@aquera/nile-elements 1.9.5 → 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 +9 -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 +3802 -664
- 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-chip/nile-chip.css.cjs.js +1 -1
- package/dist/nile-chip/nile-chip.css.cjs.js.map +1 -1
- package/dist/nile-chip/nile-chip.css.esm.js +8 -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 +4 -4
- 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-hero/nile-hero.cjs.js +1 -1
- package/dist/nile-hero/nile-hero.cjs.js.map +1 -1
- package/dist/nile-hero/nile-hero.css.cjs.js +1 -1
- package/dist/nile-hero/nile-hero.css.cjs.js.map +1 -1
- package/dist/nile-hero/nile-hero.css.esm.js +14 -14
- package/dist/nile-hero/nile-hero.esm.js +1 -1
- package/dist/nile-hero-header/nile-hero-header.cjs.js +1 -1
- package/dist/nile-hero-header/nile-hero-header.cjs.js.map +1 -1
- package/dist/nile-hero-header/nile-hero-header.css.cjs.js +1 -1
- package/dist/nile-hero-header/nile-hero-header.css.cjs.js.map +1 -1
- package/dist/nile-hero-header/nile-hero-header.css.esm.js +11 -11
- package/dist/nile-hero-header/nile-hero-header.esm.js +3 -3
- 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-rich-text-editor/index.cjs.js +1 -1
- package/dist/nile-rich-text-editor/index.esm.js +1 -1
- package/dist/nile-rich-text-editor/nile-rich-text-editor.cjs.js +1 -1
- package/dist/nile-rich-text-editor/nile-rich-text-editor.cjs.js.map +1 -1
- package/dist/nile-rich-text-editor/nile-rich-text-editor.css.cjs.js +1 -1
- package/dist/nile-rich-text-editor/nile-rich-text-editor.css.cjs.js.map +1 -1
- package/dist/nile-rich-text-editor/nile-rich-text-editor.css.esm.js +70 -0
- package/dist/nile-rich-text-editor/nile-rich-text-editor.esm.js +1 -1
- package/dist/nile-rich-text-editor/nile-rte-image.cjs.js +3 -0
- package/dist/nile-rich-text-editor/nile-rte-image.cjs.js.map +1 -0
- package/dist/nile-rich-text-editor/nile-rte-image.esm.js +96 -0
- 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-chip/nile-chip.css.js +8 -1
- package/dist/src/nile-chip/nile-chip.css.js.map +1 -1
- package/dist/src/nile-code-editor/nile-code-editor.js +3 -3
- package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
- package/dist/src/nile-hero/nile-hero.css.js +12 -12
- package/dist/src/nile-hero/nile-hero.css.js.map +1 -1
- package/dist/src/nile-hero/nile-hero.js +1 -1
- package/dist/src/nile-hero/nile-hero.js.map +1 -1
- package/dist/src/nile-hero-header/nile-hero-header.css.js +9 -9
- package/dist/src/nile-hero-header/nile-hero-header.css.js.map +1 -1
- package/dist/src/nile-hero-header/nile-hero-header.js +1 -1
- package/dist/src/nile-hero-header/nile-hero-header.js.map +1 -1
- package/dist/src/nile-rich-text-editor/nile-rich-text-editor.css.js +70 -0
- package/dist/src/nile-rich-text-editor/nile-rich-text-editor.css.js.map +1 -1
- package/dist/src/nile-rich-text-editor/nile-rich-text-editor.d.ts +3 -0
- package/dist/src/nile-rich-text-editor/nile-rich-text-editor.js +81 -3
- package/dist/src/nile-rich-text-editor/nile-rich-text-editor.js.map +1 -1
- package/dist/src/nile-rich-text-editor/nile-rte-image.d.ts +87 -0
- package/dist/src/nile-rich-text-editor/nile-rte-image.js +1073 -0
- package/dist/src/nile-rich-text-editor/nile-rte-image.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-chip/nile-chip.css.ts +8 -1
- package/src/nile-code-editor/nile-code-editor.ts +3 -3
- package/src/nile-hero/nile-hero.css.ts +12 -12
- package/src/nile-hero/nile-hero.ts +1 -1
- package/src/nile-hero-header/nile-hero-header.css.ts +9 -9
- package/src/nile-hero-header/nile-hero-header.ts +1 -1
- package/src/nile-rich-text-editor/nile-rich-text-editor.css.ts +70 -0
- package/src/nile-rich-text-editor/nile-rich-text-editor.ts +89 -3
- package/src/nile-rich-text-editor/nile-rte-image.ts +1132 -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 +491 -1
- 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,199 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, css } from 'lit';
|
|
3
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
4
|
+
import NileElement from '../../internal/nile-element';
|
|
5
|
+
import '../../nile-button-toggle-group/index';
|
|
6
|
+
import '../../nile-button-toggle/index';
|
|
7
|
+
const CATEGORIES = [
|
|
8
|
+
{
|
|
9
|
+
key: 'punctuation',
|
|
10
|
+
label: 'Punctuation',
|
|
11
|
+
icon: '¶',
|
|
12
|
+
chars: [
|
|
13
|
+
'–', '—', '…', '‘', '’', '“', '”', '‚', '„', '«', '»', '‹', '›', '§',
|
|
14
|
+
'¶', '†', '‡', '•', '·', '¡', '¿', '′', '″', '‰',
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
key: 'currency',
|
|
19
|
+
label: 'Currency',
|
|
20
|
+
icon: '$',
|
|
21
|
+
chars: [
|
|
22
|
+
'$', '€', '£', '¥', '₹', '¢', '₩', '₽', '₺', '₪', '₫', '₦', '₴', '₱',
|
|
23
|
+
'฿', '₿',
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
key: 'math',
|
|
28
|
+
label: 'Math',
|
|
29
|
+
icon: '∑',
|
|
30
|
+
chars: [
|
|
31
|
+
'±', '×', '÷', '≠', '≈', '≤', '≥', '¬', '∞', '∑', '∏', '√', '∫', '∂',
|
|
32
|
+
'∆', '∇', '∈', '∉', '∩', '∪', '⊂', '⊃', '°', 'µ', '‰', '½', '⅓', '¼',
|
|
33
|
+
'¾', '⅛',
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
key: 'arrows',
|
|
38
|
+
label: 'Arrows',
|
|
39
|
+
icon: '→',
|
|
40
|
+
chars: [
|
|
41
|
+
'←', '→', '↑', '↓', '↔', '↕', '⇐', '⇒', '⇑', '⇓', '⇔', '↩', '↪', '↖',
|
|
42
|
+
'↗', '↘', '↙', '⟵', '⟶',
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
key: 'latin',
|
|
47
|
+
label: 'Latin',
|
|
48
|
+
icon: 'Á',
|
|
49
|
+
chars: [
|
|
50
|
+
'À', 'Á', 'Â', 'Ã', 'Ä', 'Å', 'Æ', 'Ç', 'È', 'É', 'Ê', 'Ë', 'Ì', 'Í',
|
|
51
|
+
'Î', 'Ï', 'Ñ', 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', 'Ø', 'Ù', 'Ú', 'Û', 'Ü', 'ß',
|
|
52
|
+
'à', 'á', 'â', 'ã', 'ä', 'å', 'æ', 'ç', 'è', 'é', 'ê', 'ë', 'ì', 'í',
|
|
53
|
+
'î', 'ï', 'ñ', 'ò', 'ó', 'ô', 'õ', 'ö', 'ø', 'ù', 'ú', 'û', 'ü', 'ÿ',
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
key: 'symbols',
|
|
58
|
+
label: 'Symbols',
|
|
59
|
+
icon: '★',
|
|
60
|
+
chars: [
|
|
61
|
+
'©', '®', '™', '℠', '№', '℮', '✓', '✗', '★', '☆', '♠', '♣', '♥', '♦',
|
|
62
|
+
'☀', '☁', '☂', '♻', '⚠', '⌘', '⌥', '⇧', '⏎', '⌫',
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
];
|
|
66
|
+
/**
|
|
67
|
+
* Special characters picker (the Ω toolbar item). Emits
|
|
68
|
+
* `wysiwyg-char-select` detail: { char } and `wysiwyg-char-cancel`.
|
|
69
|
+
*/
|
|
70
|
+
let NileWysiwygSpecialChars = class NileWysiwygSpecialChars extends NileElement {
|
|
71
|
+
constructor() {
|
|
72
|
+
super(...arguments);
|
|
73
|
+
this.open = false;
|
|
74
|
+
this.category = CATEGORIES[0].key;
|
|
75
|
+
}
|
|
76
|
+
static get styles() {
|
|
77
|
+
return [
|
|
78
|
+
css `
|
|
79
|
+
:host {
|
|
80
|
+
font-family: var(
|
|
81
|
+
--nile-font-family-sans-serif,
|
|
82
|
+
var(--ng-font-family-body, system-ui, -apple-system, sans-serif)
|
|
83
|
+
);
|
|
84
|
+
position: absolute;
|
|
85
|
+
z-index: 20;
|
|
86
|
+
display: none;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
:host([open]) {
|
|
90
|
+
display: block;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.panel {
|
|
94
|
+
width: 316px;
|
|
95
|
+
padding: 8px;
|
|
96
|
+
background: var(--nile-wysiwyg-popover-bg, #ffffff);
|
|
97
|
+
border: 1px solid var(--nile-colors-neutral-400, #d0d5dd);
|
|
98
|
+
border-radius: 8px;
|
|
99
|
+
box-shadow: var(--nile-wysiwyg-popover-shadow, 0 4px 12px rgba(16, 24, 40, 0.12));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.tabs {
|
|
103
|
+
flex-wrap: wrap;
|
|
104
|
+
margin-bottom: 8px;
|
|
105
|
+
max-width: 100%;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.cat-icon {
|
|
109
|
+
display: inline-block;
|
|
110
|
+
min-width: 16px;
|
|
111
|
+
font-size: 15px;
|
|
112
|
+
line-height: 1;
|
|
113
|
+
text-align: center;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.grid {
|
|
117
|
+
display: grid;
|
|
118
|
+
grid-template-columns: repeat(10, 1fr);
|
|
119
|
+
gap: 2px;
|
|
120
|
+
max-height: 180px;
|
|
121
|
+
overflow-y: auto;
|
|
122
|
+
overscroll-behavior: contain;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.char {
|
|
126
|
+
font: inherit;
|
|
127
|
+
font-size: 15px;
|
|
128
|
+
height: 28px;
|
|
129
|
+
border: none;
|
|
130
|
+
border-radius: 5px;
|
|
131
|
+
background: transparent;
|
|
132
|
+
cursor: pointer;
|
|
133
|
+
color: var(--nile-colors-dark-900, #101828);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.char:hover {
|
|
137
|
+
background: var(--nile-colors-neutral-100, #f2f4f7);
|
|
138
|
+
}
|
|
139
|
+
`,
|
|
140
|
+
];
|
|
141
|
+
}
|
|
142
|
+
handleKeydown(event) {
|
|
143
|
+
if (event.key === 'Escape') {
|
|
144
|
+
event.stopPropagation();
|
|
145
|
+
this.emit('wysiwyg-char-cancel');
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
render() {
|
|
149
|
+
const current = CATEGORIES.find(c => c.key === this.category) ?? CATEGORIES[0];
|
|
150
|
+
return html `
|
|
151
|
+
<div
|
|
152
|
+
class="panel"
|
|
153
|
+
part="special-chars"
|
|
154
|
+
@keydown=${this.handleKeydown}
|
|
155
|
+
@mousedown=${(e) => e.preventDefault()}
|
|
156
|
+
>
|
|
157
|
+
<nile-button-toggle-group
|
|
158
|
+
class="tabs"
|
|
159
|
+
.value=${this.category}
|
|
160
|
+
@nile-change=${(e) => {
|
|
161
|
+
this.category = e.detail.value;
|
|
162
|
+
}}
|
|
163
|
+
>
|
|
164
|
+
${CATEGORIES.map(cat => html `
|
|
165
|
+
<nile-button-toggle
|
|
166
|
+
value=${cat.key}
|
|
167
|
+
title=${cat.label}
|
|
168
|
+
aria-label=${cat.label}
|
|
169
|
+
><span class="cat-icon">${cat.icon}</span></nile-button-toggle
|
|
170
|
+
>
|
|
171
|
+
`)}
|
|
172
|
+
</nile-button-toggle-group>
|
|
173
|
+
<div class="grid" role="listbox" aria-label="Special characters">
|
|
174
|
+
${current.chars.map(char => html `
|
|
175
|
+
<button
|
|
176
|
+
type="button"
|
|
177
|
+
class="char"
|
|
178
|
+
title=${char}
|
|
179
|
+
@click=${() => this.emit('wysiwyg-char-select', { char })}
|
|
180
|
+
>
|
|
181
|
+
${char}
|
|
182
|
+
</button>
|
|
183
|
+
`)}
|
|
184
|
+
</div>
|
|
185
|
+
</div>
|
|
186
|
+
`;
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
__decorate([
|
|
190
|
+
property({ type: Boolean, reflect: true })
|
|
191
|
+
], NileWysiwygSpecialChars.prototype, "open", void 0);
|
|
192
|
+
__decorate([
|
|
193
|
+
state()
|
|
194
|
+
], NileWysiwygSpecialChars.prototype, "category", void 0);
|
|
195
|
+
NileWysiwygSpecialChars = __decorate([
|
|
196
|
+
customElement('nile-wysiwyg-special-chars')
|
|
197
|
+
], NileWysiwygSpecialChars);
|
|
198
|
+
export { NileWysiwygSpecialChars };
|
|
199
|
+
//# sourceMappingURL=special-chars.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"special-chars.js","sourceRoot":"","sources":["../../../../src/nile-wysiwyg-editor/ui/special-chars.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAkC,MAAM,KAAK,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,WAAW,MAAM,6BAA6B,CAAC;AACtD,OAAO,sCAAsC,CAAC;AAC9C,OAAO,gCAAgC,CAAC;AAUxC,MAAM,UAAU,GAAmB;IACjC;QACE,GAAG,EAAE,aAAa;QAClB,KAAK,EAAE,aAAa;QACpB,IAAI,EAAE,GAAG;QACT,KAAK,EAAE;YACL,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,G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EAAE,CAAC,IAAI,CAAA;;;;wBAIA,IAAI;yBACH,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,EAAE,EAAE,IAAI,EAAE,CAAC;;kBAEvD,IAAI;;aAET,CACF;;;KAGN,CAAC;IACJ,CAAC;CACF,CAAA;AA1H6C;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qDAAc;AAExC;IAAhB,KAAK,EAAE;yDAAsC;AAHnC,uBAAuB;IADnC,aAAa,CAAC,4BAA4B,CAAC;GAC/B,uBAAuB,CA2HnC","sourcesContent":["import { html, css, TemplateResult, CSSResultArray } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport NileElement from '../../internal/nile-element';\nimport '../../nile-button-toggle-group/index';\nimport '../../nile-button-toggle/index';\n\ninterface CharCategory {\n key: string;\n label: string;\n /** Representative glyph shown as the (iconified) tab label. */\n icon: string;\n chars: string[];\n}\n\nconst CATEGORIES: CharCategory[] = [\n {\n key: 'punctuation',\n label: 'Punctuation',\n icon: '¶',\n chars: [\n '–', '—', '…', '‘', '’', '“', '”', '‚', '„', '«', '»', '‹', '›', '§',\n '¶', '†', '‡', '•', '·', '¡', '¿', '′', '″', '‰',\n ],\n },\n {\n key: 'currency',\n label: 'Currency',\n icon: '$',\n chars: [\n '$', '€', '£', '¥', '₹', '¢', '₩', '₽', '₺', '₪', '₫', '₦', '₴', '₱',\n '฿', '₿',\n ],\n },\n {\n key: 'math',\n label: 'Math',\n icon: '∑',\n chars: [\n '±', '×', '÷', '≠', '≈', '≤', '≥', '¬', '∞', '∑', '∏', '√', '∫', '∂',\n '∆', '∇', '∈', '∉', '∩', '∪', '⊂', '⊃', '°', 'µ', '‰', '½', '⅓', '¼',\n '¾', '⅛',\n ],\n },\n {\n key: 'arrows',\n label: 'Arrows',\n icon: '→',\n chars: [\n '←', '→', '↑', '↓', '↔', '↕', '⇐', '⇒', '⇑', '⇓', '⇔', '↩', '↪', '↖',\n '↗', '↘', '↙', '⟵', '⟶',\n ],\n },\n {\n key: 'latin',\n label: 'Latin',\n icon: 'Á',\n chars: [\n 'À', 'Á', 'Â', 'Ã', 'Ä', 'Å', 'Æ', 'Ç', 'È', 'É', 'Ê', 'Ë', 'Ì', 'Í',\n 'Î', 'Ï', 'Ñ', 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', 'Ø', 'Ù', 'Ú', 'Û', 'Ü', 'ß',\n 'à', 'á', 'â', 'ã', 'ä', 'å', 'æ', 'ç', 'è', 'é', 'ê', 'ë', 'ì', 'í',\n 'î', 'ï', 'ñ', 'ò', 'ó', 'ô', 'õ', 'ö', 'ø', 'ù', 'ú', 'û', 'ü', 'ÿ',\n ],\n },\n {\n key: 'symbols',\n label: 'Symbols',\n icon: '★',\n chars: [\n '©', '®', '™', '℠', '№', '℮', '✓', '✗', '★', '☆', '♠', '♣', '♥', '♦',\n '☀', '☁', '☂', '♻', '⚠', '⌘', '⌥', '⇧', '⏎', '⌫',\n ],\n },\n];\n\n/**\n * Special characters picker (the Ω toolbar item). Emits\n * `wysiwyg-char-select` detail: { char } and `wysiwyg-char-cancel`.\n */\n@customElement('nile-wysiwyg-special-chars')\nexport class NileWysiwygSpecialChars extends NileElement {\n @property({ type: Boolean, reflect: true }) open = false;\n\n @state() private category = CATEGORIES[0].key;\n\n public static get styles(): CSSResultArray {\n return [\n css`\n :host {\n font-family: var(\n --nile-font-family-sans-serif,\n var(--ng-font-family-body, system-ui, -apple-system, sans-serif)\n );\n position: absolute;\n z-index: 20;\n display: none;\n }\n\n :host([open]) {\n display: block;\n }\n\n .panel {\n width: 316px;\n padding: 8px;\n background: var(--nile-wysiwyg-popover-bg, #ffffff);\n border: 1px solid var(--nile-colors-neutral-400, #d0d5dd);\n border-radius: 8px;\n box-shadow: var(--nile-wysiwyg-popover-shadow, 0 4px 12px rgba(16, 24, 40, 0.12));\n }\n\n .tabs {\n flex-wrap: wrap;\n margin-bottom: 8px;\n max-width: 100%;\n }\n\n .cat-icon {\n display: inline-block;\n min-width: 16px;\n font-size: 15px;\n line-height: 1;\n text-align: center;\n }\n\n .grid {\n display: grid;\n grid-template-columns: repeat(10, 1fr);\n gap: 2px;\n max-height: 180px;\n overflow-y: auto;\n overscroll-behavior: contain;\n }\n\n .char {\n font: inherit;\n font-size: 15px;\n height: 28px;\n border: none;\n border-radius: 5px;\n background: transparent;\n cursor: pointer;\n color: var(--nile-colors-dark-900, #101828);\n }\n\n .char:hover {\n background: var(--nile-colors-neutral-100, #f2f4f7);\n }\n `,\n ];\n }\n\n private handleKeydown(event: KeyboardEvent): void {\n if (event.key === 'Escape') {\n event.stopPropagation();\n this.emit('wysiwyg-char-cancel');\n }\n }\n\n public render(): TemplateResult {\n const current = CATEGORIES.find(c => c.key === this.category) ?? CATEGORIES[0];\n return html`\n <div\n class=\"panel\"\n part=\"special-chars\"\n @keydown=${this.handleKeydown}\n @mousedown=${(e: Event) => e.preventDefault()}\n >\n <nile-button-toggle-group\n class=\"tabs\"\n .value=${this.category}\n @nile-change=${(e: CustomEvent) => {\n this.category = e.detail.value as string;\n }}\n >\n ${CATEGORIES.map(\n cat => html`\n <nile-button-toggle\n value=${cat.key}\n title=${cat.label}\n aria-label=${cat.label}\n ><span class=\"cat-icon\">${cat.icon}</span></nile-button-toggle\n >\n `\n )}\n </nile-button-toggle-group>\n <div class=\"grid\" role=\"listbox\" aria-label=\"Special characters\">\n ${current.chars.map(\n char => html`\n <button\n type=\"button\"\n class=\"char\"\n title=${char}\n @click=${() => this.emit('wysiwyg-char-select', { char })}\n >\n ${char}\n </button>\n `\n )}\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-wysiwyg-special-chars': NileWysiwygSpecialChars;\n }\n}\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TemplateResult, CSSResultArray } from 'lit';
|
|
2
|
+
import NileElement from '../../internal/nile-element';
|
|
3
|
+
export interface SuggestItem {
|
|
4
|
+
key: string;
|
|
5
|
+
label: string;
|
|
6
|
+
/** Secondary text shown right-aligned (e.g. slash-command hint). */
|
|
7
|
+
hint?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Keyboard-navigable suggestion popup shared by mentions and slash commands.
|
|
11
|
+
* The host positions it, feeds `items`, and drives navigation through
|
|
12
|
+
* next()/prev()/selectCurrent(); picking an item emits
|
|
13
|
+
* `wysiwyg-suggest-select` with the item.
|
|
14
|
+
*/
|
|
15
|
+
export declare class NileWysiwygSuggestList extends NileElement {
|
|
16
|
+
open: boolean;
|
|
17
|
+
items: SuggestItem[];
|
|
18
|
+
private activeIndex;
|
|
19
|
+
static get styles(): CSSResultArray;
|
|
20
|
+
protected willUpdate(): void;
|
|
21
|
+
next(): void;
|
|
22
|
+
prev(): void;
|
|
23
|
+
resetActive(): void;
|
|
24
|
+
selectCurrent(): boolean;
|
|
25
|
+
render(): TemplateResult;
|
|
26
|
+
}
|
|
27
|
+
declare global {
|
|
28
|
+
interface HTMLElementTagNameMap {
|
|
29
|
+
'nile-wysiwyg-suggest-list': NileWysiwygSuggestList;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, css } from 'lit';
|
|
3
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
4
|
+
import NileElement from '../../internal/nile-element';
|
|
5
|
+
/**
|
|
6
|
+
* Keyboard-navigable suggestion popup shared by mentions and slash commands.
|
|
7
|
+
* The host positions it, feeds `items`, and drives navigation through
|
|
8
|
+
* next()/prev()/selectCurrent(); picking an item emits
|
|
9
|
+
* `wysiwyg-suggest-select` with the item.
|
|
10
|
+
*/
|
|
11
|
+
let NileWysiwygSuggestList = class NileWysiwygSuggestList extends NileElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.open = false;
|
|
15
|
+
this.items = [];
|
|
16
|
+
this.activeIndex = 0;
|
|
17
|
+
}
|
|
18
|
+
static get styles() {
|
|
19
|
+
return [
|
|
20
|
+
css `
|
|
21
|
+
:host {
|
|
22
|
+
font-family: var(
|
|
23
|
+
--nile-font-family-sans-serif,
|
|
24
|
+
var(--ng-font-family-body, system-ui, -apple-system, sans-serif)
|
|
25
|
+
);
|
|
26
|
+
position: absolute;
|
|
27
|
+
z-index: 25;
|
|
28
|
+
display: none;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
:host([open]) {
|
|
32
|
+
display: block;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.list {
|
|
36
|
+
min-width: 200px;
|
|
37
|
+
max-width: 320px;
|
|
38
|
+
max-height: 240px;
|
|
39
|
+
overflow-y: auto;
|
|
40
|
+
padding: 4px;
|
|
41
|
+
background: var(--nile-wysiwyg-popover-bg, #ffffff);
|
|
42
|
+
border: 1px solid var(--nile-colors-neutral-400, #d0d5dd);
|
|
43
|
+
border-radius: 8px;
|
|
44
|
+
box-shadow: var(--nile-wysiwyg-popover-shadow, 0 4px 12px rgba(16, 24, 40, 0.12));
|
|
45
|
+
font-size: 13px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.item {
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
justify-content: space-between;
|
|
52
|
+
gap: 12px;
|
|
53
|
+
padding: 6px 8px;
|
|
54
|
+
border-radius: 5px;
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
color: var(--nile-colors-neutral-700, #344054);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.item.active {
|
|
60
|
+
background: var(--nile-colors-primary-50, var(--ng-componentcolors-utility-blue-50, #eff4ff));
|
|
61
|
+
color: var(--nile-colors-primary-700, var(--ng-componentcolors-utility-blue-700, #1d4ed8));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.hint {
|
|
65
|
+
font-size: 11px;
|
|
66
|
+
color: var(--nile-colors-neutral-500, #98a2b3);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.empty {
|
|
70
|
+
padding: 6px 8px;
|
|
71
|
+
color: var(--nile-colors-neutral-500, #98a2b3);
|
|
72
|
+
}
|
|
73
|
+
`,
|
|
74
|
+
];
|
|
75
|
+
}
|
|
76
|
+
willUpdate() {
|
|
77
|
+
if (this.activeIndex >= this.items.length)
|
|
78
|
+
this.activeIndex = 0;
|
|
79
|
+
}
|
|
80
|
+
next() {
|
|
81
|
+
if (this.items.length)
|
|
82
|
+
this.activeIndex = (this.activeIndex + 1) % this.items.length;
|
|
83
|
+
}
|
|
84
|
+
prev() {
|
|
85
|
+
if (this.items.length) {
|
|
86
|
+
this.activeIndex = (this.activeIndex - 1 + this.items.length) % this.items.length;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
resetActive() {
|
|
90
|
+
this.activeIndex = 0;
|
|
91
|
+
}
|
|
92
|
+
selectCurrent() {
|
|
93
|
+
const item = this.items[this.activeIndex];
|
|
94
|
+
if (!item)
|
|
95
|
+
return false;
|
|
96
|
+
this.emit('wysiwyg-suggest-select', { item });
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
render() {
|
|
100
|
+
return html `
|
|
101
|
+
<div class="list" part="suggest-list" @mousedown=${(e) => e.preventDefault()}>
|
|
102
|
+
${this.items.length
|
|
103
|
+
? this.items.map((item, index) => html `
|
|
104
|
+
<div
|
|
105
|
+
class="item ${index === this.activeIndex ? 'active' : ''}"
|
|
106
|
+
@mouseenter=${() => {
|
|
107
|
+
this.activeIndex = index;
|
|
108
|
+
}}
|
|
109
|
+
@click=${() => this.selectCurrent()}
|
|
110
|
+
>
|
|
111
|
+
<span>${item.label}</span>
|
|
112
|
+
${item.hint ? html `<span class="hint">${item.hint}</span>` : ''}
|
|
113
|
+
</div>
|
|
114
|
+
`)
|
|
115
|
+
: html `<div class="empty">No results</div>`}
|
|
116
|
+
</div>
|
|
117
|
+
`;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
__decorate([
|
|
121
|
+
property({ type: Boolean, reflect: true })
|
|
122
|
+
], NileWysiwygSuggestList.prototype, "open", void 0);
|
|
123
|
+
__decorate([
|
|
124
|
+
property({ attribute: false })
|
|
125
|
+
], NileWysiwygSuggestList.prototype, "items", void 0);
|
|
126
|
+
__decorate([
|
|
127
|
+
state()
|
|
128
|
+
], NileWysiwygSuggestList.prototype, "activeIndex", void 0);
|
|
129
|
+
NileWysiwygSuggestList = __decorate([
|
|
130
|
+
customElement('nile-wysiwyg-suggest-list')
|
|
131
|
+
], NileWysiwygSuggestList);
|
|
132
|
+
export { NileWysiwygSuggestList };
|
|
133
|
+
//# sourceMappingURL=suggest-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suggest-list.js","sourceRoot":"","sources":["../../../../src/nile-wysiwyg-editor/ui/suggest-list.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAkC,MAAM,KAAK,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,WAAW,MAAM,6BAA6B,CAAC;AAStD;;;;;GAKG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,WAAW;IAAhD;;QACuC,SAAI,GAAG,KAAK,CAAC;QAEzB,UAAK,GAAkB,EAAE,CAAC;QAEzC,gBAAW,GAAG,CAAC,CAAC;IA4GnC,CAAC;IA1GQ,MAAM,KAAK,MAAM;QACtB,OAAO;YACL,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqDF;SACF,CAAC;IACJ,CAAC;IAES,UAAU;QAClB,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM;YAAE,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;IAClE,CAAC;IAEM,IAAI;QAC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AAC,CAAC,CAAC,IAAI,CAAA,sBAAsB,IAAI,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,EAAE;;eAElE,CACF;YACH,CAAC,CAAC,IAAI,CAAA,qCAAqC;;KAEhD,CAAC;IACJ,CAAC;CACF,CAAA;AAhH6C;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oDAAc;AAEzB;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;qDAA2B;AAEzC;IAAhB,KAAK,EAAE;2DAAyB;AALtB,sBAAsB;IADlC,aAAa,CAAC,2BAA2B,CAAC;GAC9B,sBAAsB,CAiHlC","sourcesContent":["import { html, css, TemplateResult, CSSResultArray } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport NileElement from '../../internal/nile-element';\n\nexport interface SuggestItem {\n key: string;\n label: string;\n /** Secondary text shown right-aligned (e.g. slash-command hint). */\n hint?: string;\n}\n\n/**\n * Keyboard-navigable suggestion popup shared by mentions and slash commands.\n * The host positions it, feeds `items`, and drives navigation through\n * next()/prev()/selectCurrent(); picking an item emits\n * `wysiwyg-suggest-select` with the item.\n */\n@customElement('nile-wysiwyg-suggest-list')\nexport class NileWysiwygSuggestList extends NileElement {\n @property({ type: Boolean, reflect: true }) open = false;\n\n @property({ attribute: false }) items: SuggestItem[] = [];\n\n @state() private activeIndex = 0;\n\n public static get styles(): CSSResultArray {\n return [\n css`\n :host {\n font-family: var(\n --nile-font-family-sans-serif,\n var(--ng-font-family-body, system-ui, -apple-system, sans-serif)\n );\n position: absolute;\n z-index: 25;\n display: none;\n }\n\n :host([open]) {\n display: block;\n }\n\n .list {\n min-width: 200px;\n max-width: 320px;\n max-height: 240px;\n overflow-y: auto;\n padding: 4px;\n background: var(--nile-wysiwyg-popover-bg, #ffffff);\n border: 1px solid var(--nile-colors-neutral-400, #d0d5dd);\n border-radius: 8px;\n box-shadow: var(--nile-wysiwyg-popover-shadow, 0 4px 12px rgba(16, 24, 40, 0.12));\n font-size: 13px;\n }\n\n .item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n padding: 6px 8px;\n border-radius: 5px;\n cursor: pointer;\n color: var(--nile-colors-neutral-700, #344054);\n }\n\n .item.active {\n background: var(--nile-colors-primary-50, var(--ng-componentcolors-utility-blue-50, #eff4ff));\n color: var(--nile-colors-primary-700, var(--ng-componentcolors-utility-blue-700, #1d4ed8));\n }\n\n .hint {\n font-size: 11px;\n color: var(--nile-colors-neutral-500, #98a2b3);\n }\n\n .empty {\n padding: 6px 8px;\n color: var(--nile-colors-neutral-500, #98a2b3);\n }\n `,\n ];\n }\n\n protected willUpdate(): void {\n if (this.activeIndex >= this.items.length) this.activeIndex = 0;\n }\n\n public next(): void {\n if (this.items.length) this.activeIndex = (this.activeIndex + 1) % this.items.length;\n }\n\n public prev(): void {\n if (this.items.length) {\n this.activeIndex = (this.activeIndex - 1 + this.items.length) % this.items.length;\n }\n }\n\n public resetActive(): void {\n this.activeIndex = 0;\n }\n\n public selectCurrent(): boolean {\n const item = this.items[this.activeIndex];\n if (!item) return false;\n this.emit('wysiwyg-suggest-select', { item });\n return true;\n }\n\n public render(): TemplateResult {\n return html`\n <div class=\"list\" part=\"suggest-list\" @mousedown=${(e: Event) => e.preventDefault()}>\n ${this.items.length\n ? this.items.map(\n (item, index) => html`\n <div\n class=\"item ${index === this.activeIndex ? 'active' : ''}\"\n @mouseenter=${() => {\n this.activeIndex = index;\n }}\n @click=${() => this.selectCurrent()}\n >\n <span>${item.label}</span>\n ${item.hint ? html`<span class=\"hint\">${item.hint}</span>` : ''}\n </div>\n `\n )\n : html`<div class=\"empty\">No results</div>`}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-wysiwyg-suggest-list': NileWysiwygSuggestList;\n }\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TemplateResult, CSSResultArray } from 'lit';
|
|
2
|
+
import NileElement from '../../internal/nile-element';
|
|
3
|
+
/**
|
|
4
|
+
* Toolbar item: a table button that opens an N×M hover grid. Picking a cell
|
|
5
|
+
* emits `wysiwyg-command` with `insertTable { rows, cols }`.
|
|
6
|
+
*/
|
|
7
|
+
export declare class NileWysiwygTablePicker extends NileElement {
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
private open;
|
|
10
|
+
private hoverRows;
|
|
11
|
+
private hoverCols;
|
|
12
|
+
static get styles(): CSSResultArray;
|
|
13
|
+
connectedCallback(): void;
|
|
14
|
+
disconnectedCallback(): void;
|
|
15
|
+
private handleOutside;
|
|
16
|
+
private pick;
|
|
17
|
+
render(): TemplateResult;
|
|
18
|
+
}
|
|
19
|
+
declare global {
|
|
20
|
+
interface HTMLElementTagNameMap {
|
|
21
|
+
'nile-wysiwyg-table-picker': NileWysiwygTablePicker;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, css } from 'lit';
|
|
3
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
4
|
+
import NileElement from '../../internal/nile-element';
|
|
5
|
+
const MAX_ROWS = 8;
|
|
6
|
+
const MAX_COLS = 10;
|
|
7
|
+
/**
|
|
8
|
+
* Toolbar item: a table button that opens an N×M hover grid. Picking a cell
|
|
9
|
+
* emits `wysiwyg-command` with `insertTable { rows, cols }`.
|
|
10
|
+
*/
|
|
11
|
+
let NileWysiwygTablePicker = class NileWysiwygTablePicker extends NileElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.disabled = false;
|
|
15
|
+
this.open = false;
|
|
16
|
+
this.hoverRows = 0;
|
|
17
|
+
this.hoverCols = 0;
|
|
18
|
+
this.handleOutside = (event) => {
|
|
19
|
+
if (this.open && !event.composedPath().includes(this))
|
|
20
|
+
this.open = false;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
static get styles() {
|
|
24
|
+
return [
|
|
25
|
+
css `
|
|
26
|
+
:host {
|
|
27
|
+
font-family: var(
|
|
28
|
+
--nile-font-family-sans-serif,
|
|
29
|
+
var(--ng-font-family-body, system-ui, -apple-system, sans-serif)
|
|
30
|
+
);
|
|
31
|
+
position: relative;
|
|
32
|
+
display: inline-flex;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
button.trigger {
|
|
36
|
+
display: inline-flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
width: 32px;
|
|
40
|
+
height: 32px;
|
|
41
|
+
padding: 0 6px;
|
|
42
|
+
box-sizing: border-box;
|
|
43
|
+
border: none;
|
|
44
|
+
border-radius: var(--nile-radius-radius-lg, var(--ng-radius-md, 8px));
|
|
45
|
+
background: transparent;
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
color: var(--nile-colors-dark-900, var(--ng-colors-text-primary-900, #101828));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
button.trigger:hover:not(:disabled) {
|
|
51
|
+
background: var(--nile-colors-neutral-100, #f2f4f7);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
button.trigger:disabled {
|
|
55
|
+
opacity: 0.4;
|
|
56
|
+
cursor: default;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.panel {
|
|
60
|
+
position: absolute;
|
|
61
|
+
top: calc(100% + 4px);
|
|
62
|
+
left: 0;
|
|
63
|
+
z-index: 30;
|
|
64
|
+
padding: 8px;
|
|
65
|
+
background: var(--nile-wysiwyg-popover-bg, #ffffff);
|
|
66
|
+
border: 1px solid var(--nile-colors-neutral-400, #d0d5dd);
|
|
67
|
+
border-radius: 8px;
|
|
68
|
+
box-shadow: var(--nile-wysiwyg-popover-shadow, 0 4px 12px rgba(16, 24, 40, 0.12));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.grid {
|
|
72
|
+
display: grid;
|
|
73
|
+
grid-template-columns: repeat(${MAX_COLS}, 14px);
|
|
74
|
+
gap: 2px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.cell {
|
|
78
|
+
width: 14px;
|
|
79
|
+
height: 14px;
|
|
80
|
+
border: 1px solid var(--nile-colors-neutral-300, #d0d5dd);
|
|
81
|
+
border-radius: 2px;
|
|
82
|
+
box-sizing: border-box;
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.cell.hot {
|
|
87
|
+
background: var(--nile-colors-primary-100, var(--ng-componentcolors-utility-blue-100, #dbeafe));
|
|
88
|
+
border-color: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600, #2563eb));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.label {
|
|
92
|
+
margin-top: 6px;
|
|
93
|
+
text-align: center;
|
|
94
|
+
font-size: 12px;
|
|
95
|
+
color: var(--nile-colors-neutral-600, #475467);
|
|
96
|
+
}
|
|
97
|
+
`,
|
|
98
|
+
];
|
|
99
|
+
}
|
|
100
|
+
connectedCallback() {
|
|
101
|
+
super.connectedCallback();
|
|
102
|
+
document.addEventListener('mousedown', this.handleOutside);
|
|
103
|
+
}
|
|
104
|
+
disconnectedCallback() {
|
|
105
|
+
super.disconnectedCallback();
|
|
106
|
+
document.removeEventListener('mousedown', this.handleOutside);
|
|
107
|
+
}
|
|
108
|
+
pick(rows, cols) {
|
|
109
|
+
this.open = false;
|
|
110
|
+
this.emit('wysiwyg-command', {
|
|
111
|
+
name: 'insertTable',
|
|
112
|
+
attrs: { rows, cols, withHeaderRow: true },
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
render() {
|
|
116
|
+
const cells = [];
|
|
117
|
+
for (let r = 1; r <= MAX_ROWS; r += 1) {
|
|
118
|
+
for (let c = 1; c <= MAX_COLS; c += 1) {
|
|
119
|
+
cells.push(html `
|
|
120
|
+
<span
|
|
121
|
+
class="cell ${r <= this.hoverRows && c <= this.hoverCols ? 'hot' : ''}"
|
|
122
|
+
@mouseenter=${() => {
|
|
123
|
+
this.hoverRows = r;
|
|
124
|
+
this.hoverCols = c;
|
|
125
|
+
}}
|
|
126
|
+
@click=${() => this.pick(r, c)}
|
|
127
|
+
></span>
|
|
128
|
+
`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return html `
|
|
132
|
+
<button
|
|
133
|
+
type="button"
|
|
134
|
+
class="trigger"
|
|
135
|
+
part="button"
|
|
136
|
+
aria-label="Insert table"
|
|
137
|
+
aria-expanded=${this.open ? 'true' : 'false'}
|
|
138
|
+
?disabled=${this.disabled}
|
|
139
|
+
@mousedown=${(e) => e.preventDefault()}
|
|
140
|
+
@click=${() => {
|
|
141
|
+
this.open = !this.open;
|
|
142
|
+
this.hoverRows = 0;
|
|
143
|
+
this.hoverCols = 0;
|
|
144
|
+
}}
|
|
145
|
+
>
|
|
146
|
+
<nile-glyph name="grid-01" size="18" method="stroke"></nile-glyph>
|
|
147
|
+
</button>
|
|
148
|
+
${this.open
|
|
149
|
+
? html `
|
|
150
|
+
<div class="panel" @mousedown=${(e) => e.preventDefault()}>
|
|
151
|
+
<div class="grid">${cells}</div>
|
|
152
|
+
<div class="label">
|
|
153
|
+
${this.hoverRows > 0 ? `${this.hoverRows} × ${this.hoverCols}` : 'Pick a size'}
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
`
|
|
157
|
+
: ''}
|
|
158
|
+
`;
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
__decorate([
|
|
162
|
+
property({ type: Boolean, reflect: true })
|
|
163
|
+
], NileWysiwygTablePicker.prototype, "disabled", void 0);
|
|
164
|
+
__decorate([
|
|
165
|
+
state()
|
|
166
|
+
], NileWysiwygTablePicker.prototype, "open", void 0);
|
|
167
|
+
__decorate([
|
|
168
|
+
state()
|
|
169
|
+
], NileWysiwygTablePicker.prototype, "hoverRows", void 0);
|
|
170
|
+
__decorate([
|
|
171
|
+
state()
|
|
172
|
+
], NileWysiwygTablePicker.prototype, "hoverCols", void 0);
|
|
173
|
+
NileWysiwygTablePicker = __decorate([
|
|
174
|
+
customElement('nile-wysiwyg-table-picker')
|
|
175
|
+
], NileWysiwygTablePicker);
|
|
176
|
+
export { NileWysiwygTablePicker };
|
|
177
|
+
//# sourceMappingURL=table-grid-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-grid-picker.js","sourceRoot":"","sources":["../../../../src/nile-wysiwyg-editor/ui/table-grid-picker.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAkC,MAAM,KAAK,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,WAAW,MAAM,6BAA6B,CAAC;AAEtD,MAAM,QAAQ,GAAG,CAAC,CAAC;AACnB,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB;;;GAGG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,WAAW;IAAhD;;QACuC,aAAQ,GAAG,KAAK,CAAC;QAE5C,SAAI,GAAG,KAAK,CAAC;QAEb,cAAS,GAAG,CAAC,CAAC;QAEd,cAAS,GAAG,CAAC,CAAC;QA0FvB,kBAAa,GAAG,CAAC,KAAiB,EAAQ,EAAE;YAClD,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;gBAAE,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;QAC3E,CAAC,CAAC;IAuDJ,CAAC;IAjJQ,MAAM,KAAK,MAAM;QACtB,OAAO;YACL,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0CAgDiC,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;OAwB3C;SACF,CAAC;IACJ,CAAC;IAED,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,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;oBAChC,IAAI,CAAC,QAAQ;qBACZ,CAAC,CAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,EAAE;iBACpC,GAAG,EAAE;YACZ,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;YACvB,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;YACnB,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;QACrB,CAAC;;;;QAID,IAAI,CAAC,IAAI;YACT,CAAC,CAAC,IAAI,CAAA;4CAC8B,CAAC,CAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,EAAE;kCAC1C,KAAK;;kBAErB,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,aAAa;;;WAGnF;YACH,CAAC,CAAC,EAAE;KACP,CAAC;IACJ,CAAC;CACF,CAAA;AAzJ6C;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wDAAkB;AAE5C;IAAhB,KAAK,EAAE;oDAAsB;AAEb;IAAhB,KAAK,EAAE;yDAAuB;AAEd;IAAhB,KAAK,EAAE;yDAAuB;AAPpB,sBAAsB;IADlC,aAAa,CAAC,2BAA2B,CAAC;GAC9B,sBAAsB,CA0JlC","sourcesContent":["import { html, css, TemplateResult, CSSResultArray } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport NileElement from '../../internal/nile-element';\n\nconst MAX_ROWS = 8;\nconst MAX_COLS = 10;\n\n/**\n * Toolbar item: a table button that opens an N×M hover grid. Picking a cell\n * emits `wysiwyg-command` with `insertTable { rows, cols }`.\n */\n@customElement('nile-wysiwyg-table-picker')\nexport class NileWysiwygTablePicker extends NileElement {\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n @state() private open = false;\n\n @state() private hoverRows = 0;\n\n @state() private hoverCols = 0;\n\n public static get styles(): CSSResultArray {\n return [\n css`\n :host {\n font-family: var(\n --nile-font-family-sans-serif,\n var(--ng-font-family-body, system-ui, -apple-system, sans-serif)\n );\n position: relative;\n display: inline-flex;\n }\n\n button.trigger {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n padding: 0 6px;\n box-sizing: border-box;\n border: none;\n border-radius: var(--nile-radius-radius-lg, var(--ng-radius-md, 8px));\n background: transparent;\n cursor: pointer;\n color: var(--nile-colors-dark-900, var(--ng-colors-text-primary-900, #101828));\n }\n\n button.trigger:hover:not(:disabled) {\n background: var(--nile-colors-neutral-100, #f2f4f7);\n }\n\n button.trigger:disabled {\n opacity: 0.4;\n cursor: default;\n }\n\n .panel {\n position: absolute;\n top: calc(100% + 4px);\n left: 0;\n z-index: 30;\n padding: 8px;\n background: var(--nile-wysiwyg-popover-bg, #ffffff);\n border: 1px solid var(--nile-colors-neutral-400, #d0d5dd);\n border-radius: 8px;\n box-shadow: var(--nile-wysiwyg-popover-shadow, 0 4px 12px rgba(16, 24, 40, 0.12));\n }\n\n .grid {\n display: grid;\n grid-template-columns: repeat(${MAX_COLS}, 14px);\n gap: 2px;\n }\n\n .cell {\n width: 14px;\n height: 14px;\n border: 1px solid var(--nile-colors-neutral-300, #d0d5dd);\n border-radius: 2px;\n box-sizing: border-box;\n cursor: pointer;\n }\n\n .cell.hot {\n background: var(--nile-colors-primary-100, var(--ng-componentcolors-utility-blue-100, #dbeafe));\n border-color: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600, #2563eb));\n }\n\n .label {\n margin-top: 6px;\n text-align: center;\n font-size: 12px;\n color: var(--nile-colors-neutral-600, #475467);\n }\n `,\n ];\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n document.addEventListener('mousedown', this.handleOutside);\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n document.removeEventListener('mousedown', this.handleOutside);\n }\n\n private handleOutside = (event: MouseEvent): void => {\n if (this.open && !event.composedPath().includes(this)) this.open = false;\n };\n\n private pick(rows: number, cols: number): void {\n this.open = false;\n this.emit('wysiwyg-command', {\n name: 'insertTable',\n attrs: { rows, cols, withHeaderRow: true },\n });\n }\n\n public render(): TemplateResult {\n const cells: TemplateResult[] = [];\n for (let r = 1; r <= MAX_ROWS; r += 1) {\n for (let c = 1; c <= MAX_COLS; c += 1) {\n cells.push(html`\n <span\n class=\"cell ${r <= this.hoverRows && c <= this.hoverCols ? 'hot' : ''}\"\n @mouseenter=${() => {\n this.hoverRows = r;\n this.hoverCols = c;\n }}\n @click=${() => this.pick(r, c)}\n ></span>\n `);\n }\n }\n return html`\n <button\n type=\"button\"\n class=\"trigger\"\n part=\"button\"\n aria-label=\"Insert table\"\n aria-expanded=${this.open ? 'true' : 'false'}\n ?disabled=${this.disabled}\n @mousedown=${(e: Event) => e.preventDefault()}\n @click=${() => {\n this.open = !this.open;\n this.hoverRows = 0;\n this.hoverCols = 0;\n }}\n >\n <nile-glyph name=\"grid-01\" size=\"18\" method=\"stroke\"></nile-glyph>\n </button>\n ${this.open\n ? html`\n <div class=\"panel\" @mousedown=${(e: Event) => e.preventDefault()}>\n <div class=\"grid\">${cells}</div>\n <div class=\"label\">\n ${this.hoverRows > 0 ? `${this.hoverRows} × ${this.hoverCols}` : 'Pick a size'}\n </div>\n </div>\n `\n : ''}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-wysiwyg-table-picker': NileWysiwygTablePicker;\n }\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TemplateResult, CSSResultArray } from 'lit';
|
|
2
|
+
import NileElement from '../../internal/nile-element';
|
|
3
|
+
/**
|
|
4
|
+
* Compact floating bar shown while the cursor is inside a table. The host
|
|
5
|
+
* positions it; operations bubble up as `wysiwyg-command` events.
|
|
6
|
+
*/
|
|
7
|
+
export declare class NileWysiwygTableMenu extends NileElement {
|
|
8
|
+
open: boolean;
|
|
9
|
+
static get styles(): CSSResultArray;
|
|
10
|
+
render(): TemplateResult;
|
|
11
|
+
}
|
|
12
|
+
declare global {
|
|
13
|
+
interface HTMLElementTagNameMap {
|
|
14
|
+
'nile-wysiwyg-table-menu': NileWysiwygTableMenu;
|
|
15
|
+
}
|
|
16
|
+
}
|