@aquera/nile-elements 2.0.15 → 2.0.17
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 +6 -0
- package/demo/nxtgen-classes.css +5 -5
- package/demo/nxtgen-dark.css +16 -16
- package/demo/nxtgen-properties.css +2 -2
- package/demo/nxtgen-utilities.css +5 -5
- package/demo/nxtgen.css +5 -5
- package/demo/utilities.css +2 -2
- package/demo/variables.css +2 -2
- package/dist/{index-f6944844.cjs.js → index-0c0c869d.cjs.js} +2 -2
- package/dist/{index-f6944844.cjs.js.map → index-0c0c869d.cjs.js.map} +1 -1
- package/dist/{index-403841c7.cjs.js → index-129ef6fb.cjs.js} +3 -3
- package/dist/{index-403841c7.cjs.js.map → index-129ef6fb.cjs.js.map} +1 -1
- package/dist/{index-1faa963c.esm.js → index-36f2a6b5.esm.js} +1 -1
- package/dist/index-4df50481.esm.js +1 -0
- package/dist/index-5d34cff1.esm.js +1 -0
- package/dist/index-7ae95edd.cjs.js +2 -0
- package/dist/{index-3ca67627.cjs.js.map → index-7ae95edd.cjs.js.map} +1 -1
- package/dist/index-7ca72b78.esm.js +1 -0
- package/dist/index-bbe23ad8.cjs.js +2 -0
- package/dist/index-bbe23ad8.cjs.js.map +1 -0
- package/dist/index-ccc6a799.cjs.js +5 -0
- package/dist/index-ccc6a799.cjs.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +124 -72
- 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 +2 -2
- package/dist/nile-code-editor/index.cjs.js +1 -1
- package/dist/nile-code-editor/nile-code-editor.cjs.js +1 -1
- package/dist/nile-code-editor/theme.cjs.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/nile-combobox.cjs.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/nile-detail.cjs.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-lite-tooltip/nile-lite-tooltip.css.cjs.js +1 -1
- package/dist/nile-lite-tooltip/nile-lite-tooltip.css.cjs.js.map +1 -1
- package/dist/nile-lite-tooltip/nile-lite-tooltip.css.esm.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-segmented-progress-bar/index.cjs.js +1 -1
- package/dist/nile-segmented-progress-bar/nile-segmented-progress-bar.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-tooltip/nile-tooltip.css.cjs.js +1 -1
- package/dist/nile-tooltip/nile-tooltip.css.cjs.js.map +1 -1
- package/dist/nile-tooltip/nile-tooltip.css.esm.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/engine/commands.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/commands.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/commands.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/create-state.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/create-state.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/create-state.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/email-css.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/email-css.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/email-css.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/email-render.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/email-render.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/email-render.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/html-detect.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/html-detect.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/html-detect.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/engine/index.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/index.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/inputrules.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/inputrules.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/inputrules.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/keymap.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/keymap.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/keymap.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/embeds.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/embeds.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/embeds.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/format-painter.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/format-painter.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/format-painter.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/image-view.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/image-view.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/image-view.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/image.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/image.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/image.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/link.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/link.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/link.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/max-length.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/max-length.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/max-length.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/paste.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/paste.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/paste.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/single-line.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/single-line.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/single-line.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/tables.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/tables.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/tables.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/sanitize.cjs.js +2 -1
- package/dist/nile-wysiwyg-editor/engine/sanitize.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/sanitize.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/schema.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/schema.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/schema.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/selection-state.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/selection-state.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/selection-state.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/serializer.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/serializer.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/serializer.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/index.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/index.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.esm.js +45 -4
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.esm.js +2 -2
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/bookmark-panel.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/bookmark-panel.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/bookmark-panel.esm.js +2 -2
- package/dist/nile-wysiwyg-editor/ui/bubble-menu.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/bubble-menu.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/bubble-menu.esm.js +5 -5
- package/dist/nile-wysiwyg-editor/ui/code-block-menu.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/code-block-menu.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/code-block-menu.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/embed-menu.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/embed-menu.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/embed-menu.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/embed-panel.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/embed-panel.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/embed-panel.esm.js +2 -2
- package/dist/nile-wysiwyg-editor/ui/emoji-picker.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/emoji-picker.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/emoji-picker.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/find-replace.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/find-replace.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/find-replace.esm.js +3 -3
- package/dist/nile-wysiwyg-editor/ui/image-menu.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/image-menu.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/image-menu.esm.js +3 -3
- package/dist/nile-wysiwyg-editor/ui/image-panel.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/image-panel.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/image-panel.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/insert-menu.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/insert-menu.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/insert-menu.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/link-editor.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/link-editor.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/link-editor.esm.js +9 -9
- package/dist/nile-wysiwyg-editor/ui/markdown-panel.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/markdown-panel.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/markdown-panel.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/math-panel.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/math-panel.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/math-panel.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/shortcut-help.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/shortcut-help.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/shortcut-help.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/source-view.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/source-view.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/source-view.esm.js +4 -4
- package/dist/nile-wysiwyg-editor/ui/special-chars.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/special-chars.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/special-chars.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/suggest-list.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/suggest-list.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/suggest-list.esm.js +23 -12
- package/dist/nile-wysiwyg-editor/ui/table-grid-picker.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/table-grid-picker.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/table-grid-picker.esm.js +7 -7
- package/dist/nile-wysiwyg-editor/ui/table-menu.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/table-menu.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/table-menu.esm.js +1 -1
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.css.js +1 -1
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.css.js.map +1 -1
- package/dist/src/nile-tooltip/nile-tooltip.css.js +1 -1
- package/dist/src/nile-tooltip/nile-tooltip.css.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/create-state.d.ts +5 -0
- package/dist/src/nile-wysiwyg-editor/engine/create-state.js +2 -0
- package/dist/src/nile-wysiwyg-editor/engine/create-state.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/email-css.d.ts +14 -0
- package/dist/src/nile-wysiwyg-editor/engine/email-css.js +140 -0
- package/dist/src/nile-wysiwyg-editor/engine/email-css.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/email-fidelity.test.d.ts +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/email-fidelity.test.js +1045 -0
- package/dist/src/nile-wysiwyg-editor/engine/email-fidelity.test.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/email-render.d.ts +11 -0
- package/dist/src/nile-wysiwyg-editor/engine/email-render.js +93 -0
- package/dist/src/nile-wysiwyg-editor/engine/email-render.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/html-detect.d.ts +2 -0
- package/dist/src/nile-wysiwyg-editor/engine/html-detect.js +24 -0
- package/dist/src/nile-wysiwyg-editor/engine/html-detect.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/index.d.ts +4 -1
- package/dist/src/nile-wysiwyg-editor/engine/index.js +3 -1
- package/dist/src/nile-wysiwyg-editor/engine/index.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/inputrules.d.ts +0 -5
- package/dist/src/nile-wysiwyg-editor/engine/inputrules.js +19 -0
- package/dist/src/nile-wysiwyg-editor/engine/inputrules.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/plugins/image-view.js +3 -2
- package/dist/src/nile-wysiwyg-editor/engine/plugins/image-view.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/plugins/link.d.ts +4 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/link.js +56 -1
- package/dist/src/nile-wysiwyg-editor/engine/plugins/link.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/plugins/paste.d.ts +5 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/paste.js +27 -6
- package/dist/src/nile-wysiwyg-editor/engine/plugins/paste.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/plugins/tables.js +30 -7
- package/dist/src/nile-wysiwyg-editor/engine/plugins/tables.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/pm.test.js +46 -0
- package/dist/src/nile-wysiwyg-editor/engine/pm.test.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/sanitize.d.ts +9 -1
- package/dist/src/nile-wysiwyg-editor/engine/sanitize.js +730 -7
- package/dist/src/nile-wysiwyg-editor/engine/sanitize.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/schema.d.ts +3 -0
- package/dist/src/nile-wysiwyg-editor/engine/schema.js +215 -34
- package/dist/src/nile-wysiwyg-editor/engine/schema.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/selection-state.js +3 -1
- package/dist/src/nile-wysiwyg-editor/engine/selection-state.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/serializer.d.ts +12 -4
- package/dist/src/nile-wysiwyg-editor/engine/serializer.js +18 -8
- package/dist/src/nile-wysiwyg-editor/engine/serializer.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor-email-fidelity.test.d.ts +1 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor-email-fidelity.test.js +287 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor-email-fidelity.test.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.js +45 -4
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.d.ts +23 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js +113 -15
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.js +213 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/bookmark-panel.js +2 -2
- package/dist/src/nile-wysiwyg-editor/ui/bookmark-panel.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.js +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/embed-menu.js +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/embed-menu.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/embed-panel.js +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/embed-panel.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/emoji-picker.js +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/emoji-picker.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/find-replace.js +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/find-replace.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/image-menu.js +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/image-menu.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/image-panel.js +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/image-panel.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/insert-menu.js +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/insert-menu.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/link-editor.js +2 -2
- package/dist/src/nile-wysiwyg-editor/ui/link-editor.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/markdown-panel.js +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/markdown-panel.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/math-panel.js +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/math-panel.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/shortcut-help.js +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/shortcut-help.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/source-view.js +2 -2
- package/dist/src/nile-wysiwyg-editor/ui/source-view.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/special-chars.js +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/special-chars.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/suggest-list.js +14 -3
- package/dist/src/nile-wysiwyg-editor/ui/suggest-list.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.js +2 -2
- package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/table-menu.js +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/table-menu.js.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/version.cjs.js +1 -1
- package/dist/version.cjs.js.map +1 -1
- package/dist/version.esm.js +1 -1
- package/package.json +1 -1
- package/src/nile-lite-tooltip/nile-lite-tooltip.css.ts +1 -1
- package/src/nile-tooltip/nile-tooltip.css.ts +1 -1
- package/src/nile-wysiwyg-editor/engine/create-state.ts +7 -0
- package/src/nile-wysiwyg-editor/engine/email-css.ts +136 -0
- package/src/nile-wysiwyg-editor/engine/email-fidelity.test.ts +1347 -0
- package/src/nile-wysiwyg-editor/engine/email-render.ts +99 -0
- package/src/nile-wysiwyg-editor/engine/html-detect.ts +26 -0
- package/src/nile-wysiwyg-editor/engine/index.ts +10 -1
- package/src/nile-wysiwyg-editor/engine/inputrules.ts +18 -1
- package/src/nile-wysiwyg-editor/engine/plugins/image-view.ts +3 -2
- package/src/nile-wysiwyg-editor/engine/plugins/link.ts +58 -2
- package/src/nile-wysiwyg-editor/engine/plugins/paste.ts +31 -8
- package/src/nile-wysiwyg-editor/engine/plugins/tables.ts +29 -7
- package/src/nile-wysiwyg-editor/engine/pm.test.ts +73 -0
- package/src/nile-wysiwyg-editor/engine/sanitize.ts +729 -7
- package/src/nile-wysiwyg-editor/engine/schema.ts +206 -33
- package/src/nile-wysiwyg-editor/engine/selection-state.ts +3 -1
- package/src/nile-wysiwyg-editor/engine/serializer.ts +30 -8
- package/src/nile-wysiwyg-editor/nile-wysiwyg-editor-email-fidelity.test.ts +357 -0
- package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.ts +45 -4
- package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.ts +258 -0
- package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.ts +119 -12
- package/src/nile-wysiwyg-editor/ui/bookmark-panel.ts +2 -2
- package/src/nile-wysiwyg-editor/ui/bubble-menu.ts +1 -1
- package/src/nile-wysiwyg-editor/ui/embed-menu.ts +1 -1
- package/src/nile-wysiwyg-editor/ui/embed-panel.ts +1 -1
- package/src/nile-wysiwyg-editor/ui/emoji-picker.ts +1 -1
- package/src/nile-wysiwyg-editor/ui/find-replace.ts +1 -1
- package/src/nile-wysiwyg-editor/ui/image-menu.ts +1 -1
- package/src/nile-wysiwyg-editor/ui/image-panel.ts +1 -1
- package/src/nile-wysiwyg-editor/ui/insert-menu.ts +1 -1
- package/src/nile-wysiwyg-editor/ui/link-editor.ts +2 -2
- package/src/nile-wysiwyg-editor/ui/markdown-panel.ts +1 -1
- package/src/nile-wysiwyg-editor/ui/math-panel.ts +1 -1
- package/src/nile-wysiwyg-editor/ui/shortcut-help.ts +1 -1
- package/src/nile-wysiwyg-editor/ui/source-view.ts +2 -2
- package/src/nile-wysiwyg-editor/ui/special-chars.ts +1 -1
- package/src/nile-wysiwyg-editor/ui/suggest-list.ts +14 -3
- package/src/nile-wysiwyg-editor/ui/table-grid-picker.ts +2 -2
- package/src/nile-wysiwyg-editor/ui/table-menu.ts +1 -1
- package/vscode-html-custom-data.json +15 -1
- package/web-test-runner.config.mjs +4 -0
- package/dist/index-3ca67627.cjs.js +0 -2
- package/dist/index-6f3fa4ab.esm.js +0 -1
- package/dist/index-7b1c9857.esm.js +0 -1
- package/dist/index-89c520e9.cjs.js +0 -5
- package/dist/index-89c520e9.cjs.js.map +0 -1
- package/dist/index-ba47645d.esm.js +0 -1
- package/dist/index-c3210a9c.cjs.js +0 -2
- package/dist/index-c3210a9c.cjs.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{__decorate as
|
|
1
|
+
import{__decorate as e}from"tslib";import{css as t,html as i}from"lit";import{property as s,state as r,customElement as o}from"lit/decorators.js";import{N as a}from"../../internal/nile-element.esm.js";import"../../internal/accessibility/a11y.state.enum.esm.js";import"../../internal/accessibility/a11y.property.enum.esm.js";import"../../internal/accessibility/role.enum.esm.js";let n=class extends a{constructor(){super(...arguments),this.open=!1,this.items=[],this.activeIndex=0}static get styles(){return[t`
|
|
2
2
|
:host {
|
|
3
3
|
font-family: var(
|
|
4
4
|
--nile-font-family-sans-serif,
|
|
@@ -15,11 +15,14 @@ import{__decorate as t}from"tslib";import{css as i,html as s}from"lit";import{pr
|
|
|
15
15
|
|
|
16
16
|
.list {
|
|
17
17
|
min-width: 200px;
|
|
18
|
-
|
|
18
|
+
/* Wide enough for long field names (e.g. source.JobAssignment…); longer
|
|
19
|
+
labels wrap rather than scrolling sideways. */
|
|
20
|
+
max-width: min(480px, calc(100vw - 32px));
|
|
19
21
|
max-height: 240px;
|
|
20
22
|
overflow-y: auto;
|
|
23
|
+
overflow-x: hidden;
|
|
21
24
|
padding: 4px;
|
|
22
|
-
background: var(--nile-wysiwyg-popover-bg, var(--ng-colors-bg-primary));
|
|
25
|
+
background: var(--nile-wysiwyg-popover-bg, var(--nile-colors-white-base, var(--ng-colors-bg-primary)));
|
|
23
26
|
border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));
|
|
24
27
|
border-radius: 8px;
|
|
25
28
|
box-shadow: var(--nile-wysiwyg-popover-shadow, 0 4px 12px rgba(16, 24, 40, 0.12));
|
|
@@ -37,12 +40,20 @@ import{__decorate as t}from"tslib";import{css as i,html as s}from"lit";import{pr
|
|
|
37
40
|
color: var(--nile-colors-neutral-700, var(--ng-colors-text-secondary-700));
|
|
38
41
|
}
|
|
39
42
|
|
|
43
|
+
.label {
|
|
44
|
+
min-width: 0;
|
|
45
|
+
/* Wrap a long label instead of truncating it: names that differ only in
|
|
46
|
+
their last word (…JobFunction / …JobFunctionCode) must stay tellable apart. */
|
|
47
|
+
overflow-wrap: anywhere;
|
|
48
|
+
}
|
|
49
|
+
|
|
40
50
|
.item.active {
|
|
41
51
|
background: var(--nile-colors-primary-50, var(--ng-componentcolors-utility-blue-50));
|
|
42
52
|
color: var(--nile-colors-primary-700, var(--ng-componentcolors-utility-blue-700));
|
|
43
53
|
}
|
|
44
54
|
|
|
45
55
|
.hint {
|
|
56
|
+
flex-shrink: 0;
|
|
46
57
|
font-size: 11px;
|
|
47
58
|
color: var(--nile-colors-neutral-500, var(--ng-colors-text-quaternary-500));
|
|
48
59
|
}
|
|
@@ -51,17 +62,17 @@ import{__decorate as t}from"tslib";import{css as i,html as s}from"lit";import{pr
|
|
|
51
62
|
padding: 6px 8px;
|
|
52
63
|
color: var(--nile-colors-neutral-500, var(--ng-colors-text-quaternary-500));
|
|
53
64
|
}
|
|
54
|
-
`]}willUpdate(){this.activeIndex>=this.items.length&&(this.activeIndex=0)}updated(
|
|
55
|
-
<div class="list" part="suggest-list" @mousedown=${
|
|
56
|
-
${this.items.length?this.items.map(((t
|
|
65
|
+
`]}willUpdate(){this.activeIndex>=this.items.length&&(this.activeIndex=0)}updated(e){if(e.has("activeIndex")||e.has("items")){const e=this.renderRoot.querySelector(".item.active");e?.scrollIntoView({block:"nearest"})}}next(){this.items.length&&(this.activeIndex=(this.activeIndex+1)%this.items.length)}prev(){this.items.length&&(this.activeIndex=(this.activeIndex-1+this.items.length)%this.items.length)}resetActive(){this.activeIndex=0}selectCurrent(){const e=this.items[this.activeIndex];return!!e&&(this.emit("wysiwyg-suggest-select",{item:e}),!0)}render(){return i`
|
|
66
|
+
<div class="list" part="suggest-list" @mousedown=${e=>e.preventDefault()}>
|
|
67
|
+
${this.items.length?this.items.map(((e,t)=>i`
|
|
57
68
|
<div
|
|
58
|
-
class="item ${
|
|
59
|
-
@mouseenter=${()=>{this.activeIndex=
|
|
69
|
+
class="item ${t===this.activeIndex?"active":""}"
|
|
70
|
+
@mouseenter=${()=>{this.activeIndex=t}}
|
|
60
71
|
@click=${()=>this.selectCurrent()}
|
|
61
72
|
>
|
|
62
|
-
<span>${
|
|
63
|
-
${
|
|
73
|
+
<span class="label" title=${e.label}>${e.label}</span>
|
|
74
|
+
${e.hint?i`<span class="hint">${e.hint}</span>`:""}
|
|
64
75
|
</div>
|
|
65
|
-
`)):
|
|
76
|
+
`)):i`<div class="empty">No results</div>`}
|
|
66
77
|
</div>
|
|
67
|
-
`}};
|
|
78
|
+
`}};e([s({type:Boolean,reflect:!0})],n.prototype,"open",void 0),e([s({attribute:!1})],n.prototype,"items",void 0),e([r()],n.prototype,"activeIndex",void 0),n=e([o("nile-wysiwyg-suggest-list")],n);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","../../internal/nile-element.cjs.js","../../internal/accessibility/a11y.state.enum.cjs.js","../../internal/accessibility/a11y.property.enum.cjs.js","../../internal/accessibility/role.enum.cjs.js"],function(_export,_context){"use strict";var t,r,i,e,o,s,n,_templateObject,_templateObject2,_templateObject3,_templateObject4,a;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){r=_lit.css;i=_lit.html;},function(_litDecoratorsJs){e=_litDecoratorsJs.property;o=_litDecoratorsJs.state;s=_litDecoratorsJs.customElement;},function(_internalNileElementCjsJs){n=_internalNileElementCjsJs.N;},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){}],execute:function execute(){a=/*#__PURE__*/function(_n){function a(){var _this;_classCallCheck(this,a);_this=_callSuper(this,a,arguments),_this.disabled=!1,_this.maxRows=20,_this.maxCols=20,_this.open=!1,_this.hoverRows=0,_this.hoverCols=0,_this.customRows="",_this.customCols="",_this.handleOutside=function(t){_this.open&&!t.composedPath().includes(_assertThisInitialized(_this))&&(_this.open=!1);};return _this;}_inherits(a,_n);return _createClass(a,[{key:"connectedCallback",value:function connectedCallback(){_superPropGet(a,"connectedCallback",this,3)([]),document.addEventListener("mousedown",this.handleOutside);}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(a,"disconnectedCallback",this,3)([]),document.removeEventListener("mousedown",this.handleOutside);}},{key:"pick",value:function pick(t,r){this.open=!1,this.customRows="",this.customCols="",this.emit("wysiwyg-command",{name:"insertTable",attrs:{rows:t,cols:r,withHeaderRow:!0}});}},{key:"clamp",value:function clamp(t,r){var i=parseInt(t,10);return!Number.isFinite(i)||i<1?0:Math.min(i,r);}},{key:"insertCustom",value:function insertCustom(){var t=this.clamp(this.customRows,this.maxRows),r=this.clamp(this.customCols,this.maxCols);t>=1&&r>=1&&this.pick(t,r);}},{key:"render",value:function render(){var _this2=this;var t=Math.min(Math.max(5,this.hoverRows+1),this.maxRows),r=Math.min(Math.max(5,this.hoverCols+1),this.maxCols),e=[];var _loop=function _loop(_o){var _loop2=function _loop2(_t){e.push(i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <span\n class=\"cell ","\"\n @mouseenter=","\n @click=","\n ></span>\n "])),_o<=_this2.hoverRows&&_t<=_this2.hoverCols?"hot":"",function(){_this2.hoverRows=_o,_this2.hoverCols=_t;},function(){return _this2.pick(_o,_t);}));};for(var _t=1;_t<=r;_t+=1){_loop2(_t);}};for(var _o=1;_o<=t;_o+=1){_loop(_o);}var o=this.clamp(this.customRows,this.maxRows)>=1&&this.clamp(this.customCols,this.maxCols)>=1;return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <button\n type=\"button\"\n class=\"trigger\"\n part=\"button\"\n aria-label=\"Insert table\"\n aria-expanded=","\n ?disabled=","\n @mousedown=","\n @click=","\n >\n <nile-glyph name=\"grid-01\" size=\"18\" method=\"stroke\"></nile-glyph>\n </button>\n ","\n "])),this.open?"true":"false",this.disabled,function(t){return t.preventDefault();},function(){_this2.open=!_this2.open,_this2.hoverRows=0,_this2.hoverCols=0;},this.open?i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <div class=\"panel\">\n <div\n class=\"grid\"\n style=\"grid-template-columns: repeat(",", 14px)\"\n @mousedown=","\n @mouseleave=","\n >\n ","\n </div>\n <div class=\"label\" @mousedown=",">\n ","\n </div>\n <div class=\"custom\">\n <input\n type=\"number\"\n min=\"1\"\n max=","\n aria-label=\"Rows\"\n placeholder=\"Rows\"\n .value=","\n @input=","\n @keydown=","\n />\n <span class=\"times\">\xD7</span>\n <input\n type=\"number\"\n min=\"1\"\n max=","\n aria-label=\"Columns\"\n placeholder=\"Cols\"\n .value=","\n @input=","\n @keydown=","\n />\n <button\n type=\"button\"\n class=\"insert\"\n ?disabled=","\n @click=","\n >\n Insert\n </button>\n </div>\n </div>\n "])),r,function(t){return t.preventDefault();},function(){_this2.hoverRows=0,_this2.hoverCols=0;},e,function(t){return t.preventDefault();},this.hoverRows>0?"".concat(this.hoverRows," \xD7 ").concat(this.hoverCols):"Pick a size",this.maxRows,this.customRows,function(t){_this2.customRows=t.target.value;},function(t){"Enter"===t.key&&_this2.insertCustom();},this.maxCols,this.customCols,function(t){_this2.customCols=t.target.value;},function(t){"Enter"===t.key&&_this2.insertCustom();},!o,function(){return _this2.insertCustom();}):"");}}],[{key:"styles",get:function get(){return[r(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\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));\n }\n\n button.trigger:hover:not(:disabled) {\n background: var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary));\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, var(--ng-colors-bg-primary));\n border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));\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 gap: 2px;\n }\n\n .cell {\n width: 14px;\n height: 14px;\n border: 1px solid var(--nile-colors-neutral-300, var(--ng-colors-border-primary));\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));\n border-color: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600));\n }\n\n .label {\n margin-top: 6px;\n text-align: center;\n font-size: 12px;\n color: var(--nile-colors-neutral-600, var(--ng-colors-text-tertiary-600));\n }\n\n .custom {\n display: flex;\n align-items: center;\n gap: 6px;\n margin-top: 8px;\n padding-top: 8px;\n border-top: 1px solid var(--nile-colors-neutral-300, var(--ng-colors-border-secondary));\n }\n\n .custom input {\n width: 44px;\n height: 26px;\n padding: 0 6px;\n border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));\n border-radius: 6px;\n font-size: 12px;\n box-sizing: border-box;\n text-align: center;\n color: var(--nile-colors-dark-900, var(--ng-colors-text-primary-900));\n font-family: inherit;\n /* Hide native number spinners: they overlap the centered text in this\n narrow field and a stray click on the arrows mutates the value. */\n -moz-appearance: textfield;\n appearance: textfield;\n }\n\n .custom input::-webkit-outer-spin-button,\n .custom input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n .custom input:focus {\n outline: none;\n border-color: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600));\n }\n\n .custom .times {\n font-size: 12px;\n color: var(--nile-colors-neutral-600, var(--ng-colors-text-tertiary-600));\n }\n\n .custom button.insert {\n margin-left: auto;\n height: 26px;\n padding: 0 12px;\n border: none;\n border-radius: 6px;\n background: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600));\n color: var(--ng-colors-text-white);\n font-size: 12px;\n font-weight: 600;\n font-family: inherit;\n cursor: pointer;\n }\n\n .custom button.insert:hover:not(:disabled) {\n background: var(--nile-colors-primary-700, var(--ng-componentcolors-utility-blue-700));\n }\n\n .custom button.insert:disabled {\n opacity: 0.4;\n cursor: default;\n }\n "])))];}}]);}(n);t([e({type:Boolean,reflect:!0})],a.prototype,"disabled",void 0),t([e({type:Number,attribute:"max-rows",reflect:!0})],a.prototype,"maxRows",void 0),t([e({type:Number,attribute:"max-cols",reflect:!0})],a.prototype,"maxCols",void 0),t([o()],a.prototype,"open",void 0),t([o()],a.prototype,"hoverRows",void 0),t([o()],a.prototype,"hoverCols",void 0),t([o()],a.prototype,"customRows",void 0),t([o()],a.prototype,"customCols",void 0),a=t([s("nile-wysiwyg-table-picker")],a);}};});
|
|
1
|
+
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","../../internal/nile-element.cjs.js","../../internal/accessibility/a11y.state.enum.cjs.js","../../internal/accessibility/a11y.property.enum.cjs.js","../../internal/accessibility/role.enum.cjs.js"],function(_export,_context){"use strict";var t,r,e,i,o,s,n,_templateObject,_templateObject2,_templateObject3,_templateObject4,a;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){r=_lit.css;e=_lit.html;},function(_litDecoratorsJs){i=_litDecoratorsJs.property;o=_litDecoratorsJs.state;s=_litDecoratorsJs.customElement;},function(_internalNileElementCjsJs){n=_internalNileElementCjsJs.N;},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){}],execute:function execute(){a=/*#__PURE__*/function(_n){function a(){var _this;_classCallCheck(this,a);_this=_callSuper(this,a,arguments),_this.disabled=!1,_this.maxRows=20,_this.maxCols=20,_this.open=!1,_this.hoverRows=0,_this.hoverCols=0,_this.customRows="",_this.customCols="",_this.handleOutside=function(t){_this.open&&!t.composedPath().includes(_assertThisInitialized(_this))&&(_this.open=!1);};return _this;}_inherits(a,_n);return _createClass(a,[{key:"connectedCallback",value:function connectedCallback(){_superPropGet(a,"connectedCallback",this,3)([]),document.addEventListener("mousedown",this.handleOutside);}},{key:"disconnectedCallback",value:function disconnectedCallback(){_superPropGet(a,"disconnectedCallback",this,3)([]),document.removeEventListener("mousedown",this.handleOutside);}},{key:"pick",value:function pick(t,r){this.open=!1,this.customRows="",this.customCols="",this.emit("wysiwyg-command",{name:"insertTable",attrs:{rows:t,cols:r,withHeaderRow:!0}});}},{key:"clamp",value:function clamp(t,r){var e=parseInt(t,10);return!Number.isFinite(e)||e<1?0:Math.min(e,r);}},{key:"insertCustom",value:function insertCustom(){var t=this.clamp(this.customRows,this.maxRows),r=this.clamp(this.customCols,this.maxCols);t>=1&&r>=1&&this.pick(t,r);}},{key:"render",value:function render(){var _this2=this;var t=Math.min(Math.max(5,this.hoverRows+1),this.maxRows),r=Math.min(Math.max(5,this.hoverCols+1),this.maxCols),i=[];var _loop=function _loop(_o){var _loop2=function _loop2(_t){i.push(e(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <span\n class=\"cell ","\"\n @mouseenter=","\n @click=","\n ></span>\n "])),_o<=_this2.hoverRows&&_t<=_this2.hoverCols?"hot":"",function(){_this2.hoverRows=_o,_this2.hoverCols=_t;},function(){return _this2.pick(_o,_t);}));};for(var _t=1;_t<=r;_t+=1){_loop2(_t);}};for(var _o=1;_o<=t;_o+=1){_loop(_o);}var o=this.clamp(this.customRows,this.maxRows)>=1&&this.clamp(this.customCols,this.maxCols)>=1;return e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <button\n type=\"button\"\n class=\"trigger\"\n part=\"button\"\n aria-label=\"Insert table\"\n aria-expanded=","\n ?disabled=","\n @mousedown=","\n @click=","\n >\n <nile-glyph name=\"grid-01\" size=\"18\" method=\"stroke\"></nile-glyph>\n </button>\n ","\n "])),this.open?"true":"false",this.disabled,function(t){return t.preventDefault();},function(){_this2.open=!_this2.open,_this2.hoverRows=0,_this2.hoverCols=0;},this.open?e(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <div class=\"panel\">\n <div\n class=\"grid\"\n style=\"grid-template-columns: repeat(",", 14px)\"\n @mousedown=","\n @mouseleave=","\n >\n ","\n </div>\n <div class=\"label\" @mousedown=",">\n ","\n </div>\n <div class=\"custom\">\n <input\n type=\"number\"\n min=\"1\"\n max=","\n aria-label=\"Rows\"\n placeholder=\"Rows\"\n .value=","\n @input=","\n @keydown=","\n />\n <span class=\"times\">\xD7</span>\n <input\n type=\"number\"\n min=\"1\"\n max=","\n aria-label=\"Columns\"\n placeholder=\"Cols\"\n .value=","\n @input=","\n @keydown=","\n />\n <button\n type=\"button\"\n class=\"insert\"\n ?disabled=","\n @click=","\n >\n Insert\n </button>\n </div>\n </div>\n "])),r,function(t){return t.preventDefault();},function(){_this2.hoverRows=0,_this2.hoverCols=0;},i,function(t){return t.preventDefault();},this.hoverRows>0?"".concat(this.hoverRows," \xD7 ").concat(this.hoverCols):"Pick a size",this.maxRows,this.customRows,function(t){_this2.customRows=t.target.value;},function(t){"Enter"===t.key&&_this2.insertCustom();},this.maxCols,this.customCols,function(t){_this2.customCols=t.target.value;},function(t){"Enter"===t.key&&_this2.insertCustom();},!o,function(){return _this2.insertCustom();}):"");}}],[{key:"styles",get:function get(){return[r(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\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));\n }\n\n button.trigger:hover:not(:disabled) {\n background: var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary));\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, var(--nile-colors-white-base, var(--ng-colors-bg-primary)));\n border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));\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 gap: 2px;\n }\n\n .cell {\n width: 14px;\n height: 14px;\n border: 1px solid var(--nile-colors-neutral-300, var(--ng-colors-border-primary));\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));\n border-color: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600));\n }\n\n .label {\n margin-top: 6px;\n text-align: center;\n font-size: 12px;\n color: var(--nile-colors-neutral-600, var(--ng-colors-text-tertiary-600));\n }\n\n .custom {\n display: flex;\n align-items: center;\n gap: 6px;\n margin-top: 8px;\n padding-top: 8px;\n border-top: 1px solid var(--nile-colors-neutral-300, var(--ng-colors-border-secondary));\n }\n\n .custom input {\n width: 44px;\n height: 26px;\n padding: 0 6px;\n border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));\n border-radius: 6px;\n font-size: 12px;\n box-sizing: border-box;\n text-align: center;\n color: var(--nile-colors-dark-900, var(--ng-colors-text-primary-900));\n font-family: inherit;\n /* Hide native number spinners: they overlap the centered text in this\n narrow field and a stray click on the arrows mutates the value. */\n -moz-appearance: textfield;\n appearance: textfield;\n }\n\n .custom input::-webkit-outer-spin-button,\n .custom input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n .custom input:focus {\n outline: none;\n border-color: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600));\n }\n\n .custom .times {\n font-size: 12px;\n color: var(--nile-colors-neutral-600, var(--ng-colors-text-tertiary-600));\n }\n\n .custom button.insert {\n margin-left: auto;\n height: 26px;\n padding: 0 12px;\n border: none;\n border-radius: 6px;\n background: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600));\n color: var(--nile-colors-white-base, var(--ng-colors-text-white));\n font-size: 12px;\n font-weight: 600;\n font-family: inherit;\n cursor: pointer;\n }\n\n .custom button.insert:hover:not(:disabled) {\n background: var(--nile-colors-primary-700, var(--ng-componentcolors-utility-blue-700));\n }\n\n .custom button.insert:disabled {\n opacity: 0.4;\n cursor: default;\n }\n "])))];}}]);}(n);t([i({type:Boolean,reflect:!0})],a.prototype,"disabled",void 0),t([i({type:Number,attribute:"max-rows",reflect:!0})],a.prototype,"maxRows",void 0),t([i({type:Number,attribute:"max-cols",reflect:!0})],a.prototype,"maxCols",void 0),t([o()],a.prototype,"open",void 0),t([o()],a.prototype,"hoverRows",void 0),t([o()],a.prototype,"hoverCols",void 0),t([o()],a.prototype,"customRows",void 0),t([o()],a.prototype,"customCols",void 0),a=t([s("nile-wysiwyg-table-picker")],a);}};});
|
|
2
2
|
//# sourceMappingURL=table-grid-picker.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-grid-picker.cjs.js","sources":["../../../../src/nile-wysiwyg-editor/ui/table-grid-picker.ts"],"sourcesContent":["import { html, css, TemplateResult, CSSResultArray } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport NileElement from '../../internal/nile-element';\n\n/** Smallest grid shown before the pointer starts expanding it. */\nconst MIN_ROWS = 5;\nconst MIN_COLS = 5;\n\n/**\n * Toolbar item: a table button that opens a hover grid which auto-expands as\n * the pointer reaches the last row/column (up to `maxRows`×`maxCols`), plus a\n * \"Custom\" rows×cols input for larger tables. Picking a cell or confirming the\n * custom size 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 /** Hard cap on the number of rows selectable via grid or custom input. */\n @property({ type: Number, attribute: 'max-rows', reflect: true }) maxRows = 20;\n\n /** Hard cap on the number of columns selectable via grid or custom input. */\n @property({ type: Number, attribute: 'max-cols', reflect: true }) maxCols = 20;\n\n @state() private open = false;\n\n @state() private hoverRows = 0;\n\n @state() private hoverCols = 0;\n\n @state() private customRows = '';\n\n @state() private customCols = '';\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));\n }\n\n button.trigger:hover:not(:disabled) {\n background: var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary));\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, var(--ng-colors-bg-primary));\n border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));\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 gap: 2px;\n }\n\n .cell {\n width: 14px;\n height: 14px;\n border: 1px solid var(--nile-colors-neutral-300, var(--ng-colors-border-primary));\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));\n border-color: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600));\n }\n\n .label {\n margin-top: 6px;\n text-align: center;\n font-size: 12px;\n color: var(--nile-colors-neutral-600, var(--ng-colors-text-tertiary-600));\n }\n\n .custom {\n display: flex;\n align-items: center;\n gap: 6px;\n margin-top: 8px;\n padding-top: 8px;\n border-top: 1px solid var(--nile-colors-neutral-300, var(--ng-colors-border-secondary));\n }\n\n .custom input {\n width: 44px;\n height: 26px;\n padding: 0 6px;\n border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));\n border-radius: 6px;\n font-size: 12px;\n box-sizing: border-box;\n text-align: center;\n color: var(--nile-colors-dark-900, var(--ng-colors-text-primary-900));\n font-family: inherit;\n /* Hide native number spinners: they overlap the centered text in this\n narrow field and a stray click on the arrows mutates the value. */\n -moz-appearance: textfield;\n appearance: textfield;\n }\n\n .custom input::-webkit-outer-spin-button,\n .custom input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n .custom input:focus {\n outline: none;\n border-color: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600));\n }\n\n .custom .times {\n font-size: 12px;\n color: var(--nile-colors-neutral-600, var(--ng-colors-text-tertiary-600));\n }\n\n .custom button.insert {\n margin-left: auto;\n height: 26px;\n padding: 0 12px;\n border: none;\n border-radius: 6px;\n background: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600));\n color: var(--ng-colors-text-white);\n font-size: 12px;\n font-weight: 600;\n font-family: inherit;\n cursor: pointer;\n }\n\n .custom button.insert:hover:not(:disabled) {\n background: var(--nile-colors-primary-700, var(--ng-componentcolors-utility-blue-700));\n }\n\n .custom button.insert:disabled {\n opacity: 0.4;\n cursor: default;\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.customRows = '';\n this.customCols = '';\n this.emit('wysiwyg-command', {\n name: 'insertTable',\n attrs: { rows, cols, withHeaderRow: true },\n });\n }\n\n /** Clamp raw input to 1..max; returns 0 when empty/invalid. */\n private clamp(raw: string, max: number): number {\n const n = parseInt(raw, 10);\n if (!Number.isFinite(n) || n < 1) return 0;\n return Math.min(n, max);\n }\n\n private insertCustom(): void {\n const rows = this.clamp(this.customRows, this.maxRows);\n const cols = this.clamp(this.customCols, this.maxCols);\n if (rows >= 1 && cols >= 1) this.pick(rows, cols);\n }\n\n public render(): TemplateResult {\n // Grow the grid by one row/col once the pointer reaches the edge, capped.\n const visibleRows = Math.min(Math.max(MIN_ROWS, this.hoverRows + 1), this.maxRows);\n const visibleCols = Math.min(Math.max(MIN_COLS, this.hoverCols + 1), this.maxCols);\n\n const cells: TemplateResult[] = [];\n for (let r = 1; r <= visibleRows; r += 1) {\n for (let c = 1; c <= visibleCols; 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\n const customValid =\n this.clamp(this.customRows, this.maxRows) >= 1 &&\n this.clamp(this.customCols, this.maxCols) >= 1;\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\">\n <div\n class=\"grid\"\n style=\"grid-template-columns: repeat(${visibleCols}, 14px)\"\n @mousedown=${(e: Event) => e.preventDefault()}\n @mouseleave=${() => {\n this.hoverRows = 0;\n this.hoverCols = 0;\n }}\n >\n ${cells}\n </div>\n <div class=\"label\" @mousedown=${(e: Event) => e.preventDefault()}>\n ${this.hoverRows > 0 ? `${this.hoverRows} × ${this.hoverCols}` : 'Pick a size'}\n </div>\n <div class=\"custom\">\n <input\n type=\"number\"\n min=\"1\"\n max=${this.maxRows}\n aria-label=\"Rows\"\n placeholder=\"Rows\"\n .value=${this.customRows}\n @input=${(e: Event) => {\n this.customRows = (e.target as HTMLInputElement).value;\n }}\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === 'Enter') this.insertCustom();\n }}\n />\n <span class=\"times\">×</span>\n <input\n type=\"number\"\n min=\"1\"\n max=${this.maxCols}\n aria-label=\"Columns\"\n placeholder=\"Cols\"\n .value=${this.customCols}\n @input=${(e: Event) => {\n this.customCols = (e.target as HTMLInputElement).value;\n }}\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === 'Enter') this.insertCustom();\n }}\n />\n <button\n type=\"button\"\n class=\"insert\"\n ?disabled=${!customValid}\n @click=${() => this.insertCustom()}\n >\n Insert\n </button>\n </div>\n </div>\n `\n : ''}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-wysiwyg-table-picker': NileWysiwygTablePicker;\n }\n}\n"],"names":["NileWysiwygTablePicker","_n","a","this","disabled","maxRows","maxCols","open","hoverRows","hoverCols","customRows","customCols","handleOutside","event","composedPath","includes","_this","_inherits","_createClass","key","value","connectedCallback","super","document","addEventListener","disconnectedCallback","removeEventListener","pick","rows","cols","emit","name","attrs","withHeaderRow","clamp","raw","max","n","parseInt","Number","isFinite","Math","min","insertCustom","render","visibleRows","visibleCols","cells","_loop","_o","_loop2","_t","push","html","_templateObject3","_taggedTemplateLiteral","r","c","customValid","_templateObject","e","preventDefault","_templateObject2","concat","target","get","css","_templateObject4","NileElement","__decorate","property","type","Boolean","reflect","prototype","attribute","state","customElement"],"mappings":"i8HAeaA,CAAN,uBAAAC,EAAA,EAAA,SAAAC,EAAA,qEACuCC,EAAAA,KAAAA,CAAQC,QAAG,CAAA,CAAA,CAAA,CAGWD,KAAAA,CAAOE,OAAAA,CAAG,EAGVF,CAAAA,KAAAA,CAAOG,QAAG,EAE3DH,CAAAA,KAAAA,CAAII,IAAG,CAAA,CAAA,CAAA,CAEPJ,KAAAA,CAASK,SAAAA,CAAG,CAEZL,CAAAA,KAAAA,CAASM,SAAG,CAAA,CAAA,CAEZN,KAAAA,CAAUO,UAAAA,CAAG,EAEbP,CAAAA,KAAAA,CAAUQ,UAAG,CAAA,EAAA,CA0JtBR,KAAAA,CAAAS,aAAiBC,CAAAA,SAAAA,CAAAA,CAAAA,CACnBV,KAAAA,CAAKI,IAAAA,EAAAA,CAASM,CAAMC,CAAAA,YAAAA,CAAAA,CAAAA,CAAeC,QAASZ,CAAAA,sBAAAA,CAAAA,KAAAA,CAAAA,CAAAA,GAAOA,KAAAA,CAAKI,IAAAA,CAAAA,CAAO,CAAK,CAAA,EAiI3E,QAAAS,KAAA,EA1RQC,SAAA,CAAAf,CAAA,CAAAD,EAAA,SAAAiB,YAAA,CAAAhB,CAA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CAAjEC,CAAS,CAAA,CAAEC,KAAMhC,MAAQoC,CAAAA,SAAAA,CAAW,WAAYF,OAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqBzE,EAAA0E,SAAA,CAAA,SAAA,CAAA,IAAA,EAE9DL,CAAAA,CAAAA,CAAAA,CAAA,CAAhBO,CAA6B5E,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA0E,SAAA,CAAA,MAAA,CAAA,IAAA,IAEbL,CAAA,CAAA,CAAhBO,CAA8B5E,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA0E,UAAA,WAAA,CAAA,IAAA,EAAA,CAAA,CAEdL,EAAA,CAAhBO,CAAAA,CAAAA,CAAAA,CAAAA,CAA8B5E,EAAA0E,SAAA,CAAA,WAAA,CAAA,IAAA,EAEdL,CAAAA,CAAAA,CAAAA,CAAA,CAAhBO,CAAgC5E,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA0E,SAAA,CAAA,YAAA,CAAA,IAAA,IAEhBL,CAAA,CAAA,CAAhBO,CAAgC5E,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA0E,UAAA,YAAA,CAAA,IAAA,EAAA,CAAA,CAjBtB1E,EAAsBqE,CAAA,CAAA,CADlCQ,EAAc,2BACF7E,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA"}
|
|
1
|
+
{"version":3,"file":"table-grid-picker.cjs.js","sources":["../../../../src/nile-wysiwyg-editor/ui/table-grid-picker.ts"],"sourcesContent":["import { html, css, TemplateResult, CSSResultArray } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport NileElement from '../../internal/nile-element';\n\n/** Smallest grid shown before the pointer starts expanding it. */\nconst MIN_ROWS = 5;\nconst MIN_COLS = 5;\n\n/**\n * Toolbar item: a table button that opens a hover grid which auto-expands as\n * the pointer reaches the last row/column (up to `maxRows`×`maxCols`), plus a\n * \"Custom\" rows×cols input for larger tables. Picking a cell or confirming the\n * custom size 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 /** Hard cap on the number of rows selectable via grid or custom input. */\n @property({ type: Number, attribute: 'max-rows', reflect: true }) maxRows = 20;\n\n /** Hard cap on the number of columns selectable via grid or custom input. */\n @property({ type: Number, attribute: 'max-cols', reflect: true }) maxCols = 20;\n\n @state() private open = false;\n\n @state() private hoverRows = 0;\n\n @state() private hoverCols = 0;\n\n @state() private customRows = '';\n\n @state() private customCols = '';\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));\n }\n\n button.trigger:hover:not(:disabled) {\n background: var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary));\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, var(--nile-colors-white-base, var(--ng-colors-bg-primary)));\n border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));\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 gap: 2px;\n }\n\n .cell {\n width: 14px;\n height: 14px;\n border: 1px solid var(--nile-colors-neutral-300, var(--ng-colors-border-primary));\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));\n border-color: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600));\n }\n\n .label {\n margin-top: 6px;\n text-align: center;\n font-size: 12px;\n color: var(--nile-colors-neutral-600, var(--ng-colors-text-tertiary-600));\n }\n\n .custom {\n display: flex;\n align-items: center;\n gap: 6px;\n margin-top: 8px;\n padding-top: 8px;\n border-top: 1px solid var(--nile-colors-neutral-300, var(--ng-colors-border-secondary));\n }\n\n .custom input {\n width: 44px;\n height: 26px;\n padding: 0 6px;\n border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));\n border-radius: 6px;\n font-size: 12px;\n box-sizing: border-box;\n text-align: center;\n color: var(--nile-colors-dark-900, var(--ng-colors-text-primary-900));\n font-family: inherit;\n /* Hide native number spinners: they overlap the centered text in this\n narrow field and a stray click on the arrows mutates the value. */\n -moz-appearance: textfield;\n appearance: textfield;\n }\n\n .custom input::-webkit-outer-spin-button,\n .custom input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n .custom input:focus {\n outline: none;\n border-color: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600));\n }\n\n .custom .times {\n font-size: 12px;\n color: var(--nile-colors-neutral-600, var(--ng-colors-text-tertiary-600));\n }\n\n .custom button.insert {\n margin-left: auto;\n height: 26px;\n padding: 0 12px;\n border: none;\n border-radius: 6px;\n background: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600));\n color: var(--nile-colors-white-base, var(--ng-colors-text-white));\n font-size: 12px;\n font-weight: 600;\n font-family: inherit;\n cursor: pointer;\n }\n\n .custom button.insert:hover:not(:disabled) {\n background: var(--nile-colors-primary-700, var(--ng-componentcolors-utility-blue-700));\n }\n\n .custom button.insert:disabled {\n opacity: 0.4;\n cursor: default;\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.customRows = '';\n this.customCols = '';\n this.emit('wysiwyg-command', {\n name: 'insertTable',\n attrs: { rows, cols, withHeaderRow: true },\n });\n }\n\n /** Clamp raw input to 1..max; returns 0 when empty/invalid. */\n private clamp(raw: string, max: number): number {\n const n = parseInt(raw, 10);\n if (!Number.isFinite(n) || n < 1) return 0;\n return Math.min(n, max);\n }\n\n private insertCustom(): void {\n const rows = this.clamp(this.customRows, this.maxRows);\n const cols = this.clamp(this.customCols, this.maxCols);\n if (rows >= 1 && cols >= 1) this.pick(rows, cols);\n }\n\n public render(): TemplateResult {\n // Grow the grid by one row/col once the pointer reaches the edge, capped.\n const visibleRows = Math.min(Math.max(MIN_ROWS, this.hoverRows + 1), this.maxRows);\n const visibleCols = Math.min(Math.max(MIN_COLS, this.hoverCols + 1), this.maxCols);\n\n const cells: TemplateResult[] = [];\n for (let r = 1; r <= visibleRows; r += 1) {\n for (let c = 1; c <= visibleCols; 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\n const customValid =\n this.clamp(this.customRows, this.maxRows) >= 1 &&\n this.clamp(this.customCols, this.maxCols) >= 1;\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\">\n <div\n class=\"grid\"\n style=\"grid-template-columns: repeat(${visibleCols}, 14px)\"\n @mousedown=${(e: Event) => e.preventDefault()}\n @mouseleave=${() => {\n this.hoverRows = 0;\n this.hoverCols = 0;\n }}\n >\n ${cells}\n </div>\n <div class=\"label\" @mousedown=${(e: Event) => e.preventDefault()}>\n ${this.hoverRows > 0 ? `${this.hoverRows} × ${this.hoverCols}` : 'Pick a size'}\n </div>\n <div class=\"custom\">\n <input\n type=\"number\"\n min=\"1\"\n max=${this.maxRows}\n aria-label=\"Rows\"\n placeholder=\"Rows\"\n .value=${this.customRows}\n @input=${(e: Event) => {\n this.customRows = (e.target as HTMLInputElement).value;\n }}\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === 'Enter') this.insertCustom();\n }}\n />\n <span class=\"times\">×</span>\n <input\n type=\"number\"\n min=\"1\"\n max=${this.maxCols}\n aria-label=\"Columns\"\n placeholder=\"Cols\"\n .value=${this.customCols}\n @input=${(e: Event) => {\n this.customCols = (e.target as HTMLInputElement).value;\n }}\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === 'Enter') this.insertCustom();\n }}\n />\n <button\n type=\"button\"\n class=\"insert\"\n ?disabled=${!customValid}\n @click=${() => this.insertCustom()}\n >\n Insert\n </button>\n </div>\n </div>\n `\n : ''}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-wysiwyg-table-picker': NileWysiwygTablePicker;\n }\n}\n"],"names":["NileWysiwygTablePicker","_n","a","this","disabled","maxRows","maxCols","open","hoverRows","hoverCols","customRows","customCols","handleOutside","event","composedPath","includes","_this","_inherits","_createClass","key","value","connectedCallback","super","document","addEventListener","disconnectedCallback","removeEventListener","pick","rows","cols","emit","name","attrs","withHeaderRow","clamp","raw","max","n","parseInt","Number","isFinite","Math","min","insertCustom","render","visibleRows","visibleCols","cells","_loop","_o","_loop2","_t","push","html","_templateObject3","_taggedTemplateLiteral","r","c","customValid","_templateObject","e","preventDefault","_templateObject2","concat","target","get","css","_templateObject4","NileElement","__decorate","property","type","Boolean","reflect","prototype","attribute","state","customElement"],"mappings":"i8HAeaA,CAAN,uBAAAC,EAAA,EAAA,SAAAC,EAAA,qEACuCC,EAAAA,KAAAA,CAAQC,QAAG,CAAA,CAAA,CAAA,CAGWD,KAAAA,CAAOE,OAAAA,CAAG,EAGVF,CAAAA,KAAAA,CAAOG,QAAG,EAE3DH,CAAAA,KAAAA,CAAII,IAAG,CAAA,CAAA,CAAA,CAEPJ,KAAAA,CAASK,SAAAA,CAAG,CAEZL,CAAAA,KAAAA,CAASM,SAAG,CAAA,CAAA,CAEZN,KAAAA,CAAUO,UAAAA,CAAG,EAEbP,CAAAA,KAAAA,CAAUQ,UAAG,CAAA,EAAA,CA0JtBR,KAAAA,CAAAS,aAAiBC,CAAAA,SAAAA,CAAAA,CAAAA,CACnBV,KAAAA,CAAKI,IAAAA,EAAAA,CAASM,CAAMC,CAAAA,YAAAA,CAAAA,CAAAA,CAAeC,QAASZ,CAAAA,sBAAAA,CAAAA,KAAAA,CAAAA,CAAAA,GAAOA,KAAAA,CAAKI,IAAAA,CAAAA,CAAO,CAAK,CAAA,EAiI3E,QAAAS,KAAA,EA1RQC,SAAA,CAAAf,CAAA,CAAAD,EAAA,SAAAiB,YAAA,CAAAhB,CAAA,GAAAiB,GAAA,qBAAAC,KAAA,CA8IP,SAAAC,iBAAAA,CAAAA,CAAAA,CACEC,aAAAA,CAAAA,CAAAA,iCACAC,QAASC,CAAAA,gBAAAA,CAAiB,WAAarB,CAAAA,IAAAA,CAAKS,aAC7C,CAAA,EAED,GAAAO,GAAA,wBAAAC,KAAA,UAAAK,oBAAAA,CAAAA,CAAAA,CACEH,aAAAA,CAAAA,CAAAA,oCACAC,QAAAA,CAASG,mBAAoB,CAAA,WAAA,CAAavB,IAAKS,CAAAA,aAAAA,CAChD,EAMO,GAAAO,GAAA,QAAAC,KAAA,UAAAO,IAAAA,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AA,IAAA,EAAA,CAAA,CAEdL,EAAA,CAAhBO,CAAAA,CAAAA,CAAAA,CAAAA,CAA8B5E,EAAA0E,SAAA,CAAA,WAAA,CAAA,IAAA,EAEdL,CAAAA,CAAAA,CAAAA,CAAA,CAAhBO,CAAgC5E,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA0E,SAAA,CAAA,YAAA,CAAA,IAAA,IAEhBL,CAAA,CAAA,CAAhBO,CAAgC5E,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA0E,UAAA,YAAA,CAAA,IAAA,EAAA,CAAA,CAjBtB1E,EAAsBqE,CAAA,CAAA,CADlCQ,EAAc,2BACF7E,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{__decorate as t}from"tslib";import{css as
|
|
1
|
+
import{__decorate as t}from"tslib";import{css as e,html as r}from"lit";import{property as i,state as o,customElement as s}from"lit/decorators.js";import{N as n}from"../../internal/nile-element.esm.js";import"../../internal/accessibility/a11y.state.enum.esm.js";import"../../internal/accessibility/a11y.property.enum.esm.js";import"../../internal/accessibility/role.enum.esm.js";let a=class extends n{constructor(){super(...arguments),this.disabled=!1,this.maxRows=20,this.maxCols=20,this.open=!1,this.hoverRows=0,this.hoverCols=0,this.customRows="",this.customCols="",this.handleOutside=t=>{this.open&&!t.composedPath().includes(this)&&(this.open=!1)}}static get styles(){return[e`
|
|
2
2
|
:host {
|
|
3
3
|
font-family: var(
|
|
4
4
|
--nile-font-family-sans-serif,
|
|
@@ -38,7 +38,7 @@ import{__decorate as t}from"tslib";import{css as r,html as e}from"lit";import{pr
|
|
|
38
38
|
left: 0;
|
|
39
39
|
z-index: 30;
|
|
40
40
|
padding: 8px;
|
|
41
|
-
background: var(--nile-wysiwyg-popover-bg, var(--ng-colors-bg-primary));
|
|
41
|
+
background: var(--nile-wysiwyg-popover-bg, var(--nile-colors-white-base, var(--ng-colors-bg-primary)));
|
|
42
42
|
border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));
|
|
43
43
|
border-radius: 8px;
|
|
44
44
|
box-shadow: var(--nile-wysiwyg-popover-shadow, 0 4px 12px rgba(16, 24, 40, 0.12));
|
|
@@ -119,7 +119,7 @@ import{__decorate as t}from"tslib";import{css as r,html as e}from"lit";import{pr
|
|
|
119
119
|
border: none;
|
|
120
120
|
border-radius: 6px;
|
|
121
121
|
background: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600));
|
|
122
|
-
color: var(--ng-colors-text-white);
|
|
122
|
+
color: var(--nile-colors-white-base, var(--ng-colors-text-white));
|
|
123
123
|
font-size: 12px;
|
|
124
124
|
font-weight: 600;
|
|
125
125
|
font-family: inherit;
|
|
@@ -134,13 +134,13 @@ import{__decorate as t}from"tslib";import{css as r,html as e}from"lit";import{pr
|
|
|
134
134
|
opacity: 0.4;
|
|
135
135
|
cursor: default;
|
|
136
136
|
}
|
|
137
|
-
`]}connectedCallback(){super.connectedCallback(),document.addEventListener("mousedown",this.handleOutside)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("mousedown",this.handleOutside)}pick(t,
|
|
137
|
+
`]}connectedCallback(){super.connectedCallback(),document.addEventListener("mousedown",this.handleOutside)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("mousedown",this.handleOutside)}pick(t,e){this.open=!1,this.customRows="",this.customCols="",this.emit("wysiwyg-command",{name:"insertTable",attrs:{rows:t,cols:e,withHeaderRow:!0}})}clamp(t,e){const r=parseInt(t,10);return!Number.isFinite(r)||r<1?0:Math.min(r,e)}insertCustom(){const t=this.clamp(this.customRows,this.maxRows),e=this.clamp(this.customCols,this.maxCols);t>=1&&e>=1&&this.pick(t,e)}render(){const t=Math.min(Math.max(5,this.hoverRows+1),this.maxRows),e=Math.min(Math.max(5,this.hoverCols+1),this.maxCols),i=[];for(let o=1;o<=t;o+=1)for(let t=1;t<=e;t+=1)i.push(r`
|
|
138
138
|
<span
|
|
139
139
|
class="cell ${o<=this.hoverRows&&t<=this.hoverCols?"hot":""}"
|
|
140
140
|
@mouseenter=${()=>{this.hoverRows=o,this.hoverCols=t}}
|
|
141
141
|
@click=${()=>this.pick(o,t)}
|
|
142
142
|
></span>
|
|
143
|
-
`);const o=this.clamp(this.customRows,this.maxRows)>=1&&this.clamp(this.customCols,this.maxCols)>=1;return
|
|
143
|
+
`);const o=this.clamp(this.customRows,this.maxRows)>=1&&this.clamp(this.customCols,this.maxCols)>=1;return r`
|
|
144
144
|
<button
|
|
145
145
|
type="button"
|
|
146
146
|
class="trigger"
|
|
@@ -153,11 +153,11 @@ import{__decorate as t}from"tslib";import{css as r,html as e}from"lit";import{pr
|
|
|
153
153
|
>
|
|
154
154
|
<nile-glyph name="grid-01" size="18" method="stroke"></nile-glyph>
|
|
155
155
|
</button>
|
|
156
|
-
${this.open?
|
|
156
|
+
${this.open?r`
|
|
157
157
|
<div class="panel">
|
|
158
158
|
<div
|
|
159
159
|
class="grid"
|
|
160
|
-
style="grid-template-columns: repeat(${
|
|
160
|
+
style="grid-template-columns: repeat(${e}, 14px)"
|
|
161
161
|
@mousedown=${t=>t.preventDefault()}
|
|
162
162
|
@mouseleave=${()=>{this.hoverRows=0,this.hoverCols=0}}
|
|
163
163
|
>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","../../internal/nile-element.cjs.js","../../internal/glyph.cjs.js","../../nile-lite-tooltip/nile-lite-tooltip.cjs.js","../../internal/accessibility/a11y.state.enum.cjs.js","../../internal/accessibility/a11y.property.enum.cjs.js","../../internal/accessibility/role.enum.cjs.js","lit/directives/if-defined.js","../../nile-lite-tooltip/nile-lite-tooltip.css.cjs.js","../../tippy.esm-78baa8f2.cjs.js","../../nile-lite-tooltip/utils.cjs.js","../../utilities/visibility-manager.cjs.js"],function(_export,_context){"use strict";var e,l,t,o,n,i,r,_templateObject,_templateObject2,_templateObject3,a,s;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){e=_tslib.__decorate;},function(_lit){l=_lit.css;t=_lit.html;},function(_litDecoratorsJs){o=_litDecoratorsJs.property;n=_litDecoratorsJs.customElement;},function(_internalNileElementCjsJs){i=_internalNileElementCjsJs.N;},function(_internalGlyphCjsJs){r=_internalGlyphCjsJs.r;},function(_nileLiteTooltipNileLiteTooltipCjsJs){},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){},function(_litDirectivesIfDefinedJs){},function(_nileLiteTooltipNileLiteTooltipCssCjsJs){},function(
|
|
1
|
+
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","../../internal/nile-element.cjs.js","../../internal/glyph.cjs.js","../../nile-lite-tooltip/nile-lite-tooltip.cjs.js","../../internal/accessibility/a11y.state.enum.cjs.js","../../internal/accessibility/a11y.property.enum.cjs.js","../../internal/accessibility/role.enum.cjs.js","lit/directives/if-defined.js","../../nile-lite-tooltip/nile-lite-tooltip.css.cjs.js","../../tippy.esm-78baa8f2.cjs.js","../../nile-lite-tooltip/utils.cjs.js","../../utilities/visibility-manager.cjs.js"],function(_export,_context){"use strict";var e,l,t,o,n,i,r,_templateObject,_templateObject2,_templateObject3,a,s;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){e=_tslib.__decorate;},function(_lit){l=_lit.css;t=_lit.html;},function(_litDecoratorsJs){o=_litDecoratorsJs.property;n=_litDecoratorsJs.customElement;},function(_internalNileElementCjsJs){i=_internalNileElementCjsJs.N;},function(_internalGlyphCjsJs){r=_internalGlyphCjsJs.r;},function(_nileLiteTooltipNileLiteTooltipCjsJs){},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){},function(_litDirectivesIfDefinedJs){},function(_nileLiteTooltipNileLiteTooltipCssCjsJs){},function(_tippyEsm008CjsJs){},function(_nileLiteTooltipUtilsCjsJs){},function(_utilitiesVisibilityManagerCjsJs){}],execute:function execute(){a=[{name:"addRowBefore",label:"Add row above",icon:"ng-between-vertical-start"},{name:"addRowAfter",label:"Add row below",icon:"ng-between-vertical-end"},{name:"addColumnBefore",label:"Add column left",icon:"ng-between-horizontal-start"},{name:"addColumnAfter",label:"Add column right",icon:"ng-between-horizontal-end"},{name:"deleteRow",label:"Delete row",icon:"ng-rows-2"},{name:"deleteColumn",label:"Delete column",icon:"ng-columns-2"},{name:"mergeCells",label:"Merge cells",icon:"ng-table-cells-merge"},{name:"splitCell",label:"Split cell",icon:"ng-table-cells-split"},{name:"toggleHeaderRow",label:"Toggle header row",icon:"ng-panel-top"},{name:"toggleLayoutTable",label:"Toggle layout table (borderless)",icon:"ng-grid-2x2"},{name:"deleteTable",label:"Delete table",icon:"ng-trash-2"}];s=/*#__PURE__*/function(_i){function s(){var _this;_classCallCheck(this,s);_this=_callSuper(this,s,arguments),_this.open=!1;return _this;}_inherits(s,_i);return _createClass(s,[{key:"render",value:function render(){var _this2=this;return t(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div class=\"menu\" part=\"table-menu\" @mousedown=",">\n ","\n </div>\n "])),function(e){return e.preventDefault();},a.map(function(e){return t(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <nile-lite-tooltip content="," placement=\"top\">\n <button\n type=\"button\"\n aria-label=","\n @click=","\n >\n ","\n </button>\n </nile-lite-tooltip>\n "])),e.label,e.label,function(){return _this2.emit("wysiwyg-command",{name:e.name});},r(e.icon,16));}));}}],[{key:"styles",get:function get(){return[l(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\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, var(--nile-colors-white-base, var(--ng-colors-bg-primary)));\n border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));\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, var(--ng-colors-text-secondary-700));\n }\n\n button:hover {\n background: var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary));\n }\n "])))];}}]);}(i);e([o({type:Boolean,reflect:!0})],s.prototype,"open",void 0),s=e([n("nile-wysiwyg-table-menu")],s);}};});
|
|
2
2
|
//# sourceMappingURL=table-menu.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-menu.cjs.js","sources":["../../../../src/nile-wysiwyg-editor/ui/table-menu.ts"],"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 { CommandName } from '../engine/commands';\nimport '../../nile-lite-tooltip/nile-lite-tooltip';\n\ninterface TableOp {\n name: CommandName;\n label: string;\n icon: string;\n}\n\nconst OPS: TableOp[] = [\n { name: 'addRowBefore', label: 'Add row above', icon: 'ng-between-vertical-start' },\n { name: 'addRowAfter', label: 'Add row below', icon: 'ng-between-vertical-end' },\n { name: 'addColumnBefore', label: 'Add column left', icon: 'ng-between-horizontal-start' },\n { name: 'addColumnAfter', label: 'Add column right', icon: 'ng-between-horizontal-end' },\n { name: 'deleteRow', label: 'Delete row', icon: 'ng-rows-2' },\n { name: 'deleteColumn', label: 'Delete column', icon: 'ng-columns-2' },\n { name: 'mergeCells', label: 'Merge cells', icon: 'ng-table-cells-merge' },\n { name: 'splitCell', label: 'Split cell', icon: 'ng-table-cells-split' },\n { name: 'toggleHeaderRow', label: 'Toggle header row', icon: 'ng-panel-top' },\n { name: 'toggleLayoutTable', label: 'Toggle layout table (borderless)', icon: 'ng-grid-2x2' },\n { name: 'deleteTable', label: 'Delete table', icon: 'ng-trash-2' },\n];\n\n/**\n * Compact floating bar shown while the cursor is inside a table. The host\n * positions it; operations bubble up as `wysiwyg-command` events.\n */\n@customElement('nile-wysiwyg-table-menu')\nexport class NileWysiwygTableMenu extends NileElement {\n @property({ type: Boolean, reflect: true }) open = false;\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, var(--ng-colors-bg-primary));\n border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));\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, var(--ng-colors-text-secondary-700));\n }\n\n button:hover {\n background: var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary));\n }\n `,\n ];\n }\n\n public render(): TemplateResult {\n return html`\n <div class=\"menu\" part=\"table-menu\" @mousedown=${(e: Event) => e.preventDefault()}>\n ${OPS.map(\n op => html`\n <nile-lite-tooltip content=${op.label} placement=\"top\">\n <button\n type=\"button\"\n aria-label=${op.label}\n @click=${() => this.emit('wysiwyg-command', { name: op.name })}\n >\n ${renderGlyph(op.icon, 16)}\n </button>\n </nile-lite-tooltip>\n `\n )}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-wysiwyg-table-menu': NileWysiwygTableMenu;\n }\n}\n"],"names":["OPS","name","label","icon","NileWysiwygTableMenu","_i","s","constructor","this","open","_this","_inherits","_createClass","key","value","render","_this2","html","_templateObject","_taggedTemplateLiteral","e","preventDefault","map","op","_templateObject2","emit","renderGlyph","get","styles","css","_templateObject3","NileElement","__decorate","property","type","Boolean","reflect","prototype","customElement"],"mappings":"69HAaMA,CAAAA,CAAiB,CACrB,CAAEC,IAAM,CAAA,cAAA,CAAgBC,KAAO,CAAA,eAAA,CAAiBC,KAAM,2BACtD,CAAA,CAAA,CAAEF,IAAM,CAAA,aAAA,CAAeC,KAAO,CAAA,eAAA,CAAiBC,IAAM,CAAA,yBAAA,CAAA,CACrD,CAAEF,IAAAA,CAAM,iBAAmBC,CAAAA,KAAAA,CAAO,iBAAmBC,CAAAA,IAAAA,CAAM,+BAC3D,CAAEF,IAAAA,CAAM,gBAAkBC,CAAAA,KAAAA,CAAO,kBAAoBC,CAAAA,IAAAA,CAAM,2BAC3D,CAAA,CAAA,CAAEF,IAAM,CAAA,WAAA,CAAaC,KAAO,CAAA,YAAA,C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,CAAAA,IAAAA,CAAK,iBAAmB,CAAA,CAAExB,KAAMsB,CAAGtB,CAAAA,IAAAA,CAAAA,CAAAA,GAErDyB,CAAAA,CAAYH,EAAGpB,IAAM,CAAA,EAAA,CAAA,MAOpC,CAAA,KAAAU,GAAA,UAAAc,GAAA,CApEM,SAAAA,IAAA,CAAWC,CAChB,MAAO,CACLC,CAAG,CAAAC,gBAAA,GAAAA,gBAAA,CAAAX,sBAAA,
|
|
1
|
+
{"version":3,"file":"table-menu.cjs.js","sources":["../../../../src/nile-wysiwyg-editor/ui/table-menu.ts"],"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 { CommandName } from '../engine/commands';\nimport '../../nile-lite-tooltip/nile-lite-tooltip';\n\ninterface TableOp {\n name: CommandName;\n label: string;\n icon: string;\n}\n\nconst OPS: TableOp[] = [\n { name: 'addRowBefore', label: 'Add row above', icon: 'ng-between-vertical-start' },\n { name: 'addRowAfter', label: 'Add row below', icon: 'ng-between-vertical-end' },\n { name: 'addColumnBefore', label: 'Add column left', icon: 'ng-between-horizontal-start' },\n { name: 'addColumnAfter', label: 'Add column right', icon: 'ng-between-horizontal-end' },\n { name: 'deleteRow', label: 'Delete row', icon: 'ng-rows-2' },\n { name: 'deleteColumn', label: 'Delete column', icon: 'ng-columns-2' },\n { name: 'mergeCells', label: 'Merge cells', icon: 'ng-table-cells-merge' },\n { name: 'splitCell', label: 'Split cell', icon: 'ng-table-cells-split' },\n { name: 'toggleHeaderRow', label: 'Toggle header row', icon: 'ng-panel-top' },\n { name: 'toggleLayoutTable', label: 'Toggle layout table (borderless)', icon: 'ng-grid-2x2' },\n { name: 'deleteTable', label: 'Delete table', icon: 'ng-trash-2' },\n];\n\n/**\n * Compact floating bar shown while the cursor is inside a table. The host\n * positions it; operations bubble up as `wysiwyg-command` events.\n */\n@customElement('nile-wysiwyg-table-menu')\nexport class NileWysiwygTableMenu extends NileElement {\n @property({ type: Boolean, reflect: true }) open = false;\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, var(--nile-colors-white-base, var(--ng-colors-bg-primary)));\n border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));\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, var(--ng-colors-text-secondary-700));\n }\n\n button:hover {\n background: var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary));\n }\n `,\n ];\n }\n\n public render(): TemplateResult {\n return html`\n <div class=\"menu\" part=\"table-menu\" @mousedown=${(e: Event) => e.preventDefault()}>\n ${OPS.map(\n op => html`\n <nile-lite-tooltip content=${op.label} placement=\"top\">\n <button\n type=\"button\"\n aria-label=${op.label}\n @click=${() => this.emit('wysiwyg-command', { name: op.name })}\n >\n ${renderGlyph(op.icon, 16)}\n </button>\n </nile-lite-tooltip>\n `\n )}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-wysiwyg-table-menu': NileWysiwygTableMenu;\n }\n}\n"],"names":["OPS","name","label","icon","NileWysiwygTableMenu","_i","s","constructor","this","open","_this","_inherits","_createClass","key","value","render","_this2","html","_templateObject","_taggedTemplateLiteral","e","preventDefault","map","op","_templateObject2","emit","renderGlyph","get","styles","css","_templateObject3","NileEl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C,KAAA,EArEQC,SAAA,CAAAL,CAAA,CAAAD,EAAA,SAAAO,YAAA,CAAAN,CAAA,GAAAO,GAAA,UAAAC,KAAA,CAkDA,SAAAC,MAAAA,CAAAA,CACL,KAAAC,MAAA,MAAA,MAAOC,CAAAA,CAAI,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA,wGACyCC,SAAAA,CAAAA,QAAaA,CAAAA,CAAEC,CAAAA,cAAAA,CAAAA,CAAAA,GAC7DrB,CAAIsB,CAAAA,GAAAA,CACJC,SAAAA,SAAMN,CAAAA,CAAI,CAAAO,gBAAA,GAAAA,gBAAA,CAAAL,sBAAA,wSACqBI,CAAGrB,CAAAA,KAAAA,CAGfqB,CAAGrB,CAAAA,KAAAA,CACP,iBAAMM,CAAAA,MAAKiB,CAAAA,IAAAA,CAAK,iBAAmB,CAAA,CAAExB,KAAMsB,CAAGtB,CAAAA,IAAAA,CAAAA,CAAAA,GAErDyB,CAAAA,CAAYH,EAAGpB,IAAM,CAAA,EAAA,CAAA,MAOpC,CAAA,KAAAU,GAAA,UAAAc,GAAA,CApEM,SAAAA,IAAA,CAAWC,CAChB,MAAO,CACLC,CAAG,CAAAC,gBAAA,GAAAA,gBAAA,CAAAX,sBAAA,+2CA8CN,EAEM,MArDiCY,GACIC,EAAA,CAA3CC,CAAAA,CAAS,CAAEC,IAAAA,CAAMC,QAASC,OAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqBhC,CAAAiC,CAAAA,SAAAA,CAAA,WAAA,EAD9CjC,CAAAA,CAAAA,CAAAA,CAAoB4B,CAAA,CAAA,CADhCM,EAAc,yBACFlC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA"}
|
|
@@ -17,7 +17,7 @@ import{__decorate as e}from"tslib";import{css as l,html as t}from"lit";import{pr
|
|
|
17
17
|
display: flex;
|
|
18
18
|
gap: 2px;
|
|
19
19
|
padding: 4px;
|
|
20
|
-
background: var(--nile-wysiwyg-popover-bg, var(--ng-colors-bg-primary));
|
|
20
|
+
background: var(--nile-wysiwyg-popover-bg, var(--nile-colors-white-base, var(--ng-colors-bg-primary)));
|
|
21
21
|
border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));
|
|
22
22
|
border-radius: 8px;
|
|
23
23
|
box-shadow: var(--nile-wysiwyg-popover-shadow, 0 4px 12px rgba(16, 24, 40, 0.12));
|
|
@@ -17,7 +17,7 @@ export const styles = css `
|
|
|
17
17
|
.tippy-box {
|
|
18
18
|
position: relative;
|
|
19
19
|
background-color: var(--nile-colors-dark-900, var(--ng-colors-bg-primary-solid));
|
|
20
|
-
color: var(--nile-colors-dark-200, var(--ng-colors-text-
|
|
20
|
+
color: var(--nile-colors-dark-200, var(--ng-colors-text-white));
|
|
21
21
|
font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-semibold));
|
|
22
22
|
border-radius: var(--nile-radius-sm, var(--ng-radius-md));
|
|
23
23
|
font-size: var(--nile-type-scale-3, var(--ng-font-size-text-xs));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-lite-tooltip.css.js","sourceRoot":"","sources":["../../../src/nile-lite-tooltip/nile-lite-tooltip.css.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AAEF,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsGxB,CAAC;AAGF,MAAM,UAAU,uBAAuB;IACrC,MAAM,QAAQ,GAAG,0BAA0B,CAAC;IAC5C,IAAI,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC;QAAE,OAAO;IAE9C,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC9C,KAAK,CAAC,EAAE,GAAG,QAAQ,CAAC;IACpB,KAAK,CAAC,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC;IACnC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC;AAED,uBAAuB,EAAE,CAAC;AAE1B,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n* Copyright Aquera Inc 2025\n*\n* This source code is licensed under the BSD-3-Clause license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\nimport {css} from 'lit';\n\n/**\n * LightTooltip CSS\n */\nexport const styles = css`\n :host { }\n\n .tippy-box[data-animation=fade][data-state=hidden] { opacity: 0; }\n [data-tippy-root] { max-width: calc(100vw - 10px); }\n\n .tippy-box {\n position: relative;\n background-color: var(--nile-colors-dark-900, var(--ng-colors-bg-primary-solid));\n color: var(--nile-colors-dark-200, var(--ng-colors-text-
|
|
1
|
+
{"version":3,"file":"nile-lite-tooltip.css.js","sourceRoot":"","sources":["../../../src/nile-lite-tooltip/nile-lite-tooltip.css.ts"],"names":[],"mappings":"AAAA;;;;;EAKE;AAEF,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsGxB,CAAC;AAGF,MAAM,UAAU,uBAAuB;IACrC,MAAM,QAAQ,GAAG,0BAA0B,CAAC;IAC5C,IAAI,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC;QAAE,OAAO;IAE9C,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC9C,KAAK,CAAC,EAAE,GAAG,QAAQ,CAAC;IACpB,KAAK,CAAC,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC;IACnC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC;AAED,uBAAuB,EAAE,CAAC;AAE1B,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n* Copyright Aquera Inc 2025\n*\n* This source code is licensed under the BSD-3-Clause license found in the\n* LICENSE file in the root directory of this source tree.\n*/\n\nimport {css} from 'lit';\n\n/**\n * LightTooltip CSS\n */\nexport const styles = css`\n :host { }\n\n .tippy-box[data-animation=fade][data-state=hidden] { opacity: 0; }\n [data-tippy-root] { max-width: calc(100vw - 10px); }\n\n .tippy-box {\n position: relative;\n background-color: var(--nile-colors-dark-900, var(--ng-colors-bg-primary-solid));\n color: var(--nile-colors-dark-200, var(--ng-colors-text-white));\n font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-semibold));\n border-radius: var(--nile-radius-sm, var(--ng-radius-md));\n font-size: var(--nile-type-scale-3, var(--ng-font-size-text-xs));\n line-height: 1.4;\n white-space: normal;\n outline: 0;\n transition-property: transform, visibility, opacity;\n padding: var(--nile-spacing-xs, var(--ng-spacing-md)) var(--nile-spacing-sm, var(--ng-spacing-lg));\n box-shadow: 0px 12px 16px -4px #0A0D1214, 0px 4px 6px -2px #0A0D1208, 0px 2px 2px -1px #0A0D120A;\n }\n\n \n .tippy-box[data-placement^=top] > .tippy-arrow { bottom: 0; }\n .tippy-box[data-placement^=top] > .tippy-arrow:before {\n bottom: -7px;\n border-width: 8px 8px 0;\n border-top-color: initial;\n }\n\n .tippy-box[data-placement^=bottom] > .tippy-arrow { top: 0; }\n .tippy-box[data-placement^=bottom] > .tippy-arrow:before {\n top: -7px;\n border-width: 0 8px 8px;\n border-bottom-color: initial;\n }\n\n .tippy-box[data-placement^=left] > .tippy-arrow { right: 0; }\n .tippy-box[data-placement^=left] > .tippy-arrow:before {\n right: -7px;\n border-width: 8px 0 8px 8px;\n border-left-color: initial;\n }\n\n .tippy-box[data-placement^=right] > .tippy-arrow { left: 0; }\n .tippy-box[data-placement^=right] > .tippy-arrow:before {\n left: -7px;\n border-width: 8px 8px 8px 0;\n border-right-color: initial;\n }\n\n .tippy-box[data-inertia][data-state=visible] {\n transition-timing-function: cubic-bezier(.54, 1.5, .38, 1.11);\n }\n\n .tippy-box.large { font-size: 16px; padding: 8px 12px; }\n .tippy-arrow { width: 16px; height: 16px; color: #333; }\n .tippy-arrow:before {\n content: \"\";\n position: absolute;\n border-color: transparent;\n border-style: solid;\n }\n\n .tippy-content {\n position: relative;\n z-index: 1;\n }\n\n .tippy-box[data-placement^=top] > .tippy-svg-arrow { bottom: 0; }\n .tippy-box[data-placement^=top] > .tippy-svg-arrow:after,\n .tippy-box[data-placement^=top] > .tippy-svg-arrow > svg {\n top: 16px;\n transform: rotate(180deg);\n }\n .tippy-box[data-placement^=bottom] > .tippy-svg-arrow { top: 0; }\n .tippy-box[data-placement^=bottom] > .tippy-svg-arrow > svg { bottom: 16px; }\n .tippy-box[data-placement^=left] > .tippy-svg-arrow { right: 0; }\n .tippy-box[data-placement^=left] > .tippy-svg-arrow:after,\n .tippy-box[data-placement^=left] > .tippy-svg-arrow > svg {\n transform: rotate(90deg);\n top: calc(50% - 3px);\n left: 11px;\n }\n .tippy-box[data-placement^=right] > .tippy-svg-arrow { left: 0; }\n .tippy-box[data-placement^=right] > .tippy-svg-arrow:after,\n .tippy-box[data-placement^=right] > .tippy-svg-arrow > svg {\n transform: rotate(-90deg);\n top: calc(50% - 3px);\n right: 11px;\n }\n\n .tippy-svg-arrow {\n width: 16px;\n height: 16px;\n fill: var(--nile-colors-dark-900, var(--ng-colors-bg-primary-solid));\n text-align: initial;\n position: absolute;\n }\n\n .tippy-svg-arrow > svg {\n position: absolute;\n }\n`;\n\n\nexport function injectGlobalTippyStyles(): void {\n const STYLE_ID = 'nile-lite-tooltip-styles';\n if (document.getElementById(STYLE_ID)) return;\n\n const style = document.createElement('style');\n style.id = STYLE_ID;\n style.textContent = styles.cssText;\n document.head.appendChild(style);\n}\n \ninjectGlobalTippyStyles();\n\nexport default [styles];\n"]}
|
|
@@ -61,7 +61,7 @@ export const styles = css `
|
|
|
61
61
|
font-weight: var(--nile-tooltip-font-weight-sm, var(--ng-font-weight-semibold));
|
|
62
62
|
line-height: var(--nile-tooltip-line-height-sm, var(--ng-line-height-text-xs));
|
|
63
63
|
padding: var(--nile-tooltip-padding-y, var(--ng-spacing-md)) var(--nile-tooltip-padding-x, var(--ng-spacing-md));
|
|
64
|
-
color: var(--nile-colors-white-base, var(--ng-colors-text-
|
|
64
|
+
color: var(--nile-colors-white-base, var(--ng-colors-text-white));
|
|
65
65
|
pointer-events: none;
|
|
66
66
|
word-break: break-word;
|
|
67
67
|
font-family: var(--nile-font-family-inherit, var(--ng-font-family-body));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nile-tooltip.css.js","sourceRoot":"","sources":["../../../src/nile-tooltip/nile-tooltip.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiExB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\n\n/**\n * Tooltip CSS\n */\nexport const styles = css`\n :host {\n --max-width: 20rem;\n --hide-delay: 0ms;\n --show-delay: 150ms;\n -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));\n display: contents;\n }\n\n .tooltip {\n --arrow-size: var(--nile-height-6px, var(--ng-height-5px));\n --arrow-color: var(--nile-tooltip-color-background, var(--ng-colors-bg-primary-solid));\n --arrow-border-color: var(--nile-tooltip-color-background, var(--ng-colors-bg-primary-solid));\n }\n\n .tooltip::part(popup) {\n pointer-events: none;\n z-index: 1000;\n }\n\n .tooltip::part(arrow) {\n z-index: 1;\n box-shadow: none;\n }\n\n .tooltip[placement^='top']::part(popup) {\n transform-origin: bottom;\n }\n\n .tooltip[placement^='bottom']::part(popup) {\n transform-origin: top;\n }\n\n .tooltip[placement^='left']::part(popup) {\n transform-origin: right;\n }\n\n .tooltip[placement^='right']::part(popup) {\n transform-origin: left;\n }\n\n .tooltip__body {\n display: block;\n width: max-content;\n max-width: var(--max-width);\n border-radius: var(--nile-radius-sm, var(--ng-radius-md));\n background-color: var(--nile-tooltip-color-background, var(--ng-colors-bg-primary-solid));\n font-size: var(--nile-tooltip-font-size-sm, var(--ng-font-size-text-xs));\n font-weight: var(--nile-tooltip-font-weight-sm, var(--ng-font-weight-semibold));\n line-height: var(--nile-tooltip-line-height-sm, var(--ng-line-height-text-xs));\n padding: var(--nile-tooltip-padding-y, var(--ng-spacing-md)) var(--nile-tooltip-padding-x, var(--ng-spacing-md));\n color: var(--nile-colors-white-base, var(--ng-colors-text-
|
|
1
|
+
{"version":3,"file":"nile-tooltip.css.js","sourceRoot":"","sources":["../../../src/nile-tooltip/nile-tooltip.css.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiExB,CAAC;AAEF,eAAe,CAAC,MAAM,CAAC,CAAC","sourcesContent":["/**\n * Copyright Aquera Inc 2023\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { css } from 'lit';\n\n/**\n * Tooltip CSS\n */\nexport const styles = css`\n :host {\n --max-width: 20rem;\n --hide-delay: 0ms;\n --show-delay: 150ms;\n -webkit-font-smoothing: var(--nile-webkit-font-smoothing, var(--ng-webkit-font-smoothing));\n -moz-osx-font-smoothing: var(--nile-moz-osx-font-smoothing, var(--ng-moz-osx-font-smoothing));\n text-rendering: var(--nile-text-rendering, var(--ng-text-rendering));\n display: contents;\n }\n\n .tooltip {\n --arrow-size: var(--nile-height-6px, var(--ng-height-5px));\n --arrow-color: var(--nile-tooltip-color-background, var(--ng-colors-bg-primary-solid));\n --arrow-border-color: var(--nile-tooltip-color-background, var(--ng-colors-bg-primary-solid));\n }\n\n .tooltip::part(popup) {\n pointer-events: none;\n z-index: 1000;\n }\n\n .tooltip::part(arrow) {\n z-index: 1;\n box-shadow: none;\n }\n\n .tooltip[placement^='top']::part(popup) {\n transform-origin: bottom;\n }\n\n .tooltip[placement^='bottom']::part(popup) {\n transform-origin: top;\n }\n\n .tooltip[placement^='left']::part(popup) {\n transform-origin: right;\n }\n\n .tooltip[placement^='right']::part(popup) {\n transform-origin: left;\n }\n\n .tooltip__body {\n display: block;\n width: max-content;\n max-width: var(--max-width);\n border-radius: var(--nile-radius-sm, var(--ng-radius-md));\n background-color: var(--nile-tooltip-color-background, var(--ng-colors-bg-primary-solid));\n font-size: var(--nile-tooltip-font-size-sm, var(--ng-font-size-text-xs));\n font-weight: var(--nile-tooltip-font-weight-sm, var(--ng-font-weight-semibold));\n line-height: var(--nile-tooltip-line-height-sm, var(--ng-line-height-text-xs));\n padding: var(--nile-tooltip-padding-y, var(--ng-spacing-md)) var(--nile-tooltip-padding-x, var(--ng-spacing-md));\n color: var(--nile-colors-white-base, var(--ng-colors-text-white));\n pointer-events: none;\n word-break: break-word;\n font-family: var(--nile-font-family-inherit, var(--ng-font-family-body));\n box-shadow:var(--nile-box-shadow-none, var(--ng-shadow-lg));\n }\n\n .tooltip__body--large {\n font-size: var(--nile-tooltip-font-size-lg);\n line-height: var(--nile-tooltip-line-height-lg);\n font-weight: var(--nile-tooltip-font-weight-lg);\n }\n`;\n\nexport default [styles];\n"]}
|
|
@@ -4,6 +4,7 @@ import { KeymapOptions } from './keymap';
|
|
|
4
4
|
import { LinkPluginOptions } from './plugins/link';
|
|
5
5
|
import { ImagePluginOptions } from './plugins/image';
|
|
6
6
|
import { SuggestionOptions } from './plugins/suggestions';
|
|
7
|
+
import { NormalizedAllowedStyles } from './email-css';
|
|
7
8
|
export declare const mentionSuggestKey: PluginKey<any>;
|
|
8
9
|
export declare const slashSuggestKey: PluginKey<any>;
|
|
9
10
|
export declare const emojiSuggestKey: PluginKey<any>;
|
|
@@ -25,6 +26,10 @@ export interface CreateStateOptions extends KeymapOptions, LinkPluginOptions, Im
|
|
|
25
26
|
getForcePlainText?: () => boolean;
|
|
26
27
|
/** Read live: when false, plain-text pastes are never parsed as Markdown. */
|
|
27
28
|
getMarkdownPaste?: () => boolean;
|
|
29
|
+
/** Read live: when true, HTML source pasted as plain text is parsed as HTML. */
|
|
30
|
+
getEmailFidelity?: () => boolean;
|
|
31
|
+
/** Read live: the validated per-app email-fidelity style allowlist. */
|
|
32
|
+
getAllowedStyles?: () => NormalizedAllowedStyles;
|
|
28
33
|
/** Read live: whether pasted/parsed HTML is sanitized. Defaults to on. */
|
|
29
34
|
getSanitize?: () => boolean;
|
|
30
35
|
/** Typography autocorrect (smart quotes, dashes, (c)…). Defaults to on. */
|
|
@@ -51,6 +51,8 @@ export function createEditorState(options = {}) {
|
|
|
51
51
|
getForcePlainText: options.getForcePlainText,
|
|
52
52
|
getMarkdownPaste: options.getMarkdownPaste,
|
|
53
53
|
getSanitize: options.getSanitize,
|
|
54
|
+
getEmailFidelity: options.getEmailFidelity,
|
|
55
|
+
getAllowedStyles: options.getAllowedStyles,
|
|
54
56
|
}));
|
|
55
57
|
if (options.getMaxLength)
|
|
56
58
|
plugins.push(maxLengthPlugin(options.getMaxLength));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-state.js","sourceRoot":"","sources":["../../../../src/nile-wysiwyg-editor/engine/create-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAU,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAiB,MAAM,UAAU,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAqB,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAsB,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAqB,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"create-state.js","sourceRoot":"","sources":["../../../../src/nile-wysiwyg-editor/engine/create-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAU,SAAS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UAAU,EAAE,CAAC,EAC9C,GAAG,YAAY,EAAE,EACjB,WAAW,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,YAAY,EAAE,CAAC,EACnD,iBAAiB,EAAE,EACnB,mBAAmB,EAAE,EACrB,gBAAgB,EAAE,EAClB,mBAAmB,EAAE,EACrB,WAAW,CAAC,MAAM,EAAE;QAClB,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;QAC5C,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;QAC1C,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;QAC1C,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;KAC3C,CAAC,CACH,CAAC;IACF,IAAI,OAAO,CAAC,YAAY;QAAE,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;IAC9E,IAAI,OAAO,CAAC,UAAU;QAAE,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC;IACzD,IAAI,OAAO,CAAC,OAAO;QAAE,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEtD,OAAO,WAAW,CAAC,MAAM,CAAC;QACxB,MAAM;QACN,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,OAAO;KACR,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { EditorState, Plugin, PluginKey } from 'prosemirror-state';\nimport { Node as PMNode, Schema } from 'prosemirror-model';\nimport { history } from 'prosemirror-history';\nimport { dropCursor } from 'prosemirror-dropcursor';\nimport { gapCursor } from 'prosemirror-gapcursor';\nimport { buildKeymapPlugins, KeymapOptions } from './keymap';\nimport { buildInputRules } from './inputrules';\nimport { placeholderPlugin } from './plugins/placeholder';\nimport { linkPlugin, LinkPluginOptions } from './plugins/link';\nimport { singleLinePlugin } from './plugins/single-line';\nimport { tablePlugins } from './plugins/tables';\nimport { imagePlugin, ImagePluginOptions } from './plugins/image';\nimport { suggestionPlugin, SuggestionOptions } from './plugins/suggestions';\nimport { findReplacePlugin } from './plugins/find-replace';\nimport { maxLengthPlugin } from './plugins/max-length';\nimport { codeHighlightPlugin } from './plugins/code-highlight';\nimport { embedPastePlugin } from './plugins/embeds';\nimport { pastePlugin } from './plugins/paste';\nimport { formatPainterPlugin } from './plugins/format-painter';\nimport { defaultSchema } from './schema';\nimport { NormalizedAllowedStyles } from './email-css';\n\nexport const mentionSuggestKey = new PluginKey('nileMentionSuggest');\nexport const slashSuggestKey = new PluginKey('nileSlashSuggest');\nexport const emojiSuggestKey = new PluginKey('nileEmojiSuggest');\n\nexport interface CreateStateOptions\n extends KeymapOptions,\n LinkPluginOptions,\n ImagePluginOptions {\n schema?: Schema;\n doc?: PMNode;\n /** Read live so the placeholder updates without rebuilding state. */\n getPlaceholder?: () => string;\n singleLine?: boolean;\n /** Mention suggestions (omit onChange to disable the plugin). */\n mentions?: Omit<SuggestionOptions, 'startOfLine'>;\n /** Slash-command suggestions, anchored to the start of a block. */\n slashCommands?: Omit<SuggestionOptions, 'startOfLine' | 'getTriggers'>;\n /** \":\" emoji suggestions (activates after two query characters). */\n emoji?: Omit<SuggestionOptions, 'startOfLine' | 'getTriggers' | 'minQueryLength'>;\n /** Character limit, read live. Return 0/undefined for unlimited. */\n getMaxLength?: () => number;\n /** Read live: when true, all pastes drop formatting. */\n getForcePlainText?: () => boolean;\n /** Read live: when false, plain-text pastes are never parsed as Markdown. */\n getMarkdownPaste?: () => boolean;\n /** Read live: when true, HTML source pasted as plain text is parsed as HTML. */\n getEmailFidelity?: () => boolean;\n /** Read live: the validated per-app email-fidelity style allowlist. */\n getAllowedStyles?: () => NormalizedAllowedStyles;\n /** Read live: whether pasted/parsed HTML is sanitized. Defaults to on. */\n getSanitize?: () => boolean;\n /** Typography autocorrect (smart quotes, dashes, (c)…). Defaults to on. */\n textTransform?: boolean;\n /** Extra plugins appended after the built-in set (later phases, tests). */\n plugins?: Plugin[];\n}\n\nexport function createEditorState(options: CreateStateOptions = {}): EditorState {\n const schema = options.schema ?? defaultSchema;\n const plugins: Plugin[] = [];\n\n // Suggestion plugins must come BEFORE the keymaps: handleKeyDown props run\n // in plugin order, and the popup needs first claim on Enter/Tab/arrows\n // while a mention or slash query is active.\n if (options.mentions) {\n plugins.push(suggestionPlugin(mentionSuggestKey, options.mentions));\n }\n if (options.slashCommands) {\n plugins.push(\n suggestionPlugin(slashSuggestKey, {\n ...options.slashCommands,\n getTriggers: () => ['/'],\n startOfLine: true,\n })\n );\n }\n if (options.emoji) {\n plugins.push(\n suggestionPlugin(emojiSuggestKey, {\n ...options.emoji,\n getTriggers: () => [':'],\n minQueryLength: 2,\n })\n );\n }\n\n plugins.push(\n buildInputRules(schema, { textTransform: options.textTransform }),\n ...buildKeymapPlugins(schema, {\n onLinkShortcut: options.onLinkShortcut,\n onFindShortcut: options.onFindShortcut,\n onShortcutHelp: options.onShortcutHelp,\n }),\n history(),\n dropCursor(),\n gapCursor(),\n placeholderPlugin(options.getPlaceholder ?? (() => '')),\n linkPlugin({ onOpenLink: options.onOpenLink }),\n ...tablePlugins(),\n imagePlugin({ onImageFiles: options.onImageFiles }),\n findReplacePlugin(),\n codeHighlightPlugin(),\n embedPastePlugin(),\n formatPainterPlugin(),\n pastePlugin(schema, {\n getForcePlainText: options.getForcePlainText,\n getMarkdownPaste: options.getMarkdownPaste,\n getSanitize: options.getSanitize,\n getEmailFidelity: options.getEmailFidelity,\n getAllowedStyles: options.getAllowedStyles,\n })\n );\n if (options.getMaxLength) plugins.push(maxLengthPlugin(options.getMaxLength));\n if (options.singleLine) plugins.push(singleLinePlugin());\n if (options.plugins) plugins.push(...options.plugins);\n\n return EditorState.create({\n schema,\n doc: options.doc,\n plugins,\n });\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Properties an app can never allow, whatever its config. */
|
|
2
|
+
export declare const EXTENSION_DENYLIST: Set<string>;
|
|
3
|
+
/** Lowercase name (optionally `mso-`), not denylisted and not built in. */
|
|
4
|
+
export declare function isExtensionPropValid(name: string): boolean;
|
|
5
|
+
/** Strict value grammar: no functions except numeric colours, no escape characters. */
|
|
6
|
+
export declare function isExtensionValueValid(value: string): boolean;
|
|
7
|
+
/** tag → set of accepted extension property names. */
|
|
8
|
+
export type NormalizedAllowedStyles = Map<string, Set<string>>;
|
|
9
|
+
/** Validated tag → props map; warns once per dropped entry. */
|
|
10
|
+
export declare function normalizeEmailAllowedStyles(config: Record<string, string[]>): NormalizedAllowedStyles;
|
|
11
|
+
/** `"td: letter-spacing; p: text-indent"` → `{ td: ['letter-spacing'], p: ['text-indent'] }`. */
|
|
12
|
+
export declare function parseAllowedStylesAttr(raw: string): Record<string, string[]>;
|
|
13
|
+
/** Re-validates a stored `extraStyle` on write-back, where the per-app allowlist isn't visible. */
|
|
14
|
+
export declare function sanitizeExtraStyleForWrite(s: string): string;
|