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.
Files changed (504) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +10 -11
  2. package/dist/chart.js +12 -46
  3. package/dist/code-editor.js +16 -43
  4. package/dist/components/Badge/index.js +11 -13
  5. package/dist/components/Badge/index.js.map +1 -1
  6. package/dist/components/Button/index.js +62 -86
  7. package/dist/components/Button/index.js.map +1 -1
  8. package/dist/components/Card/index.d.ts +87 -0
  9. package/dist/components/Card/index.js +178 -44
  10. package/dist/components/Card/index.js.map +1 -1
  11. package/dist/components/Chart/Chart.js +25 -25
  12. package/dist/components/Chart/Chart.js.map +1 -1
  13. package/dist/components/Checkbox/index.js +57 -63
  14. package/dist/components/Checkbox/index.js.map +1 -1
  15. package/dist/components/ChoicePicker/index.d.ts +44 -0
  16. package/dist/components/ChoicePicker/index.js +81 -0
  17. package/dist/components/ChoicePicker/index.js.map +1 -0
  18. package/dist/components/Column/index.d.ts +28 -0
  19. package/dist/components/Column/index.js +30 -0
  20. package/dist/components/Column/index.js.map +1 -0
  21. package/dist/components/DateTimeInput/index.d.ts +44 -0
  22. package/dist/components/DateTimeInput/index.js +48 -0
  23. package/dist/components/DateTimeInput/index.js.map +1 -0
  24. package/dist/components/Demo/index.js +107 -107
  25. package/dist/components/Demo/index.js.map +1 -1
  26. package/dist/components/Divider/index.d.ts +20 -0
  27. package/dist/components/Divider/index.js +30 -0
  28. package/dist/components/Divider/index.js.map +1 -0
  29. package/dist/components/EmptyState/index.d.ts +4 -1
  30. package/dist/components/EmptyState/index.js +24 -24
  31. package/dist/components/EmptyState/index.js.map +1 -1
  32. package/dist/components/FileUploader/DropZone.js +134 -136
  33. package/dist/components/FileUploader/DropZone.js.map +1 -1
  34. package/dist/components/FileUploader/FileItem.js +159 -163
  35. package/dist/components/FileUploader/FileItem.js.map +1 -1
  36. package/dist/components/FileUploader/FileUploader.js +126 -127
  37. package/dist/components/FileUploader/FileUploader.js.map +1 -1
  38. package/dist/components/FileUploader/UploadQueue.js +62 -62
  39. package/dist/components/FileUploader/UploadQueue.js.map +1 -1
  40. package/dist/components/FloatWindow/index.d.ts +28 -0
  41. package/dist/components/GridLayout/index.d.ts +42 -0
  42. package/dist/components/Icon/index.d.ts +24 -0
  43. package/dist/components/Icon/index.js +26 -0
  44. package/dist/components/Icon/index.js.map +1 -0
  45. package/dist/components/Image/index.d.ts +33 -0
  46. package/dist/components/Image/index.js +44 -0
  47. package/dist/components/Image/index.js.map +1 -0
  48. package/dist/components/Input/index.js +196 -197
  49. package/dist/components/Input/index.js.map +1 -1
  50. package/dist/components/Label/index.js +62 -73
  51. package/dist/components/Label/index.js.map +1 -1
  52. package/dist/components/Layout/index.js +134 -139
  53. package/dist/components/Layout/index.js.map +1 -1
  54. package/dist/components/List/index.js +45 -43
  55. package/dist/components/List/index.js.map +1 -1
  56. package/dist/components/Markdown/Markdown.js +106 -103
  57. package/dist/components/Markdown/Markdown.js.map +1 -1
  58. package/dist/components/Markdown/codeThemes.js +24 -33
  59. package/dist/components/Markdown/codeThemes.js.map +1 -1
  60. package/dist/components/Markdown/markdownComponents.js +203 -208
  61. package/dist/components/Markdown/markdownComponents.js.map +1 -1
  62. package/dist/components/Markdown/parseCodeBlockMeta.js +22 -22
  63. package/dist/components/Markdown/parseCodeBlockMeta.js.map +1 -1
  64. package/dist/components/Markdown/useMarkdownSource.js +46 -46
  65. package/dist/components/Markdown/useMarkdownSource.js.map +1 -1
  66. package/dist/components/Markdown/useMarkmapRenderer.js +35 -36
  67. package/dist/components/Markdown/useMarkmapRenderer.js.map +1 -1
  68. package/dist/components/Markdown/useMermaidRenderer.js +41 -42
  69. package/dist/components/Markdown/useMermaidRenderer.js.map +1 -1
  70. package/dist/components/Modal/index.d.ts +7 -3
  71. package/dist/components/Modal/index.js +82 -70
  72. package/dist/components/Modal/index.js.map +1 -1
  73. package/dist/components/MultipleChoice/index.d.ts +44 -0
  74. package/dist/components/MultipleChoice/index.js +52 -0
  75. package/dist/components/MultipleChoice/index.js.map +1 -0
  76. package/dist/components/Notification/index.d.ts +17 -0
  77. package/dist/components/Page/index.d.ts +58 -0
  78. package/dist/components/Page/index.js +43 -0
  79. package/dist/components/Page/index.js.map +1 -0
  80. package/dist/components/PageHeader/index.js +28 -28
  81. package/dist/components/PageHeader/index.js.map +1 -1
  82. package/dist/components/ProtectedRoute/index.js +8 -9
  83. package/dist/components/ProtectedRoute/index.js.map +1 -1
  84. package/dist/components/Row/index.d.ts +28 -0
  85. package/dist/components/Row/index.js +30 -0
  86. package/dist/components/Row/index.js.map +1 -0
  87. package/dist/components/Select/index.js +251 -257
  88. package/dist/components/Select/index.js.map +1 -1
  89. package/dist/components/SidebarToggleButton/index.js +56 -59
  90. package/dist/components/SidebarToggleButton/index.js.map +1 -1
  91. package/dist/components/Slider/index.d.ts +39 -0
  92. package/dist/components/Slider/index.js +52 -0
  93. package/dist/components/Slider/index.js.map +1 -0
  94. package/dist/components/StatCard/index.d.ts +31 -1
  95. package/dist/components/StatCard/index.js +189 -58
  96. package/dist/components/StatCard/index.js.map +1 -1
  97. package/dist/components/Switch/index.d.ts +34 -0
  98. package/dist/components/Switch/index.js +55 -0
  99. package/dist/components/Switch/index.js.map +1 -0
  100. package/dist/components/Tab/index.d.ts +40 -0
  101. package/dist/components/Table/index.js +109 -103
  102. package/dist/components/Table/index.js.map +1 -1
  103. package/dist/components/Tabs/index.d.ts +19 -5
  104. package/dist/components/Tabs/index.js +30 -21
  105. package/dist/components/Tabs/index.js.map +1 -1
  106. package/dist/components/Text/index.d.ts +43 -0
  107. package/dist/components/Text/index.js +55 -0
  108. package/dist/components/Text/index.js.map +1 -0
  109. package/dist/components/Tooltip/index.d.ts +23 -0
  110. package/dist/components/Tooltip/index.js +34 -0
  111. package/dist/components/Tooltip/index.js.map +1 -0
  112. package/dist/components/Tree/Tree.js +205 -205
  113. package/dist/components/Tree/Tree.js.map +1 -1
  114. package/dist/components/pro/ArticleContextMenu/index.js +86 -87
  115. package/dist/components/pro/ArticleContextMenu/index.js.map +1 -1
  116. package/dist/components/pro/ArticleControl/ArticleControl2.js +250 -250
  117. package/dist/components/pro/ArticleControl/ArticleControl2.js.map +1 -1
  118. package/dist/components/pro/ArticleControl/buildHeadingTree.js +31 -32
  119. package/dist/components/pro/ArticleControl/buildHeadingTree.js.map +1 -1
  120. package/dist/components/pro/ArticleControl/useArticleToc.js +100 -102
  121. package/dist/components/pro/ArticleControl/useArticleToc.js.map +1 -1
  122. package/dist/components/pro/Calendar/Calendar.d.ts +10 -0
  123. package/dist/components/pro/Calendar/hooks/useCalendarDrag.d.ts +47 -0
  124. package/dist/components/pro/Calendar/hooks/useCalendarState.d.ts +56 -0
  125. package/dist/components/pro/Calendar/index.d.ts +7 -0
  126. package/dist/components/pro/Calendar/types.d.ts +151 -0
  127. package/dist/components/pro/Calendar/utils.d.ts +94 -0
  128. package/dist/components/pro/Chat/Chat.d.ts +6 -0
  129. package/dist/components/pro/Chat/index.d.ts +2 -0
  130. package/dist/components/pro/Chat/types.d.ts +84 -0
  131. package/dist/components/pro/CodeEditor/editors/CodeEditor.js +287 -320
  132. package/dist/components/pro/CodeEditor/editors/CodeEditor.js.map +1 -1
  133. package/dist/components/pro/CodeEditor/editors/MarkdownEditor.js +167 -221
  134. package/dist/components/pro/CodeEditor/editors/MarkdownEditor.js.map +1 -1
  135. package/dist/components/pro/CodeEditor/editors/markdownExtensions.js +594 -613
  136. package/dist/components/pro/CodeEditor/editors/markdownExtensions.js.map +1 -1
  137. package/dist/components/pro/CodeEditor/extensions/contextMenu.js +54 -55
  138. package/dist/components/pro/CodeEditor/extensions/contextMenu.js.map +1 -1
  139. package/dist/components/pro/CodeEditor/extensions/index.js +152 -160
  140. package/dist/components/pro/CodeEditor/extensions/index.js.map +1 -1
  141. package/dist/components/pro/CodeEditor/langs/index.js +7 -15
  142. package/dist/components/pro/CodeEditor/langs/index.js.map +1 -1
  143. package/dist/components/pro/CodeEditor/langs/javascript.js +11 -48
  144. package/dist/components/pro/CodeEditor/langs/javascript.js.map +1 -1
  145. package/dist/components/pro/CodeEditor/langs/python.js +4 -40
  146. package/dist/components/pro/CodeEditor/langs/python.js.map +1 -1
  147. package/dist/components/pro/CodeEditor/langs/snippets.js +118 -147
  148. package/dist/components/pro/CodeEditor/langs/snippets.js.map +1 -1
  149. package/dist/components/pro/CodeEditor/panels/FootnotePanel.js +153 -153
  150. package/dist/components/pro/CodeEditor/panels/FootnotePanel.js.map +1 -1
  151. package/dist/components/pro/CodeEditor/panels/HistoryPanel.js +180 -190
  152. package/dist/components/pro/CodeEditor/panels/HistoryPanel.js.map +1 -1
  153. package/dist/components/pro/CodeEditor/panels/OutlinePanel.js +130 -137
  154. package/dist/components/pro/CodeEditor/panels/OutlinePanel.js.map +1 -1
  155. package/dist/components/pro/CodeEditor/panels/TableOfContentsPanel.js +228 -242
  156. package/dist/components/pro/CodeEditor/panels/TableOfContentsPanel.js.map +1 -1
  157. package/dist/components/pro/CodeEditor/panels/VariablePanel.js +208 -248
  158. package/dist/components/pro/CodeEditor/panels/VariablePanel.js.map +1 -1
  159. package/dist/components/pro/CodeEditor/themes.js +513 -483
  160. package/dist/components/pro/CodeEditor/themes.js.map +1 -1
  161. package/dist/components/pro/CodeEditor/types.d.ts +1 -1
  162. package/dist/components/pro/CodeEditor/utils.js +171 -175
  163. package/dist/components/pro/CodeEditor/utils.js.map +1 -1
  164. package/dist/components/pro/DataTable/DataTable.js +305 -305
  165. package/dist/components/pro/DataTable/DataTable.js.map +1 -1
  166. package/dist/components/pro/DataTable/Filters.js +299 -314
  167. package/dist/components/pro/DataTable/Filters.js.map +1 -1
  168. package/dist/components/pro/DataTable/PivotPanel.js +203 -204
  169. package/dist/components/pro/DataTable/PivotPanel.js.map +1 -1
  170. package/dist/components/pro/DataTable/PivotView.js +142 -141
  171. package/dist/components/pro/DataTable/PivotView.js.map +1 -1
  172. package/dist/components/pro/DataTable/components/BulkActions.js +42 -42
  173. package/dist/components/pro/DataTable/components/BulkActions.js.map +1 -1
  174. package/dist/components/pro/DataTable/components/ColumnSelector.js +84 -84
  175. package/dist/components/pro/DataTable/components/ColumnSelector.js.map +1 -1
  176. package/dist/components/pro/DataTable/components/FilterBar.js +58 -58
  177. package/dist/components/pro/DataTable/components/FilterBar.js.map +1 -1
  178. package/dist/components/pro/DataTable/components/TableBody.js +93 -94
  179. package/dist/components/pro/DataTable/components/TableBody.js.map +1 -1
  180. package/dist/components/pro/DataTable/components/TableHeader.js +78 -78
  181. package/dist/components/pro/DataTable/components/TableHeader.js.map +1 -1
  182. package/dist/components/pro/DataTable/components/TablePagination.js +77 -77
  183. package/dist/components/pro/DataTable/components/TablePagination.js.map +1 -1
  184. package/dist/components/pro/DataTable/components/TableToolbar.js +40 -40
  185. package/dist/components/pro/DataTable/components/TableToolbar.js.map +1 -1
  186. package/dist/components/pro/DataTable/extension.js +5 -5
  187. package/dist/components/pro/DataTable/extension.js.map +1 -1
  188. package/dist/components/pro/DataTable/pivotEngine.js +84 -92
  189. package/dist/components/pro/DataTable/pivotEngine.js.map +1 -1
  190. package/dist/components/pro/DataTable/pivotExtension.js +93 -93
  191. package/dist/components/pro/DataTable/pivotExtension.js.map +1 -1
  192. package/dist/components/pro/DataTable/rowDetailExtension.js +30 -30
  193. package/dist/components/pro/DataTable/rowDetailExtension.js.map +1 -1
  194. package/dist/components/pro/DataTable/tanstack-table.js +45 -62
  195. package/dist/components/pro/DataTable/tanstack-table.js.map +1 -1
  196. package/dist/components/pro/DataTable/treeDataUtils.js +37 -48
  197. package/dist/components/pro/DataTable/treeDataUtils.js.map +1 -1
  198. package/dist/components/pro/DataTable/useColumnDragReorder.js +68 -68
  199. package/dist/components/pro/DataTable/useColumnDragReorder.js.map +1 -1
  200. package/dist/components/pro/DataTable/utils.js +156 -168
  201. package/dist/components/pro/DataTable/utils.js.map +1 -1
  202. package/dist/components/pro/FileExplorer/Breadcrumb.js +180 -180
  203. package/dist/components/pro/FileExplorer/Breadcrumb.js.map +1 -1
  204. package/dist/components/pro/FileExplorer/CreateDialog.js +78 -78
  205. package/dist/components/pro/FileExplorer/CreateDialog.js.map +1 -1
  206. package/dist/components/pro/FileExplorer/FileExplorer.js +202 -205
  207. package/dist/components/pro/FileExplorer/FileExplorer.js.map +1 -1
  208. package/dist/components/pro/FileExplorer/FileIcon.js +190 -190
  209. package/dist/components/pro/FileExplorer/FileIcon.js.map +1 -1
  210. package/dist/components/pro/FileExplorer/GridView.js +100 -100
  211. package/dist/components/pro/FileExplorer/GridView.js.map +1 -1
  212. package/dist/components/pro/FileExplorer/ListView.js +209 -209
  213. package/dist/components/pro/FileExplorer/ListView.js.map +1 -1
  214. package/dist/components/pro/FileExplorer/Toolbar.js +199 -199
  215. package/dist/components/pro/FileExplorer/Toolbar.js.map +1 -1
  216. package/dist/components/pro/Flow/Flow.js +920 -946
  217. package/dist/components/pro/Flow/Flow.js.map +1 -1
  218. package/dist/components/pro/Flow/FlowCanvas.js +1626 -1663
  219. package/dist/components/pro/Flow/FlowCanvas.js.map +1 -1
  220. package/dist/components/pro/Flow/archify/build.js +85 -94
  221. package/dist/components/pro/Flow/archify/build.js.map +1 -1
  222. package/dist/components/pro/Flow/archify/convert.js +512 -519
  223. package/dist/components/pro/Flow/archify/convert.js.map +1 -1
  224. package/dist/components/pro/Flow/archify/palette.js +87 -104
  225. package/dist/components/pro/Flow/archify/palette.js.map +1 -1
  226. package/dist/components/pro/Flow/archify/presets.js +34 -37
  227. package/dist/components/pro/Flow/archify/presets.js.map +1 -1
  228. package/dist/components/pro/Flow/archify/spec.js +7 -7
  229. package/dist/components/pro/Flow/archify/spec.js.map +1 -1
  230. package/dist/components/pro/Flow/canvas/AlignmentGuides.js +25 -25
  231. package/dist/components/pro/Flow/canvas/AlignmentGuides.js.map +1 -1
  232. package/dist/components/pro/Flow/canvas/GridRenderer.js +54 -55
  233. package/dist/components/pro/Flow/canvas/GridRenderer.js.map +1 -1
  234. package/dist/components/pro/Flow/canvas/MiniMapRenderer.js +54 -58
  235. package/dist/components/pro/Flow/canvas/MiniMapRenderer.js.map +1 -1
  236. package/dist/components/pro/Flow/canvas/PixiApp.js +105 -102
  237. package/dist/components/pro/Flow/canvas/PixiApp.js.map +1 -1
  238. package/dist/components/pro/Flow/canvas/SelectionOverlay.js +38 -38
  239. package/dist/components/pro/Flow/canvas/SelectionOverlay.js.map +1 -1
  240. package/dist/components/pro/Flow/canvas/ViewportContainer.js +117 -117
  241. package/dist/components/pro/Flow/canvas/ViewportContainer.js.map +1 -1
  242. package/dist/components/pro/Flow/constants.js +266 -278
  243. package/dist/components/pro/Flow/constants.js.map +1 -1
  244. package/dist/components/pro/Flow/context/FlowAIContext.js +27 -28
  245. package/dist/components/pro/Flow/context/FlowAIContext.js.map +1 -1
  246. package/dist/components/pro/Flow/context/FlowContext.js +60 -61
  247. package/dist/components/pro/Flow/context/FlowContext.js.map +1 -1
  248. package/dist/components/pro/Flow/context/FlowUIContext.js +115 -117
  249. package/dist/components/pro/Flow/context/FlowUIContext.js.map +1 -1
  250. package/dist/components/pro/Flow/edges/EdgeRenderer.js +135 -138
  251. package/dist/components/pro/Flow/edges/EdgeRenderer.js.map +1 -1
  252. package/dist/components/pro/Flow/edges/edgeMarkers.js +11 -14
  253. package/dist/components/pro/Flow/edges/edgeMarkers.js.map +1 -1
  254. package/dist/components/pro/Flow/edges/edgePaths.js +351 -367
  255. package/dist/components/pro/Flow/edges/edgePaths.js.map +1 -1
  256. package/dist/components/pro/Flow/hooks/useAlignmentGuides.js +49 -52
  257. package/dist/components/pro/Flow/hooks/useAlignmentGuides.js.map +1 -1
  258. package/dist/components/pro/Flow/hooks/useClipboard.js +154 -154
  259. package/dist/components/pro/Flow/hooks/useClipboard.js.map +1 -1
  260. package/dist/components/pro/Flow/hooks/useCompactMode.js +17 -17
  261. package/dist/components/pro/Flow/hooks/useCompactMode.js.map +1 -1
  262. package/dist/components/pro/Flow/hooks/useDeleteSelection.js +40 -40
  263. package/dist/components/pro/Flow/hooks/useDeleteSelection.js.map +1 -1
  264. package/dist/components/pro/Flow/hooks/useDraggablePanel.js +51 -51
  265. package/dist/components/pro/Flow/hooks/useDraggablePanel.js.map +1 -1
  266. package/dist/components/pro/Flow/hooks/useEdgeMutations.js +157 -157
  267. package/dist/components/pro/Flow/hooks/useEdgeMutations.js.map +1 -1
  268. package/dist/components/pro/Flow/hooks/useFlowImportExport.js +190 -201
  269. package/dist/components/pro/Flow/hooks/useFlowImportExport.js.map +1 -1
  270. package/dist/components/pro/Flow/hooks/useKeyboardShortcuts.js +32 -38
  271. package/dist/components/pro/Flow/hooks/useKeyboardShortcuts.js.map +1 -1
  272. package/dist/components/pro/Flow/hooks/useLayoutActions.js +172 -182
  273. package/dist/components/pro/Flow/hooks/useLayoutActions.js.map +1 -1
  274. package/dist/components/pro/Flow/hooks/useLineMutations.js +57 -57
  275. package/dist/components/pro/Flow/hooks/useLineMutations.js.map +1 -1
  276. package/dist/components/pro/Flow/hooks/useMindMap.js +229 -238
  277. package/dist/components/pro/Flow/hooks/useMindMap.js.map +1 -1
  278. package/dist/components/pro/Flow/hooks/useNodeMutations.js +102 -102
  279. package/dist/components/pro/Flow/hooks/useNodeMutations.js.map +1 -1
  280. package/dist/components/pro/Flow/hooks/usePdfExport.js +55 -56
  281. package/dist/components/pro/Flow/hooks/usePdfExport.js.map +1 -1
  282. package/dist/components/pro/Flow/hooks/usePixiApp.js +55 -57
  283. package/dist/components/pro/Flow/hooks/usePixiApp.js.map +1 -1
  284. package/dist/components/pro/Flow/hooks/useResizablePanel.js +31 -31
  285. package/dist/components/pro/Flow/hooks/useResizablePanel.js.map +1 -1
  286. package/dist/components/pro/Flow/hooks/useSelection.js +69 -69
  287. package/dist/components/pro/Flow/hooks/useSelection.js.map +1 -1
  288. package/dist/components/pro/Flow/hooks/useUndoRedo.js +27 -27
  289. package/dist/components/pro/Flow/hooks/useUndoRedo.js.map +1 -1
  290. package/dist/components/pro/Flow/hooks/useViewport.js +28 -28
  291. package/dist/components/pro/Flow/hooks/useViewport.js.map +1 -1
  292. package/dist/components/pro/Flow/lines/FreehandTool.js +63 -63
  293. package/dist/components/pro/Flow/lines/FreehandTool.js.map +1 -1
  294. package/dist/components/pro/Flow/lines/GeometricLineTool.js +80 -80
  295. package/dist/components/pro/Flow/lines/GeometricLineTool.js.map +1 -1
  296. package/dist/components/pro/Flow/lines/LineRenderer.js +88 -88
  297. package/dist/components/pro/Flow/lines/LineRenderer.js.map +1 -1
  298. package/dist/components/pro/Flow/lines/lineSmoothing.js +32 -34
  299. package/dist/components/pro/Flow/lines/lineSmoothing.js.map +1 -1
  300. package/dist/components/pro/Flow/nodes/DataNodeView.js +236 -222
  301. package/dist/components/pro/Flow/nodes/DataNodeView.js.map +1 -1
  302. package/dist/components/pro/Flow/nodes/MediaContent.js +236 -246
  303. package/dist/components/pro/Flow/nodes/MediaContent.js.map +1 -1
  304. package/dist/components/pro/Flow/nodes/MediaOverlay.js +63 -63
  305. package/dist/components/pro/Flow/nodes/MediaOverlay.js.map +1 -1
  306. package/dist/components/pro/Flow/nodes/Model3DView.js +111 -113
  307. package/dist/components/pro/Flow/nodes/Model3DView.js.map +1 -1
  308. package/dist/components/pro/Flow/nodes/NodeHandles.js +74 -80
  309. package/dist/components/pro/Flow/nodes/NodeHandles.js.map +1 -1
  310. package/dist/components/pro/Flow/nodes/NodeRenderer.js +303 -314
  311. package/dist/components/pro/Flow/nodes/NodeRenderer.js.map +1 -1
  312. package/dist/components/pro/Flow/nodes/NodeText.js +25 -29
  313. package/dist/components/pro/Flow/nodes/NodeText.js.map +1 -1
  314. package/dist/components/pro/Flow/nodes/aiClient.js +124 -137
  315. package/dist/components/pro/Flow/nodes/aiClient.js.map +1 -1
  316. package/dist/components/pro/Flow/nodes/animAnchors.js +42 -49
  317. package/dist/components/pro/Flow/nodes/animAnchors.js.map +1 -1
  318. package/dist/components/pro/Flow/nodes/dataUtils.js +246 -267
  319. package/dist/components/pro/Flow/nodes/dataUtils.js.map +1 -1
  320. package/dist/components/pro/Flow/nodes/nodeUtils.js +23 -28
  321. package/dist/components/pro/Flow/nodes/nodeUtils.js.map +1 -1
  322. package/dist/components/pro/Flow/nodes/shapes.js +556 -591
  323. package/dist/components/pro/Flow/nodes/shapes.js.map +1 -1
  324. package/dist/components/pro/Flow/nodes/svgIconTexture.js +37 -39
  325. package/dist/components/pro/Flow/nodes/svgIconTexture.js.map +1 -1
  326. package/dist/components/pro/Flow/nodes/svgIcons.js +684 -689
  327. package/dist/components/pro/Flow/nodes/svgIcons.js.map +1 -1
  328. package/dist/components/pro/Flow/panels/AIPanel.js +464 -491
  329. package/dist/components/pro/Flow/panels/AIPanel.js.map +1 -1
  330. package/dist/components/pro/Flow/panels/Breadcrumb.js +41 -41
  331. package/dist/components/pro/Flow/panels/Breadcrumb.js.map +1 -1
  332. package/dist/components/pro/Flow/panels/ContextMenu.js +37 -37
  333. package/dist/components/pro/Flow/panels/ContextMenu.js.map +1 -1
  334. package/dist/components/pro/Flow/panels/DataInspectorSection.js +428 -432
  335. package/dist/components/pro/Flow/panels/DataInspectorSection.js.map +1 -1
  336. package/dist/components/pro/Flow/panels/ExpandableTextarea.js +61 -62
  337. package/dist/components/pro/Flow/panels/ExpandableTextarea.js.map +1 -1
  338. package/dist/components/pro/Flow/panels/FlowPanelGroup.js +114 -114
  339. package/dist/components/pro/Flow/panels/FlowPanelGroup.js.map +1 -1
  340. package/dist/components/pro/Flow/panels/FlowToolbar.js +347 -391
  341. package/dist/components/pro/Flow/panels/FlowToolbar.js.map +1 -1
  342. package/dist/components/pro/Flow/panels/InspectorPanel.js +1792 -1798
  343. package/dist/components/pro/Flow/panels/InspectorPanel.js.map +1 -1
  344. package/dist/components/pro/Flow/panels/OutlinePanel.js +242 -244
  345. package/dist/components/pro/Flow/panels/OutlinePanel.js.map +1 -1
  346. package/dist/components/pro/Flow/panels/PresentationMode.js +137 -138
  347. package/dist/components/pro/Flow/panels/PresentationMode.js.map +1 -1
  348. package/dist/components/pro/Flow/panels/ProjectTitle.js +46 -46
  349. package/dist/components/pro/Flow/panels/ProjectTitle.js.map +1 -1
  350. package/dist/components/pro/Flow/panels/ShapePalette.js +557 -567
  351. package/dist/components/pro/Flow/panels/ShapePalette.js.map +1 -1
  352. package/dist/components/pro/Flow/panels/toolbarIcons.d.ts +0 -1
  353. package/dist/components/pro/Flow/panels/toolbarIcons.js +508 -557
  354. package/dist/components/pro/Flow/panels/toolbarIcons.js.map +1 -1
  355. package/dist/components/pro/Flow/types.js +26 -26
  356. package/dist/components/pro/Flow/types.js.map +1 -1
  357. package/dist/components/pro/Flow/utils/dashedLine.js +113 -117
  358. package/dist/components/pro/Flow/utils/dashedLine.js.map +1 -1
  359. package/dist/components/pro/Flow/utils/gradient.js +55 -55
  360. package/dist/components/pro/Flow/utils/gradient.js.map +1 -1
  361. package/dist/components/pro/Flow/utils/pdfExport.js +50 -89
  362. package/dist/components/pro/Flow/utils/pdfExport.js.map +1 -1
  363. package/dist/components/pro/Flow/utils/themeColor.js +185 -195
  364. package/dist/components/pro/Flow/utils/themeColor.js.map +1 -1
  365. package/dist/components/pro/Gantt/Gantt.d.ts +7 -0
  366. package/dist/components/pro/Gantt/hooks/useGanttDrag.d.ts +31 -0
  367. package/dist/components/pro/Gantt/hooks/useGanttState.d.ts +58 -0
  368. package/dist/components/pro/Gantt/index.d.ts +6 -0
  369. package/dist/components/pro/Gantt/types.d.ts +478 -0
  370. package/dist/components/pro/Gantt/utils.d.ts +124 -0
  371. package/dist/components/pro/Resizable/Resizable.d.ts +30 -0
  372. package/dist/components/pro/Resizable/index.d.ts +2 -0
  373. package/dist/components/pro/RichTextEditor/AIRewrite.js +323 -334
  374. package/dist/components/pro/RichTextEditor/AIRewrite.js.map +1 -1
  375. package/dist/components/pro/RichTextEditor/BlockHandle.js +314 -316
  376. package/dist/components/pro/RichTextEditor/BlockHandle.js.map +1 -1
  377. package/dist/components/pro/RichTextEditor/BubbleToolbar.js +97 -97
  378. package/dist/components/pro/RichTextEditor/BubbleToolbar.js.map +1 -1
  379. package/dist/components/pro/RichTextEditor/CommentDialog.js +88 -88
  380. package/dist/components/pro/RichTextEditor/CommentDialog.js.map +1 -1
  381. package/dist/components/pro/RichTextEditor/CommentPanel.js +240 -240
  382. package/dist/components/pro/RichTextEditor/CommentPanel.js.map +1 -1
  383. package/dist/components/pro/RichTextEditor/CommentPopover.js +234 -234
  384. package/dist/components/pro/RichTextEditor/CommentPopover.js.map +1 -1
  385. package/dist/components/pro/RichTextEditor/ContextMenu.js +251 -252
  386. package/dist/components/pro/RichTextEditor/ContextMenu.js.map +1 -1
  387. package/dist/components/pro/RichTextEditor/RichTextEditor.js +267 -271
  388. package/dist/components/pro/RichTextEditor/RichTextEditor.js.map +1 -1
  389. package/dist/components/pro/RichTextEditor/SlashMenu.js +214 -214
  390. package/dist/components/pro/RichTextEditor/SlashMenu.js.map +1 -1
  391. package/dist/components/pro/RichTextEditor/Toolbar/ColorPicker.js +44 -75
  392. package/dist/components/pro/RichTextEditor/Toolbar/ColorPicker.js.map +1 -1
  393. package/dist/components/pro/RichTextEditor/Toolbar/FloatingDialogMenu.js +261 -261
  394. package/dist/components/pro/RichTextEditor/Toolbar/FloatingDialogMenu.js.map +1 -1
  395. package/dist/components/pro/RichTextEditor/Toolbar/MarkdownTemplates.js +172 -526
  396. package/dist/components/pro/RichTextEditor/Toolbar/MarkdownTemplates.js.map +1 -1
  397. package/dist/components/pro/RichTextEditor/Toolbar/SelectDropdown.js +112 -114
  398. package/dist/components/pro/RichTextEditor/Toolbar/SelectDropdown.js.map +1 -1
  399. package/dist/components/pro/RichTextEditor/Toolbar/TableOpsMenu.js +194 -194
  400. package/dist/components/pro/RichTextEditor/Toolbar/TableOpsMenu.js.map +1 -1
  401. package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.js +970 -973
  402. package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.js.map +1 -1
  403. package/dist/components/pro/RichTextEditor/Toolbar/ToolbarButton.js +11 -12
  404. package/dist/components/pro/RichTextEditor/Toolbar/ToolbarButton.js.map +1 -1
  405. package/dist/components/pro/RichTextEditor/extensions/CodeBlockView.js +310 -344
  406. package/dist/components/pro/RichTextEditor/extensions/CodeBlockView.js.map +1 -1
  407. package/dist/components/pro/RichTextEditor/extensions/CommentMark.js +38 -39
  408. package/dist/components/pro/RichTextEditor/extensions/CommentMark.js.map +1 -1
  409. package/dist/components/pro/RichTextEditor/extensions/FloatingDialog.js +620 -625
  410. package/dist/components/pro/RichTextEditor/extensions/FloatingDialog.js.map +1 -1
  411. package/dist/components/pro/RichTextEditor/extensions/FontSize.js +25 -25
  412. package/dist/components/pro/RichTextEditor/extensions/FontSize.js.map +1 -1
  413. package/dist/components/pro/RichTextEditor/extensions/MarkdownBlock.js +167 -176
  414. package/dist/components/pro/RichTextEditor/extensions/MarkdownBlock.js.map +1 -1
  415. package/dist/components/pro/RichTextEditor/types.js +75 -75
  416. package/dist/components/pro/RichTextEditor/types.js.map +1 -1
  417. package/dist/contexts/AppContext.d.ts +1 -1
  418. package/dist/contexts/AppContext.js +216 -221
  419. package/dist/contexts/AppContext.js.map +1 -1
  420. package/dist/data-table.js +15 -41
  421. package/dist/data-table.js.map +1 -1
  422. package/dist/dishui.css +1 -1
  423. package/dist/flow.js +27 -83
  424. package/dist/hooks/useClickOutside.js +18 -18
  425. package/dist/hooks/useClickOutside.js.map +1 -1
  426. package/dist/hooks/useContainerElement.js +9 -9
  427. package/dist/hooks/useContainerElement.js.map +1 -1
  428. package/dist/hooks/useControllableState.js +33 -35
  429. package/dist/hooks/useControllableState.js.map +1 -1
  430. package/dist/hooks/useCopyToClipboard.js +16 -16
  431. package/dist/hooks/useCopyToClipboard.js.map +1 -1
  432. package/dist/hooks/useDebounce.js +14 -14
  433. package/dist/hooks/useDebounce.js.map +1 -1
  434. package/dist/hooks/useDraggable.js +50 -50
  435. package/dist/hooks/useDraggable.js.map +1 -1
  436. package/dist/hooks/useTableColumns.js +39 -42
  437. package/dist/hooks/useTableColumns.js.map +1 -1
  438. package/dist/hooks/useTableData.js +67 -68
  439. package/dist/hooks/useTableData.js.map +1 -1
  440. package/dist/index-nostyled.d.ts +8 -0
  441. package/dist/index.d.ts +29 -1
  442. package/dist/index.js +106 -236
  443. package/dist/layouts/MainLayout.js +56 -56
  444. package/dist/layouts/MainLayout.js.map +1 -1
  445. package/dist/layouts/Navbar.js +214 -214
  446. package/dist/layouts/Navbar.js.map +1 -1
  447. package/dist/layouts/Sidebar.js +184 -165
  448. package/dist/layouts/Sidebar.js.map +1 -1
  449. package/dist/layouts/headbar/Headbar.js +25 -25
  450. package/dist/layouts/headbar/Headbar.js.map +1 -1
  451. package/dist/layouts/headbar/HeadbarLangSwitcher.js +39 -39
  452. package/dist/layouts/headbar/HeadbarLangSwitcher.js.map +1 -1
  453. package/dist/layouts/headbar/HeadbarSearch.js +120 -120
  454. package/dist/layouts/headbar/HeadbarSearch.js.map +1 -1
  455. package/dist/layouts/headbar/HeadbarThemeSwitcher.js +27 -27
  456. package/dist/layouts/headbar/HeadbarThemeSwitcher.js.map +1 -1
  457. package/dist/layouts/headbar/HeadbarTitle.js +26 -26
  458. package/dist/layouts/headbar/HeadbarTitle.js.map +1 -1
  459. package/dist/lite.js +9 -24
  460. package/dist/markdown.js +4 -9
  461. package/dist/pages/components/Calendar/index.d.ts +3 -0
  462. package/dist/pages/components/Calendar/index.en.d.ts +3 -0
  463. package/dist/pages/components/Calendar/index.zh.d.ts +3 -0
  464. package/dist/pages/components/Chat/index.d.ts +3 -0
  465. package/dist/pages/components/Chat/index.en.d.ts +3 -0
  466. package/dist/pages/components/Chat/index.zh.d.ts +3 -0
  467. package/dist/pages/components/FloatWindow/index.d.ts +3 -0
  468. package/dist/pages/components/FloatWindow/index.en.d.ts +3 -0
  469. package/dist/pages/components/FloatWindow/index.zh.d.ts +3 -0
  470. package/dist/pages/components/Gantt/index.d.ts +3 -0
  471. package/dist/pages/components/Gantt/index.en.d.ts +3 -0
  472. package/dist/pages/components/Gantt/index.zh.d.ts +3 -0
  473. package/dist/pages/components/GridLayout/index.d.ts +3 -0
  474. package/dist/pages/components/GridLayout/index.en.d.ts +3 -0
  475. package/dist/pages/components/GridLayout/index.zh.d.ts +3 -0
  476. package/dist/pages/components/Notification/index.d.ts +3 -0
  477. package/dist/pages/components/Notification/index.en.d.ts +3 -0
  478. package/dist/pages/components/Notification/index.zh.d.ts +3 -0
  479. package/dist/pages/components/Resizable/index.d.ts +3 -0
  480. package/dist/pages/components/Resizable/index.en.d.ts +3 -0
  481. package/dist/pages/components/Resizable/index.zh.d.ts +3 -0
  482. package/dist/pages/components/Tab/index.d.ts +3 -0
  483. package/dist/pages/components/Tab/index.en.d.ts +3 -0
  484. package/dist/pages/components/Tab/index.zh.d.ts +3 -0
  485. package/dist/styles/themeStyles.js +87 -86
  486. package/dist/styles/themeStyles.js.map +1 -1
  487. package/dist/utils/cn.d.ts +13 -0
  488. package/dist/utils/cn.js +16 -0
  489. package/dist/utils/cn.js.map +1 -0
  490. package/dist/utils/i18n.js +690 -602
  491. package/dist/utils/i18n.js.map +1 -1
  492. package/dist/utils/menu.js +94 -94
  493. package/dist/utils/menu.js.map +1 -1
  494. package/dist/utils/rehype-code-meta.js +14 -14
  495. package/dist/utils/rehype-code-meta.js.map +1 -1
  496. package/dist/utils/remark-code-meta.js +9 -9
  497. package/dist/utils/remark-code-meta.js.map +1 -1
  498. package/dist/utils/routerBuilder.js +59 -58
  499. package/dist/utils/routerBuilder.js.map +1 -1
  500. package/dist/utils/selection.js +28 -29
  501. package/dist/utils/selection.js.map +1 -1
  502. package/dist/utils/themes.js +275 -255
  503. package/dist/utils/themes.js.map +1 -1
  504. 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;AAAA,MACR,MAAM;AAAA,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 {"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,MAAM;EACN,QAAQ;EACR,KAAK;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AC1B;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 +1,174 @@
1
- var Z = (f, l) => {
2
- const s = [], o = f.split(`
3
- `);
4
- if (l === "javascript" || l === "typescript" || l === "jsx" || l === "tsx") o.forEach((r, e) => {
5
- const t = r.trim(), a = /^class\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/.exec(t);
6
- a && s.push({
7
- name: a[1],
8
- line: e + 1,
9
- type: "class"
10
- });
11
- const i = /^(?:export\s+)?interface\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/.exec(t);
12
- i && s.push({
13
- name: i[1],
14
- line: e + 1,
15
- type: "interface"
16
- });
17
- const n = /^(?:export\s+)?type\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/.exec(t);
18
- n && s.push({
19
- name: n[1],
20
- line: e + 1,
21
- type: "type"
22
- });
23
- const c = /^(?:export\s+)?(?:async\s+)?function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/.exec(t);
24
- c && s.push({
25
- name: c[1],
26
- line: e + 1,
27
- type: "function"
28
- });
29
- const h = /^(?:export\s+)?const\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=\s*(?:\([^)]*\)|[a-zA-Z_$][a-zA-Z0-9_$]*)\s*=>/.exec(t);
30
- if (h) {
31
- s.push({
32
- name: h[1],
33
- line: e + 1,
34
- type: "function"
35
- });
36
- return;
37
- }
38
- const p = /^(?:export\s+)?const\s+([A-Z_$][A-Z0-9_$]*)\s*=/.exec(t);
39
- if (p) {
40
- s.push({
41
- name: p[1],
42
- line: e + 1,
43
- type: "constant"
44
- });
45
- return;
46
- }
47
- const _ = /^(?:export\s+)?const\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/.exec(t);
48
- if (_) {
49
- s.push({
50
- name: _[1],
51
- line: e + 1,
52
- type: "variable"
53
- });
54
- return;
55
- }
56
- const A = /^(?:export\s+)?(?:let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/.exec(t);
57
- if (A && s.push({
58
- name: A[1],
59
- line: e + 1,
60
- type: "variable"
61
- }), /^\s+(?:async\s+)?([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\([^)]*\)\s*[{:]/.test(r)) {
62
- const u = /^\s+(?:async\s+)?([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/.exec(r);
63
- u && ![
64
- "if",
65
- "for",
66
- "while",
67
- "switch",
68
- "catch"
69
- ].includes(u[1]) && s.push({
70
- name: u[1],
71
- line: e + 1,
72
- type: "method"
73
- });
74
- }
75
- });
76
- else if (l === "python") {
77
- let r = !1;
78
- o.forEach((e, t) => {
79
- const a = e.trim();
80
- if (!a || a.startsWith("#")) return;
81
- const i = /^class\s+([a-zA-Z_][a-zA-Z0-9_]*)/.exec(a);
82
- if (i) {
83
- s.push({
84
- name: i[1],
85
- line: t + 1,
86
- type: "class"
87
- }), r = !0;
88
- return;
89
- }
90
- const n = /^def\s+([a-zA-Z_][a-zA-Z0-9_]*)/.exec(a);
91
- if (n) {
92
- const p = /^\s+def\s+/.test(e) && r;
93
- s.push({
94
- name: n[1],
95
- line: t + 1,
96
- type: p ? "method" : "function"
97
- });
98
- return;
99
- }
100
- const c = /^([A-Z_][A-Z0-9_]*)\s*=/.exec(a);
101
- if (c) {
102
- s.push({
103
- name: c[1],
104
- line: t + 1,
105
- type: "constant"
106
- });
107
- return;
108
- }
109
- const h = /^([a-z_][a-zA-Z0-9_]*)\s*=/.exec(a);
110
- if (h && !a.startsWith("def ") && !a.startsWith("class ")) {
111
- s.push({
112
- name: h[1],
113
- line: t + 1,
114
- type: "variable"
115
- });
116
- return;
117
- }
118
- r && !e.startsWith(" ") && !e.startsWith(" ") && a && (r = !1);
119
- });
120
- }
121
- return s;
122
- }, z = (f, l) => {
123
- const s = [], o = f.split(`
124
- `);
125
- if (l === "javascript" || l === "typescript" || l === "jsx" || l === "tsx") {
126
- const r = /(?:function|const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*[=]?\s*(?:\([^)]*\)|async\s*\([^)]*\))\s*(?:=>|{)/g, e = /class\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/g, t = /interface\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/g, a = /type\s+([a-zA-Z_$][a-zA-Z0-9_$]*)/g;
127
- o.forEach((i, n) => {
128
- let c;
129
- for (; (c = e.exec(i)) !== null; ) s.push({
130
- name: c[1],
131
- line: n + 1,
132
- type: "class",
133
- children: []
134
- });
135
- for (; (c = t.exec(i)) !== null; ) s.push({
136
- name: c[1],
137
- line: n + 1,
138
- type: "interface"
139
- });
140
- for (; (c = a.exec(i)) !== null; ) s.push({
141
- name: c[1],
142
- line: n + 1,
143
- type: "type"
144
- });
145
- for (r.lastIndex = 0; (c = r.exec(i)) !== null; ) s.push({
146
- name: c[1],
147
- line: n + 1,
148
- type: "function"
149
- });
150
- });
151
- } else if (l === "python") {
152
- const r = /def\s+([a-zA-Z_][a-zA-Z0-9_]*)/g, e = /class\s+([a-zA-Z_][a-zA-Z0-9_]*)/g;
153
- let t = null;
154
- o.forEach((a, i) => {
155
- let n;
156
- if (e.lastIndex = 0, (n = e.exec(a)) !== null && (t = {
157
- name: n[1],
158
- line: i + 1,
159
- type: "class",
160
- children: []
161
- }, s.push(t)), r.lastIndex = 0, (n = r.exec(a)) !== null) {
162
- const c = {
163
- name: n[1],
164
- line: i + 1,
165
- type: t && a.startsWith(" ") ? "method" : "function"
166
- };
167
- t && a.startsWith(" ") ? t.children?.push(c) : (s.push(c), t = null);
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,KAAK;AAAA,QACb,MAAM,EAAe,CAAA;AAAA,QACrB,MAAM,IAAQ;AAAA,QACd,MAAM;AAAA,MACR,CAAC;AACD;AA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A,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,EAAU,KAAK;GACb,MAAM,EAAU;GAChB,MAAM,IAAQ;GACd,MAAM;EACR,CAAC;EAIH,IAAM,IAAgB,oEAAoE,KAAK,CAA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