@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/pages/index.js
CHANGED
|
@@ -36,503 +36,10 @@ __export(pages_exports, {
|
|
|
36
36
|
});
|
|
37
37
|
module.exports = __toCommonJS(pages_exports);
|
|
38
38
|
|
|
39
|
-
// libs/ui/src/theme/cdn.ts
|
|
40
|
-
var CDN = {
|
|
41
|
-
/**
|
|
42
|
-
* Tailwind CSS v4 Browser CDN
|
|
43
|
-
* Generates styles on-the-fly with @theme support
|
|
44
|
-
* @see https://tailwindcss.com/docs/installation/play-cdn
|
|
45
|
-
*/
|
|
46
|
-
tailwind: "https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4",
|
|
47
|
-
/**
|
|
48
|
-
* HTMX 2.x - High power tools for HTML
|
|
49
|
-
* Enables AJAX, WebSockets, Server Sent Events directly in HTML
|
|
50
|
-
* @see https://htmx.org
|
|
51
|
-
*/
|
|
52
|
-
htmx: {
|
|
53
|
-
url: "https://cdnjs.cloudflare.com/ajax/libs/htmx/2.0.7/htmx.min.js",
|
|
54
|
-
integrity: "sha512-T6VLg/MJYMbLTmQ8VLvonbWg8VOvmDhXcOvHzCwo6ShdGuUU5SEcp1IAPXL4k9lVoMi8gRXl5K/S/zh43Y9rJA=="
|
|
55
|
-
},
|
|
56
|
-
/**
|
|
57
|
-
* Alpine.js - Lightweight reactive framework
|
|
58
|
-
* Used for more complex client-side interactions
|
|
59
|
-
* @see https://alpinejs.dev
|
|
60
|
-
*/
|
|
61
|
-
alpine: {
|
|
62
|
-
url: "https://cdn.jsdelivr.net/npm/alpinejs@3.14.3/dist/cdn.min.js",
|
|
63
|
-
integrity: "sha384-6zY8MFQJ/EqS1r4RJl+7j8rvZPuBWpT0RzWf+IFcKhxqUzQNmJzA1X1VEVZhYaEz"
|
|
64
|
-
},
|
|
65
|
-
/**
|
|
66
|
-
* Google Fonts - Inter for modern UI typography
|
|
67
|
-
*/
|
|
68
|
-
fonts: {
|
|
69
|
-
preconnect: ["https://fonts.googleapis.com", "https://fonts.gstatic.com"],
|
|
70
|
-
inter: "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap",
|
|
71
|
-
mono: "https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap"
|
|
72
|
-
},
|
|
73
|
-
/**
|
|
74
|
-
* Lucide Icons - Beautiful & consistent icons
|
|
75
|
-
* @see https://lucide.dev
|
|
76
|
-
*/
|
|
77
|
-
icons: {
|
|
78
|
-
url: "https://cdn.jsdelivr.net/npm/lucide@0.294.0/dist/umd/lucide.min.js",
|
|
79
|
-
integrity: "sha384-wpLmHb7v7V1LsEuTmPQ9tXqWZvTtRWWVqJuE+Yz6X0I6O2T6bHJVeXH1lVWqF4qE"
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
var scriptCache = /* @__PURE__ */ new Map();
|
|
83
|
-
function getCachedScript(url) {
|
|
84
|
-
return scriptCache.get(url);
|
|
85
|
-
}
|
|
86
|
-
function isScriptCached(url) {
|
|
87
|
-
return scriptCache.has(url);
|
|
88
|
-
}
|
|
89
|
-
function buildFontPreconnect() {
|
|
90
|
-
return CDN.fonts.preconnect.map((url, i) => `<link rel="preconnect" href="${url}"${i > 0 ? " crossorigin" : ""}>`).join("\n ");
|
|
91
|
-
}
|
|
92
|
-
function buildFontStylesheets(options = {}) {
|
|
93
|
-
const { inter = true, mono = false } = options;
|
|
94
|
-
const links = [];
|
|
95
|
-
if (inter) {
|
|
96
|
-
links.push(`<link href="${CDN.fonts.inter}" rel="stylesheet">`);
|
|
97
|
-
}
|
|
98
|
-
if (mono) {
|
|
99
|
-
links.push(`<link href="${CDN.fonts.mono}" rel="stylesheet">`);
|
|
100
|
-
}
|
|
101
|
-
return links.join("\n ");
|
|
102
|
-
}
|
|
103
|
-
function buildScriptTag(url, integrity, options = {}) {
|
|
104
|
-
const attrs = [`src="${url}"`];
|
|
105
|
-
if (integrity) {
|
|
106
|
-
attrs.push(`integrity="${integrity}"`);
|
|
107
|
-
attrs.push('crossorigin="anonymous"');
|
|
108
|
-
}
|
|
109
|
-
if (options.defer) attrs.push("defer");
|
|
110
|
-
if (options.async) attrs.push("async");
|
|
111
|
-
return `<script ${attrs.join(" ")}></script>`;
|
|
112
|
-
}
|
|
113
|
-
function buildInlineScriptTag(content) {
|
|
114
|
-
return `<script>${content}</script>`;
|
|
115
|
-
}
|
|
116
|
-
function buildCdnScripts(options = {}) {
|
|
117
|
-
const { tailwind = true, htmx = true, alpine = false, icons = false, inline = false } = options;
|
|
118
|
-
const scripts = [];
|
|
119
|
-
if (inline) {
|
|
120
|
-
if (tailwind) {
|
|
121
|
-
if (isScriptCached(CDN.tailwind)) {
|
|
122
|
-
scripts.push(buildInlineScriptTag(getCachedScript(CDN.tailwind)));
|
|
123
|
-
} else {
|
|
124
|
-
console.warn(
|
|
125
|
-
"[frontmcp/ui] Inline mode requested but Tailwind script not cached. Call fetchAndCacheScripts() first."
|
|
126
|
-
);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
if (htmx) {
|
|
130
|
-
if (isScriptCached(CDN.htmx.url)) {
|
|
131
|
-
scripts.push(buildInlineScriptTag(getCachedScript(CDN.htmx.url)));
|
|
132
|
-
} else {
|
|
133
|
-
console.warn(
|
|
134
|
-
"[frontmcp/ui] Inline mode requested but HTMX script not cached. Call fetchAndCacheScripts() first."
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
if (alpine) {
|
|
139
|
-
if (isScriptCached(CDN.alpine.url)) {
|
|
140
|
-
scripts.push(buildInlineScriptTag(getCachedScript(CDN.alpine.url)));
|
|
141
|
-
} else {
|
|
142
|
-
console.warn(
|
|
143
|
-
"[frontmcp/ui] Inline mode requested but Alpine.js script not cached. Call fetchAndCacheScripts() first."
|
|
144
|
-
);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
if (icons) {
|
|
148
|
-
if (isScriptCached(CDN.icons.url)) {
|
|
149
|
-
scripts.push(buildInlineScriptTag(getCachedScript(CDN.icons.url)));
|
|
150
|
-
} else {
|
|
151
|
-
console.warn(
|
|
152
|
-
"[frontmcp/ui] Inline mode requested but Lucide icons script not cached. Call fetchAndCacheScripts() first."
|
|
153
|
-
);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
} else {
|
|
157
|
-
if (tailwind) {
|
|
158
|
-
scripts.push(buildScriptTag(CDN.tailwind));
|
|
159
|
-
}
|
|
160
|
-
if (htmx) {
|
|
161
|
-
scripts.push(buildScriptTag(CDN.htmx.url, CDN.htmx.integrity));
|
|
162
|
-
}
|
|
163
|
-
if (alpine) {
|
|
164
|
-
scripts.push(buildScriptTag(CDN.alpine.url, CDN.alpine.integrity, { defer: true }));
|
|
165
|
-
}
|
|
166
|
-
if (icons) {
|
|
167
|
-
scripts.push(buildScriptTag(CDN.icons.url, CDN.icons.integrity));
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
return scripts.join("\n ");
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
// libs/ui/src/theme/platforms.ts
|
|
174
|
-
var OPENAI_PLATFORM = {
|
|
175
|
-
id: "openai",
|
|
176
|
-
name: "OpenAI",
|
|
177
|
-
supportsWidgets: true,
|
|
178
|
-
supportsTailwind: true,
|
|
179
|
-
supportsHtmx: true,
|
|
180
|
-
networkMode: "full",
|
|
181
|
-
scriptStrategy: "cdn",
|
|
182
|
-
options: {
|
|
183
|
-
sdk: "apps-sdk",
|
|
184
|
-
version: "1.0"
|
|
185
|
-
}
|
|
186
|
-
};
|
|
187
|
-
var CLAUDE_PLATFORM = {
|
|
188
|
-
id: "claude",
|
|
189
|
-
name: "Claude (Artifacts)",
|
|
190
|
-
supportsWidgets: true,
|
|
191
|
-
supportsTailwind: true,
|
|
192
|
-
supportsHtmx: false,
|
|
193
|
-
// Network blocked, HTMX won't work for API calls
|
|
194
|
-
networkMode: "blocked",
|
|
195
|
-
scriptStrategy: "inline",
|
|
196
|
-
maxInlineSize: 100 * 1024,
|
|
197
|
-
// 100KB limit for artifacts
|
|
198
|
-
cspRestrictions: ["script-src 'unsafe-inline'", "connect-src 'none'"],
|
|
199
|
-
options: {
|
|
200
|
-
mode: "artifacts",
|
|
201
|
-
framework: "react"
|
|
202
|
-
// Claude artifacts prefer React
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
|
-
function canUseCdn(platform) {
|
|
206
|
-
return platform.networkMode === "full" && platform.scriptStrategy === "cdn";
|
|
207
|
-
}
|
|
208
|
-
function needsInlineScripts(platform) {
|
|
209
|
-
return platform.scriptStrategy === "inline" || platform.networkMode === "blocked";
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
// libs/ui/src/theme/presets/github-openai.ts
|
|
213
|
-
var GITHUB_OPENAI_THEME = {
|
|
214
|
-
name: "github-openai",
|
|
215
|
-
colors: {
|
|
216
|
-
semantic: {
|
|
217
|
-
// Primary: Near-black for main actions and branding
|
|
218
|
-
primary: "#24292f",
|
|
219
|
-
// Secondary: Medium gray for secondary elements
|
|
220
|
-
secondary: "#57606a",
|
|
221
|
-
// Accent: Blue for links, focus states, and highlights
|
|
222
|
-
accent: "#0969da",
|
|
223
|
-
// Status colors
|
|
224
|
-
success: "#1a7f37",
|
|
225
|
-
// GitHub green
|
|
226
|
-
warning: "#9a6700",
|
|
227
|
-
// Amber warning
|
|
228
|
-
danger: "#cf222e",
|
|
229
|
-
// GitHub red
|
|
230
|
-
info: "#0969da"
|
|
231
|
-
// Blue info
|
|
232
|
-
},
|
|
233
|
-
surface: {
|
|
234
|
-
// Pure white background
|
|
235
|
-
background: "#ffffff",
|
|
236
|
-
// Light gray surface (GitHub code background style)
|
|
237
|
-
surface: "#f6f8fa",
|
|
238
|
-
// White elevated surfaces (modals, cards)
|
|
239
|
-
elevated: "#ffffff",
|
|
240
|
-
// Dark semi-transparent overlay
|
|
241
|
-
overlay: "rgba(27, 31, 36, 0.5)"
|
|
242
|
-
},
|
|
243
|
-
text: {
|
|
244
|
-
// Near-black for primary text
|
|
245
|
-
primary: "#24292f",
|
|
246
|
-
// Gray for secondary/muted text
|
|
247
|
-
secondary: "#57606a",
|
|
248
|
-
// Light gray for disabled text
|
|
249
|
-
disabled: "#8c959f",
|
|
250
|
-
// White for text on dark backgrounds
|
|
251
|
-
inverse: "#ffffff",
|
|
252
|
-
// Blue for links
|
|
253
|
-
link: "#0969da"
|
|
254
|
-
},
|
|
255
|
-
border: {
|
|
256
|
-
// Light gray border (GitHub style)
|
|
257
|
-
default: "#d0d7de",
|
|
258
|
-
// Medium gray on hover
|
|
259
|
-
hover: "#8c959f",
|
|
260
|
-
// Blue focus ring
|
|
261
|
-
focus: "#0969da",
|
|
262
|
-
// Subtle divider
|
|
263
|
-
divider: "#d8dee4"
|
|
264
|
-
}
|
|
265
|
-
},
|
|
266
|
-
typography: {
|
|
267
|
-
families: {
|
|
268
|
-
// System UI font stack (GitHub/Apple style)
|
|
269
|
-
sans: '-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"',
|
|
270
|
-
// Monospace stack
|
|
271
|
-
mono: 'ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, "Liberation Mono", monospace'
|
|
272
|
-
},
|
|
273
|
-
sizes: {
|
|
274
|
-
xs: "0.75rem",
|
|
275
|
-
// 12px
|
|
276
|
-
sm: "0.875rem",
|
|
277
|
-
// 14px
|
|
278
|
-
base: "1rem",
|
|
279
|
-
// 16px
|
|
280
|
-
lg: "1.125rem",
|
|
281
|
-
// 18px
|
|
282
|
-
xl: "1.25rem",
|
|
283
|
-
// 20px
|
|
284
|
-
"2xl": "1.5rem",
|
|
285
|
-
// 24px
|
|
286
|
-
"3xl": "1.875rem",
|
|
287
|
-
// 30px
|
|
288
|
-
"4xl": "2.25rem"
|
|
289
|
-
// 36px
|
|
290
|
-
},
|
|
291
|
-
weights: {
|
|
292
|
-
normal: "400",
|
|
293
|
-
medium: "500",
|
|
294
|
-
semibold: "600",
|
|
295
|
-
bold: "700"
|
|
296
|
-
}
|
|
297
|
-
},
|
|
298
|
-
radius: {
|
|
299
|
-
none: "0",
|
|
300
|
-
sm: "3px",
|
|
301
|
-
// GitHub uses smaller radii
|
|
302
|
-
md: "6px",
|
|
303
|
-
lg: "8px",
|
|
304
|
-
xl: "12px",
|
|
305
|
-
"2xl": "16px",
|
|
306
|
-
full: "9999px"
|
|
307
|
-
},
|
|
308
|
-
shadows: {
|
|
309
|
-
// Subtle shadows with gray tones
|
|
310
|
-
sm: "0 1px 0 rgba(27, 31, 36, 0.04)",
|
|
311
|
-
md: "0 3px 6px rgba(140, 149, 159, 0.15)",
|
|
312
|
-
lg: "0 8px 24px rgba(140, 149, 159, 0.2)",
|
|
313
|
-
xl: "0 12px 28px rgba(140, 149, 159, 0.3)"
|
|
314
|
-
},
|
|
315
|
-
components: {
|
|
316
|
-
button: {
|
|
317
|
-
radius: "6px",
|
|
318
|
-
paddingX: "16px",
|
|
319
|
-
paddingY: "5px",
|
|
320
|
-
fontSize: "14px",
|
|
321
|
-
fontWeight: "500"
|
|
322
|
-
},
|
|
323
|
-
card: {
|
|
324
|
-
radius: "6px",
|
|
325
|
-
padding: "16px",
|
|
326
|
-
shadow: "0 1px 0 rgba(27, 31, 36, 0.04)",
|
|
327
|
-
borderWidth: "1px"
|
|
328
|
-
},
|
|
329
|
-
input: {
|
|
330
|
-
radius: "6px",
|
|
331
|
-
paddingX: "12px",
|
|
332
|
-
paddingY: "5px",
|
|
333
|
-
borderWidth: "1px",
|
|
334
|
-
focusRingWidth: "3px"
|
|
335
|
-
}
|
|
336
|
-
},
|
|
337
|
-
cdn: {
|
|
338
|
-
fonts: {
|
|
339
|
-
preconnect: ["https://fonts.googleapis.com", "https://fonts.gstatic.com"],
|
|
340
|
-
stylesheets: [
|
|
341
|
-
// System UI fonts don't need external stylesheets, but we include
|
|
342
|
-
// Inter as an optional enhancement for consistent cross-platform rendering
|
|
343
|
-
"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap"
|
|
344
|
-
]
|
|
345
|
-
},
|
|
346
|
-
icons: {
|
|
347
|
-
script: {
|
|
348
|
-
url: "https://cdn.jsdelivr.net/npm/lucide@0.294.0/dist/umd/lucide.min.js"
|
|
349
|
-
}
|
|
350
|
-
},
|
|
351
|
-
scripts: {
|
|
352
|
-
tailwind: "https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4",
|
|
353
|
-
htmx: {
|
|
354
|
-
url: "https://cdnjs.cloudflare.com/ajax/libs/htmx/2.0.7/htmx.min.js",
|
|
355
|
-
integrity: "sha512-T6VLg/MJYMbLTmQ8VLvonbWg8VOvmDhXcOvHzCwo6ShdGuUU5SEcp1IAPXL4k9lVoMi8gRXl5K/S/zh43Y9rJA=="
|
|
356
|
-
},
|
|
357
|
-
alpine: {
|
|
358
|
-
url: "https://cdn.jsdelivr.net/npm/alpinejs@3.14.3/dist/cdn.min.js",
|
|
359
|
-
integrity: "sha384-6zY8MFQJ/EqS1r4RJl+7j8rvZPuBWpT0RzWf+IFcKhxqUzQNmJzA1X1VEVZhYaEz"
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
};
|
|
364
|
-
var DEFAULT_THEME = GITHUB_OPENAI_THEME;
|
|
365
|
-
|
|
366
|
-
// libs/ui/src/theme/theme.ts
|
|
367
|
-
function mergeThemesCore(base, override) {
|
|
368
|
-
const baseColors = base.colors ?? { semantic: { primary: "#24292f" } };
|
|
369
|
-
const filterStrings = (arr) => arr.filter((s) => s !== void 0);
|
|
370
|
-
return {
|
|
371
|
-
...base,
|
|
372
|
-
...override,
|
|
373
|
-
colors: {
|
|
374
|
-
...baseColors,
|
|
375
|
-
...override.colors,
|
|
376
|
-
semantic: { ...baseColors.semantic, ...override.colors?.semantic },
|
|
377
|
-
surface: { ...baseColors.surface, ...override.colors?.surface },
|
|
378
|
-
text: { ...baseColors.text, ...override.colors?.text },
|
|
379
|
-
border: { ...baseColors.border, ...override.colors?.border },
|
|
380
|
-
custom: { ...baseColors.custom, ...override.colors?.custom }
|
|
381
|
-
},
|
|
382
|
-
typography: {
|
|
383
|
-
...base.typography,
|
|
384
|
-
...override.typography,
|
|
385
|
-
families: { ...base.typography?.families, ...override.typography?.families },
|
|
386
|
-
sizes: { ...base.typography?.sizes, ...override.typography?.sizes },
|
|
387
|
-
weights: { ...base.typography?.weights, ...override.typography?.weights },
|
|
388
|
-
lineHeight: { ...base.typography?.lineHeight, ...override.typography?.lineHeight }
|
|
389
|
-
},
|
|
390
|
-
spacing: { ...base.spacing, ...override.spacing },
|
|
391
|
-
radius: { ...base.radius, ...override.radius },
|
|
392
|
-
shadows: { ...base.shadows, ...override.shadows },
|
|
393
|
-
components: {
|
|
394
|
-
...base.components,
|
|
395
|
-
...override.components,
|
|
396
|
-
button: { ...base.components?.button, ...override.components?.button },
|
|
397
|
-
card: { ...base.components?.card, ...override.components?.card },
|
|
398
|
-
input: { ...base.components?.input, ...override.components?.input }
|
|
399
|
-
},
|
|
400
|
-
cdn: {
|
|
401
|
-
...base.cdn,
|
|
402
|
-
...override.cdn,
|
|
403
|
-
fonts: {
|
|
404
|
-
// Concatenate then dedupe so base entries are preserved without duplicates
|
|
405
|
-
preconnect: filterStrings(
|
|
406
|
-
Array.from(/* @__PURE__ */ new Set([...base.cdn?.fonts?.preconnect ?? [], ...override.cdn?.fonts?.preconnect ?? []]))
|
|
407
|
-
),
|
|
408
|
-
stylesheets: filterStrings(
|
|
409
|
-
Array.from(/* @__PURE__ */ new Set([...base.cdn?.fonts?.stylesheets ?? [], ...override.cdn?.fonts?.stylesheets ?? []]))
|
|
410
|
-
)
|
|
411
|
-
},
|
|
412
|
-
icons: {
|
|
413
|
-
...base.cdn?.icons,
|
|
414
|
-
...override.cdn?.icons,
|
|
415
|
-
// Deep merge script to preserve integrity when only url is overridden
|
|
416
|
-
script: override.cdn?.icons?.script ? { ...base.cdn?.icons?.script, ...override.cdn?.icons?.script } : base.cdn?.icons?.script
|
|
417
|
-
},
|
|
418
|
-
scripts: {
|
|
419
|
-
// tailwind is a simple string, just use override or base
|
|
420
|
-
tailwind: override.cdn?.scripts?.tailwind ?? base.cdn?.scripts?.tailwind,
|
|
421
|
-
// Deep merge htmx/alpine to preserve integrity when only url is overridden
|
|
422
|
-
htmx: override.cdn?.scripts?.htmx ? { ...base.cdn?.scripts?.htmx, ...override.cdn?.scripts?.htmx } : base.cdn?.scripts?.htmx,
|
|
423
|
-
alpine: override.cdn?.scripts?.alpine ? { ...base.cdn?.scripts?.alpine, ...override.cdn?.scripts?.alpine } : base.cdn?.scripts?.alpine
|
|
424
|
-
}
|
|
425
|
-
},
|
|
426
|
-
customVars: { ...base.customVars, ...override.customVars },
|
|
427
|
-
customCss: [base.customCss, override.customCss].filter(Boolean).join("\n")
|
|
428
|
-
};
|
|
429
|
-
}
|
|
430
|
-
function mergeThemes(base, override) {
|
|
431
|
-
const merged = mergeThemesCore(base, override);
|
|
432
|
-
let darkVariant;
|
|
433
|
-
if (override.dark !== void 0) {
|
|
434
|
-
const darkBase = base.dark ?? base;
|
|
435
|
-
const { dark: _nestedDark, ...overrideDarkWithoutNested } = override.dark;
|
|
436
|
-
darkVariant = mergeThemesCore(darkBase, overrideDarkWithoutNested);
|
|
437
|
-
} else if (base.dark !== void 0) {
|
|
438
|
-
const { dark: _nestedDark, ...baseDarkWithoutNested } = base.dark;
|
|
439
|
-
darkVariant = baseDarkWithoutNested;
|
|
440
|
-
}
|
|
441
|
-
return {
|
|
442
|
-
...merged,
|
|
443
|
-
dark: darkVariant
|
|
444
|
-
};
|
|
445
|
-
}
|
|
446
|
-
function emitColorScale(lines, name, scale) {
|
|
447
|
-
for (const [shade, value] of Object.entries(scale)) {
|
|
448
|
-
if (value) lines.push(`--color-${name}-${shade}: ${value};`);
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
function buildThemeCss(theme) {
|
|
452
|
-
const lines = [];
|
|
453
|
-
const semantic = theme.colors.semantic;
|
|
454
|
-
if (typeof semantic.primary === "string") {
|
|
455
|
-
lines.push(`--color-primary: ${semantic.primary};`);
|
|
456
|
-
} else if (semantic.primary) {
|
|
457
|
-
emitColorScale(lines, "primary", semantic.primary);
|
|
458
|
-
}
|
|
459
|
-
if (semantic.secondary) {
|
|
460
|
-
if (typeof semantic.secondary === "string") {
|
|
461
|
-
lines.push(`--color-secondary: ${semantic.secondary};`);
|
|
462
|
-
} else {
|
|
463
|
-
emitColorScale(lines, "secondary", semantic.secondary);
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
if (semantic.accent) {
|
|
467
|
-
if (typeof semantic.accent === "string") {
|
|
468
|
-
lines.push(`--color-accent: ${semantic.accent};`);
|
|
469
|
-
} else {
|
|
470
|
-
emitColorScale(lines, "accent", semantic.accent);
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
if (semantic.neutral) {
|
|
474
|
-
if (typeof semantic.neutral === "string") {
|
|
475
|
-
lines.push(`--color-neutral: ${semantic.neutral};`);
|
|
476
|
-
} else {
|
|
477
|
-
emitColorScale(lines, "neutral", semantic.neutral);
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
if (semantic.success) lines.push(`--color-success: ${semantic.success};`);
|
|
481
|
-
if (semantic.warning) lines.push(`--color-warning: ${semantic.warning};`);
|
|
482
|
-
if (semantic.danger) lines.push(`--color-danger: ${semantic.danger};`);
|
|
483
|
-
if (semantic.info) lines.push(`--color-info: ${semantic.info};`);
|
|
484
|
-
const surface = theme.colors.surface;
|
|
485
|
-
if (surface?.background) lines.push(`--color-background: ${surface.background};`);
|
|
486
|
-
if (surface?.surface) lines.push(`--color-surface: ${surface.surface};`);
|
|
487
|
-
if (surface?.elevated) lines.push(`--color-elevated: ${surface.elevated};`);
|
|
488
|
-
if (surface?.overlay) lines.push(`--color-overlay: ${surface.overlay};`);
|
|
489
|
-
const text = theme.colors.text;
|
|
490
|
-
if (text?.primary) lines.push(`--color-text-primary: ${text.primary};`);
|
|
491
|
-
if (text?.secondary) lines.push(`--color-text-secondary: ${text.secondary};`);
|
|
492
|
-
if (text?.disabled) lines.push(`--color-text-disabled: ${text.disabled};`);
|
|
493
|
-
if (text?.inverse) lines.push(`--color-text-inverse: ${text.inverse};`);
|
|
494
|
-
if (text?.link) lines.push(`--color-text-link: ${text.link};`);
|
|
495
|
-
const border = theme.colors.border;
|
|
496
|
-
if (border?.default) lines.push(`--color-border: ${border.default};`);
|
|
497
|
-
if (border?.hover) lines.push(`--color-border-hover: ${border.hover};`);
|
|
498
|
-
if (border?.focus) lines.push(`--color-border-focus: ${border.focus};`);
|
|
499
|
-
if (border?.divider) lines.push(`--color-divider: ${border.divider};`);
|
|
500
|
-
if (theme.colors.custom) {
|
|
501
|
-
for (const [key, value] of Object.entries(theme.colors.custom)) {
|
|
502
|
-
lines.push(`--color-${key}: ${value};`);
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
const typography = theme.typography;
|
|
506
|
-
if (typography?.families?.sans) lines.push(`--font-sans: ${typography.families.sans};`);
|
|
507
|
-
if (typography?.families?.serif) lines.push(`--font-serif: ${typography.families.serif};`);
|
|
508
|
-
if (typography?.families?.mono) lines.push(`--font-mono: ${typography.families.mono};`);
|
|
509
|
-
if (typography?.families?.display) lines.push(`--font-display: ${typography.families.display};`);
|
|
510
|
-
const radius = theme.radius;
|
|
511
|
-
if (radius?.none) lines.push(`--radius-none: ${radius.none};`);
|
|
512
|
-
if (radius?.sm) lines.push(`--radius-sm: ${radius.sm};`);
|
|
513
|
-
if (radius?.md) lines.push(`--radius-md: ${radius.md};`);
|
|
514
|
-
if (radius?.lg) lines.push(`--radius-lg: ${radius.lg};`);
|
|
515
|
-
if (radius?.xl) lines.push(`--radius-xl: ${radius.xl};`);
|
|
516
|
-
if (radius?.["2xl"]) lines.push(`--radius-2xl: ${radius["2xl"]};`);
|
|
517
|
-
if (radius?.full) lines.push(`--radius-full: ${radius.full};`);
|
|
518
|
-
if (theme.customVars) {
|
|
519
|
-
for (const [key, value] of Object.entries(theme.customVars)) {
|
|
520
|
-
lines.push(`${key}: ${value};`);
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
return lines.join("\n ");
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
// libs/ui/src/utils/escape-html.ts
|
|
527
|
-
function escapeHtml(str) {
|
|
528
|
-
if (str === null || str === void 0) {
|
|
529
|
-
return "";
|
|
530
|
-
}
|
|
531
|
-
const s = String(str);
|
|
532
|
-
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
533
|
-
}
|
|
534
|
-
|
|
535
39
|
// libs/ui/src/layouts/base.ts
|
|
40
|
+
var import_theme = require("@frontmcp/uipack/theme");
|
|
41
|
+
var import_utils = require("@frontmcp/uipack/utils");
|
|
42
|
+
var import_utils2 = require("@frontmcp/uipack/utils");
|
|
536
43
|
function getSizeClass(size) {
|
|
537
44
|
const sizeMap = {
|
|
538
45
|
xs: "max-w-sm",
|
|
@@ -571,30 +78,30 @@ function getBackgroundClasses(background, theme) {
|
|
|
571
78
|
function buildMetaTags(options) {
|
|
572
79
|
const tags = [];
|
|
573
80
|
if (options.description) {
|
|
574
|
-
tags.push(`<meta name="description" content="${escapeHtml(options.description)}">`);
|
|
81
|
+
tags.push(`<meta name="description" content="${(0, import_utils.escapeHtml)(options.description)}">`);
|
|
575
82
|
}
|
|
576
83
|
if (options.og) {
|
|
577
84
|
if (options.og.title) {
|
|
578
|
-
tags.push(`<meta property="og:title" content="${escapeHtml(options.og.title)}">`);
|
|
85
|
+
tags.push(`<meta property="og:title" content="${(0, import_utils.escapeHtml)(options.og.title)}">`);
|
|
579
86
|
}
|
|
580
87
|
if (options.og.description) {
|
|
581
|
-
tags.push(`<meta property="og:description" content="${escapeHtml(options.og.description)}">`);
|
|
88
|
+
tags.push(`<meta property="og:description" content="${(0, import_utils.escapeHtml)(options.og.description)}">`);
|
|
582
89
|
}
|
|
583
90
|
if (options.og.image) {
|
|
584
|
-
tags.push(`<meta property="og:image" content="${escapeHtml(options.og.image)}">`);
|
|
91
|
+
tags.push(`<meta property="og:image" content="${(0, import_utils.escapeHtml)(options.og.image)}">`);
|
|
585
92
|
}
|
|
586
93
|
if (options.og.type) {
|
|
587
|
-
tags.push(`<meta property="og:type" content="${escapeHtml(options.og.type)}">`);
|
|
94
|
+
tags.push(`<meta property="og:type" content="${(0, import_utils.escapeHtml)(options.og.type)}">`);
|
|
588
95
|
}
|
|
589
96
|
}
|
|
590
97
|
if (options.favicon) {
|
|
591
|
-
tags.push(`<link rel="icon" href="${escapeHtml(options.favicon)}">`);
|
|
98
|
+
tags.push(`<link rel="icon" href="${(0, import_utils.escapeHtml)(options.favicon)}">`);
|
|
592
99
|
}
|
|
593
100
|
return tags.join("\n ");
|
|
594
101
|
}
|
|
595
102
|
function buildBodyAttrs(attrs) {
|
|
596
103
|
if (!attrs) return "";
|
|
597
|
-
return Object.entries(attrs).map(([key, value]) => `${key}="${escapeHtml(value)}"`).join(" ");
|
|
104
|
+
return Object.entries(attrs).map(([key, value]) => `${key}="${(0, import_utils.escapeHtml)(value)}"`).join(" ");
|
|
598
105
|
}
|
|
599
106
|
function baseLayout(content, options) {
|
|
600
107
|
const {
|
|
@@ -603,7 +110,7 @@ function baseLayout(content, options) {
|
|
|
603
110
|
size = "md",
|
|
604
111
|
alignment = "center",
|
|
605
112
|
background = "solid",
|
|
606
|
-
platform = OPENAI_PLATFORM,
|
|
113
|
+
platform = import_theme.OPENAI_PLATFORM,
|
|
607
114
|
theme: themeOverrides,
|
|
608
115
|
includeHtmx,
|
|
609
116
|
includeAlpine = false,
|
|
@@ -613,20 +120,20 @@ function baseLayout(content, options) {
|
|
|
613
120
|
bodyClass = "",
|
|
614
121
|
titleSuffix = "FrontMCP"
|
|
615
122
|
} = options;
|
|
616
|
-
const theme = themeOverrides ? mergeThemes(DEFAULT_THEME, themeOverrides) : DEFAULT_THEME;
|
|
123
|
+
const theme = themeOverrides ? (0, import_theme.mergeThemes)(import_theme.DEFAULT_THEME, themeOverrides) : import_theme.DEFAULT_THEME;
|
|
617
124
|
const shouldIncludeHtmx = includeHtmx ?? platform.supportsHtmx;
|
|
618
|
-
const useCdn = canUseCdn(platform);
|
|
619
|
-
const useInline = needsInlineScripts(platform);
|
|
620
|
-
const fontPreconnect = useCdn ? buildFontPreconnect() : "";
|
|
621
|
-
const fontStylesheets = useCdn ? buildFontStylesheets({ inter: true }) : "";
|
|
622
|
-
const scripts = buildCdnScripts({
|
|
125
|
+
const useCdn = (0, import_theme.canUseCdn)(platform);
|
|
126
|
+
const useInline = (0, import_theme.needsInlineScripts)(platform);
|
|
127
|
+
const fontPreconnect = useCdn ? (0, import_theme.buildFontPreconnect)() : "";
|
|
128
|
+
const fontStylesheets = useCdn ? (0, import_theme.buildFontStylesheets)({ inter: true }) : "";
|
|
129
|
+
const scripts = (0, import_theme.buildCdnScripts)({
|
|
623
130
|
tailwind: platform.supportsTailwind,
|
|
624
131
|
htmx: shouldIncludeHtmx,
|
|
625
132
|
alpine: includeAlpine,
|
|
626
133
|
icons: includeIcons,
|
|
627
134
|
inline: useInline
|
|
628
135
|
});
|
|
629
|
-
const themeCss = buildThemeCss(theme);
|
|
136
|
+
const themeCss = (0, import_theme.buildThemeCss)(theme);
|
|
630
137
|
const customCss = theme.customCss || "";
|
|
631
138
|
const styleBlock = platform.supportsTailwind ? `<style type="text/tailwindcss">
|
|
632
139
|
@theme {
|
|
@@ -654,7 +161,7 @@ function baseLayout(content, options) {
|
|
|
654
161
|
<head>
|
|
655
162
|
<meta charset="UTF-8">
|
|
656
163
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
657
|
-
<title>${escapeHtml(title)}${titleSuffix ? ` - ${escapeHtml(titleSuffix)}` : ""}</title>
|
|
164
|
+
<title>${(0, import_utils.escapeHtml)(title)}${titleSuffix ? ` - ${(0, import_utils.escapeHtml)(titleSuffix)}` : ""}</title>
|
|
658
165
|
${metaTags}
|
|
659
166
|
|
|
660
167
|
<!-- Fonts -->
|
|
@@ -667,19 +174,19 @@ function baseLayout(content, options) {
|
|
|
667
174
|
|
|
668
175
|
${headExtra}
|
|
669
176
|
</head>
|
|
670
|
-
<body class="${escapeHtml(allBodyClasses)}"${bodyAttrStr ? ` ${bodyAttrStr}` : ""}>
|
|
177
|
+
<body class="${(0, import_utils.escapeHtml)(allBodyClasses)}"${bodyAttrStr ? ` ${bodyAttrStr}` : ""}>
|
|
671
178
|
${wrappedContent}
|
|
672
179
|
</body>
|
|
673
180
|
</html>`;
|
|
674
181
|
}
|
|
675
182
|
function createLayoutBuilder(defaults) {
|
|
676
183
|
return (content, options = {}) => {
|
|
677
|
-
let mergedTheme = DEFAULT_THEME;
|
|
184
|
+
let mergedTheme = import_theme.DEFAULT_THEME;
|
|
678
185
|
if (defaults.theme) {
|
|
679
|
-
mergedTheme = mergeThemes(mergedTheme, defaults.theme);
|
|
186
|
+
mergedTheme = (0, import_theme.mergeThemes)(mergedTheme, defaults.theme);
|
|
680
187
|
}
|
|
681
188
|
if (options.theme) {
|
|
682
|
-
mergedTheme = mergeThemes(mergedTheme, options.theme);
|
|
189
|
+
mergedTheme = (0, import_theme.mergeThemes)(mergedTheme, options.theme);
|
|
683
190
|
}
|
|
684
191
|
const merged = {
|
|
685
192
|
...defaults,
|
|
@@ -697,20 +204,20 @@ function createLayoutBuilder(defaults) {
|
|
|
697
204
|
function consentLayout(content, options) {
|
|
698
205
|
const { clientName, clientIcon, userInfo, ...baseOptions } = options;
|
|
699
206
|
const headerHtml = clientName ? `<div class="text-center mb-6">
|
|
700
|
-
${clientIcon ? `<img src="${escapeHtml(clientIcon)}" alt="${escapeHtml(
|
|
207
|
+
${clientIcon ? `<img src="${(0, import_utils2.escapeHtml)(clientIcon)}" alt="${(0, import_utils2.escapeHtml)(
|
|
701
208
|
clientName
|
|
702
209
|
)}" class="w-16 h-16 rounded-xl mx-auto mb-4">` : `<div class="inline-flex items-center justify-center w-16 h-16 rounded-xl bg-gradient-to-br from-primary to-secondary text-white font-bold text-2xl mx-auto mb-4">
|
|
703
|
-
${escapeHtml(clientName.charAt(0).toUpperCase())}
|
|
210
|
+
${(0, import_utils2.escapeHtml)(clientName.charAt(0).toUpperCase())}
|
|
704
211
|
</div>`}
|
|
705
|
-
<h1 class="text-2xl font-bold text-text-primary">${escapeHtml(clientName)}</h1>
|
|
212
|
+
<h1 class="text-2xl font-bold text-text-primary">${(0, import_utils2.escapeHtml)(clientName)}</h1>
|
|
706
213
|
</div>` : "";
|
|
707
214
|
const userInfoHtml = userInfo ? `<div class="flex items-center gap-3 p-3 bg-gray-50 rounded-lg mb-6">
|
|
708
|
-
${userInfo.avatar ? `<img src="${escapeHtml(userInfo.avatar)}" class="w-10 h-10 rounded-full">` : `<div class="w-10 h-10 rounded-full bg-primary text-white flex items-center justify-center font-medium">
|
|
709
|
-
${escapeHtml((userInfo.name || userInfo.email || "U").charAt(0).toUpperCase())}
|
|
215
|
+
${userInfo.avatar ? `<img src="${(0, import_utils2.escapeHtml)(userInfo.avatar)}" class="w-10 h-10 rounded-full">` : `<div class="w-10 h-10 rounded-full bg-primary text-white flex items-center justify-center font-medium">
|
|
216
|
+
${(0, import_utils2.escapeHtml)((userInfo.name || userInfo.email || "U").charAt(0).toUpperCase())}
|
|
710
217
|
</div>`}
|
|
711
218
|
<div>
|
|
712
|
-
${userInfo.name ? `<div class="font-medium text-text-primary">${escapeHtml(userInfo.name)}</div>` : ""}
|
|
713
|
-
${userInfo.email ? `<div class="text-sm text-text-secondary">${escapeHtml(userInfo.email)}</div>` : ""}
|
|
219
|
+
${userInfo.name ? `<div class="font-medium text-text-primary">${(0, import_utils2.escapeHtml)(userInfo.name)}</div>` : ""}
|
|
220
|
+
${userInfo.email ? `<div class="text-sm text-text-secondary">${(0, import_utils2.escapeHtml)(userInfo.email)}</div>` : ""}
|
|
714
221
|
</div>
|
|
715
222
|
</div>` : "";
|
|
716
223
|
const wrappedContent = `
|
|
@@ -746,15 +253,15 @@ function errorLayout(content, options) {
|
|
|
746
253
|
</svg>
|
|
747
254
|
</div>
|
|
748
255
|
|
|
749
|
-
${errorCode ? `<p class="text-6xl font-bold text-danger mb-2">${escapeHtml(errorCode)}</p>` : ""}
|
|
750
|
-
<h1 class="text-2xl font-bold text-text-primary mb-4">${escapeHtml(errorTitle)}</h1>
|
|
751
|
-
${errorMessage ? `<p class="text-text-secondary mb-8">${escapeHtml(errorMessage)}</p>` : ""}
|
|
256
|
+
${errorCode ? `<p class="text-6xl font-bold text-danger mb-2">${(0, import_utils2.escapeHtml)(errorCode)}</p>` : ""}
|
|
257
|
+
<h1 class="text-2xl font-bold text-text-primary mb-4">${(0, import_utils2.escapeHtml)(errorTitle)}</h1>
|
|
258
|
+
${errorMessage ? `<p class="text-text-secondary mb-8">${(0, import_utils2.escapeHtml)(errorMessage)}</p>` : ""}
|
|
752
259
|
|
|
753
260
|
${content}
|
|
754
261
|
|
|
755
262
|
<div class="flex gap-4 justify-center mt-8">
|
|
756
|
-
${showRetry ? `<button onclick="${retryUrl ? `window.location.href='${escapeHtml(retryUrl)}'` : "window.location.reload()"}" class="px-6 py-3 bg-primary hover:bg-primary/90 text-white font-medium rounded-lg transition-colors">Try Again</button>` : ""}
|
|
757
|
-
${showHome ? `<a href="${escapeHtml(
|
|
263
|
+
${showRetry ? `<button onclick="${retryUrl ? `window.location.href='${(0, import_utils2.escapeHtml)(retryUrl)}'` : "window.location.reload()"}" class="px-6 py-3 bg-primary hover:bg-primary/90 text-white font-medium rounded-lg transition-colors">Try Again</button>` : ""}
|
|
264
|
+
${showHome ? `<a href="${(0, import_utils2.escapeHtml)(
|
|
758
265
|
homeUrl
|
|
759
266
|
)}" class="px-6 py-3 bg-gray-100 hover:bg-gray-200 text-text-primary font-medium rounded-lg transition-colors">Go Home</a>` : ""}
|
|
760
267
|
</div>
|
|
@@ -788,102 +295,58 @@ var errorLayoutBuilder = createLayoutBuilder({
|
|
|
788
295
|
background: "solid"
|
|
789
296
|
});
|
|
790
297
|
|
|
791
|
-
// libs/ui/src/
|
|
792
|
-
var
|
|
793
|
-
<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"/>
|
|
794
|
-
</svg>`;
|
|
795
|
-
function validationErrorBox(options) {
|
|
796
|
-
const { componentName, invalidParam } = options;
|
|
797
|
-
return `<div
|
|
798
|
-
class="validation-error flex items-start gap-3 p-4 bg-red-50 border border-red-200 text-red-800 rounded-lg"
|
|
799
|
-
role="alert"
|
|
800
|
-
data-testid="validation-error"
|
|
801
|
-
data-component="${escapeHtml(componentName)}"
|
|
802
|
-
data-param="${escapeHtml(invalidParam)}"
|
|
803
|
-
>
|
|
804
|
-
${errorIcon}
|
|
805
|
-
<div class="min-w-0">
|
|
806
|
-
<p class="font-semibold text-sm">${escapeHtml(componentName)}: Invalid Configuration</p>
|
|
807
|
-
<p class="text-sm opacity-90 mt-0.5">The "${escapeHtml(invalidParam)}" parameter is invalid.</p>
|
|
808
|
-
</div>
|
|
809
|
-
</div>`;
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
// libs/ui/src/validation/wrapper.ts
|
|
813
|
-
function getFirstInvalidPath(error) {
|
|
814
|
-
const firstError = error.issues[0];
|
|
815
|
-
if (!firstError || firstError.path.length === 0) {
|
|
816
|
-
return "options";
|
|
817
|
-
}
|
|
818
|
-
return firstError.path.map(String).join(".");
|
|
819
|
-
}
|
|
820
|
-
function validateOptions(options, config) {
|
|
821
|
-
const result = config.schema.safeParse(options);
|
|
822
|
-
if (result.success) {
|
|
823
|
-
return { success: true, data: result.data };
|
|
824
|
-
}
|
|
825
|
-
const invalidParam = getFirstInvalidPath(result.error);
|
|
826
|
-
return {
|
|
827
|
-
success: false,
|
|
828
|
-
error: validationErrorBox({
|
|
829
|
-
componentName: config.componentName,
|
|
830
|
-
invalidParam
|
|
831
|
-
})
|
|
832
|
-
};
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
// libs/ui/src/validation/schema-paths.ts
|
|
836
|
-
var import_zod = require("zod");
|
|
298
|
+
// libs/ui/src/components/button.ts
|
|
299
|
+
var import_validation = require("@frontmcp/uipack/validation");
|
|
837
300
|
|
|
838
301
|
// libs/ui/src/components/button.schema.ts
|
|
839
|
-
var
|
|
840
|
-
var ButtonVariantSchema =
|
|
841
|
-
var ButtonSizeSchema =
|
|
842
|
-
var ButtonOptionsSchema =
|
|
302
|
+
var import_zod = require("zod");
|
|
303
|
+
var ButtonVariantSchema = import_zod.z.enum(["primary", "secondary", "outline", "ghost", "danger", "success", "link"]);
|
|
304
|
+
var ButtonSizeSchema = import_zod.z.enum(["xs", "sm", "md", "lg", "xl"]);
|
|
305
|
+
var ButtonOptionsSchema = import_zod.z.object({
|
|
843
306
|
/** Button variant */
|
|
844
307
|
variant: ButtonVariantSchema.optional(),
|
|
845
308
|
/** Button size */
|
|
846
309
|
size: ButtonSizeSchema.optional(),
|
|
847
310
|
/** Button type attribute */
|
|
848
|
-
type:
|
|
311
|
+
type: import_zod.z.enum(["button", "submit", "reset"]).optional(),
|
|
849
312
|
/** Disabled state */
|
|
850
|
-
disabled:
|
|
313
|
+
disabled: import_zod.z.boolean().optional(),
|
|
851
314
|
/** Loading state */
|
|
852
|
-
loading:
|
|
315
|
+
loading: import_zod.z.boolean().optional(),
|
|
853
316
|
/** Full width */
|
|
854
|
-
fullWidth:
|
|
317
|
+
fullWidth: import_zod.z.boolean().optional(),
|
|
855
318
|
/** Icon before text (HTML string) */
|
|
856
|
-
iconBefore:
|
|
319
|
+
iconBefore: import_zod.z.string().optional(),
|
|
857
320
|
/** Icon after text (HTML string) */
|
|
858
|
-
iconAfter:
|
|
321
|
+
iconAfter: import_zod.z.string().optional(),
|
|
859
322
|
/** Icon only (no text) */
|
|
860
|
-
iconOnly:
|
|
323
|
+
iconOnly: import_zod.z.boolean().optional(),
|
|
861
324
|
/** Additional CSS classes */
|
|
862
|
-
className:
|
|
325
|
+
className: import_zod.z.string().optional(),
|
|
863
326
|
/** Button ID */
|
|
864
|
-
id:
|
|
327
|
+
id: import_zod.z.string().optional(),
|
|
865
328
|
/** Name attribute */
|
|
866
|
-
name:
|
|
329
|
+
name: import_zod.z.string().optional(),
|
|
867
330
|
/** Value attribute */
|
|
868
|
-
value:
|
|
331
|
+
value: import_zod.z.string().optional(),
|
|
869
332
|
/** Click handler (URL for links) */
|
|
870
|
-
href:
|
|
333
|
+
href: import_zod.z.string().optional(),
|
|
871
334
|
/** Open in new tab */
|
|
872
|
-
target:
|
|
335
|
+
target: import_zod.z.enum(["_blank", "_self"]).optional(),
|
|
873
336
|
/** Data attributes */
|
|
874
|
-
data:
|
|
337
|
+
data: import_zod.z.record(import_zod.z.string(), import_zod.z.string()).optional(),
|
|
875
338
|
/** ARIA label */
|
|
876
|
-
ariaLabel:
|
|
339
|
+
ariaLabel: import_zod.z.string().optional()
|
|
877
340
|
}).strict();
|
|
878
|
-
var ButtonGroupOptionsSchema =
|
|
341
|
+
var ButtonGroupOptionsSchema = import_zod.z.object({
|
|
879
342
|
/** Attach buttons visually */
|
|
880
|
-
attached:
|
|
343
|
+
attached: import_zod.z.boolean().optional(),
|
|
881
344
|
/** Direction */
|
|
882
|
-
direction:
|
|
345
|
+
direction: import_zod.z.enum(["horizontal", "vertical"]).optional(),
|
|
883
346
|
/** Gap between buttons */
|
|
884
|
-
gap:
|
|
347
|
+
gap: import_zod.z.enum(["sm", "md", "lg"]).optional(),
|
|
885
348
|
/** Additional CSS classes */
|
|
886
|
-
className:
|
|
349
|
+
className: import_zod.z.string().optional()
|
|
887
350
|
}).strict();
|
|
888
351
|
|
|
889
352
|
// libs/ui/src/components/button.ts
|
|
@@ -936,7 +399,7 @@ function isValidHrefProtocol(href) {
|
|
|
936
399
|
return trimmed.startsWith("http://") || trimmed.startsWith("https://") || trimmed.startsWith("/") || trimmed.startsWith("#") || trimmed.startsWith("mailto:") || trimmed.startsWith("tel:");
|
|
937
400
|
}
|
|
938
401
|
function button(text, options = {}) {
|
|
939
|
-
const validation = validateOptions(options, {
|
|
402
|
+
const validation = (0, import_validation.validateOptions)(options, {
|
|
940
403
|
schema: ButtonOptionsSchema,
|
|
941
404
|
componentName: "button"
|
|
942
405
|
});
|
|
@@ -976,7 +439,7 @@ function button(text, options = {}) {
|
|
|
976
439
|
}
|
|
977
440
|
const variantClasses = getVariantClasses(variant);
|
|
978
441
|
const sizeClasses = getSizeClasses(size, iconOnly);
|
|
979
|
-
const safeClassName = className ? escapeHtml(className) : "";
|
|
442
|
+
const safeClassName = className ? (0, import_utils2.escapeHtml)(className) : "";
|
|
980
443
|
const baseClasses = [
|
|
981
444
|
"inline-flex items-center justify-center",
|
|
982
445
|
"font-medium",
|
|
@@ -991,24 +454,24 @@ function button(text, options = {}) {
|
|
|
991
454
|
].filter(Boolean).join(" ");
|
|
992
455
|
const dataAttrs = data ? Object.entries(data).map(([key, val]) => {
|
|
993
456
|
const safeKey = sanitizeDataKey(key);
|
|
994
|
-
return safeKey ? `data-${safeKey}="${escapeHtml(val)}"` : "";
|
|
457
|
+
return safeKey ? `data-${safeKey}="${(0, import_utils2.escapeHtml)(val)}"` : "";
|
|
995
458
|
}).filter(Boolean).join(" ") : "";
|
|
996
|
-
const idAttr = id ? `id="${escapeHtml(id)}"` : "";
|
|
997
|
-
const nameAttr = name ? `name="${escapeHtml(name)}"` : "";
|
|
998
|
-
const valueAttr = value ? `value="${escapeHtml(value)}"` : "";
|
|
459
|
+
const idAttr = id ? `id="${(0, import_utils2.escapeHtml)(id)}"` : "";
|
|
460
|
+
const nameAttr = name ? `name="${(0, import_utils2.escapeHtml)(name)}"` : "";
|
|
461
|
+
const valueAttr = value ? `value="${(0, import_utils2.escapeHtml)(value)}"` : "";
|
|
999
462
|
const disabledAttr = disabled || loading ? "disabled" : "";
|
|
1000
|
-
const targetAttr = target ? `target="${escapeHtml(target)}"` : "";
|
|
463
|
+
const targetAttr = target ? `target="${(0, import_utils2.escapeHtml)(target)}"` : "";
|
|
1001
464
|
const relAttr = target === "_blank" ? 'rel="noopener noreferrer"' : "";
|
|
1002
465
|
const trimmedText = text.trim();
|
|
1003
466
|
const effectiveAriaLabel = ariaLabel ?? (iconOnly && trimmedText ? trimmedText : void 0);
|
|
1004
|
-
const ariaLabelAttr = effectiveAriaLabel ? `aria-label="${escapeHtml(effectiveAriaLabel)}"` : "";
|
|
467
|
+
const ariaLabelAttr = effectiveAriaLabel ? `aria-label="${(0, import_utils2.escapeHtml)(effectiveAriaLabel)}"` : "";
|
|
1005
468
|
const iconBeforeHtml = iconBefore && !loading ? `<span class="${iconOnly ? "" : "mr-2"}">${iconBefore}</span>` : "";
|
|
1006
469
|
const iconAfterHtml = iconAfter && !loading ? `<span class="${iconOnly ? "" : "ml-2"}">${iconAfter}</span>` : "";
|
|
1007
470
|
const loadingHtml = loading ? loadingSpinner : "";
|
|
1008
|
-
const textHtml = iconOnly ? "" : escapeHtml(text);
|
|
471
|
+
const textHtml = iconOnly ? "" : (0, import_utils2.escapeHtml)(text);
|
|
1009
472
|
const contentHtml = `${loadingHtml}${iconBeforeHtml}${textHtml}${iconAfterHtml}`;
|
|
1010
473
|
if (href && !disabled && !loading && isValidHrefProtocol(href)) {
|
|
1011
|
-
return `<a href="${escapeHtml(
|
|
474
|
+
return `<a href="${(0, import_utils2.escapeHtml)(
|
|
1012
475
|
href
|
|
1013
476
|
)}" class="${baseClasses}" ${idAttr} ${dataAttrs} ${ariaLabelAttr} ${targetAttr} ${relAttr}>
|
|
1014
477
|
${contentHtml}
|
|
@@ -1061,19 +524,19 @@ function getPermissionIcon(scope, customIcon) {
|
|
|
1061
524
|
}
|
|
1062
525
|
function permissionList(permissions, options = {}) {
|
|
1063
526
|
const { id, checkable = false, inputName = "scopes", title, className = "" } = options;
|
|
1064
|
-
const titleHtml = title ? `<h4 class="font-medium text-text-primary mb-3">${escapeHtml(title)}</h4>` : "";
|
|
527
|
+
const titleHtml = title ? `<h4 class="font-medium text-text-primary mb-3">${(0, import_utils2.escapeHtml)(title)}</h4>` : "";
|
|
1065
528
|
const itemsHtml = permissions.map((perm, index) => {
|
|
1066
529
|
const icon = getPermissionIcon(perm.scope, perm.icon);
|
|
1067
530
|
const sensitiveClasses = perm.sensitive ? "border-warning/30 bg-warning/5" : "border-border";
|
|
1068
531
|
const sensitiveLabel = perm.sensitive ? '<span class="text-xs text-warning font-medium ml-2">Sensitive</span>' : "";
|
|
1069
532
|
const checkboxHtml = checkable ? `<input
|
|
1070
533
|
type="checkbox"
|
|
1071
|
-
name="${escapeHtml(inputName)}[]"
|
|
1072
|
-
value="${escapeHtml(perm.scope)}"
|
|
534
|
+
name="${(0, import_utils2.escapeHtml)(inputName)}[]"
|
|
535
|
+
value="${(0, import_utils2.escapeHtml)(perm.scope)}"
|
|
1073
536
|
class="w-4 h-4 rounded border-border text-primary focus:ring-primary/20"
|
|
1074
537
|
${perm.checked || perm.required ? "checked" : ""}
|
|
1075
538
|
${perm.required ? "disabled" : ""}
|
|
1076
|
-
id="${id ? escapeHtml(id) : "perm"}-${index}"
|
|
539
|
+
id="${id ? (0, import_utils2.escapeHtml)(id) : "perm"}-${index}"
|
|
1077
540
|
>` : `<div class="w-5 h-5 rounded-full bg-success/10 text-success flex items-center justify-center">
|
|
1078
541
|
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
1079
542
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M5 13l4 4L19 7"/>
|
|
@@ -1085,18 +548,18 @@ function permissionList(permissions, options = {}) {
|
|
|
1085
548
|
</div>
|
|
1086
549
|
<div class="flex-1 min-w-0">
|
|
1087
550
|
<div class="flex items-center">
|
|
1088
|
-
<span class="font-medium text-text-primary">${escapeHtml(perm.name)}</span>
|
|
551
|
+
<span class="font-medium text-text-primary">${(0, import_utils2.escapeHtml)(perm.name)}</span>
|
|
1089
552
|
${perm.required ? '<span class="text-xs text-text-secondary ml-2">(Required)</span>' : ""}
|
|
1090
553
|
${sensitiveLabel}
|
|
1091
554
|
</div>
|
|
1092
|
-
${perm.description ? `<p class="text-sm text-text-secondary mt-0.5">${escapeHtml(perm.description)}</p>` : ""}
|
|
555
|
+
${perm.description ? `<p class="text-sm text-text-secondary mt-0.5">${(0, import_utils2.escapeHtml)(perm.description)}</p>` : ""}
|
|
1093
556
|
</div>
|
|
1094
557
|
<div class="flex-shrink-0">
|
|
1095
558
|
${checkboxHtml}
|
|
1096
559
|
</div>
|
|
1097
560
|
</div>`;
|
|
1098
561
|
}).join("\n");
|
|
1099
|
-
const idAttr = id ? `id="${escapeHtml(id)}"` : "";
|
|
562
|
+
const idAttr = id ? `id="${(0, import_utils2.escapeHtml)(id)}"` : "";
|
|
1100
563
|
return `<div class="permission-list ${className}" ${idAttr}>
|
|
1101
564
|
${titleHtml}
|
|
1102
565
|
<div class="space-y-2">
|
|
@@ -1107,7 +570,7 @@ function permissionList(permissions, options = {}) {
|
|
|
1107
570
|
|
|
1108
571
|
// libs/ui/src/components/form.ts
|
|
1109
572
|
function hiddenInput(name, value) {
|
|
1110
|
-
return `<input type="hidden" name="${escapeHtml(name)}" value="${escapeHtml(value)}">`;
|
|
573
|
+
return `<input type="hidden" name="${(0, import_utils2.escapeHtml)(name)}" value="${(0, import_utils2.escapeHtml)(value)}">`;
|
|
1111
574
|
}
|
|
1112
575
|
function csrfInput(token) {
|
|
1113
576
|
return hiddenInput("_csrf", token);
|
|
@@ -1163,7 +626,7 @@ function alert(message, options = {}) {
|
|
|
1163
626
|
const iconHtml = showIcon ? `<div class="flex-shrink-0 ${variantClasses.icon}">
|
|
1164
627
|
${icon || alertIcons[variant]}
|
|
1165
628
|
</div>` : "";
|
|
1166
|
-
const titleHtml = title ? `<h3 class="font-semibold">${escapeHtml(title)}</h3>` : "";
|
|
629
|
+
const titleHtml = title ? `<h3 class="font-semibold">${(0, import_utils2.escapeHtml)(title)}</h3>` : "";
|
|
1167
630
|
const dismissHtml = dismissible ? `<button
|
|
1168
631
|
type="button"
|
|
1169
632
|
class="flex-shrink-0 ml-auto -mr-1 -mt-1 p-1 rounded hover:bg-black/5 transition-colors"
|
|
@@ -1175,13 +638,13 @@ function alert(message, options = {}) {
|
|
|
1175
638
|
</svg>
|
|
1176
639
|
</button>` : "";
|
|
1177
640
|
const actionsHtml = actions ? `<div class="mt-3">${actions}</div>` : "";
|
|
1178
|
-
const idAttr = id ? `id="${escapeHtml(id)}"` : "";
|
|
641
|
+
const idAttr = id ? `id="${(0, import_utils2.escapeHtml)(id)}"` : "";
|
|
1179
642
|
return `<div class="alert ${baseClasses}" role="alert" ${idAttr}>
|
|
1180
643
|
<div class="flex gap-3">
|
|
1181
644
|
${iconHtml}
|
|
1182
645
|
<div class="flex-1">
|
|
1183
646
|
${titleHtml}
|
|
1184
|
-
<div class="${title ? "mt-1" : ""}">${escapeHtml(message)}</div>
|
|
647
|
+
<div class="${title ? "mt-1" : ""}">${(0, import_utils2.escapeHtml)(message)}</div>
|
|
1185
648
|
${actionsHtml}
|
|
1186
649
|
</div>
|
|
1187
650
|
${dismissHtml}
|
|
@@ -1218,30 +681,30 @@ function consentPage(options) {
|
|
|
1218
681
|
}) : "";
|
|
1219
682
|
const clientHeader = `
|
|
1220
683
|
<div class="text-center mb-6">
|
|
1221
|
-
${client.icon ? `<img src="${escapeHtml(client.icon)}" alt="${escapeHtml(
|
|
684
|
+
${client.icon ? `<img src="${(0, import_utils2.escapeHtml)(client.icon)}" alt="${(0, import_utils2.escapeHtml)(
|
|
1222
685
|
client.name
|
|
1223
686
|
)}" class="w-16 h-16 rounded-xl mx-auto mb-4 shadow-md">` : `<div class="inline-flex items-center justify-center w-16 h-16 rounded-xl bg-gradient-to-br from-primary to-secondary text-white font-bold text-2xl mx-auto mb-4 shadow-md">
|
|
1224
|
-
${escapeHtml(client.name.charAt(0).toUpperCase())}
|
|
687
|
+
${(0, import_utils2.escapeHtml)(client.name.charAt(0).toUpperCase())}
|
|
1225
688
|
</div>`}
|
|
1226
689
|
<h1 class="text-xl font-bold text-text-primary">
|
|
1227
690
|
${client.verified ? `<span class="inline-flex items-center gap-1">
|
|
1228
|
-
${escapeHtml(client.name)}
|
|
691
|
+
${(0, import_utils2.escapeHtml)(client.name)}
|
|
1229
692
|
<svg class="w-5 h-5 text-primary" fill="currentColor" viewBox="0 0 20 20">
|
|
1230
693
|
<path fill-rule="evenodd" d="M6.267 3.455a3.066 3.066 0 001.745-.723 3.066 3.066 0 013.976 0 3.066 3.066 0 001.745.723 3.066 3.066 0 012.812 2.812c.051.643.304 1.254.723 1.745a3.066 3.066 0 010 3.976 3.066 3.066 0 00-.723 1.745 3.066 3.066 0 01-2.812 2.812 3.066 3.066 0 00-1.745.723 3.066 3.066 0 01-3.976 0 3.066 3.066 0 00-1.745-.723 3.066 3.066 0 01-2.812-2.812 3.066 3.066 0 00-.723-1.745 3.066 3.066 0 010-3.976 3.066 3.066 0 00.723-1.745 3.066 3.066 0 012.812-2.812zm7.44 5.252a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/>
|
|
1231
694
|
</svg>
|
|
1232
|
-
</span>` : escapeHtml(client.name)}
|
|
695
|
+
</span>` : (0, import_utils2.escapeHtml)(client.name)}
|
|
1233
696
|
</h1>
|
|
1234
697
|
<p class="text-text-secondary mt-1">wants to access your account</p>
|
|
1235
698
|
</div>
|
|
1236
699
|
`;
|
|
1237
700
|
const userSection = user ? `
|
|
1238
701
|
<div class="flex items-center gap-3 p-4 bg-gray-50 rounded-lg mb-6">
|
|
1239
|
-
${user.avatar ? `<img src="${escapeHtml(user.avatar)}" class="w-12 h-12 rounded-full">` : `<div class="w-12 h-12 rounded-full bg-primary text-white flex items-center justify-center font-semibold text-lg">
|
|
1240
|
-
${escapeHtml((user.name || user.email || "U").charAt(0).toUpperCase())}
|
|
702
|
+
${user.avatar ? `<img src="${(0, import_utils2.escapeHtml)(user.avatar)}" class="w-12 h-12 rounded-full">` : `<div class="w-12 h-12 rounded-full bg-primary text-white flex items-center justify-center font-semibold text-lg">
|
|
703
|
+
${(0, import_utils2.escapeHtml)((user.name || user.email || "U").charAt(0).toUpperCase())}
|
|
1241
704
|
</div>`}
|
|
1242
705
|
<div class="flex-1 min-w-0">
|
|
1243
|
-
${user.name ? `<div class="font-medium text-text-primary truncate">${escapeHtml(user.name)}</div>` : ""}
|
|
1244
|
-
${user.email ? `<div class="text-sm text-text-secondary truncate">${escapeHtml(user.email)}</div>` : ""}
|
|
706
|
+
${user.name ? `<div class="font-medium text-text-primary truncate">${(0, import_utils2.escapeHtml)(user.name)}</div>` : ""}
|
|
707
|
+
${user.email ? `<div class="text-sm text-text-secondary truncate">${(0, import_utils2.escapeHtml)(user.email)}</div>` : ""}
|
|
1245
708
|
</div>
|
|
1246
709
|
<a href="/login?prompt=select_account" class="text-sm text-primary hover:text-primary/80">
|
|
1247
710
|
Switch account
|
|
@@ -1250,7 +713,7 @@ function consentPage(options) {
|
|
|
1250
713
|
` : "";
|
|
1251
714
|
const permissionsSection = `
|
|
1252
715
|
<div class="mb-6">
|
|
1253
|
-
<h3 class="font-medium text-text-primary mb-3">This will allow ${escapeHtml(client.name)} to:</h3>
|
|
716
|
+
<h3 class="font-medium text-text-primary mb-3">This will allow ${(0, import_utils2.escapeHtml)(client.name)} to:</h3>
|
|
1254
717
|
${permissionList(permissions, {
|
|
1255
718
|
checkable: allowScopeSelection,
|
|
1256
719
|
inputName: "scope"
|
|
@@ -1271,12 +734,12 @@ function consentPage(options) {
|
|
|
1271
734
|
].filter(Boolean).join("\n");
|
|
1272
735
|
const actionsHtml = `
|
|
1273
736
|
<div class="flex gap-3 pt-4">
|
|
1274
|
-
<form action="${escapeHtml(denyUrl || approveUrl)}" method="post" class="flex-1">
|
|
737
|
+
<form action="${(0, import_utils2.escapeHtml)(denyUrl || approveUrl)}" method="post" class="flex-1">
|
|
1275
738
|
${hiddenFields}
|
|
1276
739
|
<input type="hidden" name="action" value="deny">
|
|
1277
740
|
${outlineButton(denyText, { type: "submit", fullWidth: true })}
|
|
1278
741
|
</form>
|
|
1279
|
-
<form action="${escapeHtml(approveUrl)}" method="post" class="flex-1">
|
|
742
|
+
<form action="${(0, import_utils2.escapeHtml)(approveUrl)}" method="post" class="flex-1">
|
|
1280
743
|
${hiddenFields}
|
|
1281
744
|
<input type="hidden" name="action" value="approve">
|
|
1282
745
|
${primaryButton(approveText, { type: "submit", fullWidth: true })}
|
|
@@ -1285,13 +748,13 @@ function consentPage(options) {
|
|
|
1285
748
|
`;
|
|
1286
749
|
const linksHtml = client.privacyUrl || client.termsUrl || client.websiteUrl ? `
|
|
1287
750
|
<div class="text-center text-xs text-text-secondary mt-6 space-x-3">
|
|
1288
|
-
${client.websiteUrl ? `<a href="${escapeHtml(
|
|
751
|
+
${client.websiteUrl ? `<a href="${(0, import_utils2.escapeHtml)(
|
|
1289
752
|
client.websiteUrl
|
|
1290
753
|
)}" target="_blank" rel="noopener" class="hover:text-primary">Website</a>` : ""}
|
|
1291
|
-
${client.privacyUrl ? `<a href="${escapeHtml(
|
|
754
|
+
${client.privacyUrl ? `<a href="${(0, import_utils2.escapeHtml)(
|
|
1292
755
|
client.privacyUrl
|
|
1293
756
|
)}" target="_blank" rel="noopener" class="hover:text-primary">Privacy Policy</a>` : ""}
|
|
1294
|
-
${client.termsUrl ? `<a href="${escapeHtml(
|
|
757
|
+
${client.termsUrl ? `<a href="${(0, import_utils2.escapeHtml)(
|
|
1295
758
|
client.termsUrl
|
|
1296
759
|
)}" target="_blank" rel="noopener" class="hover:text-primary">Terms of Service</a>` : ""}
|
|
1297
760
|
</div>
|
|
@@ -1318,7 +781,7 @@ function consentSuccessPage(options) {
|
|
|
1318
781
|
const redirectScript = redirectUrl && autoRedirectDelay > 0 ? `
|
|
1319
782
|
<script>
|
|
1320
783
|
setTimeout(() => {
|
|
1321
|
-
window.location.href = '${escapeHtml(redirectUrl)}';
|
|
784
|
+
window.location.href = '${(0, import_utils2.escapeHtml)(redirectUrl)}';
|
|
1322
785
|
}, ${autoRedirectDelay});
|
|
1323
786
|
</script>
|
|
1324
787
|
` : "";
|
|
@@ -1331,9 +794,9 @@ function consentSuccessPage(options) {
|
|
|
1331
794
|
</div>
|
|
1332
795
|
<h1 class="text-2xl font-bold text-text-primary mb-2">Authorization Successful</h1>
|
|
1333
796
|
<p class="text-text-secondary mb-4">
|
|
1334
|
-
You have authorized <strong>${escapeHtml(client.name)}</strong> to access your account.
|
|
797
|
+
You have authorized <strong>${(0, import_utils2.escapeHtml)(client.name)}</strong> to access your account.
|
|
1335
798
|
</p>
|
|
1336
|
-
${redirectUrl ? `<p class="text-sm text-text-secondary">Redirecting you back to ${escapeHtml(client.name)}...</p>` : ""}
|
|
799
|
+
${redirectUrl ? `<p class="text-sm text-text-secondary">Redirecting you back to ${(0, import_utils2.escapeHtml)(client.name)}...</p>` : ""}
|
|
1337
800
|
</div>
|
|
1338
801
|
${redirectScript}
|
|
1339
802
|
`;
|
|
@@ -1355,13 +818,13 @@ function consentDeniedPage(options) {
|
|
|
1355
818
|
</div>
|
|
1356
819
|
<h1 class="text-2xl font-bold text-text-primary mb-2">Authorization Denied</h1>
|
|
1357
820
|
<p class="text-text-secondary mb-6">
|
|
1358
|
-
You denied <strong>${escapeHtml(client.name)}</strong> access to your account.
|
|
821
|
+
You denied <strong>${(0, import_utils2.escapeHtml)(client.name)}</strong> access to your account.
|
|
1359
822
|
</p>
|
|
1360
823
|
${redirectUrl ? `
|
|
1361
|
-
<a href="${escapeHtml(
|
|
824
|
+
<a href="${(0, import_utils2.escapeHtml)(
|
|
1362
825
|
redirectUrl
|
|
1363
826
|
)}" class="inline-block px-6 py-3 bg-primary hover:bg-primary/90 text-white font-medium rounded-lg transition-colors">
|
|
1364
|
-
Return to ${escapeHtml(client.name)}
|
|
827
|
+
Return to ${(0, import_utils2.escapeHtml)(client.name)}
|
|
1365
828
|
</a>
|
|
1366
829
|
` : ""}
|
|
1367
830
|
</div>
|
|
@@ -1397,20 +860,20 @@ function errorPage(options) {
|
|
|
1397
860
|
${details ? `
|
|
1398
861
|
<div class="p-4 bg-gray-50 rounded-lg text-sm text-text-secondary mb-4">
|
|
1399
862
|
<strong class="text-text-primary">Details:</strong>
|
|
1400
|
-
<p class="mt-1">${escapeHtml(details)}</p>
|
|
863
|
+
<p class="mt-1">${(0, import_utils2.escapeHtml)(details)}</p>
|
|
1401
864
|
</div>
|
|
1402
865
|
` : ""}
|
|
1403
866
|
${showStack && stack ? `
|
|
1404
867
|
<details class="p-4 bg-gray-900 rounded-lg text-sm">
|
|
1405
868
|
<summary class="text-gray-300 cursor-pointer hover:text-white">Stack Trace</summary>
|
|
1406
|
-
<pre class="mt-2 text-xs text-gray-400 overflow-x-auto whitespace-pre-wrap">${escapeHtml(stack)}</pre>
|
|
869
|
+
<pre class="mt-2 text-xs text-gray-400 overflow-x-auto whitespace-pre-wrap">${(0, import_utils2.escapeHtml)(stack)}</pre>
|
|
1407
870
|
</details>
|
|
1408
871
|
` : ""}
|
|
1409
872
|
</div>
|
|
1410
873
|
` : "";
|
|
1411
874
|
const requestIdHtml = requestId ? `
|
|
1412
875
|
<p class="text-xs text-text-secondary mt-6">
|
|
1413
|
-
Request ID: <code class="px-1.5 py-0.5 bg-gray-100 rounded text-xs">${escapeHtml(requestId)}</code>
|
|
876
|
+
Request ID: <code class="px-1.5 py-0.5 bg-gray-100 rounded text-xs">${(0, import_utils2.escapeHtml)(requestId)}</code>
|
|
1414
877
|
</p>
|
|
1415
878
|
` : "";
|
|
1416
879
|
const content = `
|
|
@@ -1458,7 +921,7 @@ function unauthorizedPage(options = {}) {
|
|
|
1458
921
|
showHome: false,
|
|
1459
922
|
actions: `
|
|
1460
923
|
<div class="flex justify-center mt-8">
|
|
1461
|
-
<a href="${escapeHtml(
|
|
924
|
+
<a href="${(0, import_utils2.escapeHtml)(
|
|
1462
925
|
loginUrl
|
|
1463
926
|
)}" class="px-6 py-3 bg-primary hover:bg-primary/90 text-white font-medium rounded-lg transition-colors">
|
|
1464
927
|
Sign In
|
|
@@ -1479,7 +942,7 @@ function serverErrorPage(options = {}) {
|
|
|
1479
942
|
}
|
|
1480
943
|
function maintenancePage(options = {}) {
|
|
1481
944
|
const { estimatedTime, ...rest } = options;
|
|
1482
|
-
const timeMessage = estimatedTime ? `We expect to be back by ${escapeHtml(estimatedTime)}.` : "We'll be back shortly.";
|
|
945
|
+
const timeMessage = estimatedTime ? `We expect to be back by ${(0, import_utils2.escapeHtml)(estimatedTime)}.` : "We'll be back shortly.";
|
|
1483
946
|
return errorPage({
|
|
1484
947
|
code: 503,
|
|
1485
948
|
title: "Under Maintenance",
|
|
@@ -1522,7 +985,7 @@ function sessionExpiredPage(options = {}) {
|
|
|
1522
985
|
showHome: false,
|
|
1523
986
|
actions: `
|
|
1524
987
|
<div class="flex justify-center mt-8">
|
|
1525
|
-
<a href="${escapeHtml(
|
|
988
|
+
<a href="${(0, import_utils2.escapeHtml)(
|
|
1526
989
|
loginUrl
|
|
1527
990
|
)}" class="px-6 py-3 bg-primary hover:bg-primary/90 text-white font-medium rounded-lg transition-colors">
|
|
1528
991
|
Sign In Again
|
|
@@ -1565,12 +1028,12 @@ function oauthErrorPage(options) {
|
|
|
1565
1028
|
}
|
|
1566
1029
|
};
|
|
1567
1030
|
const errorInfo = errorCode && errorMessages[errorCode] ? errorMessages[errorCode] : { title: "Authorization Error", message: errorDescription || "An error occurred during authorization." };
|
|
1568
|
-
const clientMessage = clientName ? ` while connecting to ${escapeHtml(clientName)}` : "";
|
|
1031
|
+
const clientMessage = clientName ? ` while connecting to ${(0, import_utils2.escapeHtml)(clientName)}` : "";
|
|
1569
1032
|
const redirectAction = redirectUri ? `
|
|
1570
|
-
<a href="${escapeHtml(
|
|
1033
|
+
<a href="${(0, import_utils2.escapeHtml)(
|
|
1571
1034
|
redirectUri
|
|
1572
1035
|
)}" class="px-6 py-3 bg-gray-100 hover:bg-gray-200 text-text-primary font-medium rounded-lg transition-colors">
|
|
1573
|
-
Return to ${clientName ? escapeHtml(clientName) : "Application"}
|
|
1036
|
+
Return to ${clientName ? (0, import_utils2.escapeHtml)(clientName) : "Application"}
|
|
1574
1037
|
</a>
|
|
1575
1038
|
` : "";
|
|
1576
1039
|
return errorPage({
|