king-design-analyzer 2.1.9 → 2.2.1

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 (327) hide show
  1. package/components/actions.json +109 -0
  2. package/components/advancedset.json +128 -0
  3. package/components/affix.json +8 -0
  4. package/components/aksk.json +172 -0
  5. package/components/anchor.json +220 -0
  6. package/components/anchorlink.json +111 -0
  7. package/components/az.json +15 -2
  8. package/components/badge.json +8 -0
  9. package/components/billtypes.json +14 -2
  10. package/components/breadcrumb.json +9 -1
  11. package/components/button.json +192 -0
  12. package/components/buttonlink.json +74 -0
  13. package/components/card.json +14 -4
  14. package/components/cardcol.json +142 -0
  15. package/components/cardcols.json +121 -0
  16. package/components/cardcontent.json +20 -3
  17. package/components/cardtabs.json +172 -0
  18. package/components/carousel.json +7 -0
  19. package/components/cascader.json +576 -368
  20. package/components/checkbox.json +51 -4
  21. package/components/cidrinput.json +140 -0
  22. package/components/code.json +8 -1
  23. package/components/collapse.json +335 -341
  24. package/components/colorpicker.json +217 -0
  25. package/components/configprovider.json +96 -0
  26. package/components/copy.json +7 -0
  27. package/components/copyhover.json +111 -0
  28. package/components/copyrow.json +125 -0
  29. package/components/datepicker.json +656 -524
  30. package/components/description.json +98 -0
  31. package/components/descriptions.json +10 -3
  32. package/components/diagram.json +295 -0
  33. package/components/dialog.json +526 -455
  34. package/components/divider.json +9 -1
  35. package/components/drawer.json +603 -558
  36. package/components/dropdown.json +464 -384
  37. package/components/duration.json +125 -0
  38. package/components/editable.json +66 -0
  39. package/components/ellipsis.json +34 -1
  40. package/components/filtertablefieldsdialog.json +128 -0
  41. package/components/flex.json +152 -0
  42. package/components/form.json +143 -3
  43. package/components/formiteminput.json +214 -0
  44. package/components/formitemspinner.json +213 -0
  45. package/components/formitemswitch.json +185 -0
  46. package/components/formitemtableconfigs.json +210 -0
  47. package/components/grid.json +7 -0
  48. package/components/header.json +165 -0
  49. package/components/icon.json +13 -1
  50. package/components/icontooltip.json +19 -1
  51. package/components/input.json +196 -8
  52. package/components/instancelist.json +194 -0
  53. package/components/instancenum.json +196 -0
  54. package/components/ipinput.json +117 -0
  55. package/components/kspstatus.json +205 -0
  56. package/components/kvcode.json +120 -0
  57. package/components/layoutcontent.json +24 -3
  58. package/components/layoutlistcontent.json +157 -0
  59. package/components/layoutpermissioncontent.json +156 -0
  60. package/components/layoutstandardlist.json +276 -0
  61. package/components/layouttabs.json +168 -0
  62. package/components/lazymount.json +87 -0
  63. package/components/lazyteleport.json +119 -0
  64. package/components/menu.json +11 -3
  65. package/components/notification.json +351 -0
  66. package/components/pagination.json +12 -0
  67. package/components/paginationplus.json +30 -3
  68. package/components/password.json +121 -0
  69. package/components/popover.json +457 -437
  70. package/components/projects.json +129 -0
  71. package/components/protable.json +99 -8
  72. package/components/queuevisualrange.json +110 -0
  73. package/components/radio.json +82 -2
  74. package/components/rate.json +200 -0
  75. package/components/region.json +14 -2
  76. package/components/scrollselect.json +140 -0
  77. package/components/search.json +221 -0
  78. package/components/searchinput.json +132 -0
  79. package/components/searchitems.json +215 -0
  80. package/components/searchselect.json +195 -0
  81. package/components/select.json +749 -666
  82. package/components/sidebar.json +198 -0
  83. package/components/skeleton.json +234 -0
  84. package/components/slider.json +12 -2
  85. package/components/spin.json +10 -2
  86. package/components/spinner.json +419 -429
  87. package/components/split.json +263 -0
  88. package/components/sshkeys.json +138 -0
  89. package/components/status.json +60 -3
  90. package/components/steps.json +7 -0
  91. package/components/switch.json +12 -3
  92. package/components/table.json +24 -2
  93. package/components/tablecolumnid.json +14 -2
  94. package/components/tabs.json +14 -2
  95. package/components/tag.json +8 -5
  96. package/components/timeline.json +215 -0
  97. package/components/timepicker.json +147 -3
  98. package/components/timerange.json +262 -0
  99. package/components/tip.json +27 -0
  100. package/components/tooltip.json +492 -395
  101. package/components/tour.json +418 -372
  102. package/components/transfer.json +79 -8
  103. package/components/tree.json +28 -5
  104. package/components/treeselect.json +612 -475
  105. package/components/upload.json +474 -473
  106. package/components/vdialog.json +309 -0
  107. package/components/vdrawer.json +335 -0
  108. package/components/virtuallist.json +7 -0
  109. package/dist/ast/index.d.mts +65 -2
  110. package/dist/ast/index.d.ts +65 -2
  111. package/dist/ast/index.js +4 -3
  112. package/dist/ast/index.mjs +2 -1
  113. package/dist/chunk-4OTQAQ6J.mjs +341 -0
  114. package/dist/{chunk-F26GUCGG.js → chunk-4WXOYU2N.js} +32 -9
  115. package/dist/chunk-6HOIRUQB.mjs +409 -0
  116. package/dist/chunk-DHLWNT53.js +364 -0
  117. package/dist/{chunk-H2ET6MMM.mjs → chunk-IPJJMPOO.mjs} +155 -66
  118. package/dist/{chunk-WYSRJVX4.js → chunk-JJ6AB4ZH.js} +2 -2
  119. package/dist/{chunk-2W6OCG2S.js → chunk-JNRGUR3O.js} +155 -67
  120. package/dist/chunk-KF5YBEM5.js +143 -0
  121. package/dist/{chunk-OJOHB64C.mjs → chunk-LRTDTFFQ.mjs} +28 -5
  122. package/dist/{chunk-DSWKLUIX.mjs → chunk-NZL6T22V.mjs} +1 -1
  123. package/dist/chunk-QC6VTSA3.mjs +117 -0
  124. package/dist/chunk-V5N65MRP.js +411 -0
  125. package/dist/full/index.d.mts +2 -0
  126. package/dist/full/index.d.ts +2 -0
  127. package/dist/full/index.js +7 -6
  128. package/dist/full/index.mjs +5 -4
  129. package/dist/index.d.mts +1 -0
  130. package/dist/index.d.ts +1 -0
  131. package/dist/index.js +14 -13
  132. package/dist/index.mjs +6 -5
  133. package/dist/metadata/index.d.mts +38 -3
  134. package/dist/metadata/index.d.ts +38 -3
  135. package/dist/metadata/index.js +26 -16
  136. package/dist/metadata/index.mjs +26 -15
  137. package/dist/resolve-BsLBxlBi.d.mts +24 -0
  138. package/dist/resolve-BsLBxlBi.d.ts +24 -0
  139. package/dist/runtime/index.d.mts +2 -0
  140. package/dist/runtime/index.d.ts +2 -0
  141. package/dist/runtime/index.js +4 -4
  142. package/dist/runtime/index.mjs +2 -2
  143. package/dist/shared/index.d.mts +10 -0
  144. package/dist/shared/index.d.ts +10 -0
  145. package/dist/shared/index.js +23 -0
  146. package/dist/shared/index.mjs +2 -0
  147. package/dist/static/index.js +5 -5
  148. package/dist/static/index.mjs +2 -2
  149. package/docs_for_llm/actions.doc.md +87 -0
  150. package/docs_for_llm/advancedset.doc.md +98 -0
  151. package/docs_for_llm/affix.doc.md +20 -7
  152. package/docs_for_llm/aksk.doc.md +111 -0
  153. package/docs_for_llm/anchor.doc.md +155 -0
  154. package/docs_for_llm/anchorlink.doc.md +75 -0
  155. package/docs_for_llm/az.doc.md +17 -11
  156. package/docs_for_llm/badge.doc.md +11 -5
  157. package/docs_for_llm/billtypes.doc.md +17 -11
  158. package/docs_for_llm/breadcrumb.doc.md +80 -4
  159. package/docs_for_llm/button.doc.md +91 -18
  160. package/docs_for_llm/buttonlink.doc.md +64 -0
  161. package/docs_for_llm/card.doc.md +58 -8
  162. package/docs_for_llm/cardcol.doc.md +78 -0
  163. package/docs_for_llm/cardcols.doc.md +84 -0
  164. package/docs_for_llm/cardcontent.doc.md +31 -10
  165. package/docs_for_llm/cardtabs.doc.md +106 -0
  166. package/docs_for_llm/carousel.doc.md +79 -7
  167. package/docs_for_llm/cascader.doc.md +106 -23
  168. package/docs_for_llm/checkbox.doc.md +25 -13
  169. package/docs_for_llm/cidrinput.doc.md +83 -0
  170. package/docs_for_llm/code.doc.md +22 -11
  171. package/docs_for_llm/collapse.doc.md +147 -14
  172. package/docs_for_llm/colorpicker.doc.md +104 -0
  173. package/docs_for_llm/configprovider.doc.md +77 -0
  174. package/docs_for_llm/copy.doc.md +15 -13
  175. package/docs_for_llm/copyhover.doc.md +59 -0
  176. package/docs_for_llm/copyrow.doc.md +80 -0
  177. package/docs_for_llm/datepicker.doc.md +66 -35
  178. package/docs_for_llm/description.doc.md +75 -0
  179. package/docs_for_llm/descriptions.doc.md +122 -10
  180. package/docs_for_llm/diagram.doc.md +343 -0
  181. package/docs_for_llm/dialog.doc.md +97 -77
  182. package/docs_for_llm/divider.doc.md +14 -7
  183. package/docs_for_llm/drawer.doc.md +114 -69
  184. package/docs_for_llm/dropdown.doc.md +290 -22
  185. package/docs_for_llm/duration.doc.md +76 -0
  186. package/docs_for_llm/editable.doc.md +36 -14
  187. package/docs_for_llm/ellipsis.doc.md +10 -5
  188. package/docs_for_llm/filtertablefieldsdialog.doc.md +99 -0
  189. package/docs_for_llm/flex.doc.md +83 -0
  190. package/docs_for_llm/form.doc.md +196 -18
  191. package/docs_for_llm/formiteminput.doc.md +128 -0
  192. package/docs_for_llm/formitemspinner.doc.md +105 -0
  193. package/docs_for_llm/formitemswitch.doc.md +113 -0
  194. package/docs_for_llm/formitemtableconfigs.doc.md +95 -0
  195. package/docs_for_llm/grid.doc.md +78 -5
  196. package/docs_for_llm/header.doc.md +114 -0
  197. package/docs_for_llm/icon.doc.md +12 -8
  198. package/docs_for_llm/icontooltip.doc.md +121 -0
  199. package/docs_for_llm/input.doc.md +199 -41
  200. package/docs_for_llm/instancelist.doc.md +113 -0
  201. package/docs_for_llm/instancenum.doc.md +95 -0
  202. package/docs_for_llm/ipinput.doc.md +77 -0
  203. package/docs_for_llm/kspstatus.doc.md +82 -0
  204. package/docs_for_llm/kvcode.doc.md +76 -0
  205. package/docs_for_llm/layoutcontent.doc.md +54 -17
  206. package/docs_for_llm/layoutlistcontent.doc.md +168 -0
  207. package/docs_for_llm/layoutpermissioncontent.doc.md +93 -0
  208. package/docs_for_llm/layoutstandardlist.doc.md +129 -0
  209. package/docs_for_llm/layouttabs.doc.md +101 -0
  210. package/docs_for_llm/lazymount.doc.md +82 -0
  211. package/docs_for_llm/lazyteleport.doc.md +85 -0
  212. package/docs_for_llm/menu.doc.md +139 -14
  213. package/docs_for_llm/message.doc.md +93 -10
  214. package/docs_for_llm/notification.doc.md +214 -0
  215. package/docs_for_llm/pagination.doc.md +30 -17
  216. package/docs_for_llm/paginationplus.doc.md +31 -10
  217. package/docs_for_llm/password.doc.md +86 -0
  218. package/docs_for_llm/popover.doc.md +24 -55
  219. package/docs_for_llm/progress.doc.md +13 -10
  220. package/docs_for_llm/projects.doc.md +91 -0
  221. package/docs_for_llm/protable.doc.md +98 -15
  222. package/docs_for_llm/queuevisualrange.doc.md +78 -0
  223. package/docs_for_llm/radio.doc.md +23 -8
  224. package/docs_for_llm/rate.doc.md +127 -0
  225. package/docs_for_llm/region.doc.md +25 -13
  226. package/docs_for_llm/scrollselect.doc.md +90 -0
  227. package/docs_for_llm/search.doc.md +120 -0
  228. package/docs_for_llm/searchinput.doc.md +111 -0
  229. package/docs_for_llm/searchitems.doc.md +116 -0
  230. package/docs_for_llm/searchselect.doc.md +126 -0
  231. package/docs_for_llm/select.doc.md +208 -49
  232. package/docs_for_llm/sidebar.doc.md +133 -0
  233. package/docs_for_llm/skeleton.doc.md +152 -0
  234. package/docs_for_llm/slider.doc.md +42 -22
  235. package/docs_for_llm/spin.doc.md +18 -6
  236. package/docs_for_llm/spinner.doc.md +28 -18
  237. package/docs_for_llm/split.doc.md +170 -0
  238. package/docs_for_llm/sshkeys.doc.md +88 -0
  239. package/docs_for_llm/status.doc.md +14 -9
  240. package/docs_for_llm/steps.doc.md +81 -7
  241. package/docs_for_llm/switch.doc.md +32 -16
  242. package/docs_for_llm/table.doc.md +317 -55
  243. package/docs_for_llm/tablecolumnid.doc.md +36 -16
  244. package/docs_for_llm/tabs.doc.md +117 -12
  245. package/docs_for_llm/tag.doc.md +167 -15
  246. package/docs_for_llm/timeline.doc.md +187 -0
  247. package/docs_for_llm/timepicker.doc.md +74 -36
  248. package/docs_for_llm/timerange.doc.md +157 -0
  249. package/docs_for_llm/tip.doc.md +50 -11
  250. package/docs_for_llm/tooltip.doc.md +99 -27
  251. package/docs_for_llm/tour.doc.md +125 -28
  252. package/docs_for_llm/transfer.doc.md +99 -33
  253. package/docs_for_llm/tree.doc.md +129 -24
  254. package/docs_for_llm/treeselect.doc.md +101 -44
  255. package/docs_for_llm/upload.doc.md +63 -32
  256. package/docs_for_llm/useCRUD.doc.md +49 -0
  257. package/docs_for_llm/useCountdown.doc.md +43 -0
  258. package/docs_for_llm/useDetail.doc.md +48 -0
  259. package/docs_for_llm/useDialog.doc.md +46 -0
  260. package/docs_for_llm/useEntity.doc.md +45 -0
  261. package/docs_for_llm/useEventListener.doc.md +44 -0
  262. package/docs_for_llm/useFalseUntilTruthy.doc.md +41 -0
  263. package/docs_for_llm/useGetCopyAuthText.doc.md +35 -0
  264. package/docs_for_llm/useGetUserPermission.doc.md +43 -0
  265. package/docs_for_llm/useGroup.doc.md +48 -0
  266. package/docs_for_llm/useIdEntities.doc.md +48 -0
  267. package/docs_for_llm/useIdEntity.doc.md +103 -0
  268. package/docs_for_llm/useInterval.doc.md +43 -0
  269. package/docs_for_llm/useLayoutStandardList.doc.md +38 -0
  270. package/docs_for_llm/useMessage.doc.md +46 -0
  271. package/docs_for_llm/useModifyCache.doc.md +37 -0
  272. package/docs_for_llm/useOpenDialog.doc.md +41 -0
  273. package/docs_for_llm/usePagination.doc.md +60 -0
  274. package/docs_for_llm/usePersist.doc.md +54 -0
  275. package/docs_for_llm/usePoll.doc.md +41 -0
  276. package/docs_for_llm/useRoutePlus.doc.md +34 -0
  277. package/docs_for_llm/useRouterPlus.doc.md +34 -0
  278. package/docs_for_llm/useSearch.doc.md +68 -0
  279. package/docs_for_llm/useShell.doc.md +43 -0
  280. package/docs_for_llm/useSkip.doc.md +41 -0
  281. package/docs_for_llm/useStorageIdEntity.doc.md +46 -0
  282. package/docs_for_llm/useStore.doc.md +34 -0
  283. package/docs_for_llm/useTable.doc.md +57 -0
  284. package/docs_for_llm/useTableGroup.doc.md +47 -0
  285. package/docs_for_llm/useTableSort.doc.md +40 -0
  286. package/docs_for_llm/useToState.doc.md +112 -0
  287. package/docs_for_llm/useUser.doc.md +38 -0
  288. package/docs_for_llm/useValidForm.doc.md +41 -0
  289. package/docs_for_llm/vdialog.doc.md +154 -0
  290. package/docs_for_llm/vdrawer.doc.md +148 -0
  291. package/docs_for_llm/virtuallist.doc.md +157 -3
  292. package/hooks/useCRUD.json +61 -0
  293. package/hooks/useCountdown.json +49 -0
  294. package/hooks/useDetail.json +67 -0
  295. package/hooks/useDialog.json +49 -0
  296. package/hooks/useEntity.json +61 -0
  297. package/hooks/useEventListener.json +61 -0
  298. package/hooks/useFalseUntilTruthy.json +43 -0
  299. package/hooks/useGetCopyAuthText.json +36 -0
  300. package/hooks/useGetUserPermission.json +55 -0
  301. package/hooks/useGroup.json +49 -0
  302. package/hooks/useIdEntities.json +61 -0
  303. package/hooks/useInterval.json +55 -0
  304. package/hooks/useLayoutStandardList.json +36 -0
  305. package/hooks/useMessage.json +73 -0
  306. package/hooks/useModifyCache.json +36 -0
  307. package/hooks/useOpenDialog.json +43 -0
  308. package/hooks/usePagination.json +49 -0
  309. package/hooks/usePersist.json +61 -0
  310. package/hooks/usePoll.json +43 -0
  311. package/hooks/useRoutePlus.json +36 -0
  312. package/hooks/useRouterPlus.json +36 -0
  313. package/hooks/useSearch.json +56 -0
  314. package/hooks/useShell.json +49 -0
  315. package/hooks/useSkip.json +43 -0
  316. package/hooks/useStorageIdEntity.json +67 -0
  317. package/hooks/useStore.json +36 -0
  318. package/hooks/useTable.json +49 -0
  319. package/hooks/useTableGroup.json +43 -0
  320. package/hooks/useTableSort.json +43 -0
  321. package/hooks/useUser.json +36 -0
  322. package/hooks/useValidForm.json +43 -0
  323. package/package.json +14 -8
  324. package/dist/chunk-D3Y6FGWA.js +0 -153
  325. package/dist/chunk-HPAUCD5I.js +0 -156
  326. package/dist/chunk-L4DS3EXI.mjs +0 -133
  327. package/dist/chunk-NZ6TLWMD.mjs +0 -151
@@ -0,0 +1,364 @@
1
+ 'use strict';
2
+
3
+ var compilerSfc = require('@vue/compiler-sfc');
4
+ var sucrase = require('sucrase');
5
+ var ts = require('typescript');
6
+
7
+ function _interopNamespace(e) {
8
+ if (e && e.__esModule) return e;
9
+ var n = Object.create(null);
10
+ if (e) {
11
+ Object.keys(e).forEach(function (k) {
12
+ if (k !== 'default') {
13
+ var d = Object.getOwnPropertyDescriptor(e, k);
14
+ Object.defineProperty(n, k, d.get ? d : {
15
+ enumerable: true,
16
+ get: function () { return e[k]; }
17
+ });
18
+ }
19
+ });
20
+ }
21
+ n.default = e;
22
+ return Object.freeze(n);
23
+ }
24
+
25
+ var ts__namespace = /*#__PURE__*/_interopNamespace(ts);
26
+
27
+ // src/tools/sfcCompiler.ts
28
+ var ALLOWED_IMPORT_SOURCES = [
29
+ "vue",
30
+ "@vue/",
31
+ "vue-router",
32
+ "@king-design/vue",
33
+ "@ksyun-internal/versatile"
34
+ ];
35
+ var VUE_RUNTIME_INJECTED_BINDINGS = /* @__PURE__ */ new Set([
36
+ "ref",
37
+ "reactive",
38
+ "computed",
39
+ "readonly",
40
+ "shallowRef",
41
+ "shallowReactive",
42
+ "toRef",
43
+ "toRefs",
44
+ "toRaw",
45
+ "markRaw",
46
+ "isRef",
47
+ "isReactive",
48
+ "isReadonly",
49
+ "isProxy",
50
+ "triggerRef",
51
+ "customRef",
52
+ "onMounted",
53
+ "onUnmounted",
54
+ "onBeforeMount",
55
+ "onBeforeUnmount",
56
+ "onUpdated",
57
+ "onBeforeUpdate",
58
+ "onActivated",
59
+ "onDeactivated",
60
+ "onErrorCaptured",
61
+ "watch",
62
+ "watchEffect",
63
+ "watchPostEffect",
64
+ "watchSyncEffect",
65
+ "defineProps",
66
+ "defineEmits",
67
+ "defineExpose",
68
+ "defineOptions",
69
+ "defineSlots",
70
+ "defineModel",
71
+ "withDefaults",
72
+ "useSlots",
73
+ "useAttrs",
74
+ "inject",
75
+ "provide",
76
+ "nextTick",
77
+ "getCurrentInstance",
78
+ "h",
79
+ "createVNode",
80
+ "resolveComponent"
81
+ ]);
82
+ var VERSATILE_RUNTIME_INJECTED_BINDINGS = /* @__PURE__ */ new Set([
83
+ "useToState",
84
+ "useIdEntity"
85
+ ]);
86
+ var INTERNAL_BINDING_PREFIXES = ["__imported_module_"];
87
+ function getRuntimeInjectedBindingsForSource(source) {
88
+ if (source === "vue" || source.startsWith("@vue/")) {
89
+ return VUE_RUNTIME_INJECTED_BINDINGS;
90
+ }
91
+ if (source === "vue-router") {
92
+ return /* @__PURE__ */ new Set([
93
+ "useRouter",
94
+ "useRoute",
95
+ "onBeforeRouteLeave",
96
+ "onBeforeRouteUpdate",
97
+ "RouterLink",
98
+ "RouterView"
99
+ ]);
100
+ }
101
+ if (source === "@ksyun-internal/versatile") {
102
+ return VERSATILE_RUNTIME_INJECTED_BINDINGS;
103
+ }
104
+ return /* @__PURE__ */ new Set();
105
+ }
106
+ function normalizeNamedImportSpecifiers(specifiers) {
107
+ return specifiers.split(",").map((part) => part.trim()).filter(Boolean).map((part) => {
108
+ const aliasMatch = part.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);
109
+ if (aliasMatch) {
110
+ return `${aliasMatch[1]}: ${aliasMatch[2]}`;
111
+ }
112
+ return part;
113
+ }).join(", ");
114
+ }
115
+ function shouldUseWhitelist(source, whitelist) {
116
+ return whitelist.some((allowedSource) => source === allowedSource || source.startsWith(`${allowedSource}/`));
117
+ }
118
+ function classifyImportSource(source, whitelist) {
119
+ if (shouldUseWhitelist(source, whitelist)) {
120
+ return "whitelisted";
121
+ }
122
+ if (source.startsWith(".")) {
123
+ return "relative";
124
+ }
125
+ return "unknown";
126
+ }
127
+ function scopeStyles(css, scopeClass) {
128
+ return css.replace(/([^\r\n,{}]+)(,(?=[^}]*{)|\s*{)/g, (match, selector, suffix) => {
129
+ if (selector.trim().startsWith("@")) return match;
130
+ const scopedSelector = selector.split(",").map((rawSelector) => {
131
+ const nextSelector = rawSelector.trim();
132
+ if (nextSelector === "body" || nextSelector === "html") return `.${scopeClass}`;
133
+ return `.${scopeClass} ${nextSelector}`;
134
+ }).join(", ");
135
+ return `${scopedSelector}${suffix}`;
136
+ });
137
+ }
138
+ function transformImportToBinding(importClause, sourceExpression) {
139
+ const trimmedClause = importClause.trim();
140
+ const namespaceMatch = trimmedClause.match(/^\*\s+as\s+(\w+)$/);
141
+ if (namespaceMatch) {
142
+ return `const ${namespaceMatch[1]} = ${sourceExpression};`;
143
+ }
144
+ const mixedMatch = trimmedClause.match(/^(\w+)\s*,\s*\{([^}]+)\}$/);
145
+ if (mixedMatch) {
146
+ const defaultName = mixedMatch[1];
147
+ const namedImports = normalizeNamedImportSpecifiers(mixedMatch[2]);
148
+ const moduleVar = `__imported_module_${defaultName}`;
149
+ return `const ${moduleVar} = ${sourceExpression}; const ${defaultName} = ${moduleVar}.default || ${moduleVar}; const { ${namedImports} } = ${moduleVar};`;
150
+ }
151
+ const defaultAndNamespaceMatch = trimmedClause.match(/^(\w+)\s*,\s*\*\s+as\s+(\w+)$/);
152
+ if (defaultAndNamespaceMatch) {
153
+ const defaultName = defaultAndNamespaceMatch[1];
154
+ const namespaceName = defaultAndNamespaceMatch[2];
155
+ const moduleVar = `__imported_module_${defaultName}`;
156
+ return `const ${moduleVar} = ${sourceExpression}; const ${defaultName} = ${moduleVar}.default || ${moduleVar}; const ${namespaceName} = ${moduleVar};`;
157
+ }
158
+ const namedMatch = trimmedClause.match(/^\{([^}]+)\}$/);
159
+ if (namedMatch) {
160
+ return `const { ${normalizeNamedImportSpecifiers(namedMatch[1])} } = ${sourceExpression};`;
161
+ }
162
+ const defaultMatch = trimmedClause.match(/^(\w+)$/);
163
+ if (defaultMatch) {
164
+ const defaultName = defaultMatch[1];
165
+ return `const ${defaultName} = ${sourceExpression}.default || ${sourceExpression};`;
166
+ }
167
+ return "";
168
+ }
169
+ function transformWhitelistedImport(importClause, source) {
170
+ const trimmedClause = importClause.trim();
171
+ const injectedBindings = getRuntimeInjectedBindingsForSource(source);
172
+ const buildNamedBinding = (specifiers, sourceExpression = `__getWhitelistedModule('${source}')`) => {
173
+ const namedBindings = specifiers.split(",").map((part) => part.trim()).filter(Boolean).map((part) => {
174
+ const aliasMatch = part.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);
175
+ if (aliasMatch) {
176
+ return `${aliasMatch[1]}: ${aliasMatch[2]}`;
177
+ }
178
+ return injectedBindings.has(part) ? null : part;
179
+ }).filter(Boolean);
180
+ if (namedBindings.length === 0) {
181
+ return "";
182
+ }
183
+ return `const { ${namedBindings.join(", ")} } = ${sourceExpression};`;
184
+ };
185
+ const namespaceMatch = trimmedClause.match(/^\*\s+as\s+(\w+)$/);
186
+ if (namespaceMatch) {
187
+ return `const ${namespaceMatch[1]} = __getWhitelistedModule('${source}');`;
188
+ }
189
+ const mixedMatch = trimmedClause.match(/^(\w+)\s*,\s*\{([^}]+)\}$/);
190
+ if (mixedMatch) {
191
+ const defaultName = mixedMatch[1];
192
+ const moduleVar = `__imported_module_${defaultName}`;
193
+ const parts = [
194
+ `const ${moduleVar} = __getWhitelistedModule('${source}');`,
195
+ `const ${defaultName} = ${moduleVar}.default || ${moduleVar};`
196
+ ];
197
+ const namedBinding = buildNamedBinding(mixedMatch[2], moduleVar);
198
+ if (namedBinding) {
199
+ parts.push(namedBinding);
200
+ }
201
+ return parts.join(" ");
202
+ }
203
+ const defaultAndNamespaceMatch = trimmedClause.match(/^(\w+)\s*,\s*\*\s+as\s+(\w+)$/);
204
+ if (defaultAndNamespaceMatch) {
205
+ const defaultName = defaultAndNamespaceMatch[1];
206
+ const namespaceName = defaultAndNamespaceMatch[2];
207
+ const moduleVar = `__imported_module_${defaultName}`;
208
+ return `const ${moduleVar} = __getWhitelistedModule('${source}'); const ${defaultName} = ${moduleVar}.default || ${moduleVar}; const ${namespaceName} = ${moduleVar};`;
209
+ }
210
+ const namedMatch = trimmedClause.match(/^\{([^}]+)\}$/);
211
+ if (namedMatch) {
212
+ return buildNamedBinding(namedMatch[1]);
213
+ }
214
+ const defaultMatch = trimmedClause.match(/^(\w+)$/);
215
+ if (defaultMatch) {
216
+ const defaultName = defaultMatch[1];
217
+ return `const ${defaultName} = __getWhitelistedModule('${source}').default || __getWhitelistedModule('${source}');`;
218
+ }
219
+ return "";
220
+ }
221
+ function collectRawScript(descriptor) {
222
+ return [descriptor.script?.content, descriptor.scriptSetup?.content].filter((block) => Boolean(block?.trim())).join("\n");
223
+ }
224
+ function transformValueImports(scriptContent, whitelist, strippedImports) {
225
+ let nextScript = scriptContent.replace(/import\s+type\s+[\s\S]*?from\s+['"].*?['"];?/g, "");
226
+ nextScript = nextScript.replace(
227
+ /import\s+([^;]+?)\s+from\s+['"]([^'"]+)['"];?/g,
228
+ (_match, importClause, source) => {
229
+ const reason = classifyImportSource(source, whitelist);
230
+ strippedImports.push({ source, reason });
231
+ if (reason === "whitelisted") {
232
+ return transformWhitelistedImport(importClause, source);
233
+ }
234
+ if (reason === "relative") {
235
+ return transformImportToBinding(importClause, `__mockModule('${source}')`);
236
+ }
237
+ return transformImportToBinding(importClause, `__mockModule('${source}')`);
238
+ }
239
+ );
240
+ nextScript = nextScript.replace(
241
+ /import\s+['"]([^'"]+)['"];?/g,
242
+ (_match, source) => {
243
+ const reason = classifyImportSource(source, whitelist);
244
+ strippedImports.push({ source, reason });
245
+ if (reason === "relative") {
246
+ return `__mockModule('${source}');`;
247
+ }
248
+ return `__mockModule('${source}');`;
249
+ }
250
+ );
251
+ return nextScript;
252
+ }
253
+ function stripExports(scriptContent) {
254
+ let nextScript = scriptContent;
255
+ nextScript = nextScript.replace(/export\s+default\s*\{[\s\S]*?\}\s*;?\s*$/g, "");
256
+ nextScript = nextScript.replace(/export\s+\{[\s\S]*?\}\s*;?/g, "");
257
+ nextScript = nextScript.replace(/export\s+default\s+/g, "");
258
+ nextScript = nextScript.replace(/export\s+(const|let|var|function|class|async\s+function)\s+/g, "$1 ");
259
+ return nextScript;
260
+ }
261
+ function transpileScript(scriptContent) {
262
+ const result = sucrase.transform(scriptContent, {
263
+ transforms: ["typescript"],
264
+ disableESTransforms: true
265
+ });
266
+ return result && typeof result.code === "string" ? result.code : scriptContent;
267
+ }
268
+ function extractBindingsFromScript(scriptContent) {
269
+ const bindings = /* @__PURE__ */ new Set();
270
+ try {
271
+ let extractNames2 = function(name) {
272
+ if (ts__namespace.isIdentifier(name)) {
273
+ bindings.add(name.text);
274
+ return;
275
+ }
276
+ if (ts__namespace.isObjectBindingPattern(name) || ts__namespace.isArrayBindingPattern(name)) {
277
+ name.elements.forEach((element) => {
278
+ if (ts__namespace.isBindingElement(element)) {
279
+ extractNames2(element.name);
280
+ }
281
+ });
282
+ }
283
+ }, visit2 = function(node) {
284
+ if (ts__namespace.isVariableStatement(node)) {
285
+ node.declarationList.declarations.forEach((decl) => extractNames2(decl.name));
286
+ } else if (ts__namespace.isFunctionDeclaration(node) && node.name) {
287
+ bindings.add(node.name.text);
288
+ } else if (ts__namespace.isClassDeclaration(node) && node.name) {
289
+ bindings.add(node.name.text);
290
+ }
291
+ };
292
+ var extractNames = extractNames2, visit = visit2;
293
+ const sourceFile = ts__namespace.createSourceFile(
294
+ "temp.ts",
295
+ scriptContent,
296
+ ts__namespace.ScriptTarget.Latest,
297
+ true
298
+ );
299
+ sourceFile.statements.forEach(visit2);
300
+ } catch {
301
+ return [];
302
+ }
303
+ return Array.from(bindings).filter(
304
+ (binding) => binding && /^[A-Za-z_$][\w$]*$/.test(binding) && !INTERNAL_BINDING_PREFIXES.some((prefix) => binding.startsWith(prefix))
305
+ );
306
+ }
307
+ function processExecutableScript(rawScript, whitelist, strippedImports) {
308
+ const withoutImports = transformValueImports(rawScript, whitelist, strippedImports);
309
+ const withoutExports = stripExports(withoutImports);
310
+ return transpileScript(withoutExports);
311
+ }
312
+ function getParseError(result) {
313
+ const firstError = result.errors[0];
314
+ if (!firstError) return void 0;
315
+ return typeof firstError === "string" ? firstError : firstError.message;
316
+ }
317
+ function compileSFC(code, scopeId, options) {
318
+ const whitelist = options?.allowedImports ?? ALLOWED_IMPORT_SOURCES;
319
+ const strippedImports = [];
320
+ try {
321
+ const parseResult = compilerSfc.parse(code, {
322
+ filename: "inline.vue",
323
+ sourceMap: false
324
+ });
325
+ const parseError = getParseError(parseResult);
326
+ if (parseError) {
327
+ return {
328
+ template: "",
329
+ script: "",
330
+ style: "",
331
+ bindings: [],
332
+ error: parseError
333
+ };
334
+ }
335
+ const { descriptor } = parseResult;
336
+ const template = descriptor.template?.content || "";
337
+ const rawScript = collectRawScript(descriptor);
338
+ const rawStyles = descriptor.styles.map((styleBlock) => styleBlock.content).join("\n");
339
+ const style = rawStyles ? scopeStyles(rawStyles, scopeId) : "";
340
+ if (!template && !rawScript) {
341
+ return { template: "", script: "", style: "", bindings: [] };
342
+ }
343
+ const executableScript = rawScript ? processExecutableScript(rawScript, whitelist, strippedImports) : "";
344
+ const bindings = executableScript ? extractBindingsFromScript(executableScript) : [];
345
+ return {
346
+ template,
347
+ script: executableScript,
348
+ style,
349
+ bindings,
350
+ strippedImports: strippedImports.length > 0 ? strippedImports : void 0
351
+ };
352
+ } catch (error) {
353
+ return {
354
+ template: "",
355
+ script: "",
356
+ style: "",
357
+ bindings: [],
358
+ error: error?.message || String(error)
359
+ };
360
+ }
361
+ }
362
+
363
+ exports.compileSFC = compileSFC;
364
+ exports.scopeStyles = scopeStyles;
@@ -1,8 +1,8 @@
1
+ import { resolveMetadataInheritance, resolvePackageResourceDir } from './chunk-QC6VTSA3.mjs';
1
2
  import { __commonJS, __toESM } from './chunk-UJCSKKID.mjs';
2
3
  import * as fs from 'fs/promises';
3
4
  import * as fsSync from 'fs';
4
5
  import * as path from 'path';
5
- import { fileURLToPath } from 'url';
6
6
  import { parse } from '@vue/compiler-sfc';
7
7
  import * as ts from 'typescript';
8
8
 
@@ -32205,14 +32205,8 @@ var require_compiler_core = __commonJS({
32205
32205
  }
32206
32206
  }
32207
32207
  });
32208
- var __filename$1 = fileURLToPath(import.meta.url);
32209
- var __dirname$1 = path.dirname(__filename$1);
32210
32208
  function resolveComponentsPath() {
32211
- const prodPath = path.join(__dirname$1, "../components");
32212
- if (fsSync.existsSync(prodPath)) return prodPath;
32213
- const devPath = path.join(__dirname$1, "../../components");
32214
- if (fsSync.existsSync(devPath)) return devPath;
32215
- return prodPath;
32209
+ return resolvePackageResourceDir("components");
32216
32210
  }
32217
32211
  var ComponentRegistry = class {
32218
32212
  constructor() {
@@ -32222,27 +32216,42 @@ var ComponentRegistry = class {
32222
32216
  // Path to components directory (resolved dynamically for dev/prod compatibility)
32223
32217
  this.metadataPath = resolveComponentsPath();
32224
32218
  }
32225
- async load() {
32226
- if (this.loaded) return;
32227
- await this.reload();
32228
- this.loaded = true;
32229
- this.startWatching();
32219
+ async load(options = {}) {
32220
+ if (!this.loaded) {
32221
+ await this.reload();
32222
+ this.loaded = true;
32223
+ }
32224
+ if (options.watch) {
32225
+ this.startWatching();
32226
+ }
32230
32227
  }
32231
32228
  /**
32232
32229
  * 重新加载所有组件元数据
32233
32230
  */
32234
32231
  async reload() {
32235
32232
  const newComponents = /* @__PURE__ */ new Map();
32233
+ const rawComponents = {};
32236
32234
  try {
32237
32235
  const files = await fs.readdir(this.metadataPath);
32238
32236
  for (const file of files) {
32239
32237
  if (!file.endsWith(".json")) continue;
32240
32238
  const content = await fs.readFile(path.join(this.metadataPath, file), "utf-8");
32241
32239
  const data = JSON.parse(content);
32242
- newComponents.set(data.name, data);
32243
- if (data.subComponents) {
32244
- for (const sub of data.subComponents) {
32245
- newComponents.set(sub.name, sub);
32240
+ rawComponents[data.name] = data;
32241
+ }
32242
+ for (const data of Object.values(rawComponents)) {
32243
+ const resolvedData = resolveMetadataInheritance(data, rawComponents);
32244
+ newComponents.set(resolvedData.name, resolvedData);
32245
+ if (resolvedData.subComponents) {
32246
+ for (const sub of resolvedData.subComponents) {
32247
+ newComponents.set(sub.name, {
32248
+ id: sub.name,
32249
+ name: sub.name,
32250
+ props: sub.props || [],
32251
+ events: sub.events || [],
32252
+ slots: sub.slots || [],
32253
+ methods: sub.methods || []
32254
+ });
32246
32255
  }
32247
32256
  }
32248
32257
  }
@@ -32298,14 +32307,8 @@ var componentRegistry = new ComponentRegistry();
32298
32307
 
32299
32308
  // src/analysis/astReviewer.ts
32300
32309
  var import_compiler_core = __toESM(require_compiler_core());
32301
- var __filename2 = fileURLToPath(import.meta.url);
32302
- var __dirname2 = path.dirname(__filename2);
32303
32310
  function resolveHooksPath() {
32304
- const prodPath = path.join(__dirname2, "../hooks");
32305
- if (fsSync.existsSync(prodPath)) return prodPath;
32306
- const devPath = path.join(__dirname2, "../../hooks");
32307
- if (fsSync.existsSync(devPath)) return devPath;
32308
- return prodPath;
32311
+ return resolvePackageResourceDir("hooks");
32309
32312
  }
32310
32313
  var HooksRegistry = class {
32311
32314
  constructor() {
@@ -32314,11 +32317,14 @@ var HooksRegistry = class {
32314
32317
  this.watcher = null;
32315
32318
  this.metadataPath = resolveHooksPath();
32316
32319
  }
32317
- async load() {
32318
- if (this.loaded) return;
32319
- await this.reload();
32320
- this.loaded = true;
32321
- this.startWatching();
32320
+ async load(options = {}) {
32321
+ if (!this.loaded) {
32322
+ await this.reload();
32323
+ this.loaded = true;
32324
+ }
32325
+ if (options.watch) {
32326
+ this.startWatching();
32327
+ }
32322
32328
  }
32323
32329
  /**
32324
32330
  * 重新加载所有 hooks 元数据
@@ -32721,24 +32727,10 @@ var STRICT_CHECK_ATTRIBUTES = /* @__PURE__ */ new Set([
32721
32727
  "checked",
32722
32728
  "selected"
32723
32729
  ]);
32724
- var VERSATILE_COMPONENTS = /* @__PURE__ */ new Set([
32725
- "BillTypes",
32726
- "Region",
32727
- "AZ",
32728
- "LayoutContent",
32729
- "CardContent",
32730
- "ProTable",
32731
- "PaginationPlus",
32732
- "Status",
32733
- "TableColumnId",
32734
- "IconTooltip",
32735
- "ButtonLink"
32736
- ]);
32737
32730
  var NESTING_RULES = {
32738
32731
  "DropdownItem": ["DropdownMenu"],
32739
32732
  "DropdownMenu": ["Dropdown"],
32740
32733
  "TableColumn": ["Table", "ProTable"],
32741
- "FormItem": ["Form"],
32742
32734
  "Tab": ["Tabs"],
32743
32735
  "Step": ["Steps"],
32744
32736
  "MenuItem": ["Menu", "SubMenu"],
@@ -32987,6 +32979,16 @@ function isTemplateBuiltin(id) {
32987
32979
  function isJsKeyword(id) {
32988
32980
  return JS_KEYWORDS.has(id);
32989
32981
  }
32982
+ function resolveExpectedImportSource(metadata) {
32983
+ const importStatement = metadata.importStatement || "";
32984
+ if (importStatement.includes("@ksyun-internal/versatile")) {
32985
+ return "@ksyun-internal/versatile";
32986
+ }
32987
+ if (importStatement.includes("@king-design/vue")) {
32988
+ return "@king-design/vue";
32989
+ }
32990
+ return null;
32991
+ }
32990
32992
  function checkImport(node, violations, sourceFile) {
32991
32993
  const moduleSpecifier = node.moduleSpecifier.getText(sourceFile).replace(/['\"]/g, "");
32992
32994
  if (moduleSpecifier === "@king-design/vue" || moduleSpecifier === "@ksyun-internal/versatile") {
@@ -33030,10 +33032,10 @@ function checkImport(node, violations, sourceFile) {
33030
33032
  suggestion: `\u76F4\u63A5\u4F7F\u7528\u539F\u540D: import { ${originalName} } from '${moduleSpecifier}'`
33031
33033
  });
33032
33034
  }
33033
- if (componentRegistry.isKnownComponent(originalName)) {
33034
- const isVersatile = VERSATILE_COMPONENTS.has(originalName);
33035
- const expectedPackage = isVersatile ? "@ksyun-internal/versatile" : "@king-design/vue";
33036
- if (expectedPackage !== moduleSpecifier) {
33035
+ const metadata = componentRegistry.getComponent(originalName);
33036
+ if (metadata) {
33037
+ const expectedPackage = resolveExpectedImportSource(metadata);
33038
+ if (expectedPackage && expectedPackage !== moduleSpecifier) {
33037
33039
  violations.push({
33038
33040
  rule: `\u7EC4\u4EF6 ${originalName} \u5BFC\u5165\u6E90\u9519\u8BEF`,
33039
33041
  match: `import { ... } from '${moduleSpecifier}'`,
@@ -33065,7 +33067,7 @@ function checkNestingRules(tagName, metadata, ancestors, violations) {
33065
33067
  });
33066
33068
  }
33067
33069
  }
33068
- function checkComponentSpecificRules(tagName, node, violations) {
33070
+ function checkComponentSpecificRules(tagName, node, metadata, violations) {
33069
33071
  if (tagName === "Dropdown") {
33070
33072
  node.children?.forEach((child) => {
33071
33073
  if (child.type === 1 && child.tag === "template") {
@@ -33104,23 +33106,110 @@ function checkComponentSpecificRules(tagName, node, violations) {
33104
33106
  }
33105
33107
  });
33106
33108
  }
33107
- if (tagName === "TableColumn") {
33108
- node.children?.forEach((child) => {
33109
- if (child.type === 1 && child.tag === "template") {
33110
- const slotProp = child.props?.find((p) => p.type === 7 && p.name === "slot");
33111
- if (slotProp && slotProp.exp && slotProp.exp.content) {
33112
- const exp = slotProp.exp.content.trim();
33113
- if (exp.startsWith("{") && exp.endsWith("}")) {
33114
- violations.push({
33115
- rule: "TableColumn \u63D2\u69FD\u53C2\u6570\u5E94\u4E3A\u6570\u7EC4\u7ED3\u6784",
33116
- match: exp,
33117
- suggestion: `King Design \u8868\u683C\u63D2\u69FD\u53C2\u6570\u4E3A\u6570\u7EC4\u987A\u5E8F\u4F20\u9012\uFF0C\u8BF7\u5C06 ${exp} \u6539\u4E3A [row]`
33118
- });
33119
- }
33120
- }
33121
- }
33122
- });
33109
+ if (!metadata?.slots?.length) {
33110
+ return;
33111
+ }
33112
+ const validateSlotBinding = (slotName, expression) => {
33113
+ if (!expression) return;
33114
+ const slot = metadata.slots.find((item) => item.name === slotName);
33115
+ if (!slot) return;
33116
+ const exp = expression.trim();
33117
+ const bindingType = resolveSlotBindingType(slot);
33118
+ if (!bindingType) return;
33119
+ if (bindingType === "none") {
33120
+ violations.push({
33121
+ rule: `${tagName} \u63D2\u69FD #${slotName} \u4E0D\u63D0\u4F9B\u53C2\u6570`,
33122
+ match: exp,
33123
+ suggestion: `\u8BF7\u79FB\u9664 ${slotName} \u63D2\u69FD\u4E0A\u7684\u53C2\u6570\u58F0\u660E`
33124
+ });
33125
+ return;
33126
+ }
33127
+ if (bindingType === "array" && isObjectDestructuringExpression(exp)) {
33128
+ violations.push({
33129
+ rule: `${tagName} \u63D2\u69FD\u53C2\u6570\u5E94\u4E3A\u6570\u7EC4\u7ED3\u6784`,
33130
+ match: exp,
33131
+ suggestion: `\u8BF7\u5C06 ${exp} \u6539\u4E3A ${getSlotBindingExample(slot, "array")}`
33132
+ });
33133
+ return;
33134
+ }
33135
+ if (bindingType === "object" && isArrayDestructuringExpression(exp)) {
33136
+ violations.push({
33137
+ rule: `${tagName} \u63D2\u69FD\u53C2\u6570\u5E94\u4E3A\u5BF9\u8C61\u7ED3\u6784`,
33138
+ match: exp,
33139
+ suggestion: `\u8BF7\u5C06 ${exp} \u6539\u4E3A ${getSlotBindingExample(slot, "object")}`
33140
+ });
33141
+ return;
33142
+ }
33143
+ if (bindingType === "single" && (isArrayDestructuringExpression(exp) || isObjectDestructuringExpression(exp))) {
33144
+ violations.push({
33145
+ rule: `${tagName} \u63D2\u69FD\u53C2\u6570\u5E94\u4E3A\u5355\u503C\u7ED3\u6784`,
33146
+ match: exp,
33147
+ suggestion: `\u8BF7\u5C06 ${exp} \u6539\u4E3A ${getSlotBindingExample(slot, "single")}`
33148
+ });
33149
+ }
33150
+ };
33151
+ node.props.forEach((prop) => {
33152
+ if (prop.type !== 7 || prop.name !== "slot") return;
33153
+ validateSlotBinding(slotNameFromVSlotDirective(prop), getDirectiveExpressionContent(prop.exp));
33154
+ });
33155
+ node.children?.forEach((child) => {
33156
+ if (child.type !== 1 || child.tag !== "template") return;
33157
+ const slotProp = child.props?.find((p) => p.type === 7 && p.name === "slot");
33158
+ if (!slotProp) return;
33159
+ validateSlotBinding(slotNameFromVSlotDirective(slotProp), getDirectiveExpressionContent(slotProp.exp));
33160
+ });
33161
+ }
33162
+ function isArrayDestructuringExpression(expression) {
33163
+ return expression.startsWith("[") && expression.endsWith("]");
33164
+ }
33165
+ function isObjectDestructuringExpression(expression) {
33166
+ return expression.startsWith("{") && expression.endsWith("}");
33167
+ }
33168
+ function extractBindingExpressionFromVueTemplate(vueTemplate) {
33169
+ if (!vueTemplate) return void 0;
33170
+ const match = vueTemplate.match(/=\s*"([^"]+)"/);
33171
+ return match?.[1]?.trim();
33172
+ }
33173
+ function getDirectiveExpressionContent(exp) {
33174
+ if (!exp || !("content" in exp)) return void 0;
33175
+ return typeof exp.content === "string" ? exp.content : void 0;
33176
+ }
33177
+ function resolveSlotBindingType(slot) {
33178
+ if (slot.bindingType) {
33179
+ return slot.bindingType;
33180
+ }
33181
+ const templateExpression = extractBindingExpressionFromVueTemplate(slot.vueTemplate);
33182
+ if (templateExpression) {
33183
+ if (isArrayDestructuringExpression(templateExpression)) return "array";
33184
+ if (isObjectDestructuringExpression(templateExpression)) return "object";
33185
+ }
33186
+ const destructuringExample = slot.slotProps?.find((prop) => prop.destructuringExample)?.destructuringExample?.trim();
33187
+ if (destructuringExample) {
33188
+ if (isArrayDestructuringExpression(destructuringExample)) return "array";
33189
+ if (isObjectDestructuringExpression(destructuringExample)) return "object";
33190
+ }
33191
+ return void 0;
33192
+ }
33193
+ function getSlotBindingExample(slot, fallbackType) {
33194
+ const templateExpression = extractBindingExpressionFromVueTemplate(slot.vueTemplate);
33195
+ if (templateExpression) {
33196
+ return templateExpression;
33197
+ }
33198
+ const destructuringExample = slot.slotProps?.find((prop) => prop.destructuringExample)?.destructuringExample?.trim();
33199
+ if (destructuringExample) {
33200
+ return destructuringExample;
33201
+ }
33202
+ const paramNames = slot.slotProps?.map((prop) => prop.name).filter(Boolean) || [];
33203
+ if (paramNames.length > 0) {
33204
+ if (fallbackType === "single") {
33205
+ return paramNames[0];
33206
+ }
33207
+ return fallbackType === "array" ? `[${paramNames.join(", ")}]` : `{ ${paramNames.join(", ")} }`;
33208
+ }
33209
+ if (fallbackType === "single") {
33210
+ return "slotProp";
33123
33211
  }
33212
+ return fallbackType === "array" ? "[slotProps]" : "{ slotProps }";
33124
33213
  }
33125
33214
  function typeRawAllowsNumber(typeRaw) {
33126
33215
  if (!typeRaw) return false;
@@ -33211,7 +33300,7 @@ function checkEvents(tagName, node, metadata, violations) {
33211
33300
  (e) => e.name === eventName || e.name === camelCaseEvent || e.name.toLowerCase() === eventName.toLowerCase()
33212
33301
  );
33213
33302
  const isNativeEvent = NATIVE_EVENTS.has(eventName);
33214
- if (!isEventValid && !isNativeEvent && metadata.events && metadata.events.length > 0) {
33303
+ if (!isEventValid && !isNativeEvent) {
33215
33304
  violations.push({
33216
33305
  rule: `\u4E8B\u4EF6 @${eventName} \u4E0D\u5B58\u5728\u4E8E ${tagName}`,
33217
33306
  match: `@${eventName}`,
@@ -33286,7 +33375,7 @@ function checkTemplate(node, violations, ancestors) {
33286
33375
  if (metadata) {
33287
33376
  checkNestingRules(displayTag, metadata, ancestors, violations);
33288
33377
  }
33289
- checkComponentSpecificRules(displayTag, elementNode, violations);
33378
+ checkComponentSpecificRules(displayTag, elementNode, metadata, violations);
33290
33379
  if (metadata) {
33291
33380
  checkProps(displayTag, elementNode, metadata, violations);
33292
33381
  checkEvents(displayTag, elementNode, metadata, violations);