@nldd/design-system 0.8.64 → 0.8.66
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/dist/components/actions/button/button.d.ts.map +1 -1
- package/dist/components/actions/button/button.js +7 -6
- package/dist/components/actions/button/button.js.map +1 -1
- package/dist/components/actions/button/button.styles.d.ts.map +1 -1
- package/dist/components/actions/button/button.styles.js +9 -5
- package/dist/components/actions/button/button.styles.js.map +1 -1
- package/dist/components/actions/button-bar/button-bar.d.ts.map +1 -1
- package/dist/components/actions/button-bar/button-bar.js +3 -2
- package/dist/components/actions/button-bar/button-bar.js.map +1 -1
- package/dist/components/actions/button-group/button-group.d.ts.map +1 -1
- package/dist/components/actions/button-group/button-group.js +3 -2
- package/dist/components/actions/button-group/button-group.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.d.ts +4 -0
- package/dist/components/actions/icon-button/icon-button.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.js +13 -5
- package/dist/components/actions/icon-button/icon-button.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.styles.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.styles.js +15 -10
- package/dist/components/actions/icon-button/icon-button.styles.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.template.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.template.js +2 -0
- package/dist/components/actions/icon-button/icon-button.template.js.map +1 -1
- package/dist/components/actions/menu/menu.d.ts +1 -0
- package/dist/components/actions/menu/menu.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.js +33 -15
- package/dist/components/actions/menu/menu.js.map +1 -1
- package/dist/components/actions/menu/menu.styles.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.styles.js +8 -0
- package/dist/components/actions/menu/menu.styles.js.map +1 -1
- package/dist/components/actions/split-button/split-button.d.ts.map +1 -1
- package/dist/components/actions/split-button/split-button.js +5 -4
- package/dist/components/actions/split-button/split-button.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.d.ts +15 -2
- package/dist/components/actions/toolbar/toolbar.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.js +116 -42
- package/dist/components/actions/toolbar/toolbar.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.styles.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.styles.js +33 -18
- package/dist/components/actions/toolbar/toolbar.styles.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.template.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.template.js +5 -2
- package/dist/components/actions/toolbar/toolbar.template.js.map +1 -1
- package/dist/components/components.js +104 -102
- package/dist/components/content/blockquote/blockquote.styles.d.ts.map +1 -1
- package/dist/components/content/blockquote/blockquote.styles.js +0 -3
- package/dist/components/content/blockquote/blockquote.styles.js.map +1 -1
- package/dist/components/content/byline/byline.d.ts.map +1 -1
- package/dist/components/content/byline/byline.js +3 -2
- package/dist/components/content/byline/byline.js.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.d.ts +24 -64
- package/dist/components/content/code-viewer/code-viewer.d.ts.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.js +239 -156
- package/dist/components/content/code-viewer/code-viewer.js.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.styles.d.ts.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.styles.js +33 -92
- package/dist/components/content/code-viewer/code-viewer.styles.js.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.template.d.ts.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.template.js +10 -29
- package/dist/components/content/code-viewer/code-viewer.template.js.map +1 -1
- package/dist/components/content/icon/icon-aliases.d.ts.map +1 -1
- package/dist/components/content/icon/icon-aliases.js +43 -8
- package/dist/components/content/icon/icon-aliases.js.map +1 -1
- package/dist/components/content/icon/icon-registry.d.ts.map +1 -1
- package/dist/components/content/icon/icon-registry.js +34 -4
- package/dist/components/content/icon/icon-registry.js.map +1 -1
- package/dist/components/content/icon/icon.d.ts.map +1 -1
- package/dist/components/content/icon/icon.js +3 -2
- package/dist/components/content/icon/icon.js.map +1 -1
- package/dist/components/content/image/image.d.ts.map +1 -1
- package/dist/components/content/image/image.js +7 -6
- package/dist/components/content/image/image.js.map +1 -1
- package/dist/components/content/image/image.styles.d.ts.map +1 -1
- package/dist/components/content/image/image.styles.js +2 -6
- package/dist/components/content/image/image.styles.js.map +1 -1
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.d.ts.map +1 -1
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.js +8 -7
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.styles.d.ts.map +1 -1
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.styles.js +5 -1
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.styles.js.map +1 -1
- package/dist/components/content/rich-text/rich-text.d.ts.map +1 -1
- package/dist/components/content/rich-text/rich-text.js +3 -2
- package/dist/components/content/rich-text/rich-text.js.map +1 -1
- package/dist/components/content/tag/tag.d.ts.map +1 -1
- package/dist/components/content/tag/tag.js +5 -4
- package/dist/components/content/tag/tag.js.map +1 -1
- package/dist/components/content/title/title.d.ts.map +1 -1
- package/dist/components/content/title/title.js +2 -1
- package/dist/components/content/title/title.js.map +1 -1
- package/dist/components/content/token/token.d.ts +70 -0
- package/dist/components/content/token/token.d.ts.map +1 -0
- package/dist/components/content/token/token.js +170 -0
- package/dist/components/content/token/token.js.map +1 -0
- package/dist/components/content/token/token.styles.d.ts.map +1 -0
- package/dist/components/content/token/token.styles.js +122 -0
- package/dist/components/content/token/token.styles.js.map +1 -0
- package/dist/components/content/token/token.template.d.ts +6 -0
- package/dist/components/content/token/token.template.d.ts.map +1 -0
- package/dist/components/content/token/token.template.js +47 -0
- package/dist/components/content/token/token.template.js.map +1 -0
- package/dist/components/content/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/content/tooltip/tooltip.js +14 -5
- package/dist/components/content/tooltip/tooltip.js.map +1 -1
- package/dist/components/content/tooltip/tooltip.styles.d.ts.map +1 -1
- package/dist/components/content/tooltip/tooltip.styles.js +11 -0
- package/dist/components/content/tooltip/tooltip.styles.js.map +1 -1
- package/dist/components/gherkin-DhZlEZiy.js +115 -0
- package/dist/components/index-Bfw_pYWB.js +405 -0
- package/dist/components/index-Bqf6o41r.js +81 -0
- package/dist/components/index-CKnwqp_9.js +688 -0
- package/dist/components/index-CXT1jMFt.js +384 -0
- package/dist/components/index-DO7aT0MT.js +177 -0
- package/dist/components/index-DWwviobk.js +703 -0
- package/dist/components/index-DjsXjoZJ.js +67143 -0
- package/dist/components/index.d.ts +20 -18
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +20 -18
- package/dist/components/index.js.map +1 -1
- package/dist/components/inputs/code-editor/code-editor.d.ts +58 -29
- package/dist/components/inputs/code-editor/code-editor.d.ts.map +1 -1
- package/dist/components/inputs/code-editor/code-editor.js +241 -52
- package/dist/components/inputs/code-editor/code-editor.js.map +1 -1
- package/dist/components/inputs/code-editor/code-editor.styles.d.ts.map +1 -1
- package/dist/components/inputs/code-editor/code-editor.styles.js +58 -46
- package/dist/components/inputs/code-editor/code-editor.styles.js.map +1 -1
- package/dist/components/inputs/code-editor/code-editor.template.d.ts +1 -1
- package/dist/components/inputs/code-editor/code-editor.template.d.ts.map +1 -1
- package/dist/components/inputs/code-editor/code-editor.template.js +5 -22
- package/dist/components/inputs/code-editor/code-editor.template.js.map +1 -1
- package/dist/components/inputs/combo-box/combo-box.d.ts +15 -4
- package/dist/components/inputs/combo-box/combo-box.d.ts.map +1 -1
- package/dist/components/inputs/combo-box/combo-box.js +53 -9
- package/dist/components/inputs/combo-box/combo-box.js.map +1 -1
- package/dist/components/inputs/dropdown/dropdown.d.ts.map +1 -1
- package/dist/components/inputs/dropdown/dropdown.js +2 -1
- package/dist/components/inputs/dropdown/dropdown.js.map +1 -1
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.d.ts +1 -1
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.d.ts.map +1 -1
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.js +6 -5
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.js.map +1 -1
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.styles.d.ts.map +1 -1
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.styles.js +8 -11
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.styles.js.map +1 -1
- package/dist/components/inputs/number-field/number-field.d.ts.map +1 -1
- package/dist/components/inputs/number-field/number-field.js +2 -1
- package/dist/components/inputs/number-field/number-field.js.map +1 -1
- package/dist/components/inputs/password-field/password-field.d.ts.map +1 -1
- package/dist/components/inputs/password-field/password-field.js +3 -2
- package/dist/components/inputs/password-field/password-field.js.map +1 -1
- package/dist/components/inputs/radio-button-group/radio-button-group.js +1 -1
- package/dist/components/inputs/radio-button-group/radio-button-group.js.map +1 -1
- package/dist/components/inputs/search-field/search-field.d.ts.map +1 -1
- package/dist/components/inputs/search-field/search-field.js +2 -1
- package/dist/components/inputs/search-field/search-field.js.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.d.ts +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.d.ts.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.js +10 -9
- package/dist/components/inputs/segmented-control/segmented-control.js.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.styles.d.ts.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.styles.js +70 -36
- package/dist/components/inputs/segmented-control/segmented-control.styles.js.map +1 -1
- package/dist/components/inputs/stepper/stepper.d.ts.map +1 -1
- package/dist/components/inputs/stepper/stepper.js +2 -1
- package/dist/components/inputs/stepper/stepper.js.map +1 -1
- package/dist/components/inputs/switch/switch.d.ts.map +1 -1
- package/dist/components/inputs/switch/switch.js +2 -1
- package/dist/components/inputs/switch/switch.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.annotation-sentinels.d.ts +51 -0
- package/dist/components/inputs/text-editor/text-editor.annotation-sentinels.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.annotation-sentinels.js +148 -0
- package/dist/components/inputs/text-editor/text-editor.annotation-sentinels.js.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.annotations.d.ts +47 -0
- package/dist/components/inputs/text-editor/text-editor.annotations.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.annotations.js +327 -0
- package/dist/components/inputs/text-editor/text-editor.annotations.js.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.caret.d.ts +13 -0
- package/dist/components/inputs/text-editor/text-editor.caret.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.caret.js +27 -0
- package/dist/components/inputs/text-editor/text-editor.caret.js.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.commands.d.ts +68 -0
- package/dist/components/inputs/text-editor/text-editor.commands.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.commands.js +420 -0
- package/dist/components/inputs/text-editor/text-editor.commands.js.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.d.ts +241 -0
- package/dist/components/inputs/text-editor/text-editor.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.drag.d.ts +30 -0
- package/dist/components/inputs/text-editor/text-editor.drag.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.drag.js +231 -0
- package/dist/components/inputs/text-editor/text-editor.drag.js.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.i18n.d.ts +8 -0
- package/dist/components/inputs/text-editor/text-editor.i18n.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.i18n.js +13 -0
- package/dist/components/inputs/text-editor/text-editor.i18n.js.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.js +780 -0
- package/dist/components/inputs/text-editor/text-editor.js.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.links.d.ts +18 -0
- package/dist/components/inputs/text-editor/text-editor.links.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.links.js +147 -0
- package/dist/components/inputs/text-editor/text-editor.links.js.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.markdown.d.ts +20 -0
- package/dist/components/inputs/text-editor/text-editor.markdown.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.markdown.js +372 -0
- package/dist/components/inputs/text-editor/text-editor.markdown.js.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.mentions.d.ts +32 -0
- package/dist/components/inputs/text-editor/text-editor.mentions.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.mentions.js +153 -0
- package/dist/components/inputs/text-editor/text-editor.mentions.js.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.ordered-list.d.ts +12 -0
- package/dist/components/inputs/text-editor/text-editor.ordered-list.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.ordered-list.js +106 -0
- package/dist/components/inputs/text-editor/text-editor.ordered-list.js.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.styles.d.ts +2 -0
- package/dist/components/inputs/text-editor/text-editor.styles.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.styles.js +592 -0
- package/dist/components/inputs/text-editor/text-editor.styles.js.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.template.d.ts +4 -0
- package/dist/components/inputs/text-editor/text-editor.template.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.template.js +7 -0
- package/dist/components/inputs/text-editor/text-editor.template.js.map +1 -0
- package/dist/components/inputs/text-field/text-field.d.ts.map +1 -1
- package/dist/components/inputs/text-field/text-field.js +3 -2
- package/dist/components/inputs/text-field/text-field.js.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.d.ts.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.js +4 -3
- package/dist/components/inputs/toggle-button/toggle-button.js.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.styles.d.ts.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.styles.js +14 -10
- package/dist/components/inputs/toggle-button/toggle-button.styles.js.map +1 -1
- package/dist/components/inputs/toggle-button-group/toggle-button-group.d.ts +1 -1
- package/dist/components/inputs/toggle-button-group/toggle-button-group.d.ts.map +1 -1
- package/dist/components/inputs/toggle-button-group/toggle-button-group.js +5 -4
- package/dist/components/inputs/toggle-button-group/toggle-button-group.js.map +1 -1
- package/dist/components/inputs/token-field/token-field.d.ts +257 -0
- package/dist/components/inputs/token-field/token-field.d.ts.map +1 -0
- package/dist/components/inputs/token-field/token-field.i18n.d.ts +9 -0
- package/dist/components/inputs/token-field/token-field.i18n.d.ts.map +1 -0
- package/dist/components/inputs/token-field/token-field.i18n.js +8 -0
- package/dist/components/inputs/token-field/token-field.i18n.js.map +1 -0
- package/dist/components/inputs/token-field/token-field.js +889 -0
- package/dist/components/inputs/token-field/token-field.js.map +1 -0
- package/dist/components/inputs/token-field/token-field.styles.d.ts +2 -0
- package/dist/components/inputs/token-field/token-field.styles.d.ts.map +1 -0
- package/dist/components/inputs/token-field/token-field.styles.js +194 -0
- package/dist/components/inputs/token-field/token-field.styles.js.map +1 -0
- package/dist/components/inputs/token-field/token-field.template.d.ts +8 -0
- package/dist/components/inputs/token-field/token-field.template.d.ts.map +1 -0
- package/dist/components/inputs/token-field/token-field.template.js +136 -0
- package/dist/components/inputs/token-field/token-field.template.js.map +1 -0
- package/dist/components/layout/app-view/app-view.d.ts +26 -6
- package/dist/components/layout/app-view/app-view.d.ts.map +1 -1
- package/dist/components/layout/app-view/app-view.js +103 -12
- package/dist/components/layout/app-view/app-view.js.map +1 -1
- package/dist/components/layout/app-view/app-view.styles.d.ts.map +1 -1
- package/dist/components/layout/app-view/app-view.styles.js +25 -0
- package/dist/components/layout/app-view/app-view.styles.js.map +1 -1
- package/dist/components/layout/box/box.d.ts.map +1 -1
- package/dist/components/layout/box/box.js +2 -1
- package/dist/components/layout/box/box.js.map +1 -1
- package/dist/components/layout/box/box.styles.d.ts.map +1 -1
- package/dist/components/layout/box/box.styles.js +1 -6
- package/dist/components/layout/box/box.styles.js.map +1 -1
- package/dist/components/layout/collection/collection.d.ts +5 -0
- package/dist/components/layout/collection/collection.d.ts.map +1 -1
- package/dist/components/layout/collection/collection.js +17 -1
- package/dist/components/layout/collection/collection.js.map +1 -1
- package/dist/components/layout/collection/collection.styles.d.ts.map +1 -1
- package/dist/components/layout/collection/collection.styles.js +18 -17
- package/dist/components/layout/collection/collection.styles.js.map +1 -1
- package/dist/components/layout/page/page.d.ts +31 -1
- package/dist/components/layout/page/page.d.ts.map +1 -1
- package/dist/components/layout/page/page.js +112 -26
- package/dist/components/layout/page/page.js.map +1 -1
- package/dist/components/layout/page/page.styles.d.ts.map +1 -1
- package/dist/components/layout/page/page.styles.js +48 -0
- package/dist/components/layout/page/page.styles.js.map +1 -1
- package/dist/components/layout/page-footer/page-footer.d.ts.map +1 -1
- package/dist/components/layout/page-footer/page-footer.js +2 -1
- package/dist/components/layout/page-footer/page-footer.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.d.ts +7 -23
- package/dist/components/layout/page-sections/hero/hero.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.js +12 -73
- package/dist/components/layout/page-sections/hero/hero.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.styles.js +13 -159
- package/dist/components/layout/page-sections/hero/hero.styles.js.map +1 -1
- package/dist/components/layout/popover/popover.d.ts +1 -0
- package/dist/components/layout/popover/popover.d.ts.map +1 -1
- package/dist/components/layout/popover/popover.js +14 -1
- package/dist/components/layout/popover/popover.js.map +1 -1
- package/dist/components/layout/popover/popover.styles.d.ts.map +1 -1
- package/dist/components/layout/popover/popover.styles.js +11 -0
- package/dist/components/layout/popover/popover.styles.js.map +1 -1
- package/dist/components/layout/sheet/sheet.d.ts +5 -1
- package/dist/components/layout/sheet/sheet.d.ts.map +1 -1
- package/dist/components/layout/sheet/sheet.js +20 -6
- package/dist/components/layout/sheet/sheet.js.map +1 -1
- package/dist/components/layout/sheet/sheet.styles.d.ts.map +1 -1
- package/dist/components/layout/sheet/sheet.styles.js +60 -83
- package/dist/components/layout/sheet/sheet.styles.js.map +1 -1
- package/dist/components/layout/spacer/spacer.d.ts.map +1 -1
- package/dist/components/layout/spacer/spacer.js +2 -1
- package/dist/components/layout/spacer/spacer.js.map +1 -1
- package/dist/components/layout/spacer/spacer.styles.d.ts.map +1 -1
- package/dist/components/layout/spacer/spacer.styles.js +0 -1
- package/dist/components/layout/spacer/spacer.styles.js.map +1 -1
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.d.ts +3 -0
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.d.ts.map +1 -1
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.js +49 -0
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.js.map +1 -1
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.styles.d.ts.map +1 -1
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.styles.js +55 -0
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.styles.js.map +1 -1
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.template.d.ts.map +1 -1
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.template.js +18 -9
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.template.js.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.d.ts +8 -0
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.d.ts.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.js +21 -0
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.js.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.styles.d.ts.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.styles.js +34 -0
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.styles.js.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.template.d.ts.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.template.js +17 -7
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.template.js.map +1 -1
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.d.ts +6 -0
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.d.ts.map +1 -1
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.js +17 -0
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.js.map +1 -1
- package/dist/components/layout/split-views/split-view-divider/split-view-divider.d.ts.map +1 -1
- package/dist/components/layout/split-views/split-view-divider/split-view-divider.js +2 -1
- package/dist/components/layout/split-views/split-view-divider/split-view-divider.js.map +1 -1
- package/dist/components/layout/split-views/split-view-divider/split-view-divider.styles.js +10 -10
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.d.ts +10 -0
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.d.ts.map +1 -1
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.js +13 -0
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.js.map +1 -1
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.styles.d.ts.map +1 -1
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.styles.js +19 -0
- package/dist/components/layout/split-views/split-view-pane/split-view-pane.styles.js.map +1 -1
- package/dist/components/layout/window/window.d.ts.map +1 -1
- package/dist/components/layout/window/window.js +11 -2
- package/dist/components/layout/window/window.js.map +1 -1
- package/dist/components/lists-and-tables/cells/cell/cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/cell/cell.js +4 -3
- package/dist/components/lists-and-tables/cells/cell/cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/description-cell/description-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/description-cell/description-cell.js +3 -2
- package/dist/components/lists-and-tables/cells/description-cell/description-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.js +2 -1
- package/dist/components/lists-and-tables/cells/drag-handle-cell/drag-handle-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.js +3 -2
- package/dist/components/lists-and-tables/cells/icon-cell/icon-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.js +10 -9
- package/dist/components/lists-and-tables/cells/text-cell/text-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/timeline-track-cell/timeline-track-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/timeline-track-cell/timeline-track-cell.js +3 -2
- package/dist/components/lists-and-tables/cells/timeline-track-cell/timeline-track-cell.js.map +1 -1
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.js +9 -8
- package/dist/components/lists-and-tables/cells/title-cell/title-cell.js.map +1 -1
- package/dist/components/lists-and-tables/list/list.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list/list.js +5 -4
- package/dist/components/lists-and-tables/list/list.js.map +1 -1
- package/dist/components/lists-and-tables/list/list.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list/list.styles.js +3 -2
- package/dist/components/lists-and-tables/list/list.styles.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.js +2 -1
- package/dist/components/lists-and-tables/list-item/list-item.js.map +1 -1
- package/dist/components/lists-and-tables/table/table.d.ts.map +1 -1
- package/dist/components/lists-and-tables/table/table.js +4 -3
- package/dist/components/lists-and-tables/table/table.js.map +1 -1
- package/dist/components/navigation/breadcrumbs/breadcrumbs.d.ts.map +1 -1
- package/dist/components/navigation/breadcrumbs/breadcrumbs.js +2 -1
- package/dist/components/navigation/breadcrumbs/breadcrumbs.js.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.d.ts.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.js +5 -4
- package/dist/components/navigation/document-tab-bar/document-tab-bar.js.map +1 -1
- package/dist/components/navigation/link/link.d.ts.map +1 -1
- package/dist/components/navigation/link/link.js +2 -1
- package/dist/components/navigation/link/link.js.map +1 -1
- package/dist/components/navigation/menu-bar/menu-bar.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar/menu-bar.js +2 -1
- package/dist/components/navigation/menu-bar/menu-bar.js.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.js +4 -3
- package/dist/components/navigation/menu-bar-item/menu-bar-item.js.map +1 -1
- package/dist/components/navigation/skip-link/skip-link.d.ts.map +1 -1
- package/dist/components/navigation/skip-link/skip-link.js +2 -1
- package/dist/components/navigation/skip-link/skip-link.js.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.d.ts +7 -0
- package/dist/components/navigation/tab-bar/tab-bar.d.ts.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.js +31 -5
- package/dist/components/navigation/tab-bar/tab-bar.js.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.styles.d.ts.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.styles.js +74 -78
- package/dist/components/navigation/tab-bar/tab-bar.styles.js.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.template.d.ts.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.template.js +8 -1
- package/dist/components/navigation/tab-bar/tab-bar.template.js.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.d.ts.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js +7 -6
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.d.ts +6 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.d.ts.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.js +47 -10
- package/dist/components/navigation/top-title-bar/top-title-bar.js.map +1 -1
- package/dist/components/shell-BlsXDxCn.js +222 -0
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.d.ts.map +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.js +4 -3
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.js.map +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.styles.d.ts.map +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.styles.js +0 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.styles.js.map +1 -1
- package/dist/components/status-and-feedback/badge/badge.d.ts.map +1 -1
- package/dist/components/status-and-feedback/badge/badge.js +4 -3
- package/dist/components/status-and-feedback/badge/badge.js.map +1 -1
- package/dist/components/status-and-feedback/banner/banner.d.ts +0 -1
- package/dist/components/status-and-feedback/banner/banner.d.ts.map +1 -1
- package/dist/components/status-and-feedback/banner/banner.js +13 -13
- package/dist/components/status-and-feedback/banner/banner.js.map +1 -1
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.d.ts.map +1 -1
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.js +5 -4
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.js.map +1 -1
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.d.ts +1 -0
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.d.ts.map +1 -1
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.js +35 -4
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.js.map +1 -1
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.styles.d.ts.map +1 -1
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.styles.js +11 -0
- package/dist/components/status-and-feedback/just-in-time-education/just-in-time-education.styles.js.map +1 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.d.ts.map +1 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.js +4 -3
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.js.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.d.ts.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.js +9 -8
- package/dist/components/status-and-feedback/progress-bar/progress-bar.js.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.styles.d.ts.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.styles.js +0 -6
- package/dist/components/status-and-feedback/progress-bar/progress-bar.styles.js.map +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.d.ts.map +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.js +8 -7
- package/dist/components/status-and-feedback/progress-circle/progress-circle.js.map +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.styles.d.ts.map +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.styles.js +0 -2
- package/dist/components/status-and-feedback/progress-circle/progress-circle.styles.js.map +1 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.d.ts.map +1 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.js +3 -2
- package/dist/components/status-and-feedback/status-bar/status-bar.js.map +1 -1
- package/dist/components/toml-BOuWGMcf.js +76 -0
- package/dist/css/fouc.css +30 -0
- package/dist/css/global.css +1 -0
- package/dist/css/rich-text.css +0 -5
- package/dist/css/settings.css +25 -10
- package/dist/utilities/codemirror/codemirror-element.d.ts +66 -0
- package/dist/utilities/codemirror/codemirror-element.d.ts.map +1 -0
- package/dist/utilities/codemirror/codemirror-element.js +121 -0
- package/dist/utilities/codemirror/codemirror-element.js.map +1 -0
- package/dist/utilities/codemirror/languages.d.ts +4 -0
- package/dist/utilities/codemirror/languages.d.ts.map +1 -0
- package/dist/utilities/codemirror/languages.js +39 -0
- package/dist/utilities/codemirror/languages.js.map +1 -0
- package/dist/utilities/codemirror/theme.d.ts +4 -0
- package/dist/utilities/codemirror/theme.d.ts.map +1 -0
- package/dist/utilities/codemirror/theme.js +84 -0
- package/dist/utilities/codemirror/theme.js.map +1 -0
- package/dist/utilities/dismiss-from-title-bar.d.ts +19 -0
- package/dist/utilities/dismiss-from-title-bar.d.ts.map +1 -0
- package/dist/utilities/dismiss-from-title-bar.js +21 -0
- package/dist/utilities/dismiss-from-title-bar.js.map +1 -0
- package/dist/utilities/reflect-non-default.d.ts +30 -0
- package/dist/utilities/reflect-non-default.d.ts.map +1 -0
- package/dist/utilities/reflect-non-default.js +34 -0
- package/dist/utilities/reflect-non-default.js.map +1 -0
- package/dist/utilities/scroll-mode-controller.d.ts +69 -0
- package/dist/utilities/scroll-mode-controller.d.ts.map +1 -0
- package/dist/utilities/scroll-mode-controller.js +101 -0
- package/dist/utilities/scroll-mode-controller.js.map +1 -0
- package/package.json +92 -68
- package/dist/components/index-BNhqNvDd.js +0 -36784
- package/dist/components/inputs/token/token.d.ts +0 -42
- package/dist/components/inputs/token/token.d.ts.map +0 -1
- package/dist/components/inputs/token/token.js +0 -86
- package/dist/components/inputs/token/token.js.map +0 -1
- package/dist/components/inputs/token/token.styles.d.ts.map +0 -1
- package/dist/components/inputs/token/token.styles.js +0 -142
- package/dist/components/inputs/token/token.styles.js.map +0 -1
- package/dist/components/inputs/token/token.template.d.ts +0 -4
- package/dist/components/inputs/token/token.template.d.ts.map +0 -1
- package/dist/components/inputs/token/token.template.js +0 -41
- package/dist/components/inputs/token/token.template.js.map +0 -1
- package/dist/components/prism-bash-vbqaw3JR.js +0 -226
- package/dist/components/prism-css-B93tXdOU.js +0 -59
- package/dist/components/prism-gherkin-CMPYyXOQ.js +0 -82
- package/dist/components/prism-javascript-DeC_17Pw.js +0 -140
- package/dist/components/prism-json-DIMpow89.js +0 -25
- package/dist/components/prism-markdown-D-uFBkiz.js +0 -339
- package/dist/components/prism-markup-DfJYPYHA.js +0 -177
- package/dist/components/prism-python--N285k7w.js +0 -99
- package/dist/components/prism-rust-Cnm1tSdo.js +0 -157
- package/dist/components/prism-sql-BGqCBMyJ.js +0 -33
- package/dist/components/prism-toml-Ubdq-a5x.js +0 -45
- package/dist/components/prism-typescript-BPJAiB1s.js +0 -87
- package/dist/components/prism-yaml-DO0f9pf6.js +0 -71
- /package/dist/components/{inputs → content}/token/token.styles.d.ts +0 -0
|
@@ -7,45 +7,61 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
/**
|
|
8
8
|
* Nederlandse Digitale Dienst Code Editor Component (Lit + TypeScript)
|
|
9
9
|
*
|
|
10
|
-
* A monospace
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* the editable counterpart look like the same surface.
|
|
10
|
+
* A monospace editor for code, YAML, JSON and other technical content, built
|
|
11
|
+
* on CodeMirror 6 (via NLDDCodeMirrorElement). Visually pairs with
|
|
12
|
+
* nldd-code-viewer for a matching read-only surface.
|
|
14
13
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
14
|
+
* Default `variant="simple"` is a bare, flush editor (no frame, no focus ring)
|
|
15
|
+
* for use inside an nldd-form-field or a consumer composition that owns its own
|
|
16
|
+
* chrome and focus treatment; the caret is rendered as a prominent accent as
|
|
17
|
+
* the focus cue. `variant="input-field"` adds the framed surface (border ring, tinted
|
|
18
|
+
* fill, inner padding, radius) and a focus ring for standalone use.
|
|
18
19
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
20
|
+
* The simple variant has no surrounding space of its own: let a layout
|
|
21
|
+
* container own the spacing and forward clicks with `focusFromPoint()` so
|
|
22
|
+
* clicking the padding still starts editing.
|
|
23
|
+
*
|
|
24
|
+
* Optional `language` enables lazy syntax highlighting; `line-numbers` adds a
|
|
25
|
+
* gutter (click a number to move the caret to that line).
|
|
21
26
|
*
|
|
22
27
|
* @element nldd-code-editor
|
|
23
28
|
*
|
|
24
|
-
* @attr {string} value
|
|
25
|
-
* @attr {string} placeholder
|
|
26
|
-
* @attr {string} input-id
|
|
27
|
-
* @attr {boolean} disabled
|
|
28
|
-
* @attr {string} name
|
|
29
|
-
* @attr {boolean} readonly
|
|
30
|
-
* @attr {boolean} required
|
|
31
|
-
* @attr {boolean} wrap
|
|
32
|
-
* @attr {number} rows
|
|
33
|
-
* @attr {string} resize
|
|
34
|
-
*
|
|
35
|
-
* @attr {string}
|
|
29
|
+
* @attr {string} value - Editor content
|
|
30
|
+
* @attr {string} placeholder - Placeholder text shown while empty
|
|
31
|
+
* @attr {string} input-id - Sets the id on the editable element. Set automatically by nldd-form-field.
|
|
32
|
+
* @attr {boolean} disabled - Disabled state
|
|
33
|
+
* @attr {string} name - Field name for form submission
|
|
34
|
+
* @attr {boolean} readonly - Readonly state (focusable and selectable, not editable)
|
|
35
|
+
* @attr {boolean} required - Required state
|
|
36
|
+
* @attr {boolean} wrap - Wrap long lines instead of horizontal scroll
|
|
37
|
+
* @attr {number} rows - Minimum visible rows (the floor in every resize mode). Default: 6.
|
|
38
|
+
* @attr {string} resize - 'none' (fixed) | 'vertical' (drag) | 'auto' (grow, default)
|
|
39
|
+
* @attr {string} variant - 'simple' (default, bare) | 'input-field' (framed surface)
|
|
40
|
+
* @attr {string} language - Highlight grammar (yaml, json, javascript, typescript, css, html, xml, bash, markdown, rust, gherkin, toml, sql, python). Empty disables highlighting.
|
|
41
|
+
* @attr {boolean} line-numbers - Show a line-number gutter
|
|
42
|
+
* @attr {string} accessible-label - Accessible label forwarded to the editor. Set automatically by nldd-form-field.
|
|
36
43
|
*
|
|
37
|
-
* @fires input - When value
|
|
38
|
-
* @fires change - When
|
|
44
|
+
* @fires input - When the content changes (detail: { value })
|
|
45
|
+
* @fires change - When the content is committed on blur (detail: { value })
|
|
39
46
|
*/
|
|
40
47
|
import { LitElement } from 'lit';
|
|
41
48
|
import { customElement, property, query } from 'lit/decorators.js';
|
|
49
|
+
import { reflectNonDefault } from '../../../utilities/reflect-non-default.js';
|
|
50
|
+
import { EditorView, keymap, drawSelection, lineNumbers as cmLineNumbers, placeholder as cmPlaceholder, } from '@codemirror/view';
|
|
51
|
+
import { Compartment, EditorState } from '@codemirror/state';
|
|
52
|
+
import { defaultKeymap, history, historyKeymap } from '@codemirror/commands';
|
|
53
|
+
import { NLDDCodeMirrorElement } from '../../../utilities/codemirror/codemirror-element.js';
|
|
54
|
+
import { nlddCodeMirrorTheme } from '../../../utilities/codemirror/theme.js';
|
|
55
|
+
import { loadLanguage } from '../../../utilities/codemirror/languages.js';
|
|
42
56
|
import { codeEditorStyles } from './code-editor.styles.js';
|
|
43
57
|
import { codeEditorTemplate } from './code-editor.template.js';
|
|
44
|
-
let NLDDCodeEditor = class NLDDCodeEditor extends
|
|
58
|
+
let NLDDCodeEditor = class NLDDCodeEditor extends NLDDCodeMirrorElement {
|
|
45
59
|
constructor() {
|
|
46
60
|
super(...arguments);
|
|
47
61
|
this._internals = this.attachInternals();
|
|
48
62
|
this._initialValue = '';
|
|
63
|
+
this._valueAtFocus = '';
|
|
64
|
+
this._accessibleLabelWarned = false;
|
|
49
65
|
this.value = '';
|
|
50
66
|
this.inputId = '';
|
|
51
67
|
this.placeholder = '';
|
|
@@ -55,19 +71,203 @@ let NLDDCodeEditor = class NLDDCodeEditor extends LitElement {
|
|
|
55
71
|
this.required = false;
|
|
56
72
|
this.wrap = false;
|
|
57
73
|
this.rows = 6;
|
|
58
|
-
this.resize = '
|
|
74
|
+
this.resize = 'auto';
|
|
75
|
+
this.variant = 'simple';
|
|
76
|
+
this.language = '';
|
|
77
|
+
this.lineNumbers = false;
|
|
59
78
|
this.accessibleLabel = '';
|
|
60
|
-
|
|
79
|
+
// Compartments let us reconfigure single concerns without rebuilding state.
|
|
80
|
+
this._editableCompartment = new Compartment();
|
|
81
|
+
this._wrapCompartment = new Compartment();
|
|
82
|
+
this._lineNumbersCompartment = new Compartment();
|
|
83
|
+
this._placeholderCompartment = new Compartment();
|
|
84
|
+
this._attrsCompartment = new Compartment();
|
|
85
|
+
this._languageCompartment = new Compartment();
|
|
86
|
+
this._onScrollerPointerDown = (event) => {
|
|
87
|
+
// Only the scroller's own padding — not the content/gutter inside it.
|
|
88
|
+
// pointerdown covers mouse, touch and pen in one event.
|
|
89
|
+
if (event.target !== this.view?.scrollDOM)
|
|
90
|
+
return;
|
|
91
|
+
this.focusFromPoint(event.clientX, event.clientY);
|
|
92
|
+
event.preventDefault();
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
getEditorParent() {
|
|
96
|
+
return this._container;
|
|
97
|
+
}
|
|
98
|
+
buildExtensions() {
|
|
99
|
+
return [
|
|
100
|
+
nlddCodeMirrorTheme,
|
|
101
|
+
history(),
|
|
102
|
+
drawSelection(),
|
|
103
|
+
keymap.of([...defaultKeymap, ...historyKeymap]),
|
|
104
|
+
this._placeholderCompartment.of(this._placeholderExtension()),
|
|
105
|
+
this._wrapCompartment.of(this.wrap ? EditorView.lineWrapping : []),
|
|
106
|
+
this._lineNumbersCompartment.of(this._lineNumbersExtension()),
|
|
107
|
+
this._editableCompartment.of(this._editableExtension()),
|
|
108
|
+
this._attrsCompartment.of(this._attrsExtension()),
|
|
109
|
+
this._languageCompartment.of([]),
|
|
110
|
+
EditorView.updateListener.of((u) => {
|
|
111
|
+
if (u.docChanged)
|
|
112
|
+
this._onDocChanged();
|
|
113
|
+
}),
|
|
114
|
+
EditorView.domEventHandlers({
|
|
115
|
+
focus: () => {
|
|
116
|
+
this._valueAtFocus = this.value;
|
|
117
|
+
},
|
|
118
|
+
blur: () => {
|
|
119
|
+
if (this.value !== this._valueAtFocus)
|
|
120
|
+
this._emitChange();
|
|
121
|
+
},
|
|
122
|
+
}),
|
|
123
|
+
];
|
|
124
|
+
}
|
|
125
|
+
_editableExtension() {
|
|
126
|
+
// Readonly stays focusable/selectable (read + copy); disabled is inert.
|
|
127
|
+
const editable = !this.disabled;
|
|
128
|
+
const readOnly = this.disabled || this.readonly;
|
|
129
|
+
return [EditorView.editable.of(editable), EditorState.readOnly.of(readOnly)];
|
|
130
|
+
}
|
|
131
|
+
_placeholderExtension() {
|
|
132
|
+
return this.placeholder ? cmPlaceholder(this.placeholder) : [];
|
|
133
|
+
}
|
|
134
|
+
_lineNumbersExtension() {
|
|
135
|
+
if (!this.lineNumbers)
|
|
136
|
+
return [];
|
|
137
|
+
// Clicking a line number moves the caret to the start of that line.
|
|
138
|
+
return cmLineNumbers({
|
|
139
|
+
domEventHandlers: {
|
|
140
|
+
mousedown: (view, line) => {
|
|
141
|
+
view.dispatch({ selection: { anchor: line.from } });
|
|
142
|
+
view.focus();
|
|
143
|
+
return true;
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
_attrsExtension() {
|
|
149
|
+
// CodeMirror's content is a bare contenteditable; give it the textbox
|
|
150
|
+
// semantics a native <textarea> had — role, multiline, and the readonly/
|
|
151
|
+
// required state — so screen readers announce it correctly (WCAG 4.1.2).
|
|
152
|
+
const attrs = {
|
|
153
|
+
'role': 'textbox',
|
|
154
|
+
'aria-multiline': 'true',
|
|
155
|
+
};
|
|
156
|
+
if (this.accessibleLabel)
|
|
157
|
+
attrs['aria-label'] = this.accessibleLabel;
|
|
158
|
+
if (this.inputId)
|
|
159
|
+
attrs['id'] = this.inputId;
|
|
160
|
+
// disabled makes the field inert (contenteditable=false); readonly keeps it
|
|
161
|
+
// focusable but non-editable. Either way it's not editable, so reflect
|
|
162
|
+
// aria-readonly. aria-required mirrors the required constraint.
|
|
163
|
+
if (this.readonly || this.disabled)
|
|
164
|
+
attrs['aria-readonly'] = 'true';
|
|
165
|
+
if (this.required)
|
|
166
|
+
attrs['aria-required'] = 'true';
|
|
167
|
+
return EditorView.contentAttributes.of(attrs);
|
|
61
168
|
}
|
|
62
169
|
firstUpdated() {
|
|
63
170
|
this._initialValue = this.value;
|
|
171
|
+
this.style.setProperty('--_rows', String(this.rows));
|
|
172
|
+
this.mountEditor(this.value);
|
|
173
|
+
this.onEditorMounted();
|
|
174
|
+
}
|
|
175
|
+
/* Runs on the initial mount and on every re-mount after a detach/reattach
|
|
176
|
+
* (e.g. Vue <KeepAlive>): the view — and its scrollDOM — is rebuilt, so the
|
|
177
|
+
* padding-click forwarder and language must be (re)applied here. */
|
|
178
|
+
onEditorMounted() {
|
|
179
|
+
// A press on the scroller's own padding (outside .cm-content) doesn't
|
|
180
|
+
// place a caret; forward it to the nearest line so the padding is
|
|
181
|
+
// clickable too. CM attaches its own handlers to the content, not the
|
|
182
|
+
// scroller, so this is a plain listener on the scroller element.
|
|
183
|
+
this.view?.scrollDOM.addEventListener('pointerdown', this._onScrollerPointerDown);
|
|
184
|
+
this._internals.setFormValue(this.doc);
|
|
185
|
+
if (this.language)
|
|
186
|
+
void this._applyLanguage();
|
|
187
|
+
this._checkAccessibleLabel();
|
|
64
188
|
}
|
|
65
189
|
updated(changed) {
|
|
66
|
-
if (changed.has('
|
|
67
|
-
this.
|
|
190
|
+
if (changed.has('rows')) {
|
|
191
|
+
this.style.setProperty('--_rows', String(this.rows));
|
|
192
|
+
}
|
|
193
|
+
if (this.view) {
|
|
194
|
+
if (changed.has('value')) {
|
|
195
|
+
const docWas = this.doc;
|
|
196
|
+
this.setDoc(this.value);
|
|
197
|
+
this._internals.setFormValue(this.value);
|
|
198
|
+
// A programmatic value change while focused must not look like a user edit
|
|
199
|
+
// on the next blur: if setDoc actually moved the doc (i.e. this wasn't the
|
|
200
|
+
// echo of the user's own typing, where the doc already equals value),
|
|
201
|
+
// advance the focus-time baseline too.
|
|
202
|
+
if (docWas !== this.value)
|
|
203
|
+
this._valueAtFocus = this.value;
|
|
204
|
+
}
|
|
205
|
+
if (changed.has('disabled') || changed.has('readonly')) {
|
|
206
|
+
this.reconfigure(this._editableCompartment, this._editableExtension());
|
|
207
|
+
}
|
|
208
|
+
// readonly/required/disabled also drive the content's aria-readonly/
|
|
209
|
+
// aria-required, so refresh the attrs compartment when they change.
|
|
210
|
+
if (changed.has('disabled') || changed.has('readonly') || changed.has('required')) {
|
|
211
|
+
this.reconfigure(this._attrsCompartment, this._attrsExtension());
|
|
212
|
+
}
|
|
213
|
+
if (changed.has('wrap')) {
|
|
214
|
+
this.reconfigure(this._wrapCompartment, this.wrap ? EditorView.lineWrapping : []);
|
|
215
|
+
}
|
|
216
|
+
if (changed.has('lineNumbers')) {
|
|
217
|
+
this.reconfigure(this._lineNumbersCompartment, this._lineNumbersExtension());
|
|
218
|
+
}
|
|
219
|
+
if (changed.has('placeholder')) {
|
|
220
|
+
this.reconfigure(this._placeholderCompartment, this._placeholderExtension());
|
|
221
|
+
}
|
|
222
|
+
if (changed.has('accessibleLabel') || changed.has('inputId')) {
|
|
223
|
+
this.reconfigure(this._attrsCompartment, this._attrsExtension());
|
|
224
|
+
}
|
|
225
|
+
if (changed.has('language')) {
|
|
226
|
+
void this._applyLanguage();
|
|
227
|
+
}
|
|
68
228
|
}
|
|
69
229
|
this._checkAccessibleLabel();
|
|
70
230
|
}
|
|
231
|
+
async _applyLanguage() {
|
|
232
|
+
const lang = this.language;
|
|
233
|
+
if (!lang) {
|
|
234
|
+
this.reconfigure(this._languageCompartment, []);
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
const pending = loadLanguage(lang);
|
|
238
|
+
if (!pending) {
|
|
239
|
+
this.reconfigure(this._languageCompartment, []);
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
try {
|
|
243
|
+
const support = await pending;
|
|
244
|
+
// The attribute may have changed while the grammar was loading.
|
|
245
|
+
if (this.language === lang)
|
|
246
|
+
this.reconfigure(this._languageCompartment, support);
|
|
247
|
+
}
|
|
248
|
+
catch {
|
|
249
|
+
this.reconfigure(this._languageCompartment, []);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
_onDocChanged() {
|
|
253
|
+
const text = this.doc;
|
|
254
|
+
if (text === this.value)
|
|
255
|
+
return;
|
|
256
|
+
this.value = text;
|
|
257
|
+
this._internals.setFormValue(text);
|
|
258
|
+
this.dispatchEvent(new CustomEvent('input', {
|
|
259
|
+
detail: { value: text },
|
|
260
|
+
bubbles: true,
|
|
261
|
+
composed: true,
|
|
262
|
+
}));
|
|
263
|
+
}
|
|
264
|
+
_emitChange() {
|
|
265
|
+
this.dispatchEvent(new CustomEvent('change', {
|
|
266
|
+
detail: { value: this.value },
|
|
267
|
+
bubbles: true,
|
|
268
|
+
composed: true,
|
|
269
|
+
}));
|
|
270
|
+
}
|
|
71
271
|
/* Ran from updated(), not firstUpdated(): a parent nldd-form-field sets
|
|
72
272
|
* input-id slightly after our first render, so checking earlier triggers
|
|
73
273
|
* a spurious warning for the standard form-field usage. We re-check on
|
|
@@ -90,26 +290,6 @@ let NLDDCodeEditor = class NLDDCodeEditor extends LitElement {
|
|
|
90
290
|
if (typeof state === 'string')
|
|
91
291
|
this.value = state;
|
|
92
292
|
}
|
|
93
|
-
_handleInput(e) {
|
|
94
|
-
e.stopPropagation();
|
|
95
|
-
const textarea = e.target;
|
|
96
|
-
this.value = textarea.value;
|
|
97
|
-
this.dispatchEvent(new CustomEvent('input', {
|
|
98
|
-
detail: { value: this.value },
|
|
99
|
-
bubbles: true,
|
|
100
|
-
composed: true,
|
|
101
|
-
}));
|
|
102
|
-
}
|
|
103
|
-
_handleChange(e) {
|
|
104
|
-
e.stopPropagation();
|
|
105
|
-
const textarea = e.target;
|
|
106
|
-
this.value = textarea.value;
|
|
107
|
-
this.dispatchEvent(new CustomEvent('change', {
|
|
108
|
-
detail: { value: this.value },
|
|
109
|
-
bubbles: true,
|
|
110
|
-
composed: true,
|
|
111
|
-
}));
|
|
112
|
-
}
|
|
113
293
|
render() {
|
|
114
294
|
return codeEditorTemplate(this);
|
|
115
295
|
}
|
|
@@ -127,7 +307,7 @@ __decorate([
|
|
|
127
307
|
property({ type: String, attribute: 'input-id' })
|
|
128
308
|
], NLDDCodeEditor.prototype, "inputId", void 0);
|
|
129
309
|
__decorate([
|
|
130
|
-
property({
|
|
310
|
+
property({ reflect: true, converter: reflectNonDefault('') })
|
|
131
311
|
], NLDDCodeEditor.prototype, "placeholder", void 0);
|
|
132
312
|
__decorate([
|
|
133
313
|
property({ type: Boolean, reflect: true })
|
|
@@ -148,14 +328,23 @@ __decorate([
|
|
|
148
328
|
property({ type: Number })
|
|
149
329
|
], NLDDCodeEditor.prototype, "rows", void 0);
|
|
150
330
|
__decorate([
|
|
151
|
-
property({
|
|
331
|
+
property({ reflect: true, converter: reflectNonDefault('auto') })
|
|
152
332
|
], NLDDCodeEditor.prototype, "resize", void 0);
|
|
333
|
+
__decorate([
|
|
334
|
+
property({ reflect: true, converter: reflectNonDefault('simple') })
|
|
335
|
+
], NLDDCodeEditor.prototype, "variant", void 0);
|
|
336
|
+
__decorate([
|
|
337
|
+
property({ reflect: true, converter: reflectNonDefault('') })
|
|
338
|
+
], NLDDCodeEditor.prototype, "language", void 0);
|
|
339
|
+
__decorate([
|
|
340
|
+
property({ type: Boolean, reflect: true, attribute: 'line-numbers' })
|
|
341
|
+
], NLDDCodeEditor.prototype, "lineNumbers", void 0);
|
|
153
342
|
__decorate([
|
|
154
343
|
property({ type: String, attribute: 'accessible-label' })
|
|
155
344
|
], NLDDCodeEditor.prototype, "accessibleLabel", void 0);
|
|
156
345
|
__decorate([
|
|
157
|
-
query('.code-
|
|
158
|
-
], NLDDCodeEditor.prototype, "
|
|
346
|
+
query('.code-editor')
|
|
347
|
+
], NLDDCodeEditor.prototype, "_container", void 0);
|
|
159
348
|
NLDDCodeEditor = __decorate([
|
|
160
349
|
customElement('nldd-code-editor')
|
|
161
350
|
], NLDDCodeEditor);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-editor.js","sourceRoot":"","sources":["../../../../src/components/inputs/code-editor/code-editor.ts"],"names":[],"mappings":";;;;;;AAAA
|
|
1
|
+
{"version":3,"file":"code-editor.js","sourceRoot":"","sources":["../../../../src/components/inputs/code-editor/code-editor.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;;;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/code-editor/code-editor.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"code-editor.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/code-editor/code-editor.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,yBAgI5B,CAAC"}
|
|
@@ -9,12 +9,16 @@ export const codeEditorStyles = css `
|
|
|
9
9
|
/* # Host */
|
|
10
10
|
|
|
11
11
|
:host {
|
|
12
|
-
--
|
|
13
|
-
--
|
|
14
|
-
--
|
|
15
|
-
--
|
|
12
|
+
--__caret-width: var(--primitives-border-width-regular);
|
|
13
|
+
--_corner-radius: 0;
|
|
14
|
+
--_background-color: transparent;
|
|
15
|
+
--_border-color: transparent;
|
|
16
|
+
--_border-shadow: none;
|
|
17
|
+
--_padding-block: 0px;
|
|
18
|
+
--_padding-inline: 0px;
|
|
16
19
|
--_content-color: var(--semantics-content-color);
|
|
17
20
|
--_font: var(--primitives-font-monospace-sm-regular-snug);
|
|
21
|
+
--_rows: 6;
|
|
18
22
|
|
|
19
23
|
/* iOS Safari auto-zooms a focused field rendered under 16px (sm is ~14px).
|
|
20
24
|
Bump to the 16px md size on touch to prevent it; non-touch keeps the
|
|
@@ -24,9 +28,6 @@ export const codeEditorStyles = css `
|
|
|
24
28
|
}
|
|
25
29
|
|
|
26
30
|
${inheritedTextReset}
|
|
27
|
-
/* flex column + min-height:0 + flex:1 makes the host a good flex
|
|
28
|
-
citizen so a fixed-height parent grows the textarea; with no set
|
|
29
|
-
height it falls back to the rows attribute. */
|
|
30
31
|
display: flex;
|
|
31
32
|
min-height: 0;
|
|
32
33
|
flex-direction: column;
|
|
@@ -41,80 +42,91 @@ export const codeEditorStyles = css `
|
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
|
|
44
|
-
/*
|
|
45
|
+
/* ## Variant — input-field adds the framed surface + a default content padding */
|
|
46
|
+
|
|
47
|
+
:host([variant="input-field"]) {
|
|
48
|
+
--_corner-radius: var(--primitives-corner-radius-lg);
|
|
49
|
+
/* Match the other input fields (text-field, textarea): the input-field
|
|
50
|
+
surface + border + control padding, not the tinted surface. */
|
|
51
|
+
--_background-color: var(--semantics-input-fields-background-color);
|
|
52
|
+
--_border-color: var(--semantics-input-fields-border-color);
|
|
53
|
+
--_border-shadow: inset 0 0 0 var(--semantics-input-fields-border-thickness) var(--_border-color);
|
|
54
|
+
--_padding-block: var(--semantics-controls-md-inline-padding);
|
|
55
|
+
--_padding-inline: var(--semantics-controls-md-inline-padding);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
/* # Block — the frame only; CodeMirror fills it, padding lives on the content */
|
|
45
60
|
|
|
46
61
|
.code-editor {
|
|
47
62
|
box-sizing: border-box;
|
|
48
63
|
display: flex;
|
|
49
64
|
position: relative;
|
|
50
65
|
border-radius: var(--_corner-radius);
|
|
66
|
+
box-shadow: var(--_border-shadow);
|
|
51
67
|
background-color: var(--_background-color);
|
|
52
68
|
min-height: 0;
|
|
53
|
-
overflow: hidden;
|
|
54
69
|
flex-direction: column;
|
|
55
70
|
flex-grow: 1;
|
|
56
71
|
flex-shrink: 1;
|
|
57
72
|
flex-basis: auto;
|
|
73
|
+
color: var(--_content-color);
|
|
74
|
+
font: var(--_font);
|
|
58
75
|
}
|
|
59
76
|
|
|
60
77
|
:host([disabled]) .code-editor {
|
|
61
78
|
opacity: var(--primitives-opacity-disabled);
|
|
79
|
+
pointer-events: none;
|
|
62
80
|
}
|
|
63
81
|
|
|
64
|
-
|
|
82
|
+
/* Focus ring only on the input-field variant. The simple variant relies on a
|
|
83
|
+
prominent caret and lets a wrapping composition own its focus treatment. */
|
|
84
|
+
:host([variant="input-field"]) .code-editor:focus-within {
|
|
65
85
|
outline: var(--semantics-focus-ring-outline);
|
|
66
86
|
outline-offset: var(--semantics-focus-ring-outline-offset);
|
|
67
|
-
box-shadow: var(--semantics-focus-ring-box-shadow);
|
|
87
|
+
box-shadow: var(--semantics-focus-ring-box-shadow), var(--_border-shadow);
|
|
68
88
|
}
|
|
69
89
|
|
|
70
90
|
|
|
71
|
-
/* #
|
|
72
|
-
|
|
73
|
-
.code-editor__input {
|
|
74
|
-
box-sizing: border-box;
|
|
75
|
-
display: block;
|
|
76
|
-
margin: 0;
|
|
77
|
-
outline: none;
|
|
78
|
-
border: none;
|
|
79
|
-
background: transparent;
|
|
80
|
-
width: 100%;
|
|
81
|
-
min-height: 0;
|
|
82
|
-
padding: var(--_block-padding) var(--_inline-padding);
|
|
83
|
-
flex-grow: 1;
|
|
84
|
-
flex-shrink: 1;
|
|
85
|
-
flex-basis: auto;
|
|
86
|
-
color: var(--_content-color);
|
|
87
|
-
font: var(--_font);
|
|
88
|
-
tab-size: 2;
|
|
89
|
-
white-space: pre;
|
|
90
|
-
overflow-wrap: normal;
|
|
91
|
-
appearance: none;
|
|
92
|
-
}
|
|
91
|
+
/* # CodeMirror surface */
|
|
93
92
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
/* Padding lives on the content so the whole padded area is clickable and a
|
|
94
|
+
click maps to the nearest line — no dead zone around the text. */
|
|
95
|
+
/* Inline padding sits on the scroller so it lands left of the line-number
|
|
96
|
+
gutter (the gutter stays inset with the text). Block + right padding sit
|
|
97
|
+
on the content so the padded area is clickable and horizontal scrolling
|
|
98
|
+
keeps its end padding. :host beats the shared theme's .cm-content reset. */
|
|
99
|
+
:host .cm-scroller {
|
|
100
|
+
padding-left: var(--_padding-inline);
|
|
97
101
|
}
|
|
98
102
|
|
|
99
|
-
:host
|
|
100
|
-
|
|
103
|
+
:host .cm-content {
|
|
104
|
+
padding-block: var(--_padding-block);
|
|
105
|
+
padding-right: var(--_padding-inline);
|
|
106
|
+
min-height: calc(var(--_rows) * 1lh);
|
|
107
|
+
tab-size: 2;
|
|
101
108
|
}
|
|
102
109
|
|
|
103
|
-
|
|
104
|
-
|
|
110
|
+
/* Accent caret. The doubled class is purely for specificity — it outweighs
|
|
111
|
+
CodeMirror's theme cursor colour without depending on an attribute. */
|
|
112
|
+
:host .cm-cursor.cm-cursor {
|
|
113
|
+
border-left-color: var(--primitives-color-accent-600);
|
|
114
|
+
border-left-width: var(--__caret-width);
|
|
105
115
|
}
|
|
106
116
|
|
|
107
|
-
|
|
117
|
+
/* Resize model — rows is the floor in every mode:
|
|
118
|
+
auto (default) = grow, vertical = drag up from the floor, none = fixed. */
|
|
119
|
+
:host .cm-scroller {
|
|
108
120
|
resize: none;
|
|
109
|
-
|
|
121
|
+
min-height: calc(var(--_rows) * 1lh + 2 * var(--_padding-block));
|
|
110
122
|
}
|
|
111
123
|
|
|
112
|
-
:host([
|
|
113
|
-
|
|
124
|
+
:host([resize="vertical"]) .cm-scroller {
|
|
125
|
+
resize: vertical;
|
|
114
126
|
}
|
|
115
127
|
|
|
116
|
-
.
|
|
117
|
-
|
|
128
|
+
:host([resize="none"]) .cm-editor {
|
|
129
|
+
height: calc(var(--_rows) * 1lh + 2 * var(--_padding-block));
|
|
118
130
|
}
|
|
119
131
|
`;
|
|
120
132
|
//# sourceMappingURL=code-editor.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-editor.styles.js","sourceRoot":"","sources":["../../../../src/components/inputs/code-editor/code-editor.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAE5E,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"code-editor.styles.js","sourceRoot":"","sources":["../../../../src/components/inputs/code-editor/code-editor.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAE5E,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2B/B,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqGrB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { TemplateResult } from 'lit';
|
|
2
2
|
import type { NLDDCodeEditor } from './code-editor.js';
|
|
3
|
-
export declare function codeEditorTemplate(
|
|
3
|
+
export declare function codeEditorTemplate(_component: NLDDCodeEditor): TemplateResult;
|
|
4
4
|
//# sourceMappingURL=code-editor.template.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-editor.template.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/code-editor/code-editor.template.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"code-editor.template.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/code-editor/code-editor.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,MAAM,KAAK,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,cAAc,GAAG,cAAc,CAI7E"}
|
|
@@ -1,24 +1,7 @@
|
|
|
1
|
-
import { html
|
|
2
|
-
export function codeEditorTemplate(
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
id=${component.inputId || nothing}
|
|
7
|
-
rows=${component.rows}
|
|
8
|
-
.value=${component.value}
|
|
9
|
-
placeholder=${component.placeholder || nothing}
|
|
10
|
-
?disabled=${component.disabled}
|
|
11
|
-
?readonly=${component.readonly}
|
|
12
|
-
?required=${component.required}
|
|
13
|
-
spellcheck="false"
|
|
14
|
-
autocomplete="off"
|
|
15
|
-
autocorrect="off"
|
|
16
|
-
autocapitalize="off"
|
|
17
|
-
aria-label=${component.accessibleLabel || nothing}
|
|
18
|
-
@input=${component._handleInput}
|
|
19
|
-
@change=${component._handleChange}
|
|
20
|
-
></textarea>
|
|
21
|
-
</div>
|
|
22
|
-
`;
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
export function codeEditorTemplate(_component) {
|
|
3
|
+
// CodeMirror mounts into and owns .code-editor; keep this element free of
|
|
4
|
+
// Lit expressions so re-renders never touch the editor's own DOM.
|
|
5
|
+
return html `<div class="code-editor"></div>`;
|
|
23
6
|
}
|
|
24
7
|
//# sourceMappingURL=code-editor.template.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-editor.template.js","sourceRoot":"","sources":["../../../../src/components/inputs/code-editor/code-editor.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"code-editor.template.js","sourceRoot":"","sources":["../../../../src/components/inputs/code-editor/code-editor.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAC;AAG3C,MAAM,UAAU,kBAAkB,CAAC,UAA0B;IAC5D,0EAA0E;IAC1E,kEAAkE;IAClE,OAAO,IAAI,CAAA,iCAAiC,CAAC;AAC9C,CAAC"}
|