@aquera/nile-elements 1.9.5 → 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 (565) hide show
  1. package/README.md +9 -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 +3802 -664
  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-chip/nile-chip.css.cjs.js +1 -1
  31. package/dist/nile-chip/nile-chip.css.cjs.js.map +1 -1
  32. package/dist/nile-chip/nile-chip.css.esm.js +8 -1
  33. package/dist/nile-code-editor/extensionSetup.cjs.js +7 -7
  34. package/dist/nile-code-editor/extensionSetup.cjs.js.map +1 -1
  35. package/dist/nile-code-editor/extensionSetup.esm.js +1 -1
  36. package/dist/nile-code-editor/index.cjs.js +1 -1
  37. package/dist/nile-code-editor/index.esm.js +1 -1
  38. package/dist/nile-code-editor/nile-code-editor.cjs.js +2 -2
  39. package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
  40. package/dist/nile-code-editor/nile-code-editor.esm.js +4 -4
  41. package/dist/nile-color-picker/index.cjs.js +1 -1
  42. package/dist/nile-color-picker/nile-color-picker.cjs.js +1 -1
  43. package/dist/nile-combobox/index.cjs.js +1 -1
  44. package/dist/nile-combobox/index.esm.js +1 -1
  45. package/dist/nile-combobox/nile-combobox.cjs.js +1 -1
  46. package/dist/nile-combobox/nile-combobox.esm.js +1 -1
  47. package/dist/nile-combobox/portal-manager.cjs.js +1 -1
  48. package/dist/nile-context-menu/index.cjs.js +1 -1
  49. package/dist/nile-context-menu/nile-context-menu.cjs.js +1 -1
  50. package/dist/nile-context-submenu/index.cjs.js +1 -1
  51. package/dist/nile-context-submenu/nile-context-submenu.cjs.js +1 -1
  52. package/dist/nile-detail/index.cjs.js +1 -1
  53. package/dist/nile-detail/index.esm.js +1 -1
  54. package/dist/nile-detail/nile-detail.cjs.js +1 -1
  55. package/dist/nile-detail/nile-detail.esm.js +1 -1
  56. package/dist/nile-dropdown/index.cjs.js +1 -1
  57. package/dist/nile-dropdown/nile-dropdown.cjs.js +1 -1
  58. package/dist/nile-dropdown/portal-manager.cjs.js +1 -1
  59. package/dist/nile-file-upload/index.cjs.js +1 -1
  60. package/dist/nile-file-upload/nile-file-upload.cjs.js +1 -1
  61. package/dist/nile-file-upload/nile-file-upload.template.cjs.js +1 -1
  62. package/dist/nile-floating-panel/index.cjs.js +1 -1
  63. package/dist/nile-floating-panel/nile-floating-panel.cjs.js +1 -1
  64. package/dist/nile-hero/nile-hero.cjs.js +1 -1
  65. package/dist/nile-hero/nile-hero.cjs.js.map +1 -1
  66. package/dist/nile-hero/nile-hero.css.cjs.js +1 -1
  67. package/dist/nile-hero/nile-hero.css.cjs.js.map +1 -1
  68. package/dist/nile-hero/nile-hero.css.esm.js +14 -14
  69. package/dist/nile-hero/nile-hero.esm.js +1 -1
  70. package/dist/nile-hero-header/nile-hero-header.cjs.js +1 -1
  71. package/dist/nile-hero-header/nile-hero-header.cjs.js.map +1 -1
  72. package/dist/nile-hero-header/nile-hero-header.css.cjs.js +1 -1
  73. package/dist/nile-hero-header/nile-hero-header.css.cjs.js.map +1 -1
  74. package/dist/nile-hero-header/nile-hero-header.css.esm.js +11 -11
  75. package/dist/nile-hero-header/nile-hero-header.esm.js +3 -3
  76. package/dist/nile-lite-tooltip/index.cjs.js +1 -1
  77. package/dist/nile-lite-tooltip/nile-lite-tooltip.cjs.js +1 -1
  78. package/dist/nile-markdown-editor/index.cjs.js +1 -1
  79. package/dist/nile-markdown-editor/nile-markdown-editor.cjs.js +1 -1
  80. package/dist/nile-popover/index.cjs.js +1 -1
  81. package/dist/nile-popover/nile-popover.cjs.js +1 -1
  82. package/dist/nile-popover/portal-manager.cjs.js +1 -1
  83. package/dist/nile-popup/index.cjs.js +1 -1
  84. package/dist/nile-popup/nile-popup.cjs.js +1 -1
  85. package/dist/nile-rich-text-editor/index.cjs.js +1 -1
  86. package/dist/nile-rich-text-editor/index.esm.js +1 -1
  87. package/dist/nile-rich-text-editor/nile-rich-text-editor.cjs.js +1 -1
  88. package/dist/nile-rich-text-editor/nile-rich-text-editor.cjs.js.map +1 -1
  89. package/dist/nile-rich-text-editor/nile-rich-text-editor.css.cjs.js +1 -1
  90. package/dist/nile-rich-text-editor/nile-rich-text-editor.css.cjs.js.map +1 -1
  91. package/dist/nile-rich-text-editor/nile-rich-text-editor.css.esm.js +70 -0
  92. package/dist/nile-rich-text-editor/nile-rich-text-editor.esm.js +1 -1
  93. package/dist/nile-rich-text-editor/nile-rte-image.cjs.js +3 -0
  94. package/dist/nile-rich-text-editor/nile-rte-image.cjs.js.map +1 -0
  95. package/dist/nile-rich-text-editor/nile-rte-image.esm.js +96 -0
  96. package/dist/nile-select/index.cjs.js +1 -1
  97. package/dist/nile-select/nile-select.cjs.js +1 -1
  98. package/dist/nile-select/portal-manager.cjs.js +1 -1
  99. package/dist/nile-side-bar-action/index.cjs.js +1 -1
  100. package/dist/nile-side-bar-action/nile-side-bar-action.cjs.js +1 -1
  101. package/dist/nile-side-bar-action/portal-manager.cjs.js +1 -1
  102. package/dist/nile-tooltip/index.cjs.js +1 -1
  103. package/dist/nile-tooltip/nile-tooltip.cjs.js +1 -1
  104. package/dist/nile-virtual-select/index.cjs.js +1 -1
  105. package/dist/nile-virtual-select/nile-virtual-select.cjs.js +1 -1
  106. package/dist/nile-virtual-select/portal-manager.cjs.js +1 -1
  107. package/dist/nile-virtual-select/renderer.cjs.js +1 -1
  108. package/dist/nile-wysiwyg-editor/emoji.cjs.js +2 -0
  109. package/dist/nile-wysiwyg-editor/emoji.cjs.js.map +1 -0
  110. package/dist/nile-wysiwyg-editor/emoji.esm.js +1 -0
  111. package/dist/nile-wysiwyg-editor/engine/commands.cjs.js +2 -0
  112. package/dist/nile-wysiwyg-editor/engine/commands.cjs.js.map +1 -0
  113. package/dist/nile-wysiwyg-editor/engine/commands.esm.js +1 -0
  114. package/dist/nile-wysiwyg-editor/engine/create-state.cjs.js +2 -0
  115. package/dist/nile-wysiwyg-editor/engine/create-state.cjs.js.map +1 -0
  116. package/dist/nile-wysiwyg-editor/engine/create-state.esm.js +1 -0
  117. package/dist/nile-wysiwyg-editor/engine/export.cjs.js +2 -0
  118. package/dist/nile-wysiwyg-editor/engine/export.cjs.js.map +1 -0
  119. package/dist/nile-wysiwyg-editor/engine/export.esm.js +1 -0
  120. package/dist/nile-wysiwyg-editor/engine/index.cjs.js +2 -0
  121. package/dist/nile-wysiwyg-editor/engine/index.cjs.js.map +1 -0
  122. package/dist/nile-wysiwyg-editor/engine/index.esm.js +1 -0
  123. package/dist/nile-wysiwyg-editor/engine/inputrules.cjs.js +2 -0
  124. package/dist/nile-wysiwyg-editor/engine/inputrules.cjs.js.map +1 -0
  125. package/dist/nile-wysiwyg-editor/engine/inputrules.esm.js +1 -0
  126. package/dist/nile-wysiwyg-editor/engine/keymap.cjs.js +2 -0
  127. package/dist/nile-wysiwyg-editor/engine/keymap.cjs.js.map +1 -0
  128. package/dist/nile-wysiwyg-editor/engine/keymap.esm.js +1 -0
  129. package/dist/nile-wysiwyg-editor/engine/markdown-parse.cjs.js +2 -0
  130. package/dist/nile-wysiwyg-editor/engine/markdown-parse.cjs.js.map +1 -0
  131. package/dist/nile-wysiwyg-editor/engine/markdown-parse.esm.js +1 -0
  132. package/dist/nile-wysiwyg-editor/engine/markdown.cjs.js +2 -0
  133. package/dist/nile-wysiwyg-editor/engine/markdown.cjs.js.map +1 -0
  134. package/dist/nile-wysiwyg-editor/engine/markdown.esm.js +1 -0
  135. package/dist/nile-wysiwyg-editor/engine/office-paste.cjs.js +2 -0
  136. package/dist/nile-wysiwyg-editor/engine/office-paste.cjs.js.map +1 -0
  137. package/dist/nile-wysiwyg-editor/engine/office-paste.esm.js +1 -0
  138. package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.cjs.js +2 -0
  139. package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.cjs.js.map +1 -0
  140. package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.esm.js +1 -0
  141. package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.cjs.js +2 -0
  142. package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.cjs.js.map +1 -0
  143. package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.esm.js +1 -0
  144. package/dist/nile-wysiwyg-editor/engine/plugins/embeds.cjs.js +2 -0
  145. package/dist/nile-wysiwyg-editor/engine/plugins/embeds.cjs.js.map +1 -0
  146. package/dist/nile-wysiwyg-editor/engine/plugins/embeds.esm.js +1 -0
  147. package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.cjs.js +2 -0
  148. package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.cjs.js.map +1 -0
  149. package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.esm.js +1 -0
  150. package/dist/nile-wysiwyg-editor/engine/plugins/format-painter.cjs.js +2 -0
  151. package/dist/nile-wysiwyg-editor/engine/plugins/format-painter.cjs.js.map +1 -0
  152. package/dist/nile-wysiwyg-editor/engine/plugins/format-painter.esm.js +1 -0
  153. package/dist/nile-wysiwyg-editor/engine/plugins/image-view.cjs.js +2 -0
  154. package/dist/nile-wysiwyg-editor/engine/plugins/image-view.cjs.js.map +1 -0
  155. package/dist/nile-wysiwyg-editor/engine/plugins/image-view.esm.js +1 -0
  156. package/dist/nile-wysiwyg-editor/engine/plugins/image.cjs.js +2 -0
  157. package/dist/nile-wysiwyg-editor/engine/plugins/image.cjs.js.map +1 -0
  158. package/dist/nile-wysiwyg-editor/engine/plugins/image.esm.js +1 -0
  159. package/dist/nile-wysiwyg-editor/engine/plugins/link.cjs.js +2 -0
  160. package/dist/nile-wysiwyg-editor/engine/plugins/link.cjs.js.map +1 -0
  161. package/dist/nile-wysiwyg-editor/engine/plugins/link.esm.js +1 -0
  162. package/dist/nile-wysiwyg-editor/engine/plugins/math-view.cjs.js +2 -0
  163. package/dist/nile-wysiwyg-editor/engine/plugins/math-view.cjs.js.map +1 -0
  164. package/dist/nile-wysiwyg-editor/engine/plugins/math-view.esm.js +1 -0
  165. package/dist/nile-wysiwyg-editor/engine/plugins/max-length.cjs.js +2 -0
  166. package/dist/nile-wysiwyg-editor/engine/plugins/max-length.cjs.js.map +1 -0
  167. package/dist/nile-wysiwyg-editor/engine/plugins/max-length.esm.js +1 -0
  168. package/dist/nile-wysiwyg-editor/engine/plugins/paste.cjs.js +2 -0
  169. package/dist/nile-wysiwyg-editor/engine/plugins/paste.cjs.js.map +1 -0
  170. package/dist/nile-wysiwyg-editor/engine/plugins/paste.esm.js +1 -0
  171. package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.cjs.js +2 -0
  172. package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.cjs.js.map +1 -0
  173. package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.esm.js +1 -0
  174. package/dist/nile-wysiwyg-editor/engine/plugins/single-line.cjs.js +2 -0
  175. package/dist/nile-wysiwyg-editor/engine/plugins/single-line.cjs.js.map +1 -0
  176. package/dist/nile-wysiwyg-editor/engine/plugins/single-line.esm.js +1 -0
  177. package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.cjs.js +2 -0
  178. package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.cjs.js.map +1 -0
  179. package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.esm.js +1 -0
  180. package/dist/nile-wysiwyg-editor/engine/plugins/tables.cjs.js +2 -0
  181. package/dist/nile-wysiwyg-editor/engine/plugins/tables.cjs.js.map +1 -0
  182. package/dist/nile-wysiwyg-editor/engine/plugins/tables.esm.js +1 -0
  183. package/dist/nile-wysiwyg-editor/engine/plugins/task-list.cjs.js +2 -0
  184. package/dist/nile-wysiwyg-editor/engine/plugins/task-list.cjs.js.map +1 -0
  185. package/dist/nile-wysiwyg-editor/engine/plugins/task-list.esm.js +1 -0
  186. package/dist/nile-wysiwyg-editor/engine/sanitize.cjs.js +2 -0
  187. package/dist/nile-wysiwyg-editor/engine/sanitize.cjs.js.map +1 -0
  188. package/dist/nile-wysiwyg-editor/engine/sanitize.esm.js +1 -0
  189. package/dist/nile-wysiwyg-editor/engine/schema.cjs.js +2 -0
  190. package/dist/nile-wysiwyg-editor/engine/schema.cjs.js.map +1 -0
  191. package/dist/nile-wysiwyg-editor/engine/schema.esm.js +1 -0
  192. package/dist/nile-wysiwyg-editor/engine/selection-state.cjs.js +2 -0
  193. package/dist/nile-wysiwyg-editor/engine/selection-state.cjs.js.map +1 -0
  194. package/dist/nile-wysiwyg-editor/engine/selection-state.esm.js +1 -0
  195. package/dist/nile-wysiwyg-editor/engine/serializer.cjs.js +2 -0
  196. package/dist/nile-wysiwyg-editor/engine/serializer.cjs.js.map +1 -0
  197. package/dist/nile-wysiwyg-editor/engine/serializer.esm.js +1 -0
  198. package/dist/nile-wysiwyg-editor/index.cjs.js +2 -0
  199. package/dist/nile-wysiwyg-editor/index.cjs.js.map +1 -0
  200. package/dist/nile-wysiwyg-editor/index.esm.js +1 -0
  201. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js +2 -0
  202. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js.map +1 -0
  203. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.cjs.js +2 -0
  204. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.cjs.js.map +1 -0
  205. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.esm.js +780 -0
  206. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.esm.js +97 -0
  207. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.cjs.js +2 -0
  208. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.cjs.js.map +1 -0
  209. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.esm.js +1 -0
  210. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.cjs.js +2 -0
  211. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.cjs.js.map +1 -0
  212. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.cjs.js +2 -0
  213. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.cjs.js.map +1 -0
  214. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.esm.js +244 -0
  215. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.esm.js +137 -0
  216. package/dist/nile-wysiwyg-editor/types.cjs.js +2 -0
  217. package/dist/nile-wysiwyg-editor/types.cjs.js.map +1 -0
  218. package/dist/nile-wysiwyg-editor/types.esm.js +1 -0
  219. package/dist/nile-wysiwyg-editor/ui/bookmark-panel.cjs.js +2 -0
  220. package/dist/nile-wysiwyg-editor/ui/bookmark-panel.cjs.js.map +1 -0
  221. package/dist/nile-wysiwyg-editor/ui/bookmark-panel.esm.js +97 -0
  222. package/dist/nile-wysiwyg-editor/ui/bubble-menu.cjs.js +2 -0
  223. package/dist/nile-wysiwyg-editor/ui/bubble-menu.cjs.js.map +1 -0
  224. package/dist/nile-wysiwyg-editor/ui/bubble-menu.esm.js +67 -0
  225. package/dist/nile-wysiwyg-editor/ui/code-block-menu.cjs.js +2 -0
  226. package/dist/nile-wysiwyg-editor/ui/code-block-menu.cjs.js.map +1 -0
  227. package/dist/nile-wysiwyg-editor/ui/code-block-menu.esm.js +65 -0
  228. package/dist/nile-wysiwyg-editor/ui/embed-menu.cjs.js +2 -0
  229. package/dist/nile-wysiwyg-editor/ui/embed-menu.cjs.js.map +1 -0
  230. package/dist/nile-wysiwyg-editor/ui/embed-menu.esm.js +64 -0
  231. package/dist/nile-wysiwyg-editor/ui/embed-panel.cjs.js +2 -0
  232. package/dist/nile-wysiwyg-editor/ui/embed-panel.cjs.js.map +1 -0
  233. package/dist/nile-wysiwyg-editor/ui/embed-panel.esm.js +68 -0
  234. package/dist/nile-wysiwyg-editor/ui/emoji-picker.cjs.js +2 -0
  235. package/dist/nile-wysiwyg-editor/ui/emoji-picker.cjs.js.map +1 -0
  236. package/dist/nile-wysiwyg-editor/ui/emoji-picker.esm.js +96 -0
  237. package/dist/nile-wysiwyg-editor/ui/find-replace.cjs.js +2 -0
  238. package/dist/nile-wysiwyg-editor/ui/find-replace.cjs.js.map +1 -0
  239. package/dist/nile-wysiwyg-editor/ui/find-replace.esm.js +112 -0
  240. package/dist/nile-wysiwyg-editor/ui/image-menu.cjs.js +2 -0
  241. package/dist/nile-wysiwyg-editor/ui/image-menu.cjs.js.map +1 -0
  242. package/dist/nile-wysiwyg-editor/ui/image-menu.esm.js +64 -0
  243. package/dist/nile-wysiwyg-editor/ui/image-panel.cjs.js +2 -0
  244. package/dist/nile-wysiwyg-editor/ui/image-panel.cjs.js.map +1 -0
  245. package/dist/nile-wysiwyg-editor/ui/image-panel.esm.js +171 -0
  246. package/dist/nile-wysiwyg-editor/ui/insert-menu.cjs.js +2 -0
  247. package/dist/nile-wysiwyg-editor/ui/insert-menu.cjs.js.map +1 -0
  248. package/dist/nile-wysiwyg-editor/ui/insert-menu.esm.js +90 -0
  249. package/dist/nile-wysiwyg-editor/ui/link-editor.cjs.js +2 -0
  250. package/dist/nile-wysiwyg-editor/ui/link-editor.cjs.js.map +1 -0
  251. package/dist/nile-wysiwyg-editor/ui/link-editor.esm.js +114 -0
  252. package/dist/nile-wysiwyg-editor/ui/markdown-panel.cjs.js +2 -0
  253. package/dist/nile-wysiwyg-editor/ui/markdown-panel.cjs.js.map +1 -0
  254. package/dist/nile-wysiwyg-editor/ui/markdown-panel.esm.js +80 -0
  255. package/dist/nile-wysiwyg-editor/ui/math-panel.cjs.js +2 -0
  256. package/dist/nile-wysiwyg-editor/ui/math-panel.cjs.js.map +1 -0
  257. package/dist/nile-wysiwyg-editor/ui/math-panel.esm.js +92 -0
  258. package/dist/nile-wysiwyg-editor/ui/shortcut-help.cjs.js +2 -0
  259. package/dist/nile-wysiwyg-editor/ui/shortcut-help.cjs.js.map +1 -0
  260. package/dist/nile-wysiwyg-editor/ui/shortcut-help.esm.js +147 -0
  261. package/dist/nile-wysiwyg-editor/ui/source-view.cjs.js +2 -0
  262. package/dist/nile-wysiwyg-editor/ui/source-view.cjs.js.map +1 -0
  263. package/dist/nile-wysiwyg-editor/ui/source-view.esm.js +79 -0
  264. package/dist/nile-wysiwyg-editor/ui/special-chars.cjs.js +2 -0
  265. package/dist/nile-wysiwyg-editor/ui/special-chars.cjs.js.map +1 -0
  266. package/dist/nile-wysiwyg-editor/ui/special-chars.esm.js +96 -0
  267. package/dist/nile-wysiwyg-editor/ui/suggest-list.cjs.js +2 -0
  268. package/dist/nile-wysiwyg-editor/ui/suggest-list.cjs.js.map +1 -0
  269. package/dist/nile-wysiwyg-editor/ui/suggest-list.esm.js +67 -0
  270. package/dist/nile-wysiwyg-editor/ui/table-grid-picker.cjs.js +2 -0
  271. package/dist/nile-wysiwyg-editor/ui/table-grid-picker.cjs.js.map +1 -0
  272. package/dist/nile-wysiwyg-editor/ui/table-grid-picker.esm.js +100 -0
  273. package/dist/nile-wysiwyg-editor/ui/table-menu.cjs.js +2 -0
  274. package/dist/nile-wysiwyg-editor/ui/table-menu.cjs.js.map +1 -0
  275. package/dist/nile-wysiwyg-editor/ui/table-menu.esm.js +58 -0
  276. package/dist/src/index.d.ts +24 -0
  277. package/dist/src/index.js +19 -0
  278. package/dist/src/index.js.map +1 -1
  279. package/dist/src/internal/glyph.d.ts +6 -0
  280. package/dist/src/internal/glyph.js +13 -0
  281. package/dist/src/internal/glyph.js.map +1 -0
  282. package/dist/src/nile-chip/nile-chip.css.js +8 -1
  283. package/dist/src/nile-chip/nile-chip.css.js.map +1 -1
  284. package/dist/src/nile-code-editor/nile-code-editor.js +3 -3
  285. package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
  286. package/dist/src/nile-hero/nile-hero.css.js +12 -12
  287. package/dist/src/nile-hero/nile-hero.css.js.map +1 -1
  288. package/dist/src/nile-hero/nile-hero.js +1 -1
  289. package/dist/src/nile-hero/nile-hero.js.map +1 -1
  290. package/dist/src/nile-hero-header/nile-hero-header.css.js +9 -9
  291. package/dist/src/nile-hero-header/nile-hero-header.css.js.map +1 -1
  292. package/dist/src/nile-hero-header/nile-hero-header.js +1 -1
  293. package/dist/src/nile-hero-header/nile-hero-header.js.map +1 -1
  294. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.css.js +70 -0
  295. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.css.js.map +1 -1
  296. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.d.ts +3 -0
  297. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.js +81 -3
  298. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.js.map +1 -1
  299. package/dist/src/nile-rich-text-editor/nile-rte-image.d.ts +87 -0
  300. package/dist/src/nile-rich-text-editor/nile-rte-image.js +1073 -0
  301. package/dist/src/nile-rich-text-editor/nile-rte-image.js.map +1 -0
  302. package/dist/src/nile-wysiwyg-editor/emoji.d.ts +5 -0
  303. package/dist/src/nile-wysiwyg-editor/emoji.js +138 -0
  304. package/dist/src/nile-wysiwyg-editor/emoji.js.map +1 -0
  305. package/dist/src/nile-wysiwyg-editor/engine/commands.d.ts +69 -0
  306. package/dist/src/nile-wysiwyg-editor/engine/commands.js +863 -0
  307. package/dist/src/nile-wysiwyg-editor/engine/commands.js.map +1 -0
  308. package/dist/src/nile-wysiwyg-editor/engine/create-state.d.ts +35 -0
  309. package/dist/src/nile-wysiwyg-editor/engine/create-state.js +67 -0
  310. package/dist/src/nile-wysiwyg-editor/engine/create-state.js.map +1 -0
  311. package/dist/src/nile-wysiwyg-editor/engine/export.d.ts +38 -0
  312. package/dist/src/nile-wysiwyg-editor/engine/export.js +208 -0
  313. package/dist/src/nile-wysiwyg-editor/engine/export.js.map +1 -0
  314. package/dist/src/nile-wysiwyg-editor/engine/export.test.d.ts +1 -0
  315. package/dist/src/nile-wysiwyg-editor/engine/export.test.js +96 -0
  316. package/dist/src/nile-wysiwyg-editor/engine/export.test.js.map +1 -0
  317. package/dist/src/nile-wysiwyg-editor/engine/index.d.ts +37 -0
  318. package/dist/src/nile-wysiwyg-editor/engine/index.js +29 -0
  319. package/dist/src/nile-wysiwyg-editor/engine/index.js.map +1 -0
  320. package/dist/src/nile-wysiwyg-editor/engine/inputrules.d.ts +12 -0
  321. package/dist/src/nile-wysiwyg-editor/engine/inputrules.js +144 -0
  322. package/dist/src/nile-wysiwyg-editor/engine/inputrules.js.map +1 -0
  323. package/dist/src/nile-wysiwyg-editor/engine/keymap.d.ts +15 -0
  324. package/dist/src/nile-wysiwyg-editor/engine/keymap.js +94 -0
  325. package/dist/src/nile-wysiwyg-editor/engine/keymap.js.map +1 -0
  326. package/dist/src/nile-wysiwyg-editor/engine/markdown-parse.d.ts +22 -0
  327. package/dist/src/nile-wysiwyg-editor/engine/markdown-parse.js +287 -0
  328. package/dist/src/nile-wysiwyg-editor/engine/markdown-parse.js.map +1 -0
  329. package/dist/src/nile-wysiwyg-editor/engine/markdown-parse.test.d.ts +1 -0
  330. package/dist/src/nile-wysiwyg-editor/engine/markdown-parse.test.js +106 -0
  331. package/dist/src/nile-wysiwyg-editor/engine/markdown-parse.test.js.map +1 -0
  332. package/dist/src/nile-wysiwyg-editor/engine/markdown.d.ts +10 -0
  333. package/dist/src/nile-wysiwyg-editor/engine/markdown.js +162 -0
  334. package/dist/src/nile-wysiwyg-editor/engine/markdown.js.map +1 -0
  335. package/dist/src/nile-wysiwyg-editor/engine/office-paste.d.ts +13 -0
  336. package/dist/src/nile-wysiwyg-editor/engine/office-paste.js +182 -0
  337. package/dist/src/nile-wysiwyg-editor/engine/office-paste.js.map +1 -0
  338. package/dist/src/nile-wysiwyg-editor/engine/plugins/code-highlight.d.ts +10 -0
  339. package/dist/src/nile-wysiwyg-editor/engine/plugins/code-highlight.js +165 -0
  340. package/dist/src/nile-wysiwyg-editor/engine/plugins/code-highlight.js.map +1 -0
  341. package/dist/src/nile-wysiwyg-editor/engine/plugins/embed-view.d.ts +17 -0
  342. package/dist/src/nile-wysiwyg-editor/engine/plugins/embed-view.js +69 -0
  343. package/dist/src/nile-wysiwyg-editor/engine/plugins/embed-view.js.map +1 -0
  344. package/dist/src/nile-wysiwyg-editor/engine/plugins/embeds.d.ts +17 -0
  345. package/dist/src/nile-wysiwyg-editor/engine/plugins/embeds.js +96 -0
  346. package/dist/src/nile-wysiwyg-editor/engine/plugins/embeds.js.map +1 -0
  347. package/dist/src/nile-wysiwyg-editor/engine/plugins/find-replace.d.ts +26 -0
  348. package/dist/src/nile-wysiwyg-editor/engine/plugins/find-replace.js +123 -0
  349. package/dist/src/nile-wysiwyg-editor/engine/plugins/find-replace.js.map +1 -0
  350. package/dist/src/nile-wysiwyg-editor/engine/plugins/format-painter.d.ts +28 -0
  351. package/dist/src/nile-wysiwyg-editor/engine/plugins/format-painter.js +72 -0
  352. package/dist/src/nile-wysiwyg-editor/engine/plugins/format-painter.js.map +1 -0
  353. package/dist/src/nile-wysiwyg-editor/engine/plugins/image-view.d.ts +41 -0
  354. package/dist/src/nile-wysiwyg-editor/engine/plugins/image-view.js +176 -0
  355. package/dist/src/nile-wysiwyg-editor/engine/plugins/image-view.js.map +1 -0
  356. package/dist/src/nile-wysiwyg-editor/engine/plugins/image.d.ts +15 -0
  357. package/dist/src/nile-wysiwyg-editor/engine/plugins/image.js +64 -0
  358. package/dist/src/nile-wysiwyg-editor/engine/plugins/image.js.map +1 -0
  359. package/dist/src/nile-wysiwyg-editor/engine/plugins/link.d.ts +11 -0
  360. package/dist/src/nile-wysiwyg-editor/engine/plugins/link.js +42 -0
  361. package/dist/src/nile-wysiwyg-editor/engine/plugins/link.js.map +1 -0
  362. package/dist/src/nile-wysiwyg-editor/engine/plugins/math-view.d.ts +18 -0
  363. package/dist/src/nile-wysiwyg-editor/engine/plugins/math-view.js +46 -0
  364. package/dist/src/nile-wysiwyg-editor/engine/plugins/math-view.js.map +1 -0
  365. package/dist/src/nile-wysiwyg-editor/engine/plugins/max-length.d.ts +7 -0
  366. package/dist/src/nile-wysiwyg-editor/engine/plugins/max-length.js +26 -0
  367. package/dist/src/nile-wysiwyg-editor/engine/plugins/max-length.js.map +1 -0
  368. package/dist/src/nile-wysiwyg-editor/engine/plugins/paste.d.ts +31 -0
  369. package/dist/src/nile-wysiwyg-editor/engine/plugins/paste.js +55 -0
  370. package/dist/src/nile-wysiwyg-editor/engine/plugins/paste.js.map +1 -0
  371. package/dist/src/nile-wysiwyg-editor/engine/plugins/placeholder.d.ts +7 -0
  372. package/dist/src/nile-wysiwyg-editor/engine/plugins/placeholder.js +25 -0
  373. package/dist/src/nile-wysiwyg-editor/engine/plugins/placeholder.js.map +1 -0
  374. package/dist/src/nile-wysiwyg-editor/engine/plugins/single-line.d.ts +10 -0
  375. package/dist/src/nile-wysiwyg-editor/engine/plugins/single-line.js +48 -0
  376. package/dist/src/nile-wysiwyg-editor/engine/plugins/single-line.js.map +1 -0
  377. package/dist/src/nile-wysiwyg-editor/engine/plugins/suggestions.d.ts +29 -0
  378. package/dist/src/nile-wysiwyg-editor/engine/plugins/suggestions.js +87 -0
  379. package/dist/src/nile-wysiwyg-editor/engine/plugins/suggestions.js.map +1 -0
  380. package/dist/src/nile-wysiwyg-editor/engine/plugins/tables.d.ts +8 -0
  381. package/dist/src/nile-wysiwyg-editor/engine/plugins/tables.js +11 -0
  382. package/dist/src/nile-wysiwyg-editor/engine/plugins/tables.js.map +1 -0
  383. package/dist/src/nile-wysiwyg-editor/engine/plugins/task-list.d.ts +16 -0
  384. package/dist/src/nile-wysiwyg-editor/engine/plugins/task-list.js +49 -0
  385. package/dist/src/nile-wysiwyg-editor/engine/plugins/task-list.js.map +1 -0
  386. package/dist/src/nile-wysiwyg-editor/engine/pm.test.d.ts +1 -0
  387. package/dist/src/nile-wysiwyg-editor/engine/pm.test.js +883 -0
  388. package/dist/src/nile-wysiwyg-editor/engine/pm.test.js.map +1 -0
  389. package/dist/src/nile-wysiwyg-editor/engine/productivity.test.d.ts +1 -0
  390. package/dist/src/nile-wysiwyg-editor/engine/productivity.test.js +129 -0
  391. package/dist/src/nile-wysiwyg-editor/engine/productivity.test.js.map +1 -0
  392. package/dist/src/nile-wysiwyg-editor/engine/sanitize.d.ts +13 -0
  393. package/dist/src/nile-wysiwyg-editor/engine/sanitize.js +155 -0
  394. package/dist/src/nile-wysiwyg-editor/engine/sanitize.js.map +1 -0
  395. package/dist/src/nile-wysiwyg-editor/engine/schema.d.ts +20 -0
  396. package/dist/src/nile-wysiwyg-editor/engine/schema.js +823 -0
  397. package/dist/src/nile-wysiwyg-editor/engine/schema.js.map +1 -0
  398. package/dist/src/nile-wysiwyg-editor/engine/selection-state.d.ts +70 -0
  399. package/dist/src/nile-wysiwyg-editor/engine/selection-state.js +138 -0
  400. package/dist/src/nile-wysiwyg-editor/engine/selection-state.js.map +1 -0
  401. package/dist/src/nile-wysiwyg-editor/engine/serializer.d.ts +18 -0
  402. package/dist/src/nile-wysiwyg-editor/engine/serializer.js +63 -0
  403. package/dist/src/nile-wysiwyg-editor/engine/serializer.js.map +1 -0
  404. package/dist/src/nile-wysiwyg-editor/index.d.ts +3 -0
  405. package/dist/src/nile-wysiwyg-editor/index.js +3 -0
  406. package/dist/src/nile-wysiwyg-editor/index.js.map +1 -0
  407. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.d.ts +1 -0
  408. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.js +782 -0
  409. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.js.map +1 -0
  410. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.d.ts +364 -0
  411. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js +2038 -0
  412. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js.map +1 -0
  413. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.d.ts +1 -0
  414. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.js +636 -0
  415. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.js.map +1 -0
  416. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.d.ts +1 -0
  417. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.js +2 -0
  418. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.js.map +1 -0
  419. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.d.ts +6 -0
  420. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.js +251 -0
  421. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.js.map +1 -0
  422. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.d.ts +41 -0
  423. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.js +700 -0
  424. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.js.map +1 -0
  425. package/dist/src/nile-wysiwyg-editor/types.d.ts +49 -0
  426. package/dist/src/nile-wysiwyg-editor/types.js +8 -0
  427. package/dist/src/nile-wysiwyg-editor/types.js.map +1 -0
  428. package/dist/src/nile-wysiwyg-editor/ui/bookmark-panel.d.ts +20 -0
  429. package/dist/src/nile-wysiwyg-editor/ui/bookmark-panel.js +159 -0
  430. package/dist/src/nile-wysiwyg-editor/ui/bookmark-panel.js.map +1 -0
  431. package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.d.ts +21 -0
  432. package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.js +125 -0
  433. package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.js.map +1 -0
  434. package/dist/src/nile-wysiwyg-editor/ui/code-block-menu.d.ts +18 -0
  435. package/dist/src/nile-wysiwyg-editor/ui/code-block-menu.js +107 -0
  436. package/dist/src/nile-wysiwyg-editor/ui/code-block-menu.js.map +1 -0
  437. package/dist/src/nile-wysiwyg-editor/ui/embed-menu.d.ts +19 -0
  438. package/dist/src/nile-wysiwyg-editor/ui/embed-menu.js +123 -0
  439. package/dist/src/nile-wysiwyg-editor/ui/embed-menu.js.map +1 -0
  440. package/dist/src/nile-wysiwyg-editor/ui/embed-panel.d.ts +27 -0
  441. package/dist/src/nile-wysiwyg-editor/ui/embed-panel.js +146 -0
  442. package/dist/src/nile-wysiwyg-editor/ui/embed-panel.js.map +1 -0
  443. package/dist/src/nile-wysiwyg-editor/ui/emoji-picker.d.ts +21 -0
  444. package/dist/src/nile-wysiwyg-editor/ui/emoji-picker.js +154 -0
  445. package/dist/src/nile-wysiwyg-editor/ui/emoji-picker.js.map +1 -0
  446. package/dist/src/nile-wysiwyg-editor/ui/find-replace.d.ts +26 -0
  447. package/dist/src/nile-wysiwyg-editor/ui/find-replace.js +178 -0
  448. package/dist/src/nile-wysiwyg-editor/ui/find-replace.js.map +1 -0
  449. package/dist/src/nile-wysiwyg-editor/ui/image-menu.d.ts +18 -0
  450. package/dist/src/nile-wysiwyg-editor/ui/image-menu.js +129 -0
  451. package/dist/src/nile-wysiwyg-editor/ui/image-menu.js.map +1 -0
  452. package/dist/src/nile-wysiwyg-editor/ui/image-panel.d.ts +56 -0
  453. package/dist/src/nile-wysiwyg-editor/ui/image-panel.js +349 -0
  454. package/dist/src/nile-wysiwyg-editor/ui/image-panel.js.map +1 -0
  455. package/dist/src/nile-wysiwyg-editor/ui/insert-menu.d.ts +25 -0
  456. package/dist/src/nile-wysiwyg-editor/ui/insert-menu.js +142 -0
  457. package/dist/src/nile-wysiwyg-editor/ui/insert-menu.js.map +1 -0
  458. package/dist/src/nile-wysiwyg-editor/ui/link-editor.d.ts +30 -0
  459. package/dist/src/nile-wysiwyg-editor/ui/link-editor.js +189 -0
  460. package/dist/src/nile-wysiwyg-editor/ui/link-editor.js.map +1 -0
  461. package/dist/src/nile-wysiwyg-editor/ui/markdown-panel.d.ts +24 -0
  462. package/dist/src/nile-wysiwyg-editor/ui/markdown-panel.js +144 -0
  463. package/dist/src/nile-wysiwyg-editor/ui/markdown-panel.js.map +1 -0
  464. package/dist/src/nile-wysiwyg-editor/ui/math-panel.d.ts +31 -0
  465. package/dist/src/nile-wysiwyg-editor/ui/math-panel.js +172 -0
  466. package/dist/src/nile-wysiwyg-editor/ui/math-panel.js.map +1 -0
  467. package/dist/src/nile-wysiwyg-editor/ui/shortcut-help.d.ts +30 -0
  468. package/dist/src/nile-wysiwyg-editor/ui/shortcut-help.js +296 -0
  469. package/dist/src/nile-wysiwyg-editor/ui/shortcut-help.js.map +1 -0
  470. package/dist/src/nile-wysiwyg-editor/ui/source-view.d.ts +19 -0
  471. package/dist/src/nile-wysiwyg-editor/ui/source-view.js +120 -0
  472. package/dist/src/nile-wysiwyg-editor/ui/source-view.js.map +1 -0
  473. package/dist/src/nile-wysiwyg-editor/ui/special-chars.d.ts +20 -0
  474. package/dist/src/nile-wysiwyg-editor/ui/special-chars.js +199 -0
  475. package/dist/src/nile-wysiwyg-editor/ui/special-chars.js.map +1 -0
  476. package/dist/src/nile-wysiwyg-editor/ui/suggest-list.d.ts +31 -0
  477. package/dist/src/nile-wysiwyg-editor/ui/suggest-list.js +133 -0
  478. package/dist/src/nile-wysiwyg-editor/ui/suggest-list.js.map +1 -0
  479. package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.d.ts +23 -0
  480. package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.js +177 -0
  481. package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.js.map +1 -0
  482. package/dist/src/nile-wysiwyg-editor/ui/table-menu.d.ts +16 -0
  483. package/dist/src/nile-wysiwyg-editor/ui/table-menu.js +101 -0
  484. package/dist/src/nile-wysiwyg-editor/ui/table-menu.js.map +1 -0
  485. package/dist/src/version.js +1 -1
  486. package/dist/src/version.js.map +1 -1
  487. package/dist/tsconfig.tsbuildinfo +1 -1
  488. package/package.json +18 -2
  489. package/src/index.ts +57 -1
  490. package/src/internal/glyph.ts +13 -0
  491. package/src/nile-chip/nile-chip.css.ts +8 -1
  492. package/src/nile-code-editor/nile-code-editor.ts +3 -3
  493. package/src/nile-hero/nile-hero.css.ts +12 -12
  494. package/src/nile-hero/nile-hero.ts +1 -1
  495. package/src/nile-hero-header/nile-hero-header.css.ts +9 -9
  496. package/src/nile-hero-header/nile-hero-header.ts +1 -1
  497. package/src/nile-rich-text-editor/nile-rich-text-editor.css.ts +70 -0
  498. package/src/nile-rich-text-editor/nile-rich-text-editor.ts +89 -3
  499. package/src/nile-rich-text-editor/nile-rte-image.ts +1132 -0
  500. package/src/nile-wysiwyg-editor/emoji.ts +137 -0
  501. package/src/nile-wysiwyg-editor/engine/commands.ts +1035 -0
  502. package/src/nile-wysiwyg-editor/engine/create-state.ts +117 -0
  503. package/src/nile-wysiwyg-editor/engine/export.test.ts +113 -0
  504. package/src/nile-wysiwyg-editor/engine/export.ts +242 -0
  505. package/src/nile-wysiwyg-editor/engine/index.ts +69 -0
  506. package/src/nile-wysiwyg-editor/engine/inputrules.ts +169 -0
  507. package/src/nile-wysiwyg-editor/engine/keymap.ts +146 -0
  508. package/src/nile-wysiwyg-editor/engine/markdown-parse.test.ts +148 -0
  509. package/src/nile-wysiwyg-editor/engine/markdown-parse.ts +337 -0
  510. package/src/nile-wysiwyg-editor/engine/markdown.ts +165 -0
  511. package/src/nile-wysiwyg-editor/engine/office-paste.ts +199 -0
  512. package/src/nile-wysiwyg-editor/engine/plugins/code-highlight.ts +173 -0
  513. package/src/nile-wysiwyg-editor/engine/plugins/embed-view.ts +85 -0
  514. package/src/nile-wysiwyg-editor/engine/plugins/embeds.ts +99 -0
  515. package/src/nile-wysiwyg-editor/engine/plugins/find-replace.ts +155 -0
  516. package/src/nile-wysiwyg-editor/engine/plugins/format-painter.ts +80 -0
  517. package/src/nile-wysiwyg-editor/engine/plugins/image-view.ts +220 -0
  518. package/src/nile-wysiwyg-editor/engine/plugins/image.ts +80 -0
  519. package/src/nile-wysiwyg-editor/engine/plugins/link.ts +42 -0
  520. package/src/nile-wysiwyg-editor/engine/plugins/math-view.ts +56 -0
  521. package/src/nile-wysiwyg-editor/engine/plugins/max-length.ts +24 -0
  522. package/src/nile-wysiwyg-editor/engine/plugins/paste.ts +74 -0
  523. package/src/nile-wysiwyg-editor/engine/plugins/placeholder.ts +24 -0
  524. package/src/nile-wysiwyg-editor/engine/plugins/single-line.ts +47 -0
  525. package/src/nile-wysiwyg-editor/engine/plugins/suggestions.ts +110 -0
  526. package/src/nile-wysiwyg-editor/engine/plugins/tables.ts +12 -0
  527. package/src/nile-wysiwyg-editor/engine/plugins/task-list.ts +65 -0
  528. package/src/nile-wysiwyg-editor/engine/pm.test.ts +1088 -0
  529. package/src/nile-wysiwyg-editor/engine/productivity.test.ts +163 -0
  530. package/src/nile-wysiwyg-editor/engine/sanitize.ts +156 -0
  531. package/src/nile-wysiwyg-editor/engine/schema.ts +859 -0
  532. package/src/nile-wysiwyg-editor/engine/selection-state.ts +210 -0
  533. package/src/nile-wysiwyg-editor/engine/serializer.ts +78 -0
  534. package/src/nile-wysiwyg-editor/index.ts +3 -0
  535. package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.ts +782 -0
  536. package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.ts +750 -0
  537. package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.ts +2155 -0
  538. package/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.ts +1 -0
  539. package/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.ts +251 -0
  540. package/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.ts +772 -0
  541. package/src/nile-wysiwyg-editor/types.ts +83 -0
  542. package/src/nile-wysiwyg-editor/ui/bookmark-panel.ts +155 -0
  543. package/src/nile-wysiwyg-editor/ui/bubble-menu.ts +135 -0
  544. package/src/nile-wysiwyg-editor/ui/code-block-menu.ts +105 -0
  545. package/src/nile-wysiwyg-editor/ui/embed-menu.ts +133 -0
  546. package/src/nile-wysiwyg-editor/ui/embed-panel.ts +143 -0
  547. package/src/nile-wysiwyg-editor/ui/emoji-picker.ts +152 -0
  548. package/src/nile-wysiwyg-editor/ui/find-replace.ts +174 -0
  549. package/src/nile-wysiwyg-editor/ui/image-menu.ts +140 -0
  550. package/src/nile-wysiwyg-editor/ui/image-panel.ts +337 -0
  551. package/src/nile-wysiwyg-editor/ui/insert-menu.ts +142 -0
  552. package/src/nile-wysiwyg-editor/ui/link-editor.ts +180 -0
  553. package/src/nile-wysiwyg-editor/ui/markdown-panel.ts +143 -0
  554. package/src/nile-wysiwyg-editor/ui/math-panel.ts +169 -0
  555. package/src/nile-wysiwyg-editor/ui/shortcut-help.ts +311 -0
  556. package/src/nile-wysiwyg-editor/ui/source-view.ts +119 -0
  557. package/src/nile-wysiwyg-editor/ui/special-chars.ts +209 -0
  558. package/src/nile-wysiwyg-editor/ui/suggest-list.ts +138 -0
  559. package/src/nile-wysiwyg-editor/ui/table-grid-picker.ts +173 -0
  560. package/src/nile-wysiwyg-editor/ui/table-menu.ts +109 -0
  561. package/vscode-html-custom-data.json +491 -1
  562. package/web-dev-server.config.mjs +6 -2
  563. package/dist/index-5fef1a0d.esm.js +0 -1
  564. package/dist/index-8f38fae3.cjs.js +0 -2
  565. package/dist/index-8f38fae3.cjs.js.map +0 -1
@@ -0,0 +1,220 @@
1
+ import { Node as PMNode } from 'prosemirror-model';
2
+ import { EditorView, NodeView } from 'prosemirror-view';
3
+ import { NodeSelection } from 'prosemirror-state';
4
+
5
+ const MIN_WIDTH = 40;
6
+
7
+ /**
8
+ * Attaches four corner drag-handles to a wrapper and returns a cleanup
9
+ * function. Dragging previews by mutating the target's style; on release the
10
+ * final width is committed through onCommit (one transaction).
11
+ */
12
+ export function attachResizeHandles(
13
+ wrapper: HTMLElement,
14
+ img: HTMLElement,
15
+ onCommit: (width: number) => void,
16
+ minWidth: number = MIN_WIDTH
17
+ ): void {
18
+ for (const corner of ['nw', 'ne', 'sw', 'se']) {
19
+ const handle = document.createElement('span');
20
+ handle.className = `nile-wysiwyg__resize-handle nile-wysiwyg__resize-handle--${corner}`;
21
+ handle.dataset.resizeHandle = corner;
22
+ handle.contentEditable = 'false';
23
+ handle.addEventListener('mousedown', event => {
24
+ event.preventDefault();
25
+ event.stopPropagation();
26
+ const startX = event.clientX;
27
+ const startWidth = img.getBoundingClientRect().width;
28
+ const sign = corner.includes('w') ? -1 : 1;
29
+ const maxWidth =
30
+ wrapper.closest('.ProseMirror')?.getBoundingClientRect().width ?? 2000;
31
+ let width = startWidth;
32
+ const onMove = (move: MouseEvent): void => {
33
+ width = Math.max(
34
+ minWidth,
35
+ Math.min(maxWidth, startWidth + sign * (move.clientX - startX))
36
+ );
37
+ img.style.width = `${Math.round(width)}px`;
38
+ };
39
+ const onUp = (): void => {
40
+ window.removeEventListener('mousemove', onMove);
41
+ window.removeEventListener('mouseup', onUp);
42
+ wrapper.classList.remove('nile-wysiwyg__resizing');
43
+ onCommit(Math.round(width));
44
+ };
45
+ // While dragging, iframes inside the wrapper must not swallow mouse
46
+ // events (they are separate documents); CSS keys off this class.
47
+ wrapper.classList.add('nile-wysiwyg__resizing');
48
+ window.addEventListener('mousemove', onMove);
49
+ window.addEventListener('mouseup', onUp);
50
+ });
51
+ wrapper.appendChild(handle);
52
+ }
53
+ }
54
+
55
+ export function isResizeEvent(event: Event): boolean {
56
+ return (
57
+ event.target instanceof HTMLElement && !!event.target.dataset.resizeHandle
58
+ );
59
+ }
60
+
61
+ /** Inline image with drag-resize handles shown while selected. */
62
+ export class ImageView implements NodeView {
63
+ dom: HTMLSpanElement;
64
+
65
+ private img: HTMLImageElement;
66
+
67
+ constructor(
68
+ private node: PMNode,
69
+ view: EditorView,
70
+ getPos: () => number | undefined
71
+ ) {
72
+ this.dom = document.createElement('span');
73
+ this.dom.className = 'nile-wysiwyg__image-resizer';
74
+ this.img = document.createElement('img');
75
+ this.applyAttrs(node);
76
+ this.dom.appendChild(this.img);
77
+ attachResizeHandles(this.dom, this.img, width => {
78
+ const pos = getPos();
79
+ if (pos === undefined || !view.editable) return;
80
+ const current = view.state.doc.nodeAt(pos);
81
+ if (!current) return;
82
+ view.dispatch(
83
+ view.state.tr.setNodeMarkup(pos, undefined, { ...current.attrs, width })
84
+ );
85
+ });
86
+ }
87
+
88
+ private applyAttrs(node: PMNode): void {
89
+ const { src, alt, title, width } = node.attrs;
90
+ this.img.src = src;
91
+ if (alt) this.img.alt = alt;
92
+ else this.img.removeAttribute('alt');
93
+ if (title) this.img.title = title;
94
+ else this.img.removeAttribute('title');
95
+ this.img.style.width = width ? `${width}px` : '';
96
+ }
97
+
98
+ update(node: PMNode): boolean {
99
+ if (node.type !== this.node.type) return false;
100
+ this.node = node;
101
+ this.applyAttrs(node);
102
+ return true;
103
+ }
104
+
105
+ selectNode(): void {
106
+ this.dom.classList.add('nile-wysiwyg__image-resizer--selected');
107
+ }
108
+
109
+ deselectNode(): void {
110
+ this.dom.classList.remove('nile-wysiwyg__image-resizer--selected');
111
+ }
112
+
113
+ stopEvent(event: Event): boolean {
114
+ return isResizeEvent(event);
115
+ }
116
+
117
+ ignoreMutation(): boolean {
118
+ return true;
119
+ }
120
+ }
121
+
122
+ /**
123
+ * Captioned figure: non-editable image (with resize handles) above an
124
+ * editable figcaption (the node's content). Clicking the image selects the
125
+ * whole figure.
126
+ */
127
+ export class FigureView implements NodeView {
128
+ dom: HTMLElement;
129
+
130
+ contentDOM: HTMLElement;
131
+
132
+ private img: HTMLImageElement;
133
+
134
+ private wrapper: HTMLSpanElement;
135
+
136
+ constructor(
137
+ private node: PMNode,
138
+ view: EditorView,
139
+ getPos: () => number | undefined
140
+ ) {
141
+ this.dom = document.createElement('figure');
142
+ this.dom.className = 'nile-wysiwyg__figure';
143
+
144
+ this.wrapper = document.createElement('span');
145
+ this.wrapper.className = 'nile-wysiwyg__image-resizer';
146
+ this.wrapper.contentEditable = 'false';
147
+ this.img = document.createElement('img');
148
+ this.wrapper.appendChild(this.img);
149
+
150
+ this.contentDOM = document.createElement('figcaption');
151
+ this.contentDOM.className = 'nile-wysiwyg__figcaption';
152
+
153
+ this.dom.append(this.wrapper, this.contentDOM);
154
+ this.applyAttrs(node);
155
+
156
+ // Clicking the image selects the figure node (instead of dropping the
157
+ // cursor into the caption).
158
+ this.img.addEventListener('mousedown', event => {
159
+ event.preventDefault();
160
+ const pos = getPos();
161
+ if (pos === undefined) return;
162
+ view.dispatch(
163
+ view.state.tr.setSelection(NodeSelection.create(view.state.doc, pos))
164
+ );
165
+ view.focus();
166
+ });
167
+
168
+ attachResizeHandles(this.wrapper, this.img, width => {
169
+ const pos = getPos();
170
+ if (pos === undefined || !view.editable) return;
171
+ const current = view.state.doc.nodeAt(pos);
172
+ if (!current) return;
173
+ view.dispatch(
174
+ view.state.tr.setNodeMarkup(pos, undefined, { ...current.attrs, width })
175
+ );
176
+ });
177
+ }
178
+
179
+ private applyAttrs(node: PMNode): void {
180
+ const { src, alt, title, width, align } = node.attrs;
181
+ this.img.src = src;
182
+ if (alt) this.img.alt = alt;
183
+ else this.img.removeAttribute('alt');
184
+ if (title) this.img.title = title;
185
+ else this.img.removeAttribute('title');
186
+ this.dom.style.width = width ? `${width}px` : '';
187
+ if (align) this.dom.setAttribute('data-align', align);
188
+ else this.dom.removeAttribute('data-align');
189
+ this.dom.classList.toggle(
190
+ 'nile-wysiwyg__figure--empty-caption',
191
+ node.content.size === 0
192
+ );
193
+ }
194
+
195
+ update(node: PMNode): boolean {
196
+ if (node.type !== this.node.type) return false;
197
+ this.node = node;
198
+ this.applyAttrs(node);
199
+ return true;
200
+ }
201
+
202
+ selectNode(): void {
203
+ this.dom.classList.add('nile-wysiwyg__figure--selected');
204
+ this.wrapper.classList.add('nile-wysiwyg__image-resizer--selected');
205
+ }
206
+
207
+ deselectNode(): void {
208
+ this.dom.classList.remove('nile-wysiwyg__figure--selected');
209
+ this.wrapper.classList.remove('nile-wysiwyg__image-resizer--selected');
210
+ }
211
+
212
+ stopEvent(event: Event): boolean {
213
+ return isResizeEvent(event);
214
+ }
215
+
216
+ ignoreMutation(mutation: MutationRecord): boolean {
217
+ // Caption edits must flow through; image/handle mutations must not.
218
+ return !this.contentDOM.contains(mutation.target);
219
+ }
220
+ }
@@ -0,0 +1,80 @@
1
+ import { Plugin, PluginKey, EditorState } from 'prosemirror-state';
2
+ import { Decoration, DecorationSet } from 'prosemirror-view';
3
+
4
+ export const imageUploadKey = new PluginKey<DecorationSet>('nileImageUpload');
5
+
6
+ interface UploadMeta {
7
+ add?: { id: string; pos: number };
8
+ remove?: { id: string };
9
+ }
10
+
11
+ export interface ImagePluginOptions {
12
+ /** Called with image files pasted or dropped into the editor. */
13
+ onImageFiles?: (files: File[], pos: number | null) => void;
14
+ }
15
+
16
+ function imageFilesFrom(data: DataTransfer | null): File[] {
17
+ if (!data) return [];
18
+ return Array.from(data.files).filter(file => file.type.startsWith('image/'));
19
+ }
20
+
21
+ /**
22
+ * Image behaviors: routes pasted/dropped image files to the host's upload
23
+ * flow and tracks "uploading…" widget decorations that survive concurrent
24
+ * edits by mapping through transactions.
25
+ */
26
+ export function imagePlugin(options: ImagePluginOptions = {}): Plugin<DecorationSet> {
27
+ return new Plugin<DecorationSet>({
28
+ key: imageUploadKey,
29
+
30
+ state: {
31
+ init: () => DecorationSet.empty,
32
+ apply(tr, set) {
33
+ let mapped = set.map(tr.mapping, tr.doc);
34
+ const meta = tr.getMeta(imageUploadKey) as UploadMeta | undefined;
35
+ if (meta?.add) {
36
+ const widget = document.createElement('span');
37
+ widget.className = 'nile-wysiwyg__upload-placeholder';
38
+ widget.textContent = 'Uploading image…';
39
+ mapped = mapped.add(tr.doc, [
40
+ Decoration.widget(meta.add.pos, widget, { id: meta.add.id }),
41
+ ]);
42
+ }
43
+ if (meta?.remove) {
44
+ mapped = mapped.remove(
45
+ mapped.find(undefined, undefined, spec => spec.id === meta.remove!.id)
46
+ );
47
+ }
48
+ return mapped;
49
+ },
50
+ },
51
+
52
+ props: {
53
+ decorations(state) {
54
+ return imageUploadKey.getState(state);
55
+ },
56
+
57
+ handlePaste(_view, event) {
58
+ const files = imageFilesFrom(event.clipboardData);
59
+ if (files.length === 0 || !options.onImageFiles) return false;
60
+ options.onImageFiles(files, null);
61
+ return true;
62
+ },
63
+
64
+ handleDrop(view, event) {
65
+ const files = imageFilesFrom(event.dataTransfer);
66
+ if (files.length === 0 || !options.onImageFiles) return false;
67
+ const drop = view.posAtCoords({ left: event.clientX, top: event.clientY });
68
+ options.onImageFiles(files, drop ? drop.pos : null);
69
+ return true;
70
+ },
71
+ },
72
+ });
73
+ }
74
+
75
+ /** Position of an upload placeholder, after mapping through edits. */
76
+ export function findUploadPos(state: EditorState, id: string): number | null {
77
+ const set = imageUploadKey.getState(state);
78
+ const found = set?.find(undefined, undefined, spec => spec.id === id);
79
+ return found && found.length ? found[0].from : null;
80
+ }
@@ -0,0 +1,42 @@
1
+ import { Plugin } from 'prosemirror-state';
2
+ import { isSafeUrl } from '../sanitize';
3
+
4
+ const URL_PATTERN = /^https?:\/\/\S+$/i;
5
+
6
+ export interface LinkPluginOptions {
7
+ /** Called with the href when a link is Mod/Ctrl-clicked. */
8
+ onOpenLink?: (href: string) => void;
9
+ }
10
+
11
+ /**
12
+ * Link behaviors that belong to the document, not the chrome:
13
+ * - Mod/Ctrl-click opens the link.
14
+ * - Pasting a bare URL over a text selection turns the selection into a link.
15
+ */
16
+ export function linkPlugin(options: LinkPluginOptions = {}): Plugin {
17
+ return new Plugin({
18
+ props: {
19
+ handleClick(view, _pos, event) {
20
+ if (!(event.metaKey || event.ctrlKey)) return false;
21
+ const target = (event.target as HTMLElement | null)?.closest?.('a[href]');
22
+ if (!target) return false;
23
+ const href = target.getAttribute('href')!;
24
+ if (!isSafeUrl(href)) return false;
25
+ if (options.onOpenLink) options.onOpenLink(href);
26
+ else window.open(href, '_blank', 'noopener,noreferrer');
27
+ return true;
28
+ },
29
+
30
+ handlePaste(view, event) {
31
+ const { state } = view;
32
+ const { empty, from, to } = state.selection;
33
+ if (empty) return false;
34
+ const text = event.clipboardData?.getData('text/plain')?.trim();
35
+ if (!text || !URL_PATTERN.test(text) || !isSafeUrl(text)) return false;
36
+ const linkMark = state.schema.marks.link.create({ href: text });
37
+ view.dispatch(state.tr.addMark(from, to, linkMark));
38
+ return true;
39
+ },
40
+ },
41
+ });
42
+ }
@@ -0,0 +1,56 @@
1
+ import { Node as PMNode } from 'prosemirror-model';
2
+ import { NodeView } from 'prosemirror-view';
3
+
4
+ /** Turns a LaTeX string into HTML (KaTeX/MathJax/MathML). Host-provided. */
5
+ export type MathRenderer = (latex: string, display: 'inline' | 'block') => string;
6
+
7
+ /**
8
+ * Inline atom rendering a math formula. When the host supplies a renderer the
9
+ * formula is drawn with it; otherwise the raw LaTeX is shown in a math chip so
10
+ * the content is still visible and editable without a math engine.
11
+ */
12
+ export class MathView implements NodeView {
13
+ dom: HTMLSpanElement;
14
+
15
+ private renderer?: MathRenderer;
16
+
17
+ constructor(node: PMNode, renderer?: MathRenderer) {
18
+ this.renderer = renderer;
19
+ this.dom = document.createElement('span');
20
+ this.dom.contentEditable = 'false';
21
+ this.render(node);
22
+ }
23
+
24
+ private render(node: PMNode): void {
25
+ const latex = (node.attrs.latex as string) ?? '';
26
+ const display = (node.attrs.display as 'inline' | 'block') ?? 'inline';
27
+ this.dom.className =
28
+ display === 'block'
29
+ ? 'nile-wysiwyg__math nile-wysiwyg__math--block'
30
+ : 'nile-wysiwyg__math';
31
+ this.dom.setAttribute('data-math', latex);
32
+ this.dom.setAttribute('data-math-display', display);
33
+ this.dom.title = latex;
34
+ if (this.renderer) {
35
+ try {
36
+ // Host renderer output is trusted (same trust level as uploadHandler).
37
+ this.dom.innerHTML = this.renderer(latex, display);
38
+ return;
39
+ } catch {
40
+ // Fall back to raw LaTeX if the renderer throws.
41
+ }
42
+ }
43
+ this.dom.textContent = latex;
44
+ }
45
+
46
+ update(node: PMNode): boolean {
47
+ if (node.type.name !== 'math') return false;
48
+ this.render(node);
49
+ return true;
50
+ }
51
+
52
+ /** Atom node: ProseMirror owns selection; never read our subtree back. */
53
+ ignoreMutation(): boolean {
54
+ return true;
55
+ }
56
+ }
@@ -0,0 +1,24 @@
1
+ import { Plugin } from 'prosemirror-state';
2
+ import { docToText } from '../serializer';
3
+
4
+ function charCount(doc: import('prosemirror-model').Node): number {
5
+ return docToText(doc).replace(/\n/g, '').length;
6
+ }
7
+
8
+ /**
9
+ * Enforces a character limit by rejecting transactions that grow the
10
+ * document past it. Shrinking edits are always allowed, even while over the
11
+ * limit (e.g. after the limit was lowered), so users can recover.
12
+ */
13
+ export function maxLengthPlugin(getMaxLength: () => number): Plugin {
14
+ return new Plugin({
15
+ filterTransaction(tr, state) {
16
+ if (!tr.docChanged) return true;
17
+ const max = getMaxLength();
18
+ if (!max || max <= 0) return true;
19
+ const after = charCount(tr.doc);
20
+ if (after <= max) return true;
21
+ return after < charCount(state.doc);
22
+ },
23
+ });
24
+ }
@@ -0,0 +1,74 @@
1
+ import { Plugin } from 'prosemirror-state';
2
+ import { Slice, Fragment, Node as PMNode, Schema } from 'prosemirror-model';
3
+ import { markdownToHtml, looksLikeMarkdown } from '../markdown-parse';
4
+ import { htmlToSlice } from '../serializer';
5
+
6
+ /**
7
+ * Builds a slice of plain paragraphs from text, splitting on newlines. Open
8
+ * depth 1 on both ends lets the first/last block merge into the surrounding
9
+ * paragraph, matching how a normal plain-text paste behaves.
10
+ */
11
+ export function plainTextSlice(schema: Schema, text: string): Slice {
12
+ const blocks = text.split(/\r\n?|\n/);
13
+ const nodes: PMNode[] = blocks.map(line =>
14
+ schema.nodes.paragraph.create(null, line ? schema.text(line) : null)
15
+ );
16
+ return new Slice(Fragment.from(nodes), 1, 1);
17
+ }
18
+
19
+ /** Reduces a pasted slice to unstyled text, preserving block breaks. */
20
+ export function stripSliceFormatting(schema: Schema, slice: Slice): Slice {
21
+ const text = slice.content.textBetween(0, slice.content.size, '\n', '\n');
22
+ return plainTextSlice(schema, text);
23
+ }
24
+
25
+ export interface PasteOptions {
26
+ /**
27
+ * Read live: when it returns true, every paste drops formatting (the
28
+ * persistent "paste as plain text" toggle). The Ctrl+Shift+V shortcut is a
29
+ * separate one-shot handled in the keymap.
30
+ */
31
+ getForcePlainText?: () => boolean;
32
+ /**
33
+ * Read live: when false, plain-text pastes are never parsed as Markdown.
34
+ * Defaults to on.
35
+ */
36
+ getMarkdownPaste?: () => boolean;
37
+ /** Read live: whether pasted HTML is sanitized. Defaults to on. */
38
+ getSanitize?: () => boolean;
39
+ }
40
+
41
+ /**
42
+ * Paste behavior: plain-text pastes that look like Markdown are parsed into
43
+ * rich content (headings, lists, code fences, tables, inline marks), and all
44
+ * pastes drop formatting while the host's plain-text toggle is on.
45
+ */
46
+ export function pastePlugin(schema: Schema, options: PasteOptions = {}): Plugin {
47
+ return new Plugin({
48
+ props: {
49
+ handlePaste(view, event) {
50
+ if (options.getForcePlainText?.()) return false;
51
+ if (options.getMarkdownPaste && !options.getMarkdownPaste()) return false;
52
+ // Only plain-text pastes qualify: an HTML flavor means the source
53
+ // was already rich, and code blocks take text verbatim.
54
+ const html = event.clipboardData?.getData('text/html') ?? '';
55
+ const text = event.clipboardData?.getData('text/plain') ?? '';
56
+ if (html.trim() || !text.trim()) return false;
57
+ if (view.state.selection.$from.parent.type.spec.code) return false;
58
+ if (!looksLikeMarkdown(text)) return false;
59
+ const slice = htmlToSlice(
60
+ schema,
61
+ markdownToHtml(text),
62
+ options.getSanitize?.() ?? true
63
+ );
64
+ view.dispatch(view.state.tr.replaceSelection(slice).scrollIntoView());
65
+ return true;
66
+ },
67
+ transformPasted(slice) {
68
+ return options.getForcePlainText?.()
69
+ ? stripSliceFormatting(schema, slice)
70
+ : slice;
71
+ },
72
+ },
73
+ });
74
+ }
@@ -0,0 +1,24 @@
1
+ import { Plugin } from 'prosemirror-state';
2
+ import { Decoration, DecorationSet } from 'prosemirror-view';
3
+ import { isDocEmpty } from '../serializer';
4
+
5
+ /**
6
+ * Shows placeholder text on the first paragraph while the document is empty.
7
+ * The text itself is rendered by CSS (`content: attr(data-placeholder)`) so
8
+ * it never enters the document.
9
+ */
10
+ export function placeholderPlugin(getText: () => string): Plugin {
11
+ return new Plugin({
12
+ props: {
13
+ decorations(state) {
14
+ const text = getText();
15
+ if (!text || !isDocEmpty(state.doc)) return null;
16
+ const deco = Decoration.node(0, state.doc.firstChild!.nodeSize, {
17
+ class: 'nile-wysiwyg__empty',
18
+ 'data-placeholder': text,
19
+ });
20
+ return DecorationSet.create(state.doc, [deco]);
21
+ },
22
+ },
23
+ });
24
+ }
@@ -0,0 +1,47 @@
1
+ import { Plugin } from 'prosemirror-state';
2
+ import { Slice, Fragment, Node as PMNode } from 'prosemirror-model';
3
+
4
+ /** Flattens a multi-block document into a single paragraph, keeping marks. */
5
+ export function flattenToSingleParagraph(doc: PMNode): PMNode {
6
+ if (doc.childCount <= 1) return doc;
7
+ const schema = doc.type.schema;
8
+ const inline: PMNode[] = [];
9
+ doc.descendants(node => {
10
+ if (node.isInline) {
11
+ if (node.type === schema.nodes.hard_break) return false;
12
+ inline.push(node);
13
+ return false;
14
+ }
15
+ return true;
16
+ });
17
+ return schema.nodes.doc.create(null, schema.nodes.paragraph.create(null, inline));
18
+ }
19
+
20
+ /**
21
+ * Constrains the document to a single paragraph: Enter is inert, pasted
22
+ * multi-block content is flattened to one line, and any transaction that
23
+ * would still produce extra blocks is rejected.
24
+ */
25
+ export function singleLinePlugin(): Plugin {
26
+ return new Plugin({
27
+ filterTransaction(tr) {
28
+ return !tr.docChanged || tr.doc.childCount <= 1;
29
+ },
30
+ props: {
31
+ handleKeyDown(_view, event) {
32
+ return event.key === 'Enter';
33
+ },
34
+ transformPasted(slice) {
35
+ const inline: PMNode[] = [];
36
+ slice.content.descendants(node => {
37
+ if (node.isInline) {
38
+ inline.push(node);
39
+ return false;
40
+ }
41
+ return true;
42
+ });
43
+ return new Slice(Fragment.from(inline), 0, 0);
44
+ },
45
+ },
46
+ });
47
+ }
@@ -0,0 +1,110 @@
1
+ import { Plugin, PluginKey, EditorState } from 'prosemirror-state';
2
+ import { Decoration, DecorationSet } from 'prosemirror-view';
3
+
4
+ /** Live state of a trigger-character suggestion (mention or slash command). */
5
+ export interface SuggestionMatch {
6
+ active: boolean;
7
+ trigger: string;
8
+ query: string;
9
+ /** Doc range spanning trigger + query, to replace on selection. */
10
+ from: number;
11
+ to: number;
12
+ }
13
+
14
+ export const INACTIVE_SUGGESTION: SuggestionMatch = {
15
+ active: false,
16
+ trigger: '',
17
+ query: '',
18
+ from: 0,
19
+ to: 0,
20
+ };
21
+
22
+ export interface SuggestionOptions {
23
+ /** Read live so trigger config can change without rebuilding state. */
24
+ getTriggers: () => string[];
25
+ /** Restrict to the start of an empty-ish textblock (slash commands). */
26
+ startOfLine?: boolean;
27
+ /** Stay inactive until the query reaches this length (emoji ":" noise). */
28
+ minQueryLength?: number;
29
+ /** Notified on every state change (including becoming inactive). */
30
+ onChange: (match: SuggestionMatch) => void;
31
+ /** Intercept keys (arrows/Enter/Escape) while a suggestion is active. */
32
+ onKeyDown?: (event: KeyboardEvent, match: SuggestionMatch) => boolean;
33
+ }
34
+
35
+ const MAX_QUERY_LENGTH = 50;
36
+
37
+ function findSuggestion(state: EditorState, options: SuggestionOptions): SuggestionMatch {
38
+ const { $from, empty } = state.selection;
39
+ if (!empty || !$from.parent.isTextblock || $from.parent.type.spec.code) {
40
+ return INACTIVE_SUGGESTION;
41
+ }
42
+ const textBefore = $from.parent.textBetween(0, $from.parentOffset, '\0', '\0');
43
+ // Longest triggers first so '{{' wins over '{'.
44
+ const triggers = [...options.getTriggers()].sort((a, b) => b.length - a.length);
45
+ for (const trigger of triggers) {
46
+ if (!trigger) continue;
47
+ const index = textBefore.lastIndexOf(trigger);
48
+ if (index === -1) continue;
49
+ if (options.startOfLine && index !== 0) continue;
50
+ // Trigger must start a word: preceded by nothing or whitespace.
51
+ const before = textBefore[index - 1];
52
+ if (before !== undefined && !/\s/.test(before)) continue;
53
+ const query = textBefore.slice(index + trigger.length);
54
+ if (query.length > MAX_QUERY_LENGTH || /\s/.test(query)) continue;
55
+ if (query.length < (options.minQueryLength ?? 0)) continue;
56
+ return {
57
+ active: true,
58
+ trigger,
59
+ query,
60
+ from: $from.start() + index,
61
+ to: $from.pos,
62
+ };
63
+ }
64
+ return INACTIVE_SUGGESTION;
65
+ }
66
+
67
+ /**
68
+ * Generic trigger-character suggestion tracker. Recomputes the active
69
+ * trigger/query from the selection on every transaction, notifies the host,
70
+ * and softly highlights the query text. Insertion/UI is the host's job.
71
+ */
72
+ export function suggestionPlugin(key: PluginKey, options: SuggestionOptions): Plugin {
73
+ return new Plugin<SuggestionMatch>({
74
+ key,
75
+
76
+ state: {
77
+ init: () => INACTIVE_SUGGESTION,
78
+ apply(tr, prev, _old, newState) {
79
+ const next = findSuggestion(newState, options);
80
+ if (
81
+ next.active !== prev.active ||
82
+ next.query !== prev.query ||
83
+ next.trigger !== prev.trigger ||
84
+ next.from !== prev.from
85
+ ) {
86
+ options.onChange(next);
87
+ }
88
+ return next;
89
+ },
90
+ },
91
+
92
+ props: {
93
+ decorations(state) {
94
+ const match = key.getState(state) as SuggestionMatch;
95
+ if (!match.active) return null;
96
+ return DecorationSet.create(state.doc, [
97
+ Decoration.inline(match.from, match.to, {
98
+ class: 'nile-wysiwyg__suggestion',
99
+ }),
100
+ ]);
101
+ },
102
+
103
+ handleKeyDown(view, event) {
104
+ const match = key.getState(view.state) as SuggestionMatch;
105
+ if (!match.active || !options.onKeyDown) return false;
106
+ return options.onKeyDown(event, match);
107
+ },
108
+ },
109
+ });
110
+ }
@@ -0,0 +1,12 @@
1
+ import { Plugin } from 'prosemirror-state';
2
+ import { tableEditing, columnResizing } from 'prosemirror-tables';
3
+
4
+ /**
5
+ * prosemirror-tables wiring: cell selections, fix-tables normalization, and
6
+ * draggable column resizing (widths persist as `data-colwidth`). The CSS
7
+ * these plugins rely on (.selectedCell, .column-resize-handle, .resize-cursor)
8
+ * is inlined in nile-wysiwyg-editor.css.ts.
9
+ */
10
+ export function tablePlugins(): Plugin[] {
11
+ return [columnResizing(), tableEditing({ allowTableNodeSelection: true })];
12
+ }