figma-inspect-cli 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +156 -0
- package/dist/bin/figma-inspect.d.ts +3 -0
- package/dist/bin/figma-inspect.d.ts.map +1 -0
- package/dist/bin/figma-inspect.js +19 -0
- package/dist/bin/figma-inspect.js.map +1 -0
- package/dist/cli/errors.d.ts +3 -0
- package/dist/cli/errors.d.ts.map +1 -0
- package/dist/cli/errors.js +3 -0
- package/dist/cli/errors.js.map +1 -0
- package/dist/cli/export-component-set.d.ts +21 -0
- package/dist/cli/export-component-set.d.ts.map +1 -0
- package/dist/cli/export-component-set.js +173 -0
- package/dist/cli/export-component-set.js.map +1 -0
- package/dist/cli/export-contract.d.ts +20 -0
- package/dist/cli/export-contract.d.ts.map +1 -0
- package/dist/cli/export-contract.js +48 -0
- package/dist/cli/export-contract.js.map +1 -0
- package/dist/cli/export-node-contract.d.ts +17 -0
- package/dist/cli/export-node-contract.d.ts.map +1 -0
- package/dist/cli/export-node-contract.js +93 -0
- package/dist/cli/export-node-contract.js.map +1 -0
- package/dist/cli/export-result.d.ts +17 -0
- package/dist/cli/export-result.d.ts.map +1 -0
- package/dist/cli/export-result.js +22 -0
- package/dist/cli/export-result.js.map +1 -0
- package/dist/cli/export-team-index.d.ts +18 -0
- package/dist/cli/export-team-index.d.ts.map +1 -0
- package/dist/cli/export-team-index.js +121 -0
- package/dist/cli/export-team-index.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +3 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/output.d.ts +13 -0
- package/dist/cli/output.d.ts.map +1 -0
- package/dist/cli/output.js +26 -0
- package/dist/cli/output.js.map +1 -0
- package/dist/cli/parse-args.d.ts +3 -0
- package/dist/cli/parse-args.d.ts.map +1 -0
- package/dist/cli/parse-args.js +790 -0
- package/dist/cli/parse-args.js.map +1 -0
- package/dist/cli/run-cli.d.ts +3 -0
- package/dist/cli/run-cli.d.ts.map +1 -0
- package/dist/cli/run-cli.js +416 -0
- package/dist/cli/run-cli.js.map +1 -0
- package/dist/cli/types.d.ts +114 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/cli/types.js +2 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/cli/usage.d.ts +2 -0
- package/dist/cli/usage.d.ts.map +1 -0
- package/dist/cli/usage.js +75 -0
- package/dist/cli/usage.js.map +1 -0
- package/dist/figma-api/cache/cached-request.d.ts +8 -0
- package/dist/figma-api/cache/cached-request.d.ts.map +1 -0
- package/dist/figma-api/cache/cached-request.js +100 -0
- package/dist/figma-api/cache/cached-request.js.map +1 -0
- package/dist/figma-api/cache/constants.d.ts +5 -0
- package/dist/figma-api/cache/constants.d.ts.map +1 -0
- package/dist/figma-api/cache/constants.js +5 -0
- package/dist/figma-api/cache/constants.js.map +1 -0
- package/dist/figma-api/cache/extract-metadata.d.ts +3 -0
- package/dist/figma-api/cache/extract-metadata.d.ts.map +1 -0
- package/dist/figma-api/cache/extract-metadata.js +13 -0
- package/dist/figma-api/cache/extract-metadata.js.map +1 -0
- package/dist/figma-api/cache/index.d.ts +3 -0
- package/dist/figma-api/cache/index.d.ts.map +1 -0
- package/dist/figma-api/cache/index.js +3 -0
- package/dist/figma-api/cache/index.js.map +1 -0
- package/dist/figma-api/cache/store.d.ts +10 -0
- package/dist/figma-api/cache/store.d.ts.map +1 -0
- package/dist/figma-api/cache/store.js +53 -0
- package/dist/figma-api/cache/store.js.map +1 -0
- package/dist/figma-api/cache/types.d.ts +20 -0
- package/dist/figma-api/cache/types.d.ts.map +1 -0
- package/dist/figma-api/cache/types.js +2 -0
- package/dist/figma-api/cache/types.js.map +1 -0
- package/dist/figma-api/cache/url.d.ts +5 -0
- package/dist/figma-api/cache/url.d.ts.map +1 -0
- package/dist/figma-api/cache/url.js +20 -0
- package/dist/figma-api/cache/url.js.map +1 -0
- package/dist/figma-api/constants.d.ts +2 -0
- package/dist/figma-api/constants.d.ts.map +1 -0
- package/dist/figma-api/constants.js +2 -0
- package/dist/figma-api/constants.js.map +1 -0
- package/dist/figma-api/fetch-with-retry.d.ts +2 -0
- package/dist/figma-api/fetch-with-retry.d.ts.map +1 -0
- package/dist/figma-api/fetch-with-retry.js +48 -0
- package/dist/figma-api/fetch-with-retry.js.map +1 -0
- package/dist/figma-api/figma-api-error.d.ts +4 -0
- package/dist/figma-api/figma-api-error.d.ts.map +1 -0
- package/dist/figma-api/figma-api-error.js +7 -0
- package/dist/figma-api/figma-api-error.js.map +1 -0
- package/dist/figma-api/figma-request.d.ts +2 -0
- package/dist/figma-api/figma-request.d.ts.map +1 -0
- package/dist/figma-api/figma-request.js +21 -0
- package/dist/figma-api/figma-request.js.map +1 -0
- package/dist/figma-api/format-figma-error.d.ts +2 -0
- package/dist/figma-api/format-figma-error.d.ts.map +1 -0
- package/dist/figma-api/format-figma-error.js +24 -0
- package/dist/figma-api/format-figma-error.js.map +1 -0
- package/dist/figma-api/get-component-set.d.ts +4 -0
- package/dist/figma-api/get-component-set.d.ts.map +1 -0
- package/dist/figma-api/get-component-set.js +8 -0
- package/dist/figma-api/get-component-set.js.map +1 -0
- package/dist/figma-api/get-file-images.d.ts +4 -0
- package/dist/figma-api/get-file-images.d.ts.map +1 -0
- package/dist/figma-api/get-file-images.js +45 -0
- package/dist/figma-api/get-file-images.js.map +1 -0
- package/dist/figma-api/get-file-node.d.ts +3 -0
- package/dist/figma-api/get-file-node.d.ts.map +1 -0
- package/dist/figma-api/get-file-node.js +8 -0
- package/dist/figma-api/get-file-node.js.map +1 -0
- package/dist/figma-api/get-file.d.ts +3 -0
- package/dist/figma-api/get-file.d.ts.map +1 -0
- package/dist/figma-api/get-file.js +6 -0
- package/dist/figma-api/get-file.js.map +1 -0
- package/dist/figma-api/index.d.ts +11 -0
- package/dist/figma-api/index.d.ts.map +1 -0
- package/dist/figma-api/index.js +11 -0
- package/dist/figma-api/index.js.map +1 -0
- package/dist/figma-api/list-file-component-sets.d.ts +4 -0
- package/dist/figma-api/list-file-component-sets.d.ts.map +1 -0
- package/dist/figma-api/list-file-component-sets.js +8 -0
- package/dist/figma-api/list-file-component-sets.js.map +1 -0
- package/dist/figma-api/list-file-components.d.ts +5 -0
- package/dist/figma-api/list-file-components.d.ts.map +1 -0
- package/dist/figma-api/list-file-components.js +13 -0
- package/dist/figma-api/list-file-components.js.map +1 -0
- package/dist/figma-api/list-file-pages.d.ts +4 -0
- package/dist/figma-api/list-file-pages.d.ts.map +1 -0
- package/dist/figma-api/list-file-pages.js +10 -0
- package/dist/figma-api/list-file-pages.js.map +1 -0
- package/dist/figma-api/list-project-files.d.ts +4 -0
- package/dist/figma-api/list-project-files.d.ts.map +1 -0
- package/dist/figma-api/list-project-files.js +8 -0
- package/dist/figma-api/list-project-files.js.map +1 -0
- package/dist/figma-api/list-team-component-sets.d.ts +4 -0
- package/dist/figma-api/list-team-component-sets.d.ts.map +1 -0
- package/dist/figma-api/list-team-component-sets.js +19 -0
- package/dist/figma-api/list-team-component-sets.js.map +1 -0
- package/dist/figma-api/list-team-project-files.d.ts +4 -0
- package/dist/figma-api/list-team-project-files.d.ts.map +1 -0
- package/dist/figma-api/list-team-project-files.js +19 -0
- package/dist/figma-api/list-team-project-files.js.map +1 -0
- package/dist/figma-api/list-team-projects.d.ts +4 -0
- package/dist/figma-api/list-team-projects.d.ts.map +1 -0
- package/dist/figma-api/list-team-projects.js +8 -0
- package/dist/figma-api/list-team-projects.js.map +1 -0
- package/dist/figma-api/schemas.d.ts +95 -0
- package/dist/figma-api/schemas.d.ts.map +1 -0
- package/dist/figma-api/schemas.js +154 -0
- package/dist/figma-api/schemas.js.map +1 -0
- package/dist/figma-api/types.d.ts +60 -0
- package/dist/figma-api/types.d.ts.map +1 -0
- package/dist/figma-api/types.js +2 -0
- package/dist/figma-api/types.js.map +1 -0
- package/dist/inspect/component-set-context.d.ts +11 -0
- package/dist/inspect/component-set-context.d.ts.map +1 -0
- package/dist/inspect/component-set-context.js +71 -0
- package/dist/inspect/component-set-context.js.map +1 -0
- package/dist/inspect/component-set-lookup.d.ts +6 -0
- package/dist/inspect/component-set-lookup.d.ts.map +1 -0
- package/dist/inspect/component-set-lookup.js +40 -0
- package/dist/inspect/component-set-lookup.js.map +1 -0
- package/dist/inspect/component-set-pseudocode/asset-backed-contract.d.ts +3 -0
- package/dist/inspect/component-set-pseudocode/asset-backed-contract.d.ts.map +1 -0
- package/dist/inspect/component-set-pseudocode/asset-backed-contract.js +34 -0
- package/dist/inspect/component-set-pseudocode/asset-backed-contract.js.map +1 -0
- package/dist/inspect/component-set-pseudocode/assets-contract.d.ts +9 -0
- package/dist/inspect/component-set-pseudocode/assets-contract.d.ts.map +1 -0
- package/dist/inspect/component-set-pseudocode/assets-contract.js +4 -0
- package/dist/inspect/component-set-pseudocode/assets-contract.js.map +1 -0
- package/dist/inspect/component-set-pseudocode/baseline-contract.d.ts +17 -0
- package/dist/inspect/component-set-pseudocode/baseline-contract.d.ts.map +1 -0
- package/dist/inspect/component-set-pseudocode/baseline-contract.js +67 -0
- package/dist/inspect/component-set-pseudocode/baseline-contract.js.map +1 -0
- package/dist/inspect/component-set-pseudocode/build-pseudocode.d.ts +24 -0
- package/dist/inspect/component-set-pseudocode/build-pseudocode.d.ts.map +1 -0
- package/dist/inspect/component-set-pseudocode/build-pseudocode.js +83 -0
- package/dist/inspect/component-set-pseudocode/build-pseudocode.js.map +1 -0
- package/dist/inspect/component-set-pseudocode/index.d.ts +2 -0
- package/dist/inspect/component-set-pseudocode/index.d.ts.map +1 -0
- package/dist/inspect/component-set-pseudocode/index.js +2 -0
- package/dist/inspect/component-set-pseudocode/index.js.map +1 -0
- package/dist/inspect/component-set-pseudocode/infer.d.ts +4 -0
- package/dist/inspect/component-set-pseudocode/infer.d.ts.map +1 -0
- package/dist/inspect/component-set-pseudocode/infer.js +426 -0
- package/dist/inspect/component-set-pseudocode/infer.js.map +1 -0
- package/dist/inspect/component-set-pseudocode/meta-contract.d.ts +27 -0
- package/dist/inspect/component-set-pseudocode/meta-contract.d.ts.map +1 -0
- package/dist/inspect/component-set-pseudocode/meta-contract.js +136 -0
- package/dist/inspect/component-set-pseudocode/meta-contract.js.map +1 -0
- package/dist/inspect/component-set-pseudocode/slim-node-guards.d.ts +14 -0
- package/dist/inspect/component-set-pseudocode/slim-node-guards.d.ts.map +1 -0
- package/dist/inspect/component-set-pseudocode/slim-node-guards.js +28 -0
- package/dist/inspect/component-set-pseudocode/slim-node-guards.js.map +1 -0
- package/dist/inspect/component-set-pseudocode/structure-contract.d.ts +71 -0
- package/dist/inspect/component-set-pseudocode/structure-contract.d.ts.map +1 -0
- package/dist/inspect/component-set-pseudocode/structure-contract.js +281 -0
- package/dist/inspect/component-set-pseudocode/structure-contract.js.map +1 -0
- package/dist/inspect/component-set-pseudocode/structure-dsl.d.ts +3 -0
- package/dist/inspect/component-set-pseudocode/structure-dsl.d.ts.map +1 -0
- package/dist/inspect/component-set-pseudocode/structure-dsl.js +170 -0
- package/dist/inspect/component-set-pseudocode/structure-dsl.js.map +1 -0
- package/dist/inspect/component-set-pseudocode/types.d.ts +44 -0
- package/dist/inspect/component-set-pseudocode/types.d.ts.map +1 -0
- package/dist/inspect/component-set-pseudocode/types.js +2 -0
- package/dist/inspect/component-set-pseudocode/types.js.map +1 -0
- package/dist/inspect/component-set-pseudocode/universal.d.ts +14 -0
- package/dist/inspect/component-set-pseudocode/universal.d.ts.map +1 -0
- package/dist/inspect/component-set-pseudocode/universal.js +393 -0
- package/dist/inspect/component-set-pseudocode/universal.js.map +1 -0
- package/dist/inspect/component-set-spec/bound-variables.d.ts +14 -0
- package/dist/inspect/component-set-spec/bound-variables.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/bound-variables.js +53 -0
- package/dist/inspect/component-set-spec/bound-variables.js.map +1 -0
- package/dist/inspect/component-set-spec/build-spec.d.ts +9 -0
- package/dist/inspect/component-set-spec/build-spec.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/build-spec.js +102 -0
- package/dist/inspect/component-set-spec/build-spec.js.map +1 -0
- package/dist/inspect/component-set-spec/compact-spec.d.ts +3 -0
- package/dist/inspect/component-set-spec/compact-spec.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/compact-spec.js +357 -0
- package/dist/inspect/component-set-spec/compact-spec.js.map +1 -0
- package/dist/inspect/component-set-spec/extract-slots.d.ts +5 -0
- package/dist/inspect/component-set-spec/extract-slots.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/extract-slots.js +57 -0
- package/dist/inspect/component-set-spec/extract-slots.js.map +1 -0
- package/dist/inspect/component-set-spec/figma-node.d.ts +9 -0
- package/dist/inspect/component-set-spec/figma-node.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/figma-node.js +31 -0
- package/dist/inspect/component-set-spec/figma-node.js.map +1 -0
- package/dist/inspect/component-set-spec/index.d.ts +2 -0
- package/dist/inspect/component-set-spec/index.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/index.js +2 -0
- package/dist/inspect/component-set-spec/index.js.map +1 -0
- package/dist/inspect/component-set-spec/parse-props.d.ts +9 -0
- package/dist/inspect/component-set-spec/parse-props.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/parse-props.js +96 -0
- package/dist/inspect/component-set-spec/parse-props.js.map +1 -0
- package/dist/inspect/component-set-spec/prop-name.d.ts +5 -0
- package/dist/inspect/component-set-spec/prop-name.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/prop-name.js +26 -0
- package/dist/inspect/component-set-spec/prop-name.js.map +1 -0
- package/dist/inspect/component-set-spec/resolve-tokens.d.ts +4 -0
- package/dist/inspect/component-set-spec/resolve-tokens.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/resolve-tokens.js +42 -0
- package/dist/inspect/component-set-spec/resolve-tokens.js.map +1 -0
- package/dist/inspect/component-set-spec/slim-context.d.ts +6 -0
- package/dist/inspect/component-set-spec/slim-context.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/slim-context.js +2 -0
- package/dist/inspect/component-set-spec/slim-context.js.map +1 -0
- package/dist/inspect/component-set-spec/slim-node.d.ts +5 -0
- package/dist/inspect/component-set-spec/slim-node.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/slim-node.js +393 -0
- package/dist/inspect/component-set-spec/slim-node.js.map +1 -0
- package/dist/inspect/component-set-spec/slim-text-export.d.ts +8 -0
- package/dist/inspect/component-set-spec/slim-text-export.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/slim-text-export.js +74 -0
- package/dist/inspect/component-set-spec/slim-text-export.js.map +1 -0
- package/dist/inspect/component-set-spec/team-component-registry.d.ts +19 -0
- package/dist/inspect/component-set-spec/team-component-registry.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/team-component-registry.js +96 -0
- package/dist/inspect/component-set-spec/team-component-registry.js.map +1 -0
- package/dist/inspect/component-set-spec/types.d.ts +127 -0
- package/dist/inspect/component-set-spec/types.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/types.js +2 -0
- package/dist/inspect/component-set-spec/types.js.map +1 -0
- package/dist/inspect/component-set-spec/variable-registry.d.ts +8 -0
- package/dist/inspect/component-set-spec/variable-registry.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/variable-registry.js +74 -0
- package/dist/inspect/component-set-spec/variable-registry.js.map +1 -0
- package/dist/inspect/component-set-spec/variant-axes.d.ts +2 -0
- package/dist/inspect/component-set-spec/variant-axes.d.ts.map +1 -0
- package/dist/inspect/component-set-spec/variant-axes.js +14 -0
- package/dist/inspect/component-set-spec/variant-axes.js.map +1 -0
- package/dist/inspect/contract/contract-format.d.ts +5 -0
- package/dist/inspect/contract/contract-format.d.ts.map +1 -0
- package/dist/inspect/contract/contract-format.js +26 -0
- package/dist/inspect/contract/contract-format.js.map +1 -0
- package/dist/inspect/contract/contract-lock.d.ts +75 -0
- package/dist/inspect/contract/contract-lock.d.ts.map +1 -0
- package/dist/inspect/contract/contract-lock.js +326 -0
- package/dist/inspect/contract/contract-lock.js.map +1 -0
- package/dist/inspect/contract/contract-schema.d.ts +51 -0
- package/dist/inspect/contract/contract-schema.d.ts.map +1 -0
- package/dist/inspect/contract/contract-schema.js +130 -0
- package/dist/inspect/contract/contract-schema.js.map +1 -0
- package/dist/inspect/contract/fingerprint.d.ts +9 -0
- package/dist/inspect/contract/fingerprint.d.ts.map +1 -0
- package/dist/inspect/contract/fingerprint.js +301 -0
- package/dist/inspect/contract/fingerprint.js.map +1 -0
- package/dist/inspect/contract/lock-metadata.d.ts +30 -0
- package/dist/inspect/contract/lock-metadata.d.ts.map +1 -0
- package/dist/inspect/contract/lock-metadata.js +101 -0
- package/dist/inspect/contract/lock-metadata.js.map +1 -0
- package/dist/inspect/contract/stable-stringify.d.ts +2 -0
- package/dist/inspect/contract/stable-stringify.d.ts.map +1 -0
- package/dist/inspect/contract/stable-stringify.js +14 -0
- package/dist/inspect/contract/stable-stringify.js.map +1 -0
- package/dist/inspect/contract/verify-component-contract.d.ts +19 -0
- package/dist/inspect/contract/verify-component-contract.d.ts.map +1 -0
- package/dist/inspect/contract/verify-component-contract.js +126 -0
- package/dist/inspect/contract/verify-component-contract.js.map +1 -0
- package/dist/inspect/errors.d.ts +4 -0
- package/dist/inspect/errors.d.ts.map +1 -0
- package/dist/inspect/errors.js +7 -0
- package/dist/inspect/errors.js.map +1 -0
- package/dist/inspect/export/assert-asset-exportable.d.ts +3 -0
- package/dist/inspect/export/assert-asset-exportable.d.ts.map +1 -0
- package/dist/inspect/export/assert-asset-exportable.js +45 -0
- package/dist/inspect/export/assert-asset-exportable.js.map +1 -0
- package/dist/inspect/export/export-nested-assets.d.ts +94 -0
- package/dist/inspect/export/export-nested-assets.d.ts.map +1 -0
- package/dist/inspect/export/export-nested-assets.js +333 -0
- package/dist/inspect/export/export-nested-assets.js.map +1 -0
- package/dist/inspect/export/export-node-preview.d.ts +24 -0
- package/dist/inspect/export/export-node-preview.d.ts.map +1 -0
- package/dist/inspect/export/export-node-preview.js +34 -0
- package/dist/inspect/export/export-node-preview.js.map +1 -0
- package/dist/inspect/export/export-variant-assets.d.ts +18 -0
- package/dist/inspect/export/export-variant-assets.d.ts.map +1 -0
- package/dist/inspect/export/export-variant-assets.js +127 -0
- package/dist/inspect/export/export-variant-assets.js.map +1 -0
- package/dist/inspect/export/normalize-exported-svg.d.ts +2 -0
- package/dist/inspect/export/normalize-exported-svg.d.ts.map +1 -0
- package/dist/inspect/export/normalize-exported-svg.js +15 -0
- package/dist/inspect/export/normalize-exported-svg.js.map +1 -0
- package/dist/inspect/export/rendered-image-bytes.d.ts +4 -0
- package/dist/inspect/export/rendered-image-bytes.d.ts.map +1 -0
- package/dist/inspect/export/rendered-image-bytes.js +24 -0
- package/dist/inspect/export/rendered-image-bytes.js.map +1 -0
- package/dist/inspect/export-contract-target.d.ts +7 -0
- package/dist/inspect/export-contract-target.d.ts.map +1 -0
- package/dist/inspect/export-contract-target.js +33 -0
- package/dist/inspect/export-contract-target.js.map +1 -0
- package/dist/inspect/fetch-file-entry.d.ts +4 -0
- package/dist/inspect/fetch-file-entry.d.ts.map +1 -0
- package/dist/inspect/fetch-file-entry.js +7 -0
- package/dist/inspect/fetch-file-entry.js.map +1 -0
- package/dist/inspect/fetch-file-node-entry.d.ts +4 -0
- package/dist/inspect/fetch-file-node-entry.d.ts.map +1 -0
- package/dist/inspect/fetch-file-node-entry.js +7 -0
- package/dist/inspect/fetch-file-node-entry.js.map +1 -0
- package/dist/inspect/figma-node-url.d.ts +3 -0
- package/dist/inspect/figma-node-url.d.ts.map +1 -0
- package/dist/inspect/figma-node-url.js +30 -0
- package/dist/inspect/figma-node-url.js.map +1 -0
- package/dist/inspect/get-node-component-set.d.ts +5 -0
- package/dist/inspect/get-node-component-set.d.ts.map +1 -0
- package/dist/inspect/get-node-component-set.js +10 -0
- package/dist/inspect/get-node-component-set.js.map +1 -0
- package/dist/inspect/index.d.ts +17 -0
- package/dist/inspect/index.d.ts.map +1 -0
- package/dist/inspect/index.js +17 -0
- package/dist/inspect/index.js.map +1 -0
- package/dist/inspect/list-all-component-sets.d.ts +3 -0
- package/dist/inspect/list-all-component-sets.d.ts.map +1 -0
- package/dist/inspect/list-all-component-sets.js +27 -0
- package/dist/inspect/list-all-component-sets.js.map +1 -0
- package/dist/inspect/list-component-set-properties.d.ts +4 -0
- package/dist/inspect/list-component-set-properties.d.ts.map +1 -0
- package/dist/inspect/list-component-set-properties.js +73 -0
- package/dist/inspect/list-component-set-properties.js.map +1 -0
- package/dist/inspect/node-contract/build-node-contract.d.ts +12 -0
- package/dist/inspect/node-contract/build-node-contract.d.ts.map +1 -0
- package/dist/inspect/node-contract/build-node-contract.js +212 -0
- package/dist/inspect/node-contract/build-node-contract.js.map +1 -0
- package/dist/inspect/node-contract/dependencies.d.ts +5 -0
- package/dist/inspect/node-contract/dependencies.d.ts.map +1 -0
- package/dist/inspect/node-contract/dependencies.js +84 -0
- package/dist/inspect/node-contract/dependencies.js.map +1 -0
- package/dist/inspect/node-contract/index.d.ts +6 -0
- package/dist/inspect/node-contract/index.d.ts.map +1 -0
- package/dist/inspect/node-contract/index.js +6 -0
- package/dist/inspect/node-contract/index.js.map +1 -0
- package/dist/inspect/node-contract/node-kind.d.ts +9 -0
- package/dist/inspect/node-contract/node-kind.d.ts.map +1 -0
- package/dist/inspect/node-contract/node-kind.js +31 -0
- package/dist/inspect/node-contract/node-kind.js.map +1 -0
- package/dist/inspect/node-contract/node-lock.d.ts +6 -0
- package/dist/inspect/node-contract/node-lock.d.ts.map +1 -0
- package/dist/inspect/node-contract/node-lock.js +181 -0
- package/dist/inspect/node-contract/node-lock.js.map +1 -0
- package/dist/inspect/node-contract/node-schema.d.ts +14 -0
- package/dist/inspect/node-contract/node-schema.d.ts.map +1 -0
- package/dist/inspect/node-contract/node-schema.js +137 -0
- package/dist/inspect/node-contract/node-schema.js.map +1 -0
- package/dist/inspect/node-contract/paths.d.ts +10 -0
- package/dist/inspect/node-contract/paths.d.ts.map +1 -0
- package/dist/inspect/node-contract/paths.js +29 -0
- package/dist/inspect/node-contract/paths.js.map +1 -0
- package/dist/inspect/node-contract/tokens.d.ts +4 -0
- package/dist/inspect/node-contract/tokens.d.ts.map +1 -0
- package/dist/inspect/node-contract/tokens.js +30 -0
- package/dist/inspect/node-contract/tokens.js.map +1 -0
- package/dist/inspect/node-contract/types.d.ts +84 -0
- package/dist/inspect/node-contract/types.d.ts.map +1 -0
- package/dist/inspect/node-contract/types.js +2 -0
- package/dist/inspect/node-contract/types.js.map +1 -0
- package/dist/inspect/node-contract/verify-node-contract.d.ts +20 -0
- package/dist/inspect/node-contract/verify-node-contract.d.ts.map +1 -0
- package/dist/inspect/node-contract/verify-node-contract.js +131 -0
- package/dist/inspect/node-contract/verify-node-contract.js.map +1 -0
- package/dist/inspect/resolve-team-component-set.d.ts +14 -0
- package/dist/inspect/resolve-team-component-set.d.ts.map +1 -0
- package/dist/inspect/resolve-team-component-set.js +77 -0
- package/dist/inspect/resolve-team-component-set.js.map +1 -0
- package/dist/inspect/schemas.d.ts +37 -0
- package/dist/inspect/schemas.d.ts.map +1 -0
- package/dist/inspect/schemas.js +79 -0
- package/dist/inspect/schemas.js.map +1 -0
- package/dist/inspect/team-index.d.ts +76 -0
- package/dist/inspect/team-index.d.ts.map +1 -0
- package/dist/inspect/team-index.js +361 -0
- package/dist/inspect/team-index.js.map +1 -0
- package/dist/inspect/types.d.ts +46 -0
- package/dist/inspect/types.d.ts.map +1 -0
- package/dist/inspect/types.js +2 -0
- package/dist/inspect/types.js.map +1 -0
- package/dist/test/fixtures.d.ts +3 -0
- package/dist/test/fixtures.d.ts.map +1 -0
- package/dist/test/fixtures.js +6 -0
- package/dist/test/fixtures.js.map +1 -0
- package/dist/zod/parse-valid-entries.d.ts +4 -0
- package/dist/zod/parse-valid-entries.d.ts.map +1 -0
- package/dist/zod/parse-valid-entries.js +20 -0
- package/dist/zod/parse-valid-entries.js.map +1 -0
- package/package.json +39 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { instanceSlotKey } from "../component-set-spec/extract-slots.js";
|
|
2
|
+
import { isRecord, readArray, readChildren, readRecord, readString, } from "../component-set-spec/figma-node.js";
|
|
3
|
+
import { FigmaInspectError } from "../errors.js";
|
|
4
|
+
function readPublishedComponentSetKey(definition) {
|
|
5
|
+
const preferredValues = readArray(definition, "preferredValues");
|
|
6
|
+
const first = preferredValues?.find(isRecord);
|
|
7
|
+
if (!first) {
|
|
8
|
+
return undefined;
|
|
9
|
+
}
|
|
10
|
+
if (readString(first, "type") !== "COMPONENT_SET") {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
return readString(first, "key");
|
|
14
|
+
}
|
|
15
|
+
function addTeamDependency(seen, entry) {
|
|
16
|
+
if (!entry) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
seen.set(entry.id, entry);
|
|
20
|
+
}
|
|
21
|
+
function collectPublishedComponentSetDependencies(node, teamComponents, seen) {
|
|
22
|
+
if (readString(node, "type") === "INSTANCE") {
|
|
23
|
+
const name = readString(node, "name");
|
|
24
|
+
if (name) {
|
|
25
|
+
addTeamDependency(seen, teamComponents.findByName(name));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
for (const child of readChildren(node)) {
|
|
29
|
+
collectPublishedComponentSetDependencies(child, teamComponents, seen);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function resolveComponentEntry(spec, componentSetId, teamComponents) {
|
|
33
|
+
if (!teamComponents) {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
return (teamComponents.findByName(spec.name) ??
|
|
37
|
+
teamComponents.findById(componentSetId));
|
|
38
|
+
}
|
|
39
|
+
function buildProps(spec) {
|
|
40
|
+
const props = {};
|
|
41
|
+
for (const [name, definition] of Object.entries(spec.props)) {
|
|
42
|
+
const entry = { type: definition.type };
|
|
43
|
+
if (definition.type === "instance") {
|
|
44
|
+
entry.default = name;
|
|
45
|
+
}
|
|
46
|
+
else if (definition.default !== undefined) {
|
|
47
|
+
entry.default = definition.default;
|
|
48
|
+
}
|
|
49
|
+
if (definition.type === "variant" && definition.options) {
|
|
50
|
+
entry.options = [...definition.options];
|
|
51
|
+
}
|
|
52
|
+
props[name] = entry;
|
|
53
|
+
}
|
|
54
|
+
return Object.keys(props).length > 0 ? props : undefined;
|
|
55
|
+
}
|
|
56
|
+
function collectNestedInstanceSlots(node, slots, swapSlotKeys) {
|
|
57
|
+
if (readString(node, "type") === "INSTANCE") {
|
|
58
|
+
const name = readString(node, "name");
|
|
59
|
+
if (name) {
|
|
60
|
+
const slotKey = instanceSlotKey(name);
|
|
61
|
+
if (!swapSlotKeys.has(slotKey) && !slots[slotKey]) {
|
|
62
|
+
slots[slotKey] = {
|
|
63
|
+
kind: "nested",
|
|
64
|
+
component: name,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
for (const child of readChildren(node)) {
|
|
70
|
+
collectNestedInstanceSlots(child, slots, swapSlotKeys);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function buildSlots(componentSet, spec) {
|
|
74
|
+
const slots = {};
|
|
75
|
+
for (const [name, definition] of Object.entries(spec.props)) {
|
|
76
|
+
if (definition.type === "instance") {
|
|
77
|
+
slots[name] = {
|
|
78
|
+
kind: "swap",
|
|
79
|
+
component: name,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
const swapSlotKeys = new Set(Object.keys(slots));
|
|
84
|
+
for (const variant of readChildren(componentSet)) {
|
|
85
|
+
if (readString(variant, "type") !== "COMPONENT") {
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
collectNestedInstanceSlots(variant, slots, swapSlotKeys);
|
|
89
|
+
}
|
|
90
|
+
return Object.keys(slots).length > 0 ? slots : undefined;
|
|
91
|
+
}
|
|
92
|
+
function buildDependencies(componentSet, teamComponents, componentEntry) {
|
|
93
|
+
if (!teamComponents) {
|
|
94
|
+
return undefined;
|
|
95
|
+
}
|
|
96
|
+
const seen = new Map();
|
|
97
|
+
const definitions = readRecord(componentSet, "componentPropertyDefinitions");
|
|
98
|
+
if (definitions) {
|
|
99
|
+
for (const rawDefinition of Object.values(definitions)) {
|
|
100
|
+
if (!isRecord(rawDefinition)) {
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
const componentSetKey = readPublishedComponentSetKey(rawDefinition);
|
|
104
|
+
if (componentSetKey) {
|
|
105
|
+
addTeamDependency(seen, teamComponents.findByKey(componentSetKey));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
collectPublishedComponentSetDependencies(componentSet, teamComponents, seen);
|
|
110
|
+
if (componentEntry) {
|
|
111
|
+
seen.delete(componentEntry.id);
|
|
112
|
+
}
|
|
113
|
+
if (seen.size === 0) {
|
|
114
|
+
return undefined;
|
|
115
|
+
}
|
|
116
|
+
return [...seen.values()].sort((left, right) => left.name.localeCompare(right.name));
|
|
117
|
+
}
|
|
118
|
+
export function buildMetaContract(componentSet, spec, context) {
|
|
119
|
+
const componentSetId = readString(componentSet, "id");
|
|
120
|
+
if (!componentSetId) {
|
|
121
|
+
throw new FigmaInspectError("COMPONENT_SET is missing id.");
|
|
122
|
+
}
|
|
123
|
+
const component = context?.component ??
|
|
124
|
+
resolveComponentEntry(spec, componentSetId, context?.teamComponents);
|
|
125
|
+
const props = buildProps(spec);
|
|
126
|
+
const slots = buildSlots(componentSet, spec);
|
|
127
|
+
const dependencies = buildDependencies(componentSet, context?.teamComponents, component);
|
|
128
|
+
return {
|
|
129
|
+
version: 1,
|
|
130
|
+
...(component ? { component } : {}),
|
|
131
|
+
...(props ? { props } : {}),
|
|
132
|
+
...(slots ? { slots } : {}),
|
|
133
|
+
...(dependencies ? { dependencies } : {}),
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=meta-contract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta-contract.js","s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";
|
|
3
|
+
export { isRecord };
|
|
4
|
+
export declare function isRef(value: unknown): value is {
|
|
5
|
+
$ref: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function isVar(value: unknown): value is {
|
|
8
|
+
$var: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function isNode(value: unknown): value is SlimNode;
|
|
11
|
+
export declare function nodeKey(node: SlimNode, options?: {
|
|
12
|
+
root?: boolean;
|
|
13
|
+
}): string;
|
|
14
|
+
//# sourceMappingURL=slim-node-guards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slim-node-guards.d.ts","sourceRoot":"","sources":["../../../src/inspect/component-set-pseudocode/slim-node-guards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAE/D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE/D,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpB,wBAAgB,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAE/D;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAE/D;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAExD;AAED,wBAAgB,OAAO,CACrB,IAAI,EAAE,QAAQ,EACd,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,GAC/B,MAAM,CAcR"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { isRecord } from "../component-set-spec/figma-node.js";
|
|
2
|
+
import { normalizePropName } from "../component-set-spec/prop-name.js";
|
|
3
|
+
export { isRecord };
|
|
4
|
+
export function isRef(value) {
|
|
5
|
+
return isRecord(value) && typeof value.$ref === "string";
|
|
6
|
+
}
|
|
7
|
+
export function isVar(value) {
|
|
8
|
+
return isRecord(value) && typeof value.$var === "string";
|
|
9
|
+
}
|
|
10
|
+
export function isNode(value) {
|
|
11
|
+
return isRecord(value) && typeof value.type === "string";
|
|
12
|
+
}
|
|
13
|
+
export function nodeKey(node, options = {}) {
|
|
14
|
+
if (options.root) {
|
|
15
|
+
return "root";
|
|
16
|
+
}
|
|
17
|
+
if (typeof node.name === "string" && node.name.length > 0) {
|
|
18
|
+
return normalizePropName(node.name);
|
|
19
|
+
}
|
|
20
|
+
if (typeof node.prop === "string" && node.prop.length > 0) {
|
|
21
|
+
return normalizePropName(node.prop);
|
|
22
|
+
}
|
|
23
|
+
if (node.component && typeof node.component !== "string") {
|
|
24
|
+
return normalizePropName(node.component.name ?? "instance");
|
|
25
|
+
}
|
|
26
|
+
return node.type;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=slim-node-guards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slim-node-guards.js","sourceRoot":"","sources":["../../../src/inspect/component-set-pseudocode/slim-node-guards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAGvE,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpB,MAAM,UAAU,KAAK,CAAC,KAAc;IAClC,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC;AAC3D,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,KAAc;IAClC,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC;AAC3D,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,KAAc;IACnC,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC;AAC3D,CAAC;AAED,MAAM,UAAU,OAAO,CACrB,IAAc,EACd,UAA8B,EAAE;IAEhC,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1D,OAAO,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IACD,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1D,OAAO,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IACD,IAAI,IAAI,CAAC,SAAS,IAAI,OAAO,IAAI,CAAC,SAAS,KAAK,QAAQ,EAAE,CAAC;QACzD,OAAO,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,IAAI,UAAU,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,IAAI,CAAC,IAAI,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { ComponentSetPropDefinition, ComponentSetSpec } from "../component-set-spec/types.js";
|
|
2
|
+
import type { ContractFormat } from "../contract/contract-format.js";
|
|
3
|
+
import type { PseudocodeModel } from "./types.js";
|
|
4
|
+
export interface StructureContract {
|
|
5
|
+
version: 1;
|
|
6
|
+
component: string;
|
|
7
|
+
contracts: {
|
|
8
|
+
visuals: string;
|
|
9
|
+
geometry: string;
|
|
10
|
+
meta: string;
|
|
11
|
+
};
|
|
12
|
+
props?: Record<string, ComponentSetPropDefinition>;
|
|
13
|
+
variantAxes: Record<string, string[]>;
|
|
14
|
+
baseVariant: Record<string, string>;
|
|
15
|
+
instances: Record<string, {
|
|
16
|
+
swapSet?: string;
|
|
17
|
+
default?: string;
|
|
18
|
+
component?: string;
|
|
19
|
+
}>;
|
|
20
|
+
fragments: Record<string, StructureFragment>;
|
|
21
|
+
templates: Record<string, StructureTemplate>;
|
|
22
|
+
dispatch: StructureDispatchEntry[];
|
|
23
|
+
fallback: string | null;
|
|
24
|
+
assetBacked?: boolean;
|
|
25
|
+
}
|
|
26
|
+
interface StructureFragment {
|
|
27
|
+
when?: StructureWhen[];
|
|
28
|
+
node: StructureNode;
|
|
29
|
+
}
|
|
30
|
+
interface StructureTemplate {
|
|
31
|
+
when?: Record<string, string>;
|
|
32
|
+
root: StructureNode;
|
|
33
|
+
}
|
|
34
|
+
interface StructureDispatchEntry {
|
|
35
|
+
when: Record<string, string>;
|
|
36
|
+
template: string;
|
|
37
|
+
}
|
|
38
|
+
interface StructureWhen {
|
|
39
|
+
prop: string;
|
|
40
|
+
}
|
|
41
|
+
export type StructureNode = StructureElementNode | StructureUseNode | StructureSlotNode;
|
|
42
|
+
interface StructureBinding {
|
|
43
|
+
$ref: string;
|
|
44
|
+
}
|
|
45
|
+
interface StructurePropRef {
|
|
46
|
+
$prop: string;
|
|
47
|
+
}
|
|
48
|
+
interface StructureUseNode {
|
|
49
|
+
$use: string;
|
|
50
|
+
}
|
|
51
|
+
interface StructureSlotNode {
|
|
52
|
+
$slot: string;
|
|
53
|
+
}
|
|
54
|
+
interface StructureElementNode {
|
|
55
|
+
type: string;
|
|
56
|
+
name?: string;
|
|
57
|
+
key: string;
|
|
58
|
+
when?: StructureWhen[];
|
|
59
|
+
content?: StructurePropRef | string;
|
|
60
|
+
instance?: StructurePropRef | string;
|
|
61
|
+
asset?: StructureBinding;
|
|
62
|
+
style?: StructureBinding;
|
|
63
|
+
layout?: StructureBinding;
|
|
64
|
+
children?: StructureNode[];
|
|
65
|
+
}
|
|
66
|
+
export declare function buildStructureContract(model: PseudocodeModel, spec: ComponentSetSpec, options?: {
|
|
67
|
+
assetBacked?: boolean;
|
|
68
|
+
format?: ContractFormat;
|
|
69
|
+
}): StructureContract;
|
|
70
|
+
export {};
|
|
71
|
+
//# sourceMappingURL=structure-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structure-contract.d.ts","sourceRoot":"","sources":["../../../src/inspect/component-set-pseudocode/structure-contract.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,0BAA0B,EAC1B,gBAAgB,EAEjB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAGrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,CAAC,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE;QACT,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAC;IACnD,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACtC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,SAAS,EAAE,MAAM,CACf,MAAM,EACN;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAC3D,CAAC;IACF,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC7C,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC7C,QAAQ,EAAE,sBAAsB,EAAE,CAAC;IACnC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,UAAU,iBAAiB;IACzB,IAAI,CAAC,EAAE,aAAa,EAAE,CAAC;IACvB,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nB"}
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import { normalizePropName } from "../component-set-spec/prop-name.js";
|
|
2
|
+
import { contractArtifactFileName } from "../contract/contract-format.js";
|
|
3
|
+
import { isNode, isRef, isVar, nodeKey } from "./slim-node-guards.js";
|
|
4
|
+
function toTagName(raw, fallback) {
|
|
5
|
+
if (!raw) {
|
|
6
|
+
return fallback;
|
|
7
|
+
}
|
|
8
|
+
const words = raw
|
|
9
|
+
.replace(/[^A-Za-z0-9]+/g, " ")
|
|
10
|
+
.trim()
|
|
11
|
+
.split(/\s+/)
|
|
12
|
+
.filter((word) => word.length > 0);
|
|
13
|
+
if (words.length === 0) {
|
|
14
|
+
return fallback;
|
|
15
|
+
}
|
|
16
|
+
return words
|
|
17
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
18
|
+
.join("");
|
|
19
|
+
}
|
|
20
|
+
function stackType(node) {
|
|
21
|
+
const layout = node.layout;
|
|
22
|
+
if (layout?.mode === "row") {
|
|
23
|
+
return "HStack";
|
|
24
|
+
}
|
|
25
|
+
if (layout?.mode === "column") {
|
|
26
|
+
return "VStack";
|
|
27
|
+
}
|
|
28
|
+
return "Box";
|
|
29
|
+
}
|
|
30
|
+
function structureType(node) {
|
|
31
|
+
if (node.type === "text") {
|
|
32
|
+
return "Text";
|
|
33
|
+
}
|
|
34
|
+
if (node.icon) {
|
|
35
|
+
return "Icon";
|
|
36
|
+
}
|
|
37
|
+
if (node.type === "component" && node.component) {
|
|
38
|
+
if (typeof node.component === "string") {
|
|
39
|
+
return toTagName(node.component, "Component");
|
|
40
|
+
}
|
|
41
|
+
return toTagName(node.component.name, "Component");
|
|
42
|
+
}
|
|
43
|
+
if (node.type === "instance" && node.component) {
|
|
44
|
+
if (node.icon) {
|
|
45
|
+
return "Icon";
|
|
46
|
+
}
|
|
47
|
+
if (typeof node.component === "string") {
|
|
48
|
+
return toTagName(node.component, "Instance");
|
|
49
|
+
}
|
|
50
|
+
return toTagName(node.component.name, "Instance");
|
|
51
|
+
}
|
|
52
|
+
if (node.type === "line" ||
|
|
53
|
+
node.type === "vector" ||
|
|
54
|
+
node.type === "rectangle" ||
|
|
55
|
+
node.type === "ellipse") {
|
|
56
|
+
return "Shape";
|
|
57
|
+
}
|
|
58
|
+
if (node.type === "component") {
|
|
59
|
+
return stackType(node);
|
|
60
|
+
}
|
|
61
|
+
return stackType(node);
|
|
62
|
+
}
|
|
63
|
+
function visibleWhen(visible) {
|
|
64
|
+
if (typeof visible !== "string" || visible.length === 0) {
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
return [{ prop: normalizePropName(visible) }];
|
|
68
|
+
}
|
|
69
|
+
function schemeRef(key) {
|
|
70
|
+
return { $ref: `scheme.${key}` };
|
|
71
|
+
}
|
|
72
|
+
function geometryRef(key) {
|
|
73
|
+
return { $ref: `geometry.${key}` };
|
|
74
|
+
}
|
|
75
|
+
function contentRef(node) {
|
|
76
|
+
if (typeof node.prop === "string" && node.prop.length > 0) {
|
|
77
|
+
return { $prop: normalizePropName(node.prop) };
|
|
78
|
+
}
|
|
79
|
+
if (node.text && typeof node.text.content === "string") {
|
|
80
|
+
return node.text.content;
|
|
81
|
+
}
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
function instanceRef(node) {
|
|
85
|
+
if (typeof node.prop === "string" && node.prop.length > 0) {
|
|
86
|
+
return { $prop: normalizePropName(node.prop) };
|
|
87
|
+
}
|
|
88
|
+
if (node.component && typeof node.component !== "string") {
|
|
89
|
+
return node.component.name;
|
|
90
|
+
}
|
|
91
|
+
if (typeof node.component === "string") {
|
|
92
|
+
return node.component;
|
|
93
|
+
}
|
|
94
|
+
if (typeof node.name === "string") {
|
|
95
|
+
return node.name;
|
|
96
|
+
}
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
function convertChild(child, definitions) {
|
|
100
|
+
if (isRef(child)) {
|
|
101
|
+
return { $use: child.$ref };
|
|
102
|
+
}
|
|
103
|
+
if (isVar(child)) {
|
|
104
|
+
return { $slot: child.$var };
|
|
105
|
+
}
|
|
106
|
+
if (!isNode(child)) {
|
|
107
|
+
return { $slot: "unknown" };
|
|
108
|
+
}
|
|
109
|
+
return convertNode(child, definitions);
|
|
110
|
+
}
|
|
111
|
+
function convertNode(node, definitions, options = {}) {
|
|
112
|
+
const key = nodeKey(node, options);
|
|
113
|
+
const element = {
|
|
114
|
+
type: structureType(node),
|
|
115
|
+
key,
|
|
116
|
+
style: schemeRef(key),
|
|
117
|
+
layout: geometryRef(key),
|
|
118
|
+
};
|
|
119
|
+
if (typeof node.name === "string") {
|
|
120
|
+
element.name = node.name;
|
|
121
|
+
}
|
|
122
|
+
const when = visibleWhen(node.visible);
|
|
123
|
+
if (when) {
|
|
124
|
+
element.when = when;
|
|
125
|
+
}
|
|
126
|
+
if (element.type === "Text") {
|
|
127
|
+
const content = contentRef(node);
|
|
128
|
+
if (content !== undefined) {
|
|
129
|
+
element.content = content;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
else if (element.type === "Icon") {
|
|
133
|
+
const instance = instanceRef(node);
|
|
134
|
+
if (instance !== undefined) {
|
|
135
|
+
element.instance = instance;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
else if (element.type !== "HStack" &&
|
|
139
|
+
element.type !== "VStack" &&
|
|
140
|
+
element.type !== "Box" &&
|
|
141
|
+
element.type !== "Shape") {
|
|
142
|
+
const instance = instanceRef(node);
|
|
143
|
+
if (instance !== undefined) {
|
|
144
|
+
element.instance = instance;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
const children = Array.isArray(node.children) ? node.children : [];
|
|
148
|
+
if (children.length > 0) {
|
|
149
|
+
element.children = children.map((child) => convertChild(child, definitions));
|
|
150
|
+
}
|
|
151
|
+
return element;
|
|
152
|
+
}
|
|
153
|
+
function unwrapRoot(node) {
|
|
154
|
+
if (node.type === "component") {
|
|
155
|
+
return {
|
|
156
|
+
...node,
|
|
157
|
+
type: "frame",
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
return node;
|
|
161
|
+
}
|
|
162
|
+
function convertRoot(node, definitions) {
|
|
163
|
+
return convertNode(unwrapRoot(node), definitions, { root: true });
|
|
164
|
+
}
|
|
165
|
+
function findRepresentativeLayout(spec, when) {
|
|
166
|
+
if (!when || Object.keys(when).length === 0) {
|
|
167
|
+
return spec.variants[0]?.layout;
|
|
168
|
+
}
|
|
169
|
+
return spec.variants.find((variant) => Object.entries(when).every(([axis, value]) => variant.when[axis] === value))?.layout;
|
|
170
|
+
}
|
|
171
|
+
function collectInstances(model) {
|
|
172
|
+
const instances = {};
|
|
173
|
+
for (const [name, definition] of Object.entries(model.props)) {
|
|
174
|
+
if (definition.type !== "instance") {
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
instances[normalizePropName(name)] = {
|
|
178
|
+
default: typeof definition.default === "string" ? definition.default : undefined,
|
|
179
|
+
swapSet: definition.swapSet,
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
return instances;
|
|
183
|
+
}
|
|
184
|
+
function convertFragment(node, definitions) {
|
|
185
|
+
const converted = convertNode(unwrapRoot(node), definitions);
|
|
186
|
+
const when = visibleWhen(node.visible);
|
|
187
|
+
return {
|
|
188
|
+
when,
|
|
189
|
+
node: converted,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
function buildAssetBackedStructureContract(model, format) {
|
|
193
|
+
const templateName = "allVariants";
|
|
194
|
+
const root = {
|
|
195
|
+
type: "Asset",
|
|
196
|
+
key: "root",
|
|
197
|
+
asset: { $ref: "asset" },
|
|
198
|
+
layout: geometryRef("root"),
|
|
199
|
+
};
|
|
200
|
+
return {
|
|
201
|
+
version: 1,
|
|
202
|
+
component: model.name,
|
|
203
|
+
contracts: {
|
|
204
|
+
visuals: contractArtifactFileName(model.name, "visuals", format),
|
|
205
|
+
geometry: contractArtifactFileName(model.name, "geometry", format),
|
|
206
|
+
meta: contractArtifactFileName(model.name, "meta", format),
|
|
207
|
+
},
|
|
208
|
+
props: model.props,
|
|
209
|
+
variantAxes: model.variantAxes,
|
|
210
|
+
baseVariant: model.baseVariant,
|
|
211
|
+
instances: collectInstances(model),
|
|
212
|
+
fragments: {},
|
|
213
|
+
templates: {
|
|
214
|
+
[templateName]: {
|
|
215
|
+
root,
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
dispatch: [],
|
|
219
|
+
fallback: templateName,
|
|
220
|
+
assetBacked: true,
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
export function buildStructureContract(model, spec, options = {}) {
|
|
224
|
+
const format = options.format ?? "yaml";
|
|
225
|
+
if (options.assetBacked) {
|
|
226
|
+
return buildAssetBackedStructureContract(model, format);
|
|
227
|
+
}
|
|
228
|
+
const definitions = {
|
|
229
|
+
...model.definitions,
|
|
230
|
+
...Object.fromEntries(model.definitionTemplates.map((template) => [
|
|
231
|
+
template.name,
|
|
232
|
+
template.node,
|
|
233
|
+
])),
|
|
234
|
+
};
|
|
235
|
+
const fragments = {};
|
|
236
|
+
for (const template of model.definitionTemplates) {
|
|
237
|
+
fragments[template.name] = convertFragment(template.node, definitions);
|
|
238
|
+
}
|
|
239
|
+
for (const [id, node] of Object.entries(model.definitions)) {
|
|
240
|
+
if (fragments[id]) {
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
243
|
+
fragments[id] = convertFragment(node, definitions);
|
|
244
|
+
}
|
|
245
|
+
const templates = {};
|
|
246
|
+
for (const template of model.templates) {
|
|
247
|
+
const layout = findRepresentativeLayout(spec, template.when);
|
|
248
|
+
if (!layout) {
|
|
249
|
+
continue;
|
|
250
|
+
}
|
|
251
|
+
templates[template.name] = {
|
|
252
|
+
when: template.when,
|
|
253
|
+
root: convertRoot(layout, definitions),
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
const dispatch = model.templates
|
|
257
|
+
.filter((template) => template.when && Object.keys(template.when).length > 0)
|
|
258
|
+
.map((template) => ({
|
|
259
|
+
when: template.when ?? {},
|
|
260
|
+
template: template.name,
|
|
261
|
+
}));
|
|
262
|
+
const fallback = model.templates[0]?.name ?? null;
|
|
263
|
+
return {
|
|
264
|
+
version: 1,
|
|
265
|
+
component: model.name,
|
|
266
|
+
contracts: {
|
|
267
|
+
visuals: contractArtifactFileName(model.name, "visuals", format),
|
|
268
|
+
geometry: contractArtifactFileName(model.name, "geometry", format),
|
|
269
|
+
meta: contractArtifactFileName(model.name, "meta", format),
|
|
270
|
+
},
|
|
271
|
+
props: model.props,
|
|
272
|
+
variantAxes: model.variantAxes,
|
|
273
|
+
baseVariant: model.baseVariant,
|
|
274
|
+
instances: collectInstances(model),
|
|
275
|
+
fragments,
|
|
276
|
+
templates,
|
|
277
|
+
dispatch,
|
|
278
|
+
fallback,
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
//# sourceMappingURL=structure-contract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structure-contract.js","sourceRoot":"","sources":["../../../src/inspect/component-set-pseudocode/structure-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAOvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AA8EtE,SAAS,SAAS,CAAC,GAAuB,EAAE,QAAgB;IAC1D,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,MAAM,KAAK,GAAG,GAAG;SACd,OAAO,CAAC,gBAAgB,EAAE,GAAG,CAAC;SAC9B,IAAI,EAAE;SACN,KAAK,CAAC,KAAK,CAAC;SACZ,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACrC,IAAI,KAAK,CAAC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