@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,421 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool UI Wrapper
|
|
3
|
+
*
|
|
4
|
+
* Wraps tool UI templates with the MCP Bridge runtime and
|
|
5
|
+
* integrates with the existing layout system for consistent styling.
|
|
6
|
+
*/
|
|
7
|
+
import type { WrapToolUIOptions, HostContext } from './types';
|
|
8
|
+
import { type ThemeConfig, type PlatformCapabilities, type DeepPartial } from '../theme';
|
|
9
|
+
import { escapeHtml } from '../utils';
|
|
10
|
+
import { type SanitizerFn } from './sanitizer';
|
|
11
|
+
/**
|
|
12
|
+
* Extended options for wrapToolUI that include theme and platform
|
|
13
|
+
*/
|
|
14
|
+
export interface WrapToolUIFullOptions extends WrapToolUIOptions {
|
|
15
|
+
/** Theme configuration */
|
|
16
|
+
theme?: DeepPartial<ThemeConfig>;
|
|
17
|
+
/** Target platform capabilities */
|
|
18
|
+
platform?: PlatformCapabilities;
|
|
19
|
+
/** Initial host context */
|
|
20
|
+
hostContext?: Partial<HostContext>;
|
|
21
|
+
/**
|
|
22
|
+
* Sanitize input before exposing to widget.
|
|
23
|
+
* This protects sensitive data from being exposed in client-side widgets.
|
|
24
|
+
*
|
|
25
|
+
* - `true`: Auto-detect and redact PII patterns (email, phone, SSN, credit card)
|
|
26
|
+
* - `string[]`: Redact values in fields with these names
|
|
27
|
+
* - `SanitizerFn`: Custom sanitizer function
|
|
28
|
+
* - `false` or `undefined`: No sanitization (default)
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* // Auto-detect PII
|
|
33
|
+
* wrapToolUI({ sanitizeInput: true, ... });
|
|
34
|
+
*
|
|
35
|
+
* // Redact specific fields
|
|
36
|
+
* wrapToolUI({ sanitizeInput: ['password', 'token', 'api_key'], ... });
|
|
37
|
+
*
|
|
38
|
+
* // Custom sanitizer
|
|
39
|
+
* wrapToolUI({
|
|
40
|
+
* sanitizeInput: (key, value) => key === 'secret' ? '[HIDDEN]' : value,
|
|
41
|
+
* ...
|
|
42
|
+
* });
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
sanitizeInput?: boolean | string[] | SanitizerFn;
|
|
46
|
+
/**
|
|
47
|
+
* The type of renderer used (for framework runtime injection).
|
|
48
|
+
* Auto-detected by renderToolTemplateAsync.
|
|
49
|
+
*/
|
|
50
|
+
rendererType?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Enable client-side hydration for React/MDX components.
|
|
53
|
+
*/
|
|
54
|
+
hydrate?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Skip CSP meta tag generation.
|
|
57
|
+
*
|
|
58
|
+
* OpenAI handles CSP through `_meta['openai/widgetCSP']` in the MCP response,
|
|
59
|
+
* not through HTML meta tags. When true, the CSP meta tag is omitted from the
|
|
60
|
+
* HTML output to avoid browser warnings about CSP meta tags outside <head>.
|
|
61
|
+
*
|
|
62
|
+
* @default false
|
|
63
|
+
*/
|
|
64
|
+
skipCspMeta?: boolean;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Create template helpers for use in template builder functions
|
|
68
|
+
*/
|
|
69
|
+
export declare function createTemplateHelpers(): {
|
|
70
|
+
/**
|
|
71
|
+
* Escape HTML special characters to prevent XSS
|
|
72
|
+
*/
|
|
73
|
+
escapeHtml: typeof escapeHtml;
|
|
74
|
+
/**
|
|
75
|
+
* Format a date for display
|
|
76
|
+
*/
|
|
77
|
+
formatDate: (date: Date | string, format?: string) => string;
|
|
78
|
+
/**
|
|
79
|
+
* Format a number as currency
|
|
80
|
+
*/
|
|
81
|
+
formatCurrency: (amount: number, currency?: string) => string;
|
|
82
|
+
/**
|
|
83
|
+
* Generate a unique ID for DOM elements
|
|
84
|
+
*/
|
|
85
|
+
uniqueId: (prefix?: string) => string;
|
|
86
|
+
/**
|
|
87
|
+
* Safely embed JSON data in HTML
|
|
88
|
+
* Escapes characters that could break out of script tags or HTML
|
|
89
|
+
*/
|
|
90
|
+
jsonEmbed: (data: unknown) => string;
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Wrap tool UI content in a complete HTML document with MCP Bridge runtime.
|
|
94
|
+
*
|
|
95
|
+
* This function creates a standalone HTML document that:
|
|
96
|
+
* - Includes the MCP Bridge runtime for cross-platform compatibility
|
|
97
|
+
* - Applies Content Security Policy meta tags
|
|
98
|
+
* - Injects tool input/output data
|
|
99
|
+
* - Uses the FrontMCP theme system for consistent styling
|
|
100
|
+
*
|
|
101
|
+
* @param options - Options for wrapping the template
|
|
102
|
+
* @returns Complete HTML document string
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```typescript
|
|
106
|
+
* const html = wrapToolUI({
|
|
107
|
+
* content: '<div class="p-4">Weather: 72°F</div>',
|
|
108
|
+
* toolName: 'get_weather',
|
|
109
|
+
* input: { location: 'San Francisco' },
|
|
110
|
+
* output: { temperature: 72, conditions: 'sunny' },
|
|
111
|
+
* csp: { connectDomains: ['https://api.weather.com'] },
|
|
112
|
+
* });
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
export declare function wrapToolUI(options: WrapToolUIFullOptions): string;
|
|
116
|
+
/**
|
|
117
|
+
* Resource loading mode for widget scripts.
|
|
118
|
+
* - 'cdn': Load React/MDX from CDN URLs (lightweight HTML, requires network)
|
|
119
|
+
* - 'inline': Embed all scripts in HTML (larger, works offline)
|
|
120
|
+
*/
|
|
121
|
+
export type ResourceMode = 'cdn' | 'inline';
|
|
122
|
+
/**
|
|
123
|
+
* Options for the universal wrapper.
|
|
124
|
+
*/
|
|
125
|
+
export interface WrapToolUIUniversalOptions {
|
|
126
|
+
/** Rendered template content (HTML) */
|
|
127
|
+
content: string;
|
|
128
|
+
/** Tool name */
|
|
129
|
+
toolName: string;
|
|
130
|
+
/** Tool input arguments */
|
|
131
|
+
input?: Record<string, unknown>;
|
|
132
|
+
/** Tool output/result */
|
|
133
|
+
output?: unknown;
|
|
134
|
+
/** Structured content */
|
|
135
|
+
structuredContent?: unknown;
|
|
136
|
+
/** CSP configuration */
|
|
137
|
+
csp?: WrapToolUIOptions['csp'];
|
|
138
|
+
/** Widget accessibility flag */
|
|
139
|
+
widgetAccessible?: boolean;
|
|
140
|
+
/** Page title */
|
|
141
|
+
title?: string;
|
|
142
|
+
/** Theme configuration */
|
|
143
|
+
theme?: DeepPartial<ThemeConfig>;
|
|
144
|
+
/** Whether to include the FrontMCP Bridge */
|
|
145
|
+
includeBridge?: boolean;
|
|
146
|
+
/** Whether to inline all scripts (for blocked-network environments) */
|
|
147
|
+
inlineScripts?: boolean;
|
|
148
|
+
/** Renderer type used */
|
|
149
|
+
rendererType?: string;
|
|
150
|
+
/** Enable hydration */
|
|
151
|
+
hydrate?: boolean;
|
|
152
|
+
/**
|
|
153
|
+
* Skip CSP meta tag generation.
|
|
154
|
+
*
|
|
155
|
+
* OpenAI handles CSP through `_meta['openai/widgetCSP']` in the MCP response,
|
|
156
|
+
* not through HTML meta tags. When true, the CSP meta tag is omitted from the
|
|
157
|
+
* HTML output to avoid browser warnings about CSP meta tags outside <head>.
|
|
158
|
+
*
|
|
159
|
+
* @default false
|
|
160
|
+
*/
|
|
161
|
+
skipCspMeta?: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* Resource loading mode for widget scripts.
|
|
164
|
+
*
|
|
165
|
+
* - 'cdn': Load React, MDX, Handlebars from CDN URLs (smaller HTML, requires network)
|
|
166
|
+
* - 'inline': Embed all scripts directly in HTML (larger, works in blocked-network environments)
|
|
167
|
+
*
|
|
168
|
+
* When `inlineScripts` is true, this is automatically set to 'inline'.
|
|
169
|
+
*
|
|
170
|
+
* @default 'cdn'
|
|
171
|
+
*/
|
|
172
|
+
resourceMode?: ResourceMode;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Wrap tool UI content in a universal HTML document.
|
|
176
|
+
*
|
|
177
|
+
* This wrapper produces HTML that works on ALL platforms:
|
|
178
|
+
* - OpenAI ChatGPT (Apps SDK)
|
|
179
|
+
* - Anthropic Claude
|
|
180
|
+
* - MCP Apps (ext-apps / SEP-1865)
|
|
181
|
+
* - Google Gemini
|
|
182
|
+
* - Any MCP-compatible host
|
|
183
|
+
*
|
|
184
|
+
* The FrontMCP Bridge auto-detects the host at runtime and adapts
|
|
185
|
+
* its communication protocol accordingly.
|
|
186
|
+
*
|
|
187
|
+
* @param options - Universal wrapper options
|
|
188
|
+
* @returns Complete HTML document string
|
|
189
|
+
*
|
|
190
|
+
* @example
|
|
191
|
+
* ```typescript
|
|
192
|
+
* const html = wrapToolUIUniversal({
|
|
193
|
+
* content: '<div class="p-4">Weather: 72°F</div>',
|
|
194
|
+
* toolName: 'get_weather',
|
|
195
|
+
* output: { temperature: 72 },
|
|
196
|
+
* });
|
|
197
|
+
* ```
|
|
198
|
+
*/
|
|
199
|
+
export declare function wrapToolUIUniversal(options: WrapToolUIUniversalOptions): string;
|
|
200
|
+
/**
|
|
201
|
+
* Wrap tool UI content with minimal boilerplate.
|
|
202
|
+
* Use this when you need to control all styling yourself.
|
|
203
|
+
*
|
|
204
|
+
* @param options - Minimal wrapper options
|
|
205
|
+
* @returns HTML document string
|
|
206
|
+
*/
|
|
207
|
+
export declare function wrapToolUIMinimal(options: Pick<WrapToolUIOptions, 'content' | 'toolName' | 'input' | 'output' | 'structuredContent' | 'csp' | 'widgetAccessible' | 'title'> & {
|
|
208
|
+
skipCspMeta?: boolean;
|
|
209
|
+
}): string;
|
|
210
|
+
/**
|
|
211
|
+
* Options for wrapping a static widget.
|
|
212
|
+
*/
|
|
213
|
+
export interface WrapStaticWidgetOptions {
|
|
214
|
+
/** Tool name */
|
|
215
|
+
toolName: string;
|
|
216
|
+
/** SSR'd template content (rendered WITHOUT data) */
|
|
217
|
+
ssrContent: string;
|
|
218
|
+
/** Tool UI configuration */
|
|
219
|
+
uiConfig: {
|
|
220
|
+
csp?: WrapToolUIOptions['csp'];
|
|
221
|
+
widgetAccessible?: boolean;
|
|
222
|
+
};
|
|
223
|
+
/** Page title */
|
|
224
|
+
title?: string;
|
|
225
|
+
/** Theme configuration */
|
|
226
|
+
theme?: DeepPartial<ThemeConfig>;
|
|
227
|
+
/**
|
|
228
|
+
* Renderer type (react, mdx, html, etc).
|
|
229
|
+
* When 'react' or 'mdx', includes React runtime for client-side rendering.
|
|
230
|
+
*/
|
|
231
|
+
rendererType?: string;
|
|
232
|
+
/**
|
|
233
|
+
* Transpiled component code to include for client-side rendering.
|
|
234
|
+
* Required for React components to re-render with actual data.
|
|
235
|
+
*/
|
|
236
|
+
componentCode?: string;
|
|
237
|
+
/**
|
|
238
|
+
* Embedded data for inline mode (servingMode: 'inline').
|
|
239
|
+
* When provided, the data is embedded in the HTML and the component renders immediately
|
|
240
|
+
* instead of waiting for window.openai.toolOutput.
|
|
241
|
+
*
|
|
242
|
+
* This enables inline mode to use the same React renderer as static mode,
|
|
243
|
+
* but with data embedded in each response.
|
|
244
|
+
*/
|
|
245
|
+
embeddedData?: {
|
|
246
|
+
input?: Record<string, unknown>;
|
|
247
|
+
output?: unknown;
|
|
248
|
+
structuredContent?: unknown;
|
|
249
|
+
};
|
|
250
|
+
/**
|
|
251
|
+
* Self-contained mode for inline serving.
|
|
252
|
+
* When true:
|
|
253
|
+
* - Skips the FrontMCP Bridge entirely (no wrapper interference)
|
|
254
|
+
* - Renders React immediately with embedded data
|
|
255
|
+
* - React component manages its own state via hooks
|
|
256
|
+
* - No global state updates that could trigger platform wrappers
|
|
257
|
+
*
|
|
258
|
+
* This is used for `servingMode: 'inline'` to prevent OpenAI's wrapper
|
|
259
|
+
* from overwriting the React component on data changes.
|
|
260
|
+
*/
|
|
261
|
+
selfContained?: boolean;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Options for lean widget shell (inline mode resourceTemplate).
|
|
265
|
+
*/
|
|
266
|
+
export interface WrapLeanWidgetShellOptions {
|
|
267
|
+
/** Tool name */
|
|
268
|
+
toolName: string;
|
|
269
|
+
/** UI configuration */
|
|
270
|
+
uiConfig: {
|
|
271
|
+
widgetAccessible?: boolean;
|
|
272
|
+
};
|
|
273
|
+
/** Optional page title */
|
|
274
|
+
title?: string;
|
|
275
|
+
/** Optional theme overrides */
|
|
276
|
+
theme?: Partial<ThemeConfig>;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Create a lean widget shell for inline mode resourceTemplate.
|
|
280
|
+
*
|
|
281
|
+
* This is a minimal HTML document with:
|
|
282
|
+
* - HTML structure with theme CSS and fonts
|
|
283
|
+
* - A placeholder/loading message while waiting for tool response
|
|
284
|
+
* - FrontMCP Bridge for platform-agnostic communication
|
|
285
|
+
* - Injector script that detects ui/html in tool response and replaces the document
|
|
286
|
+
*
|
|
287
|
+
* NO React runtime, NO component code - the actual React widget comes
|
|
288
|
+
* in each tool response via _meta['ui/html'] and is injected by this shell.
|
|
289
|
+
*
|
|
290
|
+
* OpenAI caches this at discovery time. When a tool executes:
|
|
291
|
+
* 1. Tool returns full widget HTML in _meta['ui/html']
|
|
292
|
+
* 2. OpenAI injects this into window.openai.toolResponseMetadata['ui/html']
|
|
293
|
+
* 3. The bridge detects this and calls the injector callback
|
|
294
|
+
* 4. Injector replaces the entire document with the full React widget
|
|
295
|
+
*
|
|
296
|
+
* @param options - Lean widget options
|
|
297
|
+
* @returns Minimal HTML document string with bridge and injector
|
|
298
|
+
*/
|
|
299
|
+
export declare function wrapLeanWidgetShell(options: WrapLeanWidgetShellOptions): string;
|
|
300
|
+
/**
|
|
301
|
+
* Options for hybrid widget shell (hybrid mode resourceTemplate).
|
|
302
|
+
*/
|
|
303
|
+
export interface WrapHybridWidgetShellOptions {
|
|
304
|
+
/** Tool name */
|
|
305
|
+
toolName: string;
|
|
306
|
+
/** UI configuration */
|
|
307
|
+
uiConfig: {
|
|
308
|
+
widgetAccessible?: boolean;
|
|
309
|
+
csp?: WrapToolUIOptions['csp'];
|
|
310
|
+
};
|
|
311
|
+
/** Optional page title */
|
|
312
|
+
title?: string;
|
|
313
|
+
/** Optional theme overrides */
|
|
314
|
+
theme?: Partial<ThemeConfig>;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Create a hybrid widget shell for hybrid serving mode.
|
|
318
|
+
*
|
|
319
|
+
* This shell contains:
|
|
320
|
+
* - React 19 runtime from esm.sh CDN
|
|
321
|
+
* - FrontMCP Bridge for platform-agnostic communication
|
|
322
|
+
* - All FrontMCP hooks (useMcpBridgeContext, useToolOutput, useCallTool, etc.)
|
|
323
|
+
* - All FrontMCP UI components (Card, Badge, Button)
|
|
324
|
+
* - Dynamic renderer that imports and renders component code at runtime
|
|
325
|
+
*
|
|
326
|
+
* NO component code is included - it comes in the tool response via `_meta['ui/component']`.
|
|
327
|
+
*
|
|
328
|
+
* Flow:
|
|
329
|
+
* 1. Shell is cached at tools/list (OpenAI caches outputTemplate)
|
|
330
|
+
* 2. Tool response contains component code + structured data
|
|
331
|
+
* 3. Shell imports component via blob URL and renders with data
|
|
332
|
+
* 4. Re-renders on data updates via bridge notifications
|
|
333
|
+
*
|
|
334
|
+
* @param options - Hybrid widget shell options
|
|
335
|
+
* @returns Complete HTML document string with dynamic renderer
|
|
336
|
+
*/
|
|
337
|
+
export declare function wrapHybridWidgetShell(options: WrapHybridWidgetShellOptions): string;
|
|
338
|
+
/**
|
|
339
|
+
* Wrap a static widget template for MCP resource mode.
|
|
340
|
+
*
|
|
341
|
+
* Unlike `wrapToolUIUniversal`, this function creates a widget that:
|
|
342
|
+
* - Does NOT embed data (input/output/structuredContent)
|
|
343
|
+
* - Reads data at runtime from the FrontMCP Bridge (window.openai.toolOutput)
|
|
344
|
+
* - Is cached at server startup and returned for all requests
|
|
345
|
+
*
|
|
346
|
+
* This is used for `servingMode: 'static'` where OpenAI caches the
|
|
347
|
+
* outputTemplate HTML and injects data via window.openai.toolOutput.
|
|
348
|
+
*
|
|
349
|
+
* @param options - Static widget options
|
|
350
|
+
* @returns Complete HTML document string
|
|
351
|
+
*
|
|
352
|
+
* @example
|
|
353
|
+
* ```typescript
|
|
354
|
+
* const html = wrapStaticWidgetUniversal({
|
|
355
|
+
* toolName: 'get_weather',
|
|
356
|
+
* ssrContent: '<div class="weather-card"><!-- Template without data --></div>',
|
|
357
|
+
* uiConfig: { widgetAccessible: true },
|
|
358
|
+
* });
|
|
359
|
+
* ```
|
|
360
|
+
*/
|
|
361
|
+
export declare function wrapStaticWidgetUniversal(options: WrapStaticWidgetOptions): string;
|
|
362
|
+
/**
|
|
363
|
+
* Build OpenAI Apps SDK specific meta annotations.
|
|
364
|
+
* These are placed in _meta field of the tool response.
|
|
365
|
+
*/
|
|
366
|
+
export declare function buildOpenAIMeta(options: {
|
|
367
|
+
csp?: WrapToolUIOptions['csp'];
|
|
368
|
+
widgetAccessible?: boolean;
|
|
369
|
+
widgetDescription?: string;
|
|
370
|
+
displayMode?: 'inline' | 'fullscreen' | 'pip';
|
|
371
|
+
}): Record<string, unknown>;
|
|
372
|
+
/**
|
|
373
|
+
* Get the MIME type for tool UI responses based on target platform
|
|
374
|
+
*/
|
|
375
|
+
export declare function getToolUIMimeType(platform?: 'openai' | 'ext-apps' | 'generic'): string;
|
|
376
|
+
/**
|
|
377
|
+
* Options for Claude-specific wrapper.
|
|
378
|
+
*/
|
|
379
|
+
export interface WrapToolUIForClaudeOptions {
|
|
380
|
+
/** Rendered template content (HTML body) */
|
|
381
|
+
content: string;
|
|
382
|
+
/** Tool name */
|
|
383
|
+
toolName: string;
|
|
384
|
+
/** Tool input arguments */
|
|
385
|
+
input?: Record<string, unknown>;
|
|
386
|
+
/** Tool output/result */
|
|
387
|
+
output?: unknown;
|
|
388
|
+
/** Page title */
|
|
389
|
+
title?: string;
|
|
390
|
+
/** Include HTMX for dynamic interactions */
|
|
391
|
+
includeHtmx?: boolean;
|
|
392
|
+
/** Include Alpine.js for reactive components */
|
|
393
|
+
includeAlpine?: boolean;
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Wrap tool UI content for Claude Artifacts.
|
|
397
|
+
*
|
|
398
|
+
* Creates a complete HTML document using Cloudflare CDN resources
|
|
399
|
+
* which are trusted by Claude's sandbox environment.
|
|
400
|
+
*
|
|
401
|
+
* Key differences from standard wrapper:
|
|
402
|
+
* - Uses pre-built Tailwind CSS from cloudflare (not JIT compiler)
|
|
403
|
+
* - No esm.sh imports (Claude blocks non-cloudflare CDNs)
|
|
404
|
+
* - No React runtime (SSR-only, static HTML)
|
|
405
|
+
* - Self-contained with embedded data
|
|
406
|
+
*
|
|
407
|
+
* @param options - Claude wrapper options
|
|
408
|
+
* @returns Complete HTML document string
|
|
409
|
+
*
|
|
410
|
+
* @example
|
|
411
|
+
* ```typescript
|
|
412
|
+
* const html = wrapToolUIForClaude({
|
|
413
|
+
* content: '<div class="p-4 bg-gray-100">Weather: 72°F</div>',
|
|
414
|
+
* toolName: 'get_weather',
|
|
415
|
+
* output: { temperature: 72 },
|
|
416
|
+
* });
|
|
417
|
+
* // Returns full HTML with Tailwind CSS from cloudflare CDN
|
|
418
|
+
* ```
|
|
419
|
+
*/
|
|
420
|
+
export declare function wrapToolUIForClaude(options: WrapToolUIForClaudeOptions): string;
|
|
421
|
+
//# sourceMappingURL=wrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wrapper.d.ts","sourceRoot":"","sources":["../../src/runtime/wrapper.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAG9D,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,oBAAoB,EAUzB,KAAK,WAAW,EACjB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAoC,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAOjF;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB;IAC9D,0BAA0B;IAC1B,KAAK,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAEjC,mCAAmC;IACnC,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAEhC,2BAA2B;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAEnC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,WAAW,CAAC;IAEjD;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,OAAO,CAAC,EAAE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G,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAiC1B;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,GAAE,QAAQ,GAAG,UAAU,GAAG,SAAqB,GAAG,MAAM,CASjG;AAkBD;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,yBAAyB;IACzB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,iBAAiB;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gDAAgD;IAChD,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,MAAM,CAuC/E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/styles/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,YAAY,CAAC"}
|
package/styles/index.js
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// libs/uipack/src/styles/index.ts
|
|
21
|
+
var styles_exports = {};
|
|
22
|
+
__export(styles_exports, {
|
|
23
|
+
ALERT_BASE_CLASSES: () => ALERT_BASE_CLASSES,
|
|
24
|
+
ALERT_ICONS: () => ALERT_ICONS,
|
|
25
|
+
ALERT_VARIANTS: () => ALERT_VARIANTS,
|
|
26
|
+
BADGE_DOT_SIZES: () => BADGE_DOT_SIZES,
|
|
27
|
+
BADGE_DOT_VARIANTS: () => BADGE_DOT_VARIANTS,
|
|
28
|
+
BADGE_SIZES: () => BADGE_SIZES,
|
|
29
|
+
BADGE_VARIANTS: () => BADGE_VARIANTS,
|
|
30
|
+
BUTTON_BASE_CLASSES: () => BUTTON_BASE_CLASSES,
|
|
31
|
+
BUTTON_ICON_SIZES: () => BUTTON_ICON_SIZES,
|
|
32
|
+
BUTTON_SIZES: () => BUTTON_SIZES,
|
|
33
|
+
BUTTON_VARIANTS: () => BUTTON_VARIANTS,
|
|
34
|
+
CARD_SIZES: () => CARD_SIZES,
|
|
35
|
+
CARD_VARIANTS: () => CARD_VARIANTS,
|
|
36
|
+
CLOSE_ICON: () => CLOSE_ICON,
|
|
37
|
+
LOADING_SPINNER: () => LOADING_SPINNER,
|
|
38
|
+
cn: () => cn,
|
|
39
|
+
getAlertVariantClasses: () => getAlertVariantClasses,
|
|
40
|
+
getBadgeDotSizeClasses: () => getBadgeDotSizeClasses,
|
|
41
|
+
getBadgeDotVariantClasses: () => getBadgeDotVariantClasses,
|
|
42
|
+
getBadgeSizeClasses: () => getBadgeSizeClasses,
|
|
43
|
+
getBadgeVariantClasses: () => getBadgeVariantClasses,
|
|
44
|
+
getButtonSizeClasses: () => getButtonSizeClasses,
|
|
45
|
+
getButtonVariantClasses: () => getButtonVariantClasses,
|
|
46
|
+
getCardSizeClasses: () => getCardSizeClasses,
|
|
47
|
+
getCardVariantClasses: () => getCardVariantClasses
|
|
48
|
+
});
|
|
49
|
+
module.exports = __toCommonJS(styles_exports);
|
|
50
|
+
|
|
51
|
+
// libs/uipack/src/styles/variants.ts
|
|
52
|
+
var CARD_VARIANTS = {
|
|
53
|
+
default: "bg-white border border-border rounded-xl shadow-sm",
|
|
54
|
+
outlined: "bg-transparent border-2 border-border rounded-xl",
|
|
55
|
+
elevated: "bg-white rounded-xl shadow-lg",
|
|
56
|
+
filled: "bg-gray-50 rounded-xl",
|
|
57
|
+
ghost: "bg-transparent"
|
|
58
|
+
};
|
|
59
|
+
var CARD_SIZES = {
|
|
60
|
+
sm: "p-4",
|
|
61
|
+
md: "p-6",
|
|
62
|
+
lg: "p-8"
|
|
63
|
+
};
|
|
64
|
+
function getCardVariantClasses(variant) {
|
|
65
|
+
return CARD_VARIANTS[variant];
|
|
66
|
+
}
|
|
67
|
+
function getCardSizeClasses(size) {
|
|
68
|
+
return CARD_SIZES[size];
|
|
69
|
+
}
|
|
70
|
+
var BADGE_VARIANTS = {
|
|
71
|
+
default: "bg-gray-100 text-gray-800",
|
|
72
|
+
primary: "bg-primary/10 text-primary",
|
|
73
|
+
secondary: "bg-secondary/10 text-secondary",
|
|
74
|
+
success: "bg-success/10 text-success",
|
|
75
|
+
warning: "bg-warning/10 text-warning",
|
|
76
|
+
danger: "bg-danger/10 text-danger",
|
|
77
|
+
info: "bg-blue-100 text-blue-800",
|
|
78
|
+
outline: "border border-border text-text-primary bg-transparent"
|
|
79
|
+
};
|
|
80
|
+
var BADGE_SIZES = {
|
|
81
|
+
sm: "px-2 py-0.5 text-xs",
|
|
82
|
+
md: "px-2.5 py-1 text-xs",
|
|
83
|
+
lg: "px-3 py-1.5 text-sm"
|
|
84
|
+
};
|
|
85
|
+
var BADGE_DOT_SIZES = {
|
|
86
|
+
sm: "w-2 h-2",
|
|
87
|
+
md: "w-2.5 h-2.5",
|
|
88
|
+
lg: "w-3 h-3"
|
|
89
|
+
};
|
|
90
|
+
var BADGE_DOT_VARIANTS = {
|
|
91
|
+
default: "bg-gray-400",
|
|
92
|
+
primary: "bg-primary",
|
|
93
|
+
secondary: "bg-secondary",
|
|
94
|
+
success: "bg-success",
|
|
95
|
+
warning: "bg-warning",
|
|
96
|
+
danger: "bg-danger",
|
|
97
|
+
info: "bg-blue-500",
|
|
98
|
+
outline: "border border-current"
|
|
99
|
+
};
|
|
100
|
+
function getBadgeVariantClasses(variant) {
|
|
101
|
+
return BADGE_VARIANTS[variant];
|
|
102
|
+
}
|
|
103
|
+
function getBadgeSizeClasses(size) {
|
|
104
|
+
return BADGE_SIZES[size];
|
|
105
|
+
}
|
|
106
|
+
function getBadgeDotSizeClasses(size) {
|
|
107
|
+
return BADGE_DOT_SIZES[size];
|
|
108
|
+
}
|
|
109
|
+
function getBadgeDotVariantClasses(variant) {
|
|
110
|
+
return BADGE_DOT_VARIANTS[variant];
|
|
111
|
+
}
|
|
112
|
+
var BUTTON_VARIANTS = {
|
|
113
|
+
primary: "bg-primary hover:bg-primary/90 text-white shadow-sm",
|
|
114
|
+
secondary: "bg-secondary hover:bg-secondary/90 text-white shadow-sm",
|
|
115
|
+
outline: "border-2 border-primary text-primary hover:bg-primary/10",
|
|
116
|
+
ghost: "text-text-primary hover:bg-gray-100",
|
|
117
|
+
danger: "bg-danger hover:bg-danger/90 text-white shadow-sm",
|
|
118
|
+
success: "bg-success hover:bg-success/90 text-white shadow-sm",
|
|
119
|
+
link: "text-primary hover:text-primary/80 hover:underline"
|
|
120
|
+
};
|
|
121
|
+
var BUTTON_SIZES = {
|
|
122
|
+
xs: "px-2.5 py-1.5 text-xs",
|
|
123
|
+
sm: "px-3 py-2 text-sm",
|
|
124
|
+
md: "px-4 py-2.5 text-sm",
|
|
125
|
+
lg: "px-5 py-3 text-base",
|
|
126
|
+
xl: "px-6 py-3.5 text-lg"
|
|
127
|
+
};
|
|
128
|
+
var BUTTON_ICON_SIZES = {
|
|
129
|
+
xs: "p-1.5",
|
|
130
|
+
sm: "p-2",
|
|
131
|
+
md: "p-2.5",
|
|
132
|
+
lg: "p-3",
|
|
133
|
+
xl: "p-4"
|
|
134
|
+
};
|
|
135
|
+
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";
|
|
136
|
+
function getButtonVariantClasses(variant) {
|
|
137
|
+
return BUTTON_VARIANTS[variant];
|
|
138
|
+
}
|
|
139
|
+
function getButtonSizeClasses(size, iconOnly) {
|
|
140
|
+
return iconOnly ? BUTTON_ICON_SIZES[size] : BUTTON_SIZES[size];
|
|
141
|
+
}
|
|
142
|
+
var ALERT_VARIANTS = {
|
|
143
|
+
info: {
|
|
144
|
+
container: "bg-blue-50 border-blue-200 text-blue-800",
|
|
145
|
+
icon: "text-blue-500"
|
|
146
|
+
},
|
|
147
|
+
success: {
|
|
148
|
+
container: "bg-success/10 border-success/30 text-success",
|
|
149
|
+
icon: "text-success"
|
|
150
|
+
},
|
|
151
|
+
warning: {
|
|
152
|
+
container: "bg-warning/10 border-warning/30 text-warning",
|
|
153
|
+
icon: "text-warning"
|
|
154
|
+
},
|
|
155
|
+
danger: {
|
|
156
|
+
container: "bg-danger/10 border-danger/30 text-danger",
|
|
157
|
+
icon: "text-danger"
|
|
158
|
+
},
|
|
159
|
+
neutral: {
|
|
160
|
+
container: "bg-gray-50 border-gray-200 text-gray-800",
|
|
161
|
+
icon: "text-gray-500"
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
var ALERT_BASE_CLASSES = "rounded-lg border p-4";
|
|
165
|
+
function getAlertVariantClasses(variant) {
|
|
166
|
+
return ALERT_VARIANTS[variant];
|
|
167
|
+
}
|
|
168
|
+
var ALERT_ICONS = {
|
|
169
|
+
info: `<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
170
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
|
171
|
+
</svg>`,
|
|
172
|
+
success: `<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
173
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
|
174
|
+
</svg>`,
|
|
175
|
+
warning: `<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
176
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"/>
|
|
177
|
+
</svg>`,
|
|
178
|
+
danger: `<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
179
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
|
180
|
+
</svg>`,
|
|
181
|
+
neutral: `<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
182
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
|
|
183
|
+
</svg>`
|
|
184
|
+
};
|
|
185
|
+
var CLOSE_ICON = `<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
186
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
|
|
187
|
+
</svg>`;
|
|
188
|
+
var LOADING_SPINNER = `<svg class="animate-spin -ml-1 mr-2 h-4 w-4" fill="none" viewBox="0 0 24 24">
|
|
189
|
+
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
|
|
190
|
+
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
|
|
191
|
+
</svg>`;
|
|
192
|
+
function cn(...classes) {
|
|
193
|
+
return classes.filter(Boolean).join(" ");
|
|
194
|
+
}
|
|
195
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
196
|
+
0 && (module.exports = {
|
|
197
|
+
ALERT_BASE_CLASSES,
|
|
198
|
+
ALERT_ICONS,
|
|
199
|
+
ALERT_VARIANTS,
|
|
200
|
+
BADGE_DOT_SIZES,
|
|
201
|
+
BADGE_DOT_VARIANTS,
|
|
202
|
+
BADGE_SIZES,
|
|
203
|
+
BADGE_VARIANTS,
|
|
204
|
+
BUTTON_BASE_CLASSES,
|
|
205
|
+
BUTTON_ICON_SIZES,
|
|
206
|
+
BUTTON_SIZES,
|
|
207
|
+
BUTTON_VARIANTS,
|
|
208
|
+
CARD_SIZES,
|
|
209
|
+
CARD_VARIANTS,
|
|
210
|
+
CLOSE_ICON,
|
|
211
|
+
LOADING_SPINNER,
|
|
212
|
+
cn,
|
|
213
|
+
getAlertVariantClasses,
|
|
214
|
+
getBadgeDotSizeClasses,
|
|
215
|
+
getBadgeDotVariantClasses,
|
|
216
|
+
getBadgeSizeClasses,
|
|
217
|
+
getBadgeVariantClasses,
|
|
218
|
+
getButtonSizeClasses,
|
|
219
|
+
getButtonVariantClasses,
|
|
220
|
+
getCardSizeClasses,
|
|
221
|
+
getCardVariantClasses
|
|
222
|
+
});
|