@aquera/nile-elements 2.0.15 → 2.0.17

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 (376) hide show
  1. package/README.md +6 -0
  2. package/demo/nxtgen-classes.css +5 -5
  3. package/demo/nxtgen-dark.css +16 -16
  4. package/demo/nxtgen-properties.css +2 -2
  5. package/demo/nxtgen-utilities.css +5 -5
  6. package/demo/nxtgen.css +5 -5
  7. package/demo/utilities.css +2 -2
  8. package/demo/variables.css +2 -2
  9. package/dist/{index-f6944844.cjs.js → index-0c0c869d.cjs.js} +2 -2
  10. package/dist/{index-f6944844.cjs.js.map → index-0c0c869d.cjs.js.map} +1 -1
  11. package/dist/{index-403841c7.cjs.js → index-129ef6fb.cjs.js} +3 -3
  12. package/dist/{index-403841c7.cjs.js.map → index-129ef6fb.cjs.js.map} +1 -1
  13. package/dist/{index-1faa963c.esm.js → index-36f2a6b5.esm.js} +1 -1
  14. package/dist/index-4df50481.esm.js +1 -0
  15. package/dist/index-5d34cff1.esm.js +1 -0
  16. package/dist/index-7ae95edd.cjs.js +2 -0
  17. package/dist/{index-3ca67627.cjs.js.map → index-7ae95edd.cjs.js.map} +1 -1
  18. package/dist/index-7ca72b78.esm.js +1 -0
  19. package/dist/index-bbe23ad8.cjs.js +2 -0
  20. package/dist/index-bbe23ad8.cjs.js.map +1 -0
  21. package/dist/index-ccc6a799.cjs.js +5 -0
  22. package/dist/index-ccc6a799.cjs.js.map +1 -0
  23. package/dist/index.cjs.js +1 -1
  24. package/dist/index.esm.js +1 -1
  25. package/dist/index.js +124 -72
  26. package/dist/nile-auto-complete/index.cjs.js +1 -1
  27. package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -1
  28. package/dist/nile-auto-complete/portal-manager.cjs.js +1 -1
  29. package/dist/nile-auto-complete/portal-utils.cjs.js +1 -1
  30. package/dist/nile-code-editor/extensionSetup.cjs.js +2 -2
  31. package/dist/nile-code-editor/index.cjs.js +1 -1
  32. package/dist/nile-code-editor/nile-code-editor.cjs.js +1 -1
  33. package/dist/nile-code-editor/theme.cjs.js +1 -1
  34. package/dist/nile-color-picker/index.cjs.js +1 -1
  35. package/dist/nile-color-picker/nile-color-picker.cjs.js +1 -1
  36. package/dist/nile-combobox/index.cjs.js +1 -1
  37. package/dist/nile-combobox/nile-combobox.cjs.js +1 -1
  38. package/dist/nile-combobox/portal-manager.cjs.js +1 -1
  39. package/dist/nile-context-menu/index.cjs.js +1 -1
  40. package/dist/nile-context-menu/nile-context-menu.cjs.js +1 -1
  41. package/dist/nile-context-submenu/index.cjs.js +1 -1
  42. package/dist/nile-context-submenu/nile-context-submenu.cjs.js +1 -1
  43. package/dist/nile-detail/index.cjs.js +1 -1
  44. package/dist/nile-detail/nile-detail.cjs.js +1 -1
  45. package/dist/nile-dropdown/index.cjs.js +1 -1
  46. package/dist/nile-dropdown/nile-dropdown.cjs.js +1 -1
  47. package/dist/nile-dropdown/portal-manager.cjs.js +1 -1
  48. package/dist/nile-file-upload/index.cjs.js +1 -1
  49. package/dist/nile-file-upload/nile-file-upload.cjs.js +1 -1
  50. package/dist/nile-file-upload/nile-file-upload.template.cjs.js +1 -1
  51. package/dist/nile-floating-panel/index.cjs.js +1 -1
  52. package/dist/nile-floating-panel/nile-floating-panel.cjs.js +1 -1
  53. package/dist/nile-lite-tooltip/index.cjs.js +1 -1
  54. package/dist/nile-lite-tooltip/nile-lite-tooltip.cjs.js +1 -1
  55. package/dist/nile-lite-tooltip/nile-lite-tooltip.css.cjs.js +1 -1
  56. package/dist/nile-lite-tooltip/nile-lite-tooltip.css.cjs.js.map +1 -1
  57. package/dist/nile-lite-tooltip/nile-lite-tooltip.css.esm.js +1 -1
  58. package/dist/nile-markdown-editor/index.cjs.js +1 -1
  59. package/dist/nile-markdown-editor/nile-markdown-editor.cjs.js +1 -1
  60. package/dist/nile-popover/index.cjs.js +1 -1
  61. package/dist/nile-popover/nile-popover.cjs.js +1 -1
  62. package/dist/nile-popover/portal-manager.cjs.js +1 -1
  63. package/dist/nile-popup/index.cjs.js +1 -1
  64. package/dist/nile-popup/nile-popup.cjs.js +1 -1
  65. package/dist/nile-segmented-progress-bar/index.cjs.js +1 -1
  66. package/dist/nile-segmented-progress-bar/nile-segmented-progress-bar.cjs.js +1 -1
  67. package/dist/nile-select/index.cjs.js +1 -1
  68. package/dist/nile-select/nile-select.cjs.js +1 -1
  69. package/dist/nile-select/portal-manager.cjs.js +1 -1
  70. package/dist/nile-side-bar-action/index.cjs.js +1 -1
  71. package/dist/nile-side-bar-action/nile-side-bar-action.cjs.js +1 -1
  72. package/dist/nile-side-bar-action/portal-manager.cjs.js +1 -1
  73. package/dist/nile-tooltip/index.cjs.js +1 -1
  74. package/dist/nile-tooltip/nile-tooltip.cjs.js +1 -1
  75. package/dist/nile-tooltip/nile-tooltip.css.cjs.js +1 -1
  76. package/dist/nile-tooltip/nile-tooltip.css.cjs.js.map +1 -1
  77. package/dist/nile-tooltip/nile-tooltip.css.esm.js +1 -1
  78. package/dist/nile-virtual-select/index.cjs.js +1 -1
  79. package/dist/nile-virtual-select/nile-virtual-select.cjs.js +1 -1
  80. package/dist/nile-virtual-select/portal-manager.cjs.js +1 -1
  81. package/dist/nile-virtual-select/renderer.cjs.js +1 -1
  82. package/dist/nile-wysiwyg-editor/engine/commands.cjs.js +1 -1
  83. package/dist/nile-wysiwyg-editor/engine/commands.cjs.js.map +1 -1
  84. package/dist/nile-wysiwyg-editor/engine/commands.esm.js +1 -1
  85. package/dist/nile-wysiwyg-editor/engine/create-state.cjs.js +1 -1
  86. package/dist/nile-wysiwyg-editor/engine/create-state.cjs.js.map +1 -1
  87. package/dist/nile-wysiwyg-editor/engine/create-state.esm.js +1 -1
  88. package/dist/nile-wysiwyg-editor/engine/email-css.cjs.js +2 -0
  89. package/dist/nile-wysiwyg-editor/engine/email-css.cjs.js.map +1 -0
  90. package/dist/nile-wysiwyg-editor/engine/email-css.esm.js +1 -0
  91. package/dist/nile-wysiwyg-editor/engine/email-render.cjs.js +2 -0
  92. package/dist/nile-wysiwyg-editor/engine/email-render.cjs.js.map +1 -0
  93. package/dist/nile-wysiwyg-editor/engine/email-render.esm.js +1 -0
  94. package/dist/nile-wysiwyg-editor/engine/html-detect.cjs.js +2 -0
  95. package/dist/nile-wysiwyg-editor/engine/html-detect.cjs.js.map +1 -0
  96. package/dist/nile-wysiwyg-editor/engine/html-detect.esm.js +1 -0
  97. package/dist/nile-wysiwyg-editor/engine/index.cjs.js +1 -1
  98. package/dist/nile-wysiwyg-editor/engine/index.esm.js +1 -1
  99. package/dist/nile-wysiwyg-editor/engine/inputrules.cjs.js +1 -1
  100. package/dist/nile-wysiwyg-editor/engine/inputrules.cjs.js.map +1 -1
  101. package/dist/nile-wysiwyg-editor/engine/inputrules.esm.js +1 -1
  102. package/dist/nile-wysiwyg-editor/engine/keymap.cjs.js +1 -1
  103. package/dist/nile-wysiwyg-editor/engine/keymap.cjs.js.map +1 -1
  104. package/dist/nile-wysiwyg-editor/engine/keymap.esm.js +1 -1
  105. package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.cjs.js +1 -1
  106. package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.cjs.js.map +1 -1
  107. package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.esm.js +1 -1
  108. package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.cjs.js +1 -1
  109. package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.cjs.js.map +1 -1
  110. package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.esm.js +1 -1
  111. package/dist/nile-wysiwyg-editor/engine/plugins/embeds.cjs.js +1 -1
  112. package/dist/nile-wysiwyg-editor/engine/plugins/embeds.cjs.js.map +1 -1
  113. package/dist/nile-wysiwyg-editor/engine/plugins/embeds.esm.js +1 -1
  114. package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.cjs.js +1 -1
  115. package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.cjs.js.map +1 -1
  116. package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.esm.js +1 -1
  117. package/dist/nile-wysiwyg-editor/engine/plugins/format-painter.cjs.js +1 -1
  118. package/dist/nile-wysiwyg-editor/engine/plugins/format-painter.cjs.js.map +1 -1
  119. package/dist/nile-wysiwyg-editor/engine/plugins/format-painter.esm.js +1 -1
  120. package/dist/nile-wysiwyg-editor/engine/plugins/image-view.cjs.js +1 -1
  121. package/dist/nile-wysiwyg-editor/engine/plugins/image-view.cjs.js.map +1 -1
  122. package/dist/nile-wysiwyg-editor/engine/plugins/image-view.esm.js +1 -1
  123. package/dist/nile-wysiwyg-editor/engine/plugins/image.cjs.js +1 -1
  124. package/dist/nile-wysiwyg-editor/engine/plugins/image.cjs.js.map +1 -1
  125. package/dist/nile-wysiwyg-editor/engine/plugins/image.esm.js +1 -1
  126. package/dist/nile-wysiwyg-editor/engine/plugins/link.cjs.js +1 -1
  127. package/dist/nile-wysiwyg-editor/engine/plugins/link.cjs.js.map +1 -1
  128. package/dist/nile-wysiwyg-editor/engine/plugins/link.esm.js +1 -1
  129. package/dist/nile-wysiwyg-editor/engine/plugins/max-length.cjs.js +1 -1
  130. package/dist/nile-wysiwyg-editor/engine/plugins/max-length.cjs.js.map +1 -1
  131. package/dist/nile-wysiwyg-editor/engine/plugins/max-length.esm.js +1 -1
  132. package/dist/nile-wysiwyg-editor/engine/plugins/paste.cjs.js +1 -1
  133. package/dist/nile-wysiwyg-editor/engine/plugins/paste.cjs.js.map +1 -1
  134. package/dist/nile-wysiwyg-editor/engine/plugins/paste.esm.js +1 -1
  135. package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.cjs.js +1 -1
  136. package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.cjs.js.map +1 -1
  137. package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.esm.js +1 -1
  138. package/dist/nile-wysiwyg-editor/engine/plugins/single-line.cjs.js +1 -1
  139. package/dist/nile-wysiwyg-editor/engine/plugins/single-line.cjs.js.map +1 -1
  140. package/dist/nile-wysiwyg-editor/engine/plugins/single-line.esm.js +1 -1
  141. package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.cjs.js +1 -1
  142. package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.cjs.js.map +1 -1
  143. package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.esm.js +1 -1
  144. package/dist/nile-wysiwyg-editor/engine/plugins/tables.cjs.js +1 -1
  145. package/dist/nile-wysiwyg-editor/engine/plugins/tables.cjs.js.map +1 -1
  146. package/dist/nile-wysiwyg-editor/engine/plugins/tables.esm.js +1 -1
  147. package/dist/nile-wysiwyg-editor/engine/sanitize.cjs.js +2 -1
  148. package/dist/nile-wysiwyg-editor/engine/sanitize.cjs.js.map +1 -1
  149. package/dist/nile-wysiwyg-editor/engine/sanitize.esm.js +1 -1
  150. package/dist/nile-wysiwyg-editor/engine/schema.cjs.js +1 -1
  151. package/dist/nile-wysiwyg-editor/engine/schema.cjs.js.map +1 -1
  152. package/dist/nile-wysiwyg-editor/engine/schema.esm.js +1 -1
  153. package/dist/nile-wysiwyg-editor/engine/selection-state.cjs.js +1 -1
  154. package/dist/nile-wysiwyg-editor/engine/selection-state.cjs.js.map +1 -1
  155. package/dist/nile-wysiwyg-editor/engine/selection-state.esm.js +1 -1
  156. package/dist/nile-wysiwyg-editor/engine/serializer.cjs.js +1 -1
  157. package/dist/nile-wysiwyg-editor/engine/serializer.cjs.js.map +1 -1
  158. package/dist/nile-wysiwyg-editor/engine/serializer.esm.js +1 -1
  159. package/dist/nile-wysiwyg-editor/index.cjs.js +1 -1
  160. package/dist/nile-wysiwyg-editor/index.esm.js +1 -1
  161. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js +1 -1
  162. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js.map +1 -1
  163. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.cjs.js +1 -1
  164. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.cjs.js.map +1 -1
  165. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.esm.js +45 -4
  166. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.esm.js +2 -2
  167. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.cjs.js +1 -1
  168. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.cjs.js +1 -1
  169. package/dist/nile-wysiwyg-editor/ui/bookmark-panel.cjs.js +1 -1
  170. package/dist/nile-wysiwyg-editor/ui/bookmark-panel.cjs.js.map +1 -1
  171. package/dist/nile-wysiwyg-editor/ui/bookmark-panel.esm.js +2 -2
  172. package/dist/nile-wysiwyg-editor/ui/bubble-menu.cjs.js +1 -1
  173. package/dist/nile-wysiwyg-editor/ui/bubble-menu.cjs.js.map +1 -1
  174. package/dist/nile-wysiwyg-editor/ui/bubble-menu.esm.js +5 -5
  175. package/dist/nile-wysiwyg-editor/ui/code-block-menu.cjs.js +1 -1
  176. package/dist/nile-wysiwyg-editor/ui/code-block-menu.cjs.js.map +1 -1
  177. package/dist/nile-wysiwyg-editor/ui/code-block-menu.esm.js +1 -1
  178. package/dist/nile-wysiwyg-editor/ui/embed-menu.cjs.js +1 -1
  179. package/dist/nile-wysiwyg-editor/ui/embed-menu.cjs.js.map +1 -1
  180. package/dist/nile-wysiwyg-editor/ui/embed-menu.esm.js +1 -1
  181. package/dist/nile-wysiwyg-editor/ui/embed-panel.cjs.js +1 -1
  182. package/dist/nile-wysiwyg-editor/ui/embed-panel.cjs.js.map +1 -1
  183. package/dist/nile-wysiwyg-editor/ui/embed-panel.esm.js +2 -2
  184. package/dist/nile-wysiwyg-editor/ui/emoji-picker.cjs.js +1 -1
  185. package/dist/nile-wysiwyg-editor/ui/emoji-picker.cjs.js.map +1 -1
  186. package/dist/nile-wysiwyg-editor/ui/emoji-picker.esm.js +1 -1
  187. package/dist/nile-wysiwyg-editor/ui/find-replace.cjs.js +1 -1
  188. package/dist/nile-wysiwyg-editor/ui/find-replace.cjs.js.map +1 -1
  189. package/dist/nile-wysiwyg-editor/ui/find-replace.esm.js +3 -3
  190. package/dist/nile-wysiwyg-editor/ui/image-menu.cjs.js +1 -1
  191. package/dist/nile-wysiwyg-editor/ui/image-menu.cjs.js.map +1 -1
  192. package/dist/nile-wysiwyg-editor/ui/image-menu.esm.js +3 -3
  193. package/dist/nile-wysiwyg-editor/ui/image-panel.cjs.js +1 -1
  194. package/dist/nile-wysiwyg-editor/ui/image-panel.cjs.js.map +1 -1
  195. package/dist/nile-wysiwyg-editor/ui/image-panel.esm.js +1 -1
  196. package/dist/nile-wysiwyg-editor/ui/insert-menu.cjs.js +1 -1
  197. package/dist/nile-wysiwyg-editor/ui/insert-menu.cjs.js.map +1 -1
  198. package/dist/nile-wysiwyg-editor/ui/insert-menu.esm.js +1 -1
  199. package/dist/nile-wysiwyg-editor/ui/link-editor.cjs.js +1 -1
  200. package/dist/nile-wysiwyg-editor/ui/link-editor.cjs.js.map +1 -1
  201. package/dist/nile-wysiwyg-editor/ui/link-editor.esm.js +9 -9
  202. package/dist/nile-wysiwyg-editor/ui/markdown-panel.cjs.js +1 -1
  203. package/dist/nile-wysiwyg-editor/ui/markdown-panel.cjs.js.map +1 -1
  204. package/dist/nile-wysiwyg-editor/ui/markdown-panel.esm.js +1 -1
  205. package/dist/nile-wysiwyg-editor/ui/math-panel.cjs.js +1 -1
  206. package/dist/nile-wysiwyg-editor/ui/math-panel.cjs.js.map +1 -1
  207. package/dist/nile-wysiwyg-editor/ui/math-panel.esm.js +1 -1
  208. package/dist/nile-wysiwyg-editor/ui/shortcut-help.cjs.js +1 -1
  209. package/dist/nile-wysiwyg-editor/ui/shortcut-help.cjs.js.map +1 -1
  210. package/dist/nile-wysiwyg-editor/ui/shortcut-help.esm.js +1 -1
  211. package/dist/nile-wysiwyg-editor/ui/source-view.cjs.js +1 -1
  212. package/dist/nile-wysiwyg-editor/ui/source-view.cjs.js.map +1 -1
  213. package/dist/nile-wysiwyg-editor/ui/source-view.esm.js +4 -4
  214. package/dist/nile-wysiwyg-editor/ui/special-chars.cjs.js +1 -1
  215. package/dist/nile-wysiwyg-editor/ui/special-chars.cjs.js.map +1 -1
  216. package/dist/nile-wysiwyg-editor/ui/special-chars.esm.js +1 -1
  217. package/dist/nile-wysiwyg-editor/ui/suggest-list.cjs.js +1 -1
  218. package/dist/nile-wysiwyg-editor/ui/suggest-list.cjs.js.map +1 -1
  219. package/dist/nile-wysiwyg-editor/ui/suggest-list.esm.js +23 -12
  220. package/dist/nile-wysiwyg-editor/ui/table-grid-picker.cjs.js +1 -1
  221. package/dist/nile-wysiwyg-editor/ui/table-grid-picker.cjs.js.map +1 -1
  222. package/dist/nile-wysiwyg-editor/ui/table-grid-picker.esm.js +7 -7
  223. package/dist/nile-wysiwyg-editor/ui/table-menu.cjs.js +1 -1
  224. package/dist/nile-wysiwyg-editor/ui/table-menu.cjs.js.map +1 -1
  225. package/dist/nile-wysiwyg-editor/ui/table-menu.esm.js +1 -1
  226. package/dist/src/nile-lite-tooltip/nile-lite-tooltip.css.js +1 -1
  227. package/dist/src/nile-lite-tooltip/nile-lite-tooltip.css.js.map +1 -1
  228. package/dist/src/nile-tooltip/nile-tooltip.css.js +1 -1
  229. package/dist/src/nile-tooltip/nile-tooltip.css.js.map +1 -1
  230. package/dist/src/nile-wysiwyg-editor/engine/create-state.d.ts +5 -0
  231. package/dist/src/nile-wysiwyg-editor/engine/create-state.js +2 -0
  232. package/dist/src/nile-wysiwyg-editor/engine/create-state.js.map +1 -1
  233. package/dist/src/nile-wysiwyg-editor/engine/email-css.d.ts +14 -0
  234. package/dist/src/nile-wysiwyg-editor/engine/email-css.js +140 -0
  235. package/dist/src/nile-wysiwyg-editor/engine/email-css.js.map +1 -0
  236. package/dist/src/nile-wysiwyg-editor/engine/email-fidelity.test.d.ts +1 -0
  237. package/dist/src/nile-wysiwyg-editor/engine/email-fidelity.test.js +1045 -0
  238. package/dist/src/nile-wysiwyg-editor/engine/email-fidelity.test.js.map +1 -0
  239. package/dist/src/nile-wysiwyg-editor/engine/email-render.d.ts +11 -0
  240. package/dist/src/nile-wysiwyg-editor/engine/email-render.js +93 -0
  241. package/dist/src/nile-wysiwyg-editor/engine/email-render.js.map +1 -0
  242. package/dist/src/nile-wysiwyg-editor/engine/html-detect.d.ts +2 -0
  243. package/dist/src/nile-wysiwyg-editor/engine/html-detect.js +24 -0
  244. package/dist/src/nile-wysiwyg-editor/engine/html-detect.js.map +1 -0
  245. package/dist/src/nile-wysiwyg-editor/engine/index.d.ts +4 -1
  246. package/dist/src/nile-wysiwyg-editor/engine/index.js +3 -1
  247. package/dist/src/nile-wysiwyg-editor/engine/index.js.map +1 -1
  248. package/dist/src/nile-wysiwyg-editor/engine/inputrules.d.ts +0 -5
  249. package/dist/src/nile-wysiwyg-editor/engine/inputrules.js +19 -0
  250. package/dist/src/nile-wysiwyg-editor/engine/inputrules.js.map +1 -1
  251. package/dist/src/nile-wysiwyg-editor/engine/plugins/image-view.js +3 -2
  252. package/dist/src/nile-wysiwyg-editor/engine/plugins/image-view.js.map +1 -1
  253. package/dist/src/nile-wysiwyg-editor/engine/plugins/link.d.ts +4 -0
  254. package/dist/src/nile-wysiwyg-editor/engine/plugins/link.js +56 -1
  255. package/dist/src/nile-wysiwyg-editor/engine/plugins/link.js.map +1 -1
  256. package/dist/src/nile-wysiwyg-editor/engine/plugins/paste.d.ts +5 -0
  257. package/dist/src/nile-wysiwyg-editor/engine/plugins/paste.js +27 -6
  258. package/dist/src/nile-wysiwyg-editor/engine/plugins/paste.js.map +1 -1
  259. package/dist/src/nile-wysiwyg-editor/engine/plugins/tables.js +30 -7
  260. package/dist/src/nile-wysiwyg-editor/engine/plugins/tables.js.map +1 -1
  261. package/dist/src/nile-wysiwyg-editor/engine/pm.test.js +46 -0
  262. package/dist/src/nile-wysiwyg-editor/engine/pm.test.js.map +1 -1
  263. package/dist/src/nile-wysiwyg-editor/engine/sanitize.d.ts +9 -1
  264. package/dist/src/nile-wysiwyg-editor/engine/sanitize.js +730 -7
  265. package/dist/src/nile-wysiwyg-editor/engine/sanitize.js.map +1 -1
  266. package/dist/src/nile-wysiwyg-editor/engine/schema.d.ts +3 -0
  267. package/dist/src/nile-wysiwyg-editor/engine/schema.js +215 -34
  268. package/dist/src/nile-wysiwyg-editor/engine/schema.js.map +1 -1
  269. package/dist/src/nile-wysiwyg-editor/engine/selection-state.js +3 -1
  270. package/dist/src/nile-wysiwyg-editor/engine/selection-state.js.map +1 -1
  271. package/dist/src/nile-wysiwyg-editor/engine/serializer.d.ts +12 -4
  272. package/dist/src/nile-wysiwyg-editor/engine/serializer.js +18 -8
  273. package/dist/src/nile-wysiwyg-editor/engine/serializer.js.map +1 -1
  274. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor-email-fidelity.test.d.ts +1 -0
  275. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor-email-fidelity.test.js +287 -0
  276. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor-email-fidelity.test.js.map +1 -0
  277. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.js +45 -4
  278. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.js.map +1 -1
  279. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.d.ts +23 -0
  280. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js +113 -15
  281. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js.map +1 -1
  282. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.js +213 -0
  283. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.js.map +1 -1
  284. package/dist/src/nile-wysiwyg-editor/ui/bookmark-panel.js +2 -2
  285. package/dist/src/nile-wysiwyg-editor/ui/bookmark-panel.js.map +1 -1
  286. package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.js +1 -1
  287. package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.js.map +1 -1
  288. package/dist/src/nile-wysiwyg-editor/ui/embed-menu.js +1 -1
  289. package/dist/src/nile-wysiwyg-editor/ui/embed-menu.js.map +1 -1
  290. package/dist/src/nile-wysiwyg-editor/ui/embed-panel.js +1 -1
  291. package/dist/src/nile-wysiwyg-editor/ui/embed-panel.js.map +1 -1
  292. package/dist/src/nile-wysiwyg-editor/ui/emoji-picker.js +1 -1
  293. package/dist/src/nile-wysiwyg-editor/ui/emoji-picker.js.map +1 -1
  294. package/dist/src/nile-wysiwyg-editor/ui/find-replace.js +1 -1
  295. package/dist/src/nile-wysiwyg-editor/ui/find-replace.js.map +1 -1
  296. package/dist/src/nile-wysiwyg-editor/ui/image-menu.js +1 -1
  297. package/dist/src/nile-wysiwyg-editor/ui/image-menu.js.map +1 -1
  298. package/dist/src/nile-wysiwyg-editor/ui/image-panel.js +1 -1
  299. package/dist/src/nile-wysiwyg-editor/ui/image-panel.js.map +1 -1
  300. package/dist/src/nile-wysiwyg-editor/ui/insert-menu.js +1 -1
  301. package/dist/src/nile-wysiwyg-editor/ui/insert-menu.js.map +1 -1
  302. package/dist/src/nile-wysiwyg-editor/ui/link-editor.js +2 -2
  303. package/dist/src/nile-wysiwyg-editor/ui/link-editor.js.map +1 -1
  304. package/dist/src/nile-wysiwyg-editor/ui/markdown-panel.js +1 -1
  305. package/dist/src/nile-wysiwyg-editor/ui/markdown-panel.js.map +1 -1
  306. package/dist/src/nile-wysiwyg-editor/ui/math-panel.js +1 -1
  307. package/dist/src/nile-wysiwyg-editor/ui/math-panel.js.map +1 -1
  308. package/dist/src/nile-wysiwyg-editor/ui/shortcut-help.js +1 -1
  309. package/dist/src/nile-wysiwyg-editor/ui/shortcut-help.js.map +1 -1
  310. package/dist/src/nile-wysiwyg-editor/ui/source-view.js +2 -2
  311. package/dist/src/nile-wysiwyg-editor/ui/source-view.js.map +1 -1
  312. package/dist/src/nile-wysiwyg-editor/ui/special-chars.js +1 -1
  313. package/dist/src/nile-wysiwyg-editor/ui/special-chars.js.map +1 -1
  314. package/dist/src/nile-wysiwyg-editor/ui/suggest-list.js +14 -3
  315. package/dist/src/nile-wysiwyg-editor/ui/suggest-list.js.map +1 -1
  316. package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.js +2 -2
  317. package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.js.map +1 -1
  318. package/dist/src/nile-wysiwyg-editor/ui/table-menu.js +1 -1
  319. package/dist/src/nile-wysiwyg-editor/ui/table-menu.js.map +1 -1
  320. package/dist/src/version.js +1 -1
  321. package/dist/src/version.js.map +1 -1
  322. package/dist/tsconfig.tsbuildinfo +1 -1
  323. package/dist/version.cjs.js +1 -1
  324. package/dist/version.cjs.js.map +1 -1
  325. package/dist/version.esm.js +1 -1
  326. package/package.json +1 -1
  327. package/src/nile-lite-tooltip/nile-lite-tooltip.css.ts +1 -1
  328. package/src/nile-tooltip/nile-tooltip.css.ts +1 -1
  329. package/src/nile-wysiwyg-editor/engine/create-state.ts +7 -0
  330. package/src/nile-wysiwyg-editor/engine/email-css.ts +136 -0
  331. package/src/nile-wysiwyg-editor/engine/email-fidelity.test.ts +1347 -0
  332. package/src/nile-wysiwyg-editor/engine/email-render.ts +99 -0
  333. package/src/nile-wysiwyg-editor/engine/html-detect.ts +26 -0
  334. package/src/nile-wysiwyg-editor/engine/index.ts +10 -1
  335. package/src/nile-wysiwyg-editor/engine/inputrules.ts +18 -1
  336. package/src/nile-wysiwyg-editor/engine/plugins/image-view.ts +3 -2
  337. package/src/nile-wysiwyg-editor/engine/plugins/link.ts +58 -2
  338. package/src/nile-wysiwyg-editor/engine/plugins/paste.ts +31 -8
  339. package/src/nile-wysiwyg-editor/engine/plugins/tables.ts +29 -7
  340. package/src/nile-wysiwyg-editor/engine/pm.test.ts +73 -0
  341. package/src/nile-wysiwyg-editor/engine/sanitize.ts +729 -7
  342. package/src/nile-wysiwyg-editor/engine/schema.ts +206 -33
  343. package/src/nile-wysiwyg-editor/engine/selection-state.ts +3 -1
  344. package/src/nile-wysiwyg-editor/engine/serializer.ts +30 -8
  345. package/src/nile-wysiwyg-editor/nile-wysiwyg-editor-email-fidelity.test.ts +357 -0
  346. package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.ts +45 -4
  347. package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.ts +258 -0
  348. package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.ts +119 -12
  349. package/src/nile-wysiwyg-editor/ui/bookmark-panel.ts +2 -2
  350. package/src/nile-wysiwyg-editor/ui/bubble-menu.ts +1 -1
  351. package/src/nile-wysiwyg-editor/ui/embed-menu.ts +1 -1
  352. package/src/nile-wysiwyg-editor/ui/embed-panel.ts +1 -1
  353. package/src/nile-wysiwyg-editor/ui/emoji-picker.ts +1 -1
  354. package/src/nile-wysiwyg-editor/ui/find-replace.ts +1 -1
  355. package/src/nile-wysiwyg-editor/ui/image-menu.ts +1 -1
  356. package/src/nile-wysiwyg-editor/ui/image-panel.ts +1 -1
  357. package/src/nile-wysiwyg-editor/ui/insert-menu.ts +1 -1
  358. package/src/nile-wysiwyg-editor/ui/link-editor.ts +2 -2
  359. package/src/nile-wysiwyg-editor/ui/markdown-panel.ts +1 -1
  360. package/src/nile-wysiwyg-editor/ui/math-panel.ts +1 -1
  361. package/src/nile-wysiwyg-editor/ui/shortcut-help.ts +1 -1
  362. package/src/nile-wysiwyg-editor/ui/source-view.ts +2 -2
  363. package/src/nile-wysiwyg-editor/ui/special-chars.ts +1 -1
  364. package/src/nile-wysiwyg-editor/ui/suggest-list.ts +14 -3
  365. package/src/nile-wysiwyg-editor/ui/table-grid-picker.ts +2 -2
  366. package/src/nile-wysiwyg-editor/ui/table-menu.ts +1 -1
  367. package/vscode-html-custom-data.json +15 -1
  368. package/web-test-runner.config.mjs +4 -0
  369. package/dist/index-3ca67627.cjs.js +0 -2
  370. package/dist/index-6f3fa4ab.esm.js +0 -1
  371. package/dist/index-7b1c9857.esm.js +0 -1
  372. package/dist/index-89c520e9.cjs.js +0 -5
  373. package/dist/index-89c520e9.cjs.js.map +0 -1
  374. package/dist/index-ba47645d.esm.js +0 -1
  375. package/dist/index-c3210a9c.cjs.js +0 -2
  376. package/dist/index-c3210a9c.cjs.js.map +0 -1
@@ -0,0 +1,357 @@
1
+ import { fixture, expect } from '@open-wc/testing';
2
+ import { html } from 'lit';
3
+ import '../index';
4
+ import { TextSelection } from 'prosemirror-state';
5
+ import type { NileWysiwygEditor } from './nile-wysiwyg-editor';
6
+
7
+ async function editorFixture(template = html`<nile-wysiwyg-editor></nile-wysiwyg-editor>`) {
8
+ const el = await fixture<NileWysiwygEditor>(template);
9
+ await el.updateComplete;
10
+ return el;
11
+ }
12
+
13
+ /** A compact table-based email with cell padding and a 600px container. */
14
+ const EMAIL_FIXTURE =
15
+ '<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">' +
16
+ '<tr><td align="center" style="padding:32px 12px;">' +
17
+ '<table role="presentation" width="600" style="width:100%; max-width:600px; background-color:#ffffff; border:1px solid #d9dee4;">' +
18
+ '<tr><td style="padding:28px 40px; background-color:#1f3a5f;">' +
19
+ '<p style="margin:0; font-family:Georgia, serif; color:#ffffff;">Company Name</p>' +
20
+ '</td></tr>' +
21
+ '<tr><td style="padding:36px 40px; font-family:Arial, sans-serif; color:#2b2f36;">' +
22
+ '<p style="margin:0 0 18px 0;">Hello there.</p>' +
23
+ '</td></tr>' +
24
+ '</table></td></tr></table>';
25
+
26
+ /** A full standalone HTML document, the kind that lands in text/plain. */
27
+ const FULL_DOC =
28
+ '<!doctype html><html><body>' +
29
+ '<table role="presentation"><tr><td style="padding:16px">Pasted cell</td></tr></table>' +
30
+ '</body></html>';
31
+
32
+ /** Fire a paste through the ProseMirror view's handlePaste prop. */
33
+ function firePaste(el: NileWysiwygEditor, data: Record<string, string>) {
34
+ const view = el.pmView!;
35
+ const dt = new DataTransfer();
36
+ for (const [type, value] of Object.entries(data)) dt.setData(type, value);
37
+ const event = new ClipboardEvent('paste', { clipboardData: dt });
38
+ return view.someProp('handlePaste', f => f(view, event, view.state.tr.doc.slice(0)));
39
+ }
40
+
41
+ describe('nile-wysiwyg-editor email-fidelity: property reflection', () => {
42
+ it('1. defaults emailFidelity to false', async () => {
43
+ const el = await editorFixture();
44
+ expect(el.emailFidelity).to.equal(false);
45
+ expect(el.hasAttribute('email-fidelity')).to.equal(false);
46
+ });
47
+
48
+ it('2. reflects the property to the kebab attribute', async () => {
49
+ const el = await editorFixture();
50
+ el.emailFidelity = true;
51
+ await el.updateComplete;
52
+ expect(el.hasAttribute('email-fidelity')).to.equal(true);
53
+ });
54
+
55
+ it('3. reads the attribute into the property', async () => {
56
+ const el = await editorFixture(
57
+ html`<nile-wysiwyg-editor email-fidelity></nile-wysiwyg-editor>`
58
+ );
59
+ expect(el.emailFidelity).to.equal(true);
60
+ });
61
+ });
62
+
63
+ describe('nile-wysiwyg-editor email-fidelity: value parsing', () => {
64
+ it('4. keeps cell padding in value with the flag on', async () => {
65
+ const el = await editorFixture(
66
+ html`<nile-wysiwyg-editor email-fidelity></nile-wysiwyg-editor>`
67
+ );
68
+ el.value = EMAIL_FIXTURE;
69
+ await el.updateComplete;
70
+ const doc = new DOMParser().parseFromString(el.value, 'text/html');
71
+ const padded = Array.from(doc.querySelectorAll<HTMLElement>('td')).some(
72
+ td => td.style.padding !== '' || td.style.paddingTop !== ''
73
+ );
74
+ expect(padded, 'a td keeps padding').to.equal(true);
75
+ });
76
+
77
+ it('5. strips cell padding in value with the flag off', async () => {
78
+ const el = await editorFixture();
79
+ el.value = EMAIL_FIXTURE;
80
+ await el.updateComplete;
81
+ expect(el.value).to.not.include('padding');
82
+ });
83
+
84
+ it('6. re-parses value when the flag toggles on', async () => {
85
+ const el = await editorFixture();
86
+ el.value = EMAIL_FIXTURE;
87
+ await el.updateComplete;
88
+ expect(el.value).to.not.include('padding');
89
+
90
+ el.emailFidelity = true;
91
+ el.value = EMAIL_FIXTURE;
92
+ await el.updateComplete;
93
+ expect(el.value).to.match(/padding/);
94
+ });
95
+ });
96
+
97
+ describe('nile-wysiwyg-editor email-fidelity: paste', () => {
98
+ it('7. parses a text/plain-only HTML document when the flag is on', async () => {
99
+ const el = await editorFixture(
100
+ html`<nile-wysiwyg-editor email-fidelity></nile-wysiwyg-editor>`
101
+ );
102
+ const handled = firePaste(el, { 'text/plain': FULL_DOC });
103
+ expect(handled).to.equal(true);
104
+ await el.updateComplete;
105
+ expect(el.getHTML()).to.include('<table');
106
+ expect(el.getHTML()).to.not.include('&lt;table');
107
+ });
108
+
109
+ it('8. inserts the HTML document literally when the flag is off', async () => {
110
+ const el = await editorFixture();
111
+ firePaste(el, { 'text/plain': FULL_DOC });
112
+ await el.updateComplete;
113
+ // No real table node — the markup is kept as literal text.
114
+ expect(el.getHTML()).to.not.include('<table');
115
+ expect(el.getText()).to.include('<table');
116
+ });
117
+
118
+ it('9. paste-as-plain-text wins over HTML detection', async () => {
119
+ const el = await editorFixture(
120
+ html`<nile-wysiwyg-editor email-fidelity paste-as-plain-text></nile-wysiwyg-editor>`
121
+ );
122
+ firePaste(el, { 'text/plain': FULL_DOC });
123
+ await el.updateComplete;
124
+ expect(el.getHTML()).to.not.include('<table');
125
+ expect(el.getText()).to.include('<table');
126
+ });
127
+
128
+ it('10. markdown text still goes through markdown with the flag on', async () => {
129
+ const el = await editorFixture(
130
+ html`<nile-wysiwyg-editor email-fidelity></nile-wysiwyg-editor>`
131
+ );
132
+ firePaste(el, { 'text/plain': '# Heading\n\nSome **bold** text.' });
133
+ await el.updateComplete;
134
+ const out = el.getHTML();
135
+ expect(out).to.include('<h1>');
136
+ expect(out).to.include('<strong>');
137
+ });
138
+ });
139
+
140
+ /** Focuses the editor with the caret inside the first text that equals `text`. */
141
+ async function caretIn(el: NileWysiwygEditor, text: string) {
142
+ const view = el.pmView!;
143
+ let pos = -1;
144
+ view.state.doc.descendants((node, at) => {
145
+ if (pos === -1 && node.isText && node.text === text) pos = at + 1;
146
+ return pos === -1;
147
+ });
148
+ view.focus();
149
+ view.dispatch(view.state.tr.setSelection(TextSelection.create(view.state.doc, pos)));
150
+ await el.updateComplete;
151
+ await new Promise(r => setTimeout(r, 50));
152
+ }
153
+
154
+ function tableMenuOpen(el: NileWysiwygEditor): boolean {
155
+ return !!el.shadowRoot!.querySelector('nile-wysiwyg-table-menu')!.hasAttribute('open');
156
+ }
157
+
158
+ const DATA_TABLE = '<table><tr><td>data cell</td></tr></table>';
159
+ const LAYOUT_TABLE = '<table role="presentation"><tr><td><p>layout cell</p></td></tr></table>';
160
+ const DATA_IN_LAYOUT =
161
+ '<table role="presentation"><tr><td><table><tr><td>inner data</td></tr></table></td></tr></table>';
162
+
163
+ describe('nile-wysiwyg-editor: table menu visibility', () => {
164
+ it('11. shows in a data table by default', async () => {
165
+ const el = await editorFixture(html`<nile-wysiwyg-editor .value=${DATA_TABLE}></nile-wysiwyg-editor>`);
166
+ await caretIn(el, 'data cell');
167
+ expect(tableMenuOpen(el)).to.equal(true);
168
+ });
169
+
170
+ it('12. no-table-menu hides it', async () => {
171
+ const el = await editorFixture(
172
+ html`<nile-wysiwyg-editor no-table-menu .value=${DATA_TABLE}></nile-wysiwyg-editor>`
173
+ );
174
+ expect(el.noTableMenu).to.equal(true);
175
+ await caretIn(el, 'data cell');
176
+ expect(tableMenuOpen(el)).to.equal(false);
177
+ });
178
+
179
+ it('13. toggling noTableMenu while focused closes and reopens it', async () => {
180
+ const el = await editorFixture(html`<nile-wysiwyg-editor .value=${DATA_TABLE}></nile-wysiwyg-editor>`);
181
+ await caretIn(el, 'data cell');
182
+ el.noTableMenu = true;
183
+ await el.updateComplete;
184
+ expect(tableMenuOpen(el)).to.equal(false);
185
+ el.noTableMenu = false;
186
+ await el.updateComplete;
187
+ expect(tableMenuOpen(el)).to.equal(true);
188
+ });
189
+
190
+ it('14. email-fidelity hides it inside a layout table', async () => {
191
+ const el = await editorFixture(
192
+ html`<nile-wysiwyg-editor email-fidelity .value=${LAYOUT_TABLE}></nile-wysiwyg-editor>`
193
+ );
194
+ await caretIn(el, 'layout cell');
195
+ expect(tableMenuOpen(el)).to.equal(false);
196
+ });
197
+
198
+ it('15. without email-fidelity a layout table still shows it (unchanged)', async () => {
199
+ const el = await editorFixture(html`<nile-wysiwyg-editor .value=${LAYOUT_TABLE}></nile-wysiwyg-editor>`);
200
+ await caretIn(el, 'layout cell');
201
+ expect(tableMenuOpen(el)).to.equal(true);
202
+ });
203
+
204
+ it('16. email-fidelity still shows it in a data table nested in a layout table', async () => {
205
+ const el = await editorFixture(
206
+ html`<nile-wysiwyg-editor email-fidelity .value=${DATA_IN_LAYOUT}></nile-wysiwyg-editor>`
207
+ );
208
+ await caretIn(el, 'inner data');
209
+ expect(tableMenuOpen(el)).to.equal(true);
210
+ });
211
+ });
212
+
213
+ describe('nile-wysiwyg-editor email-fidelity: saved HTML matches the editor', () => {
214
+ /** A table with no role="presentation" and no layout styles of its own. */
215
+ const DATA_TABLE =
216
+ '<table><tbody><tr><td><p>Employee Number:</p></td><td><p>1342</p></td></tr></tbody></table>';
217
+ const AUTHORED =
218
+ '<table style="width: 600px"><tbody><tr><td style="padding: 20px; vertical-align: middle">' +
219
+ '<p style="margin: 0 0 12px 0">Kept</p></td></tr></tbody></table>';
220
+ const LAYOUT =
221
+ '<table role="presentation"><tbody><tr><td><p>layout cell</p></td></tr></tbody></table>';
222
+
223
+ const parse = (out: string) => new DOMParser().parseFromString(out, 'text/html').body;
224
+
225
+ async function load(value: string, fidelity = true) {
226
+ const el = await editorFixture(
227
+ fidelity
228
+ ? html`<nile-wysiwyg-editor email-fidelity></nile-wysiwyg-editor>`
229
+ : html`<nile-wysiwyg-editor></nile-wysiwyg-editor>`
230
+ );
231
+ el.value = value;
232
+ await el.updateComplete;
233
+ return el;
234
+ }
235
+
236
+ it('1. writes the editor table rendering into a data table that sets none', async () => {
237
+ const el = await load(DATA_TABLE);
238
+ const body = parse(el.getHTML());
239
+ const table = body.querySelector('table')!;
240
+ expect(table.getAttribute('cellpadding')).to.equal('0');
241
+ expect(table.getAttribute('cellspacing')).to.equal('0');
242
+ expect(table.style.width).to.equal('100%');
243
+ expect(table.style.borderCollapse).to.equal('collapse');
244
+ expect(table.style.tableLayout).to.equal('fixed');
245
+ const td = body.querySelector('td')!;
246
+ expect(td.style.padding).to.equal('6px 8px');
247
+ expect(td.style.verticalAlign).to.equal('top');
248
+ const p = body.querySelector('p')!;
249
+ expect(p.style.marginTop).to.equal('0px');
250
+ expect(p.style.marginBottom).to.equal('0px');
251
+ });
252
+
253
+ it('2. keeps values the content sets itself', async () => {
254
+ const el = await load(AUTHORED);
255
+ const body = parse(el.getHTML());
256
+ expect(body.querySelector('table')!.style.width).to.equal('600px');
257
+ const td = body.querySelector('td')!;
258
+ expect(td.style.padding).to.equal('20px');
259
+ expect(td.style.verticalAlign).to.equal('middle');
260
+ expect(body.querySelector('p')!.style.margin).to.equal('0px 0px 12px');
261
+ });
262
+
263
+ it('3. leaves layout-table cells as authored, adding only cellpadding/cellspacing and collapse', async () => {
264
+ const el = await load(LAYOUT);
265
+ const body = parse(el.getHTML());
266
+ const table = body.querySelector('table')!;
267
+ expect(table.getAttribute('cellpadding')).to.equal('0');
268
+ expect(table.style.borderCollapse).to.equal('collapse');
269
+ expect(table.style.tableLayout).to.equal('');
270
+ expect(table.style.width).to.equal('');
271
+ const td = body.querySelector('td')!;
272
+ expect(td.style.padding).to.equal('');
273
+ expect(td.style.verticalAlign).to.equal('');
274
+ });
275
+
276
+ it('4. without email-fidelity the output is unchanged', async () => {
277
+ const el = await load(DATA_TABLE, false);
278
+ const out = el.getHTML();
279
+ expect(out).to.not.include('cellpadding');
280
+ expect(out).to.not.include('padding');
281
+ expect(out).to.not.include('border-collapse');
282
+ });
283
+
284
+ it('5. is stable across save and reload', async () => {
285
+ const first = await load(DATA_TABLE);
286
+ const saved = first.getHTML();
287
+ const second = await load(saved);
288
+ expect(second.getHTML()).to.equal(saved);
289
+ expect(second.value).to.equal(saved);
290
+ });
291
+
292
+ it('6. writes cell borders and the header fill in the colours the theme draws', async () => {
293
+ const el = await editorFixture(
294
+ html`<nile-wysiwyg-editor
295
+ email-fidelity
296
+ style="--nile-wysiwyg-table-border: rgb(1, 2, 3); --nile-wysiwyg-table-header-bg: rgb(4, 5, 6)"
297
+ ></nile-wysiwyg-editor>`
298
+ );
299
+ el.value =
300
+ '<table><tbody><tr><th><p>Attribute</p></th></tr><tr><td><p>Email</p></td></tr></tbody></table>';
301
+ await el.updateComplete;
302
+ const body = parse(el.getHTML());
303
+ const td = body.querySelector('td')!;
304
+ expect(td.style.borderTop).to.equal('1px solid rgb(1, 2, 3)');
305
+ expect(td.style.borderLeft).to.equal('1px solid rgb(1, 2, 3)');
306
+ const th = body.querySelector('th')!;
307
+ expect(th.style.backgroundColor).to.equal('rgb(4, 5, 6)');
308
+ expect(th.style.textAlign).to.equal('left');
309
+ expect(th.style.fontWeight).to.equal('600');
310
+ const again = await load(el.getHTML());
311
+ expect(parse(again.getHTML()).querySelector('td')!.style.borderTop).to.equal(
312
+ '1px solid rgb(1, 2, 3)'
313
+ );
314
+ });
315
+
316
+ it('6b. keeps an imported cell border across two saves', async () => {
317
+ const first = await load(
318
+ '<table role="presentation"><tbody><tr><td style="border: 1px solid #d9dee4"><p>x</p></td></tr></tbody></table>'
319
+ );
320
+ const second = await load(first.getHTML());
321
+ const td = parse(second.getHTML()).querySelector('td')!;
322
+ expect(td.style.borderTop).to.equal('1px solid rgb(217, 222, 228)');
323
+ expect(td.style.borderRight).to.equal('1px solid rgb(217, 222, 228)');
324
+ expect(second.getHTML()).to.equal(first.getHTML());
325
+ });
326
+
327
+ it('7. writes no border when the theme draws none', async () => {
328
+ const el = await load(DATA_TABLE);
329
+ expect(el.getHTML()).to.not.include('border-top');
330
+ });
331
+
332
+ it('8. writes a resized column width onto its cells', async () => {
333
+ const el = await load(
334
+ '<table><tbody><tr><td data-colwidth="120"><p>a</p></td><td><p>b</p></td></tr></tbody></table>'
335
+ );
336
+ const tds = parse(el.getHTML()).querySelectorAll('td');
337
+ expect((tds[0] as HTMLElement).style.width).to.equal('120px');
338
+ expect((tds[1] as HTMLElement).style.width).to.equal('');
339
+ });
340
+
341
+ it('9. draws layout-table cells the way a mail client does, data cells as before', async () => {
342
+ const el = await load(LAYOUT + DATA_TABLE);
343
+ const cells = [...el.shadowRoot!.querySelectorAll('.ProseMirror td')] as HTMLElement[];
344
+ const layoutCell = cells.find(c => c.textContent === 'layout cell')!;
345
+ const dataCell = cells.find(c => c.textContent === '1342')!;
346
+ expect(getComputedStyle(layoutCell).padding).to.equal('0px');
347
+ expect(getComputedStyle(layoutCell).verticalAlign).to.equal('middle');
348
+ expect(getComputedStyle(dataCell).padding).to.equal('6px 8px');
349
+ expect(getComputedStyle(dataCell).verticalAlign).to.equal('top');
350
+ });
351
+
352
+ it('10. adds no editor-only margin around tables', async () => {
353
+ const el = await load(DATA_TABLE);
354
+ const wrapper = el.shadowRoot!.querySelector('.ProseMirror .tableWrapper') as HTMLElement;
355
+ expect(getComputedStyle(wrapper).marginTop).to.equal('0px');
356
+ });
357
+ });
@@ -332,12 +332,43 @@ export const styles = css`
332
332
  cursor: col-resize;
333
333
  }
334
334
 
335
+ /* --- Email fidelity: an unsized layout table (e.g. a button) fits its
336
+ content, as it does in mail clients, instead of the 100% default. --- */
337
+ :host([email-fidelity]) .ProseMirror table[data-autowidth] {
338
+ width: auto;
339
+ }
340
+
341
+ /* Column resizing sets an inline min-width of 100px per column; on a nested
342
+ layout table (e.g. a row of social icons) that overflows the cell holding it. */
343
+ :host([email-fidelity]) .ProseMirror table[data-layout-table] {
344
+ min-width: 0 !important;
345
+ }
346
+
347
+ /* Email fidelity: the wrapper is editor-only (it holds the resize handles), so
348
+ its margin would add space the saved email doesn't have. */
349
+ :host([email-fidelity]) .ProseMirror .tableWrapper {
350
+ margin: 0;
351
+ }
352
+
353
+ /* Email fidelity: draw unstyled layout-table cells like a mail client (no padding, centred, no header fill). */
354
+ :host([email-fidelity]) .ProseMirror table[data-layout-table] > tbody > tr > td,
355
+ :host([email-fidelity]) .ProseMirror table[data-layout-table] > tbody > tr > th {
356
+ padding: 0;
357
+ vertical-align: middle;
358
+ }
359
+
360
+ :host([email-fidelity]) .ProseMirror table[data-layout-table] > tbody > tr > th {
361
+ background: none;
362
+ }
363
+
335
364
  /* --- Layout tables (role="presentation"): borderless output, dashed
336
365
  guides while editing so the structure stays visible. --- */
337
366
  .ProseMirror table[data-layout] td,
338
367
  .ProseMirror table[data-layout] th {
339
- border: 1px dashed var(--nile-colors-neutral-300, var(--ng-colors-border-primary));
340
- background: transparent;
368
+ /* Draw the editing guide with an inset outline, not a border/background, so
369
+ author-set cell borders and backgrounds (email fidelity) are preserved. */
370
+ outline: 1px dashed var(--nile-colors-neutral-300, var(--ng-colors-border-primary));
371
+ outline-offset: -1px;
341
372
  font-weight: inherit;
342
373
  text-align: inherit;
343
374
  }
@@ -391,7 +422,7 @@ export const styles = css`
391
422
  width: 9px;
392
423
  height: 9px;
393
424
  background: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600));
394
- border: 1.5px solid var(--ng-colors-bg-primary);
425
+ border: 1.5px solid var(--nile-colors-white-base, var(--ng-colors-bg-primary));
395
426
  border-radius: 2px;
396
427
  z-index: 2;
397
428
  }
@@ -662,7 +693,17 @@ export const styles = css`
662
693
  background: var(--nile-wysiwyg-mention-bg, var(--nile-colors-primary-50, var(--ng-componentcolors-utility-blue-50)));
663
694
  color: var(--nile-wysiwyg-mention-color, var(--nile-colors-primary-700, var(--ng-componentcolors-utility-blue-700)));
664
695
  font-weight: 500;
665
- white-space: nowrap;
696
+ /* Short mentions stay on one line; a long one (e.g. a deep field path) wraps
697
+ inside its container instead of overflowing a table cell or the editor. */
698
+ max-width: 100%;
699
+ overflow-wrap: anywhere;
700
+ }
701
+
702
+ /* The chip's 500 is only a default — bold, headings and an explicit
703
+ font-weight from the content win, so the chip looks the way it exports. */
704
+ .ProseMirror :is(strong, b, h1, h2, h3, h4, h5, h6, th, [style*='font-weight'])
705
+ span.nile-wysiwyg__mention {
706
+ font-weight: inherit;
666
707
  }
667
708
 
668
709
  .ProseMirror span.nile-wysiwyg__mention.ProseMirror-selectednode {