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,127 @@
|
|
|
1
|
+
import { access, mkdir, writeFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { downloadRenderedImage, getFileImageUrls, } from "../../figma-api/get-file-images.js";
|
|
4
|
+
import { readChildren, readString } from "../component-set-spec/figma-node.js";
|
|
5
|
+
import { parseVariantName } from "../component-set-spec/parse-props.js";
|
|
6
|
+
import { collectVariantAxes } from "../component-set-spec/variant-axes.js";
|
|
7
|
+
import { variantAssetSlug } from "../contract/fingerprint.js";
|
|
8
|
+
import { FigmaInspectError } from "../errors.js";
|
|
9
|
+
import { assertComponentSetSupportsAssetExport, assertExportedSvgBytes, } from "./assert-asset-exportable.js";
|
|
10
|
+
import { normalizeExportedSvgBytes } from "./normalize-exported-svg.js";
|
|
11
|
+
function assetFileName(when, variantAxes) {
|
|
12
|
+
const slug = variantAssetSlug(when, variantAxes);
|
|
13
|
+
if (slug.length === 0) {
|
|
14
|
+
throw new FigmaInspectError("Variant asset name has no axis values.");
|
|
15
|
+
}
|
|
16
|
+
return `${slug}.svg`;
|
|
17
|
+
}
|
|
18
|
+
async function assetFileExists(absolutePath) {
|
|
19
|
+
try {
|
|
20
|
+
await access(absolutePath);
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function collectVariantNodeRefs(componentSet) {
|
|
28
|
+
const variantNodes = readChildren(componentSet).filter((child) => readString(child, "type") === "COMPONENT");
|
|
29
|
+
const refs = [];
|
|
30
|
+
for (const variantNode of variantNodes) {
|
|
31
|
+
const nodeId = readString(variantNode, "id");
|
|
32
|
+
const variantName = readString(variantNode, "name");
|
|
33
|
+
if (!nodeId || !variantName) {
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
const when = parseVariantName(variantName);
|
|
37
|
+
if (Object.keys(when).length === 0) {
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
refs.push({ nodeId, when });
|
|
41
|
+
}
|
|
42
|
+
if (refs.length === 0) {
|
|
43
|
+
throw new FigmaInspectError("COMPONENT_SET has no exportable variants.");
|
|
44
|
+
}
|
|
45
|
+
return refs.sort((left, right) => JSON.stringify(left.when).localeCompare(JSON.stringify(right.when)));
|
|
46
|
+
}
|
|
47
|
+
function setNestedAsset(root, when, axes, entry) {
|
|
48
|
+
if (axes.length === 0) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const [axis, ...rest] = axes;
|
|
52
|
+
const value = when[axis ?? ""];
|
|
53
|
+
if (!value) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (rest.length === 0) {
|
|
57
|
+
root[value] = entry;
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const current = root[value];
|
|
61
|
+
if (typeof current !== "object" || current === null || "path" in current) {
|
|
62
|
+
root[value] = {};
|
|
63
|
+
}
|
|
64
|
+
setNestedAsset(root[value], when, rest, entry);
|
|
65
|
+
}
|
|
66
|
+
function buildNestedAssetMap(entries, variantAxes) {
|
|
67
|
+
const axes = Object.keys(variantAxes);
|
|
68
|
+
const root = {};
|
|
69
|
+
for (const entry of entries) {
|
|
70
|
+
const { when, ...asset } = entry;
|
|
71
|
+
setNestedAsset(root, when, axes, asset);
|
|
72
|
+
}
|
|
73
|
+
return root;
|
|
74
|
+
}
|
|
75
|
+
export async function exportVariantAssets(options) {
|
|
76
|
+
assertComponentSetSupportsAssetExport(options.componentSet);
|
|
77
|
+
const variantRefs = collectVariantNodeRefs(options.componentSet);
|
|
78
|
+
const variantAxes = collectVariantAxes(variantRefs.map((ref) => ref.when));
|
|
79
|
+
const assetsDir = path.join(options.outputDir, `${options.baseName}.assets`);
|
|
80
|
+
await mkdir(assetsDir, { recursive: true });
|
|
81
|
+
const nodeIdsToExport = [];
|
|
82
|
+
for (const ref of variantRefs) {
|
|
83
|
+
if (!options.skipNodeIds?.has(ref.nodeId)) {
|
|
84
|
+
nodeIdsToExport.push(ref.nodeId);
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
const fileName = assetFileName(ref.when, variantAxes);
|
|
88
|
+
const absolutePath = path.join(assetsDir, fileName);
|
|
89
|
+
if (!(await assetFileExists(absolutePath))) {
|
|
90
|
+
nodeIdsToExport.push(ref.nodeId);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
const imageUrls = nodeIdsToExport.length === 0
|
|
94
|
+
? {}
|
|
95
|
+
: await getFileImageUrls({
|
|
96
|
+
token: options.token,
|
|
97
|
+
fileKey: options.fileKey,
|
|
98
|
+
nodeIds: nodeIdsToExport,
|
|
99
|
+
format: options.format,
|
|
100
|
+
fetchImpl: options.fetchImpl,
|
|
101
|
+
});
|
|
102
|
+
const entries = [];
|
|
103
|
+
const assetSlugs = [];
|
|
104
|
+
for (const ref of variantRefs) {
|
|
105
|
+
const fileName = assetFileName(ref.when, variantAxes);
|
|
106
|
+
assetSlugs.push(fileName.slice(0, -".svg".length));
|
|
107
|
+
const relativePath = path.posix.join(`${options.baseName}.assets`, fileName);
|
|
108
|
+
const absolutePath = path.join(options.outputDir, relativePath);
|
|
109
|
+
if (nodeIdsToExport.includes(ref.nodeId)) {
|
|
110
|
+
const rawBytes = await downloadRenderedImage(imageUrls[ref.nodeId], options.fetchImpl);
|
|
111
|
+
assertExportedSvgBytes(rawBytes, ref.nodeId);
|
|
112
|
+
const bytes = normalizeExportedSvgBytes(rawBytes);
|
|
113
|
+
await writeFile(absolutePath, bytes);
|
|
114
|
+
}
|
|
115
|
+
entries.push({
|
|
116
|
+
when: ref.when,
|
|
117
|
+
format: options.format,
|
|
118
|
+
path: relativePath,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
return {
|
|
122
|
+
assetsDir,
|
|
123
|
+
assets: buildNestedAssetMap(entries, variantAxes),
|
|
124
|
+
assetSlugs,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=export-variant-assets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export-variant-assets.js","sourceRoot":"","sources":["../../../src/inspect/export/export-variant-assets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,oCAAoC,CAAC;AAK5C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EACL,qCAAqC,EACrC,sBAAsB,GACvB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AA4BxE,SAAS,aAAa,CACpB,IAA4B,EAC5B,WAAqC;IAErC,MAAM,IAAI,GAAG,gBAAgB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACjD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,iBAAiB,CAAC,wCAAwC,CAAC,CAAC;IACxE,CAAC;IAED,OAAO,GAAG,IAAI,MAAM,CAAC;AACvB,CAAC;AAED,KAAK,UAAU,eAAe,CAAC,YAAoB;IACjD,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,SAAS,sBAAsB,CAC7B,YAAqC;IAErC,MAAM,YAAY,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC,MAAM,CACpD,CAAC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AW,CAAC,CAAC;QACtD,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;QACnD,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAClC,GAAG,OAAO,CAAC,QAAQ,SAAS,EAC5B,QAAQ,CACT,CAAC;QACF,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;QAEhE,IAAI,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YACzC,MAAM,QAAQ,GAAG,MAAM,qBAAqB,CAC1C,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,EACrB,OAAO,CAAC,SAAS,CAClB,CAAC;YACF,sBAAsB,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;YAC7C,MAAM,KAAK,GAAG,yBAAyB,CAAC,QAAQ,CAAC,CAAC;YAClD,MAAM,SAAS,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;QACvC,CAAC;QAED,OAAO,CAAC,IAAI,CAAC;YACX,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,IAAI,EAAE,YAAY;SACnB,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,SAAS;QACT,MAAM,EAAE,mBAAmB,CAAC,OAAO,EAAE,WAAW,CAAC;QACjD,UAAU;KACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-exported-svg.d.ts","sourceRoot":"","sources":["../../../src/inspect/export/normalize-exported-svg.ts"],"names":[],"mappings":"AAYA,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAGvE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
function stripRootSvgDimensions(attrs) {
|
|
2
|
+
return attrs
|
|
3
|
+
.replace(/\s+width=["'][^"']*["']/gi, "")
|
|
4
|
+
.replace(/\s+height=["'][^"']*["']/gi, "");
|
|
5
|
+
}
|
|
6
|
+
function normalizeExportedSvg(source) {
|
|
7
|
+
return source.replace(/<svg\b([^>]*)>/i, (_match, attrs) => {
|
|
8
|
+
return `<svg${stripRootSvgDimensions(attrs)}>`;
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export function normalizeExportedSvgBytes(bytes) {
|
|
12
|
+
const text = new TextDecoder().decode(bytes);
|
|
13
|
+
return new TextEncoder().encode(normalizeExportedSvg(text));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=normalize-exported-svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-exported-svg.js","sourceRoot":"","sources":["../../../src/inspect/export/normalize-exported-svg.ts"],"names":[],"mappings":"AAAA,SAAS,sBAAsB,CAAC,KAAa;IAC3C,OAAO,KAAK;SACT,OAAO,CAAC,2BAA2B,EAAE,EAAE,CAAC;SACxC,OAAO,CAAC,4BAA4B,EAAE,EAAE,CAAC,CAAC;AAC/C,CAAC;AAED,SAAS,oBAAoB,CAAC,MAAc;IAC1C,OAAO,MAAM,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC,MAAM,EAAE,KAAa,EAAE,EAAE;QACjE,OAAO,OAAO,sBAAsB,CAAC,KAAK,CAAC,GAAG,CAAC;IACjD,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,KAAiB;IACzD,MAAM,IAAI,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC7C,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type RenderedImageFormat = "png" | "svg";
|
|
2
|
+
export declare function assertPositiveScale(scale: number, label: string): void;
|
|
3
|
+
export declare function normalizeRenderedImageBytes(bytes: Uint8Array, format: RenderedImageFormat, context: string, artifact: string): Uint8Array;
|
|
4
|
+
//# sourceMappingURL=rendered-image-bytes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rendered-image-bytes.d.ts","sourceRoot":"","sources":["../../../src/inspect/export/rendered-image-bytes.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,KAAK,CAAC;AAIhD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAItE;AAkBD,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,mBAAmB,EAC3B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GACf,UAAU,CAQZ"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FigmaInspectError } from "../errors.js";
|
|
2
|
+
import { assertExportedSvgBytes } from "./assert-asset-exportable.js";
|
|
3
|
+
import { normalizeExportedSvgBytes } from "./normalize-exported-svg.js";
|
|
4
|
+
const PNG_SIGNATURE = [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a];
|
|
5
|
+
export function assertPositiveScale(scale, label) {
|
|
6
|
+
if (!Number.isFinite(scale) || scale <= 0) {
|
|
7
|
+
throw new FigmaInspectError(`${label} must be a positive number.`);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
function assertExportedPngBytes(bytes, context, artifact) {
|
|
11
|
+
const hasPngSignature = PNG_SIGNATURE.every((value, index) => bytes[index] === value);
|
|
12
|
+
if (!hasPngSignature) {
|
|
13
|
+
throw new FigmaInspectError(`Exported ${artifact} for ${context} is not PNG.`);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export function normalizeRenderedImageBytes(bytes, format, context, artifact) {
|
|
17
|
+
if (format === "svg") {
|
|
18
|
+
assertExportedSvgBytes(bytes, context);
|
|
19
|
+
return normalizeExportedSvgBytes(bytes);
|
|
20
|
+
}
|
|
21
|
+
assertExportedPngBytes(bytes, context, artifact);
|
|
22
|
+
return bytes;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=rendered-image-bytes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rendered-image-bytes.js","sourceRoot":"","sources":["../../../src/inspect/export/rendered-image-bytes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAIxE,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAEvE,MAAM,UAAU,mBAAmB,CAAC,KAAa,EAAE,KAAa;IAC9D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC;QAC1C,MAAM,IAAI,iBAAiB,CAAC,GAAG,KAAK,6BAA6B,CAAC,CAAC;IACrE,CAAC;AACH,CAAC;AAED,SAAS,sBAAsB,CAC7B,KAAiB,EACjB,OAAe,EACf,QAAgB;IAEhB,MAAM,eAAe,GAAG,aAAa,CAAC,KAAK,CACzC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,KAAK,CACzC,CAAC;IAEF,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,MAAM,IAAI,iBAAiB,CACzB,YAAY,QAAQ,QAAQ,OAAO,cAAc,CAClD,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,UAAU,2BAA2B,CACzC,KAAiB,EACjB,MAA2B,EAC3B,OAAe,EACf,QAAgB;IAEhB,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;QACrB,sBAAsB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACvC,OAAO,yBAAyB,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;IAED,sBAAsB,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IACjD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ExportContractTarget, FigmaNodeRef } from "./types.js";
|
|
2
|
+
export interface ResolveExportContractTargetOptions extends FigmaNodeRef {
|
|
3
|
+
token: string;
|
|
4
|
+
fetchImpl?: typeof fetch;
|
|
5
|
+
}
|
|
6
|
+
export declare function resolveExportContractTarget(options: ResolveExportContractTargetOptions): Promise<ExportContractTarget>;
|
|
7
|
+
//# sourceMappingURL=export-contract-target.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export-contract-target.d.ts","sourceRoot":"","sources":["../../src/inspect/export-contract-target.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAErE,MAAM,WAAW,kCAAmC,SAAQ,YAAY;IACtE,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CAC1B;AAED,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,kCAAkC,GAC1C,OAAO,CAAC,oBAAoB,CAAC,CAuC/B"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { FigmaInspectError } from "./errors.js";
|
|
2
|
+
import { fetchFileNodeEntry } from "./fetch-file-node-entry.js";
|
|
3
|
+
import { assertNodeContractRoot } from "./node-contract/node-kind.js";
|
|
4
|
+
export async function resolveExportContractTarget(options) {
|
|
5
|
+
const entry = await fetchFileNodeEntry({
|
|
6
|
+
token: options.token,
|
|
7
|
+
fileKey: options.fileKey,
|
|
8
|
+
nodeId: options.nodeId,
|
|
9
|
+
fetchImpl: options.fetchImpl,
|
|
10
|
+
});
|
|
11
|
+
const node = entry.document;
|
|
12
|
+
const nodeType = node?.type;
|
|
13
|
+
if (!node) {
|
|
14
|
+
throw new FigmaInspectError(`Node ${options.nodeId} has no document payload.`);
|
|
15
|
+
}
|
|
16
|
+
if (nodeType === "COMPONENT_SET") {
|
|
17
|
+
return {
|
|
18
|
+
kind: "component-set",
|
|
19
|
+
fileKey: options.fileKey,
|
|
20
|
+
nodeId: node.id ?? options.nodeId,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
if (nodeType === "FRAME" || nodeType === "COMPONENT") {
|
|
24
|
+
const { node: nodeContractRoot } = assertNodeContractRoot(entry, options.nodeId);
|
|
25
|
+
return {
|
|
26
|
+
kind: "node",
|
|
27
|
+
fileKey: options.fileKey,
|
|
28
|
+
nodeId: nodeContractRoot.id ?? options.nodeId,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
throw new FigmaInspectError(`Figma node ${options.nodeId} is ${nodeType ?? "UNKNOWN"}; --export-contract supports COMPONENT_SET, FRAME, or standalone COMPONENT.`);
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=export-contract-target.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export-contract-target.js","sourceRoot":"","sources":["../../src/inspect/export-contract-target.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAQtE,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC/C,OAA2C;IAE3C,MAAM,KAAK,GAAG,MAAM,kBAAkB,CAAC;QACrC,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,OAAO,EAAE,O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C,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,aAAa,CAAC,CAGxB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { getFile } from "../figma-api/get-file.js";
|
|
2
|
+
import { parseFileEntry } from "./schemas.js";
|
|
3
|
+
export async function fetchFileEntry(options) {
|
|
4
|
+
const payload = await getFile(options);
|
|
5
|
+
return parseFileEntry(payload);
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=fetch-file-entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch-file-entry.js","sourceRoot":"","sources":["../../src/inspect/fetch-file-entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAsB,cAAc,EAAE,MAAM,cAAc,CAAC;AAElE,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,OAAuB;IAEvB,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,OAAO,cAAc,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch-file-node-entry.d.ts","sourceRoot":"","sources":["../../src/inspect/fetch-file-node-entry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,KAAK,aAAa,EAAsB,MAAM,cAAc,CAAC;AAEtE,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,aAAa,CAAC,CAGxB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { getFileNode } from "../figma-api/get-file-node.js";
|
|
2
|
+
import { parseFileNodeEntry } from "./schemas.js";
|
|
3
|
+
export async function fetchFileNodeEntry(options) {
|
|
4
|
+
const payload = await getFileNode(options);
|
|
5
|
+
return parseFileNodeEntry(payload, options.nodeId);
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=fetch-file-node-entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch-file-node-entry.js","sourceRoot":"","sources":["../../src/inspect/fetch-file-node-entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D,OAAO,EAAsB,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEtE,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,OAA2B;IAE3B,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,OAAO,CAAC,CAAC;IAC3C,OAAO,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"figma-node-url.d.ts","sourceRoot":"","sources":["../../src/inspect/figma-node-url.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAQ/C,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CA4B9D"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FigmaInspectError } from "./errors.js";
|
|
2
|
+
const supportedFilePathKinds = new Set(["design", "file"]);
|
|
3
|
+
function normalizeNodeId(nodeId) {
|
|
4
|
+
return nodeId.includes(":") ? nodeId : nodeId.replace(/-/g, ":");
|
|
5
|
+
}
|
|
6
|
+
export function parseFigmaNodeUrl(rawUrl) {
|
|
7
|
+
let url;
|
|
8
|
+
try {
|
|
9
|
+
url = new URL(rawUrl);
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
throw new FigmaInspectError(`Invalid Figma URL: ${rawUrl}`);
|
|
13
|
+
}
|
|
14
|
+
if (url.hostname !== "figma.com" && url.hostname !== "www.figma.com") {
|
|
15
|
+
throw new FigmaInspectError(`Invalid Figma URL host: ${url.hostname}`);
|
|
16
|
+
}
|
|
17
|
+
const [, pathKind, fileKey] = url.pathname.split("/");
|
|
18
|
+
if (!supportedFilePathKinds.has(pathKind) || !fileKey) {
|
|
19
|
+
throw new FigmaInspectError("Figma URL must use /design/<fileKey>/... or /file/<fileKey>/...");
|
|
20
|
+
}
|
|
21
|
+
const rawNodeId = url.searchParams.get("node-id");
|
|
22
|
+
if (!rawNodeId) {
|
|
23
|
+
throw new FigmaInspectError("Figma URL is missing node-id.");
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
fileKey,
|
|
27
|
+
nodeId: normalizeNodeId(rawNodeId),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=figma-node-url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"figma-node-url.js","sourceRoot":"","sources":["../../src/inspect/figma-node-url.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGhD,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AAE3D,SAAS,eAAe,CAAC,MAAc;IACrC,OAAO,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,MAAc;IAC9C,IAAI,GAAQ,CAAC;IACb,IAAI,CAAC;QACH,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,iBAAiB,CAAC,sBAAsB,MAAM,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED,IAAI,GAAG,CAAC,QAAQ,KAAK,WAAW,IAAI,GAAG,CAAC,QAAQ,KAAK,eAAe,EAAE,CAAC;QACrE,MAAM,IAAI,iBAAiB,CAAC,2BAA2B,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IACzE,CAAC;IAED,MAAM,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,GAAG,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACtD,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QACtD,MAAM,IAAI,iBAAiB,CACzB,iEAAiE,CAClE,CAAC;IACJ,CAAC;IAED,MAAM,SAAS,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAClD,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,iBAAiB,CAAC,+BAA+B,CAAC,CAAC;IAC/D,CAAC;IAED,OAAO;QACL,OAAO;QACP,MAAM,EAAE,eAAe,CAAC,SAAS,CAAC;KACnC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DocumentNode } from "./schemas.js";
|
|
2
|
+
import type { ComponentSetNodeRefOptions, ComponentSetScopeOptions } from "./types.js";
|
|
3
|
+
export declare function getNodeComponentSet(options: ComponentSetScopeOptions): Promise<DocumentNode>;
|
|
4
|
+
export declare function getNodeComponentSetByRef(options: ComponentSetNodeRefOptions): Promise<DocumentNode>;
|
|
5
|
+
//# sourceMappingURL=get-node-component-set.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-node-component-set.d.ts","sourceRoot":"","sources":["../../src/inspect/get-node-component-set.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EACV,0BAA0B,EAC1B,wBAAwB,EACzB,MAAM,YAAY,CAAC;AAEpB,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,YAAY,CAAC,CAGvB;AAED,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,YAAY,CAAC,CAGvB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { loadComponentSetContext, loadComponentSetContextByNodeRef, } from "./component-set-context.js";
|
|
2
|
+
export async function getNodeComponentSet(options) {
|
|
3
|
+
const { tree } = await loadComponentSetContext(options);
|
|
4
|
+
return tree;
|
|
5
|
+
}
|
|
6
|
+
export async function getNodeComponentSetByRef(options) {
|
|
7
|
+
const { tree } = await loadComponentSetContextByNodeRef(options);
|
|
8
|
+
return tree;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=get-node-component-set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-node-component-set.js","sourceRoot":"","sources":["../../src/inspect/get-node-component-set.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,gCAAgC,GACjC,MAAM,4BAA4B,CAAC;AAOpC,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,OAAiC;IAEjC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,uBAAuB,CAAC,OAAO,CAAC,CAAC;IACxD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,OAAmC;IAEnC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,gCAAgC,CAAC,OAAO,CAAC,CAAC;IACjE,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { loadComponentSetContext } from "./component-set-context.js";
|
|
2
|
+
export { buildComponentSetPseudocodeFromFile, buildComponentSetPseudocodeFromRaw, resolveGeometryContractPath, resolveMetaContractPath, resolveStructureDslPath, resolveVisualsContractPath, } from "./component-set-pseudocode/index.js";
|
|
3
|
+
export { buildComponentSetSpecFromFile } from "./component-set-spec/index.js";
|
|
4
|
+
export { verifyComponentContracts } from "./contract/verify-component-contract.js";
|
|
5
|
+
export { FigmaInspectError } from "./errors.js";
|
|
6
|
+
export { DEFAULT_NESTED_ASSET_SCALE, exportNestedAssets, isNestedAssetNodeType, type NestedAssetFormat, type NestedAssetNodeType, type NestedAssetsOptions, supportedNestedAssetNodeTypes, } from "./export/export-nested-assets.js";
|
|
7
|
+
export { DEFAULT_PREVIEW_SCALE, type ExportPreviewOptions, exportNodePreview, type PreviewFormat, } from "./export/export-node-preview.js";
|
|
8
|
+
export { exportVariantAssets } from "./export/export-variant-assets.js";
|
|
9
|
+
export { resolveExportContractTarget } from "./export-contract-target.js";
|
|
10
|
+
export { parseFigmaNodeUrl } from "./figma-node-url.js";
|
|
11
|
+
export { getNodeComponentSet, getNodeComponentSetByRef, } from "./get-node-component-set.js";
|
|
12
|
+
export { listAllComponentSets } from "./list-all-component-sets.js";
|
|
13
|
+
export { listComponentSetProperties, listComponentSetPropertiesByRef, } from "./list-component-set-properties.js";
|
|
14
|
+
export { buildNodeContractFromRef, readNodeContractArtifacts, resolveNodeContractLockPath, resolveNodeGeometryContractPath, resolveNodeMetaContractPath, resolveNodeStructureDslPath, resolveNodeVisualsContractPath, validateNodeContractArtifacts, verifyNodeContracts, writeNodeContractLock, } from "./node-contract/index.js";
|
|
15
|
+
export { resolveTeamComponentSetScope } from "./resolve-team-component-set.js";
|
|
16
|
+
export { type BuildTeamIndexFileInput, buildTeamIndex, type TeamIndex, type TeamIndexFile, } from "./team-index.js";
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/inspect/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EACL,mCAAmC,EACnC,kCAAkC,EAClC,2BAA2B,EAC3B,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EACL,0BAA0B,EAC1B,kBAAkB,EAClB,qBAAqB,EACrB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,6BAA6B,GAC9B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,qBAAqB,EACrB,KAAK,oBAAoB,EACzB,iBAAiB,EACjB,KAAK,aAAa,GACnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EACL,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EACL,0BAA0B,EAC1B,+BAA+B,GAChC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,2BAA2B,EAC3B,+BAA+B,EAC/B,2BAA2B,EAC3B,2BAA2B,EAC3B,8BAA8B,EAC9B,6BAA6B,EAC7B,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EACL,KAAK,uBAAuB,EAC5B,cAAc,EACd,KAAK,SAAS,EACd,KAAK,aAAa,GACnB,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { loadComponentSetContext } from "./component-set-context.js";
|
|
2
|
+
export { buildComponentSetPseudocodeFromFile, buildComponentSetPseudocodeFromRaw, resolveGeometryContractPath, resolveMetaContractPath, resolveStructureDslPath, resolveVisualsContractPath, } from "./component-set-pseudocode/index.js";
|
|
3
|
+
export { buildComponentSetSpecFromFile } from "./component-set-spec/index.js";
|
|
4
|
+
export { verifyComponentContracts } from "./contract/verify-component-contract.js";
|
|
5
|
+
export { FigmaInspectError } from "./errors.js";
|
|
6
|
+
export { DEFAULT_NESTED_ASSET_SCALE, exportNestedAssets, isNestedAssetNodeType, supportedNestedAssetNodeTypes, } from "./export/export-nested-assets.js";
|
|
7
|
+
export { DEFAULT_PREVIEW_SCALE, exportNodePreview, } from "./export/export-node-preview.js";
|
|
8
|
+
export { exportVariantAssets } from "./export/export-variant-assets.js";
|
|
9
|
+
export { resolveExportContractTarget } from "./export-contract-target.js";
|
|
10
|
+
export { parseFigmaNodeUrl } from "./figma-node-url.js";
|
|
11
|
+
export { getNodeComponentSet, getNodeComponentSetByRef, } from "./get-node-component-set.js";
|
|
12
|
+
export { listAllComponentSets } from "./list-all-component-sets.js";
|
|
13
|
+
export { listComponentSetProperties, listComponentSetPropertiesByRef, } from "./list-component-set-properties.js";
|
|
14
|
+
export { buildNodeContractFromRef, readNodeContractArtifacts, resolveNodeContractLockPath, resolveNodeGeometryContractPath, resolveNodeMetaContractPath, resolveNodeStructureDslPath, resolveNodeVisualsContractPath, validateNodeContractArtifacts, verifyNodeContracts, writeNodeContractLock, } from "./node-contract/index.js";
|
|
15
|
+
export { resolveTeamComponentSetScope } from "./resolve-team-component-set.js";
|
|
16
|
+
export { buildTeamIndex, } from "./team-index.js";
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/inspect/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EACL,mCAAmC,EACnC,kCAAkC,EAClC,2BAA2B,EAC3B,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EACL,0BAA0B,EAC1B,kBAAkB,EAClB,qBAAqB,EAIrB,6BAA6B,GAC9B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,qBAAqB,EAErB,iBAAiB,GAElB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EACL,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EACL,0BAA0B,EAC1B,+BAA+B,GAChC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,2BAA2B,EAC3B,+BAA+B,EAC/B,2BAA2B,EAC3B,2BAA2B,EAC3B,8BAA8B,EAC9B,6BAA6B,EAC7B,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EAEL,cAAc,GAGf,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { FigmaTeamComponentSet, ListAllComponentSetsOptions } from "./types.js";
|
|
2
|
+
export declare function listAllComponentSets({ token, teamId, fetchImpl, }: ListAllComponentSetsOptions): Promise<FigmaTeamComponentSet[]>;
|
|
3
|
+
//# sourceMappingURL=list-all-component-sets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-all-component-sets.d.ts","sourceRoot":"","sources":["../../src/inspect/list-all-component-sets.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,qBAAqB,EACrB,2BAA2B,EAC5B,MAAM,YAAY,CAAC;AAEpB,wBAAsB,oBAAoB,CAAC,EACzC,KAAK,EACL,MAAM,EACN,SAAiB,GAClB,EAAE,2BAA2B,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC,CA6BhE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { listTeamComponentSets, listTeamProjectFiles, } from "../figma-api/index.js";
|
|
2
|
+
export async function listAllComponentSets({ token, teamId, fetchImpl = fetch, }) {
|
|
3
|
+
const [publishedSets, files] = await Promise.all([
|
|
4
|
+
listTeamComponentSets({ token, teamId, fetchImpl }),
|
|
5
|
+
listTeamProjectFiles({ token, teamId, fetchImpl }),
|
|
6
|
+
]);
|
|
7
|
+
const filesByKey = new Map(files.map((file) => [file.key, file]));
|
|
8
|
+
return publishedSets
|
|
9
|
+
.map((componentSet) => {
|
|
10
|
+
const file = filesByKey.get(componentSet.file_key);
|
|
11
|
+
return {
|
|
12
|
+
id: componentSet.node_id,
|
|
13
|
+
key: componentSet.key,
|
|
14
|
+
name: componentSet.name,
|
|
15
|
+
fileKey: componentSet.file_key,
|
|
16
|
+
fileName: file?.name ?? "",
|
|
17
|
+
projectId: file?.project_id ?? "",
|
|
18
|
+
projectName: file?.project_name ?? "",
|
|
19
|
+
};
|
|
20
|
+
})
|
|
21
|
+
.sort((left, right) => left.projectName !== right.projectName
|
|
22
|
+
? left.projectName.localeCompare(right.projectName)
|
|
23
|
+
: left.fileName !== right.fileName
|
|
24
|
+
? left.fileName.localeCompare(right.fileName)
|
|
25
|
+
: left.name.localeCompare(right.name));
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=list-all-component-sets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-all-component-sets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AAa,CAAC,KAAK,CAAC,WAAW,CAAC;QACnD,CAAC,CAAC,IAAI,CAAC,QAAQ,KAAK,KAAK,CAAC,QAAQ;YAChC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC;YAC7C,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAC1C,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ComponentSetNodeRefOptions, ComponentSetScopeOptions, FigmaComponentSetProperty } from "./types.js";
|
|
2
|
+
export declare function listComponentSetProperties(options: ComponentSetScopeOptions): Promise<FigmaComponentSetProperty[]>;
|
|
3
|
+
export declare function listComponentSetPropertiesByRef(options: ComponentSetNodeRefOptions): Promise<FigmaComponentSetProperty[]>;
|
|
4
|
+
//# sourceMappingURL=list-component-set-properties.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-component-set-properties.d.ts","sourceRoot":"","sources":["../../src/inspect/list-component-set-properties.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,YAAY,CAAC;AAsGpB,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,yBAAyB,EAAE,CAAC,CAItC;AAED,wBAAsB,+BAA+B,CACnD,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,yBAAyB,EAAE,CAAC,CAItC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { loadComponentSetContext, loadComponentSetContextByNodeRef, } from "./component-set-context.js";
|
|
2
|
+
function addNestedComponent(seen, nested) {
|
|
3
|
+
const existing = seen.get(nested.id);
|
|
4
|
+
if (!existing) {
|
|
5
|
+
seen.set(nested.id, nested);
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
if (nested.isExposedInstance) {
|
|
9
|
+
existing.isExposedInstance = true;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function resolveNestedComponentFromInstance(root, componentSetIdsByName, componentSets, components) {
|
|
13
|
+
if (root.type !== "INSTANCE" || !root.name) {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
const isExposedInstance = root.isExposedInstance;
|
|
17
|
+
if (isExposedInstance) {
|
|
18
|
+
const componentSetId = componentSetIdsByName.get(root.name);
|
|
19
|
+
if (componentSetId) {
|
|
20
|
+
return { id: componentSetId, name: root.name, isExposedInstance };
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
if (!root.componentId) {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
const component = components[root.componentId];
|
|
27
|
+
if (!component) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
if (component.componentSetId) {
|
|
31
|
+
const componentSet = componentSets[component.componentSetId];
|
|
32
|
+
if (componentSet !== undefined && componentSet.name === root.name) {
|
|
33
|
+
return {
|
|
34
|
+
id: component.componentSetId,
|
|
35
|
+
name: componentSet.name,
|
|
36
|
+
isExposedInstance,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
if (component.name && component.name === root.name) {
|
|
42
|
+
return {
|
|
43
|
+
id: root.componentId,
|
|
44
|
+
name: component.name,
|
|
45
|
+
isExposedInstance,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
function collectNestedComponents(root, componentSetIdsByName, componentSets, components, seen) {
|
|
51
|
+
const nested = resolveNestedComponentFromInstance(root, componentSetIdsByName, componentSets, components);
|
|
52
|
+
if (nested) {
|
|
53
|
+
addNestedComponent(seen, nested);
|
|
54
|
+
}
|
|
55
|
+
if (!root.children) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
for (const child of root.children) {
|
|
59
|
+
collectNestedComponents(child, componentSetIdsByName, componentSets, components, seen);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export async function listComponentSetProperties(options) {
|
|
63
|
+
return listComponentSetPropertiesFromContext(await loadComponentSetContext(options));
|
|
64
|
+
}
|
|
65
|
+
export async function listComponentSetPropertiesByRef(options) {
|
|
66
|
+
return listComponentSetPropertiesFromContext(await loadComponentSetContextByNodeRef(options));
|
|
67
|
+
}
|
|
68
|
+
function listComponentSetPropertiesFromContext({ tree, componentSets, components, nameIndex, }) {
|
|
69
|
+
const seen = new Map();
|
|
70
|
+
collectNestedComponents(tree, nameIndex, componentSets, components, seen);
|
|
71
|
+
return [...seen.values()].sort((left, right) => left.name.localeCompare(right.name));
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=list-component-set-properties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-component-set-properties.js","sourceRoot":"","sources":["../../src/inspect/list-component-set-properties.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,uBAAuB,EACvB,gCAAgC,GACjC,MAAM,4BAA4B,CAAC;AAYpC,SAAS,kBAAkB,CACzB,IAA4C,EAC5C,MAAiC;IAEjC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACrC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QAC5B,OAAO;IACT,CAAC;IAED,IAAI,MAAM,CAAC,iBAAiB,EAAE,CAAC;QAC7B,QAAQ,CAAC,iBAAiB,GAAG,IAAI,CAAC;IACpC,CAAC;AACH,CAAC;AAED,SAAS,kCAAkC,CACzC,IAAkB,EAClB,qBAA0C,EAC1C,aAAgD,EAChD,UAA0C;IAE1C,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAC3C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uildNodeContractOptions, NodeContractResult } from "./types.js";
|
|
3
|
+
export declare function buildNodeContractFromEntry(options: {
|
|
4
|
+
entry: FileNodeEntry;
|
|
5
|
+
fileKey: string;
|
|
6
|
+
nodeId: string;
|
|
7
|
+
sourceUrl?: string;
|
|
8
|
+
variablesPath: string;
|
|
9
|
+
format?: "json" | "yaml";
|
|
10
|
+
}): Promise<NodeContractResult>;
|
|
11
|
+
export declare function buildNodeContractFromRef(options: BuildNodeContractOptions): Promise<NodeContractResult>;
|
|
12
|
+
//# sourceMappingURL=build-node-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-node-contract.d.ts","sourceRoot":"","sources":["../../../src/inspect/node-contract/build-node-contract.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAgB,aAAa,EAAE,MAAM,eAAe,CAAC;AAQjE,OAAO,KAAK,EACV,wBAAwB,EAGxB,kBAAkB,EAEnB,MAAM,YAAY,CAAC;AA0LpB,wBAAsB,0BAA0B,CAAC,OAAO,EAAE;IACxD,KAAK,EAAE,aAAa,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAkE9B;AAED,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,kBAAkB,CAAC,CAgB7B"}
|