@squiz/dxp-page-content-types 1.5.3 → 1.6.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 +31 -5
- package/lib/Nodes/Nodes.js +9 -1
- package/lib/Nodes/Nodes.js.map +1 -1
- package/package.json +1 -1
package/lib/Nodes/Nodes.d.ts
CHANGED
|
@@ -24,6 +24,15 @@ export declare const LayoutOptionValueType: {
|
|
|
24
24
|
readonly text: "text";
|
|
25
25
|
};
|
|
26
26
|
export type LayoutOptionValueType = (typeof LayoutOptionValueType)[keyof typeof LayoutOptionValueType];
|
|
27
|
+
/**
|
|
28
|
+
* Layout property types.
|
|
29
|
+
*/
|
|
30
|
+
export declare const LayoutPropertyTypes: readonly ["boolean", "string"];
|
|
31
|
+
export declare const LayoutPropertyType: {
|
|
32
|
+
readonly boolean: "boolean";
|
|
33
|
+
readonly string: "string";
|
|
34
|
+
};
|
|
35
|
+
export type LayoutPropertyType = (typeof LayoutPropertyType)[keyof typeof LayoutPropertyType];
|
|
27
36
|
/**
|
|
28
37
|
* Semi-resolved (referenced content items, not resolved Matrix references) formatted nodes union type.
|
|
29
38
|
*/
|
|
@@ -128,11 +137,11 @@ export type ContentItem<T extends ContentItemBody> = {
|
|
|
128
137
|
export interface LayoutZone {
|
|
129
138
|
description: string;
|
|
130
139
|
displayName: string;
|
|
131
|
-
|
|
132
|
-
minNodes: number;
|
|
140
|
+
key: string;
|
|
133
141
|
}
|
|
142
|
+
export type LayoutZonesArray = Array<LayoutZone>;
|
|
134
143
|
export interface LayoutZones {
|
|
135
|
-
[zoneKey: string]: LayoutZone
|
|
144
|
+
[zoneKey: string]: Omit<LayoutZone, 'key'>;
|
|
136
145
|
}
|
|
137
146
|
export interface LayoutOptionBase {
|
|
138
147
|
description: string;
|
|
@@ -156,14 +165,31 @@ export type LayoutOption = LayoutOptionEnum | LayoutOptionBoolean | LayoutOption
|
|
|
156
165
|
export interface LayoutOptions {
|
|
157
166
|
[key: string]: LayoutOption;
|
|
158
167
|
}
|
|
168
|
+
export interface LayoutPropertyBase {
|
|
169
|
+
title: string;
|
|
170
|
+
description: string;
|
|
171
|
+
type: LayoutPropertyType;
|
|
172
|
+
}
|
|
173
|
+
export interface LayoutPropertyBoolean extends LayoutPropertyBase {
|
|
174
|
+
type: 'boolean';
|
|
175
|
+
selectedValue?: boolean;
|
|
176
|
+
}
|
|
177
|
+
export interface LayoutPropertyString extends LayoutPropertyBase {
|
|
178
|
+
type: 'string';
|
|
179
|
+
enum?: Array<string>;
|
|
180
|
+
selectedValue?: string;
|
|
181
|
+
}
|
|
182
|
+
export type LayoutProperty = LayoutPropertyBoolean | LayoutPropertyString;
|
|
183
|
+
export type LayoutProperties = Record<string, LayoutProperty>;
|
|
184
|
+
export type LayoutPropertyValues = Record<string, Pick<LayoutProperty, 'selectedValue'>>;
|
|
159
185
|
export interface LayoutData {
|
|
160
186
|
name: string;
|
|
161
187
|
description: string;
|
|
162
188
|
displayName: string;
|
|
163
189
|
version?: string;
|
|
164
190
|
template?: string;
|
|
165
|
-
zones?:
|
|
166
|
-
|
|
191
|
+
zones?: LayoutZonesArray;
|
|
192
|
+
properties?: LayoutProperties | LayoutPropertyValues;
|
|
167
193
|
}
|
|
168
194
|
export interface LayoutNode {
|
|
169
195
|
type: 'layout';
|
package/lib/Nodes/Nodes.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright Squiz Australia Pty Ltd. All Rights Reserved.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.LayoutOptionValueType = exports.LayoutOptionValueTypes = exports.NODE_TYPE = void 0;
|
|
7
|
+
exports.LayoutPropertyType = exports.LayoutPropertyTypes = exports.LayoutOptionValueType = exports.LayoutOptionValueTypes = exports.NODE_TYPE = void 0;
|
|
8
8
|
/**
|
|
9
9
|
* Content node helper constants.
|
|
10
10
|
*/
|
|
@@ -23,4 +23,12 @@ exports.LayoutOptionValueType = {
|
|
|
23
23
|
boolean: 'boolean',
|
|
24
24
|
text: 'text',
|
|
25
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* Layout property types.
|
|
28
|
+
*/
|
|
29
|
+
exports.LayoutPropertyTypes = ['boolean', 'string'];
|
|
30
|
+
exports.LayoutPropertyType = {
|
|
31
|
+
boolean: 'boolean',
|
|
32
|
+
string: 'string',
|
|
33
|
+
};
|
|
26
34
|
//# sourceMappingURL=Nodes.js.map
|
package/lib/Nodes/Nodes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Nodes.js","sourceRoot":"","sources":["../../src/Nodes/Nodes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH;;GAEG;AAEU,QAAA,SAAS,GAAG;IACvB,SAAS,EAAE,WAAoB;IAC/B,QAAQ,EAAE,UAAmB;IAC7B,MAAM,EAAE,QAAiB;IACzB,SAAS,EAAE,WAAoB;CAChC,CAAC;AAGF;;GAEG;AAEU,QAAA,sBAAsB,GAAG,CAAC,aAAa,EAAE,SAAS,EAAE,MAAM,CAAU,CAAC;AAErE,QAAA,qBAAqB,GAAG;IACnC,UAAU,EAAE,aAAa;IACzB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;CAC8D,CAAC"}
|
|
1
|
+
{"version":3,"file":"Nodes.js","sourceRoot":"","sources":["../../src/Nodes/Nodes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH;;GAEG;AAEU,QAAA,SAAS,GAAG;IACvB,SAAS,EAAE,WAAoB;IAC/B,QAAQ,EAAE,UAAmB;IAC7B,MAAM,EAAE,QAAiB;IACzB,SAAS,EAAE,WAAoB;CAChC,CAAC;AAGF;;GAEG;AAEU,QAAA,sBAAsB,GAAG,CAAC,aAAa,EAAE,SAAS,EAAE,MAAM,CAAU,CAAC;AAErE,QAAA,qBAAqB,GAAG;IACnC,UAAU,EAAE,aAAa;IACzB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;CAC8D,CAAC;AAI7E;;GAEG;AACU,QAAA,mBAAmB,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAU,CAAC;AACrD,QAAA,kBAAkB,GAAG;IAChC,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;CACuD,CAAC"}
|