@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":"nile-color-picker.js","sourceRoot":"","sources":["../../../src/nile-color-picker/nile-color-picker.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,gCAAgC,CAAC;AACxC,OAAO,wBAAwB,CAAC;AAChC,OAAO,kCAAkC,CAAC;AAO1C,MAAM,CAAC,MAAM,eAAe,GAAmB;IAC7C,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE;IACnC,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE;IACvC,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE;IAClC,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,EAAE;IACzC,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE;IACpC,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE;IACxC,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE;IACvC,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE;IACnC,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE;IACtC,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,O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EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC;wBACzF,OAAO,IAAI,CAAC;oBACd,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAmB,CAAC;gBACvC,CAAC;gBAAC,MAAM,CAAC;oBAAC,OAAO,EAAE,CAAC;gBAAC,CAAC;YACxB,CAAC;YACD,WAAW,EAAE,CAAC,CAAiB,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;SACtD;KACF,CAAC;gDAC2B;AAGZ;IAAhB,KAAK,EAAE;8CAA6C;AACpC;IAAhB,KAAK,EAAE;sDAA4C;AAGnC;IAAhB,KAAK,EAAE;6CAAoB;AACX;IAAhB,KAAK,EAAE;6CAAoB;AACX;IAAhB,KAAK,EAAE;6CAAqB;AACZ;IAAhB,KAAK,EAAE;mDAA2C;AAClC;IAAhB,KAAK,EAAE;kDAA+B;AACtB;IAAhB,KAAK,EAAE;2CAAiB;AACR;IAAhB,KAAK,EAAE;2CAAkB;AACT;IAAhB,KAAK,EAAE;2CAAkB;AApEf,eAAe;IAD3B,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CAkc3B","sourcesContent":["import { LitElement, html, nothing } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { getCssText } from './nile-color-picker.css';\nimport '../nile-dropdown/nile-dropdown';\nimport '../nile-menu/nile-menu';\nimport '../nile-menu-item/nile-menu-item';\n\nexport type ColorPickerType = 'swatches' | 'picker';\nexport type ColorPickerMode = 'inline' | 'popover';\nexport type SwatchTooltip = 'name' | 'value' | 'both';\nexport type PaletteEntry = { color: string; name: string };\n\nexport const DEFAULT_PALETTE: PaletteEntry[] = [\n { color: '#131316', name: 'Black' },\n { color: '#26272B', name: 'Dark Gray' },\n { color: '#525252', name: 'Gray' },\n { color: '#737373', name: 'Medium Gray' },\n { color: '#A3A3A3', name: 'Silver' },\n { color: '#D6D6D6', name: 'Light Gray' },\n { color: '#F5F5F5', name: 'Off White' },\n { color: '#FFFFFF', name: 'White' },\n { color: '#CA8504', name: 'Yellow 3' },\n { color: '#C01048', name: 'Red 3' },\n { color: '#DD2590', name: 'Pink 3' },\n { color: '#155EEF', name: 'Blue Dark 3' },\n { color: '#444CE7', name: 'Indigo 3' },\n { color: '#7A5AF8', name: 'Purple 3' },\n { color: '#3E4784', name: 'Gray Blue 3' },\n { color: '#087443', name: 'Green 3' },\n { color: '#FDE272', name: 'Yellow 2' },\n { color: '#FEA3B4', name: 'Red 2' },\n { color: '#FAA7E0', name: 'Pink 2' },\n { color: '#528BFF', name: 'Blue Dark 2' },\n { color: '#A4BCFD', name: 'Indigo 2' },\n { color: '#BDB4FE', name: 'Purple 2' },\n { color: '#B3B8DB', name: 'Gray Blue 2' },\n { color: '#73E2A3', name: 'Green 2' },\n { color: '#FEFBE8', name: 'Yellow 1' },\n { color: '#FFF1F3', name: 'Red 1' },\n { color: '#FDF2FA', name: 'Pink 1' },\n { color: '#EFF4FF', name: 'Blue Dark 1' },\n { color: '#EEF4FF', name: 'Indigo 1' },\n { color: '#F4F3FF', name: 'Purple 1' },\n { color: '#F8F9FC', name: 'Gray Blue 1' },\n { color: '#EDFCF2', name: 'Green 1' },\n];\n\n/* ── color math helpers ──────────────────────────────────────────────── */\nexport function hexToRgb(hex: string): [number, number, number] {\n const h = hex.replace('#', '');\n return [parseInt(h.slice(0, 2), 16), parseInt(h.slice(2, 4), 16), parseInt(h.slice(4, 6), 16)];\n}\n\nexport function rgbToHex(r: number, g: number, b: number): string {\n return '#' + [r, g, b].map(v => v.toString(16).padStart(2, '0')).join('').toUpperCase();\n}\n\nexport function rgbToHsv(r: number, g: number, b: number): [number, number, number] {\n r /= 255; g /= 255; b /= 255;\n const max = Math.max(r, g, b), min = Math.min(r, g, b), d = max - min;\n let h = 0;\n if (d !== 0) {\n if (max === r) h = ((g - b) / d + 6) % 6;\n else if (max === g) h = (b - r) / d + 2;\n else h = (r - g) / d + 4;\n h *= 60;\n }\n return [h, max === 0 ? 0 : d / max, max];\n}\n\nexport function hsvToRgb(h: number, s: number, v: number): [number, number, number] {\n const c = v * s, x = c * (1 - Math.abs(((h / 60) % 2) - 1)), m = v - c;\n let r = 0, g = 0, b = 0;\n if (h < 60) { r = c; g = x; }\n else if (h < 120) { r = x; g = c; }\n else if (h < 180) { g = c; b = x; }\n else if (h < 240) { g = x; b = c; }\n else if (h < 300) { r = x; b = c; }\n else { r = c; b = x; }\n return [Math.round((r + m) * 255), Math.round((g + m) * 255), Math.round((b + m) * 255)];\n}\n\n@customElement('nile-color-picker')\nexport class NileColorPicker extends LitElement {\n protected createRenderRoot() { return this; }\n\n \n @property({ type: String, attribute: true, reflect: true }) type: ColorPickerType = 'swatches';\n\n /** Currently selected hex color value. */\n @property({ type: String, attribute: true, reflect: true }) value = '#000000';\n\n /** What to show in swatch tooltips. */\n @property({ type: String, reflect: true }) swatchTooltip: SwatchTooltip = 'name';\n\n /** How many recent/custom colors to display. */\n @property({ type: Number, reflect: true }) recentColorsCount = 3;\n\n /** Show a \"No Fill\" button (useful for background-color use cases). */\n @property({ type: Boolean, reflect: true }) noFill = false;\n\n \n @property({ type: String, reflect: true })mode: ColorPickerMode = 'inline';\n\n /** Show the SV gradient canvas (the large colour area). Applies when type=\"picker\". */\n @property({ type: Boolean, reflect: true }) showCanvas = true;\n\n /** Show the hue slider row (rainbow bar + eyedropper). Applies when type=\"picker\". */\n @property({ type: Boolean, reflect: true }) showHue = true;\n\n /** Show the HEX / RGB input row. Applies when type=\"picker\". */\n @property({ type: Boolean, reflect: true }) showInputs = true;\n\n /** Show the Cancel / Okay action buttons. Applies when type=\"picker\". */\n @property({ type: Boolean, reflect: true }) showActions = true;\n\n @property({ type: Boolean, reflect: true, attribute: true}) open = false;\n\n /** Custom palette. Accepts a JSON array of `{ color, name }` objects or plain\n * hex strings. Falls back to the built-in palette when empty. */\n @property({\n attribute: 'palette',\n converter: {\n fromAttribute: (value: string): PaletteEntry[] => {\n try {\n const parsed = JSON.parse(value);\n if (!Array.isArray(parsed)) return [];\n return parsed.map((e: any) => {\n if (typeof e === 'string') return { color: e, name: e };\n if (e && typeof e.color === 'string') return { color: e.color, name: e.name || e.color };\n return null;\n }).filter(Boolean) as PaletteEntry[];\n } catch { return []; }\n },\n toAttribute: (v: PaletteEntry[]) => JSON.stringify(v),\n },\n })\n palette: PaletteEntry[] = [];\n\n /* ── internal state ──────────────────────────────────────────────── */\n @state() private _view: ColorPickerType = 'swatches';\n @state() private _recentColors: PaletteEntry[] = [];\n\n // picker canvas state\n @state() private _hue = 220;\n @state() private _sat = 0.7;\n @state() private _val = 0.93;\n @state() private _colorMode: 'HEX' | 'RGB' = 'HEX';\n @state() private _hexInput = '#366AEE';\n @state() private _r = 54;\n @state() private _g = 106;\n @state() private _b = 238;\n\n private _svCanvas: HTMLCanvasElement | null = null;\n private _hueCanvas: HTMLCanvasElement | null = null;\n private _draggingSV = false;\n private _draggingHue = false;\n private _pendingColor = '#366AEE';\n\n /* ── lifecycle ───────────────────────────────────────────────────── */\n connectedCallback() {\n super.connectedCallback();\n this._view = this.type;\n if (this.type === 'picker') {\n const [r, g, b] = hexToRgb(this._norm(this.value));\n [this._hue, this._sat, this._val] = rgbToHsv(r, g, b);\n this._syncInputs();\n }\n this._injectCss();\n document.addEventListener('mousemove', this._onGlobalMouseMove);\n document.addEventListener('mouseup', this._onGlobalMouseUp);\n }\n\n disconnectedCallback() {\n document.removeEventListener('mousemove', this._onGlobalMouseMove);\n document.removeEventListener('mouseup', this._onGlobalMouseUp);\n super.disconnectedCallback();\n }\n\n protected updated(changed: Map<string, unknown>) {\n if (changed.has('type')) {\n this._view = this.type;\n if (this.type === 'picker') {\n const [r, g, b] = hexToRgb(this._norm(this.value));\n [this._hue, this._sat, this._val] = rgbToHsv(r, g, b);\n this._syncInputs();\n }\n }\n if (changed.has('value') && this.type === 'picker' && this._view === 'picker' &&\n !this._draggingSV && !this._draggingHue) {\n const [r, g, b] = hexToRgb(this._norm(this.value));\n [this._hue, this._sat, this._val] = rgbToHsv(r, g, b);\n this._syncInputs();\n }\n \n if (this._view === 'picker') {\n requestAnimationFrame(() => {\n this._svCanvas = this.querySelector('.ncp-sv-canvas') as HTMLCanvasElement;\n this._hueCanvas = this.querySelector('.ncp-hue-canvas') as HTMLCanvasElement;\n this._drawSV();\n this._drawHue();\n });\n }\n }\n\n /* ── public API ──────────────────────────────────────────────────── */\n /** Reset the view back to the default type (call this when the host popover closes). */\n reset() {\n this._view = this.type;\n }\n\n \n private _injectCss() {\n if (this.querySelector('style[data-nile-color-picker]')) return;\n const style = document.createElement('style');\n style.setAttribute('data-nile-color-picker', '');\n style.textContent = getCssText();\n this.insertBefore(style, this.firstChild);\n }\n\n \n private _norm(hex: string) {\n const t = hex.trim();\n if (/^#[0-9a-f]{6}$/i.test(t)) return t.toUpperCase();\n if (/^#[0-9a-f]{3}$/i.test(t)) {\n const [a, b, c] = t.slice(1).toUpperCase().split('');\n return `#${a}${a}${b}${b}${c}${c}`;\n }\n return '#000000';\n }\n\n private get _paletteColors(): PaletteEntry[] {\n return this.palette.length > 0 ? this.palette : DEFAULT_PALETTE;\n }\n\n \n private _emit(value: string) {\n this.dispatchEvent(new CustomEvent('nile-change', {\n detail: { value },\n bubbles: true,\n composed: true,\n }));\n }\n\n private _apply(color: string) {\n const hex = this._norm(color);\n this.value = hex;\n const entry: PaletteEntry = { color: hex, name: hex };\n this._recentColors = [entry, ...this._recentColors.filter(e => this._norm(e.color) !== hex)].slice(0, this.recentColorsCount);\n this._emit(hex);\n if (this.mode === 'popover' && this._view === 'swatches') {\n this._closePopover();\n }\n }\n\n private _closePopover() {\n const pop = this.querySelector('nile-popover') as any;\n if (pop) pop.isShow = false;\n }\n\n private _openPicker() {\n const [r, g, b] = hexToRgb(this._norm(this.value));\n const [h, s, v] = rgbToHsv(r, g, b);\n this._hue = h; this._sat = s; this._val = v;\n this._syncInputs();\n this._view = 'picker';\n }\n\n private _syncInputs() {\n const [r, g, b] = hsvToRgb(this._hue, this._sat, this._val);\n const hex = rgbToHex(r, g, b);\n this._hexInput = hex; this._r = r; this._g = g; this._b = b;\n this._pendingColor = hex;\n }\n\n private _drawSV() {\n const canvas = this._svCanvas;\n if (!canvas) return;\n const ctx = canvas.getContext('2d');\n if (!ctx) return;\n const { width: w, height: h } = canvas;\n const [hr, hg, hb] = hsvToRgb(this._hue, 1, 1);\n ctx.fillStyle = `rgb(${hr},${hg},${hb})`;\n ctx.fillRect(0, 0, w, h);\n const wg = ctx.createLinearGradient(0, 0, w, 0);\n wg.addColorStop(0, 'rgba(255,255,255,1)'); wg.addColorStop(1, 'rgba(255,255,255,0)');\n ctx.fillStyle = wg; ctx.fillRect(0, 0, w, h);\n const bg = ctx.createLinearGradient(0, 0, 0, h);\n bg.addColorStop(0, 'rgba(0,0,0,0)'); bg.addColorStop(1, 'rgba(0,0,0,1)');\n ctx.fillStyle = bg; ctx.fillRect(0, 0, w, h);\n }\n\n private _drawHue() {\n const canvas = this._hueCanvas;\n if (!canvas) return;\n const ctx = canvas.getContext('2d');\n if (!ctx) return;\n const grad = ctx.createLinearGradient(0, 0, canvas.width, 0);\n ['#FF0000','#FFFF00','#00FF00','#00FFFF','#0000FF','#FF00FF','#FF0000']\n .forEach((c, i, a) => grad.addColorStop(i / (a.length - 1), c));\n ctx.fillStyle = grad; ctx.fillRect(0, 0, canvas.width, canvas.height);\n }\n\n private _onSVMouseDown = (e: MouseEvent) => { e.preventDefault(); this._draggingSV = true; this._updateSV(e); };\n private _onHueMouseDown = (e: MouseEvent) => { e.preventDefault(); this._draggingHue = true; this._updateHue(e); };\n\n private _onGlobalMouseMove = (e: MouseEvent) => {\n if (this._draggingSV) this._updateSV(e);\n if (this._draggingHue) this._updateHue(e);\n };\n private _onGlobalMouseUp = () => {\n const wasDraggingSV = this._draggingSV;\n const wasDraggingHue = this._draggingHue;\n if (!this.showActions && this._view === 'picker' && (wasDraggingSV || wasDraggingHue)) {\n this._commitPickerIfNoActions();\n }\n this._draggingSV = false;\n this._draggingHue = false;\n };\n\n private _commitPickerIfNoActions() {\n if (this.showActions) return;\n this._apply(this._pendingColor);\n if (this.mode === 'popover') {\n if (this.type === 'swatches') this._view = 'swatches';\n this._closePopover();\n }\n }\n\n private _updateSV(e: MouseEvent) {\n const canvas = this._svCanvas; if (!canvas) return;\n const rect = canvas.getBoundingClientRect();\n this._sat = Math.max(0, Math.min(e.clientX - rect.left, rect.width)) / rect.width;\n this._val = 1 - Math.max(0, Math.min(e.clientY - rect.top, rect.height)) / rect.height;\n this._syncInputs();\n }\n\n private _updateHue(e: MouseEvent) {\n const canvas = this._hueCanvas; if (!canvas) return;\n const rect = canvas.getBoundingClientRect();\n this._hue = (Math.max(0, Math.min(e.clientX - rect.left, rect.width)) / rect.width) * 360;\n this._syncInputs();\n }\n\n private _onHexInput = (e: Event) => {\n let val = ((e as CustomEvent).detail?.value ?? (e.target as HTMLInputElement).value ?? '').trim();\n if (!val.startsWith('#')) val = '#' + val;\n if (/^#[0-9a-f]{6}$/i.test(val)) {\n const [r, g, b] = hexToRgb(val);\n [this._hue, this._sat, this._val] = rgbToHsv(r, g, b);\n this._syncInputs();\n if (this._view === 'picker') this._commitPickerIfNoActions();\n }\n };\n\n private _onRgbInput = (ch: 'r' | 'g' | 'b', e: Event) => {\n const raw = (e as CustomEvent).detail?.value ?? (e.target as HTMLInputElement).value;\n const v = Math.max(0, Math.min(255, parseInt(String(raw), 10) || 0));\n if (ch === 'r') this._r = v; else if (ch === 'g') this._g = v; else this._b = v;\n [this._hue, this._sat, this._val] = rgbToHsv(this._r, this._g, this._b);\n this._syncInputs();\n if (this._view === 'picker') this._commitPickerIfNoActions();\n };\n\n private _onColorModeSelect = (e: CustomEvent<{ value: string }>) => {\n e.stopPropagation();\n const v = e.detail?.value;\n if (v === 'HEX' || v === 'RGB') {\n this._colorMode = v;\n }\n };\n\n private _pickEyedropper = async () => {\n const Ctor = (window as any).EyeDropper;\n if (!Ctor) { this._openPicker(); return; }\n try {\n const result = await new Ctor().open();\n if (result?.sRGBHex) this._apply(result.sRGBHex);\n } catch { /* cancelled */ }\n };\n private _renderSwatch(entry: PaletteEntry) {\n const norm = this._norm(entry.color);\n const isActive = this._norm(this.value) === norm;\n const tip = this.swatchTooltip === 'name'\n ? (entry.name || norm)\n : this.swatchTooltip === 'value'\n ? norm\n : entry.name ? `${entry.name} (${norm})` : norm;\n return html`\n <nile-lite-tooltip content=${tip}>\n <nile-color-swatch\n color=${norm}\n ?active=${isActive}\n @click=${() => this._apply(norm)}\n ></nile-color-swatch>\n </nile-lite-tooltip>\n `;\n }\n\n private _renderSwatchesView() {\n const recent = this._recentColors.slice(0, this.recentColorsCount);\n return html`\n <div class=\"ncp-panel\">\n <div class=\"ncp-palette-grid\">\n ${this._paletteColors.map(e => this._renderSwatch(e))}\n </div>\n\n ${this.noFill ? html`\n <button class=\"ncp-no-fill\" @click=${() => this._emit('none')}>\n <nile-glyph name=\"disabled\"></nile-glyph>\n <span>No Fill</span>\n </button>\n ` : nothing}\n\n <div class=\"ncp-custom-section\">\n <p class=\"ncp-custom-title\">Custom</p>\n <div class=\"ncp-custom-row\">\n ${recent.map(e => this._renderSwatch(e))}\n <nile-lite-tooltip content=\"Add custom color\">\n <button class=\"ncp-action-btn\" @click=${() => this._openPicker()}>\n<nile-glyph name=\"plus\"></nile-glyph>\n </button>\n </nile-lite-tooltip>\n <nile-lite-tooltip content=\"Pick from screen\">\n <button class=\"ncp-action-btn\" @click=${this._pickEyedropper}>\n <nile-glyph name=\"colorize\" size=\"12\"></nile-glyph>\n </button>\n </nile-lite-tooltip>\n </div>\n </div>\n </div>\n `;\n }\n\n private _renderPickerView() {\n const svX = this._sat * 100;\n const svY = (1 - this._val) * 100;\n const hueX = (this._hue / 360) * 100;\n\n return html`\n <div class=\"ncp-panel ncp-panel--picker\">\n\n ${this.showCanvas ? html`\n <div class=\"ncp-sv-area\" @mousedown=${this._onSVMouseDown}>\n <canvas class=\"ncp-sv-canvas\" width=\"244\" height=\"130\"></canvas>\n <div class=\"ncp-sv-thumb\" style=\"left:${svX}%;top:${svY}%\">\n <div class=\"ncp-sv-thumb-inner\"></div>\n </div>\n </div>\n ` : nothing}\n\n ${this.showHue ? html`\n <div class=\"ncp-hue-row\">\n <div class=\"ncp-hue-wrap\" @mousedown=${this._onHueMouseDown}>\n <canvas class=\"ncp-hue-canvas\" width=\"244\" height=\"14\"></canvas>\n <div class=\"ncp-hue-thumb\" style=\"left:${hueX}%\"></div>\n </div>\n <button class=\"ncp-eyedropper\" title=\"Pick from screen\" @click=${this._pickEyedropper}>\n <nile-glyph name=\"colorize\" size=\"16\"></nile-glyph>\n </button>\n </div>\n ` : nothing}\n\n ${this.showInputs ? html`\n <div class=\"ncp-input-row\">\n <nile-dropdown class=\"ncp-mode-dropdown\" placement=\"bottom-start\" distance=\"4\" hoist>\n <nile-button slot=\"trigger\" class=\"ncp-mode-btn\" variant=\"tertiary\">\n ${this._colorMode} <nile-icon name=\"arrowdown\" size=\"12\"></nile-icon>\n </nile-button>\n <nile-menu @nile-select=${this._onColorModeSelect}>\n <nile-menu-item value=\"HEX\" ?active=${this._colorMode === 'HEX'}>HEX</nile-menu-item>\n <nile-menu-item value=\"RGB\" ?active=${this._colorMode === 'RGB'}>RGB</nile-menu-item>\n </nile-menu>\n </nile-dropdown>\n ${this._colorMode === 'HEX'\n ? html`<nile-input class=\"ncp-hex\" .value=${this._hexInput} @nile-input=${this._onHexInput}></nile-input>`\n : html`\n <nile-input class=\"ncp-rgb\" type=\"number\" min=\"0\" max=\"255\" .value=${String(this._r)} @nile-input=${(e: Event) => this._onRgbInput('r', e)}></nile-input>\n <nile-input class=\"ncp-rgb\" type=\"number\" min=\"0\" max=\"255\" .value=${String(this._g)} @nile-input=${(e: Event) => this._onRgbInput('g', e)}></nile-input>\n <nile-input class=\"ncp-rgb\" type=\"number\" min=\"0\" max=\"255\" .value=${String(this._b)} @nile-input=${(e: Event) => this._onRgbInput('b', e)}></nile-input>\n `}\n </div>\n ` : nothing}\n\n ${this.showActions ? html`\n <div class=\"ncp-picker-actions\">\n ${this.type === 'swatches'\n ? html`<nile-button variant=\"secondary\" size=\"small\" @click=${() => { this._view = 'swatches'; }}>Cancel</nile-button>`\n : nothing}\n <nile-button variant=\"primary\" size=\"small\" @click=${() => { this._apply(this._pendingColor); if (this.type === 'swatches') this._view = 'swatches'; this._closePopover(); }}>Okay</nile-button>\n </div>\n ` : nothing}\n\n </div>\n `;\n }\n\n private _renderTrigger() {\n const isNoFill = this.value === 'none';\n const displayColor = isNoFill ? null : this._norm(this.value);\n return html`\n <button\n slot=\"anchor\"\n class=\"ncp-trigger${isNoFill ? ' ncp-trigger--no-fill' : ''}\"\n type=\"button\"\n aria-label=${isNoFill ? 'No Fill' : displayColor}\n style=${isNoFill ? '' : `background:${displayColor}`}\n ></button>\n `;\n }\n\n render() {\n const panel = this._view === 'picker' ? this._renderPickerView() : this._renderSwatchesView();\n\n if (this.mode === 'popover') {\n return html`\n <nile-popover\n .arrow=${false}\n flip\n .open=${this.open}\n placement=\"bottom-start\"\n id=\"color-picker-popover\"\n distance=\"8\"\n @nile-hide=${() => this.reset()}\n >\n ${this._renderTrigger()}\n ${panel}\n </nile-popover>\n `;\n }\n\n return panel;\n }\n}\n\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-color-picker': NileColorPicker;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"nile-color-picker.js","sourceRoot":"","sources":["../../../src/nile-color-picker/nile-color-picker.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,gCAAgC,CAAC;AACxC,OAAO,wBAAwB,CAAC;AAChC,OAAO,k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hB,KAAK,EAAE;mDAA2C;AAClC;IAAhB,KAAK,EAAE;kDAA+B;AACtB;IAAhB,KAAK,EAAE;2CAAiB;AACR;IAAhB,KAAK,EAAE;2CAAkB;AACT;IAAhB,KAAK,EAAE;2CAAkB;AApEf,eAAe;IAD3B,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CAkc3B","sourcesContent":["import { LitElement, html, nothing } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { getCssText } from './nile-color-picker.css';\nimport '../nile-dropdown/nile-dropdown';\nimport '../nile-menu/nile-menu';\nimport '../nile-menu-item/nile-menu-item';\nimport '../nile-color-swatch/nile-color-swatch';\n\nexport type ColorPickerType = 'swatches' | 'picker';\nexport type ColorPickerMode = 'inline' | 'popover';\nexport type SwatchTooltip = 'name' | 'value' | 'both';\nexport type PaletteEntry = { color: string; name: string };\n\nexport const DEFAULT_PALETTE: PaletteEntry[] = [\n { color: '#131316', name: 'Black' },\n { color: '#26272B', name: 'Dark Gray' },\n { color: '#525252', name: 'Gray' },\n { color: '#737373', name: 'Medium Gray' },\n { color: '#A3A3A3', name: 'Silver' },\n { color: '#D6D6D6', name: 'Light Gray' },\n { color: '#F5F5F5', name: 'Off White' },\n { color: '#FFFFFF', name: 'White' },\n { color: '#CA8504', name: 'Yellow 3' },\n { color: '#C01048', name: 'Red 3' },\n { color: '#DD2590', name: 'Pink 3' },\n { color: '#155EEF', name: 'Blue Dark 3' },\n { color: '#444CE7', name: 'Indigo 3' },\n { color: '#7A5AF8', name: 'Purple 3' },\n { color: '#3E4784', name: 'Gray Blue 3' },\n { color: '#087443', name: 'Green 3' },\n { color: '#FDE272', name: 'Yellow 2' },\n { color: '#FEA3B4', name: 'Red 2' },\n { color: '#FAA7E0', name: 'Pink 2' },\n { color: '#528BFF', name: 'Blue Dark 2' },\n { color: '#A4BCFD', name: 'Indigo 2' },\n { color: '#BDB4FE', name: 'Purple 2' },\n { color: '#B3B8DB', name: 'Gray Blue 2' },\n { color: '#73E2A3', name: 'Green 2' },\n { color: '#FEFBE8', name: 'Yellow 1' },\n { color: '#FFF1F3', name: 'Red 1' },\n { color: '#FDF2FA', name: 'Pink 1' },\n { color: '#EFF4FF', name: 'Blue Dark 1' },\n { color: '#EEF4FF', name: 'Indigo 1' },\n { color: '#F4F3FF', name: 'Purple 1' },\n { color: '#F8F9FC', name: 'Gray Blue 1' },\n { color: '#EDFCF2', name: 'Green 1' },\n];\n\n/* ── color math helpers ──────────────────────────────────────────────── */\nexport function hexToRgb(hex: string): [number, number, number] {\n const h = hex.replace('#', '');\n return [parseInt(h.slice(0, 2), 16), parseInt(h.slice(2, 4), 16), parseInt(h.slice(4, 6), 16)];\n}\n\nexport function rgbToHex(r: number, g: number, b: number): string {\n return '#' + [r, g, b].map(v => v.toString(16).padStart(2, '0')).join('').toUpperCase();\n}\n\nexport function rgbToHsv(r: number, g: number, b: number): [number, number, number] {\n r /= 255; g /= 255; b /= 255;\n const max = Math.max(r, g, b), min = Math.min(r, g, b), d = max - min;\n let h = 0;\n if (d !== 0) {\n if (max === r) h = ((g - b) / d + 6) % 6;\n else if (max === g) h = (b - r) / d + 2;\n else h = (r - g) / d + 4;\n h *= 60;\n }\n return [h, max === 0 ? 0 : d / max, max];\n}\n\nexport function hsvToRgb(h: number, s: number, v: number): [number, number, number] {\n const c = v * s, x = c * (1 - Math.abs(((h / 60) % 2) - 1)), m = v - c;\n let r = 0, g = 0, b = 0;\n if (h < 60) { r = c; g = x; }\n else if (h < 120) { r = x; g = c; }\n else if (h < 180) { g = c; b = x; }\n else if (h < 240) { g = x; b = c; }\n else if (h < 300) { r = x; b = c; }\n else { r = c; b = x; }\n return [Math.round((r + m) * 255), Math.round((g + m) * 255), Math.round((b + m) * 255)];\n}\n\n@customElement('nile-color-picker')\nexport class NileColorPicker extends LitElement {\n protected createRenderRoot() { return this; }\n\n \n @property({ type: String, attribute: true, reflect: true }) type: ColorPickerType = 'swatches';\n\n /** Currently selected hex color value. */\n @property({ type: String, attribute: true, reflect: true }) value = '#000000';\n\n /** What to show in swatch tooltips. */\n @property({ type: String, reflect: true }) swatchTooltip: SwatchTooltip = 'name';\n\n /** How many recent/custom colors to display. */\n @property({ type: Number, reflect: true }) recentColorsCount = 3;\n\n /** Show a \"No Fill\" button (useful for background-color use cases). */\n @property({ type: Boolean, reflect: true }) noFill = false;\n\n \n @property({ type: String, reflect: true })mode: ColorPickerMode = 'inline';\n\n /** Show the SV gradient canvas (the large colour area). Applies when type=\"picker\". */\n @property({ type: Boolean, reflect: true }) showCanvas = true;\n\n /** Show the hue slider row (rainbow bar + eyedropper). Applies when type=\"picker\". */\n @property({ type: Boolean, reflect: true }) showHue = true;\n\n /** Show the HEX / RGB input row. Applies when type=\"picker\". */\n @property({ type: Boolean, reflect: true }) showInputs = true;\n\n /** Show the Cancel / Okay action buttons. Applies when type=\"picker\". */\n @property({ type: Boolean, reflect: true }) showActions = true;\n\n @property({ type: Boolean, reflect: true, attribute: true}) open = false;\n\n /** Custom palette. Accepts a JSON array of `{ color, name }` objects or plain\n * hex strings. Falls back to the built-in palette when empty. */\n @property({\n attribute: 'palette',\n converter: {\n fromAttribute: (value: string): PaletteEntry[] => {\n try {\n const parsed = JSON.parse(value);\n if (!Array.isArray(parsed)) return [];\n return parsed.map((e: any) => {\n if (typeof e === 'string') return { color: e, name: e };\n if (e && typeof e.color === 'string') return { color: e.color, name: e.name || e.color };\n return null;\n }).filter(Boolean) as PaletteEntry[];\n } catch { return []; }\n },\n toAttribute: (v: PaletteEntry[]) => JSON.stringify(v),\n },\n })\n palette: PaletteEntry[] = [];\n\n /* ── internal state ──────────────────────────────────────────────── */\n @state() private _view: ColorPickerType = 'swatches';\n @state() private _recentColors: PaletteEntry[] = [];\n\n // picker canvas state\n @state() private _hue = 220;\n @state() private _sat = 0.7;\n @state() private _val = 0.93;\n @state() private _colorMode: 'HEX' | 'RGB' = 'HEX';\n @state() private _hexInput = '#366AEE';\n @state() private _r = 54;\n @state() private _g = 106;\n @state() private _b = 238;\n\n private _svCanvas: HTMLCanvasElement | null = null;\n private _hueCanvas: HTMLCanvasElement | null = null;\n private _draggingSV = false;\n private _draggingHue = false;\n private _pendingColor = '#366AEE';\n\n /* ── lifecycle ───────────────────────────────────────────────────── */\n connectedCallback() {\n super.connectedCallback();\n this._view = this.type;\n if (this.type === 'picker') {\n const [r, g, b] = hexToRgb(this._norm(this.value));\n [this._hue, this._sat, this._val] = rgbToHsv(r, g, b);\n this._syncInputs();\n }\n this._injectCss();\n document.addEventListener('mousemove', this._onGlobalMouseMove);\n document.addEventListener('mouseup', this._onGlobalMouseUp);\n }\n\n disconnectedCallback() {\n document.removeEventListener('mousemove', this._onGlobalMouseMove);\n document.removeEventListener('mouseup', this._onGlobalMouseUp);\n super.disconnectedCallback();\n }\n\n protected updated(changed: Map<string, unknown>) {\n if (changed.has('type')) {\n this._view = this.type;\n if (this.type === 'picker') {\n const [r, g, b] = hexToRgb(this._norm(this.value));\n [this._hue, this._sat, this._val] = rgbToHsv(r, g, b);\n this._syncInputs();\n }\n }\n if (changed.has('value') && this.type === 'picker' && this._view === 'picker' &&\n !this._draggingSV && !this._draggingHue) {\n const [r, g, b] = hexToRgb(this._norm(this.value));\n [this._hue, this._sat, this._val] = rgbToHsv(r, g, b);\n this._syncInputs();\n }\n \n if (this._view === 'picker') {\n requestAnimationFrame(() => {\n this._svCanvas = this.querySelector('.ncp-sv-canvas') as HTMLCanvasElement;\n this._hueCanvas = this.querySelector('.ncp-hue-canvas') as HTMLCanvasElement;\n this._drawSV();\n this._drawHue();\n });\n }\n }\n\n /* ── public API ──────────────────────────────────────────────────── */\n /** Reset the view back to the default type (call this when the host popover closes). */\n reset() {\n this._view = this.type;\n }\n\n \n private _injectCss() {\n if (this.querySelector('style[data-nile-color-picker]')) return;\n const style = document.createElement('style');\n style.setAttribute('data-nile-color-picker', '');\n style.textContent = getCssText();\n this.insertBefore(style, this.firstChild);\n }\n\n \n private _norm(hex: string) {\n const t = hex.trim();\n if (/^#[0-9a-f]{6}$/i.test(t)) return t.toUpperCase();\n if (/^#[0-9a-f]{3}$/i.test(t)) {\n const [a, b, c] = t.slice(1).toUpperCase().split('');\n return `#${a}${a}${b}${b}${c}${c}`;\n }\n return '#000000';\n }\n\n private get _paletteColors(): PaletteEntry[] {\n return this.palette.length > 0 ? this.palette : DEFAULT_PALETTE;\n }\n\n \n private _emit(value: string) {\n this.dispatchEvent(new CustomEvent('nile-change', {\n detail: { value },\n bubbles: true,\n composed: true,\n }));\n }\n\n private _apply(color: string) {\n const hex = this._norm(color);\n this.value = hex;\n const entry: PaletteEntry = { color: hex, name: hex };\n this._recentColors = [entry, ...this._recentColors.filter(e => this._norm(e.color) !== hex)].slice(0, this.recentColorsCount);\n this._emit(hex);\n if (this.mode === 'popover' && this._view === 'swatches') {\n this._closePopover();\n }\n }\n\n private _closePopover() {\n const pop = this.querySelector('nile-popover') as any;\n if (pop) pop.isShow = false;\n }\n\n private _openPicker() {\n const [r, g, b] = hexToRgb(this._norm(this.value));\n const [h, s, v] = rgbToHsv(r, g, b);\n this._hue = h; this._sat = s; this._val = v;\n this._syncInputs();\n this._view = 'picker';\n }\n\n private _syncInputs() {\n const [r, g, b] = hsvToRgb(this._hue, this._sat, this._val);\n const hex = rgbToHex(r, g, b);\n this._hexInput = hex; this._r = r; this._g = g; this._b = b;\n this._pendingColor = hex;\n }\n\n private _drawSV() {\n const canvas = this._svCanvas;\n if (!canvas) return;\n const ctx = canvas.getContext('2d');\n if (!ctx) return;\n const { width: w, height: h } = canvas;\n const [hr, hg, hb] = hsvToRgb(this._hue, 1, 1);\n ctx.fillStyle = `rgb(${hr},${hg},${hb})`;\n ctx.fillRect(0, 0, w, h);\n const wg = ctx.createLinearGradient(0, 0, w, 0);\n wg.addColorStop(0, 'rgba(255,255,255,1)'); wg.addColorStop(1, 'rgba(255,255,255,0)');\n ctx.fillStyle = wg; ctx.fillRect(0, 0, w, h);\n const bg = ctx.createLinearGradient(0, 0, 0, h);\n bg.addColorStop(0, 'rgba(0,0,0,0)'); bg.addColorStop(1, 'rgba(0,0,0,1)');\n ctx.fillStyle = bg; ctx.fillRect(0, 0, w, h);\n }\n\n private _drawHue() {\n const canvas = this._hueCanvas;\n if (!canvas) return;\n const ctx = canvas.getContext('2d');\n if (!ctx) return;\n const grad = ctx.createLinearGradient(0, 0, canvas.width, 0);\n ['#FF0000','#FFFF00','#00FF00','#00FFFF','#0000FF','#FF00FF','#FF0000']\n .forEach((c, i, a) => grad.addColorStop(i / (a.length - 1), c));\n ctx.fillStyle = grad; ctx.fillRect(0, 0, canvas.width, canvas.height);\n }\n\n private _onSVMouseDown = (e: MouseEvent) => { e.preventDefault(); this._draggingSV = true; this._updateSV(e); };\n private _onHueMouseDown = (e: MouseEvent) => { e.preventDefault(); this._draggingHue = true; this._updateHue(e); };\n\n private _onGlobalMouseMove = (e: MouseEvent) => {\n if (this._draggingSV) this._updateSV(e);\n if (this._draggingHue) this._updateHue(e);\n };\n private _onGlobalMouseUp = () => {\n const wasDraggingSV = this._draggingSV;\n const wasDraggingHue = this._draggingHue;\n if (!this.showActions && this._view === 'picker' && (wasDraggingSV || wasDraggingHue)) {\n this._commitPickerIfNoActions();\n }\n this._draggingSV = false;\n this._draggingHue = false;\n };\n\n private _commitPickerIfNoActions() {\n if (this.showActions) return;\n this._apply(this._pendingColor);\n if (this.mode === 'popover') {\n if (this.type === 'swatches') this._view = 'swatches';\n this._closePopover();\n }\n }\n\n private _updateSV(e: MouseEvent) {\n const canvas = this._svCanvas; if (!canvas) return;\n const rect = canvas.getBoundingClientRect();\n this._sat = Math.max(0, Math.min(e.clientX - rect.left, rect.width)) / rect.width;\n this._val = 1 - Math.max(0, Math.min(e.clientY - rect.top, rect.height)) / rect.height;\n this._syncInputs();\n }\n\n private _updateHue(e: MouseEvent) {\n const canvas = this._hueCanvas; if (!canvas) return;\n const rect = canvas.getBoundingClientRect();\n this._hue = (Math.max(0, Math.min(e.clientX - rect.left, rect.width)) / rect.width) * 360;\n this._syncInputs();\n }\n\n private _onHexInput = (e: Event) => {\n let val = ((e as CustomEvent).detail?.value ?? (e.target as HTMLInputElement).value ?? '').trim();\n if (!val.startsWith('#')) val = '#' + val;\n if (/^#[0-9a-f]{6}$/i.test(val)) {\n const [r, g, b] = hexToRgb(val);\n [this._hue, this._sat, this._val] = rgbToHsv(r, g, b);\n this._syncInputs();\n if (this._view === 'picker') this._commitPickerIfNoActions();\n }\n };\n\n private _onRgbInput = (ch: 'r' | 'g' | 'b', e: Event) => {\n const raw = (e as CustomEvent).detail?.value ?? (e.target as HTMLInputElement).value;\n const v = Math.max(0, Math.min(255, parseInt(String(raw), 10) || 0));\n if (ch === 'r') this._r = v; else if (ch === 'g') this._g = v; else this._b = v;\n [this._hue, this._sat, this._val] = rgbToHsv(this._r, this._g, this._b);\n this._syncInputs();\n if (this._view === 'picker') this._commitPickerIfNoActions();\n };\n\n private _onColorModeSelect = (e: CustomEvent<{ value: string }>) => {\n e.stopPropagation();\n const v = e.detail?.value;\n if (v === 'HEX' || v === 'RGB') {\n this._colorMode = v;\n }\n };\n\n private _pickEyedropper = async () => {\n const Ctor = (window as any).EyeDropper;\n if (!Ctor) { this._openPicker(); return; }\n try {\n const result = await new Ctor().open();\n if (result?.sRGBHex) this._apply(result.sRGBHex);\n } catch { /* cancelled */ }\n };\n private _renderSwatch(entry: PaletteEntry) {\n const norm = this._norm(entry.color);\n const isActive = this._norm(this.value) === norm;\n const tip = this.swatchTooltip === 'name'\n ? (entry.name || norm)\n : this.swatchTooltip === 'value'\n ? norm\n : entry.name ? `${entry.name} (${norm})` : norm;\n return html`\n <nile-lite-tooltip content=${tip}>\n <nile-color-swatch\n color=${norm}\n ?active=${isActive}\n @click=${() => this._apply(norm)}\n ></nile-color-swatch>\n </nile-lite-tooltip>\n `;\n }\n\n private _renderSwatchesView() {\n const recent = this._recentColors.slice(0, this.recentColorsCount);\n return html`\n <div class=\"ncp-panel\">\n <div class=\"ncp-palette-grid\">\n ${this._paletteColors.map(e => this._renderSwatch(e))}\n </div>\n\n ${this.noFill ? html`\n <button class=\"ncp-no-fill\" @click=${() => this._emit('none')}>\n <nile-glyph name=\"disabled\"></nile-glyph>\n <span>No Fill</span>\n </button>\n ` : nothing}\n\n <div class=\"ncp-custom-section\">\n <p class=\"ncp-custom-title\">Custom</p>\n <div class=\"ncp-custom-row\">\n ${recent.map(e => this._renderSwatch(e))}\n <nile-lite-tooltip content=\"Add custom color\">\n <button class=\"ncp-action-btn\" @click=${() => this._openPicker()}>\n<nile-glyph name=\"plus\"></nile-glyph>\n </button>\n </nile-lite-tooltip>\n <nile-lite-tooltip content=\"Pick from screen\">\n <button class=\"ncp-action-btn\" @click=${this._pickEyedropper}>\n <nile-glyph name=\"colorize\" size=\"12\"></nile-glyph>\n </button>\n </nile-lite-tooltip>\n </div>\n </div>\n </div>\n `;\n }\n\n private _renderPickerView() {\n const svX = this._sat * 100;\n const svY = (1 - this._val) * 100;\n const hueX = (this._hue / 360) * 100;\n\n return html`\n <div class=\"ncp-panel ncp-panel--picker\">\n\n ${this.showCanvas ? html`\n <div class=\"ncp-sv-area\" @mousedown=${this._onSVMouseDown}>\n <canvas class=\"ncp-sv-canvas\" width=\"244\" height=\"130\"></canvas>\n <div class=\"ncp-sv-thumb\" style=\"left:${svX}%;top:${svY}%\">\n <div class=\"ncp-sv-thumb-inner\"></div>\n </div>\n </div>\n ` : nothing}\n\n ${this.showHue ? html`\n <div class=\"ncp-hue-row\">\n <div class=\"ncp-hue-wrap\" @mousedown=${this._onHueMouseDown}>\n <canvas class=\"ncp-hue-canvas\" width=\"244\" height=\"14\"></canvas>\n <div class=\"ncp-hue-thumb\" style=\"left:${hueX}%\"></div>\n </div>\n <button class=\"ncp-eyedropper\" title=\"Pick from screen\" @click=${this._pickEyedropper}>\n <nile-glyph name=\"colorize\" size=\"16\"></nile-glyph>\n </button>\n </div>\n ` : nothing}\n\n ${this.showInputs ? html`\n <div class=\"ncp-input-row\">\n <nile-dropdown class=\"ncp-mode-dropdown\" placement=\"bottom-start\" distance=\"4\" hoist>\n <nile-button slot=\"trigger\" class=\"ncp-mode-btn\" variant=\"tertiary\">\n ${this._colorMode} <nile-icon name=\"arrowdown\" size=\"12\"></nile-icon>\n </nile-button>\n <nile-menu @nile-select=${this._onColorModeSelect}>\n <nile-menu-item value=\"HEX\" ?active=${this._colorMode === 'HEX'}>HEX</nile-menu-item>\n <nile-menu-item value=\"RGB\" ?active=${this._colorMode === 'RGB'}>RGB</nile-menu-item>\n </nile-menu>\n </nile-dropdown>\n ${this._colorMode === 'HEX'\n ? html`<nile-input class=\"ncp-hex\" .value=${this._hexInput} @nile-input=${this._onHexInput}></nile-input>`\n : html`\n <nile-input class=\"ncp-rgb\" type=\"number\" min=\"0\" max=\"255\" .value=${String(this._r)} @nile-input=${(e: Event) => this._onRgbInput('r', e)}></nile-input>\n <nile-input class=\"ncp-rgb\" type=\"number\" min=\"0\" max=\"255\" .value=${String(this._g)} @nile-input=${(e: Event) => this._onRgbInput('g', e)}></nile-input>\n <nile-input class=\"ncp-rgb\" type=\"number\" min=\"0\" max=\"255\" .value=${String(this._b)} @nile-input=${(e: Event) => this._onRgbInput('b', e)}></nile-input>\n `}\n </div>\n ` : nothing}\n\n ${this.showActions ? html`\n <div class=\"ncp-picker-actions\">\n ${this.type === 'swatches'\n ? html`<nile-button variant=\"secondary\" size=\"small\" @click=${() => { this._view = 'swatches'; }}>Cancel</nile-button>`\n : nothing}\n <nile-button variant=\"primary\" size=\"small\" @click=${() => { this._apply(this._pendingColor); if (this.type === 'swatches') this._view = 'swatches'; this._closePopover(); }}>Okay</nile-button>\n </div>\n ` : nothing}\n\n </div>\n `;\n }\n\n private _renderTrigger() {\n const isNoFill = this.value === 'none';\n const displayColor = isNoFill ? null : this._norm(this.value);\n return html`\n <button\n slot=\"anchor\"\n class=\"ncp-trigger${isNoFill ? ' ncp-trigger--no-fill' : ''}\"\n type=\"button\"\n aria-label=${isNoFill ? 'No Fill' : displayColor}\n style=${isNoFill ? '' : `background:${displayColor}`}\n ></button>\n `;\n }\n\n render() {\n const panel = this._view === 'picker' ? this._renderPickerView() : this._renderSwatchesView();\n\n if (this.mode === 'popover') {\n return html`\n <nile-popover\n .arrow=${false}\n flip\n .open=${this.open}\n placement=\"bottom-start\"\n id=\"color-picker-popover\"\n distance=\"8\"\n @nile-hide=${() => this.reset()}\n >\n ${this._renderTrigger()}\n ${panel}\n </nile-popover>\n `;\n }\n\n return panel;\n }\n}\n\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nile-color-picker': NileColorPicker;\n }\n}\n"]}
|
|
@@ -71,7 +71,15 @@ export class VirtualScrollHelper {
|
|
|
71
71
|
search,
|
|
72
72
|
loader,
|
|
73
73
|
footer,
|
|
74
|
-
tag__content
|
|
74
|
+
tag__content,
|
|
75
|
+
option__base,
|
|
76
|
+
option__label,
|
|
77
|
+
option__prefix,
|
|
78
|
+
option__suffix,
|
|
79
|
+
option__checked-icon,
|
|
80
|
+
option__checkbox,
|
|
81
|
+
option__label_container,
|
|
82
|
+
option__description
|
|
75
83
|
"
|
|
76
84
|
>
|
|
77
85
|
<slot name="prefix" slot="prefix"></slot>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-scroll-helper.js","sourceRoot":"","sources":["../../../src/nile-select/virtual-scroll-helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAG3B;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAG9B,YAAY,SAAsB;QAChC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED,wBAAwB;QACtB,MAAM,SAAS,GAAG,IAAI,CAAC,SAAgB,CAAC;QAExC,OAAO,IAAI,CAAA;;;kBAGG,SAAS,CAAC,IAAI;mBACb,SAAS,CAAC,KAAK;wBACV,SAAS,CAAC,UAAU;yBACnB,SAAS,CAAC,WAAW;kBAC5B,SAAS,CAAC,IAAI;2BACL,SAAS,CAAC,aAAa;uCACX,SAAS,CAAC,yBAAyB;gCAC1C,SAAS,CAAC,kBAAkB;4BAChC,SAAS,CAAC,cAAc;sBAC9B,SAAS,CAAC,QAAQ;sBAClB,SAAS,CAAC,QAAQ;0BACd,SAAS,CAAC,YAAY;qBAC3B,SAAS,CAAC,OAAO;oCACF,SAAS,CAAC,sBAAsB;mBACjD,SAAS,CAAC,KAAK;qBACb,SAAS,CAAC,OAAO;sBAChB,SAAS,CAAC,QAAQ;uBACjB,SAAS,CAAC,SAAS;mBACvB,SAAS,CAAC,KAAK;oBACd,SAAS,CAAC,MAAM;kBAClB,SAAS,CAAC,IAAI;mBACb,SAAS,CAAC,KAAK;uBACX,SAAS,CAAC,SAAS;kBACxB,SAAS,CAAC,IAAI;sBACV,SAAS,CAAC,QAAQ;2BACb,SAAS,CAAC,aAAa;8BACpB,SAAS,CAAC,gBAAgB;8BAC1B,SAAS,CAAC,gBAAgB;8BAC1B,SAAS,CAAC,gBAAgB;yBAC/B,SAAS,CAAC,WAAW;+BACf,SAAS,CAAC,iBAAiB;4BAC9B,SAAS,CAAC,cAAc;kBAClC,SAAS,CAAC,IAAI;kBACd,SAAS,CAAC,IAAI;qBACX,SAAS,CAAC,OAAO;oBAClB,SAAS,CAAC,MAAM;sCACE,SAAS,CAAC,wBAAwB;4BAC5C,SAAS,CAAC,cAAc;+BACrB,SAAS,CAAC,iBAAiB;0BAChC,SAAS,CAAC,YAAY;oBAC5B,SAAS,CAAC,MAAM
|
|
1
|
+
{"version":3,"file":"virtual-scroll-helper.js","sourceRoot":"","sources":["../../../src/nile-select/virtual-scroll-helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAG3B;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAG9B,YAAY,SAAsB;QAChC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED,wBAAwB;QACtB,MAAM,SAAS,GAAG,IAAI,CAAC,SAAgB,CAAC;QAExC,OAAO,IAAI,CAAA;;;kBAGG,SAAS,CAAC,IAAI;mBACb,SAAS,CAAC,KAAK;wBACV,SAAS,CAAC,UAAU;yBACnB,SAAS,CAAC,WAAW;kBAC5B,SAAS,CAAC,IAAI;2BACL,SAAS,CAAC,aAAa;uCACX,SAAS,CAAC,yBAAyB;gCAC1C,SAAS,CAAC,kBAAkB;4BAChC,SAAS,CAAC,cAAc;sBAC9B,SAAS,CAAC,QAAQ;sBAClB,SAAS,CAAC,QAAQ;0BACd,SAAS,CAAC,YAAY;qBAC3B,SAAS,CAAC,OAAO;oCACF,SAAS,CAAC,sBAAsB;mBACjD,SAAS,CAAC,KAAK;qBACb,SAAS,CAAC,OAAO;sBAChB,SAAS,CAAC,QAAQ;uBACjB,SAAS,CAAC,SAAS;mBACvB,SAAS,CAAC,KAAK;oBACd,SAAS,CAAC,MAAM;kBAClB,SAAS,CAAC,IAAI;mBACb,SAAS,CAAC,KAAK;uBACX,SAAS,CAAC,SAAS;kBACxB,SAAS,CAAC,IAAI;sBACV,SAAS,CAAC,QAAQ;2BACb,SAAS,CAAC,aAAa;8BACpB,SAAS,CAAC,gBAAgB;8BAC1B,SAAS,CAAC,gBAAgB;8BAC1B,SAAS,CAAC,gBAAgB;yBAC/B,SAAS,CAAC,WAAW;+BACf,SAAS,CAAC,iBAAiB;4BAC9B,SAAS,CAAC,cAAc;kBAClC,SAAS,CAAC,IAAI;kBACd,SAAS,CAAC,IAAI;qBACX,SAAS,CAAC,OAAO;oBAClB,SAAS,CAAC,MAAM;sCACE,SAAS,CAAC,wBAAwB;4BAC5C,SAAS,CAAC,cAAc;+BACrB,SAAS,CAAC,iBAAiB;0BAChC,SAAS,CAAC,YAAY;oBAC5B,SAAS,CAAC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAkC/B,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { html } from 'lit';\nimport type NileElement from '../internal/nile-element';\n\n/**\n * Helper class to manage virtual scroll functionality for nile-select component\n */\nexport class VirtualScrollHelper {\n private component: NileElement;\n\n constructor(component: NileElement) {\n this.component = component;\n }\n\n renderVirtualizedContent(): any {\n const component = this.component as any;\n\n return html`\n <div class=\"virtual-select\">\n <nile-virtual-select\n .name=${component.name}\n .value=${component.value}\n .autoResize=${component.autoResize}\n .placeholder=${component.placeholder}\n .size=${component.size}\n .searchEnabled=${component.searchEnabled}\n .internalSearchPlaceHolder=${component.internalSearchPlaceHolder}\n .disableLocalSearch=${component.disableLocalSearch}\n .optionsLoading=${component.optionsLoading}\n .multiple=${component.multiple}\n .helpText=${component.helpText}\n .errorMessage=${component.errorMessage}\n .warning=${component.warning}\n .enableVisibilityEffect=${component.enableVisibilityEffect}\n .error=${component.error}\n .success=${component.success}\n .disabled=${component.disabled}\n .clearable=${component.clearable}\n .hoist=${component.hoist}\n .filled=${component.filled}\n .pill=${component.pill}\n .label=${component.label}\n .placement=${component.placement}\n .form=${component.form}\n .required=${component.required}\n .showNoResults=${component.showNoResults}\n .noResultsMessage=${component.noResultsMessage}\n .renderItemConfig=${component.renderItemConfig}\n .blockValueChange=${component.blockValueChange}\n .noWidthSync=${component.noWidthSync}\n .maxOptionsVisible=${component.maxOptionsVisible}\n .enableTabClose=${component.enableTabClose}\n .data=${component.data}\n .open=${component.open}\n .loading=${component.loading}\n .portal=${component.portal}\n .descriptionSearchEnabled=${component.descriptionSearchEnabled}\n .allowHtmlLabel=${component.allowHtmlLabel}\n .enableDescription=${component.enableDescription}\n .tickOnSelect=${component.tickOnSelect}\n .legacy=${component.legacy}\n exportparts=\"\n select-options,\n select-no-results,\n virtualized,\n form-control,\n form-control-label,\n form-control-input,\n combobox,\n prefix,\n display-input,\n tags,\n tag,\n clear-button,\n suffix,\n expand-icon,\n listbox,\n search,\n loader,\n footer,\n tag__content,\n option__base,\n option__label,\n option__prefix,\n option__suffix,\n option__checked-icon,\n option__checkbox,\n option__label_container,\n option__description\n \"\n >\n <slot name=\"prefix\" slot=\"prefix\"></slot>\n </nile-virtual-select>\n </div>\n `;\n }\n}\n"]}
|
|
@@ -67,6 +67,7 @@ export class VirtualSelectRenderer {
|
|
|
67
67
|
.showCheckbox=${multiple}
|
|
68
68
|
.tickOnSelect=${tickOnSelect ?? false}
|
|
69
69
|
.legacy=${legacy ?? false}
|
|
70
|
+
exportparts="base:option__base, label:option__label, prefix:option__prefix, suffix:option__suffix, checked-icon:option__checked-icon, checkbox:option__checkbox, option_label_container:option__label_container, option_description:option__description"
|
|
70
71
|
class=${classMap({
|
|
71
72
|
option: enableDescription ?? false,
|
|
72
73
|
[className ?? '']: !!className,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer.js","sourceRoot":"","sources":["../../../src/nile-virtual-select/renderer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAuB,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"renderer.js","sourceRoot":"","sources":["../../../src/nile-virtual-select/renderer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAuB,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD,MAAM,OAAO,qBAAqB;IAChC,MAAM,CAAC,qBAAqB,CAC1B,IAAW,EACX,aAAsB,EACtB,kBAAyC,EACzC,KAAwB,EACxB,QAAiB,EACjB,cAAsC,EACtC,YAAoC,EACpC,kBAA0C,EAC1C,aAAqC,EACrC,aAAqC,EACrC,aAAuB,EACvB,gBAAyB,EACzB,OAAiB,EACjB,QAA6B,EAC7B,cAAwB,EACxB,iBAA2B,EAC3B,YAAsB,EACtB,MAAg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,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,WAAW,CAAC;QACzE,CAAC;QAED,OAAO,IAAI,CAAA;;gBAEC,WAAW;oBACP,UAAU;oBACV,UAAU;wBACN,QAAQ;wBACR,YAAY,IAAI,KAAK;kBAC3B,MAAM,IAAI,KAAK;;gBAEjB,QAAQ,CAAC;YACf,MAAM,EAAE,iBAAiB,IAAI,KAAK;YAClC,CAAC,SAAS,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,SAAS;SAC/B,CAAC;uBACa,WAAW;gCACF,iBAAiB;;UAEvC,UAAU,CAAC,MAAM,CAAC;UAClB,cAAc,CAAC,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW;UACtD,UAAU,CAAC,MAAM,CAAC;;KAEvB,CAAC;IACJ,CAAC;IAED;;;OAGG;IACK,MAAM,CAAC,oBAAoB,CAAC,IAAW;QAC7C,OAAO,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;IAC1B,CAAC;CACF","sourcesContent":["/**\n * Copyright Aquera Inc 2025\n *\n * This source code is licensed under the BSD-3-Clause license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, type TemplateResult } from 'lit';\nimport { virtualize } from '@lit-labs/virtualizer/virtualize.js';\nimport { unsafeHTML } from 'lit/directives/unsafe-html.js';\nimport { classMap } from 'lit/directives/class-map.js';\n\nexport class VirtualSelectRenderer {\n static getVirtualizedContent(\n data: any[], \n searchEnabled: boolean, \n renderItemFunction: (item: any) => string,\n value: string | string[],\n multiple: boolean,\n getDisplayText?: (item: any) => string,\n getItemValue?: (item: any) => string,\n getItemDescription?: (item: any) => string,\n getItemPrefix?: (item: any) => string,\n getItemSuffix?: (item: any) => string,\n showNoResults?: boolean,\n noResultsMessage?: string,\n loading?: boolean,\n onScroll?: (e: Event) => void,\n allowHtmlLabel?: boolean,\n enableDescription?: boolean,\n tickOnSelect?: boolean,\n legacy?: boolean\n ): TemplateResult {\n return html`\n <div part=\"select-options\" class=\"select__options ${\n searchEnabled ? 'select__options__search-enabled' : ``\n } ${loading ? 'loading' : ''}\">\n ${showNoResults && !loading\n ? html`\n <div part=\"select-no-results\" class=\"select__no-results\">\n ${noResultsMessage || 'No results found'}\n </div>\n `\n : html`\n <div\n class=\"virtualized\"\n part=\"virtualized\"\n @scroll=${onScroll}\n >\n ${VirtualSelectRenderer.shouldUseVirtualizer(data)\n ? html`\n ${virtualize({\n items: data,\n renderItem: (item: any): TemplateResult =>\n VirtualSelectRenderer.getItemRenderFunction(item, renderItemFunction, value, multiple, getDisplayText, getItemValue, getItemDescription, getItemPrefix, getItemSuffix, allowHtmlLabel, enableDescription, tickOnSelect, legacy),\n scroller: true,\n })}\n `\n : html`\n ${data.map((item: any) => \n VirtualSelectRenderer.getItemRenderFunction(item, renderItemFunction, value, multiple, getDisplayText, getItemValue, getItemDescription, getItemPrefix, getItemSuffix, allowHtmlLabel, enableDescription, tickOnSelect, legacy)\n )}\n `}\n </div>\n `}\n </div>`;\n }\n\n static getItemRenderFunction(\n item: any, \n renderItemFunction: (item: any) => string, \n value: string | string[], \n multiple: boolean,\n getDisplayText?: (item: any) => string,\n getItemValue?: (item: any) => string,\n getItemDescription?: (item: any) => string,\n getItemPrefix?: (item: any) => string,\n getItemSuffix?: (item: any) => string,\n allowHtmlLabel?: boolean,\n enableDescription?: boolean,\n tickOnSelect?: boolean,\n legacy?: boolean,\n ): TemplateResult {\n if(!item) {\n return html``;\n }\n const displayTextFn = getDisplayText || renderItemFunction;\n const valueFn = getItemValue || ((item: any) => item?.value || item);\n \n const optionValue = valueFn(item);\n const displayText = displayTextFn(item);\n const isDisabled = item?.disabled || false;\n const className = item?.className;\n const description = (getItemDescription ? getItemDescription(item) : item?.description) ?? '';\n const prefix = (getItemPrefix ? getItemPrefix(item) : item?.prefix) ?? '';\n const suffix = (getItemSuffix ? getItemSuffix(item) : item?.suffix) ?? '';\n \n let isSelected = false;\n if (multiple) {\n isSelected = Array.isArray(value) && value.some(v => String(v) === String(optionValue));\n } else {\n isSelected = (Array.isArray(value) ? value[0] : value) === optionValue;\n }\n\n return html`\n <nile-option\n value=${optionValue} \n .selected=${isSelected} \n .disabled=${isDisabled}\n .showCheckbox=${multiple}\n .tickOnSelect=${tickOnSelect ?? false}\n .legacy=${legacy ?? false}\n exportparts=\"base:option__base, label:option__label, prefix:option__prefix, suffix:option__suffix, checked-icon:option__checked-icon, checkbox:option__checkbox, option_label_container:option__label_container, option_description:option__description\"\n class=${classMap({\n option: enableDescription ?? false,\n [className ?? '']: !!className,\n })}\n .description=${description}\n .isDescriptionEnabled=${enableDescription}\n >\n ${unsafeHTML(prefix)}\n ${allowHtmlLabel ? unsafeHTML(displayText) : displayText}\n ${unsafeHTML(suffix)}\n </nile-option>\n `;\n }\n\n /**\n * Determines whether to use virtualizer based on dataset size\n * For small datasets (less than 5 items), use regular rendering for better sizing\n */\n private static shouldUseVirtualizer(data: any[]): boolean {\n return data.length >= 5;\n }\n} \n"]}
|
|
@@ -12,6 +12,7 @@ export type { PrintOptions } from './export';
|
|
|
12
12
|
export { selectedImageInfo } from './commands';
|
|
13
13
|
export { ImageView, FigureView } from './plugins/image-view';
|
|
14
14
|
export { EmbedView } from './plugins/embed-view';
|
|
15
|
+
export { StyleBlockView } from './plugins/style-block-view';
|
|
15
16
|
export { MathView } from './plugins/math-view';
|
|
16
17
|
export type { MathRenderer } from './plugins/math-view';
|
|
17
18
|
export { INDENT_STEP_PX, MAX_INDENT, BULLET_STYLES, ORDERED_STYLES } from './schema';
|
|
@@ -9,6 +9,7 @@ export { toInlineStyledHtml, buildWordDocument, buildPrintDocument, } from './ex
|
|
|
9
9
|
export { selectedImageInfo } from './commands';
|
|
10
10
|
export { ImageView, FigureView } from './plugins/image-view';
|
|
11
11
|
export { EmbedView } from './plugins/embed-view';
|
|
12
|
+
export { StyleBlockView } from './plugins/style-block-view';
|
|
12
13
|
export { MathView } from './plugins/math-view';
|
|
13
14
|
export { INDENT_STEP_PX, MAX_INDENT, BULLET_STYLES, ORDERED_STYLES } from './schema';
|
|
14
15
|
export { computeToolbarState } from './selection-state';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/nile-wysiwyg-editor/engine/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EACL,SAAS,EACT,WAAW,EACX,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,UAAU,GACX,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAEtD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,eAAe,GAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGnF,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EACL,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,WAAW,EACX,eAAe,EACf,YAAY,GACb,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["export { createSchema, defaultSchema } from './schema';\nexport type { Alignment } from './schema';\nexport { sanitizeHtml, isSafeUrl } from './sanitize';\nexport {\n htmlToDoc,\n htmlToSlice,\n docToHtml,\n docToText,\n docToJson,\n jsonToDoc,\n isDocEmpty,\n} from './serializer';\nexport { getCommand, getMarkRange } from './commands';\nexport type { CommandName, CommandAttrs } from './commands';\nexport { docToMarkdown } from './markdown';\nexport { markdownToHtml, looksLikeMarkdown } from './markdown-parse';\nexport { isOfficeHtml, isExcelHtml, cleanOfficeHtml } from './office-paste';\nexport {\n toInlineStyledHtml,\n buildWordDocument,\n buildPrintDocument,\n} from './export';\nexport type { PrintOptions } from './export';\nexport { selectedImageInfo } from './commands';\nexport { ImageView, FigureView } from './plugins/image-view';\nexport { EmbedView } from './plugins/embed-view';\nexport { MathView } from './plugins/math-view';\nexport type { MathRenderer } from './plugins/math-view';\nexport { INDENT_STEP_PX, MAX_INDENT, BULLET_STYLES, ORDERED_STYLES } from './schema';\nexport { computeToolbarState } from './selection-state';\nexport type { ToolbarState } from './selection-state';\nexport {\n createEditorState,\n mentionSuggestKey,\n slashSuggestKey,\n emojiSuggestKey,\n} from './create-state';\nexport { maxLengthPlugin } from './plugins/max-length';\nexport { TaskItemView } from './plugins/task-list';\nexport { codeHighlightPlugin, CODE_LANGUAGES } from './plugins/code-highlight';\nexport { toEmbedUrl, isAllowedEmbedSrc, embedPastePlugin } from './plugins/embeds';\nexport type { EmbedTarget } from './plugins/embeds';\nexport type { CreateStateOptions } from './create-state';\nexport { countWords } from './serializer';\nexport type { SuggestionMatch, SuggestionOptions } from './plugins/suggestions';\nexport {\n findReplaceKey,\n getFindState,\n searchTr,\n findStepTr,\n clearFindTr,\n replaceActiveTr,\n replaceAllTr,\n} from './plugins/find-replace';\nexport type { FindState, FindMatch } from './plugins/find-replace';\nexport { placeholderPlugin } from './plugins/placeholder';\nexport {\n formatPainterPlugin,\n formatPainterKey,\n isFormatPainterArmed,\n armFormatPainter,\n disarmFormatPainter,\n applyFormatPainter,\n} from './plugins/format-painter';\nexport { linkPlugin } from './plugins/link';\nexport { singleLinePlugin, flattenToSingleParagraph } from './plugins/single-line';\nexport { tablePlugins } from './plugins/tables';\nexport { imagePlugin, imageUploadKey, findUploadPos } from './plugins/image';\nexport { pastePlugin, plainTextSlice, stripSliceFormatting } from './plugins/paste';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/nile-wysiwyg-editor/engine/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE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,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGnF,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EACL,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,WAAW,EACX,eAAe,EACf,YAAY,GACb,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["export { createSchema, defaultSchema } from './schema';\nexport type { Alignment } from './schema';\nexport { sanitizeHtml, isSafeUrl } from './sanitize';\nexport {\n htmlToDoc,\n htmlToSlice,\n docToHtml,\n docToText,\n docToJson,\n jsonToDoc,\n isDocEmpty,\n} from './serializer';\nexport { getCommand, getMarkRange } from './commands';\nexport type { CommandName, CommandAttrs } from './commands';\nexport { docToMarkdown } from './markdown';\nexport { markdownToHtml, looksLikeMarkdown } from './markdown-parse';\nexport { isOfficeHtml, isExcelHtml, cleanOfficeHtml } from './office-paste';\nexport {\n toInlineStyledHtml,\n buildWordDocument,\n buildPrintDocument,\n} from './export';\nexport type { PrintOptions } from './export';\nexport { selectedImageInfo } from './commands';\nexport { ImageView, FigureView } from './plugins/image-view';\nexport { EmbedView } from './plugins/embed-view';\nexport { StyleBlockView } from './plugins/style-block-view';\nexport { MathView } from './plugins/math-view';\nexport type { MathRenderer } from './plugins/math-view';\nexport { INDENT_STEP_PX, MAX_INDENT, BULLET_STYLES, ORDERED_STYLES } from './schema';\nexport { computeToolbarState } from './selection-state';\nexport type { ToolbarState } from './selection-state';\nexport {\n createEditorState,\n mentionSuggestKey,\n slashSuggestKey,\n emojiSuggestKey,\n} from './create-state';\nexport { maxLengthPlugin } from './plugins/max-length';\nexport { TaskItemView } from './plugins/task-list';\nexport { codeHighlightPlugin, CODE_LANGUAGES } from './plugins/code-highlight';\nexport { toEmbedUrl, isAllowedEmbedSrc, embedPastePlugin } from './plugins/embeds';\nexport type { EmbedTarget } from './plugins/embeds';\nexport type { CreateStateOptions } from './create-state';\nexport { countWords } from './serializer';\nexport type { SuggestionMatch, SuggestionOptions } from './plugins/suggestions';\nexport {\n findReplaceKey,\n getFindState,\n searchTr,\n findStepTr,\n clearFindTr,\n replaceActiveTr,\n replaceAllTr,\n} from './plugins/find-replace';\nexport type { FindState, FindMatch } from './plugins/find-replace';\nexport { placeholderPlugin } from './plugins/placeholder';\nexport {\n formatPainterPlugin,\n formatPainterKey,\n isFormatPainterArmed,\n armFormatPainter,\n disarmFormatPainter,\n applyFormatPainter,\n} from './plugins/format-painter';\nexport { linkPlugin } from './plugins/link';\nexport { singleLinePlugin, flattenToSingleParagraph } from './plugins/single-line';\nexport { tablePlugins } from './plugins/tables';\nexport { imagePlugin, imageUploadKey, findUploadPos } from './plugins/image';\nexport { pastePlugin, plainTextSlice, stripSliceFormatting } from './plugins/paste';\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { attachResizeHandles, isResizeEvent } from './image-view';
|
|
2
|
+
import { EMBED_SANDBOX, EMBED_REFERRER_POLICY } from './embeds';
|
|
2
3
|
/** Below this a 16:9 player is unusable and its own controls stop fitting. */
|
|
3
4
|
const MIN_EMBED_WIDTH = 160;
|
|
4
5
|
/**
|
|
@@ -15,6 +16,8 @@ export class EmbedView {
|
|
|
15
16
|
this.iframe.setAttribute('frameborder', '0');
|
|
16
17
|
this.iframe.setAttribute('allowfullscreen', 'true');
|
|
17
18
|
this.iframe.setAttribute('allow', 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture');
|
|
19
|
+
this.iframe.setAttribute('sandbox', EMBED_SANDBOX);
|
|
20
|
+
this.iframe.setAttribute('referrerpolicy', EMBED_REFERRER_POLICY);
|
|
18
21
|
this.dom.appendChild(this.iframe);
|
|
19
22
|
this.applyAttrs(node);
|
|
20
23
|
attachResizeHandles(this.dom, this.dom, width => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embed-view.js","sourceRoot":"","sources":["../../../../../src/nile-wysiwyg-editor/engine/plugins/embed-view.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"embed-view.js","sourceRoot":"","sources":["../../../../../src/nile-wysiwyg-editor/engine/plugins/embed-view.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEhE,8EAA8E;AAC9E,MAAM,eAAe,GAAG,GAAG,CAAC;AAE5B;;;;GAIG;AACH,MAAM,OAAO,SAAS;IAKpB,YACU,IAAY,EACpB,IAAgB,EAChB,MAAgC;QAFxB,SAAI,GAAJ,IAAI,CAAQ;QAIpB,IAAI,CAAC,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACzC,IAAI,CAAC,GAAG,CAAC,SAAS,GAAG,qBAAqB,CAAC;QAC3C,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAC/C,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,aAAa,EAAE,GAAG,C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CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,SAAS,CAAC,KAAY;QACpB,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["import { Node as PMNode } from 'prosemirror-model';\nimport { EditorView, NodeView } from 'prosemirror-view';\nimport { attachResizeHandles, isResizeEvent } from './image-view';\nimport { EMBED_SANDBOX, EMBED_REFERRER_POLICY } from './embeds';\n\n/** Below this a 16:9 player is unusable and its own controls stop fitting. */\nconst MIN_EMBED_WIDTH = 160;\n\n/**\n * Video embed (YouTube/Vimeo/Loom) with the same corner drag-resize handles\n * as images. Only the width is dragged; the 16:9 aspect ratio comes from CSS,\n * so the height follows automatically.\n */\nexport class EmbedView implements NodeView {\n dom: HTMLDivElement;\n\n private iframe: HTMLIFrameElement;\n\n constructor(\n private node: PMNode,\n view: EditorView,\n getPos: () => number | undefined\n ) {\n this.dom = document.createElement('div');\n this.dom.className = 'nile-wysiwyg__embed';\n this.iframe = document.createElement('iframe');\n this.iframe.setAttribute('frameborder', '0');\n this.iframe.setAttribute('allowfullscreen', 'true');\n this.iframe.setAttribute(\n 'allow',\n 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture'\n );\n this.iframe.setAttribute('sandbox', EMBED_SANDBOX);\n this.iframe.setAttribute('referrerpolicy', EMBED_REFERRER_POLICY);\n this.dom.appendChild(this.iframe);\n this.applyAttrs(node);\n\n attachResizeHandles(\n this.dom,\n this.dom,\n width => {\n const pos = getPos();\n if (pos === undefined || !view.editable) return;\n const current = view.state.doc.nodeAt(pos);\n if (!current) return;\n view.dispatch(\n view.state.tr.setNodeMarkup(pos, undefined, { ...current.attrs, width })\n );\n },\n MIN_EMBED_WIDTH\n );\n }\n\n private applyAttrs(node: PMNode): void {\n const { src, provider, title, width, align } = node.attrs;\n if (this.iframe.getAttribute('src') !== src) this.iframe.setAttribute('src', src);\n this.dom.setAttribute('data-embed-provider', provider ?? 'generic');\n if (title) this.iframe.title = title;\n else this.iframe.removeAttribute('title');\n if (width) {\n this.dom.setAttribute('data-width', String(width));\n this.dom.style.width = `${width}px`;\n } else {\n this.dom.removeAttribute('data-width');\n this.dom.style.width = '';\n }\n // Block alignment via auto margins (mirrors the image figure).\n if (align) this.dom.setAttribute('data-align', align);\n else this.dom.removeAttribute('data-align');\n this.dom.style.marginLeft = align === 'center' || align === 'right' ? 'auto' : '';\n this.dom.style.marginRight = align === 'center' ? 'auto' : '';\n }\n\n update(node: PMNode): boolean {\n if (node.type !== this.node.type) return false;\n this.node = node;\n this.applyAttrs(node);\n return true;\n }\n\n stopEvent(event: Event): boolean {\n return isResizeEvent(event);\n }\n\n ignoreMutation(): boolean {\n return true;\n }\n}\n"]}
|
|
@@ -1,14 +1,29 @@
|
|
|
1
1
|
import { Plugin } from 'prosemirror-state';
|
|
2
2
|
export interface EmbedTarget {
|
|
3
3
|
src: string;
|
|
4
|
-
provider: 'youtube' | 'vimeo' | 'loom';
|
|
4
|
+
provider: 'youtube' | 'vimeo' | 'loom' | 'generic';
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* Sandbox tokens applied to every embed iframe. Notably this OMITS
|
|
8
|
+
* `allow-top-navigation`, so a framed page cannot redirect the whole tab
|
|
9
|
+
* (the main clickjacking/phishing vector); scripts and same-origin are
|
|
10
|
+
* allowed so third-party players still run. Kept in sync with the sanitizer.
|
|
11
|
+
*/
|
|
12
|
+
export declare const EMBED_SANDBOX = "allow-scripts allow-same-origin allow-presentation allow-popups";
|
|
13
|
+
/** Limits the referrer leaked to the embedded third-party host. */
|
|
14
|
+
export declare const EMBED_REFERRER_POLICY = "strict-origin-when-cross-origin";
|
|
15
|
+
/**
|
|
16
|
+
* Converts a URL into an embed target. Known providers (YouTube/Vimeo/Loom)
|
|
17
|
+
* are canonicalized to their dedicated embed URLs; any other `https://` URL
|
|
18
|
+
* is accepted as a `generic` embed. The iframe is always sandboxed on render
|
|
19
|
+
* (see EMBED_SANDBOX), so untrusted hosts cannot navigate the top window.
|
|
20
|
+
* Returns null only for non-https or unparseable URLs.
|
|
9
21
|
*/
|
|
10
22
|
export declare function toEmbedUrl(url: string): EmbedTarget | null;
|
|
11
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* True when a URL is permitted as an embed src (sanitizer check). Any
|
|
25
|
+
* `https://` URL is allowed; the iframe is sandboxed at render time.
|
|
26
|
+
*/
|
|
12
27
|
export declare function isAllowedEmbedSrc(src: string): boolean;
|
|
13
28
|
/**
|
|
14
29
|
* Pasting a bare provider URL onto an empty selection inserts an embed
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
import { Plugin } from 'prosemirror-state';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* Sandbox tokens applied to every embed iframe. Notably this OMITS
|
|
4
|
+
* `allow-top-navigation`, so a framed page cannot redirect the whole tab
|
|
5
|
+
* (the main clickjacking/phishing vector); scripts and same-origin are
|
|
6
|
+
* allowed so third-party players still run. Kept in sync with the sanitizer.
|
|
7
|
+
*/
|
|
8
|
+
export const EMBED_SANDBOX = 'allow-scripts allow-same-origin allow-presentation allow-popups';
|
|
9
|
+
/** Limits the referrer leaked to the embedded third-party host. */
|
|
10
|
+
export const EMBED_REFERRER_POLICY = 'strict-origin-when-cross-origin';
|
|
11
|
+
/**
|
|
12
|
+
* Converts a URL into an embed target. Known providers (YouTube/Vimeo/Loom)
|
|
13
|
+
* are canonicalized to their dedicated embed URLs; any other `https://` URL
|
|
14
|
+
* is accepted as a `generic` embed. The iframe is always sandboxed on render
|
|
15
|
+
* (see EMBED_SANDBOX), so untrusted hosts cannot navigate the top window.
|
|
16
|
+
* Returns null only for non-https or unparseable URLs.
|
|
5
17
|
*/
|
|
6
18
|
export function toEmbedUrl(url) {
|
|
7
19
|
let parsed;
|
|
@@ -29,42 +41,35 @@ export function toEmbedUrl(url) {
|
|
|
29
41
|
if (/^[\w-]{6,20}$/.test(id)) {
|
|
30
42
|
return { src: `https://www.youtube-nocookie.com/embed/${id}`, provider: 'youtube' };
|
|
31
43
|
}
|
|
32
|
-
return null;
|
|
33
44
|
}
|
|
34
45
|
// Vimeo: vimeo.com/123456789, player.vimeo.com/video/123456789
|
|
35
|
-
if (host === 'vimeo.com' || host === 'player.vimeo.com') {
|
|
46
|
+
else if (host === 'vimeo.com' || host === 'player.vimeo.com') {
|
|
36
47
|
const match = /\/(?:video\/)?(\d{6,12})(?:$|[/?])/.exec(parsed.pathname);
|
|
37
48
|
if (match) {
|
|
38
49
|
return { src: `https://player.vimeo.com/video/${match[1]}`, provider: 'vimeo' };
|
|
39
50
|
}
|
|
40
|
-
return null;
|
|
41
51
|
}
|
|
42
52
|
// Loom: loom.com/share/ID or loom.com/embed/ID
|
|
43
|
-
if (host === 'loom.com') {
|
|
53
|
+
else if (host === 'loom.com') {
|
|
44
54
|
const match = /^\/(share|embed)\/([0-9a-f]{16,40})/.exec(parsed.pathname);
|
|
45
55
|
if (match) {
|
|
46
56
|
return { src: `https://www.loom.com/embed/${match[2]}`, provider: 'loom' };
|
|
47
57
|
}
|
|
48
|
-
return null;
|
|
49
58
|
}
|
|
50
|
-
|
|
59
|
+
// Any other https URL: embed as-is, sandboxed.
|
|
60
|
+
return { src: parsed.href, provider: 'generic' };
|
|
51
61
|
}
|
|
52
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* True when a URL is permitted as an embed src (sanitizer check). Any
|
|
64
|
+
* `https://` URL is allowed; the iframe is sandboxed at render time.
|
|
65
|
+
*/
|
|
53
66
|
export function isAllowedEmbedSrc(src) {
|
|
54
|
-
let parsed;
|
|
55
67
|
try {
|
|
56
|
-
|
|
68
|
+
return new URL(src.trim()).protocol === 'https:';
|
|
57
69
|
}
|
|
58
70
|
catch {
|
|
59
71
|
return false;
|
|
60
72
|
}
|
|
61
|
-
if (parsed.protocol !== 'https:')
|
|
62
|
-
return false;
|
|
63
|
-
const host = parsed.hostname.replace(/^www\./, '');
|
|
64
|
-
return (((host === 'youtube.com' || host === 'youtube-nocookie.com') &&
|
|
65
|
-
parsed.pathname.startsWith('/embed/')) ||
|
|
66
|
-
(host === 'player.vimeo.com' && parsed.pathname.startsWith('/video/')) ||
|
|
67
|
-
(host === 'loom.com' && parsed.pathname.startsWith('/embed/')));
|
|
68
73
|
}
|
|
69
74
|
/**
|
|
70
75
|
* Pasting a bare provider URL onto an empty selection inserts an embed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embeds.js","sourceRoot":"","sources":["../../../../../src/nile-wysiwyg-editor/engine/plugins/embeds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAO3C
|
|
1
|
+
{"version":3,"file":"embeds.js","sourceRoot":"","sources":["../../../../../src/nile-wysiwyg-editor/engine/plugins/embeds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAO3C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,iEAAiE,CAAC;AAE/F,mEAAmE;AACnE,MAAM,CAAC,MAAM,qBAAqB,GAAG,iCAAiC,CAAC;AAEvE;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,IAAI,MAAW,CAAC;IAChB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,MAAM,CAAC,QAAQ,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC9C,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IAEnD,wDAAwD;IACxD,IA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QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC;gBACrE,OAAO,IAAI,CAAC;YACd,CAAC;SACF;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { Plugin } from 'prosemirror-state';\n\nexport interface EmbedTarget {\n src: string;\n provider: 'youtube' | 'vimeo' | 'loom' | 'generic';\n}\n\n/**\n * Sandbox tokens applied to every embed iframe. Notably this OMITS\n * `allow-top-navigation`, so a framed page cannot redirect the whole tab\n * (the main clickjacking/phishing vector); scripts and same-origin are\n * allowed so third-party players still run. Kept in sync with the sanitizer.\n */\nexport const EMBED_SANDBOX = 'allow-scripts allow-same-origin allow-presentation allow-popups';\n\n/** Limits the referrer leaked to the embedded third-party host. */\nexport const EMBED_REFERRER_POLICY = 'strict-origin-when-cross-origin';\n\n/**\n * Converts a URL into an embed target. Known providers (YouTube/Vimeo/Loom)\n * are canonicalized to their dedicated embed URLs; any other `https://` URL\n * is accepted as a `generic` embed. The iframe is always sandboxed on render\n * (see EMBED_SANDBOX), so untrusted hosts cannot navigate the top window.\n * Returns null only for non-https or unparseable URLs.\n */\nexport function toEmbedUrl(url: string): EmbedTarget | null {\n let parsed: URL;\n try {\n parsed = new URL(url.trim());\n } catch {\n return null;\n }\n if (parsed.protocol !== 'https:') return null;\n const host = parsed.hostname.replace(/^www\\./, '');\n\n // YouTube: watch?v=ID, youtu.be/ID, shorts/ID, embed/ID\n if (host === 'youtube.com' || host === 'youtube-nocookie.com' || host === 'youtu.be') {\n let id = '';\n if (host === 'youtu.be') id = parsed.pathname.slice(1).split('/')[0];\n else if (parsed.pathname === '/watch') id = parsed.searchParams.get('v') ?? '';\n else {\n const match = /^\\/(embed|shorts)\\/([\\w-]+)/.exec(parsed.pathname);\n if (match) id = match[2];\n }\n if (/^[\\w-]{6,20}$/.test(id)) {\n return { src: `https://www.youtube-nocookie.com/embed/${id}`, provider: 'youtube' };\n }\n }\n\n // Vimeo: vimeo.com/123456789, player.vimeo.com/video/123456789\n else if (host === 'vimeo.com' || host === 'player.vimeo.com') {\n const match = /\\/(?:video\\/)?(\\d{6,12})(?:$|[/?])/.exec(parsed.pathname);\n if (match) {\n return { src: `https://player.vimeo.com/video/${match[1]}`, provider: 'vimeo' };\n }\n }\n\n // Loom: loom.com/share/ID or loom.com/embed/ID\n else if (host === 'loom.com') {\n const match = /^\\/(share|embed)\\/([0-9a-f]{16,40})/.exec(parsed.pathname);\n if (match) {\n return { src: `https://www.loom.com/embed/${match[2]}`, provider: 'loom' };\n }\n }\n\n // Any other https URL: embed as-is, sandboxed.\n return { src: parsed.href, provider: 'generic' };\n}\n\n/**\n * True when a URL is permitted as an embed src (sanitizer check). Any\n * `https://` URL is allowed; the iframe is sandboxed at render time.\n */\nexport function isAllowedEmbedSrc(src: string): boolean {\n try {\n return new URL(src.trim()).protocol === 'https:';\n } catch {\n return false;\n }\n}\n\n/**\n * Pasting a bare provider URL onto an empty selection inserts an embed\n * instead of plain text. (Pasting over selected text still creates a link.)\n */\nexport function embedPastePlugin(): Plugin {\n return new Plugin({\n props: {\n handlePaste(view, event) {\n const { state } = view;\n if (!state.selection.empty) return false;\n const text = event.clipboardData?.getData('text/plain')?.trim();\n if (!text || /\\s/.test(text)) return false;\n const target = toEmbedUrl(text);\n if (!target) return false;\n const embed = state.schema.nodes.embed.create({\n src: target.src,\n provider: target.provider,\n });\n view.dispatch(state.tr.replaceSelectionWith(embed).scrollIntoView());\n return true;\n },\n },\n });\n}\n"]}
|
|
@@ -3,13 +3,18 @@ import { NodeView } from 'prosemirror-view';
|
|
|
3
3
|
/** Turns a LaTeX string into HTML (KaTeX/MathJax/MathML). Host-provided. */
|
|
4
4
|
export type MathRenderer = (latex: string, display: 'inline' | 'block') => string;
|
|
5
5
|
/**
|
|
6
|
-
* Inline atom rendering a math formula.
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* Inline atom rendering a math formula. Precedence:
|
|
7
|
+
* 1. A host-supplied `mathRenderer` (full control — e.g. KaTeX HTML, MathJax).
|
|
8
|
+
* 2. The built-in default: KaTeX compiled to **MathML**, which browsers render
|
|
9
|
+
* natively with no stylesheet or web fonts (works cleanly inside the
|
|
10
|
+
* editor's shadow root).
|
|
11
|
+
* 3. If KaTeX can't load / parse, the raw LaTeX stays visible.
|
|
9
12
|
*/
|
|
10
13
|
export declare class MathView implements NodeView {
|
|
11
14
|
dom: HTMLSpanElement;
|
|
12
15
|
private renderer?;
|
|
16
|
+
/** Bumps on every render so a slow async KaTeX result for a stale node is dropped. */
|
|
17
|
+
private token;
|
|
13
18
|
constructor(node: PMNode, renderer?: MathRenderer);
|
|
14
19
|
private render;
|
|
15
20
|
update(node: PMNode): boolean;
|