handoff-app-next 2.0.0-canary.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/Changelog.md +2069 -0
- package/License.md +19 -0
- package/README.md +461 -0
- package/components.json +21 -0
- package/config/config.template.js +95 -0
- package/config/config.template.ts +54 -0
- package/config/docs/design.md +14 -0
- package/config/docs/foundations/border-radius.md +6 -0
- package/config/docs/foundations/colors.md +7 -0
- package/config/docs/foundations/effects.md +8 -0
- package/config/docs/foundations/elevation.md +6 -0
- package/config/docs/foundations/focus.md +6 -0
- package/config/docs/foundations/fonts.md +7 -0
- package/config/docs/foundations/grid.md +21 -0
- package/config/docs/foundations/icon.md +6 -0
- package/config/docs/foundations/icons.md +6 -0
- package/config/docs/foundations/logo.md +7 -0
- package/config/docs/foundations/logos.md +7 -0
- package/config/docs/foundations/motion.md +6 -0
- package/config/docs/foundations/spacing.md +7 -0
- package/config/docs/foundations/typography.md +8 -0
- package/config/docs/foundations.md +44 -0
- package/config/docs/guidelines.md +11 -0
- package/config/docs/index.md +9 -0
- package/config/docs/playground.md +14 -0
- package/config/docs/system/figma-sync.md +14 -0
- package/config/docs/system/tokens/foundations/colors.md +24 -0
- package/config/docs/system/tokens/foundations/effects.md +21 -0
- package/config/docs/system/tokens/foundations/spacing.md +22 -0
- package/config/docs/system/tokens/foundations/typography.md +24 -0
- package/config/docs/system.md +13 -0
- package/config/templates/component/template.hbs +6 -0
- package/config/templates/component/template.js +0 -0
- package/config/templates/component/template.json +45 -0
- package/config/templates/component/template.scss +2 -0
- package/config/templates/page.md +11 -0
- package/config/templates/page.mdx +49 -0
- package/config/templates/template.html +7 -0
- package/dist/app/components/Component/Cards.d.ts +25 -0
- package/dist/app/components/Component/Cards.jsx +27 -0
- package/dist/app/lib/adapter-kit/types.d.ts +581 -0
- package/dist/app/lib/adapter-kit/types.js +36 -0
- package/dist/app/lib/hubspot-field-map.d.ts +170 -0
- package/dist/app/lib/hubspot-field-map.js +538 -0
- package/dist/app/lib/hubspot-module/build-module.d.ts +136 -0
- package/dist/app/lib/hubspot-module/build-module.js +122 -0
- package/dist/app/lib/hubspot-module/context.d.ts +111 -0
- package/dist/app/lib/hubspot-module/context.js +228 -0
- package/dist/app/lib/hubspot-module/fields/boolean.d.ts +8 -0
- package/dist/app/lib/hubspot-module/fields/boolean.js +22 -0
- package/dist/app/lib/hubspot-module/fields/button.d.ts +19 -0
- package/dist/app/lib/hubspot-module/fields/button.js +66 -0
- package/dist/app/lib/hubspot-module/fields/fields.d.ts +20 -0
- package/dist/app/lib/hubspot-module/fields/fields.js +93 -0
- package/dist/app/lib/hubspot-module/fields/generic.d.ts +33 -0
- package/dist/app/lib/hubspot-module/fields/generic.js +150 -0
- package/dist/app/lib/hubspot-module/fields/hubdb.d.ts +14 -0
- package/dist/app/lib/hubspot-module/fields/hubdb.js +155 -0
- package/dist/app/lib/hubspot-module/fields/image.d.ts +27 -0
- package/dist/app/lib/hubspot-module/fields/image.js +59 -0
- package/dist/app/lib/hubspot-module/fields/menu.d.ts +8 -0
- package/dist/app/lib/hubspot-module/fields/menu.js +12 -0
- package/dist/app/lib/hubspot-module/fields/object.d.ts +11 -0
- package/dist/app/lib/hubspot-module/fields/object.js +31 -0
- package/dist/app/lib/hubspot-module/fields/select.d.ts +17 -0
- package/dist/app/lib/hubspot-module/fields/select.js +37 -0
- package/dist/app/lib/hubspot-module/fields/text.d.ts +15 -0
- package/dist/app/lib/hubspot-module/fields/text.js +63 -0
- package/dist/app/lib/hubspot-module/fields/url.d.ts +35 -0
- package/dist/app/lib/hubspot-module/fields/url.js +57 -0
- package/dist/app/lib/hubspot-module/fields/utils.d.ts +20 -0
- package/dist/app/lib/hubspot-module/fields/utils.js +33 -0
- package/dist/app/lib/hubspot-module/fields/video.d.ts +21 -0
- package/dist/app/lib/hubspot-module/fields/video.js +70 -0
- package/dist/app/lib/hubspot-module/index.d.ts +20 -0
- package/dist/app/lib/hubspot-module/index.js +17 -0
- package/dist/app/lib/hubspot-module/transpile.d.ts +27 -0
- package/dist/app/lib/hubspot-module/transpile.js +658 -0
- package/dist/app/lib/hubspot-module/types.d.ts +204 -0
- package/dist/app/lib/hubspot-module/types.js +47 -0
- package/dist/app/lib/hubspot-module-build.d.ts +33 -0
- package/dist/app/lib/hubspot-module-build.js +41 -0
- package/dist/app-builder/build.d.ts +21 -0
- package/dist/app-builder/build.js +649 -0
- package/dist/app-builder/client-config.d.ts +17 -0
- package/dist/app-builder/client-config.js +106 -0
- package/dist/app-builder/config-diff/index.d.ts +4 -0
- package/dist/app-builder/config-diff/index.js +3 -0
- package/dist/app-builder/config-diff/registry.d.ts +9 -0
- package/dist/app-builder/config-diff/registry.js +15 -0
- package/dist/app-builder/config-diff/snapshot.d.ts +13 -0
- package/dist/app-builder/config-diff/snapshot.js +38 -0
- package/dist/app-builder/config-diff/strategies/pattern.d.ts +2 -0
- package/dist/app-builder/config-diff/strategies/pattern.js +66 -0
- package/dist/app-builder/config-diff/types.d.ts +33 -0
- package/dist/app-builder/config-diff/types.js +1 -0
- package/dist/app-builder/index.d.ts +6 -0
- package/dist/app-builder/index.js +4 -0
- package/dist/app-builder/path-contract.d.ts +23 -0
- package/dist/app-builder/path-contract.js +60 -0
- package/dist/app-builder/paths.d.ts +24 -0
- package/dist/app-builder/paths.js +82 -0
- package/dist/app-builder/watchers/component.d.ts +15 -0
- package/dist/app-builder/watchers/component.js +58 -0
- package/dist/app-builder/watchers/utils.d.ts +14 -0
- package/dist/app-builder/watchers/utils.js +31 -0
- package/dist/app-builder/watchers.d.ts +44 -0
- package/dist/app-builder/watchers.js +299 -0
- package/dist/app-builder/websocket.d.ts +12 -0
- package/dist/app-builder/websocket.js +56 -0
- package/dist/cache/build-cache.d.ts +169 -0
- package/dist/cache/build-cache.js +421 -0
- package/dist/cache/file-state.d.ts +58 -0
- package/dist/cache/file-state.js +122 -0
- package/dist/cache/index.d.ts +3 -0
- package/dist/cache/index.js +6 -0
- package/dist/cache/push-state.d.ts +69 -0
- package/dist/cache/push-state.js +156 -0
- package/dist/cli/create.d.ts +5 -0
- package/dist/cli/create.js +301 -0
- package/dist/cli/eject.d.ts +17 -0
- package/dist/cli/eject.js +82 -0
- package/dist/cli/fetch-design-md.d.ts +14 -0
- package/dist/cli/fetch-design-md.js +62 -0
- package/dist/cli/figma-audit.d.ts +7 -0
- package/dist/cli/figma-audit.js +55 -0
- package/dist/cli/init-claude-core.d.ts +26 -0
- package/dist/cli/init-claude-core.js +81 -0
- package/dist/cli/make.d.ts +12 -0
- package/dist/cli/make.js +178 -0
- package/dist/cli/scaffold.d.ts +5 -0
- package/dist/cli/scaffold.js +504 -0
- package/dist/cli/sync/apply-declaration-pull.d.ts +14 -0
- package/dist/cli/sync/apply-declaration-pull.js +184 -0
- package/dist/cli/sync/apply-pull.d.ts +24 -0
- package/dist/cli/sync/apply-pull.js +174 -0
- package/dist/cli/sync/cli-auth-store.d.ts +12 -0
- package/dist/cli/sync/cli-auth-store.js +44 -0
- package/dist/cli/sync/collect-build-artifacts.d.ts +17 -0
- package/dist/cli/sync/collect-build-artifacts.js +143 -0
- package/dist/cli/sync/collect-referenced-images.d.ts +36 -0
- package/dist/cli/sync/collect-referenced-images.js +165 -0
- package/dist/cli/sync/declaration-patch.d.ts +9 -0
- package/dist/cli/sync/declaration-patch.js +196 -0
- package/dist/cli/sync/hash.d.ts +2 -0
- package/dist/cli/sync/hash.js +11 -0
- package/dist/cli/sync/open-browser.d.ts +5 -0
- package/dist/cli/sync/open-browser.js +37 -0
- package/dist/cli/sync/push-provenance.d.ts +25 -0
- package/dist/cli/sync/push-provenance.js +82 -0
- package/dist/cli/sync/push-registry-content.d.ts +132 -0
- package/dist/cli/sync/push-registry-content.js +854 -0
- package/dist/cli/sync/push-shared-assets.d.ts +26 -0
- package/dist/cli/sync/push-shared-assets.js +33 -0
- package/dist/cli/sync/resolve-declaration-payload.d.ts +8 -0
- package/dist/cli/sync/resolve-declaration-payload.js +208 -0
- package/dist/cli/sync/resolve-declaration.d.ts +5 -0
- package/dist/cli/sync/resolve-declaration.js +12 -0
- package/dist/cli/sync/run-cli-login.d.ts +9 -0
- package/dist/cli/sync/run-cli-login.js +81 -0
- package/dist/cli/sync/run-history-purge.d.ts +19 -0
- package/dist/cli/sync/run-history-purge.js +112 -0
- package/dist/cli/sync/run-pull.d.ts +9 -0
- package/dist/cli/sync/run-pull.js +92 -0
- package/dist/cli/sync/run-push.d.ts +47 -0
- package/dist/cli/sync/run-push.js +585 -0
- package/dist/cli/sync/run-sync-status.d.ts +2 -0
- package/dist/cli/sync/run-sync-status.js +30 -0
- package/dist/cli/sync/sync-remote-env.d.ts +14 -0
- package/dist/cli/sync/sync-remote-env.js +52 -0
- package/dist/cli/sync/sync-state.d.ts +15 -0
- package/dist/cli/sync/sync-state.js +26 -0
- package/dist/cli/tokens/ensure-default-brand.d.ts +18 -0
- package/dist/cli/tokens/ensure-default-brand.js +95 -0
- package/dist/cli/tokens/migrate-legacy.d.ts +23 -0
- package/dist/cli/tokens/migrate-legacy.js +213 -0
- package/dist/cli/tokens/parse-css-brands.d.ts +25 -0
- package/dist/cli/tokens/parse-css-brands.js +148 -0
- package/dist/cli/tokens/transform.d.ts +12 -0
- package/dist/cli/tokens/transform.js +126 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +56 -0
- package/dist/commands/audit/figma-components.d.ts +8 -0
- package/dist/commands/audit/figma-components.js +27 -0
- package/dist/commands/build/app.d.ts +8 -0
- package/dist/commands/build/app.js +22 -0
- package/dist/commands/build/components.d.ts +7 -0
- package/dist/commands/build/components.js +17 -0
- package/dist/commands/build/hubspot.d.ts +56 -0
- package/dist/commands/build/hubspot.js +177 -0
- package/dist/commands/dev/index.d.ts +6 -0
- package/dist/commands/dev/index.js +14 -0
- package/dist/commands/eject/config.d.ts +6 -0
- package/dist/commands/eject/config.js +14 -0
- package/dist/commands/eject/pages.d.ts +6 -0
- package/dist/commands/eject/pages.js +14 -0
- package/dist/commands/eject/theme.d.ts +6 -0
- package/dist/commands/eject/theme.js +14 -0
- package/dist/commands/fetch/index.d.ts +6 -0
- package/dist/commands/fetch/index.js +14 -0
- package/dist/commands/history-purge.d.ts +19 -0
- package/dist/commands/history-purge.js +52 -0
- package/dist/commands/index.d.ts +1 -0
- package/dist/commands/index.js +66 -0
- package/dist/commands/init/index.d.ts +5 -0
- package/dist/commands/init/index.js +12 -0
- package/dist/commands/init/vercel.d.ts +6 -0
- package/dist/commands/init/vercel.js +99 -0
- package/dist/commands/init-claude.d.ts +9 -0
- package/dist/commands/init-claude.js +47 -0
- package/dist/commands/login.d.ts +9 -0
- package/dist/commands/login.js +28 -0
- package/dist/commands/logout.d.ts +6 -0
- package/dist/commands/logout.js +16 -0
- package/dist/commands/make/component.d.ts +7 -0
- package/dist/commands/make/component.js +23 -0
- package/dist/commands/make/page.d.ts +8 -0
- package/dist/commands/make/page.js +33 -0
- package/dist/commands/make/template.d.ts +8 -0
- package/dist/commands/make/template.js +33 -0
- package/dist/commands/mcp-init.d.ts +12 -0
- package/dist/commands/mcp-init.js +94 -0
- package/dist/commands/mcp-token.d.ts +7 -0
- package/dist/commands/mcp-token.js +23 -0
- package/dist/commands/prepare-runtime.d.ts +7 -0
- package/dist/commands/prepare-runtime.js +28 -0
- package/dist/commands/pull.d.ts +7 -0
- package/dist/commands/pull.js +18 -0
- package/dist/commands/push-all.d.ts +23 -0
- package/dist/commands/push-all.js +146 -0
- package/dist/commands/push-assets.d.ts +8 -0
- package/dist/commands/push-assets.js +40 -0
- package/dist/commands/push-tokens.d.ts +8 -0
- package/dist/commands/push-tokens.js +40 -0
- package/dist/commands/push.d.ts +14 -0
- package/dist/commands/push.js +75 -0
- package/dist/commands/scaffold/index.d.ts +6 -0
- package/dist/commands/scaffold/index.js +15 -0
- package/dist/commands/start/index.d.ts +6 -0
- package/dist/commands/start/index.js +14 -0
- package/dist/commands/sync-status.d.ts +6 -0
- package/dist/commands/sync-status.js +14 -0
- package/dist/commands/tokens-build.d.ts +7 -0
- package/dist/commands/tokens-build.js +104 -0
- package/dist/commands/types.d.ts +5 -0
- package/dist/commands/types.js +1 -0
- package/dist/commands/utils.d.ts +18 -0
- package/dist/commands/utils.js +19 -0
- package/dist/commands/validate/components.d.ts +7 -0
- package/dist/commands/validate/components.js +19 -0
- package/dist/commands/validate.d.ts +11 -0
- package/dist/commands/validate.js +163 -0
- package/dist/commands/vercel-build.d.ts +7 -0
- package/dist/commands/vercel-build.js +81 -0
- package/dist/config/declaration-module-load.d.ts +6 -0
- package/dist/config/declaration-module-load.js +68 -0
- package/dist/config/defaults.d.ts +16 -0
- package/dist/config/defaults.js +60 -0
- package/dist/config/helpers.d.ts +7 -0
- package/dist/config/helpers.js +29 -0
- package/dist/config/index.d.ts +7 -0
- package/dist/config/index.js +11 -0
- package/dist/config/loader.d.ts +20 -0
- package/dist/config/loader.js +107 -0
- package/dist/config/normalizers/declaration.d.ts +11 -0
- package/dist/config/normalizers/declaration.js +122 -0
- package/dist/config/normalizers/pattern.d.ts +8 -0
- package/dist/config/normalizers/pattern.js +31 -0
- package/dist/config/runtime.d.ts +42 -0
- package/dist/config/runtime.js +337 -0
- package/dist/config/validator.d.ts +9 -0
- package/dist/config/validator.js +22 -0
- package/dist/declarations/codegen.d.ts +57 -0
- package/dist/declarations/codegen.js +279 -0
- package/dist/declarations/helpers.d.ts +6 -0
- package/dist/declarations/helpers.js +20 -0
- package/dist/declarations/index.d.ts +2 -0
- package/dist/declarations/index.js +1 -0
- package/dist/declarations/types.d.ts +193 -0
- package/dist/declarations/types.js +1 -0
- package/dist/figma/component-linking.d.ts +164 -0
- package/dist/figma/component-linking.js +1080 -0
- package/dist/figma/image-fills.d.ts +32 -0
- package/dist/figma/image-fills.js +211 -0
- package/dist/generated/build-meta.d.ts +4 -0
- package/dist/generated/build-meta.js +6 -0
- package/dist/index.d.ts +115 -0
- package/dist/index.js +301 -0
- package/dist/pipeline/archive.d.ts +19 -0
- package/dist/pipeline/archive.js +62 -0
- package/dist/pipeline/components.d.ts +5 -0
- package/dist/pipeline/components.js +7 -0
- package/dist/pipeline/documentation.d.ts +3 -0
- package/dist/pipeline/documentation.js +64 -0
- package/dist/pipeline/figma.d.ts +11 -0
- package/dist/pipeline/figma.js +142 -0
- package/dist/pipeline/hubspot/config.d.ts +179 -0
- package/dist/pipeline/hubspot/config.js +171 -0
- package/dist/pipeline/hubspot/emit.d.ts +101 -0
- package/dist/pipeline/hubspot/emit.js +283 -0
- package/dist/pipeline/index.d.ts +14 -0
- package/dist/pipeline/index.js +34 -0
- package/dist/pipeline/patterns.d.ts +8 -0
- package/dist/pipeline/patterns.js +8 -0
- package/dist/pipeline/styles.d.ts +10 -0
- package/dist/pipeline/styles.js +127 -0
- package/dist/pipeline/validation.d.ts +6 -0
- package/dist/pipeline/validation.js +23 -0
- package/dist/transformers/docgen/index.d.ts +24 -0
- package/dist/transformers/docgen/index.js +244 -0
- package/dist/transformers/plugins/csf-render.d.ts +5 -0
- package/dist/transformers/plugins/csf-render.js +406 -0
- package/dist/transformers/plugins/handlebars-previews.d.ts +12 -0
- package/dist/transformers/plugins/handlebars-previews.js +128 -0
- package/dist/transformers/plugins/index.d.ts +11 -0
- package/dist/transformers/plugins/index.js +10 -0
- package/dist/transformers/plugins/slot-probe-candidates.d.ts +159 -0
- package/dist/transformers/plugins/slot-probe-candidates.js +279 -0
- package/dist/transformers/plugins/slot-probe.d.ts +66 -0
- package/dist/transformers/plugins/slot-probe.js +298 -0
- package/dist/transformers/plugins/ssr-render.d.ts +33 -0
- package/dist/transformers/plugins/ssr-render.js +531 -0
- package/dist/transformers/plugins.d.ts +14 -0
- package/dist/transformers/plugins.js +15 -0
- package/dist/transformers/preview/component/api.d.ts +22 -0
- package/dist/transformers/preview/component/api.js +146 -0
- package/dist/transformers/preview/component/artifacts.d.ts +3 -0
- package/dist/transformers/preview/component/artifacts.js +103 -0
- package/dist/transformers/preview/component/build-shared-bundles.d.ts +83 -0
- package/dist/transformers/preview/component/build-shared-bundles.js +400 -0
- package/dist/transformers/preview/component/builder.d.ts +29 -0
- package/dist/transformers/preview/component/builder.js +638 -0
- package/dist/transformers/preview/component/css.d.ts +68 -0
- package/dist/transformers/preview/component/css.js +219 -0
- package/dist/transformers/preview/component/field-annotations.d.ts +129 -0
- package/dist/transformers/preview/component/field-annotations.js +325 -0
- package/dist/transformers/preview/component/html.d.ts +21 -0
- package/dist/transformers/preview/component/html.js +80 -0
- package/dist/transformers/preview/component/javascript.d.ts +24 -0
- package/dist/transformers/preview/component/javascript.js +162 -0
- package/dist/transformers/preview/component/normalizer.d.ts +35 -0
- package/dist/transformers/preview/component/normalizer.js +56 -0
- package/dist/transformers/preview/component/playwright-shared.d.ts +70 -0
- package/dist/transformers/preview/component/playwright-shared.js +164 -0
- package/dist/transformers/preview/component/preview-assets.d.ts +55 -0
- package/dist/transformers/preview/component/preview-assets.js +144 -0
- package/dist/transformers/preview/component/preview-merge.d.ts +53 -0
- package/dist/transformers/preview/component/preview-merge.js +50 -0
- package/dist/transformers/preview/component/preview-select.d.ts +86 -0
- package/dist/transformers/preview/component/preview-select.js +150 -0
- package/dist/transformers/preview/component/preview-server.d.ts +41 -0
- package/dist/transformers/preview/component/preview-server.js +112 -0
- package/dist/transformers/preview/component/preview-validation.d.ts +64 -0
- package/dist/transformers/preview/component/preview-validation.js +194 -0
- package/dist/transformers/preview/component/previews.d.ts +9 -0
- package/dist/transformers/preview/component/previews.js +6 -0
- package/dist/transformers/preview/component/screenshot.d.ts +90 -0
- package/dist/transformers/preview/component/screenshot.js +282 -0
- package/dist/transformers/preview/component/serialized-elements.d.ts +86 -0
- package/dist/transformers/preview/component/serialized-elements.js +118 -0
- package/dist/transformers/preview/component/summary.d.ts +6 -0
- package/dist/transformers/preview/component/summary.js +41 -0
- package/dist/transformers/preview/component.d.ts +13 -0
- package/dist/transformers/preview/component.js +26 -0
- package/dist/transformers/preview/height-reporter.d.ts +27 -0
- package/dist/transformers/preview/height-reporter.js +32 -0
- package/dist/transformers/preview/pattern/api.d.ts +11 -0
- package/dist/transformers/preview/pattern/api.js +58 -0
- package/dist/transformers/preview/pattern/builder.d.ts +17 -0
- package/dist/transformers/preview/pattern/builder.js +149 -0
- package/dist/transformers/preview/pattern/html.d.ts +25 -0
- package/dist/transformers/preview/pattern/html.js +95 -0
- package/dist/transformers/preview/slots.d.ts +109 -0
- package/dist/transformers/preview/slots.js +13 -0
- package/dist/transformers/preview/types.d.ts +292 -0
- package/dist/transformers/preview/types.js +7 -0
- package/dist/transformers/types.d.ts +60 -0
- package/dist/transformers/types.js +1 -0
- package/dist/transformers/utils/build.d.ts +27 -0
- package/dist/transformers/utils/build.js +77 -0
- package/dist/transformers/utils/csf.d.ts +16 -0
- package/dist/transformers/utils/csf.js +29 -0
- package/dist/transformers/utils/handlebars.d.ts +32 -0
- package/dist/transformers/utils/handlebars.js +73 -0
- package/dist/transformers/utils/html.d.ts +18 -0
- package/dist/transformers/utils/html.js +40 -0
- package/dist/transformers/utils/index.d.ts +13 -0
- package/dist/transformers/utils/index.js +20 -0
- package/dist/transformers/utils/module.d.ts +13 -0
- package/dist/transformers/utils/module.js +41 -0
- package/dist/transformers/utils/schema-loader.d.ts +19 -0
- package/dist/transformers/utils/schema-loader.js +61 -0
- package/dist/transformers/utils/schema.d.ts +33 -0
- package/dist/transformers/utils/schema.js +517 -0
- package/dist/transformers/utils/string.d.ts +36 -0
- package/dist/transformers/utils/string.js +52 -0
- package/dist/transformers/utils/svg-sprite.d.ts +16 -0
- package/dist/transformers/utils/svg-sprite.js +114 -0
- package/dist/transformers/utils/usage.d.ts +23 -0
- package/dist/transformers/utils/usage.js +282 -0
- package/dist/transformers/utils/vite-logger.d.ts +2 -0
- package/dist/transformers/utils/vite-logger.js +30 -0
- package/dist/transformers/validation/runner.d.ts +67 -0
- package/dist/transformers/validation/runner.js +277 -0
- package/dist/transformers/vite-config.d.ts +3 -0
- package/dist/transformers/vite-config.js +18 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/config.d.ts +472 -0
- package/dist/types/config.js +1 -0
- package/dist/types/font.d.ts +3 -0
- package/dist/types/font.js +1 -0
- package/dist/types/handoff-sync.d.ts +132 -0
- package/dist/types/handoff-sync.js +5 -0
- package/dist/types/history-purge.d.ts +112 -0
- package/dist/types/history-purge.js +18 -0
- package/dist/types/icon.d.ts +8 -0
- package/dist/types/icon.js +1 -0
- package/dist/types/preview.d.ts +138 -0
- package/dist/types/preview.js +1 -0
- package/dist/types/validation.d.ts +200 -0
- package/dist/types/validation.js +11 -0
- package/dist/utils/asset-upload-limits.d.ts +87 -0
- package/dist/utils/asset-upload-limits.js +129 -0
- package/dist/utils/design-md.d.ts +55 -0
- package/dist/utils/design-md.js +107 -0
- package/dist/utils/duration.d.ts +2 -0
- package/dist/utils/duration.js +2 -0
- package/dist/utils/filter.d.ts +31 -0
- package/dist/utils/filter.js +109 -0
- package/dist/utils/fs.d.ts +8 -0
- package/dist/utils/fs.js +31 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.js +6 -0
- package/dist/utils/line-diff.d.ts +25 -0
- package/dist/utils/line-diff.js +74 -0
- package/dist/utils/logger.d.ts +50 -0
- package/dist/utils/logger.js +158 -0
- package/dist/utils/path.d.ts +21 -0
- package/dist/utils/path.js +50 -0
- package/dist/utils/port.d.ts +15 -0
- package/dist/utils/port.js +38 -0
- package/dist/utils/rich-text.d.ts +228 -0
- package/dist/utils/rich-text.js +1087 -0
- package/dist/validators/axe.d.ts +47 -0
- package/dist/validators/axe.js +222 -0
- package/dist/validators/contrast.d.ts +33 -0
- package/dist/validators/contrast.js +235 -0
- package/dist/validators/index.d.ts +30 -0
- package/dist/validators/index.js +26 -0
- package/dist/validators/schema.d.ts +34 -0
- package/dist/validators/schema.js +138 -0
- package/docs/DEPENDENCIES.md +26 -0
- package/docs/DEPLOYMENT.md +110 -0
- package/docs/LOCAL-RIG.md +305 -0
- package/docs/README.md +15 -0
- package/docs/REGISTRY-SETUP.md +353 -0
- package/docs/STANDALONE-INSTALL.md +70 -0
- package/docs/WORKSPACE-PACKAGE-JSON.md +125 -0
- package/docs/api.md +657 -0
- package/docs/api_spec.yaml +450 -0
- package/docs/cli.md +86 -0
- package/docs/schemas/component.schema.json +167 -0
- package/docs/schemas/examples/button.json +83 -0
- package/drizzle.config.ts +10 -0
- package/package.json +271 -0
- package/postcss.config.mjs +8 -0
- package/scripts/assert-standalone-install.mjs +60 -0
- package/src/app/app/[...slug]/DocCatchAllClient.tsx +103 -0
- package/src/app/app/[...slug]/page.tsx +101 -0
- package/src/app/app/account/AccountClient.tsx +116 -0
- package/src/app/app/account/IntegrationsSection.tsx +273 -0
- package/src/app/app/account/SanityCard.tsx +473 -0
- package/src/app/app/account/ai-cost/page.tsx +141 -0
- package/src/app/app/account/appearance/AppearanceClient.tsx +433 -0
- package/src/app/app/account/appearance/page.tsx +52 -0
- package/src/app/app/account/integrations/page.tsx +37 -0
- package/src/app/app/account/layout.tsx +82 -0
- package/src/app/app/account/page.tsx +41 -0
- package/src/app/app/account/users/UsersClient.tsx +244 -0
- package/src/app/app/account/users/page.tsx +36 -0
- package/src/app/app/actions/ai-generate.ts +25 -0
- package/src/app/app/actions/components.ts +126 -0
- package/src/app/app/actions/patterns.ts +289 -0
- package/src/app/app/admin/ai-cost/AiCostClient.tsx +236 -0
- package/src/app/app/admin/ai-cost/page.tsx +56 -0
- package/src/app/app/admin/builds/BuildsClient.tsx +527 -0
- package/src/app/app/admin/builds/page.tsx +41 -0
- package/src/app/app/admin/integrations/page.tsx +32 -0
- package/src/app/app/admin/pages/PagesClient.tsx +282 -0
- package/src/app/app/admin/pages/edit/PageEditorClient.tsx +157 -0
- package/src/app/app/admin/pages/edit/page.tsx +48 -0
- package/src/app/app/admin/pages/page.tsx +31 -0
- package/src/app/app/admin/protection/ProtectionClient.tsx +235 -0
- package/src/app/app/admin/protection/page.tsx +33 -0
- package/src/app/app/admin/reference/ReferenceClient.tsx +150 -0
- package/src/app/app/admin/reference/page.tsx +38 -0
- package/src/app/app/admin/users/page.tsx +11 -0
- package/src/app/app/api/account/route.ts +36 -0
- package/src/app/app/api/admin/builds/status/route.ts +34 -0
- package/src/app/app/api/admin/cleanup-versions/route.ts +64 -0
- package/src/app/app/api/admin/contract-limit-audit/route.ts +126 -0
- package/src/app/app/api/admin/contract-render-audit/route.ts +116 -0
- package/src/app/app/api/admin/field-bridge-audit/route.ts +152 -0
- package/src/app/app/api/admin/migrate/route.ts +47 -0
- package/src/app/app/api/admin/playground-turns/route.ts +85 -0
- package/src/app/app/api/admin/purge-history/route.ts +119 -0
- package/src/app/app/api/auth/[...nextauth]/route.ts +30 -0
- package/src/app/app/api/component/[...path]/route.ts +141 -0
- package/src/app/app/api/component-artifact/[...path]/route.ts +18 -0
- package/src/app/app/api/components/route.ts +78 -0
- package/src/app/app/api/figma-plugin/auth/device/route.ts +40 -0
- package/src/app/app/api/figma-plugin/auth/revoke/route.ts +15 -0
- package/src/app/app/api/figma-plugin/auth/token/route.ts +50 -0
- package/src/app/app/api/figma-plugin/foundations/commit/route.ts +111 -0
- package/src/app/app/api/figma-plugin/foundations/preview/route.ts +69 -0
- package/src/app/app/api/figma-plugin/foundations/route.ts +49 -0
- package/src/app/app/api/handoff/admin/appearance/route.ts +80 -0
- package/src/app/app/api/handoff/admin/backfill-artifact-blobs/route.ts +48 -0
- package/src/app/app/api/handoff/admin/build-tasks/kill/route.ts +43 -0
- package/src/app/app/api/handoff/admin/build-tasks/route.ts +21 -0
- package/src/app/app/api/handoff/admin/invite/route.ts +18 -0
- package/src/app/app/api/handoff/admin/normalize-previews/route.ts +107 -0
- package/src/app/app/api/handoff/admin/reference-materials/route.ts +69 -0
- package/src/app/app/api/handoff/admin/remove/route.ts +18 -0
- package/src/app/app/api/handoff/admin/resend-invite/route.ts +18 -0
- package/src/app/app/api/handoff/admin/role/route.ts +18 -0
- package/src/app/app/api/handoff/admin/users/route.ts +16 -0
- package/src/app/app/api/handoff/ai/analyze-layout-guide/route.ts +172 -0
- package/src/app/app/api/handoff/ai/analyze-layout-guide/wireframe-style/wireframe-example-1.png +0 -0
- package/src/app/app/api/handoff/ai/analyze-layout-guide/wireframe-style/wireframe-example-2.png +0 -0
- package/src/app/app/api/handoff/ai/chat/route.ts +217 -0
- package/src/app/app/api/handoff/ai/component-screenshot/route.ts +43 -0
- package/src/app/app/api/handoff/ai/debug-foundation-raster/route.ts +162 -0
- package/src/app/app/api/handoff/ai/design-artifact/[id]/clone/route.ts +68 -0
- package/src/app/app/api/handoff/ai/design-artifact/[id]/public/route.ts +37 -0
- package/src/app/app/api/handoff/ai/design-artifact/[id]/route.ts +99 -0
- package/src/app/app/api/handoff/ai/design-artifact/[id]/status/route.ts +44 -0
- package/src/app/app/api/handoff/ai/design-artifact/route.ts +405 -0
- package/src/app/app/api/handoff/ai/design-artifact-extract/route.ts +37 -0
- package/src/app/app/api/handoff/ai/design-generation-job/[id]/route.ts +67 -0
- package/src/app/app/api/handoff/ai/design-generation-jobs/route.ts +23 -0
- package/src/app/app/api/handoff/ai/design-jobs/run/route.ts +102 -0
- package/src/app/app/api/handoff/ai/extract-url/route.ts +34 -0
- package/src/app/app/api/handoff/ai/foundation-preview/route.ts +44 -0
- package/src/app/app/api/handoff/ai/generate-component/route.ts +137 -0
- package/src/app/app/api/handoff/ai/generate-design/route.ts +210 -0
- package/src/app/app/api/handoff/ai/generate-image/route.ts +72 -0
- package/src/app/app/api/handoff/ai/generate-pattern/route.ts +86 -0
- package/src/app/app/api/handoff/ai/playground-chat/refine/route.ts +52 -0
- package/src/app/app/api/handoff/ai/playground-chat/route.ts +102 -0
- package/src/app/app/api/handoff/ai/status/route.ts +14 -0
- package/src/app/app/api/handoff/artifact-asset/route.ts +88 -0
- package/src/app/app/api/handoff/assets/[id]/raw/route.ts +49 -0
- package/src/app/app/api/handoff/assets/[id]/route.ts +76 -0
- package/src/app/app/api/handoff/assets/collections/route.ts +54 -0
- package/src/app/app/api/handoff/assets/confirm/route.ts +80 -0
- package/src/app/app/api/handoff/assets/icon-sets/route.ts +47 -0
- package/src/app/app/api/handoff/assets/presign/route.ts +41 -0
- package/src/app/app/api/handoff/assets/route.ts +89 -0
- package/src/app/app/api/handoff/assets/upload/route.ts +152 -0
- package/src/app/app/api/handoff/assets/usages/[id]/route.ts +21 -0
- package/src/app/app/api/handoff/assets/usages/route.ts +69 -0
- package/src/app/app/api/handoff/auth/request-reset/route.ts +9 -0
- package/src/app/app/api/handoff/auth/reset-password/route.ts +17 -0
- package/src/app/app/api/handoff/capture/health/route.ts +86 -0
- package/src/app/app/api/handoff/capture/jobs/route.ts +75 -0
- package/src/app/app/api/handoff/capture/run/route.ts +112 -0
- package/src/app/app/api/handoff/changelog/pushes/route.ts +49 -0
- package/src/app/app/api/handoff/changelog/route.ts +28 -0
- package/src/app/app/api/handoff/changes/why/route.ts +41 -0
- package/src/app/app/api/handoff/cms/connections/route.ts +182 -0
- package/src/app/app/api/handoff/cms/sanity/callback/route.ts +18 -0
- package/src/app/app/api/handoff/cms/sanity/categories/route.ts +146 -0
- package/src/app/app/api/handoff/cms/sanity/connect/route.ts +15 -0
- package/src/app/app/api/handoff/cms/sanity/publish/route.ts +161 -0
- package/src/app/app/api/handoff/cms/sanity/token/route.ts +87 -0
- package/src/app/app/api/handoff/components/[id]/screenshot.png/route.ts +101 -0
- package/src/app/app/api/handoff/components/[id]/thumbnail.svg/route.ts +158 -0
- package/src/app/app/api/handoff/components/build/route.ts +26 -0
- package/src/app/app/api/handoff/components/history/contract/route.ts +33 -0
- package/src/app/app/api/handoff/components/history/route.ts +35 -0
- package/src/app/app/api/handoff/components/history/version/route.ts +36 -0
- package/src/app/app/api/handoff/components/route.ts +56 -0
- package/src/app/app/api/handoff/components/validation/route.ts +36 -0
- package/src/app/app/api/handoff/design/workspace/brand-imagery-image/route.ts +75 -0
- package/src/app/app/api/handoff/design/workspace/route.ts +163 -0
- package/src/app/app/api/handoff/figma/component-properties/route.ts +34 -0
- package/src/app/app/api/handoff/figma/components/route.ts +21 -0
- package/src/app/app/api/handoff/figma/components/sync/route.ts +50 -0
- package/src/app/app/api/handoff/figma/fetch/route.ts +126 -0
- package/src/app/app/api/handoff/guest/assets/route.ts +52 -0
- package/src/app/app/api/handoff/guest/enter/route.ts +169 -0
- package/src/app/app/api/handoff/guest/submission/route.ts +209 -0
- package/src/app/app/api/handoff/guest/submission/submit/route.ts +63 -0
- package/src/app/app/api/handoff/image-slots/route.ts +24 -0
- package/src/app/app/api/handoff/navigation/prune/route.ts +106 -0
- package/src/app/app/api/handoff/pages/route.ts +90 -0
- package/src/app/app/api/handoff/patterns/[id]/clone/route.ts +69 -0
- package/src/app/app/api/handoff/patterns/[id]/manifest/route.ts +102 -0
- package/src/app/app/api/handoff/patterns/[id]/notes/route.ts +101 -0
- package/src/app/app/api/handoff/patterns/[id]/route.ts +41 -0
- package/src/app/app/api/handoff/patterns/[id]/thumbnail.svg/route.ts +70 -0
- package/src/app/app/api/handoff/patterns/route.ts +77 -0
- package/src/app/app/api/handoff/reference-materials/route.ts +40 -0
- package/src/app/app/api/handoff/review/[id]/route.ts +172 -0
- package/src/app/app/api/handoff/review/[id]/voice/route.ts +58 -0
- package/src/app/app/api/handoff/review/route.ts +31 -0
- package/src/app/app/api/handoff/share/[token]/route.ts +82 -0
- package/src/app/app/api/handoff/share/links/route.ts +48 -0
- package/src/app/app/api/handoff/share/route.ts +172 -0
- package/src/app/app/api/handoff/site-protection/route.ts +85 -0
- package/src/app/app/api/handoff/site-protection/unlock/route.ts +62 -0
- package/src/app/app/api/handoff/templates/[id]/submissions/route.ts +41 -0
- package/src/app/app/api/mcp/route.ts +39 -0
- package/src/app/app/api/oauth/authorization-server-metadata/route.ts +30 -0
- package/src/app/app/api/oauth/authorize/route.ts +158 -0
- package/src/app/app/api/oauth/device/approve/route.ts +32 -0
- package/src/app/app/api/oauth/device/route.ts +34 -0
- package/src/app/app/api/oauth/protected-resource-metadata/route.ts +26 -0
- package/src/app/app/api/oauth/register/route.ts +43 -0
- package/src/app/app/api/oauth/token/route.ts +94 -0
- package/src/app/app/api/openapi/route.ts +38 -0
- package/src/app/app/api/patterns/route.ts +8 -0
- package/src/app/app/api/registry/assets/ingest/route.ts +204 -0
- package/src/app/app/api/registry/assets/ingest-figma-fills/route.ts +81 -0
- package/src/app/app/api/registry/components/[id]/previews/[previewId]/route.ts +56 -0
- package/src/app/app/api/registry/components/[id]/previews/route.ts +66 -0
- package/src/app/app/api/registry/config/route.ts +50 -0
- package/src/app/app/api/registry/dtcg/download/route.ts +78 -0
- package/src/app/app/api/registry/dtcg/route.ts +133 -0
- package/src/app/app/api/registry/fonts/route.ts +67 -0
- package/src/app/app/api/registry/icons/download/route.ts +52 -0
- package/src/app/app/api/registry/icons/route.ts +47 -0
- package/src/app/app/api/registry/image-slots/route.ts +68 -0
- package/src/app/app/api/registry/logo.svg/route.ts +45 -0
- package/src/app/app/api/registry/logos/route.ts +47 -0
- package/src/app/app/api/registry/navigation/route.ts +52 -0
- package/src/app/app/api/registry/pages/route.ts +67 -0
- package/src/app/app/api/registry/theme/route.ts +51 -0
- package/src/app/app/api/registry/theme.css/route.ts +34 -0
- package/src/app/app/api/registry/tokens/route.ts +59 -0
- package/src/app/app/api/sync/changes/route.ts +24 -0
- package/src/app/app/api/sync/shared-assets/route.ts +79 -0
- package/src/app/app/api/sync/status/route.ts +12 -0
- package/src/app/app/api/sync/upload/route.ts +109 -0
- package/src/app/app/assets/AssetsClient.tsx +670 -0
- package/src/app/app/assets/[id]/AssetDetailClient.tsx +319 -0
- package/src/app/app/assets/[id]/page.tsx +8 -0
- package/src/app/app/assets/fonts/page.tsx +5 -0
- package/src/app/app/assets/logos/page.tsx +5 -0
- package/src/app/app/assets/page.tsx +5 -0
- package/src/app/app/cli/device/CliDeviceClient.tsx +104 -0
- package/src/app/app/cli/device/page.tsx +45 -0
- package/src/app/app/design/DesignClient.tsx +1682 -0
- package/src/app/app/design/SessionHistoryPanel.tsx +116 -0
- package/src/app/app/design/assets/[id]/page.tsx +11 -0
- package/src/app/app/design/assets/icons/page.tsx +8 -0
- package/src/app/app/design/assets/page.tsx +8 -0
- package/src/app/app/design/library/[id]/SavedDesignDetailClient.tsx +892 -0
- package/src/app/app/design/library/[id]/page.tsx +40 -0
- package/src/app/app/design/library/[id]/share/SharePublicClient.tsx +107 -0
- package/src/app/app/design/library/[id]/share/page.tsx +22 -0
- package/src/app/app/design/library/page.tsx +12 -0
- package/src/app/app/design/page.tsx +158 -0
- package/src/app/app/design/settings/SettingsClient.tsx +648 -0
- package/src/app/app/design/settings/page.tsx +41 -0
- package/src/app/app/design/settings/settings-constants.ts +96 -0
- package/src/app/app/design/v1/DesignClient.tsx +1316 -0
- package/src/app/app/design/v1/page.tsx +103 -0
- package/src/app/app/design/workbench-session.ts +54 -0
- package/src/app/app/design/workbench-types.ts +72 -0
- package/src/app/app/dev/local-setup/LocalSetupClient.tsx +119 -0
- package/src/app/app/dev/local-setup/McpSetupSection.tsx +174 -0
- package/src/app/app/dev/local-setup/page.tsx +5 -0
- package/src/app/app/developer/api/route.ts +13 -0
- package/src/app/app/developer/cli/page.tsx +192 -0
- package/src/app/app/developer/layout.tsx +57 -0
- package/src/app/app/developer/local-setup/page.tsx +37 -0
- package/src/app/app/developer/mcp/page.tsx +74 -0
- package/src/app/app/developer/page.tsx +111 -0
- package/src/app/app/developer/push-pull/page.tsx +130 -0
- package/src/app/app/fonts/[filename]/route.ts +41 -0
- package/src/app/app/foundations/[...slug]/page.tsx +83 -0
- package/src/app/app/foundations/assets/[id]/page.tsx +35 -0
- package/src/app/app/foundations/assets/page.tsx +31 -0
- package/src/app/app/foundations/border-radius/page.tsx +179 -0
- package/src/app/app/foundations/colors/page.tsx +166 -0
- package/src/app/app/foundations/effects/page.tsx +124 -0
- package/src/app/app/foundations/elevation/page.tsx +209 -0
- package/src/app/app/foundations/error.tsx +22 -0
- package/src/app/app/foundations/grid/page.tsx +315 -0
- package/src/app/app/foundations/icons/IconsPageClient.tsx +100 -0
- package/src/app/app/foundations/icons/[name]/SingleIconClient.tsx +231 -0
- package/src/app/app/foundations/icons/[name]/page.tsx +44 -0
- package/src/app/app/foundations/icons/page.tsx +58 -0
- package/src/app/app/foundations/logo/page.tsx +213 -0
- package/src/app/app/foundations/motion/page.tsx +228 -0
- package/src/app/app/foundations/page.tsx +65 -0
- package/src/app/app/foundations/spacing/page.tsx +171 -0
- package/src/app/app/foundations/typography/page.tsx +115 -0
- package/src/app/app/layout.tsx +131 -0
- package/src/app/app/library/LibraryClient.tsx +567 -0
- package/src/app/app/library/page.tsx +46 -0
- package/src/app/app/login/LoginClient.tsx +75 -0
- package/src/app/app/login/page.tsx +33 -0
- package/src/app/app/page.tsx +178 -0
- package/src/app/app/patterns/PatternBrowserClient.tsx +263 -0
- package/src/app/app/patterns/page.tsx +14 -0
- package/src/app/app/playground/PlaygroundClient.tsx +84 -0
- package/src/app/app/playground/[id]/page.tsx +215 -0
- package/src/app/app/playground/page.tsx +79 -0
- package/src/app/app/providers.tsx +72 -0
- package/src/app/app/reset-password/ResetPasswordClient.tsx +89 -0
- package/src/app/app/reset-password/page.tsx +24 -0
- package/src/app/app/review/ReviewClient.tsx +31 -0
- package/src/app/app/review/page.tsx +56 -0
- package/src/app/app/s/[token]/page.tsx +317 -0
- package/src/app/app/setup/SetupClient.tsx +87 -0
- package/src/app/app/setup/actions.ts +53 -0
- package/src/app/app/setup/page.tsx +28 -0
- package/src/app/app/system/FigmaFetchControls.tsx +163 -0
- package/src/app/app/system/FigmaSyncPanel.tsx +357 -0
- package/src/app/app/system/NewComponentForm.tsx +272 -0
- package/src/app/app/system/SystemPageClient.tsx +137 -0
- package/src/app/app/system/changelog/ChangelogClient.tsx +608 -0
- package/src/app/app/system/changelog/page.tsx +28 -0
- package/src/app/app/system/component/[component]/ComponentAssetsPanel.tsx +108 -0
- package/src/app/app/system/component/[component]/ComponentDetailClient.tsx +420 -0
- package/src/app/app/system/component/[component]/ComponentImageSlotsPanel.tsx +163 -0
- package/src/app/app/system/component/[component]/ComponentVersionHistory.tsx +430 -0
- package/src/app/app/system/component/[component]/VersionCompare.tsx +267 -0
- package/src/app/app/system/component/[component]/page.tsx +68 -0
- package/src/app/app/system/component/page.tsx +5 -0
- package/src/app/app/system/figma-sync/FigmaSyncPageClient.tsx +35 -0
- package/src/app/app/system/figma-sync/page.tsx +21 -0
- package/src/app/app/system/health/ComponentHealthTable.tsx +217 -0
- package/src/app/app/system/health/HealthDashboardClient.tsx +141 -0
- package/src/app/app/system/health/RuleBreakdownTable.tsx +123 -0
- package/src/app/app/system/health/ScoreBadge.tsx +58 -0
- package/src/app/app/system/health/TrendChart.tsx +76 -0
- package/src/app/app/system/health/ValidatorBreakdownBars.tsx +35 -0
- package/src/app/app/system/health/health-types.ts +7 -0
- package/src/app/app/system/health/page.tsx +100 -0
- package/src/app/app/system/page.tsx +21 -0
- package/src/app/app/system/pattern/[pattern]/PatternDetailClient.tsx +216 -0
- package/src/app/app/system/pattern/[pattern]/page.tsx +53 -0
- package/src/app/app/system/pattern/page.tsx +5 -0
- package/src/app/app/unlock/UnlockClient.tsx +100 -0
- package/src/app/app/unlock/page.tsx +40 -0
- package/src/app/components/Auth/AuthControls.tsx +146 -0
- package/src/app/components/Brief/BuildList.tsx +78 -0
- package/src/app/components/Brief/BuildPanel.tsx +460 -0
- package/src/app/components/Brief/export-blocks.ts +47 -0
- package/src/app/components/Chat/ChatActionCard.tsx +97 -0
- package/src/app/components/Chat/ChatChangelogFeed.tsx +252 -0
- package/src/app/components/Chat/ChatComponentGrid.tsx +144 -0
- package/src/app/components/Chat/ChatContext.tsx +192 -0
- package/src/app/components/Chat/ChatDrawer.tsx +162 -0
- package/src/app/components/Chat/ChatFab.tsx +41 -0
- package/src/app/components/Chat/ChatInput.tsx +150 -0
- package/src/app/components/Chat/ChatMessage.tsx +125 -0
- package/src/app/components/Chat/ChatValidationPanel.tsx +161 -0
- package/src/app/components/CloudFeatureGate.tsx +27 -0
- package/src/app/components/Component/BestPracticesCard.tsx +36 -0
- package/src/app/components/Component/Cards.tsx +76 -0
- package/src/app/components/Component/ComponentLists.tsx +279 -0
- package/src/app/components/Component/ComponentWorkbenchDialog.tsx +230 -0
- package/src/app/components/Component/InlineComponentEditor.tsx +163 -0
- package/src/app/components/Component/PageSliceResolver.tsx +81 -0
- package/src/app/components/Component/Preview.tsx +1091 -0
- package/src/app/components/Component/slices/BestPracticesSlice.tsx +14 -0
- package/src/app/components/Component/slices/CardsSlice.tsx +17 -0
- package/src/app/components/Component/slices/ComponentDisplaySlice.tsx +101 -0
- package/src/app/components/Component/slices/PropertiesSlice.tsx +24 -0
- package/src/app/components/Component/slices/TextSlice.tsx +23 -0
- package/src/app/components/Component/slices/ValidationResultsSlice.tsx +31 -0
- package/src/app/components/Component/slices/index.ts +14 -0
- package/src/app/components/Component/usePreviews.ts +97 -0
- package/src/app/components/ComponentDesignTokens.tsx +271 -0
- package/src/app/components/ComponentGuidelines.tsx +21 -0
- package/src/app/components/ComponentNotFound.tsx +35 -0
- package/src/app/components/ComponentSearch.tsx +96 -0
- package/src/app/components/CopyCode.tsx +59 -0
- package/src/app/components/CopyToClipboard.tsx +63 -0
- package/src/app/components/Design/DevHandoffPanel.tsx +481 -0
- package/src/app/components/DownloadTokens.tsx +78 -0
- package/src/app/components/Footer.tsx +46 -0
- package/src/app/components/Foundations/BrandColorSwatches.tsx +151 -0
- package/src/app/components/Foundations/ColorContrast.tsx +179 -0
- package/src/app/components/Foundations/ColorGrid.tsx +199 -0
- package/src/app/components/Foundations/ColorInfo.tsx +64 -0
- package/src/app/components/Foundations/ColorSpaces.tsx +119 -0
- package/src/app/components/Foundations/ColorTailwind.tsx +58 -0
- package/src/app/components/Foundations/ColorsDisplay.tsx +136 -0
- package/src/app/components/Foundations/DisplayLogo.tsx +16 -0
- package/src/app/components/Foundations/IconCatalogGrid.tsx +145 -0
- package/src/app/components/Foundations/ProvenanceBadge.tsx +40 -0
- package/src/app/components/Foundations/RulesSheet.tsx +204 -0
- package/src/app/components/Foundations/TokenOutputTabs.tsx +88 -0
- package/src/app/components/Foundations/TypographyExample.tsx +275 -0
- package/src/app/components/Guest/GuestAuthoring.tsx +589 -0
- package/src/app/components/Guest/GuestEditor.tsx +157 -0
- package/src/app/components/Hero.tsx +42 -0
- package/src/app/components/InlineEdit/InlineEditField.tsx +162 -0
- package/src/app/components/InlineEdit/InlineEditHeader.tsx +98 -0
- package/src/app/components/Layout/BuildBadge.tsx +90 -0
- package/src/app/components/Layout/Header.tsx +54 -0
- package/src/app/components/Layout/Main.tsx +84 -0
- package/src/app/components/Markdown/CodeHighlight.tsx +328 -0
- package/src/app/components/Markdown/MarkdownComponents.tsx +270 -0
- package/src/app/components/Markdown/MarkdownEditor.tsx +153 -0
- package/src/app/components/Markdown/WysiwygEditor.tsx +364 -0
- package/src/app/components/Markdown/wysiwyg.css +89 -0
- package/src/app/components/ModeSwitcher.tsx +29 -0
- package/src/app/components/NavLink.tsx +26 -0
- package/src/app/components/Navigation/AnchorNav.tsx +94 -0
- package/src/app/components/Navigation/AnchorNavLink.tsx +41 -0
- package/src/app/components/Navigation/AnchorNavNew.tsx +27 -0
- package/src/app/components/Navigation/MainNav.tsx +84 -0
- package/src/app/components/Navigation/MobileNav.tsx +123 -0
- package/src/app/components/Navigation/PrevNextNav.tsx +53 -0
- package/src/app/components/Navigation/SideNav.tsx +336 -0
- package/src/app/components/Navigation/anchor-slugify.ts +6 -0
- package/src/app/components/Playground/AiChatPanel.tsx +1483 -0
- package/src/app/components/Playground/ComponentCard.tsx +65 -0
- package/src/app/components/Playground/ComponentLibrary.tsx +228 -0
- package/src/app/components/Playground/CoverImagePicker.tsx +281 -0
- package/src/app/components/Playground/EditContext.tsx +247 -0
- package/src/app/components/Playground/EditSheet.tsx +82 -0
- package/src/app/components/Playground/FieldGuardrailsContext.ts +31 -0
- package/src/app/components/Playground/FieldLinkContext.ts +138 -0
- package/src/app/components/Playground/FieldMediaContext.ts +50 -0
- package/src/app/components/Playground/FindingsList.tsx +149 -0
- package/src/app/components/Playground/MediaBrowser.tsx +397 -0
- package/src/app/components/Playground/PageChecks.tsx +71 -0
- package/src/app/components/Playground/PageTitle.tsx +93 -0
- package/src/app/components/Playground/PlaygroundBuilder.tsx +1271 -0
- package/src/app/components/Playground/PlaygroundContext.tsx +990 -0
- package/src/app/components/Playground/PlaygroundWorkbench.tsx +260 -0
- package/src/app/components/Playground/Preview.tsx +1465 -0
- package/src/app/components/Playground/PublishToSanityDialog.tsx +468 -0
- package/src/app/components/Playground/SavePatternDialog.tsx +231 -0
- package/src/app/components/Playground/ShareTemplate.tsx +503 -0
- package/src/app/components/Playground/SortableItem.tsx +94 -0
- package/src/app/components/Playground/Wizard/ApiKeySettings.tsx +139 -0
- package/src/app/components/Playground/Wizard/PageImporter.tsx +384 -0
- package/src/app/components/Playground/Wizard/WizardDialog.tsx +329 -0
- package/src/app/components/Playground/Wizard/llm-client.ts +87 -0
- package/src/app/components/Playground/Wizard/prompt-builder.ts +134 -0
- package/src/app/components/Playground/Wizard/response-parser.ts +80 -0
- package/src/app/components/Playground/fields/ButtonField.tsx +24 -0
- package/src/app/components/Playground/fields/Field.tsx +344 -0
- package/src/app/components/Playground/fields/FieldLabel.tsx +9 -0
- package/src/app/components/Playground/fields/FunctionField.tsx +19 -0
- package/src/app/components/Playground/fields/ImageField.tsx +239 -0
- package/src/app/components/Playground/fields/LinkField.tsx +24 -0
- package/src/app/components/Playground/fields/RawJsonField.tsx +60 -0
- package/src/app/components/Playground/fields/RichTextField.tsx +220 -0
- package/src/app/components/Playground/fields/SelectField.tsx +55 -0
- package/src/app/components/Playground/fields/SlotField.tsx +40 -0
- package/src/app/components/Playground/fields/TextField.tsx +125 -0
- package/src/app/components/Playground/fields/VideoFileField.tsx +67 -0
- package/src/app/components/Playground/fields/content-only.ts +121 -0
- package/src/app/components/Playground/fields/field-type.ts +84 -0
- package/src/app/components/Playground/fields/reseed.ts +140 -0
- package/src/app/components/Playground/inline-edit-script.ts +596 -0
- package/src/app/components/Playground/link-guard-script.ts +50 -0
- package/src/app/components/Playground/types.ts +76 -0
- package/src/app/components/Playground/usePublishToSanity.ts +153 -0
- package/src/app/components/Review/ReviewQueueClient.tsx +288 -0
- package/src/app/components/SideNav/Custom.tsx +40 -0
- package/src/app/components/SideNavNew.tsx +280 -0
- package/src/app/components/Typography/Headers.tsx +50 -0
- package/src/app/components/Validation/ValidationFrameworkResults.tsx +208 -0
- package/src/app/components/Validation/ValidationResults.tsx +60 -0
- package/src/app/components/cards/CardsWithIcons.tsx +38 -0
- package/src/app/components/context/AuthUiContext.tsx +13 -0
- package/src/app/components/context/ConfigContext.tsx +43 -0
- package/src/app/components/context/HandoffCapabilitiesContext.tsx +40 -0
- package/src/app/components/context/HotReloadProvider.tsx +38 -0
- package/src/app/components/context/PreviewContext.tsx +135 -0
- package/src/app/components/library/AssetCard.tsx +166 -0
- package/src/app/components/library/KindPicker.tsx +66 -0
- package/src/app/components/library/LaneTabs.tsx +54 -0
- package/src/app/components/library/LifecycleBadge.tsx +28 -0
- package/src/app/components/library/LifecyclePicker.tsx +53 -0
- package/src/app/components/library/MetaControl.tsx +294 -0
- package/src/app/components/library/OwnerAttribution.tsx +106 -0
- package/src/app/components/library/PageNotes.tsx +191 -0
- package/src/app/components/library/PageOrigin.tsx +124 -0
- package/src/app/components/library/VisibilityBadge.tsx +25 -0
- package/src/app/components/library/VisibilityPicker.tsx +56 -0
- package/src/app/components/library/index.ts +7 -0
- package/src/app/components/ui/accordion.tsx +49 -0
- package/src/app/components/ui/alert.tsx +39 -0
- package/src/app/components/ui/attachment.tsx +204 -0
- package/src/app/components/ui/badge.tsx +32 -0
- package/src/app/components/ui/breadcrumb.tsx +68 -0
- package/src/app/components/ui/bubble.tsx +125 -0
- package/src/app/components/ui/button.tsx +45 -0
- package/src/app/components/ui/card.tsx +76 -0
- package/src/app/components/ui/collapsible.tsx +9 -0
- package/src/app/components/ui/dialog.tsx +80 -0
- package/src/app/components/ui/drawer.tsx +103 -0
- package/src/app/components/ui/dropdown-menu.tsx +176 -0
- package/src/app/components/ui/input.tsx +22 -0
- package/src/app/components/ui/json-tree-view.tsx +250 -0
- package/src/app/components/ui/label.tsx +24 -0
- package/src/app/components/ui/marker.tsx +69 -0
- package/src/app/components/ui/message-scroller.tsx +130 -0
- package/src/app/components/ui/message.tsx +92 -0
- package/src/app/components/ui/mobile-nav.tsx +95 -0
- package/src/app/components/ui/navigation-menu.tsx +116 -0
- package/src/app/components/ui/popover.tsx +31 -0
- package/src/app/components/ui/radio-group.tsx +36 -0
- package/src/app/components/ui/select.tsx +132 -0
- package/src/app/components/ui/separator.tsx +29 -0
- package/src/app/components/ui/sheet.tsx +140 -0
- package/src/app/components/ui/sidebar.tsx +609 -0
- package/src/app/components/ui/skeleton.tsx +15 -0
- package/src/app/components/ui/switch.tsx +29 -0
- package/src/app/components/ui/table.tsx +60 -0
- package/src/app/components/ui/tabs.tsx +53 -0
- package/src/app/components/ui/textarea.tsx +19 -0
- package/src/app/components/ui/toggle-group.tsx +51 -0
- package/src/app/components/ui/toggle.tsx +39 -0
- package/src/app/components/ui/tooltip.tsx +30 -0
- package/src/app/components/util/colors.ts +93 -0
- package/src/app/components/util/dtcg.ts +50 -0
- package/src/app/components/util/index.ts +963 -0
- package/src/app/components/util/theme-provider.tsx +11 -0
- package/src/app/components/util/token.ts +70 -0
- package/src/app/components.json +21 -0
- package/src/app/css/index.css +275 -0
- package/src/app/css/theme.css +14 -0
- package/src/app/css.d.ts +1 -0
- package/src/app/hooks/use-mobile.tsx +17 -0
- package/src/app/instrumentation.ts +39 -0
- package/src/app/lib/adapter-kit/errors.ts +141 -0
- package/src/app/lib/adapter-kit/types.ts +637 -0
- package/src/app/lib/admin-build-tasks-types.ts +41 -0
- package/src/app/lib/api-path.ts +12 -0
- package/src/app/lib/asset-search.ts +167 -0
- package/src/app/lib/asset-types.ts +88 -0
- package/src/app/lib/asset-upload-source.ts +314 -0
- package/src/app/lib/auth.ts +244 -0
- package/src/app/lib/authoring-guardrails.ts +591 -0
- package/src/app/lib/authoring-shapes.ts +261 -0
- package/src/app/lib/authz/guest.ts +131 -0
- package/src/app/lib/authz/notes.ts +102 -0
- package/src/app/lib/authz/policy.ts +228 -0
- package/src/app/lib/authz/review.ts +180 -0
- package/src/app/lib/authz/vocab.ts +175 -0
- package/src/app/lib/brief-components.ts +212 -0
- package/src/app/lib/build-audits.ts +239 -0
- package/src/app/lib/capture-chromium-plan.ts +123 -0
- package/src/app/lib/capture-determinism.ts +397 -0
- package/src/app/lib/capture-kinds.ts +207 -0
- package/src/app/lib/change-digest.ts +108 -0
- package/src/app/lib/chat-turn-guards.ts +149 -0
- package/src/app/lib/cli-sync-jwt.ts +110 -0
- package/src/app/lib/client/poll-generation-job.ts +85 -0
- package/src/app/lib/client-name.ts +29 -0
- package/src/app/lib/cms-migration-prompt.ts +99 -0
- package/src/app/lib/component-capture.ts +156 -0
- package/src/app/lib/component-id.ts +14 -0
- package/src/app/lib/component-thumbnail.ts +200 -0
- package/src/app/lib/composition-summary.ts +84 -0
- package/src/app/lib/content-length-plan.ts +512 -0
- package/src/app/lib/contract-limit-audit.ts +228 -0
- package/src/app/lib/contract-render-audit.ts +208 -0
- package/src/app/lib/data/component-row.ts +121 -0
- package/src/app/lib/data/components-digest.ts +116 -0
- package/src/app/lib/data/dynamic-provider.ts +765 -0
- package/src/app/lib/data/has-payload.ts +18 -0
- package/src/app/lib/data/hybrid-provider.ts +6 -0
- package/src/app/lib/data/index.ts +45 -0
- package/src/app/lib/data/menu-merge.ts +417 -0
- package/src/app/lib/data/page-metadata.ts +85 -0
- package/src/app/lib/data/pattern-merge.ts +78 -0
- package/src/app/lib/data/static-provider.ts +237 -0
- package/src/app/lib/data/types.ts +125 -0
- package/src/app/lib/db/auto-migrate.ts +205 -0
- package/src/app/lib/db/bootstrap-admin.ts +45 -0
- package/src/app/lib/db/capture-job-queries.ts +333 -0
- package/src/app/lib/db/changelog-queries.ts +623 -0
- package/src/app/lib/db/cms-connection-config.ts +21 -0
- package/src/app/lib/db/cms-connection-queries.ts +218 -0
- package/src/app/lib/db/component-artifact-queries.ts +115 -0
- package/src/app/lib/db/component-facets.ts +535 -0
- package/src/app/lib/db/component-preview-queries.ts +224 -0
- package/src/app/lib/db/component-version-queries.ts +682 -0
- package/src/app/lib/db/dialect.ts +15 -0
- package/src/app/lib/db/event-log-store.ts +47 -0
- package/src/app/lib/db/grant-queries.ts +827 -0
- package/src/app/lib/db/history-purge-plan.ts +446 -0
- package/src/app/lib/db/history-purge.ts +233 -0
- package/src/app/lib/db/index.ts +92 -0
- package/src/app/lib/db/migrations/0000_init.sql +226 -0
- package/src/app/lib/db/migrations/0001_design_workspace.sql +12 -0
- package/src/app/lib/db/migrations/0002_boring_ricochet.sql +50 -0
- package/src/app/lib/db/migrations/0003_demonic_flatman.sql +41 -0
- package/src/app/lib/db/migrations/0004_validation_runs.sql +18 -0
- package/src/app/lib/db/migrations/0005_component_versions.sql +21 -0
- package/src/app/lib/db/migrations/0006_token_and_page_changes.sql +40 -0
- package/src/app/lib/db/migrations/0007_design_spec.sql +9 -0
- package/src/app/lib/db/migrations/0008_design_generation_jobs.sql +22 -0
- package/src/app/lib/db/migrations/0009_assets.sql +80 -0
- package/src/app/lib/db/migrations/0010_registry_dtcg.sql +13 -0
- package/src/app/lib/db/migrations/0011_dtcg_brands.sql +5 -0
- package/src/app/lib/db/migrations/0012_icon_logo_registry.sql +13 -0
- package/src/app/lib/db/migrations/0013_registry_fonts.sql +13 -0
- package/src/app/lib/db/migrations/0014_asset_blobs.sql +9 -0
- package/src/app/lib/db/migrations/0015_appearance.sql +7 -0
- package/src/app/lib/db/migrations/0016_image_slots.sql +16 -0
- package/src/app/lib/db/migrations/0017_component_preview.sql +20 -0
- package/src/app/lib/db/migrations/0018_token_change_details.sql +26 -0
- package/src/app/lib/db/migrations/0019_change_why.sql +18 -0
- package/src/app/lib/db/migrations/0020_pattern_change.sql +17 -0
- package/src/app/lib/db/migrations/0021_mcp_oauth_connector.sql +37 -0
- package/src/app/lib/db/migrations/0022_dtcg_source.sql +21 -0
- package/src/app/lib/db/migrations/0023_perf_indexes.sql +30 -0
- package/src/app/lib/db/migrations/0024_phase_b_visibility.sql +40 -0
- package/src/app/lib/db/migrations/0027_guest_authoring.sql +49 -0
- package/src/app/lib/db/migrations/0028_invite_to_build.sql +99 -0
- package/src/app/lib/db/migrations/0029_pages_templates_reflow.sql +121 -0
- package/src/app/lib/db/migrations/0030_retire_briefs.sql +71 -0
- package/src/app/lib/db/migrations/0031_drop_brief_columns.sql +32 -0
- package/src/app/lib/db/migrations/0033_site_protection.sql +45 -0
- package/src/app/lib/db/migrations/0034_brand_imagery.sql +8 -0
- package/src/app/lib/db/migrations/0035_history_provenance.sql +42 -0
- package/src/app/lib/db/migrations/0036_cms_connections.sql +68 -0
- package/src/app/lib/db/migrations/0037_component_preview_purpose.sql +17 -0
- package/src/app/lib/db/migrations/0038_capture_job.sql +87 -0
- package/src/app/lib/db/migrations/meta/0000_snapshot.json +1424 -0
- package/src/app/lib/db/migrations/meta/0002_snapshot.json +1644 -0
- package/src/app/lib/db/migrations/meta/0003_snapshot.json +1820 -0
- package/src/app/lib/db/migrations/meta/_journal.json +258 -0
- package/src/app/lib/db/note-queries.ts +184 -0
- package/src/app/lib/db/pattern-write.ts +1094 -0
- package/src/app/lib/db/property-delta.ts +117 -0
- package/src/app/lib/db/push-grouping.ts +256 -0
- package/src/app/lib/db/queries.ts +2426 -0
- package/src/app/lib/db/registry-queries.ts +607 -0
- package/src/app/lib/db/schema-active.ts +2 -0
- package/src/app/lib/db/schema-pg.ts +1201 -0
- package/src/app/lib/db/schema.ts +2 -0
- package/src/app/lib/db/seed.ts +117 -0
- package/src/app/lib/db/sync-queries.ts +542 -0
- package/src/app/lib/db/token-flatten.ts +95 -0
- package/src/app/lib/db/validation-queries.ts +82 -0
- package/src/app/lib/db/version-baseline.ts +42 -0
- package/src/app/lib/design-workspace-client.ts +194 -0
- package/src/app/lib/design-workspace-format.ts +294 -0
- package/src/app/lib/docx-copy.ts +279 -0
- package/src/app/lib/dtcg-axes.ts +138 -0
- package/src/app/lib/dtcg-normalizer.ts +370 -0
- package/src/app/lib/edit-operations.ts +275 -0
- package/src/app/lib/email.ts +199 -0
- package/src/app/lib/error-summary.ts +79 -0
- package/src/app/lib/evals/cases.ts +678 -0
- package/src/app/lib/evals/copy-coverage.ts +147 -0
- package/src/app/lib/evals/copy-decks.ts +296 -0
- package/src/app/lib/field-lens.ts +308 -0
- package/src/app/lib/field-marks.ts +206 -0
- package/src/app/lib/figma-plugin-contract.ts +104 -0
- package/src/app/lib/figma-sync-types.ts +56 -0
- package/src/app/lib/generated/build-meta.ts +8 -0
- package/src/app/lib/guest-editable.ts +371 -0
- package/src/app/lib/handoff-capabilities.ts +91 -0
- package/src/app/lib/health-types.ts +324 -0
- package/src/app/lib/hubspot-field-map.ts +770 -0
- package/src/app/lib/hubspot-module/build-module.ts +238 -0
- package/src/app/lib/hubspot-module/context.ts +259 -0
- package/src/app/lib/hubspot-module/fields/boolean.ts +24 -0
- package/src/app/lib/hubspot-module/fields/button.ts +70 -0
- package/src/app/lib/hubspot-module/fields/fields.ts +104 -0
- package/src/app/lib/hubspot-module/fields/generic.ts +183 -0
- package/src/app/lib/hubspot-module/fields/hubdb.ts +168 -0
- package/src/app/lib/hubspot-module/fields/image.ts +65 -0
- package/src/app/lib/hubspot-module/fields/menu.ts +14 -0
- package/src/app/lib/hubspot-module/fields/object.ts +42 -0
- package/src/app/lib/hubspot-module/fields/select.ts +43 -0
- package/src/app/lib/hubspot-module/fields/text.ts +68 -0
- package/src/app/lib/hubspot-module/fields/url.ts +57 -0
- package/src/app/lib/hubspot-module/fields/utils.ts +36 -0
- package/src/app/lib/hubspot-module/fields/video.ts +75 -0
- package/src/app/lib/hubspot-module/index.ts +30 -0
- package/src/app/lib/hubspot-module/transpile.ts +727 -0
- package/src/app/lib/hubspot-module/types.ts +238 -0
- package/src/app/lib/hubspot-module-build.ts +50 -0
- package/src/app/lib/image-bytes.ts +133 -0
- package/src/app/lib/image-dimensions.ts +214 -0
- package/src/app/lib/image-field-write.ts +51 -0
- package/src/app/lib/image-generation-request.ts +142 -0
- package/src/app/lib/image-target.ts +175 -0
- package/src/app/lib/json-shape.ts +121 -0
- package/src/app/lib/library-image-seed.ts +236 -0
- package/src/app/lib/login-required-messages.ts +17 -0
- package/src/app/lib/mcp/apps/component-gallery.bundle.ts +2 -0
- package/src/app/lib/mcp/apps/component-gallery.client.ts +208 -0
- package/src/app/lib/mcp/apps/component-preview.bundle.ts +2 -0
- package/src/app/lib/mcp/apps/component-preview.client.ts +140 -0
- package/src/app/lib/mcp/apps/token-palette.bundle.ts +2 -0
- package/src/app/lib/mcp/apps/token-palette.client.ts +199 -0
- package/src/app/lib/mcp/contract-report.ts +200 -0
- package/src/app/lib/mcp/create-server.ts +2622 -0
- package/src/app/lib/mcp/history-shapes.ts +72 -0
- package/src/app/lib/mcp/project-profile.ts +82 -0
- package/src/app/lib/mcp/scaffold-helpers.ts +93 -0
- package/src/app/lib/mcp/stack-guides/bootstrap-handlebars.md +62 -0
- package/src/app/lib/mcp/stack-guides/react-scss.md +7 -0
- package/src/app/lib/mcp/stack-guides/react-tailwind.md +9 -0
- package/src/app/lib/mcp/stack-guides/tailwind-handlebars.md +142 -0
- package/src/app/lib/mcp/stack-guides.ts +68 -0
- package/src/app/lib/mcp/tool-catalog.ts +132 -0
- package/src/app/lib/mcp-auth.ts +85 -0
- package/src/app/lib/merge-block-values.ts +868 -0
- package/src/app/lib/normalize-preview-values.ts +244 -0
- package/src/app/lib/notify.ts +213 -0
- package/src/app/lib/oauth-scopes.ts +33 -0
- package/src/app/lib/page-exemplars.ts +112 -0
- package/src/app/lib/page-manifest.ts +162 -0
- package/src/app/lib/page-provenance.ts +231 -0
- package/src/app/lib/page-slug.ts +68 -0
- package/src/app/lib/page-title.ts +44 -0
- package/src/app/lib/page-urls.ts +41 -0
- package/src/app/lib/passwords.ts +33 -0
- package/src/app/lib/pattern-payload.ts +122 -0
- package/src/app/lib/pattern-thumbnail.ts +234 -0
- package/src/app/lib/placeholder-audit.ts +196 -0
- package/src/app/lib/placeholder-copy.ts +370 -0
- package/src/app/lib/playground-prompt-link.ts +46 -0
- package/src/app/lib/preview-groups.ts +107 -0
- package/src/app/lib/preview-purpose-labels.ts +37 -0
- package/src/app/lib/preview-purpose.ts +37 -0
- package/src/app/lib/preview-render-target.ts +27 -0
- package/src/app/lib/preview-url.ts +15 -0
- package/src/app/lib/publish-to-sanity-state.ts +605 -0
- package/src/app/lib/rate-limit.ts +75 -0
- package/src/app/lib/remote-handoff-client.ts +33 -0
- package/src/app/lib/sanity-assets.ts +211 -0
- package/src/app/lib/sanity-categories.ts +178 -0
- package/src/app/lib/sanity-config.ts +266 -0
- package/src/app/lib/sanity-integration-state.ts +235 -0
- package/src/app/lib/sanity-mapping.ts +3284 -0
- package/src/app/lib/sanity-portable-text.ts +640 -0
- package/src/app/lib/sanity-publish.ts +337 -0
- package/src/app/lib/sanity-references.ts +295 -0
- package/src/app/lib/server/admin-users.ts +162 -0
- package/src/app/lib/server/ai-client.ts +633 -0
- package/src/app/lib/server/ai-proxy.ts +70 -0
- package/src/app/lib/server/api-gate.ts +148 -0
- package/src/app/lib/server/appearance.ts +169 -0
- package/src/app/lib/server/asset-generation-worker.ts +133 -0
- package/src/app/lib/server/asset-ingest-store.ts +55 -0
- package/src/app/lib/server/asset-ingest.ts +347 -0
- package/src/app/lib/server/auth-reset.ts +107 -0
- package/src/app/lib/server/capture-browser.ts +130 -0
- package/src/app/lib/server/capture-harness.ts +319 -0
- package/src/app/lib/server/capture-worker.ts +178 -0
- package/src/app/lib/server/change-why.ts +195 -0
- package/src/app/lib/server/cli-device-oauth.ts +159 -0
- package/src/app/lib/server/cms-providers.ts +53 -0
- package/src/app/lib/server/component-build-preload.cjs +3 -0
- package/src/app/lib/server/component-build-worker.ts +196 -0
- package/src/app/lib/server/component-builder.ts +96 -0
- package/src/app/lib/server/component-capture-reads.ts +172 -0
- package/src/app/lib/server/component-generation-context.ts +165 -0
- package/src/app/lib/server/component-generation-images.ts +40 -0
- package/src/app/lib/server/component-generation-llm.ts +232 -0
- package/src/app/lib/server/component-generation-run.ts +289 -0
- package/src/app/lib/server/component-generation-schedule.ts +12 -0
- package/src/app/lib/server/component-preview-screenshot.ts +111 -0
- package/src/app/lib/server/component-scaffold.ts +88 -0
- package/src/app/lib/server/component-visual-compare.ts +90 -0
- package/src/app/lib/server/design-artifact-persist.ts +49 -0
- package/src/app/lib/server/design-asset-extractor.ts +414 -0
- package/src/app/lib/server/design-asset-schedule.ts +36 -0
- package/src/app/lib/server/design-asset-worker-spawn.ts +64 -0
- package/src/app/lib/server/design-asset-worker.ts +24 -0
- package/src/app/lib/server/design-generation-worker.ts +281 -0
- package/src/app/lib/server/design-prompt-builder.ts +322 -0
- package/src/app/lib/server/design-spec-generator.ts +739 -0
- package/src/app/lib/server/design-spec-types.ts +219 -0
- package/src/app/lib/server/design-system-context.ts +141 -0
- package/src/app/lib/server/design-token-summary.ts +133 -0
- package/src/app/lib/server/design-workspace.ts +230 -0
- package/src/app/lib/server/dev-handoff.ts +334 -0
- package/src/app/lib/server/doc-pages.ts +442 -0
- package/src/app/lib/server/event-log.ts +138 -0
- package/src/app/lib/server/fetch-asset-bytes.ts +161 -0
- package/src/app/lib/server/figma-audit-api.ts +188 -0
- package/src/app/lib/server/figma-auth.ts +113 -0
- package/src/app/lib/server/figma-fetch-runner.ts +241 -0
- package/src/app/lib/server/figma-fetch-worker.ts +130 -0
- package/src/app/lib/server/figma-fetch.ts +90 -0
- package/src/app/lib/server/figma-fills-ingest.ts +201 -0
- package/src/app/lib/server/figma-plugin-properties-sync.ts +438 -0
- package/src/app/lib/server/figma-sync-service.ts +1076 -0
- package/src/app/lib/server/find-assets.ts +53 -0
- package/src/app/lib/server/foundation-image.tsx +671 -0
- package/src/app/lib/server/generation-queue-health.ts +108 -0
- package/src/app/lib/server/guest-context.ts +62 -0
- package/src/app/lib/server/guest-session.ts +153 -0
- package/src/app/lib/server/handoff-app-paths.ts +77 -0
- package/src/app/lib/server/handoff-component-patch.ts +123 -0
- package/src/app/lib/server/handoff-config-load.ts +29 -0
- package/src/app/lib/server/handoff-config-project.ts +104 -0
- package/src/app/lib/server/mcp-oauth-connector.ts +269 -0
- package/src/app/lib/server/node-tsx-worker-launcher.cjs +32 -0
- package/src/app/lib/server/oauth-state.ts +83 -0
- package/src/app/lib/server/passphrase.ts +121 -0
- package/src/app/lib/server/pattern-api-map.ts +123 -0
- package/src/app/lib/server/playground-chat.ts +1890 -0
- package/src/app/lib/server/public-api-paths.ts +34 -0
- package/src/app/lib/server/reference-material-generator.ts +341 -0
- package/src/app/lib/server/reference-material-ids.ts +8 -0
- package/src/app/lib/server/reference-material-persist.ts +25 -0
- package/src/app/lib/server/reference-material-schedule.ts +13 -0
- package/src/app/lib/server/registry-cache.ts +110 -0
- package/src/app/lib/server/request-public-url.ts +19 -0
- package/src/app/lib/server/runtime-config.ts +43 -0
- package/src/app/lib/server/s3-assets.ts +188 -0
- package/src/app/lib/server/sanity-connection.ts +176 -0
- package/src/app/lib/server/sanity-oauth.ts +34 -0
- package/src/app/lib/server/scaffold-args.ts +392 -0
- package/src/app/lib/server/secret-box.ts +85 -0
- package/src/app/lib/server/serverless-chromium.ts +93 -0
- package/src/app/lib/server/share-link-token.ts +106 -0
- package/src/app/lib/server/site-protection.ts +145 -0
- package/src/app/lib/server/spawn-tsx-worker.ts +47 -0
- package/src/app/lib/server/store-image-asset.ts +220 -0
- package/src/app/lib/server/token-freshness.ts +23 -0
- package/src/app/lib/server/unlock-cookie.ts +70 -0
- package/src/app/lib/server/upload-asset-to-library.ts +128 -0
- package/src/app/lib/server/url-extract.ts +117 -0
- package/src/app/lib/server/voice-audit.ts +209 -0
- package/src/app/lib/set-at-args-path.ts +36 -0
- package/src/app/lib/site-gate.ts +374 -0
- package/src/app/lib/slot-capabilities.ts +487 -0
- package/src/app/lib/source-copy.ts +295 -0
- package/src/app/lib/storage/artifact-images.ts +225 -0
- package/src/app/lib/storage/capture-artifacts.ts +109 -0
- package/src/app/lib/swap-image-src.ts +121 -0
- package/src/app/lib/sync-auth.ts +124 -0
- package/src/app/lib/tool-payload.ts +101 -0
- package/src/app/lib/turn-log.ts +78 -0
- package/src/app/lib/url-safety.ts +46 -0
- package/src/app/lib/utils.ts +35 -0
- package/src/app/lib/workbench-level.ts +56 -0
- package/src/app/middleware-hook.mjs +2 -0
- package/src/app/next-env.d.ts +6 -0
- package/src/app/next.config.mjs +355 -0
- package/src/app/postcss.config.mjs +8 -0
- package/src/app/proxy.ts +133 -0
- package/src/app/public/assets/css/preview.css +27 -0
- package/src/app/public/assets/design/blocks/callout-cta.jpg +0 -0
- package/src/app/public/assets/design/blocks/carousel.png +0 -0
- package/src/app/public/assets/design/blocks/container.png +0 -0
- package/src/app/public/assets/design/blocks/customer-stories.jpg +0 -0
- package/src/app/public/assets/design/blocks/faq.jpg +0 -0
- package/src/app/public/assets/design/blocks/features-comparison.jpg +0 -0
- package/src/app/public/assets/design/blocks/table.jpg +0 -0
- package/src/app/public/assets/images/blocks.svg +150 -0
- package/src/app/public/assets/images/check-circle.svg +10 -0
- package/src/app/public/assets/images/colors.svg +186 -0
- package/src/app/public/assets/images/components.png +0 -0
- package/src/app/public/assets/images/components.svg +183 -0
- package/src/app/public/assets/images/illustration-sample-2.svg +102 -0
- package/src/app/public/assets/images/illustration-sample-3.svg +124 -0
- package/src/app/public/assets/images/illustration-sample-bw-1.svg +84 -0
- package/src/app/public/assets/images/illustration-sample-bw-2.svg +88 -0
- package/src/app/public/assets/images/illustration-sample-bw-3.svg +125 -0
- package/src/app/public/assets/images/illustration-sample.svg +110 -0
- package/src/app/public/assets/images/typography.svg +279 -0
- package/src/app/public/assets/images/usage-correct.png +0 -0
- package/src/app/public/assets/images/usage-wrong.png +0 -0
- package/src/app/public/assets/images/x-circle.svg +10 -0
- package/src/app/public/assets/js/preview.js +90 -0
- package/src/app/public/assets/svg/activity.svg +1 -0
- package/src/app/public/assets/svg/add.svg +1 -0
- package/src/app/public/assets/svg/airplay.svg +1 -0
- package/src/app/public/assets/svg/alert-circle.svg +1 -0
- package/src/app/public/assets/svg/alert-octagon.svg +1 -0
- package/src/app/public/assets/svg/alert-triangle.svg +1 -0
- package/src/app/public/assets/svg/align-center.svg +1 -0
- package/src/app/public/assets/svg/align-justify.svg +1 -0
- package/src/app/public/assets/svg/align-left.svg +1 -0
- package/src/app/public/assets/svg/arrow-down-circle.svg +1 -0
- package/src/app/public/assets/svg/arrow-left-circle.svg +1 -0
- package/src/app/public/assets/svg/arrow-right-circle.svg +1 -0
- package/src/app/public/assets/svg/arrow-right.svg +4 -0
- package/src/app/public/assets/svg/arrow-up-circle.svg +1 -0
- package/src/app/public/assets/svg/bell-off.svg +1 -0
- package/src/app/public/assets/svg/bell.svg +1 -0
- package/src/app/public/assets/svg/camera.svg +1 -0
- package/src/app/public/assets/svg/cast.svg +1 -0
- package/src/app/public/assets/svg/check.svg +1 -0
- package/src/app/public/assets/svg/clock.svg +1 -0
- package/src/app/public/assets/svg/code.svg +1 -0
- package/src/app/public/assets/svg/component-accordion.svg +56 -0
- package/src/app/public/assets/svg/component-alert.svg +34 -0
- package/src/app/public/assets/svg/component-button.svg +63 -0
- package/src/app/public/assets/svg/component-checkbox.svg +41 -0
- package/src/app/public/assets/svg/component-input.svg +30 -0
- package/src/app/public/assets/svg/component-modal.svg +63 -0
- package/src/app/public/assets/svg/component-pagination.svg +82 -0
- package/src/app/public/assets/svg/component-radio.svg +15 -0
- package/src/app/public/assets/svg/component-select.svg +48 -0
- package/src/app/public/assets/svg/component-switch.svg +6 -0
- package/src/app/public/assets/svg/component-table.svg +45 -0
- package/src/app/public/assets/svg/component-tabs.svg +34 -0
- package/src/app/public/assets/svg/component-tooltip.svg +60 -0
- package/src/app/public/assets/svg/component.svg +48 -0
- package/src/app/public/assets/svg/copy.svg +1 -0
- package/src/app/public/assets/svg/delivery.svg +1 -0
- package/src/app/public/assets/svg/download.svg +1 -0
- package/src/app/public/assets/svg/file-jpg.svg +20 -0
- package/src/app/public/assets/svg/file-svg.svg +31 -0
- package/src/app/public/assets/svg/file-zip.svg +24 -0
- package/src/app/public/assets/svg/hero-brand-assets.svg +44 -0
- package/src/app/public/assets/svg/hero-colors.svg +10 -0
- package/src/app/public/assets/svg/hero-components.svg +68 -0
- package/src/app/public/assets/svg/hero-design.svg +20 -0
- package/src/app/public/assets/svg/hero-effects.svg +1 -0
- package/src/app/public/assets/svg/illustration-sample.svg +82 -0
- package/src/app/public/assets/svg/image.svg +8 -0
- package/src/app/public/assets/svg/link.svg +1 -0
- package/src/app/public/assets/svg/logo.svg +8 -0
- package/src/app/public/assets/svg/moon.svg +1 -0
- package/src/app/public/assets/svg/motiv-logo-dark-example.svg +11 -0
- package/src/app/public/assets/svg/motiv-logo-example.svg +11 -0
- package/src/app/public/assets/svg/plus-circle.svg +1 -0
- package/src/app/public/assets/svg/react.svg +10 -0
- package/src/app/public/assets/svg/search-laptop.svg +20 -0
- package/src/app/public/assets/svg/search.svg +1 -0
- package/src/app/public/assets/svg/send.svg +10 -0
- package/src/app/public/assets/svg/share.svg +1 -0
- package/src/app/public/assets/svg/small-accordion.svg +9 -0
- package/src/app/public/assets/svg/small-button.svg +9 -0
- package/src/app/public/assets/svg/small-pagination.svg +14 -0
- package/src/app/public/assets/svg/small-radio.svg +15 -0
- package/src/app/public/assets/svg/small-select.svg +9 -0
- package/src/app/public/assets/svg/small-table.svg +16 -0
- package/src/app/public/assets/svg/small-toggle.svg +9 -0
- package/src/app/public/assets/svg/sun.svg +1 -0
- package/src/app/public/assets/svg/token-alignment.svg +5 -0
- package/src/app/public/assets/svg/token-border-radius.svg +3 -0
- package/src/app/public/assets/svg/token-border-width.svg +10 -0
- package/src/app/public/assets/svg/token-spacing-horizontal.svg +8 -0
- package/src/app/public/assets/svg/token-spacing-vertical.svg +8 -0
- package/src/app/public/assets/svg/token-type-small.svg +5 -0
- package/src/app/public/assets/svg/x.svg +1 -0
- package/src/app/public/assets/svg/zap.svg +1 -0
- package/src/app/public/favicon.ico +0 -0
- package/src/app/public/fonts/readme.md +4 -0
- package/src/app/public/handoff-logo.svg +38 -0
- package/src/app/public/logo.svg +13 -0
- package/src/app/public/openapi.yaml +1818 -0
- package/src/app/public/robots.txt +0 -0
- package/src/app/tsconfig.json +53 -0
- package/src/app/types/middleware-hook.d.ts +10 -0
- package/src/app/types/next-auth-augmentation.d.ts +20 -0
- package/src/app-builder/README.md +43 -0
- package/src/app-builder/build.ts +741 -0
- package/src/app-builder/client-config.ts +124 -0
- package/src/app-builder/config-diff/index.ts +4 -0
- package/src/app-builder/config-diff/registry.ts +23 -0
- package/src/app-builder/config-diff/snapshot.ts +51 -0
- package/src/app-builder/config-diff/strategies/pattern.ts +80 -0
- package/src/app-builder/config-diff/types.ts +36 -0
- package/src/app-builder/index.ts +7 -0
- package/src/app-builder/path-contract.ts +81 -0
- package/src/app-builder/paths.ts +90 -0
- package/src/app-builder/watchers/component.ts +72 -0
- package/src/app-builder/watchers/utils.ts +44 -0
- package/src/app-builder/watchers.ts +345 -0
- package/src/app-builder/websocket.ts +72 -0
- package/src/cache/README.md +49 -0
- package/src/cache/build-cache.ts +567 -0
- package/src/cache/file-state.ts +170 -0
- package/src/cache/index.ts +46 -0
- package/src/cache/push-state.ts +201 -0
- package/src/cli/README.md +12 -0
- package/src/cli/create.ts +366 -0
- package/src/cli/eject.ts +93 -0
- package/src/cli/fetch-design-md.ts +60 -0
- package/src/cli/figma-audit.ts +76 -0
- package/src/cli/init-claude-core.ts +111 -0
- package/src/cli/make.ts +203 -0
- package/src/cli/scaffold.ts +651 -0
- package/src/cli/sync/apply-declaration-pull.ts +257 -0
- package/src/cli/sync/apply-pull.ts +223 -0
- package/src/cli/sync/cli-auth-store.ts +51 -0
- package/src/cli/sync/collect-build-artifacts.ts +159 -0
- package/src/cli/sync/collect-referenced-images.ts +204 -0
- package/src/cli/sync/declaration-patch.ts +192 -0
- package/src/cli/sync/hash.ts +12 -0
- package/src/cli/sync/open-browser.ts +37 -0
- package/src/cli/sync/push-provenance.ts +109 -0
- package/src/cli/sync/push-registry-content.ts +1025 -0
- package/src/cli/sync/push-shared-assets.ts +62 -0
- package/src/cli/sync/resolve-declaration-payload.ts +231 -0
- package/src/cli/sync/resolve-declaration.ts +18 -0
- package/src/cli/sync/run-cli-login.ts +110 -0
- package/src/cli/sync/run-history-purge.ts +142 -0
- package/src/cli/sync/run-pull.ts +112 -0
- package/src/cli/sync/run-push.ts +702 -0
- package/src/cli/sync/run-sync-status.ts +37 -0
- package/src/cli/sync/sync-remote-env.ts +64 -0
- package/src/cli/sync/sync-state.ts +42 -0
- package/src/cli/tokens/ensure-default-brand.ts +115 -0
- package/src/cli/tokens/migrate-legacy.ts +261 -0
- package/src/cli/tokens/parse-css-brands.ts +208 -0
- package/src/cli/tokens/transform.ts +134 -0
- package/src/cli.ts +62 -0
- package/src/commands/README.md +25 -0
- package/src/commands/audit/figma-components.ts +37 -0
- package/src/commands/build/app.ts +32 -0
- package/src/commands/build/components.ts +25 -0
- package/src/commands/build/hubspot.ts +267 -0
- package/src/commands/dev/index.ts +20 -0
- package/src/commands/eject/config.ts +20 -0
- package/src/commands/eject/pages.ts +20 -0
- package/src/commands/eject/theme.ts +20 -0
- package/src/commands/fetch/index.ts +20 -0
- package/src/commands/history-purge.ts +67 -0
- package/src/commands/index.ts +67 -0
- package/src/commands/init/index.ts +17 -0
- package/src/commands/init/vercel.ts +112 -0
- package/src/commands/init-claude.ts +61 -0
- package/src/commands/login.ts +39 -0
- package/src/commands/logout.ts +22 -0
- package/src/commands/make/component.ts +34 -0
- package/src/commands/make/page.ts +47 -0
- package/src/commands/make/template.ts +47 -0
- package/src/commands/mcp-init.ts +111 -0
- package/src/commands/mcp-token.ts +32 -0
- package/src/commands/prepare-runtime.ts +39 -0
- package/src/commands/pull.ts +28 -0
- package/src/commands/push-all.ts +202 -0
- package/src/commands/push-assets.ts +52 -0
- package/src/commands/push-tokens.ts +52 -0
- package/src/commands/push.ts +91 -0
- package/src/commands/scaffold/index.ts +22 -0
- package/src/commands/start/index.ts +20 -0
- package/src/commands/sync-status.ts +21 -0
- package/src/commands/tokens-build.ts +118 -0
- package/src/commands/types.ts +6 -0
- package/src/commands/utils.ts +21 -0
- package/src/commands/validate/components.ts +27 -0
- package/src/commands/validate.ts +189 -0
- package/src/commands/vercel-build.ts +96 -0
- package/src/config/README.md +32 -0
- package/src/config/declaration-module-load.ts +74 -0
- package/src/config/defaults.ts +78 -0
- package/src/config/helpers.ts +43 -0
- package/src/config/index.ts +16 -0
- package/src/config/loader.ts +131 -0
- package/src/config/normalizers/declaration.ts +180 -0
- package/src/config/normalizers/pattern.ts +56 -0
- package/src/config/runtime.ts +426 -0
- package/src/config/validator.ts +24 -0
- package/src/declarations/codegen.ts +367 -0
- package/src/declarations/helpers.ts +36 -0
- package/src/declarations/index.ts +20 -0
- package/src/declarations/types.ts +214 -0
- package/src/figma/component-linking.ts +1415 -0
- package/src/figma/image-fills.ts +247 -0
- package/src/generated/build-meta.ts +8 -0
- package/src/index.d.ts +13 -0
- package/src/index.ts +369 -0
- package/src/pipeline/README.md +21 -0
- package/src/pipeline/archive.ts +75 -0
- package/src/pipeline/components.ts +9 -0
- package/src/pipeline/documentation.ts +77 -0
- package/src/pipeline/figma.ts +173 -0
- package/src/pipeline/hubspot/config.ts +288 -0
- package/src/pipeline/hubspot/emit.ts +385 -0
- package/src/pipeline/index.ts +38 -0
- package/src/pipeline/patterns.ts +12 -0
- package/src/pipeline/styles.ts +154 -0
- package/src/pipeline/validation.ts +25 -0
- package/src/stacks/bootstrap-handlebars.md +117 -0
- package/src/stacks/react-scss.md +126 -0
- package/src/stacks/react-tailwind.md +123 -0
- package/src/stacks/tailwind-handlebars.md +142 -0
- package/src/transformers/README.md +19 -0
- package/src/transformers/docgen/index.ts +305 -0
- package/src/transformers/plugins/csf-render.ts +485 -0
- package/src/transformers/plugins/handlebars-previews.ts +194 -0
- package/src/transformers/plugins/index.ts +14 -0
- package/src/transformers/plugins/slot-probe-candidates.ts +386 -0
- package/src/transformers/plugins/slot-probe.ts +366 -0
- package/src/transformers/plugins/ssr-render.ts +622 -0
- package/src/transformers/plugins.ts +17 -0
- package/src/transformers/preview/component/api.ts +175 -0
- package/src/transformers/preview/component/artifacts.ts +112 -0
- package/src/transformers/preview/component/build-shared-bundles.ts +453 -0
- package/src/transformers/preview/component/builder.ts +754 -0
- package/src/transformers/preview/component/css.ts +253 -0
- package/src/transformers/preview/component/field-annotations.ts +400 -0
- package/src/transformers/preview/component/html.ts +96 -0
- package/src/transformers/preview/component/javascript.ts +182 -0
- package/src/transformers/preview/component/normalizer.ts +83 -0
- package/src/transformers/preview/component/playwright-shared.ts +183 -0
- package/src/transformers/preview/component/preview-assets.ts +158 -0
- package/src/transformers/preview/component/preview-merge.ts +95 -0
- package/src/transformers/preview/component/preview-select.ts +184 -0
- package/src/transformers/preview/component/preview-server.ts +128 -0
- package/src/transformers/preview/component/preview-validation.ts +255 -0
- package/src/transformers/preview/component/previews.ts +12 -0
- package/src/transformers/preview/component/screenshot.ts +306 -0
- package/src/transformers/preview/component/serialized-elements.ts +124 -0
- package/src/transformers/preview/component/summary.ts +54 -0
- package/src/transformers/preview/component.ts +31 -0
- package/src/transformers/preview/height-reporter.ts +37 -0
- package/src/transformers/preview/pattern/api.ts +83 -0
- package/src/transformers/preview/pattern/builder.ts +192 -0
- package/src/transformers/preview/pattern/html.ts +115 -0
- package/src/transformers/preview/slots.ts +105 -0
- package/src/transformers/preview/types.ts +302 -0
- package/src/transformers/types.ts +68 -0
- package/src/transformers/utils/build.ts +85 -0
- package/src/transformers/utils/csf.ts +48 -0
- package/src/transformers/utils/handlebars.ts +92 -0
- package/src/transformers/utils/html.ts +44 -0
- package/src/transformers/utils/index.ts +27 -0
- package/src/transformers/utils/module.ts +54 -0
- package/src/transformers/utils/schema-loader.ts +68 -0
- package/src/transformers/utils/schema.ts +569 -0
- package/src/transformers/utils/string.ts +55 -0
- package/src/transformers/utils/svg-sprite.ts +139 -0
- package/src/transformers/utils/usage.ts +317 -0
- package/src/transformers/utils/vite-logger.ts +33 -0
- package/src/transformers/validation/runner.ts +351 -0
- package/src/transformers/vite-config.ts +21 -0
- package/src/types/README.md +12 -0
- package/src/types/config.ts +482 -0
- package/src/types/font.ts +3 -0
- package/src/types/handoff-sync.ts +145 -0
- package/src/types/history-purge.ts +141 -0
- package/src/types/icon.ts +8 -0
- package/src/types/preview.ts +136 -0
- package/src/types/validation.ts +213 -0
- package/src/utils/README.md +14 -0
- package/src/utils/asset-upload-limits.ts +157 -0
- package/src/utils/design-md.ts +152 -0
- package/src/utils/duration.ts +3 -0
- package/src/utils/filter.ts +134 -0
- package/src/utils/fs.ts +35 -0
- package/src/utils/index.ts +6 -0
- package/src/utils/line-diff.ts +80 -0
- package/src/utils/logger.ts +176 -0
- package/src/utils/path.ts +61 -0
- package/src/utils/port.ts +46 -0
- package/src/utils/rich-text.ts +1202 -0
- package/src/validators/axe.ts +288 -0
- package/src/validators/contrast.ts +270 -0
- package/src/validators/index.ts +42 -0
- package/src/validators/schema.ts +191 -0
- package/tailwind.config.ts +96 -0
- package/templates/default/README.md.tpl +15 -0
- package/templates/default/components/button/Button.jsx.tpl +64 -0
- package/templates/default/components/button/Button.tsx.tpl +92 -0
- package/templates/default/components/button/button.react.handoff.js.tpl +31 -0
- package/templates/default/components/button/button.react.handoff.ts.tpl +31 -0
- package/templates/default/env.tpl +2 -0
- package/templates/default/gitignore.tpl +7 -0
- package/templates/default/handoff.config.js.tpl +216 -0
- package/templates/default/handoff.config.ts.tpl +196 -0
- package/templates/default/handoff.config.with-examples.js.tpl +215 -0
- package/templates/default/handoff.config.with-examples.ts.tpl +208 -0
- package/templates/default/package.json.tpl +19 -0
- package/templates/default/tsconfig.json.tpl +24 -0
- package/templates/workflows/hubspot-deploy.yml +134 -0
- package/tsconfig.json +30 -0
|
@@ -0,0 +1,1091 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { SlotMetadata } from '@handoff/transformers/preview/slots';
|
|
4
|
+
import { PageSlice } from '@handoff/transformers/preview/types';
|
|
5
|
+
import { PreviewObject } from '@handoff/types/preview';
|
|
6
|
+
import { Types as CoreTypes } from 'handoff-core';
|
|
7
|
+
import type { TypeNode, TypeNodeProperty } from 'handoff-docgen';
|
|
8
|
+
import { startCase } from 'lodash';
|
|
9
|
+
import {
|
|
10
|
+
AlertCircle,
|
|
11
|
+
ChevronDown,
|
|
12
|
+
ChevronLeft,
|
|
13
|
+
ChevronRight,
|
|
14
|
+
CircleCheck,
|
|
15
|
+
Component,
|
|
16
|
+
File,
|
|
17
|
+
Monitor,
|
|
18
|
+
Pencil,
|
|
19
|
+
RefreshCcw,
|
|
20
|
+
Smartphone,
|
|
21
|
+
SlidersHorizontal,
|
|
22
|
+
SquareArrowOutUpRight,
|
|
23
|
+
Tablet,
|
|
24
|
+
Text,
|
|
25
|
+
} from 'lucide-react';
|
|
26
|
+
import React, { useContext, useEffect, useMemo, useState } from 'react';
|
|
27
|
+
import { useSearchParams } from 'next/navigation';
|
|
28
|
+
import { useSession } from 'next-auth/react';
|
|
29
|
+
import { HotReloadContext } from '../context/HotReloadProvider';
|
|
30
|
+
import { usePreviewContext } from '../context/PreviewContext';
|
|
31
|
+
import { sanitizePreviewUrlForOpen } from '@/lib/preview-url';
|
|
32
|
+
import RulesSheet from '../Foundations/RulesSheet';
|
|
33
|
+
import { Badge } from '../ui/badge';
|
|
34
|
+
import { Button } from '../ui/button';
|
|
35
|
+
import { RadioGroup, RadioGroupItem } from '../ui/radio-group';
|
|
36
|
+
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectTrigger, SelectValue } from '../ui/select';
|
|
37
|
+
import { Separator } from '../ui/separator';
|
|
38
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '../ui/table';
|
|
39
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../ui/tooltip';
|
|
40
|
+
import PageSliceResolver from './PageSliceResolver';
|
|
41
|
+
import { previewRenderedHtml, renderPreview } from '../Playground/Preview';
|
|
42
|
+
import type { PlaygroundComponent, SelectedPlaygroundComponent } from '../Playground/types';
|
|
43
|
+
import { usePreviews } from './usePreviews';
|
|
44
|
+
import { ComponentWorkbenchDialog } from './ComponentWorkbenchDialog';
|
|
45
|
+
import type { RegistryPreviewLite, UnifiedPreview } from '@handoff/transformers/preview/component/preview-merge';
|
|
46
|
+
import { activePreviewGroupId, groupPreviewsForPicker, pickerOrder, stepPreviewKey, type PreviewGroup } from '../../lib/preview-groups';
|
|
47
|
+
import { PREVIEW_TEST_BADGE, PREVIEW_TEST_HINT, previewSectionLabel } from '../../lib/preview-purpose-labels';
|
|
48
|
+
import { renderTargetComponent } from '../../lib/preview-render-target';
|
|
49
|
+
import { PREVIEW_HEIGHT_MESSAGE, injectHeightReporter } from '@handoff/transformers/preview/height-reporter';
|
|
50
|
+
|
|
51
|
+
export const getDefaultSlices = (): PageSlice[] => [
|
|
52
|
+
{ type: 'BEST_PRACTICES' },
|
|
53
|
+
{ type: 'COMPONENT_DISPLAY' },
|
|
54
|
+
{ type: 'VALIDATION_RESULTS' },
|
|
55
|
+
{ type: 'PROPERTIES' },
|
|
56
|
+
];
|
|
57
|
+
|
|
58
|
+
export type ComponentPreview = {
|
|
59
|
+
component: CoreTypes.IComponentInstance;
|
|
60
|
+
name: string;
|
|
61
|
+
overrides?: { states?: string[] | undefined };
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export type ComponentPreviews = ComponentPreview[];
|
|
65
|
+
|
|
66
|
+
export const getComponentPreviewTitle = (previewableComponent: ComponentPreview): string => {
|
|
67
|
+
return previewableComponent.name ? `${previewableComponent.name}` : `${startCase(previewableComponent.component.name)}`;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* "test" tag on an `edge` preview — the whole point of the labelling amendment: an edge preview is a
|
|
72
|
+
* stress case, and someone scanning the picker must not read it as sample content to copy.
|
|
73
|
+
*/
|
|
74
|
+
const TestTag: React.FC = () => (
|
|
75
|
+
<span
|
|
76
|
+
title={PREVIEW_TEST_HINT}
|
|
77
|
+
className="rounded-sm bg-gray-200 px-1 text-[9px] uppercase tracking-wide text-muted-foreground dark:bg-gray-700"
|
|
78
|
+
>
|
|
79
|
+
{PREVIEW_TEST_BADGE}
|
|
80
|
+
</span>
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
export const ComponentDisplay: React.FC<{
|
|
84
|
+
component: PreviewObject | undefined;
|
|
85
|
+
defaultHeight?: string | undefined;
|
|
86
|
+
title?: string;
|
|
87
|
+
onPreviewChange?: (previewUrl: string) => void;
|
|
88
|
+
/** When true, hide "open in new tab" (e.g. untrusted preview URL sources). When false, opens only after {@link sanitizePreviewUrlForOpen}. */
|
|
89
|
+
hideOpenInNewTab?: boolean;
|
|
90
|
+
}> = ({ component, defaultHeight, title, onPreviewChange, hideOpenInNewTab = false }) => {
|
|
91
|
+
const ref = React.useRef<HTMLIFrameElement>(null);
|
|
92
|
+
const { status, data: session } = useSession();
|
|
93
|
+
const canEdit = status === 'authenticated' && Boolean(session?.user);
|
|
94
|
+
// The page hands each section a synthetic `id` for its anchor; the registry API and the workbench
|
|
95
|
+
// need the component's own id, so prefer it when there is one.
|
|
96
|
+
const componentId = component?.sourceComponentId ?? component?.id ?? '';
|
|
97
|
+
const basePath = process.env.HANDOFF_APP_BASE_PATH ?? '';
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* The object handed to a renderer, which builds `/api/component/<id>.css` and `<id>-client.mjs` off
|
|
101
|
+
* `id` — so it has to carry the component's own id, not the section anchor. See
|
|
102
|
+
* `lib/preview-render-target`. `component` stays the section: its heading, its anchor, its `<div id>`.
|
|
103
|
+
*/
|
|
104
|
+
const renderComponent = React.useMemo(() => (component ? renderTargetComponent(component) : component), [component]);
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* `?preview=<key>` opens on that value-set — the contract `handoff_create_preview`'s `verifyUrl` relies on.
|
|
108
|
+
* Read here rather than on the server so it works for a *registry* preview too, which arrives from a client
|
|
109
|
+
* fetch after the built-in variants.
|
|
110
|
+
*/
|
|
111
|
+
const requestedPreview = useSearchParams().get('preview');
|
|
112
|
+
|
|
113
|
+
// One source of truth: built variants + registry previews, merged.
|
|
114
|
+
const { previews, selected, selectedKey, setSelectedKey, refresh, registry } = usePreviews(
|
|
115
|
+
componentId,
|
|
116
|
+
component?.previews as Record<string, unknown> | undefined,
|
|
117
|
+
true,
|
|
118
|
+
requestedPreview
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
const [height, setHeight] = React.useState('100px');
|
|
122
|
+
const [width, setWidth] = React.useState('1100px');
|
|
123
|
+
const [scale, setScale] = React.useState(0.8);
|
|
124
|
+
const [manualReload, setManualReload] = React.useState(0);
|
|
125
|
+
const [previewHtml, setPreviewHtml] = React.useState('');
|
|
126
|
+
const [workbenchOpen, setWorkbenchOpen] = React.useState(false);
|
|
127
|
+
const [workbenchEditing, setWorkbenchEditing] = React.useState<RegistryPreviewLite | null>(null);
|
|
128
|
+
|
|
129
|
+
const { reloadCounter } = useContext(HotReloadContext);
|
|
130
|
+
|
|
131
|
+
// Auto-height: the client-rendered preview (with the injected reporter) posts
|
|
132
|
+
// its measured height; accept only messages from this iframe's window (§14).
|
|
133
|
+
React.useEffect(() => {
|
|
134
|
+
if (defaultHeight) {
|
|
135
|
+
setHeight(defaultHeight);
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
const onMessage = (event: MessageEvent) => {
|
|
139
|
+
if (event.source !== ref.current?.contentWindow) return;
|
|
140
|
+
const data = event.data;
|
|
141
|
+
if (data && data.type === PREVIEW_HEIGHT_MESSAGE && typeof data.height === 'number' && data.height > 0) {
|
|
142
|
+
setHeight(`${Math.ceil(data.height)}px`);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
window.addEventListener('message', onMessage);
|
|
146
|
+
return () => window.removeEventListener('message', onMessage);
|
|
147
|
+
}, [defaultHeight]);
|
|
148
|
+
|
|
149
|
+
// Client-render the selected preview's values via the shared render path —
|
|
150
|
+
// one path for variants and registry previews, themed, into the opaque frame.
|
|
151
|
+
React.useEffect(() => {
|
|
152
|
+
if (!renderComponent || !selected) {
|
|
153
|
+
setPreviewHtml('');
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
let cancelled = false;
|
|
157
|
+
(async () => {
|
|
158
|
+
try {
|
|
159
|
+
const view = {
|
|
160
|
+
...(renderComponent as unknown as PlaygroundComponent),
|
|
161
|
+
data: selected.values,
|
|
162
|
+
order: 0,
|
|
163
|
+
quantity: 1,
|
|
164
|
+
uniqueId: `cd-${componentId}`,
|
|
165
|
+
} as SelectedPlaygroundComponent;
|
|
166
|
+
const isReact = (renderComponent as { format?: string }).format === 'react';
|
|
167
|
+
const raw = await renderPreview(view as never, selected.values, basePath);
|
|
168
|
+
// Mirror the workbench: Handlebars output must be wrapped in
|
|
169
|
+
// previewRenderedHtml (adds the framework main.css/main.js) — templates
|
|
170
|
+
// don't all carry their own {{{style}}}. React output is already themed.
|
|
171
|
+
const content = isReact ? raw : previewRenderedHtml(raw, basePath);
|
|
172
|
+
// §14: the frame is opaque-origin, so it has to report its own height for the parent to size it.
|
|
173
|
+
if (!cancelled) setPreviewHtml(injectHeightReporter(content));
|
|
174
|
+
} catch {
|
|
175
|
+
if (!cancelled) setPreviewHtml('');
|
|
176
|
+
}
|
|
177
|
+
})();
|
|
178
|
+
return () => {
|
|
179
|
+
cancelled = true;
|
|
180
|
+
};
|
|
181
|
+
}, [selected, renderComponent, basePath, componentId, manualReload, reloadCounter]);
|
|
182
|
+
|
|
183
|
+
// Notify parent of the active selection (compat with the slice wiring).
|
|
184
|
+
React.useEffect(() => {
|
|
185
|
+
if (selected && onPreviewChange) onPreviewChange(selected.url ?? selected.key);
|
|
186
|
+
}, [selected, onPreviewChange]);
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Picker options + their purpose groups. The grouping itself lives in `lib/preview-groups` so it can
|
|
190
|
+
* be tested without rendering a `<Select>`.
|
|
191
|
+
*/
|
|
192
|
+
const previewGroups: PreviewGroup[] = React.useMemo(() => groupPreviewsForPicker(previews), [previews]);
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* ONE preview surface, and ONE control for it — the purpose rides in the picker.
|
|
196
|
+
*
|
|
197
|
+
* Two rounds of review got us here. The page first stacked a whole surface (frame + picker + code
|
|
198
|
+
* sample) per purpose section, which was "too much scrolling"; that collapsed into one surface with a
|
|
199
|
+
* purpose tab strip in this toolbar, and the strip was rejected in turn: it sat under the selector
|
|
200
|
+
* yet changed the selector's own options, which is not visually coherent, and it made the top bar
|
|
201
|
+
* bigger and more complex for information the menu was already carrying (2026-09-09). So there are no
|
|
202
|
+
* tabs. The dropdown lists every preview under its group heading — the picker main has always had,
|
|
203
|
+
* with the purpose filtering removed — and names the group in its closed value.
|
|
204
|
+
*/
|
|
205
|
+
const activeGroupId = React.useMemo(() => activePreviewGroupId(previewGroups, selectedKey), [previewGroups, selectedKey]);
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* What the CLOSED trigger reads: `Examples · Generic`, `Edge cases · Max lengths`.
|
|
209
|
+
*
|
|
210
|
+
* Only for a purposed component. An unpurposed one gets no prefix and, more to the point, no
|
|
211
|
+
* children on `<SelectValue>` at all — Radix then portals the selected item's own text into the
|
|
212
|
+
* trigger exactly as it does on main, so those pages (every Handlebars registry today) are
|
|
213
|
+
* untouched. Their two groups are origins, "Variants" and "Saved", not purposes: prefixing them
|
|
214
|
+
* would name where a preview came from, which is not what the reader is missing.
|
|
215
|
+
*/
|
|
216
|
+
const triggerLabel = React.useMemo(() => {
|
|
217
|
+
if (!selected || !previews.some((p) => p.purpose)) return null;
|
|
218
|
+
const group = previewGroups.find((g) => g.id === activeGroupId);
|
|
219
|
+
const label = `${selected.label}${selected.source === 'registry' && selected.semantic ? ` · ${selected.semantic}` : ''}`;
|
|
220
|
+
// No group means the selection is not in the menu yet (a registry preview mid-fetch) — the bare
|
|
221
|
+
// label is right, and inventing a group would be worse than saying less.
|
|
222
|
+
return group ? `${group.label} · ${label}` : label;
|
|
223
|
+
}, [selected, previews, previewGroups, activeGroupId]);
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Prev/next stepping. The order is the menu's, flattened — crossing group headings, since a heading
|
|
227
|
+
* is a label in the list and not a wall — and the ends are dead, not wrapped.
|
|
228
|
+
*
|
|
229
|
+
* Rendered for any component with more than one preview, purpose or no purpose. Walking the options
|
|
230
|
+
* is not a purpose feature; it is what the maintainer asked for ("let people tab through the
|
|
231
|
+
* options") and the reason the tab strip is gone is that the strip, not the stepping, was what
|
|
232
|
+
* cluttered the bar.
|
|
233
|
+
*/
|
|
234
|
+
const pickerItems = React.useMemo(() => pickerOrder(previewGroups), [previewGroups]);
|
|
235
|
+
const previousKey = React.useMemo(() => stepPreviewKey(previewGroups, selectedKey, -1), [previewGroups, selectedKey]);
|
|
236
|
+
const nextKey = React.useMemo(() => stepPreviewKey(previewGroups, selectedKey, 1), [previewGroups, selectedKey]);
|
|
237
|
+
|
|
238
|
+
const openWorkbench = (editing: RegistryPreviewLite | null) => {
|
|
239
|
+
setWorkbenchEditing(editing);
|
|
240
|
+
setWorkbenchOpen(true);
|
|
241
|
+
};
|
|
242
|
+
const renderable = Boolean((component as { code?: string; html?: string } | undefined)?.code || (component as { html?: string } | undefined)?.html);
|
|
243
|
+
|
|
244
|
+
const parseCssPx = (v: string, fallback: number) => {
|
|
245
|
+
const n = parseFloat(v);
|
|
246
|
+
return Number.isFinite(n) && n > 0 ? n : fallback;
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
const scaledFrameStyle: React.CSSProperties = {
|
|
250
|
+
width: parseCssPx(width, 1100) * scale,
|
|
251
|
+
height: parseCssPx(height, 100) * scale,
|
|
252
|
+
margin: '0 auto',
|
|
253
|
+
overflow: 'hidden',
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
return (
|
|
257
|
+
<div className="md:flex" id="preview">
|
|
258
|
+
<div className="text-medium flex w-full flex-col items-center rounded-lg border border-gray-200 dark:border-gray-900">
|
|
259
|
+
{component && (
|
|
260
|
+
<>
|
|
261
|
+
<div className="flex w-full items-center justify-between rounded-t-lg bg-gray-50 px-6 py-2 pr-3 align-middle @container dark:bg-gray-800">
|
|
262
|
+
<div className="flex flex-1 flex-wrap items-center gap-2">
|
|
263
|
+
{/* Single preview toggle (restores the H1 model — H2 had exploded this into
|
|
264
|
+
multiple variant-property dropdowns that cut across the preview). */}
|
|
265
|
+
<div className="flex h-8 shrink-0 items-center gap-2">
|
|
266
|
+
<p className="font-monospace text-[11px] text-accent-foreground">{title ?? 'Preview'}</p>
|
|
267
|
+
<Separator orientation="vertical" className="h-3" />
|
|
268
|
+
</div>
|
|
269
|
+
<Select value={selectedKey ?? undefined} onValueChange={setSelectedKey}>
|
|
270
|
+
{/* 280px, not main's 240: the group prefix costs about eleven characters, and
|
|
271
|
+
"Edge cases · Gallery, long copy" clipped the half that identifies the preview.
|
|
272
|
+
One width for both cases — a trigger that resized itself when a component
|
|
273
|
+
happened to declare a purpose would be its own kind of incoherence. */}
|
|
274
|
+
<SelectTrigger className="h-8 w-[280px] border-none bg-white text-xs shadow-none dark:bg-transparent">
|
|
275
|
+
{triggerLabel ? (
|
|
276
|
+
<SelectValue placeholder="Preview">
|
|
277
|
+
<span className="truncate">{triggerLabel}</span>
|
|
278
|
+
</SelectValue>
|
|
279
|
+
) : (
|
|
280
|
+
<SelectValue placeholder="Preview" />
|
|
281
|
+
)}
|
|
282
|
+
</SelectTrigger>
|
|
283
|
+
<SelectContent>
|
|
284
|
+
{previewGroups.map((group) => (
|
|
285
|
+
<SelectGroup key={group.id}>
|
|
286
|
+
<SelectLabel title={group.isTest ? PREVIEW_TEST_HINT : undefined}>
|
|
287
|
+
{previewSectionLabel(group.label, group.isTest ? 'edge' : undefined)}
|
|
288
|
+
</SelectLabel>
|
|
289
|
+
{group.items.map((p) => (
|
|
290
|
+
<SelectItem key={p.key} value={p.key}>
|
|
291
|
+
<span className="flex items-center gap-1.5">
|
|
292
|
+
{p.label}{p.source === 'registry' && p.semantic ? ` · ${p.semantic}` : ''}
|
|
293
|
+
{p.purpose === 'edge' ? <TestTag /> : null}
|
|
294
|
+
</span>
|
|
295
|
+
</SelectItem>
|
|
296
|
+
))}
|
|
297
|
+
</SelectGroup>
|
|
298
|
+
))}
|
|
299
|
+
</SelectContent>
|
|
300
|
+
</Select>
|
|
301
|
+
{pickerItems.length > 1 ? (
|
|
302
|
+
<TooltipProvider delayDuration={0}>
|
|
303
|
+
<div className="flex items-center gap-0">
|
|
304
|
+
<Tooltip>
|
|
305
|
+
<TooltipTrigger asChild>
|
|
306
|
+
<Button
|
|
307
|
+
aria-label="Previous preview"
|
|
308
|
+
className="h-8 px-2 hover:bg-gray-300 [&_svg]:size-3.5"
|
|
309
|
+
variant="ghost"
|
|
310
|
+
disabled={!previousKey}
|
|
311
|
+
onClick={() => previousKey && setSelectedKey(previousKey)}
|
|
312
|
+
>
|
|
313
|
+
<ChevronLeft strokeWidth={1.5} />
|
|
314
|
+
</Button>
|
|
315
|
+
</TooltipTrigger>
|
|
316
|
+
<TooltipContent className="rounded-sm px-2 py-1 text-[11px]">Previous preview</TooltipContent>
|
|
317
|
+
</Tooltip>
|
|
318
|
+
<Tooltip>
|
|
319
|
+
<TooltipTrigger asChild>
|
|
320
|
+
<Button
|
|
321
|
+
aria-label="Next preview"
|
|
322
|
+
className="h-8 px-2 hover:bg-gray-300 [&_svg]:size-3.5"
|
|
323
|
+
variant="ghost"
|
|
324
|
+
disabled={!nextKey}
|
|
325
|
+
onClick={() => nextKey && setSelectedKey(nextKey)}
|
|
326
|
+
>
|
|
327
|
+
<ChevronRight strokeWidth={1.5} />
|
|
328
|
+
</Button>
|
|
329
|
+
</TooltipTrigger>
|
|
330
|
+
<TooltipContent className="rounded-sm px-2 py-1 text-[11px]">Next preview</TooltipContent>
|
|
331
|
+
</Tooltip>
|
|
332
|
+
</div>
|
|
333
|
+
</TooltipProvider>
|
|
334
|
+
) : null}
|
|
335
|
+
</div>
|
|
336
|
+
<div className=" hidden items-center gap-0 @2xl:flex">
|
|
337
|
+
<TooltipProvider delayDuration={0}>
|
|
338
|
+
<Tooltip>
|
|
339
|
+
<TooltipTrigger asChild>
|
|
340
|
+
<Button
|
|
341
|
+
className="h-7 px-3 font-mono text-[11px] hover:bg-gray-300"
|
|
342
|
+
onClick={() => setScale(scale === 1 ? 0.8 : 1)}
|
|
343
|
+
variant="ghost"
|
|
344
|
+
>
|
|
345
|
+
{scale === 1 ? '100%' : '80%'}
|
|
346
|
+
</Button>
|
|
347
|
+
</TooltipTrigger>
|
|
348
|
+
<TooltipContent className="rounded-sm px-2 py-1 text-[11px]">Toggle Scale</TooltipContent>
|
|
349
|
+
</Tooltip>
|
|
350
|
+
</TooltipProvider>
|
|
351
|
+
<Separator orientation="vertical" className="mx-3 h-6" />
|
|
352
|
+
<RadioGroup className="flex items-center gap-0" defaultValue="1100" onValueChange={(value) => setWidth(`${value}px`)}>
|
|
353
|
+
<label className="relative flex h-7 cursor-pointer flex-col items-center justify-center rounded-md px-3 text-center text-xl ring-inset transition-colors hover:bg-gray-300 has-data-disabled:cursor-not-allowed has-data-[state=checked]:bg-blue-50 has-data-disabled:opacity-50 has-data-[state=checked]:shadow-[inset_0_1px_1px_0_rgba(0,0,0,0.05)] has-focus-visible:outline-solid has-focus-visible:outline-2 has-focus-visible:outline-ring/70 has-data-[state=checked]:ring-1 has-data-[state=checked]:ring-blue-500/20 [&_svg]:size-3">
|
|
354
|
+
<RadioGroupItem value="1100" className="sr-only after:absolute after:inset-0" />
|
|
355
|
+
<Monitor />
|
|
356
|
+
</label>
|
|
357
|
+
<label className="relative flex h-7 cursor-pointer flex-col items-center justify-center rounded-md px-3 text-center text-xl transition-colors hover:bg-gray-300 has-data-disabled:cursor-not-allowed has-data-[state=checked]:bg-blue-50 has-data-disabled:opacity-50 has-data-[state=checked]:shadow-[inset_0_1px_1px_0_rgba(0,0,0,0.05)] has-focus-visible:outline-solid has-focus-visible:outline-2 has-focus-visible:outline-ring/70 has-data-[state=checked]:ring-1 has-data-[state=checked]:ring-blue-500/20 [&_svg]:size-3">
|
|
358
|
+
<RadioGroupItem value="800" className="sr-only after:absolute after:inset-0" />
|
|
359
|
+
<Tablet />
|
|
360
|
+
</label>
|
|
361
|
+
<label className="relative flex h-7 cursor-pointer flex-col items-center justify-center rounded-md px-3 text-center text-xl transition-colors hover:bg-gray-300 has-data-disabled:cursor-not-allowed has-data-[state=checked]:bg-blue-50 has-data-disabled:opacity-50 has-data-[state=checked]:shadow-[inset_0_1px_1px_0_rgba(0,0,0,0.05)] has-focus-visible:outline-solid has-focus-visible:outline-2 has-focus-visible:outline-ring/70 has-data-[state=checked]:ring-1 has-data-[state=checked]:ring-blue-500/20 [&_svg]:size-2.5">
|
|
362
|
+
<RadioGroupItem value="400" className="sr-only after:absolute after:inset-0" />
|
|
363
|
+
<Smartphone />
|
|
364
|
+
</label>
|
|
365
|
+
</RadioGroup>
|
|
366
|
+
<Separator orientation="vertical" className="mx-3 h-6" />
|
|
367
|
+
<TooltipProvider delayDuration={0}>
|
|
368
|
+
<Tooltip>
|
|
369
|
+
<TooltipTrigger asChild>
|
|
370
|
+
<Button
|
|
371
|
+
className="h-7 px-3 hover:bg-gray-300 [&_svg]:size-3"
|
|
372
|
+
onClick={() => setManualReload((n) => n + 1)}
|
|
373
|
+
variant="ghost"
|
|
374
|
+
>
|
|
375
|
+
<RefreshCcw />
|
|
376
|
+
</Button>
|
|
377
|
+
</TooltipTrigger>
|
|
378
|
+
<TooltipContent className="rounded-sm px-2 py-1 text-[11px]">Refresh Preview</TooltipContent>
|
|
379
|
+
</Tooltip>
|
|
380
|
+
</TooltipProvider>
|
|
381
|
+
{canEdit ? (
|
|
382
|
+
<TooltipProvider delayDuration={0}>
|
|
383
|
+
<Tooltip>
|
|
384
|
+
<TooltipTrigger asChild>
|
|
385
|
+
<Button className="h-7 px-3 hover:bg-gray-300 [&_svg]:size-4" onClick={() => openWorkbench(null)} variant="ghost" disabled={!renderable}>
|
|
386
|
+
<SlidersHorizontal strokeWidth={1.5} />
|
|
387
|
+
</Button>
|
|
388
|
+
</TooltipTrigger>
|
|
389
|
+
<TooltipContent className="rounded-sm px-2 py-1 text-[11px]">Open component workbench</TooltipContent>
|
|
390
|
+
</Tooltip>
|
|
391
|
+
</TooltipProvider>
|
|
392
|
+
) : null}
|
|
393
|
+
{canEdit && selected?.source === 'registry' ? (
|
|
394
|
+
<TooltipProvider delayDuration={0}>
|
|
395
|
+
<Tooltip>
|
|
396
|
+
<TooltipTrigger asChild>
|
|
397
|
+
<Button
|
|
398
|
+
className="h-7 px-3 hover:bg-gray-300 [&_svg]:size-3.5"
|
|
399
|
+
variant="ghost"
|
|
400
|
+
onClick={() => openWorkbench(registry.find((r) => `registry:${r.id}` === selectedKey) ?? null)}
|
|
401
|
+
>
|
|
402
|
+
<Pencil strokeWidth={1.5} />
|
|
403
|
+
</Button>
|
|
404
|
+
</TooltipTrigger>
|
|
405
|
+
<TooltipContent className="rounded-sm px-2 py-1 text-[11px]">Edit this preview</TooltipContent>
|
|
406
|
+
</Tooltip>
|
|
407
|
+
</TooltipProvider>
|
|
408
|
+
) : null}
|
|
409
|
+
{!hideOpenInNewTab && selected?.source === 'variant' && selected.url ? (
|
|
410
|
+
<TooltipProvider delayDuration={0}>
|
|
411
|
+
<Tooltip>
|
|
412
|
+
<TooltipTrigger asChild>
|
|
413
|
+
<Button
|
|
414
|
+
className="h-7 px-3 hover:bg-gray-300 [&_svg]:size-3"
|
|
415
|
+
onClick={() => {
|
|
416
|
+
const safe = selected.url ? sanitizePreviewUrlForOpen(selected.url) : null;
|
|
417
|
+
if (!safe) return;
|
|
418
|
+
window.open(`${basePath}/api/component/${safe}`, '_blank', 'noopener,noreferrer');
|
|
419
|
+
}}
|
|
420
|
+
variant="ghost"
|
|
421
|
+
>
|
|
422
|
+
<SquareArrowOutUpRight />
|
|
423
|
+
</Button>
|
|
424
|
+
</TooltipTrigger>
|
|
425
|
+
<TooltipContent className="rounded-sm px-2 py-1 text-[11px]">Open in New Tab</TooltipContent>
|
|
426
|
+
</Tooltip>
|
|
427
|
+
</TooltipProvider>
|
|
428
|
+
) : null}
|
|
429
|
+
</div>
|
|
430
|
+
</div>
|
|
431
|
+
|
|
432
|
+
<div className="dotted-bg w-full p-8">
|
|
433
|
+
{selected ? (
|
|
434
|
+
<div style={scaledFrameStyle}>
|
|
435
|
+
{/*
|
|
436
|
+
Opaque-origin sandbox; client-rendered `srcDoc` — ONE render path for both
|
|
437
|
+
built variants and registry previews. Auto-height via the injected reporter.
|
|
438
|
+
*/}
|
|
439
|
+
<iframe
|
|
440
|
+
key={`${selectedKey}-${reloadCounter}-${manualReload}`}
|
|
441
|
+
title="Component preview"
|
|
442
|
+
sandbox="allow-scripts"
|
|
443
|
+
ref={ref}
|
|
444
|
+
height={height}
|
|
445
|
+
style={{
|
|
446
|
+
minWidth: width,
|
|
447
|
+
height: height,
|
|
448
|
+
transform: `scale(${scale})`,
|
|
449
|
+
transformOrigin: 'left top',
|
|
450
|
+
transition: 'all 0.2s ease-in-out',
|
|
451
|
+
display: 'block',
|
|
452
|
+
margin: 0,
|
|
453
|
+
}}
|
|
454
|
+
srcDoc={previewHtml}
|
|
455
|
+
/>
|
|
456
|
+
</div>
|
|
457
|
+
) : (
|
|
458
|
+
<div className="flex items-center justify-center p-8 text-sm text-gray-500">
|
|
459
|
+
No previews yet.{canEdit && renderable ? ' Open the component workbench to create one.' : ''}
|
|
460
|
+
</div>
|
|
461
|
+
)}
|
|
462
|
+
{selected?.source === 'registry' && selected.rationale ? (
|
|
463
|
+
<p className="mx-auto mt-3 max-w-[900px] text-xs text-muted-foreground">
|
|
464
|
+
<span className="font-medium">Why:</span> {selected.rationale}
|
|
465
|
+
</p>
|
|
466
|
+
) : null}
|
|
467
|
+
</div>
|
|
468
|
+
</>
|
|
469
|
+
)}
|
|
470
|
+
</div>
|
|
471
|
+
{canEdit ? (
|
|
472
|
+
<ComponentWorkbenchDialog
|
|
473
|
+
open={workbenchOpen}
|
|
474
|
+
onOpenChange={setWorkbenchOpen}
|
|
475
|
+
component={renderComponent}
|
|
476
|
+
componentId={componentId}
|
|
477
|
+
initialValues={selected?.values ?? {}}
|
|
478
|
+
editing={workbenchEditing}
|
|
479
|
+
onSaved={(id) => {
|
|
480
|
+
void refresh();
|
|
481
|
+
setSelectedKey(`registry:${id}`);
|
|
482
|
+
}}
|
|
483
|
+
/>
|
|
484
|
+
) : null}
|
|
485
|
+
</div>
|
|
486
|
+
);
|
|
487
|
+
};
|
|
488
|
+
|
|
489
|
+
export const ComponentPreview: React.FC<{
|
|
490
|
+
defaultPreview?: PreviewObject;
|
|
491
|
+
code?: string;
|
|
492
|
+
title: string;
|
|
493
|
+
children: React.ReactNode;
|
|
494
|
+
height?: string;
|
|
495
|
+
bestPracticesCard?: boolean;
|
|
496
|
+
codeHighlight?: boolean;
|
|
497
|
+
properties?: boolean;
|
|
498
|
+
validations?: boolean;
|
|
499
|
+
hideOpenInNewTab?: boolean;
|
|
500
|
+
codeAnchor?: boolean;
|
|
501
|
+
}> = ({
|
|
502
|
+
defaultPreview,
|
|
503
|
+
title,
|
|
504
|
+
children,
|
|
505
|
+
height,
|
|
506
|
+
bestPracticesCard = true,
|
|
507
|
+
codeHighlight = true,
|
|
508
|
+
properties = true,
|
|
509
|
+
validations = true,
|
|
510
|
+
hideOpenInNewTab = false,
|
|
511
|
+
codeAnchor = true,
|
|
512
|
+
}) => {
|
|
513
|
+
const context = usePreviewContext();
|
|
514
|
+
const [loaded, setLoaded] = React.useState(false);
|
|
515
|
+
const [preview, setPreview] = React.useState<PreviewObject | undefined>(defaultPreview);
|
|
516
|
+
const [currentPreviewUrl, setCurrentPreviewUrl] = React.useState<string | undefined>();
|
|
517
|
+
React.useEffect(() => {
|
|
518
|
+
if (context.preview) {
|
|
519
|
+
setPreview(context.preview);
|
|
520
|
+
setLoaded(true);
|
|
521
|
+
}
|
|
522
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
523
|
+
}, [loaded, setLoaded, context.preview]);
|
|
524
|
+
|
|
525
|
+
useEffect(() => {
|
|
526
|
+
setPreview(defaultPreview);
|
|
527
|
+
}, [defaultPreview]);
|
|
528
|
+
|
|
529
|
+
if (!preview) {
|
|
530
|
+
return <div>No preview available</div>;
|
|
531
|
+
}
|
|
532
|
+
if (!loaded) {
|
|
533
|
+
return <div id={preview.id}>Loading Previews</div>;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
// Determine which slices to use: custom slices or default slices
|
|
537
|
+
const slicesToRender =
|
|
538
|
+
preview.page && Array.isArray(preview.page.slices) && preview.page.slices.length > 0 ? preview.page.slices : getDefaultSlices();
|
|
539
|
+
|
|
540
|
+
return (
|
|
541
|
+
<>
|
|
542
|
+
{slicesToRender.map((slice, idx) => (
|
|
543
|
+
<PageSliceResolver
|
|
544
|
+
key={idx}
|
|
545
|
+
slice={slice}
|
|
546
|
+
preview={preview}
|
|
547
|
+
title={title}
|
|
548
|
+
height={height}
|
|
549
|
+
currentPreviewUrl={currentPreviewUrl}
|
|
550
|
+
onPreviewChange={(previewUrl) => {
|
|
551
|
+
setCurrentPreviewUrl(previewUrl);
|
|
552
|
+
}}
|
|
553
|
+
bestPracticesCard={bestPracticesCard}
|
|
554
|
+
codeHighlight={codeHighlight}
|
|
555
|
+
properties={properties}
|
|
556
|
+
validations={validations}
|
|
557
|
+
hideOpenInNewTab={hideOpenInNewTab}
|
|
558
|
+
codeAnchor={codeAnchor}
|
|
559
|
+
/>
|
|
560
|
+
))}
|
|
561
|
+
<hr />
|
|
562
|
+
</>
|
|
563
|
+
);
|
|
564
|
+
};
|
|
565
|
+
|
|
566
|
+
export const ComponentProperties: React.FC<{ fields: SlotMetadata[] }> = ({ fields }) => {
|
|
567
|
+
const [open, setOpen] = React.useState(false);
|
|
568
|
+
const [selectedField, setSelectedField] = React.useState(null);
|
|
569
|
+
const openSheet = (field) => {
|
|
570
|
+
setSelectedField(field);
|
|
571
|
+
setOpen(true);
|
|
572
|
+
};
|
|
573
|
+
const openFromHash = () => {
|
|
574
|
+
if (window.location.hash) {
|
|
575
|
+
const field = fields.find((field) => field.key === window.location.hash.replace('#', ''));
|
|
576
|
+
if (field) {
|
|
577
|
+
setSelectedField(field);
|
|
578
|
+
setOpen(true);
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
};
|
|
582
|
+
useEffect(() => {
|
|
583
|
+
openFromHash();
|
|
584
|
+
window.addEventListener('hashchange', openFromHash);
|
|
585
|
+
}, [fields]);
|
|
586
|
+
return (
|
|
587
|
+
<>
|
|
588
|
+
<RulesSheet open={open} setOpen={setOpen} field={selectedField} />
|
|
589
|
+
<p className="mb-5">These are the properties associated with the component.</p>
|
|
590
|
+
<Table className="table-fixed">
|
|
591
|
+
<TableHeader className="border-b-0 border-l-[0.5px] border-r-[0.5px] border-t-[0.5px] bg-gray-50/80 dark:bg-gray-800/80 ">
|
|
592
|
+
<TableRow className="border-b-[0.5px]!">
|
|
593
|
+
<TableHead className="w-[22%] border-r-[0.5px] px-4 text-xs font-medium text-gray-900 dark:text-gray-100">
|
|
594
|
+
<Component className="float-left mr-2 mt-0.5 h-3 w-3 stroke-2 opacity-80" />
|
|
595
|
+
Name
|
|
596
|
+
</TableHead>
|
|
597
|
+
<TableHead className="w-[13rem] border-r-[0.5px] px-4 text-xs font-medium text-gray-900 dark:text-gray-100">
|
|
598
|
+
<File className="float-left mr-2 mt-0.5 h-3 w-3 stroke-2 opacity-80" />
|
|
599
|
+
Type
|
|
600
|
+
</TableHead>
|
|
601
|
+
<TableHead className="w-[10rem] border-r-[0.5px] px-4 text-xs font-medium text-gray-900 dark:text-gray-100">
|
|
602
|
+
<CircleCheck className="float-left mr-2 mt-0.5 h-3 w-3 stroke-2 opacity-80" />
|
|
603
|
+
Required
|
|
604
|
+
</TableHead>
|
|
605
|
+
<TableHead className="border-r-[0.5px] px-4 text-xs font-medium text-gray-900 dark:text-gray-100">
|
|
606
|
+
<Text className="float-left mr-2 mt-0.5 h-3 w-3 stroke-2 opacity-80" />
|
|
607
|
+
Default / Description
|
|
608
|
+
</TableHead>
|
|
609
|
+
</TableRow>
|
|
610
|
+
</TableHeader>
|
|
611
|
+
<TableBody>
|
|
612
|
+
{fields.length > 0 ? (
|
|
613
|
+
<TableRows rows={fields} openSheet={openSheet} />
|
|
614
|
+
) : (
|
|
615
|
+
<TableRow>
|
|
616
|
+
<TableCell colSpan={4} className="px-4 py-6 text-center text-sm text-gray-500 dark:text-gray-400">
|
|
617
|
+
No properties have been documented for this component yet.
|
|
618
|
+
</TableCell>
|
|
619
|
+
</TableRow>
|
|
620
|
+
)}
|
|
621
|
+
</TableBody>
|
|
622
|
+
</Table>
|
|
623
|
+
</>
|
|
624
|
+
);
|
|
625
|
+
};
|
|
626
|
+
|
|
627
|
+
export const getVariantForType = (type: string) => {
|
|
628
|
+
switch (type.toLowerCase()) {
|
|
629
|
+
case 'text':
|
|
630
|
+
return 'green';
|
|
631
|
+
case 'image':
|
|
632
|
+
return 'info';
|
|
633
|
+
case 'video_file':
|
|
634
|
+
case 'video_embed':
|
|
635
|
+
return 'warning';
|
|
636
|
+
default:
|
|
637
|
+
return 'default';
|
|
638
|
+
}
|
|
639
|
+
};
|
|
640
|
+
|
|
641
|
+
const getTypeLabel = (field: SlotMetadata): string => field.deepType?.display || field.docgenType || field.generic || field.type || 'unknown';
|
|
642
|
+
|
|
643
|
+
const summarizeTypeLabel = (typeLabel: string): string => {
|
|
644
|
+
if (!typeLabel || typeLabel.length <= 46) {
|
|
645
|
+
return typeLabel;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
const parts = typeLabel
|
|
649
|
+
.split('|')
|
|
650
|
+
.map((part) => part.trim())
|
|
651
|
+
.filter(Boolean);
|
|
652
|
+
|
|
653
|
+
if (parts.length > 2) {
|
|
654
|
+
const isNullable = parts.some((part) => part === 'undefined' || part === 'null');
|
|
655
|
+
const concreteParts = parts.filter((part) => part !== 'undefined' && part !== 'null');
|
|
656
|
+
|
|
657
|
+
if (concreteParts.length > 2) {
|
|
658
|
+
return `${concreteParts.slice(0, 2).join(' | ')} +${concreteParts.length - 2}${isNullable ? ' | undefined' : ''}`;
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
return `${typeLabel.slice(0, 43)}...`;
|
|
663
|
+
};
|
|
664
|
+
|
|
665
|
+
const formatInlineValue = (value: unknown): string => {
|
|
666
|
+
if (value === null || value === undefined) {
|
|
667
|
+
return 'null';
|
|
668
|
+
}
|
|
669
|
+
if (typeof value === 'string') {
|
|
670
|
+
return value;
|
|
671
|
+
}
|
|
672
|
+
if (typeof value === 'number' || typeof value === 'boolean') {
|
|
673
|
+
return String(value);
|
|
674
|
+
}
|
|
675
|
+
try {
|
|
676
|
+
return JSON.stringify(value);
|
|
677
|
+
} catch {
|
|
678
|
+
return String(value);
|
|
679
|
+
}
|
|
680
|
+
};
|
|
681
|
+
|
|
682
|
+
const formatDefaultValue = (value: unknown): string | null => {
|
|
683
|
+
if (value === undefined || value === null || value === '') {
|
|
684
|
+
return null;
|
|
685
|
+
}
|
|
686
|
+
if (typeof value === 'string') {
|
|
687
|
+
return value;
|
|
688
|
+
}
|
|
689
|
+
if (typeof value === 'number' || typeof value === 'boolean') {
|
|
690
|
+
return String(value);
|
|
691
|
+
}
|
|
692
|
+
if (Array.isArray(value)) {
|
|
693
|
+
return `[${value.map((item) => formatInlineValue(item)).join(', ')}]`;
|
|
694
|
+
}
|
|
695
|
+
if (typeof value === 'object') {
|
|
696
|
+
const entries = Object.entries(value as Record<string, unknown>);
|
|
697
|
+
if (entries.length === 0) {
|
|
698
|
+
return '{}';
|
|
699
|
+
}
|
|
700
|
+
return entries.map(([key, val]) => `${key}: ${formatInlineValue(val)}`).join(', ');
|
|
701
|
+
}
|
|
702
|
+
try {
|
|
703
|
+
return JSON.stringify(value);
|
|
704
|
+
} catch {
|
|
705
|
+
return String(value);
|
|
706
|
+
}
|
|
707
|
+
};
|
|
708
|
+
|
|
709
|
+
const TableRows: React.FC<{
|
|
710
|
+
rows: SlotMetadata[];
|
|
711
|
+
openSheet: (field: SlotMetadata) => void;
|
|
712
|
+
}> = ({
|
|
713
|
+
rows,
|
|
714
|
+
openSheet,
|
|
715
|
+
}) => {
|
|
716
|
+
return (
|
|
717
|
+
<>
|
|
718
|
+
{rows.map((row, i) => {
|
|
719
|
+
if (!row) return null;
|
|
720
|
+
const currentPath = row.key || row.name || String(i);
|
|
721
|
+
return <ExpandableTableRow key={`row-${currentPath}-${i}`} row={row} openSheet={openSheet} />;
|
|
722
|
+
})}
|
|
723
|
+
</>
|
|
724
|
+
);
|
|
725
|
+
};
|
|
726
|
+
|
|
727
|
+
const AnnotationList: React.FC<{ annotations?: { name: string; text?: string }[] }> = ({ annotations }) => {
|
|
728
|
+
if (!annotations?.length) {
|
|
729
|
+
return null;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
return (
|
|
733
|
+
<div className="mt-2 flex flex-wrap gap-1">
|
|
734
|
+
{annotations.map((annotation, idx) => (
|
|
735
|
+
<Badge
|
|
736
|
+
key={`${annotation.name}-${idx}`}
|
|
737
|
+
variant="outline"
|
|
738
|
+
className="rounded-xl border-violet-300 bg-violet-50 px-2 text-[10px] text-violet-800 dark:border-violet-800 dark:bg-violet-950/40 dark:text-violet-200"
|
|
739
|
+
>
|
|
740
|
+
@{annotation.name}
|
|
741
|
+
{annotation.text ? `: ${annotation.text}` : ''}
|
|
742
|
+
</Badge>
|
|
743
|
+
))}
|
|
744
|
+
</div>
|
|
745
|
+
);
|
|
746
|
+
};
|
|
747
|
+
|
|
748
|
+
const TypeNodePropertyView: React.FC<{ property: TypeNodeProperty; depth: number }> = ({ property, depth }) => {
|
|
749
|
+
return (
|
|
750
|
+
<div className="mt-3 rounded-md border border-gray-200/90 bg-white/80 p-3 dark:border-gray-800 dark:bg-gray-900/20">
|
|
751
|
+
<div className="flex items-center gap-2">
|
|
752
|
+
<p className="font-mono text-xs">
|
|
753
|
+
{property.name}
|
|
754
|
+
{property.optional ? '?' : ''}
|
|
755
|
+
</p>
|
|
756
|
+
{property.optional ? (
|
|
757
|
+
<Badge variant="outline" className="rounded-xl px-2 text-[10px]">
|
|
758
|
+
optional
|
|
759
|
+
</Badge>
|
|
760
|
+
) : null}
|
|
761
|
+
</div>
|
|
762
|
+
<p className="mt-1 text-xs text-muted-foreground">{property.type.display}</p>
|
|
763
|
+
{property.description ? (
|
|
764
|
+
<p className="mt-1.5 text-[11px] leading-normal text-muted-foreground/90">{property.description}</p>
|
|
765
|
+
) : null}
|
|
766
|
+
<AnnotationList annotations={property.annotations} />
|
|
767
|
+
<TypeNodeTree node={property.type} depth={depth + 1} />
|
|
768
|
+
</div>
|
|
769
|
+
);
|
|
770
|
+
};
|
|
771
|
+
|
|
772
|
+
const TypeNodeTree: React.FC<{ node?: TypeNode; depth?: number }> = ({ node, depth = 0 }) => {
|
|
773
|
+
if (!node) {
|
|
774
|
+
return null;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
const indentClass = depth > 0 ? 'ml-4 border-l border-dashed border-gray-300 pl-3 dark:border-gray-700' : '';
|
|
778
|
+
|
|
779
|
+
return (
|
|
780
|
+
<div className={`mt-2 ${indentClass}`}>
|
|
781
|
+
<div className="flex flex-wrap items-center gap-1.5 rounded-md border border-gray-200/80 bg-gray-50/60 px-2 py-1.5 text-xs dark:border-gray-800 dark:bg-gray-800/25">
|
|
782
|
+
<Badge variant="outline" className="rounded-xl px-2 text-[10px]">
|
|
783
|
+
{node.kind}
|
|
784
|
+
</Badge>
|
|
785
|
+
<span className="font-mono">{node.display}</span>
|
|
786
|
+
{node.truncated ? (
|
|
787
|
+
<Badge variant="outline" className="rounded-xl px-2 text-[10px]">
|
|
788
|
+
truncated
|
|
789
|
+
</Badge>
|
|
790
|
+
) : null}
|
|
791
|
+
{node.cycleDetected ? (
|
|
792
|
+
<Badge variant="outline" className="rounded-xl px-2 text-[10px]">
|
|
793
|
+
cycleDetected
|
|
794
|
+
</Badge>
|
|
795
|
+
) : null}
|
|
796
|
+
</div>
|
|
797
|
+
|
|
798
|
+
{node.kind === 'enum' && node.members?.length ? (
|
|
799
|
+
<div className="mt-2 flex flex-wrap gap-1">
|
|
800
|
+
{node.members.map((member, idx) => (
|
|
801
|
+
<Badge key={`${member}-${idx}`} variant="outline" className="rounded-xl px-2 text-[10px]">
|
|
802
|
+
{member}
|
|
803
|
+
</Badge>
|
|
804
|
+
))}
|
|
805
|
+
</div>
|
|
806
|
+
) : null}
|
|
807
|
+
|
|
808
|
+
{node.kind === 'object' && node.properties?.length
|
|
809
|
+
? node.properties.map((property, idx) => <TypeNodePropertyView key={`${property.name}-${idx}`} property={property} depth={depth} />)
|
|
810
|
+
: null}
|
|
811
|
+
|
|
812
|
+
{node.kind === 'array' && node.elementType ? <TypeNodeTree node={node.elementType} depth={depth + 1} /> : null}
|
|
813
|
+
|
|
814
|
+
{(node.kind === 'union' || node.kind === 'intersection' || node.kind === 'function') && node.children?.length
|
|
815
|
+
? node.children.map((child, idx) => <TypeNodeTree key={`${node.kind}-child-${idx}`} node={child} depth={depth + 1} />)
|
|
816
|
+
: null}
|
|
817
|
+
|
|
818
|
+
{node.kind === 'record'
|
|
819
|
+
? (() => {
|
|
820
|
+
if (node.indexSignature) {
|
|
821
|
+
return (
|
|
822
|
+
<div className="mt-3 rounded border border-gray-200/80 bg-white/70 p-2 dark:border-gray-800 dark:bg-gray-900/20">
|
|
823
|
+
<p className="text-[10px] font-medium uppercase tracking-wide text-muted-foreground">Index signature</p>
|
|
824
|
+
<TypeNodeTree node={node.indexSignature.key} depth={depth + 1} />
|
|
825
|
+
<TypeNodeTree node={node.indexSignature.value} depth={depth + 1} />
|
|
826
|
+
</div>
|
|
827
|
+
);
|
|
828
|
+
}
|
|
829
|
+
return (
|
|
830
|
+
<>
|
|
831
|
+
{node.keyType ? <TypeNodeTree node={node.keyType} depth={depth + 1} /> : null}
|
|
832
|
+
{node.valueType ? <TypeNodeTree node={node.valueType} depth={depth + 1} /> : null}
|
|
833
|
+
</>
|
|
834
|
+
);
|
|
835
|
+
})()
|
|
836
|
+
: null}
|
|
837
|
+
|
|
838
|
+
{node.kind === 'set' && node.elementType ? <TypeNodeTree node={node.elementType} depth={depth + 1} /> : null}
|
|
839
|
+
|
|
840
|
+
{node.kind === 'map'
|
|
841
|
+
? (
|
|
842
|
+
<>
|
|
843
|
+
{node.keyType ? <TypeNodeTree node={node.keyType} depth={depth + 1} /> : null}
|
|
844
|
+
{node.valueType ? <TypeNodeTree node={node.valueType} depth={depth + 1} /> : null}
|
|
845
|
+
</>
|
|
846
|
+
)
|
|
847
|
+
: null}
|
|
848
|
+
|
|
849
|
+
{node.kind === 'ref' && node.refName ? (
|
|
850
|
+
<p className="mt-2 text-xs text-muted-foreground">
|
|
851
|
+
<span className="font-medium">Reference:</span> {node.refName}
|
|
852
|
+
</p>
|
|
853
|
+
) : null}
|
|
854
|
+
</div>
|
|
855
|
+
);
|
|
856
|
+
};
|
|
857
|
+
|
|
858
|
+
/** Child properties as nested table rows (same columns as main table, with indented Name) */
|
|
859
|
+
const NestedTableRows: React.FC<{
|
|
860
|
+
row: SlotMetadata;
|
|
861
|
+
indentLevel: number;
|
|
862
|
+
openSheet: (field: SlotMetadata) => void;
|
|
863
|
+
}> = ({ row, indentLevel, openSheet }) => {
|
|
864
|
+
const childMap = row.items?.properties ?? row.properties;
|
|
865
|
+
if (!childMap || Object.keys(childMap).length === 0) return null;
|
|
866
|
+
|
|
867
|
+
const entries = Object.entries(childMap);
|
|
868
|
+
const paddingLeft = 12 + indentLevel * 24;
|
|
869
|
+
|
|
870
|
+
return (
|
|
871
|
+
<>
|
|
872
|
+
{entries.map(([key, prop]) => {
|
|
873
|
+
const childRow: SlotMetadata = {
|
|
874
|
+
...prop,
|
|
875
|
+
name: prop.name ?? key,
|
|
876
|
+
id: prop.id ?? key,
|
|
877
|
+
key: key,
|
|
878
|
+
};
|
|
879
|
+
const childHasNested =
|
|
880
|
+
(childRow.items?.properties && Object.keys(childRow.items.properties).length > 0) ||
|
|
881
|
+
(childRow.properties && Object.keys(childRow.properties).length > 0);
|
|
882
|
+
if (childHasNested) {
|
|
883
|
+
return (
|
|
884
|
+
<ExpandableTableRow
|
|
885
|
+
key={key}
|
|
886
|
+
row={childRow}
|
|
887
|
+
openSheet={openSheet}
|
|
888
|
+
indentLevel={indentLevel}
|
|
889
|
+
/>
|
|
890
|
+
);
|
|
891
|
+
}
|
|
892
|
+
const childTypeLabel = getTypeLabel(childRow);
|
|
893
|
+
const childDefault = formatDefaultValue(childRow.default);
|
|
894
|
+
return (
|
|
895
|
+
<TableRow
|
|
896
|
+
key={key}
|
|
897
|
+
className="h-10 cursor-pointer border-b-[0.5px] hover:bg-gray-50/50 dark:hover:bg-gray-800/20"
|
|
898
|
+
onClick={() => openSheet(childRow)}
|
|
899
|
+
>
|
|
900
|
+
<TableCell
|
|
901
|
+
className="whitespace-nowrap border-l-[0.5px] border-r-[0.5px] px-3 py-1"
|
|
902
|
+
style={{ paddingLeft }}
|
|
903
|
+
>
|
|
904
|
+
<span className="truncate text-[15px] text-muted-foreground">{startCase(childRow.name)}</span>
|
|
905
|
+
</TableCell>
|
|
906
|
+
<TableCell className="overflow-hidden border-r-[0.5px] px-3.5 py-1">
|
|
907
|
+
<Badge
|
|
908
|
+
variant={getVariantForType(childRow.type)}
|
|
909
|
+
className="inline-flex max-w-full overflow-hidden rounded-xl px-2.5 align-middle"
|
|
910
|
+
>
|
|
911
|
+
<span className="block w-full truncate font-mono text-[11px]">
|
|
912
|
+
{summarizeTypeLabel(childTypeLabel)}
|
|
913
|
+
</span>
|
|
914
|
+
</Badge>
|
|
915
|
+
</TableCell>
|
|
916
|
+
<TableCell className="whitespace-nowrap border-l-[0.5px] border-r-[0.5px] px-4 py-1 text-gray-600 dark:text-gray-300">
|
|
917
|
+
{childRow.rules?.required ? 'Required' : 'Optional'}
|
|
918
|
+
</TableCell>
|
|
919
|
+
<TableCell className="border-r-[0.5px] px-4 py-1 text-gray-600 dark:text-gray-300">
|
|
920
|
+
<span
|
|
921
|
+
className={`slot-description block w-full overflow-hidden text-ellipsis whitespace-nowrap ${childDefault ? 'font-mono text-[12px] text-gray-700 dark:text-gray-200' : 'text-[11px] text-muted-foreground/70'}`}
|
|
922
|
+
>
|
|
923
|
+
{childDefault || '(no default)'}
|
|
924
|
+
</span>
|
|
925
|
+
<span className={`mt-1 block line-clamp-1 ${childRow.description ? 'text-[13px] text-muted-foreground' : 'text-[11px] text-muted-foreground/70'}`}>
|
|
926
|
+
{childRow.description || '(no description)'}
|
|
927
|
+
</span>
|
|
928
|
+
</TableCell>
|
|
929
|
+
</TableRow>
|
|
930
|
+
);
|
|
931
|
+
})}
|
|
932
|
+
</>
|
|
933
|
+
);
|
|
934
|
+
};
|
|
935
|
+
|
|
936
|
+
const ExpandableTableRow: React.FC<{
|
|
937
|
+
row: SlotMetadata;
|
|
938
|
+
openSheet: (field: SlotMetadata) => void;
|
|
939
|
+
indentLevel?: number;
|
|
940
|
+
}> = ({
|
|
941
|
+
row,
|
|
942
|
+
openSheet,
|
|
943
|
+
indentLevel = 0,
|
|
944
|
+
}) => {
|
|
945
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
946
|
+
const hasNestedStructure =
|
|
947
|
+
(row.items?.properties && Object.keys(row.items.properties).length > 0) ||
|
|
948
|
+
(row.properties && Object.keys(row.properties).length > 0);
|
|
949
|
+
const canExpand =
|
|
950
|
+
!!row.deepType || !!row.typeRefs?.length || !!row.warnings?.length || hasNestedStructure;
|
|
951
|
+
const typeLabel = getTypeLabel(row);
|
|
952
|
+
const defaultValue = formatDefaultValue(row.default);
|
|
953
|
+
const nestedCount = hasNestedStructure
|
|
954
|
+
? Object.keys(row.items?.properties ?? row.properties ?? {}).length
|
|
955
|
+
: 0;
|
|
956
|
+
const namePaddingLeft = indentLevel > 0 ? 12 + indentLevel * 24 : undefined;
|
|
957
|
+
|
|
958
|
+
const handleRowClick = (e: React.MouseEvent) => {
|
|
959
|
+
if ((e.target as HTMLElement).closest('.expand-toggle')) {
|
|
960
|
+
return;
|
|
961
|
+
}
|
|
962
|
+
openSheet(row);
|
|
963
|
+
};
|
|
964
|
+
|
|
965
|
+
const handleExpandToggle = (e: React.MouseEvent) => {
|
|
966
|
+
e.stopPropagation();
|
|
967
|
+
setIsExpanded(!isExpanded);
|
|
968
|
+
};
|
|
969
|
+
|
|
970
|
+
return (
|
|
971
|
+
<>
|
|
972
|
+
<TableRow className="h-10 cursor-pointer border-b-[0.5px]" onClick={handleRowClick}>
|
|
973
|
+
<TableCell
|
|
974
|
+
className="whitespace-nowrap border-l-[0.5px] border-r-[0.5px] px-3 py-1"
|
|
975
|
+
style={namePaddingLeft != null ? { paddingLeft: namePaddingLeft } : undefined}
|
|
976
|
+
>
|
|
977
|
+
<div className="flex items-center">
|
|
978
|
+
{canExpand ? (
|
|
979
|
+
<button
|
|
980
|
+
className="expand-toggle mr-2 flex h-5 w-5 items-center justify-center rounded hover:bg-gray-200 dark:hover:bg-gray-700"
|
|
981
|
+
onClick={handleExpandToggle}
|
|
982
|
+
aria-label={isExpanded ? 'Collapse' : 'Expand'}
|
|
983
|
+
>
|
|
984
|
+
{isExpanded ? <ChevronDown className="h-4 w-4 text-gray-500" /> : <ChevronRight className="h-4 w-4 text-gray-500" />}
|
|
985
|
+
</button>
|
|
986
|
+
) : null}
|
|
987
|
+
<span className="truncate text-[15px]">{startCase(row.name)}</span>
|
|
988
|
+
{isExpanded && hasNestedStructure && nestedCount > 0 ? (
|
|
989
|
+
<span className="ml-1.5 text-[13px] text-muted-foreground">
|
|
990
|
+
({nestedCount} item field{nestedCount !== 1 ? 's' : ''})
|
|
991
|
+
</span>
|
|
992
|
+
) : null}
|
|
993
|
+
</div>
|
|
994
|
+
</TableCell>
|
|
995
|
+
<TableCell className="overflow-hidden border-r-[0.5px] px-3.5 py-1">
|
|
996
|
+
<Badge variant={getVariantForType(row.type)} className="inline-flex max-w-full overflow-hidden rounded-xl px-2.5 align-middle">
|
|
997
|
+
<span className="block w-full truncate font-mono text-[11px]">
|
|
998
|
+
{summarizeTypeLabel(typeLabel)}
|
|
999
|
+
</span>
|
|
1000
|
+
</Badge>
|
|
1001
|
+
{row.items?.properties && Object.keys(row.items.properties).length > 0 ? (
|
|
1002
|
+
<Badge variant="outline" className="ml-1 rounded-xl px-2 text-[10px]">
|
|
1003
|
+
object[]
|
|
1004
|
+
</Badge>
|
|
1005
|
+
) : null}
|
|
1006
|
+
{row.warnings?.length ? (
|
|
1007
|
+
<TooltipProvider delayDuration={0}>
|
|
1008
|
+
<Tooltip>
|
|
1009
|
+
<TooltipTrigger asChild>
|
|
1010
|
+
<Badge variant="outline" className="ml-1 rounded-xl px-2 text-[10px]">
|
|
1011
|
+
<AlertCircle className="mr-1 h-3 w-3" />
|
|
1012
|
+
{row.warnings.length}
|
|
1013
|
+
</Badge>
|
|
1014
|
+
</TooltipTrigger>
|
|
1015
|
+
<TooltipContent className="max-w-xs rounded-sm px-2 py-1 text-[11px]">
|
|
1016
|
+
<div className="space-y-1">
|
|
1017
|
+
{row.warnings.map((warning, idx) => (
|
|
1018
|
+
<p key={`warning-${idx}`}>{warning}</p>
|
|
1019
|
+
))}
|
|
1020
|
+
</div>
|
|
1021
|
+
</TooltipContent>
|
|
1022
|
+
</Tooltip>
|
|
1023
|
+
</TooltipProvider>
|
|
1024
|
+
) : null}
|
|
1025
|
+
</TableCell>
|
|
1026
|
+
<TableCell className="whitespace-nowrap border-l-[0.5px] border-r-[0.5px] px-4 py-1 text-gray-600 dark:text-gray-300">
|
|
1027
|
+
{row.rules?.required ? 'Required' : 'Optional'}
|
|
1028
|
+
</TableCell>
|
|
1029
|
+
<TableCell className="border-r-[0.5px] px-4 py-1 text-gray-600 dark:text-gray-300">
|
|
1030
|
+
<span
|
|
1031
|
+
className={`slot-description block w-full overflow-hidden text-ellipsis whitespace-nowrap ${defaultValue ? 'font-mono text-[12px] text-gray-700 dark:text-gray-200' : 'text-[11px] text-muted-foreground/70'}`}
|
|
1032
|
+
>
|
|
1033
|
+
{defaultValue || '(no default)'}
|
|
1034
|
+
</span>
|
|
1035
|
+
<span className={`mt-1 block line-clamp-1 ${row.description ? 'text-[13px] text-muted-foreground' : 'text-[11px] text-muted-foreground/70'}`}>
|
|
1036
|
+
{row.description || '(no description)'}
|
|
1037
|
+
</span>
|
|
1038
|
+
</TableCell>
|
|
1039
|
+
</TableRow>
|
|
1040
|
+
|
|
1041
|
+
{isExpanded && canExpand ? (
|
|
1042
|
+
row.deepType ? (
|
|
1043
|
+
<TableRow className="border-b-[0.5px] bg-gray-50/40 dark:bg-gray-800/30">
|
|
1044
|
+
<TableCell colSpan={4} className="border-l-[0.5px] border-r-[0.5px] px-4 py-3">
|
|
1045
|
+
<div className="space-y-3">
|
|
1046
|
+
<div className="flex flex-wrap items-center gap-2 border-b border-gray-200/80 pb-2 dark:border-gray-800">
|
|
1047
|
+
<p className="text-xs font-medium">Type tree</p>
|
|
1048
|
+
<Badge variant="outline" className="rounded-xl px-2 text-[10px]">
|
|
1049
|
+
{typeLabel}
|
|
1050
|
+
</Badge>
|
|
1051
|
+
{row.deepType?.truncated ? (
|
|
1052
|
+
<Badge variant="outline" className="rounded-xl px-2 text-[10px]">
|
|
1053
|
+
truncated
|
|
1054
|
+
</Badge>
|
|
1055
|
+
) : null}
|
|
1056
|
+
{row.deepType?.cycleDetected ? (
|
|
1057
|
+
<Badge variant="outline" className="rounded-xl px-2 text-[10px]">
|
|
1058
|
+
cycleDetected
|
|
1059
|
+
</Badge>
|
|
1060
|
+
) : null}
|
|
1061
|
+
</div>
|
|
1062
|
+
{row.typeRefs?.length ? (
|
|
1063
|
+
<div>
|
|
1064
|
+
<p className="mb-1 text-[10px] font-medium uppercase tracking-wide text-muted-foreground">Type refs</p>
|
|
1065
|
+
<div className="flex flex-wrap gap-1">
|
|
1066
|
+
{row.typeRefs.map((refName) => (
|
|
1067
|
+
<Badge key={refName} variant="outline" className="rounded-xl px-2 text-[10px]">
|
|
1068
|
+
{refName}
|
|
1069
|
+
</Badge>
|
|
1070
|
+
))}
|
|
1071
|
+
</div>
|
|
1072
|
+
</div>
|
|
1073
|
+
) : null}
|
|
1074
|
+
<AnnotationList annotations={row.annotations} />
|
|
1075
|
+
<TypeNodeTree node={row.deepType} />
|
|
1076
|
+
</div>
|
|
1077
|
+
</TableCell>
|
|
1078
|
+
</TableRow>
|
|
1079
|
+
) : hasNestedStructure ? (
|
|
1080
|
+
<NestedTableRows row={row} indentLevel={indentLevel + 1} openSheet={openSheet} />
|
|
1081
|
+
) : (
|
|
1082
|
+
<TableRow className="border-b-[0.5px] bg-gray-50/40 dark:bg-gray-800/30">
|
|
1083
|
+
<TableCell colSpan={4} className="border-l-[0.5px] border-r-[0.5px] px-4 py-3">
|
|
1084
|
+
<p className="mt-2 text-xs text-muted-foreground">No deep type available. Fallback: {row.docgenType || row.generic || row.type || 'unknown'}</p>
|
|
1085
|
+
</TableCell>
|
|
1086
|
+
</TableRow>
|
|
1087
|
+
)
|
|
1088
|
+
) : null}
|
|
1089
|
+
</>
|
|
1090
|
+
);
|
|
1091
|
+
};
|