diff --git a/src/components/@types/global.ts b/src/components/@types/global.ts index e76ba307..e07b0b5e 100644 --- a/src/components/@types/global.ts +++ b/src/components/@types/global.ts @@ -9,7 +9,7 @@ export type ContainerWidth = 'narrower' | 'narrow' | 'normal' | 'wide' | 'wider' * A step in the Scroller component. */ export interface ScrollerStep { - altText: string; + altText?: string; /** * A background component * @required diff --git a/src/components/Scroller/Embedded/Foreground.svelte b/src/components/Scroller/Embedded/Foreground.svelte index ae3b6c37..2348574a 100644 --- a/src/components/Scroller/Embedded/Foreground.svelte +++ b/src/components/Scroller/Embedded/Foreground.svelte @@ -13,7 +13,9 @@
{#if typeof step.altText === 'string'} -

{step.altText}

+
+ {@html marked.parse(step.altText)} +
{/if} {:else if typeof step.foreground === 'string'} @@ -22,7 +24,9 @@ {#if typeof step.altText === 'string'} -

{step.altText}

+
+ {@html marked.parse(step.altText)} +
{/if}
{:else} diff --git a/src/components/Scroller/Foreground.svelte b/src/components/Scroller/Foreground.svelte index a74e990b..3fbab04f 100644 --- a/src/components/Scroller/Foreground.svelte +++ b/src/components/Scroller/Foreground.svelte @@ -12,7 +12,9 @@
{#if typeof step.altText === 'string'} -

{step.altText}

+
+ {@html marked.parse(step.altText)} +
{/if} {:else}
@@ -26,7 +28,9 @@ {/if}
{#if typeof step.altText === 'string'} -

{step.altText}

+
+ {@html marked.parse(step.altText)} +
{/if} {/if} diff --git a/src/components/Scroller/docProps.ts b/src/components/Scroller/docProps.ts index e16fec25..aa8cba51 100644 --- a/src/components/Scroller/docProps.ts +++ b/src/components/Scroller/docProps.ts @@ -1,7 +1,7 @@ import type { ComponentType } from 'svelte'; interface BlockStep { - AltText: string; + AltText?: string; Background: string; Text: string; } diff --git a/src/components/Scroller/stories/docs/ai2svelte.md b/src/components/Scroller/stories/docs/ai2svelte.md index 5bead0e3..e7217632 100644 --- a/src/components/Scroller/stories/docs/ai2svelte.md +++ b/src/components/Scroller/stories/docs/ai2svelte.md @@ -52,19 +52,21 @@ Step1Text: #### Step 1 Lorem Ipsum :end AltText1: A map showing the Upper West side in New York City. +:end Step2Text: #### Step 2 Lorem Ipsum :end AltText2: The same map now highlights 98th Street. +:end Step3Text: #### Step 3 Lorem Ipsum :end AltText3: The same map now highlights three locations near 98th Street where something particulary important happened. - +:end ``` ```svelte diff --git a/src/components/Scroller/stories/docs/quickit.md b/src/components/Scroller/stories/docs/quickit.md index b6b02189..214ac5a7 100644 --- a/src/components/Scroller/stories/docs/quickit.md +++ b/src/components/Scroller/stories/docs/quickit.md @@ -37,12 +37,16 @@ StackBackground: true :end AltText: A map showing the Upper West side in New York City. + Can add paragraphs of alt text if you want to break up sentences. + :end + Background: AiMap2 Text: #### Step 2 Lorem ipsum :end AltText: The same map now highlights 98th Street. + :end Background: AiMap3 Text: #### Step 3 @@ -50,7 +54,7 @@ StackBackground: true Lorem ipsum :end AltText: The same map now highlights three locations near 98th Street where something particulary important happened. - + :end [] ```