markdown-flow-ui 0.3.2-dev.1 → 0.3.2
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 +0 -13
- package/dist/_virtual/index.es6.js +3 -5
- package/dist/_virtual/index.es6.js.map +1 -1
- package/dist/_virtual/index.es7.js +5 -3
- package/dist/_virtual/index.es7.js.map +1 -1
- package/dist/_virtual/index.es8.js +2 -2
- package/dist/_virtual/index.es9.js +2 -2
- package/dist/_virtual/index6.cjs +1 -1
- package/dist/_virtual/index7.cjs +1 -1
- package/dist/_virtual/index8.cjs +1 -1
- package/dist/_virtual/index9.cjs +1 -1
- package/dist/assets/markdown-flow-ui.css +1 -1
- package/dist/components/ContentRender/IframeSandbox.cjs.map +1 -1
- package/dist/components/ContentRender/IframeSandbox.es.js.map +1 -1
- package/dist/components/ContentRender/utils/video-markdown-run.cjs.map +1 -1
- package/dist/components/ContentRender/utils/video-markdown-run.es.js.map +1 -1
- package/dist/components/MarkdownFlow/ScrollToBottomButton.cjs.map +1 -1
- package/dist/components/MarkdownFlow/ScrollToBottomButton.es.js.map +1 -1
- package/dist/components/MarkdownFlow/ScrollToBottomControl.cjs.map +1 -1
- package/dist/components/MarkdownFlow/ScrollToBottomControl.es.js.map +1 -1
- package/dist/components/MarkdownFlow/useScrollToBottom.cjs.map +1 -1
- 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 +2 -2
- package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.es.js +323 -558
- package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.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 +0 -8
- package/dist/components/MarkdownFlowEditor/components/EditorToolbar.es.js +64 -107
- package/dist/components/MarkdownFlowEditor/components/EditorToolbar.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/editor-context.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/editor-context.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/editor-context.es.js +4 -10
- package/dist/components/MarkdownFlowEditor/editor-context.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/editorI18n.d.ts +0 -308
- package/dist/components/MarkdownFlowEditor/locales/ar-SA.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/ar-SA.json.d.ts +1 -15
- package/dist/components/MarkdownFlowEditor/locales/ar-SA.json.es.js +87 -115
- package/dist/components/MarkdownFlowEditor/locales/ar-SA.json.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/locales/de-DE.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/de-DE.json.d.ts +1 -15
- package/dist/components/MarkdownFlowEditor/locales/de-DE.json.es.js +88 -116
- package/dist/components/MarkdownFlowEditor/locales/de-DE.json.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/locales/en-US.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/en-US.json.d.ts +1 -15
- package/dist/components/MarkdownFlowEditor/locales/en-US.json.es.js +88 -116
- package/dist/components/MarkdownFlowEditor/locales/en-US.json.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/locales/es-ES.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/es-ES.json.d.ts +1 -15
- package/dist/components/MarkdownFlowEditor/locales/es-ES.json.es.js +80 -108
- package/dist/components/MarkdownFlowEditor/locales/es-ES.json.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/locales/fil-PH.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/fil-PH.json.d.ts +1 -15
- package/dist/components/MarkdownFlowEditor/locales/fil-PH.json.es.js +82 -110
- package/dist/components/MarkdownFlowEditor/locales/fil-PH.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 +1 -15
- package/dist/components/MarkdownFlowEditor/locales/fr-FR.json.es.js +86 -114
- package/dist/components/MarkdownFlowEditor/locales/fr-FR.json.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/locales/ja-JP.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/ja-JP.json.d.ts +1 -15
- package/dist/components/MarkdownFlowEditor/locales/ja-JP.json.es.js +88 -116
- package/dist/components/MarkdownFlowEditor/locales/ja-JP.json.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/locales/th-TH.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/th-TH.json.d.ts +1 -15
- package/dist/components/MarkdownFlowEditor/locales/th-TH.json.es.js +85 -113
- package/dist/components/MarkdownFlowEditor/locales/th-TH.json.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/locales/ur-PK.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/ur-PK.json.d.ts +1 -15
- package/dist/components/MarkdownFlowEditor/locales/ur-PK.json.es.js +94 -122
- package/dist/components/MarkdownFlowEditor/locales/ur-PK.json.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/locales/vi-VN.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/vi-VN.json.d.ts +1 -15
- package/dist/components/MarkdownFlowEditor/locales/vi-VN.json.es.js +74 -102
- package/dist/components/MarkdownFlowEditor/locales/vi-VN.json.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/locales/zh-CN.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/zh-CN.json.d.ts +1 -15
- package/dist/components/MarkdownFlowEditor/locales/zh-CN.json.es.js +72 -100
- 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.d.ts +2 -1
- package/dist/components/MarkdownFlowEditor/plugins/ImgPlaceholder.es.js +62 -53
- package/dist/components/MarkdownFlowEditor/plugins/ImgPlaceholder.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/PlaceholderWidget.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/PlaceholderWidget.d.ts +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/PlaceholderWidget.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.cjs +3 -3
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.d.ts +1 -5
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.es.js +149 -154
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.es.js.map +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.d.ts +2 -1
- package/dist/components/MarkdownFlowEditor/plugins/VideoPlaceholder.es.js +53 -42
- package/dist/components/MarkdownFlowEditor/plugins/VideoPlaceholder.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/types.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/types.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/types.d.ts +1 -11
- package/dist/components/MarkdownFlowEditor/types.es.js +2 -2
- package/dist/components/MarkdownFlowEditor/types.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/utils.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/utils.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/utils.d.ts +0 -10
- package/dist/components/MarkdownFlowEditor/utils.es.js +59 -73
- package/dist/components/MarkdownFlowEditor/utils.es.js.map +1 -1
- package/dist/components/Slide/MarkdownSlideScaling.cjs.map +1 -1
- package/dist/components/Slide/MarkdownSlideScaling.es.js.map +1 -1
- package/dist/components/Slide/MobilePlayerSettingsSheet.es.js +16 -16
- package/dist/components/Slide/Player.cjs.map +1 -1
- package/dist/components/Slide/Player.es.js.map +1 -1
- package/dist/components/Slide/Slide.cjs.map +1 -1
- package/dist/components/Slide/Slide.es.js.map +1 -1
- package/dist/components/Slide/SubtitleOverlay.cjs.map +1 -1
- package/dist/components/Slide/SubtitleOverlay.es.js.map +1 -1
- package/dist/components/Slide/slideI18n.cjs.map +1 -1
- package/dist/components/Slide/slideI18n.es.js.map +1 -1
- package/dist/components/Slide/useSlide.cjs.map +1 -1
- package/dist/components/Slide/useSlide.es.js.map +1 -1
- package/dist/components/Slide/utils/streamingNavigation.cjs.map +1 -1
- package/dist/components/Slide/utils/streamingNavigation.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.es.js +27 -27
- package/dist/components/ui/dialog.es.js.map +1 -1
- package/dist/lib/interaction-defaults.cjs.map +1 -1
- package/dist/lib/interaction-defaults.es.js.map +1 -1
- package/dist/markdown-flow-ui-lib.css +1 -1
- package/dist/markdown-flow-ui.css +1 -1
- package/dist/node_modules/@braintree/sanitize-url/dist/index.cjs +1 -1
- package/dist/node_modules/@braintree/sanitize-url/dist/index.es.js +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 +34 -49
- 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 +1 -5
- 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 +206 -220
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.es.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/primitive/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/primitive/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/primitive/dist/index.es.js +50 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/primitive/dist/index.es.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-compose-refs/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-compose-refs/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-compose-refs/dist/index.es.js +34 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-compose-refs/dist/index.es.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-context/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-context/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-context/dist/index.es.js +82 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-context/dist/index.es.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/dist/index.es.js +216 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/dist/index.es.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-id/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-id/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-id/dist/index.es.js +15 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-id/dist/index.es.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-portal/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-portal/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-portal/dist/index.es.js +18 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-portal/dist/index.es.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-presence/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-presence/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-presence/dist/index.es.js +104 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-presence/dist/index.es.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-primitive/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-primitive/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-primitive/dist/index.es.js +39 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-primitive/dist/index.es.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-callback-ref/dist/index.es.js +13 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-callback-ref/dist/index.es.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-controllable-state/dist/index.es.js +70 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-controllable-state/dist/index.es.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-effect-event/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-effect-event/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-effect-event/dist/index.es.js +20 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-effect-event/dist/index.es.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-layout-effect/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-layout-effect/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-layout-effect/dist/index.es.js +7 -0
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-layout-effect/dist/index.es.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.es.js +18 -9
- package/dist/node_modules/@radix-ui/react-focus-guards/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 +148 -100
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.es.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-compose-refs/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-compose-refs/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-compose-refs/dist/index.es.js +34 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-compose-refs/dist/index.es.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-primitive/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-primitive/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-primitive/dist/index.es.js +39 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-primitive/dist/index.es.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-use-callback-ref/dist/index.es.js +13 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-use-callback-ref/dist/index.es.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-id/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-id/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-id/dist/index.es.js +8 -8
- package/dist/node_modules/@radix-ui/react-id/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 +1 -1
- package/dist/node_modules/@radix-ui/react-primitive/node_modules/@radix-ui/react-slot/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-primitive/node_modules/@radix-ui/react-slot/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-primitive/node_modules/@radix-ui/react-slot/dist/index.es.js +50 -0
- package/dist/node_modules/@radix-ui/react-primitive/node_modules/@radix-ui/react-slot/dist/index.es.js.map +1 -0
- 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 +80 -41
- package/dist/node_modules/@radix-ui/react-slot/dist/index.es.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-slot/node_modules/@radix-ui/react-compose-refs/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-slot/node_modules/@radix-ui/react-compose-refs/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-slot/node_modules/@radix-ui/react-compose-refs/dist/index.es.js +34 -0
- package/dist/node_modules/@radix-ui/react-slot/node_modules/@radix-ui/react-compose-refs/dist/index.es.js.map +1 -0
- 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 +1 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.es.js +12 -0
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.es.js.map +1 -0
- package/dist/node_modules/classnames/index.cjs +1 -1
- package/dist/node_modules/classnames/index.es.js +1 -1
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.cjs +1 -1
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-5PPSVZJV.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/c4Diagram-5PPSVZJV.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-2GRJ4B5K.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-2GRJ4B5K.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-NSK5VX7P.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-NSK5VX7P.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/classDiagram-JCYQIIEL.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/classDiagram-JCYQIIEL.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/classDiagram-v2-OCEON4UE.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/classDiagram-v2-OCEON4UE.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/flowDiagram-UKHOOZJN.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/flowDiagram-UKHOOZJN.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-PKOTCBZU.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ganttDiagram-PKOTCBZU.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-SI44F4Z6.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-SI44F4Z6.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-OKZ733FA.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-OKZ733FA.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-v2-UEYNNEHI.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/stateDiagram-v2-UEYNNEHI.es.js +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/swimlanesDiagram-ULZ7WXOC.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/swimlanesDiagram-ULZ7WXOC.es.js +1 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.cjs +2 -2
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.cjs.map +1 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.es.js +75 -72
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.es.js.map +1 -1
- package/package.json +10 -10
- package/dist/components/MarkdownFlowEditor/components/CustomPopover.cjs +0 -2
- package/dist/components/MarkdownFlowEditor/components/CustomPopover.cjs.map +0 -1
- package/dist/components/MarkdownFlowEditor/components/CustomPopover.d.ts +0 -17
- package/dist/components/MarkdownFlowEditor/components/CustomPopover.es.js +0 -46
- package/dist/components/MarkdownFlowEditor/components/CustomPopover.es.js.map +0 -1
- package/dist/components/MarkdownFlowEditor/components/VariableSearchDropdown.cjs +0 -2
- package/dist/components/MarkdownFlowEditor/components/VariableSearchDropdown.cjs.map +0 -1
- package/dist/components/MarkdownFlowEditor/components/VariableSearchDropdown.d.ts +0 -18
- package/dist/components/MarkdownFlowEditor/components/VariableSearchDropdown.es.js +0 -184
- package/dist/components/MarkdownFlowEditor/components/VariableSearchDropdown.es.js.map +0 -1
- package/dist/components/MarkdownFlowEditor/components/VariableSelect.cjs +0 -2
- package/dist/components/MarkdownFlowEditor/components/VariableSelect.cjs.map +0 -1
- package/dist/components/MarkdownFlowEditor/components/VariableSelect.d.ts +0 -11
- package/dist/components/MarkdownFlowEditor/components/VariableSelect.es.js +0 -172
- package/dist/components/MarkdownFlowEditor/components/VariableSelect.es.js.map +0 -1
- package/dist/components/MarkdownFlowEditor/components/icons/SearchBracesIcon.cjs +0 -2
- package/dist/components/MarkdownFlowEditor/components/icons/SearchBracesIcon.cjs.map +0 -1
- package/dist/components/MarkdownFlowEditor/components/icons/SearchBracesIcon.d.ts +0 -3
- package/dist/components/MarkdownFlowEditor/components/icons/SearchBracesIcon.es.js +0 -32
- package/dist/components/MarkdownFlowEditor/components/icons/SearchBracesIcon.es.js.map +0 -1
- package/dist/components/MarkdownFlowEditor/plugins/VariablePlaceholder.cjs +0 -3
- package/dist/components/MarkdownFlowEditor/plugins/VariablePlaceholder.cjs.map +0 -1
- package/dist/components/MarkdownFlowEditor/plugins/VariablePlaceholder.d.ts +0 -9
- package/dist/components/MarkdownFlowEditor/plugins/VariablePlaceholder.es.js +0 -53
- package/dist/components/MarkdownFlowEditor/plugins/VariablePlaceholder.es.js.map +0 -1
- package/dist/components/ui/popover.cjs +0 -2
- package/dist/components/ui/popover.cjs.map +0 -1
- package/dist/components/ui/popover.es.js +0 -24
- package/dist/components/ui/popover.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-popover/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-popover/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-popover/dist/index.es.js +0 -241
- package/dist/node_modules/@radix-ui/react-popover/dist/index.es.js.map +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/braces.cjs +0 -7
- package/dist/node_modules/lucide-react/dist/esm/icons/braces.cjs.map +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/braces.es.js +0 -25
- package/dist/node_modules/lucide-react/dist/esm/icons/braces.es.js.map +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/plus.cjs +0 -7
- package/dist/node_modules/lucide-react/dist/esm/icons/plus.cjs.map +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/plus.es.js +0 -16
- package/dist/node_modules/lucide-react/dist/esm/icons/plus.es.js.map +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/search.cjs +0 -7
- package/dist/node_modules/lucide-react/dist/esm/icons/search.cjs.map +0 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/search.es.js +0 -16
- package/dist/node_modules/lucide-react/dist/esm/icons/search.es.js.map +0 -1
- /package/dist/components/MarkdownFlowEditor/plugins/{VariablePlaceholder.test.d.ts → MediaPlaceholder.variables.test.d.ts} +0 -0
|
@@ -1,113 +1,116 @@
|
|
|
1
|
-
import { __spreadArray as
|
|
1
|
+
import { __spreadArray as N } from "../../../tslib/tslib.es6.es.js";
|
|
2
2
|
import * as n from "react";
|
|
3
|
-
import { RemoveScrollBar as
|
|
4
|
-
import { styleSingleton as
|
|
3
|
+
import { RemoveScrollBar as W } from "../../../react-remove-scroll-bar/dist/es2015/component.es.js";
|
|
4
|
+
import { styleSingleton as F } from "../../../react-style-singleton/dist/es2015/component.es.js";
|
|
5
5
|
import { nonPassive as s } from "./aggresiveCapture.es.js";
|
|
6
|
-
import { locationCouldBeScrolled as
|
|
7
|
-
var
|
|
8
|
-
return "changedTouches" in
|
|
9
|
-
},
|
|
10
|
-
return [
|
|
11
|
-
},
|
|
12
|
-
return
|
|
13
|
-
},
|
|
14
|
-
return
|
|
15
|
-
},
|
|
6
|
+
import { locationCouldBeScrolled as B, handleScroll as K } from "./handleScroll.es.js";
|
|
7
|
+
var k = function(e) {
|
|
8
|
+
return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
|
|
9
|
+
}, M = function(e) {
|
|
10
|
+
return [e.deltaX, e.deltaY];
|
|
11
|
+
}, X = function(e) {
|
|
12
|
+
return e && "current" in e ? e.current : e;
|
|
13
|
+
}, O = function(e, c) {
|
|
14
|
+
return e[0] === c[0] && e[1] === c[1];
|
|
15
|
+
}, Q = function(e) {
|
|
16
16
|
return `
|
|
17
|
-
.block-interactivity-`.concat(
|
|
18
|
-
.allow-interactivity-`).concat(
|
|
17
|
+
.block-interactivity-`.concat(e, ` {pointer-events: none;}
|
|
18
|
+
.allow-interactivity-`).concat(e, ` {pointer-events: all;}
|
|
19
19
|
`);
|
|
20
|
-
},
|
|
21
|
-
function
|
|
22
|
-
var c = n.useRef([]),
|
|
20
|
+
}, Z = 0, f = [];
|
|
21
|
+
function J(e) {
|
|
22
|
+
var c = n.useRef([]), R = n.useRef([0, 0]), m = n.useRef(), h = n.useState(Z++)[0], g = n.useState(F)[0], S = n.useRef(e);
|
|
23
23
|
n.useEffect(function() {
|
|
24
|
-
|
|
25
|
-
}, [
|
|
26
|
-
if (
|
|
24
|
+
S.current = e;
|
|
25
|
+
}, [e]), n.useEffect(function() {
|
|
26
|
+
if (e.inert) {
|
|
27
27
|
document.body.classList.add("block-interactivity-".concat(h));
|
|
28
|
-
var
|
|
29
|
-
return
|
|
28
|
+
var t = N([e.lockRef.current], (e.shards || []).map(X), !0).filter(Boolean);
|
|
29
|
+
return t.forEach(function(r) {
|
|
30
30
|
return r.classList.add("allow-interactivity-".concat(h));
|
|
31
31
|
}), function() {
|
|
32
|
-
document.body.classList.remove("block-interactivity-".concat(h)),
|
|
32
|
+
document.body.classList.remove("block-interactivity-".concat(h)), t.forEach(function(r) {
|
|
33
33
|
return r.classList.remove("allow-interactivity-".concat(h));
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
}, [
|
|
38
|
-
var
|
|
39
|
-
if ("touches" in
|
|
40
|
-
return !
|
|
41
|
-
var l =
|
|
42
|
-
if ("touches" in
|
|
37
|
+
}, [e.inert, e.lockRef.current, e.shards]);
|
|
38
|
+
var C = n.useCallback(function(t, r) {
|
|
39
|
+
if ("touches" in t && t.touches.length === 2 || t.type === "wheel" && t.ctrlKey)
|
|
40
|
+
return !S.current.allowPinchZoom;
|
|
41
|
+
var l = k(t), u = R.current, o = "deltaX" in t ? t.deltaX : u[0] - l[0], i = "deltaY" in t ? t.deltaY : u[1] - l[1], a, v = t.target, d = Math.abs(o) > Math.abs(i) ? "h" : "v";
|
|
42
|
+
if ("touches" in t && d === "h" && v.type === "range")
|
|
43
43
|
return !1;
|
|
44
|
-
var
|
|
45
|
-
if (
|
|
44
|
+
var P = window.getSelection(), E = P && P.anchorNode, I = E ? E === v || E.contains(v) : !1;
|
|
45
|
+
if (I)
|
|
46
|
+
return !1;
|
|
47
|
+
var b = B(d, v);
|
|
48
|
+
if (!b)
|
|
46
49
|
return !0;
|
|
47
|
-
if (
|
|
50
|
+
if (b ? a = d : (a = d === "v" ? "h" : "v", b = B(d, v)), !b)
|
|
48
51
|
return !1;
|
|
49
|
-
if (!
|
|
52
|
+
if (!m.current && "changedTouches" in t && (o || i) && (m.current = a), !a)
|
|
50
53
|
return !0;
|
|
51
|
-
var
|
|
52
|
-
return
|
|
53
|
-
}, []),
|
|
54
|
-
var r =
|
|
55
|
-
if (!(!f.length || f[f.length - 1] !==
|
|
56
|
-
var l = "deltaY" in r ?
|
|
57
|
-
return a.name === r.type && (a.target === r.target || r.target === a.shadowParent) &&
|
|
54
|
+
var Y = m.current || a;
|
|
55
|
+
return K(Y, r, t, Y === "h" ? o : i);
|
|
56
|
+
}, []), y = n.useCallback(function(t) {
|
|
57
|
+
var r = t;
|
|
58
|
+
if (!(!f.length || f[f.length - 1] !== g)) {
|
|
59
|
+
var l = "deltaY" in r ? M(r) : k(r), u = c.current.filter(function(a) {
|
|
60
|
+
return a.name === r.type && (a.target === r.target || r.target === a.shadowParent) && O(a.delta, l);
|
|
58
61
|
})[0];
|
|
59
|
-
if (
|
|
62
|
+
if (u && u.should) {
|
|
60
63
|
r.cancelable && r.preventDefault();
|
|
61
64
|
return;
|
|
62
65
|
}
|
|
63
|
-
if (!
|
|
64
|
-
var
|
|
66
|
+
if (!u) {
|
|
67
|
+
var o = (S.current.shards || []).map(X).filter(Boolean).filter(function(a) {
|
|
65
68
|
return a.contains(r.target);
|
|
66
|
-
}), i =
|
|
69
|
+
}), i = o.length > 0 ? C(r, o[0]) : !S.current.noIsolation;
|
|
67
70
|
i && r.cancelable && r.preventDefault();
|
|
68
71
|
}
|
|
69
72
|
}
|
|
70
|
-
}, []),
|
|
71
|
-
var
|
|
72
|
-
c.current.push(
|
|
73
|
+
}, []), w = n.useCallback(function(t, r, l, u) {
|
|
74
|
+
var o = { name: t, delta: r, target: l, should: u, shadowParent: _(l) };
|
|
75
|
+
c.current.push(o), setTimeout(function() {
|
|
73
76
|
c.current = c.current.filter(function(i) {
|
|
74
|
-
return i !==
|
|
77
|
+
return i !== o;
|
|
75
78
|
});
|
|
76
79
|
}, 1);
|
|
77
|
-
}, []),
|
|
78
|
-
|
|
79
|
-
}, []),
|
|
80
|
-
|
|
81
|
-
}, []),
|
|
82
|
-
|
|
80
|
+
}, []), L = n.useCallback(function(t) {
|
|
81
|
+
R.current = k(t), m.current = void 0;
|
|
82
|
+
}, []), T = n.useCallback(function(t) {
|
|
83
|
+
w(t.type, M(t), t.target, C(t, e.lockRef.current));
|
|
84
|
+
}, []), D = n.useCallback(function(t) {
|
|
85
|
+
w(t.type, k(t), t.target, C(t, e.lockRef.current));
|
|
83
86
|
}, []);
|
|
84
87
|
n.useEffect(function() {
|
|
85
|
-
return f.push(
|
|
86
|
-
onScrollCapture:
|
|
87
|
-
onWheelCapture:
|
|
88
|
-
onTouchMoveCapture:
|
|
89
|
-
}), document.addEventListener("wheel",
|
|
90
|
-
f = f.filter(function(
|
|
91
|
-
return
|
|
92
|
-
}), document.removeEventListener("wheel",
|
|
88
|
+
return f.push(g), e.setCallbacks({
|
|
89
|
+
onScrollCapture: T,
|
|
90
|
+
onWheelCapture: T,
|
|
91
|
+
onTouchMoveCapture: D
|
|
92
|
+
}), document.addEventListener("wheel", y, s), document.addEventListener("touchmove", y, s), document.addEventListener("touchstart", L, s), function() {
|
|
93
|
+
f = f.filter(function(t) {
|
|
94
|
+
return t !== g;
|
|
95
|
+
}), document.removeEventListener("wheel", y, s), document.removeEventListener("touchmove", y, s), document.removeEventListener("touchstart", L, s);
|
|
93
96
|
};
|
|
94
97
|
}, []);
|
|
95
|
-
var
|
|
98
|
+
var x = e.removeScrollBar, A = e.inert;
|
|
96
99
|
return n.createElement(
|
|
97
100
|
n.Fragment,
|
|
98
101
|
null,
|
|
99
|
-
|
|
100
|
-
|
|
102
|
+
A ? n.createElement(g, { styles: Q(h) }) : null,
|
|
103
|
+
x ? n.createElement(W, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
|
|
101
104
|
);
|
|
102
105
|
}
|
|
103
|
-
function
|
|
104
|
-
for (var c = null;
|
|
105
|
-
|
|
106
|
+
function _(e) {
|
|
107
|
+
for (var c = null; e !== null; )
|
|
108
|
+
e instanceof ShadowRoot && (c = e.host, e = e.host), e = e.parentNode;
|
|
106
109
|
return c;
|
|
107
110
|
}
|
|
108
111
|
export {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
+
J as RemoveScrollSideCar,
|
|
113
|
+
M as getDeltaXY,
|
|
114
|
+
k as getTouchXY
|
|
112
115
|
};
|
|
113
116
|
//# sourceMappingURL=SideEffect.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SideEffect.es.js","sources":["../../../../../node_modules/react-remove-scroll/dist/es2015/SideEffect.js"],"sourcesContent":["import { __spreadArray } from \"tslib\";\nimport * as React from 'react';\nimport { RemoveScrollBar } from 'react-remove-scroll-bar';\nimport { styleSingleton } from 'react-style-singleton';\nimport { nonPassive } from './aggresiveCapture';\nimport { handleScroll, locationCouldBeScrolled } from './handleScroll';\nexport var getTouchXY = function (event) {\n return 'changedTouches' in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];\n};\nexport var getDeltaXY = function (event) { return [event.deltaX, event.deltaY]; };\nvar extractRef = function (ref) {\n return ref && 'current' in ref ? ref.current : ref;\n};\nvar deltaCompare = function (x, y) { return x[0] === y[0] && x[1] === y[1]; };\nvar generateStyle = function (id) { return \"\\n .block-interactivity-\".concat(id, \" {pointer-events: none;}\\n .allow-interactivity-\").concat(id, \" {pointer-events: all;}\\n\"); };\nvar idCounter = 0;\nvar lockStack = [];\nexport function RemoveScrollSideCar(props) {\n var shouldPreventQueue = React.useRef([]);\n var touchStartRef = React.useRef([0, 0]);\n var activeAxis = React.useRef();\n var id = React.useState(idCounter++)[0];\n var Style = React.useState(styleSingleton)[0];\n var lastProps = React.useRef(props);\n React.useEffect(function () {\n lastProps.current = props;\n }, [props]);\n React.useEffect(function () {\n if (props.inert) {\n document.body.classList.add(\"block-interactivity-\".concat(id));\n var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);\n allow_1.forEach(function (el) { return el.classList.add(\"allow-interactivity-\".concat(id)); });\n return function () {\n document.body.classList.remove(\"block-interactivity-\".concat(id));\n allow_1.forEach(function (el) { return el.classList.remove(\"allow-interactivity-\".concat(id)); });\n };\n }\n return;\n }, [props.inert, props.lockRef.current, props.shards]);\n var shouldCancelEvent = React.useCallback(function (event, parent) {\n if (('touches' in event && event.touches.length === 2) || (event.type === 'wheel' && event.ctrlKey)) {\n return !lastProps.current.allowPinchZoom;\n }\n var touch = getTouchXY(event);\n var touchStart = touchStartRef.current;\n var deltaX = 'deltaX' in event ? event.deltaX : touchStart[0] - touch[0];\n var deltaY = 'deltaY' in event ? event.deltaY : touchStart[1] - touch[1];\n var currentAxis;\n var target = event.target;\n var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? 'h' : 'v';\n // allow horizontal touch move on Range inputs. They will not cause any scroll\n if ('touches' in event && moveDirection === 'h' && target.type === 'range') {\n return false;\n }\n var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);\n if (!canBeScrolledInMainDirection) {\n return true;\n }\n if (canBeScrolledInMainDirection) {\n currentAxis = moveDirection;\n }\n else {\n currentAxis = moveDirection === 'v' ? 'h' : 'v';\n canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);\n // other axis might be not scrollable\n }\n if (!canBeScrolledInMainDirection) {\n return false;\n }\n if (!activeAxis.current && 'changedTouches' in event && (deltaX || deltaY)) {\n activeAxis.current = currentAxis;\n }\n if (!currentAxis) {\n return true;\n }\n var cancelingAxis = activeAxis.current || currentAxis;\n return handleScroll(cancelingAxis, parent, event, cancelingAxis === 'h' ? deltaX : deltaY, true);\n }, []);\n var shouldPrevent = React.useCallback(function (_event) {\n var event = _event;\n if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) {\n // not the last active\n return;\n }\n var delta = 'deltaY' in event ? getDeltaXY(event) : getTouchXY(event);\n var sourceEvent = shouldPreventQueue.current.filter(function (e) { return e.name === event.type && (e.target === event.target || event.target === e.shadowParent) && deltaCompare(e.delta, delta); })[0];\n // self event, and should be canceled\n if (sourceEvent && sourceEvent.should) {\n if (event.cancelable) {\n event.preventDefault();\n }\n return;\n }\n // outside or shard event\n if (!sourceEvent) {\n var shardNodes = (lastProps.current.shards || [])\n .map(extractRef)\n .filter(Boolean)\n .filter(function (node) { return node.contains(event.target); });\n var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;\n if (shouldStop) {\n if (event.cancelable) {\n event.preventDefault();\n }\n }\n }\n }, []);\n var shouldCancel = React.useCallback(function (name, delta, target, should) {\n var event = { name: name, delta: delta, target: target, should: should, shadowParent: getOutermostShadowParent(target) };\n shouldPreventQueue.current.push(event);\n setTimeout(function () {\n shouldPreventQueue.current = shouldPreventQueue.current.filter(function (e) { return e !== event; });\n }, 1);\n }, []);\n var scrollTouchStart = React.useCallback(function (event) {\n touchStartRef.current = getTouchXY(event);\n activeAxis.current = undefined;\n }, []);\n var scrollWheel = React.useCallback(function (event) {\n shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));\n }, []);\n var scrollTouchMove = React.useCallback(function (event) {\n shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));\n }, []);\n React.useEffect(function () {\n lockStack.push(Style);\n props.setCallbacks({\n onScrollCapture: scrollWheel,\n onWheelCapture: scrollWheel,\n onTouchMoveCapture: scrollTouchMove,\n });\n document.addEventListener('wheel', shouldPrevent, nonPassive);\n document.addEventListener('touchmove', shouldPrevent, nonPassive);\n document.addEventListener('touchstart', scrollTouchStart, nonPassive);\n return function () {\n lockStack = lockStack.filter(function (inst) { return inst !== Style; });\n document.removeEventListener('wheel', shouldPrevent, nonPassive);\n document.removeEventListener('touchmove', shouldPrevent, nonPassive);\n document.removeEventListener('touchstart', scrollTouchStart, nonPassive);\n };\n }, []);\n var removeScrollBar = props.removeScrollBar, inert = props.inert;\n return (React.createElement(React.Fragment, null,\n inert ? React.createElement(Style, { styles: generateStyle(id) }) : null,\n removeScrollBar ? React.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null));\n}\nfunction getOutermostShadowParent(node) {\n var shadowParent = null;\n while (node !== null) {\n if (node instanceof ShadowRoot) {\n shadowParent = node.host;\n node = node.host;\n }\n node = node.parentNode;\n }\n return shadowParent;\n}\n"],"names":["getTouchXY","event","getDeltaXY","extractRef","ref","deltaCompare","x","y","generateStyle","id","idCounter","lockStack","RemoveScrollSideCar","props","shouldPreventQueue","React","touchStartRef","activeAxis","Style","styleSingleton","lastProps","allow_1","__spreadArray","el","shouldCancelEvent","parent","touch","touchStart","deltaX","deltaY","currentAxis","target","moveDirection","canBeScrolledInMainDirection","locationCouldBeScrolled","cancelingAxis","handleScroll","shouldPrevent","_event","delta","sourceEvent","e","shardNodes","node","shouldStop","shouldCancel","name","should","getOutermostShadowParent","scrollTouchStart","scrollWheel","scrollTouchMove","nonPassive","inst","removeScrollBar","inert","RemoveScrollBar","shadowParent"],"mappings":";;;;;;AAMU,IAACA,IAAa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AiB0C,IAAQ1C,EAAM;AAC3D,SAAQE,EAAM;AAAA,IAAcA,EAAM;AAAA,IAAU;AAAA,IACxCwC,IAAQxC,EAAM,cAAcG,GAAO,EAAE,QAAQV,EAAcC,CAAE,EAAC,CAAE,IAAI;AAAA,IACpE6C,IAAkBvC,EAAM,cAAcyC,GAAiB,EAAE,YAAY3C,EAAM,YAAY,SAASA,EAAM,QAAO,CAAE,IAAI;AAAA,EAAI;AAC/H;AACA,SAASmC,EAAyBL,GAAM;AAEpC,WADIc,IAAe,MACZd,MAAS;AACZ,IAAIA,aAAgB,eAChBc,IAAed,EAAK,MACpBA,IAAOA,EAAK,OAEhBA,IAAOA,EAAK;AAEhB,SAAOc;AACX;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"SideEffect.es.js","sources":["../../../../../node_modules/react-remove-scroll/dist/es2015/SideEffect.js"],"sourcesContent":["import { __spreadArray } from \"tslib\";\nimport * as React from 'react';\nimport { RemoveScrollBar } from 'react-remove-scroll-bar';\nimport { styleSingleton } from 'react-style-singleton';\nimport { nonPassive } from './aggresiveCapture';\nimport { handleScroll, locationCouldBeScrolled } from './handleScroll';\nexport var getTouchXY = function (event) {\n return 'changedTouches' in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];\n};\nexport var getDeltaXY = function (event) { return [event.deltaX, event.deltaY]; };\nvar extractRef = function (ref) {\n return ref && 'current' in ref ? ref.current : ref;\n};\nvar deltaCompare = function (x, y) { return x[0] === y[0] && x[1] === y[1]; };\nvar generateStyle = function (id) { return \"\\n .block-interactivity-\".concat(id, \" {pointer-events: none;}\\n .allow-interactivity-\").concat(id, \" {pointer-events: all;}\\n\"); };\nvar idCounter = 0;\nvar lockStack = [];\nexport function RemoveScrollSideCar(props) {\n var shouldPreventQueue = React.useRef([]);\n var touchStartRef = React.useRef([0, 0]);\n var activeAxis = React.useRef();\n var id = React.useState(idCounter++)[0];\n var Style = React.useState(styleSingleton)[0];\n var lastProps = React.useRef(props);\n React.useEffect(function () {\n lastProps.current = props;\n }, [props]);\n React.useEffect(function () {\n if (props.inert) {\n document.body.classList.add(\"block-interactivity-\".concat(id));\n var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);\n allow_1.forEach(function (el) { return el.classList.add(\"allow-interactivity-\".concat(id)); });\n return function () {\n document.body.classList.remove(\"block-interactivity-\".concat(id));\n allow_1.forEach(function (el) { return el.classList.remove(\"allow-interactivity-\".concat(id)); });\n };\n }\n return;\n }, [props.inert, props.lockRef.current, props.shards]);\n var shouldCancelEvent = React.useCallback(function (event, parent) {\n if (('touches' in event && event.touches.length === 2) || (event.type === 'wheel' && event.ctrlKey)) {\n return !lastProps.current.allowPinchZoom;\n }\n var touch = getTouchXY(event);\n var touchStart = touchStartRef.current;\n var deltaX = 'deltaX' in event ? event.deltaX : touchStart[0] - touch[0];\n var deltaY = 'deltaY' in event ? event.deltaY : touchStart[1] - touch[1];\n var currentAxis;\n var target = event.target;\n var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? 'h' : 'v';\n // allow horizontal touch move on Range inputs. They will not cause any scroll\n if ('touches' in event && moveDirection === 'h' && target.type === 'range') {\n return false;\n }\n // allow drag selection (iOS); check if selection's anchorNode is the same as target or contains target\n var selection = window.getSelection();\n var anchorNode = selection && selection.anchorNode;\n var isTouchingSelection = anchorNode ? anchorNode === target || anchorNode.contains(target) : false;\n if (isTouchingSelection) {\n return false;\n }\n var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);\n if (!canBeScrolledInMainDirection) {\n return true;\n }\n if (canBeScrolledInMainDirection) {\n currentAxis = moveDirection;\n }\n else {\n currentAxis = moveDirection === 'v' ? 'h' : 'v';\n canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);\n // other axis might be not scrollable\n }\n if (!canBeScrolledInMainDirection) {\n return false;\n }\n if (!activeAxis.current && 'changedTouches' in event && (deltaX || deltaY)) {\n activeAxis.current = currentAxis;\n }\n if (!currentAxis) {\n return true;\n }\n var cancelingAxis = activeAxis.current || currentAxis;\n return handleScroll(cancelingAxis, parent, event, cancelingAxis === 'h' ? deltaX : deltaY, true);\n }, []);\n var shouldPrevent = React.useCallback(function (_event) {\n var event = _event;\n if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) {\n // not the last active\n return;\n }\n var delta = 'deltaY' in event ? getDeltaXY(event) : getTouchXY(event);\n var sourceEvent = shouldPreventQueue.current.filter(function (e) { return e.name === event.type && (e.target === event.target || event.target === e.shadowParent) && deltaCompare(e.delta, delta); })[0];\n // self event, and should be canceled\n if (sourceEvent && sourceEvent.should) {\n if (event.cancelable) {\n event.preventDefault();\n }\n return;\n }\n // outside or shard event\n if (!sourceEvent) {\n var shardNodes = (lastProps.current.shards || [])\n .map(extractRef)\n .filter(Boolean)\n .filter(function (node) { return node.contains(event.target); });\n var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;\n if (shouldStop) {\n if (event.cancelable) {\n event.preventDefault();\n }\n }\n }\n }, []);\n var shouldCancel = React.useCallback(function (name, delta, target, should) {\n var event = { name: name, delta: delta, target: target, should: should, shadowParent: getOutermostShadowParent(target) };\n shouldPreventQueue.current.push(event);\n setTimeout(function () {\n shouldPreventQueue.current = shouldPreventQueue.current.filter(function (e) { return e !== event; });\n }, 1);\n }, []);\n var scrollTouchStart = React.useCallback(function (event) {\n touchStartRef.current = getTouchXY(event);\n activeAxis.current = undefined;\n }, []);\n var scrollWheel = React.useCallback(function (event) {\n shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));\n }, []);\n var scrollTouchMove = React.useCallback(function (event) {\n shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));\n }, []);\n React.useEffect(function () {\n lockStack.push(Style);\n props.setCallbacks({\n onScrollCapture: scrollWheel,\n onWheelCapture: scrollWheel,\n onTouchMoveCapture: scrollTouchMove,\n });\n document.addEventListener('wheel', shouldPrevent, nonPassive);\n document.addEventListener('touchmove', shouldPrevent, nonPassive);\n document.addEventListener('touchstart', scrollTouchStart, nonPassive);\n return function () {\n lockStack = lockStack.filter(function (inst) { return inst !== Style; });\n document.removeEventListener('wheel', shouldPrevent, nonPassive);\n document.removeEventListener('touchmove', shouldPrevent, nonPassive);\n document.removeEventListener('touchstart', scrollTouchStart, nonPassive);\n };\n }, []);\n var removeScrollBar = props.removeScrollBar, inert = props.inert;\n return (React.createElement(React.Fragment, null,\n inert ? React.createElement(Style, { styles: generateStyle(id) }) : null,\n removeScrollBar ? React.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null));\n}\nfunction getOutermostShadowParent(node) {\n var shadowParent = null;\n while (node !== null) {\n if (node instanceof ShadowRoot) {\n shadowParent = node.host;\n node = node.host;\n }\n node = node.parentNode;\n }\n return shadowParent;\n}\n"],"names":["getTouchXY","event","getDeltaXY","extractRef","ref","deltaCompare","x","y","generateStyle","id","idCounter","lockStack","RemoveScrollSideCar","props","shouldPreventQueue","React","touchStartRef","activeAxis","Style","styleSingleton","lastProps","allow_1","__spreadArray","el","shouldCancelEvent","parent","touch","touchStart","deltaX","deltaY","currentAxis","target","moveDirection","selection","anchorNode","isTouchingSelection","canBeScrolledInMainDirection","locationCouldBeScrolled","cancelingAxis","handleScroll","shouldPrevent","_event","delta","sourceEvent","e","shardNodes","node","shouldStop","shouldCancel","name","should","getOutermostShadowParent","scrollTouchStart","scrollWheel","scrollTouchMove","nonPassive","inst","removeScrollBar","inert","RemoveScrollBar","shadowParent"],"mappings":";;;;;;AAMU,IAACA,IAAa,SAAUC,GAAO;AACrC,SAAO,oBAAoBA,IAAQ,CAACA,EAAM,eAAe,CAAC,EAAE,SAASA,EAAM,eAAe,CAAC,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC;AACjH,GACWC,IAAa,SAAUD,GAAO;AAAE,SAAO,CAACA,EAAM,QAAQA,EAAM,MAAM;AAAG,GAC5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;AAAA,IACxC2C,IAAQ3C,EAAM,cAAcG,GAAO,EAAE,QAAQV,EAAcC,CAAE,EAAC,CAAE,IAAI;AAAA,IACpEgD,IAAkB1C,EAAM,cAAc4C,GAAiB,EAAE,YAAY9C,EAAM,YAAY,SAASA,EAAM,QAAO,CAAE,IAAI;AAAA,EAAI;AAC/H;AACA,SAASsC,EAAyBL,GAAM;AAEpC,WADIc,IAAe,MACZd,MAAS;AACZ,IAAIA,aAAgB,eAChBc,IAAed,EAAK,MACpBA,IAAOA,EAAK,OAEhBA,IAAOA,EAAK;AAEhB,SAAOc;AACX;","x_google_ignoreList":[0]}
|
package/package.json
CHANGED
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"@codemirror/view": "^6.38.1",
|
|
18
18
|
"@fontsource/inter": "^5.2.8",
|
|
19
19
|
"@microsoft/fetch-event-source": "^2.0.1",
|
|
20
|
-
"@radix-ui/react-dialog": "1.
|
|
21
|
-
"@radix-ui/react-popover": "1.
|
|
22
|
-
"@radix-ui/react-slot": "1.
|
|
20
|
+
"@radix-ui/react-dialog": "1.2.0",
|
|
21
|
+
"@radix-ui/react-popover": "1.2.0",
|
|
22
|
+
"@radix-ui/react-slot": "1.4.0",
|
|
23
23
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
24
24
|
"@types/hast": "^3.0.4",
|
|
25
25
|
"@types/mdast": "^4.0.4",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@storybook/nextjs-vite": "^9.0.16",
|
|
68
68
|
"@tailwindcss/cli": "^4.1.11",
|
|
69
69
|
"@tailwindcss/postcss": "^4",
|
|
70
|
-
"@testing-library/react": "16.3.
|
|
70
|
+
"@testing-library/react": "16.3.3",
|
|
71
71
|
"@types/node": "^20",
|
|
72
72
|
"@types/react": "^19",
|
|
73
73
|
"@types/react-dom": "^19",
|
|
@@ -82,16 +82,16 @@
|
|
|
82
82
|
"eslint-config-prettier": "^10.1.8",
|
|
83
83
|
"eslint-plugin-prettier": "^5.5.4",
|
|
84
84
|
"eslint-plugin-storybook": "^9.0.16",
|
|
85
|
-
"gsap": "3.
|
|
85
|
+
"gsap": "3.15.0",
|
|
86
86
|
"husky": "^9.1.7",
|
|
87
87
|
"jsdom": "26.1.0",
|
|
88
88
|
"lint-staged": "^16.1.6",
|
|
89
|
-
"markdownlint-cli": "^0.
|
|
89
|
+
"markdownlint-cli": "^0.49.1",
|
|
90
90
|
"next": "15.3.6",
|
|
91
91
|
"playwright": "^1.54.1",
|
|
92
|
-
"prettier": "
|
|
93
|
-
"react": "19.0
|
|
94
|
-
"react-dom": "19.0
|
|
92
|
+
"prettier": "3.9.9",
|
|
93
|
+
"react": "19.3.0",
|
|
94
|
+
"react-dom": "19.3.0",
|
|
95
95
|
"rollup": "^4.46.2",
|
|
96
96
|
"rollup-plugin-dts": "^6.2.1",
|
|
97
97
|
"standard-version": "^9.5.0",
|
|
@@ -196,7 +196,7 @@
|
|
|
196
196
|
]
|
|
197
197
|
}
|
|
198
198
|
},
|
|
199
|
-
"version": "0.3.2
|
|
199
|
+
"version": "0.3.2",
|
|
200
200
|
"type": "module",
|
|
201
201
|
"exports": {
|
|
202
202
|
".": {
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),l=require("react"),t=require("../../ui/popover.cjs"),c=require("../editor-context.cjs"),d=require("../../../lib/utils.cjs"),n=({children:s,className:i,dir:p,lang:u})=>{const{popoverOpen:r,setPopoverOpen:a,popoverPosition:e}=l.useContext(c.default);return!r||!e?null:o.jsxs(t.Popover,{open:r,onOpenChange:a,children:[o.jsx(t.PopoverAnchor,{style:{position:"fixed",left:`${e.x}px`,top:`${e.y}px`,width:0,height:0}}),o.jsx(t.PopoverContent,{className:d.cn("p-0 border-0 shadow-none bg-transparent w-auto",i),align:"start",dir:p,lang:u,sideOffset:5,children:s})]})};n.displayName="CustomPopover";exports.default=n;
|
|
2
|
-
//# sourceMappingURL=CustomPopover.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CustomPopover.cjs","sources":["../../../../src/components/MarkdownFlowEditor/components/CustomPopover.tsx"],"sourcesContent":["import React, { useContext } from \"react\";\nimport { Popover, PopoverContent, PopoverAnchor } from \"../../ui/popover\";\nimport EditorContext from \"../editor-context\";\nimport type { MarkdownFlowDirection } from \"../../../lib/locale\";\nimport { cn } from \"../../../lib/utils\";\n\ntype CustomPopoverProps = {\n children?: React.ReactNode;\n};\n\nexport interface CustomPopoverAllProps extends CustomPopoverProps {\n className?: string;\n /**\n * Sets \"ltr\" or \"rtl\" on the popover content, including its reading and layout direction.\n * When omitted, the content inherits direction from its portal container, not the trigger.\n */\n dir?: MarkdownFlowDirection;\n /** Language of the detached popover content. */\n lang?: string;\n}\n\nconst CustomPopover: React.FC<CustomPopoverAllProps> = ({\n children,\n className,\n dir,\n lang,\n}) => {\n const { popoverOpen, setPopoverOpen, popoverPosition } =\n useContext(EditorContext);\n\n if (!popoverOpen || !popoverPosition) {\n return null;\n }\n\n return (\n <Popover open={popoverOpen} onOpenChange={setPopoverOpen}>\n <PopoverAnchor\n style={{\n position: \"fixed\",\n left: `${popoverPosition.x}px`,\n top: `${popoverPosition.y}px`,\n width: 0,\n height: 0,\n }}\n />\n <PopoverContent\n className={cn(\n \"p-0 border-0 shadow-none bg-transparent w-auto\",\n className\n )}\n align=\"start\"\n dir={dir}\n lang={lang}\n sideOffset={5}\n >\n {children}\n </PopoverContent>\n </Popover>\n );\n};\n\nCustomPopover.displayName = \"CustomPopover\";\n\nexport default CustomPopover;\n"],"names":["CustomPopover","children","className","dir","lang","popoverOpen","setPopoverOpen","popoverPosition","useContext","EditorContext","jsxs","Popover","jsx","PopoverAnchor","PopoverContent","cn"],"mappings":"6QAqBMA,EAAiD,CAAC,CACtD,SAAAC,EACA,UAAAC,EACA,IAAAC,EACA,KAAAC,CACF,IAAM,CACJ,KAAM,CAAE,YAAAC,EAAa,eAAAC,EAAgB,gBAAAC,CAAA,EACnCC,EAAAA,WAAWC,EAAAA,OAAa,EAE1B,MAAI,CAACJ,GAAe,CAACE,EACZ,KAIPG,EAAAA,KAACC,EAAAA,QAAA,CAAQ,KAAMN,EAAa,aAAcC,EACxC,SAAA,CAAAM,EAAAA,IAACC,EAAAA,cAAA,CACC,MAAO,CACL,SAAU,QACV,KAAM,GAAGN,EAAgB,CAAC,KAC1B,IAAK,GAAGA,EAAgB,CAAC,KACzB,MAAO,EACP,OAAQ,CAAA,CACV,CAAA,EAEFK,EAAAA,IAACE,EAAAA,eAAA,CACC,UAAWC,EAAAA,GACT,iDACAb,CAAA,EAEF,MAAM,QACN,IAAAC,EACA,KAAAC,EACA,WAAY,EAEX,SAAAH,CAAA,CAAA,CACH,EACF,CAEJ,EAEAD,EAAc,YAAc"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { MarkdownFlowDirection } from '../../../lib/locale.js';
|
|
3
|
-
type CustomPopoverProps = {
|
|
4
|
-
children?: React.ReactNode;
|
|
5
|
-
};
|
|
6
|
-
export interface CustomPopoverAllProps extends CustomPopoverProps {
|
|
7
|
-
className?: string;
|
|
8
|
-
/**
|
|
9
|
-
* Sets "ltr" or "rtl" on the popover content, including its reading and layout direction.
|
|
10
|
-
* When omitted, the content inherits direction from its portal container, not the trigger.
|
|
11
|
-
*/
|
|
12
|
-
dir?: MarkdownFlowDirection;
|
|
13
|
-
/** Language of the detached popover content. */
|
|
14
|
-
lang?: string;
|
|
15
|
-
}
|
|
16
|
-
declare const CustomPopover: React.FC<CustomPopoverAllProps>;
|
|
17
|
-
export default CustomPopover;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { jsxs as m, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useContext as a } from "react";
|
|
3
|
-
import { Popover as f, PopoverAnchor as d, PopoverContent as l } from "../../ui/popover.es.js";
|
|
4
|
-
import x from "../editor-context.es.js";
|
|
5
|
-
import { cn as u } from "../../../lib/utils.es.js";
|
|
6
|
-
const v = ({
|
|
7
|
-
children: r,
|
|
8
|
-
className: p,
|
|
9
|
-
dir: n,
|
|
10
|
-
lang: s
|
|
11
|
-
}) => {
|
|
12
|
-
const { popoverOpen: e, setPopoverOpen: i, popoverPosition: o } = a(x);
|
|
13
|
-
return !e || !o ? null : /* @__PURE__ */ m(f, { open: e, onOpenChange: i, children: [
|
|
14
|
-
/* @__PURE__ */ t(
|
|
15
|
-
d,
|
|
16
|
-
{
|
|
17
|
-
style: {
|
|
18
|
-
position: "fixed",
|
|
19
|
-
left: `${o.x}px`,
|
|
20
|
-
top: `${o.y}px`,
|
|
21
|
-
width: 0,
|
|
22
|
-
height: 0
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
),
|
|
26
|
-
/* @__PURE__ */ t(
|
|
27
|
-
l,
|
|
28
|
-
{
|
|
29
|
-
className: u(
|
|
30
|
-
"p-0 border-0 shadow-none bg-transparent w-auto",
|
|
31
|
-
p
|
|
32
|
-
),
|
|
33
|
-
align: "start",
|
|
34
|
-
dir: n,
|
|
35
|
-
lang: s,
|
|
36
|
-
sideOffset: 5,
|
|
37
|
-
children: r
|
|
38
|
-
}
|
|
39
|
-
)
|
|
40
|
-
] });
|
|
41
|
-
};
|
|
42
|
-
v.displayName = "CustomPopover";
|
|
43
|
-
export {
|
|
44
|
-
v as default
|
|
45
|
-
};
|
|
46
|
-
//# sourceMappingURL=CustomPopover.es.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CustomPopover.es.js","sources":["../../../../src/components/MarkdownFlowEditor/components/CustomPopover.tsx"],"sourcesContent":["import React, { useContext } from \"react\";\nimport { Popover, PopoverContent, PopoverAnchor } from \"../../ui/popover\";\nimport EditorContext from \"../editor-context\";\nimport type { MarkdownFlowDirection } from \"../../../lib/locale\";\nimport { cn } from \"../../../lib/utils\";\n\ntype CustomPopoverProps = {\n children?: React.ReactNode;\n};\n\nexport interface CustomPopoverAllProps extends CustomPopoverProps {\n className?: string;\n /**\n * Sets \"ltr\" or \"rtl\" on the popover content, including its reading and layout direction.\n * When omitted, the content inherits direction from its portal container, not the trigger.\n */\n dir?: MarkdownFlowDirection;\n /** Language of the detached popover content. */\n lang?: string;\n}\n\nconst CustomPopover: React.FC<CustomPopoverAllProps> = ({\n children,\n className,\n dir,\n lang,\n}) => {\n const { popoverOpen, setPopoverOpen, popoverPosition } =\n useContext(EditorContext);\n\n if (!popoverOpen || !popoverPosition) {\n return null;\n }\n\n return (\n <Popover open={popoverOpen} onOpenChange={setPopoverOpen}>\n <PopoverAnchor\n style={{\n position: \"fixed\",\n left: `${popoverPosition.x}px`,\n top: `${popoverPosition.y}px`,\n width: 0,\n height: 0,\n }}\n />\n <PopoverContent\n className={cn(\n \"p-0 border-0 shadow-none bg-transparent w-auto\",\n className\n )}\n align=\"start\"\n dir={dir}\n lang={lang}\n sideOffset={5}\n >\n {children}\n </PopoverContent>\n </Popover>\n );\n};\n\nCustomPopover.displayName = \"CustomPopover\";\n\nexport default CustomPopover;\n"],"names":["CustomPopover","children","className","dir","lang","popoverOpen","setPopoverOpen","popoverPosition","useContext","EditorContext","jsxs","Popover","jsx","PopoverAnchor","PopoverContent","cn"],"mappings":";;;;;AAqBA,MAAMA,IAAiD,CAAC;AAAA,EACtD,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,KAAAC;AAAA,EACA,MAAAC;AACF,MAAM;AACJ,QAAM,EAAE,aAAAC,GAAa,gBAAAC,GAAgB,iBAAAC,EAAA,IACnCC,EAAWC,CAAa;AAE1B,SAAI,CAACJ,KAAe,CAACE,IACZ,OAIP,gBAAAG,EAACC,GAAA,EAAQ,MAAMN,GAAa,cAAcC,GACxC,UAAA;AAAA,IAAA,gBAAAM;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,OAAO;AAAA,UACL,UAAU;AAAA,UACV,MAAM,GAAGN,EAAgB,CAAC;AAAA,UAC1B,KAAK,GAAGA,EAAgB,CAAC;AAAA,UACzB,OAAO;AAAA,UACP,QAAQ;AAAA,QAAA;AAAA,MACV;AAAA,IAAA;AAAA,IAEF,gBAAAK;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,WAAWC;AAAA,UACT;AAAA,UACAb;AAAA,QAAA;AAAA,QAEF,OAAM;AAAA,QACN,KAAAC;AAAA,QACA,MAAAC;AAAA,QACA,YAAY;AAAA,QAEX,UAAAH;AAAA,MAAA;AAAA,IAAA;AAAA,EACH,GACF;AAEJ;AAEAD,EAAc,cAAc;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),a=require("react"),q=require("../../ui/input.cjs"),R=require("../../../lib/utils.cjs"),I=require("../../../node_modules/lucide-react/dist/esm/icons/search.cjs"),V=({open:u,anchorElement:r,onClose:l,onSelect:j,variables:N,systemVariables:L,labels:h})=>{const f=a.useRef(null),M=a.useRef(null),[k,D]=a.useState(""),[C,$]=a.useState({left:0,top:0}),[x,o]=a.useState(-1),v=a.useCallback(()=>{if(!r)return;const e=r.getBoundingClientRect(),t=r.ownerDocument,n=t.defaultView;if(!n)return;const c=f.current?.getBoundingClientRect().width??0,w=n.getComputedStyle(r).direction==="rtl"?e.right-c:e.left,b=Math.max(8,t.documentElement.clientWidth-c-8);$({left:Math.min(Math.max(8,w),b),top:e.bottom+8})},[r]);a.useEffect(()=>{if(!u){D(""),o(-1);return}const e=r?.ownerDocument.defaultView;if(!e)return;v();const t=e.setTimeout(()=>{M.current?.focus()},0),n=w=>{const b=w.target;f.current&&!f.current.contains(b)&&r&&!r.contains(b)&&l()},c=()=>v();return e.addEventListener("mousedown",n),e.addEventListener("scroll",c,!0),e.addEventListener("resize",c),()=>{e.clearTimeout(t),e.removeEventListener("mousedown",n),e.removeEventListener("scroll",c,!0),e.removeEventListener("resize",c)}},[u,r,l,v]);const p=k.trim().toLowerCase(),g=a.useCallback(e=>{if(!p)return!0;const t=e.name.toLowerCase().includes(p),n=e.label?e.label.toLowerCase().includes(p):!1;return t||n},[p]),m=a.useMemo(()=>L.filter(g),[L,g]),d=a.useMemo(()=>N.filter(g),[N,g]),i=a.useMemo(()=>[...m.map(e=>({group:"system",variable:e})),...d.map(e=>({group:"custom",variable:e}))],[m,d]),S=a.useMemo(()=>{const e=new Map;return i.forEach((t,n)=>{e.set(`${t.group}-${t.variable.name}`,n)}),e},[i]);a.useEffect(()=>{(!u||!i.length)&&o(-1)},[u,i.length]);const y=a.useCallback(e=>{j(e),l()},[l,j]),E=e=>{if(!i.length){e.key==="Escape"&&l();return}if(e.key==="ArrowDown")e.preventDefault(),o(t=>(t+1)%i.length);else if(e.key==="ArrowUp")e.preventDefault(),o(t=>t<=0?i.length-1:t-1);else if(e.key==="Enter"){e.preventDefault();const t=i[x];t&&y(t.variable)}else e.key==="Escape"&&(e.preventDefault(),l())};return u?s.jsxs("div",{ref:f,className:"markdown-flow-editor-variable-search",style:{position:"fixed",left:`${C.left}px`,top:`${C.top}px`},children:[s.jsxs("div",{className:"relative",children:[s.jsx(I.default,{className:"variable-search-icon"}),s.jsx(q.Input,{ref:M,value:k,placeholder:h.searchPlaceholder,onChange:e=>D(e.target.value),onKeyDown:E,className:"variable-search-input"})]}),s.jsxs("div",{className:"variable-search-list",children:[m.length>0&&s.jsxs("div",{className:"variable-search-section",children:[s.jsx("p",{className:"variable-search-section-title",children:h.systemLabel}),m.map(e=>{const t=S.get(`system-${e.name}`)??-1,n=x===t;return s.jsxs("button",{type:"button",onClick:()=>y(e),onMouseEnter:()=>{t>=0&&o(t)},className:R.cn("variable-search-item",n&&"variable-search-item-active"),children:[s.jsx("span",{className:"variable-search-item-name",children:e.name}),e.label&&s.jsx("span",{className:"variable-search-item-label",children:e.label})]},`system-${e.name}`)})]}),d.length>0&&s.jsxs("div",{className:"variable-search-section",children:[s.jsx("p",{className:"variable-search-section-title",children:h.customLabel}),d.map(e=>{const t=S.get(`custom-${e.name}`)??-1,n=x===t;return s.jsxs("button",{type:"button",onClick:()=>y(e),onMouseEnter:()=>{t>=0&&o(t)},className:R.cn("variable-search-item",n&&"variable-search-item-active"),children:[s.jsx("span",{className:"variable-search-item-name",children:e.name}),e.label&&s.jsx("span",{className:"variable-search-item-label",children:e.label})]},`custom-${e.name}`)})]}),m.length===0&&d.length===0&&s.jsx("div",{className:"variable-search-empty",children:h.emptyLabel})]})]}):null};exports.default=V;
|
|
2
|
-
//# sourceMappingURL=VariableSearchDropdown.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"VariableSearchDropdown.cjs","sources":["../../../../src/components/MarkdownFlowEditor/components/VariableSearchDropdown.tsx"],"sourcesContent":["import React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { Search } from \"lucide-react\";\nimport { Variable } from \"../types\";\nimport { Input } from \"../../ui/input\";\nimport { cn } from \"../../../lib/utils\";\n\ninterface VariableSearchDropdownProps {\n open: boolean;\n anchorElement: HTMLElement | null;\n onClose: () => void;\n onSelect: (variable: Variable) => void;\n variables: Variable[];\n systemVariables: Variable[];\n labels: {\n searchPlaceholder: string;\n systemLabel: string;\n customLabel: string;\n emptyLabel: string;\n };\n}\n\nconst VariableSearchDropdown: React.FC<VariableSearchDropdownProps> = ({\n open,\n anchorElement,\n onClose,\n onSelect,\n variables,\n systemVariables,\n labels,\n}) => {\n const containerRef = useRef<HTMLDivElement | null>(null);\n const inputRef = useRef<HTMLInputElement | null>(null);\n const [query, setQuery] = useState(\"\");\n const [position, setPosition] = useState({ left: 0, top: 0 });\n const [highlightIndex, setHighlightIndex] = useState(-1);\n\n const updatePosition = useCallback(() => {\n if (!anchorElement) return;\n const rect = anchorElement.getBoundingClientRect();\n const doc = anchorElement.ownerDocument;\n const view = doc.defaultView;\n if (!view) return;\n const width = containerRef.current?.getBoundingClientRect().width ?? 0;\n const desiredLeft =\n view.getComputedStyle(anchorElement).direction === \"rtl\"\n ? rect.right - width\n : rect.left;\n const maxLeft = Math.max(8, doc.documentElement.clientWidth - width - 8);\n setPosition({\n left: Math.min(Math.max(8, desiredLeft), maxLeft),\n top: rect.bottom + 8,\n });\n }, [anchorElement]);\n\n useEffect(() => {\n if (!open) {\n setQuery(\"\");\n setHighlightIndex(-1);\n return;\n }\n const view = anchorElement?.ownerDocument.defaultView;\n if (!view) return;\n updatePosition();\n const focusTimer = view.setTimeout(() => {\n inputRef.current?.focus();\n }, 0);\n const handleClick = (event: MouseEvent) => {\n const target = event.target as Node | null;\n if (\n containerRef.current &&\n !containerRef.current.contains(target) &&\n anchorElement &&\n !anchorElement.contains(target)\n ) {\n onClose();\n }\n };\n const handleScroll = () => updatePosition();\n view.addEventListener(\"mousedown\", handleClick);\n view.addEventListener(\"scroll\", handleScroll, true);\n view.addEventListener(\"resize\", handleScroll);\n\n return () => {\n view.clearTimeout(focusTimer);\n view.removeEventListener(\"mousedown\", handleClick);\n view.removeEventListener(\"scroll\", handleScroll, true);\n view.removeEventListener(\"resize\", handleScroll);\n };\n }, [open, anchorElement, onClose, updatePosition]);\n\n const normalizedQuery = query.trim().toLowerCase();\n const filterVariable = useCallback(\n (variable: Variable) => {\n if (!normalizedQuery) return true;\n const nameMatch = variable.name.toLowerCase().includes(normalizedQuery);\n const labelMatch = variable.label\n ? variable.label.toLowerCase().includes(normalizedQuery)\n : false;\n return nameMatch || labelMatch;\n },\n [normalizedQuery]\n );\n\n const filteredSystemVariables = useMemo(\n () => systemVariables.filter(filterVariable),\n [systemVariables, filterVariable]\n );\n const filteredCustomVariables = useMemo(\n () => variables.filter(filterVariable),\n [variables, filterVariable]\n );\n\n const orderedItems = useMemo(\n () => [\n ...filteredSystemVariables.map((variable) => ({\n group: \"system\" as const,\n variable,\n })),\n ...filteredCustomVariables.map((variable) => ({\n group: \"custom\" as const,\n variable,\n })),\n ],\n [filteredSystemVariables, filteredCustomVariables]\n );\n\n const indexesByKey = useMemo(() => {\n const map = new Map<string, number>();\n orderedItems.forEach((item, index) => {\n map.set(`${item.group}-${item.variable.name}`, index);\n });\n return map;\n }, [orderedItems]);\n\n useEffect(() => {\n if (!open || !orderedItems.length) {\n setHighlightIndex(-1);\n }\n }, [open, orderedItems.length]);\n\n const handleSelect = useCallback(\n (variable: Variable) => {\n onSelect(variable);\n onClose();\n },\n [onClose, onSelect]\n );\n\n const handleInputKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (!orderedItems.length) {\n if (event.key === \"Escape\") {\n onClose();\n }\n return;\n }\n if (event.key === \"ArrowDown\") {\n event.preventDefault();\n setHighlightIndex((prev) => (prev + 1) % orderedItems.length);\n } else if (event.key === \"ArrowUp\") {\n event.preventDefault();\n setHighlightIndex((prev) =>\n prev <= 0 ? orderedItems.length - 1 : prev - 1\n );\n } else if (event.key === \"Enter\") {\n event.preventDefault();\n const item = orderedItems[highlightIndex];\n if (item) {\n handleSelect(item.variable);\n }\n } else if (event.key === \"Escape\") {\n event.preventDefault();\n onClose();\n }\n };\n\n if (!open) {\n return null;\n }\n\n return (\n <div\n ref={containerRef}\n className=\"markdown-flow-editor-variable-search\"\n style={{\n position: \"fixed\",\n left: `${position.left}px`,\n top: `${position.top}px`,\n }}\n >\n <div className=\"relative\">\n <Search className=\"variable-search-icon\" />\n <Input\n ref={inputRef}\n value={query}\n placeholder={labels.searchPlaceholder}\n onChange={(event) => setQuery(event.target.value)}\n onKeyDown={handleInputKeyDown}\n className=\"variable-search-input\"\n />\n </div>\n <div className=\"variable-search-list\">\n {filteredSystemVariables.length > 0 && (\n <div className=\"variable-search-section\">\n <p className=\"variable-search-section-title\">\n {labels.systemLabel}\n </p>\n {filteredSystemVariables.map((variable) => {\n const index = indexesByKey.get(`system-${variable.name}`) ?? -1;\n const isActive = highlightIndex === index;\n return (\n <button\n key={`system-${variable.name}`}\n type=\"button\"\n onClick={() => handleSelect(variable)}\n onMouseEnter={() => {\n if (index >= 0) {\n setHighlightIndex(index);\n }\n }}\n className={cn(\n \"variable-search-item\",\n isActive && \"variable-search-item-active\"\n )}\n >\n <span className=\"variable-search-item-name\">\n {variable.name}\n </span>\n {variable.label && (\n <span className=\"variable-search-item-label\">\n {variable.label}\n </span>\n )}\n </button>\n );\n })}\n </div>\n )}\n\n {filteredCustomVariables.length > 0 && (\n <div className=\"variable-search-section\">\n <p className=\"variable-search-section-title\">\n {labels.customLabel}\n </p>\n {filteredCustomVariables.map((variable) => {\n const index = indexesByKey.get(`custom-${variable.name}`) ?? -1;\n const isActive = highlightIndex === index;\n return (\n <button\n key={`custom-${variable.name}`}\n type=\"button\"\n onClick={() => handleSelect(variable)}\n onMouseEnter={() => {\n if (index >= 0) {\n setHighlightIndex(index);\n }\n }}\n className={cn(\n \"variable-search-item\",\n isActive && \"variable-search-item-active\"\n )}\n >\n <span className=\"variable-search-item-name\">\n {variable.name}\n </span>\n {variable.label && (\n <span className=\"variable-search-item-label\">\n {variable.label}\n </span>\n )}\n </button>\n );\n })}\n </div>\n )}\n\n {filteredSystemVariables.length === 0 &&\n filteredCustomVariables.length === 0 && (\n <div className=\"variable-search-empty\">{labels.emptyLabel}</div>\n )}\n </div>\n </div>\n );\n};\n\nexport default VariableSearchDropdown;\n"],"names":["VariableSearchDropdown","open","anchorElement","onClose","onSelect","variables","systemVariables","labels","containerRef","useRef","inputRef","query","setQuery","useState","position","setPosition","highlightIndex","setHighlightIndex","updatePosition","useCallback","rect","doc","view","width","desiredLeft","maxLeft","useEffect","focusTimer","handleClick","event","target","handleScroll","normalizedQuery","filterVariable","variable","nameMatch","labelMatch","filteredSystemVariables","useMemo","filteredCustomVariables","orderedItems","indexesByKey","map","item","index","handleSelect","handleInputKeyDown","prev","jsxs","jsx","Search","Input","isActive","cn"],"mappings":"kTA2BMA,EAAgE,CAAC,CACrE,KAAAC,EACA,cAAAC,EACA,QAAAC,EACA,SAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,OAAAC,CACF,IAAM,CACJ,MAAMC,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,EAnBG,UAAUf,EAAS,IAAI,EAAA,CAuBlC,CAAC,CAAA,EACH,EAGDG,EAAwB,SAAW,GAClCE,EAAwB,SAAW,GACjCU,EAAAA,IAAC,MAAA,CAAI,UAAU,wBAAyB,SAAA1C,EAAO,UAAA,CAAW,CAAA,CAAA,CAEhE,CAAA,CAAA,CAAA,EAvGK,IA0GX"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { Variable } from '../types.js';
|
|
3
|
-
interface VariableSearchDropdownProps {
|
|
4
|
-
open: boolean;
|
|
5
|
-
anchorElement: HTMLElement | null;
|
|
6
|
-
onClose: () => void;
|
|
7
|
-
onSelect: (variable: Variable) => void;
|
|
8
|
-
variables: Variable[];
|
|
9
|
-
systemVariables: Variable[];
|
|
10
|
-
labels: {
|
|
11
|
-
searchPlaceholder: string;
|
|
12
|
-
systemLabel: string;
|
|
13
|
-
customLabel: string;
|
|
14
|
-
emptyLabel: string;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
declare const VariableSearchDropdown: React.FC<VariableSearchDropdownProps>;
|
|
18
|
-
export default VariableSearchDropdown;
|