@xlabs-store/core 0.0.1 → 0.0.3

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 (1097) hide show
  1. package/LICENSE +21 -21
  2. package/components/index.d.ts +0 -0
  3. package/components/index.js +1 -1
  4. package/components/p--BbMiBIf.js +1 -0
  5. package/components/p-4BROAJ-M.js +1 -0
  6. package/components/p-9T3IQVUX.js +1 -0
  7. package/components/p-B1Y8S28h.js +1 -0
  8. package/components/p-B5VsEsBC.js +1 -0
  9. package/components/p-B7SdFSQT.js +1 -0
  10. package/components/p-B97Hj_bs.js +1 -0
  11. package/components/p-BBTo0Tfc.js +1 -0
  12. package/components/p-BCuFZ3xx.js +1 -0
  13. package/components/p-BFPoQ179.js +1 -0
  14. package/components/p-BLqwG7xa.js +1 -0
  15. package/components/p-BPaLHj9P.js +1 -0
  16. package/components/p-BQtB82ld.js +1 -0
  17. package/components/p-BSLE4EQn.js +1 -0
  18. package/components/{p-DcRlYBIl.js → p-BUXxKr3t.js} +1 -1
  19. package/components/p-BYCebYZT.js +1 -0
  20. package/components/p-BZdNMS4e.js +1 -0
  21. package/components/p-BhWqNJhk.js +1 -0
  22. package/components/p-BnnNgLpE.js +1 -0
  23. package/components/p-BoPZ9Se8.js +1 -0
  24. package/components/p-BogEYBiK.js +1 -0
  25. package/components/p-Brr9Q7gj.js +1 -0
  26. package/components/p-BvOnPBRo.js +1 -0
  27. package/components/p-BzX-LA7W.js +1 -0
  28. package/components/p-C-KgrbKX.js +1 -0
  29. package/components/{p-CfhgoXyB.js → p-C-rau5Ex.js} +1 -1
  30. package/components/{p-B4R9Mtmk.js → p-C1PUbETy.js} +1 -1
  31. package/components/p-C1_JmoB8.js +1 -0
  32. package/components/{p-noTpj1Kh.js → p-C3Kx_-Wc.js} +1 -1
  33. package/components/p-CIOnWzKr.js +1 -0
  34. package/components/p-CQ2VND9-.js +1 -0
  35. package/components/p-CQQI-pRu.js +1 -0
  36. package/components/p-CXhCHTJf.js +1 -0
  37. package/components/p-CaJOfbTg.js +1 -0
  38. package/components/p-Cf_74fjT.js +1 -0
  39. package/components/{p-DVz50Dd3.js → p-CgLn4Y4c.js} +1 -1
  40. package/components/p-CgaLhv3u.js +1 -0
  41. package/components/{p-CGYOWZnh.js → p-CijqjTOk.js} +1 -1
  42. package/components/p-CkwLFDlS.js +1 -0
  43. package/components/p-CkyEMR2k.js +1 -0
  44. package/components/{p-Ce32Mo_Q.js → p-CmfyRJYt.js} +1 -1
  45. package/components/p-CnPsn8zN.js +1 -0
  46. package/components/p-Cp3SPBy3.js +1 -0
  47. package/components/p-CsYh9t-z.js +1 -0
  48. package/components/{p-BM-ap7lt.js → p-CtFbsd8j.js} +1 -1
  49. package/components/p-Cuf33Rgj.js +1 -0
  50. package/components/p-CwNmnRmr.js +1 -0
  51. package/components/p-CxMQkHjk.js +1 -0
  52. package/components/p-CzErFq8K.js +1 -0
  53. package/components/p-CzHtwC1k.js +1 -0
  54. package/components/p-CzjK_fJj.js +1 -0
  55. package/components/p-D4Joi-Km.js +1 -0
  56. package/components/p-D4am7l6X.js +1 -0
  57. package/components/p-D7kqIlVo.js +1 -0
  58. package/components/p-DFzUUEiS.js +1 -0
  59. package/components/p-DINdyuGa.js +1 -0
  60. package/components/p-DIZuWptV.js +1 -0
  61. package/components/p-DPo53FC8.js +1 -0
  62. package/components/p-DPt8hDp3.js +1 -0
  63. package/components/p-DSC5zsOB.js +1 -0
  64. package/components/{p-Co3Y9VjQ.js → p-DSa1uqPO.js} +1 -1
  65. package/components/p-DT7-VE44.js +1 -0
  66. package/components/p-DTPUsC3Q.js +1 -0
  67. package/components/p-DUjF0MeP.js +1 -0
  68. package/components/p-DXMO8s1V.js +1 -0
  69. package/components/p-DZtvVtvb.js +1 -0
  70. package/components/p-D_184xNl.js +1 -0
  71. package/components/p-D_hKBumm.js +1 -0
  72. package/components/p-Da7AZprv.js +1 -0
  73. package/components/p-DcqkhKqy.js +1 -0
  74. package/components/p-Dkga4pDL.js +1 -0
  75. package/components/p-Dn1c0e9W.js +1 -0
  76. package/components/p-DobuHW4v.js +1 -0
  77. package/components/p-DqayamUz.js +1 -0
  78. package/components/{p-Cd919NAP.js → p-DtIk7IPf.js} +1 -1
  79. package/components/p-DwySgZYx.js +1 -0
  80. package/components/p-DynL8Hj8.js +1 -0
  81. package/components/p-EYMvnfpO.js +1 -0
  82. package/components/p-K2tV3sog.js +1 -0
  83. package/components/p-LX68sH4m.js +1 -0
  84. package/components/{p-CKVSyuIH.js → p-MRcLOacJ.js} +1 -1
  85. package/components/p-N4_1eZ9k.js +1 -0
  86. package/components/p-PNU1f8B9.js +1 -0
  87. package/components/p-SFcKtdEL.js +1 -0
  88. package/components/p-VezrLuwj.js +1 -0
  89. package/components/p-eF_oZrS1.js +1 -0
  90. package/components/p-ez-wfqCC.js +1 -0
  91. package/components/p-gQbQhfDs.js +1 -0
  92. package/components/p-ibXnjCdF.js +1 -0
  93. package/components/p-jTIj1nFL.js +1 -0
  94. package/components/p-k2uLDFNn.js +1 -0
  95. package/components/p-pK9HRi91.js +1 -0
  96. package/components/p-sijpPVRP.js +1 -0
  97. package/components/p-tMIvQ4L0.js +1 -0
  98. package/components/p-yktKa2eA.js +1 -0
  99. package/components/x-address.js +1 -1
  100. package/components/x-affix.d.ts +0 -0
  101. package/components/x-affix.js +1 -1
  102. package/components/x-alert.d.ts +0 -0
  103. package/components/x-alert.js +1 -1
  104. package/components/x-anchor-link.d.ts +0 -0
  105. package/components/x-anchor-link.js +1 -1
  106. package/components/x-anchor.d.ts +0 -0
  107. package/components/x-anchor.js +1 -1
  108. package/components/x-app.d.ts +0 -0
  109. package/components/x-app.js +1 -1
  110. package/components/x-auto-complete-dropdown-content.d.ts +0 -0
  111. package/components/x-auto-complete-dropdown-content.js +1 -1
  112. package/components/x-auto-complete.d.ts +0 -0
  113. package/components/x-auto-complete.js +1 -1
  114. package/components/x-avatar.d.ts +0 -0
  115. package/components/x-avatar.js +1 -1
  116. package/components/x-back-top.js +1 -1
  117. package/components/x-badge.d.ts +0 -0
  118. package/components/x-badge.js +1 -1
  119. package/components/x-breadcrumb-item.d.ts +0 -0
  120. package/components/x-breadcrumb-item.js +1 -1
  121. package/components/x-breadcrumb.d.ts +0 -0
  122. package/components/x-breadcrumb.js +1 -1
  123. package/components/x-button.d.ts +0 -0
  124. package/components/x-button.js +1 -1
  125. package/components/x-captcha.js +1 -1
  126. package/components/x-card.d.ts +0 -0
  127. package/components/x-card.js +1 -1
  128. package/components/x-carousel.d.ts +0 -0
  129. package/components/x-carousel.js +1 -1
  130. package/components/x-cascader-dropdown-content.d.ts +0 -0
  131. package/components/x-cascader-dropdown-content.js +1 -1
  132. package/components/x-cascader.d.ts +0 -0
  133. package/components/x-cascader.js +1 -1
  134. package/components/x-checkbox.d.ts +0 -0
  135. package/components/x-checkbox.js +1 -1
  136. package/components/x-code-editor.d.ts +11 -0
  137. package/components/x-code-editor.js +1 -0
  138. package/components/x-col.d.ts +0 -0
  139. package/components/x-col.js +1 -1
  140. package/components/x-collapse-panel.d.ts +0 -0
  141. package/components/x-collapse-panel.js +1 -1
  142. package/components/x-collapse.d.ts +0 -0
  143. package/components/x-collapse.js +1 -1
  144. package/components/x-color-picker-panel.d.ts +0 -0
  145. package/components/x-color-picker-panel.js +1 -1
  146. package/components/x-color-picker.d.ts +0 -0
  147. package/components/x-color-picker.js +1 -1
  148. package/components/x-comment.d.ts +0 -0
  149. package/components/x-comment.js +1 -1
  150. package/components/x-content.d.ts +0 -0
  151. package/components/x-content.js +1 -1
  152. package/components/x-date-picker-dropdown-content.d.ts +0 -0
  153. package/components/x-date-picker-dropdown-content.js +1 -1
  154. package/components/x-date-picker.d.ts +0 -0
  155. package/components/x-date-picker.js +1 -1
  156. package/components/x-descriptions-item.d.ts +0 -0
  157. package/components/x-descriptions-item.js +1 -1
  158. package/components/x-descriptions.d.ts +0 -0
  159. package/components/x-descriptions.js +1 -1
  160. package/components/x-divider.d.ts +0 -0
  161. package/components/x-divider.js +1 -1
  162. package/components/x-drawer-content.d.ts +0 -0
  163. package/components/x-drawer-content.js +1 -1
  164. package/components/x-drawer.d.ts +0 -0
  165. package/components/x-drawer.js +1 -1
  166. package/components/x-dropdown-content.d.ts +0 -0
  167. package/components/x-dropdown-content.js +1 -1
  168. package/components/x-dropdown.d.ts +0 -0
  169. package/components/x-dropdown.js +1 -1
  170. package/components/x-editor.d.ts +0 -0
  171. package/components/x-editor.js +1 -1
  172. package/components/x-empty.d.ts +0 -0
  173. package/components/x-empty.js +1 -1
  174. package/components/x-finder.d.ts +0 -0
  175. package/components/x-finder.js +1 -1
  176. package/components/x-flex.d.ts +0 -0
  177. package/components/x-flex.js +1 -1
  178. package/components/x-float-button.d.ts +0 -0
  179. package/components/x-float-button.js +1 -1
  180. package/components/x-footer.d.ts +0 -0
  181. package/components/x-footer.js +1 -1
  182. package/components/x-form-builder.d.ts +0 -0
  183. package/components/x-form-builder.js +1 -1
  184. package/components/x-form-item.d.ts +0 -0
  185. package/components/x-form-item.js +1 -1
  186. package/components/x-form.d.ts +0 -0
  187. package/components/x-form.js +1 -1
  188. package/components/x-header.d.ts +0 -0
  189. package/components/x-header.js +1 -1
  190. package/components/x-icon-picker-dropdown-content.d.ts +11 -0
  191. package/components/x-icon-picker-dropdown-content.js +1 -0
  192. package/components/x-icon.d.ts +0 -0
  193. package/components/x-icon.js +1 -1
  194. package/components/x-image.d.ts +0 -0
  195. package/components/x-image.js +1 -1
  196. package/components/x-infinite-scroll.d.ts +0 -0
  197. package/components/x-infinite-scroll.js +1 -1
  198. package/components/x-input-icon.d.ts +11 -0
  199. package/components/x-input-icon.js +1 -0
  200. package/components/x-input-number.d.ts +0 -0
  201. package/components/x-input-number.js +1 -1
  202. package/components/x-input.d.ts +0 -0
  203. package/components/x-input.js +1 -1
  204. package/components/x-layout-admin.d.ts +11 -0
  205. package/components/x-layout-admin.js +1 -0
  206. package/components/x-layout-detail.d.ts +11 -0
  207. package/components/x-layout-detail.js +1 -0
  208. package/components/x-layout-list.d.ts +11 -0
  209. package/components/x-layout-list.js +1 -0
  210. package/components/x-layout.d.ts +0 -0
  211. package/components/x-layout.js +1 -1
  212. package/components/x-list-item.js +1 -1
  213. package/components/x-list.d.ts +0 -0
  214. package/components/x-list.js +1 -1
  215. package/components/x-login.d.ts +11 -0
  216. package/components/x-login.js +1 -0
  217. package/components/x-mentions.d.ts +0 -0
  218. package/components/x-mentions.js +1 -1
  219. package/components/x-menu-divider.d.ts +0 -0
  220. package/components/x-menu-divider.js +1 -1
  221. package/components/x-menu-item-group.d.ts +0 -0
  222. package/components/x-menu-item-group.js +1 -1
  223. package/components/x-menu-item.d.ts +0 -0
  224. package/components/x-menu-item.js +1 -1
  225. package/components/x-menu-submenu.d.ts +0 -0
  226. package/components/x-menu-submenu.js +1 -1
  227. package/components/x-menu.d.ts +0 -0
  228. package/components/x-menu.js +1 -1
  229. package/components/x-message.d.ts +0 -0
  230. package/components/x-message.js +1 -1
  231. package/components/x-modal-content.d.ts +0 -0
  232. package/components/x-modal-content.js +1 -1
  233. package/components/x-modal.d.ts +0 -0
  234. package/components/x-modal.js +1 -1
  235. package/components/x-notification.d.ts +0 -0
  236. package/components/x-notification.js +1 -1
  237. package/components/x-page-header.js +1 -1
  238. package/components/x-pagination.d.ts +0 -0
  239. package/components/x-pagination.js +1 -1
  240. package/components/x-popconfirm-content.d.ts +0 -0
  241. package/components/x-popconfirm-content.js +1 -1
  242. package/components/x-popconfirm.d.ts +0 -0
  243. package/components/x-popconfirm.js +1 -1
  244. package/components/x-popover-content.d.ts +0 -0
  245. package/components/x-popover-content.js +1 -1
  246. package/components/x-popover.d.ts +0 -0
  247. package/components/x-popover.js +1 -1
  248. package/components/x-progress.d.ts +0 -0
  249. package/components/x-progress.js +1 -1
  250. package/components/x-qr-code.d.ts +0 -0
  251. package/components/x-qr-code.js +1 -1
  252. package/components/x-radio-group.d.ts +0 -0
  253. package/components/x-radio-group.js +1 -1
  254. package/components/x-radio.d.ts +0 -0
  255. package/components/x-radio.js +1 -1
  256. package/components/x-range-picker-dropdown-content.d.ts +0 -0
  257. package/components/x-range-picker-dropdown-content.js +1 -1
  258. package/components/x-range-picker.d.ts +0 -0
  259. package/components/x-range-picker.js +1 -1
  260. package/components/x-rate.d.ts +0 -0
  261. package/components/x-rate.js +1 -1
  262. package/components/x-result.d.ts +0 -0
  263. package/components/x-result.js +1 -1
  264. package/components/x-row.d.ts +0 -0
  265. package/components/x-row.js +1 -1
  266. package/components/x-segmented.d.ts +0 -0
  267. package/components/x-segmented.js +1 -1
  268. package/components/x-select-dropdown-content.d.ts +0 -0
  269. package/components/x-select-dropdown-content.js +1 -1
  270. package/components/x-select-option.d.ts +0 -0
  271. package/components/x-select-option.js +1 -1
  272. package/components/x-select.d.ts +0 -0
  273. package/components/x-select.js +1 -1
  274. package/components/x-sider.d.ts +0 -0
  275. package/components/x-sider.js +1 -1
  276. package/components/x-skeleton.d.ts +0 -0
  277. package/components/x-skeleton.js +1 -1
  278. package/components/x-slider.d.ts +0 -0
  279. package/components/x-slider.js +1 -1
  280. package/components/x-space.d.ts +0 -0
  281. package/components/x-space.js +1 -1
  282. package/components/x-spin.d.ts +0 -0
  283. package/components/x-spin.js +1 -1
  284. package/components/x-splitter-panel.d.ts +0 -0
  285. package/components/x-splitter-panel.js +1 -1
  286. package/components/x-splitter.d.ts +0 -0
  287. package/components/x-splitter.js +1 -1
  288. package/components/x-statistic.d.ts +0 -0
  289. package/components/x-statistic.js +1 -1
  290. package/components/x-step.d.ts +0 -0
  291. package/components/x-step.js +1 -1
  292. package/components/x-steps.d.ts +0 -0
  293. package/components/x-steps.js +1 -1
  294. package/components/x-switch.d.ts +0 -0
  295. package/components/x-switch.js +1 -1
  296. package/components/x-tab-pane.js +1 -1
  297. package/components/x-table-cell.d.ts +0 -0
  298. package/components/x-table-cell.js +1 -1
  299. package/components/x-table-row.d.ts +0 -0
  300. package/components/x-table-row.js +1 -1
  301. package/components/x-table.d.ts +0 -0
  302. package/components/x-table.js +1 -1
  303. package/components/x-tabs.d.ts +0 -0
  304. package/components/x-tabs.js +1 -1
  305. package/components/x-tag.d.ts +0 -0
  306. package/components/x-tag.js +1 -1
  307. package/components/x-textarea.d.ts +0 -0
  308. package/components/x-textarea.js +1 -1
  309. package/components/x-time-picker-dropdown-content.d.ts +0 -0
  310. package/components/x-time-picker-dropdown-content.js +1 -1
  311. package/components/x-time-picker.d.ts +0 -0
  312. package/components/x-time-picker.js +1 -1
  313. package/components/x-timeline-item.d.ts +0 -0
  314. package/components/x-timeline-item.js +1 -1
  315. package/components/x-timeline.d.ts +0 -0
  316. package/components/x-timeline.js +1 -1
  317. package/components/x-tooltip-content.d.ts +0 -0
  318. package/components/x-tooltip-content.js +1 -1
  319. package/components/x-tooltip.d.ts +0 -0
  320. package/components/x-tooltip.js +1 -1
  321. package/components/x-tour-panel.d.ts +0 -0
  322. package/components/x-tour-panel.js +1 -1
  323. package/components/x-tour.d.ts +0 -0
  324. package/components/x-tour.js +1 -1
  325. package/components/x-transfer.d.ts +0 -0
  326. package/components/x-transfer.js +1 -1
  327. package/components/x-tree-select-dropdown-content.js +1 -1
  328. package/components/x-tree-select.d.ts +0 -0
  329. package/components/x-tree-select.js +1 -1
  330. package/components/x-tree.d.ts +0 -0
  331. package/components/x-tree.js +1 -1
  332. package/components/x-typography.d.ts +0 -0
  333. package/components/x-typography.js +1 -1
  334. package/components/x-upload.d.ts +0 -0
  335. package/components/x-upload.js +1 -1
  336. package/components/x-virtual-scroll.d.ts +0 -0
  337. package/components/x-virtual-scroll.js +1 -1
  338. package/components/x-workflow-builder.d.ts +0 -0
  339. package/components/x-workflow-builder.js +1 -1
  340. package/components/x-workflow.d.ts +0 -0
  341. package/components/x-workflow.js +1 -1
  342. package/dist/cjs/{abstract-control-C4D0eNCC.js → abstract-control-JI4_szTV.js} +40 -14
  343. package/dist/cjs/{config-BP9bROYD.js → config-BYR5qIIZ.js} +3 -3
  344. package/dist/cjs/icons-BfHE2jcr.js +19261 -0
  345. package/dist/cjs/{index-C7sKs9A2.js → index-Cy2P_ln3.js} +39 -12
  346. package/dist/cjs/index.cjs.js +7 -5
  347. package/dist/cjs/loader.cjs.js +2 -2
  348. package/dist/cjs/{locale.service-Cz-aZQnr.js → locale.service-DT6E8Rzd.js} +17 -9
  349. package/dist/cjs/{modal-service-BtAF0mFq.js → modal-service-FQpCPk_L.js} +34 -14
  350. package/dist/cjs/{notification-service-m6I5U9aG.js → notification-service-v7LRmTyh.js} +12 -13
  351. package/dist/cjs/{portal-controller-CtYVbhXL.js → portal-controller-DJft2QkA.js} +11 -16
  352. package/dist/cjs/{schema-builder-CYnX7lKi.js → schema-builder-DAwDwgIM.js} +385 -99
  353. package/dist/cjs/{tree.service-fxLOCSpD.js → tree.service-u0qqS1Qh.js} +22 -22
  354. package/dist/cjs/x-address_51.cjs.entry.js +26978 -0
  355. package/dist/cjs/x-affix.cjs.entry.js +5 -5
  356. package/dist/cjs/{x-alert_11.cjs.entry.js → x-alert_9.cjs.entry.js} +267 -646
  357. package/dist/cjs/x-anchor-link.cjs.entry.js +3 -3
  358. package/dist/cjs/x-anchor.cjs.entry.js +11 -9
  359. package/dist/cjs/x-app.cjs.entry.js +19 -19
  360. package/dist/cjs/x-back-top.cjs.entry.js +4 -4
  361. package/dist/cjs/x-breadcrumb_2.cjs.entry.js +124 -0
  362. package/dist/cjs/x-carousel.cjs.entry.js +7 -7
  363. package/dist/cjs/x-code-editor.cjs.entry.js +2365 -0
  364. package/dist/cjs/x-col_11.cjs.entry.js +1204 -0
  365. package/dist/cjs/x-collapse-panel.cjs.entry.js +4 -4
  366. package/dist/cjs/x-collapse.cjs.entry.js +4 -4
  367. package/dist/cjs/x-comment.cjs.entry.js +5 -5
  368. package/dist/cjs/x-descriptions-item.cjs.entry.js +6 -6
  369. package/dist/cjs/{x-breadcrumb_5.cjs.entry.js → x-descriptions_3.cjs.entry.js} +36 -157
  370. package/dist/cjs/x-drawer-content.cjs.entry.js +8 -8
  371. package/dist/cjs/x-drawer.cjs.entry.js +9 -7
  372. package/dist/cjs/x-finder.cjs.entry.js +39 -32
  373. package/dist/cjs/x-icon-picker-dropdown-content.cjs.entry.js +158 -0
  374. package/dist/cjs/x-infinite-scroll.cjs.entry.js +4 -4
  375. package/dist/cjs/x-input-icon.cjs.entry.js +361 -0
  376. package/dist/cjs/x-layout-admin.cjs.entry.js +45 -0
  377. package/dist/cjs/x-layout-detail.cjs.entry.js +145 -0
  378. package/dist/cjs/x-layout-list.cjs.entry.js +259 -0
  379. package/dist/cjs/x-list-item.cjs.entry.js +3 -3
  380. package/dist/cjs/{x-menu-submenu.cjs.entry.js → x-list_2.cjs.entry.js} +141 -7
  381. package/dist/cjs/x-mentions.cjs.entry.js +6 -6
  382. package/dist/cjs/x-menu-divider.cjs.entry.js +2 -2
  383. package/dist/cjs/x-menu-item-group.cjs.entry.js +2 -2
  384. package/dist/cjs/x-menu_2.cjs.entry.js +509 -0
  385. package/dist/cjs/x-message.cjs.entry.js +7 -7
  386. package/dist/cjs/x-notification.cjs.entry.js +7 -7
  387. package/dist/cjs/x-page-header.cjs.entry.js +3 -3
  388. package/dist/cjs/x-popconfirm-content.cjs.entry.js +4 -4
  389. package/dist/cjs/x-popconfirm.cjs.entry.js +5 -5
  390. package/dist/cjs/x-progress.cjs.entry.js +10 -10
  391. package/dist/cjs/x-qr-code.cjs.entry.js +11 -9
  392. package/dist/cjs/x-skeleton.cjs.entry.js +5 -5
  393. package/dist/cjs/x-splitter-panel.cjs.entry.js +2 -2
  394. package/dist/cjs/x-splitter.cjs.entry.js +11 -5
  395. package/dist/cjs/x-statistic.cjs.entry.js +3 -3
  396. package/dist/cjs/x-step.cjs.entry.js +7 -7
  397. package/dist/cjs/x-steps.cjs.entry.js +6 -8
  398. package/dist/cjs/x-table-cell.cjs.entry.js +4 -4
  399. package/dist/cjs/x-table-row.cjs.entry.js +13 -10
  400. package/dist/cjs/x-timeline-item.cjs.entry.js +4 -4
  401. package/dist/cjs/x-timeline.cjs.entry.js +4 -4
  402. package/dist/cjs/x-tour-panel.cjs.entry.js +3 -3
  403. package/dist/cjs/x-tour.cjs.entry.js +16 -16
  404. package/dist/cjs/x-virtual-scroll.cjs.entry.js +5 -5
  405. package/dist/cjs/x-workflow-builder.cjs.entry.js +8 -8
  406. package/dist/cjs/xlabs.cjs.js +24 -0
  407. package/dist/collection/collection-manifest.json +8 -1
  408. package/dist/collection/components/x-address/vietnam-data.js +3 -3
  409. package/dist/collection/components/x-address/x-address.css +5 -2
  410. package/dist/collection/components/x-address/x-address.js +8 -10
  411. package/dist/collection/components/x-affix/x-affix.js +4 -4
  412. package/dist/collection/components/x-alert/x-alert.css +5 -2
  413. package/dist/collection/components/x-alert/x-alert.js +1 -1
  414. package/dist/collection/components/x-anchor/x-anchor.js +16 -8
  415. package/dist/collection/components/x-anchor-link/x-anchor-link.js +2 -2
  416. package/dist/collection/components/x-app/x-app.js +15 -15
  417. package/dist/collection/components/x-auto-complete/auto-complete-dropdown-content/auto-complete-dropdown-content.css +5 -2
  418. package/dist/collection/components/x-auto-complete/auto-complete-dropdown-content/auto-complete-dropdown-content.js +1 -1
  419. package/dist/collection/components/x-auto-complete/types.js +2 -5
  420. package/dist/collection/components/x-auto-complete/x-auto-complete.css +5 -2
  421. package/dist/collection/components/x-auto-complete/x-auto-complete.js +52 -25
  422. package/dist/collection/components/x-avatar/x-avatar.js +23 -14
  423. package/dist/collection/components/x-back-top/x-back-top.js +3 -3
  424. package/dist/collection/components/x-badge/x-badge.js +3 -7
  425. package/dist/collection/components/x-breadcrumb/x-breadcrumb.js +3 -3
  426. package/dist/collection/components/x-breadcrumb-item/x-breadcrumb-item.js +1 -1
  427. package/dist/collection/components/x-button/x-button.js +7 -7
  428. package/dist/collection/components/x-captcha/x-captcha.js +28 -8
  429. package/dist/collection/components/x-card/x-card.css +9 -4
  430. package/dist/collection/components/x-card/x-card.js +1 -1
  431. package/dist/collection/components/x-carousel/x-carousel.css +5 -2
  432. package/dist/collection/components/x-carousel/x-carousel.js +5 -5
  433. package/dist/collection/components/x-cascader/cascader-dropdown-content/cascader-dropdown-content.css +5 -2
  434. package/dist/collection/components/x-cascader/cascader-dropdown-content/cascader-dropdown-content.js +9 -9
  435. package/dist/collection/components/x-cascader/x-cascader.css +5 -2
  436. package/dist/collection/components/x-cascader/x-cascader.js +17 -20
  437. package/dist/collection/components/x-checkbox/x-checkbox.css +5 -2
  438. package/dist/collection/components/x-checkbox/x-checkbox.js +9 -19
  439. package/dist/collection/components/x-code-editor/types.js +1 -0
  440. package/dist/collection/components/x-code-editor/x-code-editor.css +1274 -0
  441. package/dist/collection/components/x-code-editor/x-code-editor.js +1497 -0
  442. package/dist/collection/components/x-col/x-col.css +5 -2
  443. package/dist/collection/components/x-col/x-col.js +14 -14
  444. package/dist/collection/components/x-collapse/x-collapse.css +5 -2
  445. package/dist/collection/components/x-collapse/x-collapse.js +4 -4
  446. package/dist/collection/components/x-collapse-panel/x-collapse-panel.css +5 -2
  447. package/dist/collection/components/x-collapse-panel/x-collapse-panel.js +4 -4
  448. package/dist/collection/components/x-color-picker/x-color-picker-panel.js +6 -8
  449. package/dist/collection/components/x-color-picker/x-color-picker.css +5 -2
  450. package/dist/collection/components/x-color-picker/x-color-picker.js +72 -12
  451. package/dist/collection/components/x-comment/x-comment.css +5 -2
  452. package/dist/collection/components/x-comment/x-comment.js +3 -3
  453. package/dist/collection/components/x-content/x-content.css +5 -4
  454. package/dist/collection/components/x-content/x-content.js +3 -3
  455. package/dist/collection/components/x-date-picker/date-picker-dropdown-content/date-picker-dropdown-content.css +7 -3
  456. package/dist/collection/components/x-date-picker/date-picker-dropdown-content/date-picker-dropdown-content.js +5 -9
  457. package/dist/collection/components/x-date-picker/x-date-picker.css +5 -2
  458. package/dist/collection/components/x-date-picker/x-date-picker.js +65 -23
  459. package/dist/collection/components/x-descriptions/x-descriptions.css +5 -2
  460. package/dist/collection/components/x-descriptions/x-descriptions.js +3 -3
  461. package/dist/collection/components/x-descriptions-item/x-descriptions-item.css +5 -2
  462. package/dist/collection/components/x-descriptions-item/x-descriptions-item.js +4 -4
  463. package/dist/collection/components/x-divider/x-divider.css +5 -2
  464. package/dist/collection/components/x-divider/x-divider.js +3 -3
  465. package/dist/collection/components/x-drawer/x-drawer.css +5 -2
  466. package/dist/collection/components/x-drawer/x-drawer.js +6 -4
  467. package/dist/collection/components/x-drawer-content/x-drawer-content.css +5 -2
  468. package/dist/collection/components/x-drawer-content/x-drawer-content.js +4 -4
  469. package/dist/collection/components/x-dropdown/dropdown-content/dropdown-content.css +5 -2
  470. package/dist/collection/components/x-dropdown/dropdown-content/dropdown-content.js +1 -1
  471. package/dist/collection/components/x-dropdown/x-dropdown.css +5 -2
  472. package/dist/collection/components/x-dropdown/x-dropdown.js +34 -12
  473. package/dist/collection/components/x-editor/types.js +4 -6
  474. package/dist/collection/components/x-editor/x-editor.css +25 -10
  475. package/dist/collection/components/x-editor/x-editor.js +80 -74
  476. package/dist/collection/components/x-empty/x-empty.css +5 -2
  477. package/dist/collection/components/x-empty/x-empty.js +1 -1
  478. package/dist/collection/components/x-finder/services/finder-service.js +7 -9
  479. package/dist/collection/components/x-finder/x-finder.css +10 -4
  480. package/dist/collection/components/x-finder/x-finder.js +28 -19
  481. package/dist/collection/components/x-flex/x-flex.css +5 -2
  482. package/dist/collection/components/x-flex/x-flex.js +5 -7
  483. package/dist/collection/components/x-float-button/x-float-button.css +5 -2
  484. package/dist/collection/components/x-float-button/x-float-button.js +4 -4
  485. package/dist/collection/components/x-footer/x-footer.css +5 -2
  486. package/dist/collection/components/x-footer/x-footer.js +1 -1
  487. package/dist/collection/components/x-form/x-form.css +5 -2
  488. package/dist/collection/components/x-form/x-form.js +98 -3
  489. package/dist/collection/components/x-form-builder/services/apis/api-client.js +24 -15
  490. package/dist/collection/components/x-form-builder/services/forms/form-array.js +3 -5
  491. package/dist/collection/components/x-form-builder/services/forms/form-group.js +6 -6
  492. package/dist/collection/components/x-form-builder/services/forms/validators.js +20 -10
  493. package/dist/collection/components/x-form-builder/services/schema/condition-builder.js +73 -50
  494. package/dist/collection/components/x-form-builder/services/schema/default-registry.js +108 -87
  495. package/dist/collection/components/x-form-builder/services/schema/form-mapping.js +80 -5
  496. package/dist/collection/components/x-form-builder/services/schema/formula-builder.js +114 -0
  497. package/dist/collection/components/x-form-builder/services/schema/schema-builder.js +7 -2
  498. package/dist/collection/components/x-form-builder/services/schema/schema-validator.js +1 -1
  499. package/dist/collection/components/x-form-builder/types/common/index.js +1 -0
  500. package/dist/collection/components/x-form-builder/types/common/ui-types.js +1 -0
  501. package/dist/collection/components/x-form-builder/types/fields/selection-fields.js +1 -9
  502. package/dist/collection/components/x-form-builder/utils/condition-engine.js +56 -14
  503. package/dist/collection/components/x-form-builder/utils/utils.js +25 -6
  504. package/dist/collection/components/x-form-builder/x-form-builder.js +559 -206
  505. package/dist/collection/components/x-form-item/x-form-item.css +16 -10
  506. package/dist/collection/components/x-form-item/x-form-item.js +46 -28
  507. package/dist/collection/components/x-header/x-header.css +5 -2
  508. package/dist/collection/components/x-header/x-header.js +1 -1
  509. package/dist/collection/components/x-icon/icons.js +19257 -2716
  510. package/dist/collection/components/x-icon/x-icon.css +5 -2
  511. package/dist/collection/components/x-icon/x-icon.js +6 -6
  512. package/dist/collection/components/x-image/x-image.css +5 -2
  513. package/dist/collection/components/x-image/x-image.js +6 -6
  514. package/dist/collection/components/x-infinite-scroll/x-infinite-scroll.css +5 -2
  515. package/dist/collection/components/x-infinite-scroll/x-infinite-scroll.js +2 -2
  516. package/dist/collection/components/x-input/x-input.css +25 -2
  517. package/dist/collection/components/x-input/x-input.js +38 -9
  518. package/dist/collection/components/x-input-icon/icon-picker-dropdown-content/icon-picker-dropdown-content.css +453 -0
  519. package/dist/collection/components/x-input-icon/icon-picker-dropdown-content/icon-picker-dropdown-content.js +304 -0
  520. package/dist/collection/components/x-input-icon/types.js +1 -0
  521. package/dist/collection/components/x-input-icon/x-input-icon.css +404 -0
  522. package/dist/collection/components/x-input-icon/x-input-icon.js +917 -0
  523. package/dist/collection/components/x-input-number/x-input-number.css +5 -2
  524. package/dist/collection/components/x-input-number/x-input-number.js +108 -13
  525. package/dist/collection/components/x-layout/x-layout.css +5 -2
  526. package/dist/collection/components/x-layout/x-layout.js +11 -5
  527. package/dist/collection/components/x-layout-admin/x-layout-admin.css +403 -0
  528. package/dist/collection/components/x-layout-admin/x-layout-admin.js +127 -0
  529. package/dist/collection/components/x-layout-detail/x-layout-detail.css +479 -0
  530. package/dist/collection/components/x-layout-detail/x-layout-detail.js +300 -0
  531. package/dist/collection/components/x-layout-list/types.js +1 -0
  532. package/dist/collection/components/x-layout-list/x-layout-list.css +511 -0
  533. package/dist/collection/components/x-layout-list/x-layout-list.js +619 -0
  534. package/dist/collection/components/x-list/x-list.css +5 -2
  535. package/dist/collection/components/x-list/x-list.js +3 -3
  536. package/dist/collection/components/x-list-item/x-list-item.css +5 -2
  537. package/dist/collection/components/x-list-item/x-list-item.js +1 -1
  538. package/dist/collection/components/x-login/types.js +1 -0
  539. package/dist/collection/components/x-login/x-login.css +562 -0
  540. package/dist/collection/components/x-login/x-login.js +706 -0
  541. package/dist/collection/components/x-mentions/x-mentions.css +5 -2
  542. package/dist/collection/components/x-mentions/x-mentions.js +4 -4
  543. package/dist/collection/components/x-menu/x-menu.js +1 -1
  544. package/dist/collection/components/x-menu-divider/x-menu-divider.js +1 -1
  545. package/dist/collection/components/x-menu-item/x-menu-item.js +2 -2
  546. package/dist/collection/components/x-menu-item-group/x-menu-item-group.js +1 -1
  547. package/dist/collection/components/x-menu-submenu/x-menu-submenu.js +5 -5
  548. package/dist/collection/components/x-message/message-service.js +2 -2
  549. package/dist/collection/components/x-message/x-message.css +5 -2
  550. package/dist/collection/components/x-message/x-message.js +5 -5
  551. package/dist/collection/components/x-modal/modal-service.js +33 -13
  552. package/dist/collection/components/x-modal/x-modal.css +5 -2
  553. package/dist/collection/components/x-modal/x-modal.js +148 -47
  554. package/dist/collection/components/x-modal-content/x-modal-content.css +110 -18
  555. package/dist/collection/components/x-modal-content/x-modal-content.js +157 -12
  556. package/dist/collection/components/x-notification/notification-service.js +9 -10
  557. package/dist/collection/components/x-notification/x-notification.css +6 -2
  558. package/dist/collection/components/x-notification/x-notification.js +4 -4
  559. package/dist/collection/components/x-page-header/x-page-header.css +5 -2
  560. package/dist/collection/components/x-page-header/x-page-header.js +1 -1
  561. package/dist/collection/components/x-pagination/x-pagination.css +11 -2
  562. package/dist/collection/components/x-pagination/x-pagination.js +18 -14
  563. package/dist/collection/components/x-popconfirm/popconfirm-content/popconfirm-content.css +5 -2
  564. package/dist/collection/components/x-popconfirm/popconfirm-content/popconfirm-content.js +1 -1
  565. package/dist/collection/components/x-popconfirm/x-popconfirm.css +5 -2
  566. package/dist/collection/components/x-popconfirm/x-popconfirm.js +1 -1
  567. package/dist/collection/components/x-popover/popover-content/popover-content.css +5 -2
  568. package/dist/collection/components/x-popover/popover-content/popover-content.js +1 -1
  569. package/dist/collection/components/x-popover/x-popover.css +5 -2
  570. package/dist/collection/components/x-popover/x-popover.js +1 -1
  571. package/dist/collection/components/x-portal/positioning.js +11 -16
  572. package/dist/collection/components/x-progress/x-progress.css +5 -2
  573. package/dist/collection/components/x-progress/x-progress.js +8 -8
  574. package/dist/collection/components/x-qr-code/x-qr-code.css +2 -1
  575. package/dist/collection/components/x-qr-code/x-qr-code.js +23 -1
  576. package/dist/collection/components/x-radio/x-radio.css +5 -2
  577. package/dist/collection/components/x-radio/x-radio.js +5 -5
  578. package/dist/collection/components/x-radio-group/x-radio-group.css +5 -2
  579. package/dist/collection/components/x-radio-group/x-radio-group.js +6 -8
  580. package/dist/collection/components/x-range-picker/range-picker-dropdown-content/range-picker-dropdown-content.css +7 -3
  581. package/dist/collection/components/x-range-picker/range-picker-dropdown-content/range-picker-dropdown-content.js +13 -13
  582. package/dist/collection/components/x-range-picker/x-range-picker.css +5 -2
  583. package/dist/collection/components/x-range-picker/x-range-picker.js +9 -18
  584. package/dist/collection/components/x-rate/x-rate.css +5 -2
  585. package/dist/collection/components/x-rate/x-rate.js +3 -3
  586. package/dist/collection/components/x-result/x-result.css +5 -2
  587. package/dist/collection/components/x-result/x-result.js +11 -10
  588. package/dist/collection/components/x-row/x-row.css +5 -2
  589. package/dist/collection/components/x-row/x-row.js +4 -4
  590. package/dist/collection/components/x-segmented/x-segmented.css +5 -2
  591. package/dist/collection/components/x-segmented/x-segmented.js +8 -8
  592. package/dist/collection/components/x-select/select-dropdown-content/select-dropdown-content.css +11 -4
  593. package/dist/collection/components/x-select/select-dropdown-content/select-dropdown-content.js +1 -1
  594. package/dist/collection/components/x-select/x-select.css +11 -4
  595. package/dist/collection/components/x-select/x-select.js +33 -39
  596. package/dist/collection/components/x-select-option/x-select-option.css +5 -2
  597. package/dist/collection/components/x-select-option/x-select-option.js +3 -3
  598. package/dist/collection/components/x-sider/x-sider.css +7 -4
  599. package/dist/collection/components/x-sider/x-sider.js +7 -9
  600. package/dist/collection/components/x-skeleton/x-skeleton.css +5 -2
  601. package/dist/collection/components/x-skeleton/x-skeleton.js +3 -3
  602. package/dist/collection/components/x-slider/x-slider.css +5 -2
  603. package/dist/collection/components/x-slider/x-slider.js +11 -23
  604. package/dist/collection/components/x-space/x-space.css +5 -2
  605. package/dist/collection/components/x-space/x-space.js +4 -4
  606. package/dist/collection/components/x-spin/x-spin.css +5 -2
  607. package/dist/collection/components/x-spin/x-spin.js +1 -1
  608. package/dist/collection/components/x-splitter/x-splitter.js +14 -8
  609. package/dist/collection/components/x-splitter-panel/x-splitter-panel.js +1 -1
  610. package/dist/collection/components/x-statistic/x-statistic.css +5 -2
  611. package/dist/collection/components/x-statistic/x-statistic.js +1 -1
  612. package/dist/collection/components/x-step/x-step.css +5 -2
  613. package/dist/collection/components/x-step/x-step.js +5 -5
  614. package/dist/collection/components/x-steps/x-steps.css +5 -2
  615. package/dist/collection/components/x-steps/x-steps.js +4 -6
  616. package/dist/collection/components/x-switch/x-switch.css +5 -2
  617. package/dist/collection/components/x-switch/x-switch.js +7 -4
  618. package/dist/collection/components/x-tab-pane/x-tab-pane.css +5 -2
  619. package/dist/collection/components/x-tab-pane/x-tab-pane.js +58 -2
  620. package/dist/collection/components/x-table/x-table.css +187 -41
  621. package/dist/collection/components/x-table/x-table.js +257 -105
  622. package/dist/collection/components/x-table-cell/x-table-cell.css +5 -2
  623. package/dist/collection/components/x-table-cell/x-table-cell.js +2 -2
  624. package/dist/collection/components/x-table-row/x-table-row.css +5 -2
  625. package/dist/collection/components/x-table-row/x-table-row.js +11 -8
  626. package/dist/collection/components/x-tabs/x-tabs.css +17 -2
  627. package/dist/collection/components/x-tabs/x-tabs.js +130 -12
  628. package/dist/collection/components/x-tag/x-tag.css +6 -3
  629. package/dist/collection/components/x-tag/x-tag.js +1 -4
  630. package/dist/collection/components/x-textarea/x-textarea.css +5 -2
  631. package/dist/collection/components/x-textarea/x-textarea.js +5 -5
  632. package/dist/collection/components/x-time-picker/time-picker-dropdown-content/time-picker-dropdown-content.css +5 -2
  633. package/dist/collection/components/x-time-picker/time-picker-dropdown-content/time-picker-dropdown-content.js +1 -1
  634. package/dist/collection/components/x-time-picker/x-time-picker.css +5 -2
  635. package/dist/collection/components/x-time-picker/x-time-picker.js +4 -7
  636. package/dist/collection/components/x-timeline/x-timeline.css +5 -2
  637. package/dist/collection/components/x-timeline/x-timeline.js +2 -2
  638. package/dist/collection/components/x-timeline-item/x-timeline-item.css +5 -2
  639. package/dist/collection/components/x-timeline-item/x-timeline-item.js +2 -2
  640. package/dist/collection/components/x-tooltip/x-tooltip.css +5 -2
  641. package/dist/collection/components/x-tooltip/x-tooltip.js +6 -8
  642. package/dist/collection/components/x-tooltip-content/x-tooltip-content.js +2 -2
  643. package/dist/collection/components/x-tour/x-tour-panel.css +5 -2
  644. package/dist/collection/components/x-tour/x-tour-panel.js +1 -1
  645. package/dist/collection/components/x-tour/x-tour.css +5 -2
  646. package/dist/collection/components/x-tour/x-tour.js +15 -15
  647. package/dist/collection/components/x-transfer/x-transfer.css +5 -2
  648. package/dist/collection/components/x-transfer/x-transfer.js +8 -8
  649. package/dist/collection/components/x-tree/x-tree.css +5 -2
  650. package/dist/collection/components/x-tree/x-tree.js +25 -26
  651. package/dist/collection/components/x-tree-select/tree-select-dropdown-content/tree-select-dropdown-content.css +5 -2
  652. package/dist/collection/components/x-tree-select/tree-select-dropdown-content/tree-select-dropdown-content.js +6 -6
  653. package/dist/collection/components/x-tree-select/x-tree-select.css +5 -2
  654. package/dist/collection/components/x-tree-select/x-tree-select.js +21 -31
  655. package/dist/collection/components/x-typography/x-typography.css +10 -3
  656. package/dist/collection/components/x-typography/x-typography.js +12 -12
  657. package/dist/collection/components/x-upload/x-upload.css +5 -2
  658. package/dist/collection/components/x-upload/x-upload.js +342 -48
  659. package/dist/collection/components/x-virtual-scroll/x-virtual-scroll.js +5 -5
  660. package/dist/collection/components/x-workflow/x-workflow.css +3 -1
  661. package/dist/collection/components/x-workflow/x-workflow.js +81 -66
  662. package/dist/collection/components/x-workflow-builder/x-workflow-builder.css +5 -2
  663. package/dist/collection/components/x-workflow-builder/x-workflow-builder.js +6 -6
  664. package/dist/collection/index.js +2 -0
  665. package/dist/collection/locales/languages/mn_MN.js +14 -1
  666. package/dist/collection/locales/locale.service.js +4 -9
  667. package/dist/collection/utils/code-editor/ast-parser.js +378 -0
  668. package/dist/collection/utils/code-editor/autocomplete-db.js +590 -0
  669. package/dist/collection/utils/code-editor/history.js +56 -0
  670. package/dist/collection/utils/code-editor/index.js +4 -0
  671. package/dist/collection/utils/code-editor/plugin-system.js +54 -0
  672. package/dist/collection/utils/code-editor/tokenizer.js +300 -0
  673. package/dist/collection/utils/config.js +3 -3
  674. package/dist/collection/utils/form/core/abstract-control.js +40 -14
  675. package/dist/collection/utils/form/core/form-array.js +7 -5
  676. package/dist/collection/utils/form/core/form-group.js +8 -4
  677. package/dist/collection/utils/form/frameworks.js +7 -3
  678. package/dist/collection/utils/form/validators/validators.js +3 -9
  679. package/dist/collection/utils/qr-code/engine/qr.engine.js +3 -3
  680. package/dist/collection/utils/qr-code/engine/qr.mask.js +3 -3
  681. package/dist/collection/utils/qr-code/engine/qr.rs.js +1 -1
  682. package/dist/collection/utils/table.service.js +40 -14
  683. package/dist/collection/utils/tree.service.js +22 -22
  684. package/dist/collection/utils/workflow/flow.service.js +95 -30
  685. package/dist/esm/{abstract-control-XBF88YT_.js → abstract-control-BtYiIQqg.js} +40 -14
  686. package/dist/esm/{config-BPeosvTA.js → config-RKpMhZmc.js} +3 -3
  687. package/dist/esm/icons-CQ2VND9-.js +19259 -0
  688. package/dist/esm/{index-ig_mFsVk.js → index-BMTt8QT3.js} +39 -12
  689. package/dist/esm/index.js +6 -5
  690. package/dist/esm/loader.js +3 -3
  691. package/dist/esm/{locale.service-D66tF8_2.js → locale.service-DFADJBLL.js} +17 -9
  692. package/dist/esm/{modal-service-C_e0SaFZ.js → modal-service-ikfAY1gn.js} +34 -14
  693. package/dist/esm/{notification-service-DJTSPOq7.js → notification-service-CUyIF7K-.js} +12 -13
  694. package/dist/esm/{portal-controller-COpzIi1n.js → portal-controller-DM8AggMt.js} +11 -16
  695. package/dist/esm/{schema-builder-DBPGgJBx.js → schema-builder-CekbhOnD.js} +385 -99
  696. package/dist/esm/{tree.service-Dgxy93Bg.js → tree.service-iG9CbEpE.js} +22 -22
  697. package/dist/esm/x-address_51.entry.js +26926 -0
  698. package/dist/esm/x-affix.entry.js +5 -5
  699. package/dist/esm/{x-alert_11.entry.js → x-alert_9.entry.js} +268 -645
  700. package/dist/esm/x-anchor-link.entry.js +3 -3
  701. package/dist/esm/x-anchor.entry.js +11 -9
  702. package/dist/esm/x-app.entry.js +19 -19
  703. package/dist/esm/x-back-top.entry.js +4 -4
  704. package/dist/esm/x-breadcrumb_2.entry.js +121 -0
  705. package/dist/esm/x-carousel.entry.js +7 -7
  706. package/dist/esm/x-code-editor.entry.js +2363 -0
  707. package/dist/esm/x-col_11.entry.js +1192 -0
  708. package/dist/esm/x-collapse-panel.entry.js +4 -4
  709. package/dist/esm/x-collapse.entry.js +4 -4
  710. package/dist/esm/x-comment.entry.js +5 -5
  711. package/dist/esm/x-descriptions-item.entry.js +6 -6
  712. package/dist/esm/{x-breadcrumb_5.entry.js → x-descriptions_3.entry.js} +37 -156
  713. package/dist/esm/x-drawer-content.entry.js +8 -8
  714. package/dist/esm/x-drawer.entry.js +9 -7
  715. package/dist/esm/x-finder.entry.js +39 -32
  716. package/dist/esm/x-icon-picker-dropdown-content.entry.js +156 -0
  717. package/dist/esm/x-infinite-scroll.entry.js +4 -4
  718. package/dist/esm/x-input-icon.entry.js +359 -0
  719. package/dist/esm/x-layout-admin.entry.js +43 -0
  720. package/dist/esm/x-layout-detail.entry.js +143 -0
  721. package/dist/esm/x-layout-list.entry.js +257 -0
  722. package/dist/esm/x-list-item.entry.js +3 -3
  723. package/dist/esm/{x-menu-submenu.entry.js → x-list_2.entry.js} +141 -8
  724. package/dist/esm/x-mentions.entry.js +6 -6
  725. package/dist/esm/x-menu-divider.entry.js +2 -2
  726. package/dist/esm/x-menu-item-group.entry.js +2 -2
  727. package/dist/esm/x-menu_2.entry.js +506 -0
  728. package/dist/esm/x-message.entry.js +7 -7
  729. package/dist/esm/x-notification.entry.js +7 -7
  730. package/dist/esm/x-page-header.entry.js +3 -3
  731. package/dist/esm/x-popconfirm-content.entry.js +4 -4
  732. package/dist/esm/x-popconfirm.entry.js +5 -5
  733. package/dist/esm/x-progress.entry.js +10 -10
  734. package/dist/esm/x-qr-code.entry.js +11 -9
  735. package/dist/esm/x-skeleton.entry.js +5 -5
  736. package/dist/esm/x-splitter-panel.entry.js +2 -2
  737. package/dist/esm/x-splitter.entry.js +11 -5
  738. package/dist/esm/x-statistic.entry.js +3 -3
  739. package/dist/esm/x-step.entry.js +7 -7
  740. package/dist/esm/x-steps.entry.js +6 -8
  741. package/dist/esm/x-table-cell.entry.js +4 -4
  742. package/dist/esm/x-table-row.entry.js +13 -10
  743. package/dist/esm/x-timeline-item.entry.js +4 -4
  744. package/dist/esm/x-timeline.entry.js +4 -4
  745. package/dist/esm/x-tour-panel.entry.js +3 -3
  746. package/dist/esm/x-tour.entry.js +16 -16
  747. package/dist/esm/x-virtual-scroll.entry.js +5 -5
  748. package/dist/esm/x-workflow-builder.entry.js +8 -8
  749. package/dist/esm/xlabs.js +20 -0
  750. package/dist/types/components/x-app/x-app.d.ts +12 -12
  751. package/dist/types/components/x-auto-complete/auto-complete-dropdown-content/index.d.ts +1 -1
  752. package/dist/types/components/x-auto-complete/x-auto-complete.d.ts +6 -0
  753. package/dist/types/components/x-avatar/x-avatar.d.ts +3 -2
  754. package/dist/types/components/x-captcha/x-captcha.d.ts +4 -0
  755. package/dist/types/components/x-checkbox/x-checkbox.d.ts +0 -4
  756. package/dist/types/components/x-code-editor/types.d.ts +26 -0
  757. package/dist/types/components/x-code-editor/x-code-editor.d.ts +141 -0
  758. package/dist/types/components/x-color-picker/types.d.ts +4 -0
  759. package/dist/types/components/x-color-picker/x-color-picker.d.ts +8 -1
  760. package/dist/types/components/x-content/x-content.d.ts +1 -1
  761. package/dist/types/components/x-date-picker/x-date-picker.d.ts +4 -0
  762. package/dist/types/components/x-form/x-form.d.ts +12 -0
  763. package/dist/types/components/x-form-builder/services/forms/validators.d.ts +1 -0
  764. package/dist/types/components/x-form-builder/services/schema/form-mapping.d.ts +4 -0
  765. package/dist/types/components/x-form-builder/services/schema/formula-builder.d.ts +29 -0
  766. package/dist/types/components/x-form-builder/services/schema/schema-builder.d.ts +6 -1
  767. package/dist/types/components/x-form-builder/types/common/common-types.d.ts +5 -0
  768. package/dist/types/components/x-form-builder/types/common/field-types-enum.d.ts +1 -1
  769. package/dist/types/components/x-form-builder/types/common/index.d.ts +1 -0
  770. package/dist/types/components/x-form-builder/types/common/ui-types.d.ts +28 -0
  771. package/dist/types/components/x-form-builder/types/common/validation-types.d.ts +1 -1
  772. package/dist/types/components/x-form-builder/types/fields/advanced-fields.d.ts +1 -0
  773. package/dist/types/components/x-form-builder/types/fields/base-field.d.ts +4 -1
  774. package/dist/types/components/x-form-builder/types/fields/datetime-file-fields.d.ts +10 -3
  775. package/dist/types/components/x-form-builder/types/fields/display-fields.d.ts +3 -0
  776. package/dist/types/components/x-form-builder/types/fields/form-field-union.d.ts +5 -5
  777. package/dist/types/components/x-form-builder/types/fields/input-fields.d.ts +5 -0
  778. package/dist/types/components/x-form-builder/types/fields/layout-fields.d.ts +29 -2
  779. package/dist/types/components/x-form-builder/types/fields/selection-fields.d.ts +11 -4
  780. package/dist/types/components/x-form-builder/types/fields/special-input-fields.d.ts +3 -0
  781. package/dist/types/components/x-form-builder/types/form/schema-types.d.ts +7 -3
  782. package/dist/types/components/x-form-builder/utils/values.d.ts +1 -1
  783. package/dist/types/components/x-form-builder/x-form-builder.d.ts +11 -3
  784. package/dist/types/components/x-icon/icons.d.ts +12 -2716
  785. package/dist/types/components/x-icon/x-icon.d.ts +1 -1
  786. package/dist/types/components/x-input/types.d.ts +1 -1
  787. package/dist/types/components/x-input/x-input.d.ts +6 -0
  788. package/dist/types/components/x-input-icon/icon-picker-dropdown-content/icon-picker-dropdown-content.d.ts +39 -0
  789. package/dist/types/components/x-input-icon/types.d.ts +9 -0
  790. package/dist/types/components/x-input-icon/x-input-icon.d.ts +150 -0
  791. package/dist/types/components/x-input-number/x-input-number.d.ts +5 -0
  792. package/dist/types/components/x-layout/x-layout.d.ts +2 -1
  793. package/dist/types/components/x-layout-admin/x-layout-admin.d.ts +23 -0
  794. package/dist/types/components/x-layout-detail/x-layout-detail.d.ts +86 -0
  795. package/dist/types/components/x-layout-list/types.d.ts +100 -0
  796. package/dist/types/components/x-layout-list/x-layout-list.d.ts +107 -0
  797. package/dist/types/components/x-login/types.d.ts +113 -0
  798. package/dist/types/components/x-login/x-login.d.ts +126 -0
  799. package/dist/types/components/x-message/message-service.d.ts +1 -1
  800. package/dist/types/components/x-modal/x-modal.d.ts +31 -6
  801. package/dist/types/components/x-modal-content/x-modal-content.d.ts +24 -0
  802. package/dist/types/components/x-notification/notification-service.d.ts +1 -1
  803. package/dist/types/components/x-qr-code/x-qr-code.d.ts +2 -0
  804. package/dist/types/components/x-select/select-dropdown-content/index.d.ts +1 -1
  805. package/dist/types/components/x-tab-pane/x-tab-pane.d.ts +11 -0
  806. package/dist/types/components/x-table/types.d.ts +3 -0
  807. package/dist/types/components/x-table/x-table.d.ts +15 -4
  808. package/dist/types/components/x-tabs/types.d.ts +9 -0
  809. package/dist/types/components/x-tabs/x-tabs.d.ts +40 -1
  810. package/dist/types/components/x-time-picker/time-picker-dropdown-content/index.d.ts +1 -1
  811. package/dist/types/components/x-transfer/types.d.ts +3 -1
  812. package/dist/types/components/x-upload/types.d.ts +14 -0
  813. package/dist/types/components/x-upload/x-upload.d.ts +34 -7
  814. package/dist/types/components.d.ts +1304 -70
  815. package/dist/types/index.d.ts +2 -0
  816. package/dist/types/locales/locale.service.d.ts +3 -3
  817. package/dist/types/types.d.ts +2 -0
  818. package/dist/types/utils/code-editor/ast-parser.d.ts +5 -0
  819. package/dist/types/utils/code-editor/autocomplete-db.d.ts +10 -0
  820. package/dist/types/utils/code-editor/history.d.ts +19 -0
  821. package/dist/types/utils/code-editor/index.d.ts +4 -0
  822. package/dist/types/utils/code-editor/plugin-system.d.ts +31 -0
  823. package/dist/types/utils/code-editor/tokenizer.d.ts +2 -0
  824. package/dist/types/utils/form/types.d.ts +1 -1
  825. package/dist/types/utils/table.service.d.ts +2 -1
  826. package/dist/xlabs/index.esm.js +1 -0
  827. package/dist/xlabs/p-0139d27f.entry.js +1 -0
  828. package/dist/xlabs/p-04985e4d.entry.js +1 -0
  829. package/dist/xlabs/p-05a79f30.entry.js +1 -0
  830. package/dist/xlabs/p-0a08e0c8.entry.js +1 -0
  831. package/dist/xlabs/p-0d5fb8de.entry.js +1 -0
  832. package/dist/{xlabs-store/p-cd3c3374.entry.js → xlabs/p-121911e5.entry.js} +1 -1
  833. package/dist/xlabs/p-1260ad3b.entry.js +1 -0
  834. package/dist/xlabs/p-1c0ee15c.entry.js +1 -0
  835. package/dist/{xlabs-store/p-023259c9.entry.js → xlabs/p-1cd3b259.entry.js} +1 -1
  836. package/dist/xlabs/p-2451ab24.entry.js +1 -0
  837. package/dist/xlabs/p-2ab3bc58.entry.js +1 -0
  838. package/dist/xlabs/p-2f9d0da7.entry.js +1 -0
  839. package/dist/xlabs/p-302ab3b9.entry.js +1 -0
  840. package/dist/xlabs/p-31029063.entry.js +1 -0
  841. package/dist/xlabs/p-31c814c2.entry.js +1 -0
  842. package/dist/xlabs/p-3f5b28e5.entry.js +1 -0
  843. package/dist/xlabs/p-43d10a6e.entry.js +1 -0
  844. package/dist/xlabs/p-4bf9b6f7.entry.js +1 -0
  845. package/dist/xlabs/p-5ab9ce39.entry.js +1 -0
  846. package/dist/xlabs/p-5e495388.entry.js +1 -0
  847. package/dist/xlabs/p-6039e514.entry.js +1 -0
  848. package/dist/xlabs/p-674527b2.entry.js +1 -0
  849. package/dist/xlabs/p-68056c0e.entry.js +1 -0
  850. package/dist/xlabs/p-6d7480c0.entry.js +1 -0
  851. package/dist/xlabs/p-7697ef47.entry.js +1 -0
  852. package/dist/xlabs/p-7b8bdd79.entry.js +1 -0
  853. package/dist/xlabs/p-7f9a80e0.entry.js +1 -0
  854. package/dist/xlabs/p-948a032e.entry.js +1 -0
  855. package/dist/xlabs/p-99c568fd.entry.js +1 -0
  856. package/dist/{xlabs-store/p-7a8f11b4.entry.js → xlabs/p-9ae3501d.entry.js} +1 -1
  857. package/dist/xlabs/p-9b3a4aa6.entry.js +1 -0
  858. package/dist/xlabs/p-9c1cc5ff.entry.js +1 -0
  859. package/dist/xlabs/p-BMTt8QT3.js +2 -0
  860. package/dist/xlabs/p-CQ2VND9-.js +1 -0
  861. package/dist/xlabs/p-CkwLFDlS.js +1 -0
  862. package/dist/xlabs/p-D7kqIlVo.js +1 -0
  863. package/dist/{xlabs-store/p-Co3Y9VjQ.js → xlabs/p-DSa1uqPO.js} +1 -1
  864. package/dist/{xlabs-store/p-c0ca6f7d.entry.js → xlabs/p-a2d14538.entry.js} +1 -1
  865. package/dist/xlabs/p-a415c8c1.entry.js +1 -0
  866. package/dist/xlabs/p-a4995e36.entry.js +1 -0
  867. package/dist/{xlabs-store/p-fdec5d89.entry.js → xlabs/p-aba80f73.entry.js} +1 -1
  868. package/dist/xlabs/p-bc5969e0.entry.js +1 -0
  869. package/dist/xlabs/p-bef8def9.entry.js +1 -0
  870. package/dist/xlabs/p-cc57e705.entry.js +1 -0
  871. package/dist/xlabs/p-d11de492.entry.js +1 -0
  872. package/dist/xlabs/p-d4558f7b.entry.js +1 -0
  873. package/dist/xlabs/p-d921a2c7.entry.js +1 -0
  874. package/dist/xlabs/p-df10e5a1.entry.js +1 -0
  875. package/dist/xlabs/p-e1a1acbe.entry.js +1 -0
  876. package/dist/xlabs/p-eab901c4.entry.js +1 -0
  877. package/dist/xlabs/p-edcb4001.entry.js +1 -0
  878. package/dist/xlabs/p-f07d9ee7.entry.js +1 -0
  879. package/dist/xlabs/p-f280faed.entry.js +1 -0
  880. package/dist/xlabs/p-f5b96f2a.entry.js +1 -0
  881. package/dist/xlabs/p-f6950840.entry.js +1 -0
  882. package/dist/{xlabs-store/p-96b1939d.entry.js → xlabs/p-f69d2b16.entry.js} +1 -1
  883. package/dist/{xlabs-store/p-8bcbb4e3.entry.js → xlabs/p-fd003457.entry.js} +1 -1
  884. package/dist/xlabs/xlabs.css +2 -0
  885. package/dist/xlabs/xlabs.esm.js +1 -0
  886. package/loader/cdn.js +0 -0
  887. package/loader/index.cjs.js +0 -0
  888. package/loader/index.d.ts +0 -0
  889. package/loader/index.es2017.js +0 -0
  890. package/loader/index.js +0 -0
  891. package/package.json +65 -69
  892. package/readme.md +107 -50
  893. package/components/p-5c86X8JO.js +0 -1
  894. package/components/p-6KpqCGp9.js +0 -1
  895. package/components/p-ADwHM_jT.js +0 -1
  896. package/components/p-AgSyA7Ia.js +0 -1
  897. package/components/p-B-7Hwizp.js +0 -1
  898. package/components/p-B-ClGFfy.js +0 -1
  899. package/components/p-B4rO7Sgt.js +0 -1
  900. package/components/p-B5Syz0fw.js +0 -1
  901. package/components/p-B6p-mzW-.js +0 -1
  902. package/components/p-B8SZP5Xz.js +0 -1
  903. package/components/p-BBGHXZqR.js +0 -1
  904. package/components/p-BHLvuyOq.js +0 -1
  905. package/components/p-BOCR5Zk0.js +0 -1
  906. package/components/p-BRBrLtOz.js +0 -1
  907. package/components/p-BSRP2TGa.js +0 -1
  908. package/components/p-BUjRcJoK.js +0 -1
  909. package/components/p-BVeQ5W_G.js +0 -1
  910. package/components/p-BVnVlCcd.js +0 -1
  911. package/components/p-BZQcq9R_.js +0 -1
  912. package/components/p-BeIFU-wn.js +0 -1
  913. package/components/p-BkEgl31q.js +0 -1
  914. package/components/p-BkPJ1Whr.js +0 -1
  915. package/components/p-BkevSugc.js +0 -1
  916. package/components/p-BkiOFW3H.js +0 -1
  917. package/components/p-BskMfHyY.js +0 -1
  918. package/components/p-Bu2JqZs8.js +0 -1
  919. package/components/p-BvjR2Q5Q.js +0 -1
  920. package/components/p-Bz7MhZ4K.js +0 -1
  921. package/components/p-C3gvR6nN.js +0 -1
  922. package/components/p-C70KKm8p.js +0 -1
  923. package/components/p-C7csgUoA.js +0 -1
  924. package/components/p-CAPfC5Vn.js +0 -1
  925. package/components/p-CEBSDVyp.js +0 -1
  926. package/components/p-CFB6xkAX.js +0 -1
  927. package/components/p-CGIxdOEm.js +0 -1
  928. package/components/p-CHRrsVXB.js +0 -1
  929. package/components/p-CKUzvJue.js +0 -1
  930. package/components/p-CRBPzT4B.js +0 -1
  931. package/components/p-CSfrs76m.js +0 -1
  932. package/components/p-C_ZBjXFP.js +0 -1
  933. package/components/p-Ce5L9qbY.js +0 -1
  934. package/components/p-CeBfFEIa.js +0 -1
  935. package/components/p-Ck6SW8G3.js +0 -1
  936. package/components/p-D7ijqXRY.js +0 -1
  937. package/components/p-D7n-26Q5.js +0 -1
  938. package/components/p-D8ew7Rgv.js +0 -1
  939. package/components/p-DBk4T-b-.js +0 -1
  940. package/components/p-DD-W_fMF.js +0 -1
  941. package/components/p-DElCk9ta.js +0 -1
  942. package/components/p-DEumEVI3.js +0 -1
  943. package/components/p-DGqQ8PT4.js +0 -1
  944. package/components/p-DJ1WhSJ4.js +0 -1
  945. package/components/p-DOxXxhXb.js +0 -1
  946. package/components/p-DRa4o4c6.js +0 -1
  947. package/components/p-DTlSrH8_.js +0 -1
  948. package/components/p-DTvD0UO5.js +0 -1
  949. package/components/p-DZFphzg1.js +0 -1
  950. package/components/p-DZPUUptR.js +0 -1
  951. package/components/p-D_xaGiZU.js +0 -1
  952. package/components/p-DaL42JUi.js +0 -1
  953. package/components/p-DbRpEXwX.js +0 -1
  954. package/components/p-Dg0xgMke.js +0 -1
  955. package/components/p-Dky_8i8S.js +0 -1
  956. package/components/p-DlwlBBr4.js +0 -1
  957. package/components/p-DoTf8yXn.js +0 -1
  958. package/components/p-DphUq6Z5.js +0 -1
  959. package/components/p-DsgWQbJY.js +0 -1
  960. package/components/p-Dx3yBe39.js +0 -1
  961. package/components/p-DxKMnrS8.js +0 -1
  962. package/components/p-O88oQkR1.js +0 -1
  963. package/components/p-PlUkLT0A.js +0 -1
  964. package/components/p-QTSiPk0I.js +0 -1
  965. package/components/p-TC9DZAbC.js +0 -1
  966. package/components/p-bVsOg7S9.js +0 -1
  967. package/components/p-ccpcKv5U.js +0 -1
  968. package/components/p-en06CSUT.js +0 -1
  969. package/components/p-g6ZBqIze.js +0 -1
  970. package/dist/cjs/types-DQ-V76ZQ.js +0 -255
  971. package/dist/cjs/x-address_14.cjs.entry.js +0 -12577
  972. package/dist/cjs/x-auto-complete-dropdown-content.cjs.entry.js +0 -69
  973. package/dist/cjs/x-avatar.cjs.entry.js +0 -269
  974. package/dist/cjs/x-button.cjs.entry.js +0 -174
  975. package/dist/cjs/x-card_12.cjs.entry.js +0 -1386
  976. package/dist/cjs/x-cascader-dropdown-content.cjs.entry.js +0 -364
  977. package/dist/cjs/x-checkbox_5.cjs.entry.js +0 -1376
  978. package/dist/cjs/x-color-picker-panel_2.cjs.entry.js +0 -873
  979. package/dist/cjs/x-color-picker_9.cjs.entry.js +0 -3085
  980. package/dist/cjs/x-date-picker-dropdown-content.cjs.entry.js +0 -757
  981. package/dist/cjs/x-dropdown_2.cjs.entry.js +0 -735
  982. package/dist/cjs/x-empty.cjs.entry.js +0 -64
  983. package/dist/cjs/x-form-builder.cjs.entry.js +0 -807
  984. package/dist/cjs/x-icon.cjs.entry.js +0 -144
  985. package/dist/cjs/x-list.cjs.entry.js +0 -138
  986. package/dist/cjs/x-modal-content.cjs.entry.js +0 -217
  987. package/dist/cjs/x-range-picker-dropdown-content.cjs.entry.js +0 -821
  988. package/dist/cjs/x-select_2.cjs.entry.js +0 -1316
  989. package/dist/cjs/x-spin.cjs.entry.js +0 -62
  990. package/dist/cjs/x-tab-pane.cjs.entry.js +0 -73
  991. package/dist/cjs/x-tabs.cjs.entry.js +0 -609
  992. package/dist/cjs/x-time-picker-dropdown-content.cjs.entry.js +0 -389
  993. package/dist/cjs/x-tree-select-dropdown-content.cjs.entry.js +0 -439
  994. package/dist/cjs/xlabs-store.cjs.js +0 -24
  995. package/dist/esm/types-C_QdJRdB.js +0 -253
  996. package/dist/esm/x-address_14.entry.js +0 -12562
  997. package/dist/esm/x-auto-complete-dropdown-content.entry.js +0 -67
  998. package/dist/esm/x-avatar.entry.js +0 -267
  999. package/dist/esm/x-button.entry.js +0 -172
  1000. package/dist/esm/x-card_12.entry.js +0 -1373
  1001. package/dist/esm/x-cascader-dropdown-content.entry.js +0 -362
  1002. package/dist/esm/x-checkbox_5.entry.js +0 -1370
  1003. package/dist/esm/x-color-picker-panel_2.entry.js +0 -870
  1004. package/dist/esm/x-color-picker_9.entry.js +0 -3075
  1005. package/dist/esm/x-date-picker-dropdown-content.entry.js +0 -755
  1006. package/dist/esm/x-dropdown_2.entry.js +0 -732
  1007. package/dist/esm/x-empty.entry.js +0 -62
  1008. package/dist/esm/x-form-builder.entry.js +0 -805
  1009. package/dist/esm/x-icon.entry.js +0 -142
  1010. package/dist/esm/x-list.entry.js +0 -136
  1011. package/dist/esm/x-modal-content.entry.js +0 -215
  1012. package/dist/esm/x-range-picker-dropdown-content.entry.js +0 -819
  1013. package/dist/esm/x-select_2.entry.js +0 -1313
  1014. package/dist/esm/x-spin.entry.js +0 -60
  1015. package/dist/esm/x-tab-pane.entry.js +0 -71
  1016. package/dist/esm/x-tabs.entry.js +0 -607
  1017. package/dist/esm/x-time-picker-dropdown-content.entry.js +0 -387
  1018. package/dist/esm/x-tree-select-dropdown-content.entry.js +0 -437
  1019. package/dist/esm/xlabs-store.js +0 -20
  1020. package/dist/xlabs-store/index.esm.js +0 -1
  1021. package/dist/xlabs-store/p-016194dc.entry.js +0 -1
  1022. package/dist/xlabs-store/p-04a3721a.entry.js +0 -1
  1023. package/dist/xlabs-store/p-072445b7.entry.js +0 -1
  1024. package/dist/xlabs-store/p-0ec21454.entry.js +0 -1
  1025. package/dist/xlabs-store/p-12b6a843.entry.js +0 -1
  1026. package/dist/xlabs-store/p-1a81cf09.entry.js +0 -1
  1027. package/dist/xlabs-store/p-1b019aeb.entry.js +0 -1
  1028. package/dist/xlabs-store/p-262a0673.entry.js +0 -1
  1029. package/dist/xlabs-store/p-34cce823.entry.js +0 -1
  1030. package/dist/xlabs-store/p-3a9fdefe.entry.js +0 -1
  1031. package/dist/xlabs-store/p-40036100.entry.js +0 -1
  1032. package/dist/xlabs-store/p-45f04e8d.entry.js +0 -1
  1033. package/dist/xlabs-store/p-48ba7c34.entry.js +0 -1
  1034. package/dist/xlabs-store/p-48e2c26e.entry.js +0 -1
  1035. package/dist/xlabs-store/p-4ac2e915.entry.js +0 -1
  1036. package/dist/xlabs-store/p-4d7c2a35.entry.js +0 -1
  1037. package/dist/xlabs-store/p-4f67cb33.entry.js +0 -1
  1038. package/dist/xlabs-store/p-502b345e.entry.js +0 -1
  1039. package/dist/xlabs-store/p-555c5e48.entry.js +0 -1
  1040. package/dist/xlabs-store/p-5878525f.entry.js +0 -1
  1041. package/dist/xlabs-store/p-5abbdca7.entry.js +0 -1
  1042. package/dist/xlabs-store/p-6243ca69.entry.js +0 -1
  1043. package/dist/xlabs-store/p-64e7a057.entry.js +0 -1
  1044. package/dist/xlabs-store/p-6530d2ef.entry.js +0 -1
  1045. package/dist/xlabs-store/p-675a39e1.entry.js +0 -1
  1046. package/dist/xlabs-store/p-689c52ef.entry.js +0 -1
  1047. package/dist/xlabs-store/p-69b8cb7d.entry.js +0 -1
  1048. package/dist/xlabs-store/p-6b121c60.entry.js +0 -1
  1049. package/dist/xlabs-store/p-6c75fc39.entry.js +0 -1
  1050. package/dist/xlabs-store/p-6f705deb.entry.js +0 -1
  1051. package/dist/xlabs-store/p-723d362c.entry.js +0 -1
  1052. package/dist/xlabs-store/p-783545e3.entry.js +0 -1
  1053. package/dist/xlabs-store/p-81fb4caf.entry.js +0 -1
  1054. package/dist/xlabs-store/p-863dd67d.entry.js +0 -1
  1055. package/dist/xlabs-store/p-8bcc219a.entry.js +0 -1
  1056. package/dist/xlabs-store/p-914b0ae2.entry.js +0 -1
  1057. package/dist/xlabs-store/p-9ac291ea.entry.js +0 -1
  1058. package/dist/xlabs-store/p-9de03a07.entry.js +0 -1
  1059. package/dist/xlabs-store/p-C_QdJRdB.js +0 -1
  1060. package/dist/xlabs-store/p-Ce5L9qbY.js +0 -1
  1061. package/dist/xlabs-store/p-DElCk9ta.js +0 -1
  1062. package/dist/xlabs-store/p-a4223feb.entry.js +0 -1
  1063. package/dist/xlabs-store/p-a8c2eca7.entry.js +0 -1
  1064. package/dist/xlabs-store/p-ac9ba3aa.entry.js +0 -1
  1065. package/dist/xlabs-store/p-bd5084b8.entry.js +0 -1
  1066. package/dist/xlabs-store/p-bda322db.entry.js +0 -1
  1067. package/dist/xlabs-store/p-c4c8840c.entry.js +0 -1
  1068. package/dist/xlabs-store/p-c4d0ce0d.entry.js +0 -1
  1069. package/dist/xlabs-store/p-cf4697bc.entry.js +0 -1
  1070. package/dist/xlabs-store/p-d2ec3d4a.entry.js +0 -1
  1071. package/dist/xlabs-store/p-d4d00aff.entry.js +0 -1
  1072. package/dist/xlabs-store/p-d9d0147b.entry.js +0 -1
  1073. package/dist/xlabs-store/p-dd930f2a.entry.js +0 -1
  1074. package/dist/xlabs-store/p-e04836e8.entry.js +0 -1
  1075. package/dist/xlabs-store/p-e14b5f6d.entry.js +0 -1
  1076. package/dist/xlabs-store/p-eb1dd3c2.entry.js +0 -1
  1077. package/dist/xlabs-store/p-f02155e4.entry.js +0 -1
  1078. package/dist/xlabs-store/p-f1331938.entry.js +0 -1
  1079. package/dist/xlabs-store/p-fac0b689.entry.js +0 -1
  1080. package/dist/xlabs-store/p-fd2e1d9c.entry.js +0 -1
  1081. package/dist/xlabs-store/p-ffba56b2.entry.js +0 -1
  1082. package/dist/xlabs-store/p-ig_mFsVk.js +0 -2
  1083. package/dist/xlabs-store/xlabs-store.css +0 -1
  1084. package/dist/xlabs-store/xlabs-store.esm.js +0 -1
  1085. /package/components/{p-XBF88YT_.js → p-BtYiIQqg.js} +0 -0
  1086. /package/components/{p-D66tF8_2.js → p-DFADJBLL.js} +0 -0
  1087. /package/components/{p-COpzIi1n.js → p-DM8AggMt.js} +0 -0
  1088. /package/components/{p-BPeosvTA.js → p-RKpMhZmc.js} +0 -0
  1089. /package/components/{p-Dgxy93Bg.js → p-iG9CbEpE.js} +0 -0
  1090. /package/dist/{xlabs-store → xlabs}/fonts/xlabs-outlined.woff2 +0 -0
  1091. /package/dist/{xlabs-store → xlabs}/fonts/xlabs-rounded.woff2 +0 -0
  1092. /package/dist/{xlabs-store → xlabs}/fonts/xlabs-solided.woff2 +0 -0
  1093. /package/dist/{xlabs-store/p-XBF88YT_.js → xlabs/p-BtYiIQqg.js} +0 -0
  1094. /package/dist/{xlabs-store/p-D66tF8_2.js → xlabs/p-DFADJBLL.js} +0 -0
  1095. /package/dist/{xlabs-store/p-COpzIi1n.js → xlabs/p-DM8AggMt.js} +0 -0
  1096. /package/dist/{xlabs-store/p-BPeosvTA.js → xlabs/p-RKpMhZmc.js} +0 -0
  1097. /package/dist/{xlabs-store/p-Dgxy93Bg.js → xlabs/p-iG9CbEpE.js} +0 -0
@@ -0,0 +1,2365 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-Cy2P_ln3.js');
4
+
5
+ // src/utils/tokenizer.ts
6
+ // Pure syntax tokenizer — no external deps
7
+ function escH$1(s) {
8
+ return String(s).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
9
+ }
10
+ // ─── JavaScript Tokenizer ────────────────────────────────────────────────────
11
+ function tokenizeJS(code) {
12
+ const KW = /^(const|let|var|function|return|if|else|for|while|do|switch|case|break|continue|class|extends|new|this|super|import|export|default|from|typeof|instanceof|in|of|try|catch|finally|throw|async|await|static|get|set|delete|void|yield|null|undefined|true|false|NaN|Infinity)$/;
13
+ const BUILTIN = /^(console|Math|Array|Object|String|Number|Boolean|Symbol|BigInt|Promise|Map|Set|WeakMap|WeakSet|Error|TypeError|RangeError|JSON|Date|RegExp|Proxy|Reflect|globalThis|window|document|navigator|setTimeout|setInterval|clearTimeout|clearInterval|fetch|parseInt|parseFloat|isNaN|isFinite|encodeURI|decodeURI|structuredClone|queueMicrotask)$/;
14
+ const lines = code.split('\n');
15
+ let inMLComment = false;
16
+ return lines
17
+ .map(line => {
18
+ let out = '';
19
+ let rest = line;
20
+ if (inMLComment) {
21
+ const end = rest.indexOf('*/');
22
+ if (end < 0)
23
+ return `<span class="t-cmt">${escH$1(rest)}</span>`;
24
+ out += `<span class="t-cmt">${escH$1(rest.slice(0, end + 2))}</span>`;
25
+ rest = rest.slice(end + 2);
26
+ inMLComment = false;
27
+ }
28
+ while (rest.length > 0) {
29
+ // single-line comment
30
+ if (rest.startsWith('//')) {
31
+ out += `<span class="t-cmt">${escH$1(rest)}</span>`;
32
+ break;
33
+ }
34
+ // multi-line comment
35
+ if (rest.startsWith('/*')) {
36
+ const end = rest.indexOf('*/', 2);
37
+ if (end < 0) {
38
+ out += `<span class="t-cmt">${escH$1(rest)}</span>`;
39
+ inMLComment = true;
40
+ break;
41
+ }
42
+ out += `<span class="t-cmt">${escH$1(rest.slice(0, end + 2))}</span>`;
43
+ rest = rest.slice(end + 2);
44
+ continue;
45
+ }
46
+ // template literal
47
+ if (rest[0] === '`') {
48
+ let i = 1, s = '`';
49
+ while (i < rest.length) {
50
+ if (rest[i] === '\\') {
51
+ s += rest[i] + rest[i + 1];
52
+ i += 2;
53
+ continue;
54
+ }
55
+ if (rest[i] === '`') {
56
+ s += '`';
57
+ i++;
58
+ break;
59
+ }
60
+ s += rest[i++];
61
+ }
62
+ out += `<span class="t-str">${escH$1(s)}</span>`;
63
+ rest = rest.slice(s.length);
64
+ continue;
65
+ }
66
+ // string
67
+ const strM = rest.match(/^("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/);
68
+ if (strM) {
69
+ out += `<span class="t-str">${escH$1(strM[0])}</span>`;
70
+ rest = rest.slice(strM[0].length);
71
+ continue;
72
+ }
73
+ // decorator
74
+ if (rest[0] === '@') {
75
+ const dm = rest.match(/^@[a-zA-Z_$][a-zA-Z0-9_$]*/);
76
+ if (dm) {
77
+ out += `<span class="t-dec">${escH$1(dm[0])}</span>`;
78
+ rest = rest.slice(dm[0].length);
79
+ continue;
80
+ }
81
+ }
82
+ // number
83
+ const numM = rest.match(/^(0x[\da-fA-F]+|0b[01]+|0o[0-7]+|\d+\.?\d*(?:[eE][+-]?\d+)?n?)\b/);
84
+ if (numM) {
85
+ out += `<span class="t-num">${numM[0]}</span>`;
86
+ rest = rest.slice(numM[0].length);
87
+ continue;
88
+ }
89
+ // identifier / keyword
90
+ const idM = rest.match(/^[a-zA-Z_$][a-zA-Z0-9_$]*/);
91
+ if (idM) {
92
+ const w = idM[0];
93
+ if (KW.test(w))
94
+ out += `<span class="t-kw">${w}</span>`;
95
+ else if (BUILTIN.test(w))
96
+ out += `<span class="t-bi">${w}</span>`;
97
+ else if (rest[w.length] === '(')
98
+ out += `<span class="t-fn">${w}</span>`;
99
+ else
100
+ out += `<span class="t-id">${escH$1(w)}</span>`;
101
+ rest = rest.slice(w.length);
102
+ continue;
103
+ }
104
+ // operator
105
+ const opM = rest.match(/^(===|!==|=>|\.{3}|\?\?=?|\?\.|[+\-*/%=<>!&|^~?:]+)/);
106
+ if (opM) {
107
+ out += `<span class="t-op">${escH$1(opM[0])}</span>`;
108
+ rest = rest.slice(opM[0].length);
109
+ continue;
110
+ }
111
+ out += escH$1(rest[0]);
112
+ rest = rest.slice(1);
113
+ }
114
+ return out;
115
+ })
116
+ .join('\n');
117
+ }
118
+ // ─── CSS Tokenizer ──────────────────────────────────────────────────────────
119
+ function tokenizeCSS(code) {
120
+ const lines = code.split('\n');
121
+ let inComment = false;
122
+ return lines
123
+ .map(line => {
124
+ let out = '', rest = line;
125
+ if (inComment) {
126
+ const e = rest.indexOf('*/');
127
+ if (e < 0)
128
+ return `<span class="t-cmt">${escH$1(rest)}</span>`;
129
+ out += `<span class="t-cmt">${escH$1(rest.slice(0, e + 2))}</span>`;
130
+ rest = rest.slice(e + 2);
131
+ inComment = false;
132
+ }
133
+ while (rest.length > 0) {
134
+ if (rest.startsWith('/*')) {
135
+ const e = rest.indexOf('*/', 2);
136
+ if (e < 0) {
137
+ out += `<span class="t-cmt">${escH$1(rest)}</span>`;
138
+ inComment = true;
139
+ break;
140
+ }
141
+ out += `<span class="t-cmt">${escH$1(rest.slice(0, e + 2))}</span>`;
142
+ rest = rest.slice(e + 2);
143
+ continue;
144
+ }
145
+ // string
146
+ const strM = rest.match(/^("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/);
147
+ if (strM) {
148
+ out += `<span class="t-str">${escH$1(strM[0])}</span>`;
149
+ rest = rest.slice(strM[0].length);
150
+ continue;
151
+ }
152
+ // @-rule
153
+ const atM = rest.match(/^@(media|keyframes|import|font-face|layer|container|supports|charset|namespace)\b/);
154
+ if (atM) {
155
+ out += `<span class="t-kw">${escH$1(atM[0])}</span>`;
156
+ rest = rest.slice(atM[0].length);
157
+ continue;
158
+ }
159
+ // CSS property
160
+ const propM = rest.match(/^(-{1,2}[a-zA-Z][a-zA-Z0-9-]*)(?=\s*:)/);
161
+ if (propM) {
162
+ out += `<span class="t-prop">${escH$1(propM[0])}</span>`;
163
+ rest = rest.slice(propM[0].length);
164
+ continue;
165
+ }
166
+ // hex color
167
+ const hashM = rest.match(/^#([0-9a-fA-F]{3,8})\b/);
168
+ if (hashM) {
169
+ out += `<span class="t-num" style="border-bottom:2px solid #${hashM[1]}">#${hashM[1]}</span>`;
170
+ rest = rest.slice(hashM[0].length);
171
+ continue;
172
+ }
173
+ // number + unit
174
+ const numM = rest.match(/^-?[\d.]+(?:px|em|rem|vh|vw|vmin|vmax|%|s|ms|deg|rad|fr|ch|ex|cm|mm|in|pt|pc)?/);
175
+ if (numM && numM[0] && /\d/.test(numM[0])) {
176
+ out += `<span class="t-num">${numM[0]}</span>`;
177
+ rest = rest.slice(numM[0].length);
178
+ continue;
179
+ }
180
+ // function call
181
+ const fnM = rest.match(/^([a-zA-Z-]+)(?=\s*\()/);
182
+ if (fnM) {
183
+ out += `<span class="t-fn">${fnM[1]}</span>`;
184
+ rest = rest.slice(fnM[1].length);
185
+ continue;
186
+ }
187
+ // selector fragment
188
+ const selM = rest.match(/^([.#:][a-zA-Z_-][a-zA-Z0-9_-]*)/);
189
+ if (selM) {
190
+ out += `<span class="t-sel">${escH$1(selM[0])}</span>`;
191
+ rest = rest.slice(selM[0].length);
192
+ continue;
193
+ }
194
+ // keyword value
195
+ const kwM = rest.match(/^\b(important|auto|none|inherit|initial|unset|normal|bold|flex|grid|block|inline|absolute|relative|fixed|sticky|hidden|visible|scroll|solid|dashed|dotted|transparent|currentColor|center|left|right|top|bottom)\b/);
196
+ if (kwM) {
197
+ out += `<span class="t-kw">${kwM[0]}</span>`;
198
+ rest = rest.slice(kwM[0].length);
199
+ continue;
200
+ }
201
+ out += escH$1(rest[0]);
202
+ rest = rest.slice(1);
203
+ }
204
+ return out;
205
+ })
206
+ .join('\n');
207
+ }
208
+ // ─── HTML Tokenizer ─────────────────────────────────────────────────────────
209
+ function tokenizeHTML(code) {
210
+ let out = '', i = 0;
211
+ while (i < code.length) {
212
+ // comment
213
+ if (code.slice(i, i + 4) === '<!--') {
214
+ const e = code.indexOf('-->', i + 4);
215
+ const chunk = e >= 0 ? code.slice(i, e + 3) : code.slice(i);
216
+ out += `<span class="t-cmt">${escH$1(chunk)}</span>`;
217
+ i = e >= 0 ? e + 3 : code.length;
218
+ continue;
219
+ }
220
+ if (code[i] === '<') {
221
+ const tagEnd = code.indexOf('>', i);
222
+ if (tagEnd < 0) {
223
+ out += escH$1(code.slice(i));
224
+ break;
225
+ }
226
+ const rawTag = code.slice(i, tagEnd + 1);
227
+ const close = code[i + 1] === '/';
228
+ const tagM = rawTag.match(/^<\/?([a-zA-Z][a-zA-Z0-9-]*)/);
229
+ if (!tagM) {
230
+ out += escH$1(rawTag);
231
+ i = tagEnd + 1;
232
+ continue;
233
+ }
234
+ const tagName = tagM[1];
235
+ let inner = rawTag.slice(tagM[0].length, -1);
236
+ // highlight attributes
237
+ inner = inner.replace(/([a-zA-Z_:][a-zA-Z0-9_:.-]*)(\s*=\s*)("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')?/g, (_, a, eq, v) => `<span class="t-attr">${escH$1(a)}</span>${escH$1(eq || '')}${v ? `<span class="t-str">${escH$1(v)}</span>` : ''}`);
238
+ out += `<span class="t-op">&lt;${close ? '/' : ''}</span><span class="t-tag">${tagName}</span>${inner}<span class="t-op">&gt;</span>`;
239
+ i = tagEnd + 1;
240
+ continue;
241
+ }
242
+ // HTML entity
243
+ if (code[i] === '&') {
244
+ const e = code.indexOf(';', i);
245
+ if (e >= 0 && e - i < 12) {
246
+ out += `<span class="t-str">${escH$1(code.slice(i, e + 1))}</span>`;
247
+ i = e + 1;
248
+ continue;
249
+ }
250
+ }
251
+ out += escH$1(code[i++]);
252
+ }
253
+ return out;
254
+ }
255
+ // ─── JSON Tokenizer ─────────────────────────────────────────────────────────
256
+ function tokenizeJSON(code) {
257
+ const lines = code.split('\n');
258
+ return lines
259
+ .map(line => {
260
+ let out = '', rest = line;
261
+ while (rest.length > 0) {
262
+ const strM = rest.match(/^("(?:[^"\\]|\\.)*")/);
263
+ if (strM) {
264
+ const s = strM[0];
265
+ if (rest[s.length] === ':' || rest.slice(s.length).match(/^\s*:/))
266
+ out += `<span class="t-prop">${escH$1(s)}</span>`;
267
+ else
268
+ out += `<span class="t-str">${escH$1(s)}</span>`;
269
+ rest = rest.slice(s.length);
270
+ continue;
271
+ }
272
+ const numM = rest.match(/^-?\d+\.?\d*(?:[eE][+-]?\d+)?/);
273
+ if (numM) {
274
+ out += `<span class="t-num">${numM[0]}</span>`;
275
+ rest = rest.slice(numM[0].length);
276
+ continue;
277
+ }
278
+ const kwM = rest.match(/^\b(true|false|null)\b/);
279
+ if (kwM) {
280
+ out += `<span class="t-kw">${kwM[0]}</span>`;
281
+ rest = rest.slice(kwM[0].length);
282
+ continue;
283
+ }
284
+ out += escH$1(rest[0]);
285
+ rest = rest.slice(1);
286
+ }
287
+ return out;
288
+ })
289
+ .join('\n');
290
+ }
291
+ function tokenize$1(code, lang) {
292
+ switch (lang) {
293
+ case 'js':
294
+ return tokenizeJS(code);
295
+ case 'css':
296
+ return tokenizeCSS(code);
297
+ case 'html':
298
+ return tokenizeHTML(code);
299
+ case 'json':
300
+ return tokenizeJSON(code);
301
+ default:
302
+ return escH$1(code);
303
+ }
304
+ }
305
+
306
+ // src/utils/ast-parser.ts
307
+ // Lightweight JS AST parser — produces a tree for the AST Explorer panel
308
+ const JS_KEYWORDS = new Set([
309
+ 'const',
310
+ 'let',
311
+ 'var',
312
+ 'function',
313
+ 'class',
314
+ 'return',
315
+ 'if',
316
+ 'else',
317
+ 'for',
318
+ 'while',
319
+ 'do',
320
+ 'switch',
321
+ 'case',
322
+ 'break',
323
+ 'continue',
324
+ 'new',
325
+ 'import',
326
+ 'export',
327
+ 'default',
328
+ 'from',
329
+ 'async',
330
+ 'await',
331
+ 'try',
332
+ 'catch',
333
+ 'finally',
334
+ 'throw',
335
+ 'typeof',
336
+ 'instanceof',
337
+ 'delete',
338
+ 'void',
339
+ 'yield',
340
+ ]);
341
+ function tokenize(code) {
342
+ const toks = [];
343
+ let i = 0;
344
+ while (i < code.length) {
345
+ // whitespace
346
+ if (/\s/.test(code[i])) {
347
+ i++;
348
+ continue;
349
+ }
350
+ // single-line comment
351
+ if (code.slice(i, i + 2) === '//') {
352
+ while (i < code.length && code[i] !== '\n')
353
+ i++;
354
+ continue;
355
+ }
356
+ // multi-line comment
357
+ if (code.slice(i, i + 2) === '/*') {
358
+ while (i < code.length && code.slice(i, i + 2) !== '*/')
359
+ i++;
360
+ i += 2;
361
+ continue;
362
+ }
363
+ // string / template
364
+ const strM = code.slice(i).match(/^("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|`(?:[^`\\]|\\.)*`)/);
365
+ if (strM) {
366
+ toks.push({ t: 'string', v: strM[0] });
367
+ i += strM[0].length;
368
+ continue;
369
+ }
370
+ // number
371
+ const numM = code.slice(i).match(/^[\d.]+/);
372
+ if (numM) {
373
+ toks.push({ t: 'number', v: numM[0] });
374
+ i += numM[0].length;
375
+ continue;
376
+ }
377
+ // identifier / keyword
378
+ const idM = code.slice(i).match(/^[a-zA-Z_$][a-zA-Z0-9_$]*/);
379
+ if (idM) {
380
+ toks.push({ t: JS_KEYWORDS.has(idM[0]) ? 'keyword' : 'identifier', v: idM[0] });
381
+ i += idM[0].length;
382
+ continue;
383
+ }
384
+ // punctuation / operator
385
+ const pM = code.slice(i).match(/^(===|!==|=>|\.{3}|\?\?|[{}()\[\];,.:+\-*/%=<>!&|^~?])/);
386
+ if (pM) {
387
+ toks.push({ t: 'punct', v: pM[0] });
388
+ i += pM[0].length;
389
+ continue;
390
+ }
391
+ i++;
392
+ }
393
+ toks.push({ t: 'eof', v: '' });
394
+ return toks;
395
+ }
396
+ class Parser {
397
+ toks;
398
+ i = 0;
399
+ constructor(toks) {
400
+ this.toks = toks;
401
+ }
402
+ peek() {
403
+ return this.toks[this.i] ?? { t: 'eof', v: '' };
404
+ }
405
+ eat() {
406
+ return this.toks[this.i++] ?? { t: 'eof', v: '' };
407
+ }
408
+ parseProgram() {
409
+ const body = [];
410
+ while (this.peek().t !== 'eof' && this.i < this.toks.length - 1) {
411
+ try {
412
+ const node = this.parseStatement();
413
+ if (node)
414
+ body.push(node);
415
+ }
416
+ catch {
417
+ this.i++;
418
+ if (body.length > 60)
419
+ break;
420
+ }
421
+ }
422
+ return { type: 'Program', body };
423
+ }
424
+ parseStatement() {
425
+ const p = this.peek();
426
+ if (p.v === 'import')
427
+ return this.parseImport();
428
+ if (p.v === 'export')
429
+ return this.parseExport();
430
+ if (p.v === 'class')
431
+ return this.parseClass();
432
+ if (p.v === 'function' || p.v === 'async')
433
+ return this.parseFunction();
434
+ if (p.v === 'const' || p.v === 'let' || p.v === 'var')
435
+ return this.parseVarDecl();
436
+ if (p.v === 'return')
437
+ return this.parseReturn();
438
+ if (p.v === 'if')
439
+ return this.parseIf();
440
+ if (p.v === 'for')
441
+ return this.parseFor();
442
+ if (p.v === 'while')
443
+ return this.parseWhile();
444
+ if (p.v === 'try')
445
+ return this.parseTryCatch();
446
+ // expression statement — skip to semicolon or block boundary
447
+ return this.skipToSemicolon();
448
+ }
449
+ skipToSemicolon() {
450
+ let depth = 0;
451
+ while (this.peek().t !== 'eof') {
452
+ const v = this.peek().v;
453
+ if (v === '{' || v === '(' || v === '[')
454
+ depth++;
455
+ if (v === '}' || v === ')' || v === ']') {
456
+ if (depth === 0)
457
+ break;
458
+ depth--;
459
+ }
460
+ if (depth === 0 && v === ';') {
461
+ this.eat();
462
+ break;
463
+ }
464
+ this.eat();
465
+ }
466
+ return { type: 'ExpressionStatement' };
467
+ }
468
+ parseImport() {
469
+ this.eat(); // import
470
+ const specifiers = [];
471
+ while (this.peek().t !== 'eof' && this.peek().v !== ';' && this.peek().v !== '\n') {
472
+ if (this.peek().t === 'identifier')
473
+ specifiers.push(this.peek().v);
474
+ this.eat();
475
+ }
476
+ if (this.peek().v === ';')
477
+ this.eat();
478
+ return { type: 'ImportDeclaration', specifiers };
479
+ }
480
+ parseExport() {
481
+ this.eat(); // export
482
+ const isDefault = this.peek().v === 'default';
483
+ if (isDefault)
484
+ this.eat();
485
+ const declaration = this.peek().t !== 'eof' ? this.parseStatement() : null;
486
+ return { type: 'ExportDeclaration', default: isDefault, declaration };
487
+ }
488
+ parseClass() {
489
+ this.eat(); // class
490
+ const name = this.peek().t === 'identifier' ? this.eat().v : '';
491
+ let superClass = null;
492
+ if (this.peek().v === 'extends') {
493
+ this.eat();
494
+ superClass = this.peek().t === 'identifier' ? this.eat().v : null;
495
+ }
496
+ const methods = [];
497
+ if (this.peek().v === '{') {
498
+ this.eat();
499
+ let depth = 1;
500
+ while (this.peek().t !== 'eof' && depth > 0) {
501
+ const v = this.peek().v;
502
+ if (v === '{')
503
+ depth++;
504
+ if (v === '}') {
505
+ depth--;
506
+ if (depth === 0) {
507
+ this.eat();
508
+ break;
509
+ }
510
+ }
511
+ if (depth === 1 && this.peek().t === 'identifier' && this.toks[this.i + 1]?.v === '(') {
512
+ const modifier = this.toks[this.i - 1]?.v === 'static' ? 'static' : this.toks[this.i - 1]?.v === 'async' ? 'async' : '';
513
+ methods.push({ type: 'MethodDefinition', key: this.peek().v, kind: modifier || 'method' });
514
+ }
515
+ this.eat();
516
+ }
517
+ }
518
+ return { type: 'ClassDeclaration', id: { name }, superClass, body: { type: 'ClassBody', body: methods } };
519
+ }
520
+ parseFunction() {
521
+ if (this.peek().v === 'async')
522
+ this.eat();
523
+ this.eat(); // function
524
+ const name = this.peek().t === 'identifier' ? this.eat().v : '(anonymous)';
525
+ const params = [];
526
+ if (this.peek().v === '(') {
527
+ this.eat();
528
+ while (this.peek().v !== ')' && this.peek().t !== 'eof') {
529
+ if (this.peek().t === 'identifier')
530
+ params.push(this.peek().v);
531
+ this.eat();
532
+ }
533
+ if (this.peek().v === ')')
534
+ this.eat();
535
+ }
536
+ // skip body
537
+ this.skipBlock();
538
+ return { type: 'FunctionDeclaration', id: { name }, params: params.map(p => ({ type: 'Identifier', name: p })) };
539
+ }
540
+ skipBlock() {
541
+ if (this.peek().v !== '{')
542
+ return;
543
+ this.eat();
544
+ let depth = 1;
545
+ while (this.peek().t !== 'eof' && depth > 0) {
546
+ if (this.peek().v === '{')
547
+ depth++;
548
+ if (this.peek().v === '}')
549
+ depth--;
550
+ this.eat();
551
+ }
552
+ }
553
+ parseVarDecl() {
554
+ const kind = this.eat().v; // const / let / var
555
+ const declarations = [];
556
+ while (this.peek().t !== 'eof' && this.peek().v !== ';') {
557
+ if (this.peek().t === 'identifier') {
558
+ const id = this.eat().v;
559
+ let init = null;
560
+ if (this.peek().v === '=') {
561
+ this.eat();
562
+ // try to capture simple init expression
563
+ if (this.peek().t === 'string')
564
+ init = { type: 'Literal', value: this.eat().v };
565
+ else if (this.peek().t === 'number')
566
+ init = { type: 'Literal', value: this.eat().v };
567
+ else if (this.peek().v === 'new') {
568
+ this.eat();
569
+ const cls = this.peek().t === 'identifier' ? this.eat().v : '';
570
+ if (this.peek().v === '(') {
571
+ this.eat();
572
+ while (this.peek().v !== ')' && this.peek().t !== 'eof')
573
+ this.eat();
574
+ this.eat();
575
+ }
576
+ init = { type: 'NewExpression', callee: cls };
577
+ }
578
+ else {
579
+ // skip complex init
580
+ let depth = 0;
581
+ while (this.peek().t !== 'eof') {
582
+ const v = this.peek().v;
583
+ if (v === '{' || v === '(' || v === '[')
584
+ depth++;
585
+ if (v === '}' || v === ')' || v === ']') {
586
+ if (depth === 0)
587
+ break;
588
+ depth--;
589
+ }
590
+ if (depth === 0 && (v === ',' || v === ';'))
591
+ break;
592
+ this.eat();
593
+ }
594
+ }
595
+ }
596
+ declarations.push({ type: 'VariableDeclarator', id: { type: 'Identifier', name: id }, init });
597
+ if (this.peek().v === ',')
598
+ this.eat();
599
+ }
600
+ else {
601
+ if (this.peek().v === '{' || this.peek().v === '[') {
602
+ this.skipBlock();
603
+ break;
604
+ }
605
+ this.eat();
606
+ }
607
+ }
608
+ if (this.peek().v === ';')
609
+ this.eat();
610
+ return { type: 'VariableDeclaration', kind, declarations };
611
+ }
612
+ parseReturn() {
613
+ this.eat(); // return
614
+ return this.skipToSemicolon() && { type: 'ReturnStatement' };
615
+ }
616
+ parseIf() {
617
+ this.eat(); // if
618
+ if (this.peek().v === '(') {
619
+ this.eat();
620
+ while (this.peek().v !== ')' && this.peek().t !== 'eof')
621
+ this.eat();
622
+ this.eat();
623
+ }
624
+ this.skipBlock();
625
+ if (this.peek().v === 'else') {
626
+ this.eat();
627
+ this.skipBlock();
628
+ }
629
+ return { type: 'IfStatement' };
630
+ }
631
+ parseFor() {
632
+ this.eat(); // for
633
+ if (this.peek().v === '(') {
634
+ this.eat();
635
+ while (this.peek().v !== ')' && this.peek().t !== 'eof')
636
+ this.eat();
637
+ this.eat();
638
+ }
639
+ this.skipBlock();
640
+ return { type: 'ForStatement' };
641
+ }
642
+ parseWhile() {
643
+ this.eat(); // while
644
+ if (this.peek().v === '(') {
645
+ this.eat();
646
+ while (this.peek().v !== ')' && this.peek().t !== 'eof')
647
+ this.eat();
648
+ this.eat();
649
+ }
650
+ this.skipBlock();
651
+ return { type: 'WhileStatement' };
652
+ }
653
+ parseTryCatch() {
654
+ this.eat(); // try
655
+ this.skipBlock();
656
+ if (this.peek().v === 'catch') {
657
+ this.eat();
658
+ if (this.peek().v === '(') {
659
+ this.eat();
660
+ while (this.peek().v !== ')' && this.peek().t !== 'eof')
661
+ this.eat();
662
+ this.eat();
663
+ }
664
+ this.skipBlock();
665
+ }
666
+ if (this.peek().v === 'finally') {
667
+ this.eat();
668
+ this.skipBlock();
669
+ }
670
+ return { type: 'TryStatement' };
671
+ }
672
+ }
673
+ function parseAST(code) {
674
+ try {
675
+ const toks = tokenize(code);
676
+ return new Parser(toks).parseProgram();
677
+ }
678
+ catch (e) {
679
+ return { type: 'Program', body: [], error: String(e) };
680
+ }
681
+ }
682
+
683
+ const JS_ITEMS = [
684
+ // keywords
685
+ ...[
686
+ 'const',
687
+ 'let',
688
+ 'var',
689
+ 'function',
690
+ 'class',
691
+ 'return',
692
+ 'if',
693
+ 'else',
694
+ 'for',
695
+ 'while',
696
+ 'do',
697
+ 'switch',
698
+ 'case',
699
+ 'break',
700
+ 'continue',
701
+ 'try',
702
+ 'catch',
703
+ 'finally',
704
+ 'throw',
705
+ 'async',
706
+ 'await',
707
+ 'import',
708
+ 'export',
709
+ 'default',
710
+ 'from',
711
+ 'new',
712
+ 'this',
713
+ 'typeof',
714
+ 'instanceof',
715
+ 'delete',
716
+ 'void',
717
+ 'null',
718
+ 'undefined',
719
+ 'true',
720
+ 'false',
721
+ ].map(k => ({
722
+ label: k,
723
+ type: 'kw',
724
+ detail: 'keyword',
725
+ })),
726
+ // snippets
727
+ {
728
+ label: 'caf',
729
+ type: 'snip',
730
+ detail: 'const arrow fn',
731
+ doc: 'Creates a const arrow function',
732
+ insert: 'const ${1:name} = (${2:args}) => {\n $0\n};',
733
+ },
734
+ {
735
+ label: 'afn',
736
+ type: 'snip',
737
+ detail: 'async arrow fn',
738
+ insert: 'const ${1:name} = async (${2:args}) => {\n $0\n};',
739
+ },
740
+ {
741
+ label: 'fn',
742
+ type: 'snip',
743
+ detail: 'function declaration',
744
+ insert: 'function ${1:name}(${2:args}) {\n $0\n}',
745
+ },
746
+ {
747
+ label: 'class',
748
+ type: 'snip',
749
+ detail: 'class declaration',
750
+ insert: 'class ${1:Name} {\n constructor(${2:args}) {\n $0\n }\n}',
751
+ },
752
+ {
753
+ label: 'for',
754
+ type: 'snip',
755
+ detail: 'for loop',
756
+ insert: 'for (let ${1:i} = 0; ${1:i} < ${2:arr}.length; ${1:i}++) {\n $0\n}',
757
+ },
758
+ {
759
+ label: 'forin',
760
+ type: 'snip',
761
+ detail: 'for...in',
762
+ insert: 'for (const ${1:key} in ${2:obj}) {\n $0\n}',
763
+ },
764
+ {
765
+ label: 'forof',
766
+ type: 'snip',
767
+ detail: 'for...of',
768
+ insert: 'for (const ${1:item} of ${2:arr}) {\n $0\n}',
769
+ },
770
+ {
771
+ label: 'try',
772
+ type: 'snip',
773
+ detail: 'try / catch',
774
+ insert: 'try {\n $0\n} catch (${1:err}) {\n console.error(${1:err});\n}',
775
+ },
776
+ {
777
+ label: 'imp',
778
+ type: 'snip',
779
+ detail: 'import statement',
780
+ insert: "import { ${1:name} } from '${2:module}';",
781
+ },
782
+ {
783
+ label: 'prom',
784
+ type: 'snip',
785
+ detail: 'new Promise',
786
+ insert: 'new Promise((${1:resolve}, ${2:reject}) => {\n $0\n})',
787
+ },
788
+ {
789
+ label: 'ife',
790
+ type: 'snip',
791
+ detail: 'immediately invoked fn',
792
+ insert: '(async () => {\n $0\n})();',
793
+ },
794
+ // builtins
795
+ ...[
796
+ 'console.log',
797
+ 'console.error',
798
+ 'console.warn',
799
+ 'console.table',
800
+ 'console.dir',
801
+ 'Math.floor',
802
+ 'Math.ceil',
803
+ 'Math.round',
804
+ 'Math.max',
805
+ 'Math.min',
806
+ 'Math.abs',
807
+ 'Math.random',
808
+ 'Math.pow',
809
+ 'Math.sqrt',
810
+ 'Array.from',
811
+ 'Array.isArray',
812
+ 'Array.of',
813
+ 'Object.keys',
814
+ 'Object.values',
815
+ 'Object.entries',
816
+ 'Object.assign',
817
+ 'Object.freeze',
818
+ 'Object.create',
819
+ 'JSON.parse',
820
+ 'JSON.stringify',
821
+ 'parseInt',
822
+ 'parseFloat',
823
+ 'isNaN',
824
+ 'isFinite',
825
+ 'setTimeout',
826
+ 'setInterval',
827
+ 'clearTimeout',
828
+ 'clearInterval',
829
+ 'requestAnimationFrame',
830
+ 'fetch',
831
+ 'Promise.all',
832
+ 'Promise.allSettled',
833
+ 'Promise.race',
834
+ 'Promise.resolve',
835
+ 'Promise.reject',
836
+ 'document.querySelector',
837
+ 'document.querySelectorAll',
838
+ 'document.getElementById',
839
+ 'document.createElement',
840
+ 'document.addEventListener',
841
+ 'window.addEventListener',
842
+ 'window.removeEventListener',
843
+ 'localStorage.getItem',
844
+ 'localStorage.setItem',
845
+ 'localStorage.removeItem',
846
+ 'sessionStorage.getItem',
847
+ 'sessionStorage.setItem',
848
+ ].map(b => ({ label: b, type: 'fn', detail: 'builtin' })),
849
+ // array methods
850
+ ...[
851
+ 'forEach',
852
+ 'map',
853
+ 'filter',
854
+ 'reduce',
855
+ 'reduceRight',
856
+ 'find',
857
+ 'findIndex',
858
+ 'findLast',
859
+ 'some',
860
+ 'every',
861
+ 'includes',
862
+ 'indexOf',
863
+ 'lastIndexOf',
864
+ 'slice',
865
+ 'splice',
866
+ 'push',
867
+ 'pop',
868
+ 'shift',
869
+ 'unshift',
870
+ 'sort',
871
+ 'reverse',
872
+ 'flat',
873
+ 'flatMap',
874
+ 'join',
875
+ 'fill',
876
+ 'copyWithin',
877
+ 'entries',
878
+ 'keys',
879
+ 'values',
880
+ 'at',
881
+ 'toSorted',
882
+ 'toReversed',
883
+ 'toSpliced',
884
+ 'with',
885
+ ].map(m => ({ label: '.' + m, type: 'prop', detail: 'Array method' })),
886
+ // string methods
887
+ ...[
888
+ 'split',
889
+ 'trim',
890
+ 'trimStart',
891
+ 'trimEnd',
892
+ 'replace',
893
+ 'replaceAll',
894
+ 'match',
895
+ 'matchAll',
896
+ 'search',
897
+ 'startsWith',
898
+ 'endsWith',
899
+ 'includes',
900
+ 'indexOf',
901
+ 'lastIndexOf',
902
+ 'slice',
903
+ 'substring',
904
+ 'padStart',
905
+ 'padEnd',
906
+ 'repeat',
907
+ 'toUpperCase',
908
+ 'toLowerCase',
909
+ 'charAt',
910
+ 'charCodeAt',
911
+ 'codePointAt',
912
+ 'normalize',
913
+ 'at',
914
+ ].map(m => ({ label: '.' + m, type: 'prop', detail: 'String method' })),
915
+ // promise / async methods
916
+ ...['then', 'catch', 'finally'].map(m => ({ label: '.' + m, type: 'prop', detail: 'Promise method' })),
917
+ ];
918
+ const CSS_ITEMS = [
919
+ ...[
920
+ 'display',
921
+ 'position',
922
+ 'flex',
923
+ 'grid',
924
+ 'width',
925
+ 'height',
926
+ 'min-width',
927
+ 'max-width',
928
+ 'min-height',
929
+ 'max-height',
930
+ 'margin',
931
+ 'margin-top',
932
+ 'margin-right',
933
+ 'margin-bottom',
934
+ 'margin-left',
935
+ 'padding',
936
+ 'padding-top',
937
+ 'padding-right',
938
+ 'padding-bottom',
939
+ 'padding-left',
940
+ 'color',
941
+ 'background',
942
+ 'background-color',
943
+ 'background-image',
944
+ 'background-size',
945
+ 'background-position',
946
+ 'border',
947
+ 'border-width',
948
+ 'border-style',
949
+ 'border-color',
950
+ 'border-radius',
951
+ 'font-size',
952
+ 'font-weight',
953
+ 'font-family',
954
+ 'font-style',
955
+ 'line-height',
956
+ 'letter-spacing',
957
+ 'text-align',
958
+ 'text-decoration',
959
+ 'text-transform',
960
+ 'white-space',
961
+ 'word-break',
962
+ 'overflow',
963
+ 'overflow-x',
964
+ 'overflow-y',
965
+ 'z-index',
966
+ 'opacity',
967
+ 'visibility',
968
+ 'pointer-events',
969
+ 'cursor',
970
+ 'user-select',
971
+ 'outline',
972
+ 'box-shadow',
973
+ 'text-shadow',
974
+ 'transition',
975
+ 'transform',
976
+ 'animation',
977
+ 'animation-name',
978
+ 'animation-duration',
979
+ 'gap',
980
+ 'row-gap',
981
+ 'column-gap',
982
+ 'align-items',
983
+ 'align-self',
984
+ 'align-content',
985
+ 'justify-content',
986
+ 'justify-items',
987
+ 'justify-self',
988
+ 'flex-direction',
989
+ 'flex-wrap',
990
+ 'flex-grow',
991
+ 'flex-shrink',
992
+ 'flex-basis',
993
+ 'grid-template-columns',
994
+ 'grid-template-rows',
995
+ 'grid-column',
996
+ 'grid-row',
997
+ 'grid-area',
998
+ 'place-items',
999
+ 'place-content',
1000
+ 'object-fit',
1001
+ 'object-position',
1002
+ 'aspect-ratio',
1003
+ 'clip-path',
1004
+ 'filter',
1005
+ 'backdrop-filter',
1006
+ 'will-change',
1007
+ 'contain',
1008
+ 'content',
1009
+ 'resize',
1010
+ 'top',
1011
+ 'right',
1012
+ 'bottom',
1013
+ 'left',
1014
+ 'inset',
1015
+ ].map(p => ({ label: p, type: 'prop', detail: 'property' })),
1016
+ ...[
1017
+ 'none',
1018
+ 'auto',
1019
+ 'inherit',
1020
+ 'initial',
1021
+ 'unset',
1022
+ 'revert',
1023
+ 'flex',
1024
+ 'grid',
1025
+ 'block',
1026
+ 'inline',
1027
+ 'inline-block',
1028
+ 'inline-flex',
1029
+ 'inline-grid',
1030
+ 'absolute',
1031
+ 'relative',
1032
+ 'fixed',
1033
+ 'sticky',
1034
+ 'static',
1035
+ 'hidden',
1036
+ 'visible',
1037
+ 'scroll',
1038
+ 'clip',
1039
+ 'transparent',
1040
+ 'currentColor',
1041
+ 'center',
1042
+ 'start',
1043
+ 'end',
1044
+ 'stretch',
1045
+ 'left',
1046
+ 'right',
1047
+ 'normal',
1048
+ 'bold',
1049
+ 'italic',
1050
+ 'nowrap',
1051
+ 'pre',
1052
+ 'pre-wrap',
1053
+ 'break-word',
1054
+ 'pointer',
1055
+ 'default',
1056
+ 'cover',
1057
+ 'contain',
1058
+ 'fill',
1059
+ 'underline',
1060
+ 'line-through',
1061
+ 'uppercase',
1062
+ 'lowercase',
1063
+ 'capitalize',
1064
+ 'ease',
1065
+ 'ease-in',
1066
+ 'ease-out',
1067
+ 'ease-in-out',
1068
+ 'linear',
1069
+ 'forwards',
1070
+ 'backwards',
1071
+ 'both',
1072
+ ].map(v => ({ label: v, type: 'kw', detail: 'value' })),
1073
+ ...[
1074
+ 'rgb()',
1075
+ 'rgba()',
1076
+ 'hsl()',
1077
+ 'hsla()',
1078
+ 'oklch()',
1079
+ 'color()',
1080
+ 'linear-gradient()',
1081
+ 'radial-gradient()',
1082
+ 'conic-gradient()',
1083
+ 'var()',
1084
+ 'calc()',
1085
+ 'clamp()',
1086
+ 'min()',
1087
+ 'max()',
1088
+ 'env()',
1089
+ 'url()',
1090
+ 'format()',
1091
+ 'translate()',
1092
+ 'scale()',
1093
+ 'rotate()',
1094
+ 'matrix()',
1095
+ ].map(f => ({ label: f, type: 'fn', detail: 'function' })),
1096
+ ];
1097
+ const HTML_ITEMS = [
1098
+ ...[
1099
+ 'div',
1100
+ 'span',
1101
+ 'p',
1102
+ 'h1',
1103
+ 'h2',
1104
+ 'h3',
1105
+ 'h4',
1106
+ 'h5',
1107
+ 'h6',
1108
+ 'a',
1109
+ 'img',
1110
+ 'input',
1111
+ 'button',
1112
+ 'form',
1113
+ 'label',
1114
+ 'select',
1115
+ 'option',
1116
+ 'optgroup',
1117
+ 'textarea',
1118
+ 'fieldset',
1119
+ 'legend',
1120
+ 'ul',
1121
+ 'ol',
1122
+ 'li',
1123
+ 'dl',
1124
+ 'dt',
1125
+ 'dd',
1126
+ 'table',
1127
+ 'tr',
1128
+ 'td',
1129
+ 'th',
1130
+ 'thead',
1131
+ 'tbody',
1132
+ 'tfoot',
1133
+ 'caption',
1134
+ 'colgroup',
1135
+ 'col',
1136
+ 'nav',
1137
+ 'header',
1138
+ 'footer',
1139
+ 'main',
1140
+ 'section',
1141
+ 'article',
1142
+ 'aside',
1143
+ 'address',
1144
+ 'dialog',
1145
+ 'details',
1146
+ 'summary',
1147
+ 'figure',
1148
+ 'figcaption',
1149
+ 'video',
1150
+ 'audio',
1151
+ 'source',
1152
+ 'track',
1153
+ 'canvas',
1154
+ 'svg',
1155
+ 'path',
1156
+ 'circle',
1157
+ 'rect',
1158
+ 'line',
1159
+ 'script',
1160
+ 'link',
1161
+ 'meta',
1162
+ 'title',
1163
+ 'base',
1164
+ 'head',
1165
+ 'body',
1166
+ 'html',
1167
+ 'style',
1168
+ 'template',
1169
+ 'slot',
1170
+ 'picture',
1171
+ 'iframe',
1172
+ 'object',
1173
+ 'embed',
1174
+ 'code',
1175
+ 'pre',
1176
+ 'kbd',
1177
+ 'samp',
1178
+ 'var',
1179
+ 'mark',
1180
+ 'del',
1181
+ 'ins',
1182
+ 's',
1183
+ 'sub',
1184
+ 'sup',
1185
+ 'abbr',
1186
+ 'blockquote',
1187
+ 'cite',
1188
+ 'q',
1189
+ 'small',
1190
+ 'strong',
1191
+ 'em',
1192
+ 'b',
1193
+ 'i',
1194
+ 'u',
1195
+ 'time',
1196
+ 'data',
1197
+ ].map(t => ({ label: '<' + t, type: 'tag', detail: 'element', insert: `<${t}>$0</${t}>` })),
1198
+ ...[
1199
+ 'class',
1200
+ 'id',
1201
+ 'src',
1202
+ 'href',
1203
+ 'alt',
1204
+ 'type',
1205
+ 'name',
1206
+ 'value',
1207
+ 'placeholder',
1208
+ 'disabled',
1209
+ 'checked',
1210
+ 'readonly',
1211
+ 'required',
1212
+ 'data-',
1213
+ 'aria-label',
1214
+ 'aria-hidden',
1215
+ 'aria-expanded',
1216
+ 'aria-controls',
1217
+ 'aria-describedby',
1218
+ 'role',
1219
+ 'tabindex',
1220
+ 'style',
1221
+ 'title',
1222
+ 'target',
1223
+ 'rel',
1224
+ 'action',
1225
+ 'method',
1226
+ 'for',
1227
+ 'colspan',
1228
+ 'rowspan',
1229
+ 'width',
1230
+ 'height',
1231
+ 'loading',
1232
+ 'defer',
1233
+ 'async',
1234
+ 'charset',
1235
+ 'content',
1236
+ 'property',
1237
+ 'lang',
1238
+ 'dir',
1239
+ 'hidden',
1240
+ 'autofocus',
1241
+ 'multiple',
1242
+ 'accept',
1243
+ 'pattern',
1244
+ 'min',
1245
+ 'max',
1246
+ 'step',
1247
+ 'autocomplete',
1248
+ 'enctype',
1249
+ 'novalidate',
1250
+ 'crossorigin',
1251
+ 'integrity',
1252
+ 'referrerpolicy',
1253
+ 'fetchpriority',
1254
+ ].map(a => ({ label: a, type: 'attr', detail: 'attribute' })),
1255
+ ];
1256
+ const JSON_ITEMS = [
1257
+ { label: 'true', type: 'kw', detail: 'boolean' },
1258
+ { label: 'false', type: 'kw', detail: 'boolean' },
1259
+ { label: 'null', type: 'kw', detail: 'null' },
1260
+ ];
1261
+ const DB = {
1262
+ js: JS_ITEMS,
1263
+ css: CSS_ITEMS,
1264
+ html: HTML_ITEMS,
1265
+ json: JSON_ITEMS,
1266
+ };
1267
+ function getCompletions(prefix, lang) {
1268
+ if (!prefix || prefix.length < 1)
1269
+ return [];
1270
+ const lower = prefix.toLowerCase();
1271
+ return (DB[lang] || []).filter(item => item.label.toLowerCase().startsWith(lower) && item.label !== prefix).slice(0, 14);
1272
+ }
1273
+
1274
+ // src/utils/history.ts
1275
+ class EditHistory {
1276
+ stack = [];
1277
+ index = -1;
1278
+ maxSize;
1279
+ timer = null;
1280
+ constructor(maxSize = 200) {
1281
+ this.maxSize = maxSize;
1282
+ }
1283
+ push(entry) {
1284
+ // debounce: only push after 400ms of inactivity
1285
+ if (this.timer !== null)
1286
+ clearTimeout(this.timer);
1287
+ this.timer = setTimeout(() => {
1288
+ if (this.stack[this.index]?.value === entry.value)
1289
+ return;
1290
+ this.stack = this.stack.slice(0, this.index + 1);
1291
+ this.stack.push({ ...entry });
1292
+ if (this.stack.length > this.maxSize)
1293
+ this.stack.shift();
1294
+ this.index = this.stack.length - 1;
1295
+ }, 400);
1296
+ }
1297
+ /** Push immediately (e.g., before a bulk operation) */
1298
+ pushNow(entry) {
1299
+ if (this.timer !== null) {
1300
+ clearTimeout(this.timer);
1301
+ this.timer = null;
1302
+ }
1303
+ if (this.stack[this.index]?.value === entry.value)
1304
+ return;
1305
+ this.stack = this.stack.slice(0, this.index + 1);
1306
+ this.stack.push({ ...entry });
1307
+ if (this.stack.length > this.maxSize)
1308
+ this.stack.shift();
1309
+ this.index = this.stack.length - 1;
1310
+ }
1311
+ undo() {
1312
+ if (this.index <= 0)
1313
+ return null;
1314
+ this.index--;
1315
+ return { ...this.stack[this.index] };
1316
+ }
1317
+ redo() {
1318
+ if (this.index >= this.stack.length - 1)
1319
+ return null;
1320
+ this.index++;
1321
+ return { ...this.stack[this.index] };
1322
+ }
1323
+ canUndo() {
1324
+ return this.index > 0;
1325
+ }
1326
+ canRedo() {
1327
+ return this.index < this.stack.length - 1;
1328
+ }
1329
+ }
1330
+
1331
+ // src/utils/plugin-system.ts
1332
+ class PluginSystem {
1333
+ plugins = new Map();
1334
+ hooks = {};
1335
+ handlers = {};
1336
+ register(def) {
1337
+ const enabled = def.enabled !== false;
1338
+ this.plugins.set(def.id, { ...def, enabled });
1339
+ if (enabled)
1340
+ def.activate?.();
1341
+ return this;
1342
+ }
1343
+ /** Transforming hook — each fn receives and returns a value */
1344
+ hook(name, fn) {
1345
+ (this.hooks[name] ??= []).push(fn);
1346
+ return () => {
1347
+ this.hooks[name] = (this.hooks[name] ?? []).filter(f => f !== fn);
1348
+ };
1349
+ }
1350
+ /** Run all hooks, threading value through each */
1351
+ applyHooks(name, initial, ...args) {
1352
+ return (this.hooks[name] ?? []).reduce((v, fn) => fn(v, ...args), initial);
1353
+ }
1354
+ /** Fire-and-forget event */
1355
+ on(event, fn) {
1356
+ (this.handlers[event] ??= []).push(fn);
1357
+ return () => {
1358
+ this.handlers[event] = (this.handlers[event] ?? []).filter(f => f !== fn);
1359
+ };
1360
+ }
1361
+ emit(event, data) {
1362
+ (this.handlers[event] ?? []).forEach(fn => fn(data));
1363
+ }
1364
+ toggle(id) {
1365
+ const p = this.plugins.get(id);
1366
+ if (!p)
1367
+ return false;
1368
+ p.enabled = !p.enabled;
1369
+ if (p.enabled)
1370
+ p.activate?.();
1371
+ else
1372
+ p.deactivate?.();
1373
+ return p.enabled;
1374
+ }
1375
+ isEnabled(id) {
1376
+ return this.plugins.get(id)?.enabled ?? false;
1377
+ }
1378
+ list() {
1379
+ return [...this.plugins.values()];
1380
+ }
1381
+ get(id) {
1382
+ return this.plugins.get(id);
1383
+ }
1384
+ }
1385
+
1386
+ const xCodeEditorCss = () => `@charset "UTF-8";:root{--x-color-primary:#1677ff;--x-color-primary-rgb:22, 119, 255;--x-color-primary-contrast:#ffffff;--x-color-primary-contrast-rgb:255, 255, 255;--x-color-primary-shade:#0958d9;--x-color-primary-tint:#4096ff;--x-color-primary-bg:#e6f4ff;--x-color-primary-bg-hover:#bae0ff;--x-color-primary-border:#91caff;--x-color-primary-border-hover:#69b1ff;--x-color-primary-hover:#4096ff;--x-color-primary-active:#0958d9;--x-color-primary-text:#1677ff;--x-color-primary-text-hover:#4096ff;--x-color-primary-text-active:#0958d9;--x-color-secondary:#3dc2ff;--x-color-secondary-rgb:61, 194, 255;--x-color-secondary-contrast:#ffffff;--x-color-secondary-contrast-rgb:255, 255, 255;--x-color-secondary-shade:#36abe0;--x-color-secondary-tint:#50c8ff;--x-color-success:#52c41a;--x-color-success-rgb:82, 196, 26;--x-color-success-contrast:#ffffff;--x-color-success-contrast-rgb:255, 255, 255;--x-color-success-shade:#389e0d;--x-color-success-tint:#73d13d;--x-color-success-bg:#f6ffed;--x-color-success-bg-hover:#d9f7be;--x-color-success-border:#b7eb8f;--x-color-success-border-hover:#95de64;--x-color-success-hover:#73d13d;--x-color-success-active:#389e0d;--x-color-success-text:#52c41a;--x-color-success-text-hover:#73d13d;--x-color-success-text-active:#389e0d;--x-color-warning:#faad14;--x-color-warning-rgb:250, 173, 20;--x-color-warning-contrast:#000000;--x-color-warning-contrast-rgb:0, 0, 0;--x-color-warning-shade:#d48806;--x-color-warning-tint:#ffc53d;--x-color-warning-bg:#fffbe6;--x-color-warning-bg-hover:#fff1b8;--x-color-warning-border:#ffe58f;--x-color-warning-border-hover:#ffd666;--x-color-warning-hover:#ffc53d;--x-color-warning-active:#d48806;--x-color-warning-text:#faad14;--x-color-warning-text-hover:#ffc53d;--x-color-warning-text-active:#d48806;--x-color-danger:#ff4d4f;--x-color-danger-rgb:255, 77, 79;--x-color-danger-contrast:#ffffff;--x-color-danger-contrast-rgb:255, 255, 255;--x-color-danger-shade:#cf1322;--x-color-danger-tint:#ff7875;--x-color-error:#ff4d4f;--x-color-error-rgb:255, 77, 79;--x-color-error-bg:#fff2f0;--x-color-error-bg-hover:#ffccc7;--x-color-error-border:#ffa39e;--x-color-error-border-hover:#ff7875;--x-color-error-hover:#ff7875;--x-color-error-active:#d9363e;--x-color-error-text:#ff4d4f;--x-color-error-text-hover:#ff7875;--x-color-error-text-active:#d9363e;--x-color-info:#1677ff;--x-color-info-rgb:22, 119, 255;--x-color-info-bg:#e6f4ff;--x-color-info-bg-hover:#bae0ff;--x-color-info-border:#91caff;--x-color-info-border-hover:#69b1ff;--x-color-info-hover:#69b1ff;--x-color-info-active:#0958d9;--x-color-info-text:#1677ff;--x-color-info-text-hover:#69b1ff;--x-color-info-text-active:#0958d9;--x-color-text:rgba(0, 0, 0, 0.88);--x-color-text-secondary:rgba(0, 0, 0, 0.65);--x-color-text-tertiary:rgba(0, 0, 0, 0.45);--x-color-text-quaternary:rgba(0, 0, 0, 0.25);--x-color-text-disabled:rgba(0, 0, 0, 0.25);--x-color-text-placeholder:rgba(0, 0, 0, 0.25);--x-color-text-heading:rgba(0, 0, 0, 0.88);--x-color-text-label:rgba(0, 0, 0, 0.65);--x-color-text-description:rgba(0, 0, 0, 0.45);--x-color-text-light-solid:#ffffff;--x-color-text-processing:#ffffff;--x-color-bg-container:#ffffff;--x-color-bg-elevated:#ffffff;--x-color-bg-layout:#f5f5f5;--x-color-bg-spotlight:rgba(0, 0, 0, 0.85);--x-color-bg-mask:rgba(0, 0, 0, 0.45);--x-color-bg-base:#ffffff;--x-color-bg-container-disabled:#f5f5f5;--x-color-bg-container-loading:rgba(255, 255, 255, 0.65);--x-color-white:#ffffff;--x-color-fill:rgba(0, 0, 0, 0.15);--x-color-fill-secondary:rgba(0, 0, 0, 0.06);--x-color-fill-tertiary:rgba(0, 0, 0, 0.04);--x-color-fill-quaternary:rgba(0, 0, 0, 0.02);--x-color-border:#d9d9d9;--x-color-border-secondary:#f0f0f0;--x-color-border-bg:#ffffff;--x-color-split:rgba(5, 5, 5, 0.06);--x-color-dark:#222428;--x-color-dark-rgb:34, 36, 40;--x-color-dark-contrast:#ffffff;--x-color-dark-contrast-rgb:255, 255, 255;--x-color-dark-shade:#1e2023;--x-color-dark-tint:#383a3e;--x-color-medium:#92949c;--x-color-medium-rgb:146, 148, 156;--x-color-medium-contrast:#ffffff;--x-color-medium-contrast-rgb:255, 255, 255;--x-color-medium-shade:#808289;--x-color-medium-tint:#9d9fa6;--x-color-light:#f4f5f8;--x-color-light-rgb:244, 245, 248;--x-color-light-contrast:#000000;--x-color-light-contrast-rgb:0, 0, 0;--x-color-light-shade:#d7d8da;--x-color-light-tint:#f5f6f9;--x-font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';--x-font-family-code:'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;--x-font-size:14px;--x-font-size-sm:12px;--x-font-size-lg:16px;--x-font-size-xl:20px;--x-font-size-heading-1:38px;--x-font-size-heading-2:30px;--x-font-size-heading-3:24px;--x-font-size-heading-4:20px;--x-font-size-heading-5:16px;--x-line-height:1.5714285714285714;--x-line-height-lg:1.5;--x-line-height-sm:1.6666666666666667;--x-line-height-heading-1:1.2105263157894737;--x-line-height-heading-2:1.2666666666666666;--x-line-height-heading-3:1.3333333333333333;--x-line-height-heading-4:1.4;--x-line-height-heading-5:1.5;--x-font-weight-normal:400;--x-font-weight-medium:500;--x-font-weight-semibold:600;--x-font-weight-strong:600;--x-font-size-base:14px;--x-font-size-xxl:24px;--x-line-height-base:1.5714285714285714;--x-spacing-xxs:4px;--x-spacing-xs:8px;--x-spacing-sm:12px;--x-spacing-md:16px;--x-spacing-lg:20px;--x-spacing-xl:24px;--x-spacing-xxl:32px;--x-spacing-xxxl:48px;--x-margin-xxs:4px;--x-margin-xs:8px;--x-margin-sm:12px;--x-margin-md:16px;--x-margin-lg:24px;--x-margin-xl:32px;--x-margin-xxl:48px;--x-padding-xxs:4px;--x-padding-xs:8px;--x-padding-sm:12px;--x-padding-md:16px;--x-padding-lg:24px;--x-padding-content-horizontal-lg:24px;--x-padding-content-vertical-lg:12px;--x-padding-content-horizontal:16px;--x-padding-content-vertical:12px;--x-padding-content-horizontal-sm:16px;--x-padding-content-vertical-sm:8px;--x-border-radius:6px;--x-border-radius-xs:2px;--x-border-radius-sm:4px;--x-border-radius-lg:8px;--x-border-radius-xl:12px;--x-border-radius-outer:4px;--x-border-radius-base:6px;--x-border-width:1px;--x-border-width-base:1px;--x-shadow:0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05);--x-shadow-secondary:0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05);--x-shadow-tertiary:0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px 0 rgba(0, 0, 0, 0.02);--x-shadow-lg:0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05);--x-box-shadow:0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05);--x-box-shadow-secondary:0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05);--x-box-shadow-tertiary:0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px 0 rgba(0, 0, 0, 0.02);--x-box-shadow-popover-arrow:2px 2px 5px rgba(0, 0, 0, 0.05);--x-box-shadow-card:0 1px 2px -2px rgba(0, 0, 0, 0.16), 0 3px 6px 0 rgba(0, 0, 0, 0.12), 0 5px 12px 4px rgba(0, 0, 0, 0.09);--x-box-shadow-drawer-right:-6px 0 16px 0 rgba(0, 0, 0, 0.08), -3px 0 6px -4px rgba(0, 0, 0, 0.12), -9px 0 28px 8px rgba(0, 0, 0, 0.05);--x-box-shadow-drawer-left:6px 0 16px 0 rgba(0, 0, 0, 0.08), 3px 0 6px -4px rgba(0, 0, 0, 0.12), 9px 0 28px 8px rgba(0, 0, 0, 0.05);--x-box-shadow-drawer-up:0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05);--x-box-shadow-drawer-down:0 -6px 16px 0 rgba(0, 0, 0, 0.08), 0 -3px 6px -4px rgba(0, 0, 0, 0.12), 0 -9px 28px 8px rgba(0, 0, 0, 0.05);--x-box-shadow-tabs-overflow-left:inset 10px 0 8px -8px rgba(0, 0, 0, 0.08);--x-box-shadow-tabs-overflow-right:inset -10px 0 8px -8px rgba(0, 0, 0, 0.08);--x-box-shadow-tabs-overflow-top:inset 0 10px 8px -8px rgba(0, 0, 0, 0.08);--x-box-shadow-tabs-overflow-bottom:inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08);--x-motion-duration-fast:0.1s;--x-motion-duration-mid:0.2s;--x-motion-duration-slow:0.3s;--x-motion-ease-in-out:cubic-bezier(0.645, 0.045, 0.355, 1);--x-motion-ease-out:cubic-bezier(0.215, 0.61, 0.355, 1);--x-motion-ease-in:cubic-bezier(0.55, 0.055, 0.675, 0.19);--x-motion-ease-out-back:cubic-bezier(0.12, 0.4, 0.29, 1.46);--x-motion-ease-in-back:cubic-bezier(0.71, -0.46, 0.88, 0.6);--x-motion-ease-in-out-circle:cubic-bezier(0.78, 0.14, 0.15, 0.86);--x-motion-ease-out-circle:cubic-bezier(0.08, 0.82, 0.17, 1);--x-motion-ease-in-circle:cubic-bezier(0.6, 0.04, 0.98, 0.34);--x-motion-ease-in-quint:cubic-bezier(0.755, 0.05, 0.855, 0.06);--x-motion-ease-out-quint:cubic-bezier(0.23, 1, 0.32, 1);--x-z-index-base:0;--x-z-index-popup-base:1000;--x-z-index-popup:1030;--x-z-index-affix:10;--x-z-index-modal:1000;--x-z-index-modal-mask:1000;--x-z-index-drawer:1000;--x-z-index-popover:1030;--x-z-index-dropdown:1050;--x-z-index-tooltip:1070;--x-z-index-notification:1080;--x-z-index-message:1090;--x-z-index-popconfirm:1060;--x-z-index-table-fixed:10;--x-opacity-loading:0.65;--x-opacity-image:1;--x-opacity-disabled:0.5;--x-control-height:32px;--x-control-height-xs:24px;--x-control-height-sm:24px;--x-control-height-lg:40px;--x-control-radio-size:16px;--x-control-checkbox-size:16px;--x-control-padding-horizontal:12px;--x-control-padding-horizontal-sm:8px;--x-control-outline-width:2px;--x-control-outline:rgba(5, 145, 255, 0.1);--x-control-item-bg-hover:rgba(0, 0, 0, 0.04);--x-control-item-bg-active:#e6f4ff;--x-control-item-bg-active-hover:#bae0ff;--x-control-item-bg-active-disabled:rgba(0, 0, 0, 0.15);--x-control-tmp-outline:rgba(0, 0, 0, 0.02);--x-color-yellow:#fadb14;--x-color-yellow-rgb:250, 219, 20;--x-font-family-base:var(--x-font-family);--x-color-link:#1677ff;--x-color-link-hover:#69b1ff;--x-color-link-active:#0958d9;--x-color-icon:rgba(0, 0, 0, 0.45);--x-color-icon-hover:rgba(0, 0, 0, 0.88);--x-color-highlight:#ff4d4f;--x-color-bg-text-hover:rgba(0, 0, 0, 0.06);--x-color-bg-text-active:rgba(0, 0, 0, 0.15);--x-screen-xs:480px;--x-screen-xs-min:480px;--x-screen-xs-max:575px;--x-screen-sm:576px;--x-screen-sm-min:576px;--x-screen-sm-max:767px;--x-screen-md:768px;--x-screen-md-min:768px;--x-screen-md-max:991px;--x-screen-lg:992px;--x-screen-lg-min:992px;--x-screen-lg-max:1199px;--x-screen-xl:1200px;--x-screen-xl-min:1200px;--x-screen-xl-max:1599px;--x-screen-xxl:1600px;--x-screen-xxl-min:1600px;--x-color-fill-content:rgba(0, 0, 0, 0.06);--x-color-fill-content-hover:rgba(0, 0, 0, 0.15);--x-color-fill-alter:rgba(0, 0, 0, 0.02);--x-scrollbar-width:12px;--x-scrollbar-track-bg:rgba(0, 0, 0, 0.04);--x-scrollbar-thumb-bg:rgba(0, 0, 0, 0.25);--x-scrollbar-thumb-bg-hover:rgba(0, 0, 0, 0.35);--x-menu-dark-bg:#001529;--x-menu-dark-item-bg:#001529;--x-menu-dark-popup-bg:#001529;--x-menu-dark-submenu-item-bg:#000c17}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%;width:100%;overflow:hidden;--x-code-editor-bg:#0d0e14;--x-code-editor-surface:#13141c;--x-code-editor-surface2:#1a1b26;--x-code-editor-surface3:#1e2030;--x-code-editor-border:#2a2d3e;--x-code-editor-border2:#3b3f5c;--x-code-editor-txt:#c0caf5;--x-code-editor-txt2:#a9b1d6;--x-code-editor-txt3:#565f89;--x-code-editor-accent:#7aa2f7;--x-code-editor-purple:#bb9af7;--x-code-editor-green:#9ece6a;--x-code-editor-yellow:#e0af68;--x-code-editor-red:#f7768e;--x-code-editor-cyan:#7dcfff;--x-code-editor-orange:#ff9e64;--x-code-editor-lh:22px;--x-code-editor-fs:13px;--x-code-editor-gw:52px;--x-code-editor-font:'Fira Code', 'Cascadia Code', Consolas, 'Courier New', monospace;--x-code-editor-sel:rgba(122, 162, 247, 0.18);--x-code-editor-match:rgba(224, 175, 104, 0.25);--x-code-editor-cur-line:rgba(122, 162, 247, 0.06);--x-code-editor-bracket:rgba(122, 162, 247, 0.35);font-family:var(--x-code-editor-font, var(--x-font-family-code, "Fira Code", "Cascadia Code", Consolas, "Courier New", monospace));color:var(--x-code-editor-txt);background:var(--x-code-editor-bg)}:host(.theme-light){--x-code-editor-bg:#f8f8f2;--x-code-editor-surface:#f0f0e8;--x-code-editor-surface2:#e8e8e0;--x-code-editor-surface3:#dcdcd4;--x-code-editor-border:#c8c8c0;--x-code-editor-border2:#b0b0a8;--x-code-editor-txt:#383a42;--x-code-editor-txt2:#4b4d58;--x-code-editor-txt3:#9096a2;--x-code-editor-accent:#4078f2;--x-code-editor-purple:#a626a4;--x-code-editor-green:#50a14f;--x-code-editor-yellow:#c18401;--x-code-editor-red:#e45649;--x-code-editor-cyan:#0184bc;--x-code-editor-orange:#986801;--x-code-editor-cur-line:rgba(64, 120, 242, 0.06);--x-code-editor-bracket:rgba(64, 120, 242, 0.3)}.x-code-editor-t-kw{color:var(--x-code-editor-purple)}.x-code-editor-t-fn{color:var(--x-code-editor-cyan)}.x-code-editor-t-str{color:var(--x-code-editor-green)}.x-code-editor-t-num{color:var(--x-code-editor-orange)}.x-code-editor-t-cmt{color:var(--x-code-editor-txt3);font-style:italic}.x-code-editor-t-op{color:#89ddff}.x-code-editor-t-id{color:var(--x-code-editor-txt)}.x-code-editor-t-bi{color:var(--x-code-editor-cyan)}.x-code-editor-t-prop{color:var(--x-code-editor-cyan)}.x-code-editor-t-rx{color:var(--x-code-editor-orange)}.x-code-editor-t-dec{color:var(--x-code-editor-red)}.x-code-editor-t-sel{color:var(--x-code-editor-yellow)}.x-code-editor-t-tag{color:var(--x-code-editor-red)}.x-code-editor-t-attr{color:var(--x-code-editor-yellow)}.x-code-editor-t-val{color:var(--x-code-editor-green)}.x-code-editor-folded-pill{display:inline-block;background:var(--x-code-editor-surface3);border:1px solid var(--x-code-editor-border2);border-radius:3px;padding:0 5px;font-size:11px;color:var(--x-code-editor-txt3);cursor:pointer;vertical-align:middle;margin-left:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.x-code-editor-folded-pill:hover{color:var(--x-code-editor-accent, var(--x-color-primary, #4078f2));border-color:var(--x-code-editor-accent, var(--x-color-primary, #4078f2))}.x-code-editor-titlebar{height:38px;background:var(--x-code-editor-surface);border-bottom:1px solid var(--x-code-editor-border);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:0 14px;-ms-flex-negative:0;flex-shrink:0;gap:0}.x-code-editor-circles{display:-ms-flexbox;display:flex;gap:6px}.x-code-editor-dot{width:12px;height:12px;border-radius:50%;cursor:pointer;-webkit-transition:opacity 0.15s;transition:opacity 0.15s}.x-code-editor-dot:hover{opacity:0.8}.x-code-editor-dot.x-code-editor-red{background:#ff5f57}.x-code-editor-dot.x-code-editor-yellow{background:#ffbd2e}.x-code-editor-dot.x-code-editor-green{background:#28ca41}.x-code-editor-title-name{-ms-flex:1;flex:1;text-align:center;font-size:12px;color:var(--x-code-editor-txt3);letter-spacing:0.5px}.x-code-editor-title-spacer{width:52px}.x-code-editor-tabs{height:36px;background:var(--x-code-editor-surface);border-bottom:1px solid var(--x-code-editor-border);display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;padding:0 8px;gap:2px;-ms-flex-negative:0;flex-shrink:0}.x-code-editor-tab{padding:0 14px;height:32px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:6px;font-size:12px;color:var(--x-code-editor-txt3);cursor:pointer;border-radius:6px 6px 0 0;border:1px solid transparent;border-bottom:none;-webkit-transition:all 0.12s;transition:all 0.12s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap}.x-code-editor-tab:hover{color:var(--x-code-editor-txt2);background:var(--x-code-editor-surface2)}.x-code-editor-tab.x-code-editor-active{color:var(--x-code-editor-txt);background:var(--x-code-editor-surface2);border-color:var(--x-code-editor-border)}.x-code-editor-tab-dot{width:6px;height:6px;border-radius:50%;background:currentColor;opacity:0.6}.x-code-editor-tab-js .x-code-editor-tab-dot{background:#f7c948}.x-code-editor-tab-css .x-code-editor-tab-dot{background:#61afef}.x-code-editor-tab-html .x-code-editor-tab-dot{background:#e06c75}.x-code-editor-tab-json .x-code-editor-tab-dot{background:#56b6c2}.x-code-editor-toolbar{height:32px;background:var(--x-code-editor-surface2);border-bottom:1px solid var(--x-code-editor-border);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:0 8px;gap:3px;-ms-flex-negative:0;flex-shrink:0}.x-code-editor-tbtn{height:22px;padding:0 8px;font-size:11px;color:var(--x-code-editor-txt3);background:transparent;border:1px solid transparent;border-radius:4px;cursor:pointer;font-family:var(--x-code-editor-font, var(--x-font-family-code, "Fira Code", "Cascadia Code", Consolas, "Courier New", monospace));white-space:nowrap;-webkit-transition:all 0.12s;transition:all 0.12s}.x-code-editor-tbtn:hover{color:var(--x-code-editor-txt2);border-color:var(--x-code-editor-border2);background:var(--x-code-editor-surface3)}.x-code-editor-tbtn.x-code-editor-active{color:var(--x-code-editor-accent, var(--x-color-primary, #4078f2));border-color:var(--x-code-editor-accent, var(--x-color-primary, #4078f2))}.x-code-editor-tsep{width:1px;height:16px;background:var(--x-code-editor-border);margin:0 3px;-ms-flex-negative:0;flex-shrink:0}.x-code-editor-toolbar-lang{margin-left:auto;font-size:11px;color:var(--x-code-editor-txt3);padding:2px 8px;border:1px solid var(--x-code-editor-border);border-radius:4px}.x-code-editor-search-bar{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:5px;padding:5px 10px;background:var(--x-code-editor-surface2);border-bottom:1px solid var(--x-code-editor-border);-ms-flex-negative:0;flex-shrink:0}.x-code-editor-search-input{background:var(--x-code-editor-surface3);border:1px solid var(--x-code-editor-border2);color:var(--x-code-editor-txt);padding:3px 8px;font-size:12px;border-radius:4px;outline:none;font-family:var(--x-code-editor-font, var(--x-font-family-code, "Fira Code", "Cascadia Code", Consolas, "Courier New", monospace));width:200px;-webkit-transition:border-color 0.15s;transition:border-color 0.15s}.x-code-editor-search-input:focus{border-color:var(--x-code-editor-accent, var(--x-color-primary, #4078f2))}.x-code-editor-sbar-btn{height:22px;padding:0 8px;font-size:11px;color:var(--x-code-editor-txt3);background:var(--x-code-editor-surface3);border:1px solid var(--x-code-editor-border);border-radius:4px;cursor:pointer;font-family:var(--x-code-editor-font, var(--x-font-family-code, "Fira Code", "Cascadia Code", Consolas, "Courier New", monospace));-webkit-transition:all 0.12s;transition:all 0.12s}.x-code-editor-sbar-btn:hover{color:var(--x-code-editor-txt);border-color:var(--x-code-editor-border2)}.x-code-editor-match-count{font-size:11px;color:var(--x-code-editor-txt3);min-width:70px}.x-code-editor-sbar-close{margin-left:auto;font-size:16px;color:var(--x-code-editor-txt3);cursor:pointer;width:22px;height:22px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-radius:4px;background:transparent;border:none;font-family:sans-serif}.x-code-editor-sbar-close:hover{color:var(--x-code-editor-txt);background:var(--x-code-editor-surface3)}.x-code-editor-main-area{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;overflow:hidden;position:relative}.x-code-editor-editor-wrap{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;overflow:hidden}.x-code-editor-gutter{width:var(--x-code-editor-gw, 52px);background:var(--x-code-editor-surface);border-right:1px solid var(--x-code-editor-border);-ms-flex-negative:0;flex-shrink:0;overflow:hidden;position:relative}.x-code-editor-gutter-canvas{display:block;position:absolute;top:0;left:0;width:100%;cursor:pointer}.x-code-editor-code-container{-ms-flex:1;flex:1;position:relative;overflow:auto;background:var(--x-code-editor-bg)}.x-code-editor-cur-line-hl{position:absolute;left:0;right:0;height:var(--x-code-editor-lh, 22px);background:var(--x-code-editor-cur-line);pointer-events:none;z-index:1}.x-code-editor-bracket-hl{position:absolute;width:9px;height:var(--x-code-editor-lh, 22px);background:var(--x-code-editor-bracket);border-radius:2px;pointer-events:none;z-index:3}.x-code-editor-search-hl{position:absolute;height:var(--x-code-editor-lh, 22px);background:var(--x-code-editor-match);border-radius:2px;pointer-events:none;z-index:4}.x-code-editor-word-hl{position:absolute;height:var(--x-code-editor-lh, 22px);background:rgba(122, 162, 247, 0.2);border:1px solid rgba(122, 162, 247, 0.3);border-radius:2px;pointer-events:none;z-index:3;-webkit-box-sizing:border-box;box-sizing:border-box}.x-code-editor-search-cur{background:rgba(122, 162, 247, 0.4)}.x-code-editor-extra-cursor{position:absolute;width:2px;background:var(--x-code-editor-orange);z-index:11;pointer-events:none;-webkit-animation:blink 1.1s step-end infinite;animation:blink 1.1s step-end infinite;height:var(--x-code-editor-lh, 22px)}@-webkit-keyframes blink{0%,100%{opacity:1}50%{opacity:0}}@keyframes blink{0%,100%{opacity:1}50%{opacity:0}}.x-code-editor-highlight-layer{position:absolute;top:0;left:0;right:0;pointer-events:auto;padding:8px 0 8px 12px;font-size:var(--x-code-editor-fs, var(--x-font-size-sm, 13px));line-height:var(--x-code-editor-lh, 22px);font-family:var(--x-code-editor-font, var(--x-font-family-code, "Fira Code", "Cascadia Code", Consolas, "Courier New", monospace));white-space:pre;color:var(--x-code-editor-txt);z-index:5;-o-tab-size:2;tab-size:2;-moz-tab-size:2}.x-code-editor-code-input{position:absolute;top:0;left:0;width:100%;padding:8px 0 8px 12px;font-size:var(--x-code-editor-fs, var(--x-font-size-sm, 13px));line-height:var(--x-code-editor-lh, 22px);font-family:var(--x-code-editor-font, var(--x-font-family-code, "Fira Code", "Cascadia Code", Consolas, "Courier New", monospace));background:transparent;color:transparent;caret-color:var(--x-code-editor-accent, var(--x-color-primary, #4078f2));border:none;outline:none;resize:none;white-space:pre;overflow:hidden;z-index:10;-o-tab-size:2;tab-size:2;-moz-tab-size:2;-webkit-text-fill-color:transparent}.x-code-editor-code-input::-moz-selection{background:var(--x-code-editor-sel)}.x-code-editor-code-input::selection{background:var(--x-code-editor-sel)}.x-code-editor-side-panel{width:280px;background:var(--x-code-editor-surface);border-left:1px solid var(--x-code-editor-border);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-negative:0;flex-shrink:0;overflow:hidden}.x-code-editor-panel-header{padding:9px 12px;font-size:12px;color:var(--x-code-editor-txt2);border-bottom:1px solid var(--x-code-editor-border);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-negative:0;flex-shrink:0}.x-code-editor-panel-close{font-size:16px;color:var(--x-code-editor-txt3);cursor:pointer;background:transparent;border:none;font-family:sans-serif;line-height:1;padding:0 2px}.x-code-editor-panel-close:hover{color:var(--x-code-editor-txt)}.x-code-editor-panel-body{-ms-flex:1;flex:1;overflow-y:auto;padding:8px}.x-code-editor-panel-hint{font-size:11px;color:var(--x-code-editor-txt3);padding:8px;font-style:italic}.x-code-editor-ast-tree{font-size:11px;font-family:var(--x-code-editor-font, var(--x-font-family-code, "Fira Code", "Cascadia Code", Consolas, "Courier New", monospace));line-height:1.6}.x-code-editor-ast-node{margin-left:10px}.x-code-editor-ast-toggle{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:var(--x-code-editor-txt3);padding:1px 3px;border-radius:3px;display:inline-block}.x-code-editor-ast-toggle:hover{color:var(--x-code-editor-accent, var(--x-color-primary, #4078f2));background:var(--x-code-editor-surface3)}.x-code-editor-ast-children{margin-left:12px}.x-code-editor-ast-row{padding:1px 0}.x-code-editor-ast-type{color:var(--x-code-editor-cyan)}.x-code-editor-ast-val{color:var(--x-code-editor-green)}.x-code-editor-ast-key{color:var(--x-code-editor-purple)}.x-code-editor-plugin-card{background:var(--x-code-editor-surface2);border:1px solid var(--x-code-editor-border);border-radius:6px;padding:10px 12px;margin-bottom:8px}.x-code-editor-plugin-card-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;margin-bottom:5px}.x-code-editor-plugin-name{font-size:12px;color:var(--x-code-editor-txt);font-weight:500}.x-code-editor-plugin-desc{font-size:11px;color:var(--x-code-editor-txt3)}.x-code-editor-toggle{width:30px;height:16px;background:var(--x-code-editor-surface3);border-radius:8px;cursor:pointer;position:relative;border:1px solid var(--x-code-editor-border2);-webkit-transition:background 0.2s;transition:background 0.2s;-ms-flex-negative:0;flex-shrink:0}.x-code-editor-toggle.x-code-editor-on{background:var(--x-code-editor-accent, var(--x-color-primary, #4078f2));border-color:var(--x-code-editor-accent, var(--x-color-primary, #4078f2))}.x-code-editor-toggle::after{content:"";position:absolute;top:2px;left:2px;width:10px;height:10px;border-radius:50%;background:#fff;-webkit-transition:left 0.2s;transition:left 0.2s}.x-code-editor-toggle.x-code-editor-on::after{left:16px}.x-code-editor-autocomplete{position:absolute;background:var(--x-code-editor-surface2);border:1px solid var(--x-code-editor-border2);border-radius:6px;-webkit-box-shadow:0 8px 32px rgba(0, 0, 0, 0.6);box-shadow:0 8px 32px rgba(0, 0, 0, 0.6);z-index:200;min-width:220px;max-width:340px;max-height:230px;overflow-y:auto;font-size:12px}.x-code-editor-autocomplete::-webkit-scrollbar{width:4px}.x-code-editor-autocomplete::-webkit-scrollbar-track{background:var(--x-code-editor-surface3)}.x-code-editor-autocomplete::-webkit-scrollbar-thumb{background:var(--x-code-editor-border2);border-radius:2px}.x-code-editor-ac-item{padding:5px 10px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:7px;cursor:pointer;-webkit-transition:background 0.08s;transition:background 0.08s}.x-code-editor-ac-item:hover,.x-code-editor-ac-item.x-code-editor-selected{background:var(--x-code-editor-surface3)}.x-code-editor-ac-icon{width:16px;height:16px;border-radius:3px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;font-size:9px;font-weight:700;-ms-flex-negative:0;flex-shrink:0}.x-code-editor-ac-kw{background:rgba(187, 154, 247, 0.2);color:var(--x-code-editor-purple)}.x-code-editor-ac-fn{background:rgba(125, 207, 255, 0.2);color:var(--x-code-editor-cyan)}.x-code-editor-ac-var{background:rgba(158, 206, 106, 0.2);color:var(--x-code-editor-green)}.x-code-editor-ac-prop{background:rgba(122, 162, 247, 0.2);color:var(--x-code-editor-accent, var(--x-color-primary, #4078f2))}.x-code-editor-ac-snip{background:rgba(255, 158, 100, 0.2);color:var(--x-code-editor-orange)}.x-code-editor-ac-tag{background:rgba(247, 118, 142, 0.2);color:var(--x-code-editor-red)}.x-code-editor-ac-attr{background:rgba(224, 175, 104, 0.2);color:var(--x-code-editor-yellow)}.x-code-editor-ac-label{-ms-flex:1;flex:1;color:var(--x-code-editor-txt);font-family:var(--x-code-editor-font, var(--x-font-family-code, "Fira Code", "Cascadia Code", Consolas, "Courier New", monospace))}.x-code-editor-ac-label b{color:var(--x-code-editor-accent, var(--x-color-primary, #4078f2))}.x-code-editor-ac-detail{font-size:10px;color:var(--x-code-editor-txt3);white-space:nowrap}.x-code-editor-statusbar{height:24px;background:var(--x-code-editor-surface);border-top:1px solid var(--x-code-editor-border);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:0 10px;gap:12px;font-size:11px;color:var(--x-code-editor-txt3);-ms-flex-negative:0;flex-shrink:0}.x-code-editor-sb-cursor{color:var(--x-code-editor-accent, var(--x-color-primary, #4078f2))}.x-code-editor-sb-sel{color:var(--x-code-editor-yellow)}.x-code-editor-sb-multicursor{color:var(--x-code-editor-orange)}.x-code-editor-sb-spacer{-ms-flex:1;flex:1}.x-code-editor-sb-utf,.x-code-editor-sb-lf{color:var(--x-code-editor-green)}.x-code-editor-sb-lang{color:var(--x-code-editor-txt2)}.x-code-editor-sb-chars{color:var(--x-code-editor-txt3)}.x-code-editor-sb-clear-cursors{font-size:10px;color:var(--x-code-editor-txt3);background:transparent;border:1px solid var(--x-code-editor-border);border-radius:3px;padding:0 5px;cursor:pointer;font-family:var(--x-code-editor-font, var(--x-font-family-code, "Fira Code", "Cascadia Code", Consolas, "Courier New", monospace));-webkit-transition:all 0.1s;transition:all 0.1s}.x-code-editor-sb-clear-cursors:hover{color:var(--x-code-editor-txt);border-color:var(--x-code-editor-border2)}.x-code-editor-code-container::-webkit-scrollbar{width:8px;height:8px}.x-code-editor-code-container::-webkit-scrollbar-track{background:var(--x-code-editor-surface2)}.x-code-editor-code-container::-webkit-scrollbar-thumb{background:var(--x-code-editor-border2);border-radius:4px}.x-code-editor-code-container::-webkit-scrollbar-thumb:hover{background:var(--x-code-editor-txt3)}.x-code-editor-panel-body::-webkit-scrollbar{width:4px}.x-code-editor-panel-body::-webkit-scrollbar-track{background:transparent}.x-code-editor-panel-body::-webkit-scrollbar-thumb{background:var(--x-code-editor-border2);border-radius:2px}.t-kw{color:var(--x-code-editor-purple)}.t-str{color:var(--x-code-editor-green)}.t-num{color:var(--x-code-editor-orange)}.t-fn{color:var(--x-code-editor-cyan)}.t-bi{color:var(--x-code-editor-yellow)}.t-op{color:var(--x-code-editor-accent, var(--x-color-primary, #4078f2))}.t-id{color:var(--x-code-editor-txt)}.t-cmt{color:var(--x-code-editor-txt3);font-style:italic}.t-prop{color:var(--x-code-editor-accent, var(--x-color-primary, #4078f2))}.t-var{color:var(--x-code-editor-red)}.t-tag{color:var(--x-code-editor-red)}.t-attr{color:var(--x-code-editor-yellow)}.t-sel{color:var(--x-code-editor-yellow)}.t-dec{color:var(--x-code-editor-purple)}`;
1387
+
1388
+ const LANG_NAMES = {
1389
+ js: 'JavaScript',
1390
+ css: 'CSS',
1391
+ html: 'HTML',
1392
+ json: 'JSON',
1393
+ };
1394
+ const PAIRS = {
1395
+ '(': ')',
1396
+ '[': ']',
1397
+ '{': '}',
1398
+ '"': '"',
1399
+ "'": "'",
1400
+ '`': '`',
1401
+ };
1402
+ const LH = 22; // line height px
1403
+ const CW = 7.8; // approx char width at 13px monospace
1404
+ const PAD = 12; // padding-left for code area
1405
+ function clamp(n, lo, hi) {
1406
+ return Math.max(lo, Math.min(hi, n));
1407
+ }
1408
+ function escH(s) {
1409
+ return String(s).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
1410
+ }
1411
+ const XCodeEditor = class {
1412
+ constructor(hostRef) {
1413
+ index.registerInstance(this, hostRef);
1414
+ this.codeChange = index.createEvent(this, "codeChange", 7);
1415
+ this.cursorMove = index.createEvent(this, "cursorMove", 7);
1416
+ this.langChange = index.createEvent(this, "langChange", 7);
1417
+ }
1418
+ // ==================== Props ====================
1419
+ /**
1420
+ * The value of the code editor.
1421
+ */
1422
+ value = '';
1423
+ /**
1424
+ * The programming language for syntax highlighting.
1425
+ */
1426
+ language = 'js';
1427
+ /**
1428
+ * Whether the editor is read-only.
1429
+ */
1430
+ readonly = false;
1431
+ /**
1432
+ * The tab size used for indentation.
1433
+ */
1434
+ tabSize = 2;
1435
+ /**
1436
+ * Editor theme ('dark' or 'light').
1437
+ */
1438
+ theme = 'dark';
1439
+ /**
1440
+ * Whether to show the minimap (not implemented yet).
1441
+ */
1442
+ showMinimap = false;
1443
+ /**
1444
+ * Custom class names for editor components.
1445
+ */
1446
+ classNames;
1447
+ /**
1448
+ * Custom styles for editor components.
1449
+ */
1450
+ styles;
1451
+ // ==================== Events ====================
1452
+ codeChange;
1453
+ cursorMove;
1454
+ langChange;
1455
+ // ==================== Internal State ====================
1456
+ _value = '';
1457
+ _lang = 'js';
1458
+ _cursorLine = 0;
1459
+ _cursorCol = 0;
1460
+ _selLen = 0;
1461
+ _extraCursors = [];
1462
+ _folds = new Set();
1463
+ _matches = [];
1464
+ _matchIdx = 0;
1465
+ _searchQuery = '';
1466
+ _replaceQuery = '';
1467
+ _showSearch = false;
1468
+ _showReplace = false;
1469
+ _panel = null;
1470
+ _astRoot = null;
1471
+ _pluginList = [];
1472
+ _acItems = [];
1473
+ _acIndex = 0;
1474
+ _acOpen = false;
1475
+ _acX = 0;
1476
+ _acY = 0;
1477
+ _highlighted = '';
1478
+ _displayLines = [];
1479
+ get hostEl() { return index.getElement(this); }
1480
+ ta;
1481
+ codeContainer;
1482
+ gutterCanvas;
1483
+ acContainer;
1484
+ // ==================== Internal Singletons ====================
1485
+ history = new EditHistory(200);
1486
+ plugins = new PluginSystem();
1487
+ // ==================== Lifecycle ====================
1488
+ componentWillLoad() {
1489
+ this._value = this.value || '';
1490
+ this._lang = this.language;
1491
+ this._setupPlugins();
1492
+ this._reHighlight();
1493
+ this.history.pushNow({ value: this._value, selStart: 0, selEnd: 0 });
1494
+ }
1495
+ componentDidLoad() {
1496
+ this._bindScrollSync();
1497
+ this._drawGutter();
1498
+ this._resizeTA();
1499
+ }
1500
+ componentDidUpdate() {
1501
+ this._drawGutter();
1502
+ this._resizeTA();
1503
+ }
1504
+ // ==================== Watchers ====================
1505
+ onValueProp(v) {
1506
+ if (v !== this._value) {
1507
+ this._value = v;
1508
+ this._reHighlight();
1509
+ }
1510
+ }
1511
+ onLangProp(l) {
1512
+ this._lang = l;
1513
+ this._folds.clear();
1514
+ this._reHighlight();
1515
+ }
1516
+ // ==================== Methods ====================
1517
+ async getValue() {
1518
+ return this._value;
1519
+ }
1520
+ async setValue(v) {
1521
+ this._applyValue(v, 0, 0, true);
1522
+ }
1523
+ async setLanguage(l) {
1524
+ this._lang = l;
1525
+ this._reHighlight();
1526
+ }
1527
+ async undo() {
1528
+ this._undo();
1529
+ }
1530
+ async redo() {
1531
+ this._redo();
1532
+ }
1533
+ async format() {
1534
+ this._formatDoc();
1535
+ }
1536
+ async foldAll() {
1537
+ this._foldAll();
1538
+ }
1539
+ async unfoldAll() {
1540
+ this._unfoldAll();
1541
+ }
1542
+ async openSearch() {
1543
+ this._showSearch = true;
1544
+ }
1545
+ async getAST() {
1546
+ if (this._lang !== 'js')
1547
+ return null;
1548
+ return parseAST(this._value);
1549
+ }
1550
+ async registerPlugin(def) {
1551
+ this.plugins.register(def);
1552
+ this._pluginList = this.plugins.list();
1553
+ }
1554
+ // ==================== Private Methods ====================
1555
+ _setupPlugins() {
1556
+ this.plugins
1557
+ .register({ id: 'bracket-match', name: 'Bracket Matching', description: 'Highlights matching brackets under cursor', enabled: true })
1558
+ .register({ id: 'auto-close', name: 'Auto Close', description: 'Auto-closes brackets and quotes', enabled: true })
1559
+ .register({ id: 'auto-indent', name: 'Auto Indent', description: 'Smart indentation on Enter', enabled: true })
1560
+ .register({ id: 'line-highlight', name: 'Line Highlight', description: 'Highlight current line', enabled: true })
1561
+ .register({ id: 'fold', name: 'Code Folding', description: 'Collapse/expand code blocks', enabled: true })
1562
+ .register({ id: 'autocomplete', name: 'Autocomplete', description: 'IntelliSense-style completion', enabled: true })
1563
+ .register({ id: 'multi-cursor', name: 'Multi Cursor', description: 'Alt+Click to add cursors', enabled: true });
1564
+ this._pluginList = this.plugins.list();
1565
+ }
1566
+ _bindScrollSync() {
1567
+ this.codeContainer?.addEventListener('scroll', () => {
1568
+ if (this.gutterCanvas) {
1569
+ this.gutterCanvas.style.transform = `translateY(-${this.codeContainer.scrollTop}px)`;
1570
+ }
1571
+ });
1572
+ }
1573
+ _applyValue(v, selStart, selEnd, pushHistory = true) {
1574
+ this._value = v;
1575
+ if (this.ta) {
1576
+ this.ta.value = v;
1577
+ this.ta.setSelectionRange(selStart, selEnd);
1578
+ }
1579
+ if (pushHistory)
1580
+ this.history.push({ value: v, selStart, selEnd });
1581
+ this._reHighlight();
1582
+ this.codeChange.emit({ value: v });
1583
+ }
1584
+ _reHighlight() {
1585
+ // Build display lines (accounting for folds)
1586
+ const lines = this._value.split('\n');
1587
+ const displayLines = [];
1588
+ let i = 0;
1589
+ while (i < lines.length) {
1590
+ if (this._folds.has(i) && this.plugins.isEnabled('fold')) {
1591
+ const end = this._foldEnd(lines, i);
1592
+ displayLines.push({ real: i, folded: true, count: end - i, text: lines[i] });
1593
+ i = end + 1;
1594
+ }
1595
+ else {
1596
+ displayLines.push({ real: i, folded: false, text: lines[i] });
1597
+ i++;
1598
+ }
1599
+ }
1600
+ this._displayLines = displayLines;
1601
+ // Tokenize entire source, then pick lines
1602
+ const tokenized = tokenize$1(this._value, this._lang).split('\n');
1603
+ let hlHtml = '';
1604
+ for (const dl of displayLines) {
1605
+ if (dl.folded) {
1606
+ hlHtml += (tokenized[dl.real] || '') + `<span class="x-code-editor-folded-pill" data-line="${dl.real}"> ··· ${dl.count} lines </span>\n`;
1607
+ }
1608
+ else {
1609
+ hlHtml += (tokenized[dl.real] || '') + '\n';
1610
+ }
1611
+ }
1612
+ this._highlighted = hlHtml;
1613
+ // AST (debounced if panel open)
1614
+ if (this._panel === 'ast')
1615
+ this._refreshAST();
1616
+ // Search re-run
1617
+ if (this._searchQuery)
1618
+ this._runSearch();
1619
+ }
1620
+ _drawGutter() {
1621
+ const canvas = this.gutterCanvas;
1622
+ if (!canvas)
1623
+ return;
1624
+ const totalLines = this._displayLines.length;
1625
+ const w = canvas.offsetWidth || 52;
1626
+ const h = Math.max(totalLines * LH + 32, this.codeContainer?.clientHeight || 400);
1627
+ canvas.width = w * (devicePixelRatio || 1);
1628
+ canvas.height = h * (devicePixelRatio || 1);
1629
+ canvas.style.width = w + 'px';
1630
+ canvas.style.height = h + 'px';
1631
+ const ctx = canvas.getContext('2d');
1632
+ if (!ctx)
1633
+ return;
1634
+ ctx.scale(devicePixelRatio || 1, devicePixelRatio || 1);
1635
+ ctx.clearRect(0, 0, w, h);
1636
+ ctx.font = `12px Fira Code, Consolas, monospace`;
1637
+ ctx.textAlign = 'right';
1638
+ this._displayLines.forEach((dl, i) => {
1639
+ const y = i * LH + 8;
1640
+ const isCur = dl.real === this._cursorLine;
1641
+ if (isCur && this.plugins.isEnabled('line-highlight')) {
1642
+ ctx.fillStyle = 'rgba(122,162,247,0.1)';
1643
+ ctx.fillRect(0, y - 2, w, LH);
1644
+ }
1645
+ ctx.fillStyle = isCur ? '#c0caf5' : '#3b3f5c';
1646
+ ctx.fillText(String(dl.real + 1), w - 8, y + LH * 0.72);
1647
+ // fold triangle
1648
+ if (this.plugins.isEnabled('fold') && (dl.folded || this._canFold(dl.real))) {
1649
+ ctx.fillStyle = '#3b3f5c';
1650
+ ctx.font = `8px monospace`;
1651
+ ctx.fillText(dl.folded ? '▶' : '▼', w - 5, y + LH * 0.7);
1652
+ ctx.font = `12px Fira Code, Consolas, monospace`;
1653
+ }
1654
+ });
1655
+ }
1656
+ _resizeTA() {
1657
+ if (!this.ta || !this.codeContainer)
1658
+ return;
1659
+ const lines = this._displayLines.length;
1660
+ const h = Math.max(lines * LH + 32, this.codeContainer.clientHeight);
1661
+ this.ta.style.minHeight = h + 'px';
1662
+ }
1663
+ _cursorInfo() {
1664
+ if (!this.ta)
1665
+ return { line: 0, col: 0, pos: 0 };
1666
+ const pos = this.ta.selectionStart;
1667
+ const before = this._value.slice(0, pos);
1668
+ const lines = before.split('\n');
1669
+ return { line: lines.length - 1, col: lines[lines.length - 1].length, pos };
1670
+ }
1671
+ _onCursorChange() {
1672
+ const { line, col} = this._cursorInfo();
1673
+ this._cursorLine = line;
1674
+ this._cursorCol = col;
1675
+ this._selLen = Math.abs(this.ta.selectionEnd - this.ta.selectionStart);
1676
+ this.cursorMove.emit({ line, col });
1677
+ this._drawGutter();
1678
+ if (this.plugins.isEnabled('autocomplete'))
1679
+ this._tryShowAC();
1680
+ // Word Highlights
1681
+ this._wordHls = this._wordHighlights();
1682
+ // Force re-render of highlight layers
1683
+ this._reHighlight();
1684
+ }
1685
+ _wordHls = [];
1686
+ _validateWord(str) {
1687
+ return /^[A-Za-z0-9_$]+$/.test(str);
1688
+ }
1689
+ _wordHighlights() {
1690
+ if (!this.ta)
1691
+ return [];
1692
+ const s = this.ta.selectionStart, e = this.ta.selectionEnd;
1693
+ if (s === e) {
1694
+ // Find word around cursor if empty selection
1695
+ return []; // or complex logic to extract word boundaries at cursor
1696
+ }
1697
+ const word = this._value.slice(s, e);
1698
+ if (!this._validateWord(word) || word.length > 50)
1699
+ return [];
1700
+ const escaped = word.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
1701
+ const re = new RegExp(`\\b${escaped}\\b`, 'g');
1702
+ const hls = [];
1703
+ let m;
1704
+ while ((m = re.exec(this._value)) !== null) {
1705
+ if (m.index !== s) {
1706
+ const before = this._value.slice(0, m.index);
1707
+ const lines = before.split('\n');
1708
+ const rawLine = lines.length - 1;
1709
+ const col = lines[rawLine].length;
1710
+ const dispIdx = this._displayLines.findIndex(dl => dl.real === rawLine);
1711
+ const row = dispIdx >= 0 ? dispIdx : rawLine;
1712
+ hls.push({
1713
+ top: row * LH + 8,
1714
+ left: col * CW + PAD,
1715
+ width: word.length * CW,
1716
+ });
1717
+ }
1718
+ }
1719
+ return hls;
1720
+ }
1721
+ _bracketHighlights() {
1722
+ if (!this.plugins.isEnabled('bracket-match') || !this.ta)
1723
+ return [];
1724
+ const pos = this.ta.selectionStart;
1725
+ const text = this._value;
1726
+ let searchPos = text[pos] && '{}[]()'.includes(text[pos]) ? pos : text[pos - 1] && '{}[]()'.includes(text[pos - 1]) ? pos - 1 : -1;
1727
+ if (searchPos < 0)
1728
+ return [];
1729
+ const ch = text[searchPos];
1730
+ const forward = '({['.includes(ch);
1731
+ const match = this._findMatchBracket(text, searchPos, forward);
1732
+ if (match < 0)
1733
+ return [];
1734
+ return [searchPos, match].map(p => {
1735
+ const before = text.slice(0, p);
1736
+ const lines = before.split('\n');
1737
+ const dispLine = this._displayLines.findIndex(dl => dl.real === lines.length - 1);
1738
+ const row = dispLine >= 0 ? dispLine : lines.length - 1;
1739
+ const col = lines[lines.length - 1].length;
1740
+ return { top: row * LH + 8, left: col * CW + PAD };
1741
+ });
1742
+ }
1743
+ _findMatchBracket(text, pos, forward) {
1744
+ const opens = '({[', closes = ')}]';
1745
+ let depth = 0;
1746
+ const dir = forward ? 1 : -1;
1747
+ for (let i = pos; i >= 0 && i < text.length; i += dir) {
1748
+ if (opens.includes(text[i]))
1749
+ depth += forward ? 1 : -1;
1750
+ if (closes.includes(text[i]))
1751
+ depth += forward ? -1 : 1;
1752
+ if (depth === 0 && i !== pos)
1753
+ return i;
1754
+ }
1755
+ return -1;
1756
+ }
1757
+ _canFold(lineIdx) {
1758
+ const lines = this._value.split('\n');
1759
+ const line = lines[lineIdx] ?? '';
1760
+ return /[{(\[]$/.test(line.trimEnd()) || /^(function|class|if|for|while)\b/.test(line.trim());
1761
+ }
1762
+ _foldEnd(lines, start) {
1763
+ let depth = 0;
1764
+ for (let i = start; i < lines.length; i++) {
1765
+ for (const ch of lines[i]) {
1766
+ if ('({['.includes(ch))
1767
+ depth++;
1768
+ if (')}]'.includes(ch))
1769
+ depth--;
1770
+ if (depth <= 0 && i > start)
1771
+ return i;
1772
+ }
1773
+ }
1774
+ return Math.min(start + 1, lines.length - 1);
1775
+ }
1776
+ _toggleFold(lineIdx) {
1777
+ const f = new Set(this._folds);
1778
+ if (f.has(lineIdx))
1779
+ f.delete(lineIdx);
1780
+ else if (this._canFold(lineIdx))
1781
+ f.add(lineIdx);
1782
+ this._folds = f;
1783
+ this._reHighlight();
1784
+ }
1785
+ _foldAll() {
1786
+ const f = new Set();
1787
+ this._value.split('\n').forEach((_, i) => {
1788
+ if (this._canFold(i))
1789
+ f.add(i);
1790
+ });
1791
+ this._folds = f;
1792
+ this._reHighlight();
1793
+ }
1794
+ _unfoldAll() {
1795
+ this._folds = new Set();
1796
+ this._reHighlight();
1797
+ }
1798
+ _onInput() {
1799
+ if (!this.ta)
1800
+ return;
1801
+ const pos = this.ta.selectionStart;
1802
+ const char = this.ta.value[pos - 1];
1803
+ // Auto-outdent on typing closing brackets
1804
+ if (this.plugins.isEnabled('auto-indent') && (char === '}' || char === ']' || char === ')')) {
1805
+ const before = this.ta.value.slice(0, pos - 1);
1806
+ const lineStart = before.lastIndexOf('\n') + 1;
1807
+ const linePrefix = before.slice(lineStart);
1808
+ const tab = ' '.repeat(this.tabSize);
1809
+ // Only unindent if line is purely whitespace and ends with our tab size
1810
+ if (/^\s*$/.test(linePrefix) && linePrefix.endsWith(tab)) {
1811
+ const newPrefix = linePrefix.slice(0, -tab.length);
1812
+ const v = this.ta.value.slice(0, lineStart) + newPrefix + char + this.ta.value.slice(pos);
1813
+ this._applyValue(v, lineStart + newPrefix.length + 1, lineStart + newPrefix.length + 1, false);
1814
+ return;
1815
+ }
1816
+ }
1817
+ const v = this.ta.value;
1818
+ this._applyValue(v, this.ta.selectionStart, this.ta.selectionEnd, true);
1819
+ }
1820
+ _onKeydown(e) {
1821
+ const ta = this.ta;
1822
+ const ctrl = e.ctrlKey || e.metaKey;
1823
+ // Undo / Redo
1824
+ if (ctrl && e.key === 'z' && !e.shiftKey) {
1825
+ e.preventDefault();
1826
+ this._undo();
1827
+ return;
1828
+ }
1829
+ if (ctrl && (e.key === 'y' || (e.key === 'z' && e.shiftKey))) {
1830
+ e.preventDefault();
1831
+ this._redo();
1832
+ return;
1833
+ }
1834
+ // Search
1835
+ if (ctrl && e.key === 'f') {
1836
+ e.preventDefault();
1837
+ this._showSearch = true;
1838
+ return;
1839
+ }
1840
+ if (ctrl && e.key === 'h') {
1841
+ e.preventDefault();
1842
+ this._showSearch = true;
1843
+ this._showReplace = true;
1844
+ return;
1845
+ }
1846
+ // Format
1847
+ if (e.shiftKey && e.altKey && e.key === 'F') {
1848
+ e.preventDefault();
1849
+ this._formatDoc();
1850
+ return;
1851
+ }
1852
+ // Select all occurrences
1853
+ if (ctrl && e.shiftKey && e.key === 'L') {
1854
+ e.preventDefault();
1855
+ this._selectAllOccurrences();
1856
+ return;
1857
+ }
1858
+ // Autocomplete navigation
1859
+ if (this._acOpen) {
1860
+ if (e.key === 'ArrowDown') {
1861
+ e.preventDefault();
1862
+ this._acMove(1);
1863
+ return;
1864
+ }
1865
+ if (e.key === 'ArrowUp') {
1866
+ e.preventDefault();
1867
+ this._acMove(-1);
1868
+ return;
1869
+ }
1870
+ if (e.key === 'Enter' || e.key === 'Tab') {
1871
+ e.preventDefault();
1872
+ this._acAccept();
1873
+ return;
1874
+ }
1875
+ if (e.key === 'Escape') {
1876
+ this._acOpen = false;
1877
+ return;
1878
+ }
1879
+ }
1880
+ // Tab
1881
+ if (e.key === 'Tab') {
1882
+ e.preventDefault();
1883
+ e.shiftKey ? this._unindent() : this._insertTab();
1884
+ return;
1885
+ }
1886
+ // Enter — smart indent
1887
+ if (e.key === 'Enter' && this.plugins.isEnabled('auto-indent')) {
1888
+ e.preventDefault();
1889
+ this._smartEnter();
1890
+ return;
1891
+ }
1892
+ // Auto-close
1893
+ if (this.plugins.isEnabled('auto-close')) {
1894
+ if (PAIRS[e.key]) {
1895
+ const start = ta.selectionStart, end = ta.selectionEnd;
1896
+ if (start !== end) {
1897
+ e.preventDefault();
1898
+ this._wrapSel(e.key, PAIRS[e.key]);
1899
+ return;
1900
+ }
1901
+ if (e.key === PAIRS[e.key] && ta.value[start] === e.key) {
1902
+ e.preventDefault();
1903
+ ta.setSelectionRange(start + 1, start + 1);
1904
+ return;
1905
+ }
1906
+ e.preventDefault();
1907
+ this._insertPair(e.key, PAIRS[e.key]);
1908
+ return;
1909
+ }
1910
+ if (e.key === 'Backspace' && ta.selectionStart === ta.selectionEnd) {
1911
+ const pos = ta.selectionStart;
1912
+ const prev = ta.value[pos - 1], next = ta.value[pos];
1913
+ if (prev && PAIRS[prev] === next) {
1914
+ e.preventDefault();
1915
+ const v = ta.value.slice(0, pos - 1) + ta.value.slice(pos + 1);
1916
+ this._applyValue(v, pos - 1, pos - 1);
1917
+ return;
1918
+ }
1919
+ }
1920
+ }
1921
+ }
1922
+ _smartEnter() {
1923
+ const ta = this.ta;
1924
+ const pos = ta.selectionStart;
1925
+ const before = ta.value.slice(0, pos);
1926
+ const after = ta.value.slice(ta.selectionEnd);
1927
+ const linesBefore = before.split('\n');
1928
+ const curLine = linesBefore.pop() ?? '';
1929
+ const match = curLine.match(/^(\s*)/);
1930
+ const indent = match ? match[1] : '';
1931
+ const lastCh = curLine.trimEnd().slice(-1);
1932
+ const firstAfter = after.trimStart()[0];
1933
+ const tab = ' '.repeat(this.tabSize);
1934
+ let newIndent = indent;
1935
+ let extra = '';
1936
+ if ('({['.includes(lastCh)) {
1937
+ newIndent = indent + tab;
1938
+ if (')}]'.includes(firstAfter))
1939
+ extra = '\n' + indent;
1940
+ }
1941
+ const insert = '\n' + newIndent + extra;
1942
+ const v = before + insert + after;
1943
+ const newPos = pos + 1 + newIndent.length;
1944
+ this._applyValue(v, newPos, newPos);
1945
+ }
1946
+ _insertTab() {
1947
+ const ta = this.ta;
1948
+ const start = ta.selectionStart, end = ta.selectionEnd;
1949
+ const tab = ' '.repeat(this.tabSize);
1950
+ if (start === end) {
1951
+ const v = ta.value.slice(0, start) + tab + ta.value.slice(end);
1952
+ this._applyValue(v, start + tab.length, start + tab.length);
1953
+ }
1954
+ else {
1955
+ const lineStart = ta.value.lastIndexOf('\n', start - 1) + 1;
1956
+ const block = ta.value.slice(lineStart, end);
1957
+ const indented = block
1958
+ .split('\n')
1959
+ .map(l => tab + l)
1960
+ .join('\n');
1961
+ const v = ta.value.slice(0, lineStart) + indented + ta.value.slice(end);
1962
+ this._applyValue(v, lineStart, lineStart + indented.length);
1963
+ }
1964
+ }
1965
+ _unindent() {
1966
+ const ta = this.ta;
1967
+ const start = ta.selectionStart, end = ta.selectionEnd;
1968
+ const tab = ' '.repeat(this.tabSize);
1969
+ const lineStart = ta.value.lastIndexOf('\n', start - 1) + 1;
1970
+ const block = ta.value.slice(lineStart, end);
1971
+ const unindented = block
1972
+ .split('\n')
1973
+ .map(l => (l.startsWith(tab) ? l.slice(tab.length) : l.startsWith('\t') ? l.slice(1) : l))
1974
+ .join('\n');
1975
+ const v = ta.value.slice(0, lineStart) + unindented + ta.value.slice(end);
1976
+ this._applyValue(v, lineStart, lineStart + unindented.length);
1977
+ }
1978
+ _insertPair(open, close) {
1979
+ const ta = this.ta;
1980
+ const pos = ta.selectionStart;
1981
+ const v = ta.value.slice(0, pos) + open + close + ta.value.slice(ta.selectionEnd);
1982
+ this._applyValue(v, pos + 1, pos + 1);
1983
+ }
1984
+ _wrapSel(open, close) {
1985
+ const ta = this.ta;
1986
+ const s = ta.selectionStart, e = ta.selectionEnd;
1987
+ const sel = ta.value.slice(s, e);
1988
+ const v = ta.value.slice(0, s) + open + sel + close + ta.value.slice(e);
1989
+ this._applyValue(v, s + 1, e + 1);
1990
+ }
1991
+ _undo() {
1992
+ const entry = this.history.undo();
1993
+ if (!entry)
1994
+ return;
1995
+ this._value = entry.value;
1996
+ if (this.ta) {
1997
+ this.ta.value = entry.value;
1998
+ this.ta.setSelectionRange(entry.selStart, entry.selEnd);
1999
+ }
2000
+ this._reHighlight();
2001
+ this.codeChange.emit({ value: this._value });
2002
+ }
2003
+ _redo() {
2004
+ const entry = this.history.redo();
2005
+ if (!entry)
2006
+ return;
2007
+ this._value = entry.value;
2008
+ if (this.ta) {
2009
+ this.ta.value = entry.value;
2010
+ this.ta.setSelectionRange(entry.selStart, entry.selEnd);
2011
+ }
2012
+ this._reHighlight();
2013
+ this.codeChange.emit({ value: this._value });
2014
+ }
2015
+ _addExtraCursor(e) {
2016
+ if (!this.plugins.isEnabled('multi-cursor'))
2017
+ return;
2018
+ const rect = this.codeContainer.getBoundingClientRect();
2019
+ const x = e.clientX - rect.left - PAD + this.codeContainer.scrollLeft;
2020
+ const y = e.clientY - rect.top + this.codeContainer.scrollTop - 8;
2021
+ const dispLine = clamp(Math.floor(y / LH), 0, this._displayLines.length - 1);
2022
+ const realLine = this._displayLines[dispLine]?.real ?? 0;
2023
+ const lines = this._value.split('\n');
2024
+ const lineText = lines[realLine] ?? '';
2025
+ const col = clamp(Math.round(x / CW), 0, lineText.length);
2026
+ const pos = lines.slice(0, realLine).join('\n').length + (realLine > 0 ? 1 : 0) + col;
2027
+ this._extraCursors = [...this._extraCursors, { pos }];
2028
+ }
2029
+ _extraCursorPositions() {
2030
+ return this._extraCursors.map(cur => {
2031
+ const before = this._value.slice(0, cur.pos);
2032
+ const lines = before.split('\n');
2033
+ const realLine = lines.length - 1;
2034
+ const dispIdx = this._displayLines.findIndex(dl => dl.real === realLine);
2035
+ const row = dispIdx >= 0 ? dispIdx : realLine;
2036
+ const col = lines[realLine].length;
2037
+ return { top: row * LH + 8, left: col * CW + PAD };
2038
+ });
2039
+ }
2040
+ _selectAllOccurrences() {
2041
+ const ta = this.ta;
2042
+ const s = ta.selectionStart, e = ta.selectionEnd;
2043
+ if (s === e)
2044
+ return;
2045
+ const word = ta.value.slice(s, e);
2046
+ const escaped = word.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
2047
+ const re = new RegExp(escaped, 'g');
2048
+ const cursors = [];
2049
+ let m;
2050
+ while ((m = re.exec(ta.value)) !== null) {
2051
+ if (m.index !== s)
2052
+ cursors.push({ pos: m.index });
2053
+ }
2054
+ this._extraCursors = cursors;
2055
+ }
2056
+ _runSearch() {
2057
+ const q = this._searchQuery;
2058
+ if (!q) {
2059
+ this._matches = [];
2060
+ return;
2061
+ }
2062
+ try {
2063
+ const re = new RegExp(q.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'gi');
2064
+ const matches = [];
2065
+ let m;
2066
+ while ((m = re.exec(this._value)) !== null) {
2067
+ matches.push({ start: m.index, end: m.index + m[0].length });
2068
+ }
2069
+ this._matches = matches;
2070
+ if (this._matchIdx >= matches.length)
2071
+ this._matchIdx = 0;
2072
+ }
2073
+ catch {
2074
+ this._matches = [];
2075
+ }
2076
+ }
2077
+ _searchNext() {
2078
+ if (!this._matches.length)
2079
+ return;
2080
+ this._matchIdx = (this._matchIdx + 1) % this._matches.length;
2081
+ this._jumpToMatch(this._matchIdx);
2082
+ }
2083
+ _searchPrev() {
2084
+ if (!this._matches.length)
2085
+ return;
2086
+ this._matchIdx = (this._matchIdx - 1 + this._matches.length) % this._matches.length;
2087
+ this._jumpToMatch(this._matchIdx);
2088
+ }
2089
+ _jumpToMatch(idx) {
2090
+ const m = this._matches[idx];
2091
+ if (!m || !this.ta)
2092
+ return;
2093
+ this.ta.setSelectionRange(m.start, m.end);
2094
+ this.ta.focus();
2095
+ const before = this._value.slice(0, m.start);
2096
+ const line = before.split('\n').length - 1;
2097
+ const dispIdx = this._displayLines.findIndex(dl => dl.real === line);
2098
+ const row = dispIdx >= 0 ? dispIdx : line;
2099
+ this.codeContainer.scrollTop = Math.max(0, row * LH - 100);
2100
+ }
2101
+ _replaceOne() {
2102
+ const m = this._matches[this._matchIdx];
2103
+ if (!m)
2104
+ return;
2105
+ this.history.pushNow({ value: this._value, selStart: m.start, selEnd: m.end });
2106
+ const v = this._value.slice(0, m.start) + this._replaceQuery + this._value.slice(m.end);
2107
+ this._applyValue(v, m.start, m.start + this._replaceQuery.length);
2108
+ this._runSearch();
2109
+ }
2110
+ _replaceAll() {
2111
+ if (!this._searchQuery)
2112
+ return;
2113
+ this.history.pushNow({ value: this._value, selStart: 0, selEnd: 0 });
2114
+ try {
2115
+ const re = new RegExp(this._searchQuery.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'gi');
2116
+ const v = this._value.replace(re, this._replaceQuery);
2117
+ this._applyValue(v, 0, 0);
2118
+ this._runSearch();
2119
+ }
2120
+ catch { }
2121
+ }
2122
+ _searchHighlights() {
2123
+ return this._matches.map((m, idx) => {
2124
+ const before = this._value.slice(0, m.start);
2125
+ const lines = before.split('\n');
2126
+ const realLine = lines.length - 1;
2127
+ const dispIdx = this._displayLines.findIndex(dl => dl.real === realLine);
2128
+ const row = dispIdx >= 0 ? dispIdx : realLine;
2129
+ const col = lines[realLine].length;
2130
+ const len = m.end - m.start;
2131
+ return { top: row * LH + 8, left: col * CW + PAD, width: len * CW, isCur: idx === this._matchIdx };
2132
+ });
2133
+ }
2134
+ _tryShowAC() {
2135
+ if (!this.ta)
2136
+ return;
2137
+ const pos = this.ta.selectionStart;
2138
+ if (this.ta.selectionStart !== this.ta.selectionEnd) {
2139
+ this._acOpen = false;
2140
+ return;
2141
+ }
2142
+ const before = this._value.slice(0, pos);
2143
+ const m = before.match(/[\w.@#-]+$/);
2144
+ const prefix = m ? m[0] : '';
2145
+ if (prefix.length < 1) {
2146
+ this._acOpen = false;
2147
+ return;
2148
+ }
2149
+ const items = getCompletions(prefix, this._lang);
2150
+ if (!items.length) {
2151
+ this._acOpen = false;
2152
+ return;
2153
+ }
2154
+ this._acItems = items;
2155
+ this._acIndex = 0;
2156
+ this._acOpen = true;
2157
+ // Position
2158
+ const lines = before.split('\n');
2159
+ const dispIdx = this._displayLines.findIndex(dl => dl.real === lines.length - 1);
2160
+ const row = dispIdx >= 0 ? dispIdx : lines.length - 1;
2161
+ const col = lines[lines.length - 1].length;
2162
+ this._acX = col * CW + PAD;
2163
+ this._acY = (row + 1) * LH + 8;
2164
+ }
2165
+ _acMove(dir) {
2166
+ this._acIndex = clamp(this._acIndex + dir, 0, this._acItems.length - 1);
2167
+ // Auto scroll to the selected item avoiding overlap
2168
+ if (this.acContainer) {
2169
+ // Wait for DOM to render the selected class (since Stencil is async)
2170
+ // But actually we can just scroll immediately since the items are already in DOM,
2171
+ // we just need the offsetTop of the corresponding item.
2172
+ setTimeout(() => {
2173
+ if (!this.acContainer)
2174
+ return;
2175
+ const itemElement = this.acContainer.children[this._acIndex];
2176
+ if (!itemElement)
2177
+ return;
2178
+ const containerTop = this.acContainer.scrollTop;
2179
+ const containerBottom = containerTop + this.acContainer.clientHeight;
2180
+ const itemTop = itemElement.offsetTop;
2181
+ const itemBottom = itemTop + itemElement.offsetHeight;
2182
+ if (itemBottom > containerBottom) {
2183
+ this.acContainer.scrollTop = itemBottom - this.acContainer.clientHeight;
2184
+ }
2185
+ else if (itemTop < containerTop) {
2186
+ this.acContainer.scrollTop = itemTop;
2187
+ }
2188
+ }, 10);
2189
+ }
2190
+ }
2191
+ _acAccept() {
2192
+ const item = this._acItems[this._acIndex];
2193
+ if (!item)
2194
+ return;
2195
+ const ta = this.ta;
2196
+ const pos = ta.selectionStart;
2197
+ const before = this._value.slice(0, pos);
2198
+ const m = before.match(/[\w.@#-]+$/);
2199
+ const prefix = m ? m[0] : '';
2200
+ const insert = (item.insert ?? item.label).replace(/\$\{\d+:[^}]+\}|\$\d+/g, '');
2201
+ const v = this._value.slice(0, pos - prefix.length) + insert + this._value.slice(pos);
2202
+ const newPos = pos - prefix.length + insert.length;
2203
+ this._applyValue(v, newPos, newPos);
2204
+ this._acOpen = false;
2205
+ }
2206
+ _formatDoc() {
2207
+ if (this._lang !== 'json')
2208
+ return;
2209
+ try {
2210
+ const formatted = JSON.stringify(JSON.parse(this._value), null, this.tabSize);
2211
+ this.history.pushNow({ value: this._value, selStart: 0, selEnd: 0 });
2212
+ this._applyValue(formatted, 0, 0);
2213
+ }
2214
+ catch {
2215
+ /* invalid json */
2216
+ }
2217
+ }
2218
+ _refreshAST() {
2219
+ if (this._lang !== 'js') {
2220
+ this._astRoot = null;
2221
+ return;
2222
+ }
2223
+ this._astRoot = parseAST(this._value);
2224
+ }
2225
+ _togglePanel(p) {
2226
+ this._panel = this._panel === p ? null : p;
2227
+ if (this._panel === 'ast')
2228
+ this._refreshAST();
2229
+ if (this._panel === 'plugins')
2230
+ this._pluginList = this.plugins.list();
2231
+ }
2232
+ // ── Render helpers ─────────────────────────────────────────────────────────
2233
+ _renderACIcon(type) {
2234
+ const MAP = {
2235
+ kw: 'K',
2236
+ fn: 'F',
2237
+ var: 'V',
2238
+ prop: 'P',
2239
+ snip: 'S',
2240
+ tag: 'T',
2241
+ attr: 'A',
2242
+ };
2243
+ return MAP[type] ?? '?';
2244
+ }
2245
+ _renderASTTree(node, depth = 0) {
2246
+ if (!node)
2247
+ return '';
2248
+ if (Array.isArray(node)) {
2249
+ if (!node.length)
2250
+ return '<span class="x-code-editor-ast-val">[]</span>';
2251
+ return node.map(n => this._renderASTTree(n, depth)).join('');
2252
+ }
2253
+ const { type, ...rest } = node;
2254
+ const keys = Object.keys(rest).filter(k => !k.startsWith('_'));
2255
+ const id = `n${Math.random().toString(36).slice(2, 8)}`;
2256
+ const childHtml = keys
2257
+ .map(k => {
2258
+ const v = rest[k];
2259
+ if (v === null || v === undefined)
2260
+ return '';
2261
+ const rendered = typeof v === 'object' ? this._renderASTTree(v, depth + 1) : `<span class="x-code-editor-ast-val">${escH(String(v))}</span>`;
2262
+ return `<div class="x-code-editor-ast-row"><span class="x-code-editor-ast-key">${escH(k)}:</span> ${rendered}</div>`;
2263
+ })
2264
+ .filter(Boolean)
2265
+ .join('');
2266
+ if (!childHtml)
2267
+ return `<span class="x-code-editor-ast-type">${escH(type ?? '')}</span>`;
2268
+ return `<div class="x-code-editor-ast-node">
2269
+ <span class="x-code-editor-ast-toggle" onclick="this.nextElementSibling.style.display=this.nextElementSibling.style.display==='none'?'':'none'">
2270
+ ▾ <span class="x-code-editor-ast-type">${escH(type ?? '')}</span>
2271
+ </span>
2272
+ <div id="${id}" class="x-code-editor-ast-children">${childHtml}</div>
2273
+ </div>`;
2274
+ }
2275
+ // ==================== Render ====================
2276
+ render() {
2277
+ const bracketHls = this._bracketHighlights();
2278
+ const searchHls = this._searchHighlights();
2279
+ const extraCursorPositions = this._extraCursorPositions();
2280
+ const totalLines = this._displayLines.length;
2281
+ const containerH = Math.max(totalLines * LH + 32, 300);
2282
+ const acPrefix = (() => {
2283
+ if (!this.ta)
2284
+ return '';
2285
+ const before = this._value.slice(0, this.ta.selectionStart);
2286
+ return before.match(/[\w.@#-]+$/)?.[0] ?? '';
2287
+ })();
2288
+ const wrapperClasses = {
2289
+ 'x-code-editor-root': true,
2290
+ [`theme-${this.theme}`]: true,
2291
+ [this.classNames?.root ?? '']: !!this.classNames?.root,
2292
+ };
2293
+ const editorBoxClasses = {
2294
+ 'x-code-editor-editor-wrap': true,
2295
+ [this.classNames?.editorBox ?? '']: !!this.classNames?.editorBox,
2296
+ };
2297
+ return (index.h(index.Host, { class: wrapperClasses, style: this.styles?.root }, index.h("div", { class: { 'x-code-editor-toolbar': true, [this.classNames?.toolbar ?? '']: !!this.classNames?.toolbar }, style: this.styles?.toolbar }, index.h("button", { class: "x-code-editor-tbtn", onClick: () => {
2298
+ this._showSearch = true;
2299
+ } }, "\u2315 Search"), index.h("button", { class: "x-code-editor-tbtn", onClick: () => {
2300
+ this._showSearch = true;
2301
+ this._showReplace = !this._showReplace;
2302
+ } }, "\u21C4 Replace"), index.h("span", { class: "x-code-editor-tsep" }), index.h("button", { class: "x-code-editor-tbtn", onClick: () => this._undo(), title: "Ctrl+Z" }, "\u21BA Undo"), index.h("button", { class: "x-code-editor-tbtn", onClick: () => this._redo(), title: "Ctrl+Y" }, "\u21BB Redo"), index.h("span", { class: "x-code-editor-tsep" }), index.h("button", { class: "x-code-editor-tbtn", onClick: () => this._foldAll() }, "\u229F Fold All"), index.h("button", { class: "x-code-editor-tbtn", onClick: () => this._unfoldAll() }, "\u229E Unfold All"), index.h("span", { class: "x-code-editor-tsep" }), index.h("button", { class: `x-code-editor-tbtn${this._panel === 'ast' ? ' x-code-editor-active' : ''}`, onClick: () => this._togglePanel('ast') }, "\uD83C\uDF32 AST"), index.h("button", { class: `x-code-editor-tbtn${this._panel === 'plugins' ? ' x-code-editor-active' : ''}`, onClick: () => this._togglePanel('plugins') }, "\u2699 Plugins"), this._lang === 'json' && (index.h("button", { class: "x-code-editor-tbtn", onClick: () => this._formatDoc() }, "\u2726 Format")), index.h("span", { class: "x-code-editor-toolbar-lang" }, LANG_NAMES[this._lang])), this._showSearch && (index.h("div", { class: "x-code-editor-search-bar" }, index.h("input", { class: "x-code-editor-search-input", type: "text", placeholder: "Find\u2026", value: this._searchQuery, onInput: e => {
2303
+ this._searchQuery = e.target.value;
2304
+ this._runSearch();
2305
+ }, onKeyDown: e => {
2306
+ if (e.key === 'Enter')
2307
+ e.shiftKey ? this._searchPrev() : this._searchNext();
2308
+ if (e.key === 'Escape') {
2309
+ this._showSearch = false;
2310
+ this._matches = [];
2311
+ }
2312
+ } }), this._showReplace && (index.h("input", { class: "x-code-editor-search-input", type: "text", placeholder: "Replace\u2026", value: this._replaceQuery, onInput: e => {
2313
+ this._replaceQuery = e.target.value;
2314
+ } })), index.h("button", { class: "x-code-editor-sbar-btn", onClick: () => this._searchPrev() }, "\u2191"), index.h("button", { class: "x-code-editor-sbar-btn", onClick: () => this._searchNext() }, "\u2193"), this._showReplace && (index.h(index.Fragment, null, index.h("button", { class: "x-code-editor-sbar-btn", onClick: () => this._replaceOne() }, "Replace"), index.h("button", { class: "x-code-editor-sbar-btn", onClick: () => this._replaceAll() }, "All"))), index.h("span", { class: "x-code-editor-match-count" }, this._matches.length > 0 ? `${this._matchIdx + 1} / ${this._matches.length}` : this._searchQuery ? '0 matches' : ''), index.h("button", { class: "x-code-editor-sbar-close", onClick: () => {
2315
+ this._showSearch = false;
2316
+ this._matches = [];
2317
+ } }, "\u2715"))), index.h("div", { class: "x-code-editor-main-area" }, index.h("div", { class: editorBoxClasses, style: this.styles?.editorBox }, index.h("div", { class: { 'x-code-editor-gutter': true, [this.classNames?.gutter ?? '']: !!this.classNames?.gutter }, style: this.styles?.gutter }, index.h("canvas", { ref: el => (this.gutterCanvas = el), class: "x-code-editor-gutter-canvas", onClick: e => {
2318
+ const rect = e.currentTarget.getBoundingClientRect();
2319
+ const y = e.clientY - rect.top + this.codeContainer.scrollTop;
2320
+ const dispIdx = Math.floor(y / LH);
2321
+ const dl = this._displayLines[dispIdx];
2322
+ if (dl && this.plugins.isEnabled('fold'))
2323
+ this._toggleFold(dl.real);
2324
+ } })), index.h("div", { class: "x-code-editor-code-container", ref: el => (this.codeContainer = el) }, this.plugins.isEnabled('line-highlight') && index.h("div", { class: "x-code-editor-cur-line-hl", style: { top: `${this._cursorLine * LH + 8}px` } }), bracketHls.map(b => (index.h("div", { class: "x-code-editor-bracket-hl", style: { top: `${b.top}px`, left: `${b.left}px` } }))), searchHls.map(s => (index.h("div", { class: `x-code-editor-search-hl${s.isCur ? ' x-code-editor-search-cur' : ''}`, style: { top: `${s.top}px`, left: `${s.left}px`, width: `${s.width}px` } }))), extraCursorPositions.map(p => (index.h("div", { class: "x-code-editor-extra-cursor", style: { top: `${p.top}px`, left: `${p.left}px` } }))), this._wordHls.map(w => (index.h("div", { class: "x-code-editor-word-hl", style: { top: `${w.top}px`, left: `${w.left}px`, width: `${w.width}px` } }))), index.h("div", { class: "x-code-editor-highlight-layer", style: { minHeight: `${containerH}px` }, innerHTML: this._highlighted, onClick: e => {
2325
+ const target = e.target;
2326
+ if (target.classList.contains('x-code-editor-folded-pill')) {
2327
+ const line = parseInt(target.dataset.line ?? '0', 10);
2328
+ const f = new Set(this._folds);
2329
+ f.delete(line);
2330
+ this._folds = f;
2331
+ this._reHighlight();
2332
+ }
2333
+ } }), index.h("textarea", { ref: el => (this.ta = el), class: { 'x-code-editor-code-input': true, [this.classNames?.textarea ?? '']: !!this.classNames?.textarea }, spellcheck: false, autocomplete: "off", autocorrect: "off", autocapitalize: "off", readonly: this.readonly, style: { minHeight: `${containerH}px` }, onInput: () => this._onInput(), onKeyDown: e => this._onKeydown(e), onClick: () => this._onCursorChange(), onKeyUp: () => this._onCursorChange(), onMouseUp: () => this._onCursorChange(), onMouseDown: e => {
2334
+ if (e.altKey) {
2335
+ e.preventDefault();
2336
+ this._addExtraCursor(e);
2337
+ }
2338
+ }, onScroll: () => this._drawGutter() }))), this._panel === 'ast' && (index.h("div", { class: "x-code-editor-side-panel" }, index.h("div", { class: "x-code-editor-panel-header" }, "AST Explorer", index.h("button", { class: "x-code-editor-panel-close", onClick: () => (this._panel = null) }, "\u2715")), index.h("div", { class: "x-code-editor-panel-body" }, this._lang !== 'js' ? (index.h("p", { class: "x-code-editor-panel-hint" }, "AST available for JavaScript only")) : this._astRoot ? (index.h("div", { class: "x-code-editor-ast-tree", innerHTML: this._renderASTTree(this._astRoot) })) : (index.h("p", { class: "x-code-editor-panel-hint" }, "Parsing\u2026"))))), this._panel === 'plugins' && (index.h("div", { class: "x-code-editor-side-panel" }, index.h("div", { class: "x-code-editor-panel-header" }, "Plugins", index.h("button", { class: "x-code-editor-panel-close", onClick: () => (this._panel = null) }, "\u2715")), index.h("div", { class: "x-code-editor-panel-body" }, this._pluginList.map(p => (index.h("div", { class: "x-code-editor-plugin-card" }, index.h("div", { class: "x-code-editor-plugin-card-header" }, index.h("span", { class: "x-code-editor-plugin-name" }, p.name), index.h("div", { class: `x-code-editor-toggle${p.enabled ? ' x-code-editor-on' : ''}`, onClick: () => {
2339
+ this.plugins.toggle(p.id);
2340
+ this._pluginList = this.plugins.list();
2341
+ this._reHighlight();
2342
+ } })), index.h("p", { class: "x-code-editor-plugin-desc" }, p.description)))))))), this._acOpen && this._acItems.length > 0 && (index.h("div", { class: "x-code-editor-autocomplete", ref: el => (this.acContainer = el), style: {
2343
+ left: `${this._acX}px`,
2344
+ top: `${this._acY - (this.codeContainer?.scrollTop || 0) + 32 + (this._showSearch ? 36 : 0)}px`,
2345
+ } }, this._acItems.map((item, i) => {
2346
+ const hl = item.label.slice(0, acPrefix.length);
2347
+ const rest = item.label.slice(acPrefix.length);
2348
+ return (index.h("div", { class: `x-code-editor-ac-item${i === this._acIndex ? ' x-code-editor-selected' : ''}`, onClick: () => {
2349
+ this._acIndex = i;
2350
+ this._acAccept();
2351
+ } }, index.h("span", { class: `x-code-editor-ac-icon x-code-editor-ac-${item.type}` }, this._renderACIcon(item.type)), index.h("span", { class: "x-code-editor-ac-label" }, index.h("b", null, hl), rest), index.h("span", { class: "x-code-editor-ac-detail" }, item.detail)));
2352
+ }))), index.h("div", { class: "x-code-editor-statusbar" }, index.h("span", { class: "x-code-editor-sb-cursor" }, "Ln ", this._cursorLine + 1, ", Col ", this._cursorCol + 1), this._selLen > 0 && index.h("span", { class: "x-code-editor-sb-sel" }, this._selLen, " selected"), this._extraCursors.length > 0 && index.h("span", { class: "x-code-editor-sb-multicursor" }, "+", this._extraCursors.length, " cursors"), this._extraCursors.length > 0 && (index.h("button", { class: "x-code-editor-sb-clear-cursors", onClick: () => (this._extraCursors = []) }, "\u00D7 clear")), index.h("span", { class: "x-code-editor-sb-spacer" }), index.h("span", { class: "x-code-editor-sb-utf" }, "UTF-8"), index.h("span", { class: "x-code-editor-sb-lf" }, "LF"), index.h("span", { class: "x-code-editor-sb-lang" }, LANG_NAMES[this._lang]), index.h("span", { class: "x-code-editor-sb-chars" }, this._value.length, " chars"))));
2353
+ }
2354
+ static get watchers() { return {
2355
+ "value": [{
2356
+ "onValueProp": 0
2357
+ }],
2358
+ "language": [{
2359
+ "onLangProp": 0
2360
+ }]
2361
+ }; }
2362
+ };
2363
+ XCodeEditor.style = xCodeEditorCss();
2364
+
2365
+ exports.x_code_editor = XCodeEditor;