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.
- package/README.md +263 -7
- package/dist/404.html +19 -0
- package/dist/assets/index-8mpvnzOy.js +375 -0
- package/dist/assets/index-Cu8klpl0.css +1 -0
- package/dist/index.html +19 -0
- package/dist/logo.svg +314 -0
- package/package.json +7 -3
- package/dist/chrome/ChromeTheme.d.ts +0 -14
- package/dist/chrome/ChromeTheme.d.ts.map +0 -1
- package/dist/commspliant-html-editor.css +0 -1
- package/dist/components/Editor.d.ts +0 -3
- package/dist/components/Editor.d.ts.map +0 -1
- package/dist/components/HtmlSurface.d.ts +0 -9
- package/dist/components/HtmlSurface.d.ts.map +0 -1
- package/dist/components/VisualSurface.d.ts +0 -13
- package/dist/components/VisualSurface.d.ts.map +0 -1
- package/dist/core/blockFormat.d.ts +0 -10
- package/dist/core/blockFormat.d.ts.map +0 -1
- package/dist/core/blocks.d.ts +0 -19
- package/dist/core/blocks.d.ts.map +0 -1
- package/dist/core/bookmark.d.ts +0 -10
- package/dist/core/bookmark.d.ts.map +0 -1
- package/dist/core/cellProperties.d.ts +0 -18
- package/dist/core/cellProperties.d.ts.map +0 -1
- package/dist/core/clearFormatting.d.ts +0 -2
- package/dist/core/clearFormatting.d.ts.map +0 -1
- package/dist/core/clipboard.d.ts +0 -9
- package/dist/core/clipboard.d.ts.map +0 -1
- package/dist/core/commandTypes.d.ts +0 -251
- package/dist/core/commandTypes.d.ts.map +0 -1
- package/dist/core/commands.d.ts +0 -5
- package/dist/core/commands.d.ts.map +0 -1
- package/dist/core/cssLength.d.ts +0 -13
- package/dist/core/cssLength.d.ts.map +0 -1
- package/dist/core/customActions.d.ts +0 -12
- package/dist/core/customActions.d.ts.map +0 -1
- package/dist/core/documentStyles.d.ts +0 -4
- package/dist/core/documentStyles.d.ts.map +0 -1
- package/dist/core/fontFamily.d.ts +0 -40
- package/dist/core/fontFamily.d.ts.map +0 -1
- package/dist/core/fontSize.d.ts +0 -25
- package/dist/core/fontSize.d.ts.map +0 -1
- package/dist/core/fontSizeUnits.d.ts +0 -29
- package/dist/core/fontSizeUnits.d.ts.map +0 -1
- package/dist/core/horizontalRule.d.ts +0 -4
- package/dist/core/horizontalRule.d.ts.map +0 -1
- package/dist/core/image.d.ts +0 -19
- package/dist/core/image.d.ts.map +0 -1
- package/dist/core/imageProperties.d.ts +0 -35
- package/dist/core/imageProperties.d.ts.map +0 -1
- package/dist/core/imageResize.d.ts +0 -18
- package/dist/core/imageResize.d.ts.map +0 -1
- package/dist/core/imageSize.d.ts +0 -23
- package/dist/core/imageSize.d.ts.map +0 -1
- package/dist/core/indent.d.ts +0 -7
- package/dist/core/indent.d.ts.map +0 -1
- package/dist/core/inlineColor.d.ts +0 -23
- package/dist/core/inlineColor.d.ts.map +0 -1
- package/dist/core/inlineRange.d.ts +0 -10
- package/dist/core/inlineRange.d.ts.map +0 -1
- package/dist/core/link.d.ts +0 -18
- package/dist/core/link.d.ts.map +0 -1
- package/dist/core/lists.d.ts +0 -12
- package/dist/core/lists.d.ts.map +0 -1
- package/dist/core/marks.d.ts +0 -18
- package/dist/core/marks.d.ts.map +0 -1
- package/dist/core/page.d.ts +0 -8
- package/dist/core/page.d.ts.map +0 -1
- package/dist/core/pageProperties.d.ts +0 -7
- package/dist/core/pageProperties.d.ts.map +0 -1
- package/dist/core/paragraphBox.d.ts +0 -82
- package/dist/core/paragraphBox.d.ts.map +0 -1
- package/dist/core/paragraphProperties.d.ts +0 -17
- package/dist/core/paragraphProperties.d.ts.map +0 -1
- package/dist/core/rowProperties.d.ts +0 -17
- package/dist/core/rowProperties.d.ts.map +0 -1
- package/dist/core/selection.d.ts +0 -25
- package/dist/core/selection.d.ts.map +0 -1
- package/dist/core/table.d.ts +0 -28
- package/dist/core/table.d.ts.map +0 -1
- package/dist/core/tableProperties.d.ts +0 -18
- package/dist/core/tableProperties.d.ts.map +0 -1
- package/dist/core/textAlign.d.ts +0 -9
- package/dist/core/textAlign.d.ts.map +0 -1
- package/dist/hooks/useAutoSave.d.ts +0 -9
- package/dist/hooks/useAutoSave.d.ts.map +0 -1
- package/dist/hooks/useControllableState.d.ts +0 -8
- package/dist/hooks/useControllableState.d.ts.map +0 -1
- package/dist/i18n/LocaleProvider.d.ts +0 -11
- package/dist/i18n/LocaleProvider.d.ts.map +0 -1
- package/dist/i18n/en.d.ts +0 -3
- package/dist/i18n/en.d.ts.map +0 -1
- package/dist/i18n/es.d.ts +0 -3
- package/dist/i18n/es.d.ts.map +0 -1
- package/dist/i18n/types.d.ts +0 -367
- package/dist/i18n/types.d.ts.map +0 -1
- package/dist/icons/AlignCenterIcon.d.ts +0 -3
- package/dist/icons/AlignCenterIcon.d.ts.map +0 -1
- package/dist/icons/AlignJustifyIcon.d.ts +0 -3
- package/dist/icons/AlignJustifyIcon.d.ts.map +0 -1
- package/dist/icons/AlignLeftIcon.d.ts +0 -3
- package/dist/icons/AlignLeftIcon.d.ts.map +0 -1
- package/dist/icons/AlignRightIcon.d.ts +0 -3
- package/dist/icons/AlignRightIcon.d.ts.map +0 -1
- package/dist/icons/BoldIcon.d.ts +0 -3
- package/dist/icons/BoldIcon.d.ts.map +0 -1
- package/dist/icons/BookmarkIcon.d.ts +0 -3
- package/dist/icons/BookmarkIcon.d.ts.map +0 -1
- package/dist/icons/BulletListIcon.d.ts +0 -3
- package/dist/icons/BulletListIcon.d.ts.map +0 -1
- package/dist/icons/CellPropertiesIcon.d.ts +0 -3
- package/dist/icons/CellPropertiesIcon.d.ts.map +0 -1
- package/dist/icons/ClearFormattingIcon.d.ts +0 -3
- package/dist/icons/ClearFormattingIcon.d.ts.map +0 -1
- package/dist/icons/CloseIcon.d.ts +0 -3
- package/dist/icons/CloseIcon.d.ts.map +0 -1
- package/dist/icons/CommspliantShieldIcon.d.ts +0 -3
- package/dist/icons/CommspliantShieldIcon.d.ts.map +0 -1
- package/dist/icons/CustomActionIcon.d.ts +0 -3
- package/dist/icons/CustomActionIcon.d.ts.map +0 -1
- package/dist/icons/CustomizeToolbarIcon.d.ts +0 -3
- package/dist/icons/CustomizeToolbarIcon.d.ts.map +0 -1
- package/dist/icons/DarkModeIcon.d.ts +0 -3
- package/dist/icons/DarkModeIcon.d.ts.map +0 -1
- package/dist/icons/FontColorIcon.d.ts +0 -3
- package/dist/icons/FontColorIcon.d.ts.map +0 -1
- package/dist/icons/FontFamilyIcon.d.ts +0 -3
- package/dist/icons/FontFamilyIcon.d.ts.map +0 -1
- package/dist/icons/FontPropertiesIcon.d.ts +0 -3
- package/dist/icons/FontPropertiesIcon.d.ts.map +0 -1
- package/dist/icons/FontSizeIcon.d.ts +0 -3
- package/dist/icons/FontSizeIcon.d.ts.map +0 -1
- package/dist/icons/FullscreenIcon.d.ts +0 -3
- package/dist/icons/FullscreenIcon.d.ts.map +0 -1
- package/dist/icons/HighlightColorIcon.d.ts +0 -3
- package/dist/icons/HighlightColorIcon.d.ts.map +0 -1
- package/dist/icons/HorizontalRuleIcon.d.ts +0 -3
- package/dist/icons/HorizontalRuleIcon.d.ts.map +0 -1
- package/dist/icons/HtmlIcon.d.ts +0 -3
- package/dist/icons/HtmlIcon.d.ts.map +0 -1
- package/dist/icons/ImageIcon.d.ts +0 -3
- package/dist/icons/ImageIcon.d.ts.map +0 -1
- package/dist/icons/IndentIcon.d.ts +0 -3
- package/dist/icons/IndentIcon.d.ts.map +0 -1
- package/dist/icons/ItalicIcon.d.ts +0 -3
- package/dist/icons/ItalicIcon.d.ts.map +0 -1
- package/dist/icons/LightModeIcon.d.ts +0 -3
- package/dist/icons/LightModeIcon.d.ts.map +0 -1
- package/dist/icons/LinkIcon.d.ts +0 -3
- package/dist/icons/LinkIcon.d.ts.map +0 -1
- package/dist/icons/MenuIcon.d.ts +0 -3
- package/dist/icons/MenuIcon.d.ts.map +0 -1
- package/dist/icons/NumberedListIcon.d.ts +0 -3
- package/dist/icons/NumberedListIcon.d.ts.map +0 -1
- package/dist/icons/OpenIcon.d.ts +0 -3
- package/dist/icons/OpenIcon.d.ts.map +0 -1
- package/dist/icons/OutdentIcon.d.ts +0 -3
- package/dist/icons/OutdentIcon.d.ts.map +0 -1
- package/dist/icons/PagePropertiesIcon.d.ts +0 -3
- package/dist/icons/PagePropertiesIcon.d.ts.map +0 -1
- package/dist/icons/ParagraphPropertiesIcon.d.ts +0 -3
- package/dist/icons/ParagraphPropertiesIcon.d.ts.map +0 -1
- package/dist/icons/ParagraphStyleIcon.d.ts +0 -3
- package/dist/icons/ParagraphStyleIcon.d.ts.map +0 -1
- package/dist/icons/PlusIcon.d.ts +0 -3
- package/dist/icons/PlusIcon.d.ts.map +0 -1
- package/dist/icons/PreviewIcon.d.ts +0 -3
- package/dist/icons/PreviewIcon.d.ts.map +0 -1
- package/dist/icons/PrintIcon.d.ts +0 -3
- package/dist/icons/PrintIcon.d.ts.map +0 -1
- package/dist/icons/RedoIcon.d.ts +0 -3
- package/dist/icons/RedoIcon.d.ts.map +0 -1
- package/dist/icons/RowPropertiesIcon.d.ts +0 -3
- package/dist/icons/RowPropertiesIcon.d.ts.map +0 -1
- package/dist/icons/SaveIcon.d.ts +0 -3
- package/dist/icons/SaveIcon.d.ts.map +0 -1
- package/dist/icons/StrikethroughIcon.d.ts +0 -3
- package/dist/icons/StrikethroughIcon.d.ts.map +0 -1
- package/dist/icons/TableColumnIcon.d.ts +0 -3
- package/dist/icons/TableColumnIcon.d.ts.map +0 -1
- package/dist/icons/TableIcon.d.ts +0 -3
- package/dist/icons/TableIcon.d.ts.map +0 -1
- package/dist/icons/TableRowIcon.d.ts +0 -3
- package/dist/icons/TableRowIcon.d.ts.map +0 -1
- package/dist/icons/UnderlineIcon.d.ts +0 -3
- package/dist/icons/UnderlineIcon.d.ts.map +0 -1
- package/dist/icons/UndoIcon.d.ts +0 -3
- package/dist/icons/UndoIcon.d.ts.map +0 -1
- package/dist/icons/VisualIcon.d.ts +0 -3
- package/dist/icons/VisualIcon.d.ts.map +0 -1
- package/dist/icons/index.d.ts +0 -49
- package/dist/icons/index.d.ts.map +0 -1
- package/dist/icons/types.d.ts +0 -4
- package/dist/icons/types.d.ts.map +0 -1
- package/dist/index.cjs +0 -92
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -14313
- package/dist/modules/contextMenu/ContextMenu.d.ts +0 -13
- package/dist/modules/contextMenu/ContextMenu.d.ts.map +0 -1
- package/dist/modules/contextMenu/commands.d.ts +0 -3
- package/dist/modules/contextMenu/commands.d.ts.map +0 -1
- package/dist/modules/contextMenu/index.d.ts +0 -5
- package/dist/modules/contextMenu/index.d.ts.map +0 -1
- package/dist/modules/contextMenu/shouldOpenEditorContextMenu.d.ts +0 -6
- package/dist/modules/contextMenu/shouldOpenEditorContextMenu.d.ts.map +0 -1
- package/dist/modules/file/catalog.d.ts +0 -3
- package/dist/modules/file/catalog.d.ts.map +0 -1
- package/dist/modules/file/commands.d.ts +0 -3
- package/dist/modules/file/commands.d.ts.map +0 -1
- package/dist/modules/file/fileDialogs.d.ts +0 -3
- package/dist/modules/file/fileDialogs.d.ts.map +0 -1
- package/dist/modules/file/htmlFile.d.ts +0 -5
- package/dist/modules/file/htmlFile.d.ts.map +0 -1
- package/dist/modules/file/index.d.ts +0 -4
- package/dist/modules/file/index.d.ts.map +0 -1
- package/dist/modules/file/printHtml.d.ts +0 -2
- package/dist/modules/file/printHtml.d.ts.map +0 -1
- package/dist/modules/file/useHtmlFileDrop.d.ts +0 -14
- package/dist/modules/file/useHtmlFileDrop.d.ts.map +0 -1
- package/dist/modules/format/ColorField.d.ts +0 -11
- package/dist/modules/format/ColorField.d.ts.map +0 -1
- package/dist/modules/format/ColorPicker.d.ts +0 -13
- package/dist/modules/format/ColorPicker.d.ts.map +0 -1
- package/dist/modules/format/ColorSelect.d.ts +0 -16
- package/dist/modules/format/ColorSelect.d.ts.map +0 -1
- package/dist/modules/format/CustomParagraphStyleDialog.d.ts +0 -21
- package/dist/modules/format/CustomParagraphStyleDialog.d.ts.map +0 -1
- package/dist/modules/format/FontColorSelect.d.ts +0 -3
- package/dist/modules/format/FontColorSelect.d.ts.map +0 -1
- package/dist/modules/format/FontFamilyList.d.ts +0 -16
- package/dist/modules/format/FontFamilyList.d.ts.map +0 -1
- package/dist/modules/format/FontFamilySelect.d.ts +0 -15
- package/dist/modules/format/FontFamilySelect.d.ts.map +0 -1
- package/dist/modules/format/FontPropertiesDialog.d.ts +0 -24
- package/dist/modules/format/FontPropertiesDialog.d.ts.map +0 -1
- package/dist/modules/format/FontPropertiesFields.d.ts +0 -12
- package/dist/modules/format/FontPropertiesFields.d.ts.map +0 -1
- package/dist/modules/format/FontSizeCombobox.d.ts +0 -13
- package/dist/modules/format/FontSizeCombobox.d.ts.map +0 -1
- package/dist/modules/format/FontSizeSelect.d.ts +0 -3
- package/dist/modules/format/FontSizeSelect.d.ts.map +0 -1
- package/dist/modules/format/HighlightColorSelect.d.ts +0 -4
- package/dist/modules/format/HighlightColorSelect.d.ts.map +0 -1
- package/dist/modules/format/LengthField.d.ts +0 -12
- package/dist/modules/format/LengthField.d.ts.map +0 -1
- package/dist/modules/format/PagePropertiesDialog.d.ts +0 -14
- package/dist/modules/format/PagePropertiesDialog.d.ts.map +0 -1
- package/dist/modules/format/ParagraphPropertiesDialog.d.ts +0 -12
- package/dist/modules/format/ParagraphPropertiesDialog.d.ts.map +0 -1
- package/dist/modules/format/ParagraphPropertiesFields.d.ts +0 -13
- package/dist/modules/format/ParagraphPropertiesFields.d.ts.map +0 -1
- package/dist/modules/format/ParagraphStyleList.d.ts +0 -22
- package/dist/modules/format/ParagraphStyleList.d.ts.map +0 -1
- package/dist/modules/format/ParagraphStyleSelect.d.ts +0 -4
- package/dist/modules/format/ParagraphStyleSelect.d.ts.map +0 -1
- package/dist/modules/format/ShadowFields.d.ts +0 -8
- package/dist/modules/format/ShadowFields.d.ts.map +0 -1
- package/dist/modules/format/catalog.d.ts +0 -3
- package/dist/modules/format/catalog.d.ts.map +0 -1
- package/dist/modules/format/colorModel.d.ts +0 -22
- package/dist/modules/format/colorModel.d.ts.map +0 -1
- package/dist/modules/format/colorPalette.d.ts +0 -3
- package/dist/modules/format/colorPalette.d.ts.map +0 -1
- package/dist/modules/format/commands.d.ts +0 -4
- package/dist/modules/format/commands.d.ts.map +0 -1
- package/dist/modules/format/fontDialog.d.ts +0 -9
- package/dist/modules/format/fontDialog.d.ts.map +0 -1
- package/dist/modules/format/fontSize.d.ts +0 -2
- package/dist/modules/format/fontSize.d.ts.map +0 -1
- package/dist/modules/format/index.d.ts +0 -3
- package/dist/modules/format/index.d.ts.map +0 -1
- package/dist/modules/format/pageDialog.d.ts +0 -9
- package/dist/modules/format/pageDialog.d.ts.map +0 -1
- package/dist/modules/format/paragraphDialog.d.ts +0 -9
- package/dist/modules/format/paragraphDialog.d.ts.map +0 -1
- package/dist/modules/history/catalog.d.ts +0 -3
- package/dist/modules/history/catalog.d.ts.map +0 -1
- package/dist/modules/history/commands.d.ts +0 -4
- package/dist/modules/history/commands.d.ts.map +0 -1
- package/dist/modules/history/history.d.ts +0 -15
- package/dist/modules/history/history.d.ts.map +0 -1
- package/dist/modules/history/index.d.ts +0 -5
- package/dist/modules/history/index.d.ts.map +0 -1
- package/dist/modules/insert/BookmarkDialog.d.ts +0 -9
- package/dist/modules/insert/BookmarkDialog.d.ts.map +0 -1
- package/dist/modules/insert/ImageDialog.d.ts +0 -12
- package/dist/modules/insert/ImageDialog.d.ts.map +0 -1
- package/dist/modules/insert/ImagePropertiesDialog.d.ts +0 -13
- package/dist/modules/insert/ImagePropertiesDialog.d.ts.map +0 -1
- package/dist/modules/insert/ImagePropertiesFields.d.ts +0 -11
- package/dist/modules/insert/ImagePropertiesFields.d.ts.map +0 -1
- package/dist/modules/insert/ImageResizeOverlay.d.ts +0 -7
- package/dist/modules/insert/ImageResizeOverlay.d.ts.map +0 -1
- package/dist/modules/insert/ImageSizeField.d.ts +0 -10
- package/dist/modules/insert/ImageSizeField.d.ts.map +0 -1
- package/dist/modules/insert/LinkDialog.d.ts +0 -22
- package/dist/modules/insert/LinkDialog.d.ts.map +0 -1
- package/dist/modules/insert/catalog.d.ts +0 -3
- package/dist/modules/insert/catalog.d.ts.map +0 -1
- package/dist/modules/insert/commands.d.ts +0 -4
- package/dist/modules/insert/commands.d.ts.map +0 -1
- package/dist/modules/insert/imagePropertiesDialog.d.ts +0 -9
- package/dist/modules/insert/imagePropertiesDialog.d.ts.map +0 -1
- package/dist/modules/insert/index.d.ts +0 -3
- package/dist/modules/insert/index.d.ts.map +0 -1
- package/dist/modules/table/CellPropertiesDialog.d.ts +0 -10
- package/dist/modules/table/CellPropertiesDialog.d.ts.map +0 -1
- package/dist/modules/table/CellPropertiesFields.d.ts +0 -8
- package/dist/modules/table/CellPropertiesFields.d.ts.map +0 -1
- package/dist/modules/table/RowPropertiesDialog.d.ts +0 -10
- package/dist/modules/table/RowPropertiesDialog.d.ts.map +0 -1
- package/dist/modules/table/RowPropertiesFields.d.ts +0 -8
- package/dist/modules/table/RowPropertiesFields.d.ts.map +0 -1
- package/dist/modules/table/TableDialog.d.ts +0 -9
- package/dist/modules/table/TableDialog.d.ts.map +0 -1
- package/dist/modules/table/TablePropertiesDialog.d.ts +0 -10
- package/dist/modules/table/TablePropertiesDialog.d.ts.map +0 -1
- package/dist/modules/table/TablePropertiesFields.d.ts +0 -8
- package/dist/modules/table/TablePropertiesFields.d.ts.map +0 -1
- package/dist/modules/table/catalog.d.ts +0 -3
- package/dist/modules/table/catalog.d.ts.map +0 -1
- package/dist/modules/table/commands.d.ts +0 -4
- package/dist/modules/table/commands.d.ts.map +0 -1
- package/dist/modules/table/index.d.ts +0 -3
- package/dist/modules/table/index.d.ts.map +0 -1
- package/dist/modules/view/DocumentPreviewDialog.d.ts +0 -7
- package/dist/modules/view/DocumentPreviewDialog.d.ts.map +0 -1
- package/dist/modules/view/catalog.d.ts +0 -3
- package/dist/modules/view/catalog.d.ts.map +0 -1
- package/dist/modules/view/commands.d.ts +0 -4
- package/dist/modules/view/commands.d.ts.map +0 -1
- package/dist/modules/view/darkModePersistence.d.ts +0 -5
- package/dist/modules/view/darkModePersistence.d.ts.map +0 -1
- package/dist/modules/view/index.d.ts +0 -3
- package/dist/modules/view/index.d.ts.map +0 -1
- package/dist/modules/view/toolbarPositionPersistence.d.ts +0 -6
- package/dist/modules/view/toolbarPositionPersistence.d.ts.map +0 -1
- package/dist/toolbar/CustomizeToolbarDialog.d.ts +0 -16
- package/dist/toolbar/CustomizeToolbarDialog.d.ts.map +0 -1
- package/dist/toolbar/EditorToolbar.d.ts +0 -16
- package/dist/toolbar/EditorToolbar.d.ts.map +0 -1
- package/dist/toolbar/IconNav.d.ts +0 -12
- package/dist/toolbar/IconNav.d.ts.map +0 -1
- package/dist/toolbar/MenuBar.d.ts +0 -18
- package/dist/toolbar/MenuBar.d.ts.map +0 -1
- package/dist/toolbar/Tooltip.d.ts +0 -11
- package/dist/toolbar/Tooltip.d.ts.map +0 -1
- package/dist/toolbar/allowedChrome.d.ts +0 -4
- package/dist/toolbar/allowedChrome.d.ts.map +0 -1
- package/dist/toolbar/defaultCatalog.d.ts +0 -4
- package/dist/toolbar/defaultCatalog.d.ts.map +0 -1
- package/dist/toolbar/defaultLayout.d.ts +0 -3
- package/dist/toolbar/defaultLayout.d.ts.map +0 -1
- package/dist/toolbar/index.d.ts +0 -10
- package/dist/toolbar/index.d.ts.map +0 -1
- package/dist/toolbar/resolveChrome.d.ts +0 -12
- package/dist/toolbar/resolveChrome.d.ts.map +0 -1
- package/dist/toolbar/toolbarCustomization.d.ts +0 -14
- package/dist/toolbar/toolbarCustomization.d.ts.map +0 -1
- package/dist/toolbar/types.d.ts +0 -65
- package/dist/toolbar/types.d.ts.map +0 -1
- package/dist/types.d.ts +0 -263
- 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
|
+
[](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,
|
|
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
|
|
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("https://example.com/bg.png");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
|
-
|
|
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>
|