markdown-flow-ui 0.2.13 → 0.2.15
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/_virtual/index.es3.js +5 -4
- package/dist/_virtual/index.es3.js.map +1 -1
- package/dist/_virtual/index.es4.js +4 -5
- package/dist/_virtual/index.es4.js.map +1 -1
- package/dist/_virtual/index3.cjs +1 -1
- package/dist/_virtual/index4.cjs +1 -1
- 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 +9 -4
- package/dist/components/ContentRender/ContentRender.es.js +389 -298
- 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/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 +3 -3
- 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/rc-input/es/BaseInput.cjs +1 -1
- package/dist/node_modules/rc-input/es/BaseInput.es.js +1 -1
- package/dist/node_modules/rc-textarea/es/ResizableTextArea.cjs +1 -1
- package/dist/node_modules/rc-textarea/es/ResizableTextArea.es.js +1 -1
- package/dist/node_modules/rc-textarea/es/TextArea.cjs +1 -1
- package/dist/node_modules/rc-textarea/es/TextArea.es.js +1 -1
- package/dist/node_modules/rc-textarea/es/index.cjs +1 -1
- package/dist/node_modules/rc-textarea/es/index.es.js +1 -1
- 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/node_modules/remark-flow/dist/interaction-plugin-core.cjs +1 -1
- package/dist/node_modules/remark-flow/dist/interaction-plugin-core.es.js +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 +2 -0
- package/dist/scroll.cjs.map +1 -0
- package/dist/scroll.d.ts +6 -0
- package/dist/scroll.es.js +9 -0
- package/dist/scroll.es.js.map +1 -0
- package/dist/slide.d.ts +3 -3
- package/package.json +13 -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,239 +1,240 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { Button as
|
|
4
|
-
import { Input as
|
|
5
|
-
import
|
|
6
|
-
import { isValidImageUrl as
|
|
7
|
-
import { useTranslation as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
const
|
|
11
|
-
({ value:
|
|
12
|
-
const { t: c } =
|
|
13
|
-
resourceUrl:
|
|
14
|
-
resourceTitle:
|
|
15
|
-
scalePercent:
|
|
16
|
-
}), [
|
|
17
|
-
!!
|
|
18
|
-
), [
|
|
19
|
-
|
|
20
|
-
), [
|
|
21
|
-
|
|
22
|
-
), [
|
|
23
|
-
|
|
24
|
-
if (
|
|
25
|
-
|
|
1
|
+
import { jsxs as i, jsx as n, Fragment as B } from "react/jsx-runtime";
|
|
2
|
+
import X, { useContext as Y, useState as u, useEffect as Z, useMemo as F } from "react";
|
|
3
|
+
import { Button as C } from "../../ui/button.es.js";
|
|
4
|
+
import { Input as S } from "../../ui/input.es.js";
|
|
5
|
+
import ee from "../editor-context.es.js";
|
|
6
|
+
import { isValidImageUrl as te, sanitizeImageUrl as ae } from "../utils/image.es.js";
|
|
7
|
+
import { useTranslation as re } from "../../../node_modules/react-i18next/dist/es/useTranslation.es.js";
|
|
8
|
+
import ne from "../../../node_modules/lucide-react/dist/esm/icons/loader-circle.es.js";
|
|
9
|
+
import O from "../../../node_modules/lucide-react/dist/esm/icons/upload.es.js";
|
|
10
|
+
const ce = X.forwardRef(
|
|
11
|
+
({ value: s, onSelect: k, uploadProps: r }, V) => {
|
|
12
|
+
const { t: c } = re(), { setDialogOpen: I } = Y(ee), [l, f] = u({
|
|
13
|
+
resourceUrl: s?.resourceUrl ?? "",
|
|
14
|
+
resourceTitle: s?.resourceTitle ?? "",
|
|
15
|
+
scalePercent: s?.scalePercent ?? 100
|
|
16
|
+
}), [b, U] = u(
|
|
17
|
+
!!s?.resourceUrl
|
|
18
|
+
), [g, N] = u(s?.resourceUrl ?? ""), [R, w] = u(
|
|
19
|
+
s?.scalePercent ?? 100
|
|
20
|
+
), [v, L] = u(
|
|
21
|
+
s?.scalePercent !== void 0 ? String(s.scalePercent) : "100"
|
|
22
|
+
), [D, h] = u(""), [T, m] = u("idle"), d = T === "loading";
|
|
23
|
+
Z(() => {
|
|
24
|
+
if (s?.resourceUrl) {
|
|
25
|
+
f((t) => ({
|
|
26
26
|
...t,
|
|
27
|
-
resourceUrl:
|
|
28
|
-
resourceTitle:
|
|
29
|
-
scalePercent:
|
|
30
|
-
})),
|
|
31
|
-
const e =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
),
|
|
27
|
+
resourceUrl: s.resourceUrl ?? "",
|
|
28
|
+
resourceTitle: s.resourceTitle ?? t.resourceTitle ?? "",
|
|
29
|
+
scalePercent: s.scalePercent ?? t.scalePercent ?? 100
|
|
30
|
+
})), N(s.resourceUrl ?? "");
|
|
31
|
+
const e = s.scalePercent !== void 0 ? s.scalePercent : 100;
|
|
32
|
+
w(e), L(
|
|
33
|
+
s.scalePercent !== void 0 ? String(s.scalePercent) : String(e)
|
|
34
|
+
), U(!0);
|
|
35
35
|
}
|
|
36
36
|
m("idle");
|
|
37
|
-
}, [
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
resourceUrl:
|
|
44
|
-
resourceTitle: t ||
|
|
45
|
-
scalePercent:
|
|
46
|
-
}),
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
resourceUrl:
|
|
50
|
-
resourceTitle:
|
|
51
|
-
scalePercent:
|
|
52
|
-
}),
|
|
53
|
-
},
|
|
37
|
+
}, [s]);
|
|
38
|
+
const q = () => {
|
|
39
|
+
d || I(!1);
|
|
40
|
+
}, E = (e, t) => {
|
|
41
|
+
const a = ae(e);
|
|
42
|
+
f({
|
|
43
|
+
resourceUrl: a,
|
|
44
|
+
resourceTitle: t || l.resourceTitle || c("imageDefaultTitle"),
|
|
45
|
+
scalePercent: R
|
|
46
|
+
}), N(a), U(!0), h(""), T === "loading" && m("success");
|
|
47
|
+
}, z = () => {
|
|
48
|
+
d || l.resourceUrl && (k({
|
|
49
|
+
resourceUrl: l.resourceUrl,
|
|
50
|
+
resourceTitle: l.resourceTitle || c("imageDefaultTitle", "Image name"),
|
|
51
|
+
scalePercent: R
|
|
52
|
+
}), I(!1));
|
|
53
|
+
}, M = (e) => {
|
|
54
54
|
const t = e.target.value.trim();
|
|
55
|
-
|
|
56
|
-
},
|
|
57
|
-
|
|
55
|
+
N(t), U(!1), h("");
|
|
56
|
+
}, P = (e) => {
|
|
57
|
+
f((t) => ({
|
|
58
58
|
...t,
|
|
59
59
|
resourceTitle: e.target.value
|
|
60
60
|
}));
|
|
61
|
-
},
|
|
61
|
+
}, _ = (e) => {
|
|
62
62
|
const t = e.target.value.replace(/[^\d]/g, "");
|
|
63
|
-
if (
|
|
64
|
-
|
|
65
|
-
...
|
|
63
|
+
if (L(t), !t) {
|
|
64
|
+
w(void 0), f((o) => ({
|
|
65
|
+
...o,
|
|
66
66
|
scalePercent: void 0
|
|
67
67
|
}));
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
...
|
|
73
|
-
scalePercent:
|
|
70
|
+
const a = Math.max(1, Math.min(1e3, Number(t)));
|
|
71
|
+
w(a), f((o) => ({
|
|
72
|
+
...o,
|
|
73
|
+
scalePercent: a
|
|
74
74
|
}));
|
|
75
|
-
},
|
|
76
|
-
if (!
|
|
77
|
-
if (m("idle"), !
|
|
78
|
-
|
|
75
|
+
}, A = () => {
|
|
76
|
+
if (!d) {
|
|
77
|
+
if (m("idle"), !g) {
|
|
78
|
+
h(c("imageUrlRequired", "Please enter image URL"));
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
|
-
if (!
|
|
82
|
-
|
|
81
|
+
if (!te(g)) {
|
|
82
|
+
h(c("imageInvalidUrl", "Please enter a valid image URL"));
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
|
-
if (
|
|
85
|
+
if (E(g), !l.resourceTitle && g)
|
|
86
86
|
try {
|
|
87
|
-
const e = new URL(
|
|
87
|
+
const e = new URL(g), t = decodeURIComponent(
|
|
88
88
|
e.pathname.split("/").filter(Boolean).pop() ?? ""
|
|
89
89
|
);
|
|
90
|
-
t &&
|
|
91
|
-
...
|
|
90
|
+
t && f((a) => ({
|
|
91
|
+
...a,
|
|
92
92
|
resourceTitle: t
|
|
93
93
|
}));
|
|
94
94
|
} catch (e) {
|
|
95
95
|
console.error(e);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
},
|
|
99
|
-
m("success"),
|
|
100
|
-
},
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
},
|
|
98
|
+
}, y = (e, t) => {
|
|
99
|
+
m("success"), E(e, t);
|
|
100
|
+
}, p = (e, t) => {
|
|
101
|
+
const a = e?.message || c("imageUploadError", "Upload failed, please retry");
|
|
102
|
+
h(a), m("error"), U(!!l.resourceUrl), r?.onError?.(e, t);
|
|
103
|
+
}, $ = async (e) => {
|
|
104
104
|
const t = {
|
|
105
105
|
file: e,
|
|
106
|
-
filename:
|
|
107
|
-
data: typeof
|
|
108
|
-
headers:
|
|
109
|
-
withCredentials:
|
|
110
|
-
action: typeof
|
|
111
|
-
onProgress: (
|
|
112
|
-
onError: (
|
|
113
|
-
onSuccess: (
|
|
114
|
-
|
|
115
|
-
const
|
|
116
|
-
|
|
106
|
+
filename: r?.name,
|
|
107
|
+
data: typeof r?.data == "function" ? await r.data(e) : r?.data,
|
|
108
|
+
headers: r?.headers,
|
|
109
|
+
withCredentials: r?.withCredentials,
|
|
110
|
+
action: typeof r?.action == "function" ? await r.action(e) : r?.action,
|
|
111
|
+
onProgress: (a) => r?.onProgress?.(a, e),
|
|
112
|
+
onError: (a) => p(a, e),
|
|
113
|
+
onSuccess: (a) => {
|
|
114
|
+
r?.onSuccess?.(a, e);
|
|
115
|
+
const o = typeof a == "string" ? a : a?.url ?? a?.data?.url;
|
|
116
|
+
o ? y(o, e.name) : p(new Error("INVALID_RESPONSE"), e);
|
|
117
117
|
}
|
|
118
118
|
};
|
|
119
|
-
|
|
120
|
-
},
|
|
121
|
-
const t = typeof
|
|
119
|
+
r?.customRequest?.(t);
|
|
120
|
+
}, G = async (e) => {
|
|
121
|
+
const t = typeof r?.action == "function" ? await r.action(e) : r?.action;
|
|
122
122
|
if (!t) {
|
|
123
|
-
|
|
123
|
+
y(URL.createObjectURL(e), e.name);
|
|
124
124
|
return;
|
|
125
125
|
}
|
|
126
126
|
try {
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
|
|
127
|
+
const a = new FormData();
|
|
128
|
+
a.append(r?.name ?? "file", e);
|
|
129
|
+
const o = typeof r?.data == "function" ? await r.data(e) : r?.data;
|
|
130
|
+
o && Object.entries(o).forEach(([Q, W]) => {
|
|
131
|
+
a.append(Q, W);
|
|
132
132
|
});
|
|
133
|
-
const
|
|
133
|
+
const x = await (await fetch(t, {
|
|
134
134
|
method: "POST",
|
|
135
|
-
body:
|
|
136
|
-
headers:
|
|
137
|
-
credentials:
|
|
135
|
+
body: a,
|
|
136
|
+
headers: r?.headers,
|
|
137
|
+
credentials: r?.withCredentials ? "include" : "same-origin"
|
|
138
138
|
})).json();
|
|
139
|
-
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
} catch (
|
|
143
|
-
|
|
139
|
+
r?.onSuccess?.(x, e);
|
|
140
|
+
const j = typeof x == "string" ? x : x?.data;
|
|
141
|
+
j ? y(j, e.name) : p(new Error("INVALID_RESPONSE"), e);
|
|
142
|
+
} catch (a) {
|
|
143
|
+
p(a, e);
|
|
144
144
|
}
|
|
145
|
-
},
|
|
145
|
+
}, H = async (e) => {
|
|
146
146
|
try {
|
|
147
|
-
|
|
147
|
+
h("");
|
|
148
148
|
let t = e;
|
|
149
|
-
if (
|
|
149
|
+
if (r?.beforeUpload && (t = await r.beforeUpload(e), t === !1))
|
|
150
150
|
return;
|
|
151
151
|
t instanceof Blob && !(t instanceof File) && (t = new File([t], e.name, {
|
|
152
152
|
type: t.type || e.type
|
|
153
153
|
}));
|
|
154
|
-
const
|
|
155
|
-
if (m("loading"),
|
|
156
|
-
await
|
|
154
|
+
const a = t instanceof File ? t : e;
|
|
155
|
+
if (m("loading"), U(!1), r?.customRequest) {
|
|
156
|
+
await $(a);
|
|
157
157
|
return;
|
|
158
158
|
}
|
|
159
|
-
if (
|
|
160
|
-
await
|
|
159
|
+
if (r?.action) {
|
|
160
|
+
await G(a);
|
|
161
161
|
return;
|
|
162
162
|
}
|
|
163
|
-
const
|
|
164
|
-
|
|
163
|
+
const o = URL.createObjectURL(a);
|
|
164
|
+
y(o, a.name), r?.onSuccess?.({ url: o }, a);
|
|
165
165
|
} catch (t) {
|
|
166
|
-
m("error"),
|
|
166
|
+
m("error"), p(t, e);
|
|
167
167
|
}
|
|
168
|
-
},
|
|
168
|
+
}, J = async (e) => {
|
|
169
169
|
const t = e.target.files?.[0];
|
|
170
|
-
t && (await
|
|
171
|
-
},
|
|
172
|
-
() => /* @__PURE__ */
|
|
173
|
-
/* @__PURE__ */
|
|
174
|
-
|
|
170
|
+
t && (await H(t), e.target.value = "");
|
|
171
|
+
}, K = F(
|
|
172
|
+
() => /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
173
|
+
/* @__PURE__ */ n(
|
|
174
|
+
S,
|
|
175
175
|
{
|
|
176
176
|
type: "text",
|
|
177
|
-
value:
|
|
178
|
-
onChange:
|
|
177
|
+
value: v,
|
|
178
|
+
onChange: _,
|
|
179
179
|
className: "w-24",
|
|
180
180
|
inputMode: "numeric",
|
|
181
181
|
pattern: "[0-9]*"
|
|
182
182
|
}
|
|
183
183
|
),
|
|
184
|
-
/* @__PURE__ */
|
|
184
|
+
/* @__PURE__ */ n("span", { children: "%" })
|
|
185
185
|
] }),
|
|
186
|
-
[
|
|
186
|
+
[v]
|
|
187
187
|
);
|
|
188
|
-
return /* @__PURE__ */
|
|
189
|
-
/* @__PURE__ */
|
|
190
|
-
/* @__PURE__ */
|
|
191
|
-
/* @__PURE__ */
|
|
192
|
-
/* @__PURE__ */
|
|
193
|
-
|
|
188
|
+
return /* @__PURE__ */ i("div", { ref: V, className: "space-y-6", children: [
|
|
189
|
+
/* @__PURE__ */ i("div", { className: "space-y-2", children: [
|
|
190
|
+
/* @__PURE__ */ n("label", { className: "text-sm font-medium text-foreground", children: c("imageUrlLabel", "URL") }),
|
|
191
|
+
/* @__PURE__ */ i("div", { className: "flex gap-2", children: [
|
|
192
|
+
/* @__PURE__ */ n(
|
|
193
|
+
S,
|
|
194
194
|
{
|
|
195
195
|
type: "text",
|
|
196
196
|
placeholder: c("imageUrlPlaceholder", "Please enter image URL"),
|
|
197
|
-
|
|
198
|
-
|
|
197
|
+
dir: "ltr",
|
|
198
|
+
value: g,
|
|
199
|
+
onChange: M,
|
|
199
200
|
autoComplete: "off"
|
|
200
201
|
}
|
|
201
202
|
),
|
|
202
|
-
/* @__PURE__ */
|
|
203
|
-
|
|
203
|
+
/* @__PURE__ */ n(
|
|
204
|
+
C,
|
|
204
205
|
{
|
|
205
206
|
className: "h-8",
|
|
206
207
|
variant: "outline",
|
|
207
208
|
type: "button",
|
|
208
|
-
onClick:
|
|
209
|
+
onClick: A,
|
|
209
210
|
children: c("imageRunButton", "Preview")
|
|
210
211
|
}
|
|
211
212
|
)
|
|
212
213
|
] })
|
|
213
214
|
] }),
|
|
214
|
-
/* @__PURE__ */
|
|
215
|
-
/* @__PURE__ */
|
|
216
|
-
/* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ i("div", { className: "space-y-2", children: [
|
|
216
|
+
/* @__PURE__ */ n("label", { className: "text-sm font-medium text-foreground", children: c("imageUploadLabel", "Upload") }),
|
|
217
|
+
/* @__PURE__ */ i(
|
|
217
218
|
"label",
|
|
218
219
|
{
|
|
219
|
-
className: `relative group flex h-48 w-full flex-col items-center justify-center overflow-hidden rounded-lg border border-dashed transition-colors ${
|
|
220
|
+
className: `relative group flex h-48 w-full flex-col items-center justify-center overflow-hidden rounded-lg border border-dashed transition-colors ${b ? "bg-muted/40" : "bg-muted/10"} ${d ? "cursor-wait opacity-80 pointer-events-none" : "cursor-pointer"}`,
|
|
220
221
|
children: [
|
|
221
|
-
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
-
/* @__PURE__ */
|
|
222
|
+
d && /* @__PURE__ */ i("div", { className: "absolute inset-0 z-10 flex flex-col items-center justify-center gap-2 bg-background/80", children: [
|
|
223
|
+
/* @__PURE__ */ n(ne, { className: "h-6 w-6 animate-spin text-primary" }),
|
|
224
|
+
/* @__PURE__ */ n("span", { className: "text-sm text-muted-foreground", children: c("imageUploading", "Uploading...") })
|
|
224
225
|
] }),
|
|
225
|
-
|
|
226
|
-
/* @__PURE__ */
|
|
226
|
+
b && l.resourceUrl ? /* @__PURE__ */ i(B, { children: [
|
|
227
|
+
/* @__PURE__ */ n(
|
|
227
228
|
"img",
|
|
228
229
|
{
|
|
229
|
-
src:
|
|
230
|
-
alt:
|
|
230
|
+
src: l.resourceUrl,
|
|
231
|
+
alt: l.resourceTitle || c("imageDefaultTitle"),
|
|
231
232
|
className: "h-full w-full object-contain"
|
|
232
233
|
}
|
|
233
234
|
),
|
|
234
|
-
!
|
|
235
|
-
/* @__PURE__ */
|
|
236
|
-
|
|
235
|
+
!d && /* @__PURE__ */ i("div", { className: "pointer-events-none absolute inset-0 flex flex-col items-center justify-center gap-2 bg-[#D7D7D7] opacity-0 transition-opacity duration-200 group-hover:opacity-100", children: [
|
|
236
|
+
/* @__PURE__ */ n(
|
|
237
|
+
O,
|
|
237
238
|
{
|
|
238
239
|
className: "h-6 w-6",
|
|
239
240
|
style: {
|
|
@@ -241,7 +242,7 @@ const re = Q.forwardRef(
|
|
|
241
242
|
}
|
|
242
243
|
}
|
|
243
244
|
),
|
|
244
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ n(
|
|
245
246
|
"span",
|
|
246
247
|
{
|
|
247
248
|
className: "text-sm",
|
|
@@ -255,64 +256,64 @@ const re = Q.forwardRef(
|
|
|
255
256
|
}
|
|
256
257
|
)
|
|
257
258
|
] })
|
|
258
|
-
] }) : /* @__PURE__ */
|
|
259
|
-
/* @__PURE__ */
|
|
260
|
-
/* @__PURE__ */
|
|
259
|
+
] }) : /* @__PURE__ */ i("div", { className: "flex flex-col items-center gap-2 text-sm text-muted-foreground", children: [
|
|
260
|
+
/* @__PURE__ */ n(O, { className: "h-6 w-6" }),
|
|
261
|
+
/* @__PURE__ */ n("span", { children: c("imageUploadPlaceholder", "Drag files or click to upload") })
|
|
261
262
|
] }),
|
|
262
|
-
/* @__PURE__ */
|
|
263
|
+
/* @__PURE__ */ n(
|
|
263
264
|
"input",
|
|
264
265
|
{
|
|
265
266
|
type: "file",
|
|
266
267
|
accept: "image/*",
|
|
267
268
|
className: "hidden",
|
|
268
|
-
disabled:
|
|
269
|
-
onChange:
|
|
269
|
+
disabled: d,
|
|
270
|
+
onChange: J
|
|
270
271
|
}
|
|
271
272
|
)
|
|
272
273
|
]
|
|
273
274
|
}
|
|
274
275
|
),
|
|
275
|
-
|
|
276
|
+
T === "success" && /* @__PURE__ */ n("p", { className: "text-xs text-muted-foreground", children: c("imageUploadSuccess", "Upload complete") })
|
|
276
277
|
] }),
|
|
277
|
-
|
|
278
|
-
/* @__PURE__ */
|
|
279
|
-
/* @__PURE__ */
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
-
|
|
278
|
+
b && l.resourceUrl && /* @__PURE__ */ i(B, { children: [
|
|
279
|
+
/* @__PURE__ */ i("div", { className: "space-y-2", children: [
|
|
280
|
+
/* @__PURE__ */ n("label", { className: "text-sm font-medium text-foreground", children: c("imageTitleLabel", "Image Title") }),
|
|
281
|
+
/* @__PURE__ */ n(
|
|
282
|
+
S,
|
|
282
283
|
{
|
|
283
284
|
type: "text",
|
|
284
285
|
placeholder: c(
|
|
285
286
|
"imageTitlePlaceholder",
|
|
286
287
|
"Please enter image title"
|
|
287
288
|
),
|
|
288
|
-
value:
|
|
289
|
-
onChange:
|
|
289
|
+
value: l.resourceTitle || "",
|
|
290
|
+
onChange: P
|
|
290
291
|
}
|
|
291
292
|
)
|
|
292
293
|
] }),
|
|
293
|
-
/* @__PURE__ */
|
|
294
|
-
/* @__PURE__ */
|
|
295
|
-
|
|
294
|
+
/* @__PURE__ */ i("div", { className: "space-y-2", children: [
|
|
295
|
+
/* @__PURE__ */ n("label", { className: "text-sm font-medium text-foreground", children: c("imageScaleLabel", "Scale") }),
|
|
296
|
+
K
|
|
296
297
|
] })
|
|
297
298
|
] }),
|
|
298
|
-
!!
|
|
299
|
-
/* @__PURE__ */
|
|
300
|
-
/* @__PURE__ */
|
|
301
|
-
|
|
299
|
+
!!D && /* @__PURE__ */ n("p", { className: "text-xs text-destructive", children: D }),
|
|
300
|
+
/* @__PURE__ */ i("div", { className: "flex justify-end gap-2", children: [
|
|
301
|
+
/* @__PURE__ */ n(
|
|
302
|
+
C,
|
|
302
303
|
{
|
|
303
304
|
type: "button",
|
|
304
305
|
variant: "outline",
|
|
305
|
-
onClick:
|
|
306
|
-
disabled:
|
|
306
|
+
onClick: q,
|
|
307
|
+
disabled: d,
|
|
307
308
|
children: c("imageCancelButton", "Cancel")
|
|
308
309
|
}
|
|
309
310
|
),
|
|
310
|
-
/* @__PURE__ */
|
|
311
|
-
|
|
311
|
+
/* @__PURE__ */ n(
|
|
312
|
+
C,
|
|
312
313
|
{
|
|
313
314
|
className: "h-8",
|
|
314
|
-
onClick:
|
|
315
|
-
disabled: !
|
|
315
|
+
onClick: z,
|
|
316
|
+
disabled: !l?.resourceUrl || d,
|
|
316
317
|
children: c("imageUseButton", "Use Image")
|
|
317
318
|
}
|
|
318
319
|
)
|
|
@@ -320,8 +321,8 @@ const re = Q.forwardRef(
|
|
|
320
321
|
] });
|
|
321
322
|
}
|
|
322
323
|
);
|
|
323
|
-
|
|
324
|
+
ce.displayName = "ImageInject";
|
|
324
325
|
export {
|
|
325
|
-
|
|
326
|
+
ce as default
|
|
326
327
|
};
|
|
327
328
|
//# sourceMappingURL=ImageInject.es.js.map
|