@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,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LLM Platform Configurations
|
|
3
|
+
*
|
|
4
|
+
* Different LLM platforms have different capabilities for rendering UI:
|
|
5
|
+
* - OpenAI: Full support (Canvas/Apps SDK) - Tailwind + HTMX with network
|
|
6
|
+
* - Claude: Artifacts mode - Tailwind but NO network (scripts must be inlined)
|
|
7
|
+
* - Gemini: No interactive widget support
|
|
8
|
+
* - Custom MCP: Configurable based on client capabilities
|
|
9
|
+
*
|
|
10
|
+
* This module provides platform presets and utilities for building
|
|
11
|
+
* compatible UI across different environments.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Known LLM platform identifiers
|
|
15
|
+
*/
|
|
16
|
+
export type PlatformId = 'openai' | 'claude' | 'gemini' | 'ngrok' | 'custom';
|
|
17
|
+
/**
|
|
18
|
+
* Network access mode for the platform
|
|
19
|
+
*/
|
|
20
|
+
export type NetworkMode = 'full' | 'blocked' | 'limited';
|
|
21
|
+
/**
|
|
22
|
+
* Script loading strategy
|
|
23
|
+
*/
|
|
24
|
+
export type ScriptStrategy = 'cdn' | 'inline' | 'cached';
|
|
25
|
+
/**
|
|
26
|
+
* Platform capabilities configuration
|
|
27
|
+
*/
|
|
28
|
+
export interface PlatformCapabilities {
|
|
29
|
+
/** Platform identifier */
|
|
30
|
+
id: PlatformId;
|
|
31
|
+
/** Human-readable name */
|
|
32
|
+
name: string;
|
|
33
|
+
/** Whether platform supports interactive widgets */
|
|
34
|
+
supportsWidgets: boolean;
|
|
35
|
+
/** Whether platform supports Tailwind CSS */
|
|
36
|
+
supportsTailwind: boolean;
|
|
37
|
+
/** Whether platform supports HTMX/dynamic content */
|
|
38
|
+
supportsHtmx: boolean;
|
|
39
|
+
/** Network access mode */
|
|
40
|
+
networkMode: NetworkMode;
|
|
41
|
+
/** How to load scripts */
|
|
42
|
+
scriptStrategy: ScriptStrategy;
|
|
43
|
+
/** Allowed domains for network requests (if limited) */
|
|
44
|
+
allowedDomains?: string[];
|
|
45
|
+
/** Content Security Policy restrictions */
|
|
46
|
+
cspRestrictions?: string[];
|
|
47
|
+
/** Maximum inline script size (bytes) */
|
|
48
|
+
maxInlineSize?: number;
|
|
49
|
+
/** Additional platform-specific options */
|
|
50
|
+
options?: Record<string, unknown>;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* OpenAI Platform Configuration
|
|
54
|
+
* Full support via Canvas/Apps SDK
|
|
55
|
+
*/
|
|
56
|
+
export declare const OPENAI_PLATFORM: PlatformCapabilities;
|
|
57
|
+
/**
|
|
58
|
+
* Claude Platform Configuration
|
|
59
|
+
* Artifacts mode - no network access, must inline scripts
|
|
60
|
+
*/
|
|
61
|
+
export declare const CLAUDE_PLATFORM: PlatformCapabilities;
|
|
62
|
+
/**
|
|
63
|
+
* Gemini Platform Configuration
|
|
64
|
+
* No interactive widget support
|
|
65
|
+
*/
|
|
66
|
+
export declare const GEMINI_PLATFORM: PlatformCapabilities;
|
|
67
|
+
/**
|
|
68
|
+
* Ngrok Platform Configuration
|
|
69
|
+
* Bridge/tunnel - essential for HTMX
|
|
70
|
+
*/
|
|
71
|
+
export declare const NGROK_PLATFORM: PlatformCapabilities;
|
|
72
|
+
/**
|
|
73
|
+
* Default custom MCP client configuration
|
|
74
|
+
*/
|
|
75
|
+
export declare const CUSTOM_PLATFORM: PlatformCapabilities;
|
|
76
|
+
/**
|
|
77
|
+
* All platform presets
|
|
78
|
+
*/
|
|
79
|
+
export declare const PLATFORM_PRESETS: Record<PlatformId, PlatformCapabilities>;
|
|
80
|
+
/**
|
|
81
|
+
* Get platform capabilities by ID
|
|
82
|
+
*/
|
|
83
|
+
export declare function getPlatform(id: PlatformId): PlatformCapabilities;
|
|
84
|
+
/**
|
|
85
|
+
* Create custom platform configuration
|
|
86
|
+
*/
|
|
87
|
+
export declare function createPlatform(base: Partial<PlatformCapabilities> & {
|
|
88
|
+
id: PlatformId;
|
|
89
|
+
name: string;
|
|
90
|
+
}): PlatformCapabilities;
|
|
91
|
+
/**
|
|
92
|
+
* Check if platform can use CDN resources
|
|
93
|
+
*/
|
|
94
|
+
export declare function canUseCdn(platform: PlatformCapabilities): boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Check if platform needs inlined scripts
|
|
97
|
+
*/
|
|
98
|
+
export declare function needsInlineScripts(platform: PlatformCapabilities): boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Check if platform supports full interactivity
|
|
101
|
+
*/
|
|
102
|
+
export declare function supportsFullInteractivity(platform: PlatformCapabilities): boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Get fallback rendering mode for unsupported platforms
|
|
105
|
+
*/
|
|
106
|
+
export declare function getFallbackMode(platform: PlatformCapabilities): 'html' | 'markdown' | 'text';
|
|
107
|
+
//# sourceMappingURL=platforms.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platforms.d.ts","sourceRoot":"","sources":["../../../src/theme/platforms.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE7E;;GAEG;AACH,MAAM,MAAM,WAAW,GACnB,MAAM,GACN,SAAS,GACT,SAAS,CAAC;AAEd;;GAEG;AACH,MAAM,MAAM,cAAc,GACtB,KAAK,GACL,QAAQ,GACR,QAAQ,CAAC;AAEb;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,0BAA0B;IAC1B,EAAE,EAAE,UAAU,CAAC;IAEf,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IAEb,oDAAoD;IACpD,eAAe,EAAE,OAAO,CAAC;IAEzB,6CAA6C;IAC7C,gBAAgB,EAAE,OAAO,CAAC;IAE1B,qDAAqD;IACrD,YAAY,EAAE,OAAO,CAAC;IAEtB,0BAA0B;IAC1B,WAAW,EAAE,WAAW,CAAC;IAEzB,0BAA0B;IAC1B,cAAc,EAAE,cAAc,CAAC;IAE/B,wDAAwD;IACxD,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B,2CAA2C;IAC3C,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAE3B,yCAAyC;IACzC,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAMD;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,oBAY7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,oBAc7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,oBAW7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,oBAW5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,oBAQ7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,UAAU,EAAE,oBAAoB,CAMrE,CAAC;AAMF;;GAEG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,UAAU,GAAG,oBAAoB,CAEhE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,OAAO,CAAC,oBAAoB,CAAC,GAAG;IAAE,EAAE,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACrE,oBAAoB,CAGtB;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,oBAAoB,GAAG,OAAO,CAEjE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,oBAAoB,GAAG,OAAO,CAE1E;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,oBAAoB,GAAG,OAAO,CAEjF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,oBAAoB,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,CAQ5F"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file github-openai.ts
|
|
3
|
+
* @description Default theme with GitHub/OpenAI gray-black aesthetic.
|
|
4
|
+
*
|
|
5
|
+
* This is the new default theme for @frontmcp/uipack, featuring a monochromatic
|
|
6
|
+
* gray-black color palette inspired by GitHub and OpenAI's design systems.
|
|
7
|
+
* Includes system UI font stack, smaller border radii, and subtle shadows.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import { GITHUB_OPENAI_THEME, createTheme } from '@frontmcp/uipack';
|
|
12
|
+
*
|
|
13
|
+
* // Use directly
|
|
14
|
+
* baseLayout(content, { theme: GITHUB_OPENAI_THEME });
|
|
15
|
+
*
|
|
16
|
+
* // Or extend
|
|
17
|
+
* const myTheme = createTheme({
|
|
18
|
+
* colors: { semantic: { primary: '#0969da' } },
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @module @frontmcp/uipack/theme/presets/github-openai
|
|
23
|
+
*/
|
|
24
|
+
import type { ThemeConfig } from '../theme';
|
|
25
|
+
/**
|
|
26
|
+
* GitHub/OpenAI inspired default theme
|
|
27
|
+
*
|
|
28
|
+
* Color palette:
|
|
29
|
+
* - Primary: #24292f (near-black for primary actions)
|
|
30
|
+
* - Secondary: #57606a (medium gray for secondary)
|
|
31
|
+
* - Accent: #0969da (blue accent for links/highlights)
|
|
32
|
+
* - Success: #1a7f37 (GitHub green)
|
|
33
|
+
* - Warning: #9a6700 (amber warning)
|
|
34
|
+
* - Danger: #cf222e (GitHub red)
|
|
35
|
+
*
|
|
36
|
+
* Typography:
|
|
37
|
+
* - System UI font stack (Apple/GitHub style)
|
|
38
|
+
* - Monospace: ui-monospace, SFMono-Regular
|
|
39
|
+
*
|
|
40
|
+
* Design tokens:
|
|
41
|
+
* - Smaller border radii (6px default)
|
|
42
|
+
* - Subtle shadows with gray tones
|
|
43
|
+
* - Light gray borders (#d0d7de)
|
|
44
|
+
*/
|
|
45
|
+
export declare const GITHUB_OPENAI_THEME: ThemeConfig;
|
|
46
|
+
/**
|
|
47
|
+
* Export as DEFAULT_THEME for backwards compatibility
|
|
48
|
+
*/
|
|
49
|
+
export declare const DEFAULT_THEME: ThemeConfig;
|
|
50
|
+
//# sourceMappingURL=github-openai.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-openai.d.ts","sourceRoot":"","sources":["../../../../src/theme/presets/github-openai.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,mBAAmB,EAAE,WA+IjC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,aAAsB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file index.ts
|
|
3
|
+
* @description Theme presets module exports.
|
|
4
|
+
*
|
|
5
|
+
* Provides pre-configured theme presets for different design aesthetics.
|
|
6
|
+
* The GitHub/OpenAI theme is the default for all @frontmcp/uipack components.
|
|
7
|
+
*
|
|
8
|
+
* @module @frontmcp/uipack/theme/presets
|
|
9
|
+
*/
|
|
10
|
+
export { GITHUB_OPENAI_THEME, DEFAULT_THEME } from './github-openai';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/theme/presets/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file theme.ts
|
|
3
|
+
* @description Theme Configuration System for FrontMCP UI.
|
|
4
|
+
*
|
|
5
|
+
* Provides a comprehensive theming system with:
|
|
6
|
+
* - Color palettes with semantic naming
|
|
7
|
+
* - Typography configuration
|
|
8
|
+
* - Spacing and sizing
|
|
9
|
+
* - Component-specific tokens
|
|
10
|
+
* - Customizable CDN URLs for fonts, icons, and scripts
|
|
11
|
+
* - Dark mode support
|
|
12
|
+
* - Tailwind CSS v4 @theme integration
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* import { createTheme, DEFAULT_THEME } from '@frontmcp/uipack/theme';
|
|
17
|
+
*
|
|
18
|
+
* // Use the default GitHub/OpenAI theme
|
|
19
|
+
* const theme = DEFAULT_THEME;
|
|
20
|
+
*
|
|
21
|
+
* // Or create a custom theme
|
|
22
|
+
* const customTheme = createTheme({
|
|
23
|
+
* colors: {
|
|
24
|
+
* semantic: { primary: '#0969da' },
|
|
25
|
+
* },
|
|
26
|
+
* cdn: {
|
|
27
|
+
* fonts: {
|
|
28
|
+
* preconnect: ['https://fonts.googleapis.com'],
|
|
29
|
+
* stylesheets: ['https://fonts.googleapis.com/css2?family=Roboto&display=swap'],
|
|
30
|
+
* },
|
|
31
|
+
* },
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @module @frontmcp/uipack/theme
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* Deep partial type - makes all properties and nested properties optional
|
|
39
|
+
*/
|
|
40
|
+
export type DeepPartial<T> = T extends object ? {
|
|
41
|
+
[P in keyof T]?: DeepPartial<T[P]>;
|
|
42
|
+
} : T;
|
|
43
|
+
/**
|
|
44
|
+
* Semantic color scale (50-950)
|
|
45
|
+
*/
|
|
46
|
+
export interface ColorScale {
|
|
47
|
+
50?: string;
|
|
48
|
+
100?: string;
|
|
49
|
+
200?: string;
|
|
50
|
+
300?: string;
|
|
51
|
+
400?: string;
|
|
52
|
+
500?: string;
|
|
53
|
+
600?: string;
|
|
54
|
+
700?: string;
|
|
55
|
+
800?: string;
|
|
56
|
+
900?: string;
|
|
57
|
+
950?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Semantic color tokens
|
|
61
|
+
*/
|
|
62
|
+
export interface SemanticColors {
|
|
63
|
+
/** Primary brand color */
|
|
64
|
+
primary: string | ColorScale;
|
|
65
|
+
/** Secondary brand color */
|
|
66
|
+
secondary?: string | ColorScale;
|
|
67
|
+
/** Accent/highlight color */
|
|
68
|
+
accent?: string | ColorScale;
|
|
69
|
+
/** Neutral/gray tones */
|
|
70
|
+
neutral?: string | ColorScale;
|
|
71
|
+
/** Success state */
|
|
72
|
+
success?: string;
|
|
73
|
+
/** Warning state */
|
|
74
|
+
warning?: string;
|
|
75
|
+
/** Error/danger state */
|
|
76
|
+
danger?: string;
|
|
77
|
+
/** Info state */
|
|
78
|
+
info?: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Surface colors for backgrounds
|
|
82
|
+
*/
|
|
83
|
+
export interface SurfaceColors {
|
|
84
|
+
/** Page background */
|
|
85
|
+
background?: string;
|
|
86
|
+
/** Card/panel background */
|
|
87
|
+
surface?: string;
|
|
88
|
+
/** Elevated surface (modal, dropdown) */
|
|
89
|
+
elevated?: string;
|
|
90
|
+
/** Overlay/backdrop */
|
|
91
|
+
overlay?: string;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Text colors
|
|
95
|
+
*/
|
|
96
|
+
export interface TextColors {
|
|
97
|
+
/** Primary text */
|
|
98
|
+
primary?: string;
|
|
99
|
+
/** Secondary/muted text */
|
|
100
|
+
secondary?: string;
|
|
101
|
+
/** Disabled text */
|
|
102
|
+
disabled?: string;
|
|
103
|
+
/** Inverse text (on dark backgrounds) */
|
|
104
|
+
inverse?: string;
|
|
105
|
+
/** Link text */
|
|
106
|
+
link?: string;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Border colors
|
|
110
|
+
*/
|
|
111
|
+
export interface BorderColors {
|
|
112
|
+
/** Default border */
|
|
113
|
+
default?: string;
|
|
114
|
+
/** Hover border */
|
|
115
|
+
hover?: string;
|
|
116
|
+
/** Focus border */
|
|
117
|
+
focus?: string;
|
|
118
|
+
/** Divider lines */
|
|
119
|
+
divider?: string;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Complete color configuration
|
|
123
|
+
*/
|
|
124
|
+
export interface ThemeColors {
|
|
125
|
+
/** Semantic colors */
|
|
126
|
+
semantic: SemanticColors;
|
|
127
|
+
/** Surface/background colors */
|
|
128
|
+
surface?: SurfaceColors;
|
|
129
|
+
/** Text colors */
|
|
130
|
+
text?: TextColors;
|
|
131
|
+
/** Border colors */
|
|
132
|
+
border?: BorderColors;
|
|
133
|
+
/** Additional custom colors */
|
|
134
|
+
custom?: Record<string, string>;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Font family configuration
|
|
138
|
+
*/
|
|
139
|
+
export interface FontFamilies {
|
|
140
|
+
/** Sans-serif (default) */
|
|
141
|
+
sans?: string;
|
|
142
|
+
/** Serif */
|
|
143
|
+
serif?: string;
|
|
144
|
+
/** Monospace */
|
|
145
|
+
mono?: string;
|
|
146
|
+
/** Display/heading */
|
|
147
|
+
display?: string;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Font size configuration
|
|
151
|
+
*/
|
|
152
|
+
export interface FontSizes {
|
|
153
|
+
xs?: string;
|
|
154
|
+
sm?: string;
|
|
155
|
+
base?: string;
|
|
156
|
+
lg?: string;
|
|
157
|
+
xl?: string;
|
|
158
|
+
'2xl'?: string;
|
|
159
|
+
'3xl'?: string;
|
|
160
|
+
'4xl'?: string;
|
|
161
|
+
'5xl'?: string;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Font weight configuration
|
|
165
|
+
*/
|
|
166
|
+
export interface FontWeights {
|
|
167
|
+
normal?: string;
|
|
168
|
+
medium?: string;
|
|
169
|
+
semibold?: string;
|
|
170
|
+
bold?: string;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Complete typography configuration
|
|
174
|
+
*/
|
|
175
|
+
export interface ThemeTypography {
|
|
176
|
+
families?: FontFamilies;
|
|
177
|
+
sizes?: FontSizes;
|
|
178
|
+
weights?: FontWeights;
|
|
179
|
+
lineHeight?: {
|
|
180
|
+
tight?: string;
|
|
181
|
+
normal?: string;
|
|
182
|
+
relaxed?: string;
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Spacing scale
|
|
187
|
+
*/
|
|
188
|
+
export interface ThemeSpacing {
|
|
189
|
+
px?: string;
|
|
190
|
+
0?: string;
|
|
191
|
+
1?: string;
|
|
192
|
+
2?: string;
|
|
193
|
+
3?: string;
|
|
194
|
+
4?: string;
|
|
195
|
+
5?: string;
|
|
196
|
+
6?: string;
|
|
197
|
+
8?: string;
|
|
198
|
+
10?: string;
|
|
199
|
+
12?: string;
|
|
200
|
+
16?: string;
|
|
201
|
+
20?: string;
|
|
202
|
+
24?: string;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Border radius
|
|
206
|
+
*/
|
|
207
|
+
export interface ThemeRadius {
|
|
208
|
+
none?: string;
|
|
209
|
+
sm?: string;
|
|
210
|
+
md?: string;
|
|
211
|
+
lg?: string;
|
|
212
|
+
xl?: string;
|
|
213
|
+
'2xl'?: string;
|
|
214
|
+
full?: string;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Shadow configuration
|
|
218
|
+
*/
|
|
219
|
+
export interface ThemeShadows {
|
|
220
|
+
sm?: string;
|
|
221
|
+
md?: string;
|
|
222
|
+
lg?: string;
|
|
223
|
+
xl?: string;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Button component tokens
|
|
227
|
+
*/
|
|
228
|
+
export interface ButtonTokens {
|
|
229
|
+
radius?: string;
|
|
230
|
+
paddingX?: string;
|
|
231
|
+
paddingY?: string;
|
|
232
|
+
fontSize?: string;
|
|
233
|
+
fontWeight?: string;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Card component tokens
|
|
237
|
+
*/
|
|
238
|
+
export interface CardTokens {
|
|
239
|
+
radius?: string;
|
|
240
|
+
padding?: string;
|
|
241
|
+
shadow?: string;
|
|
242
|
+
borderWidth?: string;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Input component tokens
|
|
246
|
+
*/
|
|
247
|
+
export interface InputTokens {
|
|
248
|
+
radius?: string;
|
|
249
|
+
paddingX?: string;
|
|
250
|
+
paddingY?: string;
|
|
251
|
+
borderWidth?: string;
|
|
252
|
+
focusRingWidth?: string;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Component-specific tokens
|
|
256
|
+
*/
|
|
257
|
+
export interface ComponentTokens {
|
|
258
|
+
button?: ButtonTokens;
|
|
259
|
+
card?: CardTokens;
|
|
260
|
+
input?: InputTokens;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Script resource with optional integrity hash
|
|
264
|
+
*/
|
|
265
|
+
export interface CdnScriptResource {
|
|
266
|
+
/** URL to the script */
|
|
267
|
+
url: string;
|
|
268
|
+
/** Subresource integrity hash */
|
|
269
|
+
integrity?: string;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Font CDN configuration
|
|
273
|
+
*/
|
|
274
|
+
export interface ThemeCdnFonts {
|
|
275
|
+
/** Preconnect URLs for font providers */
|
|
276
|
+
preconnect?: string[];
|
|
277
|
+
/** Font stylesheet URLs */
|
|
278
|
+
stylesheets?: string[];
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Icon CDN configuration
|
|
282
|
+
*/
|
|
283
|
+
export interface ThemeCdnIcons {
|
|
284
|
+
/** Icon library script */
|
|
285
|
+
script?: CdnScriptResource;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Scripts CDN configuration
|
|
289
|
+
*/
|
|
290
|
+
export interface ThemeCdnScripts {
|
|
291
|
+
/** Tailwind CSS Browser CDN URL */
|
|
292
|
+
tailwind?: string;
|
|
293
|
+
/** HTMX script resource */
|
|
294
|
+
htmx?: CdnScriptResource;
|
|
295
|
+
/** Alpine.js script resource */
|
|
296
|
+
alpine?: CdnScriptResource;
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Complete CDN configuration for theme
|
|
300
|
+
*
|
|
301
|
+
* Allows customizing all external resource URLs used by the theme.
|
|
302
|
+
* Useful for:
|
|
303
|
+
* - Using private CDN mirrors
|
|
304
|
+
* - Self-hosting resources
|
|
305
|
+
* - Compliance with CSP policies
|
|
306
|
+
* - Using different font families
|
|
307
|
+
*/
|
|
308
|
+
export interface ThemeCdnConfig {
|
|
309
|
+
/** Font configuration */
|
|
310
|
+
fonts?: ThemeCdnFonts;
|
|
311
|
+
/** Icon library configuration */
|
|
312
|
+
icons?: ThemeCdnIcons;
|
|
313
|
+
/** Script CDN configuration */
|
|
314
|
+
scripts?: ThemeCdnScripts;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Complete theme configuration
|
|
318
|
+
*/
|
|
319
|
+
export interface ThemeConfig {
|
|
320
|
+
/** Theme name/identifier */
|
|
321
|
+
name?: string;
|
|
322
|
+
/** Color configuration */
|
|
323
|
+
colors: ThemeColors;
|
|
324
|
+
/** Typography configuration */
|
|
325
|
+
typography?: ThemeTypography;
|
|
326
|
+
/** Spacing scale */
|
|
327
|
+
spacing?: ThemeSpacing;
|
|
328
|
+
/** Border radius */
|
|
329
|
+
radius?: ThemeRadius;
|
|
330
|
+
/** Shadows */
|
|
331
|
+
shadows?: ThemeShadows;
|
|
332
|
+
/** Component-specific tokens */
|
|
333
|
+
components?: ComponentTokens;
|
|
334
|
+
/** CDN resource configuration */
|
|
335
|
+
cdn?: ThemeCdnConfig;
|
|
336
|
+
/** Dark mode variant */
|
|
337
|
+
dark?: Partial<ThemeConfig>;
|
|
338
|
+
/** Additional CSS custom properties */
|
|
339
|
+
customVars?: Record<string, string>;
|
|
340
|
+
/** Additional CSS (outside @theme) */
|
|
341
|
+
customCss?: string;
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Default FrontMCP theme - GitHub/OpenAI inspired gray-black aesthetic
|
|
345
|
+
*
|
|
346
|
+
* Re-exported from presets for convenience. The default theme features:
|
|
347
|
+
* - Monochromatic gray-black color palette
|
|
348
|
+
* - System UI font stack
|
|
349
|
+
* - Smaller border radii (GitHub style)
|
|
350
|
+
* - Subtle shadows with gray tones
|
|
351
|
+
*
|
|
352
|
+
* @see ./presets/github-openai.ts for full theme definition
|
|
353
|
+
*/
|
|
354
|
+
export declare const GITHUB_OPENAI_THEME: ThemeConfig;
|
|
355
|
+
export declare const DEFAULT_THEME: ThemeConfig;
|
|
356
|
+
/**
|
|
357
|
+
* Deep merge two theme configurations
|
|
358
|
+
*
|
|
359
|
+
* @remarks
|
|
360
|
+
* Dark variant handling:
|
|
361
|
+
* - When override.dark is provided, it's merged on top of base.dark (if present) or base
|
|
362
|
+
* - The resulting dark variant never contains a nested .dark property
|
|
363
|
+
* - This prevents infinite recursion and ensures clean dark theme composition
|
|
364
|
+
*/
|
|
365
|
+
export declare function mergeThemes(base: ThemeConfig, override: DeepPartial<ThemeConfig>): ThemeConfig;
|
|
366
|
+
/**
|
|
367
|
+
* Create a theme by extending the default theme
|
|
368
|
+
*/
|
|
369
|
+
export declare function createTheme(overrides: Partial<ThemeConfig>): ThemeConfig;
|
|
370
|
+
/**
|
|
371
|
+
* Build Tailwind @theme CSS from theme configuration
|
|
372
|
+
*/
|
|
373
|
+
export declare function buildThemeCss(theme: ThemeConfig): string;
|
|
374
|
+
/**
|
|
375
|
+
* Build complete style block with @theme and custom CSS
|
|
376
|
+
*
|
|
377
|
+
* @remarks
|
|
378
|
+
* **Security/Trust Model:**
|
|
379
|
+
* The `theme.customCss` property is injected directly into a `<style>` tag without
|
|
380
|
+
* sanitization. This is intentional - CSS customization requires full CSS syntax support.
|
|
381
|
+
*
|
|
382
|
+
* **Trust assumptions:**
|
|
383
|
+
* - Theme configurations should only come from trusted sources (developer-defined themes)
|
|
384
|
+
* - Never pass user-provided input directly to `customCss`
|
|
385
|
+
* - If you need user-customizable styles, validate/sanitize them before including in a theme
|
|
386
|
+
*
|
|
387
|
+
* **Why no sanitization:**
|
|
388
|
+
* - CSS sanitization is complex and often breaks legitimate styles
|
|
389
|
+
* - The theme system is designed for developer use, not end-user customization
|
|
390
|
+
* - Developers creating themes are trusted to provide safe CSS
|
|
391
|
+
*
|
|
392
|
+
* @param theme - Theme configuration with optional customCss
|
|
393
|
+
* @returns HTML style block with Tailwind @theme directive
|
|
394
|
+
*/
|
|
395
|
+
export declare function buildStyleBlock(theme: ThemeConfig): string;
|
|
396
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/theme/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AASH;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GACzC;KACG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACnC,GACD,CAAC,CAAC;AAMN;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,0BAA0B;IAC1B,OAAO,EAAE,MAAM,GAAG,UAAU,CAAC;IAC7B,4BAA4B;IAC5B,SAAS,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAChC,6BAA6B;IAC7B,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAC7B,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