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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollToBottomButton.cjs","sources":["../../../src/components/MarkdownFlow/ScrollToBottomButton.tsx"],"sourcesContent":["import React from \"react\";\nimport { createPortal } from \"react-dom\";\nimport {
|
|
1
|
+
{"version":3,"file":"ScrollToBottomButton.cjs","sources":["../../../src/components/MarkdownFlow/ScrollToBottomButton.tsx"],"sourcesContent":["import React, { useCallback, type CSSProperties } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { ChevronsDown } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport type ScrollToBottomPlacement = \"bottom-center\" | \"bottom-right\";\nexport type ScrollToBottomPosition = \"absolute\" | \"fixed\";\n\n/** Presentation and native button props for a localized scroll-to-bottom control. */\nexport interface ScrollToBottomButtonProps\n extends Omit<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n \"aria-label\" | \"children\"\n > {\n /** Whether the control is visible and keyboard-focusable. */\n visible: boolean;\n /** Localized accessible name for the icon-only button. */\n ariaLabel: string;\n /** Optional host element in which the library renders the button. */\n portalTarget?: HTMLElement | null;\n /** Horizontal placement within the positioning context. Defaults to bottom-center. */\n placement?: ScrollToBottomPlacement;\n /** CSS positioning model supplied by the host layout. */\n position?: ScrollToBottomPosition;\n /** Bottom offset in pixels, or any valid CSS length. */\n bottomOffset?: number | string;\n /** Right offset for bottom-right placement, in pixels or a CSS length. */\n horizontalOffset?: number | string;\n /** Stacking level within the host layout. */\n zIndex?: number;\n}\n\ntype ScrollToBottomButtonStyle = CSSProperties & {\n \"--scroll-to-bottom-bottom\"?: string;\n \"--scroll-to-bottom-horizontal\"?: string;\n \"--scroll-to-bottom-position\"?: ScrollToBottomPosition;\n};\n\nconst toCssLength = (value: number | string) =>\n typeof value === \"number\" ? `${value}px` : value;\n\n/**\n * Render the scroll control without owning scroll detection or follow state.\n *\n * @param props Visibility, localized accessible name, host layout and button events.\n * @returns A native icon button, optionally rendered into the supplied portal host.\n * @example\n * ```tsx\n * <ScrollToBottomButton\n * visible={showScrollToBottom}\n * ariaLabel=\"Scroll to bottom\"\n * onClick={scrollToBottom}\n * />\n * ```\n */\nexport const ScrollToBottomButton: React.FC<ScrollToBottomButtonProps> = ({\n visible,\n ariaLabel,\n portalTarget,\n placement = \"bottom-center\",\n position = \"absolute\",\n bottomOffset = 20,\n horizontalOffset = 20,\n zIndex = 1,\n className = \"\",\n style,\n tabIndex,\n disabled,\n type = \"button\",\n ...props\n}) => {\n const releaseHiddenFocus = useCallback(\n (button: HTMLButtonElement | null) => {\n if (!visible && button && button.ownerDocument.activeElement === button) {\n button.blur();\n }\n },\n [visible]\n );\n const buttonStyle: ScrollToBottomButtonStyle = {\n \"--scroll-to-bottom-bottom\": toCssLength(bottomOffset),\n \"--scroll-to-bottom-horizontal\": toCssLength(horizontalOffset),\n \"--scroll-to-bottom-position\": position,\n zIndex,\n ...style,\n };\n const button = (\n <button\n {...props}\n ref={releaseHiddenFocus}\n disabled={!visible || disabled}\n type={type}\n className={cn(\"scroll-to-bottom-btn\", className)}\n style={buttonStyle}\n aria-label={ariaLabel}\n aria-hidden={visible ? undefined : true}\n data-placement={placement}\n data-visible={visible ? \"true\" : \"false\"}\n tabIndex={visible ? tabIndex : -1}\n >\n <ChevronsDown size={20} aria-hidden=\"true\" focusable=\"false\" />\n </button>\n );\n return portalTarget ? createPortal(button, portalTarget) : button;\n};\n\nScrollToBottomButton.displayName = \"ScrollToBottomButton\";\n\nexport default ScrollToBottomButton;\n"],"names":["toCssLength","value","ScrollToBottomButton","visible","ariaLabel","portalTarget","placement","position","bottomOffset","horizontalOffset","zIndex","className","style","tabIndex","disabled","type","props","releaseHiddenFocus","useCallback","button","buttonStyle","jsx","cn","ChevronsDown","createPortal"],"mappings":"0SAsCMA,EAAeC,GACnB,OAAOA,GAAU,SAAW,GAAGA,CAAK,KAAOA,EAgBhCC,EAA4D,CAAC,CACxE,QAAAC,EACA,UAAAC,EACA,aAAAC,EACA,UAAAC,EAAY,gBACZ,SAAAC,EAAW,WACX,aAAAC,EAAe,GACf,iBAAAC,EAAmB,GACnB,OAAAC,EAAS,EACT,UAAAC,EAAY,GACZ,MAAAC,EACA,SAAAC,EACA,SAAAC,EACA,KAAAC,EAAO,SACP,GAAGC,CACL,IAAM,CACJ,MAAMC,EAAqBC,EAAAA,YACxBC,GAAqC,CAChC,CAAChB,GAAWgB,GAAUA,EAAO,cAAc,gBAAkBA,GAC/DA,EAAO,KAAA,CAEX,EACA,CAAChB,CAAO,CAAA,EAEJiB,EAAyC,CAC7C,4BAA6BpB,EAAYQ,CAAY,EACrD,gCAAiCR,EAAYS,CAAgB,EAC7D,8BAA+BF,EAC/B,OAAAG,EACA,GAAGE,CAAA,EAECO,EACJE,EAAAA,IAAC,SAAA,CACE,GAAGL,EACJ,IAAKC,EACL,SAAU,CAACd,GAAWW,EACtB,KAAAC,EACA,UAAWO,EAAAA,GAAG,uBAAwBX,CAAS,EAC/C,MAAOS,EACP,aAAYhB,EACZ,cAAaD,EAAU,OAAY,GACnC,iBAAgBG,EAChB,eAAcH,EAAU,OAAS,QACjC,SAAUA,EAAUU,EAAW,GAE/B,eAACU,EAAAA,QAAA,CAAa,KAAM,GAAI,cAAY,OAAO,UAAU,OAAA,CAAQ,CAAA,CAAA,EAGjE,OAAOlB,EAAemB,EAAAA,aAAaL,EAAQd,CAAY,EAAIc,CAC7D,EAEAjB,EAAqB,YAAc"}
|
|
@@ -1,8 +1,38 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export type ScrollToBottomPlacement = "bottom-center" | "bottom-right";
|
|
3
|
+
export type ScrollToBottomPosition = "absolute" | "fixed";
|
|
4
|
+
/** Presentation and native button props for a localized scroll-to-bottom control. */
|
|
5
|
+
export interface ScrollToBottomButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "aria-label" | "children"> {
|
|
6
|
+
/** Whether the control is visible and keyboard-focusable. */
|
|
3
7
|
visible: boolean;
|
|
8
|
+
/** Localized accessible name for the icon-only button. */
|
|
4
9
|
ariaLabel: string;
|
|
10
|
+
/** Optional host element in which the library renders the button. */
|
|
5
11
|
portalTarget?: HTMLElement | null;
|
|
12
|
+
/** Horizontal placement within the positioning context. Defaults to bottom-center. */
|
|
13
|
+
placement?: ScrollToBottomPlacement;
|
|
14
|
+
/** CSS positioning model supplied by the host layout. */
|
|
15
|
+
position?: ScrollToBottomPosition;
|
|
16
|
+
/** Bottom offset in pixels, or any valid CSS length. */
|
|
17
|
+
bottomOffset?: number | string;
|
|
18
|
+
/** Right offset for bottom-right placement, in pixels or a CSS length. */
|
|
19
|
+
horizontalOffset?: number | string;
|
|
20
|
+
/** Stacking level within the host layout. */
|
|
21
|
+
zIndex?: number;
|
|
6
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Render the scroll control without owning scroll detection or follow state.
|
|
25
|
+
*
|
|
26
|
+
* @param props Visibility, localized accessible name, host layout and button events.
|
|
27
|
+
* @returns A native icon button, optionally rendered into the supplied portal host.
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <ScrollToBottomButton
|
|
31
|
+
* visible={showScrollToBottom}
|
|
32
|
+
* ariaLabel="Scroll to bottom"
|
|
33
|
+
* onClick={scrollToBottom}
|
|
34
|
+
* />
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
7
37
|
export declare const ScrollToBottomButton: React.FC<ScrollToBottomButtonProps>;
|
|
8
38
|
export default ScrollToBottomButton;
|
|
@@ -1,28 +1,57 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as C } from "react";
|
|
3
|
+
import { createPortal as S } from "react-dom";
|
|
4
|
+
import { cn as w } from "../../lib/utils.es.js";
|
|
5
|
+
import z from "../../node_modules/lucide-react/dist/esm/icons/chevrons-down.es.js";
|
|
6
|
+
const n = (o) => typeof o == "number" ? `${o}px` : o, D = ({
|
|
7
|
+
visible: o,
|
|
6
8
|
ariaLabel: l,
|
|
7
|
-
portalTarget:
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
portalTarget: e,
|
|
10
|
+
placement: m = "bottom-center",
|
|
11
|
+
position: s = "absolute",
|
|
12
|
+
bottomOffset: c = 20,
|
|
13
|
+
horizontalOffset: d = 20,
|
|
14
|
+
zIndex: i = 1,
|
|
15
|
+
className: u = "",
|
|
16
|
+
style: b,
|
|
17
|
+
tabIndex: f,
|
|
18
|
+
disabled: p,
|
|
19
|
+
type: h = "button",
|
|
20
|
+
...x
|
|
10
21
|
}) => {
|
|
11
|
-
|
|
12
|
-
|
|
22
|
+
const y = C(
|
|
23
|
+
(t) => {
|
|
24
|
+
!o && t && t.ownerDocument.activeElement === t && t.blur();
|
|
25
|
+
},
|
|
26
|
+
[o]
|
|
27
|
+
), B = {
|
|
28
|
+
"--scroll-to-bottom-bottom": n(c),
|
|
29
|
+
"--scroll-to-bottom-horizontal": n(d),
|
|
30
|
+
"--scroll-to-bottom-position": s,
|
|
31
|
+
zIndex: i,
|
|
32
|
+
...b
|
|
33
|
+
}, r = /* @__PURE__ */ a(
|
|
13
34
|
"button",
|
|
14
35
|
{
|
|
15
|
-
...
|
|
16
|
-
|
|
17
|
-
|
|
36
|
+
...x,
|
|
37
|
+
ref: y,
|
|
38
|
+
disabled: !o || p,
|
|
39
|
+
type: h,
|
|
40
|
+
className: w("scroll-to-bottom-btn", u),
|
|
41
|
+
style: B,
|
|
18
42
|
"aria-label": l,
|
|
19
|
-
|
|
43
|
+
"aria-hidden": o ? void 0 : !0,
|
|
44
|
+
"data-placement": m,
|
|
45
|
+
"data-visible": o ? "true" : "false",
|
|
46
|
+
tabIndex: o ? f : -1,
|
|
47
|
+
children: /* @__PURE__ */ a(z, { size: 20, "aria-hidden": "true", focusable: "false" })
|
|
20
48
|
}
|
|
21
49
|
);
|
|
22
|
-
return
|
|
50
|
+
return e ? S(r, e) : r;
|
|
23
51
|
};
|
|
52
|
+
D.displayName = "ScrollToBottomButton";
|
|
24
53
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
54
|
+
D as ScrollToBottomButton,
|
|
55
|
+
D as default
|
|
27
56
|
};
|
|
28
57
|
//# sourceMappingURL=ScrollToBottomButton.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollToBottomButton.es.js","sources":["../../../src/components/MarkdownFlow/ScrollToBottomButton.tsx"],"sourcesContent":["import React from \"react\";\nimport { createPortal } from \"react-dom\";\nimport {
|
|
1
|
+
{"version":3,"file":"ScrollToBottomButton.es.js","sources":["../../../src/components/MarkdownFlow/ScrollToBottomButton.tsx"],"sourcesContent":["import React, { useCallback, type CSSProperties } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { ChevronsDown } from \"lucide-react\";\nimport { cn } from \"../../lib/utils\";\n\nexport type ScrollToBottomPlacement = \"bottom-center\" | \"bottom-right\";\nexport type ScrollToBottomPosition = \"absolute\" | \"fixed\";\n\n/** Presentation and native button props for a localized scroll-to-bottom control. */\nexport interface ScrollToBottomButtonProps\n extends Omit<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n \"aria-label\" | \"children\"\n > {\n /** Whether the control is visible and keyboard-focusable. */\n visible: boolean;\n /** Localized accessible name for the icon-only button. */\n ariaLabel: string;\n /** Optional host element in which the library renders the button. */\n portalTarget?: HTMLElement | null;\n /** Horizontal placement within the positioning context. Defaults to bottom-center. */\n placement?: ScrollToBottomPlacement;\n /** CSS positioning model supplied by the host layout. */\n position?: ScrollToBottomPosition;\n /** Bottom offset in pixels, or any valid CSS length. */\n bottomOffset?: number | string;\n /** Right offset for bottom-right placement, in pixels or a CSS length. */\n horizontalOffset?: number | string;\n /** Stacking level within the host layout. */\n zIndex?: number;\n}\n\ntype ScrollToBottomButtonStyle = CSSProperties & {\n \"--scroll-to-bottom-bottom\"?: string;\n \"--scroll-to-bottom-horizontal\"?: string;\n \"--scroll-to-bottom-position\"?: ScrollToBottomPosition;\n};\n\nconst toCssLength = (value: number | string) =>\n typeof value === \"number\" ? `${value}px` : value;\n\n/**\n * Render the scroll control without owning scroll detection or follow state.\n *\n * @param props Visibility, localized accessible name, host layout and button events.\n * @returns A native icon button, optionally rendered into the supplied portal host.\n * @example\n * ```tsx\n * <ScrollToBottomButton\n * visible={showScrollToBottom}\n * ariaLabel=\"Scroll to bottom\"\n * onClick={scrollToBottom}\n * />\n * ```\n */\nexport const ScrollToBottomButton: React.FC<ScrollToBottomButtonProps> = ({\n visible,\n ariaLabel,\n portalTarget,\n placement = \"bottom-center\",\n position = \"absolute\",\n bottomOffset = 20,\n horizontalOffset = 20,\n zIndex = 1,\n className = \"\",\n style,\n tabIndex,\n disabled,\n type = \"button\",\n ...props\n}) => {\n const releaseHiddenFocus = useCallback(\n (button: HTMLButtonElement | null) => {\n if (!visible && button && button.ownerDocument.activeElement === button) {\n button.blur();\n }\n },\n [visible]\n );\n const buttonStyle: ScrollToBottomButtonStyle = {\n \"--scroll-to-bottom-bottom\": toCssLength(bottomOffset),\n \"--scroll-to-bottom-horizontal\": toCssLength(horizontalOffset),\n \"--scroll-to-bottom-position\": position,\n zIndex,\n ...style,\n };\n const button = (\n <button\n {...props}\n ref={releaseHiddenFocus}\n disabled={!visible || disabled}\n type={type}\n className={cn(\"scroll-to-bottom-btn\", className)}\n style={buttonStyle}\n aria-label={ariaLabel}\n aria-hidden={visible ? undefined : true}\n data-placement={placement}\n data-visible={visible ? \"true\" : \"false\"}\n tabIndex={visible ? tabIndex : -1}\n >\n <ChevronsDown size={20} aria-hidden=\"true\" focusable=\"false\" />\n </button>\n );\n return portalTarget ? createPortal(button, portalTarget) : button;\n};\n\nScrollToBottomButton.displayName = \"ScrollToBottomButton\";\n\nexport default ScrollToBottomButton;\n"],"names":["toCssLength","value","ScrollToBottomButton","visible","ariaLabel","portalTarget","placement","position","bottomOffset","horizontalOffset","zIndex","className","style","tabIndex","disabled","type","props","releaseHiddenFocus","useCallback","button","buttonStyle","jsx","cn","ChevronsDown","createPortal"],"mappings":";;;;;AAsCA,MAAMA,IAAc,CAACC,MACnB,OAAOA,KAAU,WAAW,GAAGA,CAAK,OAAOA,GAgBhCC,IAA4D,CAAC;AAAA,EACxE,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,UAAAC,IAAW;AAAA,EACX,cAAAC,IAAe;AAAA,EACf,kBAAAC,IAAmB;AAAA,EACnB,QAAAC,IAAS;AAAA,EACT,WAAAC,IAAY;AAAA,EACZ,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAqBC;AAAA,IACzB,CAACC,MAAqC;AACpC,MAAI,CAAChB,KAAWgB,KAAUA,EAAO,cAAc,kBAAkBA,KAC/DA,EAAO,KAAA;AAAA,IAEX;AAAA,IACA,CAAChB,CAAO;AAAA,EAAA,GAEJiB,IAAyC;AAAA,IAC7C,6BAA6BpB,EAAYQ,CAAY;AAAA,IACrD,iCAAiCR,EAAYS,CAAgB;AAAA,IAC7D,+BAA+BF;AAAA,IAC/B,QAAAG;AAAA,IACA,GAAGE;AAAA,EAAA,GAECO,IACJ,gBAAAE;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGL;AAAA,MACJ,KAAKC;AAAA,MACL,UAAU,CAACd,KAAWW;AAAA,MACtB,MAAAC;AAAA,MACA,WAAWO,EAAG,wBAAwBX,CAAS;AAAA,MAC/C,OAAOS;AAAA,MACP,cAAYhB;AAAA,MACZ,eAAaD,IAAU,SAAY;AAAA,MACnC,kBAAgBG;AAAA,MAChB,gBAAcH,IAAU,SAAS;AAAA,MACjC,UAAUA,IAAUU,IAAW;AAAA,MAE/B,4BAACU,GAAA,EAAa,MAAM,IAAI,eAAY,QAAO,WAAU,QAAA,CAAQ;AAAA,IAAA;AAAA,EAAA;AAGjE,SAAOlB,IAAemB,EAAaL,GAAQd,CAAY,IAAIc;AAC7D;AAEAjB,EAAqB,cAAc;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("react/jsx-runtime"),b=require("./ScrollToBottomButton.cjs"),j=require("./useScrollToBottom.cjs"),o=({viewportRef:t,contentRef:l,endRef:e,scrollTarget:r,pageScrollFallback:c,scrollThreshold:s,contentVersion:u,followNewContent:n,autoScrollOnInit:i,behavior:m,onScrollToBottom:B,...S})=>{const{showScrollToBottom:T,scrollToBottom:a}=j.useScrollToBottom(t,{contentRef:l,endRef:e,scrollTarget:r,pageScrollFallback:c,scrollThreshold:s,contentVersion:u,followNewContent:n,autoScrollOnInit:i,behavior:m});return d.jsx(b.ScrollToBottomButton,{...S,visible:T,onClick:()=>{a(),B?.()}})};exports.ScrollToBottomControl=o;exports.default=o;
|
|
2
|
+
//# sourceMappingURL=ScrollToBottomControl.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollToBottomControl.cjs","sources":["../../../src/components/MarkdownFlow/ScrollToBottomControl.tsx"],"sourcesContent":["import React, { type RefObject } from \"react\";\nimport ScrollToBottomButton, {\n type ScrollToBottomButtonProps,\n} from \"./ScrollToBottomButton\";\nimport useScrollToBottom, {\n type UseScrollToBottomOptions,\n} from \"./useScrollToBottom\";\n\nexport interface ScrollToBottomControlProps\n extends UseScrollToBottomOptions,\n Omit<ScrollToBottomButtonProps, \"onClick\" | \"visible\"> {\n /** Existing host viewport; no wrapper or content ownership is required. */\n viewportRef: RefObject<HTMLElement | null>;\n /** Optional notification after the control requests a scroll to the end. */\n onScrollToBottom?: () => void;\n}\n\n/**\n * Complete scroll-to-bottom control for streaming or asynchronously growing content.\n *\n * The control owns target resolution, follow state, visibility, click behavior,\n * the accessible icon button, and optional portal rendering. Consumers only\n * provide host refs, localized text, and layout inputs.\n */\nexport const ScrollToBottomControl: React.FC<ScrollToBottomControlProps> = ({\n viewportRef,\n contentRef,\n endRef,\n scrollTarget,\n pageScrollFallback,\n scrollThreshold,\n contentVersion,\n followNewContent,\n autoScrollOnInit,\n behavior,\n onScrollToBottom,\n ...buttonProps\n}) => {\n const { showScrollToBottom, scrollToBottom } = useScrollToBottom(\n viewportRef,\n {\n contentRef,\n endRef,\n scrollTarget,\n pageScrollFallback,\n scrollThreshold,\n contentVersion,\n followNewContent,\n autoScrollOnInit,\n behavior,\n }\n );\n\n return (\n <ScrollToBottomButton\n {...buttonProps}\n visible={showScrollToBottom}\n onClick={() => {\n scrollToBottom();\n onScrollToBottom?.();\n }}\n />\n );\n};\n\nexport default ScrollToBottomControl;\n"],"names":["ScrollToBottomControl","viewportRef","contentRef","endRef","scrollTarget","pageScrollFallback","scrollThreshold","contentVersion","followNewContent","autoScrollOnInit","behavior","onScrollToBottom","buttonProps","showScrollToBottom","scrollToBottom","useScrollToBottom","jsx","ScrollToBottomButton"],"mappings":"8NAwBaA,EAA8D,CAAC,CAC1E,YAAAC,EACA,WAAAC,EACA,OAAAC,EACA,aAAAC,EACA,mBAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,iBAAAC,EACA,iBAAAC,EACA,SAAAC,EACA,iBAAAC,EACA,GAAGC,CACL,IAAM,CACJ,KAAM,CAAE,mBAAAC,EAAoB,eAAAC,CAAA,EAAmBC,EAAAA,kBAC7Cd,EACA,CACE,WAAAC,EACA,OAAAC,EACA,aAAAC,EACA,mBAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,iBAAAC,EACA,iBAAAC,EACA,SAAAC,CAAA,CACF,EAGF,OACEM,EAAAA,IAACC,EAAAA,qBAAA,CACE,GAAGL,EACJ,QAASC,EACT,QAAS,IAAM,CACbC,EAAA,EACAH,IAAA,CACF,CAAA,CAAA,CAGN"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React, RefObject } from 'react';
|
|
2
|
+
import { ScrollToBottomButtonProps } from './ScrollToBottomButton.js';
|
|
3
|
+
import { UseScrollToBottomOptions } from './useScrollToBottom.js';
|
|
4
|
+
export interface ScrollToBottomControlProps extends UseScrollToBottomOptions, Omit<ScrollToBottomButtonProps, "onClick" | "visible"> {
|
|
5
|
+
/** Existing host viewport; no wrapper or content ownership is required. */
|
|
6
|
+
viewportRef: RefObject<HTMLElement | null>;
|
|
7
|
+
/** Optional notification after the control requests a scroll to the end. */
|
|
8
|
+
onScrollToBottom?: () => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Complete scroll-to-bottom control for streaming or asynchronously growing content.
|
|
12
|
+
*
|
|
13
|
+
* The control owns target resolution, follow state, visibility, click behavior,
|
|
14
|
+
* the accessible icon button, and optional portal rendering. Consumers only
|
|
15
|
+
* provide host refs, localized text, and layout inputs.
|
|
16
|
+
*/
|
|
17
|
+
export declare const ScrollToBottomControl: React.FC<ScrollToBottomControlProps>;
|
|
18
|
+
export default ScrollToBottomControl;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { ScrollToBottomButton as S } from "./ScrollToBottomButton.es.js";
|
|
3
|
+
import { useScrollToBottom as a } from "./useScrollToBottom.es.js";
|
|
4
|
+
const d = ({
|
|
5
|
+
viewportRef: o,
|
|
6
|
+
contentRef: t,
|
|
7
|
+
endRef: r,
|
|
8
|
+
scrollTarget: l,
|
|
9
|
+
pageScrollFallback: m,
|
|
10
|
+
scrollThreshold: c,
|
|
11
|
+
contentVersion: s,
|
|
12
|
+
followNewContent: i,
|
|
13
|
+
autoScrollOnInit: n,
|
|
14
|
+
behavior: B,
|
|
15
|
+
onScrollToBottom: e,
|
|
16
|
+
...T
|
|
17
|
+
}) => {
|
|
18
|
+
const { showScrollToBottom: f, scrollToBottom: p } = a(
|
|
19
|
+
o,
|
|
20
|
+
{
|
|
21
|
+
contentRef: t,
|
|
22
|
+
endRef: r,
|
|
23
|
+
scrollTarget: l,
|
|
24
|
+
pageScrollFallback: m,
|
|
25
|
+
scrollThreshold: c,
|
|
26
|
+
contentVersion: s,
|
|
27
|
+
followNewContent: i,
|
|
28
|
+
autoScrollOnInit: n,
|
|
29
|
+
behavior: B
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
return /* @__PURE__ */ u(
|
|
33
|
+
S,
|
|
34
|
+
{
|
|
35
|
+
...T,
|
|
36
|
+
visible: f,
|
|
37
|
+
onClick: () => {
|
|
38
|
+
p(), e?.();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
d as ScrollToBottomControl,
|
|
45
|
+
d as default
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=ScrollToBottomControl.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollToBottomControl.es.js","sources":["../../../src/components/MarkdownFlow/ScrollToBottomControl.tsx"],"sourcesContent":["import React, { type RefObject } from \"react\";\nimport ScrollToBottomButton, {\n type ScrollToBottomButtonProps,\n} from \"./ScrollToBottomButton\";\nimport useScrollToBottom, {\n type UseScrollToBottomOptions,\n} from \"./useScrollToBottom\";\n\nexport interface ScrollToBottomControlProps\n extends UseScrollToBottomOptions,\n Omit<ScrollToBottomButtonProps, \"onClick\" | \"visible\"> {\n /** Existing host viewport; no wrapper or content ownership is required. */\n viewportRef: RefObject<HTMLElement | null>;\n /** Optional notification after the control requests a scroll to the end. */\n onScrollToBottom?: () => void;\n}\n\n/**\n * Complete scroll-to-bottom control for streaming or asynchronously growing content.\n *\n * The control owns target resolution, follow state, visibility, click behavior,\n * the accessible icon button, and optional portal rendering. Consumers only\n * provide host refs, localized text, and layout inputs.\n */\nexport const ScrollToBottomControl: React.FC<ScrollToBottomControlProps> = ({\n viewportRef,\n contentRef,\n endRef,\n scrollTarget,\n pageScrollFallback,\n scrollThreshold,\n contentVersion,\n followNewContent,\n autoScrollOnInit,\n behavior,\n onScrollToBottom,\n ...buttonProps\n}) => {\n const { showScrollToBottom, scrollToBottom } = useScrollToBottom(\n viewportRef,\n {\n contentRef,\n endRef,\n scrollTarget,\n pageScrollFallback,\n scrollThreshold,\n contentVersion,\n followNewContent,\n autoScrollOnInit,\n behavior,\n }\n );\n\n return (\n <ScrollToBottomButton\n {...buttonProps}\n visible={showScrollToBottom}\n onClick={() => {\n scrollToBottom();\n onScrollToBottom?.();\n }}\n />\n );\n};\n\nexport default ScrollToBottomControl;\n"],"names":["ScrollToBottomControl","viewportRef","contentRef","endRef","scrollTarget","pageScrollFallback","scrollThreshold","contentVersion","followNewContent","autoScrollOnInit","behavior","onScrollToBottom","buttonProps","showScrollToBottom","scrollToBottom","useScrollToBottom","jsx","ScrollToBottomButton"],"mappings":";;;AAwBO,MAAMA,IAA8D,CAAC;AAAA,EAC1E,aAAAC;AAAA,EACA,YAAAC;AAAA,EACA,QAAAC;AAAA,EACA,cAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAM,EAAE,oBAAAC,GAAoB,gBAAAC,EAAA,IAAmBC;AAAA,IAC7Cd;AAAA,IACA;AAAA,MACE,YAAAC;AAAA,MACA,QAAAC;AAAA,MACA,cAAAC;AAAA,MACA,oBAAAC;AAAA,MACA,iBAAAC;AAAA,MACA,gBAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,UAAAC;AAAA,IAAA;AAAA,EACF;AAGF,SACE,gBAAAM;AAAA,IAACC;AAAA,IAAA;AAAA,MACE,GAAGL;AAAA,MACJ,SAASC;AAAA,MACT,SAAS,MAAM;AACb,QAAAC,EAAA,GACAH,IAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),n=require("react"),g=require("./MarkdownFlow.cjs"),m=require("./ScrollToBottomControl.cjs"),f=require("../ContentRender/contentRenderI18n.cjs"),s=require("../../lib/locale.cjs");;/* empty css */const T=a=>{const{height:i="100%",className:c="",scrollToBottomAriaLabel:u,...e}=a,t=n.useRef(null),l=n.useRef(null),r=e.initialContentList??[],d=f.getContentRenderLocaleTexts(e.locale),w=u||d.scrollToBottomLabel;return o.jsxs("div",{className:`scrollable-markdown-container ${c}`.trim(),dir:e.dir??s.getMarkdownFlowDirection(e.locale),lang:e.lang??s.getMarkdownFlowLanguage(e.locale),style:{height:i,position:"relative"},children:[o.jsx("div",{ref:t,style:{height:"100%",overflowY:"auto"},children:o.jsx("div",{ref:l,children:o.jsx(g.default,{...e,initialContentList:r})})}),o.jsx(m.ScrollToBottomControl,{viewportRef:t,contentRef:l,scrollTarget:t,contentVersion:r,autoScrollOnInit:!0,scrollThreshold:150,ariaLabel:w})]})};exports.default=T;
|
|
2
2
|
//# sourceMappingURL=ScrollableMarkdownFlow.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollableMarkdownFlow.cjs","sources":["../../../src/components/MarkdownFlow/ScrollableMarkdownFlow.tsx"],"sourcesContent":["import React, { useRef } from \"react\";\nimport MarkdownFlow
|
|
1
|
+
{"version":3,"file":"ScrollableMarkdownFlow.cjs","sources":["../../../src/components/MarkdownFlow/ScrollableMarkdownFlow.tsx"],"sourcesContent":["import React, { useRef } from \"react\";\nimport MarkdownFlow, { type MarkdownFlowProps } from \"./MarkdownFlow\";\nimport ScrollToBottomControl from \"./ScrollToBottomControl\";\nimport { getContentRenderLocaleTexts } from \"../ContentRender/contentRenderI18n\";\nimport {\n getMarkdownFlowDirection,\n getMarkdownFlowLanguage,\n} from \"../../lib/locale\";\n\nimport \"./markdownFlow.css\";\n\nexport interface ScrollableMarkdownFlowProps extends MarkdownFlowProps {\n height?: string | number;\n className?: string;\n scrollToBottomAriaLabel?: string;\n}\n\nconst ScrollableMarkdownFlow: React.FC<ScrollableMarkdownFlowProps> = (\n props\n) => {\n const {\n height = \"100%\",\n className = \"\",\n scrollToBottomAriaLabel,\n ...markdownFlowProps\n } = props;\n const viewportRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const initialContentList = markdownFlowProps.initialContentList ?? [];\n const localeTexts = getContentRenderLocaleTexts(markdownFlowProps.locale);\n const resolvedScrollToBottomAriaLabel =\n scrollToBottomAriaLabel || localeTexts.scrollToBottomLabel;\n\n return (\n <div\n className={`scrollable-markdown-container ${className}`.trim()}\n dir={\n markdownFlowProps.dir ??\n getMarkdownFlowDirection(markdownFlowProps.locale)\n }\n lang={\n markdownFlowProps.lang ??\n getMarkdownFlowLanguage(markdownFlowProps.locale)\n }\n style={{ height, position: \"relative\" }}\n >\n <div ref={viewportRef} style={{ height: \"100%\", overflowY: \"auto\" }}>\n <div ref={contentRef}>\n <MarkdownFlow\n {...markdownFlowProps}\n initialContentList={initialContentList}\n />\n </div>\n </div>\n <ScrollToBottomControl\n viewportRef={viewportRef}\n contentRef={contentRef}\n scrollTarget={viewportRef}\n contentVersion={initialContentList}\n autoScrollOnInit\n scrollThreshold={150}\n ariaLabel={resolvedScrollToBottomAriaLabel}\n />\n </div>\n );\n};\n\nexport default ScrollableMarkdownFlow;\n"],"names":["ScrollableMarkdownFlow","props","height","className","scrollToBottomAriaLabel","markdownFlowProps","viewportRef","useRef","contentRef","initialContentList","localeTexts","getContentRenderLocaleTexts","resolvedScrollToBottomAriaLabel","jsxs","getMarkdownFlowDirection","getMarkdownFlowLanguage","jsx","MarkdownFlow","ScrollToBottomControl"],"mappings":"qWAiBA,MAAMA,EACJC,GACG,CACH,KAAM,CACJ,OAAAC,EAAS,OACT,UAAAC,EAAY,GACZ,wBAAAC,EACA,GAAGC,CAAA,EACDJ,EACEK,EAAcC,EAAAA,OAAuB,IAAI,EACzCC,EAAaD,EAAAA,OAAuB,IAAI,EACxCE,EAAqBJ,EAAkB,oBAAsB,CAAA,EAC7DK,EAAcC,EAAAA,4BAA4BN,EAAkB,MAAM,EAClEO,EACJR,GAA2BM,EAAY,oBAEzC,OACEG,EAAAA,KAAC,MAAA,CACC,UAAW,iCAAiCV,CAAS,GAAG,KAAA,EACxD,IACEE,EAAkB,KAClBS,EAAAA,yBAAyBT,EAAkB,MAAM,EAEnD,KACEA,EAAkB,MAClBU,EAAAA,wBAAwBV,EAAkB,MAAM,EAElD,MAAO,CAAE,OAAAH,EAAQ,SAAU,UAAA,EAE3B,SAAA,CAAAc,EAAAA,IAAC,MAAA,CAAI,IAAKV,EAAa,MAAO,CAAE,OAAQ,OAAQ,UAAW,MAAA,EACzD,SAAAU,MAAC,MAAA,CAAI,IAAKR,EACR,SAAAQ,EAAAA,IAACC,EAAAA,QAAA,CACE,GAAGZ,EACJ,mBAAAI,CAAA,CAAA,EAEJ,CAAA,CACF,EACAO,EAAAA,IAACE,EAAAA,sBAAA,CACC,YAAAZ,EACA,WAAAE,EACA,aAAcF,EACd,eAAgBG,EAChB,iBAAgB,GAChB,gBAAiB,IACjB,UAAWG,CAAA,CAAA,CACb,CAAA,CAAA,CAGN"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { MarkdownFlowProps } from './MarkdownFlow';
|
|
2
|
+
import { MarkdownFlowProps } from './MarkdownFlow.js';
|
|
3
3
|
export interface ScrollableMarkdownFlowProps extends MarkdownFlowProps {
|
|
4
4
|
height?: string | number;
|
|
5
5
|
className?: string;
|
|
@@ -1,61 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useRef as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { jsxs as f, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as n } from "react";
|
|
3
|
+
import w from "./MarkdownFlow.es.js";
|
|
4
|
+
import { ScrollToBottomControl as p } from "./ScrollToBottomControl.es.js";
|
|
5
|
+
import { getContentRenderLocaleTexts as g } from "../ContentRender/contentRenderI18n.es.js";
|
|
6
|
+
import { getMarkdownFlowLanguage as h, getMarkdownFlowDirection as u } from "../../lib/locale.es.js";
|
|
7
7
|
/* empty css */
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
copyButtonText: d,
|
|
17
|
-
copiedButtonText: f,
|
|
18
|
-
beforeSend: u,
|
|
19
|
-
interactionDefaultValueOptions: p,
|
|
20
|
-
scrollToBottomAriaLabel: x,
|
|
21
|
-
...l
|
|
22
|
-
}) => {
|
|
23
|
-
const e = B(null), T = S(r), h = x || T.scrollToBottomLabel, { showScrollToBottom: s, scrollToBottom: w } = j(
|
|
24
|
-
e,
|
|
25
|
-
{
|
|
26
|
-
contentVersion: t,
|
|
27
|
-
autoScrollOnInit: !0,
|
|
28
|
-
scrollThreshold: 150
|
|
29
|
-
}
|
|
30
|
-
);
|
|
31
|
-
return /* @__PURE__ */ o.jsxs(
|
|
8
|
+
const B = (a) => {
|
|
9
|
+
const {
|
|
10
|
+
height: i = "100%",
|
|
11
|
+
className: s = "",
|
|
12
|
+
scrollToBottomAriaLabel: c,
|
|
13
|
+
...o
|
|
14
|
+
} = a, l = n(null), r = n(null), e = o.initialContentList ?? [], m = g(o.locale), d = c || m.scrollToBottomLabel;
|
|
15
|
+
return /* @__PURE__ */ f(
|
|
32
16
|
"div",
|
|
33
17
|
{
|
|
34
|
-
className: `scrollable-markdown-container ${
|
|
35
|
-
|
|
36
|
-
|
|
18
|
+
className: `scrollable-markdown-container ${s}`.trim(),
|
|
19
|
+
dir: o.dir ?? u(o.locale),
|
|
20
|
+
lang: o.lang ?? h(o.locale),
|
|
21
|
+
style: { height: i, position: "relative" },
|
|
37
22
|
children: [
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
|
|
23
|
+
/* @__PURE__ */ t("div", { ref: l, style: { height: "100%", overflowY: "auto" }, children: /* @__PURE__ */ t("div", { ref: r, children: /* @__PURE__ */ t(
|
|
24
|
+
w,
|
|
40
25
|
{
|
|
41
|
-
...
|
|
42
|
-
initialContentList:
|
|
43
|
-
customRenderBar: n,
|
|
44
|
-
onSend: c,
|
|
45
|
-
locale: r,
|
|
46
|
-
confirmButtonText: i,
|
|
47
|
-
copyButtonText: d,
|
|
48
|
-
copiedButtonText: f,
|
|
49
|
-
beforeSend: u,
|
|
50
|
-
interactionDefaultValueOptions: p
|
|
26
|
+
...o,
|
|
27
|
+
initialContentList: e
|
|
51
28
|
}
|
|
52
|
-
) }),
|
|
53
|
-
|
|
54
|
-
|
|
29
|
+
) }) }),
|
|
30
|
+
/* @__PURE__ */ t(
|
|
31
|
+
p,
|
|
55
32
|
{
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
33
|
+
viewportRef: l,
|
|
34
|
+
contentRef: r,
|
|
35
|
+
scrollTarget: l,
|
|
36
|
+
contentVersion: e,
|
|
37
|
+
autoScrollOnInit: !0,
|
|
38
|
+
scrollThreshold: 150,
|
|
39
|
+
ariaLabel: d
|
|
59
40
|
}
|
|
60
41
|
)
|
|
61
42
|
]
|
|
@@ -63,6 +44,6 @@ const A = ({
|
|
|
63
44
|
);
|
|
64
45
|
};
|
|
65
46
|
export {
|
|
66
|
-
|
|
47
|
+
B as default
|
|
67
48
|
};
|
|
68
49
|
//# sourceMappingURL=ScrollableMarkdownFlow.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollableMarkdownFlow.es.js","sources":["../../../src/components/MarkdownFlow/ScrollableMarkdownFlow.tsx"],"sourcesContent":["import React, { useRef } from \"react\";\nimport MarkdownFlow
|
|
1
|
+
{"version":3,"file":"ScrollableMarkdownFlow.es.js","sources":["../../../src/components/MarkdownFlow/ScrollableMarkdownFlow.tsx"],"sourcesContent":["import React, { useRef } from \"react\";\nimport MarkdownFlow, { type MarkdownFlowProps } from \"./MarkdownFlow\";\nimport ScrollToBottomControl from \"./ScrollToBottomControl\";\nimport { getContentRenderLocaleTexts } from \"../ContentRender/contentRenderI18n\";\nimport {\n getMarkdownFlowDirection,\n getMarkdownFlowLanguage,\n} from \"../../lib/locale\";\n\nimport \"./markdownFlow.css\";\n\nexport interface ScrollableMarkdownFlowProps extends MarkdownFlowProps {\n height?: string | number;\n className?: string;\n scrollToBottomAriaLabel?: string;\n}\n\nconst ScrollableMarkdownFlow: React.FC<ScrollableMarkdownFlowProps> = (\n props\n) => {\n const {\n height = \"100%\",\n className = \"\",\n scrollToBottomAriaLabel,\n ...markdownFlowProps\n } = props;\n const viewportRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const initialContentList = markdownFlowProps.initialContentList ?? [];\n const localeTexts = getContentRenderLocaleTexts(markdownFlowProps.locale);\n const resolvedScrollToBottomAriaLabel =\n scrollToBottomAriaLabel || localeTexts.scrollToBottomLabel;\n\n return (\n <div\n className={`scrollable-markdown-container ${className}`.trim()}\n dir={\n markdownFlowProps.dir ??\n getMarkdownFlowDirection(markdownFlowProps.locale)\n }\n lang={\n markdownFlowProps.lang ??\n getMarkdownFlowLanguage(markdownFlowProps.locale)\n }\n style={{ height, position: \"relative\" }}\n >\n <div ref={viewportRef} style={{ height: \"100%\", overflowY: \"auto\" }}>\n <div ref={contentRef}>\n <MarkdownFlow\n {...markdownFlowProps}\n initialContentList={initialContentList}\n />\n </div>\n </div>\n <ScrollToBottomControl\n viewportRef={viewportRef}\n contentRef={contentRef}\n scrollTarget={viewportRef}\n contentVersion={initialContentList}\n autoScrollOnInit\n scrollThreshold={150}\n ariaLabel={resolvedScrollToBottomAriaLabel}\n />\n </div>\n );\n};\n\nexport default ScrollableMarkdownFlow;\n"],"names":["ScrollableMarkdownFlow","props","height","className","scrollToBottomAriaLabel","markdownFlowProps","viewportRef","useRef","contentRef","initialContentList","localeTexts","getContentRenderLocaleTexts","resolvedScrollToBottomAriaLabel","jsxs","getMarkdownFlowDirection","getMarkdownFlowLanguage","jsx","MarkdownFlow","ScrollToBottomControl"],"mappings":";;;;;;;AAiBA,MAAMA,IAAgE,CACpEC,MACG;AACH,QAAM;AAAA,IACJ,QAAAC,IAAS;AAAA,IACT,WAAAC,IAAY;AAAA,IACZ,yBAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDJ,GACEK,IAAcC,EAAuB,IAAI,GACzCC,IAAaD,EAAuB,IAAI,GACxCE,IAAqBJ,EAAkB,sBAAsB,CAAA,GAC7DK,IAAcC,EAA4BN,EAAkB,MAAM,GAClEO,IACJR,KAA2BM,EAAY;AAEzC,SACE,gBAAAG;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,iCAAiCV,CAAS,GAAG,KAAA;AAAA,MACxD,KACEE,EAAkB,OAClBS,EAAyBT,EAAkB,MAAM;AAAA,MAEnD,MACEA,EAAkB,QAClBU,EAAwBV,EAAkB,MAAM;AAAA,MAElD,OAAO,EAAE,QAAAH,GAAQ,UAAU,WAAA;AAAA,MAE3B,UAAA;AAAA,QAAA,gBAAAc,EAAC,OAAA,EAAI,KAAKV,GAAa,OAAO,EAAE,QAAQ,QAAQ,WAAW,OAAA,GACzD,UAAA,gBAAAU,EAAC,OAAA,EAAI,KAAKR,GACR,UAAA,gBAAAQ;AAAA,UAACC;AAAA,UAAA;AAAA,YACE,GAAGZ;AAAA,YACJ,oBAAAI;AAAA,UAAA;AAAA,QAAA,GAEJ,EAAA,CACF;AAAA,QACA,gBAAAO;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,aAAAZ;AAAA,YACA,YAAAE;AAAA,YACA,cAAcF;AAAA,YACd,gBAAgBG;AAAA,YAChB,kBAAgB;AAAA,YAChB,iBAAiB;AAAA,YACjB,WAAWG;AAAA,UAAA;AAAA,QAAA;AAAA,MACb;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("./MarkdownFlow.cjs");require("react/jsx-runtime");require("react");const e=require("./ScrollToBottomButton.cjs");;/* empty css */exports.MarkdownFlow=o.default;exports.default=o.default;exports.ScrollToBottomButton=e.ScrollToBottomButton;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { default as MarkdownFlow } from './MarkdownFlow';
|
|
2
|
-
import { default as ScrollableMarkdownFlow } from './ScrollableMarkdownFlow';
|
|
3
|
-
import { default as ScrollToBottomButton } from './ScrollToBottomButton';
|
|
1
|
+
import { default as MarkdownFlow } from './MarkdownFlow.js';
|
|
2
|
+
import { default as ScrollableMarkdownFlow } from './ScrollableMarkdownFlow.js';
|
|
3
|
+
import { default as ScrollToBottomButton } from './ScrollToBottomButton.js';
|
|
4
|
+
import { default as ScrollToBottomControl } from './ScrollToBottomControl.js';
|
|
4
5
|
export default MarkdownFlow;
|
|
5
|
-
export { MarkdownFlow, ScrollableMarkdownFlow, ScrollToBottomButton };
|
|
6
|
-
export { default as useScrollToBottom } from './useScrollToBottom';
|
|
7
|
-
export type {
|
|
6
|
+
export { MarkdownFlow, ScrollableMarkdownFlow, ScrollableMarkdownFlow as ScrollableMarkdown, ScrollToBottomButton, ScrollToBottomControl, };
|
|
7
|
+
export { default as useScrollToBottom } from './useScrollToBottom.js';
|
|
8
|
+
export type { ScrollToBottomButtonProps, ScrollToBottomPlacement, ScrollToBottomPosition, } from './ScrollToBottomButton.js';
|
|
9
|
+
export type { ScrollToBottomControlProps } from './ScrollToBottomControl.js';
|
|
10
|
+
export type { LegacyUseScrollToBottomOptions, PageScrollFallback, ScrollBehavior, ScrollMetrics, ScrollPresentation, ScrollTarget, ScrollTargetInput, ScrollTargetRef, ScrollTargetResolver, UseScrollToBottomOptions, UseScrollToBottomReturn, } from './useScrollToBottom.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "
|
|
1
|
+
import t from "./MarkdownFlow.es.js";
|
|
2
|
+
import "react/jsx-runtime";
|
|
3
3
|
import "react";
|
|
4
|
-
import "
|
|
5
|
-
import "../ContentRender/contentRenderI18n.es.js";
|
|
4
|
+
import { ScrollToBottomButton as a } from "./ScrollToBottomButton.es.js";
|
|
6
5
|
/* empty css */
|
|
7
6
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
t as MarkdownFlow,
|
|
8
|
+
a as ScrollToBottomButton,
|
|
9
|
+
t as default
|
|
10
10
|
};
|
|
11
11
|
//# sourceMappingURL=index.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("react"),Ve=typeof window>"u"?c.useEffect:c.useLayoutEffect,O=e=>"window"in e&&e.window===e,W=e=>"nodeType"in e&&e.nodeType===9,be=e=>{const t=O(e)?e.document:e;return t.scrollingElement||t.documentElement},_=e=>O(e)?e:W(e)?e.defaultView:e.ownerDocument.defaultView,m=e=>{if(O(e)||W(e)){const t=be(e),l=O(e)?e.innerHeight:t?.clientHeight||0;return{scrollTop:t?.scrollTop||0,scrollHeight:t?.scrollHeight||0,clientHeight:l}}return{scrollTop:e.scrollTop,scrollHeight:e.scrollHeight,clientHeight:e.clientHeight}},ge=(e,t=150)=>{const l=Math.max(0,t),s=e.scrollHeight>e.clientHeight,f=Math.max(0,e.scrollHeight-e.scrollTop-e.clientHeight),h=!s||f===0||f<l;return{distanceFromBottom:f,isAtBottom:h,isScrollable:s,showScrollToBottom:s&&!h}},oe=(e,t=150)=>{const l=e.map(s=>ge(s,t));return{distanceFromBottom:Math.max(0,...l.map(s=>s.distanceFromBottom)),isAtBottom:l.every(s=>s.isAtBottom),isScrollable:l.some(s=>s.isScrollable),showScrollToBottom:l.some(s=>s.showScrollToBottom)}},Ee=(e,t)=>e==="smooth"&&t?"auto":e,ze=e=>e?typeof e=="function"?e():"current"in e?e.current:e:null,Ie=e=>{const{scrollHeight:t,clientHeight:l}=m(e);return t>l+1},xe=e=>{const t=e.ownerDocument.defaultView?.getComputedStyle(e).overflowY;return["auto","scroll","hidden","overlay"].includes(t??"")},ye=(e,t,l="auto")=>{const s=ze(t);if(t!==void 0)return s?[s]:[];const f=e?.current;if(!f)return l!=="never"&&typeof document<"u"?[document]:[];const h=[f,f.parentElement].filter(G=>G!==null&&xe(G));return(l==="always"||l==="auto"&&!h.some(Ie))&&h.push(f.ownerDocument),h},ne=(e,t)=>t?.current?t.current:e.current,M=(e,t)=>e.length===t.length&&e.every((l,s)=>l===t[s]),re=e=>new Map(e.map(t=>[t,m(t).scrollTop])),De=e=>W(e)&&e.defaultView||e,ve=(e,t)=>{W(e)?be(e)?.scrollTo(t):e.scrollTo(t)},Oe=e=>{if(e.defaultPrevented)return!1;if(e.type==="wheel")return e.deltaY!==0;if(e.type==="pointerdown")return!(e.button>0);if(e.type!=="keydown")return!0;const t=e;if(t.ctrlKey||t.metaKey||t.altKey||!["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"," "].includes(t.key))return!1;const l=e.target;return l?.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"]), [role="textbox"]')?!1:t.key!==" "||!l?.closest?.('button, a[href], [role="button"]')};function Be(e,t,l){const s=c.useRef(void 0),f=Array.isArray(t)?t:void 0,h=s.current,U=f?h?.length===f.length&&f.every((n,o)=>Object.is(n,h[o]))?h:[...f]:void 0;c.useEffect(()=>{s.current=U},[U]);const Ae=Array.isArray(t)||t===void 0&&l!==void 0?{autoScrollOnInit:!0,scrollThreshold:10,...l,contentVersion:U??l?.contentVersion}:t??{},{contentRef:R,endRef:J,scrollTarget:ce,pageScrollFallback:le="auto",scrollThreshold:q=150,contentVersion:Ce,followNewContent:F=!0,autoScrollOnInit:Q=!1,behavior:se="smooth"}=Ae,[Re,X]=c.useState(!1),[Fe,Pe]=c.useState(!0),[He,ke]=c.useState(F),[ue,Le]=c.useState(0),V=c.useRef(F),z=c.useRef(null),P=c.useRef(F),K=c.useRef(!1),H=c.useRef([]),Z=c.useRef(null),$=c.useRef(null),I=c.useRef(!1),ie=c.useRef([]),b=c.useRef(null),y=c.useRef(null),B=c.useRef(null),k=c.useRef(null),N=c.useRef(null),p=c.useCallback(n=>{V.current=n,ke(o=>o===n?o:n)},[]),Y=c.useCallback(()=>{N.current!==null&&(clearTimeout(N.current),N.current=null)},[]),g=c.useCallback(()=>{k.current&&(k.current.view.cancelAnimationFrame(k.current.id),k.current=null)},[]),d=c.useCallback(()=>{I.current=!1,Y()},[Y]),ae=c.useRef({viewportRef:e,scrollTarget:ce,pageScrollFallback:le});Ve(()=>{ae.current={viewportRef:e,scrollTarget:ce,pageScrollFallback:le}});const w=c.useCallback(()=>{const n=ae.current;return ye(n.viewportRef,n.scrollTarget,n.pageScrollFallback)},[]),x=c.useCallback(n=>{I.current&&!M(n,ie.current)&&(g(),d()),b.current&&!M(n,[...b.current.keys()])&&(b.current=null);const o=oe(n.map(m),q);if(Pe(o.isAtBottom),I.current)return X(o.isAtBottom?o.showScrollToBottom:!1),o.distanceFromBottom<=1&&(d(),p(P.current),z.current=P.current?re(n):null),o;X(o.showScrollToBottom);const i=z.current,S=V.current&&i!==null&&M(n,[...i.keys()])&&n.every(A=>m(A).scrollTop===i.get(A)),T=!b.current&&(o.isAtBottom||S)&&P.current;return z.current=T?re(n):null,p(T),o},[g,d,q,p]),u=c.useCallback(()=>{x(w())},[x,w]),E=c.useCallback((n=se)=>{const o=w();if(o.length===0)return;const i=_(o[0]),S=i?.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1,T=Ee(n,S),A=T==="auto"?"instant":T;if(b.current=null,z.current=null,I.current=!0,ie.current=o,p(P.current),X(!1),g(),Y(),J?.current?J.current.scrollIntoView({behavior:A,block:"end"}):o.forEach(C=>{const j=m(C).scrollHeight;ve(C,{top:j,behavior:A})}),T==="auto"){if(P.current&&oe(o.map(m),q).isAtBottom&&(z.current=re(o)),i){const C=i.requestAnimationFrame(()=>{k.current=null,d(),u()});k.current={view:i,id:C}}else d(),u();return}N.current=setTimeout(()=>{d(),u()},1200)},[se,g,Y,J,d,w,u,q,p]),D=c.useCallback(()=>{const n=w(),o=e.current,i=ne(e,R);return M(n,H.current)&&o===Z.current&&i===$.current?!1:(M(n,H.current)||x(n),H.current=n,Z.current=o,$.current=i,Le(S=>S+1),!0)},[x,R,w,e]);c.useEffect(()=>{const n=w(),o=n[0]?_(n[0]):e.current?.ownerDocument.defaultView??null;if(n.length===0&&!o)return;H.current=n,Z.current=e.current,$.current=ne(e,R);const i=new Set(n.map(De)),S=new Set([...n.map(_),o].filter(r=>r!==null)),T=new Set(Array.from(S).map(r=>r.visualViewport).filter(r=>!!r)),A=r=>{if(y.current!==null&&o&&o.cancelAnimationFrame(y.current),!o){r();return}y.current=o.requestAnimationFrame(()=>{y.current=null,r()})},C=new Map(n.map(r=>[r,m(r).scrollTop])),j=()=>{I.current&&(b.current=new Map(n.map(r=>[r,m(r).scrollTop])),g(),d(),p(!1),n.forEach(r=>{ve(r,{top:m(r).scrollTop,behavior:"instant"})}),u())},fe=r=>{Oe(r)&&j()},me=()=>{const r=b.current;r&&n.some(a=>m(a).scrollTop!==r.get(a))&&(b.current=null);let v=!1;n.forEach(a=>{const te=m(a).scrollTop;te<(C.get(a)??te)-1&&(v=!0),C.set(a,te)}),v&&j(),u()},L=()=>{A(()=>{D(),K.current&&V.current?E("auto"):u()})},de=["wheel","touchstart","pointerdown","keydown"];i.forEach(r=>{r.addEventListener("scroll",me,{passive:!0}),de.forEach(v=>r.addEventListener(v,fe,{passive:!0,capture:!0}))}),S.forEach(r=>r.addEventListener("resize",L)),T.forEach(r=>r.addEventListener("resize",L));const he=o,we=he?.ResizeObserver,ee=we?new we(L):null,pe=()=>{ee?.disconnect();const r=new Set;e.current&&r.add(e.current);const v=ne(e,R);v&&r.add(v),!R?.current&&e.current&&Array.from(e.current.children).forEach(a=>r.add(a)),n.forEach(a=>{!O(a)&&!W(a)&&r.add(a)}),r.forEach(a=>ee?.observe(a))};pe();const Se=he?.MutationObserver,Te=Se?new Se(()=>{pe(),L()}):null;return e.current&&Te?.observe(e.current,{childList:!0,characterData:!0,subtree:!0}),u(),()=>{i.forEach(r=>{r.removeEventListener("scroll",me),de.forEach(v=>r.removeEventListener(v,fe,!0))}),S.forEach(r=>r.removeEventListener("resize",L)),T.forEach(r=>r.removeEventListener("resize",L)),ee?.disconnect(),Te?.disconnect(),y.current!==null&&o&&(o.cancelAnimationFrame(y.current),y.current=null),M(H.current,n)&&(H.current=[])}},[x,ue,g,R,D,d,w,u,E,p,e]),c.useEffect(()=>{D()}),c.useEffect(()=>{const n=w(),o=n[0]?_(n[0]):null;if(D(),n.length===0)return;const i=!K.current&&Q;if(!K.current&&(K.current=!0,!Q)){u();return}if(B.current!==null&&o&&o.cancelAnimationFrame(B.current),!o){V.current?E("auto"):u();return}return B.current=o.requestAnimationFrame(()=>{B.current=null,V.current||i?E("auto"):u()}),()=>{B.current!==null&&(o.cancelAnimationFrame(B.current),B.current=null)}},[Q,ue,Ce,D,w,u,E]),c.useEffect(()=>{if(P.current=F,!F){p(!1);return}u()},[F,u,p]),c.useEffect(()=>()=>{g(),d()},[g,d]);const Me=c.useCallback(()=>{E()},[E]);return{showScrollToBottom:Re,isAtBottom:Fe,followNewContent:He,scrollToBottom:E,handleUserScrollToBottom:Me,refresh:u}}exports.default=Be;exports.getCombinedScrollPresentation=oe;exports.getScrollMetrics=m;exports.getScrollPresentation=ge;exports.resolveScrollBehavior=Ee;exports.resolveScrollTargets=ye;exports.useScrollToBottom=Be;
|
|
2
2
|
//# sourceMappingURL=useScrollToBottom.cjs.map
|