@squiz/dx-page-contents-lib 1.69.0 → 1.70.1
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/formatted-text.d.ts +69 -12
- package/lib/formatted-text.js +25 -1
- package/lib/formatted-text.js.map +1 -1
- package/lib/formatted-text.spec.d.ts +1 -0
- package/lib/formatted-text.spec.js +109 -0
- package/lib/formatted-text.spec.js.map +1 -0
- package/lib/layout-content.d.ts +111 -15
- package/lib/layout-content.js +2 -2
- package/lib/layout-content.js.map +1 -1
- package/lib/layout-content.spec.js +17 -7
- package/lib/layout-content.spec.js.map +1 -1
- package/lib/layouts/index.d.ts +528 -1008
- package/lib/layouts/raw.layout.d.ts +132 -252
- package/lib/layouts/single-column.layout.d.ts +132 -252
- package/lib/layouts/two-column.layout.d.ts +264 -504
- package/lib/mocks/PageContentsHelpers.d.ts +660 -1260
- package/lib/mocks/PageContentsMocks.d.ts +1 -1
- package/lib/page-contents-lib.js +4 -4
- package/lib/page-contents-lib.js.map +1 -1
- package/lib/resolvers/create-variant-resolver.d.ts +1 -0
- package/lib/resolvers/create-variant-resolver.js +26 -11
- package/lib/resolvers/create-variant-resolver.js.map +1 -1
- package/lib/resolvers/create-variant-resolver.spec.js +0 -6
- package/lib/resolvers/create-variant-resolver.spec.js.map +1 -1
- package/package.json +1 -1
package/lib/formatted-text.d.ts
CHANGED
|
@@ -93,24 +93,42 @@ export declare const LinkToMatrixAssetNode: z.ZodObject<{
|
|
|
93
93
|
}, {
|
|
94
94
|
alignment: "left" | "center" | "right" | "justify";
|
|
95
95
|
}>>;
|
|
96
|
+
attributes: z.ZodOptional<z.ZodIntersection<z.ZodRecord<z.ZodString, z.ZodString>, z.ZodObject<{
|
|
97
|
+
href: z.ZodOptional<z.ZodNever>;
|
|
98
|
+
target: z.ZodOptional<z.ZodNever>;
|
|
99
|
+
}, "strip", z.ZodTypeAny, {
|
|
100
|
+
target?: undefined;
|
|
101
|
+
href?: undefined;
|
|
102
|
+
}, {
|
|
103
|
+
target?: undefined;
|
|
104
|
+
href?: undefined;
|
|
105
|
+
}>>>;
|
|
96
106
|
}, "strip", z.ZodTypeAny, {
|
|
97
107
|
type: "link-to-matrix-asset";
|
|
98
108
|
matrixDomain: string;
|
|
99
109
|
matrixAssetId: string;
|
|
100
110
|
target: "_blank" | "_self" | "_parent" | "_top";
|
|
101
|
-
|
|
111
|
+
attributes?: (Record<string, string> & {
|
|
112
|
+
target?: undefined;
|
|
113
|
+
href?: undefined;
|
|
114
|
+
}) | undefined;
|
|
102
115
|
formattingOptions?: {
|
|
103
116
|
alignment: "left" | "center" | "right" | "justify";
|
|
104
117
|
} | undefined;
|
|
118
|
+
matrixIdentifier?: string | undefined;
|
|
105
119
|
}, {
|
|
106
120
|
type: "link-to-matrix-asset";
|
|
107
121
|
matrixDomain: string;
|
|
108
122
|
matrixAssetId: string;
|
|
109
123
|
target: "_blank" | "_self" | "_parent" | "_top";
|
|
110
|
-
|
|
124
|
+
attributes?: (Record<string, string> & {
|
|
125
|
+
target?: undefined;
|
|
126
|
+
href?: undefined;
|
|
127
|
+
}) | undefined;
|
|
111
128
|
formattingOptions?: {
|
|
112
129
|
alignment: "left" | "center" | "right" | "justify";
|
|
113
130
|
} | undefined;
|
|
131
|
+
matrixIdentifier?: string | undefined;
|
|
114
132
|
}>;
|
|
115
133
|
export declare const MatrixImageNode: z.ZodObject<{
|
|
116
134
|
type: z.ZodLiteral<"matrix-image">;
|
|
@@ -124,22 +142,35 @@ export declare const MatrixImageNode: z.ZodObject<{
|
|
|
124
142
|
}, {
|
|
125
143
|
alignment: "left" | "center" | "right" | "justify";
|
|
126
144
|
}>>;
|
|
145
|
+
attributes: z.ZodOptional<z.ZodIntersection<z.ZodRecord<z.ZodString, z.ZodString>, z.ZodObject<{
|
|
146
|
+
src: z.ZodOptional<z.ZodNever>;
|
|
147
|
+
}, "strip", z.ZodTypeAny, {
|
|
148
|
+
src?: undefined;
|
|
149
|
+
}, {
|
|
150
|
+
src?: undefined;
|
|
151
|
+
}>>>;
|
|
127
152
|
}, "strip", z.ZodTypeAny, {
|
|
128
153
|
type: "matrix-image";
|
|
129
154
|
matrixDomain: string;
|
|
130
155
|
matrixAssetId: string;
|
|
131
|
-
|
|
156
|
+
attributes?: (Record<string, string> & {
|
|
157
|
+
src?: undefined;
|
|
158
|
+
}) | undefined;
|
|
132
159
|
formattingOptions?: {
|
|
133
160
|
alignment: "left" | "center" | "right" | "justify";
|
|
134
161
|
} | undefined;
|
|
162
|
+
matrixIdentifier?: string | undefined;
|
|
135
163
|
}, {
|
|
136
164
|
type: "matrix-image";
|
|
137
165
|
matrixDomain: string;
|
|
138
166
|
matrixAssetId: string;
|
|
139
|
-
|
|
167
|
+
attributes?: (Record<string, string> & {
|
|
168
|
+
src?: undefined;
|
|
169
|
+
}) | undefined;
|
|
140
170
|
formattingOptions?: {
|
|
141
171
|
alignment: "left" | "center" | "right" | "justify";
|
|
142
172
|
} | undefined;
|
|
173
|
+
matrixIdentifier?: string | undefined;
|
|
143
174
|
}>;
|
|
144
175
|
export declare const DamImageNode: z.ZodObject<{
|
|
145
176
|
type: z.ZodLiteral<"dam-image">;
|
|
@@ -147,28 +178,54 @@ export declare const DamImageNode: z.ZodObject<{
|
|
|
147
178
|
damSystemIdentifier: z.ZodString;
|
|
148
179
|
damObjectId: z.ZodString;
|
|
149
180
|
damAdditional: z.ZodOptional<z.ZodObject<{
|
|
181
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
182
|
+
}, "strip", z.ZodTypeAny, {
|
|
183
|
+
variant?: string | undefined;
|
|
184
|
+
}, {
|
|
185
|
+
variant?: string | undefined;
|
|
186
|
+
}>>;
|
|
187
|
+
formattingOptions: z.ZodOptional<z.ZodObject<{
|
|
150
188
|
alignment: z.ZodEnum<["left", "center", "right", "justify"]>;
|
|
151
189
|
}, "strip", z.ZodTypeAny, {
|
|
152
190
|
alignment: "left" | "center" | "right" | "justify";
|
|
153
191
|
}, {
|
|
154
192
|
alignment: "left" | "center" | "right" | "justify";
|
|
155
193
|
}>>;
|
|
194
|
+
attributes: z.ZodOptional<z.ZodIntersection<z.ZodRecord<z.ZodString, z.ZodString>, z.ZodObject<{
|
|
195
|
+
src: z.ZodOptional<z.ZodNever>;
|
|
196
|
+
}, "strip", z.ZodTypeAny, {
|
|
197
|
+
src?: undefined;
|
|
198
|
+
}, {
|
|
199
|
+
src?: undefined;
|
|
200
|
+
}>>>;
|
|
156
201
|
}, "strip", z.ZodTypeAny, {
|
|
157
202
|
type: "dam-image";
|
|
158
203
|
damSystemType: "bynder";
|
|
159
204
|
damSystemIdentifier: string;
|
|
160
205
|
damObjectId: string;
|
|
161
|
-
|
|
206
|
+
attributes?: (Record<string, string> & {
|
|
207
|
+
src?: undefined;
|
|
208
|
+
}) | undefined;
|
|
209
|
+
formattingOptions?: {
|
|
162
210
|
alignment: "left" | "center" | "right" | "justify";
|
|
163
211
|
} | undefined;
|
|
212
|
+
damAdditional?: {
|
|
213
|
+
variant?: string | undefined;
|
|
214
|
+
} | undefined;
|
|
164
215
|
}, {
|
|
165
216
|
type: "dam-image";
|
|
166
217
|
damSystemType: "bynder";
|
|
167
218
|
damSystemIdentifier: string;
|
|
168
219
|
damObjectId: string;
|
|
169
|
-
|
|
220
|
+
attributes?: (Record<string, string> & {
|
|
221
|
+
src?: undefined;
|
|
222
|
+
}) | undefined;
|
|
223
|
+
formattingOptions?: {
|
|
170
224
|
alignment: "left" | "center" | "right" | "justify";
|
|
171
225
|
} | undefined;
|
|
226
|
+
damAdditional?: {
|
|
227
|
+
variant?: string | undefined;
|
|
228
|
+
} | undefined;
|
|
172
229
|
}>;
|
|
173
230
|
export declare const ComponentNode: z.ZodObject<{
|
|
174
231
|
type: z.ZodLiteral<"component">;
|
|
@@ -227,27 +284,27 @@ export declare const Variant: z.ZodObject<{
|
|
|
227
284
|
id: z.ZodString;
|
|
228
285
|
variant: z.ZodString;
|
|
229
286
|
}, "strip", z.ZodTypeAny, {
|
|
230
|
-
id: string;
|
|
231
287
|
variant: string;
|
|
232
|
-
}, {
|
|
233
288
|
id: string;
|
|
289
|
+
}, {
|
|
234
290
|
variant: string;
|
|
291
|
+
id: string;
|
|
235
292
|
}>>;
|
|
236
293
|
}, "strip", z.ZodTypeAny, {
|
|
237
294
|
segment?: {
|
|
238
295
|
code: string;
|
|
239
296
|
} | undefined;
|
|
240
297
|
experiment?: {
|
|
241
|
-
id: string;
|
|
242
298
|
variant: string;
|
|
299
|
+
id: string;
|
|
243
300
|
} | undefined;
|
|
244
301
|
}, {
|
|
245
302
|
segment?: {
|
|
246
303
|
code: string;
|
|
247
304
|
} | undefined;
|
|
248
305
|
experiment?: {
|
|
249
|
-
id: string;
|
|
250
306
|
variant: string;
|
|
307
|
+
id: string;
|
|
251
308
|
} | undefined;
|
|
252
309
|
}>;
|
|
253
310
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -256,8 +313,8 @@ export declare const Variant: z.ZodObject<{
|
|
|
256
313
|
code: string;
|
|
257
314
|
} | undefined;
|
|
258
315
|
experiment?: {
|
|
259
|
-
id: string;
|
|
260
316
|
variant: string;
|
|
317
|
+
id: string;
|
|
261
318
|
} | undefined;
|
|
262
319
|
};
|
|
263
320
|
}, {
|
|
@@ -266,8 +323,8 @@ export declare const Variant: z.ZodObject<{
|
|
|
266
323
|
code: string;
|
|
267
324
|
} | undefined;
|
|
268
325
|
experiment?: {
|
|
269
|
-
id: string;
|
|
270
326
|
variant: string;
|
|
327
|
+
id: string;
|
|
271
328
|
} | undefined;
|
|
272
329
|
};
|
|
273
330
|
}>;
|
package/lib/formatted-text.js
CHANGED
|
@@ -35,6 +35,13 @@ exports.LinkToMatrixAssetNode = zod_1.z.object({
|
|
|
35
35
|
matrixAssetId: zod_1.z.string().min(1),
|
|
36
36
|
target: zod_1.z.enum(['_blank', '_self', '_parent', '_top']),
|
|
37
37
|
formattingOptions: FormattingOptions.optional(),
|
|
38
|
+
attributes: zod_1.z
|
|
39
|
+
.record(zod_1.z.string())
|
|
40
|
+
.and(zod_1.z.object({
|
|
41
|
+
href: zod_1.z.never().optional(),
|
|
42
|
+
target: zod_1.z.never().optional(),
|
|
43
|
+
}))
|
|
44
|
+
.optional(),
|
|
38
45
|
});
|
|
39
46
|
exports.MatrixImageNode = zod_1.z.object({
|
|
40
47
|
type: zod_1.z.literal('matrix-image'),
|
|
@@ -42,13 +49,30 @@ exports.MatrixImageNode = zod_1.z.object({
|
|
|
42
49
|
matrixDomain: zod_1.z.string().min(1),
|
|
43
50
|
matrixAssetId: zod_1.z.string().min(1),
|
|
44
51
|
formattingOptions: FormattingOptions.optional(),
|
|
52
|
+
attributes: zod_1.z
|
|
53
|
+
.record(zod_1.z.string())
|
|
54
|
+
.and(zod_1.z.object({
|
|
55
|
+
src: zod_1.z.never().optional(),
|
|
56
|
+
}))
|
|
57
|
+
.optional(),
|
|
45
58
|
});
|
|
46
59
|
exports.DamImageNode = zod_1.z.object({
|
|
47
60
|
type: zod_1.z.literal('dam-image'),
|
|
48
61
|
damSystemType: zod_1.z.enum(['bynder']),
|
|
49
62
|
damSystemIdentifier: zod_1.z.string().min(1),
|
|
50
63
|
damObjectId: zod_1.z.string().min(1),
|
|
51
|
-
damAdditional:
|
|
64
|
+
damAdditional: zod_1.z
|
|
65
|
+
.object({
|
|
66
|
+
variant: zod_1.z.string().min(1).optional(),
|
|
67
|
+
})
|
|
68
|
+
.optional(),
|
|
69
|
+
formattingOptions: FormattingOptions.optional(),
|
|
70
|
+
attributes: zod_1.z
|
|
71
|
+
.record(zod_1.z.string())
|
|
72
|
+
.and(zod_1.z.object({
|
|
73
|
+
src: zod_1.z.never().optional(),
|
|
74
|
+
}))
|
|
75
|
+
.optional(),
|
|
52
76
|
});
|
|
53
77
|
exports.ComponentNode = zod_1.z.object({
|
|
54
78
|
type: zod_1.z.literal('component'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatted-text.js","sourceRoot":"","sources":["../src/formatted-text.ts"],"names":[],"mappings":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AAE;SACpB,CAAC;KACH,CAAC;SACD,OAAO,EAAE;CACb,CAAC,CAAC;AAEU,QAAA,aAAa,GAAG,OAAC,CAAC,MAAM,CAAC;IACpC,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,WAAW,CAAC;IAC5B,OAAO,EAAE,OAAC,CAAC,MAAM,CAAC,EAAE,CAAC;CACtB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const formatted_text_1 = require("./formatted-text");
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
describe('formatted-text', () => {
|
|
6
|
+
describe('LinkToMatrixAssetNode', () => {
|
|
7
|
+
const validNode = {
|
|
8
|
+
type: 'link-to-matrix-asset',
|
|
9
|
+
matrixIdentifier: 'matrix-identifier',
|
|
10
|
+
matrixDomain: 'https://my-matrix.squiz.net',
|
|
11
|
+
matrixAssetId: '12345',
|
|
12
|
+
target: '_blank',
|
|
13
|
+
formattingOptions: {
|
|
14
|
+
alignment: 'center',
|
|
15
|
+
},
|
|
16
|
+
attributes: {
|
|
17
|
+
title: 'Link title',
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
it.each([['valid node', validNode]])('Does not throw when parsing a %s', (description, node) => {
|
|
21
|
+
expect(() => formatted_text_1.LinkToMatrixAssetNode.parse(node)).not.toThrow();
|
|
22
|
+
});
|
|
23
|
+
it.each([
|
|
24
|
+
[
|
|
25
|
+
'node with a reserved attribute',
|
|
26
|
+
{
|
|
27
|
+
...validNode,
|
|
28
|
+
attributes: {
|
|
29
|
+
href: 'https://www.my-matrix.squiz.net',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
])('Throws when parsing a %s', (description, node) => {
|
|
34
|
+
expect(() => formatted_text_1.LinkToMatrixAssetNode.parse(node)).toThrow(zod_1.ZodError);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
describe('MatrixImageNode', () => {
|
|
38
|
+
const validNode = {
|
|
39
|
+
type: 'matrix-image',
|
|
40
|
+
matrixIdentifier: 'matrix-identifier',
|
|
41
|
+
matrixDomain: 'https://my-matrix.squiz.net',
|
|
42
|
+
matrixAssetId: '12345',
|
|
43
|
+
formattingOptions: {
|
|
44
|
+
alignment: 'center',
|
|
45
|
+
},
|
|
46
|
+
attributes: {
|
|
47
|
+
title: 'Link title',
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
it.each([['valid node', validNode]])('Does not throw when parsing a %s', (description, node) => {
|
|
51
|
+
expect(() => formatted_text_1.MatrixImageNode.parse(node)).not.toThrow();
|
|
52
|
+
});
|
|
53
|
+
it.each([
|
|
54
|
+
[
|
|
55
|
+
'node with a reserved attribute',
|
|
56
|
+
{
|
|
57
|
+
...validNode,
|
|
58
|
+
attributes: {
|
|
59
|
+
src: 'https://www.my-matrix.squiz.net/image.png',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
])('Throws when parsing a %s', (description, node) => {
|
|
64
|
+
expect(() => formatted_text_1.MatrixImageNode.parse(node)).toThrow(zod_1.ZodError);
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
describe('DamImageNode', () => {
|
|
68
|
+
const validNode = {
|
|
69
|
+
type: 'dam-image',
|
|
70
|
+
damSystemIdentifier: 'dam-identifier',
|
|
71
|
+
damObjectId: 'dam-object-id',
|
|
72
|
+
damSystemType: 'bynder',
|
|
73
|
+
formattingOptions: {
|
|
74
|
+
alignment: 'center',
|
|
75
|
+
},
|
|
76
|
+
attributes: {
|
|
77
|
+
title: 'Link title',
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
it.each([
|
|
81
|
+
['valid node', validNode],
|
|
82
|
+
[
|
|
83
|
+
'valid node with variant',
|
|
84
|
+
{
|
|
85
|
+
...validNode,
|
|
86
|
+
damAdditional: {
|
|
87
|
+
variant: 'dam-image-variant',
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
])('Does not throw when parsing a %s', (description, node) => {
|
|
92
|
+
expect(() => formatted_text_1.DamImageNode.parse(node)).not.toThrow();
|
|
93
|
+
});
|
|
94
|
+
it.each([
|
|
95
|
+
[
|
|
96
|
+
'node with a reserved attribute',
|
|
97
|
+
{
|
|
98
|
+
...validNode,
|
|
99
|
+
attributes: {
|
|
100
|
+
src: 'https://www.my-matrix.squiz.net/image.png',
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
])('Throws when parsing a %s', (description, node) => {
|
|
105
|
+
expect(() => formatted_text_1.DamImageNode.parse(node)).toThrow(zod_1.ZodError);
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
//# sourceMappingURL=formatted-text.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatted-text.spec.js","sourceRoot":"","sources":["../src/formatted-text.spec.ts"],"names":[],"mappings":";;AAAA,qDAAwF;AACxF,6BAAkC;AAElC,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;QACrC,MAAM,SAAS,GAA0C;YACvD,IAAI,EAAE,sBAAsB;YAC5B,gBAAgB,EAAE,mBAAmB;YACrC,YAAY,EAAE,6BAA6B;YAC3C,aAAa,EAAE,OAAO;YACtB,MAAM,EAAE,QAAQ;YAChB,iBAAiB,EAAE;gBACjB,SAAS,EAAE,QAAQ;aACpB;YACD,UAAU,EAAE;gBACV,KAAK,EAAE,YAAY;aACpB;SACF,CAAC;QAEF,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC,CAClC,kCAAkC,EAClC,CAAC,WAAmB,EAAE,IAA2C,EAAE,EAAE;YACnE,MAAM,CAAC,GAAG,EAAE,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,CAAC,CAAC,CAAC"}
|
package/lib/layout-content.d.ts
CHANGED
|
@@ -134,24 +134,42 @@ declare const BaseLayoutContentNodes: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
134
134
|
}, {
|
|
135
135
|
alignment: "left" | "center" | "right" | "justify";
|
|
136
136
|
}>>;
|
|
137
|
+
attributes: z.ZodOptional<z.ZodIntersection<z.ZodRecord<z.ZodString, z.ZodString>, z.ZodObject<{
|
|
138
|
+
href: z.ZodOptional<z.ZodNever>;
|
|
139
|
+
target: z.ZodOptional<z.ZodNever>;
|
|
140
|
+
}, "strip", z.ZodTypeAny, {
|
|
141
|
+
target?: undefined;
|
|
142
|
+
href?: undefined;
|
|
143
|
+
}, {
|
|
144
|
+
target?: undefined;
|
|
145
|
+
href?: undefined;
|
|
146
|
+
}>>>;
|
|
137
147
|
}, "strip", z.ZodTypeAny, {
|
|
138
148
|
type: "link-to-matrix-asset";
|
|
139
149
|
matrixDomain: string;
|
|
140
150
|
matrixAssetId: string;
|
|
141
151
|
target: "_blank" | "_self" | "_parent" | "_top";
|
|
142
|
-
|
|
152
|
+
attributes?: (Record<string, string> & {
|
|
153
|
+
target?: undefined;
|
|
154
|
+
href?: undefined;
|
|
155
|
+
}) | undefined;
|
|
143
156
|
formattingOptions?: {
|
|
144
157
|
alignment: "left" | "center" | "right" | "justify";
|
|
145
158
|
} | undefined;
|
|
159
|
+
matrixIdentifier?: string | undefined;
|
|
146
160
|
}, {
|
|
147
161
|
type: "link-to-matrix-asset";
|
|
148
162
|
matrixDomain: string;
|
|
149
163
|
matrixAssetId: string;
|
|
150
164
|
target: "_blank" | "_self" | "_parent" | "_top";
|
|
151
|
-
|
|
165
|
+
attributes?: (Record<string, string> & {
|
|
166
|
+
target?: undefined;
|
|
167
|
+
href?: undefined;
|
|
168
|
+
}) | undefined;
|
|
152
169
|
formattingOptions?: {
|
|
153
170
|
alignment: "left" | "center" | "right" | "justify";
|
|
154
171
|
} | undefined;
|
|
172
|
+
matrixIdentifier?: string | undefined;
|
|
155
173
|
}>, z.ZodObject<{
|
|
156
174
|
type: z.ZodLiteral<"matrix-image">;
|
|
157
175
|
matrixIdentifier: z.ZodOptional<z.ZodString>;
|
|
@@ -164,50 +182,89 @@ declare const BaseLayoutContentNodes: z.ZodDiscriminatedUnion<"type", [z.ZodObje
|
|
|
164
182
|
}, {
|
|
165
183
|
alignment: "left" | "center" | "right" | "justify";
|
|
166
184
|
}>>;
|
|
185
|
+
attributes: z.ZodOptional<z.ZodIntersection<z.ZodRecord<z.ZodString, z.ZodString>, z.ZodObject<{
|
|
186
|
+
src: z.ZodOptional<z.ZodNever>;
|
|
187
|
+
}, "strip", z.ZodTypeAny, {
|
|
188
|
+
src?: undefined;
|
|
189
|
+
}, {
|
|
190
|
+
src?: undefined;
|
|
191
|
+
}>>>;
|
|
167
192
|
}, "strip", z.ZodTypeAny, {
|
|
168
193
|
type: "matrix-image";
|
|
169
194
|
matrixDomain: string;
|
|
170
195
|
matrixAssetId: string;
|
|
171
|
-
|
|
196
|
+
attributes?: (Record<string, string> & {
|
|
197
|
+
src?: undefined;
|
|
198
|
+
}) | undefined;
|
|
172
199
|
formattingOptions?: {
|
|
173
200
|
alignment: "left" | "center" | "right" | "justify";
|
|
174
201
|
} | undefined;
|
|
202
|
+
matrixIdentifier?: string | undefined;
|
|
175
203
|
}, {
|
|
176
204
|
type: "matrix-image";
|
|
177
205
|
matrixDomain: string;
|
|
178
206
|
matrixAssetId: string;
|
|
179
|
-
|
|
207
|
+
attributes?: (Record<string, string> & {
|
|
208
|
+
src?: undefined;
|
|
209
|
+
}) | undefined;
|
|
180
210
|
formattingOptions?: {
|
|
181
211
|
alignment: "left" | "center" | "right" | "justify";
|
|
182
212
|
} | undefined;
|
|
213
|
+
matrixIdentifier?: string | undefined;
|
|
183
214
|
}>, z.ZodObject<{
|
|
184
215
|
type: z.ZodLiteral<"dam-image">;
|
|
185
216
|
damSystemType: z.ZodEnum<["bynder"]>;
|
|
186
217
|
damSystemIdentifier: z.ZodString;
|
|
187
218
|
damObjectId: z.ZodString;
|
|
188
219
|
damAdditional: z.ZodOptional<z.ZodObject<{
|
|
220
|
+
variant: z.ZodOptional<z.ZodString>;
|
|
221
|
+
}, "strip", z.ZodTypeAny, {
|
|
222
|
+
variant?: string | undefined;
|
|
223
|
+
}, {
|
|
224
|
+
variant?: string | undefined;
|
|
225
|
+
}>>;
|
|
226
|
+
formattingOptions: z.ZodOptional<z.ZodObject<{
|
|
189
227
|
alignment: z.ZodEnum<["left", "center", "right", "justify"]>;
|
|
190
228
|
}, "strip", z.ZodTypeAny, {
|
|
191
229
|
alignment: "left" | "center" | "right" | "justify";
|
|
192
230
|
}, {
|
|
193
231
|
alignment: "left" | "center" | "right" | "justify";
|
|
194
232
|
}>>;
|
|
233
|
+
attributes: z.ZodOptional<z.ZodIntersection<z.ZodRecord<z.ZodString, z.ZodString>, z.ZodObject<{
|
|
234
|
+
src: z.ZodOptional<z.ZodNever>;
|
|
235
|
+
}, "strip", z.ZodTypeAny, {
|
|
236
|
+
src?: undefined;
|
|
237
|
+
}, {
|
|
238
|
+
src?: undefined;
|
|
239
|
+
}>>>;
|
|
195
240
|
}, "strip", z.ZodTypeAny, {
|
|
196
241
|
type: "dam-image";
|
|
197
242
|
damSystemType: "bynder";
|
|
198
243
|
damSystemIdentifier: string;
|
|
199
244
|
damObjectId: string;
|
|
200
|
-
|
|
245
|
+
attributes?: (Record<string, string> & {
|
|
246
|
+
src?: undefined;
|
|
247
|
+
}) | undefined;
|
|
248
|
+
formattingOptions?: {
|
|
201
249
|
alignment: "left" | "center" | "right" | "justify";
|
|
202
250
|
} | undefined;
|
|
251
|
+
damAdditional?: {
|
|
252
|
+
variant?: string | undefined;
|
|
253
|
+
} | undefined;
|
|
203
254
|
}, {
|
|
204
255
|
type: "dam-image";
|
|
205
256
|
damSystemType: "bynder";
|
|
206
257
|
damSystemIdentifier: string;
|
|
207
258
|
damObjectId: string;
|
|
208
|
-
|
|
259
|
+
attributes?: (Record<string, string> & {
|
|
260
|
+
src?: undefined;
|
|
261
|
+
}) | undefined;
|
|
262
|
+
formattingOptions?: {
|
|
209
263
|
alignment: "left" | "center" | "right" | "justify";
|
|
210
264
|
} | undefined;
|
|
265
|
+
damAdditional?: {
|
|
266
|
+
variant?: string | undefined;
|
|
267
|
+
} | undefined;
|
|
211
268
|
}>]>;
|
|
212
269
|
type BaseLayoutContentNodes = z.infer<typeof BaseLayoutContentNodes>;
|
|
213
270
|
/**
|
|
@@ -257,26 +314,39 @@ export declare const LayoutContentNodes: z.ZodUnion<[z.ZodType<SimpleContentNode
|
|
|
257
314
|
matrixDomain: string;
|
|
258
315
|
matrixAssetId: string;
|
|
259
316
|
target: "_blank" | "_self" | "_parent" | "_top";
|
|
260
|
-
|
|
317
|
+
attributes?: (Record<string, string> & {
|
|
318
|
+
target?: undefined;
|
|
319
|
+
href?: undefined;
|
|
320
|
+
}) | undefined;
|
|
261
321
|
formattingOptions?: {
|
|
262
322
|
alignment: "left" | "center" | "right" | "justify";
|
|
263
323
|
} | undefined;
|
|
324
|
+
matrixIdentifier?: string | undefined;
|
|
264
325
|
} | {
|
|
265
326
|
type: "matrix-image";
|
|
266
327
|
matrixDomain: string;
|
|
267
328
|
matrixAssetId: string;
|
|
268
|
-
|
|
329
|
+
attributes?: (Record<string, string> & {
|
|
330
|
+
src?: undefined;
|
|
331
|
+
}) | undefined;
|
|
269
332
|
formattingOptions?: {
|
|
270
333
|
alignment: "left" | "center" | "right" | "justify";
|
|
271
334
|
} | undefined;
|
|
335
|
+
matrixIdentifier?: string | undefined;
|
|
272
336
|
} | {
|
|
273
337
|
type: "dam-image";
|
|
274
338
|
damSystemType: "bynder";
|
|
275
339
|
damSystemIdentifier: string;
|
|
276
340
|
damObjectId: string;
|
|
277
|
-
|
|
341
|
+
attributes?: (Record<string, string> & {
|
|
342
|
+
src?: undefined;
|
|
343
|
+
}) | undefined;
|
|
344
|
+
formattingOptions?: {
|
|
278
345
|
alignment: "left" | "center" | "right" | "justify";
|
|
279
346
|
} | undefined;
|
|
347
|
+
damAdditional?: {
|
|
348
|
+
variant?: string | undefined;
|
|
349
|
+
} | undefined;
|
|
280
350
|
} | {
|
|
281
351
|
type: "component";
|
|
282
352
|
componentId: string;
|
|
@@ -322,26 +392,39 @@ export declare const PageLayoutContent: z.ZodEffects<z.ZodArray<z.ZodUnion<[z.Zo
|
|
|
322
392
|
matrixDomain: string;
|
|
323
393
|
matrixAssetId: string;
|
|
324
394
|
target: "_blank" | "_self" | "_parent" | "_top";
|
|
325
|
-
|
|
395
|
+
attributes?: (Record<string, string> & {
|
|
396
|
+
target?: undefined;
|
|
397
|
+
href?: undefined;
|
|
398
|
+
}) | undefined;
|
|
326
399
|
formattingOptions?: {
|
|
327
400
|
alignment: "left" | "center" | "right" | "justify";
|
|
328
401
|
} | undefined;
|
|
402
|
+
matrixIdentifier?: string | undefined;
|
|
329
403
|
} | {
|
|
330
404
|
type: "matrix-image";
|
|
331
405
|
matrixDomain: string;
|
|
332
406
|
matrixAssetId: string;
|
|
333
|
-
|
|
407
|
+
attributes?: (Record<string, string> & {
|
|
408
|
+
src?: undefined;
|
|
409
|
+
}) | undefined;
|
|
334
410
|
formattingOptions?: {
|
|
335
411
|
alignment: "left" | "center" | "right" | "justify";
|
|
336
412
|
} | undefined;
|
|
413
|
+
matrixIdentifier?: string | undefined;
|
|
337
414
|
} | {
|
|
338
415
|
type: "dam-image";
|
|
339
416
|
damSystemType: "bynder";
|
|
340
417
|
damSystemIdentifier: string;
|
|
341
418
|
damObjectId: string;
|
|
342
|
-
|
|
419
|
+
attributes?: (Record<string, string> & {
|
|
420
|
+
src?: undefined;
|
|
421
|
+
}) | undefined;
|
|
422
|
+
formattingOptions?: {
|
|
343
423
|
alignment: "left" | "center" | "right" | "justify";
|
|
344
424
|
} | undefined;
|
|
425
|
+
damAdditional?: {
|
|
426
|
+
variant?: string | undefined;
|
|
427
|
+
} | undefined;
|
|
345
428
|
} | {
|
|
346
429
|
type: "component";
|
|
347
430
|
componentId: string;
|
|
@@ -381,26 +464,39 @@ export declare const PageLayoutContent: z.ZodEffects<z.ZodArray<z.ZodUnion<[z.Zo
|
|
|
381
464
|
matrixDomain: string;
|
|
382
465
|
matrixAssetId: string;
|
|
383
466
|
target: "_blank" | "_self" | "_parent" | "_top";
|
|
384
|
-
|
|
467
|
+
attributes?: (Record<string, string> & {
|
|
468
|
+
target?: undefined;
|
|
469
|
+
href?: undefined;
|
|
470
|
+
}) | undefined;
|
|
385
471
|
formattingOptions?: {
|
|
386
472
|
alignment: "left" | "center" | "right" | "justify";
|
|
387
473
|
} | undefined;
|
|
474
|
+
matrixIdentifier?: string | undefined;
|
|
388
475
|
} | {
|
|
389
476
|
type: "matrix-image";
|
|
390
477
|
matrixDomain: string;
|
|
391
478
|
matrixAssetId: string;
|
|
392
|
-
|
|
479
|
+
attributes?: (Record<string, string> & {
|
|
480
|
+
src?: undefined;
|
|
481
|
+
}) | undefined;
|
|
393
482
|
formattingOptions?: {
|
|
394
483
|
alignment: "left" | "center" | "right" | "justify";
|
|
395
484
|
} | undefined;
|
|
485
|
+
matrixIdentifier?: string | undefined;
|
|
396
486
|
} | {
|
|
397
487
|
type: "dam-image";
|
|
398
488
|
damSystemType: "bynder";
|
|
399
489
|
damSystemIdentifier: string;
|
|
400
490
|
damObjectId: string;
|
|
401
|
-
|
|
491
|
+
attributes?: (Record<string, string> & {
|
|
492
|
+
src?: undefined;
|
|
493
|
+
}) | undefined;
|
|
494
|
+
formattingOptions?: {
|
|
402
495
|
alignment: "left" | "center" | "right" | "justify";
|
|
403
496
|
} | undefined;
|
|
497
|
+
damAdditional?: {
|
|
498
|
+
variant?: string | undefined;
|
|
499
|
+
} | undefined;
|
|
404
500
|
} | {
|
|
405
501
|
type: "component";
|
|
406
502
|
componentId: string;
|
package/lib/layout-content.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PageLayoutContentResolver = exports.PageLayoutContent = exports.
|
|
3
|
+
exports.PageLayoutContentResolver = exports.PageLayoutContent = exports.LayoutContentNodes = exports.LayoutVariationNode = void 0;
|
|
4
|
+
exports.getNestedNodes = getNestedNodes;
|
|
4
5
|
const zod_1 = require("zod");
|
|
5
6
|
const formatted_text_1 = require("./formatted-text");
|
|
6
7
|
const resolvers_1 = require("./resolvers");
|
|
@@ -57,7 +58,6 @@ function getNestedNodes(nodes) {
|
|
|
57
58
|
const topLevelNodes = nodes.filter(isRecursiveNode).map(pickNestedNodes);
|
|
58
59
|
return topLevelNodes.flatMap(getNestedNodes).concat(topLevelNodes.flat());
|
|
59
60
|
}
|
|
60
|
-
exports.getNestedNodes = getNestedNodes;
|
|
61
61
|
exports.PageLayoutContent = zod_1.z.array(exports.LayoutContentNodes).refine((nodes) => {
|
|
62
62
|
// Enforce singular experiment ID within the Page Content
|
|
63
63
|
return nodes
|