@aquera/nile-elements 1.9.6 → 1.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/index-178e1e57.cjs.js +2 -0
- package/dist/index-178e1e57.cjs.js.map +1 -0
- package/dist/index-1faa963c.esm.js +1 -0
- package/dist/index-249de90a.esm.js +1 -0
- package/dist/index-353172ed.esm.js +1 -0
- package/dist/index-6f3fa4ab.esm.js +1 -0
- package/dist/index-89c520e9.cjs.js +5 -0
- package/dist/index-89c520e9.cjs.js.map +1 -0
- package/dist/index-920675c4.esm.js +1 -0
- package/dist/index-b387a9f4.cjs.js +2 -0
- package/dist/index-b387a9f4.cjs.js.map +1 -0
- package/dist/index-cc1385e0.cjs.js +2 -0
- package/dist/index-cc1385e0.cjs.js.map +1 -0
- package/dist/index-dedc38a6.esm.js +1 -0
- package/dist/index-df196058.cjs.js +2 -0
- package/dist/index-df196058.cjs.js.map +1 -0
- package/dist/index-f956f56d.cjs.js +7 -0
- package/dist/index-f956f56d.cjs.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +3595 -629
- package/dist/internal/glyph.cjs.js +2 -0
- package/dist/internal/glyph.cjs.js.map +1 -0
- package/dist/internal/glyph.esm.js +5 -0
- package/dist/nile-auto-complete/index.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -1
- package/dist/nile-auto-complete/portal-manager.cjs.js +1 -1
- package/dist/nile-auto-complete/portal-utils.cjs.js +1 -1
- package/dist/nile-code-editor/extensionSetup.cjs.js +7 -7
- package/dist/nile-code-editor/extensionSetup.cjs.js.map +1 -1
- package/dist/nile-code-editor/extensionSetup.esm.js +1 -1
- package/dist/nile-code-editor/index.cjs.js +1 -1
- package/dist/nile-code-editor/index.esm.js +1 -1
- package/dist/nile-code-editor/nile-code-editor.cjs.js +2 -2
- package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
- package/dist/nile-code-editor/nile-code-editor.esm.js +1 -1
- package/dist/nile-color-picker/index.cjs.js +1 -1
- package/dist/nile-color-picker/nile-color-picker.cjs.js +1 -1
- package/dist/nile-combobox/index.cjs.js +1 -1
- package/dist/nile-combobox/index.esm.js +1 -1
- package/dist/nile-combobox/nile-combobox.cjs.js +1 -1
- package/dist/nile-combobox/nile-combobox.esm.js +1 -1
- package/dist/nile-combobox/portal-manager.cjs.js +1 -1
- package/dist/nile-context-menu/index.cjs.js +1 -1
- package/dist/nile-context-menu/nile-context-menu.cjs.js +1 -1
- package/dist/nile-context-submenu/index.cjs.js +1 -1
- package/dist/nile-context-submenu/nile-context-submenu.cjs.js +1 -1
- package/dist/nile-detail/index.cjs.js +1 -1
- package/dist/nile-detail/index.esm.js +1 -1
- package/dist/nile-detail/nile-detail.cjs.js +1 -1
- package/dist/nile-detail/nile-detail.esm.js +1 -1
- package/dist/nile-dropdown/index.cjs.js +1 -1
- package/dist/nile-dropdown/nile-dropdown.cjs.js +1 -1
- package/dist/nile-dropdown/portal-manager.cjs.js +1 -1
- package/dist/nile-file-upload/index.cjs.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.cjs.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.template.cjs.js +1 -1
- package/dist/nile-floating-panel/index.cjs.js +1 -1
- package/dist/nile-floating-panel/nile-floating-panel.cjs.js +1 -1
- package/dist/nile-lite-tooltip/index.cjs.js +1 -1
- package/dist/nile-lite-tooltip/nile-lite-tooltip.cjs.js +1 -1
- package/dist/nile-markdown-editor/index.cjs.js +1 -1
- package/dist/nile-markdown-editor/nile-markdown-editor.cjs.js +1 -1
- package/dist/nile-popover/index.cjs.js +1 -1
- package/dist/nile-popover/nile-popover.cjs.js +1 -1
- package/dist/nile-popover/portal-manager.cjs.js +1 -1
- package/dist/nile-popup/index.cjs.js +1 -1
- package/dist/nile-popup/nile-popup.cjs.js +1 -1
- package/dist/nile-select/index.cjs.js +1 -1
- package/dist/nile-select/nile-select.cjs.js +1 -1
- package/dist/nile-select/portal-manager.cjs.js +1 -1
- package/dist/nile-side-bar-action/index.cjs.js +1 -1
- package/dist/nile-side-bar-action/nile-side-bar-action.cjs.js +1 -1
- package/dist/nile-side-bar-action/portal-manager.cjs.js +1 -1
- package/dist/nile-tooltip/index.cjs.js +1 -1
- package/dist/nile-tooltip/nile-tooltip.cjs.js +1 -1
- package/dist/nile-virtual-select/index.cjs.js +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.cjs.js +1 -1
- package/dist/nile-virtual-select/portal-manager.cjs.js +1 -1
- package/dist/nile-virtual-select/renderer.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/emoji.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/emoji.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/emoji.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/commands.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/commands.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/commands.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/create-state.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/create-state.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/create-state.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/export.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/export.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/export.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/index.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/index.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/index.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/inputrules.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/inputrules.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/inputrules.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/keymap.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/keymap.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/keymap.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/markdown-parse.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/markdown-parse.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/markdown-parse.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/markdown.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/markdown.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/markdown.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/office-paste.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/office-paste.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/office-paste.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/embeds.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/embeds.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/embeds.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/format-painter.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/format-painter.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/format-painter.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/image-view.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/image-view.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/image-view.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/image.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/image.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/image.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/link.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/link.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/link.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/math-view.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/math-view.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/math-view.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/max-length.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/max-length.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/max-length.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/paste.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/paste.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/paste.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/single-line.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/single-line.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/single-line.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/tables.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/tables.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/tables.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/task-list.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/task-list.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/task-list.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/sanitize.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/sanitize.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/sanitize.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/schema.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/schema.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/schema.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/selection-state.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/selection-state.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/selection-state.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/serializer.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/serializer.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/serializer.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/index.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/index.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/index.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.esm.js +780 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.esm.js +97 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.esm.js +244 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.esm.js +137 -0
- package/dist/nile-wysiwyg-editor/types.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/types.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/types.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/ui/bookmark-panel.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/bookmark-panel.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/bookmark-panel.esm.js +97 -0
- package/dist/nile-wysiwyg-editor/ui/bubble-menu.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/bubble-menu.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/bubble-menu.esm.js +67 -0
- package/dist/nile-wysiwyg-editor/ui/code-block-menu.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/code-block-menu.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/code-block-menu.esm.js +65 -0
- package/dist/nile-wysiwyg-editor/ui/embed-menu.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/embed-menu.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/embed-menu.esm.js +64 -0
- package/dist/nile-wysiwyg-editor/ui/embed-panel.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/embed-panel.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/embed-panel.esm.js +68 -0
- package/dist/nile-wysiwyg-editor/ui/emoji-picker.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/emoji-picker.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/emoji-picker.esm.js +96 -0
- package/dist/nile-wysiwyg-editor/ui/find-replace.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/find-replace.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/find-replace.esm.js +112 -0
- package/dist/nile-wysiwyg-editor/ui/image-menu.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/image-menu.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/image-menu.esm.js +64 -0
- package/dist/nile-wysiwyg-editor/ui/image-panel.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/image-panel.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/image-panel.esm.js +171 -0
- package/dist/nile-wysiwyg-editor/ui/insert-menu.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/insert-menu.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/insert-menu.esm.js +90 -0
- package/dist/nile-wysiwyg-editor/ui/link-editor.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/link-editor.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/link-editor.esm.js +114 -0
- package/dist/nile-wysiwyg-editor/ui/markdown-panel.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/markdown-panel.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/markdown-panel.esm.js +80 -0
- package/dist/nile-wysiwyg-editor/ui/math-panel.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/math-panel.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/math-panel.esm.js +92 -0
- package/dist/nile-wysiwyg-editor/ui/shortcut-help.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/shortcut-help.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/shortcut-help.esm.js +147 -0
- package/dist/nile-wysiwyg-editor/ui/source-view.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/source-view.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/source-view.esm.js +79 -0
- package/dist/nile-wysiwyg-editor/ui/special-chars.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/special-chars.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/special-chars.esm.js +96 -0
- package/dist/nile-wysiwyg-editor/ui/suggest-list.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/suggest-list.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/suggest-list.esm.js +67 -0
- package/dist/nile-wysiwyg-editor/ui/table-grid-picker.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/table-grid-picker.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/table-grid-picker.esm.js +100 -0
- package/dist/nile-wysiwyg-editor/ui/table-menu.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/table-menu.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/table-menu.esm.js +58 -0
- package/dist/src/index.d.ts +24 -0
- package/dist/src/index.js +19 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/internal/glyph.d.ts +6 -0
- package/dist/src/internal/glyph.js +13 -0
- package/dist/src/internal/glyph.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/emoji.d.ts +5 -0
- package/dist/src/nile-wysiwyg-editor/emoji.js +138 -0
- package/dist/src/nile-wysiwyg-editor/emoji.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/commands.d.ts +69 -0
- package/dist/src/nile-wysiwyg-editor/engine/commands.js +863 -0
- package/dist/src/nile-wysiwyg-editor/engine/commands.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/create-state.d.ts +35 -0
- package/dist/src/nile-wysiwyg-editor/engine/create-state.js +67 -0
- package/dist/src/nile-wysiwyg-editor/engine/create-state.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/export.d.ts +38 -0
- package/dist/src/nile-wysiwyg-editor/engine/export.js +208 -0
- package/dist/src/nile-wysiwyg-editor/engine/export.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/export.test.d.ts +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/export.test.js +96 -0
- package/dist/src/nile-wysiwyg-editor/engine/export.test.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/index.d.ts +37 -0
- package/dist/src/nile-wysiwyg-editor/engine/index.js +29 -0
- package/dist/src/nile-wysiwyg-editor/engine/index.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/inputrules.d.ts +12 -0
- package/dist/src/nile-wysiwyg-editor/engine/inputrules.js +144 -0
- package/dist/src/nile-wysiwyg-editor/engine/inputrules.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/keymap.d.ts +15 -0
- package/dist/src/nile-wysiwyg-editor/engine/keymap.js +94 -0
- package/dist/src/nile-wysiwyg-editor/engine/keymap.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/markdown-parse.d.ts +22 -0
- package/dist/src/nile-wysiwyg-editor/engine/markdown-parse.js +287 -0
- package/dist/src/nile-wysiwyg-editor/engine/markdown-parse.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/markdown-parse.test.d.ts +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/markdown-parse.test.js +106 -0
- package/dist/src/nile-wysiwyg-editor/engine/markdown-parse.test.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/markdown.d.ts +10 -0
- package/dist/src/nile-wysiwyg-editor/engine/markdown.js +162 -0
- package/dist/src/nile-wysiwyg-editor/engine/markdown.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/office-paste.d.ts +13 -0
- package/dist/src/nile-wysiwyg-editor/engine/office-paste.js +182 -0
- package/dist/src/nile-wysiwyg-editor/engine/office-paste.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/code-highlight.d.ts +10 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/code-highlight.js +165 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/code-highlight.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/embed-view.d.ts +17 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/embed-view.js +69 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/embed-view.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/embeds.d.ts +17 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/embeds.js +96 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/embeds.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/find-replace.d.ts +26 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/find-replace.js +123 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/find-replace.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/format-painter.d.ts +28 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/format-painter.js +72 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/format-painter.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/image-view.d.ts +41 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/image-view.js +176 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/image-view.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/image.d.ts +15 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/image.js +64 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/image.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/link.d.ts +11 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/link.js +42 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/link.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/math-view.d.ts +18 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/math-view.js +46 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/math-view.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/max-length.d.ts +7 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/max-length.js +26 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/max-length.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/paste.d.ts +31 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/paste.js +55 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/paste.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/placeholder.d.ts +7 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/placeholder.js +25 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/placeholder.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/single-line.d.ts +10 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/single-line.js +48 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/single-line.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/suggestions.d.ts +29 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/suggestions.js +87 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/suggestions.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/tables.d.ts +8 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/tables.js +11 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/tables.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/task-list.d.ts +16 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/task-list.js +49 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/task-list.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/pm.test.d.ts +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/pm.test.js +883 -0
- package/dist/src/nile-wysiwyg-editor/engine/pm.test.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/productivity.test.d.ts +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/productivity.test.js +129 -0
- package/dist/src/nile-wysiwyg-editor/engine/productivity.test.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/sanitize.d.ts +13 -0
- package/dist/src/nile-wysiwyg-editor/engine/sanitize.js +155 -0
- package/dist/src/nile-wysiwyg-editor/engine/sanitize.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/schema.d.ts +20 -0
- package/dist/src/nile-wysiwyg-editor/engine/schema.js +823 -0
- package/dist/src/nile-wysiwyg-editor/engine/schema.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/selection-state.d.ts +70 -0
- package/dist/src/nile-wysiwyg-editor/engine/selection-state.js +138 -0
- package/dist/src/nile-wysiwyg-editor/engine/selection-state.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/serializer.d.ts +18 -0
- package/dist/src/nile-wysiwyg-editor/engine/serializer.js +63 -0
- package/dist/src/nile-wysiwyg-editor/engine/serializer.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/index.d.ts +3 -0
- package/dist/src/nile-wysiwyg-editor/index.js +3 -0
- package/dist/src/nile-wysiwyg-editor/index.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.d.ts +1 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.js +782 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.d.ts +364 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js +2038 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.d.ts +1 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.js +636 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.d.ts +1 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.js +2 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.d.ts +6 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.js +251 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.d.ts +41 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.js +700 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/types.d.ts +49 -0
- package/dist/src/nile-wysiwyg-editor/types.js +8 -0
- package/dist/src/nile-wysiwyg-editor/types.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/bookmark-panel.d.ts +20 -0
- package/dist/src/nile-wysiwyg-editor/ui/bookmark-panel.js +159 -0
- package/dist/src/nile-wysiwyg-editor/ui/bookmark-panel.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.d.ts +21 -0
- package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.js +125 -0
- package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/code-block-menu.d.ts +18 -0
- package/dist/src/nile-wysiwyg-editor/ui/code-block-menu.js +107 -0
- package/dist/src/nile-wysiwyg-editor/ui/code-block-menu.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/embed-menu.d.ts +19 -0
- package/dist/src/nile-wysiwyg-editor/ui/embed-menu.js +123 -0
- package/dist/src/nile-wysiwyg-editor/ui/embed-menu.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/embed-panel.d.ts +27 -0
- package/dist/src/nile-wysiwyg-editor/ui/embed-panel.js +146 -0
- package/dist/src/nile-wysiwyg-editor/ui/embed-panel.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/emoji-picker.d.ts +21 -0
- package/dist/src/nile-wysiwyg-editor/ui/emoji-picker.js +154 -0
- package/dist/src/nile-wysiwyg-editor/ui/emoji-picker.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/find-replace.d.ts +26 -0
- package/dist/src/nile-wysiwyg-editor/ui/find-replace.js +178 -0
- package/dist/src/nile-wysiwyg-editor/ui/find-replace.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/image-menu.d.ts +18 -0
- package/dist/src/nile-wysiwyg-editor/ui/image-menu.js +129 -0
- package/dist/src/nile-wysiwyg-editor/ui/image-menu.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/image-panel.d.ts +56 -0
- package/dist/src/nile-wysiwyg-editor/ui/image-panel.js +349 -0
- package/dist/src/nile-wysiwyg-editor/ui/image-panel.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/insert-menu.d.ts +25 -0
- package/dist/src/nile-wysiwyg-editor/ui/insert-menu.js +142 -0
- package/dist/src/nile-wysiwyg-editor/ui/insert-menu.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/link-editor.d.ts +30 -0
- package/dist/src/nile-wysiwyg-editor/ui/link-editor.js +189 -0
- package/dist/src/nile-wysiwyg-editor/ui/link-editor.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/markdown-panel.d.ts +24 -0
- package/dist/src/nile-wysiwyg-editor/ui/markdown-panel.js +144 -0
- package/dist/src/nile-wysiwyg-editor/ui/markdown-panel.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/math-panel.d.ts +31 -0
- package/dist/src/nile-wysiwyg-editor/ui/math-panel.js +172 -0
- package/dist/src/nile-wysiwyg-editor/ui/math-panel.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/shortcut-help.d.ts +30 -0
- package/dist/src/nile-wysiwyg-editor/ui/shortcut-help.js +296 -0
- package/dist/src/nile-wysiwyg-editor/ui/shortcut-help.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/source-view.d.ts +19 -0
- package/dist/src/nile-wysiwyg-editor/ui/source-view.js +120 -0
- package/dist/src/nile-wysiwyg-editor/ui/source-view.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/special-chars.d.ts +20 -0
- package/dist/src/nile-wysiwyg-editor/ui/special-chars.js +199 -0
- package/dist/src/nile-wysiwyg-editor/ui/special-chars.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/suggest-list.d.ts +31 -0
- package/dist/src/nile-wysiwyg-editor/ui/suggest-list.js +133 -0
- package/dist/src/nile-wysiwyg-editor/ui/suggest-list.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.d.ts +23 -0
- package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.js +177 -0
- package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/table-menu.d.ts +16 -0
- package/dist/src/nile-wysiwyg-editor/ui/table-menu.js +101 -0
- package/dist/src/nile-wysiwyg-editor/ui/table-menu.js.map +1 -0
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +18 -2
- package/src/index.ts +57 -1
- package/src/internal/glyph.ts +13 -0
- package/src/nile-wysiwyg-editor/emoji.ts +137 -0
- package/src/nile-wysiwyg-editor/engine/commands.ts +1035 -0
- package/src/nile-wysiwyg-editor/engine/create-state.ts +117 -0
- package/src/nile-wysiwyg-editor/engine/export.test.ts +113 -0
- package/src/nile-wysiwyg-editor/engine/export.ts +242 -0
- package/src/nile-wysiwyg-editor/engine/index.ts +69 -0
- package/src/nile-wysiwyg-editor/engine/inputrules.ts +169 -0
- package/src/nile-wysiwyg-editor/engine/keymap.ts +146 -0
- package/src/nile-wysiwyg-editor/engine/markdown-parse.test.ts +148 -0
- package/src/nile-wysiwyg-editor/engine/markdown-parse.ts +337 -0
- package/src/nile-wysiwyg-editor/engine/markdown.ts +165 -0
- package/src/nile-wysiwyg-editor/engine/office-paste.ts +199 -0
- package/src/nile-wysiwyg-editor/engine/plugins/code-highlight.ts +173 -0
- package/src/nile-wysiwyg-editor/engine/plugins/embed-view.ts +85 -0
- package/src/nile-wysiwyg-editor/engine/plugins/embeds.ts +99 -0
- package/src/nile-wysiwyg-editor/engine/plugins/find-replace.ts +155 -0
- package/src/nile-wysiwyg-editor/engine/plugins/format-painter.ts +80 -0
- package/src/nile-wysiwyg-editor/engine/plugins/image-view.ts +220 -0
- package/src/nile-wysiwyg-editor/engine/plugins/image.ts +80 -0
- package/src/nile-wysiwyg-editor/engine/plugins/link.ts +42 -0
- package/src/nile-wysiwyg-editor/engine/plugins/math-view.ts +56 -0
- package/src/nile-wysiwyg-editor/engine/plugins/max-length.ts +24 -0
- package/src/nile-wysiwyg-editor/engine/plugins/paste.ts +74 -0
- package/src/nile-wysiwyg-editor/engine/plugins/placeholder.ts +24 -0
- package/src/nile-wysiwyg-editor/engine/plugins/single-line.ts +47 -0
- package/src/nile-wysiwyg-editor/engine/plugins/suggestions.ts +110 -0
- package/src/nile-wysiwyg-editor/engine/plugins/tables.ts +12 -0
- package/src/nile-wysiwyg-editor/engine/plugins/task-list.ts +65 -0
- package/src/nile-wysiwyg-editor/engine/pm.test.ts +1088 -0
- package/src/nile-wysiwyg-editor/engine/productivity.test.ts +163 -0
- package/src/nile-wysiwyg-editor/engine/sanitize.ts +156 -0
- package/src/nile-wysiwyg-editor/engine/schema.ts +859 -0
- package/src/nile-wysiwyg-editor/engine/selection-state.ts +210 -0
- package/src/nile-wysiwyg-editor/engine/serializer.ts +78 -0
- package/src/nile-wysiwyg-editor/index.ts +3 -0
- package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.ts +782 -0
- package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.ts +750 -0
- package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.ts +2155 -0
- package/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.ts +1 -0
- package/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.ts +251 -0
- package/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.ts +772 -0
- package/src/nile-wysiwyg-editor/types.ts +83 -0
- package/src/nile-wysiwyg-editor/ui/bookmark-panel.ts +155 -0
- package/src/nile-wysiwyg-editor/ui/bubble-menu.ts +135 -0
- package/src/nile-wysiwyg-editor/ui/code-block-menu.ts +105 -0
- package/src/nile-wysiwyg-editor/ui/embed-menu.ts +133 -0
- package/src/nile-wysiwyg-editor/ui/embed-panel.ts +143 -0
- package/src/nile-wysiwyg-editor/ui/emoji-picker.ts +152 -0
- package/src/nile-wysiwyg-editor/ui/find-replace.ts +174 -0
- package/src/nile-wysiwyg-editor/ui/image-menu.ts +140 -0
- package/src/nile-wysiwyg-editor/ui/image-panel.ts +337 -0
- package/src/nile-wysiwyg-editor/ui/insert-menu.ts +142 -0
- package/src/nile-wysiwyg-editor/ui/link-editor.ts +180 -0
- package/src/nile-wysiwyg-editor/ui/markdown-panel.ts +143 -0
- package/src/nile-wysiwyg-editor/ui/math-panel.ts +169 -0
- package/src/nile-wysiwyg-editor/ui/shortcut-help.ts +311 -0
- package/src/nile-wysiwyg-editor/ui/source-view.ts +119 -0
- package/src/nile-wysiwyg-editor/ui/special-chars.ts +209 -0
- package/src/nile-wysiwyg-editor/ui/suggest-list.ts +138 -0
- package/src/nile-wysiwyg-editor/ui/table-grid-picker.ts +173 -0
- package/src/nile-wysiwyg-editor/ui/table-menu.ts +109 -0
- package/vscode-html-custom-data.json +450 -0
- package/web-dev-server.config.mjs +6 -2
- package/dist/index-5fef1a0d.esm.js +0 -1
- package/dist/index-8f38fae3.cjs.js +0 -2
- package/dist/index-8f38fae3.cjs.js.map +0 -1
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { EditorState, Plugin, PluginKey } from 'prosemirror-state';
|
|
2
|
+
import { Node as PMNode, Schema } from 'prosemirror-model';
|
|
3
|
+
import { history } from 'prosemirror-history';
|
|
4
|
+
import { dropCursor } from 'prosemirror-dropcursor';
|
|
5
|
+
import { gapCursor } from 'prosemirror-gapcursor';
|
|
6
|
+
import { buildKeymapPlugins, KeymapOptions } from './keymap';
|
|
7
|
+
import { buildInputRules } from './inputrules';
|
|
8
|
+
import { placeholderPlugin } from './plugins/placeholder';
|
|
9
|
+
import { linkPlugin, LinkPluginOptions } from './plugins/link';
|
|
10
|
+
import { singleLinePlugin } from './plugins/single-line';
|
|
11
|
+
import { tablePlugins } from './plugins/tables';
|
|
12
|
+
import { imagePlugin, ImagePluginOptions } from './plugins/image';
|
|
13
|
+
import { suggestionPlugin, SuggestionOptions } from './plugins/suggestions';
|
|
14
|
+
import { findReplacePlugin } from './plugins/find-replace';
|
|
15
|
+
import { maxLengthPlugin } from './plugins/max-length';
|
|
16
|
+
import { codeHighlightPlugin } from './plugins/code-highlight';
|
|
17
|
+
import { embedPastePlugin } from './plugins/embeds';
|
|
18
|
+
import { pastePlugin } from './plugins/paste';
|
|
19
|
+
import { formatPainterPlugin } from './plugins/format-painter';
|
|
20
|
+
import { defaultSchema } from './schema';
|
|
21
|
+
|
|
22
|
+
export const mentionSuggestKey = new PluginKey('nileMentionSuggest');
|
|
23
|
+
export const slashSuggestKey = new PluginKey('nileSlashSuggest');
|
|
24
|
+
export const emojiSuggestKey = new PluginKey('nileEmojiSuggest');
|
|
25
|
+
|
|
26
|
+
export interface CreateStateOptions
|
|
27
|
+
extends KeymapOptions,
|
|
28
|
+
LinkPluginOptions,
|
|
29
|
+
ImagePluginOptions {
|
|
30
|
+
schema?: Schema;
|
|
31
|
+
doc?: PMNode;
|
|
32
|
+
/** Read live so the placeholder updates without rebuilding state. */
|
|
33
|
+
getPlaceholder?: () => string;
|
|
34
|
+
singleLine?: boolean;
|
|
35
|
+
/** Mention suggestions (omit onChange to disable the plugin). */
|
|
36
|
+
mentions?: Omit<SuggestionOptions, 'startOfLine'>;
|
|
37
|
+
/** Slash-command suggestions, anchored to the start of a block. */
|
|
38
|
+
slashCommands?: Omit<SuggestionOptions, 'startOfLine' | 'getTriggers'>;
|
|
39
|
+
/** ":" emoji suggestions (activates after two query characters). */
|
|
40
|
+
emoji?: Omit<SuggestionOptions, 'startOfLine' | 'getTriggers' | 'minQueryLength'>;
|
|
41
|
+
/** Character limit, read live. Return 0/undefined for unlimited. */
|
|
42
|
+
getMaxLength?: () => number;
|
|
43
|
+
/** Read live: when true, all pastes drop formatting. */
|
|
44
|
+
getForcePlainText?: () => boolean;
|
|
45
|
+
/** Read live: when false, plain-text pastes are never parsed as Markdown. */
|
|
46
|
+
getMarkdownPaste?: () => boolean;
|
|
47
|
+
/** Read live: whether pasted/parsed HTML is sanitized. Defaults to on. */
|
|
48
|
+
getSanitize?: () => boolean;
|
|
49
|
+
/** Typography autocorrect (smart quotes, dashes, (c)…). Defaults to on. */
|
|
50
|
+
textTransform?: boolean;
|
|
51
|
+
/** Extra plugins appended after the built-in set (later phases, tests). */
|
|
52
|
+
plugins?: Plugin[];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function createEditorState(options: CreateStateOptions = {}): EditorState {
|
|
56
|
+
const schema = options.schema ?? defaultSchema;
|
|
57
|
+
const plugins: Plugin[] = [];
|
|
58
|
+
|
|
59
|
+
// Suggestion plugins must come BEFORE the keymaps: handleKeyDown props run
|
|
60
|
+
// in plugin order, and the popup needs first claim on Enter/Tab/arrows
|
|
61
|
+
// while a mention or slash query is active.
|
|
62
|
+
if (options.mentions) {
|
|
63
|
+
plugins.push(suggestionPlugin(mentionSuggestKey, options.mentions));
|
|
64
|
+
}
|
|
65
|
+
if (options.slashCommands) {
|
|
66
|
+
plugins.push(
|
|
67
|
+
suggestionPlugin(slashSuggestKey, {
|
|
68
|
+
...options.slashCommands,
|
|
69
|
+
getTriggers: () => ['/'],
|
|
70
|
+
startOfLine: true,
|
|
71
|
+
})
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
if (options.emoji) {
|
|
75
|
+
plugins.push(
|
|
76
|
+
suggestionPlugin(emojiSuggestKey, {
|
|
77
|
+
...options.emoji,
|
|
78
|
+
getTriggers: () => [':'],
|
|
79
|
+
minQueryLength: 2,
|
|
80
|
+
})
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
plugins.push(
|
|
85
|
+
buildInputRules(schema, { textTransform: options.textTransform }),
|
|
86
|
+
...buildKeymapPlugins(schema, {
|
|
87
|
+
onLinkShortcut: options.onLinkShortcut,
|
|
88
|
+
onFindShortcut: options.onFindShortcut,
|
|
89
|
+
onShortcutHelp: options.onShortcutHelp,
|
|
90
|
+
}),
|
|
91
|
+
history(),
|
|
92
|
+
dropCursor(),
|
|
93
|
+
gapCursor(),
|
|
94
|
+
placeholderPlugin(options.getPlaceholder ?? (() => '')),
|
|
95
|
+
linkPlugin({ onOpenLink: options.onOpenLink }),
|
|
96
|
+
...tablePlugins(),
|
|
97
|
+
imagePlugin({ onImageFiles: options.onImageFiles }),
|
|
98
|
+
findReplacePlugin(),
|
|
99
|
+
codeHighlightPlugin(),
|
|
100
|
+
embedPastePlugin(),
|
|
101
|
+
formatPainterPlugin(),
|
|
102
|
+
pastePlugin(schema, {
|
|
103
|
+
getForcePlainText: options.getForcePlainText,
|
|
104
|
+
getMarkdownPaste: options.getMarkdownPaste,
|
|
105
|
+
getSanitize: options.getSanitize,
|
|
106
|
+
})
|
|
107
|
+
);
|
|
108
|
+
if (options.getMaxLength) plugins.push(maxLengthPlugin(options.getMaxLength));
|
|
109
|
+
if (options.singleLine) plugins.push(singleLinePlugin());
|
|
110
|
+
if (options.plugins) plugins.push(...options.plugins);
|
|
111
|
+
|
|
112
|
+
return EditorState.create({
|
|
113
|
+
schema,
|
|
114
|
+
doc: options.doc,
|
|
115
|
+
plugins,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { expect } from '@open-wc/testing';
|
|
2
|
+
import { toInlineStyledHtml, buildWordDocument, buildPrintDocument } from './export';
|
|
3
|
+
|
|
4
|
+
/** Renders HTML into a live, attached, styled element and returns its root. */
|
|
5
|
+
function styledRoot(inner: string, css = ''): HTMLElement {
|
|
6
|
+
const host = document.createElement('div');
|
|
7
|
+
if (css) {
|
|
8
|
+
const style = document.createElement('style');
|
|
9
|
+
style.textContent = css;
|
|
10
|
+
host.appendChild(style);
|
|
11
|
+
}
|
|
12
|
+
const root = document.createElement('div');
|
|
13
|
+
root.innerHTML = inner;
|
|
14
|
+
host.appendChild(root);
|
|
15
|
+
document.body.appendChild(host);
|
|
16
|
+
return root;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
describe('export', () => {
|
|
20
|
+
describe('toInlineStyledHtml', () => {
|
|
21
|
+
it('folds computed colour into an inline style attribute', () => {
|
|
22
|
+
const root = styledRoot('<p class="c">hi</p>', '.c { color: rgb(255, 0, 0); }');
|
|
23
|
+
const out = toInlineStyledHtml(root);
|
|
24
|
+
root.parentElement!.remove();
|
|
25
|
+
expect(out).to.match(/<p[^>]*style="[^"]*color: rgb\(255, 0, 0\)/);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('strips classes and editor-only attributes', () => {
|
|
29
|
+
const root = styledRoot('<p class="foo" contenteditable="true" data-x="1">t</p>');
|
|
30
|
+
const out = toInlineStyledHtml(root);
|
|
31
|
+
root.parentElement!.remove();
|
|
32
|
+
expect(out).to.not.include('class=');
|
|
33
|
+
expect(out).to.not.include('contenteditable');
|
|
34
|
+
expect(out).to.not.include('data-x');
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('keeps structural attributes like href and src', () => {
|
|
38
|
+
const root = styledRoot('<p><a href="https://a.b">x</a></p>');
|
|
39
|
+
const out = toInlineStyledHtml(root);
|
|
40
|
+
root.parentElement!.remove();
|
|
41
|
+
expect(out).to.include('href="https://a.b"');
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('does not repeat inherited values already set on the parent', () => {
|
|
45
|
+
const root = styledRoot(
|
|
46
|
+
'<div class="wrap"><p>child</p></div>',
|
|
47
|
+
'.wrap { color: rgb(0, 128, 0); }'
|
|
48
|
+
);
|
|
49
|
+
const out = toInlineStyledHtml(root);
|
|
50
|
+
root.parentElement!.remove();
|
|
51
|
+
// The wrapper carries the colour; the inheriting <p> should not repeat it.
|
|
52
|
+
const pMatch = /<p([^>]*)>/.exec(out);
|
|
53
|
+
expect(pMatch![1]).to.not.include('color: rgb(0, 128, 0)');
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('caps images at 100% width', () => {
|
|
57
|
+
const root = styledRoot('<p><img src="data:image/png;base64,AA" alt="x"></p>');
|
|
58
|
+
const out = toInlineStyledHtml(root);
|
|
59
|
+
root.parentElement!.remove();
|
|
60
|
+
expect(out).to.match(/<img[^>]*max-width: 100%/);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('emits borders on table cells', () => {
|
|
64
|
+
const root = styledRoot(
|
|
65
|
+
'<table><tbody><tr><td class="cell">a</td></tr></tbody></table>',
|
|
66
|
+
'.cell { border: 2px solid rgb(0, 0, 0); }'
|
|
67
|
+
);
|
|
68
|
+
const out = toInlineStyledHtml(root);
|
|
69
|
+
root.parentElement!.remove();
|
|
70
|
+
// Four equal sides serialize to the border-width/style/color shorthand.
|
|
71
|
+
expect(out).to.match(/<td[^>]*border-width: 2px/);
|
|
72
|
+
expect(out).to.match(/<td[^>]*border-style: solid/);
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
describe('buildWordDocument', () => {
|
|
77
|
+
it('wraps body in a Word-openable document with office namespaces', () => {
|
|
78
|
+
const doc = buildWordDocument('<p>hi</p>', 'My File');
|
|
79
|
+
expect(doc).to.include('xmlns:w="urn:schemas-microsoft-com:office:word"');
|
|
80
|
+
expect(doc).to.include('<w:WordDocument>');
|
|
81
|
+
expect(doc).to.include('<title>My File</title>');
|
|
82
|
+
expect(doc).to.include('<p>hi</p>');
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it('escapes the title', () => {
|
|
86
|
+
const doc = buildWordDocument('<p>x</p>', '<evil>');
|
|
87
|
+
expect(doc).to.include('<title><evil></title>');
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
describe('buildPrintDocument', () => {
|
|
92
|
+
it('includes page CSS and the body', () => {
|
|
93
|
+
const doc = buildPrintDocument('<p>hi</p>', { title: 'Doc' });
|
|
94
|
+
expect(doc).to.include('@page');
|
|
95
|
+
expect(doc).to.include('<p>hi</p>');
|
|
96
|
+
expect(doc).to.include('page-break-before: always');
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it('renders a running header and footer when provided', () => {
|
|
100
|
+
const doc = buildPrintDocument('<p>x</p>', { header: 'Top', footer: 'Bottom' });
|
|
101
|
+
expect(doc).to.include('nw-print-header');
|
|
102
|
+
expect(doc).to.include('Top');
|
|
103
|
+
expect(doc).to.include('nw-print-footer');
|
|
104
|
+
expect(doc).to.include('Bottom');
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it('omits header/footer bands when not provided', () => {
|
|
108
|
+
const doc = buildPrintDocument('<p>x</p>', { title: 'Doc' });
|
|
109
|
+
expect(doc).to.not.include('nw-print-header');
|
|
110
|
+
expect(doc).to.not.include('nw-print-footer');
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
});
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Document export helpers: inline-styled HTML (email-safe), Word (.doc) and
|
|
3
|
+
* print-to-PDF. All three start from the *live, rendered* content DOM so the
|
|
4
|
+
* output reflects exactly what the user sees — chosen fonts, colours,
|
|
5
|
+
* alignment and table borders — rather than a re-derived approximation.
|
|
6
|
+
*
|
|
7
|
+
* These functions are dependency-free. PDF export relies on the browser's own
|
|
8
|
+
* print-to-PDF pipeline (see buildPrintDocument); Word export emits an HTML
|
|
9
|
+
* document Word opens natively.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/** Inherited text properties: emitted only when they differ from the parent. */
|
|
13
|
+
const INHERITED_PROPS = [
|
|
14
|
+
'color',
|
|
15
|
+
'font-family',
|
|
16
|
+
'font-size',
|
|
17
|
+
'font-weight',
|
|
18
|
+
'font-style',
|
|
19
|
+
'line-height',
|
|
20
|
+
'text-align',
|
|
21
|
+
'text-transform',
|
|
22
|
+
] as const;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Box/decoration properties: emitted only when they differ from their initial
|
|
26
|
+
* value (listed here). Longhands are used because getComputedStyle does not
|
|
27
|
+
* reliably return the `margin`/`padding`/`border` shorthands.
|
|
28
|
+
*/
|
|
29
|
+
const BOX_DEFAULTS: Record<string, string[]> = {
|
|
30
|
+
'background-color': ['rgba(0, 0, 0, 0)', 'transparent'],
|
|
31
|
+
'text-decoration-line': ['none'],
|
|
32
|
+
'margin-top': ['0px'],
|
|
33
|
+
'margin-right': ['0px'],
|
|
34
|
+
'margin-bottom': ['0px'],
|
|
35
|
+
'margin-left': ['0px'],
|
|
36
|
+
'padding-top': ['0px'],
|
|
37
|
+
'padding-right': ['0px'],
|
|
38
|
+
'padding-bottom': ['0px'],
|
|
39
|
+
'padding-left': ['0px'],
|
|
40
|
+
'vertical-align': ['baseline'],
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/** Table-ish elements get their borders folded in for email/Word fidelity. */
|
|
44
|
+
const BORDER_TAGS = new Set(['TABLE', 'TD', 'TH', 'THEAD', 'TBODY', 'TR']);
|
|
45
|
+
|
|
46
|
+
/** Attributes worth preserving; everything else (class, contenteditable,
|
|
47
|
+
* spellcheck, data-*, pm-*) is dropped from the exported markup. */
|
|
48
|
+
const KEEP_ATTRS = new Set([
|
|
49
|
+
'href',
|
|
50
|
+
'src',
|
|
51
|
+
'alt',
|
|
52
|
+
'title',
|
|
53
|
+
'colspan',
|
|
54
|
+
'rowspan',
|
|
55
|
+
'width',
|
|
56
|
+
'height',
|
|
57
|
+
'align',
|
|
58
|
+
'target',
|
|
59
|
+
'rel',
|
|
60
|
+
]);
|
|
61
|
+
|
|
62
|
+
function emitBorders(source: Element, style: CSSStyleDeclaration, clone: HTMLElement): void {
|
|
63
|
+
if (!BORDER_TAGS.has(source.tagName)) return;
|
|
64
|
+
const cs = getComputedStyle(source);
|
|
65
|
+
const collapse = cs.getPropertyValue('border-collapse');
|
|
66
|
+
if (collapse === 'collapse') clone.style.setProperty('border-collapse', 'collapse');
|
|
67
|
+
for (const side of ['top', 'right', 'bottom', 'left']) {
|
|
68
|
+
const width = cs.getPropertyValue(`border-${side}-width`);
|
|
69
|
+
if (width && width !== '0px') {
|
|
70
|
+
const st = cs.getPropertyValue(`border-${side}-style`) || 'solid';
|
|
71
|
+
const color = cs.getPropertyValue(`border-${side}-color`);
|
|
72
|
+
clone.style.setProperty(`border-${side}`, `${width} ${st} ${color}`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
void style;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** Folds computed styles from a live source element into a detached clone. */
|
|
79
|
+
function styleElement(source: Element, clone: HTMLElement, parent: Element | null): void {
|
|
80
|
+
const cs = getComputedStyle(source);
|
|
81
|
+
const parentCs = parent ? getComputedStyle(parent) : null;
|
|
82
|
+
|
|
83
|
+
for (const prop of INHERITED_PROPS) {
|
|
84
|
+
const value = cs.getPropertyValue(prop);
|
|
85
|
+
if (!value) continue;
|
|
86
|
+
if (!parentCs || parentCs.getPropertyValue(prop) !== value) {
|
|
87
|
+
clone.style.setProperty(prop, value);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
for (const [prop, defaults] of Object.entries(BOX_DEFAULTS)) {
|
|
92
|
+
const value = cs.getPropertyValue(prop);
|
|
93
|
+
if (value && !defaults.includes(value)) clone.style.setProperty(prop, value);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// List markers: emit the resolved bullet/number style on the list container.
|
|
97
|
+
if (source.tagName === 'UL' || source.tagName === 'OL') {
|
|
98
|
+
const marker = cs.getPropertyValue('list-style-type');
|
|
99
|
+
if (marker && marker !== 'none') clone.style.setProperty('list-style-type', marker);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Images and embeds should never overflow the exported page/email column.
|
|
103
|
+
if (source.tagName === 'IMG' || source.tagName === 'IFRAME') {
|
|
104
|
+
clone.style.setProperty('max-width', '100%');
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
emitBorders(source, cs, clone);
|
|
108
|
+
|
|
109
|
+
// Prune attributes down to the structural allow-list, keeping only style.
|
|
110
|
+
for (const attr of Array.from(clone.attributes)) {
|
|
111
|
+
if (attr.name !== 'style' && !KEEP_ATTRS.has(attr.name)) clone.removeAttribute(attr.name);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** Recursively clones `source` into `target`'s document, inlining styles. */
|
|
116
|
+
function cloneWithStyles(
|
|
117
|
+
source: Node,
|
|
118
|
+
doc: Document,
|
|
119
|
+
parent: Element | null
|
|
120
|
+
): Node | null {
|
|
121
|
+
if (source.nodeType === Node.TEXT_NODE) {
|
|
122
|
+
return doc.createTextNode(source.textContent ?? '');
|
|
123
|
+
}
|
|
124
|
+
if (source.nodeType !== Node.ELEMENT_NODE) return null;
|
|
125
|
+
|
|
126
|
+
const el = source as Element;
|
|
127
|
+
// ProseMirror decorations (find-highlights, gap/drop cursors, trailing
|
|
128
|
+
// break hacks) carry these classes — never part of the real content.
|
|
129
|
+
if (el.classList.contains('ProseMirror-gapcursor')) return null;
|
|
130
|
+
if (el.classList.contains('ProseMirror-separator')) return null;
|
|
131
|
+
|
|
132
|
+
const clone = doc.createElement(el.tagName.toLowerCase());
|
|
133
|
+
for (const attr of Array.from(el.attributes)) clone.setAttribute(attr.name, attr.value);
|
|
134
|
+
styleElement(el, clone as HTMLElement, parent);
|
|
135
|
+
|
|
136
|
+
for (const child of Array.from(el.childNodes)) {
|
|
137
|
+
const cloned = cloneWithStyles(child, doc, el);
|
|
138
|
+
if (cloned) clone.appendChild(cloned);
|
|
139
|
+
}
|
|
140
|
+
return clone;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Serializes the live content root to an HTML string with all styling folded
|
|
145
|
+
* into inline `style` attributes. Suitable for pasting into email clients that
|
|
146
|
+
* strip `<style>` blocks and classes.
|
|
147
|
+
*/
|
|
148
|
+
export function toInlineStyledHtml(root: HTMLElement): string {
|
|
149
|
+
const doc = document.implementation.createHTMLDocument('');
|
|
150
|
+
const container = doc.createElement('div');
|
|
151
|
+
for (const child of Array.from(root.childNodes)) {
|
|
152
|
+
const cloned = cloneWithStyles(child, doc, root);
|
|
153
|
+
if (cloned) container.appendChild(cloned);
|
|
154
|
+
}
|
|
155
|
+
return container.innerHTML;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function escapeHtml(text: string): string {
|
|
159
|
+
return text
|
|
160
|
+
.replace(/&/g, '&')
|
|
161
|
+
.replace(/</g, '<')
|
|
162
|
+
.replace(/>/g, '>')
|
|
163
|
+
.replace(/"/g, '"');
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Wraps inline-styled body HTML in a Word-openable HTML document. Word reads
|
|
168
|
+
* the `ProgId`/`xmlns:w` hints and opens it as a formatted document rather than
|
|
169
|
+
* raw HTML, preserving headings, lists, tables, colours and images.
|
|
170
|
+
*/
|
|
171
|
+
export function buildWordDocument(bodyHtml: string, title = 'Document'): string {
|
|
172
|
+
return (
|
|
173
|
+
'<!DOCTYPE html>\n' +
|
|
174
|
+
'<html xmlns:o="urn:schemas-microsoft-com:office:office" ' +
|
|
175
|
+
'xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">' +
|
|
176
|
+
'<head><meta charset="utf-8">' +
|
|
177
|
+
`<title>${escapeHtml(title)}</title>` +
|
|
178
|
+
'<!--[if gte mso 9]><xml><w:WordDocument>' +
|
|
179
|
+
'<w:View>Print</w:View><w:Zoom>100</w:Zoom><w:DoNotOptimizeForBrowser/>' +
|
|
180
|
+
'</w:WordDocument></xml><![endif]-->' +
|
|
181
|
+
'<style>@page { size: A4; margin: 2cm; } ' +
|
|
182
|
+
'body { font-family: Calibri, Arial, sans-serif; } ' +
|
|
183
|
+
'table { border-collapse: collapse; } td, th { border: 1px solid #999; padding: 4px; }</style>' +
|
|
184
|
+
'</head><body>' +
|
|
185
|
+
bodyHtml +
|
|
186
|
+
'</body></html>'
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/** Options for the print-to-PDF document. */
|
|
191
|
+
export interface PrintOptions {
|
|
192
|
+
title?: string;
|
|
193
|
+
/** Optional running header text (top of every printed page). */
|
|
194
|
+
header?: string;
|
|
195
|
+
/** Optional running footer text (bottom of every printed page). */
|
|
196
|
+
footer?: string;
|
|
197
|
+
/** Base font family for the printed page. */
|
|
198
|
+
fontFamily?: string;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Builds a standalone HTML document tuned for print-to-PDF. Page breaks,
|
|
203
|
+
* embedded images and a chosen base font are honoured by the browser's print
|
|
204
|
+
* engine; headers/footers render via a fixed running band on each page.
|
|
205
|
+
*/
|
|
206
|
+
export function buildPrintDocument(bodyHtml: string, options: PrintOptions = {}): string {
|
|
207
|
+
const {
|
|
208
|
+
title = 'Document',
|
|
209
|
+
header = '',
|
|
210
|
+
footer = '',
|
|
211
|
+
fontFamily = 'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',
|
|
212
|
+
} = options;
|
|
213
|
+
|
|
214
|
+
const runningBands =
|
|
215
|
+
(header ? `<div class="nw-print-header">${escapeHtml(header)}</div>` : '') +
|
|
216
|
+
(footer ? `<div class="nw-print-footer">${escapeHtml(footer)}</div>` : '');
|
|
217
|
+
|
|
218
|
+
return (
|
|
219
|
+
'<!DOCTYPE html>\n<html><head><meta charset="utf-8">' +
|
|
220
|
+
`<title>${escapeHtml(title)}</title><style>` +
|
|
221
|
+
'@page { size: A4; margin: 20mm; }' +
|
|
222
|
+
`body { font-family: ${fontFamily}; color: #101828; line-height: 1.5; margin: 0; }` +
|
|
223
|
+
'img, iframe { max-width: 100%; }' +
|
|
224
|
+
'table { border-collapse: collapse; width: 100%; }' +
|
|
225
|
+
'td, th { border: 1px solid #d0d5dd; padding: 6px 8px; }' +
|
|
226
|
+
'pre, blockquote, table, figure, img { break-inside: avoid; page-break-inside: avoid; }' +
|
|
227
|
+
'h1, h2, h3, h4 { break-after: avoid; page-break-after: avoid; }' +
|
|
228
|
+
'.nw-page-break { break-before: page; page-break-before: always; }' +
|
|
229
|
+
(header
|
|
230
|
+
? '.nw-print-header { position: fixed; top: 0; left: 0; right: 0; ' +
|
|
231
|
+
'font-size: 10px; color: #667085; padding: 6px 0; }'
|
|
232
|
+
: '') +
|
|
233
|
+
(footer
|
|
234
|
+
? '.nw-print-footer { position: fixed; bottom: 0; left: 0; right: 0; ' +
|
|
235
|
+
'font-size: 10px; color: #667085; padding: 6px 0; text-align: center; }'
|
|
236
|
+
: '') +
|
|
237
|
+
'</style></head><body>' +
|
|
238
|
+
runningBands +
|
|
239
|
+
`<main>${bodyHtml}</main>` +
|
|
240
|
+
'</body></html>'
|
|
241
|
+
);
|
|
242
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export { createSchema, defaultSchema } from './schema';
|
|
2
|
+
export type { Alignment } from './schema';
|
|
3
|
+
export { sanitizeHtml, isSafeUrl } from './sanitize';
|
|
4
|
+
export {
|
|
5
|
+
htmlToDoc,
|
|
6
|
+
htmlToSlice,
|
|
7
|
+
docToHtml,
|
|
8
|
+
docToText,
|
|
9
|
+
docToJson,
|
|
10
|
+
jsonToDoc,
|
|
11
|
+
isDocEmpty,
|
|
12
|
+
} from './serializer';
|
|
13
|
+
export { getCommand, getMarkRange } from './commands';
|
|
14
|
+
export type { CommandName, CommandAttrs } from './commands';
|
|
15
|
+
export { docToMarkdown } from './markdown';
|
|
16
|
+
export { markdownToHtml, looksLikeMarkdown } from './markdown-parse';
|
|
17
|
+
export { isOfficeHtml, isExcelHtml, cleanOfficeHtml } from './office-paste';
|
|
18
|
+
export {
|
|
19
|
+
toInlineStyledHtml,
|
|
20
|
+
buildWordDocument,
|
|
21
|
+
buildPrintDocument,
|
|
22
|
+
} from './export';
|
|
23
|
+
export type { PrintOptions } from './export';
|
|
24
|
+
export { selectedImageInfo } from './commands';
|
|
25
|
+
export { ImageView, FigureView } from './plugins/image-view';
|
|
26
|
+
export { EmbedView } from './plugins/embed-view';
|
|
27
|
+
export { MathView } from './plugins/math-view';
|
|
28
|
+
export type { MathRenderer } from './plugins/math-view';
|
|
29
|
+
export { INDENT_STEP_PX, MAX_INDENT, BULLET_STYLES, ORDERED_STYLES } from './schema';
|
|
30
|
+
export { computeToolbarState } from './selection-state';
|
|
31
|
+
export type { ToolbarState } from './selection-state';
|
|
32
|
+
export {
|
|
33
|
+
createEditorState,
|
|
34
|
+
mentionSuggestKey,
|
|
35
|
+
slashSuggestKey,
|
|
36
|
+
emojiSuggestKey,
|
|
37
|
+
} from './create-state';
|
|
38
|
+
export { maxLengthPlugin } from './plugins/max-length';
|
|
39
|
+
export { TaskItemView } from './plugins/task-list';
|
|
40
|
+
export { codeHighlightPlugin, CODE_LANGUAGES } from './plugins/code-highlight';
|
|
41
|
+
export { toEmbedUrl, isAllowedEmbedSrc, embedPastePlugin } from './plugins/embeds';
|
|
42
|
+
export type { EmbedTarget } from './plugins/embeds';
|
|
43
|
+
export type { CreateStateOptions } from './create-state';
|
|
44
|
+
export { countWords } from './serializer';
|
|
45
|
+
export type { SuggestionMatch, SuggestionOptions } from './plugins/suggestions';
|
|
46
|
+
export {
|
|
47
|
+
findReplaceKey,
|
|
48
|
+
getFindState,
|
|
49
|
+
searchTr,
|
|
50
|
+
findStepTr,
|
|
51
|
+
clearFindTr,
|
|
52
|
+
replaceActiveTr,
|
|
53
|
+
replaceAllTr,
|
|
54
|
+
} from './plugins/find-replace';
|
|
55
|
+
export type { FindState, FindMatch } from './plugins/find-replace';
|
|
56
|
+
export { placeholderPlugin } from './plugins/placeholder';
|
|
57
|
+
export {
|
|
58
|
+
formatPainterPlugin,
|
|
59
|
+
formatPainterKey,
|
|
60
|
+
isFormatPainterArmed,
|
|
61
|
+
armFormatPainter,
|
|
62
|
+
disarmFormatPainter,
|
|
63
|
+
applyFormatPainter,
|
|
64
|
+
} from './plugins/format-painter';
|
|
65
|
+
export { linkPlugin } from './plugins/link';
|
|
66
|
+
export { singleLinePlugin, flattenToSingleParagraph } from './plugins/single-line';
|
|
67
|
+
export { tablePlugins } from './plugins/tables';
|
|
68
|
+
export { imagePlugin, imageUploadKey, findUploadPos } from './plugins/image';
|
|
69
|
+
export { pastePlugin, plainTextSlice, stripSliceFormatting } from './plugins/paste';
|