@squiz/dxp-page-content-types 1.1.0 → 1.2.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/lib/Nodes/Nodes.d.ts +34 -3
- package/lib/Zones/Zones.d.ts +1 -0
- package/lib/Zones/Zones.js +1 -0
- package/lib/Zones/Zones.js.map +1 -1
- package/package.json +1 -1
package/lib/Nodes/Nodes.d.ts
CHANGED
|
@@ -6,11 +6,10 @@ import { FORMATTED_TEXT_MODELS } from '@squiz/dx-json-schema-lib';
|
|
|
6
6
|
import { Conditions } from '../PageContent/PageContent';
|
|
7
7
|
/**
|
|
8
8
|
* Semi-resolved (referenced content items, not resolved Matrix references) formatted nodes union type.
|
|
9
|
-
* TODO: new layout node
|
|
10
9
|
*/
|
|
11
10
|
export type LayoutContentNodes = (Exclude<FORMATTED_TEXT_MODELS.v1.FormattedNodes, {
|
|
12
|
-
type: 'component' | 'fragment';
|
|
13
|
-
}> | FormattedTextFragmentNode | ComponentNode | VariationNode) & {
|
|
11
|
+
type: 'component' | 'fragment' | 'layout';
|
|
12
|
+
}> | FormattedTextFragmentNode | ComponentNode | VariationNode | LayoutNode) & {
|
|
14
13
|
nodeId?: string;
|
|
15
14
|
};
|
|
16
15
|
/**
|
|
@@ -104,3 +103,35 @@ export type ContentItem<T extends ContentItemBody> = {
|
|
|
104
103
|
*/
|
|
105
104
|
content?: T;
|
|
106
105
|
};
|
|
106
|
+
export interface LayoutZone {
|
|
107
|
+
description: string;
|
|
108
|
+
displayName: string;
|
|
109
|
+
maxNodes: number;
|
|
110
|
+
minNodes: number;
|
|
111
|
+
}
|
|
112
|
+
export interface LayoutZones {
|
|
113
|
+
[zoneKey: string]: LayoutZone;
|
|
114
|
+
}
|
|
115
|
+
interface LayoutOption {
|
|
116
|
+
description: string;
|
|
117
|
+
displayName: string;
|
|
118
|
+
values: Array<string>;
|
|
119
|
+
}
|
|
120
|
+
interface LayoutOptions {
|
|
121
|
+
[key: string]: LayoutOption;
|
|
122
|
+
}
|
|
123
|
+
export interface LayoutData {
|
|
124
|
+
name: string;
|
|
125
|
+
description: string;
|
|
126
|
+
displayName: string;
|
|
127
|
+
version?: string;
|
|
128
|
+
template?: string;
|
|
129
|
+
zones?: LayoutZones;
|
|
130
|
+
options?: LayoutOptions;
|
|
131
|
+
}
|
|
132
|
+
export interface LayoutNode {
|
|
133
|
+
type: 'layout';
|
|
134
|
+
layout: LayoutData;
|
|
135
|
+
content: Record<string, LayoutContentNodes[]>;
|
|
136
|
+
}
|
|
137
|
+
export {};
|
package/lib/Zones/Zones.d.ts
CHANGED
package/lib/Zones/Zones.js
CHANGED
package/lib/Zones/Zones.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Zones.js","sourceRoot":"","sources":["../../src/Zones/Zones.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEU,QAAA,QAAQ,GAAG;IACtB,IAAI,EAAE,MAAM;IACZ,iBAAiB,EAAE,iBAAiB;IACpC,mBAAmB,EAAE,mBAAmB;CAChC,CAAC"}
|
|
1
|
+
{"version":3,"file":"Zones.js","sourceRoot":"","sources":["../../src/Zones/Zones.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEU,QAAA,QAAQ,GAAG;IACtB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,iBAAiB,EAAE,iBAAiB;IACpC,mBAAmB,EAAE,mBAAmB;CAChC,CAAC"}
|