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