@damiro/stylo 0.15.1 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/{InPlaceView-BLlGJ9mh.js → InPlaceView-CC5hZCcI.js} +787 -750
  2. package/dist/InPlaceView-CC5hZCcI.js.map +1 -0
  3. package/dist/Preview-5lm2uUVj.js +319 -0
  4. package/dist/Preview-5lm2uUVj.js.map +1 -0
  5. package/dist/Stylo.d.ts.map +1 -1
  6. package/dist/editor/useCodeMirror.d.ts.map +1 -1
  7. package/dist/embed-DKKeCE1Y.js +109 -0
  8. package/dist/embed-DKKeCE1Y.js.map +1 -0
  9. package/dist/embed-cache-CcBfVrc9.js +176 -0
  10. package/dist/embed-cache-CcBfVrc9.js.map +1 -0
  11. package/dist/inplace/context-menu-helpers.d.ts +3 -4
  12. package/dist/inplace/context-menu-helpers.d.ts.map +1 -1
  13. package/dist/inplace/decorate.d.ts.map +1 -1
  14. package/dist/inplace/edit-line-prefix.d.ts.map +1 -1
  15. package/dist/inplace/embed.d.ts.map +1 -1
  16. package/dist/inplace/extension.d.ts.map +1 -1
  17. package/dist/inplace/inline-md.d.ts.map +1 -1
  18. package/dist/inplace/link-row.d.ts +14 -13
  19. package/dist/inplace/link-row.d.ts.map +1 -1
  20. package/dist/inplace/list-guides.d.ts.map +1 -1
  21. package/dist/inplace/math.d.ts +18 -3
  22. package/dist/inplace/math.d.ts.map +1 -1
  23. package/dist/inplace/table-widget-keys.d.ts +46 -0
  24. package/dist/inplace/table-widget-keys.d.ts.map +1 -0
  25. package/dist/inplace/table-widget.d.ts +1 -2
  26. package/dist/inplace/table-widget.d.ts.map +1 -1
  27. package/dist/inplace/tables.d.ts.map +1 -1
  28. package/dist/inplace/wikilinks.d.ts +1 -1
  29. package/dist/inplace/wikilinks.d.ts.map +1 -1
  30. package/dist/render/Embed.d.ts.map +1 -1
  31. package/dist/render/Preview.d.ts.map +1 -1
  32. package/dist/render/embed-cache.d.ts +13 -0
  33. package/dist/render/embed-cache.d.ts.map +1 -1
  34. package/dist/render/preview-components.d.ts +22 -0
  35. package/dist/render/preview-components.d.ts.map +1 -0
  36. package/dist/render/remark-wikilink.d.ts.map +1 -1
  37. package/dist/render/taskCheckbox.d.ts +30 -0
  38. package/dist/render/taskCheckbox.d.ts.map +1 -1
  39. package/dist/styles.css +1 -1
  40. package/dist/stylo.js +208 -196
  41. package/dist/stylo.js.map +1 -1
  42. package/dist/toolbar/Toolbar.d.ts.map +1 -1
  43. package/dist/toolbar/command-helpers.d.ts +27 -0
  44. package/dist/toolbar/command-helpers.d.ts.map +1 -1
  45. package/dist/toolbar/heading.d.ts +3 -0
  46. package/dist/toolbar/heading.d.ts.map +1 -1
  47. package/dist/toolbar/inline-ops.d.ts +6 -0
  48. package/dist/toolbar/inline-ops.d.ts.map +1 -1
  49. package/dist/toolbar/table.d.ts.map +1 -1
  50. package/dist/types/core.d.ts +200 -0
  51. package/dist/types/core.d.ts.map +1 -0
  52. package/dist/types/inplace.d.ts +91 -0
  53. package/dist/types/inplace.d.ts.map +1 -0
  54. package/dist/types/sources.d.ts +66 -0
  55. package/dist/types/sources.d.ts.map +1 -0
  56. package/dist/types/toolbar.d.ts +72 -0
  57. package/dist/types/toolbar.d.ts.map +1 -0
  58. package/dist/types.d.ts +11 -406
  59. package/dist/types.d.ts.map +1 -1
  60. package/dist/{useCodeMirror-QmbR0rQM.js → useCodeMirror-TAWSJQiZ.js} +345 -304
  61. package/dist/useCodeMirror-TAWSJQiZ.js.map +1 -0
  62. package/package.json +1 -1
  63. package/dist/InPlaceView-BLlGJ9mh.js.map +0 -1
  64. package/dist/Preview-DKOoZ-vr.js +0 -295
  65. package/dist/Preview-DKOoZ-vr.js.map +0 -1
  66. package/dist/embed-Dsu6b-MV.js +0 -131
  67. package/dist/embed-Dsu6b-MV.js.map +0 -1
  68. package/dist/highlight-BLVSvron.js +0 -133
  69. package/dist/highlight-BLVSvron.js.map +0 -1
  70. package/dist/inplace/table-widget-caret.d.ts +0 -11
  71. package/dist/inplace/table-widget-caret.d.ts.map +0 -1
  72. package/dist/useCodeMirror-QmbR0rQM.js.map +0 -1
package/dist/styles.css CHANGED
@@ -1,2 +1,2 @@
1
- ._root_mypuk_1{min-height:0;color:var(--stylo-text);background:var(--stylo-bg);border:1px solid var(--stylo-border);border-radius:var(--stylo-radius);flex-direction:column;display:flex;overflow:hidden}._root_mypuk_1 .cm-scroller{scrollbar-width:thin;scrollbar-color:color-mix(in srgb, var(--stylo-border) 90%, transparent) transparent}._root_mypuk_1 .cm-scroller::-webkit-scrollbar{width:10px;height:10px}._root_mypuk_1 .cm-scroller::-webkit-scrollbar-thumb{background:color-mix(in srgb, var(--stylo-border) 90%, transparent);background-clip:padding-box;border:3px solid #0000;border-radius:6px}._root_mypuk_1 .cm-scroller::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb, var(--stylo-text-muted) 55%, transparent);background-clip:padding-box}._root_mypuk_1 .cm-scroller::-webkit-scrollbar-corner{background:0 0}._source_mypuk_42{flex:auto;min-height:0;overflow:auto}._source_mypuk_42 .cm-editor{height:100%}._source_mypuk_42 .cm-editor.cm-focused{outline:2px solid var(--stylo-ring);outline-offset:-2px}._inplace_mypuk_57{flex:auto;min-height:0;overflow:auto}._toolbar_mypuk_63{background:var(--stylo-bg);border-bottom:1px solid var(--stylo-border);flex-wrap:wrap;align-items:center;gap:2px;padding:4px 6px;display:flex}._toolbarGroup_mypuk_75{align-items:center;gap:2px;display:flex}._toolbarButton_mypuk_81{box-sizing:border-box;border-radius:calc(var(--stylo-radius) - 3px);min-width:28px;height:28px;color:var(--stylo-text-muted);font:inherit;cursor:pointer;background:0 0;border:0;justify-content:center;align-items:center;padding:0 5px;font-size:.75rem;font-weight:600;line-height:1;display:inline-flex}._toolbarButton_mypuk_81:hover:not(:disabled){background:color-mix(in srgb, var(--stylo-border) 45%, transparent);color:var(--stylo-text)}._toolbarButton_mypuk_81[data-active]{background:color-mix(in srgb, var(--stylo-accent) 12%, transparent);color:var(--stylo-text)}._toolbarButton_mypuk_81:disabled{opacity:.4;cursor:default}._toolbarButton_mypuk_81:focus-visible{outline:2px solid var(--stylo-ring);outline-offset:-2px}._toolbarButton_mypuk_81 svg{width:16px;height:16px;display:block}._toolbarButton_mypuk_81 code{font-family:var(--stylo-font-family-mono,ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-size:.8125rem;font-weight:500}._toolbarSep_mypuk_140{background:var(--stylo-border);align-self:stretch;width:1px;margin:4px 3px}._toolbarSticky_mypuk_150{z-index:50;-webkit-overflow-scrolling:touch;scrollbar-width:none;font-family:var(--stylo-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);flex-wrap:nowrap;transition:opacity .15s;overflow-x:auto}._toolbarSticky_mypuk_150::-webkit-scrollbar{display:none}._toolbarSticky_mypuk_150 ._toolbarButton_mypuk_81{flex:none;min-width:40px;height:40px}._toolbarStickyBottom_mypuk_150{border-bottom:none;border-top:1px solid var(--stylo-border);box-shadow:0 -2px 8px color-mix(in srgb, var(--stylo-text) 10%, transparent);position:fixed;bottom:0;left:0;right:0}._toolbarStickyTop_mypuk_150{box-shadow:0 2px 8px color-mix(in srgb, var(--stylo-text) 10%, transparent);position:fixed;top:0;left:0;right:0}._toolbarStickyHidden_mypuk_219{opacity:0;pointer-events:none}._stickyToolbarRootBottom_mypuk_230 ._source_mypuk_42,._stickyToolbarRootBottom_mypuk_230 ._inplace_mypuk_57{padding-bottom:52px}._stickyToolbarRootTop_mypuk_235 ._source_mypuk_42,._stickyToolbarRootTop_mypuk_235 ._inplace_mypuk_57{padding-top:52px}._inplace_mypuk_57 .cm-editor{height:100%}._inplace_mypuk_57 .cm-editor.cm-focused{outline:2px solid var(--stylo-ring);outline-offset:-2px}._split_mypuk_249{flex:1;grid-template-columns:1fr 1fr;min-height:0;display:grid}._splitPane_mypuk_256{box-sizing:border-box;flex-direction:column;min-height:0;display:flex;overflow:auto}._splitPane_mypuk_256+._splitPane_mypuk_256{border-left:1px solid var(--stylo-border)}._splitPane_mypuk_256>._source_mypuk_42{flex:1;min-height:0}._preview_mypuk_282{min-height:0;font-size:var(--stylo-font-size,.9375rem);overflow-wrap:break-word;flex:auto;padding:.8em 1.06667em;line-height:1.75;overflow:auto}._preview_mypuk_282>:first-child{margin-top:0}._preview_mypuk_282>:last-child{margin-bottom:0}._preview_mypuk_282 :is(h1,h2,h3,h4,h5,h6){font-weight:600}._preview_mypuk_282 h1{font-size:var(--stylo-rhythm-h1-size,2.25em);line-height:var(--stylo-rhythm-h1-line,1.11111);margin:0 0 .888889em}._preview_mypuk_282 h2{font-size:var(--stylo-rhythm-h2-size,1.5em);line-height:var(--stylo-rhythm-h2-line,1.33333);margin:2em 0 1em}._preview_mypuk_282 h3{font-size:var(--stylo-rhythm-h3-size,1.25em);line-height:var(--stylo-rhythm-h3-line,1.6);margin:1.6em 0 .6em}._preview_mypuk_282 :is(h4,h5,h6){line-height:var(--stylo-rhythm-h4-line,1.5);margin:1.5em 0 .5em}._preview_mypuk_282 h4{font-size:var(--stylo-rhythm-h4-size,1em)}._preview_mypuk_282 h5{font-size:var(--stylo-rhythm-h5-size,.9em)}._preview_mypuk_282 h6{font-size:var(--stylo-rhythm-h6-size,.9em)}._preview_mypuk_282 p{margin:1.25em 0}._preview_mypuk_282 :is(ul,ol){margin:1.25em 0;padding-left:1.625em}._preview_mypuk_282 li{margin:var(--stylo-rhythm-list-item-gap,.5em) 0}._preview_mypuk_282 li>:is(ul,ol){margin:var(--stylo-rhythm-list-item-gap-nested,.75em) 0}._preview_mypuk_282 a{color:var(--stylo-link);text-decoration:none}._preview_mypuk_282 code{font-family:var(--stylo-font-family-mono,ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);border-radius:calc(var(--stylo-radius) - 3px);background:color-mix(in srgb, var(--stylo-border) 45%, transparent);padding:.1em .35em;font-size:.9em}._preview_mypuk_282 pre{border-radius:var(--stylo-radius);background:color-mix(in srgb, var(--stylo-border) 35%, transparent);white-space:var(--stylo-preview-code-white-space,pre-wrap);overflow-wrap:break-word;margin:1.71429em 0;padding:.75rem .9rem;overflow-x:auto}._preview_mypuk_282 pre code{background:0 0;padding:0;font-size:.85em}.stylo-tok-keyword{color:var(--stylo-syntax-keyword)}.stylo-tok-string{color:var(--stylo-syntax-string)}.stylo-tok-escape{color:var(--stylo-syntax-escape)}.stylo-tok-comment{color:var(--stylo-syntax-comment);font-style:italic}.stylo-tok-number{color:var(--stylo-syntax-number)}.stylo-tok-constant{color:var(--stylo-syntax-constant)}.stylo-tok-function{color:var(--stylo-syntax-function)}.stylo-tok-type{color:var(--stylo-syntax-type)}.stylo-tok-property{color:var(--stylo-syntax-property)}.stylo-tok-tag{color:var(--stylo-syntax-tag)}.stylo-tok-meta{color:var(--stylo-syntax-comment)}.stylo-tok-invalid{color:var(--stylo-syntax-invalid)}.stylo-frontmatter{border-left:3px solid var(--stylo-border);border-radius:calc(var(--stylo-radius) - 3px);background:color-mix(in srgb, var(--stylo-border) 22%, transparent);color:var(--stylo-text-muted);font-family:var(--stylo-font-family-mono,ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);white-space:pre-wrap;margin:0 0 1.2em;padding:.7rem .9rem;font-size:.8125rem;line-height:1.5;overflow-x:auto}.stylo-frontmatter:before{content:"Frontmatter";font-family:var(--stylo-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);letter-spacing:.04em;text-transform:uppercase;margin-bottom:.5em;font-size:.7rem;font-weight:600;display:block}._preview_mypuk_282 blockquote{border-left:.25rem solid var(--stylo-border);color:var(--stylo-text-muted);margin:1.6em 0;padding-left:1em}._preview_mypuk_282 .stylo-callout{padding:var(--stylo-rhythm-callout-padding-y,.7em) var(--stylo-rhythm-callout-padding-x,1rem);border-left:.25rem solid var(--stylo-callout-accent,var(--stylo-border));border-top-right-radius:var(--stylo-radius);border-bottom-right-radius:var(--stylo-radius);background:color-mix(in srgb, var(--stylo-callout-accent,var(--stylo-border)) 10%, transparent);color:var(--stylo-text);margin:1.6em 0}._preview_mypuk_282 .stylo-callout:before{content:attr(data-callout);letter-spacing:.04em;text-transform:uppercase;color:var(--stylo-callout-accent,var(--stylo-text-muted));margin-bottom:.2em;font-size:.8em;font-weight:700;display:block}._preview_mypuk_282 .stylo-callout-note{--stylo-callout-accent:var(--stylo-callout-note,#3b82f6)}._preview_mypuk_282 .stylo-callout-tip{--stylo-callout-accent:var(--stylo-callout-tip,#22c55e)}._preview_mypuk_282 .stylo-callout-warn{--stylo-callout-accent:var(--stylo-callout-warn,#f59e0b)}._preview_mypuk_282 .stylo-callout-danger{--stylo-callout-accent:var(--stylo-callout-danger,#ef4444)}._preview_mypuk_282 .stylo-callout-example{--stylo-callout-accent:var(--stylo-callout-example,#a855f7)}._preview_mypuk_282 .stylo-embed{border-left:.25rem solid var(--stylo-embed-accent,var(--stylo-border));margin:1.6em 0;padding-left:1em}._preview_mypuk_282 .stylo-embed-content>:first-child{margin-top:0}._preview_mypuk_282 .stylo-embed-content>:last-child{margin-bottom:0}._preview_mypuk_282 table{border-collapse:collapse;margin:2em 0;display:block;overflow-x:auto}._preview_mypuk_282 :is(th,td){border:1px solid var(--stylo-table-border);text-align:left;padding:.35em .6em}._preview_mypuk_282 thead th{background:var(--stylo-table-header-bg);font-weight:600}._preview_mypuk_282 tbody tr:nth-child(2n) td{background:var(--stylo-table-stripe-bg)}._preview_mypuk_282 hr{border:none;border-top:1px solid var(--stylo-border);margin:1em 0}._preview_mypuk_282 .katex-display{padding:.25em 0;overflow:auto hidden}.stylo{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--stylo-bg:#fff;--stylo-surface-floating:#fff;--stylo-text:#09090b;--stylo-text-muted:#71717a;--stylo-border:#e4e4e7;--stylo-accent:#18181b;--stylo-link:#2563eb;--stylo-ring:#a1a1aa;--stylo-radius:.5rem;--stylo-font-size:.9375rem;--stylo-font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;--stylo-font-family-mono:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;--stylo-table-border:var(--stylo-border);--stylo-table-header-bg:color-mix(in srgb, var(--stylo-border) 30%, transparent);--stylo-table-stripe-bg:transparent;--stylo-guide:var(--stylo-border);--stylo-syntax-keyword:#7c3aed;--stylo-syntax-string:#0a7c2f;--stylo-syntax-escape:#b45309;--stylo-syntax-comment:#8a8f98;--stylo-syntax-number:#b45309;--stylo-syntax-constant:#b45309;--stylo-syntax-function:#2563eb;--stylo-syntax-type:#a16207;--stylo-syntax-property:#0f766e;--stylo-syntax-tag:#cf222e;--stylo-syntax-invalid:#dc2626;--stylo-rhythm-h1-size:2.25em;--stylo-rhythm-h1-line:1.11111;--stylo-rhythm-h2-size:1.5em;--stylo-rhythm-h2-line:1.33333;--stylo-rhythm-h3-size:1.25em;--stylo-rhythm-h3-line:1.6;--stylo-rhythm-h4-size:1em;--stylo-rhythm-h4-line:1.5;--stylo-rhythm-h5-size:.9em;--stylo-rhythm-h5-line:1.5;--stylo-rhythm-h6-size:.9em;--stylo-rhythm-h6-line:1.5;--stylo-rhythm-list-item-gap:.5em;--stylo-rhythm-list-item-gap-nested:.75em;--stylo-rhythm-callout-padding-x:1rem;--stylo-rhythm-callout-padding-y:.7em}:where(.dark,[data-theme=dark]) .stylo,.stylo:where(.dark,[data-theme=dark]){--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--stylo-bg:#09090b;--stylo-surface-floating:#09090b;--stylo-text:#fafafa;--stylo-text-muted:#a1a1aa;--stylo-border:#27272a;--stylo-accent:#fafafa;--stylo-link:#60a5fa;--stylo-ring:#52525b;--stylo-syntax-keyword:#c678dd;--stylo-syntax-string:#98c379;--stylo-syntax-escape:#d19a66;--stylo-syntax-comment:#7f848e;--stylo-syntax-number:#d19a66;--stylo-syntax-constant:#d19a66;--stylo-syntax-function:#61afef;--stylo-syntax-type:#e5c07b;--stylo-syntax-property:#56b6c2;--stylo-syntax-tag:#e06c75;--stylo-syntax-invalid:#e06c75}._root_18hcd_3{color:var(--stylo-text);font:inherit;grid-template-columns:1fr 1fr;gap:12px;display:grid}@media (width<=460px){._root_18hcd_3{grid-template-columns:1fr}}._col_18hcd_17{border:1px solid var(--stylo-border);border-radius:var(--stylo-radius);background:var(--stylo-bg);flex-direction:column;min-width:0;display:flex}._colHead_18hcd_26{border-bottom:1px solid var(--stylo-border);letter-spacing:.04em;text-transform:uppercase;color:var(--stylo-text-muted);margin:0;padding:8px 12px;font-size:.75rem;font-weight:600}._list_18hcd_37{flex-direction:column;flex:1;gap:2px;margin:0;padding:4px;list-style:none;display:flex}._row_18hcd_47{border-radius:calc(var(--stylo-radius) - 3px);background:var(--stylo-bg);align-items:center;gap:8px;padding:5px 6px;display:flex}._row_18hcd_47:focus-visible{outline:2px solid var(--stylo-ring);outline-offset:-2px}._row_18hcd_47:hover{background:color-mix(in srgb, var(--stylo-border) 30%, transparent)}._row_18hcd_47[data-dragging]{background:var(--stylo-surface-floating,#fff);opacity:.9;box-shadow:0 4px 16px #00000024}._handle_18hcd_73{border-radius:calc(var(--stylo-radius) - 4px);width:20px;height:22px;color:var(--stylo-text-muted);font:inherit;cursor:grab;touch-action:none;background:0 0;border:1px solid #0000;flex:none;justify-content:center;align-items:center;padding:0;line-height:1;display:inline-flex}._handle_18hcd_73:hover{background:color-mix(in srgb, var(--stylo-border) 45%, transparent);color:var(--stylo-text)}._handle_18hcd_73:focus-visible{outline:2px solid var(--stylo-ring);outline-offset:-1px}._handle_18hcd_73:active{cursor:grabbing}._glyph_18hcd_105{width:18px;height:18px;color:var(--stylo-text-muted);flex:none;justify-content:center;align-items:center;display:inline-flex}._glyph_18hcd_105 svg{width:16px;height:16px;display:block}._label_18hcd_121{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-size:.8125rem;overflow:hidden}._rowActions_18hcd_130{flex:none;gap:2px;display:flex}._iconButton_18hcd_136,._textButton_18hcd_137{box-sizing:border-box;border-radius:calc(var(--stylo-radius) - 4px);color:var(--stylo-text-muted);font:inherit;cursor:pointer;background:0 0;border:1px solid #0000}._iconButton_18hcd_136{width:22px;height:22px;font-size:.8125rem;line-height:1}._textButton_18hcd_137{padding:3px 8px;font-size:.75rem}._iconButton_18hcd_136:hover:not(:disabled),._textButton_18hcd_137:hover:not(:disabled){background:color-mix(in srgb, var(--stylo-border) 45%, transparent);color:var(--stylo-text)}._iconButton_18hcd_136:focus-visible,._textButton_18hcd_137:focus-visible{outline:2px solid var(--stylo-ring);outline-offset:-1px}._iconButton_18hcd_136:disabled{opacity:.35;cursor:default}._footer_18hcd_176{border-top:1px solid var(--stylo-border);flex-wrap:wrap;gap:6px;padding:6px;display:flex}._empty_18hcd_184{color:var(--stylo-text-muted);padding:8px 6px;font-size:.8125rem}._srOnly_18hcd_190{clip:rect(0 0 0 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}
1
+ ._root_11vle_1{min-height:0;color:var(--stylo-text);background:var(--stylo-bg);border:1px solid var(--stylo-border);border-radius:var(--stylo-radius);flex-direction:column;display:flex;overflow:hidden}._root_11vle_1 .cm-scroller{scrollbar-width:thin;scrollbar-color:color-mix(in srgb, var(--stylo-border) 90%, transparent) transparent}._root_11vle_1 .cm-scroller::-webkit-scrollbar{width:10px;height:10px}._root_11vle_1 .cm-scroller::-webkit-scrollbar-thumb{background:color-mix(in srgb, var(--stylo-border) 90%, transparent);background-clip:padding-box;border:3px solid #0000;border-radius:6px}._root_11vle_1 .cm-scroller::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb, var(--stylo-text-muted) 55%, transparent);background-clip:padding-box}._root_11vle_1 .cm-scroller::-webkit-scrollbar-corner{background:0 0}._source_11vle_42{flex:auto;min-height:0;overflow:auto}._source_11vle_42 .cm-editor{height:100%}._source_11vle_42 .cm-editor.cm-focused{outline:2px solid var(--stylo-ring);outline-offset:-2px}._inplace_11vle_57{flex:auto;min-height:0;overflow:auto}._toolbar_11vle_63{background:var(--stylo-bg);border-bottom:1px solid var(--stylo-border);flex-wrap:wrap;align-items:center;gap:2px;padding:4px 6px;display:flex}._toolbarGroup_11vle_75{align-items:center;gap:2px;display:flex}._toolbarButton_11vle_81{box-sizing:border-box;border-radius:calc(var(--stylo-radius) - 3px);min-width:28px;height:28px;color:var(--stylo-text-muted);font:inherit;cursor:pointer;background:0 0;border:0;justify-content:center;align-items:center;padding:0 5px;font-size:.75rem;font-weight:600;line-height:1;display:inline-flex}._toolbarButton_11vle_81:hover:not(:disabled){background:color-mix(in srgb, var(--stylo-border) 45%, transparent);color:var(--stylo-text)}._toolbarButton_11vle_81[data-active]{background:color-mix(in srgb, var(--stylo-accent) 12%, transparent);color:var(--stylo-text)}._toolbarButton_11vle_81:disabled{opacity:.4;cursor:default}._toolbarButton_11vle_81:focus-visible{outline:2px solid var(--stylo-ring);outline-offset:-2px}._toolbarButton_11vle_81 svg{width:16px;height:16px;display:block}._toolbarButton_11vle_81 code{font-family:var(--stylo-font-family-mono,ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-size:.8125rem;font-weight:500}._toolbarSep_11vle_140{background:var(--stylo-border);align-self:stretch;width:1px;margin:4px 3px}._toolbarSticky_11vle_150{z-index:50;-webkit-overflow-scrolling:touch;scrollbar-width:none;font-family:var(--stylo-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);flex-wrap:nowrap;transition:opacity .15s;overflow-x:auto}._toolbarSticky_11vle_150::-webkit-scrollbar{display:none}._toolbarSticky_11vle_150 ._toolbarButton_11vle_81{flex:none;min-width:40px;height:40px}._toolbarStickyBottom_11vle_150{border-bottom:none;border-top:1px solid var(--stylo-border);box-shadow:0 -2px 8px color-mix(in srgb, var(--stylo-text) 10%, transparent);position:fixed;bottom:0;left:0;right:0}._toolbarStickyTop_11vle_150{box-shadow:0 2px 8px color-mix(in srgb, var(--stylo-text) 10%, transparent);position:fixed;top:0;left:0;right:0}._toolbarStickyHidden_11vle_219{opacity:0;pointer-events:none}._stickyToolbarRootBottom_11vle_230 ._source_11vle_42,._stickyToolbarRootBottom_11vle_230 ._inplace_11vle_57{padding-bottom:52px}._stickyToolbarRootTop_11vle_235 ._source_11vle_42,._stickyToolbarRootTop_11vle_235 ._inplace_11vle_57{padding-top:52px}._inplace_11vle_57 .cm-editor{height:100%}._inplace_11vle_57 .cm-editor.cm-focused{outline:2px solid var(--stylo-ring);outline-offset:-2px}._split_11vle_249{flex:1;grid-template-columns:1fr 1fr;min-height:0;display:grid}._splitPane_11vle_256{box-sizing:border-box;flex-direction:column;min-height:0;display:flex;overflow:auto}._splitPane_11vle_256+._splitPane_11vle_256{border-left:1px solid var(--stylo-border)}._splitPane_11vle_256>._source_11vle_42{flex:1;min-height:0}._preview_11vle_282{min-height:0;font-size:var(--stylo-font-size,.9375rem);overflow-wrap:break-word;flex:auto;padding:.8em 1.06667em;line-height:1.75;overflow:auto}._preview_11vle_282>:first-child{margin-top:0}._preview_11vle_282>:last-child{margin-bottom:0}._preview_11vle_282 :is(h1,h2,h3,h4,h5,h6){font-weight:600}._preview_11vle_282 h1{font-size:var(--stylo-rhythm-h1-size,2.25em);line-height:var(--stylo-rhythm-h1-line,1.11111);margin:0 0 .888889em}._preview_11vle_282 h2{font-size:var(--stylo-rhythm-h2-size,1.5em);line-height:var(--stylo-rhythm-h2-line,1.33333);margin:2em 0 1em}._preview_11vle_282 h3{font-size:var(--stylo-rhythm-h3-size,1.25em);line-height:var(--stylo-rhythm-h3-line,1.6);margin:1.6em 0 .6em}._preview_11vle_282 :is(h4,h5,h6){line-height:var(--stylo-rhythm-h4-line,1.5);margin:1.5em 0 .5em}._preview_11vle_282 h4{font-size:var(--stylo-rhythm-h4-size,1em)}._preview_11vle_282 h5{font-size:var(--stylo-rhythm-h5-size,.9em)}._preview_11vle_282 h6{font-size:var(--stylo-rhythm-h6-size,.9em)}._preview_11vle_282 p{margin:1.25em 0}._preview_11vle_282 :is(ul,ol){margin:1.25em 0;padding-left:1.625em}._preview_11vle_282 li{margin:var(--stylo-rhythm-list-item-gap,.5em) 0}._preview_11vle_282 li>:is(ul,ol){margin:var(--stylo-rhythm-list-item-gap-nested,.75em) 0}._preview_11vle_282 a{color:var(--stylo-link);text-decoration:none}._preview_11vle_282 code{font-family:var(--stylo-font-family-mono,ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);border-radius:calc(var(--stylo-radius) - 3px);background:color-mix(in srgb, var(--stylo-border) 45%, transparent);padding:.1em .35em;font-size:.9em}._preview_11vle_282 pre{border-radius:var(--stylo-radius);background:color-mix(in srgb, var(--stylo-border) 35%, transparent);white-space:var(--stylo-preview-code-white-space,pre-wrap);overflow-wrap:break-word;margin:1.71429em 0;padding:.75rem .9rem;overflow-x:auto}._preview_11vle_282 pre code{background:0 0;padding:0;font-size:.85em}.stylo-tok-keyword{color:var(--stylo-syntax-keyword)}.stylo-tok-string{color:var(--stylo-syntax-string)}.stylo-tok-escape{color:var(--stylo-syntax-escape)}.stylo-tok-comment{color:var(--stylo-syntax-comment);font-style:italic}.stylo-tok-number{color:var(--stylo-syntax-number)}.stylo-tok-constant{color:var(--stylo-syntax-constant)}.stylo-tok-function{color:var(--stylo-syntax-function)}.stylo-tok-type{color:var(--stylo-syntax-type)}.stylo-tok-property{color:var(--stylo-syntax-property)}.stylo-tok-tag{color:var(--stylo-syntax-tag)}.stylo-tok-meta{color:var(--stylo-syntax-comment)}.stylo-tok-invalid{color:var(--stylo-syntax-invalid)}.stylo-frontmatter{border-left:3px solid var(--stylo-border);border-radius:calc(var(--stylo-radius) - 3px);background:color-mix(in srgb, var(--stylo-border) 22%, transparent);color:var(--stylo-text-muted);font-family:var(--stylo-font-family-mono,ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);white-space:pre-wrap;margin:0 0 1.2em;padding:.7rem .9rem;font-size:.8125rem;line-height:1.5;overflow-x:auto}.stylo-frontmatter:before{content:"Frontmatter";font-family:var(--stylo-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);letter-spacing:.04em;text-transform:uppercase;margin-bottom:.5em;font-size:.7rem;font-weight:600;display:block}._preview_11vle_282 blockquote{border-left:.25rem solid var(--stylo-border);color:var(--stylo-text-muted);margin:1.6em 0;padding-left:1em}._preview_11vle_282 .stylo-callout{padding:var(--stylo-rhythm-callout-padding-y,.7em) var(--stylo-rhythm-callout-padding-x,1rem);border-left:.25rem solid var(--stylo-callout-accent,var(--stylo-border));border-top-right-radius:var(--stylo-radius);border-bottom-right-radius:var(--stylo-radius);background:color-mix(in srgb, var(--stylo-callout-accent,var(--stylo-border)) 10%, transparent);color:var(--stylo-text);margin:1.6em 0}._preview_11vle_282 .stylo-callout:before{content:attr(data-callout);letter-spacing:.04em;text-transform:uppercase;color:var(--stylo-callout-accent,var(--stylo-text-muted));margin-bottom:.2em;font-size:.8em;font-weight:700;display:block}._preview_11vle_282 .stylo-callout-note{--stylo-callout-accent:var(--stylo-callout-note,#3b82f6)}._preview_11vle_282 .stylo-callout-tip{--stylo-callout-accent:var(--stylo-callout-tip,#22c55e)}._preview_11vle_282 .stylo-callout-warn{--stylo-callout-accent:var(--stylo-callout-warn,#f59e0b)}._preview_11vle_282 .stylo-callout-danger{--stylo-callout-accent:var(--stylo-callout-danger,#ef4444)}._preview_11vle_282 .stylo-callout-example{--stylo-callout-accent:var(--stylo-callout-example,#a855f7)}._preview_11vle_282 .stylo-embed{border-left:.25rem solid var(--stylo-embed-accent,var(--stylo-border));margin:1.6em 0;padding-left:1em}._preview_11vle_282 .stylo-embed-content>:first-child{margin-top:0}._preview_11vle_282 .stylo-embed-content>:last-child{margin-bottom:0}._preview_11vle_282 .stylo-table-wrap{margin:2em 0;display:block;overflow-x:auto}._preview_11vle_282 table{border-collapse:collapse}._preview_11vle_282 :is(th,td){border:1px solid var(--stylo-table-border);text-align:left;padding:.35em .6em}._preview_11vle_282 thead th{background:var(--stylo-table-header-bg);font-weight:600}._preview_11vle_282 tbody tr:nth-child(2n) td{background:var(--stylo-table-stripe-bg)}._preview_11vle_282 hr{border:none;border-top:1px solid var(--stylo-border);margin:1em 0}._preview_11vle_282 .katex-display{padding:.25em 0;overflow:auto hidden}.stylo{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--stylo-bg:#fff;--stylo-surface-floating:#fff;--stylo-text:#09090b;--stylo-text-muted:#71717a;--stylo-border:#e4e4e7;--stylo-accent:#18181b;--stylo-link:#2563eb;--stylo-ring:#a1a1aa;--stylo-radius:.5rem;--stylo-font-size:.9375rem;--stylo-font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;--stylo-font-family-mono:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;--stylo-table-border:var(--stylo-border);--stylo-table-header-bg:color-mix(in srgb, var(--stylo-border) 30%, transparent);--stylo-table-stripe-bg:transparent;--stylo-guide:var(--stylo-border);--stylo-syntax-keyword:#7c3aed;--stylo-syntax-string:#0a7c2f;--stylo-syntax-escape:#b45309;--stylo-syntax-comment:#8a8f98;--stylo-syntax-number:#b45309;--stylo-syntax-constant:#b45309;--stylo-syntax-function:#2563eb;--stylo-syntax-type:#a16207;--stylo-syntax-property:#0f766e;--stylo-syntax-tag:#cf222e;--stylo-syntax-invalid:#dc2626;--stylo-rhythm-h1-size:2.25em;--stylo-rhythm-h1-line:1.11111;--stylo-rhythm-h2-size:1.5em;--stylo-rhythm-h2-line:1.33333;--stylo-rhythm-h3-size:1.25em;--stylo-rhythm-h3-line:1.6;--stylo-rhythm-h4-size:1em;--stylo-rhythm-h4-line:1.5;--stylo-rhythm-h5-size:.9em;--stylo-rhythm-h5-line:1.5;--stylo-rhythm-h6-size:.9em;--stylo-rhythm-h6-line:1.5;--stylo-rhythm-list-item-gap:.5em;--stylo-rhythm-list-item-gap-nested:.75em;--stylo-rhythm-callout-padding-x:1rem;--stylo-rhythm-callout-padding-y:.7em}:where(.dark,[data-theme=dark]) .stylo,.stylo:where(.dark,[data-theme=dark]){--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--stylo-bg:#09090b;--stylo-surface-floating:#09090b;--stylo-text:#fafafa;--stylo-text-muted:#a1a1aa;--stylo-border:#27272a;--stylo-accent:#fafafa;--stylo-link:#60a5fa;--stylo-ring:#52525b;--stylo-syntax-keyword:#c678dd;--stylo-syntax-string:#98c379;--stylo-syntax-escape:#d19a66;--stylo-syntax-comment:#7f848e;--stylo-syntax-number:#d19a66;--stylo-syntax-constant:#d19a66;--stylo-syntax-function:#61afef;--stylo-syntax-type:#e5c07b;--stylo-syntax-property:#56b6c2;--stylo-syntax-tag:#e06c75;--stylo-syntax-invalid:#e06c75}._root_18hcd_3{color:var(--stylo-text);font:inherit;grid-template-columns:1fr 1fr;gap:12px;display:grid}@media (width<=460px){._root_18hcd_3{grid-template-columns:1fr}}._col_18hcd_17{border:1px solid var(--stylo-border);border-radius:var(--stylo-radius);background:var(--stylo-bg);flex-direction:column;min-width:0;display:flex}._colHead_18hcd_26{border-bottom:1px solid var(--stylo-border);letter-spacing:.04em;text-transform:uppercase;color:var(--stylo-text-muted);margin:0;padding:8px 12px;font-size:.75rem;font-weight:600}._list_18hcd_37{flex-direction:column;flex:1;gap:2px;margin:0;padding:4px;list-style:none;display:flex}._row_18hcd_47{border-radius:calc(var(--stylo-radius) - 3px);background:var(--stylo-bg);align-items:center;gap:8px;padding:5px 6px;display:flex}._row_18hcd_47:focus-visible{outline:2px solid var(--stylo-ring);outline-offset:-2px}._row_18hcd_47:hover{background:color-mix(in srgb, var(--stylo-border) 30%, transparent)}._row_18hcd_47[data-dragging]{background:var(--stylo-surface-floating,#fff);opacity:.9;box-shadow:0 4px 16px #00000024}._handle_18hcd_73{border-radius:calc(var(--stylo-radius) - 4px);width:20px;height:22px;color:var(--stylo-text-muted);font:inherit;cursor:grab;touch-action:none;background:0 0;border:1px solid #0000;flex:none;justify-content:center;align-items:center;padding:0;line-height:1;display:inline-flex}._handle_18hcd_73:hover{background:color-mix(in srgb, var(--stylo-border) 45%, transparent);color:var(--stylo-text)}._handle_18hcd_73:focus-visible{outline:2px solid var(--stylo-ring);outline-offset:-1px}._handle_18hcd_73:active{cursor:grabbing}._glyph_18hcd_105{width:18px;height:18px;color:var(--stylo-text-muted);flex:none;justify-content:center;align-items:center;display:inline-flex}._glyph_18hcd_105 svg{width:16px;height:16px;display:block}._label_18hcd_121{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-size:.8125rem;overflow:hidden}._rowActions_18hcd_130{flex:none;gap:2px;display:flex}._iconButton_18hcd_136,._textButton_18hcd_137{box-sizing:border-box;border-radius:calc(var(--stylo-radius) - 4px);color:var(--stylo-text-muted);font:inherit;cursor:pointer;background:0 0;border:1px solid #0000}._iconButton_18hcd_136{width:22px;height:22px;font-size:.8125rem;line-height:1}._textButton_18hcd_137{padding:3px 8px;font-size:.75rem}._iconButton_18hcd_136:hover:not(:disabled),._textButton_18hcd_137:hover:not(:disabled){background:color-mix(in srgb, var(--stylo-border) 45%, transparent);color:var(--stylo-text)}._iconButton_18hcd_136:focus-visible,._textButton_18hcd_137:focus-visible{outline:2px solid var(--stylo-ring);outline-offset:-1px}._iconButton_18hcd_136:disabled{opacity:.35;cursor:default}._footer_18hcd_176{border-top:1px solid var(--stylo-border);flex-wrap:wrap;gap:6px;padding:6px;display:flex}._empty_18hcd_184{color:var(--stylo-text-muted);padding:8px 6px;font-size:.8125rem}._srOnly_18hcd_190{clip:rect(0 0 0 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}
2
2
  /*$vite$:1*/
package/dist/stylo.js CHANGED
@@ -1,94 +1,94 @@
1
- import { i as e, o as t } from "./highlight-BLVSvron.js";
2
- import { S as n, n as r, t as i } from "./useCodeMirror-QmbR0rQM.js";
3
- import { n as a, r as o } from "./config-DTBxVhtH.js";
4
- import { Suspense as s, forwardRef as c, lazy as l, useEffect as u, useImperativeHandle as d, useReducer as f, useRef as p, useState as m, useSyncExternalStore as h } from "react";
5
- import { EditorView as g, showPanel as _ } from "@codemirror/view";
6
- import { createPortal as v } from "react-dom";
7
- import { jsx as y, jsxs as b } from "react/jsx-runtime";
1
+ import { c as e, t, u as n } from "./embed-cache-CcBfVrc9.js";
2
+ import { g as r, k as i, l as a, n as o, t as s } from "./useCodeMirror-TAWSJQiZ.js";
3
+ import { n as c, r as l } from "./config-DTBxVhtH.js";
4
+ import { Suspense as u, forwardRef as d, lazy as f, useEffect as p, useImperativeHandle as m, useReducer as h, useRef as g, useState as _, useSyncExternalStore as v } from "react";
5
+ import { EditorView as y, showPanel as b } from "@codemirror/view";
6
+ import { createPortal as x } from "react-dom";
7
+ import { jsx as S, jsxs as C } from "react/jsx-runtime";
8
8
  //#region src/editor/SourceView.tsx
9
- var x = () => () => {}, S = () => null;
10
- function C({ value: e, onChange: r, readOnly: a, placeholder: o, codeLanguages: s, wikiLinkSource: c, tagSource: l, onResolveError: u, onSave: d, onViewChange: f, canvasHeader: g }) {
11
- let [b, C] = m(null), w = p(f);
12
- w.current = f;
13
- let T = p((e) => {
14
- C(e), w.current?.(e);
15
- }).current, E = p(g);
16
- E.current = g;
17
- let [D] = m(() => g ? new n() : null), O = h(D?.subscribe ?? x, D?.getSnapshot ?? S), [k] = m(() => D ? [_.of(D.panel)] : []), A = i({
9
+ var w = () => () => {}, T = () => null;
10
+ function E({ value: e, onChange: t, readOnly: r, placeholder: a, codeLanguages: o, wikiLinkSource: c, tagSource: l, onResolveError: u, onSave: d, onViewChange: f, canvasHeader: p }) {
11
+ let [m, h] = _(null), y = g(f);
12
+ y.current = f;
13
+ let C = g((e) => {
14
+ h(e), y.current?.(e);
15
+ }).current, E = g(p);
16
+ E.current = p;
17
+ let [D] = _(() => p ? new i() : null), O = v(D?.subscribe ?? w, D?.getSnapshot ?? T), [k] = _(() => D ? [b.of(D.panel)] : []), A = s({
18
18
  value: e,
19
- onChange: r,
20
- readOnly: a,
21
- placeholder: o,
22
- codeLanguages: s,
19
+ onChange: t,
20
+ readOnly: r,
21
+ placeholder: a,
22
+ codeLanguages: o,
23
23
  wikiLinkSource: c,
24
24
  tagSource: l,
25
25
  onResolveError: u,
26
26
  onSave: d,
27
- onViewChange: T,
27
+ onViewChange: C,
28
28
  extensions: k
29
29
  });
30
- return /* @__PURE__ */ y("div", {
31
- className: t.source,
30
+ return /* @__PURE__ */ S("div", {
31
+ className: n.source,
32
32
  ref: A,
33
- children: O && E.current && v(E.current({ view: b }), O)
33
+ children: O && E.current && x(E.current({ view: m }), O)
34
34
  });
35
35
  }
36
36
  //#endregion
37
37
  //#region src/inplace/lazyInPlace.ts
38
- var w = l(async () => ({ default: (await import("./InPlaceView-BLlGJ9mh.js")).InPlaceView })), T = l(async () => ({ default: (await import("./Preview-DKOoZ-vr.js")).Preview }));
38
+ var D = f(async () => ({ default: (await import("./InPlaceView-CC5hZCcI.js")).InPlaceView })), O = f(async () => ({ default: (await import("./Preview-5lm2uUVj.js")).Preview }));
39
39
  //#endregion
40
40
  //#region src/SplitView.tsx
41
- function E({ value: e, onChange: n, onWikiLinkClick: r, readOnly: i, placeholder: a, codeLanguages: o, wikiLinkSource: c, tagSource: l, embedSource: d, onResolveError: f, frontmatter: h, softBreaks: g, onTaskToggle: _, onSave: v, onViewChange: x, canvasHeader: S }) {
42
- let [w, E] = m(null), D = p(null), O = p(!1);
43
- return u(() => {
44
- let e = w?.scrollDOM, t = D.current;
41
+ function k({ value: e, onChange: t, onWikiLinkClick: r, readOnly: i, placeholder: a, codeLanguages: o, wikiLinkSource: s, tagSource: c, embedSource: l, onResolveError: d, frontmatter: f, softBreaks: m, onTaskToggle: h, onSave: v, onViewChange: y, canvasHeader: b }) {
42
+ let [x, w] = _(null), T = g(null), D = g(!1);
43
+ return p(() => {
44
+ let e = x?.scrollDOM, t = T.current;
45
45
  if (!e || !t) return;
46
46
  let n = (e, t) => {
47
- if (O.current) return;
47
+ if (D.current) return;
48
48
  let n = e.scrollHeight - e.clientHeight;
49
- n <= 0 || (O.current = !0, t.scrollTop = e.scrollTop / n * (t.scrollHeight - t.clientHeight), requestAnimationFrame(() => {
50
- O.current = !1;
49
+ n <= 0 || (D.current = !0, t.scrollTop = e.scrollTop / n * (t.scrollHeight - t.clientHeight), requestAnimationFrame(() => {
50
+ D.current = !1;
51
51
  }));
52
52
  }, r = () => n(e, t), i = () => n(t, e);
53
53
  return e.addEventListener("scroll", r, { passive: !0 }), t.addEventListener("scroll", i, { passive: !0 }), () => {
54
54
  e.removeEventListener("scroll", r), t.removeEventListener("scroll", i);
55
55
  };
56
- }, [w]), /* @__PURE__ */ b("div", {
57
- className: t.split,
58
- children: [/* @__PURE__ */ y("div", {
59
- className: t.splitPane,
60
- children: /* @__PURE__ */ y(C, {
56
+ }, [x]), /* @__PURE__ */ C("div", {
57
+ className: n.split,
58
+ children: [/* @__PURE__ */ S("div", {
59
+ className: n.splitPane,
60
+ children: /* @__PURE__ */ S(E, {
61
61
  value: e,
62
- onChange: n,
62
+ onChange: t,
63
63
  readOnly: i,
64
64
  placeholder: a,
65
65
  codeLanguages: o,
66
- wikiLinkSource: c,
67
- tagSource: l,
68
- onResolveError: f,
66
+ wikiLinkSource: s,
67
+ tagSource: c,
68
+ onResolveError: d,
69
69
  onSave: v,
70
70
  onViewChange: (e) => {
71
- E(e), x?.(e);
71
+ w(e), y?.(e);
72
72
  },
73
- canvasHeader: S
73
+ canvasHeader: b
74
74
  })
75
- }), /* @__PURE__ */ y("div", {
76
- className: t.splitPane,
77
- ref: D,
78
- children: /* @__PURE__ */ y(s, {
79
- fallback: /* @__PURE__ */ y("div", {
80
- className: t.preview,
75
+ }), /* @__PURE__ */ S("div", {
76
+ className: n.splitPane,
77
+ ref: T,
78
+ children: /* @__PURE__ */ S(u, {
79
+ fallback: /* @__PURE__ */ S("div", {
80
+ className: n.preview,
81
81
  "aria-busy": "true"
82
82
  }),
83
- children: /* @__PURE__ */ y(T, {
83
+ children: /* @__PURE__ */ S(O, {
84
84
  value: e,
85
85
  onWikiLinkClick: r,
86
- embedSource: d,
87
- onResolveError: f,
88
- frontmatter: h,
86
+ embedSource: l,
87
+ onResolveError: d,
88
+ frontmatter: f,
89
89
  codeLanguages: o,
90
- softBreaks: g,
91
- onTaskToggle: _
90
+ softBreaks: m,
91
+ onTaskToggle: h
92
92
  })
93
93
  })
94
94
  })]
@@ -96,8 +96,8 @@ function E({ value: e, onChange: n, onWikiLinkClick: r, readOnly: i, placeholder
96
96
  }
97
97
  //#endregion
98
98
  //#region src/toolbar/floating-watchdog.ts
99
- function D(e, t) {
100
- u(() => {
99
+ function A(e, t) {
100
+ p(() => {
101
101
  if (!t) return;
102
102
  let n = 0, r = !1, i = () => {
103
103
  let t = e.current;
@@ -108,9 +108,9 @@ function D(e, t) {
108
108
  }
109
109
  //#endregion
110
110
  //#region src/toolbar/keyboard-inset.ts
111
- function O(e) {
112
- let [t, n] = m(0);
113
- return u(() => {
111
+ function j(e) {
112
+ let [t, n] = _(0);
113
+ return p(() => {
114
114
  let t = typeof window > "u" ? null : window.visualViewport;
115
115
  if (!e || !t) {
116
116
  n(0);
@@ -124,7 +124,7 @@ function O(e) {
124
124
  }
125
125
  //#endregion
126
126
  //#region src/toolbar/Toolbar.tsx
127
- function k(e) {
127
+ function M(e) {
128
128
  let t = [], n = [];
129
129
  for (let r of e) {
130
130
  if (r !== "|") {
@@ -135,7 +135,7 @@ function k(e) {
135
135
  }
136
136
  return n.length && t.push(n), t;
137
137
  }
138
- function A(e, t) {
138
+ function N(e, t) {
139
139
  if (typeof e != "string") {
140
140
  let { id: t, icon: n, title: r, run: i, isActive: a, disabled: o } = e;
141
141
  return {
@@ -147,208 +147,220 @@ function A(e, t) {
147
147
  disabled: o
148
148
  };
149
149
  }
150
- let n = r[e];
150
+ let n = o[e];
151
151
  return n ? {
152
152
  key: e,
153
- icon: t?.[e] ?? o[e],
153
+ icon: t?.[e] ?? l[e],
154
154
  title: n.title,
155
155
  run: n.run,
156
156
  isActive: n.isActive,
157
157
  disabled: n.disabled
158
158
  } : null;
159
159
  }
160
- function j({ view: e, items: n, icons: r, disabled: i, sticky: a, stickyVisibility: o }) {
161
- let [, s] = f((e) => e + 1, 0), [c, l] = m(!1), d = O(a === "bottom"), h = p(null);
162
- D(h, a === "top"), u(() => {
160
+ function P({ view: e, items: t, icons: i, disabled: s, sticky: c, stickyVisibility: l }) {
161
+ let [, u] = h((e) => e + 1, 0), [d, f] = _(!1), m = j(c === "bottom"), v = g(null);
162
+ A(v, c === "top"), p(() => {
163
163
  if (!e) return;
164
164
  let t = e.contentDOM;
165
- l(e.hasFocus);
165
+ f(e.hasFocus);
166
166
  let n = () => {
167
- l(!0), s();
167
+ f(!0), u();
168
168
  }, r = () => {
169
- l(!1), s();
169
+ f(!1), u();
170
170
  }, i = [
171
171
  "keyup",
172
172
  "mouseup",
173
173
  "input"
174
174
  ];
175
- for (let e of i) t.addEventListener(e, s);
175
+ for (let e of i) t.addEventListener(e, u);
176
176
  return t.addEventListener("focus", n), t.addEventListener("blur", r), () => {
177
- for (let e of i) t.removeEventListener(e, s);
177
+ for (let e of i) t.removeEventListener(e, u);
178
178
  t.removeEventListener("focus", n), t.removeEventListener("blur", r);
179
179
  };
180
180
  }, [e]);
181
- let g = !!a && o === "dynamic" && !c, _ = [
182
- t.toolbar,
183
- a && t.toolbarSticky,
184
- a === "top" && t.toolbarStickyTop,
185
- a === "bottom" && t.toolbarStickyBottom,
186
- g && t.toolbarStickyHidden
187
- ].filter(Boolean).join(" "), v = a === "bottom" ? { transform: `translateY(-${d}px)` } : void 0;
188
- return /* @__PURE__ */ y("div", {
189
- ref: h,
190
- className: _,
181
+ let y = !!c && l === "dynamic" && !d, b = e ? !!r(e) : !1, x = [
182
+ n.toolbar,
183
+ c && n.toolbarSticky,
184
+ c === "top" && n.toolbarStickyTop,
185
+ c === "bottom" && n.toolbarStickyBottom,
186
+ y && n.toolbarStickyHidden
187
+ ].filter(Boolean).join(" "), C = c === "bottom" ? { transform: `translateY(-${m}px)` } : void 0;
188
+ return /* @__PURE__ */ S("div", {
189
+ ref: v,
190
+ className: x,
191
191
  role: "toolbar",
192
192
  "aria-label": "Formatting",
193
- "aria-hidden": g || void 0,
194
- style: v,
195
- children: k(n).map((n, a) => n === "|" ? /* @__PURE__ */ y("span", {
196
- className: t.toolbarSep,
193
+ "aria-hidden": y || void 0,
194
+ style: C,
195
+ children: M(t).map((t, r) => t === "|" ? /* @__PURE__ */ S("span", {
196
+ className: n.toolbarSep,
197
197
  "aria-hidden": "true"
198
- }, `sep-${a}`) : /* @__PURE__ */ y("div", {
199
- className: t.toolbarGroup,
200
- children: n.map((n) => {
201
- let a = A(n, r);
202
- if (!a) return null;
203
- let o = i || !e || !!a.disabled?.(e.state), c = !!(!o && e && a.isActive?.(e.state));
204
- return /* @__PURE__ */ y("button", {
198
+ }, `sep-${r}`) : /* @__PURE__ */ S("div", {
199
+ className: n.toolbarGroup,
200
+ children: t.map((t) => {
201
+ let r = N(t, i);
202
+ if (!r) return null;
203
+ let c = typeof t == "string" ? o[t] : void 0, l = e ? c ? a(e.state, c, b) : {
204
+ disabled: !!r.disabled?.(e.state),
205
+ active: !!r.isActive?.(e.state)
206
+ } : {
207
+ disabled: !0,
208
+ active: !1
209
+ }, d = s || !e || l.disabled, f = !d && l.active;
210
+ return /* @__PURE__ */ S("button", {
205
211
  type: "button",
206
- className: t.toolbarButton,
207
- "data-command": a.key,
208
- title: a.title,
209
- "aria-label": a.title,
210
- "aria-pressed": a.isActive ? c : void 0,
211
- "data-active": c ? "" : void 0,
212
- disabled: o,
212
+ className: n.toolbarButton,
213
+ "data-command": r.key,
214
+ title: r.title,
215
+ "aria-label": r.title,
216
+ "aria-pressed": r.isActive ? f : void 0,
217
+ "data-active": f ? "" : void 0,
218
+ disabled: d,
213
219
  onMouseDown: (e) => e.preventDefault(),
214
220
  onClick: () => {
215
- e && (a.run(e), s());
221
+ e && (r.run(e), u());
216
222
  },
217
- children: a.icon
218
- }, a.key);
223
+ children: r.icon
224
+ }, r.key);
219
225
  })
220
- }, `group-${a}`))
226
+ }, `group-${r}`))
221
227
  });
222
228
  }
223
229
  //#endregion
224
230
  //#region src/Stylo.tsx
225
- var M = c(function({ value: n, onChange: r, mode: i = "in-place", onSave: o, onFrontmatter: c, onWikiLinkClick: l, onLinkClick: f, readOnly: h, placeholder: _, className: v, inPlace: x, codeLanguages: S, wikiLinkSource: D, tagSource: O, embedSource: k, onResolveError: A, toolbar: M, icons: N, frontmatter: P, softBreaks: F, onTaskToggle: I, canvasHeader: L }, R) {
226
- let z = i === "preview" || i === "split" || i === "in-place" ? i : "source", [B, V] = m(null), H = z === "preview" ? null : a(M), U = M && typeof M == "object" ? M.render : void 0, W = M && typeof M == "object" ? M.sticky : void 0, G = W === "top" ? "top" : W ? "bottom" : !1, K = M && typeof M == "object" ? M.stickyVisibility : void 0, q = p(c);
227
- q.current = c;
228
- let J = p(A);
229
- J.current = A;
230
- let Y = p((e, t) => {
231
- J.current?.(e, t);
232
- }).current, X = p(void 0);
233
- u(() => {
234
- let t = e(n)?.frontmatter ?? null;
235
- t !== X.current && (X.current = t, q.current?.(t));
236
- }, [n]), d(R, () => ({
237
- focus: () => B?.focus(),
238
- getView: () => B,
231
+ var F = d(function({ value: r, onChange: i, mode: a = "in-place", onSave: o, onFrontmatter: s, onWikiLinkClick: l, onLinkClick: d, readOnly: f, placeholder: h, className: v, inPlace: b, codeLanguages: x, wikiLinkSource: w, tagSource: T, embedSource: A, onResolveError: j, toolbar: M, icons: N, frontmatter: F, softBreaks: I, onTaskToggle: L, canvasHeader: R }, z) {
232
+ let B = a === "preview" || a === "split" || a === "in-place" ? a : "source", [V, H] = _(null), U = B === "preview" ? null : c(M), W = M && typeof M == "object" ? M : void 0, G = W?.render, K = W?.sticky === "top" ? "top" : W?.sticky ? "bottom" : !1, q = W?.stickyVisibility, J = g(s);
233
+ J.current = s;
234
+ let Y = g(j);
235
+ Y.current = j;
236
+ let X = g((e, t) => {
237
+ Y.current?.(e, t);
238
+ }).current, Z = g(A);
239
+ Z.current = A;
240
+ let Q = g(void 0);
241
+ p(() => {
242
+ let t = e(r)?.frontmatter ?? null;
243
+ t !== Q.current && (Q.current = t, J.current?.(t));
244
+ }, [r]), m(z, () => ({
245
+ focus: () => V?.focus(),
246
+ getView: () => V,
239
247
  insertAtCursor: (e) => {
240
- B && (B.dispatch(B.state.replaceSelection(e)), B.focus());
248
+ V && (V.dispatch(V.state.replaceSelection(e)), V.focus());
241
249
  },
242
250
  scrollToHeading: (e) => {
243
- if (!B) return !1;
244
- let t = e.trim().toLowerCase(), { doc: n } = B.state;
251
+ if (!V) return !1;
252
+ let t = e.trim().toLowerCase(), { doc: n } = V.state;
245
253
  for (let e = 1; e <= n.lines; e++) {
246
254
  let r = n.line(e), i = /^ {0,3}#{1,6}[ \t]+(.*?)(?:[ \t]+#+)?[ \t]*$/.exec(r.text);
247
- if (!(!i || i[1] === void 0) && i[1].trim().toLowerCase() === t) return B.dispatch({
255
+ if (!(!i || i[1] === void 0) && i[1].trim().toLowerCase() === t) return V.dispatch({
248
256
  selection: { anchor: r.from },
249
- effects: g.scrollIntoView(r.from, { y: "start" })
250
- }), B.focus(), !0;
257
+ effects: y.scrollIntoView(r.from, { y: "start" })
258
+ }), V.focus(), !0;
251
259
  }
252
260
  return !1;
261
+ },
262
+ invalidateEmbed: (e) => {
263
+ let n = Z.current;
264
+ n && t(n, e);
253
265
  }
254
- }), [B]);
255
- let Z = [
256
- t.root,
257
- G === "bottom" && t.stickyToolbarRootBottom,
258
- G === "top" && t.stickyToolbarRootTop,
266
+ }), [V]);
267
+ let $ = [
268
+ n.root,
269
+ K === "bottom" && n.stickyToolbarRootBottom,
270
+ K === "top" && n.stickyToolbarRootTop,
259
271
  "stylo",
260
272
  v
261
273
  ].filter(Boolean).join(" ");
262
- return /* @__PURE__ */ b("div", {
263
- className: Z,
264
- "data-stylo-mode": z,
274
+ return /* @__PURE__ */ C("div", {
275
+ className: $,
276
+ "data-stylo-mode": B,
265
277
  children: [
266
- H && (() => {
267
- let e = /* @__PURE__ */ y(j, {
268
- view: B,
269
- items: H,
278
+ U && (() => {
279
+ let e = /* @__PURE__ */ S(P, {
280
+ view: V,
281
+ items: U,
270
282
  icons: N,
271
- disabled: h,
272
- sticky: G,
273
- stickyVisibility: K
283
+ disabled: f,
284
+ sticky: K,
285
+ stickyVisibility: q
274
286
  });
275
- return U ? U(e, { view: B }) : e;
287
+ return G ? G(e, { view: V }) : e;
276
288
  })(),
277
- z === "source" && /* @__PURE__ */ y(C, {
278
- value: n,
279
- onChange: r,
280
- readOnly: h,
281
- placeholder: _,
282
- codeLanguages: S,
283
- wikiLinkSource: D,
284
- tagSource: O,
285
- onResolveError: Y,
289
+ B === "source" && /* @__PURE__ */ S(E, {
290
+ value: r,
291
+ onChange: i,
292
+ readOnly: f,
293
+ placeholder: h,
294
+ codeLanguages: x,
295
+ wikiLinkSource: w,
296
+ tagSource: T,
297
+ onResolveError: X,
286
298
  onSave: o,
287
- onViewChange: V,
288
- canvasHeader: L
299
+ onViewChange: H,
300
+ canvasHeader: R
289
301
  }),
290
- z === "preview" && /* @__PURE__ */ y(s, {
291
- fallback: /* @__PURE__ */ y("div", {
292
- className: t.preview,
302
+ B === "preview" && /* @__PURE__ */ S(u, {
303
+ fallback: /* @__PURE__ */ S("div", {
304
+ className: n.preview,
293
305
  "aria-busy": "true"
294
306
  }),
295
- children: /* @__PURE__ */ y(T, {
296
- value: n,
307
+ children: /* @__PURE__ */ S(O, {
308
+ value: r,
297
309
  onWikiLinkClick: l,
298
- embedSource: k,
299
- onResolveError: Y,
300
- frontmatter: P,
301
- codeLanguages: S,
302
- softBreaks: F,
303
- onTaskToggle: I
310
+ embedSource: A,
311
+ onResolveError: X,
312
+ frontmatter: F,
313
+ codeLanguages: x,
314
+ softBreaks: I,
315
+ onTaskToggle: L
304
316
  })
305
317
  }),
306
- z === "split" && /* @__PURE__ */ y(E, {
307
- value: n,
308
- onChange: r,
318
+ B === "split" && /* @__PURE__ */ S(k, {
319
+ value: r,
320
+ onChange: i,
309
321
  onWikiLinkClick: l,
310
- readOnly: h,
311
- placeholder: _,
312
- codeLanguages: S,
313
- wikiLinkSource: D,
314
- tagSource: O,
315
- embedSource: k,
316
- onResolveError: Y,
317
- frontmatter: P,
318
- softBreaks: F,
319
- onTaskToggle: I,
322
+ readOnly: f,
323
+ placeholder: h,
324
+ codeLanguages: x,
325
+ wikiLinkSource: w,
326
+ tagSource: T,
327
+ embedSource: A,
328
+ onResolveError: X,
329
+ frontmatter: F,
330
+ softBreaks: I,
331
+ onTaskToggle: L,
320
332
  onSave: o,
321
- onViewChange: V,
322
- canvasHeader: L
333
+ onViewChange: H,
334
+ canvasHeader: R
323
335
  }),
324
- z === "in-place" && /* @__PURE__ */ y(s, {
325
- fallback: /* @__PURE__ */ y("div", {
326
- className: t.inplace,
336
+ B === "in-place" && /* @__PURE__ */ S(u, {
337
+ fallback: /* @__PURE__ */ S("div", {
338
+ className: n.inplace,
327
339
  "aria-busy": "true"
328
340
  }),
329
- children: /* @__PURE__ */ y(w, {
330
- value: n,
331
- onChange: r,
332
- readOnly: h,
333
- placeholder: _,
341
+ children: /* @__PURE__ */ S(D, {
342
+ value: r,
343
+ onChange: i,
344
+ readOnly: f,
345
+ placeholder: h,
334
346
  onWikiLinkClick: l,
335
- onLinkClick: f,
336
- inPlace: x,
337
- codeLanguages: S,
338
- wikiLinkSource: D,
339
- tagSource: O,
340
- embedSource: k,
341
- onResolveError: Y,
347
+ onLinkClick: d,
348
+ inPlace: b,
349
+ codeLanguages: x,
350
+ wikiLinkSource: w,
351
+ tagSource: T,
352
+ embedSource: A,
353
+ onResolveError: X,
342
354
  onSave: o,
343
- onViewChange: V,
344
- canvasHeader: L
355
+ onViewChange: H,
356
+ canvasHeader: R
345
357
  })
346
358
  })
347
359
  ]
348
360
  });
349
361
  });
350
- M.displayName = "Stylo";
362
+ F.displayName = "Stylo";
351
363
  //#endregion
352
- export { M as Stylo, e as splitFrontmatter };
364
+ export { F as Stylo, e as splitFrontmatter };
353
365
 
354
366
  //# sourceMappingURL=stylo.js.map