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