@frontmcp/uipack 0.6.1 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (315) hide show
  1. package/CLAUDE.md +88 -105
  2. package/README.md +1 -0
  3. package/adapters/index.d.ts +1 -1
  4. package/adapters/index.d.ts.map +1 -1
  5. package/adapters/index.js +35 -2
  6. package/adapters/platform-meta.d.ts +29 -0
  7. package/adapters/platform-meta.d.ts.map +1 -1
  8. package/base-template/default-base-template.d.ts +0 -1
  9. package/base-template/default-base-template.d.ts.map +1 -1
  10. package/base-template/index.js +32 -37
  11. package/build/builders/base-builder.d.ts +124 -0
  12. package/build/builders/base-builder.d.ts.map +1 -0
  13. package/build/builders/esbuild-config.d.ts +94 -0
  14. package/build/builders/esbuild-config.d.ts.map +1 -0
  15. package/build/builders/hybrid-builder.d.ts +93 -0
  16. package/build/builders/hybrid-builder.d.ts.map +1 -0
  17. package/build/builders/index.d.ts +17 -0
  18. package/build/builders/index.d.ts.map +1 -0
  19. package/build/builders/inline-builder.d.ts +83 -0
  20. package/build/builders/inline-builder.d.ts.map +1 -0
  21. package/build/builders/static-builder.d.ts +78 -0
  22. package/build/builders/static-builder.d.ts.map +1 -0
  23. package/build/builders/types.d.ts +341 -0
  24. package/build/builders/types.d.ts.map +1 -0
  25. package/build/cdn-resources.d.ts +3 -2
  26. package/build/cdn-resources.d.ts.map +1 -1
  27. package/build/hybrid-data.d.ts +127 -0
  28. package/build/hybrid-data.d.ts.map +1 -0
  29. package/build/index.d.ts +4 -0
  30. package/build/index.d.ts.map +1 -1
  31. package/build/index.js +1901 -173
  32. package/build/ui-components-browser.d.ts +64 -0
  33. package/build/ui-components-browser.d.ts.map +1 -0
  34. package/build/widget-manifest.d.ts.map +1 -1
  35. package/bundler/file-cache/component-builder.d.ts.map +1 -1
  36. package/bundler/file-cache/storage/redis.d.ts.map +1 -1
  37. package/bundler/index.js +11 -6
  38. package/dependency/cdn-registry.d.ts +1 -1
  39. package/dependency/cdn-registry.d.ts.map +1 -1
  40. package/dependency/import-map.d.ts.map +1 -1
  41. package/dependency/index.js +93 -121
  42. package/dependency/resolver.d.ts.map +1 -1
  43. package/esm/adapters/{index.js → index.mjs} +34 -2
  44. package/esm/base-template/{index.js → index.mjs} +32 -37
  45. package/esm/build/{index.js → index.mjs} +1872 -173
  46. package/esm/bundler/{index.js → index.mjs} +12 -7
  47. package/esm/dependency/{index.js → index.mjs} +93 -121
  48. package/esm/handlebars/{index.js → index.mjs} +0 -1
  49. package/esm/{index.js → index.mjs} +2532 -827
  50. package/esm/package.json +15 -16
  51. package/esm/registry/{index.js → index.mjs} +200 -265
  52. package/esm/renderers/{index.js → index.mjs} +110 -201
  53. package/esm/runtime/{index.js → index.mjs} +44 -35
  54. package/esm/styles/{index.js → index.mjs} +6 -6
  55. package/esm/theme/{index.js → index.mjs} +90 -42
  56. package/esm/tool-template/{index.js → index.mjs} +35 -28
  57. package/esm/typings/{index.js → index.mjs} +157 -1
  58. package/esm/utils/{index.js → index.mjs} +24 -0
  59. package/esm/validation/{index.js → index.mjs} +0 -1
  60. package/handlebars/expression-extractor.d.ts.map +1 -1
  61. package/handlebars/index.d.ts.map +1 -1
  62. package/handlebars/index.js +0 -1
  63. package/index.d.ts +2 -1
  64. package/index.d.ts.map +1 -1
  65. package/index.js +2560 -831
  66. package/package.json +7 -6
  67. package/preview/claude-preview.d.ts +67 -0
  68. package/preview/claude-preview.d.ts.map +1 -0
  69. package/preview/generic-preview.d.ts +67 -0
  70. package/preview/generic-preview.d.ts.map +1 -0
  71. package/preview/index.d.ts +36 -0
  72. package/preview/index.d.ts.map +1 -0
  73. package/preview/openai-preview.d.ts +70 -0
  74. package/preview/openai-preview.d.ts.map +1 -0
  75. package/preview/types.d.ts +185 -0
  76. package/preview/types.d.ts.map +1 -0
  77. package/registry/index.js +200 -265
  78. package/registry/render-template.d.ts.map +1 -1
  79. package/renderers/index.d.ts +2 -2
  80. package/renderers/index.d.ts.map +1 -1
  81. package/renderers/index.js +114 -205
  82. package/renderers/mdx-client.renderer.d.ts +124 -0
  83. package/renderers/mdx-client.renderer.d.ts.map +1 -0
  84. package/renderers/registry.d.ts +2 -2
  85. package/renderers/registry.d.ts.map +1 -1
  86. package/renderers/types.d.ts +3 -2
  87. package/renderers/types.d.ts.map +1 -1
  88. package/renderers/utils/transpiler.d.ts +8 -27
  89. package/renderers/utils/transpiler.d.ts.map +1 -1
  90. package/runtime/index.js +44 -35
  91. package/runtime/mcp-bridge.d.ts.map +1 -1
  92. package/runtime/renderer-runtime.d.ts.map +1 -1
  93. package/runtime/wrapper.d.ts.map +1 -1
  94. package/styles/index.js +6 -6
  95. package/styles/variants.d.ts +1 -1
  96. package/styles/variants.d.ts.map +1 -1
  97. package/theme/cdn.d.ts.map +1 -1
  98. package/theme/css-to-theme.d.ts +91 -0
  99. package/theme/css-to-theme.d.ts.map +1 -0
  100. package/theme/index.d.ts +2 -1
  101. package/theme/index.d.ts.map +1 -1
  102. package/theme/index.js +92 -43
  103. package/theme/platforms.d.ts +1 -6
  104. package/theme/platforms.d.ts.map +1 -1
  105. package/theme/theme.d.ts.map +1 -1
  106. package/tool-template/builder.d.ts.map +1 -1
  107. package/tool-template/index.js +35 -28
  108. package/typings/index.d.ts +4 -4
  109. package/typings/index.d.ts.map +1 -1
  110. package/typings/index.js +162 -1
  111. package/typings/schemas.d.ts +30 -0
  112. package/typings/schemas.d.ts.map +1 -1
  113. package/typings/type-fetcher.d.ts +74 -1
  114. package/typings/type-fetcher.d.ts.map +1 -1
  115. package/typings/types.d.ts +72 -1
  116. package/typings/types.d.ts.map +1 -1
  117. package/utils/escape-html.d.ts +44 -0
  118. package/utils/escape-html.d.ts.map +1 -1
  119. package/utils/index.d.ts +1 -1
  120. package/utils/index.d.ts.map +1 -1
  121. package/utils/index.js +26 -0
  122. package/validation/index.js +0 -1
  123. package/validation/template-validator.d.ts.map +1 -1
  124. package/esm/adapters/index.d.ts +0 -13
  125. package/esm/adapters/index.d.ts.map +0 -1
  126. package/esm/adapters/platform-meta.d.ts +0 -166
  127. package/esm/adapters/platform-meta.d.ts.map +0 -1
  128. package/esm/adapters/response-builder.d.ts +0 -108
  129. package/esm/adapters/response-builder.d.ts.map +0 -1
  130. package/esm/adapters/serving-mode.d.ts +0 -107
  131. package/esm/adapters/serving-mode.d.ts.map +0 -1
  132. package/esm/base-template/bridge.d.ts +0 -90
  133. package/esm/base-template/bridge.d.ts.map +0 -1
  134. package/esm/base-template/default-base-template.d.ts +0 -92
  135. package/esm/base-template/default-base-template.d.ts.map +0 -1
  136. package/esm/base-template/index.d.ts +0 -15
  137. package/esm/base-template/index.d.ts.map +0 -1
  138. package/esm/base-template/polyfills.d.ts +0 -31
  139. package/esm/base-template/polyfills.d.ts.map +0 -1
  140. package/esm/base-template/theme-styles.d.ts +0 -74
  141. package/esm/base-template/theme-styles.d.ts.map +0 -1
  142. package/esm/bridge-runtime/iife-generator.d.ts +0 -62
  143. package/esm/bridge-runtime/iife-generator.d.ts.map +0 -1
  144. package/esm/bridge-runtime/index.d.ts +0 -10
  145. package/esm/bridge-runtime/index.d.ts.map +0 -1
  146. package/esm/build/cdn-resources.d.ts +0 -243
  147. package/esm/build/cdn-resources.d.ts.map +0 -1
  148. package/esm/build/index.d.ts +0 -295
  149. package/esm/build/index.d.ts.map +0 -1
  150. package/esm/build/widget-manifest.d.ts +0 -362
  151. package/esm/build/widget-manifest.d.ts.map +0 -1
  152. package/esm/bundler/cache.d.ts +0 -173
  153. package/esm/bundler/cache.d.ts.map +0 -1
  154. package/esm/bundler/file-cache/component-builder.d.ts +0 -167
  155. package/esm/bundler/file-cache/component-builder.d.ts.map +0 -1
  156. package/esm/bundler/file-cache/hash-calculator.d.ts +0 -155
  157. package/esm/bundler/file-cache/hash-calculator.d.ts.map +0 -1
  158. package/esm/bundler/file-cache/index.d.ts +0 -12
  159. package/esm/bundler/file-cache/index.d.ts.map +0 -1
  160. package/esm/bundler/file-cache/storage/filesystem.d.ts +0 -149
  161. package/esm/bundler/file-cache/storage/filesystem.d.ts.map +0 -1
  162. package/esm/bundler/file-cache/storage/index.d.ts +0 -11
  163. package/esm/bundler/file-cache/storage/index.d.ts.map +0 -1
  164. package/esm/bundler/file-cache/storage/interface.d.ts +0 -152
  165. package/esm/bundler/file-cache/storage/interface.d.ts.map +0 -1
  166. package/esm/bundler/file-cache/storage/redis.d.ts +0 -139
  167. package/esm/bundler/file-cache/storage/redis.d.ts.map +0 -1
  168. package/esm/bundler/index.d.ts +0 -35
  169. package/esm/bundler/index.d.ts.map +0 -1
  170. package/esm/bundler/sandbox/enclave-adapter.d.ts +0 -121
  171. package/esm/bundler/sandbox/enclave-adapter.d.ts.map +0 -1
  172. package/esm/bundler/sandbox/executor.d.ts +0 -14
  173. package/esm/bundler/sandbox/executor.d.ts.map +0 -1
  174. package/esm/bundler/sandbox/policy.d.ts +0 -62
  175. package/esm/bundler/sandbox/policy.d.ts.map +0 -1
  176. package/esm/bundler/types.d.ts +0 -702
  177. package/esm/bundler/types.d.ts.map +0 -1
  178. package/esm/dependency/cdn-registry.d.ts +0 -98
  179. package/esm/dependency/cdn-registry.d.ts.map +0 -1
  180. package/esm/dependency/import-map.d.ts +0 -186
  181. package/esm/dependency/import-map.d.ts.map +0 -1
  182. package/esm/dependency/import-parser.d.ts +0 -82
  183. package/esm/dependency/import-parser.d.ts.map +0 -1
  184. package/esm/dependency/index.d.ts +0 -17
  185. package/esm/dependency/index.d.ts.map +0 -1
  186. package/esm/dependency/resolver.d.ts +0 -164
  187. package/esm/dependency/resolver.d.ts.map +0 -1
  188. package/esm/dependency/schemas.d.ts +0 -486
  189. package/esm/dependency/schemas.d.ts.map +0 -1
  190. package/esm/dependency/template-loader.d.ts +0 -204
  191. package/esm/dependency/template-loader.d.ts.map +0 -1
  192. package/esm/dependency/template-processor.d.ts +0 -118
  193. package/esm/dependency/template-processor.d.ts.map +0 -1
  194. package/esm/dependency/types.d.ts +0 -739
  195. package/esm/dependency/types.d.ts.map +0 -1
  196. package/esm/handlebars/expression-extractor.d.ts +0 -147
  197. package/esm/handlebars/expression-extractor.d.ts.map +0 -1
  198. package/esm/handlebars/helpers.d.ts +0 -339
  199. package/esm/handlebars/helpers.d.ts.map +0 -1
  200. package/esm/handlebars/index.d.ts +0 -195
  201. package/esm/handlebars/index.d.ts.map +0 -1
  202. package/esm/index.d.ts +0 -50
  203. package/esm/index.d.ts.map +0 -1
  204. package/esm/registry/index.d.ts +0 -46
  205. package/esm/registry/index.d.ts.map +0 -1
  206. package/esm/registry/render-template.d.ts +0 -91
  207. package/esm/registry/render-template.d.ts.map +0 -1
  208. package/esm/registry/tool-ui.registry.d.ts +0 -294
  209. package/esm/registry/tool-ui.registry.d.ts.map +0 -1
  210. package/esm/registry/uri-utils.d.ts +0 -56
  211. package/esm/registry/uri-utils.d.ts.map +0 -1
  212. package/esm/renderers/cache.d.ts +0 -145
  213. package/esm/renderers/cache.d.ts.map +0 -1
  214. package/esm/renderers/html.renderer.d.ts +0 -123
  215. package/esm/renderers/html.renderer.d.ts.map +0 -1
  216. package/esm/renderers/index.d.ts +0 -36
  217. package/esm/renderers/index.d.ts.map +0 -1
  218. package/esm/renderers/mdx.renderer.d.ts +0 -120
  219. package/esm/renderers/mdx.renderer.d.ts.map +0 -1
  220. package/esm/renderers/registry.d.ts +0 -133
  221. package/esm/renderers/registry.d.ts.map +0 -1
  222. package/esm/renderers/types.d.ts +0 -342
  223. package/esm/renderers/types.d.ts.map +0 -1
  224. package/esm/renderers/utils/detect.d.ts +0 -107
  225. package/esm/renderers/utils/detect.d.ts.map +0 -1
  226. package/esm/renderers/utils/hash.d.ts +0 -40
  227. package/esm/renderers/utils/hash.d.ts.map +0 -1
  228. package/esm/renderers/utils/index.d.ts +0 -9
  229. package/esm/renderers/utils/index.d.ts.map +0 -1
  230. package/esm/renderers/utils/transpiler.d.ts +0 -89
  231. package/esm/renderers/utils/transpiler.d.ts.map +0 -1
  232. package/esm/runtime/adapters/html.adapter.d.ts +0 -59
  233. package/esm/runtime/adapters/html.adapter.d.ts.map +0 -1
  234. package/esm/runtime/adapters/index.d.ts +0 -26
  235. package/esm/runtime/adapters/index.d.ts.map +0 -1
  236. package/esm/runtime/adapters/mdx.adapter.d.ts +0 -73
  237. package/esm/runtime/adapters/mdx.adapter.d.ts.map +0 -1
  238. package/esm/runtime/adapters/types.d.ts +0 -95
  239. package/esm/runtime/adapters/types.d.ts.map +0 -1
  240. package/esm/runtime/csp.d.ts +0 -48
  241. package/esm/runtime/csp.d.ts.map +0 -1
  242. package/esm/runtime/index.d.ts +0 -17
  243. package/esm/runtime/index.d.ts.map +0 -1
  244. package/esm/runtime/mcp-bridge.d.ts +0 -101
  245. package/esm/runtime/mcp-bridge.d.ts.map +0 -1
  246. package/esm/runtime/renderer-runtime.d.ts +0 -133
  247. package/esm/runtime/renderer-runtime.d.ts.map +0 -1
  248. package/esm/runtime/sanitizer.d.ts +0 -172
  249. package/esm/runtime/sanitizer.d.ts.map +0 -1
  250. package/esm/runtime/types.d.ts +0 -415
  251. package/esm/runtime/types.d.ts.map +0 -1
  252. package/esm/runtime/wrapper.d.ts +0 -421
  253. package/esm/runtime/wrapper.d.ts.map +0 -1
  254. package/esm/styles/index.d.ts +0 -8
  255. package/esm/styles/index.d.ts.map +0 -1
  256. package/esm/styles/variants.d.ts +0 -51
  257. package/esm/styles/variants.d.ts.map +0 -1
  258. package/esm/theme/cdn.d.ts +0 -195
  259. package/esm/theme/cdn.d.ts.map +0 -1
  260. package/esm/theme/index.d.ts +0 -18
  261. package/esm/theme/index.d.ts.map +0 -1
  262. package/esm/theme/platforms.d.ts +0 -107
  263. package/esm/theme/platforms.d.ts.map +0 -1
  264. package/esm/theme/presets/github-openai.d.ts +0 -50
  265. package/esm/theme/presets/github-openai.d.ts.map +0 -1
  266. package/esm/theme/presets/index.d.ts +0 -11
  267. package/esm/theme/presets/index.d.ts.map +0 -1
  268. package/esm/theme/theme.d.ts +0 -396
  269. package/esm/theme/theme.d.ts.map +0 -1
  270. package/esm/tool-template/builder.d.ts +0 -213
  271. package/esm/tool-template/builder.d.ts.map +0 -1
  272. package/esm/tool-template/index.d.ts +0 -16
  273. package/esm/tool-template/index.d.ts.map +0 -1
  274. package/esm/types/index.d.ts +0 -14
  275. package/esm/types/index.d.ts.map +0 -1
  276. package/esm/types/ui-config.d.ts +0 -641
  277. package/esm/types/ui-config.d.ts.map +0 -1
  278. package/esm/types/ui-runtime.d.ts +0 -1008
  279. package/esm/types/ui-runtime.d.ts.map +0 -1
  280. package/esm/typings/cache/cache-adapter.d.ts +0 -125
  281. package/esm/typings/cache/cache-adapter.d.ts.map +0 -1
  282. package/esm/typings/cache/index.d.ts +0 -10
  283. package/esm/typings/cache/index.d.ts.map +0 -1
  284. package/esm/typings/cache/memory-cache.d.ts +0 -92
  285. package/esm/typings/cache/memory-cache.d.ts.map +0 -1
  286. package/esm/typings/dts-parser.d.ts +0 -90
  287. package/esm/typings/dts-parser.d.ts.map +0 -1
  288. package/esm/typings/index.d.ts +0 -48
  289. package/esm/typings/index.d.ts.map +0 -1
  290. package/esm/typings/schemas.d.ts +0 -232
  291. package/esm/typings/schemas.d.ts.map +0 -1
  292. package/esm/typings/type-fetcher.d.ts +0 -89
  293. package/esm/typings/type-fetcher.d.ts.map +0 -1
  294. package/esm/typings/types.d.ts +0 -320
  295. package/esm/typings/types.d.ts.map +0 -1
  296. package/esm/utils/escape-html.d.ts +0 -58
  297. package/esm/utils/escape-html.d.ts.map +0 -1
  298. package/esm/utils/index.d.ts +0 -10
  299. package/esm/utils/index.d.ts.map +0 -1
  300. package/esm/utils/safe-stringify.d.ts +0 -30
  301. package/esm/utils/safe-stringify.d.ts.map +0 -1
  302. package/esm/validation/error-box.d.ts +0 -56
  303. package/esm/validation/error-box.d.ts.map +0 -1
  304. package/esm/validation/index.d.ts +0 -13
  305. package/esm/validation/index.d.ts.map +0 -1
  306. package/esm/validation/schema-paths.d.ts +0 -118
  307. package/esm/validation/schema-paths.d.ts.map +0 -1
  308. package/esm/validation/template-validator.d.ts +0 -143
  309. package/esm/validation/template-validator.d.ts.map +0 -1
  310. package/esm/validation/wrapper.d.ts +0 -97
  311. package/esm/validation/wrapper.d.ts.map +0 -1
  312. package/renderers/mdx.renderer.d.ts +0 -120
  313. package/renderers/mdx.renderer.d.ts.map +0 -1
  314. /package/esm/bridge-runtime/{index.js → index.mjs} +0 -0
  315. /package/esm/types/{index.js → index.mjs} +0 -0
@@ -8,13 +8,6 @@ var __export = (target, all) => {
8
8
  __defProp(target, name, { get: all[name], enumerable: true });
9
9
  };
10
10
 
11
- // libs/uipack/src/utils/safe-stringify.ts
12
- var init_safe_stringify = __esm({
13
- "libs/uipack/src/utils/safe-stringify.ts"() {
14
- "use strict";
15
- }
16
- });
17
-
18
11
  // libs/uipack/src/utils/escape-html.ts
19
12
  function escapeHtml(str) {
20
13
  if (str === null || str === void 0) {
@@ -23,6 +16,12 @@ function escapeHtml(str) {
23
16
  const s = String(str);
24
17
  return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
25
18
  }
19
+ function escapeJsString(str) {
20
+ return str.replace(/\\/g, "\\\\").replace(/'/g, "\\'").replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
21
+ }
22
+ function escapeScriptClose(jsonString) {
23
+ return jsonString.replace(/<\//g, "<\\/");
24
+ }
26
25
  var init_escape_html = __esm({
27
26
  "libs/uipack/src/utils/escape-html.ts"() {
28
27
  "use strict";
@@ -33,7 +32,6 @@ var init_escape_html = __esm({
33
32
  var init_utils = __esm({
34
33
  "libs/uipack/src/utils/index.ts"() {
35
34
  "use strict";
36
- init_safe_stringify();
37
35
  init_escape_html();
38
36
  }
39
37
  });
@@ -264,7 +262,6 @@ var init_helpers = __esm({
264
262
  // libs/uipack/src/handlebars/expression-extractor.ts
265
263
  function extractExpressions(template) {
266
264
  const expressions = [];
267
- const lines = template.split("\n");
268
265
  const positionMap = buildPositionMap(template);
269
266
  let match;
270
267
  EXPRESSION_REGEX.lastIndex = 0;
@@ -867,11 +864,12 @@ var CLAUDE_PLATFORM = {
867
864
  id: "claude",
868
865
  name: "Claude (Artifacts)",
869
866
  supportsWidgets: true,
867
+ // Claude Artifacts support interactive widgets
870
868
  supportsTailwind: true,
871
869
  supportsHtmx: false,
872
870
  // Network blocked, HTMX won't work for API calls
873
- networkMode: "blocked",
874
- scriptStrategy: "inline",
871
+ networkMode: "limited",
872
+ scriptStrategy: "cdn",
875
873
  maxInlineSize: 100 * 1024,
876
874
  // 100KB limit for artifacts
877
875
  cspRestrictions: ["script-src 'unsafe-inline'", "connect-src 'none'"],
@@ -1315,35 +1313,25 @@ var RendererRegistry = class {
1315
1313
  };
1316
1314
  var rendererRegistry = new RendererRegistry();
1317
1315
 
1318
- // libs/uipack/src/renderers/mdx.renderer.ts
1319
- var REACT_CDN = {
1320
- react: "https://unpkg.com/react@18/umd/react.production.min.js",
1321
- reactDom: "https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"
1316
+ // libs/uipack/src/renderers/mdx-client.renderer.ts
1317
+ init_utils();
1318
+ function buildReactCdnUrls(version = "19") {
1319
+ return {
1320
+ react: `https://esm.sh/react@${version}`,
1321
+ reactDom: `https://esm.sh/react-dom@${version}/client`,
1322
+ jsxRuntime: `https://esm.sh/react@${version}/jsx-runtime`
1323
+ };
1324
+ }
1325
+ var DEFAULT_CDN = {
1326
+ mdx: "https://esm.sh/@mdx-js/mdx@3",
1327
+ ...buildReactCdnUrls("19")
1322
1328
  };
1323
- var INLINE_MDX_PLACEHOLDER = `
1324
- // MDX runtime not available inline yet.
1325
- // For blocked-network platforms, use pre-rendered HTML templates.
1326
- console.warn('[FrontMCP] MDX hydration not available on this platform.');
1327
- `;
1328
- var MdxRenderer = class {
1329
- type = "mdx";
1330
- priority = 10;
1331
- // Between HTML (0) and React (20)
1332
- /**
1333
- * Lazy-loaded modules.
1334
- */
1335
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1336
- React = null;
1337
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1338
- ReactDOMServer = null;
1339
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1340
- jsxRuntime = null;
1341
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1342
- mdxEvaluate = null;
1329
+ var MdxClientRenderer = class {
1330
+ type = "mdx-client";
1331
+ priority = 8;
1332
+ // Lower than server-side MDX (10)
1343
1333
  /**
1344
1334
  * Check if this renderer can handle the given template.
1345
- *
1346
- * Accepts strings containing MDX syntax (Markdown + JSX).
1347
1335
  */
1348
1336
  canHandle(template) {
1349
1337
  if (typeof template !== "string") {
@@ -1352,11 +1340,9 @@ var MdxRenderer = class {
1352
1340
  return containsMdxSyntax(template);
1353
1341
  }
1354
1342
  /**
1355
- * Transpile MDX to executable JavaScript.
1356
- *
1357
- * Uses @mdx-js/mdx to compile MDX source to a module.
1358
- * Note: For MDX, we use evaluate() which combines compile + run,
1359
- * so this method just returns the source hash for caching purposes.
1343
+ * Prepare MDX template for rendering.
1344
+ * Caches the template hash for deduplication. Actual MDX compilation
1345
+ * happens client-side via CDN-loaded @mdx-js/mdx in the browser.
1360
1346
  */
1361
1347
  async transpile(template, _options) {
1362
1348
  const hash = hashString(template);
@@ -1366,7 +1352,6 @@ var MdxRenderer = class {
1366
1352
  }
1367
1353
  const transpileResult = {
1368
1354
  code: template,
1369
- // Store original MDX for evaluate()
1370
1355
  hash,
1371
1356
  cached: false
1372
1357
  };
@@ -1374,37 +1359,20 @@ var MdxRenderer = class {
1374
1359
  return transpileResult;
1375
1360
  }
1376
1361
  /**
1377
- * Render MDX template to HTML string.
1362
+ * Render MDX template to HTML with CDN scripts.
1378
1363
  *
1379
- * Uses @mdx-js/mdx's evaluate() for clean compilation + execution,
1380
- * then renders the resulting React component to HTML via SSR.
1364
+ * The returned HTML includes:
1365
+ * - A container div for the rendered content
1366
+ * - Script tags that load React and MDX from CDN
1367
+ * - Inline script that compiles and renders the MDX
1381
1368
  */
1382
1369
  async render(template, context, options) {
1383
- await this.loadReact();
1384
- await this.loadMdx();
1385
- if (!this.mdxEvaluate) {
1386
- throw new Error("MDX compilation requires @mdx-js/mdx. Install it: npm install @mdx-js/mdx");
1387
- }
1388
- const templateHash = hashString(template);
1389
- const cacheKey = `mdx-component:${templateHash}`;
1390
- let Content = componentCache.get(cacheKey);
1391
- if (!Content) {
1392
- const result = await this.mdxEvaluate(template, {
1393
- ...this.jsxRuntime,
1394
- Fragment: this.React.Fragment,
1395
- development: false
1396
- });
1397
- Content = result.default;
1398
- componentCache.set(cacheKey, Content);
1399
- }
1400
- const mdxComponents = {
1401
- // User-provided components from tool config
1402
- ...options?.mdxComponents,
1403
- // Wrapper that provides context to the content
1404
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1405
- wrapper: ({ children }) => {
1406
- return this.React.createElement("div", { className: "mdx-content" }, children);
1407
- }
1370
+ const containerId = options?.containerId || "mdx-content";
1371
+ const showLoading = options?.showLoading !== false;
1372
+ const loadingMessage = options?.loadingMessage || "Loading...";
1373
+ const cdn = {
1374
+ ...DEFAULT_CDN,
1375
+ ...options?.cdn
1408
1376
  };
1409
1377
  const props = {
1410
1378
  input: context.input,
@@ -1412,114 +1380,80 @@ var MdxRenderer = class {
1412
1380
  structuredContent: context.structuredContent,
1413
1381
  helpers: context.helpers
1414
1382
  };
1383
+ const reservedProps = /* @__PURE__ */ new Set(["input", "output", "structuredContent", "helpers", "components"]);
1384
+ const outputProps = typeof context.output === "object" && context.output !== null ? Object.fromEntries(Object.entries(context.output).filter(([key]) => !reservedProps.has(key))) : {};
1415
1385
  const spreadProps = {
1416
- ...props,
1417
- ...typeof context.output === "object" && context.output !== null ? context.output : {}
1386
+ ...outputProps,
1387
+ ...props
1418
1388
  };
1419
- const element = this.React.createElement(Content, {
1420
- components: mdxComponents,
1421
- ...spreadProps
1389
+ const escapedMdx = escapeScriptClose(JSON.stringify(template));
1390
+ const escapedProps = escapeScriptClose(JSON.stringify(spreadProps));
1391
+ const safeContainerId = escapeJsString(containerId);
1392
+ const loadingHtml = showLoading ? `<div class="mdx-loading">${escapeHtml(loadingMessage)}</div>` : "";
1393
+ return `
1394
+ <div id="${escapeHtml(containerId)}">${loadingHtml}</div>
1395
+ <script type="module">
1396
+ (async function() {
1397
+ try {
1398
+ // Load dependencies from CDN
1399
+ const [
1400
+ { evaluate },
1401
+ runtime,
1402
+ React,
1403
+ { createRoot }
1404
+ ] = await Promise.all([
1405
+ import('${cdn.mdx}'),
1406
+ import('${cdn.jsxRuntime}'),
1407
+ import('${cdn.react}'),
1408
+ import('${cdn.reactDom}')
1409
+ ]);
1410
+
1411
+ // MDX content and props
1412
+ const mdxSource = ${escapedMdx};
1413
+ const props = ${escapedProps};
1414
+
1415
+ // Compile and evaluate MDX
1416
+ const { default: Content } = await evaluate(mdxSource, {
1417
+ ...runtime,
1418
+ Fragment: React.Fragment,
1419
+ development: false
1422
1420
  });
1423
- const html = this.ReactDOMServer.renderToString(element);
1424
- if (options?.hydrate) {
1425
- const escapedProps = JSON.stringify(props).replace(/&/g, "&amp;").replace(/'/g, "&#39;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
1426
- return `<div data-mdx-hydrate="true" data-props='${escapedProps}'>${html}</div>`;
1421
+
1422
+ // Render to DOM
1423
+ const container = document.getElementById('${safeContainerId}');
1424
+ if (container) {
1425
+ const root = createRoot(container);
1426
+ root.render(React.createElement(Content, props));
1427
+ }
1428
+ } catch (error) {
1429
+ console.error('[FrontMCP] MDX client rendering failed:', error);
1430
+ const container = document.getElementById('${safeContainerId}');
1431
+ if (container) {
1432
+ container.innerHTML = '<div class="mdx-error">Failed to render MDX content</div>';
1427
1433
  }
1428
- return html;
1434
+ }
1435
+ })();
1436
+ </script>
1437
+ `;
1429
1438
  }
1430
1439
  /**
1431
- * Get runtime scripts for client-side functionality.
1440
+ * Get runtime scripts - not needed for client renderer since scripts are inline.
1432
1441
  */
1433
1442
  getRuntimeScripts(platform) {
1434
1443
  if (platform.networkMode === "blocked") {
1435
1444
  return {
1436
1445
  headScripts: "",
1437
- inlineScripts: INLINE_MDX_PLACEHOLDER,
1446
+ inlineScripts: `console.warn('[FrontMCP] Client-side MDX rendering requires network access. Use @frontmcp/ui for SSR.');`,
1438
1447
  isInline: true
1439
1448
  };
1440
1449
  }
1441
1450
  return {
1442
- headScripts: `
1443
- <script crossorigin src="${REACT_CDN.react}"></script>
1444
- <script crossorigin src="${REACT_CDN.reactDom}"></script>
1445
- `,
1451
+ headScripts: "",
1446
1452
  isInline: false
1447
1453
  };
1448
1454
  }
1449
- /**
1450
- * Load React and ReactDOMServer modules.
1451
- */
1452
- async loadReact() {
1453
- if (this.React && this.ReactDOMServer && this.jsxRuntime) {
1454
- return;
1455
- }
1456
- try {
1457
- const [react, reactDomServer, jsxRuntime] = await Promise.all([
1458
- import("react"),
1459
- import("react-dom/server"),
1460
- import("react/jsx-runtime")
1461
- ]);
1462
- this.React = react;
1463
- this.ReactDOMServer = reactDomServer;
1464
- this.jsxRuntime = jsxRuntime;
1465
- } catch {
1466
- throw new Error("React is required for MdxRenderer. Install react and react-dom: npm install react react-dom");
1467
- }
1468
- }
1469
- /**
1470
- * Load @mdx-js/mdx evaluate function.
1471
- *
1472
- * evaluate() is the cleanest way to run MDX - it combines
1473
- * compile and run in a single step, handling all the runtime
1474
- * injection automatically.
1475
- */
1476
- async loadMdx() {
1477
- if (this.mdxEvaluate) {
1478
- return;
1479
- }
1480
- try {
1481
- const mdx = await import("@mdx-js/mdx");
1482
- this.mdxEvaluate = mdx.evaluate;
1483
- } catch {
1484
- console.warn(
1485
- "[@frontmcp/ui] @mdx-js/mdx not available. MDX rendering disabled. Install @mdx-js/mdx to enable: npm install @mdx-js/mdx"
1486
- );
1487
- }
1488
- }
1489
1455
  };
1490
- var mdxRenderer = new MdxRenderer();
1491
- function buildMdxHydrationScript() {
1492
- return `
1493
- <script>
1494
- (function() {
1495
- // MDX hydration requires React and component definitions
1496
- if (typeof React === 'undefined' || typeof ReactDOM === 'undefined') {
1497
- console.warn('[FrontMCP] React not available for MDX hydration');
1498
- return;
1499
- }
1500
-
1501
- // Find all elements marked for MDX hydration
1502
- document.querySelectorAll('[data-mdx-hydrate]').forEach(function(root) {
1503
- var propsJson = root.getAttribute('data-props');
1504
- var props = propsJson ? JSON.parse(propsJson) : {};
1505
-
1506
- // MDX content is pre-rendered, hydration mainly attaches event handlers
1507
- // For full interactivity, components need to be available client-side
1508
- if (window.__frontmcp_mdx_content) {
1509
- try {
1510
- ReactDOM.hydrateRoot(root, React.createElement(
1511
- window.__frontmcp_mdx_content,
1512
- props
1513
- ));
1514
- } catch (e) {
1515
- console.error('[FrontMCP] MDX hydration failed', e);
1516
- }
1517
- }
1518
- });
1519
- })();
1520
- </script>
1521
- `;
1522
- }
1456
+ var mdxClientRenderer = new MdxClientRenderer();
1523
1457
 
1524
1458
  // libs/uipack/src/renderers/utils/transpiler.ts
1525
1459
  var DEFAULT_SWC_OPTIONS = {
@@ -1534,7 +1468,10 @@ async function loadSwcTransform() {
1534
1468
  return swcTransform;
1535
1469
  }
1536
1470
  try {
1537
- const swc = await import("@swc/core");
1471
+ const swc = await import(
1472
+ /* webpackIgnore: true */
1473
+ "@swc/core"
1474
+ );
1538
1475
  swcTransform = swc.transform;
1539
1476
  return swcTransform;
1540
1477
  } catch {
@@ -1589,50 +1526,23 @@ async function isSwcAvailable() {
1589
1526
  const transform = await loadSwcTransform();
1590
1527
  return transform !== null;
1591
1528
  }
1592
- async function executeTranspiledCode(code, context = {}) {
1593
- let React;
1594
- let jsxRuntime;
1595
- try {
1596
- React = await import("react");
1597
- jsxRuntime = await import("react/jsx-runtime");
1598
- } catch {
1599
- throw new Error("React is required for JSX templates. Install react: npm install react react-dom");
1600
- }
1601
- const exports = {};
1602
- const module = { exports };
1603
- const require2 = (id) => {
1604
- switch (id) {
1605
- case "react":
1606
- return React;
1607
- case "react/jsx-runtime":
1608
- return jsxRuntime;
1609
- case "react/jsx-dev-runtime":
1610
- return jsxRuntime;
1611
- default:
1612
- if (context[id]) {
1613
- return context[id];
1614
- }
1615
- throw new Error(`Module '${id}' not available in JSX template context`);
1616
- }
1617
- };
1618
- try {
1619
- const fn = new Function("exports", "require", "module", "__filename", "__dirname", "React", "context", code);
1620
- fn(exports, require2, module, "template.js", "/", React, context);
1621
- return module.exports["default"] || module.exports[Object.keys(module.exports)[0]] || module.exports;
1622
- } catch (error) {
1623
- throw new Error(`Failed to execute transpiled JSX: ${error instanceof Error ? error.message : String(error)}`);
1624
- }
1529
+ async function executeTranspiledCode(_code, _context = {}) {
1530
+ throw new Error(
1531
+ 'executeTranspiledCode has been moved to @frontmcp/ui/renderers. Install @frontmcp/ui and import from there: import { executeTranspiledCode } from "@frontmcp/ui/renderers"'
1532
+ );
1625
1533
  }
1626
- async function transpileAndExecute(source, context = {}) {
1627
- const result = await transpileJsx(source);
1628
- return executeTranspiledCode(result.code, context);
1534
+ async function transpileAndExecute(_source, _context = {}) {
1535
+ throw new Error(
1536
+ 'transpileAndExecute has been moved to @frontmcp/ui/renderers. Install @frontmcp/ui and import from there: import { transpileAndExecute } from "@frontmcp/ui/renderers"'
1537
+ );
1629
1538
  }
1630
1539
  export {
1631
1540
  HtmlRenderer,
1632
- MdxRenderer,
1541
+ MdxClientRenderer,
1633
1542
  RendererRegistry,
1634
1543
  TranspileCache,
1635
- buildMdxHydrationScript,
1544
+ buildReactCdnUrls,
1545
+ componentCache,
1636
1546
  containsJsx,
1637
1547
  containsMdxSyntax,
1638
1548
  detectTemplateType,
@@ -1645,8 +1555,7 @@ export {
1645
1555
  isReactComponent,
1646
1556
  isSwcAvailable,
1647
1557
  isTemplateBuilderFunction,
1648
- mdxRenderer,
1649
- renderCache,
1558
+ mdxClientRenderer,
1650
1559
  rendererRegistry,
1651
1560
  transpileAndExecute,
1652
1561
  transpileCache,
@@ -8,13 +8,6 @@ var __export = (target, all) => {
8
8
  __defProp(target, name, { get: all[name], enumerable: true });
9
9
  };
10
10
 
11
- // libs/uipack/src/utils/safe-stringify.ts
12
- var init_safe_stringify = __esm({
13
- "libs/uipack/src/utils/safe-stringify.ts"() {
14
- "use strict";
15
- }
16
- });
17
-
18
11
  // libs/uipack/src/utils/escape-html.ts
19
12
  function escapeHtml(str) {
20
13
  if (str === null || str === void 0) {
@@ -33,7 +26,6 @@ var init_escape_html = __esm({
33
26
  var init_utils = __esm({
34
27
  "libs/uipack/src/utils/index.ts"() {
35
28
  "use strict";
36
- init_safe_stringify();
37
29
  init_escape_html();
38
30
  }
39
31
  });
@@ -264,7 +256,6 @@ var init_helpers = __esm({
264
256
  // libs/uipack/src/handlebars/expression-extractor.ts
265
257
  function extractExpressions(template) {
266
258
  const expressions = [];
267
- const lines = template.split("\n");
268
259
  const positionMap = buildPositionMap(template);
269
260
  let match;
270
261
  EXPRESSION_REGEX.lastIndex = 0;
@@ -884,7 +875,7 @@ var init_mdx_adapter = __esm({
884
875
  return this.renderMarkdown(source, context);
885
876
  }
886
877
  try {
887
- const compiled = await this.mdxRuntime.compile(source, {
878
+ const _compiled = await this.mdxRuntime.compile(source, {
888
879
  outputFormat: "function-body",
889
880
  development: false
890
881
  });
@@ -2405,9 +2396,6 @@ var scriptCache = /* @__PURE__ */ new Map();
2405
2396
  function getCachedScript(url) {
2406
2397
  return scriptCache.get(url);
2407
2398
  }
2408
- function isScriptCached(url) {
2409
- return scriptCache.has(url);
2410
- }
2411
2399
  function buildFontPreconnect() {
2412
2400
  return CDN.fonts.preconnect.map((url, i) => `<link rel="preconnect" href="${url}"${i > 0 ? " crossorigin" : ""}>`).join("\n ");
2413
2401
  }
@@ -2440,8 +2428,9 @@ function buildCdnScripts(options = {}) {
2440
2428
  const scripts = [];
2441
2429
  if (inline) {
2442
2430
  if (tailwind) {
2443
- if (isScriptCached(CDN.tailwind)) {
2444
- scripts.push(buildInlineScriptTag(getCachedScript(CDN.tailwind)));
2431
+ const cached = getCachedScript(CDN.tailwind);
2432
+ if (cached) {
2433
+ scripts.push(buildInlineScriptTag(cached));
2445
2434
  } else {
2446
2435
  console.warn(
2447
2436
  "[frontmcp/ui] Inline mode requested but Tailwind script not cached. Call fetchAndCacheScripts() first."
@@ -2449,8 +2438,9 @@ function buildCdnScripts(options = {}) {
2449
2438
  }
2450
2439
  }
2451
2440
  if (htmx) {
2452
- if (isScriptCached(CDN.htmx.url)) {
2453
- scripts.push(buildInlineScriptTag(getCachedScript(CDN.htmx.url)));
2441
+ const cached = getCachedScript(CDN.htmx.url);
2442
+ if (cached) {
2443
+ scripts.push(buildInlineScriptTag(cached));
2454
2444
  } else {
2455
2445
  console.warn(
2456
2446
  "[frontmcp/ui] Inline mode requested but HTMX script not cached. Call fetchAndCacheScripts() first."
@@ -2458,8 +2448,9 @@ function buildCdnScripts(options = {}) {
2458
2448
  }
2459
2449
  }
2460
2450
  if (alpine) {
2461
- if (isScriptCached(CDN.alpine.url)) {
2462
- scripts.push(buildInlineScriptTag(getCachedScript(CDN.alpine.url)));
2451
+ const cached = getCachedScript(CDN.alpine.url);
2452
+ if (cached) {
2453
+ scripts.push(buildInlineScriptTag(cached));
2463
2454
  } else {
2464
2455
  console.warn(
2465
2456
  "[frontmcp/ui] Inline mode requested but Alpine.js script not cached. Call fetchAndCacheScripts() first."
@@ -2467,8 +2458,9 @@ function buildCdnScripts(options = {}) {
2467
2458
  }
2468
2459
  }
2469
2460
  if (icons) {
2470
- if (isScriptCached(CDN.icons.url)) {
2471
- scripts.push(buildInlineScriptTag(getCachedScript(CDN.icons.url)));
2461
+ const cached = getCachedScript(CDN.icons.url);
2462
+ if (cached) {
2463
+ scripts.push(buildInlineScriptTag(cached));
2472
2464
  } else {
2473
2465
  console.warn(
2474
2466
  "[frontmcp/ui] Inline mode requested but Lucide icons script not cached. Call fetchAndCacheScripts() first."
@@ -2510,11 +2502,12 @@ var CLAUDE_PLATFORM = {
2510
2502
  id: "claude",
2511
2503
  name: "Claude (Artifacts)",
2512
2504
  supportsWidgets: true,
2505
+ // Claude Artifacts support interactive widgets
2513
2506
  supportsTailwind: true,
2514
2507
  supportsHtmx: false,
2515
2508
  // Network blocked, HTMX won't work for API calls
2516
- networkMode: "blocked",
2517
- scriptStrategy: "inline",
2509
+ networkMode: "limited",
2510
+ scriptStrategy: "cdn",
2518
2511
  maxInlineSize: 100 * 1024,
2519
2512
  // 100KB limit for artifacts
2520
2513
  cspRestrictions: ["script-src 'unsafe-inline'", "connect-src 'none'"],
@@ -2770,17 +2763,31 @@ function emitColorScale(lines, name, scale) {
2770
2763
  if (value) lines.push(`--color-${name}-${shade}: ${value};`);
2771
2764
  }
2772
2765
  }
2766
+ var OPACITY_VARIANTS = [10, 20, 30, 50, 70, 90];
2767
+ function emitColorWithOpacityVariants(lines, name, value) {
2768
+ lines.push(`--color-${name}: ${value};`);
2769
+ for (const opacity of OPACITY_VARIANTS) {
2770
+ lines.push(`--color-${name}-${opacity}: color-mix(in oklch, ${value} ${opacity}%, transparent);`);
2771
+ }
2772
+ }
2773
+ function emitBrandColorWithVariants(lines, name, value) {
2774
+ lines.push(`--color-${name}: ${value};`);
2775
+ lines.push(`--color-${name}-hover: color-mix(in oklch, ${value} 85%, black);`);
2776
+ for (const opacity of OPACITY_VARIANTS) {
2777
+ lines.push(`--color-${name}-${opacity}: color-mix(in oklch, ${value} ${opacity}%, transparent);`);
2778
+ }
2779
+ }
2773
2780
  function buildThemeCss(theme) {
2774
2781
  const lines = [];
2775
2782
  const semantic = theme.colors.semantic;
2776
2783
  if (typeof semantic.primary === "string") {
2777
- lines.push(`--color-primary: ${semantic.primary};`);
2784
+ emitBrandColorWithVariants(lines, "primary", semantic.primary);
2778
2785
  } else if (semantic.primary) {
2779
2786
  emitColorScale(lines, "primary", semantic.primary);
2780
2787
  }
2781
2788
  if (semantic.secondary) {
2782
2789
  if (typeof semantic.secondary === "string") {
2783
- lines.push(`--color-secondary: ${semantic.secondary};`);
2790
+ emitBrandColorWithVariants(lines, "secondary", semantic.secondary);
2784
2791
  } else {
2785
2792
  emitColorScale(lines, "secondary", semantic.secondary);
2786
2793
  }
@@ -2799,10 +2806,10 @@ function buildThemeCss(theme) {
2799
2806
  emitColorScale(lines, "neutral", semantic.neutral);
2800
2807
  }
2801
2808
  }
2802
- if (semantic.success) lines.push(`--color-success: ${semantic.success};`);
2803
- if (semantic.warning) lines.push(`--color-warning: ${semantic.warning};`);
2804
- if (semantic.danger) lines.push(`--color-danger: ${semantic.danger};`);
2805
- if (semantic.info) lines.push(`--color-info: ${semantic.info};`);
2809
+ if (semantic.success) emitColorWithOpacityVariants(lines, "success", semantic.success);
2810
+ if (semantic.warning) emitColorWithOpacityVariants(lines, "warning", semantic.warning);
2811
+ if (semantic.danger) emitColorWithOpacityVariants(lines, "danger", semantic.danger);
2812
+ if (semantic.info) emitColorWithOpacityVariants(lines, "info", semantic.info);
2806
2813
  const surface = theme.colors.surface;
2807
2814
  if (surface?.background) lines.push(`--color-background: ${surface.background};`);
2808
2815
  if (surface?.surface) lines.push(`--color-surface: ${surface.surface};`);
@@ -4570,13 +4577,13 @@ function getToolUIMimeType(platform = "generic") {
4570
4577
  }
4571
4578
  }
4572
4579
  var CLOUDFLARE_CDN = {
4573
- tailwindCss: "https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.2.19/tailwind.min.css",
4580
+ tailwindCss: "https://cdnjs.cloudflare.com/ajax/libs/tailwindcss-browser/4.1.13/index.global.min.js",
4574
4581
  htmx: "https://cdnjs.cloudflare.com/ajax/libs/htmx/2.0.4/htmx.min.js",
4575
4582
  alpinejs: "https://cdnjs.cloudflare.com/ajax/libs/alpinejs/3.14.3/cdn.min.js"
4576
4583
  };
4577
4584
  function wrapToolUIForClaude(options) {
4578
4585
  const { content, toolName, input = {}, output, title, includeHtmx = false, includeAlpine = false } = options;
4579
- const tailwindCss = `<link href="${CLOUDFLARE_CDN.tailwindCss}" rel="stylesheet">`;
4586
+ const tailwindCss = `<script src="${CLOUDFLARE_CDN.tailwindCss}" crossorigin="anonymous"></script>`;
4580
4587
  const htmxScript = includeHtmx ? `<script src="${CLOUDFLARE_CDN.htmx}" crossorigin="anonymous"></script>` : "";
4581
4588
  const alpineScript = includeAlpine ? `<script src="${CLOUDFLARE_CDN.alpinejs}" crossorigin="anonymous" defer></script>` : "";
4582
4589
  const helpers = createTemplateHelpers();
@@ -4833,16 +4840,18 @@ var RendererRuntime = class {
4833
4840
  * Get or load an adapter for a UI type.
4834
4841
  */
4835
4842
  async getAdapter(type, content) {
4836
- if (this.adapters.has(type)) {
4837
- return this.adapters.get(type);
4843
+ const cachedAdapter = this.adapters.get(type);
4844
+ if (cachedAdapter) {
4845
+ return cachedAdapter;
4838
4846
  }
4839
4847
  let resolvedType = type;
4840
4848
  if (type === "auto" && content) {
4841
4849
  resolvedType = this.detectType(content);
4842
4850
  this.log("Auto-detected type:", resolvedType);
4843
4851
  }
4844
- if (this.adapters.has(resolvedType)) {
4845
- return this.adapters.get(resolvedType);
4852
+ const resolvedAdapter = this.adapters.get(resolvedType);
4853
+ if (resolvedAdapter) {
4854
+ return resolvedAdapter;
4846
4855
  }
4847
4856
  const adapter = await loadAdapter(resolvedType);
4848
4857
  if (adapter) {
@@ -24,7 +24,7 @@ var BADGE_VARIANTS = {
24
24
  success: "bg-success/10 text-success",
25
25
  warning: "bg-warning/10 text-warning",
26
26
  danger: "bg-danger/10 text-danger",
27
- info: "bg-blue-100 text-blue-800",
27
+ info: "bg-info/10 text-info",
28
28
  outline: "border border-border text-text-primary bg-transparent"
29
29
  };
30
30
  var BADGE_SIZES = {
@@ -44,7 +44,7 @@ var BADGE_DOT_VARIANTS = {
44
44
  success: "bg-success",
45
45
  warning: "bg-warning",
46
46
  danger: "bg-danger",
47
- info: "bg-blue-500",
47
+ info: "bg-info",
48
48
  outline: "border border-current"
49
49
  };
50
50
  function getBadgeVariantClasses(variant) {
@@ -62,7 +62,7 @@ function getBadgeDotVariantClasses(variant) {
62
62
  var BUTTON_VARIANTS = {
63
63
  primary: "bg-primary hover:bg-primary/90 text-white shadow-sm",
64
64
  secondary: "bg-secondary hover:bg-secondary/90 text-white shadow-sm",
65
- outline: "border-2 border-primary text-primary hover:bg-primary/10",
65
+ outline: "border-2 border-primary text-primary bg-transparent hover:bg-primary/10",
66
66
  ghost: "text-text-primary hover:bg-gray-100",
67
67
  danger: "bg-danger hover:bg-danger/90 text-white shadow-sm",
68
68
  success: "bg-success hover:bg-success/90 text-white shadow-sm",
@@ -82,7 +82,7 @@ var BUTTON_ICON_SIZES = {
82
82
  lg: "p-3",
83
83
  xl: "p-4"
84
84
  };
85
- var BUTTON_BASE_CLASSES = "inline-flex items-center justify-center font-medium rounded-lg transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:ring-offset-2";
85
+ var BUTTON_BASE_CLASSES = "cursor-pointer inline-flex items-center justify-center font-medium rounded-lg transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:ring-offset-2";
86
86
  function getButtonVariantClasses(variant) {
87
87
  return BUTTON_VARIANTS[variant];
88
88
  }
@@ -91,8 +91,8 @@ function getButtonSizeClasses(size, iconOnly) {
91
91
  }
92
92
  var ALERT_VARIANTS = {
93
93
  info: {
94
- container: "bg-blue-50 border-blue-200 text-blue-800",
95
- icon: "text-blue-500"
94
+ container: "bg-info/10 border-info/30 text-info",
95
+ icon: "text-info"
96
96
  },
97
97
  success: {
98
98
  container: "bg-success/10 border-success/30 text-success",