@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 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/nile-wysiwyg-editor/engine/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAsB,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,UAAU,MAAM,YAAY,CAAC;AAIpC,MAAM,YAAY,GAAgB,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;AAEzE,SAAS,eAAe,CAAC,GAAgB;IACvC,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,SAAS,IAAI,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IACrE,OAAQ,YAAyB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAE,KAAmB,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IAAI,CAAC,KAAK,CAAC,EACtB,kBAAkB,EAClB,OAAO,CACR;SACE,MAAM,CAAC,aAAa,EAAE,cAAc,CAAC;SACrC,MAAM,CAAC,cAAc,EAAE,eAAe,CAAC;SACvC,MAAM,CAAC,cAAc,CAAC;SACtB,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC9B,OAAO,IAAI,MAAM,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AACvE,CAAC;AAED,wCAAwC;AACxC,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,EAAE,CAAC","sourcesContent":["import { Schema, NodeSpec, MarkSpec } from 'prosemirror-model';\nimport { addListNodes } from 'prosemirror-schema-list';\nimport { tableNodes } from 'prosemirror-tables';\nimport OrderedMap from 'orderedmap';\n\nexport type Alignment = 'left' | 'center' | 'right' | 'justify';\n\nconst ALIGN_VALUES: Alignment[] = ['left', 'center', 'right', 'justify'];\n\nfunction getAlignFromDom(dom: HTMLElement): Alignment | null {\n const value = dom.style.textAlign || dom.getAttribute('align') || '';\n return (ALIGN_VALUES as string[]).includes(value) ? (value as Alignment) : null;\n}\n\nfunction alignStyle(align: Alignment | null): string | null {\n return align ? `text-align: ${align}` : null;\n}\n\n/** Indent depth in 40px steps, like CKEditor/Google Docs. */\nexport const INDENT_STEP_PX = 40;\nexport const MAX_INDENT = 8;\n\nfunction getIndentFromDom(dom: HTMLElement): number {\n const raw = dom.style.marginInlineStart || dom.style.marginLeft || '';\n const px = parseFloat(raw);\n if (!Number.isFinite(px) || px <= 0) return 0;\n return Math.min(MAX_INDENT, Math.round(px / INDENT_STEP_PX));\n}\n\n/**\n * Line height as a unitless multiplier string ('1.5'). Percentages are\n * converted; px values pass through as-is so pasted content keeps its look.\n */\nfunction getLineHeightFromDom(dom: HTMLElement): string | null {\n const raw = dom.style.lineHeight.trim();\n if (!raw || raw === 'normal') return null;\n const num = parseFloat(raw);\n if (!Number.isFinite(num) || num <= 0) return null;\n if (raw.endsWith('%')) return String(num / 100);\n return raw;\n}\n\n/** Combined style string for align + indent + line-height textblock attrs. */\nfunction blockStyle(attrs: {\n align?: Alignment | null;\n indent?: number;\n lineHeight?: string | null;\n}): string | null {\n const parts: string[] = [];\n const align = alignStyle(attrs.align ?? null);\n if (align) parts.push(align);\n if (attrs.indent) parts.push(`margin-inline-start: ${attrs.indent * INDENT_STEP_PX}px`);\n if (attrs.lineHeight) parts.push(`line-height: ${attrs.lineHeight}`);\n return parts.length ? parts.join('; ') : null;\n}\n\n/**\n * Block nodes. `align` is modeled as an attribute on textblocks rather than a\n * wrapper node so alignment survives block-type changes (heading <-> paragraph).\n */\nconst nodes: Record<string, NodeSpec> = {\n doc: {\n content: 'block+',\n },\n\n paragraph: {\n content: 'inline*',\n group: 'block',\n attrs: {\n align: { default: null },\n indent: { default: 0 },\n lineHeight: { default: null },\n },\n parseDOM: [\n {\n tag: 'p',\n getAttrs: (dom: HTMLElement) => ({\n align: getAlignFromDom(dom),\n indent: getIndentFromDom(dom),\n lineHeight: getLineHeightFromDom(dom),\n }),\n },\n ],\n toDOM(node) {\n const style = blockStyle(node.attrs);\n return style ? ['p', { style }, 0] : ['p', 0];\n },\n },\n\n heading: {\n content: 'inline*',\n group: 'block',\n defining: true,\n attrs: {\n level: { default: 1 },\n align: { default: null },\n indent: { default: 0 },\n lineHeight: { default: null },\n },\n parseDOM: [1, 2, 3, 4, 5, 6].map(level => ({\n tag: `h${level}`,\n getAttrs: (dom: HTMLElement) => ({\n level,\n align: getAlignFromDom(dom),\n indent: getIndentFromDom(dom),\n lineHeight: getLineHeightFromDom(dom),\n }),\n })),\n toDOM(node) {\n const style = blockStyle(node.attrs);\n return style ? [`h${node.attrs.level}`, { style }, 0] : [`h${node.attrs.level}`, 0];\n },\n },\n\n blockquote: {\n content: 'block+',\n group: 'block',\n defining: true,\n parseDOM: [{ tag: 'blockquote' }],\n toDOM() {\n return ['blockquote', 0];\n },\n },\n\n horizontal_rule: {\n group: 'block',\n parseDOM: [{ tag: 'hr' }],\n toDOM() {\n return ['hr'];\n },\n },\n\n text: {\n group: 'inline',\n },\n\n hard_break: {\n inline: true,\n group: 'inline',\n selectable: false,\n parseDOM: [{ tag: 'br' }],\n toDOM() {\n return ['br'];\n },\n },\n\n code_block: {\n content: 'text*',\n group: 'block',\n marks: '',\n code: true,\n defining: true,\n attrs: { language: { default: null } },\n parseDOM: [\n {\n tag: 'pre',\n preserveWhitespace: 'full',\n getAttrs: (dom: HTMLElement) => ({\n language: dom.getAttribute('data-language'),\n }),\n },\n ],\n toDOM(node) {\n const attrs: Record<string, string> = { class: 'nile-wysiwyg__code-block' };\n if (node.attrs.language) attrs['data-language'] = node.attrs.language;\n return ['pre', attrs, ['code', 0]];\n },\n },\n\n /**\n * ProseMirror's canonical inline image, extended with a `width` attr (px)\n * written by the drag-resize handles.\n */\n image: {\n inline: true,\n group: 'inline',\n draggable: true,\n attrs: {\n src: {},\n alt: { default: null },\n title: { default: null },\n width: { default: null },\n },\n parseDOM: [\n {\n tag: 'img[src]',\n getAttrs: (dom: HTMLElement) => {\n const styleWidth = parseFloat(dom.style.width);\n const attrWidth = parseFloat(dom.getAttribute('width') ?? '');\n const width = Number.isFinite(styleWidth)\n ? Math.round(styleWidth)\n : Number.isFinite(attrWidth)\n ? Math.round(attrWidth)\n : null;\n return {\n src: dom.getAttribute('src'),\n alt: dom.getAttribute('alt'),\n title: dom.getAttribute('title'),\n width: width && width > 0 ? width : null,\n };\n },\n },\n ],\n toDOM(node) {\n const { src, alt, title, width } = node.attrs;\n const attrs: Record<string, string> = { src };\n if (alt) attrs.alt = alt;\n if (title) attrs.title = title;\n if (width) attrs.style = `width: ${width}px`;\n return ['img', attrs];\n },\n },\n\n /**\n * Captioned image: a block figure whose inline content is the caption. The\n * image itself lives in the attrs (TipTap-style), so the node stays valid\n * ProseMirror content — a node can't mix an inline img child with a block\n * figcaption child.\n */\n figure: {\n group: 'block',\n content: 'inline*',\n defining: true,\n isolating: true,\n attrs: {\n src: {},\n alt: { default: null },\n title: { default: null },\n width: { default: null },\n align: { default: null },\n },\n parseDOM: [\n {\n tag: 'figure',\n contentElement: 'figcaption',\n getAttrs: (dom: HTMLElement) => {\n const img = dom.querySelector('img[src]') as HTMLElement | null;\n if (!img) return false;\n const styleWidth = parseFloat(img.style.width || dom.style.width);\n const align = dom.getAttribute('data-align');\n return {\n src: img.getAttribute('src'),\n alt: img.getAttribute('alt'),\n title: img.getAttribute('title'),\n width:\n Number.isFinite(styleWidth) && styleWidth > 0\n ? Math.round(styleWidth)\n : null,\n align: align === 'left' || align === 'center' || align === 'right' ? align : null,\n };\n },\n },\n ],\n toDOM(node) {\n const { src, alt, title, width, align } = node.attrs;\n const figureAttrs: Record<string, string> = { class: 'nile-wysiwyg__figure' };\n if (align) figureAttrs['data-align'] = align;\n const styles: string[] = [];\n if (width) styles.push(`width: ${width}px`);\n if (align === 'center') styles.push('margin-left: auto; margin-right: auto');\n else if (align === 'right') styles.push('margin-left: auto; margin-right: 0');\n if (styles.length) figureAttrs.style = styles.join('; ');\n const imgAttrs: Record<string, string> = { src, style: 'width: 100%' };\n if (alt) imgAttrs.alt = alt;\n if (title) imgAttrs.title = title;\n return [\n 'figure',\n figureAttrs,\n ['img', imgAttrs],\n ['figcaption', { class: 'nile-wysiwyg__figcaption' }, 0],\n ];\n },\n },\n\n /**\n * Checklists. Serialized as <ul data-task-list><li data-task-item\n * data-checked> so they survive HTML round-trips; the live checkbox is an\n * editor-only NodeView. parseDOM priority 51 beats the generic li rule.\n */\n task_list: {\n content: 'task_item+',\n group: 'block',\n parseDOM: [{ tag: 'ul[data-task-list]', priority: 51 }],\n toDOM() {\n return ['ul', { 'data-task-list': 'true', class: 'nile-wysiwyg__task-list' }, 0];\n },\n },\n\n task_item: {\n content: 'paragraph block*',\n defining: true,\n attrs: { checked: { default: false } },\n parseDOM: [\n {\n tag: 'li[data-task-item]',\n priority: 51,\n getAttrs: (dom: HTMLElement) => ({\n checked: dom.getAttribute('data-checked') === 'true',\n }),\n },\n ],\n toDOM(node) {\n return [\n 'li',\n {\n 'data-task-item': 'true',\n 'data-checked': String(node.attrs.checked),\n class: 'nile-wysiwyg__task-item',\n },\n 0,\n ];\n },\n },\n\n /**\n * Provider embeds (YouTube/Vimeo/Loom) as block atoms. The iframe sits in\n * a wrapper div for aspect-ratio styling and a click-to-select overlay.\n */\n embed: {\n group: 'block',\n atom: true,\n selectable: true,\n draggable: true,\n attrs: {\n src: {},\n provider: { default: null },\n title: { default: null },\n /** Rendered width in px (drag-resize); null = default size. */\n width: { default: null },\n /** Block alignment: 'left' | 'center' | 'right' | null. */\n align: { default: null },\n },\n parseDOM: [\n {\n tag: 'div[data-embed-provider]',\n getAttrs: (dom: HTMLElement) => {\n const iframe = dom.querySelector('iframe[src]');\n if (!iframe) return false;\n const widthAttr =\n dom.getAttribute('data-width') ?? /^(\\d+)px$/.exec(dom.style.width)?.[1];\n const width = widthAttr ? parseInt(widthAttr, 10) : NaN;\n const align = dom.getAttribute('data-align');\n return {\n src: iframe.getAttribute('src'),\n provider: dom.getAttribute('data-embed-provider'),\n title: iframe.getAttribute('title'),\n width: Number.isFinite(width) && width > 0 ? width : null,\n align: align === 'left' || align === 'center' || align === 'right' ? align : null,\n };\n },\n },\n {\n tag: 'iframe[src]',\n getAttrs: (dom: HTMLElement) => {\n const width = parseInt(dom.getAttribute('width') ?? '', 10);\n return {\n src: dom.getAttribute('src'),\n title: dom.getAttribute('title'),\n width: Number.isFinite(width) && width > 0 ? width : null,\n };\n },\n },\n ],\n toDOM(node) {\n const { src, provider, title, width, align } = node.attrs;\n const iframeAttrs: Record<string, string> = {\n src,\n frameborder: '0',\n allowfullscreen: 'true',\n allow: 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture',\n };\n if (title) iframeAttrs.title = title;\n const wrapperAttrs: Record<string, string> = {\n class: 'nile-wysiwyg__embed',\n 'data-embed-provider': provider ?? 'generic',\n };\n const styles: string[] = [];\n if (width) {\n wrapperAttrs['data-width'] = String(width);\n styles.push(`width: ${width}px`, 'max-width: 100%');\n }\n if (align) {\n wrapperAttrs['data-align'] = align;\n if (align === 'center') styles.push('margin-left: auto', 'margin-right: auto');\n else if (align === 'right') styles.push('margin-left: auto', 'margin-right: 0');\n }\n if (styles.length) wrapperAttrs.style = styles.join('; ');\n return ['div', wrapperAttrs, ['iframe', iframeAttrs]];\n },\n },\n\n /**\n * Bookmark: a named in-text anchor (`<a id=\"…\">`) for intra-document\n * navigation. Invisible in serialized output; the editor draws a flag\n * marker via CSS so it can be selected and deleted.\n */\n bookmark: {\n inline: true,\n group: 'inline',\n atom: true,\n selectable: true,\n attrs: { id: {} },\n parseDOM: [\n {\n tag: 'a[data-bookmark]',\n priority: 60,\n getAttrs: (dom: HTMLElement) => {\n const id = dom.getAttribute('id') || dom.getAttribute('name');\n return id ? { id } : false;\n },\n },\n // Anchors without an href are bookmarks (`<a id>` / legacy `<a name>`).\n {\n tag: 'a[id]',\n getAttrs: (dom: HTMLElement) =>\n dom.hasAttribute('href') ? false : { id: dom.getAttribute('id') },\n },\n {\n tag: 'a[name]',\n getAttrs: (dom: HTMLElement) =>\n dom.hasAttribute('href') ? false : { id: dom.getAttribute('name') },\n },\n ],\n toDOM(node) {\n return ['a', { id: node.attrs.id, 'data-bookmark': 'true' }];\n },\n },\n\n /** Inline atom for @-style mentions. The label renders as `${trigger}${label}`. */\n mention: {\n inline: true,\n group: 'inline',\n atom: true,\n selectable: true,\n attrs: {\n trigger: { default: '@' },\n key: {},\n label: {},\n },\n parseDOM: [\n {\n tag: 'span[data-mention-key]',\n getAttrs: (dom: HTMLElement) => ({\n trigger: dom.getAttribute('data-mention-trigger') || '@',\n key: dom.getAttribute('data-mention-key'),\n label:\n dom.getAttribute('data-mention-label') || dom.textContent?.slice(1) || '',\n }),\n },\n ],\n toDOM(node) {\n const { trigger, key, label } = node.attrs;\n return [\n 'span',\n {\n class: 'nile-wysiwyg__mention',\n 'data-mention-trigger': trigger,\n 'data-mention-key': key,\n 'data-mention-label': label,\n },\n `${trigger}${label}`,\n ];\n },\n },\n\n /**\n * Merge field: an inline atom placeholder for mail-merge / personalization\n * (e.g. `{{first_name}}`). Stores a stable `id` and a human `label`; renders\n * the label (falling back to `{{id}}`) as a non-editable chip.\n */\n merge_field: {\n inline: true,\n group: 'inline',\n atom: true,\n selectable: true,\n attrs: { id: {}, label: { default: null } },\n parseDOM: [\n {\n tag: 'span[data-merge-field]',\n getAttrs: (dom: HTMLElement) => {\n const id = dom.getAttribute('data-merge-field');\n if (!id) return false;\n return {\n id,\n label: dom.getAttribute('data-merge-label') || dom.textContent || null,\n };\n },\n },\n ],\n toDOM(node) {\n const { id, label } = node.attrs;\n return [\n 'span',\n {\n class: 'nile-wysiwyg__merge-field',\n 'data-merge-field': id,\n 'data-merge-label': label ?? '',\n },\n label || `{{${id}}}`,\n ];\n },\n },\n\n /**\n * Math: an inline atom holding a LaTeX source string. Rendering is pluggable\n * via the editor's `mathRenderer` (KaTeX/MathJax, or MathML). Without a\n * renderer the raw LaTeX is shown in a math-styled chip. `display` chooses\n * inline vs. block presentation.\n */\n math: {\n inline: true,\n group: 'inline',\n atom: true,\n selectable: true,\n attrs: { latex: {}, display: { default: 'inline' } },\n parseDOM: [\n {\n tag: 'span[data-math]',\n getAttrs: (dom: HTMLElement) => ({\n latex: dom.getAttribute('data-math') || dom.textContent || '',\n display: dom.getAttribute('data-math-display') === 'block' ? 'block' : 'inline',\n }),\n },\n ],\n toDOM(node) {\n const { latex, display } = node.attrs;\n return [\n 'span',\n {\n class: 'nile-wysiwyg__math',\n 'data-math': latex,\n 'data-math-display': display,\n },\n latex,\n ];\n },\n },\n};\n\n/** Table nodes from prosemirror-tables, with cell background support. */\nconst tableNodeSpecs = tableNodes({\n tableGroup: 'block',\n cellContent: 'block+',\n cellAttributes: {\n background: {\n default: null,\n getFromDOM(dom) {\n return (dom as HTMLElement).style.backgroundColor || null;\n },\n setDOMAttr(value, attrs) {\n if (value) {\n attrs.style = `${(attrs.style as string) || ''}background-color: ${value};`;\n }\n },\n },\n },\n});\n\n/**\n * The table spec extended with a `layout` attr: layout tables (structured\n * layouts, e.g. for email HTML) serialize as `role=\"presentation\"` and render\n * borderless, with dashed guides visible only while editing.\n */\nconst baseTableSpec = tableNodeSpecs.table;\nconst tableSpec: NodeSpec = {\n ...baseTableSpec,\n attrs: { ...(baseTableSpec.attrs ?? {}), layout: { default: false } },\n parseDOM: [\n {\n tag: 'table',\n getAttrs: (dom: HTMLElement) => ({\n layout:\n dom.getAttribute('role') === 'presentation' || dom.hasAttribute('data-layout'),\n }),\n },\n ],\n toDOM(node) {\n return node.attrs.layout\n ? ['table', { role: 'presentation', 'data-layout': 'true' }, ['tbody', 0]]\n : ['table', ['tbody', 0]];\n },\n};\n\n/**\n * Marks. Order matters: marks later in the map render closer to the text.\n * Each styling mark parses from both semantic tags AND inline `style=`\n * declarations so pasted Word/Google Docs content keeps its formatting.\n */\nconst marks: Record<string, MarkSpec> = {\n link: {\n attrs: {\n href: {},\n title: { default: null },\n target: { default: null },\n },\n inclusive: false,\n parseDOM: [\n {\n tag: 'a[href]',\n getAttrs: (dom: HTMLElement) => ({\n href: dom.getAttribute('href'),\n title: dom.getAttribute('title'),\n target: dom.getAttribute('target'),\n }),\n },\n ],\n toDOM(mark) {\n const { href, title, target } = mark.attrs;\n const attrs: Record<string, string> = { href };\n if (title) attrs.title = title;\n if (target) {\n attrs.target = target;\n if (target === '_blank') attrs.rel = 'noopener noreferrer';\n }\n return ['a', attrs, 0];\n },\n },\n\n bold: {\n parseDOM: [\n { tag: 'strong' },\n // Google Docs wraps everything in <b style=\"font-weight: normal\">\n {\n tag: 'b',\n getAttrs: (dom: HTMLElement) => dom.style.fontWeight !== 'normal' && null,\n },\n {\n style: 'font-weight',\n getAttrs: (value: string) => /^(bold(er)?|[5-9]\\d{2,})$/.test(value) && null,\n },\n ],\n toDOM() {\n return ['strong', 0];\n },\n },\n\n italic: {\n parseDOM: [\n { tag: 'i' },\n { tag: 'em' },\n { style: 'font-style=italic' },\n ],\n toDOM() {\n return ['em', 0];\n },\n },\n\n underline: {\n parseDOM: [\n { tag: 'u' },\n {\n style: 'text-decoration',\n getAttrs: (value: string) => value.includes('underline') && null,\n },\n {\n style: 'text-decoration-line',\n getAttrs: (value: string) => value.includes('underline') && null,\n },\n ],\n toDOM() {\n return ['u', 0];\n },\n },\n\n strike: {\n parseDOM: [\n { tag: 's' },\n { tag: 'strike' },\n { tag: 'del' },\n {\n style: 'text-decoration',\n getAttrs: (value: string) => value.includes('line-through') && null,\n },\n {\n style: 'text-decoration-line',\n getAttrs: (value: string) => value.includes('line-through') && null,\n },\n ],\n toDOM() {\n return ['s', 0];\n },\n },\n\n /** Mutually exclusive vertical-shift marks (formulas, footnote refs). */\n subscript: {\n excludes: 'subscript superscript',\n parseDOM: [{ tag: 'sub' }, { style: 'vertical-align=sub' }],\n toDOM() {\n return ['sub', 0];\n },\n },\n\n superscript: {\n excludes: 'subscript superscript',\n parseDOM: [{ tag: 'sup' }, { style: 'vertical-align=super' }],\n toDOM() {\n return ['sup', 0];\n },\n },\n\n code: {\n parseDOM: [{ tag: 'code' }],\n toDOM() {\n return ['code', { class: 'nile-wysiwyg__inline-code' }, 0];\n },\n },\n\n text_color: {\n attrs: { color: {} },\n parseDOM: [\n {\n style: 'color',\n getAttrs: (value: string) => (value ? { color: value } : false),\n },\n ],\n toDOM(mark) {\n return ['span', { style: `color: ${mark.attrs.color}` }, 0];\n },\n },\n\n bg_color: {\n attrs: { color: {} },\n parseDOM: [\n {\n style: 'background-color',\n getAttrs: (value: string) =>\n value && value !== 'transparent' ? { color: value } : false,\n },\n ],\n toDOM(mark) {\n return ['span', { style: `background-color: ${mark.attrs.color}` }, 0];\n },\n },\n\n font_family: {\n attrs: { family: {} },\n parseDOM: [\n {\n style: 'font-family',\n getAttrs: (value: string) => (value ? { family: value } : false),\n },\n ],\n toDOM(mark) {\n return ['span', { style: `font-family: ${mark.attrs.family}` }, 0];\n },\n },\n\n font_size: {\n attrs: { size: {} },\n parseDOM: [\n {\n style: 'font-size',\n getAttrs: (value: string) => (value ? { size: value } : false),\n },\n ],\n toDOM(mark) {\n return ['span', { style: `font-size: ${mark.attrs.size}` }, 0];\n },\n },\n};\n\n/** Bullet markers CSS understands; anything else falls back to default. */\nexport const BULLET_STYLES = ['disc', 'circle', 'square'] as const;\n\n/** Numbering styles, keyed by the HTML `type` attribute letter. */\nexport const ORDERED_STYLES: Record<string, string> = {\n '1': 'decimal',\n a: 'lower-alpha',\n A: 'upper-alpha',\n i: 'lower-roman',\n I: 'upper-roman',\n};\n\nconst STYLE_TO_TYPE: Record<string, string> = Object.fromEntries(\n Object.entries(ORDERED_STYLES).map(([type, style]) => [style, type])\n);\n\n/**\n * Legal-style continuous numbering (1, 1.1, 1.1.1). Not a CSS\n * list-style-type: it serializes as `data-list-style=\"multilevel\"` and is\n * rendered with CSS counters (see the editor stylesheet). Consumers rendering\n * the output need the same counter rules.\n */\nexport const MULTILEVEL_STYLE = 'multilevel';\n\n/** List specs from prosemirror-schema-list, extended with style attrs. */\nconst bulletListSpec: NodeSpec = {\n content: 'list_item+',\n group: 'block',\n attrs: { style: { default: null } },\n parseDOM: [\n {\n tag: 'ul',\n getAttrs: (dom: HTMLElement) => {\n const style = dom.style.listStyleType;\n return {\n style: (BULLET_STYLES as readonly string[]).includes(style) ? style : null,\n };\n },\n },\n ],\n toDOM(node) {\n return node.attrs.style\n ? ['ul', { style: `list-style-type: ${node.attrs.style}` }, 0]\n : ['ul', 0];\n },\n};\n\nconst orderedListSpec: NodeSpec = {\n content: 'list_item+',\n group: 'block',\n attrs: { order: { default: 1 }, style: { default: null } },\n parseDOM: [\n {\n tag: 'ol',\n getAttrs: (dom: HTMLElement) => {\n const type = dom.getAttribute('type') ?? '';\n const cssStyle = dom.style.listStyleType;\n const style =\n dom.getAttribute('data-list-style') === MULTILEVEL_STYLE\n ? MULTILEVEL_STYLE\n : ORDERED_STYLES[type] ??\n (Object.values(ORDERED_STYLES).includes(cssStyle) ? cssStyle : null);\n const start = Number(dom.getAttribute('start'));\n return {\n order: Number.isFinite(start) && start > 0 ? start : 1,\n style,\n };\n },\n },\n ],\n toDOM(node) {\n const attrs: Record<string, string> = {};\n if (node.attrs.order !== 1) attrs.start = String(node.attrs.order);\n if (node.attrs.style === MULTILEVEL_STYLE) {\n attrs['data-list-style'] = MULTILEVEL_STYLE;\n } else if (node.attrs.style && STYLE_TO_TYPE[node.attrs.style]) {\n attrs.type = STYLE_TO_TYPE[node.attrs.style];\n }\n return ['ol', attrs, 0];\n },\n};\n\n/** Builds the editor schema. List nodes are added via prosemirror-schema-list. */\nexport function createSchema(): Schema {\n const nodeMap = addListNodes(\n OrderedMap.from(nodes),\n 'paragraph block*',\n 'block'\n )\n .update('bullet_list', bulletListSpec)\n .update('ordered_list', orderedListSpec)\n .append(tableNodeSpecs)\n .update('table', tableSpec);\n return new Schema({ nodes: nodeMap, marks: OrderedMap.from(marks) });\n}\n\n/** A shared default schema instance. */\nexport const defaultSchema = createSchema();\n"]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { EditorState } from 'prosemirror-state';
|
|
2
|
+
import type { Alignment } from './schema';
|
|
3
|
+
/**
|
|
4
|
+
* Immutable snapshot of everything the toolbar needs to render. Computed once
|
|
5
|
+
* per transaction in the host's dispatchTransaction and passed down as a
|
|
6
|
+
* single reactive property.
|
|
7
|
+
*/
|
|
8
|
+
export interface ToolbarState {
|
|
9
|
+
bold: boolean;
|
|
10
|
+
italic: boolean;
|
|
11
|
+
underline: boolean;
|
|
12
|
+
strike: boolean;
|
|
13
|
+
subscript: boolean;
|
|
14
|
+
superscript: boolean;
|
|
15
|
+
code: boolean;
|
|
16
|
+
/** 'paragraph' | 'heading' for the innermost textblock at the cursor. */
|
|
17
|
+
blockType: string;
|
|
18
|
+
headingLevel: number | null;
|
|
19
|
+
align: Alignment | null;
|
|
20
|
+
/** Line height ('1.5') of the textblock at the cursor, null = default. */
|
|
21
|
+
lineHeight: string | null;
|
|
22
|
+
inBulletList: boolean;
|
|
23
|
+
inOrderedList: boolean;
|
|
24
|
+
inTaskList: boolean;
|
|
25
|
+
inBlockquote: boolean;
|
|
26
|
+
inTable: boolean;
|
|
27
|
+
/** The surrounding table is a layout (presentation) table. */
|
|
28
|
+
tableLayout: boolean;
|
|
29
|
+
/** Margin-indent level (0..MAX_INDENT) of the textblock at the cursor. */
|
|
30
|
+
blockIndent: number;
|
|
31
|
+
/** list-style-type of the surrounding list ('' = default). */
|
|
32
|
+
listStyle: string | null;
|
|
33
|
+
/** Start number of the surrounding ordered list. */
|
|
34
|
+
listStart: number | null;
|
|
35
|
+
/** An image or figure is selected (or the cursor is in a caption). */
|
|
36
|
+
imageSelected: boolean;
|
|
37
|
+
/** The selected image is a captioned figure. */
|
|
38
|
+
imageIsFigure: boolean;
|
|
39
|
+
/** Alignment of the selected figure. */
|
|
40
|
+
imageAlign: string | null;
|
|
41
|
+
/** A video embed is selected. */
|
|
42
|
+
embedSelected: boolean;
|
|
43
|
+
/** Alignment of the selected embed. */
|
|
44
|
+
embedAlign: string | null;
|
|
45
|
+
inCodeBlock: boolean;
|
|
46
|
+
/** Language attr of the surrounding code block ('' = auto). */
|
|
47
|
+
codeBlockLanguage: string | null;
|
|
48
|
+
canUndo: boolean;
|
|
49
|
+
canRedo: boolean;
|
|
50
|
+
linkActive: boolean;
|
|
51
|
+
linkHref: string | null;
|
|
52
|
+
textColor: string | null;
|
|
53
|
+
bgColor: string | null;
|
|
54
|
+
fontFamily: string | null;
|
|
55
|
+
fontSize: string | null;
|
|
56
|
+
/** True when the selection is a cursor (no range). */
|
|
57
|
+
selectionEmpty: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Whether the host's "paste as plain text" toggle is on. Not derivable from
|
|
60
|
+
* editor state, so the host injects it after computeToolbarState().
|
|
61
|
+
*/
|
|
62
|
+
pasteAsPlainText?: boolean;
|
|
63
|
+
/** Whether the host is in fullscreen mode. Injected like pasteAsPlainText. */
|
|
64
|
+
fullscreen?: boolean;
|
|
65
|
+
/** Whether block boundaries are outlined. Injected like pasteAsPlainText. */
|
|
66
|
+
showBlocks?: boolean;
|
|
67
|
+
/** Whether the format painter is armed. Injected like pasteAsPlainText. */
|
|
68
|
+
formatPainter?: boolean;
|
|
69
|
+
}
|
|
70
|
+
export declare function computeToolbarState(state: EditorState): ToolbarState;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { undo, redo } from 'prosemirror-history';
|
|
2
|
+
import { getMarkRange, selectedImageInfo, selectedEmbedInfo } from './commands';
|
|
3
|
+
function markActive(state, type) {
|
|
4
|
+
const { from, $from, to, empty } = state.selection;
|
|
5
|
+
if (empty)
|
|
6
|
+
return !!type.isInSet(state.storedMarks || $from.marks());
|
|
7
|
+
return state.doc.rangeHasMark(from, to, type);
|
|
8
|
+
}
|
|
9
|
+
function markAttr(state, type, attr) {
|
|
10
|
+
const { $from, from, to, empty } = state.selection;
|
|
11
|
+
if (empty) {
|
|
12
|
+
const mark = type.isInSet(state.storedMarks || $from.marks());
|
|
13
|
+
return mark ? (mark.attrs[attr] ?? null) : null;
|
|
14
|
+
}
|
|
15
|
+
// Range: report the first occurrence of the mark inside the selection.
|
|
16
|
+
// (Boundary marks() lookups miss non-inclusive marks like link.)
|
|
17
|
+
let found = null;
|
|
18
|
+
state.doc.nodesBetween(from, to, node => {
|
|
19
|
+
if (found !== null || !node.isText)
|
|
20
|
+
return found === null;
|
|
21
|
+
const mark = type.isInSet(node.marks);
|
|
22
|
+
if (mark)
|
|
23
|
+
found = mark.attrs[attr] ?? null;
|
|
24
|
+
return found === null;
|
|
25
|
+
});
|
|
26
|
+
return found;
|
|
27
|
+
}
|
|
28
|
+
export function computeToolbarState(state) {
|
|
29
|
+
const { schema } = state;
|
|
30
|
+
const { $from, from, to, empty } = state.selection;
|
|
31
|
+
// $from.parent is the doc (not a textblock) for AllSelection / block
|
|
32
|
+
// NodeSelections; report the first textblock in the range instead so the
|
|
33
|
+
// toolbar reflects what's actually selected.
|
|
34
|
+
let parent = $from.parent;
|
|
35
|
+
if (!parent.isTextblock) {
|
|
36
|
+
let firstTextblock = null;
|
|
37
|
+
state.doc.nodesBetween(from, to, node => {
|
|
38
|
+
if (!firstTextblock && node.isTextblock)
|
|
39
|
+
firstTextblock = node;
|
|
40
|
+
return !firstTextblock;
|
|
41
|
+
});
|
|
42
|
+
if (firstTextblock)
|
|
43
|
+
parent = firstTextblock;
|
|
44
|
+
}
|
|
45
|
+
const blockType = parent.type.name;
|
|
46
|
+
const headingLevel = blockType === 'heading' ? parent.attrs.level : null;
|
|
47
|
+
const align = parent.type.spec.attrs && 'align' in parent.type.spec.attrs
|
|
48
|
+
? (parent.attrs.align ?? null)
|
|
49
|
+
: null;
|
|
50
|
+
let inBulletList = false;
|
|
51
|
+
let inOrderedList = false;
|
|
52
|
+
let inTaskList = false;
|
|
53
|
+
let inBlockquote = false;
|
|
54
|
+
let inTable = false;
|
|
55
|
+
let tableLayout = false;
|
|
56
|
+
let listStyle = null;
|
|
57
|
+
let listStart = null;
|
|
58
|
+
for (let depth = $from.depth; depth > 0; depth -= 1) {
|
|
59
|
+
const node = $from.node(depth);
|
|
60
|
+
if (node.type === schema.nodes.bullet_list) {
|
|
61
|
+
inBulletList = true;
|
|
62
|
+
if (listStyle === null)
|
|
63
|
+
listStyle = node.attrs.style ?? null;
|
|
64
|
+
}
|
|
65
|
+
else if (node.type === schema.nodes.ordered_list) {
|
|
66
|
+
inOrderedList = true;
|
|
67
|
+
if (listStyle === null)
|
|
68
|
+
listStyle = node.attrs.style ?? null;
|
|
69
|
+
if (listStart === null)
|
|
70
|
+
listStart = node.attrs.order ?? 1;
|
|
71
|
+
}
|
|
72
|
+
else if (node.type === schema.nodes.task_list)
|
|
73
|
+
inTaskList = true;
|
|
74
|
+
else if (node.type === schema.nodes.blockquote)
|
|
75
|
+
inBlockquote = true;
|
|
76
|
+
else if (node.type === schema.nodes.table) {
|
|
77
|
+
inTable = true;
|
|
78
|
+
tableLayout = !!node.attrs.layout;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const imageInfo = selectedImageInfo(state);
|
|
82
|
+
const embedInfo = selectedEmbedInfo(state);
|
|
83
|
+
const linkActive = markActive(state, schema.marks.link);
|
|
84
|
+
let linkHref = null;
|
|
85
|
+
if (linkActive) {
|
|
86
|
+
linkHref = markAttr(state, schema.marks.link, 'href');
|
|
87
|
+
if (linkHref === null && empty) {
|
|
88
|
+
const range = getMarkRange($from, schema.marks.link);
|
|
89
|
+
if (range) {
|
|
90
|
+
const mark = schema.marks.link.isInSet(state.doc.resolve(range.from + 1).marks());
|
|
91
|
+
linkHref = mark ? mark.attrs.href : null;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
bold: markActive(state, schema.marks.bold),
|
|
97
|
+
italic: markActive(state, schema.marks.italic),
|
|
98
|
+
underline: markActive(state, schema.marks.underline),
|
|
99
|
+
strike: markActive(state, schema.marks.strike),
|
|
100
|
+
subscript: markActive(state, schema.marks.subscript),
|
|
101
|
+
superscript: markActive(state, schema.marks.superscript),
|
|
102
|
+
code: markActive(state, schema.marks.code),
|
|
103
|
+
blockType,
|
|
104
|
+
headingLevel,
|
|
105
|
+
align,
|
|
106
|
+
lineHeight: parent.type.spec.attrs && 'lineHeight' in parent.type.spec.attrs
|
|
107
|
+
? (parent.attrs.lineHeight ?? null)
|
|
108
|
+
: null,
|
|
109
|
+
inBulletList,
|
|
110
|
+
inOrderedList,
|
|
111
|
+
inTaskList,
|
|
112
|
+
inBlockquote,
|
|
113
|
+
inTable,
|
|
114
|
+
tableLayout,
|
|
115
|
+
blockIndent: parent.type.spec.attrs && 'indent' in parent.type.spec.attrs
|
|
116
|
+
? (parent.attrs.indent ?? 0)
|
|
117
|
+
: 0,
|
|
118
|
+
listStyle,
|
|
119
|
+
listStart,
|
|
120
|
+
imageSelected: imageInfo !== null,
|
|
121
|
+
imageIsFigure: imageInfo?.isFigure ?? false,
|
|
122
|
+
imageAlign: imageInfo?.isFigure ? (imageInfo.node.attrs.align ?? null) : null,
|
|
123
|
+
embedSelected: embedInfo !== null,
|
|
124
|
+
embedAlign: embedInfo?.node.attrs.align ?? null,
|
|
125
|
+
inCodeBlock: blockType === 'code_block',
|
|
126
|
+
codeBlockLanguage: blockType === 'code_block' ? (parent.attrs.language ?? null) : null,
|
|
127
|
+
canUndo: undo(state),
|
|
128
|
+
canRedo: redo(state),
|
|
129
|
+
linkActive,
|
|
130
|
+
linkHref,
|
|
131
|
+
textColor: markAttr(state, schema.marks.text_color, 'color'),
|
|
132
|
+
bgColor: markAttr(state, schema.marks.bg_color, 'color'),
|
|
133
|
+
fontFamily: markAttr(state, schema.marks.font_family, 'family'),
|
|
134
|
+
fontSize: markAttr(state, schema.marks.font_size, 'size'),
|
|
135
|
+
selectionEmpty: empty,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=selection-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection-state.js","sourceRoot":"","sources":["../../../../src/nile-wysiwyg-editor/engine/selection-state.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAsEhF,SAAS,UAAU,CAAC,KAAkB,EAAE,IAAc;IACpD,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,SAAS,CAAC;IACnD,IAAI,KAAK;QAAE,OAAO,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;IACrE,OAAO,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,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AQ,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC;QACxD,UAAU,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,WAAW,EAAE,QAAQ,CAAC;QAC/D,QAAQ,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC;QACzD,cAAc,EAAE,KAAK;KACtB,CAAC;AACJ,CAAC","sourcesContent":["import { EditorState } from 'prosemirror-state';\nimport { MarkType, Node as PMNode } from 'prosemirror-model';\nimport { undo, redo } from 'prosemirror-history';\nimport type { Alignment } from './schema';\nimport { getMarkRange, selectedImageInfo, selectedEmbedInfo } from './commands';\n\n/**\n * Immutable snapshot of everything the toolbar needs to render. Computed once\n * per transaction in the host's dispatchTransaction and passed down as a\n * single reactive property.\n */\nexport interface ToolbarState {\n bold: boolean;\n italic: boolean;\n underline: boolean;\n strike: boolean;\n subscript: boolean;\n superscript: boolean;\n code: boolean;\n /** 'paragraph' | 'heading' for the innermost textblock at the cursor. */\n blockType: string;\n headingLevel: number | null;\n align: Alignment | null;\n /** Line height ('1.5') of the textblock at the cursor, null = default. */\n lineHeight: string | null;\n inBulletList: boolean;\n inOrderedList: boolean;\n inTaskList: boolean;\n inBlockquote: boolean;\n inTable: boolean;\n /** The surrounding table is a layout (presentation) table. */\n tableLayout: boolean;\n /** Margin-indent level (0..MAX_INDENT) of the textblock at the cursor. */\n blockIndent: number;\n /** list-style-type of the surrounding list ('' = default). */\n listStyle: string | null;\n /** Start number of the surrounding ordered list. */\n listStart: number | null;\n /** An image or figure is selected (or the cursor is in a caption). */\n imageSelected: boolean;\n /** The selected image is a captioned figure. */\n imageIsFigure: boolean;\n /** Alignment of the selected figure. */\n imageAlign: string | null;\n /** A video embed is selected. */\n embedSelected: boolean;\n /** Alignment of the selected embed. */\n embedAlign: string | null;\n inCodeBlock: boolean;\n /** Language attr of the surrounding code block ('' = auto). */\n codeBlockLanguage: string | null;\n canUndo: boolean;\n canRedo: boolean;\n linkActive: boolean;\n linkHref: string | null;\n textColor: string | null;\n bgColor: string | null;\n fontFamily: string | null;\n fontSize: string | null;\n /** True when the selection is a cursor (no range). */\n selectionEmpty: boolean;\n /**\n * Whether the host's \"paste as plain text\" toggle is on. Not derivable from\n * editor state, so the host injects it after computeToolbarState().\n */\n pasteAsPlainText?: boolean;\n /** Whether the host is in fullscreen mode. Injected like pasteAsPlainText. */\n fullscreen?: boolean;\n /** Whether block boundaries are outlined. Injected like pasteAsPlainText. */\n showBlocks?: boolean;\n /** Whether the format painter is armed. Injected like pasteAsPlainText. */\n formatPainter?: boolean;\n}\n\nfunction markActive(state: EditorState, type: MarkType): boolean {\n const { from, $from, to, empty } = state.selection;\n if (empty) return !!type.isInSet(state.storedMarks || $from.marks());\n return state.doc.rangeHasMark(from, to, type);\n}\n\nfunction markAttr(state: EditorState, type: MarkType, attr: string): string | null {\n const { $from, from, to, empty } = state.selection;\n if (empty) {\n const mark = type.isInSet(state.storedMarks || $from.marks());\n return mark ? ((mark.attrs[attr] as string) ?? null) : null;\n }\n // Range: report the first occurrence of the mark inside the selection.\n // (Boundary marks() lookups miss non-inclusive marks like link.)\n let found: string | null = null;\n state.doc.nodesBetween(from, to, node => {\n if (found !== null || !node.isText) return found === null;\n const mark = type.isInSet(node.marks);\n if (mark) found = (mark.attrs[attr] as string) ?? null;\n return found === null;\n });\n return found;\n}\n\nexport function computeToolbarState(state: EditorState): ToolbarState {\n const { schema } = state;\n const { $from, from, to, empty } = state.selection;\n\n // $from.parent is the doc (not a textblock) for AllSelection / block\n // NodeSelections; report the first textblock in the range instead so the\n // toolbar reflects what's actually selected.\n let parent = $from.parent;\n if (!parent.isTextblock) {\n let firstTextblock: PMNode | null = null;\n state.doc.nodesBetween(from, to, node => {\n if (!firstTextblock && node.isTextblock) firstTextblock = node;\n return !firstTextblock;\n });\n if (firstTextblock) parent = firstTextblock;\n }\n const blockType = parent.type.name;\n const headingLevel = blockType === 'heading' ? (parent.attrs.level as number) : null;\n const align =\n parent.type.spec.attrs && 'align' in parent.type.spec.attrs\n ? ((parent.attrs.align as Alignment) ?? null)\n : null;\n\n let inBulletList = false;\n let inOrderedList = false;\n let inTaskList = false;\n let inBlockquote = false;\n let inTable = false;\n let tableLayout = false;\n let listStyle: string | null = null;\n let listStart: number | null = null;\n for (let depth = $from.depth; depth > 0; depth -= 1) {\n const node = $from.node(depth);\n if (node.type === schema.nodes.bullet_list) {\n inBulletList = true;\n if (listStyle === null) listStyle = (node.attrs.style as string) ?? null;\n } else if (node.type === schema.nodes.ordered_list) {\n inOrderedList = true;\n if (listStyle === null) listStyle = (node.attrs.style as string) ?? null;\n if (listStart === null) listStart = (node.attrs.order as number) ?? 1;\n } else if (node.type === schema.nodes.task_list) inTaskList = true;\n else if (node.type === schema.nodes.blockquote) inBlockquote = true;\n else if (node.type === schema.nodes.table) {\n inTable = true;\n tableLayout = !!node.attrs.layout;\n }\n }\n\n const imageInfo = selectedImageInfo(state);\n const embedInfo = selectedEmbedInfo(state);\n\n const linkActive = markActive(state, schema.marks.link);\n let linkHref: string | null = null;\n if (linkActive) {\n linkHref = markAttr(state, schema.marks.link, 'href');\n if (linkHref === null && empty) {\n const range = getMarkRange($from, schema.marks.link);\n if (range) {\n const mark = schema.marks.link.isInSet(\n state.doc.resolve(range.from + 1).marks()\n );\n linkHref = mark ? (mark.attrs.href as string) : null;\n }\n }\n }\n\n return {\n bold: markActive(state, schema.marks.bold),\n italic: markActive(state, schema.marks.italic),\n underline: markActive(state, schema.marks.underline),\n strike: markActive(state, schema.marks.strike),\n subscript: markActive(state, schema.marks.subscript),\n superscript: markActive(state, schema.marks.superscript),\n code: markActive(state, schema.marks.code),\n blockType,\n headingLevel,\n align,\n lineHeight:\n parent.type.spec.attrs && 'lineHeight' in parent.type.spec.attrs\n ? ((parent.attrs.lineHeight as string) ?? null)\n : null,\n inBulletList,\n inOrderedList,\n inTaskList,\n inBlockquote,\n inTable,\n tableLayout,\n blockIndent:\n parent.type.spec.attrs && 'indent' in parent.type.spec.attrs\n ? ((parent.attrs.indent as number) ?? 0)\n : 0,\n listStyle,\n listStart,\n imageSelected: imageInfo !== null,\n imageIsFigure: imageInfo?.isFigure ?? false,\n imageAlign: imageInfo?.isFigure ? ((imageInfo.node.attrs.align as string) ?? null) : null,\n embedSelected: embedInfo !== null,\n embedAlign: (embedInfo?.node.attrs.align as string) ?? null,\n inCodeBlock: blockType === 'code_block',\n codeBlockLanguage:\n blockType === 'code_block' ? ((parent.attrs.language as string) ?? null) : null,\n canUndo: undo(state),\n canRedo: redo(state),\n linkActive,\n linkHref,\n textColor: markAttr(state, schema.marks.text_color, 'color'),\n bgColor: markAttr(state, schema.marks.bg_color, 'color'),\n fontFamily: markAttr(state, schema.marks.font_family, 'family'),\n fontSize: markAttr(state, schema.marks.font_size, 'size'),\n selectionEmpty: empty,\n };\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Node as PMNode, Schema, Slice } from 'prosemirror-model';
|
|
2
|
+
/** Parses an HTML string into a document node, sanitizing by default. */
|
|
3
|
+
export declare function htmlToDoc(schema: Schema, html: string, sanitize?: boolean): PMNode;
|
|
4
|
+
/** Parses an HTML string into a slice suitable for replaceSelection. */
|
|
5
|
+
export declare function htmlToSlice(schema: Schema, html: string, sanitize?: boolean): Slice;
|
|
6
|
+
/** Serializes a document node back to an HTML string. */
|
|
7
|
+
export declare function docToHtml(doc: PMNode): string;
|
|
8
|
+
/** Plain-text projection of the document (blocks joined by newlines). */
|
|
9
|
+
export declare function docToText(doc: PMNode): string;
|
|
10
|
+
export declare function docToJson(doc: PMNode): Record<string, unknown>;
|
|
11
|
+
export declare function jsonToDoc(schema: Schema, json: Record<string, unknown>): PMNode;
|
|
12
|
+
/** Word and character counts over the document's text content. */
|
|
13
|
+
export declare function countWords(doc: PMNode): {
|
|
14
|
+
words: number;
|
|
15
|
+
characters: number;
|
|
16
|
+
};
|
|
17
|
+
/** True when the document has no visible content. */
|
|
18
|
+
export declare function isDocEmpty(doc: PMNode): boolean;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { DOMParser as PMDOMParser, DOMSerializer, Node as PMNode, } from 'prosemirror-model';
|
|
2
|
+
import { sanitizeHtml } from './sanitize';
|
|
3
|
+
const parserCache = new WeakMap();
|
|
4
|
+
const serializerCache = new WeakMap();
|
|
5
|
+
function getParser(schema) {
|
|
6
|
+
let parser = parserCache.get(schema);
|
|
7
|
+
if (!parser) {
|
|
8
|
+
parser = PMDOMParser.fromSchema(schema);
|
|
9
|
+
parserCache.set(schema, parser);
|
|
10
|
+
}
|
|
11
|
+
return parser;
|
|
12
|
+
}
|
|
13
|
+
function getSerializer(schema) {
|
|
14
|
+
let serializer = serializerCache.get(schema);
|
|
15
|
+
if (!serializer) {
|
|
16
|
+
serializer = DOMSerializer.fromSchema(schema);
|
|
17
|
+
serializerCache.set(schema, serializer);
|
|
18
|
+
}
|
|
19
|
+
return serializer;
|
|
20
|
+
}
|
|
21
|
+
/** Parses an HTML string into a document node, sanitizing by default. */
|
|
22
|
+
export function htmlToDoc(schema, html, sanitize = true) {
|
|
23
|
+
const clean = sanitize ? sanitizeHtml(html) : html;
|
|
24
|
+
const dom = new DOMParser().parseFromString(`<body>${clean}</body>`, 'text/html');
|
|
25
|
+
return getParser(schema).parse(dom.body);
|
|
26
|
+
}
|
|
27
|
+
/** Parses an HTML string into a slice suitable for replaceSelection. */
|
|
28
|
+
export function htmlToSlice(schema, html, sanitize = true) {
|
|
29
|
+
const clean = sanitize ? sanitizeHtml(html) : html;
|
|
30
|
+
const dom = new DOMParser().parseFromString(`<body>${clean}</body>`, 'text/html');
|
|
31
|
+
return getParser(schema).parseSlice(dom.body, { preserveWhitespace: true });
|
|
32
|
+
}
|
|
33
|
+
/** Serializes a document node back to an HTML string. */
|
|
34
|
+
export function docToHtml(doc) {
|
|
35
|
+
const schema = doc.type.schema;
|
|
36
|
+
const container = document.createElement('div');
|
|
37
|
+
container.appendChild(getSerializer(schema).serializeFragment(doc.content));
|
|
38
|
+
return container.innerHTML;
|
|
39
|
+
}
|
|
40
|
+
/** Plain-text projection of the document (blocks joined by newlines). */
|
|
41
|
+
export function docToText(doc) {
|
|
42
|
+
return doc.textBetween(0, doc.content.size, '\n', ' ');
|
|
43
|
+
}
|
|
44
|
+
export function docToJson(doc) {
|
|
45
|
+
return doc.toJSON();
|
|
46
|
+
}
|
|
47
|
+
export function jsonToDoc(schema, json) {
|
|
48
|
+
return PMNode.fromJSON(schema, json);
|
|
49
|
+
}
|
|
50
|
+
/** Word and character counts over the document's text content. */
|
|
51
|
+
export function countWords(doc) {
|
|
52
|
+
const text = docToText(doc);
|
|
53
|
+
const words = text.trim() ? text.trim().split(/\s+/).length : 0;
|
|
54
|
+
return { words, characters: text.replace(/\n/g, '').length };
|
|
55
|
+
}
|
|
56
|
+
/** True when the document has no visible content. */
|
|
57
|
+
export function isDocEmpty(doc) {
|
|
58
|
+
if (doc.childCount > 1)
|
|
59
|
+
return false;
|
|
60
|
+
const first = doc.firstChild;
|
|
61
|
+
return !first || (first.type.name === 'paragraph' && first.content.size === 0);
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=serializer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializer.js","sourceRoot":"","sources":["../../../../src/nile-wysiwyg-editor/engine/serializer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,IAAI,WAAW,EACxB,aAAa,EACb,IAAI,IAAI,MAAM,GAGf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,WAAW,GAAG,IAAI,OAAO,EAAuB,CAAC;AACvD,MAAM,eAAe,GAAG,IAAI,OAAO,EAAyB,CAAC;AAE7D,SAAS,SAAS,CAAC,MAAc;IAC/B,IAAI,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC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AACrD,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,IAAI,GAAG,CAAC,UAAU,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IACrC,MAAM,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC;IAC7B,OAAO,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC;AACjF,CAAC","sourcesContent":["import {\n DOMParser as PMDOMParser,\n DOMSerializer,\n Node as PMNode,\n Schema,\n Slice,\n} from 'prosemirror-model';\nimport { sanitizeHtml } from './sanitize';\n\nconst parserCache = new WeakMap<Schema, PMDOMParser>();\nconst serializerCache = new WeakMap<Schema, DOMSerializer>();\n\nfunction getParser(schema: Schema): PMDOMParser {\n let parser = parserCache.get(schema);\n if (!parser) {\n parser = PMDOMParser.fromSchema(schema);\n parserCache.set(schema, parser);\n }\n return parser;\n}\n\nfunction getSerializer(schema: Schema): DOMSerializer {\n let serializer = serializerCache.get(schema);\n if (!serializer) {\n serializer = DOMSerializer.fromSchema(schema);\n serializerCache.set(schema, serializer);\n }\n return serializer;\n}\n\n/** Parses an HTML string into a document node, sanitizing by default. */\nexport function htmlToDoc(schema: Schema, html: string, sanitize = true): PMNode {\n const clean = sanitize ? sanitizeHtml(html) : html;\n const dom = new DOMParser().parseFromString(`<body>${clean}</body>`, 'text/html');\n return getParser(schema).parse(dom.body);\n}\n\n/** Parses an HTML string into a slice suitable for replaceSelection. */\nexport function htmlToSlice(schema: Schema, html: string, sanitize = true): Slice {\n const clean = sanitize ? sanitizeHtml(html) : html;\n const dom = new DOMParser().parseFromString(`<body>${clean}</body>`, 'text/html');\n return getParser(schema).parseSlice(dom.body, { preserveWhitespace: true });\n}\n\n/** Serializes a document node back to an HTML string. */\nexport function docToHtml(doc: PMNode): string {\n const schema = doc.type.schema;\n const container = document.createElement('div');\n container.appendChild(getSerializer(schema).serializeFragment(doc.content));\n return container.innerHTML;\n}\n\n/** Plain-text projection of the document (blocks joined by newlines). */\nexport function docToText(doc: PMNode): string {\n return doc.textBetween(0, doc.content.size, '\\n', ' ');\n}\n\nexport function docToJson(doc: PMNode): Record<string, unknown> {\n return doc.toJSON();\n}\n\nexport function jsonToDoc(schema: Schema, json: Record<string, unknown>): PMNode {\n return PMNode.fromJSON(schema, json);\n}\n\n/** Word and character counts over the document's text content. */\nexport function countWords(doc: PMNode): { words: number; characters: number } {\n const text = docToText(doc);\n const words = text.trim() ? text.trim().split(/\\s+/).length : 0;\n return { words, characters: text.replace(/\\n/g, '').length };\n}\n\n/** True when the document has no visible content. */\nexport function isDocEmpty(doc: PMNode): boolean {\n if (doc.childCount > 1) return false;\n const first = doc.firstChild;\n return !first || (first.type.name === 'paragraph' && first.content.size === 0);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/nile-wysiwyg-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEnE,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC","sourcesContent":["export { NileWysiwygEditor, default } from './nile-wysiwyg-editor';\nexport type { WysiwygChangeDetail, WysiwygCommandDetail, ToolbarConfig } from './types';\nexport { DEFAULT_TOOLBAR } from './types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|