From cf2dc12546a4676e4a0b72894aed53c566f8b744 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Fri, 23 Oct 2020 17:08:43 -0700 Subject: [PATCH 1/5] refactor(ui-shell): remove redundant conditional in HeaderGlobalAction --- src/UIShell/HeaderGlobalAction.svelte | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/UIShell/HeaderGlobalAction.svelte b/src/UIShell/HeaderGlobalAction.svelte index bfb4be76..18d442b9 100644 --- a/src/UIShell/HeaderGlobalAction.svelte +++ b/src/UIShell/HeaderGlobalAction.svelte @@ -27,8 +27,6 @@ on:click > - {#if icon} - - {/if} + From 8950920a10d4364df414d47fc6cb502de3e744ae Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Sat, 24 Oct 2020 14:31:40 -0700 Subject: [PATCH 2/5] fix(ui-shell): initialize platformName as empty string Prevents "undefined" from being rendered. --- COMPONENT_INDEX.md | 2 +- docs/src/PUBLIC_API.json | 94 ++++++++++---------------- src/UIShell/GlobalHeader/Header.svelte | 4 +- types/index.d.ts | 1 + 4 files changed, 40 insertions(+), 61 deletions(-) diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md index a9e89fed..0007c7ab 100644 --- a/COMPONENT_INDEX.md +++ b/COMPONENT_INDEX.md @@ -1737,7 +1737,7 @@ import { Header } from "carbon-components-svelte"; | uiShellAriaLabel | string | -- | Specify the ARIA label for the header. | | href | string | -- | Specify the `href` attribute. | | company | string | -- | Specify the company name. | -| platformName | string | -- | Specify the platform name. Alternatively, use the named slot "platform" (e.g. <span slot="platform">...</span>). | +| platformName | string | `""` | Specify the platform name. Alternatively, use the named slot "platform" (e.g. <span slot="platform">...</span>). | | ref | null | HTMLAnchorElement | `null` | Obtain a reference to the HTML anchor element. | ### Slots diff --git a/docs/src/PUBLIC_API.json b/docs/src/PUBLIC_API.json index 69ad6c2a..950b5838 100644 --- a/docs/src/PUBLIC_API.json +++ b/docs/src/PUBLIC_API.json @@ -5361,6 +5361,7 @@ "platformName", { "kind": "let", + "value": "\"\"", "type": "string", "description": "Specify the platform name\nAlternatively, use the named slot \"platform\" (e.g. ...)" } @@ -5381,14 +5382,14 @@ { "attributes": [ { - "start": 1398, - "end": 1420, + "start": 1394, + "end": 1416, "type": "Attribute", "name": "name", "value": [ { - "start": 1404, - "end": 1419, + "start": 1400, + "end": 1415, "type": "Text", "raw": "skip-to-content", "data": "skip-to-content" @@ -5406,14 +5407,14 @@ { "attributes": [ { - "start": 1740, - "end": 1755, + "start": 1736, + "end": 1751, "type": "Attribute", "name": "name", "value": [ { - "start": 1746, - "end": 1754, + "start": 1742, + "end": 1750, "type": "Text", "raw": "platform", "data": "platform" @@ -5423,13 +5424,13 @@ ], "children": [ { - "start": 1756, - "end": 1770, + "start": 1752, + "end": 1766, "type": "MustacheTag", "expression": { "type": "Identifier", - "start": 1757, - "end": 1769, + "start": 1753, + "end": 1765, "loc": { "start": { "line": 72, @@ -5462,8 +5463,8 @@ [ "click", { - "start": 1614, - "end": 1622, + "start": 1610, + "end": 1618, "type": "EventHandler", "name": "click", "modifiers": [], @@ -5743,61 +5744,38 @@ }, { "start": 608, - "end": 669, - "type": "IfBlock", + "end": 642, + "type": "InlineComponent", + "name": "svelte:component", + "attributes": [], + "children": [], "expression": { "type": "Identifier", - "start": 613, - "end": 617, + "start": 633, + "end": 637, "loc": { "start": { "line": 30, - "column": 9 + "column": 29 }, "end": { "line": 30, - "column": 13 + "column": 33 } }, "name": "icon" - }, - "children": [ - { - "start": 625, - "end": 659, - "type": "InlineComponent", - "name": "svelte:component", - "attributes": [], - "children": [], - "expression": { - "type": "Identifier", - "start": 650, - "end": 654, - "loc": { - "start": { - "line": 31, - "column": 31 - }, - "end": { - "line": 31, - "column": 35 - } - }, - "name": "icon" - } - } - ] + } }, { - "start": 669, - "end": 672, + "start": 642, + "end": 645, "type": "Text", "raw": "\n ", "data": "\n " } ], "default": true, - "default_value": "\n \n{#if icon}\n \n {/if}\n\n \n" + "default_value": "\n \n\n\n \n" } ] ], @@ -13425,8 +13403,8 @@ [ "click", { - "start": 25, - "end": 33, + "start": 21, + "end": 29, "type": "EventHandler", "name": "click", "modifiers": [], @@ -13436,8 +13414,8 @@ [ "mouseover", { - "start": 36, - "end": 48, + "start": 30, + "end": 42, "type": "EventHandler", "name": "mouseover", "modifiers": [], @@ -13447,8 +13425,8 @@ [ "mouseenter", { - "start": 51, - "end": 64, + "start": 43, + "end": 56, "type": "EventHandler", "name": "mouseenter", "modifiers": [], @@ -13458,8 +13436,8 @@ [ "mouseleave", { - "start": 67, - "end": 80, + "start": 57, + "end": 70, "type": "EventHandler", "name": "mouseleave", "modifiers": [], diff --git a/src/UIShell/GlobalHeader/Header.svelte b/src/UIShell/GlobalHeader/Header.svelte index 2fd088e9..6c27ad17 100644 --- a/src/UIShell/GlobalHeader/Header.svelte +++ b/src/UIShell/GlobalHeader/Header.svelte @@ -32,9 +32,9 @@ /** * Specify the platform name * Alternatively, use the named slot "platform" (e.g. ...) - * @type {string} [platformName] + * @type {string} [platformName=""] */ - export let platformName = undefined; + export let platformName = ""; /** * Obtain a reference to the HTML anchor element diff --git a/types/index.d.ts b/types/index.d.ts index ecf17c21..0a0c468b 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1683,6 +1683,7 @@ export class Header extends CarbonSvelteComponent { /** * Specify the platform name * Alternatively, use the named slot "platform" (e.g. ...) + * @default "" */ platformName?: string; From 392fc452e20cbe61d352e46fd64171b3c72a9fb8 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Sat, 24 Oct 2020 14:43:57 -0700 Subject: [PATCH 3/5] fix: allow numbers as item ids for ComboBox, Dropdown, MultiSelect --- src/ComboBox/ComboBox.svelte | 2 +- src/Dropdown/Dropdown.svelte | 2 +- src/MultiSelect/MultiSelect.svelte | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ComboBox/ComboBox.svelte b/src/ComboBox/ComboBox.svelte index ba3fc0c8..e4fe96f9 100644 --- a/src/ComboBox/ComboBox.svelte +++ b/src/ComboBox/ComboBox.svelte @@ -285,7 +285,7 @@ {#if open} - {#each filteredItems as item, i (item.id || i)} + {#each filteredItems as item, i (item.id)} {#if open} - {#each items as item, i (item.id || i)} + {#each items as item, i (item.id)} {#if open} - {#each filterable ? filteredItems : sortedItems as item, i (item.id || i)} + {#each filterable ? filteredItems : sortedItems as item, i (item.id)} Date: Sat, 24 Oct 2020 14:44:15 -0700 Subject: [PATCH 4/5] docs(accordion): add missing p tag --- docs/src/pages/components/Accordion.svx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/src/pages/components/Accordion.svx b/docs/src/pages/components/Accordion.svx index 9a653bd9..eabc4972 100644 --- a/docs/src/pages/components/Accordion.svx +++ b/docs/src/pages/components/Accordion.svx @@ -18,7 +18,7 @@ components: ["Accordion", "AccordionItem", "AccordionSkeleton"]

- Analyze text to extract meta-data from content such as concepts, entities, emotion, relations, sentiment and more. +

Analyze text to extract meta-data from content such as concepts, entities, emotion, relations, sentiment and more.

Translate text, documents, and websites from one language to another. Create industry or region-specific translations via the service's customization capability.

@@ -33,7 +33,7 @@ components: ["Accordion", "AccordionItem", "AccordionSkeleton"]

- Analyze text to extract meta-data from content such as concepts, entities, emotion, relations, sentiment and more. +

Analyze text to extract meta-data from content such as concepts, entities, emotion, relations, sentiment and more.

Translate text, documents, and websites from one language to another. Create industry or region-specific translations via the service's customization capability.

@@ -56,7 +56,7 @@ components: ["Accordion", "AccordionItem", "AccordionSkeleton"]
Natural Language Understanding
AI / Machine Learning
- Analyze text to extract meta-data from content such as concepts, entities, emotion, relations, sentiment and more. +

Analyze text to extract meta-data from content such as concepts, entities, emotion, relations, sentiment and more.

@@ -75,7 +75,7 @@ components: ["Accordion", "AccordionItem", "AccordionSkeleton"]

- Analyze text to extract meta-data from content such as concepts, entities, emotion, relations, sentiment and more. +

Analyze text to extract meta-data from content such as concepts, entities, emotion, relations, sentiment and more.

Translate text, documents, and websites from one language to another. Create industry or region-specific translations via the service's customization capability.

@@ -90,7 +90,7 @@ components: ["Accordion", "AccordionItem", "AccordionSkeleton"]

- Analyze text to extract meta-data from content such as concepts, entities, emotion, relations, sentiment and more. +

Analyze text to extract meta-data from content such as concepts, entities, emotion, relations, sentiment and more.

Translate text, documents, and websites from one language to another. Create industry or region-specific translations via the service's customization capability.

@@ -105,7 +105,7 @@ components: ["Accordion", "AccordionItem", "AccordionSkeleton"]

- Analyze text to extract meta-data from content such as concepts, entities, emotion, relations, sentiment and more. +

Analyze text to extract meta-data from content such as concepts, entities, emotion, relations, sentiment and more.

Translate text, documents, and websites from one language to another. Create industry or region-specific translations via the service's customization capability.

@@ -120,7 +120,7 @@ components: ["Accordion", "AccordionItem", "AccordionSkeleton"]

- Analyze text to extract meta-data from content such as concepts, entities, emotion, relations, sentiment and more. +

Analyze text to extract meta-data from content such as concepts, entities, emotion, relations, sentiment and more.

Translate text, documents, and websites from one language to another. Create industry or region-specific translations via the service's customization capability.

@@ -135,7 +135,7 @@ components: ["Accordion", "AccordionItem", "AccordionSkeleton"]

- Analyze text to extract meta-data from content such as concepts, entities, emotion, relations, sentiment and more. +

Analyze text to extract meta-data from content such as concepts, entities, emotion, relations, sentiment and more.

Translate text, documents, and websites from one language to another. Create industry or region-specific translations via the service's customization capability.

From 626a1da8b00dfcbd15189258bcaae1a4220bca81 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Sat, 24 Oct 2020 15:20:04 -0700 Subject: [PATCH 5/5] docs: remove flaky iframe on:load behavior --- docs/src/components/Preview.svelte | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/docs/src/components/Preview.svelte b/docs/src/components/Preview.svelte index f608f59f..a241d062 100644 --- a/docs/src/components/Preview.svelte +++ b/docs/src/components/Preview.svelte @@ -4,18 +4,11 @@ export let src = ""; export let framed = false; - import { CodeSnippet, Button, InlineLoading } from "carbon-components-svelte"; + import { CodeSnippet, Button } from "carbon-components-svelte"; import Launch16 from "carbon-icons-svelte/lib/Launch16"; import copy from "clipboard-copy"; import { url, beforeUrlChange } from "@sveltech/routify"; import { theme } from "../store"; - - let success = false; - - $beforeUrlChange(() => { - if (success) success = false; - return true; - });