commspliant-html-editor 0.0.3 → 0.0.5

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 (364) hide show
  1. package/README.md +263 -7
  2. package/dist/404.html +19 -0
  3. package/dist/assets/index-8mpvnzOy.js +375 -0
  4. package/dist/assets/index-Cu8klpl0.css +1 -0
  5. package/dist/index.html +19 -0
  6. package/dist/logo.svg +314 -0
  7. package/package.json +7 -3
  8. package/dist/chrome/ChromeTheme.d.ts +0 -14
  9. package/dist/chrome/ChromeTheme.d.ts.map +0 -1
  10. package/dist/commspliant-html-editor.css +0 -1
  11. package/dist/components/Editor.d.ts +0 -3
  12. package/dist/components/Editor.d.ts.map +0 -1
  13. package/dist/components/HtmlSurface.d.ts +0 -9
  14. package/dist/components/HtmlSurface.d.ts.map +0 -1
  15. package/dist/components/VisualSurface.d.ts +0 -13
  16. package/dist/components/VisualSurface.d.ts.map +0 -1
  17. package/dist/core/blockFormat.d.ts +0 -10
  18. package/dist/core/blockFormat.d.ts.map +0 -1
  19. package/dist/core/blocks.d.ts +0 -19
  20. package/dist/core/blocks.d.ts.map +0 -1
  21. package/dist/core/bookmark.d.ts +0 -10
  22. package/dist/core/bookmark.d.ts.map +0 -1
  23. package/dist/core/cellProperties.d.ts +0 -18
  24. package/dist/core/cellProperties.d.ts.map +0 -1
  25. package/dist/core/clearFormatting.d.ts +0 -2
  26. package/dist/core/clearFormatting.d.ts.map +0 -1
  27. package/dist/core/clipboard.d.ts +0 -9
  28. package/dist/core/clipboard.d.ts.map +0 -1
  29. package/dist/core/commandTypes.d.ts +0 -251
  30. package/dist/core/commandTypes.d.ts.map +0 -1
  31. package/dist/core/commands.d.ts +0 -5
  32. package/dist/core/commands.d.ts.map +0 -1
  33. package/dist/core/cssLength.d.ts +0 -13
  34. package/dist/core/cssLength.d.ts.map +0 -1
  35. package/dist/core/customActions.d.ts +0 -12
  36. package/dist/core/customActions.d.ts.map +0 -1
  37. package/dist/core/documentStyles.d.ts +0 -4
  38. package/dist/core/documentStyles.d.ts.map +0 -1
  39. package/dist/core/fontFamily.d.ts +0 -40
  40. package/dist/core/fontFamily.d.ts.map +0 -1
  41. package/dist/core/fontSize.d.ts +0 -25
  42. package/dist/core/fontSize.d.ts.map +0 -1
  43. package/dist/core/fontSizeUnits.d.ts +0 -29
  44. package/dist/core/fontSizeUnits.d.ts.map +0 -1
  45. package/dist/core/horizontalRule.d.ts +0 -4
  46. package/dist/core/horizontalRule.d.ts.map +0 -1
  47. package/dist/core/image.d.ts +0 -19
  48. package/dist/core/image.d.ts.map +0 -1
  49. package/dist/core/imageProperties.d.ts +0 -35
  50. package/dist/core/imageProperties.d.ts.map +0 -1
  51. package/dist/core/imageResize.d.ts +0 -18
  52. package/dist/core/imageResize.d.ts.map +0 -1
  53. package/dist/core/imageSize.d.ts +0 -23
  54. package/dist/core/imageSize.d.ts.map +0 -1
  55. package/dist/core/indent.d.ts +0 -7
  56. package/dist/core/indent.d.ts.map +0 -1
  57. package/dist/core/inlineColor.d.ts +0 -23
  58. package/dist/core/inlineColor.d.ts.map +0 -1
  59. package/dist/core/inlineRange.d.ts +0 -10
  60. package/dist/core/inlineRange.d.ts.map +0 -1
  61. package/dist/core/link.d.ts +0 -18
  62. package/dist/core/link.d.ts.map +0 -1
  63. package/dist/core/lists.d.ts +0 -12
  64. package/dist/core/lists.d.ts.map +0 -1
  65. package/dist/core/marks.d.ts +0 -18
  66. package/dist/core/marks.d.ts.map +0 -1
  67. package/dist/core/page.d.ts +0 -8
  68. package/dist/core/page.d.ts.map +0 -1
  69. package/dist/core/pageProperties.d.ts +0 -7
  70. package/dist/core/pageProperties.d.ts.map +0 -1
  71. package/dist/core/paragraphBox.d.ts +0 -82
  72. package/dist/core/paragraphBox.d.ts.map +0 -1
  73. package/dist/core/paragraphProperties.d.ts +0 -17
  74. package/dist/core/paragraphProperties.d.ts.map +0 -1
  75. package/dist/core/rowProperties.d.ts +0 -17
  76. package/dist/core/rowProperties.d.ts.map +0 -1
  77. package/dist/core/selection.d.ts +0 -25
  78. package/dist/core/selection.d.ts.map +0 -1
  79. package/dist/core/table.d.ts +0 -28
  80. package/dist/core/table.d.ts.map +0 -1
  81. package/dist/core/tableProperties.d.ts +0 -18
  82. package/dist/core/tableProperties.d.ts.map +0 -1
  83. package/dist/core/textAlign.d.ts +0 -9
  84. package/dist/core/textAlign.d.ts.map +0 -1
  85. package/dist/hooks/useAutoSave.d.ts +0 -9
  86. package/dist/hooks/useAutoSave.d.ts.map +0 -1
  87. package/dist/hooks/useControllableState.d.ts +0 -8
  88. package/dist/hooks/useControllableState.d.ts.map +0 -1
  89. package/dist/i18n/LocaleProvider.d.ts +0 -11
  90. package/dist/i18n/LocaleProvider.d.ts.map +0 -1
  91. package/dist/i18n/en.d.ts +0 -3
  92. package/dist/i18n/en.d.ts.map +0 -1
  93. package/dist/i18n/es.d.ts +0 -3
  94. package/dist/i18n/es.d.ts.map +0 -1
  95. package/dist/i18n/types.d.ts +0 -367
  96. package/dist/i18n/types.d.ts.map +0 -1
  97. package/dist/icons/AlignCenterIcon.d.ts +0 -3
  98. package/dist/icons/AlignCenterIcon.d.ts.map +0 -1
  99. package/dist/icons/AlignJustifyIcon.d.ts +0 -3
  100. package/dist/icons/AlignJustifyIcon.d.ts.map +0 -1
  101. package/dist/icons/AlignLeftIcon.d.ts +0 -3
  102. package/dist/icons/AlignLeftIcon.d.ts.map +0 -1
  103. package/dist/icons/AlignRightIcon.d.ts +0 -3
  104. package/dist/icons/AlignRightIcon.d.ts.map +0 -1
  105. package/dist/icons/BoldIcon.d.ts +0 -3
  106. package/dist/icons/BoldIcon.d.ts.map +0 -1
  107. package/dist/icons/BookmarkIcon.d.ts +0 -3
  108. package/dist/icons/BookmarkIcon.d.ts.map +0 -1
  109. package/dist/icons/BulletListIcon.d.ts +0 -3
  110. package/dist/icons/BulletListIcon.d.ts.map +0 -1
  111. package/dist/icons/CellPropertiesIcon.d.ts +0 -3
  112. package/dist/icons/CellPropertiesIcon.d.ts.map +0 -1
  113. package/dist/icons/ClearFormattingIcon.d.ts +0 -3
  114. package/dist/icons/ClearFormattingIcon.d.ts.map +0 -1
  115. package/dist/icons/CloseIcon.d.ts +0 -3
  116. package/dist/icons/CloseIcon.d.ts.map +0 -1
  117. package/dist/icons/CommspliantShieldIcon.d.ts +0 -3
  118. package/dist/icons/CommspliantShieldIcon.d.ts.map +0 -1
  119. package/dist/icons/CustomActionIcon.d.ts +0 -3
  120. package/dist/icons/CustomActionIcon.d.ts.map +0 -1
  121. package/dist/icons/CustomizeToolbarIcon.d.ts +0 -3
  122. package/dist/icons/CustomizeToolbarIcon.d.ts.map +0 -1
  123. package/dist/icons/DarkModeIcon.d.ts +0 -3
  124. package/dist/icons/DarkModeIcon.d.ts.map +0 -1
  125. package/dist/icons/FontColorIcon.d.ts +0 -3
  126. package/dist/icons/FontColorIcon.d.ts.map +0 -1
  127. package/dist/icons/FontFamilyIcon.d.ts +0 -3
  128. package/dist/icons/FontFamilyIcon.d.ts.map +0 -1
  129. package/dist/icons/FontPropertiesIcon.d.ts +0 -3
  130. package/dist/icons/FontPropertiesIcon.d.ts.map +0 -1
  131. package/dist/icons/FontSizeIcon.d.ts +0 -3
  132. package/dist/icons/FontSizeIcon.d.ts.map +0 -1
  133. package/dist/icons/FullscreenIcon.d.ts +0 -3
  134. package/dist/icons/FullscreenIcon.d.ts.map +0 -1
  135. package/dist/icons/HighlightColorIcon.d.ts +0 -3
  136. package/dist/icons/HighlightColorIcon.d.ts.map +0 -1
  137. package/dist/icons/HorizontalRuleIcon.d.ts +0 -3
  138. package/dist/icons/HorizontalRuleIcon.d.ts.map +0 -1
  139. package/dist/icons/HtmlIcon.d.ts +0 -3
  140. package/dist/icons/HtmlIcon.d.ts.map +0 -1
  141. package/dist/icons/ImageIcon.d.ts +0 -3
  142. package/dist/icons/ImageIcon.d.ts.map +0 -1
  143. package/dist/icons/IndentIcon.d.ts +0 -3
  144. package/dist/icons/IndentIcon.d.ts.map +0 -1
  145. package/dist/icons/ItalicIcon.d.ts +0 -3
  146. package/dist/icons/ItalicIcon.d.ts.map +0 -1
  147. package/dist/icons/LightModeIcon.d.ts +0 -3
  148. package/dist/icons/LightModeIcon.d.ts.map +0 -1
  149. package/dist/icons/LinkIcon.d.ts +0 -3
  150. package/dist/icons/LinkIcon.d.ts.map +0 -1
  151. package/dist/icons/MenuIcon.d.ts +0 -3
  152. package/dist/icons/MenuIcon.d.ts.map +0 -1
  153. package/dist/icons/NumberedListIcon.d.ts +0 -3
  154. package/dist/icons/NumberedListIcon.d.ts.map +0 -1
  155. package/dist/icons/OpenIcon.d.ts +0 -3
  156. package/dist/icons/OpenIcon.d.ts.map +0 -1
  157. package/dist/icons/OutdentIcon.d.ts +0 -3
  158. package/dist/icons/OutdentIcon.d.ts.map +0 -1
  159. package/dist/icons/PagePropertiesIcon.d.ts +0 -3
  160. package/dist/icons/PagePropertiesIcon.d.ts.map +0 -1
  161. package/dist/icons/ParagraphPropertiesIcon.d.ts +0 -3
  162. package/dist/icons/ParagraphPropertiesIcon.d.ts.map +0 -1
  163. package/dist/icons/ParagraphStyleIcon.d.ts +0 -3
  164. package/dist/icons/ParagraphStyleIcon.d.ts.map +0 -1
  165. package/dist/icons/PlusIcon.d.ts +0 -3
  166. package/dist/icons/PlusIcon.d.ts.map +0 -1
  167. package/dist/icons/PreviewIcon.d.ts +0 -3
  168. package/dist/icons/PreviewIcon.d.ts.map +0 -1
  169. package/dist/icons/PrintIcon.d.ts +0 -3
  170. package/dist/icons/PrintIcon.d.ts.map +0 -1
  171. package/dist/icons/RedoIcon.d.ts +0 -3
  172. package/dist/icons/RedoIcon.d.ts.map +0 -1
  173. package/dist/icons/RowPropertiesIcon.d.ts +0 -3
  174. package/dist/icons/RowPropertiesIcon.d.ts.map +0 -1
  175. package/dist/icons/SaveIcon.d.ts +0 -3
  176. package/dist/icons/SaveIcon.d.ts.map +0 -1
  177. package/dist/icons/StrikethroughIcon.d.ts +0 -3
  178. package/dist/icons/StrikethroughIcon.d.ts.map +0 -1
  179. package/dist/icons/TableColumnIcon.d.ts +0 -3
  180. package/dist/icons/TableColumnIcon.d.ts.map +0 -1
  181. package/dist/icons/TableIcon.d.ts +0 -3
  182. package/dist/icons/TableIcon.d.ts.map +0 -1
  183. package/dist/icons/TableRowIcon.d.ts +0 -3
  184. package/dist/icons/TableRowIcon.d.ts.map +0 -1
  185. package/dist/icons/UnderlineIcon.d.ts +0 -3
  186. package/dist/icons/UnderlineIcon.d.ts.map +0 -1
  187. package/dist/icons/UndoIcon.d.ts +0 -3
  188. package/dist/icons/UndoIcon.d.ts.map +0 -1
  189. package/dist/icons/VisualIcon.d.ts +0 -3
  190. package/dist/icons/VisualIcon.d.ts.map +0 -1
  191. package/dist/icons/index.d.ts +0 -49
  192. package/dist/icons/index.d.ts.map +0 -1
  193. package/dist/icons/types.d.ts +0 -4
  194. package/dist/icons/types.d.ts.map +0 -1
  195. package/dist/index.cjs +0 -92
  196. package/dist/index.d.ts +0 -3
  197. package/dist/index.d.ts.map +0 -1
  198. package/dist/index.js +0 -14313
  199. package/dist/modules/contextMenu/ContextMenu.d.ts +0 -13
  200. package/dist/modules/contextMenu/ContextMenu.d.ts.map +0 -1
  201. package/dist/modules/contextMenu/commands.d.ts +0 -3
  202. package/dist/modules/contextMenu/commands.d.ts.map +0 -1
  203. package/dist/modules/contextMenu/index.d.ts +0 -5
  204. package/dist/modules/contextMenu/index.d.ts.map +0 -1
  205. package/dist/modules/contextMenu/shouldOpenEditorContextMenu.d.ts +0 -6
  206. package/dist/modules/contextMenu/shouldOpenEditorContextMenu.d.ts.map +0 -1
  207. package/dist/modules/file/catalog.d.ts +0 -3
  208. package/dist/modules/file/catalog.d.ts.map +0 -1
  209. package/dist/modules/file/commands.d.ts +0 -3
  210. package/dist/modules/file/commands.d.ts.map +0 -1
  211. package/dist/modules/file/fileDialogs.d.ts +0 -3
  212. package/dist/modules/file/fileDialogs.d.ts.map +0 -1
  213. package/dist/modules/file/htmlFile.d.ts +0 -5
  214. package/dist/modules/file/htmlFile.d.ts.map +0 -1
  215. package/dist/modules/file/index.d.ts +0 -4
  216. package/dist/modules/file/index.d.ts.map +0 -1
  217. package/dist/modules/file/printHtml.d.ts +0 -2
  218. package/dist/modules/file/printHtml.d.ts.map +0 -1
  219. package/dist/modules/file/useHtmlFileDrop.d.ts +0 -14
  220. package/dist/modules/file/useHtmlFileDrop.d.ts.map +0 -1
  221. package/dist/modules/format/ColorField.d.ts +0 -11
  222. package/dist/modules/format/ColorField.d.ts.map +0 -1
  223. package/dist/modules/format/ColorPicker.d.ts +0 -13
  224. package/dist/modules/format/ColorPicker.d.ts.map +0 -1
  225. package/dist/modules/format/ColorSelect.d.ts +0 -16
  226. package/dist/modules/format/ColorSelect.d.ts.map +0 -1
  227. package/dist/modules/format/CustomParagraphStyleDialog.d.ts +0 -21
  228. package/dist/modules/format/CustomParagraphStyleDialog.d.ts.map +0 -1
  229. package/dist/modules/format/FontColorSelect.d.ts +0 -3
  230. package/dist/modules/format/FontColorSelect.d.ts.map +0 -1
  231. package/dist/modules/format/FontFamilyList.d.ts +0 -16
  232. package/dist/modules/format/FontFamilyList.d.ts.map +0 -1
  233. package/dist/modules/format/FontFamilySelect.d.ts +0 -15
  234. package/dist/modules/format/FontFamilySelect.d.ts.map +0 -1
  235. package/dist/modules/format/FontPropertiesDialog.d.ts +0 -24
  236. package/dist/modules/format/FontPropertiesDialog.d.ts.map +0 -1
  237. package/dist/modules/format/FontPropertiesFields.d.ts +0 -12
  238. package/dist/modules/format/FontPropertiesFields.d.ts.map +0 -1
  239. package/dist/modules/format/FontSizeCombobox.d.ts +0 -13
  240. package/dist/modules/format/FontSizeCombobox.d.ts.map +0 -1
  241. package/dist/modules/format/FontSizeSelect.d.ts +0 -3
  242. package/dist/modules/format/FontSizeSelect.d.ts.map +0 -1
  243. package/dist/modules/format/HighlightColorSelect.d.ts +0 -4
  244. package/dist/modules/format/HighlightColorSelect.d.ts.map +0 -1
  245. package/dist/modules/format/LengthField.d.ts +0 -12
  246. package/dist/modules/format/LengthField.d.ts.map +0 -1
  247. package/dist/modules/format/PagePropertiesDialog.d.ts +0 -14
  248. package/dist/modules/format/PagePropertiesDialog.d.ts.map +0 -1
  249. package/dist/modules/format/ParagraphPropertiesDialog.d.ts +0 -12
  250. package/dist/modules/format/ParagraphPropertiesDialog.d.ts.map +0 -1
  251. package/dist/modules/format/ParagraphPropertiesFields.d.ts +0 -13
  252. package/dist/modules/format/ParagraphPropertiesFields.d.ts.map +0 -1
  253. package/dist/modules/format/ParagraphStyleList.d.ts +0 -22
  254. package/dist/modules/format/ParagraphStyleList.d.ts.map +0 -1
  255. package/dist/modules/format/ParagraphStyleSelect.d.ts +0 -4
  256. package/dist/modules/format/ParagraphStyleSelect.d.ts.map +0 -1
  257. package/dist/modules/format/ShadowFields.d.ts +0 -8
  258. package/dist/modules/format/ShadowFields.d.ts.map +0 -1
  259. package/dist/modules/format/catalog.d.ts +0 -3
  260. package/dist/modules/format/catalog.d.ts.map +0 -1
  261. package/dist/modules/format/colorModel.d.ts +0 -22
  262. package/dist/modules/format/colorModel.d.ts.map +0 -1
  263. package/dist/modules/format/colorPalette.d.ts +0 -3
  264. package/dist/modules/format/colorPalette.d.ts.map +0 -1
  265. package/dist/modules/format/commands.d.ts +0 -4
  266. package/dist/modules/format/commands.d.ts.map +0 -1
  267. package/dist/modules/format/fontDialog.d.ts +0 -9
  268. package/dist/modules/format/fontDialog.d.ts.map +0 -1
  269. package/dist/modules/format/fontSize.d.ts +0 -2
  270. package/dist/modules/format/fontSize.d.ts.map +0 -1
  271. package/dist/modules/format/index.d.ts +0 -3
  272. package/dist/modules/format/index.d.ts.map +0 -1
  273. package/dist/modules/format/pageDialog.d.ts +0 -9
  274. package/dist/modules/format/pageDialog.d.ts.map +0 -1
  275. package/dist/modules/format/paragraphDialog.d.ts +0 -9
  276. package/dist/modules/format/paragraphDialog.d.ts.map +0 -1
  277. package/dist/modules/history/catalog.d.ts +0 -3
  278. package/dist/modules/history/catalog.d.ts.map +0 -1
  279. package/dist/modules/history/commands.d.ts +0 -4
  280. package/dist/modules/history/commands.d.ts.map +0 -1
  281. package/dist/modules/history/history.d.ts +0 -15
  282. package/dist/modules/history/history.d.ts.map +0 -1
  283. package/dist/modules/history/index.d.ts +0 -5
  284. package/dist/modules/history/index.d.ts.map +0 -1
  285. package/dist/modules/insert/BookmarkDialog.d.ts +0 -9
  286. package/dist/modules/insert/BookmarkDialog.d.ts.map +0 -1
  287. package/dist/modules/insert/ImageDialog.d.ts +0 -12
  288. package/dist/modules/insert/ImageDialog.d.ts.map +0 -1
  289. package/dist/modules/insert/ImagePropertiesDialog.d.ts +0 -13
  290. package/dist/modules/insert/ImagePropertiesDialog.d.ts.map +0 -1
  291. package/dist/modules/insert/ImagePropertiesFields.d.ts +0 -11
  292. package/dist/modules/insert/ImagePropertiesFields.d.ts.map +0 -1
  293. package/dist/modules/insert/ImageResizeOverlay.d.ts +0 -7
  294. package/dist/modules/insert/ImageResizeOverlay.d.ts.map +0 -1
  295. package/dist/modules/insert/ImageSizeField.d.ts +0 -10
  296. package/dist/modules/insert/ImageSizeField.d.ts.map +0 -1
  297. package/dist/modules/insert/LinkDialog.d.ts +0 -22
  298. package/dist/modules/insert/LinkDialog.d.ts.map +0 -1
  299. package/dist/modules/insert/catalog.d.ts +0 -3
  300. package/dist/modules/insert/catalog.d.ts.map +0 -1
  301. package/dist/modules/insert/commands.d.ts +0 -4
  302. package/dist/modules/insert/commands.d.ts.map +0 -1
  303. package/dist/modules/insert/imagePropertiesDialog.d.ts +0 -9
  304. package/dist/modules/insert/imagePropertiesDialog.d.ts.map +0 -1
  305. package/dist/modules/insert/index.d.ts +0 -3
  306. package/dist/modules/insert/index.d.ts.map +0 -1
  307. package/dist/modules/table/CellPropertiesDialog.d.ts +0 -10
  308. package/dist/modules/table/CellPropertiesDialog.d.ts.map +0 -1
  309. package/dist/modules/table/CellPropertiesFields.d.ts +0 -8
  310. package/dist/modules/table/CellPropertiesFields.d.ts.map +0 -1
  311. package/dist/modules/table/RowPropertiesDialog.d.ts +0 -10
  312. package/dist/modules/table/RowPropertiesDialog.d.ts.map +0 -1
  313. package/dist/modules/table/RowPropertiesFields.d.ts +0 -8
  314. package/dist/modules/table/RowPropertiesFields.d.ts.map +0 -1
  315. package/dist/modules/table/TableDialog.d.ts +0 -9
  316. package/dist/modules/table/TableDialog.d.ts.map +0 -1
  317. package/dist/modules/table/TablePropertiesDialog.d.ts +0 -10
  318. package/dist/modules/table/TablePropertiesDialog.d.ts.map +0 -1
  319. package/dist/modules/table/TablePropertiesFields.d.ts +0 -8
  320. package/dist/modules/table/TablePropertiesFields.d.ts.map +0 -1
  321. package/dist/modules/table/catalog.d.ts +0 -3
  322. package/dist/modules/table/catalog.d.ts.map +0 -1
  323. package/dist/modules/table/commands.d.ts +0 -4
  324. package/dist/modules/table/commands.d.ts.map +0 -1
  325. package/dist/modules/table/index.d.ts +0 -3
  326. package/dist/modules/table/index.d.ts.map +0 -1
  327. package/dist/modules/view/DocumentPreviewDialog.d.ts +0 -7
  328. package/dist/modules/view/DocumentPreviewDialog.d.ts.map +0 -1
  329. package/dist/modules/view/catalog.d.ts +0 -3
  330. package/dist/modules/view/catalog.d.ts.map +0 -1
  331. package/dist/modules/view/commands.d.ts +0 -4
  332. package/dist/modules/view/commands.d.ts.map +0 -1
  333. package/dist/modules/view/darkModePersistence.d.ts +0 -5
  334. package/dist/modules/view/darkModePersistence.d.ts.map +0 -1
  335. package/dist/modules/view/index.d.ts +0 -3
  336. package/dist/modules/view/index.d.ts.map +0 -1
  337. package/dist/modules/view/toolbarPositionPersistence.d.ts +0 -6
  338. package/dist/modules/view/toolbarPositionPersistence.d.ts.map +0 -1
  339. package/dist/toolbar/CustomizeToolbarDialog.d.ts +0 -16
  340. package/dist/toolbar/CustomizeToolbarDialog.d.ts.map +0 -1
  341. package/dist/toolbar/EditorToolbar.d.ts +0 -16
  342. package/dist/toolbar/EditorToolbar.d.ts.map +0 -1
  343. package/dist/toolbar/IconNav.d.ts +0 -12
  344. package/dist/toolbar/IconNav.d.ts.map +0 -1
  345. package/dist/toolbar/MenuBar.d.ts +0 -18
  346. package/dist/toolbar/MenuBar.d.ts.map +0 -1
  347. package/dist/toolbar/Tooltip.d.ts +0 -11
  348. package/dist/toolbar/Tooltip.d.ts.map +0 -1
  349. package/dist/toolbar/allowedChrome.d.ts +0 -4
  350. package/dist/toolbar/allowedChrome.d.ts.map +0 -1
  351. package/dist/toolbar/defaultCatalog.d.ts +0 -4
  352. package/dist/toolbar/defaultCatalog.d.ts.map +0 -1
  353. package/dist/toolbar/defaultLayout.d.ts +0 -3
  354. package/dist/toolbar/defaultLayout.d.ts.map +0 -1
  355. package/dist/toolbar/index.d.ts +0 -10
  356. package/dist/toolbar/index.d.ts.map +0 -1
  357. package/dist/toolbar/resolveChrome.d.ts +0 -12
  358. package/dist/toolbar/resolveChrome.d.ts.map +0 -1
  359. package/dist/toolbar/toolbarCustomization.d.ts +0 -14
  360. package/dist/toolbar/toolbarCustomization.d.ts.map +0 -1
  361. package/dist/toolbar/types.d.ts +0 -65
  362. package/dist/toolbar/types.d.ts.map +0 -1
  363. package/dist/types.d.ts +0 -263
  364. package/dist/types.d.ts.map +0 -1
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  **Try it out here:** [https://htmleditor.commspliant.com/](https://htmleditor.commspliant.com/)
4
4
 
5
+ [![WYSIWYG editor screenshot](screenshot.png)](https://htmleditor.commspliant.com/)
6
+
5
7
  Reusable React + TypeScript editor with two base modes: **Visual** (`contenteditable`) and **HTML** (plain-text source). Downstream apps import the package; they do not copy source.
6
8
 
7
9
  ## Install
@@ -44,7 +46,9 @@ Give the editor a parent with a definite height (`height: 100%` on a sized ances
44
46
  | `value` | `string` | — | Controlled HTML document |
45
47
  | `defaultValue` | `string` | `''` | Initial HTML when uncontrolled |
46
48
  | `onChange` | `(html: string) => void` | — | Fires when either surface edits the document |
47
- | `onAutoSave` | `(html: string) => void` | — | Polls every 1s; calls only when the document HTML changed. See [Auto save](#auto-save) |
49
+ | `onAutoSave` | `(html: string \| string[]) => void` | — | Polls every 1s; calls only when the document HTML changed. See [Auto save](#auto-save) |
50
+ | `onSave` | `(html: string \| string[]) => void` | — | File → Save host callback. See [Save and open](#save-and-open) |
51
+ | `onOpen` | `() => string \| string[] \| null` | — | File → Open host callback. See [Save and open](#save-and-open) |
48
52
  | `mode` | `'visual' \| 'html'` | — | Controlled mode |
49
53
  | `defaultMode` | `'visual' \| 'html'` | `'visual'` | Initial mode when uncontrolled |
50
54
  | `onModeChange` | `(mode: EditorMode) => void` | — | Fires when the built-in Visual / HTML toggle is used |
@@ -53,7 +57,7 @@ Give the editor a parent with a definite height (`height: 100%` on a sized ances
53
57
  | `onFullscreenChange` | `(fullscreen: boolean) => void` | — | Fires when full screen is entered or exited |
54
58
  | `placeholder` | `string` | — | Empty-state hint |
55
59
  | `disabled` | `boolean` | `false` | Same lock as `readOnly`. Either prop being true locks the editor |
56
- | `readOnly` | `boolean` | `false` | When true, neither surface can be edited and both are grayed out; menus and toolbar are grayed out and not clickable |
60
+ | `readOnly` | `boolean` | `false` | Locks document editing. When `enableComments` is also true, comment chrome stays available and `onCommentsChange` still fires; anchor writes do not call `onChange`. See [Comments](#comments) |
57
61
  | `className` | `string` | — | Extra class on the editor root |
58
62
  | `locale` | `'en' \| 'es'` | `'en'` | Library chrome language. Document content is not translated |
59
63
  | `toolbarBackground` | `string` | `#f0f0f0` | CSS color for the icon toolbar row. Omit to use the default light gray |
@@ -75,22 +79,71 @@ Give the editor a parent with a definite height (`height: 100%` on a sized ances
75
79
  | `transformHtml` | `(html: string) => string` | — | Optional map over document HTML before it is stored and passed to `onChange`. See [Transform HTML](#transform-html) |
76
80
  | `customImagePicker` | `CustomImagePicker` | — | Optional third Insert image source. See [Custom image picker](#custom-image-picker) |
77
81
  | `disableBuiltinImageInsert` | `boolean` | `false` | Skip the Insert image dialog and call `customImagePicker.onPick` from the toolbar or Insert menu |
82
+ | `customAudioPicker` | `CustomAudioPicker` | — | Optional third Insert audio source. See [Custom audio picker](#custom-audio-picker) |
83
+ | `disableBuiltinAudioInsert` | `boolean` | `false` | Skip the Insert audio dialog and call `customAudioPicker.onPick` from the Insert menu |
84
+ | `customVideoPicker` | `CustomVideoPicker` | — | Optional third Insert YouTube video source. See [Custom video picker](#custom-video-picker) |
85
+ | `disableBuiltinVideoInsert` | `boolean` | `false` | Skip the Insert YouTube video dialog and call `customVideoPicker.onPick` from the Insert menu |
78
86
  | `disableHtmlFileDrop` | `boolean` | `false` | When true, dropping an HTML file on the editor does not replace the document. File → Open is unchanged |
87
+ | `enableMultiPages` | `boolean` | `false` | When true, edit multiple independent HTML pages in visual mode. See [Multi-page editing](#multi-page-editing) |
88
+ | `pages` | `string[]` | — | Controlled page HTML strings when `enableMultiPages` is true |
89
+ | `defaultPages` | `string[]` | — | Initial pages when uncontrolled and `enableMultiPages` is true |
90
+ | `onPagesChange` | `(pages: string[], activePageIndex: number) => void` | — | Fires when any page changes while multi-page mode is enabled |
91
+ | `enableComments` | `boolean` | `false` | When true, comment chrome and thread state are enabled. See [Comments](#comments) |
92
+ | `commentAuthor` | `CommentAuthor` | — | `{ userId, userName }` identity for posting messages in the comment panel |
93
+ | `comments` | `CommentThread[]` | — | Controlled comment thread array (metadata separate from document HTML) |
94
+ | `defaultComments` | `CommentThread[]` | `[]` | Initial threads when uncontrolled |
95
+ | `onCommentsChange` | `(threads: CommentThread[]) => void` | — | Fires when comment threads change |
79
96
  | `toolbarCustomization` | `ToolbarCustomizationPersistence` | — | Host load/save for icon-toolbar layout. Omit to persist in `localStorage`. See [Customize toolbar](#customize-toolbar) |
80
97
  | `darkMode` | `boolean` | `false` | Initial chrome theme when nothing is persisted (`true` = dark). See [Dark mode](#dark-mode) |
81
98
  | `darkModePersistence` | `DarkModePersistence` | — | Host load/save for the chrome theme. Omit to persist in `localStorage`. See [Dark mode](#dark-mode) |
82
99
 
83
- `mode`, `value`, and `fullscreen` are optional. Omit them for internal state; pass them to control from the parent. Chrome includes a File menu (Save, Load, and Print), an Edit menu (Undo and Redo), an Insert menu (Link, Bookmark, Image, Table, Horizontal line, and table row/column items), a View menu (Visual, HTML, Toolbar customize and position, Light/Dark mode, Preview, and Full screen), and a Format menu (paragraph styles, font, clear formatting, paragraph, page, image properties, and table/cell/row properties), unless `menuVisible` is `false`. The icon toolbar has File (Save and Load), Print, Edit (Undo and Redo), Insert (Link, Bookmark, Image, Table, and Horizontal line), Font, Align, Paragraph, and View (Visual | HTML | Preview) groups, with Full screen pinned last, unless `toolbarVisible` is `false`. Hide both to drop the chrome slot entirely. View → Toolbar → Position docks the icon toolbar (the menu bar stays at the top). Top and bottom wrap onto multiple rows when they cannot fit on one line; Full screen stays last, pinned to the right of the first row. Left and right stay a single column and grow the editor instead of wrapping into extra columns. Full screen covers the host page with a fixed overlay; an X control (and Escape) returns to the in-page layout. Visual and HTML mode stay independent of the overlay. Save writes the current document to an HTML file; Load replaces it from an HTML file. Dropping an `.html` / `.htm` file onto the document surface does the same as Load, unless `disableHtmlFileDrop` is set. Print opens the browser print dialog for the document HTML only (not the editor chrome). Preview (View menu and View icon group) opens a large dialog with a scrollable rendering of the current document HTML. Undo and Redo walk document HTML history; they are grayed out when there is nothing to undo or redo. The File, Edit, and Insert menu items use the same icons as the toolbar buttons. Link wraps the selection (or inserts the URL as the visible text at the caret) in an `<a href>` tag; an optional title becomes the native hover tooltip, and opening in a new tab sets `target="_blank"`. Bookmark inserts a named destination (`id`) at the caret or around the selection. Horizontal line inserts an `<hr>` at the caret.
100
+ `mode`, `value`, and `fullscreen` are optional. Omit them for internal state; pass them to control from the parent. Chrome includes a File menu (Save, Load, and Print), an Edit menu (Undo, Redo, and Page properties), an Insert menu (Link, Bookmark, Image, Audio, YouTube video, Table, Horizontal line, and Page break), a Table menu (Insert table, row and column items, Merge cells, Unmerge cells, and table/cell/row properties), a View menu (Visual, HTML, Toolbar customize and position, Zoom, Light/Dark mode, Preview, Read aloud, and Full screen), and a Format menu (paragraph styles, font, clear formatting, paragraph, and image properties), unless `menuVisible` is `false`. The icon toolbar has File (Save and Load), Print, Edit (Undo and Redo), Insert (Link, Bookmark, Image, Table, and Horizontal line), Table (Merge cells and Unmerge cells), Font, Align, Paragraph, and View (Visual | HTML | Preview | Read aloud) groups, with Full screen pinned last, unless `toolbarVisible` is `false`. Hide both to drop the chrome slot entirely. View → Toolbar → Position docks the icon toolbar (the menu bar stays at the top). Top and bottom wrap onto multiple rows when they cannot fit on one line; Full screen stays last, pinned to the right of the first row. Left and right stay a single column and grow the editor instead of wrapping into extra columns. Full screen covers the host page with a fixed overlay; an X control (and Escape) returns to the in-page layout. Visual and HTML mode stay independent of the overlay. By default, Save writes the current document to an HTML file and Load replaces it from an HTML file; pass `onSave` and/or `onOpen` to delegate to host callbacks instead (see [Save and open](#save-and-open)). Dropping an `.html` / `.htm` file onto the document surface does the same as Load, unless `disableHtmlFileDrop` is set. Print opens the browser print dialog for the document HTML only (not the editor chrome). Preview (View menu and View icon group) opens a large dialog with a scrollable rendering of the current document HTML. Read aloud (View menu and View icon group) uses the browser’s built-in speech synthesis to read the current selection, or the full document when nothing is selected; click again to stop. Undo and Redo walk document HTML history; they are grayed out when there is nothing to undo or redo. The File, Edit, and Insert menu items use the same icons as the toolbar buttons where both exist. Link wraps the selection (or inserts the URL as the visible text at the caret) in an `<a href>` tag; an optional title becomes the native hover tooltip, and opening in a new tab sets `target="_blank"`. Bookmark inserts a named destination (`id`) at the caret or around the selection. Audio and YouTube video are available from the Insert menu only (no toolbar buttons). Horizontal line inserts an `<hr>` at the caret. Page break inserts a hard print break at the caret (Insert → Page break, or Ctrl/Cmd+Enter in visual mode). Content after the break starts on a new printed page. Serialized HTML uses inline `break-after: page` / `page-break-after: always` on a `<div>` — distinct from **Insert → Page**, which adds a new editor page when `enableMultiPages` is on.
84
101
 
85
102
  `menuColor`, `menuBackground`, `menuFontSize`, and `menuFontFamily` restyle the dropdown menu bar and panels only — not the icon toolbar. `border` is the outer editor box and is ignored in fullscreen. Custom menu fonts must already be available on the page.
86
103
 
87
104
  The toolbar Font dropdown lists web-safe faces (Arial, Georgia, Times New Roman, and the rest of the usual stacks). Choose **Default** to clear an authored `font-family` so the text inherits. Applied faces are written as inline `style="font-family: …"` on the selection (or the page shell from Page properties).
88
105
 
106
+ ### Custom CSS
107
+
108
+ Format → Font → **Custom CSS** (and the Custom CSS icon in the Font toolbar group) opens a dialog with a multi-line textarea. With text selected or the caret inside styled text, existing inline CSS is pre-filled — one declaration per line, split at each `;`. On **OK**, declarations are merged onto the current inline styles (matching property names are overridden; others are kept). Use an empty value (e.g. `color:`) to remove a property. The result is stored as compressed one-line inline CSS on a `<span>`. With only a caret (no selection), the CSS applies to the next characters you type. An empty textarea is a no-op. Visual mode only.
109
+
110
+ ```tsx
111
+ import { Editor } from 'commspliant-html-editor'
112
+
113
+ <Editor />
114
+ // Format → Font → Custom CSS, or the Custom CSS toolbar button
115
+ ```
116
+
117
+ ### Page properties
118
+
119
+ Edit → Page → **Page properties** opens a dialog with **Font**, **Paragraph**, and **Print** tabs. Paragraph sub-tabs include **Spacing**, **Border**, **Background** (fill color and page opacity), and **Background Image**. The **Print** tab edits `@page` size, orientation, and margins. In visual mode, the white editing surface previews that page size and print margins on screen (display-only; serialized HTML is unchanged). Use **View → Zoom** for screen-only fit and percentage zoom; zoom is not stored in the document.
120
+
121
+ The first time page properties are applied, content is wrapped in a single `<div data-page>` shell with `width: 100%` and `height: 100%`. Background **color** is written on that shell. Background **image** uses the same file, URL, or custom picker as Insert → Image, plus independent width and height (default width `100%`, height unset), and opacity, fit, and position controls (the same options as Image properties → Advanced). Rotation is not supported for page backgrounds. Width and height write `background-size`; keyword fit values (`cover`, `contain`) replace those dimensions.
122
+
123
+ When a background image is set, a single managed first child `<div id="commspliant-background" data-page-bg contenteditable="false">` holds the image layer so image opacity does not fade page text. If that id already exists in the editor, it is reused and extras are removed. The layer sits behind content (`z-index: -1`) so the document stays editable:
124
+
125
+ ```html
126
+ <div data-page style="width:100%;height:100%;position:relative;isolation:isolate;background-color:#fff">
127
+ <div id="commspliant-background" data-page-bg contenteditable="false"
128
+ style="position:absolute;inset:0;z-index:-1;pointer-events:none;user-select:none;background-image:url(&quot;https://example.com/bg.png&quot;);background-size:cover;background-position:center;background-repeat:no-repeat;opacity:0.9"></div>
129
+ <p>Hello</p>
130
+ </div>
131
+ ```
132
+
133
+ The visual editor holder mirrors the shell fill and background image for display only; serialized `value` HTML is unchanged by that paint step.
134
+
135
+ ```tsx
136
+ import { Editor } from 'commspliant-html-editor'
137
+
138
+ <Editor />
139
+ // Edit → Page → Page properties → Paragraph → Background Image
140
+ ```
141
+
89
142
  ### Editor chrome
90
143
 
91
144
  Show or hide the menu bar and icon toolbar, and control the full-screen overlay from the host. View → Toolbar → Position docks the icon toolbar; the menu bar stays at the top. Top and bottom wrap onto multiple rows when they cannot fit on one line; Full screen stays last, pinned to the right of the first row. Left and right stay a single column.
92
145
 
93
- On the visual surface, a mouse right-click opens the editor context menu (cut, copy, font and paragraph properties, and table items when the caret is in a table). A touch or pen long-press does not; phones keep the native selection handles and OS Copy / Paste callout so text can be selected.
146
+ On the visual surface, a mouse right-click opens the editor context menu (cut, copy, font and paragraph properties, and table items — including merge and unmerge — when the caret is in a table). A touch or pen long-press does not; phones keep the native selection handles and OS Copy / Paste callout so text can be selected.
94
147
 
95
148
  ```tsx
96
149
  import { useState } from 'react'
@@ -120,14 +173,18 @@ import { Editor } from 'commspliant-html-editor'
120
173
 
121
174
  Pass `allowedChrome` to show only the menus and icon-toolbar buttons the host allows. Omit the prop (or either field) to leave that surface unfiltered.
122
175
 
123
- The two lists are independent: hiding the File menu does not hide Save on the toolbar, and hiding the Print button does not hide File → Print. `menus` is top-level menu ids only: `file`, `edit`, `insert`, `view`, and `format` (plus any custom menu id from `customActions`). `toolbar` is icon-toolbar item ids:
176
+ The two lists are independent: hiding the File menu does not hide Save on the toolbar, and hiding the Print button does not hide File → Print. `menus` is top-level menu ids only: `file`, `edit`, `insert`, `table`, `view`, and `format` (plus any custom menu id from `customActions`). `toolbar` is icon-toolbar item ids:
177
+
178
+ `save`, `open`, `print`, `undo`, `redo`, `link`, `bookmark`, `image`, `table`, `horizontalRule`, `mergeCells`, `unmergeCells`, `fontFamily`, `paragraphStyle`, `fontSize`, `fontColor`, `highlightColor`, `customCss`, `formatBrush`, `bold`, `italic`, `underline`, `strikethrough`, `clearFormatting`, `alignLeft`, `alignCenter`, `alignRight`, `alignJustify`, `indent`, `outdent`, `bulletList`, `numberedList`, `visual`, `html`, `preview`, `readAloud`, `fullscreen`
124
179
 
125
- `save`, `open`, `print`, `undo`, `redo`, `link`, `bookmark`, `image`, `table`, `horizontalRule`, `fontFamily`, `paragraphStyle`, `fontSize`, `fontColor`, `highlightColor`, `bold`, `italic`, `underline`, `strikethrough`, `clearFormatting`, `alignLeft`, `alignCenter`, `alignRight`, `alignJustify`, `indent`, `outdent`, `bulletList`, `numberedList`, `visual`, `html`, `preview`, `fullscreen`
180
+ The **Format brush** icon (`formatBrush`) is toolbar-only. Select source text, click the brush to copy inline character formatting (bold, italic, underline, strikethrough, font, size, color, highlight, custom CSS), then select target text to apply. Click the brush again or click it without a selection to cancel.
126
181
 
127
182
  If `toolbar` is set, custom action ids must be listed to appear on the icon bar.
128
183
 
129
184
  Empty arrays hide that surface (`menus: []` shows no dropdowns; `toolbar: []` shows no icons). The right-click context menu is not filtered. Commands stay registered; this only hides chrome.
130
185
 
186
+ Page properties (including the Print / `@page` tab) live under **Edit → Page**. Hosts that allow only `format` in `allowedChrome` will not show Page properties unless `edit` is included too.
187
+
131
188
  View → Toolbar → Customize toolbar and its persistence still work as they do today, on the allowed toolbar subset. The dialog lists only allowed icon-toolbar items.
132
189
 
133
190
  ```tsx
@@ -295,7 +352,7 @@ let stored: CustomParagraphStyle[] = []
295
352
  | `id` | `string` | Stable id. The dialog assigns one on create |
296
353
  | `name` | `string` | Visible name. Always trimmed and non-empty on save |
297
354
  | `font` | `CustomParagraphStyleFont` | Size, unit, marks, family, and colors captured by the dialog |
298
- | `paragraph` | `CustomParagraphStyleParagraph` | Optional paragraph box: align, list, margin, padding, line-height, border, radius, shadow, background, opacity |
355
+ | `paragraph` | `CustomParagraphStyleParagraph` | Optional paragraph box: align, list, margin, padding, line-height, border, radius, shadow, background, opacity, and page-break (`breakInside`, `breakAfter`, `breakBefore`) |
299
356
 
300
357
  Omit all three props to keep only the built-in styles.
301
358
 
@@ -329,6 +386,123 @@ import { Editor } from 'commspliant-html-editor'
329
386
  />
330
387
  ```
331
388
 
389
+ ### Save and open
390
+
391
+ By default, File → Save and the Save toolbar button write the document to a local HTML file (browser save picker or download). File → Open and the Open toolbar button load from a local HTML file. Omit both callbacks to keep that behavior.
392
+
393
+ Pass `onSave` to persist through the host instead of the built-in file picker. It receives the current document HTML (same as `onChange`, after `transformHtml`) and is awaited.
394
+
395
+ Pass `onOpen` to load through the host instead of the built-in file picker. Return document HTML to replace the editor, or `null` to cancel. The callback is awaited. HTML file drag-drop is unchanged — it still reads a local file and does not call `onOpen`.
396
+
397
+ The two props are independent: set only `onSave` to keep Open on the local picker, or only `onOpen` to keep Save on the local picker.
398
+
399
+ ```tsx
400
+ import { Editor } from 'commspliant-html-editor'
401
+
402
+ <Editor
403
+ defaultValue="<p>Hello</p>"
404
+ onSave={async (html) => {
405
+ await fetch('/api/documents/current', { method: 'PUT', body: html })
406
+ }}
407
+ onOpen={async () => {
408
+ const response = await fetch('/api/documents/current')
409
+ if (!response.ok) return null
410
+ return response.text()
411
+ }}
412
+ />
413
+ ```
414
+
415
+ ### Multi-page editing
416
+
417
+ Set `enableMultiPages` to edit several independent HTML pages in visual mode. Pages appear stacked with toolbar-colored gaps between them. Use Insert → Page to add a page after the focused one. Edit → Page → Page properties includes a Print tab for `@page` size, orientation, and margins; Reset removes the print rule from the active page.
418
+
419
+ When multi-page mode is off (default), behavior is unchanged.
420
+
421
+ **HTML source mode** shows all pages in one textarea, separated by:
422
+
423
+ ```html
424
+ <!-- wysiwyg-page-separator -->
425
+ ```
426
+
427
+ **Persistence:**
428
+
429
+ - Built-in File → Save / Open operate on the **focused page only** (single `.html` file).
430
+ - Host `onSave`, `onOpen`, and `onAutoSave` receive **all pages** as a `string[]` when `enableMultiPages` is true.
431
+ - Use `onPagesChange` for controlled multi-page state. Export helpers: `splitPagesFromHtml`, `joinPagesToHtml`, and `PAGE_SEPARATOR` from the package.
432
+
433
+ ```tsx
434
+ import { useState } from 'react'
435
+ import { Editor } from 'commspliant-html-editor'
436
+
437
+ export function MultiPageEditor() {
438
+ const [pages, setPages] = useState(['<p>Page one</p>', '<p>Page two</p>'])
439
+
440
+ return (
441
+ <Editor
442
+ enableMultiPages
443
+ pages={pages}
444
+ onPagesChange={(nextPages) => setPages(nextPages)}
445
+ onSave={async (payload) => {
446
+ if (Array.isArray(payload)) {
447
+ await fetch('/api/documents/pages', {
448
+ method: 'PUT',
449
+ body: JSON.stringify(payload),
450
+ })
451
+ }
452
+ }}
453
+ />
454
+ )
455
+ }
456
+ ```
457
+
458
+ ### Page break
459
+
460
+ In visual mode, use **Insert → Page break** or **Ctrl/Cmd+Enter** to insert a hard print break at the caret. The editor shows a dashed line; serialized HTML is a `<div>` with inline `break-after: page` and `page-break-after: always`. Content after the break starts on a new page when printing.
461
+
462
+ This is not the same as **Insert → Page** (multi-page mode), which adds a separate editor page surface.
463
+
464
+ ### Comments
465
+
466
+ Set `enableComments` to add lightweight comment threads anchored in the document with `data-comment-thread` markers. Thread metadata (`CommentThread[]`) is separate from document HTML — use `comments` / `onCommentsChange` to persist it.
467
+
468
+ - **Add comment** (toolbar Insert group and Insert → Comment) wraps the selection or marks the selected image, then opens the comment panel.
469
+ - **Show/Hide comments** (View menu and View icon group) toggles highlight styling only; thread data and anchors remain.
470
+ - **`commentAuthor`** (`{ userId, userName }`) is required to enable Post in the panel.
471
+
472
+ **Sanitized HTML:** export `stripCommentAnchors` from the package to remove comment-only spans and attributes for published document HTML:
473
+
474
+ ```tsx
475
+ import { Editor, stripCommentAnchors } from 'commspliant-html-editor'
476
+
477
+ // Editor HTML may include anchors:
478
+ // <p>Price was <span data-comment-thread="cmt_…">£150</span> last week.</p>
479
+
480
+ const clean = stripCommentAnchors(html)
481
+ // <p>Price was £150 last week.</p>
482
+ ```
483
+
484
+ **Read-only documents:** with `readOnly` and `enableComments`, users can still add and reply to comments. Anchor DOM updates fire `onCommentsChange` only — not `onChange`. Supply `value` and `comments` on load; the editor re-applies anchors for highlights.
485
+
486
+ ```tsx
487
+ import { useState } from 'react'
488
+ import { Editor, type CommentThread } from 'commspliant-html-editor'
489
+
490
+ export function ReviewEditor() {
491
+ const [comments, setComments] = useState<CommentThread[]>([])
492
+
493
+ return (
494
+ <Editor
495
+ value="<p>Immutable version</p>"
496
+ readOnly
497
+ enableComments
498
+ commentAuthor={{ userId: 'u1', userName: 'Reviewer' }}
499
+ comments={comments}
500
+ onCommentsChange={setComments}
501
+ />
502
+ )
503
+ }
504
+ ```
505
+
332
506
  ### Custom actions
333
507
 
334
508
  Pass a `customActions` array to add host buttons, menu items, or both. Labels and tooltips are your copy — the library does not translate them.
@@ -426,6 +600,88 @@ Omit `customImagePicker` to keep File and URL only. Set `disableBuiltinImageInse
426
600
 
427
601
  `insertImage` uses the same insert path as File and URL: an `<img>` with inline `max-width: 100%; height: auto`, then any host `css`. `src` must be `http(s)`, a relative path, or a raster `data:` URL.
428
602
 
603
+ `onPick` from Page properties (Edit → Page → Page properties → Background Image) leaves the editor dialog open so the picked URL can fill the draft. If your picker is a modal overlay, give it a `z-index` above editor dialogs (`1200`).
604
+
605
+ ### Custom audio picker
606
+
607
+ Pass `customAudioPicker` to add a third Insert audio source. Labels are your copy — the library does not translate them. When the host finishes picking, call the `insertAudio` function received by `onPick`.
608
+
609
+ ```tsx
610
+ import { Editor, type CustomAudioPicker } from 'commspliant-html-editor'
611
+
612
+ const library: CustomAudioPicker = {
613
+ text: 'Library',
614
+ description: 'Choose from your audio library.',
615
+ buttonCaption: 'Open library',
616
+ onPick: (insertAudio) => {
617
+ openHostLibrary().then((picked) => {
618
+ insertAudio({
619
+ src: picked.url,
620
+ title: picked.title,
621
+ css: 'width: 100%',
622
+ })
623
+ })
624
+ },
625
+ }
626
+
627
+ <Editor customAudioPicker={library} />
628
+ ```
629
+
630
+ | Field | Type | Description |
631
+ | --- | --- | --- |
632
+ | `text` | `string` | Third source / navigation button label |
633
+ | `description` | `string` | Shown on the custom source panel |
634
+ | `buttonCaption` | `string` | Caption of the button that starts the host picker |
635
+ | `onPick` | `(insertAudio) => void` | Called when that button is clicked. Call `insertAudio` with a URL or audio `data:` URL, plus optional `title` and inline `css` |
636
+
637
+ Omit `customAudioPicker` to keep File and URL only. Set `disableBuiltinAudioInsert` to skip the dialog: Insert → Audio calls `onPick` immediately.
638
+
639
+ ```tsx
640
+ <Editor customAudioPicker={library} disableBuiltinAudioInsert />
641
+ ```
642
+
643
+ `insertAudio` uses the same insert path as File and URL: an `<audio controls>` with inline `max-width: 100%`, then any host `css`. `src` must be `http(s)`, a relative path, or an audio `data:` URL.
644
+
645
+ ### Custom video picker
646
+
647
+ Pass `customVideoPicker` to add a third Insert YouTube video source. Labels are your copy — the library does not translate them. When the host finishes picking, call the `insertVideo` function received by `onPick`.
648
+
649
+ ```tsx
650
+ import { Editor, type CustomVideoPicker } from 'commspliant-html-editor'
651
+
652
+ const library: CustomVideoPicker = {
653
+ text: 'Library',
654
+ description: 'Choose from your video library.',
655
+ buttonCaption: 'Open library',
656
+ onPick: (insertVideo) => {
657
+ openHostLibrary().then((picked) => {
658
+ insertVideo({
659
+ src: picked.url,
660
+ title: picked.title,
661
+ css: 'max-width: 100%',
662
+ })
663
+ })
664
+ },
665
+ }
666
+
667
+ <Editor customVideoPicker={library} />
668
+ ```
669
+
670
+ | Field | Type | Description |
671
+ | --- | --- | --- |
672
+ | `text` | `string` | Third source / navigation button label |
673
+ | `description` | `string` | Shown on the custom source panel |
674
+ | `buttonCaption` | `string` | Caption of the button that starts the host picker |
675
+ | `onPick` | `(insertVideo) => void` | Called when that button is clicked. Call `insertVideo` when the host picker finishes |
676
+
677
+ Omit `customVideoPicker` to keep URL only. Set `disableBuiltinVideoInsert` to skip the dialog: Insert → YouTube video calls `onPick` immediately.
678
+
679
+ ```tsx
680
+ <Editor customVideoPicker={library} disableBuiltinVideoInsert />
681
+ ```
682
+
683
+ The built-in dialog accepts YouTube watch, embed, shorts, and `youtu.be` URLs and inserts an `<iframe>` embed with inline sizing. From the host picker, a YouTube URL inserts the same iframe; other `http(s)` video URLs insert a `<video controls>` element. Both use inline styles in the serialized HTML.
684
+
429
685
  ### Customize toolbar
430
686
 
431
687
  View → Toolbar → Customize toolbar shows every icon-toolbar group (or only the items in `allowedChrome.toolbar` when that list is set). Uncheck an item to hide it on the icon toolbar (menus stay the same). Drag groups — not individual buttons — to reorder them. Full screen stays pinned last. Reset restores the library default.
package/dist/404.html ADDED
@@ -0,0 +1,19 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>HTML editor Playground</title>
7
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
8
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
9
+ <link
10
+ href="https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,500;0,8..60,600;0,8..60,700;1,8..60,400&family=Inter:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap"
11
+ rel="stylesheet"
12
+ />
13
+ <script type="module" crossorigin src="/assets/index-8mpvnzOy.js"></script>
14
+ <link rel="stylesheet" crossorigin href="/assets/index-Cu8klpl0.css">
15
+ </head>
16
+ <body>
17
+ <div id="root"></div>
18
+ </body>
19
+ </html>