@notectl/core 2.2.6 → 2.3.3

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 (544) hide show
  1. package/README.md +1 -1
  2. package/THIRD-PARTY-NOTICES.md +129 -0
  3. package/dist/chunks/{AlignmentPlugin-DeD4C4EP.mjs → AlignmentPlugin-C9Rr_R-g.mjs} +2 -2
  4. package/dist/chunks/{AlignmentPlugin-DeD4C4EP.mjs.map → AlignmentPlugin-C9Rr_R-g.mjs.map} +1 -1
  5. package/dist/chunks/{AttrRegistry-DcDVyzLm.mjs → AttrRegistry-B3zB02z9.mjs} +2 -2
  6. package/dist/chunks/AttrRegistry-B3zB02z9.mjs.map +1 -0
  7. package/dist/chunks/AttributedMarkCommands-BCvmqeFZ.mjs +2 -0
  8. package/dist/chunks/{AttributedMarkCommands-D4W2Jgpj.mjs.map → AttributedMarkCommands-BCvmqeFZ.mjs.map} +1 -1
  9. package/dist/chunks/{BidiIsolationPlugin-BddRbDCN.mjs → BidiIsolationPlugin-Cw2KMk-H.mjs} +2 -2
  10. package/dist/chunks/{BidiIsolationPlugin-BddRbDCN.mjs.map → BidiIsolationPlugin-Cw2KMk-H.mjs.map} +1 -1
  11. package/dist/chunks/BlockInsertion-CYH2gRkY.mjs +2 -0
  12. package/dist/chunks/BlockInsertion-CYH2gRkY.mjs.map +1 -0
  13. package/dist/chunks/BlockquotePlugin-0bZSbkyo.mjs +2 -0
  14. package/dist/chunks/{BlockquotePlugin-4V7KV_Sb.mjs.map → BlockquotePlugin-0bZSbkyo.mjs.map} +1 -1
  15. package/dist/chunks/CaretNavigationPlugin-BPZ9b6XR.mjs +2 -0
  16. package/dist/chunks/CaretNavigationPlugin-BPZ9b6XR.mjs.map +1 -0
  17. package/dist/chunks/CodeBlockPlugin-BCJ3faXx.mjs +2 -0
  18. package/dist/chunks/CodeBlockPlugin-BCJ3faXx.mjs.map +1 -0
  19. package/dist/chunks/{ColorGrid-DPNiXxpD.mjs → ColorGrid-DQEkJ-0y.mjs} +2 -2
  20. package/dist/chunks/{ColorGrid-DPNiXxpD.mjs.map → ColorGrid-DQEkJ-0y.mjs.map} +1 -1
  21. package/dist/chunks/{ColorPickerPopup-lcf3jS6G.mjs → ColorPickerPopup-CyF26zIU.mjs} +2 -2
  22. package/dist/chunks/{ColorPickerPopup-lcf3jS6G.mjs.map → ColorPickerPopup-CyF26zIU.mjs.map} +1 -1
  23. package/dist/chunks/Commands-D5ND50PQ.mjs +2 -0
  24. package/dist/chunks/Commands-D5ND50PQ.mjs.map +1 -0
  25. package/dist/chunks/ContentModel-NpAj7vGW.mjs +2 -0
  26. package/dist/chunks/ContentModel-NpAj7vGW.mjs.map +1 -0
  27. package/dist/chunks/Decoration-BOP1TAUd.mjs +2 -0
  28. package/dist/chunks/Decoration-BOP1TAUd.mjs.map +1 -0
  29. package/dist/chunks/{DirectionDetection-C7XE0nxW.mjs → DirectionDetection-CDVSEWQ6.mjs} +2 -2
  30. package/dist/chunks/{DirectionDetection-C7XE0nxW.mjs.map → DirectionDetection-CDVSEWQ6.mjs.map} +1 -1
  31. package/dist/chunks/Document-827l3P80.mjs +2 -0
  32. package/dist/chunks/Document-827l3P80.mjs.map +1 -0
  33. package/dist/chunks/DocumentParser-D2tr3ZKn.mjs +2 -0
  34. package/dist/chunks/DocumentParser-D2tr3ZKn.mjs.map +1 -0
  35. package/dist/chunks/EditorEventBoundary-zpYRxryo.mjs +2 -0
  36. package/dist/chunks/EditorEventBoundary-zpYRxryo.mjs.map +1 -0
  37. package/dist/chunks/{FontPlugin-DQMj65Bc.mjs → FontPlugin-D041tiLe.mjs} +2 -2
  38. package/dist/chunks/{FontPlugin-DQMj65Bc.mjs.map → FontPlugin-D041tiLe.mjs.map} +1 -1
  39. package/dist/chunks/{FontSizePlugin-9StCjEfN.mjs → FontSizePlugin-8CAvj1RD.mjs} +2 -2
  40. package/dist/chunks/FontSizePlugin-8CAvj1RD.mjs.map +1 -0
  41. package/dist/chunks/FormulaPlugin-DJ39BtqV.mjs +2 -0
  42. package/dist/chunks/FormulaPlugin-DJ39BtqV.mjs.map +1 -0
  43. package/dist/chunks/GapCursorNavigation-DCWOmopl.mjs +2 -0
  44. package/dist/chunks/{GapCursorNavigation-ycNzuQVH.mjs.map → GapCursorNavigation-DCWOmopl.mjs.map} +1 -1
  45. package/dist/chunks/GapCursorPlugin-2iR6506y.mjs +2 -0
  46. package/dist/chunks/{GapCursorPlugin-Zvxjnr82.mjs.map → GapCursorPlugin-2iR6506y.mjs.map} +1 -1
  47. package/dist/chunks/HTMLUtils-Bhg3_P8B.mjs +2 -0
  48. package/dist/chunks/HTMLUtils-Bhg3_P8B.mjs.map +1 -0
  49. package/dist/chunks/{HardBreakPlugin-9DOyCyyM.mjs → HardBreakPlugin-vniSvTgq.mjs} +2 -2
  50. package/dist/chunks/{HardBreakPlugin-9DOyCyyM.mjs.map → HardBreakPlugin-vniSvTgq.mjs.map} +1 -1
  51. package/dist/chunks/HeadingPlugin-DUKsLuMd.mjs +2 -0
  52. package/dist/chunks/{HeadingPlugin-BuGoM9Rz.mjs.map → HeadingPlugin-DUKsLuMd.mjs.map} +1 -1
  53. package/dist/chunks/{HighlightPlugin-C6pHifVz.mjs → HighlightPlugin-DRTAE1N5.mjs} +2 -2
  54. package/dist/chunks/{HighlightPlugin-C6pHifVz.mjs.map → HighlightPlugin-DRTAE1N5.mjs.map} +1 -1
  55. package/dist/chunks/HorizontalRulePlugin-B9OvwrKB.mjs +2 -0
  56. package/dist/chunks/HorizontalRulePlugin-B9OvwrKB.mjs.map +1 -0
  57. package/dist/chunks/ImagePlugin-CwxTRr6d.mjs +2 -0
  58. package/dist/chunks/{ImagePlugin-KpkuE2LH.mjs.map → ImagePlugin-CwxTRr6d.mjs.map} +1 -1
  59. package/dist/chunks/{InlineCodePlugin-DMr4O7c7.mjs → InlineCodePlugin-uxgMUX_E.mjs} +2 -2
  60. package/dist/chunks/InlineCodePlugin-uxgMUX_E.mjs.map +1 -0
  61. package/dist/chunks/InlineStyleMarkSpec-CjSRj4f_.mjs +2 -0
  62. package/dist/chunks/{InlineStyleMarkSpec-C6LJT7kp.mjs.map → InlineStyleMarkSpec-CjSRj4f_.mjs.map} +1 -1
  63. package/dist/chunks/LinkPlugin-CvWHbSkb.mjs +2 -0
  64. package/dist/chunks/LinkPlugin-CvWHbSkb.mjs.map +1 -0
  65. package/dist/chunks/ListPlugin-BchSFWVn.mjs +2 -0
  66. package/dist/chunks/ListPlugin-BchSFWVn.mjs.map +1 -0
  67. package/dist/chunks/MarkInputRule-Bdi8KPus.mjs +2 -0
  68. package/dist/chunks/MarkInputRule-Bdi8KPus.mjs.map +1 -0
  69. package/dist/chunks/MarkdownHTMLRegistry-Q7l0d6Ma.mjs +2 -0
  70. package/dist/chunks/MarkdownHTMLRegistry-Q7l0d6Ma.mjs.map +1 -0
  71. package/dist/chunks/MarkdownParser-Dp62mfUq.mjs +2 -0
  72. package/dist/chunks/MarkdownParser-Dp62mfUq.mjs.map +1 -0
  73. package/dist/chunks/MarkdownSerializer-DBELFAeo.mjs +2 -0
  74. package/dist/chunks/MarkdownSerializer-DBELFAeo.mjs.map +1 -0
  75. package/dist/chunks/MathFont-BS8IwYh2.mjs +2 -0
  76. package/dist/chunks/MathFont-BS8IwYh2.mjs.map +1 -0
  77. package/dist/chunks/{NodeResolver-ChgLF_IP.mjs → NodeResolver-Dleih-8R.mjs} +2 -2
  78. package/dist/chunks/{NodeResolver-ChgLF_IP.mjs.map → NodeResolver-Dleih-8R.mjs.map} +1 -1
  79. package/dist/chunks/NodeSelectionCommands-WH5snxr_.mjs +2 -0
  80. package/dist/chunks/{NodeSelectionCommands-Dj4VxLdD.mjs.map → NodeSelectionCommands-WH5snxr_.mjs.map} +1 -1
  81. package/dist/chunks/{PopupManager-DUtaK3WX.mjs → PopupManager-Cj86uDEB.mjs} +2 -2
  82. package/dist/chunks/{PopupManager-DUtaK3WX.mjs.map → PopupManager-Cj86uDEB.mjs.map} +1 -1
  83. package/dist/chunks/PopupPositioning-BFh6Ed1D.mjs +2 -0
  84. package/dist/chunks/{PopupPositioning-BB97-__N.mjs.map → PopupPositioning-BFh6Ed1D.mjs.map} +1 -1
  85. package/dist/chunks/PrintPlugin-D2javl_d.mjs +2 -0
  86. package/dist/chunks/PrintPlugin-D2javl_d.mjs.map +1 -0
  87. package/dist/chunks/{RangeIterator-o8v3msQe.mjs → RangeIterator-DP7Ud3Gp.mjs} +2 -2
  88. package/dist/chunks/{RangeIterator-o8v3msQe.mjs.map → RangeIterator-DP7Ud3Gp.mjs.map} +1 -1
  89. package/dist/chunks/SchemaRegistry-CkBN-1yW.mjs +2 -0
  90. package/dist/chunks/SchemaRegistry-CkBN-1yW.mjs.map +1 -0
  91. package/dist/chunks/SimpleMark-gTQaSJcO.mjs +2 -0
  92. package/dist/chunks/{SimpleMark-CaQtFAau.mjs.map → SimpleMark-gTQaSJcO.mjs.map} +1 -1
  93. package/dist/chunks/SmartPastePlugin-BvJQ-fOz.mjs +2 -0
  94. package/dist/chunks/SmartPastePlugin-BvJQ-fOz.mjs.map +1 -0
  95. package/dist/chunks/StarterFonts-BDQPg-cu.mjs +2 -0
  96. package/dist/chunks/StarterFonts-BDQPg-cu.mjs.map +1 -0
  97. package/dist/chunks/StrikethroughPlugin-BdrG1TTY.mjs +2 -0
  98. package/dist/chunks/StrikethroughPlugin-BdrG1TTY.mjs.map +1 -0
  99. package/dist/chunks/StyleRuntime-DW6omotc.mjs +2 -0
  100. package/dist/chunks/StyleRuntime-DW6omotc.mjs.map +1 -0
  101. package/dist/chunks/{SuperSubPlugin-DVP7VnIz.mjs → SuperSubPlugin-DTZB0Y3D.mjs} +2 -2
  102. package/dist/chunks/{SuperSubPlugin-DVP7VnIz.mjs.map → SuperSubPlugin-DTZB0Y3D.mjs.map} +1 -1
  103. package/dist/chunks/TableDimensions-BBhjHNjQ.mjs +2 -0
  104. package/dist/chunks/TableDimensions-BBhjHNjQ.mjs.map +1 -0
  105. package/dist/chunks/TablePlugin-CPvg9YZS.mjs +2 -0
  106. package/dist/chunks/TablePlugin-CPvg9YZS.mjs.map +1 -0
  107. package/dist/chunks/TextColorPlugin-Ckg3KWvb.mjs +2 -0
  108. package/dist/chunks/{TextColorPlugin-CEfZQ6Md.mjs.map → TextColorPlugin-Ckg3KWvb.mjs.map} +1 -1
  109. package/dist/chunks/TextDirectionAutoPlugin-DRGbgTlx.mjs +2 -0
  110. package/dist/chunks/{TextDirectionAutoPlugin-CzWJjrvG.mjs.map → TextDirectionAutoPlugin-DRGbgTlx.mjs.map} +1 -1
  111. package/dist/chunks/TextDirectionPlugin-BCeYyJHo.mjs +2 -0
  112. package/dist/chunks/{TextDirectionPlugin-DHB88HKf.mjs.map → TextDirectionPlugin-BCeYyJHo.mjs.map} +1 -1
  113. package/dist/chunks/TextFormattingPlugin-BhRxSC8q.mjs +2 -0
  114. package/dist/chunks/TextFormattingPlugin-BhRxSC8q.mjs.map +1 -0
  115. package/dist/chunks/ThemeEngine-BUVo_zaT.mjs +3 -0
  116. package/dist/chunks/ThemeEngine-BUVo_zaT.mjs.map +1 -0
  117. package/dist/chunks/ToolbarPlugin-dmTj1jIz.mjs +2 -0
  118. package/dist/chunks/{ToolbarPlugin-DVGrFf8v.mjs.map → ToolbarPlugin-dmTj1jIz.mjs.map} +1 -1
  119. package/dist/chunks/VideoPlugin-BugkI7-m.mjs +2 -0
  120. package/dist/chunks/VideoPlugin-BugkI7-m.mjs.map +1 -0
  121. package/dist/chunks/WordBoundary-CFpIJDNP.mjs +2 -0
  122. package/dist/chunks/{WordBoundary-DxeMBRyP.mjs.map → WordBoundary-CFpIJDNP.mjs.map} +1 -1
  123. package/dist/chunks/XmlSupport-DIXH5on9.mjs +2 -0
  124. package/dist/chunks/XmlSupport-DIXH5on9.mjs.map +1 -0
  125. package/dist/chunks/ar-Dg9PdDet.mjs +2 -0
  126. package/dist/chunks/ar-Dg9PdDet.mjs.map +1 -0
  127. package/dist/chunks/ar-eOA3UmiE.mjs +2 -0
  128. package/dist/chunks/{ar-BTShmP2E.mjs.map → ar-eOA3UmiE.mjs.map} +1 -1
  129. package/dist/chunks/de-DJ5EkXQo.mjs +2 -0
  130. package/dist/chunks/de-DJ5EkXQo.mjs.map +1 -0
  131. package/dist/chunks/{de-C--bRmjW.mjs → de-DRbhnS4T.mjs} +2 -2
  132. package/dist/chunks/{de-C--bRmjW.mjs.map → de-DRbhnS4T.mjs.map} +1 -1
  133. package/dist/chunks/{es-DFUVd7eO.mjs → es-BQ9dox_E.mjs} +2 -2
  134. package/dist/chunks/{es-DFUVd7eO.mjs.map → es-BQ9dox_E.mjs.map} +1 -1
  135. package/dist/chunks/es-CEAJj7aB.mjs +2 -0
  136. package/dist/chunks/es-CEAJj7aB.mjs.map +1 -0
  137. package/dist/chunks/fr-DhWQzZy3.mjs +2 -0
  138. package/dist/chunks/fr-DhWQzZy3.mjs.map +1 -0
  139. package/dist/chunks/{fr-BaXKyPmX.mjs → fr-NVOinLyF.mjs} +2 -2
  140. package/dist/chunks/{fr-BaXKyPmX.mjs.map → fr-NVOinLyF.mjs.map} +1 -1
  141. package/dist/chunks/full-JM0-SwWy.mjs +2 -0
  142. package/dist/chunks/{full-BBl7mvwH.mjs.map → full-JM0-SwWy.mjs.map} +1 -1
  143. package/dist/chunks/hi-BsZzSMfL.mjs +2 -0
  144. package/dist/chunks/hi-BsZzSMfL.mjs.map +1 -0
  145. package/dist/chunks/{hi-aH9HZG23.mjs → hi-DrC2H81d.mjs} +2 -2
  146. package/dist/chunks/{hi-aH9HZG23.mjs.map → hi-DrC2H81d.mjs.map} +1 -1
  147. package/dist/chunks/minimal-DSlR2A27.mjs +2 -0
  148. package/dist/chunks/{minimal-CtnR4dqp.mjs.map → minimal-DSlR2A27.mjs.map} +1 -1
  149. package/dist/chunks/pt-BuZ7acHF.mjs +2 -0
  150. package/dist/chunks/pt-BuZ7acHF.mjs.map +1 -0
  151. package/dist/chunks/{pt-Hy-0Xnnc.mjs → pt-CFrcl1v_.mjs} +2 -2
  152. package/dist/chunks/{pt-Hy-0Xnnc.mjs.map → pt-CFrcl1v_.mjs.map} +1 -1
  153. package/dist/chunks/register-BjsdJ3Aq.mjs +2 -0
  154. package/dist/chunks/register-BjsdJ3Aq.mjs.map +1 -0
  155. package/dist/chunks/rolldown-runtime-H_PjY6_i.mjs +1 -0
  156. package/dist/chunks/ru-CsP6mLxp.mjs +2 -0
  157. package/dist/chunks/ru-CsP6mLxp.mjs.map +1 -0
  158. package/dist/chunks/{ru-BFpEOrVp.mjs → ru-gxbzqLL8.mjs} +2 -2
  159. package/dist/chunks/{ru-BFpEOrVp.mjs.map → ru-gxbzqLL8.mjs.map} +1 -1
  160. package/dist/chunks/src-5GKFQ2mQ.mjs +2 -0
  161. package/dist/chunks/src-5GKFQ2mQ.mjs.map +1 -0
  162. package/dist/chunks/xml-BsV44TrJ.mjs +2 -0
  163. package/dist/chunks/xml-BsV44TrJ.mjs.map +1 -0
  164. package/dist/chunks/zh-BFZOM3lF.mjs +2 -0
  165. package/dist/chunks/{zh-BjoyjClN.mjs.map → zh-BFZOM3lF.mjs.map} +1 -1
  166. package/dist/chunks/zh-CiIyOm6U.mjs +2 -0
  167. package/dist/chunks/zh-CiIyOm6U.mjs.map +1 -0
  168. package/dist/commands/BlockInsertion.d.ts +5 -3
  169. package/dist/commands/BlockInsertion.d.ts.map +1 -1
  170. package/dist/commands/SelectionDeletion.d.ts +13 -2
  171. package/dist/commands/SelectionDeletion.d.ts.map +1 -1
  172. package/dist/editor/ContentSerializer.d.ts +21 -0
  173. package/dist/editor/ContentSerializer.d.ts.map +1 -1
  174. package/dist/editor/EditorConfig.d.ts +17 -0
  175. package/dist/editor/EditorConfig.d.ts.map +1 -1
  176. package/dist/editor/EditorConfigController.d.ts +10 -0
  177. package/dist/editor/EditorConfigController.d.ts.map +1 -1
  178. package/dist/editor/EditorInitializer.d.ts +4 -0
  179. package/dist/editor/EditorInitializer.d.ts.map +1 -1
  180. package/dist/editor/EditorLocale.d.ts +2 -0
  181. package/dist/editor/EditorLocale.d.ts.map +1 -1
  182. package/dist/editor/MarkdownMode.d.ts +46 -0
  183. package/dist/editor/MarkdownMode.d.ts.map +1 -0
  184. package/dist/editor/NotectlEditor.d.ts +24 -0
  185. package/dist/editor/NotectlEditor.d.ts.map +1 -1
  186. package/dist/editor/locales/ar.d.ts.map +1 -1
  187. package/dist/editor/locales/de.d.ts.map +1 -1
  188. package/dist/editor/locales/es.d.ts.map +1 -1
  189. package/dist/editor/locales/fr.d.ts.map +1 -1
  190. package/dist/editor/locales/hi.d.ts.map +1 -1
  191. package/dist/editor/locales/pt.d.ts.map +1 -1
  192. package/dist/editor/locales/ru.d.ts.map +1 -1
  193. package/dist/editor/locales/zh.d.ts.map +1 -1
  194. package/dist/editor/styles/list.d.ts +1 -1
  195. package/dist/editor/styles/list.d.ts.map +1 -1
  196. package/dist/editor/styles/table.d.ts +1 -1
  197. package/dist/editor/styles/table.d.ts.map +1 -1
  198. package/dist/fonts/math.d.ts +3 -0
  199. package/dist/fonts/math.d.ts.map +1 -0
  200. package/dist/fonts/math.mjs +1 -0
  201. package/dist/fonts/starter.d.ts +3 -0
  202. package/dist/fonts/starter.d.ts.map +1 -0
  203. package/dist/fonts/starter.mjs +1 -0
  204. package/dist/fonts.d.ts +4 -4
  205. package/dist/fonts.mjs +1 -1
  206. package/dist/full.d.ts +1 -1
  207. package/dist/full.mjs +1 -1
  208. package/dist/html.d.ts +1 -0
  209. package/dist/html.d.ts.map +1 -1
  210. package/dist/html.mjs +1 -1
  211. package/dist/index.d.ts +7 -6
  212. package/dist/index.d.ts.map +1 -1
  213. package/dist/input/ClipboardHandler.d.ts +2 -0
  214. package/dist/input/ClipboardHandler.d.ts.map +1 -1
  215. package/dist/input/InputHandler.d.ts +7 -0
  216. package/dist/input/InputHandler.d.ts.map +1 -1
  217. package/dist/input/InputManager.d.ts +10 -0
  218. package/dist/input/InputManager.d.ts.map +1 -1
  219. package/dist/input/KeyboardHandler.d.ts.map +1 -1
  220. package/dist/input/MarkdownPasteDetector.d.ts +26 -0
  221. package/dist/input/MarkdownPasteDetector.d.ts.map +1 -0
  222. package/dist/input/PasteHTMLHandler.d.ts +18 -1
  223. package/dist/input/PasteHTMLHandler.d.ts.map +1 -1
  224. package/dist/input/PasteHandler.d.ts +30 -0
  225. package/dist/input/PasteHandler.d.ts.map +1 -1
  226. package/dist/input/PasteRichBlockHandler.d.ts.map +1 -1
  227. package/dist/input/SelectionDocument.d.ts +2 -1
  228. package/dist/input/SelectionDocument.d.ts.map +1 -1
  229. package/dist/markdown.d.ts +17 -0
  230. package/dist/markdown.d.ts.map +1 -0
  231. package/dist/markdown.mjs +1 -0
  232. package/dist/model/AttrRegistry.d.ts +2 -2
  233. package/dist/model/AttrRegistry.d.ts.map +1 -1
  234. package/dist/model/ContentModel.d.ts +12 -0
  235. package/dist/model/ContentModel.d.ts.map +1 -1
  236. package/dist/model/Document.d.ts +28 -3
  237. package/dist/model/Document.d.ts.map +1 -1
  238. package/dist/model/HTMLUtils.d.ts +15 -0
  239. package/dist/model/HTMLUtils.d.ts.map +1 -1
  240. package/dist/model/InlineNodeSpec.d.ts +7 -1
  241. package/dist/model/InlineNodeSpec.d.ts.map +1 -1
  242. package/dist/model/InputRule.d.ts +11 -0
  243. package/dist/model/InputRule.d.ts.map +1 -1
  244. package/dist/model/MarkSpec.d.ts +7 -1
  245. package/dist/model/MarkSpec.d.ts.map +1 -1
  246. package/dist/model/MarkdownSyntaxRegistry.d.ts +51 -0
  247. package/dist/model/MarkdownSyntaxRegistry.d.ts.map +1 -0
  248. package/dist/model/NodeSpec.d.ts +47 -1
  249. package/dist/model/NodeSpec.d.ts.map +1 -1
  250. package/dist/model/RichBlockData.d.ts +2 -0
  251. package/dist/model/RichBlockData.d.ts.map +1 -1
  252. package/dist/model/SchemaRegistry.d.ts.map +1 -1
  253. package/dist/model/TableDimensions.d.ts +11 -0
  254. package/dist/model/TableDimensions.d.ts.map +1 -0
  255. package/dist/notectl-core.mjs +1 -1
  256. package/dist/notectl-core.umd.js +1 -1
  257. package/dist/notectl-core.umd.js.map +1 -1
  258. package/dist/platform/EditorEventBoundary.d.ts +12 -0
  259. package/dist/platform/EditorEventBoundary.d.ts.map +1 -0
  260. package/dist/plugins/Plugin.d.ts +7 -0
  261. package/dist/plugins/Plugin.d.ts.map +1 -1
  262. package/dist/plugins/PluginContextFactory.d.ts +2 -0
  263. package/dist/plugins/PluginContextFactory.d.ts.map +1 -1
  264. package/dist/plugins/PluginManager.d.ts +2 -0
  265. package/dist/plugins/PluginManager.d.ts.map +1 -1
  266. package/dist/plugins/alignment.mjs +1 -1
  267. package/dist/plugins/bidi-isolation.mjs +1 -1
  268. package/dist/plugins/blockquote/BlockquotePlugin.d.ts +2 -0
  269. package/dist/plugins/blockquote/BlockquotePlugin.d.ts.map +1 -1
  270. package/dist/plugins/blockquote.mjs +1 -1
  271. package/dist/plugins/caret-navigation.mjs +1 -1
  272. package/dist/plugins/code-block/CodeBlockHighlighting.d.ts.map +1 -1
  273. package/dist/plugins/code-block/CodeBlockTypes.d.ts +2 -0
  274. package/dist/plugins/code-block/CodeBlockTypes.d.ts.map +1 -1
  275. package/dist/plugins/code-block.mjs +1 -1
  276. package/dist/plugins/font-size/FontSizeOperations.d.ts.map +1 -1
  277. package/dist/plugins/font-size.mjs +1 -1
  278. package/dist/plugins/font.mjs +1 -1
  279. package/dist/plugins/formula/DisplayMathNodeSpec.d.ts.map +1 -1
  280. package/dist/plugins/formula/FormulaInputRules.d.ts.map +1 -1
  281. package/dist/plugins/formula/FormulaMarkdownSyntax.d.ts +4 -0
  282. package/dist/plugins/formula/FormulaMarkdownSyntax.d.ts.map +1 -0
  283. package/dist/plugins/formula/FormulaPlugin.d.ts.map +1 -1
  284. package/dist/plugins/formula/FormulaTypes.d.ts +3 -1
  285. package/dist/plugins/formula/FormulaTypes.d.ts.map +1 -1
  286. package/dist/plugins/formula/InlineMathNodeSpec.d.ts.map +1 -1
  287. package/dist/plugins/formula.mjs +1 -1
  288. package/dist/plugins/gap-cursor.mjs +1 -1
  289. package/dist/plugins/hard-break.mjs +1 -1
  290. package/dist/plugins/heading/HeadingPlugin.d.ts +2 -0
  291. package/dist/plugins/heading/HeadingPlugin.d.ts.map +1 -1
  292. package/dist/plugins/heading.mjs +1 -1
  293. package/dist/plugins/highlight.mjs +1 -1
  294. package/dist/plugins/horizontal-rule/HorizontalRulePlugin.d.ts +2 -0
  295. package/dist/plugins/horizontal-rule/HorizontalRulePlugin.d.ts.map +1 -1
  296. package/dist/plugins/horizontal-rule.mjs +1 -1
  297. package/dist/plugins/image/ImagePlugin.d.ts +14 -0
  298. package/dist/plugins/image/ImagePlugin.d.ts.map +1 -1
  299. package/dist/plugins/image.mjs +1 -1
  300. package/dist/plugins/inline-code/InlineCodePlugin.d.ts.map +1 -1
  301. package/dist/plugins/inline-code.mjs +1 -1
  302. package/dist/plugins/language.mjs +1 -1
  303. package/dist/plugins/link/LinkPlugin.d.ts +14 -0
  304. package/dist/plugins/link/LinkPlugin.d.ts.map +1 -1
  305. package/dist/plugins/link.mjs +1 -1
  306. package/dist/plugins/list/ListCommands.d.ts +5 -1
  307. package/dist/plugins/list/ListCommands.d.ts.map +1 -1
  308. package/dist/plugins/list/ListInputRules.d.ts.map +1 -1
  309. package/dist/plugins/list/ListItemContext.d.ts +27 -0
  310. package/dist/plugins/list/ListItemContext.d.ts.map +1 -0
  311. package/dist/plugins/list/ListKeyboardHandlers.d.ts.map +1 -1
  312. package/dist/plugins/list/ListPlugin.d.ts +2 -0
  313. package/dist/plugins/list/ListPlugin.d.ts.map +1 -1
  314. package/dist/plugins/list/ListToolbarItems.d.ts.map +1 -1
  315. package/dist/plugins/list.mjs +1 -1
  316. package/dist/plugins/print/PrintContentPreparer.d.ts.map +1 -1
  317. package/dist/plugins/print/PrintDestinationBridge.d.ts +23 -0
  318. package/dist/plugins/print/PrintDestinationBridge.d.ts.map +1 -0
  319. package/dist/plugins/print/PrintHostStyles.d.ts.map +1 -1
  320. package/dist/plugins/print/PrintServiceImpl.d.ts +5 -1
  321. package/dist/plugins/print/PrintServiceImpl.d.ts.map +1 -1
  322. package/dist/plugins/print/PrintStyleCollector.d.ts.map +1 -1
  323. package/dist/plugins/print.mjs +1 -1
  324. package/dist/plugins/shared/MarkInputRule.d.ts +9 -0
  325. package/dist/plugins/shared/MarkInputRule.d.ts.map +1 -0
  326. package/dist/plugins/shared/PopupPositioning.d.ts +2 -0
  327. package/dist/plugins/shared/PopupPositioning.d.ts.map +1 -1
  328. package/dist/plugins/shared/index.d.ts +1 -0
  329. package/dist/plugins/shared/index.d.ts.map +1 -1
  330. package/dist/plugins/shared.mjs +1 -1
  331. package/dist/plugins/smart-paste/SmartPastePlugin.d.ts.map +1 -1
  332. package/dist/plugins/smart-paste.mjs +1 -1
  333. package/dist/plugins/strikethrough/StrikethroughPlugin.d.ts +2 -0
  334. package/dist/plugins/strikethrough/StrikethroughPlugin.d.ts.map +1 -1
  335. package/dist/plugins/strikethrough.mjs +1 -1
  336. package/dist/plugins/super-sub.mjs +1 -1
  337. package/dist/plugins/table/TableClipboard.d.ts +8 -0
  338. package/dist/plugins/table/TableClipboard.d.ts.map +1 -0
  339. package/dist/plugins/table/TableCommands.d.ts.map +1 -1
  340. package/dist/plugins/table/TableContextMenu.d.ts +11 -1
  341. package/dist/plugins/table/TableContextMenu.d.ts.map +1 -1
  342. package/dist/plugins/table/TableControls.d.ts +6 -1
  343. package/dist/plugins/table/TableControls.d.ts.map +1 -1
  344. package/dist/plugins/table/TableControlsDOM.d.ts +11 -2
  345. package/dist/plugins/table/TableControlsDOM.d.ts.map +1 -1
  346. package/dist/plugins/table/TableControlsLayout.d.ts +12 -3
  347. package/dist/plugins/table/TableControlsLayout.d.ts.map +1 -1
  348. package/dist/plugins/table/TableGrid.d.ts +57 -0
  349. package/dist/plugins/table/TableGrid.d.ts.map +1 -0
  350. package/dist/plugins/table/TableHelpers.d.ts +4 -0
  351. package/dist/plugins/table/TableHelpers.d.ts.map +1 -1
  352. package/dist/plugins/table/TableLocale.d.ts +30 -0
  353. package/dist/plugins/table/TableLocale.d.ts.map +1 -1
  354. package/dist/plugins/table/TableNavigation.d.ts +5 -1
  355. package/dist/plugins/table/TableNavigation.d.ts.map +1 -1
  356. package/dist/plugins/table/TableNodeViews.d.ts +13 -1
  357. package/dist/plugins/table/TableNodeViews.d.ts.map +1 -1
  358. package/dist/plugins/table/TablePlugin.d.ts +21 -1
  359. package/dist/plugins/table/TablePlugin.d.ts.map +1 -1
  360. package/dist/plugins/table/TableSelection.d.ts.map +1 -1
  361. package/dist/plugins/table/TableSizeEditor.d.ts +11 -0
  362. package/dist/plugins/table/TableSizeEditor.d.ts.map +1 -0
  363. package/dist/plugins/table/TableSizing.d.ts +70 -0
  364. package/dist/plugins/table/TableSizing.d.ts.map +1 -0
  365. package/dist/plugins/table/index.d.ts +3 -1
  366. package/dist/plugins/table/index.d.ts.map +1 -1
  367. package/dist/plugins/table/locales/ar.d.ts.map +1 -1
  368. package/dist/plugins/table/locales/de.d.ts.map +1 -1
  369. package/dist/plugins/table/locales/es.d.ts.map +1 -1
  370. package/dist/plugins/table/locales/fr.d.ts.map +1 -1
  371. package/dist/plugins/table/locales/hi.d.ts.map +1 -1
  372. package/dist/plugins/table/locales/pt.d.ts.map +1 -1
  373. package/dist/plugins/table/locales/ru.d.ts.map +1 -1
  374. package/dist/plugins/table/locales/zh.d.ts.map +1 -1
  375. package/dist/plugins/table.mjs +1 -1
  376. package/dist/plugins/text-color.mjs +1 -1
  377. package/dist/plugins/text-direction-auto.mjs +1 -1
  378. package/dist/plugins/text-direction.mjs +1 -1
  379. package/dist/plugins/text-formatting/TextFormattingPlugin.d.ts +9 -0
  380. package/dist/plugins/text-formatting/TextFormattingPlugin.d.ts.map +1 -1
  381. package/dist/plugins/text-formatting.mjs +1 -1
  382. package/dist/plugins/toolbar.mjs +1 -1
  383. package/dist/plugins/video/VideoCommands.d.ts.map +1 -1
  384. package/dist/plugins/video.mjs +1 -1
  385. package/dist/presets/full.d.ts +1 -1
  386. package/dist/presets/full.mjs +1 -1
  387. package/dist/presets/minimal.d.ts +1 -1
  388. package/dist/presets/minimal.mjs +1 -1
  389. package/dist/presets.d.ts +1 -1
  390. package/dist/presets.mjs +1 -1
  391. package/dist/register.d.ts +3 -0
  392. package/dist/register.d.ts.map +1 -0
  393. package/dist/register.mjs +1 -0
  394. package/dist/serialization/DocumentParser.d.ts.map +1 -1
  395. package/dist/serialization/DocumentSerializer.d.ts +2 -0
  396. package/dist/serialization/DocumentSerializer.d.ts.map +1 -1
  397. package/dist/serialization/HTMLSanitization.d.ts +15 -0
  398. package/dist/serialization/HTMLSanitization.d.ts.map +1 -0
  399. package/dist/serialization/MarkSerializer.d.ts +12 -0
  400. package/dist/serialization/MarkSerializer.d.ts.map +1 -1
  401. package/dist/serialization/MarkdownParser.d.ts +6 -0
  402. package/dist/serialization/MarkdownParser.d.ts.map +1 -0
  403. package/dist/serialization/MarkdownSerializer.d.ts +12 -0
  404. package/dist/serialization/MarkdownSerializer.d.ts.map +1 -0
  405. package/dist/serialization/MarkdownTypes.d.ts +59 -0
  406. package/dist/serialization/MarkdownTypes.d.ts.map +1 -0
  407. package/dist/serialization/TableDimensions.d.ts +37 -0
  408. package/dist/serialization/TableDimensions.d.ts.map +1 -0
  409. package/dist/serialization/markdown/BlockSerializers.d.ts +7 -0
  410. package/dist/serialization/markdown/BlockSerializers.d.ts.map +1 -0
  411. package/dist/serialization/markdown/BlockTokenizer.d.ts +54 -0
  412. package/dist/serialization/markdown/BlockTokenizer.d.ts.map +1 -0
  413. package/dist/serialization/markdown/GfmAutolink.d.ts +20 -0
  414. package/dist/serialization/markdown/GfmAutolink.d.ts.map +1 -0
  415. package/dist/serialization/markdown/GfmTableParser.d.ts +26 -0
  416. package/dist/serialization/markdown/GfmTableParser.d.ts.map +1 -0
  417. package/dist/serialization/markdown/InlineAst.d.ts +34 -0
  418. package/dist/serialization/markdown/InlineAst.d.ts.map +1 -0
  419. package/dist/serialization/markdown/InlineSerializers.d.ts +5 -0
  420. package/dist/serialization/markdown/InlineSerializers.d.ts.map +1 -0
  421. package/dist/serialization/markdown/InlineTokenizer.d.ts +5 -0
  422. package/dist/serialization/markdown/InlineTokenizer.d.ts.map +1 -0
  423. package/dist/serialization/markdown/LinkReferenceExtractor.d.ts +37 -0
  424. package/dist/serialization/markdown/LinkReferenceExtractor.d.ts.map +1 -0
  425. package/dist/serialization/markdown/MarkdownContext.d.ts +32 -0
  426. package/dist/serialization/markdown/MarkdownContext.d.ts.map +1 -0
  427. package/dist/serialization/markdown/MarkdownEntities.d.ts +33 -0
  428. package/dist/serialization/markdown/MarkdownEntities.d.ts.map +1 -0
  429. package/dist/serialization/markdown/MarkdownEscape.d.ts +33 -0
  430. package/dist/serialization/markdown/MarkdownEscape.d.ts.map +1 -0
  431. package/dist/serialization/markdown/MarkdownHTMLRegistry.d.ts +4 -0
  432. package/dist/serialization/markdown/MarkdownHTMLRegistry.d.ts.map +1 -0
  433. package/dist/serialization/markdown/MarkdownParseContext.d.ts +23 -0
  434. package/dist/serialization/markdown/MarkdownParseContext.d.ts.map +1 -0
  435. package/dist/state/Mapping.d.ts +33 -10
  436. package/dist/state/Mapping.d.ts.map +1 -1
  437. package/dist/state/StepApplication.d.ts +3 -1
  438. package/dist/state/StepApplication.d.ts.map +1 -1
  439. package/dist/state/StepHandlers.d.ts.map +1 -1
  440. package/dist/state/StepInversion.d.ts +2 -1
  441. package/dist/state/StepInversion.d.ts.map +1 -1
  442. package/dist/state/StepMapping.d.ts +3 -2
  443. package/dist/state/StepMapping.d.ts.map +1 -1
  444. package/dist/state/StepMaps.d.ts +3 -2
  445. package/dist/state/StepMaps.d.ts.map +1 -1
  446. package/dist/state/Steps.d.ts +34 -2
  447. package/dist/state/Steps.d.ts.map +1 -1
  448. package/dist/state/TransactionBuilder.d.ts +7 -1
  449. package/dist/state/TransactionBuilder.d.ts.map +1 -1
  450. package/dist/test/MarkdownConformanceUtils.d.ts +12 -0
  451. package/dist/test/MarkdownConformanceUtils.d.ts.map +1 -0
  452. package/dist/view/BlockRendering.d.ts +5 -0
  453. package/dist/view/BlockRendering.d.ts.map +1 -1
  454. package/dist/view/DecorationRendering.d.ts +6 -0
  455. package/dist/view/DecorationRendering.d.ts.map +1 -1
  456. package/dist/view/EditorViewEvents.d.ts.map +1 -1
  457. package/dist/view/Reconciler.d.ts.map +1 -1
  458. package/package.json +28 -214
  459. package/dist/chunks/AttrRegistry-DcDVyzLm.mjs.map +0 -1
  460. package/dist/chunks/AttributedMarkCommands-D4W2Jgpj.mjs +0 -2
  461. package/dist/chunks/BlockInsertion-6rR9tIGP.mjs +0 -2
  462. package/dist/chunks/BlockInsertion-6rR9tIGP.mjs.map +0 -1
  463. package/dist/chunks/BlockquotePlugin-4V7KV_Sb.mjs +0 -2
  464. package/dist/chunks/CaretNavigationPlugin-C6XBwp0N.mjs +0 -2
  465. package/dist/chunks/CaretNavigationPlugin-C6XBwp0N.mjs.map +0 -1
  466. package/dist/chunks/CodeBlockPlugin-3V2K3RBe.mjs +0 -2
  467. package/dist/chunks/CodeBlockPlugin-3V2K3RBe.mjs.map +0 -1
  468. package/dist/chunks/Commands-BIIpx_Zd.mjs +0 -2
  469. package/dist/chunks/Commands-BIIpx_Zd.mjs.map +0 -1
  470. package/dist/chunks/Decoration-ZeyVfwJB.mjs +0 -2
  471. package/dist/chunks/Decoration-ZeyVfwJB.mjs.map +0 -1
  472. package/dist/chunks/Document-r7vLOAGA.mjs +0 -2
  473. package/dist/chunks/Document-r7vLOAGA.mjs.map +0 -1
  474. package/dist/chunks/DocumentParser-CcTSeT1B.mjs +0 -2
  475. package/dist/chunks/DocumentParser-CcTSeT1B.mjs.map +0 -1
  476. package/dist/chunks/FontSizePlugin-9StCjEfN.mjs.map +0 -1
  477. package/dist/chunks/FormulaPlugin-CV5VUxkb.mjs +0 -2
  478. package/dist/chunks/FormulaPlugin-CV5VUxkb.mjs.map +0 -1
  479. package/dist/chunks/GapCursorNavigation-ycNzuQVH.mjs +0 -2
  480. package/dist/chunks/GapCursorPlugin-Zvxjnr82.mjs +0 -2
  481. package/dist/chunks/HTMLUtils-C6B4UT00.mjs +0 -2
  482. package/dist/chunks/HTMLUtils-C6B4UT00.mjs.map +0 -1
  483. package/dist/chunks/HeadingPlugin-BuGoM9Rz.mjs +0 -2
  484. package/dist/chunks/HorizontalRulePlugin-0FjHPZuA.mjs +0 -2
  485. package/dist/chunks/HorizontalRulePlugin-0FjHPZuA.mjs.map +0 -1
  486. package/dist/chunks/ImagePlugin-KpkuE2LH.mjs +0 -2
  487. package/dist/chunks/InlineCodePlugin-DMr4O7c7.mjs.map +0 -1
  488. package/dist/chunks/InlineStyleMarkSpec-C6LJT7kp.mjs +0 -2
  489. package/dist/chunks/LinkPlugin-DvZ3MPgL.mjs +0 -2
  490. package/dist/chunks/LinkPlugin-DvZ3MPgL.mjs.map +0 -1
  491. package/dist/chunks/ListPlugin-2yl6KiTK.mjs +0 -2
  492. package/dist/chunks/ListPlugin-2yl6KiTK.mjs.map +0 -1
  493. package/dist/chunks/NodeSelectionCommands-Dj4VxLdD.mjs +0 -2
  494. package/dist/chunks/PopupPositioning-BB97-__N.mjs +0 -2
  495. package/dist/chunks/PrintPlugin-DyIZDY3Q.mjs +0 -2
  496. package/dist/chunks/PrintPlugin-DyIZDY3Q.mjs.map +0 -1
  497. package/dist/chunks/PrintTypes-CxU69qu3.mjs +0 -3
  498. package/dist/chunks/PrintTypes-CxU69qu3.mjs.map +0 -1
  499. package/dist/chunks/SimpleMark-CaQtFAau.mjs +0 -2
  500. package/dist/chunks/SmartPastePlugin-Bi_wpTCV.mjs +0 -2
  501. package/dist/chunks/SmartPastePlugin-Bi_wpTCV.mjs.map +0 -1
  502. package/dist/chunks/StrikethroughPlugin-BLKDRWtf.mjs +0 -2
  503. package/dist/chunks/StrikethroughPlugin-BLKDRWtf.mjs.map +0 -1
  504. package/dist/chunks/StyleRuntime-BFKu52mS.mjs +0 -2
  505. package/dist/chunks/StyleRuntime-BFKu52mS.mjs.map +0 -1
  506. package/dist/chunks/TablePlugin-BTH9VRZq.mjs +0 -2
  507. package/dist/chunks/TablePlugin-BTH9VRZq.mjs.map +0 -1
  508. package/dist/chunks/TextColorPlugin-CEfZQ6Md.mjs +0 -2
  509. package/dist/chunks/TextDirectionAutoPlugin-CzWJjrvG.mjs +0 -2
  510. package/dist/chunks/TextDirectionPlugin-DHB88HKf.mjs +0 -2
  511. package/dist/chunks/TextFormattingPlugin-Cubp3e7f.mjs +0 -2
  512. package/dist/chunks/TextFormattingPlugin-Cubp3e7f.mjs.map +0 -1
  513. package/dist/chunks/ToolbarPlugin-DVGrFf8v.mjs +0 -2
  514. package/dist/chunks/VideoPlugin-B3uf1Dwp.mjs +0 -2
  515. package/dist/chunks/VideoPlugin-B3uf1Dwp.mjs.map +0 -1
  516. package/dist/chunks/WordBoundary-DxeMBRyP.mjs +0 -2
  517. package/dist/chunks/XmlDetector-D7TQpw-e.mjs +0 -2
  518. package/dist/chunks/XmlDetector-D7TQpw-e.mjs.map +0 -1
  519. package/dist/chunks/XmlSupport-BYiRwlkK.mjs +0 -2
  520. package/dist/chunks/XmlSupport-BYiRwlkK.mjs.map +0 -1
  521. package/dist/chunks/ar-BTShmP2E.mjs +0 -2
  522. package/dist/chunks/ar-jbplYWkC.mjs +0 -2
  523. package/dist/chunks/ar-jbplYWkC.mjs.map +0 -1
  524. package/dist/chunks/de-DN-e6G5A.mjs +0 -2
  525. package/dist/chunks/de-DN-e6G5A.mjs.map +0 -1
  526. package/dist/chunks/es-CM55WeEN.mjs +0 -2
  527. package/dist/chunks/es-CM55WeEN.mjs.map +0 -1
  528. package/dist/chunks/fonts-DQC6Uj4r.mjs +0 -2
  529. package/dist/chunks/fonts-DQC6Uj4r.mjs.map +0 -1
  530. package/dist/chunks/fr-C_2i5Ono.mjs +0 -2
  531. package/dist/chunks/fr-C_2i5Ono.mjs.map +0 -1
  532. package/dist/chunks/full-BBl7mvwH.mjs +0 -2
  533. package/dist/chunks/hi-C9fvG91d.mjs +0 -2
  534. package/dist/chunks/hi-C9fvG91d.mjs.map +0 -1
  535. package/dist/chunks/minimal-CtnR4dqp.mjs +0 -2
  536. package/dist/chunks/pt-GqLw5tN0.mjs +0 -2
  537. package/dist/chunks/pt-GqLw5tN0.mjs.map +0 -1
  538. package/dist/chunks/ru-4g_qsaLr.mjs +0 -2
  539. package/dist/chunks/ru-4g_qsaLr.mjs.map +0 -1
  540. package/dist/chunks/src-C89Cw7ni.mjs +0 -2
  541. package/dist/chunks/src-C89Cw7ni.mjs.map +0 -1
  542. package/dist/chunks/zh-BjoyjClN.mjs +0 -2
  543. package/dist/chunks/zh-DeZP08HI.mjs +0 -2
  544. package/dist/chunks/zh-DeZP08HI.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"TextFormattingPlugin-Cubp3e7f.mjs","names":[],"sources":["../../src/plugins/text-formatting/TextFormattingLocale.ts","../../src/plugins/text-formatting/TextFormattingPlugin.ts"],"sourcesContent":["/**\n * Locale interface and default English locale for the TextFormattingPlugin.\n */\n\nimport { type LocaleModuleMap, loadLocaleModule } from '../shared/LocaleLoader.js';\n\n// --- Locale Interface ---\n\nexport interface TextFormattingLocale {\n\treadonly boldLabel: string;\n\treadonly italicLabel: string;\n\treadonly underlineLabel: string;\n}\n\n// --- Default English Locale ---\n\nexport const TEXT_FORMATTING_LOCALE_EN: TextFormattingLocale = {\n\tboldLabel: 'Bold',\n\titalicLabel: 'Italic',\n\tunderlineLabel: 'Underline',\n};\n\n// --- Lazy Locale Loader ---\n\nconst localeModules: LocaleModuleMap<TextFormattingLocale> = import.meta.glob<{\n\tdefault: TextFormattingLocale;\n}>('./locales/*.ts', { eager: false });\n\nexport async function loadTextFormattingLocale(lang: string): Promise<TextFormattingLocale> {\n\treturn loadLocaleModule(localeModules, lang, TEXT_FORMATTING_LOCALE_EN);\n}\n","/**\n * TextFormattingPlugin: registers inline marks (bold, italic, underline)\n * with their MarkSpecs, toggle commands, keyboard shortcuts, and toolbar items.\n *\n * This plugin is data-driven — each mark type is defined declaratively and\n * all registrations (MarkSpec, command, keymap, toolbar item) are derived\n * from the same definition.\n *\n * Supports two separate config dimensions:\n * - Feature config (bold/italic/underline): controls whether the mark is\n * registered in the schema. When disabled, the keyboard shortcut does nothing.\n * - Toolbar config: controls whether the toolbar button is visible.\n * When a feature is disabled but toolbar is enabled, the button renders as disabled.\n */\n\nimport { isMarkActive, toggleMark } from '../../commands/Commands.js';\nimport type { ParseRule } from '../../model/ParseRule.js';\nimport type { SanitizeConfig } from '../../model/SanitizeConfig.js';\nimport { markType as mkType } from '../../model/TypeBrands.js';\nimport type { Plugin, PluginContext } from '../Plugin.js';\nimport { dispatchIfPresent, resolveLocale, toCommandName } from '../shared/PluginHelpers.js';\nimport { formatShortcut } from '../shared/ShortcutFormatting.js';\nimport {\n\tTEXT_FORMATTING_LOCALE_EN,\n\ttype TextFormattingLocale,\n\tloadTextFormattingLocale,\n} from './TextFormattingLocale.js';\n\n// --- Configuration ---\n\n/** Controls toolbar button visibility per mark. */\nexport interface TextFormattingToolbarConfig {\n\treadonly bold?: boolean;\n\treadonly italic?: boolean;\n\treadonly underline?: boolean;\n}\n\n/** Controls which inline marks are enabled and which toolbar buttons are shown. */\nexport interface TextFormattingConfig {\n\treadonly bold: boolean;\n\treadonly italic: boolean;\n\treadonly underline: boolean;\n\treadonly toolbar?: TextFormattingToolbarConfig;\n\treadonly locale?: TextFormattingLocale;\n}\n\nconst DEFAULT_CONFIG: TextFormattingConfig = {\n\tbold: true,\n\titalic: true,\n\tunderline: true,\n};\n\n// --- Mark Definitions ---\n\ninterface MarkDefinition {\n\treadonly type: string;\n\treadonly configKey: keyof Omit<TextFormattingConfig, 'toolbar' | 'locale'>;\n\treadonly rank: number;\n\treadonly tag: string;\n\treadonly icon: string;\n\treadonly keyBinding: string;\n\treadonly toHTMLString: (content: string) => string;\n\treadonly parseHTML: readonly ParseRule[];\n\treadonly sanitize: SanitizeConfig;\n}\n\nconst BOLD_ICON =\n\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42zM10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3v-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5z\"/></svg>';\nconst ITALIC_ICON =\n\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z\"/></svg>';\nconst UNDERLINE_ICON =\n\t'<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6zm-7 2v2h14v-2H5z\"/></svg>';\n\nconst MARK_DEFINITIONS: readonly MarkDefinition[] = [\n\t{\n\t\ttype: 'bold',\n\t\tconfigKey: 'bold',\n\t\trank: 0,\n\t\ttag: 'strong',\n\t\ticon: BOLD_ICON,\n\t\tkeyBinding: 'Mod-B',\n\t\ttoHTMLString: (content) => `<strong>${content}</strong>`,\n\t\tparseHTML: [\n\t\t\t{ tag: 'strong' },\n\t\t\t{\n\t\t\t\ttag: 'b',\n\t\t\t\tgetAttrs: (el: HTMLElement) => {\n\t\t\t\t\tconst fw: string = el.style.fontWeight;\n\t\t\t\t\treturn fw === 'normal' || fw === '400' ? false : {};\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\ttag: 'span',\n\t\t\t\tgetAttrs: (el: HTMLElement) => {\n\t\t\t\t\tconst fw: string = el.style.fontWeight;\n\t\t\t\t\tif (!fw) return false;\n\t\t\t\t\tif (fw === 'bold') return {};\n\t\t\t\t\tconst numeric: number = Number.parseInt(fw, 10);\n\t\t\t\t\treturn !Number.isNaN(numeric) && numeric >= 700 ? {} : false;\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\tsanitize: { tags: ['strong', 'b'] },\n\t},\n\t{\n\t\ttype: 'italic',\n\t\tconfigKey: 'italic',\n\t\trank: 1,\n\t\ttag: 'em',\n\t\ticon: ITALIC_ICON,\n\t\tkeyBinding: 'Mod-I',\n\t\ttoHTMLString: (content) => `<em>${content}</em>`,\n\t\tparseHTML: [\n\t\t\t{ tag: 'em' },\n\t\t\t{ tag: 'i' },\n\t\t\t{\n\t\t\t\ttag: 'span',\n\t\t\t\tgetAttrs: (el: HTMLElement) => {\n\t\t\t\t\treturn el.style.fontStyle === 'italic' ? {} : false;\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\tsanitize: { tags: ['em', 'i'] },\n\t},\n\t{\n\t\ttype: 'underline',\n\t\tconfigKey: 'underline',\n\t\trank: 2,\n\t\ttag: 'u',\n\t\ticon: UNDERLINE_ICON,\n\t\tkeyBinding: 'Mod-U',\n\t\ttoHTMLString: (content) => `<u>${content}</u>`,\n\t\tparseHTML: [\n\t\t\t{ tag: 'u' },\n\t\t\t{\n\t\t\t\ttag: 'span',\n\t\t\t\tgetAttrs: (el: HTMLElement) => {\n\t\t\t\t\treturn el.style.textDecoration.includes('underline') ? {} : false;\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\tsanitize: { tags: ['u'] },\n\t},\n];\n\n// --- Plugin ---\n\nexport class TextFormattingPlugin implements Plugin {\n\treadonly id = 'text-formatting';\n\treadonly name = 'Text Formatting';\n\treadonly priority = 20;\n\n\tprivate readonly config: TextFormattingConfig;\n\tprivate locale!: TextFormattingLocale;\n\n\tconstructor(config?: Partial<TextFormattingConfig>) {\n\t\tthis.config = { ...DEFAULT_CONFIG, ...config };\n\t}\n\n\tasync init(context: PluginContext): Promise<void> {\n\t\tthis.locale = await resolveLocale(\n\t\t\tcontext,\n\t\t\tthis.config.locale,\n\t\t\tTEXT_FORMATTING_LOCALE_EN,\n\t\t\tloadTextFormattingLocale,\n\t\t);\n\n\t\tconst enabledMarks = MARK_DEFINITIONS.filter((def) => this.config[def.configKey]);\n\n\t\tfor (const def of enabledMarks) {\n\t\t\tthis.registerMark(context, def);\n\t\t}\n\n\t\tthis.registerKeymaps(context, enabledMarks);\n\n\t\t// Register disabled placeholder buttons for marks that are disabled\n\t\t// as features but explicitly requested in the toolbar config\n\t\tthis.registerDisabledToolbarItems(context);\n\t}\n\n\tprivate registerMark(context: PluginContext, def: MarkDefinition): void {\n\t\tconst commandName = toCommandName(def.type);\n\t\tconst toolbarVisible = this.isToolbarVisible(def.configKey);\n\n\t\tcontext.registerMarkSpec({\n\t\t\ttype: def.type,\n\t\t\trank: def.rank,\n\t\t\ttoDOM() {\n\t\t\t\treturn document.createElement(def.tag);\n\t\t\t},\n\t\t\ttoHTMLString: (_mark, content) => def.toHTMLString(content),\n\t\t\tparseHTML: def.parseHTML,\n\t\t\tsanitize: def.sanitize,\n\t\t});\n\n\t\tcontext.registerCommand(commandName, () =>\n\t\t\tdispatchIfPresent(context, toggleMark(context.getState(), mkType(def.type))),\n\t\t);\n\n\t\tif (toolbarVisible) {\n\t\t\tconst label: string = this.getMarkLabel(def.type);\n\t\t\tcontext.registerToolbarItem({\n\t\t\t\tid: def.type,\n\t\t\t\tgroup: 'format',\n\t\t\t\ticon: def.icon,\n\t\t\t\tlabel,\n\t\t\t\ttooltip: `${label} (${formatShortcut(def.keyBinding)})`,\n\t\t\t\tcommand: commandName,\n\t\t\t\tisActive: (state) => isMarkActive(state, mkType(def.type)),\n\t\t\t});\n\t\t}\n\t}\n\n\tprivate registerKeymaps(context: PluginContext, marks: readonly MarkDefinition[]): void {\n\t\tconst keymap: Record<string, () => boolean> = {};\n\t\tfor (const def of marks) {\n\t\t\tconst commandName = toCommandName(def.type);\n\t\t\tkeymap[def.keyBinding] = () => context.executeCommand(commandName);\n\t\t}\n\t\tif (Object.keys(keymap).length > 0) {\n\t\t\tcontext.registerKeymap(keymap);\n\t\t}\n\t}\n\n\t/**\n\t * Registers disabled toolbar buttons for marks whose feature is disabled\n\t * but whose toolbar button is explicitly requested.\n\t */\n\tprivate registerDisabledToolbarItems(context: PluginContext): void {\n\t\tif (!this.config.toolbar) return;\n\n\t\tfor (const def of MARK_DEFINITIONS) {\n\t\t\tconst featureEnabled = this.config[def.configKey];\n\t\t\tconst toolbarVisible = this.config.toolbar[def.configKey] ?? true;\n\n\t\t\tif (!featureEnabled && toolbarVisible) {\n\t\t\t\tcontext.registerToolbarItem({\n\t\t\t\t\tid: def.type,\n\t\t\t\t\tgroup: 'format',\n\t\t\t\t\ticon: def.icon,\n\t\t\t\t\tlabel: this.getMarkLabel(def.type),\n\t\t\t\t\tcommand: toCommandName(def.type),\n\t\t\t\t\tisEnabled: () => false,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate getMarkLabel(type: string): string {\n\t\tconst key = `${type}Label` as keyof TextFormattingLocale;\n\t\treturn this.locale[key] as string;\n\t}\n\n\t/** Checks if a toolbar button should be visible for a given mark. */\n\tprivate isToolbarVisible(\n\t\tconfigKey: keyof Omit<TextFormattingConfig, 'toolbar' | 'locale'>,\n\t): boolean {\n\t\tif (!this.config.toolbar) return true;\n\t\treturn this.config.toolbar[configKey] ?? true;\n\t}\n}\n"],"mappings":"6NAgBA,IAAa,EAAkD,CAC9D,UAAW,OACX,YAAa,SACb,eAAgB,aAKX,iBAAuD,OAAA,OAAA,CAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,qBAAA,kBAAA,IAAA,OAAA,uBAI7D,eAAsB,EAAyB,GAC9C,OAAO,EAAiB,EAAe,EAAM,EAC9C,CCgBA,IAAM,EAAuC,CAC5C,MAAM,EACN,QAAQ,EACR,WAAW,GAwBN,EAA8C,CACnD,CACC,KAAM,OACN,UAAW,OACX,KAAM,EACN,IAAK,SACL,KAAM,sTACN,WAAY,QACZ,aAAe,GAAY,WAAW,aACtC,UAAW,CACV,CAAE,IAAK,UACP,CACC,IAAK,IACL,SAAW,IACV,MAAM,EAAa,EAAG,MAAM,WAC5B,MAAc,WAAP,GAA0B,QAAP,GAAuB,CAAC,IAGpD,CACC,IAAK,OACL,SAAW,IACV,MAAM,EAAa,EAAG,MAAM,WAC5B,IAAK,EAAI,OAAO,EAChB,GAAW,SAAP,EAAe,MAAO,CAAC,EAC3B,MAAM,EAAkB,OAAO,SAAS,EAAI,IAC5C,OAAQ,OAAO,MAAM,IAAY,GAAW,KAAM,CAAC,KAItD,SAAU,CAAE,KAAM,CAAC,SAAU,OAE9B,CACC,KAAM,SACN,UAAW,SACX,KAAM,EACN,IAAK,KACL,KAAM,iIACN,WAAY,QACZ,aAAe,GAAY,OAAO,SAClC,UAAW,CACV,CAAE,IAAK,MACP,CAAE,IAAK,KACP,CACC,IAAK,OACL,SAAW,GACoB,WAAvB,EAAG,MAAM,WAAyB,CAAC,IAI7C,SAAU,CAAE,KAAM,CAAC,KAAM,OAE1B,CACC,KAAM,YACN,UAAW,YACX,KAAM,EACN,IAAK,IACL,KAAM,oMACN,WAAY,QACZ,aAAe,GAAY,MAAM,QACjC,UAAW,CACV,CAAE,IAAK,KACP,CACC,IAAK,OACL,SAAW,KACH,EAAG,MAAM,eAAe,SAAS,cAAe,CAAC,IAI3D,SAAU,CAAE,KAAM,CAAC,QAMR,EAAb,MACC,GAAc,kBACd,KAAgB,kBAChB,SAAoB,GAEpB,OACA,OAEA,WAAA,CAAY,GACX,KAAK,OAAS,IAAK,KAAmB,EACvC,CAEA,UAAM,CAAK,GACV,KAAK,aAAe,EACnB,EACA,KAAK,OAAO,OACZ,EACA,GAGD,MAAM,EAAe,EAAiB,OAAQ,GAAQ,KAAK,OAAO,EAAI,YAEtE,IAAK,MAAM,KAAO,EACjB,KAAK,aAAa,EAAS,GAG5B,KAAK,gBAAgB,EAAS,GAI9B,KAAK,6BAA6B,EACnC,CAEA,YAAA,CAAqB,EAAwB,GAC5C,MAAM,EAAc,EAAc,EAAI,MAChC,EAAiB,KAAK,iBAAiB,EAAI,WAiBjD,GAfA,EAAQ,iBAAiB,CACxB,KAAM,EAAI,KACV,KAAM,EAAI,KACV,MAAA,IACQ,SAAS,cAAc,EAAI,KAEnC,aAAA,CAAe,EAAO,IAAY,EAAI,aAAa,GACnD,UAAW,EAAI,UACf,SAAU,EAAI,WAGf,EAAQ,gBAAgB,EAAA,IACvB,EAAkB,EAAS,EAAW,EAAQ,WAAY,EAAO,EAAI,SAGlE,EAAgB,CACnB,MAAM,EAAgB,KAAK,aAAa,EAAI,MAC5C,EAAQ,oBAAoB,CAC3B,GAAI,EAAI,KACR,MAAO,SACP,KAAM,EAAI,KACV,QACA,QAAS,GAAG,MAAU,EAAe,EAAI,eACzC,QAAS,EACT,SAAW,GAAU,EAAa,EAAO,EAAO,EAAI,QAEtD,CACD,CAEA,eAAA,CAAwB,EAAwB,GAC/C,MAAM,EAAwC,CAAC,EAC/C,IAAK,MAAM,KAAO,EAAO,CACxB,MAAM,EAAc,EAAc,EAAI,MACtC,EAAO,EAAI,YAAA,IAAoB,EAAQ,eAAe,EACvD,CACI,OAAO,KAAK,GAAQ,OAAS,GAChC,EAAQ,eAAe,EAEzB,CAMA,4BAAA,CAAqC,GACpC,GAAK,KAAK,OAAO,QAEjB,IAAK,MAAM,KAAO,EAAkB,CACnC,MAAM,EAAiB,KAAK,OAAO,EAAI,WACjC,EAAiB,KAAK,OAAO,QAAQ,EAAI,aAAc,GAExD,GAAkB,GACtB,EAAQ,oBAAoB,CAC3B,GAAI,EAAI,KACR,MAAO,SACP,KAAM,EAAI,KACV,MAAO,KAAK,aAAa,EAAI,MAC7B,QAAS,EAAc,EAAI,MAC3B,UAAA,KAAiB,GAGpB,CACD,CAEA,YAAA,CAAqB,GACpB,MAAM,EAAM,GAAG,SACf,OAAO,KAAK,OAAO,EACpB,CAGA,gBAAA,CACC,GAEA,OAAK,KAAK,OAAO,UACV,KAAK,OAAO,QAAQ,KAAc,EAC1C"}
@@ -1,2 +0,0 @@
1
- import{i as t}from"./Platform-ByobkiCc.mjs";import{c as e,s as o}from"./StyleRuntime-BFKu52mS.mjs";import{n}from"./TypedKeys-CA4bfw9O.mjs";import{c as r,o as i}from"./PluginHelpers-KDuTlmXm.mjs";import{n as l,r as s,t as a}from"./KeyboardNav-D0my3wuy.mjs";import{n as c,r as d,t as p}from"./PopupPositioning-BB97-__N.mjs";import{n as u,t as h}from"./PopupManager-DUtaK3WX.mjs";var b=class{_toolbarItems=/* @__PURE__ */new Map;_toolbarItemPluginMap=/* @__PURE__ */new Map;registerToolbarItem(t,e){if(this._toolbarItems.has(t.id))throw new Error(`ToolbarItem with id "${t.id}" is already registered.`);if(this._toolbarItems.set(t.id,t),e){const o=this._toolbarItemPluginMap.get(e)??[];o.push(t.id),this._toolbarItemPluginMap.set(e,o)}}getToolbarItemsByPlugin(t){const e=this._toolbarItemPluginMap.get(t)??[],o=[];for(const n of e){const t=this._toolbarItems.get(n);t&&o.push(t)}return o}getToolbarItem(t){return this._toolbarItems.get(t)}getToolbarItems(){return[...this._toolbarItems.values()]}removeToolbarItem(t){this._toolbarItems.delete(t);for(const[e,o]of this._toolbarItemPluginMap){const n=o.indexOf(t);if(-1!==n){o.splice(n,1),0===o.length&&this._toolbarItemPluginMap.delete(e);break}}}clear(){this._toolbarItems.clear(),this._toolbarItemPluginMap.clear()}};function m(t){for(let e=0;e<t.length;e++)if(!t[e]?.disabled)return e;return-1}var f={formattingOptionsAria:"Formatting options",moreToolsAria:"More tools",gridPickerLabel:(t,e)=>`${t} x ${e}`},v=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-C9lO1jsY.mjs"),"./locales/de.ts":()=>import("./de-BXQBXxFJ.mjs"),"./locales/es.ts":()=>import("./es-CXuMz87y.mjs"),"./locales/fr.ts":()=>import("./fr-fshsDD66.mjs"),"./locales/hi.ts":()=>import("./hi-BOMkDPqC.mjs"),"./locales/pt.ts":()=>import("./pt-Cc4zysaT.mjs"),"./locales/ru.ts":()=>import("./ru-CwyPz2Va.mjs"),"./locales/zh.ts":()=>import("./zh-DgSmvLyw.mjs")});async function g(t){return r(v,t,f)}var w={BurgerMenu:"burger-menu",Flow:"flow",None:"none"},x="notectl-toolbar-btn--overflow-hidden",y="notectl-toolbar-separator--overflow-hidden",A="notectl-toolbar-group--overflow-hidden",E="notectl-toolbar-group",_="notectl-toolbar-separator",k=class{toolbar;context;onOverflowChange;onItemActivated;getActiveElement;ariaLabel;popupManager;entries=[];overflowButton=null;overflowDropdown=null;overflowHandle=null;overflowEntries=[];resizeObserver=null;closeHandler=null;closeHandlerTimer=null;closeHandlerAttached=!1;constructor(t){this.toolbar=t.toolbar,this.ariaLabel=t.ariaLabel,this.context=t.context,this.onOverflowChange=t.onOverflowChange,this.onItemActivated=t.onItemActivated,this.getActiveElement=t.getActiveElement,this.popupManager=t.popupManager??null,this.resizeObserver=new ResizeObserver(()=>this.recalculate()),this.resizeObserver.observe(this.toolbar)}update(t){this.entries=t.map(t=>({element:t.element,item:t.item})),this.recalculate()}recalculate(){if(0===this.entries.length)return;this.closeDropdown(),this.resetVisibility(),this.ensureOverflowButton(),this.setOverflowButtonVisible(!1);const t=this.measureAvailableWidth(),e=Array.from(this.toolbar.children),o=this.measureChildWidths(e),n=t-34-2;let r=0,i=!1;const l=[];for(const s of e){if(s===this.overflowButton)continue;if(s.classList.contains(_)){const t=(o.get(s)??0)+2;i||r+t>n?(i=!0,s.classList.add(y)):r+=t;continue}if(s.classList.contains(E)){const t=(o.get(s)??0)+2,e=this.entriesInside(s);i||r+t>n?(i=!0,this.hideGroup(s,e,l)):r+=t;continue}const t=this.entries.find(t=>t.element===s);if(!t)continue;const e=(o.get(s)??0)+2;i||r+e>n?(i=!0,t.element.classList.add(x),l.push(t)):r+=e}this.overflowEntries=l,this.hideTrailingSeparators(),this.setOverflowButtonVisible(l.length>0),this.notifyChange()}hideGroup(t,e,o){t.classList.add(A);for(const n of e)n.element.classList.add(x),o.push(n)}entriesInside(t){const e=[];for(const o of this.entries)t.contains(o.element)&&e.push(o);return e}updateItemStates(t){if(!this.overflowDropdown)return;const e=Array.from(this.overflowDropdown.querySelectorAll(".notectl-dropdown__item"));for(const o of e){const e=o.getAttribute("data-toolbar-item"),n=this.overflowEntries.find(t=>t.item.id===e);if(!n)continue;const r=n.item.isActive?.(t)??!1,i=n.item.isEnabled?.(t)??!0;if(o.classList.toggle("notectl-dropdown__item--active",r),o.disabled=!i,"combobox"===n.item.popupType){const e=o.querySelector(".notectl-dropdown__item-label");e&&(e.textContent=n.item.getLabel(t))}if(n.item.getIcon){const e=n.item.getIcon(t),r=o.querySelector(".notectl-dropdown__item-icon");r&&r.innerHTML!==e&&(r.innerHTML=e)}}}destroy(){this.resizeObserver?.disconnect(),this.resizeObserver=null,this.closeDropdown(),this.overflowButton?.remove(),this.overflowButton=null,this.entries=[],this.overflowEntries=[]}measureChildWidths(t){const e=/* @__PURE__ */new Map;for(const o of t)o!==this.overflowButton&&e.set(o,o.offsetWidth);return e}measureAvailableWidth(){const t=getComputedStyle(this.toolbar),e=Number.parseFloat(t.paddingLeft)||0,o=Number.parseFloat(t.paddingRight)||0;return this.toolbar.clientWidth-e-o}resetVisibility(){for(const o of this.entries)o.element.classList.remove(x);const t=Array.from(this.toolbar.querySelectorAll(`.${_}`));for(const o of t)o.classList.remove(y);const e=Array.from(this.toolbar.querySelectorAll(`.${E}`));for(const o of e)o.classList.remove(A)}setOverflowButtonVisible(t){this.overflowButton&&(this.overflowButton.classList.toggle("notectl-toolbar-overflow-btn--hidden",!t),t||this.overflowButton.removeAttribute("tabindex"))}ensureOverflowButton(){if(this.overflowButton)return;const t=document.createElement("button");t.type="button",t.className="notectl-toolbar-overflow-btn",t.setAttribute("aria-label",this.ariaLabel),t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded","false"),t.setAttribute("part","toolbar-button toolbar-overflow-button"),t.innerHTML='<svg viewBox="0 0 16 16" width="16" height="16"><circle cx="3" cy="8" r="1.5" fill="currentColor"/><circle cx="8" cy="8" r="1.5" fill="currentColor"/><circle cx="13" cy="8" r="1.5" fill="currentColor"/></svg>',t.addEventListener("mousedown",t=>{t.preventDefault(),this.toggleDropdown()}),this.toolbar.appendChild(t),this.overflowButton=t}toggleDropdown(){this.overflowDropdown?this.closeDropdown():this.openDropdown()}openDropdown(){if(!this.overflowButton||0===this.overflowEntries.length)return;const t=document.createElement("div");t.className="notectl-toolbar-popup notectl-dropdown",t.setAttribute("role","menu"),this.renderDropdownItems(t,this.context.getState()),this.popupManager?(this.overflowHandle=this.popupManager.open({anchor:this.overflowButton,className:"notectl-toolbar-popup notectl-dropdown",ariaRole:"menu",position:"below-end",referenceNode:this.overflowButton,restoreFocusTo:this.overflowButton,onClose:()=>{this.overflowHandle=null,this.overflowDropdown=null,this.overflowButton&&this.overflowButton.setAttribute("aria-expanded","false")},content:t=>{this.renderDropdownItems(t,this.context.getState()),this.overflowDropdown=t,t.addEventListener("keydown",t=>this.handleDropdownKeydown(t))}}),this.overflowButton.setAttribute("aria-expanded","true")):(this.positionDropdown(t),p(t,this.overflowButton),this.overflowDropdown=t,this.overflowButton.setAttribute("aria-expanded","true"),requestAnimationFrame(()=>{t.querySelector('[role="menuitem"]')?.focus()}),t.addEventListener("keydown",t=>this.handleDropdownKeydown(t)),this.registerCloseHandler())}renderDropdownItems(t,e){let o=null;for(const n of this.overflowEntries){if(null!==o&&n.item.group!==o){const e=document.createElement("div");e.className="notectl-dropdown__separator",e.setAttribute("role","separator"),t.appendChild(e)}o=n.item.group;const r=document.createElement("button");r.type="button",r.className="notectl-dropdown__item",r.setAttribute("role","menuitem"),r.setAttribute("tabindex","-1"),r.setAttribute("data-toolbar-item",n.item.id);const i=document.createElement("span");i.className="notectl-dropdown__item-icon","combobox"!==n.item.popupType&&(i.innerHTML=n.item.icon),r.appendChild(i);const l=document.createElement("span");l.className="notectl-dropdown__item-label",l.textContent="combobox"===n.item.popupType?n.item.getLabel(e):n.item.tooltip??n.item.label,r.appendChild(l),r.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation(),this.activateOverflowItem(n)}),t.appendChild(r)}}positionDropdown(e){if(!this.overflowButton)return;const o=this.overflowButton.getBoundingClientRect(),n=t(this.toolbar);d(e,o,{position:n?"below-start":"below-end",isRtl:n})}registerCloseHandler(){this.closeHandler=t=>{const e=t.composedPath();this.overflowDropdown&&!e.includes(this.overflowDropdown)&&this.overflowButton&&!e.includes(this.overflowButton)&&this.closeDropdown()},this.closeHandlerTimer=setTimeout(()=>{this.closeHandlerTimer=null,this.closeHandler&&this.overflowDropdown&&(document.addEventListener("mousedown",this.closeHandler),this.closeHandlerAttached=!0)},0)}closeDropdown(){if(this.overflowHandle){const t=this.overflowHandle;return this.overflowHandle=null,this.overflowDropdown=null,t.close(),void(this.overflowButton&&this.overflowButton.setAttribute("aria-expanded","false"))}this.overflowDropdown&&(this.overflowDropdown.remove(),this.overflowDropdown=null),this.overflowButton&&this.overflowButton.setAttribute("aria-expanded","false"),this.closeHandler&&(null!==this.closeHandlerTimer&&(clearTimeout(this.closeHandlerTimer),this.closeHandlerTimer=null),this.closeHandlerAttached&&(document.removeEventListener("mousedown",this.closeHandler),this.closeHandlerAttached=!1),this.closeHandler=null)}activateOverflowItem(t){this.closeDropdown(),t.item.popupType&&this.overflowButton?this.onItemActivated(this.overflowButton,t.item):this.context.executeCommand(t.item.command)}handleDropdownKeydown(t){if(!this.overflowDropdown)return;if("Escape"===t.key||"Tab"===t.key)return t.preventDefault(),t.stopPropagation(),this.closeDropdown(),void this.overflowButton?.focus();const e=Array.from(this.overflowDropdown.querySelectorAll('[role="menuitem"]')),o=e.indexOf(this.getActiveElement());switch(t.key){case"ArrowDown":t.preventDefault(),e[l(e,o,1)]?.focus();break;case"ArrowUp":t.preventDefault(),e[l(e,o,-1)]?.focus();break;case"Enter":case" ":{t.preventDefault();const n=e[o];if(!n)break;const r=n.getAttribute("data-toolbar-item"),i=this.overflowEntries.find(t=>t.item.id===r);i&&this.activateOverflowItem(i);break}}}hideTrailingSeparators(){const t=Array.from(this.toolbar.children);for(let e=t.length-1;e>=0;e--){const o=t[e];if(!o||o===this.overflowButton)continue;if(o.classList.contains(_)){o.classList.contains(y)||o.classList.add(y);continue}const n=o.classList.contains(E)&&o.classList.contains(A),r=o.classList.contains("notectl-toolbar-btn")&&o.classList.contains(x);if(!n&&!r)break}}notifyChange(){const t=this.entries.filter(t=>!t.element.classList.contains(x)).map(t=>t.element);this.onOverflowChange(t,this.overflowEntries.length>0?this.overflowButton:null)}};function C(t,e,o){const n=t.querySelectorAll(".notectl-grid-picker__cell");for(const r of n){const t=Number(r.getAttribute("data-row")),n=Number(r.getAttribute("data-col"));r.classList.toggle("notectl-grid-picker__cell--highlighted",t<=e&&n<=o)}}function B(){const t=document.createElement("span");return t.className="notectl-toolbar-separator",t.setAttribute("role","separator"),t.setAttribute("part","toolbar-divider"),t}var L=class{activePopup=null;activePopupButton=null;activeHandle=null;getActiveElement;locale;popupManager=null;constructor(t,e=f){this.getActiveElement=t,this.locale=e}setPopupManager(t){this.popupManager=t}isOpen(){return null!==this.activePopup}toggle(t,e,o){this.activePopup?this.close():this.openViaManager(t,e,o)}close(){if(this.activeHandle){const t=this.activeHandle;return this.activeHandle=null,this.clearButtonState(),void t.close()}this.clearButtonState(),this.activePopup&&(this.activePopup.remove(),this.activePopup=null)}closeAndRestoreFocus(){const t=this.activePopupButton;this.close(),t?.focus()}destroy(){this.close()}openViaManager(t,e,o){this.popupManager&&(this.activePopupButton=t,t.classList.add("notectl-toolbar-btn--popup-open"),t.setAttribute("aria-expanded","true"),this.activeHandle=this.popupManager.open({anchor:t,className:"notectl-toolbar-popup",referenceNode:t,restoreFocusTo:t,position:"below-start",onClose:()=>{this.activeHandle=null,this.clearButtonState(),this.activePopup=null},content:(t,n)=>{this.activePopup=t,this.renderPopupContent(t,e,o,n),t.addEventListener("keydown",t=>this.handlePopupKeydown(t))}}))}renderPopupContent(t,e,n,r){const i=()=>{r({restoreFocusTo:null}),n.getContainer().focus()};switch(e.popupType){case"gridPicker":!function(t,e,n,r=f){t.className+=" notectl-grid-picker";const i=document.createElement("div");i.className="notectl-grid-picker__grid",i.setAttribute("role","grid"),o(i,{display:"grid",gridTemplateColumns:`repeat(${e.maxCols}, 1fr)`,gap:"2px",padding:"8px"});const l=document.createElement("div");l.className="notectl-grid-picker__label",l.textContent=r.gridPickerLabel(1,1),o(l,{textAlign:"center",padding:"4px",fontSize:"12px"}),l.setAttribute("aria-live","polite");for(let s=1;s<=e.maxRows;s++)for(let t=1;t<=e.maxCols;t++){const a=document.createElement("div");a.className="notectl-grid-picker__cell",a.setAttribute("role","gridcell"),a.setAttribute("tabindex","-1"),a.setAttribute("aria-label",r.gridPickerLabel(s,t)),o(a,{width:"20px",height:"20px",border:"1px solid #ccc",cursor:"pointer"}),a.setAttribute("data-row",String(s)),a.setAttribute("data-col",String(t)),a.addEventListener("mouseenter",()=>{C(i,s,t),l.textContent=r.gridPickerLabel(s,t)}),a.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),a.addEventListener("click",()=>{e.onSelect(s,t),n()}),i.appendChild(a)}t.appendChild(i),t.appendChild(l)}(t,e.popupConfig,i,this.locale);break;case"dropdown":!function(t,e,o,r){t.classList.add("notectl-dropdown"),t.setAttribute("role","menu");for(const i of e.items){const e=document.createElement("button");if(e.type="button",e.className="notectl-dropdown__item",e.setAttribute("role","menuitem"),e.setAttribute("tabindex","-1"),i.icon){const t=document.createElement("span");t.className="notectl-dropdown__item-icon",t.innerHTML=i.icon,e.appendChild(t)}const o=document.createElement("span");o.className="notectl-dropdown__item-label",o.textContent=i.label,e.appendChild(o),e.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation()}),e.addEventListener("click",()=>{var t;t=i.command,n.executeCommand(t),r()}),t.appendChild(e)}}(t,e.popupConfig,0,i);break;case"custom":case"combobox":e.renderPopup(t,n,r)}}clearButtonState(){this.activePopupButton&&(this.activePopupButton.classList.remove("notectl-toolbar-btn--popup-open"),this.activePopupButton.setAttribute("aria-expanded","false"),this.activePopupButton=null)}handlePopupKeydown(t){if(!this.activePopup)return;if("Escape"===t.key)return t.preventDefault(),t.stopPropagation(),void this.closeAndRestoreFocus();if("Tab"===t.key)return t.preventDefault(),void this.closeAndRestoreFocus();const e=this.activePopup.querySelectorAll('[role="menuitem"]');e.length>0?this.handleDropdownKeydown(t,e):null===this.activePopup.querySelector(".notectl-grid-picker__cell")?this.handleCustomPopupKeydown(t):this.handleGridKeydown(t)}handleDropdownKeydown(t,e){const o=Array.from(e),n=o.indexOf(this.getActiveElement());switch(t.key){case"ArrowDown":t.preventDefault(),o[l(o,n,1)]?.focus();break;case"ArrowUp":t.preventDefault(),o[l(o,n,-1)]?.focus();break;case"Enter":case" ":{t.preventDefault();const e=o[n];e&&e.click();break}}}handleGridKeydown(e){const o=this.getActiveElement(),n=Number(o?.getAttribute("data-row")??1),r=Number(o?.getAttribute("data-col")??1),i=this.activePopup?.querySelector(".notectl-grid-picker__grid")??null;if(!i)return;const l=i.querySelector(".notectl-grid-picker__cell:last-child"),a=Number(l?.getAttribute("data-col")??1),c=Number(l?.getAttribute("data-row")??1);if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.key)){e.preventDefault();const[o,l]=s(n,r,c,a,e.key,!!this.activePopup&&t(this.activePopup));i.querySelector(`.notectl-grid-picker__cell[data-row="${o}"][data-col="${l}"]`)?.focus(),C(i,o,l);const d=this.activePopup?.querySelector(".notectl-grid-picker__label")??null;d&&(d.textContent=this.locale.gridPickerLabel(o,l))}"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),o?.click())}handleCustomPopupKeydown(t){if(!this.activePopup)return;const e=Array.from(this.activePopup.querySelectorAll("button"));if(0===e.length)return;const o=this.getActiveElement(),n=e.indexOf(o);switch(t.key){case"ArrowDown":t.preventDefault(),e[l(e,n,1)]?.focus();break;case"ArrowUp":t.preventDefault(),e[l(e,n,-1)]?.focus();break;case"Enter":case" ":t.preventDefault(),o&&((r=o).dispatchEvent(new MouseEvent("mousedown",{bubbles:!0,cancelable:!0})),r.dispatchEvent(new MouseEvent("mouseup",{bubbles:!0,cancelable:!0})),r.click())}var r}},I=class t{element;timer=null;target=null;isPopupActive;static TOOLTIP_ID="notectl-toolbar-tooltip";constructor(o){this.isPopupActive=o,this.element=document.createElement("div"),this.element.className="notectl-toolbar-tooltip",this.element.id=t.TOOLTIP_ID,this.element.setAttribute("role","tooltip"),e(this.element,"display","none")}show(n){if(this.hide(),this.isPopupActive()||n.disabled)return;const r=n.getAttribute("data-tooltip");r&&(this.target=n,this.timer=setTimeout(()=>{if(this.isPopupActive())return;this.element.textContent=r,e(this.element,"display","");const i=n.getRootNode();i instanceof ShadowRoot&&!this.element.parentNode?i.appendChild(this.element):i instanceof ShadowRoot||this.element.parentNode||document.body.appendChild(this.element),n.setAttribute("aria-describedby",t.TOOLTIP_ID);const l=n.getBoundingClientRect();e(this.element,"position","fixed");const s=c(this.element);o(this.element,{top:l.bottom+6-s.y+"px",left:l.left+l.width/2-s.x+"px",transform:"translateX(-50%)"})},500))}hide(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.target&&(this.target.removeAttribute("aria-describedby"),this.target=null),e(this.element,"display","none")}destroy(){this.hide(),this.element.remove()}};function P(t){if(Array.isArray(t))return{plugins:t,label:void 0};const e=t;return{plugins:e.plugins,label:e.label}}var T=new n("toolbar"),D=class{id="toolbar";name="Toolbar";priority=10;context=null;toolbarElement=null;buttons=[];hiddenItems=/* @__PURE__ */new Set;layoutConfig;overflowBehavior;focusedIndex=0;tooltip=null;popupController=null;popupManager=null;overflowController=null;visibleElements=[];locale;constructor(t){this.layoutConfig=t??null,this.overflowBehavior=t?.overflow??w.BurgerMenu}async init(t){this.locale=await i(t,void 0,f,g),t.registerStyleSheet('\n/* Toolbar */\n.notectl-plugin-container--top {\n\tdisplay: flex;\n\talign-items: center;\n\tflex-wrap: nowrap;\n\tborder-bottom: 1px solid var(--notectl-border);\n\tbackground: var(--notectl-toolbar-bg, var(--notectl-surface-raised));\n\tmin-height: 40px;\n\tflex-shrink: 0;\n}\n\n.notectl-toolbar {\n\tdisplay: flex;\n\talign-items: center;\n\tflex-wrap: nowrap;\n\toverflow: hidden;\n\tflex: 1;\n\tmin-width: 0;\n\tgap: 2px;\n\tpadding: 4px 8px;\n}\n\n.notectl-toolbar[hidden] {\n\tdisplay: none;\n}\n\n/* Group wrapper — real flex container so consumers can style it via ::part(toolbar-group)\n with padding/background/border directly. Group gap mirrors the toolbar gap so the\n visual rhythm between buttons stays uniform whether or not a group boundary lies between them. */\n.notectl-toolbar-group {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 2px;\n}\n\n.notectl-toolbar-group--overflow-hidden {\n\tdisplay: none;\n}\n\n.notectl-toolbar-btn {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 32px;\n\theight: 32px;\n\tborder: 1px solid transparent;\n\tborder-radius: 4px;\n\tbackground: var(--notectl-toolbar-button-bg, transparent);\n\tcursor: pointer;\n\tcolor: var(--notectl-toolbar-button-fg, var(--notectl-fg));\n\tfont-size: 14px;\n\tline-height: 1;\n\tpadding: 0;\n\tflex-shrink: 0;\n\ttransition: background 0.1s, border-color 0.1s;\n}\n\n@media (hover: hover) {\n\t.notectl-toolbar-btn:hover {\n\t\tbackground: var(--notectl-toolbar-button-hover-bg, var(--notectl-hover-bg));\n\t\tborder-color: var(--notectl-border);\n\t}\n}\n\n.notectl-toolbar-btn--active {\n\tbackground: var(--notectl-toolbar-button-active-bg, var(--notectl-active-bg));\n\tborder-color: var(--notectl-primary-muted);\n\tcolor: var(--notectl-toolbar-button-active-fg, var(--notectl-primary-fg));\n}\n\n.notectl-toolbar-btn:focus-visible {\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n\toutline: none;\n}\n\n.notectl-toolbar-btn:disabled {\n\topacity: 0.4;\n\tcursor: not-allowed;\n}\n\n@media (hover: hover) {\n\t.notectl-toolbar-btn:disabled:hover {\n\t\tbackground: transparent;\n\t\tborder-color: transparent;\n\t}\n}\n\n.notectl-toolbar-btn__icon {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\tpointer-events: none;\n}\n\n.notectl-toolbar-btn__icon svg {\n\tdisplay: block;\n\twidth: 18px;\n\theight: 18px;\n\tfill: currentColor;\n}\n\n/* Tooltip (rendered as fixed-position element in shadow root) */\n.notectl-toolbar-tooltip {\n\tpadding: 4px 8px;\n\tborder-radius: 4px;\n\tbackground: var(--notectl-tooltip-bg);\n\tcolor: var(--notectl-tooltip-fg);\n\tfont-size: 11px;\n\tfont-weight: 500;\n\twhite-space: nowrap;\n\tpointer-events: none;\n\tz-index: 10001;\n\tline-height: 1.4;\n\tletter-spacing: 0.01em;\n\tfont-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, sans-serif;\n}\n\n.notectl-toolbar-separator {\n\tdisplay: inline-block;\n\twidth: 1px;\n\theight: 20px;\n\tbackground: var(--notectl-border);\n\tmargin: 0 4px;\n\tvertical-align: middle;\n}\n\n/* Toolbar Popups */\n.notectl-toolbar-popup {\n\tbackground: var(--notectl-surface-overlay);\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 6px;\n\tbox-shadow: 0 4px 12px var(--notectl-shadow);\n\toverflow: hidden;\n}\n\n/* Grid Picker */\n.notectl-grid-picker__cell:focus-visible {\n\toutline: 2px solid var(--notectl-focus-ring);\n\toutline-offset: -1px;\n}\n\n.notectl-grid-picker__cell--highlighted {\n\tbackground: var(--notectl-primary-muted);\n\tborder-color: var(--notectl-primary);\n}\n\n/* Dropdown */\n.notectl-dropdown {\n\tmin-width: 160px;\n\tpadding: 4px 0;\n}\n\n.notectl-dropdown__item {\n\tdisplay: flex;\n\talign-items: center;\n\twidth: 100%;\n\tpadding: 8px 12px;\n\ttext-align: start;\n\tborder: none;\n\tbackground: none;\n\tcursor: pointer;\n\tfont-size: 14px;\n\tcolor: var(--notectl-fg);\n\tline-height: 1.4;\n\tfont-family: inherit;\n\twhite-space: nowrap;\n}\n\n@media (hover: hover) {\n\t.notectl-dropdown__item:hover {\n\t\tbackground: var(--notectl-hover-bg);\n\t}\n}\n\n.notectl-dropdown__item:focus-visible {\n\tbackground: var(--notectl-hover-bg);\n\toutline: none;\n}\n\n.notectl-dropdown__item-icon {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 28px;\n\tfont-weight: 600;\n\tcolor: var(--notectl-fg-muted);\n\tflex-shrink: 0;\n}\n\n.notectl-dropdown__item-label {\n\tflex: 1;\n}\n\n/* Overflow behavior: flow mode — toolbar wraps to additional rows */\n.notectl-toolbar[data-overflow="flow"] {\n\tflex-wrap: wrap;\n\toverflow: visible;\n}\n\n/* Overflow behavior: none — toolbar clips without any responsive behavior */\n.notectl-toolbar[data-overflow="none"] {\n\tflex-wrap: nowrap;\n\toverflow: hidden;\n}\n\n/* Overflow: hidden items (burger-menu mode) */\n.notectl-toolbar-btn--overflow-hidden,\n.notectl-toolbar-separator--overflow-hidden {\n\tdisplay: none;\n}\n\n/* Overflow "more" button */\n.notectl-toolbar-overflow-btn {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 32px;\n\theight: 32px;\n\tborder: 1px solid transparent;\n\tborder-radius: 4px;\n\tbackground: transparent;\n\tcursor: pointer;\n\tcolor: var(--notectl-fg);\n\tfont-size: 16px;\n\tline-height: 1;\n\tpadding: 0;\n\tflex-shrink: 0;\n\tmargin-inline-start: auto;\n\ttransition: background 0.1s, border-color 0.1s;\n}\n\n@media (hover: hover) {\n\t.notectl-toolbar-overflow-btn:hover {\n\t\tbackground: var(--notectl-hover-bg);\n\t\tborder-color: var(--notectl-border);\n\t}\n}\n\n.notectl-toolbar-overflow-btn--hidden {\n\tdisplay: none;\n}\n\n.notectl-toolbar-overflow-btn:focus-visible {\n\tbox-shadow: 0 0 0 2px var(--notectl-focus-ring);\n\toutline: none;\n}\n\n/* Dropdown item states shared by all dropdown menus (including overflow) */\n.notectl-dropdown__item:disabled {\n\topacity: 0.4;\n\tcursor: not-allowed;\n}\n\n@media (hover: hover) {\n\t.notectl-dropdown__item:disabled:hover {\n\t\tbackground: none;\n\t}\n}\n\n.notectl-dropdown__item--active {\n\tcolor: var(--notectl-primary-fg);\n}\n\n.notectl-dropdown__item-icon svg {\n\tdisplay: block;\n\twidth: 16px;\n\theight: 16px;\n\tfill: currentColor;\n}\n\n.notectl-dropdown__separator {\n\theight: 1px;\n\tbackground: var(--notectl-border);\n\tmargin: 4px 0;\n}\n\n/* Combobox-style toolbar buttons (shared base for font, fontSize, heading, etc.) */\n.notectl-toolbar-btn[role="combobox"] {\n\twidth: auto;\n\tpadding: 0 8px;\n\tgap: 4px;\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 4px;\n\tbackground: var(--notectl-toolbar-bg, var(--notectl-surface-raised));\n}\n\n@media (hover: hover) {\n\t.notectl-toolbar-btn[role="combobox"]:hover {\n\t\tbackground: var(--notectl-hover-bg);\n\t\tborder-color: var(--notectl-fg-muted);\n\t}\n}\n\n.notectl-toolbar-btn[role="combobox"].notectl-toolbar-btn--active {\n\tbackground: var(--notectl-toolbar-bg, var(--notectl-surface-raised));\n\tborder-color: var(--notectl-primary-muted);\n}\n\n.notectl-toolbar-combobox__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: start;\n\tline-height: 30px;\n}\n\n.notectl-toolbar-combobox__arrow {\n\tflex-shrink: 0;\n\tfont-size: 11px;\n\tcolor: var(--notectl-fg-muted);\n\tline-height: 30px;\n}\n\n/* Link Popup */\n.notectl-link-popup {\n\tpadding: 8px;\n\tmin-width: 200px;\n}\n\n.notectl-link-popup__input {\n\twidth: 100%;\n\tpadding: 4px;\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 4px;\n\tfont-size: 13px;\n\tcolor: var(--notectl-fg);\n\tbackground: var(--notectl-surface-overlay);\n}\n\n.notectl-link-popup__input:focus-visible {\n\toutline: 2px solid var(--notectl-focus-ring);\n\toutline-offset: -1px;\n}\n\n.notectl-link-popup__button {\n\twidth: 100%;\n\tpadding: 6px 12px;\n\tcursor: pointer;\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 4px;\n\tbackground: var(--notectl-surface-overlay);\n\tcolor: var(--notectl-fg);\n\tfont-size: 13px;\n}\n\n.notectl-link-popup__button--apply {\n\tmargin-top: 4px;\n}\n\n@media (hover: hover) {\n\t.notectl-link-popup__button:hover {\n\t\tbackground: var(--notectl-hover-bg);\n\t}\n}\n\n.notectl-link-popup__button:focus-visible {\n\toutline: 2px solid var(--notectl-focus-ring);\n\toutline-offset: -1px;\n}\n'),this.context=t,this.popupManager=new h(t.getContainer()),t.registerService(u,this.popupManager),this.popupController=new L(()=>this.getActiveElement(),this.locale),this.popupController.setPopupManager(this.popupManager),this.tooltip=new I(()=>this.popupController?.isOpen()??!1),t.registerService(T,{refresh:()=>this.updateButtonStates(t.getState()),closePopup:()=>this.popupController?.close()}),this.createToolbarElement()}getOverflowBehavior(){return this.overflowBehavior}setOverflowBehavior(t){t!==this.overflowBehavior&&(this.overflowBehavior=t,this.applyOverflowBehavior(),this.renderItems())}onReady(){this.renderItems()}destroy(){this.overflowController?.destroy(),this.overflowController=null,this.popupController?.destroy(),this.popupController=null,this.popupManager?.destroy(),this.popupManager=null,this.tooltip?.destroy(),this.tooltip=null,this.toolbarElement&&(this.toolbarElement.remove(),this.toolbarElement=null),this.buttons=[],this.visibleElements=[],this.context=null}onStateChange(t,e,o){this.updateButtonStates(e)}onReadOnlyChange(t){this.toolbarElement&&(this.toolbarElement.hidden=t)}onConfigure(t){for(const[e,o]of Object.entries(t))!1===o?this.hiddenItems.add(e):this.hiddenItems.delete(e);this.renderItems()}createToolbarElement(){if(!this.context)return;this.toolbarElement&&this.toolbarElement.remove(),this.buttons=[];const t=this.context.getPluginContainer("top");this.toolbarElement=document.createElement("div"),this.toolbarElement.setAttribute("role","toolbar"),this.toolbarElement.setAttribute("aria-label",this.locale.formattingOptionsAria),this.toolbarElement.setAttribute("data-notectl-no-print",""),this.toolbarElement.setAttribute("part","toolbar"),this.toolbarElement.className="notectl-toolbar",this.toolbarElement.addEventListener("keydown",t=>this.handleToolbarKeydown(t)),this.applyOverflowBehavior(),t.appendChild(this.toolbarElement)}applyOverflowBehavior(){this.toolbarElement&&this.context&&(this.overflowController?.destroy(),this.overflowController=null,this.toolbarElement.setAttribute("data-overflow",this.overflowBehavior),this.overflowBehavior===w.BurgerMenu?this.overflowController=new k({toolbar:this.toolbarElement,ariaLabel:this.locale.moreToolsAria,context:this.context,popupManager:this.popupManager??void 0,onOverflowChange:(t,e)=>{this.visibleElements=e?[...t,e]:[...t],this.initRovingTabindex()},onItemActivated:(t,e)=>{this.activateButton(t,e)},getActiveElement:()=>this.getActiveElement()}):this.visibleElements=[])}renderItems(){if(this.context&&this.toolbarElement){for(const t of this.buttons)t.element.remove();this.buttons=[];for(const t of this.toolbarElement.querySelectorAll(".notectl-toolbar-separator"))t.remove();for(const t of this.toolbarElement.querySelectorAll(".notectl-toolbar-group"))t.remove();this.layoutConfig?this.renderItemsByLayout():this.renderItemsByGroup(),this.buttons.length>0&&!this.toolbarElement.parentElement&&this.context.getPluginContainer("top").appendChild(this.toolbarElement),this.overflowController?.update(this.buttons),this.initRovingTabindex(),this.updateButtonStates(this.context.getState())}}createGroupWrapper(t){const e=document.createElement("div");return e.className="notectl-toolbar-group",e.setAttribute("part","toolbar-group"),void 0!==t&&(e.setAttribute("role","group"),e.setAttribute("aria-label",t)),e}getTabElements(){return this.visibleElements.length>0?this.visibleElements:this.buttons.map(t=>t.element)}initRovingTabindex(){const t=this.getTabElements(),e=m(t);this.focusedIndex=e>=0?e:0,a(t,this.focusedIndex)}setRovingFocus(t){const e=this.getTabElements();t<0||t>=e.length||(this.focusedIndex=t,a(e,t),e[t]?.focus())}getActiveElement(){const t=this.toolbarElement?.getRootNode();return t instanceof ShadowRoot?t.activeElement:document.activeElement}syncFocusedIndex(){const t=this.getActiveElement(),e=this.getTabElements().findIndex(e=>e===t);e>=0&&(this.focusedIndex=e)}handleToolbarKeydown(e){const o=this.getTabElements();var n;if(0!==o.length)switch(this.syncFocusedIndex(),e.key){case"ArrowRight":case"ArrowLeft":{e.preventDefault();const r=(n=!!this.toolbarElement&&t(this.toolbarElement),"ArrowRight"===e.key?n?-1:1:n?1:-1),i=function(t,e,o){const n=t.length;if(0===n)return-1;let r=e;for(let i=0;i<n;i++)if(r=(r+o+n)%n,!t[r]?.disabled)return r;return e}(o,this.focusedIndex,r);this.setRovingFocus(i);break}case"Home":{e.preventDefault();const t=m(o);t>=0&&this.setRovingFocus(t);break}case"End":{e.preventDefault();const t=function(t){for(let e=t.length-1;e>=0;e--)if(!t[e]?.disabled)return e;return-1}(o);t>=0&&this.setRovingFocus(t);break}case"Enter":case" ":{e.preventDefault();const t=o[this.focusedIndex],n=this.buttons.find(e=>e.element===t);n&&this.activateButton(n.element,n.item);break}}}activateButton(t,e){this.tooltip?.hide(),e.popupType&&this.context?this.popupController?.toggle(t,e,this.context):this.context?.executeCommand(e.command)}renderItemsByLayout(){if(!this.context||!this.toolbarElement||!this.layoutConfig)return;const t=this.context.getToolbarRegistry();let e=!0;for(const o of this.layoutConfig.groups){const{plugins:n,label:r}=P(o),i=[];for(const e of n){const o=t.getToolbarItemsByPlugin(e).filter(t=>!this.hiddenItems.has(t.id));i.push(...o)}if(0===i.length)continue;e||this.toolbarElement.appendChild(B()),e=!1;const l=this.createGroupWrapper(r);for(const t of i){const e=this.createButton(t);l.appendChild(e.element),this.buttons.push(e)}this.toolbarElement.appendChild(l)}0===this.buttons.length&&this.toolbarElement.remove()}renderItemsByGroup(){if(!this.context||!this.toolbarElement)return;const t=this.context.getToolbarRegistry().getToolbarItems().filter(t=>!this.hiddenItems.has(t.id));if(0===t.length)return void this.toolbarElement.remove();const e=/* @__PURE__ */new Map;for(const n of t){const t=e.get(n.group)??[];t.push(n),e.set(n.group,t)}let o=!0;for(const[,n]of e){o||this.toolbarElement.appendChild(B()),o=!1;const t=this.createGroupWrapper(void 0);for(const e of n){const o=this.createButton(e);t.appendChild(o.element),this.buttons.push(o)}this.toolbarElement.appendChild(t)}}createButton(t){const e=document.createElement("button");e.type="button",e.className=`notectl-toolbar-btn notectl-toolbar-btn--${t.id}`,e.setAttribute("aria-pressed","false"),e.setAttribute("aria-label",t.label),e.setAttribute("data-toolbar-item",t.id),e.setAttribute("data-tooltip",t.tooltip??t.label),e.setAttribute("part","toolbar-button");let o=null;if("combobox"===t.popupType){e.setAttribute("role","combobox"),e.setAttribute("aria-haspopup","listbox"),e.setAttribute("aria-expanded","false");const n=document.createElement("span");n.className="notectl-toolbar-combobox__label";const r=this.context?.getState();r&&(n.textContent=t.getLabel(r)),e.appendChild(n),o=n;const i=document.createElement("span");i.className="notectl-toolbar-combobox__arrow",i.setAttribute("aria-hidden","true"),i.textContent="▾",e.appendChild(i)}else{t.popupType&&(e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-expanded","false"));const o=document.createElement("span");o.className="notectl-toolbar-btn__icon",o.innerHTML=t.icon,e.appendChild(o)}return e.addEventListener("mousedown",o=>{o.preventDefault(),this.activateButton(e,t)}),e.addEventListener("mouseenter",()=>this.tooltip?.show(e)),e.addEventListener("mouseleave",()=>this.tooltip?.hide()),e.addEventListener("focus",()=>this.tooltip?.show(e)),e.addEventListener("blur",()=>this.tooltip?.hide()),{element:e,item:t,comboLabelEl:o}}updateButtonStates(t){for(const e of this.buttons){const o=e.item.isActive?.(t)??!1,n=e.item.isEnabled?.(t)??!0;if(e.element.setAttribute("aria-pressed",String(o)),e.element.classList.toggle("notectl-toolbar-btn--active",o),e.element.setAttribute("part",o?"toolbar-button toolbar-button-active":"toolbar-button"),e.element.disabled=!n,n?e.element.removeAttribute("aria-disabled"):e.element.setAttribute("aria-disabled","true"),e.comboLabelEl&&"combobox"===e.item.popupType&&(e.comboLabelEl.textContent=e.item.getLabel(t)),e.item.getIcon){const o=e.item.getIcon(t),n=e.element.querySelector(".notectl-toolbar-btn__icon");n&&n.innerHTML!==o&&(n.innerHTML=o)}}this.overflowController?.updateItemStates(t)}};export{g as a,f as i,T as n,b as o,w as r,D as t};
2
- //# sourceMappingURL=ToolbarPlugin-DVGrFf8v.mjs.map
@@ -1,2 +0,0 @@
1
- import{S as t,d as e,h as n,i as o}from"./Document-r7vLOAGA.mjs";import{c as i,l as r,o as a,r as l,t as s,u as d}from"./Selection-HYoVFpAx.mjs";import{a as c}from"./TypeBrands-Ch9856Gb.mjs";import{n as u}from"./DomUtils-Bf7JLFlx.mjs";import{n as p,r as h}from"./HTMLUtils-C6B4UT00.mjs";import{s as m}from"./BlockInsertion-6rR9tIGP.mjs";import{t as v}from"./NodeSelectionCommands-Dj4VxLdD.mjs";import{t as f}from"./Platform-ByobkiCc.mjs";import{c as b,r as g}from"./StyleRuntime-BFKu52mS.mjs";import{c as y,o as x}from"./PluginHelpers-KDuTlmXm.mjs";import{t as _}from"./ShortcutFormatting-TwiufqeV.mjs";import{i as w}from"./PopupPositioning-BB97-__N.mjs";import A from"dompurify";var k=/^[A-Za-z0-9_-]{11}$/,C=/^\d+$/,P=/^[A-Za-z0-9]+$/,z=/^[A-Za-z0-9]+$/;function E(t,e){const n=t.indexOf(e);if(-1!==n)return t[n+1]}function L(t,e,n){const o=e.searchParams.get("h")??n;return o&&P.test(o)?{videoId:t,hash:o}:{videoId:t}}var S=[{id:"youtube",label:"YouTube",hostnames:["youtube.com","www.youtube.com","m.youtube.com","music.youtube.com","youtu.be","youtube-nocookie.com","www.youtube-nocookie.com"],embedHostnames:["www.youtube-nocookie.com","youtube-nocookie.com","www.youtube.com","youtube.com"],parse(t){const e=t.hostname.toLowerCase(),n=t.pathname.split("/").filter(Boolean);if("youtu.be"===e){const t=n[0];return t&&k.test(t)?{videoId:t}:null}const o=t.searchParams.get("v");if(o&&k.test(o))return{videoId:o};for(const i of["embed","shorts","live","v"]){const t=E(n,i);if(t&&k.test(t))return{videoId:t}}return null},buildEmbedUrl(t,e){const n=e.privacy?"www.youtube-nocookie.com":"www.youtube.com",o=V({rel:"0",...e.autoplay?{autoplay:"1"}:{}});return`https://${n}/embed/${t.videoId}${o}`},buildWatchUrl:t=>`https://www.youtube.com/watch?v=${t.videoId}`,thumbnailUrl:t=>`https://i.ytimg.com/vi/${t.videoId}/hqdefault.jpg`},{id:"vimeo",label:"Vimeo",hostnames:["vimeo.com","www.vimeo.com","player.vimeo.com"],embedHostnames:["player.vimeo.com"],parse(t){const e=t.pathname.split("/").filter(Boolean),n=E(e,"video");if(n&&C.test(n))return L(n,t,void 0);const o=e.find(t=>C.test(t));return o?L(o,t,e[e.indexOf(o)+1]):null},buildEmbedUrl(t,e){const n=V({...t.hash?{h:t.hash}:{},...e.privacy?{dnt:"1"}:{},...e.autoplay?{autoplay:"1"}:{}});return`https://player.vimeo.com/video/${t.videoId}${n}`},buildWatchUrl(t){const e=`https://vimeo.com/${t.videoId}`;return t.hash?`${e}/${t.hash}`:e}},{id:"dailymotion",label:"Dailymotion",hostnames:["dailymotion.com","www.dailymotion.com","geo.dailymotion.com","dai.ly"],embedHostnames:["www.dailymotion.com","geo.dailymotion.com"],parse(t){const e=t.hostname.toLowerCase(),n=t.pathname.split("/").filter(Boolean);if("dai.ly"===e){const t=n[0];return t&&z.test(t)?{videoId:t}:null}const o=E(n,"video");return o&&z.test(o)?{videoId:o}:null},buildEmbedUrl(t,e){const n=V(e.autoplay?{autoplay:"1"}:{});return`https://www.dailymotion.com/embed/video/${t.videoId}${n}`},buildWatchUrl:t=>`https://www.dailymotion.com/video/${t.videoId}`,thumbnailUrl:t=>`https://www.dailymotion.com/thumbnail/video/${t.videoId}`}];function I(t,e=S){const n=B(t);if(!n)return null;if("https:"!==n.protocol&&"http:"!==n.protocol)return null;const o=n.hostname.toLowerCase();for(const i of e){if(!i.hostnames.includes(o))continue;const t=i.parse(n);if(t)return{provider:i.id,videoId:t.videoId,...t.hash?{hash:t.hash}:{}}}return null}function R(t,e=S){return e.find(e=>e.id===t)}function $(t,e){const n=R(t.provider,e);return n?n.buildWatchUrl(t):null}function N(t,e){return R(t.provider,e)?.thumbnailUrl?.(t)}function H(t,e=S){return R(t,e)?.label??t}function B(t){try{return new URL(t.trim())}catch{return null}}function V(t){const e=Object.entries(t);return 0===e.length?"":`?${e.map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&")}`}var M={growWidth:"Mod-Shift-ArrowRight",shrinkWidth:"Mod-Shift-ArrowLeft",growWidthLarge:"Mod-Shift-Alt-ArrowRight",shrinkWidthLarge:"Mod-Shift-Alt-ArrowLeft",resetSize:"Mod-Shift-0"},W={providers:S,facade:!0,useProviderThumbnail:!1,privacy:!0,allowedAspectRatios:["16/9","4/3","1/1","9/16"],defaultAspectRatio:"16/9",defaultWidthPercent:100,minWidthPercent:25,widthStep:10,widthStepLarge:25,resizable:!0},j="video",D=/^\d+(?:\.\d+)?\s*\/\s*\d+(?:\.\d+)?$/;function T(t,e){if(!t||!D.test(t.trim()))return e.defaultAspectRatio;const[n,o]=t.split("/");return`${n?.trim()} / ${o?.trim()}`}function O(t,e){return Number.isFinite(t)?Math.max(e.minWidthPercent,Math.min(100,Math.round(t))):e.defaultWidthPercent}var U=/^[A-Za-z0-9_-]+$/;function F(t){return t.length>0&&t.length<=64&&U.test(t)}function K(t,e){return{provider:t?.provider??"",videoId:t?.videoId??"",...t?.hash?{hash:t.hash}:{},aspectRatio:T(t?.aspectRatio,e),widthPercent:O(t?.widthPercent??e.defaultWidthPercent,e),align:t?.align??"center",title:t?.title??"",...t?.caption?{caption:t.caption}:{},privacy:t?.privacy??e.privacy}}function q(t,e){const n=I(t.url,e.providers);return n?{provider:n.provider,videoId:n.videoId,...n.hash?{hash:n.hash}:{},aspectRatio:T(t.aspectRatio,e),widthPercent:e.defaultWidthPercent,align:"center",title:t.title,...t.caption?{caption:t.caption}:{},privacy:e.privacy}:null}function X(t){return{provider:t.provider,videoId:t.videoId,aspectRatio:t.aspectRatio,widthPercent:t.widthPercent,align:t.align,title:t.title,privacy:t.privacy,...t.hash?{hash:t.hash}:{},...t.caption?{caption:t.caption}:{}}}function Z(t){const e=t.selection;if(!r(e))return null;const n=t.getBlock(e.nodeId);if(!n||"video"!==n.type)return null;const o=t.getNodePath(e.nodeId);return o?{block:n,path:o}:null}function G(t,e){const n=t.getState(),o=Z(n);return!!o&&(t.dispatch(n.transaction("command").setNodeAttr(o.path,e).build()),!0)}function Y(t){const e=t.getState(),n=Z(e);if(!n)return!1;const o=v(e,l(n.block.id,n.path));return!!o&&(t.dispatch(o),!0)}var J=0;function Q(t){return`${t}-${J+=1}`}function tt(t,e){const n=Q("notectl-video-field"),o=document.createElement("div");o.className="notectl-video-popup__field";const i=document.createElement("label");i.className="notectl-video-popup__label",i.setAttribute("for",n),i.textContent=e.label,o.appendChild(i);const r=document.createElement("input");r.id=n,r.type=e.type,r.value=e.value,r.placeholder=e.placeholder,r.className="notectl-video-popup__input",r.setAttribute("aria-label",e.ariaLabel),e.required&&r.setAttribute("aria-required","true");const a=[];if(e.hint){const t=`${n}-hint`,i=document.createElement("p");i.id=t,i.className="notectl-video-popup__hint",i.textContent=e.hint,o.appendChild(i),a.push(t)}return e.describedBy&&a.push(e.describedBy),a.length>0&&r.setAttribute("aria-describedby",a.join(" ")),o.insertBefore(r,o.children[1]??null),t.appendChild(o),r}var et=class{context;config;locale;panel=null;outsideHandler=null;constructor(t,e,n){this.context=t,this.config=e,this.locale=n}get isOpen(){return null!==this.panel}openInsert(){this.context.isReadOnly()||this.open({rect:nt(),mode:"insert",label:this.locale.insertDialogLabel,onSubmit:n=>{const a=q(n,this.config);a&&function(n,a){const s=n.getState(),d=s.selection;if(i(d))return!1;const u=X(a),p=r(d)?d.nodeId:d.anchor.blockId,h=function(t,e){if("table_cell"===t.getBlock(e)?.type)return e;const n=t.getNodePath(e);if(n)for(const o of n)if("table_cell"===t.getBlock(o)?.type)return o}(s,p);h?function(n,i,r,a){const s=n.getNodePath(r),d=n.getBlock(r);if(!s||!d)return!1;const u=o(c(j),[],void 0,a),p=n.transaction("command"),h=e(d);for(let e=h.length-1;e>=0;e--){const n=d.children.findIndex(n=>t(n)&&n.id===h[e]?.id);-1!==n&&p.removeNode(s,n)}p.insertNode(s,0,u),p.setSelection(l(u.id,[...s,u.id])),i.dispatch(p.build())}(s,n,h,u):function(t,e,n,i){const r=o(c(j),[],void 0,i),a=t.transaction("command");!!m(t,a,n,r)&&(a.setSelection(l(r.id,[])),e.dispatch(a.build()))}(s,n,p,u)}(this.context,a)}})}openInsertReplacingRange(e,i){this.context.isReadOnly()||this.open({rect:nt(),mode:"insert",label:this.locale.insertDialogLabel,initial:{url:i},onSubmit:i=>{const r=q(i,this.config);r&&function(e,i,r){const a=e.getState(),s=a.getBlock(i.blockId);if(!s)return!1;const d=function(e,n){const o=e.getNodePath(n);if(!o||0===o.length)return null;if(1===o.length){const t=e.doc.children.findIndex(t=>t.id===n);return-1===t?null:{parentPath:[],index:t}}const i=o[o.length-2],r=i?e.getBlock(i):void 0;if(!r)return null;const a=r.children.findIndex(e=>t(e)&&e.id===n);return-1===a?null:{parentPath:o.slice(0,-1),index:a}}(a,i.blockId);if(!d)return!1;const u=0===Math.max(0,n(s).length-(i.end-i.start))&&"paragraph"===s.type,p=o(c(j),[],void 0,X(r)),h=0===d.parentPath.length?[]:[...d.parentPath,p.id],m=a.transaction("command");u?(m.removeNode(d.parentPath,d.index),m.insertNode(d.parentPath,d.index,p),0===d.parentPath.length&&d.index>=a.doc.children.length-1&&m.insertNode([],d.index+1,o(c("paragraph")))):(m.deleteTextAt(i.blockId,i.start,i.end),m.insertNode(d.parentPath,d.index+1,p)),m.setSelection(l(p.id,h)),e.dispatch(m.build())}(this.context,e,r)}})}openEditForSelected(){if(this.context.isReadOnly())return;const t=this.context.getState(),e=t.selection;if(!r(e))return;const n=t.getBlock(e.nodeId);if(!n||"video"!==n.type)return;const o=K(n.attrs,this.config),i={url:$({provider:o.provider,videoId:o.videoId,...o.hash?{hash:o.hash}:{}},this.config.providers)??"",title:o.title,caption:o.caption??"",aspectRatio:o.aspectRatio};this.open({rect:this.videoRect(e.nodeId),mode:"edit",label:this.locale.editDialogLabel,initial:i,onSubmit:t=>{!function(t,e,n){const o=Z(t.getState());if(!o)return!1;const i=I(e.url,n.providers);if(!i)return!1;const r=function(t,e){const n={};for(const[o,i]of Object.entries(t??{}))e.includes(o)||(n[o]=i);return n}(o.block.attrs,["hash","caption"]);r.provider=i.provider,r.videoId=i.videoId,r.title=e.title,r.aspectRatio=T(e.aspectRatio,n),i.hash&&(r.hash=i.hash),e.caption.trim()&&(r.caption=e.caption.trim()),G(t,r)}(this.context,t,this.config)}})}close(t){this.panel&&(this.outsideHandler&&(document.removeEventListener("mousedown",this.outsideHandler,!0),this.outsideHandler=null),this.panel.remove(),this.panel=null,t&&this.context.getContainer().focus())}open(t){this.close(!1);const e=document.createElement("div");e.className="notectl-video-overlay",e.setAttribute("role","dialog"),e.setAttribute("aria-modal","false"),e.setAttribute("aria-label",t.label),this.panel=e,function(t,e){const{config:n,locale:o,initial:i,mode:r}=e;t.classList.add("notectl-video-popup");const a=Q("notectl-video-error"),l=document.createElement("p");l.id=a,l.className="notectl-video-popup__error",l.setAttribute("role","alert");const s=tt(t,{label:o.urlLabel,ariaLabel:o.urlAria,placeholder:o.urlPlaceholder,value:i?.url??"",type:"url",required:!0,describedBy:a}),d=tt(t,{label:o.titleLabel,ariaLabel:o.titleAria,placeholder:o.titlePlaceholder,value:i?.title??"",type:"text",required:!0,hint:o.titleHint}),c=tt(t,{label:o.captionLabel,ariaLabel:o.captionAria,placeholder:o.captionPlaceholder,value:i?.caption??"",type:"text"}),u=function(t,e,n,o){const i=Q("notectl-video-field"),r=document.createElement("div");r.className="notectl-video-popup__field";const a=document.createElement("label");a.className="notectl-video-popup__label",a.setAttribute("for",i),a.textContent=n.aspectRatioLabel,r.appendChild(a);const l=document.createElement("select");l.id=i,l.className="notectl-video-popup__select",l.setAttribute("aria-label",n.aspectRatioAria);const s=e.allowedAspectRatios.includes(o)?e.allowedAspectRatios:[o,...e.allowedAspectRatios];for(const d of s){const t=document.createElement("option");t.value=d,t.textContent=d,d===o&&(t.selected=!0),l.appendChild(t)}return r.appendChild(l),t.appendChild(r),l}(t,n,o,i?.aspectRatio??n.defaultAspectRatio);t.appendChild(l);const p=document.createElement("div");p.className="notectl-video-popup__actions";const h=document.createElement("button");h.type="button",h.className="notectl-video-popup__cancel",h.textContent=o.cancelButton;const m=document.createElement("button");m.type="button",m.className="notectl-video-popup__submit",m.textContent="edit"===r?o.updateButton:o.insertButton,m.setAttribute("aria-label","edit"===r?o.updateAria:o.insertAria),p.append(h,m),t.appendChild(p);const v=(t,e)=>{l.textContent=t,e.focus()},f=()=>{const t=s.value.trim();if(!I(t,n.providers))return void v(o.invalidUrl,s);const i=d.value.trim();i?(l.textContent="",e.onSubmit({url:t,title:i,caption:c.value.trim(),aspectRatio:u.value}),e.onClose()):v(o.titleRequired,d)};h.addEventListener("mousedown",t=>t.preventDefault()),h.addEventListener("click",t=>{t.preventDefault(),e.onClose()}),m.addEventListener("mousedown",t=>t.preventDefault()),m.addEventListener("click",t=>{t.preventDefault(),f()});for(const b of[s,d,c])b.addEventListener("keydown",t=>{"Enter"===t.key&&(t.preventDefault(),f())});requestAnimationFrame(()=>s.focus())}(e,{mode:t.mode,initial:t.initial,config:this.config,locale:this.locale,onSubmit:t.onSubmit,onClose:()=>this.close(!0)}),e.addEventListener("keydown",t=>{"Escape"===t.key&&(t.preventDefault(),t.stopPropagation(),this.close(!0))}),this.context.getPluginContainer("top").appendChild(e),w(e),function(t,e){const n=e?e.bottom:window.innerHeight/3,o=e?e.left:window.innerWidth/3,i=t.offsetWidth||320,r=window.innerWidth-i-8,a=Math.max(8,Math.min(o,r)),l=window.innerHeight-t.offsetHeight-8,s=Math.min(n+8,Math.max(8,l));t.style.left=`${Math.round(a)}px`,t.style.top=`${Math.round(s)}px`}(e,t.rect),this.installOutsideHandler()}videoRect(t){const e=this.context.getContainer().querySelector(`[data-block-id="${t}"]`);return e?e.getBoundingClientRect():null}installOutsideHandler(){const t=t=>{this.panel&&!t.composedPath().includes(this.panel)&&this.close(!1)};this.outsideHandler=t,requestAnimationFrame(()=>{this.outsideHandler&&document.addEventListener("mousedown",t,!0)})}};function nt(){const t=window.getSelection();if(!t||0===t.rangeCount)return null;const e=t.getRangeAt(0).getBoundingClientRect();return 0===e.width&&0===e.height&&0===e.top&&0===e.left?null:e}var ot={insertVideo:"Insert Video",insertVideoTooltip:"Insert Video",urlLabel:"Video URL",urlPlaceholder:"https://www.youtube.com/watch?v=...",urlAria:"Video URL",titleLabel:"Title",titlePlaceholder:"Describe the video",titleAria:"Video title",titleHint:"Describes the video for screen readers. Required.",captionLabel:"Caption",captionPlaceholder:"Optional visible caption",captionAria:"Video caption",aspectRatioLabel:"Aspect ratio",aspectRatioAria:"Video aspect ratio",insertButton:"Insert",insertAria:"Insert video",updateButton:"Update",updateAria:"Update video",cancelButton:"Cancel",insertDialogLabel:"Insert video",editDialogLabel:"Edit video",invalidUrl:"Enter a YouTube, Vimeo, or Dailymotion video URL.",titleRequired:"Enter a title so screen readers can describe the video.",play:t=>t?`Play video: ${t}`:"Play video",loading:"Loading video...",providerBadge:t=>`${t} video`,closePlayer:"Close video player",videoAria:(t,e)=>e?`${t} video: ${e}`:`${t} video`,videoSelected:"Video selected.",videoSelectedWithTitle:t=>`Video selected: ${t}.`,resizeHint:(t,e)=>`${t} / ${e} to resize.`,keyboardResizeHint:(t,e)=>`${t} / ${e} to resize`,videoResized:t=>`Video resized to ${t} percent width.`,resetToDefaultSize:"Video reset to full width.",enteredPlayer:t=>t?`Playing ${t}. Press Escape to return to the document.`:"Playing video. Press Escape to return to the document.",exitedPlayer:"Returned to the document.",videoOptions:"Video options",editVideo:"Edit video",alignStart:"Align left",alignCenter:"Align center",alignEnd:"Align right",deleteVideo:"Delete video",embedPrompt:"Embed this video?",embedConfirm:"Embed",embedDismiss:"Keep as link",embedOfferAnnounce:t=>`${t} link pasted. Press Embed to turn it into a video, or continue editing to keep it as a link.`,embeddedAnnounce:"Video embedded."},it=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar--O0A9OTR.mjs"),"./locales/de.ts":()=>import("./de-BxQIt_1Y.mjs"),"./locales/es.ts":()=>import("./es-BQweZX6P.mjs"),"./locales/fr.ts":()=>import("./fr-C3EKRThN.mjs"),"./locales/hi.ts":()=>import("./hi-L6pJxZam.mjs"),"./locales/pt.ts":()=>import("./pt-Bb908r0n.mjs"),"./locales/ru.ts":()=>import("./ru-DkW9XZFy.mjs"),"./locales/zh.ts":()=>import("./zh-ikm3rSTR.mjs")});async function rt(t){return y(it,t,ot)}var at={start:"notectl-video--start",center:"notectl-video--center",end:"notectl-video--end"};function lt(t,e){for(const o of Object.values(at))t.classList.remove(o);const n=at[e]??at.center;t.classList.add(n)}function st(t,e,n){b(t,"aspect-ratio",e),b(t,"width",`${n}%`)}var dt=/^[A-Za-z0-9]+$/;function ct(t){return{provider:t.provider,videoId:t.videoId,...t.hash?{hash:t.hash}:{}}}function ut(t,e){const n=Number.parseFloat(t.getAttribute("width")??""),o=Number.parseFloat(t.getAttribute("height")??"");return Number.isFinite(n)&&Number.isFinite(o)&&n>0&&o>0?T(`${n}/${o}`,e):e.defaultAspectRatio}function pt(t,e,n){const o=function(t,e,n){const o=R(t.provider,e);return o?o.buildEmbedUrl(t,n):null}({provider:t.provider,videoId:t.videoId,...t.hash?{hash:t.hash}:{}},e.providers,{privacy:t.privacy,autoplay:!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches})??"",i=document.createElement("iframe");return i.className="notectl-video__iframe",i.setAttribute("src",o),i.setAttribute("title",t.title||n.providerBadge(H(t.provider,e.providers))),i.setAttribute("allow","autoplay; fullscreen; picture-in-picture; encrypted-media"),i.setAttribute("allowfullscreen","true"),i.setAttribute("referrerpolicy","no-referrer"),i.setAttribute("loading","lazy"),i.setAttribute("frameborder","0"),i}var ht=class{frame;getAttrs;config;locale;announce;facadeButton=null;player=null;iframe=null;escapeHandler=null;renderedKey="";constructor(t){this.frame=t.frame,this.getAttrs=t.getAttrs,this.config=t.config,this.locale=t.locale,this.announce=t.announce,this.renderFacade()}get isActive(){return null!==this.player}facadeKey(t){return[t.provider,t.videoId,t.hash??"",t.privacy,t.title,this.config.useProviderThumbnail].join("|")}renderFacade(){this.facadeButton?.remove();const t=this.getAttrs();this.renderedKey=this.facadeKey(t);const e=document.createElement("button");e.type="button",e.className="notectl-video__facade",e.setAttribute("aria-label",this.locale.play(t.title));const n=document.createElement("span");if(n.className="notectl-video__poster",n.setAttribute("aria-hidden","true"),this.config.useProviderThumbnail){const e=N({provider:t.provider,videoId:t.videoId},this.config.providers);e&&b(n,"background-image",`url("${e}")`)}const o=document.createElement("span");o.className="notectl-video__play-icon",o.setAttribute("aria-hidden","true"),o.innerHTML='<svg viewBox="0 0 68 48" width="48" height="34" aria-hidden="true" focusable="false"><path d="M66.5 7.7c-.8-2.9-2.5-5.4-5.4-6.2C55.8.1 34 0 34 0S12.2.1 6.9 1.5C4 2.3 2.3 4.8 1.5 7.7.1 13 0 24 0 24s.1 11 1.5 16.3c.8 2.9 2.5 5.4 5.4 6.2C12.2 47.9 34 48 34 48s21.8-.1 27.1-1.5c2.9-.8 4.6-3.3 5.4-6.2C67.9 35 68 24 68 24s-.1-11-1.5-16.3z" fill="currentColor"/><path d="M45 24 27 14v20z" fill="#fff"/></svg>';const i=document.createElement("span");i.className="notectl-video__badge",i.setAttribute("aria-hidden","true"),i.textContent=this.locale.providerBadge(H(t.provider,this.config.providers)),e.append(n,o,i),e.addEventListener("mousedown",t=>t.stopPropagation()),e.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation(),this.activate()}),this.facadeButton=e,this.frame.insertBefore(e,this.frame.firstChild)}update(){const t=this.getAttrs(),e=this.facadeKey(t);if(e!==this.renderedKey){if(this.renderedKey=e,this.isActive&&this.iframe){const e=pt(t,this.config,this.locale);return this.iframe.replaceWith(e),void(this.iframe=e)}this.renderFacade()}}activate(){if(this.isActive||!this.facadeButton)return;const t=this.getAttrs(),e=document.createElement("div");e.className="notectl-video__player";const n=document.createElement("button");n.type="button",n.className="notectl-video__exit",n.setAttribute("aria-label",this.locale.closePlayer),n.innerHTML='<svg viewBox="0 0 24 24" width="20" height="20" aria-hidden="true" focusable="false"><path d="M19 6.4 17.6 5 12 10.6 6.4 5 5 6.4 10.6 12 5 17.6 6.4 19 12 13.4 17.6 19 19 17.6 13.4 12z" fill="currentColor"/></svg>',n.addEventListener("mousedown",t=>t.stopPropagation()),n.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation(),this.deactivate(!0)});const o=pt(t,this.config,this.locale);e.append(n,o),this.facadeButton.remove(),this.facadeButton=null,this.frame.insertBefore(e,this.frame.firstChild),this.player=e,this.iframe=o,this.escapeHandler=t=>{"Escape"===t.key&&(t.stopPropagation(),this.deactivate(!0))},this.frame.addEventListener("keydown",this.escapeHandler),o.focus(),this.announce(this.locale.enteredPlayer(t.title))}deactivate(t){this.player&&(this.escapeHandler&&(this.frame.removeEventListener("keydown",this.escapeHandler),this.escapeHandler=null),this.player.remove(),this.player=null,this.iframe=null,this.renderFacade(),t&&this.facadeButton?.focus(),this.announce(this.locale.exitedPlayer))}destroy(){this.escapeHandler&&(this.frame.removeEventListener("keydown",this.escapeHandler),this.escapeHandler=null),this.player?.remove(),this.player=null,this.iframe=null,this.facadeButton?.remove(),this.facadeButton=null}},mt=["w","e"],vt={w:-1,e:1},ft=null;function bt(){ft?.remove(),ft=null}function gt(t,e,n,o,i,r){let a=0,l=0,s=0,d=0,c=vt[e];const u=t=>{const e=(t.clientX-a)*c;var n,r;n=l+(s>0?e/s*100:0),r=i.minPercent,d=Math.max(r,Math.min(100,n)),i.applyLiveWidth(d),o.textContent=i.formatPercent(Math.round(d))},p=t=>{document.removeEventListener("pointermove",u),document.removeEventListener("pointerup",p),n.classList.remove("notectl-video__resize-overlay--active"),o.classList.remove("notectl-video__size-indicator--visible"),bt(),i.commit(Math.round(d)),t.target?.releasePointerCapture?.(t.pointerId)};r(()=>{document.removeEventListener("pointermove",u),document.removeEventListener("pointerup",p)}),t.addEventListener("pointerdown",t=>{t.preventDefault(),t.stopPropagation(),a=t.clientX,l=i.getWidthPercent(),d=l,s=i.getReferenceWidth(),c=i.isRtl()?-vt[e]:vt[e],n.classList.add("notectl-video__resize-overlay--active"),o.textContent=i.formatPercent(Math.round(l)),o.classList.add("notectl-video__size-indicator--visible"),function(t){bt(),ft=document.createElement("style");const e=g(t);e&&ft.setAttribute("nonce",e),ft.textContent="*{cursor:ew-resize!important;user-select:none!important}",document.head.appendChild(ft)}(n),t.target.setPointerCapture(t.pointerId),document.addEventListener("pointermove",u),document.addEventListener("pointerup",p)})}function yt(t,e,n){const o=document.createElement("button");return o.type="button",o.className="notectl-video__tool",o.setAttribute("aria-label",t),o.title=t,o.innerHTML=e,o.addEventListener("mousedown",t=>t.preventDefault()),o.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation(),n()}),o}function xt(t){const{config:e,locale:n,resolvedKeymap:o,announce:i,actions:r}=t;return(t,a,l)=>{const s=document.createElement("figure");s.className="notectl-video",s.setAttribute("data-block-id",t.id),s.setAttribute("data-void","true"),s.setAttribute("data-selectable","true");const d=document.createElement("div");d.className="notectl-video__frame",s.appendChild(d);let c=t.id,u=K(t.attrs,e),p=null,h=null,m=null;const v=new ht({frame:d,getAttrs:()=>u,config:e,locale:n,announce:i});function g(t){var o;u=K(t.attrs,e),st(d,u.aspectRatio,u.widthPercent),lt(s,u.align),s.setAttribute("aria-label",n.videoAria(H(u.provider,e.providers),u.title)),(o=u.caption)?(p||(p=document.createElement("figcaption"),p.className="notectl-video__caption",s.appendChild(p)),p.textContent!==o&&(p.textContent=o)):p&&(p.remove(),p=null),v.update(),m?.update(u.align)}function y(){h&&(h.destroy(),h.element.remove(),h=null)}return g(t),{dom:s,contentDOM:null,update:t=>"video"===t.type&&(c=t.id,s.setAttribute("data-block-id",t.id),g(t),!0),selectNode(){s.classList.add("notectl-video--selected"),e.resizable&&!h&&(h=function(t,e){const n=document.createElement("div");n.className="notectl-video__resize-overlay",n.setAttribute("data-notectl-no-print","");const o=document.createElement("div");o.className="notectl-video__size-indicator",n.appendChild(o);let i=null;for(const r of mt){const e=document.createElement("div");e.className=`notectl-video__resize-handle notectl-video__resize-handle--${r}`,e.setAttribute("aria-hidden","true"),gt(e,r,n,o,t,t=>{i=t}),n.appendChild(e)}if(e){const t=document.createElement("div");t.className="notectl-video__keyboard-hint",t.setAttribute("aria-hidden","true"),t.textContent=e,n.appendChild(t)}return{element:n,destroy(){i?.(),bt()}}}({minPercent:e.minWidthPercent,getWidthPercent:()=>u.widthPercent,getReferenceWidth:()=>s.clientWidth||d.clientWidth,isRtl:()=>"rtl"===f(s),applyLiveWidth:t=>b(d,"width",`${t}%`),commit:t=>function(t){const e=a(),n=e.getBlock(c);if(!n)return;const o=e.getNodePath(c);if(!o)return;const i={...n.attrs??{},widthPercent:t};l(e.transaction("command").setNodeAttr(o,i).build())}(t),formatPercent:t=>`${t}%`},function(t,e){const n=t.shrinkWidth??null,o=t.growWidth??null;return n&&o?e.keyboardResizeHint(_(n),_(o)):""}(o,n)),d.appendChild(h.element)),m||(m=function(t){const{locale:e,actions:n}=t,o=document.createElement("div");o.className="notectl-video__toolbar",o.setAttribute("role","toolbar"),o.setAttribute("aria-label",e.videoOptions),o.setAttribute("data-notectl-no-print",""),o.addEventListener("mousedown",t=>t.stopPropagation());const i=yt(e.editVideo,'<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a1 1 0 0 0 0-1.41l-2.34-2.34a1 1 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z" fill="currentColor"/></svg>',()=>n.edit()),r={start:yt(e.alignStart,'<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3 4h18v2H3V4zm0 7h12v2H3v-2zm0 7h18v2H3v-2zm0-3.5h12v-2H3v2z" fill="currentColor"/></svg>',()=>n.align("start")),center:yt(e.alignCenter,'<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3 4h18v2H3V4zm3 7h12v2H6v-2zm-3 7h18v2H3v-2zm3-3.5h12v-2H6v2z" fill="currentColor"/></svg>',()=>n.align("center")),end:yt(e.alignEnd,'<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3 4h18v2H3V4zm6 7h12v2H9v-2zm-6 7h18v2H3v-2zm6-3.5h12v-2H9v2z" fill="currentColor"/></svg>',()=>n.align("end"))},a=yt(e.deleteVideo,'<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6 19a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z" fill="currentColor"/></svg>',()=>n.remove()),l=()=>{const t=document.createElement("span");return t.className="notectl-video__tool-separator",t.setAttribute("aria-hidden","true"),t};o.append(i,l(),r.start,r.center,r.end,l(),a);const s=t=>{for(const e of["start","center","end"]){const n=e===t;r[e].classList.toggle("notectl-video__tool--active",n),r[e].setAttribute("aria-pressed",n?"true":"false")}};return s(t.initialAlign),{element:o,update:s,destroy(){o.remove()}}}({locale:n,actions:r,initialAlign:u.align}),s.appendChild(m.element))},deselectNode(){s.classList.remove("notectl-video--selected"),y(),m?.destroy(),m=null},destroy(){y(),m?.destroy(),m=null,v.destroy()}}}}function _t(t){return(e,n,o)=>{const i=function(t,e,n){const o=t.trim();if(o&&!/\s/.test(o)){const t=I(o,n);if(t)return{url:o,match:t}}const i=function(t){if(!t)return null;const e=function(t){const e=document.createElement("template");return e.innerHTML=t,e.content}(t),n=e.querySelector("iframe");if(!n)return null;const o=e.cloneNode(!0);for(const i of Array.from(o.querySelectorAll("iframe")))i.remove();return""!==(o.textContent??"").trim()?null:n.getAttribute("src")}(e);if(i){const t=I(i,n);if(t)return{url:$(t,n)??i,match:t}}return null}(e,n,t.providers);if(!i)return null;const r=o.selection;if(!d(r)||!a(r))return null;const l=r.anchor.blockId,c=r.anchor.offset,u=c+i.url.length,p=o.transaction("paste").insertText(l,c,i.url,[]).setSelection(s(l,u)).build();return t.onOffer({blockId:l,start:c,end:u},i.match),p}}var wt=0,At=/* @__PURE__ */new Set,kt=null;var Ct=class{id="video";name="Video";priority=47;config;resolvedKeymap;context=null;locale=ot;overlay=null;embedPrompt=null;constructor(t){this.config={...W,...t},this.resolvedKeymap={...M,...t?.keymap}}async init(t){this.context=t,this.locale=await x(t,this.config.locale,ot,rt),t.registerStyleSheet('\n.notectl-video {\n\tmargin: 12px 0;\n\tposition: relative;\n\tuser-select: none;\n}\n\n.notectl-video--center { text-align: center; }\n.notectl-video--start { text-align: start; }\n.notectl-video--end { text-align: end; }\n\n.notectl-video__frame {\n\tdisplay: inline-block;\n\tposition: relative;\n\twidth: 100%;\n\tmax-width: 100%;\n\tvertical-align: top;\n\toverflow: hidden;\n\tborder-radius: 8px;\n\tbackground: #000;\n\ttext-align: start;\n}\n\n/* Facade (click-to-load) */\n.notectl-video__facade {\n\tposition: absolute;\n\tinset: 0;\n\twidth: 100%;\n\theight: 100%;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tpadding: 0;\n\tborder: 0;\n\tcursor: pointer;\n\tbackground: #14181c;\n\tcolor: #fff;\n}\n\n.notectl-video__facade:focus-visible {\n\toutline: 3px solid var(--notectl-primary);\n\toutline-offset: -3px;\n}\n\n.notectl-video__poster {\n\tposition: absolute;\n\tinset: 0;\n\tbackground-size: cover;\n\tbackground-position: center;\n\tbackground-repeat: no-repeat;\n}\n\n.notectl-video__poster::after {\n\tcontent: "";\n\tposition: absolute;\n\tinset: 0;\n\tbackground: rgba(0, 0, 0, 0.25);\n}\n\n.notectl-video__play-icon {\n\tposition: relative;\n\tz-index: 1;\n\tdisplay: inline-flex;\n\tfilter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));\n\ttransition: transform 0.12s ease;\n}\n\n.notectl-video__facade:hover .notectl-video__play-icon {\n\ttransform: scale(1.08);\n}\n\n.notectl-video__badge {\n\tposition: absolute;\n\tz-index: 1;\n\tbottom: 8px;\n\tinset-inline-start: 8px;\n\tpadding: 2px 6px;\n\tborder-radius: 4px;\n\tbackground: rgba(0, 0, 0, 0.65);\n\tcolor: #fff;\n\tfont-size: 12px;\n\tfont-weight: 600;\n}\n\n/* Player (activated iframe + exit control) */\n.notectl-video__player {\n\tposition: absolute;\n\tinset: 0;\n}\n\n.notectl-video__iframe {\n\tposition: absolute;\n\tinset: 0;\n\twidth: 100%;\n\theight: 100%;\n\tborder: 0;\n\tdisplay: block;\n}\n\n.notectl-video__exit {\n\tposition: absolute;\n\tz-index: 2;\n\ttop: 6px;\n\tinset-inline-end: 6px;\n\twidth: 28px;\n\theight: 28px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tborder: 0;\n\tborder-radius: 50%;\n\tcursor: pointer;\n\tbackground: rgba(0, 0, 0, 0.65);\n\tcolor: #fff;\n}\n\n.notectl-video__exit:focus-visible {\n\toutline: 2px solid #fff;\n\toutline-offset: 2px;\n}\n\n/* Static fallback link (no-JS / export rehydration) */\n.notectl-video__fallback-link {\n\tposition: absolute;\n\tinset: 0;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tpadding: 8px;\n\tcolor: #fff;\n\ttext-decoration: underline;\n\ttext-align: center;\n}\n\n/* Caption */\n.notectl-video__caption {\n\tmargin-top: 6px;\n\tfont-size: 13px;\n\tcolor: var(--notectl-fg-muted);\n\ttext-align: center;\n}\n\n/* Selection */\n.notectl-video--selected .notectl-video__frame {\n\toutline: 2px solid var(--notectl-primary);\n\toutline-offset: 2px;\n}\n\n/* Resize overlay + side handles */\n.notectl-video__resize-overlay {\n\tposition: absolute;\n\tinset: 0;\n\tpointer-events: none;\n}\n\n.notectl-video__resize-handle {\n\tposition: absolute;\n\ttop: 50%;\n\ttransform: translateY(-50%);\n\twidth: 8px;\n\theight: 44px;\n\tmax-height: 60%;\n\tborder: 2px solid var(--notectl-primary);\n\tborder-radius: 6px;\n\tbackground: var(--notectl-surface-raised);\n\tpointer-events: all;\n\tcursor: ew-resize;\n\tz-index: 2;\n}\n\n.notectl-video__resize-handle--w { inset-inline-start: -5px; }\n.notectl-video__resize-handle--e { inset-inline-end: -5px; }\n\n.notectl-video__size-indicator {\n\tposition: absolute;\n\tbottom: -28px;\n\tleft: 50%;\n\ttransform: translateX(-50%);\n\tpadding: 2px 8px;\n\tborder-radius: 4px;\n\tbackground: var(--notectl-tooltip-bg);\n\tcolor: var(--notectl-tooltip-fg);\n\tfont-size: 11px;\n\tfont-weight: 500;\n\twhite-space: nowrap;\n\tpointer-events: none;\n\topacity: 0;\n\ttransition: opacity 0.15s;\n\tz-index: 3;\n}\n\n.notectl-video__size-indicator--visible { opacity: 1; }\n\n.notectl-video__keyboard-hint {\n\tdisplay: none;\n\tposition: absolute;\n\tbottom: -28px;\n\tleft: 50%;\n\ttransform: translateX(-50%);\n\tpadding: 2px 8px;\n\tfont-size: 11px;\n\tcolor: var(--notectl-fg-muted);\n\twhite-space: nowrap;\n\tpointer-events: none;\n\tz-index: 3;\n}\n\n.notectl-video--selected .notectl-video__keyboard-hint { display: block; }\n.notectl-video__resize-overlay--active ~ .notectl-video__keyboard-hint,\n.notectl-video__resize-overlay--active .notectl-video__keyboard-hint { display: none; }\n\n/* On-selection toolbar */\n.notectl-video__toolbar {\n\tposition: absolute;\n\ttop: -44px;\n\tleft: 50%;\n\ttransform: translateX(-50%);\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 2px;\n\tpadding: 2px;\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 6px;\n\tbackground: var(--notectl-surface-overlay);\n\tbox-shadow: 0 2px 8px var(--notectl-shadow);\n\tz-index: 10;\n}\n\n.notectl-video__tool {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 28px;\n\theight: 28px;\n\tborder: none;\n\tborder-radius: 4px;\n\tbackground: transparent;\n\tcursor: pointer;\n\tcolor: var(--notectl-fg);\n}\n\n.notectl-video__tool:hover { background: var(--notectl-hover-bg); }\n\n.notectl-video__tool--active {\n\tbackground: var(--notectl-active-bg);\n\tcolor: var(--notectl-primary);\n}\n\n.notectl-video__tool:focus-visible {\n\toutline: 2px solid var(--notectl-primary);\n\toutline-offset: 1px;\n}\n\n.notectl-video__tool svg { width: 16px; height: 16px; }\n\n.notectl-video__tool-separator {\n\twidth: 1px;\n\theight: 18px;\n\tmargin: 0 2px;\n\tbackground: var(--notectl-border);\n}\n\n@media (prefers-reduced-motion: reduce) {\n\t.notectl-video__play-icon,\n\t.notectl-video__size-indicator {\n\t\ttransition: none;\n\t}\n}\n\n@media (forced-colors: active) {\n\t.notectl-video__frame { outline: 1px solid CanvasText; }\n\t.notectl-video__facade { border: 1px solid ButtonText; }\n\t.notectl-video__play-icon { forced-color-adjust: none; }\n\t.notectl-video__resize-handle { background: ButtonFace; border-color: ButtonText; }\n\t.notectl-video--selected .notectl-video__frame { outline: 2px solid Highlight; }\n}\n'),t.registerStyleSheet("\n.notectl-video-overlay {\n\tposition: fixed;\n\tz-index: 1000;\n\tbox-sizing: border-box;\n\tmin-width: 300px;\n\tmax-width: 92vw;\n\tpadding: 12px;\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 8px;\n\tbackground: var(--notectl-surface-overlay);\n\tcolor: var(--notectl-fg);\n\tbox-shadow: 0 6px 24px var(--notectl-shadow);\n}\n\n.notectl-video-popup {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n}\n\n.notectl-video-popup__field {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n}\n\n.notectl-video-popup__label {\n\tfont-size: 12px;\n\tfont-weight: 600;\n\tcolor: var(--notectl-fg-muted);\n}\n\n.notectl-video-popup__input,\n.notectl-video-popup__select {\n\twidth: 100%;\n\tpadding: 6px 8px;\n\tbox-sizing: border-box;\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 4px;\n\tbackground: var(--notectl-surface-raised);\n\tcolor: var(--notectl-fg);\n\tfont: inherit;\n}\n\n.notectl-video-popup__input:focus-visible,\n.notectl-video-popup__select:focus-visible {\n\toutline: 2px solid var(--notectl-primary);\n\toutline-offset: 1px;\n}\n\n.notectl-video-popup__hint {\n\tmargin: 0;\n\tfont-size: 11px;\n\tcolor: var(--notectl-fg-muted);\n}\n\n.notectl-video-popup__error:not(:empty) {\n\tmargin: 0;\n\tpadding: 6px 8px;\n\tborder-radius: 4px;\n\tbackground: var(--notectl-danger-muted);\n\tcolor: var(--notectl-danger);\n\tfont-size: 12px;\n}\n\n.notectl-video-popup__actions {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\tgap: 8px;\n\tmargin-top: 2px;\n}\n\n.notectl-video-popup__cancel,\n.notectl-video-popup__submit {\n\tpadding: 7px 14px;\n\tcursor: pointer;\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 4px;\n\tbackground: var(--notectl-surface-raised);\n\tcolor: var(--notectl-fg);\n\tfont: inherit;\n}\n\n.notectl-video-popup__submit {\n\tborder-color: var(--notectl-primary);\n\tbackground: var(--notectl-primary);\n\tcolor: var(--notectl-primary-fg);\n\tfont-weight: 600;\n}\n\n.notectl-video-popup__cancel:focus-visible,\n.notectl-video-popup__submit:focus-visible {\n\toutline: 2px solid var(--notectl-primary);\n\toutline-offset: 2px;\n}\n\n/* Ask-first paste affordance */\n.notectl-video-embed-prompt {\n\tposition: fixed;\n\tz-index: 1000;\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tpadding: 6px 8px 6px 12px;\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 8px;\n\tbackground: var(--notectl-surface-overlay);\n\tcolor: var(--notectl-fg);\n\tbox-shadow: 0 4px 16px var(--notectl-shadow);\n\tfont-size: 13px;\n}\n\n.notectl-video-embed-prompt__text {\n\tmargin-inline-end: 4px;\n}\n\n.notectl-video-embed-prompt__embed,\n.notectl-video-embed-prompt__dismiss {\n\tpadding: 4px 10px;\n\tcursor: pointer;\n\tborder: 1px solid var(--notectl-border);\n\tborder-radius: 4px;\n\tbackground: var(--notectl-surface-raised);\n\tcolor: var(--notectl-fg);\n\tfont: inherit;\n}\n\n.notectl-video-embed-prompt__embed {\n\tborder-color: var(--notectl-primary);\n\tbackground: var(--notectl-primary);\n\tcolor: var(--notectl-primary-fg);\n\tfont-weight: 600;\n}\n\n.notectl-video-embed-prompt__embed:focus-visible,\n.notectl-video-embed-prompt__dismiss:focus-visible {\n\toutline: 2px solid var(--notectl-primary);\n\toutline-offset: 2px;\n}\n\n@media (forced-colors: active) {\n\t.notectl-video-overlay,\n\t.notectl-video-embed-prompt {\n\t\tborder: 1px solid CanvasText;\n\t}\n\t.notectl-video-popup__submit,\n\t.notectl-video-embed-prompt__embed {\n\t\tborder: 1px solid ButtonText;\n\t}\n}\n"),function(t){for(const e of t)At.add(e);wt+=1,kt||(kt=t=>{if("iframe"!==t.nodeName.toLowerCase())return;const e=t;e.hasAttribute("srcdoc")?e.parentNode?.removeChild(e):function(t,e){const n=B(t);return!!n&&"https:"===n.protocol&&e.has(n.hostname.toLowerCase())}(e.getAttribute("src")??"",At)||e.parentNode?.removeChild(e)},A.addHook("uponSanitizeElement",kt))}(function(t=S){const e=/* @__PURE__ */new Set;for(const n of t)for(const t of n.embedHostnames)e.add(t.toLowerCase());return e}(this.config.providers)),t.registerNodeSpec(function(t,e){const n=t.providers;return{type:"video",group:"block",isVoid:!0,selectable:!0,attrs:{provider:{default:""},videoId:{default:""},hash:{default:""},aspectRatio:{default:t.defaultAspectRatio},widthPercent:{default:t.defaultWidthPercent},align:{default:"center"},title:{default:""},caption:{default:""},privacy:{default:t.privacy}},toDOM(o){const i=K(o.attrs,t),r=u("figure",o.id);r.className="notectl-video",r.setAttribute("data-void","true"),r.setAttribute("data-selectable","true"),r.setAttribute("data-video-provider",i.provider),r.setAttribute("data-video-id",i.videoId),i.hash&&r.setAttribute("data-video-hash",i.hash),lt(r,i.align),r.setAttribute("aria-label",e.videoAria(H(i.provider,n),i.title));const a=document.createElement("div");a.className="notectl-video__frame",st(a,i.aspectRatio,i.widthPercent);const l=$(ct(i),n);if(l){const t=document.createElement("a");t.className="notectl-video__fallback-link",t.href=l,t.rel="noopener noreferrer",t.textContent=i.title||l,a.appendChild(t)}if(r.appendChild(a),i.caption){const t=document.createElement("figcaption");t.className="notectl-video__caption",t.textContent=i.caption,r.appendChild(t)}return r},toHTML(e){const o=K(e.attrs,t),i=ct(o),r=$(i,n),a=[`data-video-provider="${p(o.provider)}"`,`data-video-id="${p(o.videoId)}"`,`data-video-ratio="${p(o.aspectRatio)}"`,`data-video-width="${o.widthPercent}"`,`data-video-privacy="${o.privacy?"true":"false"}"`];o.hash&&a.push(`data-video-hash="${p(o.hash)}"`),o.title&&a.push(`data-video-title="${p(o.title)}"`);const l=t.useProviderThumbnail?N(i,n):void 0,s=l?`<img src="${p(l)}" alt="">`:h(o.title||r||""),d=r?`<a href="${p(r)}" rel="noopener noreferrer">${s}</a>`:s,c=o.caption?`<figcaption>${h(o.caption)}</figcaption>`:"";return`<figure ${a.join(" ")}>${d}${c}</figure>`},parseHTML:[{tag:"figure",priority:60,getAttrs:e=>function(t,e){const n=t.getAttribute("data-video-provider"),o=t.getAttribute("data-video-id");if(!n||!o)return!1;if(!F(o))return!1;if(!R(n,e.providers))return!1;const i=t.getAttribute("data-video-title")??t.querySelector("a")?.textContent?.trim()??t.getAttribute("aria-label")??"",r=t.querySelector("figcaption")?.textContent?.trim()??"",a=t.getAttribute("data-video-width"),l={provider:n,videoId:o,aspectRatio:T(t.getAttribute("data-video-ratio")??void 0,e),widthPercent:O(a?Number.parseFloat(a):e.defaultWidthPercent,e),align:"center",title:i,privacy:"false"!==t.getAttribute("data-video-privacy")},s=t.getAttribute("data-video-hash");return s&&dt.test(s)&&(l.hash=s),r&&(l.caption=r),l}(e,t)},{tag:"iframe",priority:60,getAttrs:e=>function(t,e){const n=I(t.getAttribute("src")??"",e.providers);if(!n||!F(n.videoId))return!1;const o={provider:n.provider,videoId:n.videoId,aspectRatio:ut(t,e),widthPercent:e.defaultWidthPercent,align:"center",title:t.getAttribute("title")??"",privacy:e.privacy};return n.hash&&(o.hash=n.hash),o}(e,t)}],sanitize:{tags:["figure","figcaption","a","img","iframe"],attrs:["href","rel","src","alt","title","allow","allowfullscreen","referrerpolicy","loading","width","height","frameborder","class","style"]}}}(this.config,this.locale)),this.overlay=new et(t,this.config,this.locale),this.registerNodeView(t),function(t){t.registerCommand("removeVideo",()=>Y(t))}(t),this.registerInsertCommand(t),this.registerResizeCommands(t),this.registerResizeKeymaps(t),this.registerPasteInterceptor(t),this.registerToolbarItem(t)}destroy(){(wt=Math.max(0,wt-1))>0||!kt||(A.removeHook("uponSanitizeElement"),kt=null,At.clear()),this.embedPrompt?.close(),this.embedPrompt=null,this.overlay?.close(!1),this.overlay=null,this.context=null}onStateChange(t,e,n){this.context&&!this.isVideoSelected(t)&&this.isVideoSelected(e)&&this.announceVideoSelection(e)}registerNodeView(t){t.registerNodeView(j,xt({config:this.config,locale:this.locale,resolvedKeymap:this.resolvedKeymap,announce:e=>t.announce(e),actions:{edit:()=>this.overlay?.openEditForSelected(),align:e=>function(t,e){const n=Z(t.getState());return!!n&&G(t,{...n.block.attrs??{},align:e})}(t,e),remove:()=>Y(t)}}))}registerInsertCommand(t){t.registerCommand("insertVideo",()=>(this.isVideoSelected(t.getState())?this.overlay?.openEditForSelected():this.overlay?.openInsert(),!0))}registerResizeCommands(t){const e=this.config.widthStep,n=this.config.widthStepLarge,o=e=>{const n=function(t,e,n){const o=Z(t.getState());if(!o)return!1;const i=o.block.attrs?.widthPercent??n.defaultWidthPercent,r=O(i+e,n);return r!==i&&G(t,{...o.block.attrs??{},widthPercent:r})}(t,e,this.config);return n&&this.announceCurrentSize(t),n};t.registerCommand("resizeVideoGrow",()=>o(e)),t.registerCommand("resizeVideoShrink",()=>o(-e)),t.registerCommand("resizeVideoGrowLarge",()=>o(n)),t.registerCommand("resizeVideoShrinkLarge",()=>o(-n)),t.registerCommand("resetVideoSize",()=>{const e=function(t,e){const n=Z(t.getState());return!!n&&G(t,{...n.block.attrs??{},widthPercent:e.defaultWidthPercent})}(t,this.config);return e&&t.announce(this.locale.resetToDefaultSize),e})}registerResizeKeymaps(t){const e={growWidth:"resizeVideoGrow",shrinkWidth:"resizeVideoShrink",growWidthLarge:"resizeVideoGrowLarge",shrinkWidthLarge:"resizeVideoShrinkLarge",resetSize:"resetVideoSize"},n={};for(const[o,i]of Object.entries(e)){const e=this.resolvedKeymap[o]??null;e&&(n[e]=()=>t.executeCommand(i))}Object.keys(n).length>0&&t.registerKeymap(n)}registerPasteInterceptor(t){t.registerPasteInterceptor(_t({providers:this.config.providers,onOffer:(t,e)=>this.offerEmbed(t,e)}),{name:"video",priority:40})}offerEmbed(t,e){if(!this.context)return;const o=this.context,i=H(e.provider,this.config.providers);this.embedPrompt?.close(),requestAnimationFrame(()=>{o.announce(this.locale.embedOfferAnnounce(i));const e=function(t,e){const o=t.getBlock(e.blockId);if(!o)return"";const i=n(o);return i.slice(e.start,Math.min(e.end,i.length))}(o.getState(),t);this.embedPrompt=function(t){const{locale:e}=t,n=document.createElement("div");n.className="notectl-video-embed-prompt",n.setAttribute("role","dialog"),n.setAttribute("aria-label",e.embedPrompt);const o=document.createElement("span");o.className="notectl-video-embed-prompt__text",o.textContent=e.embedPrompt;const i=document.createElement("button");i.type="button",i.className="notectl-video-embed-prompt__embed",i.textContent=e.embedConfirm;const r=document.createElement("button");r.type="button",r.className="notectl-video-embed-prompt__dismiss",r.textContent=e.embedDismiss,n.append(o,i,r);let a=null,l=!1;const s=()=>{l||(l=!0,a&&(document.removeEventListener("mousedown",a,!0),a=null),n.remove())},d=t=>{s(),t()};return i.addEventListener("mousedown",t=>t.preventDefault()),i.addEventListener("click",e=>{e.preventDefault(),d(t.onEmbed)}),r.addEventListener("mousedown",t=>t.preventDefault()),r.addEventListener("click",e=>{e.preventDefault(),d(t.onDismiss)}),n.addEventListener("keydown",e=>{"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),d(t.onDismiss))}),t.container.appendChild(n),w(n),function(t,e){const n=e?e.bottom:window.innerHeight/3,o=e?e.left:window.innerWidth/3,i=t.offsetWidth||240,r=window.innerWidth-i-8,a=Math.max(8,Math.min(o,r)),l=window.innerHeight-t.offsetHeight-8,s=Math.min(n+8,Math.max(8,l));t.style.left=`${Math.round(a)}px`,t.style.top=`${Math.round(s)}px`}(n,t.rect),a=e=>{e.composedPath().includes(n)||d(t.onDismiss)},requestAnimationFrame(()=>{a&&document.addEventListener("mousedown",a,!0),i.focus()}),{close:s}}({container:o.getPluginContainer("top"),rect:Pt(),locale:this.locale,onEmbed:()=>{this.embedPrompt=null,this.overlay?.openInsertReplacingRange(t,e)},onDismiss:()=>{this.embedPrompt=null,o.getContainer().focus()}})})}registerToolbarItem(t){t.registerToolbarItem({id:"video",group:"insert",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zm6 4.5v7l6-3.5-6-3.5z" fill="currentColor"/></svg>',label:this.locale.insertVideo,tooltip:this.locale.insertVideoTooltip,command:"insertVideo"})}isVideoSelected(t){const e=t.selection;return!!r(e)&&t.getBlock(e.nodeId)?.type===j}announceVideoSelection(t){if(!this.context)return;const e=t.selection;if(!r(e))return;const n=t.getBlock(e.nodeId);if(!n||"video"!==n.type)return;const o=n.attrs?.title??"",i=[o?this.locale.videoSelectedWithTitle(o):this.locale.videoSelected],a=this.resolvedKeymap.shrinkWidth??null,l=this.resolvedKeymap.growWidth??null;a&&l&&i.push(this.locale.resizeHint(_(a),_(l))),this.context.announce(i.join(" "))}announceCurrentSize(t){const e=function(t,e){const n=Z(t);return n?n.block.attrs?.widthPercent??e.defaultWidthPercent:null}(t.getState(),this.config);null!==e&&t.announce(this.locale.videoResized(e))}};function Pt(){const t=window.getSelection();if(!t||0===t.rangeCount)return null;const e=t.getRangeAt(0).getBoundingClientRect();return 0===e.width&&0===e.height&&0===e.top&&0===e.left?null:e}export{M as a,W as i,ot as n,S as o,rt as r,I as s,Ct as t};
2
- //# sourceMappingURL=VideoPlugin-B3uf1Dwp.mjs.map