@notectl/core 1.0.4 → 1.0.6

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 (334) hide show
  1. package/README.md +52 -148
  2. package/dist/chunks/AttrRegistry-DTsHyDVA.mjs +16 -0
  3. package/dist/chunks/AttrRegistry-DTsHyDVA.mjs.map +1 -0
  4. package/dist/chunks/Commands-DLP85Mp5.mjs +461 -0
  5. package/dist/chunks/Commands-DLP85Mp5.mjs.map +1 -0
  6. package/dist/chunks/Document-CI3iCwEP.mjs +177 -0
  7. package/dist/chunks/Document-CI3iCwEP.mjs.map +1 -0
  8. package/dist/chunks/HTMLUtils-0wvCRvJc.mjs +7 -0
  9. package/dist/chunks/HTMLUtils-0wvCRvJc.mjs.map +1 -0
  10. package/dist/chunks/NodeResolver-D68ZLXti.mjs +81 -0
  11. package/dist/chunks/NodeResolver-D68ZLXti.mjs.map +1 -0
  12. package/dist/chunks/NodeSpec-NZVvcCuH.mjs +8 -0
  13. package/dist/chunks/NodeSpec-NZVvcCuH.mjs.map +1 -0
  14. package/dist/chunks/Plugin-B9OZ6Y4c.mjs +15 -0
  15. package/dist/chunks/Plugin-B9OZ6Y4c.mjs.map +1 -0
  16. package/dist/chunks/Selection-D5ZjXoB7.mjs +44 -0
  17. package/dist/chunks/Selection-D5ZjXoB7.mjs.map +1 -0
  18. package/dist/chunks/ToolbarItem-ugDymuXi.mjs +7 -0
  19. package/dist/chunks/ToolbarItem-ugDymuXi.mjs.map +1 -0
  20. package/dist/chunks/ToolbarPlugin-sJTiZr-S.mjs +398 -0
  21. package/dist/chunks/ToolbarPlugin-sJTiZr-S.mjs.map +1 -0
  22. package/dist/chunks/TypeBrands-C09nE2qO.mjs +27 -0
  23. package/dist/chunks/TypeBrands-C09nE2qO.mjs.map +1 -0
  24. package/dist/chunks/color-picker-Csf0wx5a.mjs +5 -0
  25. package/dist/chunks/color-picker-Csf0wx5a.mjs.map +1 -0
  26. package/dist/chunks/index-QvKiO9_4.mjs +538 -0
  27. package/dist/chunks/index-QvKiO9_4.mjs.map +1 -0
  28. package/dist/commands/Commands.d.ts +71 -0
  29. package/dist/commands/Commands.d.ts.map +1 -0
  30. package/dist/commands/PasteCommand.d.ts +9 -0
  31. package/dist/commands/PasteCommand.d.ts.map +1 -0
  32. package/dist/decorations/Decoration.d.ts +76 -0
  33. package/dist/decorations/Decoration.d.ts.map +1 -0
  34. package/dist/decorations/PositionMapping.d.ts +9 -0
  35. package/dist/decorations/PositionMapping.d.ts.map +1 -0
  36. package/dist/editor/Announcer.d.ts +12 -0
  37. package/dist/editor/Announcer.d.ts.map +1 -0
  38. package/dist/editor/DocumentParser.d.ts +5 -0
  39. package/dist/editor/DocumentParser.d.ts.map +1 -0
  40. package/dist/editor/DocumentSerializer.d.ts +5 -0
  41. package/dist/editor/DocumentSerializer.d.ts.map +1 -0
  42. package/dist/editor/EditorDOM.d.ts +18 -0
  43. package/dist/editor/EditorDOM.d.ts.map +1 -0
  44. package/dist/editor/EditorThemeController.d.ts +21 -0
  45. package/dist/editor/EditorThemeController.d.ts.map +1 -0
  46. package/dist/editor/NotectlEditor.d.ts +135 -0
  47. package/dist/editor/NotectlEditor.d.ts.map +1 -0
  48. package/dist/editor/styles/base.d.ts +3 -0
  49. package/dist/editor/styles/base.d.ts.map +1 -0
  50. package/dist/editor/styles/code-block.d.ts +3 -0
  51. package/dist/editor/styles/code-block.d.ts.map +1 -0
  52. package/dist/editor/styles/color-picker.d.ts +3 -0
  53. package/dist/editor/styles/color-picker.d.ts.map +1 -0
  54. package/dist/editor/styles/font-select.d.ts +3 -0
  55. package/dist/editor/styles/font-select.d.ts.map +1 -0
  56. package/dist/editor/styles/font-size-select.d.ts +3 -0
  57. package/dist/editor/styles/font-size-select.d.ts.map +1 -0
  58. package/dist/editor/styles/heading-select.d.ts +3 -0
  59. package/dist/editor/styles/heading-select.d.ts.map +1 -0
  60. package/dist/editor/styles/image.d.ts +3 -0
  61. package/dist/editor/styles/image.d.ts.map +1 -0
  62. package/dist/editor/styles/list.d.ts +3 -0
  63. package/dist/editor/styles/list.d.ts.map +1 -0
  64. package/dist/editor/styles/reduced-motion.d.ts +3 -0
  65. package/dist/editor/styles/reduced-motion.d.ts.map +1 -0
  66. package/dist/editor/styles/table.d.ts +3 -0
  67. package/dist/editor/styles/table.d.ts.map +1 -0
  68. package/dist/editor/styles/toolbar.d.ts +3 -0
  69. package/dist/editor/styles/toolbar.d.ts.map +1 -0
  70. package/dist/editor/styles.d.ts +12 -0
  71. package/dist/editor/styles.d.ts.map +1 -0
  72. package/dist/editor/theme/ThemeEngine.d.ts +6 -0
  73. package/dist/editor/theme/ThemeEngine.d.ts.map +1 -0
  74. package/dist/editor/theme/ThemeTokens.d.ts +73 -0
  75. package/dist/editor/theme/ThemeTokens.d.ts.map +1 -0
  76. package/dist/fonts.d.ts +17 -0
  77. package/dist/fonts.d.ts.map +1 -0
  78. package/dist/fonts.mjs +7 -0
  79. package/dist/fonts.mjs.map +1 -0
  80. package/dist/index.d.ts +83 -2360
  81. package/dist/index.d.ts.map +1 -0
  82. package/dist/input/ClipboardHandler.d.ts +29 -0
  83. package/dist/input/ClipboardHandler.d.ts.map +1 -0
  84. package/dist/input/InputHandler.d.ts +32 -0
  85. package/dist/input/InputHandler.d.ts.map +1 -0
  86. package/dist/input/InputRule.d.ts +9 -0
  87. package/dist/input/InputRule.d.ts.map +1 -0
  88. package/dist/input/InternalClipboard.d.ts +23 -0
  89. package/dist/input/InternalClipboard.d.ts.map +1 -0
  90. package/dist/input/KeyboardHandler.d.ts +42 -0
  91. package/dist/input/KeyboardHandler.d.ts.map +1 -0
  92. package/dist/input/Keymap.d.ts +11 -0
  93. package/dist/input/Keymap.d.ts.map +1 -0
  94. package/dist/input/PasteHandler.d.ts +38 -0
  95. package/dist/input/PasteHandler.d.ts.map +1 -0
  96. package/dist/input/SourceNormalizer.d.ts +7 -0
  97. package/dist/input/SourceNormalizer.d.ts.map +1 -0
  98. package/dist/model/AttrRegistry.d.ts +39 -0
  99. package/dist/model/AttrRegistry.d.ts.map +1 -0
  100. package/dist/model/BuiltinSpecs.d.ts +4 -0
  101. package/dist/model/BuiltinSpecs.d.ts.map +1 -0
  102. package/dist/model/ContentModel.d.ts +12 -0
  103. package/dist/model/ContentModel.d.ts.map +1 -0
  104. package/dist/model/ContentSlice.d.ts +17 -0
  105. package/dist/model/ContentSlice.d.ts.map +1 -0
  106. package/dist/model/Document.d.ts +127 -0
  107. package/dist/model/Document.d.ts.map +1 -0
  108. package/dist/model/HTMLParser.d.ts +36 -0
  109. package/dist/model/HTMLParser.d.ts.map +1 -0
  110. package/dist/model/HTMLUtils.d.ts +6 -0
  111. package/dist/model/HTMLUtils.d.ts.map +1 -0
  112. package/dist/model/InlineNodeSpec.d.ts +20 -0
  113. package/dist/model/InlineNodeSpec.d.ts.map +1 -0
  114. package/dist/model/MarkSpec.d.ts +22 -0
  115. package/dist/model/MarkSpec.d.ts.map +1 -0
  116. package/dist/model/NodeResolver.d.ts +36 -0
  117. package/dist/model/NodeResolver.d.ts.map +1 -0
  118. package/dist/model/NodeSpec.d.ts +67 -0
  119. package/dist/model/NodeSpec.d.ts.map +1 -0
  120. package/dist/model/ParseRule.d.ts +11 -0
  121. package/dist/model/ParseRule.d.ts.map +1 -0
  122. package/dist/model/SanitizeConfig.d.ts +9 -0
  123. package/dist/model/SanitizeConfig.d.ts.map +1 -0
  124. package/dist/model/Schema.d.ts +17 -0
  125. package/dist/model/Schema.d.ts.map +1 -0
  126. package/dist/model/SchemaRegistry.d.ts +81 -0
  127. package/dist/model/SchemaRegistry.d.ts.map +1 -0
  128. package/dist/model/Selection.d.ts +52 -0
  129. package/dist/model/Selection.d.ts.map +1 -0
  130. package/dist/model/TypeBrands.d.ts +28 -0
  131. package/dist/model/TypeBrands.d.ts.map +1 -0
  132. package/dist/notectl-core.mjs +2715 -11109
  133. package/dist/notectl-core.mjs.map +1 -1
  134. package/dist/notectl-core.umd.js +6894 -0
  135. package/dist/notectl-core.umd.js.map +1 -0
  136. package/dist/plugins/EventBus.d.ts +13 -0
  137. package/dist/plugins/EventBus.d.ts.map +1 -0
  138. package/dist/plugins/Plugin.d.ts +85 -0
  139. package/dist/plugins/Plugin.d.ts.map +1 -0
  140. package/dist/plugins/PluginManager.d.ts +68 -0
  141. package/dist/plugins/PluginManager.d.ts.map +1 -0
  142. package/dist/plugins/alignment/AlignmentPlugin.d.ts +48 -0
  143. package/dist/plugins/alignment/AlignmentPlugin.d.ts.map +1 -0
  144. package/dist/plugins/alignment/index.d.ts +2 -0
  145. package/dist/plugins/alignment/index.d.ts.map +1 -0
  146. package/dist/plugins/alignment.mjs +92 -0
  147. package/dist/plugins/alignment.mjs.map +1 -0
  148. package/dist/plugins/blockquote/BlockquotePlugin.d.ts +30 -0
  149. package/dist/plugins/blockquote/BlockquotePlugin.d.ts.map +1 -0
  150. package/dist/plugins/blockquote/index.d.ts +2 -0
  151. package/dist/plugins/blockquote/index.d.ts.map +1 -0
  152. package/dist/plugins/blockquote.mjs +58 -0
  153. package/dist/plugins/blockquote.mjs.map +1 -0
  154. package/dist/plugins/code-block/CodeBlockCommands.d.ts +5 -0
  155. package/dist/plugins/code-block/CodeBlockCommands.d.ts.map +1 -0
  156. package/dist/plugins/code-block/CodeBlockKeyboardHandlers.d.ts +10 -0
  157. package/dist/plugins/code-block/CodeBlockKeyboardHandlers.d.ts.map +1 -0
  158. package/dist/plugins/code-block/CodeBlockNodeView.d.ts +5 -0
  159. package/dist/plugins/code-block/CodeBlockNodeView.d.ts.map +1 -0
  160. package/dist/plugins/code-block/CodeBlockPlugin.d.ts +27 -0
  161. package/dist/plugins/code-block/CodeBlockPlugin.d.ts.map +1 -0
  162. package/dist/plugins/code-block/CodeBlockService.d.ts +5 -0
  163. package/dist/plugins/code-block/CodeBlockService.d.ts.map +1 -0
  164. package/dist/plugins/code-block/CodeBlockTypes.d.ts +69 -0
  165. package/dist/plugins/code-block/CodeBlockTypes.d.ts.map +1 -0
  166. package/dist/plugins/code-block/index.d.ts +2 -0
  167. package/dist/plugins/code-block/index.d.ts.map +1 -0
  168. package/dist/plugins/code-block.mjs +6 -0
  169. package/dist/plugins/code-block.mjs.map +1 -0
  170. package/dist/plugins/font/FontPlugin.d.ts +85 -0
  171. package/dist/plugins/font/FontPlugin.d.ts.map +1 -0
  172. package/dist/plugins/font/StarterFonts.d.ts +10 -0
  173. package/dist/plugins/font/StarterFonts.d.ts.map +1 -0
  174. package/dist/plugins/font/index.d.ts +2 -0
  175. package/dist/plugins/font/index.d.ts.map +1 -0
  176. package/dist/plugins/font-size/FontSizeOperations.d.ts +22 -0
  177. package/dist/plugins/font-size/FontSizeOperations.d.ts.map +1 -0
  178. package/dist/plugins/font-size/FontSizePlugin.d.ts +56 -0
  179. package/dist/plugins/font-size/FontSizePlugin.d.ts.map +1 -0
  180. package/dist/plugins/font-size/FontSizePopup.d.ts +9 -0
  181. package/dist/plugins/font-size/FontSizePopup.d.ts.map +1 -0
  182. package/dist/plugins/font-size/index.d.ts +2 -0
  183. package/dist/plugins/font-size/index.d.ts.map +1 -0
  184. package/dist/plugins/font-size.mjs +204 -0
  185. package/dist/plugins/font-size.mjs.map +1 -0
  186. package/dist/plugins/font.mjs +186 -0
  187. package/dist/plugins/font.mjs.map +1 -0
  188. package/dist/plugins/hard-break/HardBreakPlugin.d.ts +16 -0
  189. package/dist/plugins/hard-break/HardBreakPlugin.d.ts.map +1 -0
  190. package/dist/plugins/hard-break/index.d.ts +2 -0
  191. package/dist/plugins/hard-break/index.d.ts.map +1 -0
  192. package/dist/plugins/hard-break.mjs +28 -0
  193. package/dist/plugins/hard-break.mjs.map +1 -0
  194. package/dist/plugins/heading/BlockTypePickerEntry.d.ts +20 -0
  195. package/dist/plugins/heading/BlockTypePickerEntry.d.ts.map +1 -0
  196. package/dist/plugins/heading/HeadingPlugin.d.ts +78 -0
  197. package/dist/plugins/heading/HeadingPlugin.d.ts.map +1 -0
  198. package/dist/plugins/heading/index.d.ts +3 -0
  199. package/dist/plugins/heading/index.d.ts.map +1 -0
  200. package/dist/plugins/heading.mjs +188 -0
  201. package/dist/plugins/heading.mjs.map +1 -0
  202. package/dist/plugins/highlight/HighlightPlugin.d.ts +37 -0
  203. package/dist/plugins/highlight/HighlightPlugin.d.ts.map +1 -0
  204. package/dist/plugins/highlight/index.d.ts +2 -0
  205. package/dist/plugins/highlight/index.d.ts.map +1 -0
  206. package/dist/plugins/highlight.mjs +126 -0
  207. package/dist/plugins/highlight.mjs.map +1 -0
  208. package/dist/plugins/horizontal-rule/HorizontalRulePlugin.d.ts +29 -0
  209. package/dist/plugins/horizontal-rule/HorizontalRulePlugin.d.ts.map +1 -0
  210. package/dist/plugins/horizontal-rule/index.d.ts +2 -0
  211. package/dist/plugins/horizontal-rule/index.d.ts.map +1 -0
  212. package/dist/plugins/horizontal-rule.mjs +59 -0
  213. package/dist/plugins/horizontal-rule.mjs.map +1 -0
  214. package/dist/plugins/image/ImageCommands.d.ts +26 -0
  215. package/dist/plugins/image/ImageCommands.d.ts.map +1 -0
  216. package/dist/plugins/image/ImageNodeView.d.ts +6 -0
  217. package/dist/plugins/image/ImageNodeView.d.ts.map +1 -0
  218. package/dist/plugins/image/ImagePlugin.d.ts +43 -0
  219. package/dist/plugins/image/ImagePlugin.d.ts.map +1 -0
  220. package/dist/plugins/image/ImageUpload.d.ts +48 -0
  221. package/dist/plugins/image/ImageUpload.d.ts.map +1 -0
  222. package/dist/plugins/image/index.d.ts +3 -0
  223. package/dist/plugins/image/index.d.ts.map +1 -0
  224. package/dist/plugins/image.mjs +381 -0
  225. package/dist/plugins/image.mjs.map +1 -0
  226. package/dist/plugins/link/LinkPlugin.d.ts +32 -0
  227. package/dist/plugins/link/LinkPlugin.d.ts.map +1 -0
  228. package/dist/plugins/link/index.d.ts +2 -0
  229. package/dist/plugins/link/index.d.ts.map +1 -0
  230. package/dist/plugins/link.mjs +127 -0
  231. package/dist/plugins/link.mjs.map +1 -0
  232. package/dist/plugins/list/ListPlugin.d.ts +51 -0
  233. package/dist/plugins/list/ListPlugin.d.ts.map +1 -0
  234. package/dist/plugins/list/index.d.ts +2 -0
  235. package/dist/plugins/list/index.d.ts.map +1 -0
  236. package/dist/plugins/list.mjs +193 -0
  237. package/dist/plugins/list.mjs.map +1 -0
  238. package/dist/plugins/print/PrintContentPreparer.d.ts +12 -0
  239. package/dist/plugins/print/PrintContentPreparer.d.ts.map +1 -0
  240. package/dist/plugins/print/PrintPlugin.d.ts +12 -0
  241. package/dist/plugins/print/PrintPlugin.d.ts.map +1 -0
  242. package/dist/plugins/print/PrintServiceImpl.d.ts +7 -0
  243. package/dist/plugins/print/PrintServiceImpl.d.ts.map +1 -0
  244. package/dist/plugins/print/PrintStyleCollector.d.ts +10 -0
  245. package/dist/plugins/print/PrintStyleCollector.d.ts.map +1 -0
  246. package/dist/plugins/print/PrintTypes.d.ts +56 -0
  247. package/dist/plugins/print/PrintTypes.d.ts.map +1 -0
  248. package/dist/plugins/strikethrough/StrikethroughPlugin.d.ts +23 -0
  249. package/dist/plugins/strikethrough/StrikethroughPlugin.d.ts.map +1 -0
  250. package/dist/plugins/strikethrough/index.d.ts +2 -0
  251. package/dist/plugins/strikethrough/index.d.ts.map +1 -0
  252. package/dist/plugins/strikethrough.mjs +35 -0
  253. package/dist/plugins/strikethrough.mjs.map +1 -0
  254. package/dist/plugins/super-sub/SuperSubPlugin.d.ts +44 -0
  255. package/dist/plugins/super-sub/SuperSubPlugin.d.ts.map +1 -0
  256. package/dist/plugins/super-sub/index.d.ts +2 -0
  257. package/dist/plugins/super-sub/index.d.ts.map +1 -0
  258. package/dist/plugins/super-sub.mjs +81 -0
  259. package/dist/plugins/super-sub.mjs.map +1 -0
  260. package/dist/plugins/table/TableCommands.d.ts +50 -0
  261. package/dist/plugins/table/TableCommands.d.ts.map +1 -0
  262. package/dist/plugins/table/TableControls.d.ts +10 -0
  263. package/dist/plugins/table/TableControls.d.ts.map +1 -0
  264. package/dist/plugins/table/TableControlsDOM.d.ts +18 -0
  265. package/dist/plugins/table/TableControlsDOM.d.ts.map +1 -0
  266. package/dist/plugins/table/TableControlsLayout.d.ts +34 -0
  267. package/dist/plugins/table/TableControlsLayout.d.ts.map +1 -0
  268. package/dist/plugins/table/TableHelpers.d.ts +39 -0
  269. package/dist/plugins/table/TableHelpers.d.ts.map +1 -0
  270. package/dist/plugins/table/TableNavigation.d.ts +4 -0
  271. package/dist/plugins/table/TableNavigation.d.ts.map +1 -0
  272. package/dist/plugins/table/TableNodeViews.d.ts +18 -0
  273. package/dist/plugins/table/TableNodeViews.d.ts.map +1 -0
  274. package/dist/plugins/table/TablePlugin.d.ts +39 -0
  275. package/dist/plugins/table/TablePlugin.d.ts.map +1 -0
  276. package/dist/plugins/table/TableSelection.d.ts +26 -0
  277. package/dist/plugins/table/TableSelection.d.ts.map +1 -0
  278. package/dist/plugins/table/TableTestUtils.d.ts +45 -0
  279. package/dist/plugins/table/TableTestUtils.d.ts.map +1 -0
  280. package/dist/plugins/table/index.d.ts +4 -0
  281. package/dist/plugins/table/index.d.ts.map +1 -0
  282. package/dist/plugins/table.mjs +663 -0
  283. package/dist/plugins/table.mjs.map +1 -0
  284. package/dist/plugins/text-color/TextColorPlugin.d.ts +37 -0
  285. package/dist/plugins/text-color/TextColorPlugin.d.ts.map +1 -0
  286. package/dist/plugins/text-color/index.d.ts +2 -0
  287. package/dist/plugins/text-color/index.d.ts.map +1 -0
  288. package/dist/plugins/text-color.mjs +126 -0
  289. package/dist/plugins/text-color.mjs.map +1 -0
  290. package/dist/plugins/text-formatting/TextFormattingPlugin.d.ts +34 -0
  291. package/dist/plugins/text-formatting/TextFormattingPlugin.d.ts.map +1 -0
  292. package/dist/plugins/text-formatting/index.d.ts +2 -0
  293. package/dist/plugins/text-formatting/index.d.ts.map +1 -0
  294. package/dist/plugins/text-formatting.mjs +52 -0
  295. package/dist/plugins/text-formatting.mjs.map +1 -0
  296. package/dist/plugins/toolbar/ToolbarItem.d.ts +66 -0
  297. package/dist/plugins/toolbar/ToolbarItem.d.ts.map +1 -0
  298. package/dist/plugins/toolbar/ToolbarKeyboardNav.d.ts +25 -0
  299. package/dist/plugins/toolbar/ToolbarKeyboardNav.d.ts.map +1 -0
  300. package/dist/plugins/toolbar/ToolbarPlugin.d.ts +47 -0
  301. package/dist/plugins/toolbar/ToolbarPlugin.d.ts.map +1 -0
  302. package/dist/plugins/toolbar/ToolbarPopupController.d.ts +25 -0
  303. package/dist/plugins/toolbar/ToolbarPopupController.d.ts.map +1 -0
  304. package/dist/plugins/toolbar/ToolbarRenderers.d.ts +19 -0
  305. package/dist/plugins/toolbar/ToolbarRenderers.d.ts.map +1 -0
  306. package/dist/plugins/toolbar/ToolbarTooltip.d.ts +17 -0
  307. package/dist/plugins/toolbar/ToolbarTooltip.d.ts.map +1 -0
  308. package/dist/plugins/toolbar/index.d.ts +4 -0
  309. package/dist/plugins/toolbar/index.d.ts.map +1 -0
  310. package/dist/plugins/toolbar.mjs +8 -0
  311. package/dist/plugins/toolbar.mjs.map +1 -0
  312. package/dist/state/EditorState.d.ts +40 -0
  313. package/dist/state/EditorState.d.ts.map +1 -0
  314. package/dist/state/History.d.ts +38 -0
  315. package/dist/state/History.d.ts.map +1 -0
  316. package/dist/state/StepApplication.d.ts +5 -0
  317. package/dist/state/StepApplication.d.ts.map +1 -0
  318. package/dist/state/Transaction.d.ts +185 -0
  319. package/dist/state/Transaction.d.ts.map +1 -0
  320. package/dist/test/PluginTestUtils.d.ts +127 -0
  321. package/dist/test/PluginTestUtils.d.ts.map +1 -0
  322. package/dist/test/TestUtils.d.ts +153 -0
  323. package/dist/test/TestUtils.d.ts.map +1 -0
  324. package/dist/view/EditorView.d.ts +74 -0
  325. package/dist/view/EditorView.d.ts.map +1 -0
  326. package/dist/view/NodeView.d.ts +18 -0
  327. package/dist/view/NodeView.d.ts.map +1 -0
  328. package/dist/view/Reconciler.d.ts +23 -0
  329. package/dist/view/Reconciler.d.ts.map +1 -0
  330. package/dist/view/SelectionSync.d.ts +8 -0
  331. package/dist/view/SelectionSync.d.ts.map +1 -0
  332. package/package.json +112 -11
  333. package/dist/notectl-core.js +0 -1463
  334. package/dist/notectl-core.js.map +0 -1
@@ -0,0 +1,69 @@
1
+ import { BlockId } from '../../model/TypeBrands.js';
2
+ import { ServiceKey } from '../Plugin.js';
3
+ declare module '../../model/AttrRegistry.js' {
4
+ interface NodeAttrRegistry {
5
+ code_block: {
6
+ language: string;
7
+ backgroundColor: string;
8
+ };
9
+ }
10
+ }
11
+ export interface SyntaxToken {
12
+ readonly from: number;
13
+ readonly to: number;
14
+ readonly type: string;
15
+ }
16
+ export interface SyntaxHighlighter {
17
+ tokenize(code: string, language: string): readonly SyntaxToken[];
18
+ getSupportedLanguages(): readonly string[];
19
+ }
20
+ /**
21
+ * Configurable keyboard bindings for CodeBlockPlugin actions.
22
+ * Omit a slot to use the default; set to `null` to disable the binding.
23
+ *
24
+ * Key descriptor format: `'Mod-Enter'`, `'Mod-Shift-M'`, etc.
25
+ * `Mod` resolves to Cmd on macOS, Ctrl on Windows/Linux.
26
+ */
27
+ export interface CodeBlockKeymap {
28
+ /**
29
+ * Insert a new paragraph below the code block and move the cursor there.
30
+ * @default 'Mod-Enter'
31
+ */
32
+ readonly insertAfter?: string | null;
33
+ /**
34
+ * Toggle the current block between code block and paragraph.
35
+ * @default 'Mod-Shift-M'
36
+ */
37
+ readonly toggle?: string | null;
38
+ }
39
+ export declare const DEFAULT_KEYMAP: Readonly<Record<keyof CodeBlockKeymap, string>>;
40
+ export interface CodeBlockConfig {
41
+ readonly highlighter?: SyntaxHighlighter;
42
+ readonly defaultLanguage?: string;
43
+ readonly useSpaces?: boolean;
44
+ readonly spaceCount?: number;
45
+ readonly showCopyButton?: boolean;
46
+ readonly separatorAfter?: boolean;
47
+ /** Default body background color (overrides --notectl-code-block-bg). */
48
+ readonly background?: string;
49
+ /** Default header background color (overrides --notectl-code-block-header-bg). */
50
+ readonly headerBackground?: string;
51
+ /** Default text color (overrides --notectl-code-block-color). */
52
+ readonly textColor?: string;
53
+ /** Default header/label text color (overrides --notectl-code-block-header-color). */
54
+ readonly headerColor?: string;
55
+ /** Customize keyboard bindings for code block actions. */
56
+ readonly keymap?: CodeBlockKeymap;
57
+ }
58
+ export declare const DEFAULT_CONFIG: CodeBlockConfig;
59
+ export interface CodeBlockService {
60
+ setLanguage(blockId: BlockId, language: string): void;
61
+ getLanguage(blockId: BlockId): string;
62
+ setBackground(blockId: BlockId, color: string): void;
63
+ getBackground(blockId: BlockId): string;
64
+ isCodeBlock(blockId: BlockId): boolean;
65
+ getSupportedLanguages(): readonly string[];
66
+ }
67
+ export declare const CODE_BLOCK_SERVICE_KEY: ServiceKey<CodeBlockService>;
68
+ export declare const CODE_BLOCK_ICON = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z\"/></svg>";
69
+ //# sourceMappingURL=CodeBlockTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeBlockTypes.d.ts","sourceRoot":"","sources":["../../../src/plugins/code-block/CodeBlockTypes.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C,OAAO,QAAQ,6BAA6B,CAAC;IAC5C,UAAU,gBAAgB;QACzB,UAAU,EAAE;YACX,QAAQ,EAAE,MAAM,CAAC;YACjB,eAAe,EAAE,MAAM,CAAC;SACxB,CAAC;KACF;CACD;AAID,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,iBA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AAG,IAAI,CAAC;IACtD,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC;IACtC,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrD,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC;IACxC,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC;IACvC,qBAAqB,IAAI,SAAS,MAAM,EAAE,CAAC;CAC3C;AAED,eAAO,MAAM,sBAAsB,8BAAgD,CAAC;AAIpF,eAAO,MAAM,eAAe,mLAC+I,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { CodeBlockPlugin, CODE_BLOCK_SERVICE_KEY, type CodeBlockConfig, type CodeBlockKeymap, type CodeBlockService, type SyntaxHighlighter, type SyntaxToken, } from './CodeBlockPlugin.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/code-block/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,sBAAsB,EACtB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,WAAW,GAChB,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { C, a } from "../chunks/index-QvKiO9_4.mjs";
2
+ export {
3
+ C as CODE_BLOCK_SERVICE_KEY,
4
+ a as CodeBlockPlugin
5
+ };
6
+ //# sourceMappingURL=code-block.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-block.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,85 @@
1
+ import { EditorState } from '../../state/EditorState.js';
2
+ import { Transaction } from '../../state/Transaction.js';
3
+ import { Plugin, PluginContext } from '../Plugin.js';
4
+ declare module '../../model/AttrRegistry.js' {
5
+ interface MarkAttrRegistry {
6
+ font: {
7
+ family: string;
8
+ };
9
+ }
10
+ }
11
+ /** Describes a single @font-face source. */
12
+ export interface FontFaceDescriptor {
13
+ /** CSS `src` value, e.g. `"url('/fonts/My.woff2') format('woff2')"`. */
14
+ readonly src: string;
15
+ /** Font weight, e.g. `'400'` or `'300 700'` for variable fonts. */
16
+ readonly weight?: string;
17
+ /** Font style, e.g. `'normal'` or `'italic'`. */
18
+ readonly style?: string;
19
+ /** Font display strategy. Defaults to `'swap'`. */
20
+ readonly display?: string;
21
+ }
22
+ /** Defines a font available in the editor. */
23
+ export interface FontDefinition {
24
+ /** Display name shown in the toolbar dropdown. */
25
+ readonly name: string;
26
+ /** CSS `font-family` value, e.g. `"'Fira Code', monospace"`. */
27
+ readonly family: string;
28
+ /** Font category for grouping in the UI. */
29
+ readonly category?: 'serif' | 'sans-serif' | 'monospace' | 'display' | 'handwriting';
30
+ /**
31
+ * Optional `@font-face` descriptors. When provided, the plugin
32
+ * auto-injects the corresponding CSS rules into the document.
33
+ */
34
+ readonly fontFaces?: readonly FontFaceDescriptor[];
35
+ }
36
+ export interface FontConfig {
37
+ /**
38
+ * Fonts available in the editor. System fonts require no `fontFaces`.
39
+ * Custom fonts with `fontFaces` get their `@font-face` rules auto-injected.
40
+ *
41
+ * Use `STARTER_FONTS` for a pre-configured set of fonts:
42
+ * ```ts
43
+ * new FontPlugin({ fonts: [...STARTER_FONTS] })
44
+ * ```
45
+ */
46
+ readonly fonts: readonly FontDefinition[];
47
+ /**
48
+ * Name of the font that acts as the editor's default.
49
+ * Selecting this font removes the mark (since the editor already uses it).
50
+ * Defaults to the first font in the list.
51
+ */
52
+ readonly defaultFont?: string;
53
+ /** When true, a separator is rendered after the font toolbar item. */
54
+ readonly separatorAfter?: boolean;
55
+ }
56
+ export declare class FontPlugin implements Plugin {
57
+ readonly id = "font";
58
+ readonly name = "Font";
59
+ readonly priority = 22;
60
+ private readonly config;
61
+ private injectedStyleElement;
62
+ private context;
63
+ private comboLabel;
64
+ constructor(config: FontConfig);
65
+ init(context: PluginContext): void;
66
+ destroy(): void;
67
+ onStateChange(_oldState: EditorState, newState: EditorState, _tr: Transaction): void;
68
+ private registerMarkSpec;
69
+ private registerCommands;
70
+ private get defaultFont();
71
+ private registerToolbarItem;
72
+ private updateComboLabel;
73
+ private resolveFontName;
74
+ private isFontActive;
75
+ getActiveFont(state: EditorState): string | null;
76
+ applyFont(context: PluginContext, state: EditorState, family: string): boolean;
77
+ private removeFont;
78
+ /** Finds the first font mark in a block's text range (for proper step inversion). */
79
+ private findFontMarkInRange;
80
+ private injectFontFaces;
81
+ private dismissPopup;
82
+ private renderFontPopup;
83
+ private createFontItem;
84
+ }
85
+ //# sourceMappingURL=FontPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FontPlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/font/FontPlugin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAK1D,OAAO,QAAQ,6BAA6B,CAAC;IAC5C,UAAU,gBAAgB;QACzB,IAAI,EAAE;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;KACzB;CACD;AAID,4CAA4C;AAC5C,MAAM,WAAW,kBAAkB;IAClC,wEAAwE;IACxE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,mEAAmE;IACnE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,iDAAiD;IACjD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,mDAAmD;IACnD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,8CAA8C;AAC9C,MAAM,WAAW,cAAc;IAC9B,kDAAkD;IAClD,QAAQ,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G,IAAI;IAyBhD,SAAS,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO;IAyC9E,OAAO,CAAC,UAAU;IAuClB,qFAAqF;IACrF,OAAO,CAAC,mBAAmB;IAgB3B,OAAO,CAAC,eAAe;IAgCvB,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,eAAe;IA0CvB,OAAO,CAAC,cAAc;CAgCtB"}
@@ -0,0 +1,10 @@
1
+ import { FontDefinition } from './FontPlugin.js';
2
+ export declare const FIRA_CODE_WOFF2_DATA: string;
3
+ export declare const FIRA_SANS_WOFF2_DATA: string;
4
+ /** Fira Code — a monospace font with programming ligatures. */
5
+ export declare const FIRA_CODE: FontDefinition;
6
+ /** Fira Sans — a humanist sans-serif typeface. */
7
+ export declare const FIRA_SANS: FontDefinition;
8
+ /** All starter fonts bundled with notectl. */
9
+ export declare const STARTER_FONTS: readonly FontDefinition[];
10
+ //# sourceMappingURL=StarterFonts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StarterFonts.d.ts","sourceRoot":"","sources":["../../../src/plugins/font/StarterFonts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,eAAO,MAAM,oBAAoB,EAAE,MAC+6sI,CAAC;AAEn9sI,eAAO,MAAM,oBAAoB,EAAE,MACuogL,CAAC;AAE3qgL,+DAA+D;AAC/D,eAAO,MAAM,SAAS,EAAE,cAWvB,CAAC;AAEF,kDAAkD;AAClD,eAAO,MAAM,SAAS,EAAE,cAWvB,CAAC;AAEF,8CAA8C;AAC9C,eAAO,MAAM,aAAa,EAAE,SAAS,cAAc,EAA2B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { FontPlugin, type FontConfig, type FontDefinition, type FontFaceDescriptor, } from './FontPlugin.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/font/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,UAAU,EACV,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,kBAAkB,GACvB,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { EditorState } from '../../state/EditorState.js';
2
+ import { PluginContext } from '../Plugin.js';
3
+ /** Returns the raw fontSize CSS value at the current selection, or null. */
4
+ export declare function getActiveSize(state: EditorState): string | null;
5
+ /** Returns the active font size as a number, falling back to defaultSize. */
6
+ export declare function getActiveSizeNumeric(state: EditorState, defaultSize: number): number;
7
+ /** Returns true when the selection carries a fontSize mark. */
8
+ export declare function isFontSizeActive(state: EditorState): boolean;
9
+ /** Applies a fontSize mark with the given CSS size string to the selection. */
10
+ export declare function applyFontSize(context: PluginContext, state: EditorState, size: string): boolean;
11
+ /** Removes the fontSize mark from the current selection. */
12
+ export declare function removeFontSize(context: PluginContext, state: EditorState): boolean;
13
+ /** Steps the font size up or down through the preset list. */
14
+ export declare function stepFontSize(context: PluginContext, state: EditorState, direction: 'up' | 'down', sizes: readonly number[], defaultSize: number): boolean;
15
+ /**
16
+ * Selects a specific font size: removes the mark when size equals the
17
+ * default, otherwise applies the new size.
18
+ */
19
+ export declare function selectSize(context: PluginContext, size: number, defaultSize: number): void;
20
+ /** Finds the next preset size in the given direction, or null at boundaries. */
21
+ export declare function getNextPresetSize(current: number, direction: 'up' | 'down', sizes: readonly number[]): number | null;
22
+ //# sourceMappingURL=FontSizeOperations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FontSizeOperations.d.ts","sourceRoot":"","sources":["../../../src/plugins/font-size/FontSizeOperations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAIlD,4EAA4E;AAC5E,wBAAgB,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAW/D;AAED,6EAA6E;AAC7E,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAKpF;AAED,+DAA+D;AAC/D,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAE5D;AAID,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAgC/F;AAED,4DAA4D;AAC5D,wBAAgB,cAAc,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CA8BlF;AAED,8DAA8D;AAC9D,wBAAgB,YAAY,CAC3B,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,IAAI,GAAG,MAAM,EACxB,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,WAAW,EAAE,MAAM,GACjB,OAAO,CAST;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAM1F;AAID,gFAAgF;AAChF,wBAAgB,iBAAiB,CAChC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,IAAI,GAAG,MAAM,EACxB,KAAK,EAAE,SAAS,MAAM,EAAE,GACtB,MAAM,GAAG,IAAI,CAYf"}
@@ -0,0 +1,56 @@
1
+ import { EditorState } from '../../state/EditorState.js';
2
+ import { Transaction } from '../../state/Transaction.js';
3
+ import { Plugin, PluginContext } from '../Plugin.js';
4
+ declare module '../../model/AttrRegistry.js' {
5
+ interface MarkAttrRegistry {
6
+ fontSize: {
7
+ size: string;
8
+ };
9
+ }
10
+ }
11
+ /** Default preset sizes shown in the font size dropdown. */
12
+ export declare const DEFAULT_FONT_SIZES: readonly number[];
13
+ export interface FontSizeConfig {
14
+ /**
15
+ * Preset sizes shown in the font size dropdown.
16
+ * Must contain positive integers. Values are sorted and deduplicated automatically.
17
+ * Defaults to {@link DEFAULT_FONT_SIZES} when omitted or empty.
18
+ */
19
+ readonly sizes?: readonly number[];
20
+ /**
21
+ * The base font size that text has when no fontSize mark is applied.
22
+ * Shown as the initial value in the toolbar combo and used as the
23
+ * "neutral" size — selecting it removes the mark instead of applying one.
24
+ * Defaults to 16.
25
+ */
26
+ readonly defaultSize?: number;
27
+ /** When true, a separator is rendered after the fontSize toolbar item. */
28
+ readonly separatorAfter?: boolean;
29
+ }
30
+ export declare class FontSizePlugin implements Plugin {
31
+ readonly id = "fontSize";
32
+ readonly name = "Font Size";
33
+ readonly priority = 21;
34
+ private readonly config;
35
+ private readonly sizes;
36
+ private readonly defaultSize;
37
+ private context;
38
+ private comboLabel;
39
+ constructor(config?: Partial<FontSizeConfig>);
40
+ init(context: PluginContext): void;
41
+ destroy(): void;
42
+ onStateChange(_oldState: EditorState, newState: EditorState, _tr: Transaction): void;
43
+ private registerMarkSpec;
44
+ private registerCommands;
45
+ private registerKeymaps;
46
+ private registerToolbarItem;
47
+ /**
48
+ * Sets the configured default font size on the editor content container
49
+ * so that unformatted text renders at the correct size instead of the
50
+ * browser default (16px).
51
+ */
52
+ private applyDefaultSizeToContainer;
53
+ private dismissPopup;
54
+ private updateComboLabel;
55
+ }
56
+ //# sourceMappingURL=FontSizePlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FontSizePlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/font-size/FontSizePlugin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,cA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
1
+ import { PluginContext } from '../Plugin.js';
2
+ export interface FontSizePopupConfig {
3
+ readonly sizes: readonly number[];
4
+ readonly defaultSize: number;
5
+ readonly dismissPopup: () => void;
6
+ }
7
+ /** Builds the font-size picker DOM inside the given container. */
8
+ export declare function renderFontSizePopup(container: HTMLElement, context: PluginContext, config: FontSizePopupConfig): void;
9
+ //# sourceMappingURL=FontSizePopup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FontSizePopup.d.ts","sourceRoot":"","sources":["../../../src/plugins/font-size/FontSizePopup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAUlD,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,IAAI,CAAC;CAClC;AAID,kEAAkE;AAClE,wBAAgB,mBAAmB,CAClC,SAAS,EAAE,WAAW,EACtB,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,mBAAmB,GACzB,IAAI,CAaN"}
@@ -0,0 +1,2 @@
1
+ export { FontSizePlugin, type FontSizeConfig, } from './FontSizePlugin.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/font-size/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,cAAc,EACd,KAAK,cAAc,GACnB,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,204 @@
1
+ import { a as t } from "../chunks/ToolbarPlugin-sJTiZr-S.mjs";
2
+ import { t as e } from "../chunks/Commands-DLP85Mp5.mjs";
3
+ import { b as n } from "../chunks/AttrRegistry-DTsHyDVA.mjs";
4
+ import { e as o, h as i } from "../chunks/Document-CI3iCwEP.mjs";
5
+ import { i as r, a as s, s as a } from "../chunks/Selection-D5ZjXoB7.mjs";
6
+ import { m as c } from "../chunks/TypeBrands-C09nE2qO.mjs";
7
+ function l(t2) {
8
+ const e2 = t2.selection;
9
+ if (r(e2)) return null;
10
+ if (s(e2) && t2.storedMarks) return b(t2.storedMarks);
11
+ const n2 = t2.getBlock(e2.anchor.blockId);
12
+ return n2 ? b(o(n2, e2.anchor.offset)) : null;
13
+ }
14
+ function p(t2, e2) {
15
+ const n2 = l(t2);
16
+ if (!n2) return e2;
17
+ const o2 = Number.parseInt(n2, 10);
18
+ return Number.isNaN(o2) ? e2 : o2;
19
+ }
20
+ function u(t2, n2, i2) {
21
+ const l2 = n2.selection;
22
+ if (r(l2)) return false;
23
+ if (s(l2)) {
24
+ const e2 = n2.getBlock(l2.anchor.blockId);
25
+ if (!e2) return false;
26
+ const r2 = [...(n2.storedMarks ?? o(e2, l2.anchor.offset)).filter((t3) => "fontSize" !== t3.type), { type: c("fontSize"), attrs: { size: i2 } }], s2 = n2.transaction("command").setStoredMarks(r2, n2.storedMarks).setSelection(l2).build();
27
+ return t2.dispatch(s2), true;
28
+ }
29
+ const p2 = a(l2, n2.getBlockOrder()), u2 = n2.transaction("command"), f2 = { type: c("fontSize"), attrs: { size: i2 } };
30
+ return e(n2, p2, (t3, e2, n3) => {
31
+ u2.removeMark(t3, e2, n3, { type: c("fontSize") }), u2.addMark(t3, e2, n3, f2);
32
+ }), u2.setSelection(l2), t2.dispatch(u2.build()), true;
33
+ }
34
+ function f(t2, n2) {
35
+ const l2 = n2.selection;
36
+ if (r(l2)) return false;
37
+ if (s(l2)) {
38
+ const e2 = n2.getBlock(l2.anchor.blockId);
39
+ if (!e2) return false;
40
+ const r2 = n2.storedMarks ?? o(e2, l2.anchor.offset);
41
+ if (!i(r2, c("fontSize"))) return false;
42
+ const s2 = r2.filter((t3) => "fontSize" !== t3.type), a2 = n2.transaction("command").setStoredMarks(s2, n2.storedMarks).setSelection(l2).build();
43
+ return t2.dispatch(a2), true;
44
+ }
45
+ const p2 = a(l2, n2.getBlockOrder()), u2 = n2.transaction("command");
46
+ return e(n2, p2, (t3, e2, n3) => {
47
+ u2.removeMark(t3, e2, n3, { type: c("fontSize") });
48
+ }), u2.setSelection(l2), t2.dispatch(u2.build()), true;
49
+ }
50
+ function d(t2, e2, n2, o2, i2) {
51
+ const r2 = (function(t3, e3, n3) {
52
+ if ("up" === e3) {
53
+ for (const e4 of n3) if (e4 > t3) return e4;
54
+ return null;
55
+ }
56
+ for (let e4 = n3.length - 1; e4 >= 0; e4--) {
57
+ const o3 = n3[e4];
58
+ if (void 0 !== o3 && o3 < t3) return o3;
59
+ }
60
+ return null;
61
+ })(p(e2, i2), n2, o2);
62
+ return null !== r2 && (r2 === i2 ? f(t2, e2) : u(t2, e2, `${r2}px`));
63
+ }
64
+ function m(t2, e2, n2) {
65
+ e2 === n2 ? t2.executeCommand("removeFontSize") : u(t2, t2.getState(), `${e2}px`);
66
+ }
67
+ function b(t2) {
68
+ const e2 = t2.find((t3) => "fontSize" === t3.type);
69
+ return e2 && n(e2, "fontSize") ? e2.attrs.size ?? null : null;
70
+ }
71
+ function z(t2, e2) {
72
+ const n2 = document.createElement("button");
73
+ n2.type = "button", n2.id = `notectl-font-size-option-${t2}`, n2.className = "notectl-font-size-picker__item", n2.setAttribute("role", "option"), n2.setAttribute("aria-selected", String(e2)), e2 && n2.classList.add("notectl-font-size-picker__item--active");
74
+ const o2 = document.createElement("span");
75
+ o2.className = "notectl-font-size-picker__check", o2.textContent = e2 ? "✓" : "", n2.appendChild(o2);
76
+ const i2 = document.createElement("span");
77
+ return i2.className = "notectl-font-size-picker__label", i2.textContent = String(t2), n2.appendChild(i2), n2;
78
+ }
79
+ const g = [8, 9, 10, 11, 12, 14, 16, 18, 20, 24, 28, 32, 36, 48, 64, 72, 96];
80
+ class h {
81
+ id = "fontSize";
82
+ name = "Font Size";
83
+ priority = 21;
84
+ config;
85
+ sizes;
86
+ defaultSize;
87
+ context = null;
88
+ comboLabel = null;
89
+ constructor(t2) {
90
+ var e2;
91
+ this.config = { ...t2 }, this.sizes = (function(t3) {
92
+ if (!t3 || 0 === t3.length) return g;
93
+ const e3 = [...new Set(t3)].filter((t4) => Number.isInteger(t4) && t4 > 0);
94
+ return e3.sort((t4, e4) => t4 - e4), e3.length > 0 ? e3 : g;
95
+ })(t2?.sizes), this.defaultSize = (e2 = t2?.defaultSize, void 0 === e2 ? 16 : Number.isInteger(e2) && e2 > 0 ? e2 : 16);
96
+ }
97
+ init(t2) {
98
+ t2.registerStyleSheet("\n/* Font Size Select — Combobox-style toolbar button */\n.notectl-toolbar-btn--fontSize {\n width: auto;\n min-width: 60px;\n max-width: 80px;\n padding: 0 8px;\n gap: 4px;\n border: 1px solid var(--notectl-border);\n border-radius: 4px;\n background: var(--notectl-bg);\n}\n\n.notectl-toolbar-btn--fontSize:hover {\n background: var(--notectl-hover-bg);\n border-color: var(--notectl-fg-muted);\n}\n\n.notectl-toolbar-btn--fontSize.notectl-toolbar-btn--active {\n background: var(--notectl-bg);\n border-color: var(--notectl-primary-muted);\n}\n\n.notectl-toolbar-btn--fontSize .notectl-toolbar-btn__icon {\n display: flex;\n align-items: center;\n gap: 4px;\n width: 100%;\n overflow: hidden;\n}\n\n.notectl-toolbar-btn--fontSize .notectl-toolbar-btn__icon svg {\n display: none;\n}\n\n.notectl-font-size-select__label {\n flex: 1;\n font-size: 13px;\n font-weight: 500;\n color: var(--notectl-fg);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n text-align: left;\n line-height: 30px;\n}\n\n.notectl-font-size-select__arrow {\n flex-shrink: 0;\n font-size: 11px;\n color: var(--notectl-fg-muted);\n line-height: 30px;\n}\n\n/* Font Size Picker Popup */\n.notectl-font-size-picker {\n min-width: 140px;\n display: flex;\n flex-direction: column;\n}\n\n.notectl-font-size-picker__input-wrapper {\n padding: 8px 8px 4px;\n}\n\n.notectl-font-size-picker__input {\n width: 100%;\n padding: 6px 8px;\n border: 1px solid var(--notectl-border);\n border-radius: 4px;\n font-size: 13px;\n font-family: inherit;\n color: var(--notectl-fg);\n background: var(--notectl-bg);\n outline: none;\n box-sizing: border-box;\n -moz-appearance: textfield;\n}\n\n.notectl-font-size-picker__input::-webkit-inner-spin-button,\n.notectl-font-size-picker__input::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\n.notectl-font-size-picker__input:focus {\n border-color: var(--notectl-border-focus);\n box-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.notectl-font-size-picker__list {\n max-height: 280px;\n overflow-y: auto;\n padding: 4px 0;\n}\n\n.notectl-font-size-picker__item {\n display: flex;\n align-items: center;\n gap: 8px;\n width: 100%;\n padding: 7px 12px;\n border: none;\n background: none;\n cursor: pointer;\n font-size: 14px;\n color: var(--notectl-fg);\n line-height: 1.4;\n text-align: left;\n white-space: nowrap;\n font-family: inherit;\n transition: background 0.1s;\n outline: none;\n}\n\n.notectl-font-size-picker__item:hover {\n background: var(--notectl-hover-bg);\n}\n\n.notectl-font-size-picker__item--active {\n background: var(--notectl-active-bg);\n color: var(--notectl-primary-fg);\n}\n\n.notectl-font-size-picker__item--active:hover {\n background: var(--notectl-active-bg);\n}\n\n.notectl-font-size-picker__item--focused {\n outline: 2px solid var(--notectl-primary);\n outline-offset: -2px;\n}\n\n.notectl-font-size-picker__check {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 16px;\n flex-shrink: 0;\n font-size: 13px;\n font-weight: 600;\n color: var(--notectl-primary-fg);\n}\n\n.notectl-font-size-picker__label {\n flex: 1;\n}\n"), this.context = t2, this.registerMarkSpec(t2), this.registerCommands(t2), this.registerKeymaps(t2), this.registerToolbarItem(t2), this.applyDefaultSizeToContainer(t2);
99
+ }
100
+ destroy() {
101
+ this.context = null, this.comboLabel = null;
102
+ }
103
+ onStateChange(t2, e2, n2) {
104
+ this.updateComboLabel(e2);
105
+ }
106
+ registerMarkSpec(t2) {
107
+ t2.registerMarkSpec({ type: "fontSize", rank: 4, attrs: { size: { default: "" } }, toDOM(t3) {
108
+ const e2 = document.createElement("span"), n2 = t3.attrs?.size ?? "";
109
+ return n2 && (e2.style.fontSize = n2), e2;
110
+ }, toHTMLString: (t3, e2) => {
111
+ const n2 = String(t3.attrs?.size ?? "");
112
+ return n2 ? `<span style="font-size: ${n2}">${e2}</span>` : e2;
113
+ }, parseHTML: [{ tag: "span", getAttrs: (t3) => {
114
+ const e2 = t3.style.fontSize;
115
+ return !!e2 && { size: e2 };
116
+ } }], sanitize: { tags: ["span"] } });
117
+ }
118
+ registerCommands(t2) {
119
+ t2.registerCommand("removeFontSize", () => f(t2, t2.getState())), t2.registerCommand("setFontSize", () => false), t2.registerCommand("increaseFontSize", () => d(t2, t2.getState(), "up", this.sizes, this.defaultSize)), t2.registerCommand("decreaseFontSize", () => d(t2, t2.getState(), "down", this.sizes, this.defaultSize));
120
+ }
121
+ registerKeymaps(t2) {
122
+ t2.registerKeymap({ "Mod-Shift-+": () => d(t2, t2.getState(), "up", this.sizes, this.defaultSize), "Mod-Shift-_": () => d(t2, t2.getState(), "down", this.sizes, this.defaultSize) });
123
+ }
124
+ registerToolbarItem(t2) {
125
+ const e2 = `<span class="notectl-font-size-select__label" data-font-size-label>${this.defaultSize}</span><span class="notectl-font-size-select__arrow">▾</span>`;
126
+ t2.registerToolbarItem({ id: "fontSize", group: "format", icon: e2, label: "Font Size", tooltip: "Font Size", command: "removeFontSize", priority: 6, popupType: "custom", separatorAfter: this.config.separatorAfter, renderPopup: (t3, e3) => {
127
+ !(function(t4, e4, n2) {
128
+ t4.classList.add("notectl-font-size-picker");
129
+ const o2 = p(e4.getState(), n2.defaultSize), i2 = (function(t5) {
130
+ const e5 = document.createElement("input");
131
+ return e5.type = "number", e5.className = "notectl-font-size-picker__input", e5.min = String(1), e5.max = String(400), e5.value = String(t5), e5.setAttribute("aria-label", "Custom font size"), e5;
132
+ })(o2);
133
+ !(function(t5, e5) {
134
+ const n3 = document.createElement("div");
135
+ n3.className = "notectl-font-size-picker__input-wrapper", n3.appendChild(e5), t5.appendChild(n3);
136
+ })(t4, i2);
137
+ const { list: r2, items: s2 } = (function(t5, e5, n3, o3) {
138
+ const i3 = document.createElement("div");
139
+ i3.className = "notectl-font-size-picker__list", i3.setAttribute("role", "listbox"), i3.setAttribute("aria-label", "Font sizes");
140
+ const r3 = [];
141
+ for (const s3 of t5) {
142
+ const t6 = z(s3, s3 === e5);
143
+ t6.addEventListener("mousedown", (t7) => {
144
+ t7.preventDefault(), t7.stopPropagation(), m(n3, s3, o3.defaultSize), o3.dismissPopup();
145
+ }), r3.push(t6), i3.appendChild(t6);
146
+ }
147
+ return { list: i3, items: r3 };
148
+ })(n2.sizes, o2, e4, n2);
149
+ t4.appendChild(r2), (function(t5, e5, n3, o3) {
150
+ const i3 = e5.indexOf(n3);
151
+ if (i3 < 0) return;
152
+ const r3 = t5[i3];
153
+ r3 && (requestAnimationFrame(() => {
154
+ r3.scrollIntoView({ block: "nearest" });
155
+ }), o3.setAttribute("aria-activedescendant", r3.id));
156
+ })(s2, n2.sizes, o2, r2), (function(t5, e5, n3, o3, i3) {
157
+ let r3 = -1;
158
+ const s3 = (t6) => {
159
+ r3 >= 0 && r3 < n3.length && n3[r3]?.classList.remove("notectl-font-size-picker__item--focused"), r3 = t6;
160
+ const o4 = n3[r3];
161
+ r3 >= 0 && r3 < n3.length && o4 && (o4.classList.add("notectl-font-size-picker__item--focused"), o4.scrollIntoView({ block: "nearest" }), e5.setAttribute("aria-activedescendant", o4.id));
162
+ };
163
+ t5.addEventListener("keydown", (e6) => {
164
+ if ("Enter" === e6.key) {
165
+ e6.preventDefault();
166
+ const n4 = Number.parseInt(t5.value, 10);
167
+ !Number.isNaN(n4) && n4 >= 1 && n4 <= 400 && (m(o3, n4, i3.defaultSize), i3.dismissPopup());
168
+ } else "ArrowDown" === e6.key ? (e6.preventDefault(), s3(0), n3[0]?.focus()) : "Escape" === e6.key && (e6.preventDefault(), i3.dismissPopup());
169
+ }), e5.addEventListener("keydown", (e6) => {
170
+ if ("ArrowDown" === e6.key) e6.preventDefault(), r3 < n3.length - 1 && (s3(r3 + 1), n3[r3]?.focus());
171
+ else if ("ArrowUp" === e6.key) e6.preventDefault(), r3 > 0 ? (s3(r3 - 1), n3[r3]?.focus()) : (s3(-1), t5.focus());
172
+ else if ("Enter" === e6.key) {
173
+ e6.preventDefault();
174
+ const t6 = i3.sizes[r3];
175
+ r3 >= 0 && r3 < i3.sizes.length && void 0 !== t6 && (m(o3, t6, i3.defaultSize), i3.dismissPopup());
176
+ } else "Escape" === e6.key && (e6.preventDefault(), i3.dismissPopup());
177
+ });
178
+ })(i2, r2, s2, e4, n2);
179
+ })(t3, e3, { sizes: this.sizes, defaultSize: this.defaultSize, dismissPopup: () => this.dismissPopup() });
180
+ }, isActive: (t3) => (function(t4) {
181
+ return null !== l(t4);
182
+ })(t3) });
183
+ }
184
+ applyDefaultSizeToContainer(t2) {
185
+ t2.getContainer().style.fontSize = `${this.defaultSize}px`;
186
+ }
187
+ dismissPopup() {
188
+ const e2 = this.context?.getService(t);
189
+ e2?.closePopup();
190
+ }
191
+ updateComboLabel(t2) {
192
+ if (!this.comboLabel) {
193
+ const t3 = this.context?.getPluginContainer("top");
194
+ if (!t3) return;
195
+ if (this.comboLabel = t3.querySelector("[data-font-size-label]") ?? null, !this.comboLabel) return;
196
+ }
197
+ const e2 = p(t2, this.defaultSize);
198
+ this.comboLabel.textContent = String(e2);
199
+ }
200
+ }
201
+ export {
202
+ h as FontSizePlugin
203
+ };
204
+ //# sourceMappingURL=font-size.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"font-size.mjs","sources":["../../src/plugins/font-size/FontSizeOperations.ts","../../src/plugins/font-size/FontSizePopup.ts","../../src/plugins/font-size/FontSizePlugin.ts","../../src/editor/styles/font-size-select.ts"],"sourcesContent":["/**\n * Pure business logic for font-size state queries and transaction builders.\n * All functions are DOM-free and operate on EditorState / PluginContext.\n */\n\nimport { forEachBlockInRange } from '../../commands/Commands.js';\nimport { isMarkOfType } from '../../model/AttrRegistry.js';\nimport type { Mark } from '../../model/Document.js';\nimport { getBlockMarksAtOffset, hasMark } from '../../model/Document.js';\nimport { isCollapsed, isNodeSelection, selectionRange } from '../../model/Selection.js';\nimport { markType } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { PluginContext } from '../Plugin.js';\n\n// --- State Queries ---\n\n/** Returns the raw fontSize CSS value at the current selection, or null. */\nexport function getActiveSize(state: EditorState): string | null {\n\tconst sel = state.selection;\n\tif (isNodeSelection(sel)) return null;\n\n\tif (isCollapsed(sel) && state.storedMarks) {\n\t\treturn extractFontSize(state.storedMarks);\n\t}\n\n\tconst block = state.getBlock(sel.anchor.blockId);\n\tif (!block) return null;\n\treturn extractFontSize(getBlockMarksAtOffset(block, sel.anchor.offset));\n}\n\n/** Returns the active font size as a number, falling back to defaultSize. */\nexport function getActiveSizeNumeric(state: EditorState, defaultSize: number): number {\n\tconst raw: string | null = getActiveSize(state);\n\tif (!raw) return defaultSize;\n\tconst parsed: number = Number.parseInt(raw, 10);\n\treturn Number.isNaN(parsed) ? defaultSize : parsed;\n}\n\n/** Returns true when the selection carries a fontSize mark. */\nexport function isFontSizeActive(state: EditorState): boolean {\n\treturn getActiveSize(state) !== null;\n}\n\n// --- Commands ---\n\n/** Applies a fontSize mark with the given CSS size string to the selection. */\nexport function applyFontSize(context: PluginContext, state: EditorState, size: string): boolean {\n\tconst sel = state.selection;\n\tif (isNodeSelection(sel)) return false;\n\n\tif (isCollapsed(sel)) {\n\t\tconst anchorBlock = state.getBlock(sel.anchor.blockId);\n\t\tif (!anchorBlock) return false;\n\t\tconst currentMarks = state.storedMarks ?? getBlockMarksAtOffset(anchorBlock, sel.anchor.offset);\n\t\tconst withoutSize = currentMarks.filter((m) => m.type !== 'fontSize');\n\t\tconst newMarks = [...withoutSize, { type: markType('fontSize'), attrs: { size } }];\n\n\t\tconst tr = state\n\t\t\t.transaction('command')\n\t\t\t.setStoredMarks(newMarks, state.storedMarks)\n\t\t\t.setSelection(sel)\n\t\t\t.build();\n\t\tcontext.dispatch(tr);\n\t\treturn true;\n\t}\n\n\tconst range = selectionRange(sel, state.getBlockOrder());\n\tconst builder = state.transaction('command');\n\tconst mark = { type: markType('fontSize'), attrs: { size } };\n\n\tforEachBlockInRange(state, range, (blockId, from, to) => {\n\t\tbuilder.removeMark(blockId, from, to, { type: markType('fontSize') });\n\t\tbuilder.addMark(blockId, from, to, mark);\n\t});\n\n\tbuilder.setSelection(sel);\n\tcontext.dispatch(builder.build());\n\treturn true;\n}\n\n/** Removes the fontSize mark from the current selection. */\nexport function removeFontSize(context: PluginContext, state: EditorState): boolean {\n\tconst sel = state.selection;\n\tif (isNodeSelection(sel)) return false;\n\n\tif (isCollapsed(sel)) {\n\t\tconst anchorBlock = state.getBlock(sel.anchor.blockId);\n\t\tif (!anchorBlock) return false;\n\t\tconst currentMarks = state.storedMarks ?? getBlockMarksAtOffset(anchorBlock, sel.anchor.offset);\n\t\tif (!hasMark(currentMarks, markType('fontSize'))) return false;\n\n\t\tconst newMarks = currentMarks.filter((m) => m.type !== 'fontSize');\n\t\tconst tr = state\n\t\t\t.transaction('command')\n\t\t\t.setStoredMarks(newMarks, state.storedMarks)\n\t\t\t.setSelection(sel)\n\t\t\t.build();\n\t\tcontext.dispatch(tr);\n\t\treturn true;\n\t}\n\n\tconst range = selectionRange(sel, state.getBlockOrder());\n\tconst builder = state.transaction('command');\n\n\tforEachBlockInRange(state, range, (blockId, from, to) => {\n\t\tbuilder.removeMark(blockId, from, to, { type: markType('fontSize') });\n\t});\n\n\tbuilder.setSelection(sel);\n\tcontext.dispatch(builder.build());\n\treturn true;\n}\n\n/** Steps the font size up or down through the preset list. */\nexport function stepFontSize(\n\tcontext: PluginContext,\n\tstate: EditorState,\n\tdirection: 'up' | 'down',\n\tsizes: readonly number[],\n\tdefaultSize: number,\n): boolean {\n\tconst current: number = getActiveSizeNumeric(state, defaultSize);\n\tconst next: number | null = getNextPresetSize(current, direction, sizes);\n\tif (next === null) return false;\n\n\tif (next === defaultSize) {\n\t\treturn removeFontSize(context, state);\n\t}\n\treturn applyFontSize(context, state, `${next}px`);\n}\n\n/**\n * Selects a specific font size: removes the mark when size equals the\n * default, otherwise applies the new size.\n */\nexport function selectSize(context: PluginContext, size: number, defaultSize: number): void {\n\tif (size === defaultSize) {\n\t\tcontext.executeCommand('removeFontSize');\n\t} else {\n\t\tapplyFontSize(context, context.getState(), `${size}px`);\n\t}\n}\n\n// --- Helpers ---\n\n/** Finds the next preset size in the given direction, or null at boundaries. */\nexport function getNextPresetSize(\n\tcurrent: number,\n\tdirection: 'up' | 'down',\n\tsizes: readonly number[],\n): number | null {\n\tif (direction === 'up') {\n\t\tfor (const size of sizes) {\n\t\t\tif (size > current) return size;\n\t\t}\n\t\treturn null;\n\t}\n\tfor (let i: number = sizes.length - 1; i >= 0; i--) {\n\t\tconst size: number | undefined = sizes[i];\n\t\tif (size !== undefined && size < current) return size;\n\t}\n\treturn null;\n}\n\nfunction extractFontSize(marks: readonly Mark[]): string | null {\n\tconst mark = marks.find((m) => m.type === 'fontSize');\n\treturn mark && isMarkOfType(mark, 'fontSize') ? (mark.attrs.size ?? null) : null;\n}\n","/**\n * Renders the font-size picker popup with a custom numeric input\n * and an accessible preset list with keyboard navigation.\n */\n\nimport type { PluginContext } from '../Plugin.js';\nimport { getActiveSizeNumeric, selectSize } from './FontSizeOperations.js';\n\n// --- Constants ---\n\nconst MIN_CUSTOM_SIZE = 1;\nconst MAX_CUSTOM_SIZE = 400;\n\n// --- Config ---\n\nexport interface FontSizePopupConfig {\n\treadonly sizes: readonly number[];\n\treadonly defaultSize: number;\n\treadonly dismissPopup: () => void;\n}\n\n// --- Public Entry Point ---\n\n/** Builds the font-size picker DOM inside the given container. */\nexport function renderFontSizePopup(\n\tcontainer: HTMLElement,\n\tcontext: PluginContext,\n\tconfig: FontSizePopupConfig,\n): void {\n\tcontainer.classList.add('notectl-font-size-picker');\n\n\tconst currentSize: number = getActiveSizeNumeric(context.getState(), config.defaultSize);\n\n\tconst input: HTMLInputElement = buildCustomInput(currentSize);\n\tappendInputWrapper(container, input);\n\n\tconst { list, items } = buildSizeList(config.sizes, currentSize, context, config);\n\tcontainer.appendChild(list);\n\n\tscrollActiveIntoView(items, config.sizes, currentSize, list);\n\tattachKeyboardNavigation(input, list, items, context, config);\n}\n\n// --- Custom Input ---\n\nfunction buildCustomInput(currentSize: number): HTMLInputElement {\n\tconst input: HTMLInputElement = document.createElement('input');\n\tinput.type = 'number';\n\tinput.className = 'notectl-font-size-picker__input';\n\tinput.min = String(MIN_CUSTOM_SIZE);\n\tinput.max = String(MAX_CUSTOM_SIZE);\n\tinput.value = String(currentSize);\n\tinput.setAttribute('aria-label', 'Custom font size');\n\treturn input;\n}\n\nfunction appendInputWrapper(container: HTMLElement, input: HTMLInputElement): void {\n\tconst wrapper: HTMLDivElement = document.createElement('div');\n\twrapper.className = 'notectl-font-size-picker__input-wrapper';\n\twrapper.appendChild(input);\n\tcontainer.appendChild(wrapper);\n}\n\n// --- Size List ---\n\ninterface SizeListResult {\n\treadonly list: HTMLDivElement;\n\treadonly items: HTMLButtonElement[];\n}\n\nfunction buildSizeList(\n\tsizes: readonly number[],\n\tcurrentSize: number,\n\tcontext: PluginContext,\n\tconfig: FontSizePopupConfig,\n): SizeListResult {\n\tconst list: HTMLDivElement = document.createElement('div');\n\tlist.className = 'notectl-font-size-picker__list';\n\tlist.setAttribute('role', 'listbox');\n\tlist.setAttribute('aria-label', 'Font sizes');\n\n\tconst items: HTMLButtonElement[] = [];\n\n\tfor (const size of sizes) {\n\t\tconst isActive: boolean = size === currentSize;\n\t\tconst item: HTMLButtonElement = buildSizeItem(size, isActive);\n\n\t\titem.addEventListener('mousedown', (e: MouseEvent) => {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tselectSize(context, size, config.defaultSize);\n\t\t\tconfig.dismissPopup();\n\t\t});\n\n\t\titems.push(item);\n\t\tlist.appendChild(item);\n\t}\n\n\treturn { list, items };\n}\n\nfunction buildSizeItem(size: number, isActive: boolean): HTMLButtonElement {\n\tconst item: HTMLButtonElement = document.createElement('button');\n\titem.type = 'button';\n\titem.id = `notectl-font-size-option-${size}`;\n\titem.className = 'notectl-font-size-picker__item';\n\titem.setAttribute('role', 'option');\n\titem.setAttribute('aria-selected', String(isActive));\n\n\tif (isActive) {\n\t\titem.classList.add('notectl-font-size-picker__item--active');\n\t}\n\n\tconst check: HTMLSpanElement = document.createElement('span');\n\tcheck.className = 'notectl-font-size-picker__check';\n\tcheck.textContent = isActive ? '\\u2713' : '';\n\titem.appendChild(check);\n\n\tconst label: HTMLSpanElement = document.createElement('span');\n\tlabel.className = 'notectl-font-size-picker__label';\n\tlabel.textContent = String(size);\n\titem.appendChild(label);\n\n\treturn item;\n}\n\n// --- Scroll ---\n\nfunction scrollActiveIntoView(\n\titems: HTMLButtonElement[],\n\tsizes: readonly number[],\n\tcurrentSize: number,\n\tlist: HTMLDivElement,\n): void {\n\tconst activeIdx: number = sizes.indexOf(currentSize);\n\tif (activeIdx < 0) return;\n\n\tconst activeItem: HTMLButtonElement | undefined = items[activeIdx];\n\tif (!activeItem) return;\n\n\trequestAnimationFrame(() => {\n\t\tactiveItem.scrollIntoView({ block: 'nearest' });\n\t});\n\tlist.setAttribute('aria-activedescendant', activeItem.id);\n}\n\n// --- Keyboard Navigation ---\n\nfunction attachKeyboardNavigation(\n\tinput: HTMLInputElement,\n\tlist: HTMLDivElement,\n\titems: HTMLButtonElement[],\n\tcontext: PluginContext,\n\tconfig: FontSizePopupConfig,\n): void {\n\tlet focusedIndex = -1;\n\n\tconst setFocused = (idx: number): void => {\n\t\tif (focusedIndex >= 0 && focusedIndex < items.length) {\n\t\t\titems[focusedIndex]?.classList.remove('notectl-font-size-picker__item--focused');\n\t\t}\n\t\tfocusedIndex = idx;\n\t\tconst el: HTMLButtonElement | undefined = items[focusedIndex];\n\t\tif (focusedIndex >= 0 && focusedIndex < items.length && el) {\n\t\t\tel.classList.add('notectl-font-size-picker__item--focused');\n\t\t\tel.scrollIntoView({ block: 'nearest' });\n\t\t\tlist.setAttribute('aria-activedescendant', el.id);\n\t\t}\n\t};\n\n\tinput.addEventListener('keydown', (e: KeyboardEvent) => {\n\t\tif (e.key === 'Enter') {\n\t\t\te.preventDefault();\n\t\t\tconst val: number = Number.parseInt(input.value, 10);\n\t\t\tif (!Number.isNaN(val) && val >= MIN_CUSTOM_SIZE && val <= MAX_CUSTOM_SIZE) {\n\t\t\t\tselectSize(context, val, config.defaultSize);\n\t\t\t\tconfig.dismissPopup();\n\t\t\t}\n\t\t} else if (e.key === 'ArrowDown') {\n\t\t\te.preventDefault();\n\t\t\tsetFocused(0);\n\t\t\titems[0]?.focus();\n\t\t} else if (e.key === 'Escape') {\n\t\t\te.preventDefault();\n\t\t\tconfig.dismissPopup();\n\t\t}\n\t});\n\n\tlist.addEventListener('keydown', (e: KeyboardEvent) => {\n\t\tif (e.key === 'ArrowDown') {\n\t\t\te.preventDefault();\n\t\t\tif (focusedIndex < items.length - 1) {\n\t\t\t\tsetFocused(focusedIndex + 1);\n\t\t\t\titems[focusedIndex]?.focus();\n\t\t\t}\n\t\t} else if (e.key === 'ArrowUp') {\n\t\t\te.preventDefault();\n\t\t\tif (focusedIndex > 0) {\n\t\t\t\tsetFocused(focusedIndex - 1);\n\t\t\t\titems[focusedIndex]?.focus();\n\t\t\t} else {\n\t\t\t\tsetFocused(-1);\n\t\t\t\tinput.focus();\n\t\t\t}\n\t\t} else if (e.key === 'Enter') {\n\t\t\te.preventDefault();\n\t\t\tconst selectedSize: number | undefined = config.sizes[focusedIndex];\n\t\t\tif (focusedIndex >= 0 && focusedIndex < config.sizes.length && selectedSize !== undefined) {\n\t\t\t\tselectSize(context, selectedSize, config.defaultSize);\n\t\t\t\tconfig.dismissPopup();\n\t\t\t}\n\t\t} else if (e.key === 'Escape') {\n\t\t\te.preventDefault();\n\t\t\tconfig.dismissPopup();\n\t\t}\n\t});\n}\n","/**\n * FontSizePlugin: registers a fontSize mark with attrs, a combobox-style\n * toolbar selector with WCAG-accessible popup, and commands for\n * increasing / decreasing font size.\n */\n\nimport { FONT_SIZE_SELECT_CSS } from '../../editor/styles/font-size-select.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { Transaction } from '../../state/Transaction.js';\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { ToolbarServiceKey } from '../toolbar/ToolbarPlugin.js';\nimport {\n\tgetActiveSizeNumeric,\n\tisFontSizeActive,\n\tremoveFontSize,\n\tstepFontSize,\n} from './FontSizeOperations.js';\nimport { renderFontSizePopup } from './FontSizePopup.js';\n\n// --- Attribute Registry Augmentation ---\n\ndeclare module '../../model/AttrRegistry.js' {\n\tinterface MarkAttrRegistry {\n\t\tfontSize: { size: string };\n\t}\n}\n\n// --- Constants ---\n\n/** Default preset sizes shown in the font size dropdown. */\nexport const DEFAULT_FONT_SIZES: readonly number[] = [\n\t8, 9, 10, 11, 12, 14, 16, 18, 20, 24, 28, 32, 36, 48, 64, 72, 96,\n];\n\nconst DEFAULT_FONT_SIZE = 16;\n\n// --- Configuration ---\n\nexport interface FontSizeConfig {\n\t/**\n\t * Preset sizes shown in the font size dropdown.\n\t * Must contain positive integers. Values are sorted and deduplicated automatically.\n\t * Defaults to {@link DEFAULT_FONT_SIZES} when omitted or empty.\n\t */\n\treadonly sizes?: readonly number[];\n\t/**\n\t * The base font size that text has when no fontSize mark is applied.\n\t * Shown as the initial value in the toolbar combo and used as the\n\t * \"neutral\" size — selecting it removes the mark instead of applying one.\n\t * Defaults to 16.\n\t */\n\treadonly defaultSize?: number;\n\t/** When true, a separator is rendered after the fontSize toolbar item. */\n\treadonly separatorAfter?: boolean;\n}\n\n// --- Plugin ---\n\nexport class FontSizePlugin implements Plugin {\n\treadonly id = 'fontSize';\n\treadonly name = 'Font Size';\n\treadonly priority = 21;\n\n\tprivate readonly config: FontSizeConfig;\n\tprivate readonly sizes: readonly number[];\n\tprivate readonly defaultSize: number;\n\tprivate context: PluginContext | null = null;\n\tprivate comboLabel: HTMLSpanElement | null = null;\n\n\tconstructor(config?: Partial<FontSizeConfig>) {\n\t\tthis.config = { ...config };\n\t\tthis.sizes = resolveSizes(config?.sizes);\n\t\tthis.defaultSize = resolveDefaultSize(config?.defaultSize);\n\t}\n\n\tinit(context: PluginContext): void {\n\t\tcontext.registerStyleSheet(FONT_SIZE_SELECT_CSS);\n\t\tthis.context = context;\n\t\tthis.registerMarkSpec(context);\n\t\tthis.registerCommands(context);\n\t\tthis.registerKeymaps(context);\n\t\tthis.registerToolbarItem(context);\n\t\tthis.applyDefaultSizeToContainer(context);\n\t}\n\n\tdestroy(): void {\n\t\tthis.context = null;\n\t\tthis.comboLabel = null;\n\t}\n\n\tonStateChange(_oldState: EditorState, newState: EditorState, _tr: Transaction): void {\n\t\tthis.updateComboLabel(newState);\n\t}\n\n\t// --- Schema ---\n\n\tprivate registerMarkSpec(context: PluginContext): void {\n\t\tcontext.registerMarkSpec({\n\t\t\ttype: 'fontSize',\n\t\t\trank: 4,\n\t\t\tattrs: {\n\t\t\t\tsize: { default: '' },\n\t\t\t},\n\t\t\ttoDOM(mark) {\n\t\t\t\tconst span: HTMLElement = document.createElement('span');\n\t\t\t\tconst size: string = mark.attrs?.size ?? '';\n\t\t\t\tif (size) {\n\t\t\t\t\tspan.style.fontSize = size;\n\t\t\t\t}\n\t\t\t\treturn span;\n\t\t\t},\n\t\t\ttoHTMLString: (mark, content) => {\n\t\t\t\tconst size: string = String(mark.attrs?.size ?? '');\n\t\t\t\tif (!size) return content;\n\t\t\t\treturn `<span style=\"font-size: ${size}\">${content}</span>`;\n\t\t\t},\n\t\t\tparseHTML: [\n\t\t\t\t{\n\t\t\t\t\ttag: 'span',\n\t\t\t\t\tgetAttrs: (el) => {\n\t\t\t\t\t\tconst size: string = el.style.fontSize;\n\t\t\t\t\t\tif (!size) return false;\n\t\t\t\t\t\treturn { size };\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t],\n\t\t\tsanitize: { tags: ['span'] },\n\t\t});\n\t}\n\n\t// --- Commands ---\n\n\tprivate registerCommands(context: PluginContext): void {\n\t\tcontext.registerCommand('removeFontSize', () => {\n\t\t\treturn removeFontSize(context, context.getState());\n\t\t});\n\n\t\tcontext.registerCommand('setFontSize', () => {\n\t\t\treturn false;\n\t\t});\n\n\t\tcontext.registerCommand('increaseFontSize', () => {\n\t\t\treturn stepFontSize(context, context.getState(), 'up', this.sizes, this.defaultSize);\n\t\t});\n\n\t\tcontext.registerCommand('decreaseFontSize', () => {\n\t\t\treturn stepFontSize(context, context.getState(), 'down', this.sizes, this.defaultSize);\n\t\t});\n\t}\n\n\t// --- Keymaps ---\n\n\tprivate registerKeymaps(context: PluginContext): void {\n\t\tcontext.registerKeymap({\n\t\t\t'Mod-Shift-+': () => {\n\t\t\t\treturn stepFontSize(context, context.getState(), 'up', this.sizes, this.defaultSize);\n\t\t\t},\n\t\t\t'Mod-Shift-_': () => {\n\t\t\t\treturn stepFontSize(context, context.getState(), 'down', this.sizes, this.defaultSize);\n\t\t\t},\n\t\t});\n\t}\n\n\t// --- Toolbar ---\n\n\tprivate registerToolbarItem(context: PluginContext): void {\n\t\tconst icon: string = `<span class=\"notectl-font-size-select__label\" data-font-size-label>${this.defaultSize}</span><span class=\"notectl-font-size-select__arrow\">\\u25BE</span>`;\n\n\t\tcontext.registerToolbarItem({\n\t\t\tid: 'fontSize',\n\t\t\tgroup: 'format',\n\t\t\ticon,\n\t\t\tlabel: 'Font Size',\n\t\t\ttooltip: 'Font Size',\n\t\t\tcommand: 'removeFontSize',\n\t\t\tpriority: 6,\n\t\t\tpopupType: 'custom',\n\t\t\tseparatorAfter: this.config.separatorAfter,\n\t\t\trenderPopup: (container, ctx) => {\n\t\t\t\trenderFontSizePopup(container, ctx, {\n\t\t\t\t\tsizes: this.sizes,\n\t\t\t\t\tdefaultSize: this.defaultSize,\n\t\t\t\t\tdismissPopup: () => this.dismissPopup(),\n\t\t\t\t});\n\t\t\t},\n\t\t\tisActive: (state) => isFontSizeActive(state),\n\t\t});\n\t}\n\n\t/**\n\t * Sets the configured default font size on the editor content container\n\t * so that unformatted text renders at the correct size instead of the\n\t * browser default (16px).\n\t */\n\tprivate applyDefaultSizeToContainer(context: PluginContext): void {\n\t\tconst container: HTMLElement = context.getContainer();\n\t\tcontainer.style.fontSize = `${this.defaultSize}px`;\n\t}\n\n\tprivate dismissPopup(): void {\n\t\tconst toolbar = this.context?.getService(ToolbarServiceKey);\n\t\ttoolbar?.closePopup();\n\t}\n\n\tprivate updateComboLabel(state: EditorState): void {\n\t\tif (!this.comboLabel) {\n\t\t\tconst container: HTMLElement | undefined = this.context?.getPluginContainer('top');\n\t\t\tif (!container) return;\n\t\t\tthis.comboLabel = container.querySelector<HTMLSpanElement>('[data-font-size-label]') ?? null;\n\t\t\tif (!this.comboLabel) return;\n\t\t}\n\n\t\tconst activeSize: number = getActiveSizeNumeric(state, this.defaultSize);\n\t\tthis.comboLabel.textContent = String(activeSize);\n\t}\n}\n\n// --- Helpers ---\n\nfunction resolveSizes(sizes: readonly number[] | undefined): readonly number[] {\n\tif (!sizes || sizes.length === 0) return DEFAULT_FONT_SIZES;\n\tconst unique: number[] = [...new Set(sizes)].filter((n) => Number.isInteger(n) && n > 0);\n\tunique.sort((a, b) => a - b);\n\treturn unique.length > 0 ? unique : DEFAULT_FONT_SIZES;\n}\n\nfunction resolveDefaultSize(size: number | undefined): number {\n\tif (size === undefined) return DEFAULT_FONT_SIZE;\n\treturn Number.isInteger(size) && size > 0 ? size : DEFAULT_FONT_SIZE;\n}\n","/** Font size picker toolbar combobox + popup styles. */\nexport const FONT_SIZE_SELECT_CSS = `\n/* Font Size Select — Combobox-style toolbar button */\n.notectl-toolbar-btn--fontSize {\n\twidth: auto;\n\tmin-width: 60px;\n\tmax-width: 80px;\n\tpadding: 0 8px;\n\tgap: 4px;\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 4px;\n\tbackground: var(--notectl-bg);\n}\n\n.notectl-toolbar-btn--fontSize:hover {\n\tbackground: var(--notectl-hover-bg);\n\tborder-color: var(--notectl-fg-muted);\n}\n\n.notectl-toolbar-btn--fontSize.notectl-toolbar-btn--active {\n\tbackground: var(--notectl-bg);\n\tborder-color: var(--notectl-primary-muted);\n}\n\n.notectl-toolbar-btn--fontSize .notectl-toolbar-btn__icon {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 4px;\n\twidth: 100%;\n\toverflow: hidden;\n}\n\n.notectl-toolbar-btn--fontSize .notectl-toolbar-btn__icon svg {\n\tdisplay: none;\n}\n\n.notectl-font-size-select__label {\n\tflex: 1;\n\tfont-size: 13px;\n\tfont-weight: 500;\n\tcolor: var(--notectl-fg);\n\twhite-space: nowrap;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\ttext-align: left;\n\tline-height: 30px;\n}\n\n.notectl-font-size-select__arrow {\n\tflex-shrink: 0;\n\tfont-size: 11px;\n\tcolor: var(--notectl-fg-muted);\n\tline-height: 30px;\n}\n\n/* Font Size Picker Popup */\n.notectl-font-size-picker {\n\tmin-width: 140px;\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.notectl-font-size-picker__input-wrapper {\n\tpadding: 8px 8px 4px;\n}\n\n.notectl-font-size-picker__input {\n\twidth: 100%;\n\tpadding: 6px 8px;\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 4px;\n\tfont-size: 13px;\n\tfont-family: inherit;\n\tcolor: var(--notectl-fg);\n\tbackground: var(--notectl-bg);\n\toutline: none;\n\tbox-sizing: border-box;\n\t-moz-appearance: textfield;\n}\n\n.notectl-font-size-picker__input::-webkit-inner-spin-button,\n.notectl-font-size-picker__input::-webkit-outer-spin-button {\n\t-webkit-appearance: none;\n\tmargin: 0;\n}\n\n.notectl-font-size-picker__input:focus {\n\tborder-color: var(--notectl-border-focus);\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.notectl-font-size-picker__list {\n\tmax-height: 280px;\n\toverflow-y: auto;\n\tpadding: 4px 0;\n}\n\n.notectl-font-size-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: left;\n\twhite-space: nowrap;\n\tfont-family: inherit;\n\ttransition: background 0.1s;\n\toutline: none;\n}\n\n.notectl-font-size-picker__item:hover {\n\tbackground: var(--notectl-hover-bg);\n}\n\n.notectl-font-size-picker__item--active {\n\tbackground: var(--notectl-active-bg);\n\tcolor: var(--notectl-primary-fg);\n}\n\n.notectl-font-size-picker__item--active:hover {\n\tbackground: var(--notectl-active-bg);\n}\n\n.notectl-font-size-picker__item--focused {\n\toutline: 2px solid var(--notectl-primary);\n\toutline-offset: -2px;\n}\n\n.notectl-font-size-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-size-picker__label {\n\tflex: 1;\n}\n`;\n"],"names":["getActiveSize","state","sel","selection","isNodeSelection","isCollapsed","storedMarks","extractFontSize","block","getBlock","anchor","blockId","getBlockMarksAtOffset","offset","getActiveSizeNumeric","defaultSize","raw","parsed","Number","parseInt","isNaN","applyFontSize","context","size","anchorBlock","newMarks","filter","m","type","markType","attrs","tr","transaction","setStoredMarks","setSelection","build","dispatch","range","selectionRange","getBlockOrder","builder","mark","forEachBlockInRange","from","to","removeMark","addMark","removeFontSize","currentMarks","hasMark","stepFontSize","direction","sizes","next","current","i","length","selectSize","executeCommand","getState","marks","find","isMarkOfType","buildSizeItem","isActive","item","document","createElement","id","className","setAttribute","String","classList","add","check","textContent","appendChild","label","DEFAULT_FONT_SIZES","FontSizePlugin","name","priority","config","comboLabel","this","unique","Set","n","isInteger","sort","a","b","registerStyleSheet","registerMarkSpec","registerCommands","registerKeymaps","registerToolbarItem","applyDefaultSizeToContainer","destroy","_oldState","newState","_tr","updateComboLabel","rank","default","span","style","fontSize","toHTMLString","content","parseHTML","tag","getAttrs","el","sanitize","tags","registerCommand","registerKeymap","icon","group","tooltip","command","popupType","separatorAfter","renderPopup","container","ctx","currentSize","input","min","max","value","wrapper","list","items","addEventListener","e","preventDefault","stopPropagation","dismissPopup","push","activeIdx","indexOf","activeItem","requestAnimationFrame","scrollIntoView","focusedIndex","setFocused","idx","remove","key","val","focus","selectedSize","getContainer","toolbar","getService","ToolbarServiceKey","closePopup","getPluginContainer","querySelector","activeSize"],"mappings":";;;;;;AAiBO,SAASA,EAAcC,IAAAA;AAC7B,QAAMC,KAAMD,GAAME;AAClB,MAAIC,EAAgBF,EAAAA,EAAM,QAAO;AAEjC,MAAIG,EAAYH,EAAAA,KAAQD,GAAMK,YAC7B,QAAOC,EAAgBN,GAAMK;AAG9B,QAAME,KAAQP,GAAMQ,SAASP,GAAIQ,OAAOC,OAAAA;AACxC,SAAKH,KACED,EAAgBK,EAAsBJ,IAAON,GAAIQ,OAAOG,MAAAA,CAAAA,IAD5C;AAEpB;AAGO,SAASC,EAAqBb,IAAoBc,IAAAA;AACxD,QAAMC,KAAqBhB,EAAcC,EAAAA;AACzC,MAAA,CAAKe,GAAK,QAAOD;AACjB,QAAME,KAAiBC,OAAOC,SAASH,IAAK,EAAA;AAC5C,SAAOE,OAAOE,MAAMH,MAAUF,KAAcE;AAC7C;AAUO,SAASI,EAAcC,IAAwBrB,IAAoBsB,IAAAA;AACzE,QAAMrB,KAAMD,GAAME;AAClB,MAAIC,EAAgBF,EAAAA,EAAM,QAAA;AAE1B,MAAIG,EAAYH,EAAAA,GAAM;AACrB,UAAMsB,KAAcvB,GAAMQ,SAASP,GAAIQ,OAAOC,OAAAA;AAC9C,SAAKa,GAAa,QAAA;AAClB,UAEMC,KAAW,CAAA,IAFIxB,GAAMK,eAAeM,EAAsBY,IAA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