@aquera/nile-elements 1.9.6 → 1.9.7

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 (510) hide show
  1. package/README.md +3 -0
  2. package/dist/index-178e1e57.cjs.js +2 -0
  3. package/dist/index-178e1e57.cjs.js.map +1 -0
  4. package/dist/index-1faa963c.esm.js +1 -0
  5. package/dist/index-249de90a.esm.js +1 -0
  6. package/dist/index-353172ed.esm.js +1 -0
  7. package/dist/index-6f3fa4ab.esm.js +1 -0
  8. package/dist/index-89c520e9.cjs.js +5 -0
  9. package/dist/index-89c520e9.cjs.js.map +1 -0
  10. package/dist/index-920675c4.esm.js +1 -0
  11. package/dist/index-b387a9f4.cjs.js +2 -0
  12. package/dist/index-b387a9f4.cjs.js.map +1 -0
  13. package/dist/index-cc1385e0.cjs.js +2 -0
  14. package/dist/index-cc1385e0.cjs.js.map +1 -0
  15. package/dist/index-dedc38a6.esm.js +1 -0
  16. package/dist/index-df196058.cjs.js +2 -0
  17. package/dist/index-df196058.cjs.js.map +1 -0
  18. package/dist/index-f956f56d.cjs.js +7 -0
  19. package/dist/index-f956f56d.cjs.js.map +1 -0
  20. package/dist/index.cjs.js +1 -1
  21. package/dist/index.esm.js +1 -1
  22. package/dist/index.js +3595 -629
  23. package/dist/internal/glyph.cjs.js +2 -0
  24. package/dist/internal/glyph.cjs.js.map +1 -0
  25. package/dist/internal/glyph.esm.js +5 -0
  26. package/dist/nile-auto-complete/index.cjs.js +1 -1
  27. package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -1
  28. package/dist/nile-auto-complete/portal-manager.cjs.js +1 -1
  29. package/dist/nile-auto-complete/portal-utils.cjs.js +1 -1
  30. package/dist/nile-code-editor/extensionSetup.cjs.js +7 -7
  31. package/dist/nile-code-editor/extensionSetup.cjs.js.map +1 -1
  32. package/dist/nile-code-editor/extensionSetup.esm.js +1 -1
  33. package/dist/nile-code-editor/index.cjs.js +1 -1
  34. package/dist/nile-code-editor/index.esm.js +1 -1
  35. package/dist/nile-code-editor/nile-code-editor.cjs.js +2 -2
  36. package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
  37. package/dist/nile-code-editor/nile-code-editor.esm.js +1 -1
  38. package/dist/nile-color-picker/index.cjs.js +1 -1
  39. package/dist/nile-color-picker/nile-color-picker.cjs.js +1 -1
  40. package/dist/nile-combobox/index.cjs.js +1 -1
  41. package/dist/nile-combobox/index.esm.js +1 -1
  42. package/dist/nile-combobox/nile-combobox.cjs.js +1 -1
  43. package/dist/nile-combobox/nile-combobox.esm.js +1 -1
  44. package/dist/nile-combobox/portal-manager.cjs.js +1 -1
  45. package/dist/nile-context-menu/index.cjs.js +1 -1
  46. package/dist/nile-context-menu/nile-context-menu.cjs.js +1 -1
  47. package/dist/nile-context-submenu/index.cjs.js +1 -1
  48. package/dist/nile-context-submenu/nile-context-submenu.cjs.js +1 -1
  49. package/dist/nile-detail/index.cjs.js +1 -1
  50. package/dist/nile-detail/index.esm.js +1 -1
  51. package/dist/nile-detail/nile-detail.cjs.js +1 -1
  52. package/dist/nile-detail/nile-detail.esm.js +1 -1
  53. package/dist/nile-dropdown/index.cjs.js +1 -1
  54. package/dist/nile-dropdown/nile-dropdown.cjs.js +1 -1
  55. package/dist/nile-dropdown/portal-manager.cjs.js +1 -1
  56. package/dist/nile-file-upload/index.cjs.js +1 -1
  57. package/dist/nile-file-upload/nile-file-upload.cjs.js +1 -1
  58. package/dist/nile-file-upload/nile-file-upload.template.cjs.js +1 -1
  59. package/dist/nile-floating-panel/index.cjs.js +1 -1
  60. package/dist/nile-floating-panel/nile-floating-panel.cjs.js +1 -1
  61. package/dist/nile-lite-tooltip/index.cjs.js +1 -1
  62. package/dist/nile-lite-tooltip/nile-lite-tooltip.cjs.js +1 -1
  63. package/dist/nile-markdown-editor/index.cjs.js +1 -1
  64. package/dist/nile-markdown-editor/nile-markdown-editor.cjs.js +1 -1
  65. package/dist/nile-popover/index.cjs.js +1 -1
  66. package/dist/nile-popover/nile-popover.cjs.js +1 -1
  67. package/dist/nile-popover/portal-manager.cjs.js +1 -1
  68. package/dist/nile-popup/index.cjs.js +1 -1
  69. package/dist/nile-popup/nile-popup.cjs.js +1 -1
  70. package/dist/nile-select/index.cjs.js +1 -1
  71. package/dist/nile-select/nile-select.cjs.js +1 -1
  72. package/dist/nile-select/portal-manager.cjs.js +1 -1
  73. package/dist/nile-side-bar-action/index.cjs.js +1 -1
  74. package/dist/nile-side-bar-action/nile-side-bar-action.cjs.js +1 -1
  75. package/dist/nile-side-bar-action/portal-manager.cjs.js +1 -1
  76. package/dist/nile-tooltip/index.cjs.js +1 -1
  77. package/dist/nile-tooltip/nile-tooltip.cjs.js +1 -1
  78. package/dist/nile-virtual-select/index.cjs.js +1 -1
  79. package/dist/nile-virtual-select/nile-virtual-select.cjs.js +1 -1
  80. package/dist/nile-virtual-select/portal-manager.cjs.js +1 -1
  81. package/dist/nile-virtual-select/renderer.cjs.js +1 -1
  82. package/dist/nile-wysiwyg-editor/emoji.cjs.js +2 -0
  83. package/dist/nile-wysiwyg-editor/emoji.cjs.js.map +1 -0
  84. package/dist/nile-wysiwyg-editor/emoji.esm.js +1 -0
  85. package/dist/nile-wysiwyg-editor/engine/commands.cjs.js +2 -0
  86. package/dist/nile-wysiwyg-editor/engine/commands.cjs.js.map +1 -0
  87. package/dist/nile-wysiwyg-editor/engine/commands.esm.js +1 -0
  88. package/dist/nile-wysiwyg-editor/engine/create-state.cjs.js +2 -0
  89. package/dist/nile-wysiwyg-editor/engine/create-state.cjs.js.map +1 -0
  90. package/dist/nile-wysiwyg-editor/engine/create-state.esm.js +1 -0
  91. package/dist/nile-wysiwyg-editor/engine/export.cjs.js +2 -0
  92. package/dist/nile-wysiwyg-editor/engine/export.cjs.js.map +1 -0
  93. package/dist/nile-wysiwyg-editor/engine/export.esm.js +1 -0
  94. package/dist/nile-wysiwyg-editor/engine/index.cjs.js +2 -0
  95. package/dist/nile-wysiwyg-editor/engine/index.cjs.js.map +1 -0
  96. package/dist/nile-wysiwyg-editor/engine/index.esm.js +1 -0
  97. package/dist/nile-wysiwyg-editor/engine/inputrules.cjs.js +2 -0
  98. package/dist/nile-wysiwyg-editor/engine/inputrules.cjs.js.map +1 -0
  99. package/dist/nile-wysiwyg-editor/engine/inputrules.esm.js +1 -0
  100. package/dist/nile-wysiwyg-editor/engine/keymap.cjs.js +2 -0
  101. package/dist/nile-wysiwyg-editor/engine/keymap.cjs.js.map +1 -0
  102. package/dist/nile-wysiwyg-editor/engine/keymap.esm.js +1 -0
  103. package/dist/nile-wysiwyg-editor/engine/markdown-parse.cjs.js +2 -0
  104. package/dist/nile-wysiwyg-editor/engine/markdown-parse.cjs.js.map +1 -0
  105. package/dist/nile-wysiwyg-editor/engine/markdown-parse.esm.js +1 -0
  106. package/dist/nile-wysiwyg-editor/engine/markdown.cjs.js +2 -0
  107. package/dist/nile-wysiwyg-editor/engine/markdown.cjs.js.map +1 -0
  108. package/dist/nile-wysiwyg-editor/engine/markdown.esm.js +1 -0
  109. package/dist/nile-wysiwyg-editor/engine/office-paste.cjs.js +2 -0
  110. package/dist/nile-wysiwyg-editor/engine/office-paste.cjs.js.map +1 -0
  111. package/dist/nile-wysiwyg-editor/engine/office-paste.esm.js +1 -0
  112. package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.cjs.js +2 -0
  113. package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.cjs.js.map +1 -0
  114. package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.esm.js +1 -0
  115. package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.cjs.js +2 -0
  116. package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.cjs.js.map +1 -0
  117. package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.esm.js +1 -0
  118. package/dist/nile-wysiwyg-editor/engine/plugins/embeds.cjs.js +2 -0
  119. package/dist/nile-wysiwyg-editor/engine/plugins/embeds.cjs.js.map +1 -0
  120. package/dist/nile-wysiwyg-editor/engine/plugins/embeds.esm.js +1 -0
  121. package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.cjs.js +2 -0
  122. package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.cjs.js.map +1 -0
  123. package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.esm.js +1 -0
  124. package/dist/nile-wysiwyg-editor/engine/plugins/format-painter.cjs.js +2 -0
  125. package/dist/nile-wysiwyg-editor/engine/plugins/format-painter.cjs.js.map +1 -0
  126. package/dist/nile-wysiwyg-editor/engine/plugins/format-painter.esm.js +1 -0
  127. package/dist/nile-wysiwyg-editor/engine/plugins/image-view.cjs.js +2 -0
  128. package/dist/nile-wysiwyg-editor/engine/plugins/image-view.cjs.js.map +1 -0
  129. package/dist/nile-wysiwyg-editor/engine/plugins/image-view.esm.js +1 -0
  130. package/dist/nile-wysiwyg-editor/engine/plugins/image.cjs.js +2 -0
  131. package/dist/nile-wysiwyg-editor/engine/plugins/image.cjs.js.map +1 -0
  132. package/dist/nile-wysiwyg-editor/engine/plugins/image.esm.js +1 -0
  133. package/dist/nile-wysiwyg-editor/engine/plugins/link.cjs.js +2 -0
  134. package/dist/nile-wysiwyg-editor/engine/plugins/link.cjs.js.map +1 -0
  135. package/dist/nile-wysiwyg-editor/engine/plugins/link.esm.js +1 -0
  136. package/dist/nile-wysiwyg-editor/engine/plugins/math-view.cjs.js +2 -0
  137. package/dist/nile-wysiwyg-editor/engine/plugins/math-view.cjs.js.map +1 -0
  138. package/dist/nile-wysiwyg-editor/engine/plugins/math-view.esm.js +1 -0
  139. package/dist/nile-wysiwyg-editor/engine/plugins/max-length.cjs.js +2 -0
  140. package/dist/nile-wysiwyg-editor/engine/plugins/max-length.cjs.js.map +1 -0
  141. package/dist/nile-wysiwyg-editor/engine/plugins/max-length.esm.js +1 -0
  142. package/dist/nile-wysiwyg-editor/engine/plugins/paste.cjs.js +2 -0
  143. package/dist/nile-wysiwyg-editor/engine/plugins/paste.cjs.js.map +1 -0
  144. package/dist/nile-wysiwyg-editor/engine/plugins/paste.esm.js +1 -0
  145. package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.cjs.js +2 -0
  146. package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.cjs.js.map +1 -0
  147. package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.esm.js +1 -0
  148. package/dist/nile-wysiwyg-editor/engine/plugins/single-line.cjs.js +2 -0
  149. package/dist/nile-wysiwyg-editor/engine/plugins/single-line.cjs.js.map +1 -0
  150. package/dist/nile-wysiwyg-editor/engine/plugins/single-line.esm.js +1 -0
  151. package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.cjs.js +2 -0
  152. package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.cjs.js.map +1 -0
  153. package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.esm.js +1 -0
  154. package/dist/nile-wysiwyg-editor/engine/plugins/tables.cjs.js +2 -0
  155. package/dist/nile-wysiwyg-editor/engine/plugins/tables.cjs.js.map +1 -0
  156. package/dist/nile-wysiwyg-editor/engine/plugins/tables.esm.js +1 -0
  157. package/dist/nile-wysiwyg-editor/engine/plugins/task-list.cjs.js +2 -0
  158. package/dist/nile-wysiwyg-editor/engine/plugins/task-list.cjs.js.map +1 -0
  159. package/dist/nile-wysiwyg-editor/engine/plugins/task-list.esm.js +1 -0
  160. package/dist/nile-wysiwyg-editor/engine/sanitize.cjs.js +2 -0
  161. package/dist/nile-wysiwyg-editor/engine/sanitize.cjs.js.map +1 -0
  162. package/dist/nile-wysiwyg-editor/engine/sanitize.esm.js +1 -0
  163. package/dist/nile-wysiwyg-editor/engine/schema.cjs.js +2 -0
  164. package/dist/nile-wysiwyg-editor/engine/schema.cjs.js.map +1 -0
  165. package/dist/nile-wysiwyg-editor/engine/schema.esm.js +1 -0
  166. package/dist/nile-wysiwyg-editor/engine/selection-state.cjs.js +2 -0
  167. package/dist/nile-wysiwyg-editor/engine/selection-state.cjs.js.map +1 -0
  168. package/dist/nile-wysiwyg-editor/engine/selection-state.esm.js +1 -0
  169. package/dist/nile-wysiwyg-editor/engine/serializer.cjs.js +2 -0
  170. package/dist/nile-wysiwyg-editor/engine/serializer.cjs.js.map +1 -0
  171. package/dist/nile-wysiwyg-editor/engine/serializer.esm.js +1 -0
  172. package/dist/nile-wysiwyg-editor/index.cjs.js +2 -0
  173. package/dist/nile-wysiwyg-editor/index.cjs.js.map +1 -0
  174. package/dist/nile-wysiwyg-editor/index.esm.js +1 -0
  175. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js +2 -0
  176. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js.map +1 -0
  177. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.cjs.js +2 -0
  178. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.cjs.js.map +1 -0
  179. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.esm.js +780 -0
  180. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.esm.js +97 -0
  181. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.cjs.js +2 -0
  182. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.cjs.js.map +1 -0
  183. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.esm.js +1 -0
  184. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.cjs.js +2 -0
  185. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.cjs.js.map +1 -0
  186. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.cjs.js +2 -0
  187. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.cjs.js.map +1 -0
  188. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.esm.js +244 -0
  189. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.esm.js +137 -0
  190. package/dist/nile-wysiwyg-editor/types.cjs.js +2 -0
  191. package/dist/nile-wysiwyg-editor/types.cjs.js.map +1 -0
  192. package/dist/nile-wysiwyg-editor/types.esm.js +1 -0
  193. package/dist/nile-wysiwyg-editor/ui/bookmark-panel.cjs.js +2 -0
  194. package/dist/nile-wysiwyg-editor/ui/bookmark-panel.cjs.js.map +1 -0
  195. package/dist/nile-wysiwyg-editor/ui/bookmark-panel.esm.js +97 -0
  196. package/dist/nile-wysiwyg-editor/ui/bubble-menu.cjs.js +2 -0
  197. package/dist/nile-wysiwyg-editor/ui/bubble-menu.cjs.js.map +1 -0
  198. package/dist/nile-wysiwyg-editor/ui/bubble-menu.esm.js +67 -0
  199. package/dist/nile-wysiwyg-editor/ui/code-block-menu.cjs.js +2 -0
  200. package/dist/nile-wysiwyg-editor/ui/code-block-menu.cjs.js.map +1 -0
  201. package/dist/nile-wysiwyg-editor/ui/code-block-menu.esm.js +65 -0
  202. package/dist/nile-wysiwyg-editor/ui/embed-menu.cjs.js +2 -0
  203. package/dist/nile-wysiwyg-editor/ui/embed-menu.cjs.js.map +1 -0
  204. package/dist/nile-wysiwyg-editor/ui/embed-menu.esm.js +64 -0
  205. package/dist/nile-wysiwyg-editor/ui/embed-panel.cjs.js +2 -0
  206. package/dist/nile-wysiwyg-editor/ui/embed-panel.cjs.js.map +1 -0
  207. package/dist/nile-wysiwyg-editor/ui/embed-panel.esm.js +68 -0
  208. package/dist/nile-wysiwyg-editor/ui/emoji-picker.cjs.js +2 -0
  209. package/dist/nile-wysiwyg-editor/ui/emoji-picker.cjs.js.map +1 -0
  210. package/dist/nile-wysiwyg-editor/ui/emoji-picker.esm.js +96 -0
  211. package/dist/nile-wysiwyg-editor/ui/find-replace.cjs.js +2 -0
  212. package/dist/nile-wysiwyg-editor/ui/find-replace.cjs.js.map +1 -0
  213. package/dist/nile-wysiwyg-editor/ui/find-replace.esm.js +112 -0
  214. package/dist/nile-wysiwyg-editor/ui/image-menu.cjs.js +2 -0
  215. package/dist/nile-wysiwyg-editor/ui/image-menu.cjs.js.map +1 -0
  216. package/dist/nile-wysiwyg-editor/ui/image-menu.esm.js +64 -0
  217. package/dist/nile-wysiwyg-editor/ui/image-panel.cjs.js +2 -0
  218. package/dist/nile-wysiwyg-editor/ui/image-panel.cjs.js.map +1 -0
  219. package/dist/nile-wysiwyg-editor/ui/image-panel.esm.js +171 -0
  220. package/dist/nile-wysiwyg-editor/ui/insert-menu.cjs.js +2 -0
  221. package/dist/nile-wysiwyg-editor/ui/insert-menu.cjs.js.map +1 -0
  222. package/dist/nile-wysiwyg-editor/ui/insert-menu.esm.js +90 -0
  223. package/dist/nile-wysiwyg-editor/ui/link-editor.cjs.js +2 -0
  224. package/dist/nile-wysiwyg-editor/ui/link-editor.cjs.js.map +1 -0
  225. package/dist/nile-wysiwyg-editor/ui/link-editor.esm.js +114 -0
  226. package/dist/nile-wysiwyg-editor/ui/markdown-panel.cjs.js +2 -0
  227. package/dist/nile-wysiwyg-editor/ui/markdown-panel.cjs.js.map +1 -0
  228. package/dist/nile-wysiwyg-editor/ui/markdown-panel.esm.js +80 -0
  229. package/dist/nile-wysiwyg-editor/ui/math-panel.cjs.js +2 -0
  230. package/dist/nile-wysiwyg-editor/ui/math-panel.cjs.js.map +1 -0
  231. package/dist/nile-wysiwyg-editor/ui/math-panel.esm.js +92 -0
  232. package/dist/nile-wysiwyg-editor/ui/shortcut-help.cjs.js +2 -0
  233. package/dist/nile-wysiwyg-editor/ui/shortcut-help.cjs.js.map +1 -0
  234. package/dist/nile-wysiwyg-editor/ui/shortcut-help.esm.js +147 -0
  235. package/dist/nile-wysiwyg-editor/ui/source-view.cjs.js +2 -0
  236. package/dist/nile-wysiwyg-editor/ui/source-view.cjs.js.map +1 -0
  237. package/dist/nile-wysiwyg-editor/ui/source-view.esm.js +79 -0
  238. package/dist/nile-wysiwyg-editor/ui/special-chars.cjs.js +2 -0
  239. package/dist/nile-wysiwyg-editor/ui/special-chars.cjs.js.map +1 -0
  240. package/dist/nile-wysiwyg-editor/ui/special-chars.esm.js +96 -0
  241. package/dist/nile-wysiwyg-editor/ui/suggest-list.cjs.js +2 -0
  242. package/dist/nile-wysiwyg-editor/ui/suggest-list.cjs.js.map +1 -0
  243. package/dist/nile-wysiwyg-editor/ui/suggest-list.esm.js +67 -0
  244. package/dist/nile-wysiwyg-editor/ui/table-grid-picker.cjs.js +2 -0
  245. package/dist/nile-wysiwyg-editor/ui/table-grid-picker.cjs.js.map +1 -0
  246. package/dist/nile-wysiwyg-editor/ui/table-grid-picker.esm.js +100 -0
  247. package/dist/nile-wysiwyg-editor/ui/table-menu.cjs.js +2 -0
  248. package/dist/nile-wysiwyg-editor/ui/table-menu.cjs.js.map +1 -0
  249. package/dist/nile-wysiwyg-editor/ui/table-menu.esm.js +58 -0
  250. package/dist/src/index.d.ts +24 -0
  251. package/dist/src/index.js +19 -0
  252. package/dist/src/index.js.map +1 -1
  253. package/dist/src/internal/glyph.d.ts +6 -0
  254. package/dist/src/internal/glyph.js +13 -0
  255. package/dist/src/internal/glyph.js.map +1 -0
  256. package/dist/src/nile-wysiwyg-editor/emoji.d.ts +5 -0
  257. package/dist/src/nile-wysiwyg-editor/emoji.js +138 -0
  258. package/dist/src/nile-wysiwyg-editor/emoji.js.map +1 -0
  259. package/dist/src/nile-wysiwyg-editor/engine/commands.d.ts +69 -0
  260. package/dist/src/nile-wysiwyg-editor/engine/commands.js +863 -0
  261. package/dist/src/nile-wysiwyg-editor/engine/commands.js.map +1 -0
  262. package/dist/src/nile-wysiwyg-editor/engine/create-state.d.ts +35 -0
  263. package/dist/src/nile-wysiwyg-editor/engine/create-state.js +67 -0
  264. package/dist/src/nile-wysiwyg-editor/engine/create-state.js.map +1 -0
  265. package/dist/src/nile-wysiwyg-editor/engine/export.d.ts +38 -0
  266. package/dist/src/nile-wysiwyg-editor/engine/export.js +208 -0
  267. package/dist/src/nile-wysiwyg-editor/engine/export.js.map +1 -0
  268. package/dist/src/nile-wysiwyg-editor/engine/export.test.d.ts +1 -0
  269. package/dist/src/nile-wysiwyg-editor/engine/export.test.js +96 -0
  270. package/dist/src/nile-wysiwyg-editor/engine/export.test.js.map +1 -0
  271. package/dist/src/nile-wysiwyg-editor/engine/index.d.ts +37 -0
  272. package/dist/src/nile-wysiwyg-editor/engine/index.js +29 -0
  273. package/dist/src/nile-wysiwyg-editor/engine/index.js.map +1 -0
  274. package/dist/src/nile-wysiwyg-editor/engine/inputrules.d.ts +12 -0
  275. package/dist/src/nile-wysiwyg-editor/engine/inputrules.js +144 -0
  276. package/dist/src/nile-wysiwyg-editor/engine/inputrules.js.map +1 -0
  277. package/dist/src/nile-wysiwyg-editor/engine/keymap.d.ts +15 -0
  278. package/dist/src/nile-wysiwyg-editor/engine/keymap.js +94 -0
  279. package/dist/src/nile-wysiwyg-editor/engine/keymap.js.map +1 -0
  280. package/dist/src/nile-wysiwyg-editor/engine/markdown-parse.d.ts +22 -0
  281. package/dist/src/nile-wysiwyg-editor/engine/markdown-parse.js +287 -0
  282. package/dist/src/nile-wysiwyg-editor/engine/markdown-parse.js.map +1 -0
  283. package/dist/src/nile-wysiwyg-editor/engine/markdown-parse.test.d.ts +1 -0
  284. package/dist/src/nile-wysiwyg-editor/engine/markdown-parse.test.js +106 -0
  285. package/dist/src/nile-wysiwyg-editor/engine/markdown-parse.test.js.map +1 -0
  286. package/dist/src/nile-wysiwyg-editor/engine/markdown.d.ts +10 -0
  287. package/dist/src/nile-wysiwyg-editor/engine/markdown.js +162 -0
  288. package/dist/src/nile-wysiwyg-editor/engine/markdown.js.map +1 -0
  289. package/dist/src/nile-wysiwyg-editor/engine/office-paste.d.ts +13 -0
  290. package/dist/src/nile-wysiwyg-editor/engine/office-paste.js +182 -0
  291. package/dist/src/nile-wysiwyg-editor/engine/office-paste.js.map +1 -0
  292. package/dist/src/nile-wysiwyg-editor/engine/plugins/code-highlight.d.ts +10 -0
  293. package/dist/src/nile-wysiwyg-editor/engine/plugins/code-highlight.js +165 -0
  294. package/dist/src/nile-wysiwyg-editor/engine/plugins/code-highlight.js.map +1 -0
  295. package/dist/src/nile-wysiwyg-editor/engine/plugins/embed-view.d.ts +17 -0
  296. package/dist/src/nile-wysiwyg-editor/engine/plugins/embed-view.js +69 -0
  297. package/dist/src/nile-wysiwyg-editor/engine/plugins/embed-view.js.map +1 -0
  298. package/dist/src/nile-wysiwyg-editor/engine/plugins/embeds.d.ts +17 -0
  299. package/dist/src/nile-wysiwyg-editor/engine/plugins/embeds.js +96 -0
  300. package/dist/src/nile-wysiwyg-editor/engine/plugins/embeds.js.map +1 -0
  301. package/dist/src/nile-wysiwyg-editor/engine/plugins/find-replace.d.ts +26 -0
  302. package/dist/src/nile-wysiwyg-editor/engine/plugins/find-replace.js +123 -0
  303. package/dist/src/nile-wysiwyg-editor/engine/plugins/find-replace.js.map +1 -0
  304. package/dist/src/nile-wysiwyg-editor/engine/plugins/format-painter.d.ts +28 -0
  305. package/dist/src/nile-wysiwyg-editor/engine/plugins/format-painter.js +72 -0
  306. package/dist/src/nile-wysiwyg-editor/engine/plugins/format-painter.js.map +1 -0
  307. package/dist/src/nile-wysiwyg-editor/engine/plugins/image-view.d.ts +41 -0
  308. package/dist/src/nile-wysiwyg-editor/engine/plugins/image-view.js +176 -0
  309. package/dist/src/nile-wysiwyg-editor/engine/plugins/image-view.js.map +1 -0
  310. package/dist/src/nile-wysiwyg-editor/engine/plugins/image.d.ts +15 -0
  311. package/dist/src/nile-wysiwyg-editor/engine/plugins/image.js +64 -0
  312. package/dist/src/nile-wysiwyg-editor/engine/plugins/image.js.map +1 -0
  313. package/dist/src/nile-wysiwyg-editor/engine/plugins/link.d.ts +11 -0
  314. package/dist/src/nile-wysiwyg-editor/engine/plugins/link.js +42 -0
  315. package/dist/src/nile-wysiwyg-editor/engine/plugins/link.js.map +1 -0
  316. package/dist/src/nile-wysiwyg-editor/engine/plugins/math-view.d.ts +18 -0
  317. package/dist/src/nile-wysiwyg-editor/engine/plugins/math-view.js +46 -0
  318. package/dist/src/nile-wysiwyg-editor/engine/plugins/math-view.js.map +1 -0
  319. package/dist/src/nile-wysiwyg-editor/engine/plugins/max-length.d.ts +7 -0
  320. package/dist/src/nile-wysiwyg-editor/engine/plugins/max-length.js +26 -0
  321. package/dist/src/nile-wysiwyg-editor/engine/plugins/max-length.js.map +1 -0
  322. package/dist/src/nile-wysiwyg-editor/engine/plugins/paste.d.ts +31 -0
  323. package/dist/src/nile-wysiwyg-editor/engine/plugins/paste.js +55 -0
  324. package/dist/src/nile-wysiwyg-editor/engine/plugins/paste.js.map +1 -0
  325. package/dist/src/nile-wysiwyg-editor/engine/plugins/placeholder.d.ts +7 -0
  326. package/dist/src/nile-wysiwyg-editor/engine/plugins/placeholder.js +25 -0
  327. package/dist/src/nile-wysiwyg-editor/engine/plugins/placeholder.js.map +1 -0
  328. package/dist/src/nile-wysiwyg-editor/engine/plugins/single-line.d.ts +10 -0
  329. package/dist/src/nile-wysiwyg-editor/engine/plugins/single-line.js +48 -0
  330. package/dist/src/nile-wysiwyg-editor/engine/plugins/single-line.js.map +1 -0
  331. package/dist/src/nile-wysiwyg-editor/engine/plugins/suggestions.d.ts +29 -0
  332. package/dist/src/nile-wysiwyg-editor/engine/plugins/suggestions.js +87 -0
  333. package/dist/src/nile-wysiwyg-editor/engine/plugins/suggestions.js.map +1 -0
  334. package/dist/src/nile-wysiwyg-editor/engine/plugins/tables.d.ts +8 -0
  335. package/dist/src/nile-wysiwyg-editor/engine/plugins/tables.js +11 -0
  336. package/dist/src/nile-wysiwyg-editor/engine/plugins/tables.js.map +1 -0
  337. package/dist/src/nile-wysiwyg-editor/engine/plugins/task-list.d.ts +16 -0
  338. package/dist/src/nile-wysiwyg-editor/engine/plugins/task-list.js +49 -0
  339. package/dist/src/nile-wysiwyg-editor/engine/plugins/task-list.js.map +1 -0
  340. package/dist/src/nile-wysiwyg-editor/engine/pm.test.d.ts +1 -0
  341. package/dist/src/nile-wysiwyg-editor/engine/pm.test.js +883 -0
  342. package/dist/src/nile-wysiwyg-editor/engine/pm.test.js.map +1 -0
  343. package/dist/src/nile-wysiwyg-editor/engine/productivity.test.d.ts +1 -0
  344. package/dist/src/nile-wysiwyg-editor/engine/productivity.test.js +129 -0
  345. package/dist/src/nile-wysiwyg-editor/engine/productivity.test.js.map +1 -0
  346. package/dist/src/nile-wysiwyg-editor/engine/sanitize.d.ts +13 -0
  347. package/dist/src/nile-wysiwyg-editor/engine/sanitize.js +155 -0
  348. package/dist/src/nile-wysiwyg-editor/engine/sanitize.js.map +1 -0
  349. package/dist/src/nile-wysiwyg-editor/engine/schema.d.ts +20 -0
  350. package/dist/src/nile-wysiwyg-editor/engine/schema.js +823 -0
  351. package/dist/src/nile-wysiwyg-editor/engine/schema.js.map +1 -0
  352. package/dist/src/nile-wysiwyg-editor/engine/selection-state.d.ts +70 -0
  353. package/dist/src/nile-wysiwyg-editor/engine/selection-state.js +138 -0
  354. package/dist/src/nile-wysiwyg-editor/engine/selection-state.js.map +1 -0
  355. package/dist/src/nile-wysiwyg-editor/engine/serializer.d.ts +18 -0
  356. package/dist/src/nile-wysiwyg-editor/engine/serializer.js +63 -0
  357. package/dist/src/nile-wysiwyg-editor/engine/serializer.js.map +1 -0
  358. package/dist/src/nile-wysiwyg-editor/index.d.ts +3 -0
  359. package/dist/src/nile-wysiwyg-editor/index.js +3 -0
  360. package/dist/src/nile-wysiwyg-editor/index.js.map +1 -0
  361. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.d.ts +1 -0
  362. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.js +782 -0
  363. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.js.map +1 -0
  364. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.d.ts +364 -0
  365. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js +2038 -0
  366. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js.map +1 -0
  367. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.d.ts +1 -0
  368. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.js +636 -0
  369. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.js.map +1 -0
  370. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.d.ts +1 -0
  371. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.js +2 -0
  372. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.js.map +1 -0
  373. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.d.ts +6 -0
  374. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.js +251 -0
  375. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.js.map +1 -0
  376. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.d.ts +41 -0
  377. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.js +700 -0
  378. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.js.map +1 -0
  379. package/dist/src/nile-wysiwyg-editor/types.d.ts +49 -0
  380. package/dist/src/nile-wysiwyg-editor/types.js +8 -0
  381. package/dist/src/nile-wysiwyg-editor/types.js.map +1 -0
  382. package/dist/src/nile-wysiwyg-editor/ui/bookmark-panel.d.ts +20 -0
  383. package/dist/src/nile-wysiwyg-editor/ui/bookmark-panel.js +159 -0
  384. package/dist/src/nile-wysiwyg-editor/ui/bookmark-panel.js.map +1 -0
  385. package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.d.ts +21 -0
  386. package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.js +125 -0
  387. package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.js.map +1 -0
  388. package/dist/src/nile-wysiwyg-editor/ui/code-block-menu.d.ts +18 -0
  389. package/dist/src/nile-wysiwyg-editor/ui/code-block-menu.js +107 -0
  390. package/dist/src/nile-wysiwyg-editor/ui/code-block-menu.js.map +1 -0
  391. package/dist/src/nile-wysiwyg-editor/ui/embed-menu.d.ts +19 -0
  392. package/dist/src/nile-wysiwyg-editor/ui/embed-menu.js +123 -0
  393. package/dist/src/nile-wysiwyg-editor/ui/embed-menu.js.map +1 -0
  394. package/dist/src/nile-wysiwyg-editor/ui/embed-panel.d.ts +27 -0
  395. package/dist/src/nile-wysiwyg-editor/ui/embed-panel.js +146 -0
  396. package/dist/src/nile-wysiwyg-editor/ui/embed-panel.js.map +1 -0
  397. package/dist/src/nile-wysiwyg-editor/ui/emoji-picker.d.ts +21 -0
  398. package/dist/src/nile-wysiwyg-editor/ui/emoji-picker.js +154 -0
  399. package/dist/src/nile-wysiwyg-editor/ui/emoji-picker.js.map +1 -0
  400. package/dist/src/nile-wysiwyg-editor/ui/find-replace.d.ts +26 -0
  401. package/dist/src/nile-wysiwyg-editor/ui/find-replace.js +178 -0
  402. package/dist/src/nile-wysiwyg-editor/ui/find-replace.js.map +1 -0
  403. package/dist/src/nile-wysiwyg-editor/ui/image-menu.d.ts +18 -0
  404. package/dist/src/nile-wysiwyg-editor/ui/image-menu.js +129 -0
  405. package/dist/src/nile-wysiwyg-editor/ui/image-menu.js.map +1 -0
  406. package/dist/src/nile-wysiwyg-editor/ui/image-panel.d.ts +56 -0
  407. package/dist/src/nile-wysiwyg-editor/ui/image-panel.js +349 -0
  408. package/dist/src/nile-wysiwyg-editor/ui/image-panel.js.map +1 -0
  409. package/dist/src/nile-wysiwyg-editor/ui/insert-menu.d.ts +25 -0
  410. package/dist/src/nile-wysiwyg-editor/ui/insert-menu.js +142 -0
  411. package/dist/src/nile-wysiwyg-editor/ui/insert-menu.js.map +1 -0
  412. package/dist/src/nile-wysiwyg-editor/ui/link-editor.d.ts +30 -0
  413. package/dist/src/nile-wysiwyg-editor/ui/link-editor.js +189 -0
  414. package/dist/src/nile-wysiwyg-editor/ui/link-editor.js.map +1 -0
  415. package/dist/src/nile-wysiwyg-editor/ui/markdown-panel.d.ts +24 -0
  416. package/dist/src/nile-wysiwyg-editor/ui/markdown-panel.js +144 -0
  417. package/dist/src/nile-wysiwyg-editor/ui/markdown-panel.js.map +1 -0
  418. package/dist/src/nile-wysiwyg-editor/ui/math-panel.d.ts +31 -0
  419. package/dist/src/nile-wysiwyg-editor/ui/math-panel.js +172 -0
  420. package/dist/src/nile-wysiwyg-editor/ui/math-panel.js.map +1 -0
  421. package/dist/src/nile-wysiwyg-editor/ui/shortcut-help.d.ts +30 -0
  422. package/dist/src/nile-wysiwyg-editor/ui/shortcut-help.js +296 -0
  423. package/dist/src/nile-wysiwyg-editor/ui/shortcut-help.js.map +1 -0
  424. package/dist/src/nile-wysiwyg-editor/ui/source-view.d.ts +19 -0
  425. package/dist/src/nile-wysiwyg-editor/ui/source-view.js +120 -0
  426. package/dist/src/nile-wysiwyg-editor/ui/source-view.js.map +1 -0
  427. package/dist/src/nile-wysiwyg-editor/ui/special-chars.d.ts +20 -0
  428. package/dist/src/nile-wysiwyg-editor/ui/special-chars.js +199 -0
  429. package/dist/src/nile-wysiwyg-editor/ui/special-chars.js.map +1 -0
  430. package/dist/src/nile-wysiwyg-editor/ui/suggest-list.d.ts +31 -0
  431. package/dist/src/nile-wysiwyg-editor/ui/suggest-list.js +133 -0
  432. package/dist/src/nile-wysiwyg-editor/ui/suggest-list.js.map +1 -0
  433. package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.d.ts +23 -0
  434. package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.js +177 -0
  435. package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.js.map +1 -0
  436. package/dist/src/nile-wysiwyg-editor/ui/table-menu.d.ts +16 -0
  437. package/dist/src/nile-wysiwyg-editor/ui/table-menu.js +101 -0
  438. package/dist/src/nile-wysiwyg-editor/ui/table-menu.js.map +1 -0
  439. package/dist/src/version.js +1 -1
  440. package/dist/src/version.js.map +1 -1
  441. package/dist/tsconfig.tsbuildinfo +1 -1
  442. package/package.json +18 -2
  443. package/src/index.ts +57 -1
  444. package/src/internal/glyph.ts +13 -0
  445. package/src/nile-wysiwyg-editor/emoji.ts +137 -0
  446. package/src/nile-wysiwyg-editor/engine/commands.ts +1035 -0
  447. package/src/nile-wysiwyg-editor/engine/create-state.ts +117 -0
  448. package/src/nile-wysiwyg-editor/engine/export.test.ts +113 -0
  449. package/src/nile-wysiwyg-editor/engine/export.ts +242 -0
  450. package/src/nile-wysiwyg-editor/engine/index.ts +69 -0
  451. package/src/nile-wysiwyg-editor/engine/inputrules.ts +169 -0
  452. package/src/nile-wysiwyg-editor/engine/keymap.ts +146 -0
  453. package/src/nile-wysiwyg-editor/engine/markdown-parse.test.ts +148 -0
  454. package/src/nile-wysiwyg-editor/engine/markdown-parse.ts +337 -0
  455. package/src/nile-wysiwyg-editor/engine/markdown.ts +165 -0
  456. package/src/nile-wysiwyg-editor/engine/office-paste.ts +199 -0
  457. package/src/nile-wysiwyg-editor/engine/plugins/code-highlight.ts +173 -0
  458. package/src/nile-wysiwyg-editor/engine/plugins/embed-view.ts +85 -0
  459. package/src/nile-wysiwyg-editor/engine/plugins/embeds.ts +99 -0
  460. package/src/nile-wysiwyg-editor/engine/plugins/find-replace.ts +155 -0
  461. package/src/nile-wysiwyg-editor/engine/plugins/format-painter.ts +80 -0
  462. package/src/nile-wysiwyg-editor/engine/plugins/image-view.ts +220 -0
  463. package/src/nile-wysiwyg-editor/engine/plugins/image.ts +80 -0
  464. package/src/nile-wysiwyg-editor/engine/plugins/link.ts +42 -0
  465. package/src/nile-wysiwyg-editor/engine/plugins/math-view.ts +56 -0
  466. package/src/nile-wysiwyg-editor/engine/plugins/max-length.ts +24 -0
  467. package/src/nile-wysiwyg-editor/engine/plugins/paste.ts +74 -0
  468. package/src/nile-wysiwyg-editor/engine/plugins/placeholder.ts +24 -0
  469. package/src/nile-wysiwyg-editor/engine/plugins/single-line.ts +47 -0
  470. package/src/nile-wysiwyg-editor/engine/plugins/suggestions.ts +110 -0
  471. package/src/nile-wysiwyg-editor/engine/plugins/tables.ts +12 -0
  472. package/src/nile-wysiwyg-editor/engine/plugins/task-list.ts +65 -0
  473. package/src/nile-wysiwyg-editor/engine/pm.test.ts +1088 -0
  474. package/src/nile-wysiwyg-editor/engine/productivity.test.ts +163 -0
  475. package/src/nile-wysiwyg-editor/engine/sanitize.ts +156 -0
  476. package/src/nile-wysiwyg-editor/engine/schema.ts +859 -0
  477. package/src/nile-wysiwyg-editor/engine/selection-state.ts +210 -0
  478. package/src/nile-wysiwyg-editor/engine/serializer.ts +78 -0
  479. package/src/nile-wysiwyg-editor/index.ts +3 -0
  480. package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.ts +782 -0
  481. package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.ts +750 -0
  482. package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.ts +2155 -0
  483. package/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.ts +1 -0
  484. package/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.ts +251 -0
  485. package/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.ts +772 -0
  486. package/src/nile-wysiwyg-editor/types.ts +83 -0
  487. package/src/nile-wysiwyg-editor/ui/bookmark-panel.ts +155 -0
  488. package/src/nile-wysiwyg-editor/ui/bubble-menu.ts +135 -0
  489. package/src/nile-wysiwyg-editor/ui/code-block-menu.ts +105 -0
  490. package/src/nile-wysiwyg-editor/ui/embed-menu.ts +133 -0
  491. package/src/nile-wysiwyg-editor/ui/embed-panel.ts +143 -0
  492. package/src/nile-wysiwyg-editor/ui/emoji-picker.ts +152 -0
  493. package/src/nile-wysiwyg-editor/ui/find-replace.ts +174 -0
  494. package/src/nile-wysiwyg-editor/ui/image-menu.ts +140 -0
  495. package/src/nile-wysiwyg-editor/ui/image-panel.ts +337 -0
  496. package/src/nile-wysiwyg-editor/ui/insert-menu.ts +142 -0
  497. package/src/nile-wysiwyg-editor/ui/link-editor.ts +180 -0
  498. package/src/nile-wysiwyg-editor/ui/markdown-panel.ts +143 -0
  499. package/src/nile-wysiwyg-editor/ui/math-panel.ts +169 -0
  500. package/src/nile-wysiwyg-editor/ui/shortcut-help.ts +311 -0
  501. package/src/nile-wysiwyg-editor/ui/source-view.ts +119 -0
  502. package/src/nile-wysiwyg-editor/ui/special-chars.ts +209 -0
  503. package/src/nile-wysiwyg-editor/ui/suggest-list.ts +138 -0
  504. package/src/nile-wysiwyg-editor/ui/table-grid-picker.ts +173 -0
  505. package/src/nile-wysiwyg-editor/ui/table-menu.ts +109 -0
  506. package/vscode-html-custom-data.json +450 -0
  507. package/web-dev-server.config.mjs +6 -2
  508. package/dist/index-5fef1a0d.esm.js +0 -1
  509. package/dist/index-8f38fae3.cjs.js +0 -2
  510. package/dist/index-8f38fae3.cjs.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-painter.cjs.js","sources":["../../../../../src/nile-wysiwyg-editor/engine/plugins/format-painter.ts"],"sourcesContent":["/**\n * Format painter: copy the inline formatting (marks) at the current selection,\n * then apply it to the next selection the user makes — like the paint-roller\n * tool in word processors. The plugin only holds the copied marks and an\n * \"armed\" flag; the host drives arm/apply through the exported helpers.\n */\nimport { EditorState, Plugin, PluginKey, Transaction } from 'prosemirror-state';\nimport { Mark } from 'prosemirror-model';\n\ninterface FormatPainterState {\n marks: readonly Mark[] | null;\n}\n\nexport const formatPainterKey = new PluginKey<FormatPainterState>('nileFormatPainter');\n\ntype PainterMeta = { type: 'arm'; marks: readonly Mark[] } | { type: 'disarm' };\n\nexport function formatPainterPlugin(): Plugin<FormatPainterState> {\n return new Plugin<FormatPainterState>({\n key: formatPainterKey,\n state: {\n init: () => ({ marks: null }),\n apply(tr, value) {\n const meta = tr.getMeta(formatPainterKey) as PainterMeta | undefined;\n if (meta?.type === 'arm') return { marks: meta.marks };\n if (meta?.type === 'disarm') return { marks: null };\n return value;\n },\n },\n props: {\n attributes: state =>\n (formatPainterKey.getState(state)?.marks\n ? { class: 'nile-wysiwyg--painting' }\n : {}) as Record<string, string>,\n },\n });\n}\n\n/** True while the painter is armed (marks captured, waiting to apply). */\nexport function isFormatPainterArmed(state: EditorState): boolean {\n return !!formatPainterKey.getState(state)?.marks;\n}\n\n/** The inline marks to copy from the current selection/caret. */\nfunction capturedMarks(state: EditorState): readonly Mark[] {\n const { $from, empty } = state.selection;\n if (empty) return state.storedMarks ?? $from.marks();\n // Marks that hold across the selection start — the visible formatting.\n return $from.marksAcross(state.selection.$to) ?? $from.marks();\n}\n\n/**\n * Arms the painter, capturing the current formatting. Returns a transaction to\n * dispatch, or null when there is nothing to copy.\n */\nexport function armFormatPainter(state: EditorState): Transaction | null {\n const marks = capturedMarks(state);\n return state.tr.setMeta(formatPainterKey, { type: 'arm', marks } as PainterMeta);\n}\n\n/** Disarms the painter without applying. */\nexport function disarmFormatPainter(state: EditorState): Transaction {\n return state.tr.setMeta(formatPainterKey, { type: 'disarm' } as PainterMeta);\n}\n\n/**\n * Applies the copied formatting to the current (non-empty) selection and\n * disarms. Returns null when not armed or the selection is empty.\n */\nexport function applyFormatPainter(state: EditorState): Transaction | null {\n const painter = formatPainterKey.getState(state);\n if (!painter?.marks) return null;\n const { from, to, empty } = state.selection;\n if (empty) return null;\n const tr = state.tr;\n tr.removeMark(from, to, null);\n for (const mark of painter.marks) tr.addMark(from, to, mark);\n tr.setMeta(formatPainterKey, { type: 'disarm' } as PainterMeta);\n return tr;\n}\n"],"names":["formatPainterPlugin","Plugin","key","formatPainterKey","state","init","marks","apply","tr","value","meta","getMeta","type","props","attributes","getState","class","isFormatPainterArmed","armFormatPainter","_n$selection","selection","$from","empty","storedMarks","marksAcross","$to","capturedMarks","setMeta","disarmFormatPainter","applyFormatPainter","painter","_n$selection2","from","to","removeMark","_iterator","_createForOfIteratorHelper","s","_step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,CAAAA,KAAAA,CAAAA,KAAAA,CAAuBjC,CAAAA,CAAGkC,QAAQV,CAAMC,CAAAA,CAAAA,CAAIQ,KAEvD,OAAAE,GAAA,EAAAR,SAAA,CAAAS,CAAA,CAAAD,GAAA,WAAAR,SAAA,CAAAU,CAAA,UADArC,CAAAA,CAAAA,CAAGmB,QAAQxB,CAAkB,CAAA,CAAES,KAAM,QAC9BJ,CAAAA,CAAAA,CAAAA,CACT,8IAlEaL,EAAmB,GAAI2C,CAAAA,CAAAA,CAA8B"}
@@ -0,0 +1 @@
1
+ import{P as n,b as t}from"../../../index-6f3fa4ab.esm.js";const r=new n("nileFormatPainter");function s(){return new t({key:r,state:{init:()=>({marks:null}),apply(n,t){const s=n.getMeta(r);return"arm"===s?.type?{marks:s.marks}:"disarm"===s?.type?{marks:null}:t}},props:{attributes:n=>r.getState(n)?.marks?{class:"nile-wysiwyg--painting"}:{}}})}function a(n){return!!r.getState(n)?.marks}function e(n){const t=function(n){const{$from:t,empty:r}=n.selection;return r?n.storedMarks??t.marks():t.marksAcross(n.selection.$to)??t.marks()}(n);return n.tr.setMeta(r,{type:"arm",marks:t})}function o(n){return n.tr.setMeta(r,{type:"disarm"})}function i(n){const t=r.getState(n);if(!t?.marks)return null;const{from:s,to:a,empty:e}=n.selection;if(e)return null;const o=n.tr;o.removeMark(s,a,null);for(const n of t.marks)o.addMark(s,a,n);return o.setMeta(r,{type:"disarm"}),o}export{i as a,e as b,o as d,s as f,a as i};
@@ -0,0 +1,2 @@
1
+ System.register(["../../../index-89c520e9.cjs.js"],function(_export,_context){"use strict";var i,e,n;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function t(i,t,s){var e=arguments.length>3&&arguments[3]!==undefined?arguments[3]:40;var _loop=function _loop(){var n=_arr[_i];var h=document.createElement("span");h.className="nile-wysiwyg__resize-handle nile-wysiwyg__resize-handle--".concat(n),h.dataset.resizeHandle=n,h.contentEditable="false",h.addEventListener("mousedown",function(h){var _i$closest$getBoundin,_i$closest;h.preventDefault(),h.stopPropagation();var o=h.clientX,r=t.getBoundingClientRect().width,a=n.includes("w")?-1:1,w=(_i$closest$getBoundin=(_i$closest=i.closest(".ProseMirror"))===null||_i$closest===void 0?void 0:_i$closest.getBoundingClientRect().width)!==null&&_i$closest$getBoundin!==void 0?_i$closest$getBoundin:2e3;var l=r;var c=function c(i){l=Math.max(e,Math.min(w,r+a*(i.clientX-o))),t.style.width="".concat(Math.round(l),"px");},_d=function d(){window.removeEventListener("mousemove",c),window.removeEventListener("mouseup",_d),i.classList.remove("nile-wysiwyg__resizing"),s(Math.round(l));};i.classList.add("nile-wysiwyg__resizing"),window.addEventListener("mousemove",c),window.addEventListener("mouseup",_d);}),i.appendChild(h);};for(var _i=0,_arr=["nw","ne","sw","se"];_i<_arr.length;_i++){_loop();}}function s(i){return i.target instanceof HTMLElement&&!!i.target.dataset.resizeHandle;}_export({a:t,i:s});return{setters:[function(_index00aCjsJs){i=_index00aCjsJs.c;}],execute:function execute(){_export("I",e=/*#__PURE__*/function(){function e(i,s,_e){_classCallCheck(this,e);this.node=i,this.dom=document.createElement("span"),this.dom.className="nile-wysiwyg__image-resizer",this.img=document.createElement("img"),this.applyAttrs(i),this.dom.appendChild(this.img),t(this.dom,this.img,function(i){var t=_e();if(void 0===t||!s.editable)return;var n=s.state.doc.nodeAt(t);n&&s.dispatch(s.state.tr.setNodeMarkup(t,void 0,_objectSpread(_objectSpread({},n.attrs),{},{width:i})));});}return _createClass(e,[{key:"applyAttrs",value:function applyAttrs(i){var _i$attrs=i.attrs,t=_i$attrs.src,s=_i$attrs.alt,_e2=_i$attrs.title,n=_i$attrs.width;this.img.src=t,s?this.img.alt=s:this.img.removeAttribute("alt"),_e2?this.img.title=_e2:this.img.removeAttribute("title"),this.img.style.width=n?"".concat(n,"px"):"";}},{key:"update",value:function update(i){return i.type===this.node.type&&(this.node=i,this.applyAttrs(i),!0);}},{key:"selectNode",value:function selectNode(){this.dom.classList.add("nile-wysiwyg__image-resizer--selected");}},{key:"deselectNode",value:function deselectNode(){this.dom.classList.remove("nile-wysiwyg__image-resizer--selected");}},{key:"stopEvent",value:function stopEvent(i){return s(i);}},{key:"ignoreMutation",value:function ignoreMutation(){return!0;}}]);}());_export("F",n=/*#__PURE__*/function(){function n(s,e,_n){_classCallCheck(this,n);this.node=s,this.dom=document.createElement("figure"),this.dom.className="nile-wysiwyg__figure",this.wrapper=document.createElement("span"),this.wrapper.className="nile-wysiwyg__image-resizer",this.wrapper.contentEditable="false",this.img=document.createElement("img"),this.wrapper.appendChild(this.img),this.contentDOM=document.createElement("figcaption"),this.contentDOM.className="nile-wysiwyg__figcaption",this.dom.append(this.wrapper,this.contentDOM),this.applyAttrs(s),this.img.addEventListener("mousedown",function(t){t.preventDefault();var s=_n();void 0!==s&&(e.dispatch(e.state.tr.setSelection(i.create(e.state.doc,s))),e.focus());}),t(this.wrapper,this.img,function(i){var t=_n();if(void 0===t||!e.editable)return;var s=e.state.doc.nodeAt(t);s&&e.dispatch(e.state.tr.setNodeMarkup(t,void 0,_objectSpread(_objectSpread({},s.attrs),{},{width:i})));});}return _createClass(n,[{key:"applyAttrs",value:function applyAttrs(i){var _i$attrs2=i.attrs,t=_i$attrs2.src,s=_i$attrs2.alt,e=_i$attrs2.title,_n2=_i$attrs2.width,h=_i$attrs2.align;this.img.src=t,s?this.img.alt=s:this.img.removeAttribute("alt"),e?this.img.title=e:this.img.removeAttribute("title"),this.dom.style.width=_n2?"".concat(_n2,"px"):"",h?this.dom.setAttribute("data-align",h):this.dom.removeAttribute("data-align"),this.dom.classList.toggle("nile-wysiwyg__figure--empty-caption",0===i.content.size);}},{key:"update",value:function update(i){return i.type===this.node.type&&(this.node=i,this.applyAttrs(i),!0);}},{key:"selectNode",value:function selectNode(){this.dom.classList.add("nile-wysiwyg__figure--selected"),this.wrapper.classList.add("nile-wysiwyg__image-resizer--selected");}},{key:"deselectNode",value:function deselectNode(){this.dom.classList.remove("nile-wysiwyg__figure--selected"),this.wrapper.classList.remove("nile-wysiwyg__image-resizer--selected");}},{key:"stopEvent",value:function stopEvent(i){return s(i);}},{key:"ignoreMutation",value:function ignoreMutation(i){return!this.contentDOM.contains(i.target);}}]);}());}};});
2
+ //# sourceMappingURL=image-view.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-view.cjs.js","sources":["../../../../../src/nile-wysiwyg-editor/engine/plugins/image-view.ts"],"sourcesContent":["import { Node as PMNode } from 'prosemirror-model';\nimport { EditorView, NodeView } from 'prosemirror-view';\nimport { NodeSelection } from 'prosemirror-state';\n\nconst MIN_WIDTH = 40;\n\n/**\n * Attaches four corner drag-handles to a wrapper and returns a cleanup\n * function. Dragging previews by mutating the target's style; on release the\n * final width is committed through onCommit (one transaction).\n */\nexport function attachResizeHandles(\n wrapper: HTMLElement,\n img: HTMLElement,\n onCommit: (width: number) => void,\n minWidth: number = MIN_WIDTH\n): void {\n for (const corner of ['nw', 'ne', 'sw', 'se']) {\n const handle = document.createElement('span');\n handle.className = `nile-wysiwyg__resize-handle nile-wysiwyg__resize-handle--${corner}`;\n handle.dataset.resizeHandle = corner;\n handle.contentEditable = 'false';\n handle.addEventListener('mousedown', event => {\n event.preventDefault();\n event.stopPropagation();\n const startX = event.clientX;\n const startWidth = img.getBoundingClientRect().width;\n const sign = corner.includes('w') ? -1 : 1;\n const maxWidth =\n wrapper.closest('.ProseMirror')?.getBoundingClientRect().width ?? 2000;\n let width = startWidth;\n const onMove = (move: MouseEvent): void => {\n width = Math.max(\n minWidth,\n Math.min(maxWidth, startWidth + sign * (move.clientX - startX))\n );\n img.style.width = `${Math.round(width)}px`;\n };\n const onUp = (): void => {\n window.removeEventListener('mousemove', onMove);\n window.removeEventListener('mouseup', onUp);\n wrapper.classList.remove('nile-wysiwyg__resizing');\n onCommit(Math.round(width));\n };\n // While dragging, iframes inside the wrapper must not swallow mouse\n // events (they are separate documents); CSS keys off this class.\n wrapper.classList.add('nile-wysiwyg__resizing');\n window.addEventListener('mousemove', onMove);\n window.addEventListener('mouseup', onUp);\n });\n wrapper.appendChild(handle);\n }\n}\n\nexport function isResizeEvent(event: Event): boolean {\n return (\n event.target instanceof HTMLElement && !!event.target.dataset.resizeHandle\n );\n}\n\n/** Inline image with drag-resize handles shown while selected. */\nexport class ImageView implements NodeView {\n dom: HTMLSpanElement;\n\n private img: HTMLImageElement;\n\n constructor(\n private node: PMNode,\n view: EditorView,\n getPos: () => number | undefined\n ) {\n this.dom = document.createElement('span');\n this.dom.className = 'nile-wysiwyg__image-resizer';\n this.img = document.createElement('img');\n this.applyAttrs(node);\n this.dom.appendChild(this.img);\n attachResizeHandles(this.dom, this.img, width => {\n const pos = getPos();\n if (pos === undefined || !view.editable) return;\n const current = view.state.doc.nodeAt(pos);\n if (!current) return;\n view.dispatch(\n view.state.tr.setNodeMarkup(pos, undefined, { ...current.attrs, width })\n );\n });\n }\n\n private applyAttrs(node: PMNode): void {\n const { src, alt, title, width } = node.attrs;\n this.img.src = src;\n if (alt) this.img.alt = alt;\n else this.img.removeAttribute('alt');\n if (title) this.img.title = title;\n else this.img.removeAttribute('title');\n this.img.style.width = width ? `${width}px` : '';\n }\n\n update(node: PMNode): boolean {\n if (node.type !== this.node.type) return false;\n this.node = node;\n this.applyAttrs(node);\n return true;\n }\n\n selectNode(): void {\n this.dom.classList.add('nile-wysiwyg__image-resizer--selected');\n }\n\n deselectNode(): void {\n this.dom.classList.remove('nile-wysiwyg__image-resizer--selected');\n }\n\n stopEvent(event: Event): boolean {\n return isResizeEvent(event);\n }\n\n ignoreMutation(): boolean {\n return true;\n }\n}\n\n/**\n * Captioned figure: non-editable image (with resize handles) above an\n * editable figcaption (the node's content). Clicking the image selects the\n * whole figure.\n */\nexport class FigureView implements NodeView {\n dom: HTMLElement;\n\n contentDOM: HTMLElement;\n\n private img: HTMLImageElement;\n\n private wrapper: HTMLSpanElement;\n\n constructor(\n private node: PMNode,\n view: EditorView,\n getPos: () => number | undefined\n ) {\n this.dom = document.createElement('figure');\n this.dom.className = 'nile-wysiwyg__figure';\n\n this.wrapper = document.createElement('span');\n this.wrapper.className = 'nile-wysiwyg__image-resizer';\n this.wrapper.contentEditable = 'false';\n this.img = document.createElement('img');\n this.wrapper.appendChild(this.img);\n\n this.contentDOM = document.createElement('figcaption');\n this.contentDOM.className = 'nile-wysiwyg__figcaption';\n\n this.dom.append(this.wrapper, this.contentDOM);\n this.applyAttrs(node);\n\n // Clicking the image selects the figure node (instead of dropping the\n // cursor into the caption).\n this.img.addEventListener('mousedown', event => {\n event.preventDefault();\n const pos = getPos();\n if (pos === undefined) return;\n view.dispatch(\n view.state.tr.setSelection(NodeSelection.create(view.state.doc, pos))\n );\n view.focus();\n });\n\n attachResizeHandles(this.wrapper, this.img, width => {\n const pos = getPos();\n if (pos === undefined || !view.editable) return;\n const current = view.state.doc.nodeAt(pos);\n if (!current) return;\n view.dispatch(\n view.state.tr.setNodeMarkup(pos, undefined, { ...current.attrs, width })\n );\n });\n }\n\n private applyAttrs(node: PMNode): void {\n const { src, alt, title, width, align } = node.attrs;\n this.img.src = src;\n if (alt) this.img.alt = alt;\n else this.img.removeAttribute('alt');\n if (title) this.img.title = title;\n else this.img.removeAttribute('title');\n this.dom.style.width = width ? `${width}px` : '';\n if (align) this.dom.setAttribute('data-align', align);\n else this.dom.removeAttribute('data-align');\n this.dom.classList.toggle(\n 'nile-wysiwyg__figure--empty-caption',\n node.content.size === 0\n );\n }\n\n update(node: PMNode): boolean {\n if (node.type !== this.node.type) return false;\n this.node = node;\n this.applyAttrs(node);\n return true;\n }\n\n selectNode(): void {\n this.dom.classList.add('nile-wysiwyg__figure--selected');\n this.wrapper.classList.add('nile-wysiwyg__image-resizer--selected');\n }\n\n deselectNode(): void {\n this.dom.classList.remove('nile-wysiwyg__figure--selected');\n this.wrapper.classList.remove('nile-wysiwyg__image-resizer--selected');\n }\n\n stopEvent(event: Event): boolean {\n return isResizeEvent(event);\n }\n\n ignoreMutation(mutation: MutationRecord): boolean {\n // Caption edits must flow through; image/handle mutations must not.\n return !this.contentDOM.contains(mutation.target);\n }\n}\n"],"names":["attachResizeHandles","wrapper","img","onCommit","minWidth","arguments","length","undefined","_loop","corner","_arr","_i","handle","document","createElement","className","concat","dataset","resizeHandle","contentEditable","addEventListener","event","preventDefault","stopPropagation","startX","clientX","startWidth","getBoundingClientRect","width","sign","includes","maxWidth","closest","_i$closest$getBoundin","onMove","move","Math","max","min","style","round","onUp","d","window","removeEventListener","classList","remove","add","appendChild","isResizeEvent","target","HTMLElement","ImageView","e","node","view","getPos","this","dom","applyAttrs","pos","editable","current","state","doc","nodeAt","dispatch","tr","setNodeMarkup","attrs","i","_createClass","key","value","_i$attrs","src","alt","title","removeAttribute","update","type","selectNode","deselectNode","stopEvent","ignoreMutation","FigureView","n","contentDOM","append","setSelection","NodeSelection","create","focus","_objectSpread","_i$attrs2","align","setAttribute","toggle","content","size","mutation","contains"],"mappings":"67DAWM,QAAUA,CAAAA,CACdC,CAAAA,CAAAA,CACAC,CACAC,CAAAA,CAAAA,CAVgB,IAWhBC,CAAAA,CAXgB,CAAAC,SAAA,CAAAC,MAAA,IAAAD,SAAA,MAAAE,SAAA,CAAAF,SAAA,IAAA,EAAA,KAAAG,KAAA,UAAAA,MAAA,CAa+B,CAA1C,GAAMC,CAAAA,CAAU,CAAAC,IAAA,CAAAC,EAAA,EACnB,GAAMC,CAAAA,CAAAA,CAASC,QAASC,CAAAA,aAAAA,CAAc,MACtCF,CAAAA,CAAAA,CAAAA,CAAOG,SAAY,6DAAAC,MAAA,CAA4DP,CAC/EG,CAAAA,CAAAA,CAAAA,CAAOK,OAAQC,CAAAA,YAAAA,CAAeT,EAC9BG,CAAOO,CAAAA,eAAAA,CAAkB,OACzBP,CAAAA,CAAAA,CAAOQ,gBAAiB,CAAA,WAAA,CAAaC,SAAAA,CACnCA,CAAAA,KAAAA,qBAAAA,CAAAA,UAAAA,CAAAA,CAAAA,CAAMC,cACND,CAAAA,CAAAA,CAAAA,CAAAA,CAAME,eACN,CAAA,CAAA,CAAA,GAAMC,CAAAA,CAASH,CAAAA,CAAAA,CAAMI,OACfC,CAAAA,CAAAA,CAAaxB,EAAIyB,qBAAwBC,CAAAA,CAAAA,CAAAA,KAAAA,CACzCC,CAAOpB,CAAA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,IAAAA,CAAK0B,OAC5BvB,IAAKH,CAAAA,IAAAA,CAAOA,CACZG,CAAAA,IAAAA,CAAKE,UAAWL,CAAAA,CAAAA,CAAAA,CAAAA,CACT,CACR,CAAA,EAED,GAAAkB,GAAA,cAAAC,KAAA,UAAAQ,UAAAA,CAAAA,CACExB,CAAAA,IAAAA,CAAKC,GAAIb,CAAAA,SAAAA,CAAUE,GAAI,CAAA,gCAAA,CAAA,CACvBU,IAAKxD,CAAAA,OAAAA,CAAQ4C,UAAUE,GAAI,CAAA,uCAAA,CAC5B,EAED,GAAAyB,GAAA,gBAAAC,KAAA,UAAAS,YAAAA,CAAAA,CACEzB,CAAAA,IAAAA,CAAKC,GAAIb,CAAAA,SAAAA,CAAUC,MAAO,CAAA,gCAAA,CAAA,CAC1BW,IAAKxD,CAAAA,OAAAA,CAAQ4C,SAAUC,CAAAA,MAAAA,CAAO,uCAC/B,CAAA,EAED,GAAA0B,GAAA,aAAAC,KAAA,UAAAU,SAAAA,CAAU9D,CAAAA,CAAAA,CACR,MAAO4B,CAAAA,CAAAA,CAAc5B,CACtB,CAAA,EAED,GAAAmD,GAAA,kBAAAC,KAAA,UAAAW,cAAAA,CAAegB,GAEb,MAAQ3C,CAAAA,IAAAA,CAAK8B,UAAWc,CAAAA,QAAAA,CAASD,CAASlD,CAAAA,MAAAA,CAC3C"}
@@ -0,0 +1 @@
1
+ import{c as i}from"../../../index-6f3fa4ab.esm.js";function t(i,t,s,e=40){for(const n of["nw","ne","sw","se"]){const h=document.createElement("span");h.className=`nile-wysiwyg__resize-handle nile-wysiwyg__resize-handle--${n}`,h.dataset.resizeHandle=n,h.contentEditable="false",h.addEventListener("mousedown",(h=>{h.preventDefault(),h.stopPropagation();const o=h.clientX,r=t.getBoundingClientRect().width,a=n.includes("w")?-1:1,w=i.closest(".ProseMirror")?.getBoundingClientRect().width??2e3;let l=r;const c=i=>{l=Math.max(e,Math.min(w,r+a*(i.clientX-o))),t.style.width=`${Math.round(l)}px`},d=()=>{window.removeEventListener("mousemove",c),window.removeEventListener("mouseup",d),i.classList.remove("nile-wysiwyg__resizing"),s(Math.round(l))};i.classList.add("nile-wysiwyg__resizing"),window.addEventListener("mousemove",c),window.addEventListener("mouseup",d)})),i.appendChild(h)}}function s(i){return i.target instanceof HTMLElement&&!!i.target.dataset.resizeHandle}class e{constructor(i,s,e){this.node=i,this.dom=document.createElement("span"),this.dom.className="nile-wysiwyg__image-resizer",this.img=document.createElement("img"),this.applyAttrs(i),this.dom.appendChild(this.img),t(this.dom,this.img,(i=>{const t=e();if(void 0===t||!s.editable)return;const n=s.state.doc.nodeAt(t);n&&s.dispatch(s.state.tr.setNodeMarkup(t,void 0,{...n.attrs,width:i}))}))}applyAttrs(i){const{src:t,alt:s,title:e,width:n}=i.attrs;this.img.src=t,s?this.img.alt=s:this.img.removeAttribute("alt"),e?this.img.title=e:this.img.removeAttribute("title"),this.img.style.width=n?`${n}px`:""}update(i){return i.type===this.node.type&&(this.node=i,this.applyAttrs(i),!0)}selectNode(){this.dom.classList.add("nile-wysiwyg__image-resizer--selected")}deselectNode(){this.dom.classList.remove("nile-wysiwyg__image-resizer--selected")}stopEvent(i){return s(i)}ignoreMutation(){return!0}}class n{constructor(s,e,n){this.node=s,this.dom=document.createElement("figure"),this.dom.className="nile-wysiwyg__figure",this.wrapper=document.createElement("span"),this.wrapper.className="nile-wysiwyg__image-resizer",this.wrapper.contentEditable="false",this.img=document.createElement("img"),this.wrapper.appendChild(this.img),this.contentDOM=document.createElement("figcaption"),this.contentDOM.className="nile-wysiwyg__figcaption",this.dom.append(this.wrapper,this.contentDOM),this.applyAttrs(s),this.img.addEventListener("mousedown",(t=>{t.preventDefault();const s=n();void 0!==s&&(e.dispatch(e.state.tr.setSelection(i.create(e.state.doc,s))),e.focus())})),t(this.wrapper,this.img,(i=>{const t=n();if(void 0===t||!e.editable)return;const s=e.state.doc.nodeAt(t);s&&e.dispatch(e.state.tr.setNodeMarkup(t,void 0,{...s.attrs,width:i}))}))}applyAttrs(i){const{src:t,alt:s,title:e,width:n,align:h}=i.attrs;this.img.src=t,s?this.img.alt=s:this.img.removeAttribute("alt"),e?this.img.title=e:this.img.removeAttribute("title"),this.dom.style.width=n?`${n}px`:"",h?this.dom.setAttribute("data-align",h):this.dom.removeAttribute("data-align"),this.dom.classList.toggle("nile-wysiwyg__figure--empty-caption",0===i.content.size)}update(i){return i.type===this.node.type&&(this.node=i,this.applyAttrs(i),!0)}selectNode(){this.dom.classList.add("nile-wysiwyg__figure--selected"),this.wrapper.classList.add("nile-wysiwyg__image-resizer--selected")}deselectNode(){this.dom.classList.remove("nile-wysiwyg__figure--selected"),this.wrapper.classList.remove("nile-wysiwyg__image-resizer--selected")}stopEvent(i){return s(i)}ignoreMutation(i){return!this.contentDOM.contains(i.target)}}export{n as F,e as I,t as a,s as i};
@@ -0,0 +1,2 @@
1
+ System.register(["../../../index-89c520e9.cjs.js","../../../index-cc1385e0.cjs.js"],function(_export,_context){"use strict";var n,o,t,e,a;function r(n){return n?Array.from(n.files).filter(function(n){return n.type.startsWith("image/");}):[];}function i(){var n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return new o({key:a,state:{init:function init(){return t.empty;},apply:function apply(n,o){var t=o.map(n.mapping,n.doc);var r=n.getMeta(a);if(r!==null&&r!==void 0&&r.add){var _o=document.createElement("span");_o.className="nile-wysiwyg__upload-placeholder",_o.textContent="Uploading image…",t=t.add(n.doc,[e.widget(r.add.pos,_o,{id:r.add.id})]);}return r!==null&&r!==void 0&&r.remove&&(t=t.remove(t.find(void 0,void 0,function(n){return n.id===r.remove.id;}))),t;}},props:{decorations:function decorations(n){return a.getState(n);},handlePaste:function handlePaste(o,t){var e=r(t.clipboardData);return!(0===e.length||!n.onImageFiles)&&(n.onImageFiles(e,null),!0);},handleDrop:function handleDrop(o,t){var e=r(t.dataTransfer);if(0===e.length||!n.onImageFiles)return!1;var a=o.posAtCoords({left:t.clientX,top:t.clientY});return n.onImageFiles(e,a?a.pos:null),!0;}}});}function s(n,o){var t=a.getState(n),e=t===null||t===void 0?void 0:t.find(void 0,void 0,function(n){return n.id===o;});return e&&e.length?e[0].from:null;}_export({f:s,i:i});return{setters:[function(_index00aCjsJs){n=_index00aCjsJs.P;o=_index00aCjsJs.b;},function(_index009CjsJs){t=_index009CjsJs.D;e=_index009CjsJs.a;}],execute:function execute(){_export("a",a=new n("nileImageUpload"));}};});
2
+ //# sourceMappingURL=image.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image.cjs.js","sources":["../../../../../src/nile-wysiwyg-editor/engine/plugins/image.ts"],"sourcesContent":["import { Plugin, PluginKey, EditorState } from 'prosemirror-state';\nimport { Decoration, DecorationSet } from 'prosemirror-view';\n\nexport const imageUploadKey = new PluginKey<DecorationSet>('nileImageUpload');\n\ninterface UploadMeta {\n add?: { id: string; pos: number };\n remove?: { id: string };\n}\n\nexport interface ImagePluginOptions {\n /** Called with image files pasted or dropped into the editor. */\n onImageFiles?: (files: File[], pos: number | null) => void;\n}\n\nfunction imageFilesFrom(data: DataTransfer | null): File[] {\n if (!data) return [];\n return Array.from(data.files).filter(file => file.type.startsWith('image/'));\n}\n\n/**\n * Image behaviors: routes pasted/dropped image files to the host's upload\n * flow and tracks \"uploading…\" widget decorations that survive concurrent\n * edits by mapping through transactions.\n */\nexport function imagePlugin(options: ImagePluginOptions = {}): Plugin<DecorationSet> {\n return new Plugin<DecorationSet>({\n key: imageUploadKey,\n\n state: {\n init: () => DecorationSet.empty,\n apply(tr, set) {\n let mapped = set.map(tr.mapping, tr.doc);\n const meta = tr.getMeta(imageUploadKey) as UploadMeta | undefined;\n if (meta?.add) {\n const widget = document.createElement('span');\n widget.className = 'nile-wysiwyg__upload-placeholder';\n widget.textContent = 'Uploading image…';\n mapped = mapped.add(tr.doc, [\n Decoration.widget(meta.add.pos, widget, { id: meta.add.id }),\n ]);\n }\n if (meta?.remove) {\n mapped = mapped.remove(\n mapped.find(undefined, undefined, spec => spec.id === meta.remove!.id)\n );\n }\n return mapped;\n },\n },\n\n props: {\n decorations(state) {\n return imageUploadKey.getState(state);\n },\n\n handlePaste(_view, event) {\n const files = imageFilesFrom(event.clipboardData);\n if (files.length === 0 || !options.onImageFiles) return false;\n options.onImageFiles(files, null);\n return true;\n },\n\n handleDrop(view, event) {\n const files = imageFilesFrom(event.dataTransfer);\n if (files.length === 0 || !options.onImageFiles) return false;\n const drop = view.posAtCoords({ left: event.clientX, top: event.clientY });\n options.onImageFiles(files, drop ? drop.pos : null);\n return true;\n },\n },\n });\n}\n\n/** Position of an upload placeholder, after mapping through edits. */\nexport function findUploadPos(state: EditorState, id: string): number | null {\n const set = imageUploadKey.getState(state);\n const found = set?.find(undefined, undefined, spec => spec.id === id);\n return found && found.length ? found[0].from : null;\n}\n"],"names":["imageFilesFrom","data","Array","from","files","filter","file","type","startsWith","imagePlugin","options","Plugin","key","imageUploadKey","state","init","DecorationSet","empty","apply","tr","set","mapped","map","mapping","doc","meta","getMeta","add","widget","document","createElement","className","textContent","Decoration","pos","id","remove","find","undefined","spec","props","decorations","getState","handlePaste","_view","event","clipboardData","length","onImageFiles","handleDrop","view","dataTransfer","drop","posAtCoords","left","clientX","top","clientY","findUploadPos","found","PluginKey"],"mappings":"0IAeA,QAASA,CAAAA,EAAeC,CACtB,CAAA,CAAA,MAAKA,CAAAA,EACEC,KAAMC,CAAAA,IAAAA,CAAKF,EAAKG,KAAOC,CAAAA,CAAAA,MAAAA,CAAOC,SAAAA,CAAQA,QAAAA,CAAAA,CAAAA,CAAKC,IAAKC,CAAAA,UAAAA,CAAW,aADhD,EAEpB,EAOgB,QAAAC,CAAAA,CAAYC,CAAAA,CAC1B,IAD0BA,CAAAA,CAAAA,CAAAA,SAAAA,CAAAA,MAAAA,IAAAA,SAAAA,MAAAA,SAAAA,CAAAA,SAAAA,IAA8B,EACxD,CAAA,MAAO,IAAIC,CAAAA,CAAAA,CAAsB,CAC/BC,GAAAA,CAAKC,EAELC,KAAO,CAAA,CACLC,KAAM,QAANA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
@@ -0,0 +1 @@
1
+ import{P as n,b as e}from"../../../index-6f3fa4ab.esm.js";import{D as o,a as t}from"../../../index-353172ed.esm.js";const a=new n("nileImageUpload");function r(n){return n?Array.from(n.files).filter((n=>n.type.startsWith("image/"))):[]}function i(n={}){return new e({key:a,state:{init:()=>o.empty,apply(n,e){let o=e.map(n.mapping,n.doc);const r=n.getMeta(a);if(r?.add){const e=document.createElement("span");e.className="nile-wysiwyg__upload-placeholder",e.textContent="Uploading image…",o=o.add(n.doc,[t.widget(r.add.pos,e,{id:r.add.id})])}return r?.remove&&(o=o.remove(o.find(void 0,void 0,(n=>n.id===r.remove.id)))),o}},props:{decorations:n=>a.getState(n),handlePaste(e,o){const t=r(o.clipboardData);return!(0===t.length||!n.onImageFiles)&&(n.onImageFiles(t,null),!0)},handleDrop(e,o){const t=r(o.dataTransfer);if(0===t.length||!n.onImageFiles)return!1;const a=e.posAtCoords({left:o.clientX,top:o.clientY});return n.onImageFiles(t,a?a.pos:null),!0}}})}function s(n,e){const o=a.getState(n),t=o?.find(void 0,void 0,(n=>n.id===e));return t&&t.length?t[0].from:null}export{a,s as f,i};
@@ -0,0 +1,2 @@
1
+ System.register(["../../../index-89c520e9.cjs.js","../sanitize.cjs.js","./embeds.cjs.js"],function(_export,_context){"use strict";var r,t,e;function n(){var n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return new r({props:{handleClick:function handleClick(r,e,s){var _s$target,_s$target$closest;if(!s.metaKey&&!s.ctrlKey)return!1;var o=(_s$target=s.target)===null||_s$target===void 0||(_s$target$closest=_s$target.closest)===null||_s$target$closest===void 0?void 0:_s$target$closest.call(_s$target,"a[href]");if(!o)return!1;var i=o.getAttribute("href");return!!t(i)&&(n.onOpenLink?n.onOpenLink(i):window.open(i,"_blank","noopener,noreferrer"),!0);},handlePaste:function handlePaste(r,n){var _n$clipboardData;var s=r.state,_s$selection=s.selection,o=_s$selection.empty,i=_s$selection.from,a=_s$selection.to;if(o)return!1;var f=(_n$clipboardData=n.clipboardData)===null||_n$clipboardData===void 0||(_n$clipboardData=_n$clipboardData.getData("text/plain"))===null||_n$clipboardData===void 0?void 0:_n$clipboardData.trim();if(!f||!e.test(f)||!t(f))return!1;var c=s.schema.marks.link.create({href:f});return r.dispatch(s.tr.addMark(i,a,c)),!0;}}});}_export("l",n);return{setters:[function(_index00aCjsJs){r=_index00aCjsJs.b;},function(_sanitizeCjsJs){t=_sanitizeCjsJs.i;},function(_embedsCjsJs){}],execute:function execute(){e=/^https?:\/\/\S+$/i;}};});
2
+ //# sourceMappingURL=link.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link.cjs.js","sources":["../../../../../src/nile-wysiwyg-editor/engine/plugins/link.ts"],"sourcesContent":["import { Plugin } from 'prosemirror-state';\nimport { isSafeUrl } from '../sanitize';\n\nconst URL_PATTERN = /^https?:\\/\\/\\S+$/i;\n\nexport interface LinkPluginOptions {\n /** Called with the href when a link is Mod/Ctrl-clicked. */\n onOpenLink?: (href: string) => void;\n}\n\n/**\n * Link behaviors that belong to the document, not the chrome:\n * - Mod/Ctrl-click opens the link.\n * - Pasting a bare URL over a text selection turns the selection into a link.\n */\nexport function linkPlugin(options: LinkPluginOptions = {}): Plugin {\n return new Plugin({\n props: {\n handleClick(view, _pos, event) {\n if (!(event.metaKey || event.ctrlKey)) return false;\n const target = (event.target as HTMLElement | null)?.closest?.('a[href]');\n if (!target) return false;\n const href = target.getAttribute('href')!;\n if (!isSafeUrl(href)) return false;\n if (options.onOpenLink) options.onOpenLink(href);\n else window.open(href, '_blank', 'noopener,noreferrer');\n return true;\n },\n\n handlePaste(view, event) {\n const { state } = view;\n const { empty, from, to } = state.selection;\n if (empty) return false;\n const text = event.clipboardData?.getData('text/plain')?.trim();\n if (!text || !URL_PATTERN.test(text) || !isSafeUrl(text)) return false;\n const linkMark = state.schema.marks.link.create({ href: text });\n view.dispatch(state.tr.addMark(from, to, linkMark));\n return true;\n },\n },\n });\n}\n"],"names":["linkPlugin","options","arguments","length","undefined","Plugin","props","handleClick","view","_pos","event","_s$target","_s$target$closest","metaKey","ctrlKey","target","closest","href","getAttribute","isSafeUrl","onOpenLink","window","open","handlePaste","_n$clipboardData","state","empty","selection","from","to","text","clipboardData","getData","trim","URL_PATTERN","test","linkMark","schema","marks","link","create","dispatch","tr","addMark"],"mappings":"4IAegB,QAAAA,CAAAA,CAAAA,CAAAA,CACd,IADyBC,CAAAA,CAA6B,CAAAC,SAAA,CAAAC,MAAA,IAAAD,SAAA,MAAAE,SAAA,CAAAF,SAAA,IAAA,EACtD,CAAA,MAAO,IAAIG,CAAAA,CAAO,CAAA,CAChBC,KAAO,CAAA,CACLC,WAAAA,SAAA,CAAAA,WAAAA,CAAYC,CAAMC,CAAAA,CAAAA,CAAMC,CACtB,CAAA,KAAAC,SAAA,CAAAC,iBAAA,CAAA,GAAA,CAAMF,CAAMG,CAAAA,OAAAA,EAAAA,CAAWH,CAAMI,CAAAA,OAAAA,CAAU,OAAO,CAC9C,CAAA,GAAMC,CAAAA,CAAUL,EAAAA,SAAAA,CAAAA,CAAAA,CAAMK,MAA+BC,UAAAA,SAAAA,YAAAA,iBAAAA,CAArCN,SAAAA,CAAqCM,OAAAA,UAAAA,iBAAAA,iBAArCN,iBAAAA,CAAAA,IAAAA,CAAAA,SAAAA,CAA+C,SAC/D,CAAA,CAAA,GAAA,CAAKK,CAAQ,CAAA,MAAA,CAAO,CACpB,CAAA,GAAME,CAAAA,CAAOF,CAAAA,CAAAA,CAAOG,aAAa,MACjC,CAAA,CAAA,MAAA,CAAA,CAAKC,CAAUF,CAAAA,CAAAA,CAAAA,GACXhB,CAAQmB,CAAAA,UAAAA,CAAYnB,CAAQmB,CAAAA,UAAAA,CAAWH,CACtCI,CAAAA,CAAAA,MAAAA,CAAOC,IAAKL,CAAAA,CAAAA,CAAM,QAAU,CAAA,qBAAA,CAAA,CAAA,CAC1B,EACR,EAED,CAAAM,WAAAA,SAAA,CAAAA,WAAAA,CAAYf,CAAAA,CAAME,CAChB,CAAA,KAAAc,gBAAA,CAAA,GAAQC,CAAAA,CAAAA,CAAUjB,CACZkB,CADAD,KAAEA,CAAAA,YAAAA,CACoBA,CAAME,CAAAA,SAAAA,CAA1BD,CAAKE,CAAAA,YAAAA,CAAPF,KAAAA,CAASE,CAAIC,CAAAA,YAAAA,CAAND,IAAAA,CAAQC,eAAFA,EAAAA,CACnB,GAAIH,CAAAA,CAAO,MAAO,CAAA,CAAA,CAClB,GAAMI,CAAAA,CAAAA,EAAAA,gBAAAA,CAAOpB,CAAMqB,CAAAA,aAAAA,UAAAA,gBAAAA,YAAAA,gBAAAA,CAANrB,gBAAAA,CAAqBsB,OAAQ,CAAA,YAAA,CAAA,UAAAR,gBAAA,iBAA7Bd,gBAAAA,CAA4CuB,IACzD,CAAA,CAAA,CAAA,GAAA,CAAKH,IAASI,CAAYC,CAAAA,IAAAA,CAAKL,CAAUX,CAAAA,EAAAA,CAAAA,CAAAA,CAAUW,CAAO,CAAA,CAAA,MAAA,CAAO,CACjE,CAAA,GAAMM,CAAAA,CAAWX,CAAAA,CAAAA,CAAMY,MAAOC,CAAAA,KAAAA,CAAMC,IAAKC,CAAAA,MAAAA,CAAO,CAAEvB,IAAAA,CAAMa,CAExD,CAAA,CAAA,CAAA,MADAtB,CAAAA,CAAKiC,CAAAA,QAAAA,CAAShB,CAAMiB,CAAAA,EAAAA,CAAGC,OAAQf,CAAAA,CAAAA,CAAMC,CAAIO,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAClC,CACR,EAAA,CAAA,CAAA,CAGP,kLAtCMF,CAAc,CAAA,mBAAA"}
@@ -0,0 +1 @@
1
+ import{b as e}from"../../../index-6f3fa4ab.esm.js";import{i as r}from"../sanitize.esm.js";import"./embeds.esm.js";const t=/^https?:\/\/\S+$/i;function n(n={}){return new e({props:{handleClick(e,t,s){if(!s.metaKey&&!s.ctrlKey)return!1;const o=s.target?.closest?.("a[href]");if(!o)return!1;const i=o.getAttribute("href");return!!r(i)&&(n.onOpenLink?n.onOpenLink(i):window.open(i,"_blank","noopener,noreferrer"),!0)},handlePaste(e,n){const{state:s}=e,{empty:o,from:i,to:a}=s.selection;if(o)return!1;const f=n.clipboardData?.getData("text/plain")?.trim();if(!f||!t.test(f)||!r(f))return!1;const m=s.schema.marks.link.create({href:f});return e.dispatch(s.tr.addMark(i,a,m)),!0}}})}export{n as l};
@@ -0,0 +1,2 @@
1
+ System.register([],function(_export,_context){"use strict";var t;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}return{setters:[],execute:function execute(){_export("M",t=/*#__PURE__*/function(){function t(_t,i){_classCallCheck(this,t);this.renderer=i,this.dom=document.createElement("span"),this.dom.contentEditable="false",this.render(_t);}return _createClass(t,[{key:"render",value:function render(_t2){var _t2$attrs$latex,_t2$attrs$display;var i=(_t2$attrs$latex=_t2.attrs.latex)!==null&&_t2$attrs$latex!==void 0?_t2$attrs$latex:"",s=(_t2$attrs$display=_t2.attrs.display)!==null&&_t2$attrs$display!==void 0?_t2$attrs$display:"inline";if(this.dom.className="block"===s?"nile-wysiwyg__math nile-wysiwyg__math--block":"nile-wysiwyg__math",this.dom.setAttribute("data-math",i),this.dom.setAttribute("data-math-display",s),this.dom.title=i,this.renderer)try{return void(this.dom.innerHTML=this.renderer(i,s));}catch(_unused){}this.dom.textContent=i;}},{key:"update",value:function update(_t3){return"math"===_t3.type.name&&(this.render(_t3),!0);}},{key:"ignoreMutation",value:function ignoreMutation(){return!0;}}]);}());}};});
2
+ //# sourceMappingURL=math-view.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"math-view.cjs.js","sources":["../../../../../src/nile-wysiwyg-editor/engine/plugins/math-view.ts"],"sourcesContent":["import { Node as PMNode } from 'prosemirror-model';\nimport { NodeView } from 'prosemirror-view';\n\n/** Turns a LaTeX string into HTML (KaTeX/MathJax/MathML). Host-provided. */\nexport type MathRenderer = (latex: string, display: 'inline' | 'block') => string;\n\n/**\n * Inline atom rendering a math formula. When the host supplies a renderer the\n * formula is drawn with it; otherwise the raw LaTeX is shown in a math chip so\n * the content is still visible and editable without a math engine.\n */\nexport class MathView implements NodeView {\n dom: HTMLSpanElement;\n\n private renderer?: MathRenderer;\n\n constructor(node: PMNode, renderer?: MathRenderer) {\n this.renderer = renderer;\n this.dom = document.createElement('span');\n this.dom.contentEditable = 'false';\n this.render(node);\n }\n\n private render(node: PMNode): void {\n const latex = (node.attrs.latex as string) ?? '';\n const display = (node.attrs.display as 'inline' | 'block') ?? 'inline';\n this.dom.className =\n display === 'block'\n ? 'nile-wysiwyg__math nile-wysiwyg__math--block'\n : 'nile-wysiwyg__math';\n this.dom.setAttribute('data-math', latex);\n this.dom.setAttribute('data-math-display', display);\n this.dom.title = latex;\n if (this.renderer) {\n try {\n // Host renderer output is trusted (same trust level as uploadHandler).\n this.dom.innerHTML = this.renderer(latex, display);\n return;\n } catch {\n // Fall back to raw LaTeX if the renderer throws.\n }\n }\n this.dom.textContent = latex;\n }\n\n update(node: PMNode): boolean {\n if (node.type.name !== 'math') return false;\n this.render(node);\n return true;\n }\n\n /** Atom node: ProseMirror owns selection; never read our subtree back. */\n ignoreMutation(): boolean {\n return true;\n }\n}\n"],"names":["MathView","t","node","renderer","this","dom","document","createElement","contentEditable","render","_createClass","key","value","_t2$attrs$latex","_t2$attrs$display","latex","attrs","display","className","setAttribute","title","innerHTML","_unused","textContent","update","type","name","ignoreMutation"],"mappings":"6sCAWaA,CAAAA,yBAKX,SAAAC,EAAYC,EAAAA,CAAcC,2BACxBC,IAAKD,CAAAA,QAAAA,CAAWA,EAChBC,IAAKC,CAAAA,GAAAA,CAAMC,SAASC,aAAc,CAAA,MAAA,CAAA,CAClCH,KAAKC,GAAIG,CAAAA,eAAAA,CAAkB,QAC3BJ,IAAKK,CAAAA,MAAAA,CAAOP,GACb,EAEO,OAAAQ,YAAA,CAAAT,CAAA,GAAAU,GAAA,UAAAC,KAAA,UAAAH,MAAAA,CAAOP,GACb,CAAA,KAAAW,eAAA,CAAAC,iBAAA,CAAA,GAAMC,CAAAA,mBAASb,GAAKc,CAAAA,KAAAA,CAAMD,wDAAoB,EACxCE,CAAAA,CAAAA,EAAAA,iBAAAA,CAAWf,IAAKc,KAAMC,CAAAA,OAAAA,UAAAA,iBAAAA,UAAAA,iBAAAA,CAAkC,SAQ9D,GAPAb,IAAAA,CAAKC,IAAIa,SACK,CAAA,OAAA,GAAZD,EACI,8CACA,CAAA,oBAAA,CACNb,KAAKC,GAAIc,CAAAA,YAAAA,CAAa,YAAaJ,CACnCX,CAAAA,CAAAA,IAAAA,CAAKC,IAAIc,YAAa,CAAA,mBAAA,CAAqBF,GAC3Cb,IAAKC,CAAAA,GAAAA,CAAIe,MAAQL,CACbX,CAAAA,IAAAA,CAAKD,SACP,GAGE,CAAA,MAAA,MADAC,KAAKC,GAAIgB,CAAAA,SAAAA,CAAYjB,KAAKD,QAASY,CAAAA,CAAAA,CAAOE,GAE3C,EAAC,MAAAK,OAAA,CAAA,CAED,CAEHlB,IAAKC,CAAAA,GAAAA,CAAIkB,YAAcR,CACxB,EAED,GAAAJ,GAAA,UAAAC,KAAA,UAAAY,MAAAA,CAAOtB,GAAAA,CAAAA,CACL,MAAuB,MAAnBA,GAAAA,GAAAA,CAAKuB,KAAKC,IACdtB,GAAAA,IAAAA,CAAKK,OAAOP,GACL,CAAA,CAAA,CAAA,CAAA,CACR,EAGD,GAAAS,GAAA,kBAAAC,KAAA,UAAAe,cAAAA,CAAAA,CAAAA,CACE,MAAO,CAAA,CACR"}
@@ -0,0 +1 @@
1
+ class t{constructor(t,i){this.renderer=i,this.dom=document.createElement("span"),this.dom.contentEditable="false",this.render(t)}render(t){const i=t.attrs.latex??"",s=t.attrs.display??"inline";if(this.dom.className="block"===s?"nile-wysiwyg__math nile-wysiwyg__math--block":"nile-wysiwyg__math",this.dom.setAttribute("data-math",i),this.dom.setAttribute("data-math-display",s),this.dom.title=i,this.renderer)try{return void(this.dom.innerHTML=this.renderer(i,s))}catch{}this.dom.textContent=i}update(t){return"math"===t.type.name&&(this.render(t),!0)}ignoreMutation(){return!0}}export{t as M};
@@ -0,0 +1,2 @@
1
+ System.register(["../../../index-89c520e9.cjs.js","../serializer.cjs.js","../sanitize.cjs.js","./embeds.cjs.js"],function(_export,_context){"use strict";var r,n;function s(r){return n(r).replace(/\n/g,"").length;}function t(n){return new r({filterTransaction:function filterTransaction(r,t){if(!r.docChanged)return!0;var i=n();if(!i||i<=0)return!0;var e=s(r.doc);return e<=i||e<s(t.doc);}});}_export("m",t);return{setters:[function(_index00aCjsJs){r=_index00aCjsJs.b;},function(_serializerCjsJs){n=_serializerCjsJs.d;},function(_sanitizeCjsJs){},function(_embedsCjsJs){}],execute:function execute(){}};});
2
+ //# sourceMappingURL=max-length.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"max-length.cjs.js","sources":["../../../../../src/nile-wysiwyg-editor/engine/plugins/max-length.ts"],"sourcesContent":["import { Plugin } from 'prosemirror-state';\nimport { docToText } from '../serializer';\n\nfunction charCount(doc: import('prosemirror-model').Node): number {\n return docToText(doc).replace(/\\n/g, '').length;\n}\n\n/**\n * Enforces a character limit by rejecting transactions that grow the\n * document past it. Shrinking edits are always allowed, even while over the\n * limit (e.g. after the limit was lowered), so users can recover.\n */\nexport function maxLengthPlugin(getMaxLength: () => number): Plugin {\n return new Plugin({\n filterTransaction(tr, state) {\n if (!tr.docChanged) return true;\n const max = getMaxLength();\n if (!max || max <= 0) return true;\n const after = charCount(tr.doc);\n if (after <= max) return true;\n return after < charCount(state.doc);\n },\n });\n}\n"],"names":["charCount","doc","docToText","replace","length","maxLengthPlugin","getMaxLength","Plugin","filterTransaction","tr","state","docChanged","max","after"],"mappings":"iKAGA,QAASA,CAAAA,CAAUC,CAAAA,CAAAA,CAAAA,CACjB,MAAOC,CAAAA,CAAAA,CAAUD,CAAKE,CAAAA,CAAAA,OAAAA,CAAQ,MAAO,EAAIC,CAAAA,CAAAA,MAC3C,EAOM,QAAUC,CAAAA,CAAgBC,CAAAA,CAAAA,CAAAA,CAC9B,MAAO,IAAIC,CAAAA,CAAO,CAAA,CAChBC,iBAAAA,SAAA,CAAAA,iBAAAA,CAAkBC,CAAIC,CAAAA,CAAAA,CAAAA,CACpB,IAAKD,CAAGE,CAAAA,UAAAA,CAAY,MAAO,CAAA,CAAA,CAC3B,GAAMC,CAAAA,CAAAA,CAAMN,IACZ,GAAKM,CAAAA,CAAAA,EAAOA,CAAO,EAAA,CAAA,CAAG,MAAO,CAAA,CAAA,CAC7B,GAAMC,CAAAA,CAAQb,CAAAA,CAAAA,CAAUS,CAAGR,CAAAA,GAAAA,CAAAA,CAC3B,MAAIY,CAAAA,CAAAA,EAASD,CACNC,EAAAA,CAAAA,CAAQb,CAAUU,CAAAA,CAAAA,CAAMT,GAChC,CAAA,EAAA,CAAA,CAEL"}
@@ -0,0 +1 @@
1
+ import{b as r}from"../../../index-6f3fa4ab.esm.js";import{d as e}from"../serializer.esm.js";import"../sanitize.esm.js";import"./embeds.esm.js";function n(r){return e(r).replace(/\n/g,"").length}function s(e){return new r({filterTransaction(r,s){if(!r.docChanged)return!0;const t=e();if(!t||t<=0)return!0;const i=n(r.doc);return i<=t||i<n(s.doc)}})}export{s as m};
@@ -0,0 +1,2 @@
1
+ System.register(["../../../index-89c520e9.cjs.js","../markdown-parse.cjs.js","../serializer.cjs.js","../sanitize.cjs.js","./embeds.cjs.js"],function(_export,_context){"use strict";var r,n,t,s,e,a;function i(r,s){var e=s.split(/\r\n?|\n/).map(function(n){return r.nodes.paragraph.create(null,n?r.text(n):null);});return new n(t.from(e),1,1);}function o(n){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return new r({props:{handlePaste:function handlePaste(r,i){var _t$getForcePlainText,_i$clipboardData$getD,_i$clipboardData,_i$clipboardData$getD2,_i$clipboardData2,_t$getSanitize,_t$getSanitize2;if((_t$getForcePlainText=t.getForcePlainText)!==null&&_t$getForcePlainText!==void 0&&_t$getForcePlainText.call(t))return!1;if(t.getMarkdownPaste&&!t.getMarkdownPaste())return!1;var o=(_i$clipboardData$getD=(_i$clipboardData=i.clipboardData)===null||_i$clipboardData===void 0?void 0:_i$clipboardData.getData("text/html"))!==null&&_i$clipboardData$getD!==void 0?_i$clipboardData$getD:"",u=(_i$clipboardData$getD2=(_i$clipboardData2=i.clipboardData)===null||_i$clipboardData2===void 0?void 0:_i$clipboardData2.getData("text/plain"))!==null&&_i$clipboardData$getD2!==void 0?_i$clipboardData$getD2:"";if(o.trim()||!u.trim())return!1;if(r.state.selection.$from.parent.type.spec.code)return!1;if(!s(u))return!1;var m=a(n,e(u),(_t$getSanitize=(_t$getSanitize2=t.getSanitize)===null||_t$getSanitize2===void 0?void 0:_t$getSanitize2.call(t))!==null&&_t$getSanitize!==void 0?_t$getSanitize:!0);return r.dispatch(r.state.tr.replaceSelection(m).scrollIntoView()),!0;},transformPasted:function transformPasted(r){var _t$getForcePlainText2;return(_t$getForcePlainText2=t.getForcePlainText)!==null&&_t$getForcePlainText2!==void 0&&_t$getForcePlainText2.call(t)?function(r,n){return i(r,n.content.textBetween(0,n.content.size,"\n","\n"));}(n,r):r;}}});}_export({a:o,p:i});return{setters:[function(_index00aCjsJs){r=_index00aCjsJs.b;n=_index00aCjsJs.d;t=_index00aCjsJs.F;},function(_markdownParseCjsJs){s=_markdownParseCjsJs.l;e=_markdownParseCjsJs.m;},function(_serializerCjsJs){a=_serializerCjsJs.h;},function(_sanitizeCjsJs){},function(_embedsCjsJs){}],execute:function execute(){}};});
2
+ //# sourceMappingURL=paste.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paste.cjs.js","sources":["../../../../../src/nile-wysiwyg-editor/engine/plugins/paste.ts"],"sourcesContent":["import { Plugin } from 'prosemirror-state';\nimport { Slice, Fragment, Node as PMNode, Schema } from 'prosemirror-model';\nimport { markdownToHtml, looksLikeMarkdown } from '../markdown-parse';\nimport { htmlToSlice } from '../serializer';\n\n/**\n * Builds a slice of plain paragraphs from text, splitting on newlines. Open\n * depth 1 on both ends lets the first/last block merge into the surrounding\n * paragraph, matching how a normal plain-text paste behaves.\n */\nexport function plainTextSlice(schema: Schema, text: string): Slice {\n const blocks = text.split(/\\r\\n?|\\n/);\n const nodes: PMNode[] = blocks.map(line =>\n schema.nodes.paragraph.create(null, line ? schema.text(line) : null)\n );\n return new Slice(Fragment.from(nodes), 1, 1);\n}\n\n/** Reduces a pasted slice to unstyled text, preserving block breaks. */\nexport function stripSliceFormatting(schema: Schema, slice: Slice): Slice {\n const text = slice.content.textBetween(0, slice.content.size, '\\n', '\\n');\n return plainTextSlice(schema, text);\n}\n\nexport interface PasteOptions {\n /**\n * Read live: when it returns true, every paste drops formatting (the\n * persistent \"paste as plain text\" toggle). The Ctrl+Shift+V shortcut is a\n * separate one-shot handled in the keymap.\n */\n getForcePlainText?: () => boolean;\n /**\n * Read live: when false, plain-text pastes are never parsed as Markdown.\n * Defaults to on.\n */\n getMarkdownPaste?: () => boolean;\n /** Read live: whether pasted HTML is sanitized. Defaults to on. */\n getSanitize?: () => boolean;\n}\n\n/**\n * Paste behavior: plain-text pastes that look like Markdown are parsed into\n * rich content (headings, lists, code fences, tables, inline marks), and all\n * pastes drop formatting while the host's plain-text toggle is on.\n */\nexport function pastePlugin(schema: Schema, options: PasteOptions = {}): Plugin {\n return new Plugin({\n props: {\n handlePaste(view, event) {\n if (options.getForcePlainText?.()) return false;\n if (options.getMarkdownPaste && !options.getMarkdownPaste()) return false;\n // Only plain-text pastes qualify: an HTML flavor means the source\n // was already rich, and code blocks take text verbatim.\n const html = event.clipboardData?.getData('text/html') ?? '';\n const text = event.clipboardData?.getData('text/plain') ?? '';\n if (html.trim() || !text.trim()) return false;\n if (view.state.selection.$from.parent.type.spec.code) return false;\n if (!looksLikeMarkdown(text)) return false;\n const slice = htmlToSlice(\n schema,\n markdownToHtml(text),\n options.getSanitize?.() ?? true\n );\n view.dispatch(view.state.tr.replaceSelection(slice).scrollIntoView());\n return true;\n },\n transformPasted(slice) {\n return options.getForcePlainText?.()\n ? stripSliceFormatting(schema, slice)\n : slice;\n },\n },\n });\n}\n"],"names":["plainTextSlice","schema","text","nodes","split","map","line","paragraph","create","Slice","Fragment","from","pastePlugin","options","arguments","length","undefined","Plugin","props","handlePaste","view","event","_t$getForcePlainText","_i$clipboardData$getD","_i$clipboardData","_i$clipboardData$getD2","_i$clipboardData2","_t$getSanitize","_t$getSanitize2","getForcePlainText","getMarkdownPaste","html","clipboardData","getData","trim","state","selection","$from","parent","type","spec","code","looksLikeMarkdown","slice","htmlToSlice","markdownToHtml","getSanitize","dispatch","tr","replaceSelection","scrollIntoView","transformPasted","content","textBetween","size","stripSliceFormatting"],"mappings":"oMAUgB,QAAAA,CAAAA,CAAAA,CAAeC,CAAgBC,CAAAA,CAAAA,CAAAA,CAC7C,GACMC,CAAAA,CADSD,CAAAA,CAAAA,CAAKE,KAAM,CAAA,UAAA,CAAA,CACKC,GAAIC,CAAAA,SAAAA,CAAAA,QACjCL,CAAAA,CAAOE,CAAAA,KAAAA,CAAMI,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3fa4ab.esm.js";import{l as e,m as s}from"../markdown-parse.esm.js";import{h as a}from"../serializer.esm.js";import"../sanitize.esm.js";import"./embeds.esm.js";function i(r,e){const s=e.split(/\r\n?|\n/).map((n=>r.nodes.paragraph.create(null,n?r.text(n):null)));return new n(t.from(s),1,1)}function m(n,t={}){return new r({props:{handlePaste(r,i){if(t.getForcePlainText?.())return!1;if(t.getMarkdownPaste&&!t.getMarkdownPaste())return!1;const m=i.clipboardData?.getData("text/html")??"",o=i.clipboardData?.getData("text/plain")??"";if(m.trim()||!o.trim())return!1;if(r.state.selection.$from.parent.type.spec.code)return!1;if(!e(o))return!1;const u=a(n,s(o),t.getSanitize?.()??!0);return r.dispatch(r.state.tr.replaceSelection(u).scrollIntoView()),!0},transformPasted:r=>t.getForcePlainText?.()?function(r,n){return i(r,n.content.textBetween(0,n.content.size,"\n","\n"))}(n,r):r}})}export{m as a,i as p};
@@ -0,0 +1,2 @@
1
+ System.register(["../../../index-89c520e9.cjs.js","../../../index-cc1385e0.cjs.js","../serializer.cjs.js","../sanitize.cjs.js","./embeds.cjs.js"],function(_export,_context){"use strict";var s,r,e,i;function o(o){return new s({props:{decorations:function decorations(s){var t=o();if(!t||!i(s.doc))return null;var a=r.node(0,s.doc.firstChild.nodeSize,{"class":"nile-wysiwyg__empty","data-placeholder":t});return e.create(s.doc,[a]);}}});}_export("p",o);return{setters:[function(_index00aCjsJs){s=_index00aCjsJs.b;},function(_index009CjsJs){r=_index009CjsJs.a;e=_index009CjsJs.D;},function(_serializerCjsJs){i=_serializerCjsJs.i;},function(_sanitizeCjsJs){},function(_embedsCjsJs){}],execute:function execute(){}};});
2
+ //# sourceMappingURL=placeholder.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"placeholder.cjs.js","sources":["../../../../../src/nile-wysiwyg-editor/engine/plugins/placeholder.ts"],"sourcesContent":["import { Plugin } from 'prosemirror-state';\nimport { Decoration, DecorationSet } from 'prosemirror-view';\nimport { isDocEmpty } from '../serializer';\n\n/**\n * Shows placeholder text on the first paragraph while the document is empty.\n * The text itself is rendered by CSS (`content: attr(data-placeholder)`) so\n * it never enters the document.\n */\nexport function placeholderPlugin(getText: () => string): Plugin {\n return new Plugin({\n props: {\n decorations(state) {\n const text = getText();\n if (!text || !isDocEmpty(state.doc)) return null;\n const deco = Decoration.node(0, state.doc.firstChild!.nodeSize, {\n class: 'nile-wysiwyg__empty',\n 'data-placeholder': text,\n });\n return DecorationSet.create(state.doc, [deco]);\n },\n },\n });\n}\n"],"names":["placeholderPlugin","getText","Plugin","props","decorations","state","text","isDocEmpty","doc","deco","Decoration","node","firstChild","nodeSize","class","DecorationSet","create"],"mappings":"sMASM,QAAUA,CAAAA,CAAAA,CAAkBC,CAChC,CAAA,CAAA,MAAO,IAAIC,CAAAA,CAAO,CAAA,CAChBC,KAAO,CAAA,CACLC,WAAAA,SAAA,CAAAA,WAAAA,CAAYC,GACV,GAAMC,CAAAA,CAAAA,CAAOL,CACb,CAAA,CAAA,CAAA,GAAA,CAAKK,CAASC,EAAAA,CAAAA,CAAAA,CAAWF,EAAMG,GAAM,CAAA,CAAA,MAAO,KAC5C,CAAA,GAAMC,CAAAA,CAAOC,CAAAA,CAAAA,CAAWC,KAAK,CAAGN,CAAAA,CAAAA,CAAMG,GAAII,CAAAA,UAAAA,CAAYC,QAAU,CAAA,CAC9DC,QAAO,qBACP,CAAA,kBAAA,CAAoBR,CAEtB,CAAA,CAAA,CAAA,MAAOS,CAAAA,CAAcC,CAAAA,MAAAA,CAAOX,EAAMG,GAAK,CAAA,CAACC,CACzC,CAAA,CAAA,EAAA,CAAA,CAAA,CAGP"}
@@ -0,0 +1 @@
1
+ import{b as s}from"../../../index-6f3fa4ab.esm.js";import{a as e,D as r}from"../../../index-353172ed.esm.js";import{i}from"../serializer.esm.js";import"../sanitize.esm.js";import"./embeds.esm.js";function o(o){return new s({props:{decorations(s){const t=o();if(!t||!i(s.doc))return null;const m=e.node(0,s.doc.firstChild.nodeSize,{class:"nile-wysiwyg__empty","data-placeholder":t});return r.create(s.doc,[m])}}})}export{o as p};
@@ -0,0 +1,2 @@
1
+ System.register(["../../../index-89c520e9.cjs.js"],function(_export,_context){"use strict";var n,r,t;function s(n){if(n.childCount<=1)return n;var r=n.type.schema,t=[];return n.descendants(function(n){return!n.isInline||(n.type===r.nodes.hard_break||t.push(n),!1);}),r.nodes.doc.create(null,r.nodes.paragraph.create(null,t));}function e(){return new n({filterTransaction:function filterTransaction(n){return!n.docChanged||n.doc.childCount<=1;},props:{handleKeyDown:function handleKeyDown(n,r){return"Enter"===r.key;},transformPasted:function transformPasted(n){var s=[];return n.content.descendants(function(n){return!n.isInline||(s.push(n),!1);}),new r(t.from(s),0,0);}}});}_export({f:s,s:e});return{setters:[function(_index00aCjsJs){n=_index00aCjsJs.b;r=_index00aCjsJs.d;t=_index00aCjsJs.F;}],execute:function execute(){}};});
2
+ //# sourceMappingURL=single-line.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"single-line.cjs.js","sources":["../../../../../src/nile-wysiwyg-editor/engine/plugins/single-line.ts"],"sourcesContent":["import { Plugin } from 'prosemirror-state';\nimport { Slice, Fragment, Node as PMNode } from 'prosemirror-model';\n\n/** Flattens a multi-block document into a single paragraph, keeping marks. */\nexport function flattenToSingleParagraph(doc: PMNode): PMNode {\n if (doc.childCount <= 1) return doc;\n const schema = doc.type.schema;\n const inline: PMNode[] = [];\n doc.descendants(node => {\n if (node.isInline) {\n if (node.type === schema.nodes.hard_break) return false;\n inline.push(node);\n return false;\n }\n return true;\n });\n return schema.nodes.doc.create(null, schema.nodes.paragraph.create(null, inline));\n}\n\n/**\n * Constrains the document to a single paragraph: Enter is inert, pasted\n * multi-block content is flattened to one line, and any transaction that\n * would still produce extra blocks is rejected.\n */\nexport function singleLinePlugin(): Plugin {\n return new Plugin({\n filterTransaction(tr) {\n return !tr.docChanged || tr.doc.childCount <= 1;\n },\n props: {\n handleKeyDown(_view, event) {\n return event.key === 'Enter';\n },\n transformPasted(slice) {\n const inline: PMNode[] = [];\n slice.content.descendants(node => {\n if (node.isInline) {\n inline.push(node);\n return false;\n }\n return true;\n });\n return new Slice(Fragment.from(inline), 0, 0);\n },\n },\n });\n}\n"],"names":["flattenToSingleParagraph","doc","childCount","schema","type","inline","descendants","node","isInline","nodes","hard_break","push","create","paragraph","singleLinePlugin","Plugin","filterTransaction","tr","docChanged","props","handleKeyDown","_view","event","key","transformPasted","slice","content","Slice","Fragment","from","_export","f"],"mappings":"qGAIM,QAAUA,CAAAA,EAAyBC,CACvC,CAAA,CAAA,GAAIA,EAAIC,UAAc,EAAA,CAAA,CAAG,MAAOD,CAAAA,CAChC,CAAA,GAAME,CAAAA,EAASF,CAAIG,CAAAA,IAAAA,CAAKD,OAClBE,CAAmB,CAAA,EAAA,CASzB,MARAJ,CAAAA,CAAIK,CAAAA,WAAAA,CAAYC,SAAAA,UACVA,CAAKC,CAAAA,QAAAA,GACHD,EAAKH,IAASD,GAAAA,CAAAA,CAAOM,MAAMC,UAC/BL,EAAAA,CAAAA,CAAOM,KAAKJ,CADsC,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAM/CJ,EAAOM,KAAMR,CAAAA,GAAAA,CAAIW,OAAO,IAAMT,CAAAA,CAAAA,CAAOM,MAAMI,SAAUD,CAAAA,MAAAA,CAAO,IAAMP,CAAAA,CAAAA,CAAAA,CAC3E,UAOgBS,CAAAA,IACd,MAAO,IAAIC,CAAAA,EAAO,CAChBC,iBAAAA,CAAkBC,QAAlBD,CAAAA,iBAAAA,CAAkBC,UACRA,CAAGC,CAAAA,UAAAA,EAAcD,EAAGhB,GAAIC,CAAAA,UAAAA,EAAc,IAEhDiB,KAAO,CAAA,CACLC,cAAa,QAAbA,CAAAA,cAAcC,CAAAA,CAAOC,SACE,OAAdA,GAAAA,CAAAA,CAAMC,GAEf,GAAAC,eAAAA,SAAA,CAAAA,eAAAA,CAAgBC,CAAAA,CAAAA,CACd,GAAMpB,CAAAA,CAAmB,CAAA,EAAA,CAQzB,MAPAoB,CAAAA,CAAMC,CAAAA,OAAAA,CAAQpB,YAAYC,SAAAA,CACpBA,QAAAA,CAAAA,CAAAA,CAAKC,WACPH,CAAOM,CAAAA,IAAAA,CAAKJ,IACL,CAIJ,CAAA,EAAA,CAAA,CAAA,GAAIoB,CAAAA,EAAMC,CAASC,CAAAA,IAAAA,CAAKxB,GAAS,CAAG,CAAA,CAAA,CAC5C,EAGP,CAAA,CAAA,CAAA,EAAAyB,OAAA,EAAAC,CAAA"}
@@ -0,0 +1 @@
1
+ import{b as n,d as r,F as t}from"../../../index-6f3fa4ab.esm.js";function e(n){if(n.childCount<=1)return n;const r=n.type.schema,t=[];return n.descendants((n=>!n.isInline||(n.type===r.nodes.hard_break||t.push(n),!1))),r.nodes.doc.create(null,r.nodes.paragraph.create(null,t))}function s(){return new n({filterTransaction:n=>!n.docChanged||n.doc.childCount<=1,props:{handleKeyDown:(n,r)=>"Enter"===r.key,transformPasted(n){const e=[];return n.content.descendants((n=>!n.isInline||(e.push(n),!1))),new r(t.from(e),0,0)}}})}export{e as f,s};
@@ -0,0 +1,2 @@
1
+ System.register(["../../../index-89c520e9.cjs.js","../../../index-cc1385e0.cjs.js"],function(_export,_context){"use strict";var n,t,o,r;function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var n=0,F=function F(){};return{s:F,n:function(_n2){function n(){return _n2.apply(this,arguments);}n.toString=function(){return _n2.toString();};return n;}(function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]};}),e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function e(e,s){return new n({key:e,state:{init:function init(){return r;},apply:function apply(n,t,o,e){var i=function(n,t){var _n$selection=n.selection,o=_n$selection.$from,e=_n$selection.empty;if(!e||!o.parent.isTextblock||o.parent.type.spec.code)return r;var s=o.parent.textBetween(0,o.parentOffset,"\0","\0"),i=_toConsumableArray(t.getTriggers()).sort(function(n,t){return t.length-n.length;});var _iterator=_createForOfIteratorHelper(i),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _t$minQueryLength;var _n=_step.value;if(!_n)continue;var _r=s.lastIndexOf(_n);if(-1===_r)continue;if(t.startOfLine&&0!==_r)continue;var _e=s[_r-1];if(void 0!==_e&&!/\s/.test(_e))continue;var _i=s.slice(_r+_n.length);if(!(_i.length>50||/\s/.test(_i)||_i.length<((_t$minQueryLength=t.minQueryLength)!==null&&_t$minQueryLength!==void 0?_t$minQueryLength:0)))return{active:!0,trigger:_n,query:_i,from:o.start()+_r,to:o.pos};}}catch(err){_iterator.e(err);}finally{_iterator.f();}return r;}(e,s);return i.active===t.active&&i.query===t.query&&i.trigger===t.trigger&&i.from===t.from||s.onChange(i),i;}},props:{decorations:function decorations(n){var r=e.getState(n);return r.active?t.create(n.doc,[o.inline(r.from,r.to,{"class":"nile-wysiwyg__suggestion"})]):null;},handleKeyDown:function handleKeyDown(n,t){var o=e.getState(n.state);return!(!o.active||!s.onKeyDown)&&s.onKeyDown(t,o);}}});}_export("s",e);return{setters:[function(_index00aCjsJs){n=_index00aCjsJs.b;},function(_index009CjsJs){t=_index009CjsJs.D;o=_index009CjsJs.a;}],execute:function execute(){r={active:!1,trigger:"",query:"",from:0,to:0};}};});
2
+ //# sourceMappingURL=suggestions.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suggestions.cjs.js","sources":["../../../../../src/nile-wysiwyg-editor/engine/plugins/suggestions.ts"],"sourcesContent":["import { Plugin, PluginKey, EditorState } from 'prosemirror-state';\nimport { Decoration, DecorationSet } from 'prosemirror-view';\n\n/** Live state of a trigger-character suggestion (mention or slash command). */\nexport interface SuggestionMatch {\n active: boolean;\n trigger: string;\n query: string;\n /** Doc range spanning trigger + query, to replace on selection. */\n from: number;\n to: number;\n}\n\nexport const INACTIVE_SUGGESTION: SuggestionMatch = {\n active: false,\n trigger: '',\n query: '',\n from: 0,\n to: 0,\n};\n\nexport interface SuggestionOptions {\n /** Read live so trigger config can change without rebuilding state. */\n getTriggers: () => string[];\n /** Restrict to the start of an empty-ish textblock (slash commands). */\n startOfLine?: boolean;\n /** Stay inactive until the query reaches this length (emoji \":\" noise). */\n minQueryLength?: number;\n /** Notified on every state change (including becoming inactive). */\n onChange: (match: SuggestionMatch) => void;\n /** Intercept keys (arrows/Enter/Escape) while a suggestion is active. */\n onKeyDown?: (event: KeyboardEvent, match: SuggestionMatch) => boolean;\n}\n\nconst MAX_QUERY_LENGTH = 50;\n\nfunction findSuggestion(state: EditorState, options: SuggestionOptions): SuggestionMatch {\n const { $from, empty } = state.selection;\n if (!empty || !$from.parent.isTextblock || $from.parent.type.spec.code) {\n return INACTIVE_SUGGESTION;\n }\n const textBefore = $from.parent.textBetween(0, $from.parentOffset, '\\0', '\\0');\n // Longest triggers first so '{{' wins over '{'.\n const triggers = [...options.getTriggers()].sort((a, b) => b.length - a.length);\n for (const trigger of triggers) {\n if (!trigger) continue;\n const index = textBefore.lastIndexOf(trigger);\n if (index === -1) continue;\n if (options.startOfLine && index !== 0) continue;\n // Trigger must start a word: preceded by nothing or whitespace.\n const before = textBefore[index - 1];\n if (before !== undefined && !/\\s/.test(before)) continue;\n const query = textBefore.slice(index + trigger.length);\n if (query.length > MAX_QUERY_LENGTH || /\\s/.test(query)) continue;\n if (query.length < (options.minQueryLength ?? 0)) continue;\n return {\n active: true,\n trigger,\n query,\n from: $from.start() + index,\n to: $from.pos,\n };\n }\n return INACTIVE_SUGGESTION;\n}\n\n/**\n * Generic trigger-character suggestion tracker. Recomputes the active\n * trigger/query from the selection on every transaction, notifies the host,\n * and softly highlights the query text. Insertion/UI is the host's job.\n */\nexport function suggestionPlugin(key: PluginKey, options: SuggestionOptions): Plugin {\n return new Plugin<SuggestionMatch>({\n key,\n\n state: {\n init: () => INACTIVE_SUGGESTION,\n apply(tr, prev, _old, newState) {\n const next = findSuggestion(newState, options);\n if (\n next.active !== prev.active ||\n next.query !== prev.query ||\n next.trigger !== prev.trigger ||\n next.from !== prev.from\n ) {\n options.onChange(next);\n }\n return next;\n },\n },\n\n props: {\n decorations(state) {\n const match = key.getState(state) as SuggestionMatch;\n if (!match.active) return null;\n return DecorationSet.create(state.doc, [\n Decoration.inline(match.from, match.to, {\n class: 'nile-wysiwyg__suggestion',\n }),\n ]);\n },\n\n handleKeyDown(view, event) {\n const match = key.getState(view.state) as SuggestionMatch;\n if (!match.active || !options.onKeyDown) return false;\n return options.onKeyDown(event, match);\n },\n },\n });\n}\n"],"names":["suggestionPlugin","key","options","Plugin","state","init","INACTIVE_SUGGESTION","apply","tr","prev","_old","newState","next","_n$selection","selection","$from","empty","parent","isTextblock","type","spec","code","textBefore","textBetween","parentOffset","triggers","_toConsumableArray","getTriggers","sort","a","b","length","_iterator","_createForOfIteratorHelper","_step","s","n","done","_t$minQueryLength","trigger","index","lastIndexOf","startOfLine","before","undefined","test","query","slice","minQueryLength","active","from","start","to","pos","err","e","f","findSuggestion","onChange","props","decorations","match","getState","DecorationSet","create","doc","Decoration","inline","class","handleKeyDown","view","event","onKeyDown"],"mappings":"u6DAuEgB,QAAAA,CAAAA,CAAAA,CAAiBC,CAAgBC,CAAAA,CAAAA,CAAAA,CAC/C,MAAO,IAAIC,CAAAA,CAAwB,CAAA,CACjCF,GAEAG,CAAAA,CAAAA,CAAAA,KAAAA,CAAO,CACLC,IAAM,CAAA,QAANA,CAAAA,IAAMA,CAAA,QAAMC,CAAAA,CACZ,GAAAC,KAAAA,SAAA,CAAAA,KAAAA,CAAMC,CAAAA,CAAIC,EAAMC,CAAMC,CAAAA,CAAAA,CAAAA,CACpB,GAAMC,CAAAA,CAAAA,CA1Cd,SAAwBR,CAAAA,CAAoBF,GAC1C,IAAAW,YAAA,CAAyBT,CAAAA,CAAMU,SAC/B,CADQC,CAAKC,CAAAA,YAAAA,CAAPD,KAAAA,CAASC,CAAUZ,CAAAA,YAAAA,CAAZY,KAAAA,CACb,GAAA,CAAKA,CAAUD,EAAAA,CAAAA,CAAAA,CAAME,MAAOC,CAAAA,WAAAA,EAAeH,CAAME,CAAAA,MAAAA,CAAOE,KAAKC,IAAKC,CAAAA,IAAAA,CAChE,MAAOf,CAAAA,CAAAA,CAET,GAAMgB,CAAAA,CAAAA,CAAaP,EAAME,MAAOM,CAAAA,WAAAA,CAAY,CAAGR,CAAAA,CAAAA,CAAMS,YAAc,CAAA,IAAA,CAAM,MAEnEC,CAAW,CAAAC,kBAAA,CAAIxB,CAAQyB,CAAAA,WAAAA,CAAAA,CAAAA,EAAeC,IAAK,CAAA,SAACC,CAAGC,CAAAA,CAAAA,QAAMA,CAAAA,CAAEC,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,CACRV,CAAAA,OAAAA,CAAS,EACTO,CAAAA,KAAAA,CAAO,GACPI,IAAM,CAAA,CAAA,CACNE,EAAI,CAAA,CAAA,CAAA"}
@@ -0,0 +1 @@
1
+ import{b as n}from"../../../index-6f3fa4ab.esm.js";import{D as t,a as o}from"../../../index-353172ed.esm.js";const e={active:!1,trigger:"",query:"",from:0,to:0};function r(r,s){return new n({key:r,state:{init:()=>e,apply(n,t,o,r){const i=function(n,t){const{$from:o,empty:r}=n.selection;if(!r||!o.parent.isTextblock||o.parent.type.spec.code)return e;const s=o.parent.textBetween(0,o.parentOffset,"\0","\0"),i=[...t.getTriggers()].sort(((n,t)=>t.length-n.length));for(const n of i){if(!n)continue;const e=s.lastIndexOf(n);if(-1===e)continue;if(t.startOfLine&&0!==e)continue;const r=s[e-1];if(void 0!==r&&!/\s/.test(r))continue;const i=s.slice(e+n.length);if(!(i.length>50||/\s/.test(i)||i.length<(t.minQueryLength??0)))return{active:!0,trigger:n,query:i,from:o.start()+e,to:o.pos}}return e}(r,s);return i.active===t.active&&i.query===t.query&&i.trigger===t.trigger&&i.from===t.from||s.onChange(i),i}},props:{decorations(n){const e=r.getState(n);return e.active?t.create(n.doc,[o.inline(e.from,e.to,{class:"nile-wysiwyg__suggestion"})]):null},handleKeyDown(n,t){const o=r.getState(n.state);return!(!o.active||!s.onKeyDown)&&s.onKeyDown(t,o)}}})}export{r as s};
@@ -0,0 +1,2 @@
1
+ System.register(["../../../index-df196058.cjs.js","../../../index-89c520e9.cjs.js","../../../index-cc1385e0.cjs.js","../../../index-178e1e57.cjs.js"],function(_export,_context){"use strict";var s,e;function i(){return[s(),e({allowTableNodeSelection:!0})];}_export("t",i);return{setters:[function(_index001CjsJs){s=_index001CjsJs.c;e=_index001CjsJs.t;},function(_index00aCjsJs){},function(_index009CjsJs){},function(_index007CjsJs){}],execute:function execute(){}};});
2
+ //# sourceMappingURL=tables.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tables.cjs.js","sources":["../../../../../src/nile-wysiwyg-editor/engine/plugins/tables.ts"],"sourcesContent":["import { Plugin } from 'prosemirror-state';\nimport { tableEditing, columnResizing } from 'prosemirror-tables';\n\n/**\n * prosemirror-tables wiring: cell selections, fix-tables normalization, and\n * draggable column resizing (widths persist as `data-colwidth`). The CSS\n * these plugins rely on (.selectedCell, .column-resize-handle, .resize-cursor)\n * is inlined in nile-wysiwyg-editor.css.ts.\n */\nexport function tablePlugins(): Plugin[] {\n return [columnResizing(), tableEditing({ allowTableNodeSelection: true })];\n}\n"],"names":["tablePlugins","columnResizing","tableEditing","allowTableNodeSelection"],"mappings":"8MASgBA,CAAAA,CAAAA,CAAAA,CAAAA,CACd,MAAO,CAACC,CAAkBC,CAAAA,CAAAA,CAAAA,CAAAA,CAAa,CAAEC,uBAAAA,CAAAA,CAAyB,IACpE"}
@@ -0,0 +1 @@
1
+ import{c as e,t as s}from"../../../index-249de90a.esm.js";import"../../../index-6f3fa4ab.esm.js";import"../../../index-353172ed.esm.js";import"../../../index-920675c4.esm.js";function i(){return[e(),s({allowTableNodeSelection:!0})]}export{i as t};
@@ -0,0 +1,2 @@
1
+ System.register([],function(_export,_context){"use strict";var t;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}return{setters:[],execute:function execute(){_export("T",t=/*#__PURE__*/function(){function t(_t,i,s){var _this=this;_classCallCheck(this,t);this.node=_t,this.dom=document.createElement("li"),this.dom.className="nile-wysiwyg__task-item",this.dom.dataset.taskItem="true",this.dom.dataset.checked=String(_t.attrs.checked),this.checkbox=document.createElement("input"),this.checkbox.type="checkbox",this.checkbox.contentEditable="false",this.checkbox.checked=_t.attrs.checked,this.checkbox.addEventListener("mousedown",function(_t2){return _t2.preventDefault();}),this.checkbox.addEventListener("change",function(){var _t3=s();if(void 0===_t3||!i.editable)return void(_this.checkbox.checked=_this.node.attrs.checked);var h=i.state.doc.nodeAt(_t3);h&&i.dispatch(i.state.tr.setNodeMarkup(_t3,void 0,_objectSpread(_objectSpread({},h.attrs),{},{checked:_this.checkbox.checked})));}),this.contentDOM=document.createElement("div"),this.contentDOM.className="nile-wysiwyg__task-content",this.dom.append(this.checkbox,this.contentDOM);}return _createClass(t,[{key:"update",value:function update(_t4){return _t4.type===this.node.type&&(this.node=_t4,this.checkbox.checked=_t4.attrs.checked,this.dom.dataset.checked=String(_t4.attrs.checked),!0);}},{key:"stopEvent",value:function stopEvent(_t5){return _t5.target===this.checkbox;}}]);}());}};});
2
+ //# sourceMappingURL=task-list.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-list.cjs.js","sources":["../../../../../src/nile-wysiwyg-editor/engine/plugins/task-list.ts"],"sourcesContent":["import { Node as PMNode } from 'prosemirror-model';\nimport { EditorView, NodeView } from 'prosemirror-view';\n\n/**\n * NodeView for task items: renders a real checkbox (contenteditable=false)\n * next to the editable content. Toggling writes the `checked` attr back to\n * the document as a single transaction.\n */\nexport class TaskItemView implements NodeView {\n dom: HTMLLIElement;\n\n contentDOM: HTMLElement;\n\n private checkbox: HTMLInputElement;\n\n constructor(\n private node: PMNode,\n view: EditorView,\n getPos: () => number | undefined\n ) {\n this.dom = document.createElement('li');\n this.dom.className = 'nile-wysiwyg__task-item';\n this.dom.dataset.taskItem = 'true';\n this.dom.dataset.checked = String(node.attrs.checked);\n\n this.checkbox = document.createElement('input');\n this.checkbox.type = 'checkbox';\n this.checkbox.contentEditable = 'false';\n this.checkbox.checked = node.attrs.checked;\n // Keep the selection in the editor while clicking.\n this.checkbox.addEventListener('mousedown', e => e.preventDefault());\n this.checkbox.addEventListener('change', () => {\n const pos = getPos();\n if (pos === undefined || !view.editable) {\n this.checkbox.checked = this.node.attrs.checked;\n return;\n }\n const current = view.state.doc.nodeAt(pos);\n if (!current) return;\n view.dispatch(\n view.state.tr.setNodeMarkup(pos, undefined, {\n ...current.attrs,\n checked: this.checkbox.checked,\n })\n );\n });\n\n this.contentDOM = document.createElement('div');\n this.contentDOM.className = 'nile-wysiwyg__task-content';\n\n this.dom.append(this.checkbox, this.contentDOM);\n }\n\n update(node: PMNode): boolean {\n if (node.type !== this.node.type) return false;\n this.node = node;\n this.checkbox.checked = node.attrs.checked;\n this.dom.dataset.checked = String(node.attrs.checked);\n return true;\n }\n\n stopEvent(event: Event): boolean {\n return event.target === this.checkbox;\n }\n}\n"],"names":["TaskItemView","t","node","view","getPos","this","dom","document","createElement","className","dataset","taskItem","checked","String","attrs","checkbox","type","contentEditable","addEventListener","e","preventDefault","pos","undefined","editable","current","state","doc","nodeAt","dispatch","tr","setNodeMarkup","contentDOM","append","_createClass","key","value","update","stopEvent","event","target"],"mappings":"k9DAQaA,CAOX,yBAAA,SAAAC,EACUC,EAAAA,CACRC,EACAC,CAFQC,CAAAA,KAAAA,KAAAA,MAAAA,eAAAA,MAAAA,CAAAA,EAAAA,IAAAA,CAAIH,IAAJA,CAAAA,EAAAA,CAIRG,KAAKC,GAAMC,CAAAA,QAAAA,CAASC,aAAc,CAAA,IAAA,CAAA,CAClCH,KAAKC,GAAIG,CAAAA,SAAAA,CAAY,yBACrBJ,CAAAA,IAAAA,CAAKC,IAAII,OAAQC,CAAAA,QAAAA,CAAW,MAC5BN,CAAAA,IAAAA,CAAKC,IAAII,OAAQE,CAAAA,OAAAA,CAAUC,MAAOX,CAAAA,EAAAA,CAAKY,MAAMF,OAE7CP,CAAAA,CAAAA,IAAAA,CAAKU,QAAWR,CAAAA,QAAAA,CAASC,cAAc,OACvCH,CAAAA,CAAAA,IAAAA,CAAKU,QAASC,CAAAA,IAAAA,CAAO,WACrBX,IAAKU,CAAAA,QAAAA,CAASE,eAAkB,CAAA,OAAA,CAChCZ,KAAKU,QAASH,CAAAA,OAAAA,CAAUV,EAAKY,CAAAA,KAAAA,CAAMF,QAEnCP,IAAKU,CAAAA,QAAAA,CAASG,gBAAiB,CAAA,WAAA,CAAaC,SAAAA,WAAKA,CAAAA,GAAEC,CAAAA,cAAAA,CAAAA,CAAAA,EAAAA,CAAAA,CACnDf,IAAKU,CAAAA,QAAAA,CAASG,iBAAiB,QAAU,CAAA,UAAA,CACvC,GAAMG,CAAAA,GAAAA,CAAMjB,IACZ,GAAYkB,IAAAA,EAAAA,GAARD,GAAsBlB,EAAAA,CAAAA,CAAAA,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}
@@ -0,0 +1 @@
1
+ class t{constructor(t,i,s){this.node=t,this.dom=document.createElement("li"),this.dom.className="nile-wysiwyg__task-item",this.dom.dataset.taskItem="true",this.dom.dataset.checked=String(t.attrs.checked),this.checkbox=document.createElement("input"),this.checkbox.type="checkbox",this.checkbox.contentEditable="false",this.checkbox.checked=t.attrs.checked,this.checkbox.addEventListener("mousedown",(t=>t.preventDefault())),this.checkbox.addEventListener("change",(()=>{const t=s();if(void 0===t||!i.editable)return void(this.checkbox.checked=this.node.attrs.checked);const h=i.state.doc.nodeAt(t);h&&i.dispatch(i.state.tr.setNodeMarkup(t,void 0,{...h.attrs,checked:this.checkbox.checked}))})),this.contentDOM=document.createElement("div"),this.contentDOM.className="nile-wysiwyg__task-content",this.dom.append(this.checkbox,this.contentDOM)}update(t){return t.type===this.node.type&&(this.node=t,this.checkbox.checked=t.attrs.checked,this.dom.dataset.checked=String(t.attrs.checked),!0)}stopEvent(t){return t.target===this.checkbox}}export{t as T};
@@ -0,0 +1,2 @@
1
+ System.register(["./plugins/embeds.cjs.js","../../index-89c520e9.cjs.js"],function(_export,_context){"use strict";var t,e,a,n,i,r,o,s;function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function l(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var a=t.trim();if(""===a)return!1;if(/^(#|\/|\.\/|\.\.\/)/.test(a))return!0;var n=/^([a-z][a-z0-9+.-]*):/i.exec(a);if(!n)return!0;var i="".concat(n[1].toLowerCase(),":");return!!o.includes(i)||!(!e||"data:"!==i)&&/^data:image\/(png|gif|jpe?g|webp|avif|bmp);/i.test(a);}function d(t,e){var a=s[e];return t.split(";").map(function(t){return t.trim();}).filter(function(t){var e=t.slice(0,t.indexOf(":")).trim().toLowerCase();return!!(r.has(e)||a&&a.has(e))&&!/url\s*\(|expression\s*\(/i.test(t);}).join("; ");}function c(t){var e=t.tagName.toLowerCase(),a=n[e];for(var _i=0,_Array$from=Array.from(t.attributes);_i<_Array$from.length;_i++){var _n=_Array$from[_i];var _r=_n.name.toLowerCase();if((i.has(_r)||void 0!==a&&a.has(_r))&&!_r.startsWith("on")){if("style"===_r){var _a=d(_n.value,e);_a?t.setAttribute("style",_a):t.removeAttribute("style");}else"href"===_r||"src"===_r?l(_n.value,"img"===e)||t.removeAttribute(_n.name):"target"===_r&&("_blank"===_n.value?t.setAttribute("rel","noopener noreferrer"):t.removeAttribute("target"));}else t.removeAttribute(_n.name);}}function f(n){for(var _i2=0,_Array$from2=Array.from(n.children);_i2<_Array$from2.length;_i2++){var _i3$getAttribute;var _i3=_Array$from2[_i2];var _n2=_i3.tagName.toLowerCase();e.has(_n2)?_i3.remove():"iframe"!==_n2||t((_i3$getAttribute=_i3.getAttribute("src"))!==null&&_i3$getAttribute!==void 0?_i3$getAttribute:"")?a.has(_n2)?(c(_i3),f(_i3)):(f(_i3),_i3.replaceWith.apply(_i3,_toConsumableArray(Array.from(_i3.childNodes)))):_i3.remove();}}function g(t){var e=new DOMParser().parseFromString(t,"text/html");return f(e.body),e.body.innerHTML;}_export({i:l,s:g});return{setters:[function(_pluginsEmbedsCjsJs){t=_pluginsEmbedsCjsJs.i;},function(_index00aCjsJs){}],execute:function execute(){e=new Set(["script","style","frame","frameset","object","embed","applet","form","input","textarea","select","button","meta","link","base","title","noscript","template","svg","math","canvas","audio","video","dialog","slot"]),a=new Set(["p","h1","h2","h3","h4","h5","h6","blockquote","ul","ol","li","br","hr","a","b","strong","i","em","u","s","strike","del","span","code","sub","sup","div","font","pre","figure","figcaption","img","iframe","table","thead","tbody","tfoot","tr","td","th","colgroup","col"]),n={a:new Set(["href","title","target","rel","id","name","data-bookmark"]),table:new Set(["role","data-layout"]),ol:new Set(["start","type","data-list-style"]),ul:new Set(["data-task-list"]),figure:new Set(["data-align"]),li:new Set(["data-task-item","data-checked"]),span:new Set(["data-mention-trigger","data-mention-key","data-mention-label","data-merge-field","data-merge-label","data-math","data-math-display"]),pre:new Set(["data-language"]),img:new Set(["src","alt","title","width","height"]),td:new Set(["colspan","rowspan","data-colwidth"]),th:new Set(["colspan","rowspan","data-colwidth"]),col:new Set(["span","width"]),div:new Set(["data-embed-provider","data-width","data-align"]),iframe:new Set(["src","title","frameborder","allowfullscreen","allow"])},i=new Set(["style","align"]),r=new Set(["color","background-color","font-family","font-size","font-style","font-weight","text-align","text-decoration","text-decoration-line","vertical-align","margin-left","margin-inline-start","list-style-type","line-height"]),o=["http:","https:","mailto:","tel:","ftp:"];s={img:new Set(["width","height"]),figure:new Set(["width","margin-right"]),div:new Set(["width","max-width"])};}};});
2
+ //# sourceMappingURL=sanitize.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sanitize.cjs.js","sources":["../../../../src/nile-wysiwyg-editor/engine/sanitize.ts"],"sourcesContent":["/**\n * HTML sanitization pre-pass. The ProseMirror schema is the real whitelist —\n * anything it can't parse is dropped — but this pass removes actively\n * dangerous content (scripts, event handlers, javascript: URLs) before the\n * string ever touches a live DOM, and strips style declarations down to the\n * set the schema understands.\n */\n\nimport { isAllowedEmbedSrc } from './plugins/embeds';\n\n/** Elements removed together with their content. */\nconst DROP_WITH_CONTENT = new Set([\n 'script', 'style', 'frame', 'frameset', 'object', 'embed',\n 'applet', 'form', 'input', 'textarea', 'select', 'button', 'meta', 'link',\n 'base', 'title', 'noscript', 'template', 'svg', 'math', 'canvas', 'audio',\n 'video', 'dialog', 'slot',\n]);\n\n/** Elements kept as-is (with filtered attributes). Extended in later phases. */\nconst ALLOWED_TAGS = new Set([\n 'p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'ul', 'ol', 'li',\n 'br', 'hr', 'a', 'b', 'strong', 'i', 'em', 'u', 's', 'strike', 'del',\n 'span', 'code', 'sub', 'sup', 'div', 'font',\n 'pre', 'figure', 'figcaption', 'img', 'iframe',\n 'table', 'thead', 'tbody', 'tfoot', 'tr', 'td', 'th', 'colgroup', 'col',\n]);\n\n/** Attributes allowed per tag (on top of GLOBAL_ATTRS). */\nconst TAG_ATTRS: Record<string, Set<string>> = {\n a: new Set(['href', 'title', 'target', 'rel', 'id', 'name', 'data-bookmark']),\n table: new Set(['role', 'data-layout']),\n ol: new Set(['start', 'type', 'data-list-style']),\n ul: new Set(['data-task-list']),\n figure: new Set(['data-align']),\n li: new Set(['data-task-item', 'data-checked']),\n span: new Set([\n 'data-mention-trigger', 'data-mention-key', 'data-mention-label',\n 'data-merge-field', 'data-merge-label', 'data-math', 'data-math-display',\n ]),\n pre: new Set(['data-language']),\n img: new Set(['src', 'alt', 'title', 'width', 'height']),\n td: new Set(['colspan', 'rowspan', 'data-colwidth']),\n th: new Set(['colspan', 'rowspan', 'data-colwidth']),\n col: new Set(['span', 'width']),\n div: new Set(['data-embed-provider', 'data-width', 'data-align']),\n iframe: new Set(['src', 'title', 'frameborder', 'allowfullscreen', 'allow']),\n};\n\nconst GLOBAL_ATTRS = new Set(['style', 'align']);\n\n/** Style declarations the schema can represent. Everything else is noise. */\nconst ALLOWED_STYLES = new Set([\n 'color', 'background-color', 'font-family', 'font-size', 'font-style',\n 'font-weight', 'text-align', 'text-decoration', 'text-decoration-line',\n 'vertical-align', 'margin-left', 'margin-inline-start', 'list-style-type',\n 'line-height',\n]);\n\nconst SAFE_URL_PROTOCOLS = ['http:', 'https:', 'mailto:', 'tel:', 'ftp:'];\n\nexport function isSafeUrl(url: string, allowDataImage = false): boolean {\n const trimmed = url.trim();\n if (trimmed === '') return false;\n // Relative URLs and fragments have no protocol — safe.\n if (/^(#|\\/|\\.\\/|\\.\\.\\/)/.test(trimmed)) return true;\n const match = /^([a-z][a-z0-9+.-]*):/i.exec(trimmed);\n if (!match) return true;\n const protocol = `${match[1].toLowerCase()}:`;\n if (SAFE_URL_PROTOCOLS.includes(protocol)) return true;\n if (allowDataImage && protocol === 'data:') {\n // Raster images only — data:image/svg+xml can carry scripts.\n return /^data:image\\/(png|gif|jpe?g|webp|avif|bmp);/i.test(trimmed);\n }\n return false;\n}\n\n/** Size styles allowed only where they are part of the document model. */\nconst SIZED_TAGS: Record<string, Set<string>> = {\n img: new Set(['width', 'height']),\n figure: new Set(['width', 'margin-right']),\n div: new Set(['width', 'max-width']),\n};\n\nfunction filterStyle(value: string, tag: string): string {\n const extra = SIZED_TAGS[tag];\n return value\n .split(';')\n .map(decl => decl.trim())\n .filter(decl => {\n const name = decl.slice(0, decl.indexOf(':')).trim().toLowerCase();\n if (!ALLOWED_STYLES.has(name) && !(extra && extra.has(name))) return false;\n // Defense in depth: CSS url()/expression() smuggling.\n return !/url\\s*\\(|expression\\s*\\(/i.test(decl);\n })\n .join('; ');\n}\n\nfunction sanitizeElement(el: Element): void {\n const tag = el.tagName.toLowerCase();\n const allowed = TAG_ATTRS[tag];\n for (const attr of Array.from(el.attributes)) {\n const name = attr.name.toLowerCase();\n const keep =\n (GLOBAL_ATTRS.has(name) || (allowed !== undefined && allowed.has(name))) &&\n !name.startsWith('on');\n if (!keep) {\n el.removeAttribute(attr.name);\n continue;\n }\n if (name === 'style') {\n const filtered = filterStyle(attr.value, tag);\n if (filtered) el.setAttribute('style', filtered);\n else el.removeAttribute('style');\n } else if (name === 'href' || name === 'src') {\n // Raster data: URLs are allowed on images only.\n if (!isSafeUrl(attr.value, tag === 'img')) el.removeAttribute(attr.name);\n } else if (name === 'target') {\n if (attr.value === '_blank') el.setAttribute('rel', 'noopener noreferrer');\n else el.removeAttribute('target');\n }\n }\n}\n\nfunction walk(node: Element): void {\n for (const child of Array.from(node.children)) {\n const tag = child.tagName.toLowerCase();\n if (DROP_WITH_CONTENT.has(tag)) {\n child.remove();\n continue;\n }\n // iframes are allowed ONLY for allowlisted embed providers.\n if (tag === 'iframe' && !isAllowedEmbedSrc(child.getAttribute('src') ?? '')) {\n child.remove();\n continue;\n }\n if (!ALLOWED_TAGS.has(tag)) {\n // Unknown wrapper (article, section, table for now, …): keep its\n // content, drop the element itself.\n walk(child);\n child.replaceWith(...Array.from(child.childNodes));\n continue;\n }\n sanitizeElement(child);\n walk(child);\n }\n}\n\n/**\n * Sanitizes an HTML string. Parsing happens in an inert document created by\n * DOMParser, so embedded scripts never execute and images never load.\n */\nexport function sanitizeHtml(html: string): string {\n const doc = new DOMParser().parseFromString(html, 'text/html');\n walk(doc.body);\n return doc.body.innerHTML;\n}\n"],"names":["isSafeUrl","url","allowDataImage","arguments","length","undefined","trimmed","trim","test","match","exec","protocol","toLowerCase","SAFE_URL_PROTOCOLS","includes","filterStyle","value","tag","extra","SIZED_TAGS","split","map","decl","filter","name","slice","indexOf","ALLOWED_STYLES","has","join","sanitizeElement","el","tagName","allowed","TAG_ATTRS","_i","_Array$from","Array","from","attributes","attr","GLOBAL_ATTRS","startsWith","filtered","setAttribute","removeAttribute","walk","node","_i2","_Array$from2","children","_i3$getAttribute","child","DROP_WITH_CONTENT","remove","isAllowedEmbedSrc","getAttribute","ALLOWED_TAGS","replaceWith","childNodes","sanitizeHtml","html","doc","DOMParser","parseFromString","body","innerHTML","_export","i","Set","a","table","ol","ul","figure","li","span","pre","img","td","th","col","div","iframe"],"mappings":"qmCA4DgBA,CAAAA,CAAUC,CAA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AA,IAAI,CAAC,MAAA,CAAQ,OACtBa,CAAAA,CAAAA,CAAAA,GAAAA,CAAK,GAAIb,CAAAA,GAAAA,CAAI,CAAC,qBAAA,CAAuB,YAAc,CAAA,YAAA,CAAA,CAAA,CACnDc,MAAQ,CAAA,GAAId,CAAAA,GAAI,CAAA,CAAC,MAAO,OAAS,CAAA,aAAA,CAAe,iBAAmB,CAAA,OAAA,CAAA,CAAA,CAAA,CAG/D5B,CAAe,CAAA,GAAI4B,CAAAA,GAAI,CAAA,CAAC,OAAS,CAAA,OAAA,CAAA,CAAA,CAGjC1C,CAAiB,CAAA,GAAI0C,CAAAA,GAAI,CAAA,CAC7B,QAAS,kBAAoB,CAAA,aAAA,CAAe,WAAa,CAAA,YAAA,CACzD,aAAe,CAAA,YAAA,CAAc,iBAAmB,CAAA,sBAAA,CAChD,gBAAkB,CAAA,aAAA,CAAe,qBAAuB,CAAA,iBAAA,CACxD,aAGIxD,CAAAA,CAAAA,CAAAA,CAAAA,CAAqB,CAAC,OAAS,CAAA,QAAA,CAAU,SAAW,CAAA,MAAA,CAAQ,QAmB5DM,CAA0C,CAAA,CAC9C2D,GAAK,CAAA,GAAIT,CAAAA,GAAI,CAAA,CAAC,QAAS,QACvBK,CAAAA,CAAAA,CAAAA,MAAAA,CAAQ,GAAIL,CAAAA,GAAAA,CAAI,CAAC,OAAA,CAAS,cAC1Ba,CAAAA,CAAAA,CAAAA,GAAAA,CAAK,GAAIb,CAAAA,GAAAA,CAAI,CAAC,OAAA,CAAS,WAGzB,CAAA,CAAA,CAAA"}
@@ -0,0 +1 @@
1
+ import{i as t}from"./plugins/embeds.esm.js";import"../../index-6f3fa4ab.esm.js";const e=new Set(["script","style","frame","frameset","object","embed","applet","form","input","textarea","select","button","meta","link","base","title","noscript","template","svg","math","canvas","audio","video","dialog","slot"]),a=new Set(["p","h1","h2","h3","h4","h5","h6","blockquote","ul","ol","li","br","hr","a","b","strong","i","em","u","s","strike","del","span","code","sub","sup","div","font","pre","figure","figcaption","img","iframe","table","thead","tbody","tfoot","tr","td","th","colgroup","col"]),n={a:new Set(["href","title","target","rel","id","name","data-bookmark"]),table:new Set(["role","data-layout"]),ol:new Set(["start","type","data-list-style"]),ul:new Set(["data-task-list"]),figure:new Set(["data-align"]),li:new Set(["data-task-item","data-checked"]),span:new Set(["data-mention-trigger","data-mention-key","data-mention-label","data-merge-field","data-merge-label","data-math","data-math-display"]),pre:new Set(["data-language"]),img:new Set(["src","alt","title","width","height"]),td:new Set(["colspan","rowspan","data-colwidth"]),th:new Set(["colspan","rowspan","data-colwidth"]),col:new Set(["span","width"]),div:new Set(["data-embed-provider","data-width","data-align"]),iframe:new Set(["src","title","frameborder","allowfullscreen","allow"])},i=new Set(["style","align"]),r=new Set(["color","background-color","font-family","font-size","font-style","font-weight","text-align","text-decoration","text-decoration-line","vertical-align","margin-left","margin-inline-start","list-style-type","line-height"]),o=["http:","https:","mailto:","tel:","ftp:"];function l(t,e=!1){const a=t.trim();if(""===a)return!1;if(/^(#|\/|\.\/|\.\.\/)/.test(a))return!0;const n=/^([a-z][a-z0-9+.-]*):/i.exec(a);if(!n)return!0;const i=`${n[1].toLowerCase()}:`;return!!o.includes(i)||!(!e||"data:"!==i)&&/^data:image\/(png|gif|jpe?g|webp|avif|bmp);/i.test(a)}const s={img:new Set(["width","height"]),figure:new Set(["width","margin-right"]),div:new Set(["width","max-width"])};function d(t,e){const a=s[e];return t.split(";").map((t=>t.trim())).filter((t=>{const e=t.slice(0,t.indexOf(":")).trim().toLowerCase();return!!(r.has(e)||a&&a.has(e))&&!/url\s*\(|expression\s*\(/i.test(t)})).join("; ")}function c(t){const e=t.tagName.toLowerCase(),a=n[e];for(const n of Array.from(t.attributes)){const r=n.name.toLowerCase();if((i.has(r)||void 0!==a&&a.has(r))&&!r.startsWith("on"))if("style"===r){const a=d(n.value,e);a?t.setAttribute("style",a):t.removeAttribute("style")}else"href"===r||"src"===r?l(n.value,"img"===e)||t.removeAttribute(n.name):"target"===r&&("_blank"===n.value?t.setAttribute("rel","noopener noreferrer"):t.removeAttribute("target"));else t.removeAttribute(n.name)}}function f(n){for(const i of Array.from(n.children)){const n=i.tagName.toLowerCase();e.has(n)?i.remove():"iframe"!==n||t(i.getAttribute("src")??"")?a.has(n)?(c(i),f(i)):(f(i),i.replaceWith(...Array.from(i.childNodes))):i.remove()}}function m(t){const e=(new DOMParser).parseFromString(t,"text/html");return f(e.body),e.body.innerHTML}export{l as i,m as s};
@@ -0,0 +1,2 @@
1
+ System.register(["../../index-89c520e9.cjs.js","../../index-df196058.cjs.js","../../index-cc1385e0.cjs.js","../../index-178e1e57.cjs.js"],function(_export,_context){"use strict";var t,e,l,r,a,n,i,s,o,u,c,g,_F$attrs,d,p,f,m,b,y,w,A,j,N,F,z,S,q,H,I,C,E,G,R;function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function h(t,e){var l={};for(var _e in t)l[_e]=t[_e];for(var _t in e)l[_t]=e[_t];return l;}function M(a){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;return function(o,u){var _o$selection=o.selection,c=_o$selection.$from,g=_o$selection.$to,d=c.blockRange(g);if(!d)return!1;var p=u?o.tr:null;return!!function(a,n,o){var u=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;var c=!1,g=n,d=n.$from.doc;if(n.depth>=2&&n.$from.node(n.depth-1).type.compatibleContent(o)&&0==n.startIndex){if(0==n.$from.index(n.depth-1))return!1;var _t2=d.resolve(n.start-2);g=new r(_t2,_t2,n.depth),n.endIndex<n.parent.childCount&&(n=new r(n.$from,d.resolve(n.$to.end(n.depth)),n.depth)),c=!0;}var p=i(g,o,u,n);if(!p)return!1;a&&function(r,a,n,i,o){var u=l.empty;for(var _t3=n.length-1;_t3>=0;_t3--)u=l.from(n[_t3].type.create(n[_t3].attrs,u));r.step(new t(a.start-(i?2:0),a.end,a.start,a.end,new e(u,0,0),n.length,!0));var c=0;for(var _t4=0;_t4<n.length;_t4++)n[_t4].type==o&&(c=_t4+1);var g=n.length-c,d=a.start+n.length-(i?2:0),p=a.parent;for(var _t5=a.startIndex,_e2=a.endIndex,_l=!0;_t5<_e2;_t5++,_l=!1)!_l&&s(r.doc,d,g)&&(r.split(d,g),d+=2*g),d+=p.child(_t5).nodeSize;}(a,n,p,c,o);return!0;}(p,d,a,n)&&(u&&u(p.scrollIntoView()),!0);};}function O(t,r){return function(a,n){var _a$selection=a.selection,i=_a$selection.$from,u=_a$selection.$to,c=_a$selection.node;if(c&&c.isBlock||i.depth<2||!i.sameParent(u))return!1;var g=i.node(-1);if(g.type!=t)return!1;if(0==i.parent.content.size&&i.node(-1).childCount==i.indexAfter(-1)){if(3==i.depth||i.node(-3).type!=t||i.index(-2)!=i.node(-2).childCount-1)return!1;if(n){var _r=l.empty,_s=i.index(-1)?1:i.index(-2)?2:3;for(var _t6=i.depth-_s;_t6>=i.depth-3;_t6--)_r=l.from(i.node(_t6).copy(_r));var _u=i.indexAfter(-1)<i.node(-2).childCount?1:i.indexAfter(-2)<i.node(-3).childCount?2:3;_r=_r.append(l.from(t.createAndFill()));var _c=i.before(i.depth-(_s-1)),_g=a.tr.replace(_c,i.after(-_u),new e(_r,4-_s,0)),_d=-1;_g.doc.nodesBetween(_c,_g.doc.content.size,function(t,e){if(_d>-1)return!1;t.isTextblock&&0==t.content.size&&(_d=e+1);}),_d>-1&&_g.setSelection(o.near(_g.doc.resolve(_d))),n(_g.scrollIntoView());}return!0;}var d=u.pos==i.end()?g.contentMatchAt(0).defaultType:null,p=a.tr["delete"](i.pos,u.pos),f=d?[r?{type:t,attrs:r}:null,{type:d}]:void 0;return!!s(p.doc,i.pos,2,f)&&(n&&n(p.split(i.pos,2,f).scrollIntoView()),!0);};}function D(i){return function(s,o){var _s$selection=s.selection,u=_s$selection.$from,c=_s$selection.$to,g=u.blockRange(c,function(t){return t.childCount>0&&t.firstChild.type==i;});return!!g&&(!o||(u.node(g.depth-1).type==i?function(i,s,o,u){var c=i.tr,g=u.end,d=u.$to.end(u.depth);g<d&&(c.step(new t(g-1,d,g,d,new e(l.from(o.create(null,u.parent.copy())),1,0),1,!0)),u=new r(c.doc.resolve(u.$from.pos),c.doc.resolve(d),u.depth));var p=a(u);if(null==p)return!1;c.lift(u,p);var f=c.doc.resolve(c.mapping.map(g,-1)-1);n(c.doc,f.pos)&&f.nodeBefore.type==f.nodeAfter.type&&c.join(f.pos);return s(c.scrollIntoView()),!0;}(s,o,i,g):function(r,a,n){var i=r.tr,s=n.parent;for(var _t7=n.end,_e3=n.endIndex-1,_l2=n.startIndex;_e3>_l2;_e3--)_t7-=s.child(_e3).nodeSize,i["delete"](_t7-1,_t7+1);var o=i.doc.resolve(n.start),u=o.nodeAfter;if(i.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;var c=0==n.startIndex,g=n.endIndex==s.childCount,d=o.node(-1),p=o.index(-1);if(!d.canReplace(p+(c?0:1),p+1,u.content.append(g?l.empty:l.from(s))))return!1;var f=o.pos,m=f+u.nodeSize;return i.step(new t(f-(c?1:0),m+(g?1:0),f+1,m-1,new e((c?l.empty:l.from(s.copy(l.empty))).append(g?l.empty:l.from(s.copy(l.empty))),c?0:1,g?0:1),c?0:1)),a(i.scrollIntoView()),!0;}(s,o,g)));};}function k(r){return function(a,n){var _a$selection2=a.selection,i=_a$selection2.$from,s=_a$selection2.$to,o=i.blockRange(s,function(t){return t.childCount>0&&t.firstChild.type==r;});if(!o)return!1;var u=o.startIndex;if(0==u)return!1;var c=o.parent,g=c.child(u-1);if(g.type!=r)return!1;if(n){var _i=g.lastChild&&g.lastChild.type==c.type,_s2=l.from(_i?r.create():null),_u2=new e(l.from(r.create(null,l.from(c.type.create(null,_s2)))),_i?3:1,0),_d2=o.start,_p=o.end;n(a.tr.step(new t(_d2-(_i?3:1),_p,_d2,_p,_u2,1,!0)).scrollIntoView());}return!0;};}function _(t){var e=t.style.textAlign||t.getAttribute("align")||"";return w.includes(e)?e:null;}function $(t){var e=t.style.marginInlineStart||t.style.marginLeft||"",l=parseFloat(e);return!Number.isFinite(l)||l<=0?0:Math.min(8,Math.round(l/40));}function x(t){var e=t.style.lineHeight.trim();if(!e||"normal"===e)return null;var l=parseFloat(e);return!Number.isFinite(l)||l<=0?null:e.endsWith("%")?String(l/100):e;}function v(t){var _t$align;var e=[],l=function(t){return t?"text-align: ".concat(t):null;}((_t$align=t.align)!==null&&_t$align!==void 0?_t$align:null);return l&&e.push(l),t.indent&&e.push("margin-inline-start: ".concat(40*t.indent,"px")),t.lineHeight&&e.push("line-height: ".concat(t.lineHeight)),e.length?e.join("; "):null;}_export({a:k,l:D,s:O,w:M});return{setters:[function(_index00aCjsJs){t=_index00aCjsJs.R;e=_index00aCjsJs.d;l=_index00aCjsJs.F;r=_index00aCjsJs.h;a=_index00aCjsJs.l;n=_index00aCjsJs.g;i=_index00aCjsJs.f;s=_index00aCjsJs.i;o=_index00aCjsJs.S;u=_index00aCjsJs.O;c=_index00aCjsJs.j;},function(_index001CjsJs){g=_index001CjsJs.a;},function(_index009CjsJs){},function(_index007CjsJs){}],execute:function execute(){d=["ol",0],p=["ul",0],f=["li",0],m={attrs:{order:{"default":1,validate:"number"}},parseDOM:[{tag:"ol",getAttrs:function getAttrs(t){return{order:t.hasAttribute("start")?+t.getAttribute("start"):1};}}],toDOM:function toDOM(t){return 1==t.attrs.order?d:["ol",{start:t.attrs.order},0];}},b={parseDOM:[{tag:"ul"}],toDOM:function toDOM(){return p;}},y={parseDOM:[{tag:"li"}],toDOM:function toDOM(){return f;},defining:!0};w=["left","center","right","justify"];_export("b",A=8);j={doc:{content:"block+"},paragraph:{content:"inline*",group:"block",attrs:{align:{"default":null},indent:{"default":0},lineHeight:{"default":null}},parseDOM:[{tag:"p",getAttrs:function getAttrs(t){return{align:_(t),indent:$(t),lineHeight:x(t)};}}],toDOM:function toDOM(t){var e=v(t.attrs);return e?["p",{style:e},0]:["p",0];}},heading:{content:"inline*",group:"block",defining:!0,attrs:{level:{"default":1},align:{"default":null},indent:{"default":0},lineHeight:{"default":null}},parseDOM:[1,2,3,4,5,6].map(function(t){return{tag:"h".concat(t),getAttrs:function getAttrs(e){return{level:t,align:_(e),indent:$(e),lineHeight:x(e)};}};}),toDOM:function toDOM(t){var e=v(t.attrs);return e?["h".concat(t.attrs.level),{style:e},0]:["h".concat(t.attrs.level),0];}},blockquote:{content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:function toDOM(){return["blockquote",0];}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:function toDOM(){return["hr"];}},text:{group:"inline"},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:function toDOM(){return["br"];}},code_block:{content:"text*",group:"block",marks:"",code:!0,defining:!0,attrs:{language:{"default":null}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:function getAttrs(t){return{language:t.getAttribute("data-language")};}}],toDOM:function toDOM(t){var e={"class":"nile-wysiwyg__code-block"};return t.attrs.language&&(e["data-language"]=t.attrs.language),["pre",e,["code",0]];}},image:{inline:!0,group:"inline",draggable:!0,attrs:{src:{},alt:{"default":null},title:{"default":null},width:{"default":null}},parseDOM:[{tag:"img[src]",getAttrs:function getAttrs(t){var _t$getAttribute;var e=parseFloat(t.style.width),l=parseFloat((_t$getAttribute=t.getAttribute("width"))!==null&&_t$getAttribute!==void 0?_t$getAttribute:""),r=Number.isFinite(e)?Math.round(e):Number.isFinite(l)?Math.round(l):null;return{src:t.getAttribute("src"),alt:t.getAttribute("alt"),title:t.getAttribute("title"),width:r&&r>0?r:null};}}],toDOM:function toDOM(t){var _t$attrs=t.attrs,e=_t$attrs.src,l=_t$attrs.alt,r=_t$attrs.title,a=_t$attrs.width,n={src:e};return l&&(n.alt=l),r&&(n.title=r),a&&(n.style="width: ".concat(a,"px")),["img",n];}},figure:{group:"block",content:"inline*",defining:!0,isolating:!0,attrs:{src:{},alt:{"default":null},title:{"default":null},width:{"default":null},align:{"default":null}},parseDOM:[{tag:"figure",contentElement:"figcaption",getAttrs:function getAttrs(t){var e=t.querySelector("img[src]");if(!e)return!1;var l=parseFloat(e.style.width||t.style.width),r=t.getAttribute("data-align");return{src:e.getAttribute("src"),alt:e.getAttribute("alt"),title:e.getAttribute("title"),width:Number.isFinite(l)&&l>0?Math.round(l):null,align:"left"===r||"center"===r||"right"===r?r:null};}}],toDOM:function toDOM(t){var _t$attrs2=t.attrs,e=_t$attrs2.src,l=_t$attrs2.alt,r=_t$attrs2.title,a=_t$attrs2.width,n=_t$attrs2.align,i={"class":"nile-wysiwyg__figure"};n&&(i["data-align"]=n);var s=[];a&&s.push("width: ".concat(a,"px")),"center"===n?s.push("margin-left: auto; margin-right: auto"):"right"===n&&s.push("margin-left: auto; margin-right: 0"),s.length&&(i.style=s.join("; "));var o={src:e,style:"width: 100%"};return l&&(o.alt=l),r&&(o.title=r),["figure",i,["img",o],["figcaption",{"class":"nile-wysiwyg__figcaption"},0]];}},task_list:{content:"task_item+",group:"block",parseDOM:[{tag:"ul[data-task-list]",priority:51}],toDOM:function toDOM(){return["ul",{"data-task-list":"true","class":"nile-wysiwyg__task-list"},0];}},task_item:{content:"paragraph block*",defining:!0,attrs:{checked:{"default":!1}},parseDOM:[{tag:"li[data-task-item]",priority:51,getAttrs:function getAttrs(t){return{checked:"true"===t.getAttribute("data-checked")};}}],toDOM:function toDOM(t){return["li",{"data-task-item":"true","data-checked":String(t.attrs.checked),"class":"nile-wysiwyg__task-item"},0];}},embed:{group:"block",atom:!0,selectable:!0,draggable:!0,attrs:{src:{},provider:{"default":null},title:{"default":null},width:{"default":null},align:{"default":null}},parseDOM:[{tag:"div[data-embed-provider]",getAttrs:function getAttrs(t){var _t$getAttribute2,_exec;var e=t.querySelector("iframe[src]");if(!e)return!1;var l=(_t$getAttribute2=t.getAttribute("data-width"))!==null&&_t$getAttribute2!==void 0?_t$getAttribute2:(_exec=/^(\d+)px$/.exec(t.style.width))===null||_exec===void 0?void 0:_exec[1],r=l?parseInt(l,10):NaN,a=t.getAttribute("data-align");return{src:e.getAttribute("src"),provider:t.getAttribute("data-embed-provider"),title:e.getAttribute("title"),width:Number.isFinite(r)&&r>0?r:null,align:"left"===a||"center"===a||"right"===a?a:null};}},{tag:"iframe[src]",getAttrs:function getAttrs(t){var _t$getAttribute3;var e=parseInt((_t$getAttribute3=t.getAttribute("width"))!==null&&_t$getAttribute3!==void 0?_t$getAttribute3:"",10);return{src:t.getAttribute("src"),title:t.getAttribute("title"),width:Number.isFinite(e)&&e>0?e:null};}}],toDOM:function toDOM(t){var _t$attrs3=t.attrs,e=_t$attrs3.src,l=_t$attrs3.provider,r=_t$attrs3.title,a=_t$attrs3.width,n=_t$attrs3.align,i={src:e,frameborder:"0",allowfullscreen:"true",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"};r&&(i.title=r);var s={"class":"nile-wysiwyg__embed","data-embed-provider":l!==null&&l!==void 0?l:"generic"},o=[];return a&&(s["data-width"]=String(a),o.push("width: ".concat(a,"px"),"max-width: 100%")),n&&(s["data-align"]=n,"center"===n?o.push("margin-left: auto","margin-right: auto"):"right"===n&&o.push("margin-left: auto","margin-right: 0")),o.length&&(s.style=o.join("; ")),["div",s,["iframe",i]];}},bookmark:{inline:!0,group:"inline",atom:!0,selectable:!0,attrs:{id:{}},parseDOM:[{tag:"a[data-bookmark]",priority:60,getAttrs:function getAttrs(t){var e=t.getAttribute("id")||t.getAttribute("name");return!!e&&{id:e};}},{tag:"a[id]",getAttrs:function getAttrs(t){return!t.hasAttribute("href")&&{id:t.getAttribute("id")};}},{tag:"a[name]",getAttrs:function getAttrs(t){return!t.hasAttribute("href")&&{id:t.getAttribute("name")};}}],toDOM:function toDOM(t){return["a",{id:t.attrs.id,"data-bookmark":"true"}];}},mention:{inline:!0,group:"inline",atom:!0,selectable:!0,attrs:{trigger:{"default":"@"},key:{},label:{}},parseDOM:[{tag:"span[data-mention-key]",getAttrs:function getAttrs(t){var _t$textContent;return{trigger:t.getAttribute("data-mention-trigger")||"@",key:t.getAttribute("data-mention-key"),label:t.getAttribute("data-mention-label")||((_t$textContent=t.textContent)===null||_t$textContent===void 0?void 0:_t$textContent.slice(1))||""};}}],toDOM:function toDOM(t){var _t$attrs4=t.attrs,e=_t$attrs4.trigger,l=_t$attrs4.key,r=_t$attrs4.label;return["span",{"class":"nile-wysiwyg__mention","data-mention-trigger":e,"data-mention-key":l,"data-mention-label":r},"".concat(e).concat(r)];}},merge_field:{inline:!0,group:"inline",atom:!0,selectable:!0,attrs:{id:{},label:{"default":null}},parseDOM:[{tag:"span[data-merge-field]",getAttrs:function getAttrs(t){var e=t.getAttribute("data-merge-field");return!!e&&{id:e,label:t.getAttribute("data-merge-label")||t.textContent||null};}}],toDOM:function toDOM(t){var _t$attrs5=t.attrs,e=_t$attrs5.id,l=_t$attrs5.label;return["span",{"class":"nile-wysiwyg__merge-field","data-merge-field":e,"data-merge-label":l!==null&&l!==void 0?l:""},l||"{{".concat(e,"}}")];}},math:{inline:!0,group:"inline",atom:!0,selectable:!0,attrs:{latex:{},display:{"default":"inline"}},parseDOM:[{tag:"span[data-math]",getAttrs:function getAttrs(t){return{latex:t.getAttribute("data-math")||t.textContent||"",display:"block"===t.getAttribute("data-math-display")?"block":"inline"};}}],toDOM:function toDOM(t){var _t$attrs6=t.attrs,e=_t$attrs6.latex,l=_t$attrs6.display;return["span",{"class":"nile-wysiwyg__math","data-math":e,"data-math-display":l},e];}}},N=g({tableGroup:"block",cellContent:"block+",cellAttributes:{background:{"default":null,getFromDOM:function getFromDOM(t){return t.style.backgroundColor||null;},setDOMAttr:function setDOMAttr(t,e){t&&(e.style="".concat(e.style||"","background-color: ").concat(t,";"));}}}}),F=N.table,z=_objectSpread(_objectSpread({},F),{},{attrs:_objectSpread(_objectSpread({},(_F$attrs=F.attrs)!==null&&_F$attrs!==void 0?_F$attrs:{}),{},{layout:{"default":!1}}),parseDOM:[{tag:"table",getAttrs:function getAttrs(t){return{layout:"presentation"===t.getAttribute("role")||t.hasAttribute("data-layout")};}}],toDOM:function toDOM(t){return t.attrs.layout?["table",{role:"presentation","data-layout":"true"},["tbody",0]]:["table",["tbody",0]];}}),S={link:{attrs:{href:{},title:{"default":null},target:{"default":null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:function getAttrs(t){return{href:t.getAttribute("href"),title:t.getAttribute("title"),target:t.getAttribute("target")};}}],toDOM:function toDOM(t){var _t$attrs7=t.attrs,e=_t$attrs7.href,l=_t$attrs7.title,r=_t$attrs7.target,a={href:e};return l&&(a.title=l),r&&(a.target=r,"_blank"===r&&(a.rel="noopener noreferrer")),["a",a,0];}},bold:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:function getAttrs(t){return"normal"!==t.style.fontWeight&&null;}},{style:"font-weight",getAttrs:function getAttrs(t){return /^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null;}}],toDOM:function toDOM(){return["strong",0];}},italic:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:function toDOM(){return["em",0];}},underline:{parseDOM:[{tag:"u"},{style:"text-decoration",getAttrs:function getAttrs(t){return t.includes("underline")&&null;}},{style:"text-decoration-line",getAttrs:function getAttrs(t){return t.includes("underline")&&null;}}],toDOM:function toDOM(){return["u",0];}},strike:{parseDOM:[{tag:"s"},{tag:"strike"},{tag:"del"},{style:"text-decoration",getAttrs:function getAttrs(t){return t.includes("line-through")&&null;}},{style:"text-decoration-line",getAttrs:function getAttrs(t){return t.includes("line-through")&&null;}}],toDOM:function toDOM(){return["s",0];}},subscript:{excludes:"subscript superscript",parseDOM:[{tag:"sub"},{style:"vertical-align=sub"}],toDOM:function toDOM(){return["sub",0];}},superscript:{excludes:"subscript superscript",parseDOM:[{tag:"sup"},{style:"vertical-align=super"}],toDOM:function toDOM(){return["sup",0];}},code:{parseDOM:[{tag:"code"}],toDOM:function toDOM(){return["code",{"class":"nile-wysiwyg__inline-code"},0];}},text_color:{attrs:{color:{}},parseDOM:[{style:"color",getAttrs:function getAttrs(t){return!!t&&{color:t};}}],toDOM:function toDOM(t){return["span",{style:"color: ".concat(t.attrs.color)},0];}},bg_color:{attrs:{color:{}},parseDOM:[{style:"background-color",getAttrs:function getAttrs(t){return!(!t||"transparent"===t)&&{color:t};}}],toDOM:function toDOM(t){return["span",{style:"background-color: ".concat(t.attrs.color)},0];}},font_family:{attrs:{family:{}},parseDOM:[{style:"font-family",getAttrs:function getAttrs(t){return!!t&&{family:t};}}],toDOM:function toDOM(t){return["span",{style:"font-family: ".concat(t.attrs.family)},0];}},font_size:{attrs:{size:{}},parseDOM:[{style:"font-size",getAttrs:function getAttrs(t){return!!t&&{size:t};}}],toDOM:function toDOM(t){return["span",{style:"font-size: ".concat(t.attrs.size)},0];}}},q=["disc","circle","square"],H={1:"decimal",a:"lower-alpha",A:"upper-alpha",i:"lower-roman",I:"upper-roman"},I=Object.fromEntries(Object.entries(H).map(function(_ref){var _ref2=_slicedToArray(_ref,2),t=_ref2[0],e=_ref2[1];return[e,t];})),_export("M",C="multilevel"),E={content:"list_item+",group:"block",attrs:{style:{"default":null}},parseDOM:[{tag:"ul",getAttrs:function getAttrs(t){var e=t.style.listStyleType;return{style:q.includes(e)?e:null};}}],toDOM:function toDOM(t){return t.attrs.style?["ul",{style:"list-style-type: ".concat(t.attrs.style)},0]:["ul",0];}},G={content:"list_item+",group:"block",attrs:{order:{"default":1},style:{"default":null}},parseDOM:[{tag:"ol",getAttrs:function getAttrs(t){var _t$getAttribute4,_H$e;var e=(_t$getAttribute4=t.getAttribute("type"))!==null&&_t$getAttribute4!==void 0?_t$getAttribute4:"",l=t.style.listStyleType,r=t.getAttribute("data-list-style")===C?C:(_H$e=H[e])!==null&&_H$e!==void 0?_H$e:Object.values(H).includes(l)?l:null,a=Number(t.getAttribute("start"));return{order:Number.isFinite(a)&&a>0?a:1,style:r};}}],toDOM:function toDOM(t){var e={};return 1!==t.attrs.order&&(e.start=String(t.attrs.order)),t.attrs.style===C?e["data-list-style"]=C:t.attrs.style&&I[t.attrs.style]&&(e.type=I[t.attrs.style]),["ol",e,0];}};_export("d",R=function(){var t=function(t,e,l){return t.append({ordered_list:h(m,{content:"list_item+",group:l}),bullet_list:h(b,{content:"list_item+",group:l}),list_item:h(y,{content:e})});}(u.from(j),"paragraph block*","block").update("bullet_list",E).update("ordered_list",G).append(N).update("table",z);return new c({nodes:t,marks:u.from(S)});}());}};});
2
+ //# sourceMappingURL=schema.cjs.js.map