king-design-analyzer 2.1.9 → 2.2.0

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 (305) hide show
  1. package/components/actions.json +101 -0
  2. package/components/advancedset.json +127 -0
  3. package/components/affix.json +7 -0
  4. package/components/aksk.json +172 -0
  5. package/components/az.json +15 -2
  6. package/components/badge.json +7 -0
  7. package/components/billtypes.json +14 -2
  8. package/components/breadcrumb.json +7 -0
  9. package/components/button.json +191 -0
  10. package/components/buttonlink.json +73 -0
  11. package/components/card.json +8 -1
  12. package/components/cardcol.json +142 -0
  13. package/components/cardcols.json +121 -0
  14. package/components/cardcontent.json +15 -3
  15. package/components/cardtabs.json +172 -0
  16. package/components/carousel.json +7 -0
  17. package/components/cascader.json +520 -368
  18. package/components/checkbox.json +51 -4
  19. package/components/cidrinput.json +140 -0
  20. package/components/code.json +8 -1
  21. package/components/collapse.json +7 -0
  22. package/components/colorpicker.json +217 -0
  23. package/components/copy.json +7 -0
  24. package/components/copyhover.json +111 -0
  25. package/components/copyrow.json +124 -0
  26. package/components/datepicker.json +656 -524
  27. package/components/description.json +98 -0
  28. package/components/dialog.json +522 -455
  29. package/components/divider.json +8 -1
  30. package/components/drawer.json +571 -558
  31. package/components/dropdown.json +464 -384
  32. package/components/duration.json +125 -0
  33. package/components/editable.json +66 -0
  34. package/components/ellipsis.json +34 -1
  35. package/components/filtertablefieldsdialog.json +128 -0
  36. package/components/flex.json +151 -0
  37. package/components/form.json +131 -0
  38. package/components/formiteminput.json +214 -0
  39. package/components/formitemspinner.json +213 -0
  40. package/components/formitemswitch.json +185 -0
  41. package/components/formitemtableconfigs.json +210 -0
  42. package/components/grid.json +7 -0
  43. package/components/header.json +161 -0
  44. package/components/icon.json +13 -1
  45. package/components/icontooltip.json +19 -1
  46. package/components/input.json +188 -4
  47. package/components/instancelist.json +194 -0
  48. package/components/instancenum.json +196 -0
  49. package/components/ipinput.json +117 -0
  50. package/components/kspstatus.json +205 -0
  51. package/components/kvcode.json +120 -0
  52. package/components/layoutcontent.json +15 -3
  53. package/components/layoutlistcontent.json +148 -0
  54. package/components/layoutpermissioncontent.json +155 -0
  55. package/components/layoutstandardlist.json +275 -0
  56. package/components/layouttabs.json +168 -0
  57. package/components/lazymount.json +86 -0
  58. package/components/lazyteleport.json +118 -0
  59. package/components/menu.json +7 -0
  60. package/components/pagination.json +12 -0
  61. package/components/paginationplus.json +30 -3
  62. package/components/password.json +121 -0
  63. package/components/popover.json +457 -437
  64. package/components/projects.json +129 -0
  65. package/components/protable.json +97 -8
  66. package/components/queuevisualrange.json +110 -0
  67. package/components/radio.json +82 -2
  68. package/components/rate.json +199 -0
  69. package/components/region.json +14 -2
  70. package/components/search.json +221 -0
  71. package/components/searchinput.json +132 -0
  72. package/components/searchitems.json +215 -0
  73. package/components/searchselect.json +195 -0
  74. package/components/select.json +686 -666
  75. package/components/sidebar.json +198 -0
  76. package/components/skeleton.json +233 -0
  77. package/components/spin.json +8 -1
  78. package/components/split.json +260 -0
  79. package/components/sshkeys.json +138 -0
  80. package/components/status.json +60 -3
  81. package/components/steps.json +7 -0
  82. package/components/switch.json +8 -1
  83. package/components/table.json +18 -1
  84. package/components/tablecolumnid.json +14 -2
  85. package/components/tabs.json +12 -0
  86. package/components/timeline.json +213 -0
  87. package/components/timepicker.json +147 -3
  88. package/components/timerange.json +262 -0
  89. package/components/tip.json +7 -0
  90. package/components/tooltip.json +484 -395
  91. package/components/tour.json +418 -372
  92. package/components/transfer.json +27 -3
  93. package/components/tree.json +6 -4
  94. package/components/treeselect.json +556 -475
  95. package/components/upload.json +474 -473
  96. package/components/vdialog.json +308 -0
  97. package/components/vdrawer.json +331 -0
  98. package/components/virtuallist.json +7 -0
  99. package/dist/ast/index.d.mts +35 -1
  100. package/dist/ast/index.d.ts +35 -1
  101. package/dist/ast/index.js +4 -3
  102. package/dist/ast/index.mjs +2 -1
  103. package/dist/{chunk-DSWKLUIX.mjs → chunk-3LYQ5XFM.mjs} +1 -1
  104. package/dist/chunk-BI5TIQID.mjs +330 -0
  105. package/dist/{chunk-F26GUCGG.js → chunk-CJGGFVQJ.js} +8 -8
  106. package/dist/chunk-CR3GC4H3.js +353 -0
  107. package/dist/{chunk-NZ6TLWMD.mjs → chunk-D2SXGGTX.mjs} +28 -17
  108. package/dist/{chunk-D3Y6FGWA.js → chunk-EYKZY2F3.js} +29 -18
  109. package/dist/chunk-KF5YBEM5.js +143 -0
  110. package/dist/{chunk-H2ET6MMM.mjs → chunk-KMIDURUR.mjs} +42 -47
  111. package/dist/chunk-QC6VTSA3.mjs +117 -0
  112. package/dist/{chunk-2W6OCG2S.js → chunk-SZYVGYKK.js} +42 -48
  113. package/dist/{chunk-WYSRJVX4.js → chunk-TA3SV4SP.js} +2 -2
  114. package/dist/{chunk-OJOHB64C.mjs → chunk-XGPHQHLR.mjs} +4 -4
  115. package/dist/full/index.js +7 -6
  116. package/dist/full/index.mjs +5 -4
  117. package/dist/index.d.mts +1 -0
  118. package/dist/index.d.ts +1 -0
  119. package/dist/index.js +14 -13
  120. package/dist/index.mjs +6 -5
  121. package/dist/metadata/index.d.mts +22 -2
  122. package/dist/metadata/index.d.ts +22 -2
  123. package/dist/metadata/index.js +26 -16
  124. package/dist/metadata/index.mjs +26 -15
  125. package/dist/resolve-BsLBxlBi.d.mts +24 -0
  126. package/dist/resolve-BsLBxlBi.d.ts +24 -0
  127. package/dist/runtime/index.js +4 -4
  128. package/dist/runtime/index.mjs +2 -2
  129. package/dist/shared/index.d.mts +10 -0
  130. package/dist/shared/index.d.ts +10 -0
  131. package/dist/shared/index.js +23 -0
  132. package/dist/shared/index.mjs +2 -0
  133. package/dist/static/index.js +5 -5
  134. package/dist/static/index.mjs +2 -2
  135. package/docs_for_llm/actions.doc.md +77 -0
  136. package/docs_for_llm/advancedset.doc.md +89 -0
  137. package/docs_for_llm/affix.doc.md +15 -7
  138. package/docs_for_llm/aksk.doc.md +111 -0
  139. package/docs_for_llm/az.doc.md +17 -11
  140. package/docs_for_llm/badge.doc.md +6 -5
  141. package/docs_for_llm/billtypes.doc.md +17 -11
  142. package/docs_for_llm/breadcrumb.doc.md +6 -3
  143. package/docs_for_llm/button.doc.md +34 -18
  144. package/docs_for_llm/buttonlink.doc.md +55 -0
  145. package/docs_for_llm/card.doc.md +8 -5
  146. package/docs_for_llm/cardcol.doc.md +78 -0
  147. package/docs_for_llm/cardcols.doc.md +84 -0
  148. package/docs_for_llm/cardcontent.doc.md +10 -10
  149. package/docs_for_llm/cardtabs.doc.md +106 -0
  150. package/docs_for_llm/carousel.doc.md +8 -7
  151. package/docs_for_llm/cascader.doc.md +46 -25
  152. package/docs_for_llm/checkbox.doc.md +25 -13
  153. package/docs_for_llm/cidrinput.doc.md +83 -0
  154. package/docs_for_llm/code.doc.md +22 -11
  155. package/docs_for_llm/collapse.doc.md +9 -6
  156. package/docs_for_llm/colorpicker.doc.md +104 -0
  157. package/docs_for_llm/copy.doc.md +15 -13
  158. package/docs_for_llm/copyhover.doc.md +59 -0
  159. package/docs_for_llm/copyrow.doc.md +71 -0
  160. package/docs_for_llm/datepicker.doc.md +51 -39
  161. package/docs_for_llm/description.doc.md +75 -0
  162. package/docs_for_llm/descriptions.doc.md +9 -6
  163. package/docs_for_llm/dialog.doc.md +48 -77
  164. package/docs_for_llm/divider.doc.md +9 -7
  165. package/docs_for_llm/drawer.doc.md +43 -84
  166. package/docs_for_llm/dropdown.doc.md +52 -21
  167. package/docs_for_llm/duration.doc.md +76 -0
  168. package/docs_for_llm/editable.doc.md +36 -14
  169. package/docs_for_llm/ellipsis.doc.md +10 -5
  170. package/docs_for_llm/filtertablefieldsdialog.doc.md +99 -0
  171. package/docs_for_llm/flex.doc.md +74 -0
  172. package/docs_for_llm/form.doc.md +33 -14
  173. package/docs_for_llm/formiteminput.doc.md +128 -0
  174. package/docs_for_llm/formitemspinner.doc.md +105 -0
  175. package/docs_for_llm/formitemswitch.doc.md +113 -0
  176. package/docs_for_llm/formitemtableconfigs.doc.md +95 -0
  177. package/docs_for_llm/grid.doc.md +7 -5
  178. package/docs_for_llm/header.doc.md +85 -0
  179. package/docs_for_llm/icon.doc.md +12 -8
  180. package/docs_for_llm/icontooltip.doc.md +121 -0
  181. package/docs_for_llm/input.doc.md +90 -39
  182. package/docs_for_llm/instancelist.doc.md +113 -0
  183. package/docs_for_llm/instancenum.doc.md +95 -0
  184. package/docs_for_llm/ipinput.doc.md +77 -0
  185. package/docs_for_llm/kspstatus.doc.md +82 -0
  186. package/docs_for_llm/kvcode.doc.md +76 -0
  187. package/docs_for_llm/layoutcontent.doc.md +17 -17
  188. package/docs_for_llm/layoutlistcontent.doc.md +95 -0
  189. package/docs_for_llm/layoutpermissioncontent.doc.md +84 -0
  190. package/docs_for_llm/layoutstandardlist.doc.md +120 -0
  191. package/docs_for_llm/layouttabs.doc.md +101 -0
  192. package/docs_for_llm/lazymount.doc.md +73 -0
  193. package/docs_for_llm/lazyteleport.doc.md +76 -0
  194. package/docs_for_llm/menu.doc.md +14 -11
  195. package/docs_for_llm/message.doc.md +48 -10
  196. package/docs_for_llm/pagination.doc.md +30 -17
  197. package/docs_for_llm/paginationplus.doc.md +31 -10
  198. package/docs_for_llm/password.doc.md +86 -0
  199. package/docs_for_llm/popover.doc.md +24 -55
  200. package/docs_for_llm/progress.doc.md +13 -10
  201. package/docs_for_llm/projects.doc.md +91 -0
  202. package/docs_for_llm/protable.doc.md +89 -15
  203. package/docs_for_llm/queuevisualrange.doc.md +78 -0
  204. package/docs_for_llm/radio.doc.md +23 -8
  205. package/docs_for_llm/rate.doc.md +122 -0
  206. package/docs_for_llm/region.doc.md +25 -13
  207. package/docs_for_llm/search.doc.md +120 -0
  208. package/docs_for_llm/searchinput.doc.md +111 -0
  209. package/docs_for_llm/searchitems.doc.md +116 -0
  210. package/docs_for_llm/searchselect.doc.md +126 -0
  211. package/docs_for_llm/select.doc.md +40 -55
  212. package/docs_for_llm/sidebar.doc.md +133 -0
  213. package/docs_for_llm/skeleton.doc.md +117 -0
  214. package/docs_for_llm/slider.doc.md +31 -21
  215. package/docs_for_llm/spin.doc.md +8 -5
  216. package/docs_for_llm/spinner.doc.md +28 -18
  217. package/docs_for_llm/split.doc.md +157 -0
  218. package/docs_for_llm/sshkeys.doc.md +88 -0
  219. package/docs_for_llm/status.doc.md +14 -9
  220. package/docs_for_llm/steps.doc.md +10 -7
  221. package/docs_for_llm/switch.doc.md +17 -14
  222. package/docs_for_llm/table.doc.md +118 -51
  223. package/docs_for_llm/tablecolumnid.doc.md +36 -16
  224. package/docs_for_llm/tabs.doc.md +19 -10
  225. package/docs_for_llm/tag.doc.md +19 -10
  226. package/docs_for_llm/timeline.doc.md +109 -0
  227. package/docs_for_llm/timepicker.doc.md +57 -38
  228. package/docs_for_llm/timerange.doc.md +157 -0
  229. package/docs_for_llm/tip.doc.md +20 -11
  230. package/docs_for_llm/tooltip.doc.md +55 -29
  231. package/docs_for_llm/tour.doc.md +48 -29
  232. package/docs_for_llm/transfer.doc.md +40 -29
  233. package/docs_for_llm/tree.doc.md +65 -23
  234. package/docs_for_llm/treeselect.doc.md +37 -48
  235. package/docs_for_llm/upload.doc.md +56 -32
  236. package/docs_for_llm/useCRUD.doc.md +49 -0
  237. package/docs_for_llm/useCountdown.doc.md +43 -0
  238. package/docs_for_llm/useDetail.doc.md +48 -0
  239. package/docs_for_llm/useDialog.doc.md +46 -0
  240. package/docs_for_llm/useEntity.doc.md +45 -0
  241. package/docs_for_llm/useEventListener.doc.md +44 -0
  242. package/docs_for_llm/useFalseUntilTruthy.doc.md +41 -0
  243. package/docs_for_llm/useGetCopyAuthText.doc.md +35 -0
  244. package/docs_for_llm/useGetUserPermission.doc.md +43 -0
  245. package/docs_for_llm/useGroup.doc.md +48 -0
  246. package/docs_for_llm/useIdEntities.doc.md +48 -0
  247. package/docs_for_llm/useIdEntity.doc.md +103 -0
  248. package/docs_for_llm/useInterval.doc.md +43 -0
  249. package/docs_for_llm/useLayoutStandardList.doc.md +38 -0
  250. package/docs_for_llm/useMessage.doc.md +46 -0
  251. package/docs_for_llm/useModifyCache.doc.md +37 -0
  252. package/docs_for_llm/useOpenDialog.doc.md +41 -0
  253. package/docs_for_llm/usePagination.doc.md +60 -0
  254. package/docs_for_llm/usePersist.doc.md +54 -0
  255. package/docs_for_llm/usePoll.doc.md +41 -0
  256. package/docs_for_llm/useRoutePlus.doc.md +34 -0
  257. package/docs_for_llm/useRouterPlus.doc.md +34 -0
  258. package/docs_for_llm/useSearch.doc.md +68 -0
  259. package/docs_for_llm/useShell.doc.md +43 -0
  260. package/docs_for_llm/useSkip.doc.md +41 -0
  261. package/docs_for_llm/useStorageIdEntity.doc.md +46 -0
  262. package/docs_for_llm/useStore.doc.md +34 -0
  263. package/docs_for_llm/useTable.doc.md +57 -0
  264. package/docs_for_llm/useTableGroup.doc.md +47 -0
  265. package/docs_for_llm/useTableSort.doc.md +40 -0
  266. package/docs_for_llm/useToState.doc.md +112 -0
  267. package/docs_for_llm/useUser.doc.md +38 -0
  268. package/docs_for_llm/useValidForm.doc.md +41 -0
  269. package/docs_for_llm/vdialog.doc.md +129 -0
  270. package/docs_for_llm/vdrawer.doc.md +119 -0
  271. package/docs_for_llm/virtuallist.doc.md +6 -3
  272. package/hooks/useCRUD.json +61 -0
  273. package/hooks/useCountdown.json +49 -0
  274. package/hooks/useDetail.json +67 -0
  275. package/hooks/useDialog.json +49 -0
  276. package/hooks/useEntity.json +61 -0
  277. package/hooks/useEventListener.json +61 -0
  278. package/hooks/useFalseUntilTruthy.json +43 -0
  279. package/hooks/useGetCopyAuthText.json +36 -0
  280. package/hooks/useGetUserPermission.json +55 -0
  281. package/hooks/useGroup.json +49 -0
  282. package/hooks/useIdEntities.json +61 -0
  283. package/hooks/useInterval.json +55 -0
  284. package/hooks/useLayoutStandardList.json +36 -0
  285. package/hooks/useMessage.json +73 -0
  286. package/hooks/useModifyCache.json +36 -0
  287. package/hooks/useOpenDialog.json +43 -0
  288. package/hooks/usePagination.json +49 -0
  289. package/hooks/usePersist.json +61 -0
  290. package/hooks/usePoll.json +43 -0
  291. package/hooks/useRoutePlus.json +36 -0
  292. package/hooks/useRouterPlus.json +36 -0
  293. package/hooks/useSearch.json +56 -0
  294. package/hooks/useShell.json +49 -0
  295. package/hooks/useSkip.json +43 -0
  296. package/hooks/useStorageIdEntity.json +67 -0
  297. package/hooks/useStore.json +36 -0
  298. package/hooks/useTable.json +49 -0
  299. package/hooks/useTableGroup.json +43 -0
  300. package/hooks/useTableSort.json +43 -0
  301. package/hooks/useUser.json +36 -0
  302. package/hooks/useValidForm.json +43 -0
  303. package/package.json +12 -6
  304. package/dist/chunk-HPAUCD5I.js +0 -156
  305. package/dist/chunk-L4DS3EXI.mjs +0 -133
@@ -1,3 +1,5 @@
1
+ import { C as ComponentInheritance } from '../resolve-BsLBxlBi.mjs';
2
+
1
3
  interface RuleViolation {
2
4
  rule: string;
3
5
  match: string;
@@ -23,6 +25,22 @@ interface ComponentProp {
23
25
  }
24
26
  interface ComponentEvent {
25
27
  name: string;
28
+ description?: string;
29
+ vueEventName?: string;
30
+ params?: {
31
+ name: string;
32
+ type: string;
33
+ description?: string;
34
+ optional?: boolean;
35
+ default?: string;
36
+ }[];
37
+ payload?: {
38
+ name: string;
39
+ type: string;
40
+ description?: string;
41
+ optional?: boolean;
42
+ default?: string;
43
+ }[];
26
44
  }
27
45
  interface ComponentSlot {
28
46
  name: string;
@@ -35,21 +53,37 @@ interface MistakeEntry {
35
53
  explanation: string;
36
54
  }
37
55
  interface ComponentMetadata {
56
+ id?: string;
38
57
  name: string;
39
58
  props: ComponentProp[];
40
59
  events: ComponentEvent[];
41
60
  slots: ComponentSlot[];
61
+ methods?: {
62
+ name: string;
63
+ description?: string;
64
+ params?: {
65
+ name: string;
66
+ type: string;
67
+ description?: string;
68
+ optional?: boolean;
69
+ default?: string;
70
+ }[];
71
+ returnType?: string;
72
+ }[];
42
73
  subComponents?: ComponentMetadata[];
43
74
  commonMistakes?: MistakeEntry[];
44
75
  importStatement?: string;
45
76
  requiredParent?: string;
77
+ inherits?: ComponentInheritance[];
46
78
  }
47
79
  declare class ComponentRegistry {
48
80
  private components;
49
81
  private loaded;
50
82
  private watcher;
51
83
  private metadataPath;
52
- load(): Promise<void>;
84
+ load(options?: {
85
+ watch?: boolean;
86
+ }): Promise<void>;
53
87
  /**
54
88
  * 重新加载所有组件元数据
55
89
  */
@@ -1,3 +1,5 @@
1
+ import { C as ComponentInheritance } from '../resolve-BsLBxlBi.js';
2
+
1
3
  interface RuleViolation {
2
4
  rule: string;
3
5
  match: string;
@@ -23,6 +25,22 @@ interface ComponentProp {
23
25
  }
24
26
  interface ComponentEvent {
25
27
  name: string;
28
+ description?: string;
29
+ vueEventName?: string;
30
+ params?: {
31
+ name: string;
32
+ type: string;
33
+ description?: string;
34
+ optional?: boolean;
35
+ default?: string;
36
+ }[];
37
+ payload?: {
38
+ name: string;
39
+ type: string;
40
+ description?: string;
41
+ optional?: boolean;
42
+ default?: string;
43
+ }[];
26
44
  }
27
45
  interface ComponentSlot {
28
46
  name: string;
@@ -35,21 +53,37 @@ interface MistakeEntry {
35
53
  explanation: string;
36
54
  }
37
55
  interface ComponentMetadata {
56
+ id?: string;
38
57
  name: string;
39
58
  props: ComponentProp[];
40
59
  events: ComponentEvent[];
41
60
  slots: ComponentSlot[];
61
+ methods?: {
62
+ name: string;
63
+ description?: string;
64
+ params?: {
65
+ name: string;
66
+ type: string;
67
+ description?: string;
68
+ optional?: boolean;
69
+ default?: string;
70
+ }[];
71
+ returnType?: string;
72
+ }[];
42
73
  subComponents?: ComponentMetadata[];
43
74
  commonMistakes?: MistakeEntry[];
44
75
  importStatement?: string;
45
76
  requiredParent?: string;
77
+ inherits?: ComponentInheritance[];
46
78
  }
47
79
  declare class ComponentRegistry {
48
80
  private components;
49
81
  private loaded;
50
82
  private watcher;
51
83
  private metadataPath;
52
- load(): Promise<void>;
84
+ load(options?: {
85
+ watch?: boolean;
86
+ }): Promise<void>;
53
87
  /**
54
88
  * 重新加载所有组件元数据
55
89
  */
package/dist/ast/index.js CHANGED
@@ -1,16 +1,17 @@
1
1
  'use strict';
2
2
 
3
3
  require('../chunk-YTEYDSDW.js');
4
- var chunk2W6OCG2S_js = require('../chunk-2W6OCG2S.js');
4
+ var chunkSZYVGYKK_js = require('../chunk-SZYVGYKK.js');
5
+ require('../chunk-KF5YBEM5.js');
5
6
  require('../chunk-JSBRDJBE.js');
6
7
 
7
8
 
8
9
 
9
10
  Object.defineProperty(exports, "analyzeCodeWithAST", {
10
11
  enumerable: true,
11
- get: function () { return chunk2W6OCG2S_js.analyzeCodeWithAST; }
12
+ get: function () { return chunkSZYVGYKK_js.analyzeCodeWithAST; }
12
13
  });
13
14
  Object.defineProperty(exports, "componentRegistry", {
14
15
  enumerable: true,
15
- get: function () { return chunk2W6OCG2S_js.componentRegistry; }
16
+ get: function () { return chunkSZYVGYKK_js.componentRegistry; }
16
17
  });
@@ -1,3 +1,4 @@
1
1
  import '../chunk-5H7N2A5X.mjs';
2
- export { analyzeCodeWithAST, componentRegistry } from '../chunk-H2ET6MMM.mjs';
2
+ export { analyzeCodeWithAST, componentRegistry } from '../chunk-KMIDURUR.mjs';
3
+ import '../chunk-QC6VTSA3.mjs';
3
4
  import '../chunk-UJCSKKID.mjs';
@@ -1,4 +1,4 @@
1
- import { compileSFC } from './chunk-L4DS3EXI.mjs';
1
+ import { compileSFC } from './chunk-BI5TIQID.mjs';
2
2
 
3
3
  // src/static/index.ts
4
4
  var scopeIdCounter = 0;
@@ -0,0 +1,330 @@
1
+ import { parse } from '@vue/compiler-sfc';
2
+ import { transform } from 'sucrase';
3
+ import * as ts from 'typescript';
4
+
5
+ // src/tools/sfcCompiler.ts
6
+ var ALLOWED_IMPORT_SOURCES = [
7
+ "vue",
8
+ "@vue/",
9
+ "@king-design/vue",
10
+ "@ksyun-internal/versatile"
11
+ ];
12
+ var VUE_RUNTIME_INJECTED_BINDINGS = /* @__PURE__ */ new Set([
13
+ "ref",
14
+ "reactive",
15
+ "computed",
16
+ "readonly",
17
+ "shallowRef",
18
+ "shallowReactive",
19
+ "toRef",
20
+ "toRefs",
21
+ "toRaw",
22
+ "markRaw",
23
+ "isRef",
24
+ "isReactive",
25
+ "isReadonly",
26
+ "isProxy",
27
+ "triggerRef",
28
+ "customRef",
29
+ "onMounted",
30
+ "onUnmounted",
31
+ "onBeforeMount",
32
+ "onBeforeUnmount",
33
+ "onUpdated",
34
+ "onBeforeUpdate",
35
+ "onActivated",
36
+ "onDeactivated",
37
+ "onErrorCaptured",
38
+ "watch",
39
+ "watchEffect",
40
+ "watchPostEffect",
41
+ "watchSyncEffect",
42
+ "defineProps",
43
+ "defineEmits",
44
+ "defineExpose",
45
+ "defineOptions",
46
+ "defineSlots",
47
+ "defineModel",
48
+ "withDefaults",
49
+ "useSlots",
50
+ "useAttrs",
51
+ "inject",
52
+ "provide",
53
+ "nextTick",
54
+ "getCurrentInstance",
55
+ "h",
56
+ "createVNode",
57
+ "resolveComponent"
58
+ ]);
59
+ var VERSATILE_RUNTIME_INJECTED_BINDINGS = /* @__PURE__ */ new Set([
60
+ "useToState",
61
+ "useIdEntity"
62
+ ]);
63
+ var INTERNAL_BINDING_PREFIXES = ["__imported_module_"];
64
+ function getRuntimeInjectedBindingsForSource(source) {
65
+ if (source === "vue" || source.startsWith("@vue/")) {
66
+ return VUE_RUNTIME_INJECTED_BINDINGS;
67
+ }
68
+ if (source === "@ksyun-internal/versatile") {
69
+ return VERSATILE_RUNTIME_INJECTED_BINDINGS;
70
+ }
71
+ return /* @__PURE__ */ new Set();
72
+ }
73
+ function normalizeNamedImportSpecifiers(specifiers) {
74
+ return specifiers.split(",").map((part) => part.trim()).filter(Boolean).map((part) => {
75
+ const aliasMatch = part.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);
76
+ if (aliasMatch) {
77
+ return `${aliasMatch[1]}: ${aliasMatch[2]}`;
78
+ }
79
+ return part;
80
+ }).join(", ");
81
+ }
82
+ function shouldUseWhitelist(source, whitelist) {
83
+ return whitelist.some((allowedSource) => source === allowedSource || source.startsWith(`${allowedSource}/`));
84
+ }
85
+ function classifyImportSource(source, whitelist) {
86
+ if (shouldUseWhitelist(source, whitelist)) {
87
+ return "whitelisted";
88
+ }
89
+ if (source.startsWith(".")) {
90
+ return "relative";
91
+ }
92
+ return "unknown";
93
+ }
94
+ function scopeStyles(css, scopeClass) {
95
+ return css.replace(/([^\r\n,{}]+)(,(?=[^}]*{)|\s*{)/g, (match, selector, suffix) => {
96
+ if (selector.trim().startsWith("@")) return match;
97
+ const scopedSelector = selector.split(",").map((rawSelector) => {
98
+ const nextSelector = rawSelector.trim();
99
+ if (nextSelector === "body" || nextSelector === "html") return `.${scopeClass}`;
100
+ return `.${scopeClass} ${nextSelector}`;
101
+ }).join(", ");
102
+ return `${scopedSelector}${suffix}`;
103
+ });
104
+ }
105
+ function transformImportToBinding(importClause, sourceExpression) {
106
+ const trimmedClause = importClause.trim();
107
+ const namespaceMatch = trimmedClause.match(/^\*\s+as\s+(\w+)$/);
108
+ if (namespaceMatch) {
109
+ return `const ${namespaceMatch[1]} = ${sourceExpression};`;
110
+ }
111
+ const mixedMatch = trimmedClause.match(/^(\w+)\s*,\s*\{([^}]+)\}$/);
112
+ if (mixedMatch) {
113
+ const defaultName = mixedMatch[1];
114
+ const namedImports = normalizeNamedImportSpecifiers(mixedMatch[2]);
115
+ const moduleVar = `__imported_module_${defaultName}`;
116
+ return `const ${moduleVar} = ${sourceExpression}; const ${defaultName} = ${moduleVar}.default || ${moduleVar}; const { ${namedImports} } = ${moduleVar};`;
117
+ }
118
+ const defaultAndNamespaceMatch = trimmedClause.match(/^(\w+)\s*,\s*\*\s+as\s+(\w+)$/);
119
+ if (defaultAndNamespaceMatch) {
120
+ const defaultName = defaultAndNamespaceMatch[1];
121
+ const namespaceName = defaultAndNamespaceMatch[2];
122
+ const moduleVar = `__imported_module_${defaultName}`;
123
+ return `const ${moduleVar} = ${sourceExpression}; const ${defaultName} = ${moduleVar}.default || ${moduleVar}; const ${namespaceName} = ${moduleVar};`;
124
+ }
125
+ const namedMatch = trimmedClause.match(/^\{([^}]+)\}$/);
126
+ if (namedMatch) {
127
+ return `const { ${normalizeNamedImportSpecifiers(namedMatch[1])} } = ${sourceExpression};`;
128
+ }
129
+ const defaultMatch = trimmedClause.match(/^(\w+)$/);
130
+ if (defaultMatch) {
131
+ const defaultName = defaultMatch[1];
132
+ return `const ${defaultName} = ${sourceExpression}.default || ${sourceExpression};`;
133
+ }
134
+ return "";
135
+ }
136
+ function transformWhitelistedImport(importClause, source) {
137
+ const trimmedClause = importClause.trim();
138
+ const injectedBindings = getRuntimeInjectedBindingsForSource(source);
139
+ const buildNamedBinding = (specifiers, sourceExpression = `__getWhitelistedModule('${source}')`) => {
140
+ const namedBindings = specifiers.split(",").map((part) => part.trim()).filter(Boolean).map((part) => {
141
+ const aliasMatch = part.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);
142
+ if (aliasMatch) {
143
+ return `${aliasMatch[1]}: ${aliasMatch[2]}`;
144
+ }
145
+ return injectedBindings.has(part) ? null : part;
146
+ }).filter(Boolean);
147
+ if (namedBindings.length === 0) {
148
+ return "";
149
+ }
150
+ return `const { ${namedBindings.join(", ")} } = ${sourceExpression};`;
151
+ };
152
+ const namespaceMatch = trimmedClause.match(/^\*\s+as\s+(\w+)$/);
153
+ if (namespaceMatch) {
154
+ return `const ${namespaceMatch[1]} = __getWhitelistedModule('${source}');`;
155
+ }
156
+ const mixedMatch = trimmedClause.match(/^(\w+)\s*,\s*\{([^}]+)\}$/);
157
+ if (mixedMatch) {
158
+ const defaultName = mixedMatch[1];
159
+ const moduleVar = `__imported_module_${defaultName}`;
160
+ const parts = [
161
+ `const ${moduleVar} = __getWhitelistedModule('${source}');`,
162
+ `const ${defaultName} = ${moduleVar}.default || ${moduleVar};`
163
+ ];
164
+ const namedBinding = buildNamedBinding(mixedMatch[2], moduleVar);
165
+ if (namedBinding) {
166
+ parts.push(namedBinding);
167
+ }
168
+ return parts.join(" ");
169
+ }
170
+ const defaultAndNamespaceMatch = trimmedClause.match(/^(\w+)\s*,\s*\*\s+as\s+(\w+)$/);
171
+ if (defaultAndNamespaceMatch) {
172
+ const defaultName = defaultAndNamespaceMatch[1];
173
+ const namespaceName = defaultAndNamespaceMatch[2];
174
+ const moduleVar = `__imported_module_${defaultName}`;
175
+ return `const ${moduleVar} = __getWhitelistedModule('${source}'); const ${defaultName} = ${moduleVar}.default || ${moduleVar}; const ${namespaceName} = ${moduleVar};`;
176
+ }
177
+ const namedMatch = trimmedClause.match(/^\{([^}]+)\}$/);
178
+ if (namedMatch) {
179
+ return buildNamedBinding(namedMatch[1]);
180
+ }
181
+ const defaultMatch = trimmedClause.match(/^(\w+)$/);
182
+ if (defaultMatch) {
183
+ const defaultName = defaultMatch[1];
184
+ return `const ${defaultName} = __getWhitelistedModule('${source}').default || __getWhitelistedModule('${source}');`;
185
+ }
186
+ return "";
187
+ }
188
+ function collectRawScript(descriptor) {
189
+ return [descriptor.script?.content, descriptor.scriptSetup?.content].filter((block) => Boolean(block?.trim())).join("\n");
190
+ }
191
+ function transformValueImports(scriptContent, whitelist, strippedImports) {
192
+ let nextScript = scriptContent.replace(/import\s+type\s+[\s\S]*?from\s+['"].*?['"];?/g, "");
193
+ nextScript = nextScript.replace(
194
+ /import\s+([^;]+?)\s+from\s+['"]([^'"]+)['"];?/g,
195
+ (_match, importClause, source) => {
196
+ const reason = classifyImportSource(source, whitelist);
197
+ strippedImports.push({ source, reason });
198
+ if (reason === "whitelisted") {
199
+ return transformWhitelistedImport(importClause, source);
200
+ }
201
+ if (reason === "relative") {
202
+ return transformImportToBinding(importClause, `__mockModule('${source}')`);
203
+ }
204
+ return "";
205
+ }
206
+ );
207
+ nextScript = nextScript.replace(
208
+ /import\s+['"]([^'"]+)['"];?/g,
209
+ (_match, source) => {
210
+ const reason = classifyImportSource(source, whitelist);
211
+ strippedImports.push({ source, reason });
212
+ if (reason === "relative") {
213
+ return `__mockModule('${source}');`;
214
+ }
215
+ return "";
216
+ }
217
+ );
218
+ return nextScript;
219
+ }
220
+ function stripExports(scriptContent) {
221
+ let nextScript = scriptContent;
222
+ nextScript = nextScript.replace(/export\s+default\s*\{[\s\S]*?\}\s*;?\s*$/g, "");
223
+ nextScript = nextScript.replace(/export\s+\{[\s\S]*?\}\s*;?/g, "");
224
+ nextScript = nextScript.replace(/export\s+default\s+/g, "");
225
+ nextScript = nextScript.replace(/export\s+(const|let|var|function|class|async\s+function)\s+/g, "$1 ");
226
+ return nextScript;
227
+ }
228
+ function transpileScript(scriptContent) {
229
+ const result = transform(scriptContent, {
230
+ transforms: ["typescript"],
231
+ disableESTransforms: true
232
+ });
233
+ return result && typeof result.code === "string" ? result.code : scriptContent;
234
+ }
235
+ function extractBindingsFromScript(scriptContent) {
236
+ const bindings = /* @__PURE__ */ new Set();
237
+ try {
238
+ let extractNames2 = function(name) {
239
+ if (ts.isIdentifier(name)) {
240
+ bindings.add(name.text);
241
+ return;
242
+ }
243
+ if (ts.isObjectBindingPattern(name) || ts.isArrayBindingPattern(name)) {
244
+ name.elements.forEach((element) => {
245
+ if (ts.isBindingElement(element)) {
246
+ extractNames2(element.name);
247
+ }
248
+ });
249
+ }
250
+ }, visit2 = function(node) {
251
+ if (ts.isVariableStatement(node)) {
252
+ node.declarationList.declarations.forEach((decl) => extractNames2(decl.name));
253
+ } else if (ts.isFunctionDeclaration(node) && node.name) {
254
+ bindings.add(node.name.text);
255
+ } else if (ts.isClassDeclaration(node) && node.name) {
256
+ bindings.add(node.name.text);
257
+ }
258
+ };
259
+ var extractNames = extractNames2, visit = visit2;
260
+ const sourceFile = ts.createSourceFile(
261
+ "temp.ts",
262
+ scriptContent,
263
+ ts.ScriptTarget.Latest,
264
+ true
265
+ );
266
+ sourceFile.statements.forEach(visit2);
267
+ } catch {
268
+ return [];
269
+ }
270
+ return Array.from(bindings).filter(
271
+ (binding) => binding && /^[A-Za-z_$][\w$]*$/.test(binding) && !INTERNAL_BINDING_PREFIXES.some((prefix) => binding.startsWith(prefix))
272
+ );
273
+ }
274
+ function processExecutableScript(rawScript, whitelist, strippedImports) {
275
+ const withoutImports = transformValueImports(rawScript, whitelist, strippedImports);
276
+ const withoutExports = stripExports(withoutImports);
277
+ return transpileScript(withoutExports);
278
+ }
279
+ function getParseError(result) {
280
+ const firstError = result.errors[0];
281
+ if (!firstError) return void 0;
282
+ return typeof firstError === "string" ? firstError : firstError.message;
283
+ }
284
+ function compileSFC(code, scopeId, options) {
285
+ const whitelist = options?.allowedImports ?? ALLOWED_IMPORT_SOURCES;
286
+ const strippedImports = [];
287
+ try {
288
+ const parseResult = parse(code, {
289
+ filename: "inline.vue",
290
+ sourceMap: false
291
+ });
292
+ const parseError = getParseError(parseResult);
293
+ if (parseError) {
294
+ return {
295
+ template: "",
296
+ script: "",
297
+ style: "",
298
+ bindings: [],
299
+ error: parseError
300
+ };
301
+ }
302
+ const { descriptor } = parseResult;
303
+ const template = descriptor.template?.content || "";
304
+ const rawScript = collectRawScript(descriptor);
305
+ const rawStyles = descriptor.styles.map((styleBlock) => styleBlock.content).join("\n");
306
+ const style = rawStyles ? scopeStyles(rawStyles, scopeId) : "";
307
+ if (!template && !rawScript) {
308
+ return { template: "", script: "", style: "", bindings: [] };
309
+ }
310
+ const executableScript = rawScript ? processExecutableScript(rawScript, whitelist, strippedImports) : "";
311
+ const bindings = executableScript ? extractBindingsFromScript(executableScript) : [];
312
+ return {
313
+ template,
314
+ script: executableScript,
315
+ style,
316
+ bindings,
317
+ strippedImports: strippedImports.length > 0 ? strippedImports : void 0
318
+ };
319
+ } catch (error) {
320
+ return {
321
+ template: "",
322
+ script: "",
323
+ style: "",
324
+ bindings: [],
325
+ error: error?.message || String(error)
326
+ };
327
+ }
328
+ }
329
+
330
+ export { compileSFC, scopeStyles };
@@ -1,15 +1,15 @@
1
1
  'use strict';
2
2
 
3
- var chunk2W6OCG2S_js = require('./chunk-2W6OCG2S.js');
4
- var chunkD3Y6FGWA_js = require('./chunk-D3Y6FGWA.js');
5
- var chunkHPAUCD5I_js = require('./chunk-HPAUCD5I.js');
3
+ var chunkSZYVGYKK_js = require('./chunk-SZYVGYKK.js');
4
+ var chunkEYKZY2F3_js = require('./chunk-EYKZY2F3.js');
5
+ var chunkCR3GC4H3_js = require('./chunk-CR3GC4H3.js');
6
6
 
7
7
  // src/tools/unifiedValidator.ts
8
8
  function validateCompilation(code) {
9
9
  const scopeId = `validate-${Date.now()}`;
10
10
  const scriptOpenCount = (code.match(/<script[\s\S]*?>/g) || []).length;
11
11
  const scriptCloseCount = (code.match(/<\/script>/g) || []).length;
12
- const templateOpenCount = (code.match(/<template>/g) || []).length;
12
+ const templateOpenCount = (code.match(/<template[^>]*>/g) || []).length;
13
13
  const templateCloseCount = (code.match(/<\/template>/g) || []).length;
14
14
  if (scriptCloseCount > 0 && scriptOpenCount === 0) {
15
15
  return {
@@ -41,7 +41,7 @@ function validateCompilation(code) {
41
41
  errors: ["SFC \u7ED3\u6784\u9519\u8BEF: \u7F3A\u5C11 <template> \u6216 <script> \u6807\u7B7E"]
42
42
  };
43
43
  }
44
- const result = chunkHPAUCD5I_js.compileSFC(code, scopeId);
44
+ const result = chunkCR3GC4H3_js.compileSFC(code, scopeId);
45
45
  if (result.error) {
46
46
  return {
47
47
  name: "\u7F16\u8BD1\u68C0\u67E5",
@@ -64,7 +64,7 @@ function validateCompilation(code) {
64
64
  }
65
65
  async function validateAST(code) {
66
66
  try {
67
- const violations = await chunk2W6OCG2S_js.analyzeCodeWithAST(code);
67
+ const violations = await chunkSZYVGYKK_js.analyzeCodeWithAST(code);
68
68
  if (violations.length > 0) {
69
69
  return {
70
70
  name: "AST\u89C4\u5219\u68C0\u67E5",
@@ -110,7 +110,7 @@ async function validateCode(code) {
110
110
  summary: `\u274C AST\u89C4\u5219\u8FDD\u89C4 (${astResult.errors.length}\u9879)`
111
111
  };
112
112
  }
113
- const runtimeResult = chunkD3Y6FGWA_js.validateRuntimePrecheck(code);
113
+ const runtimeResult = chunkEYKZY2F3_js.validateRuntimePrecheck(code);
114
114
  if (!runtimeResult.passed) {
115
115
  return {
116
116
  passed: false,
@@ -144,7 +144,7 @@ function validateCodeSync(code) {
144
144
  summary: `\u274C \u7F16\u8BD1\u5931\u8D25: ${compilationResult.errors[0]}`
145
145
  };
146
146
  }
147
- const runtimeResult = chunkD3Y6FGWA_js.validateRuntimePrecheck(code);
147
+ const runtimeResult = chunkEYKZY2F3_js.validateRuntimePrecheck(code);
148
148
  return {
149
149
  passed: runtimeResult.passed,
150
150
  layers: {