@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":"commands.js","sourceRoot":"","sources":["../../../../src/nile-wysiwyg-editor/engine/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EACL,YAAY,EACZ,WAAW,EACX,eAAe,EACf,cAAc,EACd,SAAS,EACT,YAAY,EACZ,WAAW,EACX,UAAU,EACV,SAAS,EACT,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAwB,aAAa,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGvF,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,UA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C;QACpC,KAAK,aAAa;YAChB,OAAO,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QACpC,KAAK,aAAa;YAChB,OAAO,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QACpC,KAAK,cAAc;YACjB,OAAO,YAAY,CAAC;QACtB,KAAK,aAAa;YAChB,OAAO,WAAW,CAAC;QACrB,KAAK,iBAAiB;YACpB,OAAO,eAAe,CAAC;QACzB,KAAK,gBAAgB;YACnB,OAAO,cAAc,CAAC;QACxB,KAAK,WAAW;YACd,OAAO,SAAS,CAAC;QACnB,KAAK,cAAc;YACjB,OAAO,YAAY,CAAC;QACtB,KAAK,YAAY;YACf,OAAO,UAAU,CAAC;QACpB,KAAK,WAAW;YACd,OAAO,SAAS,CAAC;QACnB,KAAK,iBAAiB;YACpB,OAAO,eAAe,CAAC;QACzB,KAAK,mBAAmB;YACtB,OAAO,iBAAiB,EAAE,CAAC;QAC7B,KAAK,aAAa;YAChB,OAAO,WAAW,CAAC;QACrB,KAAK,YAAY;YACf,OAAO,UAAU,CAAC,KAAK,CAAC,QAAQ,IAAI,OAAO,CAAC,CAAC;QAC/C,KAAK,kBAAkB;YACrB,OAAO,gBAAgB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QACzC,KAAK,YAAY;YACf,OAAO,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QACnC;YACE,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC","sourcesContent":["import { toggleMark, setBlockType, wrapIn, lift, chainCommands } from 'prosemirror-commands';\nimport { wrapInList, liftListItem, sinkListItem } from 'prosemirror-schema-list';\nimport { undo, redo } from 'prosemirror-history';\nimport {\n addRowBefore,\n addRowAfter,\n addColumnBefore,\n addColumnAfter,\n deleteRow,\n deleteColumn,\n deleteTable,\n mergeCells,\n splitCell,\n toggleHeaderRow,\n} from 'prosemirror-tables';\nimport { Command, EditorState, TextSelection, NodeSelection } from 'prosemirror-state';\nimport { MarkType, NodeType, ResolvedPos, Attrs, Schema, Node as PMNode, Mark } from 'prosemirror-model';\nimport type { Alignment } from './schema';\nimport { MAX_INDENT, MULTILEVEL_STYLE } from './schema';\n\nexport type CommandName =\n | 'bold'\n | 'italic'\n | 'underline'\n | 'strike'\n | 'subscript'\n | 'superscript'\n | 'code'\n | 'paragraph'\n | 'heading'\n | 'blockquote'\n | 'align'\n | 'lineHeight'\n | 'bulletList'\n | 'orderedList'\n | 'taskList'\n | 'indent'\n | 'outdent'\n | 'setListStyle'\n | 'setListStart'\n | 'toggleImageCaption'\n | 'setImageAlign'\n | 'setImageWidth'\n | 'deleteImage'\n | 'updateImage'\n | 'setEmbedAlign'\n | 'deleteEmbed'\n | 'link'\n | 'unlink'\n | 'insertBookmark'\n | 'textColor'\n | 'bgColor'\n | 'fontFamily'\n | 'fontSize'\n | 'horizontalRule'\n | 'clearFormatting'\n | 'undo'\n | 'redo'\n | 'codeBlock'\n | 'setCodeBlockLanguage'\n | 'insertEmbed'\n | 'insertImage'\n | 'insertTable'\n | 'addRowBefore'\n | 'addRowAfter'\n | 'addColumnBefore'\n | 'addColumnAfter'\n | 'deleteRow'\n | 'deleteColumn'\n | 'mergeCells'\n | 'splitCell'\n | 'toggleHeaderRow'\n | 'toggleLayoutTable'\n | 'deleteTable'\n | 'changeCase'\n | 'insertMergeField'\n | 'insertMath';\n\nexport interface CommandAttrs {\n level?: number;\n align?: Alignment | null;\n href?: string;\n title?: string;\n target?: string | null;\n color?: string | null;\n family?: string | null;\n size?: string | null;\n /** insertImage / updateImage */\n src?: string;\n alt?: string | null;\n /** insertImage / updateImage: figcaption text; empty/null = plain inline image */\n caption?: string | null;\n /** insertTable */\n rows?: number;\n cols?: number;\n withHeaderRow?: boolean;\n /** codeBlock */\n language?: string | null;\n /** insertEmbed */\n provider?: string | null;\n /** setListStyle: a CSS list-style-type, null = default */\n style?: string | null;\n /** setListStart */\n start?: number;\n /** setImageWidth: px, null = natural size */\n width?: number | null;\n /** lineHeight: unitless multiplier ('1.5'), null = default */\n lineHeight?: string | null;\n /** insertBookmark / insertMergeField: the anchor or field id */\n id?: string;\n /** changeCase: which transform to apply */\n textCase?: 'upper' | 'lower' | 'title' | 'sentence';\n /** insertMergeField: human-readable label */\n label?: string | null;\n /** insertMath: LaTeX source */\n latex?: string;\n /** insertMath: inline vs block presentation */\n mathDisplay?: 'inline' | 'block';\n}\n\n/** Finds the extent of a mark around a resolved position (cursor in a link). */\nexport function getMarkRange(\n $pos: ResolvedPos,\n markType: MarkType\n): { from: number; to: number } | null {\n const { parent, parentOffset } = $pos;\n const start = parent.childAfter(parentOffset);\n if (!start.node || !markType.isInSet(start.node.marks)) return null;\n\n let startIndex = start.index;\n let from = $pos.start() + start.offset;\n while (startIndex > 0 && markType.isInSet(parent.child(startIndex - 1).marks)) {\n startIndex -= 1;\n from -= parent.child(startIndex).nodeSize;\n }\n let endIndex = start.index + 1;\n let to = from + start.node.nodeSize;\n while (endIndex < parent.childCount && markType.isInSet(parent.child(endIndex).marks)) {\n to += parent.child(endIndex).nodeSize;\n endIndex += 1;\n }\n return { from, to };\n}\n\n/**\n * Sets (attrs given) or removes (attrs null) an attribute-carrying mark such\n * as text color or font size. On an empty selection the mark is stored so it\n * applies to the next typed text.\n */\nfunction setAttrMark(markType: MarkType, attrs: Attrs | null): Command {\n return (state, dispatch) => {\n const { empty, ranges, $from } = state.selection;\n if (empty && !(state.selection instanceof TextSelection && state.selection.$cursor)) {\n return false;\n }\n if (!empty && !state.selection.content().content.firstChild) return false;\n if (dispatch) {\n const tr = state.tr;\n if (empty) {\n tr.removeStoredMark(markType);\n if (attrs) tr.addStoredMark(markType.create(attrs));\n } else {\n for (const range of ranges) {\n tr.removeMark(range.$from.pos, range.$to.pos, markType);\n if (attrs) tr.addMark(range.$from.pos, range.$to.pos, markType.create(attrs));\n }\n tr.scrollIntoView();\n }\n dispatch(tr);\n }\n return true;\n };\n}\n\n/** Applies a link mark over the selection, or over the link under the cursor. */\nfunction setLink(markType: MarkType, attrs: CommandAttrs): Command {\n return (state, dispatch) => {\n if (!attrs.href) return false;\n const { empty, $from, from, to } = state.selection;\n let range = { from, to };\n if (empty) {\n const existing = getMarkRange($from, markType);\n if (!existing) return false;\n range = existing;\n }\n if (dispatch) {\n const tr = state.tr;\n tr.removeMark(range.from, range.to, markType);\n tr.addMark(\n range.from,\n range.to,\n markType.create({\n href: attrs.href,\n title: attrs.title ?? null,\n target: attrs.target ?? null,\n })\n );\n dispatch(tr.scrollIntoView());\n }\n return true;\n };\n}\n\n/** Removes the link mark from the selection or the link under the cursor. */\nfunction unsetLink(markType: MarkType): Command {\n return (state, dispatch) => {\n const { empty, $from, from, to } = state.selection;\n let range = { from, to };\n if (empty) {\n const existing = getMarkRange($from, markType);\n if (!existing) return false;\n range = existing;\n } else if (!state.doc.rangeHasMark(from, to, markType)) {\n return false;\n }\n if (dispatch) {\n dispatch(state.tr.removeMark(range.from, range.to, markType));\n }\n return true;\n };\n}\n\nfunction findParentList(\n state: EditorState\n): { node: import('prosemirror-model').Node; pos: number; depth: number } | null {\n const { $from } = state.selection;\n const { bullet_list: bullet, ordered_list: ordered, task_list: task } = state.schema.nodes;\n for (let depth = $from.depth; depth > 0; depth -= 1) {\n const node = $from.node(depth);\n if (node.type === bullet || node.type === ordered || node.type === task) {\n return { node, pos: $from.before(depth), depth };\n }\n }\n return null;\n}\n\n/** The item node type a given list type expects as children. */\nfunction itemTypeFor(listType: NodeType): NodeType {\n const { schema } = listType;\n return listType === schema.nodes.task_list\n ? schema.nodes.task_item\n : schema.nodes.list_item;\n}\n\n/**\n * Toggles a list: wraps when outside, lifts when already in the same list\n * type, converts in place when in another list type. Conversion also remaps\n * the item nodes (list_item <-> task_item) so the content stays valid.\n */\nfunction toggleList(listType: NodeType, itemType: NodeType): Command {\n return (state, dispatch, view) => {\n const parentList = findParentList(state);\n if (parentList) {\n if (parentList.node.type === listType) {\n return liftListItem(itemTypeFor(parentList.node.type))(state, dispatch, view);\n }\n if (dispatch) {\n // Build the fully converted list and swap it in one step — converting\n // the list node or its items separately fails content validation.\n const fromItem = itemTypeFor(parentList.node.type);\n const items: import('prosemirror-model').Node[] = [];\n parentList.node.forEach(child => {\n items.push(\n child.type === fromItem && fromItem !== itemType\n ? itemType.create(null, child.content, child.marks)\n : child\n );\n });\n const converted = listType.create(parentList.node.attrs, items);\n const tr = state.tr;\n const { from, to } = state.selection;\n tr.replaceWith(\n parentList.pos,\n parentList.pos + parentList.node.nodeSize,\n converted\n );\n // Item node sizes are identical, so the old positions stay valid.\n tr.setSelection(TextSelection.create(tr.doc, from, to));\n dispatch(tr);\n }\n return true;\n }\n return wrapInList(listType)(state, dispatch, view);\n };\n}\n\nfunction isInNode(state: EditorState, type: NodeType): boolean {\n const { $from } = state.selection;\n for (let depth = $from.depth; depth > 0; depth -= 1) {\n if ($from.node(depth).type === type) return true;\n }\n return false;\n}\n\n/** Wraps in blockquote, or lifts out when already inside one. */\nfunction toggleBlockquote(type: NodeType): Command {\n return (state, dispatch, view) => {\n if (isInNode(state, type)) return lift(state, dispatch, view);\n return wrapIn(type)(state, dispatch, view);\n };\n}\n\n/** Sets the `align` attribute on every textblock in the selection. */\nfunction setAlignment(align: Alignment | null): Command {\n return (state, dispatch) => {\n const { from, to } = state.selection;\n const targets: { pos: number; node: import('prosemirror-model').Node }[] = [];\n state.doc.nodesBetween(from, to, (node, pos) => {\n if (node.isTextblock && node.type.spec.attrs && 'align' in node.type.spec.attrs) {\n targets.push({ pos, node });\n }\n return true;\n });\n if (targets.length === 0) return false;\n if (dispatch) {\n const tr = state.tr;\n for (const { pos, node } of targets) {\n tr.setNodeMarkup(pos, undefined, { ...node.attrs, align });\n }\n dispatch(tr);\n }\n return true;\n };\n}\n\n/** Sets the `lineHeight` attribute on every textblock in the selection. */\nfunction setLineHeight(lineHeight: string | null): Command {\n return (state, dispatch) => {\n const { from, to } = state.selection;\n const targets: { pos: number; node: PMNode }[] = [];\n state.doc.nodesBetween(from, to, (node, pos) => {\n if (node.isTextblock && node.type.spec.attrs && 'lineHeight' in node.type.spec.attrs) {\n targets.push({ pos, node });\n }\n return true;\n });\n if (targets.length === 0) return false;\n if (dispatch) {\n const tr = state.tr;\n for (const { pos, node } of targets) {\n tr.setNodeMarkup(pos, undefined, { ...node.attrs, lineHeight });\n }\n dispatch(tr);\n }\n return true;\n };\n}\n\n/** Inserts a named in-text anchor (bookmark) at the selection. */\nfunction insertBookmark(schema: Schema, attrs: CommandAttrs): Command {\n return (state, dispatch) => {\n const id = attrs.id?.trim();\n if (!id) return false;\n if (dispatch) {\n const bookmark = schema.nodes.bookmark.create({ id });\n dispatch(state.tr.replaceSelectionWith(bookmark, false).scrollIntoView());\n }\n return true;\n };\n}\n\n/** Toggles the surrounding table between content and layout (presentation) mode. */\nfunction toggleLayoutTable(): Command {\n return (state, dispatch) => {\n const { $from } = state.selection;\n for (let depth = $from.depth; depth > 0; depth -= 1) {\n const node = $from.node(depth);\n if (node.type === state.schema.nodes.table) {\n if (dispatch) {\n dispatch(\n state.tr.setNodeMarkup($from.before(depth), undefined, {\n ...node.attrs,\n layout: !node.attrs.layout,\n })\n );\n }\n return true;\n }\n }\n return false;\n };\n}\n\nfunction insertHorizontalRule(type: NodeType): Command {\n return (state, dispatch) => {\n if (dispatch) {\n dispatch(state.tr.replaceSelectionWith(type.create()).scrollIntoView());\n }\n return true;\n };\n}\n\n/** Toggles between code block and paragraph. */\nfunction toggleCodeBlock(schema: Schema, language: string | null): Command {\n return (state, dispatch, view) => {\n const { $from } = state.selection;\n if ($from.parent.type === schema.nodes.code_block) {\n return setBlockType(schema.nodes.paragraph)(state, dispatch, view);\n }\n return setBlockType(schema.nodes.code_block, { language })(state, dispatch, view);\n };\n}\n\n/** Updates the language attr of the code block around the selection. */\nfunction setCodeBlockLanguage(schema: Schema, language: string | null): Command {\n return (state, dispatch) => {\n const { $from } = state.selection;\n for (let depth = $from.depth; depth > 0; depth -= 1) {\n if ($from.node(depth).type === schema.nodes.code_block) {\n if (dispatch) {\n dispatch(\n state.tr.setNodeMarkup($from.before(depth), undefined, { language })\n );\n }\n return true;\n }\n }\n return false;\n };\n}\n\n/** Inserts a provider embed. The src must already be an embed URL. */\nfunction insertEmbed(schema: Schema, attrs: CommandAttrs): Command {\n return (state, dispatch) => {\n if (!attrs.src) return false;\n const embed = schema.nodes.embed.create({\n src: attrs.src,\n provider: attrs.provider ?? null,\n title: attrs.title ?? null,\n });\n if (dispatch) {\n dispatch(state.tr.replaceSelectionWith(embed).scrollIntoView());\n }\n return true;\n };\n}\n\n/**\n * Inserts an image at the selection. With a non-empty caption it inserts a\n * captioned `figure` (like the alt/caption flow in toggleImageCaption);\n * otherwise a plain inline `image`.\n */\nfunction insertImage(schema: Schema, attrs: CommandAttrs): Command {\n return (state, dispatch) => {\n if (!attrs.src) return false;\n const src = attrs.src;\n const alt = attrs.alt ?? null;\n const title = attrs.title ?? null;\n const caption = attrs.caption != null ? String(attrs.caption).trim() : '';\n const node = caption\n ? schema.nodes.figure.create({ src, alt, title, width: null, align: null }, schema.text(caption))\n : schema.nodes.image.create({ src, alt, title });\n if (dispatch) {\n dispatch(state.tr.replaceSelectionWith(node).scrollIntoView());\n }\n return true;\n };\n}\n\n/**\n * Updates the selected image/figure's src, alt and caption in place. A\n * non-empty caption promotes an inline image to a captioned figure; an empty\n * caption demotes a figure back to an inline image. Width/alignment are kept.\n */\nfunction updateImage(schema: Schema, attrs: CommandAttrs): Command {\n return (state, dispatch) => {\n const info = selectedImageInfo(state);\n if (!info || !attrs.src) return false;\n const src = attrs.src;\n const alt = attrs.alt ?? null;\n const title = attrs.title ?? null;\n const caption = attrs.caption != null ? String(attrs.caption).trim() : '';\n const width = info.node.attrs.width ?? null;\n const align = info.isFigure ? info.node.attrs.align ?? null : null;\n if (dispatch) {\n const tr = state.tr;\n if (caption) {\n const figure = schema.nodes.figure.create(\n { src, alt, title, width, align },\n schema.text(caption)\n );\n if (info.isFigure) {\n tr.replaceWith(info.pos, info.pos + info.node.nodeSize, figure);\n tr.setSelection(NodeSelection.create(tr.doc, info.pos));\n } else {\n const $pos = state.doc.resolve(info.pos);\n const parent = $pos.parent;\n const replaceWhole = parent.childCount === 1 && parent.type.name === 'paragraph';\n const from = replaceWhole ? $pos.before() : info.pos;\n const to = replaceWhole ? $pos.after() : info.pos + info.node.nodeSize;\n tr.replaceWith(from, to, figure);\n tr.setSelection(NodeSelection.create(tr.doc, from));\n }\n } else if (info.isFigure) {\n const image = schema.nodes.image.create({ src, alt, title, width });\n tr.replaceWith(\n info.pos,\n info.pos + info.node.nodeSize,\n schema.nodes.paragraph.create(null, image)\n );\n tr.setSelection(NodeSelection.create(tr.doc, info.pos + 1));\n } else {\n tr.setNodeMarkup(info.pos, undefined, { src, alt, title, width });\n if (state.selection instanceof NodeSelection) {\n tr.setSelection(NodeSelection.create(tr.doc, info.pos));\n }\n }\n dispatch(tr.scrollIntoView());\n }\n return true;\n };\n}\n\n/** Inserts an empty rows × cols table, optionally with a header row. */\nfunction insertTable(schema: Schema, attrs: CommandAttrs): Command {\n const rows = Math.max(1, attrs.rows ?? 3);\n const cols = Math.max(1, attrs.cols ?? 3);\n const withHeaderRow = attrs.withHeaderRow ?? true;\n return (state, dispatch) => {\n const { table, table_row: tableRow, table_cell: cell, table_header: header } =\n schema.nodes;\n const rowNodes = [];\n for (let r = 0; r < rows; r += 1) {\n const cellType = r === 0 && withHeaderRow ? header : cell;\n const cells = [];\n for (let c = 0; c < cols; c += 1) {\n cells.push(cellType.createAndFill()!);\n }\n rowNodes.push(tableRow.create(null, cells));\n }\n if (dispatch) {\n dispatch(state.tr.replaceSelectionWith(table.create(null, rowNodes)).scrollIntoView());\n }\n return true;\n };\n}\n\n/**\n * Adjusts the `indent` attr on textblocks in the selection by ±1 step.\n * Returns false when nothing can change (e.g. outdent at level 0), letting\n * chained commands (blockquote lift) take over.\n */\nfunction changeBlockIndent(delta: number): Command {\n return (state, dispatch) => {\n const { from, to } = state.selection;\n const targets: { pos: number; node: PMNode; next: number }[] = [];\n state.doc.nodesBetween(from, to, (node, pos) => {\n if (node.isTextblock && node.type.spec.attrs && 'indent' in node.type.spec.attrs) {\n const current = (node.attrs.indent as number) ?? 0;\n const next = Math.max(0, Math.min(MAX_INDENT, current + delta));\n if (next !== current) targets.push({ pos, node, next });\n }\n return true;\n });\n if (targets.length === 0) return false;\n if (dispatch) {\n const tr = state.tr;\n for (const { pos, node, next } of targets) {\n tr.setNodeMarkup(pos, undefined, { ...node.attrs, indent: next });\n }\n dispatch(tr);\n }\n return true;\n };\n}\n\n/** Sets the marker style (list-style-type) on the surrounding list. */\nfunction setListStyle(style: string | null): Command {\n return (state, dispatch) => {\n const parentList = findParentList(state);\n if (!parentList) return false;\n let target = parentList;\n // Multilevel (legal) numbering covers the whole tree from the outermost\n // ordered list: apply it there, and clear it from wherever it sits.\n const { $from } = state.selection;\n const ordered = state.schema.nodes.ordered_list;\n for (let depth = 1; depth <= $from.depth; depth += 1) {\n const node = $from.node(depth);\n if (\n node.type === ordered &&\n (style === MULTILEVEL_STYLE || node.attrs.style === MULTILEVEL_STYLE)\n ) {\n target = { node, pos: $from.before(depth), depth };\n break;\n }\n }\n if (dispatch) {\n dispatch(\n state.tr.setNodeMarkup(target.pos, undefined, {\n ...target.node.attrs,\n style,\n })\n );\n }\n return true;\n };\n}\n\n/** Sets the start number of the surrounding ordered list. */\nfunction setListStart(start: number): Command {\n return (state, dispatch) => {\n const parentList = findParentList(state);\n if (!parentList || parentList.node.type !== state.schema.nodes.ordered_list) {\n return false;\n }\n if (dispatch) {\n dispatch(\n state.tr.setNodeMarkup(parentList.pos, undefined, {\n ...parentList.node.attrs,\n order: Math.max(1, Math.round(start)),\n })\n );\n }\n return true;\n };\n}\n\n/**\n * The image (inline `image` or block `figure`) the selection points at:\n * a NodeSelection on either type, or a cursor inside a figure's caption.\n */\nexport function selectedImageInfo(\n state: EditorState\n): { node: PMNode; pos: number; isFigure: boolean } | null {\n const { image, figure } = state.schema.nodes;\n const sel = state.selection;\n if (sel instanceof NodeSelection) {\n if (sel.node.type === image) return { node: sel.node, pos: sel.from, isFigure: false };\n if (sel.node.type === figure) return { node: sel.node, pos: sel.from, isFigure: true };\n }\n const { $from } = sel;\n for (let depth = $from.depth; depth > 0; depth -= 1) {\n if ($from.node(depth).type === figure) {\n return { node: $from.node(depth), pos: $from.before(depth), isFigure: true };\n }\n }\n return null;\n}\n\n/**\n * Toggles the caption: inline image → figure (caption prefilled from alt,\n * cursor placed inside), figure → plain inline image (caption dropped).\n */\nfunction toggleImageCaption(schema: Schema): Command {\n return (state, dispatch) => {\n const info = selectedImageInfo(state);\n if (!info) return false;\n if (dispatch) {\n const tr = state.tr;\n if (info.isFigure) {\n const { src, alt, title, width } = info.node.attrs;\n const image = schema.nodes.image.create({ src, alt, title, width });\n tr.replaceWith(\n info.pos,\n info.pos + info.node.nodeSize,\n schema.nodes.paragraph.create(null, image)\n );\n tr.setSelection(NodeSelection.create(tr.doc, info.pos + 1));\n } else {\n const { src, alt, title, width } = info.node.attrs;\n const caption = alt ? schema.text(alt) : null;\n const figure = schema.nodes.figure.create(\n { src, alt, title, width, align: null },\n caption\n );\n // An inline image sits inside a textblock; if it is the block's only\n // child, replace the whole block, otherwise just the image.\n const $pos = state.doc.resolve(info.pos);\n const parent = $pos.parent;\n const replaceWhole = parent.childCount === 1 && parent.type.name === 'paragraph';\n const from = replaceWhole ? $pos.before() : info.pos;\n const to = replaceWhole ? $pos.after() : info.pos + info.node.nodeSize;\n tr.replaceWith(from, to, figure);\n // Cursor into the caption (figure start + 1).\n tr.setSelection(TextSelection.create(tr.doc, from + 1 + figure.content.size));\n }\n dispatch(tr.scrollIntoView());\n }\n return true;\n };\n}\n\n/**\n * Aligns the selected image. Inline images are promoted to a figure first,\n * since alignment is a block concept.\n */\nfunction setImageAlign(schema: Schema, align: string | null): Command {\n return (state, dispatch) => {\n const info = selectedImageInfo(state);\n if (!info) return false;\n const clamped =\n align === 'left' || align === 'center' || align === 'right' ? align : null;\n if (dispatch) {\n const tr = state.tr;\n if (info.isFigure) {\n tr.setNodeMarkup(info.pos, undefined, { ...info.node.attrs, align: clamped });\n if (state.selection instanceof NodeSelection) {\n tr.setSelection(NodeSelection.create(tr.doc, info.pos));\n }\n } else {\n const { src, alt, title, width } = info.node.attrs;\n const figure = schema.nodes.figure.create({ src, alt, title, width, align: clamped });\n const $pos = state.doc.resolve(info.pos);\n const parent = $pos.parent;\n const replaceWhole = parent.childCount === 1 && parent.type.name === 'paragraph';\n const from = replaceWhole ? $pos.before() : info.pos;\n const to = replaceWhole ? $pos.after() : info.pos + info.node.nodeSize;\n tr.replaceWith(from, to, figure);\n tr.setSelection(NodeSelection.create(tr.doc, from));\n }\n dispatch(tr.scrollIntoView());\n }\n return true;\n };\n}\n\n/** Sets the display width (px) of the selected image or figure. */\nfunction setImageWidth(width: number | null): Command {\n return (state, dispatch) => {\n const info = selectedImageInfo(state);\n if (!info) return false;\n if (dispatch) {\n const tr = state.tr.setNodeMarkup(info.pos, undefined, {\n ...info.node.attrs,\n width: width && width > 0 ? Math.round(width) : null,\n });\n // setNodeMarkup degrades a NodeSelection — restore it so follow-up\n // image commands still see the node as selected.\n if (state.selection instanceof NodeSelection) {\n tr.setSelection(NodeSelection.create(tr.doc, info.pos));\n }\n dispatch(tr);\n }\n return true;\n };\n}\n\n/** Deletes the selected image or the figure around the cursor. */\nfunction deleteImage(): Command {\n return (state, dispatch) => {\n const info = selectedImageInfo(state);\n if (!info) return false;\n if (dispatch) {\n dispatch(\n state.tr.delete(info.pos, info.pos + info.node.nodeSize).scrollIntoView()\n );\n }\n return true;\n };\n}\n\n/** The selected embed node (a NodeSelection on an `embed`), or null. */\nexport function selectedEmbedInfo(\n state: EditorState\n): { node: PMNode; pos: number } | null {\n const sel = state.selection;\n if (sel instanceof NodeSelection && sel.node.type === state.schema.nodes.embed) {\n return { node: sel.node, pos: sel.from };\n }\n return null;\n}\n\n/** Aligns the selected video embed (left/center/right, or null to reset). */\nfunction setEmbedAlign(align: string | null): Command {\n return (state, dispatch) => {\n const info = selectedEmbedInfo(state);\n if (!info) return false;\n const clamped =\n align === 'left' || align === 'center' || align === 'right' ? align : null;\n if (dispatch) {\n const tr = state.tr.setNodeMarkup(info.pos, undefined, {\n ...info.node.attrs,\n align: clamped,\n });\n // setNodeMarkup degrades a NodeSelection — restore it so follow-up\n // align commands still see the embed as selected.\n tr.setSelection(NodeSelection.create(tr.doc, info.pos));\n dispatch(tr.scrollIntoView());\n }\n return true;\n };\n}\n\n/** Deletes the selected video embed. */\nfunction deleteEmbed(): Command {\n return (state, dispatch) => {\n const info = selectedEmbedInfo(state);\n if (!info) return false;\n if (dispatch) {\n dispatch(state.tr.delete(info.pos, info.pos + info.node.nodeSize).scrollIntoView());\n }\n return true;\n };\n}\n\n/** Strips all marks and stored marks from the selection. */\nfunction clearFormatting(): Command {\n return (state, dispatch) => {\n const { from, to, empty } = state.selection;\n if (dispatch) {\n const tr = state.tr;\n if (!empty) tr.removeMark(from, to, null);\n tr.setStoredMarks([]);\n // Also reset alignment and line height on touched textblocks.\n state.doc.nodesBetween(from, to, (node, pos) => {\n if (\n node.isTextblock &&\n node.type.spec.attrs &&\n 'align' in node.type.spec.attrs &&\n (node.attrs.align || node.attrs.lineHeight)\n ) {\n tr.setNodeMarkup(pos, undefined, { ...node.attrs, align: null, lineHeight: null });\n }\n return true;\n });\n dispatch(tr);\n }\n return true;\n };\n}\n\n/** Transforms a string per the case mode. Title/sentence are word-aware. */\nfunction transformCase(text: string, mode: 'upper' | 'lower' | 'title' | 'sentence'): string {\n switch (mode) {\n case 'upper':\n return text.toUpperCase();\n case 'lower':\n return text.toLowerCase();\n case 'title':\n // Capitalize the first letter of each word run.\n return text.toLowerCase().replace(/(^|\\s)(\\p{L})/gu, (_m, sep, ch) => sep + ch.toUpperCase());\n case 'sentence':\n // Capitalize the first letter after start or sentence-ending punctuation.\n return text\n .toLowerCase()\n .replace(/(^|[.!?]\\s+)(\\p{L})/gu, (_m, sep, ch) => sep + ch.toUpperCase());\n }\n}\n\n/**\n * Changes the case of the selected text, preserving marks. No-op on an empty\n * selection. Replacements run back-to-front so earlier positions stay valid.\n */\nfunction changeCase(mode: 'upper' | 'lower' | 'title' | 'sentence'): Command {\n return (state, dispatch) => {\n const { from, to, empty } = state.selection;\n if (empty) return false;\n const edits: { from: number; to: number; text: string; marks: readonly Mark[] }[] = [];\n state.doc.nodesBetween(from, to, (node, pos) => {\n if (!node.isText || !node.text) return;\n const start = Math.max(from, pos);\n const end = Math.min(to, pos + node.nodeSize);\n if (start >= end) return;\n const slice = node.text.slice(start - pos, end - pos);\n const next = transformCase(slice, mode);\n if (next !== slice) edits.push({ from: start, to: end, text: next, marks: node.marks });\n });\n if (edits.length === 0) return false;\n if (dispatch) {\n const tr = state.tr;\n for (const edit of edits.reverse()) {\n tr.replaceWith(edit.from, edit.to, state.schema.text(edit.text, edit.marks));\n }\n dispatch(tr.scrollIntoView());\n }\n return true;\n };\n}\n\n/** Inserts a merge-field atom at the selection. */\nfunction insertMergeField(schema: Schema, attrs: CommandAttrs): Command {\n return (state, dispatch) => {\n const type = schema.nodes.merge_field;\n if (!type || !attrs.id) return false;\n if (dispatch) {\n const node = type.create({ id: attrs.id, label: attrs.label ?? null });\n dispatch(state.tr.replaceSelectionWith(node).scrollIntoView());\n }\n return true;\n };\n}\n\n/** Inserts a math atom at the selection. */\nfunction insertMath(schema: Schema, attrs: CommandAttrs): Command {\n return (state, dispatch) => {\n const type = schema.nodes.math;\n const latex = (attrs.latex ?? '').trim();\n if (!type || !latex) return false;\n if (dispatch) {\n const node = type.create({ latex, display: attrs.mathDisplay ?? 'inline' });\n dispatch(state.tr.replaceSelectionWith(node).scrollIntoView());\n }\n return true;\n };\n}\n\n/**\n * Resolves a named command against a schema. Returns null for unknown names\n * so callers can treat the registry as data.\n */\nexport function getCommand(\n state: EditorState,\n name: CommandName,\n attrs: CommandAttrs = {}\n): Command | null {\n const { schema } = state;\n const { nodes, marks } = schema;\n switch (name) {\n case 'bold':\n return toggleMark(marks.bold);\n case 'italic':\n return toggleMark(marks.italic);\n case 'underline':\n return toggleMark(marks.underline);\n case 'strike':\n return toggleMark(marks.strike);\n case 'subscript':\n return toggleMark(marks.subscript);\n case 'superscript':\n return toggleMark(marks.superscript);\n case 'code':\n return toggleMark(marks.code);\n case 'paragraph':\n return setBlockType(nodes.paragraph);\n case 'heading':\n return setBlockType(nodes.heading, { level: attrs.level ?? 1 });\n case 'blockquote':\n return toggleBlockquote(nodes.blockquote);\n case 'align':\n return setAlignment(attrs.align ?? null);\n case 'lineHeight':\n return setLineHeight(attrs.lineHeight ?? null);\n case 'bulletList':\n return toggleList(nodes.bullet_list, nodes.list_item);\n case 'orderedList':\n return toggleList(nodes.ordered_list, nodes.list_item);\n case 'taskList':\n return toggleList(nodes.task_list, nodes.task_item);\n case 'indent':\n // List item sink first, then paragraph/heading margin indent.\n return chainCommands(\n sinkListItem(nodes.task_item),\n sinkListItem(nodes.list_item),\n changeBlockIndent(1)\n );\n case 'outdent':\n // List lift, then margin outdent, then blockquote lift.\n return chainCommands(\n liftListItem(nodes.task_item),\n liftListItem(nodes.list_item),\n changeBlockIndent(-1),\n lift\n );\n case 'setListStyle':\n return setListStyle(attrs.style ?? null);\n case 'setListStart':\n return setListStart(attrs.start ?? 1);\n case 'toggleImageCaption':\n return toggleImageCaption(schema);\n case 'setImageAlign':\n return setImageAlign(schema, (attrs.align as string | null) ?? null);\n case 'setImageWidth':\n return setImageWidth(attrs.width ?? null);\n case 'deleteImage':\n return deleteImage();\n case 'setEmbedAlign':\n return setEmbedAlign((attrs.align as string | null) ?? null);\n case 'deleteEmbed':\n return deleteEmbed();\n case 'link':\n return setLink(marks.link, attrs);\n case 'unlink':\n return unsetLink(marks.link);\n case 'insertBookmark':\n return insertBookmark(schema, attrs);\n case 'textColor':\n return setAttrMark(marks.text_color, attrs.color ? { color: attrs.color } : null);\n case 'bgColor':\n return setAttrMark(marks.bg_color, attrs.color ? { color: attrs.color } : null);\n case 'fontFamily':\n return setAttrMark(marks.font_family, attrs.family ? { family: attrs.family } : null);\n case 'fontSize':\n return setAttrMark(marks.font_size, attrs.size ? { size: attrs.size } : null);\n case 'horizontalRule':\n return insertHorizontalRule(nodes.horizontal_rule);\n case 'clearFormatting':\n return clearFormatting();\n case 'undo':\n return undo;\n case 'redo':\n return redo;\n case 'codeBlock':\n return toggleCodeBlock(schema, attrs.language ?? null);\n case 'setCodeBlockLanguage':\n return setCodeBlockLanguage(schema, attrs.language ?? null);\n case 'insertEmbed':\n return insertEmbed(schema, attrs);\n case 'insertImage':\n return insertImage(schema, attrs);\n case 'updateImage':\n return updateImage(schema, attrs);\n case 'insertTable':\n return insertTable(schema, attrs);\n case 'addRowBefore':\n return addRowBefore;\n case 'addRowAfter':\n return addRowAfter;\n case 'addColumnBefore':\n return addColumnBefore;\n case 'addColumnAfter':\n return addColumnAfter;\n case 'deleteRow':\n return deleteRow;\n case 'deleteColumn':\n return deleteColumn;\n case 'mergeCells':\n return mergeCells;\n case 'splitCell':\n return splitCell;\n case 'toggleHeaderRow':\n return toggleHeaderRow;\n case 'toggleLayoutTable':\n return toggleLayoutTable();\n case 'deleteTable':\n return deleteTable;\n case 'changeCase':\n return changeCase(attrs.textCase ?? 'upper');\n case 'insertMergeField':\n return insertMergeField(schema, attrs);\n case 'insertMath':\n return insertMath(schema, attrs);\n default:\n return null;\n }\n}\n"]}
@@ -0,0 +1,35 @@
1
+ import { EditorState, Plugin, PluginKey } from 'prosemirror-state';
2
+ import { Node as PMNode, Schema } from 'prosemirror-model';
3
+ import { KeymapOptions } from './keymap';
4
+ import { LinkPluginOptions } from './plugins/link';
5
+ import { ImagePluginOptions } from './plugins/image';
6
+ import { SuggestionOptions } from './plugins/suggestions';
7
+ export declare const mentionSuggestKey: PluginKey<any>;
8
+ export declare const slashSuggestKey: PluginKey<any>;
9
+ export declare const emojiSuggestKey: PluginKey<any>;
10
+ export interface CreateStateOptions extends KeymapOptions, LinkPluginOptions, ImagePluginOptions {
11
+ schema?: Schema;
12
+ doc?: PMNode;
13
+ /** Read live so the placeholder updates without rebuilding state. */
14
+ getPlaceholder?: () => string;
15
+ singleLine?: boolean;
16
+ /** Mention suggestions (omit onChange to disable the plugin). */
17
+ mentions?: Omit<SuggestionOptions, 'startOfLine'>;
18
+ /** Slash-command suggestions, anchored to the start of a block. */
19
+ slashCommands?: Omit<SuggestionOptions, 'startOfLine' | 'getTriggers'>;
20
+ /** ":" emoji suggestions (activates after two query characters). */
21
+ emoji?: Omit<SuggestionOptions, 'startOfLine' | 'getTriggers' | 'minQueryLength'>;
22
+ /** Character limit, read live. Return 0/undefined for unlimited. */
23
+ getMaxLength?: () => number;
24
+ /** Read live: when true, all pastes drop formatting. */
25
+ getForcePlainText?: () => boolean;
26
+ /** Read live: when false, plain-text pastes are never parsed as Markdown. */
27
+ getMarkdownPaste?: () => boolean;
28
+ /** Read live: whether pasted/parsed HTML is sanitized. Defaults to on. */
29
+ getSanitize?: () => boolean;
30
+ /** Typography autocorrect (smart quotes, dashes, (c)…). Defaults to on. */
31
+ textTransform?: boolean;
32
+ /** Extra plugins appended after the built-in set (later phases, tests). */
33
+ plugins?: Plugin[];
34
+ }
35
+ export declare function createEditorState(options?: CreateStateOptions): EditorState;
@@ -0,0 +1,67 @@
1
+ import { EditorState, PluginKey } from 'prosemirror-state';
2
+ import { history } from 'prosemirror-history';
3
+ import { dropCursor } from 'prosemirror-dropcursor';
4
+ import { gapCursor } from 'prosemirror-gapcursor';
5
+ import { buildKeymapPlugins } from './keymap';
6
+ import { buildInputRules } from './inputrules';
7
+ import { placeholderPlugin } from './plugins/placeholder';
8
+ import { linkPlugin } from './plugins/link';
9
+ import { singleLinePlugin } from './plugins/single-line';
10
+ import { tablePlugins } from './plugins/tables';
11
+ import { imagePlugin } from './plugins/image';
12
+ import { suggestionPlugin } from './plugins/suggestions';
13
+ import { findReplacePlugin } from './plugins/find-replace';
14
+ import { maxLengthPlugin } from './plugins/max-length';
15
+ import { codeHighlightPlugin } from './plugins/code-highlight';
16
+ import { embedPastePlugin } from './plugins/embeds';
17
+ import { pastePlugin } from './plugins/paste';
18
+ import { formatPainterPlugin } from './plugins/format-painter';
19
+ import { defaultSchema } from './schema';
20
+ export const mentionSuggestKey = new PluginKey('nileMentionSuggest');
21
+ export const slashSuggestKey = new PluginKey('nileSlashSuggest');
22
+ export const emojiSuggestKey = new PluginKey('nileEmojiSuggest');
23
+ export function createEditorState(options = {}) {
24
+ const schema = options.schema ?? defaultSchema;
25
+ const plugins = [];
26
+ // Suggestion plugins must come BEFORE the keymaps: handleKeyDown props run
27
+ // in plugin order, and the popup needs first claim on Enter/Tab/arrows
28
+ // while a mention or slash query is active.
29
+ if (options.mentions) {
30
+ plugins.push(suggestionPlugin(mentionSuggestKey, options.mentions));
31
+ }
32
+ if (options.slashCommands) {
33
+ plugins.push(suggestionPlugin(slashSuggestKey, {
34
+ ...options.slashCommands,
35
+ getTriggers: () => ['/'],
36
+ startOfLine: true,
37
+ }));
38
+ }
39
+ if (options.emoji) {
40
+ plugins.push(suggestionPlugin(emojiSuggestKey, {
41
+ ...options.emoji,
42
+ getTriggers: () => [':'],
43
+ minQueryLength: 2,
44
+ }));
45
+ }
46
+ plugins.push(buildInputRules(schema, { textTransform: options.textTransform }), ...buildKeymapPlugins(schema, {
47
+ onLinkShortcut: options.onLinkShortcut,
48
+ onFindShortcut: options.onFindShortcut,
49
+ onShortcutHelp: options.onShortcutHelp,
50
+ }), history(), dropCursor(), gapCursor(), placeholderPlugin(options.getPlaceholder ?? (() => '')), linkPlugin({ onOpenLink: options.onOpenLink }), ...tablePlugins(), imagePlugin({ onImageFiles: options.onImageFiles }), findReplacePlugin(), codeHighlightPlugin(), embedPastePlugin(), formatPainterPlugin(), pastePlugin(schema, {
51
+ getForcePlainText: options.getForcePlainText,
52
+ getMarkdownPaste: options.getMarkdownPaste,
53
+ getSanitize: options.getSanitize,
54
+ }));
55
+ if (options.getMaxLength)
56
+ plugins.push(maxLengthPlugin(options.getMaxLength));
57
+ if (options.singleLine)
58
+ plugins.push(singleLinePlugin());
59
+ if (options.plugins)
60
+ plugins.push(...options.plugins);
61
+ return EditorState.create({
62
+ schema,
63
+ doc: options.doc,
64
+ plugins,
65
+ });
66
+ }
67
+ //# sourceMappingURL=create-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-state.js","sourceRoot":"","sources":["../../../../src/nile-wysiwyg-editor/engine/create-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAU,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAiB,MAAM,UAAU,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAqB,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAsB,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAqB,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,aAAa,EA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AAO,CAAC,cAAc;QACtC,cAAc,EAAE,OAAO,CAAC,cAAc;QACtC,cAAc,EAAE,OAAO,CAAC,cAAc;KACvC,CAAC,EACF,OAAO,EAAE,EACT,UAAU,EAAE,EACZ,SAAS,EAAE,EACX,iBAAiB,CAAC,OAAO,CAAC,cAAc,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,EACvD,UAAU,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC,EAC9C,GAAG,YAAY,EAAE,EACjB,WAAW,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,YAAY,EAAE,CAAC,EACnD,iBAAiB,EAAE,EACnB,mBAAmB,EAAE,EACrB,gBAAgB,EAAE,EAClB,mBAAmB,EAAE,EACrB,WAAW,CAAC,MAAM,EAAE;QAClB,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;QAC5C,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;QAC1C,WAAW,EAAE,OAAO,CAAC,WAAW;KACjC,CAAC,CACH,CAAC;IACF,IAAI,OAAO,CAAC,YAAY;QAAE,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;IAC9E,IAAI,OAAO,CAAC,UAAU;QAAE,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC;IACzD,IAAI,OAAO,CAAC,OAAO;QAAE,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEtD,OAAO,WAAW,CAAC,MAAM,CAAC;QACxB,MAAM;QACN,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,OAAO;KACR,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { EditorState, Plugin, PluginKey } from 'prosemirror-state';\nimport { Node as PMNode, Schema } from 'prosemirror-model';\nimport { history } from 'prosemirror-history';\nimport { dropCursor } from 'prosemirror-dropcursor';\nimport { gapCursor } from 'prosemirror-gapcursor';\nimport { buildKeymapPlugins, KeymapOptions } from './keymap';\nimport { buildInputRules } from './inputrules';\nimport { placeholderPlugin } from './plugins/placeholder';\nimport { linkPlugin, LinkPluginOptions } from './plugins/link';\nimport { singleLinePlugin } from './plugins/single-line';\nimport { tablePlugins } from './plugins/tables';\nimport { imagePlugin, ImagePluginOptions } from './plugins/image';\nimport { suggestionPlugin, SuggestionOptions } from './plugins/suggestions';\nimport { findReplacePlugin } from './plugins/find-replace';\nimport { maxLengthPlugin } from './plugins/max-length';\nimport { codeHighlightPlugin } from './plugins/code-highlight';\nimport { embedPastePlugin } from './plugins/embeds';\nimport { pastePlugin } from './plugins/paste';\nimport { formatPainterPlugin } from './plugins/format-painter';\nimport { defaultSchema } from './schema';\n\nexport const mentionSuggestKey = new PluginKey('nileMentionSuggest');\nexport const slashSuggestKey = new PluginKey('nileSlashSuggest');\nexport const emojiSuggestKey = new PluginKey('nileEmojiSuggest');\n\nexport interface CreateStateOptions\n extends KeymapOptions,\n LinkPluginOptions,\n ImagePluginOptions {\n schema?: Schema;\n doc?: PMNode;\n /** Read live so the placeholder updates without rebuilding state. */\n getPlaceholder?: () => string;\n singleLine?: boolean;\n /** Mention suggestions (omit onChange to disable the plugin). */\n mentions?: Omit<SuggestionOptions, 'startOfLine'>;\n /** Slash-command suggestions, anchored to the start of a block. */\n slashCommands?: Omit<SuggestionOptions, 'startOfLine' | 'getTriggers'>;\n /** \":\" emoji suggestions (activates after two query characters). */\n emoji?: Omit<SuggestionOptions, 'startOfLine' | 'getTriggers' | 'minQueryLength'>;\n /** Character limit, read live. Return 0/undefined for unlimited. */\n getMaxLength?: () => number;\n /** Read live: when true, all pastes drop formatting. */\n getForcePlainText?: () => boolean;\n /** Read live: when false, plain-text pastes are never parsed as Markdown. */\n getMarkdownPaste?: () => boolean;\n /** Read live: whether pasted/parsed HTML is sanitized. Defaults to on. */\n getSanitize?: () => boolean;\n /** Typography autocorrect (smart quotes, dashes, (c)…). Defaults to on. */\n textTransform?: boolean;\n /** Extra plugins appended after the built-in set (later phases, tests). */\n plugins?: Plugin[];\n}\n\nexport function createEditorState(options: CreateStateOptions = {}): EditorState {\n const schema = options.schema ?? defaultSchema;\n const plugins: Plugin[] = [];\n\n // Suggestion plugins must come BEFORE the keymaps: handleKeyDown props run\n // in plugin order, and the popup needs first claim on Enter/Tab/arrows\n // while a mention or slash query is active.\n if (options.mentions) {\n plugins.push(suggestionPlugin(mentionSuggestKey, options.mentions));\n }\n if (options.slashCommands) {\n plugins.push(\n suggestionPlugin(slashSuggestKey, {\n ...options.slashCommands,\n getTriggers: () => ['/'],\n startOfLine: true,\n })\n );\n }\n if (options.emoji) {\n plugins.push(\n suggestionPlugin(emojiSuggestKey, {\n ...options.emoji,\n getTriggers: () => [':'],\n minQueryLength: 2,\n })\n );\n }\n\n plugins.push(\n buildInputRules(schema, { textTransform: options.textTransform }),\n ...buildKeymapPlugins(schema, {\n onLinkShortcut: options.onLinkShortcut,\n onFindShortcut: options.onFindShortcut,\n onShortcutHelp: options.onShortcutHelp,\n }),\n history(),\n dropCursor(),\n gapCursor(),\n placeholderPlugin(options.getPlaceholder ?? (() => '')),\n linkPlugin({ onOpenLink: options.onOpenLink }),\n ...tablePlugins(),\n imagePlugin({ onImageFiles: options.onImageFiles }),\n findReplacePlugin(),\n codeHighlightPlugin(),\n embedPastePlugin(),\n formatPainterPlugin(),\n pastePlugin(schema, {\n getForcePlainText: options.getForcePlainText,\n getMarkdownPaste: options.getMarkdownPaste,\n getSanitize: options.getSanitize,\n })\n );\n if (options.getMaxLength) plugins.push(maxLengthPlugin(options.getMaxLength));\n if (options.singleLine) plugins.push(singleLinePlugin());\n if (options.plugins) plugins.push(...options.plugins);\n\n return EditorState.create({\n schema,\n doc: options.doc,\n plugins,\n });\n}\n"]}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Document export helpers: inline-styled HTML (email-safe), Word (.doc) and
3
+ * print-to-PDF. All three start from the *live, rendered* content DOM so the
4
+ * output reflects exactly what the user sees — chosen fonts, colours,
5
+ * alignment and table borders — rather than a re-derived approximation.
6
+ *
7
+ * These functions are dependency-free. PDF export relies on the browser's own
8
+ * print-to-PDF pipeline (see buildPrintDocument); Word export emits an HTML
9
+ * document Word opens natively.
10
+ */
11
+ /**
12
+ * Serializes the live content root to an HTML string with all styling folded
13
+ * into inline `style` attributes. Suitable for pasting into email clients that
14
+ * strip `<style>` blocks and classes.
15
+ */
16
+ export declare function toInlineStyledHtml(root: HTMLElement): string;
17
+ /**
18
+ * Wraps inline-styled body HTML in a Word-openable HTML document. Word reads
19
+ * the `ProgId`/`xmlns:w` hints and opens it as a formatted document rather than
20
+ * raw HTML, preserving headings, lists, tables, colours and images.
21
+ */
22
+ export declare function buildWordDocument(bodyHtml: string, title?: string): string;
23
+ /** Options for the print-to-PDF document. */
24
+ export interface PrintOptions {
25
+ title?: string;
26
+ /** Optional running header text (top of every printed page). */
27
+ header?: string;
28
+ /** Optional running footer text (bottom of every printed page). */
29
+ footer?: string;
30
+ /** Base font family for the printed page. */
31
+ fontFamily?: string;
32
+ }
33
+ /**
34
+ * Builds a standalone HTML document tuned for print-to-PDF. Page breaks,
35
+ * embedded images and a chosen base font are honoured by the browser's print
36
+ * engine; headers/footers render via a fixed running band on each page.
37
+ */
38
+ export declare function buildPrintDocument(bodyHtml: string, options?: PrintOptions): string;
@@ -0,0 +1,208 @@
1
+ /**
2
+ * Document export helpers: inline-styled HTML (email-safe), Word (.doc) and
3
+ * print-to-PDF. All three start from the *live, rendered* content DOM so the
4
+ * output reflects exactly what the user sees — chosen fonts, colours,
5
+ * alignment and table borders — rather than a re-derived approximation.
6
+ *
7
+ * These functions are dependency-free. PDF export relies on the browser's own
8
+ * print-to-PDF pipeline (see buildPrintDocument); Word export emits an HTML
9
+ * document Word opens natively.
10
+ */
11
+ /** Inherited text properties: emitted only when they differ from the parent. */
12
+ const INHERITED_PROPS = [
13
+ 'color',
14
+ 'font-family',
15
+ 'font-size',
16
+ 'font-weight',
17
+ 'font-style',
18
+ 'line-height',
19
+ 'text-align',
20
+ 'text-transform',
21
+ ];
22
+ /**
23
+ * Box/decoration properties: emitted only when they differ from their initial
24
+ * value (listed here). Longhands are used because getComputedStyle does not
25
+ * reliably return the `margin`/`padding`/`border` shorthands.
26
+ */
27
+ const BOX_DEFAULTS = {
28
+ 'background-color': ['rgba(0, 0, 0, 0)', 'transparent'],
29
+ 'text-decoration-line': ['none'],
30
+ 'margin-top': ['0px'],
31
+ 'margin-right': ['0px'],
32
+ 'margin-bottom': ['0px'],
33
+ 'margin-left': ['0px'],
34
+ 'padding-top': ['0px'],
35
+ 'padding-right': ['0px'],
36
+ 'padding-bottom': ['0px'],
37
+ 'padding-left': ['0px'],
38
+ 'vertical-align': ['baseline'],
39
+ };
40
+ /** Table-ish elements get their borders folded in for email/Word fidelity. */
41
+ const BORDER_TAGS = new Set(['TABLE', 'TD', 'TH', 'THEAD', 'TBODY', 'TR']);
42
+ /** Attributes worth preserving; everything else (class, contenteditable,
43
+ * spellcheck, data-*, pm-*) is dropped from the exported markup. */
44
+ const KEEP_ATTRS = new Set([
45
+ 'href',
46
+ 'src',
47
+ 'alt',
48
+ 'title',
49
+ 'colspan',
50
+ 'rowspan',
51
+ 'width',
52
+ 'height',
53
+ 'align',
54
+ 'target',
55
+ 'rel',
56
+ ]);
57
+ function emitBorders(source, style, clone) {
58
+ if (!BORDER_TAGS.has(source.tagName))
59
+ return;
60
+ const cs = getComputedStyle(source);
61
+ const collapse = cs.getPropertyValue('border-collapse');
62
+ if (collapse === 'collapse')
63
+ clone.style.setProperty('border-collapse', 'collapse');
64
+ for (const side of ['top', 'right', 'bottom', 'left']) {
65
+ const width = cs.getPropertyValue(`border-${side}-width`);
66
+ if (width && width !== '0px') {
67
+ const st = cs.getPropertyValue(`border-${side}-style`) || 'solid';
68
+ const color = cs.getPropertyValue(`border-${side}-color`);
69
+ clone.style.setProperty(`border-${side}`, `${width} ${st} ${color}`);
70
+ }
71
+ }
72
+ void style;
73
+ }
74
+ /** Folds computed styles from a live source element into a detached clone. */
75
+ function styleElement(source, clone, parent) {
76
+ const cs = getComputedStyle(source);
77
+ const parentCs = parent ? getComputedStyle(parent) : null;
78
+ for (const prop of INHERITED_PROPS) {
79
+ const value = cs.getPropertyValue(prop);
80
+ if (!value)
81
+ continue;
82
+ if (!parentCs || parentCs.getPropertyValue(prop) !== value) {
83
+ clone.style.setProperty(prop, value);
84
+ }
85
+ }
86
+ for (const [prop, defaults] of Object.entries(BOX_DEFAULTS)) {
87
+ const value = cs.getPropertyValue(prop);
88
+ if (value && !defaults.includes(value))
89
+ clone.style.setProperty(prop, value);
90
+ }
91
+ // List markers: emit the resolved bullet/number style on the list container.
92
+ if (source.tagName === 'UL' || source.tagName === 'OL') {
93
+ const marker = cs.getPropertyValue('list-style-type');
94
+ if (marker && marker !== 'none')
95
+ clone.style.setProperty('list-style-type', marker);
96
+ }
97
+ // Images and embeds should never overflow the exported page/email column.
98
+ if (source.tagName === 'IMG' || source.tagName === 'IFRAME') {
99
+ clone.style.setProperty('max-width', '100%');
100
+ }
101
+ emitBorders(source, cs, clone);
102
+ // Prune attributes down to the structural allow-list, keeping only style.
103
+ for (const attr of Array.from(clone.attributes)) {
104
+ if (attr.name !== 'style' && !KEEP_ATTRS.has(attr.name))
105
+ clone.removeAttribute(attr.name);
106
+ }
107
+ }
108
+ /** Recursively clones `source` into `target`'s document, inlining styles. */
109
+ function cloneWithStyles(source, doc, parent) {
110
+ if (source.nodeType === Node.TEXT_NODE) {
111
+ return doc.createTextNode(source.textContent ?? '');
112
+ }
113
+ if (source.nodeType !== Node.ELEMENT_NODE)
114
+ return null;
115
+ const el = source;
116
+ // ProseMirror decorations (find-highlights, gap/drop cursors, trailing
117
+ // break hacks) carry these classes — never part of the real content.
118
+ if (el.classList.contains('ProseMirror-gapcursor'))
119
+ return null;
120
+ if (el.classList.contains('ProseMirror-separator'))
121
+ return null;
122
+ const clone = doc.createElement(el.tagName.toLowerCase());
123
+ for (const attr of Array.from(el.attributes))
124
+ clone.setAttribute(attr.name, attr.value);
125
+ styleElement(el, clone, parent);
126
+ for (const child of Array.from(el.childNodes)) {
127
+ const cloned = cloneWithStyles(child, doc, el);
128
+ if (cloned)
129
+ clone.appendChild(cloned);
130
+ }
131
+ return clone;
132
+ }
133
+ /**
134
+ * Serializes the live content root to an HTML string with all styling folded
135
+ * into inline `style` attributes. Suitable for pasting into email clients that
136
+ * strip `<style>` blocks and classes.
137
+ */
138
+ export function toInlineStyledHtml(root) {
139
+ const doc = document.implementation.createHTMLDocument('');
140
+ const container = doc.createElement('div');
141
+ for (const child of Array.from(root.childNodes)) {
142
+ const cloned = cloneWithStyles(child, doc, root);
143
+ if (cloned)
144
+ container.appendChild(cloned);
145
+ }
146
+ return container.innerHTML;
147
+ }
148
+ function escapeHtml(text) {
149
+ return text
150
+ .replace(/&/g, '&amp;')
151
+ .replace(/</g, '&lt;')
152
+ .replace(/>/g, '&gt;')
153
+ .replace(/"/g, '&quot;');
154
+ }
155
+ /**
156
+ * Wraps inline-styled body HTML in a Word-openable HTML document. Word reads
157
+ * the `ProgId`/`xmlns:w` hints and opens it as a formatted document rather than
158
+ * raw HTML, preserving headings, lists, tables, colours and images.
159
+ */
160
+ export function buildWordDocument(bodyHtml, title = 'Document') {
161
+ return ('<!DOCTYPE html>\n' +
162
+ '<html xmlns:o="urn:schemas-microsoft-com:office:office" ' +
163
+ 'xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">' +
164
+ '<head><meta charset="utf-8">' +
165
+ `<title>${escapeHtml(title)}</title>` +
166
+ '<!--[if gte mso 9]><xml><w:WordDocument>' +
167
+ '<w:View>Print</w:View><w:Zoom>100</w:Zoom><w:DoNotOptimizeForBrowser/>' +
168
+ '</w:WordDocument></xml><![endif]-->' +
169
+ '<style>@page { size: A4; margin: 2cm; } ' +
170
+ 'body { font-family: Calibri, Arial, sans-serif; } ' +
171
+ 'table { border-collapse: collapse; } td, th { border: 1px solid #999; padding: 4px; }</style>' +
172
+ '</head><body>' +
173
+ bodyHtml +
174
+ '</body></html>');
175
+ }
176
+ /**
177
+ * Builds a standalone HTML document tuned for print-to-PDF. Page breaks,
178
+ * embedded images and a chosen base font are honoured by the browser's print
179
+ * engine; headers/footers render via a fixed running band on each page.
180
+ */
181
+ export function buildPrintDocument(bodyHtml, options = {}) {
182
+ const { title = 'Document', header = '', footer = '', fontFamily = 'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif', } = options;
183
+ const runningBands = (header ? `<div class="nw-print-header">${escapeHtml(header)}</div>` : '') +
184
+ (footer ? `<div class="nw-print-footer">${escapeHtml(footer)}</div>` : '');
185
+ return ('<!DOCTYPE html>\n<html><head><meta charset="utf-8">' +
186
+ `<title>${escapeHtml(title)}</title><style>` +
187
+ '@page { size: A4; margin: 20mm; }' +
188
+ `body { font-family: ${fontFamily}; color: #101828; line-height: 1.5; margin: 0; }` +
189
+ 'img, iframe { max-width: 100%; }' +
190
+ 'table { border-collapse: collapse; width: 100%; }' +
191
+ 'td, th { border: 1px solid #d0d5dd; padding: 6px 8px; }' +
192
+ 'pre, blockquote, table, figure, img { break-inside: avoid; page-break-inside: avoid; }' +
193
+ 'h1, h2, h3, h4 { break-after: avoid; page-break-after: avoid; }' +
194
+ '.nw-page-break { break-before: page; page-break-before: always; }' +
195
+ (header
196
+ ? '.nw-print-header { position: fixed; top: 0; left: 0; right: 0; ' +
197
+ 'font-size: 10px; color: #667085; padding: 6px 0; }'
198
+ : '') +
199
+ (footer
200
+ ? '.nw-print-footer { position: fixed; bottom: 0; left: 0; right: 0; ' +
201
+ 'font-size: 10px; color: #667085; padding: 6px 0; text-align: center; }'
202
+ : '') +
203
+ '</style></head><body>' +
204
+ runningBands +
205
+ `<main>${bodyHtml}</main>` +
206
+ '</body></html>');
207
+ }
208
+ //# sourceMappingURL=export.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export.js","sourceRoot":"","sources":["../../../../src/nile-wysiwyg-editor/engine/export.ts"],"names":[],"mappings":"A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B,CAAC,MAAM,CAAC,CAAC,CAAC,gCAAgC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1E,CAAC,MAAM,CAAC,CAAC,CAAC,gCAAgC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAE7E,OAAO,CACL,qDAAqD;QACrD,UAAU,UAAU,CAAC,KAAK,CAAC,iBAAiB;QAC5C,mCAAmC;QACnC,uBAAuB,UAAU,kDAAkD;QACnF,kCAAkC;QAClC,mDAAmD;QACnD,yDAAyD;QACzD,wFAAwF;QACxF,iEAAiE;QACjE,mEAAmE;QACnE,CAAC,MAAM;YACL,CAAC,CAAC,iEAAiE;gBACjE,oDAAoD;YACtD,CAAC,CAAC,EAAE,CAAC;QACP,CAAC,MAAM;YACL,CAAC,CAAC,oEAAoE;gBACpE,wEAAwE;YAC1E,CAAC,CAAC,EAAE,CAAC;QACP,uBAAuB;QACvB,YAAY;QACZ,SAAS,QAAQ,SAAS;QAC1B,gBAAgB,CACjB,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Document export helpers: inline-styled HTML (email-safe), Word (.doc) and\n * print-to-PDF. All three start from the *live, rendered* content DOM so the\n * output reflects exactly what the user sees — chosen fonts, colours,\n * alignment and table borders — rather than a re-derived approximation.\n *\n * These functions are dependency-free. PDF export relies on the browser's own\n * print-to-PDF pipeline (see buildPrintDocument); Word export emits an HTML\n * document Word opens natively.\n */\n\n/** Inherited text properties: emitted only when they differ from the parent. */\nconst INHERITED_PROPS = [\n 'color',\n 'font-family',\n 'font-size',\n 'font-weight',\n 'font-style',\n 'line-height',\n 'text-align',\n 'text-transform',\n] as const;\n\n/**\n * Box/decoration properties: emitted only when they differ from their initial\n * value (listed here). Longhands are used because getComputedStyle does not\n * reliably return the `margin`/`padding`/`border` shorthands.\n */\nconst BOX_DEFAULTS: Record<string, string[]> = {\n 'background-color': ['rgba(0, 0, 0, 0)', 'transparent'],\n 'text-decoration-line': ['none'],\n 'margin-top': ['0px'],\n 'margin-right': ['0px'],\n 'margin-bottom': ['0px'],\n 'margin-left': ['0px'],\n 'padding-top': ['0px'],\n 'padding-right': ['0px'],\n 'padding-bottom': ['0px'],\n 'padding-left': ['0px'],\n 'vertical-align': ['baseline'],\n};\n\n/** Table-ish elements get their borders folded in for email/Word fidelity. */\nconst BORDER_TAGS = new Set(['TABLE', 'TD', 'TH', 'THEAD', 'TBODY', 'TR']);\n\n/** Attributes worth preserving; everything else (class, contenteditable,\n * spellcheck, data-*, pm-*) is dropped from the exported markup. */\nconst KEEP_ATTRS = new Set([\n 'href',\n 'src',\n 'alt',\n 'title',\n 'colspan',\n 'rowspan',\n 'width',\n 'height',\n 'align',\n 'target',\n 'rel',\n]);\n\nfunction emitBorders(source: Element, style: CSSStyleDeclaration, clone: HTMLElement): void {\n if (!BORDER_TAGS.has(source.tagName)) return;\n const cs = getComputedStyle(source);\n const collapse = cs.getPropertyValue('border-collapse');\n if (collapse === 'collapse') clone.style.setProperty('border-collapse', 'collapse');\n for (const side of ['top', 'right', 'bottom', 'left']) {\n const width = cs.getPropertyValue(`border-${side}-width`);\n if (width && width !== '0px') {\n const st = cs.getPropertyValue(`border-${side}-style`) || 'solid';\n const color = cs.getPropertyValue(`border-${side}-color`);\n clone.style.setProperty(`border-${side}`, `${width} ${st} ${color}`);\n }\n }\n void style;\n}\n\n/** Folds computed styles from a live source element into a detached clone. */\nfunction styleElement(source: Element, clone: HTMLElement, parent: Element | null): void {\n const cs = getComputedStyle(source);\n const parentCs = parent ? getComputedStyle(parent) : null;\n\n for (const prop of INHERITED_PROPS) {\n const value = cs.getPropertyValue(prop);\n if (!value) continue;\n if (!parentCs || parentCs.getPropertyValue(prop) !== value) {\n clone.style.setProperty(prop, value);\n }\n }\n\n for (const [prop, defaults] of Object.entries(BOX_DEFAULTS)) {\n const value = cs.getPropertyValue(prop);\n if (value && !defaults.includes(value)) clone.style.setProperty(prop, value);\n }\n\n // List markers: emit the resolved bullet/number style on the list container.\n if (source.tagName === 'UL' || source.tagName === 'OL') {\n const marker = cs.getPropertyValue('list-style-type');\n if (marker && marker !== 'none') clone.style.setProperty('list-style-type', marker);\n }\n\n // Images and embeds should never overflow the exported page/email column.\n if (source.tagName === 'IMG' || source.tagName === 'IFRAME') {\n clone.style.setProperty('max-width', '100%');\n }\n\n emitBorders(source, cs, clone);\n\n // Prune attributes down to the structural allow-list, keeping only style.\n for (const attr of Array.from(clone.attributes)) {\n if (attr.name !== 'style' && !KEEP_ATTRS.has(attr.name)) clone.removeAttribute(attr.name);\n }\n}\n\n/** Recursively clones `source` into `target`'s document, inlining styles. */\nfunction cloneWithStyles(\n source: Node,\n doc: Document,\n parent: Element | null\n): Node | null {\n if (source.nodeType === Node.TEXT_NODE) {\n return doc.createTextNode(source.textContent ?? '');\n }\n if (source.nodeType !== Node.ELEMENT_NODE) return null;\n\n const el = source as Element;\n // ProseMirror decorations (find-highlights, gap/drop cursors, trailing\n // break hacks) carry these classes — never part of the real content.\n if (el.classList.contains('ProseMirror-gapcursor')) return null;\n if (el.classList.contains('ProseMirror-separator')) return null;\n\n const clone = doc.createElement(el.tagName.toLowerCase());\n for (const attr of Array.from(el.attributes)) clone.setAttribute(attr.name, attr.value);\n styleElement(el, clone as HTMLElement, parent);\n\n for (const child of Array.from(el.childNodes)) {\n const cloned = cloneWithStyles(child, doc, el);\n if (cloned) clone.appendChild(cloned);\n }\n return clone;\n}\n\n/**\n * Serializes the live content root to an HTML string with all styling folded\n * into inline `style` attributes. Suitable for pasting into email clients that\n * strip `<style>` blocks and classes.\n */\nexport function toInlineStyledHtml(root: HTMLElement): string {\n const doc = document.implementation.createHTMLDocument('');\n const container = doc.createElement('div');\n for (const child of Array.from(root.childNodes)) {\n const cloned = cloneWithStyles(child, doc, root);\n if (cloned) container.appendChild(cloned);\n }\n return container.innerHTML;\n}\n\nfunction escapeHtml(text: string): string {\n return text\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;');\n}\n\n/**\n * Wraps inline-styled body HTML in a Word-openable HTML document. Word reads\n * the `ProgId`/`xmlns:w` hints and opens it as a formatted document rather than\n * raw HTML, preserving headings, lists, tables, colours and images.\n */\nexport function buildWordDocument(bodyHtml: string, title = 'Document'): string {\n return (\n '<!DOCTYPE html>\\n' +\n '<html xmlns:o=\"urn:schemas-microsoft-com:office:office\" ' +\n 'xmlns:w=\"urn:schemas-microsoft-com:office:word\" xmlns=\"http://www.w3.org/TR/REC-html40\">' +\n '<head><meta charset=\"utf-8\">' +\n `<title>${escapeHtml(title)}</title>` +\n '<!--[if gte mso 9]><xml><w:WordDocument>' +\n '<w:View>Print</w:View><w:Zoom>100</w:Zoom><w:DoNotOptimizeForBrowser/>' +\n '</w:WordDocument></xml><![endif]-->' +\n '<style>@page { size: A4; margin: 2cm; } ' +\n 'body { font-family: Calibri, Arial, sans-serif; } ' +\n 'table { border-collapse: collapse; } td, th { border: 1px solid #999; padding: 4px; }</style>' +\n '</head><body>' +\n bodyHtml +\n '</body></html>'\n );\n}\n\n/** Options for the print-to-PDF document. */\nexport interface PrintOptions {\n title?: string;\n /** Optional running header text (top of every printed page). */\n header?: string;\n /** Optional running footer text (bottom of every printed page). */\n footer?: string;\n /** Base font family for the printed page. */\n fontFamily?: string;\n}\n\n/**\n * Builds a standalone HTML document tuned for print-to-PDF. Page breaks,\n * embedded images and a chosen base font are honoured by the browser's print\n * engine; headers/footers render via a fixed running band on each page.\n */\nexport function buildPrintDocument(bodyHtml: string, options: PrintOptions = {}): string {\n const {\n title = 'Document',\n header = '',\n footer = '',\n fontFamily = 'system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif',\n } = options;\n\n const runningBands =\n (header ? `<div class=\"nw-print-header\">${escapeHtml(header)}</div>` : '') +\n (footer ? `<div class=\"nw-print-footer\">${escapeHtml(footer)}</div>` : '');\n\n return (\n '<!DOCTYPE html>\\n<html><head><meta charset=\"utf-8\">' +\n `<title>${escapeHtml(title)}</title><style>` +\n '@page { size: A4; margin: 20mm; }' +\n `body { font-family: ${fontFamily}; color: #101828; line-height: 1.5; margin: 0; }` +\n 'img, iframe { max-width: 100%; }' +\n 'table { border-collapse: collapse; width: 100%; }' +\n 'td, th { border: 1px solid #d0d5dd; padding: 6px 8px; }' +\n 'pre, blockquote, table, figure, img { break-inside: avoid; page-break-inside: avoid; }' +\n 'h1, h2, h3, h4 { break-after: avoid; page-break-after: avoid; }' +\n '.nw-page-break { break-before: page; page-break-before: always; }' +\n (header\n ? '.nw-print-header { position: fixed; top: 0; left: 0; right: 0; ' +\n 'font-size: 10px; color: #667085; padding: 6px 0; }'\n : '') +\n (footer\n ? '.nw-print-footer { position: fixed; bottom: 0; left: 0; right: 0; ' +\n 'font-size: 10px; color: #667085; padding: 6px 0; text-align: center; }'\n : '') +\n '</style></head><body>' +\n runningBands +\n `<main>${bodyHtml}</main>` +\n '</body></html>'\n );\n}\n"]}