@ant-design/agentic-ui 2.29.6 → 2.29.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AILabel/index.js +17 -8
- package/dist/AgenticLayout/index.js +3 -5
- package/dist/BackTo/BackBottom.js +17 -8
- package/dist/BackTo/BackTop.js +17 -8
- package/dist/BackTo/ScrollVisibleButton.js +75 -11
- package/dist/Bubble/AIBubble.js +131 -121
- package/dist/Bubble/Avatar/index.js +19 -10
- package/dist/Bubble/FileView.js +2 -2
- package/dist/Bubble/List/PureBubbleList.js +4 -5
- package/dist/Bubble/List/index.js +4 -5
- package/dist/Bubble/List/style.js +3 -0
- package/dist/Bubble/MessagesContent/BubbleExtra.js +108 -93
- package/dist/Bubble/MessagesContent/CopyButton/index.js +36 -26
- package/dist/Bubble/MessagesContent/DocInfo.js +19 -10
- package/dist/Bubble/MessagesContent/MarkdownPreview.js +2 -2
- package/dist/Bubble/MessagesContent/index.js +149 -130
- package/dist/Bubble/PureBubble.js +151 -133
- package/dist/Bubble/UserBubble.js +1 -1
- package/dist/Bubble/style.js +2 -2
- package/dist/Bubble/types/BubbleExtra.js +4 -1
- package/dist/Bubble/types/DocInfo.js +9 -1
- package/dist/ChatLayout/components/FooterBackgroundLottie/images/img_0.png +0 -0
- package/dist/ChatLayout/components/FooterBackgroundLottie/images/img_1.png +0 -0
- package/dist/ChatLayout/components/FooterBackgroundLottie/images/img_2.png +0 -0
- package/dist/ChatLayout/components/FooterBackgroundLottie/index.d.ts +51 -0
- package/dist/ChatLayout/components/FooterBackgroundLottie/index.js +45 -0
- package/dist/ChatLayout/components/FooterBackgroundLottie/lottie.d.ts +85 -0
- package/dist/ChatLayout/components/FooterBackgroundLottie/lottie.js +382 -0
- package/dist/ChatLayout/index.js +52 -14
- package/dist/ChatLayout/style.js +11 -0
- package/dist/ChatLayout/types.d.ts +28 -0
- package/dist/Components/ActionIconBox/index.js +30 -38
- package/dist/Components/ActionItemBox/ActionItemBox.js +1 -1
- package/dist/Components/Button/SwitchButton/index.js +18 -17
- package/dist/Components/LayoutHeader/index.js +5 -3
- package/dist/Components/LayoutHeader/style.js +5 -0
- package/dist/Components/Loading/CreativeRecommendationLoading.js +2 -2
- package/dist/Components/Loading/CreativeSparkLoading.js +2 -2
- package/dist/Components/SuggestionList/index.js +20 -19
- package/dist/Components/TextAnimate/index.js +19 -10
- package/dist/Components/TypingAnimation/index.js +19 -10
- package/dist/Components/effects/EffectPlayer.js +20 -11
- package/dist/Components/icons/LoadingSpinnerIcon.js +19 -10
- package/dist/History/components/HistoryActionsBox.js +21 -23
- package/dist/History/components/HistoryItem.js +61 -53
- package/dist/History/components/HistoryRunningIcon.js +19 -10
- package/dist/History/components/LoadMoreComponent.js +61 -55
- package/dist/History/components/NewChatComponent.js +53 -47
- package/dist/History/components/SearchComponent.js +24 -26
- package/dist/History/hooks/useHistory.js +80 -73
- package/dist/History/index.js +17 -16
- package/dist/History/menu.js +17 -8
- package/dist/Hooks/useAutoScroll.js +19 -19
- package/dist/Hooks/useDebounceFn/index.js +51 -45
- package/dist/Hooks/useElementSize.d.ts +5 -0
- package/dist/Hooks/useElementSize.js +71 -0
- package/dist/Hooks/useIntersectionOnce.js +17 -8
- package/dist/Hooks/useLanguage.d.ts +3 -0
- package/dist/I18n/locales.d.ts +3 -0
- package/dist/I18n/locales.js +8 -0
- package/dist/MarkdownEditor/BaseMarkdownEditor.js +23 -13
- package/dist/MarkdownEditor/editor/Editor.js +31 -39
- package/dist/MarkdownEditor/editor/components/CommentList/index.js +29 -37
- package/dist/MarkdownEditor/editor/elements/Blockquote/ReadonlyBlockquote.d.ts +33 -0
- package/dist/MarkdownEditor/editor/elements/Blockquote/ReadonlyBlockquote.js +69 -0
- package/dist/MarkdownEditor/editor/elements/Break/ReadonlyBreak.d.ts +30 -0
- package/dist/MarkdownEditor/editor/elements/Break/ReadonlyBreak.js +88 -0
- package/dist/MarkdownEditor/editor/elements/Card/ReadonlyCard.d.ts +34 -0
- package/dist/MarkdownEditor/editor/elements/Card/ReadonlyCard.js +96 -0
- package/dist/MarkdownEditor/editor/elements/Code/ReadonlyCode.d.ts +33 -0
- package/dist/MarkdownEditor/editor/elements/Code/ReadonlyCode.js +145 -0
- package/dist/MarkdownEditor/editor/elements/FootnoteDefinition/ReadonlyFootnoteDefinition.d.ts +34 -0
- package/dist/MarkdownEditor/editor/elements/FootnoteDefinition/ReadonlyFootnoteDefinition.js +125 -0
- package/dist/MarkdownEditor/editor/elements/FootnoteReference/ReadonlyFootnoteReference.d.ts +34 -0
- package/dist/MarkdownEditor/editor/elements/FootnoteReference/ReadonlyFootnoteReference.js +101 -0
- package/dist/MarkdownEditor/editor/elements/Head/ReadonlyHead.d.ts +35 -0
- package/dist/MarkdownEditor/editor/elements/Head/ReadonlyHead.js +111 -0
- package/dist/MarkdownEditor/editor/elements/Head/index.d.ts +3 -0
- package/dist/MarkdownEditor/editor/elements/Head/index.js +3 -1
- package/dist/MarkdownEditor/editor/elements/Hr/ReadonlyHr.d.ts +30 -0
- package/dist/MarkdownEditor/editor/elements/Hr/ReadonlyHr.js +95 -0
- package/dist/MarkdownEditor/editor/elements/Image/ReadonlyEditorImage.d.ts +35 -0
- package/dist/MarkdownEditor/editor/elements/Image/ReadonlyEditorImage.js +426 -0
- package/dist/MarkdownEditor/editor/elements/Image/index.js +124 -121
- package/dist/MarkdownEditor/editor/elements/InlineKatex/ReadonlyInlineKatex.d.ts +32 -0
- package/dist/MarkdownEditor/editor/elements/InlineKatex/ReadonlyInlineKatex.js +100 -0
- package/dist/MarkdownEditor/editor/elements/Katex/ReadonlyKatex.d.ts +32 -0
- package/dist/MarkdownEditor/editor/elements/Katex/ReadonlyKatex.js +110 -0
- package/dist/MarkdownEditor/editor/elements/LinkCard/ReadonlyLinkCard.d.ts +40 -0
- package/dist/MarkdownEditor/editor/elements/LinkCard/ReadonlyLinkCard.js +215 -0
- package/dist/MarkdownEditor/editor/elements/List/List.js +27 -12
- package/dist/MarkdownEditor/editor/elements/List/ListItem.js +17 -16
- package/dist/MarkdownEditor/editor/elements/List/ReadonlyList.d.ts +33 -0
- package/dist/MarkdownEditor/editor/elements/List/ReadonlyList.js +93 -0
- package/dist/MarkdownEditor/editor/elements/List/ReadonlyListItem.d.ts +35 -0
- package/dist/MarkdownEditor/editor/elements/List/ReadonlyListItem.js +138 -0
- package/dist/MarkdownEditor/editor/elements/Media/ReadonlyMedia.d.ts +36 -0
- package/dist/MarkdownEditor/editor/elements/Media/ReadonlyMedia.js +600 -0
- package/dist/MarkdownEditor/editor/elements/Media/index.js +107 -92
- package/dist/MarkdownEditor/editor/elements/Mermaid/ReadonlyMermaid.d.ts +32 -0
- package/dist/MarkdownEditor/editor/elements/Mermaid/ReadonlyMermaid.js +101 -0
- package/dist/MarkdownEditor/editor/elements/Paragraph/ReadonlyParagraph.d.ts +35 -0
- package/dist/MarkdownEditor/editor/elements/Paragraph/ReadonlyParagraph.js +109 -0
- package/dist/MarkdownEditor/editor/elements/Paragraph/index.js +2 -1
- package/dist/MarkdownEditor/editor/elements/Schema/ReadonlySchema.d.ts +33 -0
- package/dist/MarkdownEditor/editor/elements/Schema/ReadonlySchema.js +163 -0
- package/dist/MarkdownEditor/editor/elements/Table/Table.js +19 -10
- package/dist/MarkdownEditor/editor/elements/TagPopup/index.js +17 -16
- package/dist/MarkdownEditor/editor/elements/index.d.ts +20 -1
- package/dist/MarkdownEditor/editor/elements/index.js +65 -29
- package/dist/MarkdownEditor/editor/parser/parse/parseBlockElements.js +19 -11
- package/dist/MarkdownEditor/editor/parser/parse/parseCode.js +1 -1
- package/dist/MarkdownEditor/editor/parser/parse/parseEmptyLines.js +1 -1
- package/dist/MarkdownEditor/editor/parser/parse/parseTable.js +4 -1
- package/dist/MarkdownEditor/editor/parser/parserSlateNodeToMarkdown.js +66 -23
- package/dist/MarkdownEditor/editor/parser/remarkParse.js +3 -1
- package/dist/MarkdownEditor/editor/plugins/elements.js +60 -6
- package/dist/MarkdownEditor/editor/plugins/handlePaste.js +25 -30
- package/dist/MarkdownEditor/editor/plugins/hotKeyCommands/arrow.js +0 -1
- package/dist/MarkdownEditor/editor/plugins/hotKeyCommands/backspace.js +97 -39
- package/dist/MarkdownEditor/editor/plugins/hotKeyCommands/enter.js +0 -1
- package/dist/MarkdownEditor/editor/plugins/hotKeyCommands/match.js +0 -1
- package/dist/MarkdownEditor/editor/plugins/hotKeyCommands/tab.d.ts +14 -0
- package/dist/MarkdownEditor/editor/plugins/hotKeyCommands/tab.js +117 -91
- package/dist/MarkdownEditor/editor/plugins/index.d.ts +8 -0
- package/dist/MarkdownEditor/editor/plugins/index.js +8 -0
- package/dist/MarkdownEditor/editor/plugins/insertParsedHtmlNodes.d.ts +12 -6
- package/dist/MarkdownEditor/editor/plugins/insertParsedHtmlNodes.js +106 -95
- package/dist/MarkdownEditor/editor/plugins/useKeyboard.js +1 -1
- package/dist/MarkdownEditor/editor/plugins/useOnchange.js +28 -22
- package/dist/MarkdownEditor/editor/plugins/utils.d.ts +31 -0
- package/dist/MarkdownEditor/editor/plugins/utils.js +75 -0
- package/dist/MarkdownEditor/editor/plugins/withCardPlugin.d.ts +15 -0
- package/dist/MarkdownEditor/editor/plugins/withCardPlugin.js +329 -0
- package/dist/MarkdownEditor/editor/plugins/withCodeTagPlugin.d.ts +11 -0
- package/dist/MarkdownEditor/editor/plugins/withCodeTagPlugin.js +299 -0
- package/dist/MarkdownEditor/editor/plugins/withInlineNodes.d.ts +12 -0
- package/dist/MarkdownEditor/editor/plugins/withInlineNodes.js +17 -0
- package/dist/MarkdownEditor/editor/plugins/withLinkAndMediaPlugin.d.ts +11 -0
- package/dist/MarkdownEditor/editor/plugins/withLinkAndMediaPlugin.js +70 -0
- package/dist/MarkdownEditor/editor/plugins/withListsPlugin.d.ts +23 -0
- package/dist/MarkdownEditor/editor/plugins/withListsPlugin.js +204 -0
- package/dist/MarkdownEditor/editor/plugins/withMarkdown.d.ts +9 -12
- package/dist/MarkdownEditor/editor/plugins/withMarkdown.js +17 -764
- package/dist/MarkdownEditor/editor/plugins/withSchemaPlugin.d.ts +11 -0
- package/dist/MarkdownEditor/editor/plugins/withSchemaPlugin.js +55 -0
- package/dist/MarkdownEditor/editor/plugins/withVoidNodes.d.ts +12 -0
- package/dist/MarkdownEditor/editor/plugins/withVoidNodes.js +17 -0
- package/dist/MarkdownEditor/editor/store.js +18 -14
- package/dist/MarkdownEditor/editor/tools/InsertAutocomplete.js +202 -197
- package/dist/MarkdownEditor/editor/tools/InsertLink.js +2 -2
- package/dist/MarkdownEditor/editor/tools/ToolBar/ReadonlyBaseBar.js +142 -134
- package/dist/MarkdownEditor/editor/utils/ace.js +61 -61
- package/dist/MarkdownEditor/editor/utils/docx/module.js +41 -8
- package/dist/MarkdownEditor/editor/utils/editorCommands.d.ts +97 -0
- package/dist/MarkdownEditor/editor/utils/editorCommands.js +966 -0
- package/dist/MarkdownEditor/editor/utils/editorUtils.js +13 -6
- package/dist/MarkdownEditor/editor/utils/index.js +8 -2
- package/dist/MarkdownEditor/editor/utils/keyboard.js +46 -426
- package/dist/MarkdownEditor/editor/utils/markdownToHtml.js +23 -17
- package/dist/MarkdownEditor/editor/utils/media.js +21 -23
- package/dist/MarkdownEditor/editor/utils/performanceMonitor.js +55 -50
- package/dist/MarkdownEditor/editor/utils/useLocalState.js +11 -4
- package/dist/MarkdownEditor/el.d.ts +12 -5
- package/dist/MarkdownEditor/types.d.ts +1 -0
- package/dist/MarkdownEditor/types.js +4 -1
- package/dist/MarkdownEditor/utils/native-table/native-table-editor.js +14 -14
- package/dist/MarkdownEditor/utils/native-table/native-table-keyboard.js +2 -2
- package/dist/MarkdownInputField/AttachmentButton/AttachmentFileList/style.js +1 -0
- package/dist/MarkdownInputField/AttachmentButton/index.js +33 -31
- package/dist/MarkdownInputField/BeforeToolContainer/BeforeToolContainer.js +14 -7
- package/dist/MarkdownInputField/FileMapView/FileMapViewItem.js +2 -2
- package/dist/MarkdownInputField/FileMapView/index.js +17 -16
- package/dist/MarkdownInputField/FilePaste/index.js +25 -30
- package/dist/MarkdownInputField/FileUploadManager/index.js +39 -40
- package/dist/MarkdownInputField/MarkdownInputField.js +47 -51
- package/dist/MarkdownInputField/QuickActions/index.js +66 -60
- package/dist/MarkdownInputField/SendButton/index.js +22 -13
- package/dist/MarkdownInputField/Suggestion/index.js +17 -16
- package/dist/MarkdownInputField/VoiceInput/index.js +51 -45
- package/dist/MarkdownInputField/VoiceInputManager/index.js +133 -125
- package/dist/MarkdownInputField/hooks/useMarkdownInputFieldHandlers.js +103 -101
- package/dist/MarkdownInputField/hooks/useMarkdownInputFieldStyles.js +1 -1
- package/dist/MarkdownInputField/style.js +8 -4
- package/dist/MarkdownInputField/types/MarkdownInputFieldProps.js +14 -1
- package/dist/Plugins/chart/BarChart/index.js +8 -8
- package/dist/Plugins/chart/ChartRender.js +52 -46
- package/dist/Plugins/chart/DonutChart/index.js +26 -17
- package/dist/Plugins/chart/DonutChart/plugins.js +1 -1
- package/dist/Plugins/chart/DonutChart/types.js +1 -1
- package/dist/Plugins/chart/FunnelChart/index.js +31 -28
- package/dist/Plugins/chart/LineChart/index.js +19 -10
- package/dist/Plugins/chart/RadarChart/index.js +19 -10
- package/dist/Plugins/chart/ScatterChart/index.js +19 -10
- package/dist/Plugins/chart/components/ChartContainer/ChartContainer.js +20 -11
- package/dist/Plugins/chart/index.js +31 -13
- package/dist/Plugins/chart/loadChartRuntime.js +17 -16
- package/dist/Plugins/chart/types/classNames.js +4 -1
- package/dist/Plugins/chart/utils.js +20 -20
- package/dist/Plugins/code/CodeUI/Katex/Katex.js +52 -46
- package/dist/Plugins/code/components/AceEditor.js +149 -133
- package/dist/Plugins/code/components/CodeRenderer.js +7 -7
- package/dist/Plugins/code/components/CodeToolbar.js +2 -2
- package/dist/Plugins/code/components/LanguageSelector.js +6 -6
- package/dist/Plugins/code/components/LoadImage.js +5 -5
- package/dist/Plugins/code/components/ThinkBlock.js +8 -8
- package/dist/Plugins/code/hooks/useCodeEditorState.js +5 -5
- package/dist/Plugins/code/index.js +6 -6
- package/dist/Plugins/code/langIconMap.js +0 -1
- package/dist/Plugins/code/langIcons/AbapIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ActionscriptIcon.js +19 -10
- package/dist/Plugins/code/langIcons/AdaIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ApacheIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ApexIcon.js +19 -10
- package/dist/Plugins/code/langIcons/AplIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ApplescriptIcon.js +19 -10
- package/dist/Plugins/code/langIcons/AstroIcon.js +19 -10
- package/dist/Plugins/code/langIcons/AwkIcon.js +19 -10
- package/dist/Plugins/code/langIcons/BallerinaIcon.js +19 -10
- package/dist/Plugins/code/langIcons/BatIcon.js +19 -10
- package/dist/Plugins/code/langIcons/BicepIcon.js +19 -10
- package/dist/Plugins/code/langIcons/BladeIcon.js +19 -10
- package/dist/Plugins/code/langIcons/CIcon.js +19 -10
- package/dist/Plugins/code/langIcons/CadenceIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ClojureIcon.js +19 -10
- package/dist/Plugins/code/langIcons/CmakeIcon.js +19 -10
- package/dist/Plugins/code/langIcons/CobolIcon.js +19 -10
- package/dist/Plugins/code/langIcons/CodeqlIcon.js +19 -10
- package/dist/Plugins/code/langIcons/CoffeeIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ConsoleIcon.js +19 -10
- package/dist/Plugins/code/langIcons/CppIcon.js +19 -10
- package/dist/Plugins/code/langIcons/CrystalIcon.js +19 -10
- package/dist/Plugins/code/langIcons/CsharpIcon.js +19 -10
- package/dist/Plugins/code/langIcons/CssIcon.js +19 -10
- package/dist/Plugins/code/langIcons/DIcon.js +19 -10
- package/dist/Plugins/code/langIcons/DartIcon.js +19 -10
- package/dist/Plugins/code/langIcons/DatabaseIcon.js +19 -10
- package/dist/Plugins/code/langIcons/DiffIcon.js +19 -10
- package/dist/Plugins/code/langIcons/DockerIcon.js +19 -10
- package/dist/Plugins/code/langIcons/DotenvIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ElixirIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ElmIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ErbIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ErlangIcon.js +19 -10
- package/dist/Plugins/code/langIcons/FsharpIcon.js +19 -10
- package/dist/Plugins/code/langIcons/GdscriptIcon.js +19 -10
- package/dist/Plugins/code/langIcons/GlslIcon.js +19 -10
- package/dist/Plugins/code/langIcons/GnuplotIcon.js +19 -10
- package/dist/Plugins/code/langIcons/GoIcon.js +19 -10
- package/dist/Plugins/code/langIcons/GraphqlIcon.js +19 -10
- package/dist/Plugins/code/langIcons/GroovyIcon.js +19 -10
- package/dist/Plugins/code/langIcons/HackIcon.js +19 -10
- package/dist/Plugins/code/langIcons/HamlIcon.js +19 -10
- package/dist/Plugins/code/langIcons/HandlebarsIcon.js +19 -10
- package/dist/Plugins/code/langIcons/HaskellIcon.js +19 -10
- package/dist/Plugins/code/langIcons/HclIcon.js +19 -10
- package/dist/Plugins/code/langIcons/HclLightIcon.js +19 -10
- package/dist/Plugins/code/langIcons/HjsonIcon.js +19 -10
- package/dist/Plugins/code/langIcons/HlslIcon.js +19 -10
- package/dist/Plugins/code/langIcons/HtmlIcon.js +19 -10
- package/dist/Plugins/code/langIcons/HttpIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ImbaIcon.js +19 -10
- package/dist/Plugins/code/langIcons/IniIcon.js +19 -10
- package/dist/Plugins/code/langIcons/JavaIcon.js +19 -10
- package/dist/Plugins/code/langIcons/JavascriptIcon.js +19 -10
- package/dist/Plugins/code/langIcons/JinjaIcon.js +19 -10
- package/dist/Plugins/code/langIcons/Json5Icon.js +19 -10
- package/dist/Plugins/code/langIcons/JsonIcon.js +19 -10
- package/dist/Plugins/code/langIcons/JsonnetIcon.js +19 -10
- package/dist/Plugins/code/langIcons/JuliaIcon.js +19 -10
- package/dist/Plugins/code/langIcons/KotlinIcon.js +19 -10
- package/dist/Plugins/code/langIcons/KustoIcon.js +19 -10
- package/dist/Plugins/code/langIcons/LessIcon.js +19 -10
- package/dist/Plugins/code/langIcons/LiquidIcon.js +19 -10
- package/dist/Plugins/code/langIcons/LispIcon.js +19 -10
- package/dist/Plugins/code/langIcons/LuaIcon.js +19 -10
- package/dist/Plugins/code/langIcons/MakefileIcon.js +19 -10
- package/dist/Plugins/code/langIcons/MarkdownIcon.js +19 -10
- package/dist/Plugins/code/langIcons/MarkojsIcon.js +19 -10
- package/dist/Plugins/code/langIcons/MatlabIcon.js +19 -10
- package/dist/Plugins/code/langIcons/MdxIcon.js +19 -10
- package/dist/Plugins/code/langIcons/MermaidIcon.js +19 -10
- package/dist/Plugins/code/langIcons/MojoIcon.js +19 -10
- package/dist/Plugins/code/langIcons/NginxIcon.js +19 -10
- package/dist/Plugins/code/langIcons/NimIcon.js +19 -10
- package/dist/Plugins/code/langIcons/NixIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ObjectiveCIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ObjectiveCppIcon.js +19 -10
- package/dist/Plugins/code/langIcons/OcamlIcon.js +19 -10
- package/dist/Plugins/code/langIcons/PascalIcon.js +19 -10
- package/dist/Plugins/code/langIcons/Perl6Icon.js +19 -10
- package/dist/Plugins/code/langIcons/PerlIcon.js +19 -10
- package/dist/Plugins/code/langIcons/PhpIcon.js +19 -10
- package/dist/Plugins/code/langIcons/PostcssIcon.js +19 -10
- package/dist/Plugins/code/langIcons/PowershellIcon.js +19 -10
- package/dist/Plugins/code/langIcons/PrismaIcon.js +19 -10
- package/dist/Plugins/code/langIcons/PrologIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ProtoIcon.js +19 -10
- package/dist/Plugins/code/langIcons/PugIcon.js +19 -10
- package/dist/Plugins/code/langIcons/PuppetIcon.js +19 -10
- package/dist/Plugins/code/langIcons/PurescriptIcon.js +19 -10
- package/dist/Plugins/code/langIcons/PythonIcon.js +19 -10
- package/dist/Plugins/code/langIcons/RIcon.js +19 -10
- package/dist/Plugins/code/langIcons/RazorIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ReactIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ReactTsIcon.js +19 -10
- package/dist/Plugins/code/langIcons/RubyIcon.js +19 -10
- package/dist/Plugins/code/langIcons/RustIcon.js +19 -10
- package/dist/Plugins/code/langIcons/SasIcon.js +19 -10
- package/dist/Plugins/code/langIcons/SassIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ScalaIcon.js +19 -10
- package/dist/Plugins/code/langIcons/SchemeIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ShaderlabIcon.js +19 -10
- package/dist/Plugins/code/langIcons/SolidityIcon.js +19 -10
- package/dist/Plugins/code/langIcons/SparqlIcon.js +19 -10
- package/dist/Plugins/code/langIcons/StataIcon.js +19 -10
- package/dist/Plugins/code/langIcons/StylusIcon.js +19 -10
- package/dist/Plugins/code/langIcons/SvelteIcon.js +19 -10
- package/dist/Plugins/code/langIcons/SwiftIcon.js +19 -10
- package/dist/Plugins/code/langIcons/SystemverilogIcon.js +19 -10
- package/dist/Plugins/code/langIcons/TclIcon.js +19 -10
- package/dist/Plugins/code/langIcons/TexIcon.js +19 -10
- package/dist/Plugins/code/langIcons/TomlIcon.js +19 -10
- package/dist/Plugins/code/langIcons/TwigIcon.js +19 -10
- package/dist/Plugins/code/langIcons/TypescriptIcon.js +19 -10
- package/dist/Plugins/code/langIcons/VerilogIcon.js +19 -10
- package/dist/Plugins/code/langIcons/VhdlIcon.js +19 -10
- package/dist/Plugins/code/langIcons/VimIcon.js +19 -10
- package/dist/Plugins/code/langIcons/VueIcon.js +19 -10
- package/dist/Plugins/code/langIcons/WebassemblyIcon.js +19 -10
- package/dist/Plugins/code/langIcons/WenyanIcon.js +19 -10
- package/dist/Plugins/code/langIcons/WgslIcon.js +19 -10
- package/dist/Plugins/code/langIcons/WolframlanguageIcon.js +19 -10
- package/dist/Plugins/code/langIcons/XmlIcon.js +19 -10
- package/dist/Plugins/code/langIcons/XslIcon.js +19 -10
- package/dist/Plugins/code/langIcons/YamlIcon.js +19 -10
- package/dist/Plugins/code/langIcons/ZigIcon.js +19 -10
- package/dist/Plugins/code/loadAceEditor.js +21 -23
- package/dist/Plugins/code/utils/langOptions.js +6 -6
- package/dist/Plugins/formatter/index.js +6 -6
- package/dist/Plugins/katex/InlineKatex.js +52 -46
- package/dist/Plugins/katex/Katex.js +53 -47
- package/dist/Plugins/katex/index.js +6 -6
- package/dist/Plugins/katex/loadKatex.js +27 -29
- package/dist/Plugins/mermaid/Mermaid.js +34 -28
- package/dist/Plugins/mermaid/useMermaidRender.js +103 -97
- package/dist/Plugins/mermaid/utils.js +25 -17
- package/dist/Schema/SchemaEditor/AceEditorWrapper.js +162 -150
- package/dist/Schema/SchemaEditor/index.js +8 -1
- package/dist/Schema/SchemaForm/index.js +2 -2
- package/dist/Schema/SchemaRenderer/index.js +45 -46
- package/dist/ThoughtChainList/index.js +22 -13
- package/dist/ToolUseBar/BarItem/Content.js +3 -3
- package/dist/ToolUseBar/BarItem/index.js +10 -3
- package/dist/ToolUseBar/index.js +19 -10
- package/dist/ToolUseBar/style.js +4 -4
- package/dist/Types/common.js +4 -1
- package/dist/Types/message.js +4 -1
- package/dist/Utils/debugUtils.js +8 -8
- package/dist/Utils/getScroll.js +12 -5
- package/dist/Utils/loadCSS.js +23 -22
- package/dist/Utils/proxySandbox/ProxySandbox.js +42 -34
- package/dist/Utils/proxySandbox/SecurityContextManager.js +54 -54
- package/dist/Utils/proxySandbox/index.js +25 -22
- package/dist/Utils/proxySandbox/types.js +11 -11
- package/dist/Utils/scrollTo.js +8 -1
- package/dist/WelcomeMessage/index.js +1 -1
- package/dist/Workspace/File/FileComponent.js +91 -66
- package/dist/Workspace/File/PreviewComponent.js +15 -8
- package/dist/Workspace/File/index.d.ts +1 -1
- package/dist/Workspace/File/style.js +7 -0
- package/dist/Workspace/RealtimeFollow/index.js +1 -2
- package/dist/Workspace/index.js +13 -11
- package/dist/Workspace/style.js +8 -14
- package/dist/Workspace/types.d.ts +50 -0
- package/dist/Workspace/types.js +0 -1
- package/package.json +27 -27
|
@@ -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;
|
|
@@ -79,7 +79,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
79
79
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
80
80
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
81
81
|
}
|
|
82
|
-
import { Node } from "slate";
|
|
82
|
+
/* eslint-disable @typescript-eslint/no-loop-func */ /* eslint-disable no-case-declarations */ /* eslint-disable no-param-reassign */ /* eslint-disable @typescript-eslint/no-use-before-define */ import { Node } from "slate";
|
|
83
83
|
import stringWidth from "string-width";
|
|
84
84
|
import { debugInfo } from "../../../Utils/debugUtils";
|
|
85
85
|
import { getMediaType } from "../utils/dom";
|
|
@@ -297,6 +297,8 @@ var inlineNode = new Set([
|
|
|
297
297
|
case 'media':
|
|
298
298
|
str += handleMedia(node);
|
|
299
299
|
break;
|
|
300
|
+
case 'bulleted-list':
|
|
301
|
+
case 'numbered-list':
|
|
300
302
|
case 'list':
|
|
301
303
|
str += '\n' + handleList(node, preString, parent, plugins) + '\n\n';
|
|
302
304
|
break;
|
|
@@ -348,7 +350,7 @@ var inlineNode = new Set([
|
|
|
348
350
|
* 对于列表项、引用块、段落等不同类型的节点,会根据其特定的格式生成相应的 Markdown。
|
|
349
351
|
*/ export var parserSlateNodeToMarkdown = function(tree) {
|
|
350
352
|
var _loop = function(i) {
|
|
351
|
-
var _tree_, _tree_1;
|
|
353
|
+
var _tree_, _tree_1, _tree_2, _tree_3, _tree_4, _tree_5;
|
|
352
354
|
var node = tree[i];
|
|
353
355
|
debugInfo("parserSlateNodeToMarkdown - 处理节点 ".concat(i, "/").concat(tree.length), {
|
|
354
356
|
nodeType: node === null || node === void 0 ? void 0 : node.type,
|
|
@@ -543,16 +545,19 @@ var inlineNode = new Set([
|
|
|
543
545
|
debugInfo("parserSlateNodeToMarkdown - 引用块处理完成 ".concat(i), {
|
|
544
546
|
contentLength: blockquoteContent.length
|
|
545
547
|
});
|
|
546
|
-
} else if (node.type === 'list'
|
|
548
|
+
} else if (node.type === 'bulleted-list' || node.type === 'numbered-list' || node.type === 'list' // 向后兼容
|
|
549
|
+
) {
|
|
547
550
|
var _node_children2;
|
|
548
551
|
debugInfo("parserSlateNodeToMarkdown - 处理列表 ".concat(i), {
|
|
549
|
-
|
|
552
|
+
type: node.type,
|
|
553
|
+
isOrdered: node.type === 'numbered-list' || node.order,
|
|
550
554
|
start: node.start,
|
|
551
555
|
childrenCount: (_node_children2 = node.children) === null || _node_children2 === void 0 ? void 0 : _node_children2.length
|
|
552
556
|
});
|
|
553
557
|
// Handle lists
|
|
558
|
+
var isOrdered = node.type === 'numbered-list' || node.type === 'list' && node.order;
|
|
554
559
|
var listItems = node.children.map(function(item, index) {
|
|
555
|
-
var prefix =
|
|
560
|
+
var prefix = isOrdered ? "".concat(index + (node.start || 1), ".") : '-';
|
|
556
561
|
return prefix + ' ' + parserNode(item, '', _to_consumable_array(parent).concat([
|
|
557
562
|
node
|
|
558
563
|
]), plugins).trimEnd();
|
|
@@ -568,7 +573,7 @@ var inlineNode = new Set([
|
|
|
568
573
|
listItemsLength: listItems.length,
|
|
569
574
|
hasContent: !!listItems.trim()
|
|
570
575
|
});
|
|
571
|
-
} else if (node.type === 'paragraph' && ((_tree_ = tree[i - 1]) === null || _tree_ === void 0 ? void 0 : _tree_.type) === 'list'
|
|
576
|
+
} else if (node.type === 'paragraph' && (((_tree_ = tree[i - 1]) === null || _tree_ === void 0 ? void 0 : _tree_.type) === 'list' || ((_tree_1 = tree[i - 1]) === null || _tree_1 === void 0 ? void 0 : _tree_1.type) === 'bulleted-list' || ((_tree_2 = tree[i - 1]) === null || _tree_2 === void 0 ? void 0 : _tree_2.type) === 'numbered-list') && (((_tree_3 = tree[i + 1]) === null || _tree_3 === void 0 ? void 0 : _tree_3.type) === 'list' || ((_tree_4 = tree[i + 1]) === null || _tree_4 === void 0 ? void 0 : _tree_4.type) === 'bulleted-list' || ((_tree_5 = tree[i + 1]) === null || _tree_5 === void 0 ? void 0 : _tree_5.type) === 'numbered-list')) {
|
|
572
577
|
var _Node_string;
|
|
573
578
|
if (!((_Node_string = Node.string(node)) === null || _Node_string === void 0 ? void 0 : _Node_string.replace(/\s|\t/g, ''))) {
|
|
574
579
|
str += '<br/>\n\n';
|
|
@@ -585,7 +590,7 @@ var inlineNode = new Set([
|
|
|
585
590
|
str += '\n';
|
|
586
591
|
} else if (node.type === 'code' || node.type === 'media') {
|
|
587
592
|
str += '\n\n';
|
|
588
|
-
} else if (node.type === 'list') {
|
|
593
|
+
} else if (node.type === 'list' || node.type === 'bulleted-list' || node.type === 'numbered-list') {
|
|
589
594
|
str += '\n\n';
|
|
590
595
|
} else if (i !== tree.length - 1) {
|
|
591
596
|
// Card 节点不添加额外的换行符,让其子节点自行处理
|
|
@@ -1083,11 +1088,14 @@ export var isMix = function(t) {
|
|
|
1083
1088
|
* @returns 处理后的 Markdown 字符串
|
|
1084
1089
|
*/ var handleParagraph = function(node, preString, parent, plugins) {
|
|
1085
1090
|
var str = '';
|
|
1086
|
-
//
|
|
1091
|
+
// 如果有对齐属性,使用 HTML 标签包裹以支持对齐
|
|
1087
1092
|
if (node.align) {
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1093
|
+
// 递归处理子节点
|
|
1094
|
+
var content = parserSlateNodeToMarkdown(node === null || node === void 0 ? void 0 : node.children, '', _to_consumable_array(parent).concat([
|
|
1095
|
+
node
|
|
1096
|
+
]), plugins);
|
|
1097
|
+
// 使用 p 标签并添加 align 属性
|
|
1098
|
+
return '<p align="'.concat(node.align, '">').concat(content, "</p>");
|
|
1091
1099
|
}
|
|
1092
1100
|
str += parserSlateNodeToMarkdown(node === null || node === void 0 ? void 0 : node.children, preString, _to_consumable_array(parent).concat([
|
|
1093
1101
|
node
|
|
@@ -1103,11 +1111,14 @@ export var isMix = function(t) {
|
|
|
1103
1111
|
* @returns 处理后的 Markdown 标题字符串
|
|
1104
1112
|
*/ var handleHead = function(node, preString, parent, plugins) {
|
|
1105
1113
|
var str = '';
|
|
1106
|
-
//
|
|
1114
|
+
// 如果有对齐属性,使用 HTML 标签包裹以支持对齐
|
|
1107
1115
|
if (node.align) {
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1116
|
+
// 递归处理子节点
|
|
1117
|
+
var content = parserSlateNodeToMarkdown(node === null || node === void 0 ? void 0 : node.children, '', _to_consumable_array(parent).concat([
|
|
1118
|
+
node
|
|
1119
|
+
]), plugins);
|
|
1120
|
+
// 使用 h 标签并添加 align 属性
|
|
1121
|
+
return "<h".concat(node.level, ' align="').concat(node.align, '">').concat(content, "</h").concat(node.level, ">");
|
|
1111
1122
|
}
|
|
1112
1123
|
str += '#'.repeat(node.level) + ' ' + parserSlateNodeToMarkdown(node === null || node === void 0 ? void 0 : node.children, preString, _to_consumable_array(parent).concat([
|
|
1113
1124
|
node
|
|
@@ -1254,15 +1265,28 @@ export var isMix = function(t) {
|
|
|
1254
1265
|
};
|
|
1255
1266
|
/**
|
|
1256
1267
|
* 处理列表节点,递归处理其子节点
|
|
1257
|
-
* @param node -
|
|
1268
|
+
* @param node - 列表节点(bulleted-list、numbered-list 或 list)
|
|
1258
1269
|
* @param preString - 前缀字符串,用于处理缩进
|
|
1259
1270
|
* @param parent - 父节点数组
|
|
1260
1271
|
* @param plugins - 可选的插件数组
|
|
1261
1272
|
* @returns 处理后的 Markdown 列表字符串
|
|
1262
1273
|
*/ var handleList = function(node, preString, parent, plugins) {
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
])
|
|
1274
|
+
var _parent_;
|
|
1275
|
+
// 检查是否在嵌套列表中(父节点是 list-item)
|
|
1276
|
+
var isNested = parent.length > 0 && ((_parent_ = parent[parent.length - 1]) === null || _parent_ === void 0 ? void 0 : _parent_.type) === 'list-item';
|
|
1277
|
+
// 如果是嵌套列表,需要添加缩进
|
|
1278
|
+
var indent = isNested ? ' ' : '';
|
|
1279
|
+
// 递归处理列表项,每个列表项都会添加缩进前缀
|
|
1280
|
+
var listItems = node.children.map(function(item, index) {
|
|
1281
|
+
var isOrdered = node.type === 'numbered-list' || node.type === 'list' && node.order;
|
|
1282
|
+
var prefix = isOrdered ? "".concat(index + (node.start || 1), ".") : '-';
|
|
1283
|
+
// 处理列表项内容,如果是嵌套列表,需要额外缩进
|
|
1284
|
+
var itemContent = parserNode(item, indent + preString, _to_consumable_array(parent).concat([
|
|
1285
|
+
node
|
|
1286
|
+
]), plugins).trimEnd();
|
|
1287
|
+
return indent + prefix + ' ' + itemContent;
|
|
1288
|
+
}).join('\n' + indent);
|
|
1289
|
+
return listItems;
|
|
1266
1290
|
};
|
|
1267
1291
|
/**
|
|
1268
1292
|
* 处理列表项节点,递归处理其子节点
|
|
@@ -1272,9 +1296,28 @@ export var isMix = function(t) {
|
|
|
1272
1296
|
* @param plugins - 可选的插件数组
|
|
1273
1297
|
* @returns 处理后的 Markdown 列表项字符串
|
|
1274
1298
|
*/ var handleListItem = function(node, preString, parent, plugins) {
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
]
|
|
1299
|
+
// 列表项的第一个子节点应该是段落或其他块级元素
|
|
1300
|
+
// 后续子节点可能是嵌套的列表
|
|
1301
|
+
var result = [];
|
|
1302
|
+
for(var i = 0; i < node.children.length; i++){
|
|
1303
|
+
var child = node.children[i];
|
|
1304
|
+
var childResult = parserNode(child, preString, _to_consumable_array(parent).concat([
|
|
1305
|
+
node
|
|
1306
|
+
]), plugins);
|
|
1307
|
+
if (i === 0) {
|
|
1308
|
+
// 第一个子节点是主要内容
|
|
1309
|
+
result.push(childResult);
|
|
1310
|
+
} else {
|
|
1311
|
+
// 后续子节点可能是嵌套列表,需要换行并添加缩进
|
|
1312
|
+
if (child.type === 'bulleted-list' || child.type === 'numbered-list' || child.type === 'list') {
|
|
1313
|
+
result.push('\n' + childResult);
|
|
1314
|
+
} else {
|
|
1315
|
+
// 其他块级元素也需要换行
|
|
1316
|
+
result.push('\n' + childResult);
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
return result.join('');
|
|
1278
1321
|
};
|
|
1279
1322
|
/**
|
|
1280
1323
|
* 处理模式定义节点,生成 schema 代码块
|
|
@@ -350,7 +350,9 @@ var markdownParser = unified().use(remarkParse) // 解析 Markdown
|
|
|
350
350
|
.use(remarkHtml).use(remarkFrontmatter, [
|
|
351
351
|
'yaml'
|
|
352
352
|
]) // 处理前置元数据
|
|
353
|
-
.use(remarkGfm
|
|
353
|
+
.use(remarkGfm, {
|
|
354
|
+
singleTilde: false
|
|
355
|
+
}) // GFM 插件,禁用单波浪线删除线
|
|
354
356
|
.use(fixStrongWithSpecialChars) // 修复包含特殊字符的加粗文本
|
|
355
357
|
.use(convertParagraphToImage) // 将以 ! 开头的段落转换为图片,将 | 开头的段落转换为表格
|
|
356
358
|
.use(remarkMath, {
|
|
@@ -6,12 +6,64 @@ function _array_like_to_array(arr, len) {
|
|
|
6
6
|
function _array_without_holes(arr) {
|
|
7
7
|
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
8
8
|
}
|
|
9
|
+
function _define_property(obj, key, value) {
|
|
10
|
+
if (key in obj) {
|
|
11
|
+
Object.defineProperty(obj, key, {
|
|
12
|
+
value: value,
|
|
13
|
+
enumerable: true,
|
|
14
|
+
configurable: true,
|
|
15
|
+
writable: true
|
|
16
|
+
});
|
|
17
|
+
} else {
|
|
18
|
+
obj[key] = value;
|
|
19
|
+
}
|
|
20
|
+
return obj;
|
|
21
|
+
}
|
|
9
22
|
function _iterable_to_array(iter) {
|
|
10
23
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
11
24
|
}
|
|
12
25
|
function _non_iterable_spread() {
|
|
13
26
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
14
27
|
}
|
|
28
|
+
function _object_spread(target) {
|
|
29
|
+
for(var i = 1; i < arguments.length; i++){
|
|
30
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
31
|
+
var ownKeys = Object.keys(source);
|
|
32
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
33
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
34
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
ownKeys.forEach(function(key) {
|
|
38
|
+
_define_property(target, key, source[key]);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return target;
|
|
42
|
+
}
|
|
43
|
+
function ownKeys(object, enumerableOnly) {
|
|
44
|
+
var keys = Object.keys(object);
|
|
45
|
+
if (Object.getOwnPropertySymbols) {
|
|
46
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
47
|
+
if (enumerableOnly) {
|
|
48
|
+
symbols = symbols.filter(function(sym) {
|
|
49
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
keys.push.apply(keys, symbols);
|
|
53
|
+
}
|
|
54
|
+
return keys;
|
|
55
|
+
}
|
|
56
|
+
function _object_spread_props(target, source) {
|
|
57
|
+
source = source != null ? source : {};
|
|
58
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
59
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
60
|
+
} else {
|
|
61
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
62
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return target;
|
|
66
|
+
}
|
|
15
67
|
function _to_consumable_array(arr) {
|
|
16
68
|
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
17
69
|
}
|
|
@@ -236,7 +288,7 @@ export var MdElements = {
|
|
|
236
288
|
at: ctx.path
|
|
237
289
|
});
|
|
238
290
|
Transforms.insertNodes(ctx.editor, {
|
|
239
|
-
type: 'list',
|
|
291
|
+
type: 'bulleted-list',
|
|
240
292
|
task: true,
|
|
241
293
|
children: [
|
|
242
294
|
{
|
|
@@ -282,10 +334,12 @@ export var MdElements = {
|
|
|
282
334
|
at: path
|
|
283
335
|
});
|
|
284
336
|
var start = match[1].match(/^\s*(\d+)\./);
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
337
|
+
var listType = start ? 'numbered-list' : 'bulleted-list';
|
|
338
|
+
Transforms.insertNodes(editor, _object_spread_props(_object_spread({
|
|
339
|
+
type: listType
|
|
340
|
+
}, start && {
|
|
341
|
+
start: +start[1]
|
|
342
|
+
}), {
|
|
289
343
|
children: [
|
|
290
344
|
{
|
|
291
345
|
type: 'list-item',
|
|
@@ -297,7 +351,7 @@ export var MdElements = {
|
|
|
297
351
|
]
|
|
298
352
|
}
|
|
299
353
|
]
|
|
300
|
-
}, {
|
|
354
|
+
}), {
|
|
301
355
|
at: path
|
|
302
356
|
});
|
|
303
357
|
Transforms.select(editor, {
|
|
@@ -146,7 +146,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
146
146
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
147
147
|
}
|
|
148
148
|
function _ts_generator(thisArg, body) {
|
|
149
|
-
var f, y, t,
|
|
149
|
+
var f, y, t, _ = {
|
|
150
150
|
label: 0,
|
|
151
151
|
sent: function() {
|
|
152
152
|
if (t[0] & 1) throw t[1];
|
|
@@ -154,13 +154,17 @@ function _ts_generator(thisArg, body) {
|
|
|
154
154
|
},
|
|
155
155
|
trys: [],
|
|
156
156
|
ops: []
|
|
157
|
-
};
|
|
158
|
-
return g
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
},
|
|
163
|
-
|
|
157
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
158
|
+
return d(g, "next", {
|
|
159
|
+
value: verb(0)
|
|
160
|
+
}), d(g, "throw", {
|
|
161
|
+
value: verb(1)
|
|
162
|
+
}), d(g, "return", {
|
|
163
|
+
value: verb(2)
|
|
164
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
165
|
+
value: function() {
|
|
166
|
+
return this;
|
|
167
|
+
}
|
|
164
168
|
}), g;
|
|
165
169
|
function verb(n) {
|
|
166
170
|
return function(v) {
|
|
@@ -172,7 +176,7 @@ function _ts_generator(thisArg, body) {
|
|
|
172
176
|
}
|
|
173
177
|
function step(op) {
|
|
174
178
|
if (f) throw new TypeError("Generator is already executing.");
|
|
175
|
-
while(_)try {
|
|
179
|
+
while(g && (g = 0, op[0] && (_ = 0)), _)try {
|
|
176
180
|
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;
|
|
177
181
|
if (y = 0, t) op = [
|
|
178
182
|
op[0] & 2,
|
|
@@ -300,8 +304,8 @@ import { parseMarkdownToNodesAndInsert } from "./parseMarkdownToNodesAndInsert";
|
|
|
300
304
|
};
|
|
301
305
|
/**
|
|
302
306
|
* 处理粘贴的 HTML 内容
|
|
303
|
-
*/ export var handleHtmlPaste =
|
|
304
|
-
|
|
307
|
+
*/ export var handleHtmlPaste = function(editor, clipboardData, editorProps) {
|
|
308
|
+
return _async_to_generator(function() {
|
|
305
309
|
var html, rtf, error;
|
|
306
310
|
return _ts_generator(this, function(_state) {
|
|
307
311
|
switch(_state.label){
|
|
@@ -355,15 +359,12 @@ import { parseMarkdownToNodesAndInsert } from "./parseMarkdownToNodesAndInsert";
|
|
|
355
359
|
];
|
|
356
360
|
}
|
|
357
361
|
});
|
|
358
|
-
});
|
|
359
|
-
|
|
360
|
-
return _ref.apply(this, arguments);
|
|
361
|
-
};
|
|
362
|
-
}();
|
|
362
|
+
})();
|
|
363
|
+
};
|
|
363
364
|
/**
|
|
364
365
|
* 处理粘贴的文件
|
|
365
|
-
*/ export var handleFilesPaste =
|
|
366
|
-
|
|
366
|
+
*/ export var handleFilesPaste = function(editor, clipboardData, editorProps) {
|
|
367
|
+
return _async_to_generator(function() {
|
|
367
368
|
var _editorProps_image, fileList, hideLoading, _editor_selection_focus, _editor_selection, url, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, file, _editorProps_image1, serverUrl, err, selection, node, at, error, error1;
|
|
368
369
|
return _ts_generator(this, function(_state) {
|
|
369
370
|
switch(_state.label){
|
|
@@ -525,11 +526,8 @@ import { parseMarkdownToNodesAndInsert } from "./parseMarkdownToNodesAndInsert";
|
|
|
525
526
|
];
|
|
526
527
|
}
|
|
527
528
|
});
|
|
528
|
-
});
|
|
529
|
-
|
|
530
|
-
return _ref.apply(this, arguments);
|
|
531
|
-
};
|
|
532
|
-
}();
|
|
529
|
+
})();
|
|
530
|
+
};
|
|
533
531
|
/**
|
|
534
532
|
* 处理特殊文本格式(media:// 和 attach:// 链接)
|
|
535
533
|
*/ export var handleSpecialTextPaste = function(editor, text, selection) {
|
|
@@ -686,8 +684,8 @@ import { parseMarkdownToNodesAndInsert } from "./parseMarkdownToNodesAndInsert";
|
|
|
686
684
|
};
|
|
687
685
|
/**
|
|
688
686
|
* 处理普通文本粘贴
|
|
689
|
-
*/ export var handlePlainTextPaste =
|
|
690
|
-
|
|
687
|
+
*/ export var handlePlainTextPaste = function(editor, text, selection, plugins) {
|
|
688
|
+
return _async_to_generator(function() {
|
|
691
689
|
var success;
|
|
692
690
|
return _ts_generator(this, function(_state) {
|
|
693
691
|
switch(_state.label){
|
|
@@ -745,11 +743,8 @@ import { parseMarkdownToNodesAndInsert } from "./parseMarkdownToNodesAndInsert";
|
|
|
745
743
|
];
|
|
746
744
|
}
|
|
747
745
|
});
|
|
748
|
-
});
|
|
749
|
-
|
|
750
|
-
return _ref.apply(this, arguments);
|
|
751
|
-
};
|
|
752
|
-
}();
|
|
746
|
+
})();
|
|
747
|
+
};
|
|
753
748
|
/**
|
|
754
749
|
* 检查是否需要直接插入文本(在特定节点类型中)
|
|
755
750
|
*/ export var shouldInsertTextDirectly = function(editor, selection) {
|
|
@@ -45,7 +45,6 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
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
47
|
import isHotkey from "is-hotkey";
|
|
48
|
-
import React from "react";
|
|
49
48
|
import { Editor, Element, Node, Path, Range, Transforms } from "slate";
|
|
50
49
|
import { isMod } from "../../utils";
|
|
51
50
|
import { EditorUtils } from "../../utils/editorUtils";
|
|
@@ -90,6 +90,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
90
90
|
}
|
|
91
91
|
import { Editor, Element, Node, Path, Point, Range, Transforms } from "slate";
|
|
92
92
|
import { EditorUtils } from "../../utils/editorUtils";
|
|
93
|
+
import { isListType } from "../withListsPlugin";
|
|
93
94
|
export var BackspaceKey = /*#__PURE__*/ function() {
|
|
94
95
|
"use strict";
|
|
95
96
|
function BackspaceKey(editor) {
|
|
@@ -166,67 +167,124 @@ export var BackspaceKey = /*#__PURE__*/ function() {
|
|
|
166
167
|
var _parent_1;
|
|
167
168
|
var parent1 = Editor.parent(this.editor, path);
|
|
168
169
|
if ((parent1 === null || parent1 === void 0 ? void 0 : (_parent_1 = parent1[0]) === null || _parent_1 === void 0 ? void 0 : _parent_1.type) === 'list-item') {
|
|
170
|
+
// 处理行首 Backspace 减少缩进
|
|
171
|
+
if (Range.isCollapsed(sel) && sel.anchor.offset === 0) {
|
|
172
|
+
var listItemPath = parent1[1];
|
|
173
|
+
var listPath = Path.parent(listItemPath);
|
|
174
|
+
var list = Node.get(this.editor, listPath);
|
|
175
|
+
if (isListType(list)) {
|
|
176
|
+
var listParent = Editor.parent(this.editor, listPath);
|
|
177
|
+
// 如果父节点是 list-item,说明在嵌套列表中,可以提升
|
|
178
|
+
if (Element.isElement(listParent[0]) && listParent[0].type === 'list-item') {
|
|
179
|
+
// 使用 liftNodes 提升当前 list-item
|
|
180
|
+
Transforms.liftNodes(this.editor, {
|
|
181
|
+
at: listItemPath
|
|
182
|
+
});
|
|
183
|
+
// 如果提升后,原列表为空,需要删除空列表
|
|
184
|
+
var updatedList = Node.get(this.editor, listPath);
|
|
185
|
+
if (isListType(updatedList) && updatedList.children.length === 0) {
|
|
186
|
+
Transforms.removeNodes(this.editor, {
|
|
187
|
+
at: listPath
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
return true;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
169
194
|
if (Node.string(parent1[0]) !== '') {
|
|
170
195
|
return false;
|
|
171
196
|
}
|
|
172
197
|
if (Node.string(parent1[0]) === '') {
|
|
173
198
|
// 使用新的拆分逻辑处理空的list-item
|
|
174
|
-
var
|
|
175
|
-
var listNode = Editor.node(this.editor,
|
|
199
|
+
var listPath1 = Path.parent(parent1[1]);
|
|
200
|
+
var listNode = Editor.node(this.editor, listPath1);
|
|
176
201
|
var currentItemIndex = parent1[1][parent1[1].length - 1];
|
|
177
202
|
var isLastItem = currentItemIndex === listNode[0].children.length - 1;
|
|
178
203
|
if (isLastItem) {
|
|
179
204
|
// 如果是最后一个项目,删除list-item并替换成paragraph
|
|
180
|
-
|
|
205
|
+
// 使用 removeNodes 删除元素节点
|
|
206
|
+
Transforms.removeNodes(this.editor, {
|
|
181
207
|
at: parent1[1]
|
|
182
208
|
});
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
209
|
+
// 如果列表为空,删除列表容器
|
|
210
|
+
var updatedList1 = Node.get(this.editor, listPath1);
|
|
211
|
+
if (isListType(updatedList1) && updatedList1.children.length === 0) {
|
|
212
|
+
Transforms.removeNodes(this.editor, {
|
|
213
|
+
at: listPath1
|
|
214
|
+
});
|
|
215
|
+
// 在列表位置插入 paragraph
|
|
216
|
+
Transforms.insertNodes(this.editor, {
|
|
217
|
+
type: 'paragraph',
|
|
218
|
+
children: [
|
|
219
|
+
{
|
|
220
|
+
text: ''
|
|
221
|
+
}
|
|
222
|
+
]
|
|
223
|
+
}, {
|
|
224
|
+
at: listPath1,
|
|
225
|
+
select: true
|
|
226
|
+
});
|
|
227
|
+
} else {
|
|
228
|
+
// 在删除的位置插入 paragraph
|
|
229
|
+
Transforms.insertNodes(this.editor, {
|
|
230
|
+
type: 'paragraph',
|
|
231
|
+
children: [
|
|
232
|
+
{
|
|
233
|
+
text: ''
|
|
234
|
+
}
|
|
235
|
+
]
|
|
236
|
+
}, {
|
|
237
|
+
at: parent1[1],
|
|
238
|
+
select: true
|
|
239
|
+
});
|
|
240
|
+
}
|
|
194
241
|
} else {
|
|
195
|
-
//
|
|
196
|
-
|
|
197
|
-
// 删除当前item之后的所有items
|
|
242
|
+
// 如果不是最后一个项目,删除当前item和之后的所有items
|
|
243
|
+
// 先删除后面的 items(从后往前删除,避免索引变化)
|
|
198
244
|
for(var i = listNode[0].children.length - 1; i > currentItemIndex; i--){
|
|
199
|
-
Transforms.
|
|
200
|
-
at: _to_consumable_array(
|
|
245
|
+
Transforms.removeNodes(this.editor, {
|
|
246
|
+
at: _to_consumable_array(listPath1).concat([
|
|
201
247
|
i
|
|
202
248
|
])
|
|
203
249
|
});
|
|
204
250
|
}
|
|
205
251
|
// 删除当前item
|
|
206
|
-
Transforms.
|
|
252
|
+
Transforms.removeNodes(this.editor, {
|
|
207
253
|
at: parent1[1]
|
|
208
254
|
});
|
|
209
|
-
//
|
|
210
|
-
var
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
255
|
+
// 检查列表是否为空,如果为空则删除列表容器
|
|
256
|
+
var updatedList2 = Node.get(this.editor, listPath1);
|
|
257
|
+
if (isListType(updatedList2) && updatedList2.children.length === 0) {
|
|
258
|
+
// 列表为空,删除列表容器
|
|
259
|
+
Transforms.removeNodes(this.editor, {
|
|
260
|
+
at: listPath1
|
|
261
|
+
});
|
|
262
|
+
// 在列表位置插入 paragraph
|
|
263
|
+
Transforms.insertNodes(this.editor, {
|
|
264
|
+
type: 'paragraph',
|
|
265
|
+
children: [
|
|
266
|
+
{
|
|
267
|
+
text: ''
|
|
268
|
+
}
|
|
269
|
+
]
|
|
270
|
+
}, {
|
|
271
|
+
at: listPath1,
|
|
272
|
+
select: true
|
|
273
|
+
});
|
|
274
|
+
} else {
|
|
275
|
+
// 列表还有前面的 items,保持列表
|
|
276
|
+
// 在列表后插入 paragraph
|
|
277
|
+
var insertPath = Path.next(listPath1);
|
|
225
278
|
Transforms.insertNodes(this.editor, {
|
|
226
|
-
type:
|
|
227
|
-
children:
|
|
279
|
+
type: 'paragraph',
|
|
280
|
+
children: [
|
|
281
|
+
{
|
|
282
|
+
text: ''
|
|
283
|
+
}
|
|
284
|
+
]
|
|
228
285
|
}, {
|
|
229
|
-
at:
|
|
286
|
+
at: insertPath,
|
|
287
|
+
select: true
|
|
230
288
|
});
|
|
231
289
|
}
|
|
232
290
|
}
|
|
@@ -88,7 +88,6 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
88
88
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
89
89
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
90
90
|
}
|
|
91
|
-
import React from "react";
|
|
92
91
|
import { Editor, Element, Node, Path, Point, Range, Transforms } from "slate";
|
|
93
92
|
import { isMod } from "../../utils";
|
|
94
93
|
import { EditorUtils } from "../../utils/editorUtils";
|
|
@@ -80,7 +80,6 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
80
80
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
81
81
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
82
82
|
}
|
|
83
|
-
import React from "react";
|
|
84
83
|
import { Editor, Element, Node, Range } from "slate";
|
|
85
84
|
import { TextMatchNodes } from "../elements";
|
|
86
85
|
export var MatchKey = /*#__PURE__*/ function() {
|
|
@@ -8,5 +8,19 @@ export declare class TabKey {
|
|
|
8
8
|
constructor(editor: Editor);
|
|
9
9
|
run(e: React.KeyboardEvent): void;
|
|
10
10
|
private tableCell;
|
|
11
|
+
/**
|
|
12
|
+
* 处理列表项的 Tab/Shift+Tab 键
|
|
13
|
+
*
|
|
14
|
+
* Tab: 增加缩进(将当前 list-item 移动到前一个 list-item 的子列表中)
|
|
15
|
+
* Shift+Tab: 减少缩进(将当前 list-item 提升一级)
|
|
16
|
+
*/
|
|
11
17
|
private listItem;
|
|
18
|
+
/**
|
|
19
|
+
* 增加缩进:将当前 list-item 移动到前一个 list-item 的子列表中
|
|
20
|
+
*/
|
|
21
|
+
private indentListItem;
|
|
22
|
+
/**
|
|
23
|
+
* 减少缩进:将当前 list-item 提升一级
|
|
24
|
+
*/
|
|
25
|
+
private outdentListItem;
|
|
12
26
|
}
|