dishui 0.0.64 → 0.0.66
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/_virtual/_rolldown/runtime.js +10 -11
- package/dist/chart.js +12 -46
- package/dist/code-editor.js +16 -43
- package/dist/components/Badge/index.js +11 -13
- package/dist/components/Badge/index.js.map +1 -1
- package/dist/components/Button/index.js +62 -86
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Card/index.d.ts +87 -0
- package/dist/components/Card/index.js +178 -44
- package/dist/components/Card/index.js.map +1 -1
- package/dist/components/Chart/Chart.js +25 -25
- package/dist/components/Chart/Chart.js.map +1 -1
- package/dist/components/Checkbox/index.js +57 -63
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/ChoicePicker/index.d.ts +44 -0
- package/dist/components/ChoicePicker/index.js +81 -0
- package/dist/components/ChoicePicker/index.js.map +1 -0
- package/dist/components/Column/index.d.ts +28 -0
- package/dist/components/Column/index.js +30 -0
- package/dist/components/Column/index.js.map +1 -0
- package/dist/components/DateTimeInput/index.d.ts +44 -0
- package/dist/components/DateTimeInput/index.js +48 -0
- package/dist/components/DateTimeInput/index.js.map +1 -0
- package/dist/components/Demo/index.js +107 -107
- package/dist/components/Demo/index.js.map +1 -1
- package/dist/components/Divider/index.d.ts +20 -0
- package/dist/components/Divider/index.js +30 -0
- package/dist/components/Divider/index.js.map +1 -0
- package/dist/components/EmptyState/index.d.ts +4 -1
- package/dist/components/EmptyState/index.js +24 -24
- package/dist/components/EmptyState/index.js.map +1 -1
- package/dist/components/FileUploader/DropZone.js +134 -136
- package/dist/components/FileUploader/DropZone.js.map +1 -1
- package/dist/components/FileUploader/FileItem.js +159 -163
- package/dist/components/FileUploader/FileItem.js.map +1 -1
- package/dist/components/FileUploader/FileUploader.js +126 -127
- package/dist/components/FileUploader/FileUploader.js.map +1 -1
- package/dist/components/FileUploader/UploadQueue.js +62 -62
- package/dist/components/FileUploader/UploadQueue.js.map +1 -1
- package/dist/components/FloatWindow/index.d.ts +28 -0
- package/dist/components/GridLayout/index.d.ts +42 -0
- package/dist/components/Icon/index.d.ts +24 -0
- package/dist/components/Icon/index.js +26 -0
- package/dist/components/Icon/index.js.map +1 -0
- package/dist/components/Image/index.d.ts +33 -0
- package/dist/components/Image/index.js +44 -0
- package/dist/components/Image/index.js.map +1 -0
- package/dist/components/Input/index.js +196 -197
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/Label/index.js +62 -73
- package/dist/components/Label/index.js.map +1 -1
- package/dist/components/Layout/index.js +134 -139
- package/dist/components/Layout/index.js.map +1 -1
- package/dist/components/List/index.js +45 -43
- package/dist/components/List/index.js.map +1 -1
- package/dist/components/Markdown/Markdown.js +106 -103
- package/dist/components/Markdown/Markdown.js.map +1 -1
- package/dist/components/Markdown/codeThemes.js +24 -33
- package/dist/components/Markdown/codeThemes.js.map +1 -1
- package/dist/components/Markdown/markdownComponents.js +203 -208
- package/dist/components/Markdown/markdownComponents.js.map +1 -1
- package/dist/components/Markdown/parseCodeBlockMeta.js +22 -22
- package/dist/components/Markdown/parseCodeBlockMeta.js.map +1 -1
- package/dist/components/Markdown/useMarkdownSource.js +46 -46
- package/dist/components/Markdown/useMarkdownSource.js.map +1 -1
- package/dist/components/Markdown/useMarkmapRenderer.js +35 -36
- package/dist/components/Markdown/useMarkmapRenderer.js.map +1 -1
- package/dist/components/Markdown/useMermaidRenderer.js +41 -42
- package/dist/components/Markdown/useMermaidRenderer.js.map +1 -1
- package/dist/components/Modal/index.d.ts +7 -3
- package/dist/components/Modal/index.js +82 -70
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/MultipleChoice/index.d.ts +44 -0
- package/dist/components/MultipleChoice/index.js +52 -0
- package/dist/components/MultipleChoice/index.js.map +1 -0
- package/dist/components/Notification/index.d.ts +17 -0
- package/dist/components/Page/index.d.ts +58 -0
- package/dist/components/Page/index.js +43 -0
- package/dist/components/Page/index.js.map +1 -0
- package/dist/components/PageHeader/index.js +28 -28
- package/dist/components/PageHeader/index.js.map +1 -1
- package/dist/components/ProtectedRoute/index.js +8 -9
- package/dist/components/ProtectedRoute/index.js.map +1 -1
- package/dist/components/Row/index.d.ts +28 -0
- package/dist/components/Row/index.js +30 -0
- package/dist/components/Row/index.js.map +1 -0
- package/dist/components/Select/index.js +251 -257
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/SidebarToggleButton/index.js +56 -59
- package/dist/components/SidebarToggleButton/index.js.map +1 -1
- package/dist/components/Slider/index.d.ts +39 -0
- package/dist/components/Slider/index.js +52 -0
- package/dist/components/Slider/index.js.map +1 -0
- package/dist/components/StatCard/index.d.ts +31 -1
- package/dist/components/StatCard/index.js +189 -58
- package/dist/components/StatCard/index.js.map +1 -1
- package/dist/components/Switch/index.d.ts +34 -0
- package/dist/components/Switch/index.js +55 -0
- package/dist/components/Switch/index.js.map +1 -0
- package/dist/components/Tab/index.d.ts +40 -0
- package/dist/components/Table/index.js +109 -103
- package/dist/components/Table/index.js.map +1 -1
- package/dist/components/Tabs/index.d.ts +19 -5
- package/dist/components/Tabs/index.js +30 -21
- package/dist/components/Tabs/index.js.map +1 -1
- package/dist/components/Text/index.d.ts +43 -0
- package/dist/components/Text/index.js +55 -0
- package/dist/components/Text/index.js.map +1 -0
- package/dist/components/Tooltip/index.d.ts +23 -0
- package/dist/components/Tooltip/index.js +34 -0
- package/dist/components/Tooltip/index.js.map +1 -0
- package/dist/components/Tree/Tree.js +205 -205
- package/dist/components/Tree/Tree.js.map +1 -1
- package/dist/components/pro/ArticleContextMenu/index.js +86 -87
- package/dist/components/pro/ArticleContextMenu/index.js.map +1 -1
- package/dist/components/pro/ArticleControl/ArticleControl2.js +250 -250
- package/dist/components/pro/ArticleControl/ArticleControl2.js.map +1 -1
- package/dist/components/pro/ArticleControl/buildHeadingTree.js +31 -32
- package/dist/components/pro/ArticleControl/buildHeadingTree.js.map +1 -1
- package/dist/components/pro/ArticleControl/useArticleToc.js +100 -102
- package/dist/components/pro/ArticleControl/useArticleToc.js.map +1 -1
- package/dist/components/pro/Calendar/Calendar.d.ts +10 -0
- package/dist/components/pro/Calendar/hooks/useCalendarDrag.d.ts +47 -0
- package/dist/components/pro/Calendar/hooks/useCalendarState.d.ts +56 -0
- package/dist/components/pro/Calendar/index.d.ts +7 -0
- package/dist/components/pro/Calendar/types.d.ts +151 -0
- package/dist/components/pro/Calendar/utils.d.ts +94 -0
- package/dist/components/pro/Chat/Chat.d.ts +6 -0
- package/dist/components/pro/Chat/index.d.ts +2 -0
- package/dist/components/pro/Chat/types.d.ts +84 -0
- package/dist/components/pro/CodeEditor/editors/CodeEditor.js +287 -320
- package/dist/components/pro/CodeEditor/editors/CodeEditor.js.map +1 -1
- package/dist/components/pro/CodeEditor/editors/MarkdownEditor.js +167 -221
- package/dist/components/pro/CodeEditor/editors/MarkdownEditor.js.map +1 -1
- package/dist/components/pro/CodeEditor/editors/markdownExtensions.js +594 -613
- package/dist/components/pro/CodeEditor/editors/markdownExtensions.js.map +1 -1
- package/dist/components/pro/CodeEditor/extensions/contextMenu.js +54 -55
- package/dist/components/pro/CodeEditor/extensions/contextMenu.js.map +1 -1
- package/dist/components/pro/CodeEditor/extensions/index.js +152 -160
- package/dist/components/pro/CodeEditor/extensions/index.js.map +1 -1
- package/dist/components/pro/CodeEditor/langs/index.js +7 -15
- package/dist/components/pro/CodeEditor/langs/index.js.map +1 -1
- package/dist/components/pro/CodeEditor/langs/javascript.js +11 -48
- package/dist/components/pro/CodeEditor/langs/javascript.js.map +1 -1
- package/dist/components/pro/CodeEditor/langs/python.js +4 -40
- package/dist/components/pro/CodeEditor/langs/python.js.map +1 -1
- package/dist/components/pro/CodeEditor/langs/snippets.js +118 -147
- package/dist/components/pro/CodeEditor/langs/snippets.js.map +1 -1
- package/dist/components/pro/CodeEditor/panels/FootnotePanel.js +153 -153
- package/dist/components/pro/CodeEditor/panels/FootnotePanel.js.map +1 -1
- package/dist/components/pro/CodeEditor/panels/HistoryPanel.js +180 -190
- package/dist/components/pro/CodeEditor/panels/HistoryPanel.js.map +1 -1
- package/dist/components/pro/CodeEditor/panels/OutlinePanel.js +130 -137
- package/dist/components/pro/CodeEditor/panels/OutlinePanel.js.map +1 -1
- package/dist/components/pro/CodeEditor/panels/TableOfContentsPanel.js +228 -242
- package/dist/components/pro/CodeEditor/panels/TableOfContentsPanel.js.map +1 -1
- package/dist/components/pro/CodeEditor/panels/VariablePanel.js +208 -248
- package/dist/components/pro/CodeEditor/panels/VariablePanel.js.map +1 -1
- package/dist/components/pro/CodeEditor/themes.js +513 -483
- package/dist/components/pro/CodeEditor/themes.js.map +1 -1
- package/dist/components/pro/CodeEditor/types.d.ts +1 -1
- package/dist/components/pro/CodeEditor/utils.js +171 -175
- package/dist/components/pro/CodeEditor/utils.js.map +1 -1
- package/dist/components/pro/DataTable/DataTable.js +305 -305
- package/dist/components/pro/DataTable/DataTable.js.map +1 -1
- package/dist/components/pro/DataTable/Filters.js +299 -314
- package/dist/components/pro/DataTable/Filters.js.map +1 -1
- package/dist/components/pro/DataTable/PivotPanel.js +203 -204
- package/dist/components/pro/DataTable/PivotPanel.js.map +1 -1
- package/dist/components/pro/DataTable/PivotView.js +142 -141
- package/dist/components/pro/DataTable/PivotView.js.map +1 -1
- package/dist/components/pro/DataTable/components/BulkActions.js +42 -42
- package/dist/components/pro/DataTable/components/BulkActions.js.map +1 -1
- package/dist/components/pro/DataTable/components/ColumnSelector.js +84 -84
- package/dist/components/pro/DataTable/components/ColumnSelector.js.map +1 -1
- package/dist/components/pro/DataTable/components/FilterBar.js +58 -58
- package/dist/components/pro/DataTable/components/FilterBar.js.map +1 -1
- package/dist/components/pro/DataTable/components/TableBody.js +93 -94
- package/dist/components/pro/DataTable/components/TableBody.js.map +1 -1
- package/dist/components/pro/DataTable/components/TableHeader.js +78 -78
- package/dist/components/pro/DataTable/components/TableHeader.js.map +1 -1
- package/dist/components/pro/DataTable/components/TablePagination.js +77 -77
- package/dist/components/pro/DataTable/components/TablePagination.js.map +1 -1
- package/dist/components/pro/DataTable/components/TableToolbar.js +40 -40
- package/dist/components/pro/DataTable/components/TableToolbar.js.map +1 -1
- package/dist/components/pro/DataTable/extension.js +5 -5
- package/dist/components/pro/DataTable/extension.js.map +1 -1
- package/dist/components/pro/DataTable/pivotEngine.js +84 -92
- package/dist/components/pro/DataTable/pivotEngine.js.map +1 -1
- package/dist/components/pro/DataTable/pivotExtension.js +93 -93
- package/dist/components/pro/DataTable/pivotExtension.js.map +1 -1
- package/dist/components/pro/DataTable/rowDetailExtension.js +30 -30
- package/dist/components/pro/DataTable/rowDetailExtension.js.map +1 -1
- package/dist/components/pro/DataTable/tanstack-table.js +45 -62
- package/dist/components/pro/DataTable/tanstack-table.js.map +1 -1
- package/dist/components/pro/DataTable/treeDataUtils.js +37 -48
- package/dist/components/pro/DataTable/treeDataUtils.js.map +1 -1
- package/dist/components/pro/DataTable/useColumnDragReorder.js +68 -68
- package/dist/components/pro/DataTable/useColumnDragReorder.js.map +1 -1
- package/dist/components/pro/DataTable/utils.js +156 -168
- package/dist/components/pro/DataTable/utils.js.map +1 -1
- package/dist/components/pro/FileExplorer/Breadcrumb.js +180 -180
- package/dist/components/pro/FileExplorer/Breadcrumb.js.map +1 -1
- package/dist/components/pro/FileExplorer/CreateDialog.js +78 -78
- package/dist/components/pro/FileExplorer/CreateDialog.js.map +1 -1
- package/dist/components/pro/FileExplorer/FileExplorer.js +202 -205
- package/dist/components/pro/FileExplorer/FileExplorer.js.map +1 -1
- package/dist/components/pro/FileExplorer/FileIcon.js +190 -190
- package/dist/components/pro/FileExplorer/FileIcon.js.map +1 -1
- package/dist/components/pro/FileExplorer/GridView.js +100 -100
- package/dist/components/pro/FileExplorer/GridView.js.map +1 -1
- package/dist/components/pro/FileExplorer/ListView.js +209 -209
- package/dist/components/pro/FileExplorer/ListView.js.map +1 -1
- package/dist/components/pro/FileExplorer/Toolbar.js +199 -199
- package/dist/components/pro/FileExplorer/Toolbar.js.map +1 -1
- package/dist/components/pro/Flow/Flow.js +920 -946
- package/dist/components/pro/Flow/Flow.js.map +1 -1
- package/dist/components/pro/Flow/FlowCanvas.js +1626 -1663
- package/dist/components/pro/Flow/FlowCanvas.js.map +1 -1
- package/dist/components/pro/Flow/archify/build.js +85 -94
- package/dist/components/pro/Flow/archify/build.js.map +1 -1
- package/dist/components/pro/Flow/archify/convert.js +512 -519
- package/dist/components/pro/Flow/archify/convert.js.map +1 -1
- package/dist/components/pro/Flow/archify/palette.js +87 -104
- package/dist/components/pro/Flow/archify/palette.js.map +1 -1
- package/dist/components/pro/Flow/archify/presets.js +34 -37
- package/dist/components/pro/Flow/archify/presets.js.map +1 -1
- package/dist/components/pro/Flow/archify/spec.js +7 -7
- package/dist/components/pro/Flow/archify/spec.js.map +1 -1
- package/dist/components/pro/Flow/canvas/AlignmentGuides.js +25 -25
- package/dist/components/pro/Flow/canvas/AlignmentGuides.js.map +1 -1
- package/dist/components/pro/Flow/canvas/GridRenderer.js +54 -55
- package/dist/components/pro/Flow/canvas/GridRenderer.js.map +1 -1
- package/dist/components/pro/Flow/canvas/MiniMapRenderer.js +54 -58
- package/dist/components/pro/Flow/canvas/MiniMapRenderer.js.map +1 -1
- package/dist/components/pro/Flow/canvas/PixiApp.js +105 -102
- package/dist/components/pro/Flow/canvas/PixiApp.js.map +1 -1
- package/dist/components/pro/Flow/canvas/SelectionOverlay.js +38 -38
- package/dist/components/pro/Flow/canvas/SelectionOverlay.js.map +1 -1
- package/dist/components/pro/Flow/canvas/ViewportContainer.js +117 -117
- package/dist/components/pro/Flow/canvas/ViewportContainer.js.map +1 -1
- package/dist/components/pro/Flow/constants.js +266 -278
- package/dist/components/pro/Flow/constants.js.map +1 -1
- package/dist/components/pro/Flow/context/FlowAIContext.js +27 -28
- package/dist/components/pro/Flow/context/FlowAIContext.js.map +1 -1
- package/dist/components/pro/Flow/context/FlowContext.js +60 -61
- package/dist/components/pro/Flow/context/FlowContext.js.map +1 -1
- package/dist/components/pro/Flow/context/FlowUIContext.js +115 -117
- package/dist/components/pro/Flow/context/FlowUIContext.js.map +1 -1
- package/dist/components/pro/Flow/edges/EdgeRenderer.js +135 -138
- package/dist/components/pro/Flow/edges/EdgeRenderer.js.map +1 -1
- package/dist/components/pro/Flow/edges/edgeMarkers.js +11 -14
- package/dist/components/pro/Flow/edges/edgeMarkers.js.map +1 -1
- package/dist/components/pro/Flow/edges/edgePaths.js +351 -367
- package/dist/components/pro/Flow/edges/edgePaths.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useAlignmentGuides.js +49 -52
- package/dist/components/pro/Flow/hooks/useAlignmentGuides.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useClipboard.js +154 -154
- package/dist/components/pro/Flow/hooks/useClipboard.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useCompactMode.js +17 -17
- package/dist/components/pro/Flow/hooks/useCompactMode.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useDeleteSelection.js +40 -40
- package/dist/components/pro/Flow/hooks/useDeleteSelection.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useDraggablePanel.js +51 -51
- package/dist/components/pro/Flow/hooks/useDraggablePanel.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useEdgeMutations.js +157 -157
- package/dist/components/pro/Flow/hooks/useEdgeMutations.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useFlowImportExport.js +190 -201
- package/dist/components/pro/Flow/hooks/useFlowImportExport.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useKeyboardShortcuts.js +32 -38
- package/dist/components/pro/Flow/hooks/useKeyboardShortcuts.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useLayoutActions.js +172 -182
- package/dist/components/pro/Flow/hooks/useLayoutActions.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useLineMutations.js +57 -57
- package/dist/components/pro/Flow/hooks/useLineMutations.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useMindMap.js +229 -238
- package/dist/components/pro/Flow/hooks/useMindMap.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useNodeMutations.js +102 -102
- package/dist/components/pro/Flow/hooks/useNodeMutations.js.map +1 -1
- package/dist/components/pro/Flow/hooks/usePdfExport.js +55 -56
- package/dist/components/pro/Flow/hooks/usePdfExport.js.map +1 -1
- package/dist/components/pro/Flow/hooks/usePixiApp.js +55 -57
- package/dist/components/pro/Flow/hooks/usePixiApp.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useResizablePanel.js +31 -31
- package/dist/components/pro/Flow/hooks/useResizablePanel.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useSelection.js +69 -69
- package/dist/components/pro/Flow/hooks/useSelection.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useUndoRedo.js +27 -27
- package/dist/components/pro/Flow/hooks/useUndoRedo.js.map +1 -1
- package/dist/components/pro/Flow/hooks/useViewport.js +28 -28
- package/dist/components/pro/Flow/hooks/useViewport.js.map +1 -1
- package/dist/components/pro/Flow/lines/FreehandTool.js +63 -63
- package/dist/components/pro/Flow/lines/FreehandTool.js.map +1 -1
- package/dist/components/pro/Flow/lines/GeometricLineTool.js +80 -80
- package/dist/components/pro/Flow/lines/GeometricLineTool.js.map +1 -1
- package/dist/components/pro/Flow/lines/LineRenderer.js +88 -88
- package/dist/components/pro/Flow/lines/LineRenderer.js.map +1 -1
- package/dist/components/pro/Flow/lines/lineSmoothing.js +32 -34
- package/dist/components/pro/Flow/lines/lineSmoothing.js.map +1 -1
- package/dist/components/pro/Flow/nodes/DataNodeView.js +236 -222
- package/dist/components/pro/Flow/nodes/DataNodeView.js.map +1 -1
- package/dist/components/pro/Flow/nodes/MediaContent.js +236 -246
- package/dist/components/pro/Flow/nodes/MediaContent.js.map +1 -1
- package/dist/components/pro/Flow/nodes/MediaOverlay.js +63 -63
- package/dist/components/pro/Flow/nodes/MediaOverlay.js.map +1 -1
- package/dist/components/pro/Flow/nodes/Model3DView.js +111 -113
- package/dist/components/pro/Flow/nodes/Model3DView.js.map +1 -1
- package/dist/components/pro/Flow/nodes/NodeHandles.js +74 -80
- package/dist/components/pro/Flow/nodes/NodeHandles.js.map +1 -1
- package/dist/components/pro/Flow/nodes/NodeRenderer.js +303 -314
- package/dist/components/pro/Flow/nodes/NodeRenderer.js.map +1 -1
- package/dist/components/pro/Flow/nodes/NodeText.js +25 -29
- package/dist/components/pro/Flow/nodes/NodeText.js.map +1 -1
- package/dist/components/pro/Flow/nodes/aiClient.js +124 -137
- package/dist/components/pro/Flow/nodes/aiClient.js.map +1 -1
- package/dist/components/pro/Flow/nodes/animAnchors.js +42 -49
- package/dist/components/pro/Flow/nodes/animAnchors.js.map +1 -1
- package/dist/components/pro/Flow/nodes/dataUtils.js +246 -267
- package/dist/components/pro/Flow/nodes/dataUtils.js.map +1 -1
- package/dist/components/pro/Flow/nodes/nodeUtils.js +23 -28
- package/dist/components/pro/Flow/nodes/nodeUtils.js.map +1 -1
- package/dist/components/pro/Flow/nodes/shapes.js +556 -591
- package/dist/components/pro/Flow/nodes/shapes.js.map +1 -1
- package/dist/components/pro/Flow/nodes/svgIconTexture.js +37 -39
- package/dist/components/pro/Flow/nodes/svgIconTexture.js.map +1 -1
- package/dist/components/pro/Flow/nodes/svgIcons.js +684 -689
- package/dist/components/pro/Flow/nodes/svgIcons.js.map +1 -1
- package/dist/components/pro/Flow/panels/AIPanel.js +464 -491
- package/dist/components/pro/Flow/panels/AIPanel.js.map +1 -1
- package/dist/components/pro/Flow/panels/Breadcrumb.js +41 -41
- package/dist/components/pro/Flow/panels/Breadcrumb.js.map +1 -1
- package/dist/components/pro/Flow/panels/ContextMenu.js +37 -37
- package/dist/components/pro/Flow/panels/ContextMenu.js.map +1 -1
- package/dist/components/pro/Flow/panels/DataInspectorSection.js +428 -432
- package/dist/components/pro/Flow/panels/DataInspectorSection.js.map +1 -1
- package/dist/components/pro/Flow/panels/ExpandableTextarea.js +61 -62
- package/dist/components/pro/Flow/panels/ExpandableTextarea.js.map +1 -1
- package/dist/components/pro/Flow/panels/FlowPanelGroup.js +114 -114
- package/dist/components/pro/Flow/panels/FlowPanelGroup.js.map +1 -1
- package/dist/components/pro/Flow/panels/FlowToolbar.js +347 -391
- package/dist/components/pro/Flow/panels/FlowToolbar.js.map +1 -1
- package/dist/components/pro/Flow/panels/InspectorPanel.js +1792 -1798
- package/dist/components/pro/Flow/panels/InspectorPanel.js.map +1 -1
- package/dist/components/pro/Flow/panels/OutlinePanel.js +242 -244
- package/dist/components/pro/Flow/panels/OutlinePanel.js.map +1 -1
- package/dist/components/pro/Flow/panels/PresentationMode.js +137 -138
- package/dist/components/pro/Flow/panels/PresentationMode.js.map +1 -1
- package/dist/components/pro/Flow/panels/ProjectTitle.js +46 -46
- package/dist/components/pro/Flow/panels/ProjectTitle.js.map +1 -1
- package/dist/components/pro/Flow/panels/ShapePalette.js +557 -567
- package/dist/components/pro/Flow/panels/ShapePalette.js.map +1 -1
- package/dist/components/pro/Flow/panels/toolbarIcons.d.ts +0 -1
- package/dist/components/pro/Flow/panels/toolbarIcons.js +508 -557
- package/dist/components/pro/Flow/panels/toolbarIcons.js.map +1 -1
- package/dist/components/pro/Flow/types.js +26 -26
- package/dist/components/pro/Flow/types.js.map +1 -1
- package/dist/components/pro/Flow/utils/dashedLine.js +113 -117
- package/dist/components/pro/Flow/utils/dashedLine.js.map +1 -1
- package/dist/components/pro/Flow/utils/gradient.js +55 -55
- package/dist/components/pro/Flow/utils/gradient.js.map +1 -1
- package/dist/components/pro/Flow/utils/pdfExport.js +50 -89
- package/dist/components/pro/Flow/utils/pdfExport.js.map +1 -1
- package/dist/components/pro/Flow/utils/themeColor.js +185 -195
- package/dist/components/pro/Flow/utils/themeColor.js.map +1 -1
- package/dist/components/pro/Gantt/Gantt.d.ts +7 -0
- package/dist/components/pro/Gantt/hooks/useGanttDrag.d.ts +31 -0
- package/dist/components/pro/Gantt/hooks/useGanttState.d.ts +58 -0
- package/dist/components/pro/Gantt/index.d.ts +6 -0
- package/dist/components/pro/Gantt/types.d.ts +478 -0
- package/dist/components/pro/Gantt/utils.d.ts +124 -0
- package/dist/components/pro/Resizable/Resizable.d.ts +30 -0
- package/dist/components/pro/Resizable/index.d.ts +2 -0
- package/dist/components/pro/RichTextEditor/AIRewrite.js +323 -334
- package/dist/components/pro/RichTextEditor/AIRewrite.js.map +1 -1
- package/dist/components/pro/RichTextEditor/BlockHandle.js +314 -316
- package/dist/components/pro/RichTextEditor/BlockHandle.js.map +1 -1
- package/dist/components/pro/RichTextEditor/BubbleToolbar.js +97 -97
- package/dist/components/pro/RichTextEditor/BubbleToolbar.js.map +1 -1
- package/dist/components/pro/RichTextEditor/CommentDialog.js +88 -88
- package/dist/components/pro/RichTextEditor/CommentDialog.js.map +1 -1
- package/dist/components/pro/RichTextEditor/CommentPanel.js +240 -240
- package/dist/components/pro/RichTextEditor/CommentPanel.js.map +1 -1
- package/dist/components/pro/RichTextEditor/CommentPopover.js +234 -234
- package/dist/components/pro/RichTextEditor/CommentPopover.js.map +1 -1
- package/dist/components/pro/RichTextEditor/ContextMenu.js +251 -252
- package/dist/components/pro/RichTextEditor/ContextMenu.js.map +1 -1
- package/dist/components/pro/RichTextEditor/RichTextEditor.js +267 -271
- package/dist/components/pro/RichTextEditor/RichTextEditor.js.map +1 -1
- package/dist/components/pro/RichTextEditor/SlashMenu.js +214 -214
- package/dist/components/pro/RichTextEditor/SlashMenu.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/ColorPicker.js +44 -75
- package/dist/components/pro/RichTextEditor/Toolbar/ColorPicker.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/FloatingDialogMenu.js +261 -261
- package/dist/components/pro/RichTextEditor/Toolbar/FloatingDialogMenu.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/MarkdownTemplates.js +172 -526
- package/dist/components/pro/RichTextEditor/Toolbar/MarkdownTemplates.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/SelectDropdown.js +112 -114
- package/dist/components/pro/RichTextEditor/Toolbar/SelectDropdown.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/TableOpsMenu.js +194 -194
- package/dist/components/pro/RichTextEditor/Toolbar/TableOpsMenu.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.js +970 -973
- package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.js.map +1 -1
- package/dist/components/pro/RichTextEditor/Toolbar/ToolbarButton.js +11 -12
- package/dist/components/pro/RichTextEditor/Toolbar/ToolbarButton.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/CodeBlockView.js +310 -344
- package/dist/components/pro/RichTextEditor/extensions/CodeBlockView.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/CommentMark.js +38 -39
- package/dist/components/pro/RichTextEditor/extensions/CommentMark.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/FloatingDialog.js +620 -625
- package/dist/components/pro/RichTextEditor/extensions/FloatingDialog.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/FontSize.js +25 -25
- package/dist/components/pro/RichTextEditor/extensions/FontSize.js.map +1 -1
- package/dist/components/pro/RichTextEditor/extensions/MarkdownBlock.js +167 -176
- package/dist/components/pro/RichTextEditor/extensions/MarkdownBlock.js.map +1 -1
- package/dist/components/pro/RichTextEditor/types.js +75 -75
- package/dist/components/pro/RichTextEditor/types.js.map +1 -1
- package/dist/contexts/AppContext.d.ts +1 -1
- package/dist/contexts/AppContext.js +216 -221
- package/dist/contexts/AppContext.js.map +1 -1
- package/dist/data-table.js +15 -41
- package/dist/data-table.js.map +1 -1
- package/dist/dishui.css +1 -1
- package/dist/flow.js +27 -83
- package/dist/hooks/useClickOutside.js +18 -18
- package/dist/hooks/useClickOutside.js.map +1 -1
- package/dist/hooks/useContainerElement.js +9 -9
- package/dist/hooks/useContainerElement.js.map +1 -1
- package/dist/hooks/useControllableState.js +33 -35
- package/dist/hooks/useControllableState.js.map +1 -1
- package/dist/hooks/useCopyToClipboard.js +16 -16
- package/dist/hooks/useCopyToClipboard.js.map +1 -1
- package/dist/hooks/useDebounce.js +14 -14
- package/dist/hooks/useDebounce.js.map +1 -1
- package/dist/hooks/useDraggable.js +50 -50
- package/dist/hooks/useDraggable.js.map +1 -1
- package/dist/hooks/useTableColumns.js +39 -42
- package/dist/hooks/useTableColumns.js.map +1 -1
- package/dist/hooks/useTableData.js +67 -68
- package/dist/hooks/useTableData.js.map +1 -1
- package/dist/index-nostyled.d.ts +8 -0
- package/dist/index.d.ts +29 -1
- package/dist/index.js +106 -236
- package/dist/layouts/MainLayout.js +56 -56
- package/dist/layouts/MainLayout.js.map +1 -1
- package/dist/layouts/Navbar.js +214 -214
- package/dist/layouts/Navbar.js.map +1 -1
- package/dist/layouts/Sidebar.js +184 -165
- package/dist/layouts/Sidebar.js.map +1 -1
- package/dist/layouts/headbar/Headbar.js +25 -25
- package/dist/layouts/headbar/Headbar.js.map +1 -1
- package/dist/layouts/headbar/HeadbarLangSwitcher.js +39 -39
- package/dist/layouts/headbar/HeadbarLangSwitcher.js.map +1 -1
- package/dist/layouts/headbar/HeadbarSearch.js +120 -120
- package/dist/layouts/headbar/HeadbarSearch.js.map +1 -1
- package/dist/layouts/headbar/HeadbarThemeSwitcher.js +27 -27
- package/dist/layouts/headbar/HeadbarThemeSwitcher.js.map +1 -1
- package/dist/layouts/headbar/HeadbarTitle.js +26 -26
- package/dist/layouts/headbar/HeadbarTitle.js.map +1 -1
- package/dist/lite.js +9 -24
- package/dist/markdown.js +4 -9
- package/dist/pages/components/Calendar/index.d.ts +3 -0
- package/dist/pages/components/Calendar/index.en.d.ts +3 -0
- package/dist/pages/components/Calendar/index.zh.d.ts +3 -0
- package/dist/pages/components/Chat/index.d.ts +3 -0
- package/dist/pages/components/Chat/index.en.d.ts +3 -0
- package/dist/pages/components/Chat/index.zh.d.ts +3 -0
- package/dist/pages/components/FloatWindow/index.d.ts +3 -0
- package/dist/pages/components/FloatWindow/index.en.d.ts +3 -0
- package/dist/pages/components/FloatWindow/index.zh.d.ts +3 -0
- package/dist/pages/components/Gantt/index.d.ts +3 -0
- package/dist/pages/components/Gantt/index.en.d.ts +3 -0
- package/dist/pages/components/Gantt/index.zh.d.ts +3 -0
- package/dist/pages/components/GridLayout/index.d.ts +3 -0
- package/dist/pages/components/GridLayout/index.en.d.ts +3 -0
- package/dist/pages/components/GridLayout/index.zh.d.ts +3 -0
- package/dist/pages/components/Notification/index.d.ts +3 -0
- package/dist/pages/components/Notification/index.en.d.ts +3 -0
- package/dist/pages/components/Notification/index.zh.d.ts +3 -0
- package/dist/pages/components/Resizable/index.d.ts +3 -0
- package/dist/pages/components/Resizable/index.en.d.ts +3 -0
- package/dist/pages/components/Resizable/index.zh.d.ts +3 -0
- package/dist/pages/components/Tab/index.d.ts +3 -0
- package/dist/pages/components/Tab/index.en.d.ts +3 -0
- package/dist/pages/components/Tab/index.zh.d.ts +3 -0
- package/dist/styles/themeStyles.js +87 -86
- package/dist/styles/themeStyles.js.map +1 -1
- package/dist/utils/cn.d.ts +13 -0
- package/dist/utils/cn.js +16 -0
- package/dist/utils/cn.js.map +1 -0
- package/dist/utils/i18n.js +690 -602
- package/dist/utils/i18n.js.map +1 -1
- package/dist/utils/menu.js +94 -94
- package/dist/utils/menu.js.map +1 -1
- package/dist/utils/rehype-code-meta.js +14 -14
- package/dist/utils/rehype-code-meta.js.map +1 -1
- package/dist/utils/remark-code-meta.js +9 -9
- package/dist/utils/remark-code-meta.js.map +1 -1
- package/dist/utils/routerBuilder.js +59 -58
- package/dist/utils/routerBuilder.js.map +1 -1
- package/dist/utils/selection.js +28 -29
- package/dist/utils/selection.js.map +1 -1
- package/dist/utils/themes.js +275 -255
- package/dist/utils/themes.js.map +1 -1
- package/package.json +23 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themes.js","names":[],"sources":["../../../../src/components/pro/CodeEditor/themes.ts"],"sourcesContent":["import { Extension } from '@codemirror/state';\nimport { EditorView } from '@codemirror/view';\nimport { HighlightStyle, syntaxHighlighting } from '@codemirror/language';\nimport { tags } from '@lezer/highlight';\nimport type { EditorTheme } from './types';\n\n// ============= 主题配置类型 =============\n\ninterface ThemeColors {\n background: string;\n foreground: string;\n caret: string;\n activeLine: string;\n selectionBackground: string;\n selectionOpacity: number;\n gutterBackground: string;\n gutterForeground: string;\n // 语法高亮\n keyword: string;\n atom: string;\n number: string;\n def: string;\n variable: string;\n variable2?: string;\n type?: string;\n property: string;\n operator: string;\n comment: string;\n string: string;\n meta: string;\n builtin: string;\n bracket: string;\n tag: string;\n attribute: string;\n link: string;\n error?: string;\n}\n\n// ============= 主题配置 =============\n\nconst themeConfigs: Record<string, { colors: ThemeColors; dark?: boolean }> = {\n light: {\n colors: {\n background: '#ffffff',\n foreground: '#000000',\n caret: '#000000',\n activeLine: 'rgba(0, 0, 0, 0.03)',\n selectionBackground: '#add6ff',\n selectionOpacity: 0.9,\n gutterBackground: '#f8f8f8',\n gutterForeground: '#999',\n keyword: '#0000ff',\n atom: '#219',\n number: '#164',\n def: '#00f',\n variable: '#05a',\n property: '#05a',\n operator: '#000',\n comment: '#708090',\n string: '#a11',\n meta: '#555',\n builtin: '#30a',\n bracket: '#997',\n tag: '#170',\n attribute: '#00c',\n link: '#00e',\n },\n },\n dark: {\n colors: {\n background: '#1e1e1e',\n foreground: '#e0e0e0',\n caret: '#ffffff',\n activeLine: 'rgba(255, 255, 255, 0.08)',\n selectionBackground: '#555555',\n selectionOpacity: 0.85,\n gutterBackground: '#252526',\n gutterForeground: '#858585',\n keyword: '#ff79c6',\n atom: '#bd93f9',\n number: '#ffb86c',\n def: '#50fa7b',\n variable: '#f8f8f2',\n variable2: '#f1fa8c',\n type: '#bd93f9',\n property: '#ffd580',\n operator: '#ff79c6',\n comment: '#6a9955',\n string: '#f1fa8c',\n meta: '#f8f8f2',\n builtin: '#bd93f9',\n bracket: '#f8f8f2',\n tag: '#ff79c6',\n attribute: '#50fa7b',\n link: '#ff79c6',\n error: '#ff5555',\n },\n dark: true,\n },\n retro: {\n colors: {\n background: '#2d1b00',\n foreground: '#f5deb3',\n caret: '#ffcc66',\n activeLine: 'rgba(255, 204, 102, 0.1)',\n selectionBackground: '#663300',\n selectionOpacity: 0.8,\n gutterBackground: '#1a0f00',\n gutterForeground: '#997755',\n keyword: '#ff9966',\n atom: '#ffcc99',\n number: '#cc9966',\n def: '#ffaa55',\n variable: '#f5deb3',\n property: '#f5deb3',\n operator: '#ff9966',\n comment: '#8b7355',\n string: '#ffcc66',\n meta: '#cc9966',\n builtin: '#ff9966',\n bracket: '#cc9966',\n tag: '#ff9966',\n attribute: '#ffcc66',\n link: '#ffcc99',\n },\n dark: true,\n },\n cyberpunk: {\n colors: {\n background: '#0d0221',\n foreground: '#f72585',\n caret: '#7209b7',\n activeLine: 'rgba(114, 9, 183, 0.15)',\n selectionBackground: '#3c096c',\n selectionOpacity: 0.8,\n gutterBackground: '#0a0118',\n gutterForeground: '#7209b7',\n keyword: '#f72585',\n atom: '#b5179e',\n number: '#7209b7',\n def: '#f72585',\n variable: '#ffffff',\n property: '#ffffff',\n operator: '#f72585',\n comment: '#560bad',\n string: '#b5179e',\n meta: '#7209b7',\n builtin: '#f72585',\n bracket: '#b5179e',\n tag: '#f72585',\n attribute: '#b5179e',\n link: '#b5179e',\n },\n dark: true,\n },\n matrix: {\n colors: {\n background: '#0d1117',\n foreground: '#00ff00',\n caret: '#00ff00',\n activeLine: 'rgba(0, 255, 0, 0.08)',\n selectionBackground: '#003300',\n selectionOpacity: 0.8,\n gutterBackground: '#0a0e11',\n gutterForeground: '#00aa00',\n keyword: '#00ff00',\n atom: '#00cc00',\n number: '#00ff00',\n def: '#00ff00',\n variable: '#00ee00',\n property: '#00ee00',\n operator: '#00ff00',\n comment: '#008800',\n string: '#00cc00',\n meta: '#00ff00',\n builtin: '#00ff00',\n bracket: '#00dd00',\n tag: '#00ff00',\n attribute: '#00cc00',\n link: '#00ff00',\n },\n dark: true,\n },\n oceanblue: {\n colors: {\n background: '#f0f9ff',\n foreground: '#0c4a6e',\n caret: '#0369a1',\n activeLine: 'rgba(3, 105, 161, 0.05)',\n selectionBackground: '#bae6fd',\n selectionOpacity: 0.9,\n gutterBackground: '#e0f2fe',\n gutterForeground: '#075985',\n keyword: '#0369a1',\n atom: '#0891b2',\n number: '#0e7490',\n def: '#0369a1',\n variable: '#0c4a6e',\n property: '#0c4a6e',\n operator: '#0369a1',\n comment: '#64748b',\n string: '#0891b2',\n meta: '#475569',\n builtin: '#0369a1',\n bracket: '#334155',\n tag: '#0369a1',\n attribute: '#0891b2',\n link: '#0284c7',\n },\n },\n eyecare: {\n colors: {\n background: '#f5f8e8',\n foreground: '#2d4a2b',\n caret: '#4a7c59',\n activeLine: 'rgba(74, 124, 89, 0.06)',\n selectionBackground: '#d4e5d4',\n selectionOpacity: 0.9,\n gutterBackground: '#eef3dc',\n gutterForeground: '#5a8a5f',\n keyword: '#4a7c59',\n atom: '#5a8a5f',\n number: '#6b9b6f',\n def: '#4a7c59',\n variable: '#2d4a2b',\n property: '#2d4a2b',\n operator: '#4a7c59',\n comment: '#7a9d7e',\n string: '#5a8a5f',\n meta: '#5a7a5a',\n builtin: '#4a7c59',\n bracket: '#5a7a5a',\n tag: '#4a7c59',\n attribute: '#5a8a5f',\n link: '#4a7c59',\n },\n },\n ghibli: {\n colors: {\n background: '#fdfbf7',\n foreground: '#5c4a3c',\n caret: '#8b6f4e',\n activeLine: 'rgba(139, 111, 78, 0.05)',\n selectionBackground: '#f0e5d8',\n selectionOpacity: 0.9,\n gutterBackground: '#f7f2ea',\n gutterForeground: '#9b8b78',\n keyword: '#8b6f4e',\n atom: '#a67c52',\n number: '#7ea8a0',\n def: '#8b6f4e',\n variable: '#5c4a3c',\n property: '#5c4a3c',\n operator: '#8b6f4e',\n comment: '#9b8b78',\n string: '#a67c52',\n meta: '#7a6a58',\n builtin: '#8b6f4e',\n bracket: '#7a6a58',\n tag: '#8b6f4e',\n attribute: '#a67c52',\n link: '#7ea8a0',\n },\n },\n pinkgirl: {\n colors: {\n background: '#fff5f7',\n foreground: '#be185d',\n caret: '#db2777',\n activeLine: 'rgba(219, 39, 119, 0.05)',\n selectionBackground: '#fce7f3',\n selectionOpacity: 0.9,\n gutterBackground: '#fef1f5',\n gutterForeground: '#db2777',\n keyword: '#db2777',\n atom: '#ec4899',\n number: '#f472b6',\n def: '#db2777',\n variable: '#be185d',\n property: '#be185d',\n operator: '#db2777',\n comment: '#f9a8d4',\n string: '#ec4899',\n meta: '#be185d',\n builtin: '#db2777',\n bracket: '#be185d',\n tag: '#db2777',\n attribute: '#ec4899',\n link: '#db2777',\n },\n },\n mintgirl: {\n colors: {\n background: '#f0fdf4',\n foreground: '#065f46',\n caret: '#059669',\n activeLine: 'rgba(5, 150, 105, 0.05)',\n selectionBackground: '#d1fae5',\n selectionOpacity: 0.9,\n gutterBackground: '#ecfdf5',\n gutterForeground: '#059669',\n keyword: '#059669',\n atom: '#10b981',\n number: '#34d399',\n def: '#059669',\n variable: '#065f46',\n property: '#065f46',\n operator: '#059669',\n comment: '#6ee7b7',\n string: '#10b981',\n meta: '#047857',\n builtin: '#059669',\n bracket: '#047857',\n tag: '#059669',\n attribute: '#10b981',\n link: '#059669',\n },\n },\n // 五行主题 - 中国传统五行配色\n // 金(白/金) 木(青/绿) 水(黑/蓝) 火(赤/红) 土(黄/棕)\n wuxing: {\n colors: {\n // 背景:米黄色纸张质感(土)\n background: '#f5f0e6',\n // 前景:深棕色(土)\n foreground: '#4a3728',\n // 光标:赤红色(火)\n caret: '#c94c4c',\n // 活跃行:淡黄(土生金)\n activeLine: 'rgba(200, 170, 100, 0.12)',\n // 选中背景:淡青色(木)\n selectionBackground: '#d4e5d8',\n selectionOpacity: 0.85,\n // 行号背景:浅米黄\n gutterBackground: '#ebe5d8',\n gutterForeground: '#8b7355',\n // 关键字:赤红色(火)\n keyword: '#c94c4c',\n // 原子:金色(金)\n atom: '#b8860b',\n // 数字:深蓝(水)\n number: '#2f5496',\n // 定义:青绿色(木)\n def: '#2e7d32',\n // 变量:深棕(土)\n variable: '#5c4033',\n // 属性:棕黄(土)\n property: '#8b6914',\n // 运算符:赤色(火)\n operator: '#b5533c',\n // 注释:灰蓝(水生木)\n comment: '#6b8e8e',\n // 字符串:青绿(木)\n string: '#3d7a5a',\n // 元信息:深棕\n meta: '#6b5344',\n // 内置:金橙(金生水)\n builtin: '#cd853f',\n // 括号:深灰蓝(水)\n bracket: '#4a6670',\n // 标签:赤色(火)\n tag: '#c94c4c',\n // 属性名:青色(木)\n attribute: '#2e8b57',\n // 链接:深蓝(水)\n link: '#2f5496',\n },\n },\n};\n\n// ============= 语法高亮样式创建器 =============\n\nconst createHighlightStyle = (colors: ThemeColors): HighlightStyle => {\n const specs: { tag: any; color?: string; fontStyle?: string; fontWeight?: string; textDecoration?: string }[] = [\n { tag: tags.keyword, color: colors.keyword },\n { tag: [tags.atom, tags.bool, tags.url, tags.contentSeparator, tags.labelName], color: colors.atom },\n { tag: [tags.literal, tags.inserted], color: colors.number },\n { tag: tags.number, color: colors.number },\n { tag: [tags.string, tags.deleted], color: colors.string },\n { tag: [tags.regexp, tags.escape, tags.special(tags.string)], color: colors.string },\n { tag: tags.definition(tags.variableName), color: colors.def },\n { tag: tags.local(tags.variableName), color: colors.variable },\n { tag: tags.variableName, color: colors.variable },\n { tag: [tags.typeName, tags.namespace], color: colors.type || colors.builtin },\n { tag: tags.className, color: colors.type || colors.def },\n { tag: [tags.special(tags.variableName), tags.macroName], color: colors.builtin },\n { tag: tags.definition(tags.propertyName), color: colors.property },\n { tag: tags.propertyName, color: colors.property },\n { tag: tags.comment, color: colors.comment, fontStyle: 'italic' },\n { tag: tags.meta, color: colors.meta },\n { tag: tags.operatorKeyword, color: colors.operator },\n { tag: tags.operator, color: colors.operator },\n { tag: tags.bracket, color: colors.bracket },\n { tag: tags.angleBracket, color: colors.bracket },\n { tag: tags.squareBracket, color: colors.bracket },\n { tag: tags.paren, color: colors.bracket },\n { tag: tags.brace, color: colors.bracket },\n { tag: tags.tagName, color: colors.tag },\n { tag: tags.attributeName, color: colors.attribute },\n { tag: tags.attributeValue, color: colors.string },\n { tag: tags.link, color: colors.link, textDecoration: 'underline' },\n { tag: tags.heading, color: colors.keyword, fontWeight: 'bold' },\n { tag: tags.emphasis, fontStyle: 'italic' },\n { tag: tags.strong, fontWeight: 'bold' },\n { tag: tags.strikethrough, textDecoration: 'line-through' },\n ];\n\n if (colors.error) {\n specs.push({ tag: tags.invalid, color: colors.error });\n }\n\n if (colors.variable2) {\n specs.push({ tag: tags.special(tags.variableName), color: colors.variable2 });\n }\n\n return HighlightStyle.define(specs);\n};\n\n// ============= 编辑器外观主题创建器 =============\n\nconst createEditorTheme = (config: { colors: ThemeColors; dark?: boolean }): Extension => {\n const { colors, dark } = config;\n\n const baseStyles: Record<string, any> = {\n '&': {\n backgroundColor: colors.background,\n color: colors.foreground,\n },\n '.cm-content': {\n caretColor: colors.caret,\n },\n '.cm-cursor, .cm-dropCursor': {\n borderLeftColor: colors.caret,\n },\n '.cm-activeLine': {\n backgroundColor: colors.activeLine,\n },\n '.cm-selectionLayer': {\n mixBlendMode: 'normal',\n pointerEvents: 'none',\n zIndex: 10,\n },\n '.cm-selectionLayer .cm-selectionBackground': {\n backgroundColor: colors.selectionBackground,\n opacity: colors.selectionOpacity,\n },\n '.cm-selectionBackground': {\n backgroundColor: colors.selectionBackground,\n opacity: colors.selectionOpacity,\n },\n '&.cm-focused .cm-selectionBackground': {\n backgroundColor: colors.selectionBackground,\n },\n '.cm-gutters': {\n backgroundColor: colors.gutterBackground,\n color: colors.gutterForeground,\n border: 'none',\n },\n };\n\n if (dark) {\n baseStyles['.cm-lineNumbers .cm-gutterElement'] = { color: colors.gutterForeground };\n }\n\n return EditorView.theme(baseStyles, { dark });\n};\n\n// ============= 缓存 =============\n\nconst editorThemeCache = new Map<EditorTheme, Extension>();\nconst highlightCache = new Map<EditorTheme, Extension>();\n\n/**\n * 创建编辑器外观主题(背景色、光标色等)\n * 放入 themeCompartment\n */\nexport const createThemeExtension = (theme: EditorTheme): Extension => {\n if (editorThemeCache.has(theme)) {\n return editorThemeCache.get(theme)!;\n }\n\n const config = themeConfigs[theme] || themeConfigs.light;\n const ext = createEditorTheme(config);\n editorThemeCache.set(theme, ext);\n return ext;\n};\n\n/**\n * 创建语法高亮扩展\n * 放入 highlightCompartment\n */\nexport const createHighlightExtension = (theme: EditorTheme): Extension => {\n if (highlightCache.has(theme)) {\n return highlightCache.get(theme)!;\n }\n\n const config = themeConfigs[theme] || themeConfigs.light;\n const hl = createHighlightStyle(config.colors);\n const ext = syntaxHighlighting(hl);\n highlightCache.set(theme, ext);\n return ext;\n};\n"],"mappings":";;;AAwCA,IAAM,IAAwE;AAAA,EAC5E,OAAO,EACL,QAAQ;AAAA,IACN,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,qBAAqB;AAAA,IACrB,kBAAkB;AAAA,IAClB,kBAAkB;AAAA,IAClB,kBAAkB;AAAA,IAClB,SAAS;AAAA,IACT,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,SAAS;AAAA,IACT,SAAS;AAAA,IACT,KAAK;AAAA,IACL,WAAW;AAAA,IACX,MAAM;AAAA,EACR,EACF;AAAA,EACA,MAAM;AAAA,IACJ,QAAQ;AAAA,MACN,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,OAAO;AAAA,MACP,YAAY;AAAA,MACZ,qBAAqB;AAAA,MACrB,kBAAkB;AAAA,MAClB,kBAAkB;AAAA,MAClB,kBAAkB;AAAA,MAClB,SAAS;AAAA,MACT,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,KAAK;AAAA,MACL,UAAU;AAAA,MACV,WAAW;AAAA,MACX,MAAM;AAAA,MACN,UAAU;AAAA,MACV,UAAU;AAAA,MACV,SAAS;AAAA,MACT,QAAQ;AAA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G,GACtB;AACT"}
|
|
1
|
+
{"version":3,"file":"themes.js","names":[],"sources":["../../../../src/components/pro/CodeEditor/themes.ts"],"sourcesContent":["import { Extension } from '@codemirror/state';\nimport { EditorView } from '@codemirror/view';\nimport { HighlightStyle, syntaxHighlighting } from '@codemirror/language';\nimport { tags } from '@lezer/highlight';\nimport type { EditorTheme } from './types';\n\n// ============= 主题配置类型 =============\n\ninterface ThemeColors {\n background: string;\n foreground: string;\n caret: string;\n activeLine: string;\n selectionBackground: string;\n selectionOpacity: number;\n gutterBackground: string;\n gutterForeground: string;\n // 语法高亮\n keyword: string;\n atom: string;\n number: string;\n def: string;\n variable: string;\n variable2?: string;\n type?: string;\n property: string;\n operator: string;\n comment: string;\n string: string;\n meta: string;\n builtin: string;\n bracket: string;\n tag: string;\n attribute: string;\n link: string;\n error?: string;\n}\n\n// ============= 主题配置 =============\n\nconst themeConfigs: Record<string, { colors: ThemeColors; dark?: boolean }> = {\n light: {\n colors: {\n background: '#ffffff',\n foreground: '#000000',\n caret: '#000000',\n activeLine: 'rgba(0, 0, 0, 0.03)',\n selectionBackground: '#add6ff',\n selectionOpacity: 0.9,\n gutterBackground: '#f8f8f8',\n gutterForeground: '#999',\n keyword: '#0000ff',\n atom: '#219',\n number: '#164',\n def: '#00f',\n variable: '#05a',\n property: '#05a',\n operator: '#000',\n comment: '#708090',\n string: '#a11',\n meta: '#555',\n builtin: '#30a',\n bracket: '#997',\n tag: '#170',\n attribute: '#00c',\n link: '#00e',\n },\n },\n dark: {\n colors: {\n background: '#1e1e1e',\n foreground: '#e0e0e0',\n caret: '#ffffff',\n activeLine: 'rgba(255, 255, 255, 0.08)',\n selectionBackground: '#555555',\n selectionOpacity: 0.85,\n gutterBackground: '#252526',\n gutterForeground: '#858585',\n keyword: '#ff79c6',\n atom: '#bd93f9',\n number: '#ffb86c',\n def: '#50fa7b',\n variable: '#f8f8f2',\n variable2: '#f1fa8c',\n type: '#bd93f9',\n property: '#ffd580',\n operator: '#ff79c6',\n comment: '#6a9955',\n string: '#f1fa8c',\n meta: '#f8f8f2',\n builtin: '#bd93f9',\n bracket: '#f8f8f2',\n tag: '#ff79c6',\n attribute: '#50fa7b',\n link: '#ff79c6',\n error: '#ff5555',\n },\n dark: true,\n },\n cursor: {\n // 参考 Cursor / VS Code 深色:冷调近黑背景、克制的语法配色\n colors: {\n background: '#171922',\n foreground: '#c5cad6',\n caret: '#60a5fa',\n activeLine: 'rgba(96, 165, 250, 0.08)',\n selectionBackground: '#2b3350',\n selectionOpacity: 0.9,\n gutterBackground: '#171922',\n gutterForeground: '#5a6172',\n keyword: '#8ab4f8',\n atom: '#c792ea',\n number: '#f6c177',\n def: '#82aaff',\n variable: '#c5cad6',\n variable2: '#9cdcfe',\n type: '#4ec9b0',\n property: '#9cdcfe',\n operator: '#89ddff',\n comment: '#6a7280',\n string: '#a5d6a7',\n meta: '#c5cad6',\n builtin: '#c792ea',\n bracket: '#c5cad6',\n tag: '#8ab4f8',\n attribute: '#c792ea',\n link: '#60a5fa',\n error: '#f7768e',\n },\n dark: true,\n },\n retro: {\n colors: {\n background: '#2d1b00',\n foreground: '#f5deb3',\n caret: '#ffcc66',\n activeLine: 'rgba(255, 204, 102, 0.1)',\n selectionBackground: '#663300',\n selectionOpacity: 0.8,\n gutterBackground: '#1a0f00',\n gutterForeground: '#997755',\n keyword: '#ff9966',\n atom: '#ffcc99',\n number: '#cc9966',\n def: '#ffaa55',\n variable: '#f5deb3',\n property: '#f5deb3',\n operator: '#ff9966',\n comment: '#8b7355',\n string: '#ffcc66',\n meta: '#cc9966',\n builtin: '#ff9966',\n bracket: '#cc9966',\n tag: '#ff9966',\n attribute: '#ffcc66',\n link: '#ffcc99',\n },\n dark: true,\n },\n cyberpunk: {\n colors: {\n background: '#0d0221',\n foreground: '#f72585',\n caret: '#7209b7',\n activeLine: 'rgba(114, 9, 183, 0.15)',\n selectionBackground: '#3c096c',\n selectionOpacity: 0.8,\n gutterBackground: '#0a0118',\n gutterForeground: '#7209b7',\n keyword: '#f72585',\n atom: '#b5179e',\n number: '#7209b7',\n def: '#f72585',\n variable: '#ffffff',\n property: '#ffffff',\n operator: '#f72585',\n comment: '#560bad',\n string: '#b5179e',\n meta: '#7209b7',\n builtin: '#f72585',\n bracket: '#b5179e',\n tag: '#f72585',\n attribute: '#b5179e',\n link: '#b5179e',\n },\n dark: true,\n },\n matrix: {\n colors: {\n background: '#0d1117',\n foreground: '#00ff00',\n caret: '#00ff00',\n activeLine: 'rgba(0, 255, 0, 0.08)',\n selectionBackground: '#003300',\n selectionOpacity: 0.8,\n gutterBackground: '#0a0e11',\n gutterForeground: '#00aa00',\n keyword: '#00ff00',\n atom: '#00cc00',\n number: '#00ff00',\n def: '#00ff00',\n variable: '#00ee00',\n property: '#00ee00',\n operator: '#00ff00',\n comment: '#008800',\n string: '#00cc00',\n meta: '#00ff00',\n builtin: '#00ff00',\n bracket: '#00dd00',\n tag: '#00ff00',\n attribute: '#00cc00',\n link: '#00ff00',\n },\n dark: true,\n },\n oceanblue: {\n colors: {\n background: '#f0f9ff',\n foreground: '#0c4a6e',\n caret: '#0369a1',\n activeLine: 'rgba(3, 105, 161, 0.05)',\n selectionBackground: '#bae6fd',\n selectionOpacity: 0.9,\n gutterBackground: '#e0f2fe',\n gutterForeground: '#075985',\n keyword: '#0369a1',\n atom: '#0891b2',\n number: '#0e7490',\n def: '#0369a1',\n variable: '#0c4a6e',\n property: '#0c4a6e',\n operator: '#0369a1',\n comment: '#64748b',\n string: '#0891b2',\n meta: '#475569',\n builtin: '#0369a1',\n bracket: '#334155',\n tag: '#0369a1',\n attribute: '#0891b2',\n link: '#0284c7',\n },\n },\n eyecare: {\n colors: {\n background: '#f5f8e8',\n foreground: '#2d4a2b',\n caret: '#4a7c59',\n activeLine: 'rgba(74, 124, 89, 0.06)',\n selectionBackground: '#d4e5d4',\n selectionOpacity: 0.9,\n gutterBackground: '#eef3dc',\n gutterForeground: '#5a8a5f',\n keyword: '#4a7c59',\n atom: '#5a8a5f',\n number: '#6b9b6f',\n def: '#4a7c59',\n variable: '#2d4a2b',\n property: '#2d4a2b',\n operator: '#4a7c59',\n comment: '#7a9d7e',\n string: '#5a8a5f',\n meta: '#5a7a5a',\n builtin: '#4a7c59',\n bracket: '#5a7a5a',\n tag: '#4a7c59',\n attribute: '#5a8a5f',\n link: '#4a7c59',\n },\n },\n ghibli: {\n colors: {\n background: '#fdfbf7',\n foreground: '#5c4a3c',\n caret: '#8b6f4e',\n activeLine: 'rgba(139, 111, 78, 0.05)',\n selectionBackground: '#f0e5d8',\n selectionOpacity: 0.9,\n gutterBackground: '#f7f2ea',\n gutterForeground: '#9b8b78',\n keyword: '#8b6f4e',\n atom: '#a67c52',\n number: '#7ea8a0',\n def: '#8b6f4e',\n variable: '#5c4a3c',\n property: '#5c4a3c',\n operator: '#8b6f4e',\n comment: '#9b8b78',\n string: '#a67c52',\n meta: '#7a6a58',\n builtin: '#8b6f4e',\n bracket: '#7a6a58',\n tag: '#8b6f4e',\n attribute: '#a67c52',\n link: '#7ea8a0',\n },\n },\n pinkgirl: {\n colors: {\n background: '#fff5f7',\n foreground: '#be185d',\n caret: '#db2777',\n activeLine: 'rgba(219, 39, 119, 0.05)',\n selectionBackground: '#fce7f3',\n selectionOpacity: 0.9,\n gutterBackground: '#fef1f5',\n gutterForeground: '#db2777',\n keyword: '#db2777',\n atom: '#ec4899',\n number: '#f472b6',\n def: '#db2777',\n variable: '#be185d',\n property: '#be185d',\n operator: '#db2777',\n comment: '#f9a8d4',\n string: '#ec4899',\n meta: '#be185d',\n builtin: '#db2777',\n bracket: '#be185d',\n tag: '#db2777',\n attribute: '#ec4899',\n link: '#db2777',\n },\n },\n mintgirl: {\n colors: {\n background: '#f0fdf4',\n foreground: '#065f46',\n caret: '#059669',\n activeLine: 'rgba(5, 150, 105, 0.05)',\n selectionBackground: '#d1fae5',\n selectionOpacity: 0.9,\n gutterBackground: '#ecfdf5',\n gutterForeground: '#059669',\n keyword: '#059669',\n atom: '#10b981',\n number: '#34d399',\n def: '#059669',\n variable: '#065f46',\n property: '#065f46',\n operator: '#059669',\n comment: '#6ee7b7',\n string: '#10b981',\n meta: '#047857',\n builtin: '#059669',\n bracket: '#047857',\n tag: '#059669',\n attribute: '#10b981',\n link: '#059669',\n },\n },\n // 五行主题 - 中国传统五行配色\n // 金(白/金) 木(青/绿) 水(黑/蓝) 火(赤/红) 土(黄/棕)\n wuxing: {\n colors: {\n // 背景:米黄色纸张质感(土)\n background: '#f5f0e6',\n // 前景:深棕色(土)\n foreground: '#4a3728',\n // 光标:赤红色(火)\n caret: '#c94c4c',\n // 活跃行:淡黄(土生金)\n activeLine: 'rgba(200, 170, 100, 0.12)',\n // 选中背景:淡青色(木)\n selectionBackground: '#d4e5d8',\n selectionOpacity: 0.85,\n // 行号背景:浅米黄\n gutterBackground: '#ebe5d8',\n gutterForeground: '#8b7355',\n // 关键字:赤红色(火)\n keyword: '#c94c4c',\n // 原子:金色(金)\n atom: '#b8860b',\n // 数字:深蓝(水)\n number: '#2f5496',\n // 定义:青绿色(木)\n def: '#2e7d32',\n // 变量:深棕(土)\n variable: '#5c4033',\n // 属性:棕黄(土)\n property: '#8b6914',\n // 运算符:赤色(火)\n operator: '#b5533c',\n // 注释:灰蓝(水生木)\n comment: '#6b8e8e',\n // 字符串:青绿(木)\n string: '#3d7a5a',\n // 元信息:深棕\n meta: '#6b5344',\n // 内置:金橙(金生水)\n builtin: '#cd853f',\n // 括号:深灰蓝(水)\n bracket: '#4a6670',\n // 标签:赤色(火)\n tag: '#c94c4c',\n // 属性名:青色(木)\n attribute: '#2e8b57',\n // 链接:深蓝(水)\n link: '#2f5496',\n },\n },\n};\n\n// ============= 语法高亮样式创建器 =============\n\nconst createHighlightStyle = (colors: ThemeColors): HighlightStyle => {\n const specs: { tag: any; color?: string; fontStyle?: string; fontWeight?: string; textDecoration?: string }[] = [\n { tag: tags.keyword, color: colors.keyword },\n { tag: [tags.atom, tags.bool, tags.url, tags.contentSeparator, tags.labelName], color: colors.atom },\n { tag: [tags.literal, tags.inserted], color: colors.number },\n { tag: tags.number, color: colors.number },\n { tag: [tags.string, tags.deleted], color: colors.string },\n { tag: [tags.regexp, tags.escape, tags.special(tags.string)], color: colors.string },\n { tag: tags.definition(tags.variableName), color: colors.def },\n { tag: tags.local(tags.variableName), color: colors.variable },\n { tag: tags.variableName, color: colors.variable },\n { tag: [tags.typeName, tags.namespace], color: colors.type || colors.builtin },\n { tag: tags.className, color: colors.type || colors.def },\n { tag: [tags.special(tags.variableName), tags.macroName], color: colors.builtin },\n { tag: tags.definition(tags.propertyName), color: colors.property },\n { tag: tags.propertyName, color: colors.property },\n { tag: tags.comment, color: colors.comment, fontStyle: 'italic' },\n { tag: tags.meta, color: colors.meta },\n { tag: tags.operatorKeyword, color: colors.operator },\n { tag: tags.operator, color: colors.operator },\n { tag: tags.bracket, color: colors.bracket },\n { tag: tags.angleBracket, color: colors.bracket },\n { tag: tags.squareBracket, color: colors.bracket },\n { tag: tags.paren, color: colors.bracket },\n { tag: tags.brace, color: colors.bracket },\n { tag: tags.tagName, color: colors.tag },\n { tag: tags.attributeName, color: colors.attribute },\n { tag: tags.attributeValue, color: colors.string },\n { tag: tags.link, color: colors.link, textDecoration: 'underline' },\n { tag: tags.heading, color: colors.keyword, fontWeight: 'bold' },\n { tag: tags.emphasis, fontStyle: 'italic' },\n { tag: tags.strong, fontWeight: 'bold' },\n { tag: tags.strikethrough, textDecoration: 'line-through' },\n ];\n\n if (colors.error) {\n specs.push({ tag: tags.invalid, color: colors.error });\n }\n\n if (colors.variable2) {\n specs.push({ tag: tags.special(tags.variableName), color: colors.variable2 });\n }\n\n return HighlightStyle.define(specs);\n};\n\n// ============= 编辑器外观主题创建器 =============\n\nconst createEditorTheme = (config: { colors: ThemeColors; dark?: boolean }): Extension => {\n const { colors, dark } = config;\n\n const baseStyles: Record<string, any> = {\n '&': {\n backgroundColor: colors.background,\n color: colors.foreground,\n },\n '.cm-content': {\n caretColor: colors.caret,\n },\n '.cm-cursor, .cm-dropCursor': {\n borderLeftColor: colors.caret,\n },\n '.cm-activeLine': {\n backgroundColor: colors.activeLine,\n },\n '.cm-selectionLayer': {\n mixBlendMode: 'normal',\n pointerEvents: 'none',\n zIndex: 10,\n },\n '.cm-selectionLayer .cm-selectionBackground': {\n backgroundColor: colors.selectionBackground,\n opacity: colors.selectionOpacity,\n },\n '.cm-selectionBackground': {\n backgroundColor: colors.selectionBackground,\n opacity: colors.selectionOpacity,\n },\n '&.cm-focused .cm-selectionBackground': {\n backgroundColor: colors.selectionBackground,\n },\n '.cm-gutters': {\n backgroundColor: colors.gutterBackground,\n color: colors.gutterForeground,\n border: 'none',\n },\n };\n\n if (dark) {\n baseStyles['.cm-lineNumbers .cm-gutterElement'] = { color: colors.gutterForeground };\n }\n\n return EditorView.theme(baseStyles, { dark });\n};\n\n// ============= 缓存 =============\n\nconst editorThemeCache = new Map<EditorTheme, Extension>();\nconst highlightCache = new Map<EditorTheme, Extension>();\n\n/**\n * 创建编辑器外观主题(背景色、光标色等)\n * 放入 themeCompartment\n */\nexport const createThemeExtension = (theme: EditorTheme): Extension => {\n if (editorThemeCache.has(theme)) {\n return editorThemeCache.get(theme)!;\n }\n\n const config = themeConfigs[theme] || themeConfigs.light;\n const ext = createEditorTheme(config);\n editorThemeCache.set(theme, ext);\n return ext;\n};\n\n/**\n * 创建语法高亮扩展\n * 放入 highlightCompartment\n */\nexport const createHighlightExtension = (theme: EditorTheme): Extension => {\n if (highlightCache.has(theme)) {\n return highlightCache.get(theme)!;\n }\n\n const config = themeConfigs[theme] || themeConfigs.light;\n const hl = createHighlightStyle(config.colors);\n const ext = syntaxHighlighting(hl);\n highlightCache.set(theme, ext);\n return ext;\n};\n"],"mappings":";;;;AAwCA,IAAM,IAAwE;CAC5E,OAAO,EACL,QAAQ;EACN,YAAY;EACZ,YAAY;EACZ,OAAO;EACP,YAAY;EACZ,qBAAqB;EACrB,kBAAkB;EAClB,kBAAkB;EAClB,kBAAkB;EAClB,SAAS;EACT,MA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wC,EACtC,iBAAiB,EAAO,oBAC1B;EACA,eAAe;GACb,iBAAiB,EAAO;GACxB,OAAO,EAAO;GACd,QAAQ;EACV;CACF;CAMA,OAJI,MACF,EAAW,uCAAuC,EAAE,OAAO,EAAO,iBAAiB,IAG9E,EAAW,MAAM,GAAY,EAAE,QAAK,CAAC;AAC9C,GAIM,oBAAmB,IAAI,IAA4B,GACnD,oBAAiB,IAAI,IAA4B,GAM1C,KAAwB,MAAkC;CACrE,IAAI,EAAiB,IAAI,CAAK,GAC5B,OAAO,EAAiB,IAAI,CAAK;CAInC,IAAM,IAAM,EADG,EAAa,MAAU,EAAa,KACf;CAEpC,OADA,EAAiB,IAAI,GAAO,CAAG,GACxB;AACT,GAMa,KAA4B,MAAkC;CACzE,IAAI,EAAe,IAAI,CAAK,GAC1B,OAAO,EAAe,IAAI,CAAK;CAIjC,IAAM,IAAK,GADI,EAAa,MAAU,EAAa,MACnB,CAAO,MAAM,GACvC,IAAM,EAAmB,CAAE;CAEjC,OADA,EAAe,IAAI,GAAO,CAAG,GACtB;AACT"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EditorView } from '@codemirror/view';
|
|
2
2
|
import { CompletionContext, CompletionResult, Completion } from '@codemirror/autocomplete';
|
|
3
3
|
export type LanguageType = 'javascript' | 'typescript' | 'python' | 'html' | 'css' | 'json' | 'markdown' | 'jsx' | 'tsx';
|
|
4
|
-
export type EditorTheme = 'light' | 'dark' | 'retro' | 'cyberpunk' | 'matrix' | 'oceanblue' | 'eyecare' | 'ghibli' | 'pinkgirl' | 'mintgirl' | 'wuxing' | 'jukebox';
|
|
4
|
+
export type EditorTheme = 'light' | 'dark' | 'cursor' | 'retro' | 'cyberpunk' | 'matrix' | 'oceanblue' | 'eyecare' | 'ghibli' | 'pinkgirl' | 'mintgirl' | 'wuxing' | 'jukebox';
|
|
5
5
|
export interface ContextMenuItem {
|
|
6
6
|
label: string;
|
|
7
7
|
action: (view: EditorView) => void;
|
|
@@ -1,178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
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
},
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
return s;
|
|
172
|
-
};
|
|
173
|
-
export {
|
|
174
|
-
Z as collectVariables,
|
|
175
|
-
z as generateOutline
|
|
1
|
+
//#region src/components/pro/CodeEditor/utils.ts
|
|
2
|
+
var e = (e, t) => {
|
|
3
|
+
let n = [], r = e.split("\n");
|
|
4
|
+
if (t === "javascript" || t === "typescript" || t === "jsx" || t === "tsx") r.forEach((e, t) => {
|
|
5
|
+
let r = e.trim(), i = /^class\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/.exec(r);
|
|
6
|
+
i && n.push({
|
|
7
|
+
name: i[1],
|
|
8
|
+
line: t + 1,
|
|
9
|
+
type: "class"
|
|
10
|
+
});
|
|
11
|
+
let a = /^(?:export\s+)?interface\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/.exec(r);
|
|
12
|
+
a && n.push({
|
|
13
|
+
name: a[1],
|
|
14
|
+
line: t + 1,
|
|
15
|
+
type: "interface"
|
|
16
|
+
});
|
|
17
|
+
let o = /^(?:export\s+)?type\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/.exec(r);
|
|
18
|
+
o && n.push({
|
|
19
|
+
name: o[1],
|
|
20
|
+
line: t + 1,
|
|
21
|
+
type: "type"
|
|
22
|
+
});
|
|
23
|
+
let s = /^(?:export\s+)?(?:async\s+)?function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/.exec(r);
|
|
24
|
+
s && n.push({
|
|
25
|
+
name: s[1],
|
|
26
|
+
line: t + 1,
|
|
27
|
+
type: "function"
|
|
28
|
+
});
|
|
29
|
+
let c = /^(?:export\s+)?const\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=\s*(?:\([^)]*\)|[a-zA-Z_$][a-zA-Z0-9_$]*)\s*=>/.exec(r);
|
|
30
|
+
if (c) {
|
|
31
|
+
n.push({
|
|
32
|
+
name: c[1],
|
|
33
|
+
line: t + 1,
|
|
34
|
+
type: "function"
|
|
35
|
+
});
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
let l = /^(?:export\s+)?const\s+([A-Z_$][A-Z0-9_$]*)\s*=/.exec(r);
|
|
39
|
+
if (l) {
|
|
40
|
+
n.push({
|
|
41
|
+
name: l[1],
|
|
42
|
+
line: t + 1,
|
|
43
|
+
type: "constant"
|
|
44
|
+
});
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
let u = /^(?:export\s+)?const\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/.exec(r);
|
|
48
|
+
if (u) {
|
|
49
|
+
n.push({
|
|
50
|
+
name: u[1],
|
|
51
|
+
line: t + 1,
|
|
52
|
+
type: "variable"
|
|
53
|
+
});
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
let d = /^(?:export\s+)?(?:let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/.exec(r);
|
|
57
|
+
if (d && n.push({
|
|
58
|
+
name: d[1],
|
|
59
|
+
line: t + 1,
|
|
60
|
+
type: "variable"
|
|
61
|
+
}), /^\s+(?:async\s+)?([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\([^)]*\)\s*[{:]/.test(e)) {
|
|
62
|
+
let r = /^\s+(?:async\s+)?([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/.exec(e);
|
|
63
|
+
r && ![
|
|
64
|
+
"if",
|
|
65
|
+
"for",
|
|
66
|
+
"while",
|
|
67
|
+
"switch",
|
|
68
|
+
"catch"
|
|
69
|
+
].includes(r[1]) && n.push({
|
|
70
|
+
name: r[1],
|
|
71
|
+
line: t + 1,
|
|
72
|
+
type: "method"
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
else if (t === "python") {
|
|
77
|
+
let e = !1;
|
|
78
|
+
r.forEach((t, r) => {
|
|
79
|
+
let i = t.trim();
|
|
80
|
+
if (!i || i.startsWith("#")) return;
|
|
81
|
+
let a = /^class\s+([a-zA-Z_][a-zA-Z0-9_]*)/.exec(i);
|
|
82
|
+
if (a) {
|
|
83
|
+
n.push({
|
|
84
|
+
name: a[1],
|
|
85
|
+
line: r + 1,
|
|
86
|
+
type: "class"
|
|
87
|
+
}), e = !0;
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
let o = /^def\s+([a-zA-Z_][a-zA-Z0-9_]*)/.exec(i);
|
|
91
|
+
if (o) {
|
|
92
|
+
let i = /^\s+def\s+/.test(t) && e;
|
|
93
|
+
n.push({
|
|
94
|
+
name: o[1],
|
|
95
|
+
line: r + 1,
|
|
96
|
+
type: i ? "method" : "function"
|
|
97
|
+
});
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
let s = /^([A-Z_][A-Z0-9_]*)\s*=/.exec(i);
|
|
101
|
+
if (s) {
|
|
102
|
+
n.push({
|
|
103
|
+
name: s[1],
|
|
104
|
+
line: r + 1,
|
|
105
|
+
type: "constant"
|
|
106
|
+
});
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
let c = /^([a-z_][a-zA-Z0-9_]*)\s*=/.exec(i);
|
|
110
|
+
if (c && !i.startsWith("def ") && !i.startsWith("class ")) {
|
|
111
|
+
n.push({
|
|
112
|
+
name: c[1],
|
|
113
|
+
line: r + 1,
|
|
114
|
+
type: "variable"
|
|
115
|
+
});
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
e && !t.startsWith(" ") && !t.startsWith(" ") && i && (e = !1);
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
return n;
|
|
122
|
+
}, t = (e, t) => {
|
|
123
|
+
let n = [], r = e.split("\n");
|
|
124
|
+
if (t === "javascript" || t === "typescript" || t === "jsx" || t === "tsx") {
|
|
125
|
+
let e = /(?:function|const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*[=]?\s*(?:\([^)]*\)|async\s*\([^)]*\))\s*(?:=>|{)/g, t = /class\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/g, i = /interface\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/g, a = /type\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/g;
|
|
126
|
+
r.forEach((r, o) => {
|
|
127
|
+
let s;
|
|
128
|
+
for (; (s = t.exec(r)) !== null;) n.push({
|
|
129
|
+
name: s[1],
|
|
130
|
+
line: o + 1,
|
|
131
|
+
type: "class",
|
|
132
|
+
children: []
|
|
133
|
+
});
|
|
134
|
+
for (; (s = i.exec(r)) !== null;) n.push({
|
|
135
|
+
name: s[1],
|
|
136
|
+
line: o + 1,
|
|
137
|
+
type: "interface"
|
|
138
|
+
});
|
|
139
|
+
for (; (s = a.exec(r)) !== null;) n.push({
|
|
140
|
+
name: s[1],
|
|
141
|
+
line: o + 1,
|
|
142
|
+
type: "type"
|
|
143
|
+
});
|
|
144
|
+
for (e.lastIndex = 0; (s = e.exec(r)) !== null;) n.push({
|
|
145
|
+
name: s[1],
|
|
146
|
+
line: o + 1,
|
|
147
|
+
type: "function"
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
} else if (t === "python") {
|
|
151
|
+
let e = /def\s+([a-zA-Z_][a-zA-Z0-9_]*)/g, t = /class\s+([a-zA-Z_][a-zA-Z0-9_]*)/g, i = null;
|
|
152
|
+
r.forEach((r, a) => {
|
|
153
|
+
let o;
|
|
154
|
+
if (t.lastIndex = 0, (o = t.exec(r)) !== null && (i = {
|
|
155
|
+
name: o[1],
|
|
156
|
+
line: a + 1,
|
|
157
|
+
type: "class",
|
|
158
|
+
children: []
|
|
159
|
+
}, n.push(i)), e.lastIndex = 0, (o = e.exec(r)) !== null) {
|
|
160
|
+
let e = {
|
|
161
|
+
name: o[1],
|
|
162
|
+
line: a + 1,
|
|
163
|
+
type: i && r.startsWith(" ") ? "method" : "function"
|
|
164
|
+
};
|
|
165
|
+
i && r.startsWith(" ") ? i.children?.push(e) : (n.push(e), i = null);
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
return n;
|
|
176
170
|
};
|
|
171
|
+
//#endregion
|
|
172
|
+
export { e as collectVariables, t as generateOutline };
|
|
177
173
|
|
|
178
174
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":[],"sources":["../../../../src/components/pro/CodeEditor/utils.ts"],"sourcesContent":["import type { VariableInfo, OutlineItem, LanguageType } from './types';\n\n// ============= 收集变量信息 =============\n\nexport const collectVariables = (code: string, language: LanguageType): VariableInfo[] => {\n const variables: VariableInfo[] = [];\n const lines = code.split('\\n');\n\n if (language === 'javascript' || language === 'typescript' || language === 'jsx' || language === 'tsx') {\n lines.forEach((line, index) => {\n const trimmedLine = line.trim();\n \n // Classes\n const classMatch = /^class\\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/.exec(trimmedLine);\n if (classMatch) {\n variables.push({\n name: classMatch[1],\n line: index + 1,\n type: 'class',\n });\n }\n\n // Interfaces (TypeScript)\n const interfaceMatch = /^(?:export\\s+)?interface\\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/.exec(trimmedLine);\n if (interfaceMatch) {\n variables.push({\n name: interfaceMatch[1],\n line: index + 1,\n type: 'interface',\n });\n }\n\n // Types (TypeScript)\n const typeMatch = /^(?:export\\s+)?type\\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\\s*=/.exec(trimmedLine);\n if (typeMatch) {\n variables.push({\n name: typeMatch[1],\n line: index + 1,\n type: 'type',\n });\n }\n\n // Functions\n const functionMatch = /^(?:export\\s+)?(?:async\\s+)?function\\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/.exec(trimmedLine);\n if (functionMatch) {\n variables.push({\n name: functionMatch[1],\n line: index + 1,\n type: 'function',\n });\n }\n\n // Arrow functions and constants\n const arrowFuncMatch = /^(?:export\\s+)?const\\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\\s*=\\s*(?:\\([^)]*\\)|[a-zA-Z_$][a-zA-Z0-9_$]*)\\s*=>/.exec(trimmedLine);\n if (arrowFuncMatch) {\n variables.push({\n name: arrowFuncMatch[1],\n line: index + 1,\n type: 'function',\n });\n return; // Don't process as constant\n }\n\n // Constants (const with uppercase or specific patterns)\n const constMatch = /^(?:export\\s+)?const\\s+([A-Z_$][A-Z0-9_$]*)\\s*=/.exec(trimmedLine);\n if (constMatch) {\n variables.push({\n name: constMatch[1],\n line: index + 1,\n type: 'constant',\n });\n return;\n }\n\n // Regular const variables\n const constVarMatch = /^(?:export\\s+)?const\\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\\s*=/.exec(trimmedLine);\n if (constVarMatch) {\n variables.push({\n name: constVarMatch[1],\n line: index + 1,\n type: 'variable',\n });\n return;\n }\n\n // Let and var\n const letVarMatch = /^(?:export\\s+)?(?:let|var)\\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/.exec(trimmedLine);\n if (letVarMatch) {\n variables.push({\n name: letVarMatch[1],\n line: index + 1,\n type: 'variable',\n });\n }\n\n // Methods in classes (simplified detection)\n if (/^\\s+(?:async\\s+)?([a-zA-Z_$][a-zA-Z0-9_$]*)\\s*\\([^)]*\\)\\s*[{:]/.test(line)) {\n const methodMatch = /^\\s+(?:async\\s+)?([a-zA-Z_$][a-zA-Z0-9_$]*)\\s*\\(/.exec(line);\n if (methodMatch && !['if', 'for', 'while', 'switch', 'catch'].includes(methodMatch[1])) {\n variables.push({\n name: methodMatch[1],\n line: index + 1,\n type: 'method',\n });\n }\n }\n });\n } else if (language === 'python') {\n let inClass = false;\n lines.forEach((line, index) => {\n const trimmedLine = line.trim();\n \n // Skip empty lines and comments\n if (!trimmedLine || trimmedLine.startsWith('#')) {\n return;\n }\n\n // Classes\n const classMatch = /^class\\s+([a-zA-Z_][a-zA-Z0-9_]*)/.exec(trimmedLine);\n if (classMatch) {\n variables.push({\n name: classMatch[1],\n line: index + 1,\n type: 'class',\n });\n inClass = true;\n return;\n }\n\n // Functions/Methods\n const defMatch = /^def\\s+([a-zA-Z_][a-zA-Z0-9_]*)/.exec(trimmedLine);\n if (defMatch) {\n // Check if it's a method by looking at indentation\n const isMethod = /^\\s+def\\s+/.test(line) && inClass;\n variables.push({\n name: defMatch[1],\n line: index + 1,\n type: isMethod ? 'method' : 'function',\n });\n return;\n }\n\n // Constants (uppercase variables)\n const constMatch = /^([A-Z_][A-Z0-9_]*)\\s*=/.exec(trimmedLine);\n if (constMatch) {\n variables.push({\n name: constMatch[1],\n line: index + 1,\n type: 'constant',\n });\n return;\n }\n\n // Regular variables (at module level or in functions)\n const varMatch = /^([a-z_][a-zA-Z0-9_]*)\\s*=/.exec(trimmedLine);\n if (varMatch && !trimmedLine.startsWith('def ') && !trimmedLine.startsWith('class ')) {\n variables.push({\n name: varMatch[1],\n line: index + 1,\n type: 'variable',\n });\n return;\n }\n\n // Reset class context on dedent (non-indented line that's not def/class)\n if (inClass && !line.startsWith(' ') && !line.startsWith('\\t') && trimmedLine) {\n inClass = false;\n }\n });\n }\n\n return variables;\n};\n\n// ============= 生成大纲 =============\n\nexport const generateOutline = (code: string, language: LanguageType): OutlineItem[] => {\n const outline: OutlineItem[] = [];\n const lines = code.split('\\n');\n\n if (language === 'javascript' || language === 'typescript' || language === 'jsx' || language === 'tsx') {\n const functionRegex = /(?:function|const|let|var)\\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\\s*[=]?\\s*(?:\\([^)]*\\)|async\\s*\\([^)]*\\))\\s*(?:=>|{)/g;\n const classRegex = /class\\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/g;\n const interfaceRegex = /interface\\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/g;\n const typeRegex = /type\\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/g;\n\n lines.forEach((line, index) => {\n let match;\n \n // 类\n while ((match = classRegex.exec(line)) !== null) {\n outline.push({\n name: match[1],\n line: index + 1,\n type: 'class',\n children: [],\n });\n }\n\n // 接口\n while ((match = interfaceRegex.exec(line)) !== null) {\n outline.push({\n name: match[1],\n line: index + 1,\n type: 'interface',\n });\n }\n\n // 类型\n while ((match = typeRegex.exec(line)) !== null) {\n outline.push({\n name: match[1],\n line: index + 1,\n type: 'type',\n });\n }\n\n // 函数\n functionRegex.lastIndex = 0;\n while ((match = functionRegex.exec(line)) !== null) {\n outline.push({\n name: match[1],\n line: index + 1,\n type: 'function',\n });\n }\n });\n } else if (language === 'python') {\n const defRegex = /def\\s+([a-zA-Z_][a-zA-Z0-9_]*)/g;\n const classRegex = /class\\s+([a-zA-Z_][a-zA-Z0-9_]*)/g;\n\n let currentClass: OutlineItem | null = null;\n\n lines.forEach((line, index) => {\n let match;\n\n // 类\n classRegex.lastIndex = 0;\n if ((match = classRegex.exec(line)) !== null) {\n currentClass = {\n name: match[1],\n line: index + 1,\n type: 'class',\n children: [],\n };\n outline.push(currentClass);\n }\n\n // 函数/方法\n defRegex.lastIndex = 0;\n if ((match = defRegex.exec(line)) !== null) {\n const item: OutlineItem = {\n name: match[1],\n line: index + 1,\n type: currentClass && line.startsWith(' ') ? 'method' : 'function',\n };\n\n if (currentClass && line.startsWith(' ')) {\n currentClass.children?.push(item);\n } else {\n outline.push(item);\n currentClass = null;\n }\n }\n });\n }\n\n return outline;\n};\n\n"],"mappings":"AAIA,IAAa,IAAA,CAAoB,GAAc,MAA2C;AACxF,QAAM,IAA4B,CAAC,GAC7B,IAAQ,EAAK,MAAM;AAAA,CAAI;AAE7B,MAAI,MAAa,gBAAgB,MAAa,gBAAgB,MAAa,SAAS,MAAa,MAC/F,CAAA,EAAM,QAAA,CAAS,GAAM,MAAU;AAC7B,UAAM,IAAc,EAAK,KAAK,GAGxB,IAAa,sCAAsC,KAAK,CAAW;AACzE,IAAI,KACF,EAAU,KAAK;AAAA,MACb,MAAM,EAAW,CAAA;AAAA,MACjB,MAAM,IAAQ;AAAA,MACd,MAAM;AAAA,IACR,CAAC;AAIH,UAAM,IAAiB,wDAAwD,KAAK,CAAW;AAC/F,IAAI,KACF,EAAU,KAAK;AAAA,MACb,MAAM,EAAe,CAAA;AAAA,MACrB,MAAM,IAAQ;AAAA,MACd,MAAM;AAAA,IACR,CAAC;AAIH,UAAM,IAAY,uDAAuD,KAAK,CAAW;AACzF,IAAI,KACF,EAAU,KAAK;AAAA,MACb,MAAM,EAAU,CAAA;AAAA,MAChB,MAAM,IAAQ;AAAA,MACd,MAAM;AAAA,IACR,CAAC;AAIH,UAAM,IAAgB,oEAAoE,KAAK,CAAW;AAC1G,IAAI,KACF,EAAU,KAAK;AAAA,MACb,MAAM,EAAc,CAAA;AAAA,MACpB,MAAM,IAAQ;AAAA,MACd,MAAM;AAAA,IACR,CAAC;AAIH,UAAM,IAAiB,sGAAsG,KAAK,CAAW;AAC7I,QAAI,GAAgB;AAClB,MAAA,EAAU,KAA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U,KAAK,CAAI,KAEhC,EAAQ,KAAK,CAAI,GACjB,IAAe;AAAA,MAEnB;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["../../../../src/components/pro/CodeEditor/utils.ts"],"sourcesContent":["import type { VariableInfo, OutlineItem, LanguageType } from './types';\n\n// ============= 收集变量信息 =============\n\nexport const collectVariables = (code: string, language: LanguageType): VariableInfo[] => {\n const variables: VariableInfo[] = [];\n const lines = code.split('\\n');\n\n if (language === 'javascript' || language === 'typescript' || language === 'jsx' || language === 'tsx') {\n lines.forEach((line, index) => {\n const trimmedLine = line.trim();\n \n // Classes\n const classMatch = /^class\\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/.exec(trimmedLine);\n if (classMatch) {\n variables.push({\n name: classMatch[1],\n line: index + 1,\n type: 'class',\n });\n }\n\n // Interfaces (TypeScript)\n const interfaceMatch = /^(?:export\\s+)?interface\\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/.exec(trimmedLine);\n if (interfaceMatch) {\n variables.push({\n name: interfaceMatch[1],\n line: index + 1,\n type: 'interface',\n });\n }\n\n // Types (TypeScript)\n const typeMatch = /^(?:export\\s+)?type\\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\\s*=/.exec(trimmedLine);\n if (typeMatch) {\n variables.push({\n name: typeMatch[1],\n line: index + 1,\n type: 'type',\n });\n }\n\n // Functions\n const functionMatch = /^(?:export\\s+)?(?:async\\s+)?function\\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/.exec(trimmedLine);\n if (functionMatch) {\n variables.push({\n name: functionMatch[1],\n line: index + 1,\n type: 'function',\n });\n }\n\n // Arrow functions and constants\n const arrowFuncMatch = /^(?:export\\s+)?const\\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\\s*=\\s*(?:\\([^)]*\\)|[a-zA-Z_$][a-zA-Z0-9_$]*)\\s*=>/.exec(trimmedLine);\n if (arrowFuncMatch) {\n variables.push({\n name: arrowFuncMatch[1],\n line: index + 1,\n type: 'function',\n });\n return; // Don't process as constant\n }\n\n // Constants (const with uppercase or specific patterns)\n const constMatch = /^(?:export\\s+)?const\\s+([A-Z_$][A-Z0-9_$]*)\\s*=/.exec(trimmedLine);\n if (constMatch) {\n variables.push({\n name: constMatch[1],\n line: index + 1,\n type: 'constant',\n });\n return;\n }\n\n // Regular const variables\n const constVarMatch = /^(?:export\\s+)?const\\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\\s*=/.exec(trimmedLine);\n if (constVarMatch) {\n variables.push({\n name: constVarMatch[1],\n line: index + 1,\n type: 'variable',\n });\n return;\n }\n\n // Let and var\n const letVarMatch = /^(?:export\\s+)?(?:let|var)\\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/.exec(trimmedLine);\n if (letVarMatch) {\n variables.push({\n name: letVarMatch[1],\n line: index + 1,\n type: 'variable',\n });\n }\n\n // Methods in classes (simplified detection)\n if (/^\\s+(?:async\\s+)?([a-zA-Z_$][a-zA-Z0-9_$]*)\\s*\\([^)]*\\)\\s*[{:]/.test(line)) {\n const methodMatch = /^\\s+(?:async\\s+)?([a-zA-Z_$][a-zA-Z0-9_$]*)\\s*\\(/.exec(line);\n if (methodMatch && !['if', 'for', 'while', 'switch', 'catch'].includes(methodMatch[1])) {\n variables.push({\n name: methodMatch[1],\n line: index + 1,\n type: 'method',\n });\n }\n }\n });\n } else if (language === 'python') {\n let inClass = false;\n lines.forEach((line, index) => {\n const trimmedLine = line.trim();\n \n // Skip empty lines and comments\n if (!trimmedLine || trimmedLine.startsWith('#')) {\n return;\n }\n\n // Classes\n const classMatch = /^class\\s+([a-zA-Z_][a-zA-Z0-9_]*)/.exec(trimmedLine);\n if (classMatch) {\n variables.push({\n name: classMatch[1],\n line: index + 1,\n type: 'class',\n });\n inClass = true;\n return;\n }\n\n // Functions/Methods\n const defMatch = /^def\\s+([a-zA-Z_][a-zA-Z0-9_]*)/.exec(trimmedLine);\n if (defMatch) {\n // Check if it's a method by looking at indentation\n const isMethod = /^\\s+def\\s+/.test(line) && inClass;\n variables.push({\n name: defMatch[1],\n line: index + 1,\n type: isMethod ? 'method' : 'function',\n });\n return;\n }\n\n // Constants (uppercase variables)\n const constMatch = /^([A-Z_][A-Z0-9_]*)\\s*=/.exec(trimmedLine);\n if (constMatch) {\n variables.push({\n name: constMatch[1],\n line: index + 1,\n type: 'constant',\n });\n return;\n }\n\n // Regular variables (at module level or in functions)\n const varMatch = /^([a-z_][a-zA-Z0-9_]*)\\s*=/.exec(trimmedLine);\n if (varMatch && !trimmedLine.startsWith('def ') && !trimmedLine.startsWith('class ')) {\n variables.push({\n name: varMatch[1],\n line: index + 1,\n type: 'variable',\n });\n return;\n }\n\n // Reset class context on dedent (non-indented line that's not def/class)\n if (inClass && !line.startsWith(' ') && !line.startsWith('\\t') && trimmedLine) {\n inClass = false;\n }\n });\n }\n\n return variables;\n};\n\n// ============= 生成大纲 =============\n\nexport const generateOutline = (code: string, language: LanguageType): OutlineItem[] => {\n const outline: OutlineItem[] = [];\n const lines = code.split('\\n');\n\n if (language === 'javascript' || language === 'typescript' || language === 'jsx' || language === 'tsx') {\n const functionRegex = /(?:function|const|let|var)\\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\\s*[=]?\\s*(?:\\([^)]*\\)|async\\s*\\([^)]*\\))\\s*(?:=>|{)/g;\n const classRegex = /class\\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/g;\n const interfaceRegex = /interface\\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/g;\n const typeRegex = /type\\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/g;\n\n lines.forEach((line, index) => {\n let match;\n \n // 类\n while ((match = classRegex.exec(line)) !== null) {\n outline.push({\n name: match[1],\n line: index + 1,\n type: 'class',\n children: [],\n });\n }\n\n // 接口\n while ((match = interfaceRegex.exec(line)) !== null) {\n outline.push({\n name: match[1],\n line: index + 1,\n type: 'interface',\n });\n }\n\n // 类型\n while ((match = typeRegex.exec(line)) !== null) {\n outline.push({\n name: match[1],\n line: index + 1,\n type: 'type',\n });\n }\n\n // 函数\n functionRegex.lastIndex = 0;\n while ((match = functionRegex.exec(line)) !== null) {\n outline.push({\n name: match[1],\n line: index + 1,\n type: 'function',\n });\n }\n });\n } else if (language === 'python') {\n const defRegex = /def\\s+([a-zA-Z_][a-zA-Z0-9_]*)/g;\n const classRegex = /class\\s+([a-zA-Z_][a-zA-Z0-9_]*)/g;\n\n let currentClass: OutlineItem | null = null;\n\n lines.forEach((line, index) => {\n let match;\n\n // 类\n classRegex.lastIndex = 0;\n if ((match = classRegex.exec(line)) !== null) {\n currentClass = {\n name: match[1],\n line: index + 1,\n type: 'class',\n children: [],\n };\n outline.push(currentClass);\n }\n\n // 函数/方法\n defRegex.lastIndex = 0;\n if ((match = defRegex.exec(line)) !== null) {\n const item: OutlineItem = {\n name: match[1],\n line: index + 1,\n type: currentClass && line.startsWith(' ') ? 'method' : 'function',\n };\n\n if (currentClass && line.startsWith(' ')) {\n currentClass.children?.push(item);\n } else {\n outline.push(item);\n currentClass = null;\n }\n }\n });\n }\n\n return outline;\n};\n\n"],"mappings":";AAIA,IAAa,KAAoB,GAAc,MAA2C;CACxF,IAAM,IAA4B,CAAC,GAC7B,IAAQ,EAAK,MAAM,IAAI;CAE7B,IAAI,MAAa,gBAAgB,MAAa,gBAAgB,MAAa,SAAS,MAAa,OAC/F,EAAM,SAAS,GAAM,MAAU;EAC7B,IAAM,IAAc,EAAK,KAAK,GAGxB,IAAa,sCAAsC,KAAK,CAAW;EACzE,AAAI,KACF,EAAU,KAAK;GACb,MAAM,EAAW;GACjB,MAAM,IAAQ;GACd,MAAM;EACR,CAAC;EAIH,IAAM,IAAiB,wDAAwD,KAAK,CAAW;EAC/F,AAAI,KACF,EAAU,KAAK;GACb,MAAM,EAAe;GACrB,MAAM,IAAQ;GACd,MAAM;EACR,CAAC;EAIH,IAAM,IAAY,uDAAuD,KAAK,CAAW;EACzF,AAAI,KACF,EA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