@dialpad/dialtone-vue 3.223.0-next.2 → 3.223.0-next.4
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-CYEmi3dv.cjs +3 -0
- package/dist/Combobox-CYEmi3dv.cjs.map +1 -0
- package/dist/{Combobox-By01ETlj.js → Combobox-D8nQeBIf.js} +33 -32
- package/dist/Combobox-D8nQeBIf.js.map +1 -0
- package/dist/MarkdownRenderer-D5XWsyQk.cjs.map +1 -1
- package/dist/{MarkdownRenderer-C3MZDB2I.js → MarkdownRenderer-NSSny0ID.js} +2 -2
- package/dist/{MarkdownRenderer-C3MZDB2I.js.map → MarkdownRenderer-NSSny0ID.js.map} +1 -1
- package/dist/{RichTextEditor-BX-5tCOx.cjs → RichTextEditor-B9NGgB03.cjs} +2 -2
- package/dist/{RichTextEditor-BX-5tCOx.cjs.map → RichTextEditor-B9NGgB03.cjs.map} +1 -1
- package/dist/{RichTextEditor-D8Kas5A3.js → RichTextEditor-DxbZSRop.js} +4 -4
- package/dist/{RichTextEditor-D8Kas5A3.js.map → RichTextEditor-DxbZSRop.js.map} +1 -1
- package/dist/TextList-B6XFfQfD.js +88 -0
- package/dist/TextList-B6XFfQfD.js.map +1 -0
- package/dist/TextList-Dd-ROFiI.cjs +2 -0
- package/dist/TextList-Dd-ROFiI.cjs.map +1 -0
- package/dist/TextListItem-DIlrCkaM.cjs +2 -0
- package/dist/TextListItem-DIlrCkaM.cjs.map +1 -0
- package/dist/TextListItem-ImUi_FWh.js +62 -0
- package/dist/TextListItem-ImUi_FWh.js.map +1 -0
- package/dist/{Toast-CHbVmbBg.js → Toast-BIHkIpZP.js} +95 -94
- package/dist/Toast-BIHkIpZP.js.map +1 -0
- package/dist/Toast-D8ARDEgT.cjs +2 -0
- package/dist/Toast-D8ARDEgT.cjs.map +1 -0
- package/dist/{attachment_carousel-BFIAXWOZ.js → attachment_carousel-CyiexPBk.js} +1 -1
- package/dist/{attachment_carousel-BFIAXWOZ.js.map → attachment_carousel-CyiexPBk.js.map} +1 -1
- package/dist/{attachment_carousel-BJxqNJ5T.cjs → attachment_carousel-DJqILY7f.cjs} +1 -1
- package/dist/{attachment_carousel-BJxqNJ5T.cjs.map → attachment_carousel-DJqILY7f.cjs.map} +1 -1
- package/dist/common/mixins/input.d.ts +4 -4
- package/dist/common/mixins/input_group.d.ts +2 -2
- package/dist/common/sr_only_close_button.vue.d.ts +30 -30
- package/dist/common/sr_only_close_button.vue.d.ts.map +1 -1
- package/dist/common/validators/index.cjs +1 -1
- package/dist/common/validators/index.cjs.map +1 -1
- package/dist/common/validators/index.d.ts +2 -0
- package/dist/common/validators/index.d.ts.map +1 -1
- package/dist/common/validators/index.js +9 -2
- package/dist/common/validators/index.js.map +1 -1
- package/dist/component-documentation.json +1 -1
- package/dist/components/Avatar/Avatar.vue.d.ts +10 -10
- package/dist/components/Avatar/Avatar.vue.d.ts.map +1 -1
- package/dist/components/Badge/Badge.vue.d.ts +13 -13
- package/dist/components/Banner/Banner.vue.d.ts +142 -107
- package/dist/components/Banner/Banner.vue.d.ts.map +1 -1
- package/dist/components/Box/Box.vue.d.ts +18 -0
- package/dist/components/Box/Box.vue.d.ts.map +1 -1
- package/dist/components/Box/BoxConstants.d.ts +4 -0
- package/dist/components/Box/BoxConstants.d.ts.map +1 -1
- package/dist/components/Box/Validators.d.ts +4 -0
- package/dist/components/Box/Validators.d.ts.map +1 -1
- package/dist/components/Box/index.d.ts +1 -1
- package/dist/components/Breadcrumbs/BreadcrumbItem.vue.d.ts +1 -0
- package/dist/components/Breadcrumbs/BreadcrumbItem.vue.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.vue.d.ts +3 -2
- package/dist/components/Button/Button.vue.d.ts +25 -25
- package/dist/components/Button/Button.vue.d.ts.map +1 -1
- package/dist/components/Card/Card.vue.d.ts +6 -6
- package/dist/components/Checkbox/Checkbox.vue.d.ts +62 -27
- package/dist/components/Checkbox/Checkbox.vue.d.ts.map +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.vue.d.ts +82 -47
- package/dist/components/CheckboxGroup/CheckboxGroup.vue.d.ts.map +1 -1
- package/dist/components/Chip/Chip.vue.d.ts +40 -40
- package/dist/components/Chip/Chip.vue.d.ts.map +1 -1
- package/dist/components/Codeblock/Codeblock.vue.d.ts +2 -2
- package/dist/components/Collapsible/Collapsible.vue.d.ts +39 -39
- package/dist/components/Collapsible/Collapsible.vue.d.ts.map +1 -1
- package/dist/components/Combobox/Combobox.vue.d.ts +66 -66
- package/dist/components/Combobox/Combobox.vue.d.ts.map +1 -1
- package/dist/components/Combobox/ComboboxEmptyList.vue.d.ts +29 -29
- package/dist/components/Combobox/ComboboxEmptyList.vue.d.ts.map +1 -1
- package/dist/components/Combobox/ComboboxLoadingList.vue.d.ts +35 -35
- package/dist/components/Combobox/ComboboxLoadingList.vue.d.ts.map +1 -1
- package/dist/components/ComboboxWithPopover/ComboboxWithPopover.vue.d.ts +216 -216
- package/dist/components/ComboboxWithPopover/ComboboxWithPopover.vue.d.ts.map +1 -1
- package/dist/components/DescriptionList/DescriptionList.vue.d.ts +4 -4
- package/dist/components/Dropdown/Dropdown.vue.d.ts +82 -82
- package/dist/components/Dropdown/Dropdown.vue.d.ts.map +1 -1
- package/dist/components/Emoji/Emoji.vue.d.ts +17 -17
- package/dist/components/EmojiPicker/EmojiPicker.vue.d.ts +73 -38
- package/dist/components/EmojiPicker/EmojiPicker.vue.d.ts.map +1 -1
- package/dist/components/EmojiPicker/Modules/EmojiSearch.vue.d.ts +73 -38
- package/dist/components/EmojiPicker/Modules/EmojiSearch.vue.d.ts.map +1 -1
- package/dist/components/EmojiTextWrapper/EmojiTextWrapper.vue.d.ts +24 -24
- package/dist/components/EmojiTextWrapper/EmojiTextWrapper.vue.d.ts.map +1 -1
- package/dist/components/EmptyState/EmptyState.vue.d.ts.map +1 -1
- package/dist/components/FilterPill/FilterPill.vue.d.ts +380 -310
- package/dist/components/FilterPill/FilterPill.vue.d.ts.map +1 -1
- package/dist/components/Hovercard/Hovercard.vue.d.ts +156 -156
- package/dist/components/Hovercard/Hovercard.vue.d.ts.map +1 -1
- package/dist/components/Icon/Icon.vue.d.ts +7 -7
- package/dist/components/ImageViewer/ImageViewer.vue.d.ts +60 -60
- package/dist/components/ImageViewer/ImageViewer.vue.d.ts.map +1 -1
- package/dist/components/Input/Input.vue.d.ts +73 -38
- package/dist/components/Input/Input.vue.d.ts.map +1 -1
- package/dist/components/InputGroup/InputGroup.vue.d.ts +82 -47
- package/dist/components/InputGroup/InputGroup.vue.d.ts.map +1 -1
- package/dist/components/ItemLayout/ItemLayout.vue.d.ts +20 -20
- package/dist/components/KeyboardShortcut/KeyboardShortcut.vue.d.ts +116 -81
- package/dist/components/KeyboardShortcut/KeyboardShortcut.vue.d.ts.map +1 -1
- package/dist/components/Link/Link.vue.d.ts +1 -0
- package/dist/components/Link/LinkConstants.d.ts +3 -0
- package/dist/components/Link/LinkConstants.d.ts.map +1 -1
- package/dist/components/ListItem/ListItem.vue.d.ts +27 -27
- package/dist/components/ListItem/ListItem.vue.d.ts.map +1 -1
- package/dist/components/ListItemGroup/ListItemGroup.vue.d.ts +4 -4
- package/dist/components/Loader/Loader.vue.d.ts +7 -7
- package/dist/components/Modal/Modal.vue.d.ts +115 -86
- package/dist/components/Modal/Modal.vue.d.ts.map +1 -1
- package/dist/components/Modal/ModalConstants.d.ts +0 -5
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/Notice/Notice.vue.d.ts +142 -107
- package/dist/components/Notice/Notice.vue.d.ts.map +1 -1
- package/dist/components/Notice/NoticeAction.vue.d.ts +62 -62
- package/dist/components/Notice/NoticeAction.vue.d.ts.map +1 -1
- package/dist/components/Notice/NoticeContent.vue.d.ts +40 -5
- package/dist/components/Notice/NoticeContent.vue.d.ts.map +1 -1
- package/dist/components/Notice/NoticeIcon.vue.d.ts +32 -32
- package/dist/components/Notice/NoticeIcon.vue.d.ts.map +1 -1
- package/dist/components/Pagination/Pagination.vue.d.ts +40 -40
- package/dist/components/Pagination/Pagination.vue.d.ts.map +1 -1
- package/dist/components/Popover/Popover.vue.d.ts +78 -78
- package/dist/components/Popover/Popover.vue.d.ts.map +1 -1
- package/dist/components/Popover/PopoverHeaderFooter.vue.d.ts +34 -34
- package/dist/components/Popover/PopoverHeaderFooter.vue.d.ts.map +1 -1
- package/dist/components/ProgressCircle/ProgressCircle.vue.d.ts +7 -7
- package/dist/components/Prose/Prose.vue.d.ts.map +1 -1
- package/dist/components/Radio/Radio.vue.d.ts +62 -27
- package/dist/components/Radio/Radio.vue.d.ts.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.vue.d.ts +82 -47
- package/dist/components/RadioGroup/RadioGroup.vue.d.ts.map +1 -1
- package/dist/components/RichTextEditor/Extensions/Channels/ChannelComponent.vue.d.ts +6 -5
- package/dist/components/RichTextEditor/Extensions/Channels/ChannelComponent.vue.d.ts.map +1 -1
- package/dist/components/RichTextEditor/Extensions/Channels/ChannelSuggestion.vue.d.ts +10 -10
- package/dist/components/RichTextEditor/Extensions/Channels/ChannelSuggestion.vue.d.ts.map +1 -1
- package/dist/components/RichTextEditor/Extensions/Emoji/EmojiComponent.vue.d.ts +17 -17
- package/dist/components/RichTextEditor/Extensions/Emoji/EmojiSuggestion.vue.d.ts +17 -17
- package/dist/components/RichTextEditor/Extensions/Mentions/MentionComponent.vue.d.ts +1 -0
- package/dist/components/RichTextEditor/Extensions/Mentions/MentionSuggestion.vue.d.ts +46 -11
- package/dist/components/RichTextEditor/Extensions/SlashCommand/SlashCommandSuggestion.vue.d.ts +36 -1
- package/dist/components/RichTextEditor/Extensions/Suggestion/SuggestionList.vue.d.ts +27 -27
- package/dist/components/RichTextEditor/Extensions/Suggestion/SuggestionList.vue.d.ts.map +1 -1
- package/dist/components/RichTextEditor/Extensions/Variable/VariableComponent.vue.d.ts +189 -154
- package/dist/components/RichTextEditor/Extensions/Variable/VariableComponent.vue.d.ts.map +1 -1
- package/dist/components/RootLayout/RootLayout.vue.d.ts +10 -10
- package/dist/components/SegmentedControl/SegmentedControl.vue.d.ts.map +1 -1
- package/dist/components/SelectMenu/SelectMenu.vue.d.ts +69 -34
- package/dist/components/SelectMenu/SelectMenu.vue.d.ts.map +1 -1
- package/dist/components/Skeleton/Skeleton.vue.d.ts +8 -8
- package/dist/components/Skeleton/SkeletonListItem.vue.d.ts +4 -4
- package/dist/components/Skeleton/SkeletonParagraph.vue.d.ts +2 -2
- package/dist/components/Skeleton/SkeletonShape.vue.d.ts +2 -2
- package/dist/components/SplitButton/SplitButton.vue.d.ts +157 -157
- package/dist/components/SplitButton/SplitButton.vue.d.ts.map +1 -1
- package/dist/components/SplitButton/SplitButtonEnd.vue.d.ts +30 -30
- package/dist/components/SplitButton/SplitButtonEnd.vue.d.ts.map +1 -1
- package/dist/components/SplitButton/SplitButtonStart.vue.d.ts +31 -31
- package/dist/components/Tab/Tab.vue.d.ts +33 -33
- package/dist/components/Tab/TabGroup.vue.d.ts +6 -6
- package/dist/components/Tab/TabPanel.vue.d.ts +2 -2
- package/dist/components/Text/Text.vue.d.ts +36 -1
- package/dist/components/Text/Text.vue.d.ts.map +1 -1
- package/dist/components/Text/TextConstants.d.ts +53 -0
- package/dist/components/Text/TextConstants.d.ts.map +1 -1
- package/dist/components/Text/index.d.ts +1 -1
- package/dist/components/TextList/TextList.vue.d.ts +87 -0
- package/dist/components/TextList/TextList.vue.d.ts.map +1 -0
- package/dist/components/TextList/TextListConstants.d.ts +20 -0
- package/dist/components/TextList/TextListConstants.d.ts.map +1 -0
- package/dist/components/TextList/TextListItem.vue.d.ts +60 -0
- package/dist/components/TextList/TextListItem.vue.d.ts.map +1 -0
- package/dist/components/TextList/Validators.d.ts +5 -0
- package/dist/components/TextList/Validators.d.ts.map +1 -0
- package/dist/components/TextList/index.d.ts +4 -0
- package/dist/components/TextList/index.d.ts.map +1 -0
- package/dist/components/Toast/Layouts/ToastLayoutAlternate.vue.d.ts +144 -109
- package/dist/components/Toast/Layouts/ToastLayoutAlternate.vue.d.ts.map +1 -1
- package/dist/components/Toast/Layouts/ToastLayoutAlternateIcon.vue.d.ts +34 -34
- package/dist/components/Toast/Layouts/ToastLayoutAlternateIcon.vue.d.ts.map +1 -1
- package/dist/components/Toast/Layouts/ToastLayoutDefault.vue.d.ts +142 -107
- package/dist/components/Toast/Layouts/ToastLayoutDefault.vue.d.ts.map +1 -1
- package/dist/components/Toast/Toast.vue.d.ts +580 -440
- package/dist/components/Toast/Toast.vue.d.ts.map +1 -1
- package/dist/components/Toggle/Toggle.vue.d.ts +4 -4
- package/dist/components/Toggle/Toggle.vue.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.vue.d.ts +4 -4
- package/dist/components/ValidationMessages/ValidationMessages.vue.d.ts +22 -22
- package/dist/components/ValidationMessages/ValidationMessages.vue.d.ts.map +1 -1
- package/dist/dialtone-vue.cjs +1 -1
- package/dist/dialtone-vue.js +146 -142
- package/dist/index.d.ts +1 -0
- package/dist/lib/attachment-carousel/attachment-carousel.cjs +1 -1
- package/dist/lib/attachment-carousel/attachment-carousel.js +1 -1
- package/dist/lib/attachment-carousel/index.cjs +1 -1
- package/dist/lib/attachment-carousel/index.js +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 +55 -54
- package/dist/lib/avatar/avatar.js.map +1 -1
- package/dist/lib/badge/badge.cjs +1 -1
- package/dist/lib/badge/badge.cjs.map +1 -1
- package/dist/lib/badge/badge.js +36 -35
- package/dist/lib/badge/badge.js.map +1 -1
- package/dist/lib/box/box-constants.cjs +1 -1
- package/dist/lib/box/box-constants.cjs.map +1 -1
- package/dist/lib/box/box-constants.js +34 -7
- package/dist/lib/box/box-constants.js.map +1 -1
- package/dist/lib/box/box.cjs +1 -1
- package/dist/lib/box/box.cjs.map +1 -1
- package/dist/lib/box/box.js +93 -34
- package/dist/lib/box/box.js.map +1 -1
- package/dist/lib/box/index.cjs +1 -1
- package/dist/lib/box/index.js +3 -3
- package/dist/lib/box/validators.cjs +1 -1
- package/dist/lib/box/validators.cjs.map +1 -1
- package/dist/lib/box/validators.js +4 -4
- package/dist/lib/box/validators.js.map +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 +69 -68
- package/dist/lib/button/button.js.map +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 +36 -35
- package/dist/lib/chip/chip.js.map +1 -1
- package/dist/lib/codeblock/codeblock.cjs +1 -1
- package/dist/lib/codeblock/codeblock.cjs.map +1 -1
- package/dist/lib/codeblock/codeblock.js +11 -10
- package/dist/lib/codeblock/codeblock.js.map +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 +53 -53
- package/dist/lib/combobox-multi-select/combobox-multi-select.js.map +1 -1
- 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 +48 -47
- package/dist/lib/combobox-with-popover/combobox-with-popover.js.map +1 -1
- package/dist/lib/editor/editor.cjs +1 -1
- package/dist/lib/editor/editor.js +2 -2
- package/dist/lib/emoji/emoji.cjs +1 -1
- package/dist/lib/emoji/emoji.cjs.map +1 -1
- package/dist/lib/emoji/emoji.js +25 -24
- package/dist/lib/emoji/emoji.js.map +1 -1
- package/dist/lib/emoji-text-wrapper/emoji-text-wrapper.cjs +1 -1
- package/dist/lib/emoji-text-wrapper/emoji-text-wrapper.cjs.map +1 -1
- package/dist/lib/emoji-text-wrapper/emoji-text-wrapper.js +20 -19
- package/dist/lib/emoji-text-wrapper/emoji-text-wrapper.js.map +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 +31 -30
- package/dist/lib/empty-state/empty-state.js.map +1 -1
- package/dist/lib/filter-pill/filter-pill.cjs +1 -1
- package/dist/lib/filter-pill/filter-pill.cjs.map +1 -1
- package/dist/lib/filter-pill/filter-pill.js +73 -72
- package/dist/lib/filter-pill/filter-pill.js.map +1 -1
- package/dist/lib/icon/icon.cjs +1 -1
- package/dist/lib/icon/icon.cjs.map +1 -1
- package/dist/lib/icon/icon.js +16 -15
- package/dist/lib/icon/icon.js.map +1 -1
- package/dist/lib/input/input.cjs +1 -1
- package/dist/lib/input/input.cjs.map +1 -1
- package/dist/lib/input/input.js +64 -63
- package/dist/lib/input/input.js.map +1 -1
- package/dist/lib/link/link-constants.cjs +1 -1
- package/dist/lib/link/link-constants.cjs.map +1 -1
- package/dist/lib/link/link-constants.js +11 -9
- package/dist/lib/link/link-constants.js.map +1 -1
- package/dist/lib/link/link.cjs +1 -1
- package/dist/lib/link/link.cjs.map +1 -1
- package/dist/lib/link/link.js +17 -14
- package/dist/lib/link/link.js.map +1 -1
- package/dist/lib/loader/loader.cjs +3 -3
- package/dist/lib/loader/loader.cjs.map +1 -1
- package/dist/lib/loader/loader.js +21 -20
- package/dist/lib/loader/loader.js.map +1 -1
- package/dist/lib/message-input/index.cjs +1 -1
- package/dist/lib/message-input/index.js +1 -1
- package/dist/lib/message-input/message-input.cjs +1 -1
- package/dist/lib/message-input/message-input.js +1 -1
- package/dist/lib/modal/index.cjs +1 -1
- package/dist/lib/modal/index.js +3 -3
- package/dist/lib/modal/modal-constants.cjs +1 -1
- package/dist/lib/modal/modal-constants.cjs.map +1 -1
- package/dist/lib/modal/modal-constants.js +1 -4
- package/dist/lib/modal/modal-constants.js.map +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 +40 -42
- package/dist/lib/modal/modal.js.map +1 -1
- package/dist/lib/popover/popover.cjs +1 -1
- package/dist/lib/popover/popover.cjs.map +1 -1
- package/dist/lib/popover/popover.js +1 -1
- package/dist/lib/popover/popover.js.map +1 -1
- 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 +33 -32
- package/dist/lib/progress-circle/progress-circle.js.map +1 -1
- package/dist/lib/prose/prose.cjs +1 -1
- package/dist/lib/prose/prose.cjs.map +1 -1
- package/dist/lib/prose/prose.js +23 -22
- package/dist/lib/prose/prose.js.map +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.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/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 +42 -41
- package/dist/lib/segmented-control/segmented-control.js.map +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 +48 -47
- package/dist/lib/select-menu/select-menu.js.map +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 +45 -44
- package/dist/lib/split-button/split-button.js.map +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 +34 -35
- package/dist/lib/tab/tab-group.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 +70 -21
- package/dist/lib/text/text-constants.js.map +1 -1
- package/dist/lib/text/text.cjs +1 -1
- package/dist/lib/text/text.cjs.map +1 -1
- package/dist/lib/text/text.js +72 -37
- package/dist/lib/text/text.js.map +1 -1
- package/dist/lib/text-list/index.cjs +1 -0
- package/dist/lib/text-list/index.js +4 -0
- package/dist/lib/text-list/text-list-constants.cjs +2 -0
- package/dist/lib/text-list/text-list-constants.cjs.map +1 -0
- package/dist/lib/text-list/text-list-constants.js +31 -0
- package/dist/lib/text-list/text-list-constants.js.map +1 -0
- package/dist/lib/text-list/text-list-item.cjs +1 -0
- package/dist/lib/text-list/text-list-item.js +2 -0
- package/dist/lib/text-list/text-list.cjs +1 -0
- package/dist/lib/text-list/text-list.js +2 -0
- package/dist/lib/text-list/validators.cjs +2 -0
- package/dist/lib/text-list/validators.cjs.map +1 -0
- package/dist/lib/text-list/validators.js +10 -0
- package/dist/lib/text-list/validators.js.map +1 -0
- 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 +23 -22
- package/dist/lib/toggle/toggle.js.map +1 -1
- package/dist/{message_input-CbQCd07F.js → message_input-C6BcWqr8.js} +2 -2
- package/dist/{message_input-CbQCd07F.js.map → message_input-C6BcWqr8.js.map} +1 -1
- package/dist/{message_input-dBQwgyjI.cjs → message_input-ftx8f8wC.cjs} +2 -2
- package/dist/{message_input-dBQwgyjI.cjs.map → message_input-ftx8f8wC.cjs.map} +1 -1
- package/dist/node_modules/@tiptap/vue-3.cjs.map +1 -1
- package/dist/node_modules/@tiptap/vue-3.js +1 -1
- package/dist/node_modules/@tiptap/vue-3.js.map +1 -1
- package/dist/recipes/buttons/callbar_button/callbar_button.vue.d.ts +33 -33
- package/dist/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts +149 -149
- package/dist/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts.map +1 -1
- package/dist/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +147 -147
- package/dist/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts.map +1 -1
- package/dist/recipes/cards/ivr_node/ivr_node.vue.d.ts +173 -173
- package/dist/recipes/cards/ivr_node/ivr_node.vue.d.ts.map +1 -1
- package/dist/recipes/chips/grouped_chip/grouped_chip.vue.d.ts +40 -40
- package/dist/recipes/chips/grouped_chip/grouped_chip.vue.d.ts.map +1 -1
- package/dist/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts +132 -132
- package/dist/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts.map +1 -1
- package/dist/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.d.ts +97 -97
- package/dist/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.d.ts.map +1 -1
- package/dist/recipes/conversation_view/editor/EditorToolbarButton.vue.d.ts +25 -25
- package/dist/recipes/conversation_view/editor/EditorToolbarDropdownButton.vue.d.ts +107 -107
- package/dist/recipes/conversation_view/editor/EditorToolbarDropdownButton.vue.d.ts.map +1 -1
- package/dist/recipes/conversation_view/editor/EditorToolbarPopoverButton.vue.d.ts +103 -103
- package/dist/recipes/conversation_view/editor/EditorToolbarPopoverButton.vue.d.ts.map +1 -1
- package/dist/recipes/conversation_view/editor/editor.vue.d.ts +672 -637
- package/dist/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
- package/dist/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts +70 -70
- package/dist/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts.map +1 -1
- package/dist/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts +66 -66
- package/dist/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts.map +1 -1
- package/dist/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts +55 -55
- package/dist/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts.map +1 -1
- package/dist/recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue.d.ts +55 -55
- package/dist/recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue.d.ts.map +1 -1
- package/dist/recipes/conversation_view/message_input/message_input.vue.d.ts +784 -609
- package/dist/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
- package/dist/recipes/conversation_view/message_input/message_input_button.vue.d.ts +145 -110
- package/dist/recipes/conversation_view/message_input/message_input_button.vue.d.ts.map +1 -1
- package/dist/recipes/conversation_view/message_input/message_input_link.vue.d.ts +326 -256
- package/dist/recipes/conversation_view/message_input/message_input_link.vue.d.ts.map +1 -1
- package/dist/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts +185 -150
- package/dist/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts.map +1 -1
- package/dist/recipes/header/settings_menu_button/settings_menu_button.vue.d.ts +30 -30
- package/dist/recipes/header/settings_menu_button/settings_menu_button.vue.d.ts.map +1 -1
- package/dist/recipes/item_layout/contact_info/contact_info.vue.d.ts +30 -30
- package/dist/recipes/leftbar/callbox/callbox.vue.d.ts +28 -28
- package/dist/recipes/leftbar/callbox/callbox.vue.d.ts.map +1 -1
- package/dist/recipes/leftbar/contact_centers_row/contact_centers_row.vue.d.ts +72 -72
- package/dist/recipes/leftbar/contact_centers_row/contact_centers_row.vue.d.ts.map +1 -1
- package/dist/recipes/leftbar/contact_row/contact_row.vue.d.ts +215 -215
- package/dist/recipes/leftbar/contact_row/contact_row.vue.d.ts.map +1 -1
- package/dist/recipes/leftbar/general_row/general_row.vue.d.ts +176 -176
- package/dist/recipes/leftbar/general_row/general_row.vue.d.ts.map +1 -1
- package/dist/recipes/leftbar/general_row/leftbar_general_row_icon.vue.d.ts +80 -80
- package/dist/recipes/leftbar/general_row/leftbar_general_row_icon.vue.d.ts.map +1 -1
- package/dist/recipes/leftbar/group_row/group_row.vue.d.ts +181 -181
- package/dist/recipes/leftbar/group_row/group_row.vue.d.ts.map +1 -1
- package/dist/recipes/leftbar/unread_pill/unread_pill.vue.d.ts +10 -10
- package/dist/recipes/leftbar/unread_pill/unread_pill.vue.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/Combobox-By01ETlj.js.map +0 -1
- package/dist/Combobox-D4hc1-41.cjs +0 -3
- package/dist/Combobox-D4hc1-41.cjs.map +0 -1
- package/dist/Toast-CHbVmbBg.js.map +0 -1
- package/dist/Toast-DX-REYXG.cjs +0 -2
- package/dist/Toast-DX-REYXG.cjs.map +0 -1
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import { COMPONENT_SIZES as e } from "../../common/constants/sizes.js";
|
|
2
2
|
import { HTML_ELEMENT_TYPE as t } from "../../common/constants/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { t as a } from "../../
|
|
6
|
-
import o from "
|
|
7
|
-
import s from "../combobox/combobox-
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import f from "../popover/popover.js";
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
3
|
+
import { ordinalSizeValidator as n } from "../../common/validators/index.js";
|
|
4
|
+
import { getUniqueString as r, hasSlotContent as i } from "../../common/utils/index.js";
|
|
5
|
+
import { t as a } from "../../_plugin-vue_export-helper-BTgDAbhb.js";
|
|
6
|
+
import { t as o } from "../../mode_constants-tb7TL85q.js";
|
|
7
|
+
import s from "../combobox/combobox-loading-list.js";
|
|
8
|
+
import c from "../combobox/combobox-empty-list.js";
|
|
9
|
+
import { t as l } from "../../Combobox-D8nQeBIf.js";
|
|
10
|
+
import { COMBOBOX_LABEL_SIZES as u } from "../combobox/combobox-constants.js";
|
|
11
|
+
import { POPOVER_APPEND_TO_VALUES as d, POPOVER_CONTENT_WIDTHS as f } from "../popover/popover-constants.js";
|
|
12
|
+
import p from "../popover/popover.js";
|
|
13
|
+
import { DROPDOWN_PADDING_CLASSES as m } from "../dropdown/dropdown-constants.js";
|
|
14
|
+
import { createBlock as h, createElementVNode as g, createSlots as _, createVNode as v, mergeProps as y, normalizeClass as b, normalizeProps as x, openBlock as S, renderSlot as C, resolveComponent as w, withCtx as T, withKeys as E } from "vue";
|
|
14
15
|
//#region components/ComboboxWithPopover/ComboboxWithPopover.vue
|
|
15
|
-
var
|
|
16
|
+
var D = {
|
|
16
17
|
name: "DtComboboxWithPopover",
|
|
17
18
|
components: {
|
|
18
|
-
DtCombobox:
|
|
19
|
-
DtPopover:
|
|
20
|
-
ComboboxLoadingList:
|
|
21
|
-
ComboboxEmptyList:
|
|
19
|
+
DtCombobox: l,
|
|
20
|
+
DtPopover: p,
|
|
21
|
+
ComboboxLoadingList: s,
|
|
22
|
+
ComboboxEmptyList: c
|
|
22
23
|
},
|
|
23
24
|
props: {
|
|
24
|
-
contentMode:
|
|
25
|
+
contentMode: o,
|
|
25
26
|
label: {
|
|
26
27
|
type: String,
|
|
27
28
|
required: !0
|
|
@@ -33,7 +34,7 @@ var E = {
|
|
|
33
34
|
size: {
|
|
34
35
|
type: [String, Number],
|
|
35
36
|
default: null,
|
|
36
|
-
validator: (t) => t === null || Object.values(
|
|
37
|
+
validator: (t) => t === null || Object.values(u).includes(t) || n(e)(t)
|
|
37
38
|
},
|
|
38
39
|
description: {
|
|
39
40
|
type: String,
|
|
@@ -46,7 +47,7 @@ var E = {
|
|
|
46
47
|
listId: {
|
|
47
48
|
type: String,
|
|
48
49
|
default() {
|
|
49
|
-
return
|
|
50
|
+
return r();
|
|
50
51
|
}
|
|
51
52
|
},
|
|
52
53
|
listClass: {
|
|
@@ -100,12 +101,12 @@ var E = {
|
|
|
100
101
|
padding: {
|
|
101
102
|
type: String,
|
|
102
103
|
default: "small",
|
|
103
|
-
validator: (e) => Object.keys(
|
|
104
|
+
validator: (e) => Object.keys(m).some((t) => t === e)
|
|
104
105
|
},
|
|
105
106
|
contentWidth: {
|
|
106
107
|
type: String,
|
|
107
108
|
default: null,
|
|
108
|
-
validator: (e) =>
|
|
109
|
+
validator: (e) => f.includes(e)
|
|
109
110
|
},
|
|
110
111
|
openWithArrowKeys: {
|
|
111
112
|
type: Boolean,
|
|
@@ -138,7 +139,7 @@ var E = {
|
|
|
138
139
|
appendTo: {
|
|
139
140
|
type: [t, String],
|
|
140
141
|
default: "body",
|
|
141
|
-
validator: (e) =>
|
|
142
|
+
validator: (e) => d.includes(e) || e instanceof HTMLElement
|
|
142
143
|
},
|
|
143
144
|
transition: {
|
|
144
145
|
type: String,
|
|
@@ -153,12 +154,12 @@ var E = {
|
|
|
153
154
|
],
|
|
154
155
|
data() {
|
|
155
156
|
return {
|
|
156
|
-
DROPDOWN_PADDING_CLASSES:
|
|
157
|
+
DROPDOWN_PADDING_CLASSES: m,
|
|
157
158
|
isListShown: !1,
|
|
158
159
|
isInputFocused: !1,
|
|
159
160
|
isListFocused: !1,
|
|
160
|
-
externalAnchor:
|
|
161
|
-
hasSlotContent:
|
|
161
|
+
externalAnchor: r(),
|
|
162
|
+
hasSlotContent: i
|
|
162
163
|
};
|
|
163
164
|
},
|
|
164
165
|
computed: { comboboxListeners() {
|
|
@@ -213,10 +214,10 @@ var E = {
|
|
|
213
214
|
this.showList !== null || this.isListShown || !this.openWithArrowKeys || this.showComboboxList();
|
|
214
215
|
}
|
|
215
216
|
}
|
|
216
|
-
},
|
|
217
|
-
function
|
|
218
|
-
let o =
|
|
219
|
-
return
|
|
217
|
+
}, O = ["id"], k = ["onMouseleave", "onFocusout"];
|
|
218
|
+
function A(e, t, n, r, i, a) {
|
|
219
|
+
let o = w("combobox-loading-list"), s = w("combobox-empty-list"), c = w("dt-popover"), l = w("dt-combobox");
|
|
220
|
+
return S(), h(l, y({
|
|
220
221
|
ref: "combobox",
|
|
221
222
|
loading: n.loading,
|
|
222
223
|
label: n.label,
|
|
@@ -232,16 +233,16 @@ function k(e, t, n, r, i, a) {
|
|
|
232
233
|
"list-id": n.listId,
|
|
233
234
|
"data-qa": "dt-combobox"
|
|
234
235
|
}, a.comboboxListeners), {
|
|
235
|
-
input:
|
|
236
|
+
input: T(({ inputProps: n }) => [g("div", {
|
|
236
237
|
id: i.externalAnchor,
|
|
237
238
|
ref: "input",
|
|
238
239
|
onFocusin: t[0] || (t[0] = (...e) => a.onFocusIn && a.onFocusIn(...e)),
|
|
239
|
-
onKeydown: [t[1] || (t[1] =
|
|
240
|
-
}, [
|
|
240
|
+
onKeydown: [t[1] || (t[1] = E((e) => a.openOnArrowKeyPress(e), ["up"])), t[2] || (t[2] = E((e) => a.openOnArrowKeyPress(e), ["down"]))]
|
|
241
|
+
}, [C(e.$slots, "input", {
|
|
241
242
|
inputProps: n,
|
|
242
243
|
onInput: a.handleDisplayList
|
|
243
|
-
})], 40,
|
|
244
|
-
list:
|
|
244
|
+
})], 40, O)]),
|
|
245
|
+
list: T(({ opened: r, listProps: a, clearHighlightIndex: l }) => [v(c, {
|
|
245
246
|
ref: "popover",
|
|
246
247
|
open: i.isListShown,
|
|
247
248
|
"onUpdate:open": t[3] || (t[3] = (e) => i.isListShown = e),
|
|
@@ -265,34 +266,34 @@ function k(e, t, n, r, i, a) {
|
|
|
265
266
|
"dialog-class": n.dialogClass,
|
|
266
267
|
transition: n.transition,
|
|
267
268
|
onOpened: r
|
|
268
|
-
},
|
|
269
|
-
content:
|
|
269
|
+
}, _({
|
|
270
|
+
content: T(() => [g("div", {
|
|
270
271
|
ref: "listWrapper",
|
|
271
|
-
class:
|
|
272
|
+
class: b([
|
|
272
273
|
"d-recipe-combobox-with-popover__list",
|
|
273
274
|
i.DROPDOWN_PADDING_CLASSES[n.padding],
|
|
274
275
|
n.listClass
|
|
275
276
|
]),
|
|
276
277
|
onMouseleave: l,
|
|
277
278
|
onFocusout: l
|
|
278
|
-
}, [n.loading ? (
|
|
279
|
+
}, [n.loading ? (S(), h(o, x(y({ key: 0 }, a)), null, 16)) : n.emptyList && n.emptyStateMessage ? (S(), h(s, y({ key: 1 }, a, { message: n.emptyStateMessage }), null, 16, ["message"])) : C(e.$slots, "list", {
|
|
279
280
|
key: 2,
|
|
280
281
|
listProps: a
|
|
281
|
-
})], 42,
|
|
282
|
+
})], 42, k)]),
|
|
282
283
|
_: 2
|
|
283
284
|
}, [i.hasSlotContent(e.$slots.header) ? {
|
|
284
285
|
name: "headerContent",
|
|
285
|
-
fn:
|
|
286
|
+
fn: T(() => [g("div", {
|
|
286
287
|
ref: "header",
|
|
287
|
-
class:
|
|
288
|
-
}, [
|
|
288
|
+
class: b(n.headerClass)
|
|
289
|
+
}, [C(e.$slots, "header")], 2)]),
|
|
289
290
|
key: "0"
|
|
290
291
|
} : void 0, i.hasSlotContent(e.$slots.footer) ? {
|
|
291
292
|
name: "footerContent",
|
|
292
|
-
fn:
|
|
293
|
+
fn: T(() => [g("div", {
|
|
293
294
|
ref: "footer",
|
|
294
|
-
class:
|
|
295
|
-
}, [
|
|
295
|
+
class: b(n.footerClass)
|
|
296
|
+
}, [C(e.$slots, "footer")], 2)]),
|
|
296
297
|
key: "1"
|
|
297
298
|
} : void 0]), 1032, [
|
|
298
299
|
"open",
|
|
@@ -323,8 +324,8 @@ function k(e, t, n, r, i, a) {
|
|
|
323
324
|
"list-id"
|
|
324
325
|
]);
|
|
325
326
|
}
|
|
326
|
-
var
|
|
327
|
+
var j = /* @__PURE__ */ a(D, [["render", A]]);
|
|
327
328
|
//#endregion
|
|
328
|
-
export {
|
|
329
|
+
export { j as default };
|
|
329
330
|
|
|
330
331
|
//# sourceMappingURL=combobox-with-popover.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox-with-popover.js","names":[],"sources":["../../../components/ComboboxWithPopover/ComboboxWithPopover.vue"],"sourcesContent":["<template>\n <dt-combobox\n ref=\"combobox\"\n :loading=\"loading\"\n :label=\"label\"\n :show-label=\"showLabel\"\n :size=\"size\"\n :description=\"description\"\n :empty-list=\"emptyList\"\n :empty-state-message=\"emptyStateMessage\"\n :show-list=\"isListShown\"\n :on-beginning-of-list=\"onBeginningOfList\"\n :on-end-of-list=\"onEndOfList\"\n :list-rendered-outside=\"true\"\n :list-id=\"listId\"\n data-qa=\"dt-combobox\"\n v-bind=\"comboboxListeners\"\n >\n <template\n #input=\"{ inputProps }\"\n >\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <div\n :id=\"externalAnchor\"\n ref=\"input\"\n @focusin=\"onFocusIn\"\n @keydown.up=\"openOnArrowKeyPress($event)\"\n @keydown.down=\"openOnArrowKeyPress($event)\"\n >\n <slot\n name=\"input\"\n :input-props=\"inputProps\"\n :on-input=\"handleDisplayList\"\n />\n </div>\n </template>\n <template #list=\"{ opened, listProps, clearHighlightIndex }\">\n <dt-popover\n ref=\"popover\"\n v-model:open=\"isListShown\"\n :close-on-click=\"false\"\n :max-height=\"maxHeight\"\n :max-width=\"maxWidth\"\n :offset=\"popoverOffset\"\n :sticky=\"popoverSticky\"\n :content-mode=\"contentMode\"\n placement=\"bottom-start\"\n initial-focus-element=\"none\"\n padding=\"none\"\n role=\"listbox\"\n :external-anchor=\"externalAnchor\"\n :content-width=\"contentWidth\"\n :content-appear=\"true\"\n :content-tabindex=\"null\"\n :modal=\"false\"\n :auto-focus=\"false\"\n :append-to=\"appendTo\"\n :dialog-class=\"dialogClass\"\n :transition=\"transition\"\n @opened=\"opened\"\n >\n <template\n v-if=\"hasSlotContent($slots.header)\"\n #headerContent\n >\n <div\n ref=\"header\"\n :class=\"headerClass\"\n >\n <slot name=\"header\" />\n </div>\n </template>\n\n <template #content>\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <div\n ref=\"listWrapper\"\n :class=\"[\n 'd-recipe-combobox-with-popover__list',\n DROPDOWN_PADDING_CLASSES[padding],\n listClass,\n ]\"\n @mouseleave=\"clearHighlightIndex\"\n @focusout=\"clearHighlightIndex\"\n >\n <combobox-loading-list\n v-if=\"loading\"\n v-bind=\"listProps\"\n />\n <combobox-empty-list\n v-else-if=\"emptyList && emptyStateMessage\"\n v-bind=\"listProps\"\n :message=\"emptyStateMessage\"\n />\n <slot\n v-else\n name=\"list\"\n :list-props=\"listProps\"\n />\n </div>\n </template>\n\n <template\n v-if=\"hasSlotContent($slots.footer)\"\n #footerContent\n >\n <div\n ref=\"footer\"\n :class=\"footerClass\"\n >\n <slot name=\"footer\" />\n </div>\n </template>\n </dt-popover>\n </template>\n </dt-combobox>\n</template>\n\n<script>\nimport ComboboxLoadingList from '@/components/Combobox/ComboboxLoadingList.vue';\nimport ComboboxEmptyList from '@/components/Combobox/ComboboxEmptyList.vue';\nimport { DtCombobox, COMBOBOX_LABEL_SIZES } from '@/components/Combobox';\nimport { DtPopover, POPOVER_APPEND_TO_VALUES, POPOVER_CONTENT_WIDTHS } from '@/components/Popover';\nimport { getUniqueString, hasSlotContent } from '@/common/utils';\nimport { COMPONENT_SIZES, HTML_ELEMENT_TYPE } from '@/common/constants';\nimport { DROPDOWN_PADDING_CLASSES } from '@/components/Dropdown';\nimport { CONTENT_MODE_PROP } from '@/common/mode_constants';\n\nexport default {\n name: 'DtComboboxWithPopover',\n\n components: {\n DtCombobox,\n DtPopover,\n ComboboxLoadingList,\n ComboboxEmptyList,\n },\n\n props: {\n /**\n * Applies a color mode to the positioned content element.\n * @values light, dark, invert\n */\n contentMode: CONTENT_MODE_PROP,\n\n /**\n * String to use for the input label.\n */\n label: {\n type: String,\n required: true,\n },\n\n /**\n * Determines visibility of input label.\n * @values true, false\n */\n showLabel: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Size of the input.\n * @values 100, 200, 300, 400, 500\n */\n size: {\n type: [String, Number],\n default: null,\n validator: (t) => t === null\n || Object.values(COMBOBOX_LABEL_SIZES).includes(t)\n || Object.keys(COMPONENT_SIZES).includes(String(t)),\n },\n\n /**\n * Description for the input\n */\n description: {\n type: String,\n default: '',\n },\n\n /**\n * Determines when to show the list element and also controls the aria-expanded attribute.\n * Leaving this null will have the combobox trigger on input focus by default.\n * If you set this value, the default trigger behavior will be disabled and you can\n * control it as you need.\n */\n showList: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Sets an ID on the list element of the component. Used by several aria attributes\n * as well as when deriving the IDs for each item.\n */\n listId: {\n type: String,\n default () { return getUniqueString(); },\n },\n\n /**\n * Additional class for the wrapper list element.\n */\n listClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class for the header wrapper element.\n */\n headerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class for the footer wrapper element.\n */\n footerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class for the popover dialog element.\n */\n dialogClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * A method that will be called when the selection goes past the beginning of the list.\n */\n onBeginningOfList: {\n type: Function,\n default: null,\n },\n\n /**\n * A method that will be called when the selection goes past the end of the list.\n */\n onEndOfList: {\n type: Function,\n default: null,\n },\n\n /**\n * Determines maximum height for the popover before overflow.\n * Possible units rem|px|em\n */\n maxHeight: {\n type: String,\n default: '',\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|%|em\n */\n maxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Vertical padding size around the list element.\n */\n padding: {\n type: String,\n default: 'small',\n validator: (padding) => {\n return Object.keys(DROPDOWN_PADDING_CLASSES).some((item) => item === padding);\n },\n },\n\n /**\n * Width configuration for the popover content. When its value is 'anchor',\n * the popover content will have the same width as the anchor.\n */\n contentWidth: {\n type: String,\n default: null,\n validator: contentWidth => POPOVER_CONTENT_WIDTHS.includes(contentWidth),\n },\n\n /**\n * If the list should be shown by pressing up or down arrow key on the input element.\n * This can be set when not passing showList prop.\n */\n openWithArrowKeys: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Displaces the popover content box from its anchor element\n * by the specified number of pixels.\n */\n popoverOffset: {\n type: Array,\n default: () => [0, 4],\n },\n\n /**\n * If the popover sticks to the input.\n */\n popoverSticky: {\n type: [Boolean, String],\n default: false,\n },\n\n /**\n * Displays the list when the combobox is focused, before the user has typed anything.\n * When this is enabled the list will not close after selection.\n */\n hasSuggestionList: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Determines when to show the skeletons and also controls aria-busy attribute.\n */\n loading: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the list to an empty state, and displays the message from prop `emptyStateMessage`.\n */\n emptyList: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Message to show when the list is empty\n */\n emptyStateMessage: {\n type: String,\n default: '',\n },\n\n /**\n * Sets the element to which the popover is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * @values 'body', 'parent', HTMLElement,\n */\n appendTo: {\n type: [HTML_ELEMENT_TYPE, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n\n /**\n * Named transition when the content display is toggled.\n * @see DtLazyShow\n */\n transition: {\n type: String,\n default: 'fade',\n },\n },\n\n emits: [\n /**\n * Event fired when item selected\n *\n * @event select\n * @type {Number}\n */\n 'select',\n\n /**\n * Event fired when 'escape' key is pressed\n *\n * @event escape\n */\n 'escape',\n\n /**\n * Event fired when an item is highlighted\n *\n * @event highlight\n * @type {Number}\n */\n 'highlight',\n\n /**\n * Emitted when items are shown or hidden\n *\n * @event opened\n * @type {Boolean | Array}\n */\n 'opened',\n ],\n\n data () {\n return {\n DROPDOWN_PADDING_CLASSES,\n isListShown: false,\n isInputFocused: false,\n isListFocused: false,\n externalAnchor: getUniqueString(),\n hasSlotContent,\n };\n },\n\n computed: {\n comboboxListeners () {\n return {\n ...this.$attrs,\n\n onSelect: this.onSelect,\n\n onEscape: this.onEscape,\n\n onHighlight: this.onHighlight,\n };\n },\n },\n\n watch: {\n showList: {\n handler: function (show) {\n if (show !== null) {\n this.isListShown = show;\n }\n },\n\n immediate: true,\n },\n\n isListShown (val) {\n if (val) {\n window.addEventListener('mousedown', this.onFocusOut);\n } else {\n window.removeEventListener('mousedown', this.onFocusOut);\n }\n this.onOpened(val);\n },\n },\n\n methods: {\n handleDisplayList (value) {\n if (!this.hasSuggestionList && value) { this.showComboboxList(); }\n if (!this.hasSuggestionList && !value) { this.closeComboboxList(); }\n },\n\n showComboboxList () {\n if (this.showList != null) { return; }\n this.isListShown = true;\n },\n\n closeComboboxList () {\n if (this.showList != null) { return; }\n this.isListShown = false;\n },\n\n onSelect (highlightIndex) {\n if (this.loading) return;\n\n this.$emit('select', highlightIndex);\n if (!this.hasSuggestionList) {\n // we don't display the list before the user has typed anything\n this.closeComboboxList();\n }\n },\n\n onEscape () {\n this.$emit('escape');\n this.closeComboboxList();\n },\n\n onHighlight (highlightIndex) {\n if (this.loading) return;\n\n this.$emit('highlight', highlightIndex);\n },\n\n onOpened (opened) {\n this.$emit('opened', opened);\n },\n\n onFocusIn (e) {\n if (this.hasSuggestionList && e && this.$refs.input?.querySelector('input') === e.target) {\n // only trigger if we show suggestion list when focused, and\n // it's the input specifically that was focused\n this.showComboboxList();\n }\n },\n\n onFocusOut (e) {\n // Check if the focus change was to another target within the combobox component\n const popoverEl = this.$refs.popover?.tip?.popper;\n const comboboxEl = this.$refs.input;\n\n if (e.composedPath()?.some(el => [popoverEl, comboboxEl].includes(el))) return;\n\n // If outside the combobox then close\n this.closeComboboxList();\n },\n\n openOnArrowKeyPress () {\n if (this.showList !== null || this.isListShown || !this.openWithArrowKeys) { return; }\n\n this.showComboboxList();\n },\n },\n};\n</script>\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"combobox-with-popover.js","names":[],"sources":["../../../components/ComboboxWithPopover/ComboboxWithPopover.vue"],"sourcesContent":["<template>\n <dt-combobox\n ref=\"combobox\"\n :loading=\"loading\"\n :label=\"label\"\n :show-label=\"showLabel\"\n :size=\"size\"\n :description=\"description\"\n :empty-list=\"emptyList\"\n :empty-state-message=\"emptyStateMessage\"\n :show-list=\"isListShown\"\n :on-beginning-of-list=\"onBeginningOfList\"\n :on-end-of-list=\"onEndOfList\"\n :list-rendered-outside=\"true\"\n :list-id=\"listId\"\n data-qa=\"dt-combobox\"\n v-bind=\"comboboxListeners\"\n >\n <template\n #input=\"{ inputProps }\"\n >\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <div\n :id=\"externalAnchor\"\n ref=\"input\"\n @focusin=\"onFocusIn\"\n @keydown.up=\"openOnArrowKeyPress($event)\"\n @keydown.down=\"openOnArrowKeyPress($event)\"\n >\n <slot\n name=\"input\"\n :input-props=\"inputProps\"\n :on-input=\"handleDisplayList\"\n />\n </div>\n </template>\n <template #list=\"{ opened, listProps, clearHighlightIndex }\">\n <dt-popover\n ref=\"popover\"\n v-model:open=\"isListShown\"\n :close-on-click=\"false\"\n :max-height=\"maxHeight\"\n :max-width=\"maxWidth\"\n :offset=\"popoverOffset\"\n :sticky=\"popoverSticky\"\n :content-mode=\"contentMode\"\n placement=\"bottom-start\"\n initial-focus-element=\"none\"\n padding=\"none\"\n role=\"listbox\"\n :external-anchor=\"externalAnchor\"\n :content-width=\"contentWidth\"\n :content-appear=\"true\"\n :content-tabindex=\"null\"\n :modal=\"false\"\n :auto-focus=\"false\"\n :append-to=\"appendTo\"\n :dialog-class=\"dialogClass\"\n :transition=\"transition\"\n @opened=\"opened\"\n >\n <template\n v-if=\"hasSlotContent($slots.header)\"\n #headerContent\n >\n <div\n ref=\"header\"\n :class=\"headerClass\"\n >\n <slot name=\"header\" />\n </div>\n </template>\n\n <template #content>\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <div\n ref=\"listWrapper\"\n :class=\"[\n 'd-recipe-combobox-with-popover__list',\n DROPDOWN_PADDING_CLASSES[padding],\n listClass,\n ]\"\n @mouseleave=\"clearHighlightIndex\"\n @focusout=\"clearHighlightIndex\"\n >\n <combobox-loading-list\n v-if=\"loading\"\n v-bind=\"listProps\"\n />\n <combobox-empty-list\n v-else-if=\"emptyList && emptyStateMessage\"\n v-bind=\"listProps\"\n :message=\"emptyStateMessage\"\n />\n <slot\n v-else\n name=\"list\"\n :list-props=\"listProps\"\n />\n </div>\n </template>\n\n <template\n v-if=\"hasSlotContent($slots.footer)\"\n #footerContent\n >\n <div\n ref=\"footer\"\n :class=\"footerClass\"\n >\n <slot name=\"footer\" />\n </div>\n </template>\n </dt-popover>\n </template>\n </dt-combobox>\n</template>\n\n<script>\nimport ComboboxLoadingList from '@/components/Combobox/ComboboxLoadingList.vue';\nimport ComboboxEmptyList from '@/components/Combobox/ComboboxEmptyList.vue';\nimport { DtCombobox, COMBOBOX_LABEL_SIZES } from '@/components/Combobox';\nimport { DtPopover, POPOVER_APPEND_TO_VALUES, POPOVER_CONTENT_WIDTHS } from '@/components/Popover';\nimport { getUniqueString, hasSlotContent } from '@/common/utils';\nimport { COMPONENT_SIZES, HTML_ELEMENT_TYPE } from '@/common/constants';\nimport { ordinalSizeValidator } from '@/common/validators';\nimport { DROPDOWN_PADDING_CLASSES } from '@/components/Dropdown';\nimport { CONTENT_MODE_PROP } from '@/common/mode_constants';\n\nexport default {\n name: 'DtComboboxWithPopover',\n\n components: {\n DtCombobox,\n DtPopover,\n ComboboxLoadingList,\n ComboboxEmptyList,\n },\n\n props: {\n /**\n * Applies a color mode to the positioned content element.\n * @values light, dark, invert\n */\n contentMode: CONTENT_MODE_PROP,\n\n /**\n * String to use for the input label.\n */\n label: {\n type: String,\n required: true,\n },\n\n /**\n * Determines visibility of input label.\n * @values true, false\n */\n showLabel: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Size of the input.\n * @values 100, 200, 300, 400, 500\n */\n size: {\n type: [String, Number],\n default: null,\n validator: (t) => t === null\n || Object.values(COMBOBOX_LABEL_SIZES).includes(t)\n || ordinalSizeValidator(COMPONENT_SIZES)(t),\n },\n\n /**\n * Description for the input\n */\n description: {\n type: String,\n default: '',\n },\n\n /**\n * Determines when to show the list element and also controls the aria-expanded attribute.\n * Leaving this null will have the combobox trigger on input focus by default.\n * If you set this value, the default trigger behavior will be disabled and you can\n * control it as you need.\n */\n showList: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Sets an ID on the list element of the component. Used by several aria attributes\n * as well as when deriving the IDs for each item.\n */\n listId: {\n type: String,\n default () { return getUniqueString(); },\n },\n\n /**\n * Additional class for the wrapper list element.\n */\n listClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class for the header wrapper element.\n */\n headerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class for the footer wrapper element.\n */\n footerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class for the popover dialog element.\n */\n dialogClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * A method that will be called when the selection goes past the beginning of the list.\n */\n onBeginningOfList: {\n type: Function,\n default: null,\n },\n\n /**\n * A method that will be called when the selection goes past the end of the list.\n */\n onEndOfList: {\n type: Function,\n default: null,\n },\n\n /**\n * Determines maximum height for the popover before overflow.\n * Possible units rem|px|em\n */\n maxHeight: {\n type: String,\n default: '',\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|%|em\n */\n maxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Vertical padding size around the list element.\n */\n padding: {\n type: String,\n default: 'small',\n validator: (padding) => {\n return Object.keys(DROPDOWN_PADDING_CLASSES).some((item) => item === padding);\n },\n },\n\n /**\n * Width configuration for the popover content. When its value is 'anchor',\n * the popover content will have the same width as the anchor.\n */\n contentWidth: {\n type: String,\n default: null,\n validator: contentWidth => POPOVER_CONTENT_WIDTHS.includes(contentWidth),\n },\n\n /**\n * If the list should be shown by pressing up or down arrow key on the input element.\n * This can be set when not passing showList prop.\n */\n openWithArrowKeys: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Displaces the popover content box from its anchor element\n * by the specified number of pixels.\n */\n popoverOffset: {\n type: Array,\n default: () => [0, 4],\n },\n\n /**\n * If the popover sticks to the input.\n */\n popoverSticky: {\n type: [Boolean, String],\n default: false,\n },\n\n /**\n * Displays the list when the combobox is focused, before the user has typed anything.\n * When this is enabled the list will not close after selection.\n */\n hasSuggestionList: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Determines when to show the skeletons and also controls aria-busy attribute.\n */\n loading: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the list to an empty state, and displays the message from prop `emptyStateMessage`.\n */\n emptyList: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Message to show when the list is empty\n */\n emptyStateMessage: {\n type: String,\n default: '',\n },\n\n /**\n * Sets the element to which the popover is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * @values 'body', 'parent', HTMLElement,\n */\n appendTo: {\n type: [HTML_ELEMENT_TYPE, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n\n /**\n * Named transition when the content display is toggled.\n * @see DtLazyShow\n */\n transition: {\n type: String,\n default: 'fade',\n },\n },\n\n emits: [\n /**\n * Event fired when item selected\n *\n * @event select\n * @type {Number}\n */\n 'select',\n\n /**\n * Event fired when 'escape' key is pressed\n *\n * @event escape\n */\n 'escape',\n\n /**\n * Event fired when an item is highlighted\n *\n * @event highlight\n * @type {Number}\n */\n 'highlight',\n\n /**\n * Emitted when items are shown or hidden\n *\n * @event opened\n * @type {Boolean | Array}\n */\n 'opened',\n ],\n\n data () {\n return {\n DROPDOWN_PADDING_CLASSES,\n isListShown: false,\n isInputFocused: false,\n isListFocused: false,\n externalAnchor: getUniqueString(),\n hasSlotContent,\n };\n },\n\n computed: {\n comboboxListeners () {\n return {\n ...this.$attrs,\n\n onSelect: this.onSelect,\n\n onEscape: this.onEscape,\n\n onHighlight: this.onHighlight,\n };\n },\n },\n\n watch: {\n showList: {\n handler: function (show) {\n if (show !== null) {\n this.isListShown = show;\n }\n },\n\n immediate: true,\n },\n\n isListShown (val) {\n if (val) {\n window.addEventListener('mousedown', this.onFocusOut);\n } else {\n window.removeEventListener('mousedown', this.onFocusOut);\n }\n this.onOpened(val);\n },\n },\n\n methods: {\n handleDisplayList (value) {\n if (!this.hasSuggestionList && value) { this.showComboboxList(); }\n if (!this.hasSuggestionList && !value) { this.closeComboboxList(); }\n },\n\n showComboboxList () {\n if (this.showList != null) { return; }\n this.isListShown = true;\n },\n\n closeComboboxList () {\n if (this.showList != null) { return; }\n this.isListShown = false;\n },\n\n onSelect (highlightIndex) {\n if (this.loading) return;\n\n this.$emit('select', highlightIndex);\n if (!this.hasSuggestionList) {\n // we don't display the list before the user has typed anything\n this.closeComboboxList();\n }\n },\n\n onEscape () {\n this.$emit('escape');\n this.closeComboboxList();\n },\n\n onHighlight (highlightIndex) {\n if (this.loading) return;\n\n this.$emit('highlight', highlightIndex);\n },\n\n onOpened (opened) {\n this.$emit('opened', opened);\n },\n\n onFocusIn (e) {\n if (this.hasSuggestionList && e && this.$refs.input?.querySelector('input') === e.target) {\n // only trigger if we show suggestion list when focused, and\n // it's the input specifically that was focused\n this.showComboboxList();\n }\n },\n\n onFocusOut (e) {\n // Check if the focus change was to another target within the combobox component\n const popoverEl = this.$refs.popover?.tip?.popper;\n const comboboxEl = this.$refs.input;\n\n if (e.composedPath()?.some(el => [popoverEl, comboboxEl].includes(el))) return;\n\n // If outside the combobox then close\n this.closeComboboxList();\n },\n\n openOnArrowKeyPress () {\n if (this.showList !== null || this.isListShown || !this.openWithArrowKeys) { return; }\n\n this.showComboboxList();\n },\n },\n};\n</script>\n"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/utils/index.cjs`),t=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),n=require(`../../localization/index.cjs`),r=require(`../button/button.cjs`),i=require(`../list-item/list-item.cjs`),a=require(`../../Combobox-D4hc1-41.cjs`),o=require(`../stack/stack.cjs`),s=require(`../tooltip/tooltip.cjs`),c=require(`../popover/popover.cjs`),l=require(`../dropdown/dropdown-separator.cjs`),u=require(`../input/input.cjs`),d=require(`../list-item-group/list-item-group.cjs`),f=require(`../../RichTextEditor-BX-5tCOx.cjs`),p=require(`../rich-text-editor/rich-text-editor-constants.cjs`),m=require(`./editor-constants.cjs`),h=require(`./editor-toolbar-button.cjs`),g=require(`./editor-toolbar-dropdown-button.cjs`),_=require(`./editor-toolbar-popover-button.cjs`);let v=require(`vue`),y=require(`@dialpad/dialtone-icons/vue`);var b={compatConfig:{MODE:3},name:`DtRecipeEditor`,components:{DtListItemGroup:d.default,DtDropdownSeparator:l.default,DtListItem:i.default,DtRichTextEditor:f.t,DtButton:r.default,DtPopover:c.default,DtStack:o.default,DtInput:u.default,DtTooltip:s.default,DtCombobox:a.t,EditorToolbarButton:h.default,EditorToolbarDropdownButton:g.default,EditorToolbarPopoverButton:_.default,DtIconQuickReply:y.DtIconQuickReply,DtIconBold:y.DtIconBold,DtIconItalic:y.DtIconItalic,DtIconUnderline:y.DtIconUnderline,DtIconStrikethrough:y.DtIconStrikethrough,DtIconListBullet:y.DtIconListBullet,DtIconListOrdered:y.DtIconListOrdered,DtIconAlignLeft:y.DtIconAlignLeft,DtIconAlignCenter:y.DtIconAlignCenter,DtIconAlignRight:y.DtIconAlignRight,DtIconAlignJustify:y.DtIconAlignJustify,DtIconQuote:y.DtIconQuote,DtIconCodeBlock:y.DtIconCodeBlock,DtIconLink2:y.DtIconLink2,DtIconImage:y.DtIconImage,DtIconSearch:y.DtIconSearch,DtIconType:y.DtIconType,DtIconBraces:y.DtIconBraces,DtIconChevronDown:y.DtIconChevronDown,DtIconFontSize:y.DtIconFontSize,DtIconStopFilled:y.DtIconStopFilled},mixins:[],inheritAttrs:!1,props:{modelValue:{type:[Object,String],default:``},editable:{type:Boolean,default:!0},inputAriaLabel:{type:String,required:!0,default:``},inputClass:{type:String,default:``},autoFocus:{type:[Boolean,String,Number],default:!1,validator(e){return typeof e==`string`?p.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(e):!0}},placeholder:{type:String,default:``},maxHeight:{type:String,default:`unset`},setLinkPlaceholder:{type:String,default:``},showBoldButton:{type:Boolean,default:!0},showItalicsButton:{type:Boolean,default:!0},showUnderlineButton:{type:Boolean,default:!0},showStrikeButton:{type:Boolean,default:!0},showListItemsButton:{type:Boolean,default:!0},showOrderedListButton:{type:Boolean,default:!0},showAlignLeftButton:{type:Boolean,default:!0},showAlignCenterButton:{type:Boolean,default:!0},showAlignRightButton:{type:Boolean,default:!0},showAlignJustifyButton:{type:Boolean,default:!0},showQuoteButton:{type:Boolean,default:!0},showCodeBlockButton:{type:Boolean,default:!0},showQuickRepliesButton:{type:Boolean,default:!0},showInlineImageButton:{type:Boolean,default:!1},showVariableButton:{type:Boolean,default:!1},variableCategories:{type:Array,default:()=>[]},showAddLink:{type:Object,default:()=>({showAddLinkButton:!0})},showFontStyleButton:{type:Boolean,default:!1},showFontSizeButton:{type:Boolean,default:!1},showFontColorButton:{type:Boolean,default:!1},fontStyles:{type:Array,default:()=>[{name:`Arial`,value:null},{name:`Georgia`,value:`Georgia`},{name:`Helvetica`,value:`Helvetica`},{name:`Verdana`,value:`Verdana`},{name:`Times New Roman`,value:`Times New Roman`}]},fontSizes:{type:Array,default:()=>[{name:`Small`,value:`12px`},{name:`Normal`,value:`15px`},{name:`Large`,value:`24px`},{name:`Huge`,value:`36px`}]},allowBackgroundColor:{type:Boolean,default:!1},allowLineHeight:{type:Boolean,default:!1},preserveWhitespace:{type:[Boolean,String],default:`full`},useDivTags:{type:Boolean,default:!1},allowTables:{type:Boolean,default:!1},allowImageResize:{type:Boolean,default:!1}},emits:[`focus`,`blur`,`update:modelValue`,`quick-replies-click`,`inline-image-click`,`text-input`],data(){return{internalInputValue:this.modelValue,hasFocus:!1,linkOptions:{class:`d-recipe-editor__link`},currentFontColor:void 0,showLinkInput:!1,fontStyleSearch:``,linkInput:``,currentButtonRefIndex:0,variableSearchValue:``,i18n:new n.DialtoneLocalization}},computed:{inputLength(){return this.internalInputValue.length},htmlOutputFormat(){return p.RICH_TEXT_EDITOR_OUTPUT_FORMATS[2]},flattenedVariableItems(){return this.variableCategories?this.variableCategories.reduce((e,t)=>e.concat(t.items||[]),[]):[]},showingTextFormatButtons(){return this.showBoldButton||this.showItalicsButton||this.showStrikeButton||this.showUnderlineButton},showingAlignmentButtons(){return this.showAlignLeftButton||this.showAlignCenterButton||this.showAlignRightButton||this.showAlignJustifyButton},showingListButtons(){return this.showListItemsButton||this.showOrderedListButton},orderedRefs(){let e=this.buttonGroups.reduce(function(e,t){return t.buttonGroup.forEach(n=>{e.push(this.getButtonRef(t.key,n.selector))},this),e}.bind(this),[]);return e.push(this.getButtonRef(`custom`,`link`)),e},buttonGroups(){let e=this.individualButtons.map(e=>({key:e.selector,buttonGroup:[e]}));return[{key:`new`,buttonGroup:this.newButtons},{key:`format`,buttonGroup:this.textFormatButtons},{key:`alignment`,buttonGroup:this.alignmentButtons},{key:`list`,buttonGroup:this.listButtons},...e].filter(e=>e.buttonGroup.length>0)},newButtons(){return[{showBtn:this.showQuickRepliesButton,buttonType:`button`,label:this.i18n.$t(`DIALTONE_EDITOR_QUICK_REPLY_BUTTON_LABEL`),selector:`quickReplies`,icon:y.DtIconQuickReply,dataQA:`dt-recipe-editor-quick-replies-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_QUICK_REPLY_BUTTON_LABEL`),onClick:this.onQuickRepliesClick}].filter(e=>e.showBtn)},textFormatButtons(){return[{showBtn:this.showFontStyleButton,buttonType:`popover`,selector:`fontStyle`,icon:y.DtIconType,dataQA:`dt-recipe-editor-font-style-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_FONT_STYLE_BUTTON_LABEL`)},{showBtn:this.showFontSizeButton,buttonType:`popover`,selector:`fontSize`,icon:y.DtIconFontSize,dataQA:`dt-recipe-editor-font-size-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_FONT_SIZE_BUTTON_LABEL`)},{showBtn:this.showFontColorButton,buttonType:`custom`,selector:`fontColor`,icon:y.DtIconStopFilled,dataQA:`dt-recipe-editor-font-color-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_FONT_COLOR_BUTTON_LABEL`),onClick:this.onColorPickerButtonClick},{showBtn:this.showBoldButton,buttonType:`button`,selector:`bold`,icon:y.DtIconBold,dataQA:`dt-recipe-editor-bold-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_BOLD_BUTTON_LABEL`),onClick:this.onBoldTextToggle},{showBtn:this.showItalicsButton,buttonType:`button`,selector:`italic`,icon:y.DtIconItalic,dataQA:`dt-recipe-editor-italics-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_ITALICS_BUTTON_LABEL`),onClick:this.onItalicTextToggle},{showBtn:this.showUnderlineButton,buttonType:`button`,selector:`underline`,icon:y.DtIconUnderline,dataQA:`dt-recipe-editor-underline-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_UNDERLINE_BUTTON_LABEL`),onClick:this.onUnderlineTextToggle},{showBtn:this.showStrikeButton,buttonType:`button`,selector:`strike`,icon:y.DtIconStrikethrough,dataQA:`dt-recipe-editor-strike-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_STRIKE_BUTTON_LABEL`),onClick:this.onStrikethroughTextToggle}].filter(e=>e.showBtn)},alignmentButtons(){return[{showBtn:this.showAlignLeftButton,buttonType:`button`,selector:{textAlign:`left`},icon:y.DtIconAlignLeft,dataQA:`dt-recipe-editor-align-left-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_ALIGN_LEFT_BUTTON_LABEL`),onClick:()=>this.onTextAlign(`left`)},{showBtn:this.showAlignCenterButton,buttonType:`button`,selector:{textAlign:`center`},icon:y.DtIconAlignCenter,dataQA:`dt-recipe-editor-align-center-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_ALIGN_CENTER_BUTTON_LABEL`),onClick:()=>this.onTextAlign(`center`)},{showBtn:this.showAlignRightButton,buttonType:`button`,selector:{textAlign:`right`},icon:y.DtIconAlignRight,dataQA:`dt-recipe-editor-align-right-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_ALIGN_RIGHT_BUTTON_LABEL`),onClick:()=>this.onTextAlign(`right`)},{showBtn:this.showAlignJustifyButton,buttonType:`button`,selector:{textAlign:`justify`},icon:y.DtIconAlignJustify,dataQA:`dt-recipe-editor-align-justify-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_ALIGN_JUSTIFY_BUTTON_LABEL`),onClick:()=>this.onTextAlign(`justify`)}].filter(e=>e.showBtn)},listButtons(){return[{showBtn:this.showListItemsButton,buttonType:`button`,selector:`bulletList`,icon:y.DtIconListBullet,dataQA:`dt-recipe-editor-list-items-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_BULLET_LIST_BUTTON_LABEL`),onClick:this.onBulletListToggle},{showBtn:this.showOrderedListButton,buttonType:`button`,selector:`orderedList`,icon:y.DtIconListOrdered,dataQA:`dt-recipe-editor-ordered-list-items-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_ORDERED_LIST_BUTTON_LABEL`),onClick:this.onOrderedListToggle}].filter(e=>e.showBtn)},individualButtons(){return[{showBtn:this.showQuoteButton,buttonType:`button`,selector:`blockquote`,icon:y.DtIconQuote,dataQA:`dt-recipe-editor-blockquote-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_QUOTE_BUTTON_LABEL`),onClick:this.onBlockquoteToggle},{showBtn:this.showCodeBlockButton,buttonType:`button`,selector:`codeBlock`,icon:y.DtIconCodeBlock,dataQA:`dt-recipe-editor-code-block-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_CODE_BUTTON_LABEL`),onClick:this.onCodeBlockToggle},{showBtn:this.showInlineImageButton,buttonType:`button`,selector:`image`,icon:y.DtIconImage,dataQA:`dt-recipe-editor-inline-image-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_IMAGE_BUTTON_LABEL`),onClick:this.onInsertInlineImageClick},{showBtn:this.showVariableButton,buttonType:`popover`,selector:`variable`,icon:y.DtIconBraces,dataQA:`dt-recipe-editor-variable-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_VARIABLE_BUTTON_LABEL`)}].filter(e=>e.showBtn)},linkButton(){return{showBtn:this.showAddLink.showAddLinkButton,buttonType:`custom`,selector:`link`,icon:y.DtIconLink2,dataQA:`dt-recipe-editor-add-link-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_LINK_BUTTON_LABEL`),onClick:this.openLinkInput}},confirmSetLinkButtonLabels(){return this.i18n.$ta(`DIALTONE_EDITOR_CONFIRM_SET_LINK_BUTTON`)},cancelSetLinkButtonLabels(){return this.i18n.$ta(`DIALTONE_EDITOR_CANCEL_SET_LINK_BUTTON`)},removeLinkButtonLabels(){return this.i18n.$ta(`DIALTONE_EDITOR_REMOVE_LINK_BUTTON`)},showAddLinkButtonLabels(){return this.i18n.$ta(`DIALTONE_EDITOR_ADD_LINK_BUTTON`)},filteredFontStyles(){let e=this.fontStyleSearch.toLowerCase();return this.fontStyles.filter(t=>t.name.toLowerCase().includes(e))},filteredCategories(){return this.variableCategories.filter(e=>this.getFilteredItemsForCategory(e).length)},colorPickerInput(){return this.$refs.editorRoot?.querySelector(`.colorPickerInput`)},isDefaultFontColor(){return this.currentFontColor===m.EDITOR_DEFAULT_FONT_COLOR},actionBarBtn(){let e=this.$refs[this.orderedRefs[this.currentButtonRefIndex]][0]?.$refs?.buttonRef||this.$refs[this.orderedRefs[this.currentButtonRefIndex]];return Array.isArray(e)?e[0]:e}},watch:{modelValue(e){this.internalInputValue=e}},methods:{removeClassStyleAttrs:e.removeClassStyleAttrs,focusEditor(){this.$refs.richTextEditor?.editor?.commands.focus()},onInputFocus(e){e?.stopPropagation()},removeLink(){this.$refs.richTextEditor?.editor?.chain()?.focus()?.unsetLink()?.run(),this.closeLinkInput()},setLink(e){let t=this.$refs.richTextEditor?.editor;if(e?.preventDefault(),e?.stopPropagation(),!this.linkInput){this.removeLink();return}m.EDITOR_SUPPORTED_LINK_PROTOCOLS.find(e=>e.test(this.linkInput))||(this.linkInput=`${m.EDITOR_DEFAULT_LINK_PREFIX}${this.linkInput}`);let n=t?.view?.state?.selection;n.anchor===n.head?t.chain().focus().insertContentAt(n.anchor,`<a class="${this.linkOptions.class}" href=${this.linkInput}>${this.linkInput}</a>`).run():t.chain().focus().extendMarkRange(`link`).setLink({href:this.linkInput,class:this.linkOptions.class}).run(),this.closeLinkInput()},openLinkInput(){this.showLinkInput=!0},updateInput(e){if(!e)return this.closeLinkInput();this.linkInput=this.$refs.richTextEditor?.editor?.getAttributes(`link`)?.href},closeLinkInput(){this.showLinkInput=!1,this.linkInput=``,this.$refs.richTextEditor.editor?.chain().focus()},onBoldTextToggle(){this.$refs.richTextEditor?.editor?.chain().focus().toggleBold().run()},onItalicTextToggle(){this.$refs.richTextEditor?.editor.chain().focus().toggleItalic().run()},onUnderlineTextToggle(){this.$refs.richTextEditor?.editor.chain().focus().toggleUnderline().run()},onStrikethroughTextToggle(){this.$refs.richTextEditor?.editor.chain().focus().toggleStrike().run()},onTextAlign(e){if(this.$refs.richTextEditor?.editor?.isActive({textAlign:e}))return this.$refs.richTextEditor?.editor.chain().focus().unsetTextAlign().run();this.$refs.richTextEditor?.editor.chain().focus().setTextAlign(e).run()},onBulletListToggle(){this.$refs.richTextEditor?.editor.chain().focus().toggleBulletList().run()},onOrderedListToggle(){this.$refs.richTextEditor?.editor.chain().focus().toggleOrderedList().run()},onCodeBlockToggle(){this.$refs.richTextEditor?.editor.chain().focus().toggleCodeBlock().run()},onQuickRepliesClick(){this.$emit(`quick-replies-click`)},onInsertInlineImageClick(){this.$emit(`inline-image-click`)},insertVariable(e,t){this.$refs.richTextEditor?.editor.chain().focus().insertVariable({id:t.id,placeholder:t.placeholder||``,altText:``,enableAltText:t.enableAltText}).run()},insertInlineImage(e){this.$refs.richTextEditor?.editor.chain().focus().setImage({src:e}).run()},insertInMessageBody(e){this.$refs.richTextEditor?.editor.chain().focus().insertContent(e).run()},setCursorPosition(e=null){this.$refs.richTextEditor?.editor.chain().focus(e).run()},onBlockquoteToggle(){this.$refs.richTextEditor?.editor.chain().focus().toggleBlockquote().run()},onTextInput(e){this.$emit(`text-input`,e)},onFocus(e){this.hasFocus=!0,this.$emit(`focus`,e)},onBlur(e){this.hasFocus=!1,this.$emit(`blur`,e)},onUpdateModelValue(e){this.$emit(`update:modelValue`,e)},onSelected(){this.updateFontColorInput()},getButtonKey(e,t){return`${e}-${JSON.stringify(t)}`},getButtonRef(e,t){return`${this.getButtonKey(e,t)}-ref`},canFocus(e){return e===this.orderedRefs[this.currentButtonRefIndex]},shiftActionBarFocusRight(){this.shiftButtonRefIndex(1)},shiftActionBarFocusLeft(){this.shiftButtonRefIndex(-1)},shiftButtonRefIndex(e){let t=this.actionBarBtn,n=(this.currentButtonRefIndex+e)%this.orderedRefs.length;this.currentButtonRefIndex=n>=0?n:this.orderedRefs.length+n;let r=this.actionBarBtn;t.$el.blur(),r.$el.focus()},onFontStyleSelect(e){e?this.$refs.richTextEditor?.editor?.chain().focus().setFontFamily(e).run():this.$refs.richTextEditor?.editor?.chain().focus().unsetFontFamily().run(),this.$refs.richTextEditor?.editor?.commands.focus()},isCurrentFontFamily(e){return e?this.$refs.richTextEditor?.editor?.isActive(`textStyle`,{fontFamily:e}):!this.$refs.richTextEditor?.editor?.getAttributes(`textStyle`)?.fontFamily},onFontSizeSelect(e){this.$refs.richTextEditor?.editor?.chain().focus().setFontSize(e).run(),this.$refs.richTextEditor?.editor?.commands.focus()},isCurrentFontSize(e){return e?this.$refs.richTextEditor?.editor?.isActive(`textStyle`,{fontSize:e}):!this.$refs.richTextEditor?.editor?.getAttributes(`textStyle`)?.fontSize},getFilteredItemsForCategory(e){let t=this.variableSearchValue.toLowerCase();return e.name.toLowerCase().includes(t)?e.items:e.items.filter(e=>e.name.toLowerCase().includes(t))},updateFontColorInput(){this.currentFontColor=this.$refs.richTextEditor?.editor?.getAttributes(`textStyle`)?.color||`#000000`},onColorPickerButtonClick(){this.colorPickerInput?.click()},onColorPickerInput(e){this.$refs.richTextEditor?.editor?.chain().focus().setColor(e).run(),this.$refs.richTextEditor?.editor?.commands.focus(),this.updateFontColorInput()}}},x={class:`d-recipe-editor__popover-content`};function S(e,t,n,r,i,a){let o=(0,v.resolveComponent)(`dt-icon-search`),s=(0,v.resolveComponent)(`dt-input`),c=(0,v.resolveComponent)(`dt-list-item`),l=(0,v.resolveComponent)(`dt-combobox`),u=(0,v.resolveComponent)(`editor-toolbar-popover-button`),d=(0,v.resolveComponent)(`editor-toolbar-dropdown-button`),f=(0,v.resolveComponent)(`dt-button`),p=(0,v.resolveComponent)(`dt-dropdown-separator`),m=(0,v.resolveComponent)(`dt-list-item-group`),h=(0,v.resolveComponent)(`editor-toolbar-button`),g=(0,v.resolveComponent)(`dt-stack`),_=(0,v.resolveComponent)(`dt-tooltip`),y=(0,v.resolveComponent)(`dt-popover`),b=(0,v.resolveComponent)(`dt-rich-text-editor`),S=(0,v.resolveDirective)(`dt-tooltip`);return(0,v.openBlock)(),(0,v.createElementBlock)(`div`,{ref:`editorRoot`,class:(0,v.normalizeClass)([`d-recipe-editor`,e.$attrs.class]),style:(0,v.normalizeStyle)(e.$attrs.style),"data-qa":`dt-recipe-editor`,role:`presentation`,onClick:t[6]||(t[6]=t=>e.$refs.richTextEditor.focusEditor())},[(0,v.createVNode)(g,{class:`d-recipe-editor__top-bar`,direction:`row`,gap:`150`},{default:(0,v.withCtx)(()=>[((0,v.openBlock)(!0),(0,v.createElementBlock)(v.Fragment,null,(0,v.renderList)(a.buttonGroups,r=>((0,v.openBlock)(),(0,v.createBlock)(g,{key:r.key,direction:`row`,gap:`50`},{default:(0,v.withCtx)(()=>[((0,v.openBlock)(!0),(0,v.createElementBlock)(v.Fragment,null,(0,v.renderList)(r.buttonGroup,g=>((0,v.openBlock)(),(0,v.createElementBlock)(v.Fragment,null,[g.buttonType===`popover`&&g.selector===`fontStyle`?((0,v.openBlock)(),(0,v.createBlock)(u,{key:a.getButtonKey(r.key,g.selector),ref_for:!0,ref:a.getButtonRef(r.key,g.selector),"is-active":e.$refs.richTextEditor?.editor?.isActive(g.selector),"tooltip-message":g.tooltipMessage,"data-qa":g.dataQA,"popover-data-qa":`dt-recipe-editor-font-style-input-popover`,tabindex:a.canFocus(a.getButtonRef(r.key,g.selector))?0:-1,icon:g.icon,onShiftFocusRight:a.shiftActionBarFocusRight,onShiftFocusLeft:a.shiftActionBarFocusLeft},{content:(0,v.withCtx)(({close:e})=>[(0,v.createVNode)(l,{label:``,"show-label":!1,"show-list":!0,"click-on-select":!0,onEscape:t=>e()},{input:(0,v.withCtx)(({inputProps:e})=>[(0,v.createVNode)(s,(0,v.mergeProps)({ref_for:!0},e,{modelValue:i.fontStyleSearch,"onUpdate:modelValue":t[0]||(t[0]=e=>i.fontStyleSearch=e),class:`d-p-100 d-pbe-50 d-w216`,type:`search`,placeholder:i.i18n.$t(`DIALTONE_EDITOR_FONT_STYLE_SEARCH_PLACEHOLDER`),size:200,role:`menuitem`}),{startIcon:(0,v.withCtx)(({iconSize:e})=>[(0,v.createVNode)(o,{size:e},null,8,[`size`])]),_:1},16,[`modelValue`,`placeholder`])]),list:(0,v.withCtx)(({listProps:t})=>[(0,v.createElementVNode)(`ul`,(0,v.mergeProps)({ref_for:!0},t),[((0,v.openBlock)(!0),(0,v.createElementBlock)(v.Fragment,null,(0,v.renderList)(a.filteredFontStyles,t=>((0,v.openBlock)(),(0,v.createBlock)(c,{key:t.name,selected:a.isCurrentFontFamily(t.value),style:(0,v.normalizeStyle)({fontFamily:t.value||`inherit`}),role:`option`,"navigation-type":`arrow-keys`,onClick:n=>{e(a.focusEditor),a.onFontStyleSelect(t.value)}},{default:(0,v.withCtx)(()=>[(0,v.createTextVNode)((0,v.toDisplayString)(t.name),1)]),_:2},1032,[`selected`,`style`,`onClick`]))),128))],16)]),_:2},1032,[`onEscape`])]),_:1},8,[`is-active`,`tooltip-message`,`data-qa`,`tabindex`,`icon`,`onShiftFocusRight`,`onShiftFocusLeft`])):g.buttonType===`popover`&&g.selector===`fontSize`?((0,v.openBlock)(),(0,v.createBlock)(d,{key:a.getButtonKey(r.key,g.selector),ref_for:!0,ref:a.getButtonRef(r.key,g.selector),"is-active":e.$refs.richTextEditor?.editor?.isActive(g.selector),"tooltip-message":g.tooltipMessage,"data-qa":g.dataQA,"dropdown-data-qa":`dt-recipe-editor-font-size-input-popover`,tabindex:a.canFocus(a.getButtonRef(r.key,g.selector))?0:-1,icon:g.icon,onShiftFocusRight:a.shiftActionBarFocusRight,onShiftFocusLeft:a.shiftActionBarFocusLeft},{list:(0,v.withCtx)(({close:e})=>[((0,v.openBlock)(!0),(0,v.createElementBlock)(v.Fragment,null,(0,v.renderList)(n.fontSizes,t=>((0,v.openBlock)(),(0,v.createBlock)(c,{key:t.name,selected:a.isCurrentFontSize(t.value),role:`menuitem`,"navigation-type":`arrow-keys`,onClick:n=>{e(a.focusEditor),a.onFontSizeSelect(t.value,n)}},{default:(0,v.withCtx)(()=>[(0,v.createElementVNode)(`span`,{style:(0,v.normalizeStyle)({fontSize:t.value})},(0,v.toDisplayString)(t.name),5)]),_:2},1032,[`selected`,`onClick`]))),128))]),_:1},8,[`is-active`,`tooltip-message`,`data-qa`,`tabindex`,`icon`,`onShiftFocusRight`,`onShiftFocusLeft`])):g.buttonType===`custom`&&g.selector===`fontColor`?(0,v.withDirectives)(((0,v.openBlock)(),(0,v.createBlock)(f,{key:a.getButtonKey(r.key,g.selector),ref_for:!0,ref:a.getButtonRef(r.key,g.selector),kind:`muted`,importance:`clear`,size:100,active:e.$refs.richTextEditor?.editor?.isActive(g.selector),tabindex:a.canFocus(a.getButtonRef(r.key,g.selector))?0:-1,"aria-label":g.tooltipMessage,"data-qa":g.dataQA,onKeydown:[(0,v.withKeys)((0,v.withModifiers)(a.shiftActionBarFocusRight,[`stop`]),[`right`]),(0,v.withKeys)((0,v.withModifiers)(a.shiftActionBarFocusLeft,[`stop`]),[`left`])],onClick:e=>g.onClick()},{icon:(0,v.withCtx)(()=>[((0,v.openBlock)(),(0,v.createBlock)((0,v.resolveDynamicComponent)(g.icon),{size:`200`,style:(0,v.normalizeStyle)(a.isDefaultFontColor?{}:{color:i.currentFontColor})},null,8,[`style`])),(0,v.createVNode)(s,{value:i.currentFontColor,class:`d-w0 d-h0 d-of-hidden`,"input-class":`colorPickerInput d-w0 d-h0 d-p-0 d-bar-0`,"input-wrapper-class":`d-w0 d-h0 d-ba-none`,size:200,type:`color`,"onUpdate:modelValue":a.onColorPickerInput,onClick:t[1]||(t[1]=(0,v.withModifiers)(()=>{},[`stop`]))},null,8,[`value`,`onUpdate:modelValue`])]),_:2},1032,[`active`,`tabindex`,`aria-label`,`data-qa`,`onKeydown`,`onClick`])),[[S,{message:g.tooltipMessage,placement:`top`,externalAnchorElement:e.$refs[a.getButtonRef(r.key,g.selector)]?.$el}]]):g.buttonType===`popover`&&g.selector===`variable`?((0,v.openBlock)(),(0,v.createBlock)(u,{key:a.getButtonKey(r.key,g.selector),ref_for:!0,ref:a.getButtonRef(r.key,g.selector),"is-active":!1,"tooltip-message":g.tooltipMessage,"data-qa":g.dataQA,"popover-data-qa":`dt-recipe-editor-variable-popover`,tabindex:a.canFocus(a.getButtonRef(r.key,g.selector))?0:-1,icon:g.icon,onShiftFocusRight:a.shiftActionBarFocusRight,onShiftFocusLeft:a.shiftActionBarFocusLeft},{content:(0,v.withCtx)(({close:e})=>[(0,v.createVNode)(l,{label:``,"show-label":!1,"show-list":!0,"click-on-select":!0,onEscape:t=>e()},{input:(0,v.withCtx)(({inputProps:e})=>[(0,v.createVNode)(s,(0,v.mergeProps)({ref_for:!0},e,{modelValue:i.variableSearchValue,"onUpdate:modelValue":t[2]||(t[2]=e=>i.variableSearchValue=e),class:`d-p-100 d-pbe-50 d-w264`,type:`search`,placeholder:i.i18n.$t(`DIALTONE_EDITOR_VARIABLE_POPOVER_SEARCH_PLACEHOLDER`),size:300,role:`menuitem`}),{startIcon:(0,v.withCtx)(({iconSize:e})=>[(0,v.createVNode)(o,{size:e},null,8,[`size`])]),_:1},16,[`modelValue`,`placeholder`])]),list:(0,v.withCtx)(({listProps:t})=>[(0,v.createElementVNode)(`div`,(0,v.mergeProps)({ref_for:!0},t),[((0,v.openBlock)(!0),(0,v.createElementBlock)(v.Fragment,null,(0,v.renderList)(a.filteredCategories,(t,n)=>((0,v.openBlock)(),(0,v.createBlock)(m,{key:t.name,heading:t.name,"heading-class":`d-headline--sm-compact d-p-100`},{default:(0,v.withCtx)(()=>[((0,v.openBlock)(!0),(0,v.createElementBlock)(v.Fragment,null,(0,v.renderList)(a.getFilteredItemsForCategory(t),n=>((0,v.openBlock)(),(0,v.createBlock)(c,{key:t.name+n.name,role:`option`,"navigation-type":`arrow-keys`,onClick:r=>{a.insertVariable(t.name,n),e(a.focusEditor)}},{default:(0,v.withCtx)(()=>[(0,v.createTextVNode)((0,v.toDisplayString)(n.name),1)]),_:2},1032,[`onClick`]))),128)),n<a.filteredCategories.length-1?((0,v.openBlock)(),(0,v.createBlock)(p,{key:0})):(0,v.createCommentVNode)(``,!0)]),_:2},1032,[`heading`]))),128))],16)]),_:2},1032,[`onEscape`])]),_:1},8,[`tooltip-message`,`data-qa`,`tabindex`,`icon`,`onShiftFocusRight`,`onShiftFocusLeft`])):g.buttonType===`button`?((0,v.openBlock)(),(0,v.createBlock)(h,{key:a.getButtonKey(r.key,g.selector),ref_for:!0,ref:a.getButtonRef(r.key,g.selector),"is-active":e.$refs.richTextEditor?.editor?.isActive(g.selector),"tooltip-message":g.tooltipMessage,"data-qa":g.dataQA,tabindex:a.canFocus(a.getButtonRef(r.key,g.selector))?0:-1,icon:g.icon,label:g.label,"on-click":g.onClick,onShiftFocusRight:a.shiftActionBarFocusRight,onShiftFocusLeft:a.shiftActionBarFocusLeft},null,8,[`is-active`,`tooltip-message`,`data-qa`,`tabindex`,`icon`,`label`,`on-click`,`onShiftFocusRight`,`onShiftFocusLeft`])):(0,v.createCommentVNode)(``,!0)],64))),256)),t[7]||(t[7]=(0,v.createElementVNode)(`div`,{class:`d-recipe-editor__button-group-divider`},null,-1))]),_:2},1024))),128)),a.linkButton.showBtn?((0,v.openBlock)(),(0,v.createBlock)(g,{key:0,direction:`row`,gap:`50`},{default:(0,v.withCtx)(()=>[(0,v.createVNode)(y,{open:i.showLinkInput,"show-close-button":!1,"data-qa":`dt-recipe-editor-link-input-popover`,padding:`none`,placement:`bottom-start`,onClick:[a.onInputFocus,(0,v.withModifiers)(a.onInputFocus,[`stop`])],onOpened:a.updateInput},{anchor:(0,v.withCtx)(()=>[((0,v.openBlock)(),(0,v.createBlock)(_,{key:a.linkButton.key,message:a.linkButton.tooltipMessage,placement:`top`},{anchor:(0,v.withCtx)(()=>[(0,v.createVNode)(f,{ref:a.getButtonRef(`custom`,`link`),active:e.$refs.richTextEditor?.editor?.isActive(a.linkButton.selector),"aria-label":a.linkButton.tooltipMessage,"data-qa":a.linkButton.dataQA,tabindex:a.canFocus(a.getButtonRef(`custom`,`link`))?0:-1,importance:`clear`,kind:`muted`,size:100,onClick:t[3]||(t[3]=e=>a.linkButton.onClick()),onKeydown:[(0,v.withKeys)((0,v.withModifiers)(a.shiftActionBarFocusRight,[`stop`]),[`right`]),(0,v.withKeys)((0,v.withModifiers)(a.shiftActionBarFocusLeft,[`stop`]),[`left`])]},{icon:(0,v.withCtx)(()=>[((0,v.openBlock)(),(0,v.createBlock)((0,v.resolveDynamicComponent)(a.linkButton.icon),{size:`200`}))]),_:1},8,[`active`,`aria-label`,`data-qa`,`tabindex`,`onKeydown`])]),_:1},8,[`message`]))]),content:(0,v.withCtx)(()=>[(0,v.createElementVNode)(`div`,x,[(0,v.createElementVNode)(`span`,null,(0,v.toDisplayString)(a.showAddLinkButtonLabels.title),1),(0,v.createVNode)(s,{modelValue:i.linkInput,"onUpdate:modelValue":t[4]||(t[4]=e=>i.linkInput=e),"input-aria-label":a.showAddLinkButtonLabels[`aria-label`],placeholder:n.setLinkPlaceholder,"data-qa":`dt-recipe-editor-link-input`,"input-wrapper-class":`d-recipe-editor-link__input-wrapper`,onClick:[a.onInputFocus,(0,v.withModifiers)(a.onInputFocus,[`stop`])],onFocus:a.onInputFocus,onKeydown:(0,v.withKeys)(a.setLink,[`enter`])},null,8,[`modelValue`,`input-aria-label`,`placeholder`,`onClick`,`onFocus`,`onKeydown`])])]),footerContent:(0,v.withCtx)(()=>[(0,v.createVNode)(g,{direction:`row`,gap:`50`,class:`d-recipe-editor__popover-footer`},{default:(0,v.withCtx)(()=>[(0,v.createVNode)(f,(0,v.mergeProps)({"data-qa":`dt-recipe-editor-remove-link-btn`,importance:`clear`,kind:`muted`,size:200},a.removeLinkButtonLabels,{onClick:a.removeLink}),{default:(0,v.withCtx)(()=>[(0,v.createTextVNode)((0,v.toDisplayString)(a.removeLinkButtonLabels.title),1)]),_:1},16,[`onClick`]),(0,v.createVNode)(f,(0,v.mergeProps)({"data-qa":`dt-recipe-editor-set-link-cancel-btn`,importance:`clear`,kind:`muted`,size:200},a.cancelSetLinkButtonLabels,{onClick:a.closeLinkInput}),{default:(0,v.withCtx)(()=>[(0,v.createTextVNode)((0,v.toDisplayString)(a.cancelSetLinkButtonLabels.title),1)]),_:1},16,[`onClick`]),(0,v.createVNode)(f,(0,v.mergeProps)({"data-qa":`dt-recipe-editor-set-link-confirm-btn`,size:200},a.confirmSetLinkButtonLabels,{onClick:a.setLink}),{default:(0,v.withCtx)(()=>[(0,v.createTextVNode)((0,v.toDisplayString)(a.confirmSetLinkButtonLabels.title),1)]),_:1},16,[`onClick`])]),_:1})]),_:1},8,[`open`,`onClick`,`onOpened`])]),_:1})):(0,v.createCommentVNode)(``,!0)]),_:1}),(0,v.createElementVNode)(`div`,{style:(0,v.normalizeStyle)({"max-height":n.maxHeight}),class:(0,v.normalizeClass)([`d-recipe-editor__content`,{"d-recipe-editor__content-image-resize":n.allowImageResize}])},[(0,v.createVNode)(b,(0,v.mergeProps)({ref:`richTextEditor`,modelValue:i.internalInputValue,"onUpdate:modelValue":t[5]||(t[5]=e=>i.internalInputValue=e),"allow-font-color":!0,"allow-font-family":!0,"allow-inline-images":!0,"allow-line-breaks":!0,"allow-variable":!0,"allow-font-size":n.showFontSizeButton,"allow-background-color":n.allowBackgroundColor,"allow-line-height":n.allowLineHeight,"variable-items":a.flattenedVariableItems,"show-link-bubble-menu":!1,"auto-focus":n.autoFocus,editable:n.editable,"input-aria-label":n.inputAriaLabel,"input-class":`d-recipe-editor__content-input ${n.inputClass}`,link:!0,"output-format":a.htmlOutputFormat,placeholder:n.placeholder,"preserve-whitespace":n.preserveWhitespace,"use-div-tags":n.useDivTags,"allow-tables":n.allowTables,"allow-image-resize":n.allowImageResize,"data-qa":`dt-rich-text-editor`},a.removeClassStyleAttrs(e.$attrs),{onTextInput:a.onTextInput,onBlur:a.onBlur,onFocus:a.onFocus,"onUpdate:modelValue":a.onUpdateModelValue,onSelected:a.onSelected}),null,16,[`modelValue`,`allow-font-size`,`allow-background-color`,`allow-line-height`,`variable-items`,`auto-focus`,`editable`,`input-aria-label`,`input-class`,`output-format`,`placeholder`,`preserve-whitespace`,`use-div-tags`,`allow-tables`,`allow-image-resize`,`onTextInput`,`onBlur`,`onFocus`,`onUpdate:modelValue`,`onSelected`])],6)],6)}var C=t.t(b,[[`render`,S]]);exports.default=C;
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/utils/index.cjs`),t=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),n=require(`../../localization/index.cjs`),r=require(`../button/button.cjs`),i=require(`../list-item/list-item.cjs`),a=require(`../../Combobox-CYEmi3dv.cjs`),o=require(`../stack/stack.cjs`),s=require(`../tooltip/tooltip.cjs`),c=require(`../popover/popover.cjs`),l=require(`../dropdown/dropdown-separator.cjs`),u=require(`../input/input.cjs`),d=require(`../list-item-group/list-item-group.cjs`),f=require(`../../RichTextEditor-B9NGgB03.cjs`),p=require(`../rich-text-editor/rich-text-editor-constants.cjs`),m=require(`./editor-constants.cjs`),h=require(`./editor-toolbar-button.cjs`),g=require(`./editor-toolbar-dropdown-button.cjs`),_=require(`./editor-toolbar-popover-button.cjs`);let v=require(`vue`),y=require(`@dialpad/dialtone-icons/vue`);var b={compatConfig:{MODE:3},name:`DtRecipeEditor`,components:{DtListItemGroup:d.default,DtDropdownSeparator:l.default,DtListItem:i.default,DtRichTextEditor:f.t,DtButton:r.default,DtPopover:c.default,DtStack:o.default,DtInput:u.default,DtTooltip:s.default,DtCombobox:a.t,EditorToolbarButton:h.default,EditorToolbarDropdownButton:g.default,EditorToolbarPopoverButton:_.default,DtIconQuickReply:y.DtIconQuickReply,DtIconBold:y.DtIconBold,DtIconItalic:y.DtIconItalic,DtIconUnderline:y.DtIconUnderline,DtIconStrikethrough:y.DtIconStrikethrough,DtIconListBullet:y.DtIconListBullet,DtIconListOrdered:y.DtIconListOrdered,DtIconAlignLeft:y.DtIconAlignLeft,DtIconAlignCenter:y.DtIconAlignCenter,DtIconAlignRight:y.DtIconAlignRight,DtIconAlignJustify:y.DtIconAlignJustify,DtIconQuote:y.DtIconQuote,DtIconCodeBlock:y.DtIconCodeBlock,DtIconLink2:y.DtIconLink2,DtIconImage:y.DtIconImage,DtIconSearch:y.DtIconSearch,DtIconType:y.DtIconType,DtIconBraces:y.DtIconBraces,DtIconChevronDown:y.DtIconChevronDown,DtIconFontSize:y.DtIconFontSize,DtIconStopFilled:y.DtIconStopFilled},mixins:[],inheritAttrs:!1,props:{modelValue:{type:[Object,String],default:``},editable:{type:Boolean,default:!0},inputAriaLabel:{type:String,required:!0,default:``},inputClass:{type:String,default:``},autoFocus:{type:[Boolean,String,Number],default:!1,validator(e){return typeof e==`string`?p.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(e):!0}},placeholder:{type:String,default:``},maxHeight:{type:String,default:`unset`},setLinkPlaceholder:{type:String,default:``},showBoldButton:{type:Boolean,default:!0},showItalicsButton:{type:Boolean,default:!0},showUnderlineButton:{type:Boolean,default:!0},showStrikeButton:{type:Boolean,default:!0},showListItemsButton:{type:Boolean,default:!0},showOrderedListButton:{type:Boolean,default:!0},showAlignLeftButton:{type:Boolean,default:!0},showAlignCenterButton:{type:Boolean,default:!0},showAlignRightButton:{type:Boolean,default:!0},showAlignJustifyButton:{type:Boolean,default:!0},showQuoteButton:{type:Boolean,default:!0},showCodeBlockButton:{type:Boolean,default:!0},showQuickRepliesButton:{type:Boolean,default:!0},showInlineImageButton:{type:Boolean,default:!1},showVariableButton:{type:Boolean,default:!1},variableCategories:{type:Array,default:()=>[]},showAddLink:{type:Object,default:()=>({showAddLinkButton:!0})},showFontStyleButton:{type:Boolean,default:!1},showFontSizeButton:{type:Boolean,default:!1},showFontColorButton:{type:Boolean,default:!1},fontStyles:{type:Array,default:()=>[{name:`Arial`,value:null},{name:`Georgia`,value:`Georgia`},{name:`Helvetica`,value:`Helvetica`},{name:`Verdana`,value:`Verdana`},{name:`Times New Roman`,value:`Times New Roman`}]},fontSizes:{type:Array,default:()=>[{name:`Small`,value:`12px`},{name:`Normal`,value:`15px`},{name:`Large`,value:`24px`},{name:`Huge`,value:`36px`}]},allowBackgroundColor:{type:Boolean,default:!1},allowLineHeight:{type:Boolean,default:!1},preserveWhitespace:{type:[Boolean,String],default:`full`},useDivTags:{type:Boolean,default:!1},allowTables:{type:Boolean,default:!1},allowImageResize:{type:Boolean,default:!1}},emits:[`focus`,`blur`,`update:modelValue`,`quick-replies-click`,`inline-image-click`,`text-input`],data(){return{internalInputValue:this.modelValue,hasFocus:!1,linkOptions:{class:`d-recipe-editor__link`},currentFontColor:void 0,showLinkInput:!1,fontStyleSearch:``,linkInput:``,currentButtonRefIndex:0,variableSearchValue:``,i18n:new n.DialtoneLocalization}},computed:{inputLength(){return this.internalInputValue.length},htmlOutputFormat(){return p.RICH_TEXT_EDITOR_OUTPUT_FORMATS[2]},flattenedVariableItems(){return this.variableCategories?this.variableCategories.reduce((e,t)=>e.concat(t.items||[]),[]):[]},showingTextFormatButtons(){return this.showBoldButton||this.showItalicsButton||this.showStrikeButton||this.showUnderlineButton},showingAlignmentButtons(){return this.showAlignLeftButton||this.showAlignCenterButton||this.showAlignRightButton||this.showAlignJustifyButton},showingListButtons(){return this.showListItemsButton||this.showOrderedListButton},orderedRefs(){let e=this.buttonGroups.reduce(function(e,t){return t.buttonGroup.forEach(n=>{e.push(this.getButtonRef(t.key,n.selector))},this),e}.bind(this),[]);return e.push(this.getButtonRef(`custom`,`link`)),e},buttonGroups(){let e=this.individualButtons.map(e=>({key:e.selector,buttonGroup:[e]}));return[{key:`new`,buttonGroup:this.newButtons},{key:`format`,buttonGroup:this.textFormatButtons},{key:`alignment`,buttonGroup:this.alignmentButtons},{key:`list`,buttonGroup:this.listButtons},...e].filter(e=>e.buttonGroup.length>0)},newButtons(){return[{showBtn:this.showQuickRepliesButton,buttonType:`button`,label:this.i18n.$t(`DIALTONE_EDITOR_QUICK_REPLY_BUTTON_LABEL`),selector:`quickReplies`,icon:y.DtIconQuickReply,dataQA:`dt-recipe-editor-quick-replies-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_QUICK_REPLY_BUTTON_LABEL`),onClick:this.onQuickRepliesClick}].filter(e=>e.showBtn)},textFormatButtons(){return[{showBtn:this.showFontStyleButton,buttonType:`popover`,selector:`fontStyle`,icon:y.DtIconType,dataQA:`dt-recipe-editor-font-style-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_FONT_STYLE_BUTTON_LABEL`)},{showBtn:this.showFontSizeButton,buttonType:`popover`,selector:`fontSize`,icon:y.DtIconFontSize,dataQA:`dt-recipe-editor-font-size-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_FONT_SIZE_BUTTON_LABEL`)},{showBtn:this.showFontColorButton,buttonType:`custom`,selector:`fontColor`,icon:y.DtIconStopFilled,dataQA:`dt-recipe-editor-font-color-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_FONT_COLOR_BUTTON_LABEL`),onClick:this.onColorPickerButtonClick},{showBtn:this.showBoldButton,buttonType:`button`,selector:`bold`,icon:y.DtIconBold,dataQA:`dt-recipe-editor-bold-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_BOLD_BUTTON_LABEL`),onClick:this.onBoldTextToggle},{showBtn:this.showItalicsButton,buttonType:`button`,selector:`italic`,icon:y.DtIconItalic,dataQA:`dt-recipe-editor-italics-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_ITALICS_BUTTON_LABEL`),onClick:this.onItalicTextToggle},{showBtn:this.showUnderlineButton,buttonType:`button`,selector:`underline`,icon:y.DtIconUnderline,dataQA:`dt-recipe-editor-underline-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_UNDERLINE_BUTTON_LABEL`),onClick:this.onUnderlineTextToggle},{showBtn:this.showStrikeButton,buttonType:`button`,selector:`strike`,icon:y.DtIconStrikethrough,dataQA:`dt-recipe-editor-strike-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_STRIKE_BUTTON_LABEL`),onClick:this.onStrikethroughTextToggle}].filter(e=>e.showBtn)},alignmentButtons(){return[{showBtn:this.showAlignLeftButton,buttonType:`button`,selector:{textAlign:`left`},icon:y.DtIconAlignLeft,dataQA:`dt-recipe-editor-align-left-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_ALIGN_LEFT_BUTTON_LABEL`),onClick:()=>this.onTextAlign(`left`)},{showBtn:this.showAlignCenterButton,buttonType:`button`,selector:{textAlign:`center`},icon:y.DtIconAlignCenter,dataQA:`dt-recipe-editor-align-center-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_ALIGN_CENTER_BUTTON_LABEL`),onClick:()=>this.onTextAlign(`center`)},{showBtn:this.showAlignRightButton,buttonType:`button`,selector:{textAlign:`right`},icon:y.DtIconAlignRight,dataQA:`dt-recipe-editor-align-right-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_ALIGN_RIGHT_BUTTON_LABEL`),onClick:()=>this.onTextAlign(`right`)},{showBtn:this.showAlignJustifyButton,buttonType:`button`,selector:{textAlign:`justify`},icon:y.DtIconAlignJustify,dataQA:`dt-recipe-editor-align-justify-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_ALIGN_JUSTIFY_BUTTON_LABEL`),onClick:()=>this.onTextAlign(`justify`)}].filter(e=>e.showBtn)},listButtons(){return[{showBtn:this.showListItemsButton,buttonType:`button`,selector:`bulletList`,icon:y.DtIconListBullet,dataQA:`dt-recipe-editor-list-items-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_BULLET_LIST_BUTTON_LABEL`),onClick:this.onBulletListToggle},{showBtn:this.showOrderedListButton,buttonType:`button`,selector:`orderedList`,icon:y.DtIconListOrdered,dataQA:`dt-recipe-editor-ordered-list-items-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_ORDERED_LIST_BUTTON_LABEL`),onClick:this.onOrderedListToggle}].filter(e=>e.showBtn)},individualButtons(){return[{showBtn:this.showQuoteButton,buttonType:`button`,selector:`blockquote`,icon:y.DtIconQuote,dataQA:`dt-recipe-editor-blockquote-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_QUOTE_BUTTON_LABEL`),onClick:this.onBlockquoteToggle},{showBtn:this.showCodeBlockButton,buttonType:`button`,selector:`codeBlock`,icon:y.DtIconCodeBlock,dataQA:`dt-recipe-editor-code-block-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_CODE_BUTTON_LABEL`),onClick:this.onCodeBlockToggle},{showBtn:this.showInlineImageButton,buttonType:`button`,selector:`image`,icon:y.DtIconImage,dataQA:`dt-recipe-editor-inline-image-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_IMAGE_BUTTON_LABEL`),onClick:this.onInsertInlineImageClick},{showBtn:this.showVariableButton,buttonType:`popover`,selector:`variable`,icon:y.DtIconBraces,dataQA:`dt-recipe-editor-variable-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_VARIABLE_BUTTON_LABEL`)}].filter(e=>e.showBtn)},linkButton(){return{showBtn:this.showAddLink.showAddLinkButton,buttonType:`custom`,selector:`link`,icon:y.DtIconLink2,dataQA:`dt-recipe-editor-add-link-btn`,tooltipMessage:this.i18n.$t(`DIALTONE_EDITOR_LINK_BUTTON_LABEL`),onClick:this.openLinkInput}},confirmSetLinkButtonLabels(){return this.i18n.$ta(`DIALTONE_EDITOR_CONFIRM_SET_LINK_BUTTON`)},cancelSetLinkButtonLabels(){return this.i18n.$ta(`DIALTONE_EDITOR_CANCEL_SET_LINK_BUTTON`)},removeLinkButtonLabels(){return this.i18n.$ta(`DIALTONE_EDITOR_REMOVE_LINK_BUTTON`)},showAddLinkButtonLabels(){return this.i18n.$ta(`DIALTONE_EDITOR_ADD_LINK_BUTTON`)},filteredFontStyles(){let e=this.fontStyleSearch.toLowerCase();return this.fontStyles.filter(t=>t.name.toLowerCase().includes(e))},filteredCategories(){return this.variableCategories.filter(e=>this.getFilteredItemsForCategory(e).length)},colorPickerInput(){return this.$refs.editorRoot?.querySelector(`.colorPickerInput`)},isDefaultFontColor(){return this.currentFontColor===m.EDITOR_DEFAULT_FONT_COLOR},actionBarBtn(){let e=this.$refs[this.orderedRefs[this.currentButtonRefIndex]][0]?.$refs?.buttonRef||this.$refs[this.orderedRefs[this.currentButtonRefIndex]];return Array.isArray(e)?e[0]:e}},watch:{modelValue(e){this.internalInputValue=e}},methods:{removeClassStyleAttrs:e.removeClassStyleAttrs,focusEditor(){this.$refs.richTextEditor?.editor?.commands.focus()},onInputFocus(e){e?.stopPropagation()},removeLink(){this.$refs.richTextEditor?.editor?.chain()?.focus()?.unsetLink()?.run(),this.closeLinkInput()},setLink(e){let t=this.$refs.richTextEditor?.editor;if(e?.preventDefault(),e?.stopPropagation(),!this.linkInput){this.removeLink();return}m.EDITOR_SUPPORTED_LINK_PROTOCOLS.find(e=>e.test(this.linkInput))||(this.linkInput=`${m.EDITOR_DEFAULT_LINK_PREFIX}${this.linkInput}`);let n=t?.view?.state?.selection;n.anchor===n.head?t.chain().focus().insertContentAt(n.anchor,`<a class="${this.linkOptions.class}" href=${this.linkInput}>${this.linkInput}</a>`).run():t.chain().focus().extendMarkRange(`link`).setLink({href:this.linkInput,class:this.linkOptions.class}).run(),this.closeLinkInput()},openLinkInput(){this.showLinkInput=!0},updateInput(e){if(!e)return this.closeLinkInput();this.linkInput=this.$refs.richTextEditor?.editor?.getAttributes(`link`)?.href},closeLinkInput(){this.showLinkInput=!1,this.linkInput=``,this.$refs.richTextEditor.editor?.chain().focus()},onBoldTextToggle(){this.$refs.richTextEditor?.editor?.chain().focus().toggleBold().run()},onItalicTextToggle(){this.$refs.richTextEditor?.editor.chain().focus().toggleItalic().run()},onUnderlineTextToggle(){this.$refs.richTextEditor?.editor.chain().focus().toggleUnderline().run()},onStrikethroughTextToggle(){this.$refs.richTextEditor?.editor.chain().focus().toggleStrike().run()},onTextAlign(e){if(this.$refs.richTextEditor?.editor?.isActive({textAlign:e}))return this.$refs.richTextEditor?.editor.chain().focus().unsetTextAlign().run();this.$refs.richTextEditor?.editor.chain().focus().setTextAlign(e).run()},onBulletListToggle(){this.$refs.richTextEditor?.editor.chain().focus().toggleBulletList().run()},onOrderedListToggle(){this.$refs.richTextEditor?.editor.chain().focus().toggleOrderedList().run()},onCodeBlockToggle(){this.$refs.richTextEditor?.editor.chain().focus().toggleCodeBlock().run()},onQuickRepliesClick(){this.$emit(`quick-replies-click`)},onInsertInlineImageClick(){this.$emit(`inline-image-click`)},insertVariable(e,t){this.$refs.richTextEditor?.editor.chain().focus().insertVariable({id:t.id,placeholder:t.placeholder||``,altText:``,enableAltText:t.enableAltText}).run()},insertInlineImage(e){this.$refs.richTextEditor?.editor.chain().focus().setImage({src:e}).run()},insertInMessageBody(e){this.$refs.richTextEditor?.editor.chain().focus().insertContent(e).run()},setCursorPosition(e=null){this.$refs.richTextEditor?.editor.chain().focus(e).run()},onBlockquoteToggle(){this.$refs.richTextEditor?.editor.chain().focus().toggleBlockquote().run()},onTextInput(e){this.$emit(`text-input`,e)},onFocus(e){this.hasFocus=!0,this.$emit(`focus`,e)},onBlur(e){this.hasFocus=!1,this.$emit(`blur`,e)},onUpdateModelValue(e){this.$emit(`update:modelValue`,e)},onSelected(){this.updateFontColorInput()},getButtonKey(e,t){return`${e}-${JSON.stringify(t)}`},getButtonRef(e,t){return`${this.getButtonKey(e,t)}-ref`},canFocus(e){return e===this.orderedRefs[this.currentButtonRefIndex]},shiftActionBarFocusRight(){this.shiftButtonRefIndex(1)},shiftActionBarFocusLeft(){this.shiftButtonRefIndex(-1)},shiftButtonRefIndex(e){let t=this.actionBarBtn,n=(this.currentButtonRefIndex+e)%this.orderedRefs.length;this.currentButtonRefIndex=n>=0?n:this.orderedRefs.length+n;let r=this.actionBarBtn;t.$el.blur(),r.$el.focus()},onFontStyleSelect(e){e?this.$refs.richTextEditor?.editor?.chain().focus().setFontFamily(e).run():this.$refs.richTextEditor?.editor?.chain().focus().unsetFontFamily().run(),this.$refs.richTextEditor?.editor?.commands.focus()},isCurrentFontFamily(e){return e?this.$refs.richTextEditor?.editor?.isActive(`textStyle`,{fontFamily:e}):!this.$refs.richTextEditor?.editor?.getAttributes(`textStyle`)?.fontFamily},onFontSizeSelect(e){this.$refs.richTextEditor?.editor?.chain().focus().setFontSize(e).run(),this.$refs.richTextEditor?.editor?.commands.focus()},isCurrentFontSize(e){return e?this.$refs.richTextEditor?.editor?.isActive(`textStyle`,{fontSize:e}):!this.$refs.richTextEditor?.editor?.getAttributes(`textStyle`)?.fontSize},getFilteredItemsForCategory(e){let t=this.variableSearchValue.toLowerCase();return e.name.toLowerCase().includes(t)?e.items:e.items.filter(e=>e.name.toLowerCase().includes(t))},updateFontColorInput(){this.currentFontColor=this.$refs.richTextEditor?.editor?.getAttributes(`textStyle`)?.color||`#000000`},onColorPickerButtonClick(){this.colorPickerInput?.click()},onColorPickerInput(e){this.$refs.richTextEditor?.editor?.chain().focus().setColor(e).run(),this.$refs.richTextEditor?.editor?.commands.focus(),this.updateFontColorInput()}}},x={class:`d-recipe-editor__popover-content`};function S(e,t,n,r,i,a){let o=(0,v.resolveComponent)(`dt-icon-search`),s=(0,v.resolveComponent)(`dt-input`),c=(0,v.resolveComponent)(`dt-list-item`),l=(0,v.resolveComponent)(`dt-combobox`),u=(0,v.resolveComponent)(`editor-toolbar-popover-button`),d=(0,v.resolveComponent)(`editor-toolbar-dropdown-button`),f=(0,v.resolveComponent)(`dt-button`),p=(0,v.resolveComponent)(`dt-dropdown-separator`),m=(0,v.resolveComponent)(`dt-list-item-group`),h=(0,v.resolveComponent)(`editor-toolbar-button`),g=(0,v.resolveComponent)(`dt-stack`),_=(0,v.resolveComponent)(`dt-tooltip`),y=(0,v.resolveComponent)(`dt-popover`),b=(0,v.resolveComponent)(`dt-rich-text-editor`),S=(0,v.resolveDirective)(`dt-tooltip`);return(0,v.openBlock)(),(0,v.createElementBlock)(`div`,{ref:`editorRoot`,class:(0,v.normalizeClass)([`d-recipe-editor`,e.$attrs.class]),style:(0,v.normalizeStyle)(e.$attrs.style),"data-qa":`dt-recipe-editor`,role:`presentation`,onClick:t[6]||(t[6]=t=>e.$refs.richTextEditor.focusEditor())},[(0,v.createVNode)(g,{class:`d-recipe-editor__top-bar`,direction:`row`,gap:`150`},{default:(0,v.withCtx)(()=>[((0,v.openBlock)(!0),(0,v.createElementBlock)(v.Fragment,null,(0,v.renderList)(a.buttonGroups,r=>((0,v.openBlock)(),(0,v.createBlock)(g,{key:r.key,direction:`row`,gap:`50`},{default:(0,v.withCtx)(()=>[((0,v.openBlock)(!0),(0,v.createElementBlock)(v.Fragment,null,(0,v.renderList)(r.buttonGroup,g=>((0,v.openBlock)(),(0,v.createElementBlock)(v.Fragment,null,[g.buttonType===`popover`&&g.selector===`fontStyle`?((0,v.openBlock)(),(0,v.createBlock)(u,{key:a.getButtonKey(r.key,g.selector),ref_for:!0,ref:a.getButtonRef(r.key,g.selector),"is-active":e.$refs.richTextEditor?.editor?.isActive(g.selector),"tooltip-message":g.tooltipMessage,"data-qa":g.dataQA,"popover-data-qa":`dt-recipe-editor-font-style-input-popover`,tabindex:a.canFocus(a.getButtonRef(r.key,g.selector))?0:-1,icon:g.icon,onShiftFocusRight:a.shiftActionBarFocusRight,onShiftFocusLeft:a.shiftActionBarFocusLeft},{content:(0,v.withCtx)(({close:e})=>[(0,v.createVNode)(l,{label:``,"show-label":!1,"show-list":!0,"click-on-select":!0,onEscape:t=>e()},{input:(0,v.withCtx)(({inputProps:e})=>[(0,v.createVNode)(s,(0,v.mergeProps)({ref_for:!0},e,{modelValue:i.fontStyleSearch,"onUpdate:modelValue":t[0]||(t[0]=e=>i.fontStyleSearch=e),class:`d-p-100 d-pbe-50 d-w216`,type:`search`,placeholder:i.i18n.$t(`DIALTONE_EDITOR_FONT_STYLE_SEARCH_PLACEHOLDER`),size:200,role:`menuitem`}),{startIcon:(0,v.withCtx)(({iconSize:e})=>[(0,v.createVNode)(o,{size:e},null,8,[`size`])]),_:1},16,[`modelValue`,`placeholder`])]),list:(0,v.withCtx)(({listProps:t})=>[(0,v.createElementVNode)(`ul`,(0,v.mergeProps)({ref_for:!0},t),[((0,v.openBlock)(!0),(0,v.createElementBlock)(v.Fragment,null,(0,v.renderList)(a.filteredFontStyles,t=>((0,v.openBlock)(),(0,v.createBlock)(c,{key:t.name,selected:a.isCurrentFontFamily(t.value),style:(0,v.normalizeStyle)({fontFamily:t.value||`inherit`}),role:`option`,"navigation-type":`arrow-keys`,onClick:n=>{e(a.focusEditor),a.onFontStyleSelect(t.value)}},{default:(0,v.withCtx)(()=>[(0,v.createTextVNode)((0,v.toDisplayString)(t.name),1)]),_:2},1032,[`selected`,`style`,`onClick`]))),128))],16)]),_:2},1032,[`onEscape`])]),_:1},8,[`is-active`,`tooltip-message`,`data-qa`,`tabindex`,`icon`,`onShiftFocusRight`,`onShiftFocusLeft`])):g.buttonType===`popover`&&g.selector===`fontSize`?((0,v.openBlock)(),(0,v.createBlock)(d,{key:a.getButtonKey(r.key,g.selector),ref_for:!0,ref:a.getButtonRef(r.key,g.selector),"is-active":e.$refs.richTextEditor?.editor?.isActive(g.selector),"tooltip-message":g.tooltipMessage,"data-qa":g.dataQA,"dropdown-data-qa":`dt-recipe-editor-font-size-input-popover`,tabindex:a.canFocus(a.getButtonRef(r.key,g.selector))?0:-1,icon:g.icon,onShiftFocusRight:a.shiftActionBarFocusRight,onShiftFocusLeft:a.shiftActionBarFocusLeft},{list:(0,v.withCtx)(({close:e})=>[((0,v.openBlock)(!0),(0,v.createElementBlock)(v.Fragment,null,(0,v.renderList)(n.fontSizes,t=>((0,v.openBlock)(),(0,v.createBlock)(c,{key:t.name,selected:a.isCurrentFontSize(t.value),role:`menuitem`,"navigation-type":`arrow-keys`,onClick:n=>{e(a.focusEditor),a.onFontSizeSelect(t.value,n)}},{default:(0,v.withCtx)(()=>[(0,v.createElementVNode)(`span`,{style:(0,v.normalizeStyle)({fontSize:t.value})},(0,v.toDisplayString)(t.name),5)]),_:2},1032,[`selected`,`onClick`]))),128))]),_:1},8,[`is-active`,`tooltip-message`,`data-qa`,`tabindex`,`icon`,`onShiftFocusRight`,`onShiftFocusLeft`])):g.buttonType===`custom`&&g.selector===`fontColor`?(0,v.withDirectives)(((0,v.openBlock)(),(0,v.createBlock)(f,{key:a.getButtonKey(r.key,g.selector),ref_for:!0,ref:a.getButtonRef(r.key,g.selector),kind:`muted`,importance:`clear`,size:100,active:e.$refs.richTextEditor?.editor?.isActive(g.selector),tabindex:a.canFocus(a.getButtonRef(r.key,g.selector))?0:-1,"aria-label":g.tooltipMessage,"data-qa":g.dataQA,onKeydown:[(0,v.withKeys)((0,v.withModifiers)(a.shiftActionBarFocusRight,[`stop`]),[`right`]),(0,v.withKeys)((0,v.withModifiers)(a.shiftActionBarFocusLeft,[`stop`]),[`left`])],onClick:e=>g.onClick()},{icon:(0,v.withCtx)(()=>[((0,v.openBlock)(),(0,v.createBlock)((0,v.resolveDynamicComponent)(g.icon),{size:`200`,style:(0,v.normalizeStyle)(a.isDefaultFontColor?{}:{color:i.currentFontColor})},null,8,[`style`])),(0,v.createVNode)(s,{value:i.currentFontColor,class:`d-w0 d-h0 d-of-hidden`,"input-class":`colorPickerInput d-w0 d-h0 d-p-0 d-bar-0`,"input-wrapper-class":`d-w0 d-h0 d-ba-none`,size:200,type:`color`,"onUpdate:modelValue":a.onColorPickerInput,onClick:t[1]||(t[1]=(0,v.withModifiers)(()=>{},[`stop`]))},null,8,[`value`,`onUpdate:modelValue`])]),_:2},1032,[`active`,`tabindex`,`aria-label`,`data-qa`,`onKeydown`,`onClick`])),[[S,{message:g.tooltipMessage,placement:`top`,externalAnchorElement:e.$refs[a.getButtonRef(r.key,g.selector)]?.$el}]]):g.buttonType===`popover`&&g.selector===`variable`?((0,v.openBlock)(),(0,v.createBlock)(u,{key:a.getButtonKey(r.key,g.selector),ref_for:!0,ref:a.getButtonRef(r.key,g.selector),"is-active":!1,"tooltip-message":g.tooltipMessage,"data-qa":g.dataQA,"popover-data-qa":`dt-recipe-editor-variable-popover`,tabindex:a.canFocus(a.getButtonRef(r.key,g.selector))?0:-1,icon:g.icon,onShiftFocusRight:a.shiftActionBarFocusRight,onShiftFocusLeft:a.shiftActionBarFocusLeft},{content:(0,v.withCtx)(({close:e})=>[(0,v.createVNode)(l,{label:``,"show-label":!1,"show-list":!0,"click-on-select":!0,onEscape:t=>e()},{input:(0,v.withCtx)(({inputProps:e})=>[(0,v.createVNode)(s,(0,v.mergeProps)({ref_for:!0},e,{modelValue:i.variableSearchValue,"onUpdate:modelValue":t[2]||(t[2]=e=>i.variableSearchValue=e),class:`d-p-100 d-pbe-50 d-w264`,type:`search`,placeholder:i.i18n.$t(`DIALTONE_EDITOR_VARIABLE_POPOVER_SEARCH_PLACEHOLDER`),size:300,role:`menuitem`}),{startIcon:(0,v.withCtx)(({iconSize:e})=>[(0,v.createVNode)(o,{size:e},null,8,[`size`])]),_:1},16,[`modelValue`,`placeholder`])]),list:(0,v.withCtx)(({listProps:t})=>[(0,v.createElementVNode)(`div`,(0,v.mergeProps)({ref_for:!0},t),[((0,v.openBlock)(!0),(0,v.createElementBlock)(v.Fragment,null,(0,v.renderList)(a.filteredCategories,(t,n)=>((0,v.openBlock)(),(0,v.createBlock)(m,{key:t.name,heading:t.name,"heading-class":`d-headline--sm-compact d-p-100`},{default:(0,v.withCtx)(()=>[((0,v.openBlock)(!0),(0,v.createElementBlock)(v.Fragment,null,(0,v.renderList)(a.getFilteredItemsForCategory(t),n=>((0,v.openBlock)(),(0,v.createBlock)(c,{key:t.name+n.name,role:`option`,"navigation-type":`arrow-keys`,onClick:r=>{a.insertVariable(t.name,n),e(a.focusEditor)}},{default:(0,v.withCtx)(()=>[(0,v.createTextVNode)((0,v.toDisplayString)(n.name),1)]),_:2},1032,[`onClick`]))),128)),n<a.filteredCategories.length-1?((0,v.openBlock)(),(0,v.createBlock)(p,{key:0})):(0,v.createCommentVNode)(``,!0)]),_:2},1032,[`heading`]))),128))],16)]),_:2},1032,[`onEscape`])]),_:1},8,[`tooltip-message`,`data-qa`,`tabindex`,`icon`,`onShiftFocusRight`,`onShiftFocusLeft`])):g.buttonType===`button`?((0,v.openBlock)(),(0,v.createBlock)(h,{key:a.getButtonKey(r.key,g.selector),ref_for:!0,ref:a.getButtonRef(r.key,g.selector),"is-active":e.$refs.richTextEditor?.editor?.isActive(g.selector),"tooltip-message":g.tooltipMessage,"data-qa":g.dataQA,tabindex:a.canFocus(a.getButtonRef(r.key,g.selector))?0:-1,icon:g.icon,label:g.label,"on-click":g.onClick,onShiftFocusRight:a.shiftActionBarFocusRight,onShiftFocusLeft:a.shiftActionBarFocusLeft},null,8,[`is-active`,`tooltip-message`,`data-qa`,`tabindex`,`icon`,`label`,`on-click`,`onShiftFocusRight`,`onShiftFocusLeft`])):(0,v.createCommentVNode)(``,!0)],64))),256)),t[7]||(t[7]=(0,v.createElementVNode)(`div`,{class:`d-recipe-editor__button-group-divider`},null,-1))]),_:2},1024))),128)),a.linkButton.showBtn?((0,v.openBlock)(),(0,v.createBlock)(g,{key:0,direction:`row`,gap:`50`},{default:(0,v.withCtx)(()=>[(0,v.createVNode)(y,{open:i.showLinkInput,"show-close-button":!1,"data-qa":`dt-recipe-editor-link-input-popover`,padding:`none`,placement:`bottom-start`,onClick:[a.onInputFocus,(0,v.withModifiers)(a.onInputFocus,[`stop`])],onOpened:a.updateInput},{anchor:(0,v.withCtx)(()=>[((0,v.openBlock)(),(0,v.createBlock)(_,{key:a.linkButton.key,message:a.linkButton.tooltipMessage,placement:`top`},{anchor:(0,v.withCtx)(()=>[(0,v.createVNode)(f,{ref:a.getButtonRef(`custom`,`link`),active:e.$refs.richTextEditor?.editor?.isActive(a.linkButton.selector),"aria-label":a.linkButton.tooltipMessage,"data-qa":a.linkButton.dataQA,tabindex:a.canFocus(a.getButtonRef(`custom`,`link`))?0:-1,importance:`clear`,kind:`muted`,size:100,onClick:t[3]||(t[3]=e=>a.linkButton.onClick()),onKeydown:[(0,v.withKeys)((0,v.withModifiers)(a.shiftActionBarFocusRight,[`stop`]),[`right`]),(0,v.withKeys)((0,v.withModifiers)(a.shiftActionBarFocusLeft,[`stop`]),[`left`])]},{icon:(0,v.withCtx)(()=>[((0,v.openBlock)(),(0,v.createBlock)((0,v.resolveDynamicComponent)(a.linkButton.icon),{size:`200`}))]),_:1},8,[`active`,`aria-label`,`data-qa`,`tabindex`,`onKeydown`])]),_:1},8,[`message`]))]),content:(0,v.withCtx)(()=>[(0,v.createElementVNode)(`div`,x,[(0,v.createElementVNode)(`span`,null,(0,v.toDisplayString)(a.showAddLinkButtonLabels.title),1),(0,v.createVNode)(s,{modelValue:i.linkInput,"onUpdate:modelValue":t[4]||(t[4]=e=>i.linkInput=e),"input-aria-label":a.showAddLinkButtonLabels[`aria-label`],placeholder:n.setLinkPlaceholder,"data-qa":`dt-recipe-editor-link-input`,"input-wrapper-class":`d-recipe-editor-link__input-wrapper`,onClick:[a.onInputFocus,(0,v.withModifiers)(a.onInputFocus,[`stop`])],onFocus:a.onInputFocus,onKeydown:(0,v.withKeys)(a.setLink,[`enter`])},null,8,[`modelValue`,`input-aria-label`,`placeholder`,`onClick`,`onFocus`,`onKeydown`])])]),footerContent:(0,v.withCtx)(()=>[(0,v.createVNode)(g,{direction:`row`,gap:`50`,class:`d-recipe-editor__popover-footer`},{default:(0,v.withCtx)(()=>[(0,v.createVNode)(f,(0,v.mergeProps)({"data-qa":`dt-recipe-editor-remove-link-btn`,importance:`clear`,kind:`muted`,size:200},a.removeLinkButtonLabels,{onClick:a.removeLink}),{default:(0,v.withCtx)(()=>[(0,v.createTextVNode)((0,v.toDisplayString)(a.removeLinkButtonLabels.title),1)]),_:1},16,[`onClick`]),(0,v.createVNode)(f,(0,v.mergeProps)({"data-qa":`dt-recipe-editor-set-link-cancel-btn`,importance:`clear`,kind:`muted`,size:200},a.cancelSetLinkButtonLabels,{onClick:a.closeLinkInput}),{default:(0,v.withCtx)(()=>[(0,v.createTextVNode)((0,v.toDisplayString)(a.cancelSetLinkButtonLabels.title),1)]),_:1},16,[`onClick`]),(0,v.createVNode)(f,(0,v.mergeProps)({"data-qa":`dt-recipe-editor-set-link-confirm-btn`,size:200},a.confirmSetLinkButtonLabels,{onClick:a.setLink}),{default:(0,v.withCtx)(()=>[(0,v.createTextVNode)((0,v.toDisplayString)(a.confirmSetLinkButtonLabels.title),1)]),_:1},16,[`onClick`])]),_:1})]),_:1},8,[`open`,`onClick`,`onOpened`])]),_:1})):(0,v.createCommentVNode)(``,!0)]),_:1}),(0,v.createElementVNode)(`div`,{style:(0,v.normalizeStyle)({"max-height":n.maxHeight}),class:(0,v.normalizeClass)([`d-recipe-editor__content`,{"d-recipe-editor__content-image-resize":n.allowImageResize}])},[(0,v.createVNode)(b,(0,v.mergeProps)({ref:`richTextEditor`,modelValue:i.internalInputValue,"onUpdate:modelValue":t[5]||(t[5]=e=>i.internalInputValue=e),"allow-font-color":!0,"allow-font-family":!0,"allow-inline-images":!0,"allow-line-breaks":!0,"allow-variable":!0,"allow-font-size":n.showFontSizeButton,"allow-background-color":n.allowBackgroundColor,"allow-line-height":n.allowLineHeight,"variable-items":a.flattenedVariableItems,"show-link-bubble-menu":!1,"auto-focus":n.autoFocus,editable:n.editable,"input-aria-label":n.inputAriaLabel,"input-class":`d-recipe-editor__content-input ${n.inputClass}`,link:!0,"output-format":a.htmlOutputFormat,placeholder:n.placeholder,"preserve-whitespace":n.preserveWhitespace,"use-div-tags":n.useDivTags,"allow-tables":n.allowTables,"allow-image-resize":n.allowImageResize,"data-qa":`dt-rich-text-editor`},a.removeClassStyleAttrs(e.$attrs),{onTextInput:a.onTextInput,onBlur:a.onBlur,onFocus:a.onFocus,"onUpdate:modelValue":a.onUpdateModelValue,onSelected:a.onSelected}),null,16,[`modelValue`,`allow-font-size`,`allow-background-color`,`allow-line-height`,`variable-items`,`auto-focus`,`editable`,`input-aria-label`,`input-class`,`output-format`,`placeholder`,`preserve-whitespace`,`use-div-tags`,`allow-tables`,`allow-image-resize`,`onTextInput`,`onBlur`,`onFocus`,`onUpdate:modelValue`,`onSelected`])],6)],6)}var C=t.t(b,[[`render`,S]]);exports.default=C;
|
|
2
2
|
//# sourceMappingURL=editor.cjs.map
|
|
@@ -3,14 +3,14 @@ import { t } from "../../_plugin-vue_export-helper-BTgDAbhb.js";
|
|
|
3
3
|
import { DialtoneLocalization as n } from "../../localization/index.js";
|
|
4
4
|
import r from "../button/button.js";
|
|
5
5
|
import i from "../list-item/list-item.js";
|
|
6
|
-
import { t as a } from "../../Combobox-
|
|
6
|
+
import { t as a } from "../../Combobox-D8nQeBIf.js";
|
|
7
7
|
import o from "../stack/stack.js";
|
|
8
8
|
import s from "../tooltip/tooltip.js";
|
|
9
9
|
import c from "../popover/popover.js";
|
|
10
10
|
import l from "../dropdown/dropdown-separator.js";
|
|
11
11
|
import u from "../input/input.js";
|
|
12
12
|
import d from "../list-item-group/list-item-group.js";
|
|
13
|
-
import { t as f } from "../../RichTextEditor-
|
|
13
|
+
import { t as f } from "../../RichTextEditor-DxbZSRop.js";
|
|
14
14
|
import { RICH_TEXT_EDITOR_AUTOFOCUS_TYPES as p, RICH_TEXT_EDITOR_OUTPUT_FORMATS as m } from "../rich-text-editor/rich-text-editor-constants.js";
|
|
15
15
|
import { EDITOR_DEFAULT_FONT_COLOR as h, EDITOR_DEFAULT_LINK_PREFIX as g, EDITOR_SUPPORTED_LINK_PROTOCOLS as _ } from "./editor-constants.js";
|
|
16
16
|
import v from "./editor-toolbar-button.js";
|
package/dist/lib/emoji/emoji.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../common/validators/index.cjs`),t=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),n=require(`../../common/emoji/index.cjs`),r=require(`../icon/icon-constants.cjs`),i=require(`../skeleton/skeleton.cjs`);let a=require(`vue`);var o={name:`DtEmoji`,components:{DtSkeleton:i.default},props:{code:{type:String,required:!0},size:{type:[String,Number],default:500,validator:e.ordinalSizeValidator(r.ICON_SIZE_MODIFIERS)},imgClass:{type:[String,Object,Array],default:``},ariaLabel:{type:String,default:null},showSkeleton:{type:Boolean,default:!0}},data(){return{emojiData:null,imgLoading:!1}},computed:{emojiDataValid(){return!!this.emojiData},emojiSrc(){return this.emojiDataValid?this.emojiData?.custom?this.emojiData.image:[`100`,`200`].includes(String(this.size))?n.emojiImageUrlSmall+this.emojiData.key+n.emojiFileExtensionSmall:n.emojiImageUrlLarge+this.emojiData.key+n.emojiFileExtensionLarge:`invalid`},emojiAlt(){if(this.emojiDataValid)return this.emojiData.unicode_output?n.stringToUnicode(this.emojiData.unicode_output):this.emojiData.name},emojiLabel(){return this.emojiDataValid?this.ariaLabel?this.ariaLabel:this.emojiData.name:`Invalid Emoji`},emojiSize(){return r.ICON_SIZE_MODIFIERS[this.size]}},watch:{code:{handler:function(){this.getEmojiData()},immediate:!0},emojiSrc:{handler:async function(){this.imgLoading=!0},immediate:!0}},methods:{getEmojiData(){this.emojiData=n.codeToEmojiData(this.code)},imageLoaded(){this.imgLoading=!1},imageErrored(){this.imgLoading=!1}}},s=[`aria-label`,`alt`,`title`,`src`];function c(e,t,n,r,i,o){let c=(0,a.resolveComponent)(`dt-skeleton`);return(0,a.openBlock)(),(0,a.createElementBlock)(`span`,{class:(0,a.normalizeClass)([`d-emoji d-icon`,o.emojiSize])},[(0,a.withDirectives)((0,a.createVNode)(c,{offset:0,class:(0,a.normalizeClass)([`d-icon`,o.emojiSize]),"shape-option":{shape:`circle`,size:`100%`}},null,8,[`class`]),[[a.vShow,i.imgLoading&&n.showSkeleton]]),(0,a.withDirectives)((0,a.createElementVNode)(`img`,{ref:`emojiImg`,class:(0,a.normalizeClass)([`d-icon`,o.emojiSize,n.imgClass]),"aria-label":o.emojiLabel,alt:o.emojiAlt,title:o.emojiLabel,src:o.emojiSrc,onLoad:t[0]||(t[0]=(...e)=>o.imageLoaded&&o.imageLoaded(...e)),onError:t[1]||(t[1]=(...e)=>o.imageErrored&&o.imageErrored(...e))},null,42,s),[[a.vShow,!i.imgLoading]])],2)}var l=t.t(o,[[`render`,c]]);exports.default=l;
|
|
2
2
|
//# sourceMappingURL=emoji.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emoji.cjs","names":[],"sources":["../../../components/Emoji/Emoji.vue"],"sourcesContent":["<template>\n <span :class=\"['d-emoji d-icon', emojiSize]\">\n <dt-skeleton\n v-show=\"imgLoading && showSkeleton\"\n :offset=\"0\"\n :class=\"['d-icon', emojiSize]\"\n :shape-option=\"{ shape: 'circle', size: '100%' }\"\n />\n <img\n v-show=\"!imgLoading\"\n ref=\"emojiImg\"\n :class=\"['d-icon', emojiSize, imgClass]\"\n :aria-label=\"emojiLabel\"\n :alt=\"emojiAlt\"\n :title=\"emojiLabel\"\n :src=\"emojiSrc\"\n @load=\"imageLoaded\"\n @error=\"imageErrored\"\n >\n </span>\n</template>\n\n<script>\nimport { ICON_SIZE_MODIFIERS } from '@/components/Icon';\nimport {\n codeToEmojiData,\n stringToUnicode,\n emojiImageUrlSmall,\n emojiFileExtensionSmall,\n emojiImageUrlLarge,\n emojiFileExtensionLarge,\n} from '@/common/emoji';\nimport { DtSkeleton } from '@/components/Skeleton';\n\n/**\n * Renders an emoji from a shortcode such as :smile: or unicode character such as 😄\n * @see https://dialtone.dialpad.com/components/emoji.html\n */\nexport default {\n name: 'DtEmoji',\n\n components: {\n DtSkeleton,\n },\n\n props: {\n /**\n * Supports shortcode ex: :smile: or unicode ex: 😄. Will display the resulting emoji.\n * <a class=\"d-link\" href=\"https://emojipedia.org/joypixels/\" target=\"_blank\">JoyPixels</a>\n * for all supported shortcode/unicode or the docs for setting up custom emojis.\n */\n code: {\n type: String,\n required: true,\n },\n\n /**\n * The size of the emoji. Can be any of the icon size utility classes from\n * <a class=\"d-link\" href=\"https://dialtone.dialpad.com/components/icon.html\" target=\"_blank\"> Dialpad Icon Size</a>\n * @values 100, 200, 300, 400, 500, 600, 700, 800\n */\n size: {\n type: String,\n default:
|
|
1
|
+
{"version":3,"file":"emoji.cjs","names":[],"sources":["../../../components/Emoji/Emoji.vue"],"sourcesContent":["<template>\n <span :class=\"['d-emoji d-icon', emojiSize]\">\n <dt-skeleton\n v-show=\"imgLoading && showSkeleton\"\n :offset=\"0\"\n :class=\"['d-icon', emojiSize]\"\n :shape-option=\"{ shape: 'circle', size: '100%' }\"\n />\n <img\n v-show=\"!imgLoading\"\n ref=\"emojiImg\"\n :class=\"['d-icon', emojiSize, imgClass]\"\n :aria-label=\"emojiLabel\"\n :alt=\"emojiAlt\"\n :title=\"emojiLabel\"\n :src=\"emojiSrc\"\n @load=\"imageLoaded\"\n @error=\"imageErrored\"\n >\n </span>\n</template>\n\n<script>\nimport { ICON_SIZE_MODIFIERS } from '@/components/Icon';\nimport { ordinalSizeValidator } from '@/common/validators';\nimport {\n codeToEmojiData,\n stringToUnicode,\n emojiImageUrlSmall,\n emojiFileExtensionSmall,\n emojiImageUrlLarge,\n emojiFileExtensionLarge,\n} from '@/common/emoji';\nimport { DtSkeleton } from '@/components/Skeleton';\n\n/**\n * Renders an emoji from a shortcode such as :smile: or unicode character such as 😄\n * @see https://dialtone.dialpad.com/components/emoji.html\n */\nexport default {\n name: 'DtEmoji',\n\n components: {\n DtSkeleton,\n },\n\n props: {\n /**\n * Supports shortcode ex: :smile: or unicode ex: 😄. Will display the resulting emoji.\n * <a class=\"d-link\" href=\"https://emojipedia.org/joypixels/\" target=\"_blank\">JoyPixels</a>\n * for all supported shortcode/unicode or the docs for setting up custom emojis.\n */\n code: {\n type: String,\n required: true,\n },\n\n /**\n * The size of the emoji. Can be any of the icon size utility classes from\n * <a class=\"d-link\" href=\"https://dialtone.dialpad.com/components/icon.html\" target=\"_blank\"> Dialpad Icon Size</a>\n * @values 100, 200, 300, 400, 500, 600, 700, 800\n */\n size: {\n type: [String, Number],\n default: 500,\n validator: ordinalSizeValidator(ICON_SIZE_MODIFIERS),\n },\n\n /**\n * Additional class name for the emoji img element.\n * Can accept String, Object, and Array, i.e. has the\n * same API as Vue's built-in handling of the class attribute.\n */\n imgClass: {\n type: [String, Object, Array],\n default: '',\n },\n\n /**\n * Will be read out on a screen reader for this emoji. You must use this prop if you want your emoji to be i18n\n * Compatible as Dialtone Vue will not translate it by itself. If you do not set this prop the aria-label will\n * be set to the english description of the emoji. You can retrieve the description for an emoji yourself via the\n * getEmojiData() function\n */\n ariaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * Shows a skeleton loader while the emoji asset is loading.\n * @values true, false\n */\n showSkeleton: {\n type: Boolean,\n default: true,\n },\n },\n\n data () {\n return {\n emojiData: null,\n imgLoading: false,\n };\n },\n\n computed: {\n emojiDataValid () {\n return !!this.emojiData;\n },\n\n emojiSrc () {\n if (!this.emojiDataValid) { return 'invalid'; }\n\n // custom emoji\n if (this.emojiData?.custom) {\n return this.emojiData.image;\n }\n\n if (['100', '200'].includes(String(this.size))) {\n return emojiImageUrlSmall + this.emojiData.key + emojiFileExtensionSmall;\n } else {\n return emojiImageUrlLarge + this.emojiData.key + emojiFileExtensionLarge;\n }\n },\n\n emojiAlt () {\n if (!this.emojiDataValid) { return undefined; }\n return this.emojiData.unicode_output ? stringToUnicode(this.emojiData.unicode_output) : this.emojiData.name;\n },\n\n emojiLabel () {\n if (!this.emojiDataValid) { return 'Invalid Emoji'; }\n return this.ariaLabel ? this.ariaLabel : this.emojiData.name;\n },\n\n emojiSize () {\n return ICON_SIZE_MODIFIERS[this.size];\n },\n },\n\n watch: {\n code: {\n handler: function () {\n this.getEmojiData();\n },\n\n immediate: true,\n },\n\n emojiSrc: {\n handler: async function () {\n this.imgLoading = true;\n },\n\n immediate: true,\n },\n },\n\n methods: {\n getEmojiData () {\n this.emojiData = codeToEmojiData(this.code);\n },\n\n imageLoaded () {\n this.imgLoading = false;\n },\n\n imageErrored () {\n this.imgLoading = false;\n },\n },\n};\n</script>\n"],"mappings":"+XAuCA,IAAK,EAAU,CACb,KAAM,UAEN,WAAY,CACV,WAAA,EAAA,QACD,CAED,MAAO,CAML,KAAM,CACJ,KAAM,OACN,SAAU,GACX,CAOD,KAAM,CACJ,KAAM,CAAC,OAAQ,OAAO,CACtB,QAAS,IACT,UAAW,EAAA,qBAAqB,EAAA,oBAAoB,CACrD,CAOD,SAAU,CACR,KAAM,CAAC,OAAQ,OAAQ,MAAM,CAC7B,QAAS,GACV,CAQD,UAAW,CACT,KAAM,OACN,QAAS,KACV,CAMD,aAAc,CACZ,KAAM,QACN,QAAS,GACV,CACF,CAED,MAAQ,CACN,MAAO,CACL,UAAW,KACX,WAAY,GACb,EAGH,SAAU,CACR,gBAAkB,CAChB,MAAO,CAAC,CAAC,KAAK,WAGhB,UAAY,CAWR,OAVG,KAAK,eAGN,KAAK,WAAW,OACX,KAAK,UAAU,MAGpB,CAAC,MAAO,MAAM,CAAC,SAAS,OAAO,KAAK,KAAK,CAAC,CACrC,EAAA,mBAAqB,KAAK,UAAU,IAAM,EAAA,wBAE1C,EAAA,mBAAqB,KAAK,UAAU,IAAM,EAAA,wBAVhB,WAcrC,UAAY,CACL,QAAK,eACV,OAAO,KAAK,UAAU,eAAiB,EAAA,gBAAgB,KAAK,UAAU,eAAc,CAAI,KAAK,UAAU,MAGzG,YAAc,CAEZ,OADK,KAAK,eACH,KAAK,UAAY,KAAK,UAAY,KAAK,UAAU,KADrB,iBAIrC,WAAa,CACX,OAAO,EAAA,oBAAoB,KAAK,OAEnC,CAED,MAAO,CACL,KAAM,CACJ,QAAS,UAAY,CACnB,KAAK,cAAc,EAGrB,UAAW,GACZ,CAED,SAAU,CACR,QAAS,gBAAkB,CACzB,KAAK,WAAa,IAGpB,UAAW,GACZ,CACF,CAED,QAAS,CACP,cAAgB,CACd,KAAK,UAAY,EAAA,gBAAgB,KAAK,KAAK,EAG7C,aAAe,CACb,KAAK,WAAa,IAGpB,cAAgB,CACd,KAAK,WAAa,IAErB,CACF,2JAzJQ,OAAA,CAlBA,OAAA,EAAA,EAAA,gBAAK,CAAA,iBAAqB,EAAA,UAAS,CAAA,CAAA,CAAA,EAAA,EAAA,EAAA,iBAAA,EAAA,EAAA,aAMtC,EAAA,CAHC,OAAQ,EACR,OAAA,EAAA,EAAA,gBAAK,CAAA,SAAa,EAAA,UAAS,CAAA,CAC3B,eAAc,CAAA,MAAA,SAAA,KAAA,OAAiC,8BAHxC,EAAA,YAAc,EAAA,aAAY,CAAA,CAAA,EAAA,EAAA,EAAA,iBAAA,EAAA,EAAA,oBAenC,MAAA,CARC,IAAI,WACH,OAAA,EAAA,EAAA,gBAAK,CAAA,SAAa,EAAA,UAAW,EAAA,SAAQ,CAAA,CACrC,aAAY,EAAA,WACZ,IAAK,EAAA,SACL,MAAO,EAAA,WACP,IAAK,EAAA,SACL,OAAI,EAAA,KAAA,EAAA,IAAA,GAAA,IAAE,EAAA,aAAA,EAAA,YAAA,GAAA,EAAW,EACjB,QAAK,EAAA,KAAA,EAAA,IAAA,GAAA,IAAE,EAAA,cAAA,EAAA,aAAA,GAAA,EAAY,yBARX,EAAA,WAAU,CAAA,CAAA,CAAA,CAAA,EAAA"}
|
package/dist/lib/emoji/emoji.js
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import c from "../
|
|
5
|
-
import
|
|
1
|
+
import { ordinalSizeValidator as e } from "../../common/validators/index.js";
|
|
2
|
+
import { t } from "../../_plugin-vue_export-helper-BTgDAbhb.js";
|
|
3
|
+
import { codeToEmojiData as n, emojiFileExtensionLarge as r, emojiFileExtensionSmall as i, emojiImageUrlLarge as a, emojiImageUrlSmall as o, stringToUnicode as s } from "../../common/emoji/index.js";
|
|
4
|
+
import { ICON_SIZE_MODIFIERS as c } from "../icon/icon-constants.js";
|
|
5
|
+
import l from "../skeleton/skeleton.js";
|
|
6
|
+
import { createElementBlock as u, createElementVNode as d, createVNode as f, normalizeClass as p, openBlock as m, resolveComponent as h, vShow as g, withDirectives as _ } from "vue";
|
|
6
7
|
//#region components/Emoji/Emoji.vue
|
|
7
|
-
var
|
|
8
|
+
var v = {
|
|
8
9
|
name: "DtEmoji",
|
|
9
|
-
components: { DtSkeleton:
|
|
10
|
+
components: { DtSkeleton: l },
|
|
10
11
|
props: {
|
|
11
12
|
code: {
|
|
12
13
|
type: String,
|
|
13
14
|
required: !0
|
|
14
15
|
},
|
|
15
16
|
size: {
|
|
16
|
-
type: String,
|
|
17
|
-
default:
|
|
18
|
-
validator:
|
|
17
|
+
type: [String, Number],
|
|
18
|
+
default: 500,
|
|
19
|
+
validator: e(c)
|
|
19
20
|
},
|
|
20
21
|
imgClass: {
|
|
21
22
|
type: [
|
|
@@ -45,16 +46,16 @@ var _ = {
|
|
|
45
46
|
return !!this.emojiData;
|
|
46
47
|
},
|
|
47
48
|
emojiSrc() {
|
|
48
|
-
return this.emojiDataValid ? this.emojiData?.custom ? this.emojiData.image : ["100", "200"].includes(this.size) ?
|
|
49
|
+
return this.emojiDataValid ? this.emojiData?.custom ? this.emojiData.image : ["100", "200"].includes(String(this.size)) ? o + this.emojiData.key + i : a + this.emojiData.key + r : "invalid";
|
|
49
50
|
},
|
|
50
51
|
emojiAlt() {
|
|
51
|
-
if (this.emojiDataValid) return this.emojiData.unicode_output ?
|
|
52
|
+
if (this.emojiDataValid) return this.emojiData.unicode_output ? s(this.emojiData.unicode_output) : this.emojiData.name;
|
|
52
53
|
},
|
|
53
54
|
emojiLabel() {
|
|
54
55
|
return this.emojiDataValid ? this.ariaLabel ? this.ariaLabel : this.emojiData.name : "Invalid Emoji";
|
|
55
56
|
},
|
|
56
57
|
emojiSize() {
|
|
57
|
-
return
|
|
58
|
+
return c[this.size];
|
|
58
59
|
}
|
|
59
60
|
},
|
|
60
61
|
watch: {
|
|
@@ -73,7 +74,7 @@ var _ = {
|
|
|
73
74
|
},
|
|
74
75
|
methods: {
|
|
75
76
|
getEmojiData() {
|
|
76
|
-
this.emojiData =
|
|
77
|
+
this.emojiData = n(this.code);
|
|
77
78
|
},
|
|
78
79
|
imageLoaded() {
|
|
79
80
|
this.imgLoading = !1;
|
|
@@ -82,24 +83,24 @@ var _ = {
|
|
|
82
83
|
this.imgLoading = !1;
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
|
-
},
|
|
86
|
+
}, y = [
|
|
86
87
|
"aria-label",
|
|
87
88
|
"alt",
|
|
88
89
|
"title",
|
|
89
90
|
"src"
|
|
90
91
|
];
|
|
91
|
-
function
|
|
92
|
-
let o =
|
|
93
|
-
return
|
|
92
|
+
function b(e, t, n, r, i, a) {
|
|
93
|
+
let o = h("dt-skeleton");
|
|
94
|
+
return m(), u("span", { class: p(["d-emoji d-icon", a.emojiSize]) }, [_(f(o, {
|
|
94
95
|
offset: 0,
|
|
95
|
-
class:
|
|
96
|
+
class: p(["d-icon", a.emojiSize]),
|
|
96
97
|
"shape-option": {
|
|
97
98
|
shape: "circle",
|
|
98
99
|
size: "100%"
|
|
99
100
|
}
|
|
100
|
-
}, null, 8, ["class"]), [[
|
|
101
|
+
}, null, 8, ["class"]), [[g, i.imgLoading && n.showSkeleton]]), _(d("img", {
|
|
101
102
|
ref: "emojiImg",
|
|
102
|
-
class:
|
|
103
|
+
class: p([
|
|
103
104
|
"d-icon",
|
|
104
105
|
a.emojiSize,
|
|
105
106
|
n.imgClass
|
|
@@ -110,10 +111,10 @@ function y(e, t, n, r, i, a) {
|
|
|
110
111
|
src: a.emojiSrc,
|
|
111
112
|
onLoad: t[0] || (t[0] = (...e) => a.imageLoaded && a.imageLoaded(...e)),
|
|
112
113
|
onError: t[1] || (t[1] = (...e) => a.imageErrored && a.imageErrored(...e))
|
|
113
|
-
}, null, 42,
|
|
114
|
+
}, null, 42, y), [[g, !i.imgLoading]])], 2);
|
|
114
115
|
}
|
|
115
|
-
var
|
|
116
|
+
var x = /* @__PURE__ */ t(v, [["render", b]]);
|
|
116
117
|
//#endregion
|
|
117
|
-
export {
|
|
118
|
+
export { x as default };
|
|
118
119
|
|
|
119
120
|
//# sourceMappingURL=emoji.js.map
|