@aquera/nile-elements 1.9.7 → 1.9.9
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/dist/{index-249de90a.esm.js → index-289706c7.esm.js} +1 -1
- package/dist/{index-df196058.cjs.js → index-d7e6f1c6.cjs.js} +2 -2
- package/dist/index-d7e6f1c6.cjs.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1587 -1276
- package/dist/katex-44476ab4.esm.js +1 -0
- package/dist/katex-f4186f87.cjs.js +2 -0
- package/dist/katex-f4186f87.cjs.js.map +1 -0
- package/dist/nile-color-picker/index.cjs.js +1 -1
- package/dist/nile-color-picker/index.esm.js +1 -1
- package/dist/nile-color-picker/nile-color-picker.cjs.js +1 -1
- package/dist/nile-color-picker/nile-color-picker.cjs.js.map +1 -1
- package/dist/nile-color-picker/nile-color-picker.esm.js +1 -1
- package/dist/nile-select/virtual-scroll-helper.cjs.js +1 -1
- package/dist/nile-select/virtual-scroll-helper.cjs.js.map +1 -1
- package/dist/nile-select/virtual-scroll-helper.esm.js +52 -44
- package/dist/nile-virtual-select/renderer.cjs.js +1 -1
- package/dist/nile-virtual-select/renderer.cjs.js.map +1 -1
- package/dist/nile-virtual-select/renderer.esm.js +23 -22
- 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/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/keymap.cjs.js +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/math-view.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/math-view.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/math-view.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/style-block-view.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/style-block-view.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/engine/plugins/style-block-view.esm.js +1 -0
- 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 +1 -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/index.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/index.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/math/katex-renderer.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/math/katex-renderer.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/math/katex-renderer.esm.js +1 -0
- 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 +22 -3
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.esm.js +7 -6
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar-item.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar-item.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar-item.esm.js +1 -0
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.esm.js +33 -54
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.esm.js +83 -95
- package/dist/nile-wysiwyg-editor/types.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/types.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/types.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/bubble-item.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/bubble-item.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/bubble-item.esm.js +1 -0
- 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 +23 -15
- 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 +3 -3
- 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/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 +0 -3
- package/dist/nile-wysiwyg-editor/ui/preview.cjs.js +2 -0
- package/dist/nile-wysiwyg-editor/ui/preview.cjs.js.map +1 -0
- package/dist/nile-wysiwyg-editor/ui/preview.esm.js +8 -0
- 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 +225 -24
- 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 +9 -9
- 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 +115 -13
- 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 +13 -12
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.js +3 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/nile-color-picker/nile-color-picker.d.ts +1 -0
- package/dist/src/nile-color-picker/nile-color-picker.js +1 -0
- package/dist/src/nile-color-picker/nile-color-picker.js.map +1 -1
- package/dist/src/nile-select/virtual-scroll-helper.js +9 -1
- package/dist/src/nile-select/virtual-scroll-helper.js.map +1 -1
- package/dist/src/nile-virtual-select/renderer.js +1 -0
- package/dist/src/nile-virtual-select/renderer.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/index.d.ts +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/index.js +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/index.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/plugins/embed-view.js +3 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/embed-view.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/plugins/embeds.d.ts +19 -4
- package/dist/src/nile-wysiwyg-editor/engine/plugins/embeds.js +23 -18
- package/dist/src/nile-wysiwyg-editor/engine/plugins/embeds.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/plugins/math-view.d.ts +8 -3
- package/dist/src/nile-wysiwyg-editor/engine/plugins/math-view.js +41 -4
- package/dist/src/nile-wysiwyg-editor/engine/plugins/math-view.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/plugins/style-block-view.d.ts +17 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/style-block-view.js +174 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/style-block-view.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/engine/plugins/tables.js +33 -2
- package/dist/src/nile-wysiwyg-editor/engine/plugins/tables.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/pm.test.js +49 -8
- package/dist/src/nile-wysiwyg-editor/engine/pm.test.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/sanitize.d.ts +12 -0
- package/dist/src/nile-wysiwyg-editor/engine/sanitize.js +76 -8
- package/dist/src/nile-wysiwyg-editor/engine/sanitize.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/engine/schema.d.ts +2 -0
- package/dist/src/nile-wysiwyg-editor/engine/schema.js +154 -2
- package/dist/src/nile-wysiwyg-editor/engine/schema.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/index.d.ts +5 -0
- package/dist/src/nile-wysiwyg-editor/index.js +3 -0
- package/dist/src/nile-wysiwyg-editor/index.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/math/katex-renderer.d.ts +38 -0
- package/dist/src/nile-wysiwyg-editor/math/katex-renderer.js +40 -0
- package/dist/src/nile-wysiwyg-editor/math/katex-renderer.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.js +22 -3
- 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 +36 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js +125 -8
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.js +5 -2
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.d.ts +2 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.js +1 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar-item.d.ts +55 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar-item.js +79 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar-item.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.js +33 -54
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.d.ts +50 -2
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.js +158 -102
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/types.d.ts +4 -2
- package/dist/src/nile-wysiwyg-editor/types.js +2 -2
- package/dist/src/nile-wysiwyg-editor/types.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/bubble-item.d.ts +48 -0
- package/dist/src/nile-wysiwyg-editor/ui/bubble-item.js +69 -0
- package/dist/src/nile-wysiwyg-editor/ui/bubble-item.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.d.ts +17 -2
- package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.js +128 -35
- package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/embed-panel.d.ts +2 -1
- package/dist/src/nile-wysiwyg-editor/ui/embed-panel.js +4 -3
- package/dist/src/nile-wysiwyg-editor/ui/embed-panel.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/math-panel.js +0 -3
- package/dist/src/nile-wysiwyg-editor/ui/math-panel.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/preview.d.ts +20 -0
- package/dist/src/nile-wysiwyg-editor/ui/preview.js +44 -0
- package/dist/src/nile-wysiwyg-editor/ui/preview.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/source-view.d.ts +35 -3
- package/dist/src/nile-wysiwyg-editor/ui/source-view.js +337 -24
- package/dist/src/nile-wysiwyg-editor/ui/source-view.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/suggest-list.d.ts +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/suggest-list.js +9 -0
- package/dist/src/nile-wysiwyg-editor/ui/suggest-list.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.d.ts +13 -2
- package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.js +166 -10
- package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/table-menu.d.ts +1 -0
- package/dist/src/nile-wysiwyg-editor/ui/table-menu.js +10 -8
- 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/xml-25c4108a.esm.js +1 -0
- package/dist/xml-90fd974e.cjs.js +2 -0
- package/dist/xml-90fd974e.cjs.js.map +1 -0
- package/package.json +2 -1
- package/rollup.config.js +1 -0
- package/src/index.ts +8 -0
- package/src/nile-color-picker/nile-color-picker.ts +1 -0
- package/src/nile-select/virtual-scroll-helper.ts +9 -1
- package/src/nile-virtual-select/renderer.ts +1 -1
- package/src/nile-wysiwyg-editor/engine/index.ts +1 -0
- package/src/nile-wysiwyg-editor/engine/plugins/embed-view.ts +3 -0
- package/src/nile-wysiwyg-editor/engine/plugins/embeds.ts +26 -20
- package/src/nile-wysiwyg-editor/engine/plugins/math-view.ts +45 -4
- package/src/nile-wysiwyg-editor/engine/plugins/style-block-view.ts +178 -0
- package/src/nile-wysiwyg-editor/engine/plugins/tables.ts +34 -2
- package/src/nile-wysiwyg-editor/engine/pm.test.ts +58 -8
- package/src/nile-wysiwyg-editor/engine/sanitize.ts +71 -8
- package/src/nile-wysiwyg-editor/engine/schema.ts +158 -7
- package/src/nile-wysiwyg-editor/index.ts +5 -0
- package/src/nile-wysiwyg-editor/math/katex-renderer.ts +59 -0
- package/src/nile-wysiwyg-editor/math/katex.d.ts +17 -0
- package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.ts +22 -3
- package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.test.ts +5 -2
- package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.ts +142 -7
- package/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/index.ts +2 -0
- package/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar-item.ts +68 -0
- package/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.ts +33 -54
- package/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.ts +202 -108
- package/src/nile-wysiwyg-editor/types.ts +6 -4
- package/src/nile-wysiwyg-editor/ui/bubble-item.ts +60 -0
- package/src/nile-wysiwyg-editor/ui/bubble-menu.ts +147 -40
- package/src/nile-wysiwyg-editor/ui/embed-panel.ts +4 -3
- package/src/nile-wysiwyg-editor/ui/math-panel.ts +0 -3
- package/src/nile-wysiwyg-editor/ui/preview.ts +42 -0
- package/src/nile-wysiwyg-editor/ui/source-view.ts +339 -31
- package/src/nile-wysiwyg-editor/ui/suggest-list.ts +10 -0
- package/src/nile-wysiwyg-editor/ui/table-grid-picker.ts +160 -10
- package/src/nile-wysiwyg-editor/ui/table-menu.ts +10 -8
- package/vscode-html-custom-data.json +75 -6
- package/dist/index-df196058.cjs.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-view.cjs.js","sources":["../../../../src/nile-wysiwyg-editor/ui/source-view.ts"],"sourcesContent":["import { html, css, TemplateResult, CSSResultArray } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport NileElement from '../../internal/nile-element';\n\n/**\n * Raw HTML source editing mode. Replaces the rich surface while open; the\n * host re-parses (and re-sanitizes) the HTML on apply. Emits\n * `wysiwyg-source-apply` detail: { html } and `wysiwyg-source-cancel`.\n */\n@customElement('nile-wysiwyg-source-view')\nexport class NileWysiwygSourceView extends NileElement {\n @property({ type: String }) value = '';\n\n @query('textarea') textarea?: HTMLTextAreaElement;\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 display: flex;\n flex-direction: column;\n }\n\n .bar {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 6px 12px;\n font-size: 12px;\n color: var(--nile-colors-neutral-600, #475467);\n border-bottom: 1px solid var(--nile-colors-neutral-300, #e4e7ec);\n background: var(--nile-wysiwyg-toolbar-bg, var(--nile-colors-neutral-50, #f9fafb));\n }\n\n .actions {\n display: flex;\n gap: 8px;\n }\n\n button {\n font: inherit;\n font-size: 12px;\n padding: 4px 12px;\n border-radius: 6px;\n border: 1px solid transparent;\n cursor: pointer;\n background: transparent;\n color: var(--nile-colors-neutral-700, #344054);\n }\n\n button.primary {\n background: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600, #2563eb));\n color: #ffffff;\n }\n\n textarea {\n flex: 1;\n min-height: var(--nile-wysiwyg-min-height, 160px);\n padding: 12px 16px;\n border: none;\n outline: none;\n resize: vertical;\n font-family: var(--nile-wysiwyg-code-font, ui-monospace, SFMono-Regular, Menlo, monospace);\n font-size: 12px;\n line-height: 1.5;\n color: var(--nile-colors-neutral-900, #101828);\n background: transparent;\n box-sizing: border-box;\n }\n `,\n ];\n }\n\n public focusInput(): void {\n this.updateComplete.then(() => this.textarea?.focus());\n }\n\n public render(): TemplateResult {\n return html`\n <div class=\"bar\" part=\"source-bar\">\n <span>HTML source</span>\n <span class=\"actions\">\n <button type=\"button\" @click=${() => this.emit('wysiwyg-source-cancel')}>\n Cancel\n </button>\n <button\n type=\"button\"\n class=\"primary\"\n @click=${() =>\n this.emit('wysiwyg-source-apply', { html: this.textarea?.value ?? '' })}\n >\n Done\n </button>\n </span>\n </div>\n <textarea\n part=\"source-textarea\"\n spellcheck=\"false\"\n .value=${this.value}\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n e.stopPropagation();\n this.emit('wysiwyg-source-cancel');\n }\n }}\n ></textarea>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-wysiwyg-source-view': NileWysiwygSourceView;\n }\n}\n"],"names":["NileWysiwygSourceView","_s","a","this","value","_this","_inherits","_createClass","key","focusInput","updateComplete","then","_this2$textarea","textarea","focus","render","html","_templateObject","_taggedTemplateLiteral","emit","_this3$textarea$value","_this3$textarea","e","stopPropagation","__decorate","get","css","_templateObject2","NileElement","property","type","String","prototype","query","customElement"],"mappings":"k5GAUaA,CAAN,uBAAAC,EAAA,EAAA,SAAAC,EAAA,qEACuBC,EAAAA,KAAAA,CAAKC,KAAG,CAAA,EAqGrC,QAAAC,KAAA,EAjGQC,SAAA,CAAAJ,CAAA,CAAAD,EAAA,SAAAM,YAAA,CAAAL,CAAA,GAAAM,GAAA,cAAAJ,KAAA,CA8DA,SAAAK,UAAAA,CAAAA,CAAAA,KAAAA,MAAAA,MACLN,IAAKO,CAAAA,cAA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ADjCU,CAAAA,CAAc,0BACFlC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA"}
|
|
1
|
+
{"version":3,"file":"source-view.cjs.js","sources":["../../../../src/nile-wysiwyg-editor/ui/source-view.ts"],"sourcesContent":["import { html, css, TemplateResult, CSSResultArray } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\nimport hljs from 'highlight.js/lib/core';\nimport xml from 'highlight.js/lib/languages/xml';\nimport NileElement from '../../internal/nile-element';\nimport { sanitizeHtml } from '../engine/sanitize';\nimport './preview';\n\n// HTML highlighting only — reuses the same lib the code-block feature already\n// bundles, so this adds no new dependency. Registration is idempotent.\nhljs.registerLanguage('xml', xml);\n\n/**\n * Raw HTML source editing mode. A split view: the raw HTML on the left, a\n * live rendered preview on the right, with a draggable divider between them\n * and a resizable body. The preview runs the same sanitizer the host applies\n * on the way back, so what you see is what the document becomes. Emits\n * `wysiwyg-source-apply` detail: { html } and `wysiwyg-source-cancel`.\n *\n * The code pane is a lightweight editor: a real `<textarea>` for input, with a\n * highlight.js-coloured layer painted behind it and a synced line-number\n * gutter. No heavyweight code-editor dependency.\n */\n@customElement('nile-wysiwyg-source-view')\nexport class NileWysiwygSourceView extends NileElement {\n @property({ type: String }) value = '';\n\n @query('textarea') private textarea?: HTMLTextAreaElement;\n\n @query('.hl > code') private highlightEl?: HTMLElement;\n\n @query('.linenos-inner') private linenosEl?: HTMLElement;\n\n @query('.body') private bodyEl?: HTMLElement;\n\n /** Current source text, drives the live preview, highlight and gutter. */\n @state() private draft = '';\n\n /**\n * Fraction of the body width given to the code pane (the rest is preview).\n * Clamped while dragging the divider.\n */\n @state() private splitRatio = 0.5;\n\n /** Whether the divider is currently being dragged. */\n @state() private splitDragging = false;\n\n public static get styles(): CSSResultArray {\n return [\n css`\n :host {\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n overflow: hidden;\n min-height: var(--nile-wysiwyg-min-height, 200px);\n height: var(--nile-wysiwyg-source-height, 340px);\n max-height: var(\n --nile-wysiwyg-source-max-height,\n var(--nile-wysiwyg-max-height, 70vh)\n );\n resize: vertical;\n }\n\n .bar {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 6px 12px;\n font-size: 12px;\n color: var(--nile-colors-neutral-600, #475467);\n border-bottom: 1px solid var(--nile-colors-neutral-300, #e4e7ec);\n background: var(--nile-wysiwyg-toolbar-bg, var(--nile-colors-neutral-50, #f9fafb));\n }\n\n .actions {\n display: flex;\n gap: 8px;\n }\n\n button {\n font: inherit;\n font-size: 12px;\n padding: 4px 12px;\n border-radius: 6px;\n border: 1px solid transparent;\n cursor: pointer;\n background: transparent;\n color: var(--nile-colors-neutral-700, #344054);\n }\n\n button.primary {\n background: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600, #2563eb));\n color: #ffffff;\n }\n\n .body {\n flex: 1 1 auto;\n display: flex;\n align-items: stretch;\n overflow: hidden;\n min-height: 0;\n box-sizing: border-box;\n }\n\n .body--dragging {\n cursor: col-resize;\n user-select: none;\n -webkit-user-select: none;\n }\n\n .body--dragging .pane {\n pointer-events: none;\n }\n\n .pane {\n min-width: 0;\n min-height: 0;\n box-sizing: border-box;\n }\n\n /* --- Lightweight code editor: gutter + highlighted textarea --- */\n .pane--code {\n display: flex;\n background: var(--nile-colors-white-base, #ffffff);\n /* Shared code metrics, inherited by the gutter, highlight and textarea\n so every line lines up to the pixel. */\n font-family: var(--nile-wysiwyg-code-font, ui-monospace, SFMono-Regular, Menlo, monospace);\n font-size: 12px;\n line-height: 18px;\n tab-size: 2;\n -moz-tab-size: 2;\n }\n\n .linenos {\n flex: 0 0 auto;\n overflow: hidden;\n box-sizing: border-box;\n padding: 12px 8px 0;\n text-align: right;\n color: var(--nile-colors-neutral-400, #98a2b3);\n background: var(--nile-colors-neutral-50, #f9fafb);\n border-right: 1px solid var(--nile-colors-neutral-200, #eaecf0);\n user-select: none;\n }\n\n .linenos-inner {\n will-change: transform;\n }\n\n .linenos-inner > div {\n height: 18px;\n }\n\n .input-wrap {\n position: relative;\n flex: 1 1 0;\n min-width: 0;\n overflow: hidden;\n }\n\n /* Highlight layer and textarea share the exact same box (offset for\n padding via top/left, extending to the edges for horizontal scroll),\n so the coloured text sits directly under the caret. */\n .hl,\n textarea {\n position: absolute;\n top: 12px;\n left: 16px;\n right: 0;\n bottom: 0;\n margin: 0;\n border: 0;\n padding: 0;\n font: inherit;\n line-height: inherit;\n tab-size: inherit;\n white-space: pre;\n word-wrap: normal;\n overflow-wrap: normal;\n box-sizing: border-box;\n }\n\n .hl {\n overflow: hidden;\n pointer-events: none;\n color: var(--nile-colors-neutral-900, #101828);\n }\n\n .hl > code {\n display: block;\n will-change: transform;\n }\n\n textarea {\n width: auto;\n resize: none;\n outline: none;\n overflow: auto;\n background: transparent;\n color: transparent;\n caret-color: var(--nile-colors-neutral-900, #101828);\n }\n\n /* Must be translucent: the textarea's text is transparent and the\n coloured code sits BEHIND it, so an opaque selection would hide the\n text. A tint lets the highlighted code show through the selection. */\n textarea::selection {\n background: rgba(41, 112, 255, 0.3);\n }\n textarea::-moz-selection {\n background: rgba(41, 112, 255, 0.3);\n }\n\n /* highlight.js token palette (Atom One Light), matching code blocks. */\n .hl .hljs-comment,\n .hl .hljs-quote { color: #a0a1a7; font-style: italic; }\n .hl .hljs-keyword,\n .hl .hljs-selector-tag,\n .hl .hljs-doctag { color: #a626a4; }\n .hl .hljs-name,\n .hl .hljs-selector-id,\n .hl .hljs-selector-class,\n .hl .hljs-tag { color: #e45649; }\n .hl .hljs-literal,\n .hl .hljs-built_in { color: #0184bb; }\n .hl .hljs-string,\n .hl .hljs-attribute,\n .hl .hljs-meta .hljs-string { color: #50a14f; }\n .hl .hljs-attr,\n .hl .hljs-variable,\n .hl .hljs-type,\n .hl .hljs-number { color: #986801; }\n .hl .hljs-symbol,\n .hl .hljs-meta,\n .hl .hljs-title { color: #4078f2; }\n\n /* Draggable divider between the code and preview panes. */\n .gutter {\n flex: 0 0 auto;\n position: relative;\n width: 1px;\n align-self: stretch;\n background: var(--nile-colors-neutral-300, #e4e7ec);\n cursor: col-resize;\n touch-action: none;\n }\n\n .gutter::before {\n content: '';\n position: absolute;\n inset: 0 -4px;\n }\n\n .gutter:hover,\n .body--dragging .gutter {\n background: var(--ng-colors-bg-brand-primary, #2970ff);\n }\n\n .pane--preview {\n flex: 1 1 0;\n overflow: auto;\n border-left: 1px solid var(--nile-colors-neutral-200, #eaecf0);\n background: var(--nile-colors-white-base, #ffffff);\n }\n\n nile-wysiwyg-preview {\n display: block;\n }\n\n .preview-empty {\n display: block;\n padding: 12px 16px;\n color: var(--nile-colors-neutral-500, #98a2b3);\n font-size: 12px;\n opacity: 0.7;\n }\n `,\n ];\n }\n\n protected willUpdate(changed: Map<string, unknown>): void {\n // Sync the draft (and thus preview/highlight) whenever the host sets value.\n if (changed.has('value')) this.draft = this.value;\n }\n\n /** The current (possibly edited) source text — what \"Done\" would apply. */\n public get currentValue(): string {\n return this.draft;\n }\n\n public focusInput(): void {\n this.updateComplete.then(() => this.textarea?.focus());\n }\n\n /** highlight.js-coloured HTML for the current draft (falls back to escaped). */\n private get highlighted(): string {\n if (!this.draft) return '';\n try {\n return hljs.highlight(this.draft, { language: 'xml' }).value;\n } catch {\n return this.draft.replace(/[&<>]/g, c => ({ '&': '&', '<': '<', '>': '>' }[c]!));\n }\n }\n\n private get lineCount(): number {\n return this.draft ? this.draft.split('\\n').length : 1;\n }\n\n /** Begins a pointer-driven resize of the split divider. */\n private startSplitDrag = (e: PointerEvent) => {\n const body = this.bodyEl;\n if (!body) return;\n e.preventDefault();\n this.splitDragging = true;\n\n const rect = body.getBoundingClientRect();\n const MIN = 0.15;\n const MAX = 0.85;\n\n const onMove = (ev: PointerEvent) => {\n if (rect.width === 0) return;\n const ratio = (ev.clientX - rect.left) / rect.width;\n this.splitRatio = Math.min(MAX, Math.max(MIN, ratio));\n };\n const onUp = () => {\n this.splitDragging = false;\n window.removeEventListener('pointermove', onMove);\n window.removeEventListener('pointerup', onUp);\n };\n window.addEventListener('pointermove', onMove);\n window.addEventListener('pointerup', onUp);\n };\n\n /** Resets the divider to a 50/50 layout (double-click affordance). */\n private resetSplit = () => {\n this.splitRatio = 0.5;\n };\n\n private onInput = (e: Event) => {\n this.draft = (e.target as HTMLTextAreaElement).value;\n };\n\n /** Keeps the highlight layer and line-number gutter aligned with scroll. */\n private onScroll = (e: Event) => {\n const ta = e.target as HTMLTextAreaElement;\n if (this.highlightEl) {\n this.highlightEl.style.transform = `translate(${-ta.scrollLeft}px, ${-ta.scrollTop}px)`;\n }\n if (this.linenosEl) {\n this.linenosEl.style.transform = `translateY(${-ta.scrollTop}px)`;\n }\n };\n\n public render(): TemplateResult {\n const preview = sanitizeHtml(this.draft);\n const lines: TemplateResult[] = [];\n for (let i = 1; i <= this.lineCount; i += 1) lines.push(html`<div>${i}</div>`);\n return html`\n <div class=\"bar\" part=\"source-bar\">\n <span>HTML</span>\n <span class=\"actions\">\n <button type=\"button\" @click=${() => this.emit('wysiwyg-source-cancel')}>\n Cancel\n </button>\n <button\n type=\"button\"\n class=\"primary\"\n @click=${() => this.emit('wysiwyg-source-apply', { html: this.draft })}\n >\n Done\n </button>\n </span>\n </div>\n <div class=${classMap({ body: true, 'body--dragging': this.splitDragging })}>\n <div class=\"pane pane--code\" style=\"flex: 0 0 ${this.splitRatio * 100}%\">\n <div class=\"linenos\" part=\"line-numbers\" aria-hidden=\"true\">\n <div class=\"linenos-inner\">${lines}</div>\n </div>\n <div class=\"input-wrap\">\n <pre class=\"hl\" aria-hidden=\"true\"><code>${unsafeHTML(this.highlighted)}</code></pre>\n <textarea\n part=\"source-textarea\"\n spellcheck=\"false\"\n autocapitalize=\"off\"\n autocomplete=\"off\"\n wrap=\"off\"\n .value=${this.value}\n @input=${this.onInput}\n @scroll=${this.onScroll}\n @keydown=${(e: KeyboardEvent) => {\n if (e.key === 'Escape') {\n e.stopPropagation();\n this.emit('wysiwyg-source-cancel');\n }\n }}\n ></textarea>\n </div>\n </div>\n <div\n class=\"gutter\"\n part=\"gutter\"\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label=\"Resize source and preview\"\n title=\"Drag to resize · double-click to reset\"\n @pointerdown=${this.startSplitDrag}\n @dblclick=${this.resetSplit}\n ></div>\n <div class=\"pane pane--preview\" part=\"preview\">\n ${this.draft.trim()\n ? html`<nile-wysiwyg-preview .content=${preview}></nile-wysiwyg-preview>`\n : html`<span class=\"preview-empty\">Nothing to preview</span>`}\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-wysiwyg-source-view': NileWysiwygSourceView;\n }\n}\n"],"names":["hljs","registerLanguage","xml","NileWysiwygSourceView","_d","g","constructor","this","value","draft","splitRatio","splitDragging","startSplitDrag","e","body","bodyEl","preventDefault","rect","getBoundingClientRect","onMove","ev","width","ratio","clientX","left","Math","min","max","onUp","window","removeEventListener","addEventListener","resetSplit","onInput","target","onScroll","ta","highlightEl","style","transform","scrollLeft","scrollTop","linenosEl","_this","_inherits","_createClass","key","willUpdate","changed","has","get","currentValue","focusInput","updateComplete","then","_this2$textarea","textarea","focus","highlighted","highlight","language","_unused","replace","c","lineCount","split","length","render","_this3","preview","sanitizeHtml","lines","i","push","html","_templateObject","_taggedTemplateLiteral","_templateObject2","emit","classMap","unsafeHTML","stopPropagation","trim","_templateObject3","_templateObject4","css","_templateObject5","NileElement","__decorate","property","type","String","prototype","query","state","customElement"],"mappings":"smIAYAA,CAAKC,CAAAA,gBAAAA,CAAiB,KAAOC,CAAAA,CAAAA,CAAAA,CAchBC,CAAN,uBAAAC,EAAA,EAAA,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,mCACuBC,EAAAA,KAAAA,CAAKC,KAAG,CAAA,EAAA,CAWnBD,KAAAA,CAAKE,KAAG,CAAA,EAAA,CAMR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1F,CAAAA,CAAAA,CAAAA,CAAAA,CAAAyF,UAAA,QAAA,CAAA,IAAA,EAAA,CAAA,CAG5BJ,CAAA,CAAA,CAAhBM,CAA2B3F,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAyF,SAAA,CAAA,OAAA,CAAA,IAAA,IAMXJ,CAAA,CAAA,CAAhBM,CAAiC3F,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAyF,SAAA,CAAA,YAAA,CAAA,IAAA,EAGjBJ,CAAAA,CAAAA,CAAAA,CAAA,CAAhBM,CAAsC3F,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAyF,SAAA,CAAA,eAAA,CAAA,IAAA,EArB5BzF,CAAAA,CAAAA,CAAAA,CAAqBqF,CAAA,CAAA,CADjCO,EAAc,0BACF5F,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA"}
|
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
import{__decorate as e}from"tslib";import{css as t,html as
|
|
1
|
+
import{__decorate as e}from"tslib";import{css as t,html as i}from"lit";import{property as r,query as o,state as s,customElement as l}from"lit/decorators.js";import{classMap as n}from"lit/directives/class-map.js";import{unsafeHTML as a}from"lit/directives/unsafe-html.js";import{H as h,x as c}from"../../xml-25c4108a.esm.js";import{N as d}from"../../internal/nile-element.esm.js";import{s as p}from"../engine/sanitize.esm.js";import"./preview.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";import"../engine/plugins/embeds.esm.js";import"../../index-6f3fa4ab.esm.js";import"../nile-wysiwyg-editor.css.esm.js";h.registerLanguage("xml",c);let g=class extends d{constructor(){super(...arguments),this.value="",this.draft="",this.splitRatio=.5,this.splitDragging=!1,this.startSplitDrag=e=>{const t=this.bodyEl;if(!t)return;e.preventDefault(),this.splitDragging=!0;const i=t.getBoundingClientRect(),r=e=>{if(0===i.width)return;const t=(e.clientX-i.left)/i.width;this.splitRatio=Math.min(.85,Math.max(.15,t))},o=()=>{this.splitDragging=!1,window.removeEventListener("pointermove",r),window.removeEventListener("pointerup",o)};window.addEventListener("pointermove",r),window.addEventListener("pointerup",o)},this.resetSplit=()=>{this.splitRatio=.5},this.onInput=e=>{this.draft=e.target.value},this.onScroll=e=>{const t=e.target;this.highlightEl&&(this.highlightEl.style.transform=`translate(${-t.scrollLeft}px, ${-t.scrollTop}px)`),this.linenosEl&&(this.linenosEl.style.transform=`translateY(${-t.scrollTop}px)`)}}static get styles(){return[t`
|
|
2
2
|
:host {
|
|
3
|
-
font-family: var(
|
|
4
|
-
--nile-font-family-sans-serif,
|
|
5
|
-
var(--ng-font-family-body, system-ui, -apple-system, sans-serif)
|
|
6
|
-
);
|
|
7
3
|
display: flex;
|
|
8
4
|
flex-direction: column;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
min-height: var(--nile-wysiwyg-min-height, 200px);
|
|
8
|
+
height: var(--nile-wysiwyg-source-height, 340px);
|
|
9
|
+
max-height: var(
|
|
10
|
+
--nile-wysiwyg-source-max-height,
|
|
11
|
+
var(--nile-wysiwyg-max-height, 70vh)
|
|
12
|
+
);
|
|
13
|
+
resize: vertical;
|
|
9
14
|
}
|
|
10
15
|
|
|
11
16
|
.bar {
|
|
17
|
+
flex: 0 0 auto;
|
|
12
18
|
display: flex;
|
|
13
19
|
align-items: center;
|
|
14
20
|
justify-content: space-between;
|
|
@@ -40,23 +46,190 @@ import{__decorate as e}from"tslib";import{css as t,html as r}from"lit";import{pr
|
|
|
40
46
|
color: #ffffff;
|
|
41
47
|
}
|
|
42
48
|
|
|
43
|
-
|
|
44
|
-
flex: 1;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
.body {
|
|
50
|
+
flex: 1 1 auto;
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: stretch;
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
min-height: 0;
|
|
55
|
+
box-sizing: border-box;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.body--dragging {
|
|
59
|
+
cursor: col-resize;
|
|
60
|
+
user-select: none;
|
|
61
|
+
-webkit-user-select: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.body--dragging .pane {
|
|
65
|
+
pointer-events: none;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.pane {
|
|
69
|
+
min-width: 0;
|
|
70
|
+
min-height: 0;
|
|
71
|
+
box-sizing: border-box;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* --- Lightweight code editor: gutter + highlighted textarea --- */
|
|
75
|
+
.pane--code {
|
|
76
|
+
display: flex;
|
|
77
|
+
background: var(--nile-colors-white-base, #ffffff);
|
|
78
|
+
/* Shared code metrics, inherited by the gutter, highlight and textarea
|
|
79
|
+
so every line lines up to the pixel. */
|
|
50
80
|
font-family: var(--nile-wysiwyg-code-font, ui-monospace, SFMono-Regular, Menlo, monospace);
|
|
51
81
|
font-size: 12px;
|
|
52
|
-
line-height:
|
|
82
|
+
line-height: 18px;
|
|
83
|
+
tab-size: 2;
|
|
84
|
+
-moz-tab-size: 2;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.linenos {
|
|
88
|
+
flex: 0 0 auto;
|
|
89
|
+
overflow: hidden;
|
|
90
|
+
box-sizing: border-box;
|
|
91
|
+
padding: 12px 8px 0;
|
|
92
|
+
text-align: right;
|
|
93
|
+
color: var(--nile-colors-neutral-400, #98a2b3);
|
|
94
|
+
background: var(--nile-colors-neutral-50, #f9fafb);
|
|
95
|
+
border-right: 1px solid var(--nile-colors-neutral-200, #eaecf0);
|
|
96
|
+
user-select: none;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.linenos-inner {
|
|
100
|
+
will-change: transform;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.linenos-inner > div {
|
|
104
|
+
height: 18px;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.input-wrap {
|
|
108
|
+
position: relative;
|
|
109
|
+
flex: 1 1 0;
|
|
110
|
+
min-width: 0;
|
|
111
|
+
overflow: hidden;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* Highlight layer and textarea share the exact same box (offset for
|
|
115
|
+
padding via top/left, extending to the edges for horizontal scroll),
|
|
116
|
+
so the coloured text sits directly under the caret. */
|
|
117
|
+
.hl,
|
|
118
|
+
textarea {
|
|
119
|
+
position: absolute;
|
|
120
|
+
top: 12px;
|
|
121
|
+
left: 16px;
|
|
122
|
+
right: 0;
|
|
123
|
+
bottom: 0;
|
|
124
|
+
margin: 0;
|
|
125
|
+
border: 0;
|
|
126
|
+
padding: 0;
|
|
127
|
+
font: inherit;
|
|
128
|
+
line-height: inherit;
|
|
129
|
+
tab-size: inherit;
|
|
130
|
+
white-space: pre;
|
|
131
|
+
word-wrap: normal;
|
|
132
|
+
overflow-wrap: normal;
|
|
133
|
+
box-sizing: border-box;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.hl {
|
|
137
|
+
overflow: hidden;
|
|
138
|
+
pointer-events: none;
|
|
53
139
|
color: var(--nile-colors-neutral-900, #101828);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.hl > code {
|
|
143
|
+
display: block;
|
|
144
|
+
will-change: transform;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
textarea {
|
|
148
|
+
width: auto;
|
|
149
|
+
resize: none;
|
|
150
|
+
outline: none;
|
|
151
|
+
overflow: auto;
|
|
54
152
|
background: transparent;
|
|
55
|
-
|
|
153
|
+
color: transparent;
|
|
154
|
+
caret-color: var(--nile-colors-neutral-900, #101828);
|
|
56
155
|
}
|
|
57
|
-
|
|
156
|
+
|
|
157
|
+
/* Must be translucent: the textarea's text is transparent and the
|
|
158
|
+
coloured code sits BEHIND it, so an opaque selection would hide the
|
|
159
|
+
text. A tint lets the highlighted code show through the selection. */
|
|
160
|
+
textarea::selection {
|
|
161
|
+
background: rgba(41, 112, 255, 0.3);
|
|
162
|
+
}
|
|
163
|
+
textarea::-moz-selection {
|
|
164
|
+
background: rgba(41, 112, 255, 0.3);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/* highlight.js token palette (Atom One Light), matching code blocks. */
|
|
168
|
+
.hl .hljs-comment,
|
|
169
|
+
.hl .hljs-quote { color: #a0a1a7; font-style: italic; }
|
|
170
|
+
.hl .hljs-keyword,
|
|
171
|
+
.hl .hljs-selector-tag,
|
|
172
|
+
.hl .hljs-doctag { color: #a626a4; }
|
|
173
|
+
.hl .hljs-name,
|
|
174
|
+
.hl .hljs-selector-id,
|
|
175
|
+
.hl .hljs-selector-class,
|
|
176
|
+
.hl .hljs-tag { color: #e45649; }
|
|
177
|
+
.hl .hljs-literal,
|
|
178
|
+
.hl .hljs-built_in { color: #0184bb; }
|
|
179
|
+
.hl .hljs-string,
|
|
180
|
+
.hl .hljs-attribute,
|
|
181
|
+
.hl .hljs-meta .hljs-string { color: #50a14f; }
|
|
182
|
+
.hl .hljs-attr,
|
|
183
|
+
.hl .hljs-variable,
|
|
184
|
+
.hl .hljs-type,
|
|
185
|
+
.hl .hljs-number { color: #986801; }
|
|
186
|
+
.hl .hljs-symbol,
|
|
187
|
+
.hl .hljs-meta,
|
|
188
|
+
.hl .hljs-title { color: #4078f2; }
|
|
189
|
+
|
|
190
|
+
/* Draggable divider between the code and preview panes. */
|
|
191
|
+
.gutter {
|
|
192
|
+
flex: 0 0 auto;
|
|
193
|
+
position: relative;
|
|
194
|
+
width: 1px;
|
|
195
|
+
align-self: stretch;
|
|
196
|
+
background: var(--nile-colors-neutral-300, #e4e7ec);
|
|
197
|
+
cursor: col-resize;
|
|
198
|
+
touch-action: none;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.gutter::before {
|
|
202
|
+
content: '';
|
|
203
|
+
position: absolute;
|
|
204
|
+
inset: 0 -4px;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.gutter:hover,
|
|
208
|
+
.body--dragging .gutter {
|
|
209
|
+
background: var(--ng-colors-bg-brand-primary, #2970ff);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.pane--preview {
|
|
213
|
+
flex: 1 1 0;
|
|
214
|
+
overflow: auto;
|
|
215
|
+
border-left: 1px solid var(--nile-colors-neutral-200, #eaecf0);
|
|
216
|
+
background: var(--nile-colors-white-base, #ffffff);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
nile-wysiwyg-preview {
|
|
220
|
+
display: block;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.preview-empty {
|
|
224
|
+
display: block;
|
|
225
|
+
padding: 12px 16px;
|
|
226
|
+
color: var(--nile-colors-neutral-500, #98a2b3);
|
|
227
|
+
font-size: 12px;
|
|
228
|
+
opacity: 0.7;
|
|
229
|
+
}
|
|
230
|
+
`]}willUpdate(e){e.has("value")&&(this.draft=this.value)}get currentValue(){return this.draft}focusInput(){this.updateComplete.then((()=>this.textarea?.focus()))}get highlighted(){if(!this.draft)return"";try{return h.highlight(this.draft,{language:"xml"}).value}catch{return this.draft.replace(/[&<>]/g,(e=>({"&":"&","<":"<",">":">"}[e])))}}get lineCount(){return this.draft?this.draft.split("\n").length:1}render(){const e=p(this.draft),t=[];for(let e=1;e<=this.lineCount;e+=1)t.push(i`<div>${e}</div>`);return i`
|
|
58
231
|
<div class="bar" part="source-bar">
|
|
59
|
-
<span>HTML
|
|
232
|
+
<span>HTML</span>
|
|
60
233
|
<span class="actions">
|
|
61
234
|
<button type="button" @click=${()=>this.emit("wysiwyg-source-cancel")}>
|
|
62
235
|
Cancel
|
|
@@ -64,16 +237,44 @@ import{__decorate as e}from"tslib";import{css as t,html as r}from"lit";import{pr
|
|
|
64
237
|
<button
|
|
65
238
|
type="button"
|
|
66
239
|
class="primary"
|
|
67
|
-
@click=${()=>this.emit("wysiwyg-source-apply",{html:this.
|
|
240
|
+
@click=${()=>this.emit("wysiwyg-source-apply",{html:this.draft})}
|
|
68
241
|
>
|
|
69
242
|
Done
|
|
70
243
|
</button>
|
|
71
244
|
</span>
|
|
72
245
|
</div>
|
|
73
|
-
<
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
246
|
+
<div class=${n({body:!0,"body--dragging":this.splitDragging})}>
|
|
247
|
+
<div class="pane pane--code" style="flex: 0 0 ${100*this.splitRatio}%">
|
|
248
|
+
<div class="linenos" part="line-numbers" aria-hidden="true">
|
|
249
|
+
<div class="linenos-inner">${t}</div>
|
|
250
|
+
</div>
|
|
251
|
+
<div class="input-wrap">
|
|
252
|
+
<pre class="hl" aria-hidden="true"><code>${a(this.highlighted)}</code></pre>
|
|
253
|
+
<textarea
|
|
254
|
+
part="source-textarea"
|
|
255
|
+
spellcheck="false"
|
|
256
|
+
autocapitalize="off"
|
|
257
|
+
autocomplete="off"
|
|
258
|
+
wrap="off"
|
|
259
|
+
.value=${this.value}
|
|
260
|
+
@input=${this.onInput}
|
|
261
|
+
@scroll=${this.onScroll}
|
|
262
|
+
@keydown=${e=>{"Escape"===e.key&&(e.stopPropagation(),this.emit("wysiwyg-source-cancel"))}}
|
|
263
|
+
></textarea>
|
|
264
|
+
</div>
|
|
265
|
+
</div>
|
|
266
|
+
<div
|
|
267
|
+
class="gutter"
|
|
268
|
+
part="gutter"
|
|
269
|
+
role="separator"
|
|
270
|
+
aria-orientation="vertical"
|
|
271
|
+
aria-label="Resize source and preview"
|
|
272
|
+
title="Drag to resize · double-click to reset"
|
|
273
|
+
@pointerdown=${this.startSplitDrag}
|
|
274
|
+
@dblclick=${this.resetSplit}
|
|
275
|
+
></div>
|
|
276
|
+
<div class="pane pane--preview" part="preview">
|
|
277
|
+
${this.draft.trim()?i`<nile-wysiwyg-preview .content=${e}></nile-wysiwyg-preview>`:i`<span class="preview-empty">Nothing to preview</span>`}
|
|
278
|
+
</div>
|
|
279
|
+
</div>
|
|
280
|
+
`}};e([r({type:String})],g.prototype,"value",void 0),e([o("textarea")],g.prototype,"textarea",void 0),e([o(".hl > code")],g.prototype,"highlightEl",void 0),e([o(".linenos-inner")],g.prototype,"linenosEl",void 0),e([o(".body")],g.prototype,"bodyEl",void 0),e([s()],g.prototype,"draft",void 0),e([s()],g.prototype,"splitRatio",void 0),e([s()],g.prototype,"splitDragging",void 0),g=e([l("nile-wysiwyg-source-view")],g);
|
|
@@ -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 i,
|
|
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,i,s,e,r,o,n,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,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 _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){i=_lit.css;s=_lit.html;},function(_litDecoratorsJs){e=_litDecoratorsJs.property;r=_litDecoratorsJs.state;o=_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.open=!1,_this.items=[],_this.activeIndex=0;return _this;}_inherits(a,_n);return _createClass(a,[{key:"willUpdate",value:function willUpdate(){this.activeIndex>=this.items.length&&(this.activeIndex=0);}},{key:"updated",value:function updated(t){if(t.has("activeIndex")||t.has("items")){var _t=this.renderRoot.querySelector(".item.active");_t===null||_t===void 0||_t.scrollIntoView({block:"nearest"});}}},{key:"next",value:function next(){this.items.length&&(this.activeIndex=(this.activeIndex+1)%this.items.length);}},{key:"prev",value:function prev(){this.items.length&&(this.activeIndex=(this.activeIndex-1+this.items.length)%this.items.length);}},{key:"resetActive",value:function resetActive(){this.activeIndex=0;}},{key:"selectCurrent",value:function selectCurrent(){var t=this.items[this.activeIndex];return!!t&&(this.emit("wysiwyg-suggest-select",{item:t}),!0);}},{key:"render",value:function render(){var _this2=this;return s(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div class=\"list\" part=\"suggest-list\" @mousedown=",">\n ","\n </div>\n "])),function(t){return t.preventDefault();},this.items.length?this.items.map(function(t,i){return s(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <div\n class=\"item ","\"\n @mouseenter=","\n @click=","\n >\n <span>","</span>\n ","\n </div>\n "])),i===_this2.activeIndex?"active":"",function(){_this2.activeIndex=i;},function(){return _this2.selectCurrent();},t.label,t.hint?s(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<span class=\"hint\">","</span>"])),t.hint):"");}):s(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["<div class=\"empty\">No results</div>"]))));}}],[{key:"styles",get:function get(){return[i(_templateObject5||(_templateObject5=_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: 25;\n display: none;\n }\n\n :host([open]) {\n display: block;\n }\n\n .list {\n min-width: 200px;\n max-width: 320px;\n max-height: 240px;\n overflow-y: auto;\n padding: 4px;\n background: var(--nile-wysiwyg-popover-bg, #ffffff);\n border: 1px solid var(--nile-colors-neutral-400, #d0d5dd);\n border-radius: 8px;\n box-shadow: var(--nile-wysiwyg-popover-shadow, 0 4px 12px rgba(16, 24, 40, 0.12));\n font-size: 13px;\n }\n\n .item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n padding: 6px 8px;\n border-radius: 5px;\n cursor: pointer;\n color: var(--nile-colors-neutral-700, #344054);\n }\n\n .item.active {\n background: var(--nile-colors-primary-50, var(--ng-componentcolors-utility-blue-50, #eff4ff));\n color: var(--nile-colors-primary-700, var(--ng-componentcolors-utility-blue-700, #1d4ed8));\n }\n\n .hint {\n font-size: 11px;\n color: var(--nile-colors-neutral-500, #98a2b3);\n }\n\n .empty {\n padding: 6px 8px;\n color: var(--nile-colors-neutral-500, #98a2b3);\n }\n "])))];}}]);}(n);t([e({type:Boolean,reflect:!0})],a.prototype,"open",void 0),t([e({attribute:!1})],a.prototype,"items",void 0),t([r()],a.prototype,"activeIndex",void 0),a=t([o("nile-wysiwyg-suggest-list")],a);}};});
|
|
2
2
|
//# sourceMappingURL=suggest-list.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggest-list.cjs.js","sources":["../../../../src/nile-wysiwyg-editor/ui/suggest-list.ts"],"sourcesContent":["import { html, css, TemplateResult, CSSResultArray } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport NileElement from '../../internal/nile-element';\n\nexport interface SuggestItem {\n key: string;\n label: string;\n /** Secondary text shown right-aligned (e.g. slash-command hint). */\n hint?: string;\n}\n\n/**\n * Keyboard-navigable suggestion popup shared by mentions and slash commands.\n * The host positions it, feeds `items`, and drives navigation through\n * next()/prev()/selectCurrent(); picking an item emits\n * `wysiwyg-suggest-select` with the item.\n */\n@customElement('nile-wysiwyg-suggest-list')\nexport class NileWysiwygSuggestList extends NileElement {\n @property({ type: Boolean, reflect: true }) open = false;\n\n @property({ attribute: false }) items: SuggestItem[] = [];\n\n @state() private activeIndex = 0;\n\n public static get styles(): CSSResultArray {\n return [\n css`\n :host {\n font-family: var(\n --nile-font-family-sans-serif,\n var(--ng-font-family-body, system-ui, -apple-system, sans-serif)\n );\n position: absolute;\n z-index: 25;\n display: none;\n }\n\n :host([open]) {\n display: block;\n }\n\n .list {\n min-width: 200px;\n max-width: 320px;\n max-height: 240px;\n overflow-y: auto;\n padding: 4px;\n background: var(--nile-wysiwyg-popover-bg, #ffffff);\n border: 1px solid var(--nile-colors-neutral-400, #d0d5dd);\n border-radius: 8px;\n box-shadow: var(--nile-wysiwyg-popover-shadow, 0 4px 12px rgba(16, 24, 40, 0.12));\n font-size: 13px;\n }\n\n .item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n padding: 6px 8px;\n border-radius: 5px;\n cursor: pointer;\n color: var(--nile-colors-neutral-700, #344054);\n }\n\n .item.active {\n background: var(--nile-colors-primary-50, var(--ng-componentcolors-utility-blue-50, #eff4ff));\n color: var(--nile-colors-primary-700, var(--ng-componentcolors-utility-blue-700, #1d4ed8));\n }\n\n .hint {\n font-size: 11px;\n color: var(--nile-colors-neutral-500, #98a2b3);\n }\n\n .empty {\n padding: 6px 8px;\n color: var(--nile-colors-neutral-500, #98a2b3);\n }\n `,\n ];\n }\n\n protected willUpdate(): void {\n if (this.activeIndex >= this.items.length) this.activeIndex = 0;\n }\n\n public next(): void {\n if (this.items.length) this.activeIndex = (this.activeIndex + 1) % this.items.length;\n }\n\n public prev(): void {\n if (this.items.length) {\n this.activeIndex = (this.activeIndex - 1 + this.items.length) % this.items.length;\n }\n }\n\n public resetActive(): void {\n this.activeIndex = 0;\n }\n\n public selectCurrent(): boolean {\n const item = this.items[this.activeIndex];\n if (!item) return false;\n this.emit('wysiwyg-suggest-select', { item });\n return true;\n }\n\n public render(): TemplateResult {\n return html`\n <div class=\"list\" part=\"suggest-list\" @mousedown=${(e: Event) => e.preventDefault()}>\n ${this.items.length\n ? this.items.map(\n (item, index) => html`\n <div\n class=\"item ${index === this.activeIndex ? 'active' : ''}\"\n @mouseenter=${() => {\n this.activeIndex = index;\n }}\n @click=${() => this.selectCurrent()}\n >\n <span>${item.label}</span>\n ${item.hint ? html`<span class=\"hint\">${item.hint}</span>` : ''}\n </div>\n `\n )\n : html`<div class=\"empty\">No results</div>`}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-wysiwyg-suggest-list': NileWysiwygSuggestList;\n }\n}\n"],"names":["NileWysiwygSuggestList","a","constructor","this","open","items","activeIndex","_this","_inherits","_n","_createClass","key","value","willUpdate","length","next","prev","resetActive","selectCurrent","item","emit","render","html","_templateObject","_taggedTemplateLiteral","e","preventDefault","map","index","_templateObject2","label","hint","_templateObject3","_templateObject4","get","css","_templateObject5","NileElement","__decorate","property","type","Boolean","reflect","prototype","attribute","state","customElement"],"mappings":"q8GAkBaA,4BAAN,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,mCACuCC,EAAAA,KAAAA,CAAIC,IAAG,CAAA,CAAA,CAAA,CAEnBD,KAAAA,CAAKE,KAAkB,CAAA,EAAA,CAEtCF,KAAAA,CAAWG,WAAAA,CAAG,
|
|
1
|
+
{"version":3,"file":"suggest-list.cjs.js","sources":["../../../../src/nile-wysiwyg-editor/ui/suggest-list.ts"],"sourcesContent":["import { html, css, TemplateResult, CSSResultArray } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport NileElement from '../../internal/nile-element';\n\nexport interface SuggestItem {\n key: string;\n label: string;\n /** Secondary text shown right-aligned (e.g. slash-command hint). */\n hint?: string;\n}\n\n/**\n * Keyboard-navigable suggestion popup shared by mentions and slash commands.\n * The host positions it, feeds `items`, and drives navigation through\n * next()/prev()/selectCurrent(); picking an item emits\n * `wysiwyg-suggest-select` with the item.\n */\n@customElement('nile-wysiwyg-suggest-list')\nexport class NileWysiwygSuggestList extends NileElement {\n @property({ type: Boolean, reflect: true }) open = false;\n\n @property({ attribute: false }) items: SuggestItem[] = [];\n\n @state() private activeIndex = 0;\n\n public static get styles(): CSSResultArray {\n return [\n css`\n :host {\n font-family: var(\n --nile-font-family-sans-serif,\n var(--ng-font-family-body, system-ui, -apple-system, sans-serif)\n );\n position: absolute;\n z-index: 25;\n display: none;\n }\n\n :host([open]) {\n display: block;\n }\n\n .list {\n min-width: 200px;\n max-width: 320px;\n max-height: 240px;\n overflow-y: auto;\n padding: 4px;\n background: var(--nile-wysiwyg-popover-bg, #ffffff);\n border: 1px solid var(--nile-colors-neutral-400, #d0d5dd);\n border-radius: 8px;\n box-shadow: var(--nile-wysiwyg-popover-shadow, 0 4px 12px rgba(16, 24, 40, 0.12));\n font-size: 13px;\n }\n\n .item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n padding: 6px 8px;\n border-radius: 5px;\n cursor: pointer;\n color: var(--nile-colors-neutral-700, #344054);\n }\n\n .item.active {\n background: var(--nile-colors-primary-50, var(--ng-componentcolors-utility-blue-50, #eff4ff));\n color: var(--nile-colors-primary-700, var(--ng-componentcolors-utility-blue-700, #1d4ed8));\n }\n\n .hint {\n font-size: 11px;\n color: var(--nile-colors-neutral-500, #98a2b3);\n }\n\n .empty {\n padding: 6px 8px;\n color: var(--nile-colors-neutral-500, #98a2b3);\n }\n `,\n ];\n }\n\n protected willUpdate(): void {\n if (this.activeIndex >= this.items.length) this.activeIndex = 0;\n }\n\n protected updated(changed: Map<string, unknown>): void {\n // Keep the highlighted item visible as the user arrows through a list\n // that overflows the popup's max-height. `nearest` is a no-op when the\n // item is already visible (e.g. after a hover), so it never fights the mouse.\n if (changed.has('activeIndex') || changed.has('items')) {\n const active = this.renderRoot.querySelector('.item.active');\n (active as HTMLElement | null)?.scrollIntoView({ block: 'nearest' });\n }\n }\n\n public next(): void {\n if (this.items.length) this.activeIndex = (this.activeIndex + 1) % this.items.length;\n }\n\n public prev(): void {\n if (this.items.length) {\n this.activeIndex = (this.activeIndex - 1 + this.items.length) % this.items.length;\n }\n }\n\n public resetActive(): void {\n this.activeIndex = 0;\n }\n\n public selectCurrent(): boolean {\n const item = this.items[this.activeIndex];\n if (!item) return false;\n this.emit('wysiwyg-suggest-select', { item });\n return true;\n }\n\n public render(): TemplateResult {\n return html`\n <div class=\"list\" part=\"suggest-list\" @mousedown=${(e: Event) => e.preventDefault()}>\n ${this.items.length\n ? this.items.map(\n (item, index) => html`\n <div\n class=\"item ${index === this.activeIndex ? 'active' : ''}\"\n @mouseenter=${() => {\n this.activeIndex = index;\n }}\n @click=${() => this.selectCurrent()}\n >\n <span>${item.label}</span>\n ${item.hint ? html`<span class=\"hint\">${item.hint}</span>` : ''}\n </div>\n `\n )\n : html`<div class=\"empty\">No results</div>`}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-wysiwyg-suggest-list': NileWysiwygSuggestList;\n }\n}\n"],"names":["NileWysiwygSuggestList","a","constructor","this","open","items","activeIndex","_this","_inherits","_n","_createClass","key","value","willUpdate","length","updated","changed","has","active","renderRoot","querySelector","scrollIntoView","block","next","prev","resetActive","selectCurrent","item","emit","t","render","html","_templateObject","_taggedTemplateLiteral","e","preventDefault","map","index","_templateObject2","label","hint","_templateObject3","_templateObject4","get","css","_templateObject5","NileElement","__decorate","property","type","Boolean","reflect","prototype","attribute","state","customElement"],"mappings":"q8GAkBaA,4BAAN,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,mCACuCC,EAAAA,KAAAA,CAAIC,IAAG,CAAA,CAAA,CAAA,CAEnBD,KAAAA,CAAKE,KAAkB,CAAA,EAAA,CAEtCF,KAAA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,SAAA,CAAA,MAAA,CAAA,IAAA,EAEzBL,CAAAA,CAAAA,CAAAA,CAAA,CAA/BC,CAAS,CAAA,CAAEK,SAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAmCrD,CAAAoD,CAAAA,SAAAA,CAAA,OAAA,CAAA,IAAA,EAAA,CAAA,CAEzCL,EAAA,CAAhBO,CAAAA,CAAAA,CAAAA,CAAAA,CAAgCtD,CAAAoD,CAAAA,SAAAA,CAAA,kBAAA,EALtBpD,CAAAA,CAAAA,CAAAA,CAAsB+C,CAAA,CAAA,CADlCQ,EAAc,2BACFvD,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{__decorate as
|
|
1
|
+
import{__decorate as t}from"tslib";import{css as i,html as s}from"lit";import{property as e,state as r,customElement as o}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.open=!1,this.items=[],this.activeIndex=0}static get styles(){return[i`
|
|
2
2
|
:host {
|
|
3
3
|
font-family: var(
|
|
4
4
|
--nile-font-family-sans-serif,
|
|
@@ -51,17 +51,17 @@ import{__decorate as i}from"tslib";import{css as t,html as s}from"lit";import{pr
|
|
|
51
51
|
padding: 6px 8px;
|
|
52
52
|
color: var(--nile-colors-neutral-500, #98a2b3);
|
|
53
53
|
}
|
|
54
|
-
`]}willUpdate(){this.activeIndex>=this.items.length&&(this.activeIndex=0)}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
|
|
55
|
-
<div class="list" part="suggest-list" @mousedown=${
|
|
56
|
-
${this.items.length?this.items.map(((i
|
|
54
|
+
`]}willUpdate(){this.activeIndex>=this.items.length&&(this.activeIndex=0)}updated(t){if(t.has("activeIndex")||t.has("items")){const t=this.renderRoot.querySelector(".item.active");t?.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 t=this.items[this.activeIndex];return!!t&&(this.emit("wysiwyg-suggest-select",{item:t}),!0)}render(){return s`
|
|
55
|
+
<div class="list" part="suggest-list" @mousedown=${t=>t.preventDefault()}>
|
|
56
|
+
${this.items.length?this.items.map(((t,i)=>s`
|
|
57
57
|
<div
|
|
58
|
-
class="item ${
|
|
59
|
-
@mouseenter=${()=>{this.activeIndex=
|
|
58
|
+
class="item ${i===this.activeIndex?"active":""}"
|
|
59
|
+
@mouseenter=${()=>{this.activeIndex=i}}
|
|
60
60
|
@click=${()=>this.selectCurrent()}
|
|
61
61
|
>
|
|
62
|
-
<span>${
|
|
63
|
-
${
|
|
62
|
+
<span>${t.label}</span>
|
|
63
|
+
${t.hint?s`<span class="hint">${t.hint}</span>`:""}
|
|
64
64
|
</div>
|
|
65
65
|
`)):s`<div class="empty">No results</div>`}
|
|
66
66
|
</div>
|
|
67
|
-
`}};
|
|
67
|
+
`}};t([e({type:Boolean,reflect:!0})],a.prototype,"open",void 0),t([e({attribute:!1})],a.prototype,"items",void 0),t([r()],a.prototype,"activeIndex",void 0),a=t([o("nile-wysiwyg-suggest-list")],a);
|
|
@@ -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 e,i,r,t,s,o,l,_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){e=_tslib.__decorate;},function(_lit){i=_lit.css;r=_lit.html;},function(_litDecoratorsJs){t=_litDecoratorsJs.property;s=_litDecoratorsJs.state;o=_litDecoratorsJs.customElement;},function(_internalNileElementCjsJs){l=_internalNileElementCjsJs.N;},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){}],execute:function execute(){a=/*#__PURE__*/function(_l){function a(){var _this;_classCallCheck(this,a);_this=_callSuper(this,a,arguments),_this.disabled=!1,_this.open=!1,_this.hoverRows=0,_this.hoverCols=0,_this.handleOutside=function(e){_this.open&&!e.composedPath().includes(_assertThisInitialized(_this))&&(_this.open=!1);};return _this;}_inherits(a,_l);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(e,i){this.open=!1,this.emit("wysiwyg-command",{name:"insertTable",attrs:{rows:e,cols:i,withHeaderRow:!0}});}},{key:"render",value:function render(){var _this2=this;var e=[];var _loop=function _loop(_i){var _loop2=function _loop2(_t){e.push(r(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n <span\n class=\"cell ","\"\n @mouseenter=","\n @click=","\n ></span>\n "])),_i<=_this2.hoverRows&&_t<=_this2.hoverCols?"hot":"",function(){_this2.hoverRows=_i,_this2.hoverCols=_t;},function(){return _this2.pick(_i,_t);}));};for(var _t=1;_t<=10;_t+=1){_loop2(_t);}};for(var _i=1;_i<=8;_i+=1){_loop(_i);}return r(_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(e){return e.preventDefault();},function(){_this2.open=!_this2.open,_this2.hoverRows=0,_this2.hoverCols=0;},this.open?r(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <div class=\"panel\" @mousedown=",">\n <div class=\"grid\">","</div>\n <div class=\"label\">\n ","\n </div>\n </div>\n "])),function(e){return e.preventDefault();},e,this.hoverRows>0?"".concat(this.hoverRows," \xD7 ").concat(this.hoverCols):"Pick a size"):"");}}],[{key:"styles",get:function get(){return[i(_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, #101828));\n }\n\n button.trigger:hover:not(:disabled) {\n background: var(--nile-colors-neutral-100, #f2f4f7);\n }\n\n button.trigger:disabled {\n opacity: 0.4;\n cursor: default;\n }\n\n .panel {\n position: absolute;\n top: calc(100% + 4px);\n left: 0;\n z-index: 30;\n padding: 8px;\n background: var(--nile-wysiwyg-popover-bg, #ffffff);\n border: 1px solid var(--nile-colors-neutral-400, #d0d5dd);\n border-radius: 8px;\n box-shadow: var(--nile-wysiwyg-popover-shadow, 0 4px 12px rgba(16, 24, 40, 0.12));\n }\n\n .grid {\n display: grid;\n grid-template-columns: repeat(",", 14px);\n gap: 2px;\n }\n\n .cell {\n width: 14px;\n height: 14px;\n border: 1px solid var(--nile-colors-neutral-300, #d0d5dd);\n border-radius: 2px;\n box-sizing: border-box;\n cursor: pointer;\n }\n\n .cell.hot {\n background: var(--nile-colors-primary-100, var(--ng-componentcolors-utility-blue-100, #dbeafe));\n border-color: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600, #2563eb));\n }\n\n .label {\n margin-top: 6px;\n text-align: center;\n font-size: 12px;\n color: var(--nile-colors-neutral-600, #475467);\n }\n "])),10)];}}]);}(l);e([t({type:Boolean,reflect:!0})],a.prototype,"disabled",void 0),e([s()],a.prototype,"open",void 0),e([s()],a.prototype,"hoverRows",void 0),e([s()],a.prototype,"hoverCols",void 0),a=e([o("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,e,i,r,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){e=_lit.css;i=_lit.html;},function(_litDecoratorsJs){r=_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,e){this.open=!1,this.customRows="",this.customCols="",this.emit("wysiwyg-command",{name:"insertTable",attrs:{rows:t,cols:e,withHeaderRow:!0}});}},{key:"clamp",value:function clamp(t,e){var i=parseInt(t,10);return!Number.isFinite(i)||i<1?0:Math.min(i,e);}},{key:"insertCustom",value:function insertCustom(){var t=this.clamp(this.customRows,this.maxRows),e=this.clamp(this.customCols,this.maxCols);t>=1&&e>=1&&this.pick(t,e);}},{key:"render",value:function render(){var _this2=this;var t=Math.min(Math.max(5,this.hoverRows+1),this.maxRows),e=Math.min(Math.max(5,this.hoverCols+1),this.maxCols),r=[];var _loop=function _loop(_o){var _loop2=function _loop2(_t){r.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<=e;_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 "])),e,function(t){return t.preventDefault();},function(){_this2.hoverRows=0,_this2.hoverCols=0;},r,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[e(_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, #101828));\n }\n\n button.trigger:hover:not(:disabled) {\n background: var(--nile-colors-neutral-100, #f2f4f7);\n }\n\n button.trigger:disabled {\n opacity: 0.4;\n cursor: default;\n }\n\n .panel {\n position: absolute;\n top: calc(100% + 4px);\n left: 0;\n z-index: 30;\n padding: 8px;\n background: var(--nile-wysiwyg-popover-bg, #ffffff);\n border: 1px solid var(--nile-colors-neutral-400, #d0d5dd);\n border-radius: 8px;\n box-shadow: var(--nile-wysiwyg-popover-shadow, 0 4px 12px rgba(16, 24, 40, 0.12));\n }\n\n .grid {\n display: grid;\n gap: 2px;\n }\n\n .cell {\n width: 14px;\n height: 14px;\n border: 1px solid var(--nile-colors-neutral-300, #d0d5dd);\n border-radius: 2px;\n box-sizing: border-box;\n cursor: pointer;\n }\n\n .cell.hot {\n background: var(--nile-colors-primary-100, var(--ng-componentcolors-utility-blue-100, #dbeafe));\n border-color: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600, #2563eb));\n }\n\n .label {\n margin-top: 6px;\n text-align: center;\n font-size: 12px;\n color: var(--nile-colors-neutral-600, #475467);\n }\n\n .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, #e4e7ec);\n }\n\n .custom input {\n width: 44px;\n height: 26px;\n padding: 0 6px;\n border: 1px solid var(--nile-colors-neutral-400, #d0d5dd);\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, #101828));\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, #2563eb));\n }\n\n .custom .times {\n font-size: 12px;\n color: var(--nile-colors-neutral-600, #475467);\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, #2563eb));\n color: #ffffff;\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, #1d4ed8);\n }\n\n .custom button.insert:disabled {\n opacity: 0.4;\n cursor: default;\n }\n "])))];}}]);}(n);t([r({type:Boolean,reflect:!0})],a.prototype,"disabled",void 0),t([r({type:Number,attribute:"max-rows",reflect:!0})],a.prototype,"maxRows",void 0),t([r({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\nconst MAX_ROWS = 8;\nconst MAX_COLS = 10;\n\n/**\n * Toolbar item: a table button that opens an N×M hover grid. Picking a cell\n * emits `wysiwyg-command` with `insertTable { rows, cols }`.\n */\n@customElement('nile-wysiwyg-table-picker')\nexport class NileWysiwygTablePicker extends NileElement {\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n @state() private open = false;\n\n @state() private hoverRows = 0;\n\n @state() private hoverCols = 0;\n\n public static get styles(): CSSResultArray {\n return [\n css`\n :host {\n font-family: var(\n --nile-font-family-sans-serif,\n var(--ng-font-family-body, system-ui, -apple-system, sans-serif)\n );\n position: relative;\n display: inline-flex;\n }\n\n button.trigger {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n padding: 0 6px;\n box-sizing: border-box;\n border: none;\n border-radius: var(--nile-radius-radius-lg, var(--ng-radius-md, 8px));\n background: transparent;\n cursor: pointer;\n color: var(--nile-colors-dark-900, var(--ng-colors-text-primary-900, #101828));\n }\n\n button.trigger:hover:not(:disabled) {\n background: var(--nile-colors-neutral-100, #f2f4f7);\n }\n\n button.trigger:disabled {\n opacity: 0.4;\n cursor: default;\n }\n\n .panel {\n position: absolute;\n top: calc(100% + 4px);\n left: 0;\n z-index: 30;\n padding: 8px;\n background: var(--nile-wysiwyg-popover-bg, #ffffff);\n border: 1px solid var(--nile-colors-neutral-400, #d0d5dd);\n border-radius: 8px;\n box-shadow: var(--nile-wysiwyg-popover-shadow, 0 4px 12px rgba(16, 24, 40, 0.12));\n }\n\n .grid {\n display: grid;\n grid-template-columns: repeat(${MAX_COLS}, 14px);\n gap: 2px;\n }\n\n .cell {\n width: 14px;\n height: 14px;\n border: 1px solid var(--nile-colors-neutral-300, #d0d5dd);\n border-radius: 2px;\n box-sizing: border-box;\n cursor: pointer;\n }\n\n .cell.hot {\n background: var(--nile-colors-primary-100, var(--ng-componentcolors-utility-blue-100, #dbeafe));\n border-color: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600, #2563eb));\n }\n\n .label {\n margin-top: 6px;\n text-align: center;\n font-size: 12px;\n color: var(--nile-colors-neutral-600, #475467);\n }\n `,\n ];\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n document.addEventListener('mousedown', this.handleOutside);\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n document.removeEventListener('mousedown', this.handleOutside);\n }\n\n private handleOutside = (event: MouseEvent): void => {\n if (this.open && !event.composedPath().includes(this)) this.open = false;\n };\n\n private pick(rows: number, cols: number): void {\n this.open = false;\n this.emit('wysiwyg-command', {\n name: 'insertTable',\n attrs: { rows, cols, withHeaderRow: true },\n });\n }\n\n public render(): TemplateResult {\n const cells: TemplateResult[] = [];\n for (let r = 1; r <= MAX_ROWS; r += 1) {\n for (let c = 1; c <= MAX_COLS; c += 1) {\n cells.push(html`\n <span\n class=\"cell ${r <= this.hoverRows && c <= this.hoverCols ? 'hot' : ''}\"\n @mouseenter=${() => {\n this.hoverRows = r;\n this.hoverCols = c;\n }}\n @click=${() => this.pick(r, c)}\n ></span>\n `);\n }\n }\n return html`\n <button\n type=\"button\"\n class=\"trigger\"\n part=\"button\"\n aria-label=\"Insert table\"\n aria-expanded=${this.open ? 'true' : 'false'}\n ?disabled=${this.disabled}\n @mousedown=${(e: Event) => e.preventDefault()}\n @click=${() => {\n this.open = !this.open;\n this.hoverRows = 0;\n this.hoverCols = 0;\n }}\n >\n <nile-glyph name=\"grid-01\" size=\"18\" method=\"stroke\"></nile-glyph>\n </button>\n ${this.open\n ? html`\n <div class=\"panel\" @mousedown=${(e: Event) => e.preventDefault()}>\n <div class=\"grid\">${cells}</div>\n <div class=\"label\">\n ${this.hoverRows > 0 ? `${this.hoverRows} × ${this.hoverCols}` : 'Pick a size'}\n </div>\n </div>\n `\n : ''}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-wysiwyg-table-picker': NileWysiwygTablePicker;\n }\n}\n"],"names":["NileWysiwygTablePicker","_l","a","this","disabled","open","hoverRows","hoverCols","handleOutside","event","composedPath","includes","_this","_inherits","_createClass","key","value","connectedCallback","super","document","addEventListener","disconnectedCallback","removeEventListener","pick","rows","cols","emit","name","attrs","withHeaderRow","render","_this2","cells","_loop","_i","_loop2","_t","push","html","_templateObject3","_taggedTemplateLiteral","r","c","_templateObject","e","preventDefault","_templateObject2","concat","get","styles","css","_templateObject4","NileElement","__decorate","property","type","Boolean","reflect","prototype","state","customElement"],"mappings":"i8HAYaA,CAAN,uBAAAC,EAAA,EAAA,SAAAC,EAAA,uEACuCC,KAAAA,CAAQC,QAAAA,CAAAA,CAAG,CAEtCD,CAAAA,KAAAA,CAAIE,MAAG,CAEPF,CAAAA,KAAAA,CAASG,SAAG,CAAA,CAAA,CAEZH,KAAAA,CAASI,SAAAA,CAAG,EA0FrBJ,KAAAA,CAAAK,aAAAA,CAAiBC,SAAAA,CACnBN,CAAAA,CAAAA,KAAAA,CAAKE,IAASI,EAAAA,CAAAA,CAAAA,CAAMC,eAAeC,QAASR,CAAAA,sBA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AAA,GAAAA,gBAAA,CAAAX,sBAAA,6rEAlBQ,EAAA,EA4Fd,EAED,MAvF0CY,CAArC,EACuCC,EAAA,CAA3CC,CAAAA,CAAS,CAAEC,IAAAA,CAAMC,QAASC,OAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAyBzD,CAAA0D,CAAAA,SAAAA,CAAA,eAAA,EAE5CL,CAAAA,CAAAA,CAAAA,CAAA,CAAhBM,CAAAA,CAAAA,CAAAA,CAAAA,CAA6B3D,EAAA0D,SAAA,CAAA,MAAA,CAAA,IAAA,EAEbL,CAAAA,CAAAA,CAAAA,CAAA,CAAhBM,CAA8B3D,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA0D,SAAA,CAAA,WAAA,CAAA,IAAA,IAEdL,CAAA,CAAA,CAAhBM,CAA8B3D,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA0D,UAAA,WAAA,CAAA,IAAA,EAAA,CAAA,CAPpB1D,EAAsBqD,CAAA,CAAA,CADlCO,EAAc,2BACF5D,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, #101828));\n }\n\n button.trigger:hover:not(:disabled) {\n background: var(--nile-colors-neutral-100, #f2f4f7);\n }\n\n button.trigger:disabled {\n opacity: 0.4;\n cursor: default;\n }\n\n .panel {\n position: absolute;\n top: calc(100% + 4px);\n left: 0;\n z-index: 30;\n padding: 8px;\n background: var(--nile-wysiwyg-popover-bg, #ffffff);\n border: 1px solid var(--nile-colors-neutral-400, #d0d5dd);\n border-radius: 8px;\n box-shadow: var(--nile-wysiwyg-popover-shadow, 0 4px 12px rgba(16, 24, 40, 0.12));\n }\n\n .grid {\n display: grid;\n gap: 2px;\n }\n\n .cell {\n width: 14px;\n height: 14px;\n border: 1px solid var(--nile-colors-neutral-300, #d0d5dd);\n border-radius: 2px;\n box-sizing: border-box;\n cursor: pointer;\n }\n\n .cell.hot {\n background: var(--nile-colors-primary-100, var(--ng-componentcolors-utility-blue-100, #dbeafe));\n border-color: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600, #2563eb));\n }\n\n .label {\n margin-top: 6px;\n text-align: center;\n font-size: 12px;\n color: var(--nile-colors-neutral-600, #475467);\n }\n\n .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, #e4e7ec);\n }\n\n .custom input {\n width: 44px;\n height: 26px;\n padding: 0 6px;\n border: 1px solid var(--nile-colors-neutral-400, #d0d5dd);\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, #101828));\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, #2563eb));\n }\n\n .custom .times {\n font-size: 12px;\n color: var(--nile-colors-neutral-600, #475467);\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, #2563eb));\n color: #ffffff;\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, #1d4ed8);\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,CA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