@aquera/nile-elements 1.9.7 → 1.9.9

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 (244) hide show
  1. package/README.md +6 -0
  2. package/dist/{index-249de90a.esm.js → index-289706c7.esm.js} +1 -1
  3. package/dist/{index-df196058.cjs.js → index-d7e6f1c6.cjs.js} +2 -2
  4. package/dist/index-d7e6f1c6.cjs.js.map +1 -0
  5. package/dist/index.cjs.js +1 -1
  6. package/dist/index.esm.js +1 -1
  7. package/dist/index.js +1587 -1276
  8. package/dist/katex-44476ab4.esm.js +1 -0
  9. package/dist/katex-f4186f87.cjs.js +2 -0
  10. package/dist/katex-f4186f87.cjs.js.map +1 -0
  11. package/dist/nile-color-picker/index.cjs.js +1 -1
  12. package/dist/nile-color-picker/index.esm.js +1 -1
  13. package/dist/nile-color-picker/nile-color-picker.cjs.js +1 -1
  14. package/dist/nile-color-picker/nile-color-picker.cjs.js.map +1 -1
  15. package/dist/nile-color-picker/nile-color-picker.esm.js +1 -1
  16. package/dist/nile-select/virtual-scroll-helper.cjs.js +1 -1
  17. package/dist/nile-select/virtual-scroll-helper.cjs.js.map +1 -1
  18. package/dist/nile-select/virtual-scroll-helper.esm.js +52 -44
  19. package/dist/nile-virtual-select/renderer.cjs.js +1 -1
  20. package/dist/nile-virtual-select/renderer.cjs.js.map +1 -1
  21. package/dist/nile-virtual-select/renderer.esm.js +23 -22
  22. package/dist/nile-wysiwyg-editor/engine/commands.cjs.js +1 -1
  23. package/dist/nile-wysiwyg-editor/engine/commands.cjs.js.map +1 -1
  24. package/dist/nile-wysiwyg-editor/engine/commands.esm.js +1 -1
  25. package/dist/nile-wysiwyg-editor/engine/create-state.cjs.js +1 -1
  26. package/dist/nile-wysiwyg-editor/engine/create-state.cjs.js.map +1 -1
  27. package/dist/nile-wysiwyg-editor/engine/create-state.esm.js +1 -1
  28. package/dist/nile-wysiwyg-editor/engine/index.cjs.js +1 -1
  29. package/dist/nile-wysiwyg-editor/engine/index.esm.js +1 -1
  30. package/dist/nile-wysiwyg-editor/engine/inputrules.cjs.js +1 -1
  31. package/dist/nile-wysiwyg-editor/engine/keymap.cjs.js +1 -1
  32. package/dist/nile-wysiwyg-editor/engine/keymap.esm.js +1 -1
  33. package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.cjs.js +1 -1
  34. package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.cjs.js.map +1 -1
  35. package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.esm.js +1 -1
  36. package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.cjs.js +1 -1
  37. package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.cjs.js.map +1 -1
  38. package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.esm.js +1 -1
  39. package/dist/nile-wysiwyg-editor/engine/plugins/embeds.cjs.js +1 -1
  40. package/dist/nile-wysiwyg-editor/engine/plugins/embeds.cjs.js.map +1 -1
  41. package/dist/nile-wysiwyg-editor/engine/plugins/embeds.esm.js +1 -1
  42. package/dist/nile-wysiwyg-editor/engine/plugins/math-view.cjs.js +1 -1
  43. package/dist/nile-wysiwyg-editor/engine/plugins/math-view.cjs.js.map +1 -1
  44. package/dist/nile-wysiwyg-editor/engine/plugins/math-view.esm.js +1 -1
  45. package/dist/nile-wysiwyg-editor/engine/plugins/style-block-view.cjs.js +2 -0
  46. package/dist/nile-wysiwyg-editor/engine/plugins/style-block-view.cjs.js.map +1 -0
  47. package/dist/nile-wysiwyg-editor/engine/plugins/style-block-view.esm.js +1 -0
  48. package/dist/nile-wysiwyg-editor/engine/plugins/tables.cjs.js +1 -1
  49. package/dist/nile-wysiwyg-editor/engine/plugins/tables.cjs.js.map +1 -1
  50. package/dist/nile-wysiwyg-editor/engine/plugins/tables.esm.js +1 -1
  51. package/dist/nile-wysiwyg-editor/engine/sanitize.cjs.js +1 -1
  52. package/dist/nile-wysiwyg-editor/engine/sanitize.cjs.js.map +1 -1
  53. package/dist/nile-wysiwyg-editor/engine/sanitize.esm.js +1 -1
  54. package/dist/nile-wysiwyg-editor/engine/schema.cjs.js +1 -1
  55. package/dist/nile-wysiwyg-editor/engine/schema.cjs.js.map +1 -1
  56. package/dist/nile-wysiwyg-editor/engine/schema.esm.js +1 -1
  57. package/dist/nile-wysiwyg-editor/engine/selection-state.cjs.js +1 -1
  58. package/dist/nile-wysiwyg-editor/engine/selection-state.cjs.js.map +1 -1
  59. package/dist/nile-wysiwyg-editor/engine/selection-state.esm.js +1 -1
  60. package/dist/nile-wysiwyg-editor/index.cjs.js +1 -1
  61. package/dist/nile-wysiwyg-editor/index.esm.js +1 -1
  62. package/dist/nile-wysiwyg-editor/math/katex-renderer.cjs.js +2 -0
  63. package/dist/nile-wysiwyg-editor/math/katex-renderer.cjs.js.map +1 -0
  64. package/dist/nile-wysiwyg-editor/math/katex-renderer.esm.js +1 -0
  65. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js +1 -1
  66. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js.map +1 -1
  67. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.cjs.js +1 -1
  68. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.cjs.js.map +1 -1
  69. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.esm.js +22 -3
  70. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.esm.js +7 -6
  71. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.cjs.js +1 -1
  72. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.esm.js +1 -1
  73. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar-item.cjs.js +2 -0
  74. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar-item.cjs.js.map +1 -0
  75. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar-item.esm.js +1 -0
  76. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.cjs.js +1 -1
  77. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.cjs.js.map +1 -1
  78. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.cjs.js +1 -1
  79. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.cjs.js.map +1 -1
  80. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.esm.js +33 -54
  81. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.esm.js +83 -95
  82. package/dist/nile-wysiwyg-editor/types.cjs.js +1 -1
  83. package/dist/nile-wysiwyg-editor/types.cjs.js.map +1 -1
  84. package/dist/nile-wysiwyg-editor/types.esm.js +1 -1
  85. package/dist/nile-wysiwyg-editor/ui/bubble-item.cjs.js +2 -0
  86. package/dist/nile-wysiwyg-editor/ui/bubble-item.cjs.js.map +1 -0
  87. package/dist/nile-wysiwyg-editor/ui/bubble-item.esm.js +1 -0
  88. package/dist/nile-wysiwyg-editor/ui/bubble-menu.cjs.js +1 -1
  89. package/dist/nile-wysiwyg-editor/ui/bubble-menu.cjs.js.map +1 -1
  90. package/dist/nile-wysiwyg-editor/ui/bubble-menu.esm.js +23 -15
  91. package/dist/nile-wysiwyg-editor/ui/code-block-menu.cjs.js +1 -1
  92. package/dist/nile-wysiwyg-editor/ui/code-block-menu.cjs.js.map +1 -1
  93. package/dist/nile-wysiwyg-editor/ui/code-block-menu.esm.js +3 -3
  94. package/dist/nile-wysiwyg-editor/ui/embed-panel.cjs.js +1 -1
  95. package/dist/nile-wysiwyg-editor/ui/embed-panel.cjs.js.map +1 -1
  96. package/dist/nile-wysiwyg-editor/ui/embed-panel.esm.js +2 -2
  97. package/dist/nile-wysiwyg-editor/ui/math-panel.cjs.js +1 -1
  98. package/dist/nile-wysiwyg-editor/ui/math-panel.cjs.js.map +1 -1
  99. package/dist/nile-wysiwyg-editor/ui/math-panel.esm.js +0 -3
  100. package/dist/nile-wysiwyg-editor/ui/preview.cjs.js +2 -0
  101. package/dist/nile-wysiwyg-editor/ui/preview.cjs.js.map +1 -0
  102. package/dist/nile-wysiwyg-editor/ui/preview.esm.js +8 -0
  103. package/dist/nile-wysiwyg-editor/ui/source-view.cjs.js +1 -1
  104. package/dist/nile-wysiwyg-editor/ui/source-view.cjs.js.map +1 -1
  105. package/dist/nile-wysiwyg-editor/ui/source-view.esm.js +225 -24
  106. package/dist/nile-wysiwyg-editor/ui/suggest-list.cjs.js +1 -1
  107. package/dist/nile-wysiwyg-editor/ui/suggest-list.cjs.js.map +1 -1
  108. package/dist/nile-wysiwyg-editor/ui/suggest-list.esm.js +9 -9
  109. package/dist/nile-wysiwyg-editor/ui/table-grid-picker.cjs.js +1 -1
  110. package/dist/nile-wysiwyg-editor/ui/table-grid-picker.cjs.js.map +1 -1
  111. package/dist/nile-wysiwyg-editor/ui/table-grid-picker.esm.js +115 -13
  112. package/dist/nile-wysiwyg-editor/ui/table-menu.cjs.js +1 -1
  113. package/dist/nile-wysiwyg-editor/ui/table-menu.cjs.js.map +1 -1
  114. package/dist/nile-wysiwyg-editor/ui/table-menu.esm.js +13 -12
  115. package/dist/src/index.d.ts +5 -0
  116. package/dist/src/index.js +3 -0
  117. package/dist/src/index.js.map +1 -1
  118. package/dist/src/nile-color-picker/nile-color-picker.d.ts +1 -0
  119. package/dist/src/nile-color-picker/nile-color-picker.js +1 -0
  120. package/dist/src/nile-color-picker/nile-color-picker.js.map +1 -1
  121. package/dist/src/nile-select/virtual-scroll-helper.js +9 -1
  122. package/dist/src/nile-select/virtual-scroll-helper.js.map +1 -1
  123. package/dist/src/nile-virtual-select/renderer.js +1 -0
  124. package/dist/src/nile-virtual-select/renderer.js.map +1 -1
  125. package/dist/src/nile-wysiwyg-editor/engine/index.d.ts +1 -0
  126. package/dist/src/nile-wysiwyg-editor/engine/index.js +1 -0
  127. package/dist/src/nile-wysiwyg-editor/engine/index.js.map +1 -1
  128. package/dist/src/nile-wysiwyg-editor/engine/plugins/embed-view.js +3 -0
  129. package/dist/src/nile-wysiwyg-editor/engine/plugins/embed-view.js.map +1 -1
  130. package/dist/src/nile-wysiwyg-editor/engine/plugins/embeds.d.ts +19 -4
  131. package/dist/src/nile-wysiwyg-editor/engine/plugins/embeds.js +23 -18
  132. package/dist/src/nile-wysiwyg-editor/engine/plugins/embeds.js.map +1 -1
  133. package/dist/src/nile-wysiwyg-editor/engine/plugins/math-view.d.ts +8 -3
  134. package/dist/src/nile-wysiwyg-editor/engine/plugins/math-view.js +41 -4
  135. package/dist/src/nile-wysiwyg-editor/engine/plugins/math-view.js.map +1 -1
  136. package/dist/src/nile-wysiwyg-editor/engine/plugins/style-block-view.d.ts +17 -0
  137. package/dist/src/nile-wysiwyg-editor/engine/plugins/style-block-view.js +174 -0
  138. package/dist/src/nile-wysiwyg-editor/engine/plugins/style-block-view.js.map +1 -0
  139. package/dist/src/nile-wysiwyg-editor/engine/plugins/tables.js +33 -2
  140. package/dist/src/nile-wysiwyg-editor/engine/plugins/tables.js.map +1 -1
  141. package/dist/src/nile-wysiwyg-editor/engine/pm.test.js +49 -8
  142. package/dist/src/nile-wysiwyg-editor/engine/pm.test.js.map +1 -1
  143. package/dist/src/nile-wysiwyg-editor/engine/sanitize.d.ts +12 -0
  144. package/dist/src/nile-wysiwyg-editor/engine/sanitize.js +76 -8
  145. package/dist/src/nile-wysiwyg-editor/engine/sanitize.js.map +1 -1
  146. package/dist/src/nile-wysiwyg-editor/engine/schema.d.ts +2 -0
  147. package/dist/src/nile-wysiwyg-editor/engine/schema.js +154 -2
  148. package/dist/src/nile-wysiwyg-editor/engine/schema.js.map +1 -1
  149. package/dist/src/nile-wysiwyg-editor/index.d.ts +5 -0
  150. package/dist/src/nile-wysiwyg-editor/index.js +3 -0
  151. package/dist/src/nile-wysiwyg-editor/index.js.map +1 -1
  152. package/dist/src/nile-wysiwyg-editor/math/katex-renderer.d.ts +38 -0
  153. package/dist/src/nile-wysiwyg-editor/math/katex-renderer.js +40 -0
  154. package/dist/src/nile-wysiwyg-editor/math/katex-renderer.js.map +1 -0
  155. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.js +22 -3
  156. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.js.map +1 -1
  157. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.d.ts +36 -0
  158. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js +125 -8
  159. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js.map +1 -1
  160. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.js +5 -2
  161. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.js.map +1 -1
  162. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.d.ts +2 -0
  163. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.js +1 -0
  164. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.js.map +1 -1
  165. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar-item.d.ts +55 -0
  166. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar-item.js +79 -0
  167. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar-item.js.map +1 -0
  168. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.js +33 -54
  169. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.js.map +1 -1
  170. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.d.ts +50 -2
  171. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.js +158 -102
  172. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.js.map +1 -1
  173. package/dist/src/nile-wysiwyg-editor/types.d.ts +4 -2
  174. package/dist/src/nile-wysiwyg-editor/types.js +2 -2
  175. package/dist/src/nile-wysiwyg-editor/types.js.map +1 -1
  176. package/dist/src/nile-wysiwyg-editor/ui/bubble-item.d.ts +48 -0
  177. package/dist/src/nile-wysiwyg-editor/ui/bubble-item.js +69 -0
  178. package/dist/src/nile-wysiwyg-editor/ui/bubble-item.js.map +1 -0
  179. package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.d.ts +17 -2
  180. package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.js +128 -35
  181. package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.js.map +1 -1
  182. package/dist/src/nile-wysiwyg-editor/ui/embed-panel.d.ts +2 -1
  183. package/dist/src/nile-wysiwyg-editor/ui/embed-panel.js +4 -3
  184. package/dist/src/nile-wysiwyg-editor/ui/embed-panel.js.map +1 -1
  185. package/dist/src/nile-wysiwyg-editor/ui/math-panel.js +0 -3
  186. package/dist/src/nile-wysiwyg-editor/ui/math-panel.js.map +1 -1
  187. package/dist/src/nile-wysiwyg-editor/ui/preview.d.ts +20 -0
  188. package/dist/src/nile-wysiwyg-editor/ui/preview.js +44 -0
  189. package/dist/src/nile-wysiwyg-editor/ui/preview.js.map +1 -0
  190. package/dist/src/nile-wysiwyg-editor/ui/source-view.d.ts +35 -3
  191. package/dist/src/nile-wysiwyg-editor/ui/source-view.js +337 -24
  192. package/dist/src/nile-wysiwyg-editor/ui/source-view.js.map +1 -1
  193. package/dist/src/nile-wysiwyg-editor/ui/suggest-list.d.ts +1 -0
  194. package/dist/src/nile-wysiwyg-editor/ui/suggest-list.js +9 -0
  195. package/dist/src/nile-wysiwyg-editor/ui/suggest-list.js.map +1 -1
  196. package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.d.ts +13 -2
  197. package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.js +166 -10
  198. package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.js.map +1 -1
  199. package/dist/src/nile-wysiwyg-editor/ui/table-menu.d.ts +1 -0
  200. package/dist/src/nile-wysiwyg-editor/ui/table-menu.js +10 -8
  201. package/dist/src/nile-wysiwyg-editor/ui/table-menu.js.map +1 -1
  202. package/dist/src/version.js +1 -1
  203. package/dist/src/version.js.map +1 -1
  204. package/dist/tsconfig.tsbuildinfo +1 -1
  205. package/dist/xml-25c4108a.esm.js +1 -0
  206. package/dist/xml-90fd974e.cjs.js +2 -0
  207. package/dist/xml-90fd974e.cjs.js.map +1 -0
  208. package/package.json +2 -1
  209. package/rollup.config.js +1 -0
  210. package/src/index.ts +8 -0
  211. package/src/nile-color-picker/nile-color-picker.ts +1 -0
  212. package/src/nile-select/virtual-scroll-helper.ts +9 -1
  213. package/src/nile-virtual-select/renderer.ts +1 -1
  214. package/src/nile-wysiwyg-editor/engine/index.ts +1 -0
  215. package/src/nile-wysiwyg-editor/engine/plugins/embed-view.ts +3 -0
  216. package/src/nile-wysiwyg-editor/engine/plugins/embeds.ts +26 -20
  217. package/src/nile-wysiwyg-editor/engine/plugins/math-view.ts +45 -4
  218. package/src/nile-wysiwyg-editor/engine/plugins/style-block-view.ts +178 -0
  219. package/src/nile-wysiwyg-editor/engine/plugins/tables.ts +34 -2
  220. package/src/nile-wysiwyg-editor/engine/pm.test.ts +58 -8
  221. package/src/nile-wysiwyg-editor/engine/sanitize.ts +71 -8
  222. package/src/nile-wysiwyg-editor/engine/schema.ts +158 -7
  223. package/src/nile-wysiwyg-editor/index.ts +5 -0
  224. package/src/nile-wysiwyg-editor/math/katex-renderer.ts +59 -0
  225. package/src/nile-wysiwyg-editor/math/katex.d.ts +17 -0
  226. package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.ts +22 -3
  227. package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.ts +5 -2
  228. package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.ts +142 -7
  229. package/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.ts +2 -0
  230. package/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar-item.ts +68 -0
  231. package/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.ts +33 -54
  232. package/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.ts +202 -108
  233. package/src/nile-wysiwyg-editor/types.ts +6 -4
  234. package/src/nile-wysiwyg-editor/ui/bubble-item.ts +60 -0
  235. package/src/nile-wysiwyg-editor/ui/bubble-menu.ts +147 -40
  236. package/src/nile-wysiwyg-editor/ui/embed-panel.ts +4 -3
  237. package/src/nile-wysiwyg-editor/ui/math-panel.ts +0 -3
  238. package/src/nile-wysiwyg-editor/ui/preview.ts +42 -0
  239. package/src/nile-wysiwyg-editor/ui/source-view.ts +339 -31
  240. package/src/nile-wysiwyg-editor/ui/suggest-list.ts +10 -0
  241. package/src/nile-wysiwyg-editor/ui/table-grid-picker.ts +160 -10
  242. package/src/nile-wysiwyg-editor/ui/table-menu.ts +10 -8
  243. package/vscode-html-custom-data.json +75 -6
  244. package/dist/index-df196058.cjs.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/nile-wysiwyg-editor/engine/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAsB,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,UAAU,MAAM,YAAY,CAAC;AAIpC,MAAM,YAAY,GAAgB,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;AAEzE,SAAS,eAAe,CAAC,GAAgB;IACvC,MAAM,K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CAAC;QACD,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAC1B,CAAC;CACF,CAAC;AAEF,kFAAkF;AAClF,MAAM,UAAU,YAAY;IAC1B,MAAM,OAAO,GAAG,YAAY,CAC1B,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EACtB,kBAAkB,EAClB,OAAO,CACR;SACE,MAAM,CAAC,aAAa,EAAE,cAAc,CAAC;SACrC,MAAM,CAAC,cAAc,EAAE,eAAe,CAAC;SACvC,MAAM,CAAC,cAAc,CAAC;SACtB,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC9B,OAAO,IAAI,MAAM,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AACvE,CAAC;AAED,wCAAwC;AACxC,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,EAAE,CAAC","sourcesContent":["import { Schema, NodeSpec, MarkSpec } from 'prosemirror-model';\nimport { addListNodes } from 'prosemirror-schema-list';\nimport { tableNodes } from 'prosemirror-tables';\nimport OrderedMap from 'orderedmap';\n\nexport type Alignment = 'left' | 'center' | 'right' | 'justify';\n\nconst ALIGN_VALUES: Alignment[] = ['left', 'center', 'right', 'justify'];\n\nfunction getAlignFromDom(dom: HTMLElement): Alignment | null {\n const value = dom.style.textAlign || dom.getAttribute('align') || '';\n return (ALIGN_VALUES as string[]).includes(value) ? (value as Alignment) : null;\n}\n\nfunction alignStyle(align: Alignment | null): string | null {\n return align ? `text-align: ${align}` : null;\n}\n\n/** Indent depth in 40px steps, like CKEditor/Google Docs. */\nexport const INDENT_STEP_PX = 40;\nexport const MAX_INDENT = 8;\n\nfunction getIndentFromDom(dom: HTMLElement): number {\n const raw = dom.style.marginInlineStart || dom.style.marginLeft || '';\n const px = parseFloat(raw);\n if (!Number.isFinite(px) || px <= 0) return 0;\n return Math.min(MAX_INDENT, Math.round(px / INDENT_STEP_PX));\n}\n\n/**\n * Line height as a unitless multiplier string ('1.5'). Percentages are\n * converted; px values pass through as-is so pasted content keeps its look.\n */\nfunction getLineHeightFromDom(dom: HTMLElement): string | null {\n const raw = dom.style.lineHeight.trim();\n if (!raw || raw === 'normal') return null;\n const num = parseFloat(raw);\n if (!Number.isFinite(num) || num <= 0) return null;\n if (raw.endsWith('%')) return String(num / 100);\n return raw;\n}\n\n/** Combined style string for align + indent + line-height textblock attrs. */\nfunction blockStyle(attrs: {\n align?: Alignment | null;\n indent?: number;\n lineHeight?: string | null;\n}): string | null {\n const parts: string[] = [];\n const align = alignStyle(attrs.align ?? null);\n if (align) parts.push(align);\n if (attrs.indent) parts.push(`margin-inline-start: ${attrs.indent * INDENT_STEP_PX}px`);\n if (attrs.lineHeight) parts.push(`line-height: ${attrs.lineHeight}`);\n return parts.length ? parts.join('; ') : null;\n}\n\n/**\n * Block nodes. `align` is modeled as an attribute on textblocks rather than a\n * wrapper node so alignment survives block-type changes (heading <-> paragraph).\n */\nconst nodes: Record<string, NodeSpec> = {\n doc: {\n content: 'block+',\n },\n\n paragraph: {\n content: 'inline*',\n group: 'block',\n attrs: {\n align: { default: null },\n indent: { default: 0 },\n lineHeight: { default: null },\n },\n parseDOM: [\n {\n tag: 'p',\n getAttrs: (dom: HTMLElement) => ({\n align: getAlignFromDom(dom),\n indent: getIndentFromDom(dom),\n lineHeight: getLineHeightFromDom(dom),\n }),\n },\n ],\n toDOM(node) {\n const style = blockStyle(node.attrs);\n return style ? ['p', { style }, 0] : ['p', 0];\n },\n },\n\n heading: {\n content: 'inline*',\n group: 'block',\n defining: true,\n attrs: {\n level: { default: 1 },\n align: { default: null },\n indent: { default: 0 },\n lineHeight: { default: null },\n },\n parseDOM: [1, 2, 3, 4, 5, 6].map(level => ({\n tag: `h${level}`,\n getAttrs: (dom: HTMLElement) => ({\n level,\n align: getAlignFromDom(dom),\n indent: getIndentFromDom(dom),\n lineHeight: getLineHeightFromDom(dom),\n }),\n })),\n toDOM(node) {\n const style = blockStyle(node.attrs);\n return style ? [`h${node.attrs.level}`, { style }, 0] : [`h${node.attrs.level}`, 0];\n },\n },\n\n blockquote: {\n content: 'block+',\n group: 'block',\n defining: true,\n parseDOM: [{ tag: 'blockquote' }],\n toDOM() {\n return ['blockquote', 0];\n },\n },\n\n horizontal_rule: {\n group: 'block',\n parseDOM: [{ tag: 'hr' }],\n toDOM() {\n return ['hr'];\n },\n },\n\n text: {\n group: 'inline',\n },\n\n hard_break: {\n inline: true,\n group: 'inline',\n selectable: false,\n parseDOM: [{ tag: 'br' }],\n toDOM() {\n return ['br'];\n },\n },\n\n code_block: {\n content: 'text*',\n group: 'block',\n marks: '',\n code: true,\n defining: true,\n attrs: { language: { default: null } },\n parseDOM: [\n {\n tag: 'pre',\n preserveWhitespace: 'full',\n getAttrs: (dom: HTMLElement) => ({\n language: dom.getAttribute('data-language'),\n }),\n },\n ],\n toDOM(node) {\n const attrs: Record<string, string> = { class: 'nile-wysiwyg__code-block' };\n if (node.attrs.language) attrs['data-language'] = node.attrs.language;\n return ['pre', attrs, ['code', 0]];\n },\n },\n\n /**\n * ProseMirror's canonical inline image, extended with a `width` attr (px)\n * written by the drag-resize handles.\n */\n image: {\n inline: true,\n group: 'inline',\n draggable: true,\n attrs: {\n src: {},\n alt: { default: null },\n title: { default: null },\n width: { default: null },\n },\n parseDOM: [\n {\n tag: 'img[src]',\n getAttrs: (dom: HTMLElement) => {\n const styleWidth = parseFloat(dom.style.width);\n const attrWidth = parseFloat(dom.getAttribute('width') ?? '');\n const width = Number.isFinite(styleWidth)\n ? Math.round(styleWidth)\n : Number.isFinite(attrWidth)\n ? Math.round(attrWidth)\n : null;\n return {\n src: dom.getAttribute('src'),\n alt: dom.getAttribute('alt'),\n title: dom.getAttribute('title'),\n width: width && width > 0 ? width : null,\n };\n },\n },\n ],\n toDOM(node) {\n const { src, alt, title, width } = node.attrs;\n const attrs: Record<string, string> = { src };\n if (alt) attrs.alt = alt;\n if (title) attrs.title = title;\n if (width) attrs.style = `width: ${width}px`;\n return ['img', attrs];\n },\n },\n\n /**\n * Captioned image: a block figure whose inline content is the caption. The\n * image itself lives in the attrs (TipTap-style), so the node stays valid\n * ProseMirror content — a node can't mix an inline img child with a block\n * figcaption child.\n */\n figure: {\n group: 'block',\n content: 'inline*',\n defining: true,\n isolating: true,\n attrs: {\n src: {},\n alt: { default: null },\n title: { default: null },\n width: { default: null },\n align: { default: null },\n },\n parseDOM: [\n {\n tag: 'figure',\n contentElement: 'figcaption',\n getAttrs: (dom: HTMLElement) => {\n const img = dom.querySelector('img[src]') as HTMLElement | null;\n if (!img) return false;\n const styleWidth = parseFloat(img.style.width || dom.style.width);\n const align = dom.getAttribute('data-align');\n return {\n src: img.getAttribute('src'),\n alt: img.getAttribute('alt'),\n title: img.getAttribute('title'),\n width:\n Number.isFinite(styleWidth) && styleWidth > 0\n ? Math.round(styleWidth)\n : null,\n align: align === 'left' || align === 'center' || align === 'right' ? align : null,\n };\n },\n },\n ],\n toDOM(node) {\n const { src, alt, title, width, align } = node.attrs;\n const figureAttrs: Record<string, string> = { class: 'nile-wysiwyg__figure' };\n if (align) figureAttrs['data-align'] = align;\n const styles: string[] = [];\n if (width) styles.push(`width: ${width}px`);\n if (align === 'center') styles.push('margin-left: auto; margin-right: auto');\n else if (align === 'right') styles.push('margin-left: auto; margin-right: 0');\n if (styles.length) figureAttrs.style = styles.join('; ');\n const imgAttrs: Record<string, string> = { src, style: 'width: 100%' };\n if (alt) imgAttrs.alt = alt;\n if (title) imgAttrs.title = title;\n return [\n 'figure',\n figureAttrs,\n ['img', imgAttrs],\n ['figcaption', { class: 'nile-wysiwyg__figcaption' }, 0],\n ];\n },\n },\n\n /**\n * Checklists. Serialized as <ul data-task-list><li data-task-item\n * data-checked> so they survive HTML round-trips; the live checkbox is an\n * editor-only NodeView. parseDOM priority 51 beats the generic li rule.\n */\n task_list: {\n content: 'task_item+',\n group: 'block',\n parseDOM: [{ tag: 'ul[data-task-list]', priority: 51 }],\n toDOM() {\n return ['ul', { 'data-task-list': 'true', class: 'nile-wysiwyg__task-list' }, 0];\n },\n },\n\n task_item: {\n content: 'paragraph block*',\n defining: true,\n attrs: { checked: { default: false } },\n parseDOM: [\n {\n tag: 'li[data-task-item]',\n priority: 51,\n getAttrs: (dom: HTMLElement) => ({\n checked: dom.getAttribute('data-checked') === 'true',\n }),\n },\n ],\n toDOM(node) {\n return [\n 'li',\n {\n 'data-task-item': 'true',\n 'data-checked': String(node.attrs.checked),\n class: 'nile-wysiwyg__task-item',\n },\n 0,\n ];\n },\n },\n\n /**\n * Provider embeds (YouTube/Vimeo/Loom) as block atoms. The iframe sits in\n * a wrapper div for aspect-ratio styling and a click-to-select overlay.\n */\n embed: {\n group: 'block',\n atom: true,\n selectable: true,\n draggable: true,\n attrs: {\n src: {},\n provider: { default: null },\n title: { default: null },\n /** Rendered width in px (drag-resize); null = default size. */\n width: { default: null },\n /** Block alignment: 'left' | 'center' | 'right' | null. */\n align: { default: null },\n },\n parseDOM: [\n {\n tag: 'div[data-embed-provider]',\n getAttrs: (dom: HTMLElement) => {\n const iframe = dom.querySelector('iframe[src]');\n if (!iframe) return false;\n const widthAttr =\n dom.getAttribute('data-width') ?? /^(\\d+)px$/.exec(dom.style.width)?.[1];\n const width = widthAttr ? parseInt(widthAttr, 10) : NaN;\n const align = dom.getAttribute('data-align');\n return {\n src: iframe.getAttribute('src'),\n provider: dom.getAttribute('data-embed-provider'),\n title: iframe.getAttribute('title'),\n width: Number.isFinite(width) && width > 0 ? width : null,\n align: align === 'left' || align === 'center' || align === 'right' ? align : null,\n };\n },\n },\n {\n tag: 'iframe[src]',\n getAttrs: (dom: HTMLElement) => {\n const width = parseInt(dom.getAttribute('width') ?? '', 10);\n return {\n src: dom.getAttribute('src'),\n title: dom.getAttribute('title'),\n width: Number.isFinite(width) && width > 0 ? width : null,\n };\n },\n },\n ],\n toDOM(node) {\n const { src, provider, title, width, align } = node.attrs;\n const iframeAttrs: Record<string, string> = {\n src,\n frameborder: '0',\n allowfullscreen: 'true',\n allow: 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture',\n };\n if (title) iframeAttrs.title = title;\n const wrapperAttrs: Record<string, string> = {\n class: 'nile-wysiwyg__embed',\n 'data-embed-provider': provider ?? 'generic',\n };\n const styles: string[] = [];\n if (width) {\n wrapperAttrs['data-width'] = String(width);\n styles.push(`width: ${width}px`, 'max-width: 100%');\n }\n if (align) {\n wrapperAttrs['data-align'] = align;\n if (align === 'center') styles.push('margin-left: auto', 'margin-right: auto');\n else if (align === 'right') styles.push('margin-left: auto', 'margin-right: 0');\n }\n if (styles.length) wrapperAttrs.style = styles.join('; ');\n return ['div', wrapperAttrs, ['iframe', iframeAttrs]];\n },\n },\n\n /**\n * Bookmark: a named in-text anchor (`<a id=\"…\">`) for intra-document\n * navigation. Invisible in serialized output; the editor draws a flag\n * marker via CSS so it can be selected and deleted.\n */\n bookmark: {\n inline: true,\n group: 'inline',\n atom: true,\n selectable: true,\n attrs: { id: {} },\n parseDOM: [\n {\n tag: 'a[data-bookmark]',\n priority: 60,\n getAttrs: (dom: HTMLElement) => {\n const id = dom.getAttribute('id') || dom.getAttribute('name');\n return id ? { id } : false;\n },\n },\n // Anchors without an href are bookmarks (`<a id>` / legacy `<a name>`).\n {\n tag: 'a[id]',\n getAttrs: (dom: HTMLElement) =>\n dom.hasAttribute('href') ? false : { id: dom.getAttribute('id') },\n },\n {\n tag: 'a[name]',\n getAttrs: (dom: HTMLElement) =>\n dom.hasAttribute('href') ? false : { id: dom.getAttribute('name') },\n },\n ],\n toDOM(node) {\n return ['a', { id: node.attrs.id, 'data-bookmark': 'true' }];\n },\n },\n\n /** Inline atom for @-style mentions. The label renders as `${trigger}${label}`. */\n mention: {\n inline: true,\n group: 'inline',\n atom: true,\n selectable: true,\n attrs: {\n trigger: { default: '@' },\n key: {},\n label: {},\n },\n parseDOM: [\n {\n tag: 'span[data-mention-key]',\n getAttrs: (dom: HTMLElement) => ({\n trigger: dom.getAttribute('data-mention-trigger') || '@',\n key: dom.getAttribute('data-mention-key'),\n label:\n dom.getAttribute('data-mention-label') || dom.textContent?.slice(1) || '',\n }),\n },\n ],\n toDOM(node) {\n const { trigger, key, label } = node.attrs;\n return [\n 'span',\n {\n class: 'nile-wysiwyg__mention',\n 'data-mention-trigger': trigger,\n 'data-mention-key': key,\n 'data-mention-label': label,\n },\n `${trigger}${label}`,\n ];\n },\n },\n\n /**\n * Merge field: an inline atom placeholder for mail-merge / personalization\n * (e.g. `{{first_name}}`). Stores a stable `id` and a human `label`; renders\n * the label (falling back to `{{id}}`) as a non-editable chip.\n */\n merge_field: {\n inline: true,\n group: 'inline',\n atom: true,\n selectable: true,\n attrs: { id: {}, label: { default: null } },\n parseDOM: [\n {\n tag: 'span[data-merge-field]',\n getAttrs: (dom: HTMLElement) => {\n const id = dom.getAttribute('data-merge-field');\n if (!id) return false;\n return {\n id,\n label: dom.getAttribute('data-merge-label') || dom.textContent || null,\n };\n },\n },\n ],\n toDOM(node) {\n const { id, label } = node.attrs;\n return [\n 'span',\n {\n class: 'nile-wysiwyg__merge-field',\n 'data-merge-field': id,\n 'data-merge-label': label ?? '',\n },\n label || `{{${id}}}`,\n ];\n },\n },\n\n /**\n * Math: an inline atom holding a LaTeX source string. Rendering is pluggable\n * via the editor's `mathRenderer` (KaTeX/MathJax, or MathML). Without a\n * renderer the raw LaTeX is shown in a math-styled chip. `display` chooses\n * inline vs. block presentation.\n */\n math: {\n inline: true,\n group: 'inline',\n atom: true,\n selectable: true,\n attrs: { latex: {}, display: { default: 'inline' } },\n parseDOM: [\n {\n tag: 'span[data-math]',\n getAttrs: (dom: HTMLElement) => ({\n latex: dom.getAttribute('data-math') || dom.textContent || '',\n display: dom.getAttribute('data-math-display') === 'block' ? 'block' : 'inline',\n }),\n },\n ],\n toDOM(node) {\n const { latex, display } = node.attrs;\n return [\n 'span',\n {\n class: 'nile-wysiwyg__math',\n 'data-math': latex,\n 'data-math-display': display,\n },\n latex,\n ];\n },\n },\n};\n\n/** Table nodes from prosemirror-tables, with cell background support. */\nconst tableNodeSpecs = tableNodes({\n tableGroup: 'block',\n cellContent: 'block+',\n cellAttributes: {\n background: {\n default: null,\n getFromDOM(dom) {\n return (dom as HTMLElement).style.backgroundColor || null;\n },\n setDOMAttr(value, attrs) {\n if (value) {\n attrs.style = `${(attrs.style as string) || ''}background-color: ${value};`;\n }\n },\n },\n },\n});\n\n/**\n * The table spec extended with a `layout` attr: layout tables (structured\n * layouts, e.g. for email HTML) serialize as `role=\"presentation\"` and render\n * borderless, with dashed guides visible only while editing.\n */\nconst baseTableSpec = tableNodeSpecs.table;\nconst tableSpec: NodeSpec = {\n ...baseTableSpec,\n attrs: { ...(baseTableSpec.attrs ?? {}), layout: { default: false } },\n parseDOM: [\n {\n tag: 'table',\n getAttrs: (dom: HTMLElement) => ({\n layout:\n dom.getAttribute('role') === 'presentation' || dom.hasAttribute('data-layout'),\n }),\n },\n ],\n toDOM(node) {\n return node.attrs.layout\n ? ['table', { role: 'presentation', 'data-layout': 'true' }, ['tbody', 0]]\n : ['table', ['tbody', 0]];\n },\n};\n\n/**\n * Marks. Order matters: marks later in the map render closer to the text.\n * Each styling mark parses from both semantic tags AND inline `style=`\n * declarations so pasted Word/Google Docs content keeps its formatting.\n */\nconst marks: Record<string, MarkSpec> = {\n link: {\n attrs: {\n href: {},\n title: { default: null },\n target: { default: null },\n },\n inclusive: false,\n parseDOM: [\n {\n tag: 'a[href]',\n getAttrs: (dom: HTMLElement) => ({\n href: dom.getAttribute('href'),\n title: dom.getAttribute('title'),\n target: dom.getAttribute('target'),\n }),\n },\n ],\n toDOM(mark) {\n const { href, title, target } = mark.attrs;\n const attrs: Record<string, string> = { href };\n if (title) attrs.title = title;\n if (target) {\n attrs.target = target;\n if (target === '_blank') attrs.rel = 'noopener noreferrer';\n }\n return ['a', attrs, 0];\n },\n },\n\n bold: {\n parseDOM: [\n { tag: 'strong' },\n // Google Docs wraps everything in <b style=\"font-weight: normal\">\n {\n tag: 'b',\n getAttrs: (dom: HTMLElement) => dom.style.fontWeight !== 'normal' && null,\n },\n {\n style: 'font-weight',\n getAttrs: (value: string) => /^(bold(er)?|[5-9]\\d{2,})$/.test(value) && null,\n },\n ],\n toDOM() {\n return ['strong', 0];\n },\n },\n\n italic: {\n parseDOM: [\n { tag: 'i' },\n { tag: 'em' },\n { style: 'font-style=italic' },\n ],\n toDOM() {\n return ['em', 0];\n },\n },\n\n underline: {\n parseDOM: [\n { tag: 'u' },\n {\n style: 'text-decoration',\n getAttrs: (value: string) => value.includes('underline') && null,\n },\n {\n style: 'text-decoration-line',\n getAttrs: (value: string) => value.includes('underline') && null,\n },\n ],\n toDOM() {\n return ['u', 0];\n },\n },\n\n strike: {\n parseDOM: [\n { tag: 's' },\n { tag: 'strike' },\n { tag: 'del' },\n {\n style: 'text-decoration',\n getAttrs: (value: string) => value.includes('line-through') && null,\n },\n {\n style: 'text-decoration-line',\n getAttrs: (value: string) => value.includes('line-through') && null,\n },\n ],\n toDOM() {\n return ['s', 0];\n },\n },\n\n /** Mutually exclusive vertical-shift marks (formulas, footnote refs). */\n subscript: {\n excludes: 'subscript superscript',\n parseDOM: [{ tag: 'sub' }, { style: 'vertical-align=sub' }],\n toDOM() {\n return ['sub', 0];\n },\n },\n\n superscript: {\n excludes: 'subscript superscript',\n parseDOM: [{ tag: 'sup' }, { style: 'vertical-align=super' }],\n toDOM() {\n return ['sup', 0];\n },\n },\n\n code: {\n parseDOM: [{ tag: 'code' }],\n toDOM() {\n return ['code', { class: 'nile-wysiwyg__inline-code' }, 0];\n },\n },\n\n text_color: {\n attrs: { color: {} },\n parseDOM: [\n {\n style: 'color',\n getAttrs: (value: string) => (value ? { color: value } : false),\n },\n ],\n toDOM(mark) {\n return ['span', { style: `color: ${mark.attrs.color}` }, 0];\n },\n },\n\n bg_color: {\n attrs: { color: {} },\n parseDOM: [\n {\n style: 'background-color',\n getAttrs: (value: string) =>\n value && value !== 'transparent' ? { color: value } : false,\n },\n ],\n toDOM(mark) {\n return ['span', { style: `background-color: ${mark.attrs.color}` }, 0];\n },\n },\n\n font_family: {\n attrs: { family: {} },\n parseDOM: [\n {\n style: 'font-family',\n getAttrs: (value: string) => (value ? { family: value } : false),\n },\n ],\n toDOM(mark) {\n return ['span', { style: `font-family: ${mark.attrs.family}` }, 0];\n },\n },\n\n font_size: {\n attrs: { size: {} },\n parseDOM: [\n {\n style: 'font-size',\n getAttrs: (value: string) => (value ? { size: value } : false),\n },\n ],\n toDOM(mark) {\n return ['span', { style: `font-size: ${mark.attrs.size}` }, 0];\n },\n },\n};\n\n/** Bullet markers CSS understands; anything else falls back to default. */\nexport const BULLET_STYLES = ['disc', 'circle', 'square'] as const;\n\n/** Numbering styles, keyed by the HTML `type` attribute letter. */\nexport const ORDERED_STYLES: Record<string, string> = {\n '1': 'decimal',\n a: 'lower-alpha',\n A: 'upper-alpha',\n i: 'lower-roman',\n I: 'upper-roman',\n};\n\nconst STYLE_TO_TYPE: Record<string, string> = Object.fromEntries(\n Object.entries(ORDERED_STYLES).map(([type, style]) => [style, type])\n);\n\n/**\n * Legal-style continuous numbering (1, 1.1, 1.1.1). Not a CSS\n * list-style-type: it serializes as `data-list-style=\"multilevel\"` and is\n * rendered with CSS counters (see the editor stylesheet). Consumers rendering\n * the output need the same counter rules.\n */\nexport const MULTILEVEL_STYLE = 'multilevel';\n\n/** List specs from prosemirror-schema-list, extended with style attrs. */\nconst bulletListSpec: NodeSpec = {\n content: 'list_item+',\n group: 'block',\n attrs: { style: { default: null } },\n parseDOM: [\n {\n tag: 'ul',\n getAttrs: (dom: HTMLElement) => {\n const style = dom.style.listStyleType;\n return {\n style: (BULLET_STYLES as readonly string[]).includes(style) ? style : null,\n };\n },\n },\n ],\n toDOM(node) {\n return node.attrs.style\n ? ['ul', { style: `list-style-type: ${node.attrs.style}` }, 0]\n : ['ul', 0];\n },\n};\n\nconst orderedListSpec: NodeSpec = {\n content: 'list_item+',\n group: 'block',\n attrs: { order: { default: 1 }, style: { default: null } },\n parseDOM: [\n {\n tag: 'ol',\n getAttrs: (dom: HTMLElement) => {\n const type = dom.getAttribute('type') ?? '';\n const cssStyle = dom.style.listStyleType;\n const style =\n dom.getAttribute('data-list-style') === MULTILEVEL_STYLE\n ? MULTILEVEL_STYLE\n : ORDERED_STYLES[type] ??\n (Object.values(ORDERED_STYLES).includes(cssStyle) ? cssStyle : null);\n const start = Number(dom.getAttribute('start'));\n return {\n order: Number.isFinite(start) && start > 0 ? start : 1,\n style,\n };\n },\n },\n ],\n toDOM(node) {\n const attrs: Record<string, string> = {};\n if (node.attrs.order !== 1) attrs.start = String(node.attrs.order);\n if (node.attrs.style === MULTILEVEL_STYLE) {\n attrs['data-list-style'] = MULTILEVEL_STYLE;\n } else if (node.attrs.style && STYLE_TO_TYPE[node.attrs.style]) {\n attrs.type = STYLE_TO_TYPE[node.attrs.style];\n }\n return ['ol', attrs, 0];\n },\n};\n\n/** Builds the editor schema. List nodes are added via prosemirror-schema-list. */\nexport function createSchema(): Schema {\n const nodeMap = addListNodes(\n OrderedMap.from(nodes),\n 'paragraph block*',\n 'block'\n )\n .update('bullet_list', bulletListSpec)\n .update('ordered_list', orderedListSpec)\n .append(tableNodeSpecs)\n .update('table', tableSpec);\n return new Schema({ nodes: nodeMap, marks: OrderedMap.from(marks) });\n}\n\n/** A shared default schema instance. */\nexport const defaultSchema = createSchema();\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/nile-wysiwyg-editor/engine/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAuD,MAAM,mBAAmB,CAAC;AAChG,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAIxE,MAAM,YAAY,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ParseRule } from 'prosemirror-model';\nimport { addListNodes } from 'prosemirror-schema-list';\nimport { tableNodes } from 'prosemirror-tables';\nimport OrderedMap from 'orderedmap';\nimport { EMBED_SANDBOX, EMBED_REFERRER_POLICY } from './plugins/embeds';\n\nexport type Alignment = 'left' | 'center' | 'right' | 'justify';\n\nconst ALIGN_VALUES: Alignment[] = ['left', 'center', 'right', 'justify'];\n\nfunction getAlignFromDom(dom: HTMLElement): Alignment | null {\n const value = dom.style.textAlign || dom.getAttribute('align') || '';\n return (ALIGN_VALUES as string[]).includes(value) ? (value as Alignment) : null;\n}\n\nfunction alignStyle(align: Alignment | null): string | null {\n return align ? `text-align: ${align}` : null;\n}\n\n/** Indent depth in 40px steps, like CKEditor/Google Docs. */\nexport const INDENT_STEP_PX = 40;\nexport const MAX_INDENT = 8;\n\nfunction getIndentFromDom(dom: HTMLElement): number {\n const raw = dom.style.marginInlineStart || dom.style.marginLeft || '';\n const px = parseFloat(raw);\n if (!Number.isFinite(px) || px <= 0) return 0;\n return Math.min(MAX_INDENT, Math.round(px / INDENT_STEP_PX));\n}\n\n/**\n * Line height as a unitless multiplier string ('1.5'). Percentages are\n * converted; px values pass through as-is so pasted content keeps its look.\n */\nfunction getLineHeightFromDom(dom: HTMLElement): string | null {\n const raw = dom.style.lineHeight.trim();\n if (!raw || raw === 'normal') return null;\n const num = parseFloat(raw);\n if (!Number.isFinite(num) || num <= 0) return null;\n if (raw.endsWith('%')) return String(num / 100);\n return raw;\n}\n\n/** Combined style string for align + indent + line-height textblock attrs. */\nfunction blockStyle(attrs: {\n align?: Alignment | null;\n indent?: number;\n lineHeight?: string | null;\n}): string | null {\n const parts: string[] = [];\n const align = alignStyle(attrs.align ?? null);\n if (align) parts.push(align);\n if (attrs.indent) parts.push(`margin-inline-start: ${attrs.indent * INDENT_STEP_PX}px`);\n if (attrs.lineHeight) parts.push(`line-height: ${attrs.lineHeight}`);\n return parts.length ? parts.join('; ') : null;\n}\n\n/* -------------------------------------------------------------------------\n * Author class / id passthrough\n *\n * Content elements keep the `class` and `id` an author gave them, so class/id\n * CSS (e.g. a scoped author <style> block) can target the document. Values that\n * collide with the editor's own internal names are dropped so content can never\n * impersonate or restyle the chrome; the editor's own classes (emitted in\n * toDOM) are always preserved and merged with the author's.\n * ------------------------------------------------------------------------- */\n\nconst RESERVED_NAME = /^(?:nile-wysiwyg|ProseMirror)/;\n\nexport function cleanClass(value: string | null): string | null {\n if (!value) return null;\n const kept = value.split(/\\s+/).filter(token => token && !RESERVED_NAME.test(token));\n return kept.length ? kept.join(' ') : null;\n}\n\nexport function cleanId(value: string | null): string | null {\n return value && !RESERVED_NAME.test(value) ? value : null;\n}\n\nconst HTML_ATTR_SPEC = { htmlClass: { default: null }, htmlId: { default: null } };\n\nfunction readHtmlAttrs(dom: HTMLElement): { htmlClass: string | null; htmlId: string | null } {\n return {\n htmlClass: cleanClass(dom.getAttribute('class')),\n htmlId: cleanId(dom.getAttribute('id')),\n };\n}\n\n/** Wraps a tag-based parse rule so it also captures author class/id. Rules\n * keyed by `style` (whose getAttrs receives a value string, not an element)\n * pass through untouched. */\nfunction augmentParseRule(rule: ParseRule): ParseRule {\n if (!('tag' in rule) || 'style' in rule) return rule;\n const inner = rule.getAttrs;\n return {\n ...rule,\n getAttrs(dom: HTMLElement) {\n const base = inner ? inner(dom) : null;\n if (base === false) return false;\n return { ...(base ?? {}), ...readHtmlAttrs(dom) };\n },\n } as ParseRule;\n}\n\n/** Wraps a toDOM so stored class/id are written back onto the element, merged\n * with any class the spec emits itself. Handles the `[tag]`, `[tag, attrs]`,\n * `[tag, 0]`, and `[tag, attrs, …children]` output shapes. */\nfunction augmentToDOM(\n toDOM?: (node: { attrs: Attrs }, ...rest: unknown[]) => DOMOutputSpec\n): ((node: { attrs: Attrs }, ...rest: unknown[]) => DOMOutputSpec) | undefined {\n if (!toDOM) return toDOM;\n return (node, ...rest) => {\n const out = toDOM(node, ...rest);\n const cls = node.attrs.htmlClass as string | null;\n const id = node.attrs.htmlId as string | null;\n if (!Array.isArray(out) || (!cls && !id)) return out;\n const [tag, ...tail] = out as unknown[];\n let attrs: Record<string, unknown> = {};\n let children = tail;\n if (tail.length && tail[0] && typeof tail[0] === 'object' && !Array.isArray(tail[0])) {\n attrs = { ...(tail[0] as Record<string, unknown>) };\n children = tail.slice(1);\n }\n if (cls) attrs.class = attrs.class ? `${attrs.class as string} ${cls}` : cls;\n if (id) attrs.id = id;\n return [tag, attrs, ...children] as DOMOutputSpec;\n };\n}\n\n/** Adds `htmlClass`/`htmlId` attrs plus parse/serialize support to a spec. */\nfunction withHtmlAttrs<S extends NodeSpec | MarkSpec>(spec: S): S {\n return {\n ...spec,\n attrs: { ...(spec.attrs ?? {}), ...HTML_ATTR_SPEC },\n parseDOM: spec.parseDOM?.map(augmentParseRule),\n toDOM: augmentToDOM(spec.toDOM as never) as never,\n };\n}\n\n/** Content nodes/marks that carry author class/id. Excludes structural leaves\n * (doc, text), atoms with bespoke DOM (image, embeds, mentions, math, …) and\n * style-only marks (their spans are covered by `html_span`). */\nconst HTML_ATTR_NODES = [\n 'paragraph', 'heading', 'blockquote', 'code_block',\n 'bullet_list', 'ordered_list', 'list_item',\n 'table', 'table_row', 'table_cell', 'table_header',\n];\nconst HTML_ATTR_MARKS = [\n 'link', 'bold', 'italic', 'underline', 'strike', 'code', 'subscript', 'superscript',\n];\n\n/**\n * Block nodes. `align` is modeled as an attribute on textblocks rather than a\n * wrapper node so alignment survives block-type changes (heading <-> paragraph).\n */\nconst nodes: Record<string, NodeSpec> = {\n doc: {\n content: 'block+',\n },\n\n paragraph: {\n content: 'inline*',\n group: 'block',\n attrs: {\n align: { default: null },\n indent: { default: 0 },\n lineHeight: { default: null },\n },\n parseDOM: [\n {\n tag: 'p',\n getAttrs: (dom: HTMLElement) => ({\n align: getAlignFromDom(dom),\n indent: getIndentFromDom(dom),\n lineHeight: getLineHeightFromDom(dom),\n }),\n },\n ],\n toDOM(node) {\n const style = blockStyle(node.attrs);\n return style ? ['p', { style }, 0] : ['p', 0];\n },\n },\n\n heading: {\n content: 'inline*',\n group: 'block',\n defining: true,\n attrs: {\n level: { default: 1 },\n align: { default: null },\n indent: { default: 0 },\n lineHeight: { default: null },\n },\n parseDOM: [1, 2, 3, 4, 5, 6].map(level => ({\n tag: `h${level}`,\n getAttrs: (dom: HTMLElement) => ({\n level,\n align: getAlignFromDom(dom),\n indent: getIndentFromDom(dom),\n lineHeight: getLineHeightFromDom(dom),\n }),\n })),\n toDOM(node) {\n const style = blockStyle(node.attrs);\n return style ? [`h${node.attrs.level}`, { style }, 0] : [`h${node.attrs.level}`, 0];\n },\n },\n\n blockquote: {\n content: 'block+',\n group: 'block',\n defining: true,\n parseDOM: [{ tag: 'blockquote' }],\n toDOM() {\n return ['blockquote', 0];\n },\n },\n\n horizontal_rule: {\n group: 'block',\n parseDOM: [{ tag: 'hr' }],\n toDOM() {\n return ['hr'];\n },\n },\n\n text: {\n group: 'inline',\n },\n\n hard_break: {\n inline: true,\n group: 'inline',\n selectable: false,\n parseDOM: [{ tag: 'br' }],\n toDOM() {\n return ['br'];\n },\n },\n\n code_block: {\n content: 'text*',\n group: 'block',\n marks: '',\n code: true,\n defining: true,\n attrs: { language: { default: null } },\n parseDOM: [\n {\n tag: 'pre',\n preserveWhitespace: 'full',\n getAttrs: (dom: HTMLElement) => ({\n language: dom.getAttribute('data-language'),\n }),\n },\n ],\n toDOM(node) {\n const attrs: Record<string, string> = { class: 'nile-wysiwyg__code-block' };\n if (node.attrs.language) attrs['data-language'] = node.attrs.language;\n return ['pre', attrs, ['code', 0]];\n },\n },\n\n /**\n * ProseMirror's canonical inline image, extended with a `width` attr (px)\n * written by the drag-resize handles.\n */\n image: {\n inline: true,\n group: 'inline',\n draggable: true,\n attrs: {\n src: {},\n alt: { default: null },\n title: { default: null },\n width: { default: null },\n },\n parseDOM: [\n {\n tag: 'img[src]',\n getAttrs: (dom: HTMLElement) => {\n const styleWidth = parseFloat(dom.style.width);\n const attrWidth = parseFloat(dom.getAttribute('width') ?? '');\n const width = Number.isFinite(styleWidth)\n ? Math.round(styleWidth)\n : Number.isFinite(attrWidth)\n ? Math.round(attrWidth)\n : null;\n return {\n src: dom.getAttribute('src'),\n alt: dom.getAttribute('alt'),\n title: dom.getAttribute('title'),\n width: width && width > 0 ? width : null,\n };\n },\n },\n ],\n toDOM(node) {\n const { src, alt, title, width } = node.attrs;\n const attrs: Record<string, string> = { src };\n if (alt) attrs.alt = alt;\n if (title) attrs.title = title;\n if (width) attrs.style = `width: ${width}px`;\n return ['img', attrs];\n },\n },\n\n /**\n * Captioned image: a block figure whose inline content is the caption. The\n * image itself lives in the attrs (TipTap-style), so the node stays valid\n * ProseMirror content — a node can't mix an inline img child with a block\n * figcaption child.\n */\n figure: {\n group: 'block',\n content: 'inline*',\n defining: true,\n isolating: true,\n attrs: {\n src: {},\n alt: { default: null },\n title: { default: null },\n width: { default: null },\n align: { default: null },\n },\n parseDOM: [\n {\n tag: 'figure',\n contentElement: 'figcaption',\n getAttrs: (dom: HTMLElement) => {\n const img = dom.querySelector('img[src]') as HTMLElement | null;\n if (!img) return false;\n const styleWidth = parseFloat(img.style.width || dom.style.width);\n const align = dom.getAttribute('data-align');\n return {\n src: img.getAttribute('src'),\n alt: img.getAttribute('alt'),\n title: img.getAttribute('title'),\n width:\n Number.isFinite(styleWidth) && styleWidth > 0\n ? Math.round(styleWidth)\n : null,\n align: align === 'left' || align === 'center' || align === 'right' ? align : null,\n };\n },\n },\n ],\n toDOM(node) {\n const { src, alt, title, width, align } = node.attrs;\n const figureAttrs: Record<string, string> = { class: 'nile-wysiwyg__figure' };\n if (align) figureAttrs['data-align'] = align;\n const styles: string[] = [];\n if (width) styles.push(`width: ${width}px`);\n if (align === 'center') styles.push('margin-left: auto; margin-right: auto');\n else if (align === 'right') styles.push('margin-left: auto; margin-right: 0');\n if (styles.length) figureAttrs.style = styles.join('; ');\n const imgAttrs: Record<string, string> = { src, style: 'width: 100%' };\n if (alt) imgAttrs.alt = alt;\n if (title) imgAttrs.title = title;\n return [\n 'figure',\n figureAttrs,\n ['img', imgAttrs],\n ['figcaption', { class: 'nile-wysiwyg__figcaption' }, 0],\n ];\n },\n },\n\n /**\n * Checklists. Serialized as <ul data-task-list><li data-task-item\n * data-checked> so they survive HTML round-trips; the live checkbox is an\n * editor-only NodeView. parseDOM priority 51 beats the generic li rule.\n */\n task_list: {\n content: 'task_item+',\n group: 'block',\n parseDOM: [{ tag: 'ul[data-task-list]', priority: 51 }],\n toDOM() {\n return ['ul', { 'data-task-list': 'true', class: 'nile-wysiwyg__task-list' }, 0];\n },\n },\n\n task_item: {\n content: 'paragraph block*',\n defining: true,\n attrs: { checked: { default: false } },\n parseDOM: [\n {\n tag: 'li[data-task-item]',\n priority: 51,\n getAttrs: (dom: HTMLElement) => ({\n checked: dom.getAttribute('data-checked') === 'true',\n }),\n },\n ],\n toDOM(node) {\n return [\n 'li',\n {\n 'data-task-item': 'true',\n 'data-checked': String(node.attrs.checked),\n class: 'nile-wysiwyg__task-item',\n },\n 0,\n ];\n },\n },\n\n /**\n * Provider embeds (YouTube/Vimeo/Loom) as block atoms. The iframe sits in\n * a wrapper div for aspect-ratio styling and a click-to-select overlay.\n */\n embed: {\n group: 'block',\n atom: true,\n selectable: true,\n draggable: true,\n attrs: {\n src: {},\n provider: { default: null },\n title: { default: null },\n /** Rendered width in px (drag-resize); null = default size. */\n width: { default: null },\n /** Block alignment: 'left' | 'center' | 'right' | null. */\n align: { default: null },\n },\n parseDOM: [\n {\n tag: 'div[data-embed-provider]',\n getAttrs: (dom: HTMLElement) => {\n const iframe = dom.querySelector('iframe[src]');\n if (!iframe) return false;\n const widthAttr =\n dom.getAttribute('data-width') ?? /^(\\d+)px$/.exec(dom.style.width)?.[1];\n const width = widthAttr ? parseInt(widthAttr, 10) : NaN;\n const align = dom.getAttribute('data-align');\n return {\n src: iframe.getAttribute('src'),\n provider: dom.getAttribute('data-embed-provider'),\n title: iframe.getAttribute('title'),\n width: Number.isFinite(width) && width > 0 ? width : null,\n align: align === 'left' || align === 'center' || align === 'right' ? align : null,\n };\n },\n },\n {\n tag: 'iframe[src]',\n getAttrs: (dom: HTMLElement) => {\n const width = parseInt(dom.getAttribute('width') ?? '', 10);\n return {\n src: dom.getAttribute('src'),\n title: dom.getAttribute('title'),\n width: Number.isFinite(width) && width > 0 ? width : null,\n };\n },\n },\n ],\n toDOM(node) {\n const { src, provider, title, width, align } = node.attrs;\n const iframeAttrs: Record<string, string> = {\n src,\n frameborder: '0',\n allowfullscreen: 'true',\n allow: 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture',\n sandbox: EMBED_SANDBOX,\n referrerpolicy: EMBED_REFERRER_POLICY,\n };\n if (title) iframeAttrs.title = title;\n const wrapperAttrs: Record<string, string> = {\n class: 'nile-wysiwyg__embed',\n 'data-embed-provider': provider ?? 'generic',\n };\n const styles: string[] = [];\n if (width) {\n wrapperAttrs['data-width'] = String(width);\n styles.push(`width: ${width}px`, 'max-width: 100%');\n }\n if (align) {\n wrapperAttrs['data-align'] = align;\n if (align === 'center') styles.push('margin-left: auto', 'margin-right: auto');\n else if (align === 'right') styles.push('margin-left: auto', 'margin-right: 0');\n }\n if (styles.length) wrapperAttrs.style = styles.join('; ');\n return ['div', wrapperAttrs, ['iframe', iframeAttrs]];\n },\n },\n\n /**\n * Author-supplied `<style>` block, entered via the HTML source view. The CSS\n * is sanitized on the way in (see sanitizeCss) — `@import`, `expression()`\n * and external `url()` are neutralized — then stored verbatim and serialized\n * straight back to a `<style>` element. A node view renders it live in the\n * editor with a small chip so the otherwise-invisible block stays selectable.\n */\n styleBlock: {\n group: 'block',\n atom: true,\n selectable: true,\n attrs: { css: { default: '' } },\n parseDOM: [\n {\n tag: 'style',\n getAttrs: (dom: HTMLElement) => ({ css: dom.textContent ?? '' }),\n },\n ],\n toDOM(node) {\n return ['style', node.attrs.css];\n },\n },\n\n /**\n * Bookmark: a named in-text anchor (`<a id=\"…\">`) for intra-document\n * navigation. Invisible in serialized output; the editor draws a flag\n * marker via CSS so it can be selected and deleted.\n */\n bookmark: {\n inline: true,\n group: 'inline',\n atom: true,\n selectable: true,\n attrs: { id: {} },\n parseDOM: [\n {\n tag: 'a[data-bookmark]',\n priority: 60,\n getAttrs: (dom: HTMLElement) => {\n const id = dom.getAttribute('id') || dom.getAttribute('name');\n return id ? { id } : false;\n },\n },\n // Anchors without an href are bookmarks (`<a id>` / legacy `<a name>`).\n {\n tag: 'a[id]',\n getAttrs: (dom: HTMLElement) =>\n dom.hasAttribute('href') ? false : { id: dom.getAttribute('id') },\n },\n {\n tag: 'a[name]',\n getAttrs: (dom: HTMLElement) =>\n dom.hasAttribute('href') ? false : { id: dom.getAttribute('name') },\n },\n ],\n toDOM(node) {\n return ['a', { id: node.attrs.id, 'data-bookmark': 'true' }];\n },\n },\n\n /** Inline atom for @-style mentions. The label renders as `${trigger}${label}`. */\n mention: {\n inline: true,\n group: 'inline',\n atom: true,\n selectable: true,\n attrs: {\n trigger: { default: '@' },\n key: {},\n label: {},\n },\n parseDOM: [\n {\n tag: 'span[data-mention-key]',\n getAttrs: (dom: HTMLElement) => ({\n trigger: dom.getAttribute('data-mention-trigger') || '@',\n key: dom.getAttribute('data-mention-key'),\n label:\n dom.getAttribute('data-mention-label') || dom.textContent?.slice(1) || '',\n }),\n },\n ],\n toDOM(node) {\n const { trigger, key, label } = node.attrs;\n return [\n 'span',\n {\n class: 'nile-wysiwyg__mention',\n 'data-mention-trigger': trigger,\n 'data-mention-key': key,\n 'data-mention-label': label,\n },\n `${trigger}${label}`,\n ];\n },\n },\n\n /**\n * Merge field: an inline atom placeholder for mail-merge / personalization\n * (e.g. `{{first_name}}`). Stores a stable `id` and a human `label`; renders\n * the label (falling back to `{{id}}`) as a non-editable chip.\n */\n merge_field: {\n inline: true,\n group: 'inline',\n atom: true,\n selectable: true,\n attrs: { id: {}, label: { default: null } },\n parseDOM: [\n {\n tag: 'span[data-merge-field]',\n getAttrs: (dom: HTMLElement) => {\n const id = dom.getAttribute('data-merge-field');\n if (!id) return false;\n return {\n id,\n label: dom.getAttribute('data-merge-label') || dom.textContent || null,\n };\n },\n },\n ],\n toDOM(node) {\n const { id, label } = node.attrs;\n return [\n 'span',\n {\n class: 'nile-wysiwyg__merge-field',\n 'data-merge-field': id,\n 'data-merge-label': label ?? '',\n },\n label || `{{${id}}}`,\n ];\n },\n },\n\n /**\n * Math: an inline atom holding a LaTeX source string. Rendering is pluggable\n * via the editor's `mathRenderer` (KaTeX/MathJax, or MathML). Without a\n * renderer the raw LaTeX is shown in a math-styled chip. `display` chooses\n * inline vs. block presentation.\n */\n math: {\n inline: true,\n group: 'inline',\n atom: true,\n selectable: true,\n attrs: { latex: {}, display: { default: 'inline' } },\n parseDOM: [\n {\n tag: 'span[data-math]',\n getAttrs: (dom: HTMLElement) => ({\n latex: dom.getAttribute('data-math') || dom.textContent || '',\n display: dom.getAttribute('data-math-display') === 'block' ? 'block' : 'inline',\n }),\n },\n ],\n toDOM(node) {\n const { latex, display } = node.attrs;\n return [\n 'span',\n {\n class: 'nile-wysiwyg__math',\n 'data-math': latex,\n 'data-math-display': display,\n },\n latex,\n ];\n },\n },\n};\n\n/** Table nodes from prosemirror-tables, with cell background support. */\nconst tableNodeSpecs = tableNodes({\n tableGroup: 'block',\n cellContent: 'block+',\n cellAttributes: {\n background: {\n default: null,\n getFromDOM(dom) {\n return (dom as HTMLElement).style.backgroundColor || null;\n },\n setDOMAttr(value, attrs) {\n if (value) {\n attrs.style = `${(attrs.style as string) || ''}background-color: ${value};`;\n }\n },\n },\n },\n});\n\n/**\n * The table spec extended with a `layout` attr: layout tables (structured\n * layouts, e.g. for email HTML) serialize as `role=\"presentation\"` and render\n * borderless, with dashed guides visible only while editing.\n */\nconst baseTableSpec = tableNodeSpecs.table;\nconst tableSpec: NodeSpec = {\n ...baseTableSpec,\n attrs: { ...(baseTableSpec.attrs ?? {}), layout: { default: false } },\n parseDOM: [\n {\n tag: 'table',\n getAttrs: (dom: HTMLElement) => ({\n layout:\n dom.getAttribute('role') === 'presentation' || dom.hasAttribute('data-layout'),\n }),\n },\n ],\n toDOM(node) {\n return node.attrs.layout\n ? ['table', { role: 'presentation', 'data-layout': 'true' }, ['tbody', 0]]\n : ['table', ['tbody', 0]];\n },\n};\n\n/**\n * Marks. Order matters: marks later in the map render closer to the text.\n * Each styling mark parses from both semantic tags AND inline `style=`\n * declarations so pasted Word/Google Docs content keeps its formatting.\n */\nconst marks: Record<string, MarkSpec> = {\n link: {\n attrs: {\n href: {},\n title: { default: null },\n target: { default: null },\n },\n inclusive: false,\n parseDOM: [\n {\n tag: 'a[href]',\n getAttrs: (dom: HTMLElement) => ({\n href: dom.getAttribute('href'),\n title: dom.getAttribute('title'),\n target: dom.getAttribute('target'),\n }),\n },\n ],\n toDOM(mark) {\n const { href, title, target } = mark.attrs;\n const attrs: Record<string, string> = { href };\n if (title) attrs.title = title;\n if (target) {\n attrs.target = target;\n if (target === '_blank') attrs.rel = 'noopener noreferrer';\n }\n return ['a', attrs, 0];\n },\n },\n\n bold: {\n parseDOM: [\n { tag: 'strong' },\n // Google Docs wraps everything in <b style=\"font-weight: normal\">\n {\n tag: 'b',\n getAttrs: (dom: HTMLElement) => dom.style.fontWeight !== 'normal' && null,\n },\n {\n style: 'font-weight',\n getAttrs: (value: string) => /^(bold(er)?|[5-9]\\d{2,})$/.test(value) && null,\n },\n ],\n toDOM() {\n return ['strong', 0];\n },\n },\n\n italic: {\n parseDOM: [\n { tag: 'i' },\n { tag: 'em' },\n { style: 'font-style=italic' },\n ],\n toDOM() {\n return ['em', 0];\n },\n },\n\n underline: {\n parseDOM: [\n { tag: 'u' },\n {\n style: 'text-decoration',\n getAttrs: (value: string) => value.includes('underline') && null,\n },\n {\n style: 'text-decoration-line',\n getAttrs: (value: string) => value.includes('underline') && null,\n },\n ],\n toDOM() {\n return ['u', 0];\n },\n },\n\n strike: {\n parseDOM: [\n { tag: 's' },\n { tag: 'strike' },\n { tag: 'del' },\n {\n style: 'text-decoration',\n getAttrs: (value: string) => value.includes('line-through') && null,\n },\n {\n style: 'text-decoration-line',\n getAttrs: (value: string) => value.includes('line-through') && null,\n },\n ],\n toDOM() {\n return ['s', 0];\n },\n },\n\n /** Mutually exclusive vertical-shift marks (formulas, footnote refs). */\n subscript: {\n excludes: 'subscript superscript',\n parseDOM: [{ tag: 'sub' }, { style: 'vertical-align=sub' }],\n toDOM() {\n return ['sub', 0];\n },\n },\n\n superscript: {\n excludes: 'subscript superscript',\n parseDOM: [{ tag: 'sup' }, { style: 'vertical-align=super' }],\n toDOM() {\n return ['sup', 0];\n },\n },\n\n code: {\n parseDOM: [{ tag: 'code' }],\n toDOM() {\n return ['code', { class: 'nile-wysiwyg__inline-code' }, 0];\n },\n },\n\n /** Carries an author `class`/`id` on an inline `<span>` that has no other\n * meaning, so class/id CSS can target runs of text. Low priority so styled\n * spans (color/font marks) and atom spans (mention/merge/math) win. */\n html_span: {\n attrs: { htmlClass: { default: null }, htmlId: { default: null } },\n parseDOM: [\n {\n tag: 'span',\n priority: 5,\n getAttrs: (dom: HTMLElement) => {\n const htmlClass = cleanClass(dom.getAttribute('class'));\n const htmlId = cleanId(dom.getAttribute('id'));\n return htmlClass || htmlId ? { htmlClass, htmlId } : false;\n },\n },\n ],\n toDOM(mark) {\n const attrs: Record<string, string> = {};\n if (mark.attrs.htmlClass) attrs.class = mark.attrs.htmlClass;\n if (mark.attrs.htmlId) attrs.id = mark.attrs.htmlId;\n return ['span', attrs, 0];\n },\n },\n\n text_color: {\n attrs: { color: {} },\n parseDOM: [\n {\n style: 'color',\n getAttrs: (value: string) => (value ? { color: value } : false),\n },\n ],\n toDOM(mark) {\n return ['span', { style: `color: ${mark.attrs.color}` }, 0];\n },\n },\n\n bg_color: {\n attrs: { color: {} },\n parseDOM: [\n {\n style: 'background-color',\n getAttrs: (value: string) =>\n value && value !== 'transparent' ? { color: value } : false,\n },\n ],\n toDOM(mark) {\n return ['span', { style: `background-color: ${mark.attrs.color}` }, 0];\n },\n },\n\n font_family: {\n attrs: { family: {} },\n parseDOM: [\n {\n style: 'font-family',\n getAttrs: (value: string) => (value ? { family: value } : false),\n },\n ],\n toDOM(mark) {\n return ['span', { style: `font-family: ${mark.attrs.family}` }, 0];\n },\n },\n\n font_size: {\n attrs: { size: {} },\n parseDOM: [\n {\n style: 'font-size',\n getAttrs: (value: string) => (value ? { size: value } : false),\n },\n ],\n toDOM(mark) {\n return ['span', { style: `font-size: ${mark.attrs.size}` }, 0];\n },\n },\n};\n\n/** Bullet markers CSS understands; anything else falls back to default. */\nexport const BULLET_STYLES = ['disc', 'circle', 'square'] as const;\n\n/** Numbering styles, keyed by the HTML `type` attribute letter. */\nexport const ORDERED_STYLES: Record<string, string> = {\n '1': 'decimal',\n a: 'lower-alpha',\n A: 'upper-alpha',\n i: 'lower-roman',\n I: 'upper-roman',\n};\n\nconst STYLE_TO_TYPE: Record<string, string> = Object.fromEntries(\n Object.entries(ORDERED_STYLES).map(([type, style]) => [style, type])\n);\n\n/**\n * Legal-style continuous numbering (1, 1.1, 1.1.1). Not a CSS\n * list-style-type: it serializes as `data-list-style=\"multilevel\"` and is\n * rendered with CSS counters (see the editor stylesheet). Consumers rendering\n * the output need the same counter rules.\n */\nexport const MULTILEVEL_STYLE = 'multilevel';\n\n/** List specs from prosemirror-schema-list, extended with style attrs. */\nconst bulletListSpec: NodeSpec = {\n content: 'list_item+',\n group: 'block',\n attrs: { style: { default: null } },\n parseDOM: [\n {\n tag: 'ul',\n getAttrs: (dom: HTMLElement) => {\n const style = dom.style.listStyleType;\n return {\n style: (BULLET_STYLES as readonly string[]).includes(style) ? style : null,\n };\n },\n },\n ],\n toDOM(node) {\n return node.attrs.style\n ? ['ul', { style: `list-style-type: ${node.attrs.style}` }, 0]\n : ['ul', 0];\n },\n};\n\nconst orderedListSpec: NodeSpec = {\n content: 'list_item+',\n group: 'block',\n attrs: { order: { default: 1 }, style: { default: null } },\n parseDOM: [\n {\n tag: 'ol',\n getAttrs: (dom: HTMLElement) => {\n const type = dom.getAttribute('type') ?? '';\n const cssStyle = dom.style.listStyleType;\n const style =\n dom.getAttribute('data-list-style') === MULTILEVEL_STYLE\n ? MULTILEVEL_STYLE\n : ORDERED_STYLES[type] ??\n (Object.values(ORDERED_STYLES).includes(cssStyle) ? cssStyle : null);\n const start = Number(dom.getAttribute('start'));\n return {\n order: Number.isFinite(start) && start > 0 ? start : 1,\n style,\n };\n },\n },\n ],\n toDOM(node) {\n const attrs: Record<string, string> = {};\n if (node.attrs.order !== 1) attrs.start = String(node.attrs.order);\n if (node.attrs.style === MULTILEVEL_STYLE) {\n attrs['data-list-style'] = MULTILEVEL_STYLE;\n } else if (node.attrs.style && STYLE_TO_TYPE[node.attrs.style]) {\n attrs.type = STYLE_TO_TYPE[node.attrs.style];\n }\n return ['ol', attrs, 0];\n },\n};\n\n/** Builds the editor schema. List nodes are added via prosemirror-schema-list. */\nexport function createSchema(): Schema {\n let nodeMap = addListNodes(OrderedMap.from(nodes), 'paragraph block*', 'block')\n .update('bullet_list', bulletListSpec)\n .update('ordered_list', orderedListSpec)\n .append(tableNodeSpecs)\n .update('table', tableSpec);\n // Thread author class/id through the content nodes and marks (applied last so\n // it also wraps the list/table specs pulled in from external packages).\n for (const name of HTML_ATTR_NODES) {\n const spec = nodeMap.get(name);\n if (spec) nodeMap = nodeMap.update(name, withHtmlAttrs(spec));\n }\n let markMap = OrderedMap.from<MarkSpec>(marks);\n for (const name of HTML_ATTR_MARKS) {\n const spec = markMap.get(name);\n if (spec) markMap = markMap.update(name, withHtmlAttrs(spec));\n }\n return new Schema({ nodes: nodeMap, marks: markMap });\n}\n\n/** A shared default schema instance. */\nexport const defaultSchema = createSchema();\n"]}
@@ -1,3 +1,8 @@
1
1
  export { NileWysiwygEditor, default } from './nile-wysiwyg-editor';
2
+ export { NileWysiwygToolbarItem } from './nile-wysiwyg-toolbar/nile-wysiwyg-toolbar-item';
3
+ export { NileWysiwygBubbleItem } from './ui/bubble-item';
4
+ export type { AuthoredToolbarItem } from './nile-wysiwyg-toolbar/nile-wysiwyg-toolbar';
2
5
  export type { WysiwygChangeDetail, WysiwygCommandDetail, ToolbarConfig } from './types';
3
6
  export { DEFAULT_TOOLBAR } from './types';
7
+ export { createKatexRenderer } from './math/katex-renderer';
8
+ export type { KatexLike, KatexRendererOptions } from './math/katex-renderer';
@@ -1,3 +1,6 @@
1
1
  export { NileWysiwygEditor, default } from './nile-wysiwyg-editor';
2
+ export { NileWysiwygToolbarItem } from './nile-wysiwyg-toolbar/nile-wysiwyg-toolbar-item';
3
+ export { NileWysiwygBubbleItem } from './ui/bubble-item';
2
4
  export { DEFAULT_TOOLBAR } from './types';
5
+ export { createKatexRenderer } from './math/katex-renderer';
3
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nile-wysiwyg-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC","sourcesContent":["export { NileWysiwygEditor, default } from './nile-wysiwyg-editor';\nexport type { WysiwygChangeDetail, WysiwygCommandDetail, ToolbarConfig } from './types';\nexport { DEFAULT_TOOLBAR } from './types';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nile-wysiwyg-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,kDAAkD,CAAC;AAC1F,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAGzD,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC","sourcesContent":["export { NileWysiwygEditor, default } from './nile-wysiwyg-editor';\nexport { NileWysiwygToolbarItem } from './nile-wysiwyg-toolbar/nile-wysiwyg-toolbar-item';\nexport { NileWysiwygBubbleItem } from './ui/bubble-item';\nexport type { AuthoredToolbarItem } from './nile-wysiwyg-toolbar/nile-wysiwyg-toolbar';\nexport type { WysiwygChangeDetail, WysiwygCommandDetail, ToolbarConfig } from './types';\nexport { DEFAULT_TOOLBAR } from './types';\nexport { createKatexRenderer } from './math/katex-renderer';\nexport type { KatexLike, KatexRendererOptions } from './math/katex-renderer';\n"]}
@@ -0,0 +1,38 @@
1
+ import type { MathRenderer } from '../engine/plugins/math-view';
2
+ /**
3
+ * The slice of the KaTeX module this helper needs. Declared locally so the
4
+ * design system never imports `katex` itself — you bundle KaTeX from your own
5
+ * app's install and pass the instance in.
6
+ */
7
+ export interface KatexLike {
8
+ renderToString(latex: string, options?: Record<string, unknown>): string;
9
+ }
10
+ export interface KatexRendererOptions {
11
+ /**
12
+ * Extra options merged into every `katex.renderToString` call (after the
13
+ * `displayMode` / `throwOnError` defaults). See the KaTeX options reference.
14
+ */
15
+ katexOptions?: Record<string, unknown>;
16
+ }
17
+ /**
18
+ * Builds a {@link MathRenderer} backed by KaTeX for the editor's `mathRenderer`
19
+ * property. KaTeX is **not** bundled by the design system — install it in your
20
+ * app and hand the instance to this helper so your bundler ships it (no CDN):
21
+ *
22
+ * ```ts
23
+ * import katex from 'katex';
24
+ * import 'katex/dist/katex.min.css';
25
+ * import { createKatexRenderer } from '@aquera/nile-elements';
26
+ *
27
+ * editor.mathRenderer = createKatexRenderer(katex);
28
+ * // or with overrides:
29
+ * editor.mathRenderer = createKatexRenderer(katex, {
30
+ * katexOptions: { macros: { '\\RR': '\\mathbb{R}' } },
31
+ * });
32
+ * ```
33
+ *
34
+ * Called with no instance it falls back to a global `katex` (e.g. a CDN
35
+ * `<script>`), which is handy for quick demos. If no engine is available at
36
+ * render time the raw LaTeX is returned, so content stays visible.
37
+ */
38
+ export declare function createKatexRenderer(katex?: KatexLike, options?: KatexRendererOptions): MathRenderer;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Builds a {@link MathRenderer} backed by KaTeX for the editor's `mathRenderer`
3
+ * property. KaTeX is **not** bundled by the design system — install it in your
4
+ * app and hand the instance to this helper so your bundler ships it (no CDN):
5
+ *
6
+ * ```ts
7
+ * import katex from 'katex';
8
+ * import 'katex/dist/katex.min.css';
9
+ * import { createKatexRenderer } from '@aquera/nile-elements';
10
+ *
11
+ * editor.mathRenderer = createKatexRenderer(katex);
12
+ * // or with overrides:
13
+ * editor.mathRenderer = createKatexRenderer(katex, {
14
+ * katexOptions: { macros: { '\\RR': '\\mathbb{R}' } },
15
+ * });
16
+ * ```
17
+ *
18
+ * Called with no instance it falls back to a global `katex` (e.g. a CDN
19
+ * `<script>`), which is handy for quick demos. If no engine is available at
20
+ * render time the raw LaTeX is returned, so content stays visible.
21
+ */
22
+ export function createKatexRenderer(katex, options = {}) {
23
+ return (latex, display) => {
24
+ const engine = katex ?? globalThis.katex;
25
+ if (!engine)
26
+ return latex;
27
+ try {
28
+ return engine.renderToString(latex, {
29
+ displayMode: display === 'block',
30
+ throwOnError: false,
31
+ ...options.katexOptions,
32
+ });
33
+ }
34
+ catch {
35
+ // Malformed LaTeX (with throwOnError overridden true, say) → show source.
36
+ return latex;
37
+ }
38
+ };
39
+ }
40
+ //# sourceMappingURL=katex-renderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"katex-renderer.js","sourceRoot":"","sources":["../../../../src/nile-wysiwyg-editor/math/katex-renderer.ts"],"names":[],"mappings":"AAmBA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,mBAAmB,CACjC,KAAiB,EACjB,UAAgC,EAAE;IAElC,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACxB,MAAM,MAAM,GAAG,KAAK,IAAK,UAAoC,CAAC,KAAK,CAAC;QACpE,IAAI,CAAC,MAAM;YAAE,OAAO,KAAK,CAAC;QAC1B,IAAI,CAAC;YACH,OAAO,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE;gBAClC,WAAW,EAAE,OAAO,KAAK,OAAO;gBAChC,YAAY,EAAE,KAAK;gBACnB,GAAG,OAAO,CAAC,YAAY;aACxB,CAAC,CAAC;QACL,CAAC;QAAC,MAAM,CAAC;YACP,0EAA0E;YAC1E,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { MathRenderer } from '../engine/plugins/math-view';\n\n/**\n * The slice of the KaTeX module this helper needs. Declared locally so the\n * design system never imports `katex` itself — you bundle KaTeX from your own\n * app's install and pass the instance in.\n */\nexport interface KatexLike {\n renderToString(latex: string, options?: Record<string, unknown>): string;\n}\n\nexport interface KatexRendererOptions {\n /**\n * Extra options merged into every `katex.renderToString` call (after the\n * `displayMode` / `throwOnError` defaults). See the KaTeX options reference.\n */\n katexOptions?: Record<string, unknown>;\n}\n\n/**\n * Builds a {@link MathRenderer} backed by KaTeX for the editor's `mathRenderer`\n * property. KaTeX is **not** bundled by the design system — install it in your\n * app and hand the instance to this helper so your bundler ships it (no CDN):\n *\n * ```ts\n * import katex from 'katex';\n * import 'katex/dist/katex.min.css';\n * import { createKatexRenderer } from '@aquera/nile-elements';\n *\n * editor.mathRenderer = createKatexRenderer(katex);\n * // or with overrides:\n * editor.mathRenderer = createKatexRenderer(katex, {\n * katexOptions: { macros: { '\\\\RR': '\\\\mathbb{R}' } },\n * });\n * ```\n *\n * Called with no instance it falls back to a global `katex` (e.g. a CDN\n * `<script>`), which is handy for quick demos. If no engine is available at\n * render time the raw LaTeX is returned, so content stays visible.\n */\nexport function createKatexRenderer(\n katex?: KatexLike,\n options: KatexRendererOptions = {}\n): MathRenderer {\n return (latex, display) => {\n const engine = katex ?? (globalThis as { katex?: KatexLike }).katex;\n if (!engine) return latex;\n try {\n return engine.renderToString(latex, {\n displayMode: display === 'block',\n throwOnError: false,\n ...options.katexOptions,\n });\n } catch {\n // Malformed LaTeX (with throwOnError overridden true, say) → show source.\n return latex;\n }\n };\n}\n"]}
@@ -291,8 +291,10 @@ export const styles = css `
291
291
  text-align: left;
292
292
  }
293
293
 
294
- .ProseMirror td > :last-child,
295
- .ProseMirror th > :last-child {
294
+
295
+ .ProseMirror td > *,
296
+ .ProseMirror th > * {
297
+ margin-top: 0;
296
298
  margin-bottom: 0;
297
299
  }
298
300
 
@@ -604,11 +606,28 @@ export const styles = css `
604
606
  font-weight: 600;
605
607
  }
606
608
 
607
- /* --- Sticky toolbar --- */
609
+ /* --- Author <style> block (from HTML source) ---
610
+ Applied live by StyleBlockView (a hidden <style> host, scoped to the
611
+ content); the block renders nothing in the editor. */
612
+ .nile-wysiwyg__style-block {
613
+ display: none;
614
+ }
615
+
616
+ /* --- Sticky toolbar ---
617
+ Pins to the top of the scroll container. Note: sticky anchors to the
618
+ container's PADDING box, so if the scroll container has top padding, a
619
+ band of content shows above the toolbar — set --nile-wysiwyg-sticky-top
620
+ (or remove the container's top padding) to compensate. The opaque
621
+ background makes the pinned bar self-backing so content can never bleed
622
+ through it. */
608
623
  :host([sticky-toolbar]) nile-wysiwyg-toolbar {
609
624
  position: sticky;
610
625
  top: var(--nile-wysiwyg-sticky-top, 0);
611
626
  z-index: 12;
627
+ background: var(
628
+ --nile-wysiwyg-bg,
629
+ var(--nile-colors-white-base, var(--ng-colors-bg-primary, #ffffff))
630
+ );
612
631
  }
613
632
 
614
633
  /* --- Mentions & suggestions --- */
@@ -1 +1 @@
1
- {"version":3,"file":"nile-wysiwyg-editor.css.js","sourceRoot":"","sources":["../../../src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2wBxB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`\n :host {\n display: block;\n font-family: var(\n --nile-wysiwyg-font-family,\n var(\n --nile-font-family-sans-serif,\n var(--ng-font-family-body, system-ui, -apple-system, sans-serif)\n )\n );\n }\n\n .nile-wysiwyg {\n position: relative;\n display: flex;\n flex-direction: column;\n border: 1px solid\n var(\n --nile-wysiwyg-border-color,\n var(--nile-colors-neutral-400, var(--ng-colors-border-neutral, #d0d5dd))\n );\n border-radius: var(\n --nile-wysiwyg-radius,\n var(--nile-radius-radius-xl, var(--ng-radius-md, 8px))\n );\n background: var(\n --nile-wysiwyg-bg,\n var(--nile-colors-white-base, var(--ng-colors-bg-primary, #ffffff))\n );\n box-sizing: border-box;\n }\n\n /* --- Fullscreen (distraction-free) mode --- */\n :host([fullscreen]) {\n position: fixed;\n inset: 0;\n z-index: var(--nile-wysiwyg-fullscreen-z-index, 1000);\n background: var(\n --nile-wysiwyg-bg,\n var(--nile-colors-white-base, var(--ng-colors-bg-primary, #ffffff))\n );\n }\n\n :host([fullscreen]) .nile-wysiwyg {\n height: 100%;\n border: none;\n border-radius: 0;\n }\n\n :host([fullscreen]) .nile-wysiwyg__surface {\n max-height: none;\n }\n\n :host([disabled]) .nile-wysiwyg {\n border-color: var(--nile-colors-neutral-500, var(--ng-colors-border-disabled, #98a2b3));\n background: var(\n --nile-wysiwyg-disabled-bg,\n var(--nile-colors-dark-200, var(--ng-colors-bg-disabled-subtle, #f2f4f7))\n );\n cursor: not-allowed;\n pointer-events: none;\n }\n\n :host([disabled]) .ProseMirror {\n background: var(--nile-colors-dark-200, var(--ng-colors-bg-disabled-subtle, #f2f4f7));\n color: var(--nile-colors-dark-500, var(--ng-colors-text-disabled, #98a2b3));\n }\n\n .nile-wysiwyg__surface {\n flex: 1;\n overflow-y: auto;\n max-height: var(--nile-wysiwyg-max-height, none);\n }\n\n /* --- ProseMirror base rules (inlined from prosemirror-view/style) --- */\n .ProseMirror {\n position: relative;\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: 'liga' 0;\n outline: none;\n padding: var(--nile-wysiwyg-content-padding, 12px);\n min-height: var(--nile-wysiwyg-min-height, 160px);\n font-size: var(--nile-wysiwyg-font-size, inherit);\n line-height: var(--nile-wysiwyg-line-height, inherit);\n tab-size: 4;\n -moz-tab-size: 4;\n word-break: break-word;\n color: var(\n --nile-wysiwyg-color,\n var(--nile-colors-dark-900, var(--ng-colors-text-primary, #101828))\n );\n box-sizing: border-box;\n border-radius: 0 0 var(--nile-wysiwyg-radius, var(--nile-radius-radius-xl, 8px))\n var(--nile-wysiwyg-radius, var(--nile-radius-radius-xl, 8px));\n }\n\n .ProseMirror pre {\n white-space: pre-wrap;\n }\n\n .ProseMirror li {\n position: relative;\n }\n\n .ProseMirror-hideselection *::selection {\n background: transparent;\n }\n\n .ProseMirror-hideselection {\n caret-color: transparent;\n }\n\n .ProseMirror-selectednode {\n outline: 2px solid\n var(--nile-wysiwyg-focus-border-color, var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600, #2563eb)));\n }\n\n /* Gap cursor (inlined from prosemirror-gapcursor/style) */\n .ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n }\n\n .ProseMirror-gapcursor:after {\n content: '';\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid currentColor;\n animation: nile-wysiwyg-cursor-blink 1.1s steps(2, start) infinite;\n }\n\n @keyframes nile-wysiwyg-cursor-blink {\n to {\n visibility: hidden;\n }\n }\n\n .ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n }\n\n /* --- Placeholder (legacy: neutral-500 at 0.7 opacity) --- */\n .nile-wysiwyg__empty::before {\n content: attr(data-placeholder);\n float: left;\n height: 0;\n pointer-events: none;\n user-select: none;\n opacity: 0.7;\n color: var(\n --nile-wysiwyg-placeholder-color,\n var(--nile-colors-neutral-500, var(--ng-colors-text-secondary, #98a2b3))\n );\n }\n\n /* --- Document content typography --- */\n .ProseMirror > :first-child {\n margin-top: 0;\n }\n\n .ProseMirror > :last-child {\n margin-bottom: 0;\n }\n\n /* Legacy nile-rich-text-editor typography */\n .ProseMirror p {\n margin: 1em 0;\n }\n\n .ProseMirror h1,\n .ProseMirror h2,\n .ProseMirror h3,\n .ProseMirror h4,\n .ProseMirror h5,\n .ProseMirror h6 {\n font-weight: bold;\n }\n\n .ProseMirror h1 {\n font-size: 2em;\n margin: 0.67em 0;\n }\n .ProseMirror h2 {\n font-size: 1.5em;\n margin: 0.83em 0;\n }\n .ProseMirror h3 {\n font-size: 1.17em;\n margin: 1em 0;\n }\n .ProseMirror h4 {\n font-size: 1em;\n margin: 1.33em 0;\n }\n .ProseMirror h5 {\n font-size: 0.83em;\n margin: 1.67em 0;\n }\n .ProseMirror h6 {\n font-size: 0.67em;\n margin: 2.33em 0;\n }\n\n .ProseMirror blockquote {\n margin: 0.5em 0;\n padding: 0.25em 0 0.25em 1em;\n border-left: 3px solid\n var(\n --nile-wysiwyg-blockquote-border,\n var(--nile-colors-neutral-300, #d0d5dd)\n );\n color: var(--nile-wysiwyg-blockquote-color, var(--nile-colors-neutral-600, #475467));\n }\n\n .ProseMirror ul,\n .ProseMirror ol {\n list-style-position: outside;\n padding-inline-start: 24px;\n }\n\n .ProseMirror hr {\n border: none;\n border-top: 1px solid var(--nile-wysiwyg-border-color, #d0d5dd);\n margin: 1em 0;\n }\n\n /* Legacy: brand color, no underline */\n .ProseMirror a {\n color: var(\n --nile-wysiwyg-link-color,\n var(--nile-colors-primary-600, var(--ng-colors-text-brand-tertiary-600, #2563eb))\n );\n text-decoration: none;\n cursor: pointer;\n }\n\n .ProseMirror code.nile-wysiwyg__inline-code {\n font-family: var(--nile-wysiwyg-code-font, ui-monospace, SFMono-Regular, Menlo, monospace);\n font-size: 0.9em;\n background: var(--nile-wysiwyg-code-bg, var(--nile-colors-neutral-100, #f2f4f7));\n border-radius: 4px;\n padding: 0.1em 0.35em;\n }\n\n /* --- Code blocks --- */\n .ProseMirror pre.nile-wysiwyg__code-block {\n font-family: var(--nile-wysiwyg-code-font, ui-monospace, SFMono-Regular, Menlo, monospace);\n font-size: 0.9em;\n background: var(--nile-wysiwyg-code-bg, var(--nile-colors-neutral-100, #f2f4f7));\n border: 1px solid var(--nile-colors-neutral-200, #eaecf0);\n border-radius: 6px;\n padding: 12px 14px;\n margin: 0.5em 0;\n overflow-x: auto;\n }\n\n /* --- Tables (rules required by prosemirror-tables) --- */\n .ProseMirror .tableWrapper {\n overflow-x: auto;\n margin: 0.5em 0;\n }\n\n .ProseMirror table {\n border-collapse: collapse;\n table-layout: fixed;\n width: 100%;\n overflow: hidden;\n }\n\n .ProseMirror td,\n .ProseMirror th {\n vertical-align: top;\n box-sizing: border-box;\n position: relative;\n border: 1px solid var(--nile-wysiwyg-table-border, var(--nile-colors-neutral-300, #d0d5dd));\n padding: 6px 8px;\n min-width: 1em;\n }\n\n .ProseMirror th {\n background: var(--nile-wysiwyg-table-header-bg, var(--nile-colors-neutral-50, #f9fafb));\n font-weight: 600;\n text-align: left;\n }\n\n .ProseMirror td > :last-child,\n .ProseMirror th > :last-child {\n margin-bottom: 0;\n }\n\n .ProseMirror .column-resize-handle {\n position: absolute;\n right: -2px;\n top: 0;\n bottom: 0;\n width: 4px;\n z-index: 20;\n background-color: var(--nile-colors-primary-300, #b692f6);\n pointer-events: none;\n }\n\n .ProseMirror.resize-cursor {\n cursor: ew-resize;\n cursor: col-resize;\n }\n\n /* --- Layout tables (role=\"presentation\"): borderless output, dashed\n guides while editing so the structure stays visible. --- */\n .ProseMirror table[data-layout] td,\n .ProseMirror table[data-layout] th {\n border: 1px dashed var(--nile-colors-neutral-300, #e4e7ec);\n background: transparent;\n font-weight: inherit;\n text-align: inherit;\n }\n\n /* --- Bookmarks: invisible anchors get a flag marker while editing --- */\n .ProseMirror a[data-bookmark] {\n display: inline-block;\n vertical-align: baseline;\n cursor: default;\n text-decoration: none;\n }\n\n .ProseMirror a[data-bookmark]::after {\n content: '⚑';\n font-size: 12px;\n line-height: 1;\n padding: 0 1px;\n color: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600, #2563eb));\n }\n\n .ProseMirror .selectedCell:after {\n z-index: 2;\n position: absolute;\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n background: var(--nile-wysiwyg-cell-selection, rgba(127, 86, 217, 0.12));\n pointer-events: none;\n }\n\n /* --- Images (ProseMirror's standard inline image node) --- */\n .ProseMirror img {\n max-width: 100%;\n height: auto;\n border-radius: 4px;\n }\n\n /* --- Image resize handles --- */\n .ProseMirror .nile-wysiwyg__image-resizer {\n position: relative;\n display: inline-block;\n line-height: 0;\n max-width: 100%;\n }\n\n .ProseMirror .nile-wysiwyg__resize-handle {\n display: none;\n position: absolute;\n width: 9px;\n height: 9px;\n background: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600, #2563eb));\n border: 1.5px solid #ffffff;\n border-radius: 2px;\n z-index: 2;\n }\n\n .ProseMirror .nile-wysiwyg__image-resizer--selected .nile-wysiwyg__resize-handle {\n display: block;\n }\n\n .ProseMirror .nile-wysiwyg__image-resizer--selected img {\n outline: 2px solid var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600, #2563eb));\n }\n\n .ProseMirror .nile-wysiwyg__resize-handle--nw { top: -5px; left: -5px; cursor: nwse-resize; }\n .ProseMirror .nile-wysiwyg__resize-handle--ne { top: -5px; right: -5px; cursor: nesw-resize; }\n .ProseMirror .nile-wysiwyg__resize-handle--sw { bottom: -5px; left: -5px; cursor: nesw-resize; }\n .ProseMirror .nile-wysiwyg__resize-handle--se { bottom: -5px; right: -5px; cursor: nwse-resize; }\n\n /* --- Captioned figures --- */\n .ProseMirror figure.nile-wysiwyg__figure {\n margin: 0.75em 0;\n max-width: 100%;\n }\n\n .ProseMirror figure.nile-wysiwyg__figure[data-align='center'] {\n margin-left: auto;\n margin-right: auto;\n }\n\n .ProseMirror figure.nile-wysiwyg__figure[data-align='right'] {\n margin-left: auto;\n margin-right: 0;\n }\n\n .ProseMirror figure.nile-wysiwyg__figure img {\n width: 100%;\n display: block;\n }\n\n .ProseMirror figure.nile-wysiwyg__figure .nile-wysiwyg__image-resizer {\n display: block;\n }\n\n .ProseMirror .nile-wysiwyg__figcaption {\n font-size: 0.85em;\n color: var(--nile-colors-neutral-500, #667085);\n text-align: center;\n padding: 4px 8px;\n line-height: 1.4;\n }\n\n .ProseMirror figure.nile-wysiwyg__figure--empty-caption .nile-wysiwyg__figcaption::before {\n content: 'Add a caption…';\n float: left;\n width: 100%;\n pointer-events: none;\n color: var(--nile-colors-neutral-400, #98a2b3);\n margin-bottom: -1.4em;\n }\n\n .ProseMirror figure.nile-wysiwyg__figure--selected {\n border-radius: 4px;\n }\n\n /* --- Embeds --- */\n .ProseMirror div.nile-wysiwyg__embed {\n position: relative;\n aspect-ratio: 16 / 9;\n /* Default size; an inline width from drag-resize overrides it, capped by\n max-width. overflow stays visible so the resize handles aren't clipped\n (rounding lives on the iframe). */\n width: min(640px, 100%);\n max-width: 100%;\n margin: 0.75em 0;\n border-radius: 8px;\n background: var(--nile-colors-neutral-100, #f2f4f7);\n }\n\n .ProseMirror div.nile-wysiwyg__embed iframe {\n width: 100%;\n height: 100%;\n border: 0;\n display: block;\n border-radius: 8px;\n /* Editing mode: the first click selects the node instead of hitting the\n iframe; once selected (or in readonly) the video is interactive. */\n pointer-events: none;\n }\n\n .ProseMirror div.nile-wysiwyg__embed.ProseMirror-selectednode iframe,\n :host([readonly]) .ProseMirror div.nile-wysiwyg__embed iframe {\n pointer-events: auto;\n }\n\n .ProseMirror div.nile-wysiwyg__embed.ProseMirror-selectednode {\n outline: 2px solid var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600, #2563eb));\n }\n\n .ProseMirror div.nile-wysiwyg__embed.ProseMirror-selectednode .nile-wysiwyg__resize-handle {\n display: block;\n }\n\n /* A live resize drag must not lose mousemove to the embedded document. */\n .ProseMirror div.nile-wysiwyg__embed.nile-wysiwyg__resizing iframe {\n pointer-events: none !important;\n }\n\n /* --- Code highlighting (compact light theme for hljs tokens) --- */\n .ProseMirror .hljs-comment,\n .ProseMirror .hljs-quote {\n color: #a0a1a7;\n font-style: italic;\n }\n\n .ProseMirror .hljs-keyword,\n .ProseMirror .hljs-selector-tag,\n .ProseMirror .hljs-formula,\n .ProseMirror .hljs-doctag {\n color: #a626a4;\n }\n\n .ProseMirror .hljs-section,\n .ProseMirror .hljs-name,\n .ProseMirror .hljs-selector-id,\n .ProseMirror .hljs-selector-class,\n .ProseMirror .hljs-deletion,\n .ProseMirror .hljs-subst,\n .ProseMirror .hljs-tag {\n color: #e45649;\n }\n\n .ProseMirror .hljs-literal,\n .ProseMirror .hljs-built_in,\n .ProseMirror .hljs-bullet {\n color: #0184bb;\n }\n\n .ProseMirror .hljs-string,\n .ProseMirror .hljs-regexp,\n .ProseMirror .hljs-addition,\n .ProseMirror .hljs-attribute,\n .ProseMirror .hljs-meta .hljs-string {\n color: #50a14f;\n }\n\n .ProseMirror .hljs-attr,\n .ProseMirror .hljs-variable,\n .ProseMirror .hljs-template-variable,\n .ProseMirror .hljs-type,\n .ProseMirror .hljs-selector-attr,\n .ProseMirror .hljs-selector-pseudo,\n .ProseMirror .hljs-number {\n color: #986801;\n }\n\n .ProseMirror .hljs-symbol,\n .ProseMirror .hljs-meta,\n .ProseMirror .hljs-link,\n .ProseMirror .hljs-operator,\n .ProseMirror .hljs-title,\n .ProseMirror .hljs-title.class_,\n .ProseMirror .hljs-title.function_ {\n color: #4078f2;\n }\n\n .ProseMirror .hljs-emphasis {\n font-style: italic;\n }\n\n .ProseMirror .hljs-strong {\n font-weight: bold;\n }\n\n /* --- Checklists --- */\n .ProseMirror ul.nile-wysiwyg__task-list {\n list-style: none;\n padding-inline-start: 4px;\n }\n\n .ProseMirror li.nile-wysiwyg__task-item {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n }\n\n .ProseMirror li.nile-wysiwyg__task-item > input[type='checkbox'] {\n /* Center on the first text line: (1 line box - checkbox height) / 2. */\n margin: calc((1em * 1.45 - 14px) / 2) 0 0;\n width: 14px;\n height: 14px;\n flex: none;\n cursor: pointer;\n accent-color: var(--nile-colors-primary-600, #2563eb);\n }\n\n .ProseMirror li.nile-wysiwyg__task-item > .nile-wysiwyg__task-content {\n flex: 1;\n min-width: 0;\n }\n\n /* The content's paragraph margins (legacy 1em) push text below the\n checkbox — strip them at the edges of each item. */\n .ProseMirror li.nile-wysiwyg__task-item > .nile-wysiwyg__task-content > :first-child {\n margin-top: 0;\n }\n\n .ProseMirror li.nile-wysiwyg__task-item > .nile-wysiwyg__task-content > :last-child {\n margin-bottom: 0;\n }\n\n .ProseMirror ul.nile-wysiwyg__task-list > li + li {\n margin-top: 0.35em;\n }\n\n .ProseMirror li.nile-wysiwyg__task-item[data-checked='true'] > .nile-wysiwyg__task-content {\n color: var(--nile-colors-neutral-500, #98a2b3);\n text-decoration: line-through;\n }\n\n /* --- Counter footer --- */\n .nile-wysiwyg__counter {\n padding: 4px 12px 6px;\n text-align: right;\n font-size: 12px;\n color: var(--nile-colors-neutral-500, var(--ng-colors-text-secondary, #98a2b3));\n border-top: 1px solid var(--nile-colors-neutral-200, #eaecf0);\n }\n\n .nile-wysiwyg__counter.over {\n color: var(--nile-colors-error-600, #d92d20);\n font-weight: 600;\n }\n\n /* --- Sticky toolbar --- */\n :host([sticky-toolbar]) nile-wysiwyg-toolbar {\n position: sticky;\n top: var(--nile-wysiwyg-sticky-top, 0);\n z-index: 12;\n }\n\n /* --- Mentions & suggestions --- */\n .ProseMirror span.nile-wysiwyg__mention {\n display: inline-block;\n padding: 0 4px;\n border-radius: 4px;\n background: var(--nile-wysiwyg-mention-bg, var(--nile-colors-primary-50, var(--ng-componentcolors-utility-blue-50, #eff4ff)));\n color: var(--nile-wysiwyg-mention-color, var(--nile-colors-primary-700, var(--ng-componentcolors-utility-blue-700, #1d4ed8)));\n font-weight: 500;\n white-space: nowrap;\n }\n\n .ProseMirror span.nile-wysiwyg__mention.ProseMirror-selectednode {\n outline: 2px solid var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600, #2563eb));\n }\n\n /* --- Merge fields --- */\n .ProseMirror span.nile-wysiwyg__merge-field {\n display: inline-block;\n padding: 0 4px;\n border-radius: 4px;\n background: var(--nile-wysiwyg-merge-bg, var(--nile-colors-neutral-100, #f2f4f7));\n color: var(--nile-wysiwyg-merge-color, var(--nile-colors-neutral-700, #344054));\n border: 1px dashed var(--nile-colors-neutral-400, #d0d5dd);\n font-family: ui-monospace, SFMono-Regular, Menlo, monospace;\n font-size: 0.9em;\n white-space: nowrap;\n }\n\n .ProseMirror span.nile-wysiwyg__merge-field.ProseMirror-selectednode {\n outline: 2px solid var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600, #2563eb));\n }\n\n /* --- Math --- */\n .ProseMirror span.nile-wysiwyg__math {\n display: inline-block;\n padding: 0 2px;\n font-family: \"Cambria Math\", \"Latin Modern Math\", serif;\n }\n\n .ProseMirror span.nile-wysiwyg__math--block {\n display: block;\n text-align: center;\n margin: 8px 0;\n }\n\n .ProseMirror span.nile-wysiwyg__math.ProseMirror-selectednode {\n outline: 2px solid var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600, #2563eb));\n border-radius: 3px;\n }\n\n /* Format painter armed: hint the next selection will be painted. */\n .ProseMirror.nile-wysiwyg--painting {\n cursor: cell;\n }\n\n .ProseMirror .nile-wysiwyg__suggestion {\n background: var(--nile-colors-primary-50, var(--ng-componentcolors-utility-blue-50, #eff4ff));\n border-radius: 3px;\n }\n\n /* --- Find & replace highlights --- */\n .ProseMirror .nile-wysiwyg__find-match {\n background: var(--nile-wysiwyg-find-bg, rgba(255, 214, 102, 0.45));\n border-radius: 2px;\n }\n\n .ProseMirror .nile-wysiwyg__find-active {\n background: var(--nile-wysiwyg-find-active-bg, rgba(255, 170, 0, 0.65));\n }\n\n /* --- Upload placeholder --- */\n .nile-wysiwyg__upload-placeholder {\n display: inline-block;\n padding: 6px 12px;\n border: 1px dashed var(--nile-colors-neutral-400, #d0d5dd);\n border-radius: 6px;\n background: var(--nile-colors-neutral-50, #f9fafb);\n color: var(--nile-colors-neutral-600, #475467);\n font-size: 0.85em;\n }\n\n /* --- Multi-level (legal) ordered lists: 1 / 1.1 / 1.1.1 numbering.\n Serialized output carries data-list-style=\"multilevel\"; consumers\n rendering it outside the editor need these same counter rules. --- */\n .ProseMirror ol[data-list-style='multilevel'],\n .ProseMirror ol[data-list-style='multilevel'] ol {\n list-style: none;\n counter-reset: nile-multilevel;\n }\n\n .ProseMirror ol[data-list-style='multilevel'] > li,\n .ProseMirror ol[data-list-style='multilevel'] ol > li {\n counter-increment: nile-multilevel;\n }\n\n /* The number sits inside the item's first paragraph so it shares a line. */\n .ProseMirror ol[data-list-style='multilevel'] > li > p:first-child::before,\n .ProseMirror ol[data-list-style='multilevel'] ol > li > p:first-child::before {\n content: counters(nile-multilevel, '.') '. ';\n font-variant-numeric: tabular-nums;\n }\n\n /* --- Show blocks: dashed outlines + tag labels while editing --- */\n .nile-wysiwyg--show-blocks .ProseMirror p,\n .nile-wysiwyg--show-blocks .ProseMirror h1,\n .nile-wysiwyg--show-blocks .ProseMirror h2,\n .nile-wysiwyg--show-blocks .ProseMirror h3,\n .nile-wysiwyg--show-blocks .ProseMirror h4,\n .nile-wysiwyg--show-blocks .ProseMirror h5,\n .nile-wysiwyg--show-blocks .ProseMirror h6,\n .nile-wysiwyg--show-blocks .ProseMirror blockquote,\n .nile-wysiwyg--show-blocks .ProseMirror pre,\n .nile-wysiwyg--show-blocks .ProseMirror figure,\n .nile-wysiwyg--show-blocks .ProseMirror ul,\n .nile-wysiwyg--show-blocks .ProseMirror ol,\n .nile-wysiwyg--show-blocks .ProseMirror li,\n .nile-wysiwyg--show-blocks .ProseMirror table {\n outline: 1px dashed var(--nile-wysiwyg-block-outline, var(--nile-colors-neutral-400, #d0d5dd));\n outline-offset: -1px;\n }\n\n .nile-wysiwyg--show-blocks .ProseMirror p,\n .nile-wysiwyg--show-blocks .ProseMirror h1,\n .nile-wysiwyg--show-blocks .ProseMirror h2,\n .nile-wysiwyg--show-blocks .ProseMirror h3,\n .nile-wysiwyg--show-blocks .ProseMirror h4,\n .nile-wysiwyg--show-blocks .ProseMirror h5,\n .nile-wysiwyg--show-blocks .ProseMirror h6,\n .nile-wysiwyg--show-blocks .ProseMirror blockquote,\n .nile-wysiwyg--show-blocks .ProseMirror pre {\n position: relative;\n }\n\n .nile-wysiwyg--show-blocks .ProseMirror p::after,\n .nile-wysiwyg--show-blocks .ProseMirror h1::after,\n .nile-wysiwyg--show-blocks .ProseMirror h2::after,\n .nile-wysiwyg--show-blocks .ProseMirror h3::after,\n .nile-wysiwyg--show-blocks .ProseMirror h4::after,\n .nile-wysiwyg--show-blocks .ProseMirror h5::after,\n .nile-wysiwyg--show-blocks .ProseMirror h6::after,\n .nile-wysiwyg--show-blocks .ProseMirror blockquote::after,\n .nile-wysiwyg--show-blocks .ProseMirror pre::after {\n position: absolute;\n top: 0;\n left: 0;\n padding: 0 3px;\n font-family: system-ui, sans-serif;\n font-size: 9px;\n font-weight: 600;\n font-style: normal;\n line-height: 14px;\n letter-spacing: 0.5px;\n color: var(--nile-colors-neutral-500, #667085);\n background: var(--nile-colors-neutral-100, #f2f4f7);\n border-radius: 0 0 4px 0;\n pointer-events: none;\n }\n\n .nile-wysiwyg--show-blocks .ProseMirror p::after { content: 'P'; }\n .nile-wysiwyg--show-blocks .ProseMirror h1::after { content: 'H1'; }\n .nile-wysiwyg--show-blocks .ProseMirror h2::after { content: 'H2'; }\n .nile-wysiwyg--show-blocks .ProseMirror h3::after { content: 'H3'; }\n .nile-wysiwyg--show-blocks .ProseMirror h4::after { content: 'H4'; }\n .nile-wysiwyg--show-blocks .ProseMirror h5::after { content: 'H5'; }\n .nile-wysiwyg--show-blocks .ProseMirror h6::after { content: 'H6'; }\n .nile-wysiwyg--show-blocks .ProseMirror blockquote::after { content: 'QUOTE'; }\n .nile-wysiwyg--show-blocks .ProseMirror pre::after { content: 'PRE'; }\n`;\n"]}
1
+ {"version":3,"file":"nile-wysiwyg-editor.css.js","sourceRoot":"","sources":["../../../src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8xBxB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`\n :host {\n display: block;\n font-family: var(\n --nile-wysiwyg-font-family,\n var(\n --nile-font-family-sans-serif,\n var(--ng-font-family-body, system-ui, -apple-system, sans-serif)\n )\n );\n }\n\n .nile-wysiwyg {\n position: relative;\n display: flex;\n flex-direction: column;\n border: 1px solid\n var(\n --nile-wysiwyg-border-color,\n var(--nile-colors-neutral-400, var(--ng-colors-border-neutral, #d0d5dd))\n );\n border-radius: var(\n --nile-wysiwyg-radius,\n var(--nile-radius-radius-xl, var(--ng-radius-md, 8px))\n );\n background: var(\n --nile-wysiwyg-bg,\n var(--nile-colors-white-base, var(--ng-colors-bg-primary, #ffffff))\n );\n box-sizing: border-box;\n }\n\n /* --- Fullscreen (distraction-free) mode --- */\n :host([fullscreen]) {\n position: fixed;\n inset: 0;\n z-index: var(--nile-wysiwyg-fullscreen-z-index, 1000);\n background: var(\n --nile-wysiwyg-bg,\n var(--nile-colors-white-base, var(--ng-colors-bg-primary, #ffffff))\n );\n }\n\n :host([fullscreen]) .nile-wysiwyg {\n height: 100%;\n border: none;\n border-radius: 0;\n }\n\n :host([fullscreen]) .nile-wysiwyg__surface {\n max-height: none;\n }\n\n :host([disabled]) .nile-wysiwyg {\n border-color: var(--nile-colors-neutral-500, var(--ng-colors-border-disabled, #98a2b3));\n background: var(\n --nile-wysiwyg-disabled-bg,\n var(--nile-colors-dark-200, var(--ng-colors-bg-disabled-subtle, #f2f4f7))\n );\n cursor: not-allowed;\n pointer-events: none;\n }\n\n :host([disabled]) .ProseMirror {\n background: var(--nile-colors-dark-200, var(--ng-colors-bg-disabled-subtle, #f2f4f7));\n color: var(--nile-colors-dark-500, var(--ng-colors-text-disabled, #98a2b3));\n }\n\n .nile-wysiwyg__surface {\n flex: 1;\n overflow-y: auto;\n max-height: var(--nile-wysiwyg-max-height, none);\n }\n\n /* --- ProseMirror base rules (inlined from prosemirror-view/style) --- */\n .ProseMirror {\n position: relative;\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: 'liga' 0;\n outline: none;\n padding: var(--nile-wysiwyg-content-padding, 12px);\n min-height: var(--nile-wysiwyg-min-height, 160px);\n font-size: var(--nile-wysiwyg-font-size, inherit);\n line-height: var(--nile-wysiwyg-line-height, inherit);\n tab-size: 4;\n -moz-tab-size: 4;\n word-break: break-word;\n color: var(\n --nile-wysiwyg-color,\n var(--nile-colors-dark-900, var(--ng-colors-text-primary, #101828))\n );\n box-sizing: border-box;\n border-radius: 0 0 var(--nile-wysiwyg-radius, var(--nile-radius-radius-xl, 8px))\n var(--nile-wysiwyg-radius, var(--nile-radius-radius-xl, 8px));\n }\n\n .ProseMirror pre {\n white-space: pre-wrap;\n }\n\n .ProseMirror li {\n position: relative;\n }\n\n .ProseMirror-hideselection *::selection {\n background: transparent;\n }\n\n .ProseMirror-hideselection {\n caret-color: transparent;\n }\n\n .ProseMirror-selectednode {\n outline: 2px solid\n var(--nile-wysiwyg-focus-border-color, var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600, #2563eb)));\n }\n\n /* Gap cursor (inlined from prosemirror-gapcursor/style) */\n .ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n }\n\n .ProseMirror-gapcursor:after {\n content: '';\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid currentColor;\n animation: nile-wysiwyg-cursor-blink 1.1s steps(2, start) infinite;\n }\n\n @keyframes nile-wysiwyg-cursor-blink {\n to {\n visibility: hidden;\n }\n }\n\n .ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n }\n\n /* --- Placeholder (legacy: neutral-500 at 0.7 opacity) --- */\n .nile-wysiwyg__empty::before {\n content: attr(data-placeholder);\n float: left;\n height: 0;\n pointer-events: none;\n user-select: none;\n opacity: 0.7;\n color: var(\n --nile-wysiwyg-placeholder-color,\n var(--nile-colors-neutral-500, var(--ng-colors-text-secondary, #98a2b3))\n );\n }\n\n /* --- Document content typography --- */\n .ProseMirror > :first-child {\n margin-top: 0;\n }\n\n .ProseMirror > :last-child {\n margin-bottom: 0;\n }\n\n /* Legacy nile-rich-text-editor typography */\n .ProseMirror p {\n margin: 1em 0;\n }\n\n .ProseMirror h1,\n .ProseMirror h2,\n .ProseMirror h3,\n .ProseMirror h4,\n .ProseMirror h5,\n .ProseMirror h6 {\n font-weight: bold;\n }\n\n .ProseMirror h1 {\n font-size: 2em;\n margin: 0.67em 0;\n }\n .ProseMirror h2 {\n font-size: 1.5em;\n margin: 0.83em 0;\n }\n .ProseMirror h3 {\n font-size: 1.17em;\n margin: 1em 0;\n }\n .ProseMirror h4 {\n font-size: 1em;\n margin: 1.33em 0;\n }\n .ProseMirror h5 {\n font-size: 0.83em;\n margin: 1.67em 0;\n }\n .ProseMirror h6 {\n font-size: 0.67em;\n margin: 2.33em 0;\n }\n\n .ProseMirror blockquote {\n margin: 0.5em 0;\n padding: 0.25em 0 0.25em 1em;\n border-left: 3px solid\n var(\n --nile-wysiwyg-blockquote-border,\n var(--nile-colors-neutral-300, #d0d5dd)\n );\n color: var(--nile-wysiwyg-blockquote-color, var(--nile-colors-neutral-600, #475467));\n }\n\n .ProseMirror ul,\n .ProseMirror ol {\n list-style-position: outside;\n padding-inline-start: 24px;\n }\n\n .ProseMirror hr {\n border: none;\n border-top: 1px solid var(--nile-wysiwyg-border-color, #d0d5dd);\n margin: 1em 0;\n }\n\n /* Legacy: brand color, no underline */\n .ProseMirror a {\n color: var(\n --nile-wysiwyg-link-color,\n var(--nile-colors-primary-600, var(--ng-colors-text-brand-tertiary-600, #2563eb))\n );\n text-decoration: none;\n cursor: pointer;\n }\n\n .ProseMirror code.nile-wysiwyg__inline-code {\n font-family: var(--nile-wysiwyg-code-font, ui-monospace, SFMono-Regular, Menlo, monospace);\n font-size: 0.9em;\n background: var(--nile-wysiwyg-code-bg, var(--nile-colors-neutral-100, #f2f4f7));\n border-radius: 4px;\n padding: 0.1em 0.35em;\n }\n\n /* --- Code blocks --- */\n .ProseMirror pre.nile-wysiwyg__code-block {\n font-family: var(--nile-wysiwyg-code-font, ui-monospace, SFMono-Regular, Menlo, monospace);\n font-size: 0.9em;\n background: var(--nile-wysiwyg-code-bg, var(--nile-colors-neutral-100, #f2f4f7));\n border: 1px solid var(--nile-colors-neutral-200, #eaecf0);\n border-radius: 6px;\n padding: 12px 14px;\n margin: 0.5em 0;\n overflow-x: auto;\n }\n\n /* --- Tables (rules required by prosemirror-tables) --- */\n .ProseMirror .tableWrapper {\n overflow-x: auto;\n margin: 0.5em 0;\n }\n\n .ProseMirror table {\n border-collapse: collapse;\n table-layout: fixed;\n width: 100%;\n overflow: hidden;\n }\n\n .ProseMirror td,\n .ProseMirror th {\n vertical-align: top;\n box-sizing: border-box;\n position: relative;\n border: 1px solid var(--nile-wysiwyg-table-border, var(--nile-colors-neutral-300, #d0d5dd));\n padding: 6px 8px;\n min-width: 1em;\n }\n\n .ProseMirror th {\n background: var(--nile-wysiwyg-table-header-bg, var(--nile-colors-neutral-50, #f9fafb));\n font-weight: 600;\n text-align: left;\n }\n\n \n .ProseMirror td > *,\n .ProseMirror th > * {\n margin-top: 0;\n margin-bottom: 0;\n }\n\n .ProseMirror .column-resize-handle {\n position: absolute;\n right: -2px;\n top: 0;\n bottom: 0;\n width: 4px;\n z-index: 20;\n background-color: var(--nile-colors-primary-300, #b692f6);\n pointer-events: none;\n }\n\n .ProseMirror.resize-cursor {\n cursor: ew-resize;\n cursor: col-resize;\n }\n\n /* --- Layout tables (role=\"presentation\"): borderless output, dashed\n guides while editing so the structure stays visible. --- */\n .ProseMirror table[data-layout] td,\n .ProseMirror table[data-layout] th {\n border: 1px dashed var(--nile-colors-neutral-300, #e4e7ec);\n background: transparent;\n font-weight: inherit;\n text-align: inherit;\n }\n\n /* --- Bookmarks: invisible anchors get a flag marker while editing --- */\n .ProseMirror a[data-bookmark] {\n display: inline-block;\n vertical-align: baseline;\n cursor: default;\n text-decoration: none;\n }\n\n .ProseMirror a[data-bookmark]::after {\n content: '⚑';\n font-size: 12px;\n line-height: 1;\n padding: 0 1px;\n color: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600, #2563eb));\n }\n\n .ProseMirror .selectedCell:after {\n z-index: 2;\n position: absolute;\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n background: var(--nile-wysiwyg-cell-selection, rgba(127, 86, 217, 0.12));\n pointer-events: none;\n }\n\n /* --- Images (ProseMirror's standard inline image node) --- */\n .ProseMirror img {\n max-width: 100%;\n height: auto;\n border-radius: 4px;\n }\n\n /* --- Image resize handles --- */\n .ProseMirror .nile-wysiwyg__image-resizer {\n position: relative;\n display: inline-block;\n line-height: 0;\n max-width: 100%;\n }\n\n .ProseMirror .nile-wysiwyg__resize-handle {\n display: none;\n position: absolute;\n width: 9px;\n height: 9px;\n background: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600, #2563eb));\n border: 1.5px solid #ffffff;\n border-radius: 2px;\n z-index: 2;\n }\n\n .ProseMirror .nile-wysiwyg__image-resizer--selected .nile-wysiwyg__resize-handle {\n display: block;\n }\n\n .ProseMirror .nile-wysiwyg__image-resizer--selected img {\n outline: 2px solid var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600, #2563eb));\n }\n\n .ProseMirror .nile-wysiwyg__resize-handle--nw { top: -5px; left: -5px; cursor: nwse-resize; }\n .ProseMirror .nile-wysiwyg__resize-handle--ne { top: -5px; right: -5px; cursor: nesw-resize; }\n .ProseMirror .nile-wysiwyg__resize-handle--sw { bottom: -5px; left: -5px; cursor: nesw-resize; }\n .ProseMirror .nile-wysiwyg__resize-handle--se { bottom: -5px; right: -5px; cursor: nwse-resize; }\n\n /* --- Captioned figures --- */\n .ProseMirror figure.nile-wysiwyg__figure {\n margin: 0.75em 0;\n max-width: 100%;\n }\n\n .ProseMirror figure.nile-wysiwyg__figure[data-align='center'] {\n margin-left: auto;\n margin-right: auto;\n }\n\n .ProseMirror figure.nile-wysiwyg__figure[data-align='right'] {\n margin-left: auto;\n margin-right: 0;\n }\n\n .ProseMirror figure.nile-wysiwyg__figure img {\n width: 100%;\n display: block;\n }\n\n .ProseMirror figure.nile-wysiwyg__figure .nile-wysiwyg__image-resizer {\n display: block;\n }\n\n .ProseMirror .nile-wysiwyg__figcaption {\n font-size: 0.85em;\n color: var(--nile-colors-neutral-500, #667085);\n text-align: center;\n padding: 4px 8px;\n line-height: 1.4;\n }\n\n .ProseMirror figure.nile-wysiwyg__figure--empty-caption .nile-wysiwyg__figcaption::before {\n content: 'Add a caption…';\n float: left;\n width: 100%;\n pointer-events: none;\n color: var(--nile-colors-neutral-400, #98a2b3);\n margin-bottom: -1.4em;\n }\n\n .ProseMirror figure.nile-wysiwyg__figure--selected {\n border-radius: 4px;\n }\n\n /* --- Embeds --- */\n .ProseMirror div.nile-wysiwyg__embed {\n position: relative;\n aspect-ratio: 16 / 9;\n /* Default size; an inline width from drag-resize overrides it, capped by\n max-width. overflow stays visible so the resize handles aren't clipped\n (rounding lives on the iframe). */\n width: min(640px, 100%);\n max-width: 100%;\n margin: 0.75em 0;\n border-radius: 8px;\n background: var(--nile-colors-neutral-100, #f2f4f7);\n }\n\n .ProseMirror div.nile-wysiwyg__embed iframe {\n width: 100%;\n height: 100%;\n border: 0;\n display: block;\n border-radius: 8px;\n /* Editing mode: the first click selects the node instead of hitting the\n iframe; once selected (or in readonly) the video is interactive. */\n pointer-events: none;\n }\n\n .ProseMirror div.nile-wysiwyg__embed.ProseMirror-selectednode iframe,\n :host([readonly]) .ProseMirror div.nile-wysiwyg__embed iframe {\n pointer-events: auto;\n }\n\n .ProseMirror div.nile-wysiwyg__embed.ProseMirror-selectednode {\n outline: 2px solid var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600, #2563eb));\n }\n\n .ProseMirror div.nile-wysiwyg__embed.ProseMirror-selectednode .nile-wysiwyg__resize-handle {\n display: block;\n }\n\n /* A live resize drag must not lose mousemove to the embedded document. */\n .ProseMirror div.nile-wysiwyg__embed.nile-wysiwyg__resizing iframe {\n pointer-events: none !important;\n }\n\n /* --- Code highlighting (compact light theme for hljs tokens) --- */\n .ProseMirror .hljs-comment,\n .ProseMirror .hljs-quote {\n color: #a0a1a7;\n font-style: italic;\n }\n\n .ProseMirror .hljs-keyword,\n .ProseMirror .hljs-selector-tag,\n .ProseMirror .hljs-formula,\n .ProseMirror .hljs-doctag {\n color: #a626a4;\n }\n\n .ProseMirror .hljs-section,\n .ProseMirror .hljs-name,\n .ProseMirror .hljs-selector-id,\n .ProseMirror .hljs-selector-class,\n .ProseMirror .hljs-deletion,\n .ProseMirror .hljs-subst,\n .ProseMirror .hljs-tag {\n color: #e45649;\n }\n\n .ProseMirror .hljs-literal,\n .ProseMirror .hljs-built_in,\n .ProseMirror .hljs-bullet {\n color: #0184bb;\n }\n\n .ProseMirror .hljs-string,\n .ProseMirror .hljs-regexp,\n .ProseMirror .hljs-addition,\n .ProseMirror .hljs-attribute,\n .ProseMirror .hljs-meta .hljs-string {\n color: #50a14f;\n }\n\n .ProseMirror .hljs-attr,\n .ProseMirror .hljs-variable,\n .ProseMirror .hljs-template-variable,\n .ProseMirror .hljs-type,\n .ProseMirror .hljs-selector-attr,\n .ProseMirror .hljs-selector-pseudo,\n .ProseMirror .hljs-number {\n color: #986801;\n }\n\n .ProseMirror .hljs-symbol,\n .ProseMirror .hljs-meta,\n .ProseMirror .hljs-link,\n .ProseMirror .hljs-operator,\n .ProseMirror .hljs-title,\n .ProseMirror .hljs-title.class_,\n .ProseMirror .hljs-title.function_ {\n color: #4078f2;\n }\n\n .ProseMirror .hljs-emphasis {\n font-style: italic;\n }\n\n .ProseMirror .hljs-strong {\n font-weight: bold;\n }\n\n /* --- Checklists --- */\n .ProseMirror ul.nile-wysiwyg__task-list {\n list-style: none;\n padding-inline-start: 4px;\n }\n\n .ProseMirror li.nile-wysiwyg__task-item {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n }\n\n .ProseMirror li.nile-wysiwyg__task-item > input[type='checkbox'] {\n /* Center on the first text line: (1 line box - checkbox height) / 2. */\n margin: calc((1em * 1.45 - 14px) / 2) 0 0;\n width: 14px;\n height: 14px;\n flex: none;\n cursor: pointer;\n accent-color: var(--nile-colors-primary-600, #2563eb);\n }\n\n .ProseMirror li.nile-wysiwyg__task-item > .nile-wysiwyg__task-content {\n flex: 1;\n min-width: 0;\n }\n\n /* The content's paragraph margins (legacy 1em) push text below the\n checkbox — strip them at the edges of each item. */\n .ProseMirror li.nile-wysiwyg__task-item > .nile-wysiwyg__task-content > :first-child {\n margin-top: 0;\n }\n\n .ProseMirror li.nile-wysiwyg__task-item > .nile-wysiwyg__task-content > :last-child {\n margin-bottom: 0;\n }\n\n .ProseMirror ul.nile-wysiwyg__task-list > li + li {\n margin-top: 0.35em;\n }\n\n .ProseMirror li.nile-wysiwyg__task-item[data-checked='true'] > .nile-wysiwyg__task-content {\n color: var(--nile-colors-neutral-500, #98a2b3);\n text-decoration: line-through;\n }\n\n /* --- Counter footer --- */\n .nile-wysiwyg__counter {\n padding: 4px 12px 6px;\n text-align: right;\n font-size: 12px;\n color: var(--nile-colors-neutral-500, var(--ng-colors-text-secondary, #98a2b3));\n border-top: 1px solid var(--nile-colors-neutral-200, #eaecf0);\n }\n\n .nile-wysiwyg__counter.over {\n color: var(--nile-colors-error-600, #d92d20);\n font-weight: 600;\n }\n\n /* --- Author <style> block (from HTML source) ---\n Applied live by StyleBlockView (a hidden <style> host, scoped to the\n content); the block renders nothing in the editor. */\n .nile-wysiwyg__style-block {\n display: none;\n }\n\n /* --- Sticky toolbar ---\n Pins to the top of the scroll container. Note: sticky anchors to the\n container's PADDING box, so if the scroll container has top padding, a\n band of content shows above the toolbar — set --nile-wysiwyg-sticky-top\n (or remove the container's top padding) to compensate. The opaque\n background makes the pinned bar self-backing so content can never bleed\n through it. */\n :host([sticky-toolbar]) nile-wysiwyg-toolbar {\n position: sticky;\n top: var(--nile-wysiwyg-sticky-top, 0);\n z-index: 12;\n background: var(\n --nile-wysiwyg-bg,\n var(--nile-colors-white-base, var(--ng-colors-bg-primary, #ffffff))\n );\n }\n\n /* --- Mentions & suggestions --- */\n .ProseMirror span.nile-wysiwyg__mention {\n display: inline-block;\n padding: 0 4px;\n border-radius: 4px;\n background: var(--nile-wysiwyg-mention-bg, var(--nile-colors-primary-50, var(--ng-componentcolors-utility-blue-50, #eff4ff)));\n color: var(--nile-wysiwyg-mention-color, var(--nile-colors-primary-700, var(--ng-componentcolors-utility-blue-700, #1d4ed8)));\n font-weight: 500;\n white-space: nowrap;\n }\n\n .ProseMirror span.nile-wysiwyg__mention.ProseMirror-selectednode {\n outline: 2px solid var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600, #2563eb));\n }\n\n /* --- Merge fields --- */\n .ProseMirror span.nile-wysiwyg__merge-field {\n display: inline-block;\n padding: 0 4px;\n border-radius: 4px;\n background: var(--nile-wysiwyg-merge-bg, var(--nile-colors-neutral-100, #f2f4f7));\n color: var(--nile-wysiwyg-merge-color, var(--nile-colors-neutral-700, #344054));\n border: 1px dashed var(--nile-colors-neutral-400, #d0d5dd);\n font-family: ui-monospace, SFMono-Regular, Menlo, monospace;\n font-size: 0.9em;\n white-space: nowrap;\n }\n\n .ProseMirror span.nile-wysiwyg__merge-field.ProseMirror-selectednode {\n outline: 2px solid var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600, #2563eb));\n }\n\n /* --- Math --- */\n .ProseMirror span.nile-wysiwyg__math {\n display: inline-block;\n padding: 0 2px;\n font-family: \"Cambria Math\", \"Latin Modern Math\", serif;\n }\n\n .ProseMirror span.nile-wysiwyg__math--block {\n display: block;\n text-align: center;\n margin: 8px 0;\n }\n\n .ProseMirror span.nile-wysiwyg__math.ProseMirror-selectednode {\n outline: 2px solid var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600, #2563eb));\n border-radius: 3px;\n }\n\n /* Format painter armed: hint the next selection will be painted. */\n .ProseMirror.nile-wysiwyg--painting {\n cursor: cell;\n }\n\n .ProseMirror .nile-wysiwyg__suggestion {\n background: var(--nile-colors-primary-50, var(--ng-componentcolors-utility-blue-50, #eff4ff));\n border-radius: 3px;\n }\n\n /* --- Find & replace highlights --- */\n .ProseMirror .nile-wysiwyg__find-match {\n background: var(--nile-wysiwyg-find-bg, rgba(255, 214, 102, 0.45));\n border-radius: 2px;\n }\n\n .ProseMirror .nile-wysiwyg__find-active {\n background: var(--nile-wysiwyg-find-active-bg, rgba(255, 170, 0, 0.65));\n }\n\n /* --- Upload placeholder --- */\n .nile-wysiwyg__upload-placeholder {\n display: inline-block;\n padding: 6px 12px;\n border: 1px dashed var(--nile-colors-neutral-400, #d0d5dd);\n border-radius: 6px;\n background: var(--nile-colors-neutral-50, #f9fafb);\n color: var(--nile-colors-neutral-600, #475467);\n font-size: 0.85em;\n }\n\n /* --- Multi-level (legal) ordered lists: 1 / 1.1 / 1.1.1 numbering.\n Serialized output carries data-list-style=\"multilevel\"; consumers\n rendering it outside the editor need these same counter rules. --- */\n .ProseMirror ol[data-list-style='multilevel'],\n .ProseMirror ol[data-list-style='multilevel'] ol {\n list-style: none;\n counter-reset: nile-multilevel;\n }\n\n .ProseMirror ol[data-list-style='multilevel'] > li,\n .ProseMirror ol[data-list-style='multilevel'] ol > li {\n counter-increment: nile-multilevel;\n }\n\n /* The number sits inside the item's first paragraph so it shares a line. */\n .ProseMirror ol[data-list-style='multilevel'] > li > p:first-child::before,\n .ProseMirror ol[data-list-style='multilevel'] ol > li > p:first-child::before {\n content: counters(nile-multilevel, '.') '. ';\n font-variant-numeric: tabular-nums;\n }\n\n /* --- Show blocks: dashed outlines + tag labels while editing --- */\n .nile-wysiwyg--show-blocks .ProseMirror p,\n .nile-wysiwyg--show-blocks .ProseMirror h1,\n .nile-wysiwyg--show-blocks .ProseMirror h2,\n .nile-wysiwyg--show-blocks .ProseMirror h3,\n .nile-wysiwyg--show-blocks .ProseMirror h4,\n .nile-wysiwyg--show-blocks .ProseMirror h5,\n .nile-wysiwyg--show-blocks .ProseMirror h6,\n .nile-wysiwyg--show-blocks .ProseMirror blockquote,\n .nile-wysiwyg--show-blocks .ProseMirror pre,\n .nile-wysiwyg--show-blocks .ProseMirror figure,\n .nile-wysiwyg--show-blocks .ProseMirror ul,\n .nile-wysiwyg--show-blocks .ProseMirror ol,\n .nile-wysiwyg--show-blocks .ProseMirror li,\n .nile-wysiwyg--show-blocks .ProseMirror table {\n outline: 1px dashed var(--nile-wysiwyg-block-outline, var(--nile-colors-neutral-400, #d0d5dd));\n outline-offset: -1px;\n }\n\n .nile-wysiwyg--show-blocks .ProseMirror p,\n .nile-wysiwyg--show-blocks .ProseMirror h1,\n .nile-wysiwyg--show-blocks .ProseMirror h2,\n .nile-wysiwyg--show-blocks .ProseMirror h3,\n .nile-wysiwyg--show-blocks .ProseMirror h4,\n .nile-wysiwyg--show-blocks .ProseMirror h5,\n .nile-wysiwyg--show-blocks .ProseMirror h6,\n .nile-wysiwyg--show-blocks .ProseMirror blockquote,\n .nile-wysiwyg--show-blocks .ProseMirror pre {\n position: relative;\n }\n\n .nile-wysiwyg--show-blocks .ProseMirror p::after,\n .nile-wysiwyg--show-blocks .ProseMirror h1::after,\n .nile-wysiwyg--show-blocks .ProseMirror h2::after,\n .nile-wysiwyg--show-blocks .ProseMirror h3::after,\n .nile-wysiwyg--show-blocks .ProseMirror h4::after,\n .nile-wysiwyg--show-blocks .ProseMirror h5::after,\n .nile-wysiwyg--show-blocks .ProseMirror h6::after,\n .nile-wysiwyg--show-blocks .ProseMirror blockquote::after,\n .nile-wysiwyg--show-blocks .ProseMirror pre::after {\n position: absolute;\n top: 0;\n left: 0;\n padding: 0 3px;\n font-family: system-ui, sans-serif;\n font-size: 9px;\n font-weight: 600;\n font-style: normal;\n line-height: 14px;\n letter-spacing: 0.5px;\n color: var(--nile-colors-neutral-500, #667085);\n background: var(--nile-colors-neutral-100, #f2f4f7);\n border-radius: 0 0 4px 0;\n pointer-events: none;\n }\n\n .nile-wysiwyg--show-blocks .ProseMirror p::after { content: 'P'; }\n .nile-wysiwyg--show-blocks .ProseMirror h1::after { content: 'H1'; }\n .nile-wysiwyg--show-blocks .ProseMirror h2::after { content: 'H2'; }\n .nile-wysiwyg--show-blocks .ProseMirror h3::after { content: 'H3'; }\n .nile-wysiwyg--show-blocks .ProseMirror h4::after { content: 'H4'; }\n .nile-wysiwyg--show-blocks .ProseMirror h5::after { content: 'H5'; }\n .nile-wysiwyg--show-blocks .ProseMirror h6::after { content: 'H6'; }\n .nile-wysiwyg--show-blocks .ProseMirror blockquote::after { content: 'QUOTE'; }\n .nile-wysiwyg--show-blocks .ProseMirror pre::after { content: 'PRE'; }\n`;\n"]}
@@ -5,8 +5,10 @@ import type { CommandAttrs } from './engine/commands';
5
5
  import type { MathRenderer } from './engine/plugins/math-view';
6
6
  import type { MentionsConfig, SnippetConfig, MergeFieldConfig, TemplateConfig } from './types';
7
7
  import './nile-wysiwyg-toolbar/nile-wysiwyg-toolbar';
8
+ import './nile-wysiwyg-toolbar/nile-wysiwyg-toolbar-item';
8
9
  import './ui/link-editor';
9
10
  import './ui/bubble-menu';
11
+ import './ui/bubble-item';
10
12
  import './ui/image-panel';
11
13
  import './ui/table-menu';
12
14
  import './ui/suggest-list';
@@ -58,6 +60,19 @@ export declare class NileWysiwygEditor extends NileElement {
58
60
  readonly: boolean;
59
61
  /** Toolbar config string; `"none"` hides the toolbar. */
60
62
  toolbar: string;
63
+ /**
64
+ * Toolbar built from authored `<nile-wysiwyg-toolbar-item>` light-DOM
65
+ * children. When present it takes precedence over the `toolbar` string.
66
+ */
67
+ private authoredToolbar?;
68
+ /**
69
+ * Bubble menu built from authored `<nile-wysiwyg-bubble-item>` light-DOM
70
+ * children. When present it replaces the built-in bold/italic/underline/
71
+ * strike/link set.
72
+ */
73
+ private authoredBubble?;
74
+ /** Watches authored toolbar/bubble children so edits re-render them. */
75
+ private toolbarObserver?;
61
76
  /** Shows a balloon toolbar over text selections. */
62
77
  bubbleMenu: boolean;
63
78
  /** Sanitizes incoming HTML (value, paste, insertHTML). Leave on. */
@@ -177,6 +192,19 @@ export declare class NileWysiwygEditor extends NileElement {
177
192
  connectedCallback(): void;
178
193
  disconnectedCallback(): void;
179
194
  protected firstUpdated(): void;
195
+ /**
196
+ * Reads `<nile-wysiwyg-toolbar-item>` children into a structured toolbar and
197
+ * stores it on {@link authoredToolbar}. Absent items clear the override
198
+ * (falling back to the `toolbar` string). No-ops when nothing changed to
199
+ * avoid needless re-renders.
200
+ */
201
+ private syncAuthoredToolbar;
202
+ /**
203
+ * Reads `<nile-wysiwyg-bubble-item>` children into a structured bubble-menu
204
+ * item list stored on {@link authoredBubble}. Absent items clear the override
205
+ * (falling back to the built-in default). No-ops when nothing changed.
206
+ */
207
+ private syncAuthoredBubble;
180
208
  protected updated(changed: PropertyValues): void;
181
209
  private restartAutosave;
182
210
  private buildState;
@@ -186,6 +214,14 @@ export declare class NileWysiwygEditor extends NileElement {
186
214
  */
187
215
  private snapshotToolbar;
188
216
  private mountView;
217
+ /**
218
+ * True while a drag-selection is in progress with the format painter armed.
219
+ * Suppresses the mid-drag auto-apply in {@link handleTransaction} so the
220
+ * copied formatting lands on the final, complete selection (on mouse-up).
221
+ */
222
+ private painterDragActive;
223
+ private onPainterPointerDown;
224
+ private onPainterPointerUp;
189
225
  private handleTransaction;
190
226
  private buildChangeDetail;
191
227
  private scheduleChange;