markdown-flow-ui 0.3.2-dev.2 → 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.es8.js +2 -2
- package/dist/_virtual/index.es9.js +2 -2
- 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 -562
- 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/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,42 +1,38 @@
|
|
|
1
|
-
import { SelectedOption as
|
|
1
|
+
import { SelectedOption as m } from "./types.es.js";
|
|
2
2
|
import { getVideoEmbedUrl as $ } from "./utils/video.es.js";
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
switch (
|
|
6
|
-
case
|
|
3
|
+
import "../../_virtual/index.es.js";
|
|
4
|
+
const i = "===", x = (e, t) => {
|
|
5
|
+
switch (e) {
|
|
6
|
+
case m.Image:
|
|
7
7
|
return {
|
|
8
|
-
resourceUrl:
|
|
9
|
-
resourceTitle:
|
|
10
|
-
scalePercent:
|
|
8
|
+
resourceUrl: t.url,
|
|
9
|
+
resourceTitle: t.title,
|
|
10
|
+
scalePercent: t.scalePercent
|
|
11
11
|
};
|
|
12
|
-
case
|
|
12
|
+
case m.Video:
|
|
13
13
|
return {
|
|
14
|
-
resourceUrl:
|
|
15
|
-
resourceTitle:
|
|
16
|
-
};
|
|
17
|
-
case u.Variable:
|
|
18
|
-
return {
|
|
19
|
-
variableName: d.normalizeVariableName(e.title ?? "") ?? void 0
|
|
14
|
+
resourceUrl: t.url,
|
|
15
|
+
resourceTitle: t.title
|
|
20
16
|
};
|
|
21
17
|
default:
|
|
22
18
|
return {
|
|
23
|
-
resourceUrl:
|
|
24
|
-
resourceTitle:
|
|
19
|
+
resourceUrl: t.url ?? "",
|
|
20
|
+
resourceTitle: t.title ?? ""
|
|
25
21
|
};
|
|
26
22
|
}
|
|
27
23
|
};
|
|
28
|
-
function
|
|
29
|
-
return (
|
|
30
|
-
const
|
|
31
|
-
if (!
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
changes: { from:
|
|
35
|
-
}),
|
|
24
|
+
function E(e, t) {
|
|
25
|
+
return (o) => {
|
|
26
|
+
const r = o.matchBefore(/\/(\w*)$/);
|
|
27
|
+
if (!r) return null;
|
|
28
|
+
const l = (n, a, s, c, p) => {
|
|
29
|
+
n.dispatch({
|
|
30
|
+
changes: { from: s, to: c, insert: "" }
|
|
31
|
+
}), e(p);
|
|
36
32
|
};
|
|
37
33
|
return {
|
|
38
|
-
from:
|
|
39
|
-
to:
|
|
34
|
+
from: r.from,
|
|
35
|
+
to: r.to,
|
|
40
36
|
options: [
|
|
41
37
|
// {
|
|
42
38
|
// label: labels?.divider ?? "Divider",
|
|
@@ -50,24 +46,16 @@ function v(t, e, { enableVariables: n = !0 } = {}) {
|
|
|
50
46
|
// handleSelect(view, _, from, to, SelectedOption.FixedText);
|
|
51
47
|
// },
|
|
52
48
|
// },
|
|
53
|
-
...n ? [
|
|
54
|
-
{
|
|
55
|
-
label: e?.variable ?? "Variable",
|
|
56
|
-
apply: (r, c, i, l) => {
|
|
57
|
-
o(r, c, i, l, u.Variable);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
] : [],
|
|
61
49
|
{
|
|
62
|
-
label:
|
|
63
|
-
apply: (
|
|
64
|
-
|
|
50
|
+
label: t?.image ?? "Image",
|
|
51
|
+
apply: (n, a, s, c) => {
|
|
52
|
+
l(n, a, s, c, m.Image);
|
|
65
53
|
}
|
|
66
54
|
},
|
|
67
55
|
{
|
|
68
|
-
label:
|
|
69
|
-
apply: (
|
|
70
|
-
|
|
56
|
+
label: t?.video ?? "Video",
|
|
57
|
+
apply: (n, a, s, c) => {
|
|
58
|
+
l(n, a, s, c, m.Video);
|
|
71
59
|
}
|
|
72
60
|
}
|
|
73
61
|
],
|
|
@@ -75,40 +63,38 @@ function v(t, e, { enableVariables: n = !0 } = {}) {
|
|
|
75
63
|
};
|
|
76
64
|
};
|
|
77
65
|
}
|
|
78
|
-
const
|
|
79
|
-
const
|
|
80
|
-
return
|
|
81
|
-
`^${
|
|
82
|
-
).test(
|
|
83
|
-
},
|
|
84
|
-
const
|
|
85
|
-
`^${
|
|
66
|
+
const f = (e) => $(e), d = (e) => e.replace(/&/g, "&").replace(/"/g, """), g = (e) => e.replace(/([\[\]\\])/g, "\\$1"), b = (e) => Math.max(1, Math.min(1e3, Math.round(e))), u = (e) => {
|
|
67
|
+
const t = e.trim();
|
|
68
|
+
return t ? new RegExp(
|
|
69
|
+
`^${i}\\s*[\\s\\S]*?\\s*${i}$`
|
|
70
|
+
).test(t) ? t : `${i} ${t} ${i}` : `${i}${i}`;
|
|
71
|
+
}, M = (e) => {
|
|
72
|
+
const t = e.trim(), o = new RegExp(
|
|
73
|
+
`^${i}\\s*([\\s\\S]*?)\\s*${i}$`
|
|
86
74
|
);
|
|
87
|
-
return (
|
|
88
|
-
},
|
|
89
|
-
resourceUrl:
|
|
90
|
-
resourceTitle:
|
|
91
|
-
scalePercent:
|
|
75
|
+
return (t.match(o)?.[1] ?? t).trim();
|
|
76
|
+
}, z = ({
|
|
77
|
+
resourceUrl: e,
|
|
78
|
+
resourceTitle: t,
|
|
79
|
+
scalePercent: o
|
|
92
80
|
}) => {
|
|
93
|
-
const
|
|
94
|
-
return
|
|
95
|
-
},
|
|
96
|
-
const
|
|
97
|
-
return
|
|
98
|
-
},
|
|
81
|
+
const r = typeof o == "number" ? b(o) : void 0, l = d(e), n = t ? d(t) : void 0, a = t ? g(t) : "", s = typeof r == "number" && r !== 100 ? ` width="${r}%"` : "", c = n ? ` alt="${n}" title="${n}"` : "", p = !r || r === 100 ? `` : `<img src="${l}"${c}${s} />`;
|
|
82
|
+
return u(p);
|
|
83
|
+
}, U = (e, t) => {
|
|
84
|
+
const o = f(e), r = t ? d(t) : "", l = d(e), n = d(o), a = `<iframe data-tag="video" data-title="${r}" data-url="${l}" class="w-full aspect-video rounded-lg border-0" src="${n}" allowfullscreen="" allow="autoplay; encrypted-media"></iframe>`;
|
|
85
|
+
return u(a);
|
|
86
|
+
}, k = distExports.findDocumentVariableMarkers, I = distExports.findVariableMarkers, P = distExports.normalizeVariableName, T = distExports.trimVariablePadding;
|
|
99
87
|
export {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
U as unwrapFixedOutput,
|
|
112
|
-
b as wrapWithFixedOutput
|
|
88
|
+
E as createSlashCommands,
|
|
89
|
+
k as findDocumentVariableMarkers,
|
|
90
|
+
I as findVariableMarkers,
|
|
91
|
+
f as getEmbedUrl,
|
|
92
|
+
z as getImageContentToInsert,
|
|
93
|
+
U as getVideoContentToInsert,
|
|
94
|
+
P as normalizeVariableName,
|
|
95
|
+
x as parseContentInfo,
|
|
96
|
+
T as trimVariablePadding,
|
|
97
|
+
M as unwrapFixedOutput,
|
|
98
|
+
u as wrapWithFixedOutput
|
|
113
99
|
};
|
|
114
100
|
//# sourceMappingURL=utils.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.es.js","sources":["../../../src/components/MarkdownFlowEditor/utils.ts"],"sourcesContent":["import {\n type Completion,\n type CompletionContext,\n type CompletionResult,\n} from \"@codemirror/autocomplete\";\nimport { EditorView } from \"@codemirror/view\";\nimport { SelectedOption } from \"./types\";\nimport { getVideoEmbedUrl } from \"./utils/video\";\n\nimport {\n createVariableExpressionRegex,\n extractVariableNames,\n findVariableMarkers,\n findDocumentVariableMarkers,\n formatVariableReference,\n formatVariableAssignment,\n isValidVariableName,\n normalizeVariableName,\n trimVariablePadding,\n} from \"remark-flow\";\n\nconst FIXED_OUTPUT_MARKER = \"===\";\nconst createVariableExpressionRegexp = () =>\n createVariableExpressionRegex(\"gu\");\n\nconst parseContentInfo = (\n type: SelectedOption,\n dataset: { title?: string; url?: string; scalePercent?: number }\n) => {\n switch (type) {\n case SelectedOption.Image:\n return {\n resourceUrl: dataset.url,\n resourceTitle: dataset.title,\n scalePercent: dataset.scalePercent,\n };\n\n case SelectedOption.Video:\n return {\n resourceUrl: dataset.url,\n resourceTitle: dataset.title,\n };\n case SelectedOption.Variable:\n return {\n variableName: normalizeVariableName(dataset.title ?? \"\") ?? undefined,\n };\n default:\n return {\n resourceUrl: dataset.url ?? \"\",\n resourceTitle: dataset.title ?? \"\",\n };\n }\n};\n\nfunction createSlashCommands(\n onSelectOption: (selectedOption: SelectedOption) => void,\n labels?: {\n divider?: string;\n fixedText?: string;\n image?: string;\n video?: string;\n variable?: string;\n },\n { enableVariables = true }: { enableVariables?: boolean } = {}\n) {\n return (context: CompletionContext): CompletionResult | null => {\n const word = context.matchBefore(/\\/(\\w*)$/);\n if (!word) return null;\n\n const handleSelect = (\n view: EditorView,\n _: any,\n from: number,\n to: number,\n selectedOption: SelectedOption\n ) => {\n view.dispatch({\n changes: { from, to, insert: \"\" },\n });\n onSelectOption(selectedOption);\n };\n\n return {\n from: word.from,\n to: word.to,\n options: [\n // {\n // label: labels?.divider ?? \"Divider\",\n // apply: (view, _, from, to) => {\n // handleSelect(view, _, from, to, SelectedOption.Divider);\n // },\n // },\n // {\n // label: labels?.fixedText ?? \"Fixed Text\",\n // apply: (view, _, from, to) => {\n // handleSelect(view, _, from, to, SelectedOption.FixedText);\n // },\n // },\n ...(enableVariables\n ? [\n {\n label: labels?.variable ?? \"Variable\",\n apply: (\n view: EditorView,\n _: Completion,\n from: number,\n to: number\n ) => {\n handleSelect(view, _, from, to, SelectedOption.Variable);\n },\n },\n ]\n : []),\n {\n label: labels?.image ?? \"Image\",\n apply: (view, _, from, to) => {\n handleSelect(view, _, from, to, SelectedOption.Image);\n },\n },\n {\n label: labels?.video ?? \"Video\",\n apply: (view, _, from, to) => {\n handleSelect(view, _, from, to, SelectedOption.Video);\n },\n },\n ],\n filter: false,\n };\n };\n}\n\nconst getEmbedUrl = (url: string) => {\n return getVideoEmbedUrl(url);\n};\n\nconst escapeHtmlAttribute = (value: string) =>\n value.replace(/&/g, \"&\").replace(/\"/g, \""\");\n\nconst escapeMarkdownText = (text: string) =>\n text.replace(/([\\[\\]\\\\])/g, \"\\\\$1\");\n\nconst clampScalePercent = (value: number) =>\n Math.max(1, Math.min(1000, Math.round(value)));\n\nconst wrapWithFixedOutput = (content: string) => {\n const normalizedContent = content.trim();\n if (!normalizedContent) {\n return `${FIXED_OUTPUT_MARKER}${FIXED_OUTPUT_MARKER}`;\n }\n const wrappedPattern = new RegExp(\n `^${FIXED_OUTPUT_MARKER}\\\\s*[\\\\s\\\\S]*?\\\\s*${FIXED_OUTPUT_MARKER}$`\n );\n if (wrappedPattern.test(normalizedContent)) {\n return normalizedContent;\n }\n return `${FIXED_OUTPUT_MARKER} ${normalizedContent} ${FIXED_OUTPUT_MARKER}`;\n};\n\nconst unwrapFixedOutput = (content: string) => {\n const normalizedContent = content.trim();\n const wrappedPattern = new RegExp(\n `^${FIXED_OUTPUT_MARKER}\\\\s*([\\\\s\\\\S]*?)\\\\s*${FIXED_OUTPUT_MARKER}$`\n );\n const match = normalizedContent.match(wrappedPattern);\n return (match?.[1] ?? normalizedContent).trim();\n};\n\nconst getImageContentToInsert = ({\n resourceUrl,\n resourceTitle,\n scalePercent,\n}: {\n resourceUrl: string;\n resourceTitle?: string;\n scalePercent?: number;\n}) => {\n const clampedScale =\n typeof scalePercent === \"number\"\n ? clampScalePercent(scalePercent)\n : undefined;\n const sanitizedHtmlUrl = escapeHtmlAttribute(resourceUrl);\n const sanitizedTitle = resourceTitle\n ? escapeHtmlAttribute(resourceTitle)\n : undefined;\n const markdownTitle = resourceTitle ? escapeMarkdownText(resourceTitle) : \"\";\n const widthAttribute =\n typeof clampedScale === \"number\" && clampedScale !== 100\n ? ` width=\"${clampedScale}%\"`\n : \"\";\n const htmlTitleAttributes = sanitizedTitle\n ? ` alt=\"${sanitizedTitle}\" title=\"${sanitizedTitle}\"`\n : \"\";\n const imageMarkup =\n !clampedScale || clampedScale === 100\n ? ``\n : `<img src=\"${sanitizedHtmlUrl}\"${htmlTitleAttributes}${widthAttribute} />`;\n\n return wrapWithFixedOutput(imageMarkup);\n};\n\nconst getVideoContentToInsert = (\n resourceUrl: string,\n resourceTitle: string\n) => {\n const embedUrl = getEmbedUrl(resourceUrl);\n const sanitizedTitle = resourceTitle\n ? escapeHtmlAttribute(resourceTitle)\n : \"\";\n const sanitizedResourceUrl = escapeHtmlAttribute(resourceUrl);\n const sanitizedEmbedUrl = escapeHtmlAttribute(embedUrl);\n const videoMarkup = `<iframe data-tag=\"video\" data-title=\"${sanitizedTitle}\" data-url=\"${sanitizedResourceUrl}\" class=\"w-full aspect-video rounded-lg border-0\" src=\"${sanitizedEmbedUrl}\" allowfullscreen=\"\" allow=\"autoplay; encrypted-media\"></iframe>`;\n\n return wrapWithFixedOutput(videoMarkup);\n};\n\nexport {\n createSlashCommands,\n parseContentInfo,\n getEmbedUrl,\n getImageContentToInsert,\n getVideoContentToInsert,\n isValidVariableName,\n normalizeVariableName,\n trimVariablePadding,\n extractVariableNames,\n findVariableMarkers,\n findDocumentVariableMarkers,\n formatVariableReference,\n formatVariableAssignment,\n createVariableExpressionRegexp,\n wrapWithFixedOutput,\n unwrapFixedOutput,\n};\n"],"names":["FIXED_OUTPUT_MARKER","parseContentInfo","type","dataset","SelectedOption","normalizeVariableName","createSlashCommands","onSelectOption","labels","enableVariables","context","word","handleSelect","view","_","from","to","selectedOption","getEmbedUrl","url","getVideoEmbedUrl","escapeHtmlAttribute","value","escapeMarkdownText","text","clampScalePercent","wrapWithFixedOutput","content","normalizedContent","unwrapFixedOutput","wrappedPattern","getImageContentToInsert","resourceUrl","resourceTitle","scalePercent","clampedScale","sanitizedHtmlUrl","sanitizedTitle","markdownTitle","widthAttribute","htmlTitleAttributes","imageMarkup","getVideoContentToInsert","embedUrl","sanitizedResourceUrl","sanitizedEmbedUrl","videoMarkup"],"mappings":";;;AAqBA,MAAMA,IAAsB,OAItBC,IAAmB,CACvBC,GACAC,MACG;AACH,UAAQD,GAAA;AAAA,IACN,KAAKE,EAAe;AAClB,aAAO;AAAA,QACL,aAAaD,EAAQ;AAAA,QACrB,eAAeA,EAAQ;AAAA,QACvB,cAAcA,EAAQ;AAAA,MAAA;AAAA,IAG1B,KAAKC,EAAe;AAClB,aAAO;AAAA,QACL,aAAaD,EAAQ;AAAA,QACrB,eAAeA,EAAQ;AAAA,MAAA;AAAA,IAE3B,KAAKC,EAAe;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Y,OACvB,IACAK,IAAsBH,IACxB,SAASA,CAAc,YAAYA,CAAc,MACjD,IACEI,IACJ,CAACN,KAAgBA,MAAiB,MAC9B,KAAKG,CAAa,KAAKN,CAAW,MAClC,aAAaI,CAAgB,IAAII,CAAmB,GAAGD,CAAc;AAE3E,SAAOb,EAAoBe,CAAW;AACxC,GAEMC,IAA0B,CAC9BV,GACAC,MACG;AACH,QAAMU,IAAWzB,EAAYc,CAAW,GAClCK,IAAiBJ,IACnBZ,EAAoBY,CAAa,IACjC,IACEW,IAAuBvB,EAAoBW,CAAW,GACtDa,IAAoBxB,EAAoBsB,CAAQ,GAChDG,IAAc,wCAAwCT,CAAc,eAAeO,CAAoB,0DAA0DC,CAAiB;AAExL,SAAOnB,EAAoBoB,CAAW;AACxC;"}
|
|
1
|
+
{"version":3,"file":"utils.es.js","sources":["../../../src/components/MarkdownFlowEditor/utils.ts"],"sourcesContent":["import {\n type CompletionContext,\n type CompletionResult,\n} from \"@codemirror/autocomplete\";\nimport { EditorView } from \"@codemirror/view\";\nimport { SelectedOption } from \"./types\";\nimport { getVideoEmbedUrl } from \"./utils/video\";\n\nimport {\n createVariableExpressionRegex,\n extractVariableNames,\n findVariableMarkers,\n findDocumentVariableMarkers,\n formatVariableReference,\n formatVariableAssignment,\n isValidVariableName,\n normalizeVariableName,\n trimVariablePadding,\n} from \"remark-flow\";\n\nconst FIXED_OUTPUT_MARKER = \"===\";\nconst createVariableExpressionRegexp = () =>\n createVariableExpressionRegex(\"gu\");\n\nconst parseContentInfo = (\n type: SelectedOption,\n dataset: { title?: string; url?: string; scalePercent?: number }\n) => {\n switch (type) {\n case SelectedOption.Image:\n return {\n resourceUrl: dataset.url,\n resourceTitle: dataset.title,\n scalePercent: dataset.scalePercent,\n };\n\n case SelectedOption.Video:\n return {\n resourceUrl: dataset.url,\n resourceTitle: dataset.title,\n };\n default:\n return {\n resourceUrl: dataset.url ?? \"\",\n resourceTitle: dataset.title ?? \"\",\n };\n }\n};\n\nfunction createSlashCommands(\n onSelectOption: (selectedOption: SelectedOption) => void,\n labels?: {\n divider?: string;\n fixedText?: string;\n image?: string;\n video?: string;\n }\n) {\n return (context: CompletionContext): CompletionResult | null => {\n const word = context.matchBefore(/\\/(\\w*)$/);\n if (!word) return null;\n\n const handleSelect = (\n view: EditorView,\n _: any,\n from: number,\n to: number,\n selectedOption: SelectedOption\n ) => {\n view.dispatch({\n changes: { from, to, insert: \"\" },\n });\n onSelectOption(selectedOption);\n };\n\n return {\n from: word.from,\n to: word.to,\n options: [\n // {\n // label: labels?.divider ?? \"Divider\",\n // apply: (view, _, from, to) => {\n // handleSelect(view, _, from, to, SelectedOption.Divider);\n // },\n // },\n // {\n // label: labels?.fixedText ?? \"Fixed Text\",\n // apply: (view, _, from, to) => {\n // handleSelect(view, _, from, to, SelectedOption.FixedText);\n // },\n // },\n {\n label: labels?.image ?? \"Image\",\n apply: (view, _, from, to) => {\n handleSelect(view, _, from, to, SelectedOption.Image);\n },\n },\n {\n label: labels?.video ?? \"Video\",\n apply: (view, _, from, to) => {\n handleSelect(view, _, from, to, SelectedOption.Video);\n },\n },\n ],\n filter: false,\n };\n };\n}\n\nconst getEmbedUrl = (url: string) => {\n return getVideoEmbedUrl(url);\n};\n\nconst escapeHtmlAttribute = (value: string) =>\n value.replace(/&/g, \"&\").replace(/\"/g, \""\");\n\nconst escapeMarkdownText = (text: string) =>\n text.replace(/([\\[\\]\\\\])/g, \"\\\\$1\");\n\nconst clampScalePercent = (value: number) =>\n Math.max(1, Math.min(1000, Math.round(value)));\n\nconst wrapWithFixedOutput = (content: string) => {\n const normalizedContent = content.trim();\n if (!normalizedContent) {\n return `${FIXED_OUTPUT_MARKER}${FIXED_OUTPUT_MARKER}`;\n }\n const wrappedPattern = new RegExp(\n `^${FIXED_OUTPUT_MARKER}\\\\s*[\\\\s\\\\S]*?\\\\s*${FIXED_OUTPUT_MARKER}$`\n );\n if (wrappedPattern.test(normalizedContent)) {\n return normalizedContent;\n }\n return `${FIXED_OUTPUT_MARKER} ${normalizedContent} ${FIXED_OUTPUT_MARKER}`;\n};\n\nconst unwrapFixedOutput = (content: string) => {\n const normalizedContent = content.trim();\n const wrappedPattern = new RegExp(\n `^${FIXED_OUTPUT_MARKER}\\\\s*([\\\\s\\\\S]*?)\\\\s*${FIXED_OUTPUT_MARKER}$`\n );\n const match = normalizedContent.match(wrappedPattern);\n return (match?.[1] ?? normalizedContent).trim();\n};\n\nconst getImageContentToInsert = ({\n resourceUrl,\n resourceTitle,\n scalePercent,\n}: {\n resourceUrl: string;\n resourceTitle?: string;\n scalePercent?: number;\n}) => {\n const clampedScale =\n typeof scalePercent === \"number\"\n ? clampScalePercent(scalePercent)\n : undefined;\n const sanitizedHtmlUrl = escapeHtmlAttribute(resourceUrl);\n const sanitizedTitle = resourceTitle\n ? escapeHtmlAttribute(resourceTitle)\n : undefined;\n const markdownTitle = resourceTitle ? escapeMarkdownText(resourceTitle) : \"\";\n const widthAttribute =\n typeof clampedScale === \"number\" && clampedScale !== 100\n ? ` width=\"${clampedScale}%\"`\n : \"\";\n const htmlTitleAttributes = sanitizedTitle\n ? ` alt=\"${sanitizedTitle}\" title=\"${sanitizedTitle}\"`\n : \"\";\n const imageMarkup =\n !clampedScale || clampedScale === 100\n ? ``\n : `<img src=\"${sanitizedHtmlUrl}\"${htmlTitleAttributes}${widthAttribute} />`;\n\n return wrapWithFixedOutput(imageMarkup);\n};\n\nconst getVideoContentToInsert = (\n resourceUrl: string,\n resourceTitle: string\n) => {\n const embedUrl = getEmbedUrl(resourceUrl);\n const sanitizedTitle = resourceTitle\n ? escapeHtmlAttribute(resourceTitle)\n : \"\";\n const sanitizedResourceUrl = escapeHtmlAttribute(resourceUrl);\n const sanitizedEmbedUrl = escapeHtmlAttribute(embedUrl);\n const videoMarkup = `<iframe data-tag=\"video\" data-title=\"${sanitizedTitle}\" data-url=\"${sanitizedResourceUrl}\" class=\"w-full aspect-video rounded-lg border-0\" src=\"${sanitizedEmbedUrl}\" allowfullscreen=\"\" allow=\"autoplay; encrypted-media\"></iframe>`;\n\n return wrapWithFixedOutput(videoMarkup);\n};\n\nexport {\n createSlashCommands,\n parseContentInfo,\n getEmbedUrl,\n getImageContentToInsert,\n getVideoContentToInsert,\n isValidVariableName,\n normalizeVariableName,\n trimVariablePadding,\n extractVariableNames,\n findVariableMarkers,\n findDocumentVariableMarkers,\n formatVariableReference,\n formatVariableAssignment,\n createVariableExpressionRegexp,\n wrapWithFixedOutput,\n unwrapFixedOutput,\n};\n"],"names":["FIXED_OUTPUT_MARKER","parseContentInfo","type","dataset","SelectedOption","createSlashCommands","onSelectOption","labels","context","word","handleSelect","view","_","from","to","selectedOption","getEmbedUrl","url","getVideoEmbedUrl","escapeHtmlAttribute","value","escapeMarkdownText","text","clampScalePercent","wrapWithFixedOutput","content","normalizedContent","unwrapFixedOutput","wrappedPattern","getImageContentToInsert","resourceUrl","resourceTitle","scalePercent","clampedScale","sanitizedHtmlUrl","sanitizedTitle","markdownTitle","widthAttribute","htmlTitleAttributes","imageMarkup","getVideoContentToInsert","embedUrl","sanitizedResourceUrl","sanitizedEmbedUrl","videoMarkup"],"mappings":";;;AAoBA,MAAMA,IAAsB,OAItBC,IAAmB,CACvBC,GACAC,MACG;AACH,UAAQD,GAAA;AAAA,IACN,KAAKE,EAAe;AAClB,aAAO;AAAA,QACL,aAAaD,EAAQ;AAAA,QACrB,eAAeA,EAAQ;AAAA,QACvB,cAAcA,EAAQ;AAAA,MAAA;AAAA,IAG1B,KAAKC,EAAe;AAClB,aAAO;AAAA,QACL,aAAaD,EAAQ;AAAA,QACrB,eAAeA,EAAQ;AAAA,MAAA;AAAA,IAE3B;AACE,aAAO;AAAA,QACL,aAAaA,EAAQ,OAAO;AAAA,QAC5B,eAAeA,EAAQ,SAAS;AAAA,MAAA;AAAA,EAClC;AAEN;AAEA,SAASE,EACPC,GACAC,GAMA;AACA,SAAO,CAACC,MAAwD;AAC9D,UAAMC,IAAOD,EAAQ,YAAY,UAAU;AAC3C,QAAI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aling.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useLayoutEffect, useRef } from \"react\";\n\nimport { cn } from \"../../lib/utils\";\nimport {\n fitPresentationFontSize,\n resolvePresentationBaseFontSize,\n} from \"../ContentRender/utils/presentation-scaling\";\nimport type { MarkdownScalingMode } from \"./utils/markdownScaling\";\n\nconst SLIDE_FONT_SIZE_PROPERTY = \"--mdf-slide-font-size\";\nconst useIsomorphicLayoutEffect =\n typeof window === \"undefined\" ? useEffect : useLayoutEffect;\n\ninterface MarkdownFitSnapshot {\n contentHeight: number;\n contentWidth: number;\n mode: MarkdownScalingMode;\n viewportHeight: number;\n viewportWidth: number;\n}\n\nconst areFitSnapshotsEqual = (\n left: MarkdownFitSnapshot,\n right: MarkdownFitSnapshot\n) =>\n left.contentHeight === right.contentHeight &&\n left.contentWidth === right.contentWidth &&\n left.mode === right.mode &&\n left.viewportHeight === right.viewportHeight &&\n left.viewportWidth === right.viewportWidth;\n\nexport interface MarkdownSlideScalingProps\n extends React.ComponentPropsWithoutRef<\"div\"> {\n /** Controls whether Markdown content is fitted, base-scaled, or unscaled. */\n mode: MarkdownScalingMode;\n}\n\n/**\n * Fits all Markdown elements in one logical slide with a shared font-size.\n * Keeping this boundary outside ContentRender lets accumulated title, text,\n * table, and code elements participate in the same presentation layout.\n */\nconst MarkdownSlideScaling: React.FC<MarkdownSlideScalingProps> = ({\n children,\n className,\n mode,\n ...props\n}) => {\n const viewportRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const fitFrameRef = useRef<number | null>(null);\n const isFittingRef = useRef(false);\n const lastFitSnapshotRef = useRef<MarkdownFitSnapshot | null>(null);\n\n const fitContent = useCallback(() => {\n const viewport = viewportRef.current;\n const content = contentRef.current;\n\n if (mode === \"disabled\" || !viewport || !content || isFittingRef.current) {\n return;\n }\n\n const viewportSize = {\n height: viewport.clientHeight,\n width: viewport.clientWidth,\n };\n\n if (viewportSize.height <= 0 || viewportSize.width <= 0) {\n return;\n }\n\n const currentSnapshot: MarkdownFitSnapshot = {\n contentHeight: content.scrollHeight,\n contentWidth: content.scrollWidth,\n mode,\n viewportHeight: viewportSize.height,\n viewportWidth: viewportSize.width,\n };\n const lastSnapshot = lastFitSnapshotRef.current;\n\n if (lastSnapshot && areFitSnapshotsEqual(lastSnapshot, currentSnapshot)) {\n return;\n }\n\n isFittingRef.current = true;\n\n try {\n const fontSize =\n mode === \"fit\"\n ? fitPresentationFontSize({\n viewport: viewportSize,\n measure: (candidateFontSize) => {\n content.style.setProperty(\n SLIDE_FONT_SIZE_PROPERTY,\n `${candidateFontSize}px`\n );\n\n // Read after the CSS variable update so wrapping and em-based\n // styles are included in the next compression step.\n return {\n height: content.scrollHeight,\n width: content.scrollWidth,\n };\n },\n })\n : resolvePresentationBaseFontSize(viewportSize);\n\n content.style.setProperty(SLIDE_FONT_SIZE_PROPERTY, `${fontSize}px`);\n content.dataset.markdownSlideFontSize = String(fontSize);\n lastFitSnapshotRef.current = {\n contentHeight: content.scrollHeight,\n contentWidth: content.scrollWidth,\n mode,\n viewportHeight: viewportSize.height,\n viewportWidth: viewportSize.width,\n };\n } finally {\n isFittingRef.current = false;\n }\n }, [mode]);\n\n const scheduleFit = useCallback(() => {\n if (mode === \"disabled\" || fitFrameRef.current !== null) {\n return;\n }\n\n fitFrameRef.current = window.requestAnimationFrame(() => {\n fitFrameRef.current = null;\n fitContent();\n });\n }, [fitContent, mode]);\n\n useIsomorphicLayoutEffect(() => {\n if (fitFrameRef.current !== null) {\n window.cancelAnimationFrame(fitFrameRef.current);\n fitFrameRef.current = null;\n }\n\n const content = contentRef.current;\n\n if (!content) {\n return;\n }\n\n if (mode === \"disabled\") {\n content.style.removeProperty(SLIDE_FONT_SIZE_PROPERTY);\n delete content.dataset.markdownSlideFontSize;\n lastFitSnapshotRef.current = null;\n return;\n }\n\n fitContent();\n }, [fitContent, mode]);\n\n useEffect(() => {\n const viewport = viewportRef.current;\n const content = contentRef.current;\n\n if (mode === \"disabled\" || !viewport || !content) {\n return;\n }\n\n const resizeObserver =\n typeof ResizeObserver === \"undefined\"\n ? null\n : new ResizeObserver(scheduleFit);\n resizeObserver?.observe(viewport);\n\n const handleContentChange = () => {\n lastFitSnapshotRef.current = null;\n scheduleFit();\n };\n const mutationObserver =\n mode === \"fit\" && typeof MutationObserver !== \"undefined\"\n ? new MutationObserver(handleContentChange)\n : null;\n\n if (mode === \"fit\") {\n resizeObserver?.observe(content);\n mutationObserver?.observe(content, {\n childList: true,\n characterData: true,\n subtree: true,\n });\n content.addEventListener(\"load\", handleContentChange, true);\n }\n\n window.addEventListener(\"resize\", scheduleFit);\n scheduleFit();\n\n return () => {\n resizeObserver?.disconnect();\n mutationObserver?.disconnect();\n\n if (mode === \"fit\") {\n content.removeEventListener(\"load\", handleContentChange, true);\n }\n\n window.removeEventListener(\"resize\", scheduleFit);\n\n if (fitFrameRef.current !== null) {\n window.cancelAnimationFrame(fitFrameRef.current);\n fitFrameRef.current = null;\n }\n };\n }, [mode, scheduleFit]);\n\n const isScaling = mode !== \"disabled\";\n\n return (\n <div\n ref={viewportRef}\n className={cn(className, isScaling && \"slide-markdown-scaling\")}\n data-markdown-slide-scaling={isScaling ? mode : undefined}\n {...props}\n >\n <div\n ref={contentRef}\n className={cn(\n \"slide-markdown-scaling__content flex w-full flex-col gap-4\",\n mode !== \"fit\" && \"slide-markdown-scaling__content--contents\"\n )}\n >\n {children}\n </div>\n </div>\n );\n};\n\nexport default MarkdownSlideScaling;\n"],"names":["SLIDE_FONT_SIZE_PROPERTY","useIsomorphicLayoutEffect","useEffect","useLayoutEffect","areFitSnapshotsEqual","left","right","MarkdownSlideScaling","children","className","mode","props","viewportRef","useRef","contentRef","fitFrameRef","isFittingRef","lastFitSnapshotRef","fitContent","useCallback","viewport","content","viewportSize","currentSnapshot","lastSnapshot","fontSize","fitPresentationFontSize","candidateFontSize","resolvePresentationBaseFontSize","scheduleFit","resizeObserver","handleContentChange","mutationObserver","isScaling","jsx","cn"],"mappings":"k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AAe,GACf,QAAS,EAAA,CACV,EACDA,EAAQ,iBAAiB,OAAQU,EAAqB,EAAI,GAG5D,OAAO,iBAAiB,SAAUF,CAAW,EAC7CA,EAAA,EAEO,IAAM,CACXC,GAAgB,WAAA,EAChBE,GAAkB,WAAA,EAEdtB,IAAS,OACXW,EAAQ,oBAAoB,OAAQU,EAAqB,EAAI,EAG/D,OAAO,oBAAoB,SAAUF,CAAW,EAE5Cd,EAAY,UAAY,OAC1B,OAAO,qBAAqBA,EAAY,OAAO,EAC/CA,EAAY,QAAU,KAE1B,CACF,EAAG,CAACL,EAAMmB,CAAW,CAAC,EAEtB,MAAMI,EAAYvB,IAAS,WAE3B,OACEwB,EAAAA,IAAC,MAAA,CACC,IAAKtB,EACL,UAAWuB,EAAAA,GAAG1B,EAAWwB,GAAa,wBAAwB,EAC9D,8BAA6BA,EAAYvB,EAAO,OAC/C,GAAGC,EAEJ,SAAAuB,EAAAA,IAAC,MAAA,CACC,IAAKpB,EACL,UAAWqB,EAAAA,GACT,6DACAzB,IAAS,OAAS,2CAAA,EAGnB,SAAAF,CAAA,CAAA,CACH,CAAA,CAGN"}
|
|
1
|
+
{"version":3,"file":"MarkdownSlideScaling.cjs","sources":["../../../src/components/Slide/MarkdownSlideScaling.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useLayoutEffect, useRef } from \"react\";\n\nimport { cn } from \"../../lib/utils\";\nimport {\n fitPresentationFontSize,\n resolvePresentationBaseFontSize,\n} from \"../ContentRender/utils/presentation-scaling\";\nimport type { MarkdownScalingMode } from \"./utils/markdownScaling\";\n\nconst SLIDE_FONT_SIZE_PROPERTY = \"--mdf-slide-font-size\";\nconst useIsomorphicLayoutEffect =\n typeof window === \"undefined\" ? useEffect : useLayoutEffect;\n\ninterface MarkdownFitSnapshot {\n contentHeight: number;\n contentWidth: number;\n mode: MarkdownScalingMode;\n viewportHeight: number;\n viewportWidth: number;\n}\n\nconst areFitSnapshotsEqual = (\n left: MarkdownFitSnapshot,\n right: MarkdownFitSnapshot\n) =>\n left.contentHeight === right.contentHeight &&\n left.contentWidth === right.contentWidth &&\n left.mode === right.mode &&\n left.viewportHeight === right.viewportHeight &&\n left.viewportWidth === right.viewportWidth;\n\nexport interface MarkdownSlideScalingProps extends React.ComponentPropsWithoutRef<\"div\"> {\n /** Controls whether Markdown content is fitted, base-scaled, or unscaled. */\n mode: MarkdownScalingMode;\n}\n\n/**\n * Fits all Markdown elements in one logical slide with a shared font-size.\n * Keeping this boundary outside ContentRender lets accumulated title, text,\n * table, and code elements participate in the same presentation layout.\n */\nconst MarkdownSlideScaling: React.FC<MarkdownSlideScalingProps> = ({\n children,\n className,\n mode,\n ...props\n}) => {\n const viewportRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const fitFrameRef = useRef<number | null>(null);\n const isFittingRef = useRef(false);\n const lastFitSnapshotRef = useRef<MarkdownFitSnapshot | null>(null);\n\n const fitContent = useCallback(() => {\n const viewport = viewportRef.current;\n const content = contentRef.current;\n\n if (mode === \"disabled\" || !viewport || !content || isFittingRef.current) {\n return;\n }\n\n const viewportSize = {\n height: viewport.clientHeight,\n width: viewport.clientWidth,\n };\n\n if (viewportSize.height <= 0 || viewportSize.width <= 0) {\n return;\n }\n\n const currentSnapshot: MarkdownFitSnapshot = {\n contentHeight: content.scrollHeight,\n contentWidth: content.scrollWidth,\n mode,\n viewportHeight: viewportSize.height,\n viewportWidth: viewportSize.width,\n };\n const lastSnapshot = lastFitSnapshotRef.current;\n\n if (lastSnapshot && areFitSnapshotsEqual(lastSnapshot, currentSnapshot)) {\n return;\n }\n\n isFittingRef.current = true;\n\n try {\n const fontSize =\n mode === \"fit\"\n ? fitPresentationFontSize({\n viewport: viewportSize,\n measure: (candidateFontSize) => {\n content.style.setProperty(\n SLIDE_FONT_SIZE_PROPERTY,\n `${candidateFontSize}px`\n );\n\n // Read after the CSS variable update so wrapping and em-based\n // styles are included in the next compression step.\n return {\n height: content.scrollHeight,\n width: content.scrollWidth,\n };\n },\n })\n : resolvePresentationBaseFontSize(viewportSize);\n\n content.style.setProperty(SLIDE_FONT_SIZE_PROPERTY, `${fontSize}px`);\n content.dataset.markdownSlideFontSize = String(fontSize);\n lastFitSnapshotRef.current = {\n contentHeight: content.scrollHeight,\n contentWidth: content.scrollWidth,\n mode,\n viewportHeight: viewportSize.height,\n viewportWidth: viewportSize.width,\n };\n } finally {\n isFittingRef.current = false;\n }\n }, [mode]);\n\n const scheduleFit = useCallback(() => {\n if (mode === \"disabled\" || fitFrameRef.current !== null) {\n return;\n }\n\n fitFrameRef.current = window.requestAnimationFrame(() => {\n fitFrameRef.current = null;\n fitContent();\n });\n }, [fitContent, mode]);\n\n useIsomorphicLayoutEffect(() => {\n if (fitFrameRef.current !== null) {\n window.cancelAnimationFrame(fitFrameRef.current);\n fitFrameRef.current = null;\n }\n\n const content = contentRef.current;\n\n if (!content) {\n return;\n }\n\n if (mode === \"disabled\") {\n content.style.removeProperty(SLIDE_FONT_SIZE_PROPERTY);\n delete content.dataset.markdownSlideFontSize;\n lastFitSnapshotRef.current = null;\n return;\n }\n\n fitContent();\n }, [fitContent, mode]);\n\n useEffect(() => {\n const viewport = viewportRef.current;\n const content = contentRef.current;\n\n if (mode === \"disabled\" || !viewport || !content) {\n return;\n }\n\n const resizeObserver =\n typeof ResizeObserver === \"undefined\"\n ? null\n : new ResizeObserver(scheduleFit);\n resizeObserver?.observe(viewport);\n\n const handleContentChange = () => {\n lastFitSnapshotRef.current = null;\n scheduleFit();\n };\n const mutationObserver =\n mode === \"fit\" && typeof MutationObserver !== \"undefined\"\n ? new MutationObserver(handleContentChange)\n : null;\n\n if (mode === \"fit\") {\n resizeObserver?.observe(content);\n mutationObserver?.observe(content, {\n childList: true,\n characterData: true,\n subtree: true,\n });\n content.addEventListener(\"load\", handleContentChange, true);\n }\n\n window.addEventListener(\"resize\", scheduleFit);\n scheduleFit();\n\n return () => {\n resizeObserver?.disconnect();\n mutationObserver?.disconnect();\n\n if (mode === \"fit\") {\n content.removeEventListener(\"load\", handleContentChange, true);\n }\n\n window.removeEventListener(\"resize\", scheduleFit);\n\n if (fitFrameRef.current !== null) {\n window.cancelAnimationFrame(fitFrameRef.current);\n fitFrameRef.current = null;\n }\n };\n }, [mode, scheduleFit]);\n\n const isScaling = mode !== \"disabled\";\n\n return (\n <div\n ref={viewportRef}\n className={cn(className, isScaling && \"slide-markdown-scaling\")}\n data-markdown-slide-scaling={isScaling ? mode : undefined}\n {...props}\n >\n <div\n ref={contentRef}\n className={cn(\n \"slide-markdown-scaling__content flex w-full flex-col gap-4\",\n mode !== \"fit\" && \"slide-markdown-scaling__content--contents\"\n )}\n >\n {children}\n </div>\n </div>\n );\n};\n\nexport default MarkdownSlideScaling;\n"],"names":["SLIDE_FONT_SIZE_PROPERTY","useIsomorphicLayoutEffect","useEffect","useLayoutEffect","areFitSnapshotsEqual","left","right","MarkdownSlideScaling","children","className","mode","props","viewportRef","useRef","contentRef","fitFrameRef","isFittingRef","lastFitSnapshotRef","fitContent","useCallback","viewport","content","viewportSize","currentSnapshot","lastSnapshot","fontSize","fitPresentationFontSize","candidateFontSize","resolvePresentationBaseFontSize","scheduleFit","resizeObserver","handleContentChange","mutationObserver","isScaling","jsx","cn"],"mappings":"kQASMA,EAA2B,wBAC3BC,EACJ,OAAO,OAAW,IAAcC,EAAAA,UAAYC,EAAAA,gBAUxCC,EAAuB,CAC3BC,EACAC,IAEAD,EAAK,gBAAkBC,EAAM,eAC7BD,EAAK,eAAiBC,EAAM,cAC5BD,EAAK,OAASC,EAAM,MACpBD,EAAK,iBAAmBC,EAAM,gBAC9BD,EAAK,gBAAkBC,EAAM,cAYzBC,EAA4D,CAAC,CACjE,SAAAC,EACA,UAAAC,EACA,KAAAC,EACA,GAAGC,CACL,IAAM,CACJ,MAAMC,EAAcC,EAAAA,OAAuB,IAAI,EACzCC,EAAaD,EAAAA,OAAuB,IAAI,EACxCE,EAAcF,EAAAA,OAAsB,IAAI,EACxCG,EAAeH,EAAAA,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EACL,UAAWuB,EAAAA,GAAG1B,EAAWwB,GAAa,wBAAwB,EAC9D,8BAA6BA,EAAYvB,EAAO,OAC/C,GAAGC,EAEJ,SAAAuB,EAAAA,IAAC,MAAA,CACC,IAAKpB,EACL,UAAWqB,EAAAA,GACT,6DACAzB,IAAS,OAAS,2CAAA,EAGnB,SAAAF,CAAA,CAAA,CACH,CAAA,CAGN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownSlideScaling.es.js","sources":["../../../src/components/Slide/MarkdownSlideScaling.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useLayoutEffect, useRef } from \"react\";\n\nimport { cn } from \"../../lib/utils\";\nimport {\n fitPresentationFontSize,\n resolvePresentationBaseFontSize,\n} from \"../ContentRender/utils/presentation-scaling\";\nimport type { MarkdownScalingMode } from \"./utils/markdownScaling\";\n\nconst SLIDE_FONT_SIZE_PROPERTY = \"--mdf-slide-font-size\";\nconst useIsomorphicLayoutEffect =\n typeof window === \"undefined\" ? useEffect : useLayoutEffect;\n\ninterface MarkdownFitSnapshot {\n contentHeight: number;\n contentWidth: number;\n mode: MarkdownScalingMode;\n viewportHeight: number;\n viewportWidth: number;\n}\n\nconst areFitSnapshotsEqual = (\n left: MarkdownFitSnapshot,\n right: MarkdownFitSnapshot\n) =>\n left.contentHeight === right.contentHeight &&\n left.contentWidth === right.contentWidth &&\n left.mode === right.mode &&\n left.viewportHeight === right.viewportHeight &&\n left.viewportWidth === right.viewportWidth;\n\nexport interface MarkdownSlideScalingProps\n extends React.ComponentPropsWithoutRef<\"div\"> {\n /** Controls whether Markdown content is fitted, base-scaled, or unscaled. */\n mode: MarkdownScalingMode;\n}\n\n/**\n * Fits all Markdown elements in one logical slide with a shared font-size.\n * Keeping this boundary outside ContentRender lets accumulated title, text,\n * table, and code elements participate in the same presentation layout.\n */\nconst MarkdownSlideScaling: React.FC<MarkdownSlideScalingProps> = ({\n children,\n className,\n mode,\n ...props\n}) => {\n const viewportRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const fitFrameRef = useRef<number | null>(null);\n const isFittingRef = useRef(false);\n const lastFitSnapshotRef = useRef<MarkdownFitSnapshot | null>(null);\n\n const fitContent = useCallback(() => {\n const viewport = viewportRef.current;\n const content = contentRef.current;\n\n if (mode === \"disabled\" || !viewport || !content || isFittingRef.current) {\n return;\n }\n\n const viewportSize = {\n height: viewport.clientHeight,\n width: viewport.clientWidth,\n };\n\n if (viewportSize.height <= 0 || viewportSize.width <= 0) {\n return;\n }\n\n const currentSnapshot: MarkdownFitSnapshot = {\n contentHeight: content.scrollHeight,\n contentWidth: content.scrollWidth,\n mode,\n viewportHeight: viewportSize.height,\n viewportWidth: viewportSize.width,\n };\n const lastSnapshot = lastFitSnapshotRef.current;\n\n if (lastSnapshot && areFitSnapshotsEqual(lastSnapshot, currentSnapshot)) {\n return;\n }\n\n isFittingRef.current = true;\n\n try {\n const fontSize =\n mode === \"fit\"\n ? fitPresentationFontSize({\n viewport: viewportSize,\n measure: (candidateFontSize) => {\n content.style.setProperty(\n SLIDE_FONT_SIZE_PROPERTY,\n `${candidateFontSize}px`\n );\n\n // Read after the CSS variable update so wrapping and em-based\n // styles are included in the next compression step.\n return {\n height: content.scrollHeight,\n width: content.scrollWidth,\n };\n },\n })\n : resolvePresentationBaseFontSize(viewportSize);\n\n content.style.setProperty(SLIDE_FONT_SIZE_PROPERTY, `${fontSize}px`);\n content.dataset.markdownSlideFontSize = String(fontSize);\n lastFitSnapshotRef.current = {\n contentHeight: content.scrollHeight,\n contentWidth: content.scrollWidth,\n mode,\n viewportHeight: viewportSize.height,\n viewportWidth: viewportSize.width,\n };\n } finally {\n isFittingRef.current = false;\n }\n }, [mode]);\n\n const scheduleFit = useCallback(() => {\n if (mode === \"disabled\" || fitFrameRef.current !== null) {\n return;\n }\n\n fitFrameRef.current = window.requestAnimationFrame(() => {\n fitFrameRef.current = null;\n fitContent();\n });\n }, [fitContent, mode]);\n\n useIsomorphicLayoutEffect(() => {\n if (fitFrameRef.current !== null) {\n window.cancelAnimationFrame(fitFrameRef.current);\n fitFrameRef.current = null;\n }\n\n const content = contentRef.current;\n\n if (!content) {\n return;\n }\n\n if (mode === \"disabled\") {\n content.style.removeProperty(SLIDE_FONT_SIZE_PROPERTY);\n delete content.dataset.markdownSlideFontSize;\n lastFitSnapshotRef.current = null;\n return;\n }\n\n fitContent();\n }, [fitContent, mode]);\n\n useEffect(() => {\n const viewport = viewportRef.current;\n const content = contentRef.current;\n\n if (mode === \"disabled\" || !viewport || !content) {\n return;\n }\n\n const resizeObserver =\n typeof ResizeObserver === \"undefined\"\n ? null\n : new ResizeObserver(scheduleFit);\n resizeObserver?.observe(viewport);\n\n const handleContentChange = () => {\n lastFitSnapshotRef.current = null;\n scheduleFit();\n };\n const mutationObserver =\n mode === \"fit\" && typeof MutationObserver !== \"undefined\"\n ? new MutationObserver(handleContentChange)\n : null;\n\n if (mode === \"fit\") {\n resizeObserver?.observe(content);\n mutationObserver?.observe(content, {\n childList: true,\n characterData: true,\n subtree: true,\n });\n content.addEventListener(\"load\", handleContentChange, true);\n }\n\n window.addEventListener(\"resize\", scheduleFit);\n scheduleFit();\n\n return () => {\n resizeObserver?.disconnect();\n mutationObserver?.disconnect();\n\n if (mode === \"fit\") {\n content.removeEventListener(\"load\", handleContentChange, true);\n }\n\n window.removeEventListener(\"resize\", scheduleFit);\n\n if (fitFrameRef.current !== null) {\n window.cancelAnimationFrame(fitFrameRef.current);\n fitFrameRef.current = null;\n }\n };\n }, [mode, scheduleFit]);\n\n const isScaling = mode !== \"disabled\";\n\n return (\n <div\n ref={viewportRef}\n className={cn(className, isScaling && \"slide-markdown-scaling\")}\n data-markdown-slide-scaling={isScaling ? mode : undefined}\n {...props}\n >\n <div\n ref={contentRef}\n className={cn(\n \"slide-markdown-scaling__content flex w-full flex-col gap-4\",\n mode !== \"fit\" && \"slide-markdown-scaling__content--contents\"\n )}\n >\n {children}\n </div>\n </div>\n );\n};\n\nexport default MarkdownSlideScaling;\n"],"names":["SLIDE_FONT_SIZE_PROPERTY","useIsomorphicLayoutEffect","useEffect","useLayoutEffect","areFitSnapshotsEqual","left","right","MarkdownSlideScaling","children","className","mode","props","viewportRef","useRef","contentRef","fitFrameRef","isFittingRef","lastFitSnapshotRef","fitContent","useCallback","viewport","content","viewportSize","currentSnapshot","lastSnapshot","fontSize","fitPresentationFontSize","candidateFontSize","resolvePresentationBaseFontSize","scheduleFit","resizeObserver","handleContentChange","mutationObserver","isScaling","jsx","cn"],"mappings":";;;;AASA,MAAMA,IAA2B,yBAC3BC,IACJ,OAAO,SAAW,MAAcC,IAAYC,GAUxCC,IAAuB,CAC3BC,GACAC,MAEAD,EAAK,kBAAkBC,EAAM,iBAC7BD,EAAK,iBAAiBC,EAAM,gBAC5BD,EAAK,SAASC,EAAM,QACpBD,EAAK,mBAAmBC,EAAM,kBAC9BD,EAAK,kBAAkBC,EAAM,eAazBC,IAA4D,CAAC;AAAA,EACjE,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,MAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAcC,EAAuB,IAAI,GACzCC,IAAaD,EAAuB,IAAI,GACxCE,IAAcF,EAAsB,IAAI,GACxCG,IAAeH,EAAO,EAAK,GAC3BI,IAAqBJ,EAAmC,IAAI,GAE5DK,IAAaC,EAAY,MAAM;AACnC,UAAMC,IAAWR,EAAY,SACvBS,IAAUP,EAAW;AAE3B,QAAIJ,MAAS,cAAc,CAACU,KAAY,CAACC,KAAWL,EAAa;AAC/D;AAGF,UAAMM,IAAe;AAAA,MACnB,QAAQF,EAAS;AAAA,MACjB,OAAOA,EAAS;AAAA,IAAA;AAGlB,QAAIE,EAAa,UAAU,KAAKA,EAAa,SAAS;AACpD;AAGF,UAAMC,IAAuC;AAAA,MAC3C,eAAeF,EAAQ;AAAA,MACvB,cAAcA,EAAQ;AAAA,MACtB,MAAAX;AAAA,MACA,gBAAgBY,EAAa;AAAA,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AAA,QAAC;AAAA,QAAA;AAAA,UACC,KAAKpB;AAAA,UACL,WAAWqB;AAAA,YACT;AAAA,YACAzB,MAAS,SAAS;AAAA,UAAA;AAAA,UAGnB,UAAAF;AAAA,QAAA;AAAA,MAAA;AAAA,IACH;AAAA,EAAA;AAGN;"}
|
|
1
|
+
{"version":3,"file":"MarkdownSlideScaling.es.js","sources":["../../../src/components/Slide/MarkdownSlideScaling.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useLayoutEffect, useRef } from \"react\";\n\nimport { cn } from \"../../lib/utils\";\nimport {\n fitPresentationFontSize,\n resolvePresentationBaseFontSize,\n} from \"../ContentRender/utils/presentation-scaling\";\nimport type { MarkdownScalingMode } from \"./utils/markdownScaling\";\n\nconst SLIDE_FONT_SIZE_PROPERTY = \"--mdf-slide-font-size\";\nconst useIsomorphicLayoutEffect =\n typeof window === \"undefined\" ? useEffect : useLayoutEffect;\n\ninterface MarkdownFitSnapshot {\n contentHeight: number;\n contentWidth: number;\n mode: MarkdownScalingMode;\n viewportHeight: number;\n viewportWidth: number;\n}\n\nconst areFitSnapshotsEqual = (\n left: MarkdownFitSnapshot,\n right: MarkdownFitSnapshot\n) =>\n left.contentHeight === right.contentHeight &&\n left.contentWidth === right.contentWidth &&\n left.mode === right.mode &&\n left.viewportHeight === right.viewportHeight &&\n left.viewportWidth === right.viewportWidth;\n\nexport interface MarkdownSlideScalingProps extends React.ComponentPropsWithoutRef<\"div\"> {\n /** Controls whether Markdown content is fitted, base-scaled, or unscaled. */\n mode: MarkdownScalingMode;\n}\n\n/**\n * Fits all Markdown elements in one logical slide with a shared font-size.\n * Keeping this boundary outside ContentRender lets accumulated title, text,\n * table, and code elements participate in the same presentation layout.\n */\nconst MarkdownSlideScaling: React.FC<MarkdownSlideScalingProps> = ({\n children,\n className,\n mode,\n ...props\n}) => {\n const viewportRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const fitFrameRef = useRef<number | null>(null);\n const isFittingRef = useRef(false);\n const lastFitSnapshotRef = useRef<MarkdownFitSnapshot | null>(null);\n\n const fitContent = useCallback(() => {\n const viewport = viewportRef.current;\n const content = contentRef.current;\n\n if (mode === \"disabled\" || !viewport || !content || isFittingRef.current) {\n return;\n }\n\n const viewportSize = {\n height: viewport.clientHeight,\n width: viewport.clientWidth,\n };\n\n if (viewportSize.height <= 0 || viewportSize.width <= 0) {\n return;\n }\n\n const currentSnapshot: MarkdownFitSnapshot = {\n contentHeight: content.scrollHeight,\n contentWidth: content.scrollWidth,\n mode,\n viewportHeight: viewportSize.height,\n viewportWidth: viewportSize.width,\n };\n const lastSnapshot = lastFitSnapshotRef.current;\n\n if (lastSnapshot && areFitSnapshotsEqual(lastSnapshot, currentSnapshot)) {\n return;\n }\n\n isFittingRef.current = true;\n\n try {\n const fontSize =\n mode === \"fit\"\n ? fitPresentationFontSize({\n viewport: viewportSize,\n measure: (candidateFontSize) => {\n content.style.setProperty(\n SLIDE_FONT_SIZE_PROPERTY,\n `${candidateFontSize}px`\n );\n\n // Read after the CSS variable update so wrapping and em-based\n // styles are included in the next compression step.\n return {\n height: content.scrollHeight,\n width: content.scrollWidth,\n };\n },\n })\n : resolvePresentationBaseFontSize(viewportSize);\n\n content.style.setProperty(SLIDE_FONT_SIZE_PROPERTY, `${fontSize}px`);\n content.dataset.markdownSlideFontSize = String(fontSize);\n lastFitSnapshotRef.current = {\n contentHeight: content.scrollHeight,\n contentWidth: content.scrollWidth,\n mode,\n viewportHeight: viewportSize.height,\n viewportWidth: viewportSize.width,\n };\n } finally {\n isFittingRef.current = false;\n }\n }, [mode]);\n\n const scheduleFit = useCallback(() => {\n if (mode === \"disabled\" || fitFrameRef.current !== null) {\n return;\n }\n\n fitFrameRef.current = window.requestAnimationFrame(() => {\n fitFrameRef.current = null;\n fitContent();\n });\n }, [fitContent, mode]);\n\n useIsomorphicLayoutEffect(() => {\n if (fitFrameRef.current !== null) {\n window.cancelAnimationFrame(fitFrameRef.current);\n fitFrameRef.current = null;\n }\n\n const content = contentRef.current;\n\n if (!content) {\n return;\n }\n\n if (mode === \"disabled\") {\n content.style.removeProperty(SLIDE_FONT_SIZE_PROPERTY);\n delete content.dataset.markdownSlideFontSize;\n lastFitSnapshotRef.current = null;\n return;\n }\n\n fitContent();\n }, [fitContent, mode]);\n\n useEffect(() => {\n const viewport = viewportRef.current;\n const content = contentRef.current;\n\n if (mode === \"disabled\" || !viewport || !content) {\n return;\n }\n\n const resizeObserver =\n typeof ResizeObserver === \"undefined\"\n ? null\n : new ResizeObserver(scheduleFit);\n resizeObserver?.observe(viewport);\n\n const handleContentChange = () => {\n lastFitSnapshotRef.current = null;\n scheduleFit();\n };\n const mutationObserver =\n mode === \"fit\" && typeof MutationObserver !== \"undefined\"\n ? new MutationObserver(handleContentChange)\n : null;\n\n if (mode === \"fit\") {\n resizeObserver?.observe(content);\n mutationObserver?.observe(content, {\n childList: true,\n characterData: true,\n subtree: true,\n });\n content.addEventListener(\"load\", handleContentChange, true);\n }\n\n window.addEventListener(\"resize\", scheduleFit);\n scheduleFit();\n\n return () => {\n resizeObserver?.disconnect();\n mutationObserver?.disconnect();\n\n if (mode === \"fit\") {\n content.removeEventListener(\"load\", handleContentChange, true);\n }\n\n window.removeEventListener(\"resize\", scheduleFit);\n\n if (fitFrameRef.current !== null) {\n window.cancelAnimationFrame(fitFrameRef.current);\n fitFrameRef.current = null;\n }\n };\n }, [mode, scheduleFit]);\n\n const isScaling = mode !== \"disabled\";\n\n return (\n <div\n ref={viewportRef}\n className={cn(className, isScaling && \"slide-markdown-scaling\")}\n data-markdown-slide-scaling={isScaling ? mode : undefined}\n {...props}\n >\n <div\n ref={contentRef}\n className={cn(\n \"slide-markdown-scaling__content flex w-full flex-col gap-4\",\n mode !== \"fit\" && \"slide-markdown-scaling__content--contents\"\n )}\n >\n {children}\n </div>\n </div>\n );\n};\n\nexport default MarkdownSlideScaling;\n"],"names":["SLIDE_FONT_SIZE_PROPERTY","useIsomorphicLayoutEffect","useEffect","useLayoutEffect","areFitSnapshotsEqual","left","right","MarkdownSlideScaling","children","className","mode","props","viewportRef","useRef","contentRef","fitFrameRef","isFittingRef","lastFitSnapshotRef","fitContent","useCallback","viewport","content","viewportSize","currentSnapshot","lastSnapshot","fontSize","fitPresentationFontSize","candidateFontSize","resolvePresentationBaseFontSize","scheduleFit","resizeObserver","handleContentChange","mutationObserver","isScaling","jsx","cn"],"mappings":";;;;AASA,MAAMA,IAA2B,yBAC3BC,IACJ,OAAO,SAAW,MAAcC,IAAYC,GAUxCC,IAAuB,CAC3BC,GACAC,MAEAD,EAAK,kBAAkBC,EAAM,iBAC7BD,EAAK,iBAAiBC,EAAM,gBAC5BD,EAAK,SAASC,EAAM,QACpBD,EAAK,mBAAmBC,EAAM,kBAC9BD,EAAK,kBAAkBC,EAAM,eAYzBC,IAA4D,CAAC;AAAA,EACjE,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,MAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAcC,EAAuB,IAAI,GACzCC,IAAaD,EAAuB,IAAI,GACxCE,IAAcF,EAAsB,IAAI,GACxCG,IAAeH,EAAO,EAAK,GAC3BI,IAAqBJ,EAAmC,IAAI,GAE5DK,IAAaC,EAAY,MAAM;AACnC,UAAMC,IAAWR,EAAY,SACvBS,IAAUP,EAAW;AAE3B,QAAIJ,MAAS,cAAc,CAACU,KAAY,CAACC,KAAWL,EAAa;AAC/D;AAGF,UAAMM,IAAe;AAAA,MACnB,QAAQF,EAAS;AAAA,MACjB,OAAOA,EAAS;AAAA,IAAA;AAGlB,QAAIE,EAAa,UAAU,KAAKA,EAAa,SAAS;AACpD;AAGF,UAAMC,IAAuC;AAAA,MAC3C,eAAeF,EAAQ;AAAA,MACvB,cAAcA,EAAQ;AAAA,MACtB,MAAAX;AAAA,MACA,gBAAgBY,EAAa;AAAA,MAC7B,eAAeA,EAAa;AAAA,IAAA,GAExBE,IAAeP,EAAmB;AAExC,QAAI,EAAAO,KAAgBp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AzB,MAAS,SAAS;AAAA,UAAA;AAAA,UAGnB,UAAAF;AAAA,QAAA;AAAA,MAAA;AAAA,IACH;AAAA,EAAA;AAGN;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
2
2
|
import { Content as u } from "../../node_modules/@radix-ui/react-dialog/dist/index.es.js";
|
|
3
3
|
import { cn as n } from "../../lib/utils.es.js";
|
|
4
4
|
import { Dialog as x, DialogPortal as b, DialogOverlay as g, DialogTitle as h } from "../ui/dialog.es.js";
|
|
@@ -7,7 +7,7 @@ const w = ({
|
|
|
7
7
|
open: i,
|
|
8
8
|
dir: s,
|
|
9
9
|
lang: d,
|
|
10
|
-
labels:
|
|
10
|
+
labels: t,
|
|
11
11
|
isSubtitleEnabled: a,
|
|
12
12
|
viewMode: o,
|
|
13
13
|
container: c,
|
|
@@ -15,9 +15,9 @@ const w = ({
|
|
|
15
15
|
onOpenChange: f,
|
|
16
16
|
onSubtitleToggle: p,
|
|
17
17
|
onViewModeChange: l
|
|
18
|
-
}) => /* @__PURE__ */ e(x, { open: i, onOpenChange: f, children: /* @__PURE__ */
|
|
18
|
+
}) => /* @__PURE__ */ e(x, { open: i, onOpenChange: f, children: /* @__PURE__ */ r(b, { container: c, children: [
|
|
19
19
|
/* @__PURE__ */ e(g, { className: "z-[60] bg-black/35" }),
|
|
20
|
-
/* @__PURE__ */
|
|
20
|
+
/* @__PURE__ */ r(
|
|
21
21
|
u,
|
|
22
22
|
{
|
|
23
23
|
"aria-describedby": void 0,
|
|
@@ -30,12 +30,12 @@ const w = ({
|
|
|
30
30
|
"data-[state=open]:slide-in-from-bottom-full data-[state=closed]:slide-out-to-bottom-full"
|
|
31
31
|
),
|
|
32
32
|
children: [
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
/* @__PURE__ */ e(h, { className: "text-[15px] font-semibold leading-5 text-foreground", children:
|
|
33
|
+
/* @__PURE__ */ r("div", { className: "flex min-h-14 items-center justify-between border-b border-border px-4", children: [
|
|
34
|
+
/* @__PURE__ */ e(h, { className: "text-[15px] font-semibold leading-5 text-foreground", children: t.title }),
|
|
35
35
|
/* @__PURE__ */ e(
|
|
36
36
|
"button",
|
|
37
37
|
{
|
|
38
|
-
"aria-label":
|
|
38
|
+
"aria-label": t.closeSettings,
|
|
39
39
|
className: "inline-flex h-8 w-8 items-center justify-center rounded-full border-none bg-transparent p-0 text-foreground/70 transition-colors hover:text-foreground",
|
|
40
40
|
onClick: m,
|
|
41
41
|
type: "button",
|
|
@@ -43,7 +43,7 @@ const w = ({
|
|
|
43
43
|
}
|
|
44
44
|
)
|
|
45
45
|
] }),
|
|
46
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ r(
|
|
47
47
|
"div",
|
|
48
48
|
{
|
|
49
49
|
className: n(
|
|
@@ -51,11 +51,11 @@ const w = ({
|
|
|
51
51
|
"after:pointer-events-none after:absolute after:bottom-0 after:left-4 after:right-4 after:border-b after:border-border after:content-['']"
|
|
52
52
|
),
|
|
53
53
|
children: [
|
|
54
|
-
/* @__PURE__ */ e("span", { className: "shrink-0 text-[15px] font-semibold leading-5 text-foreground", children:
|
|
54
|
+
/* @__PURE__ */ e("span", { className: "shrink-0 text-[15px] font-semibold leading-5 text-foreground", children: t.subtitle }),
|
|
55
55
|
/* @__PURE__ */ e(
|
|
56
56
|
"button",
|
|
57
57
|
{
|
|
58
|
-
"aria-label":
|
|
58
|
+
"aria-label": t.subtitleToggle,
|
|
59
59
|
"aria-pressed": a,
|
|
60
60
|
className: "inline-flex h-6 w-6 shrink-0 items-center justify-center p-0",
|
|
61
61
|
onClick: p,
|
|
@@ -83,12 +83,12 @@ const w = ({
|
|
|
83
83
|
]
|
|
84
84
|
}
|
|
85
85
|
),
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
/* @__PURE__ */ e("span", { className: "shrink-0 text-[15px] font-semibold leading-5 text-foreground", children:
|
|
88
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ r("div", { className: "flex min-h-[72px] items-center gap-6 px-4", children: [
|
|
87
|
+
/* @__PURE__ */ e("span", { className: "shrink-0 text-[15px] font-semibold leading-5 text-foreground", children: t.screen }),
|
|
88
|
+
/* @__PURE__ */ r(
|
|
89
89
|
"div",
|
|
90
90
|
{
|
|
91
|
-
"aria-label":
|
|
91
|
+
"aria-label": t.screenMode,
|
|
92
92
|
className: "flex items-center gap-8",
|
|
93
93
|
role: "radiogroup",
|
|
94
94
|
children: [
|
|
@@ -103,7 +103,7 @@ const w = ({
|
|
|
103
103
|
onClick: () => l("nonFullscreen"),
|
|
104
104
|
role: "radio",
|
|
105
105
|
type: "button",
|
|
106
|
-
children:
|
|
106
|
+
children: t.nonFullscreen
|
|
107
107
|
}
|
|
108
108
|
),
|
|
109
109
|
/* @__PURE__ */ e(
|
|
@@ -117,7 +117,7 @@ const w = ({
|
|
|
117
117
|
onClick: () => l("fullscreen"),
|
|
118
118
|
role: "radio",
|
|
119
119
|
type: "button",
|
|
120
|
-
children:
|
|
120
|
+
children: t.fullscreen
|
|
121
121
|
}
|
|
122
122
|
)
|
|
123
123
|
]
|