@dialpad/dialtone-vue 4.9.0 → 4.11.0
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/{Combobox-WsLvegw6.js → Combobox-BKj61IcR.js} +5 -5
- package/dist/{Combobox-WsLvegw6.js.map → Combobox-BKj61IcR.js.map} +1 -1
- package/dist/Combobox-BOGcBq-6.cjs +3 -0
- package/dist/{Combobox-96zAPv6d.cjs.map → Combobox-BOGcBq-6.cjs.map} +1 -1
- package/dist/{Datepicker-D-Lgvthq.js → Datepicker-DOSIyo8a.js} +39 -39
- package/dist/{Datepicker-D-Lgvthq.js.map → Datepicker-DOSIyo8a.js.map} +1 -1
- package/dist/Datepicker-DfdVsVb9.cjs +2 -0
- package/dist/{Datepicker-DmKOuf5y.cjs.map → Datepicker-DfdVsVb9.cjs.map} +1 -1
- package/dist/{EmojiPicker-D46lLRMp.js → EmojiPicker-B_ZVTdOY.js} +2 -2
- package/dist/{EmojiPicker-D46lLRMp.js.map → EmojiPicker-B_ZVTdOY.js.map} +1 -1
- package/dist/EmojiPicker-DS8XmAHV.cjs +2 -0
- package/dist/{EmojiPicker-CXFd-iVj.cjs.map → EmojiPicker-DS8XmAHV.cjs.map} +1 -1
- package/dist/FilterPill-BmYe_SsY.cjs +2 -0
- package/dist/{FilterPill-DY9T19XB.cjs.map → FilterPill-BmYe_SsY.cjs.map} +1 -1
- package/dist/{FilterPill-IBlswKiK.js → FilterPill-C4TXD8Tl.js} +5 -5
- package/dist/{FilterPill-IBlswKiK.js.map → FilterPill-C4TXD8Tl.js.map} +1 -1
- package/dist/{ForceLinkify-DhmBEXhe.cjs → ForceLinkify-BMmlUc8Q.cjs} +1 -1
- package/dist/{ForceLinkify-DhmBEXhe.cjs.map → ForceLinkify-BMmlUc8Q.cjs.map} +1 -1
- package/dist/{ForceLinkify-53Zegx7z.js → ForceLinkify-Cw3Q1Nn7.js} +1 -1
- package/dist/{ForceLinkify-53Zegx7z.js.map → ForceLinkify-Cw3Q1Nn7.js.map} +1 -1
- package/dist/{MarkdownRenderer-Cnbn7gje.js → MarkdownRenderer-BR-fbldH.js} +1 -1
- package/dist/{MarkdownRenderer-Cnbn7gje.js.map → MarkdownRenderer-BR-fbldH.js.map} +1 -1
- package/dist/{MarkdownRenderer-a12waV7r.cjs → MarkdownRenderer-CH4L8Evn.cjs} +1 -1
- package/dist/{MarkdownRenderer-a12waV7r.cjs.map → MarkdownRenderer-CH4L8Evn.cjs.map} +1 -1
- package/dist/{Presence-CGgyodnC.js → Presence-BkPCvddH.js} +2 -2
- package/dist/{Presence-CGgyodnC.js.map → Presence-BkPCvddH.js.map} +1 -1
- package/dist/{Presence-DLM3JR-n.cjs → Presence-DG9Kvu5J.cjs} +2 -2
- package/dist/{Presence-DLM3JR-n.cjs.map → Presence-DG9Kvu5J.cjs.map} +1 -1
- package/dist/ProgressBar-BMycZBZE.cjs +2 -0
- package/dist/ProgressBar-BMycZBZE.cjs.map +1 -0
- package/dist/ProgressBar-Cj8xqPc0.js +77 -0
- package/dist/ProgressBar-Cj8xqPc0.js.map +1 -0
- package/dist/{Resizable-Ddsm-H14.js → Resizable-BkijqucD.js} +3 -3
- package/dist/{Resizable-Ddsm-H14.js.map → Resizable-BkijqucD.js.map} +1 -1
- package/dist/{Resizable-DdP6uPio.cjs → Resizable-DQoUk81S.cjs} +2 -2
- package/dist/{Resizable-DdP6uPio.cjs.map → Resizable-DQoUk81S.cjs.map} +1 -1
- package/dist/{ResizableHandle-_ldmhyEw.cjs → ResizableHandle-D2gZ6dg5.cjs} +2 -2
- package/dist/{ResizableHandle-_ldmhyEw.cjs.map → ResizableHandle-D2gZ6dg5.cjs.map} +1 -1
- package/dist/{ResizableHandle-DQduVxrG.js → ResizableHandle-MDdaNR_t.js} +3 -3
- package/dist/{ResizableHandle-DQduVxrG.js.map → ResizableHandle-MDdaNR_t.js.map} +1 -1
- package/dist/{ResizableUtils-BptSHmLg.cjs → ResizableUtils-CXU7o9pL.cjs} +1 -1
- package/dist/{ResizableUtils-BptSHmLg.cjs.map → ResizableUtils-CXU7o9pL.cjs.map} +1 -1
- package/dist/{ResizableUtils-BIRNCdKB.js → ResizableUtils-ChIk3Blc.js} +1 -1
- package/dist/{ResizableUtils-BIRNCdKB.js.map → ResizableUtils-ChIk3Blc.js.map} +1 -1
- package/dist/{RichTextEditor-DhNhx5AH.js → RichTextEditor-BIcaFJQp.js} +15 -15
- package/dist/{RichTextEditor-DhNhx5AH.js.map → RichTextEditor-BIcaFJQp.js.map} +1 -1
- package/dist/RichTextEditor-D6kCBnLJ.cjs +11 -0
- package/dist/{RichTextEditor-CjyvDYID.cjs.map → RichTextEditor-D6kCBnLJ.cjs.map} +1 -1
- package/dist/{Scroller-D7MjyXun.js → Scroller-D6LZtmkL.js} +3 -3
- package/dist/{Scroller-D7MjyXun.js.map → Scroller-D6LZtmkL.js.map} +1 -1
- package/dist/Scroller-eXc7l23J.cjs +2 -0
- package/dist/{Scroller-Bt8TUghI.cjs.map → Scroller-eXc7l23J.cjs.map} +1 -1
- package/dist/Slider-B7O2M5_S.cjs +2 -0
- package/dist/{Slider-CfvbLBv5.cjs.map → Slider-B7O2M5_S.cjs.map} +1 -1
- package/dist/{Slider-Xd5Aj9nS.js → Slider-oJROUIMS.js} +7 -7
- package/dist/{Slider-Xd5Aj9nS.js.map → Slider-oJROUIMS.js.map} +1 -1
- package/dist/Text-BDgOWPw7.cjs +2 -0
- package/dist/Text-BDgOWPw7.cjs.map +1 -0
- package/dist/Text-CfiPqjL0.js +404 -0
- package/dist/Text-CfiPqjL0.js.map +1 -0
- package/dist/{TextList-DUL3NwQp.cjs → TextList-D3HHK2DW.cjs} +1 -1
- package/dist/{TextList-DUL3NwQp.cjs.map → TextList-D3HHK2DW.cjs.map} +1 -1
- package/dist/{TextList-CkY7OAl2.js → TextList-DXEov7Ls.js} +1 -1
- package/dist/{TextList-CkY7OAl2.js.map → TextList-DXEov7Ls.js.map} +1 -1
- package/dist/TextListItem-C2Vc8Gnu.cjs +2 -0
- package/dist/{TextListItem-BI9M_J8Y.cjs.map → TextListItem-C2Vc8Gnu.cjs.map} +1 -1
- package/dist/{TextListItem-D96feMQf.js → TextListItem-CaFTtZ3G.js} +2 -2
- package/dist/{TextListItem-D96feMQf.js.map → TextListItem-CaFTtZ3G.js.map} +1 -1
- package/dist/{Toast-DmzQrYtG.js → Toast-AGiQccuG.js} +3 -3
- package/dist/{Toast-DmzQrYtG.js.map → Toast-AGiQccuG.js.map} +1 -1
- package/dist/Toast-DImJ0PkZ.cjs +2 -0
- package/dist/{Toast-BXvUrvd_.cjs.map → Toast-DImJ0PkZ.cjs.map} +1 -1
- package/dist/{UseResizableCalculations-BNcxJfef.cjs → UseResizableCalculations-D4xVxWje.cjs} +2 -2
- package/dist/{UseResizableCalculations-BNcxJfef.cjs.map → UseResizableCalculations-D4xVxWje.cjs.map} +1 -1
- package/dist/{UseResizableCalculations-k6TSRlpa.js → UseResizableCalculations-DTxD7NKO.js} +2 -2
- package/dist/{UseResizableCalculations-k6TSRlpa.js.map → UseResizableCalculations-DTxD7NKO.js.map} +1 -1
- package/dist/common/composables/use-accessible-name-warning.cjs +2 -0
- package/dist/common/composables/use-accessible-name-warning.cjs.map +1 -0
- package/dist/common/composables/use-accessible-name-warning.js +11 -0
- package/dist/common/composables/use-accessible-name-warning.js.map +1 -0
- package/dist/common/composables/use-indicator-animation.cjs +1 -1
- package/dist/common/composables/use-indicator-animation.cjs.map +1 -1
- package/dist/common/composables/use-indicator-animation.js +14 -14
- package/dist/common/composables/use-indicator-animation.js.map +1 -1
- package/dist/common/composables/useAccessibleNameWarning.d.ts +2 -0
- package/dist/common/composables/useAccessibleNameWarning.d.ts.map +1 -0
- package/dist/common/composables/useIndicatorAnimation.d.ts +2 -1
- package/dist/common/composables/useIndicatorAnimation.d.ts.map +1 -1
- package/dist/common/dates/index.cjs +1 -1
- package/dist/common/dates/index.cjs.map +1 -1
- package/dist/common/dates/index.js +1 -1
- package/dist/common/mixins/input-group.cjs +1 -1
- package/dist/common/mixins/input-group.cjs.map +1 -1
- package/dist/common/mixins/input-group.js +5 -5
- package/dist/common/mixins/input.cjs +1 -1
- package/dist/common/mixins/input.cjs.map +1 -1
- package/dist/common/mixins/input.js +1 -1
- package/dist/common/mixins/keyboard-list-navigation.cjs +1 -1
- package/dist/common/mixins/keyboard-list-navigation.cjs.map +1 -1
- package/dist/common/mixins/keyboard-list-navigation.js +1 -1
- package/dist/common/mixins/modal.cjs +1 -1
- package/dist/common/mixins/modal.cjs.map +1 -1
- package/dist/common/mixins/modal.js +1 -1
- package/dist/common/mixins/mode.cjs +1 -1
- package/dist/common/mixins/mode.js +1 -1
- package/dist/common/owned_classes.d.ts +4 -0
- package/dist/common/owned_classes.d.ts.map +1 -0
- package/dist/common/utils/index.cjs +1 -2
- package/dist/common/utils/index.d.ts +2 -2
- package/dist/common/utils/index.d.ts.map +1 -1
- package/dist/common/utils/index.js +2 -150
- package/dist/component-documentation.json +1 -1
- package/dist/components/Banner/Banner.vue.d.ts +53 -1
- package/dist/components/Banner/Banner.vue.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.vue.d.ts +53 -1
- package/dist/components/Checkbox/Checkbox.vue.d.ts.map +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.vue.d.ts +53 -1
- package/dist/components/ComboboxWithPopover/ComboboxWithPopover.vue.d.ts +1 -0
- package/dist/components/ComboboxWithPopover/ComboboxWithPopover.vue.d.ts.map +1 -1
- package/dist/components/Dropdown/Dropdown.vue.d.ts +1 -3
- package/dist/components/Dropdown/Dropdown.vue.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPicker.vue.d.ts +53 -1
- package/dist/components/EmojiPicker/Modules/EmojiSearch.vue.d.ts +53 -1
- package/dist/components/EmojiPicker/Modules/EmojiSearch.vue.d.ts.map +1 -1
- package/dist/components/FilterPill/FilterPill.vue.d.ts +161 -6
- package/dist/components/FilterPill/FilterPill.vue.d.ts.map +1 -1
- package/dist/components/Hovercard/Hovercard.vue.d.ts +4 -0
- package/dist/components/Hovercard/Hovercard.vue.d.ts.map +1 -1
- package/dist/components/Input/Input.vue.d.ts +53 -1
- package/dist/components/Input/Input.vue.d.ts.map +1 -1
- package/dist/components/InputGroup/InputGroup.vue.d.ts +53 -1
- package/dist/components/InputGroup/InputGroup.vue.d.ts.map +1 -1
- package/dist/components/KeyboardShortcut/KeyboardShortcut.vue.d.ts +53 -1
- package/dist/components/Modal/Modal.vue.d.ts +53 -1
- package/dist/components/Modal/Modal.vue.d.ts.map +1 -1
- package/dist/components/Notice/Notice.vue.d.ts +53 -1
- package/dist/components/Notice/Notice.vue.d.ts.map +1 -1
- package/dist/components/Notice/NoticeContent.vue.d.ts +53 -1
- package/dist/components/Notice/NoticeContent.vue.d.ts.map +1 -1
- package/dist/components/Popover/Popover.vue.d.ts +1 -0
- package/dist/components/Popover/Popover.vue.d.ts.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.vue.d.ts +66 -0
- package/dist/components/ProgressBar/ProgressBar.vue.d.ts.map +1 -0
- package/dist/components/ProgressBar/ProgressBarConstants.d.ts +18 -0
- package/dist/components/ProgressBar/ProgressBarConstants.d.ts.map +1 -0
- package/dist/components/ProgressBar/index.d.ts +3 -0
- package/dist/components/ProgressBar/index.d.ts.map +1 -0
- package/dist/components/ProgressCircle/ProgressCircle.vue.d.ts +41 -9
- package/dist/components/Radio/Radio.vue.d.ts +53 -1
- package/dist/components/Radio/Radio.vue.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.vue.d.ts +53 -1
- package/dist/components/RichTextEditor/Extensions/Mentions/MentionSuggestion.vue.d.ts +53 -1
- package/dist/components/RichTextEditor/Extensions/SlashCommand/SlashCommandSuggestion.vue.d.ts +53 -1
- package/dist/components/RichTextEditor/Extensions/Variable/VariableComponent.vue.d.ts +54 -1
- package/dist/components/RichTextEditor/Extensions/Variable/VariableComponent.vue.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControlItem.vue.d.ts +10 -0
- package/dist/components/SegmentedControl/SegmentedControlItem.vue.d.ts.map +1 -1
- package/dist/components/SelectMenu/SelectMenu.vue.d.ts +53 -1
- package/dist/components/SelectMenu/SelectMenu.vue.d.ts.map +1 -1
- package/dist/components/SplitButton/SplitButton.vue.d.ts +1 -3
- package/dist/components/SplitButton/SplitButton.vue.d.ts.map +1 -1
- package/dist/components/Tab/Tab.vue.d.ts +18 -0
- package/dist/components/Tab/Tab.vue.d.ts.map +1 -1
- package/dist/components/Tab/TabGroup.vue.d.ts +3 -1
- package/dist/components/Tab/TabGroup.vue.d.ts.map +1 -1
- package/dist/components/Text/Text.vue.d.ts +53 -1
- package/dist/components/Text/Text.vue.d.ts.map +1 -1
- package/dist/components/Text/TextConstants.d.ts +2 -0
- package/dist/components/Text/TextConstants.d.ts.map +1 -1
- package/dist/components/Text/index.d.ts +1 -1
- package/dist/components/Text/modules/SlideViewport.vue.d.ts +38 -0
- package/dist/components/Text/modules/SlideViewport.vue.d.ts.map +1 -0
- package/dist/components/Text/modules/slide.d.ts +19 -0
- package/dist/components/Text/modules/slide.d.ts.map +1 -0
- package/dist/components/Toast/Layouts/ToastLayoutAlternate.vue.d.ts +53 -1
- package/dist/components/Toast/Layouts/ToastLayoutAlternate.vue.d.ts.map +1 -1
- package/dist/components/Toast/Layouts/ToastLayoutDefault.vue.d.ts +53 -1
- package/dist/components/Toast/Layouts/ToastLayoutDefault.vue.d.ts.map +1 -1
- package/dist/components/Toast/Toast.vue.d.ts +212 -4
- package/dist/components/Toast/Toast.vue.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.vue.d.ts.map +1 -1
- package/dist/dialtone-vue.cjs +1 -1
- package/dist/dialtone-vue.js +62 -61
- package/dist/{floating-ui.dom-BUeA6pp4.js → floating-ui.dom-CuL5LTgX.js} +1 -1
- package/dist/{floating-ui.dom-BUeA6pp4.js.map → floating-ui.dom-CuL5LTgX.js.map} +1 -1
- package/dist/{floating-ui.dom-DF2uE3n8.cjs → floating-ui.dom-S7QIcAlj.cjs} +1 -1
- package/dist/{floating-ui.dom-DF2uE3n8.cjs.map → floating-ui.dom-S7QIcAlj.cjs.map} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/lib/avatar/avatar.cjs +1 -1
- package/dist/lib/avatar/avatar.cjs.map +1 -1
- package/dist/lib/avatar/avatar.js +7 -7
- package/dist/lib/badge/badge.cjs +1 -1
- package/dist/lib/badge/badge.cjs.map +1 -1
- package/dist/lib/badge/badge.js +2 -2
- package/dist/lib/banner/banner.cjs +1 -1
- package/dist/lib/banner/banner.cjs.map +1 -1
- package/dist/lib/banner/banner.js +2 -2
- package/dist/lib/breadcrumbs/breadcrumb-item.cjs +1 -1
- package/dist/lib/breadcrumbs/breadcrumb-item.cjs.map +1 -1
- package/dist/lib/breadcrumbs/breadcrumb-item.js +2 -2
- package/dist/lib/breadcrumbs/breadcrumbs.cjs +1 -1
- package/dist/lib/breadcrumbs/breadcrumbs.js +1 -1
- package/dist/lib/button/button.cjs +1 -1
- package/dist/lib/button/button.cjs.map +1 -1
- package/dist/lib/button/button.js +6 -6
- package/dist/lib/button/button.js.map +1 -1
- package/dist/lib/button-group/button-group.cjs +1 -1
- package/dist/lib/button-group/button-group.js +1 -1
- package/dist/lib/button-group/buttons-decorator.cjs +1 -1
- package/dist/lib/button-group/buttons-decorator.js +1 -1
- package/dist/lib/card/card.cjs +1 -1
- package/dist/lib/card/card.cjs.map +1 -1
- package/dist/lib/card/card.js +2 -2
- package/dist/lib/checkbox/checkbox.cjs +1 -1
- package/dist/lib/checkbox/checkbox.cjs.map +1 -1
- package/dist/lib/checkbox/checkbox.js +5 -5
- package/dist/lib/checkbox-group/checkboxes-decorator.cjs +1 -1
- package/dist/lib/checkbox-group/checkboxes-decorator.js +1 -1
- package/dist/lib/chip/chip.cjs +1 -1
- package/dist/lib/chip/chip.cjs.map +1 -1
- package/dist/lib/chip/chip.js +4 -4
- package/dist/lib/codeblock/codeblock.cjs +1 -1
- package/dist/lib/codeblock/codeblock.js +1 -1
- package/dist/lib/collapsible/collapsible-lazy-show.cjs +1 -1
- package/dist/lib/collapsible/collapsible-lazy-show.js +1 -1
- package/dist/lib/collapsible/collapsible.cjs +1 -1
- package/dist/lib/collapsible/collapsible.cjs.map +1 -1
- package/dist/lib/collapsible/collapsible.js +4 -4
- package/dist/lib/combobox/combobox-empty-list.cjs +1 -1
- package/dist/lib/combobox/combobox-empty-list.js +1 -1
- package/dist/lib/combobox/combobox-loading-list.cjs +1 -1
- package/dist/lib/combobox/combobox-loading-list.js +1 -1
- package/dist/lib/combobox/combobox.cjs +1 -1
- package/dist/lib/combobox/combobox.js +1 -1
- package/dist/lib/combobox/index.cjs +1 -1
- package/dist/lib/combobox/index.js +1 -1
- package/dist/lib/combobox-multi-select/combobox-multi-select.cjs +1 -1
- package/dist/lib/combobox-multi-select/combobox-multi-select.cjs.map +1 -1
- package/dist/lib/combobox-multi-select/combobox-multi-select.js +8 -8
- package/dist/lib/combobox-with-popover/combobox-with-popover.cjs +1 -1
- package/dist/lib/combobox-with-popover/combobox-with-popover.cjs.map +1 -1
- package/dist/lib/combobox-with-popover/combobox-with-popover.js +7 -7
- package/dist/lib/datepicker/datepicker.cjs +1 -1
- package/dist/lib/datepicker/datepicker.js +1 -1
- package/dist/lib/datepicker/index.cjs +1 -1
- package/dist/lib/datepicker/index.js +1 -1
- package/dist/lib/description-list/description-list.cjs +1 -1
- package/dist/lib/description-list/description-list.js +1 -1
- package/dist/lib/dropdown/dropdown-list.cjs +1 -1
- package/dist/lib/dropdown/dropdown-list.cjs.map +1 -1
- package/dist/lib/dropdown/dropdown-list.js +2 -2
- package/dist/lib/dropdown/dropdown-separator.cjs +1 -1
- package/dist/lib/dropdown/dropdown-separator.js +1 -1
- package/dist/lib/dropdown/dropdown.cjs +1 -1
- package/dist/lib/dropdown/dropdown.cjs.map +1 -1
- package/dist/lib/dropdown/dropdown.js +8 -18
- package/dist/lib/dropdown/dropdown.js.map +1 -1
- package/dist/lib/emoji/emoji.cjs +1 -1
- package/dist/lib/emoji/emoji.js +1 -1
- package/dist/lib/emoji-picker/emoji-picker.cjs +1 -1
- package/dist/lib/emoji-picker/emoji-picker.js +1 -1
- package/dist/lib/emoji-picker/index.cjs +1 -1
- package/dist/lib/emoji-picker/index.js +1 -1
- package/dist/lib/empty-state/empty-state.cjs +1 -1
- package/dist/lib/empty-state/empty-state.cjs.map +1 -1
- package/dist/lib/empty-state/empty-state.js +2 -2
- package/dist/lib/filter-pill/filter-pill-controlled.cjs +1 -1
- package/dist/lib/filter-pill/filter-pill-controlled.cjs.map +1 -1
- package/dist/lib/filter-pill/filter-pill-controlled.js +1 -1
- package/dist/lib/filter-pill/filter-pill.cjs +1 -1
- package/dist/lib/filter-pill/filter-pill.js +1 -1
- package/dist/lib/filter-pill/index.cjs +1 -1
- package/dist/lib/filter-pill/index.js +1 -1
- package/dist/lib/hovercard/hovercard.cjs +1 -1
- package/dist/lib/hovercard/hovercard.cjs.map +1 -1
- package/dist/lib/hovercard/hovercard.js +2 -2
- package/dist/lib/icon/icon.cjs +1 -1
- package/dist/lib/icon/icon.js +1 -1
- package/dist/lib/image-viewer/image-viewer.cjs +1 -1
- package/dist/lib/image-viewer/image-viewer.cjs.map +1 -1
- package/dist/lib/image-viewer/image-viewer.js +2 -2
- package/dist/lib/input/input.cjs +1 -1
- package/dist/lib/input/input.cjs.map +1 -1
- package/dist/lib/input/input.js +8 -8
- package/dist/lib/input-group/input-group.cjs +1 -1
- package/dist/lib/input-group/input-group.cjs.map +1 -1
- package/dist/lib/input-group/input-group.js +5 -5
- package/dist/lib/item-layout/item-layout.cjs +2 -2
- package/dist/lib/item-layout/item-layout.cjs.map +1 -1
- package/dist/lib/item-layout/item-layout.js +2 -2
- package/dist/lib/keyboard-shortcut/keyboard-shortcut.cjs +1 -1
- package/dist/lib/keyboard-shortcut/keyboard-shortcut.cjs.map +1 -1
- package/dist/lib/keyboard-shortcut/keyboard-shortcut.js +2 -2
- package/dist/lib/kitchen-sink/kitchen-sink-view.cjs +1 -1
- package/dist/lib/kitchen-sink/kitchen-sink-view.cjs.map +1 -1
- package/dist/lib/kitchen-sink/kitchen-sink-view.js +2 -2
- package/dist/lib/lazy-show/lazy-show.cjs +1 -1
- package/dist/lib/lazy-show/lazy-show.js +1 -1
- package/dist/lib/link/link.cjs +1 -1
- package/dist/lib/link/link.js +1 -1
- package/dist/lib/list-item/list-item.cjs +1 -1
- package/dist/lib/list-item/list-item.cjs.map +1 -1
- package/dist/lib/list-item/list-item.js +2 -2
- package/dist/lib/list-item-group/list-item-group.cjs +1 -1
- package/dist/lib/list-item-group/list-item-group.cjs.map +1 -1
- package/dist/lib/list-item-group/list-item-group.js +2 -2
- package/dist/lib/loader/loader.cjs +1 -1
- package/dist/lib/loader/loader.js +1 -1
- package/dist/lib/modal/modal.cjs +1 -1
- package/dist/lib/modal/modal.cjs.map +1 -1
- package/dist/lib/modal/modal.js +9 -9
- package/dist/lib/modal/modal.js.map +1 -1
- package/dist/lib/mode-directive/mode.cjs +1 -1
- package/dist/lib/mode-directive/mode.js +1 -1
- package/dist/lib/mode-island/mode-island.cjs +1 -1
- package/dist/lib/mode-island/mode-island.js +1 -1
- package/dist/lib/motion-text/motion-text.cjs +1 -1
- package/dist/lib/motion-text/motion-text.js +1 -1
- package/dist/lib/notice/notice-action.cjs +1 -1
- package/dist/lib/notice/notice-action.js +1 -1
- package/dist/lib/notice/notice-content.cjs +1 -1
- package/dist/lib/notice/notice-content.cjs.map +1 -1
- package/dist/lib/notice/notice-content.js +3 -3
- package/dist/lib/notice/notice-icon.cjs +1 -1
- package/dist/lib/notice/notice-icon.cjs.map +1 -1
- package/dist/lib/notice/notice-icon.js +2 -2
- package/dist/lib/notice/notice.cjs +1 -1
- package/dist/lib/notice/notice.js +1 -1
- package/dist/lib/pagination/pagination.cjs +1 -1
- package/dist/lib/pagination/pagination.js +1 -1
- package/dist/lib/popover/popover-header-footer.cjs +1 -1
- package/dist/lib/popover/popover-header-footer.cjs.map +1 -1
- package/dist/lib/popover/popover-header-footer.js +4 -4
- package/dist/lib/popover/popover.cjs +1 -1
- package/dist/lib/popover/popover.cjs.map +1 -1
- package/dist/lib/popover/popover.js +101 -83
- package/dist/lib/popover/popover.js.map +1 -1
- package/dist/lib/presence/index.cjs +1 -1
- package/dist/lib/presence/index.js +1 -1
- package/dist/lib/presence/presence.cjs +1 -1
- package/dist/lib/presence/presence.js +1 -1
- package/dist/lib/progress-bar/index.cjs +1 -0
- package/dist/lib/progress-bar/index.js +2 -0
- package/dist/lib/progress-bar/progress-bar.cjs +1 -0
- package/dist/lib/progress-bar/progress-bar.js +2 -0
- package/dist/lib/progress-circle/progress-circle.cjs +1 -1
- package/dist/lib/progress-circle/progress-circle.cjs.map +1 -1
- package/dist/lib/progress-circle/progress-circle.js +81 -42
- package/dist/lib/progress-circle/progress-circle.js.map +1 -1
- package/dist/lib/radio/radio.cjs +1 -1
- package/dist/lib/radio/radio.cjs.map +1 -1
- package/dist/lib/radio/radio.js +7 -7
- package/dist/lib/radio-group/radios-decorator.cjs +1 -1
- package/dist/lib/radio-group/radios-decorator.js +1 -1
- package/dist/lib/resizable/index.cjs +1 -1
- package/dist/lib/resizable/index.js +3 -3
- package/dist/lib/resizable/resizable-handle.cjs +1 -1
- package/dist/lib/resizable/resizable-handle.js +1 -1
- package/dist/lib/resizable/resizable-panel.cjs +1 -1
- package/dist/lib/resizable/resizable-panel.js +1 -1
- package/dist/lib/resizable/resizable.cjs +1 -1
- package/dist/lib/resizable/resizable.js +1 -1
- package/dist/lib/rich-text-editor/force-linkify.cjs +1 -1
- package/dist/lib/rich-text-editor/force-linkify.js +1 -1
- package/dist/lib/rich-text-editor/index.cjs +1 -1
- package/dist/lib/rich-text-editor/index.js +1 -1
- package/dist/lib/rich-text-editor/markdown-renderer.cjs +1 -1
- package/dist/lib/rich-text-editor/markdown-renderer.js +1 -1
- package/dist/lib/rich-text-editor/rich-text-editor.cjs +1 -1
- package/dist/lib/rich-text-editor/rich-text-editor.js +1 -1
- package/dist/lib/root-layout/root-layout.cjs +1 -1
- package/dist/lib/root-layout/root-layout.js +1 -1
- package/dist/lib/scroller/index.cjs +1 -1
- package/dist/lib/scroller/index.js +1 -1
- package/dist/lib/scroller/scroller.cjs +1 -1
- package/dist/lib/scroller/scroller.js +1 -1
- package/dist/lib/segmented-control/segmented-control-item.cjs +1 -1
- package/dist/lib/segmented-control/segmented-control-item.cjs.map +1 -1
- package/dist/lib/segmented-control/segmented-control-item.js +34 -4
- package/dist/lib/segmented-control/segmented-control-item.js.map +1 -1
- package/dist/lib/segmented-control/segmented-control.cjs +1 -1
- package/dist/lib/segmented-control/segmented-control.cjs.map +1 -1
- package/dist/lib/segmented-control/segmented-control.js +1 -1
- package/dist/lib/select-menu/select-menu.cjs +1 -1
- package/dist/lib/select-menu/select-menu.cjs.map +1 -1
- package/dist/lib/select-menu/select-menu.js +8 -8
- package/dist/lib/skeleton/skeleton-list-item.cjs +1 -1
- package/dist/lib/skeleton/skeleton-list-item.js +1 -1
- package/dist/lib/skeleton/skeleton-paragraph.cjs +1 -1
- package/dist/lib/skeleton/skeleton-paragraph.js +1 -1
- package/dist/lib/skeleton/skeleton-shape.cjs +1 -1
- package/dist/lib/skeleton/skeleton-shape.js +1 -1
- package/dist/lib/skeleton/skeleton-text.cjs +1 -1
- package/dist/lib/skeleton/skeleton-text.js +1 -1
- package/dist/lib/skeleton/skeleton.cjs +1 -1
- package/dist/lib/skeleton/skeleton.js +1 -1
- package/dist/lib/slider/index.cjs +1 -1
- package/dist/lib/slider/index.js +1 -1
- package/dist/lib/slider/slider.cjs +1 -1
- package/dist/lib/slider/slider.js +1 -1
- package/dist/lib/split-button/split-button-end.cjs +1 -1
- package/dist/lib/split-button/split-button-end.cjs.map +1 -1
- package/dist/lib/split-button/split-button-end.js +2 -2
- package/dist/lib/split-button/split-button-start.cjs +1 -1
- package/dist/lib/split-button/split-button-start.js +1 -1
- package/dist/lib/split-button/split-button.cjs +1 -1
- package/dist/lib/split-button/split-button.cjs.map +1 -1
- package/dist/lib/split-button/split-button.js +5 -5
- package/dist/lib/stack/stack.cjs +1 -1
- package/dist/lib/stack/stack.js +1 -1
- package/dist/lib/tab/tab-group.cjs +1 -1
- package/dist/lib/tab/tab-group.cjs.map +1 -1
- package/dist/lib/tab/tab-group.js +12 -4
- package/dist/lib/tab/tab-group.js.map +1 -1
- package/dist/lib/tab/tab-panel.cjs +1 -1
- package/dist/lib/tab/tab-panel.cjs.map +1 -1
- package/dist/lib/tab/tab-panel.js +2 -2
- package/dist/lib/tab/tab.cjs +1 -1
- package/dist/lib/tab/tab.cjs.map +1 -1
- package/dist/lib/tab/tab.js +36 -6
- package/dist/lib/tab/tab.js.map +1 -1
- package/dist/lib/text/index.cjs +1 -1
- package/dist/lib/text/index.js +3 -3
- package/dist/lib/text/text-constants.cjs +1 -1
- package/dist/lib/text/text-constants.cjs.map +1 -1
- package/dist/lib/text/text-constants.js +5 -4
- package/dist/lib/text/text-constants.js.map +1 -1
- package/dist/lib/text/text.cjs +1 -2
- package/dist/lib/text/text.js +2 -184
- package/dist/lib/text-list/index.cjs +1 -1
- package/dist/lib/text-list/index.js +2 -2
- package/dist/lib/text-list/text-list-item.cjs +1 -1
- package/dist/lib/text-list/text-list-item.js +1 -1
- package/dist/lib/text-list/text-list.cjs +1 -1
- package/dist/lib/text-list/text-list.js +1 -1
- package/dist/lib/toast/index.cjs +1 -1
- package/dist/lib/toast/index.js +1 -1
- package/dist/lib/toast/toast.cjs +1 -1
- package/dist/lib/toast/toast.js +1 -1
- package/dist/lib/toggle/toggle.cjs +1 -1
- package/dist/lib/toggle/toggle.cjs.map +1 -1
- package/dist/lib/toggle/toggle.js +4 -4
- package/dist/lib/tooltip/tooltip.cjs +1 -1
- package/dist/lib/tooltip/tooltip.cjs.map +1 -1
- package/dist/lib/tooltip/tooltip.js +6 -6
- package/dist/lib/tooltip/tooltip.js.map +1 -1
- package/dist/lib/tooltip-directive/tooltip.cjs +1 -1
- package/dist/lib/tooltip-directive/tooltip.cjs.map +1 -1
- package/dist/lib/tooltip-directive/tooltip.js +2 -2
- package/dist/lib/validation-messages/validation-messages.cjs +1 -1
- package/dist/lib/validation-messages/validation-messages.cjs.map +1 -1
- package/dist/lib/validation-messages/validation-messages.js +4 -4
- package/dist/{mode_constants-tb7TL85q.js → mode_constants-B8_1b5T8.js} +1 -1
- package/dist/{mode_constants-tb7TL85q.js.map → mode_constants-B8_1b5T8.js.map} +1 -1
- package/dist/{mode_constants-CzYJW9ua.cjs → mode_constants-DM0SVbFM.cjs} +1 -1
- package/dist/{mode_constants-CzYJW9ua.cjs.map → mode_constants-DM0SVbFM.cjs.map} +1 -1
- package/dist/shared/sr_only_close_button.cjs +1 -1
- package/dist/shared/sr_only_close_button.js +1 -1
- package/dist/utils-BL_SrwnF.js +172 -0
- package/dist/utils-BL_SrwnF.js.map +1 -0
- package/dist/utils-GofHWJKi.cjs +2 -0
- package/dist/{common/utils/index.js.map → utils-GofHWJKi.cjs.map} +1 -1
- package/package.json +11 -6
- package/dist/Combobox-96zAPv6d.cjs +0 -3
- package/dist/Datepicker-DmKOuf5y.cjs +0 -2
- package/dist/EmojiPicker-CXFd-iVj.cjs +0 -2
- package/dist/FilterPill-DY9T19XB.cjs +0 -2
- package/dist/RichTextEditor-CjyvDYID.cjs +0 -11
- package/dist/Scroller-Bt8TUghI.cjs +0 -2
- package/dist/Slider-CfvbLBv5.cjs +0 -2
- package/dist/TextListItem-BI9M_J8Y.cjs +0 -2
- package/dist/Toast-BXvUrvd_.cjs +0 -2
- package/dist/common/utils/index.cjs.map +0 -1
- package/dist/lib/text/text.cjs.map +0 -1
- package/dist/lib/text/text.js.map +0 -1
- /package/dist/{_plugin-vue_export-helper-BTgDAbhb.js → _plugin-vue_export-helper-BecorN_g.js} +0 -0
- /package/dist/{_plugin-vue_export-helper-D8jCH6HB.cjs → _plugin-vue_export-helper-CX7YVcP6.cjs} +0 -0
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
const e=require(`./chunk-Bmb41Sf3.cjs`),t=require(`./common/utils/index.cjs`),n=require(`./_plugin-vue_export-helper-D8jCH6HB.cjs`),r=require(`./common/emoji/index.cjs`),i=require(`./lib/avatar/avatar.cjs`),a=require(`./lib/badge/badge.cjs`),o=require(`./lib/text/text.cjs`),s=require(`./localization/index.cjs`),c=require(`./lib/link/link.cjs`),l=require(`./lib/button/button.cjs`),u=require(`./lib/list-item/list-item.cjs`),d=require(`./lib/stack/stack.cjs`),f=require(`./lib/popover/popover.cjs`),p=require(`./lib/emoji/emoji.cjs`),ee=require(`./lib/input/input.cjs`),m=require(`./node_modules/@tiptap/vue-3.cjs`),h=require(`./floating-ui.dom-DF2uE3n8.cjs`),te=require(`./ForceLinkify-DhmBEXhe.cjs`),g=require(`./lib/rich-text-editor/rich-text-editor-constants.cjs`),_=require(`./MarkdownRenderer-a12waV7r.cjs`);let v=require(`vue`),ne=require(`@dialpad/dialtone-icons/vue`),y=require(`regex-combined-emojis`),b=require(`@tiptap/core`),x=require(`@tiptap/pm/state`),re=require(`@tiptap/pm/tables`),S=require(`@tiptap/extension-blockquote`);S=e.t(S);let C=require(`@tiptap/extension-code-block`);C=e.t(C);let w=require(`@tiptap/extension-code`);w=e.t(w);let T=require(`@tiptap/extension-document`);T=e.t(T);let E=require(`@tiptap/extensions`),D=require(`@tiptap/extension-hard-break`);D=e.t(D);let O=require(`@tiptap/extension-paragraph`);O=e.t(O);let k=require(`@tiptap/extension-bold`);k=e.t(k);let A=require(`@tiptap/extension-list`),j=require(`@tiptap/extension-italic`);j=e.t(j);let M=require(`@tiptap/extension-link`);M=e.t(M);let N=require(`@tiptap/extension-strike`);N=e.t(N);let P=require(`@tiptap/extension-underline`);P=e.t(P);let F=require(`@tiptap/extension-text`);F=e.t(F);let I=require(`@tiptap/extension-text-align`);I=e.t(I);let L=require(`@tiptap/extension-table`),R=require(`@tiptap/extension-text-style`),z=require(`@tiptap/suggestion`);z=e.t(z);let B=require(`@tiptap/extension-image`);B=e.t(B);let V=require(`@tiptap/extension-mention`);V=e.t(V);let H=require(`@dialpad/dialtone-icons/vue/hash`);H=e.t(H);let U=require(`@dialpad/dialtone-icons/vue/lock`);U=e.t(U);let W=require(`deep-equal`);W=e.t(W);function ie(e,t){let n=Math.min(e.top,t.top),r=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),a=Math.max(e.right,t.right)-i,o=r-n;return new DOMRect(i,n,a,o)}var ae=class{constructor({editor:e,element:t,view:n,updateDelay:r=250,resizeDelay:i=60,shouldShow:a,appendTo:o,getReferencedVirtualElement:s,options:c}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:`absolute`,placement:`top`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:e,state:t,from:n,to:r})=>{let{doc:i,selection:a}=t,{empty:o}=a,s=!i.textBetween(n,r).length&&(0,b.isTextSelection)(t.selection),c=this.element.contains(document.activeElement);return!(!(e.hasFocus()||c)||o||s||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(e,t)=>{let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);!n&&!r||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,n,r,t)},this.updateDelay))},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;if(!(i||!t&&!n)){if(!this.getShouldShow(r)){this.hide();return}this.updatePosition(),this.show()}},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(`bubbleMenu`);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`&&this.updateOptions(t.options)},this.editor=e,this.element=t,this.view=n,this.updateDelay=r,this.resizeDelay=i,this.appendTo=o,this.scrollTarget=c?.scrollTarget??window,this.getReferencedVirtualElement=s,this.floatingUIOptions={...this.floatingUIOptions,...c},this.element.tabIndex=0,a&&(this.shouldShow=a),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener(`dragstart`,this.dragstartHandler),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(h.a(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(h.l(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(h.c(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(h.t(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(h.u(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(h.n(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(h.o(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(h.s(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}get virtualElement(){let{selection:e}=this.editor.state,t=this.getReferencedVirtualElement?.call(this);if(t)return t;if(!this.view?.dom?.parentNode)return;let n=(0,b.posToDOMRect)(this.view,e.from,e.to),r={getBoundingClientRect:()=>n,getClientRects:()=>[n]};if(e instanceof x.NodeSelection){let t=this.view.nodeDOM(e.from),n=t.dataset.nodeViewWrapper?t:t.querySelector(`[data-node-view-wrapper]`);n&&(t=n),t&&(r={getBoundingClientRect:()=>t.getBoundingClientRect(),getClientRects:()=>[t.getBoundingClientRect()]})}if(e instanceof re.CellSelection){let{$anchorCell:t,$headCell:n}=e,i=t?t.pos:n.pos,a=n?n.pos:t.pos,o=this.view.nodeDOM(i),s=this.view.nodeDOM(a);if(!o||!s)return;let c=o===s?o.getBoundingClientRect():ie(o.getBoundingClientRect(),s.getBoundingClientRect());r={getBoundingClientRect:()=>c,getClientRects:()=>[c]}}return r}updatePosition(){let e=this.virtualElement;e&&h.i(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{if(r.hide?.referenceHidden||r.hide?.escaped){this.element.style.visibility=`hidden`;return}this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){let{state:n}=e,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(e,t);return}let i=!t?.selection.eq(e.state.selection),a=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,a,t)}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,element:this.element,view:this.view,state:t,oldState:e,from:i,to:a})||!1}show(){var e;this.isVisible||(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0)}hide(){this.isVisible&&(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener(`dragstart`,this.dragstartHandler),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},oe=e=>new x.Plugin({key:typeof e.pluginKey==`string`?new x.PluginKey(e.pluginKey):e.pluginKey,view:t=>new ae({view:t,...e})}),se=(0,v.defineComponent)({name:`BubbleMenu`,inheritAttrs:!1,props:{pluginKey:{type:[String,Object],default:`bubbleMenu`},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},resizeDelay:{type:Number,default:void 0},options:{type:Object,default:()=>({})},appendTo:{type:[Object,Function],default:void 0},shouldShow:{type:Function,default:null},getReferencedVirtualElement:{type:Function,default:void 0}},setup(e,{slots:t,attrs:n}){let r=(0,v.ref)(null);return(0,v.onMounted)(()=>{let{editor:t,options:n,pluginKey:i,resizeDelay:a,appendTo:o,shouldShow:s,getReferencedVirtualElement:c,updateDelay:l}=e,u=r.value;u&&(u.style.visibility=`hidden`,u.style.position=`absolute`,u.remove(),(0,v.nextTick)(()=>{t.registerPlugin(oe({editor:t,element:u,options:n,pluginKey:i,resizeDelay:a,appendTo:o,shouldShow:s,getReferencedVirtualElement:c,updateDelay:l}))}))}),(0,v.onBeforeUnmount)(()=>{let{pluginKey:t,editor:n}=e;n.unregisterPlugin(t)}),()=>(0,v.h)(`div`,{ref:r,...n},t.default?.call(t))}}),ce=class{constructor({editor:e,element:t,view:n,updateDelay:r=250,resizeDelay:i=60,options:a,appendTo:o,shouldShow:s}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:e,state:t})=>{let{selection:n}=t,{$anchor:r,empty:i}=n,a=r.depth===1,o=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent&&r.parent.childCount===0&&!this.getTextContent(r.parent);return!(!e.hasFocus()||!i||!a||!o||!this.editor.isEditable)},this.floatingUIOptions={strategy:`absolute`,placement:`right`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;if(!(i||!t&&!n)){if(!this.getShouldShow(r)){this.hide();return}this.updatePosition(),this.show()}},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(`floatingMenu`);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`&&this.updateOptions(t.options)},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.updateDelay=r,this.resizeDelay=i,this.appendTo=o,this.scrollTarget=a?.scrollTarget??window,this.floatingUIOptions={...this.floatingUIOptions,...a},this.element.tabIndex=0,s&&(this.shouldShow=s),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getTextContent(e){return(0,b.getText)(e,{textSerializers:(0,b.getTextSerializersFromSchema)(this.editor.schema)})}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(h.a(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(h.l(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(h.c(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(h.t(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(h.u(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(h.n(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(h.o(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(h.s(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,view:this.view,state:t,oldState:e,from:i,to:a})}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){let{selection:e}=this.editor.state,t=(0,b.posToDOMRect)(this.view,e.from,e.to);h.i({getBoundingClientRect:()=>t,getClientRects:()=>[t]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{if(r.hide?.referenceHidden||r.hide?.escaped){this.element.style.visibility=`hidden`;return}this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,r,t)}show(){var e;this.isVisible||(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0)}hide(){this.isVisible&&(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},le=e=>new x.Plugin({key:typeof e.pluginKey==`string`?new x.PluginKey(e.pluginKey):e.pluginKey,view:t=>new ce({view:t,...e})});(0,v.defineComponent)({name:`FloatingMenu`,inheritAttrs:!1,props:{pluginKey:{type:null,default:`floatingMenu`},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},resizeDelay:{type:Number,default:void 0},options:{type:Object,default:()=>({})},appendTo:{type:[Object,Function],default:void 0},shouldShow:{type:Function,default:null}},setup(e,{slots:t,attrs:n}){let r=(0,v.ref)(null);return(0,v.onMounted)(()=>{let{pluginKey:t,editor:n,updateDelay:i,resizeDelay:a,options:o,appendTo:s,shouldShow:c}=e,l=r.value;l&&(l.style.visibility=`hidden`,l.style.position=`absolute`,l.remove(),n.registerPlugin(le({pluginKey:t,editor:n,element:l,updateDelay:i,resizeDelay:a,options:o,appendTo:s,shouldShow:c})))}),(0,v.onBeforeUnmount)(()=>{let{pluginKey:t,editor:n}=e;n.unregisterPlugin(t)}),()=>(0,v.h)(`div`,{ref:r,...n},t.default?.call(t))}});var G=e=>({default:null,parseHTML:t=>t.getAttribute(e),renderHTML:t=>t[e]?{[e]:t[e]}:{}}),ue=()=>{let e=G(`style`);return e.renderHTML=e=>e.style?{style:de(e.style)}:{},e};function de(e){return e.replace(/(?<![a-z-])width\s*:\s*([^;]+);?/gi,(e,t)=>/^\s*0\s*[a-z%]*\s*(!important)?\s*$/i.test(t)?`width: 100%;`:e)}var fe=L.Table.extend({addAttributes(){return{...this.parent?.(),border:G(`border`),cellpadding:G(`cellpadding`),cellspacing:G(`cellspacing`),style:ue()}},renderHTML({HTMLAttributes:e}){return[`table`,(0,b.mergeAttributes)(this.options.HTMLAttributes,e),[`tbody`,0]]}}),pe=L.TableRow.extend({addAttributes(){return{...this.parent?.(),style:G(`style`)}}}),K={style:G(`style`),valign:G(`valign`),width:G(`width`)},me=L.TableCell.extend({addAttributes(){return{...this.parent?.(),...K}}}),he=L.TableHeader.extend({addAttributes(){return{...this.parent?.(),...K}}}),ge=R.TextStyle.extend({parseHTML(){return[...this.parent?.()||[],{tag:`div`,consuming:!1,getAttrs:e=>e.hasAttribute(`style`)?{}:!1},{tag:`a`,consuming:!1,getAttrs:e=>e.hasAttribute(`style`)?{}:!1}]}}),_e={name:`EmojiComponent`,components:{NodeViewWrapper:m.NodeViewWrapper,DtEmoji:p.default},props:m.nodeViewProps};function ve(e,t,n,r,i,a){let o=(0,v.resolveComponent)(`dt-emoji`),s=(0,v.resolveComponent)(`node-view-wrapper`);return(0,v.openBlock)(),(0,v.createBlock)(s,{class:`d-d-inline-block d-va-bottom d-lh0`},{default:(0,v.withCtx)(()=>[(0,v.createVNode)(o,{size:`500`,code:e.node.attrs.code},null,8,[`code`])]),_:1})}var ye=n.t(_e,[[`render`,ve]]),be={name:`SuggestionList`,components:{DtListItem:u.default},props:{items:{type:Array,required:!0},command:{type:Function,required:!0},itemComponent:{type:Object,required:!0},itemType:{type:String,required:!0}},data(){return{selectedIndex:0}},watch:{items(){this.selectedIndex=0}},methods:{onKeyDown({event:e}){return e.key===`ArrowUp`?(this.upHandler(),!0):e.key===`ArrowDown`?(this.downHandler(),!0):e.key===`Enter`||e.key===`Tab`?(this.selectHandler(),!0):!1},upHandler(){this.selectedIndex=(this.selectedIndex+this.items.length-1)%this.items.length,this.scrollActiveElementIntoView()},downHandler(){this.selectedIndex=(this.selectedIndex+1)%this.items.length,this.scrollActiveElementIntoView()},async scrollActiveElementIntoView(){await this.$nextTick();let e=this.$refs.suggestionList.querySelector(`.d-list-item--highlighted`);e&&e.scrollIntoView({behavior:`smooth`,block:`nearest`})},selectHandler(){this.selectItem(this.selectedIndex)},selectItem(e){let t=this.items[e];switch(this.itemType){case`emoji`:this.command(t);return;case`mention`:this.command({name:t.name,id:t.id,avatarSrc:t.avatarSrc,contactKey:t.contactKey});break;case`channel`:this.command({name:t.name,id:t.id,locked:t.locked,channelKey:t.channelKey});break;case`slash-command`:this.command({command:t.command});break}}}},xe={class:`d-popover__dialog d-suggestion-list__container`},Se={ref:`suggestionList`,class:`d-suggestion-list`};function Ce(e,t,n,r,i,a){let o=(0,v.resolveComponent)(`dt-list-item`);return(0,v.openBlock)(),(0,v.createElementBlock)(`div`,xe,[(0,v.withDirectives)((0,v.createElementVNode)(`ul`,Se,[((0,v.openBlock)(!0),(0,v.createElementBlock)(v.Fragment,null,(0,v.renderList)(n.items,(e,t)=>((0,v.openBlock)(),(0,v.createBlock)(o,{key:e.id,class:(0,v.normalizeClass)([`d-suggestion-list__item`,{"d-list-item--highlighted":t===i.selectedIndex}]),"navigation-type":`arrow-keys`,onClick:e=>a.selectItem(t),onKeydown:(0,v.withModifiers)(a.onKeyDown,[`prevent`])},{default:(0,v.withCtx)(()=>[((0,v.openBlock)(),(0,v.createBlock)((0,v.resolveDynamicComponent)(n.itemComponent),{item:e},null,8,[`item`]))]),_:2},1032,[`class`,`onClick`,`onKeydown`]))),128))],512),[[v.vShow,n.items.length]])])}var we=n.t(be,[[`render`,Ce]]),q=`top-start`;function Te(){return{getBoundingClientRect:()=>({width:0,height:0,x:0,y:0,top:0,left:0,right:0,bottom:0})}}function J(e){return{getBoundingClientRect:e}}async function Ee(e,t,n={}){if(!e||!t?.getBoundingClientRect)return;let{placement:r=q,middleware:i=[h.c(0),h.a(),h.l({padding:8})]}=n,{x:a,y:o}=await h.i(t,e,{placement:r,middleware:i});Object.assign(e.style,{left:`${a}px`,top:`${o}px`})}function De(e,t={}){let{zIndex:n=`650`}=t;e.style.position=`absolute`,e.style.zIndex=n,e.style.display=`none`}function Oe(e){e&&(e.style.display=`block`)}function ke(e){e&&(e.style.display=`none`)}function Ae(e,t){return n=>{n.key===`Escape`&&t()&&e()}}function je(e){document.addEventListener(`keydown`,e)}function Me(e){document.removeEventListener(`keydown`,e)}function Ne(e,t,n,r){return new m.VueRenderer(e,{props:{itemComponent:(0,v.markRaw)(t),itemType:n,...r},editor:r.editor})}function Pe(e){e.escHandler&&Me(e.escHandler),e.floatingEl?.remove(),e.component?.destroy()}function Y(e,t,n={}){let{listComponent:r=we,placement:i=q,zIndex:a=`650`}=n;return()=>{let n=null,o=null,s=!1,c=Te(),l=null;function u(){Ee(o,c,{placement:i})}function d(){o&&(Oe(o),s=!0,u())}function f(){o&&(ke(o),s=!1)}return{onStart:i=>{n=Ne(r,e,t,i),i.clientRect&&(o=n.element,De(o,{zIndex:a}),document.body.appendChild(o),c=J(i.clientRect),l=Ae(f,()=>s),je(l),i.items.length>0&&d())},onUpdate(e){n?.updateProps(e),e.items.length>0?d():f(),e.clientRect&&(c=J(e.clientRect),u())},onKeyDown(e){if(s)return n?.ref?.onKeyDown(e)},onExit(){Pe({escHandler:l,floatingEl:o,component:n}),l=null,o=null,n=null}}}}var Fe={name:`EmojiSuggestion`,components:{DtEmoji:p.default,DtStack:d.default},props:{item:{type:Object,required:!0}}};function Ie(e,t,n,r,i,a){let o=(0,v.resolveComponent)(`dt-emoji`),s=(0,v.resolveComponent)(`dt-stack`);return(0,v.openBlock)(),(0,v.createBlock)(s,{direction:`row`,gap:`100`},{default:(0,v.withCtx)(()=>[(0,v.createVNode)(o,{size:`200`,code:n.item.code},null,8,[`code`]),(0,v.createTextVNode)(` `+(0,v.toDisplayString)(n.item.code),1)]),_:1})}var Le=n.t(Fe,[[`render`,Ie]]),Re=20,ze=(e,t,n)=>{let r=e.shortname?.replaceAll(`:`,``),i=t.shortname?.replaceAll(`:`,``),a=r.startsWith(n),o=i.startsWith(n);return a&&!o?-1:!a&&o?1:r.localeCompare(i)},Be={items:({query:e})=>{if(e.length<2)return[];let t=Object.values(r.getEmojiData());return e=e.toLowerCase(),t.filter(t=>[t.name,t.shortname?.replaceAll(`:`,``),...t.keywords||[]].some(t=>t&&t.startsWith(e))).splice(0,Re).sort((t,n)=>ze(t,n,e)).map(e=>({code:e.shortname}))},command:({editor:e,range:t,props:n})=>{e.view.state.selection.$to.nodeAfter?.text?.startsWith(` `)&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:`emoji`,attrs:n}]).run(),window.getSelection()?.collapseToEnd()},render:Y(Le,`emoji`)},Ve=/(:\w+:)$/,He=RegExp(y.emojiPattern+`$`),Ue=e=>{if(e&&r.codeToEmojiData(e[0]))return{text:e[2]||e[0]}},We=e=>[...e.matchAll(r.emojiShortCodeRegex)].filter(e=>r.codeToEmojiData(e[0])).map(e=>({index:e.index,text:e[0],match:e})),Ge=b.Node.create({name:`emoji`,addOptions(){return{HTMLAttributes:{}}},group:`inline`,inline:!0,selectable:!1,atom:!0,addNodeView(){return m.VueNodeViewRenderer(ye)},addAttributes(){return{code:{default:null}}},parseHTML(){return[{tag:`emoji-component`}]},renderText({node:e}){let t=e.attrs.code??``,n=t?r.codeToEmojiData(t):void 0;return n?r.stringToUnicode(n.unicode_output):t},renderHTML({HTMLAttributes:e}){return[`emoji-component`,(0,b.mergeAttributes)(this.options.HTMLAttributes,e)]},addInputRules(){return[new b.InputRule({find:e=>{let t=e.match(Ve)||e.match(He);if(t)return Ue(t)},handler:({state:e,range:t,match:n})=>{let{tr:r}=e,i=t.from,a=t.to;r.replaceWith(i,a,this.type.create({code:n[0]}))}})]},addPasteRules(){return[(0,b.nodePasteRule)({find:We,type:this.type,getAttributes(e){return{code:e[0]}}}),(0,b.nodePasteRule)({find:r.emojiRegex,type:this.type,getAttributes(e){return{code:e[0]}}})]},addProseMirrorPlugins(){return[(0,z.default)({char:`:`,pluginKey:new x.PluginKey(`emoji`),editor:this.editor,...this.options.suggestion,...Be})]},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:t})=>{let n=!1,{selection:r}=t,{empty:i,anchor:a}=r;return i?(t.doc.nodesBetween(a-1,a,(t,r)=>{if(t.type.name===this.name)return n=!0,e.insertText(``,r,r+t.nodeSize),!1}),n):!1})}}});function Ke(e,t,n=()=>!0){let r=[];t.lastIndex=0;let i;for(;i=t.exec(e);)n(e,i)&&r.push(i);return r}function qe(e,t){return![`#`,`@`].includes(e.charAt(t.index))&&![`#`,`@`].includes(e.charAt(t.index-1))}function Je(e){let t=RegExp(`(?:`+[`[!?.,:;'"]`,`(?:&|&)(?:lt|gt|quot|apos|raquo|laquo|rsaquo|lsaquo);)+$`].join(`|`),`g`);return e.replace(t,``)}function Ye(e,t){let n=e.slice(0,t+1).search(/\S+\s*$/),r=e.slice(t).search(/\s/);if(r<0){let t=e.slice(n);return{text:t,from:n,to:n+t.length}}return{text:e.slice(n,r+t),from:n,to:r+t}}function X(e,t,n,r){let i=Ye(e,t);if(r.lastIndex=0,!r.test(i.text))return i;let a=n===`left`?i.from-1:i.to+1;return a<=0||a>=e.length||a===t?i:X(e,a,n,r)}function Xe(e,t,n,r){let i=(0,b.getMarksBetween)(Math.max(e.from-1,0),Math.min(e.to+1,t.content.size),t);for(let e of i)e.mark.type===r&&n.removeMark(e.from,e.to,r)}var Z=t.getPhoneNumberRegex(1,15);function Q(e,n,r,i,a,o){if(!e)return;let s=r-n-1;s=s<0?0:s;let c=i-n,l=X(e,s,`left`,Z),u=X(e,c,`right`,Z);Ke(e.slice(l.from,u.to),t.linkRegex,qe).forEach(e=>{let t=Je(e[0]),r=n+l.from+e.index+1,i=r+t.length;a.addMark(r,i,o.create())})}function Ze(e){let t=!1;return new x.Plugin({key:new x.PluginKey(`autolink`),appendTransaction:(n,r,i)=>{let a=n.some(e=>e.docChanged)&&!r.doc.eq(i.doc);if(t&&!a)return;let{tr:o}=i,{textContent:s}=i.doc;if(!t||!r.doc.textContent)return Q(s,0,0,s.length,o,e.type),t=!0,o;t=!0;let c=(0,b.getChangedRanges)((0,b.combineTransactionSteps)(r.doc,[...n]));return c.length?(c.forEach(({oldRange:t,newRange:n})=>{if(n.from===n.to){Q(s,0,0,s.length,o,e.type);return}Xe(n,i.doc,o,e.type),(0,b.findChildrenInRange)(i.doc,n,e=>e.isTextblock).forEach(({node:r,pos:i})=>{Q(r.textContent,i,t.from,n.to,o,e.type)})}),o):(Q(s,0,0,s.length,o,e.type),o)}})}var Qe={class:`d-link d-c-text d-d-inline-block d-wb-break-all`,rel:`noopener noreferrer nofollow`},$e=b.Mark.create({name:`CustomLink`,renderHTML({HTMLAttributes:e}){return[`a`,(0,b.mergeAttributes)(this.options.HTMLAttributes,e,Qe)]},renderText({node:e}){return e.attrs.text},addProseMirrorPlugins(){return[Ze({type:this.type})]}}),et=b.Mark.create({name:`LinkPhoneNumbers`,renderHTML({HTMLAttributes:e}){return[`a`,(0,b.mergeAttributes)(e,{class:`d-link d-c-pointer d-d-inline-block d-wb-break-all`,rel:`noopener noreferrer nofollow`})]},addProseMirrorPlugins(){let e=this.editor,t=this.type;return[new x.Plugin({key:new x.PluginKey(`phoneClick`),props:{handleClick(n,r,i){let{state:a}=n,o=a.doc.resolve(r);if(!o.marks().some(e=>e.type===t))return!1;let s=(0,b.getMarkRange)(o,t),c=s?a.doc.textBetween(s.from,s.to):``;return i.preventDefault(),e.emit(`phone-click`,{phoneNumber:c}),!0}}})]}}),tt=B.default.extend({name:`ConfigurableImage`,addAttributes(){return{src:{default:``},alt:{default:void 0},title:{default:void 0},width:{default:void 0},height:{default:void 0},style:{default:void 0}}}}).configure({inline:!0,allowBase64:!0}),nt=new Set(`address.article.aside.blockquote.dd.details.dialog.div.dl.dt.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.hr.li.main.nav.ol.p.pre.section.table.ul`.split(`.`)),rt=O.default.extend({parseHTML(){return[{tag:`div`,getAttrs:e=>{for(let t of e.children)if(nt.has(t.tagName.toLowerCase()))return!1;return null}}]},renderHTML({HTMLAttributes:e}){return[`div`,(0,b.mergeAttributes)(this.options.HTMLAttributes,e),0]}}),it={name:`MentionComponent`,components:{NodeViewWrapper:m.NodeViewWrapper,DtLink:c.default},props:m.nodeViewProps,computed:{text(){return`@`+this.$props.node.attrs.name}},methods:{getMentionData(){return{name:this.$props.node.attrs.name,id:this.$props.node.attrs.id,avatarSrc:this.$props.node.attrs.avatarSrc,contactKey:this.$props.node.attrs.contactKey}},handleClick(){this.$props.editor.emit(`mention-click`,this.getMentionData())},handleMouseEnter(e){this.$props.editor.emit(`mention-hover`,{...this.getMentionData(),event:e})},handleMouseLeave(e){this.$props.editor.emit(`mention-leave`,{...this.getMentionData(),event:e})}}};function at(e,t,n,r,i,a){let o=(0,v.resolveComponent)(`dt-link`),s=(0,v.resolveComponent)(`node-view-wrapper`);return(0,v.openBlock)(),(0,v.createBlock)(s,{class:`d-d-inline-block`},{default:(0,v.withCtx)(()=>[(0,v.createVNode)(o,{tone:`mention`,onClick:(0,v.withModifiers)(a.handleClick,[`prevent`]),onMouseenter:a.handleMouseEnter,onMouseleave:a.handleMouseLeave,onFocusin:a.handleMouseEnter,onFocusout:a.handleMouseLeave},{default:(0,v.withCtx)(()=>[(0,v.createTextVNode)((0,v.toDisplayString)(a.text),1)]),_:1},8,[`onClick`,`onMouseenter`,`onMouseleave`,`onFocusin`,`onFocusout`])]),_:1})}var ot=n.t(it,[[`render`,at]]),st=V.default.extend({addNodeView(){return m.VueNodeViewRenderer(ot)},parseHTML(){return[{tag:`mention-component`}]},addAttributes(){return{name:{default:``},avatarSrc:{default:``},id:{default:``},contactKey:{default:``}}},renderText({node:e}){return`@${e.attrs.id}`},renderHTML({HTMLAttributes:e}){return[`mention-component`,(0,b.mergeAttributes)(this.options.HTMLAttributes,e)]}}).configure({suggestion:{char:`@`,pluginKey:new x.PluginKey(`mentionSuggestion`)}}),ct={name:`ChannelComponent`,components:{NodeViewWrapper:m.NodeViewWrapper,DtLink:c.default,DtIconLock:ne.DtIconLock,DtStack:d.default},props:m.nodeViewProps,computed:{text(){return this.$props.node.attrs.locked?this.$props.node.attrs.name:`#`+this.$props.node.attrs.name}},methods:{handleClick(){let e={name:this.$props.node.attrs.name,id:this.$props.node.attrs.id,locked:this.$props.node.attrs.locked,channelKey:this.$props.node.attrs.channelKey};this.$props.editor.emit(`channel-click`,e)}}};function lt(e,t,n,r,i,a){let o=(0,v.resolveComponent)(`dt-icon-lock`),s=(0,v.resolveComponent)(`dt-stack`),c=(0,v.resolveComponent)(`dt-link`),l=(0,v.resolveComponent)(`node-view-wrapper`);return(0,v.openBlock)(),(0,v.createBlock)(l,{class:`d-d-inline-block`},{default:(0,v.withCtx)(()=>[(0,v.createVNode)(c,{tone:`mention`,onClick:(0,v.withModifiers)(a.handleClick,[`prevent`])},{default:(0,v.withCtx)(()=>[(0,v.createVNode)(s,{direction:`row`,gap:`0`},{default:(0,v.withCtx)(()=>[e.$props.node.attrs.locked?((0,v.openBlock)(),(0,v.createBlock)(o,{key:0,size:`200`})):(0,v.createCommentVNode)(``,!0),(0,v.createElementVNode)(`span`,null,(0,v.toDisplayString)(a.text),1)]),_:1})]),_:1},8,[`onClick`])]),_:1})}var ut=n.t(ct,[[`render`,lt]]),dt=V.default.extend({name:`channel`,addNodeView(){return m.VueNodeViewRenderer(ut)},parseHTML(){return[{tag:`channel-component`}]},addAttributes(){return{name:{default:``},id:{default:``},locked:{default:!1},channelKey:{default:``}}},renderText({node:e}){return`#${e.attrs.id}`},renderHTML({HTMLAttributes:e}){return[`channel-component`,(0,b.mergeAttributes)(this.options.HTMLAttributes,e)]}}).configure({suggestion:{char:`#`,pluginKey:new x.PluginKey(`channelSuggestion`)}}),ft={name:`SlashCommandsComponent`,components:{NodeViewWrapper:m.NodeViewWrapper},props:{...m.nodeViewProps},emits:[`selected-command`],computed:{text(){return`/`+this.$props.node.attrs.command}},created(){let e=this.$props.node.attrs.command;this.$emit(`selected-command`,e);let t=this.editor?.storage?.[`slash-commands`]?.onSelectedCommand;t&&typeof t==`function`&&t(e)}};function pt(e,t,n,r,i,a){let o=(0,v.resolveComponent)(`node-view-wrapper`);return(0,v.openBlock)(),(0,v.createBlock)(o,{class:`d-d-inline-block`},{default:(0,v.withCtx)(()=>[(0,v.createTextVNode)((0,v.toDisplayString)(a.text),1)]),_:1})}var mt=n.t(ft,[[`render`,pt]]),ht=(e,t)=>[...e.matchAll(t)].map(e=>{let t=e[2];return t.endsWith(` `)||(t+=` `),{index:e.index,text:t,match:e}}),gt=V.default.extend({name:`slash-commands`,group:`inline`,inline:!0,addOptions(){return{...this.parent?.(),onSelectedCommand:null}},addStorage(){return{onSelectedCommand:this.options.onSelectedCommand}},addNodeView(){return m.VueNodeViewRenderer(mt)},parseHTML(){return[{tag:`command-component`}]},addAttributes(){return{command:{default:``},parametersExample:{default:``},description:{default:``}}},renderText({node:e}){return`/${e.attrs.command}`},renderHTML({HTMLAttributes:e}){return[`command-component`,(0,b.mergeAttributes)(this.options.HTMLAttributes,e)]},addInputRules(){let e=this.options.suggestion?.items({query:``}).map(e=>e.command);return[(0,b.nodeInputRule)({find:RegExp(`^((?:\\/)(${e.join(`|`)})) $`),type:this.type,getAttributes(e){return{command:e[2]}}})]},addPasteRules(){let e=this.options.suggestion?.items({query:``}).map(e=>e.command),t=RegExp(`^((?:\\/)(${e.join(`|`)})) ?$`,`g`);return[(0,b.nodePasteRule)({find:e=>ht(e,t),type:this.type,getAttributes(e){return{command:e[0].trim()}}})]}}).configure({suggestion:{char:`/`,pluginKey:new x.PluginKey(`slashCommandSuggestion`)}}),_t=100,vt={name:`VariableComponent`,components:{DtBadge:a.default,DtButton:l.default,DtPopover:f.default,DtInput:ee.default,NodeViewWrapper:m.NodeViewWrapper},props:m.nodeViewProps,data(){return{i18n:new s.DialtoneLocalization,MAX_VARIABLE_ALT_LENGTH:_t}},computed:{altText:{get(){return this.node?.attrs?.altText||``},set(e){this.updateAttributes({altText:e})}},variableId(){return this.node?.attrs?.id},placeholder(){return this.variableData?.placeholder||``},variableItems(){return this.extension?.options?.variableItems||[]},variableData(){return this.variableItems.find(e=>e.id===this.variableId)},enableAltText(){return this.node?.attrs?.enableAltText},badgeLabel(){return`{} ${this.placeholder}`},placeholderText(){return`Replaces ${this.placeholder}`}}};function yt(e,t,n,r,i,a){let o=(0,v.resolveComponent)(`dt-badge`),s=(0,v.resolveComponent)(`dt-button`),c=(0,v.resolveComponent)(`dt-input`),l=(0,v.resolveComponent)(`dt-popover`),u=(0,v.resolveComponent)(`node-view-wrapper`);return(0,v.openBlock)(),(0,v.createBlock)(u,{class:`d-d-inline-block`},{default:(0,v.withCtx)(()=>[a.enableAltText?((0,v.openBlock)(),(0,v.createBlock)(l,{key:0,padding:`small`,"navigation-type":`arrow-keys`,placement:`top-start`,modal:!1},{anchor:(0,v.withCtx)(({attrs:e})=>[(0,v.createVNode)(s,(0,v.mergeProps)(e,{kind:`unstyled`}),{default:(0,v.withCtx)(()=>[(0,v.createVNode)(o,{text:a.badgeLabel,contenteditable:`false`},null,8,[`text`])]),_:1},16)]),content:(0,v.withCtx)(({close:e})=>[(0,v.createVNode)(c,{modelValue:a.altText,"onUpdate:modelValue":t[0]||(t[0]=e=>a.altText=e),class:`d-p-100 d-w332`,label:i.i18n.$t(`DIALTONE_EDITOR_VARIABLE_LABEL`),placeholder:a.placeholderText,validate:{length:{description:i.i18n.$t(`DIALTONE_EDITOR_VARIABLE_VALIDATE_DESCRIPTION`),message:i.i18n.$t(`DIALTONE_EDITOR_VARIABLE_VALIDATE_MESSAGE`),max:i.MAX_VARIABLE_ALT_LENGTH,warn:i.MAX_VARIABLE_ALT_LENGTH,limitMaxLength:!0}},onKeyup:(0,v.withKeys)(t=>e(),[`enter`])},null,8,[`modelValue`,`label`,`placeholder`,`validate`,`onKeyup`])]),_:1})):((0,v.openBlock)(),(0,v.createBlock)(o,{key:1,text:a.badgeLabel,contenteditable:`false`},null,8,[`text`]))]),_:1})}var bt=n.t(vt,[[`render`,yt]]),xt=b.Node.create({name:`variable`,group:`inline`,inline:!0,selectable:!0,atom:!0,addOptions(){return{HTMLAttributes:{},variableItems:[]}},addNodeView(){return m.VueNodeViewRenderer(bt)},addAttributes(){return{id:{default:null,parseHTML:e=>e.getAttribute(`data-variable-id`),renderHTML:e=>e.id?{"data-variable-id":e.id}:{}},altText:{default:``,parseHTML:e=>e.getAttribute(`data-alt-text`),renderHTML:e=>e.altText?{"data-alt-text":e.altText}:{}},enableAltText:{default:!0,parseHTML:e=>e.getAttribute(`data-enable-alt-text`)===`true`,renderHTML:e=>({"data-enable-alt-text":String(e.enableAltText)})}}},parseHTML(){return[{tag:`variable`}]},renderText({node:e}){return e.attrs.altText},renderHTML({node:e,HTMLAttributes:t}){return[`variable`,(0,b.mergeAttributes)(this.options.HTMLAttributes,t,{"data-variable-id":e.attrs.id,"data-alt-text":e.attrs.altText,"data-enable-alt-text":String(e.attrs.enableAltText)})]},addCommands(){return{insertVariable:(e={})=>({commands:t})=>t.insertContent({type:this.name,attrs:{id:e.id||null,altText:e.altText||``,enableAltText:e.enableAltText}})}}}),St={name:`MentionSuggestion`,components:{DtAvatar:i.default,DtStack:d.default,DtText:o.default},props:{item:{type:Object,required:!0}},computed:{name(){return this.item.name},avatarSrc(){return this.item.avatarSrc},presence(){return this.item.presence},status(){return this.item.status},presenceText(){return this.item.presenceText},presenceFontColorClass(){return{active:`d-mention-suggestion__presence--active`,busy:`d-mention-suggestion__presence--busy`,away:`d-mention-suggestion__presence--away`,offline:`d-mention-suggestion__presence--busy`}[this.presence]},showDetails(){return this.item.showDetails}}},Ct={class:`d-mention-suggestion__name`};function wt(e,t,n,r,i,a){let o=(0,v.resolveComponent)(`dt-avatar`),s=(0,v.resolveComponent)(`dt-text`),c=(0,v.resolveComponent)(`dt-stack`);return(0,v.openBlock)(),(0,v.createBlock)(c,{direction:`row`,class:`d-mention-suggestion__container`,gap:`100`},{default:(0,v.withCtx)(()=>[(0,v.createVNode)(o,{"full-name":a.name,"image-src":a.avatarSrc,"image-alt":a.name,"show-presence":a.showDetails,presence:a.presence,size:200},null,8,[`full-name`,`image-src`,`image-alt`,`show-presence`,`presence`]),(0,v.createVNode)(c,{class:`d-mention-suggestion__details-container`,gap:`1`},{default:(0,v.withCtx)(()=>[(0,v.createElementVNode)(`span`,Ct,(0,v.toDisplayString)(a.name),1),a.showDetails?((0,v.openBlock)(),(0,v.createBlock)(c,{key:0,direction:`row`,gap:`50`},{default:(0,v.withCtx)(()=>[a.presenceText?((0,v.openBlock)(),(0,v.createBlock)(s,{key:0,kind:`label`,size:200,strength:`normal`,class:(0,v.normalizeClass)([`d-mention-suggestion__presence`,[a.presenceFontColorClass]])},{default:(0,v.withCtx)(()=>[(0,v.createTextVNode)((0,v.toDisplayString)(a.presenceText),1)]),_:1},8,[`class`])):(0,v.createCommentVNode)(``,!0),a.status&&a.presenceText?((0,v.openBlock)(),(0,v.createBlock)(s,{key:1,kind:`label`,size:200,strength:`normal`,as:`div`,class:`d-mention-suggestion__divider`},{default:(0,v.withCtx)(()=>[...t[0]||(t[0]=[(0,v.createTextVNode)(` • `,-1)])]),_:1})):(0,v.createCommentVNode)(``,!0),a.status?((0,v.openBlock)(),(0,v.createBlock)(s,{key:2,kind:`label`,size:200,strength:`normal`,as:`div`,class:`d-mention-suggestion__status`},{default:(0,v.withCtx)(()=>[(0,v.createTextVNode)((0,v.toDisplayString)(a.status),1)]),_:1})):(0,v.createCommentVNode)(``,!0)]),_:1})):(0,v.createCommentVNode)(``,!0)]),_:1})]),_:1})}var Tt={allowSpaces:!0,render:Y(n.t(St,[[`render`,wt]]),`mention`)},Et={name:`ChannelSuggestion`,components:{DtStack:d.default,DtIconHash:H.default,DtIconLock:U.default},props:{item:{type:Object,required:!0}},computed:{name(){return this.item.name}}};function $(e,t,n,r,i,a){let o=(0,v.resolveComponent)(`dt-icon-hash`),s=(0,v.resolveComponent)(`dt-icon-lock`),c=(0,v.resolveComponent)(`dt-stack`);return(0,v.openBlock)(),(0,v.createBlock)(c,{direction:`row`,gap:`100`},{default:(0,v.withCtx)(()=>[n.item.locked?((0,v.openBlock)(),(0,v.createBlock)(s,{key:1,size:`300`})):((0,v.openBlock)(),(0,v.createBlock)(o,{key:0,size:`300`})),(0,v.createElementVNode)(`span`,null,(0,v.toDisplayString)(a.name),1)]),_:1})}var Dt={allowSpaces:!0,render:Y(n.t(Et,[[`render`,$]]),`channel`)},Ot={name:`SlashCommandSuggestion`,components:{DtText:o.default},props:{item:{type:Object,required:!0}},computed:{command(){return this.item.command},description(){return this.item.description},parametersExample(){return this.item.parametersExample}}},kt={key:0};function At(e,t,n,r,i,a){let o=(0,v.resolveComponent)(`dt-text`);return(0,v.openBlock)(),(0,v.createElementBlock)(`div`,null,[(0,v.createVNode)(o,{kind:`body`,size:300,density:300,as:`div`},{default:(0,v.withCtx)(()=>[(0,v.createElementVNode)(`span`,null,`/`+(0,v.toDisplayString)(a.command),1),a.parametersExample?((0,v.openBlock)(),(0,v.createElementBlock)(`span`,kt,(0,v.toDisplayString)(a.parametersExample),1)):(0,v.createCommentVNode)(``,!0)]),_:1}),(0,v.createVNode)(o,{kind:`body`,size:200,tone:`tertiary`,as:`div`},{default:(0,v.withCtx)(()=>[(0,v.createTextVNode)((0,v.toDisplayString)(a.description),1)]),_:1})])}var jt={allowSpaces:!0,startOfLine:!0,render:Y(n.t(Ot,[[`render`,At]]),`slash-command`)},Mt={name:`DtRichTextEditor`,components:{EditorContent:m.EditorContent,BubbleMenu:se,DtButton:l.default,DtStack:d.default},props:{modelValue:{type:[Object,String],default:``},editable:{type:Boolean,default:!0},allowTyping:{type:Boolean,default:!0},pasteRichText:{type:Boolean,default:!0},allowLineBreaks:{type:Boolean,default:!1},inputAriaLabel:{type:String,required:!0},inputClass:{type:String,default:``},autoFocus:{type:[Boolean,String,Number],default:!1,validator(e){return typeof e==`string`?g.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(e):!0}},outputFormat:{type:String,default:`html`,validator(e){return g.RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(e)}},placeholder:{type:String,default:``},link:{type:[Boolean,Object],default:!1},customLink:{type:[Boolean,Object],default:!1},linkPhoneNumbers:{type:Array,default:null},mentionSuggestion:{type:Object,default:null},channelSuggestion:{type:Object,default:null},slashCommandSuggestion:{type:Object,default:null},allowBlockquote:{type:Boolean,default:!0},allowBold:{type:Boolean,default:!0},allowBulletList:{type:Boolean,default:!0},allowItalic:{type:Boolean,default:!0},allowStrike:{type:Boolean,default:!0},allowUnderline:{type:Boolean,default:!0},allowCode:{type:Boolean,default:!0},allowCodeblock:{type:Boolean,default:!0},allowInlineImages:{type:Boolean,default:!1},allowFontColor:{type:Boolean,default:!1},allowBackgroundColor:{type:Boolean,default:!1},allowFontSize:{type:Boolean,default:!1},allowFontFamily:{type:Boolean,default:!1},allowLineHeight:{type:Boolean,default:!1},allowVariable:{type:Boolean,default:!1},variableItems:{type:Array,default:()=>[]},additionalExtensions:{type:Array,default:()=>[]},showLinkBubbleMenu:{type:Boolean,default:!0},preserveWhitespace:{type:[Boolean,String],default:`full`},useDivTags:{type:Boolean,default:!1},allowTables:{type:Boolean,default:!1},allowTextAlign:{type:Boolean,default:!0},allowImageResize:{type:Boolean,default:!1}},emits:[`update:modelValue`,`json-input`,`html-input`,`text-input`,`markdown-input`,`blur`,`focus`,`enter`,`edit-link`,`selected`,`selected-command`,`mention-click`,`mention-hover`,`mention-leave`,`channel-click`,`phone-click`,`link-click`],data(){return{editor:null,appendTo:()=>t.returnFirstEl(this.$refs.editor.$el).getRootNode()?.querySelector(`body`),floatingOptions:{placement:`top-start`},i18n:new s.DialtoneLocalization}},computed:{attrs(){return{...this.$attrs,onInput:()=>{},onFocus:()=>{},onBlur:()=>{}}},extensions(){let e=[T.default,F.default,E.UndoRedo,D.default];e.push(this.useDivTags?rt:O.default),this.allowBold&&e.push(k.default),this.allowBlockquote&&e.push(S.default),this.allowBulletList&&(e.push(A.BulletList),e.push(A.ListItem.extend({renderText({node:e}){return e.textContent}})),e.push(A.OrderedList)),this.allowItalic&&e.push(j.default),this.allowStrike&&e.push(N.default),this.allowUnderline&&e.push(P.default),this.placeholder&&e.push(E.Placeholder.configure({placeholder:this.placeholder}));let t=this,n=b.Extension.create({addKeyboardShortcuts(){return{"Shift-Enter":({editor:e})=>t.allowLineBreaks?!1:(e.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>t.allowBulletList&&e.splitListItem(`listItem`),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),!0),Enter:()=>t.allowLineBreaks?!1:(t.$emit(`enter`),!0)}}});if(e.push(n),this.link&&e.push(M.default.extend({inclusive:!1,addKeyboardShortcuts(){return{"Mod-k":()=>(t.$emit(`edit-link`),!0)}}}).configure({HTMLAttributes:{class:`d-link d-wb-break-all`},openOnClick:!1,autolink:!this.customLink,protocols:g.RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS})),this.customLink&&e.push(this.getExtension($e,this.customLink)),this.linkPhoneNumbers!==null&&e.push(et),this.mentionSuggestion){let t={...this.mentionSuggestion,...Tt};e.push(st.configure({suggestion:t}))}if(this.channelSuggestion){let t={...this.channelSuggestion,...Dt};e.push(dt.configure({suggestion:t}))}if(this.slashCommandSuggestion){let t={...this.slashCommandSuggestion,...jt};e.push(gt.configure({suggestion:t,onSelectedCommand:e=>{this.$emit(`selected-command`,e)}}))}return this.allowVariable&&e.push(xt.configure({variableItems:this.variableItems})),e.push(Ge),this.allowTextAlign&&e.push(I.default.configure({types:[`paragraph`]})),this.allowCode&&e.push(w.default),this.allowCodeblock&&e.push(C.default.extend({renderText({node:e,pos:t,range:n}){let r=n?.from??0,i=n?.to??t+e.nodeSize;if(r<=t&&i>=t+e.nodeSize)return`\`\`\`\n${e.textContent}\n\`\`\``;let a=Math.max(0,r-t-1),o=Math.min(e.textContent.length,i-t-1);return e.textContent.slice(a,o)},addCommands(){return{...this.parent?.(),toggleCodeBlock:(e={})=>({state:t,chain:n,commands:r})=>{let i=t.schema.nodes[this.name],{$from:a,$to:o}=t.selection,s=[];return t.doc.nodesBetween(a.pos,o.pos,(e,t)=>{if(e.isTextblock)return s.push({node:e,pos:t}),!1}),s.length<=1?r.toggleNode(this.name,`paragraph`,e):s.every(({node:e})=>e.type===i)?r.toggleNode(this.name,`paragraph`):n().setNode(this.name,e).command(({tr:e})=>{for(let n=s.length-1;n>0;n--){let r=e.mapping.map(s[n].pos),a=r-1;e.doc.resolve(a).parent.type===i&&e.replaceWith(a,r+1,t.schema.text(`
|
|
2
|
-
`))}return!0}).run()}}}}).configure({HTMLAttributes:{class:`d-rich-text-editor__code-block`}})),this.allowInlineImages&&e.push(tt.configure({resize:{enabled:this.allowImageResize,alwaysPreserveAspectRatio:!0}})),(this.allowFontFamily||this.allowFontColor||this.allowFontSize||this.allowBackgroundColor||this.allowLineHeight)&&(e.push(R.TextStyleKit.configure({textStyle:!1,color:this.allowFontColor,backgroundColor:this.allowBackgroundColor,fontFamily:this.allowFontFamily,fontSize:this.allowFontSize,lineHeight:this.allowLineHeight})),e.push(ge)),this.additionalExtensions.length&&e.push(...this.additionalExtensions),this.allowTables&&e.push(fe.configure({resizable:!0}),pe,he,me,E.Gapcursor),e},inputAttrs(){let e={"aria-label":this.inputAriaLabel,"aria-multiline":!0,role:`textbox`};return this.editable||(e[`aria-readonly`]=!0),e}},watch:{editable(e){this.editor.setEditable(e),this.updateEditorAttributes({"aria-readonly":!e})},inputClass(e){this.updateEditorAttributes({class:e})},inputAriaLabel(e){this.updateEditorAttributes({"aria-label":e})},extensions(){this.destroyEditor(),this.createEditor()},modelValue(e){this.processValue(e)},linkPhoneNumbers(){this._applyPhoneMarks()}},created(){this.createEditor()},beforeUnmount(){this.destroyEditor()},mounted(){t.warnIfUnmounted(t.returnFirstEl(this.$el),this.$options.name),this.processValue(this.modelValue,!1)},methods:{createEditor(){this.editor=new m.Editor({autofocus:this.autoFocus,content:this.modelValue,editable:this.editable,extensions:this.extensions,shouldRerenderOnTransaction:!1,parseOptions:{preserveWhitespace:this.preserveWhitespace},editorProps:{attributes:{...this.inputAttrs,class:this.inputClass},handleDOMEvents:{click:(e,t)=>{if(!this.link||t.button!==0)return!1;let n=t.target?.closest?.(`a`);return n?(this.editor.emit(`link-click`,{href:n.href,text:n.textContent,event:t}),t.defaultPrevented):!1}},handleKeyDown:(e,t)=>{if(this.allowTyping)return!1;let n=[`Backspace`];return!this.allowLineBreaks&&!t.shiftKey&&n.push(`Enter`),!n.includes(t.key)},handlePaste:(e,t)=>{let n=t.clipboardData||window.clipboardData,r=n.getData(`text/plain`),i=n.getData(`text/html`);return this.processPasteData(e,r,i)},transformPastedHTML(e){return e.replace(/<hr[^>]*\/?>/gi,`<p><br></p>`).replace(/(<\/\w+>)((<br \/>)+)/g,`$2$1`).replace(/(<br[^>]*>\s*)+<\/p>(\s*)$/i,`</p>$2`)}}}),this.addEditorListeners()},bubbleMenuShouldShow({editor:e}){return this.showLinkBubbleMenu&&e.isActive(`link`)},getSelectedLinkText(e){let{view:t,state:n}=e,{from:r,to:i}=t.state.selection,a=n.doc.textBetween(r,i,``),o=this.editor.state.doc.nodeAt(r);return o&&o.marks?.at(0)?.type?.name===`link`?o.textContent:a},editLink(){let e=this.getSelectedLinkText(this.editor),t={href:this.editor.getAttributes(`link`).href,text:e};this.$emit(`edit-link`,t)},removeLink(){this.editor?.chain()?.focus()?.unsetLink()?.run()},openLink(){this.editor?.chain()?.focus();let e=this.editor.getAttributes(`link`).href;window.open(e,`_blank`)},forceLinkifyPendingText(){!this.editor||!this.link||this.customLink||te.t(this.editor)},setLink(e,t,n,r=g.RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,i){if(!e){this.removeLink();return}r.find(t=>t.test(e))||(e=`${i}${e}`),this.editor.chain().focus().extendMarkRange(`link`).run();let a=this.editor?.view?.state?.selection,o=t||e;this.editor.chain().focus().insertContent(o).setTextSelection({from:a.from,to:a.from+o.length}).setLink({href:e,class:n.class}).run()},processValue(e,t=!0){if(!this.editor)return;let n=this.getOutput();if(!(t&&(0,W.default)(e,n))){if(typeof e==`string`&&this.outputFormat===`text`){let t=RegExp(`(${y.emojiPattern})`,`g`);e=e?.replace(t,`<emoji-component code="$1"></emoji-component>`)}this.editor.commands.setContent(e,{emitUpdate:!1,parseOptions:{preserveWhitespace:this.preserveWhitespace}}),this._applyPhoneMarks()}},_applyPhoneMarks(){if(!this.editor)return;let e=this.editor.schema.marks.LinkPhoneNumbers;if(!e)return;let{tr:t,doc:n}=this.editor.state;t.removeMark(0,n.content.size,e),this.linkPhoneNumbers?.length&&n.descendants((n,r)=>{if(!(!n.isText||!n.text))for(let i of this.linkPhoneNumbers){let a=0,o;for(;(o=n.text.indexOf(i,a))!==-1;)t.addMark(r+o,r+o+i.length,e.create()),a=o+i.length}}),this.editor.view.dispatch(t)},destroyEditor(){this.editor.destroy()},insertPlainTextWithHardBreaks(e,t){let n=(this.pasteRichText?t:t.replace(/\r\n/g,`
|
|
3
|
-
`).replace(/\n\n/g,`
|
|
4
|
-
`)).replace(/[\r\n]+$/,``).split(/\r?\n/),r=[];for(let e=0;e<n.length;e++)e>0&&r.push({type:`hardBreak`}),n[e]&&r.push({type:`text`,text:n[e]});this.editor.chain().focus().insertContent(r).run()},shouldPreserveLineBreaks(e,t){return this.pasteRichText?!t&&e&&this.hasBlankLines(e):!!e},processPasteData(e,t,n){if(this.shouldPreserveLineBreaks(t,n))return this.insertPlainTextWithHardBreaks(e,t),!0;if(this.shouldHandlePreformattedHTML(n)){let t=this.extractPreformattedText(n);if(t&&t.includes(`
|
|
5
|
-
`))return this.insertPlainTextWithHardBreaks(e,t),!0}return!1},shouldHandlePreformattedHTML(e){return this.pasteRichText&&e&&this.containsPreformattedContent(e)},containsPreformattedContent(e){let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelectorAll(`*`);for(let e of n)if(this.hasPreWhitespace(e)&&this.hasLineBreaks(e))return!0;return!1},hasPreWhitespace(e){let t=e.getAttribute(`style`)||``,n=e.style.whiteSpace||``,r=n===`pre`||n===`pre-wrap`,i=t.includes(`white-space: pre`);return r||i},hasLineBreaks(e){return e.textContent&&e.textContent.includes(`
|
|
6
|
-
`)},hasBlankLines(e){return e.includes(`
|
|
7
|
-
|
|
8
|
-
`)||/\n\s*\n/.test(e)},extractPreformattedText(e){let t=document.createElement(`div`);return t.innerHTML=e,this.walkAndExtractText(t)},walkAndExtractText(e){let t=``;if(e.nodeType===Node.TEXT_NODE)t+=e.textContent;else if(e.nodeType===Node.ELEMENT_NODE)if(this.hasPreWhitespace(e))t+=e.textContent;else for(let n of e.childNodes)t+=this.walkAndExtractText(n);return t},triggerInputChangeEvents(){let e=this.getOutput();this.$emit(`update:modelValue`,e);let t=this.editor.getJSON();this.$emit(`json-input`,t);let n=this.editor.getHTML();this.$emit(`html-input`,n);let r=this.editor.getText({blockSeparator:`
|
|
9
|
-
`});this.$emit(`text-input`,r);let i=_.t(t,this.extensions);this.$emit(`markdown-input`,i)},addEditorListeners(){this.editor.on(`create`,()=>{this.triggerInputChangeEvents()}),this.editor.on(`update`,()=>{this.triggerInputChangeEvents()}),this.editor.on(`selectionUpdate`,({editor:e})=>{this.$emit(`selected`,this.getSelectedLinkText(e))}),this.editor.on(`focus`,({event:e})=>{this.$emit(`focus`,e)}),this.editor.on(`blur`,({event:e})=>{this.$emit(`blur`,e)}),this.editor.on(`mention-click`,e=>{this.$emit(`mention-click`,e)}),this.editor.on(`mention-hover`,e=>{this.$emit(`mention-hover`,e)}),this.editor.on(`mention-leave`,e=>{this.$emit(`mention-leave`,e)}),this.editor.on(`channel-click`,e=>{this.$emit(`channel-click`,e)}),this.editor.on(`phone-click`,e=>{this.$emit(`phone-click`,e)}),this.editor.on(`link-click`,e=>{this.$emit(`link-click`,e)})},getOutput(){switch(this.outputFormat){case`json`:return this.editor.getJSON();case`html`:return this.editor.getHTML();case`markdown`:return _.t(this.editor.getJSON(),this.extensions);default:return this.editor.getText({blockSeparator:`
|
|
10
|
-
`})}},getExtension(e,t){return typeof t==`boolean`?e:e.configure?.(t)},updateEditorAttributes(e){this.editor.setOptions({editorProps:{attributes:{...this.inputAttrs,class:this.inputClass,...e}}})},focusEditor(){this.editor.commands.focus()}}},Nt={class:`d-popover__dialog`};function Pt(e,t,n,r,i,a){let o=(0,v.resolveComponent)(`dt-button`),s=(0,v.resolveComponent)(`dt-stack`),c=(0,v.resolveComponent)(`bubble-menu`),l=(0,v.resolveComponent)(`editor-content`);return(0,v.openBlock)(),(0,v.createElementBlock)(`div`,null,[i.editor&&n.link?((0,v.openBlock)(),(0,v.createBlock)(c,{key:0,editor:i.editor,"should-show":a.bubbleMenuShouldShow,options:i.floatingOptions,"append-to":i.appendTo,style:{visibility:`visible`}},{default:(0,v.withCtx)(()=>[(0,v.createElementVNode)(`div`,Nt,[(0,v.createVNode)(s,{direction:`row`,class:`d-rich-text-editor-bubble-menu__button-stack`,gap:`0`},{default:(0,v.withCtx)(()=>[(0,v.createVNode)(o,{kind:`muted`,importance:`clear`,onClick:a.editLink},{default:(0,v.withCtx)(()=>[(0,v.createTextVNode)((0,v.toDisplayString)(i.i18n.$t(`DIALTONE_RICH_TEXT_EDITOR_EDIT_BUTTON_LABEL`)),1)]),_:1},8,[`onClick`]),(0,v.createVNode)(o,{kind:`muted`,importance:`clear`,onClick:a.openLink},{default:(0,v.withCtx)(()=>[(0,v.createTextVNode)((0,v.toDisplayString)(i.i18n.$t(`DIALTONE_RICH_TEXT_EDITOR_OPEN_LINK_BUTTON_LABEL`)),1)]),_:1},8,[`onClick`]),(0,v.createVNode)(o,{kind:`critical`,importance:`clear`,onClick:a.removeLink},{default:(0,v.withCtx)(()=>[(0,v.createTextVNode)((0,v.toDisplayString)(i.i18n.$t(`DIALTONE_RICH_TEXT_EDITOR_REMOVE_BUTTON_LABEL`)),1)]),_:1},8,[`onClick`])]),_:1})])]),_:1},8,[`editor`,`should-show`,`options`,`append-to`])):(0,v.createCommentVNode)(``,!0),(0,v.createVNode)(l,(0,v.mergeProps)({ref:`editor`,editor:i.editor,class:`d-rich-text-editor`,"data-qa":`dt-rich-text-editor`},a.attrs),null,16,[`editor`])])}var Ft=n.t(Mt,[[`render`,Pt]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return Ft}});
|
|
11
|
-
//# sourceMappingURL=RichTextEditor-CjyvDYID.cjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
require(`./chunk-Bmb41Sf3.cjs`);const e=require(`./common/utils/index.cjs`),t=require(`./_plugin-vue_export-helper-D8jCH6HB.cjs`);let n=require(`vue`);var r={__name:`CoreScroller`,props:{items:{type:Array,required:!0},keyField:{type:String,default:`id`},direction:{type:String,default:`vertical`,validator:e=>[`vertical`,`horizontal`].includes(e)},itemSize:{type:Number,default:null},minItemSize:{type:[Number,String],default:null},sizeField:{type:String,default:`size`},buffer:{type:Number,default:200},enableHover:{type:Boolean,default:!0},listTag:{type:String,default:`div`},itemTag:{type:String,default:`div`},listClass:{type:[String,Object,Array],default:``},itemClass:{type:[String,Object,Array],default:``}},emits:[`user-position`,`scroll-start`,`scroll-end`],setup(e,{expose:t,emit:r}){let i=e,a=r,o=(0,n.reactive)(new Map),s=(0,n.reactive)(new Map),c=(0,n.ref)([]),l=(0,n.ref)(null),u=(0,n.ref)(!1),d=(0,n.ref)(null),f=(0,n.ref)(null),p=(0,n.ref)(null),m=(0,n.ref)(`blockStart`),h=0,g=0,_=!1,v=0,y=null,b=null,x=0,S=0,C=(0,n.computed)(()=>{if(i.itemSize===null){let e={"-1":{accumulator:0}},t=i.items,n=i.sizeField,r=i.minItemSize,a=1e4,o=0,s;for(let i=0,c=t.length;i<c;i++)s=t[i][n]||r,s<a&&(a=s),o+=s,e[i]={accumulator:o,size:s};return b=a,e}return[]}),w=(0,n.computed)(()=>i.items.length&&typeof i.items[0]!=`object`),T=(0,n.computed)(()=>{let e={};for(let t=0,n=i.items.length;t<n;t++)e[i.items[t][i.keyField]]=t;return e});(0,n.watch)(C,()=>{j(!1)},{deep:!0}),(0,n.onMounted)(()=>{(0,n.nextTick)(()=>{j(!0),u.value=!0})});let E=(e,t,r,i,a)=>{let o=(0,n.shallowReactive)({item:r,position:0,nr:(0,n.markRaw)({id:S++,index:t,used:!0,key:i,type:a})});return e.value.push(o),o},D=(e,t=!1)=>{let n=s,r=e.nr.type,i=n.get(r);i||(i=[],n.set(r,i)),i.push(e),t||(e.nr.used=!1,e.position=-9999)},O=()=>{let e=i.direction===`vertical`,t;return t=e?{start:d.value.scrollTop,end:d.value.scrollTop+d.value.clientHeight}:{start:d.value.scrollLeft,end:d.value.scrollLeft+d.value.clientWidth},t},k=()=>{throw setTimeout(()=>{console.error(`It seems the scroller element isn't scrolling, so it tries to render all the items at once.`,`Scroller:`,d),console.error(`Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.`)}),Error(`Rendered items limit reached`)},A=()=>{c.value.sort((e,t)=>e.nr.index-t.nr.index)},j=(e,t=!1)=>{if(!d.value)return;let n=i.itemSize,r=b,l=w.value?null:i.keyField,u=i.items,m=u.length,_=C.value,S=o,j=s,M=c,N=T,P,F,I,L,R;if(!m)P=F=L=R=I=0;else{let e=O();if(t){let t=e.start-v.value;if(t<0&&(t=-t),n===null&&t<r.value||t<n)return{continuous:!0}}v=e.start;let a=i.buffer;e.start-=a,e.end+=a;let o=i.direction===`vertical`?`scrollHeight`:`scrollWidth`;if(f.value&&(e.start-=f.value[o]),p.value&&(e.end+=p.value[o]),n===null){let t,n=0,r=m-1,i=~~(m/2),a;do a=i,t=_[i]?.accumulator,t<e.start?n=i:i<m-1&&_[i+1]?.accumulator>e.start&&(r=i),i=~~((n+r)/2);while(i!==a);for(i<0&&(i=0),P=i,I=_[m-1]?.accumulator,F=i;F<m&&_[F]?.accumulator<e.end;F++);for(F===-1?F=u.length-1:(F++,F>m&&(F=m)),L=h;L<m&&_[L]?.accumulator<e.start;L++);for(R=L;R<m&&_[R]?.accumulator<e.end;R++);}else{P=~~(e.start/n);let t=P%1;P-=t,F=Math.ceil(e.end/n),L=Math.max(0,Math.floor(e.start/n)),R=Math.floor(e.end/n),P<0&&(P=0),F>m&&(F=m),L<0&&(L=0),R>m&&(R=m),I=Math.ceil(m/1)*n}}F-P>1e3&&k(),x=I;let z,B=P<=g&&F>=P;if(B)for(let t=0,n=M.value.length;t<n;t++)z=M.value[t],z?.nr.used&&(e&&(z.nr.index=N[z.item[l]]),(z.nr.index==null||z.nr.index<P||z.nr.index>=F)&&D(z));let V=B?null:new Map,H,U,W;for(let e=P;e<F;e++){H=u[e];let t=l?H?.[l]:H;if(t==null)throw Error(`Key is ${t} on item (keyField is '${l}')`);if(z=S.get(t),!n&&!_[e]?.size){z&&D(z);continue}U=H.type;let r=j.get(U),i=!1;if(!z)B?z=r&&r.length?r.pop():E(M,e,H,t,U):(W=V.get(U)||0,(!r||W>=r.length)&&(z=E(M,e,H,t,U),D(z,!0),r=j.get(U)),z=r[W],V.set(U,W+1)),S.delete(z.nr.key),z.nr.used=!0,z.nr.index=e,z.nr.key=t,z.nr.type=U,S.set(t,z),i=!0;else if(!z.nr.used&&(z.nr.used=!0,i=!0,r)){let e=r.indexOf(z);e!==-1&&r.splice(e,1)}z.item=H,i&&(e===u.length-1&&a(`scroll-end`),e===0&&a(`scroll-start`)),n===null?(z.position=_[e-1]?.accumulator,z.offset=0):(z.position=Math.floor(e)*n,z.offset=e%1*n)}return h=P,g=F,clearTimeout(y),y=setTimeout(A,300),{continuous:B}},M=e=>{let t=i.direction===`vertical`?{scroll:`scrollTop`,start:`top`}:{scroll:`scrollLeft`,start:`left`},n=d.value,r=t.scroll;n[r]=e},N=e=>{let t;t=i.itemSize===null?e>0?C.value[e-1]?.accumulator:0:Math.floor(e)*i.itemSize,M(t)},P=()=>{let e=d.value;m.value!==`middle`&&(m.value=`middle`,a(`user-position`,`middle`)),e.scrollTop===0&&(m.value=`blockStart`,a(`user-position`,`blockStart`),a(`user-position`,`top`)),e.scrollTop+e.clientHeight===e.scrollHeight&&(m.value=`blockEnd`,a(`user-position`,`blockEnd`),a(`user-position`,`bottom`)),_||(_=!0,requestAnimationFrame(()=>{_=!1,j(!1,!0)}))};return t({scrollToItem:N,_updateVisibleItems:j}),(t,r)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{ref_key:`scroller`,ref:d,class:(0,n.normalizeClass)([`vue-recycle-scroller`,{ready:u.value,[`direction-${e.direction}`]:!0}]),onScrollPassive:P},[t.$slots.before?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{key:0,ref_key:`before`,ref:f,"data-qa":`dt-scroller-before`,class:`vue-recycle-scroller__slot`},[(0,n.renderSlot)(t.$slots,`before`)],512)):(0,n.createCommentVNode)(``,!0),((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.listTag),{ref:`wrapper`,style:(0,n.normalizeStyle)({[e.direction===`vertical`?`minHeight`:`minWidth`]:`${(0,n.unref)(x)}px`}),"data-qa":`dt-scroller-item-wrapper`,class:(0,n.normalizeClass)([`vue-recycle-scroller__item-wrapper`,e.listClass])},{default:(0,n.withCtx)(()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(c.value,r=>((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.itemTag),(0,n.mergeProps)({key:r.nr.id,"data-qa":`dt-scroller-item`,style:u.value?{transform:`translate${e.direction===`vertical`?`Y`:`X`}(${r.position}px) translate${e.direction===`vertical`?`X`:`Y`}(${r.offset}px)`,width:void 0,height:void 0}:null,class:[`vue-recycle-scroller__item-view`,[e.itemClass,{hover:i.enableHover&&l.value===r.nr.key}]]},(0,n.toHandlers)(i.enableHover?{mouseenter:()=>{l.value=r.nr.key},mouseleave:()=>{l.value=null}}:{})),{default:(0,n.withCtx)(()=>[(0,n.renderSlot)(t.$slots,`default`,{item:r.item,index:r.nr.index,active:r.nr.used})]),_:2},1040,[`style`,`class`]))),128)),e.items.length?(0,n.createCommentVNode)(``,!0):(0,n.renderSlot)(t.$slots,`empty`,{key:0})]),_:3},8,[`style`,`class`])),t.$slots.after?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{key:1,ref_key:`after`,ref:p,"data-qa":`dt-scroller-after`,class:`vue-recycle-scroller__slot`},[(0,n.renderSlot)(t.$slots,`after`)],512)):(0,n.createCommentVNode)(``,!0)],34))}},i={name:`DynamicScroller`,components:{CoreScroller:r,DtScrollerItem:{name:`DtScrollerItem`,inject:[`vscrollData`,`vscrollParent`,`vscrollResizeObserver`],props:{item:{required:!0},watchData:{type:Boolean,default:!1},active:{type:Boolean,required:!0},index:{type:Number,default:void 0},sizeDependencies:{type:[Array,Object],default:null},tag:{type:String,default:`div`}},computed:{id(){if(this.vscrollData.simpleArray)return this.index;if(this.vscrollData.keyField in this.item)return this.item[this.vscrollData.keyField];throw Error(`keyField '${this.vscrollData.keyField}' not found in your item. You should set a valid keyField prop on your Scroller`)},size(){return this.vscrollData.sizes[this.id]||0},finalActive(){return this.active&&this.vscrollData.active}},watch:{watchData:`updateWatchData`,id(t,n){if(e.returnFirstEl(this.$el).$_vs_id=this.id,this.size||this.onDataUpdate(),this.$_sizeObserved){let e=this.vscrollData.sizes[n],r=this.vscrollData.sizes[t];e!=null&&e!==r&&this.applySize(e)}},finalActive(e){this.size||(e?this.vscrollParent.$_undefinedMap[this.id]||(this.vscrollParent.$_undefinedSizes++,this.vscrollParent.$_undefinedMap[this.id]=!0):this.vscrollParent.$_undefinedMap[this.id]&&(this.vscrollParent.$_undefinedSizes--,this.vscrollParent.$_undefinedMap[this.id]=!1)),this.vscrollResizeObserver?e?this.observeSize():this.unobserveSize():e&&this.$_pendingVScrollUpdate===this.id&&this.updateSize()}},created(){if(!this.$isServer&&(this.$_forceNextVScrollUpdate=null,this.updateWatchData(),!this.vscrollResizeObserver))for(let e in this.sizeDependencies)this.$watch(()=>this.sizeDependencies[e],this.onDataUpdate)},mounted(){this.finalActive&&(this.updateSize(),this.observeSize())},beforeUnmount(){this.unobserveSize()},methods:{updateSize(){this.finalActive?this.$_pendingSizeUpdate!==this.id&&(this.$_pendingSizeUpdate=this.id,this.$_forceNextVScrollUpdate=null,this.$_pendingVScrollUpdate=null,this.computeSize(this.id)):this.$_forceNextVScrollUpdate=this.id},updateWatchData(){this.watchData&&!this.vscrollResizeObserver?this.$_watchData=this.$watch(`item`,()=>{this.onDataUpdate()},{deep:!0}):this.$_watchData&&(this.$_watchData(),this.$_watchData=null)},onVscrollUpdate({force:e}){!this.finalActive&&e&&(this.$_pendingVScrollUpdate=this.id),(this.$_forceNextVScrollUpdate===this.id||e||!this.size)&&this.updateSize()},onDataUpdate(){this.updateSize()},computeSize(t){this.$nextTick(()=>{if(this.id===t){let t=e.returnFirstEl(this.$el).offsetWidth,n=e.returnFirstEl(this.$el).offsetHeight;this.applyWidthHeight(t,n)}this.$_pendingSizeUpdate=null})},applyWidthHeight(e,t){let n=~~(this.vscrollParent.direction===`vertical`?t:e);n&&this.size!==n&&this.applySize(n)},applySize(e){this.vscrollParent.$_undefinedMap[this.id]&&(this.vscrollParent.$_undefinedSizes--,this.vscrollParent.$_undefinedMap[this.id]=void 0),this.vscrollData.sizes[this.id]=e},observeSize(){this.vscrollResizeObserver&&(this.$_sizeObserved||(this.vscrollResizeObserver.observe(e.returnFirstEl(this.$el)),this.$el.$_vs_id=this.id,this.$el.$_vs_onResize=this.onResize,this.$_sizeObserved=!0))},unobserveSize(){this.vscrollResizeObserver&&this.$_sizeObserved&&(this.vscrollResizeObserver.unobserve(e.returnFirstEl(this.$el)),this.$el.$_vs_onResize=void 0,this.$_sizeObserved=!1)},onResize(e,t,n){this.id===e&&this.applyWidthHeight(t,n)}},render(){return(0,n.h)(this.tag,this.$slots.default())}}},provide(){return typeof ResizeObserver<`u`&&(this.$_resizeObserver=new ResizeObserver(e=>{requestAnimationFrame(()=>{if(Array.isArray(e)){for(let t of e)if(t.target&&t.target.$_vs_onResize){let e,n;if(t.borderBoxSize){let r=t.borderBoxSize[0];e=r.inlineSize,n=r.blockSize}else e=t.contentRect.width,n=t.contentRect.height;t.target.$_vs_onResize(t.target.$_vs_id,e,n)}}})})),{vscrollData:this.vscrollData,vscrollParent:this,vscrollResizeObserver:this.$_resizeObserver}},inheritAttrs:!1,props:{items:{type:Array,required:!0},dynamic:{type:Boolean,default:!1},keyField:{type:String,default:`id`},direction:{type:String,default:`vertical`,validator:e=>[`vertical`,`horizontal`].includes(e)},listTag:{type:String,default:`div`},itemTag:{type:String,default:`div`},minItemSize:{type:[Number,String]}},data(){return{vscrollData:{active:!0,sizes:{},keyField:this.keyField,simpleArray:!1}}},computed:{simpleArray(){return this.items.length&&typeof this.items[0]!=`object`},itemsWithSize(){let e=[],{items:t,keyField:n,simpleArray:r}=this,i=this.vscrollData.sizes,a=t.length;for(let o=0;o<a;o++){let a=t[o],s=r?o:a[n],c=i[s];c===void 0&&!this.$_undefinedMap[s]&&(c=0),e.push({item:a,[n]:s,size:c})}return e}},watch:{simpleArray:{handler(e){this.vscrollData.simpleArray=e},immediate:!0},itemsWithSize(t,n){let r=e.returnFirstEl(this.$el).scrollTop,i=0,a=0,o=Math.min(t.length,n.length);for(let e=0;e<o&&!(i>=r);e++)i+=n[e].size||this.minItemSize,a+=t[e].size||this.minItemSize;let s=a-i;s!==0&&(e.returnFirstEl(this.$el).scrollTop+=s)}},beforeCreate(){this.$_updates=[],this.$_undefinedSizes=0,this.$_undefinedMap={}},activated(){this.vscrollData.active=!0},deactivated(){this.vscrollData.active=!1},methods:{dynamicScrollerUpdateItems(){let e=this.$refs.scroller;e&&e._updateVisibleItems(!0)},dynamicScrollerUpdateItemsFromBottom(){let e=this.$refs.scroller;e&&e._updateVisibleItems(!1,!0)},scrollToItem(e){let t=this.$refs.scroller;t&&t.scrollToItem(e)},scrollToBottom(){if(this.$_scrollingToBottom)return;this.$_scrollingToBottom=!0;let t=e.returnFirstEl(this.$el);this.$nextTick(()=>{t.scrollTop=t.scrollHeight+5e3;let e=()=>{t.scrollTop=t.scrollHeight+5e3,requestAnimationFrame(()=>{t.scrollTop=t.scrollHeight+5e3,this.$_undefinedSizes===0?this.$_scrollingToBottom=!1:requestAnimationFrame(e)})};requestAnimationFrame(e)})}}};function a(e,t,r,i,a,o){let s=(0,n.resolveComponent)(`dt-scroller-item`),c=(0,n.resolveComponent)(`core-scroller`);return(0,n.openBlock)(),(0,n.createBlock)(c,(0,n.mergeProps)({ref:`scroller`,items:o.itemsWithSize,"min-item-size":r.minItemSize,direction:r.direction,"key-field":r.keyField,"list-tag":r.listTag,"item-tag":r.itemTag},e.$attrs),(0,n.createSlots)({default:(0,n.withCtx)(({item:t,index:r,active:i})=>[(0,n.createVNode)(s,{item:t,active:i,"size-dependencies":[t.message],"data-index":r},{default:(0,n.withCtx)(()=>[(0,n.renderSlot)(e.$slots,`default`,(0,n.normalizeProps)((0,n.guardReactiveProps)({item:t.item,index:r,active:i,itemWithSize:t})))]),_:2},1032,[`item`,`active`,`size-dependencies`,`data-index`])]),_:2},[e.$slots.before?{name:`before`,fn:(0,n.withCtx)(()=>[(0,n.renderSlot)(e.$slots,`before`)]),key:`0`}:void 0,e.$slots.empty?{name:`empty`,fn:(0,n.withCtx)(()=>[(0,n.renderSlot)(e.$slots,`empty`)]),key:`1`}:void 0,e.$slots.after?{name:`after`,fn:(0,n.withCtx)(()=>[(0,n.renderSlot)(e.$slots,`after`)]),key:`2`}:void 0]),1040,[`items`,`min-item-size`,`direction`,`key-field`,`list-tag`,`item-tag`])}var o=t.t(i,[[`render`,a]]),s=Object.assign({name:`DtScroller`},{__name:`Scroller`,props:{buffer:{type:Number,default:200},direction:{type:String,default:`vertical`,validator:e=>[`vertical`,`horizontal`].includes(e)},dynamic:{type:Boolean,default:!1},itemSize:{type:Number,default:null},itemTag:{type:String,default:`div`},items:{type:Array,required:!0},keyField:{type:String,default:`id`},listTag:{type:String,default:`div`},minItemSize:{type:[Number,String],default:null},scrollerHeight:{type:[String,Number],default:`100%`},scrollerWidth:{type:[String,Number],default:`100%`}},emits:[`user-position`,`scroll-start`,`scroll-end`],setup(e,{expose:t,emit:i}){let a=e;(0,n.provide)(`emit`,i);let s=(0,n.ref)(null),c=(0,n.computed)(()=>({width:typeof a.scrollerWidth==`number`?`${a.scrollerWidth}px`:a.scrollerWidth,height:typeof a.scrollerHeight==`number`?`${a.scrollerHeight}px`:a.scrollerHeight}));(0,n.watch)(a,()=>{p()},{deep:!0,immediate:!0});function l(){s.value&&s.value.scrollToBottom()}function u(e){s.value&&s.value.scrollToItem(e)}function d(){s.value&&(a.dynamic?s.value.dynamicScrollerUpdateItems():s.value._updateVisibleItems(!0))}function f(){s.value&&(a.dynamic?s.value.dynamicScrollerUpdateItemsFromBottom():s.value._updateVisibleItems(!1,!0))}function p(){a.dynamic&&!a.minItemSize&&console.error(`scroller error: 'minItemSize' is required on 'dynamic' mode.`),!a.dynamic&&!a.itemSize&&console.error(`scroller error: 'itemSize' is required.`)}return t({scrollToBottom:l,scrollToItem:u,updateItems:d,updateItemsFromBottom:f}),(t,i)=>((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.dynamic?o:r),{ref_key:`scroller`,ref:s,"data-qa":`dt-scroller`,items:e.items,"item-size":e.itemSize,"min-item-size":e.minItemSize,buffer:e.buffer,direction:e.direction,"key-field":e.keyField,"list-tag":e.listTag,"item-tag":e.itemTag,style:(0,n.normalizeStyle)(c.value),tabindex:`0`,onUserPosition:i[0]||(i[0]=e=>t.$emit(`user-position`,e)),onScrollStart:i[1]||(i[1]=e=>t.$emit(`scroll-start`)),onScrollEnd:i[2]||(i[2]=e=>t.$emit(`scroll-end`))},(0,n.createSlots)({default:(0,n.withCtx)(({item:e,index:r,active:i})=>[(0,n.renderSlot)(t.$slots,`default`,(0,n.normalizeProps)((0,n.guardReactiveProps)({item:e,index:r,active:i})))]),_:2},[t.$slots.before?{name:`before`,fn:(0,n.withCtx)(()=>[(0,n.renderSlot)(t.$slots,`before`)]),key:`0`}:void 0,t.$slots.empty?{name:`empty`,fn:(0,n.withCtx)(()=>[(0,n.renderSlot)(t.$slots,`empty`)]),key:`1`}:void 0,t.$slots.after?{name:`after`,fn:(0,n.withCtx)(()=>[(0,n.renderSlot)(t.$slots,`after`)]),key:`2`}:void 0]),1064,[`items`,`item-size`,`min-item-size`,`buffer`,`direction`,`key-field`,`list-tag`,`item-tag`,`style`]))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return s}});
|
|
2
|
-
//# sourceMappingURL=Scroller-Bt8TUghI.cjs.map
|
package/dist/Slider-CfvbLBv5.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
require(`./chunk-Bmb41Sf3.cjs`);const e=require(`./common/utils/index.cjs`),t=require(`./lib/text/text-constants.cjs`),n=require(`./lib/text/text.cjs`),r=require(`./floating-ui.dom-DF2uE3n8.cjs`),i=require(`./lib/slider/utils.cjs`);let a=require(`vue`);var o=[`horizontal`,`vertical`],s=[`always`,`never`,`tooltip`],c=[`start`,`end`],l=10,u=32,d=0;function f(e,{isRange:t,hasAccessibleName:n}){process.env.NODE_ENV!==`production`&&((0,a.watch)(()=>t.value&&!e.getValueText,e=>{e&&console.info(`[Dialtone] DtSlider in range mode: provide getValueText to give each thumb a distinct screen-reader description.`)},{immediate:!0}),(0,a.watch)(()=>n.value,e=>{e||console.info(`[Dialtone] DtSlider: provide a label prop (set showLabel to false to hide it visually) or aria-label for accessibility.`)},{immediate:!0}),(0,a.watch)(()=>e.minGapSteps!==Math.round(e.minGapSteps),t=>{t&&console.info(`[Dialtone] DtSlider: minGapSteps (${e.minGapSteps}) is not a whole number — it will be rounded to ${Math.round(e.minGapSteps)}.`)},{immediate:!0}),(0,a.watch)(()=>e.min>e.max,t=>{t&&console.info(`[Dialtone] DtSlider: min (${e.min}) is greater than max (${e.max}) — every value will collapse to max.`)},{immediate:!0}))}function p(e){let t=(0,a.ref)(!1);function n(){t.value=!!e.value&&getComputedStyle(e.value).direction===`rtl`}let r=null;return(0,a.onMounted)(()=>{if(n(),typeof MutationObserver<`u`&&e.value){r=new MutationObserver(n);let t={attributes:!0,attributeFilter:[`dir`,`style`,`class`]};for(let n=e.value;n;n=n.parentElement)r.observe(n,t);r.observe(document.documentElement,t)}}),(0,a.onBeforeUnmount)(()=>{r?.disconnect()}),{isRtl:t}}function m(e,t,{isRange:n,activeSnapValue:r}){function i(e,t){return r?.value[e]===t}function o(e){let t=String(e),n=t.search(/e/i);if(n!==-1){let e=t.slice(0,n),r=parseInt(t.slice(n+1),10),i=e.indexOf(`.`),a=i===-1?0:e.length-i-1;return Math.max(0,a-r)}let r=t.indexOf(`.`);return r===-1?0:t.length-r-1}function s(t){return Math.min(e.max,Math.max(e.min,t))}function c(t){if(e.step<=0)return Math.min(e.max,Math.max(e.min,t));let n=Math.round((t-e.min)/e.step),r=Math.max(o(e.min),o(e.step));return Math.min(e.max,Math.max(e.min,parseFloat((e.min+n*e.step).toFixed(r))))}function l(e){return e.length===2&&e[0]>e[1]?[e[1],e[0]]:e}function u(t,n=null){if(t.length!==2)return t;let r=Math.round(e.minGapSteps)*e.step;if(r<=0)return t;let[i,a]=t;if(a-i>=r)return t;n===0?a=Math.min(e.max,i+r):n===1?i=Math.max(e.min,a-r):i+r<=e.max?a=i+r:a-r>=e.min?i=a-r:(a=e.max,i=Math.max(e.min,a-r));let s=Math.max(o(e.min),o(e.max),o(e.step),n===null?0:o(t[n]));return n!==0&&(i=Math.min(e.max,Math.max(e.min,parseFloat(i.toFixed(s))))),n!==1&&(a=Math.min(e.max,Math.max(e.min,parseFloat(a.toFixed(s))))),[i,a]}function d(e,t=null){let n=e.map((e,n)=>n===t||Number.isFinite(e)?e:f());return n=n.map((e,n)=>n===t?e:s(e)),n=n.map((e,n)=>n===t?e:c(e)),n=n.length===2&&t===null?l(n):n,u(n,t)}function f(){return(e.min+e.max)/2}function p(e,t=null){let n;return n=Array.isArray(e)?e.length>=2?[e[0],e[1]]:e.length===1?[e[0]]:[f()]:e==null?[f()]:[e],d(n,t)}let m=(0,a.ref)(p(e.modelValue)),h=(0,a.ref)([...m.value]),g=(0,a.computed)(()=>n.value?[...m.value]:m.value[0]);function _(t){return e.max===e.min?0:(t-e.min)/(e.max-e.min)*100}function v(t,n){if(e.step<=0)return t;let r=(t-e.min)/e.step,i=n?Math.ceil(r-1e-9):Math.floor(r+1e-9);return e.min+i*e.step}function y(t){if(!n.value||t!==1||m.value.length<2)return e.min;let r=Math.round(e.minGapSteps)*e.step,i=Math.min(e.max,m.value[0]+r);return Math.min(e.max,v(i,!0))}function b(t){if(!n.value||t!==0||m.value.length<2)return e.max;let r=Math.round(e.minGapSteps)*e.step,i=Math.max(e.min,m.value[1]-r);return Math.max(e.min,v(i,!1))}function x(t){if(e.step<=0)return`any`;let n=m.value[t];if(n===void 0)return e.step;let r=(n-e.min)/e.step;return Math.abs(r-Math.round(r))>1e-9?`any`:e.step}let S=!1;function C(e){process.env.NODE_ENV===`production`||S||(S=!0,console.info(`[Dialtone] DtSlider: ${e}`))}function w(t,n){if(e.getValueText)try{let r=e.getValueText(t,n);if(typeof r==`string`)return r;C(`getValueText must return a string synchronously (got ${typeof r}) — falling back to the raw value.`)}catch(e){C(`getValueText threw — falling back to the raw value. ${e}`)}return`${e.prefix}${t}${e.suffix}`}return(0,a.watch)(()=>e.modelValue,e=>{if(e==null)return;let n=m.value,r=Array.isArray(e)?e:[e],a=n.findIndex((e,t)=>r[t]===e&&i(t,e)),o=p(e,a===-1?null:a);if(o.length!==n.length||o.some((e,t)=>e!==n[t])){let e=n.length!==h.value.length||n.some((e,t)=>e!==h.value[t]);m.value=o,e||(h.value=[...o])}(o.length!==r.length||o.some((e,t)=>e!==r[t]))&&t(`update:modelValue`,Array.isArray(e)?[...o]:o[0])},{deep:!0}),(0,a.watch)(()=>[e.min,e.max,e.step,e.minGapSteps],()=>{let r=m.value,a=r.length!==h.value.length||r.some((e,t)=>e!==h.value[t]),o=r.findIndex((t,n)=>i(n,t)&&t>=e.min&&t<=e.max),s=d(r,o===-1?null:o);if(s.length!==r.length||s.some((e,t)=>e!==r[t])){m.value=s;let e=n.value?[...s]:s[0];if(t(`update:modelValue`,e),a)return;h.value=[...s],t(`change`,e)}}),(0,a.onMounted)(()=>{if(e.modelValue===void 0||e.modelValue===null)return;let n=Array.isArray(e.modelValue)?e.modelValue:[e.modelValue],r=m.value;(r.length!==n.length||r.some((e,t)=>e!==n[t]))&&t(`update:modelValue`,Array.isArray(e.modelValue)?[...r]:r[0])}),{internalValues:m,lastCommittedValues:h,currentValue:g,decimalPlaces:o,snapToStep:c,thumbPercent:_,thumbNativeMin:y,thumbNativeMax:b,thumbNativeStep:x,formatValue:w}}var h=10,g=2;function _(e,{controlRef:t,isVertical:n}){let r=(0,a.computed)(()=>{if(e.snapPoints==null)return[];if(typeof e.snapPoints==`number`){let t=e.snapPoints;return!Number.isFinite(t)||t<=0?[]:i.generateInterval(e.min,e.max,t,`snapPoints`)}return Array.isArray(e.snapPoints)?e.snapPoints.filter(t=>Number.isFinite(t)&&t>=e.min&&t<=e.max):[]}),o=(0,a.ref)({});function s(i,a){let s=r.value;if(!s.length||!t.value)return delete o.value[a],null;let c=t.value.getBoundingClientRect(),l=n.value?c.height:c.width;if(!l)return null;let u=h/l*(e.max-e.min),d=o.value[a];if(d!=null&&s.includes(d)){let e=u*g;if(Math.abs(d-i)<=e)return d}let f=null,p=1/0;for(let e of s){let t=Math.abs(e-i);t<=u&&t<p&&(f=e,p=t)}return f==null?delete o.value[a]:o.value[a]=f,f}return{activeSnapValue:o,findMagneticSnapPoint:s}}var v=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`,`PageUp`,`PageDown`]);function y(e,t,{controlRef:n,thumbRefs:r,internalValues:o,isRange:s,isVertical:c,decimalPlaces:l,snapToStep:u,lastCommittedValues:d,findMagneticSnapPoint:f,activeSnapValue:p,isRtl:m}){let h=(0,a.ref)(!1),g=(0,a.ref)(null),_=(0,a.ref)(null),y=(0,a.ref)(null),b=(0,a.ref)(null),x=(0,a.ref)(null),S=!1,C=null,w=!1;(0,a.watch)(()=>e.disabled,e=>{e&&(y.value=null,b.value=null)}),(0,a.watch)(()=>o.value.length,(e,t)=>{let n=y.value===1||document.activeElement===r.value[1];e===1&&t===2&&n&&(0,a.nextTick)(()=>r.value[0]?.focus()),g.value!==null&&g.value>=e&&(g.value=null)});function T(n,i,{allowSnap:a=!1}={}){let c=Math.min(e.max,Math.max(e.min,i)),d=a?f(c,n):null;c=d??u(c);let m=[...o.value];if(s.value){let t=Math.max(0,Math.round(e.minGapSteps)*e.step);if(c=n===0?Math.min(c,(m[1]??e.max)-t):Math.max(c,(m[0]??e.min)+t),!(d!=null&&c===d)){let t=Math.max(l(e.min),l(e.step));c=parseFloat(c.toFixed(t)),c=Math.min(e.max,Math.max(e.min,c))}d!=null&&c!==d&&delete p.value[n]}if(m[n]===c){let e=r.value[n];e&&e.value!==String(c)&&(e.value=String(c));return}m[n]=c,o.value=m,t(`update:modelValue`,s.value?[...m]:m[0])}function E(){let e=o.value,n=d.value;(e.length!==n.length||e.some((e,t)=>e!==n[t]))&&(d.value=[...e],t(`change`,s.value?[...e]:e[0]))}let D=0;function O(t){let r=n.value.getBoundingClientRect(),i=c.value?r.height:r.width,a=i-2*D,o;if(c.value){let e=r.bottom-t.clientY;o=a>0?(e-D)/a:e/i}else{let e=t.clientX-r.left;o=a>0?(e-D)/a:e/i,m.value&&(o=1-o)}return o=Math.min(1,Math.max(0,o)),e.min+o*(e.max-e.min)}function k(e){if(!s.value||o.value.length<2)return 0;let[t,n]=o.value;return t===n?_.value===0?1:0:Math.abs(e-t)<=Math.abs(e-n)?0:1}function A(e,t){if(!s.value)return e;let[n,r]=o.value;return n===r?e===0&&t>n?1:e===1&&t<r?0:e:e}function j(t){if(e.disabled||t.pointerType===`mouse`&&t.button!==0||h.value&&t.pointerId!==C)return;t.preventDefault(),D=i.measureEdgeInsetPx(n.value);let a=O(t),c=k(a),[l,u]=o.value;w=s.value&&o.value.length===2&&l===u,x.value===c&&(x.value=null),g.value=c,_.value=c,h.value=!0,C=t.pointerId,n.value.setPointerCapture(t.pointerId),b.value=null,T(c,a,{allowSnap:!0});let d=r.value[c];d&&document.activeElement!==d?(S=!0,d.focus()):y.value===c&&(y.value=null)}function M(t){if(!h.value||g.value===null||t.pointerId!==C)return;if(e.disabled){P();return}if(t.buttons===0){P();return}let n=O(t),r=w?A(g.value,n):g.value;r!==g.value&&(delete p.value[g.value],x.value===r&&(x.value=null),g.value=r,_.value=r),T(r,n,{allowSnap:!0})}function N(t){if(e.step<=0)return!1;let n=(t-e.min)/e.step;return Math.abs(n-Math.round(n))>1e-9}function P(e){if(!h.value||e&&e.pointerId!==C)return;h.value=!1,C=null;let t=g.value;t!==null&&N(o.value[t])&&T(t,o.value[t]),E(),g.value=null,p.value={}}function F(e,t){T(e,Number(t.target.value))}function I(e,t,n,r){return e===`PageUp`?1:e===`PageDown`?-1:t?e===`ArrowUp`||e===n?1:e===`ArrowDown`||e===r?-1:0:0}function L(){return e.step<=0?e.largeStep:Math.max(1,Math.round(e.largeStep/e.step))*e.step}function R(e,t){y.value!==e&&(y.value=e);let n=m.value,r=n?`ArrowLeft`:`ArrowRight`,i=n?`ArrowRight`:`ArrowLeft`,a=I(t.key,t.shiftKey,r,i);a!==0&&(t.preventDefault(),T(e,o.value[e]+a*L())),t.key===`Escape`?x.value=e:v.has(t.key)&&x.value===e&&(x.value=null)}function z(e,n){S?S=!1:(x.value===e&&(x.value=null),y.value=e),t(`focus`,n)}function B(e,n){y.value=null,E(),t(`blur`,n)}function ee(e){x.value===e&&(x.value=null),b.value=e}function te(e){b.value===e&&(b.value=null)}function V(t){return e.readout===`always`?!0:x.value===t?!1:g.value===t||y.value===t||b.value===t}return{isDragging:h,activeThumbIndex:g,focusedThumbIndex:y,hoveredThumbIndex:b,updateThumbValue:T,commitIfChanged:E,onPointerDown:j,onPointerMove:M,onPointerUp:P,onThumbInput:F,onThumbKeydown:R,onThumbFocus:z,onThumbBlur:B,onThumbHitPointerEnter:ee,onThumbHitPointerLeave:te,isReadoutOpen:V}}function b(e,{isVertical:t,isRange:n,internalValues:r,thumbPercent:i,isRtl:o,markEdgeOffsetPx:s,formatValue:c}){function l(e,n){let r=t.value?{bottom:`${e}%`}:{insetInlineStart:`${e}%`};return n&&(r.transform=n),r}function u(){return o.value?`50%`:`-50%`}let d=`var(--slider-edge-inset)`,f=`calc(${d} + (100% - ${d} * 2) * `;function p(e){return`${f}${e/100})`}function m(e){return`calc((100% - ${d} * 2) * ${e/100})`}function h(e,{verticalTransform:n,horizontalTransform:r}){let a=i(e);return t.value?{bottom:p(a),transform:n}:{insetInlineStart:p(a),transform:r}}function g(e){return h(e,{verticalTransform:`translate(${u()}, 50%)`,horizontalTransform:`translate(${u()}, -50%)`})}function _(e){return h(e,{verticalTransform:`translateY(50%)`,horizontalTransform:`translateX(${u()})`})}function v(e){let t=o.value?-1:1;return e===`start`?`translateX(${t}px)`:`translateX(calc(${o.value?`100%`:`-100%`} + ${-t}px))`}function y(e,n){let r=t.value?{bottom:p(e)}:{insetInlineStart:p(e)};return n&&(r.transform=n),r}function b(e,n,r){if(r&&!t.value)return l(e,v(r));let i=t.value?0:s.value[n];return i?y(e,`translateX(calc(${u()} + ${i}px))`):y(e)}function x(e,n,r){if(r&&!t.value)return l(e,v(r));let i=t.value?0:n;return i?y(e,`translateX(calc(${u()} + ${i}px))`):y(e)}return{thumbPositionStyle:g,tickPositionStyle:_,markStyle:b,readoutStyle:x,mergedReadoutPct:(0,a.computed)(()=>{if(!n.value||r.value.length!==2)return 0;let[e,t]=r.value;return(i(e)+i(t))/2}),mergedReadoutText:(0,a.computed)(()=>{if(!n.value||r.value.length!==2)return``;let[e,t]=r.value;return`${c(e,0)}–${c(t,1)}`}),indicatorStyle:(0,a.computed)(()=>{if(n.value&&r.value.length===2){let[e,n]=r.value,a=i(e),o=i(n);return t.value?{bottom:p(a),height:m(o-a)}:{insetInlineStart:p(a),width:m(o-a)}}let a=i(r.value[0]??e.min);if(typeof e.fillOrigin==`number`){let n=i(Math.min(e.max,Math.max(e.min,e.fillOrigin))),r=Math.min(a,n),o=Math.abs(a-n);return t.value?{bottom:p(r),height:m(o)}:{insetInlineStart:p(r),width:m(o)}}let o=e.fillOrigin===`end`;return t.value?o?{top:0,height:`calc(100% - ${p(a)})`}:{bottom:0,height:p(a)}:o?{insetInlineEnd:0,width:`calc(100% - ${p(a)})`}:{insetInlineStart:0,width:p(a)}})}}function x(e,{isVertical:t,thumbPercent:n}){let r=(0,a.computed)(()=>{let t=typeof e.showTicks==`number`?e.showTicks:e.step;return!t||t<=0?[]:i.generateInterval(e.min,e.max,t,`ticks`)});function o(t){return`${e.prefix}${t}${e.suffix}`}let s=(0,a.computed)(()=>{let t=e.showMarks===!0?[e.min,e.max]:e.showMarks;return Array.isArray(t)?t.filter(i.isValidMark).map(t=>{let r=typeof t==`number`?t:t.value,i=typeof t==`number`?o(t):t.text??o(r),a=r===e.min?`start`:r===e.max?`end`:null;return{text:i,pct:n(r),edge:a}}):[]});return{computedTickValues:r,computedMarks:s,reservesAnnotationSpace:(0,a.computed)(()=>!t.value&&(s.value.length>0||e.readout===`always`))}}function S(e,{controlRef:t,isVertical:n,isRange:r,internalValues:o,thumbPercent:s,isRtl:c,isReadoutOpen:l,computedMarks:u,formatValue:d}){let f=(0,a.ref)([]),p=(0,a.ref)([]),m=(0,a.ref)(null),h=(0,a.ref)([]),g=(0,a.ref)([]),_=(0,a.ref)(!1),v=(0,a.ref)([]),y=(0,a.ref)([]),b=(0,a.ref)(0);function x(e,t,n=0){return!(e.right+n<t.left||e.left-n>t.right||e.bottom+n<t.top||e.top-n>t.bottom)}let S=0,C=0;function w(e,r){if(!r||!t.value)return null;let a=r.getBoundingClientRect(),o=t.value.getBoundingClientRect(),s=C;if(n.value){let t=a.bottom-a.top,n=s+(o.bottom-o.top-2*s)*(e/100),r=o.bottom-n;return{left:a.left,right:a.right,top:r-t/2,bottom:r+t/2}}let l=a.right-a.left,u=s+(o.right-o.left-2*s)*(i.mirrorPct(e,c.value)/100),d=o.left+u;return{left:d-l/2,right:d+l/2,top:a.top,bottom:a.bottom}}function T(e){return p.value.find(t=>t&&Number(t.dataset.readoutIndex)===e)}function E(t,n){return e.readout===`tooltip`?h.value[n]?.getBoundingClientRect()??null:w(s(t),T(n))}async function D(){let n=++S;if(await(0,a.nextTick)(),n!==S)return;t.value&&(C=i.measureEdgeInsetPx(t.value));let c=_.value;if(e.readout!==`tooltip`&&r.value&&o.value.length===2&&l(0)&&l(1)){let[e,t]=o.value,n=w(s(e),T(0)),r=w(s(t),T(1));_.value=!!(n&&r&&x(n,r,4))}else _.value=!1;_.value!==c&&(await(0,a.nextTick)(),n!==S)||(j(),O())}function O(){let r=e.readout===`always`&&!!t.value&&!n.value,a=r?t.value.getBoundingClientRect():null;function s(e,t){if(!e||!r)return 0;let n=e.getBoundingClientRect();return i.edgeClampOffset(n.left-t,n.right-t,a,0)}function c(){let e=s(m.value,b.value);e!==b.value&&(b.value=e),y.value.some(Boolean)&&(y.value=o.value.map(()=>0))}function u(){b.value&&(b.value=0);let e=o.value.map((e,t)=>l(t)?s(T(t),y.value[t]||0):0);i.sameValues(e,y.value)||(y.value=e)}_.value?c():u()}function k(){let[e,t]=o.value;return(s(e)+s(t))/2}function A(){if(_.value){let e=w(k(),m.value);return e?[e]:[]}return o.value.map((e,t)=>l(t)?E(e,t):null).filter(Boolean)}function j(){let e=f.value;if(!e.length)return;let r=A(),a=u.value.map(()=>!1),o=u.value.map(()=>0),s=!!t.value&&!n.value,c=s?t.value.getBoundingClientRect():null;e.forEach(e=>{if(!e)return;let t=Number(e.dataset.markIndex),n=v.value[t]||0,l=e.getBoundingClientRect(),u=l.left-n,d=l.right-n,f=s?i.edgeClampOffset(u,d,c,32):0;if(o[t]=f,r.length){let e={top:l.top,bottom:l.bottom,left:u+f,right:d+f};a[t]=r.some(t=>x(e,t,4))}}),i.sameValues(a,g.value)||(g.value=a),i.sameValues(o,v.value)||(v.value=o)}let M=(0,a.computed)(()=>o.value.map((e,t)=>l(t))),N=(0,a.computed)(()=>o.value.map((e,t)=>d(e,t))),P=null;return(0,a.watch)([M,u,n,c],()=>D(),{deep:!0}),(0,a.watch)([o,N,()=>e.readoutClass],()=>{e.readout!==`tooltip`&&D()},{deep:!0}),(0,a.onMounted)(()=>{(0,a.nextTick)(D),typeof ResizeObserver<`u`&&t.value&&(P=new ResizeObserver(()=>{D()}),P.observe(t.value))}),(0,a.onBeforeUnmount)(()=>{P?.disconnect()}),{markElRefs:f,readoutElRefs:p,mergedReadoutElRef:m,tooltipElRefs:h,markCollisionHidden:g,readoutMerged:_,markEdgeOffsetPx:v,readoutEdgeOffsetPx:y,mergedReadoutEdgeOffsetPx:b,readoutVisibility:M,formattedValues:N,updateCollisions:D}}var C={visibilityProperty:!0,opacityProperty:!0,checkVisibilityCSS:!0,checkOpacity:!0};function w(e){if(e.checkVisibility)return e.checkVisibility(C);if(!e.getClientRects().length||getComputedStyle(e).visibility!==`visible`)return!1;for(let t=e;t;t=t.parentElement){let e=getComputedStyle(t);if(e.opacity===`0`||e.contentVisibility===`hidden`)return!1}return!0}function T(e,t){return e.left===t.left&&e.top===t.top&&e.right===t.right&&e.bottom===t.bottom}var E=(e,t,n)=>Math.min(n,Math.max(t,e));function D(e,{thumbVisualRefs:t,tooltipElRefs:n,isVertical:o,isRtl:s,readoutVisibility:c,formattedValues:l,onPosition:u}){let d=new Map;function f(t){return e.readout===`tooltip`&&!e.disabled&&c.value[t]}function p(e){let t=d.get(e);t&&(d.delete(e),t.cleanup?.(),t.tooltip.matches(`:popover-open`)&&t.tooltip.hidePopover())}function m(e,t,n){if(typeof n.showPopover!=`function`)return;let a=0,c=!0,l=null,m=null,h,g={anchor:t,tooltip:n,update:b,cleanup:null},_=()=>d.get(e)===g;function v(){return c||!w(t)?`hidden`:`visible`}function y(){n.style.visibility=`hidden`,n.showPopover()}async function b(){if(!_())return;if(!n.matches(`:popover-open`)){if(!f(e)||!t.isConnected||!n.isConnected||!w(t)){p(e);return}y()}let d=++a,h=t.getBoundingClientRect();l=h;let g=parseFloat(getComputedStyle(n).paddingBlockStart)||0,b={boundary:[],padding:g*2},x=n.firstElementChild,S=()=>_()&&d===a,C=await r.i(t,n,{strategy:`fixed`,placement:o.value?s.value?`left`:`right`:`top`,middleware:[r.c(g),r.a(b),r.l(b),r.u({...b,apply({availableWidth:e,availableHeight:t}){S()&&(x.style.maxInlineSize=`${Math.max(0,e-g*2)}px`,x.style.maxBlockSize=`${Math.max(0,t-g*2)}px`)}}),r.o()]});if(!S())return;let T=n.offsetWidth,D=n.offsetHeight,O=C.placement;c=C.middlewareData.hide?.referenceHidden;let k=v();n.dataset.side=O,Object.assign(n.style,{left:`${C.x}px`,top:`${C.y}px`,visibility:k}),O===`top`||O===`bottom`?n.style.setProperty(`--slider-tooltip-arrow-x`,`${E(h.left+h.width/2-C.x,g,T-g)}px`):n.style.setProperty(`--slider-tooltip-arrow-y`,`${E(h.top+h.height/2-C.y,g,D-g)}px`);let A=[C.x,C.y,T,D,O,k];(!m||!i.sameValues(A,m))&&(m=A,u())}function x(){!n.matches(`:popover-open`)||!l||!T(t.getBoundingClientRect(),l)?b():n.style.visibility=v(),_()&&(h=requestAnimationFrame(x))}d.set(e,g),y();let S=r.r(t,n,b,{layoutShift:!1});x(),g.cleanup=()=>{S(),cancelAnimationFrame(h)}}function h(){for(let[e,r]of d)(!f(e)||t.value[e]!==r.anchor||n.value[e]!==r.tooltip)&&p(e);c.value.forEach((e,r)=>{let i=t.value[r],a=n.value[r];!i||!a||!f(r)||(d.has(r)?d.get(r).update():m(r,i,a))})}(0,a.watch)([()=>e.readout,()=>e.disabled,o,s,l,c],h,{flush:`post`}),(0,a.onMounted)(h),(0,a.onBeforeUnmount)(()=>{for(let e of d.keys())p(e)})}var O=[`data-disabled`,`data-orientation`,`data-dragging`],k=[`onPointerenter`,`onPointerleave`],A=[`min`,`max`,`step`,`value`,`disabled`,`name`,`aria-labelledby`,`aria-label`,`aria-describedby`,`aria-errormessage`,`aria-details`,`aria-invalid`,`aria-valuetext`,`aria-orientation`,`onInput`,`onKeydown`,`onFocus`,`onBlur`],j=[`data-mark-index`],M=[`data-readout-index`],N={class:`d-slider__tooltip-content`},P=(0,a.defineComponent)({name:`DtSlider`,inheritAttrs:!1,__name:`Slider`,props:{modelValue:{type:[Number,Array],default:void 0,validator:e=>!Array.isArray(e)||e.length===2},min:{type:Number,default:0,validator:Number.isFinite},max:{type:Number,default:100,validator:Number.isFinite},step:{type:Number,default:1,validator:Number.isFinite},snapPoints:{type:[Number,Array],default:void 0,validator:e=>Number.isFinite(e)||Array.isArray(e)&&e.every(Number.isFinite)},disabled:{type:Boolean,default:!1},orientation:{type:String,default:`horizontal`,validator:e=>o.includes(e)},fillOrigin:{type:[Number,String],default:`start`,validator:e=>typeof e==`number`||c.includes(e)},showTicks:{type:[Boolean,Number],default:!1},minGapSteps:{type:Number,default:0},label:{type:String,default:``},showLabel:{type:Boolean,default:!0},labelSize:{type:[String,Number],default:null,validator:e=>t.TEXT_SIZE_MODIFIERS.label.includes(String(e))},labelStrength:{type:String,default:null,validator:e=>Object.keys(t.TEXT_STRENGTH_MODIFIERS).includes(e)},getValueText:{type:Function,default:null},prefix:{type:String,default:``},suffix:{type:String,default:``},name:{type:String,default:``},largeStep:{type:Number,default:10},bodyClass:{type:[String,Array,Object],default:``},labelClass:{type:[String,Array,Object],default:``},startClass:{type:[String,Array,Object],default:``},endClass:{type:[String,Array,Object],default:``},readout:{type:String,default:`tooltip`,validator:e=>s.includes(e)},readoutClass:{type:[String,Array,Object],default:``},showMarks:{type:[Array,Boolean],default:!1,validator:e=>typeof e==`boolean`||Array.isArray(e)&&e.every(i.isValidMark)}},emits:[`update:modelValue`,`change`,`focus`,`blur`],setup(t,{expose:r,emit:i}){let o=t,s=i,c=(0,a.useSlots)(),l=(0,a.useAttrs)(),u=`slider-label-${e.getUniqueString()}`,d=(0,a.ref)(null),h=(0,a.ref)([]),g=(0,a.ref)([]),v=(0,a.computed)(()=>Array.isArray(o.modelValue)),C=(0,a.computed)(()=>o.orientation===`vertical`),{isRtl:w}=p(d),{activeSnapValue:T,findMagneticSnapPoint:E}=_(o,{controlRef:d,isVertical:C}),{internalValues:P,lastCommittedValues:F,currentValue:I,decimalPlaces:L,snapToStep:R,thumbPercent:z,thumbNativeMin:B,thumbNativeMax:ee,thumbNativeStep:te,formatValue:V}=m(o,s,{isRange:v,activeSnapValue:T});function H(e){return e.some(e=>{if(typeof e==`string`)return e.trim()!==``;if(e.type===a.Comment)return!1;if(typeof e.children==`string`)return e.children.trim()!==``;if(Array.isArray(e.children))return H(e.children);if(e.children&&typeof e.children.default==`function`){let t=e.children.default();return H(Array.isArray(t)?t:[t])}return!1})}let ne=(0,a.computed)(()=>c.label?H(c.label({value:I.value})):!!o.label?.trim()),U=(0,a.computed)(()=>o.showLabel&&ne.value),W=(0,a.computed)(()=>U.value?u:l[`aria-labelledby`]),G=(0,a.computed)(()=>{if(!U.value)return!o.showLabel&&o.label?o.label:l[`aria-label`]}),re=(0,a.computed)(()=>U.value||!!(String(G.value??``).trim()||String(W.value??``).trim())),ie=(0,a.computed)(()=>o.labelSize??300),ae=[`aria-label`,`aria-labelledby`,`aria-describedby`,`aria-errormessage`,`aria-details`,`aria-invalid`],oe=(0,a.computed)(()=>{let t=e.removeClassStyleAttrs(l);return Object.fromEntries(Object.entries(t).filter(([e])=>!ae.includes(e)))}),{isDragging:K,activeThumbIndex:se,focusedThumbIndex:ce,onPointerDown:q,onPointerMove:J,onPointerUp:Y,onThumbInput:le,onThumbKeydown:ue,onThumbFocus:de,onThumbBlur:fe,onThumbHitPointerEnter:pe,onThumbHitPointerLeave:me,isReadoutOpen:he}=y(o,s,{controlRef:d,thumbRefs:h,internalValues:P,isRange:v,isVertical:C,decimalPlaces:L,snapToStep:R,lastCommittedValues:F,findMagneticSnapPoint:E,activeSnapValue:T,isRtl:w}),{computedTickValues:ge,computedMarks:X,reservesAnnotationSpace:_e}=x(o,{isVertical:C,thumbPercent:z}),{markElRefs:ve,readoutElRefs:ye,mergedReadoutElRef:be,tooltipElRefs:Z,markCollisionHidden:xe,readoutMerged:Q,markEdgeOffsetPx:Se,readoutEdgeOffsetPx:Ce,mergedReadoutEdgeOffsetPx:we,readoutVisibility:Te,formattedValues:Ee,updateCollisions:De}=S(o,{controlRef:d,isVertical:C,isRange:v,internalValues:P,thumbPercent:z,isRtl:w,isReadoutOpen:he,computedMarks:X,formatValue:V}),{thumbPositionStyle:$,tickPositionStyle:Oe,markStyle:ke,readoutStyle:Ae,mergedReadoutPct:je,mergedReadoutText:Me,indicatorStyle:Ne}=b(o,{isVertical:C,isRange:v,internalValues:P,thumbPercent:z,isRtl:w,markEdgeOffsetPx:Se,formatValue:V});function Pe(e){return e===o.min?`start`:e===o.max?`end`:null}D(o,{thumbVisualRefs:g,tooltipElRefs:Z,isVertical:C,isRtl:w,readoutVisibility:Te,formattedValues:Ee,onPosition:De}),f(o,{isRange:v,hasAccessibleName:re});function Fe(){h.value[0]?.focus()}function Ie(){h.value.find(e=>e===document.activeElement)?.blur()}return r({focus:Fe,blur:Ie}),(r,i)=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,(0,a.mergeProps)(oe.value,{class:[`d-slider`,r.$attrs.class,{"d-slider--disabled":t.disabled,"d-slider--vertical":C.value,"d-slider--inverted":t.fillOrigin===`end`,"d-slider--dragging":(0,a.unref)(K)}],style:r.$attrs.style,"data-disabled":t.disabled||void 0,"data-orientation":t.orientation,"data-dragging":(0,a.unref)(K)||void 0,"data-qa":`dt-slider`}),[t.showLabel?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:0,id:u,class:(0,a.normalizeClass)([`d-slider__label`,t.labelClass]),"data-qa":`dt-slider-label`},[(0,a.renderSlot)(r.$slots,`label`,{value:(0,a.unref)(I)},()=>[t.label?((0,a.openBlock)(),(0,a.createBlock)((0,a.unref)(n.default),{key:0,kind:`label`,size:ie.value,strength:t.labelStrength,tone:t.disabled?`disabled`:`secondary`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(t.label),1)]),_:1},8,[`size`,`strength`,`tone`])):(0,a.createCommentVNode)(``,!0)])],2)):(0,a.createCommentVNode)(``,!0),(0,a.createElementVNode)(`div`,{class:(0,a.normalizeClass)([`d-slider__body`,t.bodyClass,{"d-slider__body--reserve-annotation-space":(0,a.unref)(_e)}]),"data-qa":`dt-slider-body`},[(0,a.unref)(e.hasSlotContent)(r.$slots.start)?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:0,class:(0,a.normalizeClass)([`d-slider__start`,t.startClass]),"data-qa":`dt-slider-start`},[(0,a.renderSlot)(r.$slots,`start`)],2)):(0,a.createCommentVNode)(``,!0),(0,a.createElementVNode)(`div`,{ref_key:`controlRef`,ref:d,class:`d-slider__control`,style:(0,a.normalizeStyle)(C.value?{touchAction:`pan-x`}:{touchAction:`pan-y`}),"data-qa":`dt-slider-control`,onPointerdown:i[0]||(i[0]=(...e)=>(0,a.unref)(q)&&(0,a.unref)(q)(...e)),onPointermove:i[1]||(i[1]=(...e)=>(0,a.unref)(J)&&(0,a.unref)(J)(...e)),onPointerup:i[2]||(i[2]=(...e)=>(0,a.unref)(Y)&&(0,a.unref)(Y)(...e)),onPointercancel:i[3]||(i[3]=(...e)=>(0,a.unref)(Y)&&(0,a.unref)(Y)(...e))},[i[4]||(i[4]=(0,a.createElementVNode)(`div`,{class:`d-slider__track`,"data-qa":`dt-slider-track`},null,-1)),(0,a.createElementVNode)(`div`,{class:`d-slider__indicator`,style:(0,a.normalizeStyle)((0,a.unref)(Ne)),"data-qa":`dt-slider-indicator`},null,4),t.showTicks?((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,{key:0},(0,a.renderList)((0,a.unref)(ge),(e,t)=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:t,class:`d-slider__tick`,style:(0,a.normalizeStyle)((0,a.unref)(Oe)(e)),"data-qa":`dt-slider-tick`},null,4))),128)):(0,a.createCommentVNode)(``,!0),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)((0,a.unref)(P),(e,t)=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:`thumb-visual-${t}`,ref_for:!0,ref:e=>{g.value[t]=e},class:(0,a.normalizeClass)([`d-slider__thumb-visual`,{"d-slider__thumb-visual--focused":(0,a.unref)(ce)===t,"d-slider__thumb-visual--active":(0,a.unref)(se)===t}]),style:(0,a.normalizeStyle)((0,a.unref)($)(e)),"data-qa":`dt-slider-thumb-visual`},null,6))),128)),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)((0,a.unref)(P),(e,t)=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:`thumb-hit-${t}`,class:`d-slider__thumb-hit`,style:(0,a.normalizeStyle)({...(0,a.unref)($)(e),touchAction:C.value?`pan-x`:`pan-y`}),"data-qa":`dt-slider-thumb-hit`,onPointerenter:e=>(0,a.unref)(pe)(t),onPointerleave:e=>(0,a.unref)(me)(t)},null,44,k))),128)),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)((0,a.unref)(P),(e,n)=>((0,a.openBlock)(),(0,a.createElementBlock)(`input`,{key:`thumb-input-${n}`,ref_for:!0,ref:e=>{h.value[n]=e},type:`range`,class:`d-slider__thumb`,min:(0,a.unref)(B)(n),max:(0,a.unref)(ee)(n),step:(0,a.unref)(te)(n),value:e,disabled:t.disabled,name:t.name||void 0,"aria-labelledby":W.value,"aria-label":G.value,"aria-describedby":(0,a.unref)(l)[`aria-describedby`],"aria-errormessage":(0,a.unref)(l)[`aria-errormessage`],"aria-details":(0,a.unref)(l)[`aria-details`],"aria-invalid":(0,a.unref)(l)[`aria-invalid`],"aria-valuetext":(0,a.unref)(V)(e,n),"aria-orientation":C.value?`vertical`:void 0,"data-qa":`dt-slider-thumb`,onInput:e=>(0,a.unref)(le)(n,e),onKeydown:e=>(0,a.unref)(ue)(n,e),onFocus:e=>(0,a.unref)(de)(n,e),onBlur:e=>(0,a.unref)(fe)(n,e)},null,40,A))),128)),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)((0,a.unref)(X),(e,t)=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:`mark-${t}`,ref_for:!0,ref_key:`markElRefs`,ref:ve,class:(0,a.normalizeClass)([`d-slider__mark`,{"d-slider__mark--collision-hidden":(0,a.unref)(xe)[t]}]),style:(0,a.normalizeStyle)((0,a.unref)(ke)(e.pct,t,e.edge)),"data-mark-index":t,"data-qa":`dt-slider-mark`},(0,a.toDisplayString)(e.text),15,j))),128)),t.readout===`always`?((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,{key:1},[((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)((0,a.unref)(P),(e,n)=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:`readout-${n}`,ref_for:!0,ref_key:`readoutElRefs`,ref:ye,class:(0,a.normalizeClass)([`d-slider__readout`,(0,a.unref)(Q)?`d-slider__readout--hide`:`d-slider__readout--show`,t.readoutClass]),style:(0,a.normalizeStyle)((0,a.unref)(Ae)((0,a.unref)(z)(e),(0,a.unref)(Ce)[n],Pe(e))),"data-readout-index":n,"aria-hidden":`true`,"data-qa":`dt-slider-thumb-readout`},(0,a.toDisplayString)((0,a.unref)(V)(e,n)),15,M))),128)),(0,a.unref)(Q)?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:0,ref_key:`mergedReadoutElRef`,ref:be,class:(0,a.normalizeClass)([`d-slider__readout`,`d-slider__readout--show`,t.readoutClass]),style:(0,a.normalizeStyle)((0,a.unref)(Ae)((0,a.unref)(je),(0,a.unref)(we))),"aria-hidden":`true`,"data-qa":`dt-slider-thumb-readout-merged`},(0,a.toDisplayString)((0,a.unref)(Me)),7)):(0,a.createCommentVNode)(``,!0)],64)):(0,a.createCommentVNode)(``,!0),t.readout===`tooltip`?((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,{key:2},(0,a.renderList)((0,a.unref)(P),(e,t)=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:`readout-tooltip-${t}`,ref_for:!0,ref:e=>{(0,a.unref)(Z)[t]=e},class:`d-tooltip d-slider__readout-tooltip`,popover:`manual`,inert:``,"aria-hidden":`true`,"data-qa":`dt-slider-thumb-readout-tooltip`},[(0,a.createElementVNode)(`span`,N,(0,a.toDisplayString)((0,a.unref)(V)(e,t)),1)]))),128)):(0,a.createCommentVNode)(``,!0)],36),(0,a.unref)(e.hasSlotContent)(r.$slots.end)?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:1,class:(0,a.normalizeClass)([`d-slider__end`,t.endClass]),"data-qa":`dt-slider-end`},[(0,a.renderSlot)(r.$slots,`end`)],2)):(0,a.createCommentVNode)(``,!0)],2)],16,O))}});Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return P}});
|
|
2
|
-
//# sourceMappingURL=Slider-CfvbLBv5.cjs.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
require(`./chunk-Bmb41Sf3.cjs`);const e=require(`./common/utils/index.cjs`),t=require(`./lib/text-list/text-list-constants.cjs`),n=require(`./lib/text-list/validators.cjs`);let r=require(`vue`);var i=[`value`],a=(0,r.defineComponent)({name:`DtTextListItem`,__name:`TextListItem`,props:{value:{type:Number,default:void 0},markerTone:{type:String,default:void 0,validator:n.textListMarkerToneValidator},markerClass:{type:[String,Array,Object],default:``},contentClass:{type:[String,Array,Object],default:``}},setup(n){let a=n,o=(0,r.useSlots)(),s=(0,r.inject)(t.DT_TEXT_LIST_CONTEXT,null),c=(0,r.computed)(()=>s?(0,r.unref)(s.type):void 0),l=(0,r.computed)(()=>e.hasSlotContent(o.marker)),u=(0,r.computed)(()=>c.value===`ordered`?a.value:void 0),d=(0,r.computed)(()=>[`d-text-list__item`,{"d-text-list__item--custom-marker":l.value},a.markerTone?`d-text-list__item--marker-tone-${a.markerTone}`:null]),f=e=>console.warn(`[DtTextListItem] ${e}`);return(0,r.onMounted)(()=>{process.env.NODE_ENV!==`production`&&(s||f(`DtTextListItem must be used inside DtTextList.`),a.value!==void 0&&c.value!==`ordered`&&f(`The value prop only applies inside a DtTextList with type="ordered".`))}),(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`li`,{"data-qa":`dt-text-list-item`,class:(0,r.normalizeClass)(d.value),value:u.value},[l.value?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{key:0,"data-qa":`dt-text-list-item-marker`,class:(0,r.normalizeClass)([`d-text-list__item-marker`,n.markerClass]),"aria-hidden":`true`},[(0,r.renderSlot)(e.$slots,`marker`)],2)):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,{"data-qa":`dt-text-list-item-content`,class:(0,r.normalizeClass)([`d-text-list__item-content`,n.contentClass])},[(0,r.renderSlot)(e.$slots,`default`)],2)],10,i))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return a}});
|
|
2
|
-
//# sourceMappingURL=TextListItem-BI9M_J8Y.cjs.map
|
package/dist/Toast-BXvUrvd_.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
require(`./chunk-Bmb41Sf3.cjs`);const e=require(`./common/validators/index.cjs`),t=require(`./common/utils/index.cjs`),n=require(`./_plugin-vue_export-helper-D8jCH6HB.cjs`),r=require(`./lib/icon/icon-constants.cjs`),i=require(`./lib/notice/notice-constants.cjs`),a=require(`./lib/notice/notice-icon.cjs`),o=require(`./lib/notice/notice-content.cjs`),s=require(`./lib/notice/notice-action.cjs`),c=require(`./lib/toast/toast-constants.cjs`);let l=require(`vue`),u=require(`@dialpad/dialtone-icons/vue`);var d={name:`ToastLayoutDefault`,components:{DtNoticeIcon:a.default,DtNoticeContent:o.default,DtNoticeAction:s.default},inheritAttrs:!1,props:{isShown:{type:Boolean,default:!1},headerId:{type:String,default(){return t.default.getUniqueString()}},contentId:{type:String,default(){return t.default.getUniqueString()}},headerText:{type:String,default:void 0},message:{type:String,default:``},role:{type:String,default:`status`,validator:e=>c.TOAST_ROLES.includes(e)},kind:{type:String,default:`base`,validator:e=>i.NOTICE_KINDS.includes(e)},important:{type:Boolean,default:!1},showClose:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},showAction:{type:Boolean,default:!0},iconClass:{type:[String,Array,Object],default:``},headerClass:{type:[String,Array,Object],default:``},contentClass:{type:[String,Array,Object],default:``},actionClass:{type:[String,Array,Object],default:``}},emits:[`close`],computed:{kindClass(){return{critical:`d-toast--critical`,info:`d-toast--info`,positive:`d-toast--positive`,warning:`d-toast--warning`,base:`d-toast--base`}[this.kind]},toastListeners(){return t.extractVueListeners(this.$attrs)}}},f=[`aria-hidden`],p={class:`d-toast__dialog`};function m(e,t,n,r,i,a){let o=(0,l.resolveComponent)(`dt-notice-icon`),s=(0,l.resolveComponent)(`dt-notice-content`),c=(0,l.resolveComponent)(`dt-notice-action`);return n.isShown?((0,l.openBlock)(),(0,l.createElementBlock)(`div`,{key:0,class:(0,l.normalizeClass)([`d-toast`,a.kindClass,e.$attrs.class,{"d-toast--important":n.important}]),"data-qa":`dt-toast`,"aria-hidden":(!n.isShown).toString()},[(0,l.createElementVNode)(`div`,p,[n.showIcon?((0,l.openBlock)(),(0,l.createBlock)(o,(0,l.mergeProps)({key:0,kind:n.kind,"icon-class":n.iconClass,class:{"d-notice__icon--has-title":n.headerText||e.$slots.header}},a.toastListeners),{default:(0,l.withCtx)(()=>[(0,l.renderSlot)(e.$slots,`icon`)]),_:3},16,[`kind`,`icon-class`,`class`])):(0,l.createCommentVNode)(``,!0),(0,l.createVNode)(s,(0,l.mergeProps)({"header-id":n.headerId,"content-id":n.contentId,"header-text":n.headerText,message:n.message,"header-class":n.headerClass,"content-class":n.contentClass,role:n.role},a.toastListeners),{header:(0,l.withCtx)(()=>[(0,l.renderSlot)(e.$slots,`header`)]),default:(0,l.withCtx)(()=>[(0,l.renderSlot)(e.$slots,`default`)]),_:3},16,[`header-id`,`content-id`,`header-text`,`message`,`header-class`,`content-class`,`role`]),(0,l.createVNode)(c,(0,l.mergeProps)({"show-action":n.showAction,"show-close":n.showClose,"action-class":n.actionClass},a.toastListeners,{onClose:t[0]||(t[0]=t=>e.$emit(`close`))}),{default:(0,l.withCtx)(()=>[(0,l.renderSlot)(e.$slots,`action`)]),_:3},16,[`show-action`,`show-close`,`action-class`])])],10,f)):(0,l.createCommentVNode)(``,!0)}var h=n.t(d,[[`render`,m]]),g=new Map([[`info`,u.DtIconInfo],[`positive`,u.DtIconInfo],[`warning`,u.DtIconAlertTriangle],[`critical`,u.DtIconInfo],[`base`,u.DtIconBell],[`gradient`,u.DtIconSparkle]]),_={name:`DtToastLayoutAlternateIcon`,components:{DtIconInfo:u.DtIconInfo,DtIconAlertTriangle:u.DtIconAlertTriangle,DtIconBell:u.DtIconBell,DtIconSparkle:u.DtIconSparkle},props:{kind:{type:String,default:`base`,validator(e){return c.TOAST_ALTERNATE_KINDS.includes(e)}},size:{type:[String,Number],default:400,validator:e.ordinalSizeValidator(r.ICON_SIZE_MODIFIERS)},iconClass:{type:[String,Array,Object],default:``}},computed:{defaultIcon(){return g.get(this.kind)}}};function v(e,t,n,r,i,a){return(0,l.openBlock)(),(0,l.createElementBlock)(`div`,{"aria-hidden":`true`,class:(0,l.normalizeClass)([`d-toast-layout-alternate__icon`,n.iconClass])},[(0,l.renderSlot)(e.$slots,`default`,{},()=>[a.defaultIcon?((0,l.openBlock)(),(0,l.createBlock)((0,l.resolveDynamicComponent)(a.defaultIcon),{key:0,size:n.size},null,8,[`size`])):(0,l.createCommentVNode)(``,!0)])],2)}var y=n.t(_,[[`render`,v]]),b={name:`ToastLayoutAlternate`,components:{DtNoticeAction:s.default,DtNoticeContent:o.default,DtToastLayoutAlternateIcon:y},inheritAttrs:!1,props:{isShown:{type:Boolean,default:!1},headerId:{type:String,default(){return t.default.getUniqueString()}},contentId:{type:String,default(){return t.default.getUniqueString()}},headerText:{type:String,default:void 0},message:{type:String,default:``},role:{type:String,default:`status`,validator:e=>c.TOAST_ROLES.includes(e)},kind:{type:String,default:`base`,validator:e=>c.TOAST_ALTERNATE_KINDS.includes(e)},showClose:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},iconClass:{type:[String,Array,Object],default:``},headerClass:{type:[String,Array,Object],default:``},contentClass:{type:[String,Array,Object],default:``},actionClass:{type:[String,Array,Object],default:``}},computed:{kindClass(){return{critical:`d-toast-alternate--critical`,info:`d-toast-alternate--info`,positive:`d-toast-alternate--positive`,warning:`d-toast-alternate--warning`,gradient:`d-toast-alternate--gradient`}[this.kind]},toastListeners(){return t.extractVueListeners(this.$attrs)}}},x=[`aria-hidden`],S={class:`d-toast-alternate__dialog`},C={class:`d-toast-alternate__header`},w={class:`d-toast-alternate__content`};function T(e,t,n,r,i,a){let o=(0,l.resolveComponent)(`dt-toast-layout-alternate-icon`),s=(0,l.resolveComponent)(`dt-notice-content`),c=(0,l.resolveComponent)(`dt-notice-action`);return n.isShown?((0,l.openBlock)(),(0,l.createElementBlock)(`div`,{key:0,class:(0,l.normalizeClass)([`d-toast-alternate`,e.$attrs.class,a.kindClass]),"data-qa":`dt-toast`,"aria-hidden":(!n.isShown).toString()},[(0,l.createElementVNode)(`div`,S,[(0,l.createElementVNode)(`div`,C,[n.showIcon?((0,l.openBlock)(),(0,l.createBlock)(o,(0,l.mergeProps)({key:0,kind:n.kind,"icon-class":n.iconClass,size:`200`},a.toastListeners),{default:(0,l.withCtx)(()=>[(0,l.renderSlot)(e.$slots,`icon`)]),_:3},16,[`kind`,`icon-class`])):(0,l.createCommentVNode)(``,!0),(0,l.createVNode)(s,(0,l.mergeProps)({"header-id":n.headerId,"content-id":n.contentId,"header-text":n.headerText,"header-class":n.headerClass,"content-class":n.contentClass,role:n.role},a.toastListeners),{header:(0,l.withCtx)(()=>[(0,l.renderSlot)(e.$slots,`header`)]),_:3},16,[`header-id`,`content-id`,`header-text`,`header-class`,`content-class`,`role`]),(0,l.createVNode)(c,(0,l.mergeProps)({"show-action":!1,"show-close":n.showClose,"action-class":n.actionClass,"button-size":100},a.toastListeners,{onClose:t[0]||(t[0]=t=>e.$emit(`close`))}),null,16,[`show-close`,`action-class`])]),(0,l.createElementVNode)(`div`,w,[(0,l.renderSlot)(e.$slots,`default`,{},()=>[(0,l.createTextVNode)((0,l.toDisplayString)(n.message),1)])])])],10,x)):(0,l.createCommentVNode)(``,!0)}var E=n.t(b,[[`render`,T]]),D={name:`DtToast`,components:{ToastLayoutDefault:h,ToastLayoutAlternate:E},inheritAttrs:!1,props:{headerId:{type:String,default:void 0},contentId:{type:String,default:void 0},headerText:{type:String,default:void 0},message:{type:String,default:void 0},role:{type:String,default:`status`},kind:{type:String,default:void 0},important:{type:Boolean,default:!1},open:{type:Boolean,default:!1},showClose:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},showAction:{type:Boolean,default:!0},duration:{type:Number,default:null,validator:e=>e>=c.TOAST_MIN_DURATION},layout:{type:String,default:`default`,validator:e=>c.TOAST_LAYOUTS.includes(e)},iconClass:{type:[String,Array,Object],default:``},headerClass:{type:[String,Array,Object],default:``},contentClass:{type:[String,Array,Object],default:``},actionClass:{type:[String,Array,Object],default:``}},emits:[`close`,`update:open`],data(){return{isShown:!1,minDuration:c.TOAST_MIN_DURATION}},computed:{shouldSetTimeout(){return!!this.duration&&this.duration>=this.minDuration},selectedLayout(){return this.layout===`alternate`?E:h}},watch:{open:{handler:function(e){this.isShown=e,e?this.setTimeout():clearTimeout(this.displayTimer)},immediate:!0}},unmounted(){clearTimeout(this.displayTimer)},methods:{setTimeout(){this.shouldSetTimeout&&(this.displayTimer=setTimeout(()=>{this.isShown=!1,this.$emit(`update:open`,!1)},this.duration))},handleClose(){this.isShown=!1,this.$emit(`close`),this.$emit(`update:open`,!1)}}};function O(e,t,n,r,i,a){return(0,l.openBlock)(),(0,l.createBlock)((0,l.resolveDynamicComponent)(a.selectedLayout),(0,l.mergeProps)({"is-shown":i.isShown,"header-id":n.headerId,"content-id":n.contentId,"header-text":n.headerText,message:n.message,role:n.role,kind:n.kind,important:n.important,"show-close":n.showClose,"show-icon":n.showIcon,"show-action":n.showAction,"icon-class":n.iconClass,"header-class":n.headerClass,"content-class":n.contentClass,"action-class":n.actionClass},e.$attrs,{onClose:a.handleClose}),{icon:(0,l.withCtx)(()=>[(0,l.renderSlot)(e.$slots,`icon`)]),header:(0,l.withCtx)(()=>[(0,l.renderSlot)(e.$slots,`header`)]),action:(0,l.withCtx)(()=>[(0,l.renderSlot)(e.$slots,`action`)]),default:(0,l.withCtx)(()=>[(0,l.renderSlot)(e.$slots,`default`)]),_:3},16,[`is-shown`,`header-id`,`content-id`,`header-text`,`message`,`role`,`kind`,`important`,`show-close`,`show-icon`,`show-action`,`icon-class`,`header-class`,`content-class`,`action-class`,`onClose`])}var k=n.t(D,[[`render`,O]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return k}});
|
|
2
|
-
//# sourceMappingURL=Toast-BXvUrvd_.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["DEFAULT_VALIDATION_MESSAGE_TYPE","VALIDATION_MESSAGE_TYPES","Comment","Text"],"sources":["../../../common/utils/index.js"],"sourcesContent":["import {\n DEFAULT_PREFIX,\n DEFAULT_VALIDATION_MESSAGE_TYPE,\n VALIDATION_MESSAGE_TYPES,\n} from '../constants/index.js';\nimport {\n h,\n Comment,\n Text,\n} from 'vue';\n\nlet UNIQUE_ID_COUNTER = 0;\nlet TIMER;\n\n// selector to find focusable not hidden inputs\nconst FOCUSABLE_SELECTOR_NOT_HIDDEN = 'input:not([type=hidden]):not(:disabled)';\n// selector to find focusable not disables elements\nconst FOCUSABLE_SELECTOR_NOT_DISABLED = 'select:not(:disabled),textarea:not(:disabled),button:not(:disabled)';\n// // selector to find focusable not hidden and disabled elements\nconst FOCUSABLE_SELECTOR_NOT_HIDDEN_DISABLED = `${FOCUSABLE_SELECTOR_NOT_HIDDEN},${FOCUSABLE_SELECTOR_NOT_DISABLED}`;\n// selector to find focusable elements\nconst FOCUSABLE_SELECTOR = `a,frame,iframe,${FOCUSABLE_SELECTOR_NOT_HIDDEN_DISABLED},*[tabindex]`;\n\nconst scheduler = typeof setImmediate === 'function' ? setImmediate : setTimeout;\n\nexport function getUniqueString (prefix = DEFAULT_PREFIX) {\n return `${prefix}${UNIQUE_ID_COUNTER++}`;\n}\n\n/**\n * Returns a random element from array\n * @param array - the array to return a random element from\n * @param {string} seed - use a string to seed the randomization, so it returns the same element each time\n * based on that string.\n * @returns {*} - the random element\n */\nexport function getRandomElement (array, seed) {\n if (seed) {\n const hash = javaHashCode(seed);\n return array[Math.abs(hash) % array.length];\n } else {\n return array[getRandomInt(array.length)];\n }\n}\n\n/**\n * Returns a hash code for a string.\n * (Compatible to Java's String.hashCode())\n * We use this algo to be in sync with android.\n *\n * The hash code for a string object is computed as\n * s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]\n * using number arithmetic, where s[i] is the i th character\n * of the given string, n is the length of the string,\n * and ^ indicates exponentiation.\n * (The hash value of the empty string is zero.)\n *\n * @param {string} str a string\n * @return {number} a hash code value for the given string.\n */\nexport function javaHashCode (str) {\n let h;\n for (let i = 0; i < str.length; i++) {\n h = Math.imul(31, h) + str.charCodeAt(i) | 0;\n }\n\n return h;\n}\n\n/**\n * Generate a random integer\n * @param {number} max - max range of integer to generate\n * @returns {number} randomly generated integer between 0 and max\n */\nexport function getRandomInt (max) {\n return Math.floor(Math.random() * max);\n}\n\nexport function formatMessages (messages) {\n if (!messages) {\n return [];\n }\n\n return messages.map(message => {\n if (typeof message === 'string') {\n return {\n message,\n type: DEFAULT_VALIDATION_MESSAGE_TYPE,\n };\n }\n\n return message;\n });\n}\n\nexport function filterFormattedMessages (formattedMessages) {\n const validationState = getValidationState(formattedMessages);\n\n if (!formattedMessages || !validationState) {\n return [];\n }\n\n return formattedMessages.filter(message => !!message.message && message.type === validationState);\n}\n\n/*\n * The priority order of message types is: 'critical' > 'warning' > 'positive' > 'info'.\n * If any message of type 'critical' is present in messages, the input state is considered\n * to be 'critical', then 'warning', then 'positive', and lastly 'info'.\n */\nexport function getValidationState (formattedMessages) {\n if (!formattedMessages) {\n return null;\n }\n\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.CRITICAL)) {\n return VALIDATION_MESSAGE_TYPES.CRITICAL;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.WARNING)) {\n return VALIDATION_MESSAGE_TYPES.WARNING;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.POSITIVE)) {\n return VALIDATION_MESSAGE_TYPES.POSITIVE;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.INFO)) {\n return VALIDATION_MESSAGE_TYPES.INFO;\n }\n\n return null;\n}\n\nexport function hasFormattedMessageOfType (formattedMessages, messageType) {\n if (!formattedMessages || !messageType) {\n return false;\n }\n\n return formattedMessages.some(message => message?.type === messageType);\n}\n\nexport function findFirstFocusableNode (element) {\n return element?.querySelector(FOCUSABLE_SELECTOR);\n}\n\n/* html-fragment component:\n * To render html without wrapping in another element as when using v-html.\n * props: html\n */\nexport const htmlFragment = (props) => {\n return h('div', { innerHTML: props.html });\n};\n\nexport const flushPromises = () => {\n return new Promise((resolve) => {\n scheduler(resolve);\n });\n};\n\n/*\n It is very cumbersome to check if a slot is empty in vue 3. Copied this method from the following thread\n https://github.com/vuejs/core/issues/4733. There is an RFC to fix this but not yet being worked on.\n https://github.com/vuejs/rfcs/discussions/453\n*/\nexport function hasSlotContent (slot, slotProps = {}) {\n if (!slot) return false;\n\n\n return slot(slotProps).some((vnode) => {\n if (vnode.type === Comment) return false;\n\n if (Array.isArray(vnode.children) && !vnode.children.length) return false;\n\n return (\n vnode.type !== Text ||\n (typeof vnode.children === 'string' && vnode.children.trim() !== '')\n );\n });\n}\n\n/**\n * Transform a string from kebab-case to PascalCase\n * @param string\n * @returns {string}\n */\nexport const kebabCaseToPascalCase = (string) => {\n return string?.toLowerCase()\n .split('-')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join('');\n};\n\n/**\n * Transform a string from PascalCase to kebab-case\n * @param string\n * @returns {string}\n */\nexport const pascalCaseToKebabCase = (string) => {\n return string\n .replace(/\\.?([A-Z0-9]+)/g, (x, y) => '-' + y.toLowerCase())\n .replace(/^-/, '');\n};\n\n/**\n * Extracts Vue event listeners from attributes object\n * @param {Object} attrs - The attributes object to extract listeners from\n * @returns {Object} Object containing only Vue event listeners (keys matching on[A-Z])\n */\nexport const extractVueListeners = (attrs) => {\n const listeners = Object.entries(attrs)\n .filter(([key]) => key.match(/on[A-Z]/));\n return Object.fromEntries(listeners);\n};\n\n/**\n * Extracts non-listener attributes from attributes object\n * @param {Object} attrs - The attributes object to extract non-listeners from\n * @returns {Object} Object containing only non-listener attributes (keys not matching on[A-Z])\n */\nexport const extractNonListeners = (attrs) => {\n const nonListeners = Object.entries(attrs)\n .filter(([key]) => !key.match(/on[A-Z]/));\n return Object.fromEntries(nonListeners);\n};\n\n/**\n * $el works very differently than in vue 2, if the first node in the template is a text node\n * such as a comment it will return that instead of the first actual element. This function\n * will recursively return the first element in the template instead of the first node.\n * @param el\n * @returns {HTMLElement} The first element in the template\n */\nexport const returnFirstEl = (el) => {\n if (el?.nodeType === Node.ELEMENT_NODE) {\n return el;\n } else if (!el?.nodeType) {\n return null;\n } else {\n return returnFirstEl(el?.nextSibling);\n }\n};\n\n/**\n In Vue 3, $attrs includes class and style attributes, but when using inheritAttrs: false\n and manually binding :class=\"$attrs.class\" and :style=\"$attrs.style\" to the root element,\n we need to prevent class/style from being passed to inner elements via v-bind=\"removeClassStyleAttrs($attrs)\".\n This function removes class and style attributes from the attrs object.\n*/\nexport function removeClassStyleAttrs (attrs) {\n const listeners = Object.entries(attrs)\n .filter(([key]) => !['class', 'style'].includes(key));\n return Object.fromEntries(listeners);\n}\n\n\n/*\n* Set's a global timer to debounce the execution of a function.\n* @param { object } func - the function that is going to be called after timeout\n* @param { number } [timeout=300] timeout\n* */\nexport function debounce (func, timeout = 300) {\n clearTimeout(TIMER);\n TIMER = setTimeout(func, timeout);\n}\n\n/**\n * Checks if the element is out of the viewport\n * https://gomakethings.com/how-to-check-if-any-part-of-an-element-is-out-of-the-viewport-with-vanilla-js/\n * @param {HTMLElement} element The element to check\n * @return {Object} A set of booleans for each side of the element\n */\n\nexport function isOutOfViewPort (element) {\n const bounding = element.getBoundingClientRect();\n\n const isOut = {\n top: bounding.top < 0,\n left: bounding.left < 0,\n bottom: bounding.bottom > (window.innerHeight || document.documentElement.clientHeight),\n right: bounding.right > (window.innerWidth || document.documentElement.clientWidth),\n };\n isOut.any = Object.values(isOut).some(val => val);\n isOut.all = Object.values(isOut).every(val => val);\n return isOut;\n}\n\n// match valid characters for a domain name followed by a dot, e.g. \"dialpad.\"\nconst domainNameRegex = /(?:(?:[^\\s!@#$%^&*()_=+[\\]{}\\\\|;:'\",.<>/?]+)\\.)/;\n\n// match valid TLDs for a hostname (outdated list from ~2017)\nconst tldRegerx = new RegExp(\n '(?:' +\n 'com|ru|org|net|de|jp|uk|br|it|pl|fr|in|au|ir|info|nl|cn|es|cz|kr|ca|eu|ua|co|gr|' +\n 'za|ro|biz|ch|se|tw|mx|vn|hu|be|tr|at|dk|tv|me|ar|sk|no|us|fi|id|cl|xyz|io|pt|by|' +\n 'il|ie|nz|kz|hk|lt|cc|my|sg|club|bg|edu|рф|pk|su|top|th|hr|rs|pe|pro|si|az|lv|pw|' +\n 'ae|ph|online|ng|ee|ws|ve|cat' +\n ')',\n);\n\n// match valid IPv4 addresses, e.g. \"192.158.1.38\"\nconst ipv4Regex = new RegExp(\n '(?:(?:[0-9]|[1-9]\\\\d|1\\\\d{2}|2[0-4]\\\\d|25[0-5])\\\\.){3}' +\n '(?:[0-9]|[1-9]\\\\d|1\\\\d{2}|2[0-4]\\\\d|25[0-5])',\n);\n\n// match hostnames OR IPv4 addresses, e.g. \"dialpad.com\" or \"192.158.1.38\"\nconst hostnameOrIpRegex = new RegExp(\n '(?:' +\n [\n [\n domainNameRegex.source,\n tldRegerx.source,\n ].join('+'),\n ipv4Regex.source,\n ].join('|') +\n ')',\n);\n\n// match URL paths, e.g. \"/news\"\nconst urlPathRegex = /(?:(?:[;/][^#?<>\\s]*)?)/;\n\n// match URL queries and fragments, e.g. \"?cache=1&new=true\" or \"#heading1\"\nconst urlQueryOrFragmentRegex = /(?:(?:\\?[^#<>\\s]+)?(?:#[^<>\\s]+)?)/;\n\n// match complete hostnames or IPv4 addresses without a protocol and with optional\n// URL paths, queries and fragments e.g. \"dialpad.com/news?cache=1#heading1\"\nconst urlWithoutProtocolRegex = new RegExp(\n '\\\\b' +\n [\n hostnameOrIpRegex.source,\n urlPathRegex.source,\n urlQueryOrFragmentRegex.source,\n '(?!\\\\w)',\n ].join('+'),\n);\n\n// match complete hostnames with protocols and optional URL paths, queries and fragments,\n// e.g. \"ws://localhost:9011\" or \"https://dialpad.com/news?cache=1#heading1\"\nconst urlWithProtocolRegex = /\\b[a-z\\d.-]+:\\/\\/[^<>\\s]+/;\n\n// match email addresses with an optional \"mailto:\" prefix and URL queries, e.g.\n// \"hey@dialpad.com\" or \"mailto:hey@dialpad.com?subject=Hi&body=Hey%20there\"\nconst emailAddressRegex = new RegExp(\n '(?:mailto:)?' +\n '[a-z0-9!#$%&\\'*+/=?^_`{|}~-]+(?:\\\\.[a-z0-9!#$%&\\'*+/=?^_`{|}~-]+)*@' +\n [\n hostnameOrIpRegex.source,\n urlQueryOrFragmentRegex.source,\n ].join('+') +\n '(?!\\\\w)',\n);\n\n/**\n * Match phone numbers, e.g. \"765-8813\", \"(778) 765-8813\" or \"+17787658813\".\n * @param {number} minLength\n * @param {number} maxLength\n * @returns {RegExp}\n */\nexport function getPhoneNumberRegex (minLength = 7, maxLength = 15) {\n // Some older browser versions don't support lookbehind, so provide a RegExp\n // version without it. It fails just one test case, so IMO it's still good\n // enough to use. https://caniuse.com/js-regexp-lookbehind\n try {\n return new RegExp(\n '(?:^|(?<=\\\\W))' +\n '(?![\\\\s\\\\-])\\\\+?(?:[0-9()\\\\- \\\\t]' +\n `{${minLength},${maxLength}}` +\n ')(?=\\\\b)(?=\\\\W(?=\\\\W|$)|\\\\s|$)',\n );\n } catch {\n \n console.warn('This browser doesn\\'t support regex lookahead/lookbehind');\n }\n\n return new RegExp(\n '(?![\\\\s\\\\-])\\\\+?(?:[0-9()\\\\- \\\\t]' +\n `{${minLength},${maxLength}}` +\n ')(?=\\\\b)(?=\\\\W(?=\\\\W|$)|\\\\s|$)',\n );\n}\n\nconst phoneNumberRegex = getPhoneNumberRegex();\n\n// match all link types\nexport const linkRegex = new RegExp(\n [\n urlWithoutProtocolRegex.source,\n urlWithProtocolRegex.source,\n emailAddressRegex.source,\n phoneNumberRegex.source,\n ].join('|'),\n 'gi',\n);\n\n/**\n * Check if a string is a phone number. Validates only exact matches.\n * @param {string|number} input\n * @returns {boolean}\n */\nexport function isPhoneNumber (input) {\n if (!input || (!['string', 'number'].includes(typeof input))) return false;\n input = input.toString();\n return phoneNumberRegex.exec(input)?.[0] === input;\n}\n\n/**\n * Check if a string is an URL. Validates only exact matches.\n * @param {string} input\n * @returns {boolean}\n */\nexport function isURL (input) {\n if (!input || typeof input !== 'string') return false;\n return urlWithoutProtocolRegex.exec(input)?.[0] === input ||\n urlWithProtocolRegex.exec(input)?.[0] === input;\n}\n\n/**\n * Check if a string is an email address. Validates only exact matches.\n * @param {string} input\n * @returns {boolean}\n */\nexport function isEmailAddress (input) {\n if (!input || typeof input !== 'string') return false;\n return emailAddressRegex.exec(input)?.[0] === input;\n}\n\n/**\n * Concatenate a string removing null or undefined elements\n * avoiding parsing them as string with template strings\n * @param {Array} elements\n * @returns {String}\n */\nexport function safeConcatStrings (elements) {\n return elements.filter(str => !!str).join(', ');\n}\n\n/**\n * Locale safe function to capitalize the first letter of a string.\n * @param {string} str the string to capitalize the first letter of\n * @param {string} locale a string representing the locale to be used. Defaults to 'en-US'\n * @returns The passed in string with the first letter capitalized\n */\nexport function capitalizeFirstLetter (str, locale = 'en-US') {\n return str.replace(/^\\p{CWU}/u, char => char.toLocaleUpperCase(locale));\n}\n\n/**\n * Warns if the component is not mounted properly. Useful for tests.\n * @param {HTMLElement} componentRef - the component reference\n * @param {string} componentName - the component name\n */\n\nexport function warnIfUnmounted (componentRef, componentName) {\n if (typeof process === 'undefined') return;\n if (process.env.NODE_ENV !== 'test') return;\n if (!componentRef || !(componentRef instanceof HTMLElement) || !document?.body) return;\n if (!document.body.contains(componentRef)) {\n console.warn(`The ${componentName} component is not attached to the document body. This may cause issues.`);\n }\n}\n\n/**\n * checks whether the dt-scrollbar is being used on the root element.\n * @param rootElement {HTMLElement}\n * @returns {boolean}\n */\nfunction isDtScrollbarInUse (rootElement = document.documentElement) {\n if (rootElement.hasAttribute('data-overlayscrollbars')) {\n return true;\n }\n return false;\n}\n\n/**\n * This will disable scrolling on the root element regardless of whether you are using dt-scrollbar or not.\n * @param rootElement {HTMLElement}\n */\nexport function disableRootScrolling (rootElement = document.documentElement) {\n if (isDtScrollbarInUse(rootElement)) {\n rootElement.classList.add('d-scrollbar-disabled');\n } else {\n rootElement.classList.add('d-of-hidden');\n }\n}\n\n/**\n * This will enable scrolling on the root element regardless of whether you are using dt-scrollbar or not.\n * @param rootElement {HTMLElement}\n */\nexport function enableRootScrolling (rootElement = document.documentElement) {\n if (isDtScrollbarInUse(rootElement)) {\n rootElement.classList.remove('d-scrollbar-disabled');\n } else {\n rootElement.classList.remove('d-of-hidden');\n }\n}\n\n/**\n * This will take a text string e.g \"accessibility-mac\"\n * and convert it to our Fluent Key standard format \"ACCESSIBILITY_MAC\"\n * @param text\n * @returns {string}\n */\nexport function toFluentKeyString (text) {\n return text\n .replaceAll(/[ -]/g, '_')\n .replaceAll(/\\W/g, '')\n .toUpperCase();\n}\n\nexport default {\n getUniqueString,\n getRandomElement,\n getRandomInt,\n formatMessages,\n filterFormattedMessages,\n hasFormattedMessageOfType,\n getValidationState,\n htmlFragment,\n flushPromises,\n kebabCaseToPascalCase,\n extractVueListeners,\n extractNonListeners,\n removeClassStyleAttrs,\n returnFirstEl,\n debounce,\n isOutOfViewPort,\n getPhoneNumberRegex,\n linkRegex,\n isEmailAddress,\n isPhoneNumber,\n isURL,\n safeConcatStrings,\n capitalizeFirstLetter,\n disableRootScrolling,\n enableRootScrolling,\n};\n\n"],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"text.cjs","names":[],"sources":["../../../components/Text/Text.vue"],"sourcesContent":["<template>\n <component\n :is=\"as\"\n data-qa=\"dt-text\"\n :class=\"textClasses\"\n :style=\"textStyles\"\n >\n <!-- @slot Default slot for text content -->\n <slot />\n </component>\n</template>\n\n<script>\nimport {\n TEXT_KIND_MODIFIERS,\n TEXT_VARIANT_MODIFIERS,\n TEXT_SIZE_MODIFIERS,\n TEXT_SIZE_MAP,\n TEXT_HEADLINE_ONLY_SIZES,\n TEXT_FONT_SIZE_MODIFIERS,\n TEXT_FAMILY_MODIFIERS,\n TEXT_ITALIC_CLASS,\n TEXT_ALIGN_MODIFIERS,\n TEXT_TONE_MODIFIERS,\n TEXT_NUMERIC_CLASS,\n TEXT_TRUNCATE_CLASS,\n TEXT_LINE_CLAMP_CLASS,\n TEXT_WRAP_MODIFIERS,\n TEXT_BOX_TRIM_MODIFIERS,\n TEXT_STRENGTH_MODIFIERS,\n TEXT_DENSITY_MODIFIERS,\n} from './TextConstants';\n\nconst DEFAULT_SIZE = '300';\nconst SEMANTIC_HEADING_ELEMENTS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\n\n// Module-level flag to emit info only once per session\nlet hasEmittedHeadlineSemanticInfo = false;\n\n// Exported for testing purposes only\nexport const resetHeadlineSemanticInfoFlag = () => {\n hasEmittedHeadlineSemanticInfo = false;\n};\n\n/**\n * Dialtone text primitive that applies typography tokens based on semantic props.\n * @see https://dialtone.dialpad.com/components/text.html\n */\nexport default {\n name: 'DtText',\n\n props: {\n /**\n * HTML tag or component used for rendering.\n * @values span, p, strong, h1, h2, h3, h4, h5, h6, label, div, component\n */\n as: {\n type: String,\n default: 'span',\n },\n\n /**\n * Typography kind mapping to headline/body/label/code token sets.\n * @values headline, body, label, code\n * @deprecated Use variant instead\n */\n kind: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_KIND_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Typography variant mapping to a complete token-backed composition.\n * @values headline-3xl, headline-2xl, headline-xl, headline-lg, headline-md, headline-sm, headline-xs, body-lg, body-md, body-sm, body-xs, label-lg, label-md, label-sm, label-xs, code-lg, code-md, code-sm, code-xs\n */\n variant: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_VARIANT_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Raw font-size token. Must be paired with `variant` for overrides or legacy `kind` for composition size.\n * @values 50, 75, 100, 125, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800\n */\n size: {\n type: [String, Number],\n default: null,\n },\n\n /**\n * Overrides font-family. By default, no font-family class is emitted and text inherits naturally.\n * @values inherit, custom, sans, mono, expressive\n */\n family: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_FAMILY_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Applies italic font style when true.\n */\n italic: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Semantic foreground color.\n * @values primary, secondary, tertiary, muted, disabled, placeholder, critical, critical-strong, positive, positive-strong, warning, info, info-strong, neutral-black, neutral-white\n */\n tone: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_TONE_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Logical text alignment. Requires block/inline-block context.\n * @values start, center, end, justify\n */\n align: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_ALIGN_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Enables single-line truncation (i.e. ellipsis) when true; requires block/inline-block context.\n */\n truncate: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Applies multi-line truncation (i.e. clamp) when greater than zero; requires block/inline-block context.\n */\n maxLines: {\n type: Number,\n default: null,\n validator: (value) => {\n return value === null || (Number.isInteger(value) && value > 0);\n },\n },\n\n /**\n * Renders numeric content with tabular figures.\n */\n numeric: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Controls text wrapping behavior.\n * @values wrap, nowrap, balance, pretty\n */\n wrap: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_WRAP_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Controls text-box-trim (leading space above/below text). Useful for tight component layouts.\n * @values start, end, both\n */\n textBoxTrim: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_BOX_TRIM_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Overrides font-weight. Applies to any kind/size combination.\n * @values bold, semibold, medium, normal\n */\n strength: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_STRENGTH_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Overrides line-height. Applies to any kind/size combination.\n * @values 100, 200, 300, 400, 500, 600\n */\n density: {\n type: [String, Number],\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_DENSITY_MODIFIERS, value)\n );\n },\n },\n },\n\n computed: {\n textClasses() {\n const classes = ['d-text'];\n const variantClass = this.getVariantClass();\n if (variantClass) {\n classes.push(variantClass);\n }\n\n const fontSizeClass = this.getFontSizeClass();\n if (fontSizeClass) {\n classes.push(fontSizeClass);\n }\n\n const familyClass = this.getFamilyClass();\n if (familyClass) {\n classes.push(familyClass);\n }\n\n if (this.italic) {\n classes.push(TEXT_ITALIC_CLASS);\n }\n\n const alignClass = this.getAlignClass();\n if (alignClass) {\n classes.push(alignClass);\n }\n\n const toneClass = this.getToneClass();\n if (toneClass) {\n classes.push(toneClass);\n }\n\n if (this.truncate) {\n classes.push(TEXT_TRUNCATE_CLASS);\n }\n\n if (this.numeric) {\n classes.push(TEXT_NUMERIC_CLASS);\n }\n\n if (this.maxLines) {\n classes.push(TEXT_LINE_CLAMP_CLASS);\n }\n\n const wrapClass = this.getWrapClass();\n if (wrapClass) {\n classes.push(wrapClass);\n }\n\n const textBoxTrimClass = this.getTextBoxTrimClass();\n if (textBoxTrimClass) {\n classes.push(textBoxTrimClass);\n }\n\n const strengthClass = this.getStrengthClass();\n if (strengthClass) {\n classes.push(strengthClass);\n }\n\n const densityClass = this.getDensityClass();\n if (densityClass) {\n classes.push(densityClass);\n }\n\n return classes;\n },\n\n textStyles() {\n if (!this.maxLines) {\n return undefined;\n }\n\n return {\n '--dt-text-line-clamp': this.maxLines,\n };\n },\n },\n\n mounted() {\n // Emit info once per session when headline is used without semantic heading element\n if (\n !hasEmittedHeadlineSemanticInfo &&\n this.usesHeadlineVisualStyle() &&\n !SEMANTIC_HEADING_ELEMENTS.includes(this.as)\n ) {\n console.info(\n '[DtText] A headline text style is used without a semantic heading element. ' +\n 'Consider using as=\"h1|h2|h3|h4|h5|h6\" for better accessibility.',\n );\n hasEmittedHeadlineSemanticInfo = true;\n }\n },\n\n methods: {\n usesHeadlineVisualStyle() {\n if (this.variant) {\n return this.variant.startsWith('headline-');\n }\n\n return this.kind === 'headline';\n },\n\n usesLegacyKindSize() {\n return Boolean(this.kind && !this.variant);\n },\n\n getVariantClass() {\n if (this.variant) {\n return this.getModifierClass(\n this.variant,\n TEXT_VARIANT_MODIFIERS,\n 'variant',\n );\n }\n\n if (!this.kind) {\n return null;\n }\n\n if (\n !Object.prototype.hasOwnProperty.call(TEXT_KIND_MODIFIERS, this.kind)\n ) {\n console.warn(`[DtText] Unsupported kind \"${this.kind}\".`);\n return null;\n }\n\n const allowedSizes = TEXT_SIZE_MODIFIERS[this.kind] || [];\n const rawSize = this.size != null ? String(this.size) : null;\n const requestedSize = rawSize || DEFAULT_SIZE;\n let resolvedSize = requestedSize;\n\n if (!allowedSizes.includes(requestedSize)) {\n // Headline-only sizes (3xl, 2xl, xl, 500, 600, 700) throw an error when used with incompatible kinds\n if (TEXT_HEADLINE_ONLY_SIZES.includes(requestedSize)) {\n throw new Error(\n `[DtText] size=\"${requestedSize}\" is only valid for kind=\"headline\". ` +\n `Cannot use with kind=\"${this.kind}\".`,\n );\n }\n\n // Universal sizes fall back gracefully with a warning\n const fallbackSize = allowedSizes.includes(DEFAULT_SIZE)\n ? DEFAULT_SIZE\n : allowedSizes[0];\n if (fallbackSize) {\n resolvedSize = fallbackSize;\n }\n console.warn(\n `[DtText] size=\"${requestedSize}\" is not valid for kind=\"${this.kind}\". Using \"${resolvedSize}\" instead.`,\n );\n }\n\n if (!resolvedSize) {\n return null;\n }\n\n // Map numeric sizes to t-shirt CSS class suffix\n const cssSuffix = TEXT_SIZE_MAP[resolvedSize] || resolvedSize;\n return `${TEXT_KIND_MODIFIERS[this.kind]}--${cssSuffix}`;\n },\n\n getFontSizeClass() {\n if (this.size === null || this.size === undefined) {\n return null;\n }\n\n if (!this.variant && !this.kind) {\n console.warn(\n '[DtText] size must be paired with variant or legacy kind. ' +\n 'Prefer variant for typography composition; use size only as a variant override.',\n );\n return null;\n }\n\n if (this.usesLegacyKindSize()) {\n return null;\n }\n\n const size = String(this.size);\n const className = TEXT_FONT_SIZE_MODIFIERS[size];\n if (className) {\n return className;\n }\n\n console.warn(\n `[DtText] Unsupported size \"${size}\". Use a numeric font-size token.`,\n );\n return null;\n },\n\n getModifierClass(value, modifiers, propName) {\n if (value === null || value === undefined) {\n return null;\n }\n\n const className = modifiers[value];\n if (!className) {\n console.warn(`[DtText] Unsupported ${propName} \"${value}\".`);\n return null;\n }\n\n return className;\n },\n\n getAlignClass() {\n return this.getModifierClass(this.align, TEXT_ALIGN_MODIFIERS, 'align');\n },\n\n getToneClass() {\n return this.getModifierClass(this.tone, TEXT_TONE_MODIFIERS, 'tone');\n },\n\n getWrapClass() {\n return this.getModifierClass(this.wrap, TEXT_WRAP_MODIFIERS, 'wrap');\n },\n\n getTextBoxTrimClass() {\n return this.getModifierClass(\n this.textBoxTrim,\n TEXT_BOX_TRIM_MODIFIERS,\n 'textBoxTrim',\n );\n },\n\n getStrengthClass() {\n return this.getModifierClass(\n this.strength,\n TEXT_STRENGTH_MODIFIERS,\n 'strength',\n );\n },\n\n getDensityClass() {\n return this.getModifierClass(\n this.density,\n TEXT_DENSITY_MODIFIERS,\n 'density',\n );\n },\n\n getFamilyClass() {\n return this.getModifierClass(\n this.family,\n TEXT_FAMILY_MODIFIERS,\n 'family',\n );\n },\n },\n};\n</script>\n"],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","names":[],"sources":["../../../components/Text/Text.vue"],"sourcesContent":["<template>\n <component\n :is=\"as\"\n data-qa=\"dt-text\"\n :class=\"textClasses\"\n :style=\"textStyles\"\n >\n <!-- @slot Default slot for text content -->\n <slot />\n </component>\n</template>\n\n<script>\nimport {\n TEXT_KIND_MODIFIERS,\n TEXT_VARIANT_MODIFIERS,\n TEXT_SIZE_MODIFIERS,\n TEXT_SIZE_MAP,\n TEXT_HEADLINE_ONLY_SIZES,\n TEXT_FONT_SIZE_MODIFIERS,\n TEXT_FAMILY_MODIFIERS,\n TEXT_ITALIC_CLASS,\n TEXT_ALIGN_MODIFIERS,\n TEXT_TONE_MODIFIERS,\n TEXT_NUMERIC_CLASS,\n TEXT_TRUNCATE_CLASS,\n TEXT_LINE_CLAMP_CLASS,\n TEXT_WRAP_MODIFIERS,\n TEXT_BOX_TRIM_MODIFIERS,\n TEXT_STRENGTH_MODIFIERS,\n TEXT_DENSITY_MODIFIERS,\n} from './TextConstants';\n\nconst DEFAULT_SIZE = '300';\nconst SEMANTIC_HEADING_ELEMENTS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\n\n// Module-level flag to emit info only once per session\nlet hasEmittedHeadlineSemanticInfo = false;\n\n// Exported for testing purposes only\nexport const resetHeadlineSemanticInfoFlag = () => {\n hasEmittedHeadlineSemanticInfo = false;\n};\n\n/**\n * Dialtone text primitive that applies typography tokens based on semantic props.\n * @see https://dialtone.dialpad.com/components/text.html\n */\nexport default {\n name: 'DtText',\n\n props: {\n /**\n * HTML tag or component used for rendering.\n * @values span, p, strong, h1, h2, h3, h4, h5, h6, label, div, component\n */\n as: {\n type: String,\n default: 'span',\n },\n\n /**\n * Typography kind mapping to headline/body/label/code token sets.\n * @values headline, body, label, code\n * @deprecated Use variant instead\n */\n kind: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_KIND_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Typography variant mapping to a complete token-backed composition.\n * @values headline-3xl, headline-2xl, headline-xl, headline-lg, headline-md, headline-sm, headline-xs, body-lg, body-md, body-sm, body-xs, label-lg, label-md, label-sm, label-xs, code-lg, code-md, code-sm, code-xs\n */\n variant: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_VARIANT_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Raw font-size token. Must be paired with `variant` for overrides or legacy `kind` for composition size.\n * @values 50, 75, 100, 125, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800\n */\n size: {\n type: [String, Number],\n default: null,\n },\n\n /**\n * Overrides font-family. By default, no font-family class is emitted and text inherits naturally.\n * @values inherit, custom, sans, mono, expressive\n */\n family: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_FAMILY_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Applies italic font style when true.\n */\n italic: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Semantic foreground color.\n * @values primary, secondary, tertiary, muted, disabled, placeholder, critical, critical-strong, positive, positive-strong, warning, info, info-strong, neutral-black, neutral-white\n */\n tone: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_TONE_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Logical text alignment. Requires block/inline-block context.\n * @values start, center, end, justify\n */\n align: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_ALIGN_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Enables single-line truncation (i.e. ellipsis) when true; requires block/inline-block context.\n */\n truncate: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Applies multi-line truncation (i.e. clamp) when greater than zero; requires block/inline-block context.\n */\n maxLines: {\n type: Number,\n default: null,\n validator: (value) => {\n return value === null || (Number.isInteger(value) && value > 0);\n },\n },\n\n /**\n * Renders numeric content with tabular figures.\n */\n numeric: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Controls text wrapping behavior.\n * @values wrap, nowrap, balance, pretty\n */\n wrap: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_WRAP_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Controls text-box-trim (leading space above/below text). Useful for tight component layouts.\n * @values start, end, both\n */\n textBoxTrim: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_BOX_TRIM_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Overrides font-weight. Applies to any kind/size combination.\n * @values bold, semibold, medium, normal\n */\n strength: {\n type: String,\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_STRENGTH_MODIFIERS, value)\n );\n },\n },\n\n /**\n * Overrides line-height. Applies to any kind/size combination.\n * @values 100, 200, 300, 400, 500, 600\n */\n density: {\n type: [String, Number],\n default: null,\n validator: (value) => {\n return (\n value === null ||\n Object.prototype.hasOwnProperty.call(TEXT_DENSITY_MODIFIERS, value)\n );\n },\n },\n },\n\n computed: {\n textClasses() {\n const classes = ['d-text'];\n const variantClass = this.getVariantClass();\n if (variantClass) {\n classes.push(variantClass);\n }\n\n const fontSizeClass = this.getFontSizeClass();\n if (fontSizeClass) {\n classes.push(fontSizeClass);\n }\n\n const familyClass = this.getFamilyClass();\n if (familyClass) {\n classes.push(familyClass);\n }\n\n if (this.italic) {\n classes.push(TEXT_ITALIC_CLASS);\n }\n\n const alignClass = this.getAlignClass();\n if (alignClass) {\n classes.push(alignClass);\n }\n\n const toneClass = this.getToneClass();\n if (toneClass) {\n classes.push(toneClass);\n }\n\n if (this.truncate) {\n classes.push(TEXT_TRUNCATE_CLASS);\n }\n\n if (this.numeric) {\n classes.push(TEXT_NUMERIC_CLASS);\n }\n\n if (this.maxLines) {\n classes.push(TEXT_LINE_CLAMP_CLASS);\n }\n\n const wrapClass = this.getWrapClass();\n if (wrapClass) {\n classes.push(wrapClass);\n }\n\n const textBoxTrimClass = this.getTextBoxTrimClass();\n if (textBoxTrimClass) {\n classes.push(textBoxTrimClass);\n }\n\n const strengthClass = this.getStrengthClass();\n if (strengthClass) {\n classes.push(strengthClass);\n }\n\n const densityClass = this.getDensityClass();\n if (densityClass) {\n classes.push(densityClass);\n }\n\n return classes;\n },\n\n textStyles() {\n if (!this.maxLines) {\n return undefined;\n }\n\n return {\n '--dt-text-line-clamp': this.maxLines,\n };\n },\n },\n\n mounted() {\n // Emit info once per session when headline is used without semantic heading element\n if (\n !hasEmittedHeadlineSemanticInfo &&\n this.usesHeadlineVisualStyle() &&\n !SEMANTIC_HEADING_ELEMENTS.includes(this.as)\n ) {\n console.info(\n '[DtText] A headline text style is used without a semantic heading element. ' +\n 'Consider using as=\"h1|h2|h3|h4|h5|h6\" for better accessibility.',\n );\n hasEmittedHeadlineSemanticInfo = true;\n }\n },\n\n methods: {\n usesHeadlineVisualStyle() {\n if (this.variant) {\n return this.variant.startsWith('headline-');\n }\n\n return this.kind === 'headline';\n },\n\n usesLegacyKindSize() {\n return Boolean(this.kind && !this.variant);\n },\n\n getVariantClass() {\n if (this.variant) {\n return this.getModifierClass(\n this.variant,\n TEXT_VARIANT_MODIFIERS,\n 'variant',\n );\n }\n\n if (!this.kind) {\n return null;\n }\n\n if (\n !Object.prototype.hasOwnProperty.call(TEXT_KIND_MODIFIERS, this.kind)\n ) {\n console.warn(`[DtText] Unsupported kind \"${this.kind}\".`);\n return null;\n }\n\n const allowedSizes = TEXT_SIZE_MODIFIERS[this.kind] || [];\n const rawSize = this.size != null ? String(this.size) : null;\n const requestedSize = rawSize || DEFAULT_SIZE;\n let resolvedSize = requestedSize;\n\n if (!allowedSizes.includes(requestedSize)) {\n // Headline-only sizes (3xl, 2xl, xl, 500, 600, 700) throw an error when used with incompatible kinds\n if (TEXT_HEADLINE_ONLY_SIZES.includes(requestedSize)) {\n throw new Error(\n `[DtText] size=\"${requestedSize}\" is only valid for kind=\"headline\". ` +\n `Cannot use with kind=\"${this.kind}\".`,\n );\n }\n\n // Universal sizes fall back gracefully with a warning\n const fallbackSize = allowedSizes.includes(DEFAULT_SIZE)\n ? DEFAULT_SIZE\n : allowedSizes[0];\n if (fallbackSize) {\n resolvedSize = fallbackSize;\n }\n console.warn(\n `[DtText] size=\"${requestedSize}\" is not valid for kind=\"${this.kind}\". Using \"${resolvedSize}\" instead.`,\n );\n }\n\n if (!resolvedSize) {\n return null;\n }\n\n // Map numeric sizes to t-shirt CSS class suffix\n const cssSuffix = TEXT_SIZE_MAP[resolvedSize] || resolvedSize;\n return `${TEXT_KIND_MODIFIERS[this.kind]}--${cssSuffix}`;\n },\n\n getFontSizeClass() {\n if (this.size === null || this.size === undefined) {\n return null;\n }\n\n if (!this.variant && !this.kind) {\n console.warn(\n '[DtText] size must be paired with variant or legacy kind. ' +\n 'Prefer variant for typography composition; use size only as a variant override.',\n );\n return null;\n }\n\n if (this.usesLegacyKindSize()) {\n return null;\n }\n\n const size = String(this.size);\n const className = TEXT_FONT_SIZE_MODIFIERS[size];\n if (className) {\n return className;\n }\n\n console.warn(\n `[DtText] Unsupported size \"${size}\". Use a numeric font-size token.`,\n );\n return null;\n },\n\n getModifierClass(value, modifiers, propName) {\n if (value === null || value === undefined) {\n return null;\n }\n\n const className = modifiers[value];\n if (!className) {\n console.warn(`[DtText] Unsupported ${propName} \"${value}\".`);\n return null;\n }\n\n return className;\n },\n\n getAlignClass() {\n return this.getModifierClass(this.align, TEXT_ALIGN_MODIFIERS, 'align');\n },\n\n getToneClass() {\n return this.getModifierClass(this.tone, TEXT_TONE_MODIFIERS, 'tone');\n },\n\n getWrapClass() {\n return this.getModifierClass(this.wrap, TEXT_WRAP_MODIFIERS, 'wrap');\n },\n\n getTextBoxTrimClass() {\n return this.getModifierClass(\n this.textBoxTrim,\n TEXT_BOX_TRIM_MODIFIERS,\n 'textBoxTrim',\n );\n },\n\n getStrengthClass() {\n return this.getModifierClass(\n this.strength,\n TEXT_STRENGTH_MODIFIERS,\n 'strength',\n );\n },\n\n getDensityClass() {\n return this.getModifierClass(\n this.density,\n TEXT_DENSITY_MODIFIERS,\n 'density',\n );\n },\n\n getFamilyClass() {\n return this.getModifierClass(\n this.family,\n TEXT_FAMILY_MODIFIERS,\n 'family',\n );\n },\n },\n};\n</script>\n"],"mappings":"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"}
|
/package/dist/{_plugin-vue_export-helper-BTgDAbhb.js → _plugin-vue_export-helper-BecorN_g.js}
RENAMED
|
File without changes
|
/package/dist/{_plugin-vue_export-helper-D8jCH6HB.cjs → _plugin-vue_export-helper-CX7YVcP6.cjs}
RENAMED
|
File without changes
|