@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,
|
|
@@ -210,95 +214,97 @@ import { getPointStrOffset, getSelectionFromDomSelection } from "../../utils/edi
|
|
|
210
214
|
role: "button",
|
|
211
215
|
key: "highlight",
|
|
212
216
|
className: classnames("".concat(baseClassName, "-item"), hashId),
|
|
213
|
-
onClick:
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
if (domSelection) {
|
|
226
|
-
selection = getSelectionFromDomSelection(markdownEditorRef.current, domSelection);
|
|
227
|
-
}
|
|
217
|
+
onClick: function() {
|
|
218
|
+
return _async_to_generator(function() {
|
|
219
|
+
var _editorProps_comment_onSubmit, _editorProps_comment, domSelection, editor, selection, texts, title, fragments, i, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, str, focus, anchor, _ref, start, end, anchorOffset, focusOffset, comment;
|
|
220
|
+
return _ts_generator(this, function(_state) {
|
|
221
|
+
switch(_state.label){
|
|
222
|
+
case 0:
|
|
223
|
+
if (typeof window === 'undefined') return [
|
|
224
|
+
2
|
|
225
|
+
];
|
|
226
|
+
domSelection = window.getSelection();
|
|
227
|
+
editor = markdownEditorRef.current;
|
|
228
|
+
selection = editor.selection;
|
|
228
229
|
if (!selection) {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
230
|
+
if (domSelection) {
|
|
231
|
+
selection = getSelectionFromDomSelection(markdownEditorRef.current, domSelection);
|
|
232
|
+
}
|
|
233
|
+
if (!selection) {
|
|
234
|
+
return [
|
|
235
|
+
2
|
|
236
|
+
];
|
|
237
|
+
}
|
|
232
238
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
texts.push(Node.string(fragments[i]));
|
|
239
|
-
}
|
|
240
|
-
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
241
|
-
try {
|
|
242
|
-
for(_iterator = texts[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
243
|
-
str = _step.value;
|
|
244
|
-
title += str;
|
|
239
|
+
texts = [];
|
|
240
|
+
title = '';
|
|
241
|
+
fragments = Node.fragment(editor, selection);
|
|
242
|
+
for(i = 0; i < fragments.length; i++){
|
|
243
|
+
texts.push(Node.string(fragments[i]));
|
|
245
244
|
}
|
|
246
|
-
|
|
247
|
-
_didIteratorError = true;
|
|
248
|
-
_iteratorError = err;
|
|
249
|
-
} finally{
|
|
245
|
+
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
250
246
|
try {
|
|
251
|
-
|
|
252
|
-
|
|
247
|
+
for(_iterator = texts[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
248
|
+
str = _step.value;
|
|
249
|
+
title += str;
|
|
253
250
|
}
|
|
251
|
+
} catch (err) {
|
|
252
|
+
_didIteratorError = true;
|
|
253
|
+
_iteratorError = err;
|
|
254
254
|
} finally{
|
|
255
|
-
|
|
256
|
-
|
|
255
|
+
try {
|
|
256
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
257
|
+
_iterator.return();
|
|
258
|
+
}
|
|
259
|
+
} finally{
|
|
260
|
+
if (_didIteratorError) {
|
|
261
|
+
throw _iteratorError;
|
|
262
|
+
}
|
|
257
263
|
}
|
|
258
264
|
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
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
|
-
}
|
|
265
|
+
focus = selection.focus, anchor = selection.anchor;
|
|
266
|
+
_ref = _sliced_to_array(Point.isAfter(focus, anchor) ? [
|
|
267
|
+
anchor,
|
|
268
|
+
focus
|
|
269
|
+
] : [
|
|
270
|
+
focus,
|
|
271
|
+
anchor
|
|
272
|
+
], 2), start = _ref[0], end = _ref[1];
|
|
273
|
+
anchorOffset = getPointStrOffset(editor, start);
|
|
274
|
+
focusOffset = getPointStrOffset(editor, end);
|
|
275
|
+
comment = {
|
|
276
|
+
selection: {
|
|
277
|
+
anchor: start,
|
|
278
|
+
focus: end
|
|
279
|
+
},
|
|
280
|
+
path: start.path,
|
|
281
|
+
time: Date.now(),
|
|
282
|
+
id: Date.now(),
|
|
283
|
+
content: '',
|
|
284
|
+
anchorOffset: anchorOffset,
|
|
285
|
+
focusOffset: focusOffset,
|
|
286
|
+
refContent: title,
|
|
287
|
+
commentType: 'highlight'
|
|
288
|
+
};
|
|
289
|
+
return [
|
|
290
|
+
4,
|
|
291
|
+
editorProps === null || editorProps === void 0 ? void 0 : (_editorProps_comment = editorProps.comment) === null || _editorProps_comment === void 0 ? void 0 : (_editorProps_comment_onSubmit = _editorProps_comment.onSubmit) === null || _editorProps_comment_onSubmit === void 0 ? void 0 : _editorProps_comment_onSubmit.call(_editorProps_comment, comment.id + '', comment)
|
|
292
|
+
];
|
|
293
|
+
case 1:
|
|
294
|
+
_state.sent();
|
|
295
|
+
// 更新时间戳,触发一下dom的rerender,不然不给我更新
|
|
296
|
+
Transforms.setNodes(editor, {
|
|
297
|
+
updateTimestamp: Date.now()
|
|
298
|
+
}, {
|
|
299
|
+
at: comment.path
|
|
300
|
+
});
|
|
301
|
+
return [
|
|
302
|
+
2
|
|
303
|
+
];
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
})();
|
|
307
|
+
}
|
|
302
308
|
}, /*#__PURE__*/ React.createElement(HighlightFilled, null)));
|
|
303
309
|
list.push(/*#__PURE__*/ React.createElement("div", {
|
|
304
310
|
role: "button",
|
|
@@ -382,53 +388,55 @@ import { getPointStrOffset, getSelectionFromDomSelection } from "../../utils/edi
|
|
|
382
388
|
}
|
|
383
389
|
}),
|
|
384
390
|
icon: null,
|
|
385
|
-
onOk:
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
+
onOk: function() {
|
|
392
|
+
return _async_to_generator(function() {
|
|
393
|
+
var _editorProps_comment_onSubmit, _editorProps_comment, error;
|
|
394
|
+
return _ts_generator(this, function(_state) {
|
|
395
|
+
switch(_state.label){
|
|
396
|
+
case 0:
|
|
397
|
+
if (comment.content.trim() === '') {
|
|
398
|
+
return [
|
|
399
|
+
2
|
|
400
|
+
];
|
|
401
|
+
}
|
|
402
|
+
_state.label = 1;
|
|
403
|
+
case 1:
|
|
404
|
+
_state.trys.push([
|
|
405
|
+
1,
|
|
406
|
+
3,
|
|
407
|
+
,
|
|
408
|
+
4
|
|
409
|
+
]);
|
|
410
|
+
return [
|
|
411
|
+
4,
|
|
412
|
+
editorProps === null || editorProps === void 0 ? void 0 : (_editorProps_comment = editorProps.comment) === null || _editorProps_comment === void 0 ? void 0 : (_editorProps_comment_onSubmit = _editorProps_comment.onSubmit) === null || _editorProps_comment_onSubmit === void 0 ? void 0 : _editorProps_comment_onSubmit.call(_editorProps_comment, comment.id + '', comment)
|
|
413
|
+
];
|
|
414
|
+
case 2:
|
|
415
|
+
_state.sent();
|
|
416
|
+
// 更新时间戳,触发一下dom的rerender,不然不给我更新
|
|
417
|
+
Transforms.setNodes(editor, {
|
|
418
|
+
updateTimestamp: Date.now()
|
|
419
|
+
}, {
|
|
420
|
+
at: comment.path
|
|
421
|
+
});
|
|
422
|
+
return [
|
|
423
|
+
3,
|
|
424
|
+
4
|
|
425
|
+
];
|
|
426
|
+
case 3:
|
|
427
|
+
error = _state.sent();
|
|
428
|
+
return [
|
|
429
|
+
3,
|
|
430
|
+
4
|
|
431
|
+
];
|
|
432
|
+
case 4:
|
|
391
433
|
return [
|
|
392
434
|
2
|
|
393
435
|
];
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
1,
|
|
399
|
-
3,
|
|
400
|
-
,
|
|
401
|
-
4
|
|
402
|
-
]);
|
|
403
|
-
return [
|
|
404
|
-
4,
|
|
405
|
-
editorProps === null || editorProps === void 0 ? void 0 : (_editorProps_comment = editorProps.comment) === null || _editorProps_comment === void 0 ? void 0 : (_editorProps_comment_onSubmit = _editorProps_comment.onSubmit) === null || _editorProps_comment_onSubmit === void 0 ? void 0 : _editorProps_comment_onSubmit.call(_editorProps_comment, comment.id + '', comment)
|
|
406
|
-
];
|
|
407
|
-
case 2:
|
|
408
|
-
_state.sent();
|
|
409
|
-
// 更新时间戳,触发一下dom的rerender,不然不给我更新
|
|
410
|
-
Transforms.setNodes(editor, {
|
|
411
|
-
updateTimestamp: Date.now()
|
|
412
|
-
}, {
|
|
413
|
-
at: comment.path
|
|
414
|
-
});
|
|
415
|
-
return [
|
|
416
|
-
3,
|
|
417
|
-
4
|
|
418
|
-
];
|
|
419
|
-
case 3:
|
|
420
|
-
error = _state.sent();
|
|
421
|
-
return [
|
|
422
|
-
3,
|
|
423
|
-
4
|
|
424
|
-
];
|
|
425
|
-
case 4:
|
|
426
|
-
return [
|
|
427
|
-
2
|
|
428
|
-
];
|
|
429
|
-
}
|
|
430
|
-
});
|
|
431
|
-
})
|
|
436
|
+
}
|
|
437
|
+
});
|
|
438
|
+
})();
|
|
439
|
+
}
|
|
432
440
|
});
|
|
433
441
|
}
|
|
434
442
|
}, /*#__PURE__*/ React.createElement(CommentOutlined, null)));
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* @fileoverview Ace Editor 工具函数
|
|
3
|
-
*
|
|
4
|
-
* 提供语言模式映射和异步加载 Ace Editor 相关资源的功能
|
|
5
|
-
* 所有 ace-builds 相关的导入都改为异步,避免同步加载导致的错误
|
|
6
|
-
*/ /**
|
|
7
|
-
* 语言模式映射表
|
|
8
|
-
* 将常见的语言别名映射到 Ace Editor 支持的标准模式名称
|
|
9
|
-
*/ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
1
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
10
2
|
try {
|
|
11
3
|
var info = gen[key](arg);
|
|
12
4
|
var value = info.value;
|
|
@@ -36,7 +28,7 @@ function _async_to_generator(fn) {
|
|
|
36
28
|
};
|
|
37
29
|
}
|
|
38
30
|
function _ts_generator(thisArg, body) {
|
|
39
|
-
var f, y, t,
|
|
31
|
+
var f, y, t, _ = {
|
|
40
32
|
label: 0,
|
|
41
33
|
sent: function() {
|
|
42
34
|
if (t[0] & 1) throw t[1];
|
|
@@ -44,13 +36,17 @@ function _ts_generator(thisArg, body) {
|
|
|
44
36
|
},
|
|
45
37
|
trys: [],
|
|
46
38
|
ops: []
|
|
47
|
-
};
|
|
48
|
-
return g
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
},
|
|
53
|
-
|
|
39
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
40
|
+
return d(g, "next", {
|
|
41
|
+
value: verb(0)
|
|
42
|
+
}), d(g, "throw", {
|
|
43
|
+
value: verb(1)
|
|
44
|
+
}), d(g, "return", {
|
|
45
|
+
value: verb(2)
|
|
46
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
47
|
+
value: function() {
|
|
48
|
+
return this;
|
|
49
|
+
}
|
|
54
50
|
}), g;
|
|
55
51
|
function verb(n) {
|
|
56
52
|
return function(v) {
|
|
@@ -62,7 +58,7 @@ function _ts_generator(thisArg, body) {
|
|
|
62
58
|
}
|
|
63
59
|
function step(op) {
|
|
64
60
|
if (f) throw new TypeError("Generator is already executing.");
|
|
65
|
-
while(_)try {
|
|
61
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
66
62
|
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;
|
|
67
63
|
if (y = 0, t) op = [
|
|
68
64
|
op[0] & 2,
|
|
@@ -130,7 +126,15 @@ function _ts_generator(thisArg, body) {
|
|
|
130
126
|
};
|
|
131
127
|
}
|
|
132
128
|
}
|
|
133
|
-
|
|
129
|
+
/**
|
|
130
|
+
* @fileoverview Ace Editor 工具函数
|
|
131
|
+
*
|
|
132
|
+
* 提供语言模式映射和异步加载 Ace Editor 相关资源的功能
|
|
133
|
+
* 所有 ace-builds 相关的导入都改为异步,避免同步加载导致的错误
|
|
134
|
+
*/ /**
|
|
135
|
+
* 语言模式映射表
|
|
136
|
+
* 将常见的语言别名映射到 Ace Editor 支持的标准模式名称
|
|
137
|
+
*/ export var modeMap = new Map([
|
|
134
138
|
[
|
|
135
139
|
'ts',
|
|
136
140
|
'typescript'
|
|
@@ -271,8 +275,8 @@ var aceLangsLoader = null;
|
|
|
271
275
|
/**
|
|
272
276
|
* 异步加载所有 Ace Editor 语言模式
|
|
273
277
|
* 这些导入主要用于注册模式,不需要直接使用返回值
|
|
274
|
-
*/ var loadAceModes =
|
|
275
|
-
|
|
278
|
+
*/ var loadAceModes = function() {
|
|
279
|
+
return _async_to_generator(function() {
|
|
276
280
|
return _ts_generator(this, function(_state) {
|
|
277
281
|
switch(_state.label){
|
|
278
282
|
case 0:
|
|
@@ -390,18 +394,15 @@ var aceLangsLoader = null;
|
|
|
390
394
|
];
|
|
391
395
|
}
|
|
392
396
|
});
|
|
393
|
-
});
|
|
394
|
-
|
|
395
|
-
return _ref.apply(this, arguments);
|
|
396
|
-
};
|
|
397
|
-
}();
|
|
397
|
+
})();
|
|
398
|
+
};
|
|
398
399
|
/**
|
|
399
400
|
* 异步获取 Ace Editor 支持的语言列表
|
|
400
401
|
* 使用单例模式确保只加载一次
|
|
401
402
|
*
|
|
402
403
|
* @returns {Promise<Set<string>>} Ace Editor 支持的语言名称集合
|
|
403
|
-
*/ export var getAceLangs =
|
|
404
|
-
|
|
404
|
+
*/ export var getAceLangs = function() {
|
|
405
|
+
return _async_to_generator(function() {
|
|
405
406
|
return _ts_generator(this, function(_state) {
|
|
406
407
|
if (aceLangsCache) {
|
|
407
408
|
return [
|
|
@@ -410,45 +411,44 @@ var aceLangsLoader = null;
|
|
|
410
411
|
];
|
|
411
412
|
}
|
|
412
413
|
if (!aceLangsLoader) {
|
|
413
|
-
aceLangsLoader =
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
414
|
+
aceLangsLoader = function() {
|
|
415
|
+
return _async_to_generator(function() {
|
|
416
|
+
var ext;
|
|
417
|
+
return _ts_generator(this, function(_state) {
|
|
418
|
+
switch(_state.label){
|
|
419
|
+
case 0:
|
|
420
|
+
// 先加载所有模式
|
|
421
|
+
return [
|
|
422
|
+
4,
|
|
423
|
+
loadAceModes()
|
|
424
|
+
];
|
|
425
|
+
case 1:
|
|
426
|
+
_state.sent();
|
|
427
|
+
return [
|
|
428
|
+
4,
|
|
429
|
+
import("ace-builds/src-noconflict/ext-modelist")
|
|
430
|
+
];
|
|
431
|
+
case 2:
|
|
432
|
+
ext = _state.sent();
|
|
433
|
+
aceLangsCache = new Set(ext.default.modes.map(function(m) {
|
|
434
|
+
return m.name;
|
|
435
|
+
}));
|
|
436
|
+
return [
|
|
437
|
+
2,
|
|
438
|
+
aceLangsCache
|
|
439
|
+
];
|
|
440
|
+
}
|
|
441
|
+
});
|
|
442
|
+
})();
|
|
443
|
+
}();
|
|
441
444
|
}
|
|
442
445
|
return [
|
|
443
446
|
2,
|
|
444
447
|
aceLangsLoader
|
|
445
448
|
];
|
|
446
449
|
});
|
|
447
|
-
});
|
|
448
|
-
|
|
449
|
-
return _ref.apply(this, arguments);
|
|
450
|
-
};
|
|
451
|
-
}();
|
|
450
|
+
})();
|
|
451
|
+
};
|
|
452
452
|
/**
|
|
453
453
|
* 预加载 Ace Editor 语言模式
|
|
454
454
|
* 可以在应用启动时调用,提前开始加载
|
|
@@ -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;
|
|
@@ -41,6 +41,13 @@ function _define_property(obj, key, value) {
|
|
|
41
41
|
}
|
|
42
42
|
return obj;
|
|
43
43
|
}
|
|
44
|
+
function _instanceof(left, right) {
|
|
45
|
+
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
46
|
+
return !!right[Symbol.hasInstance](left);
|
|
47
|
+
} else {
|
|
48
|
+
return left instanceof right;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
44
51
|
function _iterable_to_array(iter) {
|
|
45
52
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
46
53
|
}
|
|
@@ -127,7 +134,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
127
134
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
128
135
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
129
136
|
}
|
|
130
|
-
import { Editor, Element, Node, Path, Point, Range, Text, Transforms } from "slate";
|
|
137
|
+
/* eslint-disable no-param-reassign */ import { Editor, Element, Node, Path, Point, Range, Text, Transforms } from "slate";
|
|
131
138
|
import { ReactEditor } from "slate-react";
|
|
132
139
|
import { getMediaType } from "./dom";
|
|
133
140
|
export var EditorUtils = /*#__PURE__*/ function() {
|
|
@@ -833,7 +840,7 @@ export var EditorUtils = /*#__PURE__*/ function() {
|
|
|
833
840
|
*/ function parseUrlParams(url) {
|
|
834
841
|
try {
|
|
835
842
|
return new URL(url).searchParams;
|
|
836
|
-
} catch (
|
|
843
|
+
} catch (unused) {
|
|
837
844
|
return new URLSearchParams();
|
|
838
845
|
}
|
|
839
846
|
}
|
|
@@ -1019,7 +1026,7 @@ export var getDefaultView = function(value) {
|
|
|
1019
1026
|
};
|
|
1020
1027
|
export var isDOMNode = function(value) {
|
|
1021
1028
|
var window1 = getDefaultView(value);
|
|
1022
|
-
return !!window1 && value
|
|
1029
|
+
return !!window1 && _instanceof(value, window1.Node);
|
|
1023
1030
|
};
|
|
1024
1031
|
export var isEventHandled = function(event, handler) {
|
|
1025
1032
|
if (!handler) {
|
|
@@ -22,6 +22,13 @@ function _define_property(obj, key, value) {
|
|
|
22
22
|
}
|
|
23
23
|
return obj;
|
|
24
24
|
}
|
|
25
|
+
function _instanceof(left, right) {
|
|
26
|
+
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
27
|
+
return !!right[Symbol.hasInstance](left);
|
|
28
|
+
} else {
|
|
29
|
+
return left instanceof right;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
25
32
|
function _iterable_to_array(iter) {
|
|
26
33
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
27
34
|
}
|
|
@@ -89,7 +96,6 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
89
96
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
90
97
|
}
|
|
91
98
|
import { customAlphabet } from "nanoid";
|
|
92
|
-
import React from "react";
|
|
93
99
|
import { Subject } from "rxjs";
|
|
94
100
|
export var nid = customAlphabet('1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', 13);
|
|
95
101
|
var kb = 1024;
|
|
@@ -131,7 +137,7 @@ export function toArrayBuffer(buffer) {
|
|
|
131
137
|
return arrayBuffer;
|
|
132
138
|
}
|
|
133
139
|
export var download = function(data, fileName) {
|
|
134
|
-
data = data
|
|
140
|
+
data = _instanceof(data, Uint8Array) ? new Blob([
|
|
135
141
|
data
|
|
136
142
|
]) : data;
|
|
137
143
|
var link = document.createElement('a');
|