@notectl/core 1.7.0 → 1.7.1

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 (195) hide show
  1. package/README.md +2 -2
  2. package/dist/chunks/{AttrRegistry-I-VdmRnN.mjs → AttrRegistry-Ci0qAvtS.mjs} +2 -2
  3. package/dist/chunks/{AttrRegistry-I-VdmRnN.mjs.map → AttrRegistry-Ci0qAvtS.mjs.map} +1 -1
  4. package/dist/chunks/AttributedMarkCommands-BETuHXj8.mjs +58 -0
  5. package/dist/chunks/AttributedMarkCommands-BETuHXj8.mjs.map +1 -0
  6. package/dist/chunks/{CaretNavigation-CAJXoaae.mjs → CaretNavigation-qLfeL0So.mjs} +56 -56
  7. package/dist/chunks/{CaretNavigation-CAJXoaae.mjs.map → CaretNavigation-qLfeL0So.mjs.map} +1 -1
  8. package/dist/chunks/ColorGrid-BBkN0AOb.mjs +80 -0
  9. package/dist/chunks/ColorGrid-BBkN0AOb.mjs.map +1 -0
  10. package/dist/chunks/ColorPickerPopup-D3ysvOH-.mjs +37 -0
  11. package/dist/chunks/ColorPickerPopup-D3ysvOH-.mjs.map +1 -0
  12. package/dist/chunks/ColorValidation-CV4f1wu6.mjs +39 -0
  13. package/dist/chunks/ColorValidation-CV4f1wu6.mjs.map +1 -0
  14. package/dist/chunks/{Document-CuwE73FF.mjs → Document-DfZ1NOjs.mjs} +15 -15
  15. package/dist/chunks/{Document-CuwE73FF.mjs.map → Document-DfZ1NOjs.mjs.map} +1 -1
  16. package/dist/chunks/MarkCommands-uybmkw9l.mjs +94 -0
  17. package/dist/chunks/MarkCommands-uybmkw9l.mjs.map +1 -0
  18. package/dist/chunks/{NavigationUtils-CyW0Vo8A.mjs → NavigationUtils-Cspt2ZrK.mjs} +3 -3
  19. package/dist/chunks/{NavigationUtils-CyW0Vo8A.mjs.map → NavigationUtils-Cspt2ZrK.mjs.map} +1 -1
  20. package/dist/chunks/{NodeResolver-B-wzthAQ.mjs → NodeResolver-CzLmmrph.mjs} +2 -2
  21. package/dist/chunks/{NodeResolver-B-wzthAQ.mjs.map → NodeResolver-CzLmmrph.mjs.map} +1 -1
  22. package/dist/chunks/PopupPositioning-Cn6L_mO2.mjs +30 -0
  23. package/dist/chunks/PopupPositioning-Cn6L_mO2.mjs.map +1 -0
  24. package/dist/chunks/RangeIterator-Bye0UtbY.mjs +16 -0
  25. package/dist/chunks/RangeIterator-Bye0UtbY.mjs.map +1 -0
  26. package/dist/chunks/{Selection-DmFDwiPJ.mjs → Selection-BRTab5hO.mjs} +7 -7
  27. package/dist/chunks/{Selection-DmFDwiPJ.mjs.map → Selection-BRTab5hO.mjs.map} +1 -1
  28. package/dist/chunks/ToolbarItem-BpZggUGo.mjs.map +1 -1
  29. package/dist/chunks/{ToolbarKeyboardNav-B32OMv8r.mjs → ToolbarKeyboardNav-DhpL8zNV.mjs} +3 -3
  30. package/dist/chunks/{ToolbarKeyboardNav-B32OMv8r.mjs.map → ToolbarKeyboardNav-DhpL8zNV.mjs.map} +1 -1
  31. package/dist/chunks/{ToolbarPlugin-B6JETWaw.mjs → ToolbarPlugin-B7oJRzpl.mjs} +339 -127
  32. package/dist/chunks/ToolbarPlugin-B7oJRzpl.mjs.map +1 -0
  33. package/dist/chunks/{index-CAV2N-fF.mjs → index-Bt_d4IqB.mjs} +8 -8
  34. package/dist/chunks/{index-CAV2N-fF.mjs.map → index-Bt_d4IqB.mjs.map} +1 -1
  35. package/dist/chunks/{index-pxbbDHVH.mjs → index-CFJFD4lF.mjs} +3 -3
  36. package/dist/chunks/{index-pxbbDHVH.mjs.map → index-CFJFD4lF.mjs.map} +1 -1
  37. package/dist/chunks/{index-C0cEs7Jc.mjs → index-CFPP456m.mjs} +10 -10
  38. package/dist/chunks/{index-C0cEs7Jc.mjs.map → index-CFPP456m.mjs.map} +1 -1
  39. package/dist/chunks/{index-FlTg80Pk.mjs → index-CH1r7DL-.mjs} +257 -298
  40. package/dist/chunks/index-CH1r7DL-.mjs.map +1 -0
  41. package/dist/chunks/{index-D0s0Q8Wc.mjs → index-CfyS_pgH.mjs} +25 -18
  42. package/dist/chunks/index-CfyS_pgH.mjs.map +1 -0
  43. package/dist/chunks/{index-CflvcXSd.mjs → index-Ckzqtn5D.mjs} +17 -14
  44. package/dist/chunks/{index-CflvcXSd.mjs.map → index-Ckzqtn5D.mjs.map} +1 -1
  45. package/dist/chunks/{index-C9gc3Bws.mjs → index-CrKz_IEn.mjs} +32 -32
  46. package/dist/chunks/{index-C9gc3Bws.mjs.map → index-CrKz_IEn.mjs.map} +1 -1
  47. package/dist/chunks/{index-DMt3ojrY.mjs → index-DGKQhSAl.mjs} +2 -2
  48. package/dist/chunks/{index-DMt3ojrY.mjs.map → index-DGKQhSAl.mjs.map} +1 -1
  49. package/dist/chunks/{index-CoeD4T9-.mjs → index-DIvHQtE2.mjs} +10 -7
  50. package/dist/chunks/{index-CoeD4T9-.mjs.map → index-DIvHQtE2.mjs.map} +1 -1
  51. package/dist/chunks/index-DayTn6Re.mjs +166 -0
  52. package/dist/chunks/index-DayTn6Re.mjs.map +1 -0
  53. package/dist/chunks/index-Deag_lVi.mjs +121 -0
  54. package/dist/chunks/index-Deag_lVi.mjs.map +1 -0
  55. package/dist/chunks/{index--z_Txzej.mjs → index-DmuuFS5D.mjs} +6 -6
  56. package/dist/chunks/{index--z_Txzej.mjs.map → index-DmuuFS5D.mjs.map} +1 -1
  57. package/dist/chunks/{index-B9GkDVsx.mjs → index-DoCvDkfj.mjs} +77 -94
  58. package/dist/chunks/index-DoCvDkfj.mjs.map +1 -0
  59. package/dist/chunks/index-DuRNETFv.mjs +296 -0
  60. package/dist/chunks/index-DuRNETFv.mjs.map +1 -0
  61. package/dist/chunks/{index-B-NSeaM4.mjs → index-Dum8yE_t.mjs} +12 -12
  62. package/dist/chunks/{index-B-NSeaM4.mjs.map → index-Dum8yE_t.mjs.map} +1 -1
  63. package/dist/chunks/{index-CNs4QQ8l.mjs → index-Dy6SllXW.mjs} +52 -64
  64. package/dist/chunks/index-Dy6SllXW.mjs.map +1 -0
  65. package/dist/chunks/{index-D8tbbW97.mjs → index-E7OgN7hM.mjs} +2 -2
  66. package/dist/chunks/{index-D8tbbW97.mjs.map → index-E7OgN7hM.mjs.map} +1 -1
  67. package/dist/chunks/{index-DyIwN_67.mjs → index-yhz2qeeh.mjs} +220 -218
  68. package/dist/chunks/index-yhz2qeeh.mjs.map +1 -0
  69. package/dist/commands/AttributedMarkCommands.d.ts +46 -0
  70. package/dist/commands/AttributedMarkCommands.d.ts.map +1 -0
  71. package/dist/commands/CommandHelpers.d.ts +21 -0
  72. package/dist/commands/CommandHelpers.d.ts.map +1 -0
  73. package/dist/commands/Commands.d.ts +2 -8
  74. package/dist/commands/Commands.d.ts.map +1 -1
  75. package/dist/commands/DeleteCommands.d.ts.map +1 -1
  76. package/dist/commands/GapCursorCommands.d.ts.map +1 -1
  77. package/dist/commands/NodeSelectionCommands.d.ts.map +1 -1
  78. package/dist/commands/PasteCommand.d.ts.map +1 -1
  79. package/dist/commands/RangeIterator.d.ts +10 -0
  80. package/dist/commands/RangeIterator.d.ts.map +1 -0
  81. package/dist/editor/DocumentParser.d.ts.map +1 -1
  82. package/dist/editor/DocumentSerializer.d.ts +2 -0
  83. package/dist/editor/DocumentSerializer.d.ts.map +1 -1
  84. package/dist/editor/MarkSerializer.d.ts +11 -0
  85. package/dist/editor/MarkSerializer.d.ts.map +1 -0
  86. package/dist/editor/NotectlEditor.d.ts +6 -3
  87. package/dist/editor/NotectlEditor.d.ts.map +1 -1
  88. package/dist/editor/PaperLayoutController.d.ts +2 -0
  89. package/dist/editor/PaperLayoutController.d.ts.map +1 -1
  90. package/dist/editor/styles/font-select.d.ts +1 -1
  91. package/dist/editor/styles/font-select.d.ts.map +1 -1
  92. package/dist/editor/styles/font-size-select.d.ts +1 -1
  93. package/dist/editor/styles/font-size-select.d.ts.map +1 -1
  94. package/dist/editor/styles/heading-select.d.ts +1 -1
  95. package/dist/editor/styles/heading-select.d.ts.map +1 -1
  96. package/dist/editor/styles/toolbar.d.ts +1 -1
  97. package/dist/editor/styles/toolbar.d.ts.map +1 -1
  98. package/dist/index.d.ts +8 -2
  99. package/dist/index.d.ts.map +1 -1
  100. package/dist/input/ClipboardHandler.d.ts +0 -2
  101. package/dist/input/ClipboardHandler.d.ts.map +1 -1
  102. package/dist/model/MarkSpec.d.ts +6 -0
  103. package/dist/model/MarkSpec.d.ts.map +1 -1
  104. package/dist/notectl-core.mjs +2227 -2090
  105. package/dist/notectl-core.mjs.map +1 -1
  106. package/dist/notectl-core.umd.js +2527 -2337
  107. package/dist/notectl-core.umd.js.map +1 -1
  108. package/dist/plugins/PluginManager.d.ts +2 -0
  109. package/dist/plugins/PluginManager.d.ts.map +1 -1
  110. package/dist/plugins/alignment.mjs +1 -1
  111. package/dist/plugins/blockquote.mjs +1 -1
  112. package/dist/plugins/caret-navigation.mjs +1 -1
  113. package/dist/plugins/code-block.mjs +1 -1
  114. package/dist/plugins/font/FontPlugin.d.ts +0 -6
  115. package/dist/plugins/font/FontPlugin.d.ts.map +1 -1
  116. package/dist/plugins/font-size/FontSizeOperations.d.ts.map +1 -1
  117. package/dist/plugins/font-size/FontSizePlugin.d.ts +0 -5
  118. package/dist/plugins/font-size/FontSizePlugin.d.ts.map +1 -1
  119. package/dist/plugins/font-size.mjs +1 -1
  120. package/dist/plugins/font.mjs +1 -1
  121. package/dist/plugins/gap-cursor.mjs +7 -7
  122. package/dist/plugins/hard-break.mjs +2 -25
  123. package/dist/plugins/hard-break.mjs.map +1 -1
  124. package/dist/plugins/heading/HeadingBlockTypePicker.d.ts +1 -7
  125. package/dist/plugins/heading/HeadingBlockTypePicker.d.ts.map +1 -1
  126. package/dist/plugins/heading/HeadingPlugin.d.ts +0 -6
  127. package/dist/plugins/heading/HeadingPlugin.d.ts.map +1 -1
  128. package/dist/plugins/heading.mjs +1 -1
  129. package/dist/plugins/highlight/HighlightPlugin.d.ts.map +1 -1
  130. package/dist/plugins/highlight.mjs +1 -1
  131. package/dist/plugins/horizontal-rule.mjs +1 -1
  132. package/dist/plugins/image/ImagePlugin.d.ts.map +1 -1
  133. package/dist/plugins/image.mjs +1 -1
  134. package/dist/plugins/link/LinkPlugin.d.ts.map +1 -1
  135. package/dist/plugins/link.mjs +1 -1
  136. package/dist/plugins/list/ListPlugin.d.ts.map +1 -1
  137. package/dist/plugins/list.mjs +1 -1
  138. package/dist/plugins/shared/ColorGrid.d.ts +25 -0
  139. package/dist/plugins/shared/ColorGrid.d.ts.map +1 -0
  140. package/dist/plugins/shared/ColorMarkOperations.d.ts.map +1 -1
  141. package/dist/plugins/shared/ColorPickerPopup.d.ts.map +1 -1
  142. package/dist/plugins/shared/ColorValidation.d.ts +13 -2
  143. package/dist/plugins/shared/ColorValidation.d.ts.map +1 -1
  144. package/dist/plugins/shared/PopupKeyboardPatterns.d.ts +43 -0
  145. package/dist/plugins/shared/PopupKeyboardPatterns.d.ts.map +1 -0
  146. package/dist/plugins/shared/PopupManager.d.ts +45 -0
  147. package/dist/plugins/shared/PopupManager.d.ts.map +1 -0
  148. package/dist/plugins/shared/PopupPositioning.d.ts +21 -0
  149. package/dist/plugins/shared/PopupPositioning.d.ts.map +1 -0
  150. package/dist/plugins/strikethrough.mjs +1 -1
  151. package/dist/plugins/super-sub.mjs +1 -1
  152. package/dist/plugins/table/TableBorderColor.d.ts.map +1 -1
  153. package/dist/plugins/table/TableContextMenu.d.ts +2 -1
  154. package/dist/plugins/table/TableContextMenu.d.ts.map +1 -1
  155. package/dist/plugins/table.mjs +1 -1
  156. package/dist/plugins/text-color/TextColorPlugin.d.ts.map +1 -1
  157. package/dist/plugins/text-color.mjs +1 -1
  158. package/dist/plugins/text-formatting.mjs +1 -1
  159. package/dist/plugins/toolbar/ToolbarItem.d.ts +11 -2
  160. package/dist/plugins/toolbar/ToolbarItem.d.ts.map +1 -1
  161. package/dist/plugins/toolbar/ToolbarOverflowController.d.ts +5 -1
  162. package/dist/plugins/toolbar/ToolbarOverflowController.d.ts.map +1 -1
  163. package/dist/plugins/toolbar/ToolbarPlugin.d.ts +1 -0
  164. package/dist/plugins/toolbar/ToolbarPlugin.d.ts.map +1 -1
  165. package/dist/plugins/toolbar/ToolbarPopupController.d.ts +9 -1
  166. package/dist/plugins/toolbar/ToolbarPopupController.d.ts.map +1 -1
  167. package/dist/plugins/toolbar/index.d.ts +1 -1
  168. package/dist/plugins/toolbar/index.d.ts.map +1 -1
  169. package/dist/plugins/toolbar.mjs +1 -1
  170. package/dist/state/BlockTreeOps.d.ts +21 -0
  171. package/dist/state/BlockTreeOps.d.ts.map +1 -0
  172. package/dist/state/InlineContentOps.d.ts +37 -0
  173. package/dist/state/InlineContentOps.d.ts.map +1 -0
  174. package/dist/state/StepApplication.d.ts.map +1 -1
  175. package/dist/test/PluginTestUtils.d.ts +4 -0
  176. package/dist/test/PluginTestUtils.d.ts.map +1 -1
  177. package/package.json +2 -2
  178. package/dist/chunks/ColorNames-BdsHwA2f.mjs +0 -59
  179. package/dist/chunks/ColorNames-BdsHwA2f.mjs.map +0 -1
  180. package/dist/chunks/ColorPickerPopup-xL8ZUfpB.mjs +0 -125
  181. package/dist/chunks/ColorPickerPopup-xL8ZUfpB.mjs.map +0 -1
  182. package/dist/chunks/Commands-CicwYoTQ.mjs +0 -286
  183. package/dist/chunks/Commands-CicwYoTQ.mjs.map +0 -1
  184. package/dist/chunks/MarkCommands-CC37WA7Z.mjs +0 -94
  185. package/dist/chunks/MarkCommands-CC37WA7Z.mjs.map +0 -1
  186. package/dist/chunks/ToolbarPlugin-B6JETWaw.mjs.map +0 -1
  187. package/dist/chunks/index-B9GkDVsx.mjs.map +0 -1
  188. package/dist/chunks/index-CKPrAOr6.mjs +0 -209
  189. package/dist/chunks/index-CKPrAOr6.mjs.map +0 -1
  190. package/dist/chunks/index-CNs4QQ8l.mjs.map +0 -1
  191. package/dist/chunks/index-D0s0Q8Wc.mjs.map +0 -1
  192. package/dist/chunks/index-DfzCof6H.mjs +0 -191
  193. package/dist/chunks/index-DfzCof6H.mjs.map +0 -1
  194. package/dist/chunks/index-DyIwN_67.mjs.map +0 -1
  195. package/dist/chunks/index-FlTg80Pk.mjs.map +0 -1
@@ -1,5 +1,6 @@
1
1
  import { BlockId } from '../../model/TypeBrands.js';
2
2
  import { PluginContext } from '../Plugin.js';
3
+ import { PopupManager } from '../shared/PopupManager.js';
3
4
  import { TableLocale } from './TableLocale.js';
4
5
  export interface TableContextMenuHandle {
5
6
  isOpen(): boolean;
@@ -10,5 +11,5 @@ export interface TableContextMenuHandle {
10
11
  * Creates and displays an accessible context menu for table operations.
11
12
  * Attaches to the provided container (shadow root or editor container).
12
13
  */
13
- export declare function createTableContextMenu(container: HTMLElement, context: PluginContext, tableId: BlockId, anchorRect: DOMRect, onClosed?: () => void, locale?: TableLocale): TableContextMenuHandle;
14
+ export declare function createTableContextMenu(container: HTMLElement, context: PluginContext, tableId: BlockId, anchorRect: DOMRect, onClosed?: () => void, locale?: TableLocale, popupManager?: PopupManager): TableContextMenuHandle;
14
15
  //# sourceMappingURL=TableContextMenu.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableContextMenu.d.ts","sourceRoot":"","sources":["../../../src/plugins/table/TableContextMenu.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAIrE,MAAM,WAAW,sBAAsB;IACtC,MAAM,IAAI,OAAO,CAAC;IAClB,KAAK,IAAI,IAAI,CAAC;IACd,OAAO,IAAI,IAAI,CAAC;CAChB;AAyCD;;;GAGG;AACH,wBAAgB,sBAAsB,CACrC,SAAS,EAAE,WAAW,EACtB,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,OAAO,EACnB,QAAQ,CAAC,EAAE,MAAM,IAAI,EACrB,MAAM,GAAE,WAA6B,GACnC,sBAAsB,CAgQxB"}
1
+ {"version":3,"file":"TableContextMenu.d.ts","sourceRoot":"","sources":["../../../src/plugins/table/TableContextMenu.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAe,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAI3E,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAIrE,MAAM,WAAW,sBAAsB;IACtC,MAAM,IAAI,OAAO,CAAC;IAClB,KAAK,IAAI,IAAI,CAAC;IACd,OAAO,IAAI,IAAI,CAAC;CAChB;AAyCD;;;GAGG;AACH,wBAAgB,sBAAsB,CACrC,SAAS,EAAE,WAAW,EACtB,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,OAAO,EACnB,QAAQ,CAAC,EAAE,MAAM,IAAI,EACrB,MAAM,GAAE,WAA6B,EACrC,YAAY,CAAC,EAAE,YAAY,GACzB,sBAAsB,CA2RxB"}
@@ -1,4 +1,4 @@
1
- import { B, b, c, d, e, f, g, h, i, T, j, m, k, n, l, r, s } from "../chunks/index-FlTg80Pk.mjs";
1
+ import { B, b, c, d, e, f, g, h, i, T, j, m, k, n, l, r, s } from "../chunks/index-CH1r7DL-.mjs";
2
2
  export {
3
3
  B as BORDER_COLOR_PALETTE,
4
4
  b as TABLE_LOCALE_AR,
@@ -1 +1 @@
1
- {"version":3,"file":"TextColorPlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/text-color/TextColorPlugin.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAI1D,OAAO,EAAsB,KAAK,eAAe,EAAE,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Q,CAAC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,2EAA2E;IAC3E,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC;CAClC;AAsFD,qBAAa,eAAgB,YAAW,MAAM;IAC7C,QAAQ,CAAC,EAAE,eAAe;IAC1B,QAAQ,CAAC,IAAI,gBAAgB;IAC7B,QAAQ,CAAC,QAAQ,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IACzC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;IAC3C,OAAO,CAAC,MAAM,CAAmB;gBAErB,MAAM,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC;IAK7C,IAAI,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IASlC,OAAO,CAAC,gBAAgB;IAqCxB,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,mBAAmB;CAoC3B"}
@@ -1,4 +1,4 @@
1
- import { T } from "../chunks/index-CflvcXSd.mjs";
1
+ import { T } from "../chunks/index-Ckzqtn5D.mjs";
2
2
  export {
3
3
  T as TextColorPlugin
4
4
  };
@@ -1,4 +1,4 @@
1
- import { T } from "../chunks/index-D8tbbW97.mjs";
1
+ import { T } from "../chunks/index-E7OgN7hM.mjs";
2
2
  export {
3
3
  T as TextFormattingPlugin
4
4
  };
@@ -13,7 +13,7 @@ export interface DropdownConfig {
13
13
  }[];
14
14
  }
15
15
  export type ToolbarGroup = 'format' | 'block' | 'insert' | (string & {});
16
- export type PopupType = 'gridPicker' | 'dropdown' | 'custom';
16
+ export type PopupType = 'gridPicker' | 'dropdown' | 'custom' | 'combobox';
17
17
  interface ToolbarItemBase {
18
18
  readonly id: string;
19
19
  /** Grouping key: 'format' | 'insert' | 'block' or custom. */
@@ -53,7 +53,16 @@ interface ToolbarItemCustomPopup extends ToolbarItemBase {
53
53
  readonly popupType: 'custom';
54
54
  renderPopup(container: HTMLElement, context: PluginContext, onClose: () => void): void;
55
55
  }
56
- export type ToolbarItem = ToolbarItemNoPopup | ToolbarItemGridPicker | ToolbarItemDropdown | ToolbarItemCustomPopup;
56
+ export interface ToolbarItemCombobox extends Omit<ToolbarItemBase, 'icon'> {
57
+ readonly popupType: 'combobox';
58
+ /** Optional icon — combobox items typically display a text label instead. */
59
+ readonly icon?: string;
60
+ /** Pure function returning the current label text. Called on every state change. */
61
+ getLabel(state: EditorState): string;
62
+ /** Renders the popup content when the combobox is opened. */
63
+ renderPopup(container: HTMLElement, context: PluginContext, onClose: () => void): void;
64
+ }
65
+ export type ToolbarItem = ToolbarItemNoPopup | ToolbarItemGridPicker | ToolbarItemDropdown | ToolbarItemCustomPopup | ToolbarItemCombobox;
57
66
  /**
58
67
  * Formats a keymap binding string into a human-readable shortcut,
59
68
  * using platform-appropriate modifier symbols (⌘ on Mac, Ctrl on others).
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarItem.d.ts","sourceRoot":"","sources":["../../../src/plugins/toolbar/ToolbarItem.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3C;AAED,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,KAAK,EAAE,SAAS;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC7E;AAED,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,OAAO,G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M,IAAI,GAAG,IAAI,CAAC;CACvF;AAED,MAAM,MAAM,WAAW,GACpB,kBAAkB,GAClB,qBAAqB,GACrB,mBAAmB,GACnB,sBAAsB,GACtB,mBAAmB,CAAC;AAEvB;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAStD"}
@@ -1,5 +1,6 @@
1
1
  import { EditorState } from '../../state/EditorState.js';
2
2
  import { PluginContext } from '../Plugin.js';
3
+ import { PopupManager } from '../shared/PopupManager.js';
3
4
  import { ToolbarItem } from './ToolbarItem.js';
4
5
  type OnOverflowChange = (visibleButtons: readonly HTMLButtonElement[], overflowButton: HTMLButtonElement | null) => void;
5
6
  type OnItemActivated = (overflowButton: HTMLButtonElement, item: ToolbarItem) => void;
@@ -10,6 +11,7 @@ export interface OverflowControllerConfig {
10
11
  readonly onOverflowChange: OnOverflowChange;
11
12
  readonly onItemActivated: OnItemActivated;
12
13
  readonly getActiveElement: () => Element | null;
14
+ readonly popupManager?: PopupManager;
13
15
  }
14
16
  export declare class ToolbarOverflowController {
15
17
  private readonly toolbar;
@@ -18,9 +20,11 @@ export declare class ToolbarOverflowController {
18
20
  private readonly onItemActivated;
19
21
  private readonly getActiveElement;
20
22
  private readonly ariaLabel;
23
+ private readonly popupManager;
21
24
  private entries;
22
25
  private overflowButton;
23
26
  private overflowDropdown;
27
+ private overflowHandle;
24
28
  private overflowEntries;
25
29
  private resizeObserver;
26
30
  private closeHandler;
@@ -36,6 +40,7 @@ export declare class ToolbarOverflowController {
36
40
  updateItemStates(state: EditorState): void;
37
41
  /** Cleans up ResizeObserver, DOM elements, and event listeners. */
38
42
  destroy(): void;
43
+ private measureChildWidths;
39
44
  private measureAvailableWidth;
40
45
  private resetVisibility;
41
46
  private setOverflowButtonVisible;
@@ -44,7 +49,6 @@ export declare class ToolbarOverflowController {
44
49
  private openDropdown;
45
50
  private renderDropdownItems;
46
51
  private positionDropdown;
47
- private appendToRoot;
48
52
  private registerCloseHandler;
49
53
  private closeDropdown;
50
54
  private activateOverflowItem;
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarOverflowController.d.ts","sourceRoot":"","sources":["../../../src/plugins/toolbar/ToolbarOverflowController.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAUpD,KAAK,gBAAgB,GAAG,CACvB,cAAc,EAAE,SAAS,iBAAiB,EAAE,EAC5C,cAAc,EAAE,iBAAiB,GAAG,IAAI,KACpC,IAAI,CAAC;AAEV,KAAK,eAAe,GAAG,CAAC,cAAc,EAAE,iBAAiB,EAAE,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;AAEtF,MAAM,WAAW,wBAAwB;IACxC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;IAChC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;IAC1C,QAAQ,CAAC,gBAAgB,EAAE,MAAM,OAAO,GAAG,IAAI,CAAC;CAChD;AAcD,qBAAa,yBAAyB;IACrC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgB;IACxC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAmB;IACpD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAkB;IAClD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAuB;IACxD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IAEnC,OAAO,CAAC,OAAO,CAAuB;IACtC,OAAO,CAAC,cAAc,CAAk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AAC;QAAC,IAAI,EAAE,WAAW,CAAA;KAAE,EAAE,GAAG,IAAI;IAKnF,6EAA6E;IAC7E,WAAW,IAAI,IAAI;IA8DnB,8EAA8E;IAC9E,gBAAgB,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IA8B1C,mEAAmE;IACnE,OAAO,IAAI,IAAI;IAYf,OAAO,CAAC,kBAAkB;IAS1B,OAAO,CAAC,qBAAqB;IAO7B,OAAO,CAAC,eAAe;IAcvB,OAAO,CAAC,wBAAwB;IAQhC,OAAO,CAAC,oBAAoB;IAsB5B,OAAO,CAAC,cAAc;IAQtB,OAAO,CAAC,YAAY;IA+CpB,OAAO,CAAC,mBAAmB;IA4C3B,OAAO,CAAC,gBAAgB;IAaxB,OAAO,CAAC,oBAAoB;IAmB5B,OAAO,CAAC,aAAa;IAyBrB,OAAO,CAAC,oBAAoB;IAW5B,OAAO,CAAC,qBAAqB;IA8C7B,OAAO,CAAC,sBAAsB;IAe9B,OAAO,CAAC,YAAY;CAMpB"}
@@ -30,6 +30,7 @@ export declare class ToolbarPlugin implements Plugin {
30
30
  private focusedIndex;
31
31
  private tooltip;
32
32
  private popupController;
33
+ private popupManager;
33
34
  private overflowController;
34
35
  private visibleElements;
35
36
  private locale;
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarPlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/toolbar/ToolbarPlugin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AASxE,OAAO,EAEN,KAAK,uBAAuB,IAAI,2BAA2B,EAC3D,MAAM,8BAA8B,CAAC;AAQtC,MAAM,W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BAAkB;IAO1B,OAAO,CAAC,cAAc;IAQtB,oEAAoE;IACpE,OAAO,CAAC,gBAAgB;IAQxB,OAAO,CAAC,gBAAgB;IAWxB,OAAO,CAAC,oBAAoB;IA0C5B,4EAA4E;IAC5E,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,mBAAmB;IAmC3B,OAAO,CAAC,qBAAqB;IAwD7B,OAAO,CAAC,YAAY;IAyDpB,OAAO,CAAC,kBAAkB;CAkB1B"}
@@ -1,11 +1,15 @@
1
1
  import { PluginContext } from '../Plugin.js';
2
+ import { PopupManager } from '../shared/PopupManager.js';
2
3
  import { ToolbarItem } from './ToolbarItem.js';
3
4
  export declare class ToolbarPopupController {
4
5
  private activePopup;
5
6
  private activePopupButton;
6
- private closePopupHandler;
7
+ private activeHandle;
7
8
  private readonly getActiveElement;
9
+ private popupManager;
8
10
  constructor(getActiveElement: () => Element | null);
11
+ /** Injects the PopupManager instance (called after service registration). */
12
+ setPopupManager(manager: PopupManager): void;
9
13
  /** Whether a popup is currently open. */
10
14
  isOpen(): boolean;
11
15
  /** Toggles a popup for the given toolbar button. */
@@ -15,6 +19,10 @@ export declare class ToolbarPopupController {
15
19
  /** Closes popup and restores focus to the trigger button. */
16
20
  closeAndRestoreFocus(): void;
17
21
  destroy(): void;
22
+ private openViaManager;
23
+ private openLegacy;
24
+ private renderPopupContent;
25
+ private clearButtonState;
18
26
  private positionAndAppend;
19
27
  private focusFirstItem;
20
28
  private handlePopupKeydown;
@@ -1 +1 @@
1
- {"version":3,"file":"ToolbarPopupController.d.ts","sourceRoot":"","sources":["../../../src/plugins/toolbar/ToolbarPopupController.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAIpD,qBAAa,sBAAsB;IAClC,OAAO,CAAC,WAAW,CAA4B;IAC/C,OAAO,CAAC,iBAA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pD,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,GAAG,IAAI;IAalF,6DAA6D;IAC7D,KAAK,IAAI,IAAI;IAiBb,6DAA6D;IAC7D,oBAAoB,IAAI,IAAI;IAM5B,OAAO,IAAI,IAAI;IAMf,OAAO,CAAC,cAAc;IAiCtB,OAAO,CAAC,UAAU;IAuClB,OAAO,CAAC,kBAAkB;IA6B1B,OAAO,CAAC,gBAAgB;IAUxB,OAAO,CAAC,iBAAiB;IAiBzB,OAAO,CAAC,cAAc;IAYtB,OAAO,CAAC,kBAAkB;IA+B1B,OAAO,CAAC,qBAAqB;IA2B7B,OAAO,CAAC,iBAAiB;IAuCzB,OAAO,CAAC,wBAAwB;CA8BhC"}
@@ -1,4 +1,4 @@
1
1
  export { ToolbarPlugin, ToolbarServiceKey, type ToolbarServiceAPI, type ToolbarLayoutConfig, } from './ToolbarPlugin.js';
2
- export type { ToolbarItem, ToolbarGroup, PopupType, GridPickerConfig, DropdownConfig, } from './ToolbarItem.js';
2
+ export type { ToolbarItem, ToolbarItemCombobox, ToolbarGroup, PopupType, GridPickerConfig, DropdownConfig, } from './ToolbarItem.js';
3
3
  export { formatShortcut } from './ToolbarItem.js';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/toolbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,aAAa,EACb,iBAAiB,EACjB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,GACxB,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EACX,WAAW,EACX,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,cAAc,GACd,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/toolbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,aAAa,EACb,iBAAiB,EACjB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,GACxB,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EACX,WAAW,EACX,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,cAAc,GACd,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { T, a } from "../chunks/ToolbarPlugin-B6JETWaw.mjs";
1
+ import { T, a } from "../chunks/ToolbarPlugin-B7oJRzpl.mjs";
2
2
  import { f } from "../chunks/ToolbarItem-BpZggUGo.mjs";
3
3
  export {
4
4
  T as ToolbarPlugin,
@@ -0,0 +1,21 @@
1
+ import { BlockNode, ChildNode, Document } from '../model/Document.js';
2
+ /** Finds a block by ID anywhere in the tree and applies a transform. */
3
+ export declare function mapBlock(doc: Document, blockId: string, fn: (block: BlockNode) => BlockNode): Document;
4
+ /** Recursively maps over children to find and transform a block by ID. */
5
+ export declare function mapBlockInChildren(children: readonly ChildNode[], blockId: string, fn: (block: BlockNode) => BlockNode): ChildNode[];
6
+ /**
7
+ * Maps a node at the given path, replacing it with the result of fn.
8
+ * Navigates down the path immutably, creating new parent nodes as needed.
9
+ */
10
+ export declare function mapNodeByPath(doc: Document, path: readonly string[], fn: (node: BlockNode) => BlockNode): Document;
11
+ /** Recursive helper for mapNodeByPath — walks one level deeper. */
12
+ export declare function mapNodeByPathRecursive(node: BlockNode, path: readonly string[], depth: number, fn: (node: BlockNode) => BlockNode): BlockNode;
13
+ /**
14
+ * Searches children for a level where `predicate` matches,
15
+ * then applies `transform` at that level.
16
+ * Recurses into nested BlockNodes if not found at the current level.
17
+ *
18
+ * Returns `null` if no matching level was found.
19
+ */
20
+ export declare function findAndTransformChildren(children: readonly ChildNode[], predicate: (children: readonly ChildNode[]) => boolean, transform: (children: readonly ChildNode[]) => readonly ChildNode[]): readonly Child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@@
1
+ import { ChildNode, InlineNode, Mark, TextNode, TextSegment } from '../model/Document.js';
2
+ /**
3
+ * Inserts text into mixed inline content at the given offset.
4
+ * Handles both TextNode and InlineNode children.
5
+ */
6
+ export declare function insertTextIntoInlineContent(nodes: readonly (TextNode | InlineNode)[], offset: number, text: string, marks: readonly Mark[]): (TextNode | InlineNode)[];
7
+ /**
8
+ * Inserts segments into mixed inline content at the given offset.
9
+ */
10
+ export declare function insertSegmentsIntoInlineContent(nodes: readonly (TextNode | InlineNode)[], offset: number, segments: readonly TextSegment[]): (TextNode | InlineNode)[];
11
+ /**
12
+ * Deletes content from mixed inline content in the given range.
13
+ * Removes InlineNodes that fall within the range.
14
+ */
15
+ export declare function deleteFromInlineContent(nodes: readonly (TextNode | InlineNode)[], from: number, to: number): (TextNode | InlineNode)[];
16
+ /**
17
+ * Slices mixed inline content to the given range.
18
+ * InlineNodes are preserved as atoms (included if within range).
19
+ */
20
+ export declare function sliceInlineContent(nodes: readonly (TextNode | InlineNode)[], from: number, to: number): (TextNode | InlineNode)[];
21
+ /**
22
+ * Applies or removes a mark from mixed inline content in the given range.
23
+ * InlineNodes are passed through unchanged (marks only apply to text).
24
+ */
25
+ export declare function applyMarkToInlineContent(nodes: readonly (TextNode | InlineNode)[], from: number, to: number, mark: Mark, add: boolean): (TextNode | InlineNode)[];
26
+ /** Inserts an InlineNode at the given offset in mixed inline content. */
27
+ export declare function insertInlineNodeAtOffset(nodes: readonly (TextNode | InlineNode)[], offset: number, inlineNode: InlineNode): (TextNode | InlineNode)[];
28
+ /** Removes the InlineNode at the given offset from mixed inline content. */
29
+ export declare function removeInlineNodeAtOffset(nodes: readonly (TextNode | InlineNode)[], offset: number): (TextNode | InlineNode)[];
30
+ /** Replaces the attrs of an InlineNode at the given offset. */
31
+ export declare function setInlineNodeAttrsAtOffset(nodes: readonly (TextNode | InlineNode)[], offset: number, attrs: Readonly<Record<string, string | number | boolean>>): (TextNode | InlineNode)[];
32
+ /**
33
+ * Replaces the inline content children of a ChildNode array,
34
+ * preserving any BlockNode children in their original positions.
35
+ */
36
+ export declare function replaceInlineChildren(original: readonly ChildNode[], newInlineChildren: readonly (TextNode | InlineNode)[]): readonly ChildNode[];
37
+ //# sourceMappingURL=InlineContentOps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InlineContentOps.d.ts","sourceRoot":"","sources":["../../src/state/InlineContentOps.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,IAAI,EACT,KAAK,QAAQ,EACb,KAAK,WAAW,EAMhB,MAAM,sBAAsB,CAAC;AAE9B;;;GAGG;AACH,wBAAgB,2BAA2B,CAC1C,KAAK,EAAE,SAAS,CAAC,QAAQ,GAAG,UAAU,CAAC,EAAE,EACzC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,SAAS,IAAI,EAAE,GACpB,CAAC,QAAQ,GAAG,UAAU,CAAC,EAAE,CAuC3B;AAED;;GAEG;AACH,wBAAgB,+BAA+B,CAC9C,KAAK,EAAE,SAAS,CAAC,QAAQ,GAAG,UAAU,CAAC,EAAE,EACzC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,SAAS,WAAW,EAAE,GAC9B,CAAC,QAAQ,GAAG,UAAU,CAAC,EAAE,CA6C3B;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACtC,KAAK,EAAE,SAAS,CAAC,QAAQ,GAAG,UAAU,CAAC,EAAE,EACzC,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,GACR,CAAC,QAAQ,GAAG,UAAU,CAAC,EAAE,CAgC3B;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CACjC,KAAK,EAAE,SAAS,CAAC,QAAQ,GAAG,UAAU,CAAC,EAAE,EACzC,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,GACR,CAAC,QAAQ,GAAG,UAAU,CAAC,EAAE,C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AAO,KAAK,EAcX,IAAI,EACJ,MAAM,kBAAkB,CAAC;AAE1B,wEAAwE;AACxE,wBAAgB,SAAS,CAAC,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,GAAG,QAAQ,CA+B7D"}
1
+ {"version":3,"file":"StepApplication.d.ts","sourceRoot":"","sources":["../../src/state/StepApplication.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAGN,KAAK,QAAQ,EAQb,MAAM,sBAAsB,CAAC;AAa9B,OAAO,KAAK,EAcX,IAAI,EACJ,MAAM,kBAAkB,CAAC;AAE1B,wEAAwE;AACxE,wBAAgB,SAAS,CAAC,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,GAAG,QAAQ,CA+B7D"}
@@ -86,6 +86,10 @@ export declare function expectToolbarActive(harness: PluginHarnessResult, itemId
86
86
  * Assert that a toolbar item's `isEnabled()` returns the expected value.
87
87
  */
88
88
  export declare function expectToolbarEnabled(harness: PluginHarnessResult, itemId: string, enabled: boolean, state?: EditorState): void;
89
+ /**
90
+ * Assert that a combobox toolbar item's `getLabel()` returns the expected value.
91
+ */
92
+ export declare function expectComboboxLabel(harness: PluginHarnessResult, itemId: string, expectedLabel: string, state?: EditorState): void;
89
93
  /**
90
94
  * Assert that a key binding is registered.
91
95
  *
@@ -1 +1 @@
1
- {"version":3,"file":"PluginTestUtils.d.ts","sourceRoot":"","sources":["../../src/test/PluginTestUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAM1D,qDAAqD;AACrD,MAAM,WAAW,gBAAgB;IAChC,yDAAyD;IACzD,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,6BAA6B;IAC7B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,oEA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ectl/core",
3
- "version": "1.7.0",
4
- "description": "A modern and accessable rich text editor shipped as a single Web Component. Immutable state, transaction-based architecture, and a plugin system that powers every feature.",
3
+ "version": "1.7.1",
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",
7
7
  "sideEffects": false,
@@ -1,59 +0,0 @@
1
- const e = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;
2
- function r(r2) {
3
- return e.test(r2);
4
- }
5
- const a = /^rgba?\(\s*(\d{1,3}%?\s*,\s*){2}\d{1,3}%?(\s*,\s*(0|1|0?\.\d+))?\s*\)$/, l = /^hsla?\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%(\s*,\s*(0|1|0?\.\d+))?\s*\)$/, t = /* @__PURE__ */ new Set(["aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue", "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkgrey", "darkkhaki", "darkmagenta", "darkolivegreen", "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen", "darkslateblue", "darkslategray", "darkslategrey", "darkturquoise", "darkviolet", "deeppink", "deepskyblue", "dimgray", "dimgrey", "dodgerblue", "firebrick", "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite", "gold", "goldenrod", "gray", "green", "greenyellow", "grey", "honeydew", "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender", "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral", "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightgrey", "lightpink", "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", "lightslategrey", "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta", "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise", "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin", "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered", "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred", "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", "purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown", "salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue", "slateblue", "slategray", "slategrey", "snow", "springgreen", "steelblue", "tan", "teal", "thistle", "tomato", "transparent", "turquoise", "violet", "wheat", "white", "whitesmoke", "yellow", "yellowgreen"]);
6
- function n(r2) {
7
- if (!r2) return false;
8
- const n2 = r2.trim().toLowerCase();
9
- return !!n2 && (e.test(n2) || a.test(n2) || l.test(n2) || t.has(n2));
10
- }
11
- function i(e2, a2, l2) {
12
- if (!e2 || 0 === e2.length) return a2;
13
- const t2 = e2.filter((e3) => !r(e3));
14
- if (t2.length > 0) throw new Error(`${l2}: invalid hex color(s): ${t2.join(", ")}. Expected format: #RGB or #RRGGBB.`);
15
- const n2 = /* @__PURE__ */ new Set(), i2 = [];
16
- for (const r2 of e2) {
17
- const e3 = r2.toLowerCase();
18
- n2.has(e3) || (n2.add(e3), i2.push(e3));
19
- }
20
- return i2;
21
- }
22
- const f = /* @__PURE__ */ new Map([["#000000", "Black"], ["#434343", "Dark Gray 4"], ["#666666", "Dark Gray 3"], ["#999999", "Dark Gray 2"], ["#b7b7b7", "Dark Gray 1"], ["#cccccc", "Light Gray 3"], ["#d9d9d9", "Light Gray 2"], ["#efefef", "Light Gray 1"], ["#f3f3f3", "Near White"], ["#ffffff", "White"], ["#980000", "Dark Red Berry"], ["#ff0000", "Red"], ["#ff9900", "Orange"], ["#ffff00", "Yellow"], ["#00ff00", "Green"], ["#00ffff", "Cyan"], ["#4a86e8", "Cornflower Blue"], ["#0000ff", "Blue"], ["#9900ff", "Purple"], ["#ff00ff", "Magenta"], ["#e6b8af", "Light Red Berry 3"], ["#f4cccc", "Light Red 3"], ["#fce5cd", "Light Orange 3"], ["#fff2cc", "Light Yellow 3"], ["#d9ead3", "Light Green 3"], ["#d0e0e3", "Light Cyan 3"], ["#c9daf8", "Light Cornflower Blue 3"], ["#cfe2f3", "Light Blue 3"], ["#d9d2e9", "Light Purple 3"], ["#ead1dc", "Light Magenta 3"], ["#dd7e6b", "Light Red Berry 2"], ["#ea9999", "Light Red 2"], ["#f9cb9c", "Light Orange 2"], ["#ffe599", "Light Yellow 2"], ["#b6d7a8", "Light Green 2"], ["#a2c4c9", "Light Cyan 2"], ["#a4c2f4", "Light Cornflower Blue 2"], ["#9fc5e8", "Light Blue 2"], ["#b4a7d6", "Light Purple 2"], ["#d5a6bd", "Light Magenta 2"], ["#cc4125", "Light Red Berry 1"], ["#e06666", "Light Red 1"], ["#f6b26b", "Light Orange 1"], ["#ffd966", "Light Yellow 1"], ["#93c47d", "Light Green 1"], ["#76a5af", "Light Cyan 1"], ["#6d9eeb", "Light Cornflower Blue 1"], ["#6fa8dc", "Light Blue 1"], ["#8e7cc3", "Light Purple 1"], ["#c27ba0", "Light Magenta 1"], ["#a61c00", "Dark Red Berry 1"], ["#cc0000", "Dark Red 1"], ["#e69138", "Dark Orange 1"], ["#f1c232", "Dark Yellow 1"], ["#6aa84f", "Dark Green 1"], ["#45818e", "Dark Cyan 1"], ["#3c78d8", "Dark Cornflower Blue 1"], ["#3d85c6", "Dark Blue 1"], ["#674ea7", "Dark Purple 1"], ["#a64d79", "Dark Magenta 1"], ["#85200c", "Dark Red Berry 2"], ["#990000", "Dark Red 2"], ["#b45f06", "Dark Orange 2"], ["#bf9000", "Dark Yellow 2"], ["#38761d", "Dark Green 2"], ["#134f5c", "Dark Cyan 2"], ["#1155cc", "Dark Cornflower Blue 2"], ["#0b5394", "Dark Blue 2"], ["#351c75", "Dark Purple 2"], ["#741b47", "Dark Magenta 2"], ["#fff176", "Bright Yellow"], ["#aed581", "Light Green"], ["#4dd0e1", "Bright Cyan"], ["#64b5f6", "Sky Blue"], ["#ce93d8", "Lavender"], ["#f48fb1", "Pink"], ["#ffab91", "Peach"], ["#ff8a65", "Coral"], ["#e6ee9c", "Lime"], ["#80cbc4", "Teal"], ["#fff9c4", "Pale Yellow"], ["#dcedc8", "Pale Green"], ["#e0f7fa", "Pale Cyan"], ["#e3f2fd", "Pale Blue"], ["#f3e5f5", "Pale Purple"], ["#fce4ec", "Pale Pink"], ["#fff3e0", "Pale Orange"], ["#fbe9e7", "Pale Red"], ["#f9fbe7", "Pale Lime"], ["#e0f2f1", "Pale Teal"], ["#fff59d", "Soft Yellow"], ["#c5e1a5", "Soft Green"], ["#80deea", "Soft Cyan"], ["#90caf9", "Soft Blue"], ["#e1bee7", "Soft Purple"], ["#f8bbd0", "Soft Pink"], ["#ffcc80", "Soft Orange"], ["#a5d6a7", "Mint"], ["#ffee58", "Vivid Yellow"], ["#9ccc65", "Vivid Green"], ["#26c6da", "Vivid Cyan"], ["#42a5f5", "Vivid Blue"], ["#ab47bc", "Vivid Purple"], ["#ec407a", "Vivid Pink"], ["#ffa726", "Vivid Orange"], ["#ff7043", "Red Orange"], ["#d4e157", "Vivid Lime"], ["#66bb6a", "Emerald"], ["#fafafa", "Almost White"], ["#f5f5f5", "Lightest Gray"], ["#eeeeee", "Very Light Gray"], ["#e0e0e0", "Silver"], ["#bdbdbd", "Medium Gray"], ["#e8eaf6", "Lavender Gray"], ["#efebe9", "Warm Gray"], ["#eceff1", "Cool Gray"]]);
23
- function o(e2) {
24
- return f.get(e2.toLowerCase()) || (function(e3) {
25
- const r2 = g(e3), a2 = Number.parseInt(r2.slice(1, 3), 16) / 255, l2 = Number.parseInt(r2.slice(3, 5), 16) / 255, t2 = Number.parseInt(r2.slice(5, 7), 16) / 255, n2 = Math.max(a2, l2, t2), i2 = Math.min(a2, l2, t2), f2 = (n2 + i2) / 2, o2 = n2 - i2;
26
- if (o2 < 0.05) return f2 < 0.15 ? "Black" : f2 < 0.35 ? "Dark Gray" : f2 < 0.65 ? "Gray" : f2 < 0.85 ? "Light Gray" : "Near White";
27
- let d2 = 0;
28
- d2 = n2 === a2 ? 60 * ((l2 - t2) / o2 + (l2 < t2 ? 6 : 0)) : n2 === l2 ? 60 * ((t2 - a2) / o2 + 2) : 60 * ((a2 - l2) / o2 + 4);
29
- let c2 = "Red";
30
- for (const [e4, r3] of s) if (d2 < e4) {
31
- c2 = r3;
32
- break;
33
- }
34
- return f2 < 0.25 ? `Very Dark ${c2}` : f2 < 0.4 ? `Dark ${c2}` : f2 > 0.8 ? `Very Light ${c2}` : f2 > 0.65 ? `Light ${c2}` : c2;
35
- })(e2);
36
- }
37
- function d(e2) {
38
- const r2 = (function(e3) {
39
- const r3 = g(e3);
40
- return 0.2126 * c(Number.parseInt(r3.slice(1, 3), 16) / 255) + 0.7152 * c(Number.parseInt(r3.slice(3, 5), 16) / 255) + 0.0722 * c(Number.parseInt(r3.slice(5, 7), 16) / 255);
41
- })(e2);
42
- return r2 > 0.3;
43
- }
44
- function g(e2) {
45
- const r2 = e2.toLowerCase();
46
- return 4 === r2.length ? `#${r2[1]}${r2[1]}${r2[2]}${r2[2]}${r2[3]}${r2[3]}` : r2;
47
- }
48
- function c(e2) {
49
- return e2 <= 0.03928 ? e2 / 12.92 : ((e2 + 0.055) / 1.055) ** 2.4;
50
- }
51
- const s = [[15, "Red"], [45, "Orange"], [65, "Yellow"], [150, "Green"], [190, "Cyan"], [250, "Blue"], [290, "Purple"], [330, "Pink"], [361, "Red"]];
52
- export {
53
- d as a,
54
- r as b,
55
- o as g,
56
- n as i,
57
- i as r
58
- };
59
- //# sourceMappingURL=ColorNames-BdsHwA2f.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ColorNames-BdsHwA2f.mjs","sources":["../../src/plugins/shared/ColorValidation.ts","../../src/plugins/shared/ColorNames.ts"],"sourcesContent":["/**\n * Shared color validation and normalization utilities\n * for color-based mark plugins (TextColor, Highlight).\n */\n\nconst HEX_COLOR_PATTERN: RegExp = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;\n\n/** Returns `true` when the value is a valid `#RGB` or `#RRGGBB` hex color. */\nexport function isValidHexColor(value: string): boolean {\n\treturn HEX_COLOR_PATTERN.test(value);\n}\n\n// --- CSS Color Validation (broad format support for paste / API input) ---\n\n/** Matches `rgb(r, g, b)` and `rgba(r, g, b, a)` with integer or percentage values. */\nconst RGB_PATTERN: RegExp =\n\t/^rgba?\\(\\s*(\\d{1,3}%?\\s*,\\s*){2}\\d{1,3}%?(\\s*,\\s*(0|1|0?\\.\\d+))?\\s*\\)$/;\n\n/** Matches `hsl(h, s%, l%)` and `hsla(h, s%, l%, a)`. */\nconst HSL_PATTERN: RegExp =\n\t/^hsla?\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}%\\s*,\\s*\\d{1,3}%(\\s*,\\s*(0|1|0?\\.\\d+))?\\s*\\)$/;\n\n/**\n * Complete set of CSS Level 4 named colors (including `transparent`).\n * Used as an allowlist — unknown names are rejected.\n */\nconst CSS_NAMED_COLORS: ReadonlySet<string> = new Set([\n\t'aliceblue',\n\t'antiquewhite',\n\t'aqua',\n\t'aquamarine',\n\t'azure',\n\t'beige',\n\t'bisque',\n\t'black',\n\t'blanchedalmond',\n\t'blue',\n\t'blueviolet',\n\t'brown',\n\t'burlywood',\n\t'cadetblue',\n\t'chartreuse',\n\t'chocolate',\n\t'coral',\n\t'cornflowerblue',\n\t'cornsilk',\n\t'crimson',\n\t'cyan',\n\t'darkblue',\n\t'darkcyan',\n\t'darkgoldenrod',\n\t'darkgray',\n\t'darkgreen',\n\t'darkgrey',\n\t'darkkhaki',\n\t'darkmagenta',\n\t'darkolivegreen',\n\t'darkorange',\n\t'darkorchid',\n\t'darkred',\n\t'darksalmon',\n\t'darkseagreen',\n\t'darkslateblue',\n\t'darkslategray',\n\t'darkslategrey',\n\t'darkturquoise',\n\t'darkviolet',\n\t'deeppink',\n\t'deepskyblue',\n\t'dimgray',\n\t'dimgrey',\n\t'dodgerblue',\n\t'firebrick',\n\t'floralwhite',\n\t'forestgreen',\n\t'fuchsia',\n\t'gainsboro',\n\t'ghostwhite',\n\t'gold',\n\t'goldenrod',\n\t'gray',\n\t'green',\n\t'greenyellow',\n\t'grey',\n\t'honeydew',\n\t'hotpink',\n\t'indianred',\n\t'indigo',\n\t'ivory',\n\t'khaki',\n\t'lavender',\n\t'lavenderblush',\n\t'lawngreen',\n\t'lemonchiffon',\n\t'lightblue',\n\t'lightcoral',\n\t'lightcyan',\n\t'lightgoldenrodyellow',\n\t'lightgray',\n\t'lightgreen',\n\t'lightgrey',\n\t'lightpink',\n\t'lightsalmon',\n\t'lightseagreen',\n\t'lightskyblue',\n\t'lightslategray',\n\t'lightslategrey',\n\t'lightsteelblue',\n\t'lightyellow',\n\t'lime',\n\t'limegreen',\n\t'linen',\n\t'magenta',\n\t'maroon',\n\t'mediumaquamarine',\n\t'mediumblue',\n\t'mediumorchid',\n\t'mediumpurple',\n\t'mediumseagreen',\n\t'mediumslateblue',\n\t'mediumspringgreen',\n\t'mediumturquoise',\n\t'mediumvioletred',\n\t'midnightblue',\n\t'mintcream',\n\t'mistyrose',\n\t'moccasin',\n\t'navajowhite',\n\t'navy',\n\t'oldlace',\n\t'olive',\n\t'olivedrab',\n\t'orange',\n\t'orangered',\n\t'orchid',\n\t'palegoldenrod',\n\t'palegreen',\n\t'paleturquoise',\n\t'palevioletred',\n\t'papayawhip',\n\t'peachpuff',\n\t'peru',\n\t'pink',\n\t'plum',\n\t'powderblue',\n\t'purple',\n\t'rebeccapurple',\n\t'red',\n\t'rosybrown',\n\t'royalblue',\n\t'saddlebrown',\n\t'salmon',\n\t'sandybrown',\n\t'seagreen',\n\t'seashell',\n\t'sienna',\n\t'silver',\n\t'skyblue',\n\t'slateblue',\n\t'slategray',\n\t'slategrey',\n\t'snow',\n\t'springgreen',\n\t'steelblue',\n\t'tan',\n\t'teal',\n\t'thistle',\n\t'tomato',\n\t'transparent',\n\t'turquoise',\n\t'violet',\n\t'wheat',\n\t'white',\n\t'whitesmoke',\n\t'yellow',\n\t'yellowgreen',\n]);\n\n/**\n * Returns `true` when `value` is a safe CSS color value.\n * Accepts hex (`#RGB`, `#RRGGBB`), `rgb()`, `rgba()`, `hsl()`, `hsla()`,\n * and CSS named colors. Rejects anything else — defense against CSS injection\n * via manipulated color values in `style` attributes.\n */\nexport function isValidCSSColor(value: string): boolean {\n\tif (!value) return false;\n\tconst trimmed: string = value.trim().toLowerCase();\n\tif (!trimmed) return false;\n\n\treturn (\n\t\tHEX_COLOR_PATTERN.test(trimmed) ||\n\t\tRGB_PATTERN.test(trimmed) ||\n\t\tHSL_PATTERN.test(trimmed) ||\n\t\tCSS_NAMED_COLORS.has(trimmed)\n\t);\n}\n\n/**\n * Validates, deduplicates, and normalizes a user-supplied color list.\n * Returns `fallbackPalette` when no custom colors are provided.\n *\n * @throws {Error} if any value is not a valid hex color code.\n */\nexport function resolveColors(\n\tcolors: readonly string[] | undefined,\n\tfallbackPalette: readonly string[],\n\tpluginName: string,\n): readonly string[] {\n\tif (!colors || colors.length === 0) return fallbackPalette;\n\n\tconst invalid: string[] = colors.filter((c) => !isValidHexColor(c));\n\tif (invalid.length > 0) {\n\t\tthrow new Error(\n\t\t\t`${pluginName}: invalid hex color(s): ${invalid.join(', ')}. Expected format: #RGB or #RRGGBB.`,\n\t\t);\n\t}\n\n\tconst seen: Set<string> = new Set();\n\tconst unique: string[] = [];\n\tfor (const color of colors) {\n\t\tconst normalized: string = color.toLowerCase();\n\t\tif (!seen.has(normalized)) {\n\t\t\tseen.add(normalized);\n\t\t\tunique.push(normalized);\n\t\t}\n\t}\n\treturn unique;\n}\n","/**\n * Human-readable color name lookup for accessibility.\n *\n * Provides descriptive names for color swatches so screen readers\n * announce \"Red\" instead of \"#ff0000\". Covers all default palette\n * colors with a fallback algorithm for custom hex values.\n */\n\n// ---------------------------------------------------------------------------\n// Static name map — covers every default palette color\n// ---------------------------------------------------------------------------\n\nconst COLOR_NAME_MAP: ReadonlyMap<string, string> = new Map([\n\t// ── TextColor palette (70 colors) ──────────────────────────────────────\n\n\t// Row 1 — Grays\n\t['#000000', 'Black'],\n\t['#434343', 'Dark Gray 4'],\n\t['#666666', 'Dark Gray 3'],\n\t['#999999', 'Dark Gray 2'],\n\t['#b7b7b7', 'Dark Gray 1'],\n\t['#cccccc', 'Light Gray 3'],\n\t['#d9d9d9', 'Light Gray 2'],\n\t['#efefef', 'Light Gray 1'],\n\t['#f3f3f3', 'Near White'],\n\t['#ffffff', 'White'],\n\n\t// Row 2 — Vivid\n\t['#980000', 'Dark Red Berry'],\n\t['#ff0000', 'Red'],\n\t['#ff9900', 'Orange'],\n\t['#ffff00', 'Yellow'],\n\t['#00ff00', 'Green'],\n\t['#00ffff', 'Cyan'],\n\t['#4a86e8', 'Cornflower Blue'],\n\t['#0000ff', 'Blue'],\n\t['#9900ff', 'Purple'],\n\t['#ff00ff', 'Magenta'],\n\n\t// Row 3 — Light 3 (lightest tint)\n\t['#e6b8af', 'Light Red Berry 3'],\n\t['#f4cccc', 'Light Red 3'],\n\t['#fce5cd', 'Light Orange 3'],\n\t['#fff2cc', 'Light Yellow 3'],\n\t['#d9ead3', 'Light Green 3'],\n\t['#d0e0e3', 'Light Cyan 3'],\n\t['#c9daf8', 'Light Cornflower Blue 3'],\n\t['#cfe2f3', 'Light Blue 3'],\n\t['#d9d2e9', 'Light Purple 3'],\n\t['#ead1dc', 'Light Magenta 3'],\n\n\t// Row 4 — Light 2\n\t['#dd7e6b', 'Light Red Berry 2'],\n\t['#ea9999', 'Light Red 2'],\n\t['#f9cb9c', 'Light Orange 2'],\n\t['#ffe599', 'Light Yellow 2'],\n\t['#b6d7a8', 'Light Green 2'],\n\t['#a2c4c9', 'Light Cyan 2'],\n\t['#a4c2f4', 'Light Cornflower Blue 2'],\n\t['#9fc5e8', 'Light Blue 2'],\n\t['#b4a7d6', 'Light Purple 2'],\n\t['#d5a6bd', 'Light Magenta 2'],\n\n\t// Row 5 — Light 1\n\t['#cc4125', 'Light Red Berry 1'],\n\t['#e06666', 'Light Red 1'],\n\t['#f6b26b', 'Light Orange 1'],\n\t['#ffd966', 'Light Yellow 1'],\n\t['#93c47d', 'Light Green 1'],\n\t['#76a5af', 'Light Cyan 1'],\n\t['#6d9eeb', 'Light Cornflower Blue 1'],\n\t['#6fa8dc', 'Light Blue 1'],\n\t['#8e7cc3', 'Light Purple 1'],\n\t['#c27ba0', 'Light Magenta 1'],\n\n\t// Row 6 — Dark 1\n\t['#a61c00', 'Dark Red Berry 1'],\n\t['#cc0000', 'Dark Red 1'],\n\t['#e69138', 'Dark Orange 1'],\n\t['#f1c232', 'Dark Yellow 1'],\n\t['#6aa84f', 'Dark Green 1'],\n\t['#45818e', 'Dark Cyan 1'],\n\t['#3c78d8', 'Dark Cornflower Blue 1'],\n\t['#3d85c6', 'Dark Blue 1'],\n\t['#674ea7', 'Dark Purple 1'],\n\t['#a64d79', 'Dark Magenta 1'],\n\n\t// Row 7 — Dark 2\n\t['#85200c', 'Dark Red Berry 2'],\n\t['#990000', 'Dark Red 2'],\n\t['#b45f06', 'Dark Orange 2'],\n\t['#bf9000', 'Dark Yellow 2'],\n\t['#38761d', 'Dark Green 2'],\n\t['#134f5c', 'Dark Cyan 2'],\n\t['#1155cc', 'Dark Cornflower Blue 2'],\n\t['#0b5394', 'Dark Blue 2'],\n\t['#351c75', 'Dark Purple 2'],\n\t['#741b47', 'Dark Magenta 2'],\n\n\t// ── Highlight palette (50 colors, minus duplicates) ────────────────────\n\n\t// Row 1 — Classic highlighter (bright, vivid)\n\t['#fff176', 'Bright Yellow'],\n\t['#aed581', 'Light Green'],\n\t['#4dd0e1', 'Bright Cyan'],\n\t['#64b5f6', 'Sky Blue'],\n\t['#ce93d8', 'Lavender'],\n\t['#f48fb1', 'Pink'],\n\t['#ffab91', 'Peach'],\n\t['#ff8a65', 'Coral'],\n\t['#e6ee9c', 'Lime'],\n\t['#80cbc4', 'Teal'],\n\n\t// Row 2 — Light pastels\n\t['#fff9c4', 'Pale Yellow'],\n\t['#dcedc8', 'Pale Green'],\n\t['#e0f7fa', 'Pale Cyan'],\n\t['#e3f2fd', 'Pale Blue'],\n\t['#f3e5f5', 'Pale Purple'],\n\t['#fce4ec', 'Pale Pink'],\n\t['#fff3e0', 'Pale Orange'],\n\t['#fbe9e7', 'Pale Red'],\n\t['#f9fbe7', 'Pale Lime'],\n\t['#e0f2f1', 'Pale Teal'],\n\n\t// Row 3 — Medium pastels\n\t['#fff59d', 'Soft Yellow'],\n\t['#c5e1a5', 'Soft Green'],\n\t['#80deea', 'Soft Cyan'],\n\t['#90caf9', 'Soft Blue'],\n\t['#e1bee7', 'Soft Purple'],\n\t['#f8bbd0', 'Soft Pink'],\n\t['#ffcc80', 'Soft Orange'],\n\t// #ffab91 duplicate → Peach (already mapped)\n\t// #e6ee9c duplicate → Lime (already mapped)\n\t['#a5d6a7', 'Mint'],\n\n\t// Row 4 — Bold pastels\n\t['#ffee58', 'Vivid Yellow'],\n\t['#9ccc65', 'Vivid Green'],\n\t['#26c6da', 'Vivid Cyan'],\n\t['#42a5f5', 'Vivid Blue'],\n\t['#ab47bc', 'Vivid Purple'],\n\t['#ec407a', 'Vivid Pink'],\n\t['#ffa726', 'Vivid Orange'],\n\t['#ff7043', 'Red Orange'],\n\t['#d4e157', 'Vivid Lime'],\n\t['#66bb6a', 'Emerald'],\n\n\t// Row 5 — Grays and neutral highlights\n\t// #ffffff duplicate → White (already mapped)\n\t['#fafafa', 'Almost White'],\n\t['#f5f5f5', 'Lightest Gray'],\n\t['#eeeeee', 'Very Light Gray'],\n\t['#e0e0e0', 'Silver'],\n\t['#bdbdbd', 'Medium Gray'],\n\t['#e8eaf6', 'Lavender Gray'],\n\t['#efebe9', 'Warm Gray'],\n\t['#eceff1', 'Cool Gray'],\n\t// #fafafa duplicate → Almost White (already mapped)\n]);\n\n// ---------------------------------------------------------------------------\n// Public API\n// ---------------------------------------------------------------------------\n\n/**\n * Returns a human-readable name for a hex color.\n *\n * Checks the static map first, then falls back to a computed\n * description based on hue, saturation, and lightness.\n */\nexport function getColorName(hex: string): string {\n\tconst name: string | undefined = COLOR_NAME_MAP.get(hex.toLowerCase());\n\tif (name) return name;\n\treturn describeColor(hex);\n}\n\n/**\n * Determines whether a color is light enough to need a visible\n * border when rendered on a white background (WCAG 1.4.11).\n *\n * Uses a contrast-ratio threshold of 3:1 against white.\n */\nexport function isLightColor(hex: string): boolean {\n\tconst luminance: number = relativeLuminance(hex);\n\t// Contrast ratio against white: (1.05) / (L + 0.05) < 3\n\t// ⟹ L > 1.05/3 − 0.05 = 0.3\n\tconst LIGHT_THRESHOLD = 0.3;\n\treturn luminance > LIGHT_THRESHOLD;\n}\n\n// ---------------------------------------------------------------------------\n// Internal helpers\n// ---------------------------------------------------------------------------\n\n/** Expands `#RGB` to `#RRGGBB` and lowercases. */\nfunction normalizeHex(hex: string): string {\n\tconst h: string = hex.toLowerCase();\n\tif (h.length === 4) {\n\t\treturn `#${h[1]}${h[1]}${h[2]}${h[2]}${h[3]}${h[3]}`;\n\t}\n\treturn h;\n}\n\n/** Applies sRGB linearization to a single channel value (0–1). */\nfunction linearize(channel: number): number {\n\treturn channel <= 0.03928 ? channel / 12.92 : ((channel + 0.055) / 1.055) ** 2.4;\n}\n\n/** Computes WCAG relative luminance from a hex color. */\nfunction relativeLuminance(hex: string): number {\n\tconst normalized: string = normalizeHex(hex);\n\tconst r: number = linearize(Number.parseInt(normalized.slice(1, 3), 16) / 255);\n\tconst g: number = linearize(Number.parseInt(normalized.slice(3, 5), 16) / 255);\n\tconst b: number = linearize(Number.parseInt(normalized.slice(5, 7), 16) / 255);\n\treturn 0.2126 * r + 0.7152 * g + 0.0722 * b;\n}\n\n/** Hue boundary table: upper bound (degrees) → name. */\nconst HUE_NAMES: readonly (readonly [number, string])[] = [\n\t[15, 'Red'],\n\t[45, 'Orange'],\n\t[65, 'Yellow'],\n\t[150, 'Green'],\n\t[190, 'Cyan'],\n\t[250, 'Blue'],\n\t[290, 'Purple'],\n\t[330, 'Pink'],\n\t[361, 'Red'],\n];\n\n/**\n * Generates a descriptive name from a hex color using HSL analysis.\n * Produces names like \"Dark Blue\", \"Light Green\", or \"Gray\".\n */\nfunction describeColor(hex: string): string {\n\tconst normalized: string = normalizeHex(hex);\n\tconst rRaw: number = Number.parseInt(normalized.slice(1, 3), 16) / 255;\n\tconst gRaw: number = Number.parseInt(normalized.slice(3, 5), 16) / 255;\n\tconst bRaw: number = Number.parseInt(normalized.slice(5, 7), 16) / 255;\n\n\tconst max: number = Math.max(rRaw, gRaw, bRaw);\n\tconst min: number = Math.min(rRaw, gRaw, bRaw);\n\tconst lightness: number = (max + min) / 2;\n\tconst delta: number = max - min;\n\n\t// Achromatic\n\tif (delta < 0.05) {\n\t\tif (lightness < 0.15) return 'Black';\n\t\tif (lightness < 0.35) return 'Dark Gray';\n\t\tif (lightness < 0.65) return 'Gray';\n\t\tif (lightness < 0.85) return 'Light Gray';\n\t\treturn 'Near White';\n\t}\n\n\t// Compute hue in degrees\n\tlet hue = 0;\n\tif (max === rRaw) {\n\t\thue = ((gRaw - bRaw) / delta + (gRaw < bRaw ? 6 : 0)) * 60;\n\t} else if (max === gRaw) {\n\t\thue = ((bRaw - rRaw) / delta + 2) * 60;\n\t} else {\n\t\thue = ((rRaw - gRaw) / delta + 4) * 60;\n\t}\n\n\t// Look up hue name\n\tlet hueName = 'Red';\n\tfor (const [threshold, name] of HUE_NAMES) {\n\t\tif (hue < threshold) {\n\t\t\thueName = name;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Lightness modifier\n\tif (lightness < 0.25) return `Very Dark ${hueName}`;\n\tif (lightness < 0.4) return `Dark ${hueName}`;\n\tif (lightness > 0.8) return `Very Light ${hueName}`;\n\tif (lightness > 0.65) return `Light ${hueName}`;\n\treturn hueName;\n}\n"],"names":["HEX_COLOR_PATTERN","isValidHexColor","value","test","RGB_PATTERN","HSL_PATTERN","CSS_NAMED_COLORS","Set","isValidCSSColor","trimmed","trim","toLowerCase","has","resolveColors","colors","fallbackPalette","pluginName","length","invalid","filter","c","Error","join","seen","unique","color","normalized","add","push","COLOR_NAME_MAP","Map","getColorName","hex","get","normalizeHex","rRaw","Number","parseInt","slice","gRaw","bRaw","max","Math","min","lightness","delta","hue","hueName","threshold","name","HUE_NAMES","isLightColor","luminance","linearize","h","channel"],"mappings":"AAKA,MAAMA,IAA4B;AAG3B,SAASC,EAAgBC;AAC/B,SAAOF,EAAkBG,KAAKD,EAAAA;AAC/B;AAKA,MAAME,IACL,0EAGKC,IACL,iFAMKC,wBAA4CC,IAAI,CACrD,aACA,gBACA,QACA,cACA,SACA,SACA,UACA,SACA,kBACA,QACA,cACA,SACA,aACA,aACA,cACA,aACA,SACA,kBACA,YACA,WACA,QACA,YACA,YACA,iBACA,YACA,aACA,YACA,aACA,eACA,kBACA,cACA,cACA,WACA,cACA,gBACA,iBACA,iBACA,iBACA,iBACA,cACA,YACA,eACA,WACA,WACA,cACA,aACA,eACA,eACA,WACA,aACA,cACA,QACA,aACA,QACA,SACA,eACA,QACA,YACA,WACA,aACA,UACA,SACA,SACA,YACA,iBACA,aACA,gBACA,aACA,cACA,aACA,wBACA,aACA,cACA,aACA,aACA,eACA,iBACA,gBACA,kBACA,kBACA,kBACA,eACA,QACA,aACA,SACA,WACA,UACA,oBACA,cACA,gBACA,gBACA,kBACA,mBACA,qBACA,mBACA,mBACA,gBACA,aACA,aACA,YACA,eACA,QACA,WACA,SACA,aACA,UACA,aACA,UACA,iBACA,aACA,iBACA,iBACA,cACA,aACA,QACA,QACA,QACA,cACA,UACA,iBACA,OACA,aACA,aACA,eACA,UACA,cACA,YACA,YACA,UACA,UACA,WACA,aACA,aACA,aACA,QACA,eACA,aACA,OACA,QACA,WACA,UACA,eACA,aACA,UACA,SACA,SACA,cACA,UACA;AASM,SAASC,EAAgBN,IAAAA;AAC/B,MAAA,CAAKA,GAAO,QAAA;AACZ,QAA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,SAAOoB,KADiB;AAEzB;AAOA,SAASlB,EAAaF,IAAAA;AACrB,QAAMsB,KAAYtB,GAAIrB,YAAAA;AACtB,SAAiB,MAAb2C,GAAErC,SACE,IAAIqC,GAAE,CAAA,CAAA,GAAKA,GAAE,CAAA,CAAA,GAAKA,GAAE,CAAA,CAAA,GAAKA,GAAE,KAAKA,GAAE,CAAA,CAAA,GAAKA,GAAE,CAAA,CAAA,KAE1CA;AACR;AAGA,SAASD,EAAUE,IAAAA;AAClB,SAAOA,MAAW,UAAUA,KAAU,UAAUA,KAAU,SAAS,UAAU;AAC9E;AAYA,MAAML,IAAoD,CACzD,CAAC,IAAI,KAAA,GACL,CAAC,IAAI,QAAA,GACL,CAAC,IAAI,QAAA,GACL,CAAC,KAAK,UACN,CAAC,KAAK,MAAA,GACN,CAAC,KAAK,MAAA,GACN,CAAC,KAAK,QAAA,GACN,CAAC,KAAK,MAAA,GACN,CAAC,KAAK,KAAA,CAAA;"}
@@ -1,125 +0,0 @@
1
- import { n as t } from "./ToolbarKeyboardNav-B32OMv8r.mjs";
2
- import { f as e } from "./Commands-CicwYoTQ.mjs";
3
- import { i as o } from "./AttrRegistry-I-VdmRnN.mjs";
4
- import { g as n, h as r } from "./Document-CuwE73FF.mjs";
5
- import { i as a, a as c, b as s, s as l } from "./Selection-DmFDwiPJ.mjs";
6
- import { m as i } from "./TypeBrands-C09nE2qO.mjs";
7
- import { i as d, g as p, a as u } from "./ColorNames-BdsHwA2f.mjs";
8
- const f = '\n/* Color Picker Popup */\n.notectl-color-picker {\n padding: 8px;\n min-width: 240px;\n}\n\n.notectl-color-picker__default {\n display: block;\n width: 100%;\n padding: 6px 12px;\n margin-bottom: 8px;\n border: 1px solid var(--notectl-border);\n border-radius: 4px;\n background: var(--notectl-bg);\n cursor: pointer;\n font-size: 13px;\n color: var(--notectl-fg);\n text-align: center;\n}\n\n.notectl-color-picker__default:hover {\n background: var(--notectl-hover-bg);\n}\n\n.notectl-color-picker__grid {\n display: grid;\n grid-template-columns: repeat(10, 1fr);\n gap: 3px;\n}\n\n.notectl-color-picker__grid [role="row"] {\n display: contents;\n}\n\n.notectl-color-picker__swatch {\n width: 22px;\n height: 22px;\n border: 1px solid transparent;\n border-radius: 3px;\n padding: 0;\n cursor: pointer;\n transition: transform 0.1s;\n}\n\n.notectl-color-picker__swatch:hover,\n.notectl-color-picker__swatch:focus-visible {\n transform: scale(1.25);\n z-index: 1;\n}\n\n.notectl-color-picker__swatch:focus-visible {\n outline: 2px solid var(--notectl-focus-ring);\n outline-offset: 1px;\n}\n\n.notectl-color-picker__swatch--active {\n border: 2px solid var(--notectl-primary-fg);\n border-radius: 3px;\n}\n\n.notectl-toolbar-btn--textColor .notectl-toolbar-btn__color-indicator {\n display: block;\n width: 16px;\n height: 3px;\n margin-top: 1px;\n border-radius: 1px;\n}\n';
9
- function m(t2, e2) {
10
- const r2 = t2.selection;
11
- if (a(r2) || c(r2)) return null;
12
- if (s(r2)) {
13
- if (t2.storedMarks) {
14
- const n2 = t2.storedMarks.find((t3) => t3.type === e2);
15
- return n2 && o(n2, e2) ? n2.attrs.color ?? null : null;
16
- }
17
- const a2 = t2.getBlock(r2.anchor.blockId);
18
- if (!a2) return null;
19
- const c2 = n(a2, r2.anchor.offset).find((t3) => t3.type === e2);
20
- return c2 && o(c2, e2) ? c2.attrs.color ?? null : null;
21
- }
22
- const l2 = t2.getBlock(r2.anchor.blockId);
23
- if (!l2) return null;
24
- const i2 = n(l2, r2.anchor.offset).find((t3) => t3.type === e2);
25
- return i2 && o(i2, e2) ? i2.attrs.color ?? null : null;
26
- }
27
- function k(t2, e2) {
28
- return null !== m(t2, e2);
29
- }
30
- function b(t2, o2, r2, p2) {
31
- if (!d(p2)) return false;
32
- const u2 = o2.selection;
33
- if (a(u2) || c(u2)) return false;
34
- const f2 = i(r2);
35
- if (s(u2)) {
36
- const e2 = o2.getBlock(u2.anchor.blockId);
37
- if (!e2) return false;
38
- const a2 = [...(o2.storedMarks ?? n(e2, u2.anchor.offset)).filter((t3) => t3.type !== r2), { type: f2, attrs: { color: p2 } }], c2 = o2.transaction("command").setStoredMarks(a2, o2.storedMarks).setSelection(u2).build();
39
- return t2.dispatch(c2), true;
40
- }
41
- const m2 = l(u2, o2.getBlockOrder()), k2 = o2.transaction("command"), b2 = { type: f2, attrs: { color: p2 } };
42
- return e(o2, m2, (t3, e2, o3) => {
43
- k2.removeMark(t3, e2, o3, { type: f2 }), k2.addMark(t3, e2, o3, b2);
44
- }), k2.setSelection(u2), t2.dispatch(k2.build()), true;
45
- }
46
- function h(t2, o2, d2) {
47
- const p2 = o2.selection;
48
- if (a(p2) || c(p2)) return false;
49
- const u2 = i(d2);
50
- if (s(p2)) {
51
- const e2 = o2.getBlock(p2.anchor.blockId);
52
- if (!e2) return false;
53
- const a2 = o2.storedMarks ?? n(e2, p2.anchor.offset);
54
- if (!r(a2, u2)) return false;
55
- const c2 = a2.filter((t3) => t3.type !== d2), s2 = o2.transaction("command").setStoredMarks(c2, o2.storedMarks).setSelection(p2).build();
56
- return t2.dispatch(s2), true;
57
- }
58
- const f2 = l(p2, o2.getBlockOrder()), m2 = o2.transaction("command");
59
- return e(o2, f2, (t3, e2, o3) => {
60
- m2.removeMark(t3, e2, o3, { type: u2 });
61
- }), m2.setSelection(p2), t2.dispatch(m2.build()), true;
62
- }
63
- const g = /* @__PURE__ */ new Set(["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"]), y = /* @__PURE__ */ new Set(["Home", "End"]);
64
- function x(e2, o2, n2) {
65
- e2.classList.add("notectl-color-picker");
66
- const r2 = m(o2.getState(), n2.markType), a2 = n2.columns || 10, c2 = n2.colors.length, s2 = Math.ceil(c2 / a2), l2 = document.createElement("button");
67
- l2.type = "button", l2.className = "notectl-color-picker__default", l2.textContent = n2.resetLabel, l2.addEventListener("mousedown", (t2) => {
68
- t2.preventDefault(), t2.stopPropagation(), o2.executeCommand(n2.resetCommand), n2.onClose();
69
- }), l2.addEventListener("keydown", (t2) => {
70
- "Escape" === t2.key && (t2.preventDefault(), n2.onClose());
71
- }), e2.appendChild(l2);
72
- const i2 = document.createElement("div");
73
- i2.className = "notectl-color-picker__grid", i2.setAttribute("role", "grid"), i2.setAttribute("aria-label", `${n2.ariaLabelPrefix} color picker`);
74
- const d2 = [];
75
- let f2 = 0;
76
- for (let t2 = 0; t2 < s2; t2++) {
77
- const e3 = document.createElement("div");
78
- e3.setAttribute("role", "row");
79
- for (let s3 = 0; s3 < a2; s3++) {
80
- const l3 = t2 * a2 + s3;
81
- if (l3 >= c2) break;
82
- const i3 = n2.colors[l3], m2 = p(i3), k2 = !!r2 && r2.toLowerCase() === i3.toLowerCase(), h2 = document.createElement("button");
83
- h2.type = "button", h2.className = "notectl-color-picker__swatch", h2.setAttribute("role", "gridcell"), h2.setAttribute("aria-label", `${n2.ariaLabelPrefix} ${m2}`), h2.setAttribute("aria-selected", String(k2)), h2.dataset.index = String(l3), h2.style.backgroundColor = i3, h2.title = i3, u(i3) && (h2.style.border = "1px solid #d0d0d0"), k2 && (h2.classList.add("notectl-color-picker__swatch--active"), f2 = l3), h2.addEventListener("mousedown", (t3) => {
84
- t3.preventDefault(), t3.stopPropagation(), b(o2, o2.getState(), n2.markType, i3), n2.onClose();
85
- }), d2.push(h2), e3.appendChild(h2);
86
- }
87
- i2.appendChild(e3);
88
- }
89
- v(d2, f2), i2.addEventListener("keydown", (e3) => {
90
- if ("Escape" === e3.key) return e3.preventDefault(), void n2.onClose();
91
- if ("Enter" === e3.key || " " === e3.key) {
92
- e3.preventDefault();
93
- const t2 = e3.target.dataset.index;
94
- if (void 0 !== t2) {
95
- const e4 = n2.colors[Number(t2)];
96
- e4 && (b(o2, o2.getState(), n2.markType, e4), n2.onClose());
97
- }
98
- return;
99
- }
100
- if (g.has(e3.key)) {
101
- e3.preventDefault();
102
- const o3 = Math.floor(f2 / a2) + 1, n3 = f2 % a2 + 1, r3 = s2, l3 = a2, [i3, p2] = t(o3, n3, r3, l3, e3.key);
103
- let u2 = (i3 - 1) * a2 + (p2 - 1);
104
- return u2 >= c2 && (u2 = c2 - 1), f2 = u2, v(d2, f2), void d2[f2]?.focus();
105
- }
106
- if (y.has(e3.key)) {
107
- e3.preventDefault();
108
- const t2 = Math.floor(f2 / a2) * a2, o3 = Math.min(t2 + a2 - 1, c2 - 1);
109
- f2 = "Home" === e3.key ? t2 : o3, v(d2, f2), d2[f2]?.focus();
110
- }
111
- }), e2.appendChild(i2);
112
- }
113
- function v(t2, e2) {
114
- for (let o2 = 0; o2 < t2.length; o2++) {
115
- const n2 = t2[o2];
116
- n2 && n2.setAttribute("tabindex", o2 === e2 ? "0" : "-1");
117
- }
118
- }
119
- export {
120
- f as C,
121
- x as a,
122
- k as i,
123
- h as r
124
- };
125
- //# sourceMappingURL=ColorPickerPopup-xL8ZUfpB.mjs.map