@contentful/experience-design-system-types 2.16.2-dev-build-a6d3bd1.0 → 2.16.2-dev-build-1a1be21.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/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-types",
3
- "version": "2.16.2-dev-build-a6d3bd1.0",
3
+ "version": "2.16.2-dev-build-1a1be21.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/src/index.js",
@@ -1,4 +1,4 @@
1
1
  export { validateCDF, parseCDFComponents } from './validate.js';
2
2
  export { CDF_V1_SCHEMA_URL } from './schema.js';
3
3
  export { CDF_PROPERTY_TYPES, CDF_PROPERTY_CATEGORIES } from './vocabularies.js';
4
- export type { CDFComponentEntry, CDFPropertyDefinition, CDFSlotDefinition, CDFValidationError } from './types.js';
4
+ export { CDFComponentSchema, CDFPropertySchema, CDFSlotSchema, type CDFComponentEntry, type CDFPropertyDefinition, type CDFSlotDefinition, type CDFValidationError, } from './types.js';
@@ -1,3 +1,4 @@
1
1
  export { validateCDF, parseCDFComponents } from './validate.js';
2
2
  export { CDF_V1_SCHEMA_URL } from './schema.js';
3
3
  export { CDF_PROPERTY_TYPES, CDF_PROPERTY_CATEGORIES } from './vocabularies.js';
4
+ export { CDFComponentSchema, CDFPropertySchema, CDFSlotSchema, } from './types.js';
@@ -54,7 +54,7 @@ export declare const cdfV1JsonSchema: {
54
54
  readonly properties: {
55
55
  readonly $type: {
56
56
  readonly type: "string";
57
- readonly enum: readonly ["string", "richtext", "media", "link", "enum", "token", "boolean"];
57
+ readonly enum: readonly ["string", "richtext", "number", "media", "link", "enum", "token", "boolean"];
58
58
  };
59
59
  readonly $category: {
60
60
  readonly type: "string";
@@ -1,32 +1,68 @@
1
- import type { CDFPropertyType, CDFPropertyCategory } from './vocabularies.js';
2
- export interface CDFPropertyDefinition {
3
- $type: CDFPropertyType;
4
- $category: CDFPropertyCategory;
5
- $description?: string;
6
- $required?: boolean;
7
- $default?: unknown;
8
- $values?: string[];
9
- '$token.kind'?: string;
10
- }
11
- export interface CDFSlotDefinition {
12
- $description?: string;
13
- $allowedComponents?: string[];
14
- $required?: boolean;
15
- }
16
- export interface CDFComponentEntry {
17
- $type: 'component';
18
- $description?: string;
19
- $properties: Record<string, CDFPropertyDefinition>;
20
- $slots?: Record<string, CDFSlotDefinition>;
21
- }
22
- export type CDFGroupOrComponent = CDFComponentEntry | CDFGroup;
23
- export interface CDFGroup {
24
- $description?: string;
25
- [key: string]: CDFGroupOrComponent | string | undefined;
26
- }
1
+ import * as z from 'zod/mini';
2
+ export declare const CDFPropertySchema: z.ZodMiniObject<{
3
+ $type: z.ZodMiniEnum<{
4
+ string: "string";
5
+ number: "number";
6
+ boolean: "boolean";
7
+ richtext: "richtext";
8
+ media: "media";
9
+ link: "link";
10
+ enum: "enum";
11
+ token: "token";
12
+ }>;
13
+ $category: z.ZodMiniEnum<{
14
+ content: "content";
15
+ design: "design";
16
+ state: "state";
17
+ }>;
18
+ $description: z.ZodMiniOptional<z.ZodMiniString<string>>;
19
+ $required: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
20
+ $default: z.ZodMiniOptional<z.ZodMiniAny>;
21
+ $values: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
22
+ '$token.kind': z.ZodMiniOptional<z.ZodMiniString<string>>;
23
+ }, z.core.$strict>;
24
+ export type CDFPropertyDefinition = z.infer<typeof CDFPropertySchema>;
25
+ export declare const CDFSlotSchema: z.ZodMiniObject<{
26
+ $description: z.ZodMiniOptional<z.ZodMiniString<string>>;
27
+ $allowedComponents: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
28
+ $required: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
29
+ }, z.core.$strict>;
30
+ export type CDFSlotDefinition = z.infer<typeof CDFSlotSchema>;
31
+ export declare const CDFComponentSchema: z.ZodMiniObject<{
32
+ $type: z.ZodMiniLiteral<"component">;
33
+ $description: z.ZodMiniOptional<z.ZodMiniString<string>>;
34
+ $properties: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
35
+ $type: z.ZodMiniEnum<{
36
+ string: "string";
37
+ number: "number";
38
+ boolean: "boolean";
39
+ richtext: "richtext";
40
+ media: "media";
41
+ link: "link";
42
+ enum: "enum";
43
+ token: "token";
44
+ }>;
45
+ $category: z.ZodMiniEnum<{
46
+ content: "content";
47
+ design: "design";
48
+ state: "state";
49
+ }>;
50
+ $description: z.ZodMiniOptional<z.ZodMiniString<string>>;
51
+ $required: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
52
+ $default: z.ZodMiniOptional<z.ZodMiniAny>;
53
+ $values: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
54
+ '$token.kind': z.ZodMiniOptional<z.ZodMiniString<string>>;
55
+ }, z.core.$strict>>;
56
+ $slots: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
57
+ $description: z.ZodMiniOptional<z.ZodMiniString<string>>;
58
+ $allowedComponents: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
59
+ $required: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
60
+ }, z.core.$strict>>>;
61
+ }, z.core.$strict>;
62
+ export type CDFComponentEntry = z.infer<typeof CDFComponentSchema>;
27
63
  export interface CDFFile {
28
64
  $schema: string;
29
- [key: string]: CDFGroupOrComponent | string | undefined;
65
+ [key: string]: unknown;
30
66
  }
31
67
  export interface CDFValidationError {
32
68
  path: string;
@@ -1 +1,22 @@
1
- export {};
1
+ import * as z from 'zod/mini';
2
+ import { CDF_PROPERTY_TYPES, CDF_PROPERTY_CATEGORIES } from './vocabularies.js';
3
+ export const CDFPropertySchema = z.strictObject({
4
+ $type: z.enum(CDF_PROPERTY_TYPES),
5
+ $category: z.enum(CDF_PROPERTY_CATEGORIES),
6
+ $description: z.optional(z.string()),
7
+ $required: z.optional(z.boolean()),
8
+ $default: z.optional(z.any()),
9
+ $values: z.optional(z.array(z.string())),
10
+ '$token.kind': z.optional(z.string()),
11
+ });
12
+ export const CDFSlotSchema = z.strictObject({
13
+ $description: z.optional(z.string()),
14
+ $allowedComponents: z.optional(z.array(z.string())),
15
+ $required: z.optional(z.boolean()),
16
+ });
17
+ export const CDFComponentSchema = z.strictObject({
18
+ $type: z.literal('component'),
19
+ $description: z.optional(z.string()),
20
+ $properties: z.record(z.string(), CDFPropertySchema),
21
+ $slots: z.optional(z.record(z.string(), CDFSlotSchema)),
22
+ });
@@ -1,4 +1,2 @@
1
- export declare const CDF_PROPERTY_TYPES: readonly ["string", "richtext", "media", "link", "enum", "token", "boolean"];
2
- export type CDFPropertyType = (typeof CDF_PROPERTY_TYPES)[number];
1
+ export declare const CDF_PROPERTY_TYPES: readonly ["string", "richtext", "number", "media", "link", "enum", "token", "boolean"];
3
2
  export declare const CDF_PROPERTY_CATEGORIES: readonly ["content", "design", "state"];
4
- export type CDFPropertyCategory = (typeof CDF_PROPERTY_CATEGORIES)[number];
@@ -1,2 +1,11 @@
1
- export const CDF_PROPERTY_TYPES = ['string', 'richtext', 'media', 'link', 'enum', 'token', 'boolean'];
1
+ export const CDF_PROPERTY_TYPES = [
2
+ 'string',
3
+ 'richtext',
4
+ 'number',
5
+ 'media',
6
+ 'link',
7
+ 'enum',
8
+ 'token',
9
+ 'boolean',
10
+ ];
2
11
  export const CDF_PROPERTY_CATEGORIES = ['content', 'design', 'state'];
@@ -1,4 +1,4 @@
1
1
  export { DESIGN_TOKEN_TYPES, type DesignTokenType } from './token-types.js';
2
- export type { DTCGTokenEntry, DTCGTokenGroup, DTCGTokenNode, DTCGTokenGroupNode } from './types.js';
2
+ export { DTCGTokenSchema, type DTCGTokenEntry, type DTCGTokenGroup, type DTCGTokenNode, type DTCGTokenGroupNode, } from './types.js';
3
3
  export { flattenDTCG } from './utils.js';
4
4
  export { validateDTCG, type DTCGValidationError, type DTCGValidationResult } from './validate.js';
@@ -1,3 +1,4 @@
1
1
  export { DESIGN_TOKEN_TYPES } from './token-types.js';
2
+ export { DTCGTokenSchema, } from './types.js';
2
3
  export { flattenDTCG } from './utils.js';
3
4
  export { validateDTCG } from './validate.js';
@@ -1,10 +1,25 @@
1
- import type { DesignTokenType } from './token-types.js';
2
- export interface DTCGTokenEntry {
3
- path: string;
4
- $type: DesignTokenType;
5
- $value: unknown;
6
- $description?: string;
7
- }
1
+ import * as z from 'zod/mini';
2
+ export declare const DTCGTokenSchema: z.ZodMiniObject<{
3
+ path: z.ZodMiniString<string>;
4
+ $type: z.ZodMiniEnum<{
5
+ number: "number";
6
+ color: "color";
7
+ dimension: "dimension";
8
+ fontFamily: "fontFamily";
9
+ fontWeight: "fontWeight";
10
+ duration: "duration";
11
+ cubicBezier: "cubicBezier";
12
+ strokeStyle: "strokeStyle";
13
+ border: "border";
14
+ transition: "transition";
15
+ shadow: "shadow";
16
+ gradient: "gradient";
17
+ typography: "typography";
18
+ }>;
19
+ $value: z.ZodMiniUnknown;
20
+ $description: z.ZodMiniOptional<z.ZodMiniString<string>>;
21
+ }, z.core.$strict>;
22
+ export type DTCGTokenEntry = z.infer<typeof DTCGTokenSchema>;
8
23
  export interface DTCGTokenGroup {
9
24
  path: string;
10
25
  $description?: string;
@@ -1 +1,8 @@
1
- export {};
1
+ import * as z from 'zod/mini';
2
+ import { DESIGN_TOKEN_TYPES } from './token-types.js';
3
+ export const DTCGTokenSchema = z.strictObject({
4
+ path: z.string(),
5
+ $type: z.enum(DESIGN_TOKEN_TYPES),
6
+ $value: z.unknown(),
7
+ $description: z.optional(z.string()),
8
+ });
@@ -1,5 +1,5 @@
1
- export { validateCDF, parseCDFComponents, CDF_V1_SCHEMA_URL, CDF_PROPERTY_TYPES, CDF_PROPERTY_CATEGORIES, type CDFComponentEntry, type CDFPropertyDefinition, type CDFSlotDefinition, type CDFValidationError, } from './cdf/index.js';
2
- export { DESIGN_TOKEN_TYPES, flattenDTCG, validateDTCG, type DesignTokenType, type DTCGTokenEntry, type DTCGTokenGroup, type DTCGTokenNode, type DTCGTokenGroupNode, type DTCGValidationError, type DTCGValidationResult, } from './dtcg/index.js';
1
+ export { validateCDF, parseCDFComponents, CDF_V1_SCHEMA_URL, CDF_PROPERTY_TYPES, CDF_PROPERTY_CATEGORIES, CDFComponentSchema, CDFPropertySchema, CDFSlotSchema, type CDFComponentEntry, type CDFPropertyDefinition, type CDFSlotDefinition, type CDFValidationError, } from './cdf/index.js';
2
+ export { DESIGN_TOKEN_TYPES, flattenDTCG, validateDTCG, DTCGTokenSchema, type DesignTokenType, type DTCGTokenEntry, type DTCGTokenGroup, type DTCGTokenNode, type DTCGTokenGroupNode, type DTCGValidationError, type DTCGValidationResult, } from './dtcg/index.js';
3
3
  export type { BreakingChange, ChangeClassification, DownstreamImpact, PropertySummary, ComponentTypeSummary, DesignTokenSummary, TaxonomySummary, ChangedEntity, EntityDiffGroup, ServerPreviewResponse, } from './sources-api/preview/index.js';
4
4
  export type { ApplyOperationStatus, ApplyOperationItemError, ApplyOperationItem, ApplyOperationResponse, ApplyGateError, } from './sources-api/apply/index.js';
5
5
  export type { ManifestPayload } from './sources-api/manifest/index.js';
package/dist/src/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // CDF (Component Definition Format) exports
2
- export { validateCDF, parseCDFComponents, CDF_V1_SCHEMA_URL, CDF_PROPERTY_TYPES, CDF_PROPERTY_CATEGORIES, } from './cdf/index.js';
2
+ export { validateCDF, parseCDFComponents, CDF_V1_SCHEMA_URL, CDF_PROPERTY_TYPES, CDF_PROPERTY_CATEGORIES, CDFComponentSchema, CDFPropertySchema, CDFSlotSchema, } from './cdf/index.js';
3
3
  // DTCG (W3C Design Token Community Group)
4
- export { DESIGN_TOKEN_TYPES, flattenDTCG, validateDTCG, } from './dtcg/index.js';
4
+ export { DESIGN_TOKEN_TYPES, flattenDTCG, validateDTCG, DTCGTokenSchema, } from './dtcg/index.js';
5
5
  export { buildManifest, buildFilteredManifest, stripUnsupportedSlotFields } from './sources-api/manifest/index.js';
@@ -16,6 +16,7 @@ export interface ChangeClassification {
16
16
  export interface DownstreamImpact {
17
17
  affectedFragments: number;
18
18
  affectedExperiences: number;
19
+ referencedByFragment?: boolean;
19
20
  }
20
21
  export interface PropertySummary {
21
22
  type: string;
@@ -36,11 +37,14 @@ export interface ComponentTypeSummary {
36
37
  * no-slot-allow-diff behavior. Empty arrays mean "no restrictions" (any).
37
38
  */
38
39
  currentSlotAllowed?: Record<string, string[]>;
40
+ deleteBlocked?: {
41
+ reason: 'fragment-referenced';
42
+ };
39
43
  }
40
44
  export interface DesignTokenSummary {
41
45
  id: string;
42
46
  name: string;
43
- kind: string;
47
+ type: string;
44
48
  }
45
49
  export interface TaxonomySummary {
46
50
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-types",
3
- "version": "2.16.2-dev-build-a6d3bd1.0",
3
+ "version": "2.16.2-dev-build-1a1be21.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/src/index.js",