@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
|
@@ -74,7 +74,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
74
74
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
75
75
|
}
|
|
76
76
|
function _ts_generator(thisArg, body) {
|
|
77
|
-
var f, y, t,
|
|
77
|
+
var f, y, t, _ = {
|
|
78
78
|
label: 0,
|
|
79
79
|
sent: function() {
|
|
80
80
|
if (t[0] & 1) throw t[1];
|
|
@@ -82,13 +82,17 @@ function _ts_generator(thisArg, body) {
|
|
|
82
82
|
},
|
|
83
83
|
trys: [],
|
|
84
84
|
ops: []
|
|
85
|
-
};
|
|
86
|
-
return g
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
},
|
|
91
|
-
|
|
85
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
86
|
+
return d(g, "next", {
|
|
87
|
+
value: verb(0)
|
|
88
|
+
}), d(g, "throw", {
|
|
89
|
+
value: verb(1)
|
|
90
|
+
}), d(g, "return", {
|
|
91
|
+
value: verb(2)
|
|
92
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
93
|
+
value: function() {
|
|
94
|
+
return this;
|
|
95
|
+
}
|
|
92
96
|
}), g;
|
|
93
97
|
function verb(n) {
|
|
94
98
|
return function(v) {
|
|
@@ -100,7 +104,7 @@ function _ts_generator(thisArg, body) {
|
|
|
100
104
|
}
|
|
101
105
|
function step(op) {
|
|
102
106
|
if (f) throw new TypeError("Generator is already executing.");
|
|
103
|
-
while(_)try {
|
|
107
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
104
108
|
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;
|
|
105
109
|
if (y = 0, t) op = [
|
|
106
110
|
op[0] & 2,
|
|
@@ -193,124 +197,128 @@ import { useRefFunction } from "../../Hooks/useRefFunction";
|
|
|
193
197
|
});
|
|
194
198
|
/**
|
|
195
199
|
* 开始录音
|
|
196
|
-
*/ var startRecording = useRefFunction(
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
200
|
+
*/ var startRecording = useRefFunction(function() {
|
|
201
|
+
return _async_to_generator(function() {
|
|
202
|
+
var recognizer, e;
|
|
203
|
+
return _ts_generator(this, function(_state) {
|
|
204
|
+
switch(_state.label){
|
|
205
|
+
case 0:
|
|
206
|
+
if (!voiceRecognizer) return [
|
|
207
|
+
2
|
|
208
|
+
];
|
|
209
|
+
if (recording || pendingRef.current) return [
|
|
210
|
+
2
|
|
211
|
+
];
|
|
212
|
+
pendingRef.current = true;
|
|
213
|
+
_state.label = 1;
|
|
214
|
+
case 1:
|
|
215
|
+
_state.trys.push([
|
|
216
|
+
1,
|
|
217
|
+
4,
|
|
218
|
+
5,
|
|
219
|
+
6
|
|
220
|
+
]);
|
|
221
|
+
return [
|
|
222
|
+
4,
|
|
223
|
+
voiceRecognizer({
|
|
224
|
+
onSentenceBegin: function() {
|
|
225
|
+
var _editorRef_current_store, _editorRef_current;
|
|
226
|
+
// 记录当前内容位置,重置本句累积
|
|
227
|
+
var current = (editorRef === null || editorRef === void 0 ? void 0 : (_editorRef_current = editorRef.current) === null || _editorRef_current === void 0 ? void 0 : (_editorRef_current_store = _editorRef_current.store) === null || _editorRef_current_store === void 0 ? void 0 : _editorRef_current_store.getMDContent()) || '';
|
|
228
|
+
sentenceStartIndexRef.current = current.length;
|
|
229
|
+
},
|
|
230
|
+
onPartial: updateCurrentSentence,
|
|
231
|
+
onSentenceEnd: updateCurrentSentence,
|
|
232
|
+
onError: function() {
|
|
233
|
+
var _recognizerRef_current_stop, _recognizerRef_current;
|
|
234
|
+
setRecording(false);
|
|
235
|
+
(_recognizerRef_current = recognizerRef.current) === null || _recognizerRef_current === void 0 ? void 0 : (_recognizerRef_current_stop = _recognizerRef_current.stop) === null || _recognizerRef_current_stop === void 0 ? void 0 : _recognizerRef_current_stop.call(_recognizerRef_current).catch(function() {
|
|
236
|
+
return void 0;
|
|
237
|
+
});
|
|
238
|
+
recognizerRef.current = null;
|
|
239
|
+
pendingRef.current = false;
|
|
240
|
+
}
|
|
241
|
+
})
|
|
242
|
+
];
|
|
243
|
+
case 2:
|
|
244
|
+
recognizer = _state.sent();
|
|
245
|
+
recognizerRef.current = recognizer;
|
|
246
|
+
return [
|
|
247
|
+
4,
|
|
248
|
+
recognizerRef.current.start()
|
|
249
|
+
];
|
|
250
|
+
case 3:
|
|
251
|
+
_state.sent();
|
|
252
|
+
setRecording(true);
|
|
253
|
+
return [
|
|
254
|
+
3,
|
|
255
|
+
6
|
|
256
|
+
];
|
|
257
|
+
case 4:
|
|
258
|
+
e = _state.sent();
|
|
259
|
+
recognizerRef.current = null;
|
|
260
|
+
return [
|
|
261
|
+
3,
|
|
262
|
+
6
|
|
263
|
+
];
|
|
264
|
+
case 5:
|
|
265
|
+
pendingRef.current = false;
|
|
266
|
+
return [
|
|
267
|
+
7
|
|
268
|
+
];
|
|
269
|
+
case 6:
|
|
270
|
+
return [
|
|
271
|
+
2
|
|
272
|
+
];
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
})();
|
|
276
|
+
});
|
|
271
277
|
/**
|
|
272
278
|
* 停止录音
|
|
273
|
-
*/ var stopRecording = useRefFunction(
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
279
|
+
*/ var stopRecording = useRefFunction(function() {
|
|
280
|
+
return _async_to_generator(function() {
|
|
281
|
+
var _recognizerRef_current;
|
|
282
|
+
return _ts_generator(this, function(_state) {
|
|
283
|
+
switch(_state.label){
|
|
284
|
+
case 0:
|
|
285
|
+
if (!recording || pendingRef.current) return [
|
|
286
|
+
2
|
|
287
|
+
];
|
|
288
|
+
pendingRef.current = true;
|
|
289
|
+
_state.label = 1;
|
|
290
|
+
case 1:
|
|
291
|
+
_state.trys.push([
|
|
292
|
+
1,
|
|
293
|
+
,
|
|
294
|
+
3,
|
|
295
|
+
4
|
|
296
|
+
]);
|
|
297
|
+
return [
|
|
298
|
+
4,
|
|
299
|
+
(_recognizerRef_current = recognizerRef.current) === null || _recognizerRef_current === void 0 ? void 0 : _recognizerRef_current.stop()
|
|
300
|
+
];
|
|
301
|
+
case 2:
|
|
302
|
+
_state.sent();
|
|
303
|
+
return [
|
|
304
|
+
3,
|
|
305
|
+
4
|
|
306
|
+
];
|
|
307
|
+
case 3:
|
|
308
|
+
setRecording(false);
|
|
309
|
+
recognizerRef.current = null;
|
|
310
|
+
pendingRef.current = false;
|
|
311
|
+
return [
|
|
312
|
+
7
|
|
313
|
+
];
|
|
314
|
+
case 4:
|
|
315
|
+
return [
|
|
316
|
+
2
|
|
317
|
+
];
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
})();
|
|
321
|
+
});
|
|
314
322
|
// 清理函数
|
|
315
323
|
useEffect(function() {
|
|
316
324
|
return function() {
|
|
@@ -80,7 +80,7 @@ function _object_spread_props(target, source) {
|
|
|
80
80
|
return target;
|
|
81
81
|
}
|
|
82
82
|
function _ts_generator(thisArg, body) {
|
|
83
|
-
var f, y, t,
|
|
83
|
+
var f, y, t, _ = {
|
|
84
84
|
label: 0,
|
|
85
85
|
sent: function() {
|
|
86
86
|
if (t[0] & 1) throw t[1];
|
|
@@ -88,13 +88,17 @@ function _ts_generator(thisArg, body) {
|
|
|
88
88
|
},
|
|
89
89
|
trys: [],
|
|
90
90
|
ops: []
|
|
91
|
-
};
|
|
92
|
-
return g
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
},
|
|
97
|
-
|
|
91
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
92
|
+
return d(g, "next", {
|
|
93
|
+
value: verb(0)
|
|
94
|
+
}), d(g, "throw", {
|
|
95
|
+
value: verb(1)
|
|
96
|
+
}), d(g, "return", {
|
|
97
|
+
value: verb(2)
|
|
98
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
99
|
+
value: function() {
|
|
100
|
+
return this;
|
|
101
|
+
}
|
|
98
102
|
}), g;
|
|
99
103
|
function verb(n) {
|
|
100
104
|
return function(v) {
|
|
@@ -106,7 +110,7 @@ function _ts_generator(thisArg, body) {
|
|
|
106
110
|
}
|
|
107
111
|
function step(op) {
|
|
108
112
|
if (f) throw new TypeError("Generator is already executing.");
|
|
109
|
-
while(_)try {
|
|
113
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
110
114
|
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;
|
|
111
115
|
if (y = 0, t) op = [
|
|
112
116
|
op[0] & 2,
|
|
@@ -174,7 +178,6 @@ function _ts_generator(thisArg, body) {
|
|
|
174
178
|
};
|
|
175
179
|
}
|
|
176
180
|
}
|
|
177
|
-
import React from "react";
|
|
178
181
|
import { Editor, Transforms } from "slate";
|
|
179
182
|
import { useRefFunction } from "../../Hooks/useRefFunction";
|
|
180
183
|
import { upLoadFileToServer } from "../AttachmentButton";
|
|
@@ -195,93 +198,95 @@ import { getFileListFromDataTransferItems } from "../FilePaste";
|
|
|
195
198
|
* 发送消息的函数
|
|
196
199
|
* @description 该函数用于处理发送消息的逻辑,包括调用回调函数和清空输入框。
|
|
197
200
|
* @returns {Promise<void>} 发送操作的Promise
|
|
198
|
-
*/ var sendMessage = useRefFunction(
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
201
|
+
*/ var sendMessage = useRefFunction(function() {
|
|
202
|
+
return _async_to_generator(function() {
|
|
203
|
+
var _markdownEditorRef_current_store, _markdownEditorRef_current, mdValue, _props_onChange, _markdownEditorRef_current_store1, _markdownEditorRef_current1, _props_onChange1, error;
|
|
204
|
+
return _ts_generator(this, function(_state) {
|
|
205
|
+
switch(_state.label){
|
|
206
|
+
case 0:
|
|
207
|
+
if (props.disabled) return [
|
|
208
|
+
2
|
|
209
|
+
];
|
|
210
|
+
if (props.typing) return [
|
|
211
|
+
2
|
|
212
|
+
];
|
|
213
|
+
// 防止重复触发:如果正在加载中,直接返回
|
|
214
|
+
if (isLoading) return [
|
|
215
|
+
2
|
|
216
|
+
];
|
|
217
|
+
// 使用 ref 防止快速连续触发
|
|
218
|
+
if (isSendingRef.current) return [
|
|
219
|
+
2
|
|
220
|
+
];
|
|
221
|
+
if (!recording) return [
|
|
222
|
+
3,
|
|
223
|
+
2
|
|
224
|
+
];
|
|
225
|
+
return [
|
|
226
|
+
4,
|
|
227
|
+
stopRecording()
|
|
228
|
+
];
|
|
229
|
+
case 1:
|
|
230
|
+
_state.sent();
|
|
231
|
+
_state.label = 2;
|
|
232
|
+
case 2:
|
|
233
|
+
mdValue = markdownEditorRef === null || markdownEditorRef === void 0 ? void 0 : (_markdownEditorRef_current = markdownEditorRef.current) === null || _markdownEditorRef_current === void 0 ? void 0 : (_markdownEditorRef_current_store = _markdownEditorRef_current.store) === null || _markdownEditorRef_current_store === void 0 ? void 0 : _markdownEditorRef_current_store.getMDContent();
|
|
234
|
+
// 如果mdValue和value不一致,并且mdValue不为空,则调用onChange
|
|
235
|
+
if (mdValue !== value && mdValue) {
|
|
236
|
+
;
|
|
237
|
+
(_props_onChange = props.onChange) === null || _props_onChange === void 0 ? void 0 : _props_onChange.call(props, mdValue);
|
|
238
|
+
}
|
|
239
|
+
if (!(props.onSend && (props.allowEmptySubmit || mdValue))) return [
|
|
240
|
+
3,
|
|
241
|
+
7
|
|
242
|
+
];
|
|
243
|
+
// 设置发送标记
|
|
244
|
+
isSendingRef.current = true;
|
|
245
|
+
setIsLoading(true);
|
|
246
|
+
_state.label = 3;
|
|
247
|
+
case 3:
|
|
248
|
+
_state.trys.push([
|
|
249
|
+
3,
|
|
250
|
+
5,
|
|
251
|
+
6,
|
|
252
|
+
7
|
|
253
|
+
]);
|
|
254
|
+
return [
|
|
255
|
+
4,
|
|
256
|
+
props.onSend(mdValue || '')
|
|
257
|
+
];
|
|
258
|
+
case 4:
|
|
259
|
+
_state.sent();
|
|
260
|
+
markdownEditorRef === null || markdownEditorRef === void 0 ? void 0 : (_markdownEditorRef_current1 = markdownEditorRef.current) === null || _markdownEditorRef_current1 === void 0 ? void 0 : (_markdownEditorRef_current_store1 = _markdownEditorRef_current1.store) === null || _markdownEditorRef_current_store1 === void 0 ? void 0 : _markdownEditorRef_current_store1.clearContent();
|
|
261
|
+
(_props_onChange1 = props.onChange) === null || _props_onChange1 === void 0 ? void 0 : _props_onChange1.call(props, '');
|
|
262
|
+
setValue('');
|
|
263
|
+
setFileMap === null || setFileMap === void 0 ? void 0 : setFileMap(new Map());
|
|
264
|
+
return [
|
|
265
|
+
3,
|
|
266
|
+
7
|
|
267
|
+
];
|
|
268
|
+
case 5:
|
|
269
|
+
error = _state.sent();
|
|
270
|
+
console.error('Send message failed:', error);
|
|
271
|
+
throw error;
|
|
272
|
+
case 6:
|
|
273
|
+
setIsLoading(false);
|
|
274
|
+
// 重置发送标记
|
|
275
|
+
isSendingRef.current = false;
|
|
276
|
+
return [
|
|
277
|
+
7
|
|
278
|
+
];
|
|
279
|
+
case 7:
|
|
280
|
+
return [
|
|
281
|
+
2
|
|
282
|
+
];
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
})();
|
|
286
|
+
});
|
|
282
287
|
// 图片粘贴上传
|
|
283
|
-
var handlePaste = useRefFunction(
|
|
284
|
-
|
|
288
|
+
var handlePaste = useRefFunction(function(e) {
|
|
289
|
+
return _async_to_generator(function() {
|
|
285
290
|
var _props_markdownProps, attachmentConfig, imageFiles;
|
|
286
291
|
return _ts_generator(this, function(_state) {
|
|
287
292
|
switch(_state.label){
|
|
@@ -317,11 +322,8 @@ import { getFileListFromDataTransferItems } from "../FilePaste";
|
|
|
317
322
|
];
|
|
318
323
|
}
|
|
319
324
|
});
|
|
320
|
-
});
|
|
321
|
-
|
|
322
|
-
return _ref.apply(this, arguments);
|
|
323
|
-
};
|
|
324
|
-
}());
|
|
325
|
+
})();
|
|
326
|
+
});
|
|
325
327
|
// 键盘事件:早返回减少嵌套
|
|
326
328
|
var handleKeyDown = useRefFunction(function(e) {
|
|
327
329
|
var _markdownEditorRef_current, _markdownEditorRef_current_markdownEditorRef, _markdownEditorRef_current1;
|
|
@@ -123,6 +123,7 @@ var genStyle = function(token) {
|
|
|
123
123
|
maxWidth: 980,
|
|
124
124
|
position: 'relative',
|
|
125
125
|
transition: 'box-shadow 0.3s',
|
|
126
|
+
overflow: 'hidden',
|
|
126
127
|
'> * ': {
|
|
127
128
|
boxSizing: 'border-box'
|
|
128
129
|
},
|
|
@@ -138,7 +139,6 @@ var genStyle = function(token) {
|
|
|
138
139
|
'&-enlarged': (_obj = {}, _define_property(_obj, "".concat(token.componentCls, "-editor"), {
|
|
139
140
|
flex: 1,
|
|
140
141
|
height: '100%',
|
|
141
|
-
minHeight: '100%',
|
|
142
142
|
maxHeight: 'none',
|
|
143
143
|
overflow: 'hidden',
|
|
144
144
|
width: '100%'
|
|
@@ -187,7 +187,6 @@ var genStyle = function(token) {
|
|
|
187
187
|
'&-editor-content': _define_property({
|
|
188
188
|
overflowY: 'auto',
|
|
189
189
|
maxHeight: 'inherit',
|
|
190
|
-
borderRadius: 'inherit',
|
|
191
190
|
scrollbarColor: 'var(--color-gray-text-tertiary) transparent',
|
|
192
191
|
scrollbarWidth: 'thin'
|
|
193
192
|
}, "@media (max-width: ".concat(MOBILE_BREAKPOINT, ")"), {
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Markdown 输入字段的属性接口
|
|
3
|
+
*
|
|
4
|
+
* @interface MarkdownInputFieldProps
|
|
5
|
+
* @property {string} [value] - 输入字段的当前文本值
|
|
6
|
+
* @property {function} [onChange] - 当输入值改变时触发的回调函数
|
|
7
|
+
* @property {string} [placeholder] - 输入字段的占位文本
|
|
8
|
+
* @property {React.CSSProperties} [style] - 应用于输入字段的内联样式
|
|
9
|
+
* @property {string} [className] - 应用于输入字段的 CSS 类名
|
|
10
|
+
* @property {boolean} [disabled] - 是否禁用输入字段
|
|
11
|
+
* @property {boolean} [typing] - 用户是否正在输入的状态标志
|
|
12
|
+
* @property {'Enter'} [triggerSendKey] - 触发发送操作的键盘快捷键(Enter 发送,Shift+Enter 换行)
|
|
13
|
+
* @property {function} [onSend] - 当内容发送时触发的异步回调函数
|
|
14
|
+
*/ export { };
|