markdown-flow-ui 0.2.14 → 0.2.16-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/dist/assets/markdown-flow-ui.css +10 -1
- package/dist/components/ContentRender/CodeBlock.cjs +1 -1
- package/dist/components/ContentRender/CodeBlock.cjs.map +1 -1
- package/dist/components/ContentRender/CodeBlock.d.ts +5 -0
- package/dist/components/ContentRender/CodeBlock.es.js +41 -38
- package/dist/components/ContentRender/CodeBlock.es.js.map +1 -1
- package/dist/components/ContentRender/ContentRender.cjs +2 -2
- package/dist/components/ContentRender/ContentRender.cjs.map +1 -1
- package/dist/components/ContentRender/ContentRender.d.ts +12 -4
- package/dist/components/ContentRender/ContentRender.es.js +436 -306
- package/dist/components/ContentRender/ContentRender.es.js.map +1 -1
- package/dist/components/ContentRender/IframeSandbox.cjs +7 -7
- package/dist/components/ContentRender/IframeSandbox.cjs.map +1 -1
- package/dist/components/ContentRender/IframeSandbox.d.ts +5 -1
- package/dist/components/ContentRender/IframeSandbox.es.js +311 -266
- package/dist/components/ContentRender/IframeSandbox.es.js.map +1 -1
- package/dist/components/ContentRender/MarkdownFlowInput.cjs +1 -1
- package/dist/components/ContentRender/MarkdownFlowInput.cjs.map +1 -1
- package/dist/components/ContentRender/MarkdownFlowInput.d.ts +5 -1
- package/dist/components/ContentRender/MarkdownFlowInput.es.js +37 -32
- package/dist/components/ContentRender/MarkdownFlowInput.es.js.map +1 -1
- package/dist/components/ContentRender/SandboxApp.cjs +2 -2
- package/dist/components/ContentRender/SandboxApp.cjs.map +1 -1
- package/dist/components/ContentRender/SandboxApp.d.ts +5 -1
- package/dist/components/ContentRender/SandboxApp.es.js +108 -103
- package/dist/components/ContentRender/SandboxApp.es.js.map +1 -1
- package/dist/components/ContentRender/blackboard-vendor.d.ts +1 -1
- package/dist/components/ContentRender/contentRenderI18n.cjs +1 -1
- package/dist/components/ContentRender/contentRenderI18n.cjs.map +1 -1
- package/dist/components/ContentRender/contentRenderI18n.d.ts +6 -1
- package/dist/components/ContentRender/contentRenderI18n.es.js +5 -56
- package/dist/components/ContentRender/contentRenderI18n.es.js.map +1 -1
- package/dist/components/ContentRender/contentRenderI18n.test.d.ts +1 -0
- package/dist/components/ContentRender/index.cjs +1 -1
- package/dist/components/ContentRender/index.d.ts +11 -11
- package/dist/components/ContentRender/index.es.js +1 -2
- package/dist/components/ContentRender/index.es.js.map +1 -1
- package/dist/components/ContentRender/locales/contentRender.json.cjs +2 -0
- package/dist/components/ContentRender/locales/contentRender.json.cjs.map +1 -0
- package/dist/components/ContentRender/locales/contentRender.json.d.ts +90 -0
- package/dist/components/ContentRender/locales/contentRender.json.es.js +11 -0
- package/dist/components/ContentRender/locales/contentRender.json.es.js.map +1 -0
- package/dist/components/ContentRender/plugins/CustomVariable.cjs +1 -1
- package/dist/components/ContentRender/plugins/CustomVariable.cjs.map +1 -1
- package/dist/components/ContentRender/plugins/CustomVariable.d.ts +7 -3
- package/dist/components/ContentRender/plugins/CustomVariable.es.js +165 -151
- package/dist/components/ContentRender/plugins/CustomVariable.es.js.map +1 -1
- package/dist/components/ContentRender/plugins/MermaidChart.cjs +1 -1
- package/dist/components/ContentRender/plugins/MermaidChart.cjs.map +1 -1
- package/dist/components/ContentRender/plugins/MermaidChart.d.ts +1 -0
- package/dist/components/ContentRender/plugins/MermaidChart.es.js +68 -44
- package/dist/components/ContentRender/plugins/MermaidChart.es.js.map +1 -1
- package/dist/components/ContentRender/typewriterPacing.fixtures.d.ts +14 -0
- package/dist/components/ContentRender/utils/typewriter-pacing.cjs +3 -0
- package/dist/components/ContentRender/utils/typewriter-pacing.cjs.map +1 -0
- package/dist/components/ContentRender/utils/typewriter-pacing.d.ts +27 -0
- package/dist/components/ContentRender/utils/typewriter-pacing.es.js +98 -0
- package/dist/components/ContentRender/utils/typewriter-pacing.es.js.map +1 -0
- package/dist/components/ContentRender/utils/typewriter-pacing.test.d.ts +1 -0
- package/dist/components/MarkdownFlow/MarkdownFlow.cjs +1 -1
- package/dist/components/MarkdownFlow/MarkdownFlow.cjs.map +1 -1
- package/dist/components/MarkdownFlow/MarkdownFlow.d.ts +12 -4
- package/dist/components/MarkdownFlow/MarkdownFlow.es.js +51 -39
- package/dist/components/MarkdownFlow/MarkdownFlow.es.js.map +1 -1
- package/dist/components/MarkdownFlow/ScrollToBottomButton.cjs +1 -1
- package/dist/components/MarkdownFlow/ScrollToBottomButton.cjs.map +1 -1
- package/dist/components/MarkdownFlow/ScrollToBottomButton.d.ts +31 -1
- package/dist/components/MarkdownFlow/ScrollToBottomButton.es.js +46 -17
- package/dist/components/MarkdownFlow/ScrollToBottomButton.es.js.map +1 -1
- package/dist/components/MarkdownFlow/ScrollToBottomControl.cjs +2 -0
- package/dist/components/MarkdownFlow/ScrollToBottomControl.cjs.map +1 -0
- package/dist/components/MarkdownFlow/ScrollToBottomControl.d.ts +18 -0
- package/dist/components/MarkdownFlow/ScrollToBottomControl.es.js +47 -0
- package/dist/components/MarkdownFlow/ScrollToBottomControl.es.js.map +1 -0
- package/dist/components/MarkdownFlow/ScrollableMarkdownFlow.cjs +1 -1
- package/dist/components/MarkdownFlow/ScrollableMarkdownFlow.cjs.map +1 -1
- package/dist/components/MarkdownFlow/ScrollableMarkdownFlow.d.ts +1 -1
- package/dist/components/MarkdownFlow/ScrollableMarkdownFlow.es.js +33 -52
- package/dist/components/MarkdownFlow/ScrollableMarkdownFlow.es.js.map +1 -1
- package/dist/components/MarkdownFlow/index.cjs +1 -1
- package/dist/components/MarkdownFlow/index.d.ts +9 -6
- package/dist/components/MarkdownFlow/index.es.js +6 -6
- package/dist/components/MarkdownFlow/index.es.js.map +1 -1
- package/dist/components/MarkdownFlow/useScrollToBottom.cjs +1 -1
- package/dist/components/MarkdownFlow/useScrollToBottom.cjs.map +1 -1
- package/dist/components/MarkdownFlow/useScrollToBottom.d.ts +40 -8
- package/dist/components/MarkdownFlow/useScrollToBottom.es.js +352 -83
- package/dist/components/MarkdownFlow/useScrollToBottom.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.d.ts +5 -3
- package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.es.js +371 -324
- package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/components/CustomDialog.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/components/CustomDialog.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/components/CustomDialog.d.ts +10 -0
- package/dist/components/MarkdownFlowEditor/components/CustomDialog.es.js +22 -19
- package/dist/components/MarkdownFlowEditor/components/CustomDialog.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/components/CustomPopover.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/components/CustomPopover.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/components/CustomPopover.d.ts +8 -0
- package/dist/components/MarkdownFlowEditor/components/CustomPopover.es.js +19 -15
- package/dist/components/MarkdownFlowEditor/components/CustomPopover.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/components/EditorToolbar.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/components/EditorToolbar.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/components/EditorToolbar.d.ts +4 -1
- package/dist/components/MarkdownFlowEditor/components/EditorToolbar.es.js +99 -93
- package/dist/components/MarkdownFlowEditor/components/EditorToolbar.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/components/ImageInject.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/components/ImageInject.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/components/ImageInject.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/components/ImageInject.es.js +183 -182
- package/dist/components/MarkdownFlowEditor/components/ImageInject.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/components/VariableSearchDropdown.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/components/VariableSearchDropdown.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/components/VariableSearchDropdown.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/components/VariableSearchDropdown.es.js +107 -103
- package/dist/components/MarkdownFlowEditor/components/VariableSearchDropdown.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/components/VariableSelect.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/components/VariableSelect.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/components/VariableSelect.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/components/VariableSelect.es.js +106 -106
- package/dist/components/MarkdownFlowEditor/components/VariableSelect.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/components/VideoInject.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/components/VideoInject.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/components/VideoInject.es.js +64 -63
- package/dist/components/MarkdownFlowEditor/components/VideoInject.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/components/icons/ButtonIcon.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/components/icons/ButtonIcon.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/components/icons/ButtonIcon.es.js +13 -13
- package/dist/components/MarkdownFlowEditor/components/icons/ButtonIcon.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/components/icons/SearchBracesIcon.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/components/icons/SearchBracesIcon.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/components/icons/SearchBracesIcon.es.js +12 -12
- package/dist/components/MarkdownFlowEditor/components/icons/SearchBracesIcon.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/editor-context.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/editorI18n.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/editorI18n.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/editorI18n.d.ts +290 -0
- package/dist/components/MarkdownFlowEditor/editorI18n.es.js +12 -8
- package/dist/components/MarkdownFlowEditor/editorI18n.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/editorI18n.test.d.ts +1 -0
- package/dist/components/MarkdownFlowEditor/index.d.ts +6 -6
- package/dist/components/MarkdownFlowEditor/locales/ar-SA.json.cjs +2 -0
- package/dist/components/MarkdownFlowEditor/locales/ar-SA.json.cjs.map +1 -0
- package/dist/components/MarkdownFlowEditor/locales/ar-SA.json.d.ts +72 -0
- package/dist/components/MarkdownFlowEditor/locales/ar-SA.json.es.js +140 -0
- package/dist/components/MarkdownFlowEditor/locales/ar-SA.json.es.js.map +1 -0
- package/dist/components/MarkdownFlowEditor/locales/en-US.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/en-US.json.d.ts +2 -0
- package/dist/components/MarkdownFlowEditor/locales/en-US.json.es.js +118 -114
- package/dist/components/MarkdownFlowEditor/locales/en-US.json.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/locales/fr-FR.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/fr-FR.json.d.ts +2 -0
- package/dist/components/MarkdownFlowEditor/locales/fr-FR.json.es.js +118 -114
- package/dist/components/MarkdownFlowEditor/locales/fr-FR.json.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/locales/th-TH.json.cjs +2 -0
- package/dist/components/MarkdownFlowEditor/locales/th-TH.json.cjs.map +1 -0
- package/dist/components/MarkdownFlowEditor/locales/th-TH.json.d.ts +72 -0
- package/dist/components/MarkdownFlowEditor/locales/th-TH.json.es.js +140 -0
- package/dist/components/MarkdownFlowEditor/locales/th-TH.json.es.js.map +1 -0
- package/dist/components/MarkdownFlowEditor/locales/zh-CN.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/zh-CN.json.d.ts +2 -0
- package/dist/components/MarkdownFlowEditor/locales/zh-CN.json.es.js +70 -66
- package/dist/components/MarkdownFlowEditor/locales/zh-CN.json.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/ImgPlaceholder.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/ImgPlaceholder.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/ImgPlaceholder.es.js +40 -35
- package/dist/components/MarkdownFlowEditor/plugins/ImgPlaceholder.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/PlaceholderWidget.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/VideoPlaceholder.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/VideoPlaceholder.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/VideoPlaceholder.es.js +27 -23
- package/dist/components/MarkdownFlowEditor/plugins/VideoPlaceholder.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/mediaPlaceholderLabels.cjs +2 -0
- package/dist/components/MarkdownFlowEditor/plugins/mediaPlaceholderLabels.cjs.map +1 -0
- package/dist/components/MarkdownFlowEditor/plugins/mediaPlaceholderLabels.d.ts +7 -0
- package/dist/components/MarkdownFlowEditor/plugins/mediaPlaceholderLabels.es.js +12 -0
- package/dist/components/MarkdownFlowEditor/plugins/mediaPlaceholderLabels.es.js.map +1 -0
- package/dist/components/MarkdownFlowEditor/utils.d.ts +1 -1
- package/dist/components/Slide/MarkdownSlideScaling.cjs +1 -1
- package/dist/components/Slide/MarkdownSlideScaling.cjs.map +1 -1
- package/dist/components/Slide/MarkdownSlideScaling.d.ts +1 -1
- package/dist/components/Slide/MarkdownSlideScaling.es.js +20 -20
- package/dist/components/Slide/MarkdownSlideScaling.es.js.map +1 -1
- package/dist/components/Slide/MobilePlayerSettingsSheet.cjs +1 -1
- package/dist/components/Slide/MobilePlayerSettingsSheet.cjs.map +1 -1
- package/dist/components/Slide/MobilePlayerSettingsSheet.d.ts +7 -2
- package/dist/components/Slide/MobilePlayerSettingsSheet.es.js +61 -57
- package/dist/components/Slide/MobilePlayerSettingsSheet.es.js.map +1 -1
- package/dist/components/Slide/Player.cjs +1 -1
- package/dist/components/Slide/Player.cjs.map +1 -1
- package/dist/components/Slide/Player.d.ts +6 -6
- package/dist/components/Slide/Player.es.js +547 -541
- package/dist/components/Slide/Player.es.js.map +1 -1
- package/dist/components/Slide/Slide.cjs +1 -1
- package/dist/components/Slide/Slide.cjs.map +1 -1
- package/dist/components/Slide/Slide.d.ts +14 -12
- package/dist/components/Slide/Slide.es.js +745 -726
- package/dist/components/Slide/Slide.es.js.map +1 -1
- package/dist/components/Slide/SubtitleOverlay.cjs +1 -1
- package/dist/components/Slide/SubtitleOverlay.cjs.map +1 -1
- package/dist/components/Slide/SubtitleOverlay.d.ts +2 -2
- package/dist/components/Slide/SubtitleOverlay.es.js +17 -17
- package/dist/components/Slide/SubtitleOverlay.es.js.map +1 -1
- package/dist/components/Slide/diff-utils.d.ts +1 -1
- package/dist/components/Slide/index.d.ts +12 -12
- package/dist/components/Slide/locales/slide.json.cjs +2 -0
- package/dist/components/Slide/locales/slide.json.cjs.map +1 -0
- package/dist/components/Slide/locales/slide.json.d.ts +205 -0
- package/dist/components/Slide/locales/slide.json.es.js +11 -0
- package/dist/components/Slide/locales/slide.json.es.js.map +1 -0
- package/dist/components/Slide/slideI18n.cjs +1 -1
- package/dist/components/Slide/slideI18n.cjs.map +1 -1
- package/dist/components/Slide/slideI18n.d.ts +6 -3
- package/dist/components/Slide/slideI18n.es.js +10 -155
- package/dist/components/Slide/slideI18n.es.js.map +1 -1
- package/dist/components/Slide/useSlide.d.ts +1 -1
- package/dist/components/Slide/utils/appendedMarkerAdvance.d.ts +1 -1
- package/dist/components/Slide/utils/audioSegments.d.ts +1 -1
- package/dist/components/Slide/utils/interactionResolution.d.ts +2 -2
- package/dist/components/Slide/utils/listenModeElementList.d.ts +2 -2
- package/dist/components/Slide/utils/markdownScaling.d.ts +1 -1
- package/dist/components/Slide/utils/playerCustomActions.d.ts +2 -2
- package/dist/components/Slide/utils/playerKeyboardShortcuts.cjs +1 -1
- package/dist/components/Slide/utils/playerKeyboardShortcuts.cjs.map +1 -1
- package/dist/components/Slide/utils/playerKeyboardShortcuts.d.ts +1 -1
- package/dist/components/Slide/utils/playerKeyboardShortcuts.es.js +20 -20
- package/dist/components/Slide/utils/playerKeyboardShortcuts.es.js.map +1 -1
- package/dist/components/Slide/utils/runStreamFixture.d.ts +1 -1
- package/dist/components/Slide/utils/segmentSeek.d.ts +1 -1
- package/dist/components/Slide/utils/silentStepAutoAdvance.d.ts +1 -1
- package/dist/components/Slide/utils/streamingNavigation.d.ts +1 -1
- package/dist/components/Slide/utils/subtitleCue.d.ts +1 -1
- package/dist/components/Slide/utils/subtitleJumpNavigation.d.ts +1 -1
- package/dist/components/index.d.ts +22 -18
- package/dist/components/ui/button.cjs +1 -1
- package/dist/components/ui/button.cjs.map +1 -1
- package/dist/components/ui/button.es.js +12 -13
- package/dist/components/ui/button.es.js.map +1 -1
- package/dist/components/ui/checkbox.cjs +1 -1
- package/dist/components/ui/checkbox.cjs.map +1 -1
- package/dist/components/ui/checkbox.es.js +35 -35
- package/dist/components/ui/checkbox.es.js.map +1 -1
- package/dist/components/ui/dialog.cjs +1 -1
- package/dist/components/ui/dialog.cjs.map +1 -1
- package/dist/components/ui/dialog.d.ts +5 -1
- package/dist/components/ui/dialog.es.js +37 -37
- package/dist/components/ui/dialog.es.js.map +1 -1
- package/dist/components/ui/input.cjs +1 -1
- package/dist/components/ui/input.cjs.map +1 -1
- package/dist/components/ui/input.es.js +4 -4
- package/dist/components/ui/input.es.js.map +1 -1
- package/dist/components/ui/inputGroup/button.cjs +1 -1
- package/dist/components/ui/inputGroup/button.cjs.map +1 -1
- package/dist/components/ui/inputGroup/button.es.js +9 -10
- package/dist/components/ui/inputGroup/button.es.js.map +1 -1
- package/dist/components/ui/inputGroup/input-group.cjs +1 -1
- package/dist/components/ui/inputGroup/input-group.cjs.map +1 -1
- package/dist/components/ui/inputGroup/input-group.d.ts +1 -1
- package/dist/components/ui/inputGroup/input-group.es.js +10 -10
- package/dist/components/ui/inputGroup/input-group.es.js.map +1 -1
- package/dist/components/ui/inputGroup/textarea.cjs +1 -1
- package/dist/components/ui/inputGroup/textarea.cjs.map +1 -1
- package/dist/components/ui/inputGroup/textarea.es.js +2 -2
- package/dist/components/ui/inputGroup/textarea.es.js.map +1 -1
- package/dist/components/ui/loading-overlay-card.cjs +2 -2
- package/dist/components/ui/loading-overlay-card.cjs.map +1 -1
- package/dist/components/ui/loading-overlay-card.es.js +11 -11
- package/dist/components/ui/loading-overlay-card.es.js.map +1 -1
- package/dist/components/ui/popover.cjs +1 -1
- package/dist/components/ui/popover.cjs.map +1 -1
- package/dist/components/ui/popover.es.js +6 -6
- package/dist/components/ui/popover.es.js.map +1 -1
- package/dist/components/ui/tooltip.cjs +1 -1
- package/dist/components/ui/tooltip.cjs.map +1 -1
- package/dist/components/ui/tooltip.es.js +16 -16
- package/dist/components/ui/tooltip.es.js.map +1 -1
- package/dist/editor.d.ts +2 -2
- package/dist/fonts/KaTeX_AMS-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_AMS-Regular.woff +0 -0
- package/dist/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_Fraktur-Bold.woff +0 -0
- package/dist/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Fraktur-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_Main-Bold.woff +0 -0
- package/dist/fonts/KaTeX_Main-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
- package/dist/fonts/KaTeX_Main-BoldItalic.woff +0 -0
- package/dist/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-Italic.ttf +0 -0
- package/dist/fonts/KaTeX_Main-Italic.woff +0 -0
- package/dist/fonts/KaTeX_Main-Italic.woff2 +0 -0
- package/dist/fonts/KaTeX_Main-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Main-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Main-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
- package/dist/fonts/KaTeX_Math-BoldItalic.woff +0 -0
- package/dist/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/dist/fonts/KaTeX_Math-Italic.ttf +0 -0
- package/dist/fonts/KaTeX_Math-Italic.woff +0 -0
- package/dist/fonts/KaTeX_Math-Italic.woff2 +0 -0
- package/dist/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
- package/dist/fonts/KaTeX_SansSerif-Bold.woff +0 -0
- package/dist/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/dist/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
- package/dist/fonts/KaTeX_SansSerif-Italic.woff +0 -0
- package/dist/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/dist/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_SansSerif-Regular.woff +0 -0
- package/dist/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Script-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Script-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Script-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size1-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size1-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size2-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size2-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size3-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size3-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Size4-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Size4-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- package/dist/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
- package/dist/fonts/KaTeX_Typewriter-Regular.woff +0 -0
- package/dist/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.es.js +22 -19
- package/dist/index.es.js.map +1 -1
- package/dist/lib/locale.cjs +1 -1
- package/dist/lib/locale.cjs.map +1 -1
- package/dist/lib/locale.d.ts +5 -1
- package/dist/lib/locale.es.js +26 -13
- package/dist/lib/locale.es.js.map +1 -1
- package/dist/lib/locale.test.d.ts +1 -0
- package/dist/lib/useDetachedLanguage.cjs +2 -0
- package/dist/lib/useDetachedLanguage.cjs.map +1 -0
- package/dist/lib/useDetachedLanguage.d.ts +3 -0
- package/dist/lib/useDetachedLanguage.es.js +25 -0
- package/dist/lib/useDetachedLanguage.es.js.map +1 -0
- package/dist/lib/useResolvedDirection.cjs +2 -0
- package/dist/lib/useResolvedDirection.cjs.map +1 -0
- package/dist/lib/useResolvedDirection.d.ts +6 -0
- package/dist/lib/useResolvedDirection.es.js +37 -0
- package/dist/lib/useResolvedDirection.es.js.map +1 -0
- package/dist/markdown-flow-ui-lib.css +1 -1
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.es.js +6 -6
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.es.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-context/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-context/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-context/dist/index.es.js +21 -21
- package/dist/node_modules/@radix-ui/react-context/dist/index.es.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.cjs +2 -2
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.es.js +100 -100
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.es.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.es.js +38 -38
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.es.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.es.js +9 -9
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.es.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-popover/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-popover/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-popover/dist/index.es.js +95 -95
- package/dist/node_modules/@radix-ui/react-popover/dist/index.es.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-popper/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-popper/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-popper/dist/index.es.js +48 -48
- package/dist/node_modules/@radix-ui/react-popper/dist/index.es.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-portal/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-portal/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-portal/dist/index.es.js +6 -6
- package/dist/node_modules/@radix-ui/react-portal/dist/index.es.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.es.js +9 -9
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.es.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-slot/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-slot/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-slot/dist/index.es.js +17 -17
- package/dist/node_modules/@radix-ui/react-slot/dist/index.es.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.es.js +100 -100
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.es.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.es.js +6 -6
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.es.js.map +1 -1
- package/dist/node_modules/@uiw/react-codemirror/esm/index.cjs +1 -1
- package/dist/node_modules/@uiw/react-codemirror/esm/index.cjs.map +1 -1
- package/dist/node_modules/@uiw/react-codemirror/esm/index.es.js +27 -27
- package/dist/node_modules/@uiw/react-codemirror/esm/index.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/{chevron-down.cjs → chevrons-down.cjs} +2 -2
- package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-down.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/{chevron-down.es.js → chevrons-down.es.js} +6 -3
- package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-down.es.js.map +1 -0
- package/dist/node_modules/react-markdown/lib/index.cjs +1 -1
- package/dist/node_modules/react-markdown/lib/index.cjs.map +1 -1
- package/dist/node_modules/react-markdown/lib/index.es.js +39 -39
- package/dist/node_modules/react-markdown/lib/index.es.js.map +1 -1
- package/dist/renderer.cjs +1 -1
- package/dist/renderer.d.ts +18 -17
- package/dist/renderer.es.js +20 -17
- package/dist/renderer.es.js.map +1 -1
- package/dist/scroll.cjs +1 -1
- package/dist/scroll.d.ts +6 -3
- package/dist/scroll.es.js +4 -2
- package/dist/scroll.es.js.map +1 -1
- package/dist/slide.d.ts +3 -3
- package/package.json +5 -2
- package/dist/_virtual/jsx-runtime.cjs +0 -2
- package/dist/_virtual/jsx-runtime.cjs.map +0 -1
- package/dist/_virtual/jsx-runtime.es.js +0 -6
- package/dist/_virtual/jsx-runtime.es.js.map +0 -1
- package/dist/_virtual/jsx-runtime.es2.js +0 -5
- package/dist/_virtual/jsx-runtime.es2.js.map +0 -1
- package/dist/_virtual/jsx-runtime2.cjs +0 -2
- package/dist/_virtual/jsx-runtime2.cjs.map +0 -1
- package/dist/_virtual/react-jsx-runtime.development.cjs +0 -2
- package/dist/_virtual/react-jsx-runtime.development.cjs.map +0 -1
- package/dist/_virtual/react-jsx-runtime.development.es.js +0 -5
- package/dist/_virtual/react-jsx-runtime.development.es.js.map +0 -1
- package/dist/_virtual/react-jsx-runtime.production.cjs +0 -2
- package/dist/_virtual/react-jsx-runtime.production.cjs.map +0 -1
- package/dist/_virtual/react-jsx-runtime.production.es.js +0 -5
- package/dist/_virtual/react-jsx-runtime.production.es.js.map +0 -1
- package/dist/lib/localeTextMap.cjs +0 -2
- package/dist/lib/localeTextMap.cjs.map +0 -1
- package/dist/lib/localeTextMap.es.js +0 -5
- package/dist/lib/localeTextMap.es.js.map +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.cjs.map +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.es.js.map +0 -1
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.cjs +0 -24
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.cjs.map +0 -1
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.es.js +0 -409
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.es.js.map +0 -1
- package/dist/node_modules/react/cjs/react-jsx-runtime.production.cjs +0 -10
- package/dist/node_modules/react/cjs/react-jsx-runtime.production.cjs.map +0 -1
- package/dist/node_modules/react/cjs/react-jsx-runtime.production.es.js +0 -36
- package/dist/node_modules/react/cjs/react-jsx-runtime.production.es.js.map +0 -1
- package/dist/node_modules/react/jsx-runtime.cjs +0 -2
- package/dist/node_modules/react/jsx-runtime.cjs.map +0 -1
- package/dist/node_modules/react/jsx-runtime.es.js +0 -11
- package/dist/node_modules/react/jsx-runtime.es.js.map +0 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import * as s from "react";
|
|
2
2
|
import { composeEventHandlers as p } from "../../primitive/dist/index.es.js";
|
|
3
|
-
import { useComposedRefs as
|
|
4
|
-
import { createContextScope as
|
|
5
|
-
import { useId as
|
|
6
|
-
import { useControllableState as
|
|
7
|
-
import { DismissableLayer as
|
|
8
|
-
import { FocusScope as
|
|
9
|
-
import { Portal as
|
|
10
|
-
import { Presence as
|
|
3
|
+
import { useComposedRefs as _ } from "../../react-compose-refs/dist/index.es.js";
|
|
4
|
+
import { createContextScope as H, createContext as V } from "../../react-context/dist/index.es.js";
|
|
5
|
+
import { useId as R } from "../../react-id/dist/index.es.js";
|
|
6
|
+
import { useControllableState as q } from "../../react-use-controllable-state/dist/index.es.js";
|
|
7
|
+
import { DismissableLayer as K } from "../../react-dismissable-layer/dist/index.es.js";
|
|
8
|
+
import { FocusScope as U } from "../../react-focus-scope/dist/index.es.js";
|
|
9
|
+
import { Portal as Y } from "../../react-portal/dist/index.es.js";
|
|
10
|
+
import { Presence as h } from "../../react-presence/dist/index.es.js";
|
|
11
11
|
import { Primitive as g } from "../../react-primitive/dist/index.es.js";
|
|
12
|
-
import { useFocusGuards as
|
|
13
|
-
import
|
|
14
|
-
import { hideOthers as
|
|
15
|
-
import { createSlot as
|
|
16
|
-
import {
|
|
17
|
-
var D = "Dialog", [
|
|
12
|
+
import { useFocusGuards as Z } from "../../react-focus-guards/dist/index.es.js";
|
|
13
|
+
import z from "../../../react-remove-scroll/dist/es2015/Combination.es.js";
|
|
14
|
+
import { hideOthers as J } from "../../../aria-hidden/dist/es2015/index.es.js";
|
|
15
|
+
import { createSlot as Q } from "../../react-slot/dist/index.es.js";
|
|
16
|
+
import { jsx as i, jsxs as P, Fragment as O } from "react/jsx-runtime";
|
|
17
|
+
var D = "Dialog", [I, Ne] = H(D), [X, u] = I(D), x = (e) => {
|
|
18
18
|
const {
|
|
19
19
|
__scopeDialog: t,
|
|
20
20
|
children: n,
|
|
@@ -22,41 +22,41 @@ var D = "Dialog", [N, he] = $(D), [J, u] = N(D), P = (e) => {
|
|
|
22
22
|
defaultOpen: r,
|
|
23
23
|
onOpenChange: o,
|
|
24
24
|
modal: l = !0
|
|
25
|
-
} = e, c = s.useRef(null), f = s.useRef(null), [v,
|
|
25
|
+
} = e, c = s.useRef(null), f = s.useRef(null), [v, C] = q({
|
|
26
26
|
prop: a,
|
|
27
27
|
defaultProp: r ?? !1,
|
|
28
28
|
onChange: o,
|
|
29
29
|
caller: D
|
|
30
30
|
});
|
|
31
|
-
return /* @__PURE__ */ i
|
|
32
|
-
|
|
31
|
+
return /* @__PURE__ */ i(
|
|
32
|
+
X,
|
|
33
33
|
{
|
|
34
34
|
scope: t,
|
|
35
35
|
triggerRef: c,
|
|
36
36
|
contentRef: f,
|
|
37
|
-
contentId:
|
|
38
|
-
titleId:
|
|
39
|
-
descriptionId:
|
|
37
|
+
contentId: R(),
|
|
38
|
+
titleId: R(),
|
|
39
|
+
descriptionId: R(),
|
|
40
40
|
open: v,
|
|
41
|
-
onOpenChange:
|
|
42
|
-
onOpenToggle: s.useCallback(() =>
|
|
41
|
+
onOpenChange: C,
|
|
42
|
+
onOpenToggle: s.useCallback(() => C((j) => !j), [C]),
|
|
43
43
|
modal: l,
|
|
44
44
|
children: n
|
|
45
45
|
}
|
|
46
46
|
);
|
|
47
47
|
};
|
|
48
|
-
|
|
49
|
-
var
|
|
48
|
+
x.displayName = D;
|
|
49
|
+
var A = "DialogTrigger", ee = s.forwardRef(
|
|
50
50
|
(e, t) => {
|
|
51
|
-
const { __scopeDialog: n, ...a } = e, r = u(
|
|
52
|
-
return /* @__PURE__ */ i
|
|
51
|
+
const { __scopeDialog: n, ...a } = e, r = u(A, n), o = _(t, r.triggerRef);
|
|
52
|
+
return /* @__PURE__ */ i(
|
|
53
53
|
g.button,
|
|
54
54
|
{
|
|
55
55
|
type: "button",
|
|
56
56
|
"aria-haspopup": "dialog",
|
|
57
57
|
"aria-expanded": r.open,
|
|
58
58
|
"aria-controls": r.contentId,
|
|
59
|
-
"data-state":
|
|
59
|
+
"data-state": N(r.open),
|
|
60
60
|
...a,
|
|
61
61
|
ref: o,
|
|
62
62
|
onClick: p(e.onClick, r.onOpenToggle)
|
|
@@ -64,31 +64,31 @@ var O = "DialogTrigger", Q = s.forwardRef(
|
|
|
64
64
|
);
|
|
65
65
|
}
|
|
66
66
|
);
|
|
67
|
-
|
|
68
|
-
var
|
|
67
|
+
ee.displayName = A;
|
|
68
|
+
var E = "DialogPortal", [oe, T] = I(E, {
|
|
69
69
|
forceMount: void 0
|
|
70
|
-
}),
|
|
71
|
-
const { __scopeDialog: t, forceMount: n, children: a, container: r } = e, o = u(
|
|
72
|
-
return /* @__PURE__ */ i
|
|
70
|
+
}), b = (e) => {
|
|
71
|
+
const { __scopeDialog: t, forceMount: n, children: a, container: r } = e, o = u(E, t);
|
|
72
|
+
return /* @__PURE__ */ i(oe, { scope: t, forceMount: n, children: s.Children.map(a, (l) => /* @__PURE__ */ i(h, { present: n || o.open, children: /* @__PURE__ */ i(Y, { asChild: !0, container: r, children: l }) })) });
|
|
73
73
|
};
|
|
74
|
-
|
|
75
|
-
var m = "DialogOverlay",
|
|
74
|
+
b.displayName = E;
|
|
75
|
+
var m = "DialogOverlay", M = s.forwardRef(
|
|
76
76
|
(e, t) => {
|
|
77
|
-
const n =
|
|
78
|
-
return o.modal ? /* @__PURE__ */ i
|
|
77
|
+
const n = T(m, e.__scopeDialog), { forceMount: a = n.forceMount, ...r } = e, o = u(m, e.__scopeDialog);
|
|
78
|
+
return o.modal ? /* @__PURE__ */ i(h, { present: a || o.open, children: /* @__PURE__ */ i(re, { ...r, ref: t }) }) : null;
|
|
79
79
|
}
|
|
80
80
|
);
|
|
81
|
-
|
|
82
|
-
var
|
|
81
|
+
M.displayName = m;
|
|
82
|
+
var te = Q("DialogOverlay.RemoveScroll"), re = s.forwardRef(
|
|
83
83
|
(e, t) => {
|
|
84
84
|
const { __scopeDialog: n, ...a } = e, r = u(m, n);
|
|
85
85
|
return (
|
|
86
86
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
87
87
|
// ie. when `Overlay` and `Content` are siblings
|
|
88
|
-
/* @__PURE__ */ i
|
|
88
|
+
/* @__PURE__ */ i(z, { as: te, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ i(
|
|
89
89
|
g.div,
|
|
90
90
|
{
|
|
91
|
-
"data-state":
|
|
91
|
+
"data-state": N(r.open),
|
|
92
92
|
...a,
|
|
93
93
|
ref: t,
|
|
94
94
|
style: { pointerEvents: "auto", ...a.style }
|
|
@@ -96,21 +96,21 @@ var ee = z("DialogOverlay.RemoveScroll"), oe = s.forwardRef(
|
|
|
96
96
|
) })
|
|
97
97
|
);
|
|
98
98
|
}
|
|
99
|
-
), d = "DialogContent",
|
|
99
|
+
), d = "DialogContent", w = s.forwardRef(
|
|
100
100
|
(e, t) => {
|
|
101
|
-
const n =
|
|
102
|
-
return /* @__PURE__ */ i
|
|
101
|
+
const n = T(d, e.__scopeDialog), { forceMount: a = n.forceMount, ...r } = e, o = u(d, e.__scopeDialog);
|
|
102
|
+
return /* @__PURE__ */ i(h, { present: a || o.open, children: o.modal ? /* @__PURE__ */ i(ne, { ...r, ref: t }) : /* @__PURE__ */ i(ae, { ...r, ref: t }) });
|
|
103
103
|
}
|
|
104
104
|
);
|
|
105
|
-
|
|
106
|
-
var
|
|
105
|
+
w.displayName = d;
|
|
106
|
+
var ne = s.forwardRef(
|
|
107
107
|
(e, t) => {
|
|
108
|
-
const n = u(d, e.__scopeDialog), a = s.useRef(null), r =
|
|
108
|
+
const n = u(d, e.__scopeDialog), a = s.useRef(null), r = _(t, n.contentRef, a);
|
|
109
109
|
return s.useEffect(() => {
|
|
110
110
|
const o = a.current;
|
|
111
|
-
if (o) return
|
|
112
|
-
}, []), /* @__PURE__ */ i
|
|
113
|
-
|
|
111
|
+
if (o) return J(o);
|
|
112
|
+
}, []), /* @__PURE__ */ i(
|
|
113
|
+
S,
|
|
114
114
|
{
|
|
115
115
|
...e,
|
|
116
116
|
ref: r,
|
|
@@ -130,11 +130,11 @@ var te = s.forwardRef(
|
|
|
130
130
|
}
|
|
131
131
|
);
|
|
132
132
|
}
|
|
133
|
-
),
|
|
133
|
+
), ae = s.forwardRef(
|
|
134
134
|
(e, t) => {
|
|
135
135
|
const n = u(d, e.__scopeDialog), a = s.useRef(!1), r = s.useRef(!1);
|
|
136
|
-
return /* @__PURE__ */ i
|
|
137
|
-
|
|
136
|
+
return /* @__PURE__ */ i(
|
|
137
|
+
S,
|
|
138
138
|
{
|
|
139
139
|
...e,
|
|
140
140
|
ref: t,
|
|
@@ -151,26 +151,26 @@ var te = s.forwardRef(
|
|
|
151
151
|
}
|
|
152
152
|
);
|
|
153
153
|
}
|
|
154
|
-
),
|
|
154
|
+
), S = s.forwardRef(
|
|
155
155
|
(e, t) => {
|
|
156
|
-
const { __scopeDialog: n, trapFocus: a, onOpenAutoFocus: r, onCloseAutoFocus: o, ...l } = e, c = u(d, n), f = s.useRef(null), v =
|
|
157
|
-
return
|
|
158
|
-
/* @__PURE__ */ i
|
|
159
|
-
|
|
156
|
+
const { __scopeDialog: n, trapFocus: a, onOpenAutoFocus: r, onCloseAutoFocus: o, ...l } = e, c = u(d, n), f = s.useRef(null), v = _(t, f);
|
|
157
|
+
return Z(), /* @__PURE__ */ P(O, { children: [
|
|
158
|
+
/* @__PURE__ */ i(
|
|
159
|
+
U,
|
|
160
160
|
{
|
|
161
161
|
asChild: !0,
|
|
162
162
|
loop: !0,
|
|
163
163
|
trapped: a,
|
|
164
164
|
onMountAutoFocus: r,
|
|
165
165
|
onUnmountAutoFocus: o,
|
|
166
|
-
children: /* @__PURE__ */ i
|
|
167
|
-
|
|
166
|
+
children: /* @__PURE__ */ i(
|
|
167
|
+
K,
|
|
168
168
|
{
|
|
169
169
|
role: "dialog",
|
|
170
170
|
id: c.contentId,
|
|
171
171
|
"aria-describedby": c.descriptionId,
|
|
172
172
|
"aria-labelledby": c.titleId,
|
|
173
|
-
"data-state":
|
|
173
|
+
"data-state": N(c.open),
|
|
174
174
|
...l,
|
|
175
175
|
ref: v,
|
|
176
176
|
onDismiss: () => c.onOpenChange(!1)
|
|
@@ -178,30 +178,30 @@ var te = s.forwardRef(
|
|
|
178
178
|
)
|
|
179
179
|
}
|
|
180
180
|
),
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
/* @__PURE__ */ i
|
|
183
|
-
/* @__PURE__ */ i
|
|
181
|
+
/* @__PURE__ */ P(O, { children: [
|
|
182
|
+
/* @__PURE__ */ i(ie, { titleId: c.titleId }),
|
|
183
|
+
/* @__PURE__ */ i(ce, { contentRef: f, descriptionId: c.descriptionId })
|
|
184
184
|
] })
|
|
185
185
|
] });
|
|
186
186
|
}
|
|
187
|
-
),
|
|
187
|
+
), y = "DialogTitle", F = s.forwardRef(
|
|
188
188
|
(e, t) => {
|
|
189
|
-
const { __scopeDialog: n, ...a } = e, r = u(
|
|
190
|
-
return /* @__PURE__ */ i
|
|
189
|
+
const { __scopeDialog: n, ...a } = e, r = u(y, n);
|
|
190
|
+
return /* @__PURE__ */ i(g.h2, { id: r.titleId, ...a, ref: t });
|
|
191
191
|
}
|
|
192
192
|
);
|
|
193
|
-
|
|
194
|
-
var
|
|
193
|
+
F.displayName = y;
|
|
194
|
+
var W = "DialogDescription", k = s.forwardRef(
|
|
195
195
|
(e, t) => {
|
|
196
|
-
const { __scopeDialog: n, ...a } = e, r = u(
|
|
197
|
-
return /* @__PURE__ */ i
|
|
196
|
+
const { __scopeDialog: n, ...a } = e, r = u(W, n);
|
|
197
|
+
return /* @__PURE__ */ i(g.p, { id: r.descriptionId, ...a, ref: t });
|
|
198
198
|
}
|
|
199
199
|
);
|
|
200
|
-
|
|
201
|
-
var
|
|
200
|
+
k.displayName = W;
|
|
201
|
+
var G = "DialogClose", L = s.forwardRef(
|
|
202
202
|
(e, t) => {
|
|
203
|
-
const { __scopeDialog: n, ...a } = e, r = u(
|
|
204
|
-
return /* @__PURE__ */ i
|
|
203
|
+
const { __scopeDialog: n, ...a } = e, r = u(G, n);
|
|
204
|
+
return /* @__PURE__ */ i(
|
|
205
205
|
g.button,
|
|
206
206
|
{
|
|
207
207
|
type: "button",
|
|
@@ -212,16 +212,16 @@ var S = "DialogClose", W = s.forwardRef(
|
|
|
212
212
|
);
|
|
213
213
|
}
|
|
214
214
|
);
|
|
215
|
-
|
|
216
|
-
function
|
|
215
|
+
L.displayName = G;
|
|
216
|
+
function N(e) {
|
|
217
217
|
return e ? "open" : "closed";
|
|
218
218
|
}
|
|
219
|
-
var
|
|
219
|
+
var $ = "DialogTitleWarning", [Pe, B] = V($, {
|
|
220
220
|
contentName: d,
|
|
221
|
-
titleName:
|
|
221
|
+
titleName: y,
|
|
222
222
|
docsSlug: "dialog"
|
|
223
|
-
}),
|
|
224
|
-
const t =
|
|
223
|
+
}), ie = ({ titleId: e }) => {
|
|
224
|
+
const t = B($), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
225
225
|
|
|
226
226
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
227
227
|
|
|
@@ -229,30 +229,30 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
229
229
|
return s.useEffect(() => {
|
|
230
230
|
e && (document.getElementById(e) || console.error(n));
|
|
231
231
|
}, [n, e]), null;
|
|
232
|
-
},
|
|
233
|
-
const a = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${
|
|
232
|
+
}, se = "DialogDescriptionWarning", ce = ({ contentRef: e, descriptionId: t }) => {
|
|
233
|
+
const a = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${B(se).contentName}}.`;
|
|
234
234
|
return s.useEffect(() => {
|
|
235
235
|
const r = e.current?.getAttribute("aria-describedby");
|
|
236
236
|
t && r && (document.getElementById(t) || console.warn(a));
|
|
237
237
|
}, [a, e, t]), null;
|
|
238
|
-
},
|
|
238
|
+
}, Oe = x, Ie = b, xe = M, Ae = w, Te = F, be = k, Me = L;
|
|
239
239
|
export {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
240
|
+
Me as Close,
|
|
241
|
+
Ae as Content,
|
|
242
|
+
be as Description,
|
|
243
|
+
x as Dialog,
|
|
244
|
+
L as DialogClose,
|
|
245
|
+
w as DialogContent,
|
|
246
|
+
k as DialogDescription,
|
|
247
|
+
M as DialogOverlay,
|
|
248
|
+
b as DialogPortal,
|
|
249
|
+
F as DialogTitle,
|
|
250
|
+
ee as DialogTrigger,
|
|
251
|
+
xe as Overlay,
|
|
252
|
+
Ie as Portal,
|
|
253
|
+
Oe as Root,
|
|
254
|
+
Te as Title,
|
|
255
|
+
Pe as WarningProvider,
|
|
256
|
+
Ne as createDialogScope
|
|
257
257
|
};
|
|
258
258
|
//# sourceMappingURL=index.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../../../node_modules/@radix-ui/react-dialog/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/dialog.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContext, createContextScope } from \"@radix-ui/react-context\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useFocusGuards } from \"@radix-ui/react-focus-guards\";\nimport { RemoveScroll } from \"react-remove-scroll\";\nimport { hideOthers } from \"aria-hidden\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nvar DIALOG_NAME = \"Dialog\";\nvar [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);\nvar [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);\nvar Dialog = (props) => {\n const {\n __scopeDialog,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = true\n } = props;\n const triggerRef = React.useRef(null);\n const contentRef = React.useRef(null);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: DIALOG_NAME\n });\n return /* @__PURE__ */ jsx(\n DialogProvider,\n {\n scope: __scopeDialog,\n triggerRef,\n contentRef,\n contentId: useId(),\n titleId: useId(),\n descriptionId: useId(),\n open,\n onOpenChange: setOpen,\n onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),\n modal,\n children\n }\n );\n};\nDialog.displayName = DIALOG_NAME;\nvar TRIGGER_NAME = \"DialogTrigger\";\nvar DialogTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...triggerProps } = props;\n const context = useDialogContext(TRIGGER_NAME, __scopeDialog);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": context.open,\n \"aria-controls\": context.contentId,\n \"data-state\": getState(context.open),\n ...triggerProps,\n ref: composedTriggerRef,\n onClick: composeEventHandlers(props.onClick, context.onOpenToggle)\n }\n );\n }\n);\nDialogTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"DialogPortal\";\nvar [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {\n forceMount: void 0\n});\nvar DialogPortal = (props) => {\n const { __scopeDialog, forceMount, children, container } = props;\n const context = useDialogContext(PORTAL_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeDialog, forceMount, children: React.Children.map(children, (child) => /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children: child }) })) });\n};\nDialogPortal.displayName = PORTAL_NAME;\nvar OVERLAY_NAME = \"DialogOverlay\";\nvar DialogOverlay = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);\n return context.modal ? /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;\n }\n);\nDialogOverlay.displayName = OVERLAY_NAME;\nvar Slot = createSlot(\"DialogOverlay.RemoveScroll\");\nvar DialogOverlayImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, __scopeDialog);\n return (\n // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`\n // ie. when `Overlay` and `Content` are siblings\n /* @__PURE__ */ jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-state\": getState(context.open),\n ...overlayProps,\n ref: forwardedRef,\n style: { pointerEvents: \"auto\", ...overlayProps.style }\n }\n ) })\n );\n }\n);\nvar CONTENT_NAME = \"DialogContent\";\nvar DialogContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });\n }\n);\nDialogContent.displayName = CONTENT_NAME;\nvar DialogContentModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n return /* @__PURE__ */ jsx(\n DialogContentImpl,\n {\n ...props,\n ref: composedRefs,\n trapFocus: context.open,\n disableOutsidePointerEvents: true,\n onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {\n event.preventDefault();\n context.triggerRef.current?.focus();\n }),\n onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n if (isRightClick) event.preventDefault();\n }),\n onFocusOutside: composeEventHandlers(\n props.onFocusOutside,\n (event) => event.preventDefault()\n )\n }\n );\n }\n);\nvar DialogContentNonModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const hasInteractedOutsideRef = React.useRef(false);\n const hasPointerDownOutsideRef = React.useRef(false);\n return /* @__PURE__ */ jsx(\n DialogContentImpl,\n {\n ...props,\n ref: forwardedRef,\n trapFocus: false,\n disableOutsidePointerEvents: false,\n onCloseAutoFocus: (event) => {\n props.onCloseAutoFocus?.(event);\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n event.preventDefault();\n }\n hasInteractedOutsideRef.current = false;\n hasPointerDownOutsideRef.current = false;\n },\n onInteractOutside: (event) => {\n props.onInteractOutside?.(event);\n if (!event.defaultPrevented) {\n hasInteractedOutsideRef.current = true;\n if (event.detail.originalEvent.type === \"pointerdown\") {\n hasPointerDownOutsideRef.current = true;\n }\n }\n const target = event.target;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n if (event.detail.originalEvent.type === \"focusin\" && hasPointerDownOutsideRef.current) {\n event.preventDefault();\n }\n }\n }\n );\n }\n);\nvar DialogContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, __scopeDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n useFocusGuards();\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(\n FocusScope,\n {\n asChild: true,\n loop: true,\n trapped: trapFocus,\n onMountAutoFocus: onOpenAutoFocus,\n onUnmountAutoFocus: onCloseAutoFocus,\n children: /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n role: \"dialog\",\n id: context.contentId,\n \"aria-describedby\": context.descriptionId,\n \"aria-labelledby\": context.titleId,\n \"data-state\": getState(context.open),\n ...contentProps,\n ref: composedRefs,\n onDismiss: () => context.onOpenChange(false)\n }\n )\n }\n ),\n /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(TitleWarning, { titleId: context.titleId }),\n /* @__PURE__ */ jsx(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })\n ] })\n ] });\n }\n);\nvar TITLE_NAME = \"DialogTitle\";\nvar DialogTitle = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...titleProps } = props;\n const context = useDialogContext(TITLE_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });\n }\n);\nDialogTitle.displayName = TITLE_NAME;\nvar DESCRIPTION_NAME = \"DialogDescription\";\nvar DialogDescription = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...descriptionProps } = props;\n const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });\n }\n);\nDialogDescription.displayName = DESCRIPTION_NAME;\nvar CLOSE_NAME = \"DialogClose\";\nvar DialogClose = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...closeProps } = props;\n const context = useDialogContext(CLOSE_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n ...closeProps,\n ref: forwardedRef,\n onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))\n }\n );\n }\n);\nDialogClose.displayName = CLOSE_NAME;\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nvar TITLE_WARNING_NAME = \"DialogTitleWarning\";\nvar [WarningProvider, useWarningContext] = createContext(TITLE_WARNING_NAME, {\n contentName: CONTENT_NAME,\n titleName: TITLE_NAME,\n docsSlug: \"dialog\"\n});\nvar TitleWarning = ({ titleId }) => {\n const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);\n const MESSAGE = `\\`${titleWarningContext.contentName}\\` requires a \\`${titleWarningContext.titleName}\\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \\`${titleWarningContext.titleName}\\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;\n React.useEffect(() => {\n if (titleId) {\n const hasTitle = document.getElementById(titleId);\n if (!hasTitle) console.error(MESSAGE);\n }\n }, [MESSAGE, titleId]);\n return null;\n};\nvar DESCRIPTION_WARNING_NAME = \"DialogDescriptionWarning\";\nvar DescriptionWarning = ({ contentRef, descriptionId }) => {\n const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);\n const MESSAGE = `Warning: Missing \\`Description\\` or \\`aria-describedby={undefined}\\` for {${descriptionWarningContext.contentName}}.`;\n React.useEffect(() => {\n const describedById = contentRef.current?.getAttribute(\"aria-describedby\");\n if (descriptionId && describedById) {\n const hasDescription = document.getElementById(descriptionId);\n if (!hasDescription) console.warn(MESSAGE);\n }\n }, [MESSAGE, contentRef, descriptionId]);\n return null;\n};\nvar Root = Dialog;\nvar Trigger = DialogTrigger;\nvar Portal = DialogPortal;\nvar Overlay = DialogOverlay;\nvar Content = DialogContent;\nvar Title = DialogTitle;\nvar Description = DialogDescription;\nvar Close = DialogClose;\nexport {\n Close,\n Content,\n Description,\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n Overlay,\n Portal,\n Root,\n Title,\n Trigger,\n WarningProvider,\n createDialogScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["DIALOG_NAME","createDialogContext","createDialogScope","createContextScope","DialogProvider","useDialogContext","Dialog","props","__scopeDialog","children","openProp","defaultOpen","onOpenChange","modal","triggerRef","React","contentRef","open","setOpen","useControllableState","jsx","useId","prevOpen","TRIGGER_NAME","DialogTrigger","forwardedRef","triggerProps","context","composedTriggerRef","useComposedRefs","Primitive","getState","composeEventHandlers","PORTAL_NAME","PortalProvider","usePortalContext","DialogPortal","forceMount","container","child","Presence","PortalPrimitive","OVERLAY_NAME","DialogOverlay","portalContext","overlayProps","DialogOverlayImpl","Slot","createSlot","RemoveScroll","CONTENT_NAME","DialogContent","contentProps","DialogContentModal","DialogContentNonModal","composedRefs","content","hideOthers","DialogContentImpl","event","originalEvent","ctrlLeftClick","hasInteractedOutsideRef","hasPointerDownOutsideRef","target","trapFocus","onOpenAutoFocus","onCloseAutoFocus","useFocusGuards","jsxs","Fragment","FocusScope","DismissableLayer","TitleWarning","DescriptionWarning","TITLE_NAME","DialogTitle","titleProps","DESCRIPTION_NAME","DialogDescription","descriptionProps","CLOSE_NAME","DialogClose","closeProps","TITLE_WARNING_NAME","WarningProvider","useWarningContext","createContext","titleId","titleWarningContext","MESSAGE","DESCRIPTION_WARNING_NAME","descriptionId","describedById","Root","Portal","Overlay","Content","Title","Description","Close"],"mappings":";;;;;;;;;;;;;;;;AAmBA,IAAIA,IAAc,UACd,CAACC,GAAqBC,EAAiB,IAAIC,EAAmBH,CAAW,GACzE,CAACI,GAAgBC,CAAgB,IAAIJ,EAAoBD,CAAW,GACpEM,IAAS,CAACC,MAAU;AACtB,QAAM;AAAA,IACJ,eAAAC;AAAA,IACA,UAAAC;AAAA,IACA,MAAMC;AAAA,IACN,aAAAC;AAAA,IACA,cAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,EACZ,IAAMN,GACEO,IAAaC,EAAM,OAAO,IAAI,GAC9BC,IAAaD,EAAM,OAAO,IAAI,GAC9B,CAACE,GAAMC,CAAO,IAAIC,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,CAAC,GACGF,KAAe,CAAC,EAAE,SAAAe,QAAc;AAClC,QAAMC,IAAsBH,EAAkBF,CAAkB,GAC1DM,IAAU,KAAKD,EAAoB,WAAW,mBAAmBA,EAAoB,SAAS;AAAA;AAAA,4BAE1EA,EAAoB,SAAS;AAAA;AAAA,4EAEmBA,EAAoB,QAAQ;AACtG,SAAA1E,EAAM,UAAU,MAAM;AACpB,IAAIyE,MACe,SAAS,eAAeA,CAAO,KACjC,QAAQ,MAAME,CAAO;AAAA,EAExC,GAAG,CAACA,GAASF,CAAO,CAAC,GACd;AACT,GACIG,KAA2B,4BAC3BjB,KAAqB,CAAC,EAAE,YAAA1D,GAAY,eAAA4E,QAAoB;AAE1D,QAAMF,IAAU,6EADkBJ,EAAkBK,EAAwB,EAC2C,WAAW;AAClI,SAAA5E,EAAM,UAAU,MAAM;AACpB,UAAM8E,IAAgB7E,EAAW,SAAS,aAAa,kBAAkB;AACzE,IAAI4E,KAAiBC,MACI,SAAS,eAAeD,CAAa,KACvC,QAAQ,KAAKF,CAAO;AAAA,EAE7C,GAAG,CAACA,GAAS1E,GAAY4E,CAAa,CAAC,GAChC;AACT,GACIE,KAAOxF,GAEPyF,KAAS3D,GACT4D,KAAUrD,GACVsD,KAAU9C,GACV+C,KAAQtB,GACRuB,KAAcpB,GACdqB,KAAQlB;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../../../node_modules/@radix-ui/react-dialog/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/dialog.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContext, createContextScope } from \"@radix-ui/react-context\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useFocusGuards } from \"@radix-ui/react-focus-guards\";\nimport { RemoveScroll } from \"react-remove-scroll\";\nimport { hideOthers } from \"aria-hidden\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { Fragment, jsx, jsxs } from \"react/jsx-runtime\";\nvar DIALOG_NAME = \"Dialog\";\nvar [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);\nvar [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);\nvar Dialog = (props) => {\n const {\n __scopeDialog,\n children,\n open: openProp,\n defaultOpen,\n onOpenChange,\n modal = true\n } = props;\n const triggerRef = React.useRef(null);\n const contentRef = React.useRef(null);\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: DIALOG_NAME\n });\n return /* @__PURE__ */ jsx(\n DialogProvider,\n {\n scope: __scopeDialog,\n triggerRef,\n contentRef,\n contentId: useId(),\n titleId: useId(),\n descriptionId: useId(),\n open,\n onOpenChange: setOpen,\n onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),\n modal,\n children\n }\n );\n};\nDialog.displayName = DIALOG_NAME;\nvar TRIGGER_NAME = \"DialogTrigger\";\nvar DialogTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...triggerProps } = props;\n const context = useDialogContext(TRIGGER_NAME, __scopeDialog);\n const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": context.open,\n \"aria-controls\": context.contentId,\n \"data-state\": getState(context.open),\n ...triggerProps,\n ref: composedTriggerRef,\n onClick: composeEventHandlers(props.onClick, context.onOpenToggle)\n }\n );\n }\n);\nDialogTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"DialogPortal\";\nvar [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {\n forceMount: void 0\n});\nvar DialogPortal = (props) => {\n const { __scopeDialog, forceMount, children, container } = props;\n const context = useDialogContext(PORTAL_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeDialog, forceMount, children: React.Children.map(children, (child) => /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children: child }) })) });\n};\nDialogPortal.displayName = PORTAL_NAME;\nvar OVERLAY_NAME = \"DialogOverlay\";\nvar DialogOverlay = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);\n return context.modal ? /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;\n }\n);\nDialogOverlay.displayName = OVERLAY_NAME;\nvar Slot = createSlot(\"DialogOverlay.RemoveScroll\");\nvar DialogOverlayImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...overlayProps } = props;\n const context = useDialogContext(OVERLAY_NAME, __scopeDialog);\n return (\n // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`\n // ie. when `Overlay` and `Content` are siblings\n /* @__PURE__ */ jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-state\": getState(context.open),\n ...overlayProps,\n ref: forwardedRef,\n style: { pointerEvents: \"auto\", ...overlayProps.style }\n }\n ) })\n );\n }\n);\nvar CONTENT_NAME = \"DialogContent\";\nvar DialogContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });\n }\n);\nDialogContent.displayName = CONTENT_NAME;\nvar DialogContentModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);\n React.useEffect(() => {\n const content = contentRef.current;\n if (content) return hideOthers(content);\n }, []);\n return /* @__PURE__ */ jsx(\n DialogContentImpl,\n {\n ...props,\n ref: composedRefs,\n trapFocus: context.open,\n disableOutsidePointerEvents: true,\n onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {\n event.preventDefault();\n context.triggerRef.current?.focus();\n }),\n onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {\n const originalEvent = event.detail.originalEvent;\n const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;\n const isRightClick = originalEvent.button === 2 || ctrlLeftClick;\n if (isRightClick) event.preventDefault();\n }),\n onFocusOutside: composeEventHandlers(\n props.onFocusOutside,\n (event) => event.preventDefault()\n )\n }\n );\n }\n);\nvar DialogContentNonModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);\n const hasInteractedOutsideRef = React.useRef(false);\n const hasPointerDownOutsideRef = React.useRef(false);\n return /* @__PURE__ */ jsx(\n DialogContentImpl,\n {\n ...props,\n ref: forwardedRef,\n trapFocus: false,\n disableOutsidePointerEvents: false,\n onCloseAutoFocus: (event) => {\n props.onCloseAutoFocus?.(event);\n if (!event.defaultPrevented) {\n if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();\n event.preventDefault();\n }\n hasInteractedOutsideRef.current = false;\n hasPointerDownOutsideRef.current = false;\n },\n onInteractOutside: (event) => {\n props.onInteractOutside?.(event);\n if (!event.defaultPrevented) {\n hasInteractedOutsideRef.current = true;\n if (event.detail.originalEvent.type === \"pointerdown\") {\n hasPointerDownOutsideRef.current = true;\n }\n }\n const target = event.target;\n const targetIsTrigger = context.triggerRef.current?.contains(target);\n if (targetIsTrigger) event.preventDefault();\n if (event.detail.originalEvent.type === \"focusin\" && hasPointerDownOutsideRef.current) {\n event.preventDefault();\n }\n }\n }\n );\n }\n);\nvar DialogContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;\n const context = useDialogContext(CONTENT_NAME, __scopeDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n useFocusGuards();\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(\n FocusScope,\n {\n asChild: true,\n loop: true,\n trapped: trapFocus,\n onMountAutoFocus: onOpenAutoFocus,\n onUnmountAutoFocus: onCloseAutoFocus,\n children: /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n role: \"dialog\",\n id: context.contentId,\n \"aria-describedby\": context.descriptionId,\n \"aria-labelledby\": context.titleId,\n \"data-state\": getState(context.open),\n ...contentProps,\n ref: composedRefs,\n onDismiss: () => context.onOpenChange(false)\n }\n )\n }\n ),\n /* @__PURE__ */ jsxs(Fragment, { children: [\n /* @__PURE__ */ jsx(TitleWarning, { titleId: context.titleId }),\n /* @__PURE__ */ jsx(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })\n ] })\n ] });\n }\n);\nvar TITLE_NAME = \"DialogTitle\";\nvar DialogTitle = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...titleProps } = props;\n const context = useDialogContext(TITLE_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });\n }\n);\nDialogTitle.displayName = TITLE_NAME;\nvar DESCRIPTION_NAME = \"DialogDescription\";\nvar DialogDescription = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...descriptionProps } = props;\n const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });\n }\n);\nDialogDescription.displayName = DESCRIPTION_NAME;\nvar CLOSE_NAME = \"DialogClose\";\nvar DialogClose = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeDialog, ...closeProps } = props;\n const context = useDialogContext(CLOSE_NAME, __scopeDialog);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n ...closeProps,\n ref: forwardedRef,\n onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))\n }\n );\n }\n);\nDialogClose.displayName = CLOSE_NAME;\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nvar TITLE_WARNING_NAME = \"DialogTitleWarning\";\nvar [WarningProvider, useWarningContext] = createContext(TITLE_WARNING_NAME, {\n contentName: CONTENT_NAME,\n titleName: TITLE_NAME,\n docsSlug: \"dialog\"\n});\nvar TitleWarning = ({ titleId }) => {\n const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);\n const MESSAGE = `\\`${titleWarningContext.contentName}\\` requires a \\`${titleWarningContext.titleName}\\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \\`${titleWarningContext.titleName}\\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;\n React.useEffect(() => {\n if (titleId) {\n const hasTitle = document.getElementById(titleId);\n if (!hasTitle) console.error(MESSAGE);\n }\n }, [MESSAGE, titleId]);\n return null;\n};\nvar DESCRIPTION_WARNING_NAME = \"DialogDescriptionWarning\";\nvar DescriptionWarning = ({ contentRef, descriptionId }) => {\n const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);\n const MESSAGE = `Warning: Missing \\`Description\\` or \\`aria-describedby={undefined}\\` for {${descriptionWarningContext.contentName}}.`;\n React.useEffect(() => {\n const describedById = contentRef.current?.getAttribute(\"aria-describedby\");\n if (descriptionId && describedById) {\n const hasDescription = document.getElementById(descriptionId);\n if (!hasDescription) console.warn(MESSAGE);\n }\n }, [MESSAGE, contentRef, descriptionId]);\n return null;\n};\nvar Root = Dialog;\nvar Trigger = DialogTrigger;\nvar Portal = DialogPortal;\nvar Overlay = DialogOverlay;\nvar Content = DialogContent;\nvar Title = DialogTitle;\nvar Description = DialogDescription;\nvar Close = DialogClose;\nexport {\n Close,\n Content,\n Description,\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n Overlay,\n Portal,\n Root,\n Title,\n Trigger,\n WarningProvider,\n createDialogScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["DIALOG_NAME","createDialogContext","createDialogScope","createContextScope","DialogProvider","useDialogContext","Dialog","props","__scopeDialog","children","openProp","defaultOpen","onOpenChange","modal","triggerRef","React","contentRef","open","setOpen","useControllableState","jsx","useId","prevOpen","TRIGGER_NAME","DialogTrigger","forwardedRef","triggerProps","context","composedTriggerRef","useComposedRefs","Primitive","getState","composeEventHandlers","PORTAL_NAME","PortalProvider","usePortalContext","DialogPortal","forceMount","container","child","Presence","PortalPrimitive","OVERLAY_NAME","DialogOverlay","portalContext","overlayProps","DialogOverlayImpl","Slot","createSlot","RemoveScroll","CONTENT_NAME","DialogContent","contentProps","DialogContentModal","DialogContentNonModal","composedRefs","content","hideOthers","DialogContentImpl","event","originalEvent","ctrlLeftClick","hasInteractedOutsideRef","hasPointerDownOutsideRef","target","trapFocus","onOpenAutoFocus","onCloseAutoFocus","useFocusGuards","jsxs","Fragment","FocusScope","DismissableLayer","TitleWarning","DescriptionWarning","TITLE_NAME","DialogTitle","titleProps","DESCRIPTION_NAME","DialogDescription","descriptionProps","CLOSE_NAME","DialogClose","closeProps","TITLE_WARNING_NAME","WarningProvider","useWarningContext","createContext","titleId","titleWarningContext","MESSAGE","DESCRIPTION_WARNING_NAME","descriptionId","describedById","Root","Portal","Overlay","Content","Title","Description","Close"],"mappings":";;;;;;;;;;;;;;;;AAmBA,IAAIA,IAAc,UACd,CAACC,GAAqBC,EAAiB,IAAIC,EAAmBH,CAAW,GACzE,CAACI,GAAgBC,CAAgB,IAAIJ,EAAoBD,CAAW,GACpEM,IAAS,CAACC,MAAU;AACtB,QAAM;AAAA,IACJ,eAAAC;AAAA,IACA,UAAAC;AAAA,IACA,MAAMC;AAAA,IACN,aAAAC;AAAA,IACA,cAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,EACZ,IAAMN,GACEO,IAAaC,EAAM,OAAO,IAAI,GAC9BC,IAAaD,EAAM,OAAO,IAAI,GAC9B,CAACE,GAAMC,CAAO,IAAIC,EAAqB;AAAA,IAC3C,MAAMT;AAAA,IACN,aAAaC,KAAe;AAAA,IAC5B,UAAUC;AAAA,IACV,QAAQZ;AAAA,EACZ,CAAG;AACD,SAAuB,gBAAAoB;AAAA,IACrBhB;AAAA,IACA;AAAA,MACE,OAAOI;AAAA,MACP,YAAAM;AAAA,MACA,YAAAE;AAAA,MACA,WAAWK,EAAK;AAAA,MAChB,SAASA,EAAK;AAAA,MACd,eAAeA,EAAK;AAAA,MACpB,MAAAJ;AAAA,MACA,cAAcC;AAAA,MACd,cAAcH,EAAM,YAAY,MAAMG,EAAQ,CAACI,MAAa,CAACA,CAAQ,GAAG,CAACJ,CAAO,CAAC;AAAA,MACjF,OAAAL;AAAA,MACA,UAAAJ;AAAA,IACN;AAAA,EACA;AACA;AACAH,EAAO,cAAcN;AACrB,IAAIuB,IAAe,iBACfC,KAAgBT,EAAM;AAAA,EACxB,CAACR,GAAOkB,MAAiB;AACvB,UAAM,EAAE,eAAAjB,GAAe,GAAGkB,EAAY,IAAKnB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KAAcpB,GACdqB,KAAQlB;","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("react"),b=require("../../primitive/dist/index.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("react"),b=require("../../primitive/dist/index.cjs"),m=require("../../react-primitive/dist/index.cjs"),R=require("../../react-compose-refs/dist/index.cjs"),w=require("../../react-use-callback-ref/dist/index.cjs"),H=require("../../react-use-escape-keydown/dist/index.cjs"),x=require("react/jsx-runtime");function U(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const i=U(q);var z="DismissableLayer",h="dismissableLayer.update",M="dismissableLayer.pointerDownOutside",$="dismissableLayer.focusOutside",L,T=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),S=i.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:c,onInteractOutside:f,onDismiss:d,...v}=e,a=i.useContext(T),[u,I]=i.useState(null),l=u?.ownerDocument??globalThis?.document,[,N]=i.useState({}),W=R.useComposedRefs(t,s=>I(s)),p=Array.from(a.layers),[_]=[...a.layersWithOutsidePointerEventsDisabled].slice(-1),A=p.indexOf(_),D=u?p.indexOf(u):-1,j=a.layersWithOutsidePointerEventsDisabled.size>0,O=D>=A,k=X(s=>{const E=s.target,C=[...a.branches].some(y=>y.contains(E));!O||C||(o?.(s),f?.(s),s.defaultPrevented||d?.())},l),P=Y(s=>{const E=s.target;[...a.branches].some(y=>y.contains(E))||(c?.(s),f?.(s),s.defaultPrevented||d?.())},l);return H.useEscapeKeydown(s=>{D===a.layers.size-1&&(r?.(s),!s.defaultPrevented&&d&&(s.preventDefault(),d()))},l),i.useEffect(()=>{if(u)return n&&(a.layersWithOutsidePointerEventsDisabled.size===0&&(L=l.body.style.pointerEvents,l.body.style.pointerEvents="none"),a.layersWithOutsidePointerEventsDisabled.add(u)),a.layers.add(u),g(),()=>{n&&a.layersWithOutsidePointerEventsDisabled.size===1&&(l.body.style.pointerEvents=L)}},[u,l,n,a]),i.useEffect(()=>()=>{u&&(a.layers.delete(u),a.layersWithOutsidePointerEventsDisabled.delete(u),g())},[u,a]),i.useEffect(()=>{const s=()=>N({});return document.addEventListener(h,s),()=>document.removeEventListener(h,s)},[]),x.jsx(m.Primitive.div,{...v,ref:W,style:{pointerEvents:j?O?"auto":"none":void 0,...e.style},onFocusCapture:b.composeEventHandlers(e.onFocusCapture,P.onFocusCapture),onBlurCapture:b.composeEventHandlers(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:b.composeEventHandlers(e.onPointerDownCapture,k.onPointerDownCapture)})});S.displayName=z;var K="DismissableLayerBranch",B=i.forwardRef((e,t)=>{const n=i.useContext(T),r=i.useRef(null),o=R.useComposedRefs(t,r);return i.useEffect(()=>{const c=r.current;if(c)return n.branches.add(c),()=>{n.branches.delete(c)}},[n.branches]),x.jsx(m.Primitive.div,{...e,ref:o})});B.displayName=K;function X(e,t=globalThis?.document){const n=w.useCallbackRef(e),r=i.useRef(!1),o=i.useRef(()=>{});return i.useEffect(()=>{const c=d=>{if(d.target&&!r.current){let v=function(){F(M,n,a,{discrete:!0})};const a={originalEvent:d};d.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=v,t.addEventListener("click",o.current,{once:!0})):v()}else t.removeEventListener("click",o.current);r.current=!1},f=window.setTimeout(()=>{t.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(f),t.removeEventListener("pointerdown",c),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Y(e,t=globalThis?.document){const n=w.useCallbackRef(e),r=i.useRef(!1);return i.useEffect(()=>{const o=c=>{c.target&&!r.current&&F($,n,{originalEvent:c},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function g(){const e=new CustomEvent(h);document.dispatchEvent(e)}function F(e,t,n,{discrete:r}){const o=n.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?m.dispatchDiscreteCustomEvent(o,c):o.dispatchEvent(c)}exports.DismissableLayer=S;exports.DismissableLayerBranch=B;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/dismissable-layer.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Primitive, dispatchDiscreteCustomEvent } from \"@radix-ui/react-primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useEscapeKeydown } from \"@radix-ui/react-use-escape-keydown\";\nimport { jsx } from \"react/jsx-runtime\";\nvar DISMISSABLE_LAYER_NAME = \"DismissableLayer\";\nvar CONTEXT_UPDATE = \"dismissableLayer.update\";\nvar POINTER_DOWN_OUTSIDE = \"dismissableLayer.pointerDownOutside\";\nvar FOCUS_OUTSIDE = \"dismissableLayer.focusOutside\";\nvar originalBodyPointerEvents;\nvar DismissableLayerContext = React.createContext({\n layers: /* @__PURE__ */ new Set(),\n layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),\n branches: /* @__PURE__ */ new Set()\n});\nvar DismissableLayer = React.forwardRef(\n (props, forwardedRef) => {\n const {\n disableOutsidePointerEvents = false,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n ...layerProps\n } = props;\n const context = React.useContext(DismissableLayerContext);\n const [node, setNode] = React.useState(null);\n const ownerDocument = node?.ownerDocument ?? globalThis?.document;\n const [, force] = React.useState({});\n const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));\n const layers = Array.from(context.layers);\n const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);\n const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);\n const index = node ? layers.indexOf(node) : -1;\n const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;\n const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;\n const pointerDownOutside = usePointerDownOutside((event) => {\n const target = event.target;\n const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));\n if (!isPointerEventsEnabled || isPointerDownOnBranch) return;\n onPointerDownOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n const focusOutside = useFocusOutside((event) => {\n const target = event.target;\n const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));\n if (isFocusInBranch) return;\n onFocusOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n useEscapeKeydown((event) => {\n const isHighestLayer = index === context.layers.size - 1;\n if (!isHighestLayer) return;\n onEscapeKeyDown?.(event);\n if (!event.defaultPrevented && onDismiss) {\n event.preventDefault();\n onDismiss();\n }\n }, ownerDocument);\n React.useEffect(() => {\n if (!node) return;\n if (disableOutsidePointerEvents) {\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;\n ownerDocument.body.style.pointerEvents = \"none\";\n }\n context.layersWithOutsidePointerEventsDisabled.add(node);\n }\n context.layers.add(node);\n dispatchUpdate();\n return () => {\n if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {\n ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;\n }\n };\n }, [node, ownerDocument, disableOutsidePointerEvents, context]);\n React.useEffect(() => {\n return () => {\n if (!node) return;\n context.layers.delete(node);\n context.layersWithOutsidePointerEventsDisabled.delete(node);\n dispatchUpdate();\n };\n }, [node, context]);\n React.useEffect(() => {\n const handleUpdate = () => force({});\n document.addEventListener(CONTEXT_UPDATE, handleUpdate);\n return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);\n }, []);\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n ...layerProps,\n ref: composedRefs,\n style: {\n pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? \"auto\" : \"none\" : void 0,\n ...props.style\n },\n onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),\n onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),\n onPointerDownCapture: composeEventHandlers(\n props.onPointerDownCapture,\n pointerDownOutside.onPointerDownCapture\n )\n }\n );\n }\n);\nDismissableLayer.displayName = DISMISSABLE_LAYER_NAME;\nvar BRANCH_NAME = \"DismissableLayerBranch\";\nvar DismissableLayerBranch = React.forwardRef((props, forwardedRef) => {\n const context = React.useContext(DismissableLayerContext);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n context.branches.add(node);\n return () => {\n context.branches.delete(node);\n };\n }\n }, [context.branches]);\n return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs });\n});\nDismissableLayerBranch.displayName = BRANCH_NAME;\nfunction usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {\n const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);\n const isPointerInsideReactTreeRef = React.useRef(false);\n const handleClickRef = React.useRef(() => {\n });\n React.useEffect(() => {\n const handlePointerDown = (event) => {\n if (event.target && !isPointerInsideReactTreeRef.current) {\n let handleAndDispatchPointerDownOutsideEvent2 = function() {\n handleAndDispatchCustomEvent(\n POINTER_DOWN_OUTSIDE,\n handlePointerDownOutside,\n eventDetail,\n { discrete: true }\n );\n };\n var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;\n const eventDetail = { originalEvent: event };\n if (event.pointerType === \"touch\") {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;\n ownerDocument.addEventListener(\"click\", handleClickRef.current, { once: true });\n } else {\n handleAndDispatchPointerDownOutsideEvent2();\n }\n } else {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n }\n isPointerInsideReactTreeRef.current = false;\n };\n const timerId = window.setTimeout(() => {\n ownerDocument.addEventListener(\"pointerdown\", handlePointerDown);\n }, 0);\n return () => {\n window.clearTimeout(timerId);\n ownerDocument.removeEventListener(\"pointerdown\", handlePointerDown);\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n };\n }, [ownerDocument, handlePointerDownOutside]);\n return {\n // ensures we check React component tree (not just DOM tree)\n onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true\n };\n}\nfunction useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {\n const handleFocusOutside = useCallbackRef(onFocusOutside);\n const isFocusInsideReactTreeRef = React.useRef(false);\n React.useEffect(() => {\n const handleFocus = (event) => {\n if (event.target && !isFocusInsideReactTreeRef.current) {\n const eventDetail = { originalEvent: event };\n handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {\n discrete: false\n });\n }\n };\n ownerDocument.addEventListener(\"focusin\", handleFocus);\n return () => ownerDocument.removeEventListener(\"focusin\", handleFocus);\n }, [ownerDocument, handleFocusOutside]);\n return {\n onFocusCapture: () => isFocusInsideReactTreeRef.current = true,\n onBlurCapture: () => isFocusInsideReactTreeRef.current = false\n };\n}\nfunction dispatchUpdate() {\n const event = new CustomEvent(CONTEXT_UPDATE);\n document.dispatchEvent(event);\n}\nfunction handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {\n const target = detail.originalEvent.target;\n const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });\n if (handler) target.addEventListener(name, handler, { once: true });\n if (discrete) {\n dispatchDiscreteCustomEvent(target, event);\n } else {\n target.dispatchEvent(event);\n }\n}\nvar Root = DismissableLayer;\nvar Branch = DismissableLayerBranch;\nexport {\n Branch,\n DismissableLayer,\n DismissableLayerBranch,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["DISMISSABLE_LAYER_NAME","CONTEXT_UPDATE","POINTER_DOWN_OUTSIDE","FOCUS_OUTSIDE","originalBodyPointerEvents","DismissableLayerContext","React","DismissableLayer","props","forwardedRef","disableOutsidePointerEvents","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","layerProps","context","node","setNode","ownerDocument","force","composedRefs","useComposedRefs","node2","layers","highestLayerWithOutsidePointerEventsDisabled","highestLayerWithOutsidePointerEventsDisabledIndex","index","isBodyPointerEventsDisabled","isPointerEventsEnabled","pointerDownOutside","usePointerDownOutside","event","target","isPointerDownOnBranch","branch","focusOutside","useFocusOutside","useEscapeKeydown","dispatchUpdate","handleUpdate","jsx","Primitive","composeEventHandlers","BRANCH_NAME","DismissableLayerBranch","ref","handlePointerDownOutside","useCallbackRef","isPointerInsideReactTreeRef","handleClickRef","handlePointerDown","handleAndDispatchPointerDownOutsideEvent2","handleAndDispatchCustomEvent","eventDetail","timerId","handleFocusOutside","isFocusInsideReactTreeRef","handleFocus","name","handler","detail","discrete","dispatchDiscreteCustomEvent"],"mappings":"4rBAUA,IAAIA,EAAyB,mBACzBC,EAAiB,0BACjBC,EAAuB,sCACvBC,EAAgB,gCAChBC,EACAC,EAA0BC,EAAM,cAAc,CAChD,OAAwB,IAAI,IAC5B,uCAAwD,IAAI,IAC5D,SAA0B,IAAI,GAChC,CAAC,EACGC,EAAmBD,EAAM,WAC3B,CAAC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O,EAC3BpC,EAAc,oBAAoB,cAAegC,CAAiB,EAClEhC,EAAc,oBAAoB,QAAS+B,EAAe,OAAO,CACnE,CACF,EAAG,CAAC/B,EAAe4B,CAAwB,CAAC,EACrC,CAEL,qBAAsB,IAAME,EAA4B,QAAU,EACtE,CACA,CACA,SAASZ,EAAgBzB,EAAgBO,EAAgB,YAAY,SAAU,CAC7E,MAAMqC,EAAqBR,EAAAA,eAAepC,CAAc,EAClD6C,EAA4BpD,EAAM,OAAO,EAAK,EACpDA,OAAAA,EAAM,UAAU,IAAM,CACpB,MAAMqD,EAAe1B,GAAU,CACzBA,EAAM,QAAU,CAACyB,EAA0B,SAE7CJ,EAA6BnD,EAAesD,EADxB,CAAE,cAAexB,CAAK,EACmC,CAC3E,SAAU,EACpB,CAAS,CAEL,EACA,OAAAb,EAAc,iBAAiB,UAAWuC,CAAW,EAC9C,IAAMvC,EAAc,oBAAoB,UAAWuC,CAAW,CACvE,EAAG,CAACvC,EAAeqC,CAAkB,CAAC,EAC/B,CACL,eAAgB,IAAMC,EAA0B,QAAU,GAC1D,cAAe,IAAMA,EAA0B,QAAU,EAC7D,CACA,CACA,SAASlB,GAAiB,CACxB,MAAMP,EAAQ,IAAI,YAAYhC,CAAc,EAC5C,SAAS,cAAcgC,CAAK,CAC9B,CACA,SAASqB,EAA6BM,EAAMC,EAASC,EAAQ,CAAE,SAAAC,CAAQ,EAAI,CACzE,MAAM7B,EAAS4B,EAAO,cAAc,OAC9B7B,EAAQ,IAAI,YAAY2B,EAAM,CAAE,QAAS,GAAO,WAAY,GAAM,OAAAE,EAAQ,EAC5ED,GAAS3B,EAAO,iBAAiB0B,EAAMC,EAAS,CAAE,KAAM,GAAM,EAC9DE,EACFC,EAAAA,4BAA4B9B,EAAQD,CAAK,EAEzCC,EAAO,cAAcD,CAAK,CAE9B","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../../node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/dismissable-layer.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Primitive, dispatchDiscreteCustomEvent } from \"@radix-ui/react-primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useEscapeKeydown } from \"@radix-ui/react-use-escape-keydown\";\nimport { jsx } from \"react/jsx-runtime\";\nvar DISMISSABLE_LAYER_NAME = \"DismissableLayer\";\nvar CONTEXT_UPDATE = \"dismissableLayer.update\";\nvar POINTER_DOWN_OUTSIDE = \"dismissableLayer.pointerDownOutside\";\nvar FOCUS_OUTSIDE = \"dismissableLayer.focusOutside\";\nvar originalBodyPointerEvents;\nvar DismissableLayerContext = React.createContext({\n layers: /* @__PURE__ */ new Set(),\n layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),\n branches: /* @__PURE__ */ new Set()\n});\nvar DismissableLayer = React.forwardRef(\n (props, forwardedRef) => {\n const {\n disableOutsidePointerEvents = false,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n ...layerProps\n } = props;\n const context = React.useContext(DismissableLayerContext);\n const [node, setNode] = React.useState(null);\n const ownerDocument = node?.ownerDocument ?? globalThis?.document;\n const [, force] = React.useState({});\n const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));\n const layers = Array.from(context.layers);\n const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);\n const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);\n const index = node ? layers.indexOf(node) : -1;\n const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;\n const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;\n const pointerDownOutside = usePointerDownOutside((event) => {\n const target = event.target;\n const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));\n if (!isPointerEventsEnabled || isPointerDownOnBranch) return;\n onPointerDownOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n const focusOutside = useFocusOutside((event) => {\n const target = event.target;\n const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));\n if (isFocusInBranch) return;\n onFocusOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n useEscapeKeydown((event) => {\n const isHighestLayer = index === context.layers.size - 1;\n if (!isHighestLayer) return;\n onEscapeKeyDown?.(event);\n if (!event.defaultPrevented && onDismiss) {\n event.preventDefault();\n onDismiss();\n }\n }, ownerDocument);\n React.useEffect(() => {\n if (!node) return;\n if (disableOutsidePointerEvents) {\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;\n ownerDocument.body.style.pointerEvents = \"none\";\n }\n context.layersWithOutsidePointerEventsDisabled.add(node);\n }\n context.layers.add(node);\n dispatchUpdate();\n return () => {\n if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {\n ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;\n }\n };\n }, [node, ownerDocument, disableOutsidePointerEvents, context]);\n React.useEffect(() => {\n return () => {\n if (!node) return;\n context.layers.delete(node);\n context.layersWithOutsidePointerEventsDisabled.delete(node);\n dispatchUpdate();\n };\n }, [node, context]);\n React.useEffect(() => {\n const handleUpdate = () => force({});\n document.addEventListener(CONTEXT_UPDATE, handleUpdate);\n return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);\n }, []);\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n ...layerProps,\n ref: composedRefs,\n style: {\n pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? \"auto\" : \"none\" : void 0,\n ...props.style\n },\n onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),\n onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),\n onPointerDownCapture: composeEventHandlers(\n props.onPointerDownCapture,\n pointerDownOutside.onPointerDownCapture\n )\n }\n );\n }\n);\nDismissableLayer.displayName = DISMISSABLE_LAYER_NAME;\nvar BRANCH_NAME = \"DismissableLayerBranch\";\nvar DismissableLayerBranch = React.forwardRef((props, forwardedRef) => {\n const context = React.useContext(DismissableLayerContext);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n context.branches.add(node);\n return () => {\n context.branches.delete(node);\n };\n }\n }, [context.branches]);\n return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs });\n});\nDismissableLayerBranch.displayName = BRANCH_NAME;\nfunction usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {\n const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);\n const isPointerInsideReactTreeRef = React.useRef(false);\n const handleClickRef = React.useRef(() => {\n });\n React.useEffect(() => {\n const handlePointerDown = (event) => {\n if (event.target && !isPointerInsideReactTreeRef.current) {\n let handleAndDispatchPointerDownOutsideEvent2 = function() {\n handleAndDispatchCustomEvent(\n POINTER_DOWN_OUTSIDE,\n handlePointerDownOutside,\n eventDetail,\n { discrete: true }\n );\n };\n var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;\n const eventDetail = { originalEvent: event };\n if (event.pointerType === \"touch\") {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;\n ownerDocument.addEventListener(\"click\", handleClickRef.current, { once: true });\n } else {\n handleAndDispatchPointerDownOutsideEvent2();\n }\n } else {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n }\n isPointerInsideReactTreeRef.current = false;\n };\n const timerId = window.setTimeout(() => {\n ownerDocument.addEventListener(\"pointerdown\", handlePointerDown);\n }, 0);\n return () => {\n window.clearTimeout(timerId);\n ownerDocument.removeEventListener(\"pointerdown\", handlePointerDown);\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n };\n }, [ownerDocument, handlePointerDownOutside]);\n return {\n // ensures we check React component tree (not just DOM tree)\n onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true\n };\n}\nfunction useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {\n const handleFocusOutside = useCallbackRef(onFocusOutside);\n const isFocusInsideReactTreeRef = React.useRef(false);\n React.useEffect(() => {\n const handleFocus = (event) => {\n if (event.target && !isFocusInsideReactTreeRef.current) {\n const eventDetail = { originalEvent: event };\n handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {\n discrete: false\n });\n }\n };\n ownerDocument.addEventListener(\"focusin\", handleFocus);\n return () => ownerDocument.removeEventListener(\"focusin\", handleFocus);\n }, [ownerDocument, handleFocusOutside]);\n return {\n onFocusCapture: () => isFocusInsideReactTreeRef.current = true,\n onBlurCapture: () => isFocusInsideReactTreeRef.current = false\n };\n}\nfunction dispatchUpdate() {\n const event = new CustomEvent(CONTEXT_UPDATE);\n document.dispatchEvent(event);\n}\nfunction handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {\n const target = detail.originalEvent.target;\n const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });\n if (handler) target.addEventListener(name, handler, { once: true });\n if (discrete) {\n dispatchDiscreteCustomEvent(target, event);\n } else {\n target.dispatchEvent(event);\n }\n}\nvar Root = DismissableLayer;\nvar Branch = DismissableLayerBranch;\nexport {\n Branch,\n DismissableLayer,\n DismissableLayerBranch,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["DISMISSABLE_LAYER_NAME","CONTEXT_UPDATE","POINTER_DOWN_OUTSIDE","FOCUS_OUTSIDE","originalBodyPointerEvents","DismissableLayerContext","React","DismissableLayer","props","forwardedRef","disableOutsidePointerEvents","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","layerProps","context","node","setNode","ownerDocument","force","composedRefs","useComposedRefs","node2","layers","highestLayerWithOutsidePointerEventsDisabled","highestLayerWithOutsidePointerEventsDisabledIndex","index","isBodyPointerEventsDisabled","isPointerEventsEnabled","pointerDownOutside","usePointerDownOutside","event","target","isPointerDownOnBranch","branch","focusOutside","useFocusOutside","useEscapeKeydown","dispatchUpdate","handleUpdate","jsx","Primitive","composeEventHandlers","BRANCH_NAME","DismissableLayerBranch","ref","handlePointerDownOutside","useCallbackRef","isPointerInsideReactTreeRef","handleClickRef","handlePointerDown","handleAndDispatchPointerDownOutsideEvent2","handleAndDispatchCustomEvent","eventDetail","timerId","handleFocusOutside","isFocusInsideReactTreeRef","handleFocus","name","handler","detail","discrete","dispatchDiscreteCustomEvent"],"mappings":"yqBAUA,IAAIA,EAAyB,mBACzBC,EAAiB,0BACjBC,EAAuB,sCACvBC,EAAgB,gCAChBC,EACAC,EAA0BC,EAAM,cAAc,CAChD,OAAwB,IAAI,IAC5B,uCAAwD,IAAI,IAC5D,SAA0B,IAAI,GAChC,CAAC,EACGC,EAAmBD,EAAM,WAC3B,CAACE,EAAOC,IAAiB,CACvB,KAAM,CACJ,4BAAAC,EAA8B,GAC9B,gBAAAC,EACA,qBAAAC,EACA,eAAAC,EACA,kBAAAC,EACA,UAAAC,EACA,GAAGC,CACT,EAAQR,EACES,EAAUX,EAAM,WAAWD,CAAuB,EAClD,CAACa,EAAMC,CAAO,EAAIb,EAAM,SAAS,IAAI,EACrCc,EAAgBF,GAAM,eAAiB,YAAY,SACnD,CAAA,CAAGG,CAAK,EAAIf,EAAM,SAAS,CAAA,CAAE,EAC7BgB,EAAeC,EAAAA,gBAAgBd,EAAee,GAAUL,EAAQK,CAAK,CAAC,EACtEC,EAAS,MAAM,KAAKR,EAAQ,MAAM,EAClC,CAACS,CAA4C,EAAI,CAAC,GAAGT,EAAQ,sCAAsC,EAAE,MAAM,EAAE,EAC7GU,EAAoDF,EA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