@notectl/core 2.2.3 → 2.2.5

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 (118) hide show
  1. package/README.md +12 -0
  2. package/dist/chunks/AlignmentPlugin-BCHxo16v.mjs +2 -0
  3. package/dist/chunks/AlignmentPlugin-BCHxo16v.mjs.map +1 -0
  4. package/dist/chunks/{BidiIsolationPlugin-Bm3h9J15.mjs → BidiIsolationPlugin-BddRbDCN.mjs} +2 -2
  5. package/dist/chunks/{BidiIsolationPlugin-Bm3h9J15.mjs.map → BidiIsolationPlugin-BddRbDCN.mjs.map} +1 -1
  6. package/dist/chunks/{BlockquotePlugin-CxrCA0vY.mjs → BlockquotePlugin-4V7KV_Sb.mjs} +2 -2
  7. package/dist/chunks/{BlockquotePlugin-CxrCA0vY.mjs.map → BlockquotePlugin-4V7KV_Sb.mjs.map} +1 -1
  8. package/dist/chunks/{CaretNavigationPlugin-Bb7W_FMg.mjs → CaretNavigationPlugin-C6XBwp0N.mjs} +2 -2
  9. package/dist/chunks/{CaretNavigationPlugin-Bb7W_FMg.mjs.map → CaretNavigationPlugin-C6XBwp0N.mjs.map} +1 -1
  10. package/dist/chunks/{CodeBlockPlugin-CcB0WaIz.mjs → CodeBlockPlugin-DC0-BnNy.mjs} +2 -2
  11. package/dist/chunks/{CodeBlockPlugin-CcB0WaIz.mjs.map → CodeBlockPlugin-DC0-BnNy.mjs.map} +1 -1
  12. package/dist/chunks/FontPlugin-DB1_bgam.mjs +2 -0
  13. package/dist/chunks/{FontPlugin-1VYDwETg.mjs.map → FontPlugin-DB1_bgam.mjs.map} +1 -1
  14. package/dist/chunks/{FontSizePlugin-L1uDVsKY.mjs → FontSizePlugin-DFvp7Ki9.mjs} +2 -2
  15. package/dist/chunks/{FontSizePlugin-L1uDVsKY.mjs.map → FontSizePlugin-DFvp7Ki9.mjs.map} +1 -1
  16. package/dist/chunks/{FormulaPlugin-66Cc9sH2.mjs → FormulaPlugin-BLEcyazj.mjs} +2 -2
  17. package/dist/chunks/{FormulaPlugin-66Cc9sH2.mjs.map → FormulaPlugin-BLEcyazj.mjs.map} +1 -1
  18. package/dist/chunks/GapCursorPlugin-Zvxjnr82.mjs +2 -0
  19. package/dist/chunks/{GapCursorPlugin-B29ieXel.mjs.map → GapCursorPlugin-Zvxjnr82.mjs.map} +1 -1
  20. package/dist/chunks/{HeadingPlugin-SICF6Tm0.mjs → HeadingPlugin-D9yvG2Aw.mjs} +2 -2
  21. package/dist/chunks/{HeadingPlugin-SICF6Tm0.mjs.map → HeadingPlugin-D9yvG2Aw.mjs.map} +1 -1
  22. package/dist/chunks/{HighlightPlugin-B3b_qe68.mjs → HighlightPlugin-D4gh4RP7.mjs} +2 -2
  23. package/dist/chunks/{HighlightPlugin-B3b_qe68.mjs.map → HighlightPlugin-D4gh4RP7.mjs.map} +1 -1
  24. package/dist/chunks/HorizontalRulePlugin-0FjHPZuA.mjs +2 -0
  25. package/dist/chunks/{HorizontalRulePlugin-BrFlrpmb.mjs.map → HorizontalRulePlugin-0FjHPZuA.mjs.map} +1 -1
  26. package/dist/chunks/{ImagePlugin-eRVtFFou.mjs → ImagePlugin-Cp_RINtc.mjs} +2 -2
  27. package/dist/chunks/{ImagePlugin-eRVtFFou.mjs.map → ImagePlugin-Cp_RINtc.mjs.map} +1 -1
  28. package/dist/chunks/{InlineCodePlugin-Cj1EZ3x2.mjs → InlineCodePlugin-DMr4O7c7.mjs} +2 -2
  29. package/dist/chunks/{InlineCodePlugin-Cj1EZ3x2.mjs.map → InlineCodePlugin-DMr4O7c7.mjs.map} +1 -1
  30. package/dist/chunks/LinkPlugin-DvZ3MPgL.mjs +2 -0
  31. package/dist/chunks/{LinkPlugin-B_ysjORS.mjs.map → LinkPlugin-DvZ3MPgL.mjs.map} +1 -1
  32. package/dist/chunks/{ListPlugin-C0BV8CnQ.mjs → ListPlugin-CVId2dE0.mjs} +2 -2
  33. package/dist/chunks/{ListPlugin-C0BV8CnQ.mjs.map → ListPlugin-CVId2dE0.mjs.map} +1 -1
  34. package/dist/chunks/PluginHelpers-KDuTlmXm.mjs +2 -0
  35. package/dist/chunks/{PluginHelpers-D4quRJ5a.mjs.map → PluginHelpers-KDuTlmXm.mjs.map} +1 -1
  36. package/dist/chunks/{PrintPlugin-CXDFFzWB.mjs → PrintPlugin-C6gOJT6d.mjs} +2 -2
  37. package/dist/chunks/{PrintPlugin-CXDFFzWB.mjs.map → PrintPlugin-C6gOJT6d.mjs.map} +1 -1
  38. package/dist/chunks/{SimpleMark-Bdqjcz0G.mjs → SimpleMark-CaQtFAau.mjs} +2 -2
  39. package/dist/chunks/{SimpleMark-Bdqjcz0G.mjs.map → SimpleMark-CaQtFAau.mjs.map} +1 -1
  40. package/dist/chunks/{SmartPastePlugin-BhkoH03E.mjs → SmartPastePlugin-Bi_wpTCV.mjs} +2 -2
  41. package/dist/chunks/{SmartPastePlugin-BhkoH03E.mjs.map → SmartPastePlugin-Bi_wpTCV.mjs.map} +1 -1
  42. package/dist/chunks/StrikethroughPlugin-BLKDRWtf.mjs +2 -0
  43. package/dist/chunks/{StrikethroughPlugin-DRuwEZhu.mjs.map → StrikethroughPlugin-BLKDRWtf.mjs.map} +1 -1
  44. package/dist/chunks/{SuperSubPlugin-IZ_x8GS-.mjs → SuperSubPlugin-DVP7VnIz.mjs} +2 -2
  45. package/dist/chunks/{SuperSubPlugin-IZ_x8GS-.mjs.map → SuperSubPlugin-DVP7VnIz.mjs.map} +1 -1
  46. package/dist/chunks/{TablePlugin-CRp4qSZE.mjs → TablePlugin-D93RR5xH.mjs} +2 -2
  47. package/dist/chunks/{TablePlugin-CRp4qSZE.mjs.map → TablePlugin-D93RR5xH.mjs.map} +1 -1
  48. package/dist/chunks/TextColorPlugin-C1qpzEOa.mjs +2 -0
  49. package/dist/chunks/{TextColorPlugin-CViEiYZk.mjs.map → TextColorPlugin-C1qpzEOa.mjs.map} +1 -1
  50. package/dist/chunks/TextDirectionPlugin-DHB88HKf.mjs +2 -0
  51. package/dist/chunks/TextDirectionPlugin-DHB88HKf.mjs.map +1 -0
  52. package/dist/chunks/{TextFormattingPlugin-CpyZgtLi.mjs → TextFormattingPlugin-Cubp3e7f.mjs} +2 -2
  53. package/dist/chunks/{TextFormattingPlugin-CpyZgtLi.mjs.map → TextFormattingPlugin-Cubp3e7f.mjs.map} +1 -1
  54. package/dist/chunks/{ToolbarPlugin-B5UUc6dY.mjs → ToolbarPlugin-CLz2wa2c.mjs} +2 -2
  55. package/dist/chunks/{ToolbarPlugin-B5UUc6dY.mjs.map → ToolbarPlugin-CLz2wa2c.mjs.map} +1 -1
  56. package/dist/chunks/{VideoPlugin-mXIDODzC.mjs → VideoPlugin-D9rQZol6.mjs} +2 -2
  57. package/dist/chunks/{VideoPlugin-mXIDODzC.mjs.map → VideoPlugin-D9rQZol6.mjs.map} +1 -1
  58. package/dist/chunks/full-Cah3qjCT.mjs +2 -0
  59. package/dist/chunks/{full-CHkwduuY.mjs.map → full-Cah3qjCT.mjs.map} +1 -1
  60. package/dist/chunks/minimal-DqATlnAL.mjs +2 -0
  61. package/dist/chunks/{minimal-D5v-raei.mjs.map → minimal-DqATlnAL.mjs.map} +1 -1
  62. package/dist/chunks/{src-gVRDR_79.mjs → src-YY6n2SmV.mjs} +2 -2
  63. package/dist/chunks/{src-gVRDR_79.mjs.map → src-YY6n2SmV.mjs.map} +1 -1
  64. package/dist/full.mjs +1 -1
  65. package/dist/notectl-core.mjs +1 -1
  66. package/dist/notectl-core.umd.js +1 -1
  67. package/dist/notectl-core.umd.js.map +1 -1
  68. package/dist/plugins/alignment/AlignmentPlugin.d.ts +5 -0
  69. package/dist/plugins/alignment/AlignmentPlugin.d.ts.map +1 -1
  70. package/dist/plugins/alignment.mjs +1 -1
  71. package/dist/plugins/bidi-isolation.mjs +1 -1
  72. package/dist/plugins/blockquote.mjs +1 -1
  73. package/dist/plugins/caret-navigation.mjs +1 -1
  74. package/dist/plugins/code-block.mjs +1 -1
  75. package/dist/plugins/font-size.mjs +1 -1
  76. package/dist/plugins/font.mjs +1 -1
  77. package/dist/plugins/formula.mjs +1 -1
  78. package/dist/plugins/gap-cursor.mjs +1 -1
  79. package/dist/plugins/heading.mjs +1 -1
  80. package/dist/plugins/highlight.mjs +1 -1
  81. package/dist/plugins/horizontal-rule.mjs +1 -1
  82. package/dist/plugins/image.mjs +1 -1
  83. package/dist/plugins/inline-code.mjs +1 -1
  84. package/dist/plugins/link.mjs +1 -1
  85. package/dist/plugins/list.mjs +1 -1
  86. package/dist/plugins/print.mjs +1 -1
  87. package/dist/plugins/shared/PluginHelpers.d.ts +8 -0
  88. package/dist/plugins/shared/PluginHelpers.d.ts.map +1 -1
  89. package/dist/plugins/shared.mjs +1 -1
  90. package/dist/plugins/smart-paste.mjs +1 -1
  91. package/dist/plugins/strikethrough.mjs +1 -1
  92. package/dist/plugins/super-sub.mjs +1 -1
  93. package/dist/plugins/table/TableNodeViews.d.ts.map +1 -1
  94. package/dist/plugins/table.mjs +1 -1
  95. package/dist/plugins/text-color.mjs +1 -1
  96. package/dist/plugins/text-direction/TextDirectionPlugin.d.ts +0 -1
  97. package/dist/plugins/text-direction/TextDirectionPlugin.d.ts.map +1 -1
  98. package/dist/plugins/text-direction.mjs +1 -1
  99. package/dist/plugins/text-formatting.mjs +1 -1
  100. package/dist/plugins/toolbar.mjs +1 -1
  101. package/dist/plugins/video.mjs +1 -1
  102. package/dist/presets/full.mjs +1 -1
  103. package/dist/presets/minimal.mjs +1 -1
  104. package/dist/presets.mjs +1 -1
  105. package/package.json +2 -2
  106. package/dist/chunks/AlignmentPlugin-h6sx-yIf.mjs +0 -2
  107. package/dist/chunks/AlignmentPlugin-h6sx-yIf.mjs.map +0 -1
  108. package/dist/chunks/FontPlugin-1VYDwETg.mjs +0 -2
  109. package/dist/chunks/GapCursorPlugin-B29ieXel.mjs +0 -2
  110. package/dist/chunks/HorizontalRulePlugin-BrFlrpmb.mjs +0 -2
  111. package/dist/chunks/LinkPlugin-B_ysjORS.mjs +0 -2
  112. package/dist/chunks/PluginHelpers-D4quRJ5a.mjs +0 -2
  113. package/dist/chunks/StrikethroughPlugin-DRuwEZhu.mjs +0 -2
  114. package/dist/chunks/TextColorPlugin-CViEiYZk.mjs +0 -2
  115. package/dist/chunks/TextDirectionPlugin-CQGkaS2s.mjs +0 -2
  116. package/dist/chunks/TextDirectionPlugin-CQGkaS2s.mjs.map +0 -1
  117. package/dist/chunks/full-CHkwduuY.mjs +0 -2
  118. package/dist/chunks/minimal-D5v-raei.mjs +0 -2
@@ -35,6 +35,11 @@ export declare class AlignmentPlugin implements Plugin {
35
35
  * type (e.g. paragraph → heading) via `setBlockType`, which replaces attrs.
36
36
  */
37
37
  private registerMiddleware;
38
+ /**
39
+ * Applies `alignment` to every alignable block in the current selection in
40
+ * a single transaction. A multi-block selection aligns all of its blocks,
41
+ * not just the anchor; non-alignable blocks in the range are left untouched.
42
+ */
38
43
  private setAlignment;
39
44
  private isNonDefaultAlignment;
40
45
  private isAlignable;
@@ -1 +1 @@
1
- {"version":3,"file":"AlignmentPlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/alignment/AlignmentPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAKpE,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAQ1D,OAAO,EAEN,KAAK,eAAe,EAEpB,MAAM,sBAAsB,CAAC;AAI9B,MAAM,WAAW,eAAe;IAC/B,wDAAwD;IACxD,QAAQ,CAAC,UAAU,EAAE,SAAS,cAAc,EAAE,CAAC;IAC/C,mHAAmH;IACnH,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,wFAAwF;IACxF,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC;IAC5D,QAAQ,CAAC,MAAM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C3C,wFAAwF;IACxF,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC;IAC5D,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC;CAClC;AAUD,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAQpE,CAAC;AAIF,qBAAa,eAAgB,YAAW,MAAM;IAC7C,QAAQ,CAAC,EAAE,eAAe;IAC1B,QAAQ,CAAC,IAAI,eAAe;IAC5B,QAAQ,CAAC,QAAQ,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IACzC,OAAO,CAAC,MAAM,CAAmB;IACjC,OAAO,CAAC,cAAc,CAAuB;gBAEjC,MAAM,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC;IAQvC,IAAI,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBjD;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAUtB,OAAO,CAAC,gBAAgB;IAUxB,OAAO,CAAC,eAAe;IAuBvB,OAAO,CAAC,mBAAmB;IAqB3B,OAAO,CAAC,iBAAiB;IAYzB;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IA4B1B;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAwBpB,OAAO,CAAC,qBAAqB;IAQ7B,OAAO,CAAC,WAAW;CAInB"}
@@ -1 +1 @@
1
- import{i as s,n,r as a,t as i}from"../chunks/AlignmentPlugin-h6sx-yIf.mjs";export{i as ALIGNMENT_ICONS,a as ALIGNMENT_LOCALE_EN,n as AlignmentPlugin,s as loadAlignmentLocale};
1
+ import{i as s,n,r as a,t as i}from"../chunks/AlignmentPlugin-BCHxo16v.mjs";export{i as ALIGNMENT_ICONS,a as ALIGNMENT_LOCALE_EN,n as AlignmentPlugin,s as loadAlignmentLocale};
@@ -1 +1 @@
1
- import{n as s,r as i,t as o}from"../chunks/BidiIsolationPlugin-Bm3h9J15.mjs";export{s as BIDI_ISOLATION_LOCALE_EN,o as BidiIsolationPlugin,i as loadBidiIsolationLocale};
1
+ import{n as s,r as i,t as o}from"../chunks/BidiIsolationPlugin-BddRbDCN.mjs";export{s as BIDI_ISOLATION_LOCALE_EN,o as BidiIsolationPlugin,i as loadBidiIsolationLocale};
@@ -1 +1 @@
1
- import{n as o,r as s,t as r}from"../chunks/BlockquotePlugin-CxrCA0vY.mjs";export{o as BLOCKQUOTE_LOCALE_EN,r as BlockquotePlugin,s as loadBlockquoteLocale};
1
+ import{n as o,r as s,t as r}from"../chunks/BlockquotePlugin-4V7KV_Sb.mjs";export{o as BLOCKQUOTE_LOCALE_EN,r as BlockquotePlugin,s as loadBlockquoteLocale};
@@ -1 +1 @@
1
- import{n as a,r,t as s}from"../chunks/CaretNavigationPlugin-Bb7W_FMg.mjs";export{a as CARET_NAVIGATION_LOCALE_EN,s as CaretNavigationPlugin,r as loadCaretNavigationLocale};
1
+ import{n as a,r,t as s}from"../chunks/CaretNavigationPlugin-C6XBwp0N.mjs";export{a as CARET_NAVIGATION_LOCALE_EN,s as CaretNavigationPlugin,r as loadCaretNavigationLocale};
@@ -1 +1 @@
1
- import{a as s,i as a,n as o,o as m,r,t as i}from"../chunks/CodeBlockPlugin-CcB0WaIz.mjs";import{c as n,i as p,n as t,o as c}from"../chunks/XmlSupport-BYiRwlkK.mjs";export{o as CODE_BLOCK_LOCALE_EN,s as CODE_BLOCK_SERVICE_KEY,i as CodeBlockPlugin,n as JAVA_LANGUAGE,c as JSON_LANGUAGE,a as RegexTokenizer,m as SYNTAX_HIGHLIGHTER_SERVICE_KEY,p as TYPESCRIPT_LANGUAGE,t as XML_LANGUAGE,r as loadCodeBlockLocale};
1
+ import{a as s,i as a,n as o,o as m,r,t as i}from"../chunks/CodeBlockPlugin-DC0-BnNy.mjs";import{c as n,i as p,n as t,o as c}from"../chunks/XmlSupport-BYiRwlkK.mjs";export{o as CODE_BLOCK_LOCALE_EN,s as CODE_BLOCK_SERVICE_KEY,i as CodeBlockPlugin,n as JAVA_LANGUAGE,c as JSON_LANGUAGE,a as RegexTokenizer,m as SYNTAX_HIGHLIGHTER_SERVICE_KEY,p as TYPESCRIPT_LANGUAGE,t as XML_LANGUAGE,r as loadCodeBlockLocale};
@@ -1 +1 @@
1
- import{n as s,r as n,t as o}from"../chunks/FontSizePlugin-L1uDVsKY.mjs";export{s as FONT_SIZE_LOCALE_EN,o as FontSizePlugin,n as loadFontSizeLocale};
1
+ import{n as s,r as n,t as o}from"../chunks/FontSizePlugin-DFvp7Ki9.mjs";export{s as FONT_SIZE_LOCALE_EN,o as FontSizePlugin,n as loadFontSizeLocale};
@@ -1 +1 @@
1
- import{n as s,r as n,t as o}from"../chunks/FontPlugin-1VYDwETg.mjs";export{s as FONT_LOCALE_EN,o as FontPlugin,n as loadFontLocale};
1
+ import{n as s,r as n,t as o}from"../chunks/FontPlugin-DB1_bgam.mjs";export{s as FONT_LOCALE_EN,o as FontPlugin,n as loadFontLocale};
@@ -1 +1 @@
1
- import{a as s,c as a,i as o,n as r,o as m,r as i,s as n,t}from"../chunks/FormulaPlugin-66Cc9sH2.mjs";export{n as DEFAULT_FORMULA_KEYMAP,r as FORMULA_LOCALE_EN,t as FormulaPlugin,s as MATHML_ATTRS,m as MATHML_TAGS,a as buildMathML,o as latexToMathML,i as loadFormulaLocale};
1
+ import{a as s,c as a,i as o,n as r,o as m,r as i,s as n,t}from"../chunks/FormulaPlugin-BLEcyazj.mjs";export{n as DEFAULT_FORMULA_KEYMAP,r as FORMULA_LOCALE_EN,t as FormulaPlugin,s as MATHML_ATTRS,m as MATHML_TAGS,a as buildMathML,o as latexToMathML,i as loadFormulaLocale};
@@ -1 +1 @@
1
- import{t as r}from"../chunks/GapCursorPlugin-B29ieXel.mjs";export{r as GapCursorPlugin};
1
+ import{t as r}from"../chunks/GapCursorPlugin-Zvxjnr82.mjs";export{r as GapCursorPlugin};
@@ -1 +1 @@
1
- import{t as s}from"../chunks/BlockTypePickerRegistry-BTET9jM-.mjs";import{n as r,r as i,t as m}from"../chunks/HeadingPlugin-SICF6Tm0.mjs";export{s as BlockTypePickerRegistry,r as HEADING_LOCALE_EN,m as HeadingPlugin,i as loadHeadingLocale};
1
+ import{t as s}from"../chunks/BlockTypePickerRegistry-BTET9jM-.mjs";import{n as r,r as i,t as m}from"../chunks/HeadingPlugin-D9yvG2Aw.mjs";export{s as BlockTypePickerRegistry,r as HEADING_LOCALE_EN,m as HeadingPlugin,i as loadHeadingLocale};
@@ -1 +1 @@
1
- import{n as s,r as i,t as r}from"../chunks/HighlightPlugin-B3b_qe68.mjs";export{s as HIGHLIGHT_LOCALE_EN,r as HighlightPlugin,i as loadHighlightLocale};
1
+ import{n as s,r as i,t as r}from"../chunks/HighlightPlugin-D4gh4RP7.mjs";export{s as HIGHLIGHT_LOCALE_EN,r as HighlightPlugin,i as loadHighlightLocale};
@@ -1 +1 @@
1
- import{n as o,r,t as s}from"../chunks/HorizontalRulePlugin-BrFlrpmb.mjs";export{o as HORIZONTAL_RULE_LOCALE_EN,s as HorizontalRulePlugin,r as loadHorizontalRuleLocale};
1
+ import{n as o,r,t as s}from"../chunks/HorizontalRulePlugin-0FjHPZuA.mjs";export{o as HORIZONTAL_RULE_LOCALE_EN,s as HorizontalRulePlugin,r as loadHorizontalRuleLocale};
@@ -1 +1 @@
1
- import{a,i as s,n as m,r,t as i}from"../chunks/ImagePlugin-eRVtFFou.mjs";export{m as DEFAULT_IMAGE_KEYMAP,s as IMAGE_LOCALE_EN,r as IMAGE_UPLOAD_SERVICE,i as ImagePlugin,a as loadImageLocale};
1
+ import{a,i as s,n as m,r,t as i}from"../chunks/ImagePlugin-Cp_RINtc.mjs";export{m as DEFAULT_IMAGE_KEYMAP,s as IMAGE_LOCALE_EN,r as IMAGE_UPLOAD_SERVICE,i as ImagePlugin,a as loadImageLocale};
@@ -1 +1 @@
1
- import{n,r as s,t as o}from"../chunks/InlineCodePlugin-Cj1EZ3x2.mjs";export{n as INLINE_CODE_LOCALE_EN,o as InlineCodePlugin,s as loadInlineCodeLocale};
1
+ import{n,r as s,t as o}from"../chunks/InlineCodePlugin-DMr4O7c7.mjs";export{n as INLINE_CODE_LOCALE_EN,o as InlineCodePlugin,s as loadInlineCodeLocale};
@@ -1 +1 @@
1
- import{n as s,r as n,t as r}from"../chunks/LinkPlugin-B_ysjORS.mjs";export{s as LINK_LOCALE_EN,r as LinkPlugin,n as loadLinkLocale};
1
+ import{n as s,r as n,t as r}from"../chunks/LinkPlugin-DvZ3MPgL.mjs";export{s as LINK_LOCALE_EN,r as LinkPlugin,n as loadLinkLocale};
@@ -1 +1 @@
1
- import{n as s,r,t}from"../chunks/ListPlugin-C0BV8CnQ.mjs";export{s as LIST_LOCALE_EN,t as ListPlugin,r as loadListLocale};
1
+ import{n as s,r,t}from"../chunks/ListPlugin-CVId2dE0.mjs";export{s as LIST_LOCALE_EN,t as ListPlugin,r as loadListLocale};
@@ -1 +1 @@
1
- import{n as s,r,t as n}from"../chunks/PrintTypes-WdtgSj74.mjs";import{n as t,r as a,t as m}from"../chunks/PrintPlugin-CXDFFzWB.mjs";export{n as AFTER_PRINT,s as BEFORE_PRINT,t as PRINT_LOCALE_EN,r as PRINT_SERVICE_KEY,m as PrintPlugin,a as loadPrintLocale};
1
+ import{n as s,r,t as n}from"../chunks/PrintTypes-WdtgSj74.mjs";import{n as t,r as a,t as m}from"../chunks/PrintPlugin-C6gOJT6d.mjs";export{n as AFTER_PRINT,s as BEFORE_PRINT,t as PRINT_LOCALE_EN,r as PRINT_SERVICE_KEY,m as PrintPlugin,a as loadPrintLocale};
@@ -23,4 +23,12 @@ export declare function resolveLocale<T>(context: PluginContext, configLocale: T
23
23
  export declare function getSelectedBlock(state: EditorState): BlockNode | undefined;
24
24
  /** Returns the block ID under the cursor, handling both TextSelection and NodeSelection. */
25
25
  export declare function getSelectedBlockId(state: EditorState): BlockId | undefined;
26
+ /**
27
+ * Returns every leaf-block ID covered by the current selection, in document
28
+ * order. A NodeSelection yields its single node; a collapsed or single-block
29
+ * TextSelection yields one ID; a multi-block TextSelection yields the full
30
+ * inclusive range from anchor to head. Used by block-attribute commands
31
+ * (alignment, text direction) that must apply to the whole selection.
32
+ */
33
+ export declare function getSelectedBlockIds(state: EditorState): BlockId[];
26
34
  //# sourceMappingURL=PluginHelpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PluginHelpers.d.ts","sourceRoot":"","sources":["../../../src/plugins/shared/PluginHelpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,aAAa,EAAE,EAAE,EAAE,WAAW,GAAG,IAAI,GAAG,OAAO,CAIzF;AAED,mDAAmD;AACnD,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED,oFAAoF;AACpF,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED;;;GAGG;AACH,wBAAsB,aAAa,CAAC,CAAC,EACpC,OAAO,EAAE,aAAa,EACtB,YAAY,EAAE,CAAC,GAAG,SAAS,EAC3B,aAAa,EAAE,CAAC,EAChB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,GAClC,OAAO,CAAC,CAAC,CAAC,CAKZ;AAED,yFAAyF;AACzF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,GAAG,SA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AC,KAAK,EAAE,WAAW,GAAG,OAAO,EAAE,CAkBjE"}
@@ -1 +1 @@
1
- import{i as s,r as a,s as r,t as o}from"../chunks/PluginHelpers-D4quRJ5a.mjs";import{t as m}from"../chunks/ShortcutFormatting-TwiufqeV.mjs";import{n as t,r as n,t as i}from"../chunks/KeyboardNav-D0my3wuy.mjs";import{r as p,t as u}from"../chunks/PopupPositioning-DtUrY9bh.mjs";import{n as c,t as h}from"../chunks/PopupManager-CyOfZUab.mjs";import{a as k,i as f,n as j,r as e,t as P}from"../chunks/ColorValidation-DAijTjG9.mjs";import{n as l,t as d}from"../chunks/XmlPatterns-RN32-0ob.mjs";import{n as g,r as C,t as b}from"../chunks/PopupKeyboardPatterns-tUrT9TyV.mjs";import{a as v,i as x,n as y,r as K,t as M}from"../chunks/ColorPickerPopup-C_74bqid.mjs";import{n as S,r as w,t as z}from"../chunks/ColorGrid-CXRdpP_n.mjs";export{h as PopupManager,c as PopupServiceKey,d as XML_ATTRS,l as XML_TAG_NAME,u as appendToRoot,y as applyColorMark,i as applyRovingTabindex,b as attachGridKeyboard,g as attachListboxKeyboard,C as attachMenuKeyboard,o as capitalize,t as findNextDropdownItem,m as formatShortcut,K as getActiveColor,S as getColorName,a as getSelectedBlock,s as getSelectedBlockId,x as isColorMarkActive,w as isLightColor,P as isValidCSSColor,j as isValidCSSFontFamily,e as isValidCSSFontSize,f as isValidHexColor,r as loadLocaleModule,n as navigateGrid,p as positionPopup,v as removeColorMark,z as renderColorGrid,M as renderColorPickerPopup,k as resolveColors};
1
+ import{c as s,i as a,r,t as o}from"../chunks/PluginHelpers-KDuTlmXm.mjs";import{t as m}from"../chunks/ShortcutFormatting-TwiufqeV.mjs";import{n as t,r as n,t as i}from"../chunks/KeyboardNav-D0my3wuy.mjs";import{r as p,t as u}from"../chunks/PopupPositioning-DtUrY9bh.mjs";import{n as c,t as h}from"../chunks/PopupManager-CyOfZUab.mjs";import{a as k,i as f,n as j,r as e,t as P}from"../chunks/ColorValidation-DAijTjG9.mjs";import{n as l,t as d}from"../chunks/XmlPatterns-RN32-0ob.mjs";import{n as g,r as C,t as b}from"../chunks/PopupKeyboardPatterns-tUrT9TyV.mjs";import{a as v,i as x,n as y,r as K,t as M}from"../chunks/ColorPickerPopup-C_74bqid.mjs";import{n as S,r as w,t as z}from"../chunks/ColorGrid-CXRdpP_n.mjs";export{h as PopupManager,c as PopupServiceKey,d as XML_ATTRS,l as XML_TAG_NAME,u as appendToRoot,y as applyColorMark,i as applyRovingTabindex,b as attachGridKeyboard,g as attachListboxKeyboard,C as attachMenuKeyboard,o as capitalize,t as findNextDropdownItem,m as formatShortcut,K as getActiveColor,S as getColorName,r as getSelectedBlock,a as getSelectedBlockId,x as isColorMarkActive,w as isLightColor,P as isValidCSSColor,j as isValidCSSFontFamily,e as isValidCSSFontSize,f as isValidHexColor,s as loadLocaleModule,n as navigateGrid,p as positionPopup,v as removeColorMark,z as renderColorGrid,M as renderColorPickerPopup,k as resolveColors};
@@ -1 +1 @@
1
- import{a as s,i as a,n as r,o as t,r as m,s as o,t as i}from"../chunks/XmlDetector-D7TQpw-e.mjs";import{i as n,n as e,r as c,t as p}from"../chunks/SmartPastePlugin-BhkoH03E.mjs";export{s as DEFAULT_RELEVANCE_WEIGHTS,r as JsonDetector,m as LexerDetector,t as MAX_RELEVANCE_WEIGHT,c as SMART_PASTE_LOCALE_EN,e as SMART_PASTE_SERVICE_KEY,p as SmartPastePlugin,i as XmlDetector,o as computeTokenStats,n as loadSmartPasteLocale,a as scoreFromStats};
1
+ import{a as s,i as a,n as r,o as t,r as m,s as o,t as i}from"../chunks/XmlDetector-D7TQpw-e.mjs";import{i as n,n as e,r as c,t as p}from"../chunks/SmartPastePlugin-Bi_wpTCV.mjs";export{s as DEFAULT_RELEVANCE_WEIGHTS,r as JsonDetector,m as LexerDetector,t as MAX_RELEVANCE_WEIGHT,c as SMART_PASTE_LOCALE_EN,e as SMART_PASTE_SERVICE_KEY,p as SmartPastePlugin,i as XmlDetector,o as computeTokenStats,n as loadSmartPasteLocale,a as scoreFromStats};
@@ -1 +1 @@
1
- import{n as r,r as s,t}from"../chunks/StrikethroughPlugin-DRuwEZhu.mjs";export{r as STRIKETHROUGH_LOCALE_EN,t as StrikethroughPlugin,s as loadStrikethroughLocale};
1
+ import{n as r,r as s,t}from"../chunks/StrikethroughPlugin-BLKDRWtf.mjs";export{r as STRIKETHROUGH_LOCALE_EN,t as StrikethroughPlugin,s as loadStrikethroughLocale};
@@ -1 +1 @@
1
- import{n as r,r as s,t as u}from"../chunks/SuperSubPlugin-IZ_x8GS-.mjs";export{r as SUPER_SUB_LOCALE_EN,u as SuperSubPlugin,s as loadSuperSubLocale};
1
+ import{n as r,r as s,t as u}from"../chunks/SuperSubPlugin-DVP7VnIz.mjs";export{r as SUPER_SUB_LOCALE_EN,u as SuperSubPlugin,s as loadSuperSubLocale};
@@ -1 +1 @@
1
- {"version":3,"file":"TableNodeViews.d.ts","sourceRoot":"","sources":["../../../src/plugins/table/TableNodeViews.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAIpE,OAAO,KAAK,EAAY,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGlD,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAErE;;;GAGG;AACH,wBAAgB,0BAA0B,CACzC,SAAS,EAAE,cAAc,EACzB,aAAa,CAAC,EAAE,aAAa,EAC7B,MAAM,GAAE,WAA6B,GACnC,eAAe,CA+GjB;AAgBD;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,cAAc,GAAG,eAAe,CAuBxF;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,cAAc,GAAG,eAAe,CAgDzF"}
1
+ {"version":3,"file":"TableNodeViews.d.ts","sourceRoot":"","sources":["../../../src/plugins/table/TableNodeViews.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAIpE,OAAO,KAAK,EAAY,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGlD,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAErE;;;GAGG;AACH,wBAAgB,0BAA0B,CACzC,SAAS,EAAE,cAAc,EACzB,aAAa,CAAC,EAAE,aAAa,EAC7B,MAAM,GAAE,WAA6B,GACnC,eAAe,CAgHjB;AAgBD;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,cAAc,GAAG,eAAe,CAwBxF;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,cAAc,GAAG,eAAe,CAiDzF"}
@@ -1 +1 @@
1
- import{n as s,t as a}from"../chunks/TablePlugin-CRp4qSZE.mjs";export{a as TablePlugin,s as TableSelectionServiceKey};
1
+ import{n as s,t as a}from"../chunks/TablePlugin-D93RR5xH.mjs";export{a as TablePlugin,s as TableSelectionServiceKey};
@@ -1 +1 @@
1
- import{n as o,r,t as s}from"../chunks/TextColorPlugin-CViEiYZk.mjs";export{o as TEXT_COLOR_LOCALE_EN,s as TextColorPlugin,r as loadTextColorLocale};
1
+ import{n as o,r,t as s}from"../chunks/TextColorPlugin-C1qpzEOa.mjs";export{o as TEXT_COLOR_LOCALE_EN,s as TextColorPlugin,r as loadTextColorLocale};
@@ -25,7 +25,6 @@ export declare class TextDirectionPlugin implements Plugin {
25
25
  private registerToolbarItem;
26
26
  private getDirectionLabel;
27
27
  private setDirection;
28
- private getSelectedBlockIds;
29
28
  private isNonDefaultDirection;
30
29
  private isDirectable;
31
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TextDirectionPlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/text-direction/TextDirectionPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAOH,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAO1D,OAAO,EAEN,KAAK,mBAAmB,EAExB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAEN,KAAK,aAAa,EAElB,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EAAE,aAAa,EAAE,CAAC;AAE9B,MAAM,WAAW,mBAAmB;IACnC,0CAA0C;IAC1C,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5C,QAAQ,CAAC,MAAM,CAAC,EAAE,mBAAmB,CAAC;CACtC;AAgBD,qBAAa,mBAAoB,YAAW,MAAM;IACjD,QAAQ,CAAC,EAAE,oBAAoB;IAC/B,QAAQ,CAAC,IAAI,oBAAoB;IACjC,QAAQ,CAAC,QAAQ,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsB;IAC7C,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,eAAe,CAAuB;IAC9C,OAAO,CAAC,eAAe,CAAsC;gBAEjD,MAAM,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC;IAI3C,IAAI,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBjD,OAAO,IAAI,IAAI;IAKf,OAAO,CAAC,eAAe;IAQvB,OAAO,CAAC,cAAc;IAQtB,OAAO,CAAC,gBAAgB;IA8BxB,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,mBAAmB;IAiC3B,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,YAAY;IAwBpB,OAAO,CAAC,mBAAmB;IAwB3B,OAAO,CAAC,qBAAqB;IAO7B,OAAO,CAAC,YAAY;CAIpB"}
1
+ {"version":3,"file":"TextDirectionPlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/text-direction/TextDirectionPlugin.ts"],"names":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s";import{n,r as m,t as c}from"../chunks/TextDirectionPlugin-CQGkaS2s.mjs";export{s as DIRECTION_ICONS,n as TEXT_DIRECTION_LOCALE_EN,t as TEXT_DIRECTION_SERVICE_KEY,c as TextDirectionPlugin,o as detectTextDirection,r as findSiblingDirection,i as getBlockDir,m as loadTextDirectionLocale};
1
+ import{t as s}from"../chunks/DirectionIcons-Bbawl9ei.mjs";import{t}from"../chunks/TextDirectionService-OFOU6r_s.mjs";import{n as r,r as i,t as o}from"../chunks/DirectionDetection-C7XE0nxW.mjs";import{n,r as m,t as c}from"../chunks/TextDirectionPlugin-DHB88HKf.mjs";export{s as DIRECTION_ICONS,n as TEXT_DIRECTION_LOCALE_EN,t as TEXT_DIRECTION_SERVICE_KEY,c as TextDirectionPlugin,o as detectTextDirection,r as findSiblingDirection,i as getBlockDir,m as loadTextDirectionLocale};
@@ -1 +1 @@
1
- import{n as t,r,t as s}from"../chunks/TextFormattingPlugin-CpyZgtLi.mjs";export{t as TEXT_FORMATTING_LOCALE_EN,s as TextFormattingPlugin,r as loadTextFormattingLocale};
1
+ import{n as t,r,t as s}from"../chunks/TextFormattingPlugin-Cubp3e7f.mjs";export{t as TEXT_FORMATTING_LOCALE_EN,s as TextFormattingPlugin,r as loadTextFormattingLocale};
@@ -1 +1 @@
1
- import{a,i as s,n as o,o as r,r as i,t as m}from"../chunks/ToolbarPlugin-B5UUc6dY.mjs";export{s as TOOLBAR_LOCALE_EN,i as ToolbarOverflowBehavior,m as ToolbarPlugin,r as ToolbarRegistry,o as ToolbarServiceKey,a as loadToolbarLocale};
1
+ import{a,i as s,n as o,o as r,r as i,t as m}from"../chunks/ToolbarPlugin-CLz2wa2c.mjs";export{s as TOOLBAR_LOCALE_EN,i as ToolbarOverflowBehavior,m as ToolbarPlugin,r as ToolbarRegistry,o as ToolbarServiceKey,a as loadToolbarLocale};
@@ -1 +1 @@
1
- import{a as s,i as a,n as o,o as i,r,s as m,t as n}from"../chunks/VideoPlugin-mXIDODzC.mjs";export{a as DEFAULT_VIDEO_CONFIG,s as DEFAULT_VIDEO_KEYMAP,i as DEFAULT_VIDEO_PROVIDERS,o as VIDEO_LOCALE_EN,n as VideoPlugin,r as loadVideoLocale,m as parseVideoUrl};
1
+ import{a as s,i as a,n as o,o as i,r,s as m,t as n}from"../chunks/VideoPlugin-D9rQZol6.mjs";export{a as DEFAULT_VIDEO_CONFIG,s as DEFAULT_VIDEO_KEYMAP,i as DEFAULT_VIDEO_PROVIDERS,o as VIDEO_LOCALE_EN,n as VideoPlugin,r as loadVideoLocale,m as parseVideoUrl};
@@ -1 +1 @@
1
- import{t as m}from"../chunks/full-CHkwduuY.mjs";export{m as createFullPreset};
1
+ import{t as m}from"../chunks/full-Cah3qjCT.mjs";export{m as createFullPreset};
@@ -1 +1 @@
1
- import{t as m}from"../chunks/minimal-D5v-raei.mjs";export{m as createMinimalPreset};
1
+ import{t as m}from"../chunks/minimal-DqATlnAL.mjs";export{m as createMinimalPreset};
package/dist/presets.mjs CHANGED
@@ -1 +1 @@
1
- import{t as m}from"./chunks/minimal-D5v-raei.mjs";import{t as s}from"./chunks/full-CHkwduuY.mjs";export{s as createFullPreset,m as createMinimalPreset};
1
+ import{t as m}from"./chunks/minimal-DqATlnAL.mjs";import{t as s}from"./chunks/full-Cah3qjCT.mjs";export{s as createFullPreset,m as createMinimalPreset};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@notectl/core",
3
- "version": "2.2.3",
3
+ "version": "2.2.5",
4
4
  "description": "A modern and accessible rich text editor shipped as a single Web Component. Immutable state, transaction-based architecture, and a plugin system that powers every feature.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -401,7 +401,7 @@
401
401
  }
402
402
  ],
403
403
  "dependencies": {
404
- "dompurify": "^3.4.0"
404
+ "dompurify": "^3.4.11"
405
405
  },
406
406
  "devDependencies": {
407
407
  "@size-limit/preset-small-lib": "^12.0.1",
@@ -1,2 +0,0 @@
1
- import{s as t}from"./StyleRuntime-BAutwDZT.mjs";import{a as e,i as s,r as i,s as n,t as a}from"./PluginHelpers-D4quRJ5a.mjs";import{t as l}from"./NodeSpecPatching-B_yLknTl.mjs";var r={alignStart:"Align Start",alignCenter:"Align Center",alignEnd:"Align End",justify:"Justify",toolbarLabel:"Alignment",toolbarTooltip:"Alignment"},o=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-Bdmunk5h.mjs"),"./locales/de.ts":()=>import("./de-B8-w9gPi.mjs"),"./locales/es.ts":()=>import("./es-B8K3Yvf3.mjs"),"./locales/fr.ts":()=>import("./fr-BeRlON1t.mjs"),"./locales/hi.ts":()=>import("./hi-Bl-yeeOI.mjs"),"./locales/pt.ts":()=>import("./pt-5VeuNDd2.mjs"),"./locales/ru.ts":()=>import("./ru-Yngw7nFP.mjs"),"./locales/zh.ts":()=>import("./zh-BvuAbM2S.mjs")});async function g(t){return n(o,t,r)}var m={alignments:["start","center","end","justify"],alignableTypes:["paragraph","heading","title","subtitle","table_cell","image"],defaults:{image:"center"}},c={start:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15 15H3v2h12v-2zm0-8H3v2h12V7zM3 13h18v-2H3v2zm0 8h18v-2H3v2zM3 3v2h18V3H3z"/></svg>',center:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 15v2h10v-2H7zm-4 6h18v-2H3v2zm0-8h18v-2H3v2zm4-6v2h10V7H7zM3 3v2h18V3H3z"/></svg>',end:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 21h18v-2H3v2zm6-4h12v-2H9v2zm-6-4h18v-2H3v2zm6-4h12V7H9v2zM3 3v2h18V3H3z"/></svg>',justify:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 21h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18V7H3v2zM3 3v2h18V3H3z"/></svg>'},h=class{id="alignment";name="Alignment";priority=90;config;locale;alignableTypes;constructor(t){this.config={...m,...t,defaults:{...m.defaults,...t?.defaults}}}async init(t){this.locale=await e(t,this.config.locale,r,g),this.alignableTypes=new Set(this.config.alignableTypes),this.patchNodeSpecs(t),this.registerCommands(t),this.registerKeymaps(t),this.registerToolbarItem(t),this.registerMiddleware(t)}patchNodeSpecs(t){l(t.getSchemaRegistry(),this.config.alignableTypes,{attrName:"align",getDefault:t=>this.config.defaults[t]??"start",applyToDOM:p})}registerCommands(t){for(const e of this.config.alignments)t.registerCommand(`align${a(e)}`,()=>this.setAlignment(t,e))}registerKeymaps(t){const e={};this.config.alignments.includes("start")&&(e["Mod-Shift-L"]=()=>t.executeCommand("alignStart")),this.config.alignments.includes("center")&&(e["Mod-Shift-E"]=()=>t.executeCommand("alignCenter")),this.config.alignments.includes("end")&&(e["Mod-Shift-R"]=()=>t.executeCommand("alignEnd")),this.config.alignments.includes("justify")&&(e["Mod-Shift-J"]=()=>t.executeCommand("alignJustify")),Object.keys(e).length>0&&t.registerKeymap(e)}registerToolbarItem(t){const e=this.config.alignments.map(t=>({label:this.getAlignmentLabel(t),command:`align${a(t)}`,icon:c[t]}));t.registerToolbarItem({id:"alignment",group:"block",icon:c.start,label:this.locale.toolbarLabel,tooltip:this.locale.toolbarTooltip,command:"alignStart",popupType:"dropdown",popupConfig:{items:e},isActive:t=>this.isNonDefaultAlignment(t),isEnabled:t=>this.isAlignable(t)})}getAlignmentLabel(t){return{start:this.locale.alignStart,center:this.locale.alignCenter,end:this.locale.alignEnd,justify:this.locale.justify}[t]}registerMiddleware(t){t.registerMiddleware((t,e,s)=>{let i=!1;const n=t.steps.map(t=>{if("setBlockType"!==t.type)return t;if(!this.alignableTypes.has(t.nodeType))return t;const e=t.previousAttrs?.align;return e&&"start"!==e?(i=!0,{...t,attrs:{...t.attrs,align:e}}):t});s(i?{...t,steps:n}:t)},{name:"alignment:preserve-align"})}setAlignment(t,e){const n=t.getState(),a=i(n);if(!a||!this.alignableTypes.has(a.type))return!1;const l=s(n);if(!l)return!1;const r=n.getNodePath(l);if(!r)return!1;const o={...a.attrs,align:e},g=n.transaction("command").setNodeAttr(r,o).setSelection(n.selection).build();return t.dispatch(g),!0}isNonDefaultAlignment(t){const e=i(t);if(!e||!this.alignableTypes.has(e.type))return!1;const s=e.attrs?.align,n=this.config.defaults[e.type]??"start";return null!=s&&s!==n}isAlignable(t){const e=i(t);return null!=e&&this.alignableTypes.has(e.type)}};function p(e,s){const i=s.attrs?.align;"string"==typeof i&&"start"!==i&&t(e,"textAlign",i)}export{g as i,h as n,r,c as t};
2
- //# sourceMappingURL=AlignmentPlugin-h6sx-yIf.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AlignmentPlugin-h6sx-yIf.mjs","names":[],"sources":["../../src/plugins/alignment/AlignmentLocale.ts","../../src/plugins/alignment/AlignmentPlugin.ts"],"sourcesContent":["/** Locale interface and default English locale for the AlignmentPlugin. */\n\nimport { type LocaleModuleMap, loadLocaleModule } from '../shared/LocaleLoader.js';\n\nexport interface AlignmentLocale {\n\treadonly alignStart: string;\n\treadonly alignCenter: string;\n\treadonly alignEnd: string;\n\treadonly justify: string;\n\treadonly toolbarLabel: string;\n\treadonly toolbarTooltip: string;\n}\n\n// --- Default English Locale ---\n\nexport const ALIGNMENT_LOCALE_EN: AlignmentLocale = {\n\talignStart: 'Align Start',\n\talignCenter: 'Align Center',\n\talignEnd: 'Align End',\n\tjustify: 'Justify',\n\ttoolbarLabel: 'Alignment',\n\ttoolbarTooltip: 'Alignment',\n};\n\n// --- Lazy Locale Loader ---\n\nconst localeModules: LocaleModuleMap<AlignmentLocale> = import.meta.glob<{\n\tdefault: AlignmentLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadAlignmentLocale(lang: string): Promise<AlignmentLocale> {\n\treturn loadLocaleModule(localeModules, lang, ALIGNMENT_LOCALE_EN);\n}\n","/**\n * AlignmentPlugin: adds start/center/end/justify alignment as a block\n * attribute on paragraphs, headings, images, and other alignable types.\n * Uses logical values (`start`/`end`) instead of physical (`left`/`right`)\n * for correct behavior with RTL text direction. Patches NodeSpecs to render\n * the `align` attribute via inline `text-align` style and provides toggle\n * commands, keyboard shortcuts, and a toolbar dropdown.\n */\n\nimport type { BlockAlignment } from '../../model/BlockAlignment.js';\nimport type { BlockNode } from '../../model/Document.js';\nimport type { BlockId } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport { setStyleProperty } from '../../style/StyleRuntime.js';\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { patchNodeSpecAttr } from '../shared/NodeSpecPatching.js';\nimport {\n\tcapitalize,\n\tgetSelectedBlock,\n\tgetSelectedBlockId,\n\tresolveLocale,\n} from '../shared/PluginHelpers.js';\nimport {\n\tALIGNMENT_LOCALE_EN,\n\ttype AlignmentLocale,\n\tloadAlignmentLocale,\n} from './AlignmentLocale.js';\n\n// --- Public Types ---\n\nexport interface AlignmentConfig {\n\t/** Which alignments to expose. Defaults to all four. */\n\treadonly alignments: readonly BlockAlignment[];\n\t/** Block types that support alignment. Defaults to paragraph + heading + title + subtitle + table_cell + image. */\n\treadonly alignableTypes: readonly string[];\n\t/** Per-type default alignment (e.g. `{ image: 'center' }`). Falls back to `'start'`. */\n\treadonly defaults: Readonly<Record<string, BlockAlignment>>;\n\treadonly locale?: AlignmentLocale;\n}\n\n// --- Constants ---\n\nconst DEFAULT_CONFIG: AlignmentConfig = {\n\talignments: ['start', 'center', 'end', 'justify'],\n\talignableTypes: ['paragraph', 'heading', 'title', 'subtitle', 'table_cell', 'image'],\n\tdefaults: { image: 'center' },\n};\n\nexport const ALIGNMENT_ICONS: Readonly<Record<BlockAlignment, string>> = {\n\tstart:\n\t\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M15 15H3v2h12v-2zm0-8H3v2h12V7zM3 13h18v-2H3v2zm0 8h18v-2H3v2zM3 3v2h18V3H3z\"/></svg>',\n\tcenter:\n\t\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M7 15v2h10v-2H7zm-4 6h18v-2H3v2zm0-8h18v-2H3v2zm4-6v2h10V7H7zM3 3v2h18V3H3z\"/></svg>',\n\tend: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M3 21h18v-2H3v2zm6-4h12v-2H9v2zm-6-4h18v-2H3v2zm6-4h12V7H9v2zM3 3v2h18V3H3z\"/></svg>',\n\tjustify:\n\t\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M3 21h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18V7H3v2zM3 3v2h18V3H3z\"/></svg>',\n};\n\n// --- Plugin ---\n\nexport class AlignmentPlugin implements Plugin {\n\treadonly id = 'alignment';\n\treadonly name = 'Alignment';\n\treadonly priority = 90;\n\n\tprivate readonly config: AlignmentConfig;\n\tprivate locale!: AlignmentLocale;\n\tprivate alignableTypes!: ReadonlySet<string>;\n\n\tconstructor(config?: Partial<AlignmentConfig>) {\n\t\tthis.config = {\n\t\t\t...DEFAULT_CONFIG,\n\t\t\t...config,\n\t\t\tdefaults: { ...DEFAULT_CONFIG.defaults, ...config?.defaults },\n\t\t};\n\t}\n\n\tasync init(context: PluginContext): Promise<void> {\n\t\tthis.locale = await resolveLocale(\n\t\t\tcontext,\n\t\t\tthis.config.locale,\n\t\t\tALIGNMENT_LOCALE_EN,\n\t\t\tloadAlignmentLocale,\n\t\t);\n\n\t\tthis.alignableTypes = new Set(this.config.alignableTypes);\n\t\tthis.patchNodeSpecs(context);\n\t\tthis.registerCommands(context);\n\t\tthis.registerKeymaps(context);\n\t\tthis.registerToolbarItem(context);\n\t\tthis.registerMiddleware(context);\n\t}\n\n\t// --- NodeSpec Patching ---\n\n\t/**\n\t * Patches existing NodeSpecs for alignable block types to support the\n\t * `align` attribute and render it as an inline style. Skips types\n\t * that already define an `align` attribute in their spec.\n\t */\n\tprivate patchNodeSpecs(context: PluginContext): void {\n\t\tpatchNodeSpecAttr(context.getSchemaRegistry(), this.config.alignableTypes, {\n\t\t\tattrName: 'align',\n\t\t\tgetDefault: (type) => this.config.defaults[type] ?? 'start',\n\t\t\tapplyToDOM: applyAlignment,\n\t\t});\n\t}\n\n\t// --- Commands ---\n\n\tprivate registerCommands(context: PluginContext): void {\n\t\tfor (const alignment of this.config.alignments) {\n\t\t\tcontext.registerCommand(`align${capitalize(alignment)}`, () => {\n\t\t\t\treturn this.setAlignment(context, alignment);\n\t\t\t});\n\t\t}\n\t}\n\n\t// --- Keymaps ---\n\n\tprivate registerKeymaps(context: PluginContext): void {\n\t\tconst bindings: Record<string, () => boolean> = {};\n\n\t\tif (this.config.alignments.includes('start')) {\n\t\t\tbindings['Mod-Shift-L'] = () => context.executeCommand('alignStart');\n\t\t}\n\t\tif (this.config.alignments.includes('center')) {\n\t\t\tbindings['Mod-Shift-E'] = () => context.executeCommand('alignCenter');\n\t\t}\n\t\tif (this.config.alignments.includes('end')) {\n\t\t\tbindings['Mod-Shift-R'] = () => context.executeCommand('alignEnd');\n\t\t}\n\t\tif (this.config.alignments.includes('justify')) {\n\t\t\tbindings['Mod-Shift-J'] = () => context.executeCommand('alignJustify');\n\t\t}\n\n\t\tif (Object.keys(bindings).length > 0) {\n\t\t\tcontext.registerKeymap(bindings);\n\t\t}\n\t}\n\n\t// --- Toolbar ---\n\n\tprivate registerToolbarItem(context: PluginContext): void {\n\t\tconst dropdownItems = this.config.alignments.map((alignment) => ({\n\t\t\tlabel: this.getAlignmentLabel(alignment),\n\t\t\tcommand: `align${capitalize(alignment)}`,\n\t\t\ticon: ALIGNMENT_ICONS[alignment],\n\t\t}));\n\n\t\tcontext.registerToolbarItem({\n\t\t\tid: 'alignment',\n\t\t\tgroup: 'block',\n\t\t\ticon: ALIGNMENT_ICONS.start,\n\t\t\tlabel: this.locale.toolbarLabel,\n\t\t\ttooltip: this.locale.toolbarTooltip,\n\t\t\tcommand: 'alignStart',\n\t\t\tpopupType: 'dropdown',\n\t\t\tpopupConfig: { items: dropdownItems },\n\t\t\tisActive: (state) => this.isNonDefaultAlignment(state),\n\t\t\tisEnabled: (state) => this.isAlignable(state),\n\t\t});\n\t}\n\n\tprivate getAlignmentLabel(alignment: BlockAlignment): string {\n\t\tconst labels: Record<BlockAlignment, string> = {\n\t\t\tstart: this.locale.alignStart,\n\t\t\tcenter: this.locale.alignCenter,\n\t\t\tend: this.locale.alignEnd,\n\t\t\tjustify: this.locale.justify,\n\t\t};\n\t\treturn labels[alignment];\n\t}\n\n\t// --- Middleware ---\n\n\t/**\n\t * Preserves the `align` attribute when other plugins change the block\n\t * type (e.g. paragraph → heading) via `setBlockType`, which replaces attrs.\n\t */\n\tprivate registerMiddleware(context: PluginContext): void {\n\t\tcontext.registerMiddleware(\n\t\t\t(tr, _state, next) => {\n\t\t\t\tlet patched = false;\n\n\t\t\t\tconst patchedSteps = tr.steps.map((step) => {\n\t\t\t\t\tif (step.type !== 'setBlockType') return step;\n\t\t\t\t\tif (!this.alignableTypes.has(step.nodeType)) return step;\n\n\t\t\t\t\tconst prevAlign = step.previousAttrs?.align;\n\t\t\t\t\tif (!prevAlign || prevAlign === 'start') return step;\n\n\t\t\t\t\t// Carry forward align into new attrs\n\t\t\t\t\tpatched = true;\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...step,\n\t\t\t\t\t\tattrs: { ...step.attrs, align: prevAlign },\n\t\t\t\t\t};\n\t\t\t\t});\n\n\t\t\t\tnext(patched ? { ...tr, steps: patchedSteps } : tr);\n\t\t\t},\n\t\t\t{ name: 'alignment:preserve-align' },\n\t\t);\n\t}\n\n\t// --- Alignment Logic ---\n\n\tprivate setAlignment(context: PluginContext, alignment: BlockAlignment): boolean {\n\t\tconst state = context.getState();\n\t\tconst block = getSelectedBlock(state);\n\t\tif (!block || !this.alignableTypes.has(block.type)) return false;\n\n\t\tconst id = getSelectedBlockId(state);\n\t\tif (!id) return false;\n\n\t\tconst path = state.getNodePath(id);\n\t\tif (!path) return false;\n\n\t\tconst newAttrs = { ...block.attrs, align: alignment };\n\n\t\tconst tr = state\n\t\t\t.transaction('command')\n\t\t\t.setNodeAttr(path as BlockId[], newAttrs)\n\t\t\t.setSelection(state.selection)\n\t\t\t.build();\n\n\t\tcontext.dispatch(tr);\n\t\treturn true;\n\t}\n\n\tprivate isNonDefaultAlignment(state: EditorState): boolean {\n\t\tconst block = getSelectedBlock(state);\n\t\tif (!block || !this.alignableTypes.has(block.type)) return false;\n\t\tconst align = block.attrs?.align;\n\t\tconst defaultAlign: BlockAlignment = this.config.defaults[block.type] ?? 'start';\n\t\treturn align != null && align !== defaultAlign;\n\t}\n\n\tprivate isAlignable(state: EditorState): boolean {\n\t\tconst block = getSelectedBlock(state);\n\t\treturn block != null && this.alignableTypes.has(block.type);\n\t}\n}\n\n// --- Helpers ---\n\nfunction applyAlignment(el: HTMLElement, node: BlockNode): void {\n\tconst align = node.attrs?.align;\n\tif (typeof align === 'string' && align !== 'start') {\n\t\tsetStyleProperty(el, 'textAlign', align);\n\t}\n}\n"],"mappings":"iLAeA,IAAa,EAAuC,CACnD,WAAY,cACZ,YAAa,eACb,SAAU,YACV,QAAS,UACT,aAAc,YACd,eAAgB,aAKX,iBAAkD,OAAA,OAAA,CAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,uBAIxD,eAAsB,EAAoB,GACzC,OAAO,EAAiB,EAAe,EAAM,EAC9C,CCUA,IAAM,EAAkC,CACvC,WAAY,CAAC,QAAS,SAAU,MAAO,WACvC,eAAgB,CAAC,YAAa,UAAW,QAAS,WAAY,aAAc,SAC5E,SAAU,CAAE,MAAO,WAGP,EAA4D,CACxE,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MAAM,EAAQ,EAAM,OAAO,MACrB,EAA+B,KAAK,OAAO,SAAS,EAAM,OAAS,QACzE,OAAgB,MAAT,GAAiB,IAAU,CACnC,CAEA,WAAA,CAAoB,GACnB,MAAM,EAAQ,EAAiB,GAC/B,OAAgB,MAAT,GAAiB,KAAK,eAAe,IAAI,EAAM,KACvD,GAKD,SAAS,EAAe,EAAiB,GACxC,MAAM,EAAQ,EAAK,OAAO,MACL,iBAAV,GAAgC,UAAV,GAChC,EAAiB,EAAI,YAAa,EAEpC"}
@@ -1,2 +0,0 @@
1
- import{i as t}from"./TypeBrands-Ch9856Gb.mjs";import{i as e,n,r as o,t as i}from"./AttributedMarkCommands-D4W2Jgpj.mjs";import{r,s}from"./StyleRuntime-BAutwDZT.mjs";import{a,n as l,s as c}from"./PluginHelpers-D4quRJ5a.mjs";import{n as m}from"./ColorValidation-DAijTjG9.mjs";import{t as p}from"./InlineStyleMarkSpec-4R6DC7ij.mjs";var f={label:"Font",tooltip:"Font Family"},d=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-DahJwMI9.mjs"),"./locales/de.ts":()=>import("./de-DiPz7abS.mjs"),"./locales/es.ts":()=>import("./es-CCQFu1t1.mjs"),"./locales/fr.ts":()=>import("./fr-BwWrFThE.mjs"),"./locales/hi.ts":()=>import("./hi-B-ZuX4aN.mjs"),"./locales/pt.ts":()=>import("./pt-Dg2ctkug.mjs"),"./locales/ru.ts":()=>import("./ru-DJMpeuey.mjs"),"./locales/zh.ts":()=>import("./zh-CRsDvfPR.mjs")});async function h(t){return c(d,t,f)}var g=class{id="font";name="Font";priority=22;config;locale;injectedStyleElement=null;context=null;constructor(t){this.config=t}async init(t){this.locale=await a(t,this.config.locale,f,h),t.registerStyleSheet("\n/* Font Select — Width overrides for combobox button */\n.notectl-toolbar-btn--font {\n\tmin-width: 100px;\n\tmax-width: 160px;\n}\n\n/* Font Picker Popup */\n.notectl-font-picker {\n\tmin-width: 200px;\n\tmax-height: 320px;\n\toverflow-y: auto;\n}\n\n.notectl-font-picker__list {\n\tpadding: 4px 0;\n}\n\n.notectl-font-picker__item {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\twidth: 100%;\n\tpadding: 7px 12px;\n\tborder: none;\n\tbackground: none;\n\tcursor: pointer;\n\tfont-size: 14px;\n\tcolor: var(--notectl-fg);\n\tline-height: 1.4;\n\ttext-align: start;\n\twhite-space: nowrap;\n\tfont-family: inherit;\n\ttransition: background 0.1s;\n}\n\n@media (hover: hover) {\n\t.notectl-font-picker__item:hover {\n\t\tbackground: var(--notectl-hover-bg);\n\t}\n}\n\n.notectl-font-picker__item--active {\n\tbackground: var(--notectl-active-bg);\n\tcolor: var(--notectl-primary-fg);\n}\n\n@media (hover: hover) {\n\t.notectl-font-picker__item--active:hover {\n\t\tbackground: var(--notectl-active-bg);\n\t}\n}\n\n.notectl-font-picker__check {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 16px;\n\tflex-shrink: 0;\n\tfont-size: 13px;\n\tfont-weight: 600;\n\tcolor: var(--notectl-primary-fg);\n}\n\n.notectl-font-picker__label {\n\tflex: 1;\n}\n\n.notectl-font-picker__separator {\n\theight: 1px;\n\tbackground: var(--notectl-border);\n\tmargin: 4px 8px;\n}\n"),this.context=t,this.registerMarkSpec(t),this.registerCommands(t),this.config.fonts.length>0&&this.registerToolbarItem(t),this.injectFontFaces()}destroy(){this.injectedStyleElement?.remove(),this.injectedStyleElement=null,this.context=null}registerMarkSpec(t){t.registerMarkSpec(p({type:"font",rank:6,valueAttr:"family",domStyleProperty:"fontFamily",cssProperty:"font-family",validate:m,transformParsed:t=>t.replace(/"/g,"'")}))}registerCommands(t){t.registerCommand("removeFont",()=>{const e=t.getState();return this.removeFont(t,e)}),t.registerCommand("setFont",()=>!1)}get defaultFont(){if(this.config.defaultFont){const t=this.config.fonts.find(t=>t.name===this.config.defaultFont);if(t)return t}return this.config.fonts[0]}registerToolbarItem(t){t.registerToolbarItem({id:"font",group:"format",label:this.locale.label,tooltip:this.locale.tooltip,command:"removeFont",popupType:"combobox",getLabel:t=>this.resolveFontName(this.getActiveFont(t)),renderPopup:(t,e,n)=>{this.renderFontPopup(t,e,n)},isActive:t=>this.isFontActive(t)})}resolveFontName(t){return t?this.config.fonts.find(e=>e.family===t)?.name??(t.split(",")[0]??"").trim().replace(/['"]/g,""):this.defaultFont?.name??this.locale.label}isFontActive(t){return o(t,"font")}getActiveFont(t){return n(t,"font",t=>t.attrs.family??null)}applyFont(e,n,o){return l(e,i(n,{type:t("font"),attrs:{family:o}}))}removeFont(n,o){return l(n,e(o,t("font")))}injectFontFaces(){const t=[];for(const o of this.config.fonts)if(o.fontFaces?.length)for(const e of o.fontFaces){const n=[`font-family: '${(o.family.split(",")[0]??"").trim().replace(/['"]/g,"")}'`,`src: ${e.src}`];e.weight&&n.push(`font-weight: ${e.weight}`),e.style&&n.push(`font-style: ${e.style}`),n.push(`font-display: ${e.display??"swap"}`),t.push(`@font-face {\n\t${n.join(";\n\t")};\n}`)}if(0===t.length)return;const e=document.createElement("style");e.setAttribute("data-notectl-fonts","");const n=this.context?r(this.context.getContainer()):void 0;n&&e.setAttribute("nonce",n),e.textContent=t.join("\n\n"),document.head.appendChild(e),this.injectedStyleElement=e}renderFontPopup(t,e,n){t.classList.add("notectl-font-picker");const o=e.getState(),i=this.getActiveFont(o),r=this.defaultFont?.family,s=e.getContainer(),a=document.createElement("div");a.className="notectl-font-picker__list",a.setAttribute("role","listbox"),a.setAttribute("aria-label",this.locale.label);for(const l of this.config.fonts){const t=void 0!==r&&l.family===r,o=t&&!i||i===l.family,c=this.createFontItem(l.name,l.family,o,o=>{o.preventDefault(),o.stopPropagation(),t?e.executeCommand("removeFont"):this.applyFont(e,e.getState(),l.family),n({restoreFocusTo:s})});l.category&&c.setAttribute("data-category",l.category),a.appendChild(c)}t.appendChild(a)}createFontItem(t,e,n,o){const i=document.createElement("button");i.type="button",i.className="notectl-font-picker__item",i.setAttribute("role","option"),i.setAttribute("aria-selected",String(n)),n&&i.classList.add("notectl-font-picker__item--active");const r=document.createElement("span");r.className="notectl-font-picker__check",r.textContent=n?"✓":"",i.appendChild(r);const a=document.createElement("span");return a.className="notectl-font-picker__label",a.textContent=t,e&&s(a,"fontFamily",e),i.appendChild(a),i.addEventListener("mousedown",o),i}};export{f as n,h as r,g as t};
2
- //# sourceMappingURL=FontPlugin-1VYDwETg.mjs.map
@@ -1,2 +0,0 @@
1
- import{c as t}from"./Selection-HYoVFpAx.mjs";import{t as e}from"./GapCursorNavigation-ycNzuQVH.mjs";import{a as n,s as o}from"./PluginHelpers-D4quRJ5a.mjs";var r={gapCursorActive:"Gap cursor active. Type to insert new paragraph."},s=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-CR6UdFL9.mjs"),"./locales/de.ts":()=>import("./de-CHcv_Vmf.mjs"),"./locales/es.ts":()=>import("./es-BIXm2Coj.mjs"),"./locales/fr.ts":()=>import("./fr-Bg937iAy.mjs"),"./locales/hi.ts":()=>import("./hi-B5cl8TWK.mjs"),"./locales/pt.ts":()=>import("./pt-UPF7DBlz.mjs"),"./locales/ru.ts":()=>import("./ru-CkG_bpfo.mjs"),"./locales/zh.ts":()=>import("./zh-CWIzJcXi.mjs")});async function i(t){return o(s,t,r)}var a=class{id="gap-cursor";name="Gap Cursor";priority=5;context=null;activeCursorBlockId=null;activeCursorSide=null;locale=r;async init(o){this.locale=await n(o,void 0,r,i),this.context=o,o.registerStyleSheet("\n.notectl-gap-cursor--before,\n.notectl-gap-cursor--after {\n\tposition: relative;\n}\n.notectl-gap-cursor--before::before {\n\tcontent: '';\n\tdisplay: block;\n\tposition: absolute;\n\ttop: 0;\n\tinset-inline-start: 0;\n\twidth: 100%;\n\theight: 1px;\n\tbackground: currentColor;\n\ttransform: translateY(-50%);\n\tpointer-events: none;\n\tz-index: 1;\n\tanimation: notectl-gap-blink 1.1s step-end infinite;\n}\n.notectl-gap-cursor--after::after {\n\tcontent: '';\n\tdisplay: block;\n\tposition: absolute;\n\tbottom: 0;\n\tinset-inline-start: 0;\n\twidth: 100%;\n\theight: 1px;\n\tbackground: currentColor;\n\ttransform: translateY(50%);\n\tpointer-events: none;\n\tz-index: 1;\n\tanimation: notectl-gap-blink 1.1s step-end infinite;\n}\n@media (prefers-reduced-motion: reduce) {\n\t.notectl-gap-cursor--before::before,\n\t.notectl-gap-cursor--after::after {\n\t\tanimation: none;\n\t}\n}\n@keyframes notectl-gap-blink {\n\t50% { opacity: 0; }\n}\n");const s={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",ArrowDown:"down"},a={};for(const[n,r]of Object.entries(s))a[n]=()=>{const n=o.getState();if(!t(n.selection))return!1;const s=e(n,r,o.getContainer());return!!s&&(o.dispatch(s),!0)};o.registerKeymap(a,{priority:"navigation"})}onReady(){this.context&&this.syncCursorClass(this.context.getState())}onStateChange(e,n,o){this.context&&(this.syncCursorClass(n),!t(e.selection)&&t(n.selection)&&this.context.announce(this.locale.gapCursorActive))}destroy(){this.clearCursorClass(),this.context=null}syncCursorClass(e){if(this.clearCursorClass(),!t(e.selection)||!this.context)return;const n="before"===e.selection.side?"notectl-gap-cursor--before":"notectl-gap-cursor--after",o=this.context.getContainer().querySelector(`[data-block-id="${e.selection.blockId}"]`);o instanceof HTMLElement&&(o.classList.add(n),this.activeCursorBlockId=e.selection.blockId,this.activeCursorSide=e.selection.side)}clearCursorClass(){if(!this.context||!this.activeCursorBlockId||!this.activeCursorSide)return;const t=this.context.getContainer().querySelector(`[data-block-id="${this.activeCursorBlockId}"]`);t instanceof HTMLElement&&t.classList.remove("notectl-gap-cursor--before","notectl-gap-cursor--after"),this.activeCursorBlockId=null,this.activeCursorSide=null}};export{a as t};
2
- //# sourceMappingURL=GapCursorPlugin-B29ieXel.mjs.map
@@ -1,2 +0,0 @@
1
- import{i as t}from"./Document-r7vLOAGA.mjs";import{o as r,t as e,u as o}from"./Selection-HYoVFpAx.mjs";import{a as s}from"./TypeBrands-Ch9856Gb.mjs";import{n as i}from"./DomUtils-Bf7JLFlx.mjs";import{s as l}from"./BlockInsertion-6rR9tIGP.mjs";import{a,i as n,s as c}from"./PluginHelpers-D4quRJ5a.mjs";import{t as m}from"./ShortcutFormatting-TwiufqeV.mjs";var p={label:"Horizontal Rule",tooltip:t=>`Horizontal Rule (${t})`},u=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-CrOb0jL2.mjs"),"./locales/de.ts":()=>import("./de-C7uehgMu.mjs"),"./locales/es.ts":()=>import("./es-xuahrvJN.mjs"),"./locales/fr.ts":()=>import("./fr-B9pBLaVx.mjs"),"./locales/hi.ts":()=>import("./hi-DWX6k5ZD.mjs"),"./locales/pt.ts":()=>import("./pt-DFKJVh7k.mjs"),"./locales/ru.ts":()=>import("./ru-q8kz-237.mjs"),"./locales/zh.ts":()=>import("./zh-BGYJXxVl.mjs")});async function h(t){return c(u,t,p)}var d={},g=class{id="horizontal-rule";name="Horizontal Rule";priority=40;config;locale;constructor(t){this.config={...d,...t}}async init(t){this.locale=await a(t,this.config.locale,p,h),this.registerNodeSpec(t),this.registerCommands(t),this.registerKeymap(t),this.registerInputRule(t),this.registerToolbarItem(t)}registerNodeSpec(t){t.registerNodeSpec({type:"horizontal_rule",group:"block",isVoid:!0,toDOM:t=>i("hr",t.id),toHTML:()=>"<hr>",parseHTML:[{tag:"hr"}],sanitize:{tags:["hr"]}})}registerCommands(t){t.registerCommand("insertHorizontalRule",()=>this.insertHorizontalRule(t))}registerKeymap(t){t.registerKeymap({"Mod-Shift-H":()=>t.executeCommand("insertHorizontalRule")})}registerInputRule(i){i.registerInputRule({pattern:/^-{3,} $/,handler(i,l,a,n){const c=i.selection;if(!o(c))return null;if(!r(c))return null;const m=i.getBlock(c.anchor.blockId);if(!m||"paragraph"!==m.type)return null;const p=function(t){const r=t.selection;return o(r)?t.doc.children.findIndex(t=>t.id===r.anchor.blockId):-1}(i);if(-1===p)return null;const u=t(s("paragraph"));return i.transaction("input").deleteTextAt(c.anchor.blockId,0,n).setBlockType(c.anchor.blockId,s("horizontal_rule")).insertNode([],p+1,u).setSelection(e(u.id,0)).build()}})}registerToolbarItem(t){t.registerToolbarItem({id:"horizontal-rule",group:"block",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11h16v2H4z"/></svg>',label:this.locale.label,tooltip:this.locale.tooltip(m("Mod-Shift-H")),command:"insertHorizontalRule",isActive:()=>!1})}insertHorizontalRule(r){const o=r.getState(),i=n(o);if(!i)return!1;const a=o.transaction("command"),c=l(o,a,i,t(s("horizontal_rule")));return!!c&&(a.setSelection(e(c.id,0)),r.dispatch(a.build()),!0)}};export{p as n,h as r,g as t};
2
- //# sourceMappingURL=HorizontalRulePlugin-BrFlrpmb.mjs.map
@@ -1,2 +0,0 @@
1
- import{b as t}from"./Document-r7vLOAGA.mjs";import{o as e,u as r}from"./Selection-HYoVFpAx.mjs";import{i as n}from"./TypeBrands-Ch9856Gb.mjs";import{a as i,r as o}from"./HTMLUtils-C6B4UT00.mjs";import{i as s,r as a,t as l}from"./AttributedMarkCommands-D4W2Jgpj.mjs";import{a as c,n as p,s as m}from"./PluginHelpers-D4quRJ5a.mjs";import{t as d}from"./ShortcutFormatting-TwiufqeV.mjs";var u={label:"Link",tooltip:t=>`Insert Link (${t})`,removeLink:"Remove Link",removeLinkAria:"Remove link",urlPlaceholder:"https://...",urlAria:"Link URL",apply:"Apply",applyAria:"Apply link",invalidUrl:"Only http(s), mailto, tel, fragments, and relative paths are allowed."},h=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-Ctrv6cIi.mjs"),"./locales/de.ts":()=>import("./de-JhGflzS5.mjs"),"./locales/es.ts":()=>import("./es-Bv7bDbMp.mjs"),"./locales/fr.ts":()=>import("./fr-DtzIu6tU.mjs"),"./locales/hi.ts":()=>import("./hi-Bu799xIO.mjs"),"./locales/pt.ts":()=>import("./pt-DmN9u3NX.mjs"),"./locales/ru.ts":()=>import("./ru-BxySx7an.mjs"),"./locales/zh.ts":()=>import("./zh-DuucmOns.mjs")});async function k(t){return m(h,t,u)}var g={openInNewTab:!0},f=class{id="link";name="Link";priority=25;config;locale;constructor(t){this.config={...g,...t}}async init(t){this.locale=await c(t,this.config.locale,u,k),this.registerMarkSpec(t),this.registerCommands(t),this.registerKeymap(t),this.registerToolbarItem(t)}registerMarkSpec(t){const e=this.config.openInNewTab;t.registerMarkSpec({type:"link",rank:10,inclusive:!1,attrs:{href:{default:""}},toDOM(t){const r=document.createElement("a"),n=i(String(t.attrs?.href??""));return r.setAttribute("href",n),e&&(r.setAttribute("target","_blank"),r.setAttribute("rel","noopener noreferrer")),r},toHTMLString:(t,r)=>{const n=o(i(String(t.attrs?.href??"")));return e?`<a href="${n}" target="_blank" rel="noopener noreferrer">${r}</a>`:`<a href="${n}">${r}</a>`},parseHTML:[{tag:"a",getAttrs:t=>({href:i(t.getAttribute("href")??"")})}],sanitize:{tags:["a"],attrs:["href","target","rel"]}})}registerCommands(t){t.registerCommand("toggleLink",()=>{const e=t.getState();return this.toggleLink(t,e)}),t.registerCommand("setLink",()=>!1),t.registerCommand("removeLink",()=>{const e=t.getState();return this.removeLink(t,e)})}registerKeymap(t){t.registerKeymap({"Mod-K":()=>t.executeCommand("toggleLink")})}registerToolbarItem(t){t.registerToolbarItem({id:"link",group:"insert",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>',label:this.locale.label,tooltip:this.locale.tooltip(d("Mod-K")),command:"toggleLink",popupType:"custom",renderPopup:(t,e,r)=>{this.renderLinkPopup(t,e,r)},isActive:t=>this.isLinkActive(t),isEnabled:t=>!e(t.selection)})}isLinkActive(t){return a(t,"link")}toggleLink(t,e){return!!this.isLinkActive(e)&&this.removeLink(t,e)}addLink(t,i,o){const s=i.selection;return!!r(s)&&!e(s)&&p(t,l(i,{type:n("link"),attrs:{href:o}}))}removeLink(i,o){const a=o.selection;if(!r(a))return!1;if(e(a)){const e=o.getBlock(a.anchor.blockId);if(!e)return!1;const r=[];let s=0;for(const i of e.children){if(!("text"in i))continue;const e=s+i.text.length;r.push({pos:s,end:e,hasLink:t(i.marks,n("link"))}),s=e}const l=r.findIndex(t=>a.anchor.offset>=t.pos&&a.anchor.offset<=t.end),c=l>=0?r[l]:void 0;if(-1===l||!c?.hasLink)return!1;let p=l;for(;p>0&&r[p-1]?.hasLink;)p--;let m=l;for(;m<r.length-1&&r[m+1]?.hasLink;)m++;const d=r[p],u=r[m];if(!d||!u)return!1;const h=d.pos,k=u.end,g=o.transaction("command");return g.removeMark(a.anchor.blockId,h,k,{type:n("link")}),g.setSelection(a),i.dispatch(g.build()),!0}return p(i,s(o,n("link")))}renderLinkPopup(t,e,r){t.classList.add("notectl-link-popup");const n=e.getState();if(this.isLinkActive(n)){const n=document.createElement("button");n.type="button",n.className="notectl-link-popup__button",n.textContent=this.locale.removeLink,n.setAttribute("aria-label",this.locale.removeLinkAria),n.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation(),e.executeCommand("removeLink"),r(),e.getContainer().focus()}),t.appendChild(n)}else{const n=document.createElement("input");n.type="url",n.className="notectl-link-popup__input",n.placeholder=this.locale.urlPlaceholder,n.setAttribute("aria-label",this.locale.urlAria);const o=document.createElement("button");o.type="button",o.className="notectl-link-popup__button notectl-link-popup__button--apply",o.textContent=this.locale.apply,o.setAttribute("aria-label",this.locale.applyAria);const s=document.createElement("div");s.className="notectl-link-popup__error",s.setAttribute("role","alert"),s.hidden=!0;const a=()=>{const t=n.value.trim();if(""===t)return;const o=i(t);if(""===o)return s.textContent=this.locale.invalidUrl,s.hidden=!1,n.setAttribute("aria-invalid","true"),void n.focus();s.hidden=!0,n.removeAttribute("aria-invalid"),this.addLink(e,e.getState(),o),r(),e.getContainer().focus()};o.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation(),a()}),n.addEventListener("keydown",t=>{"Enter"===t.key&&(t.preventDefault(),a())}),n.addEventListener("input",()=>{s.hidden||(s.hidden=!0,n.removeAttribute("aria-invalid"))}),t.appendChild(n),t.appendChild(o),t.appendChild(s),requestAnimationFrame(()=>n.focus())}}};export{u as n,k as r,f as t};
2
- //# sourceMappingURL=LinkPlugin-B_ysjORS.mjs.map
@@ -1,2 +0,0 @@
1
- import{l as e,u as n}from"./Selection-HYoVFpAx.mjs";import{n as t}from"./TypedKeys-CA4bfw9O.mjs";var o=class{resolvedLocale;constructor(e){this.resolvedLocale="browser"===e?"undefined"!=typeof navigator?navigator.language.split("-")[0]??"en":"en":e}getLocale(){return this.resolvedLocale}},r=new t("locale");async function a(e,n,t){if("en"===n)return t;const o=e[`./locales/${n}.ts`];if(!o)return t;try{return(await o()).default}catch{return t}}function c(e,n){return!!n&&(e.dispatch(n),!0)}function s(e){return e.charAt(0).toUpperCase()+e.slice(1)}function i(e){return`toggle${s(e)}`}async function l(e,n,t,o){if(n)return n;const a=e.getService(r)?.getLocale()??"en";return"en"===a?t:o(a)}function u(t){const o=t.selection;return e(o)?t.getBlock(o.nodeId):n(o)?t.getBlock(o.anchor.blockId):void 0}function d(t){const o=t.selection;return e(o)?o.nodeId:n(o)?o.anchor.blockId:void 0}export{l as a,o as c,d as i,r as l,c as n,i as o,u as r,a as s,s as t};
2
- //# sourceMappingURL=PluginHelpers-D4quRJ5a.mjs.map
@@ -1,2 +0,0 @@
1
- import{a as t,s}from"./PluginHelpers-D4quRJ5a.mjs";import{t as o}from"./ShortcutFormatting-TwiufqeV.mjs";import{t as r}from"./SimpleMark-Bdqjcz0G.mjs";var i={label:"Strikethrough",tooltip:t=>`Strikethrough (${t})`},e=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-XmSFrtmd.mjs"),"./locales/de.ts":()=>import("./de-DViI26lG.mjs"),"./locales/es.ts":()=>import("./es-paXY7HFt.mjs"),"./locales/fr.ts":()=>import("./fr-ZsRdLuys.mjs"),"./locales/hi.ts":()=>import("./hi-CTWubxLY.mjs"),"./locales/pt.ts":()=>import("./pt-paXY7HFt.mjs"),"./locales/ru.ts":()=>import("./ru-Y11wuxOB.mjs"),"./locales/zh.ts":()=>import("./zh-C7iCgCRP.mjs")});async function a(t){return s(e,t,i)}var l={},h=class{id="strikethrough";name="Strikethrough";priority=22;config;locale;constructor(t){this.config={...l,...t}}async init(s){this.locale=await t(s,this.config.locale,i,a),r(s,{markSpec:{type:"strikethrough",rank:3,toDOM:()=>document.createElement("s"),toHTMLString:(t,s)=>`<s>${s}</s>`,parseHTML:[{tag:"s"},{tag:"strike"},{tag:"del"},{tag:"span",getAttrs:t=>!!t.style.textDecoration.includes("line-through")&&{}}],sanitize:{tags:["s"]}},command:"toggleStrikethrough",keyBinding:"Mod-Shift-X",toolbar:{id:"strikethrough",group:"format",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z"/></svg>',label:this.locale.label,tooltip:this.locale.tooltip(o("Mod-Shift-X"))}})}};export{i as n,a as r,h as t};
2
- //# sourceMappingURL=StrikethroughPlugin-DRuwEZhu.mjs.map
@@ -1,2 +0,0 @@
1
- import{a as e,s as o}from"./PluginHelpers-D4quRJ5a.mjs";import{a as r,t}from"./ColorValidation-DAijTjG9.mjs";import{t as a}from"./InlineStyleMarkSpec-4R6DC7ij.mjs";import{t as s}from"./color-picker-C9B2rYw-.mjs";import{a as l,i as c,t as i}from"./ColorPickerPopup-C_74bqid.mjs";var f={label:"Text Color",tooltip:"Text Color",resetLabel:"Default",ariaLabelPrefix:"Text color"},m=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-Dcl3kgtd.mjs"),"./locales/de.ts":()=>import("./de-DHs9i4af.mjs"),"./locales/es.ts":()=>import("./es-DHxdoEzR.mjs"),"./locales/fr.ts":()=>import("./fr-SbpHNrQ-.mjs"),"./locales/hi.ts":()=>import("./hi-By8YwVIX.mjs"),"./locales/pt.ts":()=>import("./pt-DgfMoLWR.mjs"),"./locales/ru.ts":()=>import("./ru-C-APN_dm.mjs"),"./locales/zh.ts":()=>import("./zh-CYV-db-K.mjs")});async function d(e){return o(m,e,f)}var p=["#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#efefef","#f3f3f3","#ffffff","#980000","#ff0000","#ff9900","#ffff00","#00ff00","#00ffff","#4a86e8","#0000ff","#9900ff","#ff00ff","#e6b8af","#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#c9daf8","#cfe2f3","#d9d2e9","#ead1dc","#dd7e6b","#ea9999","#f9cb9c","#ffe599","#b6d7a8","#a2c4c9","#a4c2f4","#9fc5e8","#b4a7d6","#d5a6bd","#cc4125","#e06666","#f6b26b","#ffd966","#93c47d","#76a5af","#6d9eeb","#6fa8dc","#8e7cc3","#c27ba0","#a61c00","#cc0000","#e69138","#f1c232","#6aa84f","#45818e","#3c78d8","#3d85c6","#674ea7","#a64d79","#85200c","#990000","#b45f06","#bf9000","#38761d","#134f5c","#1155cc","#0b5394","#351c75","#741b47"],n=class{id="textColor";name="Text Color";priority=23;config;colors;locale;constructor(e){this.config={...e},this.colors=r(e?.colors,p,"TextColorPlugin")}async init(o){this.locale=await e(o,this.config.locale,f,d),o.registerStyleSheet(s),this.registerMarkSpec(o),this.registerCommands(o),this.registerToolbarItem(o)}registerMarkSpec(e){e.registerMarkSpec(a({type:"textColor",rank:5,valueAttr:"color",domStyleProperty:"color",cssProperty:"color",validate:t,validateOnParse:!0}))}registerCommands(e){e.registerCommand("removeTextColor",()=>l(e,e.getState(),"textColor"))}registerToolbarItem(e){const o=['<svg xmlns="http://www.w3.org/2000/svg"',' viewBox="0 0 24 24">','<path d="M11 3L5.5 17h2.25l1.12-3h6.25l1.12 3h2.25L13 3h-2zm-1.38 9L12 5.67 14.38 12H9.62z"/>','<rect x="3" y="19.5" width="18" height="3"',' rx="0.5" fill="#e53935"/>',"</svg>"].join("");e.registerToolbarItem({id:"textColor",group:"format",icon:o,label:this.locale.label,tooltip:this.locale.tooltip,command:"removeTextColor",popupType:"custom",renderPopup:(e,o,r)=>{i(e,o,{markType:"textColor",colors:this.colors,columns:10,resetLabel:this.locale.resetLabel,resetCommand:"removeTextColor",ariaLabelPrefix:this.locale.ariaLabelPrefix,onClose:r})},isActive:e=>c(e,"textColor")})}};export{f as n,d as r,n as t};
2
- //# sourceMappingURL=TextColorPlugin-CViEiYZk.mjs.map
@@ -1,2 +0,0 @@
1
- import{l as t,u as e}from"./Selection-HYoVFpAx.mjs";import{r as i}from"./Platform-ByobkiCc.mjs";import{a as o,n as r,r as n,s}from"./PluginHelpers-D4quRJ5a.mjs";import{t as c}from"./ShortcutFormatting-TwiufqeV.mjs";import{t as a}from"./NodeSpecPatching-B_yLknTl.mjs";import{t as l}from"./DirectionIcons-Bbawl9ei.mjs";import{t as h}from"./TextDirectionService-OFOU6r_s.mjs";import{r as d}from"./DirectionDetection-C7XE0nxW.mjs";var u=class{context;pendingDir=null;container=null;constructor(t){this.context=t}attach(t){this.container=t,t.addEventListener("keydown",this.onKeydown),t.addEventListener("keyup",this.onKeyup)}detach(){this.container&&(this.container.removeEventListener("keydown",this.onKeydown),this.container.removeEventListener("keyup",this.onKeyup),this.container=null)}onKeydown=t=>{"Shift"!==t.key||!t.ctrlKey||t.altKey||t.metaKey?this.pendingDir=null:"ShiftLeft"===t.code?this.pendingDir="ltr":"ShiftRight"===t.code&&(this.pendingDir="rtl")};onKeyup=t=>{if("Shift"!==t.key||!this.pendingDir)return;const e=this.pendingDir;this.pendingDir=null;const i="ltr"===e?"setDirectionLTR":"setDirectionRTL";this.context.executeCommand(i)}},m={ltr:"Left to Right",rtl:"Right to Left",auto:"Auto",toolbarLabel:"Text Direction",toolbarTooltip:"Text Direction",announceLTR:"Text direction set to left-to-right",announceRTL:"Text direction set to right-to-left",announceAuto:"Text direction set to automatic"},p=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-BwaoCUVN.mjs"),"./locales/de.ts":()=>import("./de-BdD3DpUB.mjs"),"./locales/es.ts":()=>import("./es-kfKiqpyD.mjs"),"./locales/fr.ts":()=>import("./fr-BSUKEtTk.mjs"),"./locales/hi.ts":()=>import("./hi-Dt89SxNy.mjs"),"./locales/pt.ts":()=>import("./pt-CMrFpUWS.mjs"),"./locales/ru.ts":()=>import("./ru-C9yFslEG.mjs"),"./locales/zh.ts":()=>import("./zh-CnW44JEw.mjs")});async function g(t){return s(p,t,m)}var f={directableTypes:["paragraph","heading","title","subtitle","table_cell","blockquote","list_item"]},D=["ltr","rtl","auto"],y=class{id="text-direction";name="Text Direction";priority=91;config;locale;directableTypes;shiftDirHandler=null;constructor(t){this.config={...f,...t}}async init(t){this.locale=await o(t,this.config.locale,m,g),this.directableTypes=new Set(this.config.directableTypes),this.patchNodeSpecs(t),this.registerCommands(t),this.registerKeymaps(t),this.registerToolbarItem(t),this.registerService(t),i()||(this.shiftDirHandler=new u(t),this.shiftDirHandler.attach(t.getContainer()))}destroy(){this.shiftDirHandler?.detach(),this.shiftDirHandler=null}registerService(t){const e={directableTypes:this.directableTypes,getBlockDir:d};t.registerService(h,e)}patchNodeSpecs(t){a(t.getSchemaRegistry(),this.config.directableTypes,{attrName:"dir",getDefault:()=>"auto",applyToDOM:b})}registerCommands(t){t.registerCommand("setDirectionLTR",()=>{const e=this.setDirection(t,"ltr");return e&&t.announce(this.locale.announceLTR),e}),t.registerCommand("setDirectionRTL",()=>{const e=this.setDirection(t,"rtl");return e&&t.announce(this.locale.announceRTL),e}),t.registerCommand("setDirectionAuto",()=>{const e=this.setDirection(t,"auto");return e&&t.announce(this.locale.announceAuto),e}),t.registerCommand("toggleDirection",()=>{const e=n(t.getState());if(!e||!this.directableTypes.has(e.type))return!1;const i=d(e),o="auto"===i?"rtl":"rtl"===i?"ltr":"auto";return this.setDirection(t,o)})}registerKeymaps(t){t.registerKeymap({"Mod-Shift-D":()=>t.executeCommand("toggleDirection")})}registerToolbarItem(t){const e={ltr:"setDirectionLTR",rtl:"setDirectionRTL",auto:"setDirectionAuto"},i=D.map(t=>({label:this.getDirectionLabel(t),command:e[t],icon:l[t]}));t.registerToolbarItem({id:"text-direction",group:"block",icon:l.auto,label:this.locale.toolbarLabel,tooltip:`${this.locale.toolbarTooltip} (${c("Mod-Shift-D")})`,command:"setDirectionAuto",popupType:"dropdown",popupConfig:{items:i},isActive:t=>this.isNonDefaultDirection(t),isEnabled:t=>this.isDirectable(t),getIcon:t=>{const e=n(t);return e?l[d(e)]??l.auto:l.auto}})}getDirectionLabel(t){return"ltr"===t?this.locale.ltr:"rtl"===t?this.locale.rtl:this.locale.auto}setDirection(t,e){const i=t.getState(),o=this.getSelectedBlockIds(i);if(0===o.length)return!1;const n=i.transaction("command");let s=!1;for(const r of o){const t=i.getBlock(r);if(!t||!this.directableTypes.has(t.type))continue;const o=i.getNodePath(r);o&&(n.setNodeAttr(o,{...t.attrs,dir:e}),s=!0)}return!!s&&r(t,n.setSelection(i.selection).build())}getSelectedBlockIds(i){const o=i.selection;if(t(o))return[o.nodeId];if(!e(o))return[];const r=o.anchor.blockId,n=o.head.blockId;if(r===n)return[r];const s=i.getBlockOrder(),c=s.indexOf(r),a=s.indexOf(n);if(-1===c||-1===a)return[];const l=Math.min(c,a),h=Math.max(c,a);return s.slice(l,h+1)}isNonDefaultDirection(t){const e=n(t);if(!e||!this.directableTypes.has(e.type))return!1;const i=e.attrs?.dir;return null!=i&&"auto"!==i}isDirectable(t){const e=n(t);return null!=e&&this.directableTypes.has(e.type)}};function b(t,e){const i=e.attrs?.dir;"ltr"!==i&&"rtl"!==i&&"auto"!==i||t.setAttribute("dir",i)}export{m as n,g as r,y as t};
2
- //# sourceMappingURL=TextDirectionPlugin-CQGkaS2s.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TextDirectionPlugin-CQGkaS2s.mjs","names":[],"sources":["../../src/plugins/text-direction/ShiftDirectionHandler.ts","../../src/plugins/text-direction/TextDirectionLocale.ts","../../src/plugins/text-direction/TextDirectionPlugin.ts"],"sourcesContent":["/**\n * Handles Ctrl+Left-Shift → LTR and Ctrl+Right-Shift → RTL shortcuts.\n *\n * Uses a deferred pattern: sets a pending direction on Ctrl+Shift keydown,\n * and applies it on Shift keyup only if no other key was pressed in between.\n * This prevents conflicts with Ctrl+Shift+<key> shortcuts like Ctrl+Shift+D.\n */\n\nimport type { PluginContext } from '../Plugin.js';\n\nexport class ShiftDirectionHandler {\n\tprivate pendingDir: 'ltr' | 'rtl' | null = null;\n\tprivate container: HTMLElement | null = null;\n\n\tconstructor(private readonly context: PluginContext) {}\n\n\tattach(container: HTMLElement): void {\n\t\tthis.container = container;\n\t\tcontainer.addEventListener('keydown', this.onKeydown);\n\t\tcontainer.addEventListener('keyup', this.onKeyup);\n\t}\n\n\tdetach(): void {\n\t\tif (!this.container) return;\n\t\tthis.container.removeEventListener('keydown', this.onKeydown);\n\t\tthis.container.removeEventListener('keyup', this.onKeyup);\n\t\tthis.container = null;\n\t}\n\n\tprivate readonly onKeydown = (e: KeyboardEvent): void => {\n\t\tif (e.key === 'Shift' && e.ctrlKey && !e.altKey && !e.metaKey) {\n\t\t\tif (e.code === 'ShiftLeft') {\n\t\t\t\tthis.pendingDir = 'ltr';\n\t\t\t} else if (e.code === 'ShiftRight') {\n\t\t\t\tthis.pendingDir = 'rtl';\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\t// Any other keydown cancels the pending direction change\n\t\tthis.pendingDir = null;\n\t};\n\n\tprivate readonly onKeyup = (e: KeyboardEvent): void => {\n\t\tif (e.key !== 'Shift' || !this.pendingDir) return;\n\t\tconst dir: 'ltr' | 'rtl' = this.pendingDir;\n\t\tthis.pendingDir = null;\n\t\tconst command: string = dir === 'ltr' ? 'setDirectionLTR' : 'setDirectionRTL';\n\t\tthis.context.executeCommand(command);\n\t};\n}\n","/** Locale interface and default English locale for the TextDirectionPlugin. */\n\nimport { type LocaleModuleMap, loadLocaleModule } from '../shared/LocaleLoader.js';\n\nexport interface TextDirectionLocale {\n\treadonly ltr: string;\n\treadonly rtl: string;\n\treadonly auto: string;\n\treadonly toolbarLabel: string;\n\treadonly toolbarTooltip: string;\n\treadonly announceLTR: string;\n\treadonly announceRTL: string;\n\treadonly announceAuto: string;\n}\n\nexport const TEXT_DIRECTION_LOCALE_EN: TextDirectionLocale = {\n\tltr: 'Left to Right',\n\trtl: 'Right to Left',\n\tauto: 'Auto',\n\ttoolbarLabel: 'Text Direction',\n\ttoolbarTooltip: 'Text Direction',\n\tannounceLTR: 'Text direction set to left-to-right',\n\tannounceRTL: 'Text direction set to right-to-left',\n\tannounceAuto: 'Text direction set to automatic',\n};\n\nconst localeModules: LocaleModuleMap<TextDirectionLocale> = import.meta.glob<{\n\tdefault: TextDirectionLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadTextDirectionLocale(lang: string): Promise<TextDirectionLocale> {\n\treturn loadLocaleModule(localeModules, lang, TEXT_DIRECTION_LOCALE_EN);\n}\n","/**\n * Block-level text direction plugin.\n *\n * Patches NodeSpecs of directable block types to add a `dir` attribute\n * (`'ltr' | 'rtl' | 'auto'`), exposes commands and a toolbar dropdown\n * for changing block direction, registers a `Mod-Shift-D` keymap, and\n * (on Windows/Linux) attaches a `Ctrl+Shift` direction handler.\n *\n * Inline `<bdi>` isolation lives in {@link BidiIsolationPlugin}; the\n * auto-detect / inherit / preserve middlewares live in\n * {@link TextDirectionAutoPlugin}. Both consume the\n * {@link TextDirectionService} that this plugin registers.\n */\n\nimport type { BlockNode } from '../../model/Document.js';\nimport { isNodeSelection, isTextSelection } from '../../model/Selection.js';\nimport type { BlockId } from '../../model/TypeBrands.js';\nimport { isMac } from '../../platform/Platform.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { patchNodeSpecAttr } from '../shared/NodeSpecPatching.js';\nimport { dispatchIfPresent, getSelectedBlock, resolveLocale } from '../shared/PluginHelpers.js';\nimport { formatShortcut } from '../shared/ShortcutFormatting.js';\nimport { getBlockDir } from './DirectionDetection.js';\nimport { DIRECTION_ICONS } from './DirectionIcons.js';\nimport { ShiftDirectionHandler } from './ShiftDirectionHandler.js';\nimport {\n\tTEXT_DIRECTION_LOCALE_EN,\n\ttype TextDirectionLocale,\n\tloadTextDirectionLocale,\n} from './TextDirectionLocale.js';\nimport {\n\tTEXT_DIRECTION_SERVICE_KEY,\n\ttype TextDirection,\n\ttype TextDirectionService,\n} from './TextDirectionService.js';\n\nexport type { TextDirection };\n\nexport interface TextDirectionConfig {\n\t/** Block types that support direction. */\n\treadonly directableTypes: readonly string[];\n\treadonly locale?: TextDirectionLocale;\n}\n\nconst DEFAULT_CONFIG: TextDirectionConfig = {\n\tdirectableTypes: [\n\t\t'paragraph',\n\t\t'heading',\n\t\t'title',\n\t\t'subtitle',\n\t\t'table_cell',\n\t\t'blockquote',\n\t\t'list_item',\n\t],\n};\n\nconst ALL_DIRECTIONS: readonly TextDirection[] = ['ltr', 'rtl', 'auto'];\n\nexport class TextDirectionPlugin implements Plugin {\n\treadonly id = 'text-direction';\n\treadonly name = 'Text Direction';\n\treadonly priority = 91;\n\n\tprivate readonly config: TextDirectionConfig;\n\tprivate locale!: TextDirectionLocale;\n\tprivate directableTypes!: ReadonlySet<string>;\n\tprivate shiftDirHandler: ShiftDirectionHandler | null = null;\n\n\tconstructor(config?: Partial<TextDirectionConfig>) {\n\t\tthis.config = { ...DEFAULT_CONFIG, ...config };\n\t}\n\n\tasync init(context: PluginContext): Promise<void> {\n\t\tthis.locale = await resolveLocale(\n\t\t\tcontext,\n\t\t\tthis.config.locale,\n\t\t\tTEXT_DIRECTION_LOCALE_EN,\n\t\t\tloadTextDirectionLocale,\n\t\t);\n\n\t\tthis.directableTypes = new Set(this.config.directableTypes);\n\t\tthis.patchNodeSpecs(context);\n\t\tthis.registerCommands(context);\n\t\tthis.registerKeymaps(context);\n\t\tthis.registerToolbarItem(context);\n\t\tthis.registerService(context);\n\n\t\tif (!isMac()) {\n\t\t\tthis.shiftDirHandler = new ShiftDirectionHandler(context);\n\t\t\tthis.shiftDirHandler.attach(context.getContainer());\n\t\t}\n\t}\n\n\tdestroy(): void {\n\t\tthis.shiftDirHandler?.detach();\n\t\tthis.shiftDirHandler = null;\n\t}\n\n\tprivate registerService(context: PluginContext): void {\n\t\tconst service: TextDirectionService = {\n\t\t\tdirectableTypes: this.directableTypes,\n\t\t\tgetBlockDir,\n\t\t};\n\t\tcontext.registerService(TEXT_DIRECTION_SERVICE_KEY, service);\n\t}\n\n\tprivate patchNodeSpecs(context: PluginContext): void {\n\t\tpatchNodeSpecAttr(context.getSchemaRegistry(), this.config.directableTypes, {\n\t\t\tattrName: 'dir',\n\t\t\tgetDefault: () => 'auto',\n\t\t\tapplyToDOM: applyDirection,\n\t\t});\n\t}\n\n\tprivate registerCommands(context: PluginContext): void {\n\t\tcontext.registerCommand('setDirectionLTR', () => {\n\t\t\tconst result: boolean = this.setDirection(context, 'ltr');\n\t\t\tif (result) context.announce(this.locale.announceLTR);\n\t\t\treturn result;\n\t\t});\n\n\t\tcontext.registerCommand('setDirectionRTL', () => {\n\t\t\tconst result: boolean = this.setDirection(context, 'rtl');\n\t\t\tif (result) context.announce(this.locale.announceRTL);\n\t\t\treturn result;\n\t\t});\n\n\t\tcontext.registerCommand('setDirectionAuto', () => {\n\t\t\tconst result: boolean = this.setDirection(context, 'auto');\n\t\t\tif (result) context.announce(this.locale.announceAuto);\n\t\t\treturn result;\n\t\t});\n\n\t\tcontext.registerCommand('toggleDirection', () => {\n\t\t\tconst state = context.getState();\n\t\t\tconst block = getSelectedBlock(state);\n\t\t\tif (!block || !this.directableTypes.has(block.type)) return false;\n\n\t\t\tconst current: TextDirection = getBlockDir(block);\n\t\t\tconst next: TextDirection = current === 'auto' ? 'rtl' : current === 'rtl' ? 'ltr' : 'auto';\n\t\t\treturn this.setDirection(context, next);\n\t\t});\n\t}\n\n\tprivate registerKeymaps(context: PluginContext): void {\n\t\tcontext.registerKeymap({\n\t\t\t'Mod-Shift-D': () => context.executeCommand('toggleDirection'),\n\t\t});\n\t}\n\n\tprivate registerToolbarItem(context: PluginContext): void {\n\t\tconst commandNames: Readonly<Record<TextDirection, string>> = {\n\t\t\tltr: 'setDirectionLTR',\n\t\t\trtl: 'setDirectionRTL',\n\t\t\tauto: 'setDirectionAuto',\n\t\t};\n\n\t\tconst dropdownItems = ALL_DIRECTIONS.map((dir) => ({\n\t\t\tlabel: this.getDirectionLabel(dir),\n\t\t\tcommand: commandNames[dir],\n\t\t\ticon: DIRECTION_ICONS[dir],\n\t\t}));\n\n\t\tcontext.registerToolbarItem({\n\t\t\tid: 'text-direction',\n\t\t\tgroup: 'block',\n\t\t\ticon: DIRECTION_ICONS.auto,\n\t\t\tlabel: this.locale.toolbarLabel,\n\t\t\ttooltip: `${this.locale.toolbarTooltip} (${formatShortcut('Mod-Shift-D')})`,\n\t\t\tcommand: 'setDirectionAuto',\n\t\t\tpopupType: 'dropdown',\n\t\t\tpopupConfig: { items: dropdownItems },\n\t\t\tisActive: (state) => this.isNonDefaultDirection(state),\n\t\t\tisEnabled: (state) => this.isDirectable(state),\n\t\t\tgetIcon: (state) => {\n\t\t\t\tconst block = getSelectedBlock(state);\n\t\t\t\tif (!block) return DIRECTION_ICONS.auto;\n\t\t\t\tconst dir: TextDirection = getBlockDir(block);\n\t\t\t\treturn DIRECTION_ICONS[dir] ?? DIRECTION_ICONS.auto;\n\t\t\t},\n\t\t});\n\t}\n\n\tprivate getDirectionLabel(dir: TextDirection): string {\n\t\tif (dir === 'ltr') return this.locale.ltr;\n\t\tif (dir === 'rtl') return this.locale.rtl;\n\t\treturn this.locale.auto;\n\t}\n\n\tprivate setDirection(context: PluginContext, direction: TextDirection): boolean {\n\t\tconst state = context.getState();\n\t\tconst blockIds: BlockId[] = this.getSelectedBlockIds(state);\n\t\tif (blockIds.length === 0) return false;\n\n\t\tconst tb = state.transaction('command');\n\t\tlet changed = false;\n\n\t\tfor (const id of blockIds) {\n\t\t\tconst block = state.getBlock(id);\n\t\t\tif (!block || !this.directableTypes.has(block.type)) continue;\n\n\t\t\tconst path = state.getNodePath(id);\n\t\t\tif (!path) continue;\n\n\t\t\ttb.setNodeAttr(path, { ...block.attrs, dir: direction });\n\t\t\tchanged = true;\n\t\t}\n\n\t\tif (!changed) return false;\n\n\t\treturn dispatchIfPresent(context, tb.setSelection(state.selection).build());\n\t}\n\n\tprivate getSelectedBlockIds(state: EditorState): BlockId[] {\n\t\tconst sel = state.selection;\n\n\t\tif (isNodeSelection(sel)) {\n\t\t\treturn [sel.nodeId];\n\t\t}\n\n\t\tif (!isTextSelection(sel)) return [];\n\n\t\tconst anchorId: BlockId = sel.anchor.blockId;\n\t\tconst headId: BlockId = sel.head.blockId;\n\n\t\tif (anchorId === headId) return [anchorId];\n\n\t\tconst order: readonly BlockId[] = state.getBlockOrder();\n\t\tconst anchorIdx: number = order.indexOf(anchorId);\n\t\tconst headIdx: number = order.indexOf(headId);\n\t\tif (anchorIdx === -1 || headIdx === -1) return [];\n\n\t\tconst from: number = Math.min(anchorIdx, headIdx);\n\t\tconst to: number = Math.max(anchorIdx, headIdx);\n\t\treturn order.slice(from, to + 1) as BlockId[];\n\t}\n\n\tprivate isNonDefaultDirection(state: EditorState): boolean {\n\t\tconst block = getSelectedBlock(state);\n\t\tif (!block || !this.directableTypes.has(block.type)) return false;\n\t\tconst dir = block.attrs?.dir;\n\t\treturn dir != null && dir !== 'auto';\n\t}\n\n\tprivate isDirectable(state: EditorState): boolean {\n\t\tconst block = getSelectedBlock(state);\n\t\treturn block != null && this.directableTypes.has(block.type);\n\t}\n}\n\nfunction applyDirection(el: HTMLElement, node: BlockNode): void {\n\tconst dir =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ACX,CAEA,QAAK,GAEE,EAAkB,EAAS,EAAG,aAAa,EAAM,WAAW,QACpE,CAEA,mBAAA,CAA4B,GAC3B,MAAM,EAAM,EAAM,UAElB,GAAI,EAAgB,GACnB,MAAO,CAAC,EAAI,QAGb,IAAK,EAAgB,GAAM,MAAO,GAElC,MAAM,EAAoB,EAAI,OAAO,QAC/B,EAAkB,EAAI,KAAK,QAEjC,GAAI,IAAa,EAAQ,MAAO,CAAC,GAEjC,MAAM,EAA4B,EAAM,gBAClC,EAAoB,EAAM,QAAQ,GAClC,EAAkB,EAAM,QAAQ,GACtC,IAAkB,IAAd,IAAgC,IAAZ,EAAgB,MAAO,GAE/C,MAAM,EAAe,KAAK,IAAI,EAAW,GACnC,EAAa,KAAK,IAAI,EAAW,GACvC,OAAO,EAAM,MAAM,EAAM,EAAK,EAC/B,CAEA,qBAAA,CAA8B,GAC7B,MAAM,EAAQ,EAAiB,GAC/B,IAAK,IAAU,KAAK,gBAAgB,IAAI,EAAM,MAAO,OAAO,EAC5D,MAAM,EAAM,EAAM,OAAO,IACzB,OAAc,MAAP,GAAuB,SAAR,CACvB,CAEA,YAAA,CAAqB,GACpB,MAAM,EAAQ,EAAiB,GAC/B,OAAgB,MAAT,GAAiB,KAAK,gBAAgB,IAAI,EAAM,KACxD,GAGD,SAAS,EAAe,EAAiB,GACxC,MAAM,EAAM,EAAK,OAAO,IACZ,QAAR,GAAyB,QAAR,GAAyB,SAAR,GACrC,EAAG,aAAa,MAAO,EAEzB"}
@@ -1,2 +0,0 @@
1
- import{t}from"./TextFormattingPlugin-CpyZgtLi.mjs";import{t as o}from"./FontPlugin-1VYDwETg.mjs";import{n as i}from"./AlignmentPlugin-h6sx-yIf.mjs";import{t as m}from"./BidiIsolationPlugin-Bm3h9J15.mjs";import{t as n}from"./BlockquotePlugin-CxrCA0vY.mjs";import{t as r}from"./CodeBlockPlugin-CcB0WaIz.mjs";import{t as e}from"./FontSizePlugin-L1uDVsKY.mjs";import{t as s}from"./FormulaPlugin-66Cc9sH2.mjs";import{t as l}from"./HardBreakPlugin-9DOyCyyM.mjs";import{t as a}from"./HeadingPlugin-SICF6Tm0.mjs";import{t as u}from"./HighlightPlugin-B3b_qe68.mjs";import{t as g}from"./HorizontalRulePlugin-BrFlrpmb.mjs";import{t as f}from"./ImagePlugin-eRVtFFou.mjs";import{t as p}from"./InlineCodePlugin-Cj1EZ3x2.mjs";import{t as P}from"./LinkPlugin-B_ysjORS.mjs";import{t as j}from"./ListPlugin-C0BV8CnQ.mjs";import{t as w}from"./PrintPlugin-CXDFFzWB.mjs";import{t as d}from"./SmartPastePlugin-BhkoH03E.mjs";import{t as h}from"./StrikethroughPlugin-DRuwEZhu.mjs";import{t as c}from"./SuperSubPlugin-IZ_x8GS-.mjs";import{t as k}from"./TablePlugin-CRp4qSZE.mjs";import{t as x}from"./TextColorPlugin-CViEiYZk.mjs";import{t as b}from"./TextDirectionAutoPlugin-CzWJjrvG.mjs";import{t as S}from"./TextDirectionPlugin-CQGkaS2s.mjs";import{t as B}from"./VideoPlugin-mXIDODzC.mjs";function C(C){return{toolbar:[[new o({fonts:[],...C?.font}),new e(C?.fontSize)],[new t(C?.textFormatting),new h(C?.strikethrough),new p(C?.inlineCode),new c(C?.superSub),new m(C?.bidiIsolation)],[new x(C?.textColor),new u(C?.highlight)],[new a(C?.heading),new n(C?.blockquote),new r(C?.codeBlock)],[new i(C?.alignment),new S(C?.textDirection)],[new j(C?.list)],[new P(C?.link),new k(C?.table),new g(C?.horizontalRule),new f(C?.image),new s(C?.formula),new B(C?.video)],[new w(C?.print)]],plugins:[new l,new d(C?.smartPaste),new b(C?.textDirectionAuto)]}}export{C as t};
2
- //# sourceMappingURL=full-CHkwduuY.mjs.map
@@ -1,2 +0,0 @@
1
- import{t}from"./FontPlugin-1VYDwETg.mjs";function n(n){return{toolbar:[[new t({fonts:[],...n?.font})]],plugins:[]}}export{n as t};
2
- //# sourceMappingURL=minimal-D5v-raei.mjs.map