@frontmcp/ui 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +140 -362
- package/bridge/runtime/index.d.ts +2 -1
- package/bridge/runtime/index.d.ts.map +1 -1
- package/bundler/file-cache/component-builder.d.ts +1 -1
- package/bundler/file-cache/component-builder.d.ts.map +1 -1
- package/bundler/file-cache/hash-calculator.d.ts +1 -1
- package/bundler/file-cache/hash-calculator.d.ts.map +1 -1
- package/bundler/file-cache/storage/filesystem.d.ts +1 -1
- package/bundler/file-cache/storage/filesystem.d.ts.map +1 -1
- package/bundler/file-cache/storage/interface.d.ts +1 -1
- package/bundler/file-cache/storage/interface.d.ts.map +1 -1
- package/bundler/file-cache/storage/redis.d.ts +1 -1
- package/bundler/file-cache/storage/redis.d.ts.map +1 -1
- package/bundler/index.js +10 -1057
- package/components/alert.schema.d.ts +6 -6
- package/components/avatar.schema.d.ts +9 -9
- package/components/badge.schema.d.ts +9 -9
- package/components/button.schema.d.ts +9 -9
- package/components/card.schema.d.ts +7 -7
- package/components/form.schema.d.ts +24 -24
- package/components/index.js +128 -198
- package/components/modal.schema.d.ts +8 -8
- package/components/table.schema.d.ts +6 -6
- package/esm/bridge/runtime/index.d.ts +2 -1
- package/esm/bridge/runtime/index.d.ts.map +1 -1
- package/esm/bundler/file-cache/component-builder.d.ts +1 -1
- package/esm/bundler/file-cache/component-builder.d.ts.map +1 -1
- package/esm/bundler/file-cache/hash-calculator.d.ts +1 -1
- package/esm/bundler/file-cache/hash-calculator.d.ts.map +1 -1
- package/esm/bundler/file-cache/storage/filesystem.d.ts +1 -1
- package/esm/bundler/file-cache/storage/filesystem.d.ts.map +1 -1
- package/esm/bundler/file-cache/storage/interface.d.ts +1 -1
- package/esm/bundler/file-cache/storage/interface.d.ts.map +1 -1
- package/esm/bundler/file-cache/storage/redis.d.ts +1 -1
- package/esm/bundler/file-cache/storage/redis.d.ts.map +1 -1
- package/esm/bundler/index.js +3 -1050
- package/esm/components/alert.schema.d.ts +6 -6
- package/esm/components/avatar.schema.d.ts +9 -9
- package/esm/components/badge.schema.d.ts +9 -9
- package/esm/components/button.schema.d.ts +9 -9
- package/esm/components/card.schema.d.ts +7 -7
- package/esm/components/form.schema.d.ts +24 -24
- package/esm/components/index.js +136 -196
- package/esm/components/modal.schema.d.ts +8 -8
- package/esm/components/table.schema.d.ts +6 -6
- package/esm/index.d.ts +23 -39
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +4256 -16441
- package/esm/layouts/base.d.ts +2 -2
- package/esm/layouts/base.d.ts.map +1 -1
- package/esm/layouts/index.js +33 -516
- package/esm/package.json +8 -26
- package/esm/pages/index.js +100 -627
- package/esm/react/Alert.d.ts +1 -2
- package/esm/react/Alert.d.ts.map +1 -1
- package/esm/react/Badge.d.ts +1 -2
- package/esm/react/Badge.d.ts.map +1 -1
- package/esm/react/Button.d.ts +1 -2
- package/esm/react/Button.d.ts.map +1 -1
- package/esm/react/Card.d.ts +1 -2
- package/esm/react/Card.d.ts.map +1 -1
- package/esm/react/hooks/context.d.ts +1 -1
- package/esm/react/hooks/context.d.ts.map +1 -1
- package/esm/react/index.d.ts +5 -6
- package/esm/react/index.d.ts.map +1 -1
- package/esm/react/index.js +2074 -322
- package/esm/react/types.d.ts +1 -2
- package/esm/react/types.d.ts.map +1 -1
- package/esm/renderers/index.d.ts +10 -25
- package/esm/renderers/index.d.ts.map +1 -1
- package/esm/renderers/index.js +171 -1617
- package/esm/{runtime/adapters → renderers}/react.adapter.d.ts +2 -2
- package/esm/renderers/react.adapter.d.ts.map +1 -0
- package/esm/renderers/react.renderer.d.ts +3 -3
- package/esm/renderers/react.renderer.d.ts.map +1 -1
- package/esm/universal/index.js +1755 -0
- package/esm/web-components/index.js +232 -287
- package/esm/widgets/index.js +89 -147
- package/index.d.ts +23 -39
- package/index.d.ts.map +1 -1
- package/index.js +6123 -18539
- package/layouts/base.d.ts +2 -2
- package/layouts/base.d.ts.map +1 -1
- package/layouts/index.js +43 -536
- package/package.json +8 -26
- package/pages/index.js +111 -648
- package/react/Alert.d.ts +1 -2
- package/react/Alert.d.ts.map +1 -1
- package/react/Badge.d.ts +1 -2
- package/react/Badge.d.ts.map +1 -1
- package/react/Button.d.ts +1 -2
- package/react/Button.d.ts.map +1 -1
- package/react/Card.d.ts +1 -2
- package/react/Card.d.ts.map +1 -1
- package/react/hooks/context.d.ts +1 -1
- package/react/hooks/context.d.ts.map +1 -1
- package/react/index.d.ts +5 -6
- package/react/index.d.ts.map +1 -1
- package/react/index.js +2065 -335
- package/react/types.d.ts +1 -2
- package/react/types.d.ts.map +1 -1
- package/renderers/index.d.ts +10 -25
- package/renderers/index.d.ts.map +1 -1
- package/renderers/index.js +175 -1641
- package/{runtime/adapters → renderers}/react.adapter.d.ts +2 -2
- package/renderers/react.adapter.d.ts.map +1 -0
- package/renderers/react.renderer.d.ts +3 -3
- package/renderers/react.renderer.d.ts.map +1 -1
- package/universal/index.js +1841 -0
- package/web-components/index.js +224 -289
- package/widgets/index.js +80 -148
- package/adapters/index.d.ts +0 -13
- package/adapters/index.d.ts.map +0 -1
- package/adapters/index.js +0 -462
- package/adapters/platform-meta.d.ts +0 -166
- package/adapters/platform-meta.d.ts.map +0 -1
- package/adapters/response-builder.d.ts +0 -108
- package/adapters/response-builder.d.ts.map +0 -1
- package/adapters/serving-mode.d.ts +0 -107
- package/adapters/serving-mode.d.ts.map +0 -1
- package/base-template/bridge.d.ts +0 -90
- package/base-template/bridge.d.ts.map +0 -1
- package/base-template/default-base-template.d.ts +0 -92
- package/base-template/default-base-template.d.ts.map +0 -1
- package/base-template/index.d.ts +0 -15
- package/base-template/index.d.ts.map +0 -1
- package/base-template/index.js +0 -1398
- package/base-template/polyfills.d.ts +0 -31
- package/base-template/polyfills.d.ts.map +0 -1
- package/base-template/theme-styles.d.ts +0 -74
- package/base-template/theme-styles.d.ts.map +0 -1
- package/build/cdn-resources.d.ts +0 -243
- package/build/cdn-resources.d.ts.map +0 -1
- package/build/index.d.ts +0 -295
- package/build/index.d.ts.map +0 -1
- package/build/index.js +0 -7096
- package/build/widget-manifest.d.ts +0 -362
- package/build/widget-manifest.d.ts.map +0 -1
- package/dependency/cdn-registry.d.ts +0 -98
- package/dependency/cdn-registry.d.ts.map +0 -1
- package/dependency/import-map.d.ts +0 -186
- package/dependency/import-map.d.ts.map +0 -1
- package/dependency/import-parser.d.ts +0 -82
- package/dependency/import-parser.d.ts.map +0 -1
- package/dependency/index.d.ts +0 -17
- package/dependency/index.d.ts.map +0 -1
- package/dependency/resolver.d.ts +0 -164
- package/dependency/resolver.d.ts.map +0 -1
- package/dependency/schemas.d.ts +0 -486
- package/dependency/schemas.d.ts.map +0 -1
- package/dependency/template-loader.d.ts +0 -204
- package/dependency/template-loader.d.ts.map +0 -1
- package/dependency/template-processor.d.ts +0 -118
- package/dependency/template-processor.d.ts.map +0 -1
- package/dependency/types.d.ts +0 -739
- package/dependency/types.d.ts.map +0 -1
- package/esm/adapters/index.d.ts +0 -13
- package/esm/adapters/index.d.ts.map +0 -1
- package/esm/adapters/index.js +0 -427
- package/esm/adapters/platform-meta.d.ts +0 -166
- package/esm/adapters/platform-meta.d.ts.map +0 -1
- package/esm/adapters/response-builder.d.ts +0 -108
- package/esm/adapters/response-builder.d.ts.map +0 -1
- package/esm/adapters/serving-mode.d.ts +0 -107
- package/esm/adapters/serving-mode.d.ts.map +0 -1
- package/esm/base-template/bridge.d.ts +0 -90
- package/esm/base-template/bridge.d.ts.map +0 -1
- package/esm/base-template/default-base-template.d.ts +0 -92
- package/esm/base-template/default-base-template.d.ts.map +0 -1
- package/esm/base-template/index.d.ts +0 -15
- package/esm/base-template/index.d.ts.map +0 -1
- package/esm/base-template/index.js +0 -1364
- package/esm/base-template/polyfills.d.ts +0 -31
- package/esm/base-template/polyfills.d.ts.map +0 -1
- package/esm/base-template/theme-styles.d.ts +0 -74
- package/esm/base-template/theme-styles.d.ts.map +0 -1
- package/esm/build/cdn-resources.d.ts +0 -243
- package/esm/build/cdn-resources.d.ts.map +0 -1
- package/esm/build/index.d.ts +0 -295
- package/esm/build/index.d.ts.map +0 -1
- package/esm/build/index.js +0 -7021
- package/esm/build/widget-manifest.d.ts +0 -362
- package/esm/build/widget-manifest.d.ts.map +0 -1
- package/esm/dependency/cdn-registry.d.ts +0 -98
- package/esm/dependency/cdn-registry.d.ts.map +0 -1
- package/esm/dependency/import-map.d.ts +0 -186
- package/esm/dependency/import-map.d.ts.map +0 -1
- package/esm/dependency/import-parser.d.ts +0 -82
- package/esm/dependency/import-parser.d.ts.map +0 -1
- package/esm/dependency/index.d.ts +0 -17
- package/esm/dependency/index.d.ts.map +0 -1
- package/esm/dependency/resolver.d.ts +0 -164
- package/esm/dependency/resolver.d.ts.map +0 -1
- package/esm/dependency/schemas.d.ts +0 -486
- package/esm/dependency/schemas.d.ts.map +0 -1
- package/esm/dependency/template-loader.d.ts +0 -204
- package/esm/dependency/template-loader.d.ts.map +0 -1
- package/esm/dependency/template-processor.d.ts +0 -118
- package/esm/dependency/template-processor.d.ts.map +0 -1
- package/esm/dependency/types.d.ts +0 -739
- package/esm/dependency/types.d.ts.map +0 -1
- package/esm/handlebars/expression-extractor.d.ts +0 -147
- package/esm/handlebars/expression-extractor.d.ts.map +0 -1
- package/esm/handlebars/helpers.d.ts +0 -339
- package/esm/handlebars/helpers.d.ts.map +0 -1
- package/esm/handlebars/index.d.ts +0 -195
- package/esm/handlebars/index.d.ts.map +0 -1
- package/esm/handlebars/index.js +0 -587
- package/esm/registry/index.d.ts +0 -46
- package/esm/registry/index.d.ts.map +0 -1
- package/esm/registry/index.js +0 -6422
- package/esm/registry/render-template.d.ts +0 -91
- package/esm/registry/render-template.d.ts.map +0 -1
- package/esm/registry/tool-ui.registry.d.ts +0 -294
- package/esm/registry/tool-ui.registry.d.ts.map +0 -1
- package/esm/registry/uri-utils.d.ts +0 -56
- package/esm/registry/uri-utils.d.ts.map +0 -1
- package/esm/renderers/cache.d.ts +0 -145
- package/esm/renderers/cache.d.ts.map +0 -1
- package/esm/renderers/html.renderer.d.ts +0 -123
- package/esm/renderers/html.renderer.d.ts.map +0 -1
- package/esm/renderers/mdx.renderer.d.ts +0 -120
- package/esm/renderers/mdx.renderer.d.ts.map +0 -1
- package/esm/renderers/registry.d.ts +0 -134
- package/esm/renderers/registry.d.ts.map +0 -1
- package/esm/renderers/types.d.ts +0 -342
- package/esm/renderers/types.d.ts.map +0 -1
- package/esm/renderers/utils/detect.d.ts +0 -107
- package/esm/renderers/utils/detect.d.ts.map +0 -1
- package/esm/renderers/utils/hash.d.ts +0 -40
- package/esm/renderers/utils/hash.d.ts.map +0 -1
- package/esm/renderers/utils/index.d.ts +0 -9
- package/esm/renderers/utils/index.d.ts.map +0 -1
- package/esm/renderers/utils/transpiler.d.ts +0 -89
- package/esm/renderers/utils/transpiler.d.ts.map +0 -1
- package/esm/runtime/adapters/html.adapter.d.ts +0 -59
- package/esm/runtime/adapters/html.adapter.d.ts.map +0 -1
- package/esm/runtime/adapters/index.d.ts +0 -26
- package/esm/runtime/adapters/index.d.ts.map +0 -1
- package/esm/runtime/adapters/mdx.adapter.d.ts +0 -73
- package/esm/runtime/adapters/mdx.adapter.d.ts.map +0 -1
- package/esm/runtime/adapters/react.adapter.d.ts.map +0 -1
- package/esm/runtime/adapters/types.d.ts +0 -95
- package/esm/runtime/adapters/types.d.ts.map +0 -1
- package/esm/runtime/csp.d.ts +0 -48
- package/esm/runtime/csp.d.ts.map +0 -1
- package/esm/runtime/index.d.ts +0 -17
- package/esm/runtime/index.d.ts.map +0 -1
- package/esm/runtime/index.js +0 -5186
- package/esm/runtime/mcp-bridge.d.ts +0 -101
- package/esm/runtime/mcp-bridge.d.ts.map +0 -1
- package/esm/runtime/renderer-runtime.d.ts +0 -133
- package/esm/runtime/renderer-runtime.d.ts.map +0 -1
- package/esm/runtime/sanitizer.d.ts +0 -172
- package/esm/runtime/sanitizer.d.ts.map +0 -1
- package/esm/runtime/types.d.ts +0 -415
- package/esm/runtime/types.d.ts.map +0 -1
- package/esm/runtime/wrapper.d.ts +0 -421
- package/esm/runtime/wrapper.d.ts.map +0 -1
- package/esm/styles/index.d.ts +0 -8
- package/esm/styles/index.d.ts.map +0 -1
- package/esm/styles/index.js +0 -171
- package/esm/styles/variants.d.ts +0 -51
- package/esm/styles/variants.d.ts.map +0 -1
- package/esm/theme/cdn.d.ts +0 -195
- package/esm/theme/cdn.d.ts.map +0 -1
- package/esm/theme/index.d.ts +0 -18
- package/esm/theme/index.d.ts.map +0 -1
- package/esm/theme/index.js +0 -700
- package/esm/theme/platforms.d.ts +0 -107
- package/esm/theme/platforms.d.ts.map +0 -1
- package/esm/theme/presets/github-openai.d.ts +0 -50
- package/esm/theme/presets/github-openai.d.ts.map +0 -1
- package/esm/theme/presets/index.d.ts +0 -11
- package/esm/theme/presets/index.d.ts.map +0 -1
- package/esm/theme/theme.d.ts +0 -396
- package/esm/theme/theme.d.ts.map +0 -1
- package/esm/tool-template/builder.d.ts +0 -213
- package/esm/tool-template/builder.d.ts.map +0 -1
- package/esm/tool-template/index.d.ts +0 -16
- package/esm/tool-template/index.d.ts.map +0 -1
- package/esm/tool-template/index.js +0 -3515
- package/esm/types/index.d.ts +0 -14
- package/esm/types/index.d.ts.map +0 -1
- package/esm/types/index.js +0 -75
- package/esm/types/ui-config.d.ts +0 -639
- package/esm/types/ui-config.d.ts.map +0 -1
- package/esm/types/ui-runtime.d.ts +0 -1007
- package/esm/types/ui-runtime.d.ts.map +0 -1
- package/esm/typings/cache/cache-adapter.d.ts +0 -125
- package/esm/typings/cache/cache-adapter.d.ts.map +0 -1
- package/esm/typings/cache/index.d.ts +0 -10
- package/esm/typings/cache/index.d.ts.map +0 -1
- package/esm/typings/cache/memory-cache.d.ts +0 -92
- package/esm/typings/cache/memory-cache.d.ts.map +0 -1
- package/esm/typings/dts-parser.d.ts +0 -90
- package/esm/typings/dts-parser.d.ts.map +0 -1
- package/esm/typings/index.d.ts +0 -48
- package/esm/typings/index.d.ts.map +0 -1
- package/esm/typings/schemas.d.ts +0 -232
- package/esm/typings/schemas.d.ts.map +0 -1
- package/esm/typings/type-fetcher.d.ts +0 -89
- package/esm/typings/type-fetcher.d.ts.map +0 -1
- package/esm/typings/types.d.ts +0 -320
- package/esm/typings/types.d.ts.map +0 -1
- package/esm/utils/escape-html.d.ts +0 -58
- package/esm/utils/escape-html.d.ts.map +0 -1
- package/esm/utils/index.d.ts +0 -10
- package/esm/utils/index.d.ts.map +0 -1
- package/esm/utils/index.js +0 -40
- package/esm/utils/safe-stringify.d.ts +0 -30
- package/esm/utils/safe-stringify.d.ts.map +0 -1
- package/esm/validation/error-box.d.ts +0 -56
- package/esm/validation/error-box.d.ts.map +0 -1
- package/esm/validation/index.d.ts +0 -13
- package/esm/validation/index.d.ts.map +0 -1
- package/esm/validation/index.js +0 -562
- package/esm/validation/schema-paths.d.ts +0 -118
- package/esm/validation/schema-paths.d.ts.map +0 -1
- package/esm/validation/template-validator.d.ts +0 -143
- package/esm/validation/template-validator.d.ts.map +0 -1
- package/esm/validation/wrapper.d.ts +0 -97
- package/esm/validation/wrapper.d.ts.map +0 -1
- package/handlebars/expression-extractor.d.ts +0 -147
- package/handlebars/expression-extractor.d.ts.map +0 -1
- package/handlebars/helpers.d.ts +0 -339
- package/handlebars/helpers.d.ts.map +0 -1
- package/handlebars/index.d.ts +0 -195
- package/handlebars/index.d.ts.map +0 -1
- package/handlebars/index.js +0 -666
- package/registry/index.d.ts +0 -46
- package/registry/index.d.ts.map +0 -1
- package/registry/index.js +0 -6465
- package/registry/render-template.d.ts +0 -91
- package/registry/render-template.d.ts.map +0 -1
- package/registry/tool-ui.registry.d.ts +0 -294
- package/registry/tool-ui.registry.d.ts.map +0 -1
- package/registry/uri-utils.d.ts +0 -56
- package/registry/uri-utils.d.ts.map +0 -1
- package/renderers/cache.d.ts +0 -145
- package/renderers/cache.d.ts.map +0 -1
- package/renderers/html.renderer.d.ts +0 -123
- package/renderers/html.renderer.d.ts.map +0 -1
- package/renderers/mdx.renderer.d.ts +0 -120
- package/renderers/mdx.renderer.d.ts.map +0 -1
- package/renderers/registry.d.ts +0 -134
- package/renderers/registry.d.ts.map +0 -1
- package/renderers/types.d.ts +0 -342
- package/renderers/types.d.ts.map +0 -1
- package/renderers/utils/detect.d.ts +0 -107
- package/renderers/utils/detect.d.ts.map +0 -1
- package/renderers/utils/hash.d.ts +0 -40
- package/renderers/utils/hash.d.ts.map +0 -1
- package/renderers/utils/index.d.ts +0 -9
- package/renderers/utils/index.d.ts.map +0 -1
- package/renderers/utils/transpiler.d.ts +0 -89
- package/renderers/utils/transpiler.d.ts.map +0 -1
- package/runtime/adapters/html.adapter.d.ts +0 -59
- package/runtime/adapters/html.adapter.d.ts.map +0 -1
- package/runtime/adapters/index.d.ts +0 -26
- package/runtime/adapters/index.d.ts.map +0 -1
- package/runtime/adapters/mdx.adapter.d.ts +0 -73
- package/runtime/adapters/mdx.adapter.d.ts.map +0 -1
- package/runtime/adapters/react.adapter.d.ts.map +0 -1
- package/runtime/adapters/types.d.ts +0 -95
- package/runtime/adapters/types.d.ts.map +0 -1
- package/runtime/csp.d.ts +0 -48
- package/runtime/csp.d.ts.map +0 -1
- package/runtime/index.d.ts +0 -17
- package/runtime/index.d.ts.map +0 -1
- package/runtime/index.js +0 -5264
- package/runtime/mcp-bridge.d.ts +0 -101
- package/runtime/mcp-bridge.d.ts.map +0 -1
- package/runtime/renderer-runtime.d.ts +0 -133
- package/runtime/renderer-runtime.d.ts.map +0 -1
- package/runtime/sanitizer.d.ts +0 -172
- package/runtime/sanitizer.d.ts.map +0 -1
- package/runtime/types.d.ts +0 -415
- package/runtime/types.d.ts.map +0 -1
- package/runtime/wrapper.d.ts +0 -421
- package/runtime/wrapper.d.ts.map +0 -1
- package/styles/index.d.ts +0 -8
- package/styles/index.d.ts.map +0 -1
- package/styles/index.js +0 -222
- package/styles/variants.d.ts +0 -51
- package/styles/variants.d.ts.map +0 -1
- package/theme/cdn.d.ts +0 -195
- package/theme/cdn.d.ts.map +0 -1
- package/theme/index.d.ts +0 -18
- package/theme/index.d.ts.map +0 -1
- package/theme/index.js +0 -757
- package/theme/platforms.d.ts +0 -107
- package/theme/platforms.d.ts.map +0 -1
- package/theme/presets/github-openai.d.ts +0 -50
- package/theme/presets/github-openai.d.ts.map +0 -1
- package/theme/presets/index.d.ts +0 -11
- package/theme/presets/index.d.ts.map +0 -1
- package/theme/theme.d.ts +0 -396
- package/theme/theme.d.ts.map +0 -1
- package/tool-template/builder.d.ts +0 -213
- package/tool-template/builder.d.ts.map +0 -1
- package/tool-template/index.d.ts +0 -16
- package/tool-template/index.d.ts.map +0 -1
- package/tool-template/index.js +0 -3559
- package/types/index.d.ts +0 -14
- package/types/index.d.ts.map +0 -1
- package/types/index.js +0 -108
- package/types/ui-config.d.ts +0 -639
- package/types/ui-config.d.ts.map +0 -1
- package/types/ui-runtime.d.ts +0 -1007
- package/types/ui-runtime.d.ts.map +0 -1
- package/typings/cache/cache-adapter.d.ts +0 -125
- package/typings/cache/cache-adapter.d.ts.map +0 -1
- package/typings/cache/index.d.ts +0 -10
- package/typings/cache/index.d.ts.map +0 -1
- package/typings/cache/memory-cache.d.ts +0 -92
- package/typings/cache/memory-cache.d.ts.map +0 -1
- package/typings/dts-parser.d.ts +0 -90
- package/typings/dts-parser.d.ts.map +0 -1
- package/typings/index.d.ts +0 -48
- package/typings/index.d.ts.map +0 -1
- package/typings/schemas.d.ts +0 -232
- package/typings/schemas.d.ts.map +0 -1
- package/typings/type-fetcher.d.ts +0 -89
- package/typings/type-fetcher.d.ts.map +0 -1
- package/typings/types.d.ts +0 -320
- package/typings/types.d.ts.map +0 -1
- package/utils/escape-html.d.ts +0 -58
- package/utils/escape-html.d.ts.map +0 -1
- package/utils/index.d.ts +0 -10
- package/utils/index.d.ts.map +0 -1
- package/utils/index.js +0 -70
- package/utils/safe-stringify.d.ts +0 -30
- package/utils/safe-stringify.d.ts.map +0 -1
- package/validation/error-box.d.ts +0 -56
- package/validation/error-box.d.ts.map +0 -1
- package/validation/index.d.ts +0 -13
- package/validation/index.d.ts.map +0 -1
- package/validation/index.js +0 -603
- package/validation/schema-paths.d.ts +0 -118
- package/validation/schema-paths.d.ts.map +0 -1
- package/validation/template-validator.d.ts +0 -143
- package/validation/template-validator.d.ts.map +0 -1
- package/validation/wrapper.d.ts +0 -97
- package/validation/wrapper.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -1,438 +1,216 @@
|
|
|
1
1
|
# @frontmcp/ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
FrontMCP's platform-aware UI toolkit for building HTML widgets, web components, and React surfaces that run inside MCP transports. It renders plain strings by default (perfect for agents and dual-payload responses) and exposes React renderers, web components, and bundling helpers so you can reuse the same design system everywhere.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Package Split
|
|
6
|
+
|
|
7
|
+
| Package | Purpose | React Required |
|
|
8
|
+
| ------------------ | --------------------------------------------------------------- | --------------------- |
|
|
9
|
+
| `@frontmcp/ui` | HTML components, layouts, widgets, React components/hooks | Yes (peer dependency) |
|
|
10
|
+
| `@frontmcp/uipack` | Themes, build/render pipelines, runtime helpers, template types | No |
|
|
6
11
|
|
|
7
|
-
|
|
8
|
-
- **Zod Validation** - All component options validated at runtime with detailed error feedback.
|
|
9
|
-
- **Platform-Aware** - Optimized for OpenAI, Claude, Gemini, and ngrok platforms.
|
|
10
|
-
- **HTMX Support** - Built-in support for dynamic interactions without JavaScript.
|
|
11
|
-
- **Theme System** - Customizable themes with CDN URL configuration.
|
|
12
|
-
- **GitHub/OpenAI Theme** - Default gray-black aesthetic inspired by GitHub and OpenAI.
|
|
12
|
+
Use `@frontmcp/ui` for components and renderers. Pair it with `@frontmcp/uipack` for theming, build-time tooling, validation, and platform adapters.
|
|
13
13
|
|
|
14
14
|
## Installation
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
npm install @frontmcp/ui
|
|
17
|
+
npm install @frontmcp/ui @frontmcp/uipack react react-dom
|
|
18
18
|
# or
|
|
19
|
-
yarn add @frontmcp/ui
|
|
19
|
+
yarn add @frontmcp/ui @frontmcp/uipack react react-dom
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
+
## Features
|
|
23
|
+
|
|
24
|
+
- **HTML-first components** – Buttons, cards, badges, alerts, forms, tables, layouts, and widgets that return ready-to-stream HTML strings.
|
|
25
|
+
- **React + SSR** – Optional React components, hooks, and renderers so you can hydrate widgets when the host allows it.
|
|
26
|
+
- **MCP Bridge helpers** – Generate bridge bundles, wrap tool responses, and expose follow-up actions from inside widgets.
|
|
27
|
+
- **Web components** – Register `<fmcp-button>`, `<fmcp-card>`, and friends for projects that prefer custom elements.
|
|
28
|
+
- **Validation + error boxes** – Every component validates its options with Zod and renders a friendly error when something is misconfigured.
|
|
29
|
+
- **Works with uipack** – Import themes, runtime helpers, adapters, and build APIs from `@frontmcp/uipack` to keep HTML and React outputs in sync.
|
|
30
|
+
|
|
22
31
|
## Quick Start
|
|
23
32
|
|
|
24
|
-
|
|
25
|
-
import { button, card, baseLayout, DEFAULT_THEME } from '@frontmcp/ui';
|
|
33
|
+
### HTML components
|
|
26
34
|
|
|
27
|
-
|
|
28
|
-
|
|
35
|
+
```ts
|
|
36
|
+
import { card, button } from '@frontmcp/ui/components';
|
|
37
|
+
import { baseLayout } from '@frontmcp/ui/layouts';
|
|
38
|
+
import { DEFAULT_THEME } from '@frontmcp/uipack/theme';
|
|
29
39
|
|
|
30
|
-
|
|
31
|
-
const content = card(
|
|
40
|
+
const widget = card(
|
|
32
41
|
`
|
|
33
|
-
<h2>
|
|
34
|
-
<p>
|
|
42
|
+
<h2 class="text-lg font-semibold">CRM Access</h2>
|
|
43
|
+
<p>Grant the orchestrator access to customer data.</p>
|
|
44
|
+
${button('Approve', { variant: 'primary', type: 'submit' })}
|
|
35
45
|
`,
|
|
36
|
-
{ variant: '
|
|
46
|
+
{ variant: 'elevated' },
|
|
37
47
|
);
|
|
38
48
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
49
|
+
const html = baseLayout(widget, {
|
|
50
|
+
title: 'Authorize CRM',
|
|
51
|
+
description: 'Let the agent read CRM data for this session.',
|
|
42
52
|
theme: DEFAULT_THEME,
|
|
53
|
+
width: 'md',
|
|
54
|
+
align: 'center',
|
|
55
|
+
scripts: { tailwind: true, htmx: true },
|
|
43
56
|
});
|
|
44
57
|
```
|
|
45
58
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
### Button
|
|
59
|
+
### React components
|
|
49
60
|
|
|
50
|
-
```
|
|
51
|
-
import {
|
|
52
|
-
|
|
53
|
-
// Basic button
|
|
54
|
-
button('Submit');
|
|
55
|
-
|
|
56
|
-
// Button variants
|
|
57
|
-
button('Save', { variant: 'secondary' });
|
|
58
|
-
button('Delete', { variant: 'danger' });
|
|
59
|
-
button('Cancel', { variant: 'outline' });
|
|
60
|
-
|
|
61
|
-
// Shorthand functions
|
|
62
|
-
primaryButton('Submit');
|
|
63
|
-
dangerButton('Delete');
|
|
64
|
-
|
|
65
|
-
// Button with HTMX
|
|
66
|
-
button('Load More', {
|
|
67
|
-
htmx: {
|
|
68
|
-
get: '/api/items?page=2',
|
|
69
|
-
target: '#items-list',
|
|
70
|
-
swap: 'beforeend',
|
|
71
|
-
},
|
|
72
|
-
});
|
|
61
|
+
```tsx
|
|
62
|
+
import { Button, Card, Alert, Badge } from '@frontmcp/ui/react';
|
|
73
63
|
|
|
74
|
-
|
|
75
|
-
|
|
64
|
+
function MyWidget() {
|
|
65
|
+
return (
|
|
66
|
+
<Card title="Welcome">
|
|
67
|
+
<Alert variant="info">Hello, world!</Alert>
|
|
68
|
+
<Button variant="primary" onClick={handleClick}>
|
|
69
|
+
Get Started
|
|
70
|
+
</Button>
|
|
71
|
+
<Badge variant="success">Active</Badge>
|
|
72
|
+
</Card>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
76
75
|
```
|
|
77
76
|
|
|
78
|
-
###
|
|
79
|
-
|
|
80
|
-
```typescript
|
|
81
|
-
import { card, cardGroup } from '@frontmcp/ui';
|
|
82
|
-
|
|
83
|
-
// Basic card
|
|
84
|
-
card('<p>Card content</p>');
|
|
85
|
-
|
|
86
|
-
// Card with title and footer
|
|
87
|
-
card('<p>Content</p>', {
|
|
88
|
-
title: 'Card Title',
|
|
89
|
-
subtitle: 'Optional subtitle',
|
|
90
|
-
footer: '<button>Action</button>',
|
|
91
|
-
variant: 'elevated',
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
// Card group
|
|
95
|
-
cardGroup([card('Card 1', { title: 'First' }), card('Card 2', { title: 'Second' })], { columns: 2 });
|
|
96
|
-
```
|
|
77
|
+
### MCP Bridge hooks
|
|
97
78
|
|
|
98
|
-
|
|
79
|
+
```tsx
|
|
80
|
+
import { useMcpBridge, useCallTool, useToolInput, useToolOutput } from '@frontmcp/ui/react/hooks';
|
|
99
81
|
|
|
100
|
-
|
|
101
|
-
|
|
82
|
+
function ToolWidget() {
|
|
83
|
+
const bridge = useMcpBridge();
|
|
84
|
+
const { call, loading, error } = useCallTool();
|
|
85
|
+
const input = useToolInput();
|
|
86
|
+
const output = useToolOutput();
|
|
102
87
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
${input({ name: 'email', type: 'email', label: 'Email Address', required: true })}
|
|
107
|
-
${input({ name: 'password', type: 'password', label: 'Password', required: true })}
|
|
108
|
-
${checkbox({ name: 'remember', label: 'Remember me' })}
|
|
109
|
-
${formActions(button('Sign In', { type: 'submit' }))}
|
|
110
|
-
`,
|
|
111
|
-
{
|
|
112
|
-
action: '/login',
|
|
113
|
-
method: 'post',
|
|
114
|
-
htmx: { post: '/api/login', target: '#result' },
|
|
115
|
-
},
|
|
116
|
-
);
|
|
88
|
+
const handleClick = async () => {
|
|
89
|
+
await call('my-tool', { data: input.query });
|
|
90
|
+
};
|
|
117
91
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
// Radio group
|
|
129
|
-
radioGroup({
|
|
130
|
-
name: 'plan',
|
|
131
|
-
label: 'Select Plan',
|
|
132
|
-
options: [
|
|
133
|
-
{ value: 'free', label: 'Free' },
|
|
134
|
-
{ value: 'pro', label: 'Pro' },
|
|
135
|
-
],
|
|
136
|
-
});
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
### Alert & Badge
|
|
140
|
-
|
|
141
|
-
```typescript
|
|
142
|
-
import { alert, successAlert, warningAlert, badge, activeBadge } from '@frontmcp/ui';
|
|
143
|
-
|
|
144
|
-
// Alerts
|
|
145
|
-
alert('Information message', { variant: 'info' });
|
|
146
|
-
successAlert('Operation completed!');
|
|
147
|
-
warningAlert('Please review your input.');
|
|
148
|
-
|
|
149
|
-
// Badges
|
|
150
|
-
badge('New');
|
|
151
|
-
badge('Active', { variant: 'success' });
|
|
152
|
-
activeBadge(); // Green "Active" badge
|
|
92
|
+
return (
|
|
93
|
+
<div>
|
|
94
|
+
<p>Query: {input.query}</p>
|
|
95
|
+
{loading && <p>Loading...</p>}
|
|
96
|
+
{error && <p>Error: {error.message}</p>}
|
|
97
|
+
{output && <pre>{JSON.stringify(output, null, 2)}</pre>}
|
|
98
|
+
<button onClick={handleClick}>Run Tool</button>
|
|
99
|
+
</div>
|
|
100
|
+
);
|
|
101
|
+
}
|
|
153
102
|
```
|
|
154
103
|
|
|
155
|
-
###
|
|
156
|
-
|
|
157
|
-
```typescript
|
|
158
|
-
import { modal, modalTrigger, drawer, confirmModal } from '@frontmcp/ui';
|
|
104
|
+
### Universal app shell
|
|
159
105
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
id: 'my-modal',
|
|
163
|
-
title: 'Modal Title',
|
|
164
|
-
size: 'md',
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
// Modal trigger button
|
|
168
|
-
modalTrigger({ targetId: 'my-modal', text: 'Open Modal' });
|
|
106
|
+
```tsx
|
|
107
|
+
import { UniversalApp, FrontMCPProvider } from '@frontmcp/ui/universal';
|
|
169
108
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
// Drawer
|
|
180
|
-
drawer('<nav>Navigation</nav>', {
|
|
181
|
-
id: 'nav-drawer',
|
|
182
|
-
position: 'left',
|
|
183
|
-
title: 'Menu',
|
|
184
|
-
});
|
|
109
|
+
function App() {
|
|
110
|
+
return (
|
|
111
|
+
<FrontMCPProvider>
|
|
112
|
+
<UniversalApp>
|
|
113
|
+
<ToolWidget />
|
|
114
|
+
</UniversalApp>
|
|
115
|
+
</FrontMCPProvider>
|
|
116
|
+
);
|
|
117
|
+
}
|
|
185
118
|
```
|
|
186
119
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
```typescript
|
|
190
|
-
import { table, pagination } from '@frontmcp/ui';
|
|
191
|
-
|
|
192
|
-
// Data table
|
|
193
|
-
const data = [
|
|
194
|
-
{ id: 1, name: 'John', email: 'john@example.com' },
|
|
195
|
-
{ id: 2, name: 'Jane', email: 'jane@example.com' },
|
|
196
|
-
];
|
|
197
|
-
|
|
198
|
-
table(data, {
|
|
199
|
-
columns: [
|
|
200
|
-
{ key: 'id', header: 'ID', width: '60px' },
|
|
201
|
-
{ key: 'name', header: 'Name', sortable: true },
|
|
202
|
-
{ key: 'email', header: 'Email' },
|
|
203
|
-
],
|
|
204
|
-
selectable: true,
|
|
205
|
-
hoverable: true,
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
// Pagination
|
|
209
|
-
pagination({
|
|
210
|
-
page: 1,
|
|
211
|
-
totalPages: 10,
|
|
212
|
-
htmx: { get: '/api/items?page={page}', target: '#table' },
|
|
213
|
-
});
|
|
214
|
-
```
|
|
120
|
+
## Entry points
|
|
215
121
|
|
|
216
|
-
|
|
122
|
+
| Path | Exports |
|
|
123
|
+
| ----------------------------- | -------------------------------------------------- |
|
|
124
|
+
| `@frontmcp/ui/components` | HTML components, helpers, error boxes |
|
|
125
|
+
| `@frontmcp/ui/layouts` | Base layouts, consent/error templates |
|
|
126
|
+
| `@frontmcp/ui/pages` | High-level page templates |
|
|
127
|
+
| `@frontmcp/ui/widgets` | OpenAI App SDK-style widgets |
|
|
128
|
+
| `@frontmcp/ui/react` | React components |
|
|
129
|
+
| `@frontmcp/ui/react/hooks` | MCP Bridge React hooks |
|
|
130
|
+
| `@frontmcp/ui/renderers` | ReactRenderer + adapter helpers |
|
|
131
|
+
| `@frontmcp/ui/render` | React 19 static rendering utilities |
|
|
132
|
+
| `@frontmcp/ui/web-components` | `<fmcp-*>` custom elements |
|
|
133
|
+
| `@frontmcp/ui/bridge` | Bridge registry + adapters |
|
|
134
|
+
| `@frontmcp/ui/bundler` | SSR/component bundler (uses uipack under the hood) |
|
|
217
135
|
|
|
218
|
-
|
|
136
|
+
Use `@frontmcp/uipack/theme`, `@frontmcp/uipack/runtime`, and `@frontmcp/uipack/build` for theming, runtime helpers, and build-time APIs.
|
|
219
137
|
|
|
220
|
-
|
|
221
|
-
import { DEFAULT_THEME, GITHUB_OPENAI_THEME, baseLayout } from '@frontmcp/ui';
|
|
138
|
+
## Server-side rendering
|
|
222
139
|
|
|
223
|
-
|
|
224
|
-
const page = baseLayout(content, {
|
|
225
|
-
theme: DEFAULT_THEME,
|
|
226
|
-
});
|
|
227
|
-
```
|
|
140
|
+
### ReactRenderer (SSR)
|
|
228
141
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
```typescript
|
|
232
|
-
import { createTheme } from '@frontmcp/ui';
|
|
233
|
-
|
|
234
|
-
const myTheme = createTheme({
|
|
235
|
-
name: 'my-brand',
|
|
236
|
-
colors: {
|
|
237
|
-
semantic: {
|
|
238
|
-
primary: '#0969da',
|
|
239
|
-
secondary: '#8250df',
|
|
240
|
-
accent: '#bf8700',
|
|
241
|
-
},
|
|
242
|
-
},
|
|
243
|
-
typography: {
|
|
244
|
-
families: {
|
|
245
|
-
sans: '"Roboto", system-ui, sans-serif',
|
|
246
|
-
},
|
|
247
|
-
},
|
|
248
|
-
cdn: {
|
|
249
|
-
fonts: {
|
|
250
|
-
stylesheets: ['https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap'],
|
|
251
|
-
},
|
|
252
|
-
},
|
|
253
|
-
});
|
|
254
|
-
```
|
|
142
|
+
```ts
|
|
143
|
+
import { ReactRenderer, reactRenderer } from '@frontmcp/ui/renderers';
|
|
255
144
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
```typescript
|
|
261
|
-
const theme = createTheme({
|
|
262
|
-
cdn: {
|
|
263
|
-
fonts: {
|
|
264
|
-
preconnect: ['https://fonts.example.com'],
|
|
265
|
-
stylesheets: ['https://fonts.example.com/css/roboto.css'],
|
|
266
|
-
},
|
|
267
|
-
scripts: {
|
|
268
|
-
tailwind: 'https://cdn.example.com/tailwind.js',
|
|
269
|
-
htmx: {
|
|
270
|
-
url: 'https://cdn.example.com/htmx.min.js',
|
|
271
|
-
integrity: 'sha512-...',
|
|
272
|
-
},
|
|
273
|
-
},
|
|
274
|
-
icons: {
|
|
275
|
-
script: { url: 'https://cdn.example.com/lucide.min.js' },
|
|
276
|
-
},
|
|
277
|
-
},
|
|
145
|
+
const html = await reactRenderer.render(MyComponent, {
|
|
146
|
+
input: { query: 'test' },
|
|
147
|
+
output: { result: 'data' },
|
|
278
148
|
});
|
|
279
149
|
```
|
|
280
150
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
### Platform Detection
|
|
151
|
+
### ReactRendererAdapter (client hydration)
|
|
284
152
|
|
|
285
|
-
```
|
|
286
|
-
import {
|
|
153
|
+
```ts
|
|
154
|
+
import { ReactRendererAdapter, createReactAdapter } from '@frontmcp/ui/renderers';
|
|
287
155
|
|
|
288
|
-
const
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
} else if (needsInlineScripts(platform)) {
|
|
293
|
-
// Embed scripts inline for blocked-network platforms
|
|
294
|
-
}
|
|
156
|
+
const adapter = createReactAdapter();
|
|
157
|
+
await adapter.hydrate(targetElement, context);
|
|
158
|
+
await adapter.renderToDOM(content, targetElement, context);
|
|
159
|
+
adapter.destroy(targetElement);
|
|
295
160
|
```
|
|
296
161
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
```typescript
|
|
300
|
-
import { buildCdnScriptsFromTheme, fetchAndCacheScriptsFromTheme, DEFAULT_THEME } from '@frontmcp/ui';
|
|
162
|
+
## SSR bundling
|
|
301
163
|
|
|
302
|
-
|
|
303
|
-
|
|
164
|
+
```ts
|
|
165
|
+
import { InMemoryBundler, createBundler } from '@frontmcp/ui/bundler';
|
|
304
166
|
|
|
305
|
-
|
|
306
|
-
await
|
|
307
|
-
const inlineScripts = buildCdnScriptsFromTheme(DEFAULT_THEME, { inline: true });
|
|
167
|
+
const bundler = createBundler({ cache: true });
|
|
168
|
+
const result = await bundler.bundle('./components/MyWidget.tsx');
|
|
308
169
|
```
|
|
309
170
|
|
|
310
|
-
##
|
|
171
|
+
## Using with @frontmcp/uipack
|
|
311
172
|
|
|
312
|
-
|
|
173
|
+
```ts
|
|
174
|
+
// Theme + scripts
|
|
175
|
+
import { DEFAULT_THEME, createTheme } from '@frontmcp/uipack/theme';
|
|
313
176
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
button('Click', { variant: 'primary' });
|
|
177
|
+
// Build API & adapters
|
|
178
|
+
import { buildToolUI, buildToolDiscoveryMeta } from '@frontmcp/uipack/build';
|
|
317
179
|
|
|
318
|
-
//
|
|
319
|
-
|
|
180
|
+
// Runtime helpers
|
|
181
|
+
import { wrapToolUI, createTemplateHelpers } from '@frontmcp/uipack/runtime';
|
|
320
182
|
|
|
321
|
-
//
|
|
322
|
-
|
|
183
|
+
// Validation + utils
|
|
184
|
+
import { validateOptions } from '@frontmcp/uipack/validation';
|
|
323
185
|
```
|
|
324
186
|
|
|
325
|
-
|
|
187
|
+
`@frontmcp/uipack` lets you configure themes, register cached widgets, wrap templates with CSP, and emit platform-specific metadata without pulling React into HTML-only projects.
|
|
326
188
|
|
|
327
|
-
|
|
328
|
-
import { ButtonOptionsSchema } from '@frontmcp/ui';
|
|
189
|
+
## Peer dependencies
|
|
329
190
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
191
|
+
```json
|
|
192
|
+
{
|
|
193
|
+
"peerDependencies": {
|
|
194
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
195
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
196
|
+
"@frontmcp/uipack": "^0.6.1"
|
|
197
|
+
}
|
|
336
198
|
}
|
|
337
199
|
```
|
|
338
200
|
|
|
339
|
-
## Layouts
|
|
340
|
-
|
|
341
|
-
### Base Layout
|
|
342
|
-
|
|
343
|
-
```typescript
|
|
344
|
-
import { baseLayout } from '@frontmcp/ui';
|
|
345
|
-
|
|
346
|
-
const html = baseLayout(content, {
|
|
347
|
-
title: 'Page Title',
|
|
348
|
-
description: 'Page description for SEO',
|
|
349
|
-
theme: DEFAULT_THEME,
|
|
350
|
-
width: 'md', // 'sm' | 'md' | 'lg' | 'xl' | 'full'
|
|
351
|
-
align: 'center', // 'left' | 'center' | 'right'
|
|
352
|
-
scripts: { htmx: true, tailwind: true },
|
|
353
|
-
});
|
|
354
|
-
```
|
|
355
|
-
|
|
356
|
-
## Testing Tool UI
|
|
357
|
-
|
|
358
|
-
When using `@frontmcp/ui` components in Tool UI templates (React, MDX), you can use `@frontmcp/testing` for E2E validation:
|
|
359
|
-
|
|
360
|
-
```typescript
|
|
361
|
-
import { test, expect, UIAssertions } from '@frontmcp/testing';
|
|
362
|
-
|
|
363
|
-
test.describe('Tool UI with @frontmcp/ui', () => {
|
|
364
|
-
test('renders UI components correctly', async ({ mcp }) => {
|
|
365
|
-
const result = await mcp.tools.call('my-tool', { data: 'test' });
|
|
366
|
-
|
|
367
|
-
// Verify HTML is rendered (not fallback)
|
|
368
|
-
expect(result).toHaveRenderedHtml();
|
|
369
|
-
expect(result).toHaveProperHtmlStructure();
|
|
370
|
-
|
|
371
|
-
// Verify data binding
|
|
372
|
-
const output = result.json();
|
|
373
|
-
expect(result).toContainBoundValue(output.data);
|
|
374
|
-
|
|
375
|
-
// Security validation
|
|
376
|
-
expect(result).toBeXssSafe();
|
|
377
|
-
|
|
378
|
-
// Extract HTML for additional assertions
|
|
379
|
-
const html = UIAssertions.assertRenderedUI(result);
|
|
380
|
-
|
|
381
|
-
// Verify @frontmcp/ui component classes
|
|
382
|
-
expect(html).toContain('btn-primary'); // Button class
|
|
383
|
-
expect(html).toContain('card'); // Card component
|
|
384
|
-
});
|
|
385
|
-
});
|
|
386
|
-
```
|
|
387
|
-
|
|
388
|
-
### UI Matchers
|
|
389
|
-
|
|
390
|
-
| Matcher | Description |
|
|
391
|
-
| ----------------------------- | ----------------------------------------------- |
|
|
392
|
-
| `toHaveRenderedHtml()` | Checks `_meta['ui/html']` exists, not fallback |
|
|
393
|
-
| `toContainHtmlElement(tag)` | Checks HTML contains `<tag>` element |
|
|
394
|
-
| `toContainBoundValue(value)` | Checks output value appears in HTML |
|
|
395
|
-
| `toBeXssSafe()` | No `<script>`, event handlers, `javascript:` |
|
|
396
|
-
| `toHaveWidgetMetadata()` | Has platform metadata |
|
|
397
|
-
| `toHaveCssClass(className)` | Checks for specific CSS class |
|
|
398
|
-
| `toNotContainRawContent(str)` | Content is NOT present (for fallback detection) |
|
|
399
|
-
| `toHaveProperHtmlStructure()` | HTML has tags, not escaped text |
|
|
400
|
-
|
|
401
|
-
### UIAssertions Helper
|
|
402
|
-
|
|
403
|
-
```typescript
|
|
404
|
-
import { UIAssertions } from '@frontmcp/testing';
|
|
405
|
-
|
|
406
|
-
// Extract HTML from result
|
|
407
|
-
const html = UIAssertions.assertRenderedUI(result);
|
|
408
|
-
|
|
409
|
-
// Validate data binding
|
|
410
|
-
UIAssertions.assertDataBinding(html, output, ['field1', 'field2']);
|
|
411
|
-
|
|
412
|
-
// Comprehensive validation
|
|
413
|
-
const html = UIAssertions.assertValidUI(result, ['field1', 'field2']);
|
|
414
|
-
```
|
|
415
|
-
|
|
416
|
-
See [@frontmcp/testing documentation](../testing/README.md) for full API reference.
|
|
417
|
-
|
|
418
201
|
## Development
|
|
419
202
|
|
|
420
|
-
### Building
|
|
421
|
-
|
|
422
203
|
```bash
|
|
423
204
|
yarn nx build ui
|
|
424
|
-
```
|
|
425
|
-
|
|
426
|
-
### Testing
|
|
427
|
-
|
|
428
|
-
```bash
|
|
429
205
|
yarn nx test ui
|
|
430
206
|
```
|
|
431
207
|
|
|
432
|
-
|
|
208
|
+
## Related packages
|
|
433
209
|
|
|
434
|
-
|
|
210
|
+
- [`@frontmcp/uipack`](../uipack/README.md) – React-free themes, runtime helpers, build tooling
|
|
211
|
+
- [`@frontmcp/sdk`](../sdk/README.md) – Core SDK
|
|
212
|
+
- [`@frontmcp/testing`](../testing/README.md) – UI assertions and fixtures
|
|
435
213
|
|
|
436
214
|
## License
|
|
437
215
|
|
|
438
|
-
|
|
216
|
+
Apache-2.0
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
* Bridge Runtime Module
|
|
3
3
|
*
|
|
4
4
|
* Exports for generating runtime bridge scripts.
|
|
5
|
+
* Re-exports from @frontmcp/uipack/bridge-runtime for compatibility.
|
|
5
6
|
*
|
|
6
7
|
* @packageDocumentation
|
|
7
8
|
*/
|
|
8
|
-
export { generateBridgeIIFE, generatePlatformBundle, UNIVERSAL_BRIDGE_SCRIPT, BRIDGE_SCRIPT_TAGS, type IIFEGeneratorOptions, } from '
|
|
9
|
+
export { generateBridgeIIFE, generatePlatformBundle, UNIVERSAL_BRIDGE_SCRIPT, BRIDGE_SCRIPT_TAGS, type IIFEGeneratorOptions, } from '@frontmcp/uipack';
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/bridge/runtime/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/bridge/runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,KAAK,oBAAoB,GAC1B,MAAM,kBAAkB,CAAC"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
|
-
import type { ComponentBuildManifest, FileBundleOptions, CDNDependency, CDNPlatformType } from '
|
|
9
|
+
import type { ComponentBuildManifest, FileBundleOptions, CDNDependency, CDNPlatformType } from '@frontmcp/uipack/dependency';
|
|
10
10
|
import type { BuildCacheStorage } from './storage/interface';
|
|
11
11
|
/**
|
|
12
12
|
* Options for building a component.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-builder.d.ts","sourceRoot":"","sources":["../../../src/bundler/file-cache/component-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,OAAO,KAAK,EACV,sBAAsB,EACtB,iBAAiB,EACjB,aAAa,EACb,eAAe,EAGhB,MAAM,
|
|
1
|
+
{"version":3,"file":"component-builder.d.ts","sourceRoot":"","sources":["../../../src/bundler/file-cache/component-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,OAAO,KAAK,EACV,sBAAsB,EACtB,iBAAiB,EACjB,aAAa,EACb,eAAe,EAGhB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAQ7D;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,QAAQ,EAAE,M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G;IACG,YAAY,CAChB,OAAO,EAAE,IAAI,CAAC,qBAAqB,EAAE,WAAW,GAAG,WAAW,GAAG,cAAc,GAAG,eAAe,CAAC,GACjG,OAAO,CAAC,OAAO,CAAC;IAcnB;;OAEG;IACG,SAAS,CACb,OAAO,EAAE,IAAI,CAAC,qBAAqB,EAAE,WAAW,GAAG,WAAW,GAAG,cAAc,GAAG,eAAe,CAAC,GACjG,OAAO,CAAC,sBAAsB,GAAG,SAAS,CAAC;IAa9C;;OAEG;IACG,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIvD;;OAEG;IACH,YAAY,CAAC,QAAQ,EAAE,sBAAsB,EAAE,MAAM,UAAQ,GAAG,MAAM;IAatE;;OAEG;YACW,eAAe;IA4C7B;;OAEG;YACW,SAAS;CAqDxB;AAMD;;GAEG;AACH,wBAAsB,uBAAuB,CAAC,QAAQ,SAA2B,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAK5G;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,WAAW,EAAE,OAAO,oBAAoB,EAAE,WAAW,EACrD,SAAS,SAAuB,GAC/B,OAAO,CAAC,gBAAgB,CAAC,CAQ3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hash-calculator.d.ts","sourceRoot":"","sources":["../../../src/bundler/file-cache/hash-calculator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"hash-calculator.d.ts","sourceRoot":"","sources":["../../../src/bundler/file-cache/hash-calculator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAMpF;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED;;;;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O,CAAC,MAAM,CAAC,CAO9G;AA6HD;;;;;;GAMG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAIxC;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGpD"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
|
-
import type { ComponentBuildManifest, CacheStats } from '
|
|
9
|
+
import type { ComponentBuildManifest, CacheStats } from '@frontmcp/uipack/dependency';
|
|
10
10
|
import type { BuildCacheStorage, StorageOptions } from './interface';
|
|
11
11
|
/**
|
|
12
12
|
* Error thrown when cache storage fails to initialize.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filesystem.d.ts","sourceRoot":"","sources":["../../../../src/bundler/file-cache/storage/filesystem.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,OAAO,KAAK,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"filesystem.d.ts","sourceRoot":"","sources":["../../../../src/bundler/file-cache/storage/filesystem.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,OAAO,KAAK,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACtF,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAc,MAAM,aAAa,CAAC;AAOjF;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;IACjD,SAAkB,KAAK,CAAC,EAAE,OAAO,CAAC;gBAEtB,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;CAK7C;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,SAAkB,KAAK,CAAC,EAAE,OAAO,CAAC;gBAEtB,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO;CAK7C;AAED;;GAEG;AACH,qBAAa,0BAA2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