@dialpad/dialtone-vue 3.222.1 → 3.222.3

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.
Files changed (87) hide show
  1. package/dist/component-documentation.json +1 -1
  2. package/dist/components/combobox_with_popover/combobox_with_popover.vue.d.ts +18 -1
  3. package/dist/components/combobox_with_popover/combobox_with_popover.vue.d.ts.map +1 -1
  4. package/dist/components/dropdown/dropdown.vue.d.ts +18 -1
  5. package/dist/components/dropdown/dropdown.vue.d.ts.map +1 -1
  6. package/dist/components/hovercard/hovercard.vue.d.ts +40 -4
  7. package/dist/components/hovercard/hovercard.vue.d.ts.map +1 -1
  8. package/dist/components/modal/modal.vue.d.ts +1 -0
  9. package/dist/components/modal/modal.vue.d.ts.map +1 -1
  10. package/dist/components/popover/popover.vue.d.ts +18 -1
  11. package/dist/components/popover/popover.vue.d.ts.map +1 -1
  12. package/dist/components/popover/popover_constants.d.ts +2 -0
  13. package/dist/components/popover/popover_constants.d.ts.map +1 -1
  14. package/dist/components/popover/tippy_utils.d.ts +1 -1
  15. package/dist/components/popover/tippy_utils.d.ts.map +1 -1
  16. package/dist/components/rich_text_editor/extensions/variable/VariableComponent.vue.d.ts +18 -1
  17. package/dist/components/rich_text_editor/extensions/variable/VariableComponent.vue.d.ts.map +1 -1
  18. package/dist/components/split_button/split_button.vue.d.ts +18 -1
  19. package/dist/components/split_button/split_button.vue.d.ts.map +1 -1
  20. package/dist/components/tooltip/tooltip.vue.d.ts +2 -2
  21. package/dist/dialtone-vue.cjs +1 -1
  22. package/dist/dialtone-vue.js +2 -2
  23. package/dist/lib/editor/editor.cjs +1 -1
  24. package/dist/lib/editor/editor.js +1 -1
  25. package/dist/lib/message-input/index.cjs +1 -1
  26. package/dist/lib/message-input/index.js +1 -1
  27. package/dist/lib/message-input/message-input.cjs +1 -1
  28. package/dist/lib/message-input/message-input.js +1 -1
  29. package/dist/lib/modal/modal.cjs +1 -1
  30. package/dist/lib/modal/modal.cjs.map +1 -1
  31. package/dist/lib/modal/modal.js +5 -2
  32. package/dist/lib/modal/modal.js.map +1 -1
  33. package/dist/lib/popover/popover-constants.cjs +1 -1
  34. package/dist/lib/popover/popover-constants.cjs.map +1 -1
  35. package/dist/lib/popover/popover-constants.js +14 -9
  36. package/dist/lib/popover/popover-constants.js.map +1 -1
  37. package/dist/lib/popover/popover.cjs +1 -1
  38. package/dist/lib/popover/popover.cjs.map +1 -1
  39. package/dist/lib/popover/popover.js +56 -47
  40. package/dist/lib/popover/popover.js.map +1 -1
  41. package/dist/lib/popover/tippy-utils.cjs +1 -1
  42. package/dist/lib/popover/tippy-utils.cjs.map +1 -1
  43. package/dist/lib/popover/tippy-utils.js +2 -1
  44. package/dist/lib/popover/tippy-utils.js.map +1 -1
  45. package/dist/lib/rich-text-editor/index.cjs +1 -1
  46. package/dist/lib/rich-text-editor/index.js +1 -1
  47. package/dist/lib/rich-text-editor/markdownRenderer.js +1 -1
  48. package/dist/lib/rich-text-editor/rich-text-editor.cjs +1 -1
  49. package/dist/lib/rich-text-editor/rich-text-editor.js +1 -1
  50. package/dist/markdownRenderer-DCgGQseq.cjs.map +1 -1
  51. package/dist/{markdownRenderer-D_P94RyM.js → markdownRenderer-vnndXQhE.js} +2 -2
  52. package/dist/{markdownRenderer-D_P94RyM.js.map → markdownRenderer-vnndXQhE.js.map} +1 -1
  53. package/dist/{message_input-BCIq_1AD.cjs → message_input-B45NFtUx.cjs} +2 -2
  54. package/dist/{message_input-BCIq_1AD.cjs.map → message_input-B45NFtUx.cjs.map} +1 -1
  55. package/dist/{message_input-B47LB7C8.js → message_input-DQQ3d8vG.js} +2 -2
  56. package/dist/{message_input-B47LB7C8.js.map → message_input-DQQ3d8vG.js.map} +1 -1
  57. package/dist/node_modules/@tiptap/vue-3.cjs.map +1 -1
  58. package/dist/node_modules/@tiptap/vue-3.js +1 -1
  59. package/dist/node_modules/@tiptap/vue-3.js.map +1 -1
  60. package/dist/recipes/buttons/callbar_button/callbar_button.vue.d.ts +2 -2
  61. package/dist/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts +20 -3
  62. package/dist/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts.map +1 -1
  63. package/dist/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +20 -3
  64. package/dist/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts.map +1 -1
  65. package/dist/recipes/cards/ivr_node/ivr_node.vue.d.ts +18 -1
  66. package/dist/recipes/cards/ivr_node/ivr_node.vue.d.ts.map +1 -1
  67. package/dist/recipes/conversation_view/editor/EditorToolbarDropdownButton.vue.d.ts +18 -1
  68. package/dist/recipes/conversation_view/editor/EditorToolbarDropdownButton.vue.d.ts.map +1 -1
  69. package/dist/recipes/conversation_view/editor/EditorToolbarPopoverButton.vue.d.ts +18 -1
  70. package/dist/recipes/conversation_view/editor/EditorToolbarPopoverButton.vue.d.ts.map +1 -1
  71. package/dist/recipes/conversation_view/editor/editor.vue.d.ts +56 -5
  72. package/dist/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
  73. package/dist/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts +2 -2
  74. package/dist/recipes/conversation_view/message_input/message_input.vue.d.ts +42 -8
  75. package/dist/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
  76. package/dist/recipes/conversation_view/message_input/message_input_button.vue.d.ts +2 -2
  77. package/dist/recipes/conversation_view/message_input/message_input_link.vue.d.ts +20 -3
  78. package/dist/recipes/conversation_view/message_input/message_input_link.vue.d.ts.map +1 -1
  79. package/dist/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts +2 -2
  80. package/dist/recipes/leftbar/contact_row/contact_row.vue.d.ts +2 -2
  81. package/dist/recipes/leftbar/general_row/general_row.vue.d.ts +2 -2
  82. package/dist/recipes/leftbar/group_row/group_row.vue.d.ts +2 -2
  83. package/dist/{rich_text_editor-CNFb6tIx.js → rich_text_editor-COc4LaIk.js} +5 -4
  84. package/dist/{rich_text_editor-CNFb6tIx.js.map → rich_text_editor-COc4LaIk.js.map} +1 -1
  85. package/dist/{rich_text_editor-DRytK1_9.cjs → rich_text_editor-DWrdKcza.cjs} +2 -2
  86. package/dist/{rich_text_editor-DRytK1_9.cjs.map → rich_text_editor-DWrdKcza.cjs.map} +1 -1
  87. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"popover.js","names":[],"sources":["../../../components/popover/popover.vue"],"sourcesContent":["<!-- eslint-disable vuejs-accessibility/mouse-events-have-key-events -->\n<template>\n <div>\n <Teleport\n v-if=\"modal && isOpen\"\n to=\"body\"\n >\n <div\n class=\"d-modal--transparent\"\n aria-hidden=\"false\"\n @click.prevent.stop\n />\n </Teleport>\n <component\n :is=\"elementType\"\n ref=\"popover\"\n :class=\"['d-popover', { 'd-popover__anchor--opened': isOpen }]\"\n data-qa=\"dt-popover-container\"\n >\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <div\n :id=\"!ariaLabelledby && labelledBy\"\n ref=\"anchor\"\n :data-qa=\"$attrs['data-qa'] ? `${$attrs['data-qa']}-anchor` : 'dt-popover-anchor'\"\n :tabindex=\"openOnContext ? 0 : undefined\"\n @click.capture=\"defaultToggleOpen\"\n @contextmenu=\"onContext\"\n @keydown.up.prevent=\"onArrowKeyPress\"\n @keydown.down.prevent=\"onArrowKeyPress\"\n @keydown.escape.capture=\"closePopover\"\n @keydown.enter=\"$emit('keydown', $event)\"\n @keydown.space=\"$emit('keydown', $event)\"\n @mouseenter=\"onMouseEnter\"\n @mouseleave=\"onMouseLeave\"\n >\n <!-- @slot Anchor element that activates the popover. Usually a button. -->\n <slot\n name=\"anchor\"\n :attrs=\"{\n 'aria-expanded': isOpen.toString(),\n 'aria-controls': id,\n 'aria-haspopup': role,\n }\"\n />\n </div>\n <dt-lazy-show\n :id=\"id\"\n ref=\"content\"\n :role=\"role\"\n :data-qa=\"$attrs['data-qa'] ? `${$attrs['data-qa']}__dialog` : 'dt-popover'\"\n :aria-hidden=\"`${!isOpen}`\"\n :aria-labelledby=\"labelledBy\"\n :aria-label=\"ariaLabel\"\n :aria-modal=\"`${!modal}`\"\n :transition=\"transition\"\n :show=\"isOpen\"\n :appear=\"toAppear\"\n :class=\"['d-popover__dialog', { 'd-popover__dialog--modal': modal }, dialogClass]\"\n :style=\"{\n 'max-height': calculatedMaxHeight,\n 'max-width': maxWidth,\n }\"\n :css=\"$attrs.css\"\n :tabindex=\"contentTabindex\"\n v-on=\"popoverListeners\"\n @mouseenter=\"onMouseEnterAnchor\"\n @mouseleave=\"onMouseLeaveAnchor\"\n >\n <popover-header-footer\n v-if=\"hasSlotContent($slots.headerContent) || showCloseButton\"\n ref=\"popover__header\"\n :class=\"POPOVER_HEADER_FOOTER_PADDING_CLASSES[padding]\"\n :content-class=\"headerClass\"\n type=\"header\"\n :show-close-button=\"showCloseButton\"\n @close=\"closePopover\"\n >\n <template #content>\n <!-- @slot Slot for popover header content -->\n <slot\n name=\"headerContent\"\n :close=\"closePopover\"\n />\n </template>\n </popover-header-footer>\n <div\n ref=\"popover__content\"\n :data-qa=\"$attrs['data-qa'] ? `${$attrs['data-qa']}-content` : 'dt-popover-content'\"\n :class=\"[\n 'd-popover__content',\n POPOVER_PADDING_CLASSES[padding],\n contentClass,\n ]\"\n >\n <!-- @slot Slot for the content that is displayed in the popover when it is open. -->\n <slot\n name=\"content\"\n :close=\"closePopover\"\n />\n </div>\n <popover-header-footer\n v-if=\"hasSlotContent($slots.footerContent)\"\n ref=\"popover__footer\"\n type=\"footer\"\n :class=\"POPOVER_HEADER_FOOTER_PADDING_CLASSES[padding]\"\n :content-class=\"footerClass\"\n >\n <template #content>\n <!-- @slot Slot for the footer content. -->\n <slot\n name=\"footerContent\"\n :close=\"closePopover\"\n />\n </template>\n </popover-header-footer>\n <sr-only-close-button\n v-if=\"!showCloseButton\"\n @close=\"closePopover\"\n />\n </dt-lazy-show>\n </component>\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport {\n POPOVER_APPEND_TO_VALUES,\n POPOVER_CONTENT_WIDTHS,\n POPOVER_HEADER_FOOTER_PADDING_CLASSES,\n POPOVER_INITIAL_FOCUS_STRINGS,\n POPOVER_PADDING_CLASSES,\n POPOVER_ROLES,\n POPOVER_STICKY_VALUES,\n} from './popover_constants';\nimport { getUniqueString, hasSlotContent, isOutOfViewPort, warnIfUnmounted, disableRootScrolling, enableRootScrolling, returnFirstEl } from '@/common/utils';\nimport { HTML_ELEMENT_TYPE } from '@/common/constants';\nimport { DtLazyShow } from '@/components/lazy_show';\nimport ModalMixin from '@/common/mixins/modal';\nimport { createTippyPopover, getPopperOptions } from './tippy_utils';\nimport PopoverHeaderFooter from './popover_header_footer.vue';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\n\n/**\n * A Popover displays a content overlay when its anchor element is activated.\n * @see https://dialtone.dialpad.com/components/popover.html\n */\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtPopover',\n\n /********************\n * CHILD COMPONENTS *\n ********************/\n components: {\n SrOnlyCloseButton,\n DtLazyShow,\n PopoverHeaderFooter,\n },\n\n mixins: [ModalMixin],\n\n props: {\n /**\n * Controls whether the popover is shown. Leaving this null will have the popover trigger on click by default.\n * If you set this value, the default trigger behavior will be disabled, and you can control it as you need.\n * Supports v-model\n * @values null, true, false\n */\n open: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Opens the popover on right click (context menu). If you set this value to `true`,\n * the default trigger behavior will be disabled.\n * @values true, false\n */\n openOnContext: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Element type (tag name) of the root element of the component.\n */\n elementType: {\n type: String,\n default: 'div',\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 * ARIA role for the content of the popover. Defaults to \"dialog\".\n * <a class=\"d-link\" href=\"https://www.w3.org/TR/wai-aria/#aria-haspopup\" target=\"_blank\">aria-haspopup</a>\n */\n role: {\n type: String,\n default: 'dialog',\n validator: (role) => {\n return POPOVER_ROLES.includes(role);\n },\n },\n\n /**\n * ID of the element that serves as the label for the popover content.\n * Defaults to the \"anchor\" element; this exists to provide a different\n * ID of the label element if, for example, the anchor slot contains\n * other items that do not serve as a label. You should provide this\n * or ariaLabel, but not both.\n */\n ariaLabelledby: {\n type: String,\n default: null,\n },\n\n /**\n * Descriptive label for the popover content. You should provide this\n * or ariaLabelledby, but not both.\n */\n ariaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * Padding size class for the popover content.\n * @values none, small, medium, large\n */\n padding: {\n type: String,\n default: 'large',\n validator: (padding) => {\n return Object.keys(POPOVER_PADDING_CLASSES).some((item) => item === padding);\n },\n },\n\n /**\n * Additional class name for the content wrapper element.\n */\n contentClass: {\n type: [String, Array, Object],\n default: '',\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 * @values null, anchor\n */\n contentWidth: {\n type: String,\n default: '',\n validator: contentWidth => POPOVER_CONTENT_WIDTHS.includes(contentWidth),\n },\n\n /**\n * Whether to apply transition on initial render in the content lazy show component.\n */\n contentAppear: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Tabindex value for the content. Passing null, no tabindex attribute will be set.\n */\n contentTabindex: {\n type: Number || null,\n default: -1,\n },\n\n /**\n * External anchor id to use in those cases the anchor can't be provided via the slot.\n * For instance, using the combobox's input as the anchor for the popover.\n * @deprecated Use externalAnchorElement instead for Shadow DOM compatibility.\n */\n externalAnchor: {\n type: String,\n default: '',\n },\n\n /**\n * External anchor element reference. Use this instead of externalAnchor when\n * the anchor may be inside a Shadow DOM, as querySelector cannot pierce shadow boundaries.\n */\n externalAnchorElement: {\n type: HTML_ELEMENT_TYPE,\n default: null,\n },\n\n /**\n * The id of the tooltip\n */\n id: {\n type: String,\n default () { return getUniqueString(); },\n },\n\n /**\n * Displaces the content box from its anchor element\n * by the specified number of pixels.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#offset\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n */\n offset: {\n type: Array,\n default: () => [0, 4],\n },\n\n /**\n * Determines if the popover hides upon clicking the\n * anchor or outside the content box.\n * @values true, false\n */\n hideOnClick: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Determines modal state. If enabled popover has a modal overlay\n * preventing interaction with elements below it, but it is invisible.\n * @values true, false\n */\n modal: {\n type: Boolean,\n default: true,\n },\n\n /**\n * If the popover does not fit in the direction described by \"placement\",\n * it will attempt to change its direction to the \"fallbackPlacements\".\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * */\n fallbackPlacements: {\n type: Array,\n default: () => {\n return ['auto'];\n },\n },\n\n /**\n * The direction the popover displays relative to the anchor.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#placement\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n * @values top, top-start, top-end,\n * right, right-start, right-end,\n * left, left-start, left-end,\n * bottom, bottom-start, bottom-end,\n * auto, auto-start, auto-end\n */\n placement: {\n type: String,\n default: 'bottom-end',\n },\n\n /**\n * If set to false the dialog will display over top of the anchor when there is insufficient space.\n * If set to true it will never move from its position relative to the anchor and will clip instead.\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/modifiers/prevent-overflow/#tether\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * @values true, false\n */\n tether: {\n type: Boolean,\n default: true,\n },\n\n /**\n * If the popover sticks to the anchor. This is usually not needed, but can be needed\n * if the reference element's position is animating, or to automatically update the popover\n * position in those cases the DOM layout changes the reference element's position.\n * `true` enables it, `reference` only checks the \"reference\" rect for changes and `popper` only\n * checks the \"popper\" rect for changes.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#sticky\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n * @values true, false, reference, popper\n */\n sticky: {\n type: [Boolean, String],\n default: false,\n validator: (sticky) => {\n return POPOVER_STICKY_VALUES.includes(sticky);\n },\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 * Determines visibility for close button\n * @values true, false\n */\n showCloseButton: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the header content wrapper element.\n */\n headerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the footer content wrapper element.\n */\n footerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the dialog element.\n */\n dialogClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * The element that is focused when the popover is opened. This can be an\n * HTMLElement within the popover, a string starting with '#' which will\n * find the element by ID. 'first' which will automatically focus\n * the first element, or 'dialog' which will focus the dialog window itself.\n * If the dialog is modal this prop cannot be 'none'.\n * @values none, dialog, first\n */\n initialFocusElement: {\n type: [String, HTML_ELEMENT_TYPE],\n default: 'first',\n validator: initialFocusElement => {\n return POPOVER_INITIAL_FOCUS_STRINGS.includes(initialFocusElement) ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n\n /**\n * If the popover should open pressing up or down arrow key on the anchor element.\n * This can be set when not passing open prop.\n * @values true, false\n */\n openWithArrowKeys: {\n type: Boolean,\n default: false,\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 * 'root' will try append to the iFrame's parent body if it is contained in an iFrame\n * and has permissions to access it, else, it'd default to 'parent'.\n * @values 'body', 'parent', 'root', 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 emits: [\n /**\n * Native keydown event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * Event fired to sync the open prop with the parent component\n * @event update:open\n */\n 'update:open',\n\n /**\n * Emitted when popover is shown or hidden\n *\n * @event opened\n * @type {Boolean | Array}\n */\n 'opened',\n\n /**\n * Emitted when the mouse enters the popover\n *\n * @event mouseenter-popover\n */\n 'mouseenter-popover',\n\n /**\n * Emitted when the mouse leaves the popover\n *\n * @event mouseleave-popover\n */\n 'mouseleave-popover',\n\n /**\n * Emitted when the mouse enters the popover anchor\n *\n * @event mouseenter-popover-anchor\n */\n 'mouseenter-popover-anchor',\n\n /**\n * Emitted when the mouse leaves the popover anchor\n *\n * @event mouseleave-popover-anchor\n */\n 'mouseleave-popover-anchor',\n ],\n\n data () {\n return {\n POPOVER_PADDING_CLASSES,\n POPOVER_HEADER_FOOTER_PADDING_CLASSES,\n intersectionObserver: null,\n mutationObserver: null,\n isOutsideViewport: false,\n isOpen: false,\n toAppear: false,\n anchorEl: null,\n popoverContentEl: null,\n hasSlotContent,\n };\n },\n\n computed: {\n popoverListeners () {\n return {\n keydown: event => {\n this.onKeydown(event);\n },\n\n 'after-leave': () => {\n this.onLeaveTransitionComplete();\n },\n\n 'after-enter': () => {\n this.onEnterTransitionComplete();\n },\n };\n },\n\n calculatedMaxHeight () {\n if (this.isOutsideViewport && this.modal) {\n return `calc(100vh - var(--dt-space-300))`;\n }\n return this.maxHeight;\n },\n\n labelledBy () {\n // aria-labelledby should be set only if aria-labelledby is passed as a prop, or if\n // there is no aria-label and the labelledby should point to the anchor.\n return this.ariaLabelledby || (!this.ariaLabel && getUniqueString('DtPopover__anchor'));\n },\n },\n\n watch: {\n $props: {\n immediate: true,\n deep: true,\n handler () {\n this.validateProps();\n },\n },\n\n modal (modal) {\n this.tip?.setProps({\n zIndex: modal ? 650 : this.calculateAnchorZindex(),\n });\n },\n\n offset (offset) {\n this.tip?.setProps({\n offset,\n });\n },\n\n sticky (sticky) {\n this.tip?.setProps({\n sticky,\n });\n },\n\n fallbackPlacements () {\n this.tip?.setProps({\n popperOptions: this.popperOptions(),\n });\n },\n\n tether () {\n this.tip?.setProps({\n popperOptions: this.popperOptions(),\n });\n },\n\n externalAnchorElement () {\n this.updateAnchorEl();\n },\n\n placement (placement) {\n this.tip?.setProps({\n placement,\n });\n },\n\n open: {\n handler: function (open) {\n if (open !== null) {\n this.isOpen = open;\n }\n if (open === true) {\n this.toAppear = true;\n }\n },\n\n immediate: true,\n },\n\n contentAppear: {\n handler: function (contentAppear) {\n if (contentAppear !== null) {\n this.toAppear = contentAppear;\n }\n },\n },\n\n isOpen (isOpen, isPrev) {\n if (isOpen) {\n this.initTippyInstance();\n this.tip?.show();\n } else if (!isOpen && isPrev !== isOpen) {\n this.removeEventListeners();\n this.tip?.hide();\n }\n },\n },\n\n mounted () {\n warnIfUnmounted(returnFirstEl(this.$el), this.$options.name);\n\n this.popoverContentEl = returnFirstEl(this.$refs.content?.$el);\n this.updateAnchorEl();\n\n this.mutationObserver = new MutationObserver(this.updateAnchorEl);\n this.mutationObserver.observe(this.$refs.anchor, {childList: true});\n\n // rootMargin here must be greater than the margin of the height we are setting in calculatedMaxHeight which\n // currently is var(--dt-space-300) (4px). If not the intersectionObserver will continually trigger in an infinite\n // loop.\n // threshold 1.0 makes this trigger every time the dialog \"touches\" the edge of the viewport.\n this.intersectionObserver = new IntersectionObserver(this.hasIntersectedViewport);\n this.intersectionObserver.observe(this.popoverContentEl);\n },\n\n beforeUnmount () {\n this._isUnmounting = true;\n // Cancel any in-progress CSS transitions so transitionend cannot fire\n // after this component is torn down and call into dead lifecycle methods.\n if (this.popoverContentEl) {\n this.popoverContentEl.style.transition = 'none';\n }\n this.tip?.destroy();\n this.intersectionObserver?.disconnect();\n this.mutationObserver?.disconnect();\n this.removeReferences();\n this.removeEventListeners();\n },\n\n /******************\n * METHODS *\n ******************/\n methods: {\n\n hasIntersectedViewport (entries) {\n const dialog = entries?.[0]?.target;\n if (!dialog) return;\n const isOut = isOutOfViewPort(dialog);\n this.isOutsideViewport = isOut.bottom || isOut.top;\n },\n\n updateAnchorEl () {\n const externalAnchorEl = this.externalAnchorElement ||\n (this.externalAnchor\n ? this.$refs.anchor.getRootNode().querySelector(`#${this.externalAnchor}`)\n : null);\n const anchorEl = externalAnchorEl ?? this.$refs.anchor.children[0];\n if (anchorEl === this.anchorEl) {\n return;\n }\n this.anchorEl = anchorEl;\n\n this.tip?.destroy();\n delete this.tip;\n\n if (!this.anchorEl) {\n console.warn('No anchor found for popover');\n return;\n }\n\n if (this.isOpen) {\n this.initTippyInstance();\n this.tip?.show();\n }\n },\n\n popperOptions () {\n return getPopperOptions({\n fallbackPlacements: this.fallbackPlacements,\n tether: this.tether,\n hasHideModifierEnabled: true,\n });\n },\n\n validateProps () {\n if (this.modal && this.initialFocusElement === 'none') {\n console.error('If the popover is modal you must set the ' +\n 'initialFocusElement prop. Possible values: \"dialog\", \"first\", HTMLElement');\n }\n },\n\n calculateAnchorZindex () {\n // if a modal is currently active render at modal-element z-index, otherwise at popover z-index\n if (returnFirstEl(this.$el).getRootNode()\n .querySelector('.d-modal[aria-hidden=\"false\"], .d-modal--transparent[aria-hidden=\"false\"]') ||\n // Special case because we don't have any dialtone drawer component yet. Render at 650 when\n // anchor of popover is within a drawer.\n this.anchorEl?.closest('.d-zi-drawer')) {\n return 650;\n } else {\n return 300;\n }\n },\n\n defaultToggleOpen (e) {\n if (this.openOnContext) { return; }\n\n // Only use default toggle behaviour if the user has not set the open prop.\n // Check that the anchor element specifically was clicked.\n if (this.open === null || this.open === undefined) {\n if ((!this.anchorEl?.contains(e.target) && !this.anchorEl?.isEqualNode(e.target)) || this.anchorEl?.disabled) {\n return;\n }\n\n this.toggleOpen();\n }\n },\n\n async onContext (event) {\n if (!this.openOnContext) { return; }\n\n event.preventDefault();\n\n this.isOpen = true;\n await this.$nextTick();\n this.tip?.setProps({\n placement: 'right-start',\n getReferenceClientRect: () => ({\n width: 0,\n height: 0,\n top: event.clientY,\n bottom: event.clientY,\n left: event.clientX,\n right: event.clientX,\n }),\n });\n },\n\n toggleOpen () {\n this.isOpen = !this.isOpen;\n },\n\n onArrowKeyPress (e) {\n if (this.open !== null) { return; }\n if (this.openWithArrowKeys && this.anchorEl?.contains(e.target)) {\n if (!this.isOpen) {\n this.isOpen = true;\n }\n }\n\n this.$emit('keydown', e);\n },\n\n addEventListeners () {\n window.addEventListener('dt-popover-close', this.closePopover);\n // align popover content width when contentWidth is 'anchor'\n if (this.contentWidth === 'anchor') {\n window.addEventListener('resize', this.onResize);\n }\n },\n\n removeEventListeners () {\n window.removeEventListener('dt-popover-close', this.closePopover);\n if (this.contentWidth === 'anchor') {\n window.removeEventListener('resize', this.onResize);\n }\n },\n\n closePopover () {\n this.isOpen = false;\n },\n\n /*\n * Prevents scrolling outside of the currently opened modal popover by:\n * - when anchor is not within another popover: setting the body to overflow: hidden\n * - when anchor is within another popover: set the popover dialog container to it's non-modal z-index\n * since it is no longer the active modal. This puts it underneath the overlay and prevents scrolling.\n **/\n preventScrolling () {\n if (this.modal) {\n const element = this.anchorEl?.closest('body, .tippy-box');\n if (!element) return;\n if (element.tagName?.toLowerCase() === 'body') {\n disableRootScrolling(this.anchorEl.getRootNode().host);\n this.tip?.setProps({ offset: this.offset });\n } else {\n element.classList.add('d-zi-popover');\n }\n }\n },\n\n /*\n * Resets the prevent scrolling properties set in preventScrolling() back to normal.\n **/\n enableScrolling () {\n const element = this.anchorEl?.closest('body, .tippy-box');\n if (!element) return;\n if (element.tagName?.toLowerCase() === 'body') {\n enableRootScrolling(this.anchorEl.getRootNode().host);\n this.tip?.setProps({ offset: this.offset });\n } else {\n element.classList.remove('d-zi-popover');\n }\n },\n\n removeReferences () {\n this.anchorEl = null;\n this.popoverContentEl = null;\n this.tip = null;\n },\n\n async onShow () {\n if (this.contentWidth === 'anchor') {\n await this.setPopoverContentAnchorWidth();\n }\n\n if (this.contentWidth === null) {\n this.popoverContentEl.style.width = 'auto';\n }\n\n this.addEventListeners();\n },\n\n async onLeaveTransitionComplete () {\n if (this._isUnmounting) return;\n if (this.modal) {\n await this.focusFirstElement(this.$refs.anchor);\n if (this._isUnmounting) return;\n // await next tick in case the user wants to change focus themselves.\n await this.$nextTick();\n if (this._isUnmounting) return;\n this.enableScrolling();\n }\n if (this._isUnmounting) return;\n this.tip?.unmount();\n this.$emit('opened', false);\n if (this.open !== null) {\n this.$emit('update:open', false);\n }\n },\n\n async onEnterTransitionComplete () {\n if (this._isUnmounting) return;\n this.focusInitialElement();\n // await next tick in case the user wants to change focus themselves.\n await this.$nextTick();\n if (this._isUnmounting) return;\n this.preventScrolling();\n this.$emit('opened', true, this.$refs.popover__content);\n if (this.open !== null) {\n this.$emit('update:open', true);\n }\n },\n\n focusInitialElement () {\n if (this.initialFocusElement === 'dialog') {\n returnFirstEl(this.$refs.content?.$el)?.focus();\n }\n // find by ID\n if (this.initialFocusElement.startsWith('#')) {\n this.focusInitialElementById();\n }\n if (this.initialFocusElement === 'first') {\n this.focusFirstElementIfNeeded(this.$refs.popover__content);\n }\n if (this.initialFocusElement instanceof HTMLElement) {\n this.initialFocusElement.focus();\n }\n },\n\n focusInitialElementById () {\n const result = returnFirstEl(this.$refs.content?.$el)?.querySelector(this.initialFocusElement);\n if (result) {\n result.focus();\n } else {\n console.warn('Could not find the element specified in dt-popover prop \"initialFocusElement\". ' +\n 'Defaulting to focusing the dialog.');\n returnFirstEl(this.$refs.content?.$el)?.focus();\n }\n },\n\n onResize () {\n this.closePopover();\n },\n\n onClickOutside () {\n if (!this.hideOnClick) return;\n // If a popover is opened inside of this one, do not hide on click out\n const innerModals = this.popoverContentEl?.querySelector('.d-popover__anchor--opened');\n if (!innerModals) {\n this.closePopover();\n }\n },\n\n onKeydown (e) {\n if (e.key === 'Tab') {\n if (this.modal) {\n this.focusTrappedTabPress(e, this.popoverContentEl);\n }\n }\n if (e.key === 'Escape') {\n this.closePopover();\n }\n\n this.$emit('keydown', e);\n },\n\n async setPopoverContentAnchorWidth () {\n await this.$nextTick();\n this.popoverContentEl.style.width = `${this.anchorEl?.clientWidth}px`;\n },\n\n focusFirstElementIfNeeded (domEl) {\n const focusableElements = this._getFocusableElements(domEl, true);\n if (focusableElements.length !== 0) {\n this.focusFirstElement(domEl);\n } else if (this.showCloseButton) {\n this.$refs.popover__header?.focusCloseButton();\n } else {\n // if there are no focusable elements at all focus the dialog itself\n returnFirstEl(this.$refs.content?.$el).focus();\n }\n },\n\n /**\n * Return's the anchor ClientRect object relative to the window.\n * Refer to: https://atomiks.github.io/tippyjs/v6/all-props/#getreferenceclientrect for more information\n * @param error\n */\n getReferenceClientRect (error) {\n const anchorReferenceRect = this.anchorEl?.getBoundingClientRect();\n\n if (this.appendTo !== 'root' || error) return anchorReferenceRect;\n\n const anchorOwnerDocument = this.anchorEl?.ownerDocument;\n const anchorParentWindow = anchorOwnerDocument?.defaultView || anchorOwnerDocument?.parentWindow;\n const anchorIframe = anchorParentWindow?.frameElement;\n\n if (!anchorIframe) return anchorReferenceRect;\n\n const iframeReferenceRect = anchorIframe.getBoundingClientRect();\n\n return {\n width: anchorReferenceRect?.width,\n height: anchorReferenceRect?.height,\n top: iframeReferenceRect?.top + anchorReferenceRect?.top,\n left: iframeReferenceRect?.left + anchorReferenceRect?.left,\n right: iframeReferenceRect?.right + anchorReferenceRect?.right,\n bottom: iframeReferenceRect?.bottom + anchorReferenceRect?.bottom,\n };\n },\n\n initTippyInstance () {\n let internalAppendTo = null;\n let iFrameError = false;\n\n switch (this.appendTo) {\n case 'body':\n internalAppendTo = this.anchorEl?.getRootNode()?.querySelector('body');\n break;\n\n case 'root':\n // Try to attach the popover to root document, fallback to parent is fail\n try {\n internalAppendTo = window.parent.document.body;\n } catch (err) {\n console.error('Could not attach the popover to iframe parent window: ', err);\n internalAppendTo = 'parent';\n iFrameError = true;\n }\n break;\n\n default:\n internalAppendTo = this.appendTo;\n break;\n }\n\n this.tip?.destroy();\n\n this.tip = createTippyPopover(this.anchorEl, {\n popperOptions: this.popperOptions(),\n contentElement: this.popoverContentEl,\n placement: this.placement,\n offset: this.offset,\n sticky: this.sticky,\n appendTo: internalAppendTo,\n interactive: true,\n trigger: 'manual',\n getReferenceClientRect: () => this.getReferenceClientRect(iFrameError),\n // We have to manage hideOnClick functionality manually to handle\n // popover within popover situations.\n hideOnClick: false,\n zIndex: this.modal ? 650 : this.calculateAnchorZindex(),\n onClickOutside: this.onClickOutside,\n onShow: this.onShow,\n });\n },\n\n onMouseEnter () {\n this.$emit('mouseenter-popover');\n },\n\n onMouseLeave () {\n this.$emit('mouseleave-popover');\n },\n\n onMouseEnterAnchor () {\n this.$emit('mouseenter-popover-anchor');\n },\n\n onMouseLeaveAnchor () {\n this.$emit('mouseleave-popover-anchor');\n },\n },\n};\n</script>\n"],"mappings":";;;;;;;;;;;AAmJA,IAAK,IAAU;CACb,cAAc,EAAE,MAAM,GAAG;CACzB,MAAM;CAKN,YAAY;EACV,mBAAA;EACA,YAAA;EACA,qBAAA;EACD;CAED,QAAQ,CAAC,EAAW;CAEpB,OAAO;EAOL,MAAM;GACJ,MAAM;GACN,SAAS;GACV;EAOD,eAAe;GACb,MAAM;GACN,SAAS;GACV;EAKD,aAAa;GACX,MAAM;GACN,SAAS;GACV;EAMD,YAAY;GACV,MAAM;GACN,SAAS;GACV;EAMD,MAAM;GACJ,MAAM;GACN,SAAS;GACT,YAAY,MACH,EAAc,SAAS,EAAK;GAEtC;EASD,gBAAgB;GACd,MAAM;GACN,SAAS;GACV;EAMD,WAAW;GACT,MAAM;GACN,SAAS;GACV;EAMD,SAAS;GACP,MAAM;GACN,SAAS;GACT,YAAY,MACH,OAAO,KAAK,EAAwB,CAAC,MAAM,MAAS,MAAS,EAAQ;GAE/E;EAKD,cAAc;GACZ,MAAM;IAAC;IAAQ;IAAO;IAAO;G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A,GAAA,EAD3C,EAcwB,GAAA;;KAZtB,KAAI;KACJ,MAAK;KACJ,OAAK,EAAE,EAAA,sCAAsC,EAAA,SAAO;KACpD,iBAAe,EAAA;;KAEL,SAAO,QAKd,CAHF,EAGE,EAAA,QAAA,iBAAA,EADC,OAAO,EAAA,cAAY,CAAA,CAAA,CAAA;;;IAKjB,EAAA,+BAAA,GAAA,EADT,EAGE,GAAA;;KADC,SAAO,EAAA"}
1
+ {"version":3,"file":"popover.js","names":[],"sources":["../../../components/popover/popover.vue"],"sourcesContent":["<!-- eslint-disable vuejs-accessibility/mouse-events-have-key-events -->\n<template>\n <div>\n <Teleport\n v-if=\"modal && isOpen\"\n to=\"body\"\n >\n <div\n class=\"d-modal--transparent\"\n aria-hidden=\"false\"\n @click.prevent.stop\n />\n </Teleport>\n <component\n :is=\"elementType\"\n ref=\"popover\"\n :class=\"['d-popover', { 'd-popover__anchor--opened': isOpen }]\"\n data-qa=\"dt-popover-container\"\n >\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <div\n :id=\"!ariaLabelledby && labelledBy\"\n ref=\"anchor\"\n :data-qa=\"$attrs['data-qa'] ? `${$attrs['data-qa']}-anchor` : 'dt-popover-anchor'\"\n :tabindex=\"openOnContext ? 0 : undefined\"\n @click.capture=\"defaultToggleOpen\"\n @contextmenu=\"onContext\"\n @keydown.up.prevent=\"onArrowKeyPress\"\n @keydown.down.prevent=\"onArrowKeyPress\"\n @keydown.escape.capture=\"closePopover\"\n @keydown.enter=\"$emit('keydown', $event)\"\n @keydown.space=\"$emit('keydown', $event)\"\n @mouseenter=\"onMouseEnter\"\n @mouseleave=\"onMouseLeave\"\n >\n <!-- @slot Anchor element that activates the popover. Usually a button. -->\n <slot\n name=\"anchor\"\n :attrs=\"{\n 'aria-expanded': isOpen.toString(),\n 'aria-controls': id,\n 'aria-haspopup': role,\n }\"\n />\n </div>\n <dt-lazy-show\n :id=\"id\"\n ref=\"content\"\n :role=\"role\"\n :data-qa=\"$attrs['data-qa'] ? `${$attrs['data-qa']}__dialog` : 'dt-popover'\"\n :aria-hidden=\"`${!isOpen}`\"\n :aria-labelledby=\"labelledBy\"\n :aria-label=\"ariaLabel\"\n :aria-modal=\"`${!modal}`\"\n :transition=\"transition\"\n :show=\"isOpen\"\n :appear=\"toAppear\"\n :class=\"['d-popover__dialog', { 'd-popover__dialog--modal': modal }, dialogClass]\"\n :style=\"{\n 'max-height': calculatedMaxHeight,\n 'max-width': maxWidth,\n }\"\n :css=\"$attrs.css\"\n :tabindex=\"contentTabindex\"\n v-on=\"popoverListeners\"\n @mouseenter=\"onMouseEnterAnchor\"\n @mouseleave=\"onMouseLeaveAnchor\"\n >\n <popover-header-footer\n v-if=\"hasSlotContent($slots.headerContent) || showCloseButton\"\n ref=\"popover__header\"\n :class=\"POPOVER_HEADER_FOOTER_PADDING_CLASSES[padding]\"\n :content-class=\"headerClass\"\n type=\"header\"\n :show-close-button=\"showCloseButton\"\n @close=\"closePopover\"\n >\n <template #content>\n <!-- @slot Slot for popover header content -->\n <slot\n name=\"headerContent\"\n :close=\"closePopover\"\n />\n </template>\n </popover-header-footer>\n <div\n ref=\"popover__content\"\n :data-qa=\"$attrs['data-qa'] ? `${$attrs['data-qa']}-content` : 'dt-popover-content'\"\n :class=\"[\n 'd-popover__content',\n POPOVER_PADDING_CLASSES[padding],\n contentClass,\n ]\"\n >\n <!-- @slot Slot for the content that is displayed in the popover when it is open. -->\n <slot\n name=\"content\"\n :close=\"closePopover\"\n />\n </div>\n <popover-header-footer\n v-if=\"hasSlotContent($slots.footerContent)\"\n ref=\"popover__footer\"\n type=\"footer\"\n :class=\"POPOVER_HEADER_FOOTER_PADDING_CLASSES[padding]\"\n :content-class=\"footerClass\"\n >\n <template #content>\n <!-- @slot Slot for the footer content. -->\n <slot\n name=\"footerContent\"\n :close=\"closePopover\"\n />\n </template>\n </popover-header-footer>\n <sr-only-close-button\n v-if=\"!showCloseButton\"\n @close=\"closePopover\"\n />\n </dt-lazy-show>\n </component>\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport {\n POPOVER_APPEND_TO_VALUES,\n POPOVER_BOUNDARY_VALUES,\n POPOVER_CONTENT_WIDTHS,\n POPOVER_HEADER_FOOTER_PADDING_CLASSES,\n POPOVER_INITIAL_FOCUS_STRINGS,\n POPOVER_PADDING_CLASSES,\n POPOVER_ROLES,\n POPOVER_STICKY_VALUES,\n} from './popover_constants';\nimport { getUniqueString, hasSlotContent, isOutOfViewPort, warnIfUnmounted, disableRootScrolling, enableRootScrolling, returnFirstEl } from '@/common/utils';\nimport { HTML_ELEMENT_TYPE } from '@/common/constants';\nimport { DtLazyShow } from '@/components/lazy_show';\nimport ModalMixin from '@/common/mixins/modal';\nimport { createTippyPopover, getPopperOptions } from './tippy_utils';\nimport PopoverHeaderFooter from './popover_header_footer.vue';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\n\n/**\n * A Popover displays a content overlay when its anchor element is activated.\n * @see https://dialtone.dialpad.com/components/popover.html\n */\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtPopover',\n\n /********************\n * CHILD COMPONENTS *\n ********************/\n components: {\n SrOnlyCloseButton,\n DtLazyShow,\n PopoverHeaderFooter,\n },\n\n mixins: [ModalMixin],\n\n props: {\n /**\n * Controls whether the popover is shown. Leaving this null will have the popover trigger on click by default.\n * If you set this value, the default trigger behavior will be disabled, and you can control it as you need.\n * Supports v-model\n * @values null, true, false\n */\n open: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Opens the popover on right click (context menu). If you set this value to `true`,\n * the default trigger behavior will be disabled.\n * @values true, false\n */\n openOnContext: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Element type (tag name) of the root element of the component.\n */\n elementType: {\n type: String,\n default: 'div',\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 * ARIA role for the content of the popover. Defaults to \"dialog\".\n * <a class=\"d-link\" href=\"https://www.w3.org/TR/wai-aria/#aria-haspopup\" target=\"_blank\">aria-haspopup</a>\n */\n role: {\n type: String,\n default: 'dialog',\n validator: (role) => {\n return POPOVER_ROLES.includes(role);\n },\n },\n\n /**\n * ID of the element that serves as the label for the popover content.\n * Defaults to the \"anchor\" element; this exists to provide a different\n * ID of the label element if, for example, the anchor slot contains\n * other items that do not serve as a label. You should provide this\n * or ariaLabel, but not both.\n */\n ariaLabelledby: {\n type: String,\n default: null,\n },\n\n /**\n * Descriptive label for the popover content. You should provide this\n * or ariaLabelledby, but not both.\n */\n ariaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * Padding size class for the popover content.\n * @values none, small, medium, large\n */\n padding: {\n type: String,\n default: 'large',\n validator: (padding) => {\n return Object.keys(POPOVER_PADDING_CLASSES).some((item) => item === padding);\n },\n },\n\n /**\n * Additional class name for the content wrapper element.\n */\n contentClass: {\n type: [String, Array, Object],\n default: '',\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 * @values null, anchor\n */\n contentWidth: {\n type: String,\n default: '',\n validator: contentWidth => POPOVER_CONTENT_WIDTHS.includes(contentWidth),\n },\n\n /**\n * Whether to apply transition on initial render in the content lazy show component.\n */\n contentAppear: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Tabindex value for the content. Passing null, no tabindex attribute will be set.\n */\n contentTabindex: {\n type: Number || null,\n default: -1,\n },\n\n /**\n * External anchor id to use in those cases the anchor can't be provided via the slot.\n * For instance, using the combobox's input as the anchor for the popover.\n * @deprecated Use externalAnchorElement instead for Shadow DOM compatibility.\n */\n externalAnchor: {\n type: String,\n default: '',\n },\n\n /**\n * External anchor element reference. Use this instead of externalAnchor when\n * the anchor may be inside a Shadow DOM, as querySelector cannot pierce shadow boundaries.\n */\n externalAnchorElement: {\n type: HTML_ELEMENT_TYPE,\n default: null,\n },\n\n /**\n * The id of the tooltip\n */\n id: {\n type: String,\n default () { return getUniqueString(); },\n },\n\n /**\n * Displaces the content box from its anchor element\n * by the specified number of pixels.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#offset\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n */\n offset: {\n type: Array,\n default: () => [0, 4],\n },\n\n /**\n * Determines if the popover hides upon clicking the\n * anchor or outside the content box.\n * @values true, false\n */\n hideOnClick: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Determines modal state. If enabled popover has a modal overlay\n * preventing interaction with elements below it, but it is invisible.\n * @values true, false\n */\n modal: {\n type: Boolean,\n default: true,\n },\n\n /**\n * If the popover does not fit in the direction described by \"placement\",\n * it will attempt to change its direction to the \"fallbackPlacements\".\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * */\n fallbackPlacements: {\n type: Array,\n default: () => {\n return ['auto'];\n },\n },\n\n /**\n * The element used to determine overflow boundaries for the popover.\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/utils/detect-overflow/#boundary\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * @values clippingParents, viewport, document, HTMLElement\n */\n boundary: {\n type: [String, HTML_ELEMENT_TYPE],\n default: 'clippingParents',\n validator: boundary => {\n return POPOVER_BOUNDARY_VALUES.includes(boundary) ||\n (boundary instanceof HTMLElement);\n },\n },\n\n /**\n * The direction the popover displays relative to the anchor.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#placement\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n * @values top, top-start, top-end,\n * right, right-start, right-end,\n * left, left-start, left-end,\n * bottom, bottom-start, bottom-end,\n * auto, auto-start, auto-end\n */\n placement: {\n type: String,\n default: 'bottom-end',\n },\n\n /**\n * If set to false the dialog will display over top of the anchor when there is insufficient space.\n * If set to true it will never move from its position relative to the anchor and will clip instead.\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/modifiers/prevent-overflow/#tether\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * @values true, false\n */\n tether: {\n type: Boolean,\n default: true,\n },\n\n /**\n * If the popover sticks to the anchor. This is usually not needed, but can be needed\n * if the reference element's position is animating, or to automatically update the popover\n * position in those cases the DOM layout changes the reference element's position.\n * `true` enables it, `reference` only checks the \"reference\" rect for changes and `popper` only\n * checks the \"popper\" rect for changes.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#sticky\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n * @values true, false, reference, popper\n */\n sticky: {\n type: [Boolean, String],\n default: false,\n validator: (sticky) => {\n return POPOVER_STICKY_VALUES.includes(sticky);\n },\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 * Determines visibility for close button\n * @values true, false\n */\n showCloseButton: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the header content wrapper element.\n */\n headerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the footer content wrapper element.\n */\n footerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the dialog element.\n */\n dialogClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * The element that is focused when the popover is opened. This can be an\n * HTMLElement within the popover, a string starting with '#' which will\n * find the element by ID. 'first' which will automatically focus\n * the first element, or 'dialog' which will focus the dialog window itself.\n * If the dialog is modal this prop cannot be 'none'.\n * @values none, dialog, first\n */\n initialFocusElement: {\n type: [String, HTML_ELEMENT_TYPE],\n default: 'first',\n validator: initialFocusElement => {\n return POPOVER_INITIAL_FOCUS_STRINGS.includes(initialFocusElement) ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n\n /**\n * If the popover should open pressing up or down arrow key on the anchor element.\n * This can be set when not passing open prop.\n * @values true, false\n */\n openWithArrowKeys: {\n type: Boolean,\n default: false,\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 * 'root' will try append to the iFrame's parent body if it is contained in an iFrame\n * and has permissions to access it, else, it'd default to 'parent'.\n * @values 'body', 'parent', 'root', 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 emits: [\n /**\n * Native keydown event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * Event fired to sync the open prop with the parent component\n * @event update:open\n */\n 'update:open',\n\n /**\n * Emitted when popover is shown or hidden\n *\n * @event opened\n * @type {Boolean | Array}\n */\n 'opened',\n\n /**\n * Emitted when the mouse enters the popover\n *\n * @event mouseenter-popover\n */\n 'mouseenter-popover',\n\n /**\n * Emitted when the mouse leaves the popover\n *\n * @event mouseleave-popover\n */\n 'mouseleave-popover',\n\n /**\n * Emitted when the mouse enters the popover anchor\n *\n * @event mouseenter-popover-anchor\n */\n 'mouseenter-popover-anchor',\n\n /**\n * Emitted when the mouse leaves the popover anchor\n *\n * @event mouseleave-popover-anchor\n */\n 'mouseleave-popover-anchor',\n ],\n\n data () {\n return {\n POPOVER_PADDING_CLASSES,\n POPOVER_HEADER_FOOTER_PADDING_CLASSES,\n intersectionObserver: null,\n mutationObserver: null,\n isOutsideViewport: false,\n isOpen: false,\n toAppear: false,\n anchorEl: null,\n popoverContentEl: null,\n hasSlotContent,\n };\n },\n\n computed: {\n popoverListeners () {\n return {\n keydown: event => {\n this.onKeydown(event);\n },\n\n 'after-leave': () => {\n this.onLeaveTransitionComplete();\n },\n\n 'after-enter': () => {\n this.onEnterTransitionComplete();\n },\n };\n },\n\n calculatedMaxHeight () {\n if (this.isOutsideViewport && this.modal) {\n return `calc(100vh - var(--dt-space-300))`;\n }\n return this.maxHeight;\n },\n\n labelledBy () {\n // aria-labelledby should be set only if aria-labelledby is passed as a prop, or if\n // there is no aria-label and the labelledby should point to the anchor.\n return this.ariaLabelledby || (!this.ariaLabel && getUniqueString('DtPopover__anchor'));\n },\n },\n\n watch: {\n $props: {\n immediate: true,\n deep: true,\n handler () {\n this.validateProps();\n },\n },\n\n modal (modal) {\n this.tip?.setProps({\n zIndex: modal ? 650 : this.calculateAnchorZindex(),\n });\n },\n\n offset (offset) {\n this.tip?.setProps({\n offset,\n });\n },\n\n sticky (sticky) {\n this.tip?.setProps({\n sticky,\n });\n },\n\n fallbackPlacements () {\n this.tip?.setProps({\n popperOptions: this.popperOptions(),\n });\n },\n\n tether () {\n this.tip?.setProps({\n popperOptions: this.popperOptions(),\n });\n },\n\n boundary () {\n this.tip?.setProps({ popperOptions: this.popperOptions() });\n },\n\n externalAnchorElement () {\n this.updateAnchorEl();\n },\n\n placement (placement) {\n this.tip?.setProps({\n placement,\n });\n },\n\n open: {\n handler: function (open) {\n if (open !== null) {\n this.isOpen = open;\n }\n if (open === true) {\n this.toAppear = true;\n }\n },\n\n immediate: true,\n },\n\n contentAppear: {\n handler: function (contentAppear) {\n if (contentAppear !== null) {\n this.toAppear = contentAppear;\n }\n },\n },\n\n isOpen (isOpen, isPrev) {\n if (isOpen) {\n this.initTippyInstance();\n this.tip?.show();\n } else if (!isOpen && isPrev !== isOpen) {\n this.removeEventListeners();\n this.tip?.hide();\n }\n },\n },\n\n mounted () {\n warnIfUnmounted(returnFirstEl(this.$el), this.$options.name);\n\n this.popoverContentEl = returnFirstEl(this.$refs.content?.$el);\n this.updateAnchorEl();\n\n this.mutationObserver = new MutationObserver(this.updateAnchorEl);\n this.mutationObserver.observe(this.$refs.anchor, {childList: true});\n\n // rootMargin here must be greater than the margin of the height we are setting in calculatedMaxHeight which\n // currently is var(--dt-space-300) (4px). If not the intersectionObserver will continually trigger in an infinite\n // loop.\n // threshold 1.0 makes this trigger every time the dialog \"touches\" the edge of the viewport.\n this.intersectionObserver = new IntersectionObserver(this.hasIntersectedViewport);\n this.intersectionObserver.observe(this.popoverContentEl);\n },\n\n beforeUnmount () {\n this._isUnmounting = true;\n // Cancel any in-progress CSS transitions so transitionend cannot fire\n // after this component is torn down and call into dead lifecycle methods.\n if (this.popoverContentEl) {\n this.popoverContentEl.style.transition = 'none';\n }\n this.tip?.destroy();\n this.intersectionObserver?.disconnect();\n this.mutationObserver?.disconnect();\n this.removeReferences();\n this.removeEventListeners();\n },\n\n /******************\n * METHODS *\n ******************/\n methods: {\n\n hasIntersectedViewport (entries) {\n const dialog = entries?.[0]?.target;\n if (!dialog) return;\n const isOut = isOutOfViewPort(dialog);\n this.isOutsideViewport = isOut.bottom || isOut.top;\n },\n\n updateAnchorEl () {\n const externalAnchorEl = this.externalAnchorElement ||\n (this.externalAnchor\n ? this.$refs.anchor.getRootNode().querySelector(`#${this.externalAnchor}`)\n : null);\n const anchorEl = externalAnchorEl ?? this.$refs.anchor.children[0];\n if (anchorEl === this.anchorEl) {\n return;\n }\n this.anchorEl = anchorEl;\n\n this.tip?.destroy();\n delete this.tip;\n\n if (!this.anchorEl) {\n console.warn('No anchor found for popover');\n return;\n }\n\n if (this.isOpen) {\n this.initTippyInstance();\n this.tip?.show();\n }\n },\n\n popperOptions () {\n return getPopperOptions({\n fallbackPlacements: this.fallbackPlacements,\n tether: this.tether,\n hasHideModifierEnabled: true,\n boundary: this.boundary,\n });\n },\n\n validateProps () {\n if (this.modal && this.initialFocusElement === 'none') {\n console.error('If the popover is modal you must set the ' +\n 'initialFocusElement prop. Possible values: \"dialog\", \"first\", HTMLElement');\n }\n },\n\n calculateAnchorZindex () {\n // if a modal is currently active render at modal-element z-index, otherwise at popover z-index\n if (returnFirstEl(this.$el).getRootNode()\n .querySelector('.d-modal[aria-hidden=\"false\"], .d-modal--transparent[aria-hidden=\"false\"]') ||\n // Special case because we don't have any dialtone drawer component yet. Render at 650 when\n // anchor of popover is within a drawer.\n this.anchorEl?.closest('.d-zi-drawer')) {\n return 650;\n } else {\n return 300;\n }\n },\n\n defaultToggleOpen (e) {\n if (this.openOnContext) { return; }\n\n // Only use default toggle behaviour if the user has not set the open prop.\n // Check that the anchor element specifically was clicked.\n if (this.open === null || this.open === undefined) {\n if ((!this.anchorEl?.contains(e.target) && !this.anchorEl?.isEqualNode(e.target)) || this.anchorEl?.disabled) {\n return;\n }\n\n this.toggleOpen();\n }\n },\n\n async onContext (event) {\n if (!this.openOnContext) { return; }\n\n event.preventDefault();\n\n this.isOpen = true;\n await this.$nextTick();\n this.tip?.setProps({\n placement: 'right-start',\n getReferenceClientRect: () => ({\n width: 0,\n height: 0,\n top: event.clientY,\n bottom: event.clientY,\n left: event.clientX,\n right: event.clientX,\n }),\n });\n },\n\n toggleOpen () {\n this.isOpen = !this.isOpen;\n },\n\n onArrowKeyPress (e) {\n if (this.open !== null) { return; }\n if (this.openWithArrowKeys && this.anchorEl?.contains(e.target)) {\n if (!this.isOpen) {\n this.isOpen = true;\n }\n }\n\n this.$emit('keydown', e);\n },\n\n addEventListeners () {\n window.addEventListener('dt-popover-close', this.closePopover);\n // align popover content width when contentWidth is 'anchor'\n if (this.contentWidth === 'anchor') {\n window.addEventListener('resize', this.onResize);\n }\n },\n\n removeEventListeners () {\n window.removeEventListener('dt-popover-close', this.closePopover);\n if (this.contentWidth === 'anchor') {\n window.removeEventListener('resize', this.onResize);\n }\n },\n\n closePopover () {\n this.isOpen = false;\n },\n\n /*\n * Prevents scrolling outside of the currently opened modal popover by:\n * - when anchor is not within another popover: setting the body to overflow: hidden\n * - when anchor is within another popover: set the popover dialog container to it's non-modal z-index\n * since it is no longer the active modal. This puts it underneath the overlay and prevents scrolling.\n **/\n preventScrolling () {\n if (this.modal) {\n const element = this.anchorEl?.closest('body, .tippy-box');\n if (!element) return;\n if (element.tagName?.toLowerCase() === 'body') {\n disableRootScrolling(this.anchorEl.getRootNode().host);\n this.tip?.setProps({ offset: this.offset });\n } else {\n element.classList.add('d-zi-popover');\n }\n }\n },\n\n /*\n * Resets the prevent scrolling properties set in preventScrolling() back to normal.\n **/\n enableScrolling () {\n const element = this.anchorEl?.closest('body, .tippy-box');\n if (!element) return;\n if (element.tagName?.toLowerCase() === 'body') {\n enableRootScrolling(this.anchorEl.getRootNode().host);\n this.tip?.setProps({ offset: this.offset });\n } else {\n element.classList.remove('d-zi-popover');\n }\n },\n\n removeReferences () {\n this.anchorEl = null;\n this.popoverContentEl = null;\n this.tip = null;\n },\n\n async onShow () {\n if (this.contentWidth === 'anchor') {\n await this.setPopoverContentAnchorWidth();\n if (this._isUnmounting) return;\n }\n\n if (this.contentWidth === null) {\n this.popoverContentEl.style.width = 'auto';\n }\n\n this.addEventListeners();\n },\n\n async onLeaveTransitionComplete () {\n if (this._isUnmounting) return;\n if (this.modal) {\n await this.focusFirstElement(this.$refs.anchor);\n if (this._isUnmounting) return;\n // await next tick in case the user wants to change focus themselves.\n await this.$nextTick();\n if (this._isUnmounting) return;\n this.enableScrolling();\n }\n if (this._isUnmounting) return;\n this.tip?.unmount();\n this.$emit('opened', false);\n if (this.open !== null) {\n this.$emit('update:open', false);\n }\n },\n\n async onEnterTransitionComplete () {\n if (this._isUnmounting) return;\n this.focusInitialElement();\n // await next tick in case the user wants to change focus themselves.\n await this.$nextTick();\n if (this._isUnmounting) return;\n this.preventScrolling();\n this.$emit('opened', true, this.$refs.popover__content);\n if (this.open !== null) {\n this.$emit('update:open', true);\n }\n },\n\n focusInitialElement () {\n if (this.initialFocusElement === 'dialog') {\n returnFirstEl(this.$refs.content?.$el)?.focus();\n }\n // find by ID\n if (this.initialFocusElement.startsWith('#')) {\n this.focusInitialElementById();\n }\n if (this.initialFocusElement === 'first') {\n this.focusFirstElementIfNeeded(this.$refs.popover__content);\n }\n if (this.initialFocusElement instanceof HTMLElement) {\n this.initialFocusElement.focus();\n }\n },\n\n focusInitialElementById () {\n const result = returnFirstEl(this.$refs.content?.$el)?.querySelector(this.initialFocusElement);\n if (result) {\n result.focus();\n } else {\n console.warn('Could not find the element specified in dt-popover prop \"initialFocusElement\". ' +\n 'Defaulting to focusing the dialog.');\n returnFirstEl(this.$refs.content?.$el)?.focus();\n }\n },\n\n onResize () {\n this.closePopover();\n },\n\n onClickOutside () {\n if (!this.hideOnClick) return;\n // If a popover is opened inside of this one, do not hide on click out\n const innerModals = this.popoverContentEl?.querySelector('.d-popover__anchor--opened');\n if (!innerModals) {\n this.closePopover();\n }\n },\n\n onKeydown (e) {\n if (e.key === 'Tab') {\n if (this.modal) {\n this.focusTrappedTabPress(e, this.popoverContentEl);\n }\n }\n if (e.key === 'Escape') {\n this.closePopover();\n }\n\n this.$emit('keydown', e);\n },\n\n async setPopoverContentAnchorWidth () {\n await this.$nextTick();\n this.popoverContentEl.style.width = `${this.anchorEl?.clientWidth}px`;\n },\n\n focusFirstElementIfNeeded (domEl) {\n const focusableElements = this._getFocusableElements(domEl, true);\n if (focusableElements.length !== 0) {\n this.focusFirstElement(domEl);\n } else if (this.showCloseButton) {\n this.$refs.popover__header?.focusCloseButton();\n } else {\n // if there are no focusable elements at all focus the dialog itself\n returnFirstEl(this.$refs.content?.$el).focus();\n }\n },\n\n /**\n * Return's the anchor ClientRect object relative to the window.\n * Refer to: https://atomiks.github.io/tippyjs/v6/all-props/#getreferenceclientrect for more information\n * @param error\n */\n getReferenceClientRect (error) {\n const anchorReferenceRect = this.anchorEl?.getBoundingClientRect();\n\n if (this.appendTo !== 'root' || error) return anchorReferenceRect;\n\n const anchorOwnerDocument = this.anchorEl?.ownerDocument;\n const anchorParentWindow = anchorOwnerDocument?.defaultView || anchorOwnerDocument?.parentWindow;\n const anchorIframe = anchorParentWindow?.frameElement;\n\n if (!anchorIframe) return anchorReferenceRect;\n\n const iframeReferenceRect = anchorIframe.getBoundingClientRect();\n\n return {\n width: anchorReferenceRect?.width,\n height: anchorReferenceRect?.height,\n top: iframeReferenceRect?.top + anchorReferenceRect?.top,\n left: iframeReferenceRect?.left + anchorReferenceRect?.left,\n right: iframeReferenceRect?.right + anchorReferenceRect?.right,\n bottom: iframeReferenceRect?.bottom + anchorReferenceRect?.bottom,\n };\n },\n\n initTippyInstance () {\n let internalAppendTo = null;\n let iFrameError = false;\n\n switch (this.appendTo) {\n case 'body':\n internalAppendTo = this.anchorEl?.getRootNode()?.querySelector('body');\n break;\n\n case 'root':\n // Try to attach the popover to root document, fallback to parent is fail\n try {\n internalAppendTo = window.parent.document.body;\n } catch (err) {\n console.error('Could not attach the popover to iframe parent window: ', err);\n internalAppendTo = 'parent';\n iFrameError = true;\n }\n break;\n\n default:\n internalAppendTo = this.appendTo;\n break;\n }\n\n this.tip?.destroy();\n\n this.tip = createTippyPopover(this.anchorEl, {\n popperOptions: this.popperOptions(),\n contentElement: this.popoverContentEl,\n placement: this.placement,\n offset: this.offset,\n sticky: this.sticky,\n appendTo: internalAppendTo,\n interactive: true,\n trigger: 'manual',\n getReferenceClientRect: () => this.getReferenceClientRect(iFrameError),\n // We have to manage hideOnClick functionality manually to handle\n // popover within popover situations.\n hideOnClick: false,\n zIndex: this.modal ? 650 : this.calculateAnchorZindex(),\n onClickOutside: this.onClickOutside,\n onShow: this.onShow,\n });\n },\n\n onMouseEnter () {\n this.$emit('mouseenter-popover');\n },\n\n onMouseLeave () {\n this.$emit('mouseleave-popover');\n },\n\n onMouseEnterAnchor () {\n this.$emit('mouseenter-popover-anchor');\n },\n\n onMouseLeaveAnchor () {\n this.$emit('mouseleave-popover-anchor');\n },\n },\n};\n</script>\n"],"mappings":";;;;;;;;;;;AAoJA,IAAK,IAAU;CACb,cAAc,EAAE,MAAM,GAAG;CACzB,MAAM;CAKN,YAAY;EACV,mBAAA;EACA,YAAA;EACA,qBAAA;EACD;CAED,QAAQ,CAAC,EAAW;CAEpB,OAAO;EAOL,MAAM;GACJ,MAAM;GACN,SAAS;GACV;EAOD,e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B,cAAY,EAAA;GACZ,cAAY,EAAA;;oBAkBW;IAfhB,EAAA,eAAe,EAAA,OAAO,cAAa,IAAK,EAAA,mBAAA,GAAA,EADhD,EAgBwB,GAAA;;KAdtB,KAAI;KACH,OAAK,EAAE,EAAA,sCAAsC,EAAA,SAAO;KACpD,iBAAe,EAAA;KAChB,MAAK;KACJ,qBAAmB,EAAA;KACnB,SAAO,EAAA;;KAEG,SAAO,QAKd,CAHF,EAGE,EAAA,QAAA,iBAAA,EADC,OAAO,EAAA,cAAY,CAAA,CAAA,CAAA;;;;;;;;IAI1B,EAcM,OAAA;KAbJ,KAAI;KACH,WAAS,EAAA,OAAM,aAAA,GAAiB,EAAA,OAAM,WAAA,YAAA;KACtC,OAAK,EAAA;;MAAkD,EAAA,wBAAwB,EAAA;MAAsB,EAAA;;QAOtG,EAGE,EAAA,QAAA,WAAA,EADC,OAAO,EAAA,cAAY,CAAA,CAAA,EAAA,IAAA,EAAA;IAIhB,EAAA,eAAe,EAAA,OAAO,cAAa,IAAA,GAAA,EAD3C,EAcwB,GAAA;;KAZtB,KAAI;KACJ,MAAK;KACJ,OAAK,EAAE,EAAA,sCAAsC,EAAA,SAAO;KACpD,iBAAe,EAAA;;KAEL,SAAO,QAKd,CAHF,EAGE,EAAA,QAAA,iBAAA,EADC,OAAO,EAAA,cAAY,CAAA,CAAA,CAAA;;;IAKjB,EAAA,+BAAA,GAAA,EADT,EAGE,GAAA;;KADC,SAAO,EAAA"}
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../chunk-Bmb41Sf3.cjs`);let t=require(`tippy.js`);t=e.t(t);var n=[`bottom`,`bottom-start`,`bottom-end`,`right`,`right-start`,`right-end`,`left`,`left-start`,`left-end`,`top`,`top-start`,`top-end`],r=[!0,!1,`reference`,`popper`],i=(e,n)=>{let{contentElement:r}={...n};return delete n.contentElement,(0,t.default)(e,{...n,plugins:[t.sticky],render:()=>l(r)})},a=(e,n)=>(0,t.default)(e,{...n,plugins:[t.sticky]}),o=({boundary:e=`clippingParents`,fallbackPlacements:t=[],hasHideModifierEnabled:n=!1,tether:r=!0}={})=>({modifiers:[{name:`flip`,options:{fallbackPlacements:t,boundary:e}},{name:`hide`,enabled:n},{name:`preventOverflow`,options:{altAxis:!r,tether:r}}]}),s=e=>{let t=document.createElement(`span`);return t.innerText=e.innerText||``,e.innerText=``,e.appendChild(t),t},c=e=>{if(!e){console.warn(`No anchor wrapper provided. This may cause issues with the popover.`);return}return e.children[0]||s(e)},l=e=>{let t=document.createElement(`div`);return t.className=`tippy-box d-ps-absolute`,t.appendChild(e),{popper:t}};exports.BASE_TIPPY_DIRECTIONS=n,exports.TIPPY_STICKY_VALUES=r,exports.createTippy=a,exports.createTippyPopover=i,exports.getAnchor=c,exports.getContentWrapper=l,exports.getPopperOptions=o;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../chunk-Bmb41Sf3.cjs`);let t=require(`tippy.js`);t=e.t(t);var n=[`bottom`,`bottom-start`,`bottom-end`,`right`,`right-start`,`right-end`,`left`,`left-start`,`left-end`,`top`,`top-start`,`top-end`],r=[!0,!1,`reference`,`popper`],i=(e,n)=>{let{contentElement:r}={...n};return delete n.contentElement,(0,t.default)(e,{...n,plugins:[t.sticky],render:()=>l(r)})},a=(e,n)=>(0,t.default)(e,{...n,plugins:[t.sticky]}),o=({boundary:e=`clippingParents`,fallbackPlacements:t=[],hasHideModifierEnabled:n=!1,tether:r=!0}={})=>({modifiers:[{name:`flip`,options:{fallbackPlacements:t,boundary:e}},{name:`hide`,enabled:n},{name:`preventOverflow`,options:{altAxis:!r,tether:r,boundary:e}}]}),s=e=>{let t=document.createElement(`span`);return t.innerText=e.innerText||``,e.innerText=``,e.appendChild(t),t},c=e=>{if(!e){console.warn(`No anchor wrapper provided. This may cause issues with the popover.`);return}return e.children[0]||s(e)},l=e=>{let t=document.createElement(`div`);return t.className=`tippy-box d-ps-absolute`,t.appendChild(e),{popper:t}};exports.BASE_TIPPY_DIRECTIONS=n,exports.TIPPY_STICKY_VALUES=r,exports.createTippy=a,exports.createTippyPopover=i,exports.getAnchor=c,exports.getContentWrapper=l,exports.getPopperOptions=o;
2
2
  //# sourceMappingURL=tippy-utils.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"tippy-utils.cjs","names":["sticky"],"sources":["../../../components/popover/tippy_utils.js"],"sourcesContent":["import tippy, { sticky } from 'tippy.js';\n\nexport const BASE_TIPPY_DIRECTIONS = [\n 'bottom', 'bottom-start', 'bottom-end',\n 'right', 'right-start', 'right-end',\n 'left', 'left-start', 'left-end',\n 'top', 'top-start', 'top-end',\n];\n\nexport const TIPPY_STICKY_VALUES = [true, false, 'reference', 'popper'];\nexport const createTippyPopover = (anchorElement, options) => {\n const { contentElement } = { ...options };\n delete options.contentElement;\n return tippy(anchorElement, {\n ...options,\n plugins: [sticky],\n render: () => getContentWrapper(contentElement),\n });\n};\n\nexport const createTippy = (anchorElement, options) => {\n return tippy(anchorElement, {\n ...options,\n plugins: [sticky],\n });\n};\n\nexport const getPopperOptions = ({\n boundary = 'clippingParents',\n fallbackPlacements = [],\n hasHideModifierEnabled = false,\n // If set to false the dialog will display over top of the anchor when there is insufficient space.\n // if set to true it will never move from its position relative to the anchor and will clip instead.\n tether = true,\n} = {}) => {\n return {\n modifiers: [\n {\n name: 'flip',\n options: {\n fallbackPlacements,\n boundary,\n },\n },\n {\n name: 'hide',\n enabled: hasHideModifierEnabled,\n },\n {\n name: 'preventOverflow',\n options: {\n altAxis: !tether,\n tether,\n },\n },\n ],\n };\n};\n\nconst createAnchor = (anchorWrapper) => {\n const span = document.createElement('span');\n span.innerText = anchorWrapper.innerText || '';\n anchorWrapper.innerText = '';\n anchorWrapper.appendChild(span);\n return span;\n};\n\nexport const getAnchor = (anchorWrapper) => {\n if (!anchorWrapper) {\n console.warn('No anchor wrapper provided. This may cause issues with the popover.');\n return;\n }\n const anchor = anchorWrapper.children[0];\n if (!anchor) return createAnchor(anchorWrapper);\n return anchor;\n};\n\nexport const getContentWrapper = content => {\n // The recommended structure is to use the popper as an outer wrapper\n const popper = document.createElement('div');\n popper.className = 'tippy-box d-ps-absolute';\n popper.appendChild(content);\n return {\n popper,\n };\n};\n"],"mappings":"kJAEA,IAAa,EAAwB,CACnC,SAAU,eAAgB,aAC1B,QAAS,cAAe,YACxB,OAAQ,aAAc,WACtB,MAAO,YAAa,UACrB,CAEY,EAAsB,CAAC,GAAM,GAAO,YAAa,SAAS,CAC1D,GAAsB,EAAe,IAAY,CAC5D,GAAM,CAAE,kBAAmB,CAAE,GAAG,EAAS,CAEzC,OADA,OAAO,EAAQ,gBACf,EAAA,EAAA,SAAa,EAAe,CAC1B,GAAG,EACH,QAAS,CAACA,EAAAA,OAAO,CACjB,WAAc,EAAkB,EAAe,CAChD,CAAC,EAGS,GAAe,EAAe,KACzC,EAAA,EAAA,SAAa,EAAe,CAC1B,GAAG,EACH,QAAS,CAACA,EAAAA,OAAO,CAClB,CAAC,CAGS,GAAoB,CAC/B,WAAW,kBACX,qBAAqB,EAAE,CACvB,yBAAyB,GAGzB,SAAS,IACP,EAAE,IACG,CACL,UAAW,CACT,CACE,KAAM,OACN,QAAS,CACP,qBACA,WACD,CACF,CACD,CACE,KAAM,OACN,QAAS,EACV,CACD,CACE,KAAM,kBACN,QAAS,CACP,QAAS,CAAC,EACV,SACD,CACF,CACF,CACF,EAGG,EAAgB,GAAkB,CACtC,IAAM,EAAO,SAAS,cAAc,OAAO,CAI3C,MAHA,GAAK,UAAY,EAAc,WAAa,GAC5C,EAAc,UAAY,GAC1B,EAAc,YAAY,EAAK,CACxB,GAGI,EAAa,GAAkB,CAC1C,GAAI,CAAC,EAAe,CAClB,QAAQ,KAAK,sEAAsE,CACnF,OAIF,OAFe,EAAc,SAAS,IAClB,EAAa,EAAc,EAIpC,EAAoB,GAAW,CAE1C,IAAM,EAAS,SAAS,cAAc,MAAM,CAG5C,MAFA,GAAO,UAAY,0BACnB,EAAO,YAAY,EAAQ,CACpB,CACL,SACD"}
1
+ {"version":3,"file":"tippy-utils.cjs","names":["sticky"],"sources":["../../../components/popover/tippy_utils.js"],"sourcesContent":["import tippy, { sticky } from 'tippy.js';\n\nexport const BASE_TIPPY_DIRECTIONS = [\n 'bottom', 'bottom-start', 'bottom-end',\n 'right', 'right-start', 'right-end',\n 'left', 'left-start', 'left-end',\n 'top', 'top-start', 'top-end',\n];\n\nexport const TIPPY_STICKY_VALUES = [true, false, 'reference', 'popper'];\nexport const createTippyPopover = (anchorElement, options) => {\n const { contentElement } = { ...options };\n delete options.contentElement;\n return tippy(anchorElement, {\n ...options,\n plugins: [sticky],\n render: () => getContentWrapper(contentElement),\n });\n};\n\nexport const createTippy = (anchorElement, options) => {\n return tippy(anchorElement, {\n ...options,\n plugins: [sticky],\n });\n};\n\nexport const getPopperOptions = ({\n boundary = 'clippingParents',\n fallbackPlacements = [],\n hasHideModifierEnabled = false,\n // If set to false the dialog will display over top of the anchor when there is insufficient space.\n // if set to true it will never move from its position relative to the anchor and will clip instead.\n tether = true,\n} = {}) => {\n return {\n modifiers: [\n {\n name: 'flip',\n options: {\n fallbackPlacements,\n boundary,\n },\n },\n {\n name: 'hide',\n enabled: hasHideModifierEnabled,\n },\n {\n name: 'preventOverflow',\n options: {\n altAxis: !tether,\n tether,\n boundary,\n },\n },\n ],\n };\n};\n\nconst createAnchor = (anchorWrapper) => {\n const span = document.createElement('span');\n span.innerText = anchorWrapper.innerText || '';\n anchorWrapper.innerText = '';\n anchorWrapper.appendChild(span);\n return span;\n};\n\nexport const getAnchor = (anchorWrapper) => {\n if (!anchorWrapper) {\n console.warn('No anchor wrapper provided. This may cause issues with the popover.');\n return;\n }\n const anchor = anchorWrapper.children[0];\n if (!anchor) return createAnchor(anchorWrapper);\n return anchor;\n};\n\nexport const getContentWrapper = content => {\n // The recommended structure is to use the popper as an outer wrapper\n const popper = document.createElement('div');\n popper.className = 'tippy-box d-ps-absolute';\n popper.appendChild(content);\n return {\n popper,\n };\n};\n"],"mappings":"kJAEA,IAAa,EAAwB,CACnC,SAAU,eAAgB,aAC1B,QAAS,cAAe,YACxB,OAAQ,aAAc,WACtB,MAAO,YAAa,UACrB,CAEY,EAAsB,CAAC,GAAM,GAAO,YAAa,SAAS,CAC1D,GAAsB,EAAe,IAAY,CAC5D,GAAM,CAAE,kBAAmB,CAAE,GAAG,EAAS,CAEzC,OADA,OAAO,EAAQ,gBACf,EAAA,EAAA,SAAa,EAAe,CAC1B,GAAG,EACH,QAAS,CAACA,EAAAA,OAAO,CACjB,WAAc,EAAkB,EAAe,CAChD,CAAC,EAGS,GAAe,EAAe,KACzC,EAAA,EAAA,SAAa,EAAe,CAC1B,GAAG,EACH,QAAS,CAACA,EAAAA,OAAO,CAClB,CAAC,CAGS,GAAoB,CAC/B,WAAW,kBACX,qBAAqB,EAAE,CACvB,yBAAyB,GAGzB,SAAS,IACP,EAAE,IACG,CACL,UAAW,CACT,CACE,KAAM,OACN,QAAS,CACP,qBACA,WACD,CACF,CACD,CACE,KAAM,OACN,QAAS,EACV,CACD,CACE,KAAM,kBACN,QAAS,CACP,QAAS,CAAC,EACV,SACA,WACD,CACF,CACF,CACF,EAGG,EAAgB,GAAkB,CACtC,IAAM,EAAO,SAAS,cAAc,OAAO,CAI3C,MAHA,GAAK,UAAY,EAAc,WAAa,GAC5C,EAAc,UAAY,GAC1B,EAAc,YAAY,EAAK,CACxB,GAGI,EAAa,GAAkB,CAC1C,GAAI,CAAC,EAAe,CAClB,QAAQ,KAAK,sEAAsE,CACnF,OAIF,OAFe,EAAc,SAAS,IAClB,EAAa,EAAc,EAIpC,EAAoB,GAAW,CAE1C,IAAM,EAAS,SAAS,cAAc,MAAM,CAG5C,MAFA,GAAO,UAAY,0BACnB,EAAO,YAAY,EAAQ,CACpB,CACL,SACD"}
@@ -44,7 +44,8 @@ var n = [
44
44
  name: "preventOverflow",
45
45
  options: {
46
46
  altAxis: !r,
47
- tether: r
47
+ tether: r,
48
+ boundary: e
48
49
  }
49
50
  }
50
51
  ] }), s = (e) => {
@@ -1 +1 @@
1
- {"version":3,"file":"tippy-utils.js","names":[],"sources":["../../../components/popover/tippy_utils.js"],"sourcesContent":["import tippy, { sticky } from 'tippy.js';\n\nexport const BASE_TIPPY_DIRECTIONS = [\n 'bottom', 'bottom-start', 'bottom-end',\n 'right', 'right-start', 'right-end',\n 'left', 'left-start', 'left-end',\n 'top', 'top-start', 'top-end',\n];\n\nexport const TIPPY_STICKY_VALUES = [true, false, 'reference', 'popper'];\nexport const createTippyPopover = (anchorElement, options) => {\n const { contentElement } = { ...options };\n delete options.contentElement;\n return tippy(anchorElement, {\n ...options,\n plugins: [sticky],\n render: () => getContentWrapper(contentElement),\n });\n};\n\nexport const createTippy = (anchorElement, options) => {\n return tippy(anchorElement, {\n ...options,\n plugins: [sticky],\n });\n};\n\nexport const getPopperOptions = ({\n boundary = 'clippingParents',\n fallbackPlacements = [],\n hasHideModifierEnabled = false,\n // If set to false the dialog will display over top of the anchor when there is insufficient space.\n // if set to true it will never move from its position relative to the anchor and will clip instead.\n tether = true,\n} = {}) => {\n return {\n modifiers: [\n {\n name: 'flip',\n options: {\n fallbackPlacements,\n boundary,\n },\n },\n {\n name: 'hide',\n enabled: hasHideModifierEnabled,\n },\n {\n name: 'preventOverflow',\n options: {\n altAxis: !tether,\n tether,\n },\n },\n ],\n };\n};\n\nconst createAnchor = (anchorWrapper) => {\n const span = document.createElement('span');\n span.innerText = anchorWrapper.innerText || '';\n anchorWrapper.innerText = '';\n anchorWrapper.appendChild(span);\n return span;\n};\n\nexport const getAnchor = (anchorWrapper) => {\n if (!anchorWrapper) {\n console.warn('No anchor wrapper provided. This may cause issues with the popover.');\n return;\n }\n const anchor = anchorWrapper.children[0];\n if (!anchor) return createAnchor(anchorWrapper);\n return anchor;\n};\n\nexport const getContentWrapper = content => {\n // The recommended structure is to use the popper as an outer wrapper\n const popper = document.createElement('div');\n popper.className = 'tippy-box d-ps-absolute';\n popper.appendChild(content);\n return {\n popper,\n };\n};\n"],"mappings":";;AAEA,IAAa,IAAwB;CACnC;CAAU;CAAgB;CAC1B;CAAS;CAAe;CACxB;CAAQ;CAAc;CACtB;CAAO;CAAa;CACrB,EAEY,IAAsB;CAAC;CAAM;CAAO;CAAa;CAAS,EAC1D,KAAsB,GAAe,MAAY;CAC5D,IAAM,EAAE,sBAAmB,EAAE,GAAG,GAAS;AAEzC,QADA,OAAO,EAAQ,gBACR,EAAM,GAAe;EAC1B,GAAG;EACH,SAAS,CAAC,EAAO;EACjB,cAAc,EAAkB,EAAe;EAChD,CAAC;GAGS,KAAe,GAAe,MAClC,EAAM,GAAe;CAC1B,GAAG;CACH,SAAS,CAAC,EAAO;CAClB,CAAC,EAGS,KAAoB,EAC/B,cAAW,mBACX,wBAAqB,EAAE,EACvB,4BAAyB,IAGzB,YAAS,OACP,EAAE,MACG,EACL,WAAW;CACT;EACE,MAAM;EACN,SAAS;GACP;GACA;GACD;EACF;CACD;EACE,MAAM;EACN,SAAS;EACV;CACD;EACE,MAAM;EACN,SAAS;GACP,SAAS,CAAC;GACV;GACD;EACF;CACF,EACF,GAGG,KAAgB,MAAkB;CACtC,IAAM,IAAO,SAAS,cAAc,OAAO;AAI3C,QAHA,EAAK,YAAY,EAAc,aAAa,IAC5C,EAAc,YAAY,IAC1B,EAAc,YAAY,EAAK,EACxB;GAGI,KAAa,MAAkB;AAC1C,KAAI,CAAC,GAAe;AAClB,UAAQ,KAAK,sEAAsE;AACnF;;AAIF,QAFe,EAAc,SAAS,MAClB,EAAa,EAAc;GAIpC,KAAoB,MAAW;CAE1C,IAAM,IAAS,SAAS,cAAc,MAAM;AAG5C,QAFA,EAAO,YAAY,2BACnB,EAAO,YAAY,EAAQ,EACpB,EACL,WACD"}
1
+ {"version":3,"file":"tippy-utils.js","names":[],"sources":["../../../components/popover/tippy_utils.js"],"sourcesContent":["import tippy, { sticky } from 'tippy.js';\n\nexport const BASE_TIPPY_DIRECTIONS = [\n 'bottom', 'bottom-start', 'bottom-end',\n 'right', 'right-start', 'right-end',\n 'left', 'left-start', 'left-end',\n 'top', 'top-start', 'top-end',\n];\n\nexport const TIPPY_STICKY_VALUES = [true, false, 'reference', 'popper'];\nexport const createTippyPopover = (anchorElement, options) => {\n const { contentElement } = { ...options };\n delete options.contentElement;\n return tippy(anchorElement, {\n ...options,\n plugins: [sticky],\n render: () => getContentWrapper(contentElement),\n });\n};\n\nexport const createTippy = (anchorElement, options) => {\n return tippy(anchorElement, {\n ...options,\n plugins: [sticky],\n });\n};\n\nexport const getPopperOptions = ({\n boundary = 'clippingParents',\n fallbackPlacements = [],\n hasHideModifierEnabled = false,\n // If set to false the dialog will display over top of the anchor when there is insufficient space.\n // if set to true it will never move from its position relative to the anchor and will clip instead.\n tether = true,\n} = {}) => {\n return {\n modifiers: [\n {\n name: 'flip',\n options: {\n fallbackPlacements,\n boundary,\n },\n },\n {\n name: 'hide',\n enabled: hasHideModifierEnabled,\n },\n {\n name: 'preventOverflow',\n options: {\n altAxis: !tether,\n tether,\n boundary,\n },\n },\n ],\n };\n};\n\nconst createAnchor = (anchorWrapper) => {\n const span = document.createElement('span');\n span.innerText = anchorWrapper.innerText || '';\n anchorWrapper.innerText = '';\n anchorWrapper.appendChild(span);\n return span;\n};\n\nexport const getAnchor = (anchorWrapper) => {\n if (!anchorWrapper) {\n console.warn('No anchor wrapper provided. This may cause issues with the popover.');\n return;\n }\n const anchor = anchorWrapper.children[0];\n if (!anchor) return createAnchor(anchorWrapper);\n return anchor;\n};\n\nexport const getContentWrapper = content => {\n // The recommended structure is to use the popper as an outer wrapper\n const popper = document.createElement('div');\n popper.className = 'tippy-box d-ps-absolute';\n popper.appendChild(content);\n return {\n popper,\n };\n};\n"],"mappings":";;AAEA,IAAa,IAAwB;CACnC;CAAU;CAAgB;CAC1B;CAAS;CAAe;CACxB;CAAQ;CAAc;CACtB;CAAO;CAAa;CACrB,EAEY,IAAsB;CAAC;CAAM;CAAO;CAAa;CAAS,EAC1D,KAAsB,GAAe,MAAY;CAC5D,IAAM,EAAE,sBAAmB,EAAE,GAAG,GAAS;AAEzC,QADA,OAAO,EAAQ,gBACR,EAAM,GAAe;EAC1B,GAAG;EACH,SAAS,CAAC,EAAO;EACjB,cAAc,EAAkB,EAAe;EAChD,CAAC;GAGS,KAAe,GAAe,MAClC,EAAM,GAAe;CAC1B,GAAG;CACH,SAAS,CAAC,EAAO;CAClB,CAAC,EAGS,KAAoB,EAC/B,cAAW,mBACX,wBAAqB,EAAE,EACvB,4BAAyB,IAGzB,YAAS,OACP,EAAE,MACG,EACL,WAAW;CACT;EACE,MAAM;EACN,SAAS;GACP;GACA;GACD;EACF;CACD;EACE,MAAM;EACN,SAAS;EACV;CACD;EACE,MAAM;EACN,SAAS;GACP,SAAS,CAAC;GACV;GACA;GACD;EACF;CACF,EACF,GAGG,KAAgB,MAAkB;CACtC,IAAM,IAAO,SAAS,cAAc,OAAO;AAI3C,QAHA,EAAK,YAAY,EAAc,aAAa,IAC5C,EAAc,YAAY,IAC1B,EAAc,YAAY,EAAK,EACxB;GAGI,KAAa,MAAkB;AAC1C,KAAI,CAAC,GAAe;AAClB,UAAQ,KAAK,sEAAsE;AACnF;;AAIF,QAFe,EAAc,SAAS,MAClB,EAAa,EAAc;GAIpC,KAAoB,MAAW;CAE1C,IAAM,IAAS,SAAS,cAAc,MAAM;AAG5C,QAFA,EAAO,YAAY,2BACnB,EAAO,YAAY,EAAQ,EACpB,EACL,WACD"}
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../rich_text_editor-DRytK1_9.cjs`),t=require(`./rich-text-editor-constants.cjs`);exports.DtRichTextEditor=e.t,exports.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES=t.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,exports.RICH_TEXT_EDITOR_OUTPUT_FORMATS=t.RICH_TEXT_EDITOR_OUTPUT_FORMATS;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../rich_text_editor-DWrdKcza.cjs`),t=require(`./rich-text-editor-constants.cjs`);exports.DtRichTextEditor=e.t,exports.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES=t.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES,exports.RICH_TEXT_EDITOR_OUTPUT_FORMATS=t.RICH_TEXT_EDITOR_OUTPUT_FORMATS;
@@ -1,3 +1,3 @@
1
- import { t as e } from "../../rich_text_editor-CNFb6tIx.js";
1
+ import { t as e } from "../../rich_text_editor-COc4LaIk.js";
2
2
  import { RICH_TEXT_EDITOR_AUTOFOCUS_TYPES as t, RICH_TEXT_EDITOR_OUTPUT_FORMATS as n } from "./rich-text-editor-constants.js";
3
3
  export { e as DtRichTextEditor, t as RICH_TEXT_EDITOR_AUTOFOCUS_TYPES, n as RICH_TEXT_EDITOR_OUTPUT_FORMATS };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../markdownRenderer-D_P94RyM.js";
1
+ import { t as e } from "../../markdownRenderer-vnndXQhE.js";
2
2
  export { e as renderEditorToMarkdown };
@@ -1 +1 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`../../rich_text_editor-DRytK1_9.cjs`);exports.default=e.t;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`../../rich_text_editor-DWrdKcza.cjs`);exports.default=e.t;
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../rich_text_editor-CNFb6tIx.js";
1
+ import { t as e } from "../../rich_text_editor-COc4LaIk.js";
2
2
  export { e as default };
@@ -1 +1 @@
1
- {"version":3,"file":"markdownRenderer-DCgGQseq.cjs","names":["Node"],"sources":["../../../node_modules/.pnpm/@tiptap+static-renderer@3.19.0_@tiptap+core@3.19.0_@tiptap+pm@3.19.0__@tiptap+pm@3.19.0_react_4n7lapq7bmfej5hsrzhdkukr6e/node_modules/@tiptap/static-renderer/dist/pm/markdown/index.js","../components/rich_text_editor/markdownRenderer.js"],"sourcesContent":["// src/pm/extensionRenderer.ts\nimport {\n getAttributesFromExtensions,\n getExtensionField,\n getSchemaByResolvedExtensions,\n resolveExtensions,\n splitExtensions\n} from \"@tiptap/core\";\nimport { Node } from \"@tiptap/pm/model\";\n\n// src/helpers.ts\nimport { mergeAttributes } from \"@tiptap/core\";\nfunction getAttributes(nodeOrMark, extensionAttributes, onlyRenderedAttributes) {\n const nodeOrMarkAttributes = nodeOrMark.attrs;\n if (!nodeOrMarkAttributes) {\n return {};\n }\n return extensionAttributes.filter((item) => {\n if (item.type !== (typeof nodeOrMark.type === \"string\" ? nodeOrMark.type : nodeOrMark.type.name)) {\n return false;\n }\n if (onlyRenderedAttributes) {\n return item.attribute.rendered;\n }\n return true;\n }).map((item) => {\n if (!item.attribute.renderHTML) {\n return {\n [item.name]: item.name in nodeOrMarkAttributes ? nodeOrMarkAttributes[item.name] : item.attribute.default\n };\n }\n return item.attribute.renderHTML(nodeOrMarkAttributes) || {\n [item.name]: item.name in nodeOrMarkAttributes ? nodeOrMarkAttributes[item.name] : item.attribute.default\n };\n }).reduce((attributes, attribute) => mergeAttributes(attributes, attribute), {});\n}\nfunction getHTMLAttributes(nodeOrMark, extensionAttributes) {\n return getAttributes(nodeOrMark, extensionAttributes, true);\n}\n\n// src/pm/extensionRenderer.ts\nfunction mapNodeExtensionToReactNode(domOutputSpecToElement, extension, extensionAttributes, options) {\n const context = {\n name: extension.name,\n options: extension.options,\n storage: extension.storage,\n parent: extension.parent\n };\n const renderToHTML = getExtensionField(extension, \"renderHTML\", context);\n if (!renderToHTML) {\n if (options == null ? void 0 : options.unhandledNode) {\n return [extension.name, options.unhandledNode];\n }\n return [\n extension.name,\n () => {\n throw new Error(\n `[tiptap error]: Node ${extension.name} cannot be rendered, it is missing a \"renderToHTML\" method, please implement it or override the corresponding \"nodeMapping\" method to have a custom rendering`\n );\n }\n ];\n }\n return [\n extension.name,\n ({ node, children }) => {\n try {\n return domOutputSpecToElement(\n renderToHTML({\n node,\n HTMLAttributes: getHTMLAttributes(node, extensionAttributes)\n })\n )(children);\n } catch (e) {\n throw new Error(\n `[tiptap error]: Node ${extension.name} cannot be rendered, it's \"renderToHTML\" method threw an error: ${e.message}`,\n { cause: e }\n );\n }\n }\n ];\n}\nfunction mapMarkExtensionToReactNode(domOutputSpecToElement, extension, extensionAttributes, options) {\n const context = {\n name: extension.name,\n options: extension.options,\n storage: extension.storage,\n parent: extension.parent\n };\n const renderToHTML = getExtensionField(extension, \"renderHTML\", context);\n if (!renderToHTML) {\n if (options == null ? void 0 : options.unhandledMark) {\n return [extension.name, options.unhandledMark];\n }\n return [\n extension.name,\n () => {\n throw new Error(`Node ${extension.name} cannot be rendered, it is missing a \"renderToHTML\" method`);\n }\n ];\n }\n return [\n extension.name,\n ({ mark, children }) => {\n try {\n return domOutputSpecToElement(\n renderToHTML({\n mark,\n HTMLAttributes: getHTMLAttributes(mark, extensionAttributes)\n })\n )(children);\n } catch (e) {\n throw new Error(\n `[tiptap error]: Mark ${extension.name} cannot be rendered, it's \"renderToHTML\" method threw an error: ${e.message}`,\n { cause: e }\n );\n }\n }\n ];\n}\nfunction renderToElement({\n renderer,\n domOutputSpecToElement,\n mapDefinedTypes,\n content,\n extensions,\n options\n}) {\n extensions = resolveExtensions(extensions);\n const extensionAttributes = getAttributesFromExtensions(extensions);\n const { nodeExtensions, markExtensions } = splitExtensions(extensions);\n if (!(content instanceof Node)) {\n content = Node.fromJSON(getSchemaByResolvedExtensions(extensions), content);\n }\n return renderer({\n ...options,\n nodeMapping: {\n ...Object.fromEntries(\n nodeExtensions.filter((e) => {\n if (e.name in mapDefinedTypes) {\n return false;\n }\n if (options == null ? void 0 : options.nodeMapping) {\n return !(e.name in options.nodeMapping);\n }\n return true;\n }).map(\n (nodeExtension) => mapNodeExtensionToReactNode(domOutputSpecToElement, nodeExtension, extensionAttributes, options)\n )\n ),\n ...mapDefinedTypes,\n ...options == null ? void 0 : options.nodeMapping\n },\n markMapping: {\n ...Object.fromEntries(\n markExtensions.filter((e) => {\n if (options == null ? void 0 : options.markMapping) {\n return !(e.name in options.markMapping);\n }\n return true;\n }).map((mark) => mapMarkExtensionToReactNode(domOutputSpecToElement, mark, extensionAttributes, options))\n ),\n ...options == null ? void 0 : options.markMapping\n }\n })({ content });\n}\n\n// src/json/renderer.ts\nfunction TiptapStaticRenderer(renderComponent, {\n nodeMapping,\n markMapping,\n unhandledNode,\n unhandledMark\n}) {\n return function renderContent({\n content,\n parent\n }) {\n var _a;\n const nodeType = typeof content.type === \"string\" ? content.type : content.type.name;\n const NodeHandler = (_a = nodeMapping[nodeType]) != null ? _a : unhandledNode;\n if (!NodeHandler) {\n throw new Error(`missing handler for node type ${nodeType}`);\n }\n const nodeContent = renderComponent({\n component: NodeHandler,\n props: {\n node: content,\n parent,\n renderElement: renderContent,\n // Lazily compute the children to avoid unnecessary recursion\n get children() {\n const children = [];\n if (content.content) {\n content.content.forEach((child) => {\n children.push(\n renderContent({\n content: child,\n parent: content\n })\n );\n });\n }\n return children;\n }\n }\n });\n const markedContent = content.marks ? content.marks.reduce((acc, mark) => {\n var _a2;\n const markType = typeof mark.type === \"string\" ? mark.type : mark.type.name;\n const MarkHandler = (_a2 = markMapping[markType]) != null ? _a2 : unhandledMark;\n if (!MarkHandler) {\n throw new Error(`missing handler for mark type ${markType}`);\n }\n return renderComponent({\n component: MarkHandler,\n props: {\n mark,\n parent,\n node: content,\n children: acc\n }\n });\n }, nodeContent) : nodeContent;\n return markedContent;\n };\n}\n\n// src/json/html-string/string.ts\nfunction renderJSONContentToString(options) {\n return TiptapStaticRenderer((ctx) => {\n return ctx.component(ctx.props);\n }, options);\n}\nfunction serializeAttrsToHTMLString(attrs) {\n const output = Object.entries(attrs || {}).map(([key, value]) => `${key.split(\" \").at(-1)}=${JSON.stringify(value)}`).join(\" \");\n return output ? ` ${output}` : \"\";\n}\nfunction serializeChildrenToHTMLString(children) {\n return [].concat(children || \"\").filter(Boolean).join(\"\");\n}\n\n// src/pm/html-string/html-string.ts\nvar NON_SELF_CLOSING_TAGS = /* @__PURE__ */ new Set([\"iframe\", \"script\", \"style\", \"title\", \"textarea\", \"div\", \"span\", \"a\", \"button\"]);\nfunction domOutputSpecToHTMLString(content) {\n if (typeof content === \"string\") {\n return () => content;\n }\n if (typeof content === \"object\" && \"length\" in content) {\n const [_tag, attrs, children, ...rest] = content;\n let tag = _tag;\n const parts = tag.split(\" \");\n if (parts.length > 1) {\n tag = `${parts[1]} xmlns=\"${parts[0]}\"`;\n }\n if (attrs === void 0) {\n return () => `<${tag}/>`;\n }\n if (attrs === 0) {\n return (child) => `<${tag}>${serializeChildrenToHTMLString(child)}</${tag}>`;\n }\n if (typeof attrs === \"object\") {\n if (Array.isArray(attrs)) {\n if (children === void 0) {\n return (child) => `<${tag}>${domOutputSpecToHTMLString(attrs)(child)}</${tag}>`;\n }\n if (children === 0) {\n return (child) => `<${tag}>${domOutputSpecToHTMLString(attrs)(child)}</${tag}>`;\n }\n return (child) => `<${tag}>${domOutputSpecToHTMLString(attrs)(child)}${[children].concat(rest).map((a) => domOutputSpecToHTMLString(a)(child))}</${tag}>`;\n }\n if (children === void 0) {\n if (NON_SELF_CLOSING_TAGS.has(tag)) {\n return () => `<${tag}${serializeAttrsToHTMLString(attrs)}></${tag}>`;\n }\n return () => `<${tag}${serializeAttrsToHTMLString(attrs)}/>`;\n }\n if (children === 0) {\n return (child) => `<${tag}${serializeAttrsToHTMLString(attrs)}>${serializeChildrenToHTMLString(child)}</${tag}>`;\n }\n return (child) => `<${tag}${serializeAttrsToHTMLString(attrs)}>${[children].concat(rest).map((a) => domOutputSpecToHTMLString(a)(child)).join(\"\")}</${tag}>`;\n }\n }\n throw new Error(\n \"[tiptap error]: Unsupported DomOutputSpec type, check the `renderHTML` method output or implement a node mapping\",\n {\n cause: content\n }\n );\n}\nfunction renderToHTMLString({\n content,\n extensions,\n options\n}) {\n return renderToElement({\n renderer: renderJSONContentToString,\n domOutputSpecToElement: domOutputSpecToHTMLString,\n mapDefinedTypes: {\n // Map a doc node to concatenated children\n doc: ({ children }) => serializeChildrenToHTMLString(children),\n // Map a text node to its text content\n text: ({ node }) => {\n var _a;\n return (_a = node.text) != null ? _a : \"\";\n }\n },\n content,\n extensions,\n options\n });\n}\n\n// src/pm/markdown/markdown.ts\nfunction renderToMarkdown({\n content,\n extensions,\n options\n}) {\n return renderToHTMLString({\n content,\n extensions,\n options: {\n ...options,\n nodeMapping: {\n bulletList({ children }) {\n return `\n${serializeChildrenToHTMLString(children)}`;\n },\n orderedList({ children }) {\n return `\n${serializeChildrenToHTMLString(children)}`;\n },\n listItem({ node, children, parent }) {\n if ((parent == null ? void 0 : parent.type.name) === \"bulletList\") {\n return `- ${serializeChildrenToHTMLString(children).trim()}\n`;\n }\n if ((parent == null ? void 0 : parent.type.name) === \"orderedList\") {\n let number = parent.attrs.start || 1;\n parent.forEach((parentChild, _offset, index) => {\n if (node === parentChild) {\n number = index + 1;\n }\n });\n return `${number}. ${serializeChildrenToHTMLString(children).trim()}\n`;\n }\n return serializeChildrenToHTMLString(children);\n },\n paragraph({ children }) {\n return `\n${serializeChildrenToHTMLString(children)}\n`;\n },\n heading({ node, children }) {\n const level = node.attrs.level;\n return `${new Array(level).fill(\"#\").join(\"\")} ${children}\n`;\n },\n codeBlock({ node, children }) {\n return `\n\\`\\`\\`${node.attrs.language}\n${serializeChildrenToHTMLString(children)}\n\\`\\`\\`\n`;\n },\n blockquote({ children }) {\n return `\n${serializeChildrenToHTMLString(children).trim().split(\"\\n\").map((a) => `> ${a}`).join(\"\\n\")}`;\n },\n image({ node }) {\n return `![${node.attrs.alt}](${node.attrs.src})`;\n },\n hardBreak() {\n return \"\\n\";\n },\n horizontalRule() {\n return \"\\n---\\n\";\n },\n table({ children, node }) {\n if (!Array.isArray(children)) {\n return `\n${serializeChildrenToHTMLString(children)}\n`;\n }\n const columnCount = node.children[0].childCount;\n return `\n${serializeChildrenToHTMLString(children[0])}| ${new Array(columnCount).fill(\"---\").join(\" | \")} |\n${serializeChildrenToHTMLString(children.slice(1))}\n`;\n },\n tableRow({ children }) {\n if (Array.isArray(children)) {\n return `| ${children.join(\" | \")} |\n`;\n }\n return `${serializeChildrenToHTMLString(children)}\n`;\n },\n tableHeader({ children }) {\n return serializeChildrenToHTMLString(children).trim();\n },\n tableCell({ children }) {\n return serializeChildrenToHTMLString(children).trim();\n },\n ...options == null ? void 0 : options.nodeMapping\n },\n markMapping: {\n bold({ children }) {\n return `**${serializeChildrenToHTMLString(children)}**`;\n },\n italic({ children, node }) {\n let isBoldToo = false;\n if (node == null ? void 0 : node.marks.some((m) => m.type.name === \"bold\")) {\n isBoldToo = true;\n }\n if (isBoldToo) {\n return `*${serializeChildrenToHTMLString(children)}*`;\n }\n return `_${serializeChildrenToHTMLString(children)}_`;\n },\n code({ children }) {\n return `\\`${serializeChildrenToHTMLString(children)}\\``;\n },\n strike({ children }) {\n return `~~${serializeChildrenToHTMLString(children)}~~`;\n },\n underline({ children }) {\n return `<u>${serializeChildrenToHTMLString(children)}</u>`;\n },\n subscript({ children }) {\n return `<sub>${serializeChildrenToHTMLString(children)}</sub>`;\n },\n superscript({ children }) {\n return `<sup>${serializeChildrenToHTMLString(children)}</sup>`;\n },\n link({ mark, children }) {\n return `[${serializeChildrenToHTMLString(children)}](${mark.attrs.href})`;\n },\n highlight({ children }) {\n return `==${serializeChildrenToHTMLString(children)}==`;\n },\n ...options == null ? void 0 : options.markMapping\n }\n }\n });\n}\nexport {\n mapMarkExtensionToReactNode,\n mapNodeExtensionToReactNode,\n renderToElement,\n renderToMarkdown\n};\n//# sourceMappingURL=index.js.map","import { renderToMarkdown } from '@tiptap/static-renderer/pm/markdown';\n\n// The pm/markdown renderer passes children as string[] (one entry per child node),\n// not as a pre-joined string. Normalize to a string before processing.\nconst joinChildren = (children) => Array.isArray(children) ? children.join('') : (children || '');\n\n// Move leading/trailing spaces outside mark delimiters so parsers like CommonMark\n// don't reject them (e.g. \"** bold **\" → \" **bold** \").\nconst wrapMark = (text, open, close) => {\n const trimmed = text.trim();\n if (!trimmed) return text;\n const leading = text.slice(0, text.length - text.trimStart().length);\n const trailing = text.slice(text.trimEnd().length);\n return `${leading}${open}${trimmed}${close}${trailing}`;\n};\n\n/**\n * Renders a TipTap/ProseMirror JSON document to a markdown string.\n *\n * Uses @tiptap/static-renderer with custom mappings to preserve the output\n * format of the legacy jsonToMarkdownConverter, including Dialtone-specific\n * node types (mention, channel, emoji, variable, slash-commands).\n *\n * @param {import('@tiptap/core').JSONContent} jsonContent - TipTap JSON document\n * @param {import('@tiptap/core').Extensions} extensions - Active editor extensions\n * @returns {string}\n */\nexport function renderEditorToMarkdown (jsonContent, extensions) {\n const output = renderToMarkdown({\n extensions,\n content: jsonContent,\n options: {\n nodeMapping: {\n // Override blockquote: built-in omits trailing newline (causes lazy continuation).\n // Since we replace the built-in entirely, we must add the '> ' prefix ourselves.\n blockquote ({ children }) {\n const text = joinChildren(children).trim();\n const quoted = text\n .split('\\n')\n .map(line => line ? `> ${line}` : '>')\n .join('\\n');\n return quoted + '\\n';\n },\n\n // Override codeBlock: built-in passes null language through literally\n codeBlock ({ node, children }) {\n const lang = node.attrs?.language || '';\n return `\\`\\`\\`${lang}\\n${joinChildren(children)}\\n\\`\\`\\`\\n`;\n },\n\n // Custom Dialtone node types\n mention ({ node }) {\n const id = node.attrs?.id || '';\n const contactKey = node.attrs?.contactKey || '';\n const name = node.attrs?.name || '';\n return `<!-- @mention: {\"id\": \"${id}\", \"contactKey\": \"${contactKey}\", \"name\": \"${name}\"} -->`;\n },\n\n channel ({ node }) {\n const id = node.attrs?.id || '';\n const channelKey = node.attrs?.channelKey || '';\n const name = node.attrs?.name || '';\n const locked = String(node.attrs?.locked ?? '');\n return `<!-- @channel: {\"id\": \"${id}\", \"channelKey\": \"${channelKey}\", \"name\": \"${name}\", \"locked\": \"${locked}\"} -->`;\n },\n\n 'slash-commands' ({ node }) {\n return `/${node.attrs?.command || ''}`;\n },\n\n emoji ({ node }) {\n return node.attrs?.code || '';\n },\n\n variable ({ node }) {\n const id = node.attrs?.id || '';\n const altText = node.attrs?.altText || '';\n return `{{${id}=${altText}}}`;\n },\n },\n\n markMapping: {\n bold ({ children }) {\n return wrapMark(joinChildren(children), '**', '**');\n },\n\n // Override italic: use * instead of built-in _ and fix boundary spaces\n italic ({ children }) {\n return wrapMark(joinChildren(children), '*', '*');\n },\n\n strike ({ children }) {\n return wrapMark(joinChildren(children), '~~', '~~');\n },\n\n code ({ children }) {\n return wrapMark(joinChildren(children), '`', '`');\n },\n\n link ({ mark, children }) {\n const text = joinChildren(children);\n const href = mark.attrs?.href || '';\n const trimmed = text.trim();\n const leading = text.slice(0, text.length - text.trimStart().length);\n const trailing = text.slice(text.trimEnd().length);\n return `${leading}[${trimmed}](${href})${trailing}`;\n },\n\n // Override underline: pass-through (no markdown equivalent, matches legacy no-op)\n underline ({ children }) {\n return joinChildren(children);\n },\n },\n },\n });\n // Collapse 3+ consecutive newlines to 2 (CommonMark ignores extra blank\n // lines between blocks), and strip the leading newline that the built-in\n // paragraph renderer always prepends to the first node.\n return output.replace(/\\n{3,}/g, '\\n\\n').replace(/^\\n+|\\n+$/g, '');\n}\n"],"x_google_ignoreList":[0],"mappings":"4FAYA,SAAS,EAAc,EAAY,EAAqB,EAAwB,CAC9E,IAAM,EAAuB,EAAW,MAIxC,OAHK,EAGE,EAAoB,OAAQ,GAC7B,EAAK,QAAU,OAAO,EAAW,MAAS,SAAW,EAAW,KAAO,EAAW,KAAK,MAGvF,EACK,EAAK,UAAU,SAEjB,GALE,GAMT,CAAC,IAAK,GACD,EAAK,UAAU,YAKb,EAAK,UAAU,WAAW,EAAqB,EAJ7C,EACJ,EAAK,MAAO,EAAK,QAAQ,EAAuB,EAAqB,EAAK,MAAQ,EAAK,UAAU,QACnG,CAKH,CAAC,QAAQ,EAAY,KAAA,EAAA,EAAA,iBAA8B,EAAY,EAAU,CAAE,EAAE,CAAC,CAnBvE,EAAE,CAqBb,SAAS,EAAkB,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AK,IAAI,EAGnD,KAAM,CAAE,OAAM,YAAY,CACxB,IAAM,EAAO,EAAa,EAAS,CAC7B,EAAO,EAAK,OAAO,MAAQ,GAC3B,EAAU,EAAK,MAAM,CAG3B,MAAO,GAFS,EAAK,MAAM,EAAG,EAAK,OAAS,EAAK,WAAW,CAAC,OAAO,CAElD,GAAG,EAAQ,IAAI,EAAK,GADrB,EAAK,MAAM,EAAK,SAAS,CAAC,OAAO,IAKpD,UAAW,CAAE,YAAY,CACvB,OAAO,EAAa,EAAS,EAEhC,CACF,CACF,CAAC,CAIY,QAAQ,UAAW;;EAAO,CAAC,QAAQ,aAAc,GAAG"}
1
+ {"version":3,"file":"markdownRenderer-DCgGQseq.cjs","names":["Node"],"sources":["../../../node_modules/.pnpm/@tiptap+static-renderer@3.19.0_@tiptap+core@3.19.0_@tiptap+pm@3.19.0__@tiptap+pm@3.19.0_9606d4b01b88c88c850636a0b274a958/node_modules/@tiptap/static-renderer/dist/pm/markdown/index.js","../components/rich_text_editor/markdownRenderer.js"],"sourcesContent":["// src/pm/extensionRenderer.ts\nimport {\n getAttributesFromExtensions,\n getExtensionField,\n getSchemaByResolvedExtensions,\n resolveExtensions,\n splitExtensions\n} from \"@tiptap/core\";\nimport { Node } from \"@tiptap/pm/model\";\n\n// src/helpers.ts\nimport { mergeAttributes } from \"@tiptap/core\";\nfunction getAttributes(nodeOrMark, extensionAttributes, onlyRenderedAttributes) {\n const nodeOrMarkAttributes = nodeOrMark.attrs;\n if (!nodeOrMarkAttributes) {\n return {};\n }\n return extensionAttributes.filter((item) => {\n if (item.type !== (typeof nodeOrMark.type === \"string\" ? nodeOrMark.type : nodeOrMark.type.name)) {\n return false;\n }\n if (onlyRenderedAttributes) {\n return item.attribute.rendered;\n }\n return true;\n }).map((item) => {\n if (!item.attribute.renderHTML) {\n return {\n [item.name]: item.name in nodeOrMarkAttributes ? nodeOrMarkAttributes[item.name] : item.attribute.default\n };\n }\n return item.attribute.renderHTML(nodeOrMarkAttributes) || {\n [item.name]: item.name in nodeOrMarkAttributes ? nodeOrMarkAttributes[item.name] : item.attribute.default\n };\n }).reduce((attributes, attribute) => mergeAttributes(attributes, attribute), {});\n}\nfunction getHTMLAttributes(nodeOrMark, extensionAttributes) {\n return getAttributes(nodeOrMark, extensionAttributes, true);\n}\n\n// src/pm/extensionRenderer.ts\nfunction mapNodeExtensionToReactNode(domOutputSpecToElement, extension, extensionAttributes, options) {\n const context = {\n name: extension.name,\n options: extension.options,\n storage: extension.storage,\n parent: extension.parent\n };\n const renderToHTML = getExtensionField(extension, \"renderHTML\", context);\n if (!renderToHTML) {\n if (options == null ? void 0 : options.unhandledNode) {\n return [extension.name, options.unhandledNode];\n }\n return [\n extension.name,\n () => {\n throw new Error(\n `[tiptap error]: Node ${extension.name} cannot be rendered, it is missing a \"renderToHTML\" method, please implement it or override the corresponding \"nodeMapping\" method to have a custom rendering`\n );\n }\n ];\n }\n return [\n extension.name,\n ({ node, children }) => {\n try {\n return domOutputSpecToElement(\n renderToHTML({\n node,\n HTMLAttributes: getHTMLAttributes(node, extensionAttributes)\n })\n )(children);\n } catch (e) {\n throw new Error(\n `[tiptap error]: Node ${extension.name} cannot be rendered, it's \"renderToHTML\" method threw an error: ${e.message}`,\n { cause: e }\n );\n }\n }\n ];\n}\nfunction mapMarkExtensionToReactNode(domOutputSpecToElement, extension, extensionAttributes, options) {\n const context = {\n name: extension.name,\n options: extension.options,\n storage: extension.storage,\n parent: extension.parent\n };\n const renderToHTML = getExtensionField(extension, \"renderHTML\", context);\n if (!renderToHTML) {\n if (options == null ? void 0 : options.unhandledMark) {\n return [extension.name, options.unhandledMark];\n }\n return [\n extension.name,\n () => {\n throw new Error(`Node ${extension.name} cannot be rendered, it is missing a \"renderToHTML\" method`);\n }\n ];\n }\n return [\n extension.name,\n ({ mark, children }) => {\n try {\n return domOutputSpecToElement(\n renderToHTML({\n mark,\n HTMLAttributes: getHTMLAttributes(mark, extensionAttributes)\n })\n )(children);\n } catch (e) {\n throw new Error(\n `[tiptap error]: Mark ${extension.name} cannot be rendered, it's \"renderToHTML\" method threw an error: ${e.message}`,\n { cause: e }\n );\n }\n }\n ];\n}\nfunction renderToElement({\n renderer,\n domOutputSpecToElement,\n mapDefinedTypes,\n content,\n extensions,\n options\n}) {\n extensions = resolveExtensions(extensions);\n const extensionAttributes = getAttributesFromExtensions(extensions);\n const { nodeExtensions, markExtensions } = splitExtensions(extensions);\n if (!(content instanceof Node)) {\n content = Node.fromJSON(getSchemaByResolvedExtensions(extensions), content);\n }\n return renderer({\n ...options,\n nodeMapping: {\n ...Object.fromEntries(\n nodeExtensions.filter((e) => {\n if (e.name in mapDefinedTypes) {\n return false;\n }\n if (options == null ? void 0 : options.nodeMapping) {\n return !(e.name in options.nodeMapping);\n }\n return true;\n }).map(\n (nodeExtension) => mapNodeExtensionToReactNode(domOutputSpecToElement, nodeExtension, extensionAttributes, options)\n )\n ),\n ...mapDefinedTypes,\n ...options == null ? void 0 : options.nodeMapping\n },\n markMapping: {\n ...Object.fromEntries(\n markExtensions.filter((e) => {\n if (options == null ? void 0 : options.markMapping) {\n return !(e.name in options.markMapping);\n }\n return true;\n }).map((mark) => mapMarkExtensionToReactNode(domOutputSpecToElement, mark, extensionAttributes, options))\n ),\n ...options == null ? void 0 : options.markMapping\n }\n })({ content });\n}\n\n// src/json/renderer.ts\nfunction TiptapStaticRenderer(renderComponent, {\n nodeMapping,\n markMapping,\n unhandledNode,\n unhandledMark\n}) {\n return function renderContent({\n content,\n parent\n }) {\n var _a;\n const nodeType = typeof content.type === \"string\" ? content.type : content.type.name;\n const NodeHandler = (_a = nodeMapping[nodeType]) != null ? _a : unhandledNode;\n if (!NodeHandler) {\n throw new Error(`missing handler for node type ${nodeType}`);\n }\n const nodeContent = renderComponent({\n component: NodeHandler,\n props: {\n node: content,\n parent,\n renderElement: renderContent,\n // Lazily compute the children to avoid unnecessary recursion\n get children() {\n const children = [];\n if (content.content) {\n content.content.forEach((child) => {\n children.push(\n renderContent({\n content: child,\n parent: content\n })\n );\n });\n }\n return children;\n }\n }\n });\n const markedContent = content.marks ? content.marks.reduce((acc, mark) => {\n var _a2;\n const markType = typeof mark.type === \"string\" ? mark.type : mark.type.name;\n const MarkHandler = (_a2 = markMapping[markType]) != null ? _a2 : unhandledMark;\n if (!MarkHandler) {\n throw new Error(`missing handler for mark type ${markType}`);\n }\n return renderComponent({\n component: MarkHandler,\n props: {\n mark,\n parent,\n node: content,\n children: acc\n }\n });\n }, nodeContent) : nodeContent;\n return markedContent;\n };\n}\n\n// src/json/html-string/string.ts\nfunction renderJSONContentToString(options) {\n return TiptapStaticRenderer((ctx) => {\n return ctx.component(ctx.props);\n }, options);\n}\nfunction serializeAttrsToHTMLString(attrs) {\n const output = Object.entries(attrs || {}).map(([key, value]) => `${key.split(\" \").at(-1)}=${JSON.stringify(value)}`).join(\" \");\n return output ? ` ${output}` : \"\";\n}\nfunction serializeChildrenToHTMLString(children) {\n return [].concat(children || \"\").filter(Boolean).join(\"\");\n}\n\n// src/pm/html-string/html-string.ts\nvar NON_SELF_CLOSING_TAGS = /* @__PURE__ */ new Set([\"iframe\", \"script\", \"style\", \"title\", \"textarea\", \"div\", \"span\", \"a\", \"button\"]);\nfunction domOutputSpecToHTMLString(content) {\n if (typeof content === \"string\") {\n return () => content;\n }\n if (typeof content === \"object\" && \"length\" in content) {\n const [_tag, attrs, children, ...rest] = content;\n let tag = _tag;\n const parts = tag.split(\" \");\n if (parts.length > 1) {\n tag = `${parts[1]} xmlns=\"${parts[0]}\"`;\n }\n if (attrs === void 0) {\n return () => `<${tag}/>`;\n }\n if (attrs === 0) {\n return (child) => `<${tag}>${serializeChildrenToHTMLString(child)}</${tag}>`;\n }\n if (typeof attrs === \"object\") {\n if (Array.isArray(attrs)) {\n if (children === void 0) {\n return (child) => `<${tag}>${domOutputSpecToHTMLString(attrs)(child)}</${tag}>`;\n }\n if (children === 0) {\n return (child) => `<${tag}>${domOutputSpecToHTMLString(attrs)(child)}</${tag}>`;\n }\n return (child) => `<${tag}>${domOutputSpecToHTMLString(attrs)(child)}${[children].concat(rest).map((a) => domOutputSpecToHTMLString(a)(child))}</${tag}>`;\n }\n if (children === void 0) {\n if (NON_SELF_CLOSING_TAGS.has(tag)) {\n return () => `<${tag}${serializeAttrsToHTMLString(attrs)}></${tag}>`;\n }\n return () => `<${tag}${serializeAttrsToHTMLString(attrs)}/>`;\n }\n if (children === 0) {\n return (child) => `<${tag}${serializeAttrsToHTMLString(attrs)}>${serializeChildrenToHTMLString(child)}</${tag}>`;\n }\n return (child) => `<${tag}${serializeAttrsToHTMLString(attrs)}>${[children].concat(rest).map((a) => domOutputSpecToHTMLString(a)(child)).join(\"\")}</${tag}>`;\n }\n }\n throw new Error(\n \"[tiptap error]: Unsupported DomOutputSpec type, check the `renderHTML` method output or implement a node mapping\",\n {\n cause: content\n }\n );\n}\nfunction renderToHTMLString({\n content,\n extensions,\n options\n}) {\n return renderToElement({\n renderer: renderJSONContentToString,\n domOutputSpecToElement: domOutputSpecToHTMLString,\n mapDefinedTypes: {\n // Map a doc node to concatenated children\n doc: ({ children }) => serializeChildrenToHTMLString(children),\n // Map a text node to its text content\n text: ({ node }) => {\n var _a;\n return (_a = node.text) != null ? _a : \"\";\n }\n },\n content,\n extensions,\n options\n });\n}\n\n// src/pm/markdown/markdown.ts\nfunction renderToMarkdown({\n content,\n extensions,\n options\n}) {\n return renderToHTMLString({\n content,\n extensions,\n options: {\n ...options,\n nodeMapping: {\n bulletList({ children }) {\n return `\n${serializeChildrenToHTMLString(children)}`;\n },\n orderedList({ children }) {\n return `\n${serializeChildrenToHTMLString(children)}`;\n },\n listItem({ node, children, parent }) {\n if ((parent == null ? void 0 : parent.type.name) === \"bulletList\") {\n return `- ${serializeChildrenToHTMLString(children).trim()}\n`;\n }\n if ((parent == null ? void 0 : parent.type.name) === \"orderedList\") {\n let number = parent.attrs.start || 1;\n parent.forEach((parentChild, _offset, index) => {\n if (node === parentChild) {\n number = index + 1;\n }\n });\n return `${number}. ${serializeChildrenToHTMLString(children).trim()}\n`;\n }\n return serializeChildrenToHTMLString(children);\n },\n paragraph({ children }) {\n return `\n${serializeChildrenToHTMLString(children)}\n`;\n },\n heading({ node, children }) {\n const level = node.attrs.level;\n return `${new Array(level).fill(\"#\").join(\"\")} ${children}\n`;\n },\n codeBlock({ node, children }) {\n return `\n\\`\\`\\`${node.attrs.language}\n${serializeChildrenToHTMLString(children)}\n\\`\\`\\`\n`;\n },\n blockquote({ children }) {\n return `\n${serializeChildrenToHTMLString(children).trim().split(\"\\n\").map((a) => `> ${a}`).join(\"\\n\")}`;\n },\n image({ node }) {\n return `![${node.attrs.alt}](${node.attrs.src})`;\n },\n hardBreak() {\n return \"\\n\";\n },\n horizontalRule() {\n return \"\\n---\\n\";\n },\n table({ children, node }) {\n if (!Array.isArray(children)) {\n return `\n${serializeChildrenToHTMLString(children)}\n`;\n }\n const columnCount = node.children[0].childCount;\n return `\n${serializeChildrenToHTMLString(children[0])}| ${new Array(columnCount).fill(\"---\").join(\" | \")} |\n${serializeChildrenToHTMLString(children.slice(1))}\n`;\n },\n tableRow({ children }) {\n if (Array.isArray(children)) {\n return `| ${children.join(\" | \")} |\n`;\n }\n return `${serializeChildrenToHTMLString(children)}\n`;\n },\n tableHeader({ children }) {\n return serializeChildrenToHTMLString(children).trim();\n },\n tableCell({ children }) {\n return serializeChildrenToHTMLString(children).trim();\n },\n ...options == null ? void 0 : options.nodeMapping\n },\n markMapping: {\n bold({ children }) {\n return `**${serializeChildrenToHTMLString(children)}**`;\n },\n italic({ children, node }) {\n let isBoldToo = false;\n if (node == null ? void 0 : node.marks.some((m) => m.type.name === \"bold\")) {\n isBoldToo = true;\n }\n if (isBoldToo) {\n return `*${serializeChildrenToHTMLString(children)}*`;\n }\n return `_${serializeChildrenToHTMLString(children)}_`;\n },\n code({ children }) {\n return `\\`${serializeChildrenToHTMLString(children)}\\``;\n },\n strike({ children }) {\n return `~~${serializeChildrenToHTMLString(children)}~~`;\n },\n underline({ children }) {\n return `<u>${serializeChildrenToHTMLString(children)}</u>`;\n },\n subscript({ children }) {\n return `<sub>${serializeChildrenToHTMLString(children)}</sub>`;\n },\n superscript({ children }) {\n return `<sup>${serializeChildrenToHTMLString(children)}</sup>`;\n },\n link({ mark, children }) {\n return `[${serializeChildrenToHTMLString(children)}](${mark.attrs.href})`;\n },\n highlight({ children }) {\n return `==${serializeChildrenToHTMLString(children)}==`;\n },\n ...options == null ? void 0 : options.markMapping\n }\n }\n });\n}\nexport {\n mapMarkExtensionToReactNode,\n mapNodeExtensionToReactNode,\n renderToElement,\n renderToMarkdown\n};\n//# sourceMappingURL=index.js.map","import { renderToMarkdown } from '@tiptap/static-renderer/pm/markdown';\n\n// The pm/markdown renderer passes children as string[] (one entry per child node),\n// not as a pre-joined string. Normalize to a string before processing.\nconst joinChildren = (children) => Array.isArray(children) ? children.join('') : (children || '');\n\n// Move leading/trailing spaces outside mark delimiters so parsers like CommonMark\n// don't reject them (e.g. \"** bold **\" → \" **bold** \").\nconst wrapMark = (text, open, close) => {\n const trimmed = text.trim();\n if (!trimmed) return text;\n const leading = text.slice(0, text.length - text.trimStart().length);\n const trailing = text.slice(text.trimEnd().length);\n return `${leading}${open}${trimmed}${close}${trailing}`;\n};\n\n/**\n * Renders a TipTap/ProseMirror JSON document to a markdown string.\n *\n * Uses @tiptap/static-renderer with custom mappings to preserve the output\n * format of the legacy jsonToMarkdownConverter, including Dialtone-specific\n * node types (mention, channel, emoji, variable, slash-commands).\n *\n * @param {import('@tiptap/core').JSONContent} jsonContent - TipTap JSON document\n * @param {import('@tiptap/core').Extensions} extensions - Active editor extensions\n * @returns {string}\n */\nexport function renderEditorToMarkdown (jsonContent, extensions) {\n const output = renderToMarkdown({\n extensions,\n content: jsonContent,\n options: {\n nodeMapping: {\n // Override blockquote: built-in omits trailing newline (causes lazy continuation).\n // Since we replace the built-in entirely, we must add the '> ' prefix ourselves.\n blockquote ({ children }) {\n const text = joinChildren(children).trim();\n const quoted = text\n .split('\\n')\n .map(line => line ? `> ${line}` : '>')\n .join('\\n');\n return quoted + '\\n';\n },\n\n // Override codeBlock: built-in passes null language through literally\n codeBlock ({ node, children }) {\n const lang = node.attrs?.language || '';\n return `\\`\\`\\`${lang}\\n${joinChildren(children)}\\n\\`\\`\\`\\n`;\n },\n\n // Custom Dialtone node types\n mention ({ node }) {\n const id = node.attrs?.id || '';\n const contactKey = node.attrs?.contactKey || '';\n const name = node.attrs?.name || '';\n return `<!-- @mention: {\"id\": \"${id}\", \"contactKey\": \"${contactKey}\", \"name\": \"${name}\"} -->`;\n },\n\n channel ({ node }) {\n const id = node.attrs?.id || '';\n const channelKey = node.attrs?.channelKey || '';\n const name = node.attrs?.name || '';\n const locked = String(node.attrs?.locked ?? '');\n return `<!-- @channel: {\"id\": \"${id}\", \"channelKey\": \"${channelKey}\", \"name\": \"${name}\", \"locked\": \"${locked}\"} -->`;\n },\n\n 'slash-commands' ({ node }) {\n return `/${node.attrs?.command || ''}`;\n },\n\n emoji ({ node }) {\n return node.attrs?.code || '';\n },\n\n variable ({ node }) {\n const id = node.attrs?.id || '';\n const altText = node.attrs?.altText || '';\n return `{{${id}=${altText}}}`;\n },\n },\n\n markMapping: {\n bold ({ children }) {\n return wrapMark(joinChildren(children), '**', '**');\n },\n\n // Override italic: use * instead of built-in _ and fix boundary spaces\n italic ({ children }) {\n return wrapMark(joinChildren(children), '*', '*');\n },\n\n strike ({ children }) {\n return wrapMark(joinChildren(children), '~~', '~~');\n },\n\n code ({ children }) {\n return wrapMark(joinChildren(children), '`', '`');\n },\n\n link ({ mark, children }) {\n const text = joinChildren(children);\n const href = mark.attrs?.href || '';\n const trimmed = text.trim();\n const leading = text.slice(0, text.length - text.trimStart().length);\n const trailing = text.slice(text.trimEnd().length);\n return `${leading}[${trimmed}](${href})${trailing}`;\n },\n\n // Override underline: pass-through (no markdown equivalent, matches legacy no-op)\n underline ({ children }) {\n return joinChildren(children);\n },\n },\n },\n });\n // Collapse 3+ consecutive newlines to 2 (CommonMark ignores extra blank\n // lines between blocks), and strip the leading newline that the built-in\n // paragraph renderer always prepends to the first node.\n return output.replace(/\\n{3,}/g, '\\n\\n').replace(/^\\n+|\\n+$/g, '');\n}\n"],"x_google_ignoreList":[0],"mappings":"4FAYA,SAAS,EAAc,EAAY,EAAqB,EAAwB,CAC9E,IAAM,EAAuB,EAAW,MAIxC,OAHK,EAGE,EAAoB,OAAQ,GAC7B,EAAK,QAAU,OAAO,EAAW,MAAS,SAAW,EAAW,KAAO,EAAW,KAAK,MAGvF,EACK,EAAK,UAAU,SAEjB,GALE,GAMT,CAAC,IAAK,GACD,EAAK,UAAU,YAKb,EAAK,UAAU,WAAW,EAAqB,EAJ7C,EACJ,EAAK,MAAO,EAAK,QAAQ,EAAuB,EAAqB,EAAK,MAAQ,EAAK,UAAU,QACnG,CAKH,CAAC,QAAQ,EAAY,KAAA,EAAA,EAAA,iBAA8B,EAAY,EAAU,CAAE,EAAE,CAAC,CAnBvE,EAAE,CAqBb,SAAS,EAAkB,EAAY,EAAqB,CAC1D,OAAO,EAAc,EAAY,EAAqB,GAAK,CAI7D,SAAS,EAA4B,EAAwB,EAAW,EAAqB,EAAS,CAOpG,IAAM,GAAA,EAAA,EAAA,mBAAiC,EAAW,aANlC,CACd,KAAM,EAAU,KAChB,QAAS,EAAU,QACnB,QAAS,EAAU,QACnB,OAAQ,EAAU,OACnB,CACuE,CAcxE,OAbK,EAaE,CACL,EAAU,MACT,CAAE,OAAM,cAAe,CACtB,GAAI,CACF,OAAO,EACL,EAAa,CACX,OACA,eAAgB,EAAkB,EAAM,EAAoB,CAC7D,CAAC,CACH,CAAC,EAAS,OACJ,EAAG,CACV,MAAU,MACR,wBAAwB,EAAU,KAAK,kEAAkE,EAAE,UAC3G,CAAE,MAAO,EAAG,CACb,GAGN,CA7BK,GAAmC,cAC9B,CAAC,EAAU,KAAM,EAAQ,cAAc,CAEzC,CACL,EAAU,SACJ,CACJ,MAAU,MACR,wBAAwB,EAAU,KAAK,+JACxC,EAEJ,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O,YAAc,GAGsB,cAFtD,EAAK,OAAO,MAAQ,GAEqD,gBADvE,OAAO,EAAK,OAAO,QAAU,GAAG,CAC8D,SAG/G,iBAAkB,CAAE,QAAQ,CAC1B,MAAO,IAAI,EAAK,OAAO,SAAW,MAGpC,MAAO,CAAE,QAAQ,CACf,OAAO,EAAK,OAAO,MAAQ,IAG7B,SAAU,CAAE,QAAQ,CAGlB,MAAO,KAFI,EAAK,OAAO,IAAM,GAEd,GADC,EAAK,OAAO,SAAW,GACb,KAE7B,CAED,YAAa,CACX,KAAM,CAAE,YAAY,CAClB,OAAO,EAAS,EAAa,EAAS,CAAE,KAAM,KAAK,EAIrD,OAAQ,CAAE,YAAY,CACpB,OAAO,EAAS,EAAa,EAAS,CAAE,IAAK,IAAI,EAGnD,OAAQ,CAAE,YAAY,CACpB,OAAO,EAAS,EAAa,EAAS,CAAE,KAAM,KAAK,EAGrD,KAAM,CAAE,YAAY,CAClB,OAAO,EAAS,EAAa,EAAS,CAAE,IAAK,IAAI,EAGnD,KAAM,CAAE,OAAM,YAAY,CACxB,IAAM,EAAO,EAAa,EAAS,CAC7B,EAAO,EAAK,OAAO,MAAQ,GAC3B,EAAU,EAAK,MAAM,CAG3B,MAAO,GAFS,EAAK,MAAM,EAAG,EAAK,OAAS,EAAK,WAAW,CAAC,OAAO,CAElD,GAAG,EAAQ,IAAI,EAAK,GADrB,EAAK,MAAM,EAAK,SAAS,CAAC,OAAO,IAKpD,UAAW,CAAE,YAAY,CACvB,OAAO,EAAa,EAAS,EAEhC,CACF,CACF,CAAC,CAIY,QAAQ,UAAW;;EAAO,CAAC,QAAQ,aAAc,GAAG"}
@@ -1,6 +1,6 @@
1
1
  import { getAttributesFromExtensions as e, getExtensionField as t, getSchemaByResolvedExtensions as n, mergeAttributes as r, resolveExtensions as i, splitExtensions as a } from "@tiptap/core";
2
2
  import { Node as o } from "@tiptap/pm/model";
3
- //#region ../../node_modules/.pnpm/@tiptap+static-renderer@3.19.0_@tiptap+core@3.19.0_@tiptap+pm@3.19.0__@tiptap+pm@3.19.0_react_4n7lapq7bmfej5hsrzhdkukr6e/node_modules/@tiptap/static-renderer/dist/pm/markdown/index.js
3
+ //#region ../../node_modules/.pnpm/@tiptap+static-renderer@3.19.0_@tiptap+core@3.19.0_@tiptap+pm@3.19.0__@tiptap+pm@3.19.0_9606d4b01b88c88c850636a0b274a958/node_modules/@tiptap/static-renderer/dist/pm/markdown/index.js
4
4
  function s(e, t, n) {
5
5
  let i = e.attrs;
6
6
  return i ? t.filter((t) => t.type === (typeof e.type == "string" ? e.type : e.type.name) ? n ? t.attribute.rendered : !0 : !1).map((e) => e.attribute.renderHTML && e.attribute.renderHTML(i) || { [e.name]: e.name in i ? i[e.name] : e.attribute.default }).reduce((e, t) => r(e, t), {}) : {};
@@ -319,4 +319,4 @@ function S(e, t) {
319
319
  //#endregion
320
320
  export { S as t };
321
321
 
322
- //# sourceMappingURL=markdownRenderer-D_P94RyM.js.map
322
+ //# sourceMappingURL=markdownRenderer-vnndXQhE.js.map