@vonage/vivid 5.19.0 → 5.20.1
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/accordion/definition.cjs +1 -1
- package/accordion/definition.js +1 -1
- package/accordion/index.cjs +2 -2
- package/accordion/index.js +2 -2
- package/accordion-item/definition.cjs +1 -1
- package/accordion-item/definition.js +1 -1
- package/action-group/definition.cjs +1 -1
- package/action-group/definition.js +1 -1
- package/action-group/index.cjs +2 -2
- package/action-group/index.js +2 -2
- package/alert/index.cjs +5 -5
- package/alert/index.js +8 -8
- package/audio-player/index.cjs +10 -10
- package/audio-player/index.js +28 -28
- package/avatar/index.cjs +7 -7
- package/avatar/index.js +14 -14
- package/banner/index.cjs +5 -5
- package/banner/index.js +9 -9
- package/breadcrumb/index.cjs +2 -2
- package/breadcrumb/index.js +3 -3
- package/breadcrumb-item/index.cjs +5 -5
- package/breadcrumb-item/index.js +1 -1
- package/bundled/affix.cjs +2 -2
- package/bundled/affix.js +11 -11
- package/bundled/anchored.cjs +1 -1
- package/bundled/anchored.js +6 -6
- package/bundled/aria-binding-directive.cjs +1 -1
- package/bundled/aria-binding-directive.js +88 -16
- package/bundled/base-color-picker.cjs +3 -3
- package/bundled/base-color-picker.js +5 -5
- package/bundled/base-progress.cjs +1 -1
- package/bundled/base-progress.js +3 -3
- package/bundled/breadcrumb-item.cjs +1 -1
- package/bundled/breadcrumb-item.js +3 -3
- package/bundled/button.cjs +1 -1
- package/bundled/button.js +3 -3
- package/bundled/calendar-event.cjs +1 -1
- package/bundled/calendar-event.js +4 -4
- package/bundled/calendar-picker.template.cjs +23 -24
- package/bundled/calendar-picker.template.js +35 -36
- package/bundled/char-count.cjs +2 -2
- package/bundled/char-count.js +8 -8
- package/bundled/children.cjs +1 -1
- package/bundled/children.js +11 -13
- package/bundled/definition.cjs +1 -1
- package/bundled/definition.js +2 -2
- package/bundled/definition10.cjs +3 -3
- package/bundled/definition10.js +5 -5
- package/bundled/definition11.cjs +2 -2
- package/bundled/definition11.js +7 -7
- package/bundled/definition12.cjs +15 -16
- package/bundled/definition12.js +22 -22
- package/bundled/definition13.cjs +3 -3
- package/bundled/definition13.js +5 -5
- package/bundled/definition14.cjs +2 -2
- package/bundled/definition14.js +2 -2
- package/bundled/definition15.cjs +7 -8
- package/bundled/definition15.js +14 -14
- package/bundled/definition16.cjs +3 -3
- package/bundled/definition16.js +8 -8
- package/bundled/definition17.cjs +7 -7
- package/bundled/definition17.js +13 -13
- package/bundled/definition18.cjs +18 -18
- package/bundled/definition18.js +36 -36
- package/bundled/definition19.cjs +2 -2
- package/bundled/definition19.js +1 -1
- package/bundled/definition2.cjs +10 -9
- package/bundled/definition2.js +24 -24
- package/bundled/definition20.cjs +19 -14
- package/bundled/definition20.js +51 -39
- package/bundled/definition21.cjs +6 -6
- package/bundled/definition21.js +18 -18
- package/bundled/definition22.cjs +3 -3
- package/bundled/definition22.js +7 -7
- package/bundled/definition23.cjs +4 -4
- package/bundled/definition23.js +8 -8
- package/bundled/definition24.cjs +8 -8
- package/bundled/definition24.js +17 -17
- package/bundled/definition3.cjs +1 -1
- package/bundled/definition3.js +5 -5
- package/bundled/definition4.cjs +9 -9
- package/bundled/definition4.js +16 -16
- package/bundled/definition5.cjs +4 -4
- package/bundled/definition5.js +5 -5
- package/bundled/definition6.cjs +6 -6
- package/bundled/definition6.js +21 -21
- package/bundled/definition7.cjs +2 -2
- package/bundled/definition7.js +4 -4
- package/bundled/definition8.cjs +4 -4
- package/bundled/definition8.js +7 -7
- package/bundled/definition9.cjs +10 -6
- package/bundled/definition9.js +48 -34
- package/bundled/delegates-aria.cjs +1 -1
- package/bundled/delegates-aria.js +20 -9
- package/bundled/divider.cjs +1 -1
- package/bundled/divider.js +3 -3
- package/bundled/form-associated.cjs +1 -1
- package/bundled/form-associated.js +6 -6
- package/bundled/form-element.cjs +1 -1
- package/bundled/form-element.js +1 -1
- package/bundled/host-semantics.cjs +1 -1
- package/bundled/host-semantics.js +2 -1
- package/bundled/kbd-shortcut.cjs +1 -0
- package/bundled/kbd-shortcut.js +14 -0
- package/bundled/linkable.cjs +2 -2
- package/bundled/linkable.js +5 -5
- package/bundled/listbox.cjs +1 -1
- package/bundled/listbox.js +4 -4
- package/bundled/localized.cjs +1 -1
- package/bundled/localized.js +3 -2
- package/bundled/mixins.cjs +16 -16
- package/bundled/mixins.js +39 -105
- package/bundled/picker-field.template.cjs +6 -6
- package/bundled/picker-field.template.js +15 -15
- package/bundled/platform.cjs +1 -0
- package/bundled/platform.js +9 -0
- package/bundled/ref.cjs +1 -1
- package/bundled/ref.js +2 -2
- package/bundled/render-in-light-dom.cjs +1 -0
- package/bundled/render-in-light-dom.js +57 -0
- package/bundled/repeat.cjs +1 -1
- package/bundled/repeat.js +117 -107
- package/bundled/slider.template.cjs +3 -3
- package/bundled/slider.template.js +1 -1
- package/bundled/slotted.cjs +1 -1
- package/bundled/slotted.js +2 -2
- package/bundled/time-selection-picker.template.cjs +4 -4
- package/bundled/time-selection-picker.template.js +18 -18
- package/bundled/vivid-element.cjs +3 -3
- package/bundled/vivid-element.js +626 -550
- package/bundled/when.cjs +1 -1
- package/bundled/when.js +2 -2
- package/bundled/with-contextual-help.cjs +1 -1
- package/bundled/with-contextual-help.js +1 -1
- package/bundled/with-error-text.cjs +1 -1
- package/bundled/with-error-text.js +1 -1
- package/bundled/with-success-text.cjs +1 -1
- package/bundled/with-success-text.js +1 -1
- package/calendar/index.cjs +8 -8
- package/calendar/index.js +9 -9
- package/calendar-event/index.cjs +4 -4
- package/calendar-event/index.js +1 -1
- package/card/index.cjs +24 -25
- package/card/index.js +29 -30
- package/color-picker/index.cjs +26 -26
- package/color-picker/index.js +90 -90
- package/combobox/index.cjs +13 -13
- package/combobox/index.js +22 -22
- package/country-group/index.cjs +4 -4
- package/country-group/index.js +3 -3
- package/custom-elements.json +849 -12
- package/data-grid/index.cjs +34 -34
- package/data-grid/index.js +37 -38
- package/date-picker/definition.cjs +1 -1
- package/date-picker/definition.js +1 -1
- package/date-picker/index.cjs +1 -1
- package/date-picker/index.js +2 -2
- package/date-range-picker/definition.cjs +1 -1
- package/date-range-picker/definition.js +1 -1
- package/date-range-picker/index.cjs +1 -1
- package/date-range-picker/index.js +4 -4
- package/date-time-picker/definition.cjs +1 -1
- package/date-time-picker/definition.js +1 -1
- package/date-time-picker/index.cjs +2 -2
- package/date-time-picker/index.js +6 -6
- package/dial-pad/definition.cjs +1 -1
- package/dial-pad/definition.js +1 -1
- package/dial-pad/index.cjs +8 -8
- package/dial-pad/index.js +15 -15
- package/dialog/definition.cjs +1 -1
- package/dialog/definition.js +1 -1
- package/dialog/index.cjs +16 -17
- package/dialog/index.js +29 -27
- package/divider/definition.cjs +1 -1
- package/divider/definition.js +1 -1
- package/empty-state/definition.cjs +1 -1
- package/empty-state/definition.js +1 -1
- package/empty-state/index.cjs +5 -5
- package/empty-state/index.js +9 -9
- package/fab/definition.cjs +1 -1
- package/fab/definition.js +1 -1
- package/fab/index.cjs +2 -2
- package/fab/index.js +6 -6
- package/file-picker/definition.cjs +1 -1
- package/file-picker/definition.js +1 -1
- package/file-picker/index.cjs +9 -10
- package/file-picker/index.js +21 -22
- package/flag/index.cjs +3 -3
- package/flag/index.js +7 -7
- package/header/definition.cjs +1 -1
- package/header/definition.js +1 -1
- package/header/index.cjs +2 -2
- package/header/index.js +8 -8
- package/icon/definition.cjs +1 -1
- package/icon/definition.js +1 -1
- package/index.cjs +184 -172
- package/index.js +52 -49
- package/kbd-key/definition.cjs +5 -0
- package/kbd-key/definition.js +2 -0
- package/kbd-key/index.cjs +5 -0
- package/kbd-key/index.js +65 -0
- package/kbd-shortcut/definition.cjs +5 -0
- package/kbd-shortcut/definition.js +2 -0
- package/kbd-shortcut/index.cjs +3 -0
- package/kbd-shortcut/index.js +27 -0
- package/layout/definition.cjs +1 -1
- package/layout/definition.js +1 -1
- package/layout/index.cjs +2 -2
- package/layout/index.js +2 -2
- package/lib/accordion-item/accordion-item.d.ts +18 -1
- package/lib/action-group/action-group.d.ts +18 -1
- package/lib/alert/alert.d.ts +36 -2
- package/lib/audio-player/audio-player.d.ts +18 -1
- package/lib/avatar/avatar.d.ts +18 -1
- package/lib/badge/badge.d.ts +18 -1
- package/lib/banner/banner.d.ts +54 -3
- package/lib/breadcrumb/breadcrumb.d.ts +18 -1
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +18 -1
- package/lib/button/button.d.ts +54 -3
- package/lib/calendar-event/calendar-event.d.ts +18 -1
- package/lib/card/card.d.ts +18 -1
- package/lib/checkbox/checkbox.d.ts +107 -5
- package/lib/color-picker/color-picker.d.ts +126 -7
- package/lib/combobox/combobox.d.ts +124 -5
- package/lib/components.d.ts +4 -1
- package/lib/country-group/country-group.d.ts +36 -2
- package/lib/data-grid/data-grid-cell.d.ts +36 -2
- package/lib/data-grid/data-grid-row.d.ts +18 -1
- package/lib/date-picker/date-picker.d.ts +140 -4
- package/lib/date-range-picker/date-range-picker.d.ts +70 -2
- package/lib/date-time-picker/date-time-picker.d.ts +140 -4
- package/lib/dial-pad/dial-pad.d.ts +18 -1
- package/lib/dialog/dialog.d.ts +36 -2
- package/lib/divider/divider.d.ts +18 -1
- package/lib/fab/fab.d.ts +18 -1
- package/lib/file-picker/file-picker.d.ts +124 -5
- package/lib/header/header.d.ts +18 -1
- package/lib/icon/icon.template.d.ts +1 -2
- package/lib/kbd-key/definition.d.ts +4 -0
- package/lib/kbd-key/index.d.ts +1 -0
- package/lib/kbd-key/kbd-key.d.ts +18 -0
- package/lib/kbd-key/kbd-key.template.d.ts +4 -0
- package/lib/kbd-shortcut/definition.d.ts +3 -0
- package/lib/kbd-shortcut/index.d.ts +1 -0
- package/lib/kbd-shortcut/kbd-shortcut.d.ts +4 -0
- package/lib/kbd-shortcut/kbd-shortcut.template.d.ts +4 -0
- package/lib/menu/menu.d.ts +35 -1
- package/lib/menu-item/menu-item.d.ts +463 -2
- package/lib/nav/nav.d.ts +18 -1
- package/lib/nav-disclosure/nav-disclosure.d.ts +36 -2
- package/lib/nav-item/nav-item.d.ts +36 -2
- package/lib/note/note.d.ts +18 -1
- package/lib/number-field/number-field.d.ts +160 -7
- package/lib/option/option.d.ts +36 -2
- package/lib/pagination/pagination.d.ts +18 -1
- package/lib/platform-switch/definition.d.ts +3 -0
- package/lib/platform-switch/index.d.ts +1 -0
- package/lib/platform-switch/platform-switch.d.ts +4 -0
- package/lib/platform-switch/platform-switch.template.d.ts +4 -0
- package/lib/popover/popover.d.ts +36 -2
- package/lib/progress/progress.d.ts +18 -1
- package/lib/progress-ring/progress-ring.d.ts +18 -1
- package/lib/radio/radio.d.ts +53 -2
- package/lib/radio-group/radio-group.d.ts +18 -1
- package/lib/range-slider/range-slider.d.ts +52 -1
- package/lib/rich-text-editor/locale.d.ts +1 -0
- package/lib/rich-text-editor/popover.d.ts +1 -0
- package/lib/rich-text-editor/rich-text-editor.d.ts +17 -0
- package/lib/rich-text-editor/rte/utils/ui.d.ts +3 -0
- package/lib/searchable-select/option-tag.d.ts +18 -1
- package/lib/searchable-select/searchable-select.d.ts +160 -7
- package/lib/select/select.d.ts +160 -7
- package/lib/selectable-box/selectable-box.d.ts +18 -1
- package/lib/simple-color-picker/simple-color-picker.d.ts +35 -1
- package/lib/slider/slider.d.ts +53 -2
- package/lib/split-button/split-button.d.ts +54 -3
- package/lib/status/status.d.ts +18 -1
- package/lib/switch/switch.d.ts +36 -2
- package/lib/tab/tab.d.ts +54 -3
- package/lib/tab-panel/tab-panel.d.ts +18 -1
- package/lib/table/table-cell.d.ts +18 -1
- package/lib/table/table-header-cell.d.ts +18 -1
- package/lib/table/table-row.d.ts +18 -1
- package/lib/table/table-sorting-button.d.ts +18 -1
- package/lib/tag/tag.d.ts +54 -3
- package/lib/tag-group/tag-group.d.ts +18 -1
- package/lib/tag-name-map.d.ts +4 -1
- package/lib/text-area/text-area.d.ts +142 -6
- package/lib/text-field/text-field.d.ts +160 -7
- package/lib/time-picker/time-picker.d.ts +70 -2
- package/lib/toggletip/toggletip.d.ts +35 -1
- package/lib/tooltip/tooltip.d.ts +444 -0
- package/lib/tree-item/tree-item.d.ts +36 -2
- package/lib/tree-view/tree-view.d.ts +18 -1
- package/lib/video-player/video-player.d.ts +18 -1
- package/locales/de-DE.cjs +1 -0
- package/locales/de-DE.js +1 -0
- package/locales/en-GB.cjs +1 -0
- package/locales/en-GB.js +1 -0
- package/locales/en-US.cjs +1 -0
- package/locales/en-US.js +1 -0
- package/locales/ja-JP.cjs +1 -0
- package/locales/ja-JP.js +1 -0
- package/locales/zh-CN.cjs +1 -0
- package/locales/zh-CN.js +1 -0
- package/nav/definition.cjs +1 -1
- package/nav/definition.js +1 -1
- package/nav/index.cjs +2 -2
- package/nav/index.js +2 -2
- package/nav-disclosure/definition.cjs +1 -1
- package/nav-disclosure/definition.js +1 -1
- package/nav-disclosure/index.cjs +3 -4
- package/nav-disclosure/index.js +11 -11
- package/nav-item/definition.cjs +1 -1
- package/nav-item/definition.js +1 -1
- package/nav-item/index.cjs +2 -2
- package/nav-item/index.js +6 -6
- package/note/definition.cjs +1 -1
- package/note/definition.js +1 -1
- package/note/index.cjs +2 -2
- package/note/index.js +7 -7
- package/number-field/definition.cjs +1 -1
- package/number-field/definition.js +1 -1
- package/number-field/index.cjs +8 -9
- package/number-field/index.js +16 -17
- package/package.json +6 -6
- package/pagination/definition.cjs +1 -1
- package/pagination/definition.js +1 -1
- package/pagination/index.cjs +9 -9
- package/pagination/index.js +16 -16
- package/platform-switch/definition.cjs +5 -0
- package/platform-switch/definition.js +2 -0
- package/platform-switch/index.cjs +1 -0
- package/platform-switch/index.js +28 -0
- package/popover/definition.cjs +1 -1
- package/popover/definition.js +1 -1
- package/popover/index.cjs +6 -6
- package/popover/index.js +12 -12
- package/progress/definition.cjs +1 -1
- package/progress/definition.js +1 -1
- package/progress/index.cjs +4 -4
- package/progress/index.js +5 -5
- package/progress-ring/definition.cjs +1 -1
- package/progress-ring/definition.js +1 -1
- package/radio/definition.cjs +1 -1
- package/radio/definition.js +1 -1
- package/radio-group/definition.cjs +1 -1
- package/radio-group/definition.js +1 -1
- package/radio-group/index.cjs +5 -8
- package/radio-group/index.js +16 -16
- package/range-slider/definition.cjs +1 -1
- package/range-slider/definition.js +1 -1
- package/range-slider/index.cjs +5 -5
- package/range-slider/index.js +9 -9
- package/rich-text-editor/definition.cjs +1 -1
- package/rich-text-editor/definition.js +1 -1
- package/rich-text-editor/index.cjs +8 -6
- package/rich-text-editor/index.js +136 -94
- package/rich-text-view/definition.cjs +1 -1
- package/rich-text-view/definition.js +1 -1
- package/rich-text-view/index.cjs +1 -1
- package/rich-text-view/index.js +3 -3
- package/searchable-select/definition.cjs +1 -1
- package/searchable-select/definition.js +1 -1
- package/searchable-select/index.cjs +38 -40
- package/searchable-select/index.js +64 -64
- package/select/definition.cjs +1 -1
- package/select/definition.js +1 -1
- package/selectable-box/definition.cjs +1 -1
- package/selectable-box/definition.js +1 -1
- package/selectable-box/index.cjs +4 -4
- package/selectable-box/index.js +13 -13
- package/shared/aria/aria-binding-directive.d.ts +4 -4
- package/shared/aria/aria-mixin.d.ts +21 -3
- package/shared/aria/delegates-aria.d.ts +18 -1
- package/shared/aria/host-semantics.d.ts +18 -1
- package/shared/aria/idrefs-controller.d.ts +17 -0
- package/shared/color-picker/base-color-picker.d.ts +18 -1
- package/shared/feedback/feedback-message.d.ts +18 -1
- package/shared/feedback/mixins.d.ts +36 -2
- package/shared/foundation/button/button.d.ts +35 -1
- package/shared/foundation/form-associated/form-associated.d.ts +35 -1
- package/shared/foundation/vivid-element/vivid-element.d.ts +375 -0
- package/shared/framework/reactive-controller.d.ts +373 -0
- package/shared/patterns/affix.d.ts +36 -2
- package/shared/patterns/anchored.d.ts +34 -0
- package/shared/patterns/char-count/char-count.d.ts +18 -1
- package/shared/patterns/form-elements/form-element.d.ts +17 -0
- package/shared/patterns/form-elements/with-contextual-help.d.ts +18 -1
- package/shared/patterns/form-elements/with-error-text.d.ts +18 -1
- package/shared/patterns/form-elements/with-success-text.d.ts +18 -1
- package/shared/patterns/index.d.ts +1 -0
- package/shared/patterns/kbd-shortcut.d.ts +431 -0
- package/shared/patterns/linkable.d.ts +18 -1
- package/shared/patterns/localized.d.ts +35 -1
- package/shared/patterns/trapped-focus.d.ts +18 -1
- package/shared/picker-field/mixins/calendar-picker.d.ts +35 -1
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +35 -1
- package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +18 -1
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +35 -1
- package/shared/picker-field/mixins/single-date-picker.d.ts +35 -1
- package/shared/picker-field/mixins/single-value-picker.d.ts +35 -1
- package/shared/picker-field/mixins/time-selection-picker.d.ts +35 -1
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +70 -2
- package/shared/picker-field/picker-field.d.ts +124 -5
- package/shared/templating/render-in-light-dom.d.ts +7 -20
- package/shared/utils/platform.d.ts +1 -0
- package/side-drawer/definition.cjs +1 -1
- package/side-drawer/definition.js +1 -1
- package/side-drawer/index.cjs +3 -3
- package/side-drawer/index.js +3 -3
- package/simple-color-picker/definition.cjs +1 -1
- package/simple-color-picker/definition.js +1 -1
- package/simple-color-picker/index.cjs +2 -2
- package/simple-color-picker/index.js +6 -6
- package/split-button/definition.cjs +1 -1
- package/split-button/definition.js +1 -1
- package/split-button/index.cjs +5 -6
- package/split-button/index.js +8 -8
- package/status/definition.cjs +1 -1
- package/status/definition.js +1 -1
- package/status/index.cjs +4 -4
- package/status/index.js +9 -9
- package/styles/core/all.css +24 -2
- package/styles/core/typography.css +24 -2
- package/styles/fonts/spezia-variable.css +6 -0
- package/styles/tokens/theme-dark.css +2 -0
- package/styles/tokens/theme-light.css +2 -0
- package/switch/definition.cjs +1 -1
- package/switch/definition.js +1 -1
- package/switch/index.cjs +3 -3
- package/switch/index.js +4 -4
- package/tab/definition.cjs +1 -1
- package/tab/definition.js +1 -1
- package/tab-panel/definition.cjs +1 -1
- package/tab-panel/definition.js +1 -1
- package/table/definition.cjs +1 -1
- package/table/definition.js +1 -1
- package/table/index.cjs +9 -9
- package/table/index.js +19 -19
- package/tabs/definition.cjs +1 -1
- package/tabs/definition.js +1 -1
- package/tabs/index.cjs +8 -8
- package/tabs/index.js +14 -14
- package/tag/definition.cjs +1 -1
- package/tag/definition.js +1 -1
- package/tag/index.cjs +8 -8
- package/tag/index.js +11 -11
- package/tag-group/definition.cjs +1 -1
- package/tag-group/definition.js +1 -1
- package/tag-group/index.cjs +2 -2
- package/tag-group/index.js +2 -2
- package/text-area/definition.cjs +1 -1
- package/text-area/definition.js +1 -1
- package/text-area/index.cjs +8 -9
- package/text-area/index.js +25 -26
- package/time-picker/definition.cjs +1 -1
- package/time-picker/definition.js +1 -1
- package/time-picker/index.cjs +1 -1
- package/time-picker/index.js +1 -1
- package/tree-item/definition.cjs +1 -1
- package/tree-item/definition.js +1 -1
- package/tree-view/definition.cjs +1 -1
- package/tree-view/definition.js +1 -1
- package/tree-view/index.cjs +4 -4
- package/tree-view/index.js +7 -7
- package/unbundled/affix.cjs +1 -1
- package/unbundled/affix.js +1 -1
- package/unbundled/aria-binding-directive.cjs +112 -2
- package/unbundled/aria-binding-directive.js +108 -4
- package/unbundled/calendar-picker.template.cjs +8 -10
- package/unbundled/calendar-picker.template.js +8 -10
- package/unbundled/char-count.cjs +1 -1
- package/unbundled/char-count.js +1 -1
- package/unbundled/definition.cjs +91 -17
- package/unbundled/definition.js +88 -14
- package/unbundled/definition10.js +1 -1
- package/unbundled/definition11.js +1 -1
- package/unbundled/definition12.cjs +15 -2
- package/unbundled/definition12.js +17 -4
- package/unbundled/definition13.js +1 -1
- package/unbundled/definition14.js +1 -1
- package/unbundled/definition15.cjs +1 -1
- package/unbundled/definition15.js +2 -2
- package/unbundled/definition16.cjs +1 -1
- package/unbundled/definition16.js +2 -2
- package/unbundled/definition17.cjs +1 -1
- package/unbundled/definition17.js +2 -2
- package/unbundled/definition18.cjs +1 -1
- package/unbundled/definition18.js +2 -2
- package/unbundled/definition19.js +1 -1
- package/unbundled/definition2.cjs +96 -77
- package/unbundled/definition2.js +94 -75
- package/unbundled/definition20.js +1 -1
- package/unbundled/definition21.js +1 -1
- package/unbundled/definition22.cjs +2 -3
- package/unbundled/definition22.js +3 -4
- package/unbundled/definition23.cjs +3 -3
- package/unbundled/definition23.js +5 -5
- package/unbundled/definition24.js +1 -1
- package/unbundled/definition25.cjs +1 -1
- package/unbundled/definition25.js +2 -2
- package/unbundled/definition26.cjs +8 -8
- package/unbundled/definition26.js +6 -6
- package/unbundled/definition27.cjs +26 -12
- package/unbundled/definition27.js +28 -14
- package/unbundled/definition28.cjs +1 -1
- package/unbundled/definition28.js +3 -3
- package/unbundled/definition29.cjs +1 -1
- package/unbundled/definition29.js +2 -2
- package/unbundled/definition3.cjs +154 -95
- package/unbundled/definition3.js +146 -93
- package/unbundled/definition30.cjs +1 -1
- package/unbundled/definition30.js +3 -3
- package/unbundled/definition31.cjs +1 -1
- package/unbundled/definition31.js +2 -2
- package/unbundled/definition32.js +1 -1
- package/unbundled/definition33.cjs +1 -1
- package/unbundled/definition33.js +2 -2
- package/unbundled/definition34.cjs +103 -65
- package/unbundled/definition34.js +102 -64
- package/unbundled/definition35.cjs +26 -326
- package/unbundled/definition35.js +24 -247
- package/unbundled/definition36.cjs +131 -25
- package/unbundled/definition36.js +124 -23
- package/unbundled/definition37.cjs +326 -51
- package/unbundled/definition37.js +324 -49
- package/unbundled/definition38.cjs +137 -317
- package/unbundled/definition38.js +135 -315
- package/unbundled/definition39.cjs +337 -173
- package/unbundled/definition39.js +334 -170
- package/unbundled/definition4.cjs +34 -159
- package/unbundled/definition4.js +25 -151
- package/unbundled/definition40.cjs +234 -339
- package/unbundled/definition40.js +230 -335
- package/unbundled/definition41.cjs +48 -271
- package/unbundled/definition41.js +44 -267
- package/unbundled/definition42.cjs +68 -49
- package/unbundled/definition42.js +65 -46
- package/unbundled/definition43.cjs +424 -56
- package/unbundled/definition43.js +422 -54
- package/unbundled/definition44.cjs +45 -428
- package/unbundled/definition44.js +42 -425
- package/unbundled/definition45.cjs +45 -54
- package/unbundled/definition45.js +42 -51
- package/unbundled/definition46.cjs +178 -30
- package/unbundled/definition46.js +175 -26
- package/unbundled/definition47.cjs +29 -94
- package/unbundled/definition47.js +25 -91
- package/unbundled/definition48.cjs +76 -36
- package/unbundled/definition48.js +73 -33
- package/unbundled/definition49.cjs +56 -23
- package/unbundled/definition49.js +54 -18
- package/unbundled/definition5.cjs +56 -38
- package/unbundled/definition5.js +52 -28
- package/unbundled/definition50.cjs +23 -40
- package/unbundled/definition50.js +18 -38
- package/unbundled/definition51.cjs +30 -338
- package/unbundled/definition51.js +30 -338
- package/unbundled/definition52.cjs +317 -187
- package/unbundled/definition52.js +314 -184
- package/unbundled/definition53.cjs +194 -289
- package/unbundled/definition53.js +189 -284
- package/unbundled/definition54.cjs +47 -54
- package/unbundled/definition54.js +44 -50
- package/unbundled/definition55.cjs +279 -133
- package/unbundled/definition55.js +277 -130
- package/unbundled/definition56.cjs +50 -262
- package/unbundled/definition56.js +48 -261
- package/unbundled/definition57.cjs +128 -460
- package/unbundled/definition57.js +126 -459
- package/unbundled/definition58.cjs +235 -3604
- package/unbundled/definition58.js +231 -3437
- package/unbundled/definition59.cjs +419 -729
- package/unbundled/definition59.js +417 -727
- package/unbundled/definition6.cjs +18 -64
- package/unbundled/definition6.js +15 -60
- package/unbundled/definition60.cjs +3699 -106
- package/unbundled/definition60.js +3531 -101
- package/unbundled/definition61.cjs +625 -878
- package/unbundled/definition61.js +619 -872
- package/unbundled/definition62.cjs +106 -108
- package/unbundled/definition62.js +103 -105
- package/unbundled/definition63.cjs +1045 -71
- package/unbundled/definition63.js +1041 -66
- package/unbundled/definition64.cjs +105 -173
- package/unbundled/definition64.js +102 -170
- package/unbundled/definition65.cjs +70 -113
- package/unbundled/definition65.js +66 -110
- package/unbundled/definition66.cjs +185 -54
- package/unbundled/definition66.js +182 -51
- package/unbundled/definition67.cjs +110 -77
- package/unbundled/definition67.js +111 -77
- package/unbundled/definition68.cjs +58 -21
- package/unbundled/definition68.js +56 -16
- package/unbundled/definition69.cjs +82 -75
- package/unbundled/definition69.js +81 -75
- package/unbundled/definition7.cjs +2 -2
- package/unbundled/definition7.js +3 -3
- package/unbundled/definition70.cjs +19 -349
- package/unbundled/definition70.js +15 -341
- package/unbundled/definition71.cjs +88 -26
- package/unbundled/definition71.js +86 -23
- package/unbundled/definition72.cjs +309 -119
- package/unbundled/definition72.js +234 -116
- package/unbundled/definition73.cjs +293 -229
- package/unbundled/definition73.js +287 -230
- package/unbundled/definition74.cjs +39 -30
- package/unbundled/definition74.js +29 -28
- package/unbundled/definition75.cjs +106 -121
- package/unbundled/definition75.js +104 -113
- package/unbundled/definition76.cjs +260 -179
- package/unbundled/definition76.js +258 -176
- package/unbundled/definition77.cjs +29 -514
- package/unbundled/definition77.js +27 -503
- package/unbundled/definition78.cjs +171 -0
- package/unbundled/definition78.js +147 -0
- package/unbundled/definition79.cjs +233 -0
- package/unbundled/definition79.js +214 -0
- package/unbundled/definition8.js +1 -1
- package/unbundled/definition80.cjs +533 -0
- package/unbundled/definition80.js +513 -0
- package/unbundled/definition9.cjs +1 -1
- package/unbundled/definition9.js +2 -2
- package/unbundled/delegates-aria.cjs +15 -1
- package/unbundled/delegates-aria.js +17 -3
- package/unbundled/host-semantics.cjs +2 -1
- package/unbundled/host-semantics.js +2 -1
- package/unbundled/kbd-shortcut.cjs +26 -0
- package/unbundled/kbd-shortcut.js +20 -0
- package/unbundled/mixins.cjs +7 -77
- package/unbundled/mixins.js +6 -64
- package/unbundled/platform.cjs +17 -0
- package/unbundled/platform.js +12 -0
- package/unbundled/randomId.cjs +47 -0
- package/unbundled/randomId.js +35 -0
- package/unbundled/time-selection-picker.template.js +1 -1
- package/unbundled/vivid-element.cjs +82 -9
- package/unbundled/vivid-element.js +63 -8
- package/video-player/definition.cjs +1 -1
- package/video-player/definition.js +1 -1
- package/video-player/index.cjs +3 -3
- package/video-player/index.js +5 -5
- package/visually-hidden/definition.cjs +1 -1
- package/visually-hidden/definition.js +1 -1
- package/vivid.api.json +604 -6
- package/bundled/normalize.cjs +0 -1
- package/bundled/normalize.js +0 -7
|
@@ -1,149 +1,147 @@
|
|
|
1
1
|
require("./chunk.cjs");
|
|
2
2
|
const require_vivid_element = require("./vivid-element.cjs");
|
|
3
3
|
const require_decorate = require("./decorate.cjs");
|
|
4
|
-
const
|
|
5
|
-
const require_enums = require("./enums.cjs");
|
|
6
|
-
const require_definition = require("./definition23.cjs");
|
|
7
|
-
const require_definition$1 = require("./definition55.cjs");
|
|
4
|
+
const require_slottable_request = require("./slottable-request.cjs");
|
|
8
5
|
let _microsoft_fast_element = require("@microsoft/fast-element");
|
|
9
|
-
let
|
|
10
|
-
//#region src/lib/
|
|
11
|
-
var
|
|
6
|
+
let prosemirror_model = require("prosemirror-model");
|
|
7
|
+
//#region src/lib/rich-text-view/rich-text-view.scss?inline
|
|
8
|
+
var rich_text_view_default = ":host{display:contents}.content{overflow-wrap:break-word;white-space:break-spaces;display:contents}";
|
|
12
9
|
//#endregion
|
|
13
|
-
//#region src/lib/
|
|
10
|
+
//#region src/lib/rich-text-view/rich-text-view.ts
|
|
14
11
|
/**
|
|
15
12
|
* @public
|
|
16
|
-
* @component
|
|
17
|
-
* @
|
|
18
|
-
* @event {CustomEvent<undefined>} change - Fired when the checked state changes
|
|
19
|
-
* @testAction check check #control
|
|
20
|
-
* @testAction uncheck uncheck #control
|
|
21
|
-
* @testQuery checked checked true
|
|
22
|
-
* @testQuery unchecked checked false
|
|
23
|
-
* @testRef control nestedShadow [data-vvd-component].control div.control
|
|
13
|
+
* @component rich-text-view
|
|
14
|
+
* @dynamicSlot `@vonage/vivid#RteChildSlotProps` child - Used for custom rendered children.
|
|
24
15
|
*/
|
|
25
|
-
var
|
|
16
|
+
var RichTextView = class extends require_vivid_element.VividElement {
|
|
26
17
|
constructor(..._args) {
|
|
27
18
|
super(..._args);
|
|
28
|
-
this.
|
|
29
|
-
this.
|
|
30
|
-
this.
|
|
31
|
-
this.
|
|
32
|
-
this.disabled = false;
|
|
19
|
+
this._slotCounter = 0;
|
|
20
|
+
this._slottedChildren = /* @__PURE__ */ new Set();
|
|
21
|
+
this._slotRequests = /* @__PURE__ */ new Set();
|
|
22
|
+
this._contentElement = null;
|
|
33
23
|
}
|
|
34
24
|
/**
|
|
35
25
|
* @internal
|
|
36
26
|
*/
|
|
37
|
-
|
|
38
|
-
if (this.
|
|
39
|
-
if (
|
|
40
|
-
this.
|
|
41
|
-
|
|
27
|
+
viewChanged(oldView, newView) {
|
|
28
|
+
if (oldView) this._removeStyles();
|
|
29
|
+
if (newView) this._addStyles(newView);
|
|
30
|
+
this._updateView();
|
|
31
|
+
}
|
|
32
|
+
_addStyles(view) {
|
|
33
|
+
const config = view[require_slottable_request.impl].config[require_slottable_request.impl];
|
|
34
|
+
this._styles = new _microsoft_fast_element.ElementStyles(require_slottable_request.sortedContributions(config.features.flatMap((f) => f.getStyles())));
|
|
35
|
+
this._styles.addStylesTo(this.shadowRoot);
|
|
36
|
+
}
|
|
37
|
+
_removeStyles() {
|
|
38
|
+
if (this._styles) {
|
|
39
|
+
this._styles.removeStylesFrom(this.shadowRoot);
|
|
40
|
+
this._styles = void 0;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
_cleanupLightDom() {
|
|
44
|
+
for (const el of this._slottedChildren) this.removeChild(el);
|
|
45
|
+
for (const slotName of this._slotRequests) require_slottable_request.dispatchSlottableRequest(this, "child", slotName, require_slottable_request.removeSymbol);
|
|
46
|
+
this._slottedChildren.clear();
|
|
47
|
+
this._slotRequests.clear();
|
|
48
|
+
this._slotCounter = 0;
|
|
49
|
+
}
|
|
50
|
+
_updateView() {
|
|
51
|
+
if (!this._contentElement) return;
|
|
52
|
+
this._contentElement.innerHTML = "";
|
|
53
|
+
this._cleanupLightDom();
|
|
54
|
+
if (this.view) this._contentElement.appendChild(this._renderView(this.view));
|
|
55
|
+
}
|
|
56
|
+
_renderView(rteView) {
|
|
57
|
+
const ctx = rteView[require_slottable_request.impl];
|
|
58
|
+
if (rteView.type === "node" && rteView.node.type === "doc") rteView = rteView.children;
|
|
59
|
+
if (rteView.type === "fragment") {
|
|
60
|
+
const frag = document.createDocumentFragment();
|
|
61
|
+
for (const child of rteView.content) frag.appendChild(this._renderView(child));
|
|
62
|
+
return frag;
|
|
63
|
+
}
|
|
64
|
+
const customRenderedView = ctx.options.renderChildView?.(rteView) ?? false;
|
|
65
|
+
if (customRenderedView) return this._handleCustomRender(rteView, customRenderedView);
|
|
66
|
+
else return this._renderDefault(rteView);
|
|
67
|
+
}
|
|
68
|
+
_handleCustomRender(rteView, customResult) {
|
|
69
|
+
const slotName = `child-view-${this._slotCounter++}`;
|
|
70
|
+
const slot = document.createElement("slot");
|
|
71
|
+
slot.setAttribute("name", slotName);
|
|
72
|
+
if (customResult === true) {
|
|
73
|
+
this._slotRequests.add(slotName);
|
|
74
|
+
require_slottable_request.dispatchSlottableRequest(this, "child", slotName, { view: rteView });
|
|
75
|
+
} else {
|
|
76
|
+
const { dom, contentDom = dom } = customResult;
|
|
77
|
+
const nestedView = document.createElement(this.tagName);
|
|
78
|
+
nestedView.view = rteView.children;
|
|
79
|
+
contentDom.appendChild(nestedView);
|
|
80
|
+
dom.setAttribute("slot", slotName);
|
|
81
|
+
this.appendChild(dom);
|
|
82
|
+
this._slottedChildren.add(dom);
|
|
83
|
+
}
|
|
84
|
+
return slot;
|
|
85
|
+
}
|
|
86
|
+
_renderDefault(view) {
|
|
87
|
+
const schema = view[require_slottable_request.impl].config[require_slottable_request.impl].schema;
|
|
88
|
+
if (view.type === "node" && view.node.type === "text") return document.createTextNode(view.node.text);
|
|
89
|
+
const item = view.type === "node" ? view.node : view.mark;
|
|
90
|
+
const pmItem = view.type === "node" ? prosemirror_model.Node.fromJSON(schema, item) : prosemirror_model.Mark.fromJSON(schema, item);
|
|
91
|
+
const spec = pmItem instanceof prosemirror_model.Node ? pmItem.type.spec.toDOM(pmItem) : pmItem.type.spec.toDOM(pmItem, true);
|
|
92
|
+
const { dom, contentDOM = dom } = prosemirror_model.DOMSerializer.renderSpec(document, spec);
|
|
93
|
+
const childrenRendered = this._renderView(view.children);
|
|
94
|
+
contentDOM.appendChild(childrenRendered);
|
|
95
|
+
return dom;
|
|
42
96
|
}
|
|
43
97
|
/**
|
|
44
98
|
* @internal
|
|
45
99
|
*/
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
100
|
+
connectedCallback() {
|
|
101
|
+
super.connectedCallback();
|
|
102
|
+
this._updateView();
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* @internal
|
|
106
|
+
*/
|
|
107
|
+
disconnectedCallback() {
|
|
108
|
+
super.disconnectedCallback();
|
|
109
|
+
this._removeStyles();
|
|
110
|
+
this._cleanupLightDom();
|
|
50
111
|
}
|
|
51
112
|
};
|
|
52
|
-
require_decorate.__decorate([
|
|
53
|
-
require_decorate.__decorate([(0, _microsoft_fast_element.attr)({
|
|
54
|
-
attribute: "clickable-box",
|
|
55
|
-
mode: "boolean"
|
|
56
|
-
})], SelectableBox.prototype, "clickableBox", void 0);
|
|
57
|
-
require_decorate.__decorate([_microsoft_fast_element.attr], SelectableBox.prototype, "connotation", void 0);
|
|
58
|
-
require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ attribute: "control-type" })], SelectableBox.prototype, "controlType", void 0);
|
|
59
|
-
require_decorate.__decorate([(0, _microsoft_fast_element.attr)({
|
|
60
|
-
attribute: "control-placement",
|
|
61
|
-
mode: "fromView"
|
|
62
|
-
})], SelectableBox.prototype, "controlPlacement", void 0);
|
|
63
|
-
require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ mode: "boolean" })], SelectableBox.prototype, "tight", void 0);
|
|
64
|
-
require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ mode: "boolean" })], SelectableBox.prototype, "disabled", void 0);
|
|
113
|
+
require_decorate.__decorate([_microsoft_fast_element.observable], RichTextView.prototype, "view", void 0);
|
|
65
114
|
//#endregion
|
|
66
|
-
//#region src/lib/
|
|
67
|
-
var
|
|
68
|
-
function handleControlChange(x) {
|
|
69
|
-
if (!x.clickableBox) x._handleCheckedChange();
|
|
70
|
-
}
|
|
71
|
-
function checkbox(context) {
|
|
72
|
-
const checkboxTag = context.tagFor(require_definition.Checkbox);
|
|
73
|
-
return _microsoft_fast_element.html`${(0, _microsoft_fast_element.when)((x) => x.controlType !== "radio", _microsoft_fast_element.html`
|
|
74
|
-
<${checkboxTag}
|
|
75
|
-
${require_delegates_aria.delegateAria({ ariaLabel: (x) => !x.clickableBox && x.ariaLabel ? x.ariaLabel : null }, { onlySpecified: true })}
|
|
76
|
-
@change="${(x) => handleControlChange(x)}"
|
|
77
|
-
class="control checkbox ${(x) => x.controlPlacement}"
|
|
78
|
-
connotation="${(x) => x.connotation === "cta" ? require_enums.Connotation.CTA : require_enums.Connotation.Accent}"
|
|
79
|
-
:checked="${(x) => x.checked}"
|
|
80
|
-
?disabled="${(x) => x.disabled}"
|
|
81
|
-
inert="${(x) => x.clickableBox ? true : null}"
|
|
82
|
-
></${checkboxTag}>`)} `;
|
|
83
|
-
}
|
|
84
|
-
function radio(context) {
|
|
85
|
-
const radioTag = context.tagFor(require_definition$1.Radio);
|
|
86
|
-
return _microsoft_fast_element.html`${(0, _microsoft_fast_element.when)((x) => x.controlType === "radio", _microsoft_fast_element.html`
|
|
87
|
-
<${radioTag}
|
|
88
|
-
${require_delegates_aria.delegateAria({ ariaLabel: (x) => !x.clickableBox && x.ariaLabel ? x.ariaLabel : null }, { onlySpecified: true })}
|
|
89
|
-
@change="${(x) => handleControlChange(x)}"
|
|
90
|
-
class="control radio ${(x) => x.controlPlacement}"
|
|
91
|
-
connotation="${(x) => x.connotation === "cta" ? require_enums.Connotation.CTA : require_enums.Connotation.Accent}"
|
|
92
|
-
:checked="${(x) => x.checked}"
|
|
93
|
-
?disabled="${(x) => x.disabled}"
|
|
94
|
-
inert="${(x) => x.clickableBox ? true : null}"
|
|
95
|
-
></${radioTag}>`)} `;
|
|
96
|
-
}
|
|
97
|
-
var SelectableBoxTemplate = (context) => {
|
|
98
|
-
return _microsoft_fast_element.html`<template>
|
|
99
|
-
<div
|
|
100
|
-
class="${getClasses}"
|
|
101
|
-
tabindex="${(x) => x.clickableBox && !x.disabled ? "0" : null}"
|
|
102
|
-
${require_delegates_aria.delegateAria({
|
|
103
|
-
role: (x) => x.clickableBox ? "button" : null,
|
|
104
|
-
ariaPressed: (x) => x.clickableBox ? x.checked ? "true" : "false" : null,
|
|
105
|
-
ariaLabel: (x) => x.clickableBox ? x.ariaLabel : null,
|
|
106
|
-
ariaDisabled: (x) => x.clickableBox && x.disabled ? "true" : null
|
|
107
|
-
})}
|
|
108
|
-
@keydown="${(x, c) => x._handleKeydown(c.event)}"
|
|
109
|
-
@click="${(x) => x.clickableBox ? x._handleCheckedChange() : null}"
|
|
110
|
-
>
|
|
111
|
-
${checkbox(context)} ${radio(context)}
|
|
112
|
-
<slot></slot>
|
|
113
|
-
</div>
|
|
114
|
-
</template>`;
|
|
115
|
-
};
|
|
115
|
+
//#region src/lib/rich-text-view/rich-text-view.template.ts
|
|
116
|
+
var RichTextViewTemplate = () => _microsoft_fast_element.html`<div class="content rich-text" ${(0, _microsoft_fast_element.ref)("_contentElement")}></div>`;
|
|
116
117
|
//#endregion
|
|
117
|
-
//#region src/lib/
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
*/
|
|
121
|
-
var selectableBoxDefinition = require_vivid_element.defineVividComponent("selectable-box", SelectableBox, SelectableBoxTemplate, [require_definition.checkboxDefinition, require_definition$1.radioDefinition], {
|
|
122
|
-
styles: selectable_box_default,
|
|
118
|
+
//#region src/lib/rich-text-view/definition.ts
|
|
119
|
+
var richTextViewDefinition = require_vivid_element.defineVividComponent("rich-text-view", RichTextView, RichTextViewTemplate, [], {
|
|
120
|
+
styles: rich_text_view_default,
|
|
123
121
|
shadowOptions: { delegatesFocus: true }
|
|
124
122
|
});
|
|
125
123
|
/**
|
|
126
|
-
* Registers the
|
|
124
|
+
* Registers the rich-text-view element with the design system.
|
|
127
125
|
*
|
|
128
126
|
* @param prefix - the prefix to use for the component name
|
|
129
127
|
*/
|
|
130
|
-
var
|
|
128
|
+
var registerRichTextView = require_vivid_element.createRegisterFunction(richTextViewDefinition);
|
|
131
129
|
//#endregion
|
|
132
|
-
Object.defineProperty(exports, "
|
|
130
|
+
Object.defineProperty(exports, "RichTextView", {
|
|
133
131
|
enumerable: true,
|
|
134
132
|
get: function() {
|
|
135
|
-
return
|
|
133
|
+
return RichTextView;
|
|
136
134
|
}
|
|
137
135
|
});
|
|
138
|
-
Object.defineProperty(exports, "
|
|
136
|
+
Object.defineProperty(exports, "registerRichTextView", {
|
|
139
137
|
enumerable: true,
|
|
140
138
|
get: function() {
|
|
141
|
-
return
|
|
139
|
+
return registerRichTextView;
|
|
142
140
|
}
|
|
143
141
|
});
|
|
144
|
-
Object.defineProperty(exports, "
|
|
142
|
+
Object.defineProperty(exports, "richTextViewDefinition", {
|
|
145
143
|
enumerable: true,
|
|
146
144
|
get: function() {
|
|
147
|
-
return
|
|
145
|
+
return richTextViewDefinition;
|
|
148
146
|
}
|
|
149
147
|
});
|
|
@@ -1,131 +1,129 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as createRegisterFunction, t as VividElement, u as defineVividComponent } from "./vivid-element.js";
|
|
2
2
|
import { t as __decorate } from "./decorate.js";
|
|
3
|
-
import { n as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { classNames } from "@microsoft/fast-web-utilities";
|
|
9
|
-
//#region src/lib/selectable-box/selectable-box.scss?inline
|
|
10
|
-
var selectable_box_default = ":host{display:flex}.base.connotation-cta{--_connotation-color-firm-all:var(--vvd-selectable-box-cta-firm-all,var(--vvd-color-cta-600));--_connotation-color-pale:var(--vvd-selectable-box-cta-pale,var(--vvd-color-cta-300));--_connotation-color-fierce:var(--vvd-selectable-box-cta-fierce,var(--vvd-color-cta-700));--_connotation-color-faint:var(--vvd-selectable-box-cta-faint,var(--vvd-color-cta-50));--_connotation-color-soft:var(--vvd-selectable-box-cta-soft,var(--vvd-color-cta-100))}.base:not(.connotation-cta){--_connotation-color-firm-all:var(--vvd-selectable-box-accent-firm-all,var(--vvd-color-neutral-600));--_connotation-color-pale:var(--vvd-selectable-box-accent-pale,var(--vvd-color-neutral-300));--_connotation-color-fierce:var(--vvd-selectable-box-accent-fierce,var(--vvd-color-neutral-700));--_connotation-color-faint:var(--vvd-selectable-box-accent-faint,var(--vvd-color-neutral-50));--_connotation-color-soft:var(--vvd-selectable-box-accent-soft,var(--vvd-color-neutral-100))}.base{--_appearance-color-text:var(--_connotation-color-firm-all);--_appearance-color-fill:transparent;--_appearance-color-outline:var(--_connotation-color-pale)}@media (hover:hover){.base:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm-all);--_appearance-color-fill:transparent;--_appearance-color-outline:var(--_connotation-color-firm-all)}}.base.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm-all);--_appearance-color-fill:transparent;--_appearance-color-outline:var(--_connotation-color-firm-all)}.base.selected:where(:not(.disabled,:disabled)){--_appearance-color-text:var(--_connotation-color-firm-all);--_appearance-color-fill:var(--_connotation-color-soft);--_appearance-color-outline:var(--_connotation-color-pale)}@media (hover:hover){.base.selected:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm-all);--_appearance-color-fill:var(--_connotation-color-faint);--_appearance-color-outline:var(--_connotation-color-firm-all)}}.base.selected.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm-all);--_appearance-color-fill:var(--_connotation-color-faint);--_appearance-color-outline:var(--_connotation-color-firm-all)}.base:disabled,.base.disabled{--_appearance-color-text:var(--vvd-color-neutral-300);--_appearance-color-fill:transparent;--_appearance-color-outline:var(--vvd-color-neutral-100)}.base{--control-offset:calc(var(--selectable-box-spacing,16px) + 36px);padding:var(--selectable-box-spacing,16px);border:1px solid var(--_appearance-color-outline);background-color:var(--_appearance-color-fill);text-align:start;border-radius:8px;inline-size:100%;position:relative}.base.control-placement-end-stacked,.base.control-placement-start-stacked{padding-block-start:var(--control-offset)}.base.control-placement-start{padding-inline-start:var(--control-offset)}.base.control-placement-end{padding-inline-end:var(--control-offset)}.base:focus-visible{--focus-stroke-gap-color:transparent;box-shadow:0 0 0 4px color-mix(in srgb, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px))}.base.tight{min-height:calc(var(--selectable-box-spacing,16px) * 2 + 22px);padding:0;overflow:hidden}.base.selected{background-color:var(--selectable-box-checked-bg,var(--_appearance-color-fill))}.base.clickable{cursor:pointer}.control{position:absolute;inset-block-start:var(--selectable-box-spacing,16px)}.control.start-stacked,.control.start{inset-inline-start:var(--selectable-box-spacing,16px)}.control.end-stacked,.control.end{inset-inline-end:var(--selectable-box-spacing,16px)}";
|
|
3
|
+
import { c as impl, n as removeSymbol, s as sortedContributions, t as dispatchSlottableRequest } from "./slottable-request.js";
|
|
4
|
+
import { ElementStyles, html, observable, ref } from "@microsoft/fast-element";
|
|
5
|
+
import { DOMSerializer, Mark, Node } from "prosemirror-model";
|
|
6
|
+
//#region src/lib/rich-text-view/rich-text-view.scss?inline
|
|
7
|
+
var rich_text_view_default = ":host{display:contents}.content{overflow-wrap:break-word;white-space:break-spaces;display:contents}";
|
|
11
8
|
//#endregion
|
|
12
|
-
//#region src/lib/
|
|
9
|
+
//#region src/lib/rich-text-view/rich-text-view.ts
|
|
13
10
|
/**
|
|
14
11
|
* @public
|
|
15
|
-
* @component
|
|
16
|
-
* @
|
|
17
|
-
* @event {CustomEvent<undefined>} change - Fired when the checked state changes
|
|
18
|
-
* @testAction check check #control
|
|
19
|
-
* @testAction uncheck uncheck #control
|
|
20
|
-
* @testQuery checked checked true
|
|
21
|
-
* @testQuery unchecked checked false
|
|
22
|
-
* @testRef control nestedShadow [data-vvd-component].control div.control
|
|
12
|
+
* @component rich-text-view
|
|
13
|
+
* @dynamicSlot `@vonage/vivid#RteChildSlotProps` child - Used for custom rendered children.
|
|
23
14
|
*/
|
|
24
|
-
var
|
|
15
|
+
var RichTextView = class extends VividElement {
|
|
25
16
|
constructor(..._args) {
|
|
26
17
|
super(..._args);
|
|
27
|
-
this.
|
|
28
|
-
this.
|
|
29
|
-
this.
|
|
30
|
-
this.
|
|
31
|
-
this.disabled = false;
|
|
18
|
+
this._slotCounter = 0;
|
|
19
|
+
this._slottedChildren = /* @__PURE__ */ new Set();
|
|
20
|
+
this._slotRequests = /* @__PURE__ */ new Set();
|
|
21
|
+
this._contentElement = null;
|
|
32
22
|
}
|
|
33
23
|
/**
|
|
34
24
|
* @internal
|
|
35
25
|
*/
|
|
36
|
-
|
|
37
|
-
if (this.
|
|
38
|
-
if (
|
|
39
|
-
this.
|
|
40
|
-
|
|
26
|
+
viewChanged(oldView, newView) {
|
|
27
|
+
if (oldView) this._removeStyles();
|
|
28
|
+
if (newView) this._addStyles(newView);
|
|
29
|
+
this._updateView();
|
|
30
|
+
}
|
|
31
|
+
_addStyles(view) {
|
|
32
|
+
const config = view[impl].config[impl];
|
|
33
|
+
this._styles = new ElementStyles(sortedContributions(config.features.flatMap((f) => f.getStyles())));
|
|
34
|
+
this._styles.addStylesTo(this.shadowRoot);
|
|
35
|
+
}
|
|
36
|
+
_removeStyles() {
|
|
37
|
+
if (this._styles) {
|
|
38
|
+
this._styles.removeStylesFrom(this.shadowRoot);
|
|
39
|
+
this._styles = void 0;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
_cleanupLightDom() {
|
|
43
|
+
for (const el of this._slottedChildren) this.removeChild(el);
|
|
44
|
+
for (const slotName of this._slotRequests) dispatchSlottableRequest(this, "child", slotName, removeSymbol);
|
|
45
|
+
this._slottedChildren.clear();
|
|
46
|
+
this._slotRequests.clear();
|
|
47
|
+
this._slotCounter = 0;
|
|
48
|
+
}
|
|
49
|
+
_updateView() {
|
|
50
|
+
if (!this._contentElement) return;
|
|
51
|
+
this._contentElement.innerHTML = "";
|
|
52
|
+
this._cleanupLightDom();
|
|
53
|
+
if (this.view) this._contentElement.appendChild(this._renderView(this.view));
|
|
54
|
+
}
|
|
55
|
+
_renderView(rteView) {
|
|
56
|
+
const ctx = rteView[impl];
|
|
57
|
+
if (rteView.type === "node" && rteView.node.type === "doc") rteView = rteView.children;
|
|
58
|
+
if (rteView.type === "fragment") {
|
|
59
|
+
const frag = document.createDocumentFragment();
|
|
60
|
+
for (const child of rteView.content) frag.appendChild(this._renderView(child));
|
|
61
|
+
return frag;
|
|
62
|
+
}
|
|
63
|
+
const customRenderedView = ctx.options.renderChildView?.(rteView) ?? false;
|
|
64
|
+
if (customRenderedView) return this._handleCustomRender(rteView, customRenderedView);
|
|
65
|
+
else return this._renderDefault(rteView);
|
|
66
|
+
}
|
|
67
|
+
_handleCustomRender(rteView, customResult) {
|
|
68
|
+
const slotName = `child-view-${this._slotCounter++}`;
|
|
69
|
+
const slot = document.createElement("slot");
|
|
70
|
+
slot.setAttribute("name", slotName);
|
|
71
|
+
if (customResult === true) {
|
|
72
|
+
this._slotRequests.add(slotName);
|
|
73
|
+
dispatchSlottableRequest(this, "child", slotName, { view: rteView });
|
|
74
|
+
} else {
|
|
75
|
+
const { dom, contentDom = dom } = customResult;
|
|
76
|
+
const nestedView = document.createElement(this.tagName);
|
|
77
|
+
nestedView.view = rteView.children;
|
|
78
|
+
contentDom.appendChild(nestedView);
|
|
79
|
+
dom.setAttribute("slot", slotName);
|
|
80
|
+
this.appendChild(dom);
|
|
81
|
+
this._slottedChildren.add(dom);
|
|
82
|
+
}
|
|
83
|
+
return slot;
|
|
84
|
+
}
|
|
85
|
+
_renderDefault(view) {
|
|
86
|
+
const schema = view[impl].config[impl].schema;
|
|
87
|
+
if (view.type === "node" && view.node.type === "text") return document.createTextNode(view.node.text);
|
|
88
|
+
const item = view.type === "node" ? view.node : view.mark;
|
|
89
|
+
const pmItem = view.type === "node" ? Node.fromJSON(schema, item) : Mark.fromJSON(schema, item);
|
|
90
|
+
const spec = pmItem instanceof Node ? pmItem.type.spec.toDOM(pmItem) : pmItem.type.spec.toDOM(pmItem, true);
|
|
91
|
+
const { dom, contentDOM = dom } = DOMSerializer.renderSpec(document, spec);
|
|
92
|
+
const childrenRendered = this._renderView(view.children);
|
|
93
|
+
contentDOM.appendChild(childrenRendered);
|
|
94
|
+
return dom;
|
|
41
95
|
}
|
|
42
96
|
/**
|
|
43
97
|
* @internal
|
|
44
98
|
*/
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
99
|
+
connectedCallback() {
|
|
100
|
+
super.connectedCallback();
|
|
101
|
+
this._updateView();
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* @internal
|
|
105
|
+
*/
|
|
106
|
+
disconnectedCallback() {
|
|
107
|
+
super.disconnectedCallback();
|
|
108
|
+
this._removeStyles();
|
|
109
|
+
this._cleanupLightDom();
|
|
49
110
|
}
|
|
50
111
|
};
|
|
51
|
-
__decorate([
|
|
52
|
-
__decorate([attr({
|
|
53
|
-
attribute: "clickable-box",
|
|
54
|
-
mode: "boolean"
|
|
55
|
-
})], SelectableBox.prototype, "clickableBox", void 0);
|
|
56
|
-
__decorate([attr], SelectableBox.prototype, "connotation", void 0);
|
|
57
|
-
__decorate([attr({ attribute: "control-type" })], SelectableBox.prototype, "controlType", void 0);
|
|
58
|
-
__decorate([attr({
|
|
59
|
-
attribute: "control-placement",
|
|
60
|
-
mode: "fromView"
|
|
61
|
-
})], SelectableBox.prototype, "controlPlacement", void 0);
|
|
62
|
-
__decorate([attr({ mode: "boolean" })], SelectableBox.prototype, "tight", void 0);
|
|
63
|
-
__decorate([attr({ mode: "boolean" })], SelectableBox.prototype, "disabled", void 0);
|
|
112
|
+
__decorate([observable], RichTextView.prototype, "view", void 0);
|
|
64
113
|
//#endregion
|
|
65
|
-
//#region src/lib/
|
|
66
|
-
var
|
|
67
|
-
function handleControlChange(x) {
|
|
68
|
-
if (!x.clickableBox) x._handleCheckedChange();
|
|
69
|
-
}
|
|
70
|
-
function checkbox(context) {
|
|
71
|
-
const checkboxTag = context.tagFor(Checkbox);
|
|
72
|
-
return html`${when((x) => x.controlType !== "radio", html`
|
|
73
|
-
<${checkboxTag}
|
|
74
|
-
${delegateAria({ ariaLabel: (x) => !x.clickableBox && x.ariaLabel ? x.ariaLabel : null }, { onlySpecified: true })}
|
|
75
|
-
@change="${(x) => handleControlChange(x)}"
|
|
76
|
-
class="control checkbox ${(x) => x.controlPlacement}"
|
|
77
|
-
connotation="${(x) => x.connotation === "cta" ? Connotation.CTA : Connotation.Accent}"
|
|
78
|
-
:checked="${(x) => x.checked}"
|
|
79
|
-
?disabled="${(x) => x.disabled}"
|
|
80
|
-
inert="${(x) => x.clickableBox ? true : null}"
|
|
81
|
-
></${checkboxTag}>`)} `;
|
|
82
|
-
}
|
|
83
|
-
function radio(context) {
|
|
84
|
-
const radioTag = context.tagFor(Radio);
|
|
85
|
-
return html`${when((x) => x.controlType === "radio", html`
|
|
86
|
-
<${radioTag}
|
|
87
|
-
${delegateAria({ ariaLabel: (x) => !x.clickableBox && x.ariaLabel ? x.ariaLabel : null }, { onlySpecified: true })}
|
|
88
|
-
@change="${(x) => handleControlChange(x)}"
|
|
89
|
-
class="control radio ${(x) => x.controlPlacement}"
|
|
90
|
-
connotation="${(x) => x.connotation === "cta" ? Connotation.CTA : Connotation.Accent}"
|
|
91
|
-
:checked="${(x) => x.checked}"
|
|
92
|
-
?disabled="${(x) => x.disabled}"
|
|
93
|
-
inert="${(x) => x.clickableBox ? true : null}"
|
|
94
|
-
></${radioTag}>`)} `;
|
|
95
|
-
}
|
|
96
|
-
var SelectableBoxTemplate = (context) => {
|
|
97
|
-
return html`<template>
|
|
98
|
-
<div
|
|
99
|
-
class="${getClasses}"
|
|
100
|
-
tabindex="${(x) => x.clickableBox && !x.disabled ? "0" : null}"
|
|
101
|
-
${delegateAria({
|
|
102
|
-
role: (x) => x.clickableBox ? "button" : null,
|
|
103
|
-
ariaPressed: (x) => x.clickableBox ? x.checked ? "true" : "false" : null,
|
|
104
|
-
ariaLabel: (x) => x.clickableBox ? x.ariaLabel : null,
|
|
105
|
-
ariaDisabled: (x) => x.clickableBox && x.disabled ? "true" : null
|
|
106
|
-
})}
|
|
107
|
-
@keydown="${(x, c) => x._handleKeydown(c.event)}"
|
|
108
|
-
@click="${(x) => x.clickableBox ? x._handleCheckedChange() : null}"
|
|
109
|
-
>
|
|
110
|
-
${checkbox(context)} ${radio(context)}
|
|
111
|
-
<slot></slot>
|
|
112
|
-
</div>
|
|
113
|
-
</template>`;
|
|
114
|
-
};
|
|
114
|
+
//#region src/lib/rich-text-view/rich-text-view.template.ts
|
|
115
|
+
var RichTextViewTemplate = () => html`<div class="content rich-text" ${ref("_contentElement")}></div>`;
|
|
115
116
|
//#endregion
|
|
116
|
-
//#region src/lib/
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
*/
|
|
120
|
-
var selectableBoxDefinition = defineVividComponent("selectable-box", SelectableBox, SelectableBoxTemplate, [checkboxDefinition, radioDefinition], {
|
|
121
|
-
styles: selectable_box_default,
|
|
117
|
+
//#region src/lib/rich-text-view/definition.ts
|
|
118
|
+
var richTextViewDefinition = defineVividComponent("rich-text-view", RichTextView, RichTextViewTemplate, [], {
|
|
119
|
+
styles: rich_text_view_default,
|
|
122
120
|
shadowOptions: { delegatesFocus: true }
|
|
123
121
|
});
|
|
124
122
|
/**
|
|
125
|
-
* Registers the
|
|
123
|
+
* Registers the rich-text-view element with the design system.
|
|
126
124
|
*
|
|
127
125
|
* @param prefix - the prefix to use for the component name
|
|
128
126
|
*/
|
|
129
|
-
var
|
|
127
|
+
var registerRichTextView = createRegisterFunction(richTextViewDefinition);
|
|
130
128
|
//#endregion
|
|
131
|
-
export {
|
|
129
|
+
export { richTextViewDefinition as n, RichTextView as r, registerRichTextView as t };
|