@notectl/core 2.3.7 → 2.4.2

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 (751) hide show
  1. package/README.md +1 -1
  2. package/dist/chunks/AlignmentPlugin-Cp7HYGaH.mjs +2 -0
  3. package/dist/chunks/AlignmentPlugin-Cp7HYGaH.mjs.map +1 -0
  4. package/dist/chunks/{AttrRegistry-CtNhf2EF.mjs → AttrRegistry-Di936wMv.mjs} +2 -2
  5. package/dist/chunks/AttrRegistry-Di936wMv.mjs.map +1 -0
  6. package/dist/chunks/{AttributedMarkCommands-B3MQdob_.mjs → AttributedMarkCommands-DKHuhZA7.mjs} +2 -2
  7. package/dist/chunks/AttributedMarkCommands-DKHuhZA7.mjs.map +1 -0
  8. package/dist/chunks/BidiIsolationPlugin-GWukKdgJ.mjs +2 -0
  9. package/dist/chunks/BidiIsolationPlugin-GWukKdgJ.mjs.map +1 -0
  10. package/dist/chunks/BlockAlignment-BqyBQ4uV.mjs +2 -0
  11. package/dist/chunks/BlockAlignment-BqyBQ4uV.mjs.map +1 -0
  12. package/dist/chunks/BlockInsertion-CXfXqUZl.mjs +2 -0
  13. package/dist/chunks/BlockInsertion-CXfXqUZl.mjs.map +1 -0
  14. package/dist/chunks/BlockTypePickerRegistry-BTET9jM-.mjs.map +1 -1
  15. package/dist/chunks/BlockquotePlugin-CSL_7Yit.mjs +2 -0
  16. package/dist/chunks/BlockquotePlugin-CSL_7Yit.mjs.map +1 -0
  17. package/dist/chunks/CSSValueEquivalence-DeyUKPQ7.mjs +2 -0
  18. package/dist/chunks/CSSValueEquivalence-DeyUKPQ7.mjs.map +1 -0
  19. package/dist/chunks/{CaretNavigationPlugin-DEZU09LJ.mjs → CaretNavigationPlugin-BQPqqK4n.mjs} +2 -2
  20. package/dist/chunks/CaretNavigationPlugin-BQPqqK4n.mjs.map +1 -0
  21. package/dist/chunks/CodeBlockPlugin-B4AcDJRK.mjs +2 -0
  22. package/dist/chunks/CodeBlockPlugin-B4AcDJRK.mjs.map +1 -0
  23. package/dist/chunks/ColorGrid-DAs0--ty.mjs.map +1 -1
  24. package/dist/chunks/ColorPickerPopup-B6340f3p.mjs +2 -0
  25. package/dist/chunks/ColorPickerPopup-B6340f3p.mjs.map +1 -0
  26. package/dist/chunks/{ColorValidation-B9d_umnf.mjs → ColorValidation-ZBKZ_gTr.mjs} +2 -2
  27. package/dist/chunks/ColorValidation-ZBKZ_gTr.mjs.map +1 -0
  28. package/dist/chunks/Commands-Bk7Cl1nH.mjs +2 -0
  29. package/dist/chunks/Commands-Bk7Cl1nH.mjs.map +1 -0
  30. package/dist/chunks/ContentModel-dkGOh3N7.mjs +2 -0
  31. package/dist/chunks/ContentModel-dkGOh3N7.mjs.map +1 -0
  32. package/dist/chunks/{CursorMarks-dx51OGBf.mjs → CursorMarks-CqHLzGNI.mjs} +2 -2
  33. package/dist/chunks/CursorMarks-CqHLzGNI.mjs.map +1 -0
  34. package/dist/chunks/{Decoration-BwhoA4MU.mjs → Decoration-BoFcdSXk.mjs} +2 -2
  35. package/dist/chunks/Decoration-BoFcdSXk.mjs.map +1 -0
  36. package/dist/chunks/{DirectionDetection-ZrkMhyaL.mjs → DirectionDetection-a-1iksmh.mjs} +2 -2
  37. package/dist/chunks/DirectionDetection-a-1iksmh.mjs.map +1 -0
  38. package/dist/chunks/DirectionIcons-Bbawl9ei.mjs.map +1 -1
  39. package/dist/chunks/{Document-D_2cIBJG.mjs → Document-ssR6hBzG.mjs} +2 -2
  40. package/dist/chunks/Document-ssR6hBzG.mjs.map +1 -0
  41. package/dist/chunks/DocumentParser-C99N0MWF.mjs +2 -0
  42. package/dist/chunks/DocumentParser-C99N0MWF.mjs.map +1 -0
  43. package/dist/chunks/DomUtils-Bf7JLFlx.mjs.map +1 -1
  44. package/dist/chunks/EditorEventBoundary-zpYRxryo.mjs.map +1 -1
  45. package/dist/chunks/FontPlugin-BcXNFqqO.mjs +2 -0
  46. package/dist/chunks/FontPlugin-BcXNFqqO.mjs.map +1 -0
  47. package/dist/chunks/FontSizePlugin-Dswra3oU.mjs +2 -0
  48. package/dist/chunks/FontSizePlugin-Dswra3oU.mjs.map +1 -0
  49. package/dist/chunks/FormulaPlugin-DVpLaKi5.mjs +2 -0
  50. package/dist/chunks/FormulaPlugin-DVpLaKi5.mjs.map +1 -0
  51. package/dist/chunks/GapCursorPlugin-QDGwnaRR.mjs +2 -0
  52. package/dist/chunks/GapCursorPlugin-QDGwnaRR.mjs.map +1 -0
  53. package/dist/chunks/HTMLSanitization-Ce9dVT1q.mjs.map +1 -1
  54. package/dist/chunks/HTMLUtils-DTpsjZyK.mjs +2 -0
  55. package/dist/chunks/HTMLUtils-DTpsjZyK.mjs.map +1 -0
  56. package/dist/chunks/{HardBreakPlugin-CC4rntSX.mjs → HardBreakPlugin-gjCq8prD.mjs} +2 -2
  57. package/dist/chunks/HardBreakPlugin-gjCq8prD.mjs.map +1 -0
  58. package/dist/chunks/HeadingPlugin-B7EfynaH.mjs +2 -0
  59. package/dist/chunks/HeadingPlugin-B7EfynaH.mjs.map +1 -0
  60. package/dist/chunks/HighlightPlugin-LdO0INtJ.mjs +2 -0
  61. package/dist/chunks/HighlightPlugin-LdO0INtJ.mjs.map +1 -0
  62. package/dist/chunks/HorizontalRulePlugin-YywXVZYr.mjs +2 -0
  63. package/dist/chunks/HorizontalRulePlugin-YywXVZYr.mjs.map +1 -0
  64. package/dist/chunks/ImagePlugin-BAhZuVdE.mjs +2 -0
  65. package/dist/chunks/ImagePlugin-BAhZuVdE.mjs.map +1 -0
  66. package/dist/chunks/InlineCodePlugin-Bu9-rE4B.mjs +2 -0
  67. package/dist/chunks/InlineCodePlugin-Bu9-rE4B.mjs.map +1 -0
  68. package/dist/chunks/InlineStyleMarkSpec-BhfGgfH9.mjs +2 -0
  69. package/dist/chunks/InlineStyleMarkSpec-BhfGgfH9.mjs.map +1 -0
  70. package/dist/chunks/KeyboardNav-D0my3wuy.mjs.map +1 -1
  71. package/dist/chunks/LinkPlugin-CAUaWW5-.mjs +2 -0
  72. package/dist/chunks/LinkPlugin-CAUaWW5-.mjs.map +1 -0
  73. package/dist/chunks/{ListPlugin--dqEctgn.mjs → ListPlugin-U1r4p_fE.mjs} +2 -2
  74. package/dist/chunks/ListPlugin-U1r4p_fE.mjs.map +1 -0
  75. package/dist/chunks/MarkCommands-C0ps9h0z.mjs +2 -0
  76. package/dist/chunks/MarkCommands-C0ps9h0z.mjs.map +1 -0
  77. package/dist/chunks/MarkInputRule-DNneF2gp.mjs.map +1 -1
  78. package/dist/chunks/MarkdownHTMLRegistry-BunUDiza.mjs +2 -0
  79. package/dist/chunks/MarkdownHTMLRegistry-BunUDiza.mjs.map +1 -0
  80. package/dist/chunks/{MarkdownParser-D1d9zB0R.mjs → MarkdownParser-uX1p_GQk.mjs} +2 -2
  81. package/dist/chunks/MarkdownParser-uX1p_GQk.mjs.map +1 -0
  82. package/dist/chunks/MarkdownSerializer--MrgJTdJ.mjs +2 -0
  83. package/dist/chunks/MarkdownSerializer--MrgJTdJ.mjs.map +1 -0
  84. package/dist/chunks/MathFont-BS8IwYh2.mjs.map +1 -1
  85. package/dist/chunks/NavigationQueries-CaKfccu7.mjs +2 -0
  86. package/dist/chunks/NavigationQueries-CaKfccu7.mjs.map +1 -0
  87. package/dist/chunks/NodeResolver-F4RtpoEd.mjs +2 -0
  88. package/dist/chunks/NodeResolver-F4RtpoEd.mjs.map +1 -0
  89. package/dist/chunks/{NodeSelectionCommands-DK3iEh18.mjs → NodeSelectionCommands-CAqIHW_6.mjs} +2 -2
  90. package/dist/chunks/NodeSelectionCommands-CAqIHW_6.mjs.map +1 -0
  91. package/dist/chunks/NodeSpecPatching-BrjPAbqe.mjs.map +1 -1
  92. package/dist/chunks/Platform-ByobkiCc.mjs.map +1 -1
  93. package/dist/chunks/PluginHelpers-B3gk3VB3.mjs +2 -0
  94. package/dist/chunks/PluginHelpers-B3gk3VB3.mjs.map +1 -0
  95. package/dist/chunks/PopupKeyboardPatterns-BcwdDxRq.mjs.map +1 -1
  96. package/dist/chunks/PopupManager-Dxv0OVMo.mjs +2 -0
  97. package/dist/chunks/PopupManager-Dxv0OVMo.mjs.map +1 -0
  98. package/dist/chunks/PopupPositioning-CIqgpqlW.mjs.map +1 -1
  99. package/dist/chunks/{PrintPlugin-BQ7LWbEB.mjs → PrintPlugin-DAEiEyKQ.mjs} +2 -2
  100. package/dist/chunks/PrintPlugin-DAEiEyKQ.mjs.map +1 -0
  101. package/dist/chunks/{RangeIterator-DDOxTQIf.mjs → RangeIterator-sJ_c9MNr.mjs} +2 -2
  102. package/dist/chunks/RangeIterator-sJ_c9MNr.mjs.map +1 -0
  103. package/dist/chunks/Schema-BSM4YLNT.mjs +2 -0
  104. package/dist/chunks/Schema-BSM4YLNT.mjs.map +1 -0
  105. package/dist/chunks/SchemaRegistry-Cs7rxafF.mjs +2 -0
  106. package/dist/chunks/SchemaRegistry-Cs7rxafF.mjs.map +1 -0
  107. package/dist/chunks/Selection-DC6AOGgF.mjs.map +1 -1
  108. package/dist/chunks/SelectionReplacement-vC1xhFS0.mjs +2 -0
  109. package/dist/chunks/SelectionReplacement-vC1xhFS0.mjs.map +1 -0
  110. package/dist/chunks/SelectionSync-BkjCwGp-.mjs +2 -0
  111. package/dist/chunks/SelectionSync-BkjCwGp-.mjs.map +1 -0
  112. package/dist/chunks/{SelectionTransactions-DNCzsl_b.mjs → SelectionTransactions-mQ1NfMEg.mjs} +2 -2
  113. package/dist/chunks/SelectionTransactions-mQ1NfMEg.mjs.map +1 -0
  114. package/dist/chunks/ShortcutFormatting-TwiufqeV.mjs.map +1 -1
  115. package/dist/chunks/SimpleMark-D6vz3Nfd.mjs +2 -0
  116. package/dist/chunks/SimpleMark-D6vz3Nfd.mjs.map +1 -0
  117. package/dist/chunks/SmartPastePlugin-BHsYKbgd.mjs +2 -0
  118. package/dist/chunks/SmartPastePlugin-BHsYKbgd.mjs.map +1 -0
  119. package/dist/chunks/StarterFonts-BDQPg-cu.mjs.map +1 -1
  120. package/dist/chunks/{StrikethroughPlugin-d-EW2YYx.mjs → StrikethroughPlugin-v-VJZzUZ.mjs} +2 -2
  121. package/dist/chunks/StrikethroughPlugin-v-VJZzUZ.mjs.map +1 -0
  122. package/dist/chunks/StyleClassNames-BsAx7k5T.mjs +2 -0
  123. package/dist/chunks/StyleClassNames-BsAx7k5T.mjs.map +1 -0
  124. package/dist/chunks/StyleRuntime-C0RSqKzG.mjs.map +1 -1
  125. package/dist/chunks/{SuperSubPlugin-C-kvFQyx.mjs → SuperSubPlugin-x1iPnZyt.mjs} +2 -2
  126. package/dist/chunks/SuperSubPlugin-x1iPnZyt.mjs.map +1 -0
  127. package/dist/chunks/SyntaxTokenTypes-BUCOMtL8.mjs.map +1 -1
  128. package/dist/chunks/TableDimensions-BSEOEox2.mjs +2 -0
  129. package/dist/chunks/TableDimensions-BSEOEox2.mjs.map +1 -0
  130. package/dist/chunks/TablePlugin-CjKThPug.mjs +2 -0
  131. package/dist/chunks/TablePlugin-CjKThPug.mjs.map +1 -0
  132. package/dist/chunks/TextColorPlugin-Bnl9of9E.mjs +2 -0
  133. package/dist/chunks/TextColorPlugin-Bnl9of9E.mjs.map +1 -0
  134. package/dist/chunks/{TextDirectionAutoPlugin-LVDkKdDX.mjs → TextDirectionAutoPlugin-DOH5cfyy.mjs} +2 -2
  135. package/dist/chunks/TextDirectionAutoPlugin-DOH5cfyy.mjs.map +1 -0
  136. package/dist/chunks/{TextDirectionPlugin-CtGwof7i.mjs → TextDirectionPlugin-JwlR-R-b.mjs} +2 -2
  137. package/dist/chunks/TextDirectionPlugin-JwlR-R-b.mjs.map +1 -0
  138. package/dist/chunks/TextDirectionService-BcX07mw2.mjs +2 -0
  139. package/dist/chunks/TextDirectionService-BcX07mw2.mjs.map +1 -0
  140. package/dist/chunks/{TextFormattingPlugin-DlS0SeW7.mjs → TextFormattingPlugin-Kc_UNoOz.mjs} +2 -2
  141. package/dist/chunks/TextFormattingPlugin-Kc_UNoOz.mjs.map +1 -0
  142. package/dist/chunks/ThemeEngine-kIXtSRkI.mjs.map +1 -1
  143. package/dist/chunks/ToolbarPlugin-CgZA2hz8.mjs +2 -0
  144. package/dist/chunks/ToolbarPlugin-CgZA2hz8.mjs.map +1 -0
  145. package/dist/chunks/TypeBrands-Ch9856Gb.mjs.map +1 -1
  146. package/dist/chunks/TypedKeys-CA4bfw9O.mjs.map +1 -1
  147. package/dist/chunks/VideoPlugin-DJXfuNA9.mjs +2 -0
  148. package/dist/chunks/VideoPlugin-DJXfuNA9.mjs.map +1 -0
  149. package/dist/chunks/XmlPatterns-RN32-0ob.mjs.map +1 -1
  150. package/dist/chunks/XmlSupport-3Za6SIqF.mjs.map +1 -1
  151. package/dist/chunks/ar--Isa9OHJ.mjs.map +1 -1
  152. package/dist/chunks/ar--O0A9OTR.mjs.map +1 -1
  153. package/dist/chunks/ar-0g2bmXTn.mjs.map +1 -1
  154. package/dist/chunks/ar-4b8e2YSc.mjs.map +1 -1
  155. package/dist/chunks/ar-B03uY4xr.mjs.map +1 -1
  156. package/dist/chunks/ar-BAfInw85.mjs.map +1 -1
  157. package/dist/chunks/ar-BRX5E_Pw.mjs.map +1 -1
  158. package/dist/chunks/ar-BWOue6jG.mjs.map +1 -1
  159. package/dist/chunks/ar-Bdmunk5h.mjs.map +1 -1
  160. package/dist/chunks/ar-BwaoCUVN.mjs.map +1 -1
  161. package/dist/chunks/ar-BzqAYGER.mjs.map +1 -1
  162. package/dist/chunks/ar-C9lO1jsY.mjs.map +1 -1
  163. package/dist/chunks/ar-CMXjVzFx.mjs.map +1 -1
  164. package/dist/chunks/ar-CR6UdFL9.mjs.map +1 -1
  165. package/dist/chunks/ar-CrOb0jL2.mjs.map +1 -1
  166. package/dist/chunks/ar-Cy_77yRf.mjs.map +1 -1
  167. package/dist/chunks/ar-D1jFXqLJ.mjs.map +1 -1
  168. package/dist/chunks/ar-DahJwMI9.mjs.map +1 -1
  169. package/dist/chunks/ar-Dcl3kgtd.mjs.map +1 -1
  170. package/dist/chunks/ar-Dg9PdDet.mjs.map +1 -1
  171. package/dist/chunks/ar-DhwCFHql.mjs +2 -0
  172. package/dist/chunks/ar-DhwCFHql.mjs.map +1 -0
  173. package/dist/chunks/ar-Dx2lO0Nm.mjs.map +1 -1
  174. package/dist/chunks/ar-NV_puwI2.mjs.map +1 -1
  175. package/dist/chunks/ar-Uzo1Azdw.mjs.map +1 -1
  176. package/dist/chunks/ar-XmSFrtmd.mjs.map +1 -1
  177. package/dist/chunks/ar-eOA3UmiE.mjs.map +1 -1
  178. package/dist/chunks/ar-sGZ-oZqB.mjs.map +1 -1
  179. package/dist/chunks/color-picker-D6HrTsDM.mjs +2 -0
  180. package/dist/chunks/color-picker-D6HrTsDM.mjs.map +1 -0
  181. package/dist/chunks/de-B8-w9gPi.mjs.map +1 -1
  182. package/dist/chunks/de-B9zSHWqY.mjs.map +1 -1
  183. package/dist/chunks/de-BX4y4PlH.mjs.map +1 -1
  184. package/dist/chunks/de-BXQBXxFJ.mjs.map +1 -1
  185. package/dist/chunks/de-BcPntcnr.mjs.map +1 -1
  186. package/dist/chunks/de-BdD3DpUB.mjs.map +1 -1
  187. package/dist/chunks/de-Bwxlcuee.mjs.map +1 -1
  188. package/dist/chunks/de-BxQIt_1Y.mjs.map +1 -1
  189. package/dist/chunks/de-C-Yf378-.mjs.map +1 -1
  190. package/dist/chunks/de-C7uehgMu.mjs.map +1 -1
  191. package/dist/chunks/de-C9ZhDqPi.mjs.map +1 -1
  192. package/dist/chunks/de-CHcv_Vmf.mjs.map +1 -1
  193. package/dist/chunks/de-CTzAMkXC.mjs.map +1 -1
  194. package/dist/chunks/de-CaeEIyzV.mjs.map +1 -1
  195. package/dist/chunks/de-CjLUbQmg.mjs +2 -0
  196. package/dist/chunks/de-CjLUbQmg.mjs.map +1 -0
  197. package/dist/chunks/de-DHs9i4af.mjs.map +1 -1
  198. package/dist/chunks/de-DJ5EkXQo.mjs.map +1 -1
  199. package/dist/chunks/de-DRbhnS4T.mjs.map +1 -1
  200. package/dist/chunks/de-DViI26lG.mjs.map +1 -1
  201. package/dist/chunks/de-DY3obIAF.mjs.map +1 -1
  202. package/dist/chunks/de-DcMhfRBu.mjs.map +1 -1
  203. package/dist/chunks/de-DiPz7abS.mjs.map +1 -1
  204. package/dist/chunks/de-Dl4QFHMa.mjs.map +1 -1
  205. package/dist/chunks/de-XCCpWyg0.mjs.map +1 -1
  206. package/dist/chunks/de-e6J6nvAD.mjs.map +1 -1
  207. package/dist/chunks/de-i95F9SDy.mjs.map +1 -1
  208. package/dist/chunks/de-uKR7koQe.mjs.map +1 -1
  209. package/dist/chunks/es-B0Za939C.mjs.map +1 -1
  210. package/dist/chunks/es-B8K3Yvf3.mjs.map +1 -1
  211. package/dist/chunks/es-BIXm2Coj.mjs.map +1 -1
  212. package/dist/chunks/es-BJHF95J_.mjs.map +1 -1
  213. package/dist/chunks/es-BMm9kqjC.mjs.map +1 -1
  214. package/dist/chunks/es-BQ9dox_E.mjs.map +1 -1
  215. package/dist/chunks/es-BQweZX6P.mjs.map +1 -1
  216. package/dist/chunks/es-BdpTTRuX.mjs.map +1 -1
  217. package/dist/chunks/es-C7uVqFYr.mjs.map +1 -1
  218. package/dist/chunks/es-CCQFu1t1.mjs.map +1 -1
  219. package/dist/chunks/es-CEAJj7aB.mjs.map +1 -1
  220. package/dist/chunks/es-CMSzvjOT.mjs +2 -0
  221. package/dist/chunks/es-CMSzvjOT.mjs.map +1 -0
  222. package/dist/chunks/es-CUKJujcb.mjs.map +1 -1
  223. package/dist/chunks/es-CXuMz87y.mjs.map +1 -1
  224. package/dist/chunks/es-CgMfhkJJ.mjs.map +1 -1
  225. package/dist/chunks/es-CtOtKQCP.mjs.map +1 -1
  226. package/dist/chunks/es-DD01rZ6N.mjs.map +1 -1
  227. package/dist/chunks/es-DDoqchUq.mjs.map +1 -1
  228. package/dist/chunks/es-DFokqQst.mjs.map +1 -1
  229. package/dist/chunks/es-DHxdoEzR.mjs.map +1 -1
  230. package/dist/chunks/es-DehVGwQ8.mjs.map +1 -1
  231. package/dist/chunks/es-DrJyl38L.mjs.map +1 -1
  232. package/dist/chunks/es-fTW0TkYV.mjs.map +1 -1
  233. package/dist/chunks/es-kfKiqpyD.mjs.map +1 -1
  234. package/dist/chunks/es-nRLq7bgP.mjs.map +1 -1
  235. package/dist/chunks/es-paXY7HFt.mjs.map +1 -1
  236. package/dist/chunks/es-xuahrvJN.mjs.map +1 -1
  237. package/dist/chunks/fr-0qEo3bRP.mjs.map +1 -1
  238. package/dist/chunks/fr-5HkMazAf.mjs.map +1 -1
  239. package/dist/chunks/fr-B9pBLaVx.mjs.map +1 -1
  240. package/dist/chunks/fr-BRXUnq3R.mjs.map +1 -1
  241. package/dist/chunks/fr-BSUKEtTk.mjs.map +1 -1
  242. package/dist/chunks/fr-BeRlON1t.mjs.map +1 -1
  243. package/dist/chunks/fr-Bg937iAy.mjs.map +1 -1
  244. package/dist/chunks/fr-BwWrFThE.mjs.map +1 -1
  245. package/dist/chunks/fr-C3EKRThN.mjs.map +1 -1
  246. package/dist/chunks/fr-CKjH6tJI.mjs.map +1 -1
  247. package/dist/chunks/fr-CQs0-pNX.mjs.map +1 -1
  248. package/dist/chunks/fr-CfhyYN-t.mjs.map +1 -1
  249. package/dist/chunks/fr-D0MDdoir.mjs.map +1 -1
  250. package/dist/chunks/fr-D5ulA3Z6.mjs.map +1 -1
  251. package/dist/chunks/fr-DB_OvHWH.mjs +2 -0
  252. package/dist/chunks/fr-DB_OvHWH.mjs.map +1 -0
  253. package/dist/chunks/fr-DEZ_oxzS.mjs.map +1 -1
  254. package/dist/chunks/fr-DciSEykY.mjs.map +1 -1
  255. package/dist/chunks/fr-DhWQzZy3.mjs.map +1 -1
  256. package/dist/chunks/fr-DiDhVhyV.mjs.map +1 -1
  257. package/dist/chunks/fr-DjMZ-3K5.mjs.map +1 -1
  258. package/dist/chunks/fr-F2ZrfVaF.mjs.map +1 -1
  259. package/dist/chunks/fr-KXmbys88.mjs.map +1 -1
  260. package/dist/chunks/fr-NVOinLyF.mjs.map +1 -1
  261. package/dist/chunks/fr-SbpHNrQ-.mjs.map +1 -1
  262. package/dist/chunks/fr-ZsRdLuys.mjs.map +1 -1
  263. package/dist/chunks/fr-eC0UdAPu.mjs.map +1 -1
  264. package/dist/chunks/fr-fshsDD66.mjs.map +1 -1
  265. package/dist/chunks/full-BsWAZr1w.mjs +2 -0
  266. package/dist/chunks/full-BsWAZr1w.mjs.map +1 -0
  267. package/dist/chunks/hi-4CiAKVjT.mjs.map +1 -1
  268. package/dist/chunks/hi-B-ZuX4aN.mjs.map +1 -1
  269. package/dist/chunks/hi-B2YB3Bo4.mjs.map +1 -1
  270. package/dist/chunks/hi-B2uhiPCN.mjs.map +1 -1
  271. package/dist/chunks/hi-B5cl8TWK.mjs.map +1 -1
  272. package/dist/chunks/hi-BNJIGWQQ.mjs.map +1 -1
  273. package/dist/chunks/hi-BOMkDPqC.mjs.map +1 -1
  274. package/dist/chunks/hi-Bl-yeeOI.mjs.map +1 -1
  275. package/dist/chunks/hi-BsZzSMfL.mjs.map +1 -1
  276. package/dist/chunks/hi-By8YwVIX.mjs.map +1 -1
  277. package/dist/chunks/hi-BzbMD_cP.mjs.map +1 -1
  278. package/dist/chunks/hi-C2jEsf8v.mjs.map +1 -1
  279. package/dist/chunks/hi-CTWubxLY.mjs.map +1 -1
  280. package/dist/chunks/hi-ChNQZZ1z.mjs +2 -0
  281. package/dist/chunks/hi-ChNQZZ1z.mjs.map +1 -0
  282. package/dist/chunks/hi-CoclKAUM.mjs.map +1 -1
  283. package/dist/chunks/hi-CrmakMVj.mjs.map +1 -1
  284. package/dist/chunks/hi-DWX6k5ZD.mjs.map +1 -1
  285. package/dist/chunks/hi-DY55FuDK.mjs.map +1 -1
  286. package/dist/chunks/hi-DrC2H81d.mjs.map +1 -1
  287. package/dist/chunks/hi-DsdXcOB6.mjs.map +1 -1
  288. package/dist/chunks/hi-Dt89SxNy.mjs.map +1 -1
  289. package/dist/chunks/hi-J8ErB5nB.mjs.map +1 -1
  290. package/dist/chunks/hi-L6pJxZam.mjs.map +1 -1
  291. package/dist/chunks/hi-SECtQQzq.mjs.map +1 -1
  292. package/dist/chunks/hi-j3TDLMYd.mjs.map +1 -1
  293. package/dist/chunks/hi-l6DA-aOw.mjs.map +1 -1
  294. package/dist/chunks/hi-uACJUw53.mjs.map +1 -1
  295. package/dist/chunks/minimal-DO7LiFTa.mjs +2 -0
  296. package/dist/chunks/minimal-DO7LiFTa.mjs.map +1 -0
  297. package/dist/chunks/pt-5VeuNDd2.mjs.map +1 -1
  298. package/dist/chunks/pt-BCXgUDiU.mjs.map +1 -1
  299. package/dist/chunks/pt-BDam9cDu.mjs.map +1 -1
  300. package/dist/chunks/pt-Bb908r0n.mjs.map +1 -1
  301. package/dist/chunks/pt-BkpVtod-.mjs.map +1 -1
  302. package/dist/chunks/pt-BlFAJZo7.mjs.map +1 -1
  303. package/dist/chunks/pt-Bu7Mbz67.mjs.map +1 -1
  304. package/dist/chunks/pt-BuZ7acHF.mjs.map +1 -1
  305. package/dist/chunks/pt-C8sOyw0V.mjs.map +1 -1
  306. package/dist/chunks/pt-CEUgbrii.mjs.map +1 -1
  307. package/dist/chunks/pt-CFrcl1v_.mjs.map +1 -1
  308. package/dist/chunks/pt-CI8t6oul.mjs +2 -0
  309. package/dist/chunks/pt-CI8t6oul.mjs.map +1 -0
  310. package/dist/chunks/pt-CMrFpUWS.mjs.map +1 -1
  311. package/dist/chunks/pt-CMx2wPPY.mjs.map +1 -1
  312. package/dist/chunks/pt-CR4j8gtE.mjs.map +1 -1
  313. package/dist/chunks/pt-Cc4zysaT.mjs.map +1 -1
  314. package/dist/chunks/pt-Cv6q7x5x.mjs.map +1 -1
  315. package/dist/chunks/pt-DFKJVh7k.mjs.map +1 -1
  316. package/dist/chunks/pt-DYMyMgKQ.mjs.map +1 -1
  317. package/dist/chunks/pt-D__tcM2T.mjs.map +1 -1
  318. package/dist/chunks/pt-Dg2ctkug.mjs.map +1 -1
  319. package/dist/chunks/pt-DgfMoLWR.mjs.map +1 -1
  320. package/dist/chunks/pt-OXa_IR4Q.mjs.map +1 -1
  321. package/dist/chunks/pt-UPF7DBlz.mjs.map +1 -1
  322. package/dist/chunks/pt-_qxIe7zX.mjs.map +1 -1
  323. package/dist/chunks/pt-paXY7HFt.mjs.map +1 -1
  324. package/dist/chunks/pt-zMHcNGPk.mjs.map +1 -1
  325. package/dist/chunks/register-DXLu8Njp.mjs +3 -0
  326. package/dist/chunks/register-DXLu8Njp.mjs.map +1 -0
  327. package/dist/chunks/ru-9WtNGZtl.mjs +2 -0
  328. package/dist/chunks/ru-9WtNGZtl.mjs.map +1 -0
  329. package/dist/chunks/ru-B1m8J9dl.mjs.map +1 -1
  330. package/dist/chunks/ru-BNPUT-3S.mjs.map +1 -1
  331. package/dist/chunks/ru-BotG0MFT.mjs.map +1 -1
  332. package/dist/chunks/ru-C-APN_dm.mjs.map +1 -1
  333. package/dist/chunks/ru-C9yFslEG.mjs.map +1 -1
  334. package/dist/chunks/ru-CkG_bpfo.mjs.map +1 -1
  335. package/dist/chunks/ru-Cs8KCNyq.mjs.map +1 -1
  336. package/dist/chunks/ru-CsP6mLxp.mjs.map +1 -1
  337. package/dist/chunks/ru-CvDl-yEd.mjs.map +1 -1
  338. package/dist/chunks/ru-CwyPz2Va.mjs.map +1 -1
  339. package/dist/chunks/ru-D53d-_UB.mjs.map +1 -1
  340. package/dist/chunks/ru-DJMpeuey.mjs.map +1 -1
  341. package/dist/chunks/ru-DSRv3_Rg.mjs.map +1 -1
  342. package/dist/chunks/ru-DV-lgEtM.mjs.map +1 -1
  343. package/dist/chunks/ru-DiwQV30V.mjs.map +1 -1
  344. package/dist/chunks/ru-DkW9XZFy.mjs.map +1 -1
  345. package/dist/chunks/ru-DyCTlhjg.mjs.map +1 -1
  346. package/dist/chunks/ru-QGX8lOTs.mjs.map +1 -1
  347. package/dist/chunks/ru-QcTo2yoL.mjs.map +1 -1
  348. package/dist/chunks/ru-Y11wuxOB.mjs.map +1 -1
  349. package/dist/chunks/ru-Yngw7nFP.mjs.map +1 -1
  350. package/dist/chunks/ru-d68SZpEe.mjs.map +1 -1
  351. package/dist/chunks/ru-gxbzqLL8.mjs.map +1 -1
  352. package/dist/chunks/ru-k7o3Qks3.mjs.map +1 -1
  353. package/dist/chunks/ru-l73diFXn.mjs.map +1 -1
  354. package/dist/chunks/ru-q8kz-237.mjs.map +1 -1
  355. package/dist/chunks/src-5GKFQ2mQ.mjs.map +1 -1
  356. package/dist/chunks/xml-BsV44TrJ.mjs.map +1 -1
  357. package/dist/chunks/zh-BFZOM3lF.mjs.map +1 -1
  358. package/dist/chunks/zh-BGYJXxVl.mjs.map +1 -1
  359. package/dist/chunks/zh-BP97XjlS.mjs.map +1 -1
  360. package/dist/chunks/zh-BQ73oqxc.mjs.map +1 -1
  361. package/dist/chunks/zh-BQqf3wJZ.mjs.map +1 -1
  362. package/dist/chunks/zh-Baxh6v0j.mjs.map +1 -1
  363. package/dist/chunks/zh-BrqJ4ywP.mjs +2 -0
  364. package/dist/chunks/zh-BrqJ4ywP.mjs.map +1 -0
  365. package/dist/chunks/zh-BvuAbM2S.mjs.map +1 -1
  366. package/dist/chunks/zh-C-wHnDo5.mjs.map +1 -1
  367. package/dist/chunks/zh-C7iCgCRP.mjs.map +1 -1
  368. package/dist/chunks/zh-CRsDvfPR.mjs.map +1 -1
  369. package/dist/chunks/zh-CWGAPVei.mjs.map +1 -1
  370. package/dist/chunks/zh-CWIzJcXi.mjs.map +1 -1
  371. package/dist/chunks/zh-CYV-db-K.mjs.map +1 -1
  372. package/dist/chunks/zh-CiIyOm6U.mjs.map +1 -1
  373. package/dist/chunks/zh-CnW44JEw.mjs.map +1 -1
  374. package/dist/chunks/zh-D1HSmSOf.mjs.map +1 -1
  375. package/dist/chunks/zh-DWN1Jqn3.mjs.map +1 -1
  376. package/dist/chunks/zh-DYD476c5.mjs.map +1 -1
  377. package/dist/chunks/zh-DdzgYD7k.mjs.map +1 -1
  378. package/dist/chunks/zh-DgSmvLyw.mjs.map +1 -1
  379. package/dist/chunks/zh-DlVfQn4z.mjs.map +1 -1
  380. package/dist/chunks/zh-Oj-qSUEp.mjs.map +1 -1
  381. package/dist/chunks/zh-YfuE_m2y.mjs.map +1 -1
  382. package/dist/chunks/zh-dGSDBBzb.mjs.map +1 -1
  383. package/dist/chunks/zh-ikm3rSTR.mjs.map +1 -1
  384. package/dist/chunks/zh-oZl1P_p0.mjs.map +1 -1
  385. package/dist/commands/BlockInsertion.d.ts +15 -19
  386. package/dist/commands/BlockInsertion.d.ts.map +1 -1
  387. package/dist/commands/Commands.d.ts.map +1 -1
  388. package/dist/commands/CompositionCommands.d.ts +47 -0
  389. package/dist/commands/CompositionCommands.d.ts.map +1 -0
  390. package/dist/commands/CompositionRebase.d.ts +24 -0
  391. package/dist/commands/CompositionRebase.d.ts.map +1 -0
  392. package/dist/commands/PasteCommand.d.ts.map +1 -1
  393. package/dist/commands/SelectionDeletion.d.ts +20 -8
  394. package/dist/commands/SelectionDeletion.d.ts.map +1 -1
  395. package/dist/commands/SelectionReplacement.d.ts +42 -0
  396. package/dist/commands/SelectionReplacement.d.ts.map +1 -0
  397. package/dist/editor/BlockIdentity.d.ts +16 -0
  398. package/dist/editor/BlockIdentity.d.ts.map +1 -0
  399. package/dist/editor/ContentSerializer.d.ts +13 -11
  400. package/dist/editor/ContentSerializer.d.ts.map +1 -1
  401. package/dist/editor/NotectlEditor.d.ts +6 -5
  402. package/dist/editor/NotectlEditor.d.ts.map +1 -1
  403. package/dist/editor/styles/link.d.ts +3 -0
  404. package/dist/editor/styles/link.d.ts.map +1 -0
  405. package/dist/fonts.mjs +1 -1
  406. package/dist/full.mjs +1 -1
  407. package/dist/html.mjs +1 -1
  408. package/dist/index.d.ts +2 -1
  409. package/dist/index.d.ts.map +1 -1
  410. package/dist/input/CompositionController.d.ts +78 -0
  411. package/dist/input/CompositionController.d.ts.map +1 -0
  412. package/dist/input/HTMLParser.d.ts +15 -2
  413. package/dist/input/HTMLParser.d.ts.map +1 -1
  414. package/dist/input/InputHandler.d.ts +34 -1
  415. package/dist/input/InputHandler.d.ts.map +1 -1
  416. package/dist/input/InputManager.d.ts +3 -0
  417. package/dist/input/InputManager.d.ts.map +1 -1
  418. package/dist/input/PasteHTMLHandler.d.ts.map +1 -1
  419. package/dist/input/PasteHandler.d.ts.map +1 -1
  420. package/dist/input/PasteRichBlockHandler.d.ts +10 -17
  421. package/dist/input/PasteRichBlockHandler.d.ts.map +1 -1
  422. package/dist/markdown.mjs +1 -1
  423. package/dist/model/BlockAlignment.d.ts +6 -0
  424. package/dist/model/BlockAlignment.d.ts.map +1 -1
  425. package/dist/model/BlockOffsetText.d.ts +11 -0
  426. package/dist/model/BlockOffsetText.d.ts.map +1 -0
  427. package/dist/model/CompositionState.d.ts +14 -0
  428. package/dist/model/CompositionState.d.ts.map +1 -1
  429. package/dist/model/ContentModel.d.ts +6 -1
  430. package/dist/model/ContentModel.d.ts.map +1 -1
  431. package/dist/model/FileHandlerDispatcher.d.ts +3 -1
  432. package/dist/model/FileHandlerDispatcher.d.ts.map +1 -1
  433. package/dist/model/FileHandlerRegistry.d.ts +11 -2
  434. package/dist/model/FileHandlerRegistry.d.ts.map +1 -1
  435. package/dist/model/HTMLUtils.d.ts +16 -3
  436. package/dist/model/HTMLUtils.d.ts.map +1 -1
  437. package/dist/model/MarkSpec.d.ts +5 -3
  438. package/dist/model/MarkSpec.d.ts.map +1 -1
  439. package/dist/model/NodeResolver.d.ts +2 -0
  440. package/dist/model/NodeResolver.d.ts.map +1 -1
  441. package/dist/model/NodeSpec.d.ts +2 -1
  442. package/dist/model/NodeSpec.d.ts.map +1 -1
  443. package/dist/model/Schema.d.ts +2 -0
  444. package/dist/model/Schema.d.ts.map +1 -1
  445. package/dist/model/SchemaRegistry.d.ts +26 -1
  446. package/dist/model/SchemaRegistry.d.ts.map +1 -1
  447. package/dist/model/StyleClass.d.ts +45 -0
  448. package/dist/model/StyleClass.d.ts.map +1 -0
  449. package/dist/model/StyleClassRegistry.d.ts +28 -0
  450. package/dist/model/StyleClassRegistry.d.ts.map +1 -0
  451. package/dist/model/TextChange.d.ts +40 -0
  452. package/dist/model/TextChange.d.ts.map +1 -0
  453. package/dist/notectl-core.mjs +1 -1
  454. package/dist/notectl-core.umd.js +1 -1
  455. package/dist/notectl-core.umd.js.map +1 -1
  456. package/dist/plugins/Plugin.d.ts +11 -0
  457. package/dist/plugins/Plugin.d.ts.map +1 -1
  458. package/dist/plugins/PluginContextFactory.d.ts +2 -0
  459. package/dist/plugins/PluginContextFactory.d.ts.map +1 -1
  460. package/dist/plugins/RegistrationTracker.d.ts.map +1 -1
  461. package/dist/plugins/alignment/AlignmentPlugin.d.ts +17 -0
  462. package/dist/plugins/alignment/AlignmentPlugin.d.ts.map +1 -1
  463. package/dist/plugins/alignment.mjs +1 -1
  464. package/dist/plugins/bidi-isolation.mjs +1 -1
  465. package/dist/plugins/blockquote.mjs +1 -1
  466. package/dist/plugins/caret-navigation.mjs +1 -1
  467. package/dist/plugins/code-block/CodeBlockSchema.d.ts.map +1 -1
  468. package/dist/plugins/code-block.mjs +1 -1
  469. package/dist/plugins/font/FontPlugin.d.ts +13 -0
  470. package/dist/plugins/font/FontPlugin.d.ts.map +1 -1
  471. package/dist/plugins/font-size/FontSizeOperations.d.ts +2 -0
  472. package/dist/plugins/font-size/FontSizeOperations.d.ts.map +1 -1
  473. package/dist/plugins/font-size/FontSizePlugin.d.ts +11 -0
  474. package/dist/plugins/font-size/FontSizePlugin.d.ts.map +1 -1
  475. package/dist/plugins/font-size.mjs +1 -1
  476. package/dist/plugins/font.mjs +1 -1
  477. package/dist/plugins/formula/FormulaCommands.d.ts +6 -4
  478. package/dist/plugins/formula/FormulaCommands.d.ts.map +1 -1
  479. package/dist/plugins/formula/FormulaPlugin.d.ts.map +1 -1
  480. package/dist/plugins/formula/latex/LatexParser.d.ts.map +1 -1
  481. package/dist/plugins/formula/latex/LatexSymbols.d.ts.map +1 -1
  482. package/dist/plugins/formula/latex/LookupOwn.d.ts +6 -0
  483. package/dist/plugins/formula/latex/LookupOwn.d.ts.map +1 -0
  484. package/dist/plugins/formula/latex/handlers/Accents.d.ts.map +1 -1
  485. package/dist/plugins/formula/latex/handlers/Delimiters.d.ts.map +1 -1
  486. package/dist/plugins/formula/latex/handlers/Environments.d.ts.map +1 -1
  487. package/dist/plugins/formula/latex/handlers/Fonts.d.ts.map +1 -1
  488. package/dist/plugins/formula/latex/handlers/Spacing.d.ts.map +1 -1
  489. package/dist/plugins/formula.mjs +1 -1
  490. package/dist/plugins/gap-cursor/GapCursorPlugin.d.ts.map +1 -1
  491. package/dist/plugins/gap-cursor.mjs +1 -1
  492. package/dist/plugins/hard-break.mjs +1 -1
  493. package/dist/plugins/heading.mjs +1 -1
  494. package/dist/plugins/highlight/HighlightPlugin.d.ts +11 -0
  495. package/dist/plugins/highlight/HighlightPlugin.d.ts.map +1 -1
  496. package/dist/plugins/highlight.mjs +1 -1
  497. package/dist/plugins/horizontal-rule.mjs +1 -1
  498. package/dist/plugins/image/ImageCommands.d.ts +15 -3
  499. package/dist/plugins/image/ImageCommands.d.ts.map +1 -1
  500. package/dist/plugins/image/ImagePlugin.d.ts.map +1 -1
  501. package/dist/plugins/image.mjs +1 -1
  502. package/dist/plugins/inline-code/InlineCodePlugin.d.ts.map +1 -1
  503. package/dist/plugins/inline-code.mjs +1 -1
  504. package/dist/plugins/link/LinkInteractionController.d.ts +26 -0
  505. package/dist/plugins/link/LinkInteractionController.d.ts.map +1 -0
  506. package/dist/plugins/link/LinkLocale.d.ts +7 -1
  507. package/dist/plugins/link/LinkLocale.d.ts.map +1 -1
  508. package/dist/plugins/link/LinkNavigation.d.ts +12 -0
  509. package/dist/plugins/link/LinkNavigation.d.ts.map +1 -0
  510. package/dist/plugins/link/LinkPlugin.d.ts +4 -4
  511. package/dist/plugins/link/LinkPlugin.d.ts.map +1 -1
  512. package/dist/plugins/link/LinkPreview.d.ts +28 -0
  513. package/dist/plugins/link/LinkPreview.d.ts.map +1 -0
  514. package/dist/plugins/link/locales/ar.d.ts.map +1 -1
  515. package/dist/plugins/link/locales/de.d.ts.map +1 -1
  516. package/dist/plugins/link/locales/es.d.ts.map +1 -1
  517. package/dist/plugins/link/locales/fr.d.ts.map +1 -1
  518. package/dist/plugins/link/locales/hi.d.ts.map +1 -1
  519. package/dist/plugins/link/locales/pt.d.ts.map +1 -1
  520. package/dist/plugins/link/locales/ru.d.ts.map +1 -1
  521. package/dist/plugins/link/locales/zh.d.ts.map +1 -1
  522. package/dist/plugins/link.mjs +1 -1
  523. package/dist/plugins/list.mjs +1 -1
  524. package/dist/plugins/print.mjs +1 -1
  525. package/dist/plugins/shared/ColorValidation.d.ts +12 -4
  526. package/dist/plugins/shared/ColorValidation.d.ts.map +1 -1
  527. package/dist/plugins/shared/InlineStyleMarkSpec.d.ts +10 -0
  528. package/dist/plugins/shared/InlineStyleMarkSpec.d.ts.map +1 -1
  529. package/dist/plugins/shared/PopupManager.d.ts +5 -0
  530. package/dist/plugins/shared/PopupManager.d.ts.map +1 -1
  531. package/dist/plugins/shared/StyleClassNames.d.ts +10 -0
  532. package/dist/plugins/shared/StyleClassNames.d.ts.map +1 -0
  533. package/dist/plugins/shared.mjs +1 -1
  534. package/dist/plugins/smart-paste/SmartPastePlugin.d.ts +0 -1
  535. package/dist/plugins/smart-paste/SmartPastePlugin.d.ts.map +1 -1
  536. package/dist/plugins/smart-paste.mjs +1 -1
  537. package/dist/plugins/strikethrough.mjs +1 -1
  538. package/dist/plugins/super-sub.mjs +1 -1
  539. package/dist/plugins/table.mjs +1 -1
  540. package/dist/plugins/text-color/TextColorPlugin.d.ts +11 -0
  541. package/dist/plugins/text-color/TextColorPlugin.d.ts.map +1 -1
  542. package/dist/plugins/text-color.mjs +1 -1
  543. package/dist/plugins/text-direction-auto.mjs +1 -1
  544. package/dist/plugins/text-direction.mjs +1 -1
  545. package/dist/plugins/text-formatting.mjs +1 -1
  546. package/dist/plugins/toolbar.mjs +1 -1
  547. package/dist/plugins/video.mjs +1 -1
  548. package/dist/presets/full.mjs +1 -1
  549. package/dist/presets/minimal.mjs +1 -1
  550. package/dist/presets.mjs +1 -1
  551. package/dist/register.mjs +1 -1
  552. package/dist/serialization/AlignmentHTML.d.ts +43 -0
  553. package/dist/serialization/AlignmentHTML.d.ts.map +1 -0
  554. package/dist/serialization/CSSClassCollector.d.ts +20 -17
  555. package/dist/serialization/CSSClassCollector.d.ts.map +1 -1
  556. package/dist/serialization/CSSValueEquivalence.d.ts +24 -0
  557. package/dist/serialization/CSSValueEquivalence.d.ts.map +1 -0
  558. package/dist/serialization/DocumentParser.d.ts +2 -1
  559. package/dist/serialization/DocumentParser.d.ts.map +1 -1
  560. package/dist/serialization/DocumentSerializer.d.ts +0 -4
  561. package/dist/serialization/DocumentSerializer.d.ts.map +1 -1
  562. package/dist/serialization/FirstTagAttributes.d.ts +16 -0
  563. package/dist/serialization/FirstTagAttributes.d.ts.map +1 -0
  564. package/dist/serialization/HTMLParseRules.d.ts +32 -0
  565. package/dist/serialization/HTMLParseRules.d.ts.map +1 -0
  566. package/dist/serialization/HTMLParseSession.d.ts +21 -0
  567. package/dist/serialization/HTMLParseSession.d.ts.map +1 -0
  568. package/dist/serialization/MarkSerializer.d.ts.map +1 -1
  569. package/dist/serialization/StyleClassHTML.d.ts +37 -0
  570. package/dist/serialization/StyleClassHTML.d.ts.map +1 -0
  571. package/dist/serialization/StyleRehydration.d.ts +16 -0
  572. package/dist/serialization/StyleRehydration.d.ts.map +1 -0
  573. package/dist/serialization/TableDimensions.d.ts.map +1 -1
  574. package/dist/serialization/index.d.ts +2 -1
  575. package/dist/serialization/index.d.ts.map +1 -1
  576. package/dist/serialization/markdown/InlineSerializers.d.ts.map +1 -1
  577. package/dist/state/EditorState.d.ts.map +1 -1
  578. package/dist/state/History.d.ts +2 -1
  579. package/dist/state/History.d.ts.map +1 -1
  580. package/dist/state/NavigationQueries.d.ts.map +1 -1
  581. package/dist/state/SelectionValidation.d.ts +12 -0
  582. package/dist/state/SelectionValidation.d.ts.map +1 -0
  583. package/dist/state/StepApplication.d.ts.map +1 -1
  584. package/dist/state/StepMapping.d.ts.map +1 -1
  585. package/dist/state/Steps.d.ts +3 -0
  586. package/dist/state/Steps.d.ts.map +1 -1
  587. package/dist/state/StructuralPositions.d.ts +15 -0
  588. package/dist/state/StructuralPositions.d.ts.map +1 -0
  589. package/dist/state/TransactionBuilder.d.ts +13 -15
  590. package/dist/state/TransactionBuilder.d.ts.map +1 -1
  591. package/dist/test/TestUtils.d.ts.map +1 -1
  592. package/dist/view/CursorWrapper.d.ts.map +1 -1
  593. package/dist/view/EditorView.d.ts +25 -1
  594. package/dist/view/EditorView.d.ts.map +1 -1
  595. package/dist/view/EditorViewEvents.d.ts.map +1 -1
  596. package/dist/view/InlineContentDOM.d.ts +44 -0
  597. package/dist/view/InlineContentDOM.d.ts.map +1 -0
  598. package/dist/view/Reconciler.d.ts +20 -1
  599. package/dist/view/Reconciler.d.ts.map +1 -1
  600. package/dist/view/RenderedBlockText.d.ts +27 -0
  601. package/dist/view/RenderedBlockText.d.ts.map +1 -0
  602. package/dist/view/SelectionSync.d.ts.map +1 -1
  603. package/package.json +9 -8
  604. package/dist/chunks/AlignmentPlugin-DIwrRsHd.mjs +0 -2
  605. package/dist/chunks/AlignmentPlugin-DIwrRsHd.mjs.map +0 -1
  606. package/dist/chunks/AttrRegistry-CtNhf2EF.mjs.map +0 -1
  607. package/dist/chunks/AttributedMarkCommands-B3MQdob_.mjs.map +0 -1
  608. package/dist/chunks/BidiIsolationPlugin-cOLlL3Y9.mjs +0 -2
  609. package/dist/chunks/BidiIsolationPlugin-cOLlL3Y9.mjs.map +0 -1
  610. package/dist/chunks/BlockInsertion-O5pAFKid.mjs +0 -2
  611. package/dist/chunks/BlockInsertion-O5pAFKid.mjs.map +0 -1
  612. package/dist/chunks/BlockquotePlugin-D-jRWLQB.mjs +0 -2
  613. package/dist/chunks/BlockquotePlugin-D-jRWLQB.mjs.map +0 -1
  614. package/dist/chunks/CaretNavigationPlugin-DEZU09LJ.mjs.map +0 -1
  615. package/dist/chunks/CodeBlockPlugin-BandNM3t.mjs +0 -2
  616. package/dist/chunks/CodeBlockPlugin-BandNM3t.mjs.map +0 -1
  617. package/dist/chunks/ColorPickerPopup-CFYCCN7m.mjs +0 -2
  618. package/dist/chunks/ColorPickerPopup-CFYCCN7m.mjs.map +0 -1
  619. package/dist/chunks/ColorValidation-B9d_umnf.mjs.map +0 -1
  620. package/dist/chunks/Commands-D-0UXYvo.mjs +0 -2
  621. package/dist/chunks/Commands-D-0UXYvo.mjs.map +0 -1
  622. package/dist/chunks/ContentModel-Bzmzeqwg.mjs +0 -2
  623. package/dist/chunks/ContentModel-Bzmzeqwg.mjs.map +0 -1
  624. package/dist/chunks/CursorMarks-dx51OGBf.mjs.map +0 -1
  625. package/dist/chunks/Decoration-BwhoA4MU.mjs.map +0 -1
  626. package/dist/chunks/DirectionDetection-ZrkMhyaL.mjs.map +0 -1
  627. package/dist/chunks/Document-D_2cIBJG.mjs.map +0 -1
  628. package/dist/chunks/DocumentParser-i-CreJ48.mjs +0 -2
  629. package/dist/chunks/DocumentParser-i-CreJ48.mjs.map +0 -1
  630. package/dist/chunks/FontPlugin-BySgRcF3.mjs +0 -2
  631. package/dist/chunks/FontPlugin-BySgRcF3.mjs.map +0 -1
  632. package/dist/chunks/FontSizePlugin-zJDiyhUv.mjs +0 -2
  633. package/dist/chunks/FontSizePlugin-zJDiyhUv.mjs.map +0 -1
  634. package/dist/chunks/FormulaPlugin-CI0r4X1o.mjs +0 -2
  635. package/dist/chunks/FormulaPlugin-CI0r4X1o.mjs.map +0 -1
  636. package/dist/chunks/GapCursorPlugin-NozsEK9J.mjs +0 -2
  637. package/dist/chunks/GapCursorPlugin-NozsEK9J.mjs.map +0 -1
  638. package/dist/chunks/HTMLUtils-B0nGyFLb.mjs +0 -2
  639. package/dist/chunks/HTMLUtils-B0nGyFLb.mjs.map +0 -1
  640. package/dist/chunks/HardBreakPlugin-CC4rntSX.mjs.map +0 -1
  641. package/dist/chunks/HeadingPlugin-BCh12hFT.mjs +0 -2
  642. package/dist/chunks/HeadingPlugin-BCh12hFT.mjs.map +0 -1
  643. package/dist/chunks/HighlightPlugin-By7CWUss.mjs +0 -2
  644. package/dist/chunks/HighlightPlugin-By7CWUss.mjs.map +0 -1
  645. package/dist/chunks/HorizontalRulePlugin-CxmUMM34.mjs +0 -2
  646. package/dist/chunks/HorizontalRulePlugin-CxmUMM34.mjs.map +0 -1
  647. package/dist/chunks/ImagePlugin-C_MuvfYo.mjs +0 -2
  648. package/dist/chunks/ImagePlugin-C_MuvfYo.mjs.map +0 -1
  649. package/dist/chunks/InlineCodePlugin-C1SqGfv5.mjs +0 -2
  650. package/dist/chunks/InlineCodePlugin-C1SqGfv5.mjs.map +0 -1
  651. package/dist/chunks/InlineStyleMarkSpec-Cx3goc3W.mjs +0 -2
  652. package/dist/chunks/InlineStyleMarkSpec-Cx3goc3W.mjs.map +0 -1
  653. package/dist/chunks/LinkPlugin-Bsmt97Kw.mjs +0 -2
  654. package/dist/chunks/LinkPlugin-Bsmt97Kw.mjs.map +0 -1
  655. package/dist/chunks/ListPlugin--dqEctgn.mjs.map +0 -1
  656. package/dist/chunks/MarkCommands-CJvLGL5G.mjs +0 -2
  657. package/dist/chunks/MarkCommands-CJvLGL5G.mjs.map +0 -1
  658. package/dist/chunks/MarkdownHTMLRegistry-CISsC0lH.mjs +0 -2
  659. package/dist/chunks/MarkdownHTMLRegistry-CISsC0lH.mjs.map +0 -1
  660. package/dist/chunks/MarkdownParser-D1d9zB0R.mjs.map +0 -1
  661. package/dist/chunks/MarkdownSerializer-Oex2RzNw.mjs +0 -2
  662. package/dist/chunks/MarkdownSerializer-Oex2RzNw.mjs.map +0 -1
  663. package/dist/chunks/NavigationQueries-Bt4zZ17v.mjs +0 -2
  664. package/dist/chunks/NavigationQueries-Bt4zZ17v.mjs.map +0 -1
  665. package/dist/chunks/NodeResolver-BtIknXqD.mjs +0 -2
  666. package/dist/chunks/NodeResolver-BtIknXqD.mjs.map +0 -1
  667. package/dist/chunks/NodeSelectionCommands-DK3iEh18.mjs.map +0 -1
  668. package/dist/chunks/PluginHelpers-WG1Lzzh3.mjs +0 -2
  669. package/dist/chunks/PluginHelpers-WG1Lzzh3.mjs.map +0 -1
  670. package/dist/chunks/PopupManager-Jz5JrUdC.mjs +0 -2
  671. package/dist/chunks/PopupManager-Jz5JrUdC.mjs.map +0 -1
  672. package/dist/chunks/PrintPlugin-BQ7LWbEB.mjs.map +0 -1
  673. package/dist/chunks/RangeIterator-DDOxTQIf.mjs.map +0 -1
  674. package/dist/chunks/SchemaRegistry-acc6q_5x.mjs +0 -2
  675. package/dist/chunks/SchemaRegistry-acc6q_5x.mjs.map +0 -1
  676. package/dist/chunks/SelectionSync-CwOHMMfI.mjs +0 -2
  677. package/dist/chunks/SelectionSync-CwOHMMfI.mjs.map +0 -1
  678. package/dist/chunks/SelectionTransactions-DNCzsl_b.mjs.map +0 -1
  679. package/dist/chunks/SimpleMark-CTDtEIMV.mjs +0 -2
  680. package/dist/chunks/SimpleMark-CTDtEIMV.mjs.map +0 -1
  681. package/dist/chunks/SmartPastePlugin-CjExbE9Q.mjs +0 -2
  682. package/dist/chunks/SmartPastePlugin-CjExbE9Q.mjs.map +0 -1
  683. package/dist/chunks/StrikethroughPlugin-d-EW2YYx.mjs.map +0 -1
  684. package/dist/chunks/SuperSubPlugin-C-kvFQyx.mjs.map +0 -1
  685. package/dist/chunks/TableDimensions-BcARMxQB.mjs +0 -2
  686. package/dist/chunks/TableDimensions-BcARMxQB.mjs.map +0 -1
  687. package/dist/chunks/TablePlugin-CdXY0Px5.mjs +0 -2
  688. package/dist/chunks/TablePlugin-CdXY0Px5.mjs.map +0 -1
  689. package/dist/chunks/TextColorPlugin-BLTKft_Z.mjs +0 -2
  690. package/dist/chunks/TextColorPlugin-BLTKft_Z.mjs.map +0 -1
  691. package/dist/chunks/TextDirectionAutoPlugin-LVDkKdDX.mjs.map +0 -1
  692. package/dist/chunks/TextDirectionPlugin-CtGwof7i.mjs.map +0 -1
  693. package/dist/chunks/TextDirectionService-OFOU6r_s.mjs +0 -2
  694. package/dist/chunks/TextDirectionService-OFOU6r_s.mjs.map +0 -1
  695. package/dist/chunks/TextFormattingPlugin-DlS0SeW7.mjs.map +0 -1
  696. package/dist/chunks/ToolbarPlugin-CMHJCdYY.mjs +0 -2
  697. package/dist/chunks/ToolbarPlugin-CMHJCdYY.mjs.map +0 -1
  698. package/dist/chunks/VideoPlugin-C9z4JfP_.mjs +0 -2
  699. package/dist/chunks/VideoPlugin-C9z4JfP_.mjs.map +0 -1
  700. package/dist/chunks/ar-Ctrv6cIi.mjs +0 -2
  701. package/dist/chunks/ar-Ctrv6cIi.mjs.map +0 -1
  702. package/dist/chunks/color-picker-DJ05ey9o.mjs +0 -2
  703. package/dist/chunks/color-picker-DJ05ey9o.mjs.map +0 -1
  704. package/dist/chunks/de-JhGflzS5.mjs +0 -2
  705. package/dist/chunks/de-JhGflzS5.mjs.map +0 -1
  706. package/dist/chunks/es-Bv7bDbMp.mjs +0 -2
  707. package/dist/chunks/es-Bv7bDbMp.mjs.map +0 -1
  708. package/dist/chunks/fr-DtzIu6tU.mjs +0 -2
  709. package/dist/chunks/fr-DtzIu6tU.mjs.map +0 -1
  710. package/dist/chunks/full-9sO5JbWG.mjs +0 -2
  711. package/dist/chunks/full-9sO5JbWG.mjs.map +0 -1
  712. package/dist/chunks/hi-Bu799xIO.mjs +0 -2
  713. package/dist/chunks/hi-Bu799xIO.mjs.map +0 -1
  714. package/dist/chunks/minimal-C07d5reO.mjs +0 -2
  715. package/dist/chunks/minimal-C07d5reO.mjs.map +0 -1
  716. package/dist/chunks/pt-DmN9u3NX.mjs +0 -2
  717. package/dist/chunks/pt-DmN9u3NX.mjs.map +0 -1
  718. package/dist/chunks/register-DMdtiQ_Z.mjs +0 -3
  719. package/dist/chunks/register-DMdtiQ_Z.mjs.map +0 -1
  720. package/dist/chunks/ru-BxySx7an.mjs +0 -2
  721. package/dist/chunks/ru-BxySx7an.mjs.map +0 -1
  722. package/dist/chunks/zh-DuucmOns.mjs +0 -2
  723. package/dist/chunks/zh-DuucmOns.mjs.map +0 -1
  724. package/dist/editor/styles/base.d.ts +0 -3
  725. package/dist/editor/styles/base.d.ts.map +0 -1
  726. package/dist/editor/styles/color-picker.d.ts +0 -3
  727. package/dist/editor/styles/color-picker.d.ts.map +0 -1
  728. package/dist/editor/styles/font-select.d.ts +0 -3
  729. package/dist/editor/styles/font-select.d.ts.map +0 -1
  730. package/dist/editor/styles/font-size-select.d.ts +0 -3
  731. package/dist/editor/styles/font-size-select.d.ts.map +0 -1
  732. package/dist/editor/styles/heading-select.d.ts +0 -3
  733. package/dist/editor/styles/heading-select.d.ts.map +0 -1
  734. package/dist/editor/styles/image.d.ts +0 -3
  735. package/dist/editor/styles/image.d.ts.map +0 -1
  736. package/dist/editor/styles/reduced-motion.d.ts +0 -3
  737. package/dist/editor/styles/reduced-motion.d.ts.map +0 -1
  738. package/dist/editor/styles/table.d.ts +0 -3
  739. package/dist/editor/styles/table.d.ts.map +0 -1
  740. package/dist/editor/styles/toolbar.d.ts +0 -3
  741. package/dist/editor/styles/toolbar.d.ts.map +0 -1
  742. package/dist/plugins/blockquote/BlockquoteStyles.d.ts +0 -3
  743. package/dist/plugins/blockquote/BlockquoteStyles.d.ts.map +0 -1
  744. package/dist/plugins/formula/FormulaStyles.d.ts +0 -12
  745. package/dist/plugins/formula/FormulaStyles.d.ts.map +0 -1
  746. package/dist/plugins/image/ImagePopupStyles.d.ts +0 -3
  747. package/dist/plugins/image/ImagePopupStyles.d.ts.map +0 -1
  748. package/dist/plugins/video/VideoPopupStyles.d.ts +0 -3
  749. package/dist/plugins/video/VideoPopupStyles.d.ts.map +0 -1
  750. package/dist/plugins/video/VideoStyles.d.ts +0 -3
  751. package/dist/plugins/video/VideoStyles.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Platform-ByobkiCc.mjs","names":[],"sources":["../../src/platform/Platform.ts"],"sourcesContent":["/**\n * Platform and browser detection utilities.\n *\n * Determines the current platform (macOS/iOS) and browser engine, which\n * affects keyboard shortcut bindings and browser-specific workarounds.\n * Also provides BiDi text direction detection.\n *\n * All detection results are cached after first evaluation for performance.\n */\n\ninterface NavigatorUAData {\n\treadonly platform?: string;\n}\n\nlet cachedIsMac: boolean | undefined;\nlet cachedIsFirefox: boolean | undefined;\nlet cachedIsWebKit: boolean | undefined;\n\n/** Returns `true` when running on macOS or iOS. */\nexport function isMac(): boolean {\n\tif (cachedIsMac !== undefined) return cachedIsMac;\n\tif (typeof navigator === 'undefined') {\n\t\tcachedIsMac = false;\n\t\treturn false;\n\t}\n\tif ('userAgentData' in navigator) {\n\t\tconst uaData: NavigatorUAData = navigator.userAgentData as NavigatorUAData;\n\t\tif (uaData.platform) {\n\t\t\tcachedIsMac = /macOS/i.test(uaData.platform);\n\t\t\treturn cachedIsMac;\n\t\t}\n\t}\n\tcachedIsMac = /Mac|iP(hone|[oa]d)/.test(navigator.platform);\n\treturn cachedIsMac;\n}\n\n/**\n * Returns `true` when running on Firefox (Gecko engine).\n * Only use for genuine browser workarounds, not feature detection.\n */\nexport function isFirefox(): boolean {\n\tif (cachedIsFirefox !== undefined) return cachedIsFirefox;\n\tif (typeof navigator === 'undefined') {\n\t\tcachedIsFirefox = false;\n\t\treturn false;\n\t}\n\tcachedIsFirefox = /Firefox\\//.test(navigator.userAgent);\n\treturn cachedIsFirefox;\n}\n\n/**\n * Returns `true` when running on WebKit (Safari engine).\n * Only use for genuine browser workarounds, not feature detection.\n */\nexport function isWebKit(): boolean {\n\tif (cachedIsWebKit !== undefined) return cachedIsWebKit;\n\tif (typeof navigator === 'undefined') {\n\t\tcachedIsWebKit = false;\n\t\treturn false;\n\t}\n\tcachedIsWebKit =\n\t\t/AppleWebKit\\//.test(navigator.userAgent) && !/Chrome\\//.test(navigator.userAgent);\n\treturn cachedIsWebKit;\n}\n\n/** Returns the computed text direction of the given element. */\nexport function getTextDirection(element: HTMLElement): 'ltr' | 'rtl' {\n\tconst dir: string = getComputedStyle(element).direction;\n\treturn dir === 'rtl' ? 'rtl' : 'ltr';\n}\n\n/** Returns `true` when the element is in an RTL context (computed direction is RTL). */\nexport function isRtlContext(element: HTMLElement): boolean {\n\treturn getTextDirection(element) === 'rtl';\n}\n\n/**\n * Resets cached detection results.\n * Only intended for use in tests.\n */\nexport function resetPlatformCache(): void {\n\tcachedIsMac = undefined;\n\tcachedIsFirefox = undefined;\n\tcachedIsWebKit = undefined;\n}\n"],"mappings":"AAcA,IAAI,EACA,EACA,EAGJ,SAAgB,IACf,QAAoB,IAAhB,EAA2B,OAAO,EACtC,GAAyB,oBAAd,UAEV,OADA,GAAc,GACP,EAER,GAAI,kBAAmB,UAAW,CACjC,MAAM,EAA0B,UAAU,cAC1C,GAAI,EAAO,SAEV,OADA,EAAc,SAAS,KAAK,EAAO,SAGrC,CAEA,OADA,EAAc,qBAAqB,KAAK,UAAU,SAEnD,CAMA,SAAgB,IACf,YAAwB,IAApB,EAAsC,EACjB,oBAAd,WACV,GAAkB,GACX,GAER,EAAkB,YAAY,KAAK,UAAU,UAE9C,CAMA,SAAgB,IACf,YAAuB,IAAnB,EAAqC,EAChB,oBAAd,WACV,GAAiB,GACV,GAER,EACC,gBAAgB,KAAK,UAAU,aAAe,WAAW,KAAK,UAAU,UAE1E,CAGA,SAAgB,EAAiB,GAEhC,MAAe,QADK,iBAAiB,GAAS,UACvB,MAAQ,KAChC,CAGA,SAAgB,EAAa,GAC5B,MAAqC,QAA9B,EAAiB,EACzB"}
1
+ {"version":3,"file":"Platform-ByobkiCc.mjs","names":["cachedIsMac","cachedIsFirefox","cachedIsWebKit","isMac","navigator","uaData","userAgentData","platform","test","isFirefox","userAgent","isWebKit","getTextDirection","element","getComputedStyle","direction","isRtlContext"],"sources":["../../src/platform/Platform.ts"],"sourcesContent":["/**\n * Platform and browser detection utilities.\n *\n * Determines the current platform (macOS/iOS) and browser engine, which\n * affects keyboard shortcut bindings and browser-specific workarounds.\n * Also provides BiDi text direction detection.\n *\n * All detection results are cached after first evaluation for performance.\n */\n\ninterface NavigatorUAData {\n\treadonly platform?: string;\n}\n\nlet cachedIsMac: boolean | undefined;\nlet cachedIsFirefox: boolean | undefined;\nlet cachedIsWebKit: boolean | undefined;\n\n/** Returns `true` when running on macOS or iOS. */\nexport function isMac(): boolean {\n\tif (cachedIsMac !== undefined) return cachedIsMac;\n\tif (typeof navigator === 'undefined') {\n\t\tcachedIsMac = false;\n\t\treturn false;\n\t}\n\tif ('userAgentData' in navigator) {\n\t\tconst uaData: NavigatorUAData = navigator.userAgentData as NavigatorUAData;\n\t\tif (uaData.platform) {\n\t\t\tcachedIsMac = /macOS/i.test(uaData.platform);\n\t\t\treturn cachedIsMac;\n\t\t}\n\t}\n\tcachedIsMac = /Mac|iP(hone|[oa]d)/.test(navigator.platform);\n\treturn cachedIsMac;\n}\n\n/**\n * Returns `true` when running on Firefox (Gecko engine).\n * Only use for genuine browser workarounds, not feature detection.\n */\nexport function isFirefox(): boolean {\n\tif (cachedIsFirefox !== undefined) return cachedIsFirefox;\n\tif (typeof navigator === 'undefined') {\n\t\tcachedIsFirefox = false;\n\t\treturn false;\n\t}\n\tcachedIsFirefox = /Firefox\\//.test(navigator.userAgent);\n\treturn cachedIsFirefox;\n}\n\n/**\n * Returns `true` when running on WebKit (Safari engine).\n * Only use for genuine browser workarounds, not feature detection.\n */\nexport function isWebKit(): boolean {\n\tif (cachedIsWebKit !== undefined) return cachedIsWebKit;\n\tif (typeof navigator === 'undefined') {\n\t\tcachedIsWebKit = false;\n\t\treturn false;\n\t}\n\tcachedIsWebKit =\n\t\t/AppleWebKit\\//.test(navigator.userAgent) && !/Chrome\\//.test(navigator.userAgent);\n\treturn cachedIsWebKit;\n}\n\n/** Returns the computed text direction of the given element. */\nexport function getTextDirection(element: HTMLElement): 'ltr' | 'rtl' {\n\tconst dir: string = getComputedStyle(element).direction;\n\treturn dir === 'rtl' ? 'rtl' : 'ltr';\n}\n\n/** Returns `true` when the element is in an RTL context (computed direction is RTL). */\nexport function isRtlContext(element: HTMLElement): boolean {\n\treturn getTextDirection(element) === 'rtl';\n}\n\n/**\n * Resets cached detection results.\n * Only intended for use in tests.\n */\nexport function resetPlatformCache(): void {\n\tcachedIsMac = undefined;\n\tcachedIsFirefox = undefined;\n\tcachedIsWebKit = undefined;\n}\n"],"mappings":"AAcA,IAAIA,EACAC,EACAC,EAGJ,SAAgBC,IACf,QAAoB,IAAhBH,EAA2B,OAAOA,EACtC,GAAyB,oBAAdI,UAEV,OADAJ,GAAc,GACP,EAER,GAAI,kBAAmBI,UAAW,CACjC,MAAMC,EAA0BD,UAAUE,cAC1C,GAAID,EAAOE,SAEV,OADAP,EAAc,SAASQ,KAAKH,EAAOE,SAGrC,CAEA,OADAP,EAAc,qBAAqBQ,KAAKJ,UAAUG,SAEnD,CAMA,SAAgBE,IACf,YAAwB,IAApBR,EAAsCA,EACjB,oBAAdG,WACVH,GAAkB,GACX,GAERA,EAAkB,YAAYO,KAAKJ,UAAUM,UAE9C,CAMA,SAAgBC,IACf,YAAuB,IAAnBT,EAAqCA,EAChB,oBAAdE,WACVF,GAAiB,GACV,GAERA,EACC,gBAAgBM,KAAKJ,UAAUM,aAAe,WAAWF,KAAKJ,UAAUM,UAE1E,CAGA,SAAgBE,EAAiBC,GAEhC,MAAe,QADKC,iBAAiBD,GAASE,UACvB,MAAQ,KAChC,CAGA,SAAgBC,EAAaH,GAC5B,MAAqC,QAA9BD,EAAiBC,EACzB,Q"}
@@ -0,0 +1,2 @@
1
+ import{d as e,f as n}from"./Selection-DC6AOGgF.mjs";import{n as t}from"./TypedKeys-CA4bfw9O.mjs";var r=class{resolvedLocale;constructor(e){this.resolvedLocale="browser"===e?"undefined"!=typeof navigator?navigator.language.split("-")[0]??"en":"en":e}getLocale(){return this.resolvedLocale}},o=new t("locale");async function c(e,n,t){if("en"===n)return t;const r=e[`./locales/${n}.ts`];if(!r)return t;try{return(await r()).default}catch{return t}}function s(e,n){return!!n&&(e.dispatch(n),!0)}function a(e){return e.charAt(0).toUpperCase()+e.slice(1)}function i(e){return`toggle${a(e)}`}async function l(e,n,t,r){if(n)return n;const c=e.getService(o)?.getLocale()??"en";return"en"===c?t:r(c)}function u(t){const r=t.selection;return e(r)?t.getBlock(r.nodeId):n(r)?t.getBlock(r.anchor.blockId):void 0}function d(t){const r=t.selection;return e(r)?r.nodeId:n(r)?r.anchor.blockId:void 0}function f(t){const r=t.selection;if(e(r))return[r.nodeId];if(!n(r))return[];const o=r.anchor.blockId,c=r.head.blockId;if(o===c)return[o];const s=t.getBlockOrder(),a=s.indexOf(o),i=s.indexOf(c);if(-1===a||-1===i)return[];const l=Math.min(a,i),u=Math.max(a,i);return s.slice(l,u+1)}export{f as a,c,d as i,r as l,s as n,l as o,u as r,i as s,a as t,o as u};
2
+ //# sourceMappingURL=PluginHelpers-B3gk3VB3.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PluginHelpers-B3gk3VB3.mjs","names":["isNodeSelection","isTextSelection","ServiceKey","LocaleService","resolvedLocale","constructor","locale","this","navigator","language","split","getLocale","LocaleServiceKey","async","loadLocaleModule","modules","lang","fallback","loader","default","dispatchIfPresent","context","tr","dispatch","capitalize","s","charAt","toUpperCase","slice","toCommandName","markType","resolveLocale","configLocale","defaultLocale","getService","getSelectedBlock","state","sel","selection","getBlock","nodeId","anchor","blockId","getSelectedBlockId","getSelectedBlockIds","anchorId","headId","head","order","getBlockOrder","anchorIdx","indexOf","headIdx","from","Math","min","to","max"],"sources":["../../src/i18n/LocaleService.ts","../../src/plugins/shared/LocaleLoader.ts","../../src/plugins/shared/PluginHelpers.ts"],"sourcesContent":["/**\n * Global locale service that resolves the active language.\n * Registered as a system-level service before plugin init.\n */\n\nimport { ServiceKey } from '../model/TypedKeys.js';\n\nexport class LocaleService {\n\tprivate readonly resolvedLocale: string;\n\n\tconstructor(locale: string) {\n\t\tthis.resolvedLocale =\n\t\t\tlocale === 'browser'\n\t\t\t\t? typeof navigator !== 'undefined'\n\t\t\t\t\t? (navigator.language.split('-')[0] ?? 'en')\n\t\t\t\t\t: 'en'\n\t\t\t\t: locale;\n\t}\n\n\tgetLocale(): string {\n\t\treturn this.resolvedLocale;\n\t}\n}\n\nexport const LocaleServiceKey = new ServiceKey<LocaleService>('locale');\n","/**\n * Shared helper for loading plugin locale bundles.\n *\n * Rationale:\n * Every notectl plugin used to ship its own copy of a ~15-line locale\n * loader: English shortcut, glob lookup, lazy import, try/catch fallback.\n * The logic is identical across ~23 plugins — only the locale type and\n * the default value change. This helper centralizes the pattern so each\n * plugin's `XxxLocale.ts` shrinks to a handful of lines.\n *\n * Why the glob map still lives in the plugin:\n * `import.meta.glob` is statically resolved by the bundler **relative to\n * the file that calls it**. The helper therefore cannot build the glob\n * itself — each plugin must pass in its own `import.meta.glob(...)`\n * result, and the helper takes care of everything else.\n */\n\n/**\n * Signature of a single locale loader as produced by `import.meta.glob`.\n * The bundler wraps each matched module in a thunk returning a Promise\n * that resolves to an ES module whose default export is the locale.\n */\nexport type LocaleModuleLoader<TLocale> = () => Promise<{ default: TLocale }>;\n\n/**\n * Map from the path string emitted by `import.meta.glob` (e.g.\n * `./locales/de.ts`) to its corresponding lazy loader.\n */\nexport type LocaleModuleMap<TLocale> = Record<string, LocaleModuleLoader<TLocale>>;\n\n/**\n * Loads a plugin locale for the requested language with three fallbacks:\n *\n * 1. `lang === 'en'` — returns the default locale immediately, no import.\n * 2. No matching module in the map — returns the default locale.\n * 3. Module import throws — returns the default locale.\n *\n * This is the exact behavior every plugin needs; sharing it removes ~15\n * lines of boilerplate per plugin and guarantees consistent fallback\n * semantics across the entire editor.\n *\n * @param modules The `import.meta.glob('./locales/*.ts', ...)` map from\n * the caller's module. Passing this in from the plugin\n * is mandatory — globs are resolved at the call site.\n * @param lang IETF-style language tag, e.g. `'de'`, `'zh'`, `'en'`.\n * @param fallback English default locale to return when lookup or\n * import fails. Must already be a fully-formed locale.\n */\nexport async function loadLocaleModule<TLocale>(\n\tmodules: LocaleModuleMap<TLocale>,\n\tlang: string,\n\tfallback: TLocale,\n): Promise<TLocale> {\n\tif (lang === 'en') return fallback;\n\n\tconst loader: LocaleModuleLoader<TLocale> | undefined = modules[`./locales/${lang}.ts`];\n\tif (!loader) return fallback;\n\n\ttry {\n\t\tconst mod = await loader();\n\t\treturn mod.default;\n\t} catch {\n\t\treturn fallback;\n\t}\n}\n","/**\n * Shared helper utilities for plugins.\n * Common operations extracted to avoid code duplication across plugins.\n */\n\nimport { LocaleServiceKey } from '../../i18n/LocaleService.js';\nimport type { BlockNode } from '../../model/Document.js';\nimport { isNodeSelection, isTextSelection } from '../../model/Selection.js';\nimport type { BlockId } from '../../model/TypeBrands.js';\nimport type { EditorState } from '../../state/EditorState.js';\nimport type { Transaction } from '../../state/Transaction.js';\nimport type { PluginContext } from '../Plugin.js';\n\n/**\n * Dispatches `tr` when it is non-null and reports whether anything happened.\n * Collapses the command body `if (tr) { dispatch(tr); return true; } return false;`\n * shared by mark toggle commands and attributed-mark operations into a single\n * call: `return dispatchIfPresent(context, tr);`.\n */\nexport function dispatchIfPresent(context: PluginContext, tr: Transaction | null): boolean {\n\tif (!tr) return false;\n\tcontext.dispatch(tr);\n\treturn true;\n}\n\n/** Capitalizes the first character of a string. */\nexport function capitalize(s: string): string {\n\treturn s.charAt(0).toUpperCase() + s.slice(1);\n}\n\n/** Converts a mark type to its toggle command name (e.g. 'bold' → 'toggleBold'). */\nexport function toCommandName(markType: string): string {\n\treturn `toggle${capitalize(markType)}`;\n}\n\n/**\n * Resolves the locale for a plugin, using config override, default, or dynamic loader.\n * Plugins provide their config locale, a default English locale, and a loader for other languages.\n */\nexport async function resolveLocale<T>(\n\tcontext: PluginContext,\n\tconfigLocale: T | undefined,\n\tdefaultLocale: T,\n\tloader: (lang: string) => Promise<T>,\n): Promise<T> {\n\tif (configLocale) return configLocale;\n\tconst service = context.getService(LocaleServiceKey);\n\tconst lang: string = service?.getLocale() ?? 'en';\n\treturn lang === 'en' ? defaultLocale : loader(lang);\n}\n\n/** Returns the block under the cursor, handling both TextSelection and NodeSelection. */\nexport function getSelectedBlock(state: EditorState): BlockNode | undefined {\n\tconst sel = state.selection;\n\tif (isNodeSelection(sel)) return state.getBlock(sel.nodeId);\n\tif (isTextSelection(sel)) return state.getBlock(sel.anchor.blockId);\n\treturn undefined;\n}\n\n/** Returns the block ID under the cursor, handling both TextSelection and NodeSelection. */\nexport function getSelectedBlockId(state: EditorState): BlockId | undefined {\n\tconst sel = state.selection;\n\tif (isNodeSelection(sel)) return sel.nodeId;\n\tif (isTextSelection(sel)) return sel.anchor.blockId;\n\treturn undefined;\n}\n\n/**\n * Returns every leaf-block ID covered by the current selection, in document\n * order. A NodeSelection yields its single node; a collapsed or single-block\n * TextSelection yields one ID; a multi-block TextSelection yields the full\n * inclusive range from anchor to head. Used by block-attribute commands\n * (alignment, text direction) that must apply to the whole selection.\n */\nexport function getSelectedBlockIds(state: EditorState): BlockId[] {\n\tconst sel = state.selection;\n\n\tif (isNodeSelection(sel)) return [sel.nodeId];\n\tif (!isTextSelection(sel)) return [];\n\n\tconst anchorId: BlockId = sel.anchor.blockId;\n\tconst headId: BlockId = sel.head.blockId;\n\tif (anchorId === headId) return [anchorId];\n\n\tconst order: readonly BlockId[] = state.getBlockOrder();\n\tconst anchorIdx: number = order.indexOf(anchorId);\n\tconst headIdx: number = order.indexOf(headId);\n\tif (anchorIdx === -1 || headIdx === -1) return [];\n\n\tconst from: number = Math.min(anchorIdx, headIdx);\n\tconst to: number = Math.max(anchorIdx, headIdx);\n\treturn order.slice(from, to + 1) as BlockId[];\n}\n"],"mappings":"Y,qFAOA,IAAaG,EAAb,MACCC,eAEA,WAAAC,CAAYC,GACXC,KAAKH,eACO,YAAXE,EACwB,oBAAdE,UACLA,UAAUC,SAASC,MAAM,KAAK,IAAM,KACrC,KACDJ,CACL,CAEA,SAAAK,GACC,OAAOJ,KAAKH,cACb,GAGYQ,EAAmB,IAAIV,EAA0B,UCwB9DW,eAAsBC,EACrBC,EACAC,EACAC,GAEA,GAAa,OAATD,EAAe,OAAOC,EAE1B,MAAMC,EAAkDH,EAAQ,aAAaC,QAC7E,IAAKE,EAAQ,OAAOD,EAEpB,IAEC,aADkBC,KACPC,OACZ,CAAA,MACC,OAAOF,CACR,CACD,CC7CA,SAAgBG,EAAkBC,EAAwBC,GACzD,QAAKA,IACLD,EAAQE,SAASD,IACV,EACR,CAGA,SAAgBE,EAAWC,GAC1B,OAAOA,EAAEC,OAAO,GAAGC,cAAgBF,EAAEG,MAAM,EAC5C,CAGA,SAAgBC,EAAcC,GAC7B,MAAO,SAASN,EAAWM,IAC5B,CAMAjB,eAAsBkB,EACrBV,EACAW,EACAC,EACAf,GAEA,GAAIc,EAAc,OAAOA,EAEzB,MAAMhB,EADUK,EAAQa,WAAWtB,IACLD,aAAe,KAC7C,MAAgB,OAATK,EAAgBiB,EAAgBf,EAAOF,EAC/C,CAGA,SAAgBmB,EAAiBC,GAChC,MAAMC,EAAMD,EAAME,UAClB,OAAItC,EAAgBqC,GAAaD,EAAMG,SAASF,EAAIG,QAChDvC,EAAgBoC,GAAaD,EAAMG,SAASF,EAAII,OAAOC,cAA3D,CAED,CAGA,SAAgBC,EAAmBP,GAClC,MAAMC,EAAMD,EAAME,UAClB,OAAItC,EAAgBqC,GAAaA,EAAIG,OACjCvC,EAAgBoC,GAAaA,EAAII,OAAOC,aAA5C,CAED,CASA,SAAgBE,EAAoBR,GACnC,MAAMC,EAAMD,EAAME,UAElB,GAAItC,EAAgBqC,GAAM,MAAO,CAACA,EAAIG,QACtC,IAAKvC,EAAgBoC,GAAM,MAAO,GAElC,MAAMQ,EAAoBR,EAAII,OAAOC,QAC/BI,EAAkBT,EAAIU,KAAKL,QACjC,GAAIG,IAAaC,EAAQ,MAAO,CAACD,GAEjC,MAAMG,EAA4BZ,EAAMa,gBAClCC,EAAoBF,EAAMG,QAAQN,GAClCO,EAAkBJ,EAAMG,QAAQL,GACtC,IAAkB,IAAdI,IAAgC,IAAZE,EAAgB,MAAO,GAE/C,MAAMC,EAAeC,KAAKC,IAAIL,EAAWE,GACnCI,EAAaF,KAAKG,IAAIP,EAAWE,GACvC,OAAOJ,EAAMpB,MAAMyB,EAAMG,EAAK,EAC/B,Q"}
@@ -1 +1 @@
1
- {"version":3,"file":"PopupKeyboardPatterns-BcwdDxRq.mjs","names":[],"sources":["../../src/plugins/shared/PopupKeyboardPatterns.ts"],"sourcesContent":["/**\n * Pure functions that attach WAI-ARIA keyboard patterns to popup containers.\n * Supports menu, listbox, and grid navigation patterns.\n * Delegates to shared keyboard navigation helpers.\n */\n\nimport { applyRovingTabindex, findNextDropdownItem, navigateGrid } from './KeyboardNav.js';\n\n// --- Types ---\n\nexport interface MenuKeyboardConfig {\n\treadonly container: HTMLElement;\n\treadonly itemSelector: string;\n\treadonly onActivate: (item: HTMLElement) => void;\n\treadonly onClose: () => void;\n\treadonly getActiveElement: () => Element | null;\n}\n\nexport interface ListboxKeyboardConfig {\n\treadonly container: HTMLElement;\n\treadonly itemSelector: string;\n\treadonly onSelect: (item: HTMLElement) => void;\n\treadonly onClose: () => void;\n}\n\nexport interface GridKeyboardConfig {\n\treadonly container: HTMLElement;\n\treadonly cellSelector: string;\n\treadonly columns: number;\n\treadonly totalCells: number;\n\treadonly onSelect: (cell: HTMLElement) => void;\n\treadonly onClose: () => void;\n\treadonly onNavigate?: (index: number) => void;\n}\n\n// --- Constants ---\n\nconst GRID_NAV_KEYS: ReadonlySet<string> = new Set([\n\t'ArrowUp',\n\t'ArrowDown',\n\t'ArrowLeft',\n\t'ArrowRight',\n]);\n\n// --- Menu Keyboard ---\n\n/**\n * Attaches menu keyboard navigation (ArrowUp/Down, Enter/Space, Home/End, Escape).\n * Returns a cleanup function that removes the event listener.\n */\nexport function attachMenuKeyboard(config: MenuKeyboardConfig): () => void {\n\tlet focusedIndex = 0;\n\n\tconst handler = (e: KeyboardEvent): void => {\n\t\te.stopPropagation();\n\t\tconst items: HTMLElement[] = Array.from(\n\t\t\tconfig.container.querySelectorAll(config.itemSelector),\n\t\t) as HTMLElement[];\n\t\tif (items.length === 0) return;\n\n\t\tswitch (e.key) {\n\t\t\tcase 'Escape': {\n\t\t\t\te.preventDefault();\n\t\t\t\tconfig.onClose();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase 'ArrowDown': {\n\t\t\t\te.preventDefault();\n\t\t\t\tfocusedIndex = findNextDropdownItem(items, focusedIndex, 1);\n\t\t\t\tapplyRovingTabindex(items as HTMLButtonElement[], focusedIndex);\n\t\t\t\titems[focusedIndex]?.focus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase 'ArrowUp': {\n\t\t\t\te.preventDefault();\n\t\t\t\tfocusedIndex = findNextDropdownItem(items, focusedIndex, -1);\n\t\t\t\tapplyRovingTabindex(items as HTMLButtonElement[], focusedIndex);\n\t\t\t\titems[focusedIndex]?.focus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase 'Enter':\n\t\t\tcase ' ': {\n\t\t\t\te.preventDefault();\n\t\t\t\tconst item: HTMLElement | undefined = items[focusedIndex];\n\t\t\t\tif (item) config.onActivate(item);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase 'Home': {\n\t\t\t\te.preventDefault();\n\t\t\t\tfocusedIndex = 0;\n\t\t\t\tapplyRovingTabindex(items as HTMLButtonElement[], focusedIndex);\n\t\t\t\titems[focusedIndex]?.focus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase 'End': {\n\t\t\t\te.preventDefault();\n\t\t\t\tfocusedIndex = items.length - 1;\n\t\t\t\tapplyRovingTabindex(items as HTMLButtonElement[], focusedIndex);\n\t\t\t\titems[focusedIndex]?.focus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t};\n\n\tconfig.container.addEventListener('keydown', handler);\n\treturn () => config.container.removeEventListener('keydown', handler);\n}\n\n// --- Listbox Keyboard ---\n\n/**\n * Attaches listbox keyboard navigation (ArrowUp/Down, Enter/Space, Escape).\n * Returns a cleanup function.\n */\nexport function attachListboxKeyboard(config: ListboxKeyboardConfig): () => void {\n\tlet focusedIndex = 0;\n\n\tconst handler = (e: KeyboardEvent): void => {\n\t\tconst items: HTMLElement[] = Array.from(\n\t\t\tconfig.container.querySelectorAll(config.itemSelector),\n\t\t) as HTMLElement[];\n\t\tif (items.length === 0) return;\n\n\t\tswitch (e.key) {\n\t\t\tcase 'Escape': {\n\t\t\t\te.preventDefault();\n\t\t\t\tconfig.onClose();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase 'ArrowDown': {\n\t\t\t\te.preventDefault();\n\t\t\t\tfocusedIndex = findNextDropdownItem(items, focusedIndex, 1);\n\t\t\t\tapplyRovingTabindex(items as HTMLButtonElement[], focusedIndex);\n\t\t\t\titems[focusedIndex]?.focus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase 'ArrowUp': {\n\t\t\t\te.preventDefault();\n\t\t\t\tfocusedIndex = findNextDropdownItem(items, focusedIndex, -1);\n\t\t\t\tapplyRovingTabindex(items as HTMLButtonElement[], focusedIndex);\n\t\t\t\titems[focusedIndex]?.focus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase 'Enter':\n\t\t\tcase ' ': {\n\t\t\t\te.preventDefault();\n\t\t\t\tconst item: HTMLElement | undefined = items[focusedIndex];\n\t\t\t\tif (item) config.onSelect(item);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t};\n\n\tconfig.container.addEventListener('keydown', handler);\n\treturn () => config.container.removeEventListener('keydown', handler);\n}\n\n// --- Grid Keyboard ---\n\n/**\n * Attaches grid keyboard navigation (2D arrows, Home/End per row, Enter/Space, Escape).\n * Returns a cleanup function.\n */\nexport function attachGridKeyboard(config: GridKeyboardConfig): () => void {\n\tlet focusedIndex = 0;\n\tconst columns: number = config.columns;\n\tconst totalCells: number = config.totalCells;\n\tconst totalRows: number = Math.ceil(totalCells / columns);\n\n\tconst handler = (e: KeyboardEvent): void => {\n\t\tconst cells: HTMLElement[] = Array.from(\n\t\t\tconfig.container.querySelectorAll(config.cellSelector),\n\t\t) as HTMLElement[];\n\t\tif (cells.length === 0) return;\n\n\t\tif (e.key === 'Escape') {\n\t\t\te.preventDefault();\n\t\t\tconfig.onClose();\n\t\t\treturn;\n\t\t}\n\n\t\tif (e.key === 'Enter' || e.key === ' ') {\n\t\t\te.preventDefault();\n\t\t\tconst cell: HTMLElement | undefined = cells[focusedIndex];\n\t\t\tif (cell) config.onSelect(cell);\n\t\t\treturn;\n\t\t}\n\n\t\tif (GRID_NAV_KEYS.has(e.key)) {\n\t\t\te.preventDefault();\n\t\t\tconst currentRow: number = Math.floor(focusedIndex / columns) + 1;\n\t\t\tconst currentCol: number = (focusedIndex % columns) + 1;\n\n\t\t\tconst [newRow, newCol] = navigateGrid(\n\t\t\t\tcurrentRow,\n\t\t\t\tcurrentCol,\n\t\t\t\ttotalRows,\n\t\t\t\tcolumns,\n\t\t\t\te.key as 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight',\n\t\t\t);\n\n\t\t\tlet newIdx: number = (newRow - 1) * columns + (newCol - 1);\n\t\t\tif (newIdx >= totalCells) {\n\t\t\t\tnewIdx = totalCells - 1;\n\t\t\t}\n\n\t\t\tfocusedIndex = newIdx;\n\t\t\tapplyRovingTabindex(cells as HTMLButtonElement[], focusedIndex);\n\t\t\tcells[focusedIndex]?.focus();\n\t\t\tconfig.onNavigate?.(focusedIndex);\n\t\t\treturn;\n\t\t}\n\n\t\tif (e.key === 'Home' || e.key === 'End') {\n\t\t\te.preventDefault();\n\t\t\tconst currentRow: number = Math.floor(focusedIndex / columns);\n\t\t\tconst rowStart: number = currentRow * columns;\n\t\t\tconst rowEnd: number = Math.min(rowStart + columns - 1, totalCells - 1);\n\n\t\t\tfocusedIndex = e.key === 'Home' ? rowStart : rowEnd;\n\t\t\tapplyRovingTabindex(cells as HTMLButtonElement[], focusedIndex);\n\t\t\tcells[focusedIndex]?.focus();\n\t\t\tconfig.onNavigate?.(focusedIndex);\n\t\t}\n\t};\n\n\tconfig.container.addEventListener('keydown', handler);\n\treturn () => config.container.removeEventListener('keydown', handler);\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"PopupKeyboardPatterns-BcwdDxRq.mjs","names":["findNextDropdownItem","navigateGrid","applyRovingTabindex","GRID_NAV_KEYS","Set","attachMenuKeyboard","config","focusedIndex","handler","e","stopPropagation","items","Array","from","container","querySelectorAll","itemSelector","length","key","preventDefault","onClose","focus","item","onActivate","addEventListener","removeEventListener","attachListboxKeyboard","onSelect","attachGridKeyboard","columns","totalCells","totalRows","Math","ceil","cells","cellSelector","cell","has","currentRow","floor","currentCol","newRow","newCol","newIdx","onNavigate","rowStart","rowEnd","min"],"sources":["../../src/plugins/shared/PopupKeyboardPatterns.ts"],"sourcesContent":["/**\n * Pure functions that attach WAI-ARIA keyboard patterns to popup containers.\n * Supports menu, listbox, and grid navigation patterns.\n * Delegates to shared keyboard navigation helpers.\n */\n\nimport { applyRovingTabindex, findNextDropdownItem, navigateGrid } from './KeyboardNav.js';\n\n// --- Types ---\n\nexport interface MenuKeyboardConfig {\n\treadonly container: HTMLElement;\n\treadonly itemSelector: string;\n\treadonly onActivate: (item: HTMLElement) => void;\n\treadonly onClose: () => void;\n\treadonly getActiveElement: () => Element | null;\n}\n\nexport interface ListboxKeyboardConfig {\n\treadonly container: HTMLElement;\n\treadonly itemSelector: string;\n\treadonly onSelect: (item: HTMLElement) => void;\n\treadonly onClose: () => void;\n}\n\nexport interface GridKeyboardConfig {\n\treadonly container: HTMLElement;\n\treadonly cellSelector: string;\n\treadonly columns: number;\n\treadonly totalCells: number;\n\treadonly onSelect: (cell: HTMLElement) => void;\n\treadonly onClose: () => void;\n\treadonly onNavigate?: (index: number) => void;\n}\n\n// --- Constants ---\n\nconst GRID_NAV_KEYS: ReadonlySet<string> = new Set([\n\t'ArrowUp',\n\t'ArrowDown',\n\t'ArrowLeft',\n\t'ArrowRight',\n]);\n\n// --- Menu Keyboard ---\n\n/**\n * Attaches menu keyboard navigation (ArrowUp/Down, Enter/Space, Home/End, Escape).\n * Returns a cleanup function that removes the event listener.\n */\nexport function attachMenuKeyboard(config: MenuKeyboardConfig): () => void {\n\tlet focusedIndex = 0;\n\n\tconst handler = (e: KeyboardEvent): void => {\n\t\te.stopPropagation();\n\t\tconst items: HTMLElement[] = Array.from(\n\t\t\tconfig.container.querySelectorAll(config.itemSelector),\n\t\t) as HTMLElement[];\n\t\tif (items.length === 0) return;\n\n\t\tswitch (e.key) {\n\t\t\tcase 'Escape': {\n\t\t\t\te.preventDefault();\n\t\t\t\tconfig.onClose();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase 'ArrowDown': {\n\t\t\t\te.preventDefault();\n\t\t\t\tfocusedIndex = findNextDropdownItem(items, focusedIndex, 1);\n\t\t\t\tapplyRovingTabindex(items as HTMLButtonElement[], focusedIndex);\n\t\t\t\titems[focusedIndex]?.focus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase 'ArrowUp': {\n\t\t\t\te.preventDefault();\n\t\t\t\tfocusedIndex = findNextDropdownItem(items, focusedIndex, -1);\n\t\t\t\tapplyRovingTabindex(items as HTMLButtonElement[], focusedIndex);\n\t\t\t\titems[focusedIndex]?.focus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase 'Enter':\n\t\t\tcase ' ': {\n\t\t\t\te.preventDefault();\n\t\t\t\tconst item: HTMLElement | undefined = items[focusedIndex];\n\t\t\t\tif (item) config.onActivate(item);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase 'Home': {\n\t\t\t\te.preventDefault();\n\t\t\t\tfocusedIndex = 0;\n\t\t\t\tapplyRovingTabindex(items as HTMLButtonElement[], focusedIndex);\n\t\t\t\titems[focusedIndex]?.focus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase 'End': {\n\t\t\t\te.preventDefault();\n\t\t\t\tfocusedIndex = items.length - 1;\n\t\t\t\tapplyRovingTabindex(items as HTMLButtonElement[], focusedIndex);\n\t\t\t\titems[focusedIndex]?.focus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t};\n\n\tconfig.container.addEventListener('keydown', handler);\n\treturn () => config.container.removeEventListener('keydown', handler);\n}\n\n// --- Listbox Keyboard ---\n\n/**\n * Attaches listbox keyboard navigation (ArrowUp/Down, Enter/Space, Escape).\n * Returns a cleanup function.\n */\nexport function attachListboxKeyboard(config: ListboxKeyboardConfig): () => void {\n\tlet focusedIndex = 0;\n\n\tconst handler = (e: KeyboardEvent): void => {\n\t\tconst items: HTMLElement[] = Array.from(\n\t\t\tconfig.container.querySelectorAll(config.itemSelector),\n\t\t) as HTMLElement[];\n\t\tif (items.length === 0) return;\n\n\t\tswitch (e.key) {\n\t\t\tcase 'Escape': {\n\t\t\t\te.preventDefault();\n\t\t\t\tconfig.onClose();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase 'ArrowDown': {\n\t\t\t\te.preventDefault();\n\t\t\t\tfocusedIndex = findNextDropdownItem(items, focusedIndex, 1);\n\t\t\t\tapplyRovingTabindex(items as HTMLButtonElement[], focusedIndex);\n\t\t\t\titems[focusedIndex]?.focus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase 'ArrowUp': {\n\t\t\t\te.preventDefault();\n\t\t\t\tfocusedIndex = findNextDropdownItem(items, focusedIndex, -1);\n\t\t\t\tapplyRovingTabindex(items as HTMLButtonElement[], focusedIndex);\n\t\t\t\titems[focusedIndex]?.focus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase 'Enter':\n\t\t\tcase ' ': {\n\t\t\t\te.preventDefault();\n\t\t\t\tconst item: HTMLElement | undefined = items[focusedIndex];\n\t\t\t\tif (item) config.onSelect(item);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t};\n\n\tconfig.container.addEventListener('keydown', handler);\n\treturn () => config.container.removeEventListener('keydown', handler);\n}\n\n// --- Grid Keyboard ---\n\n/**\n * Attaches grid keyboard navigation (2D arrows, Home/End per row, Enter/Space, Escape).\n * Returns a cleanup function.\n */\nexport function attachGridKeyboard(config: GridKeyboardConfig): () => void {\n\tlet focusedIndex = 0;\n\tconst columns: number = config.columns;\n\tconst totalCells: number = config.totalCells;\n\tconst totalRows: number = Math.ceil(totalCells / columns);\n\n\tconst handler = (e: KeyboardEvent): void => {\n\t\tconst cells: HTMLElement[] = Array.from(\n\t\t\tconfig.container.querySelectorAll(config.cellSelector),\n\t\t) as HTMLElement[];\n\t\tif (cells.length === 0) return;\n\n\t\tif (e.key === 'Escape') {\n\t\t\te.preventDefault();\n\t\t\tconfig.onClose();\n\t\t\treturn;\n\t\t}\n\n\t\tif (e.key === 'Enter' || e.key === ' ') {\n\t\t\te.preventDefault();\n\t\t\tconst cell: HTMLElement | undefined = cells[focusedIndex];\n\t\t\tif (cell) config.onSelect(cell);\n\t\t\treturn;\n\t\t}\n\n\t\tif (GRID_NAV_KEYS.has(e.key)) {\n\t\t\te.preventDefault();\n\t\t\tconst currentRow: number = Math.floor(focusedIndex / columns) + 1;\n\t\t\tconst currentCol: number = (focusedIndex % columns) + 1;\n\n\t\t\tconst [newRow, newCol] = navigateGrid(\n\t\t\t\tcurrentRow,\n\t\t\t\tcurrentCol,\n\t\t\t\ttotalRows,\n\t\t\t\tcolumns,\n\t\t\t\te.key as 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight',\n\t\t\t);\n\n\t\t\tlet newIdx: number = (newRow - 1) * columns + (newCol - 1);\n\t\t\tif (newIdx >= totalCells) {\n\t\t\t\tnewIdx = totalCells - 1;\n\t\t\t}\n\n\t\t\tfocusedIndex = newIdx;\n\t\t\tapplyRovingTabindex(cells as HTMLButtonElement[], focusedIndex);\n\t\t\tcells[focusedIndex]?.focus();\n\t\t\tconfig.onNavigate?.(focusedIndex);\n\t\t\treturn;\n\t\t}\n\n\t\tif (e.key === 'Home' || e.key === 'End') {\n\t\t\te.preventDefault();\n\t\t\tconst currentRow: number = Math.floor(focusedIndex / columns);\n\t\t\tconst rowStart: number = currentRow * columns;\n\t\t\tconst rowEnd: number = Math.min(rowStart + columns - 1, totalCells - 1);\n\n\t\t\tfocusedIndex = e.key === 'Home' ? rowStart : rowEnd;\n\t\t\tapplyRovingTabindex(cells as HTMLButtonElement[], focusedIndex);\n\t\t\tcells[focusedIndex]?.focus();\n\t\t\tconfig.onNavigate?.(focusedIndex);\n\t\t}\n\t};\n\n\tconfig.container.addEventListener('keydown', handler);\n\treturn () => config.container.removeEventListener('keydown', handler);\n}\n"],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ import{n as e}from"./TypedKeys-CA4bfw9O.mjs";import{i as t}from"./Platform-ByobkiCc.mjs";import{a as s,i as n,t as o}from"./PopupPositioning-CIqgpqlW.mjs";var i=new e("popup"),r=class{stack=[];referenceNode;constructor(e){this.referenceNode=e}open(e){const t=document.createElement("div");t.className=e.className?`notectl-popup ${e.className}`:"notectl-popup",e.ariaRole&&t.setAttribute("role",e.ariaRole),e.ariaLabel&&t.setAttribute("aria-label",e.ariaLabel);const n=e.parent?this.findEntryByHandle(e.parent):null;let i;const r={close:e=>this.closeEntry(i,e),getElement:()=>t},c=s=>{const n=s.composedPath();if(!n.includes(t)){for(const e of this.stack)if(n.includes(e.element))return;e.anchor instanceof HTMLElement&&n.includes(e.anchor)||this.closeEntry(i)}};i={element:t,config:e,clickOutsideHandler:c,parent:n,listenerRegistrationTimer:null,documentListenerAttached:!1},this.stack.push(i);try{e.content(t,e=>this.closeEntry(i,e))}catch(a){throw this.removeEntry(i),a}if(!this.stack.includes(i))return r;const l=e.referenceNode??this.referenceNode;return o(t,l),s(t),this.positionEntry(i),i.listenerRegistrationTimer=setTimeout(()=>{i.listenerRegistrationTimer=null,this.stack.includes(i)&&(document.addEventListener("mousedown",c),i.documentListenerAttached=!0)},0),!1!==e.autoFocus&&this.focusFirstItem(t),r}close(){const e=this.stack[this.stack.length-1];e&&this.closeEntry(e)}closeAll(){for(;this.stack.length>0;){const e=this.stack[this.stack.length-1];e&&this.closeEntry(e)}}isOpen(){return this.stack.length>0}destroy(){this.closeAll()}closeEntry(e,t){const s=this.stack.indexOf(e);if(-1!==s){for(;this.stack.length>s+1;){const e=this.stack[this.stack.length-1];e&&this.removeEntry(e)}this.removeEntry(e),void 0!==t&&"restoreFocusTo"in t?t.restoreFocusTo?.focus():e.config.restoreFocusTo&&e.config.restoreFocusTo.focus(),e.config.onClose?.()}}removeEntry(e){const t=this.stack.indexOf(e);-1!==t&&(this.stack.splice(t,1),null!==e.listenerRegistrationTimer&&(clearTimeout(e.listenerRegistrationTimer),e.listenerRegistrationTimer=null),e.element.remove(),e.documentListenerAttached&&(document.removeEventListener("mousedown",e.clickOutsideHandler),e.documentListenerAttached=!1))}reposition(e){const t=this.findEntryByHandle(e);t&&this.positionEntry(t)}positionEntry(e){const t=e.config,s=t.anchor instanceof HTMLElement?t.anchor.getBoundingClientRect():t.anchor;n(e.element,s,{position:t.position??"below-start",isRtl:this.isRtlContext()})}findEntryByHandle(e){const t=e.getElement();return this.stack.find(e=>e.element===t)??null}isRtlContext(){return this.referenceNode instanceof HTMLElement&&t(this.referenceNode)}focusFirstItem(e){requestAnimationFrame(()=>{e.isConnected&&(e.querySelector('[role="menuitem"]')??e.querySelector('[role="option"]')??e.querySelector('[role="gridcell"]')??e.querySelector("input, textarea")??e.querySelector("button"))?.focus()})}};export{i as n,r as t};
2
+ //# sourceMappingURL=PopupManager-Dxv0OVMo.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PopupManager-Dxv0OVMo.mjs","names":["ServiceKey","isRtlContext","promoteToTopLayer","positionPopup","appendToRoot","PopupServiceKey","PopupManager","stack","referenceNode","constructor","this","open","config","popup","document","createElement","className","ariaRole","setAttribute","ariaLabel","parentEntry","parent","findEntryByHandle","entry","handle","close","options","closeEntry","getElement","clickOutsideHandler","e","path","composedPath","includes","stackEntry","element","anchor","HTMLElement","listenerRegistrationTimer","documentListenerAttached","push","content","error","removeEntry","refNode","positionEntry","setTimeout","addEventListener","autoFocus","focusFirstItem","top","length","closeAll","isOpen","destroy","index","indexOf","child","restoreFocusTo","focus","onClose","splice","clearTimeout","remove","removeEventListener","reposition","anchorRect","getBoundingClientRect","position","isRtl","find","requestAnimationFrame","isConnected","querySelector"],"sources":["../../src/plugins/shared/PopupManager.ts"],"sourcesContent":["/**\n * Central popup lifecycle manager. Handles creation, positioning,\n * click-outside closing, Escape key, focus restoration, and popup stacking\n * for submenus/nested popups.\n */\n\nimport { isRtlContext } from '../../platform/Platform.js';\nimport { ServiceKey } from '../Plugin.js';\nimport {\n\ttype PopupPosition,\n\tappendToRoot,\n\tpositionPopup,\n\tpromoteToTopLayer,\n} from './PopupPositioning.js';\n\n// --- Types ---\n\n/** Options for overriding focus restoration when closing a popup. */\nexport interface PopupCloseOptions {\n\t/**\n\t * Override the default focus target on close.\n\t * - `HTMLElement` → focus that element instead of `config.restoreFocusTo`\n\t * - `null` → skip focus restoration entirely\n\t * - `undefined` / omitted → use default `config.restoreFocusTo`\n\t */\n\treadonly restoreFocusTo?: HTMLElement | null;\n}\n\nexport interface PopupConfig {\n\treadonly anchor: HTMLElement | DOMRect;\n\treadonly content: (container: HTMLElement, close: (options?: PopupCloseOptions) => void) => void;\n\treadonly className?: string;\n\treadonly ariaRole?: 'menu' | 'listbox' | 'grid' | 'dialog';\n\treadonly ariaLabel?: string;\n\t/** Focus the first control on open. Disable for non-modal previews while editing. */\n\treadonly autoFocus?: boolean;\n\treadonly restoreFocusTo?: HTMLElement;\n\treadonly onClose?: () => void;\n\treadonly position?: PopupPosition;\n\treadonly parent?: PopupHandle;\n\treadonly referenceNode?: Node;\n}\n\nexport interface PopupHandle {\n\tclose(options?: PopupCloseOptions): void;\n\tgetElement(): HTMLElement;\n}\n\nexport interface PopupServiceAPI {\n\topen(config: PopupConfig): PopupHandle;\n\tclose(): void;\n\tcloseAll(): void;\n\tisOpen(): boolean;\n}\n\nexport const PopupServiceKey = new ServiceKey<PopupServiceAPI>('popup');\n\n// --- Internal Entry ---\n\ninterface PopupEntry {\n\treadonly element: HTMLElement;\n\treadonly config: PopupConfig;\n\treadonly clickOutsideHandler: (e: MouseEvent) => void;\n\treadonly parent: PopupEntry | null;\n\tlistenerRegistrationTimer: ReturnType<typeof setTimeout> | null;\n\tdocumentListenerAttached: boolean;\n}\n\n// --- Manager ---\n\nexport class PopupManager implements PopupServiceAPI {\n\tprivate readonly stack: PopupEntry[] = [];\n\tprivate readonly referenceNode: Node;\n\n\tconstructor(referenceNode: Node) {\n\t\tthis.referenceNode = referenceNode;\n\t}\n\n\t/** Opens a popup with the given configuration. Returns a handle for closing it. */\n\topen(config: PopupConfig): PopupHandle {\n\t\tconst popup: HTMLDivElement = document.createElement('div');\n\t\tpopup.className = config.className ? `notectl-popup ${config.className}` : 'notectl-popup';\n\n\t\tif (config.ariaRole) {\n\t\t\tpopup.setAttribute('role', config.ariaRole);\n\t\t}\n\t\tif (config.ariaLabel) {\n\t\t\tpopup.setAttribute('aria-label', config.ariaLabel);\n\t\t}\n\n\t\tconst parentEntry: PopupEntry | null = config.parent\n\t\t\t? this.findEntryByHandle(config.parent)\n\t\t\t: null;\n\n\t\tlet entry!: PopupEntry;\n\t\tconst handle: PopupHandle = {\n\t\t\tclose: (options?: PopupCloseOptions) => this.closeEntry(entry, options),\n\t\t\tgetElement: () => popup,\n\t\t};\n\n\t\tconst clickOutsideHandler = (e: MouseEvent): void => {\n\t\t\tconst path: EventTarget[] = e.composedPath();\n\t\t\tif (path.includes(popup)) return;\n\n\t\t\t// Don't close if click is inside any ancestor popup in the stack\n\t\t\tfor (const stackEntry of this.stack) {\n\t\t\t\tif (path.includes(stackEntry.element)) return;\n\t\t\t}\n\n\t\t\t// Don't close if click is on the anchor element\n\t\t\tif (config.anchor instanceof HTMLElement && path.includes(config.anchor)) return;\n\n\t\t\tthis.closeEntry(entry);\n\t\t};\n\n\t\tentry = {\n\t\t\telement: popup,\n\t\t\tconfig,\n\t\t\tclickOutsideHandler,\n\t\t\tparent: parentEntry,\n\t\t\tlistenerRegistrationTimer: null,\n\t\t\tdocumentListenerAttached: false,\n\t\t};\n\n\t\tthis.stack.push(entry);\n\n\t\ttry {\n\t\t\tconfig.content(popup, (options?: PopupCloseOptions) => this.closeEntry(entry, options));\n\t\t} catch (error) {\n\t\t\tthis.removeEntry(entry);\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (!this.stack.includes(entry)) {\n\t\t\treturn handle;\n\t\t}\n\n\t\tconst refNode: Node = config.referenceNode ?? this.referenceNode;\n\t\tappendToRoot(popup, refNode);\n\t\t// Promote to the top layer before measuring/positioning so the popup\n\t\t// escapes any ancestor stacking context in the host page.\n\t\tpromoteToTopLayer(popup);\n\n\t\tthis.positionEntry(entry);\n\n\t\tentry.listenerRegistrationTimer = setTimeout(() => {\n\t\t\tentry.listenerRegistrationTimer = null;\n\t\t\tif (!this.stack.includes(entry)) return;\n\t\t\tdocument.addEventListener('mousedown', clickOutsideHandler);\n\t\t\tentry.documentListenerAttached = true;\n\t\t}, 0);\n\n\t\tif (config.autoFocus !== false) this.focusFirstItem(popup);\n\n\t\treturn handle;\n\t}\n\n\t/** Closes the topmost popup in the stack. */\n\tclose(): void {\n\t\tconst top: PopupEntry | undefined = this.stack[this.stack.length - 1];\n\t\tif (top) {\n\t\t\tthis.closeEntry(top);\n\t\t}\n\t}\n\n\t/** Closes all open popups. */\n\tcloseAll(): void {\n\t\twhile (this.stack.length > 0) {\n\t\t\tconst top: PopupEntry | undefined = this.stack[this.stack.length - 1];\n\t\t\tif (top) {\n\t\t\t\tthis.closeEntry(top);\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Returns true if any popup is currently open. */\n\tisOpen(): boolean {\n\t\treturn this.stack.length > 0;\n\t}\n\n\t/** Cleans up all popups and event listeners. */\n\tdestroy(): void {\n\t\tthis.closeAll();\n\t}\n\n\t// --- Internal ---\n\n\tprivate closeEntry(entry: PopupEntry, options?: PopupCloseOptions): void {\n\t\tconst index: number = this.stack.indexOf(entry);\n\t\tif (index === -1) return;\n\n\t\t// Close all child popups first (anything above this entry in the stack)\n\t\twhile (this.stack.length > index + 1) {\n\t\t\tconst child: PopupEntry | undefined = this.stack[this.stack.length - 1];\n\t\t\tif (child) {\n\t\t\t\tthis.removeEntry(child);\n\t\t\t}\n\t\t}\n\n\t\tthis.removeEntry(entry);\n\n\t\tif (options !== undefined && 'restoreFocusTo' in options) {\n\t\t\toptions.restoreFocusTo?.focus();\n\t\t} else if (entry.config.restoreFocusTo) {\n\t\t\tentry.config.restoreFocusTo.focus();\n\t\t}\n\t\tentry.config.onClose?.();\n\t}\n\n\tprivate removeEntry(entry: PopupEntry): void {\n\t\tconst index: number = this.stack.indexOf(entry);\n\t\tif (index === -1) return;\n\n\t\tthis.stack.splice(index, 1);\n\t\tif (entry.listenerRegistrationTimer !== null) {\n\t\t\tclearTimeout(entry.listenerRegistrationTimer);\n\t\t\tentry.listenerRegistrationTimer = null;\n\t\t}\n\t\tentry.element.remove();\n\t\tif (entry.documentListenerAttached) {\n\t\t\tdocument.removeEventListener('mousedown', entry.clickOutsideHandler);\n\t\t\tentry.documentListenerAttached = false;\n\t\t}\n\t}\n\n\t/** Re-anchors an open popup after its anchor moved, for example through scrolling or resizing. */\n\treposition(handle: PopupHandle): void {\n\t\tconst entry: PopupEntry | null = this.findEntryByHandle(handle);\n\t\tif (entry) this.positionEntry(entry);\n\t}\n\n\tprivate positionEntry(entry: PopupEntry): void {\n\t\tconst config: PopupConfig = entry.config;\n\t\tconst anchorRect: DOMRect =\n\t\t\tconfig.anchor instanceof HTMLElement ? config.anchor.getBoundingClientRect() : config.anchor;\n\t\tpositionPopup(entry.element, anchorRect, {\n\t\t\tposition: config.position ?? 'below-start',\n\t\t\tisRtl: this.isRtlContext(),\n\t\t});\n\t}\n\n\tprivate findEntryByHandle(handle: PopupHandle): PopupEntry | null {\n\t\tconst element: HTMLElement = handle.getElement();\n\t\treturn this.stack.find((e) => e.element === element) ?? null;\n\t}\n\n\t/** Detects whether the editor context is RTL from the computed style. */\n\tprivate isRtlContext(): boolean {\n\t\tif (this.referenceNode instanceof HTMLElement) {\n\t\t\treturn isRtlContext(this.referenceNode);\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate focusFirstItem(popup: HTMLElement): void {\n\t\trequestAnimationFrame(() => {\n\t\t\tif (!popup.isConnected) return;\n\t\t\tconst firstFocusable: HTMLElement | null =\n\t\t\t\tpopup.querySelector('[role=\"menuitem\"]') ??\n\t\t\t\tpopup.querySelector('[role=\"option\"]') ??\n\t\t\t\tpopup.querySelector('[role=\"gridcell\"]') ??\n\t\t\t\t// `input, textarea` returns whichever comes first in the DOM, so a\n\t\t\t\t// popup whose primary field is a textarea (e.g. the formula editor's\n\t\t\t\t// LaTeX field) focuses that rather than a later text input.\n\t\t\t\tpopup.querySelector('input, textarea') ??\n\t\t\t\tpopup.querySelector('button');\n\t\t\tfirstFocusable?.focus();\n\t\t});\n\t}\n}\n"],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"file":"PopupPositioning-CIqgpqlW.mjs","names":[],"sources":["../../src/plugins/shared/PopupPositioning.ts"],"sourcesContent":["/**\n * Shared popup positioning logic. Positions a popup element relative to an\n * anchor rectangle, clamping to the viewport. Also provides a shadow DOM-aware\n * append helper.\n */\n\nimport { setStyleProperties } from '../../style/StyleRuntime.js';\n\n// --- Types ---\n\nexport type PopupPosition = 'below-start' | 'below-end' | 'right';\n\nexport interface PositionOptions {\n\treadonly position: PopupPosition;\n\treadonly offset?: number;\n\treadonly isRtl?: boolean;\n}\n\nexport interface ContainingBlockOffset {\n\treadonly x: number;\n\treadonly y: number;\n\treadonly rightX: number;\n}\n\n// --- Constants ---\n\nconst DEFAULT_OFFSET = 2;\nconst Z_INDEX = '10000';\nconst POPUP_MIN_MARGIN = 4;\n\n// --- Containing Block Offset ---\n\n/**\n * Measures the offset between the popup's CSS containing block and the\n * viewport. When an ancestor has `transform`, `will-change: transform`,\n * `filter`, or `perspective`, `position: fixed` resolves relative to that\n * ancestor — not the viewport. This probe detects the shift so callers\n * can compensate.\n *\n * Technique: temporarily set `top: 0; left: 0` on the fixed-position\n * element and read `getBoundingClientRect()`. If no containing-block\n * ancestor exists the rect origin is `(0, 0)`; otherwise it equals the\n * ancestor's offset.\n */\nexport function measureContainingBlockOffset(popup: HTMLElement): ContainingBlockOffset {\n\tconst prevTop: string = popup.style.top;\n\tconst prevLeft: string = popup.style.left;\n\tconst prevRight: string = popup.style.right;\n\n\t// Probe 1: left-edge offset\n\tpopup.style.top = '0px';\n\tpopup.style.left = '0px';\n\tpopup.style.right = 'auto';\n\n\tconst leftRect: DOMRect = popup.getBoundingClientRect();\n\tconst x: number = leftRect.left;\n\tconst y: number = leftRect.top;\n\n\t// Probe 2: right-edge offset\n\tpopup.style.left = 'auto';\n\tpopup.style.right = '0px';\n\n\tconst rightRect: DOMRect = popup.getBoundingClientRect();\n\tconst rightX: number = window.innerWidth - rightRect.right;\n\n\tpopup.style.top = prevTop;\n\tpopup.style.left = prevLeft;\n\tpopup.style.right = prevRight;\n\n\treturn { x, y, rightX };\n}\n\n// --- Positioning ---\n\n/**\n * Positions a popup element relative to the given anchor rectangle.\n * Uses fixed positioning and clamps to the viewport edges.\n * Automatically compensates for ancestors that create a new containing\n * block (e.g. `transform`, `will-change: transform`).\n */\nexport function positionPopup(popup: HTMLElement, anchor: DOMRect, options: PositionOptions): void {\n\tconst offset: number = options.offset ?? DEFAULT_OFFSET;\n\tconst vpWidth: number = window.innerWidth;\n\tconst vpHeight: number = window.innerHeight;\n\n\t// Apply fixed positioning first so offsetWidth/offsetHeight reflect\n\t// shrink-to-fit sizing rather than normal-flow block width.\n\tsetStyleProperties(popup, { position: 'fixed', zIndex: Z_INDEX });\n\n\t// Detect containing-block offset caused by ancestor transforms etc.\n\tconst cbOffset: ContainingBlockOffset = measureContainingBlockOffset(popup);\n\n\tconst popupWidth: number = popup.offsetWidth;\n\tconst popupHeight: number = popup.offsetHeight;\n\n\tconst styles: Record<string, string> = {};\n\n\tswitch (options.position) {\n\t\tcase 'below-start': {\n\t\t\tlet top: number = anchor.bottom + offset;\n\n\t\t\tif (options.isRtl) {\n\t\t\t\t// RTL: anchor to physical right edge (visual start)\n\t\t\t\tlet right: number = vpWidth - anchor.right;\n\t\t\t\tif (right + popupWidth > vpWidth - POPUP_MIN_MARGIN) {\n\t\t\t\t\tright = vpWidth - popupWidth - POPUP_MIN_MARGIN;\n\t\t\t\t}\n\t\t\t\tif (top + popupHeight > vpHeight - POPUP_MIN_MARGIN) {\n\t\t\t\t\ttop = anchor.top - popupHeight - offset;\n\t\t\t\t}\n\t\t\t\tif (right < POPUP_MIN_MARGIN) right = POPUP_MIN_MARGIN;\n\t\t\t\tif (top < POPUP_MIN_MARGIN) top = POPUP_MIN_MARGIN;\n\t\t\t\tstyles.top = `${top - cbOffset.y}px`;\n\t\t\t\tstyles.right = `${right - cbOffset.rightX}px`;\n\t\t\t\tstyles.left = 'auto';\n\t\t\t} else {\n\t\t\t\tlet left: number = anchor.left;\n\t\t\t\tif (left + popupWidth > vpWidth - POPUP_MIN_MARGIN) {\n\t\t\t\t\tleft = vpWidth - popupWidth - POPUP_MIN_MARGIN;\n\t\t\t\t}\n\t\t\t\tif (top + popupHeight > vpHeight - POPUP_MIN_MARGIN) {\n\t\t\t\t\ttop = anchor.top - popupHeight - offset;\n\t\t\t\t}\n\t\t\t\tif (left < POPUP_MIN_MARGIN) left = POPUP_MIN_MARGIN;\n\t\t\t\tif (top < POPUP_MIN_MARGIN) top = POPUP_MIN_MARGIN;\n\t\t\t\tstyles.top = `${top - cbOffset.y}px`;\n\t\t\t\tstyles.left = `${left - cbOffset.x}px`;\n\t\t\t\tstyles.right = 'auto';\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase 'below-end': {\n\t\t\tlet top: number = anchor.bottom + offset;\n\n\t\t\tif (options.isRtl) {\n\t\t\t\t// RTL: \"end\" = physical left edge\n\t\t\t\tlet left: number = anchor.left;\n\t\t\t\tif (left + popupWidth > vpWidth - POPUP_MIN_MARGIN) {\n\t\t\t\t\tleft = vpWidth - popupWidth - POPUP_MIN_MARGIN;\n\t\t\t\t}\n\t\t\t\tif (top + popupHeight > vpHeight - POPUP_MIN_MARGIN) {\n\t\t\t\t\ttop = anchor.top - popupHeight - offset;\n\t\t\t\t}\n\t\t\t\tif (left < POPUP_MIN_MARGIN) left = POPUP_MIN_MARGIN;\n\t\t\t\tif (top < POPUP_MIN_MARGIN) top = POPUP_MIN_MARGIN;\n\t\t\t\tstyles.top = `${top - cbOffset.y}px`;\n\t\t\t\tstyles.left = `${left - cbOffset.x}px`;\n\t\t\t\tstyles.right = 'auto';\n\t\t\t} else {\n\t\t\t\t// LTR: \"end\" = physical right edge\n\t\t\t\tlet right: number = vpWidth - anchor.right;\n\t\t\t\tif (right + popupWidth > vpWidth - POPUP_MIN_MARGIN) {\n\t\t\t\t\tright = vpWidth - popupWidth - POPUP_MIN_MARGIN;\n\t\t\t\t}\n\t\t\t\tif (top + popupHeight > vpHeight - POPUP_MIN_MARGIN) {\n\t\t\t\t\ttop = anchor.top - popupHeight - offset;\n\t\t\t\t}\n\t\t\t\tif (right < POPUP_MIN_MARGIN) right = POPUP_MIN_MARGIN;\n\t\t\t\tif (top < POPUP_MIN_MARGIN) top = POPUP_MIN_MARGIN;\n\t\t\t\tstyles.top = `${top - cbOffset.y}px`;\n\t\t\t\tstyles.right = `${right - cbOffset.rightX}px`;\n\t\t\t\tstyles.left = 'auto';\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase 'right': {\n\t\t\tlet top: number = anchor.top;\n\n\t\t\tif (options.isRtl) {\n\t\t\t\t// RTL: open submenu to the physical left\n\t\t\t\tlet left: number = anchor.left - popupWidth - offset;\n\t\t\t\tif (left < POPUP_MIN_MARGIN) {\n\t\t\t\t\tleft = anchor.right + offset;\n\t\t\t\t}\n\t\t\t\tif (top + popupHeight > vpHeight - POPUP_MIN_MARGIN) {\n\t\t\t\t\ttop = vpHeight - popupHeight - POPUP_MIN_MARGIN;\n\t\t\t\t}\n\t\t\t\tif (left < POPUP_MIN_MARGIN) left = POPUP_MIN_MARGIN;\n\t\t\t\tif (top < POPUP_MIN_MARGIN) top = POPUP_MIN_MARGIN;\n\t\t\t\tstyles.top = `${top - cbOffset.y}px`;\n\t\t\t\tstyles.left = `${left - cbOffset.x}px`;\n\t\t\t\tstyles.right = 'auto';\n\t\t\t} else {\n\t\t\t\tlet left: number = anchor.right + offset;\n\t\t\t\tif (left + popupWidth > vpWidth - POPUP_MIN_MARGIN) {\n\t\t\t\t\tleft = anchor.left - popupWidth - offset;\n\t\t\t\t}\n\t\t\t\tif (top + popupHeight > vpHeight - POPUP_MIN_MARGIN) {\n\t\t\t\t\ttop = vpHeight - popupHeight - POPUP_MIN_MARGIN;\n\t\t\t\t}\n\t\t\t\tif (left < POPUP_MIN_MARGIN) left = POPUP_MIN_MARGIN;\n\t\t\t\tif (top < POPUP_MIN_MARGIN) top = POPUP_MIN_MARGIN;\n\t\t\t\tstyles.top = `${top - cbOffset.y}px`;\n\t\t\t\tstyles.left = `${left - cbOffset.x}px`;\n\t\t\t\tstyles.right = 'auto';\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tsetStyleProperties(popup, styles);\n}\n\n/**\n * Appends an element to the appropriate root: the shadow root if the\n * reference node lives inside one, otherwise `document.body`.\n */\nexport function appendToRoot(element: HTMLElement, referenceNode: Node): void {\n\tconst root: Node = referenceNode.getRootNode();\n\tif (root instanceof ShadowRoot) {\n\t\troot.appendChild(element);\n\t} else {\n\t\tdocument.body.appendChild(element);\n\t}\n}\n\n/** Returns the focused element in the reference node's root, including nested shadow roots. */\nexport function getDeepActiveHTMLElement(referenceNode: Node): HTMLElement | null {\n\tconst root: Node = referenceNode.getRootNode();\n\tlet active: Element | null =\n\t\troot instanceof ShadowRoot || root instanceof Document\n\t\t\t? root.activeElement\n\t\t\t: document.activeElement;\n\twhile (active?.shadowRoot?.activeElement) active = active.shadowRoot.activeElement;\n\treturn active instanceof HTMLElement ? active : null;\n}\n\n/**\n * Promotes a popup/overlay to the browser's top layer via the Popover API so it\n * paints above — and receives pointer events ahead of — every stacking context\n * in the host page. A high `z-index` alone is not enough: an ancestor that forms\n * a stacking context (e.g. Starlight's `isolation: isolate` content wrapper)\n * traps the popup below a sibling such as the fixed table-of-contents sidebar,\n * so clicks on the overlapped region hit the sidebar and dismiss the popup.\n *\n * The element keeps living in the editor's shadow DOM, so its registered styles\n * still apply; only its paint layer changes. Must be called while the element is\n * connected to the document and BEFORE positioning, so subsequent\n * `offsetWidth`/containing-block measurements reflect the displayed top-layer\n * box.\n *\n * No-ops when the Popover API is unavailable (older engines, happy-dom in unit\n * tests); callers then fall back to plain `z-index` stacking. Neutralizes the UA\n * popover box styles (`inset: 0; margin: auto`) so the caller's explicit\n * `top`/`left` placement is what positions the element.\n */\nexport function promoteToTopLayer(element: HTMLElement): void {\n\tif (typeof element.showPopover !== 'function') return;\n\telement.setAttribute('popover', 'manual');\n\ttry {\n\t\telement.showPopover();\n\t} catch {\n\t\telement.removeAttribute('popover');\n\t\treturn;\n\t}\n\tsetStyleProperties(element, { margin: '0', inset: 'auto' });\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"PopupPositioning-CIqgpqlW.mjs","names":["setStyleProperties","measureContainingBlockOffset","popup","prevTop","style","top","prevLeft","left","prevRight","right","leftRect","getBoundingClientRect","x","y","rightRect","rightX","window","innerWidth","positionPopup","anchor","options","offset","vpWidth","vpHeight","innerHeight","position","zIndex","cbOffset","popupWidth","offsetWidth","popupHeight","offsetHeight","styles","bottom","isRtl","appendToRoot","element","referenceNode","root","getRootNode","ShadowRoot","appendChild","document","body","getDeepActiveHTMLElement","active","Document","activeElement","shadowRoot","HTMLElement","promoteToTopLayer","showPopover","setAttribute","removeAttribute","margin","inset"],"sources":["../../src/plugins/shared/PopupPositioning.ts"],"sourcesContent":["/**\n * Shared popup positioning logic. Positions a popup element relative to an\n * anchor rectangle, clamping to the viewport. Also provides a shadow DOM-aware\n * append helper.\n */\n\nimport { setStyleProperties } from '../../style/StyleRuntime.js';\n\n// --- Types ---\n\nexport type PopupPosition = 'below-start' | 'below-end' | 'right';\n\nexport interface PositionOptions {\n\treadonly position: PopupPosition;\n\treadonly offset?: number;\n\treadonly isRtl?: boolean;\n}\n\nexport interface ContainingBlockOffset {\n\treadonly x: number;\n\treadonly y: number;\n\treadonly rightX: number;\n}\n\n// --- Constants ---\n\nconst DEFAULT_OFFSET = 2;\nconst Z_INDEX = '10000';\nconst POPUP_MIN_MARGIN = 4;\n\n// --- Containing Block Offset ---\n\n/**\n * Measures the offset between the popup's CSS containing block and the\n * viewport. When an ancestor has `transform`, `will-change: transform`,\n * `filter`, or `perspective`, `position: fixed` resolves relative to that\n * ancestor — not the viewport. This probe detects the shift so callers\n * can compensate.\n *\n * Technique: temporarily set `top: 0; left: 0` on the fixed-position\n * element and read `getBoundingClientRect()`. If no containing-block\n * ancestor exists the rect origin is `(0, 0)`; otherwise it equals the\n * ancestor's offset.\n */\nexport function measureContainingBlockOffset(popup: HTMLElement): ContainingBlockOffset {\n\tconst prevTop: string = popup.style.top;\n\tconst prevLeft: string = popup.style.left;\n\tconst prevRight: string = popup.style.right;\n\n\t// Probe 1: left-edge offset\n\tpopup.style.top = '0px';\n\tpopup.style.left = '0px';\n\tpopup.style.right = 'auto';\n\n\tconst leftRect: DOMRect = popup.getBoundingClientRect();\n\tconst x: number = leftRect.left;\n\tconst y: number = leftRect.top;\n\n\t// Probe 2: right-edge offset\n\tpopup.style.left = 'auto';\n\tpopup.style.right = '0px';\n\n\tconst rightRect: DOMRect = popup.getBoundingClientRect();\n\tconst rightX: number = window.innerWidth - rightRect.right;\n\n\tpopup.style.top = prevTop;\n\tpopup.style.left = prevLeft;\n\tpopup.style.right = prevRight;\n\n\treturn { x, y, rightX };\n}\n\n// --- Positioning ---\n\n/**\n * Positions a popup element relative to the given anchor rectangle.\n * Uses fixed positioning and clamps to the viewport edges.\n * Automatically compensates for ancestors that create a new containing\n * block (e.g. `transform`, `will-change: transform`).\n */\nexport function positionPopup(popup: HTMLElement, anchor: DOMRect, options: PositionOptions): void {\n\tconst offset: number = options.offset ?? DEFAULT_OFFSET;\n\tconst vpWidth: number = window.innerWidth;\n\tconst vpHeight: number = window.innerHeight;\n\n\t// Apply fixed positioning first so offsetWidth/offsetHeight reflect\n\t// shrink-to-fit sizing rather than normal-flow block width.\n\tsetStyleProperties(popup, { position: 'fixed', zIndex: Z_INDEX });\n\n\t// Detect containing-block offset caused by ancestor transforms etc.\n\tconst cbOffset: ContainingBlockOffset = measureContainingBlockOffset(popup);\n\n\tconst popupWidth: number = popup.offsetWidth;\n\tconst popupHeight: number = popup.offsetHeight;\n\n\tconst styles: Record<string, string> = {};\n\n\tswitch (options.position) {\n\t\tcase 'below-start': {\n\t\t\tlet top: number = anchor.bottom + offset;\n\n\t\t\tif (options.isRtl) {\n\t\t\t\t// RTL: anchor to physical right edge (visual start)\n\t\t\t\tlet right: number = vpWidth - anchor.right;\n\t\t\t\tif (right + popupWidth > vpWidth - POPUP_MIN_MARGIN) {\n\t\t\t\t\tright = vpWidth - popupWidth - POPUP_MIN_MARGIN;\n\t\t\t\t}\n\t\t\t\tif (top + popupHeight > vpHeight - POPUP_MIN_MARGIN) {\n\t\t\t\t\ttop = anchor.top - popupHeight - offset;\n\t\t\t\t}\n\t\t\t\tif (right < POPUP_MIN_MARGIN) right = POPUP_MIN_MARGIN;\n\t\t\t\tif (top < POPUP_MIN_MARGIN) top = POPUP_MIN_MARGIN;\n\t\t\t\tstyles.top = `${top - cbOffset.y}px`;\n\t\t\t\tstyles.right = `${right - cbOffset.rightX}px`;\n\t\t\t\tstyles.left = 'auto';\n\t\t\t} else {\n\t\t\t\tlet left: number = anchor.left;\n\t\t\t\tif (left + popupWidth > vpWidth - POPUP_MIN_MARGIN) {\n\t\t\t\t\tleft = vpWidth - popupWidth - POPUP_MIN_MARGIN;\n\t\t\t\t}\n\t\t\t\tif (top + popupHeight > vpHeight - POPUP_MIN_MARGIN) {\n\t\t\t\t\ttop = anchor.top - popupHeight - offset;\n\t\t\t\t}\n\t\t\t\tif (left < POPUP_MIN_MARGIN) left = POPUP_MIN_MARGIN;\n\t\t\t\tif (top < POPUP_MIN_MARGIN) top = POPUP_MIN_MARGIN;\n\t\t\t\tstyles.top = `${top - cbOffset.y}px`;\n\t\t\t\tstyles.left = `${left - cbOffset.x}px`;\n\t\t\t\tstyles.right = 'auto';\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase 'below-end': {\n\t\t\tlet top: number = anchor.bottom + offset;\n\n\t\t\tif (options.isRtl) {\n\t\t\t\t// RTL: \"end\" = physical left edge\n\t\t\t\tlet left: number = anchor.left;\n\t\t\t\tif (left + popupWidth > vpWidth - POPUP_MIN_MARGIN) {\n\t\t\t\t\tleft = vpWidth - popupWidth - POPUP_MIN_MARGIN;\n\t\t\t\t}\n\t\t\t\tif (top + popupHeight > vpHeight - POPUP_MIN_MARGIN) {\n\t\t\t\t\ttop = anchor.top - popupHeight - offset;\n\t\t\t\t}\n\t\t\t\tif (left < POPUP_MIN_MARGIN) left = POPUP_MIN_MARGIN;\n\t\t\t\tif (top < POPUP_MIN_MARGIN) top = POPUP_MIN_MARGIN;\n\t\t\t\tstyles.top = `${top - cbOffset.y}px`;\n\t\t\t\tstyles.left = `${left - cbOffset.x}px`;\n\t\t\t\tstyles.right = 'auto';\n\t\t\t} else {\n\t\t\t\t// LTR: \"end\" = physical right edge\n\t\t\t\tlet right: number = vpWidth - anchor.right;\n\t\t\t\tif (right + popupWidth > vpWidth - POPUP_MIN_MARGIN) {\n\t\t\t\t\tright = vpWidth - popupWidth - POPUP_MIN_MARGIN;\n\t\t\t\t}\n\t\t\t\tif (top + popupHeight > vpHeight - POPUP_MIN_MARGIN) {\n\t\t\t\t\ttop = anchor.top - popupHeight - offset;\n\t\t\t\t}\n\t\t\t\tif (right < POPUP_MIN_MARGIN) right = POPUP_MIN_MARGIN;\n\t\t\t\tif (top < POPUP_MIN_MARGIN) top = POPUP_MIN_MARGIN;\n\t\t\t\tstyles.top = `${top - cbOffset.y}px`;\n\t\t\t\tstyles.right = `${right - cbOffset.rightX}px`;\n\t\t\t\tstyles.left = 'auto';\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase 'right': {\n\t\t\tlet top: number = anchor.top;\n\n\t\t\tif (options.isRtl) {\n\t\t\t\t// RTL: open submenu to the physical left\n\t\t\t\tlet left: number = anchor.left - popupWidth - offset;\n\t\t\t\tif (left < POPUP_MIN_MARGIN) {\n\t\t\t\t\tleft = anchor.right + offset;\n\t\t\t\t}\n\t\t\t\tif (top + popupHeight > vpHeight - POPUP_MIN_MARGIN) {\n\t\t\t\t\ttop = vpHeight - popupHeight - POPUP_MIN_MARGIN;\n\t\t\t\t}\n\t\t\t\tif (left < POPUP_MIN_MARGIN) left = POPUP_MIN_MARGIN;\n\t\t\t\tif (top < POPUP_MIN_MARGIN) top = POPUP_MIN_MARGIN;\n\t\t\t\tstyles.top = `${top - cbOffset.y}px`;\n\t\t\t\tstyles.left = `${left - cbOffset.x}px`;\n\t\t\t\tstyles.right = 'auto';\n\t\t\t} else {\n\t\t\t\tlet left: number = anchor.right + offset;\n\t\t\t\tif (left + popupWidth > vpWidth - POPUP_MIN_MARGIN) {\n\t\t\t\t\tleft = anchor.left - popupWidth - offset;\n\t\t\t\t}\n\t\t\t\tif (top + popupHeight > vpHeight - POPUP_MIN_MARGIN) {\n\t\t\t\t\ttop = vpHeight - popupHeight - POPUP_MIN_MARGIN;\n\t\t\t\t}\n\t\t\t\tif (left < POPUP_MIN_MARGIN) left = POPUP_MIN_MARGIN;\n\t\t\t\tif (top < POPUP_MIN_MARGIN) top = POPUP_MIN_MARGIN;\n\t\t\t\tstyles.top = `${top - cbOffset.y}px`;\n\t\t\t\tstyles.left = `${left - cbOffset.x}px`;\n\t\t\t\tstyles.right = 'auto';\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tsetStyleProperties(popup, styles);\n}\n\n/**\n * Appends an element to the appropriate root: the shadow root if the\n * reference node lives inside one, otherwise `document.body`.\n */\nexport function appendToRoot(element: HTMLElement, referenceNode: Node): void {\n\tconst root: Node = referenceNode.getRootNode();\n\tif (root instanceof ShadowRoot) {\n\t\troot.appendChild(element);\n\t} else {\n\t\tdocument.body.appendChild(element);\n\t}\n}\n\n/** Returns the focused element in the reference node's root, including nested shadow roots. */\nexport function getDeepActiveHTMLElement(referenceNode: Node): HTMLElement | null {\n\tconst root: Node = referenceNode.getRootNode();\n\tlet active: Element | null =\n\t\troot instanceof ShadowRoot || root instanceof Document\n\t\t\t? root.activeElement\n\t\t\t: document.activeElement;\n\twhile (active?.shadowRoot?.activeElement) active = active.shadowRoot.activeElement;\n\treturn active instanceof HTMLElement ? active : null;\n}\n\n/**\n * Promotes a popup/overlay to the browser's top layer via the Popover API so it\n * paints above — and receives pointer events ahead of — every stacking context\n * in the host page. A high `z-index` alone is not enough: an ancestor that forms\n * a stacking context (e.g. Starlight's `isolation: isolate` content wrapper)\n * traps the popup below a sibling such as the fixed table-of-contents sidebar,\n * so clicks on the overlapped region hit the sidebar and dismiss the popup.\n *\n * The element keeps living in the editor's shadow DOM, so its registered styles\n * still apply; only its paint layer changes. Must be called while the element is\n * connected to the document and BEFORE positioning, so subsequent\n * `offsetWidth`/containing-block measurements reflect the displayed top-layer\n * box.\n *\n * No-ops when the Popover API is unavailable (older engines, happy-dom in unit\n * tests); callers then fall back to plain `z-index` stacking. Neutralizes the UA\n * popover box styles (`inset: 0; margin: auto`) so the caller's explicit\n * `top`/`left` placement is what positions the element.\n */\nexport function promoteToTopLayer(element: HTMLElement): void {\n\tif (typeof element.showPopover !== 'function') return;\n\telement.setAttribute('popover', 'manual');\n\ttry {\n\t\telement.showPopover();\n\t} catch {\n\t\telement.removeAttribute('popover');\n\t\treturn;\n\t}\n\tsetStyleProperties(element, { margin: '0', inset: 'auto' });\n}\n"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
- import{a as t,n as e,r as n}from"./HTMLUtils-B0nGyFLb.mjs";import{a as o,d as r,f as s,h as i,i as a,n as c,r as l,s as u,v as d}from"./ThemeEngine-kIXtSRkI.mjs";import{n as f}from"./HTMLSanitization-Ce9dVT1q.mjs";import{c as p,o as h}from"./PluginHelpers-WG1Lzzh3.mjs";import{i as m,l as g,n as y,s as b}from"./StyleRuntime-C0RSqKzG.mjs";import{t as v}from"./ShortcutFormatting-TwiufqeV.mjs";var $={label:"Print",tooltip:t=>`Print (${t})`,printingAnnouncement:"Printing"},S=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-Uzo1Azdw.mjs"),"./locales/de.ts":()=>import("./de-DcMhfRBu.mjs"),"./locales/es.ts":()=>import("./es-BJHF95J_.mjs"),"./locales/fr.ts":()=>import("./fr-KXmbys88.mjs"),"./locales/hi.ts":()=>import("./hi-l6DA-aOw.mjs"),"./locales/pt.ts":()=>import("./pt-C8sOyw0V.mjs"),"./locales/ru.ts":()=>import("./ru-B1m8J9dl.mjs"),"./locales/zh.ts":()=>import("./zh-dGSDBBzb.mjs")});async function w(t){return p(S,t,$)}var k=["h1","h2","h3","h4","h5","h6","p","div","span","br","hr","strong","b","em","i","u","s","sub","sup","small","ul","ol","li","table","thead","tbody","tr","th","td","img"],T=["style","class","src","alt","width","height","colspan","rowspan"];function C(t){const e="function"==typeof t?t():t;return f(e,{ALLOWED_TAGS:[...k],ALLOWED_ATTR:[...T]})}var j=/* @__PURE__ */new Set(["AREA","BASE","BR","COL","EMBED","HR","IMG","INPUT","LINK","META","PARAM","SOURCE","TRACK","WBR"]),A=/* @__PURE__ */new Set(["TABLE","THEAD","TBODY","TFOOT","TR"]),L=/* @__PURE__ */new Set(["AUDIO","CANVAS","EMBED","IFRAME","IMG","INPUT","METER","OBJECT","PROGRESS","SELECT","TEXTAREA","VIDEO"]);function x(t,e){let n;do{n=`${t}-${crypto.randomUUID()}`}while(e.has(n));return e.add(n),n}function E(t){const e=/* @__PURE__ */new Map;t.matches("[data-block-id][id]")&&""!==t.id&&e.set(t.id,t);for(const n of t.querySelectorAll("[data-block-id][id]")){const t=n.id;""===t||e.has(t)||e.set(t,n)}return e}function M(e,n){for(const o of t(n)){const t=e.get(o);if(t)return t}}function R(t,e,n,o){const r=x("notectl-print-destination",n),s=x("notectl-print-destination-slot",o),i=e.createElement("slot");i.name=s,i.setAttribute("data-notectl-print-destination-slot",""),function(t,e){if(j.has(t.tagName)||L.has(t.tagName))t.before(e);else{if(A.has(t.tagName)){const n=t.querySelector("th, td");if(n)return void n.insertBefore(e,n.firstChild);const o=t.closest("table");if(o?.parentNode)return void o.before(e)}t.insertBefore(e,t.firstChild)}}(t,i);const a=e.createElement("a");return a.id=r,a.setAttribute("href",`#${r}`),a.slot=s,a.tabIndex=-1,a.setAttribute("aria-hidden","true"),a.setAttribute("data-notectl-print-destination",""),function(t){for(const[e,n]of Object.entries({all:"initial",display:"block",position:"absolute",width:"0",height:"0",margin:"0",padding:"0",border:"0",overflow:"hidden","pointer-events":"none","font-size":"0","line-height":"0",color:"transparent",background:"transparent"}))t.style.setProperty(e,n,"important")}(a),{id:r,marker:a}}var B="notectl-host";function N(t){const e=Array.from(t.styleSheets),n=t.adoptedStyleSheets;return n&&e.push(...n),e}function H(t,e){const n=t[e]??'"';let o=e+1;for(;o<t.length;){const e=t[o]??"";if("\\"!==e){if(e===n)return o+1;o++}else o+=2}return t.length}function z(t,e){if("url("!==t.slice(e,e+4).toLowerCase())return!1;const n=e>0?t[e-1]??"":"";return!/[\w-]/.test(n)}function P(t,e){let n=e+4;for(;n<t.length&&/\s/.test(t[n]??"");)n++;const o=t[n]??"";let r;if('"'===o||"'"===o){const e=H(t,n);r=t.slice(n+1,e-1),n=e}else{const e=t.indexOf(")",n);if(-1===e)return null;r=t.slice(n,e).trim(),n=e}for(;n<t.length&&/\s/.test(t[n]??"");)n++;return")"!==t[n]?null:{end:n+1,url:(s=r,s.replace(/\\([0-9a-f]{1,6}\s?|[\s\S])/gi,(t,e)=>{const n=e.trim();if(/^[0-9a-f]{1,6}$/i.test(n)){const t=Number.parseInt(n,16);return t>0&&t<=1114111?String.fromCodePoint(t):"�"}return e}))};var s}function D(t,e,n){if(!e||!function(t){return!t.startsWith("#")&&!t.startsWith("//")&&!/^[a-z][a-z0-9+.-]*:/i.test(t)}(e))return t;try{return`url("${new URL(e,n).href}")`}catch{return t}}function q(t,e){if(!t.toLowerCase().includes("url("))return t;let n="",o=0;for(;o<t.length;){const r=t[o]??"";if('"'===r||"'"===r){const e=H(t,o);n+=t.slice(o,e),o=e;continue}if(z(t,o)){const r=P(t,o);if(r){n+=D(t.slice(o,r.end),r.url,e),o=r.end;continue}}n+=r,o++}return n}function O(t){return t.anonymousLayerCount+=1,`notectl-anonymous-${t.anonymousLayerCount}`}var I={media:[],layers:[],supports:[]};function U(t,e,n,o){const r=e.trim(),s=o?.trim()??"";return{media:r&&"all"!==r?[...t.media,r]:t.media,layers:null===n?t.layers:[...t.layers,""===n?null:n],supports:s?[...t.supports,s]:t.supports}}function W(t,e,n){const o=[B];for(const c of n.layers)o.push(c??O(t));const r=0===(s=n.supports).length?"":1===s.length?` supports(${s[0]})`:` supports(${s.map(t=>`(${t})`).join(" and ")})`;var s;const i=n.media.length?` ${n.media.join(" and ")}`:"";var a;t.segments.push({kind:"import",statement:`@import url("${a=e,a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}") layer(${o.join(".")})${r}${i};`})}function V(t,e){const n=e.trim();return n&&"all"!==n?`@media ${n} {\n${t}\n}`:t}function G(t,e){if(e.seen.has(t))return;if(e.seen.add(t),t.disabled)return;const n=U(I,t.media.mediaText,null,null);let o;try{o=t.cssRules}catch{return void(t.href&&W(e,t.href,n))}const r=t.href??e.baseURL,s=[];for(const a of o)3!==a.type?s.push(q(a.cssText,r)):F(a,e,s,n);const i=s.join("\n");i&&function(t,e){const n=t.segments[t.segments.length-1];"rules"!==n?.kind?t.segments.push({kind:"rules",css:e}):t.segments[t.segments.length-1]={kind:"rules",css:`${n.css}\n${e}`}}(e,V(i,t.media.mediaText))}function F(t,e,n,o){const r=t.layerName??null,s=t.supportsText??null,i=U(o,t.media.mediaText,r,s),a=t.styleSheet;if(a&&!e.seen.has(a)){let o;try{o=a.cssRules}catch{o=null}if(o){e.seen.add(a);const c=a.href??e.baseURL,l=[];for(const t of o)3!==t.type?l.push(q(t.cssText,c)):F(t,e,l,i);let u=l.join("\n");return void(u&&(null!==r&&(u=""===r?`@layer {\n${u}\n}`:`@layer ${r} {\n${u}\n}`),s?.trim()&&(u=`@supports (${s.trim()}) {\n${u}\n}`),n.push(V(u,t.media.mediaText))))}}const c=a?.href??t.href;c&&W(e,c,i)}var K="notectl-print",Y="notectl-custom";function _(t){return t.replace(/;$/gm," !important;")}function J(t){return _(c(u).replace(":host {",`${t} {`))}function X(t,e){const n=getComputedStyle(t),o=[];for(let r=0;r<n.length;r++){const t=n[r]??"";if(t.startsWith("--notectl-")){const e=n.getPropertyValue(t).trim();e&&o.push(` ${t}: ${e};`)}}return 0===o.length?"":`${e} {\n${o.join("\n")}\n}`}var Q=["","transparent","rgba(0, 0, 0, 0)"];function Z(t){let e=t;for(;e;){const t=getComputedStyle(e).getPropertyValue("background-color").trim();if(!Q.includes(t))return t;const n=e.getRootNode();e=e.parentElement??(n instanceof ShadowRoot?n.host:null)}return"#ffffff"}function tt(t,e,n="#ffffff",o="body"){const r=getComputedStyle(t),s=["font-family","font-size","font-weight","line-height","letter-spacing","word-spacing","color"],i=[" margin: 0;",` background: ${n};`];for(const a of s){if("color"===a&&e){i.push(` color: ${e};`);continue}const t=r.getPropertyValue(a).trim();t&&i.push(` ${a}: ${t};`)}return`${o} {\n${i.join("\n")}\n}`}var et=["display: block","position: static","inset: auto","width: auto","height: auto","min-width: 0","min-height: 0","max-width: none","max-height: none","margin: 0","padding: 0","border: none","border-radius: 0","outline: none","box-shadow: none","background: transparent","overflow: visible","transform: none","filter: none","opacity: 1","contain: none","float: none","visibility: visible","clip: auto","clip-path: none","content-visibility: visible"],nt=["display: block","visibility: visible","opacity: 1","position: static","height: auto","min-height: 0","max-height: none","overflow: visible","transform: none","filter: none","contain: none","clip: auto","clip-path: none","content-visibility: visible"];function ot(t){return[`${t} {`,...et.map(t=>` ${t} !important;`),"}"].join("\n")}function rt(t,e,n){const o=t.tagName.toLowerCase(),r=[],s=!1!==n.forceLightTheme,a=[ot(o),["html, body {",...nt.map(t=>` ${t} !important;`),"}"].join("\n")];if(s&&a.push(J(`:root, ${o}`)),!1!==n.printBackground&&a.push("* {\n -webkit-print-color-adjust: exact !important;\n print-color-adjust: exact !important;\n}"),r.push(`@layer ${K} {\n${a.join("\n\n")}\n}`),!s){const e=X(t,`:root, ${o}`);e&&r.push(e)}const c=s?u.primitives.foreground:void 0,l=s?"#ffffff":Z(e);r.push(tt(t,c,l));const d=function(t){const e=[];if(t.margin?e.push(` margin: ${t.margin};`):t.paperSize&&e.push(" margin: 0;"),t.paperSize||t.orientation){const n=[t.paperSize?i(t.paperSize):"A4"];t.orientation&&n.push(t.orientation),e.push(` size: ${n.join(" ")};`)}return 0===e.length?"":`@page {\n${e.join("\n")}\n}`}(n);return d&&r.push(d),n.customCSS&&(r.push(n.customCSS),r.push(`@layer ${Y} {\n${n.customCSS}\n}`)),r.join("\n\n")}function st(t,e,n,o){const r=`${t.tagName.toLowerCase()}[${o}]`,s=!1!==n.forceLightTheme,i=[ot(r)];s&&i.push(J(r)),!1!==n.printBackground&&i.push(`${r}, ${r} * {\n -webkit-print-color-adjust: exact !important;\n print-color-adjust: exact !important;\n}`);const a=s?u.primitives.foreground:void 0,c=s?"#ffffff":Z(e);i.push(_(tt(t,a,c,r)));const l=[`@layer ${K} {\n${i.join("\n\n")}\n}`];if(!s){const e=X(t,r);e&&l.push(e)}return l.join("\n\n")}var it="data-notectl-print-fallback",at=["(function () {"," var head = document.head;"," if (head && head.querySelector('meta[name=\"notectl-print-export\"]')) {"," var bundles = document.querySelectorAll('template[data-notectl-print-styles]');"," for (var b = 0; b < bundles.length; b++) {"," if (bundles[b].content) head.appendChild(bundles[b].content);"," bundles[b].parentNode.removeChild(bundles[b]);"," }"," }"," var statics = document.querySelectorAll('[data-notectl-static]');"," for (var i = 0; i < statics.length; i++) {"," var host = statics[i];"," if (!host.shadowRoot && host.attachShadow) {"," for (var j = 0; j < host.children.length; j++) {"," var child = host.children[j];"," if (child.tagName !== 'TEMPLATE') continue;"," if (!child.getAttribute('shadowrootmode') || !child.content) continue;"," host.attachShadow({ mode: 'open' }).appendChild(child.content);"," host.removeChild(child);"," break;"," }"," }"," if (!host.shadowRoot) continue;"," var fallbacks = host.querySelectorAll('[data-notectl-print-fallback]');"," for (var k = 0; k < fallbacks.length; k++) {"," fallbacks[k].parentNode.removeChild(fallbacks[k]);"," }"," }","})();"].join("\n");function ct(t){return t.replace(/<\//g,"<\\/")}function lt(t,n){const o=[];for(const r of Array.from(t.attributes))n(r.name)&&o.push(""===r.value?r.name:`${r.name}="${e(r.value)}"`);return o.length>0?` ${o.join(" ")}`:""}function ut(t){return t?lt(t,t=>"class"===t||t.startsWith("data-")):""}function dt(t){const n=function(t){if(!(t instanceof HTMLElement))return"";const e=[];for(let n=0;n<t.style.length;n++){const o=t.style[n]??"";if(!o.startsWith("--notectl-"))continue;const r=t.style.getPropertyValue(o).trim();r&&e.push(`${o}: ${r}`)}return e.join("; ")}(t);return n?` style="${e(n)}"`:""}function ft(t){const o=t.host.ownerDocument,r=t.host.tagName.toLowerCase(),s="export"===t.variant,i=s?["style","id",d]:["style",d],a=(c=t.host,l=i,lt(c,t=>!l.includes(t)));var c,l;const u=t.carryThemeContext?dt(t.host):"",f=t.carryThemeContext?ut(o.documentElement)+dt(o.documentElement):"",p=t.carryThemeContext?ut(o.body)+dt(o.body):"",h=t.styleNonce?` nonce="${e(t.styleNonce)}"`:"",m=['<meta charset="utf-8">',`<title>${n(t.title)}</title>`];s&&m.push('<meta name="notectl-print-export">'),m.push(`<style${h}>@layer ${Y}, ${K}, ${B};</style>`),m.push(`<style${h}>${ct(t.documentCSS)}</style>`);const g=t.hostSegments.map(t=>{const e="import"===t.kind?t.statement:`@layer ${B} {\n${t.css}\n}`;return`<style${h}>${ct(e)}</style>`});s||m.push(...g);const y=s?`<template data-notectl-print-styles><style>${ct(t.standaloneCSS)}</style>${g.join("")}</template>`:"",b=s?`<div ${it}><style>@scope ([${it}]) {\n${ct(t.shadowCSS)}\n}</style>${t.fallbackContentHTML}</div>`:"",v=s?`<script>${at}<\/script>`:"",$=[`<${r}${a}${u} ${d}>`,'<template shadowrootmode="open">',`<style${h}>${ct(t.shadowCSS)}</style>`,t.contentHTML,"</template>",...b?[b]:[],...t.destinationMarkersHTML?[t.destinationMarkersHTML]:[],`</${r}>`,...y?[y]:[],...v?[v]:[]];return["<!DOCTYPE html>",`<html lang="${e(t.lang)}"${f}>`,"<head>",...m,"</head>",`<body${p}>`,...$,"</body>","</html>"].join("\n")}function pt(t,e,n,o){const r=/* @__PURE__ */new Set;function s(t){return t??{}}function i(r){const s={options:r,cancelled:!1};if(o.emit(a,s),s.cancelled)return null;const i=s.options,c=function(t,e){const n=[],o=function(t){const e=[],n=[];for(const o of t.adoptedStyleSheets){const t=m(o)?n:e;for(const e of o.cssRules)t.push(e.cssText)}return{base:e.join("\n"),runtime:n.join("\n")}}(t);o.base&&n.push(`@layer notectl-base {\n${o.base}\n}`),o.runtime&&n.push(o.runtime);const r=function(t){const e=[];e.push(".notectl-content { height: auto !important; max-height: none !important; min-height: 0 !important; overflow: visible !important; }"),t.paperSize&&e.push(".notectl-content { padding: 48px 56px !important; }");const n=[];return n.push("[data-notectl-no-print] { display: none !important; }"),n.push(".notectl-code-block { white-space: pre-wrap !important; word-break: break-all !important; page-break-inside: avoid; }"),n.push("img { page-break-inside: avoid; }"),n.push(".notectl-table { break-inside: avoid; }"),!1!==t.printBackground&&n.push("* { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }"),e.push(`@media print {\n ${n.join("\n ")}\n}`),e.join("\n\n")}(e);return r&&n.push(r),e.customCSS&&n.push(e.customCSS),n.join("\n\n")}(t,i),u=function(t){const e={segments:[],seen:/* @__PURE__ */new Set,baseURL:t.ownerDocument.baseURI??"",anonymousLayerCount:0};for(const n of function(t){const e=[];let n=t.getRootNode();for(;n instanceof ShadowRoot;)e.push(n),n=n.host.getRootNode();return e.push(t.ownerDocument),e.reverse()}(t))for(const t of N(n))G(t,e);return e.segments}(e),f=function(t,e){const n=function(t){return(t.querySelector(".notectl-content")??t).cloneNode(!0)}(t);return function(t){t.removeAttribute("contenteditable");for(const e of["notectl-node-selected","notectl-content--empty","notectl-table-cell--selected"]){t.classList.remove(e);for(const n of t.querySelectorAll(`.${e}`))n.classList.remove(e)}t.removeAttribute("data-placeholder")}(n),function(t,e){if(e.excludeBlockTypes)for(const n of e.excludeBlockTypes){const e=t.querySelectorAll(`[data-block-type="${n}"]`);for(const t of e)t.remove()}if(e.pageBreakBefore)for(const n of e.pageBreakBefore){const e=t.querySelectorAll(`[data-block-type="${n}"]`);for(const t of e)b(t,{breakBefore:"page",pageBreakBefore:"always"})}}(n,e),function(t,e){if(e.header){const n=document.createElement("div");n.className="notectl-print-header",n.innerHTML=C(e.header),t.insertBefore(n,t.firstChild)}if(e.footer){const n=document.createElement("div");n.className="notectl-print-footer",n.innerHTML=C(e.footer),t.appendChild(n)}}(n,e),n}(n,i),p=f.cloneNode(!0);!function(t){const e=E(t);if(0===e.size)return;const n=/* @__PURE__ */new Set;""!==t.id&&n.add(t.id);for(const r of t.querySelectorAll("[id]"))n.add(r.id);const o=/* @__PURE__ */new Map;for(const r of function(t){const e=[];return t.matches("[data-block-id][id]")&&""!==t.id&&e.push(t),e.push(...t.querySelectorAll("[data-block-id][id]")),e}(t)){const t=x("notectl-print-fallback-destination",n);o.set(r,t),r.id=t}for(const r of t.querySelectorAll("a[href]")){const t=M(e,r.getAttribute("href")??""),n=t?o.get(t):void 0;n&&r.setAttribute("href",`#${n}`)}}(p);const h=p.outerHTML,g=function(t){const e=E(t);if(0===e.size)return{markers:[]};const n=t.ownerDocument,o=/* @__PURE__ */new Set;""!==t.id&&o.add(t.id);for(const a of t.querySelectorAll("[id]"))o.add(a.id);const r=/* @__PURE__ */new Set;for(const a of t.querySelectorAll("slot[name]"))r.add(a.name);const s=/* @__PURE__ */new Map,i=[];for(const a of t.querySelectorAll("a[href]")){const t=a.getAttribute("href")??"";if(!t.startsWith("#"))continue;const c=M(e,t);if(!c)continue;let l=s.get(c);l||(l=R(c,n,o,r),s.set(c,l),i.push(l.marker)),a.setAttribute("href",`#${l.id}`)}return{markers:i}}(f),y=f.outerHTML,v=g.markers.map(t=>t.outerHTML).join(""),$=i.title??"",S=e.ownerDocument,w=e.closest("[lang]")?.getAttribute("lang")??(S.documentElement.lang||"en"),k={documentCSS:st(e,n,i,d),standaloneCSS:rt(e,n,i),hostSegments:u,shadowCSS:c,host:e,contentHTML:y,fallbackContentHTML:h,destinationMarkersHTML:v,title:$,lang:w,carryThemeContext:!1===i.forceLightTheme,variant:"export"},T=ft(k),j={html:T};return o.emit(l,j),{html:T,input:k}}return{print(t){const e=i(s(t));if(!e)return;const o=ft({...e.input,documentCSS:e.input.standaloneCSS,variant:"internal",styleNonce:y(n)}),a=document.createElement("iframe");g(a,"position:fixed;left:-9999px;width:0;height:0;border:none"),document.body.appendChild(a);const c=a.contentDocument,l=a.contentWindow;if(!c||!l)return void document.body.removeChild(a);c.open(),c.write(o),c.close();const u=()=>{a.remove()},d=()=>{l.addEventListener("afterprint",u,{once:!0}),l.print()};if("complete"===c.readyState)return void d();let f=!1;const p=()=>{f||(f=!0,r.delete(h),window.clearTimeout(m),d())},h=()=>{f=!0,window.clearTimeout(m),l.removeEventListener("load",p),a.remove()},m=window.setTimeout(p,4e3);r.add(h),l.addEventListener("load",p,{once:!0})},toHTML:t=>i(s(t))?.html??"",dispose(){for(const t of r)t();r.clear()}}}var ht={print(){},toHTML:()=>"",dispose(){}},mt=class{id="print";name="Print";config;service=null;locale;constructor(t){this.config=t??{}}async init(t){this.locale=await h(t,this.config.locale,$,w);const e=t.getContainer(),n=e.getRootNode();if(n instanceof ShadowRoot){const o=n.host,r=t.getEventBus();this.service=pt(n,o,e,r)}else this.service=ht;t.registerService(o,this.service);const r=this.config.defaults??{},s=this.service,i=this.locale;t.registerCommand("print",()=>(t.announce(i.printingAnnouncement),s.print(r),!0));const a=this.config.keyBinding??"Mod-P";if(t.registerKeymap({[a]:()=>(t.executeCommand("print"),!0)}),!1!==this.config.showToolbarItem){const e=v(a);t.registerToolbarItem({id:"print",group:"actions",label:this.locale.label,tooltip:this.locale.tooltip(e),icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z"/></svg>',command:"print"})}}destroy(){this.service?.dispose(),this.service=null}};export{$ as n,w as r,mt as t};
2
- //# sourceMappingURL=PrintPlugin-BQ7LWbEB.mjs.map
1
+ import{i as t,o as e,r as n}from"./HTMLUtils-DTpsjZyK.mjs";import{a as o,d as r,f as s,h as i,i as a,n as c,r as l,s as u,v as d}from"./ThemeEngine-kIXtSRkI.mjs";import{n as f}from"./HTMLSanitization-Ce9dVT1q.mjs";import{c as p,o as h}from"./PluginHelpers-B3gk3VB3.mjs";import{i as m,l as g,n as y,s as b}from"./StyleRuntime-C0RSqKzG.mjs";import{t as v}from"./ShortcutFormatting-TwiufqeV.mjs";var $={label:"Print",tooltip:t=>`Print (${t})`,printingAnnouncement:"Printing"},S=/* #__PURE__ */Object.assign({"./locales/ar.ts":()=>import("./ar-Uzo1Azdw.mjs"),"./locales/de.ts":()=>import("./de-DcMhfRBu.mjs"),"./locales/es.ts":()=>import("./es-BJHF95J_.mjs"),"./locales/fr.ts":()=>import("./fr-KXmbys88.mjs"),"./locales/hi.ts":()=>import("./hi-l6DA-aOw.mjs"),"./locales/pt.ts":()=>import("./pt-C8sOyw0V.mjs"),"./locales/ru.ts":()=>import("./ru-B1m8J9dl.mjs"),"./locales/zh.ts":()=>import("./zh-dGSDBBzb.mjs")});async function w(t){return p(S,t,$)}var T=["h1","h2","h3","h4","h5","h6","p","div","span","br","hr","strong","b","em","i","u","s","sub","sup","small","ul","ol","li","table","thead","tbody","tr","th","td","img"],k=["style","class","src","alt","width","height","colspan","rowspan"];function C(t){const e="function"==typeof t?t():t;return f(e,{ALLOWED_TAGS:[...T],ALLOWED_ATTR:[...k]})}var j=/* @__PURE__ */new Set(["AREA","BASE","BR","COL","EMBED","HR","IMG","INPUT","LINK","META","PARAM","SOURCE","TRACK","WBR"]),A=/* @__PURE__ */new Set(["TABLE","THEAD","TBODY","TFOOT","TR"]),L=/* @__PURE__ */new Set(["AUDIO","CANVAS","EMBED","IFRAME","IMG","INPUT","METER","OBJECT","PROGRESS","SELECT","TEXTAREA","VIDEO"]);function E(t,e){let n;do{n=`${t}-${crypto.randomUUID()}`}while(e.has(n));return e.add(n),n}function x(t){const e=/* @__PURE__ */new Map;t.matches("[data-block-id][id]")&&""!==t.id&&e.set(t.id,t);for(const n of t.querySelectorAll("[data-block-id][id]")){const t=n.id;""===t||e.has(t)||e.set(t,n)}return e}function M(t,n){for(const o of e(n)){const e=t.get(o);if(e)return e}}function R(t,e,n,o){const r=E("notectl-print-destination",n),s=E("notectl-print-destination-slot",o),i=e.createElement("slot");i.name=s,i.setAttribute("data-notectl-print-destination-slot",""),function(t,e){if(j.has(t.tagName)||L.has(t.tagName))t.before(e);else{if(A.has(t.tagName)){const n=t.querySelector("th, td");if(n)return void n.insertBefore(e,n.firstChild);const o=t.closest("table");if(o?.parentNode)return void o.before(e)}t.insertBefore(e,t.firstChild)}}(t,i);const a=e.createElement("a");return a.id=r,a.setAttribute("href",`#${r}`),a.slot=s,a.tabIndex=-1,a.setAttribute("aria-hidden","true"),a.setAttribute("data-notectl-print-destination",""),function(t){for(const[e,n]of Object.entries({all:"initial",display:"block",position:"absolute",width:"0",height:"0",margin:"0",padding:"0",border:"0",overflow:"hidden","pointer-events":"none","font-size":"0","line-height":"0",color:"transparent",background:"transparent"}))t.style.setProperty(e,n,"important")}(a),{id:r,marker:a}}var B="notectl-host";function N(t){const e=Array.from(t.styleSheets),n=t.adoptedStyleSheets;return n&&e.push(...n),e}function H(t,e){const n=t[e]??'"';let o=e+1;for(;o<t.length;){const e=t[o]??"";if("\\"!==e){if(e===n)return o+1;o++}else o+=2}return t.length}function z(t,e){if("url("!==t.slice(e,e+4).toLowerCase())return!1;const n=e>0?t[e-1]??"":"";return!/[\w-]/.test(n)}function P(t,e){let n=e+4;for(;n<t.length&&/\s/.test(t[n]??"");)n++;const o=t[n]??"";let r;if('"'===o||"'"===o){const e=H(t,n);r=t.slice(n+1,e-1),n=e}else{const e=t.indexOf(")",n);if(-1===e)return null;r=t.slice(n,e).trim(),n=e}for(;n<t.length&&/\s/.test(t[n]??"");)n++;return")"!==t[n]?null:{end:n+1,url:(s=r,s.replace(/\\([0-9a-f]{1,6}\s?|[\s\S])/gi,(t,e)=>{const n=e.trim();if(/^[0-9a-f]{1,6}$/i.test(n)){const t=Number.parseInt(n,16);return t>0&&t<=1114111?String.fromCodePoint(t):"�"}return e}))};var s}function D(t,e,n){if(!e||!function(t){return!t.startsWith("#")&&!t.startsWith("//")&&!/^[a-z][a-z0-9+.-]*:/i.test(t)}(e))return t;try{return`url("${new URL(e,n).href}")`}catch{return t}}function q(t,e){if(!t.toLowerCase().includes("url("))return t;let n="",o=0;for(;o<t.length;){const r=t[o]??"";if('"'===r||"'"===r){const e=H(t,o);n+=t.slice(o,e),o=e;continue}if(z(t,o)){const r=P(t,o);if(r){n+=D(t.slice(o,r.end),r.url,e),o=r.end;continue}}n+=r,o++}return n}function I(t){return t.anonymousLayerCount+=1,`notectl-anonymous-${t.anonymousLayerCount}`}var O={media:[],layers:[],supports:[]};function U(t,e,n,o){const r=e.trim(),s=o?.trim()??"";return{media:r&&"all"!==r?[...t.media,r]:t.media,layers:null===n?t.layers:[...t.layers,""===n?null:n],supports:s?[...t.supports,s]:t.supports}}function W(t,e,n){const o=[B];for(const c of n.layers)o.push(c??I(t));const r=0===(s=n.supports).length?"":1===s.length?` supports(${s[0]})`:` supports(${s.map(t=>`(${t})`).join(" and ")})`;var s;const i=n.media.length?` ${n.media.join(" and ")}`:"";var a;t.segments.push({kind:"import",statement:`@import url("${a=e,a.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}") layer(${o.join(".")})${r}${i};`})}function V(t,e){const n=e.trim();return n&&"all"!==n?`@media ${n} {\n${t}\n}`:t}function F(t,e){if(e.seen.has(t))return;if(e.seen.add(t),t.disabled)return;const n=U(O,t.media.mediaText,null,null);let o;try{o=t.cssRules}catch{return void(t.href&&W(e,t.href,n))}const r=t.href??e.baseURL,s=[];for(const a of o)3!==a.type?s.push(q(a.cssText,r)):G(a,e,s,n);const i=s.join("\n");i&&function(t,e){const n=t.segments[t.segments.length-1];"rules"!==n?.kind?t.segments.push({kind:"rules",css:e}):t.segments[t.segments.length-1]={kind:"rules",css:`${n.css}\n${e}`}}(e,V(i,t.media.mediaText))}function G(t,e,n,o){const r=t.layerName??null,s=t.supportsText??null,i=U(o,t.media.mediaText,r,s),a=t.styleSheet;if(a&&!e.seen.has(a)){let o;try{o=a.cssRules}catch{o=null}if(o){e.seen.add(a);const c=a.href??e.baseURL,l=[];for(const t of o)3!==t.type?l.push(q(t.cssText,c)):G(t,e,l,i);let u=l.join("\n");return void(u&&(null!==r&&(u=""===r?`@layer {\n${u}\n}`:`@layer ${r} {\n${u}\n}`),s?.trim()&&(u=`@supports (${s.trim()}) {\n${u}\n}`),n.push(V(u,t.media.mediaText))))}}const c=a?.href??t.href;c&&W(e,c,i)}var K="notectl-print",Y="notectl-custom";function _(t){return t.replace(/;$/gm," !important;")}function J(t){return _(c(u).replace(":host {",`${t} {`))}function X(t,e){const n=getComputedStyle(t),o=[];for(let r=0;r<n.length;r++){const t=n[r]??"";if(t.startsWith("--notectl-")){const e=n.getPropertyValue(t).trim();e&&o.push(` ${t}: ${e};`)}}return 0===o.length?"":`${e} {\n${o.join("\n")}\n}`}var Q=["","transparent","rgba(0, 0, 0, 0)"];function Z(t){let e=t;for(;e;){const t=getComputedStyle(e).getPropertyValue("background-color").trim();if(!Q.includes(t))return t;const n=e.getRootNode();e=e.parentElement??(n instanceof ShadowRoot?n.host:null)}return"#ffffff"}function tt(t,e,n="#ffffff",o="body"){const r=getComputedStyle(t),s=["font-family","font-size","font-weight","line-height","letter-spacing","word-spacing","color"],i=[" margin: 0;",` background: ${n};`];for(const a of s){if("color"===a&&e){i.push(` color: ${e};`);continue}const t=r.getPropertyValue(a).trim();t&&i.push(` ${a}: ${t};`)}return`${o} {\n${i.join("\n")}\n}`}var et=["display: block","position: static","inset: auto","width: auto","height: auto","min-width: 0","min-height: 0","max-width: none","max-height: none","margin: 0","padding: 0","border: none","border-radius: 0","outline: none","box-shadow: none","background: transparent","overflow: visible","transform: none","filter: none","opacity: 1","contain: none","float: none","visibility: visible","clip: auto","clip-path: none","content-visibility: visible"],nt=["display: block","visibility: visible","opacity: 1","position: static","height: auto","min-height: 0","max-height: none","overflow: visible","transform: none","filter: none","contain: none","clip: auto","clip-path: none","content-visibility: visible"];function ot(t){return[`${t} {`,...et.map(t=>` ${t} !important;`),"}"].join("\n")}function rt(t,e,n){const o=t.tagName.toLowerCase(),r=[],s=!1!==n.forceLightTheme,a=[ot(o),["html, body {",...nt.map(t=>` ${t} !important;`),"}"].join("\n")];if(s&&a.push(J(`:root, ${o}`)),!1!==n.printBackground&&a.push("* {\n -webkit-print-color-adjust: exact !important;\n print-color-adjust: exact !important;\n}"),r.push(`@layer ${K} {\n${a.join("\n\n")}\n}`),!s){const e=X(t,`:root, ${o}`);e&&r.push(e)}const c=s?u.primitives.foreground:void 0,l=s?"#ffffff":Z(e);r.push(tt(t,c,l));const d=function(t){const e=[];if(t.margin?e.push(` margin: ${t.margin};`):t.paperSize&&e.push(" margin: 0;"),t.paperSize||t.orientation){const n=[t.paperSize?i(t.paperSize):"A4"];t.orientation&&n.push(t.orientation),e.push(` size: ${n.join(" ")};`)}return 0===e.length?"":`@page {\n${e.join("\n")}\n}`}(n);return d&&r.push(d),n.customCSS&&(r.push(n.customCSS),r.push(`@layer ${Y} {\n${n.customCSS}\n}`)),r.join("\n\n")}function st(t,e,n,o){const r=`${t.tagName.toLowerCase()}[${o}]`,s=!1!==n.forceLightTheme,i=[ot(r)];s&&i.push(J(r)),!1!==n.printBackground&&i.push(`${r}, ${r} * {\n -webkit-print-color-adjust: exact !important;\n print-color-adjust: exact !important;\n}`);const a=s?u.primitives.foreground:void 0,c=s?"#ffffff":Z(e);i.push(_(tt(t,a,c,r)));const l=[`@layer ${K} {\n${i.join("\n\n")}\n}`];if(!s){const e=X(t,r);e&&l.push(e)}return l.join("\n\n")}var it="data-notectl-print-fallback",at=["(function () {"," var head = document.head;"," if (head && head.querySelector('meta[name=\"notectl-print-export\"]')) {"," var bundles = document.querySelectorAll('template[data-notectl-print-styles]');"," for (var b = 0; b < bundles.length; b++) {"," if (bundles[b].content) head.appendChild(bundles[b].content);"," bundles[b].parentNode.removeChild(bundles[b]);"," }"," }"," var statics = document.querySelectorAll('[data-notectl-static]');"," for (var i = 0; i < statics.length; i++) {"," var host = statics[i];"," if (!host.shadowRoot && host.attachShadow) {"," for (var j = 0; j < host.children.length; j++) {"," var child = host.children[j];"," if (child.tagName !== 'TEMPLATE') continue;"," if (!child.getAttribute('shadowrootmode') || !child.content) continue;"," host.attachShadow({ mode: 'open' }).appendChild(child.content);"," host.removeChild(child);"," break;"," }"," }"," if (!host.shadowRoot) continue;"," var fallbacks = host.querySelectorAll('[data-notectl-print-fallback]');"," for (var k = 0; k < fallbacks.length; k++) {"," fallbacks[k].parentNode.removeChild(fallbacks[k]);"," }"," }","})();"].join("\n");function ct(t){return t.replace(/<\//g,"<\\/")}function lt(t,e){const o=[];for(const r of Array.from(t.attributes))e(r.name)&&o.push(""===r.value?r.name:`${r.name}="${n(r.value)}"`);return o.length>0?` ${o.join(" ")}`:""}function ut(t){return t?lt(t,t=>"class"===t||t.startsWith("data-")):""}function dt(t){const e=function(t){if(!(t instanceof HTMLElement))return"";const e=[];for(let n=0;n<t.style.length;n++){const o=t.style[n]??"";if(!o.startsWith("--notectl-"))continue;const r=t.style.getPropertyValue(o).trim();r&&e.push(`${o}: ${r}`)}return e.join("; ")}(t);return e?` style="${n(e)}"`:""}function ft(e){const o=e.host.ownerDocument,r=e.host.tagName.toLowerCase(),s="export"===e.variant,i=s?["style","id",d]:["style",d],a=(c=e.host,l=i,lt(c,t=>!l.includes(t)));var c,l;const u=e.carryThemeContext?dt(e.host):"",f=e.carryThemeContext?ut(o.documentElement)+dt(o.documentElement):"",p=e.carryThemeContext?ut(o.body)+dt(o.body):"",h=e.styleNonce?` nonce="${n(e.styleNonce)}"`:"",m=['<meta charset="utf-8">',`<title>${t(e.title)}</title>`];s&&m.push('<meta name="notectl-print-export">'),m.push(`<style${h}>@layer ${Y}, ${K}, ${B};</style>`),m.push(`<style${h}>${ct(e.documentCSS)}</style>`);const g=e.hostSegments.map(t=>{const e="import"===t.kind?t.statement:`@layer ${B} {\n${t.css}\n}`;return`<style${h}>${ct(e)}</style>`});s||m.push(...g);const y=s?`<template data-notectl-print-styles><style>${ct(e.standaloneCSS)}</style>${g.join("")}</template>`:"",b=s?`<div ${it}><style>@scope ([${it}]) {\n${ct(e.shadowCSS)}\n}</style>${e.fallbackContentHTML}</div>`:"",v=s?`<script>${at}<\/script>`:"",$=[`<${r}${a}${u} ${d}>`,'<template shadowrootmode="open">',`<style${h}>${ct(e.shadowCSS)}</style>`,e.contentHTML,"</template>",...b?[b]:[],...e.destinationMarkersHTML?[e.destinationMarkersHTML]:[],`</${r}>`,...y?[y]:[],...v?[v]:[]];return["<!DOCTYPE html>",`<html lang="${n(e.lang)}"${f}>`,"<head>",...m,"</head>",`<body${p}>`,...$,"</body>","</html>"].join("\n")}function pt(t,e,n,o){const r=/* @__PURE__ */new Set;function s(t){return t??{}}function i(r){const s={options:r,cancelled:!1};if(o.emit(a,s),s.cancelled)return null;const i=s.options,c=function(t,e){const n=[],o=function(t){const e=[],n=[];for(const o of t.adoptedStyleSheets){const t=m(o)?n:e;for(const e of o.cssRules)t.push(e.cssText)}return{base:e.join("\n"),runtime:n.join("\n")}}(t);o.base&&n.push(`@layer notectl-base {\n${o.base}\n}`),o.runtime&&n.push(o.runtime);const r=function(t){const e=[];e.push(".notectl-content { height: auto !important; max-height: none !important; min-height: 0 !important; overflow: visible !important; }"),t.paperSize&&e.push(".notectl-content { padding: 48px 56px !important; }");const n=[];return n.push("[data-notectl-no-print] { display: none !important; }"),n.push(".notectl-code-block { white-space: pre-wrap !important; word-break: break-all !important; page-break-inside: avoid; }"),n.push("img { page-break-inside: avoid; }"),n.push(".notectl-table { break-inside: avoid; }"),!1!==t.printBackground&&n.push("* { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }"),e.push(`@media print {\n ${n.join("\n ")}\n}`),e.join("\n\n")}(e);return r&&n.push(r),e.customCSS&&n.push(e.customCSS),n.join("\n\n")}(t,i),u=function(t){const e={segments:[],seen:/* @__PURE__ */new Set,baseURL:t.ownerDocument.baseURI??"",anonymousLayerCount:0};for(const n of function(t){const e=[];let n=t.getRootNode();for(;n instanceof ShadowRoot;)e.push(n),n=n.host.getRootNode();return e.push(t.ownerDocument),e.reverse()}(t))for(const t of N(n))F(t,e);return e.segments}(e),f=function(t,e){const n=function(t){return(t.querySelector(".notectl-content")??t).cloneNode(!0)}(t);return function(t){t.removeAttribute("contenteditable");for(const e of["notectl-node-selected","notectl-content--empty","notectl-table-cell--selected"]){t.classList.remove(e);for(const n of t.querySelectorAll(`.${e}`))n.classList.remove(e)}t.removeAttribute("data-placeholder")}(n),function(t,e){if(e.excludeBlockTypes)for(const n of e.excludeBlockTypes){const e=t.querySelectorAll(`[data-block-type="${n}"]`);for(const t of e)t.remove()}if(e.pageBreakBefore)for(const n of e.pageBreakBefore){const e=t.querySelectorAll(`[data-block-type="${n}"]`);for(const t of e)b(t,{breakBefore:"page",pageBreakBefore:"always"})}}(n,e),function(t,e){if(e.header){const n=document.createElement("div");n.className="notectl-print-header",n.innerHTML=C(e.header),t.insertBefore(n,t.firstChild)}if(e.footer){const n=document.createElement("div");n.className="notectl-print-footer",n.innerHTML=C(e.footer),t.appendChild(n)}}(n,e),n}(n,i),p=f.cloneNode(!0);!function(t){const e=x(t);if(0===e.size)return;const n=/* @__PURE__ */new Set;""!==t.id&&n.add(t.id);for(const r of t.querySelectorAll("[id]"))n.add(r.id);const o=/* @__PURE__ */new Map;for(const r of function(t){const e=[];return t.matches("[data-block-id][id]")&&""!==t.id&&e.push(t),e.push(...t.querySelectorAll("[data-block-id][id]")),e}(t)){const t=E("notectl-print-fallback-destination",n);o.set(r,t),r.id=t}for(const r of t.querySelectorAll("a[href]")){const t=M(e,r.getAttribute("href")??""),n=t?o.get(t):void 0;n&&r.setAttribute("href",`#${n}`)}}(p);const h=p.outerHTML,g=function(t){const e=x(t);if(0===e.size)return{markers:[]};const n=t.ownerDocument,o=/* @__PURE__ */new Set;""!==t.id&&o.add(t.id);for(const a of t.querySelectorAll("[id]"))o.add(a.id);const r=/* @__PURE__ */new Set;for(const a of t.querySelectorAll("slot[name]"))r.add(a.name);const s=/* @__PURE__ */new Map,i=[];for(const a of t.querySelectorAll("a[href]")){const t=a.getAttribute("href")??"";if(!t.startsWith("#"))continue;const c=M(e,t);if(!c)continue;let l=s.get(c);l||(l=R(c,n,o,r),s.set(c,l),i.push(l.marker)),a.setAttribute("href",`#${l.id}`)}return{markers:i}}(f),y=f.outerHTML,v=g.markers.map(t=>t.outerHTML).join(""),$=i.title??"",S=e.ownerDocument,w=e.closest("[lang]")?.getAttribute("lang")??(S.documentElement.lang||"en"),T={documentCSS:st(e,n,i,d),standaloneCSS:rt(e,n,i),hostSegments:u,shadowCSS:c,host:e,contentHTML:y,fallbackContentHTML:h,destinationMarkersHTML:v,title:$,lang:w,carryThemeContext:!1===i.forceLightTheme,variant:"export"},k=ft(T),j={html:k};return o.emit(l,j),{html:k,input:T}}return{print(t){const e=i(s(t));if(!e)return;const o=ft({...e.input,documentCSS:e.input.standaloneCSS,variant:"internal",styleNonce:y(n)}),a=document.createElement("iframe");g(a,"position:fixed;left:-9999px;width:0;height:0;border:none"),document.body.appendChild(a);const c=a.contentDocument,l=a.contentWindow;if(!c||!l)return void document.body.removeChild(a);c.open(),c.write(o),c.close();const u=()=>{a.remove()},d=()=>{l.addEventListener("afterprint",u,{once:!0}),l.print()};if("complete"===c.readyState)return void d();let f=!1;const p=()=>{f||(f=!0,r.delete(h),window.clearTimeout(m),d())},h=()=>{f=!0,window.clearTimeout(m),l.removeEventListener("load",p),a.remove()},m=window.setTimeout(p,4e3);r.add(h),l.addEventListener("load",p,{once:!0})},toHTML:t=>i(s(t))?.html??"",dispose(){for(const t of r)t();r.clear()}}}var ht={print(){},toHTML:()=>"",dispose(){}},mt=class{id="print";name="Print";config;service=null;locale;constructor(t){this.config=t??{}}async init(t){this.locale=await h(t,this.config.locale,$,w);const e=t.getContainer(),n=e.getRootNode();if(n instanceof ShadowRoot){const o=n.host,r=t.getEventBus();this.service=pt(n,o,e,r)}else this.service=ht;t.registerService(o,this.service);const r=this.config.defaults??{},s=this.service,i=this.locale;t.registerCommand("print",()=>(t.announce(i.printingAnnouncement),s.print(r),!0));const a=this.config.keyBinding??"Mod-P";if(t.registerKeymap({[a]:()=>(t.executeCommand("print"),!0)}),!1!==this.config.showToolbarItem){const e=v(a);t.registerToolbarItem({id:"print",group:"actions",label:this.locale.label,tooltip:this.locale.tooltip(e),icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z"/></svg>',command:"print"})}}destroy(){this.service?.dispose(),this.service=null}};export{$ as n,w as r,mt as t};
2
+ //# sourceMappingURL=PrintPlugin-DAEiEyKQ.mjs.map