@ant-design/agentic-ui 2.29.5 → 2.29.7
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 +22 -12
- package/dist/MarkdownEditor/editor/Editor.js +31 -39
- package/dist/MarkdownEditor/editor/components/CommentList/index.js +29 -37
- package/dist/MarkdownEditor/editor/elements/Image/index.js +86 -71
- package/dist/MarkdownEditor/editor/elements/List/ListItem.js +17 -16
- package/dist/MarkdownEditor/editor/elements/Media/index.js +107 -92
- package/dist/MarkdownEditor/editor/elements/Table/Table.js +19 -10
- package/dist/MarkdownEditor/editor/elements/TagPopup/index.js +17 -16
- package/dist/MarkdownEditor/editor/parser/parse/parseBlockElements.js +1 -1
- 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 +2 -2
- package/dist/MarkdownEditor/editor/parser/remarkParse.js +3 -1
- 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/enter.js +0 -1
- package/dist/MarkdownEditor/editor/plugins/hotKeyCommands/match.js +0 -1
- package/dist/MarkdownEditor/editor/plugins/hotKeyCommands/tab.js +0 -1
- package/dist/MarkdownEditor/editor/plugins/insertParsedHtmlNodes.js +39 -53
- package/dist/MarkdownEditor/editor/plugins/useKeyboard.js +1 -1
- package/dist/MarkdownEditor/editor/plugins/useOnchange.js +28 -22
- package/dist/MarkdownEditor/editor/plugins/withMarkdown.js +1 -1
- package/dist/MarkdownEditor/editor/store.js +17 -13
- 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/editorUtils.js +11 -4
- package/dist/MarkdownEditor/editor/utils/index.js +8 -2
- package/dist/MarkdownEditor/editor/utils/keyboard.js +31 -35
- 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/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 +38 -29
- 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 +1 -2
- 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 +25 -25
|
@@ -104,12 +104,22 @@ function _object_spread(target) {
|
|
|
104
104
|
}
|
|
105
105
|
function _object_without_properties(source, excluded) {
|
|
106
106
|
if (source == null) return {};
|
|
107
|
-
var target =
|
|
108
|
-
|
|
107
|
+
var target = {}, sourceKeys, key, i;
|
|
108
|
+
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
109
|
+
sourceKeys = Reflect.ownKeys(source);
|
|
110
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
111
|
+
key = sourceKeys[i];
|
|
112
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
113
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
114
|
+
target[key] = source[key];
|
|
115
|
+
}
|
|
116
|
+
return target;
|
|
117
|
+
}
|
|
118
|
+
target = _object_without_properties_loose(source, excluded);
|
|
109
119
|
if (Object.getOwnPropertySymbols) {
|
|
110
|
-
|
|
111
|
-
for(i = 0; i <
|
|
112
|
-
key =
|
|
120
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
121
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
122
|
+
key = sourceKeys[i];
|
|
113
123
|
if (excluded.indexOf(key) >= 0) continue;
|
|
114
124
|
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
115
125
|
target[key] = source[key];
|
|
@@ -119,12 +129,11 @@ function _object_without_properties(source, excluded) {
|
|
|
119
129
|
}
|
|
120
130
|
function _object_without_properties_loose(source, excluded) {
|
|
121
131
|
if (source == null) return {};
|
|
122
|
-
var target = {};
|
|
123
|
-
var sourceKeys = Object.keys(source);
|
|
124
|
-
var key, i;
|
|
132
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
125
133
|
for(i = 0; i < sourceKeys.length; i++){
|
|
126
134
|
key = sourceKeys[i];
|
|
127
135
|
if (excluded.indexOf(key) >= 0) continue;
|
|
136
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
128
137
|
target[key] = source[key];
|
|
129
138
|
}
|
|
130
139
|
return target;
|
|
@@ -141,7 +150,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
141
150
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
142
151
|
}
|
|
143
152
|
function _ts_generator(thisArg, body) {
|
|
144
|
-
var f, y, t,
|
|
153
|
+
var f, y, t, _ = {
|
|
145
154
|
label: 0,
|
|
146
155
|
sent: function() {
|
|
147
156
|
if (t[0] & 1) throw t[1];
|
|
@@ -149,13 +158,17 @@ function _ts_generator(thisArg, body) {
|
|
|
149
158
|
},
|
|
150
159
|
trys: [],
|
|
151
160
|
ops: []
|
|
152
|
-
};
|
|
153
|
-
return g
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
},
|
|
158
|
-
|
|
161
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
162
|
+
return d(g, "next", {
|
|
163
|
+
value: verb(0)
|
|
164
|
+
}), d(g, "throw", {
|
|
165
|
+
value: verb(1)
|
|
166
|
+
}), d(g, "return", {
|
|
167
|
+
value: verb(2)
|
|
168
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
169
|
+
value: function() {
|
|
170
|
+
return this;
|
|
171
|
+
}
|
|
159
172
|
}), g;
|
|
160
173
|
function verb(n) {
|
|
161
174
|
return function(v) {
|
|
@@ -167,7 +180,7 @@ function _ts_generator(thisArg, body) {
|
|
|
167
180
|
}
|
|
168
181
|
function step(op) {
|
|
169
182
|
if (f) throw new TypeError("Generator is already executing.");
|
|
170
|
-
while(_)try {
|
|
183
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
171
184
|
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;
|
|
172
185
|
if (y = 0, t) op = [
|
|
173
186
|
op[0] & 2,
|
|
@@ -269,8 +282,8 @@ import { loadAceEditor, loadAceTheme } from "../loadAceEditor";
|
|
|
269
282
|
* - 支持多种主题切换
|
|
270
283
|
* - 自动处理键盘事件和快捷键
|
|
271
284
|
* - 与 Slate 编辑器深度集成
|
|
272
|
-
*/ export function AceEditor(
|
|
273
|
-
var element =
|
|
285
|
+
*/ export function AceEditor(_0) {
|
|
286
|
+
var element = _0.element, onUpdate = _0.onUpdate, onShowBorderChange = _0.onShowBorderChange, onHideChange = _0.onHideChange, path = _0.path, _0_isSelected = _0.isSelected, isSelected = _0_isSelected === void 0 ? false : _0_isSelected, onSelectionChange = _0.onSelectionChange, props = _object_without_properties(_0, [
|
|
274
287
|
"element",
|
|
275
288
|
"onUpdate",
|
|
276
289
|
"onShowBorderChange",
|
|
@@ -311,52 +324,54 @@ import { loadAceEditor, loadAceTheme } from "../loadAceEditor";
|
|
|
311
324
|
// 使用 startTransition 标记为非紧急更新
|
|
312
325
|
startTransition(function() {
|
|
313
326
|
// 异步加载在 startTransition 外部执行
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
327
|
+
(function() {
|
|
328
|
+
return _async_to_generator(function() {
|
|
329
|
+
var _editorProps_codeProps, aceModule, theme, error;
|
|
330
|
+
return _ts_generator(this, function(_state) {
|
|
331
|
+
switch(_state.label){
|
|
332
|
+
case 0:
|
|
333
|
+
_state.trys.push([
|
|
334
|
+
0,
|
|
335
|
+
3,
|
|
336
|
+
,
|
|
337
|
+
4
|
|
338
|
+
]);
|
|
339
|
+
return [
|
|
340
|
+
4,
|
|
341
|
+
loadAceEditor()
|
|
342
|
+
];
|
|
343
|
+
case 1:
|
|
344
|
+
aceModule = _state.sent();
|
|
345
|
+
aceModuleRef.current = aceModule;
|
|
346
|
+
// 加载主题
|
|
347
|
+
theme = ((_editorProps_codeProps = editorProps.codeProps) === null || _editorProps_codeProps === void 0 ? void 0 : _editorProps_codeProps.theme) || props.theme || 'github';
|
|
348
|
+
return [
|
|
349
|
+
4,
|
|
350
|
+
loadAceTheme(theme)
|
|
351
|
+
];
|
|
352
|
+
case 2:
|
|
353
|
+
_state.sent();
|
|
354
|
+
setAceLoaded(true);
|
|
355
|
+
return [
|
|
356
|
+
3,
|
|
357
|
+
4
|
|
358
|
+
];
|
|
359
|
+
case 3:
|
|
360
|
+
error = _state.sent();
|
|
361
|
+
console.error('Failed to load Ace Editor:', error);
|
|
362
|
+
// 即使加载失败也设置 loaded,避免无限加载
|
|
363
|
+
setAceLoaded(true);
|
|
364
|
+
return [
|
|
365
|
+
3,
|
|
366
|
+
4
|
|
367
|
+
];
|
|
368
|
+
case 4:
|
|
369
|
+
return [
|
|
370
|
+
2
|
|
371
|
+
];
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
})();
|
|
360
375
|
})();
|
|
361
376
|
});
|
|
362
377
|
}, [
|
|
@@ -507,30 +522,32 @@ import { loadAceEditor, loadAceTheme } from "../loadAceEditor";
|
|
|
507
522
|
var theme = ((_editorProps_codeProps = editorProps.codeProps) === null || _editorProps_codeProps === void 0 ? void 0 : _editorProps_codeProps.theme) || props.theme || 'github';
|
|
508
523
|
codeEditor.setTheme("ace/theme/".concat(theme));
|
|
509
524
|
// 设置语法高亮
|
|
510
|
-
setTimeout(
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
525
|
+
setTimeout(function() {
|
|
526
|
+
return _async_to_generator(function() {
|
|
527
|
+
var lang, aceLangs;
|
|
528
|
+
return _ts_generator(this, function(_state) {
|
|
529
|
+
switch(_state.label){
|
|
530
|
+
case 0:
|
|
531
|
+
lang = element.language;
|
|
532
|
+
if (modeMap.has(lang)) {
|
|
533
|
+
lang = modeMap.get(lang);
|
|
534
|
+
}
|
|
535
|
+
return [
|
|
536
|
+
4,
|
|
537
|
+
getAceLangs()
|
|
538
|
+
];
|
|
539
|
+
case 1:
|
|
540
|
+
aceLangs = _state.sent();
|
|
541
|
+
if (aceLangs.has(lang)) {
|
|
542
|
+
codeEditor.session.setMode("ace/mode/".concat(lang));
|
|
543
|
+
}
|
|
544
|
+
return [
|
|
545
|
+
2
|
|
546
|
+
];
|
|
547
|
+
}
|
|
548
|
+
});
|
|
549
|
+
})();
|
|
550
|
+
}, 16);
|
|
534
551
|
if (readonly) return;
|
|
535
552
|
// 配置编辑器事件
|
|
536
553
|
setupEditorEvents(codeEditor);
|
|
@@ -569,43 +586,45 @@ import { loadAceEditor, loadAceTheme } from "../loadAceEditor";
|
|
|
569
586
|
var theme = ((_editorProps_codeProps = editorProps.codeProps) === null || _editorProps_codeProps === void 0 ? void 0 : _editorProps_codeProps.theme) || props.theme || 'github';
|
|
570
587
|
// 异步加载新主题
|
|
571
588
|
startTransition(function() {
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
589
|
+
(function() {
|
|
590
|
+
return _async_to_generator(function() {
|
|
591
|
+
var _editorRef_current, error, // 尝试使用默认主题
|
|
592
|
+
_editorRef_current1;
|
|
593
|
+
return _ts_generator(this, function(_state) {
|
|
594
|
+
switch(_state.label){
|
|
595
|
+
case 0:
|
|
596
|
+
_state.trys.push([
|
|
597
|
+
0,
|
|
598
|
+
2,
|
|
599
|
+
,
|
|
600
|
+
3
|
|
601
|
+
]);
|
|
602
|
+
return [
|
|
603
|
+
4,
|
|
604
|
+
loadAceTheme(theme)
|
|
605
|
+
];
|
|
606
|
+
case 1:
|
|
607
|
+
_state.sent();
|
|
608
|
+
(_editorRef_current = editorRef.current) === null || _editorRef_current === void 0 ? void 0 : _editorRef_current.setTheme("ace/theme/".concat(theme));
|
|
609
|
+
return [
|
|
610
|
+
3,
|
|
611
|
+
3
|
|
612
|
+
];
|
|
613
|
+
case 2:
|
|
614
|
+
error = _state.sent();
|
|
615
|
+
console.warn("Failed to load theme: ".concat(theme), error);
|
|
616
|
+
(_editorRef_current1 = editorRef.current) === null || _editorRef_current1 === void 0 ? void 0 : _editorRef_current1.setTheme("ace/theme/github");
|
|
617
|
+
return [
|
|
618
|
+
3,
|
|
619
|
+
3
|
|
620
|
+
];
|
|
621
|
+
case 3:
|
|
622
|
+
return [
|
|
623
|
+
2
|
|
624
|
+
];
|
|
625
|
+
}
|
|
626
|
+
});
|
|
627
|
+
})();
|
|
609
628
|
})();
|
|
610
629
|
});
|
|
611
630
|
}, [
|
|
@@ -614,8 +633,8 @@ import { loadAceEditor, loadAceTheme } from "../loadAceEditor";
|
|
|
614
633
|
aceLoaded
|
|
615
634
|
]);
|
|
616
635
|
// 暴露设置语言的方法
|
|
617
|
-
var setLanguage = useRefFunction(
|
|
618
|
-
|
|
636
|
+
var setLanguage = useRefFunction(function(changeLang) {
|
|
637
|
+
return _async_to_generator(function() {
|
|
619
638
|
var _element_language, lang, aceLangs, _editorRef_current, _editorRef_current1;
|
|
620
639
|
return _ts_generator(this, function(_state) {
|
|
621
640
|
switch(_state.label){
|
|
@@ -648,11 +667,8 @@ import { loadAceEditor, loadAceTheme } from "../loadAceEditor";
|
|
|
648
667
|
];
|
|
649
668
|
}
|
|
650
669
|
});
|
|
651
|
-
});
|
|
652
|
-
|
|
653
|
-
return _ref.apply(this, arguments);
|
|
654
|
-
};
|
|
655
|
-
}());
|
|
670
|
+
})();
|
|
671
|
+
});
|
|
656
672
|
return {
|
|
657
673
|
dom: dom,
|
|
658
674
|
editorRef: editorRef,
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* @fileoverview 代码渲染器组件
|
|
3
|
-
* 封装代码编辑器的所有渲染逻辑
|
|
4
|
-
*/ function _array_like_to_array(arr, len) {
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
5
2
|
if (len == null || len > arr.length) len = arr.length;
|
|
6
3
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
7
4
|
return arr2;
|
|
@@ -99,7 +96,10 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
99
96
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
100
97
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
101
98
|
}
|
|
102
|
-
|
|
99
|
+
/**
|
|
100
|
+
* @fileoverview 代码渲染器组件
|
|
101
|
+
* 封装代码编辑器的所有渲染逻辑
|
|
102
|
+
*/ import { ConfigProvider, Skeleton, theme as antdTheme } from "antd";
|
|
103
103
|
import React, { useEffect, useMemo, useState } from "react";
|
|
104
104
|
import { MarkdownEditor } from "../../../MarkdownEditor";
|
|
105
105
|
import { useEditorStore } from "../../../MarkdownEditor/editor/store";
|
|
@@ -153,6 +153,7 @@ import { AceEditor, AceEditorContainer, CodeContainer, CodeToolbar, HtmlPreview,
|
|
|
153
153
|
* - 响应式布局适配
|
|
154
154
|
* - 支持代码框选中状态管理
|
|
155
155
|
*/ export function CodeRenderer(props) {
|
|
156
|
+
var _ref;
|
|
156
157
|
var _editorProps_codeProps, _props_element_language, _props_element, _props_element1, _props_element_otherProps, _props_element2, _props_element_otherProps1, _props_element3, _editorProps_codeProps1, _editorProps_codeProps2;
|
|
157
158
|
var _useEditorStore = useEditorStore(), editorProps = _useEditorStore.editorProps, readonly = _useEditorStore.readonly;
|
|
158
159
|
// 使用状态管理Hook
|
|
@@ -161,11 +162,10 @@ import { AceEditor, AceEditorContainer, CodeContainer, CodeToolbar, HtmlPreview,
|
|
|
161
162
|
var _useState1 = _sliced_to_array(useState(true), 2), isExpanded = _useState1[0], setIsExpanded = _useState1[1];
|
|
162
163
|
// 选中状态管理
|
|
163
164
|
var _React_useState = _sliced_to_array(React.useState(false), 2), isSelected = _React_useState[0], setIsSelected = _React_useState[1];
|
|
164
|
-
var _editorProps_codeProps_disableHtmlPreview;
|
|
165
165
|
// 视图模式状态管理(用于HTML和Markdown)
|
|
166
166
|
// 如果是 markdown 或 html,默认打开预览模式
|
|
167
167
|
// 但如果禁用了 HTML 预览,则强制使用代码模式
|
|
168
|
-
var disableHtmlPreview = (
|
|
168
|
+
var disableHtmlPreview = (_ref = (_editorProps_codeProps = editorProps.codeProps) === null || _editorProps_codeProps === void 0 ? void 0 : _editorProps_codeProps.disableHtmlPreview) !== null && _ref !== void 0 ? _ref : false;
|
|
169
169
|
var language = (_props_element = props.element) === null || _props_element === void 0 ? void 0 : (_props_element_language = _props_element.language) === null || _props_element_language === void 0 ? void 0 : _props_element_language.toLowerCase();
|
|
170
170
|
var htmlValue = ((_props_element1 = props.element) === null || _props_element1 === void 0 ? void 0 : _props_element1.value) || '';
|
|
171
171
|
// 检测 HTML 代码中是否包含 JavaScript
|
|
@@ -76,13 +76,13 @@ import { LoadImage } from "./LoadImage";
|
|
|
76
76
|
* />
|
|
77
77
|
* ```
|
|
78
78
|
*/ export var CodeToolbar = function(props) {
|
|
79
|
+
var _ref;
|
|
79
80
|
var _editorProps_codeProps, _editorProps_codeProps1, _element_language, _element_language1, _i18n_locale, _i18n_locale1, _i18n_locale2, _i18n_locale3;
|
|
80
81
|
// 获取国际化上下文
|
|
81
82
|
var i18n = useContext(I18nContext);
|
|
82
83
|
// 获取编辑器配置
|
|
83
84
|
var editorProps = useEditorStore().editorProps;
|
|
84
|
-
var
|
|
85
|
-
var disableHtmlPreview = (_editorProps_codeProps_disableHtmlPreview = (_editorProps_codeProps = editorProps.codeProps) === null || _editorProps_codeProps === void 0 ? void 0 : _editorProps_codeProps.disableHtmlPreview) !== null && _editorProps_codeProps_disableHtmlPreview !== void 0 ? _editorProps_codeProps_disableHtmlPreview : false;
|
|
85
|
+
var disableHtmlPreview = (_ref = (_editorProps_codeProps = editorProps.codeProps) === null || _editorProps_codeProps === void 0 ? void 0 : _editorProps_codeProps.disableHtmlPreview) !== null && _ref !== void 0 ? _ref : false;
|
|
86
86
|
var viewModeLabels = (_editorProps_codeProps1 = editorProps.codeProps) === null || _editorProps_codeProps1 === void 0 ? void 0 : _editorProps_codeProps1.viewModeLabels;
|
|
87
87
|
var element = props.element, readonly = props.readonly, onCloseClick = props.onCloseClick, languageSelectorProps = props.languageSelectorProps, onViewModeToggle = props.onViewModeToggle, theme = props.theme, isExpanded = props.isExpanded, onExpandToggle = props.onExpandToggle, setTheme = props.setTheme, _props_viewMode = props.viewMode, viewMode = _props_viewMode === void 0 ? 'code' : _props_viewMode;
|
|
88
88
|
// 检测 HTML 代码中是否包含 JavaScript
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* @fileoverview 语言选择器组件
|
|
3
|
-
* 提供搜索和选择编程语言的交互界面
|
|
4
|
-
* @author Code Plugin Team
|
|
5
|
-
*/ function _array_like_to_array(arr, len) {
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
6
2
|
if (len == null || len > arr.length) len = arr.length;
|
|
7
3
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
8
4
|
return arr2;
|
|
@@ -48,7 +44,11 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
48
44
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
49
45
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
50
46
|
}
|
|
51
|
-
|
|
47
|
+
/**
|
|
48
|
+
* @fileoverview 语言选择器组件
|
|
49
|
+
* 提供搜索和选择编程语言的交互界面
|
|
50
|
+
* @author Code Plugin Team
|
|
51
|
+
*/ import { SearchOutlined } from "@ant-design/icons";
|
|
52
52
|
import { AutoComplete, Button, Input, Popover } from "antd";
|
|
53
53
|
import React, { useContext, useEffect, useRef, useState } from "react";
|
|
54
54
|
import { I18nContext } from "../../../I18n";
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* @fileoverview 图片加载组件,提供图片加载状态管理
|
|
3
|
-
* @author Code Plugin Team
|
|
4
|
-
*/ function _array_like_to_array(arr, len) {
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
5
2
|
if (len == null || len > arr.length) len = arr.length;
|
|
6
3
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
7
4
|
return arr2;
|
|
@@ -99,7 +96,10 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
99
96
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
100
97
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
101
98
|
}
|
|
102
|
-
|
|
99
|
+
/**
|
|
100
|
+
* @fileoverview 图片加载组件,提供图片加载状态管理
|
|
101
|
+
* @author Code Plugin Team
|
|
102
|
+
*/ import React, { useState } from "react";
|
|
103
103
|
/**
|
|
104
104
|
* 图片加载组件
|
|
105
105
|
*
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* @fileoverview 思考块组件
|
|
3
|
-
* 只读模式下渲染思考类型的代码块
|
|
4
|
-
*/ function _array_like_to_array(arr, len) {
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
5
2
|
if (len == null || len > arr.length) len = arr.length;
|
|
6
3
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
7
4
|
return arr2;
|
|
@@ -47,7 +44,10 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
47
44
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
48
45
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
49
46
|
}
|
|
50
|
-
|
|
47
|
+
/**
|
|
48
|
+
* @fileoverview 思考块组件
|
|
49
|
+
* 只读模式下渲染思考类型的代码块
|
|
50
|
+
*/ import { useMergedState } from "rc-util";
|
|
51
51
|
import React, { createContext, useContext, useEffect, useMemo, useRef } from "react";
|
|
52
52
|
import { MessagesContext } from "../../../Bubble/MessagesContent/BubbleContext";
|
|
53
53
|
import { I18nContext } from "../../../I18n";
|
|
@@ -90,6 +90,7 @@ import { ToolUseBarThink } from "../../../ToolUseBarThink";
|
|
|
90
90
|
});
|
|
91
91
|
};
|
|
92
92
|
export function ThinkBlock(props) {
|
|
93
|
+
var _ref, _ref1;
|
|
93
94
|
var _editorProps_codeProps, _editorProps_codeProps1;
|
|
94
95
|
var element = props.element;
|
|
95
96
|
var locale = useContext(I18nContext).locale;
|
|
@@ -129,13 +130,12 @@ export function ThinkBlock(props) {
|
|
|
129
130
|
markdownEditorRef.current,
|
|
130
131
|
elementPath
|
|
131
132
|
]);
|
|
132
|
-
var _editorProps_codeProps_alwaysExpandedDeepThink, _thinkBlockContext_expanded;
|
|
133
133
|
// 状态优先级(从高到低):
|
|
134
134
|
// 1. Context 提供的 expanded(受控模式)
|
|
135
135
|
// 2. editorProps?.codeProps?.alwaysExpandedDeepThink
|
|
136
136
|
// 3. 默认值(false)
|
|
137
|
-
var _useMergedState = _sliced_to_array(useMergedState((
|
|
138
|
-
value: (editorProps === null || editorProps === void 0 ? void 0 : (_editorProps_codeProps1 = editorProps.codeProps) === null || _editorProps_codeProps1 === void 0 ? void 0 : _editorProps_codeProps1.alwaysExpandedDeepThink) ? true : (
|
|
137
|
+
var _useMergedState = _sliced_to_array(useMergedState((_ref = editorProps === null || editorProps === void 0 ? void 0 : (_editorProps_codeProps = editorProps.codeProps) === null || _editorProps_codeProps === void 0 ? void 0 : _editorProps_codeProps.alwaysExpandedDeepThink) !== null && _ref !== void 0 ? _ref : false, {
|
|
138
|
+
value: (editorProps === null || editorProps === void 0 ? void 0 : (_editorProps_codeProps1 = editorProps.codeProps) === null || _editorProps_codeProps1 === void 0 ? void 0 : _editorProps_codeProps1.alwaysExpandedDeepThink) ? true : (_ref1 = thinkBlockContext === null || thinkBlockContext === void 0 ? void 0 : thinkBlockContext.expanded) !== null && _ref1 !== void 0 ? _ref1 : undefined,
|
|
139
139
|
defaultValue: false,
|
|
140
140
|
onChange: thinkBlockContext === null || thinkBlockContext === void 0 ? void 0 : thinkBlockContext.onExpandedChange
|
|
141
141
|
}), 2), expanded = _useMergedState[0], setExpanded = _useMergedState[1];
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* @fileoverview 代码编辑器状态管理Hook
|
|
3
|
-
* 统一管理代码编辑器的状态逻辑
|
|
4
|
-
*/ function _array_like_to_array(arr, len) {
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
5
2
|
if (len == null || len > arr.length) len = arr.length;
|
|
6
3
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
7
4
|
return arr2;
|
|
@@ -47,7 +44,10 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
47
44
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
48
45
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
49
46
|
}
|
|
50
|
-
|
|
47
|
+
/**
|
|
48
|
+
* @fileoverview 代码编辑器状态管理Hook
|
|
49
|
+
* 统一管理代码编辑器的状态逻辑
|
|
50
|
+
*/ import { useCallback, useEffect } from "react";
|
|
51
51
|
import { useGetSetState } from "react-use";
|
|
52
52
|
import { Transforms } from "slate";
|
|
53
53
|
import { ReactEditor } from "slate-react";
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* @fileoverview 代码编辑器插件主文件
|
|
3
|
-
* 提供基于 Ace Editor 的代码编辑功能,支持多种编程语言语法高亮
|
|
4
|
-
* @author Code Plugin Team
|
|
5
|
-
*/ function _array_like_to_array(arr, len) {
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
6
2
|
if (len == null || len > arr.length) len = arr.length;
|
|
7
3
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
8
4
|
return arr2;
|
|
@@ -27,7 +23,11 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
27
23
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
28
24
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
29
25
|
}
|
|
30
|
-
|
|
26
|
+
/**
|
|
27
|
+
* @fileoverview 代码编辑器插件主文件
|
|
28
|
+
* 提供基于 Ace Editor 的代码编辑功能,支持多种编程语言语法高亮
|
|
29
|
+
* @author Code Plugin Team
|
|
30
|
+
*/ import React from "react";
|
|
31
31
|
import { BaseMarkdownEditor } from "../../MarkdownEditor";
|
|
32
32
|
import { useEditorStore } from "../../MarkdownEditor/editor/store";
|
|
33
33
|
import { CodeRenderer } from "./components";
|
|
@@ -52,12 +52,22 @@ function _object_spread_props(target, source) {
|
|
|
52
52
|
}
|
|
53
53
|
function _object_without_properties(source, excluded) {
|
|
54
54
|
if (source == null) return {};
|
|
55
|
-
var target =
|
|
56
|
-
|
|
55
|
+
var target = {}, sourceKeys, key, i;
|
|
56
|
+
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
57
|
+
sourceKeys = Reflect.ownKeys(source);
|
|
58
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
59
|
+
key = sourceKeys[i];
|
|
60
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
61
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
62
|
+
target[key] = source[key];
|
|
63
|
+
}
|
|
64
|
+
return target;
|
|
65
|
+
}
|
|
66
|
+
target = _object_without_properties_loose(source, excluded);
|
|
57
67
|
if (Object.getOwnPropertySymbols) {
|
|
58
|
-
|
|
59
|
-
for(i = 0; i <
|
|
60
|
-
key =
|
|
68
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
69
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
70
|
+
key = sourceKeys[i];
|
|
61
71
|
if (excluded.indexOf(key) >= 0) continue;
|
|
62
72
|
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
63
73
|
target[key] = source[key];
|
|
@@ -67,19 +77,18 @@ function _object_without_properties(source, excluded) {
|
|
|
67
77
|
}
|
|
68
78
|
function _object_without_properties_loose(source, excluded) {
|
|
69
79
|
if (source == null) return {};
|
|
70
|
-
var target = {};
|
|
71
|
-
var sourceKeys = Object.keys(source);
|
|
72
|
-
var key, i;
|
|
80
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
73
81
|
for(i = 0; i < sourceKeys.length; i++){
|
|
74
82
|
key = sourceKeys[i];
|
|
75
83
|
if (excluded.indexOf(key) >= 0) continue;
|
|
84
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
76
85
|
target[key] = source[key];
|
|
77
86
|
}
|
|
78
87
|
return target;
|
|
79
88
|
}
|
|
80
89
|
import React from "react";
|
|
81
|
-
export var AbapIcon = function(
|
|
82
|
-
var
|
|
90
|
+
export var AbapIcon = function(_0) {
|
|
91
|
+
var _0_size = _0.size, size = _0_size === void 0 ? '1em' : _0_size, props = _object_without_properties(_0, [
|
|
83
92
|
"size"
|
|
84
93
|
]);
|
|
85
94
|
return /*#__PURE__*/ React.createElement("svg", _object_spread_props(_object_spread({
|