@squiz/dx-page-contents-lib 1.40.1-alpha.18
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/README.md +5 -0
- package/lib/formatted-text.d.ts +177 -0
- package/lib/formatted-text.js +57 -0
- package/lib/formatted-text.js.map +1 -0
- package/lib/layout-content.d.ts +210 -0
- package/lib/layout-content.js +60 -0
- package/lib/layout-content.js.map +1 -0
- package/lib/layouts/index.d.ts +455 -0
- package/lib/layouts/index.js +12 -0
- package/lib/layouts/index.js.map +1 -0
- package/lib/layouts/single-column.layout.d.ts +158 -0
- package/lib/layouts/single-column.layout.js +15 -0
- package/lib/layouts/single-column.layout.js.map +1 -0
- package/lib/layouts/two-column.layout.d.ts +298 -0
- package/lib/layouts/two-column.layout.js +16 -0
- package/lib/layouts/two-column.layout.js.map +1 -0
- package/lib/page-contents-lib.d.ts +11 -0
- package/lib/page-contents-lib.js +54 -0
- package/lib/page-contents-lib.js.map +1 -0
- package/lib/page-contents-lib.spec.d.ts +1 -0
- package/lib/page-contents-lib.spec.js +198 -0
- package/lib/page-contents-lib.spec.js.map +1 -0
- package/package.json +30 -0
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { LayoutContentNodes } from '../layout-content';
|
|
3
|
+
export declare const TwoColumnLayout: z.ZodObject<{
|
|
4
|
+
name: z.ZodLiteral<"two-column">;
|
|
5
|
+
content: z.ZodObject<{
|
|
6
|
+
left: z.ZodArray<z.ZodType<LayoutContentNodes, z.ZodTypeDef, {
|
|
7
|
+
value: string;
|
|
8
|
+
type: "text";
|
|
9
|
+
} | {
|
|
10
|
+
type: "tag";
|
|
11
|
+
tag: string;
|
|
12
|
+
attributes?: Record<string, string> | undefined;
|
|
13
|
+
font?: {
|
|
14
|
+
bold?: boolean | undefined;
|
|
15
|
+
italics?: boolean | undefined;
|
|
16
|
+
underline?: boolean | undefined;
|
|
17
|
+
color?: string | undefined;
|
|
18
|
+
size?: string | undefined;
|
|
19
|
+
fontFamily?: string | undefined;
|
|
20
|
+
} | undefined;
|
|
21
|
+
formattingOptions?: {
|
|
22
|
+
alignment: "left" | "center" | "right" | "justify";
|
|
23
|
+
} | undefined;
|
|
24
|
+
} | {
|
|
25
|
+
type: "link-to-matrix-asset";
|
|
26
|
+
matrixDomain: string;
|
|
27
|
+
matrixAssetId: string;
|
|
28
|
+
target: "_blank" | "_self" | "_parent" | "_top";
|
|
29
|
+
matrixIdentifier?: string | undefined;
|
|
30
|
+
formattingOptions?: {
|
|
31
|
+
alignment: "left" | "center" | "right" | "justify";
|
|
32
|
+
} | undefined;
|
|
33
|
+
} | {
|
|
34
|
+
type: "matrix-image";
|
|
35
|
+
matrixDomain: string;
|
|
36
|
+
matrixAssetId: string;
|
|
37
|
+
matrixIdentifier?: string | undefined;
|
|
38
|
+
formattingOptions?: {
|
|
39
|
+
alignment: "left" | "center" | "right" | "justify";
|
|
40
|
+
} | undefined;
|
|
41
|
+
} | {
|
|
42
|
+
type: "component";
|
|
43
|
+
componentId: string;
|
|
44
|
+
componentSet: string;
|
|
45
|
+
contentItem?: {
|
|
46
|
+
id: string;
|
|
47
|
+
} | {
|
|
48
|
+
content: Record<string, unknown>;
|
|
49
|
+
schemaName: string;
|
|
50
|
+
} | undefined;
|
|
51
|
+
}>, "many">;
|
|
52
|
+
right: z.ZodArray<z.ZodType<LayoutContentNodes, z.ZodTypeDef, {
|
|
53
|
+
value: string;
|
|
54
|
+
type: "text";
|
|
55
|
+
} | {
|
|
56
|
+
type: "tag";
|
|
57
|
+
tag: string;
|
|
58
|
+
attributes?: Record<string, string> | undefined;
|
|
59
|
+
font?: {
|
|
60
|
+
bold?: boolean | undefined;
|
|
61
|
+
italics?: boolean | undefined;
|
|
62
|
+
underline?: boolean | undefined;
|
|
63
|
+
color?: string | undefined;
|
|
64
|
+
size?: string | undefined;
|
|
65
|
+
fontFamily?: string | undefined;
|
|
66
|
+
} | undefined;
|
|
67
|
+
formattingOptions?: {
|
|
68
|
+
alignment: "left" | "center" | "right" | "justify";
|
|
69
|
+
} | undefined;
|
|
70
|
+
} | {
|
|
71
|
+
type: "link-to-matrix-asset";
|
|
72
|
+
matrixDomain: string;
|
|
73
|
+
matrixAssetId: string;
|
|
74
|
+
target: "_blank" | "_self" | "_parent" | "_top";
|
|
75
|
+
matrixIdentifier?: string | undefined;
|
|
76
|
+
formattingOptions?: {
|
|
77
|
+
alignment: "left" | "center" | "right" | "justify";
|
|
78
|
+
} | undefined;
|
|
79
|
+
} | {
|
|
80
|
+
type: "matrix-image";
|
|
81
|
+
matrixDomain: string;
|
|
82
|
+
matrixAssetId: string;
|
|
83
|
+
matrixIdentifier?: string | undefined;
|
|
84
|
+
formattingOptions?: {
|
|
85
|
+
alignment: "left" | "center" | "right" | "justify";
|
|
86
|
+
} | undefined;
|
|
87
|
+
} | {
|
|
88
|
+
type: "component";
|
|
89
|
+
componentId: string;
|
|
90
|
+
componentSet: string;
|
|
91
|
+
contentItem?: {
|
|
92
|
+
id: string;
|
|
93
|
+
} | {
|
|
94
|
+
content: Record<string, unknown>;
|
|
95
|
+
schemaName: string;
|
|
96
|
+
} | undefined;
|
|
97
|
+
}>, "many">;
|
|
98
|
+
}, "strip", z.ZodTypeAny, {
|
|
99
|
+
left: LayoutContentNodes[];
|
|
100
|
+
right: LayoutContentNodes[];
|
|
101
|
+
}, {
|
|
102
|
+
left: ({
|
|
103
|
+
value: string;
|
|
104
|
+
type: "text";
|
|
105
|
+
} | {
|
|
106
|
+
type: "tag";
|
|
107
|
+
tag: string;
|
|
108
|
+
attributes?: Record<string, string> | undefined;
|
|
109
|
+
font?: {
|
|
110
|
+
bold?: boolean | undefined;
|
|
111
|
+
italics?: boolean | undefined;
|
|
112
|
+
underline?: boolean | undefined;
|
|
113
|
+
color?: string | undefined;
|
|
114
|
+
size?: string | undefined;
|
|
115
|
+
fontFamily?: string | undefined;
|
|
116
|
+
} | undefined;
|
|
117
|
+
formattingOptions?: {
|
|
118
|
+
alignment: "left" | "center" | "right" | "justify";
|
|
119
|
+
} | undefined;
|
|
120
|
+
} | {
|
|
121
|
+
type: "link-to-matrix-asset";
|
|
122
|
+
matrixDomain: string;
|
|
123
|
+
matrixAssetId: string;
|
|
124
|
+
target: "_blank" | "_self" | "_parent" | "_top";
|
|
125
|
+
matrixIdentifier?: string | undefined;
|
|
126
|
+
formattingOptions?: {
|
|
127
|
+
alignment: "left" | "center" | "right" | "justify";
|
|
128
|
+
} | undefined;
|
|
129
|
+
} | {
|
|
130
|
+
type: "matrix-image";
|
|
131
|
+
matrixDomain: string;
|
|
132
|
+
matrixAssetId: string;
|
|
133
|
+
matrixIdentifier?: string | undefined;
|
|
134
|
+
formattingOptions?: {
|
|
135
|
+
alignment: "left" | "center" | "right" | "justify";
|
|
136
|
+
} | undefined;
|
|
137
|
+
} | {
|
|
138
|
+
type: "component";
|
|
139
|
+
componentId: string;
|
|
140
|
+
componentSet: string;
|
|
141
|
+
contentItem?: {
|
|
142
|
+
id: string;
|
|
143
|
+
} | {
|
|
144
|
+
content: Record<string, unknown>;
|
|
145
|
+
schemaName: string;
|
|
146
|
+
} | undefined;
|
|
147
|
+
})[];
|
|
148
|
+
right: ({
|
|
149
|
+
value: string;
|
|
150
|
+
type: "text";
|
|
151
|
+
} | {
|
|
152
|
+
type: "tag";
|
|
153
|
+
tag: string;
|
|
154
|
+
attributes?: Record<string, string> | undefined;
|
|
155
|
+
font?: {
|
|
156
|
+
bold?: boolean | undefined;
|
|
157
|
+
italics?: boolean | undefined;
|
|
158
|
+
underline?: boolean | undefined;
|
|
159
|
+
color?: string | undefined;
|
|
160
|
+
size?: string | undefined;
|
|
161
|
+
fontFamily?: string | undefined;
|
|
162
|
+
} | undefined;
|
|
163
|
+
formattingOptions?: {
|
|
164
|
+
alignment: "left" | "center" | "right" | "justify";
|
|
165
|
+
} | undefined;
|
|
166
|
+
} | {
|
|
167
|
+
type: "link-to-matrix-asset";
|
|
168
|
+
matrixDomain: string;
|
|
169
|
+
matrixAssetId: string;
|
|
170
|
+
target: "_blank" | "_self" | "_parent" | "_top";
|
|
171
|
+
matrixIdentifier?: string | undefined;
|
|
172
|
+
formattingOptions?: {
|
|
173
|
+
alignment: "left" | "center" | "right" | "justify";
|
|
174
|
+
} | undefined;
|
|
175
|
+
} | {
|
|
176
|
+
type: "matrix-image";
|
|
177
|
+
matrixDomain: string;
|
|
178
|
+
matrixAssetId: string;
|
|
179
|
+
matrixIdentifier?: string | undefined;
|
|
180
|
+
formattingOptions?: {
|
|
181
|
+
alignment: "left" | "center" | "right" | "justify";
|
|
182
|
+
} | undefined;
|
|
183
|
+
} | {
|
|
184
|
+
type: "component";
|
|
185
|
+
componentId: string;
|
|
186
|
+
componentSet: string;
|
|
187
|
+
contentItem?: {
|
|
188
|
+
id: string;
|
|
189
|
+
} | {
|
|
190
|
+
content: Record<string, unknown>;
|
|
191
|
+
schemaName: string;
|
|
192
|
+
} | undefined;
|
|
193
|
+
})[];
|
|
194
|
+
}>;
|
|
195
|
+
}, "strip", z.ZodTypeAny, {
|
|
196
|
+
content: {
|
|
197
|
+
left: LayoutContentNodes[];
|
|
198
|
+
right: LayoutContentNodes[];
|
|
199
|
+
};
|
|
200
|
+
name: "two-column";
|
|
201
|
+
}, {
|
|
202
|
+
content: {
|
|
203
|
+
left: ({
|
|
204
|
+
value: string;
|
|
205
|
+
type: "text";
|
|
206
|
+
} | {
|
|
207
|
+
type: "tag";
|
|
208
|
+
tag: string;
|
|
209
|
+
attributes?: Record<string, string> | undefined;
|
|
210
|
+
font?: {
|
|
211
|
+
bold?: boolean | undefined;
|
|
212
|
+
italics?: boolean | undefined;
|
|
213
|
+
underline?: boolean | undefined;
|
|
214
|
+
color?: string | undefined;
|
|
215
|
+
size?: string | undefined;
|
|
216
|
+
fontFamily?: string | undefined;
|
|
217
|
+
} | undefined;
|
|
218
|
+
formattingOptions?: {
|
|
219
|
+
alignment: "left" | "center" | "right" | "justify";
|
|
220
|
+
} | undefined;
|
|
221
|
+
} | {
|
|
222
|
+
type: "link-to-matrix-asset";
|
|
223
|
+
matrixDomain: string;
|
|
224
|
+
matrixAssetId: string;
|
|
225
|
+
target: "_blank" | "_self" | "_parent" | "_top";
|
|
226
|
+
matrixIdentifier?: string | undefined;
|
|
227
|
+
formattingOptions?: {
|
|
228
|
+
alignment: "left" | "center" | "right" | "justify";
|
|
229
|
+
} | undefined;
|
|
230
|
+
} | {
|
|
231
|
+
type: "matrix-image";
|
|
232
|
+
matrixDomain: string;
|
|
233
|
+
matrixAssetId: string;
|
|
234
|
+
matrixIdentifier?: string | undefined;
|
|
235
|
+
formattingOptions?: {
|
|
236
|
+
alignment: "left" | "center" | "right" | "justify";
|
|
237
|
+
} | undefined;
|
|
238
|
+
} | {
|
|
239
|
+
type: "component";
|
|
240
|
+
componentId: string;
|
|
241
|
+
componentSet: string;
|
|
242
|
+
contentItem?: {
|
|
243
|
+
id: string;
|
|
244
|
+
} | {
|
|
245
|
+
content: Record<string, unknown>;
|
|
246
|
+
schemaName: string;
|
|
247
|
+
} | undefined;
|
|
248
|
+
})[];
|
|
249
|
+
right: ({
|
|
250
|
+
value: string;
|
|
251
|
+
type: "text";
|
|
252
|
+
} | {
|
|
253
|
+
type: "tag";
|
|
254
|
+
tag: string;
|
|
255
|
+
attributes?: Record<string, string> | undefined;
|
|
256
|
+
font?: {
|
|
257
|
+
bold?: boolean | undefined;
|
|
258
|
+
italics?: boolean | undefined;
|
|
259
|
+
underline?: boolean | undefined;
|
|
260
|
+
color?: string | undefined;
|
|
261
|
+
size?: string | undefined;
|
|
262
|
+
fontFamily?: string | undefined;
|
|
263
|
+
} | undefined;
|
|
264
|
+
formattingOptions?: {
|
|
265
|
+
alignment: "left" | "center" | "right" | "justify";
|
|
266
|
+
} | undefined;
|
|
267
|
+
} | {
|
|
268
|
+
type: "link-to-matrix-asset";
|
|
269
|
+
matrixDomain: string;
|
|
270
|
+
matrixAssetId: string;
|
|
271
|
+
target: "_blank" | "_self" | "_parent" | "_top";
|
|
272
|
+
matrixIdentifier?: string | undefined;
|
|
273
|
+
formattingOptions?: {
|
|
274
|
+
alignment: "left" | "center" | "right" | "justify";
|
|
275
|
+
} | undefined;
|
|
276
|
+
} | {
|
|
277
|
+
type: "matrix-image";
|
|
278
|
+
matrixDomain: string;
|
|
279
|
+
matrixAssetId: string;
|
|
280
|
+
matrixIdentifier?: string | undefined;
|
|
281
|
+
formattingOptions?: {
|
|
282
|
+
alignment: "left" | "center" | "right" | "justify";
|
|
283
|
+
} | undefined;
|
|
284
|
+
} | {
|
|
285
|
+
type: "component";
|
|
286
|
+
componentId: string;
|
|
287
|
+
componentSet: string;
|
|
288
|
+
contentItem?: {
|
|
289
|
+
id: string;
|
|
290
|
+
} | {
|
|
291
|
+
content: Record<string, unknown>;
|
|
292
|
+
schemaName: string;
|
|
293
|
+
} | undefined;
|
|
294
|
+
})[];
|
|
295
|
+
};
|
|
296
|
+
name: "two-column";
|
|
297
|
+
}>;
|
|
298
|
+
export declare const TEMPLATE = "\n<div class=\"container\"><div class=\"left\">{{left}}</div><div class=\"right\">{{right}}</div></div>\n";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TEMPLATE = exports.TwoColumnLayout = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const layout_content_1 = require("../layout-content");
|
|
6
|
+
exports.TwoColumnLayout = zod_1.z.object({
|
|
7
|
+
name: zod_1.z.literal('two-column'),
|
|
8
|
+
content: zod_1.z.object({
|
|
9
|
+
left: zod_1.z.array(layout_content_1.LayoutContentNodes),
|
|
10
|
+
right: zod_1.z.array(layout_content_1.LayoutContentNodes),
|
|
11
|
+
}),
|
|
12
|
+
});
|
|
13
|
+
exports.TEMPLATE = `
|
|
14
|
+
<div class="container"><div class="left">{{left}}</div><div class="right">{{right}}</div></div>
|
|
15
|
+
`;
|
|
16
|
+
//# sourceMappingURL=two-column.layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"two-column.layout.js","sourceRoot":"","sources":["../../src/layouts/two-column.layout.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,sDAAuD;AAE1C,QAAA,eAAe,GAAG,OAAC,CAAC,MAAM,CAAC;IACtC,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,YAAY,CAAC;IAC7B,OAAO,EAAE,OAAC,CAAC,MAAM,CAAC;QAChB,IAAI,EAAE,OAAC,CAAC,KAAK,CAAC,mCAAkB,CAAC;QACjC,KAAK,EAAE,OAAC,CAAC,KAAK,CAAC,mCAAkB,CAAC;KACnC,CAAC;CACH,CAAC,CAAC;AAEU,QAAA,QAAQ,GAAG;;CAEvB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PageLayoutContentResolver } from './layout-content';
|
|
2
|
+
import { PageLayout } from './layouts';
|
|
3
|
+
/**
|
|
4
|
+
* Validate that the provided layout is a valid page layout
|
|
5
|
+
*/
|
|
6
|
+
export declare function assertIsPageLayout(layout: unknown): asserts layout is PageLayout;
|
|
7
|
+
export declare function resolveLayout(layout: PageLayout, resolver: PageLayoutContentResolver): Promise<PageLayout>;
|
|
8
|
+
export declare function renderLayout(layout: PageLayout): Promise<string>;
|
|
9
|
+
export { PageLayoutContentResolver };
|
|
10
|
+
export { PageLayoutContent, LayoutContentNodes } from './layout-content';
|
|
11
|
+
export { PageLayout } from './layouts';
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PageLayout = exports.LayoutContentNodes = exports.PageLayoutContentResolver = exports.renderLayout = exports.resolveLayout = exports.assertIsPageLayout = void 0;
|
|
4
|
+
const dx_common_lib_1 = require("@squiz/dx-common-lib");
|
|
5
|
+
const layout_content_1 = require("./layout-content");
|
|
6
|
+
Object.defineProperty(exports, "PageLayoutContentResolver", { enumerable: true, get: function () { return layout_content_1.PageLayoutContentResolver; } });
|
|
7
|
+
const layouts_1 = require("./layouts");
|
|
8
|
+
/**
|
|
9
|
+
* Validate that the provided layout is a valid page layout
|
|
10
|
+
*/
|
|
11
|
+
function assertIsPageLayout(layout) {
|
|
12
|
+
layouts_1.PageLayout.parse(layout);
|
|
13
|
+
}
|
|
14
|
+
exports.assertIsPageLayout = assertIsPageLayout;
|
|
15
|
+
// TODO: Make the layout resolution more generic
|
|
16
|
+
async function resolveLayout(layout, resolver) {
|
|
17
|
+
switch (layout.name) {
|
|
18
|
+
case 'single-column':
|
|
19
|
+
return {
|
|
20
|
+
...layout,
|
|
21
|
+
content: {
|
|
22
|
+
main: await resolver.resolve(layout.content.main),
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
case 'two-column':
|
|
26
|
+
return {
|
|
27
|
+
...layout,
|
|
28
|
+
content: {
|
|
29
|
+
left: await resolver.resolve(layout.content.left),
|
|
30
|
+
right: await resolver.resolve(layout.content.right),
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
default:
|
|
34
|
+
return layout;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.resolveLayout = resolveLayout;
|
|
38
|
+
async function renderLayout(layout) {
|
|
39
|
+
let { [layout.name]: template } = layouts_1.LAYOUT_TEMPLATES;
|
|
40
|
+
if (!template) {
|
|
41
|
+
return '';
|
|
42
|
+
}
|
|
43
|
+
for (const [key, value] of Object.entries(layout.content)) {
|
|
44
|
+
const text = await Promise.all(value.map(dx_common_lib_1.formattedTextToHtmlString));
|
|
45
|
+
template = template.replace(`{{${key}}}`, text.join(''));
|
|
46
|
+
}
|
|
47
|
+
return template.trim();
|
|
48
|
+
}
|
|
49
|
+
exports.renderLayout = renderLayout;
|
|
50
|
+
var layout_content_2 = require("./layout-content");
|
|
51
|
+
Object.defineProperty(exports, "LayoutContentNodes", { enumerable: true, get: function () { return layout_content_2.LayoutContentNodes; } });
|
|
52
|
+
var layouts_2 = require("./layouts");
|
|
53
|
+
Object.defineProperty(exports, "PageLayout", { enumerable: true, get: function () { return layouts_2.PageLayout; } });
|
|
54
|
+
//# sourceMappingURL=page-contents-lib.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-contents-lib.js","sourceRoot":"","sources":["../src/page-contents-lib.ts"],"names":[],"mappings":";;;AAAA,wDAAiE;AAEjE,qDAA6D;AA+CpD,0GA/CA,0CAAyB,OA+CA;AA9ClC,uCAAyD;AAEzD;;GAEG;AACH,SAAgB,kBAAkB,CAAC,MAAe;IAChD,oBAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAC3B,CAAC;AAFD,gDAEC;AAED,gDAAgD;AACzC,KAAK,UAAU,aAAa,CAAC,MAAkB,EAAE,QAAmC;IACzF,QAAQ,MAAM,CAAC,IAAI,EAAE;QACnB,KAAK,eAAe;YAClB,OAAO;gBACL,GAAG,MAAM;gBACT,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;iBAClD;aACF,CAAC;QACJ,KAAK,YAAY;YACf,OAAO;gBACL,GAAG,MAAM;gBACT,OAAO,EAAE;oBACP,IAAI,EAAE,MAAM,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;oBACjD,KAAK,EAAE,MAAM,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;iBACpD;aACF,CAAC;QACJ;YACE,OAAO,MAAM,CAAC;KACjB;AACH,CAAC;AApBD,sCAoBC;AAEM,KAAK,UAAU,YAAY,CAAC,MAAkB;IACnD,IAAI,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,GAAG,0BAAgB,CAAC;IAEnD,IAAI,CAAC,QAAQ,EAAE;QACb,OAAO,EAAE,CAAC;KACX;IAED,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE;QACzD,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,GAAG,CAAE,KAAe,CAAC,GAAG,CAAC,yCAAyB,CAAC,CAAC,CAAC;QAChF,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,GAAG,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;KAC1D;IACD,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;AACzB,CAAC;AAZD,oCAYC;AAGD,mDAAyE;AAA7C,oHAAA,kBAAkB,OAAA;AAC9C,qCAAuC;AAA9B,qGAAA,UAAU,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const page_contents_lib_1 = require("./page-contents-lib");
|
|
4
|
+
const mockContentItem = {
|
|
5
|
+
schemaName: 'test',
|
|
6
|
+
content: {
|
|
7
|
+
title: 'test',
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
const mockComponentResolver = async (node) => {
|
|
11
|
+
return {
|
|
12
|
+
...node,
|
|
13
|
+
contentItem: mockContentItem,
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
const VALID_CONTENT_NODES = {
|
|
17
|
+
component: {
|
|
18
|
+
type: 'component',
|
|
19
|
+
componentSet: 'my-component-set',
|
|
20
|
+
componentId: 'my-component-1',
|
|
21
|
+
contentItem: {
|
|
22
|
+
id: '123',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
text: {
|
|
26
|
+
type: 'text',
|
|
27
|
+
value: 'test',
|
|
28
|
+
},
|
|
29
|
+
tag: {
|
|
30
|
+
type: 'tag',
|
|
31
|
+
tag: 'div',
|
|
32
|
+
children: [],
|
|
33
|
+
},
|
|
34
|
+
'link-to-matrix-asset': {
|
|
35
|
+
type: 'link-to-matrix-asset',
|
|
36
|
+
matrixIdentifier: 'my-matrix-identifier',
|
|
37
|
+
matrixAssetId: '123',
|
|
38
|
+
matrixDomain: 'my-matrix-domain',
|
|
39
|
+
children: [],
|
|
40
|
+
target: '_blank',
|
|
41
|
+
},
|
|
42
|
+
'matrix-image': {
|
|
43
|
+
type: 'matrix-image',
|
|
44
|
+
matrixIdentifier: 'my-matrix-identifier',
|
|
45
|
+
matrixAssetId: '123',
|
|
46
|
+
matrixDomain: 'my-matrix-domain',
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
describe('page-contents-lib', () => {
|
|
50
|
+
describe('assertIsPageLayout', () => {
|
|
51
|
+
it('should validate a single-column layout', () => {
|
|
52
|
+
const layout = {
|
|
53
|
+
name: 'single-column',
|
|
54
|
+
content: {
|
|
55
|
+
main: [VALID_CONTENT_NODES.component],
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
expect(() => (0, page_contents_lib_1.assertIsPageLayout)(layout)).not.toThrow();
|
|
59
|
+
});
|
|
60
|
+
it('should validate a two-column layout', () => {
|
|
61
|
+
const layout = {
|
|
62
|
+
name: 'two-column',
|
|
63
|
+
content: {
|
|
64
|
+
left: [VALID_CONTENT_NODES.component],
|
|
65
|
+
right: [VALID_CONTENT_NODES.component],
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
expect(() => (0, page_contents_lib_1.assertIsPageLayout)(layout)).not.toThrow();
|
|
69
|
+
});
|
|
70
|
+
it.each(['text', 'component', 'matrix-image'])('should not allow children on %s node', (nodeType) => {
|
|
71
|
+
const layout = {
|
|
72
|
+
name: 'single-column',
|
|
73
|
+
content: {
|
|
74
|
+
main: [
|
|
75
|
+
{
|
|
76
|
+
...VALID_CONTENT_NODES[nodeType],
|
|
77
|
+
children: [],
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
expect(() => (0, page_contents_lib_1.assertIsPageLayout)(layout)).toThrow();
|
|
83
|
+
});
|
|
84
|
+
it('should validate a deeply nested layout', () => {
|
|
85
|
+
const layout = {
|
|
86
|
+
name: 'single-column',
|
|
87
|
+
content: {
|
|
88
|
+
main: [
|
|
89
|
+
{
|
|
90
|
+
type: 'tag',
|
|
91
|
+
tag: 'div',
|
|
92
|
+
children: [VALID_CONTENT_NODES.component],
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
expect(() => (0, page_contents_lib_1.assertIsPageLayout)(layout)).not.toThrow();
|
|
98
|
+
});
|
|
99
|
+
it('should not allow invalid layout names', () => {
|
|
100
|
+
const layout = {
|
|
101
|
+
name: 'invalid',
|
|
102
|
+
content: {
|
|
103
|
+
main: [VALID_CONTENT_NODES.component],
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
expect(() => (0, page_contents_lib_1.assertIsPageLayout)(layout)).toThrow();
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
describe('PageLayoutContentResolver', () => {
|
|
110
|
+
it('should resolve component nodes', async () => {
|
|
111
|
+
const layoutContent = [VALID_CONTENT_NODES.component];
|
|
112
|
+
const resolver = new page_contents_lib_1.PageLayoutContentResolver({ component: mockComponentResolver });
|
|
113
|
+
const resolvedContent = await resolver.resolve(layoutContent);
|
|
114
|
+
expect(resolvedContent).toEqual([expect.objectContaining({ contentItem: mockContentItem })]);
|
|
115
|
+
});
|
|
116
|
+
it('should resolve nested component nodes', async () => {
|
|
117
|
+
const layoutContent = [
|
|
118
|
+
{
|
|
119
|
+
type: 'tag',
|
|
120
|
+
tag: 'div',
|
|
121
|
+
children: [VALID_CONTENT_NODES.component],
|
|
122
|
+
},
|
|
123
|
+
];
|
|
124
|
+
const resolver = new page_contents_lib_1.PageLayoutContentResolver({ component: mockComponentResolver });
|
|
125
|
+
const resolvedContent = await resolver.resolve(layoutContent);
|
|
126
|
+
expect(resolvedContent).toEqual([
|
|
127
|
+
{ type: 'tag', tag: 'div', children: [expect.objectContaining({ contentItem: mockContentItem })] },
|
|
128
|
+
]);
|
|
129
|
+
});
|
|
130
|
+
it('should resolve nested component nodes in multiple levels', async () => {
|
|
131
|
+
const layoutContent = [
|
|
132
|
+
{
|
|
133
|
+
type: 'tag',
|
|
134
|
+
tag: 'div',
|
|
135
|
+
children: [
|
|
136
|
+
VALID_CONTENT_NODES.component,
|
|
137
|
+
{
|
|
138
|
+
type: 'tag',
|
|
139
|
+
tag: 'div',
|
|
140
|
+
children: [VALID_CONTENT_NODES.component],
|
|
141
|
+
},
|
|
142
|
+
],
|
|
143
|
+
},
|
|
144
|
+
];
|
|
145
|
+
const resolver = new page_contents_lib_1.PageLayoutContentResolver({ component: mockComponentResolver });
|
|
146
|
+
const resolvedContent = await resolver.resolve(layoutContent);
|
|
147
|
+
expect(resolvedContent).toEqual([
|
|
148
|
+
{
|
|
149
|
+
type: 'tag',
|
|
150
|
+
tag: 'div',
|
|
151
|
+
children: [
|
|
152
|
+
expect.objectContaining({ contentItem: mockContentItem }),
|
|
153
|
+
{
|
|
154
|
+
type: 'tag',
|
|
155
|
+
tag: 'div',
|
|
156
|
+
children: [expect.objectContaining({ contentItem: mockContentItem })],
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
},
|
|
160
|
+
]);
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
describe('resolveLayout', () => {
|
|
164
|
+
it('should resolve a single-column layout', async () => {
|
|
165
|
+
const layout = {
|
|
166
|
+
name: 'single-column',
|
|
167
|
+
content: {
|
|
168
|
+
main: [VALID_CONTENT_NODES.component],
|
|
169
|
+
},
|
|
170
|
+
};
|
|
171
|
+
const resolvedLayout = await (0, page_contents_lib_1.resolveLayout)(layout, new page_contents_lib_1.PageLayoutContentResolver({ component: mockComponentResolver }));
|
|
172
|
+
expect(resolvedLayout).toEqual({
|
|
173
|
+
name: 'single-column',
|
|
174
|
+
content: {
|
|
175
|
+
main: [expect.objectContaining({ contentItem: mockContentItem })],
|
|
176
|
+
},
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
it('should resolve a two-column layout', async () => {
|
|
180
|
+
const layout = {
|
|
181
|
+
name: 'two-column',
|
|
182
|
+
content: {
|
|
183
|
+
left: [VALID_CONTENT_NODES.component],
|
|
184
|
+
right: [VALID_CONTENT_NODES.component],
|
|
185
|
+
},
|
|
186
|
+
};
|
|
187
|
+
const resolvedLayout = await (0, page_contents_lib_1.resolveLayout)(layout, new page_contents_lib_1.PageLayoutContentResolver({ component: mockComponentResolver }));
|
|
188
|
+
expect(resolvedLayout).toEqual({
|
|
189
|
+
name: 'two-column',
|
|
190
|
+
content: {
|
|
191
|
+
left: [expect.objectContaining({ contentItem: mockContentItem })],
|
|
192
|
+
right: [expect.objectContaining({ contentItem: mockContentItem })],
|
|
193
|
+
},
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
//# sourceMappingURL=page-contents-lib.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-contents-lib.spec.js","sourceRoot":"","sources":["../src/page-contents-lib.spec.ts"],"names":[],"mappings":";;AAAA,2DAM6B;AAE7B,MAAM,eAAe,GAAG;IACtB,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE;QACP,KAAK,EAAE,MAAM;KACd;CACF,CAAC;AACF,MAAM,qBAAqB,GAAG,KAAK,EAAE,IAA0D,EAAE,EAAE;IACjG,OAAO;QACL,GAAG,IAAI;QACP,WAAW,EAAE,eAAe;KAC7B,CAAC;AACJ,CAAC,CAAC;AAIF,MAAM,mBAAmB,GAAoE;IAC3F,SAAS,EAAE;QACT,IAAI,EAAE,WAAW;QACjB,YAAY,EAAE,kBAAkB;QAChC,WAAW,EAAE,gBAAgB;QAC7B,WAAW,EAAE;YACX,EAAE,EAAE,KAAK;SACV;KACF;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,KA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aACF,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,oCAAoC,EAAE,KAAK,IAAI,EAAE;YAClD,MAAM,MAAM,GAAe;gBACzB,IAAI,EAAE,YAAY;gBAClB,OAAO,EAAE;oBACP,IAAI,EAAE,CAAC,mBAAmB,CAAC,SAAS,CAAC;oBACrC,KAAK,EAAE,CAAC,mBAAmB,CAAC,SAAS,CAAC;iBACvC;aACF,CAAC;YAEF,MAAM,cAAc,GAAG,MAAM,IAAA,iCAAa,EACxC,MAAM,EACN,IAAI,6CAAyB,CAAC,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC,CACpE,CAAC;YAEF,MAAM,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC;gBAC7B,IAAI,EAAE,YAAY;gBAClB,OAAO,EAAE;oBACP,IAAI,EAAE,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC,CAAC;oBACjE,KAAK,EAAE,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC,CAAC;iBACnE;aACF,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@squiz/dx-page-contents-lib",
|
|
3
|
+
"version": "1.40.1-alpha.18",
|
|
4
|
+
"description": "",
|
|
5
|
+
"author": "FEAAS Team",
|
|
6
|
+
"homepage": "",
|
|
7
|
+
"license": "ISC",
|
|
8
|
+
"main": "lib/page-contents-lib.js",
|
|
9
|
+
"files": [
|
|
10
|
+
"lib"
|
|
11
|
+
],
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git@gitlab.squiz.net:developer-experience/cmp"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"compile": "tsc",
|
|
18
|
+
"test": "jest"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@squiz/dx-common-lib": "1.40.1-alpha.18",
|
|
22
|
+
"zod": "^3.21.4"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/jest": "^29.5.3",
|
|
26
|
+
"jest": "^29.6.1",
|
|
27
|
+
"ts-jest": "^29.1.1"
|
|
28
|
+
},
|
|
29
|
+
"gitHead": "7091fc524b035040f4775215d063b0493e09792c"
|
|
30
|
+
}
|