@ant-design/agentic-ui 2.29.6 → 2.29.8
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/dist/AILabel/index.js +17 -8
- package/dist/AgenticLayout/index.js +3 -5
- package/dist/BackTo/BackBottom.js +17 -8
- package/dist/BackTo/BackTop.js +17 -8
- package/dist/BackTo/ScrollVisibleButton.js +75 -11
- package/dist/Bubble/AIBubble.js +131 -121
- package/dist/Bubble/Avatar/index.js +19 -10
- package/dist/Bubble/FileView.js +2 -2
- package/dist/Bubble/List/PureBubbleList.js +4 -5
- package/dist/Bubble/List/index.js +4 -5
- package/dist/Bubble/List/style.js +3 -0
- package/dist/Bubble/MessagesContent/BubbleExtra.js +108 -93
- package/dist/Bubble/MessagesContent/CopyButton/index.js +36 -26
- package/dist/Bubble/MessagesContent/DocInfo.js +19 -10
- package/dist/Bubble/MessagesContent/MarkdownPreview.js +2 -2
- package/dist/Bubble/MessagesContent/index.js +149 -130
- package/dist/Bubble/PureBubble.js +151 -133
- package/dist/Bubble/UserBubble.js +1 -1
- package/dist/Bubble/style.js +2 -2
- package/dist/Bubble/types/BubbleExtra.js +4 -1
- package/dist/Bubble/types/DocInfo.js +9 -1
- package/dist/ChatLayout/components/FooterBackgroundLottie/images/img_0.png +0 -0
- package/dist/ChatLayout/components/FooterBackgroundLottie/images/img_1.png +0 -0
- package/dist/ChatLayout/components/FooterBackgroundLottie/images/img_2.png +0 -0
- package/dist/ChatLayout/components/FooterBackgroundLottie/index.d.ts +51 -0
- package/dist/ChatLayout/components/FooterBackgroundLottie/index.js +45 -0
- package/dist/ChatLayout/components/FooterBackgroundLottie/lottie.d.ts +85 -0
- package/dist/ChatLayout/components/FooterBackgroundLottie/lottie.js +382 -0
- package/dist/ChatLayout/index.js +52 -14
- package/dist/ChatLayout/style.js +11 -0
- package/dist/ChatLayout/types.d.ts +28 -0
- package/dist/Components/ActionIconBox/index.js +30 -38
- package/dist/Components/ActionItemBox/ActionItemBox.js +1 -1
- package/dist/Components/Button/SwitchButton/index.js +18 -17
- package/dist/Components/LayoutHeader/index.js +5 -3
- package/dist/Components/LayoutHeader/style.js +5 -0
- package/dist/Components/Loading/CreativeRecommendationLoading.js +2 -2
- package/dist/Components/Loading/CreativeSparkLoading.js +2 -2
- package/dist/Components/SuggestionList/index.js +20 -19
- package/dist/Components/TextAnimate/index.js +19 -10
- package/dist/Components/TypingAnimation/index.js +19 -10
- package/dist/Components/effects/EffectPlayer.js +20 -11
- package/dist/Components/icons/LoadingSpinnerIcon.js +19 -10
- package/dist/History/components/HistoryActionsBox.js +21 -23
- package/dist/History/components/HistoryItem.js +61 -53
- package/dist/History/components/HistoryRunningIcon.js +19 -10
- package/dist/History/components/LoadMoreComponent.js +61 -55
- package/dist/History/components/NewChatComponent.js +53 -47
- package/dist/History/components/SearchComponent.js +24 -26
- package/dist/History/hooks/useHistory.js +80 -73
- package/dist/History/index.js +17 -16
- package/dist/History/menu.js +17 -8
- package/dist/Hooks/useAutoScroll.js +19 -19
- package/dist/Hooks/useDebounceFn/index.js +51 -45
- package/dist/Hooks/useElementSize.d.ts +5 -0
- package/dist/Hooks/useElementSize.js +71 -0
- package/dist/Hooks/useIntersectionOnce.js +17 -8
- package/dist/Hooks/useLanguage.d.ts +3 -0
- package/dist/I18n/locales.d.ts +3 -0
- package/dist/I18n/locales.js +8 -0
- package/dist/MarkdownEditor/BaseMarkdownEditor.js +23 -13
- package/dist/MarkdownEditor/editor/Editor.js +31 -39
- package/dist/MarkdownEditor/editor/components/CommentList/index.js +29 -37
- package/dist/MarkdownEditor/editor/elements/Blockquote/ReadonlyBlockquote.d.ts +33 -0
- package/dist/MarkdownEditor/editor/elements/Blockquote/ReadonlyBlockquote.js +69 -0
- package/dist/MarkdownEditor/editor/elements/Break/ReadonlyBreak.d.ts +30 -0
- package/dist/MarkdownEditor/editor/elements/Break/ReadonlyBreak.js +88 -0
- package/dist/MarkdownEditor/editor/elements/Card/ReadonlyCard.d.ts +34 -0
- package/dist/MarkdownEditor/editor/elements/Card/ReadonlyCard.js +96 -0
- package/dist/MarkdownEditor/editor/elements/Code/ReadonlyCode.d.ts +33 -0
- package/dist/MarkdownEditor/editor/elements/Code/ReadonlyCode.js +145 -0
- package/dist/MarkdownEditor/editor/elements/FootnoteDefinition/ReadonlyFootnoteDefinition.d.ts +34 -0
- package/dist/MarkdownEditor/editor/elements/FootnoteDefinition/ReadonlyFootnoteDefinition.js +125 -0
- package/dist/MarkdownEditor/editor/elements/FootnoteReference/ReadonlyFootnoteReference.d.ts +34 -0
- package/dist/MarkdownEditor/editor/elements/FootnoteReference/ReadonlyFootnoteReference.js +101 -0
- package/dist/MarkdownEditor/editor/elements/Head/ReadonlyHead.d.ts +35 -0
- package/dist/MarkdownEditor/editor/elements/Head/ReadonlyHead.js +111 -0
- package/dist/MarkdownEditor/editor/elements/Head/index.d.ts +3 -0
- package/dist/MarkdownEditor/editor/elements/Head/index.js +3 -1
- package/dist/MarkdownEditor/editor/elements/Hr/ReadonlyHr.d.ts +30 -0
- package/dist/MarkdownEditor/editor/elements/Hr/ReadonlyHr.js +95 -0
- package/dist/MarkdownEditor/editor/elements/Image/ReadonlyEditorImage.d.ts +35 -0
- package/dist/MarkdownEditor/editor/elements/Image/ReadonlyEditorImage.js +426 -0
- package/dist/MarkdownEditor/editor/elements/Image/index.js +124 -121
- package/dist/MarkdownEditor/editor/elements/InlineKatex/ReadonlyInlineKatex.d.ts +32 -0
- package/dist/MarkdownEditor/editor/elements/InlineKatex/ReadonlyInlineKatex.js +100 -0
- package/dist/MarkdownEditor/editor/elements/Katex/ReadonlyKatex.d.ts +32 -0
- package/dist/MarkdownEditor/editor/elements/Katex/ReadonlyKatex.js +110 -0
- package/dist/MarkdownEditor/editor/elements/LinkCard/ReadonlyLinkCard.d.ts +40 -0
- package/dist/MarkdownEditor/editor/elements/LinkCard/ReadonlyLinkCard.js +215 -0
- package/dist/MarkdownEditor/editor/elements/List/List.js +27 -12
- package/dist/MarkdownEditor/editor/elements/List/ListItem.js +17 -16
- package/dist/MarkdownEditor/editor/elements/List/ReadonlyList.d.ts +33 -0
- package/dist/MarkdownEditor/editor/elements/List/ReadonlyList.js +93 -0
- package/dist/MarkdownEditor/editor/elements/List/ReadonlyListItem.d.ts +35 -0
- package/dist/MarkdownEditor/editor/elements/List/ReadonlyListItem.js +138 -0
- package/dist/MarkdownEditor/editor/elements/Media/ReadonlyMedia.d.ts +36 -0
- package/dist/MarkdownEditor/editor/elements/Media/ReadonlyMedia.js +600 -0
- package/dist/MarkdownEditor/editor/elements/Media/index.js +107 -92
- package/dist/MarkdownEditor/editor/elements/Mermaid/ReadonlyMermaid.d.ts +32 -0
- package/dist/MarkdownEditor/editor/elements/Mermaid/ReadonlyMermaid.js +101 -0
- package/dist/MarkdownEditor/editor/elements/Paragraph/ReadonlyParagraph.d.ts +35 -0
- package/dist/MarkdownEditor/editor/elements/Paragraph/ReadonlyParagraph.js +109 -0
- package/dist/MarkdownEditor/editor/elements/Paragraph/index.js +2 -1
- package/dist/MarkdownEditor/editor/elements/Schema/ReadonlySchema.d.ts +33 -0
- package/dist/MarkdownEditor/editor/elements/Schema/ReadonlySchema.js +163 -0
- package/dist/MarkdownEditor/editor/elements/Table/Table.js +19 -10
- package/dist/MarkdownEditor/editor/elements/TagPopup/index.js +17 -16
- package/dist/MarkdownEditor/editor/elements/index.d.ts +20 -1
- package/dist/MarkdownEditor/editor/elements/index.js +65 -29
- package/dist/MarkdownEditor/editor/parser/parse/parseBlockElements.js +19 -11
- package/dist/MarkdownEditor/editor/parser/parse/parseCode.js +1 -1
- package/dist/MarkdownEditor/editor/parser/parse/parseEmptyLines.js +1 -1
- package/dist/MarkdownEditor/editor/parser/parse/parseTable.js +4 -1
- package/dist/MarkdownEditor/editor/parser/parserSlateNodeToMarkdown.js +66 -23
- package/dist/MarkdownEditor/editor/parser/remarkParse.js +3 -1
- package/dist/MarkdownEditor/editor/plugins/elements.js +60 -6
- package/dist/MarkdownEditor/editor/plugins/handlePaste.js +25 -30
- package/dist/MarkdownEditor/editor/plugins/hotKeyCommands/arrow.js +0 -1
- package/dist/MarkdownEditor/editor/plugins/hotKeyCommands/backspace.js +97 -39
- package/dist/MarkdownEditor/editor/plugins/hotKeyCommands/enter.js +0 -1
- package/dist/MarkdownEditor/editor/plugins/hotKeyCommands/match.js +0 -1
- package/dist/MarkdownEditor/editor/plugins/hotKeyCommands/tab.d.ts +14 -0
- package/dist/MarkdownEditor/editor/plugins/hotKeyCommands/tab.js +117 -91
- package/dist/MarkdownEditor/editor/plugins/index.d.ts +8 -0
- package/dist/MarkdownEditor/editor/plugins/index.js +8 -0
- package/dist/MarkdownEditor/editor/plugins/insertParsedHtmlNodes.d.ts +12 -6
- package/dist/MarkdownEditor/editor/plugins/insertParsedHtmlNodes.js +106 -95
- package/dist/MarkdownEditor/editor/plugins/useKeyboard.js +1 -1
- package/dist/MarkdownEditor/editor/plugins/useOnchange.js +28 -22
- package/dist/MarkdownEditor/editor/plugins/utils.d.ts +31 -0
- package/dist/MarkdownEditor/editor/plugins/utils.js +75 -0
- package/dist/MarkdownEditor/editor/plugins/withCardPlugin.d.ts +15 -0
- package/dist/MarkdownEditor/editor/plugins/withCardPlugin.js +329 -0
- package/dist/MarkdownEditor/editor/plugins/withCodeTagPlugin.d.ts +11 -0
- package/dist/MarkdownEditor/editor/plugins/withCodeTagPlugin.js +299 -0
- package/dist/MarkdownEditor/editor/plugins/withInlineNodes.d.ts +12 -0
- package/dist/MarkdownEditor/editor/plugins/withInlineNodes.js +17 -0
- package/dist/MarkdownEditor/editor/plugins/withLinkAndMediaPlugin.d.ts +11 -0
- package/dist/MarkdownEditor/editor/plugins/withLinkAndMediaPlugin.js +70 -0
- package/dist/MarkdownEditor/editor/plugins/withListsPlugin.d.ts +23 -0
- package/dist/MarkdownEditor/editor/plugins/withListsPlugin.js +204 -0
- package/dist/MarkdownEditor/editor/plugins/withMarkdown.d.ts +9 -12
- package/dist/MarkdownEditor/editor/plugins/withMarkdown.js +17 -764
- package/dist/MarkdownEditor/editor/plugins/withSchemaPlugin.d.ts +11 -0
- package/dist/MarkdownEditor/editor/plugins/withSchemaPlugin.js +55 -0
- package/dist/MarkdownEditor/editor/plugins/withVoidNodes.d.ts +12 -0
- package/dist/MarkdownEditor/editor/plugins/withVoidNodes.js +17 -0
- package/dist/MarkdownEditor/editor/store.js +18 -14
- package/dist/MarkdownEditor/editor/tools/InsertAutocomplete.js +202 -197
- package/dist/MarkdownEditor/editor/tools/InsertLink.js +2 -2
- package/dist/MarkdownEditor/editor/tools/ToolBar/ReadonlyBaseBar.js +142 -134
- package/dist/MarkdownEditor/editor/utils/ace.js +61 -61
- package/dist/MarkdownEditor/editor/utils/docx/module.js +41 -8
- package/dist/MarkdownEditor/editor/utils/editorCommands.d.ts +97 -0
- package/dist/MarkdownEditor/editor/utils/editorCommands.js +966 -0
- package/dist/MarkdownEditor/editor/utils/editorUtils.js +13 -6
- package/dist/MarkdownEditor/editor/utils/index.js +8 -2
- package/dist/MarkdownEditor/editor/utils/keyboard.js +46 -426
- package/dist/MarkdownEditor/editor/utils/markdownToHtml.js +23 -17
- package/dist/MarkdownEditor/editor/utils/media.js +21 -23
- package/dist/MarkdownEditor/editor/utils/performanceMonitor.js +55 -50
- package/dist/MarkdownEditor/editor/utils/useLocalState.js +11 -4
- package/dist/MarkdownEditor/el.d.ts +12 -5
- package/dist/MarkdownEditor/types.d.ts +1 -0
- package/dist/MarkdownEditor/types.js +4 -1
- package/dist/MarkdownEditor/utils/native-table/native-table-editor.js +14 -14
- package/dist/MarkdownEditor/utils/native-table/native-table-keyboard.js +2 -2
- package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/style.js +1 -0
- package/dist/MarkdownInputField/AttachmentButton/index.js +33 -31
- package/dist/MarkdownInputField/BeforeToolContainer/BeforeToolContainer.js +14 -7
- package/dist/MarkdownInputField/FileMapView/FileMapViewItem.js +2 -2
- package/dist/MarkdownInputField/FileMapView/index.js +17 -16
- package/dist/MarkdownInputField/FilePaste/index.js +25 -30
- package/dist/MarkdownInputField/FileUploadManager/index.js +39 -40
- package/dist/MarkdownInputField/MarkdownInputField.js +47 -51
- package/dist/MarkdownInputField/QuickActions/index.js +66 -60
- package/dist/MarkdownInputField/SendButton/index.js +22 -13
- package/dist/MarkdownInputField/Suggestion/index.js +17 -16
- package/dist/MarkdownInputField/VoiceInput/index.js +51 -45
- package/dist/MarkdownInputField/VoiceInputManager/index.js +133 -125
- package/dist/MarkdownInputField/hooks/useMarkdownInputFieldHandlers.js +103 -101
- package/dist/MarkdownInputField/hooks/useMarkdownInputFieldStyles.js +1 -1
- package/dist/MarkdownInputField/style.js +8 -4
- package/dist/MarkdownInputField/types/MarkdownInputFieldProps.js +14 -1
- package/dist/Plugins/chart/BarChart/index.js +8 -8
- package/dist/Plugins/chart/ChartRender.js +52 -46
- package/dist/Plugins/chart/DonutChart/index.js +26 -17
- package/dist/Plugins/chart/DonutChart/plugins.js +1 -1
- package/dist/Plugins/chart/DonutChart/types.js +1 -1
- package/dist/Plugins/chart/FunnelChart/index.js +31 -28
- package/dist/Plugins/chart/LineChart/index.js +19 -10
- package/dist/Plugins/chart/RadarChart/index.js +19 -10
- package/dist/Plugins/chart/ScatterChart/index.js +19 -10
- package/dist/Plugins/chart/components/ChartContainer/ChartContainer.js +20 -11
- package/dist/Plugins/chart/index.js +31 -13
- package/dist/Plugins/chart/loadChartRuntime.js +17 -16
- package/dist/Plugins/chart/types/classNames.js +4 -1
- package/dist/Plugins/chart/utils.js +20 -20
- package/dist/Plugins/code/CodeUI/Katex/Katex.js +52 -46
- package/dist/Plugins/code/components/AceEditor.js +149 -133
- package/dist/Plugins/code/components/CodeRenderer.js +7 -7
- package/dist/Plugins/code/components/CodeToolbar.js +2 -2
- package/dist/Plugins/code/components/LanguageSelector.js +6 -6
- package/dist/Plugins/code/components/LoadImage.js +5 -5
- package/dist/Plugins/code/components/ThinkBlock.js +8 -8
- package/dist/Plugins/code/hooks/useCodeEditorState.js +5 -5
- package/dist/Plugins/code/index.js +6 -6
- package/dist/Plugins/code/langIconMap.js +0 -1
- package/dist/Plugins/code/langIcons/AbapIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ActionscriptIcon.js +19 -10
- package/dist/Plugins/code/langIcons/AdaIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ApacheIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ApexIcon.js +19 -10
- package/dist/Plugins/code/langIcons/AplIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ApplescriptIcon.js +19 -10
- package/dist/Plugins/code/langIcons/AstroIcon.js +19 -10
- package/dist/Plugins/code/langIcons/AwkIcon.js +19 -10
- package/dist/Plugins/code/langIcons/BallerinaIcon.js +19 -10
- package/dist/Plugins/code/langIcons/BatIcon.js +19 -10
- package/dist/Plugins/code/langIcons/BicepIcon.js +19 -10
- package/dist/Plugins/code/langIcons/BladeIcon.js +19 -10
- package/dist/Plugins/code/langIcons/CIcon.js +19 -10
- package/dist/Plugins/code/langIcons/CadenceIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ClojureIcon.js +19 -10
- package/dist/Plugins/code/langIcons/CmakeIcon.js +19 -10
- package/dist/Plugins/code/langIcons/CobolIcon.js +19 -10
- package/dist/Plugins/code/langIcons/CodeqlIcon.js +19 -10
- package/dist/Plugins/code/langIcons/CoffeeIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ConsoleIcon.js +19 -10
- package/dist/Plugins/code/langIcons/CppIcon.js +19 -10
- package/dist/Plugins/code/langIcons/CrystalIcon.js +19 -10
- package/dist/Plugins/code/langIcons/CsharpIcon.js +19 -10
- package/dist/Plugins/code/langIcons/CssIcon.js +19 -10
- package/dist/Plugins/code/langIcons/DIcon.js +19 -10
- package/dist/Plugins/code/langIcons/DartIcon.js +19 -10
- package/dist/Plugins/code/langIcons/DatabaseIcon.js +19 -10
- package/dist/Plugins/code/langIcons/DiffIcon.js +19 -10
- package/dist/Plugins/code/langIcons/DockerIcon.js +19 -10
- package/dist/Plugins/code/langIcons/DotenvIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ElixirIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ElmIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ErbIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ErlangIcon.js +19 -10
- package/dist/Plugins/code/langIcons/FsharpIcon.js +19 -10
- package/dist/Plugins/code/langIcons/GdscriptIcon.js +19 -10
- package/dist/Plugins/code/langIcons/GlslIcon.js +19 -10
- package/dist/Plugins/code/langIcons/GnuplotIcon.js +19 -10
- package/dist/Plugins/code/langIcons/GoIcon.js +19 -10
- package/dist/Plugins/code/langIcons/GraphqlIcon.js +19 -10
- package/dist/Plugins/code/langIcons/GroovyIcon.js +19 -10
- package/dist/Plugins/code/langIcons/HackIcon.js +19 -10
- package/dist/Plugins/code/langIcons/HamlIcon.js +19 -10
- package/dist/Plugins/code/langIcons/HandlebarsIcon.js +19 -10
- package/dist/Plugins/code/langIcons/HaskellIcon.js +19 -10
- package/dist/Plugins/code/langIcons/HclIcon.js +19 -10
- package/dist/Plugins/code/langIcons/HclLightIcon.js +19 -10
- package/dist/Plugins/code/langIcons/HjsonIcon.js +19 -10
- package/dist/Plugins/code/langIcons/HlslIcon.js +19 -10
- package/dist/Plugins/code/langIcons/HtmlIcon.js +19 -10
- package/dist/Plugins/code/langIcons/HttpIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ImbaIcon.js +19 -10
- package/dist/Plugins/code/langIcons/IniIcon.js +19 -10
- package/dist/Plugins/code/langIcons/JavaIcon.js +19 -10
- package/dist/Plugins/code/langIcons/JavascriptIcon.js +19 -10
- package/dist/Plugins/code/langIcons/JinjaIcon.js +19 -10
- package/dist/Plugins/code/langIcons/Json5Icon.js +19 -10
- package/dist/Plugins/code/langIcons/JsonIcon.js +19 -10
- package/dist/Plugins/code/langIcons/JsonnetIcon.js +19 -10
- package/dist/Plugins/code/langIcons/JuliaIcon.js +19 -10
- package/dist/Plugins/code/langIcons/KotlinIcon.js +19 -10
- package/dist/Plugins/code/langIcons/KustoIcon.js +19 -10
- package/dist/Plugins/code/langIcons/LessIcon.js +19 -10
- package/dist/Plugins/code/langIcons/LiquidIcon.js +19 -10
- package/dist/Plugins/code/langIcons/LispIcon.js +19 -10
- package/dist/Plugins/code/langIcons/LuaIcon.js +19 -10
- package/dist/Plugins/code/langIcons/MakefileIcon.js +19 -10
- package/dist/Plugins/code/langIcons/MarkdownIcon.js +19 -10
- package/dist/Plugins/code/langIcons/MarkojsIcon.js +19 -10
- package/dist/Plugins/code/langIcons/MatlabIcon.js +19 -10
- package/dist/Plugins/code/langIcons/MdxIcon.js +19 -10
- package/dist/Plugins/code/langIcons/MermaidIcon.js +19 -10
- package/dist/Plugins/code/langIcons/MojoIcon.js +19 -10
- package/dist/Plugins/code/langIcons/NginxIcon.js +19 -10
- package/dist/Plugins/code/langIcons/NimIcon.js +19 -10
- package/dist/Plugins/code/langIcons/NixIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ObjectiveCIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ObjectiveCppIcon.js +19 -10
- package/dist/Plugins/code/langIcons/OcamlIcon.js +19 -10
- package/dist/Plugins/code/langIcons/PascalIcon.js +19 -10
- package/dist/Plugins/code/langIcons/Perl6Icon.js +19 -10
- package/dist/Plugins/code/langIcons/PerlIcon.js +19 -10
- package/dist/Plugins/code/langIcons/PhpIcon.js +19 -10
- package/dist/Plugins/code/langIcons/PostcssIcon.js +19 -10
- package/dist/Plugins/code/langIcons/PowershellIcon.js +19 -10
- package/dist/Plugins/code/langIcons/PrismaIcon.js +19 -10
- package/dist/Plugins/code/langIcons/PrologIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ProtoIcon.js +19 -10
- package/dist/Plugins/code/langIcons/PugIcon.js +19 -10
- package/dist/Plugins/code/langIcons/PuppetIcon.js +19 -10
- package/dist/Plugins/code/langIcons/PurescriptIcon.js +19 -10
- package/dist/Plugins/code/langIcons/PythonIcon.js +19 -10
- package/dist/Plugins/code/langIcons/RIcon.js +19 -10
- package/dist/Plugins/code/langIcons/RazorIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ReactIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ReactTsIcon.js +19 -10
- package/dist/Plugins/code/langIcons/RubyIcon.js +19 -10
- package/dist/Plugins/code/langIcons/RustIcon.js +19 -10
- package/dist/Plugins/code/langIcons/SasIcon.js +19 -10
- package/dist/Plugins/code/langIcons/SassIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ScalaIcon.js +19 -10
- package/dist/Plugins/code/langIcons/SchemeIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ShaderlabIcon.js +19 -10
- package/dist/Plugins/code/langIcons/SolidityIcon.js +19 -10
- package/dist/Plugins/code/langIcons/SparqlIcon.js +19 -10
- package/dist/Plugins/code/langIcons/StataIcon.js +19 -10
- package/dist/Plugins/code/langIcons/StylusIcon.js +19 -10
- package/dist/Plugins/code/langIcons/SvelteIcon.js +19 -10
- package/dist/Plugins/code/langIcons/SwiftIcon.js +19 -10
- package/dist/Plugins/code/langIcons/SystemverilogIcon.js +19 -10
- package/dist/Plugins/code/langIcons/TclIcon.js +19 -10
- package/dist/Plugins/code/langIcons/TexIcon.js +19 -10
- package/dist/Plugins/code/langIcons/TomlIcon.js +19 -10
- package/dist/Plugins/code/langIcons/TwigIcon.js +19 -10
- package/dist/Plugins/code/langIcons/TypescriptIcon.js +19 -10
- package/dist/Plugins/code/langIcons/VerilogIcon.js +19 -10
- package/dist/Plugins/code/langIcons/VhdlIcon.js +19 -10
- package/dist/Plugins/code/langIcons/VimIcon.js +19 -10
- package/dist/Plugins/code/langIcons/VueIcon.js +19 -10
- package/dist/Plugins/code/langIcons/WebassemblyIcon.js +19 -10
- package/dist/Plugins/code/langIcons/WenyanIcon.js +19 -10
- package/dist/Plugins/code/langIcons/WgslIcon.js +19 -10
- package/dist/Plugins/code/langIcons/WolframlanguageIcon.js +19 -10
- package/dist/Plugins/code/langIcons/XmlIcon.js +19 -10
- package/dist/Plugins/code/langIcons/XslIcon.js +19 -10
- package/dist/Plugins/code/langIcons/YamlIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ZigIcon.js +19 -10
- package/dist/Plugins/code/loadAceEditor.js +21 -23
- package/dist/Plugins/code/utils/langOptions.js +6 -6
- package/dist/Plugins/formatter/index.js +6 -6
- package/dist/Plugins/katex/InlineKatex.js +52 -46
- package/dist/Plugins/katex/Katex.js +53 -47
- package/dist/Plugins/katex/index.js +6 -6
- package/dist/Plugins/katex/loadKatex.js +27 -29
- package/dist/Plugins/mermaid/Mermaid.js +34 -28
- package/dist/Plugins/mermaid/useMermaidRender.js +103 -97
- package/dist/Plugins/mermaid/utils.js +25 -17
- package/dist/Schema/SchemaEditor/AceEditorWrapper.js +162 -150
- package/dist/Schema/SchemaEditor/index.js +8 -1
- package/dist/Schema/SchemaForm/index.js +2 -2
- package/dist/Schema/SchemaRenderer/index.js +45 -46
- package/dist/ThoughtChainList/index.js +22 -13
- package/dist/ToolUseBar/BarItem/Content.js +3 -3
- package/dist/ToolUseBar/BarItem/index.js +10 -3
- package/dist/ToolUseBar/index.js +19 -10
- package/dist/ToolUseBar/style.js +4 -4
- package/dist/Types/common.js +4 -1
- package/dist/Types/message.js +4 -1
- package/dist/Utils/debugUtils.js +8 -8
- package/dist/Utils/getScroll.js +12 -5
- package/dist/Utils/loadCSS.js +23 -22
- package/dist/Utils/proxySandbox/ProxySandbox.js +42 -34
- package/dist/Utils/proxySandbox/SecurityContextManager.js +54 -54
- package/dist/Utils/proxySandbox/index.js +25 -22
- package/dist/Utils/proxySandbox/types.js +11 -11
- package/dist/Utils/scrollTo.js +8 -1
- package/dist/WelcomeMessage/index.js +1 -1
- package/dist/Workspace/File/FileComponent.js +91 -66
- package/dist/Workspace/File/PreviewComponent.js +15 -8
- package/dist/Workspace/File/index.d.ts +1 -1
- package/dist/Workspace/File/style.js +7 -0
- package/dist/Workspace/RealtimeFollow/index.js +1 -2
- package/dist/Workspace/index.js +13 -11
- package/dist/Workspace/style.js +8 -14
- package/dist/Workspace/types.d.ts +50 -0
- package/dist/Workspace/types.js +0 -1
- package/package.json +27 -27
|
@@ -92,12 +92,22 @@ function _object_spread(target) {
|
|
|
92
92
|
}
|
|
93
93
|
function _object_without_properties(source, excluded) {
|
|
94
94
|
if (source == null) return {};
|
|
95
|
-
var target =
|
|
96
|
-
|
|
95
|
+
var target = {}, sourceKeys, key, i;
|
|
96
|
+
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
97
|
+
sourceKeys = Reflect.ownKeys(source);
|
|
98
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
99
|
+
key = sourceKeys[i];
|
|
100
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
101
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
102
|
+
target[key] = source[key];
|
|
103
|
+
}
|
|
104
|
+
return target;
|
|
105
|
+
}
|
|
106
|
+
target = _object_without_properties_loose(source, excluded);
|
|
97
107
|
if (Object.getOwnPropertySymbols) {
|
|
98
|
-
|
|
99
|
-
for(i = 0; i <
|
|
100
|
-
key =
|
|
108
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
109
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
110
|
+
key = sourceKeys[i];
|
|
101
111
|
if (excluded.indexOf(key) >= 0) continue;
|
|
102
112
|
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
103
113
|
target[key] = source[key];
|
|
@@ -107,12 +117,11 @@ function _object_without_properties(source, excluded) {
|
|
|
107
117
|
}
|
|
108
118
|
function _object_without_properties_loose(source, excluded) {
|
|
109
119
|
if (source == null) return {};
|
|
110
|
-
var target = {};
|
|
111
|
-
var sourceKeys = Object.keys(source);
|
|
112
|
-
var key, i;
|
|
120
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
113
121
|
for(i = 0; i < sourceKeys.length; i++){
|
|
114
122
|
key = sourceKeys[i];
|
|
115
123
|
if (excluded.indexOf(key) >= 0) continue;
|
|
124
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
116
125
|
target[key] = source[key];
|
|
117
126
|
}
|
|
118
127
|
return target;
|
|
@@ -129,7 +138,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
129
138
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
130
139
|
}
|
|
131
140
|
function _ts_generator(thisArg, body) {
|
|
132
|
-
var f, y, t,
|
|
141
|
+
var f, y, t, _ = {
|
|
133
142
|
label: 0,
|
|
134
143
|
sent: function() {
|
|
135
144
|
if (t[0] & 1) throw t[1];
|
|
@@ -137,13 +146,17 @@ function _ts_generator(thisArg, body) {
|
|
|
137
146
|
},
|
|
138
147
|
trys: [],
|
|
139
148
|
ops: []
|
|
140
|
-
};
|
|
141
|
-
return g
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
},
|
|
146
|
-
|
|
149
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
150
|
+
return d(g, "next", {
|
|
151
|
+
value: verb(0)
|
|
152
|
+
}), d(g, "throw", {
|
|
153
|
+
value: verb(1)
|
|
154
|
+
}), d(g, "return", {
|
|
155
|
+
value: verb(2)
|
|
156
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
157
|
+
value: function() {
|
|
158
|
+
return this;
|
|
159
|
+
}
|
|
147
160
|
}), g;
|
|
148
161
|
function verb(n) {
|
|
149
162
|
return function(v) {
|
|
@@ -155,7 +168,7 @@ function _ts_generator(thisArg, body) {
|
|
|
155
168
|
}
|
|
156
169
|
function step(op) {
|
|
157
170
|
if (f) throw new TypeError("Generator is already executing.");
|
|
158
|
-
while(_)try {
|
|
171
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
159
172
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
160
173
|
if (y = 0, t) op = [
|
|
161
174
|
op[0] & 2,
|
|
@@ -261,8 +274,8 @@ import { ReadonlyImage } from "../Image";
|
|
|
261
274
|
* onResizeStop={(size) => console.log('新尺寸:', size)}
|
|
262
275
|
* />
|
|
263
276
|
* ```
|
|
264
|
-
*/ export var ResizeImage = function(
|
|
265
|
-
var onResizeStart =
|
|
277
|
+
*/ export var ResizeImage = function(_0) {
|
|
278
|
+
var onResizeStart = _0.onResizeStart, onResizeStop = _0.onResizeStop, selected = _0.selected, defaultSize = _0.defaultSize, props = _object_without_properties(_0, [
|
|
266
279
|
"onResizeStart",
|
|
267
280
|
"onResizeStop",
|
|
268
281
|
"selected",
|
|
@@ -418,80 +431,82 @@ export function Media(param) {
|
|
|
418
431
|
}, [
|
|
419
432
|
element.finished
|
|
420
433
|
]);
|
|
421
|
-
var initial = useRefFunction(
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
realUrl = element === null || element === void 0 ? void 0 : element.url;
|
|
436
|
-
setState({
|
|
437
|
-
url: realUrl
|
|
438
|
-
});
|
|
439
|
-
if (finalType === 'image' || finalType === 'other') {
|
|
440
|
-
img = document.createElement('img');
|
|
441
|
-
img.referrerPolicy = 'no-referrer';
|
|
442
|
-
img.crossOrigin = 'anonymous';
|
|
443
|
-
img.src = realUrl;
|
|
444
|
-
img.onerror = function() {
|
|
445
|
-
setState({
|
|
446
|
-
loadSuccess: false
|
|
447
|
-
});
|
|
448
|
-
};
|
|
449
|
-
img.onload = function() {
|
|
450
|
-
return setState({
|
|
451
|
-
loadSuccess: true
|
|
452
|
-
});
|
|
453
|
-
};
|
|
454
|
-
}
|
|
455
|
-
if (finalType === 'video') {
|
|
456
|
-
video = document.createElement('video');
|
|
457
|
-
video.src = realUrl;
|
|
458
|
-
video.preload = 'metadata';
|
|
459
|
-
video.onerror = function() {
|
|
460
|
-
setState({
|
|
461
|
-
loadSuccess: false
|
|
462
|
-
});
|
|
463
|
-
};
|
|
464
|
-
video.onloadedmetadata = function() {
|
|
465
|
-
setState({
|
|
466
|
-
loadSuccess: true
|
|
467
|
-
});
|
|
468
|
-
};
|
|
469
|
-
}
|
|
470
|
-
if (finalType === 'audio') {
|
|
471
|
-
audio = document.createElement('audio');
|
|
472
|
-
audio.src = realUrl;
|
|
473
|
-
audio.preload = 'metadata';
|
|
474
|
-
audio.onerror = function() {
|
|
475
|
-
setState({
|
|
476
|
-
loadSuccess: false
|
|
477
|
-
});
|
|
478
|
-
};
|
|
479
|
-
audio.onloadedmetadata = function() {
|
|
480
|
-
setState({
|
|
481
|
-
loadSuccess: true
|
|
482
|
-
});
|
|
483
|
-
};
|
|
484
|
-
}
|
|
485
|
-
if (!element.mediaType) {
|
|
486
|
-
updateElement({
|
|
487
|
-
mediaType: state().type
|
|
434
|
+
var initial = useRefFunction(function() {
|
|
435
|
+
return _async_to_generator(function() {
|
|
436
|
+
var type, finalType, realUrl, img, video, audio;
|
|
437
|
+
return _ts_generator(this, function(_state) {
|
|
438
|
+
type = getMediaType(element === null || element === void 0 ? void 0 : element.url, element.alt);
|
|
439
|
+
type = !type ? 'image' : type;
|
|
440
|
+
finalType = [
|
|
441
|
+
'image',
|
|
442
|
+
'video',
|
|
443
|
+
'autio',
|
|
444
|
+
'attachment'
|
|
445
|
+
].includes(type) ? type : 'other';
|
|
446
|
+
setState({
|
|
447
|
+
type: finalType
|
|
488
448
|
});
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
449
|
+
realUrl = element === null || element === void 0 ? void 0 : element.url;
|
|
450
|
+
setState({
|
|
451
|
+
url: realUrl
|
|
452
|
+
});
|
|
453
|
+
if (finalType === 'image' || finalType === 'other') {
|
|
454
|
+
img = document.createElement('img');
|
|
455
|
+
img.referrerPolicy = 'no-referrer';
|
|
456
|
+
img.crossOrigin = 'anonymous';
|
|
457
|
+
img.src = realUrl;
|
|
458
|
+
img.onerror = function() {
|
|
459
|
+
setState({
|
|
460
|
+
loadSuccess: false
|
|
461
|
+
});
|
|
462
|
+
};
|
|
463
|
+
img.onload = function() {
|
|
464
|
+
return setState({
|
|
465
|
+
loadSuccess: true
|
|
466
|
+
});
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
if (finalType === 'video') {
|
|
470
|
+
video = document.createElement('video');
|
|
471
|
+
video.src = realUrl;
|
|
472
|
+
video.preload = 'metadata';
|
|
473
|
+
video.onerror = function() {
|
|
474
|
+
setState({
|
|
475
|
+
loadSuccess: false
|
|
476
|
+
});
|
|
477
|
+
};
|
|
478
|
+
video.onloadedmetadata = function() {
|
|
479
|
+
setState({
|
|
480
|
+
loadSuccess: true
|
|
481
|
+
});
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
if (finalType === 'audio') {
|
|
485
|
+
audio = document.createElement('audio');
|
|
486
|
+
audio.src = realUrl;
|
|
487
|
+
audio.preload = 'metadata';
|
|
488
|
+
audio.onerror = function() {
|
|
489
|
+
setState({
|
|
490
|
+
loadSuccess: false
|
|
491
|
+
});
|
|
492
|
+
};
|
|
493
|
+
audio.onloadedmetadata = function() {
|
|
494
|
+
setState({
|
|
495
|
+
loadSuccess: true
|
|
496
|
+
});
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
if (!element.mediaType) {
|
|
500
|
+
updateElement({
|
|
501
|
+
mediaType: state().type
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
return [
|
|
505
|
+
2
|
|
506
|
+
];
|
|
507
|
+
});
|
|
508
|
+
})();
|
|
509
|
+
});
|
|
495
510
|
useLayoutEffect(function() {
|
|
496
511
|
initial();
|
|
497
512
|
}, [
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RenderElementProps } from 'slate-react';
|
|
3
|
+
/**
|
|
4
|
+
* ReadonlyMermaid 组件 - 只读 Mermaid 图表预览组件
|
|
5
|
+
*
|
|
6
|
+
* 专门针对 readonly 模式优化的 Mermaid 图表组件。
|
|
7
|
+
* 简化渲染逻辑,提升预览模式性能。
|
|
8
|
+
*
|
|
9
|
+
* @component
|
|
10
|
+
* @description 只读 Mermaid 图表预览组件,用于预览模式下的 Mermaid 图表渲染
|
|
11
|
+
* @param {RenderElementProps} props - 组件属性
|
|
12
|
+
* @param {any} props.element - Mermaid 图表节点元素
|
|
13
|
+
* @param {React.ReactNode} props.children - 子组件内容
|
|
14
|
+
* @param {Object} props.attributes - 元素属性
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <ReadonlyMermaid
|
|
19
|
+
* element={mermaidNode}
|
|
20
|
+
* attributes={attributes}
|
|
21
|
+
* >
|
|
22
|
+
* 图表内容
|
|
23
|
+
* </ReadonlyMermaid>
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @returns {React.ReactElement} 渲染的只读 Mermaid 图表组件
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* - 使用 React.memo 优化性能
|
|
30
|
+
* - 保持预览模式的视觉效果
|
|
31
|
+
*/
|
|
32
|
+
export declare const ReadonlyMermaid: React.FC<RenderElementProps>;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
function _object_spread(target) {
|
|
15
|
+
for(var i = 1; i < arguments.length; i++){
|
|
16
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
|
+
var ownKeys = Object.keys(source);
|
|
18
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
19
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
ownKeys.forEach(function(key) {
|
|
24
|
+
_define_property(target, key, source[key]);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
}
|
|
29
|
+
function ownKeys(object, enumerableOnly) {
|
|
30
|
+
var keys = Object.keys(object);
|
|
31
|
+
if (Object.getOwnPropertySymbols) {
|
|
32
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
33
|
+
if (enumerableOnly) {
|
|
34
|
+
symbols = symbols.filter(function(sym) {
|
|
35
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
keys.push.apply(keys, symbols);
|
|
39
|
+
}
|
|
40
|
+
return keys;
|
|
41
|
+
}
|
|
42
|
+
function _object_spread_props(target, source) {
|
|
43
|
+
source = source != null ? source : {};
|
|
44
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
45
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
46
|
+
} else {
|
|
47
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
48
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return target;
|
|
52
|
+
}
|
|
53
|
+
import { ConfigProvider } from "antd";
|
|
54
|
+
import classNames from "classnames";
|
|
55
|
+
import React, { useContext } from "react";
|
|
56
|
+
import { debugInfo } from "../../../../Utils/debugUtils";
|
|
57
|
+
import { useStyle } from "./style";
|
|
58
|
+
/**
|
|
59
|
+
* ReadonlyMermaid 组件 - 只读 Mermaid 图表预览组件
|
|
60
|
+
*
|
|
61
|
+
* 专门针对 readonly 模式优化的 Mermaid 图表组件。
|
|
62
|
+
* 简化渲染逻辑,提升预览模式性能。
|
|
63
|
+
*
|
|
64
|
+
* @component
|
|
65
|
+
* @description 只读 Mermaid 图表预览组件,用于预览模式下的 Mermaid 图表渲染
|
|
66
|
+
* @param {RenderElementProps} props - 组件属性
|
|
67
|
+
* @param {any} props.element - Mermaid 图表节点元素
|
|
68
|
+
* @param {React.ReactNode} props.children - 子组件内容
|
|
69
|
+
* @param {Object} props.attributes - 元素属性
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```tsx
|
|
73
|
+
* <ReadonlyMermaid
|
|
74
|
+
* element={mermaidNode}
|
|
75
|
+
* attributes={attributes}
|
|
76
|
+
* >
|
|
77
|
+
* 图表内容
|
|
78
|
+
* </ReadonlyMermaid>
|
|
79
|
+
* ```
|
|
80
|
+
*
|
|
81
|
+
* @returns {React.ReactElement} 渲染的只读 Mermaid 图表组件
|
|
82
|
+
*
|
|
83
|
+
* @remarks
|
|
84
|
+
* - 使用 React.memo 优化性能
|
|
85
|
+
* - 保持预览模式的视觉效果
|
|
86
|
+
*/ export var ReadonlyMermaid = /*#__PURE__*/ React.memo(function(param) {
|
|
87
|
+
var attributes = param.attributes, children = param.children, element = param.element;
|
|
88
|
+
var _element_otherProps, _element_value, _element_otherProps1;
|
|
89
|
+
debugInfo('ReadonlyMermaid - 渲染只读 Mermaid 图表', {
|
|
90
|
+
hasError: (element === null || element === void 0 ? void 0 : (_element_otherProps = element.otherProps) === null || _element_otherProps === void 0 ? void 0 : _element_otherProps.error) === true,
|
|
91
|
+
valueLength: element === null || element === void 0 ? void 0 : (_element_value = element.value) === null || _element_value === void 0 ? void 0 : _element_value.length
|
|
92
|
+
});
|
|
93
|
+
var context = useContext(ConfigProvider.ConfigContext);
|
|
94
|
+
var baseCls = context === null || context === void 0 ? void 0 : context.getPrefixCls('agentic-md-editor-mermaid');
|
|
95
|
+
var _useStyle = useStyle(baseCls), wrapSSR = _useStyle.wrapSSR, hashId = _useStyle.hashId;
|
|
96
|
+
var hasError = (element === null || element === void 0 ? void 0 : (_element_otherProps1 = element.otherProps) === null || _element_otherProps1 === void 0 ? void 0 : _element_otherProps1.error) === true;
|
|
97
|
+
return wrapSSR(/*#__PURE__*/ React.createElement("pre", _object_spread_props(_object_spread({}, attributes), {
|
|
98
|
+
className: classNames(baseCls, hashId, _define_property({}, "".concat(baseCls, "-error"), hasError))
|
|
99
|
+
}), /*#__PURE__*/ React.createElement("code", null, children)));
|
|
100
|
+
});
|
|
101
|
+
ReadonlyMermaid.displayName = 'ReadonlyMermaid';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ElementProps, ParagraphNode } from '../../../el';
|
|
3
|
+
/**
|
|
4
|
+
* ReadonlyParagraph 组件 - 只读段落预览组件
|
|
5
|
+
*
|
|
6
|
+
* 专门针对 readonly 模式优化的段落组件,移除了拖拽手柄、占位符逻辑等编辑相关功能。
|
|
7
|
+
* 简化渲染逻辑,提升预览模式性能。
|
|
8
|
+
*
|
|
9
|
+
* @component
|
|
10
|
+
* @description 只读段落预览组件,用于预览模式下的段落渲染
|
|
11
|
+
* @param {ElementProps<ParagraphNode>} props - 组件属性
|
|
12
|
+
* @param {ParagraphNode} props.element - 段落节点元素
|
|
13
|
+
* @param {React.ReactNode} props.children - 子组件内容
|
|
14
|
+
* @param {Object} props.attributes - 元素属性
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <ReadonlyParagraph
|
|
19
|
+
* element={paragraphNode}
|
|
20
|
+
* attributes={attributes}
|
|
21
|
+
* >
|
|
22
|
+
* 段落内容
|
|
23
|
+
* </ReadonlyParagraph>
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @returns {React.ReactElement} 渲染的只读段落组件
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* - 移除拖拽手柄(DragHandle)
|
|
30
|
+
* - 移除占位符逻辑
|
|
31
|
+
* - 移除拖拽相关事件处理
|
|
32
|
+
* - 使用 React.memo 优化性能
|
|
33
|
+
* - 保持预览模式的视觉效果
|
|
34
|
+
*/
|
|
35
|
+
export declare const ReadonlyParagraph: React.FC<ElementProps<ParagraphNode>>;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
function _object_spread(target) {
|
|
15
|
+
for(var i = 1; i < arguments.length; i++){
|
|
16
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
|
+
var ownKeys = Object.keys(source);
|
|
18
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
19
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
ownKeys.forEach(function(key) {
|
|
24
|
+
_define_property(target, key, source[key]);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
}
|
|
29
|
+
function ownKeys(object, enumerableOnly) {
|
|
30
|
+
var keys = Object.keys(object);
|
|
31
|
+
if (Object.getOwnPropertySymbols) {
|
|
32
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
33
|
+
if (enumerableOnly) {
|
|
34
|
+
symbols = symbols.filter(function(sym) {
|
|
35
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
keys.push.apply(keys, symbols);
|
|
39
|
+
}
|
|
40
|
+
return keys;
|
|
41
|
+
}
|
|
42
|
+
function _object_spread_props(target, source) {
|
|
43
|
+
source = source != null ? source : {};
|
|
44
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
45
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
46
|
+
} else {
|
|
47
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
48
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return target;
|
|
52
|
+
}
|
|
53
|
+
import classNames from "classnames";
|
|
54
|
+
import React from "react";
|
|
55
|
+
import { Node } from "slate";
|
|
56
|
+
import { debugInfo } from "../../../../Utils/debugUtils";
|
|
57
|
+
/**
|
|
58
|
+
* ReadonlyParagraph 组件 - 只读段落预览组件
|
|
59
|
+
*
|
|
60
|
+
* 专门针对 readonly 模式优化的段落组件,移除了拖拽手柄、占位符逻辑等编辑相关功能。
|
|
61
|
+
* 简化渲染逻辑,提升预览模式性能。
|
|
62
|
+
*
|
|
63
|
+
* @component
|
|
64
|
+
* @description 只读段落预览组件,用于预览模式下的段落渲染
|
|
65
|
+
* @param {ElementProps<ParagraphNode>} props - 组件属性
|
|
66
|
+
* @param {ParagraphNode} props.element - 段落节点元素
|
|
67
|
+
* @param {React.ReactNode} props.children - 子组件内容
|
|
68
|
+
* @param {Object} props.attributes - 元素属性
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```tsx
|
|
72
|
+
* <ReadonlyParagraph
|
|
73
|
+
* element={paragraphNode}
|
|
74
|
+
* attributes={attributes}
|
|
75
|
+
* >
|
|
76
|
+
* 段落内容
|
|
77
|
+
* </ReadonlyParagraph>
|
|
78
|
+
* ```
|
|
79
|
+
*
|
|
80
|
+
* @returns {React.ReactElement} 渲染的只读段落组件
|
|
81
|
+
*
|
|
82
|
+
* @remarks
|
|
83
|
+
* - 移除拖拽手柄(DragHandle)
|
|
84
|
+
* - 移除占位符逻辑
|
|
85
|
+
* - 移除拖拽相关事件处理
|
|
86
|
+
* - 使用 React.memo 优化性能
|
|
87
|
+
* - 保持预览模式的视觉效果
|
|
88
|
+
*/ export var ReadonlyParagraph = /*#__PURE__*/ React.memo(function(props) {
|
|
89
|
+
var _props_children;
|
|
90
|
+
debugInfo('ReadonlyParagraph - 渲染只读段落', {
|
|
91
|
+
align: props.element.align,
|
|
92
|
+
children: props.element.children
|
|
93
|
+
});
|
|
94
|
+
var str = Node.string(props.element).trim();
|
|
95
|
+
debugInfo('ReadonlyParagraph - useMemo 渲染', {
|
|
96
|
+
strLength: str.length,
|
|
97
|
+
align: props.element.align
|
|
98
|
+
});
|
|
99
|
+
return /*#__PURE__*/ React.createElement("div", _object_spread_props(_object_spread({}, props.attributes), {
|
|
100
|
+
"data-be": 'paragraph',
|
|
101
|
+
className: classNames({}),
|
|
102
|
+
"data-align": props.element.align,
|
|
103
|
+
style: {
|
|
104
|
+
display: !!str || !!((_props_children = props.children) === null || _props_children === void 0 ? void 0 : _props_children.at(0).type) ? undefined : 'none',
|
|
105
|
+
textAlign: props.element.align
|
|
106
|
+
}
|
|
107
|
+
}), props.children);
|
|
108
|
+
});
|
|
109
|
+
ReadonlyParagraph.displayName = 'ReadonlyParagraph';
|
|
@@ -145,7 +145,8 @@ export var Paragraph = function(props) {
|
|
|
145
145
|
},
|
|
146
146
|
"data-empty": isEmpty,
|
|
147
147
|
style: {
|
|
148
|
-
display: !!str || !!((_props_children = props.children) === null || _props_children === void 0 ? void 0 : _props_children.at(0).type) ? undefined : 'none'
|
|
148
|
+
display: !!str || !!((_props_children = props.children) === null || _props_children === void 0 ? void 0 : _props_children.at(0).type) ? undefined : 'none',
|
|
149
|
+
textAlign: props.element.align
|
|
149
150
|
}
|
|
150
151
|
}), /*#__PURE__*/ React.createElement(DragHandle, null), props.children);
|
|
151
152
|
}, [
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RenderElementProps } from 'slate-react';
|
|
3
|
+
/**
|
|
4
|
+
* ReadonlySchema 组件 - 只读模式渲染组件
|
|
5
|
+
*
|
|
6
|
+
* 专门针对 readonly 模式优化的模式组件,移除了编辑相关功能。
|
|
7
|
+
* 简化渲染逻辑,提升预览模式性能。
|
|
8
|
+
*
|
|
9
|
+
* @component
|
|
10
|
+
* @description 只读模式预览组件,用于预览模式下的模式渲染
|
|
11
|
+
* @param {RenderElementProps} props - 组件属性
|
|
12
|
+
* @param {any} props.element - 模式节点元素
|
|
13
|
+
* @param {React.ReactNode} props.children - 子组件内容
|
|
14
|
+
* @param {Object} props.attributes - 元素属性
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <ReadonlySchema
|
|
19
|
+
* element={schemaNode}
|
|
20
|
+
* attributes={attributes}
|
|
21
|
+
* >
|
|
22
|
+
* 模式内容
|
|
23
|
+
* </ReadonlySchema>
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @returns {React.ReactElement} 渲染的只读模式组件
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* - 移除编辑相关功能
|
|
30
|
+
* - 使用 React.memo 优化性能
|
|
31
|
+
* - 保持预览模式的视觉效果
|
|
32
|
+
*/
|
|
33
|
+
export declare const ReadonlySchema: React.FC<RenderElementProps>;
|