@frontmcp/ui 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (445) hide show
  1. package/README.md +140 -362
  2. package/bridge/runtime/index.d.ts +2 -1
  3. package/bridge/runtime/index.d.ts.map +1 -1
  4. package/bundler/file-cache/component-builder.d.ts +1 -1
  5. package/bundler/file-cache/component-builder.d.ts.map +1 -1
  6. package/bundler/file-cache/hash-calculator.d.ts +1 -1
  7. package/bundler/file-cache/hash-calculator.d.ts.map +1 -1
  8. package/bundler/file-cache/storage/filesystem.d.ts +1 -1
  9. package/bundler/file-cache/storage/filesystem.d.ts.map +1 -1
  10. package/bundler/file-cache/storage/interface.d.ts +1 -1
  11. package/bundler/file-cache/storage/interface.d.ts.map +1 -1
  12. package/bundler/file-cache/storage/redis.d.ts +1 -1
  13. package/bundler/file-cache/storage/redis.d.ts.map +1 -1
  14. package/bundler/index.js +10 -1057
  15. package/components/alert.schema.d.ts +6 -6
  16. package/components/avatar.schema.d.ts +9 -9
  17. package/components/badge.schema.d.ts +9 -9
  18. package/components/button.schema.d.ts +9 -9
  19. package/components/card.schema.d.ts +7 -7
  20. package/components/form.schema.d.ts +24 -24
  21. package/components/index.js +128 -198
  22. package/components/modal.schema.d.ts +8 -8
  23. package/components/table.schema.d.ts +6 -6
  24. package/esm/bridge/runtime/index.d.ts +2 -1
  25. package/esm/bridge/runtime/index.d.ts.map +1 -1
  26. package/esm/bundler/file-cache/component-builder.d.ts +1 -1
  27. package/esm/bundler/file-cache/component-builder.d.ts.map +1 -1
  28. package/esm/bundler/file-cache/hash-calculator.d.ts +1 -1
  29. package/esm/bundler/file-cache/hash-calculator.d.ts.map +1 -1
  30. package/esm/bundler/file-cache/storage/filesystem.d.ts +1 -1
  31. package/esm/bundler/file-cache/storage/filesystem.d.ts.map +1 -1
  32. package/esm/bundler/file-cache/storage/interface.d.ts +1 -1
  33. package/esm/bundler/file-cache/storage/interface.d.ts.map +1 -1
  34. package/esm/bundler/file-cache/storage/redis.d.ts +1 -1
  35. package/esm/bundler/file-cache/storage/redis.d.ts.map +1 -1
  36. package/esm/bundler/index.js +3 -1050
  37. package/esm/components/alert.schema.d.ts +6 -6
  38. package/esm/components/avatar.schema.d.ts +9 -9
  39. package/esm/components/badge.schema.d.ts +9 -9
  40. package/esm/components/button.schema.d.ts +9 -9
  41. package/esm/components/card.schema.d.ts +7 -7
  42. package/esm/components/form.schema.d.ts +24 -24
  43. package/esm/components/index.js +136 -196
  44. package/esm/components/modal.schema.d.ts +8 -8
  45. package/esm/components/table.schema.d.ts +6 -6
  46. package/esm/index.d.ts +23 -39
  47. package/esm/index.d.ts.map +1 -1
  48. package/esm/index.js +4256 -16441
  49. package/esm/layouts/base.d.ts +2 -2
  50. package/esm/layouts/base.d.ts.map +1 -1
  51. package/esm/layouts/index.js +33 -516
  52. package/esm/package.json +8 -26
  53. package/esm/pages/index.js +100 -627
  54. package/esm/react/Alert.d.ts +1 -2
  55. package/esm/react/Alert.d.ts.map +1 -1
  56. package/esm/react/Badge.d.ts +1 -2
  57. package/esm/react/Badge.d.ts.map +1 -1
  58. package/esm/react/Button.d.ts +1 -2
  59. package/esm/react/Button.d.ts.map +1 -1
  60. package/esm/react/Card.d.ts +1 -2
  61. package/esm/react/Card.d.ts.map +1 -1
  62. package/esm/react/hooks/context.d.ts +1 -1
  63. package/esm/react/hooks/context.d.ts.map +1 -1
  64. package/esm/react/index.d.ts +5 -6
  65. package/esm/react/index.d.ts.map +1 -1
  66. package/esm/react/index.js +2074 -322
  67. package/esm/react/types.d.ts +1 -2
  68. package/esm/react/types.d.ts.map +1 -1
  69. package/esm/renderers/index.d.ts +10 -25
  70. package/esm/renderers/index.d.ts.map +1 -1
  71. package/esm/renderers/index.js +171 -1617
  72. package/esm/{runtime/adapters → renderers}/react.adapter.d.ts +2 -2
  73. package/esm/renderers/react.adapter.d.ts.map +1 -0
  74. package/esm/renderers/react.renderer.d.ts +3 -3
  75. package/esm/renderers/react.renderer.d.ts.map +1 -1
  76. package/esm/universal/index.js +1755 -0
  77. package/esm/web-components/index.js +232 -287
  78. package/esm/widgets/index.js +89 -147
  79. package/index.d.ts +23 -39
  80. package/index.d.ts.map +1 -1
  81. package/index.js +6123 -18539
  82. package/layouts/base.d.ts +2 -2
  83. package/layouts/base.d.ts.map +1 -1
  84. package/layouts/index.js +43 -536
  85. package/package.json +8 -26
  86. package/pages/index.js +111 -648
  87. package/react/Alert.d.ts +1 -2
  88. package/react/Alert.d.ts.map +1 -1
  89. package/react/Badge.d.ts +1 -2
  90. package/react/Badge.d.ts.map +1 -1
  91. package/react/Button.d.ts +1 -2
  92. package/react/Button.d.ts.map +1 -1
  93. package/react/Card.d.ts +1 -2
  94. package/react/Card.d.ts.map +1 -1
  95. package/react/hooks/context.d.ts +1 -1
  96. package/react/hooks/context.d.ts.map +1 -1
  97. package/react/index.d.ts +5 -6
  98. package/react/index.d.ts.map +1 -1
  99. package/react/index.js +2065 -335
  100. package/react/types.d.ts +1 -2
  101. package/react/types.d.ts.map +1 -1
  102. package/renderers/index.d.ts +10 -25
  103. package/renderers/index.d.ts.map +1 -1
  104. package/renderers/index.js +175 -1641
  105. package/{runtime/adapters → renderers}/react.adapter.d.ts +2 -2
  106. package/renderers/react.adapter.d.ts.map +1 -0
  107. package/renderers/react.renderer.d.ts +3 -3
  108. package/renderers/react.renderer.d.ts.map +1 -1
  109. package/universal/index.js +1841 -0
  110. package/web-components/index.js +224 -289
  111. package/widgets/index.js +80 -148
  112. package/adapters/index.d.ts +0 -13
  113. package/adapters/index.d.ts.map +0 -1
  114. package/adapters/index.js +0 -462
  115. package/adapters/platform-meta.d.ts +0 -166
  116. package/adapters/platform-meta.d.ts.map +0 -1
  117. package/adapters/response-builder.d.ts +0 -108
  118. package/adapters/response-builder.d.ts.map +0 -1
  119. package/adapters/serving-mode.d.ts +0 -107
  120. package/adapters/serving-mode.d.ts.map +0 -1
  121. package/base-template/bridge.d.ts +0 -90
  122. package/base-template/bridge.d.ts.map +0 -1
  123. package/base-template/default-base-template.d.ts +0 -92
  124. package/base-template/default-base-template.d.ts.map +0 -1
  125. package/base-template/index.d.ts +0 -15
  126. package/base-template/index.d.ts.map +0 -1
  127. package/base-template/index.js +0 -1398
  128. package/base-template/polyfills.d.ts +0 -31
  129. package/base-template/polyfills.d.ts.map +0 -1
  130. package/base-template/theme-styles.d.ts +0 -74
  131. package/base-template/theme-styles.d.ts.map +0 -1
  132. package/build/cdn-resources.d.ts +0 -243
  133. package/build/cdn-resources.d.ts.map +0 -1
  134. package/build/index.d.ts +0 -295
  135. package/build/index.d.ts.map +0 -1
  136. package/build/index.js +0 -7096
  137. package/build/widget-manifest.d.ts +0 -362
  138. package/build/widget-manifest.d.ts.map +0 -1
  139. package/dependency/cdn-registry.d.ts +0 -98
  140. package/dependency/cdn-registry.d.ts.map +0 -1
  141. package/dependency/import-map.d.ts +0 -186
  142. package/dependency/import-map.d.ts.map +0 -1
  143. package/dependency/import-parser.d.ts +0 -82
  144. package/dependency/import-parser.d.ts.map +0 -1
  145. package/dependency/index.d.ts +0 -17
  146. package/dependency/index.d.ts.map +0 -1
  147. package/dependency/resolver.d.ts +0 -164
  148. package/dependency/resolver.d.ts.map +0 -1
  149. package/dependency/schemas.d.ts +0 -486
  150. package/dependency/schemas.d.ts.map +0 -1
  151. package/dependency/template-loader.d.ts +0 -204
  152. package/dependency/template-loader.d.ts.map +0 -1
  153. package/dependency/template-processor.d.ts +0 -118
  154. package/dependency/template-processor.d.ts.map +0 -1
  155. package/dependency/types.d.ts +0 -739
  156. package/dependency/types.d.ts.map +0 -1
  157. package/esm/adapters/index.d.ts +0 -13
  158. package/esm/adapters/index.d.ts.map +0 -1
  159. package/esm/adapters/index.js +0 -427
  160. package/esm/adapters/platform-meta.d.ts +0 -166
  161. package/esm/adapters/platform-meta.d.ts.map +0 -1
  162. package/esm/adapters/response-builder.d.ts +0 -108
  163. package/esm/adapters/response-builder.d.ts.map +0 -1
  164. package/esm/adapters/serving-mode.d.ts +0 -107
  165. package/esm/adapters/serving-mode.d.ts.map +0 -1
  166. package/esm/base-template/bridge.d.ts +0 -90
  167. package/esm/base-template/bridge.d.ts.map +0 -1
  168. package/esm/base-template/default-base-template.d.ts +0 -92
  169. package/esm/base-template/default-base-template.d.ts.map +0 -1
  170. package/esm/base-template/index.d.ts +0 -15
  171. package/esm/base-template/index.d.ts.map +0 -1
  172. package/esm/base-template/index.js +0 -1364
  173. package/esm/base-template/polyfills.d.ts +0 -31
  174. package/esm/base-template/polyfills.d.ts.map +0 -1
  175. package/esm/base-template/theme-styles.d.ts +0 -74
  176. package/esm/base-template/theme-styles.d.ts.map +0 -1
  177. package/esm/build/cdn-resources.d.ts +0 -243
  178. package/esm/build/cdn-resources.d.ts.map +0 -1
  179. package/esm/build/index.d.ts +0 -295
  180. package/esm/build/index.d.ts.map +0 -1
  181. package/esm/build/index.js +0 -7021
  182. package/esm/build/widget-manifest.d.ts +0 -362
  183. package/esm/build/widget-manifest.d.ts.map +0 -1
  184. package/esm/dependency/cdn-registry.d.ts +0 -98
  185. package/esm/dependency/cdn-registry.d.ts.map +0 -1
  186. package/esm/dependency/import-map.d.ts +0 -186
  187. package/esm/dependency/import-map.d.ts.map +0 -1
  188. package/esm/dependency/import-parser.d.ts +0 -82
  189. package/esm/dependency/import-parser.d.ts.map +0 -1
  190. package/esm/dependency/index.d.ts +0 -17
  191. package/esm/dependency/index.d.ts.map +0 -1
  192. package/esm/dependency/resolver.d.ts +0 -164
  193. package/esm/dependency/resolver.d.ts.map +0 -1
  194. package/esm/dependency/schemas.d.ts +0 -486
  195. package/esm/dependency/schemas.d.ts.map +0 -1
  196. package/esm/dependency/template-loader.d.ts +0 -204
  197. package/esm/dependency/template-loader.d.ts.map +0 -1
  198. package/esm/dependency/template-processor.d.ts +0 -118
  199. package/esm/dependency/template-processor.d.ts.map +0 -1
  200. package/esm/dependency/types.d.ts +0 -739
  201. package/esm/dependency/types.d.ts.map +0 -1
  202. package/esm/handlebars/expression-extractor.d.ts +0 -147
  203. package/esm/handlebars/expression-extractor.d.ts.map +0 -1
  204. package/esm/handlebars/helpers.d.ts +0 -339
  205. package/esm/handlebars/helpers.d.ts.map +0 -1
  206. package/esm/handlebars/index.d.ts +0 -195
  207. package/esm/handlebars/index.d.ts.map +0 -1
  208. package/esm/handlebars/index.js +0 -587
  209. package/esm/registry/index.d.ts +0 -46
  210. package/esm/registry/index.d.ts.map +0 -1
  211. package/esm/registry/index.js +0 -6422
  212. package/esm/registry/render-template.d.ts +0 -91
  213. package/esm/registry/render-template.d.ts.map +0 -1
  214. package/esm/registry/tool-ui.registry.d.ts +0 -294
  215. package/esm/registry/tool-ui.registry.d.ts.map +0 -1
  216. package/esm/registry/uri-utils.d.ts +0 -56
  217. package/esm/registry/uri-utils.d.ts.map +0 -1
  218. package/esm/renderers/cache.d.ts +0 -145
  219. package/esm/renderers/cache.d.ts.map +0 -1
  220. package/esm/renderers/html.renderer.d.ts +0 -123
  221. package/esm/renderers/html.renderer.d.ts.map +0 -1
  222. package/esm/renderers/mdx.renderer.d.ts +0 -120
  223. package/esm/renderers/mdx.renderer.d.ts.map +0 -1
  224. package/esm/renderers/registry.d.ts +0 -134
  225. package/esm/renderers/registry.d.ts.map +0 -1
  226. package/esm/renderers/types.d.ts +0 -342
  227. package/esm/renderers/types.d.ts.map +0 -1
  228. package/esm/renderers/utils/detect.d.ts +0 -107
  229. package/esm/renderers/utils/detect.d.ts.map +0 -1
  230. package/esm/renderers/utils/hash.d.ts +0 -40
  231. package/esm/renderers/utils/hash.d.ts.map +0 -1
  232. package/esm/renderers/utils/index.d.ts +0 -9
  233. package/esm/renderers/utils/index.d.ts.map +0 -1
  234. package/esm/renderers/utils/transpiler.d.ts +0 -89
  235. package/esm/renderers/utils/transpiler.d.ts.map +0 -1
  236. package/esm/runtime/adapters/html.adapter.d.ts +0 -59
  237. package/esm/runtime/adapters/html.adapter.d.ts.map +0 -1
  238. package/esm/runtime/adapters/index.d.ts +0 -26
  239. package/esm/runtime/adapters/index.d.ts.map +0 -1
  240. package/esm/runtime/adapters/mdx.adapter.d.ts +0 -73
  241. package/esm/runtime/adapters/mdx.adapter.d.ts.map +0 -1
  242. package/esm/runtime/adapters/react.adapter.d.ts.map +0 -1
  243. package/esm/runtime/adapters/types.d.ts +0 -95
  244. package/esm/runtime/adapters/types.d.ts.map +0 -1
  245. package/esm/runtime/csp.d.ts +0 -48
  246. package/esm/runtime/csp.d.ts.map +0 -1
  247. package/esm/runtime/index.d.ts +0 -17
  248. package/esm/runtime/index.d.ts.map +0 -1
  249. package/esm/runtime/index.js +0 -5186
  250. package/esm/runtime/mcp-bridge.d.ts +0 -101
  251. package/esm/runtime/mcp-bridge.d.ts.map +0 -1
  252. package/esm/runtime/renderer-runtime.d.ts +0 -133
  253. package/esm/runtime/renderer-runtime.d.ts.map +0 -1
  254. package/esm/runtime/sanitizer.d.ts +0 -172
  255. package/esm/runtime/sanitizer.d.ts.map +0 -1
  256. package/esm/runtime/types.d.ts +0 -415
  257. package/esm/runtime/types.d.ts.map +0 -1
  258. package/esm/runtime/wrapper.d.ts +0 -421
  259. package/esm/runtime/wrapper.d.ts.map +0 -1
  260. package/esm/styles/index.d.ts +0 -8
  261. package/esm/styles/index.d.ts.map +0 -1
  262. package/esm/styles/index.js +0 -171
  263. package/esm/styles/variants.d.ts +0 -51
  264. package/esm/styles/variants.d.ts.map +0 -1
  265. package/esm/theme/cdn.d.ts +0 -195
  266. package/esm/theme/cdn.d.ts.map +0 -1
  267. package/esm/theme/index.d.ts +0 -18
  268. package/esm/theme/index.d.ts.map +0 -1
  269. package/esm/theme/index.js +0 -700
  270. package/esm/theme/platforms.d.ts +0 -107
  271. package/esm/theme/platforms.d.ts.map +0 -1
  272. package/esm/theme/presets/github-openai.d.ts +0 -50
  273. package/esm/theme/presets/github-openai.d.ts.map +0 -1
  274. package/esm/theme/presets/index.d.ts +0 -11
  275. package/esm/theme/presets/index.d.ts.map +0 -1
  276. package/esm/theme/theme.d.ts +0 -396
  277. package/esm/theme/theme.d.ts.map +0 -1
  278. package/esm/tool-template/builder.d.ts +0 -213
  279. package/esm/tool-template/builder.d.ts.map +0 -1
  280. package/esm/tool-template/index.d.ts +0 -16
  281. package/esm/tool-template/index.d.ts.map +0 -1
  282. package/esm/tool-template/index.js +0 -3515
  283. package/esm/types/index.d.ts +0 -14
  284. package/esm/types/index.d.ts.map +0 -1
  285. package/esm/types/index.js +0 -75
  286. package/esm/types/ui-config.d.ts +0 -639
  287. package/esm/types/ui-config.d.ts.map +0 -1
  288. package/esm/types/ui-runtime.d.ts +0 -1007
  289. package/esm/types/ui-runtime.d.ts.map +0 -1
  290. package/esm/typings/cache/cache-adapter.d.ts +0 -125
  291. package/esm/typings/cache/cache-adapter.d.ts.map +0 -1
  292. package/esm/typings/cache/index.d.ts +0 -10
  293. package/esm/typings/cache/index.d.ts.map +0 -1
  294. package/esm/typings/cache/memory-cache.d.ts +0 -92
  295. package/esm/typings/cache/memory-cache.d.ts.map +0 -1
  296. package/esm/typings/dts-parser.d.ts +0 -90
  297. package/esm/typings/dts-parser.d.ts.map +0 -1
  298. package/esm/typings/index.d.ts +0 -48
  299. package/esm/typings/index.d.ts.map +0 -1
  300. package/esm/typings/schemas.d.ts +0 -232
  301. package/esm/typings/schemas.d.ts.map +0 -1
  302. package/esm/typings/type-fetcher.d.ts +0 -89
  303. package/esm/typings/type-fetcher.d.ts.map +0 -1
  304. package/esm/typings/types.d.ts +0 -320
  305. package/esm/typings/types.d.ts.map +0 -1
  306. package/esm/utils/escape-html.d.ts +0 -58
  307. package/esm/utils/escape-html.d.ts.map +0 -1
  308. package/esm/utils/index.d.ts +0 -10
  309. package/esm/utils/index.d.ts.map +0 -1
  310. package/esm/utils/index.js +0 -40
  311. package/esm/utils/safe-stringify.d.ts +0 -30
  312. package/esm/utils/safe-stringify.d.ts.map +0 -1
  313. package/esm/validation/error-box.d.ts +0 -56
  314. package/esm/validation/error-box.d.ts.map +0 -1
  315. package/esm/validation/index.d.ts +0 -13
  316. package/esm/validation/index.d.ts.map +0 -1
  317. package/esm/validation/index.js +0 -562
  318. package/esm/validation/schema-paths.d.ts +0 -118
  319. package/esm/validation/schema-paths.d.ts.map +0 -1
  320. package/esm/validation/template-validator.d.ts +0 -143
  321. package/esm/validation/template-validator.d.ts.map +0 -1
  322. package/esm/validation/wrapper.d.ts +0 -97
  323. package/esm/validation/wrapper.d.ts.map +0 -1
  324. package/handlebars/expression-extractor.d.ts +0 -147
  325. package/handlebars/expression-extractor.d.ts.map +0 -1
  326. package/handlebars/helpers.d.ts +0 -339
  327. package/handlebars/helpers.d.ts.map +0 -1
  328. package/handlebars/index.d.ts +0 -195
  329. package/handlebars/index.d.ts.map +0 -1
  330. package/handlebars/index.js +0 -666
  331. package/registry/index.d.ts +0 -46
  332. package/registry/index.d.ts.map +0 -1
  333. package/registry/index.js +0 -6465
  334. package/registry/render-template.d.ts +0 -91
  335. package/registry/render-template.d.ts.map +0 -1
  336. package/registry/tool-ui.registry.d.ts +0 -294
  337. package/registry/tool-ui.registry.d.ts.map +0 -1
  338. package/registry/uri-utils.d.ts +0 -56
  339. package/registry/uri-utils.d.ts.map +0 -1
  340. package/renderers/cache.d.ts +0 -145
  341. package/renderers/cache.d.ts.map +0 -1
  342. package/renderers/html.renderer.d.ts +0 -123
  343. package/renderers/html.renderer.d.ts.map +0 -1
  344. package/renderers/mdx.renderer.d.ts +0 -120
  345. package/renderers/mdx.renderer.d.ts.map +0 -1
  346. package/renderers/registry.d.ts +0 -134
  347. package/renderers/registry.d.ts.map +0 -1
  348. package/renderers/types.d.ts +0 -342
  349. package/renderers/types.d.ts.map +0 -1
  350. package/renderers/utils/detect.d.ts +0 -107
  351. package/renderers/utils/detect.d.ts.map +0 -1
  352. package/renderers/utils/hash.d.ts +0 -40
  353. package/renderers/utils/hash.d.ts.map +0 -1
  354. package/renderers/utils/index.d.ts +0 -9
  355. package/renderers/utils/index.d.ts.map +0 -1
  356. package/renderers/utils/transpiler.d.ts +0 -89
  357. package/renderers/utils/transpiler.d.ts.map +0 -1
  358. package/runtime/adapters/html.adapter.d.ts +0 -59
  359. package/runtime/adapters/html.adapter.d.ts.map +0 -1
  360. package/runtime/adapters/index.d.ts +0 -26
  361. package/runtime/adapters/index.d.ts.map +0 -1
  362. package/runtime/adapters/mdx.adapter.d.ts +0 -73
  363. package/runtime/adapters/mdx.adapter.d.ts.map +0 -1
  364. package/runtime/adapters/react.adapter.d.ts.map +0 -1
  365. package/runtime/adapters/types.d.ts +0 -95
  366. package/runtime/adapters/types.d.ts.map +0 -1
  367. package/runtime/csp.d.ts +0 -48
  368. package/runtime/csp.d.ts.map +0 -1
  369. package/runtime/index.d.ts +0 -17
  370. package/runtime/index.d.ts.map +0 -1
  371. package/runtime/index.js +0 -5264
  372. package/runtime/mcp-bridge.d.ts +0 -101
  373. package/runtime/mcp-bridge.d.ts.map +0 -1
  374. package/runtime/renderer-runtime.d.ts +0 -133
  375. package/runtime/renderer-runtime.d.ts.map +0 -1
  376. package/runtime/sanitizer.d.ts +0 -172
  377. package/runtime/sanitizer.d.ts.map +0 -1
  378. package/runtime/types.d.ts +0 -415
  379. package/runtime/types.d.ts.map +0 -1
  380. package/runtime/wrapper.d.ts +0 -421
  381. package/runtime/wrapper.d.ts.map +0 -1
  382. package/styles/index.d.ts +0 -8
  383. package/styles/index.d.ts.map +0 -1
  384. package/styles/index.js +0 -222
  385. package/styles/variants.d.ts +0 -51
  386. package/styles/variants.d.ts.map +0 -1
  387. package/theme/cdn.d.ts +0 -195
  388. package/theme/cdn.d.ts.map +0 -1
  389. package/theme/index.d.ts +0 -18
  390. package/theme/index.d.ts.map +0 -1
  391. package/theme/index.js +0 -757
  392. package/theme/platforms.d.ts +0 -107
  393. package/theme/platforms.d.ts.map +0 -1
  394. package/theme/presets/github-openai.d.ts +0 -50
  395. package/theme/presets/github-openai.d.ts.map +0 -1
  396. package/theme/presets/index.d.ts +0 -11
  397. package/theme/presets/index.d.ts.map +0 -1
  398. package/theme/theme.d.ts +0 -396
  399. package/theme/theme.d.ts.map +0 -1
  400. package/tool-template/builder.d.ts +0 -213
  401. package/tool-template/builder.d.ts.map +0 -1
  402. package/tool-template/index.d.ts +0 -16
  403. package/tool-template/index.d.ts.map +0 -1
  404. package/tool-template/index.js +0 -3559
  405. package/types/index.d.ts +0 -14
  406. package/types/index.d.ts.map +0 -1
  407. package/types/index.js +0 -108
  408. package/types/ui-config.d.ts +0 -639
  409. package/types/ui-config.d.ts.map +0 -1
  410. package/types/ui-runtime.d.ts +0 -1007
  411. package/types/ui-runtime.d.ts.map +0 -1
  412. package/typings/cache/cache-adapter.d.ts +0 -125
  413. package/typings/cache/cache-adapter.d.ts.map +0 -1
  414. package/typings/cache/index.d.ts +0 -10
  415. package/typings/cache/index.d.ts.map +0 -1
  416. package/typings/cache/memory-cache.d.ts +0 -92
  417. package/typings/cache/memory-cache.d.ts.map +0 -1
  418. package/typings/dts-parser.d.ts +0 -90
  419. package/typings/dts-parser.d.ts.map +0 -1
  420. package/typings/index.d.ts +0 -48
  421. package/typings/index.d.ts.map +0 -1
  422. package/typings/schemas.d.ts +0 -232
  423. package/typings/schemas.d.ts.map +0 -1
  424. package/typings/type-fetcher.d.ts +0 -89
  425. package/typings/type-fetcher.d.ts.map +0 -1
  426. package/typings/types.d.ts +0 -320
  427. package/typings/types.d.ts.map +0 -1
  428. package/utils/escape-html.d.ts +0 -58
  429. package/utils/escape-html.d.ts.map +0 -1
  430. package/utils/index.d.ts +0 -10
  431. package/utils/index.d.ts.map +0 -1
  432. package/utils/index.js +0 -70
  433. package/utils/safe-stringify.d.ts +0 -30
  434. package/utils/safe-stringify.d.ts.map +0 -1
  435. package/validation/error-box.d.ts +0 -56
  436. package/validation/error-box.d.ts.map +0 -1
  437. package/validation/index.d.ts +0 -13
  438. package/validation/index.d.ts.map +0 -1
  439. package/validation/index.js +0 -603
  440. package/validation/schema-paths.d.ts +0 -118
  441. package/validation/schema-paths.d.ts.map +0 -1
  442. package/validation/template-validator.d.ts +0 -143
  443. package/validation/template-validator.d.ts.map +0 -1
  444. package/validation/wrapper.d.ts +0 -97
  445. package/validation/wrapper.d.ts.map +0 -1
@@ -1,700 +0,0 @@
1
- // libs/ui/src/theme/cdn.ts
2
- var CDN = {
3
- /**
4
- * Tailwind CSS v4 Browser CDN
5
- * Generates styles on-the-fly with @theme support
6
- * @see https://tailwindcss.com/docs/installation/play-cdn
7
- */
8
- tailwind: "https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4",
9
- /**
10
- * HTMX 2.x - High power tools for HTML
11
- * Enables AJAX, WebSockets, Server Sent Events directly in HTML
12
- * @see https://htmx.org
13
- */
14
- htmx: {
15
- url: "https://cdnjs.cloudflare.com/ajax/libs/htmx/2.0.7/htmx.min.js",
16
- integrity: "sha512-T6VLg/MJYMbLTmQ8VLvonbWg8VOvmDhXcOvHzCwo6ShdGuUU5SEcp1IAPXL4k9lVoMi8gRXl5K/S/zh43Y9rJA=="
17
- },
18
- /**
19
- * Alpine.js - Lightweight reactive framework
20
- * Used for more complex client-side interactions
21
- * @see https://alpinejs.dev
22
- */
23
- alpine: {
24
- url: "https://cdn.jsdelivr.net/npm/alpinejs@3.14.3/dist/cdn.min.js",
25
- integrity: "sha384-6zY8MFQJ/EqS1r4RJl+7j8rvZPuBWpT0RzWf+IFcKhxqUzQNmJzA1X1VEVZhYaEz"
26
- },
27
- /**
28
- * Google Fonts - Inter for modern UI typography
29
- */
30
- fonts: {
31
- preconnect: ["https://fonts.googleapis.com", "https://fonts.gstatic.com"],
32
- inter: "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap",
33
- mono: "https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap"
34
- },
35
- /**
36
- * Lucide Icons - Beautiful & consistent icons
37
- * @see https://lucide.dev
38
- */
39
- icons: {
40
- url: "https://cdn.jsdelivr.net/npm/lucide@0.294.0/dist/umd/lucide.min.js",
41
- integrity: "sha384-wpLmHb7v7V1LsEuTmPQ9tXqWZvTtRWWVqJuE+Yz6X0I6O2T6bHJVeXH1lVWqF4qE"
42
- }
43
- };
44
- var scriptCache = /* @__PURE__ */ new Map();
45
- async function fetchScript(url) {
46
- if (scriptCache.has(url)) {
47
- return scriptCache.get(url);
48
- }
49
- const response = await fetch(url);
50
- if (!response.ok) {
51
- throw new Error(`Failed to fetch script: ${url} (${response.status})`);
52
- }
53
- const content = await response.text();
54
- scriptCache.set(url, content);
55
- return content;
56
- }
57
- async function fetchAndCacheScripts(options = {}) {
58
- const { tailwind = true, htmx = true, alpine = false, icons = false } = options;
59
- const urls = [];
60
- if (tailwind) urls.push(CDN.tailwind);
61
- if (htmx) urls.push(CDN.htmx.url);
62
- if (alpine) urls.push(CDN.alpine.url);
63
- if (icons) urls.push(CDN.icons.url);
64
- await Promise.all(urls.map(fetchScript));
65
- return scriptCache;
66
- }
67
- function getCachedScript(url) {
68
- return scriptCache.get(url);
69
- }
70
- function isScriptCached(url) {
71
- return scriptCache.has(url);
72
- }
73
- function clearScriptCache() {
74
- scriptCache.clear();
75
- }
76
- function buildFontPreconnect() {
77
- return CDN.fonts.preconnect.map((url, i) => `<link rel="preconnect" href="${url}"${i > 0 ? " crossorigin" : ""}>`).join("\n ");
78
- }
79
- function buildFontStylesheets(options = {}) {
80
- const { inter = true, mono = false } = options;
81
- const links = [];
82
- if (inter) {
83
- links.push(`<link href="${CDN.fonts.inter}" rel="stylesheet">`);
84
- }
85
- if (mono) {
86
- links.push(`<link href="${CDN.fonts.mono}" rel="stylesheet">`);
87
- }
88
- return links.join("\n ");
89
- }
90
- function buildScriptTag(url, integrity, options = {}) {
91
- const attrs = [`src="${url}"`];
92
- if (integrity) {
93
- attrs.push(`integrity="${integrity}"`);
94
- attrs.push('crossorigin="anonymous"');
95
- }
96
- if (options.defer) attrs.push("defer");
97
- if (options.async) attrs.push("async");
98
- return `<script ${attrs.join(" ")}></script>`;
99
- }
100
- function buildInlineScriptTag(content) {
101
- return `<script>${content}</script>`;
102
- }
103
- function buildCdnScripts(options = {}) {
104
- const { tailwind = true, htmx = true, alpine = false, icons = false, inline = false } = options;
105
- const scripts = [];
106
- if (inline) {
107
- if (tailwind) {
108
- if (isScriptCached(CDN.tailwind)) {
109
- scripts.push(buildInlineScriptTag(getCachedScript(CDN.tailwind)));
110
- } else {
111
- console.warn(
112
- "[frontmcp/ui] Inline mode requested but Tailwind script not cached. Call fetchAndCacheScripts() first."
113
- );
114
- }
115
- }
116
- if (htmx) {
117
- if (isScriptCached(CDN.htmx.url)) {
118
- scripts.push(buildInlineScriptTag(getCachedScript(CDN.htmx.url)));
119
- } else {
120
- console.warn(
121
- "[frontmcp/ui] Inline mode requested but HTMX script not cached. Call fetchAndCacheScripts() first."
122
- );
123
- }
124
- }
125
- if (alpine) {
126
- if (isScriptCached(CDN.alpine.url)) {
127
- scripts.push(buildInlineScriptTag(getCachedScript(CDN.alpine.url)));
128
- } else {
129
- console.warn(
130
- "[frontmcp/ui] Inline mode requested but Alpine.js script not cached. Call fetchAndCacheScripts() first."
131
- );
132
- }
133
- }
134
- if (icons) {
135
- if (isScriptCached(CDN.icons.url)) {
136
- scripts.push(buildInlineScriptTag(getCachedScript(CDN.icons.url)));
137
- } else {
138
- console.warn(
139
- "[frontmcp/ui] Inline mode requested but Lucide icons script not cached. Call fetchAndCacheScripts() first."
140
- );
141
- }
142
- }
143
- } else {
144
- if (tailwind) {
145
- scripts.push(buildScriptTag(CDN.tailwind));
146
- }
147
- if (htmx) {
148
- scripts.push(buildScriptTag(CDN.htmx.url, CDN.htmx.integrity));
149
- }
150
- if (alpine) {
151
- scripts.push(buildScriptTag(CDN.alpine.url, CDN.alpine.integrity, { defer: true }));
152
- }
153
- if (icons) {
154
- scripts.push(buildScriptTag(CDN.icons.url, CDN.icons.integrity));
155
- }
156
- }
157
- return scripts.join("\n ");
158
- }
159
- function buildFontPreconnectFromTheme(theme) {
160
- const preconnect = theme.cdn?.fonts?.preconnect ?? CDN.fonts.preconnect;
161
- return preconnect.map((url, i) => `<link rel="preconnect" href="${url}"${i > 0 ? " crossorigin" : ""}>`).join("\n ");
162
- }
163
- function buildFontStylesheetsFromTheme(theme) {
164
- const stylesheets = theme.cdn?.fonts?.stylesheets ?? [CDN.fonts.inter];
165
- return stylesheets.map((url) => `<link href="${url}" rel="stylesheet">`).join("\n ");
166
- }
167
- function buildCdnScriptsFromTheme(theme, options = {}) {
168
- const { tailwind = true, htmx = true, alpine = false, icons = false, inline = false } = options;
169
- const scripts = [];
170
- const tailwindUrl = theme.cdn?.scripts?.tailwind ?? CDN.tailwind;
171
- const htmxConfig = theme.cdn?.scripts?.htmx ?? CDN.htmx;
172
- const alpineConfig = theme.cdn?.scripts?.alpine ?? CDN.alpine;
173
- const iconsConfig = theme.cdn?.icons?.script ?? CDN.icons;
174
- if (inline) {
175
- if (tailwind) {
176
- if (isScriptCached(tailwindUrl)) {
177
- scripts.push(buildInlineScriptTag(getCachedScript(tailwindUrl)));
178
- } else {
179
- console.warn(
180
- "[frontmcp/ui] Inline mode requested but Tailwind script not cached. Call fetchAndCacheScriptsFromTheme() first."
181
- );
182
- }
183
- }
184
- if (htmx) {
185
- if (isScriptCached(htmxConfig.url)) {
186
- scripts.push(buildInlineScriptTag(getCachedScript(htmxConfig.url)));
187
- } else {
188
- console.warn(
189
- "[frontmcp/ui] Inline mode requested but HTMX script not cached. Call fetchAndCacheScriptsFromTheme() first."
190
- );
191
- }
192
- }
193
- if (alpine) {
194
- if (isScriptCached(alpineConfig.url)) {
195
- scripts.push(buildInlineScriptTag(getCachedScript(alpineConfig.url)));
196
- } else {
197
- console.warn(
198
- "[frontmcp/ui] Inline mode requested but Alpine.js script not cached. Call fetchAndCacheScriptsFromTheme() first."
199
- );
200
- }
201
- }
202
- if (icons) {
203
- if (isScriptCached(iconsConfig.url)) {
204
- scripts.push(buildInlineScriptTag(getCachedScript(iconsConfig.url)));
205
- } else {
206
- console.warn(
207
- "[frontmcp/ui] Inline mode requested but icons script not cached. Call fetchAndCacheScriptsFromTheme() first."
208
- );
209
- }
210
- }
211
- } else {
212
- if (tailwind) {
213
- scripts.push(buildScriptTag(tailwindUrl));
214
- }
215
- if (htmx) {
216
- scripts.push(buildScriptTag(htmxConfig.url, htmxConfig.integrity));
217
- }
218
- if (alpine) {
219
- scripts.push(buildScriptTag(alpineConfig.url, alpineConfig.integrity, { defer: true }));
220
- }
221
- if (icons) {
222
- scripts.push(buildScriptTag(iconsConfig.url, iconsConfig.integrity));
223
- }
224
- }
225
- return scripts.join("\n ");
226
- }
227
- async function fetchAndCacheScriptsFromTheme(theme, options = {}) {
228
- const { tailwind = true, htmx = true, alpine = false, icons = false } = options;
229
- const urls = [];
230
- const tailwindUrl = theme.cdn?.scripts?.tailwind ?? CDN.tailwind;
231
- const htmxConfig = theme.cdn?.scripts?.htmx ?? CDN.htmx;
232
- const alpineConfig = theme.cdn?.scripts?.alpine ?? CDN.alpine;
233
- const iconsConfig = theme.cdn?.icons?.script ?? CDN.icons;
234
- if (tailwind) urls.push(tailwindUrl);
235
- if (htmx) urls.push(htmxConfig.url);
236
- if (alpine) urls.push(alpineConfig.url);
237
- if (icons) urls.push(iconsConfig.url);
238
- await Promise.all(urls.map(fetchScript));
239
- return scriptCache;
240
- }
241
-
242
- // libs/ui/src/theme/platforms.ts
243
- var OPENAI_PLATFORM = {
244
- id: "openai",
245
- name: "OpenAI",
246
- supportsWidgets: true,
247
- supportsTailwind: true,
248
- supportsHtmx: true,
249
- networkMode: "full",
250
- scriptStrategy: "cdn",
251
- options: {
252
- sdk: "apps-sdk",
253
- version: "1.0"
254
- }
255
- };
256
- var CLAUDE_PLATFORM = {
257
- id: "claude",
258
- name: "Claude (Artifacts)",
259
- supportsWidgets: true,
260
- supportsTailwind: true,
261
- supportsHtmx: false,
262
- // Network blocked, HTMX won't work for API calls
263
- networkMode: "blocked",
264
- scriptStrategy: "inline",
265
- maxInlineSize: 100 * 1024,
266
- // 100KB limit for artifacts
267
- cspRestrictions: ["script-src 'unsafe-inline'", "connect-src 'none'"],
268
- options: {
269
- mode: "artifacts",
270
- framework: "react"
271
- // Claude artifacts prefer React
272
- }
273
- };
274
- var GEMINI_PLATFORM = {
275
- id: "gemini",
276
- name: "Gemini",
277
- supportsWidgets: false,
278
- supportsTailwind: false,
279
- supportsHtmx: false,
280
- networkMode: "blocked",
281
- scriptStrategy: "inline",
282
- options: {
283
- fallback: "markdown"
284
- // Fall back to markdown rendering
285
- }
286
- };
287
- var NGROK_PLATFORM = {
288
- id: "ngrok",
289
- name: "Ngrok Tunnel",
290
- supportsWidgets: true,
291
- supportsTailwind: true,
292
- supportsHtmx: true,
293
- networkMode: "full",
294
- scriptStrategy: "cdn",
295
- options: {
296
- tunnelRequired: true
297
- }
298
- };
299
- var CUSTOM_PLATFORM = {
300
- id: "custom",
301
- name: "Custom MCP Client",
302
- supportsWidgets: true,
303
- supportsTailwind: true,
304
- supportsHtmx: true,
305
- networkMode: "full",
306
- scriptStrategy: "cdn"
307
- };
308
- var PLATFORM_PRESETS = {
309
- openai: OPENAI_PLATFORM,
310
- claude: CLAUDE_PLATFORM,
311
- gemini: GEMINI_PLATFORM,
312
- ngrok: NGROK_PLATFORM,
313
- custom: CUSTOM_PLATFORM
314
- };
315
- function getPlatform(id) {
316
- return PLATFORM_PRESETS[id] ?? CUSTOM_PLATFORM;
317
- }
318
- function createPlatform(base) {
319
- const preset = PLATFORM_PRESETS[base.id] ?? CUSTOM_PLATFORM;
320
- return { ...preset, ...base };
321
- }
322
- function canUseCdn(platform) {
323
- return platform.networkMode === "full" && platform.scriptStrategy === "cdn";
324
- }
325
- function needsInlineScripts(platform) {
326
- return platform.scriptStrategy === "inline" || platform.networkMode === "blocked";
327
- }
328
- function supportsFullInteractivity(platform) {
329
- return platform.supportsWidgets && platform.supportsHtmx && platform.networkMode === "full";
330
- }
331
- function getFallbackMode(platform) {
332
- if (platform.supportsWidgets && platform.supportsTailwind) {
333
- return "html";
334
- }
335
- if (platform.options?.["fallback"] === "markdown") {
336
- return "markdown";
337
- }
338
- return "text";
339
- }
340
-
341
- // libs/ui/src/theme/presets/github-openai.ts
342
- var GITHUB_OPENAI_THEME = {
343
- name: "github-openai",
344
- colors: {
345
- semantic: {
346
- // Primary: Near-black for main actions and branding
347
- primary: "#24292f",
348
- // Secondary: Medium gray for secondary elements
349
- secondary: "#57606a",
350
- // Accent: Blue for links, focus states, and highlights
351
- accent: "#0969da",
352
- // Status colors
353
- success: "#1a7f37",
354
- // GitHub green
355
- warning: "#9a6700",
356
- // Amber warning
357
- danger: "#cf222e",
358
- // GitHub red
359
- info: "#0969da"
360
- // Blue info
361
- },
362
- surface: {
363
- // Pure white background
364
- background: "#ffffff",
365
- // Light gray surface (GitHub code background style)
366
- surface: "#f6f8fa",
367
- // White elevated surfaces (modals, cards)
368
- elevated: "#ffffff",
369
- // Dark semi-transparent overlay
370
- overlay: "rgba(27, 31, 36, 0.5)"
371
- },
372
- text: {
373
- // Near-black for primary text
374
- primary: "#24292f",
375
- // Gray for secondary/muted text
376
- secondary: "#57606a",
377
- // Light gray for disabled text
378
- disabled: "#8c959f",
379
- // White for text on dark backgrounds
380
- inverse: "#ffffff",
381
- // Blue for links
382
- link: "#0969da"
383
- },
384
- border: {
385
- // Light gray border (GitHub style)
386
- default: "#d0d7de",
387
- // Medium gray on hover
388
- hover: "#8c959f",
389
- // Blue focus ring
390
- focus: "#0969da",
391
- // Subtle divider
392
- divider: "#d8dee4"
393
- }
394
- },
395
- typography: {
396
- families: {
397
- // System UI font stack (GitHub/Apple style)
398
- sans: '-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"',
399
- // Monospace stack
400
- mono: 'ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, "Liberation Mono", monospace'
401
- },
402
- sizes: {
403
- xs: "0.75rem",
404
- // 12px
405
- sm: "0.875rem",
406
- // 14px
407
- base: "1rem",
408
- // 16px
409
- lg: "1.125rem",
410
- // 18px
411
- xl: "1.25rem",
412
- // 20px
413
- "2xl": "1.5rem",
414
- // 24px
415
- "3xl": "1.875rem",
416
- // 30px
417
- "4xl": "2.25rem"
418
- // 36px
419
- },
420
- weights: {
421
- normal: "400",
422
- medium: "500",
423
- semibold: "600",
424
- bold: "700"
425
- }
426
- },
427
- radius: {
428
- none: "0",
429
- sm: "3px",
430
- // GitHub uses smaller radii
431
- md: "6px",
432
- lg: "8px",
433
- xl: "12px",
434
- "2xl": "16px",
435
- full: "9999px"
436
- },
437
- shadows: {
438
- // Subtle shadows with gray tones
439
- sm: "0 1px 0 rgba(27, 31, 36, 0.04)",
440
- md: "0 3px 6px rgba(140, 149, 159, 0.15)",
441
- lg: "0 8px 24px rgba(140, 149, 159, 0.2)",
442
- xl: "0 12px 28px rgba(140, 149, 159, 0.3)"
443
- },
444
- components: {
445
- button: {
446
- radius: "6px",
447
- paddingX: "16px",
448
- paddingY: "5px",
449
- fontSize: "14px",
450
- fontWeight: "500"
451
- },
452
- card: {
453
- radius: "6px",
454
- padding: "16px",
455
- shadow: "0 1px 0 rgba(27, 31, 36, 0.04)",
456
- borderWidth: "1px"
457
- },
458
- input: {
459
- radius: "6px",
460
- paddingX: "12px",
461
- paddingY: "5px",
462
- borderWidth: "1px",
463
- focusRingWidth: "3px"
464
- }
465
- },
466
- cdn: {
467
- fonts: {
468
- preconnect: ["https://fonts.googleapis.com", "https://fonts.gstatic.com"],
469
- stylesheets: [
470
- // System UI fonts don't need external stylesheets, but we include
471
- // Inter as an optional enhancement for consistent cross-platform rendering
472
- "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
473
- ]
474
- },
475
- icons: {
476
- script: {
477
- url: "https://cdn.jsdelivr.net/npm/lucide@0.294.0/dist/umd/lucide.min.js"
478
- }
479
- },
480
- scripts: {
481
- tailwind: "https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4",
482
- htmx: {
483
- url: "https://cdnjs.cloudflare.com/ajax/libs/htmx/2.0.7/htmx.min.js",
484
- integrity: "sha512-T6VLg/MJYMbLTmQ8VLvonbWg8VOvmDhXcOvHzCwo6ShdGuUU5SEcp1IAPXL4k9lVoMi8gRXl5K/S/zh43Y9rJA=="
485
- },
486
- alpine: {
487
- url: "https://cdn.jsdelivr.net/npm/alpinejs@3.14.3/dist/cdn.min.js",
488
- integrity: "sha384-6zY8MFQJ/EqS1r4RJl+7j8rvZPuBWpT0RzWf+IFcKhxqUzQNmJzA1X1VEVZhYaEz"
489
- }
490
- }
491
- }
492
- };
493
- var DEFAULT_THEME = GITHUB_OPENAI_THEME;
494
-
495
- // libs/ui/src/theme/theme.ts
496
- var DEFAULT_THEME2 = DEFAULT_THEME;
497
- function mergeThemesCore(base, override) {
498
- const baseColors = base.colors ?? { semantic: { primary: "#24292f" } };
499
- const filterStrings = (arr) => arr.filter((s) => s !== void 0);
500
- return {
501
- ...base,
502
- ...override,
503
- colors: {
504
- ...baseColors,
505
- ...override.colors,
506
- semantic: { ...baseColors.semantic, ...override.colors?.semantic },
507
- surface: { ...baseColors.surface, ...override.colors?.surface },
508
- text: { ...baseColors.text, ...override.colors?.text },
509
- border: { ...baseColors.border, ...override.colors?.border },
510
- custom: { ...baseColors.custom, ...override.colors?.custom }
511
- },
512
- typography: {
513
- ...base.typography,
514
- ...override.typography,
515
- families: { ...base.typography?.families, ...override.typography?.families },
516
- sizes: { ...base.typography?.sizes, ...override.typography?.sizes },
517
- weights: { ...base.typography?.weights, ...override.typography?.weights },
518
- lineHeight: { ...base.typography?.lineHeight, ...override.typography?.lineHeight }
519
- },
520
- spacing: { ...base.spacing, ...override.spacing },
521
- radius: { ...base.radius, ...override.radius },
522
- shadows: { ...base.shadows, ...override.shadows },
523
- components: {
524
- ...base.components,
525
- ...override.components,
526
- button: { ...base.components?.button, ...override.components?.button },
527
- card: { ...base.components?.card, ...override.components?.card },
528
- input: { ...base.components?.input, ...override.components?.input }
529
- },
530
- cdn: {
531
- ...base.cdn,
532
- ...override.cdn,
533
- fonts: {
534
- // Concatenate then dedupe so base entries are preserved without duplicates
535
- preconnect: filterStrings(
536
- Array.from(/* @__PURE__ */ new Set([...base.cdn?.fonts?.preconnect ?? [], ...override.cdn?.fonts?.preconnect ?? []]))
537
- ),
538
- stylesheets: filterStrings(
539
- Array.from(/* @__PURE__ */ new Set([...base.cdn?.fonts?.stylesheets ?? [], ...override.cdn?.fonts?.stylesheets ?? []]))
540
- )
541
- },
542
- icons: {
543
- ...base.cdn?.icons,
544
- ...override.cdn?.icons,
545
- // Deep merge script to preserve integrity when only url is overridden
546
- script: override.cdn?.icons?.script ? { ...base.cdn?.icons?.script, ...override.cdn?.icons?.script } : base.cdn?.icons?.script
547
- },
548
- scripts: {
549
- // tailwind is a simple string, just use override or base
550
- tailwind: override.cdn?.scripts?.tailwind ?? base.cdn?.scripts?.tailwind,
551
- // Deep merge htmx/alpine to preserve integrity when only url is overridden
552
- htmx: override.cdn?.scripts?.htmx ? { ...base.cdn?.scripts?.htmx, ...override.cdn?.scripts?.htmx } : base.cdn?.scripts?.htmx,
553
- alpine: override.cdn?.scripts?.alpine ? { ...base.cdn?.scripts?.alpine, ...override.cdn?.scripts?.alpine } : base.cdn?.scripts?.alpine
554
- }
555
- },
556
- customVars: { ...base.customVars, ...override.customVars },
557
- customCss: [base.customCss, override.customCss].filter(Boolean).join("\n")
558
- };
559
- }
560
- function mergeThemes(base, override) {
561
- const merged = mergeThemesCore(base, override);
562
- let darkVariant;
563
- if (override.dark !== void 0) {
564
- const darkBase = base.dark ?? base;
565
- const { dark: _nestedDark, ...overrideDarkWithoutNested } = override.dark;
566
- darkVariant = mergeThemesCore(darkBase, overrideDarkWithoutNested);
567
- } else if (base.dark !== void 0) {
568
- const { dark: _nestedDark, ...baseDarkWithoutNested } = base.dark;
569
- darkVariant = baseDarkWithoutNested;
570
- }
571
- return {
572
- ...merged,
573
- dark: darkVariant
574
- };
575
- }
576
- function createTheme(overrides) {
577
- return mergeThemes(DEFAULT_THEME2, overrides);
578
- }
579
- function emitColorScale(lines, name, scale) {
580
- for (const [shade, value] of Object.entries(scale)) {
581
- if (value) lines.push(`--color-${name}-${shade}: ${value};`);
582
- }
583
- }
584
- function buildThemeCss(theme) {
585
- const lines = [];
586
- const semantic = theme.colors.semantic;
587
- if (typeof semantic.primary === "string") {
588
- lines.push(`--color-primary: ${semantic.primary};`);
589
- } else if (semantic.primary) {
590
- emitColorScale(lines, "primary", semantic.primary);
591
- }
592
- if (semantic.secondary) {
593
- if (typeof semantic.secondary === "string") {
594
- lines.push(`--color-secondary: ${semantic.secondary};`);
595
- } else {
596
- emitColorScale(lines, "secondary", semantic.secondary);
597
- }
598
- }
599
- if (semantic.accent) {
600
- if (typeof semantic.accent === "string") {
601
- lines.push(`--color-accent: ${semantic.accent};`);
602
- } else {
603
- emitColorScale(lines, "accent", semantic.accent);
604
- }
605
- }
606
- if (semantic.neutral) {
607
- if (typeof semantic.neutral === "string") {
608
- lines.push(`--color-neutral: ${semantic.neutral};`);
609
- } else {
610
- emitColorScale(lines, "neutral", semantic.neutral);
611
- }
612
- }
613
- if (semantic.success) lines.push(`--color-success: ${semantic.success};`);
614
- if (semantic.warning) lines.push(`--color-warning: ${semantic.warning};`);
615
- if (semantic.danger) lines.push(`--color-danger: ${semantic.danger};`);
616
- if (semantic.info) lines.push(`--color-info: ${semantic.info};`);
617
- const surface = theme.colors.surface;
618
- if (surface?.background) lines.push(`--color-background: ${surface.background};`);
619
- if (surface?.surface) lines.push(`--color-surface: ${surface.surface};`);
620
- if (surface?.elevated) lines.push(`--color-elevated: ${surface.elevated};`);
621
- if (surface?.overlay) lines.push(`--color-overlay: ${surface.overlay};`);
622
- const text = theme.colors.text;
623
- if (text?.primary) lines.push(`--color-text-primary: ${text.primary};`);
624
- if (text?.secondary) lines.push(`--color-text-secondary: ${text.secondary};`);
625
- if (text?.disabled) lines.push(`--color-text-disabled: ${text.disabled};`);
626
- if (text?.inverse) lines.push(`--color-text-inverse: ${text.inverse};`);
627
- if (text?.link) lines.push(`--color-text-link: ${text.link};`);
628
- const border = theme.colors.border;
629
- if (border?.default) lines.push(`--color-border: ${border.default};`);
630
- if (border?.hover) lines.push(`--color-border-hover: ${border.hover};`);
631
- if (border?.focus) lines.push(`--color-border-focus: ${border.focus};`);
632
- if (border?.divider) lines.push(`--color-divider: ${border.divider};`);
633
- if (theme.colors.custom) {
634
- for (const [key, value] of Object.entries(theme.colors.custom)) {
635
- lines.push(`--color-${key}: ${value};`);
636
- }
637
- }
638
- const typography = theme.typography;
639
- if (typography?.families?.sans) lines.push(`--font-sans: ${typography.families.sans};`);
640
- if (typography?.families?.serif) lines.push(`--font-serif: ${typography.families.serif};`);
641
- if (typography?.families?.mono) lines.push(`--font-mono: ${typography.families.mono};`);
642
- if (typography?.families?.display) lines.push(`--font-display: ${typography.families.display};`);
643
- const radius = theme.radius;
644
- if (radius?.none) lines.push(`--radius-none: ${radius.none};`);
645
- if (radius?.sm) lines.push(`--radius-sm: ${radius.sm};`);
646
- if (radius?.md) lines.push(`--radius-md: ${radius.md};`);
647
- if (radius?.lg) lines.push(`--radius-lg: ${radius.lg};`);
648
- if (radius?.xl) lines.push(`--radius-xl: ${radius.xl};`);
649
- if (radius?.["2xl"]) lines.push(`--radius-2xl: ${radius["2xl"]};`);
650
- if (radius?.full) lines.push(`--radius-full: ${radius.full};`);
651
- if (theme.customVars) {
652
- for (const [key, value] of Object.entries(theme.customVars)) {
653
- lines.push(`${key}: ${value};`);
654
- }
655
- }
656
- return lines.join("\n ");
657
- }
658
- function buildStyleBlock(theme) {
659
- const themeCss = buildThemeCss(theme);
660
- const customCss = theme.customCss || "";
661
- return `<style type="text/tailwindcss">
662
- @theme {
663
- ${themeCss}
664
- }
665
- ${customCss}
666
- </style>`;
667
- }
668
- export {
669
- CDN,
670
- CLAUDE_PLATFORM,
671
- CUSTOM_PLATFORM,
672
- DEFAULT_THEME,
673
- GEMINI_PLATFORM,
674
- GITHUB_OPENAI_THEME,
675
- NGROK_PLATFORM,
676
- OPENAI_PLATFORM,
677
- PLATFORM_PRESETS,
678
- buildCdnScripts,
679
- buildCdnScriptsFromTheme,
680
- buildFontPreconnect,
681
- buildFontPreconnectFromTheme,
682
- buildFontStylesheets,
683
- buildFontStylesheetsFromTheme,
684
- buildStyleBlock,
685
- buildThemeCss,
686
- canUseCdn,
687
- clearScriptCache,
688
- createPlatform,
689
- createTheme,
690
- fetchAndCacheScripts,
691
- fetchAndCacheScriptsFromTheme,
692
- fetchScript,
693
- getCachedScript,
694
- getFallbackMode,
695
- getPlatform,
696
- isScriptCached,
697
- mergeThemes,
698
- needsInlineScripts,
699
- supportsFullInteractivity
700
- };