@contentful/experience-design-system-types 2.39.1-dev-build-eee35c0c.0 → 2.39.1-dev-build-6e58be6f.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.39.1-dev-build-eee35c0c.0",
3
+ "version": "2.39.1-dev-build-6e58be6f.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/src/index.js",
@@ -4,10 +4,10 @@ export declare const CDFPropertySchema: z.ZodMiniObject<{
4
4
  string: "string";
5
5
  number: "number";
6
6
  boolean: "boolean";
7
- enum: "enum";
8
7
  richtext: "richtext";
9
8
  media: "media";
10
9
  link: "link";
10
+ enum: "enum";
11
11
  token: "token";
12
12
  }>;
13
13
  $category: z.ZodMiniEnum<{
@@ -38,10 +38,10 @@ export declare const CDFComponentSchema: z.ZodMiniObject<{
38
38
  string: "string";
39
39
  number: "number";
40
40
  boolean: "boolean";
41
- enum: "enum";
42
41
  richtext: "richtext";
43
42
  media: "media";
44
43
  link: "link";
44
+ enum: "enum";
45
45
  token: "token";
46
46
  }>;
47
47
  $category: z.ZodMiniEnum<{
@@ -1,5 +1,3 @@
1
- export type { SharedSource, SharedSourceFile, SharedSourceCompilerContext, SharedSourceReference, SharedSourceRange, SharedSourceCoverage, SharedSourceCallerCoverage, } from './shared-source.js';
2
- export * from './source-input-association.js';
3
1
  export { validateCDF, parseCDFComponents, CDF_SCHEMA_URL, cdfJsonSchema, CDF_PROPERTY_TYPES, CDF_PROPERTY_CATEGORIES, CDFComponentSchema, CDFPropertySchema, CDFSlotSchema, CDFTokenSchema, buildCDF, buildFilteredCDF, stripUnsupportedSlotFields, validateSlotReferences, type CDFComponentEntry, type CDFPropertyDefinition, type CDFSlotDefinition, type CDFTokenEntry, type CDFValidationError, type CDFValidationResult, type CDFDocument, } from './cdf/index.js';
4
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';
5
3
  export type { BreakingChange, ChangeClassification, DownstreamImpact, PropertySummary, ComponentTypeSummary, DesignTokenSummary, TaxonomySummary, ChangedEntity, EntityDiffGroup, ServerPreviewResponse, } from './sources-api/preview/index.js';
package/dist/src/index.js CHANGED
@@ -1,4 +1,3 @@
1
- export * from './source-input-association.js';
2
1
  // CDF (Component Definition Format) exports — one schema/file for both
3
2
  // components and design tokens, no separate manifest envelope.
4
3
  export { validateCDF, parseCDFComponents, CDF_SCHEMA_URL, cdfJsonSchema, CDF_PROPERTY_TYPES, CDF_PROPERTY_CATEGORIES, CDFComponentSchema, CDFPropertySchema, CDFSlotSchema, CDFTokenSchema, buildCDF, buildFilteredCDF, stripUnsupportedSlotFields, validateSlotReferences, } from './cdf/index.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-types",
3
- "version": "2.39.1-dev-build-eee35c0c.0",
3
+ "version": "2.39.1-dev-build-6e58be6f.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/src/index.js",
@@ -1,105 +0,0 @@
1
- export type SharedSourceCoverage = 'complete-within-declared-bound' | 'partial' | 'unavailable';
2
- export interface SharedSourceCallerCoverage {
3
- scope: 'admitted-source';
4
- analysis: 'lexical-jsx-in-known-component-bodies' | 'configured-lexical-references';
5
- coverage: 'partial';
6
- files: Array<{
7
- path: string;
8
- status: 'analyzed' | 'unsupported' | 'parse-error';
9
- }>;
10
- unresolvedReferences: number;
11
- unownedReferences: number;
12
- components: Array<{
13
- name: string;
14
- sourcePath: string;
15
- referenceCount: number;
16
- outcome: 'observed' | 'not-observed' | 'unknown';
17
- reason: string;
18
- }>;
19
- }
20
- export interface SharedSourceRange {
21
- startLine: number;
22
- endLine: number;
23
- displayStartLine: number;
24
- }
25
- export interface SharedSourceFile {
26
- path: string;
27
- content: string;
28
- partial: boolean;
29
- fileId?: string;
30
- compilerContextId?: string;
31
- canonicalPath?: string;
32
- textHash?: string | null;
33
- coverage?: SharedSourceCoverage;
34
- ranges?: SharedSourceRange[];
35
- roles?: string[];
36
- componentRefs?: Array<{
37
- componentId: string;
38
- name: string;
39
- roles: string[];
40
- observations?: Array<{
41
- role: string;
42
- startLine: number;
43
- endLine: number;
44
- }>;
45
- }>;
46
- }
47
- export interface SharedSourceCompilerContext {
48
- contextId: string;
49
- configPath: string | null;
50
- status: 'configured' | 'fallback' | 'ambiguous' | 'invalid';
51
- referenceOutcome: 'selected' | 'fallback' | 'missing' | 'ambiguous' | 'invalid' | 'cycle' | 'budget-exhausted';
52
- compilerOptions: Record<string, unknown>;
53
- configFiles: Array<{
54
- fileId: string;
55
- textHash: string | null;
56
- }>;
57
- diagnostics: string[];
58
- }
59
- export interface SharedSourceReference {
60
- path: string;
61
- role: string;
62
- partial: boolean;
63
- fileId?: string;
64
- }
65
- /** Source files are stored once; lexical references do not prove runtime execution. */
66
- export interface SharedSource {
67
- inventory?: unknown;
68
- omittedInventory?: number;
69
- files: SharedSourceFile[];
70
- /** Absent on older snapshots; missing configuration is unknown. */
71
- compilerContexts?: SharedSourceCompilerContext[];
72
- omittedCompilerContexts?: number;
73
- components: Array<{
74
- component: string;
75
- source: string;
76
- refs: SharedSourceReference[];
77
- componentId?: string;
78
- }>;
79
- captureId?: string;
80
- captureDigest?: string;
81
- envelopeId?: string;
82
- envelopeDigest?: string;
83
- sessionId?: string;
84
- extractionStepId?: number;
85
- coverage?: SharedSourceCoverage;
86
- promptCoverage?: SharedSourceCoverage;
87
- /** Legacy snapshot metadata; ignored and removed from new prompt projections. */
88
- projectionBounds?: {
89
- maxBytes: number;
90
- usedBytes: number;
91
- };
92
- extractionByteBinding?: 'verified-same' | 'changed' | 'unverified';
93
- omittedFiles?: number;
94
- omittedRanges?: number;
95
- omittedComponents?: number;
96
- omittedDiagnostics?: number;
97
- omittedObservations?: number;
98
- diagnostics?: unknown[];
99
- observations?: {
100
- accepted: unknown[];
101
- rejected: unknown[];
102
- callerCoverage?: SharedSourceCallerCoverage;
103
- referenceIndexes?: unknown[];
104
- };
105
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,23 +0,0 @@
1
- import * as z from 'zod/mini';
2
- export declare const SourceInputAssociationSchema: z.ZodMiniObject<{
3
- schemaVersion: z.ZodMiniLiteral<1>;
4
- componentId: z.ZodMiniString<string>;
5
- componentDeclarationId: z.ZodMiniString<string>;
6
- rootSymbolId: z.ZodMiniString<string>;
7
- inputName: z.ZodMiniString<string>;
8
- inputPath: z.ZodMiniArray<z.ZodMiniString<string>>;
9
- }, z.core.$strict>;
10
- export type SourceInputAssociation = z.infer<typeof SourceInputAssociationSchema>;
11
- export declare function sourceInputOwnerKey(input: SourceInputAssociation): string;
12
- export declare function validateSourceInputOwners(owners: readonly {
13
- name: string;
14
- sourceInput?: SourceInputAssociation;
15
- }[]): void;
16
- export declare function validateCDFSourceOwnerContract(entry: {
17
- $properties: Record<string, {
18
- $sourceInput?: SourceInputAssociation;
19
- }>;
20
- $slots?: Record<string, {
21
- $sourceInput?: SourceInputAssociation;
22
- }>;
23
- }): void;
@@ -1,52 +0,0 @@
1
- import * as z from 'zod/mini';
2
- const name = z.string().check(z.refine((value) => value.trim().length > 0));
3
- export const SourceInputAssociationSchema = z
4
- .strictObject({
5
- schemaVersion: z.literal(1),
6
- componentId: name,
7
- componentDeclarationId: name,
8
- rootSymbolId: name,
9
- inputName: name,
10
- inputPath: z.array(name).check(z.minLength(1)),
11
- })
12
- .check(z.refine((value) => value.inputPath[0] === value.inputName));
13
- export function sourceInputOwnerKey(input) {
14
- return JSON.stringify([input.componentId, input.componentDeclarationId, input.rootSymbolId, input.inputPath]);
15
- }
16
- export function validateSourceInputOwners(owners) {
17
- const names = new Set();
18
- const inputs = new Set();
19
- for (const owner of owners) {
20
- if (!owner.name.trim() || names.has(owner.name))
21
- throw new Error('Blank or duplicate authoring name');
22
- names.add(owner.name);
23
- if (!owner.sourceInput)
24
- continue;
25
- if (!SourceInputAssociationSchema.safeParse(owner.sourceInput).success ||
26
- owner.sourceInput.inputPath[0] !== owner.sourceInput.inputName)
27
- throw new Error('Invalid source input association');
28
- const key = sourceInputOwnerKey(owner.sourceInput);
29
- if (inputs.has(key))
30
- throw new Error('Source input has multiple owners');
31
- inputs.add(key);
32
- }
33
- }
34
- export function validateCDFSourceOwnerContract(entry) {
35
- validateSourceInputOwners([
36
- ...Object.entries(entry.$properties).map(([name, property]) => ({
37
- name: `property:${name}`,
38
- sourceInput: property.$sourceInput,
39
- })),
40
- ...Object.entries(entry.$slots ?? {}).map(([name, slot]) => ({
41
- name: `slot:${name}`,
42
- sourceInput: slot.$sourceInput,
43
- })),
44
- ]);
45
- for (const [name, slot] of Object.entries(entry.$slots ?? {})) {
46
- if (!name.trim())
47
- throw new Error('Blank slot name');
48
- const input = slot.$sourceInput;
49
- if (input && entry.$properties[input.inputName] && !entry.$properties[input.inputName].$sourceInput)
50
- throw new Error('Property and slot conflict over source input ownership');
51
- }
52
- }