diff --git a/src/lib/components/AlignButton.svelte b/src/lib/components/AlignButton.svelte index 533055d..48db38a 100644 --- a/src/lib/components/AlignButton.svelte +++ b/src/lib/components/AlignButton.svelte @@ -1,11 +1,12 @@ + + diff --git a/src/lib/components/StyleManagerDialog.svelte b/src/lib/components/StyleManagerDialog.svelte new file mode 100644 index 0000000..d735edb --- /dev/null +++ b/src/lib/components/StyleManagerDialog.svelte @@ -0,0 +1,470 @@ + + + (open = false)} + onclick={(e) => { if (e.target === dialogEl) open = false; }} + aria-label={t().styles.title} +> +
+
+

{t().styles.title}

+ +
+ +
+
    + {#each rows as { style: s, depth } (s.name)} +
  • + +
  • + {/each} +
+ +
+ +
{style.name}
+ + + + + +
+ + +
+ +
+ + + + +
+ +
+ {t().styles.alignment} +
+ {#each ALIGNMENTS as a} + + {/each} +
+
+ +
+ + + +
+
+
+ + +
+
+ + diff --git a/src/lib/components/Toolbar.svelte b/src/lib/components/Toolbar.svelte index f1e84e8..3de9b91 100644 --- a/src/lib/components/Toolbar.svelte +++ b/src/lib/components/Toolbar.svelte @@ -9,6 +9,7 @@ import { blockStyleName } from '../editor/extensions/paragraphStyle'; import { DEFAULT_STYLE, resolveStyle, styleOrder } from '../styles/styleSheet'; import { styleSheet } from '../styles/sheet.svelte'; + import StyleManagerDialog from './StyleManagerDialog.svelte'; import { t } from '../i18n/i18n.svelte'; import { withShortcut } from '../i18n/shortcut'; @@ -42,6 +43,7 @@ } let stylesOpen = $state(false); + let managerOpen = $state(false); // $derived re-evaluates whenever `tick` changes (i.e. on every TipTap transaction) let isHeading = $derived(tick >= 0 && !!editor?.isActive('heading')); @@ -209,6 +211,9 @@ {styleLabel(s.name)} {/each} + {/if} @@ -341,6 +346,8 @@ {/if} + +