@aquera/nile-elements 2.0.0 → 2.0.2
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 +11 -0
- package/demo/nxtgen-dark.css +2 -2
- package/dist/{index-ccff99d6.esm.js → index-0fe57384.esm.js} +1 -1
- package/dist/index-f6944844.cjs.js +2 -0
- package/dist/{index-e43755f5.cjs.js.map → index-f6944844.cjs.js.map} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1127 -741
- package/dist/nile-code-editor/extensionSetup.cjs.js +1 -1
- package/dist/nile-code-editor/extensionSetup.esm.js +1 -1
- package/dist/nile-code-editor/index.cjs.js +1 -1
- package/dist/nile-code-editor/index.esm.js +1 -1
- package/dist/nile-code-editor/nile-code-editor.cjs.js +2 -2
- package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
- package/dist/nile-code-editor/nile-code-editor.css.cjs.js +1 -1
- package/dist/nile-code-editor/nile-code-editor.css.cjs.js.map +1 -1
- package/dist/nile-code-editor/nile-code-editor.css.esm.js +2 -2
- package/dist/nile-code-editor/nile-code-editor.esm.js +4 -4
- package/dist/nile-code-editor/theme.cjs.js +1 -1
- package/dist/nile-code-editor/theme.cjs.js.map +1 -1
- package/dist/nile-code-editor/theme.esm.js +1 -1
- package/dist/nile-combobox/nile-combobox.css.cjs.js +1 -1
- package/dist/nile-combobox/nile-combobox.css.cjs.js.map +1 -1
- package/dist/nile-combobox/nile-combobox.css.esm.js +1 -1
- package/dist/nile-detail/nile-detail.css.cjs.js +1 -1
- package/dist/nile-detail/nile-detail.css.cjs.js.map +1 -1
- package/dist/nile-detail/nile-detail.css.esm.js +1 -1
- package/dist/nile-side-bar-footer/nile-side-bar-footer.css.cjs.js +1 -1
- package/dist/nile-side-bar-footer/nile-side-bar-footer.css.cjs.js.map +1 -1
- package/dist/nile-side-bar-footer/nile-side-bar-footer.css.esm.js +3 -3
- package/dist/nile-side-bar-footer-item/nile-side-bar-footer-item.css.cjs.js +1 -1
- package/dist/nile-side-bar-footer-item/nile-side-bar-footer-item.css.cjs.js.map +1 -1
- package/dist/nile-side-bar-footer-item/nile-side-bar-footer-item.css.esm.js +13 -7
- package/dist/nile-timestamp-builder/index.cjs.js +2 -0
- package/dist/nile-timestamp-builder/index.cjs.js.map +1 -0
- package/dist/nile-timestamp-builder/index.esm.js +1 -0
- package/dist/nile-timestamp-builder/nile-timestamp-builder-utils.cjs.js +2 -0
- package/dist/nile-timestamp-builder/nile-timestamp-builder-utils.cjs.js.map +1 -0
- package/dist/nile-timestamp-builder/nile-timestamp-builder-utils.esm.js +1 -0
- package/dist/nile-timestamp-builder/nile-timestamp-builder.cjs.js +2 -0
- package/dist/nile-timestamp-builder/nile-timestamp-builder.cjs.js.map +1 -0
- package/dist/nile-timestamp-builder/nile-timestamp-builder.css.cjs.js +2 -0
- package/dist/nile-timestamp-builder/nile-timestamp-builder.css.cjs.js.map +1 -0
- package/dist/nile-timestamp-builder/nile-timestamp-builder.css.esm.js +195 -0
- package/dist/nile-timestamp-builder/nile-timestamp-builder.esm.js +154 -0
- package/dist/nile-timestamp-builder/timezones.cjs.js +2 -0
- package/dist/nile-timestamp-builder/timezones.cjs.js.map +1 -0
- package/dist/nile-timestamp-builder/timezones.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 +91 -58
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.esm.js +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 +19 -19
- package/dist/nile-wysiwyg-editor/ui/bookmark-panel.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/bookmark-panel.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/bookmark-panel.esm.js +14 -14
- 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 +13 -13
- 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 +12 -12
- package/dist/nile-wysiwyg-editor/ui/embed-menu.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/embed-menu.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/embed-menu.esm.js +10 -10
- 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 +4 -4
- package/dist/nile-wysiwyg-editor/ui/emoji-picker.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/emoji-picker.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/emoji-picker.esm.js +11 -11
- package/dist/nile-wysiwyg-editor/ui/find-replace.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/find-replace.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/find-replace.esm.js +9 -9
- package/dist/nile-wysiwyg-editor/ui/image-menu.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/image-menu.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/image-menu.esm.js +11 -11
- package/dist/nile-wysiwyg-editor/ui/image-panel.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/image-panel.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/image-panel.esm.js +6 -6
- package/dist/nile-wysiwyg-editor/ui/insert-menu.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/insert-menu.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/insert-menu.esm.js +14 -14
- package/dist/nile-wysiwyg-editor/ui/link-editor.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/link-editor.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/link-editor.esm.js +16 -16
- package/dist/nile-wysiwyg-editor/ui/markdown-panel.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/markdown-panel.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/markdown-panel.esm.js +8 -8
- 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 +4 -4
- package/dist/nile-wysiwyg-editor/ui/shortcut-help.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/shortcut-help.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/shortcut-help.esm.js +16 -16
- 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 +29 -29
- package/dist/nile-wysiwyg-editor/ui/special-chars.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/special-chars.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/ui/special-chars.esm.js +8 -8
- 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 +23 -23
- 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 +7 -7
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/nile-code-editor/nile-code-editor.css.js +2 -2
- package/dist/src/nile-code-editor/nile-code-editor.css.js.map +1 -1
- package/dist/src/nile-code-editor/nile-code-editor.d.ts +15 -0
- package/dist/src/nile-code-editor/nile-code-editor.js +65 -6
- package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
- package/dist/src/nile-code-editor/theme.d.ts +6 -117
- package/dist/src/nile-code-editor/theme.js +100 -147
- package/dist/src/nile-code-editor/theme.js.map +1 -1
- package/dist/src/nile-combobox/nile-combobox.css.js +1 -1
- package/dist/src/nile-combobox/nile-combobox.css.js.map +1 -1
- package/dist/src/nile-detail/nile-detail.css.js +1 -1
- package/dist/src/nile-detail/nile-detail.css.js.map +1 -1
- package/dist/src/nile-side-bar-footer/nile-side-bar-footer.css.js +3 -3
- package/dist/src/nile-side-bar-footer/nile-side-bar-footer.css.js.map +1 -1
- package/dist/src/nile-side-bar-footer-item/nile-side-bar-footer-item.css.js +11 -5
- package/dist/src/nile-side-bar-footer-item/nile-side-bar-footer-item.css.js.map +1 -1
- package/dist/src/nile-timestamp-builder/index.d.ts +1 -0
- package/dist/src/nile-timestamp-builder/index.js +2 -0
- package/dist/src/nile-timestamp-builder/index.js.map +1 -0
- package/dist/src/nile-timestamp-builder/nile-timestamp-builder-utils.d.ts +54 -0
- package/dist/src/nile-timestamp-builder/nile-timestamp-builder-utils.js +254 -0
- package/dist/src/nile-timestamp-builder/nile-timestamp-builder-utils.js.map +1 -0
- package/dist/src/nile-timestamp-builder/nile-timestamp-builder.css.d.ts +7 -0
- package/dist/src/nile-timestamp-builder/nile-timestamp-builder.css.js +203 -0
- package/dist/src/nile-timestamp-builder/nile-timestamp-builder.css.js.map +1 -0
- package/dist/src/nile-timestamp-builder/nile-timestamp-builder.d.ts +94 -0
- package/dist/src/nile-timestamp-builder/nile-timestamp-builder.js +578 -0
- package/dist/src/nile-timestamp-builder/nile-timestamp-builder.js.map +1 -0
- package/dist/src/nile-timestamp-builder/nile-timestamp-builder.test.d.ts +1 -0
- package/dist/src/nile-timestamp-builder/nile-timestamp-builder.test.js +890 -0
- package/dist/src/nile-timestamp-builder/nile-timestamp-builder.test.js.map +1 -0
- package/dist/src/nile-timestamp-builder/timezones.d.ts +8 -0
- package/dist/src/nile-timestamp-builder/timezones.js +357 -0
- package/dist/src/nile-timestamp-builder/timezones.js.map +1 -0
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.js +91 -58
- 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 +2 -1
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js +23 -1
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.js +19 -19
- package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/bookmark-panel.js +10 -10
- package/dist/src/nile-wysiwyg-editor/ui/bookmark-panel.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.js +7 -7
- package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/code-block-menu.js +5 -5
- package/dist/src/nile-wysiwyg-editor/ui/code-block-menu.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/embed-menu.js +6 -6
- package/dist/src/nile-wysiwyg-editor/ui/embed-menu.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/embed-panel.js +4 -4
- package/dist/src/nile-wysiwyg-editor/ui/embed-panel.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/emoji-picker.js +6 -6
- package/dist/src/nile-wysiwyg-editor/ui/emoji-picker.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/find-replace.js +7 -7
- package/dist/src/nile-wysiwyg-editor/ui/find-replace.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/image-menu.js +6 -6
- package/dist/src/nile-wysiwyg-editor/ui/image-menu.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/image-panel.js +6 -6
- package/dist/src/nile-wysiwyg-editor/ui/image-panel.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/insert-menu.js +7 -7
- package/dist/src/nile-wysiwyg-editor/ui/insert-menu.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/link-editor.js +9 -9
- package/dist/src/nile-wysiwyg-editor/ui/link-editor.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/markdown-panel.js +8 -8
- package/dist/src/nile-wysiwyg-editor/ui/markdown-panel.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/math-panel.js +4 -4
- package/dist/src/nile-wysiwyg-editor/ui/math-panel.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/shortcut-help.js +9 -9
- package/dist/src/nile-wysiwyg-editor/ui/shortcut-help.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/source-view.js +24 -24
- package/dist/src/nile-wysiwyg-editor/ui/source-view.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/special-chars.js +4 -4
- package/dist/src/nile-wysiwyg-editor/ui/special-chars.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/suggest-list.js +7 -7
- package/dist/src/nile-wysiwyg-editor/ui/suggest-list.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.js +16 -16
- package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.js.map +1 -1
- package/dist/src/nile-wysiwyg-editor/ui/table-menu.js +4 -4
- package/dist/src/nile-wysiwyg-editor/ui/table-menu.js.map +1 -1
- package/dist/src/version.js +2 -2
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/nile-code-editor/nile-code-editor.css.ts +2 -2
- package/src/nile-code-editor/nile-code-editor.ts +68 -5
- package/src/nile-code-editor/theme.ts +129 -162
- package/src/nile-combobox/nile-combobox.css.ts +1 -1
- package/src/nile-detail/nile-detail.css.ts +1 -1
- package/src/nile-side-bar-footer/nile-side-bar-footer.css.ts +3 -3
- package/src/nile-side-bar-footer-item/nile-side-bar-footer-item.css.ts +11 -5
- package/src/nile-timestamp-builder/index.ts +1 -0
- package/src/nile-timestamp-builder/nile-timestamp-builder-utils.ts +321 -0
- package/src/nile-timestamp-builder/nile-timestamp-builder.css.ts +204 -0
- package/src/nile-timestamp-builder/nile-timestamp-builder.test.ts +1089 -0
- package/src/nile-timestamp-builder/nile-timestamp-builder.ts +625 -0
- package/src/nile-timestamp-builder/timezones.ts +356 -0
- package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.ts +91 -58
- package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.ts +21 -1
- package/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.ts +19 -19
- package/src/nile-wysiwyg-editor/ui/bookmark-panel.ts +10 -10
- package/src/nile-wysiwyg-editor/ui/bubble-menu.ts +7 -7
- package/src/nile-wysiwyg-editor/ui/code-block-menu.ts +5 -5
- package/src/nile-wysiwyg-editor/ui/embed-menu.ts +6 -6
- package/src/nile-wysiwyg-editor/ui/embed-panel.ts +4 -4
- package/src/nile-wysiwyg-editor/ui/emoji-picker.ts +6 -6
- package/src/nile-wysiwyg-editor/ui/find-replace.ts +7 -7
- package/src/nile-wysiwyg-editor/ui/image-menu.ts +6 -6
- package/src/nile-wysiwyg-editor/ui/image-panel.ts +6 -6
- package/src/nile-wysiwyg-editor/ui/insert-menu.ts +7 -7
- package/src/nile-wysiwyg-editor/ui/link-editor.ts +9 -9
- package/src/nile-wysiwyg-editor/ui/markdown-panel.ts +8 -8
- package/src/nile-wysiwyg-editor/ui/math-panel.ts +4 -4
- package/src/nile-wysiwyg-editor/ui/shortcut-help.ts +9 -9
- package/src/nile-wysiwyg-editor/ui/source-view.ts +24 -24
- package/src/nile-wysiwyg-editor/ui/special-chars.ts +4 -4
- package/src/nile-wysiwyg-editor/ui/suggest-list.ts +7 -7
- package/src/nile-wysiwyg-editor/ui/table-grid-picker.ts +16 -16
- package/src/nile-wysiwyg-editor/ui/table-menu.ts +4 -4
- package/vscode-html-custom-data.json +94 -2
- package/dist/index-e43755f5.cjs.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embed-panel.cjs.js","sources":["../../../../src/nile-wysiwyg-editor/ui/embed-panel.ts"],"sourcesContent":["import { html, css, TemplateResult, CSSResultArray } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport NileElement from '../../internal/nile-element';\nimport { toEmbedUrl } from '../engine/plugins/embeds';\nimport '../../nile-input/index';\nimport '../../nile-button/index';\n\n/**\n * Floating embed-insert panel: paste any https:// link (YouTube/Vimeo/Loom\n * are auto-formatted; anything else embeds as a sandboxed iframe). Styled to\n * match the image panel (nile-input + nile-button). Emits\n * `wysiwyg-embed-apply` detail: { src, provider } and `wysiwyg-embed-cancel`.\n */\n@customElement('nile-wysiwyg-embed-panel')\nexport class NileWysiwygEmbedPanel extends NileElement {\n @property({ type: Boolean, reflect: true }) open = false;\n\n @state() private urlValue = '';\n @state() private error = '';\n\n public static get styles(): CSSResultArray {\n return [\n css`\n :host {\n font-family: var(\n --nile-font-family-sans-serif,\n var(--ng-font-family-body, system-ui, -apple-system, sans-serif)\n );\n position: absolute;\n z-index: 20;\n display: none;\n }\n\n :host([open]) {\n display: block;\n }\n\n .embed-panel {\n display: flex;\n flex-direction: column;\n gap: 12px;\n min-width: 340px;\n max-width: 420px;\n padding: 12px;\n background: var(--nile-wysiwyg-popover-bg,
|
|
1
|
+
{"version":3,"file":"embed-panel.cjs.js","sources":["../../../../src/nile-wysiwyg-editor/ui/embed-panel.ts"],"sourcesContent":["import { html, css, TemplateResult, CSSResultArray } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport NileElement from '../../internal/nile-element';\nimport { toEmbedUrl } from '../engine/plugins/embeds';\nimport '../../nile-input/index';\nimport '../../nile-button/index';\n\n/**\n * Floating embed-insert panel: paste any https:// link (YouTube/Vimeo/Loom\n * are auto-formatted; anything else embeds as a sandboxed iframe). Styled to\n * match the image panel (nile-input + nile-button). Emits\n * `wysiwyg-embed-apply` detail: { src, provider } and `wysiwyg-embed-cancel`.\n */\n@customElement('nile-wysiwyg-embed-panel')\nexport class NileWysiwygEmbedPanel extends NileElement {\n @property({ type: Boolean, reflect: true }) open = false;\n\n @state() private urlValue = '';\n @state() private error = '';\n\n public static get styles(): CSSResultArray {\n return [\n css`\n :host {\n font-family: var(\n --nile-font-family-sans-serif,\n var(--ng-font-family-body, system-ui, -apple-system, sans-serif)\n );\n position: absolute;\n z-index: 20;\n display: none;\n }\n\n :host([open]) {\n display: block;\n }\n\n .embed-panel {\n display: flex;\n flex-direction: column;\n gap: 12px;\n min-width: 340px;\n max-width: 420px;\n padding: 12px;\n background: var(--nile-wysiwyg-popover-bg, var(--ng-colors-bg-primary));\n border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));\n border-radius: 8px;\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);\n font-size: 13px;\n }\n\n nile-input {\n width: 100%;\n }\n\n .hint {\n font-size: 12px;\n color: var(--nile-colors-neutral-500, var(--ng-colors-text-quaternary-500));\n }\n\n .error {\n font-size: 12px;\n color: var(--nile-colors-danger-600, var(--ng-componentcolors-utility-error-600));\n }\n\n .actions {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n gap: 8px;\n width: 100%;\n }\n `,\n ];\n }\n\n public focusInput(): void {\n this.updateComplete.then(() => {\n const input = this.shadowRoot?.querySelector('nile-input') as HTMLElement | null;\n input?.focus();\n });\n }\n\n /** Clears the field. */\n public reset(): void {\n this.urlValue = '';\n this.error = '';\n }\n\n private onUrl(event: CustomEvent): void {\n this.urlValue = (event.detail?.value ?? '') as string;\n this.error = '';\n }\n\n private handleSubmit(): void {\n const target = toEmbedUrl(this.urlValue.trim());\n if (!target) {\n this.error = 'Enter a valid https:// URL.';\n return;\n }\n this.error = '';\n this.emit('wysiwyg-embed-apply', target);\n }\n\n private handleKeydown(event: KeyboardEvent): void {\n if (event.key === 'Escape') {\n event.stopPropagation();\n this.emit('wysiwyg-embed-cancel');\n } else if (event.key === 'Enter') {\n event.preventDefault();\n event.stopPropagation();\n this.handleSubmit();\n }\n }\n\n public render(): TemplateResult {\n return html`\n <div class=\"embed-panel\" part=\"embed-panel\" @keydown=${this.handleKeydown}>\n <nile-input\n label=\"Video URL\"\n placeholder=\"https://www.youtube.com/watch?v=…\"\n .value=${this.urlValue}\n @nile-input=${this.onUrl}\n ></nile-input>\n\n ${this.error\n ? html`<span class=\"error\" part=\"error\">${this.error}</span>`\n : html`<span class=\"hint\">Add any link to it</span>`}\n\n <div class=\"actions\">\n <nile-button variant=\"primary\" @click=${() => this.handleSubmit()}\n >Embed</nile-button\n >\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-wysiwyg-embed-panel': NileWysiwygEmbedPanel;\n }\n}\n"],"names":["NileWysiwygEmbedPanel","_j","t","this","open","urlValue","error","_this","_inherits","_createClass","key","value","focusInput","updateComplete","then","input","shadowRoot","querySelector","focus","reset","onUrl","event","detail","handleSubmit","target","toEmbedUrl","trim","emit","handleKeydown","stopPropagation","preventDefault","render","html","_templateObject","_taggedTemplateLiteral","_templateObject2","_templateObject3","get","css","_templateObject4","NileElement","__decorate","property","type","Boolean","reflect","prototype","state","customElement"],"mappings":"ik1DAcaA,CAAN,uBAAAC,EAAA,EAAA,SAAAC,EAAA,uEACuCC,KAAAA,CAAIC,IAAAA,CAAAA,CAAG,EAElCD,KAAAA,CAAQE,QAAAA,CAAG,EACXF,CAAAA,KAAAA,CAAKG,MAAG,EAuH1B,QAAAC,KAAA,EArHQC,SAAA,CAAAN,CAAA,CAAAD,EAAA,SAAAQ,YAAA,CAAAP,CAAA,GAAAQ,GAAA,cAAAC,KAAA,CAwDA,SAAAC,UAAAA,CAAAA,CACLT,KAAAA,MAAAA,MAAAA,IAAAA,CAAKU,cAAeC,CAAAA,IAAAA,CAAK,iCACvB,GAAMC,CAAAA,CAAAA,EAAAA,iBAAAA,CAAQZ,MAAKa,CAAAA,UAAAA,UAAAA,iBAAAA,iBAALb,iBAAAA,CAAiBc,cAAc,YAC7CF,CAAAA,CAAAA,CAAAA,SAAAA,CAAAA,WAAAA,CAAAA,CAAOG,OAAO,EAEjB,CAAA,EAGM,GAAAR,GAAA,SAAAC,KAAA,UAAAQ,KAAAA,CAAAA,CACLhB,CAAAA,IAAAA,CAAKE,QAAW,CAAA,EAAA,CAChBF,KAAKG,KAAQ,CAAA,EACd,EAEO,GAAAI,GAAA,SAAAC,KAAA,UAAAS,KAAAA,CAAMC,iCACZlB,IAAKE,CAAAA,QAAAA,EAAAA,eAAAA,EAAAA,SAAAA,CAAYgB,CAAMC,CAAAA,MAAAA,UAAAA,SAAAA,iBAAND,SAAAA,CAAcV,wDAAS,EACxCR,CAAAA,IAAAA,CAAKG,MAAQ,EACd,EAEO,GAAAI,GAAA,gBAAAC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N,EAEM,MA9DkCM,CAApC,EACuCC,CAAA,CAAA,CAA3CC,CAAS,CAAA,CAAEC,IAAMC,CAAAA,OAAAA,CAASC,OAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqB7C,CAAA8C,CAAAA,SAAAA,CAAA,MAAA,CAAA,IAAA,EAAA,CAAA,CAExCL,EAAA,CAAhBM,CAAAA,CAAAA,CAAAA,CAAAA,CAA8B/C,CAAA8C,CAAAA,SAAAA,CAAA,UAAA,CAAA,IAAA,EAAA,CAAA,CACdL,CAAA,CAAA,CAAhBM,CAA2B/C,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAA8C,SAAA,CAAA,OAAA,CAAA,IAAA,EAJjB9C,CAAAA,CAAAA,CAAAA,CAAqByC,CAAA,CAAA,CADjCO,EAAc,0BACFhD,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA"}
|
|
@@ -20,8 +20,8 @@ import{__decorate as i}from"tslib";import{css as s,html as n}from"lit";import{pr
|
|
|
20
20
|
min-width: 340px;
|
|
21
21
|
max-width: 420px;
|
|
22
22
|
padding: 12px;
|
|
23
|
-
background: var(--nile-wysiwyg-popover-bg,
|
|
24
|
-
border: 1px solid var(--nile-colors-neutral-400,
|
|
23
|
+
background: var(--nile-wysiwyg-popover-bg, var(--ng-colors-bg-primary));
|
|
24
|
+
border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));
|
|
25
25
|
border-radius: 8px;
|
|
26
26
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
|
|
27
27
|
font-size: 13px;
|
|
@@ -33,12 +33,12 @@ import{__decorate as i}from"tslib";import{css as s,html as n}from"lit";import{pr
|
|
|
33
33
|
|
|
34
34
|
.hint {
|
|
35
35
|
font-size: 12px;
|
|
36
|
-
color: var(--nile-colors-neutral-500,
|
|
36
|
+
color: var(--nile-colors-neutral-500, var(--ng-colors-text-quaternary-500));
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
.error {
|
|
40
40
|
font-size: 12px;
|
|
41
|
-
color: var(--nile-colors-danger-600,
|
|
41
|
+
color: var(--nile-colors-danger-600, var(--ng-componentcolors-utility-error-600));
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
.actions {
|
|
@@ -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","../emoji.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
|
|
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","../emoji.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 r,e,i,o,t,s,n,a,l,_templateObject,_templateObject2,_templateObject3,_templateObject4,p;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){r=_tslib.__decorate;},function(_lit){e=_lit.css;i=_lit.html;},function(_litDecoratorsJs){o=_litDecoratorsJs.property;t=_litDecoratorsJs.state;s=_litDecoratorsJs.query;n=_litDecoratorsJs.customElement;},function(_internalNileElementCjsJs){a=_internalNileElementCjsJs.N;},function(_emojiCjsJs){l=_emojiCjsJs.E;},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){}],execute:function execute(){p=/*#__PURE__*/function(_a){function p(){var _this;_classCallCheck(this,p);_this=_callSuper(this,p,arguments),_this.open=!1,_this.filter="";return _this;}_inherits(p,_a);return _createClass(p,[{key:"focusInput",value:function focusInput(){var _this2=this;this.filter="",this.updateComplete.then(function(){var _this2$searchInput;_this2.searchInput&&(_this2.searchInput.value=""),(_this2$searchInput=_this2.searchInput)===null||_this2$searchInput===void 0?void 0:_this2$searchInput.focus();});}},{key:"handleKeydown",value:function handleKeydown(r){"Escape"===r.key&&(r.stopPropagation(),this.emit("wysiwyg-emoji-cancel"));}},{key:"render",value:function render(){var _this3=this;var r=this.filter.trim().toLowerCase(),e=r?l.filter(function(e){return e.name.includes(r);}):l;return i(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div class=\"panel\" part=\"emoji-picker\" @keydown=",">\n <input\n class=\"emoji-picker__search\"\n type=\"text\"\n placeholder=\"Search emoji\u2026\"\n aria-label=\"Search emoji\"\n @input=","\n />\n <div class=\"grid\" role=\"listbox\" aria-label=\"Emoji\">\n ","\n ","\n </div>\n </div>\n "])),this.handleKeydown,function(r){_this3.filter=r.target.value;},e.map(function(r){return i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <button\n type=\"button\"\n class=\"emoji\"\n title=","\n @mousedown=","\n @click=","\n >\n ","\n </button>\n "])),r.name,function(r){return r.preventDefault();},function(){return _this3.emit("wysiwyg-emoji-select",{"char":r["char"]});},r["char"]);}),0===e.length?i(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["<div class=\"empty\" style=\"grid-column: 1 / -1\">No emoji found</div>"]))):"");}}],[{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: absolute;\n z-index: 20;\n display: none;\n }\n\n :host([open]) {\n display: block;\n }\n\n .panel {\n width: 316px;\n padding: 8px;\n background: var(--nile-wysiwyg-popover-bg, var(--ng-colors-bg-primary));\n border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));\n border-radius: 8px;\n box-shadow: var(--nile-wysiwyg-popover-shadow, 0 4px 12px rgba(16, 24, 40, 0.12));\n }\n\n input {\n font: inherit;\n font-size: 13px;\n width: 100%;\n box-sizing: border-box;\n margin-bottom: 6px;\n padding: 5px 8px;\n border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));\n border-radius: 6px;\n outline: none;\n }\n\n input:focus {\n border-color: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600));\n }\n\n .grid {\n display: grid;\n grid-template-columns: repeat(9, 1fr);\n gap: 2px;\n max-height: 200px;\n overflow-y: auto;\n overscroll-behavior: contain;\n }\n\n .emoji {\n font: inherit;\n font-size: 18px;\n height: 30px;\n padding: 0;\n border: none;\n border-radius: 5px;\n background: transparent;\n cursor: pointer;\n line-height: 1;\n }\n\n .emoji:hover {\n background: var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary));\n }\n\n .empty {\n padding: 12px 4px;\n font-size: 12px;\n color: var(--nile-colors-neutral-500, var(--ng-colors-text-quaternary-500));\n text-align: center;\n }\n "])))];}}]);}(a);r([o({type:Boolean,reflect:!0})],p.prototype,"open",void 0),r([t()],p.prototype,"filter",void 0),r([s(".emoji-picker__search")],p.prototype,"searchInput",void 0),p=r([n("nile-wysiwyg-emoji-picker")],p);}};});
|
|
2
2
|
//# sourceMappingURL=emoji-picker.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emoji-picker.cjs.js","sources":["../../../../src/nile-wysiwyg-editor/ui/emoji-picker.ts"],"sourcesContent":["import { html, css, TemplateResult, CSSResultArray } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport NileElement from '../../internal/nile-element';\nimport { EMOJI } from '../emoji';\n\n/**\n * Emoji picker panel (the 😊 toolbar item). Shares the emoji set with the\n * \":\" autocomplete; the search box filters by name. Emits\n * `wysiwyg-emoji-select` detail: { char } and `wysiwyg-emoji-cancel`.\n */\n@customElement('nile-wysiwyg-emoji-picker')\nexport class NileWysiwygEmojiPicker extends NileElement {\n @property({ type: Boolean, reflect: true }) open = false;\n\n @state() private filter = '';\n\n @query('.emoji-picker__search') searchInput?: HTMLInputElement;\n\n public static get styles(): CSSResultArray {\n return [\n css`\n :host {\n font-family: var(\n --nile-font-family-sans-serif,\n var(--ng-font-family-body, system-ui, -apple-system, sans-serif)\n );\n position: absolute;\n z-index: 20;\n display: none;\n }\n\n :host([open]) {\n display: block;\n }\n\n .panel {\n width: 316px;\n padding: 8px;\n background: var(--nile-wysiwyg-popover-bg,
|
|
1
|
+
{"version":3,"file":"emoji-picker.cjs.js","sources":["../../../../src/nile-wysiwyg-editor/ui/emoji-picker.ts"],"sourcesContent":["import { html, css, TemplateResult, CSSResultArray } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport NileElement from '../../internal/nile-element';\nimport { EMOJI } from '../emoji';\n\n/**\n * Emoji picker panel (the 😊 toolbar item). Shares the emoji set with the\n * \":\" autocomplete; the search box filters by name. Emits\n * `wysiwyg-emoji-select` detail: { char } and `wysiwyg-emoji-cancel`.\n */\n@customElement('nile-wysiwyg-emoji-picker')\nexport class NileWysiwygEmojiPicker extends NileElement {\n @property({ type: Boolean, reflect: true }) open = false;\n\n @state() private filter = '';\n\n @query('.emoji-picker__search') searchInput?: HTMLInputElement;\n\n public static get styles(): CSSResultArray {\n return [\n css`\n :host {\n font-family: var(\n --nile-font-family-sans-serif,\n var(--ng-font-family-body, system-ui, -apple-system, sans-serif)\n );\n position: absolute;\n z-index: 20;\n display: none;\n }\n\n :host([open]) {\n display: block;\n }\n\n .panel {\n width: 316px;\n padding: 8px;\n background: var(--nile-wysiwyg-popover-bg, var(--ng-colors-bg-primary));\n border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));\n border-radius: 8px;\n box-shadow: var(--nile-wysiwyg-popover-shadow, 0 4px 12px rgba(16, 24, 40, 0.12));\n }\n\n input {\n font: inherit;\n font-size: 13px;\n width: 100%;\n box-sizing: border-box;\n margin-bottom: 6px;\n padding: 5px 8px;\n border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));\n border-radius: 6px;\n outline: none;\n }\n\n input:focus {\n border-color: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600));\n }\n\n .grid {\n display: grid;\n grid-template-columns: repeat(9, 1fr);\n gap: 2px;\n max-height: 200px;\n overflow-y: auto;\n overscroll-behavior: contain;\n }\n\n .emoji {\n font: inherit;\n font-size: 18px;\n height: 30px;\n padding: 0;\n border: none;\n border-radius: 5px;\n background: transparent;\n cursor: pointer;\n line-height: 1;\n }\n\n .emoji:hover {\n background: var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary));\n }\n\n .empty {\n padding: 12px 4px;\n font-size: 12px;\n color: var(--nile-colors-neutral-500, var(--ng-colors-text-quaternary-500));\n text-align: center;\n }\n `,\n ];\n }\n\n public focusInput(): void {\n this.filter = '';\n this.updateComplete.then(() => {\n if (this.searchInput) this.searchInput.value = '';\n this.searchInput?.focus();\n });\n }\n\n private handleKeydown(event: KeyboardEvent): void {\n if (event.key === 'Escape') {\n event.stopPropagation();\n this.emit('wysiwyg-emoji-cancel');\n }\n }\n\n public render(): TemplateResult {\n const query = this.filter.trim().toLowerCase();\n const shown = query ? EMOJI.filter(e => e.name.includes(query)) : EMOJI;\n return html`\n <div class=\"panel\" part=\"emoji-picker\" @keydown=${this.handleKeydown}>\n <input\n class=\"emoji-picker__search\"\n type=\"text\"\n placeholder=\"Search emoji…\"\n aria-label=\"Search emoji\"\n @input=${(e: Event) => {\n this.filter = (e.target as HTMLInputElement).value;\n }}\n />\n <div class=\"grid\" role=\"listbox\" aria-label=\"Emoji\">\n ${shown.map(\n e => html`\n <button\n type=\"button\"\n class=\"emoji\"\n title=${e.name}\n @mousedown=${(ev: Event) => ev.preventDefault()}\n @click=${() => this.emit('wysiwyg-emoji-select', { char: e.char })}\n >\n ${e.char}\n </button>\n `\n )}\n ${shown.length === 0\n ? html`<div class=\"empty\" style=\"grid-column: 1 / -1\">No emoji found</div>`\n : ''}\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-wysiwyg-emoji-picker': NileWysiwygEmojiPicker;\n }\n}\n"],"names":["NileWysiwygEmojiPicker","_a","p","constructor","this","open","filter","_this","_inherits","_createClass","key","value","focusInput","updateComplete","then","_this2$searchInput","searchInput","focus","handleKeydown","event","stopPropagation","emit","render","_this3","query","trim","toLowerCase","shown","EMOJI","e","name","includes","html","_templateObject","_taggedTemplateLiteral","target","map","_templateObject2","ev","preventDefault","char","length","_templateObject3","get","css","_templateObject4","NileElement","__decorate","property","type","Boolean","reflect","prototype","state","customElement"],"mappings":"2gHAWaA,CAAN,uBAAAC,EAAA,EAAA,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,qCACuCC,KAAAA,CAAIC,IAAG,CAAA,CAAA,CAAA,CAElCD,KAAAA,CAAME,MAAAA,CAAG,EAmI3B,QAAAC,KAAA,EA/HQC,SAAA,CAAAN,CAAA,CAAAD,EAAA,SAAAQ,YAAA,CAAAP,CAAA,GAAAQ,GAAA,cAAAC,KAAA,CA6EA,SAAAC,UAAAA,CAAAA,kBACLR,IAAKE,CAAAA,MAAAA,CAAS,GACdF,IAAKS,CAAAA,cAAAA,CAAeC,IAAK,CAAA,UAAA,KAAAC,kBAAA,CACnBX,MAAKY,CAAAA,WAAAA,GAAaZ,OAAKY,WAAYL,CAAAA,KAAAA,CAAQ,EAC/CP,CAAAA,EAAAA,kBAAAA,CAAAA,MAAAA,CAAKY,WAAaC,UAAAA,kBAAAA,iBAAlBb,kBAAAA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gFACJ,EAAA,EAIX,CAAA,KAAAxB,GAAA,UAAAiC,GAAA,CA9HM,SAAAA,IAAA,CACL,CAAA,MAAO,CACLC,CAAG,CAAAC,gBAAA,GAAAA,gBAAA,CAAAX,sBAAA,qhEAyEN,EAEM,MApFmCY,GACEC,CAAA,CAAA,CAA3CC,CAAS,CAAA,CAAEC,IAAMC,CAAAA,OAAAA,CAASC,OAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqBnD,CAAAoD,CAAAA,SAAAA,CAAA,MAAA,CAAA,IAAA,EAAA,CAAA,CAExCL,EAAA,CAAhBM,CAAAA,CAAAA,CAAAA,CAAAA,CAA4BrD,CAAAoD,CAAAA,SAAAA,CAAA,QAAA,CAAA,IAAA,EAAA,CAAA,CAEGL,CAAA,CAAA,CAA/BvB,EAAM,uBAAwDxB,CAAAA,CAAAA,CAAAA,CAAAA,CAAAoD,SAAA,CAAA,aAAA,CAAA,IAAA,EALpDpD,CAAAA,CAAAA,CAAAA,CAAsB+C,CAAA,CAAA,CADlCO,EAAc,2BACFtD,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{__decorate as e}from"tslib";import{css as
|
|
1
|
+
import{__decorate as e}from"tslib";import{css as r,html as i}from"lit";import{property as o,state as t,query as s,customElement as n}from"lit/decorators.js";import{N as a}from"../../internal/nile-element.esm.js";import{E as l}from"../emoji.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 p=class extends a{constructor(){super(...arguments),this.open=!1,this.filter=""}static get styles(){return[r`
|
|
2
2
|
:host {
|
|
3
3
|
font-family: var(
|
|
4
4
|
--nile-font-family-sans-serif,
|
|
@@ -16,8 +16,8 @@ import{__decorate as e}from"tslib";import{css as i,html as o}from"lit";import{pr
|
|
|
16
16
|
.panel {
|
|
17
17
|
width: 316px;
|
|
18
18
|
padding: 8px;
|
|
19
|
-
background: var(--nile-wysiwyg-popover-bg,
|
|
20
|
-
border: 1px solid var(--nile-colors-neutral-400,
|
|
19
|
+
background: var(--nile-wysiwyg-popover-bg, var(--ng-colors-bg-primary));
|
|
20
|
+
border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));
|
|
21
21
|
border-radius: 8px;
|
|
22
22
|
box-shadow: var(--nile-wysiwyg-popover-shadow, 0 4px 12px rgba(16, 24, 40, 0.12));
|
|
23
23
|
}
|
|
@@ -29,13 +29,13 @@ import{__decorate as e}from"tslib";import{css as i,html as o}from"lit";import{pr
|
|
|
29
29
|
box-sizing: border-box;
|
|
30
30
|
margin-bottom: 6px;
|
|
31
31
|
padding: 5px 8px;
|
|
32
|
-
border: 1px solid var(--nile-colors-neutral-400,
|
|
32
|
+
border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));
|
|
33
33
|
border-radius: 6px;
|
|
34
34
|
outline: none;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
input:focus {
|
|
38
|
-
border-color: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600
|
|
38
|
+
border-color: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600));
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
.grid {
|
|
@@ -60,16 +60,16 @@ import{__decorate as e}from"tslib";import{css as i,html as o}from"lit";import{pr
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
.emoji:hover {
|
|
63
|
-
background: var(--nile-colors-neutral-100,
|
|
63
|
+
background: var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary));
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
.empty {
|
|
67
67
|
padding: 12px 4px;
|
|
68
68
|
font-size: 12px;
|
|
69
|
-
color: var(--nile-colors-neutral-500,
|
|
69
|
+
color: var(--nile-colors-neutral-500, var(--ng-colors-text-quaternary-500));
|
|
70
70
|
text-align: center;
|
|
71
71
|
}
|
|
72
|
-
`]}focusInput(){this.filter="",this.updateComplete.then((()=>{this.searchInput&&(this.searchInput.value=""),this.searchInput?.focus()}))}handleKeydown(e){"Escape"===e.key&&(e.stopPropagation(),this.emit("wysiwyg-emoji-cancel"))}render(){const e=this.filter.trim().toLowerCase(),
|
|
72
|
+
`]}focusInput(){this.filter="",this.updateComplete.then((()=>{this.searchInput&&(this.searchInput.value=""),this.searchInput?.focus()}))}handleKeydown(e){"Escape"===e.key&&(e.stopPropagation(),this.emit("wysiwyg-emoji-cancel"))}render(){const e=this.filter.trim().toLowerCase(),r=e?l.filter((r=>r.name.includes(e))):l;return i`
|
|
73
73
|
<div class="panel" part="emoji-picker" @keydown=${this.handleKeydown}>
|
|
74
74
|
<input
|
|
75
75
|
class="emoji-picker__search"
|
|
@@ -79,7 +79,7 @@ import{__decorate as e}from"tslib";import{css as i,html as o}from"lit";import{pr
|
|
|
79
79
|
@input=${e=>{this.filter=e.target.value}}
|
|
80
80
|
/>
|
|
81
81
|
<div class="grid" role="listbox" aria-label="Emoji">
|
|
82
|
-
${
|
|
82
|
+
${r.map((e=>i`
|
|
83
83
|
<button
|
|
84
84
|
type="button"
|
|
85
85
|
class="emoji"
|
|
@@ -90,7 +90,7 @@ import{__decorate as e}from"tslib";import{css as i,html as o}from"lit";import{pr
|
|
|
90
90
|
${e.char}
|
|
91
91
|
</button>
|
|
92
92
|
`))}
|
|
93
|
-
${0===
|
|
93
|
+
${0===r.length?i`<div class="empty" style="grid-column: 1 / -1">No emoji found</div>`:""}
|
|
94
94
|
</div>
|
|
95
95
|
</div>
|
|
96
|
-
`}};e([
|
|
96
|
+
`}};e([o({type:Boolean,reflect:!0})],p.prototype,"open",void 0),e([t()],p.prototype,"filter",void 0),e([s(".emoji-picker__search")],p.prototype,"searchInput",void 0),p=e([n("nile-wysiwyg-emoji-picker")],p);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","../../internal/nile-element.cjs.js","../../internal/accessibility/a11y.state.enum.cjs.js","../../internal/accessibility/a11y.property.enum.cjs.js","../../internal/accessibility/role.enum.cjs.js"],function(_export,_context){"use strict";var t,i,e,n,o,
|
|
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,e,r,n,o,s,_templateObject,_templateObject2,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;e=_lit.html;},function(_litDecoratorsJs){r=_litDecoratorsJs.property;n=_litDecoratorsJs.query;o=_litDecoratorsJs.customElement;},function(_internalNileElementCjsJs){s=_internalNileElementCjsJs.N;},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){}],execute:function execute(){a=/*#__PURE__*/function(_s){function a(){var _this;_classCallCheck(this,a);_this=_callSuper(this,a,arguments),_this.open=!1,_this.matchCount=0,_this.activeIndex=0;return _this;}_inherits(a,_s);return _createClass(a,[{key:"focusInput",value:function focusInput(){var _this2=this;this.updateComplete.then(function(){var _this2$queryInput,_this2$queryInput2;(_this2$queryInput=_this2.queryInput)!==null&&_this2$queryInput!==void 0&&_this2$queryInput.focus(),(_this2$queryInput2=_this2.queryInput)===null||_this2$queryInput2===void 0?void 0:_this2$queryInput2.select();});}},{key:"handleKeydown",value:function handleKeydown(t){"Escape"===t.key?(t.stopPropagation(),this.emit("wysiwyg-find-close")):"Enter"===t.key&&t.target===this.queryInput&&(t.preventDefault(),this.emit("wysiwyg-find-step",{direction:t.shiftKey?"prev":"next"}));}},{key:"render",value:function render(){var _this3=this;var t=this.matchCount?"".concat(Math.min(this.activeIndex+1,this.matchCount),"/").concat(this.matchCount):"0/0";return e(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div class=\"find-bar\" part=\"find-bar\" @keydown=",">\n <input\n class=\"find-bar__query\"\n type=\"text\"\n placeholder=\"Find\"\n aria-label=\"Find\"\n @input=","\n />\n <span class=\"count\">","</span>\n <button\n type=\"button\"\n title=\"Previous match\"\n @click=","\n >\n \u2191\n </button>\n <button\n type=\"button\"\n title=\"Next match\"\n @click=","\n >\n \u2193\n </button>\n <input\n class=\"find-bar__replace\"\n type=\"text\"\n placeholder=\"Replace with\"\n aria-label=\"Replace with\"\n />\n <button\n type=\"button\"\n @click=","\n >\n Replace\n </button>\n <button\n type=\"button\"\n @click=","\n >\n All\n </button>\n <button type=\"button\" title=\"Close (Esc)\" @click=",">\n \u2715\n </button>\n </div>\n "])),this.handleKeydown,function(t){return _this3.emit("wysiwyg-find",{query:t.target.value});},t,function(){return _this3.emit("wysiwyg-find-step",{direction:"prev"});},function(){return _this3.emit("wysiwyg-find-step",{direction:"next"});},function(){var _this3$replaceInput$v,_this3$replaceInput;return _this3.emit("wysiwyg-replace",{value:(_this3$replaceInput$v=(_this3$replaceInput=_this3.replaceInput)===null||_this3$replaceInput===void 0?void 0:_this3$replaceInput.value)!==null&&_this3$replaceInput$v!==void 0?_this3$replaceInput$v:""});},function(){var _this3$replaceInput$v2,_this3$replaceInput2;return _this3.emit("wysiwyg-replace-all",{value:(_this3$replaceInput$v2=(_this3$replaceInput2=_this3.replaceInput)===null||_this3$replaceInput2===void 0?void 0:_this3$replaceInput2.value)!==null&&_this3$replaceInput$v2!==void 0?_this3$replaceInput$v2:""});},function(){return _this3.emit("wysiwyg-find-close");});}}],[{key:"styles",get:function get(){return[i(_templateObject2||(_templateObject2=_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 top: 8px;\n right: 8px;\n z-index: 25;\n display: none;\n }\n\n :host([open]) {\n display: block;\n }\n\n .find-bar {\n display: grid;\n grid-template-columns: auto auto auto auto;\n align-items: center;\n gap: 6px;\n padding: 8px;\n background: var(--nile-wysiwyg-popover-bg, var(--ng-colors-bg-primary));\n border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));\n border-radius: 8px;\n box-shadow: var(--nile-wysiwyg-popover-shadow, 0 4px 12px rgba(16, 24, 40, 0.12));\n font-size: 13px;\n }\n\n input {\n font: inherit;\n font-size: 13px;\n width: 160px;\n padding: 4px 8px;\n border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));\n border-radius: 6px;\n outline: none;\n }\n\n input:focus {\n border-color: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600));\n }\n\n .count {\n min-width: 42px;\n text-align: center;\n color: var(--nile-colors-neutral-500, var(--ng-colors-text-quaternary-500));\n font-variant-numeric: tabular-nums;\n }\n\n button {\n font: inherit;\n font-size: 12px;\n padding: 4px 8px;\n border: none;\n border-radius: 5px;\n background: transparent;\n cursor: pointer;\n color: var(--nile-colors-neutral-700, var(--ng-colors-text-secondary-700));\n }\n\n button:hover {\n background: var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary));\n }\n "])))];}}]);}(s);t([r({type:Boolean,reflect:!0})],a.prototype,"open",void 0),t([r({type:Number})],a.prototype,"matchCount",void 0),t([r({type:Number})],a.prototype,"activeIndex",void 0),t([n(".find-bar__query")],a.prototype,"queryInput",void 0),t([n(".find-bar__replace")],a.prototype,"replaceInput",void 0),a=t([o("nile-wysiwyg-find-bar")],a);}};});
|
|
2
2
|
//# sourceMappingURL=find-replace.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-replace.cjs.js","sources":["../../../../src/nile-wysiwyg-editor/ui/find-replace.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 * Find & replace bar pinned to the top-right of the editor. Emits:\n * - `wysiwyg-find` detail: { query }\n * - `wysiwyg-find-step` detail: { direction: 'next' | 'prev' }\n * - `wysiwyg-replace` detail: { value }\n * - `wysiwyg-replace-all` detail: { value }\n * - `wysiwyg-find-close`\n */\n@customElement('nile-wysiwyg-find-bar')\nexport class NileWysiwygFindBar extends NileElement {\n @property({ type: Boolean, reflect: true }) open = false;\n\n @property({ type: Number }) matchCount = 0;\n\n @property({ type: Number }) activeIndex = 0;\n\n @query('.find-bar__query') queryInput?: HTMLInputElement;\n\n @query('.find-bar__replace') replaceInput?: HTMLInputElement;\n\n public static get styles(): CSSResultArray {\n return [\n css`\n :host {\n font-family: var(\n --nile-font-family-sans-serif,\n var(--ng-font-family-body, system-ui, -apple-system, sans-serif)\n );\n position: absolute;\n top: 8px;\n right: 8px;\n z-index: 25;\n display: none;\n }\n\n :host([open]) {\n display: block;\n }\n\n .find-bar {\n display: grid;\n grid-template-columns: auto auto auto auto;\n align-items: center;\n gap: 6px;\n padding: 8px;\n background: var(--nile-wysiwyg-popover-bg,
|
|
1
|
+
{"version":3,"file":"find-replace.cjs.js","sources":["../../../../src/nile-wysiwyg-editor/ui/find-replace.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 * Find & replace bar pinned to the top-right of the editor. Emits:\n * - `wysiwyg-find` detail: { query }\n * - `wysiwyg-find-step` detail: { direction: 'next' | 'prev' }\n * - `wysiwyg-replace` detail: { value }\n * - `wysiwyg-replace-all` detail: { value }\n * - `wysiwyg-find-close`\n */\n@customElement('nile-wysiwyg-find-bar')\nexport class NileWysiwygFindBar extends NileElement {\n @property({ type: Boolean, reflect: true }) open = false;\n\n @property({ type: Number }) matchCount = 0;\n\n @property({ type: Number }) activeIndex = 0;\n\n @query('.find-bar__query') queryInput?: HTMLInputElement;\n\n @query('.find-bar__replace') replaceInput?: HTMLInputElement;\n\n public static get styles(): CSSResultArray {\n return [\n css`\n :host {\n font-family: var(\n --nile-font-family-sans-serif,\n var(--ng-font-family-body, system-ui, -apple-system, sans-serif)\n );\n position: absolute;\n top: 8px;\n right: 8px;\n z-index: 25;\n display: none;\n }\n\n :host([open]) {\n display: block;\n }\n\n .find-bar {\n display: grid;\n grid-template-columns: auto auto auto auto;\n align-items: center;\n gap: 6px;\n padding: 8px;\n background: var(--nile-wysiwyg-popover-bg, var(--ng-colors-bg-primary));\n border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));\n border-radius: 8px;\n box-shadow: var(--nile-wysiwyg-popover-shadow, 0 4px 12px rgba(16, 24, 40, 0.12));\n font-size: 13px;\n }\n\n input {\n font: inherit;\n font-size: 13px;\n width: 160px;\n padding: 4px 8px;\n border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));\n border-radius: 6px;\n outline: none;\n }\n\n input:focus {\n border-color: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600));\n }\n\n .count {\n min-width: 42px;\n text-align: center;\n color: var(--nile-colors-neutral-500, var(--ng-colors-text-quaternary-500));\n font-variant-numeric: tabular-nums;\n }\n\n button {\n font: inherit;\n font-size: 12px;\n padding: 4px 8px;\n border: none;\n border-radius: 5px;\n background: transparent;\n cursor: pointer;\n color: var(--nile-colors-neutral-700, var(--ng-colors-text-secondary-700));\n }\n\n button:hover {\n background: var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary));\n }\n `,\n ];\n }\n\n public focusInput(): void {\n this.updateComplete.then(() => {\n this.queryInput?.focus();\n this.queryInput?.select();\n });\n }\n\n private handleKeydown(event: KeyboardEvent): void {\n if (event.key === 'Escape') {\n event.stopPropagation();\n this.emit('wysiwyg-find-close');\n } else if (event.key === 'Enter' && event.target === this.queryInput) {\n event.preventDefault();\n this.emit('wysiwyg-find-step', { direction: event.shiftKey ? 'prev' : 'next' });\n }\n }\n\n public render(): TemplateResult {\n const count = this.matchCount\n ? `${Math.min(this.activeIndex + 1, this.matchCount)}/${this.matchCount}`\n : '0/0';\n return html`\n <div class=\"find-bar\" part=\"find-bar\" @keydown=${this.handleKeydown}>\n <input\n class=\"find-bar__query\"\n type=\"text\"\n placeholder=\"Find\"\n aria-label=\"Find\"\n @input=${(e: Event) =>\n this.emit('wysiwyg-find', { query: (e.target as HTMLInputElement).value })}\n />\n <span class=\"count\">${count}</span>\n <button\n type=\"button\"\n title=\"Previous match\"\n @click=${() => this.emit('wysiwyg-find-step', { direction: 'prev' })}\n >\n ↑\n </button>\n <button\n type=\"button\"\n title=\"Next match\"\n @click=${() => this.emit('wysiwyg-find-step', { direction: 'next' })}\n >\n ↓\n </button>\n <input\n class=\"find-bar__replace\"\n type=\"text\"\n placeholder=\"Replace with\"\n aria-label=\"Replace with\"\n />\n <button\n type=\"button\"\n @click=${() =>\n this.emit('wysiwyg-replace', { value: this.replaceInput?.value ?? '' })}\n >\n Replace\n </button>\n <button\n type=\"button\"\n @click=${() =>\n this.emit('wysiwyg-replace-all', { value: this.replaceInput?.value ?? '' })}\n >\n All\n </button>\n <button type=\"button\" title=\"Close (Esc)\" @click=${() => this.emit('wysiwyg-find-close')}>\n ✕\n </button>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-wysiwyg-find-bar': NileWysiwygFindBar;\n }\n}\n"],"names":["NileWysiwygFindBar","a","constructor","this","open","matchCount","activeIndex","_this","_inherits","_s","_createClass","key","value","focusInput","updateComplete","then","_this2$queryInput","_this2$queryInput2","queryInput","focus","select","handleKeydown","event","stopPropagation","emit","target","preventDefault","direction","shiftKey","render","_this3","count","concat","Math","min","html","_templateObject","_taggedTemplateLiteral","e","query","_this3$replaceInput$v","_this3$replaceInput","replaceInput","_this3$replaceInput$v2","_this3$replaceInput2","__decorate","get","css","_templateObject2","NileElement","property","type","Boolean","reflect","prototype","Number","customElement"],"mappings":"k5GAaaA,4BAAN,SAAAC,EAAA,CAAAC,KAAAA,KAAAA,CAAAA,eAAAA,MAAAA,CAAAA,mCACuCC,EAAAA,KAAAA,CAAIC,IAAG,CAAA,CAAA,CAAA,CAEvBD,KAAAA,CAAUE,UAAG,CAAA,CAAA,CAEbF,KAAAA,CAAWG,WAAAA,CAAG,CAqJ3C,QAAAC,KAAA,EA/IQC,SAAA,CAAAP,CAAA,CAAAQ,EAAA,SAAAC,YAAA,CAAAT,CAAA,GAAAU,GAAA,cAAAC,KAAA,CAuEA,SAAAC,UAAAA,CAAAA,CAAAA,KAAAA,MAAAA,MACLV,IAAKW,CAAAA,cAAAA,CAAeC,IAAK,CAAA,UAAA,KAAAC,iBAAA,CAAAC,kBAAA,CACvBd,CAAAA,iBAAAA,CAAAA,MAAKe,CAAAA,UAAAA,UAAAA,iBAAAA,WAALf,iBAAAA,CAAiBgB,KACjBhB,CAAAA,CAAAA,EAAAA,kBAAAA,CAAAA,MAAAA,CAAKe,UAAYE,UAAAA,kBAAAA,iBAAjBjB,kBAAAA,CAAiBiB,MAAAA,CAAAA,CAAQ,EAE5B,CAAA,EAEO,GAAAT,GAAA,iBAAAC,KAAA,UAAAS,aAAAA,CAAcC,CACF,CAAA,CAAA,QAAA,GAAdA,CAAMX,CAAAA,GAAAA,EACRW,CAAMC,CAAAA,eAAAA,CAAAA,CAAAA,CACNpB,IAAKqB,CAAAA,IAAAA,CAAK,oBACa,CAAA,EAAA,OAAA,GAAdF,CAAMX,CAAAA,GAAAA,EAAmBW,EAA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,CAAA,CAD9BW,CAAAA,CAAc,uBACFxD,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{__decorate as t}from"tslib";import{css as e,html as i}from"lit";import{property as
|
|
1
|
+
import{__decorate as t}from"tslib";import{css as e,html as i}from"lit";import{property as r,query as n,customElement as o}from"lit/decorators.js";import{N as s}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 s{constructor(){super(...arguments),this.open=!1,this.matchCount=0,this.activeIndex=0}static get styles(){return[e`
|
|
2
2
|
:host {
|
|
3
3
|
font-family: var(
|
|
4
4
|
--nile-font-family-sans-serif,
|
|
@@ -21,8 +21,8 @@ import{__decorate as t}from"tslib";import{css as e,html as i}from"lit";import{pr
|
|
|
21
21
|
align-items: center;
|
|
22
22
|
gap: 6px;
|
|
23
23
|
padding: 8px;
|
|
24
|
-
background: var(--nile-wysiwyg-popover-bg,
|
|
25
|
-
border: 1px solid var(--nile-colors-neutral-400,
|
|
24
|
+
background: var(--nile-wysiwyg-popover-bg, var(--ng-colors-bg-primary));
|
|
25
|
+
border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));
|
|
26
26
|
border-radius: 8px;
|
|
27
27
|
box-shadow: var(--nile-wysiwyg-popover-shadow, 0 4px 12px rgba(16, 24, 40, 0.12));
|
|
28
28
|
font-size: 13px;
|
|
@@ -33,19 +33,19 @@ import{__decorate as t}from"tslib";import{css as e,html as i}from"lit";import{pr
|
|
|
33
33
|
font-size: 13px;
|
|
34
34
|
width: 160px;
|
|
35
35
|
padding: 4px 8px;
|
|
36
|
-
border: 1px solid var(--nile-colors-neutral-400,
|
|
36
|
+
border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));
|
|
37
37
|
border-radius: 6px;
|
|
38
38
|
outline: none;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
input:focus {
|
|
42
|
-
border-color: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600
|
|
42
|
+
border-color: var(--nile-colors-primary-600, var(--ng-componentcolors-utility-blue-600));
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.count {
|
|
46
46
|
min-width: 42px;
|
|
47
47
|
text-align: center;
|
|
48
|
-
color: var(--nile-colors-neutral-500,
|
|
48
|
+
color: var(--nile-colors-neutral-500, var(--ng-colors-text-quaternary-500));
|
|
49
49
|
font-variant-numeric: tabular-nums;
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -57,11 +57,11 @@ import{__decorate as t}from"tslib";import{css as e,html as i}from"lit";import{pr
|
|
|
57
57
|
border-radius: 5px;
|
|
58
58
|
background: transparent;
|
|
59
59
|
cursor: pointer;
|
|
60
|
-
color: var(--nile-colors-neutral-700,
|
|
60
|
+
color: var(--nile-colors-neutral-700, var(--ng-colors-text-secondary-700));
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
button:hover {
|
|
64
|
-
background: var(--nile-colors-neutral-100,
|
|
64
|
+
background: var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary));
|
|
65
65
|
}
|
|
66
66
|
`]}focusInput(){this.updateComplete.then((()=>{this.queryInput?.focus(),this.queryInput?.select()}))}handleKeydown(t){"Escape"===t.key?(t.stopPropagation(),this.emit("wysiwyg-find-close")):"Enter"===t.key&&t.target===this.queryInput&&(t.preventDefault(),this.emit("wysiwyg-find-step",{direction:t.shiftKey?"prev":"next"}))}render(){const t=this.matchCount?`${Math.min(this.activeIndex+1,this.matchCount)}/${this.matchCount}`:"0/0";return i`
|
|
67
67
|
<div class="find-bar" part="find-bar" @keydown=${this.handleKeydown}>
|
|
@@ -109,4 +109,4 @@ import{__decorate as t}from"tslib";import{css as e,html as i}from"lit";import{pr
|
|
|
109
109
|
✕
|
|
110
110
|
</button>
|
|
111
111
|
</div>
|
|
112
|
-
`}};t([
|
|
112
|
+
`}};t([r({type:Boolean,reflect:!0})],a.prototype,"open",void 0),t([r({type:Number})],a.prototype,"matchCount",void 0),t([r({type:Number})],a.prototype,"activeIndex",void 0),t([n(".find-bar__query")],a.prototype,"queryInput",void 0),t([n(".find-bar__replace")],a.prototype,"replaceInput",void 0),a=t([o("nile-wysiwyg-find-bar")],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/glyph.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,n,
|
|
1
|
+
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}System.register(["tslib","lit","lit/decorators.js","../../internal/nile-element.cjs.js","../../internal/glyph.cjs.js","../../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,a,i,n,r,o,_templateObject,_templateObject2,_templateObject3,l,s;function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}return{setters:[function(_tslib){t=_tslib.__decorate;},function(_lit){e=_lit.css;a=_lit.html;},function(_litDecoratorsJs){i=_litDecoratorsJs.property;n=_litDecoratorsJs.customElement;},function(_internalNileElementCjsJs){r=_internalNileElementCjsJs.N;},function(_internalGlyphCjsJs){o=_internalGlyphCjsJs.r;},function(_internalAccessibilityA11yStateEnumCjsJs){},function(_internalAccessibilityA11yPropertyEnumCjsJs){},function(_internalAccessibilityRoleEnumCjsJs){}],execute:function execute(){l=[{label:"Align left",icon:"format_align_left",command:"setImageAlign",attrs:{align:"left"},active:function active(t){return"left"===t.imageAlign;}},{label:"Align center",icon:"format_align_middle",command:"setImageAlign",attrs:{align:"center"},active:function active(t){return"center"===t.imageAlign;}},{label:"Align right",icon:"format_align_right",command:"setImageAlign",attrs:{align:"right"},active:function active(t){return"right"===t.imageAlign;}},{label:"Toggle caption",icon:"ng-captions",command:"toggleImageCaption",active:function active(t){return t.imageIsFigure;}},{label:"Original size",text:"1:1",command:"setImageWidth",attrs:{width:null}},{label:"Delete image",icon:"ng-trash-01",command:"deleteImage"}];s=/*#__PURE__*/function(_r){function s(){var _this;_classCallCheck(this,s);_this=_callSuper(this,s,arguments),_this.open=!1;return _this;}_inherits(s,_r);return _createClass(s,[{key:"render",value:function render(){var _this2=this;var t=this.toolbarState;return a(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n <div class=\"menu\" part=\"image-menu\" @mousedown=",">\n ","\n </div>\n "])),function(t){return t.preventDefault();},l.map(function(e){return a(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n <button\n type=\"button\"\n title=","\n aria-label=","\n ?data-active=","\n @click=","\n >\n ","\n </button>\n "])),e.label,e.label,!(!t||!e.active)&&e.active(t),function(){return _this2.emit("wysiwyg-command",{name:e.command,attrs:e.attrs});},e.icon?o(e.icon,16):e.text);}));}}],[{key:"styles",get:function get(){return[e(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n :host {\n font-family: var(\n --nile-font-family-sans-serif,\n var(--ng-font-family-body, system-ui, -apple-system, sans-serif)\n );\n position: absolute;\n z-index: 15;\n display: none;\n }\n\n :host([open]) {\n display: block;\n }\n\n .menu {\n display: flex;\n gap: 2px;\n padding: 4px;\n background: var(--nile-wysiwyg-popover-bg, var(--ng-colors-bg-primary));\n border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));\n border-radius: 8px;\n box-shadow: var(--nile-wysiwyg-popover-shadow, 0 4px 12px rgba(16, 24, 40, 0.12));\n }\n\n button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 26px;\n height: 26px;\n padding: 0 4px;\n border: none;\n border-radius: 5px;\n background: transparent;\n cursor: pointer;\n font-size: 12px;\n font-weight: 600;\n color: var(--nile-colors-neutral-700, var(--ng-colors-text-secondary-700));\n }\n\n button:hover {\n background: var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary));\n }\n\n button[data-active] {\n background: var(--nile-colors-primary-50, var(--ng-componentcolors-utility-blue-50));\n color: var(--nile-colors-primary-700, var(--ng-componentcolors-utility-blue-700));\n }\n "])))];}}]);}(r);t([i({type:Boolean,reflect:!0})],s.prototype,"open",void 0),t([i({attribute:!1})],s.prototype,"toolbarState",void 0),s=t([n("nile-wysiwyg-image-menu")],s);}};});
|
|
2
2
|
//# sourceMappingURL=image-menu.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-menu.cjs.js","sources":["../../../../src/nile-wysiwyg-editor/ui/image-menu.ts"],"sourcesContent":["import { html, css, TemplateResult, CSSResultArray } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport NileElement from '../../internal/nile-element';\nimport { renderGlyph } from '../../internal/glyph';\nimport type { ToolbarState } from '../engine/selection-state';\n\ninterface ImageOp {\n label: string;\n /** Design-system icon name; `text` is the fallback when no glyph fits. */\n icon?: string;\n text?: string;\n command: string;\n attrs?: Record<string, unknown>;\n active?: (s: ToolbarState) => boolean;\n}\n\nconst OPS: ImageOp[] = [\n {\n label: 'Align left',\n icon: 'format_align_left',\n command: 'setImageAlign',\n attrs: { align: 'left' },\n active: s => s.imageAlign === 'left',\n },\n {\n label: 'Align center',\n icon: 'format_align_middle',\n command: 'setImageAlign',\n attrs: { align: 'center' },\n active: s => s.imageAlign === 'center',\n },\n {\n label: 'Align right',\n icon: 'format_align_right',\n command: 'setImageAlign',\n attrs: { align: 'right' },\n active: s => s.imageAlign === 'right',\n },\n {\n label: 'Toggle caption',\n icon: 'ng-captions',\n command: 'toggleImageCaption',\n active: s => s.imageIsFigure,\n },\n { label: 'Original size', text: '1:1', command: 'setImageWidth', attrs: { width: null } },\n { label: 'Delete image', icon: 'ng-trash-01', command: 'deleteImage' },\n];\n\n/**\n * Compact floating bar shown while an image or figure is selected. The host\n * positions it; operations bubble up as `wysiwyg-command` events.\n */\n@customElement('nile-wysiwyg-image-menu')\nexport class NileWysiwygImageMenu extends NileElement {\n @property({ type: Boolean, reflect: true }) open = false;\n\n @property({ attribute: false }) toolbarState?: ToolbarState;\n\n public static get styles(): CSSResultArray {\n return [\n css`\n :host {\n font-family: var(\n --nile-font-family-sans-serif,\n var(--ng-font-family-body, system-ui, -apple-system, sans-serif)\n );\n position: absolute;\n z-index: 15;\n display: none;\n }\n\n :host([open]) {\n display: block;\n }\n\n .menu {\n display: flex;\n gap: 2px;\n padding: 4px;\n background: var(--nile-wysiwyg-popover-bg,
|
|
1
|
+
{"version":3,"file":"image-menu.cjs.js","sources":["../../../../src/nile-wysiwyg-editor/ui/image-menu.ts"],"sourcesContent":["import { html, css, TemplateResult, CSSResultArray } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport NileElement from '../../internal/nile-element';\nimport { renderGlyph } from '../../internal/glyph';\nimport type { ToolbarState } from '../engine/selection-state';\n\ninterface ImageOp {\n label: string;\n /** Design-system icon name; `text` is the fallback when no glyph fits. */\n icon?: string;\n text?: string;\n command: string;\n attrs?: Record<string, unknown>;\n active?: (s: ToolbarState) => boolean;\n}\n\nconst OPS: ImageOp[] = [\n {\n label: 'Align left',\n icon: 'format_align_left',\n command: 'setImageAlign',\n attrs: { align: 'left' },\n active: s => s.imageAlign === 'left',\n },\n {\n label: 'Align center',\n icon: 'format_align_middle',\n command: 'setImageAlign',\n attrs: { align: 'center' },\n active: s => s.imageAlign === 'center',\n },\n {\n label: 'Align right',\n icon: 'format_align_right',\n command: 'setImageAlign',\n attrs: { align: 'right' },\n active: s => s.imageAlign === 'right',\n },\n {\n label: 'Toggle caption',\n icon: 'ng-captions',\n command: 'toggleImageCaption',\n active: s => s.imageIsFigure,\n },\n { label: 'Original size', text: '1:1', command: 'setImageWidth', attrs: { width: null } },\n { label: 'Delete image', icon: 'ng-trash-01', command: 'deleteImage' },\n];\n\n/**\n * Compact floating bar shown while an image or figure is selected. The host\n * positions it; operations bubble up as `wysiwyg-command` events.\n */\n@customElement('nile-wysiwyg-image-menu')\nexport class NileWysiwygImageMenu extends NileElement {\n @property({ type: Boolean, reflect: true }) open = false;\n\n @property({ attribute: false }) toolbarState?: ToolbarState;\n\n public static get styles(): CSSResultArray {\n return [\n css`\n :host {\n font-family: var(\n --nile-font-family-sans-serif,\n var(--ng-font-family-body, system-ui, -apple-system, sans-serif)\n );\n position: absolute;\n z-index: 15;\n display: none;\n }\n\n :host([open]) {\n display: block;\n }\n\n .menu {\n display: flex;\n gap: 2px;\n padding: 4px;\n background: var(--nile-wysiwyg-popover-bg, var(--ng-colors-bg-primary));\n border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));\n border-radius: 8px;\n box-shadow: var(--nile-wysiwyg-popover-shadow, 0 4px 12px rgba(16, 24, 40, 0.12));\n }\n\n button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 26px;\n height: 26px;\n padding: 0 4px;\n border: none;\n border-radius: 5px;\n background: transparent;\n cursor: pointer;\n font-size: 12px;\n font-weight: 600;\n color: var(--nile-colors-neutral-700, var(--ng-colors-text-secondary-700));\n }\n\n button:hover {\n background: var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary));\n }\n\n button[data-active] {\n background: var(--nile-colors-primary-50, var(--ng-componentcolors-utility-blue-50));\n color: var(--nile-colors-primary-700, var(--ng-componentcolors-utility-blue-700));\n }\n `,\n ];\n }\n\n public render(): TemplateResult {\n const state = this.toolbarState;\n return html`\n <div class=\"menu\" part=\"image-menu\" @mousedown=${(e: Event) => e.preventDefault()}>\n ${OPS.map(\n op => html`\n <button\n type=\"button\"\n title=${op.label}\n aria-label=${op.label}\n ?data-active=${state && op.active ? op.active(state) : false}\n @click=${() => this.emit('wysiwyg-command', { name: op.command, attrs: op.attrs })}\n >\n ${op.icon ? renderGlyph(op.icon, 16) : op.text}\n </button>\n `\n )}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-wysiwyg-image-menu': NileWysiwygImageMenu;\n }\n}\n"],"names":["OPS","label","icon","command","attrs","align","active","s","imageAlign","imageIsFigure","text","width","NileWysiwygImageMenu","_r","constructor","this","open","_this","_inherits","_createClass","key","value","render","_this2","state","toolbarState","html","_templateObject","_taggedTemplateLiteral","e","preventDefault","map","op","_templateObject2","emit","name","renderGlyph","__decorate","get","styles","css","_templateObject3","NileElement","property","type","Boolean","reflect","prototype","attribute","customElement"],"mappings":"k+GAgBMA,CAAiB,CAAA,CACrB,CACEC,KAAAA,CAAO,aACPC,IAAM,CAAA,mBAAA,CACNC,OAAS,CAAA,eAAA,CACTC,KAAO,CAAA,CAAEC,MAAO,MAChBC,CAAAA,CAAAA,MAAAA,CAAQC,QAARD,CAAAA,MAAAA,CAAQC,CAAsB,QAAA,MAAA,GAAjBA,CAAEC,CAAAA,UAAAA,GAAAA,CAEjB,CACEP,KAAO,CAAA,cAAA,CACPC,IAAM,CAAA,qBAAA,CACNC,OAAS,CAAA,eAAA,CACTC,MAAO,CAAEC,KAAAA,CAAO,QAChBC,CAAAA,CAAAA,MAAAA,CAAQC,QAARD,CAAAA,MAAAA,CAAQC,CAAsB,QAAA,QAAA,GAAjBA,CAAEC,CAAAA,UAAAA,GAAAA,CAEjB,CACEP,KAAAA,CAAO,aACPC,CAAAA,IAAAA,CAAM,oBACNC,CAAAA,OAAAA,CAAS,gBACTC,KAAO,CAAA,C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CAAAA,CAAG1B,MAAS0B,CAAAA,EAAAA,CAAAA,CAAG1B,MAAOkB,CAAAA,CAAAA,CAAAA,CACrC,iBAAMT,CAAAA,MAAAA,CAAKmB,KAAK,iBAAmB,CAAA,CAAEC,KAAMH,CAAG7B,CAAAA,OAAAA,CAASC,MAAO4B,CAAG5B,CAAAA,KAAAA,CAAAA,CAAAA,GAExE4B,CAAAA,CAAG9B,IAAOkC,CAAAA,CAAAA,CAAYJ,CAAG9B,CAAAA,IAAAA,CAAM,IAAM8B,CAAGtB,CAAAA,IAAAA,MAMrD,CA9E2C2B,KAAAA,GAAAA,UAAAA,GAAAA,CAIrC,SAAAC,IAAA,CAAWC,CAChB,MAAO,CACLC,CAAG,CAAAC,gBAAA,GAAAA,gBAAA,CAAAb,sBAAA,2jDAmDN,EAEM,MA5DiCc,GACIL,CAAAA,CAAA,CAA3CM,CAAAA,CAAS,CAAEC,IAAAA,CAAMC,OAASC,CAAAA,OAAAA,CAAAA,CAAS,CAAqBlC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAmC,SAAA,CAAA,MAAA,CAAA,IAAA,EAEzBV,CAAAA,CAAAA,CAAAA,CAAA,CAA/BM,CAAS,CAAA,CAAEK,SAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqCpC,CAAAmC,CAAAA,SAAAA,CAAA,cAAA,CAAA,IAAA,EAAA,CAAA,CAHjDnC,CAAoByB,CAAAA,CAAAA,CAAA,CADhCY,CAAAA,CAAc,yBACFrC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
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 a}from"lit";import{property as i,customElement as n}from"lit/decorators.js";import{N as r}from"../../internal/nile-element.esm.js";import{r as o}from"../../internal/glyph.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";const l=[{label:"Align left",icon:"format_align_left",command:"setImageAlign",attrs:{align:"left"},active:e=>"left"===e.imageAlign},{label:"Align center",icon:"format_align_middle",command:"setImageAlign",attrs:{align:"center"},active:e=>"center"===e.imageAlign},{label:"Align right",icon:"format_align_right",command:"setImageAlign",attrs:{align:"right"},active:e=>"right"===e.imageAlign},{label:"Toggle caption",icon:"ng-captions",command:"toggleImageCaption",active:e=>e.imageIsFigure},{label:"Original size",text:"1:1",command:"setImageWidth",attrs:{width:null}},{label:"Delete image",icon:"ng-trash-01",command:"deleteImage"}];let s=class extends r{constructor(){super(...arguments),this.open=!1}static get styles(){return[t`
|
|
2
2
|
:host {
|
|
3
3
|
font-family: var(
|
|
4
4
|
--nile-font-family-sans-serif,
|
|
@@ -17,8 +17,8 @@ import{__decorate as e}from"tslib";import{css as t,html as i}from"lit";import{pr
|
|
|
17
17
|
display: flex;
|
|
18
18
|
gap: 2px;
|
|
19
19
|
padding: 4px;
|
|
20
|
-
background: var(--nile-wysiwyg-popover-bg,
|
|
21
|
-
border: 1px solid var(--nile-colors-neutral-400,
|
|
20
|
+
background: var(--nile-wysiwyg-popover-bg, var(--ng-colors-bg-primary));
|
|
21
|
+
border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-primary));
|
|
22
22
|
border-radius: 8px;
|
|
23
23
|
box-shadow: var(--nile-wysiwyg-popover-shadow, 0 4px 12px rgba(16, 24, 40, 0.12));
|
|
24
24
|
}
|
|
@@ -36,20 +36,20 @@ import{__decorate as e}from"tslib";import{css as t,html as i}from"lit";import{pr
|
|
|
36
36
|
cursor: pointer;
|
|
37
37
|
font-size: 12px;
|
|
38
38
|
font-weight: 600;
|
|
39
|
-
color: var(--nile-colors-neutral-700,
|
|
39
|
+
color: var(--nile-colors-neutral-700, var(--ng-colors-text-secondary-700));
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
button:hover {
|
|
43
|
-
background: var(--nile-colors-neutral-100,
|
|
43
|
+
background: var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary));
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
button[data-active] {
|
|
47
|
-
background: var(--nile-colors-primary-50, var(--ng-componentcolors-utility-blue-50
|
|
48
|
-
color: var(--nile-colors-primary-700, var(--ng-componentcolors-utility-blue-700
|
|
47
|
+
background: var(--nile-colors-primary-50, var(--ng-componentcolors-utility-blue-50));
|
|
48
|
+
color: var(--nile-colors-primary-700, var(--ng-componentcolors-utility-blue-700));
|
|
49
49
|
}
|
|
50
|
-
`]}render(){const e=this.toolbarState;return
|
|
50
|
+
`]}render(){const e=this.toolbarState;return a`
|
|
51
51
|
<div class="menu" part="image-menu" @mousedown=${e=>e.preventDefault()}>
|
|
52
|
-
${l.map((t=>
|
|
52
|
+
${l.map((t=>a`
|
|
53
53
|
<button
|
|
54
54
|
type="button"
|
|
55
55
|
title=${t.label}
|
|
@@ -57,8 +57,8 @@ import{__decorate as e}from"tslib";import{css as t,html as i}from"lit";import{pr
|
|
|
57
57
|
?data-active=${!(!e||!t.active)&&t.active(e)}
|
|
58
58
|
@click=${()=>this.emit("wysiwyg-command",{name:t.command,attrs:t.attrs})}
|
|
59
59
|
>
|
|
60
|
-
${t.icon?
|
|
60
|
+
${t.icon?o(t.icon,16):t.text}
|
|
61
61
|
</button>
|
|
62
62
|
`))}
|
|
63
63
|
</div>
|
|
64
|
-
`}};e([
|
|
64
|
+
`}};e([i({type:Boolean,reflect:!0})],s.prototype,"open",void 0),e([i({attribute:!1})],s.prototype,"toolbarState",void 0),s=e([n("nile-wysiwyg-image-menu")],s);
|