@contentful/experience-design-system-types 2.14.2 → 2.15.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
|
@@ -5,5 +5,7 @@ export declare function stripUnsupportedSlotFields(entry: CDFComponentEntry): CD
|
|
|
5
5
|
export declare function buildManifest(components: Array<{
|
|
6
6
|
key: string;
|
|
7
7
|
entry: CDFComponentEntry;
|
|
8
|
-
}>, tokens: DTCGTokenEntry[]
|
|
8
|
+
}>, tokens: DTCGTokenEntry[], opts?: {
|
|
9
|
+
deleteAllComponents?: boolean;
|
|
10
|
+
}): ManifestPayload;
|
|
9
11
|
export declare function buildFilteredManifest(fullManifest: ManifestPayload, selectedComponentKeys: Set<string>, selectedTokenPaths: Set<string>): ManifestPayload;
|
|
@@ -9,9 +9,13 @@ export function stripUnsupportedSlotFields(entry) {
|
|
|
9
9
|
}
|
|
10
10
|
return { ...entry, $slots: cleaned };
|
|
11
11
|
}
|
|
12
|
-
export function buildManifest(components, tokens) {
|
|
12
|
+
export function buildManifest(components, tokens, opts = {}) {
|
|
13
13
|
const manifest = {};
|
|
14
|
-
|
|
14
|
+
// With components, emit them. With none, normally omit the key entirely — but
|
|
15
|
+
// when `deleteAllComponents` is set, emit an empty-but-present manifest so the
|
|
16
|
+
// server diffs it as "remove every existing component" (delete-all). An
|
|
17
|
+
// omitted key is a no-op; a present-empty one is an explicit clear.
|
|
18
|
+
if (components.length > 0 || opts.deleteAllComponents) {
|
|
15
19
|
const componentsObj = { $schema: CDF_V1_SCHEMA_URL };
|
|
16
20
|
for (const { key, entry } of components) {
|
|
17
21
|
componentsObj[key] = stripUnsupportedSlotFields(entry);
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import type { CDFComponentEntry } from '../../cdf/index.js';
|
|
2
2
|
import type { DTCGTokenEntry } from '../../dtcg/index.js';
|
|
3
|
-
export interface
|
|
3
|
+
export interface PropertyBreakingChange {
|
|
4
4
|
propertyId: string;
|
|
5
5
|
reason: 'removed' | 'added_required_no_default' | 'type_changed' | 'validation_narrowed';
|
|
6
6
|
}
|
|
7
|
+
export interface SlotBreakingChange {
|
|
8
|
+
slotId: string;
|
|
9
|
+
reason: 'slot_removed' | 'slot_allowed_components_narrowed';
|
|
10
|
+
}
|
|
11
|
+
export type BreakingChange = PropertyBreakingChange | SlotBreakingChange;
|
|
7
12
|
export interface ChangeClassification {
|
|
8
13
|
classification: 'breaking' | 'compatible';
|
|
9
14
|
breakingChanges: BreakingChange[];
|
|
@@ -25,6 +30,12 @@ export interface ComponentTypeSummary {
|
|
|
25
30
|
designProperties: string[];
|
|
26
31
|
slots: string[];
|
|
27
32
|
fullProperties?: Record<string, PropertySummary>;
|
|
33
|
+
/**
|
|
34
|
+
* Per-slot `$allowedComponents` on the currently-published version, keyed by
|
|
35
|
+
* slot name. Optional so consumers that don't populate it get the previous
|
|
36
|
+
* no-slot-allow-diff behavior. Empty arrays mean "no restrictions" (any).
|
|
37
|
+
*/
|
|
38
|
+
currentSlotAllowed?: Record<string, string[]>;
|
|
28
39
|
}
|
|
29
40
|
export interface DesignTokenSummary {
|
|
30
41
|
id: string;
|