diff --git a/docs/src/lib/auto-notes.ts b/docs/src/lib/auto-notes.ts new file mode 100644 index 000000000..4a539a79a --- /dev/null +++ b/docs/src/lib/auto-notes.ts @@ -0,0 +1,20 @@ +export type Note = { + text: string; /* the text of the note */ + search?: string | RegExp; /* default '' - diplays for any source */ + layers?: ('svg' | 'canvas' | 'html')[]; /* default [] = shows for all layers */ + type?: 'basic' | 'note' | 'tip' | 'warning' | 'caution'; /* default 'warning' */ +}; + +export const autoNotes: Note[] = [ + // { + // text: 'your source include the word "createDateSeries" and your layer is "canvas"', + // search: '/createDateSeries/', + // layers: ['canvas'], + // type: 'caution' + // }, + // { + // text: 'your source include the word "integer" and your layer is "canvas"', + // search: '/integer/', + // layers: ['canvas'] + // } +]; diff --git a/docs/src/lib/components/AutoNotes.svelte b/docs/src/lib/components/AutoNotes.svelte new file mode 100644 index 000000000..5b5a9ffbf --- /dev/null +++ b/docs/src/lib/components/AutoNotes.svelte @@ -0,0 +1,33 @@ + + +{#each notes as { text, type }, i (i)} +
+
+

{text}

+
+
+{/each} diff --git a/docs/src/lib/components/Blockquote.svelte b/docs/src/lib/components/Blockquote.svelte index 76852e623..e089b082e 100644 --- a/docs/src/lib/components/Blockquote.svelte +++ b/docs/src/lib/components/Blockquote.svelte @@ -1,17 +1,65 @@
a]:font-medium [&>a]:underline [&>a]:decoration-dashed [&>a]:decoration-primary/50 [&>a]:underline-offset-2' + 'border border-l-[6px] px-4 py-2 my-4 rounded-sm flex items-center gap-2 text-sm', + '[&>a]:font-medium [&>a]:underline [&>a]:decoration-dashed [&>a]:underline-offset-2', + classes.container )} > - + {#if type === 'note'} + {:else if type === 'tip'} + {:else if type === 'warning'} + {:else if type === 'caution'} + {:else} + {/if} {@render children()}
diff --git a/docs/src/lib/components/Example.svelte b/docs/src/lib/components/Example.svelte index 62ae649af..faf5e07bf 100644 --- a/docs/src/lib/components/Example.svelte +++ b/docs/src/lib/components/Example.svelte @@ -38,6 +38,7 @@ getChartSvgString, getSettings } from 'layerchart'; + import AutoNotes from './AutoNotes.svelte'; const settings = getSettings(); import { movable } from '$lib/actions/movable'; @@ -439,6 +440,7 @@ /> {/if} + (pngDialogOpen = false)} class="max-w-md">
{pngAction === 'copy' ? 'Copy as PNG' : 'Export as PNG'}