@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
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
2
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
3
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
|
+
return arr2;
|
|
5
|
+
}
|
|
6
|
+
function _array_with_holes(arr) {
|
|
7
|
+
if (Array.isArray(arr)) return arr;
|
|
8
|
+
}
|
|
9
|
+
function _iterable_to_array_limit(arr, i) {
|
|
10
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
11
|
+
if (_i == null) return;
|
|
12
|
+
var _arr = [];
|
|
13
|
+
var _n = true;
|
|
14
|
+
var _d = false;
|
|
15
|
+
var _s, _e;
|
|
16
|
+
try {
|
|
17
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
18
|
+
_arr.push(_s.value);
|
|
19
|
+
if (i && _arr.length === i) break;
|
|
20
|
+
}
|
|
21
|
+
} catch (err) {
|
|
22
|
+
_d = true;
|
|
23
|
+
_e = err;
|
|
24
|
+
} finally{
|
|
25
|
+
try {
|
|
26
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
27
|
+
} finally{
|
|
28
|
+
if (_d) throw _e;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return _arr;
|
|
32
|
+
}
|
|
33
|
+
function _non_iterable_rest() {
|
|
34
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
35
|
+
}
|
|
36
|
+
function _sliced_to_array(arr, i) {
|
|
37
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
38
|
+
}
|
|
39
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
40
|
+
if (!o) return;
|
|
41
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
42
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
43
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
44
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
45
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
46
|
+
}
|
|
47
|
+
import { ConfigProvider, Skeleton } from "antd";
|
|
48
|
+
import classNames from "classnames";
|
|
49
|
+
import React, { useContext, useEffect, useState } from "react";
|
|
50
|
+
import { debugInfo } from "../../../../Utils/debugUtils";
|
|
51
|
+
import { AvatarList } from "../../components/ContributorAvatar";
|
|
52
|
+
import { useStyle } from "./style";
|
|
53
|
+
/**
|
|
54
|
+
* ReadonlyLinkCard 组件 - 只读链接卡片预览组件
|
|
55
|
+
*
|
|
56
|
+
* 专门针对 readonly 模式优化的链接卡片组件,移除了拖拽功能。
|
|
57
|
+
* 简化渲染逻辑,提升预览模式性能。
|
|
58
|
+
*
|
|
59
|
+
* @component
|
|
60
|
+
* @description 只读链接卡片预览组件,用于预览模式下的链接卡片渲染
|
|
61
|
+
* @param {ElementProps<LinkCardNode>} props - 组件属性
|
|
62
|
+
* @param {LinkCardNode} props.element - 链接卡片节点元素
|
|
63
|
+
* @param {React.ReactNode} props.children - 子组件内容
|
|
64
|
+
* @param {Object} props.attributes - 元素属性
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```tsx
|
|
68
|
+
* <ReadonlyLinkCard
|
|
69
|
+
* element={linkCardNode}
|
|
70
|
+
* attributes={attributes}
|
|
71
|
+
* >
|
|
72
|
+
* 内容
|
|
73
|
+
* </ReadonlyLinkCard>
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @returns {React.ReactElement} 渲染的只读链接卡片组件
|
|
77
|
+
*
|
|
78
|
+
* @remarks
|
|
79
|
+
* - 移除拖拽手柄(DragHandle)
|
|
80
|
+
* - 移除拖拽相关事件处理
|
|
81
|
+
* - 使用 React.memo 优化性能
|
|
82
|
+
* - 保持预览模式的视觉效果
|
|
83
|
+
*/ export var ReadonlyLinkCard = /*#__PURE__*/ React.memo(function(param) {
|
|
84
|
+
var element = param.element, attributes = param.attributes, children = param.children;
|
|
85
|
+
var _element_url, _element_otherProps, _element_otherProps_collaborators, _element_otherProps1, _element_otherProps2;
|
|
86
|
+
debugInfo('ReadonlyLinkCard - 渲染只读链接卡片', {
|
|
87
|
+
url: element === null || element === void 0 ? void 0 : (_element_url = element.url) === null || _element_url === void 0 ? void 0 : _element_url.substring(0, 100),
|
|
88
|
+
title: element === null || element === void 0 ? void 0 : element.title,
|
|
89
|
+
name: element === null || element === void 0 ? void 0 : element.name,
|
|
90
|
+
finished: element === null || element === void 0 ? void 0 : element.finished
|
|
91
|
+
});
|
|
92
|
+
var context = useContext(ConfigProvider.ConfigContext);
|
|
93
|
+
var baseCls = context === null || context === void 0 ? void 0 : context.getPrefixCls('agentic-md-editor-link-card');
|
|
94
|
+
var _useStyle = useStyle(baseCls), wrapSSR = _useStyle.wrapSSR, hashId = _useStyle.hashId;
|
|
95
|
+
var _useState = _sliced_to_array(useState(false), 2), showAsText = _useState[0], setShowAsText = _useState[1];
|
|
96
|
+
// 如果 finished 为 false,设置 5 秒超时,超时后显示为文本
|
|
97
|
+
useEffect(function() {
|
|
98
|
+
if (element.finished === false) {
|
|
99
|
+
debugInfo('ReadonlyLinkCard - 设置超时显示文本');
|
|
100
|
+
setShowAsText(false);
|
|
101
|
+
var timer = setTimeout(function() {
|
|
102
|
+
debugInfo('ReadonlyLinkCard - 超时,显示为文本');
|
|
103
|
+
setShowAsText(true);
|
|
104
|
+
}, 5000);
|
|
105
|
+
return function() {
|
|
106
|
+
clearTimeout(timer);
|
|
107
|
+
};
|
|
108
|
+
} else {
|
|
109
|
+
setShowAsText(false);
|
|
110
|
+
}
|
|
111
|
+
}, [
|
|
112
|
+
element.finished
|
|
113
|
+
]);
|
|
114
|
+
// 如果是不完整状态
|
|
115
|
+
if (element.finished === false) {
|
|
116
|
+
// 如果 5 秒后仍未完成,显示为文本
|
|
117
|
+
if (showAsText) {
|
|
118
|
+
debugInfo('ReadonlyLinkCard - 显示为文本');
|
|
119
|
+
return /*#__PURE__*/ React.createElement("div", attributes, /*#__PURE__*/ React.createElement("div", {
|
|
120
|
+
style: {
|
|
121
|
+
padding: '8px 12px',
|
|
122
|
+
border: '1px solid #d9d9d9',
|
|
123
|
+
borderRadius: '4px',
|
|
124
|
+
color: 'rgba(0, 0, 0, 0.65)',
|
|
125
|
+
wordBreak: 'break-all'
|
|
126
|
+
}
|
|
127
|
+
}, element.url || element.title || element.name || '链接卡片'), children);
|
|
128
|
+
}
|
|
129
|
+
// 5 秒内显示加载骨架屏
|
|
130
|
+
debugInfo('ReadonlyLinkCard - 显示加载骨架屏');
|
|
131
|
+
return /*#__PURE__*/ React.createElement("div", attributes, /*#__PURE__*/ React.createElement(Skeleton, {
|
|
132
|
+
active: true,
|
|
133
|
+
paragraph: {
|
|
134
|
+
rows: 2
|
|
135
|
+
}
|
|
136
|
+
}), children);
|
|
137
|
+
}
|
|
138
|
+
debugInfo('ReadonlyLinkCard - 渲染完整链接卡片');
|
|
139
|
+
return wrapSSR(/*#__PURE__*/ React.createElement("div", attributes, /*#__PURE__*/ React.createElement("div", {
|
|
140
|
+
className: classNames(baseCls, hashId),
|
|
141
|
+
"data-be": "link-card",
|
|
142
|
+
draggable: false,
|
|
143
|
+
style: {
|
|
144
|
+
display: 'flex'
|
|
145
|
+
}
|
|
146
|
+
}, /*#__PURE__*/ React.createElement("div", {
|
|
147
|
+
style: {
|
|
148
|
+
display: 'flex',
|
|
149
|
+
height: '100%',
|
|
150
|
+
minWidth: '0',
|
|
151
|
+
fontSize: 60,
|
|
152
|
+
minHeight: '100px',
|
|
153
|
+
lineHeight: '100px'
|
|
154
|
+
}
|
|
155
|
+
}, children.at(0)), /*#__PURE__*/ React.createElement("div", {
|
|
156
|
+
style: {
|
|
157
|
+
flex: 1
|
|
158
|
+
},
|
|
159
|
+
onClick: function() {
|
|
160
|
+
if (typeof window === 'undefined') return;
|
|
161
|
+
window.open(element === null || element === void 0 ? void 0 : element.url);
|
|
162
|
+
},
|
|
163
|
+
className: classNames("".concat(baseCls, "-container"), hashId)
|
|
164
|
+
}, /*#__PURE__*/ React.createElement("div", {
|
|
165
|
+
className: classNames("".concat(baseCls, "-container-content"), hashId),
|
|
166
|
+
contentEditable: false
|
|
167
|
+
}, element.icon ? /*#__PURE__*/ React.createElement("img", {
|
|
168
|
+
className: classNames("".concat(baseCls, "-container-content-icon"), hashId),
|
|
169
|
+
src: element.icon,
|
|
170
|
+
width: 56
|
|
171
|
+
}) : null, /*#__PURE__*/ React.createElement("div", {
|
|
172
|
+
style: {
|
|
173
|
+
flex: 1,
|
|
174
|
+
minWidth: 0
|
|
175
|
+
}
|
|
176
|
+
}, /*#__PURE__*/ React.createElement("a", {
|
|
177
|
+
href: element === null || element === void 0 ? void 0 : element.url,
|
|
178
|
+
className: classNames("".concat(baseCls, "-container-content-title"), hashId),
|
|
179
|
+
onClick: function(e) {
|
|
180
|
+
e.stopPropagation();
|
|
181
|
+
e.preventDefault();
|
|
182
|
+
if (typeof window === 'undefined') return;
|
|
183
|
+
window.open(element === null || element === void 0 ? void 0 : element.url);
|
|
184
|
+
},
|
|
185
|
+
download: element.title || element.name || 'no title'
|
|
186
|
+
}, element.title || element.name || 'no title'), /*#__PURE__*/ React.createElement("div", {
|
|
187
|
+
className: classNames("".concat(baseCls, "-container-content-description"), hashId)
|
|
188
|
+
}, element.description ? element.description : element === null || element === void 0 ? void 0 : element.url), /*#__PURE__*/ React.createElement("div", {
|
|
189
|
+
className: classNames("".concat(baseCls, "-container-content-collaborators"), hashId)
|
|
190
|
+
}, ((_element_otherProps = element.otherProps) === null || _element_otherProps === void 0 ? void 0 : _element_otherProps.collaborators) ? /*#__PURE__*/ React.createElement("div", null, /*#__PURE__*/ React.createElement(AvatarList, {
|
|
191
|
+
displayList: ((_element_otherProps1 = element.otherProps) === null || _element_otherProps1 === void 0 ? void 0 : (_element_otherProps_collaborators = _element_otherProps1.collaborators) === null || _element_otherProps_collaborators === void 0 ? void 0 : _element_otherProps_collaborators.map(function(item) {
|
|
192
|
+
var _Object_keys, _Object_values;
|
|
193
|
+
return {
|
|
194
|
+
name: (_Object_keys = Object.keys(item)) === null || _Object_keys === void 0 ? void 0 : _Object_keys.at(0),
|
|
195
|
+
collaboratorNumber: ((_Object_values = Object.values(item)) === null || _Object_values === void 0 ? void 0 : _Object_values.at(0)) || 0
|
|
196
|
+
};
|
|
197
|
+
}).slice(0, 5)) || []
|
|
198
|
+
})) : /*#__PURE__*/ React.createElement("div", null), ((_element_otherProps2 = element.otherProps) === null || _element_otherProps2 === void 0 ? void 0 : _element_otherProps2.updateTime) ? /*#__PURE__*/ React.createElement("div", {
|
|
199
|
+
className: classNames("".concat(baseCls, "-container-content-updateTime"), hashId),
|
|
200
|
+
style: {
|
|
201
|
+
color: 'rgba(0,0,0,0.45)',
|
|
202
|
+
fontSize: 12
|
|
203
|
+
}
|
|
204
|
+
}, element.otherProps.updateTime) : null)))), /*#__PURE__*/ React.createElement("div", {
|
|
205
|
+
style: {
|
|
206
|
+
display: 'flex',
|
|
207
|
+
height: '100%',
|
|
208
|
+
minWidth: '4px',
|
|
209
|
+
minHeight: '100px',
|
|
210
|
+
fontSize: 60,
|
|
211
|
+
lineHeight: '100px'
|
|
212
|
+
}
|
|
213
|
+
}, children.at(-1)))));
|
|
214
|
+
});
|
|
215
|
+
ReadonlyLinkCard.displayName = 'ReadonlyLinkCard';
|
|
@@ -75,10 +75,17 @@ export var ListContext = /*#__PURE__*/ React.createContext(null);
|
|
|
75
75
|
*/ export var List = function(param) {
|
|
76
76
|
var element = param.element, attributes = param.attributes, children = param.children;
|
|
77
77
|
var _element_children;
|
|
78
|
+
// 支持新的列表类型和向后兼容
|
|
79
|
+
// 新格式:numbered-list 或 bulleted-list
|
|
80
|
+
// 旧格式:list 类型,通过 order 属性判断
|
|
81
|
+
var isOrdered = element.type === 'numbered-list' || element.type === 'list' && element.order === true;
|
|
82
|
+
// 获取 task 属性(支持旧格式和新格式)
|
|
83
|
+
var task = element.task;
|
|
78
84
|
debugInfo('List - 渲染列表', {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
85
|
+
type: element.type,
|
|
86
|
+
isOrdered: isOrdered,
|
|
87
|
+
task: task,
|
|
88
|
+
start: isOrdered ? element.start : undefined,
|
|
82
89
|
childrenCount: (_element_children = element.children) === null || _element_children === void 0 ? void 0 : _element_children.length
|
|
83
90
|
});
|
|
84
91
|
var _useEditorStore = useEditorStore(), store = _useEditorStore.store, markdownContainerRef = _useEditorStore.markdownContainerRef;
|
|
@@ -86,12 +93,16 @@ export var ListContext = /*#__PURE__*/ React.createContext(null);
|
|
|
86
93
|
var baseCls = context.getPrefixCls('agentic-md-editor-list');
|
|
87
94
|
var _useStyle = useStyle(baseCls), wrapSSR = _useStyle.wrapSSR, hashId = _useStyle.hashId;
|
|
88
95
|
var listContent = React.useMemo(function() {
|
|
89
|
-
|
|
96
|
+
// 支持新的列表类型和向后兼容
|
|
97
|
+
var isOrdered = element.type === 'numbered-list' || element.type === 'list' && element.order === true;
|
|
98
|
+
var task = element.task;
|
|
99
|
+
var start = isOrdered ? element.start : undefined;
|
|
100
|
+
var tag = isOrdered ? 'ol' : 'ul';
|
|
90
101
|
debugInfo('List - useMemo 渲染', {
|
|
91
102
|
tag: tag,
|
|
92
|
-
|
|
93
|
-
start:
|
|
94
|
-
task:
|
|
103
|
+
type: element.type,
|
|
104
|
+
start: start,
|
|
105
|
+
task: task
|
|
95
106
|
});
|
|
96
107
|
return wrapSSR(/*#__PURE__*/ React.createElement(ListContext.Provider, {
|
|
97
108
|
value: {
|
|
@@ -105,13 +116,17 @@ export var ListContext = /*#__PURE__*/ React.createContext(null);
|
|
|
105
116
|
debugInfo('List - 拖拽开始');
|
|
106
117
|
store.dragStart(e, markdownContainerRef.current);
|
|
107
118
|
}
|
|
108
|
-
}), /*#__PURE__*/ createElement(tag,
|
|
109
|
-
className: classNames(baseCls, hashId,
|
|
110
|
-
|
|
111
|
-
|
|
119
|
+
}), /*#__PURE__*/ createElement(tag, _object_spread({
|
|
120
|
+
className: classNames(baseCls, hashId, isOrdered ? 'ol' : 'ul')
|
|
121
|
+
}, start !== undefined && {
|
|
122
|
+
start: start
|
|
123
|
+
}, task && {
|
|
124
|
+
'data-task': 'true'
|
|
125
|
+
}), children))));
|
|
112
126
|
}, [
|
|
113
|
-
element.
|
|
127
|
+
element.type,
|
|
114
128
|
element.order,
|
|
129
|
+
element.task,
|
|
115
130
|
element.start,
|
|
116
131
|
element.children,
|
|
117
132
|
baseCls,
|
|
@@ -102,7 +102,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
102
102
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
103
103
|
}
|
|
104
104
|
function _ts_generator(thisArg, body) {
|
|
105
|
-
var f, y, t,
|
|
105
|
+
var f, y, t, _ = {
|
|
106
106
|
label: 0,
|
|
107
107
|
sent: function() {
|
|
108
108
|
if (t[0] & 1) throw t[1];
|
|
@@ -110,13 +110,17 @@ function _ts_generator(thisArg, body) {
|
|
|
110
110
|
},
|
|
111
111
|
trys: [],
|
|
112
112
|
ops: []
|
|
113
|
-
};
|
|
114
|
-
return g
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
},
|
|
119
|
-
|
|
113
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
114
|
+
return d(g, "next", {
|
|
115
|
+
value: verb(0)
|
|
116
|
+
}), d(g, "throw", {
|
|
117
|
+
value: verb(1)
|
|
118
|
+
}), d(g, "return", {
|
|
119
|
+
value: verb(2)
|
|
120
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
121
|
+
value: function() {
|
|
122
|
+
return this;
|
|
123
|
+
}
|
|
120
124
|
}), g;
|
|
121
125
|
function verb(n) {
|
|
122
126
|
return function(v) {
|
|
@@ -128,7 +132,7 @@ function _ts_generator(thisArg, body) {
|
|
|
128
132
|
}
|
|
129
133
|
function step(op) {
|
|
130
134
|
if (f) throw new TypeError("Generator is already executing.");
|
|
131
|
-
while(_)try {
|
|
135
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
132
136
|
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;
|
|
133
137
|
if (y = 0, t) op = [
|
|
134
138
|
op[0] & 2,
|
|
@@ -214,8 +218,8 @@ var MentionsUser = function(props) {
|
|
|
214
218
|
onChange: props.onSelect
|
|
215
219
|
}), 2), selectedUsers = _useMountMergeState[0], setSelectedUsers = _useMountMergeState[1];
|
|
216
220
|
var _useEditorStore = useEditorStore(), editorProps = _useEditorStore.editorProps, readonly = _useEditorStore.readonly;
|
|
217
|
-
var onSearch =
|
|
218
|
-
|
|
221
|
+
var onSearch = function(text) {
|
|
222
|
+
return _async_to_generator(function() {
|
|
219
223
|
var _editorProps_comment_loadMentions, _editorProps_comment, list;
|
|
220
224
|
return _ts_generator(this, function(_state) {
|
|
221
225
|
switch(_state.label){
|
|
@@ -234,11 +238,8 @@ var MentionsUser = function(props) {
|
|
|
234
238
|
];
|
|
235
239
|
}
|
|
236
240
|
});
|
|
237
|
-
});
|
|
238
|
-
|
|
239
|
-
return _ref.apply(this, arguments);
|
|
240
|
-
};
|
|
241
|
-
}();
|
|
241
|
+
})();
|
|
242
|
+
};
|
|
242
243
|
useEffect(function() {
|
|
243
244
|
onSearch('');
|
|
244
245
|
}, [
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ElementProps, ListNode } from '../../../el';
|
|
3
|
+
/**
|
|
4
|
+
* ReadonlyList 组件 - 只读列表预览组件
|
|
5
|
+
*
|
|
6
|
+
* 专门针对 readonly 模式优化的列表组件,移除了拖拽功能等编辑相关功能。
|
|
7
|
+
* 简化渲染逻辑,提升预览模式性能。
|
|
8
|
+
*
|
|
9
|
+
* @component
|
|
10
|
+
* @description 只读列表预览组件,用于预览模式下的列表渲染
|
|
11
|
+
* @param {ElementProps<ListNode>} props - 组件属性
|
|
12
|
+
* @param {ListNode} props.element - 列表节点元素
|
|
13
|
+
* @param {React.ReactNode} props.children - 子组件内容
|
|
14
|
+
* @param {Object} props.attributes - 元素属性
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <ReadonlyList
|
|
19
|
+
* element={listNode}
|
|
20
|
+
* attributes={attributes}
|
|
21
|
+
* >
|
|
22
|
+
* 列表项内容
|
|
23
|
+
* </ReadonlyList>
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @returns {React.ReactElement} 渲染的只读列表组件
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* - 移除拖拽相关事件处理
|
|
30
|
+
* - 使用 React.memo 优化性能
|
|
31
|
+
* - 保持预览模式的视觉效果
|
|
32
|
+
*/
|
|
33
|
+
export declare const ReadonlyList: React.FC<ElementProps<ListNode>>;
|
|
@@ -0,0 +1,93 @@
|
|
|
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
|
+
import { ConfigProvider } from "antd";
|
|
30
|
+
import classNames from "classnames";
|
|
31
|
+
import React, { createElement, useContext } from "react";
|
|
32
|
+
import { debugInfo } from "../../../../Utils/debugUtils";
|
|
33
|
+
import { useStyle } from "./style";
|
|
34
|
+
/**
|
|
35
|
+
* ReadonlyList 组件 - 只读列表预览组件
|
|
36
|
+
*
|
|
37
|
+
* 专门针对 readonly 模式优化的列表组件,移除了拖拽功能等编辑相关功能。
|
|
38
|
+
* 简化渲染逻辑,提升预览模式性能。
|
|
39
|
+
*
|
|
40
|
+
* @component
|
|
41
|
+
* @description 只读列表预览组件,用于预览模式下的列表渲染
|
|
42
|
+
* @param {ElementProps<ListNode>} props - 组件属性
|
|
43
|
+
* @param {ListNode} props.element - 列表节点元素
|
|
44
|
+
* @param {React.ReactNode} props.children - 子组件内容
|
|
45
|
+
* @param {Object} props.attributes - 元素属性
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```tsx
|
|
49
|
+
* <ReadonlyList
|
|
50
|
+
* element={listNode}
|
|
51
|
+
* attributes={attributes}
|
|
52
|
+
* >
|
|
53
|
+
* 列表项内容
|
|
54
|
+
* </ReadonlyList>
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @returns {React.ReactElement} 渲染的只读列表组件
|
|
58
|
+
*
|
|
59
|
+
* @remarks
|
|
60
|
+
* - 移除拖拽相关事件处理
|
|
61
|
+
* - 使用 React.memo 优化性能
|
|
62
|
+
* - 保持预览模式的视觉效果
|
|
63
|
+
*/ export var ReadonlyList = /*#__PURE__*/ React.memo(function(param) {
|
|
64
|
+
var element = param.element, attributes = param.attributes, children = param.children;
|
|
65
|
+
var _element_children;
|
|
66
|
+
var isOrdered = element.type === 'numbered-list';
|
|
67
|
+
var isBulleted = element.type === 'bulleted-list';
|
|
68
|
+
debugInfo('ReadonlyList - 渲染只读列表', {
|
|
69
|
+
type: element.type,
|
|
70
|
+
isOrdered: isOrdered,
|
|
71
|
+
task: isBulleted ? element.task : undefined,
|
|
72
|
+
start: isOrdered ? element.start : undefined,
|
|
73
|
+
childrenCount: (_element_children = element.children) === null || _element_children === void 0 ? void 0 : _element_children.length
|
|
74
|
+
});
|
|
75
|
+
var context = useContext(ConfigProvider.ConfigContext);
|
|
76
|
+
var baseCls = context.getPrefixCls('agentic-md-editor-list');
|
|
77
|
+
var _useStyle = useStyle(baseCls), wrapSSR = _useStyle.wrapSSR, hashId = _useStyle.hashId;
|
|
78
|
+
var tag = isOrdered ? 'ol' : 'ul';
|
|
79
|
+
debugInfo('ReadonlyList - 渲染', {
|
|
80
|
+
tag: tag,
|
|
81
|
+
type: element.type,
|
|
82
|
+
start: isOrdered ? element.start : undefined,
|
|
83
|
+
task: isBulleted ? element.task : undefined
|
|
84
|
+
});
|
|
85
|
+
return wrapSSR(/*#__PURE__*/ React.createElement("div", _object_spread({
|
|
86
|
+
className: classNames("".concat(baseCls, "-container"), hashId, 'relative'),
|
|
87
|
+
"data-be": 'list'
|
|
88
|
+
}, attributes), /*#__PURE__*/ createElement(tag, _define_property({
|
|
89
|
+
className: classNames(baseCls, hashId, isOrdered ? 'ol' : 'ul'),
|
|
90
|
+
start: isOrdered ? element.start : undefined
|
|
91
|
+
}, 'data-task', isBulleted && element.task ? 'true' : undefined), children)));
|
|
92
|
+
});
|
|
93
|
+
ReadonlyList.displayName = 'ReadonlyList';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ElementProps, ListItemNode } from '../../../el';
|
|
3
|
+
/**
|
|
4
|
+
* ReadonlyListItem 组件 - 只读列表项预览组件
|
|
5
|
+
*
|
|
6
|
+
* 专门针对 readonly 模式优化的列表项组件,移除了编辑相关功能。
|
|
7
|
+
* 简化渲染逻辑,提升预览模式性能。
|
|
8
|
+
*
|
|
9
|
+
* @component
|
|
10
|
+
* @description 只读列表项预览组件,用于预览模式下的列表项渲染
|
|
11
|
+
* @param {ElementProps<ListItemNode>} props - 组件属性
|
|
12
|
+
* @param {ListItemNode} props.element - 列表项节点元素
|
|
13
|
+
* @param {React.ReactNode} props.children - 子组件内容
|
|
14
|
+
* @param {Object} props.attributes - 元素属性
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <ReadonlyListItem
|
|
19
|
+
* element={listItemNode}
|
|
20
|
+
* attributes={attributes}
|
|
21
|
+
* >
|
|
22
|
+
* 列表项内容
|
|
23
|
+
* </ReadonlyListItem>
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @returns {React.ReactElement} 渲染的只读列表项组件
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* - 移除拖拽相关事件处理
|
|
30
|
+
* - 任务列表的复选框在预览模式下只读
|
|
31
|
+
* - 移除提及用户编辑功能
|
|
32
|
+
* - 使用 React.memo 优化性能
|
|
33
|
+
* - 保持预览模式的视觉效果
|
|
34
|
+
*/
|
|
35
|
+
export declare const ReadonlyListItem: React.FC<ElementProps<ListItemNode>>;
|
|
@@ -0,0 +1,138 @@
|
|
|
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
|
+
import { Checkbox, ConfigProvider } from "antd";
|
|
30
|
+
import classNames from "classnames";
|
|
31
|
+
import React, { useContext, useMemo } from "react";
|
|
32
|
+
import { debugInfo } from "../../../../Utils/debugUtils";
|
|
33
|
+
import { ListContext } from "./List";
|
|
34
|
+
/**
|
|
35
|
+
* ReadonlyListItem 组件 - 只读列表项预览组件
|
|
36
|
+
*
|
|
37
|
+
* 专门针对 readonly 模式优化的列表项组件,移除了编辑相关功能。
|
|
38
|
+
* 简化渲染逻辑,提升预览模式性能。
|
|
39
|
+
*
|
|
40
|
+
* @component
|
|
41
|
+
* @description 只读列表项预览组件,用于预览模式下的列表项渲染
|
|
42
|
+
* @param {ElementProps<ListItemNode>} props - 组件属性
|
|
43
|
+
* @param {ListItemNode} props.element - 列表项节点元素
|
|
44
|
+
* @param {React.ReactNode} props.children - 子组件内容
|
|
45
|
+
* @param {Object} props.attributes - 元素属性
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```tsx
|
|
49
|
+
* <ReadonlyListItem
|
|
50
|
+
* element={listItemNode}
|
|
51
|
+
* attributes={attributes}
|
|
52
|
+
* >
|
|
53
|
+
* 列表项内容
|
|
54
|
+
* </ReadonlyListItem>
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @returns {React.ReactElement} 渲染的只读列表项组件
|
|
58
|
+
*
|
|
59
|
+
* @remarks
|
|
60
|
+
* - 移除拖拽相关事件处理
|
|
61
|
+
* - 任务列表的复选框在预览模式下只读
|
|
62
|
+
* - 移除提及用户编辑功能
|
|
63
|
+
* - 使用 React.memo 优化性能
|
|
64
|
+
* - 保持预览模式的视觉效果
|
|
65
|
+
*/ export var ReadonlyListItem = /*#__PURE__*/ React.memo(function(param) {
|
|
66
|
+
var element = param.element, children = param.children, attributes = param.attributes;
|
|
67
|
+
var _element_mentions, _element_children;
|
|
68
|
+
debugInfo('ReadonlyListItem - 渲染只读列表项', {
|
|
69
|
+
checked: element.checked,
|
|
70
|
+
isTask: typeof element.checked === 'boolean',
|
|
71
|
+
mentionsCount: (_element_mentions = element.mentions) === null || _element_mentions === void 0 ? void 0 : _element_mentions.length,
|
|
72
|
+
childrenCount: (_element_children = element.children) === null || _element_children === void 0 ? void 0 : _element_children.length
|
|
73
|
+
});
|
|
74
|
+
var isTask = typeof element.checked === 'boolean';
|
|
75
|
+
var context = useContext(ConfigProvider.ConfigContext);
|
|
76
|
+
var _ref = useContext(ListContext) || {}, _ref_hashId = _ref.hashId, hashId = _ref_hashId === void 0 ? '' : _ref_hashId;
|
|
77
|
+
var baseCls = context.getPrefixCls('agentic-md-editor-list');
|
|
78
|
+
// 任务列表的复选框(只读模式)
|
|
79
|
+
var checkbox = useMemo(function() {
|
|
80
|
+
if (!isTask) return null;
|
|
81
|
+
return /*#__PURE__*/ React.createElement("span", {
|
|
82
|
+
contentEditable: false,
|
|
83
|
+
"data-check-item": true,
|
|
84
|
+
className: classNames("".concat(baseCls, "-check-item"), hashId)
|
|
85
|
+
}, /*#__PURE__*/ React.createElement(Checkbox, {
|
|
86
|
+
checked: element.checked,
|
|
87
|
+
disabled: true
|
|
88
|
+
}));
|
|
89
|
+
}, [
|
|
90
|
+
element.checked,
|
|
91
|
+
isTask,
|
|
92
|
+
baseCls,
|
|
93
|
+
hashId
|
|
94
|
+
]);
|
|
95
|
+
// 提及用户显示(只读模式,只显示不编辑)
|
|
96
|
+
var mentionsUser = useMemo(function() {
|
|
97
|
+
var _element_mentions;
|
|
98
|
+
if (!isTask || !((_element_mentions = element.mentions) === null || _element_mentions === void 0 ? void 0 : _element_mentions.length)) return null;
|
|
99
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
100
|
+
style: {
|
|
101
|
+
display: 'inline-block',
|
|
102
|
+
marginLeft: 8
|
|
103
|
+
}
|
|
104
|
+
}, element.mentions.map(function(u) {
|
|
105
|
+
var _u_avatar;
|
|
106
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
107
|
+
key: u.name || u.id,
|
|
108
|
+
style: {
|
|
109
|
+
display: 'inline-flex',
|
|
110
|
+
alignItems: 'center',
|
|
111
|
+
backgroundColor: '#f5f5f5',
|
|
112
|
+
padding: '0 4px',
|
|
113
|
+
borderRadius: 4,
|
|
114
|
+
fontSize: '1em',
|
|
115
|
+
lineHeight: '24px',
|
|
116
|
+
color: '#1677ff',
|
|
117
|
+
marginRight: 4
|
|
118
|
+
}
|
|
119
|
+
}, "@", ((_u_avatar = u.avatar) === null || _u_avatar === void 0 ? void 0 : _u_avatar.startsWith('http')) ? /*#__PURE__*/ React.createElement("img", {
|
|
120
|
+
width: 16,
|
|
121
|
+
height: 16,
|
|
122
|
+
src: u.avatar,
|
|
123
|
+
alt: u.name,
|
|
124
|
+
style: {
|
|
125
|
+
marginLeft: 4
|
|
126
|
+
}
|
|
127
|
+
}) : null, /*#__PURE__*/ React.createElement("span", null, u.name));
|
|
128
|
+
}));
|
|
129
|
+
}, [
|
|
130
|
+
element.mentions,
|
|
131
|
+
isTask
|
|
132
|
+
]);
|
|
133
|
+
return /*#__PURE__*/ React.createElement("li", _object_spread({
|
|
134
|
+
className: classNames("".concat(baseCls, "-item"), hashId, _define_property({}, "".concat(baseCls, "-task"), isTask)),
|
|
135
|
+
"data-be": 'list-item'
|
|
136
|
+
}, attributes), checkbox, mentionsUser, children);
|
|
137
|
+
});
|
|
138
|
+
ReadonlyListItem.displayName = 'ReadonlyListItem';
|