@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
|
@@ -138,7 +138,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
138
138
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
139
139
|
}
|
|
140
140
|
function _ts_generator(thisArg, body) {
|
|
141
|
-
var f, y, t,
|
|
141
|
+
var f, y, t, _ = {
|
|
142
142
|
label: 0,
|
|
143
143
|
sent: function() {
|
|
144
144
|
if (t[0] & 1) throw t[1];
|
|
@@ -146,13 +146,17 @@ function _ts_generator(thisArg, body) {
|
|
|
146
146
|
},
|
|
147
147
|
trys: [],
|
|
148
148
|
ops: []
|
|
149
|
-
};
|
|
150
|
-
return g
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
},
|
|
155
|
-
|
|
149
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
150
|
+
return d(g, "next", {
|
|
151
|
+
value: verb(0)
|
|
152
|
+
}), d(g, "throw", {
|
|
153
|
+
value: verb(1)
|
|
154
|
+
}), d(g, "return", {
|
|
155
|
+
value: verb(2)
|
|
156
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
157
|
+
value: function() {
|
|
158
|
+
return this;
|
|
159
|
+
}
|
|
156
160
|
}), g;
|
|
157
161
|
function verb(n) {
|
|
158
162
|
return function(v) {
|
|
@@ -164,7 +168,7 @@ function _ts_generator(thisArg, body) {
|
|
|
164
168
|
}
|
|
165
169
|
function step(op) {
|
|
166
170
|
if (f) throw new TypeError("Generator is already executing.");
|
|
167
|
-
while(_)try {
|
|
171
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
168
172
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
169
173
|
if (y = 0, t) op = [
|
|
170
174
|
op[0] & 2,
|
|
@@ -482,8 +486,8 @@ export var InsertAutocomplete = function(props) {
|
|
|
482
486
|
if (typeof window === 'undefined') return;
|
|
483
487
|
window.removeEventListener('click', clickClose);
|
|
484
488
|
}, []);
|
|
485
|
-
var runInsertTask = useCallback(
|
|
486
|
-
|
|
489
|
+
var runInsertTask = useCallback(function(op, params) {
|
|
490
|
+
return _async_to_generator(function() {
|
|
487
491
|
var _props_runInsertTask;
|
|
488
492
|
return _ts_generator(this, function(_state) {
|
|
489
493
|
switch(_state.label){
|
|
@@ -557,108 +561,107 @@ export var InsertAutocomplete = function(props) {
|
|
|
557
561
|
];
|
|
558
562
|
}
|
|
559
563
|
});
|
|
560
|
-
});
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
if (!res.ok) {
|
|
595
|
-
throw new Error();
|
|
596
|
-
}
|
|
597
|
-
size = Number(res.headers.get('content-length') || 0);
|
|
598
|
-
match = url.match(/([\w_-]+)\.\w+$/);
|
|
599
|
-
if (match) {
|
|
600
|
-
name = match[1];
|
|
601
|
-
}
|
|
602
|
-
_state.label = 3;
|
|
603
|
-
case 3:
|
|
604
|
-
Transforms.insertText(markdownEditorRef.current, '', {
|
|
605
|
-
at: {
|
|
606
|
-
anchor: Editor.start(markdownEditorRef.current, ctx.current.path),
|
|
607
|
-
focus: Editor.end(markdownEditorRef.current, ctx.current.path)
|
|
564
|
+
})();
|
|
565
|
+
}, []);
|
|
566
|
+
var insertAttachByLink = useCallback(function() {
|
|
567
|
+
return _async_to_generator(function() {
|
|
568
|
+
var url, size, name, res, match, node, next, _Editor_nodes, m;
|
|
569
|
+
return _ts_generator(this, function(_state) {
|
|
570
|
+
switch(_state.label){
|
|
571
|
+
case 0:
|
|
572
|
+
setState({
|
|
573
|
+
loading: true
|
|
574
|
+
});
|
|
575
|
+
_state.label = 1;
|
|
576
|
+
case 1:
|
|
577
|
+
_state.trys.push([
|
|
578
|
+
1,
|
|
579
|
+
,
|
|
580
|
+
4,
|
|
581
|
+
5
|
|
582
|
+
]);
|
|
583
|
+
url = state.insertUrl;
|
|
584
|
+
size = 0;
|
|
585
|
+
name = url;
|
|
586
|
+
if (!/^https?:\/\//.test(url)) return [
|
|
587
|
+
3,
|
|
588
|
+
3
|
|
589
|
+
];
|
|
590
|
+
return [
|
|
591
|
+
4,
|
|
592
|
+
fetch(url)
|
|
593
|
+
];
|
|
594
|
+
case 2:
|
|
595
|
+
res = _state.sent();
|
|
596
|
+
if (!res.ok) {
|
|
597
|
+
throw new Error();
|
|
608
598
|
}
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
599
|
+
size = Number(res.headers.get('content-length') || 0);
|
|
600
|
+
match = url.match(/([\w_-]+)\.\w+$/);
|
|
601
|
+
if (match) {
|
|
602
|
+
name = match[1];
|
|
603
|
+
}
|
|
604
|
+
_state.label = 3;
|
|
605
|
+
case 3:
|
|
606
|
+
Transforms.insertText(markdownEditorRef.current, '', {
|
|
607
|
+
at: {
|
|
608
|
+
anchor: Editor.start(markdownEditorRef.current, ctx.current.path),
|
|
609
|
+
focus: Editor.end(markdownEditorRef.current, ctx.current.path)
|
|
618
610
|
}
|
|
619
|
-
]
|
|
620
|
-
};
|
|
621
|
-
Transforms.setNodes(markdownEditorRef.current, node, {
|
|
622
|
-
at: ctx.current.path
|
|
623
|
-
});
|
|
624
|
-
EditorUtils.focus(markdownEditorRef.current);
|
|
625
|
-
next = Editor.next(markdownEditorRef.current, {
|
|
626
|
-
at: ctx.current.path
|
|
627
|
-
});
|
|
628
|
-
if ((next === null || next === void 0 ? void 0 : next[0].type) === 'paragraph' && !Node.string(next[0])) {
|
|
629
|
-
Transforms.delete(markdownEditorRef.current, {
|
|
630
|
-
at: next[1]
|
|
631
611
|
});
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
612
|
+
node = {
|
|
613
|
+
type: 'attach',
|
|
614
|
+
name: name,
|
|
615
|
+
url: url,
|
|
616
|
+
size: size,
|
|
617
|
+
children: [
|
|
618
|
+
{
|
|
619
|
+
text: ''
|
|
620
|
+
}
|
|
621
|
+
]
|
|
622
|
+
};
|
|
623
|
+
Transforms.setNodes(markdownEditorRef.current, node, {
|
|
624
|
+
at: ctx.current.path
|
|
625
|
+
});
|
|
626
|
+
EditorUtils.focus(markdownEditorRef.current);
|
|
627
|
+
next = Editor.next(markdownEditorRef.current, {
|
|
628
|
+
at: ctx.current.path
|
|
629
|
+
});
|
|
630
|
+
if ((next === null || next === void 0 ? void 0 : next[0].type) === 'paragraph' && !Node.string(next[0])) {
|
|
631
|
+
Transforms.delete(markdownEditorRef.current, {
|
|
632
|
+
at: next[1]
|
|
633
|
+
});
|
|
634
|
+
}
|
|
635
|
+
_Editor_nodes = _sliced_to_array(Editor.nodes(markdownEditorRef.current, {
|
|
636
|
+
match: function(n) {
|
|
637
|
+
return !!n.type;
|
|
638
|
+
},
|
|
639
|
+
mode: 'lowest'
|
|
640
|
+
}), 1), m = _Editor_nodes[0];
|
|
641
|
+
selChange$.next({
|
|
642
|
+
node: m,
|
|
643
|
+
sel: markdownEditorRef.current.selection
|
|
644
|
+
});
|
|
645
|
+
close();
|
|
646
|
+
return [
|
|
647
|
+
3,
|
|
648
|
+
5
|
|
649
|
+
];
|
|
650
|
+
case 4:
|
|
651
|
+
setState({
|
|
652
|
+
loading: false
|
|
653
|
+
});
|
|
654
|
+
return [
|
|
655
|
+
7
|
|
656
|
+
];
|
|
657
|
+
case 5:
|
|
658
|
+
return [
|
|
659
|
+
2
|
|
660
|
+
];
|
|
661
|
+
}
|
|
662
|
+
});
|
|
663
|
+
})();
|
|
664
|
+
}, []);
|
|
662
665
|
var keydown = useCallback(function(e) {
|
|
663
666
|
if (state.options.length && (e.key === 'ArrowUp' || e.key === 'ArrowDown')) {
|
|
664
667
|
e.preventDefault();
|
|
@@ -715,99 +718,101 @@ export var InsertAutocomplete = function(props) {
|
|
|
715
718
|
]);
|
|
716
719
|
/**
|
|
717
720
|
* 插入媒体
|
|
718
|
-
*/ var insertMedia = useCallback(
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
for(_iterator = replaceUrl[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
738
|
-
r = _step.value;
|
|
739
|
-
m = url.match(r.reg);
|
|
740
|
-
if (m) {
|
|
741
|
-
url = r.replace(m);
|
|
742
|
-
break;
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
} catch (err) {
|
|
746
|
-
_didIteratorError = true;
|
|
747
|
-
_iteratorError = err;
|
|
748
|
-
} finally{
|
|
721
|
+
*/ var insertMedia = useCallback(function() {
|
|
722
|
+
return _async_to_generator(function() {
|
|
723
|
+
var url, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, r, m, type, node, _Editor_nodes, n;
|
|
724
|
+
return _ts_generator(this, function(_state) {
|
|
725
|
+
switch(_state.label){
|
|
726
|
+
case 0:
|
|
727
|
+
setState({
|
|
728
|
+
loading: true
|
|
729
|
+
});
|
|
730
|
+
_state.label = 1;
|
|
731
|
+
case 1:
|
|
732
|
+
_state.trys.push([
|
|
733
|
+
1,
|
|
734
|
+
,
|
|
735
|
+
3,
|
|
736
|
+
4
|
|
737
|
+
]);
|
|
738
|
+
url = state.insertUrl;
|
|
739
|
+
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
749
740
|
try {
|
|
750
|
-
|
|
751
|
-
|
|
741
|
+
for(_iterator = replaceUrl[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
742
|
+
r = _step.value;
|
|
743
|
+
m = url.match(r.reg);
|
|
744
|
+
if (m) {
|
|
745
|
+
url = r.replace(m);
|
|
746
|
+
break;
|
|
747
|
+
}
|
|
752
748
|
}
|
|
749
|
+
} catch (err) {
|
|
750
|
+
_didIteratorError = true;
|
|
751
|
+
_iteratorError = err;
|
|
753
752
|
} finally{
|
|
754
|
-
|
|
755
|
-
|
|
753
|
+
try {
|
|
754
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
755
|
+
_iterator.return();
|
|
756
|
+
}
|
|
757
|
+
} finally{
|
|
758
|
+
if (_didIteratorError) {
|
|
759
|
+
throw _iteratorError;
|
|
760
|
+
}
|
|
756
761
|
}
|
|
757
762
|
}
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
throw new Error();
|
|
761
|
-
}
|
|
762
|
-
return [
|
|
763
|
-
4,
|
|
764
|
-
getRemoteMediaType(url)
|
|
765
|
-
];
|
|
766
|
-
case 2:
|
|
767
|
-
type = _state.sent();
|
|
768
|
-
if (!type) {
|
|
769
|
-
throw new Error();
|
|
770
|
-
}
|
|
771
|
-
Transforms.insertText(markdownEditorRef.current, '', {
|
|
772
|
-
at: {
|
|
773
|
-
anchor: Editor.start(markdownEditorRef.current, ctx.current.path),
|
|
774
|
-
focus: Editor.end(markdownEditorRef.current, ctx.current.path)
|
|
763
|
+
if (!/^(\w+:)?\/\//.test(url)) {
|
|
764
|
+
throw new Error();
|
|
775
765
|
}
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
766
|
+
return [
|
|
767
|
+
4,
|
|
768
|
+
getRemoteMediaType(url)
|
|
769
|
+
];
|
|
770
|
+
case 2:
|
|
771
|
+
type = _state.sent();
|
|
772
|
+
if (!type) {
|
|
773
|
+
throw new Error();
|
|
774
|
+
}
|
|
775
|
+
Transforms.insertText(markdownEditorRef.current, '', {
|
|
776
|
+
at: {
|
|
777
|
+
anchor: Editor.start(markdownEditorRef.current, ctx.current.path),
|
|
778
|
+
focus: Editor.end(markdownEditorRef.current, ctx.current.path)
|
|
779
|
+
}
|
|
780
|
+
});
|
|
781
|
+
node = EditorUtils.createMediaNode(url, 'image', {});
|
|
782
|
+
Transforms.setNodes(markdownEditorRef.current, node, {
|
|
783
|
+
at: ctx.current.path
|
|
784
|
+
});
|
|
785
|
+
EditorUtils.focus(markdownEditorRef.current);
|
|
786
|
+
_Editor_nodes = _sliced_to_array(Editor.nodes(markdownEditorRef.current, {
|
|
787
|
+
match: function(n) {
|
|
788
|
+
return !!n.type;
|
|
789
|
+
},
|
|
790
|
+
mode: 'lowest'
|
|
791
|
+
}), 1), n = _Editor_nodes[0];
|
|
792
|
+
selChange$.next({
|
|
793
|
+
sel: markdownEditorRef.current.selection,
|
|
794
|
+
node: n
|
|
795
|
+
});
|
|
796
|
+
close();
|
|
797
|
+
return [
|
|
798
|
+
3,
|
|
799
|
+
4
|
|
800
|
+
];
|
|
801
|
+
case 3:
|
|
802
|
+
setState({
|
|
803
|
+
loading: false
|
|
804
|
+
});
|
|
805
|
+
return [
|
|
806
|
+
7
|
|
807
|
+
];
|
|
808
|
+
case 4:
|
|
809
|
+
return [
|
|
810
|
+
2
|
|
811
|
+
];
|
|
812
|
+
}
|
|
813
|
+
});
|
|
814
|
+
})();
|
|
815
|
+
}, []);
|
|
811
816
|
useSubject(insertCompletionText$, function(text) {
|
|
812
817
|
var _props_insertOptions;
|
|
813
818
|
var tempText = text || '';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
2
2
|
if (len == null || len > arr.length) len = arr.length;
|
|
3
3
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
4
|
return arr2;
|
|
@@ -44,7 +44,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
44
44
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
45
45
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
46
46
|
}
|
|
47
|
-
import { DeleteOutlined } from "@ant-design/icons";
|
|
47
|
+
/* eslint-disable @typescript-eslint/no-use-before-define */ import { DeleteOutlined } from "@ant-design/icons";
|
|
48
48
|
import { Input, Modal, Tooltip } from "antd";
|
|
49
49
|
import React, { useCallback, useContext, useRef } from "react";
|
|
50
50
|
import { Text, Transforms } from "slate";
|