@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,107 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, css } from 'lit';
|
|
3
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import NileElement from '../../internal/nile-element';
|
|
5
|
+
import { CODE_LANGUAGES } from '../engine/plugins/code-highlight';
|
|
6
|
+
/**
|
|
7
|
+
* Compact floating language picker shown while the cursor is inside a code
|
|
8
|
+
* block. Selection dispatches `wysiwyg-command` with setCodeBlockLanguage.
|
|
9
|
+
*/
|
|
10
|
+
let NileWysiwygCodeMenu = class NileWysiwygCodeMenu extends NileElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.open = false;
|
|
14
|
+
/** Current language attr ('' = auto, null treated as ''). */
|
|
15
|
+
this.language = null;
|
|
16
|
+
}
|
|
17
|
+
static get styles() {
|
|
18
|
+
return [
|
|
19
|
+
css `
|
|
20
|
+
:host {
|
|
21
|
+
font-family: var(
|
|
22
|
+
--nile-font-family-sans-serif,
|
|
23
|
+
var(--ng-font-family-body, system-ui, -apple-system, sans-serif)
|
|
24
|
+
);
|
|
25
|
+
position: absolute;
|
|
26
|
+
z-index: 15;
|
|
27
|
+
display: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:host([open]) {
|
|
31
|
+
display: block;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.menu {
|
|
35
|
+
display: inline-flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
gap: 6px;
|
|
38
|
+
padding: 4px 4px 4px 10px;
|
|
39
|
+
border: 1px solid var(--nile-colors-neutral-400, #d0d5dd);
|
|
40
|
+
border-radius: 8px;
|
|
41
|
+
background: var(--nile-colors-white-base, #ffffff);
|
|
42
|
+
box-shadow: 0 4px 12px rgba(16, 24, 40, 0.12);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.label {
|
|
46
|
+
font-size: 12px;
|
|
47
|
+
color: var(--nile-colors-neutral-500, #98a2b3);
|
|
48
|
+
white-space: nowrap;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
select {
|
|
52
|
+
font: inherit;
|
|
53
|
+
font-size: 12px;
|
|
54
|
+
height: 24px;
|
|
55
|
+
padding: 0 4px;
|
|
56
|
+
border: none;
|
|
57
|
+
border-radius: 5px;
|
|
58
|
+
background: transparent;
|
|
59
|
+
color: var(--nile-colors-neutral-700, #344054);
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
outline: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
select:hover {
|
|
65
|
+
background: var(--nile-colors-neutral-100, #f2f4f7);
|
|
66
|
+
}
|
|
67
|
+
`,
|
|
68
|
+
];
|
|
69
|
+
}
|
|
70
|
+
render() {
|
|
71
|
+
const value = this.language ?? '';
|
|
72
|
+
return html `
|
|
73
|
+
<span class="menu" part="code-language" @mousedown=${(e) => e.stopPropagation()}>
|
|
74
|
+
<span class="label">Language</span>
|
|
75
|
+
<select
|
|
76
|
+
aria-label="Code block language"
|
|
77
|
+
title="Syntax highlighting language for this code block"
|
|
78
|
+
.value=${value}
|
|
79
|
+
@change=${(e) => {
|
|
80
|
+
const language = e.target.value;
|
|
81
|
+
this.emit('wysiwyg-command', {
|
|
82
|
+
name: 'setCodeBlockLanguage',
|
|
83
|
+
attrs: { language: language || null },
|
|
84
|
+
});
|
|
85
|
+
}}
|
|
86
|
+
>
|
|
87
|
+
${CODE_LANGUAGES.map(lang => html `
|
|
88
|
+
<option value=${lang.value} ?selected=${lang.value === value}>
|
|
89
|
+
${lang.label}
|
|
90
|
+
</option>
|
|
91
|
+
`)}
|
|
92
|
+
</select>
|
|
93
|
+
</span>
|
|
94
|
+
`;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
__decorate([
|
|
98
|
+
property({ type: Boolean, reflect: true })
|
|
99
|
+
], NileWysiwygCodeMenu.prototype, "open", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
property({ type: String })
|
|
102
|
+
], NileWysiwygCodeMenu.prototype, "language", void 0);
|
|
103
|
+
NileWysiwygCodeMenu = __decorate([
|
|
104
|
+
customElement('nile-wysiwyg-code-menu')
|
|
105
|
+
], NileWysiwygCodeMenu);
|
|
106
|
+
export { NileWysiwygCodeMenu };
|
|
107
|
+
//# sourceMappingURL=code-block-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-block-menu.js","sourceRoot":"","sources":["../../../../src/nile-wysiwyg-editor/ui/code-block-menu.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAkC,MAAM,KAAK,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,WAAW,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAElE;;;GAGG;AAEI,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,WAAW;IAA7C;;QACuC,SAAI,GAAG,KAAK,CAAC;QAEzD,6DAA6D;QACjC,aAAQ,GAAkB,IAAI,CAAC;IAoF7D,CAAC;IAlFQ,MAAM,KAAK,MAAM;QACtB,OAAO;YACL,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgDF;SACF,CAAC;IACJ,CAAC;IAEM,MAAM;QACX,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC;QAClC,OAAO,IAAI,CAAA;2DAC4C,CAAC,CAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE;;;;;mBAKzE,KAAK;oBACJ,CAAC,CAAQ,EAAE,EAAE;YACrB,MAAM,QAAQ,GAAI,CAAC,CAAC,MAA4B,CAAC,KAAK,CAAC;YACvD,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE;gBAC3B,IAAI,EAAE,sBAAsB;gBAC5B,KAAK,EAAE,EAAE,QAAQ,EAAE,QAAQ,IAAI,IAAI,EAAE;aACtC,CAAC,CAAC;QACL,CAAC;;YAEC,cAAc,CAAC,GAAG,CAClB,IAAI,CAAC,EAAE,CAAC,IAAI,CAAA;8BACM,IAAI,CAAC,KAAK,cAAc,IAAI,CAAC,KAAK,KAAK,KAAK;kBACxD,IAAI,CAAC,KAAK;;aAEf,CACF;;;KAGN,CAAC;IACJ,CAAC;CACF,CAAA;AAvF6C;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDAAc;AAG7B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qDAAgC;AAJhD,mBAAmB;IAD/B,aAAa,CAAC,wBAAwB,CAAC;GAC3B,mBAAmB,CAwF/B","sourcesContent":["import { html, css, TemplateResult, CSSResultArray } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport NileElement from '../../internal/nile-element';\nimport { CODE_LANGUAGES } from '../engine/plugins/code-highlight';\n\n/**\n * Compact floating language picker shown while the cursor is inside a code\n * block. Selection dispatches `wysiwyg-command` with setCodeBlockLanguage.\n */\n@customElement('nile-wysiwyg-code-menu')\nexport class NileWysiwygCodeMenu extends NileElement {\n @property({ type: Boolean, reflect: true }) open = false;\n\n /** Current language attr ('' = auto, null treated as ''). */\n @property({ type: String }) language: string | null = null;\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: 15;\n display: none;\n }\n\n :host([open]) {\n display: block;\n }\n\n .menu {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 4px 4px 4px 10px;\n border: 1px solid var(--nile-colors-neutral-400, #d0d5dd);\n border-radius: 8px;\n background: var(--nile-colors-white-base, #ffffff);\n box-shadow: 0 4px 12px rgba(16, 24, 40, 0.12);\n }\n\n .label {\n font-size: 12px;\n color: var(--nile-colors-neutral-500, #98a2b3);\n white-space: nowrap;\n }\n\n select {\n font: inherit;\n font-size: 12px;\n height: 24px;\n padding: 0 4px;\n border: none;\n border-radius: 5px;\n background: transparent;\n color: var(--nile-colors-neutral-700, #344054);\n cursor: pointer;\n outline: none;\n }\n\n select:hover {\n background: var(--nile-colors-neutral-100, #f2f4f7);\n }\n `,\n ];\n }\n\n public render(): TemplateResult {\n const value = this.language ?? '';\n return html`\n <span class=\"menu\" part=\"code-language\" @mousedown=${(e: Event) => e.stopPropagation()}>\n <span class=\"label\">Language</span>\n <select\n aria-label=\"Code block language\"\n title=\"Syntax highlighting language for this code block\"\n .value=${value}\n @change=${(e: Event) => {\n const language = (e.target as HTMLSelectElement).value;\n this.emit('wysiwyg-command', {\n name: 'setCodeBlockLanguage',\n attrs: { language: language || null },\n });\n }}\n >\n ${CODE_LANGUAGES.map(\n lang => html`\n <option value=${lang.value} ?selected=${lang.value === value}>\n ${lang.label}\n </option>\n `\n )}\n </select>\n </span>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-wysiwyg-code-menu': NileWysiwygCodeMenu;\n }\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TemplateResult, CSSResultArray } from 'lit';
|
|
2
|
+
import NileElement from '../../internal/nile-element';
|
|
3
|
+
import type { ToolbarState } from '../engine/selection-state';
|
|
4
|
+
/**
|
|
5
|
+
* Compact floating bar shown while a video embed is selected — mirrors the
|
|
6
|
+
* image menu (align left/center/right, delete). The host positions it;
|
|
7
|
+
* operations bubble up as `wysiwyg-command` events.
|
|
8
|
+
*/
|
|
9
|
+
export declare class NileWysiwygEmbedMenu extends NileElement {
|
|
10
|
+
open: boolean;
|
|
11
|
+
toolbarState?: ToolbarState;
|
|
12
|
+
static get styles(): CSSResultArray;
|
|
13
|
+
render(): TemplateResult;
|
|
14
|
+
}
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
'nile-wysiwyg-embed-menu': NileWysiwygEmbedMenu;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, css } from 'lit';
|
|
3
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import NileElement from '../../internal/nile-element';
|
|
5
|
+
import { renderGlyph } from '../../internal/glyph';
|
|
6
|
+
const OPS = [
|
|
7
|
+
{
|
|
8
|
+
label: 'Align left',
|
|
9
|
+
icon: 'format_align_left',
|
|
10
|
+
command: 'setEmbedAlign',
|
|
11
|
+
attrs: { align: 'left' },
|
|
12
|
+
active: s => s.embedAlign === 'left' || s.embedAlign === null,
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
label: 'Align center',
|
|
16
|
+
icon: 'format_align_middle',
|
|
17
|
+
command: 'setEmbedAlign',
|
|
18
|
+
attrs: { align: 'center' },
|
|
19
|
+
active: s => s.embedAlign === 'center',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
label: 'Align right',
|
|
23
|
+
icon: 'format_align_right',
|
|
24
|
+
command: 'setEmbedAlign',
|
|
25
|
+
attrs: { align: 'right' },
|
|
26
|
+
active: s => s.embedAlign === 'right',
|
|
27
|
+
},
|
|
28
|
+
{ label: 'Delete video', icon: 'ng-trash-01', command: 'deleteEmbed' },
|
|
29
|
+
];
|
|
30
|
+
/**
|
|
31
|
+
* Compact floating bar shown while a video embed is selected — mirrors the
|
|
32
|
+
* image menu (align left/center/right, delete). The host positions it;
|
|
33
|
+
* operations bubble up as `wysiwyg-command` events.
|
|
34
|
+
*/
|
|
35
|
+
let NileWysiwygEmbedMenu = class NileWysiwygEmbedMenu extends NileElement {
|
|
36
|
+
constructor() {
|
|
37
|
+
super(...arguments);
|
|
38
|
+
this.open = false;
|
|
39
|
+
}
|
|
40
|
+
static get styles() {
|
|
41
|
+
return [
|
|
42
|
+
css `
|
|
43
|
+
:host {
|
|
44
|
+
font-family: var(
|
|
45
|
+
--nile-font-family-sans-serif,
|
|
46
|
+
var(--ng-font-family-body, system-ui, -apple-system, sans-serif)
|
|
47
|
+
);
|
|
48
|
+
position: absolute;
|
|
49
|
+
z-index: 15;
|
|
50
|
+
display: none;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:host([open]) {
|
|
54
|
+
display: block;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.menu {
|
|
58
|
+
display: flex;
|
|
59
|
+
gap: 2px;
|
|
60
|
+
padding: 4px;
|
|
61
|
+
background: var(--nile-wysiwyg-popover-bg, #ffffff);
|
|
62
|
+
border: 1px solid var(--nile-colors-neutral-400, #d0d5dd);
|
|
63
|
+
border-radius: 8px;
|
|
64
|
+
box-shadow: var(--nile-wysiwyg-popover-shadow, 0 4px 12px rgba(16, 24, 40, 0.12));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
button {
|
|
68
|
+
display: inline-flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
justify-content: center;
|
|
71
|
+
min-width: 26px;
|
|
72
|
+
height: 26px;
|
|
73
|
+
padding: 0 4px;
|
|
74
|
+
border: none;
|
|
75
|
+
border-radius: 5px;
|
|
76
|
+
background: transparent;
|
|
77
|
+
cursor: pointer;
|
|
78
|
+
font-size: 12px;
|
|
79
|
+
font-weight: 600;
|
|
80
|
+
color: var(--nile-colors-neutral-700, #344054);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
button:hover {
|
|
84
|
+
background: var(--nile-colors-neutral-100, #f2f4f7);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
button[data-active] {
|
|
88
|
+
background: var(--nile-colors-primary-50, var(--ng-componentcolors-utility-blue-50, #eff4ff));
|
|
89
|
+
color: var(--nile-colors-primary-700, var(--ng-componentcolors-utility-blue-700, #1d4ed8));
|
|
90
|
+
}
|
|
91
|
+
`,
|
|
92
|
+
];
|
|
93
|
+
}
|
|
94
|
+
render() {
|
|
95
|
+
const state = this.toolbarState;
|
|
96
|
+
return html `
|
|
97
|
+
<div class="menu" part="embed-menu" @mousedown=${(e) => e.preventDefault()}>
|
|
98
|
+
${OPS.map(op => html `
|
|
99
|
+
<button
|
|
100
|
+
type="button"
|
|
101
|
+
title=${op.label}
|
|
102
|
+
aria-label=${op.label}
|
|
103
|
+
?data-active=${state && op.active ? op.active(state) : false}
|
|
104
|
+
@click=${() => this.emit('wysiwyg-command', { name: op.command, attrs: op.attrs })}
|
|
105
|
+
>
|
|
106
|
+
${op.icon ? renderGlyph(op.icon, 16) : op.text}
|
|
107
|
+
</button>
|
|
108
|
+
`)}
|
|
109
|
+
</div>
|
|
110
|
+
`;
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
__decorate([
|
|
114
|
+
property({ type: Boolean, reflect: true })
|
|
115
|
+
], NileWysiwygEmbedMenu.prototype, "open", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
property({ attribute: false })
|
|
118
|
+
], NileWysiwygEmbedMenu.prototype, "toolbarState", void 0);
|
|
119
|
+
NileWysiwygEmbedMenu = __decorate([
|
|
120
|
+
customElement('nile-wysiwyg-embed-menu')
|
|
121
|
+
], NileWysiwygEmbedMenu);
|
|
122
|
+
export { NileWysiwygEmbedMenu };
|
|
123
|
+
//# sourceMappingURL=embed-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embed-menu.js","sourceRoot":"","sources":["../../../../src/nile-wysiwyg-editor/ui/embed-menu.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAkC,MAAM,KAAK,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,WAAW,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAYnD,MAAM,GAAG,GAAc;IACrB;QACE,KAAK,EAAE,YAAY;QACnB,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,eAAe;QACxB,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;QACxB,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,MAAM,IAAI,CAAC,CAAC,UAAU,KAAK,IAAI;KAC9D;IACD;QACE,KAAK,EAAE,cAAc;QACrB,IAAI,EAAE,qBAAqB;QAC3B,OAAO,EAAE,eAAe;QACxB,KAAK,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE;QAC1B,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,QAAQ;KACvC;IACD;QACE,KAAK,EAAE,aAAa;QACpB,IAAI,EAAE,oBAAoB;QAC1B,OAAO,EAAE,eAAe;QACxB,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE;QACzB,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,OAAO;KACtC;IACD,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa,EAAE;CACvE,CAAC;AAEF;;;;GAIG;AAEI,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,WAAW;IAA9C;;QACuC,SAAI,GAAG,KAAK,CAAC;IA+E3D,CAAC;IA3EQ,MAAM,KAAK,MAAM;QACtB,OAAO;YACL,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiDF;SACF,CAAC;IACJ,CAAC;IAEM,MAAM;QACX,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC;QAChC,OAAO,IAAI,CAAA;uDACwC,CAAC,CAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,EAAE;UAC7E,GAAG,CAAC,GAAG,CACP,EAAE,CAAC,EAAE,CAAC,IAAI,CAAA;;;sBAGE,EAAE,CAAC,KAAK;2BACH,EAAE,CAAC,KAAK;6BACN,KAAK,IAAI,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK;uBACnD,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC;;gBAEhF,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI;;WAEjD,CACF;;KAEJ,CAAC;IACJ,CAAC;CACF,CAAA;AA/E6C;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDAAc;AAEzB;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;0DAA6B;AAHjD,oBAAoB;IADhC,aAAa,CAAC,yBAAyB,CAAC;GAC5B,oBAAoB,CAgFhC","sourcesContent":["import { html, css, TemplateResult, CSSResultArray } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport NileElement from '../../internal/nile-element';\nimport { renderGlyph } from '../../internal/glyph';\nimport type { ToolbarState } from '../engine/selection-state';\n\ninterface EmbedOp {\n label: string;\n icon?: string;\n text?: string;\n command: string;\n attrs?: Record<string, unknown>;\n active?: (s: ToolbarState) => boolean;\n}\n\nconst OPS: EmbedOp[] = [\n {\n label: 'Align left',\n icon: 'format_align_left',\n command: 'setEmbedAlign',\n attrs: { align: 'left' },\n active: s => s.embedAlign === 'left' || s.embedAlign === null,\n },\n {\n label: 'Align center',\n icon: 'format_align_middle',\n command: 'setEmbedAlign',\n attrs: { align: 'center' },\n active: s => s.embedAlign === 'center',\n },\n {\n label: 'Align right',\n icon: 'format_align_right',\n command: 'setEmbedAlign',\n attrs: { align: 'right' },\n active: s => s.embedAlign === 'right',\n },\n { label: 'Delete video', icon: 'ng-trash-01', command: 'deleteEmbed' },\n];\n\n/**\n * Compact floating bar shown while a video embed is selected — mirrors the\n * image menu (align left/center/right, delete). The host positions it;\n * operations bubble up as `wysiwyg-command` events.\n */\n@customElement('nile-wysiwyg-embed-menu')\nexport class NileWysiwygEmbedMenu extends NileElement {\n @property({ type: Boolean, reflect: true }) open = false;\n\n @property({ attribute: false }) toolbarState?: ToolbarState;\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: 15;\n display: none;\n }\n\n :host([open]) {\n display: block;\n }\n\n .menu {\n display: flex;\n gap: 2px;\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 }\n\n button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 26px;\n height: 26px;\n padding: 0 4px;\n border: none;\n border-radius: 5px;\n background: transparent;\n cursor: pointer;\n font-size: 12px;\n font-weight: 600;\n color: var(--nile-colors-neutral-700, #344054);\n }\n\n button:hover {\n background: var(--nile-colors-neutral-100, #f2f4f7);\n }\n\n button[data-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 ];\n }\n\n public render(): TemplateResult {\n const state = this.toolbarState;\n return html`\n <div class=\"menu\" part=\"embed-menu\" @mousedown=${(e: Event) => e.preventDefault()}>\n ${OPS.map(\n op => html`\n <button\n type=\"button\"\n title=${op.label}\n aria-label=${op.label}\n ?data-active=${state && op.active ? op.active(state) : false}\n @click=${() => this.emit('wysiwyg-command', { name: op.command, attrs: op.attrs })}\n >\n ${op.icon ? renderGlyph(op.icon, 16) : op.text}\n </button>\n `\n )}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-wysiwyg-embed-menu': NileWysiwygEmbedMenu;\n }\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { TemplateResult, CSSResultArray } from 'lit';
|
|
2
|
+
import NileElement from '../../internal/nile-element';
|
|
3
|
+
import '../../nile-input/index';
|
|
4
|
+
import '../../nile-button/index';
|
|
5
|
+
/**
|
|
6
|
+
* Floating embed-insert panel: paste a YouTube/Vimeo/Loom link. Styled to
|
|
7
|
+
* match the image panel (nile-input + nile-button). Emits
|
|
8
|
+
* `wysiwyg-embed-apply` detail: { src, provider } and `wysiwyg-embed-cancel`.
|
|
9
|
+
*/
|
|
10
|
+
export declare class NileWysiwygEmbedPanel extends NileElement {
|
|
11
|
+
open: boolean;
|
|
12
|
+
private urlValue;
|
|
13
|
+
private error;
|
|
14
|
+
static get styles(): CSSResultArray;
|
|
15
|
+
focusInput(): void;
|
|
16
|
+
/** Clears the field. */
|
|
17
|
+
reset(): void;
|
|
18
|
+
private onUrl;
|
|
19
|
+
private handleSubmit;
|
|
20
|
+
private handleKeydown;
|
|
21
|
+
render(): TemplateResult;
|
|
22
|
+
}
|
|
23
|
+
declare global {
|
|
24
|
+
interface HTMLElementTagNameMap {
|
|
25
|
+
'nile-wysiwyg-embed-panel': NileWysiwygEmbedPanel;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
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 { toEmbedUrl } from '../engine/plugins/embeds';
|
|
6
|
+
import '../../nile-input/index';
|
|
7
|
+
import '../../nile-button/index';
|
|
8
|
+
/**
|
|
9
|
+
* Floating embed-insert panel: paste a YouTube/Vimeo/Loom link. Styled to
|
|
10
|
+
* match the image panel (nile-input + nile-button). Emits
|
|
11
|
+
* `wysiwyg-embed-apply` detail: { src, provider } and `wysiwyg-embed-cancel`.
|
|
12
|
+
*/
|
|
13
|
+
let NileWysiwygEmbedPanel = class NileWysiwygEmbedPanel extends NileElement {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.open = false;
|
|
17
|
+
this.urlValue = '';
|
|
18
|
+
this.error = '';
|
|
19
|
+
}
|
|
20
|
+
static get styles() {
|
|
21
|
+
return [
|
|
22
|
+
css `
|
|
23
|
+
:host {
|
|
24
|
+
font-family: var(
|
|
25
|
+
--nile-font-family-sans-serif,
|
|
26
|
+
var(--ng-font-family-body, system-ui, -apple-system, sans-serif)
|
|
27
|
+
);
|
|
28
|
+
position: absolute;
|
|
29
|
+
z-index: 20;
|
|
30
|
+
display: none;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:host([open]) {
|
|
34
|
+
display: block;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.embed-panel {
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
gap: 12px;
|
|
41
|
+
min-width: 340px;
|
|
42
|
+
max-width: 420px;
|
|
43
|
+
padding: 12px;
|
|
44
|
+
background: var(--nile-wysiwyg-popover-bg, #ffffff);
|
|
45
|
+
border: 1px solid var(--nile-colors-neutral-400, #d0d5dd);
|
|
46
|
+
border-radius: 8px;
|
|
47
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
|
|
48
|
+
font-size: 13px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
nile-input {
|
|
52
|
+
width: 100%;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.hint {
|
|
56
|
+
font-size: 12px;
|
|
57
|
+
color: var(--nile-colors-neutral-500, #98a2b3);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.error {
|
|
61
|
+
font-size: 12px;
|
|
62
|
+
color: var(--nile-colors-danger-600, #d92d20);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.actions {
|
|
66
|
+
display: flex;
|
|
67
|
+
justify-content: flex-end;
|
|
68
|
+
align-items: center;
|
|
69
|
+
gap: 8px;
|
|
70
|
+
width: 100%;
|
|
71
|
+
}
|
|
72
|
+
`,
|
|
73
|
+
];
|
|
74
|
+
}
|
|
75
|
+
focusInput() {
|
|
76
|
+
this.updateComplete.then(() => {
|
|
77
|
+
const input = this.shadowRoot?.querySelector('nile-input');
|
|
78
|
+
input?.focus();
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/** Clears the field. */
|
|
82
|
+
reset() {
|
|
83
|
+
this.urlValue = '';
|
|
84
|
+
this.error = '';
|
|
85
|
+
}
|
|
86
|
+
onUrl(event) {
|
|
87
|
+
this.urlValue = (event.detail?.value ?? '');
|
|
88
|
+
this.error = '';
|
|
89
|
+
}
|
|
90
|
+
handleSubmit() {
|
|
91
|
+
const target = toEmbedUrl(this.urlValue.trim());
|
|
92
|
+
if (!target) {
|
|
93
|
+
this.error = 'Only YouTube, Vimeo, and Loom links are supported.';
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
this.error = '';
|
|
97
|
+
this.emit('wysiwyg-embed-apply', target);
|
|
98
|
+
}
|
|
99
|
+
handleKeydown(event) {
|
|
100
|
+
if (event.key === 'Escape') {
|
|
101
|
+
event.stopPropagation();
|
|
102
|
+
this.emit('wysiwyg-embed-cancel');
|
|
103
|
+
}
|
|
104
|
+
else if (event.key === 'Enter') {
|
|
105
|
+
event.preventDefault();
|
|
106
|
+
event.stopPropagation();
|
|
107
|
+
this.handleSubmit();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
render() {
|
|
111
|
+
return html `
|
|
112
|
+
<div class="embed-panel" part="embed-panel" @keydown=${this.handleKeydown}>
|
|
113
|
+
<nile-input
|
|
114
|
+
label="Video URL"
|
|
115
|
+
placeholder="https://www.youtube.com/watch?v=…"
|
|
116
|
+
.value=${this.urlValue}
|
|
117
|
+
@nile-input=${this.onUrl}
|
|
118
|
+
></nile-input>
|
|
119
|
+
|
|
120
|
+
${this.error
|
|
121
|
+
? html `<span class="error" part="error">${this.error}</span>`
|
|
122
|
+
: html `<span class="hint">YouTube, Vimeo, or Loom</span>`}
|
|
123
|
+
|
|
124
|
+
<div class="actions">
|
|
125
|
+
<nile-button variant="primary" @click=${() => this.handleSubmit()}
|
|
126
|
+
>Embed</nile-button
|
|
127
|
+
>
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
`;
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
__decorate([
|
|
134
|
+
property({ type: Boolean, reflect: true })
|
|
135
|
+
], NileWysiwygEmbedPanel.prototype, "open", void 0);
|
|
136
|
+
__decorate([
|
|
137
|
+
state()
|
|
138
|
+
], NileWysiwygEmbedPanel.prototype, "urlValue", void 0);
|
|
139
|
+
__decorate([
|
|
140
|
+
state()
|
|
141
|
+
], NileWysiwygEmbedPanel.prototype, "error", void 0);
|
|
142
|
+
NileWysiwygEmbedPanel = __decorate([
|
|
143
|
+
customElement('nile-wysiwyg-embed-panel')
|
|
144
|
+
], NileWysiwygEmbedPanel);
|
|
145
|
+
export { NileWysiwygEmbedPanel };
|
|
146
|
+
//# sourceMappingURL=embed-panel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embed-panel.js","sourceRoot":"","sources":["../../../../src/nile-wysiwyg-editor/ui/embed-panel.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,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,wBAAwB,CAAC;AAChC,OAAO,yBAAyB,CAAC;AAEjC;;;;GAIG;AAEI,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,WAAW;IAA/C;;QACuC,SAAI,GAAG,KAAK,CAAC;QAExC,aAAQ,GAAG,EAAE,CAAC;QACd,UAAK,GAAG,EAAE,CAAC;IAuH9B,CAAC;IArHQ,MAAM,KAAK,MAAM;QACtB,OAAO;YACL,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkDF;SACF,CAAC;IACJ,CAAC;IAEM,UAAU;QACf,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE;YAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,YAAY,CAAuB,CAAC;YACjF,KAAK,EAAE,KAAK,EAAE,CAAC;QACjB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,wBAAwB;IACjB,KAAK;QACV,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;IAClB,CAAC;IAEO,KAAK,CAAC,KAAkB;QAC9B,IAAI,CAAC,QAAQ,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,IAAI,EAAE,CAAW,CAAC;QACtD,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;IAClB,CAAC;IAEO,YAAY;QAClB,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;QAChD,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,IAAI,CAAC,KAAK,GAAG,oDAAoD,CAAC;YAClE,OAAO;QACT,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,IAAI,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;IAEO,aAAa,CAAC,KAAoB;QACxC,IAAI,KAAK,CAAC,GAAG,KAAK,QAAQ,EAAE,CAAC;YAC3B,KAAK,CAAC,eAAe,EAAE,CAAC;YACxB,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QACpC,CAAC;aAAM,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,EAAE,CAAC;YACjC,KAAK,CAAC,cAAc,EAAE,CAAC;YACvB,KAAK,CAAC,eAAe,EAAE,CAAC;YACxB,IAAI,CAAC,YAAY,EAAE,CAAC;QACtB,CAAC;IACH,CAAC;IAEM,MAAM;QACX,OAAO,IAAI,CAAA;6DAC8C,IAAI,CAAC,aAAa;;;;mBAI5D,IAAI,CAAC,QAAQ;wBACR,IAAI,CAAC,KAAK;;;UAGxB,IAAI,CAAC,KAAK;YACV,CAAC,CAAC,IAAI,CAAA,oCAAoC,IAAI,CAAC,KAAK,SAAS;YAC7D,CAAC,CAAC,IAAI,CAAA,mDAAmD;;;kDAGjB,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE;;;;;KAKtE,CAAC;IACJ,CAAC;CACF,CAAA;AA1H6C;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;mDAAc;AAExC;IAAhB,KAAK,EAAE;uDAAuB;AACd;IAAhB,KAAK,EAAE;oDAAoB;AAJjB,qBAAqB;IADjC,aAAa,CAAC,0BAA0B,CAAC;GAC7B,qBAAqB,CA2HjC","sourcesContent":["import { html, css, TemplateResult, CSSResultArray } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport NileElement from '../../internal/nile-element';\nimport { toEmbedUrl } from '../engine/plugins/embeds';\nimport '../../nile-input/index';\nimport '../../nile-button/index';\n\n/**\n * Floating embed-insert panel: paste a YouTube/Vimeo/Loom link. Styled to\n * match the image panel (nile-input + nile-button). Emits\n * `wysiwyg-embed-apply` detail: { src, provider } and `wysiwyg-embed-cancel`.\n */\n@customElement('nile-wysiwyg-embed-panel')\nexport class NileWysiwygEmbedPanel extends NileElement {\n @property({ type: Boolean, reflect: true }) open = false;\n\n @state() private urlValue = '';\n @state() private error = '';\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 .embed-panel {\n display: flex;\n flex-direction: column;\n gap: 12px;\n min-width: 340px;\n max-width: 420px;\n padding: 12px;\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: 0 4px 16px rgba(0, 0, 0, 0.08);\n font-size: 13px;\n }\n\n nile-input {\n width: 100%;\n }\n\n .hint {\n font-size: 12px;\n color: var(--nile-colors-neutral-500, #98a2b3);\n }\n\n .error {\n font-size: 12px;\n color: var(--nile-colors-danger-600, #d92d20);\n }\n\n .actions {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n gap: 8px;\n width: 100%;\n }\n `,\n ];\n }\n\n public focusInput(): void {\n this.updateComplete.then(() => {\n const input = this.shadowRoot?.querySelector('nile-input') as HTMLElement | null;\n input?.focus();\n });\n }\n\n /** Clears the field. */\n public reset(): void {\n this.urlValue = '';\n this.error = '';\n }\n\n private onUrl(event: CustomEvent): void {\n this.urlValue = (event.detail?.value ?? '') as string;\n this.error = '';\n }\n\n private handleSubmit(): void {\n const target = toEmbedUrl(this.urlValue.trim());\n if (!target) {\n this.error = 'Only YouTube, Vimeo, and Loom links are supported.';\n return;\n }\n this.error = '';\n this.emit('wysiwyg-embed-apply', target);\n }\n\n private handleKeydown(event: KeyboardEvent): void {\n if (event.key === 'Escape') {\n event.stopPropagation();\n this.emit('wysiwyg-embed-cancel');\n } else if (event.key === 'Enter') {\n event.preventDefault();\n event.stopPropagation();\n this.handleSubmit();\n }\n }\n\n public render(): TemplateResult {\n return html`\n <div class=\"embed-panel\" part=\"embed-panel\" @keydown=${this.handleKeydown}>\n <nile-input\n label=\"Video URL\"\n placeholder=\"https://www.youtube.com/watch?v=…\"\n .value=${this.urlValue}\n @nile-input=${this.onUrl}\n ></nile-input>\n\n ${this.error\n ? html`<span class=\"error\" part=\"error\">${this.error}</span>`\n : html`<span class=\"hint\">YouTube, Vimeo, or Loom</span>`}\n\n <div class=\"actions\">\n <nile-button variant=\"primary\" @click=${() => this.handleSubmit()}\n >Embed</nile-button\n >\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-wysiwyg-embed-panel': NileWysiwygEmbedPanel;\n }\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TemplateResult, CSSResultArray } from 'lit';
|
|
2
|
+
import NileElement from '../../internal/nile-element';
|
|
3
|
+
/**
|
|
4
|
+
* Emoji picker panel (the 😊 toolbar item). Shares the emoji set with the
|
|
5
|
+
* ":" autocomplete; the search box filters by name. Emits
|
|
6
|
+
* `wysiwyg-emoji-select` detail: { char } and `wysiwyg-emoji-cancel`.
|
|
7
|
+
*/
|
|
8
|
+
export declare class NileWysiwygEmojiPicker extends NileElement {
|
|
9
|
+
open: boolean;
|
|
10
|
+
private filter;
|
|
11
|
+
searchInput?: HTMLInputElement;
|
|
12
|
+
static get styles(): CSSResultArray;
|
|
13
|
+
focusInput(): void;
|
|
14
|
+
private handleKeydown;
|
|
15
|
+
render(): TemplateResult;
|
|
16
|
+
}
|
|
17
|
+
declare global {
|
|
18
|
+
interface HTMLElementTagNameMap {
|
|
19
|
+
'nile-wysiwyg-emoji-picker': NileWysiwygEmojiPicker;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { html, css } from 'lit';
|
|
3
|
+
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
4
|
+
import NileElement from '../../internal/nile-element';
|
|
5
|
+
import { EMOJI } from '../emoji';
|
|
6
|
+
/**
|
|
7
|
+
* Emoji picker panel (the 😊 toolbar item). Shares the emoji set with the
|
|
8
|
+
* ":" autocomplete; the search box filters by name. Emits
|
|
9
|
+
* `wysiwyg-emoji-select` detail: { char } and `wysiwyg-emoji-cancel`.
|
|
10
|
+
*/
|
|
11
|
+
let NileWysiwygEmojiPicker = class NileWysiwygEmojiPicker extends NileElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.open = false;
|
|
15
|
+
this.filter = '';
|
|
16
|
+
}
|
|
17
|
+
static get styles() {
|
|
18
|
+
return [
|
|
19
|
+
css `
|
|
20
|
+
:host {
|
|
21
|
+
font-family: var(
|
|
22
|
+
--nile-font-family-sans-serif,
|
|
23
|
+
var(--ng-font-family-body, system-ui, -apple-system, sans-serif)
|
|
24
|
+
);
|
|
25
|
+
position: absolute;
|
|
26
|
+
z-index: 20;
|
|
27
|
+
display: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:host([open]) {
|
|
31
|
+
display: block;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.panel {
|
|
35
|
+
width: 316px;
|
|
36
|
+
padding: 8px;
|
|
37
|
+
background: var(--nile-wysiwyg-popover-bg, #ffffff);
|
|
38
|
+
border: 1px solid var(--nile-colors-neutral-400, #d0d5dd);
|
|
39
|
+
border-radius: 8px;
|
|
40
|
+
box-shadow: var(--nile-wysiwyg-popover-shadow, 0 4px 12px rgba(16, 24, 40, 0.12));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
input {
|
|
44
|
+
font: inherit;
|
|
45
|
+
font-size: 13px;
|
|
46
|
+
width: 100%;
|
|
47
|
+
box-sizing: border-box;
|
|
48
|
+
margin-bottom: 6px;
|
|
49
|
+
padding: 5px 8px;
|
|
50
|
+
border: 1px solid var(--nile-colors-neutral-400, #d0d5dd);
|
|
51
|
+
border-radius: 6px;
|
|
52
|
+
outline: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
input:focus {
|
|
56
|
+
border-color: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600, #2563eb));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.grid {
|
|
60
|
+
display: grid;
|
|
61
|
+
grid-template-columns: repeat(9, 1fr);
|
|
62
|
+
gap: 2px;
|
|
63
|
+
max-height: 200px;
|
|
64
|
+
overflow-y: auto;
|
|
65
|
+
overscroll-behavior: contain;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.emoji {
|
|
69
|
+
font: inherit;
|
|
70
|
+
font-size: 18px;
|
|
71
|
+
height: 30px;
|
|
72
|
+
padding: 0;
|
|
73
|
+
border: none;
|
|
74
|
+
border-radius: 5px;
|
|
75
|
+
background: transparent;
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
line-height: 1;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.emoji:hover {
|
|
81
|
+
background: var(--nile-colors-neutral-100, #f2f4f7);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.empty {
|
|
85
|
+
padding: 12px 4px;
|
|
86
|
+
font-size: 12px;
|
|
87
|
+
color: var(--nile-colors-neutral-500, #98a2b3);
|
|
88
|
+
text-align: center;
|
|
89
|
+
}
|
|
90
|
+
`,
|
|
91
|
+
];
|
|
92
|
+
}
|
|
93
|
+
focusInput() {
|
|
94
|
+
this.filter = '';
|
|
95
|
+
this.updateComplete.then(() => {
|
|
96
|
+
if (this.searchInput)
|
|
97
|
+
this.searchInput.value = '';
|
|
98
|
+
this.searchInput?.focus();
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
handleKeydown(event) {
|
|
102
|
+
if (event.key === 'Escape') {
|
|
103
|
+
event.stopPropagation();
|
|
104
|
+
this.emit('wysiwyg-emoji-cancel');
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
render() {
|
|
108
|
+
const query = this.filter.trim().toLowerCase();
|
|
109
|
+
const shown = query ? EMOJI.filter(e => e.name.includes(query)) : EMOJI;
|
|
110
|
+
return html `
|
|
111
|
+
<div class="panel" part="emoji-picker" @keydown=${this.handleKeydown}>
|
|
112
|
+
<input
|
|
113
|
+
class="emoji-picker__search"
|
|
114
|
+
type="text"
|
|
115
|
+
placeholder="Search emoji…"
|
|
116
|
+
aria-label="Search emoji"
|
|
117
|
+
@input=${(e) => {
|
|
118
|
+
this.filter = e.target.value;
|
|
119
|
+
}}
|
|
120
|
+
/>
|
|
121
|
+
<div class="grid" role="listbox" aria-label="Emoji">
|
|
122
|
+
${shown.map(e => html `
|
|
123
|
+
<button
|
|
124
|
+
type="button"
|
|
125
|
+
class="emoji"
|
|
126
|
+
title=${e.name}
|
|
127
|
+
@mousedown=${(ev) => ev.preventDefault()}
|
|
128
|
+
@click=${() => this.emit('wysiwyg-emoji-select', { char: e.char })}
|
|
129
|
+
>
|
|
130
|
+
${e.char}
|
|
131
|
+
</button>
|
|
132
|
+
`)}
|
|
133
|
+
${shown.length === 0
|
|
134
|
+
? html `<div class="empty" style="grid-column: 1 / -1">No emoji found</div>`
|
|
135
|
+
: ''}
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
`;
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
__decorate([
|
|
142
|
+
property({ type: Boolean, reflect: true })
|
|
143
|
+
], NileWysiwygEmojiPicker.prototype, "open", void 0);
|
|
144
|
+
__decorate([
|
|
145
|
+
state()
|
|
146
|
+
], NileWysiwygEmojiPicker.prototype, "filter", void 0);
|
|
147
|
+
__decorate([
|
|
148
|
+
query('.emoji-picker__search')
|
|
149
|
+
], NileWysiwygEmojiPicker.prototype, "searchInput", void 0);
|
|
150
|
+
NileWysiwygEmojiPicker = __decorate([
|
|
151
|
+
customElement('nile-wysiwyg-emoji-picker')
|
|
152
|
+
], NileWysiwygEmojiPicker);
|
|
153
|
+
export { NileWysiwygEmojiPicker };
|
|
154
|
+
//# sourceMappingURL=emoji-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emoji-picker.js","sourceRoot":"","sources":["../../../../src/nile-wysiwyg-editor/ui/emoji-picker.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAkC,MAAM,KAAK,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,WAAW,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC;;;;GAIG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,WAAW;IAAhD;;QACuC,SAAI,GAAG,KAAK,CAAC;QAExC,WAAM,GAAG,EAAE,CAAC;IAmI/B,CAAC;IA/HQ,MAAM,KAAK,MAAM;QACtB,OAAO;YACL,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuEF;SACF,CAAC;IACJ,CAAC;IAEM,UAAU;QACf,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE;YAC5B,IAAI,IAAI,CAAC,WAAW;gBAAE,IAAI,CAAC,WAAW,CAAC,KAAK,GAAG,EAAE,CAAC;YAClD,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,CAAC;QAC5B,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,aAAa,CAAC,KAAoB;QACxC,IAAI,KAAK,CAAC,GAAG,KAAK,QAAQ,EAAE,CAAC;YAC3B,KAAK,CAAC,eAAe,EAAE,CAAC;YACxB,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;IAEM,MAAM;QACX,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAC/C,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QACxE,OAAO,IAAI,CAAA;wDACyC,IAAI,CAAC,aAAa;;;;;;mBAMvD,CAAC,CAAQ,EAAE,EAAE;YACpB,IAAI,CAAC,MAAM,GAAI,CAAC,CAAC,MAA2B,CAAC,KAAK,CAAC;QACrD,CAAC;;;YAGC,KAAK,CAAC,GAAG,CACT,CAAC,CAAC,EAAE,CAAC,IAAI,CAAA;;;;wBAIG,CAAC,CAAC,IAAI;6BACD,CAAC,EAAS,EAAE,EAAE,CAAC,EAAE,CAAC,cAAc,EAAE;yBACtC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,sBAAsB,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;;kBAEhE,CAAC,CAAC,IAAI;;aAEX,CACF;YACC,KAAK,CAAC,MAAM,KAAK,CAAC;YAClB,CAAC,CAAC,IAAI,CAAA,qEAAqE;YAC3E,CAAC,CAAC,EAAE;;;KAGX,CAAC;IACJ,CAAC;CACF,CAAA;AArI6C;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oDAAc;AAExC;IAAhB,KAAK,EAAE;sDAAqB;AAEG;IAA/B,KAAK,CAAC,uBAAuB,CAAC;2DAAgC;AALpD,sBAAsB;IADlC,aAAa,CAAC,2BAA2B,CAAC;GAC9B,sBAAsB,CAsIlC","sourcesContent":["import { html, css, TemplateResult, CSSResultArray } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport NileElement from '../../internal/nile-element';\nimport { EMOJI } from '../emoji';\n\n/**\n * Emoji picker panel (the 😊 toolbar item). Shares the emoji set with the\n * \":\" autocomplete; the search box filters by name. Emits\n * `wysiwyg-emoji-select` detail: { char } and `wysiwyg-emoji-cancel`.\n */\n@customElement('nile-wysiwyg-emoji-picker')\nexport class NileWysiwygEmojiPicker extends NileElement {\n @property({ type: Boolean, reflect: true }) open = false;\n\n @state() private filter = '';\n\n @query('.emoji-picker__search') searchInput?: HTMLInputElement;\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 input {\n font: inherit;\n font-size: 13px;\n width: 100%;\n box-sizing: border-box;\n margin-bottom: 6px;\n padding: 5px 8px;\n border: 1px solid var(--nile-colors-neutral-400, #d0d5dd);\n border-radius: 6px;\n outline: none;\n }\n\n input:focus {\n border-color: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600, #2563eb));\n }\n\n .grid {\n display: grid;\n grid-template-columns: repeat(9, 1fr);\n gap: 2px;\n max-height: 200px;\n overflow-y: auto;\n overscroll-behavior: contain;\n }\n\n .emoji {\n font: inherit;\n font-size: 18px;\n height: 30px;\n padding: 0;\n border: none;\n border-radius: 5px;\n background: transparent;\n cursor: pointer;\n line-height: 1;\n }\n\n .emoji:hover {\n background: var(--nile-colors-neutral-100, #f2f4f7);\n }\n\n .empty {\n padding: 12px 4px;\n font-size: 12px;\n color: var(--nile-colors-neutral-500, #98a2b3);\n text-align: center;\n }\n `,\n ];\n }\n\n public focusInput(): void {\n this.filter = '';\n this.updateComplete.then(() => {\n if (this.searchInput) this.searchInput.value = '';\n this.searchInput?.focus();\n });\n }\n\n private handleKeydown(event: KeyboardEvent): void {\n if (event.key === 'Escape') {\n event.stopPropagation();\n this.emit('wysiwyg-emoji-cancel');\n }\n }\n\n public render(): TemplateResult {\n const query = this.filter.trim().toLowerCase();\n const shown = query ? EMOJI.filter(e => e.name.includes(query)) : EMOJI;\n return html`\n <div class=\"panel\" part=\"emoji-picker\" @keydown=${this.handleKeydown}>\n <input\n class=\"emoji-picker__search\"\n type=\"text\"\n placeholder=\"Search emoji…\"\n aria-label=\"Search emoji\"\n @input=${(e: Event) => {\n this.filter = (e.target as HTMLInputElement).value;\n }}\n />\n <div class=\"grid\" role=\"listbox\" aria-label=\"Emoji\">\n ${shown.map(\n e => html`\n <button\n type=\"button\"\n class=\"emoji\"\n title=${e.name}\n @mousedown=${(ev: Event) => ev.preventDefault()}\n @click=${() => this.emit('wysiwyg-emoji-select', { char: e.char })}\n >\n ${e.char}\n </button>\n `\n )}\n ${shown.length === 0\n ? html`<div class=\"empty\" style=\"grid-column: 1 / -1\">No emoji found</div>`\n : ''}\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-wysiwyg-emoji-picker': NileWysiwygEmojiPicker;\n }\n}\n"]}
|