markdown-flow-ui 0.3.2 → 0.3.4-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -0
- 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 -10
- 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 -0
- package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.es.js +275 -261
- package/dist/components/MarkdownFlowEditor/MarkdownFlowEditor.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/editorI18n.d.ts +22 -0
- package/dist/components/MarkdownFlowEditor/locales/ar-SA.json.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/locales/ar-SA.json.d.ts +2 -1
- package/dist/components/MarkdownFlowEditor/locales/ar-SA.json.es.js +18 -16
- 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 +2 -1
- package/dist/components/MarkdownFlowEditor/locales/de-DE.json.es.js +27 -25
- 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 +2 -1
- package/dist/components/MarkdownFlowEditor/locales/en-US.json.es.js +27 -25
- 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 +2 -1
- package/dist/components/MarkdownFlowEditor/locales/es-ES.json.es.js +11 -9
- 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 +2 -1
- package/dist/components/MarkdownFlowEditor/locales/fil-PH.json.es.js +15 -13
- 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 +2 -1
- package/dist/components/MarkdownFlowEditor/locales/fr-FR.json.es.js +23 -21
- 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 +2 -1
- package/dist/components/MarkdownFlowEditor/locales/ja-JP.json.es.js +21 -19
- 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 +2 -1
- package/dist/components/MarkdownFlowEditor/locales/th-TH.json.es.js +20 -18
- 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 +2 -1
- package/dist/components/MarkdownFlowEditor/locales/ur-PK.json.es.js +15 -13
- 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 +2 -1
- package/dist/components/MarkdownFlowEditor/locales/vi-VN.json.es.js +29 -27
- 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 +2 -1
- package/dist/components/MarkdownFlowEditor/locales/zh-CN.json.es.js +25 -23
- package/dist/components/MarkdownFlowEditor/locales/zh-CN.json.es.js.map +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/ImgPlaceholder.cjs +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/ImgPlaceholder.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/ImgPlaceholder.es.js +23 -24
- package/dist/components/MarkdownFlowEditor/plugins/ImgPlaceholder.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 +5 -1
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.es.js +161 -155
- 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.es.js +21 -22
- package/dist/components/MarkdownFlowEditor/plugins/VideoPlaceholder.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 +5 -1
- package/dist/components/MarkdownFlowEditor/utils.es.js +40 -41
- package/dist/components/MarkdownFlowEditor/utils.es.js.map +1 -1
- package/dist/markdown-flow-ui-lib.css +1 -1
- package/dist/markdown-flow-ui.css +1 -10
- 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/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-FOHPRMQF.cjs +2 -14
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-FOHPRMQF.cjs.map +1 -1
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-FOHPRMQF.es.js +6 -26
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-FOHPRMQF.es.js.map +1 -1
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-ICYGCRZG.cjs +1 -1
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-ICYGCRZG.cjs.map +1 -1
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-ICYGCRZG.es.js +2 -6
- package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-ICYGCRZG.es.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-primitive/dist/index.es.js +1 -1
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-primitive/dist/index.es.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-controllable-state/dist/index.es.js +1 -1
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-controllable-state/dist/index.es.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-primitive/dist/index.es.js +1 -1
- package/dist/node_modules/@radix-ui/react-focus-scope/node_modules/@radix-ui/react-primitive/dist/index.es.js.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/dist/index.es.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-primitive/node_modules/@radix-ui/react-slot/dist/index.es.js +1 -1
- package/dist/node_modules/@radix-ui/react-primitive/node_modules/@radix-ui/react-slot/dist/index.es.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-slot/dist/index.es.js +2 -2
- package/dist/node_modules/@radix-ui/react-slot/dist/index.es.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.es.js +1 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.es.js.map +1 -1
- package/dist/node_modules/classnames/index.cjs +1 -5
- package/dist/node_modules/classnames/index.cjs.map +1 -1
- package/dist/node_modules/classnames/index.es.js +1 -6
- package/dist/node_modules/classnames/index.es.js.map +1 -1
- package/dist/node_modules/cytoscape/dist/cytoscape.esm.cjs +3 -13
- package/dist/node_modules/cytoscape/dist/cytoscape.esm.cjs.map +1 -1
- package/dist/node_modules/cytoscape/dist/cytoscape.esm.es.js +15 -46
- package/dist/node_modules/cytoscape/dist/cytoscape.esm.es.js.map +1 -1
- package/dist/node_modules/d3-scale/src/ordinal.es.js +1 -1
- package/dist/node_modules/d3-scale/src/ordinal.es.js.map +1 -1
- package/dist/node_modules/dompurify/dist/purify.es.cjs +2 -2
- package/dist/node_modules/dompurify/dist/purify.es.cjs.map +1 -1
- package/dist/node_modules/dompurify/dist/purify.es.es.js +0 -2
- package/dist/node_modules/dompurify/dist/purify.es.es.js.map +1 -1
- package/dist/node_modules/highlight.js/lib/core.es.js +1 -1
- package/dist/node_modules/highlight.js/lib/core.es.js.map +1 -1
- package/dist/node_modules/katex/dist/katex.cjs +18 -18
- package/dist/node_modules/katex/dist/katex.cjs.map +1 -1
- package/dist/node_modules/katex/dist/katex.es.js +2716 -3120
- package/dist/node_modules/katex/dist/katex.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/Icon.cjs +1 -6
- package/dist/node_modules/lucide-react/dist/esm/Icon.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/Icon.es.js +0 -6
- package/dist/node_modules/lucide-react/dist/esm/Icon.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.cjs +1 -6
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.es.js +0 -6
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.cjs +1 -6
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.es.js +0 -6
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/captions-off.cjs +1 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/captions-off.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/captions-off.es.js +0 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/captions-off.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/captions.cjs +1 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/captions.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/captions.es.js +0 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/captions.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/check.cjs +1 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/check.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/check.es.js +0 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/check.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.cjs +1 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.es.js +0 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-down.cjs +1 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-down.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-down.es.js +0 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-down.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.cjs +1 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.es.js +0 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/copy.cjs +1 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/copy.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/copy.es.js +0 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/copy.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.cjs +1 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js +0 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/fast-forward.cjs +1 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/fast-forward.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/fast-forward.es.js +0 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/fast-forward.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/file-type.cjs +1 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/file-type.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/file-type.es.js +0 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/file-type.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.cjs +1 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.es.js +0 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/image.cjs +1 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/image.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/image.es.js +0 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/image.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.cjs +1 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.es.js +0 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/maximize.cjs +1 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/maximize.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/maximize.es.js +0 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/maximize.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/rewind.cjs +1 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/rewind.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/rewind.es.js +0 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/rewind.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/scan-line.cjs +1 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/scan-line.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/scan-line.es.js +0 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/scan-line.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-back.cjs +1 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-back.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-back.es.js +0 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-back.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-forward.cjs +1 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-forward.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-forward.es.js +0 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-forward.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/square-check.cjs +1 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/square-check.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/square-check.es.js +0 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/square-check.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/square-play.cjs +1 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/square-play.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/square-play.es.js +0 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/square-play.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/text-cursor-input.cjs +1 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/text-cursor-input.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/text-cursor-input.es.js +0 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/text-cursor-input.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/upload.cjs +1 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/upload.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/upload.es.js +0 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/upload.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/volume-2.cjs +1 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/volume-2.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/volume-2.es.js +0 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/volume-2.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/x.cjs +1 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/x.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/x.es.js +0 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/x.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.cjs +1 -6
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.es.js +0 -6
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.es.js.map +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/blockDiagram-VBNYF7ZC.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/blockDiagram-VBNYF7ZC.cjs.map +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/blockDiagram-VBNYF7ZC.es.js +1 -6
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/blockDiagram-VBNYF7ZC.es.js.map +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/dagre-VZM6K2ZE.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/dagre-VZM6K2ZE.cjs.map +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/dagre-VZM6K2ZE.es.js +0 -3
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/dagre-VZM6K2ZE.es.js.map +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-B4RE2ZJO.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-B4RE2ZJO.cjs.map +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-B4RE2ZJO.es.js +0 -2
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-B4RE2ZJO.es.js.map +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-7S7Q4E2Y.cjs +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-7S7Q4E2Y.cjs.map +1 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-7S7Q4E2Y.es.js +0 -1
- package/dist/node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-7S7Q4E2Y.es.js.map +1 -1
- package/dist/node_modules/mermaid/dist/mermaid.core.cjs +1 -3
- package/dist/node_modules/mermaid/dist/mermaid.core.cjs.map +1 -1
- package/dist/node_modules/mermaid/dist/mermaid.core.es.js +0 -4
- package/dist/node_modules/mermaid/dist/mermaid.core.es.js.map +1 -1
- package/dist/node_modules/rc-util/es/React/isFragment.es.js +1 -1
- package/dist/node_modules/rc-util/es/React/isFragment.es.js.map +1 -1
- package/dist/node_modules/rc-util/node_modules/react-is/cjs/react-is.development.cjs +1 -9
- package/dist/node_modules/rc-util/node_modules/react-is/cjs/react-is.development.cjs.map +1 -1
- package/dist/node_modules/rc-util/node_modules/react-is/cjs/react-is.development.es.js +2 -11
- package/dist/node_modules/rc-util/node_modules/react-is/cjs/react-is.development.es.js.map +1 -1
- package/dist/node_modules/rc-util/node_modules/react-is/cjs/react-is.production.min.cjs +1 -9
- package/dist/node_modules/rc-util/node_modules/react-is/cjs/react-is.production.min.cjs.map +1 -1
- package/dist/node_modules/rc-util/node_modules/react-is/cjs/react-is.production.min.es.js +2 -11
- package/dist/node_modules/rc-util/node_modules/react-is/cjs/react-is.production.min.es.js.map +1 -1
- package/dist/node_modules/style-mod/src/style-mod.es.js +1 -1
- package/dist/node_modules/style-mod/src/style-mod.es.js.map +1 -1
- package/package.json +21 -20
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const n = "Nhập '/' để chèn nội dung", o = "Nhập nội dung của bạn",
|
|
1
|
+
const n = "Nhập '/' để chèn nội dung", o = "Nhập nội dung của bạn", e = "Nhập nội dung của bạn, gõ '/' để xem thêm tùy chọn", t = "Cài đặt", i = "Đóng", l = "Thêm hình ảnh", c = "Thêm video", h = "Nhập URL hình ảnh", Z = "URL", a = "Xem trước", s = "Nhập tiêu đề hình ảnh", d = "Dùng hình ảnh", r = "Tên hình ảnh", u = "Tải lên", g = "Kéo thả tệp vào đây hoặc nhấp để tải lên", b = "Đang tải lên...", p = "Tải lên thành công", v = "Tải lên thất bại, vui lòng thử lại", m = "Thêm văn bản cố định", T = "Văn bản cố định", U = "Đường phân cách", C = "Tiêu đề hình ảnh", L = "Tỷ lệ", _ = "Hủy", B = "Nhập URL hình ảnh", I = "Nhập URL hình ảnh hợp lệ", x = "Nhập URL video Bilibili hoặc YouTube", $ = "URL", N = "Xem trước", P = "Dùng tài nguyên", V = "Nhập tiêu đề video", R = "Tiêu đề", f = "Tiêu đề video", D = "Video Bilibili", y = "Video YouTube", k = "Nhập URL video Bilibili hoặc YouTube hợp lệ", nn = "Hủy", Y = "Dùng video", q = "Bản xem trước sẽ xuất hiện ở đây", E = "Xem trước video", H = "Hình ảnh", O = "Video", S = "Văn bản cố định", X = "Chèn kết quả xác nhận", w = "Chèn liên kết", F = "Chèn nút", K = "Chèn lựa chọn đơn", M = "Lựa chọn 1", Q = "Lựa chọn 2", j = "Chèn lựa chọn nhiều đáp án", z = "Chèn ô nhập liệu", A = "Vui lòng nhập", G = "Chèn hình ảnh", J = "Chèn video", W = "Câu hỏi của bạn", on = {
|
|
2
2
|
placeholder: n,
|
|
3
3
|
placeholderCodeEdit: o,
|
|
4
|
-
placeholderQuickEdit:
|
|
5
|
-
dialogTitle:
|
|
4
|
+
placeholderQuickEdit: e,
|
|
5
|
+
dialogTitle: t,
|
|
6
6
|
dialogCloseLabel: i,
|
|
7
7
|
dialogTitleImage: l,
|
|
8
8
|
dialogTitleVideo: c,
|
|
@@ -28,8 +28,8 @@ const n = "Nhập '/' để chèn nội dung", o = "Nhập nội dung của bạ
|
|
|
28
28
|
videoUrlPlaceholder: x,
|
|
29
29
|
videoUrlLabel: "URL",
|
|
30
30
|
videoRunButton: N,
|
|
31
|
-
videoUseButton:
|
|
32
|
-
videoTitlePlaceholder:
|
|
31
|
+
videoUseButton: P,
|
|
32
|
+
videoTitlePlaceholder: V,
|
|
33
33
|
videoTitleLabel: R,
|
|
34
34
|
videoDefaultTitle: f,
|
|
35
35
|
videoDefaultTitleBilibili: D,
|
|
@@ -37,12 +37,12 @@ const n = "Nhập '/' để chèn nội dung", o = "Nhập nội dung của bạ
|
|
|
37
37
|
videoInvalidUrl: k,
|
|
38
38
|
videoCancelButton: "Hủy",
|
|
39
39
|
videoUseVideoButton: Y,
|
|
40
|
-
videoPreviewPlaceholder:
|
|
41
|
-
videoPreviewTitle:
|
|
42
|
-
slashImage:
|
|
43
|
-
slashVideo:
|
|
44
|
-
slashFixedText:
|
|
45
|
-
toolbarConfirmOutput:
|
|
40
|
+
videoPreviewPlaceholder: q,
|
|
41
|
+
videoPreviewTitle: E,
|
|
42
|
+
slashImage: H,
|
|
43
|
+
slashVideo: O,
|
|
44
|
+
slashFixedText: S,
|
|
45
|
+
toolbarConfirmOutput: X,
|
|
46
46
|
toolbarInsertLink: w,
|
|
47
47
|
toolbarInsertButton: F,
|
|
48
48
|
toolbarInsertSingleChoice: K,
|
|
@@ -52,17 +52,18 @@ const n = "Nhập '/' để chèn nội dung", o = "Nhập nội dung của bạ
|
|
|
52
52
|
toolbarInsertInput: z,
|
|
53
53
|
toolbarInputPlaceholder: A,
|
|
54
54
|
toolbarInsertImage: G,
|
|
55
|
-
toolbarInsertVideo: J
|
|
55
|
+
toolbarInsertVideo: J,
|
|
56
|
+
questionPlaceholder: W
|
|
56
57
|
};
|
|
57
58
|
export {
|
|
58
|
-
|
|
59
|
+
on as default,
|
|
59
60
|
i as dialogCloseLabel,
|
|
60
|
-
|
|
61
|
+
t as dialogTitle,
|
|
61
62
|
l as dialogTitleImage,
|
|
62
63
|
c as dialogTitleVideo,
|
|
63
64
|
m as fixedTextPlaceholder,
|
|
64
65
|
T as fixedTextTooltip,
|
|
65
|
-
|
|
66
|
+
_ as imageCancelButton,
|
|
66
67
|
r as imageDefaultTitle,
|
|
67
68
|
I as imageInvalidUrl,
|
|
68
69
|
a as imageRunButton,
|
|
@@ -74,20 +75,21 @@ export {
|
|
|
74
75
|
g as imageUploadPlaceholder,
|
|
75
76
|
p as imageUploadSuccess,
|
|
76
77
|
b as imageUploading,
|
|
77
|
-
|
|
78
|
+
Z as imageUrlLabel,
|
|
78
79
|
h as imageUrlPlaceholder,
|
|
79
80
|
B as imageUrlRequired,
|
|
80
81
|
d as imageUseButton,
|
|
81
82
|
n as placeholder,
|
|
82
83
|
o as placeholderCodeEdit,
|
|
83
|
-
|
|
84
|
+
e as placeholderQuickEdit,
|
|
85
|
+
W as questionPlaceholder,
|
|
84
86
|
U as slashDivider,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
87
|
+
S as slashFixedText,
|
|
88
|
+
H as slashImage,
|
|
89
|
+
O as slashVideo,
|
|
88
90
|
M as toolbarChoiceOption1,
|
|
89
91
|
Q as toolbarChoiceOption2,
|
|
90
|
-
|
|
92
|
+
X as toolbarConfirmOutput,
|
|
91
93
|
A as toolbarInputPlaceholder,
|
|
92
94
|
F as toolbarInsertButton,
|
|
93
95
|
G as toolbarInsertImage,
|
|
@@ -96,19 +98,19 @@ export {
|
|
|
96
98
|
j as toolbarInsertMultiChoice,
|
|
97
99
|
K as toolbarInsertSingleChoice,
|
|
98
100
|
J as toolbarInsertVideo,
|
|
99
|
-
|
|
101
|
+
nn as videoCancelButton,
|
|
100
102
|
f as videoDefaultTitle,
|
|
101
103
|
D as videoDefaultTitleBilibili,
|
|
102
104
|
y as videoDefaultTitleYoutube,
|
|
103
105
|
k as videoInvalidUrl,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
+
q as videoPreviewPlaceholder,
|
|
107
|
+
E as videoPreviewTitle,
|
|
106
108
|
N as videoRunButton,
|
|
107
109
|
R as videoTitleLabel,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
+
V as videoTitlePlaceholder,
|
|
111
|
+
$ as videoUrlLabel,
|
|
110
112
|
x as videoUrlPlaceholder,
|
|
111
|
-
|
|
113
|
+
P as videoUseButton,
|
|
112
114
|
Y as videoUseVideoButton
|
|
113
115
|
};
|
|
114
116
|
//# sourceMappingURL=vi-VN.json.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vi-VN.json.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vi-VN.json.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="输入'/'快速插入内容",o="请输入你的内容",t="请输入你的内容,输入 / 唤起更多",l="设置",i="关闭",a="添加图片",n="添加视频",s="请输入图片地址",
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="输入'/'快速插入内容",o="请输入你的内容",t="请输入你的内容,输入 / 唤起更多",l="设置",i="关闭",a="添加图片",n="添加视频",s="请输入图片地址",c="URL",d="预览",r="请输入图片标题",u="使用图片",g="图片名称",b="上传",h="拖拽文件或点击上传",m="正在上传...",v="上传完成",T="上传失败,请重试",U="添加固定文本",p="固定文本",I="分割线",P="图片标题",B="缩放比例",C="取消",L="请输入图片地址",f="请输入有效的图片地址",x="请输入 B 站或 YouTube 视频链接",D="URL",R="预览",S="使用资源",V="请输入视频标题",O="标题",E="视频标题",Y="哔哩哔哩视频",k="YouTube 视频",q="请输入有效的 B 站或 YouTube 视频链接",w="取消",M="使用视频",F="预览将在这里显示",Q="视频预览",_="图片",j="视频",y="固定文本",z="插入确定内容",N="插入链接",A="插入按钮",G="插入单选",H="选项1",J="选项2",K="插入多选",W="插入输入框",X="请输入",Z="插入图片",$="插入视频",ee="你的问题",oe={placeholder:e,placeholderCodeEdit:o,placeholderQuickEdit:t,dialogTitle:l,dialogCloseLabel:i,dialogTitleImage:a,dialogTitleVideo:n,imageUrlPlaceholder:s,imageUrlLabel:c,imageRunButton:d,imageTitlePlaceholder:r,imageUseButton:u,imageDefaultTitle:g,imageUploadLabel:b,imageUploadPlaceholder:h,imageUploading:m,imageUploadSuccess:v,imageUploadError:T,fixedTextPlaceholder:U,fixedTextTooltip:p,slashDivider:I,imageTitleLabel:P,imageScaleLabel:B,imageCancelButton:C,imageUrlRequired:L,imageInvalidUrl:f,videoUrlPlaceholder:x,videoUrlLabel:D,videoRunButton:R,videoUseButton:S,videoTitlePlaceholder:V,videoTitleLabel:O,videoDefaultTitle:E,videoDefaultTitleBilibili:Y,videoDefaultTitleYoutube:k,videoInvalidUrl:q,videoCancelButton:w,videoUseVideoButton:M,videoPreviewPlaceholder:F,videoPreviewTitle:Q,slashImage:_,slashVideo:j,slashFixedText:y,toolbarConfirmOutput:z,toolbarInsertLink:N,toolbarInsertButton:A,toolbarInsertSingleChoice:G,toolbarChoiceOption1:H,toolbarChoiceOption2:J,toolbarInsertMultiChoice:K,toolbarInsertInput:W,toolbarInputPlaceholder:X,toolbarInsertImage:Z,toolbarInsertVideo:$,questionPlaceholder:ee};exports.default=oe;exports.dialogCloseLabel=i;exports.dialogTitle=l;exports.dialogTitleImage=a;exports.dialogTitleVideo=n;exports.fixedTextPlaceholder=U;exports.fixedTextTooltip=p;exports.imageCancelButton=C;exports.imageDefaultTitle=g;exports.imageInvalidUrl=f;exports.imageRunButton=d;exports.imageScaleLabel=B;exports.imageTitleLabel=P;exports.imageTitlePlaceholder=r;exports.imageUploadError=T;exports.imageUploadLabel=b;exports.imageUploadPlaceholder=h;exports.imageUploadSuccess=v;exports.imageUploading=m;exports.imageUrlLabel=c;exports.imageUrlPlaceholder=s;exports.imageUrlRequired=L;exports.imageUseButton=u;exports.placeholder=e;exports.placeholderCodeEdit=o;exports.placeholderQuickEdit=t;exports.questionPlaceholder=ee;exports.slashDivider=I;exports.slashFixedText=y;exports.slashImage=_;exports.slashVideo=j;exports.toolbarChoiceOption1=H;exports.toolbarChoiceOption2=J;exports.toolbarConfirmOutput=z;exports.toolbarInputPlaceholder=X;exports.toolbarInsertButton=A;exports.toolbarInsertImage=Z;exports.toolbarInsertInput=W;exports.toolbarInsertLink=N;exports.toolbarInsertMultiChoice=K;exports.toolbarInsertSingleChoice=G;exports.toolbarInsertVideo=$;exports.videoCancelButton=w;exports.videoDefaultTitle=E;exports.videoDefaultTitleBilibili=Y;exports.videoDefaultTitleYoutube=k;exports.videoInvalidUrl=q;exports.videoPreviewPlaceholder=F;exports.videoPreviewTitle=Q;exports.videoRunButton=R;exports.videoTitleLabel=O;exports.videoTitlePlaceholder=V;exports.videoUrlLabel=D;exports.videoUrlPlaceholder=x;exports.videoUseButton=S;exports.videoUseVideoButton=M;
|
|
2
2
|
//# sourceMappingURL=zh-CN.json.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const o = "输入'/'快速插入内容", e = "请输入你的内容", t = "请输入你的内容,输入 / 唤起更多",
|
|
1
|
+
const o = "输入'/'快速插入内容", e = "请输入你的内容", t = "请输入你的内容,输入 / 唤起更多", M = "设置", N = "关闭", l = "添加图片", i = "添加视频", n = "请输入图片地址", Q = "URL", j = "预览", a = "请输入图片标题", s = "使用图片", c = "图片名称", y = "上传", d = "拖拽文件或点击上传", r = "正在上传...", u = "上传完成", g = "上传失败,请重试", b = "添加固定文本", h = "固定文本", A = "分割线", m = "图片标题", v = "缩放比例", G = "取消", T = "请输入图片地址", U = "请输入有效的图片地址", p = "请输入 B 站或 YouTube 视频链接", H = "URL", J = "预览", I = "使用资源", B = "请输入视频标题", K = "标题", C = "视频标题", L = "哔哩哔哩视频", P = "YouTube 视频", f = "请输入有效的 B 站或 YouTube 视频链接", W = "取消", x = "使用视频", R = "预览将在这里显示", D = "视频预览", X = "图片", Z = "视频", O = "固定文本", V = "插入确定内容", Y = "插入链接", E = "插入按钮", S = "插入单选", _ = "选项1", $ = "选项2", k = "插入多选", q = "插入输入框", oo = "请输入", w = "插入图片", z = "插入视频", F = "你的问题", eo = {
|
|
2
2
|
placeholder: o,
|
|
3
3
|
placeholderCodeEdit: e,
|
|
4
4
|
placeholderQuickEdit: t,
|
|
@@ -49,64 +49,66 @@ const o = "输入'/'快速插入内容", e = "请输入你的内容", t = "请
|
|
|
49
49
|
toolbarChoiceOption1: "选项1",
|
|
50
50
|
toolbarChoiceOption2: "选项2",
|
|
51
51
|
toolbarInsertMultiChoice: k,
|
|
52
|
-
toolbarInsertInput:
|
|
52
|
+
toolbarInsertInput: q,
|
|
53
53
|
toolbarInputPlaceholder: "请输入",
|
|
54
|
-
toolbarInsertImage:
|
|
55
|
-
toolbarInsertVideo: z
|
|
54
|
+
toolbarInsertImage: w,
|
|
55
|
+
toolbarInsertVideo: z,
|
|
56
|
+
questionPlaceholder: F
|
|
56
57
|
};
|
|
57
58
|
export {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
eo as default,
|
|
60
|
+
N as dialogCloseLabel,
|
|
61
|
+
M as dialogTitle,
|
|
61
62
|
l as dialogTitleImage,
|
|
62
63
|
i as dialogTitleVideo,
|
|
63
64
|
b as fixedTextPlaceholder,
|
|
64
65
|
h as fixedTextTooltip,
|
|
65
|
-
|
|
66
|
+
G as imageCancelButton,
|
|
66
67
|
c as imageDefaultTitle,
|
|
67
68
|
U as imageInvalidUrl,
|
|
68
|
-
|
|
69
|
+
j as imageRunButton,
|
|
69
70
|
v as imageScaleLabel,
|
|
70
71
|
m as imageTitleLabel,
|
|
71
72
|
a as imageTitlePlaceholder,
|
|
72
73
|
g as imageUploadError,
|
|
73
|
-
|
|
74
|
+
y as imageUploadLabel,
|
|
74
75
|
d as imageUploadPlaceholder,
|
|
75
76
|
u as imageUploadSuccess,
|
|
76
77
|
r as imageUploading,
|
|
77
|
-
|
|
78
|
+
Q as imageUrlLabel,
|
|
78
79
|
n as imageUrlPlaceholder,
|
|
79
80
|
T as imageUrlRequired,
|
|
80
81
|
s as imageUseButton,
|
|
81
82
|
o as placeholder,
|
|
82
83
|
e as placeholderCodeEdit,
|
|
83
84
|
t as placeholderQuickEdit,
|
|
84
|
-
|
|
85
|
+
F as questionPlaceholder,
|
|
86
|
+
A as slashDivider,
|
|
85
87
|
O as slashFixedText,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
X as slashImage,
|
|
89
|
+
Z as slashVideo,
|
|
90
|
+
_ as toolbarChoiceOption1,
|
|
91
|
+
$ as toolbarChoiceOption2,
|
|
90
92
|
V as toolbarConfirmOutput,
|
|
91
|
-
|
|
93
|
+
oo as toolbarInputPlaceholder,
|
|
92
94
|
E as toolbarInsertButton,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
+
w as toolbarInsertImage,
|
|
96
|
+
q as toolbarInsertInput,
|
|
95
97
|
Y as toolbarInsertLink,
|
|
96
98
|
k as toolbarInsertMultiChoice,
|
|
97
99
|
S as toolbarInsertSingleChoice,
|
|
98
100
|
z as toolbarInsertVideo,
|
|
99
|
-
|
|
101
|
+
W as videoCancelButton,
|
|
100
102
|
C as videoDefaultTitle,
|
|
101
103
|
L as videoDefaultTitleBilibili,
|
|
102
104
|
P as videoDefaultTitleYoutube,
|
|
103
105
|
f as videoInvalidUrl,
|
|
104
106
|
R as videoPreviewPlaceholder,
|
|
105
107
|
D as videoPreviewTitle,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
+
J as videoRunButton,
|
|
109
|
+
K as videoTitleLabel,
|
|
108
110
|
B as videoTitlePlaceholder,
|
|
109
|
-
|
|
111
|
+
H as videoUrlLabel,
|
|
110
112
|
p as videoUrlPlaceholder,
|
|
111
113
|
I as videoUseButton,
|
|
112
114
|
x as videoUseVideoButton
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zh-CN.json.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"zh-CN.json.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("../../../node_modules/@codemirror/view/dist/index.cjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("../../../node_modules/@codemirror/view/dist/index.cjs"),x=require("../types.cjs"),p=require("../utils.cjs"),b=require("./PlaceholderWidget.cjs"),u=require("./mediaPlaceholderLabels.cjs"),P=/!\[([^\]]*)\]\(([^)]+)\)|<img\b[^>]*>/i,w=/===\s*(?:!\[[^\]]*\]\([^)]+\)|<img\b[^>]*>)\s*===|!\[[^\]]*\]\([^)]+\)|<img\b[^>]*>/gi,l=(e,c)=>{const t=new RegExp(`${c}\\s*=\\s*("(.*?)"|'(.*?)'|([^\\s"'<>]+))`,"i"),r=e.match(t);if(r)return r[2]??r[3]??r[4]},M=e=>Math.max(1,Math.min(1e3,Math.round(e))),D=e=>{const c=e?.[0]??"",t=p.unwrapFixedOutput(c),r=/^\s*===/.test(c);if(/^<img\b/i.test(t)){const n=l(t,"src")??"",d=l(t,"alt")??l(t,"title")??"",h=l(t,"width");let m;if(h){const g=Number.parseFloat(h);Number.isFinite(g)&&(m=M(g))}return{text:d,url:n,title:d,scalePercent:m,fixedOutput:r}}const s=t.match(P),o=s?.[1]??"",a=s?.[2]??"";return{text:o,url:a,title:o,scalePercent:void 0,fixedOutput:r}},f=e=>{const c=p.findDocumentVariableMarkers(e.state.doc.toString()).filter(t=>t.name!==null);return new i.MatchDecorator({regexp:w,decoration:(t,r,s)=>{const o=s+t[0].length;if(c.some(n=>s<n.end&&o>n.start))return null;const a=D(t);return i.Decoration.replace({widget:new b.default(a.text||r.state.facet(u.mediaPlaceholderLabels).image,{tag:"image",url:a.url,title:a.title,scalePercent:a.scalePercent,fixedOutput:a.fixedOutput},"tag-image",x.SelectedOption.Image,r)})}})},v=i.ViewPlugin.fromClass(class{constructor(e){this.matcher=f(e),this.placeholders=this.matcher.createDeco(e)}update(e){if(e.docChanged&&(this.matcher=f(e.view)),e.docChanged||e.startState.facet(u.mediaPlaceholderLabels)!==e.state.facet(u.mediaPlaceholderLabels)){this.placeholders=this.matcher.createDeco(e.view);return}this.placeholders=this.matcher.updateDeco(e,this.placeholders)}},{decorations:e=>e.placeholders,provide:e=>i.EditorView.atomicRanges.of(c=>c.plugin(e)?.placeholders||i.Decoration.none)});exports.default=v;
|
|
2
2
|
//# sourceMappingURL=ImgPlaceholder.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImgPlaceholder.cjs","sources":["../../../../src/components/MarkdownFlowEditor/plugins/ImgPlaceholder.ts"],"sourcesContent":["import {\n EditorView,\n Decoration,\n DecorationSet,\n ViewPlugin,\n ViewUpdate,\n MatchDecorator,\n} from \"@codemirror/view\";\nimport { SelectedOption } from \"../types\";\nimport { findDocumentVariableMarkers, unwrapFixedOutput } from \"../utils\";\nimport PlaceholderWidget from \"./PlaceholderWidget\";\nimport { mediaPlaceholderLabels } from \"./mediaPlaceholderLabels\";\n\nconst imageMarkupRegexp = /!\\[([^\\]]*)\\]\\(([^)]+)\\)|<img\\b[^>]*>/i;\nconst agiImgContextRegexp =\n /===\\s*(?:!\\[[^\\]]*\\]\\([^)]+\\)|<img\\b[^>]*>)\\s*===|!\\[[^\\]]*\\]\\([^)]+\\)|<img\\b[^>]*>/gi;\n\nconst extractAttributeValue = (tag: string, attribute: string) => {\n const regexp = new RegExp(\n `${attribute}\\\\s*=\\\\s*(\"(.*?)\"|'(.*?)'|([^\\\\s\"'<>]+))`,\n \"i\"\n );\n const match = tag.match(regexp);\n if (!match) return undefined;\n return match[2] ?? match[3] ?? match[4];\n};\n\nconst clampScalePercent = (value: number) =>\n Math.max(1, Math.min(1000, Math.round(value)));\n\nconst getImageMatchInfo = (match: RegExpMatchArray) => {\n const source = match?.[0] ?? \"\";\n const raw = unwrapFixedOutput(source);\n const fixedOutput = /^\\s*===/.test(source);\n if (/^<img\\b/i.test(raw)) {\n const src = extractAttributeValue(raw, \"src\") ?? \"\";\n const alt =\n extractAttributeValue(raw, \"alt\") ??\n extractAttributeValue(raw, \"title\") ??\n \"\";\n const widthAttr = extractAttributeValue(raw, \"width\");\n let scalePercent: number | undefined;\n if (widthAttr) {\n const numeric = Number.parseFloat(widthAttr);\n if (Number.isFinite(numeric)) {\n scalePercent = clampScalePercent(numeric);\n }\n }\n return {\n text: alt,\n url: src,\n title: alt,\n scalePercent,\n fixedOutput,\n };\n }\n const markdownMatch = raw.match(imageMarkupRegexp);\n const title = markdownMatch?.[1] ?? \"\";\n const url = markdownMatch?.[2] ?? \"\";\n return {\n text: title,\n url,\n title,\n scalePercent: undefined,\n fixedOutput,\n };\n};\n\nconst createImageUrlMatcher = (view: EditorView) => {\n const variables = findDocumentVariableMarkers(\n view.state.doc.toString()\n ).filter((marker) => marker.name !== null);\n return new MatchDecorator({\n regexp: agiImgContextRegexp,\n decoration: (match, view, from) => {\n const to = from + match[0].length;\n if (variables.some((marker) => from < marker.end && to > marker.start)) {\n return null;\n }\n const info = getImageMatchInfo(match);\n return Decoration.replace({\n widget: new PlaceholderWidget(\n info.text || view.state.facet(mediaPlaceholderLabels).image,\n {\n tag: \"image\",\n url: info.url,\n title: info.title,\n scalePercent: info.scalePercent,\n fixedOutput: info.fixedOutput,\n },\n \"tag-image\",\n SelectedOption.Image,\n view\n ),\n });\n },\n });\n};\n\nconst ImgPlaceholder = ViewPlugin.fromClass(\n class {\n placeholders: DecorationSet;\n matcher: MatchDecorator;\n constructor(view: EditorView) {\n this.matcher = createImageUrlMatcher(view);\n this.placeholders = this.matcher.createDeco(view);\n }\n update(update: ViewUpdate) {\n if (update.docChanged) {\n this.matcher = createImageUrlMatcher(update.view);\n }\n if (\n update.docChanged ||\n update.startState.facet(mediaPlaceholderLabels) !==\n update.state.facet(mediaPlaceholderLabels)\n ) {\n this.placeholders = this.matcher.createDeco(update.view);\n return;\n }\n this.placeholders = this.matcher.updateDeco(update, this.placeholders);\n }\n },\n {\n decorations: (instance) => instance.placeholders,\n provide: (plugin) =>\n EditorView.atomicRanges.of((view) => {\n return view.plugin(plugin)?.placeholders || Decoration.none;\n }),\n }\n);\n\nexport default ImgPlaceholder;\n"],"names":["imageMarkupRegexp","agiImgContextRegexp","extractAttributeValue","tag","attribute","regexp","match","clampScalePercent","value","getImageMatchInfo","source","raw","unwrapFixedOutput","fixedOutput","src","alt","widthAttr","scalePercent","numeric","markdownMatch","title","url","createImageUrlMatcher","view","variables","findDocumentVariableMarkers","marker","MatchDecorator","from","to","info","Decoration","PlaceholderWidget","mediaPlaceholderLabels","SelectedOption","ImgPlaceholder","ViewPlugin","update","instance","plugin","EditorView"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ImgPlaceholder.cjs","sources":["../../../../src/components/MarkdownFlowEditor/plugins/ImgPlaceholder.ts"],"sourcesContent":["import {\n EditorView,\n Decoration,\n DecorationSet,\n ViewPlugin,\n ViewUpdate,\n MatchDecorator,\n} from \"@codemirror/view\";\nimport { SelectedOption } from \"../types\";\nimport { findDocumentVariableMarkers, unwrapFixedOutput } from \"../utils\";\nimport PlaceholderWidget from \"./PlaceholderWidget\";\nimport { mediaPlaceholderLabels } from \"./mediaPlaceholderLabels\";\n\nconst imageMarkupRegexp = /!\\[([^\\]]*)\\]\\(([^)]+)\\)|<img\\b[^>]*>/i;\nconst agiImgContextRegexp =\n /===\\s*(?:!\\[[^\\]]*\\]\\([^)]+\\)|<img\\b[^>]*>)\\s*===|!\\[[^\\]]*\\]\\([^)]+\\)|<img\\b[^>]*>/gi;\n\nconst extractAttributeValue = (tag: string, attribute: string) => {\n const regexp = new RegExp(\n `${attribute}\\\\s*=\\\\s*(\"(.*?)\"|'(.*?)'|([^\\\\s\"'<>]+))`,\n \"i\"\n );\n const match = tag.match(regexp);\n if (!match) return undefined;\n return match[2] ?? match[3] ?? match[4];\n};\n\nconst clampScalePercent = (value: number) =>\n Math.max(1, Math.min(1000, Math.round(value)));\n\nconst getImageMatchInfo = (match: RegExpMatchArray) => {\n const source = match?.[0] ?? \"\";\n const raw = unwrapFixedOutput(source);\n const fixedOutput = /^\\s*===/.test(source);\n if (/^<img\\b/i.test(raw)) {\n const src = extractAttributeValue(raw, \"src\") ?? \"\";\n const alt =\n extractAttributeValue(raw, \"alt\") ??\n extractAttributeValue(raw, \"title\") ??\n \"\";\n const widthAttr = extractAttributeValue(raw, \"width\");\n let scalePercent: number | undefined;\n if (widthAttr) {\n const numeric = Number.parseFloat(widthAttr);\n if (Number.isFinite(numeric)) {\n scalePercent = clampScalePercent(numeric);\n }\n }\n return {\n text: alt,\n url: src,\n title: alt,\n scalePercent,\n fixedOutput,\n };\n }\n const markdownMatch = raw.match(imageMarkupRegexp);\n const title = markdownMatch?.[1] ?? \"\";\n const url = markdownMatch?.[2] ?? \"\";\n return {\n text: title,\n url,\n title,\n scalePercent: undefined,\n fixedOutput,\n };\n};\n\nconst createImageUrlMatcher = (view: EditorView) => {\n const variables = findDocumentVariableMarkers(\n view.state.doc.toString()\n ).filter((marker) => marker.name !== null);\n return new MatchDecorator({\n regexp: agiImgContextRegexp,\n decoration: (match, view, from) => {\n const to = from + match[0].length;\n if (variables.some((marker) => from < marker.end && to > marker.start)) {\n return null;\n }\n const info = getImageMatchInfo(match);\n return Decoration.replace({\n widget: new PlaceholderWidget(\n info.text || view.state.facet(mediaPlaceholderLabels).image,\n {\n tag: \"image\",\n url: info.url,\n title: info.title,\n scalePercent: info.scalePercent,\n fixedOutput: info.fixedOutput,\n },\n \"tag-image\",\n SelectedOption.Image,\n view\n ),\n });\n },\n });\n};\n\nconst ImgPlaceholder = ViewPlugin.fromClass(\n class {\n placeholders: DecorationSet;\n matcher: MatchDecorator;\n constructor(view: EditorView) {\n this.matcher = createImageUrlMatcher(view);\n this.placeholders = this.matcher.createDeco(view);\n }\n update(update: ViewUpdate) {\n if (update.docChanged) {\n this.matcher = createImageUrlMatcher(update.view);\n }\n if (\n update.docChanged ||\n update.startState.facet(mediaPlaceholderLabels) !==\n update.state.facet(mediaPlaceholderLabels)\n ) {\n this.placeholders = this.matcher.createDeco(update.view);\n return;\n }\n this.placeholders = this.matcher.updateDeco(update, this.placeholders);\n }\n },\n {\n decorations: (instance) => instance.placeholders,\n provide: (plugin) =>\n EditorView.atomicRanges.of((view) => {\n return view.plugin(plugin)?.placeholders || Decoration.none;\n }),\n }\n);\n\nexport default ImgPlaceholder;\n"],"names":["imageMarkupRegexp","agiImgContextRegexp","extractAttributeValue","tag","attribute","regexp","match","clampScalePercent","value","getImageMatchInfo","source","raw","unwrapFixedOutput","fixedOutput","src","alt","widthAttr","scalePercent","numeric","markdownMatch","title","url","createImageUrlMatcher","view","variables","findDocumentVariableMarkers","marker","MatchDecorator","from","to","info","Decoration","PlaceholderWidget","mediaPlaceholderLabels","SelectedOption","ImgPlaceholder","ViewPlugin","update","instance","plugin","EditorView"],"mappings":"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"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { ViewPlugin as f, EditorView as x, Decoration as p, MatchDecorator as w } from "../../../node_modules/@codemirror/view/dist/index.es.js";
|
|
2
2
|
import { SelectedOption as b } from "../types.es.js";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
3
|
+
import { findDocumentVariableMarkers as M, unwrapFixedOutput as P } from "../utils.es.js";
|
|
4
|
+
import D from "./PlaceholderWidget.es.js";
|
|
5
5
|
import { mediaPlaceholderLabels as l } from "./mediaPlaceholderLabels.es.js";
|
|
6
|
-
import { d as D } from "../../../_virtual/index.es.js";
|
|
7
6
|
const I = /!\[([^\]]*)\]\(([^)]+)\)|<img\b[^>]*>/i, O = /===\s*(?:!\[[^\]]*\]\([^)]+\)|<img\b[^>]*>)\s*===|!\[[^\]]*\]\([^)]+\)|<img\b[^>]*>/gi, n = (t, c) => {
|
|
8
7
|
const e = new RegExp(
|
|
9
8
|
`${c}\\s*=\\s*("(.*?)"|'(.*?)'|([^\\s"'<>]+))`,
|
|
@@ -12,50 +11,50 @@ const I = /!\[([^\]]*)\]\(([^)]+)\)|<img\b[^>]*>/i, O = /===\s*(?:!\[[^\]]*\]\([
|
|
|
12
11
|
if (r)
|
|
13
12
|
return r[2] ?? r[3] ?? r[4];
|
|
14
13
|
}, v = (t) => Math.max(1, Math.min(1e3, Math.round(t))), C = (t) => {
|
|
15
|
-
const c = t?.[0] ?? "", e =
|
|
14
|
+
const c = t?.[0] ?? "", e = P(c), r = /^\s*===/.test(c);
|
|
16
15
|
if (/^<img\b/i.test(e)) {
|
|
17
16
|
const s = n(e, "src") ?? "", m = n(e, "alt") ?? n(e, "title") ?? "", h = n(e, "width");
|
|
18
|
-
let
|
|
17
|
+
let u;
|
|
19
18
|
if (h) {
|
|
20
|
-
const
|
|
21
|
-
Number.isFinite(
|
|
19
|
+
const g = Number.parseFloat(h);
|
|
20
|
+
Number.isFinite(g) && (u = v(g));
|
|
22
21
|
}
|
|
23
22
|
return {
|
|
24
23
|
text: m,
|
|
25
24
|
url: s,
|
|
26
25
|
title: m,
|
|
27
|
-
scalePercent:
|
|
26
|
+
scalePercent: u,
|
|
28
27
|
fixedOutput: r
|
|
29
28
|
};
|
|
30
29
|
}
|
|
31
|
-
const
|
|
30
|
+
const o = e.match(I), i = o?.[1] ?? "", a = o?.[2] ?? "";
|
|
32
31
|
return {
|
|
33
32
|
text: i,
|
|
34
|
-
url:
|
|
33
|
+
url: a,
|
|
35
34
|
title: i,
|
|
36
35
|
scalePercent: void 0,
|
|
37
36
|
fixedOutput: r
|
|
38
37
|
};
|
|
39
|
-
},
|
|
40
|
-
const c =
|
|
38
|
+
}, d = (t) => {
|
|
39
|
+
const c = M(
|
|
41
40
|
t.state.doc.toString()
|
|
42
41
|
).filter((e) => e.name !== null);
|
|
43
42
|
return new w({
|
|
44
43
|
regexp: O,
|
|
45
|
-
decoration: (e, r,
|
|
46
|
-
const i =
|
|
47
|
-
if (c.some((s) =>
|
|
44
|
+
decoration: (e, r, o) => {
|
|
45
|
+
const i = o + e[0].length;
|
|
46
|
+
if (c.some((s) => o < s.end && i > s.start))
|
|
48
47
|
return null;
|
|
49
|
-
const
|
|
48
|
+
const a = C(e);
|
|
50
49
|
return p.replace({
|
|
51
|
-
widget: new
|
|
52
|
-
|
|
50
|
+
widget: new D(
|
|
51
|
+
a.text || r.state.facet(l).image,
|
|
53
52
|
{
|
|
54
53
|
tag: "image",
|
|
55
|
-
url:
|
|
56
|
-
title:
|
|
57
|
-
scalePercent:
|
|
58
|
-
fixedOutput:
|
|
54
|
+
url: a.url,
|
|
55
|
+
title: a.title,
|
|
56
|
+
scalePercent: a.scalePercent,
|
|
57
|
+
fixedOutput: a.fixedOutput
|
|
59
58
|
},
|
|
60
59
|
"tag-image",
|
|
61
60
|
b.Image,
|
|
@@ -67,10 +66,10 @@ const I = /!\[([^\]]*)\]\(([^)]+)\)|<img\b[^>]*>/i, O = /===\s*(?:!\[[^\]]*\]\([
|
|
|
67
66
|
}, A = f.fromClass(
|
|
68
67
|
class {
|
|
69
68
|
constructor(t) {
|
|
70
|
-
this.matcher =
|
|
69
|
+
this.matcher = d(t), this.placeholders = this.matcher.createDeco(t);
|
|
71
70
|
}
|
|
72
71
|
update(t) {
|
|
73
|
-
if (t.docChanged && (this.matcher =
|
|
72
|
+
if (t.docChanged && (this.matcher = d(t.view)), t.docChanged || t.startState.facet(l) !== t.state.facet(l)) {
|
|
74
73
|
this.placeholders = this.matcher.createDeco(t.view);
|
|
75
74
|
return;
|
|
76
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImgPlaceholder.es.js","sources":["../../../../src/components/MarkdownFlowEditor/plugins/ImgPlaceholder.ts"],"sourcesContent":["import {\n EditorView,\n Decoration,\n DecorationSet,\n ViewPlugin,\n ViewUpdate,\n MatchDecorator,\n} from \"@codemirror/view\";\nimport { SelectedOption } from \"../types\";\nimport { findDocumentVariableMarkers, unwrapFixedOutput } from \"../utils\";\nimport PlaceholderWidget from \"./PlaceholderWidget\";\nimport { mediaPlaceholderLabels } from \"./mediaPlaceholderLabels\";\n\nconst imageMarkupRegexp = /!\\[([^\\]]*)\\]\\(([^)]+)\\)|<img\\b[^>]*>/i;\nconst agiImgContextRegexp =\n /===\\s*(?:!\\[[^\\]]*\\]\\([^)]+\\)|<img\\b[^>]*>)\\s*===|!\\[[^\\]]*\\]\\([^)]+\\)|<img\\b[^>]*>/gi;\n\nconst extractAttributeValue = (tag: string, attribute: string) => {\n const regexp = new RegExp(\n `${attribute}\\\\s*=\\\\s*(\"(.*?)\"|'(.*?)'|([^\\\\s\"'<>]+))`,\n \"i\"\n );\n const match = tag.match(regexp);\n if (!match) return undefined;\n return match[2] ?? match[3] ?? match[4];\n};\n\nconst clampScalePercent = (value: number) =>\n Math.max(1, Math.min(1000, Math.round(value)));\n\nconst getImageMatchInfo = (match: RegExpMatchArray) => {\n const source = match?.[0] ?? \"\";\n const raw = unwrapFixedOutput(source);\n const fixedOutput = /^\\s*===/.test(source);\n if (/^<img\\b/i.test(raw)) {\n const src = extractAttributeValue(raw, \"src\") ?? \"\";\n const alt =\n extractAttributeValue(raw, \"alt\") ??\n extractAttributeValue(raw, \"title\") ??\n \"\";\n const widthAttr = extractAttributeValue(raw, \"width\");\n let scalePercent: number | undefined;\n if (widthAttr) {\n const numeric = Number.parseFloat(widthAttr);\n if (Number.isFinite(numeric)) {\n scalePercent = clampScalePercent(numeric);\n }\n }\n return {\n text: alt,\n url: src,\n title: alt,\n scalePercent,\n fixedOutput,\n };\n }\n const markdownMatch = raw.match(imageMarkupRegexp);\n const title = markdownMatch?.[1] ?? \"\";\n const url = markdownMatch?.[2] ?? \"\";\n return {\n text: title,\n url,\n title,\n scalePercent: undefined,\n fixedOutput,\n };\n};\n\nconst createImageUrlMatcher = (view: EditorView) => {\n const variables = findDocumentVariableMarkers(\n view.state.doc.toString()\n ).filter((marker) => marker.name !== null);\n return new MatchDecorator({\n regexp: agiImgContextRegexp,\n decoration: (match, view, from) => {\n const to = from + match[0].length;\n if (variables.some((marker) => from < marker.end && to > marker.start)) {\n return null;\n }\n const info = getImageMatchInfo(match);\n return Decoration.replace({\n widget: new PlaceholderWidget(\n info.text || view.state.facet(mediaPlaceholderLabels).image,\n {\n tag: \"image\",\n url: info.url,\n title: info.title,\n scalePercent: info.scalePercent,\n fixedOutput: info.fixedOutput,\n },\n \"tag-image\",\n SelectedOption.Image,\n view\n ),\n });\n },\n });\n};\n\nconst ImgPlaceholder = ViewPlugin.fromClass(\n class {\n placeholders: DecorationSet;\n matcher: MatchDecorator;\n constructor(view: EditorView) {\n this.matcher = createImageUrlMatcher(view);\n this.placeholders = this.matcher.createDeco(view);\n }\n update(update: ViewUpdate) {\n if (update.docChanged) {\n this.matcher = createImageUrlMatcher(update.view);\n }\n if (\n update.docChanged ||\n update.startState.facet(mediaPlaceholderLabels) !==\n update.state.facet(mediaPlaceholderLabels)\n ) {\n this.placeholders = this.matcher.createDeco(update.view);\n return;\n }\n this.placeholders = this.matcher.updateDeco(update, this.placeholders);\n }\n },\n {\n decorations: (instance) => instance.placeholders,\n provide: (plugin) =>\n EditorView.atomicRanges.of((view) => {\n return view.plugin(plugin)?.placeholders || Decoration.none;\n }),\n }\n);\n\nexport default ImgPlaceholder;\n"],"names":["imageMarkupRegexp","agiImgContextRegexp","extractAttributeValue","tag","attribute","regexp","match","clampScalePercent","value","getImageMatchInfo","source","raw","unwrapFixedOutput","fixedOutput","src","alt","widthAttr","scalePercent","numeric","markdownMatch","title","url","createImageUrlMatcher","view","variables","findDocumentVariableMarkers","marker","MatchDecorator","from","to","info","Decoration","PlaceholderWidget","mediaPlaceholderLabels","SelectedOption","ImgPlaceholder","ViewPlugin","update","instance","plugin","EditorView"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ImgPlaceholder.es.js","sources":["../../../../src/components/MarkdownFlowEditor/plugins/ImgPlaceholder.ts"],"sourcesContent":["import {\n EditorView,\n Decoration,\n DecorationSet,\n ViewPlugin,\n ViewUpdate,\n MatchDecorator,\n} from \"@codemirror/view\";\nimport { SelectedOption } from \"../types\";\nimport { findDocumentVariableMarkers, unwrapFixedOutput } from \"../utils\";\nimport PlaceholderWidget from \"./PlaceholderWidget\";\nimport { mediaPlaceholderLabels } from \"./mediaPlaceholderLabels\";\n\nconst imageMarkupRegexp = /!\\[([^\\]]*)\\]\\(([^)]+)\\)|<img\\b[^>]*>/i;\nconst agiImgContextRegexp =\n /===\\s*(?:!\\[[^\\]]*\\]\\([^)]+\\)|<img\\b[^>]*>)\\s*===|!\\[[^\\]]*\\]\\([^)]+\\)|<img\\b[^>]*>/gi;\n\nconst extractAttributeValue = (tag: string, attribute: string) => {\n const regexp = new RegExp(\n `${attribute}\\\\s*=\\\\s*(\"(.*?)\"|'(.*?)'|([^\\\\s\"'<>]+))`,\n \"i\"\n );\n const match = tag.match(regexp);\n if (!match) return undefined;\n return match[2] ?? match[3] ?? match[4];\n};\n\nconst clampScalePercent = (value: number) =>\n Math.max(1, Math.min(1000, Math.round(value)));\n\nconst getImageMatchInfo = (match: RegExpMatchArray) => {\n const source = match?.[0] ?? \"\";\n const raw = unwrapFixedOutput(source);\n const fixedOutput = /^\\s*===/.test(source);\n if (/^<img\\b/i.test(raw)) {\n const src = extractAttributeValue(raw, \"src\") ?? \"\";\n const alt =\n extractAttributeValue(raw, \"alt\") ??\n extractAttributeValue(raw, \"title\") ??\n \"\";\n const widthAttr = extractAttributeValue(raw, \"width\");\n let scalePercent: number | undefined;\n if (widthAttr) {\n const numeric = Number.parseFloat(widthAttr);\n if (Number.isFinite(numeric)) {\n scalePercent = clampScalePercent(numeric);\n }\n }\n return {\n text: alt,\n url: src,\n title: alt,\n scalePercent,\n fixedOutput,\n };\n }\n const markdownMatch = raw.match(imageMarkupRegexp);\n const title = markdownMatch?.[1] ?? \"\";\n const url = markdownMatch?.[2] ?? \"\";\n return {\n text: title,\n url,\n title,\n scalePercent: undefined,\n fixedOutput,\n };\n};\n\nconst createImageUrlMatcher = (view: EditorView) => {\n const variables = findDocumentVariableMarkers(\n view.state.doc.toString()\n ).filter((marker) => marker.name !== null);\n return new MatchDecorator({\n regexp: agiImgContextRegexp,\n decoration: (match, view, from) => {\n const to = from + match[0].length;\n if (variables.some((marker) => from < marker.end && to > marker.start)) {\n return null;\n }\n const info = getImageMatchInfo(match);\n return Decoration.replace({\n widget: new PlaceholderWidget(\n info.text || view.state.facet(mediaPlaceholderLabels).image,\n {\n tag: \"image\",\n url: info.url,\n title: info.title,\n scalePercent: info.scalePercent,\n fixedOutput: info.fixedOutput,\n },\n \"tag-image\",\n SelectedOption.Image,\n view\n ),\n });\n },\n });\n};\n\nconst ImgPlaceholder = ViewPlugin.fromClass(\n class {\n placeholders: DecorationSet;\n matcher: MatchDecorator;\n constructor(view: EditorView) {\n this.matcher = createImageUrlMatcher(view);\n this.placeholders = this.matcher.createDeco(view);\n }\n update(update: ViewUpdate) {\n if (update.docChanged) {\n this.matcher = createImageUrlMatcher(update.view);\n }\n if (\n update.docChanged ||\n update.startState.facet(mediaPlaceholderLabels) !==\n update.state.facet(mediaPlaceholderLabels)\n ) {\n this.placeholders = this.matcher.createDeco(update.view);\n return;\n }\n this.placeholders = this.matcher.updateDeco(update, this.placeholders);\n }\n },\n {\n decorations: (instance) => instance.placeholders,\n provide: (plugin) =>\n EditorView.atomicRanges.of((view) => {\n return view.plugin(plugin)?.placeholders || Decoration.none;\n }),\n }\n);\n\nexport default ImgPlaceholder;\n"],"names":["imageMarkupRegexp","agiImgContextRegexp","extractAttributeValue","tag","attribute","regexp","match","clampScalePercent","value","getImageMatchInfo","source","raw","unwrapFixedOutput","fixedOutput","src","alt","widthAttr","scalePercent","numeric","markdownMatch","title","url","createImageUrlMatcher","view","variables","findDocumentVariableMarkers","marker","MatchDecorator","from","to","info","Decoration","PlaceholderWidget","mediaPlaceholderLabels","SelectedOption","ImgPlaceholder","ViewPlugin","update","instance","plugin","EditorView"],"mappings":";;;;;AAaA,MAAMA,IAAoB,0CACpBC,IACJ,yFAEIC,IAAwB,CAACC,GAAaC,MAAsB;AAChE,QAAMC,IAAS,IAAI;AAAA,IACjB,GAAGD,CAAS;AAAA,IACZ;AAAA,EAAA,GAEIE,IAAQH,EAAI,MAAME,CAAM;AAC9B,MAAKC;AACL,WAAOA,EAAM,CAAC,KAAKA,EAAM,CAAC,KAAKA,EAAM,CAAC;AACxC,GAEMC,IAAoB,CAACC,MACzB,KAAK,IAAI,GAAG,KAAK,IAAI,KAAM,KAAK,MAAMA,CAAK,CAAC,CAAC,GAEzCC,IAAoB,CAACH,MAA4B;AACrD,QAAMI,IAASJ,IAAQ,CAAC,KAAK,IACvBK,IAAMC,EAAkBF,CAAM,GAC9BG,IAAc,UAAU,KAAKH,CAAM;AACzC,MAAI,WAAW,KAAKC,CAAG,GAAG;AACxB,UAAMG,IAAMZ,EAAsBS,GAAK,KAAK,KAAK,IAC3CI,IACJb,EAAsBS,GAAK,KAAK,KAChCT,EAAsBS,GAAK,OAAO,KAClC,IACIK,IAAYd,EAAsBS,GAAK,OAAO;AACpD,QAAIM;AACJ,QAAID,GAAW;AACb,YAAME,IAAU,OAAO,WAAWF,CAAS;AAC3C,MAAI,OAAO,SAASE,CAAO,MACzBD,IAAeV,EAAkBW,CAAO;AAAA,IAE5C;AACA,WAAO;AAAA,MACL,MAAMH;AAAA,MACN,KAAKD;AAAA,MACL,OAAOC;AAAA,MACP,cAAAE;AAAA,MACA,aAAAJ;AAAA,IAAA;AAAA,EAEJ;AACA,QAAMM,IAAgBR,EAAI,MAAMX,CAAiB,GAC3CoB,IAAQD,IAAgB,CAAC,KAAK,IAC9BE,IAAMF,IAAgB,CAAC,KAAK;AAClC,SAAO;AAAA,IACL,MAAMC;AAAA,IACN,KAAAC;AAAA,IACA,OAAAD;AAAA,IACA,cAAc;AAAA,IACd,aAAAP;AAAA,EAAA;AAEJ,GAEMS,IAAwB,CAACC,MAAqB;AAClD,QAAMC,IAAYC;AAAA,IAChBF,EAAK,MAAM,IAAI,SAAA;AAAA,EAAS,EACxB,OAAO,CAACG,MAAWA,EAAO,SAAS,IAAI;AACzC,SAAO,IAAIC,EAAe;AAAA,IACxB,QAAQ1B;AAAA,IACR,YAAY,CAACK,GAAOiB,GAAMK,MAAS;AACjC,YAAMC,IAAKD,IAAOtB,EAAM,CAAC,EAAE;AAC3B,UAAIkB,EAAU,KAAK,CAACE,MAAWE,IAAOF,EAAO,OAAOG,IAAKH,EAAO,KAAK;AACnE,eAAO;AAET,YAAMI,IAAOrB,EAAkBH,CAAK;AACpC,aAAOyB,EAAW,QAAQ;AAAA,QACxB,QAAQ,IAAIC;AAAA,UACVF,EAAK,QAAQP,EAAK,MAAM,MAAMU,CAAsB,EAAE;AAAA,UACtD;AAAA,YACE,KAAK;AAAA,YACL,KAAKH,EAAK;AAAA,YACV,OAAOA,EAAK;AAAA,YACZ,cAAcA,EAAK;AAAA,YACnB,aAAaA,EAAK;AAAA,UAAA;AAAA,UAEpB;AAAA,UACAI,EAAe;AAAA,UACfX;AAAAA,QAAA;AAAA,MACF,CACD;AAAA,IACH;AAAA,EAAA,CACD;AACH,GAEMY,IAAiBC,EAAW;AAAA,EAChC,MAAM;AAAA,IAGJ,YAAYb,GAAkB;AAC5B,WAAK,UAAUD,EAAsBC,CAAI,GACzC,KAAK,eAAe,KAAK,QAAQ,WAAWA,CAAI;AAAA,IAClD;AAAA,IACA,OAAOc,GAAoB;AAIzB,UAHIA,EAAO,eACT,KAAK,UAAUf,EAAsBe,EAAO,IAAI,IAGhDA,EAAO,cACPA,EAAO,WAAW,MAAMJ,CAAsB,MAC5CI,EAAO,MAAM,MAAMJ,CAAsB,GAC3C;AACA,aAAK,eAAe,KAAK,QAAQ,WAAWI,EAAO,IAAI;AACvD;AAAA,MACF;AACA,WAAK,eAAe,KAAK,QAAQ,WAAWA,GAAQ,KAAK,YAAY;AAAA,IACvE;AAAA,EAAA;AAAA,EAEF;AAAA,IACE,aAAa,CAACC,MAAaA,EAAS;AAAA,IACpC,SAAS,CAACC,MACRC,EAAW,aAAa,GAAG,CAACjB,MACnBA,EAAK,OAAOgB,CAAM,GAAG,gBAAgBR,EAAW,IACxD;AAAA,EAAA;AAEP;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const A=require("../../../node_modules/@codemirror/view/dist/index.cjs"),
|
|
2
|
-
`,
|
|
3
|
-
`,
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const A=require("../../../node_modules/@codemirror/view/dist/index.cjs"),L=require("../../../node_modules/@codemirror/state/dist/index.cjs"),Q=require("../../ContentRender/utils/inline-code-ranges.cjs"),B=require("../../../_virtual/index.cjs"),E=require("../utils.cjs"),F=/<!--[\s\S]*?-->/g,W=n=>{const s=E.findVariableMarkers(n),f=n.indexOf("{{",s.at(-1)?.end??0);return f===-1?s:[...s,{start:f,end:n.length,name:null}]},C=new RegExp(`\\?\\[(${B.distExports.INTERACTION_CONTENT_SOURCE})\\](?!\\()`,"g"),j=n=>Q.getMarkdownSourceAnalysis(n).interactions;function T(n,s){const f=[];let i=null,d=0;for(;d<=n.length;){const a=n.indexOf(`
|
|
2
|
+
`,d),r=a===-1?n.length:a;if(n.slice(d,r).trim()==="!==="&&!s(d)&&(i===null?i=d:(f.push({from:i,to:r,className:"syntax-fixed"}),i=null)),a===-1)break;d=a+1}return f}function U(n,s,f){const i=[];let d=0;const a=t=>{for(;d<s.length&&s[d].to<=t;)d++;const o=s[d];return!!o&&t>=o.from&&t<o.to};let r=0;for(;r<=n.length;){const t=n.indexOf(`
|
|
3
|
+
`,r),o=t===-1?n.length:t,l=n.slice(r,o),g=[];let p=0;for(;p<l.length;){const u=l.indexOf("===",p);if(u===-1)break;const h=r+u;!(h>0&&n[h-1]==="!")&&!a(h)&&!f(h)&&g.push(h),p=u+3}for(let u=0;u+1<g.length;u+=2)i.push({from:g[u],to:g[u+1]+3,className:"syntax-fixed"});if(t===-1)break;r=t+1}return i}function z(n,s){const f=[];let i;for(F.lastIndex=0;(i=F.exec(n))!==null;)s(i.index)||f.push({from:i.index,to:i.index+i[0].length,className:"syntax-comment"});return f}function D(n){const s=E.findDocumentVariableMarkers(n),f=r=>s.some(t=>r>=t.start&&r<t.end),i=z(n,f),d=[...T(n,f),...U(n,i,f),...i].sort((r,t)=>r.from!==t.from?r.from-t.from:t.to-r.to),a=[];for(const r of d){const t=a[a.length-1];(!t||r.from>=t.to)&&a.push(r)}return a}function P(n,s=()=>!1,f=!1){const i=[],d=E.findDocumentVariableMarkers(n),a=[];C.lastIndex=0;const r=(o,l)=>a.some(g=>!(l<=g.from||o>=g.to)),t=(o,l,g)=>o>=l||r(o,l)?!1:(a.push({from:o,to:l}),i.push({from:o,to:l,className:g}),!0);for(const o of D(n))t(o.from,o.to,o.className);for(const o of j(n)){C.lastIndex=o.start;const l=C.exec(n);if(!l||l.index!==o.start||l.index+l[0].length!==o.end)continue;const g=l.index,p=l.index+l[0].length,u=l[1],h=g+2;if(r(g,p)||d.some(y=>y.start<=g&&g<y.end))continue;t(g,g+1,"syntax-keyword"),t(g+1,g+2,"syntax-bracket"),t(p-1,p,"syntax-bracket");const V=W(u),b=V[0],w=b?b.start-1:-1,I=w>=0&&u[w]==="%"&&E.trimVariablePadding(u.slice(0,w))==="";if(u.startsWith("%")||I){let y="syntax-percent-invalid";if(b&&I){const e=h+b.start,x=h+b.end,M=s(e,x);y=b.name!==null&&!M?"syntax-percent-valid":"syntax-percent-invalid"}const v=h+(I?w:0);t(v,v+1,y);const O=[],k=[],R=[];for(const e of V)k.push({from:h+e.start,to:h+e.end,className:e.name===null?"syntax-variable-invalid":"syntax-variable"});let m=0;for(;m<u.length;){const e=k.find(M=>h+m===M.from);if(e){m=e.to-h;continue}if(B.distExports.isEscape(u,m)){m+=2;continue}const x=u.startsWith("||",m)?"||":u[m]==="|"?"|":u.startsWith("...",m)?"...":null;if(!x){m+=1;continue}O.push({from:h+m,to:h+m+x.length}),m+=x.length}const c=[...O.map(e=>({...e,className:"syntax-keyword"})),...k.map(e=>({...e,className:e.className}))].sort((e,x)=>e.from!==x.from?e.from-x.from:e.to-x.to);for(const e of c)e.className.startsWith("syntax-variable")&&s(e.from,e.to)||t(e.from,e.to,e.className)&&R.push({from:e.from,to:e.to});const N=v+1,H=p-1;let S=N;const $=R.sort((e,x)=>e.from!==x.from?e.from-x.from:e.to-x.to);for(const e of $)S<e.from&&t(S,e.from,"syntax-string"),S=Math.max(S,e.to);S<H&&t(S,H,"syntax-string")}else{const y=[],v=[];for(const c of W(u))y.push({from:h+c.start,to:h+c.end,className:c.name===null?"syntax-variable-invalid":"syntax-variable"});const O=y.sort((c,N)=>c.from!==N.from?c.from-N.from:c.to-N.to);for(const c of O)c.className.startsWith("syntax-variable")&&s(c.from,c.to)||t(c.from,c.to,c.className)&&v.push({from:c.from,to:c.to});const k=h,R=p-1;let m=k;for(const c of v)m<c.from&&t(m,c.from,"syntax-button-text"),m=Math.max(m,c.to);m<R&&t(m,R,"syntax-button-text")}}for(const o of f?[]:d)o.name!==null&&!s(o.start,o.end)&&t(o.start,o.end,"syntax-variable");return i.sort((o,l)=>o.from!==l.from?o.from-l.from:l.to-o.to),i}function q(n,s=!1){const f=new L.RangeSetBuilder,i=n.state.doc.toString(),d=P(i,(a,r)=>n.state.selection.ranges.some(t=>t.from>=a&&t.to<=r),s);for(const a of d)if(a.from<a.to)try{f.add(a.from,a.to,A.Decoration.mark({class:a.className}))}catch(r){console.warn("SyntaxHighlighter: Failed to add decoration",a,r)}return f.finish()}const _=(n=!1)=>A.ViewPlugin.fromClass(class{constructor(s){this.decorations=q(s,n)}update(s){(s.docChanged||s.viewportChanged||s.selectionSet)&&(this.decorations=q(s.view,n))}},{decorations:s=>s.decorations}),G=_(),J=_(!0);exports.QuestionSyntaxHighlighter=J;exports.collectOuterBlockRanges=D;exports.collectSyntaxHighlightRanges=P;exports.default=G;
|
|
4
4
|
//# sourceMappingURL=SyntaxHighlighter.cjs.map
|