ngwr 10.2.1 → 11.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (431) hide show
  1. package/README.md +39 -19
  2. package/action-sheet/styles/_index.scss +4 -1
  3. package/anchor/styles/_index.scss +6 -5
  4. package/back-top/styles/_index.scss +6 -1
  5. package/blur-text/styles/_index.scss +13 -0
  6. package/button/styles/_index.scss +11 -6
  7. package/calendar/styles/_index.scss +11 -2
  8. package/carousel/styles/_index.scss +13 -2
  9. package/cascader/styles/_index.scss +5 -3
  10. package/circular-text/styles/_index.scss +2 -0
  11. package/collapse/styles/_index.scss +1 -1
  12. package/color-picker/styles/_index.scss +6 -1
  13. package/command-palette/styles/_index.scss +2 -1
  14. package/compare/styles/_index.scss +1 -2
  15. package/context-menu/styles/_index.scss +8 -2
  16. package/descriptions/styles/_index.scss +2 -2
  17. package/dialog/styles/_index.scss +7 -0
  18. package/drawer/styles/_index.scss +20 -1
  19. package/dropdown/styles/_index.scss +19 -5
  20. package/empty/styles/_index.scss +10 -0
  21. package/falling-text/styles/_index.scss +2 -1
  22. package/fesm2022/ngwr-action-sheet.mjs +13 -3
  23. package/fesm2022/ngwr-action-sheet.mjs.map +1 -1
  24. package/fesm2022/ngwr-affix.mjs +40 -13
  25. package/fesm2022/ngwr-affix.mjs.map +1 -1
  26. package/fesm2022/ngwr-anchor.mjs +18 -6
  27. package/fesm2022/ngwr-anchor.mjs.map +1 -1
  28. package/fesm2022/ngwr-aurora.mjs +2 -2
  29. package/fesm2022/ngwr-aurora.mjs.map +1 -1
  30. package/fesm2022/ngwr-avatar.mjs +31 -7
  31. package/fesm2022/ngwr-avatar.mjs.map +1 -1
  32. package/fesm2022/ngwr-back-top.mjs +6 -2
  33. package/fesm2022/ngwr-back-top.mjs.map +1 -1
  34. package/fesm2022/ngwr-badge.mjs +1 -1
  35. package/fesm2022/ngwr-badge.mjs.map +1 -1
  36. package/fesm2022/ngwr-bar-chart.mjs +30 -9
  37. package/fesm2022/ngwr-bar-chart.mjs.map +1 -1
  38. package/fesm2022/ngwr-blur-text.mjs +2 -2
  39. package/fesm2022/ngwr-blur-text.mjs.map +1 -1
  40. package/fesm2022/ngwr-border-glow.mjs +2 -2
  41. package/fesm2022/ngwr-border-glow.mjs.map +1 -1
  42. package/fesm2022/ngwr-breadcrumbs.mjs +2 -2
  43. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  44. package/fesm2022/ngwr-burger.mjs +9 -4
  45. package/fesm2022/ngwr-burger.mjs.map +1 -1
  46. package/fesm2022/ngwr-button-testing.mjs +96 -0
  47. package/fesm2022/ngwr-button-testing.mjs.map +1 -0
  48. package/fesm2022/ngwr-button.mjs +31 -14
  49. package/fesm2022/ngwr-button.mjs.map +1 -1
  50. package/fesm2022/ngwr-calendar-heatmap.mjs +40 -8
  51. package/fesm2022/ngwr-calendar-heatmap.mjs.map +1 -1
  52. package/fesm2022/ngwr-calendar.mjs +20 -1
  53. package/fesm2022/ngwr-calendar.mjs.map +1 -1
  54. package/fesm2022/ngwr-card.mjs +2 -2
  55. package/fesm2022/ngwr-card.mjs.map +1 -1
  56. package/fesm2022/ngwr-carousel-testing.mjs +377 -0
  57. package/fesm2022/ngwr-carousel-testing.mjs.map +1 -0
  58. package/fesm2022/ngwr-carousel.mjs +67 -13
  59. package/fesm2022/ngwr-carousel.mjs.map +1 -1
  60. package/fesm2022/ngwr-cascader-testing.mjs +534 -0
  61. package/fesm2022/ngwr-cascader-testing.mjs.map +1 -0
  62. package/fesm2022/ngwr-cascader.mjs +2 -2
  63. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  64. package/fesm2022/ngwr-checkbox-testing.mjs +90 -0
  65. package/fesm2022/ngwr-checkbox-testing.mjs.map +1 -0
  66. package/fesm2022/ngwr-checkbox.mjs +9 -3
  67. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  68. package/fesm2022/ngwr-circular-text.mjs +2 -2
  69. package/fesm2022/ngwr-circular-text.mjs.map +1 -1
  70. package/fesm2022/ngwr-click-spark.mjs +2 -2
  71. package/fesm2022/ngwr-click-spark.mjs.map +1 -1
  72. package/fesm2022/ngwr-collapse-testing.mjs +368 -0
  73. package/fesm2022/ngwr-collapse-testing.mjs.map +1 -0
  74. package/fesm2022/ngwr-color-picker.mjs +134 -14
  75. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  76. package/fesm2022/ngwr-command-palette-testing.mjs +589 -0
  77. package/fesm2022/ngwr-command-palette-testing.mjs.map +1 -0
  78. package/fesm2022/ngwr-command-palette.mjs +58 -8
  79. package/fesm2022/ngwr-command-palette.mjs.map +1 -1
  80. package/fesm2022/ngwr-compare.mjs +103 -13
  81. package/fesm2022/ngwr-compare.mjs.map +1 -1
  82. package/fesm2022/ngwr-config.mjs +106 -0
  83. package/fesm2022/ngwr-config.mjs.map +1 -0
  84. package/fesm2022/ngwr-context-menu-testing.mjs +631 -0
  85. package/fesm2022/ngwr-context-menu-testing.mjs.map +1 -0
  86. package/fesm2022/ngwr-context-menu.mjs +94 -8
  87. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  88. package/fesm2022/ngwr-cookie.mjs +5 -1
  89. package/fesm2022/ngwr-cookie.mjs.map +1 -1
  90. package/fesm2022/ngwr-counter.mjs +11 -3
  91. package/fesm2022/ngwr-counter.mjs.map +1 -1
  92. package/fesm2022/ngwr-date-adapter-luxon.mjs +52 -4
  93. package/fesm2022/ngwr-date-adapter-luxon.mjs.map +1 -1
  94. package/fesm2022/ngwr-date-adapter.mjs +54 -8
  95. package/fesm2022/ngwr-date-adapter.mjs.map +1 -1
  96. package/fesm2022/ngwr-date-picker-testing.mjs +766 -0
  97. package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -0
  98. package/fesm2022/ngwr-date-picker.mjs +73 -3
  99. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  100. package/fesm2022/ngwr-decrypt-text.mjs +27 -9
  101. package/fesm2022/ngwr-decrypt-text.mjs.map +1 -1
  102. package/fesm2022/ngwr-dialog-testing.mjs +89 -0
  103. package/fesm2022/ngwr-dialog-testing.mjs.map +1 -0
  104. package/fesm2022/ngwr-directives.mjs +36 -12
  105. package/fesm2022/ngwr-directives.mjs.map +1 -1
  106. package/fesm2022/ngwr-donut-chart.mjs +22 -5
  107. package/fesm2022/ngwr-donut-chart.mjs.map +1 -1
  108. package/fesm2022/ngwr-drag-drop.mjs +2 -2
  109. package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
  110. package/fesm2022/ngwr-drawer-testing.mjs +250 -0
  111. package/fesm2022/ngwr-drawer-testing.mjs.map +1 -0
  112. package/fesm2022/ngwr-dropdown-testing.mjs +291 -0
  113. package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -0
  114. package/fesm2022/ngwr-dropdown.mjs +10 -2
  115. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  116. package/fesm2022/ngwr-empty.mjs +24 -7
  117. package/fesm2022/ngwr-empty.mjs.map +1 -1
  118. package/fesm2022/ngwr-event-calendar.mjs +57 -10
  119. package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
  120. package/fesm2022/ngwr-falling-text.mjs +2 -2
  121. package/fesm2022/ngwr-falling-text.mjs.map +1 -1
  122. package/fesm2022/ngwr-file-upload-testing.mjs +332 -0
  123. package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -0
  124. package/fesm2022/ngwr-form-testing.mjs +451 -0
  125. package/fesm2022/ngwr-form-testing.mjs.map +1 -0
  126. package/fesm2022/ngwr-form.mjs +19 -3
  127. package/fesm2022/ngwr-form.mjs.map +1 -1
  128. package/fesm2022/ngwr-fuzzy-text.mjs +9 -2
  129. package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -1
  130. package/fesm2022/ngwr-gauge.mjs +19 -5
  131. package/fesm2022/ngwr-gauge.mjs.map +1 -1
  132. package/fesm2022/ngwr-glitch-text.mjs +2 -2
  133. package/fesm2022/ngwr-glitch-text.mjs.map +1 -1
  134. package/fesm2022/ngwr-gradient-text.mjs +2 -2
  135. package/fesm2022/ngwr-gradient-text.mjs.map +1 -1
  136. package/fesm2022/ngwr-i18n-en.mjs +50 -0
  137. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  138. package/fesm2022/ngwr-i18n-ru.mjs +48 -0
  139. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  140. package/fesm2022/ngwr-image-cropper.mjs +23 -0
  141. package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
  142. package/fesm2022/ngwr-input-number-testing.mjs +306 -0
  143. package/fesm2022/ngwr-input-number-testing.mjs.map +1 -0
  144. package/fesm2022/ngwr-input-number.mjs +35 -3
  145. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  146. package/fesm2022/ngwr-input-otp-testing.mjs +419 -0
  147. package/fesm2022/ngwr-input-otp-testing.mjs.map +1 -0
  148. package/fesm2022/ngwr-input-otp.mjs +36 -5
  149. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  150. package/fesm2022/ngwr-input-testing.mjs +102 -0
  151. package/fesm2022/ngwr-input-testing.mjs.map +1 -0
  152. package/fesm2022/ngwr-input.mjs +47 -10
  153. package/fesm2022/ngwr-input.mjs.map +1 -1
  154. package/fesm2022/ngwr-knob.mjs +44 -8
  155. package/fesm2022/ngwr-knob.mjs.map +1 -1
  156. package/fesm2022/ngwr-layout.mjs +21 -5
  157. package/fesm2022/ngwr-layout.mjs.map +1 -1
  158. package/fesm2022/ngwr-lightbox.mjs +33 -6
  159. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  160. package/fesm2022/ngwr-line-chart.mjs +17 -4
  161. package/fesm2022/ngwr-line-chart.mjs.map +1 -1
  162. package/fesm2022/ngwr-list.mjs +2 -2
  163. package/fesm2022/ngwr-list.mjs.map +1 -1
  164. package/fesm2022/ngwr-loading-bar.mjs +2 -2
  165. package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
  166. package/fesm2022/ngwr-markdown-testing.mjs +516 -0
  167. package/fesm2022/ngwr-markdown-testing.mjs.map +1 -0
  168. package/fesm2022/ngwr-markdown.mjs +1492 -0
  169. package/fesm2022/ngwr-markdown.mjs.map +1 -0
  170. package/fesm2022/ngwr-marquee.mjs +17 -6
  171. package/fesm2022/ngwr-marquee.mjs.map +1 -1
  172. package/fesm2022/ngwr-mention-testing.mjs +513 -0
  173. package/fesm2022/ngwr-mention-testing.mjs.map +1 -0
  174. package/fesm2022/ngwr-mention.mjs +10 -1
  175. package/fesm2022/ngwr-mention.mjs.map +1 -1
  176. package/fesm2022/ngwr-meta.mjs +22 -7
  177. package/fesm2022/ngwr-meta.mjs.map +1 -1
  178. package/fesm2022/ngwr-meter-group.mjs +19 -5
  179. package/fesm2022/ngwr-meter-group.mjs.map +1 -1
  180. package/fesm2022/ngwr-overlay.mjs +41 -1
  181. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  182. package/fesm2022/ngwr-pagination-testing.mjs +389 -0
  183. package/fesm2022/ngwr-pagination-testing.mjs.map +1 -0
  184. package/fesm2022/ngwr-pagination.mjs +14 -2
  185. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  186. package/fesm2022/ngwr-popconfirm-testing.mjs +309 -0
  187. package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -0
  188. package/fesm2022/ngwr-popconfirm.mjs +95 -17
  189. package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
  190. package/fesm2022/ngwr-popover-testing.mjs +316 -0
  191. package/fesm2022/ngwr-popover-testing.mjs.map +1 -0
  192. package/fesm2022/ngwr-popover.mjs +21 -3
  193. package/fesm2022/ngwr-popover.mjs.map +1 -1
  194. package/fesm2022/ngwr-pull-to-refresh.mjs +17 -2
  195. package/fesm2022/ngwr-pull-to-refresh.mjs.map +1 -1
  196. package/fesm2022/ngwr-qr.mjs +13 -3
  197. package/fesm2022/ngwr-qr.mjs.map +1 -1
  198. package/fesm2022/ngwr-radio-testing.mjs +392 -0
  199. package/fesm2022/ngwr-radio-testing.mjs.map +1 -0
  200. package/fesm2022/ngwr-radio.mjs +10 -3
  201. package/fesm2022/ngwr-radio.mjs.map +1 -1
  202. package/fesm2022/ngwr-rating-testing.mjs +384 -0
  203. package/fesm2022/ngwr-rating-testing.mjs.map +1 -0
  204. package/fesm2022/ngwr-rating.mjs +37 -2
  205. package/fesm2022/ngwr-rating.mjs.map +1 -1
  206. package/fesm2022/ngwr-segmented-testing.mjs +512 -0
  207. package/fesm2022/ngwr-segmented-testing.mjs.map +1 -0
  208. package/fesm2022/ngwr-select-testing.mjs +268 -0
  209. package/fesm2022/ngwr-select-testing.mjs.map +1 -0
  210. package/fesm2022/ngwr-select.mjs +87 -16
  211. package/fesm2022/ngwr-select.mjs.map +1 -1
  212. package/fesm2022/ngwr-shiny-text.mjs +2 -2
  213. package/fesm2022/ngwr-shiny-text.mjs.map +1 -1
  214. package/fesm2022/ngwr-sidebar.mjs +65 -12
  215. package/fesm2022/ngwr-sidebar.mjs.map +1 -1
  216. package/fesm2022/ngwr-slider-testing.mjs +478 -0
  217. package/fesm2022/ngwr-slider-testing.mjs.map +1 -0
  218. package/fesm2022/ngwr-slider.mjs +57 -13
  219. package/fesm2022/ngwr-slider.mjs.map +1 -1
  220. package/fesm2022/ngwr-sparkline.mjs +26 -6
  221. package/fesm2022/ngwr-sparkline.mjs.map +1 -1
  222. package/fesm2022/ngwr-speed-dial.mjs +37 -4
  223. package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
  224. package/fesm2022/ngwr-spinner.mjs +12 -3
  225. package/fesm2022/ngwr-spinner.mjs.map +1 -1
  226. package/fesm2022/ngwr-splash-cursor.mjs +2 -2
  227. package/fesm2022/ngwr-splash-cursor.mjs.map +1 -1
  228. package/fesm2022/ngwr-split-text.mjs +2 -2
  229. package/fesm2022/ngwr-split-text.mjs.map +1 -1
  230. package/fesm2022/ngwr-splitter.mjs +70 -9
  231. package/fesm2022/ngwr-splitter.mjs.map +1 -1
  232. package/fesm2022/ngwr-spotlight-card.mjs +2 -2
  233. package/fesm2022/ngwr-spotlight-card.mjs.map +1 -1
  234. package/fesm2022/ngwr-star-border.mjs +2 -2
  235. package/fesm2022/ngwr-star-border.mjs.map +1 -1
  236. package/fesm2022/ngwr-statistic.mjs +24 -7
  237. package/fesm2022/ngwr-statistic.mjs.map +1 -1
  238. package/fesm2022/ngwr-stepper-testing.mjs +477 -0
  239. package/fesm2022/ngwr-stepper-testing.mjs.map +1 -0
  240. package/fesm2022/ngwr-switch-testing.mjs +77 -0
  241. package/fesm2022/ngwr-switch-testing.mjs.map +1 -0
  242. package/fesm2022/ngwr-switch.mjs +9 -3
  243. package/fesm2022/ngwr-switch.mjs.map +1 -1
  244. package/fesm2022/ngwr-table-testing.mjs +580 -0
  245. package/fesm2022/ngwr-table-testing.mjs.map +1 -0
  246. package/fesm2022/ngwr-table.mjs +87 -14
  247. package/fesm2022/ngwr-table.mjs.map +1 -1
  248. package/fesm2022/ngwr-tabs-testing.mjs +617 -0
  249. package/fesm2022/ngwr-tabs-testing.mjs.map +1 -0
  250. package/fesm2022/ngwr-tabs.mjs +38 -6
  251. package/fesm2022/ngwr-tabs.mjs.map +1 -1
  252. package/fesm2022/ngwr-textarea-testing.mjs +238 -0
  253. package/fesm2022/ngwr-textarea-testing.mjs.map +1 -0
  254. package/fesm2022/ngwr-textarea.mjs +32 -4
  255. package/fesm2022/ngwr-textarea.mjs.map +1 -1
  256. package/fesm2022/ngwr-tilt-card.mjs +2 -2
  257. package/fesm2022/ngwr-tilt-card.mjs.map +1 -1
  258. package/fesm2022/ngwr-toast-testing.mjs +101 -0
  259. package/fesm2022/ngwr-toast-testing.mjs.map +1 -0
  260. package/fesm2022/ngwr-toast.mjs +2 -2
  261. package/fesm2022/ngwr-toast.mjs.map +1 -1
  262. package/fesm2022/ngwr-tour.mjs +61 -9
  263. package/fesm2022/ngwr-tour.mjs.map +1 -1
  264. package/fesm2022/ngwr-transfer-testing.mjs +538 -0
  265. package/fesm2022/ngwr-transfer-testing.mjs.map +1 -0
  266. package/fesm2022/ngwr-transfer.mjs +45 -14
  267. package/fesm2022/ngwr-transfer.mjs.map +1 -1
  268. package/fesm2022/ngwr-tree-testing.mjs +734 -0
  269. package/fesm2022/ngwr-tree-testing.mjs.map +1 -0
  270. package/fesm2022/ngwr-tree.mjs +73 -7
  271. package/fesm2022/ngwr-tree.mjs.map +1 -1
  272. package/fesm2022/ngwr-typewriter.mjs +5 -3
  273. package/fesm2022/ngwr-typewriter.mjs.map +1 -1
  274. package/fesm2022/ngwr-version.mjs +1 -1
  275. package/fesm2022/ngwr-version.mjs.map +1 -1
  276. package/fesm2022/ngwr-virtual-scroll.mjs +31 -5
  277. package/fesm2022/ngwr-virtual-scroll.mjs.map +1 -1
  278. package/fesm2022/ngwr-waves.mjs +3 -3
  279. package/fesm2022/ngwr-waves.mjs.map +1 -1
  280. package/fesm2022/ngwr-window.mjs +8 -0
  281. package/fesm2022/ngwr-window.mjs.map +1 -1
  282. package/file-upload/styles/_index.scss +7 -2
  283. package/gauge/styles/_index.scss +1 -1
  284. package/glitch-text/styles/_index.scss +4 -0
  285. package/i18n/en.json +48 -0
  286. package/i18n/ru.json +48 -0
  287. package/image-cropper/styles/_index.scss +13 -1
  288. package/input/styles/_index.scss +2 -2
  289. package/input-number/styles/_index.scss +7 -2
  290. package/knob/styles/_index.scss +8 -1
  291. package/layout/styles/_index.scss +3 -3
  292. package/lightbox/styles/_index.scss +10 -2
  293. package/line-chart/styles/_index.scss +6 -0
  294. package/llms-full.txt +151 -4
  295. package/llms.txt +57 -8
  296. package/loading-bar/styles/_index.scss +1 -2
  297. package/markdown/styles/_index.scss +296 -0
  298. package/marquee/styles/_index.scss +12 -0
  299. package/mcp/api.js +512 -0
  300. package/mcp/catalog.js +157 -0
  301. package/mcp/server.js +273 -0
  302. package/mcp/tools.js +366 -0
  303. package/meter-group/styles/_index.scss +1 -1
  304. package/package.json +186 -35
  305. package/pagination/styles/_index.scss +6 -6
  306. package/popover/styles/_index.scss +37 -5
  307. package/rating/styles/_index.scss +10 -0
  308. package/result/styles/_index.scss +3 -1
  309. package/schematics/use/symbol-map.json +2 -0
  310. package/segmented/styles/_index.scss +12 -1
  311. package/select/styles/_index.scss +32 -10
  312. package/sidebar/styles/_index.scss +30 -5
  313. package/slider/styles/_index.scss +15 -0
  314. package/speed-dial/styles/_index.scss +20 -0
  315. package/split-text/styles/_index.scss +13 -0
  316. package/star-border/styles/_index.scss +2 -0
  317. package/stepper/styles/_index.scss +19 -3
  318. package/styles/_grid.scss +4 -4
  319. package/styles.scss +1 -0
  320. package/switch/styles/_index.scss +5 -3
  321. package/table/styles/_index.scss +25 -12
  322. package/tabs/styles/_index.scss +11 -1
  323. package/textarea/styles/_index.scss +5 -0
  324. package/theme/styles/_colors.scss +44 -15
  325. package/theme/styles/_dark.scss +35 -15
  326. package/theme/styles/_mixins.scss +3 -0
  327. package/timeline/styles/_index.scss +2 -2
  328. package/toast/styles/_index.scss +17 -8
  329. package/toolbar/styles/_index.scss +3 -3
  330. package/tour/styles/_index.scss +7 -1
  331. package/tree/styles/_index.scss +9 -5
  332. package/types/ngwr-action-sheet.d.ts +9 -1
  333. package/types/ngwr-affix.d.ts +7 -1
  334. package/types/ngwr-anchor.d.ts +8 -1
  335. package/types/ngwr-avatar.d.ts +13 -3
  336. package/types/ngwr-bar-chart.d.ts +16 -0
  337. package/types/ngwr-burger.d.ts +6 -2
  338. package/types/ngwr-button-testing.d.ts +85 -0
  339. package/types/ngwr-button.d.ts +26 -10
  340. package/types/ngwr-calendar-heatmap.d.ts +16 -2
  341. package/types/ngwr-calendar.d.ts +10 -0
  342. package/types/ngwr-carousel-testing.d.ts +257 -0
  343. package/types/ngwr-carousel.d.ts +20 -4
  344. package/types/ngwr-cascader-testing.d.ts +392 -0
  345. package/types/ngwr-checkbox-testing.d.ts +77 -0
  346. package/types/ngwr-checkbox.d.ts +7 -2
  347. package/types/ngwr-collapse-testing.d.ts +290 -0
  348. package/types/ngwr-color-picker.d.ts +20 -11
  349. package/types/ngwr-command-palette-testing.d.ts +437 -0
  350. package/types/ngwr-command-palette.d.ts +25 -2
  351. package/types/ngwr-compare.d.ts +50 -2
  352. package/types/ngwr-config.d.ts +176 -0
  353. package/types/ngwr-context-menu-testing.d.ts +401 -0
  354. package/types/ngwr-context-menu.d.ts +65 -17
  355. package/types/ngwr-counter.d.ts +6 -1
  356. package/types/ngwr-date-adapter-luxon.d.ts +26 -0
  357. package/types/ngwr-date-picker-testing.d.ts +518 -0
  358. package/types/ngwr-date-picker.d.ts +4 -0
  359. package/types/ngwr-dialog-testing.d.ts +79 -0
  360. package/types/ngwr-directives.d.ts +10 -1
  361. package/types/ngwr-donut-chart.d.ts +8 -1
  362. package/types/ngwr-drawer-testing.d.ts +196 -0
  363. package/types/ngwr-dropdown-testing.d.ts +202 -0
  364. package/types/ngwr-dropdown.d.ts +7 -1
  365. package/types/ngwr-empty.d.ts +19 -4
  366. package/types/ngwr-event-calendar.d.ts +26 -1
  367. package/types/ngwr-file-upload-testing.d.ts +194 -0
  368. package/types/ngwr-form-testing.d.ts +379 -0
  369. package/types/ngwr-form.d.ts +17 -0
  370. package/types/ngwr-gauge.d.ts +13 -1
  371. package/types/ngwr-image-cropper.d.ts +10 -0
  372. package/types/ngwr-input-number-testing.d.ts +226 -0
  373. package/types/ngwr-input-number.d.ts +29 -1
  374. package/types/ngwr-input-otp-testing.d.ts +299 -0
  375. package/types/ngwr-input-otp.d.ts +23 -2
  376. package/types/ngwr-input-testing.d.ts +84 -0
  377. package/types/ngwr-input.d.ts +20 -6
  378. package/types/ngwr-knob.d.ts +18 -0
  379. package/types/ngwr-layout.d.ts +1 -0
  380. package/types/ngwr-lightbox.d.ts +17 -3
  381. package/types/ngwr-line-chart.d.ts +9 -2
  382. package/types/ngwr-markdown-testing.d.ts +462 -0
  383. package/types/ngwr-markdown.d.ts +534 -0
  384. package/types/ngwr-marquee.d.ts +12 -2
  385. package/types/ngwr-mention-testing.d.ts +359 -0
  386. package/types/ngwr-meta.d.ts +4 -2
  387. package/types/ngwr-meter-group.d.ts +11 -1
  388. package/types/ngwr-overlay.d.ts +33 -2
  389. package/types/ngwr-pagination-testing.d.ts +291 -0
  390. package/types/ngwr-pagination.d.ts +1 -0
  391. package/types/ngwr-popconfirm-testing.d.ts +235 -0
  392. package/types/ngwr-popconfirm.d.ts +31 -21
  393. package/types/ngwr-popover-testing.d.ts +221 -0
  394. package/types/ngwr-popover.d.ts +9 -0
  395. package/types/ngwr-pull-to-refresh.d.ts +7 -0
  396. package/types/ngwr-qr.d.ts +9 -1
  397. package/types/ngwr-radio-testing.d.ts +296 -0
  398. package/types/ngwr-radio.d.ts +8 -2
  399. package/types/ngwr-rating-testing.d.ts +291 -0
  400. package/types/ngwr-rating.d.ts +23 -0
  401. package/types/ngwr-segmented-testing.d.ts +401 -0
  402. package/types/ngwr-select-testing.d.ts +175 -0
  403. package/types/ngwr-select.d.ts +45 -4
  404. package/types/ngwr-sidebar.d.ts +17 -2
  405. package/types/ngwr-slider-testing.d.ts +329 -0
  406. package/types/ngwr-slider.d.ts +35 -1
  407. package/types/ngwr-sparkline.d.ts +12 -2
  408. package/types/ngwr-speed-dial.d.ts +17 -18
  409. package/types/ngwr-spinner.d.ts +8 -1
  410. package/types/ngwr-splitter.d.ts +24 -1
  411. package/types/ngwr-statistic.d.ts +12 -2
  412. package/types/ngwr-stepper-testing.d.ts +346 -0
  413. package/types/ngwr-switch-testing.d.ts +66 -0
  414. package/types/ngwr-switch.d.ts +7 -2
  415. package/types/ngwr-table-testing.d.ts +423 -0
  416. package/types/ngwr-table.d.ts +42 -0
  417. package/types/ngwr-tabs-testing.d.ts +470 -0
  418. package/types/ngwr-tabs.d.ts +9 -0
  419. package/types/ngwr-textarea-testing.d.ts +184 -0
  420. package/types/ngwr-textarea.d.ts +7 -2
  421. package/types/ngwr-toast-testing.d.ts +80 -0
  422. package/types/ngwr-tour.d.ts +27 -0
  423. package/types/ngwr-transfer-testing.d.ts +444 -0
  424. package/types/ngwr-transfer.d.ts +16 -1
  425. package/types/ngwr-tree-testing.d.ts +501 -0
  426. package/types/ngwr-tree.d.ts +33 -0
  427. package/types/ngwr-version.d.ts +1 -1
  428. package/types/ngwr-virtual-scroll.d.ts +13 -1
  429. package/typewriter/styles/_index.scss +1 -1
  430. package/typography/styles/_index.scss +1 -1
  431. package/window/styles/_index.scss +32 -9
package/mcp/api.js ADDED
@@ -0,0 +1,512 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Use of this source code is governed by an MIT-style license that can be
5
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
6
+ */
7
+ /**
8
+ * Angular's signal wrappers, behind whichever namespace alias ng-packagr used.
9
+ *
10
+ * BOTH aliases, which is not decoration: of the 167 shipped declaration files, 99
11
+ * import Angular as `_angular_core` and 25 as `i0`. Matching only the first hid
12
+ * every binding in those 25 files — including `WrIcon`, whose single required
13
+ * input is the entire component.
14
+ */
15
+ const SIGNAL_WRAPPER = /^(?:[A-Za-z_$][\w$]*\.)?(InputSignal|InputSignalWithTransform|ModelSignal|OutputEmitterRef)</;
16
+ /** Modifiers that may precede a member name in a `.d.ts`. */
17
+ const MODIFIERS = new Set([
18
+ 'public',
19
+ 'private',
20
+ 'protected',
21
+ 'static',
22
+ 'abstract',
23
+ 'readonly',
24
+ 'override',
25
+ 'declare',
26
+ // `accessor label: string` — without this the member came out named `accessor`
27
+ // and the real name was lost.
28
+ 'accessor',
29
+ ]);
30
+ /** Modifiers that mean "not part of the API". */
31
+ const HIDDEN = new Set(['private', 'protected', 'static']);
32
+ /**
33
+ * A class's public surface, read out of the bundled `.d.ts`.
34
+ *
35
+ * **This is the tool that earns the server its place.** `dist/lib/types/` already
36
+ * carries every summary, `@example` and input description, so a second copy would
37
+ * have to justify itself — and it does not. What an agent cannot do cheaply is USE
38
+ * those files: `ngwr-table.d.ts` is 60 KB of declarations to answer "what inputs
39
+ * does `wr-table` take", and the answer is forty lines. Reading the shipped file
40
+ * and returning only the surface cannot drift, because it IS the published type.
41
+ *
42
+ * **Scanned, not pattern-matched.** The first version was one regular expression
43
+ * per member, and it failed the way pattern-matching a language always fails: the
44
+ * optional JSDoc prefix was lazy but expandable, so any member the pattern could
45
+ * not read — a `private` field, an `abstract` method, a generic signature — let
46
+ * the match grow to the NEXT comment and swallow every public member in between,
47
+ * filing the raw source as the following member's description.
48
+ * `WrTable.scrollToRow` came out with a 5806-character "description" naming 42
49
+ * internals; `WrDialog.open`, the only reason to call that service, vanished.
50
+ * Sixty-seven public members were missing across the catalog and sixty-six leaked
51
+ * `protected` declarations into prose.
52
+ *
53
+ * `typescript` would parse this properly and is not an option: this ships inside a
54
+ * package whose only runtime dependency is `tslib`. A scanner over ng-packagr's
55
+ * OUTPUT — a generated, regular subset of the language — is the middle path, and
56
+ * it is small enough to reason about.
57
+ */
58
+ function extractClass(declarations, symbol) {
59
+ const start = findClass(declarations, symbol);
60
+ if (start === -1)
61
+ return null;
62
+ const doc = docCommentBefore(declarations, start);
63
+ const body = classBody(declarations, start);
64
+ return {
65
+ name: symbol,
66
+ description: summaryOf(doc),
67
+ example: tagOf(doc, 'example'),
68
+ docs: tagOf(doc, 'see'),
69
+ members: body === null ? [] : membersOf(body, bindings(body)),
70
+ };
71
+ }
72
+ /** Every class the file declares, `abstract` ones included. */
73
+ function declaredClasses(declarations) {
74
+ return [...declarations.matchAll(/declare (?:abstract )?class (\w+)/g)].map(match => match[1]);
75
+ }
76
+ /** Where `declare class X` / `declare abstract class X` begins, or -1. */
77
+ function findClass(source, symbol) {
78
+ return source.search(new RegExp(`declare (?:abstract )?class ${escapeRegExp(symbol)}\\b`));
79
+ }
80
+ /**
81
+ * The `{ … }` of the class at `start`, brace-matched.
82
+ *
83
+ * The opening brace is found at angle-depth zero, because
84
+ * `declare class WrA<T extends { id: string }>` puts one in the type parameters —
85
+ * and taking the first `{` there made a constraint's members the class's own: the
86
+ * component's real API vanished and `id: string` was reported in its place.
87
+ */
88
+ function classBody(source, start) {
89
+ const open = bodyBrace(source, start);
90
+ if (open === -1)
91
+ return null;
92
+ let depth = 0;
93
+ for (let i = open; i < source.length; i++) {
94
+ if (source[i] === '{')
95
+ depth++;
96
+ if (source[i] === '}') {
97
+ depth--;
98
+ if (depth === 0)
99
+ return source.slice(open + 1, i);
100
+ }
101
+ }
102
+ return null;
103
+ }
104
+ /** The index of the brace that opens a class body, skipping any in its header. */
105
+ function bodyBrace(source, start) {
106
+ let angles = 0;
107
+ for (let i = start; i < source.length; i++) {
108
+ const char = source[i];
109
+ if (char === '<')
110
+ angles++;
111
+ if (char === '>' && source[i - 1] !== '=')
112
+ angles--;
113
+ if (char === '{' && angles <= 0)
114
+ return i;
115
+ }
116
+ return -1;
117
+ }
118
+ /** The JSDoc block immediately above a declaration, if there is one. */
119
+ function docCommentBefore(source, at) {
120
+ const before = source.slice(0, at);
121
+ const close = before.lastIndexOf('*/');
122
+ if (close === -1)
123
+ return '';
124
+ // Only when nothing but whitespace separates them — otherwise it belongs to
125
+ // whatever came in between.
126
+ if (before.slice(close + 2).trim() !== '')
127
+ return '';
128
+ const open = before.lastIndexOf('/**', close);
129
+ return open === -1 ? '' : before.slice(open, close + 2);
130
+ }
131
+ /**
132
+ * The tags this reads. A closed set, deliberately.
133
+ *
134
+ * Only these open a tag block, and only outside a fenced code sample. Both halves
135
+ * were learned from live output. A tag body that begins on the next line used to
136
+ * capture nothing, because the terminator was `$` under the `m` flag — so
137
+ * `@example` was `null` for 273 of 276 classes. And once that was fixed, ANY line
138
+ * starting `@word` ended a body, which in a library that documents Angular
139
+ * templates means `@for` / `@if` / `@defer` inside a code fence: `WrRange`'s whole
140
+ * example collapsed to an unterminated ```html and `WrRotatingText` lost the five
141
+ * lines that demonstrate its API.
142
+ */
143
+ const KNOWN_TAGS = new Set([
144
+ 'default',
145
+ 'defaultValue',
146
+ 'example',
147
+ 'see',
148
+ 'param',
149
+ 'returns',
150
+ 'throws',
151
+ 'deprecated',
152
+ 'internal',
153
+ 'remarks',
154
+ 'since',
155
+ ]);
156
+ /** Splits an inline `… @default false` onto its own line, so one walker sees both. */
157
+ const INLINE_TAG = /\s+@([a-zA-Z]+)\b/;
158
+ /** A fence opens or closes a code sample, inside which nothing is a tag. */
159
+ const FENCE = /^\s*(?:```|~~~)/;
160
+ /** JSDoc furniture removed, nothing else interpreted. */
161
+ function docLines(doc) {
162
+ return doc
163
+ .replace(/^\s*\/\*\*/, '')
164
+ .replace(/\*\/\s*$/, '')
165
+ .split('\n')
166
+ .map(line => line.replace(/^\s*\* ?/, ''));
167
+ }
168
+ /**
169
+ * A doc comment as a summary plus its tags, in one fence-aware pass.
170
+ *
171
+ * The first occurrence of a tag wins, and a tag's body runs until the next tag at
172
+ * the top level — never into or out of a code fence.
173
+ */
174
+ function parseDoc(doc) {
175
+ const summary = [];
176
+ const tags = new Map();
177
+ let current = null;
178
+ let fenced = false;
179
+ for (const raw of docLines(doc)) {
180
+ if (FENCE.test(raw)) {
181
+ fenced = !fenced;
182
+ (current ?? summary).push(raw);
183
+ continue;
184
+ }
185
+ if (!fenced) {
186
+ // An inline tag becomes a tag and a body, so `/** Show it. @default false */`
187
+ // reads the same as the multi-line form.
188
+ const inline = INLINE_TAG.exec(raw);
189
+ if (inline && KNOWN_TAGS.has(inline[1]) && inline.index > 0) {
190
+ (current ?? summary).push(raw.slice(0, inline.index));
191
+ current = openTag(tags, inline[1]);
192
+ current.push(raw.slice(inline.index + inline[0].length));
193
+ continue;
194
+ }
195
+ const tag = /^@([a-zA-Z]+)\b/.exec(raw);
196
+ if (tag && KNOWN_TAGS.has(tag[1])) {
197
+ current = openTag(tags, tag[1]);
198
+ current.push(raw.slice(tag[0].length));
199
+ continue;
200
+ }
201
+ }
202
+ (current ?? summary).push(raw);
203
+ }
204
+ return {
205
+ summary: summary.join('\n').trim(),
206
+ tags: new Map([...tags].map(([name, body]) => [name, body.join('\n').trim()])),
207
+ };
208
+ }
209
+ /** First occurrence wins — a repeated tag does not overwrite the one that counts. */
210
+ function openTag(tags, name) {
211
+ const existing = tags.get(name);
212
+ if (existing)
213
+ return existing;
214
+ const body = [];
215
+ tags.set(name, body);
216
+ return body;
217
+ }
218
+ /** Everything before the first tag. */
219
+ function summaryOf(doc) {
220
+ return parseDoc(doc).summary;
221
+ }
222
+ /** The body of one tag, however many lines it runs to, or `null`. */
223
+ function tagOf(doc, tag) {
224
+ const body = parseDoc(doc).tags.get(tag) ?? '';
225
+ // An empty body reads as absent — `@default` with nothing after it says nothing.
226
+ return body === '' ? null : body;
227
+ }
228
+ /**
229
+ * The input map Angular emits into `ɵcmp` / `ɵdir`.
230
+ *
231
+ * The only place required-ness is actually written down. Inferring it from the
232
+ * member's type does not work — `input()` and `input.required()` both emit
233
+ * `InputSignal<T>`, so the first attempt marked EVERY input required, including
234
+ * the five on `wr-alert` that have defaults. The declaration also carries the
235
+ * alias, which is the name a template binds when it differs from the property.
236
+ */
237
+ function bindings(body) {
238
+ const map = new Map();
239
+ // Each entry read as an object, with its keys in ANY order. Pinning the order
240
+ // to `alias` then `required` happened to match all 144 maps in the catalog
241
+ // today — and a compiler that emitted `isSignal` between them would have
242
+ // reported every required input as optional, from the file this function's own
243
+ // comment calls the only place required-ness is written down.
244
+ const entry = /"([^"]+)":\s*\{([^}]*)\}/g;
245
+ for (const [, name, fields] of body.matchAll(entry)) {
246
+ const alias = /"alias":\s*"([^"]*)"/.exec(fields);
247
+ const required = /"required":\s*(true|false)/.exec(fields);
248
+ if (!alias || !required)
249
+ continue;
250
+ map.set(name, { alias: alias[1], required: required[1] === 'true' });
251
+ }
252
+ return map;
253
+ }
254
+ /**
255
+ * Public members of a class body, read one declaration at a time.
256
+ *
257
+ * The scanner walks the body rather than matching it: comments are consumed as
258
+ * comments, a declaration ends at the first `;` outside every bracket and string,
259
+ * and a member the scanner cannot classify is skipped WITHOUT disturbing the ones
260
+ * around it. That last property is the one a single pattern could not offer.
261
+ */
262
+ function membersOf(body, declared) {
263
+ const members = [];
264
+ let doc = '';
265
+ let i = 0;
266
+ while (i < body.length) {
267
+ const char = body[i];
268
+ if (char === '/' && body[i + 1] === '*') {
269
+ const close = body.indexOf('*/', i + 2);
270
+ const comment = body.slice(i, close === -1 ? body.length : close + 2);
271
+ // Only a `/** … */` block documents the member after it.
272
+ doc = comment.startsWith('/**') ? comment : '';
273
+ i = close === -1 ? body.length : close + 2;
274
+ continue;
275
+ }
276
+ if (char === '/' && body[i + 1] === '/') {
277
+ const newline = body.indexOf('\n', i);
278
+ i = newline === -1 ? body.length : newline + 1;
279
+ continue;
280
+ }
281
+ if (/\s/.test(char)) {
282
+ i++;
283
+ continue;
284
+ }
285
+ const end = declarationEnd(body, i);
286
+ const member = parseMember(body.slice(i, end), doc, declared);
287
+ if (member)
288
+ members.push(member);
289
+ doc = '';
290
+ i = end + 1;
291
+ }
292
+ return members;
293
+ }
294
+ /** The index of the `;` that ends the declaration starting at `from`. */
295
+ function declarationEnd(body, from) {
296
+ let depth = 0;
297
+ let quote = '';
298
+ for (let i = from; i < body.length; i++) {
299
+ const char = body[i];
300
+ if (quote) {
301
+ if (char === '\\')
302
+ i++;
303
+ else if (char === quote)
304
+ quote = '';
305
+ continue;
306
+ }
307
+ // Comments are not code. An apostrophe in a JSDoc INSIDE a declaration used
308
+ // to open a string that never closed, so no `;` was ever found at depth zero
309
+ // and the rest of the class body became one member — a 241,013-character
310
+ // "type" in the worst case. That is the pre-rewrite failure mode arriving
311
+ // through a different door.
312
+ if (char === '/' && body[i + 1] === '*') {
313
+ const close = body.indexOf('*/', i + 2);
314
+ i = close === -1 ? body.length : close + 1;
315
+ continue;
316
+ }
317
+ if (char === '/' && body[i + 1] === '/') {
318
+ const newline = body.indexOf('\n', i);
319
+ i = newline === -1 ? body.length : newline;
320
+ continue;
321
+ }
322
+ if (char === '"' || char === "'" || char === '`') {
323
+ quote = char;
324
+ continue;
325
+ }
326
+ if (char === '(' || char === '[' || char === '{' || char === '<')
327
+ depth++;
328
+ // `=>` is not a closing angle bracket, and reading it as one truncated nine
329
+ // binding types into TypeScript that does not parse.
330
+ if (char === ')' || char === ']' || char === '}' || (char === '>' && body[i - 1] !== '='))
331
+ depth--;
332
+ if (char === ';' && depth <= 0)
333
+ return i;
334
+ }
335
+ return body.length;
336
+ }
337
+ /** One declaration's text as a member, or `null` when it is not public API. */
338
+ function parseMember(text, doc, declared) {
339
+ const words = [];
340
+ let rest = text.trim();
341
+ // Leading modifiers, in whatever order they were written.
342
+ for (;;) {
343
+ const match = /^([A-Za-z]+)\s+/.exec(rest);
344
+ if (!match || !MODIFIERS.has(match[1]))
345
+ break;
346
+ words.push(match[1]);
347
+ rest = rest.slice(match[0].length);
348
+ }
349
+ if (words.some(word => HIDDEN.has(word)))
350
+ return null;
351
+ // `@internal` is the library saying "this is not for you" about a member that
352
+ // is `public` only because TypeScript needed it to be. Nine ship. Read as
353
+ // a TAG, not as a line match: prose inside an `@example` that began with the
354
+ // word deleted the member it was documenting.
355
+ if (parseDoc(doc).tags.has('internal'))
356
+ return null;
357
+ const accessor = /^(get|set)\s+/.exec(rest);
358
+ if (accessor)
359
+ rest = rest.slice(accessor[0].length);
360
+ // A `get`/`set` pair is ONE property to a reader, and the getter is the half
361
+ // that carries the type: reporting both gave two members of the same name, the
362
+ // setter's typed `unknown`.
363
+ if (accessor?.[1] === 'set')
364
+ return null;
365
+ const named = /^(#?[A-Za-z_$][\w$]*)(\?)?/.exec(rest);
366
+ // Index signatures, computed names, `#private` fields — not API.
367
+ if (!named || named[1].startsWith('#'))
368
+ return null;
369
+ const name = named[1];
370
+ // `ɵcmp` / `ɵfac` are the compiler's, and a constructor is not something a
371
+ // consumer of an Angular class ever calls — 92 of them were being listed as
372
+ // methods with a return type of `unknown`.
373
+ if (name.startsWith('ɵ') || name === 'constructor')
374
+ return null;
375
+ rest = rest.slice(named[0].length).trim();
376
+ // A method may carry generics and a parameter list before its return type.
377
+ const callable = rest.startsWith('<') || rest.startsWith('(');
378
+ const signature = callable ? rest.slice(0, rest.length - afterSignature(rest).length).trim() : '';
379
+ if (callable)
380
+ rest = afterSignature(rest);
381
+ const colon = rest.indexOf(':');
382
+ const type = colon === -1 ? 'unknown' : collapse(rest.slice(colon + 1));
383
+ const wrapper = SIGNAL_WRAPPER.exec(type);
384
+ const binding = declared.get(name);
385
+ return {
386
+ // A method carries its signature, because that is what a caller has to know.
387
+ // A getter does not: `get componentInstance(): C` is read as a property, and
388
+ // naming it `componentInstance()` invites a call that does not exist.
389
+ name: callable && signature && !accessor ? `${name}${collapse(signature)}` : name,
390
+ // A getter is a property to anyone reading it, whatever it compiles to.
391
+ kind: accessor ? 'property' : kindOf(wrapper?.[1], callable),
392
+ type: unwrap(type),
393
+ description: summaryOf(doc),
394
+ default: tagOf(doc, 'default'),
395
+ required: binding?.required ?? false,
396
+ alias: binding && binding.alias !== name ? binding.alias : null,
397
+ };
398
+ }
399
+ /** Past a member's `<generics>(parameters)`, to whatever follows. */
400
+ function afterSignature(rest) {
401
+ let depth = 0;
402
+ for (let i = 0; i < rest.length; i++) {
403
+ const char = rest[i];
404
+ if (char === '(' || char === '<')
405
+ depth++;
406
+ if (char === ')' || (char === '>' && rest[i - 1] !== '=')) {
407
+ depth--;
408
+ if (depth === 0 && char === ')')
409
+ return rest.slice(i + 1).trim();
410
+ }
411
+ }
412
+ return rest;
413
+ }
414
+ function kindOf(wrapper, callable) {
415
+ if (wrapper === 'OutputEmitterRef')
416
+ return 'output';
417
+ if (wrapper === 'ModelSignal')
418
+ return 'model';
419
+ if (wrapper?.startsWith('InputSignal'))
420
+ return 'input';
421
+ return callable ? 'method' : 'property';
422
+ }
423
+ /** `InputSignal<'sm' | 'md'>` reads as `'sm' | 'md'` — the type a template binds. */
424
+ function unwrap(type) {
425
+ const match = SIGNAL_WRAPPER.exec(type);
426
+ if (!match)
427
+ return type;
428
+ const inner = balanced(type.slice(match[0].length));
429
+ // `InputSignalWithTransform<T, TransformT>` — the first argument is the value.
430
+ return splitTopLevel(inner)[0].trim();
431
+ }
432
+ /**
433
+ * Up to the `>` that closes the wrapper, counting nesting and ignoring `=>`.
434
+ *
435
+ * Quote-aware, like {@link declarationEnd}: a string-literal type is allowed to
436
+ * contain the very characters this counts. `InputSignal<', ' | ' | '>` reported a
437
+ * type of `'` before this tracked them.
438
+ */
439
+ function balanced(source) {
440
+ let depth = 1;
441
+ let quote = '';
442
+ for (let i = 0; i < source.length; i++) {
443
+ const char = source[i];
444
+ if (quote) {
445
+ if (char === '\\')
446
+ i++;
447
+ else if (char === quote)
448
+ quote = '';
449
+ continue;
450
+ }
451
+ if (char === '"' || char === "'" || char === '`') {
452
+ quote = char;
453
+ continue;
454
+ }
455
+ if (char === '<')
456
+ depth++;
457
+ if (char === '>' && source[i - 1] !== '=') {
458
+ depth--;
459
+ if (depth === 0)
460
+ return source.slice(0, i);
461
+ }
462
+ }
463
+ return source;
464
+ }
465
+ /** Split on commas that sit outside every bracket and every string. */
466
+ function splitTopLevel(source) {
467
+ const parts = [];
468
+ let depth = 0;
469
+ let quote = '';
470
+ let current = '';
471
+ for (let i = 0; i < source.length; i++) {
472
+ const char = source[i];
473
+ if (quote) {
474
+ if (char === '\\') {
475
+ current += char + (source[i + 1] ?? '');
476
+ i++;
477
+ continue;
478
+ }
479
+ if (char === quote)
480
+ quote = '';
481
+ current += char;
482
+ continue;
483
+ }
484
+ if (char === '"' || char === "'" || char === '`')
485
+ quote = char;
486
+ if (char === '<' || char === '(' || char === '[' || char === '{')
487
+ depth++;
488
+ if (char === ')' || char === ']' || char === '}' || (char === '>' && source[i - 1] !== '='))
489
+ depth--;
490
+ if (char === ',' && depth === 0 && !quote) {
491
+ parts.push(current);
492
+ current = '';
493
+ continue;
494
+ }
495
+ current += char;
496
+ }
497
+ parts.push(current);
498
+ return parts;
499
+ }
500
+ /** A type as one line, with any comment inside it removed. */
501
+ function collapse(type) {
502
+ return type
503
+ .replace(/\/\*[\s\S]*?\*\//g, '')
504
+ .replace(/\/\/[^\n]*/g, '')
505
+ .replace(/\s+/g, ' ')
506
+ .replace(/\{ /g, '{ ')
507
+ .trim();
508
+ }
509
+ function escapeRegExp(value) {
510
+ return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
511
+ }
512
+ export { declaredClasses, extractClass };
package/mcp/catalog.js ADDED
@@ -0,0 +1,157 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Use of this source code is governed by an MIT-style license that can be
5
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
6
+ */
7
+ import { existsSync, readFileSync } from 'node:fs';
8
+ import { dirname, join } from 'node:path';
9
+ import { fileURLToPath } from 'node:url';
10
+ /**
11
+ * The catalog, read from the files the package already ships.
12
+ *
13
+ * **No second copy of anything, and that is the design constraint this whole
14
+ * server was built under.** `llms-full.txt` (51 KB, 166 entry points) and
15
+ * `schematics/use/symbol-map.json` (215 symbols) are already in the tarball for
16
+ * other reasons, and the `.d.ts` bundle carries every signature. A server that
17
+ * embedded its own index would be a fourth copy to keep in step with the library,
18
+ * and the first one to go stale.
19
+ *
20
+ * What it adds on top is the part none of those files have: a way to ASK. An
21
+ * agent that does not already know an entry point's name cannot use a `.d.ts`,
22
+ * and reading 51 KB of catalog to answer "what renders markdown" is the cost this
23
+ * exists to remove.
24
+ */
25
+ class Catalog {
26
+ root;
27
+ entries = null;
28
+ symbols = null;
29
+ exports = null;
30
+ constructor(root) {
31
+ this.root = root ?? defaultRoot();
32
+ }
33
+ /** Every entry point, in catalog order. */
34
+ all() {
35
+ this.entries ??= parseCatalog(this.read('llms-full.txt'));
36
+ return this.entries;
37
+ }
38
+ /** Symbol name to entry point path, from the schematics' own map. */
39
+ symbolMap() {
40
+ if (this.symbols)
41
+ return this.symbols;
42
+ const raw = this.read(join('schematics', 'use', 'symbol-map.json'));
43
+ // A null prototype, because this map is looked up with a caller's string:
44
+ // `find('constructor')` on a plain object returns a FUNCTION, and the next
45
+ // line called `.toLowerCase()` on it and threw.
46
+ const parsed = raw ? JSON.parse(raw) : {};
47
+ const map = Object.assign(Object.create(null), parsed);
48
+ this.symbols = map;
49
+ return map;
50
+ }
51
+ /**
52
+ * Does this entry point ship a stylesheet?
53
+ *
54
+ * Read from the package's own `exports` map rather than assumed: 58 of the 166
55
+ * entry points ship no `styles/_index.scss` — the testing harnesses, the
56
+ * services, the adapters — and telling a consumer to `@use` one of those breaks
57
+ * their Sass build.
58
+ */
59
+ hasStyles(path) {
60
+ this.exports ??= (() => {
61
+ const raw = this.read('package.json');
62
+ const parsed = raw ? JSON.parse(raw) : {};
63
+ return parsed.exports ?? {};
64
+ })();
65
+ const entry = this.exports[`.${path.slice('ngwr'.length)}`];
66
+ return typeof entry === 'object' && entry !== null && 'sass' in entry;
67
+ }
68
+ /** An entry point by `ngwr/select`, by `select`, or by any symbol it exports. */
69
+ find(query) {
70
+ const wanted = query.trim();
71
+ const mapped = this.symbolMap()[wanted];
72
+ const path = typeof mapped === 'string' ? mapped : undefined;
73
+ const normalised = (path ?? (wanted.startsWith('ngwr/') ? wanted : `ngwr/${wanted}`)).toLowerCase();
74
+ return (this.all().find(entry => entry.path.toLowerCase() === normalised) ??
75
+ this.all().find(entry => entry.exports.some(name => name.toLowerCase() === wanted.toLowerCase())) ??
76
+ this.all().find(entry => entry.selectors.some(selector => selector === wanted)) ??
77
+ null);
78
+ }
79
+ /**
80
+ * The version of the package this server is part of.
81
+ *
82
+ * From its own `package.json`, NOT from `npm_package_version` — npx sets that
83
+ * from the project that INVOKED the server, so a consumer app saw its own
84
+ * version reported back as the catalog's. Only an install test catches that:
85
+ * in the repo the two happen to be the same file.
86
+ */
87
+ version() {
88
+ const raw = this.read('package.json');
89
+ const parsed = raw ? JSON.parse(raw) : {};
90
+ return parsed.version ?? '0.0.0';
91
+ }
92
+ /** The bundled declarations for an entry point, or `null` when not shipped. */
93
+ types(path) {
94
+ const file = join('types', `${path.replace(/\//g, '-')}.d.ts`);
95
+ return this.read(file);
96
+ }
97
+ read(relative) {
98
+ const file = join(this.root, relative);
99
+ return existsSync(file) ? readFileSync(file, 'utf8') : null;
100
+ }
101
+ }
102
+ /**
103
+ * The installed package root, from this file's own location.
104
+ *
105
+ * `dist/lib/mcp/server.js` at runtime, `projects/lib/mcp/` in the repo — one level
106
+ * up either way, which is what makes the same code testable in place and correct
107
+ * once published.
108
+ */
109
+ function defaultRoot() {
110
+ return dirname(dirname(fileURLToPath(import.meta.url)));
111
+ }
112
+ /**
113
+ * `llms-full.txt` into entries.
114
+ *
115
+ * The generator's format is fixed and checked by `pnpm check:llms`, so parsing it
116
+ * is a contract between two files in the same repo rather than a guess at someone
117
+ * else's output.
118
+ */
119
+ function parseCatalog(source) {
120
+ if (!source)
121
+ return [];
122
+ const entries = [];
123
+ for (const section of source.split(/^## /m).slice(1)) {
124
+ const [heading, ...lines] = section.split('\n');
125
+ const path = heading.trim();
126
+ if (!path.startsWith('ngwr/'))
127
+ continue;
128
+ const field = (label) => lines
129
+ .find(line => line.startsWith(`- ${label}:`))
130
+ ?.slice(label.length + 4)
131
+ .trim() ?? '';
132
+ // The description is the one bullet with no `label:` prefix.
133
+ const description = lines
134
+ .filter(line => line.startsWith('- ') && !/^- [a-z]+:/.test(line))
135
+ .map(line => line.slice(2).trim())
136
+ .join(' ') || '';
137
+ entries.push({
138
+ path,
139
+ name: path.slice('ngwr/'.length),
140
+ import: unquote(field('import')),
141
+ selectors: unquote(field('selector'))
142
+ .split(',')
143
+ .map(selector => selector.trim().replace(/`/g, ''))
144
+ .filter(Boolean),
145
+ exports: field('exports')
146
+ .split(',')
147
+ .map(name => name.trim())
148
+ .filter(Boolean),
149
+ description,
150
+ });
151
+ }
152
+ return entries;
153
+ }
154
+ function unquote(value) {
155
+ return value.replace(/`/g, '').trim();
156
+ }
157
+ export { Catalog, parseCatalog };