@squiz/dx-page-contents-lib 1.85.0 → 2.0.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/formatted-text.d.ts +94 -729
- package/lib/formatted-text.js +8 -8
- package/lib/formatted-text.js.map +1 -1
- package/lib/layout-content.d.ts +94 -775
- package/lib/layout-content.js +6 -6
- package/lib/layout-content.js.map +1 -1
- package/lib/layouts/custom-layout.d.ts +14 -119
- package/lib/layouts/index.d.ts +19 -137
- package/lib/layouts/raw.layout.d.ts +4 -17
- package/lib/layouts/single-column.layout.d.ts +4 -17
- package/lib/layouts/two-column.layout.d.ts +5 -22
- package/lib/mocks/PageContentsHelpers.d.ts +21 -217
- package/lib/mocks/PageContentsHelpers.js +1 -1
- package/lib/mocks/PageContentsHelpers.js.map +1 -1
- package/lib/page-contents-lib.d.ts +1 -3
- package/lib/page-contents-lib.spec.js +1 -2
- package/lib/page-contents-lib.spec.js.map +1 -1
- package/lib/resolvers/default-layout-resolver.js.map +1 -1
- package/package.json +2 -2
package/lib/layout-content.js
CHANGED
|
@@ -8,14 +8,17 @@ const resolvers_1 = require("./resolvers");
|
|
|
8
8
|
exports.DeveloperDefinedLayoutNode = formatted_text_1.LayoutNode.and(zod_1.z.object({
|
|
9
9
|
content: zod_1.z.lazy(() => zod_1.z.record(zod_1.z.string(), exports.PageLayoutContent)),
|
|
10
10
|
}));
|
|
11
|
-
const
|
|
11
|
+
const baseLayoutContentNodeSchemas = [
|
|
12
12
|
formatted_text_1.TextNode,
|
|
13
13
|
formatted_text_1.TagNode,
|
|
14
14
|
formatted_text_1.LinkToMatrixAssetNode,
|
|
15
15
|
formatted_text_1.LinkToDamAssetNode,
|
|
16
16
|
formatted_text_1.MatrixImageNode,
|
|
17
17
|
formatted_text_1.DamImageNode,
|
|
18
|
-
]
|
|
18
|
+
];
|
|
19
|
+
const BaseLayoutContentNodes = zod_1.z.discriminatedUnion('type', [...baseLayoutContentNodeSchemas]);
|
|
20
|
+
/** Discriminator values for {@link BaseLayoutContentNodes} */
|
|
21
|
+
const BASE_LAYOUT_CONTENT_NODE_TYPES = new Set(baseLayoutContentNodeSchemas.map((schema) => schema.shape.type.value));
|
|
19
22
|
/**
|
|
20
23
|
* All the nodes which allow children
|
|
21
24
|
*/
|
|
@@ -58,10 +61,7 @@ const SimpleContentNodes = zod_1.z
|
|
|
58
61
|
exports.LayoutContentNodes = zod_1.z.preprocess((val) => {
|
|
59
62
|
// Backwards compatibility for when we didn't wrap FormattedText nodes in a fragment node
|
|
60
63
|
// This ensures that existing pages don't break if they haven't been saved from Page Builder
|
|
61
|
-
if (typeof val === 'object' &&
|
|
62
|
-
val &&
|
|
63
|
-
'type' in val &&
|
|
64
|
-
BaseLayoutContentNodes._def.optionsMap.has(val.type)) {
|
|
64
|
+
if (typeof val === 'object' && val && 'type' in val && BASE_LAYOUT_CONTENT_NODE_TYPES.has(val.type)) {
|
|
65
65
|
return { type: 'fragment', children: [val] };
|
|
66
66
|
}
|
|
67
67
|
return val;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-content.js","sourceRoot":"","sources":["../src/layout-content.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"layout-content.js","sourceRoot":"","sources":["../src/layout-content.ts"],"names":[],"mappings":";;;AA0JA,wCAGC;AA7JD,6BAAwB;AACxB,qDAa0B;AAC1B,2CAA8E;AAOjE,QAAA,0BAA0B,GAAG,2BAAU,CAAC,GAAG,CACtD,OAAC,CAAC,MAAM,CAAC;IACP,OAAO,EAAE,OAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,yBAAiB,CAAC,CAAC;CAC/D,CAAC,CACH,CAAC;AAEF,MAAM,4BAA4B,GAAG;IACnC,yBAAQ;IACR,wBAAO;IACP,sCAAqB;IACrB,mCAAkB;IAClB,gCAAe;IACf,6BAAY;CACJ,CA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ACzD,CAAC;CACF;AAlDD,8DAkDC"}
|
|
@@ -1,139 +1,34 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { PageLayoutContent } from '../layout-content';
|
|
2
3
|
export declare const CustomLayoutConfig: z.ZodObject<{
|
|
3
4
|
rootWrapper: z.ZodObject<{
|
|
4
5
|
tag: z.ZodString;
|
|
5
|
-
classes: z.ZodOptional<z.ZodArray<z.ZodString
|
|
6
|
-
},
|
|
7
|
-
tag: string;
|
|
8
|
-
classes?: string[] | undefined;
|
|
9
|
-
}, {
|
|
10
|
-
tag: string;
|
|
11
|
-
classes?: string[] | undefined;
|
|
12
|
-
}>;
|
|
6
|
+
classes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
7
|
+
}, z.core.$strip>;
|
|
13
8
|
nodeWrapper: z.ZodOptional<z.ZodObject<{
|
|
14
9
|
tag: z.ZodString;
|
|
15
|
-
classes: z.ZodOptional<z.ZodArray<z.ZodString
|
|
16
|
-
},
|
|
17
|
-
tag: string;
|
|
18
|
-
classes?: string[] | undefined;
|
|
19
|
-
}, {
|
|
20
|
-
tag: string;
|
|
21
|
-
classes?: string[] | undefined;
|
|
22
|
-
}>>;
|
|
10
|
+
classes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
11
|
+
}, z.core.$strip>>;
|
|
23
12
|
minNodes: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
24
13
|
maxNodes: z.ZodOptional<z.ZodNumber>;
|
|
25
|
-
},
|
|
26
|
-
rootWrapper: {
|
|
27
|
-
tag: string;
|
|
28
|
-
classes?: string[] | undefined;
|
|
29
|
-
};
|
|
30
|
-
nodeWrapper?: {
|
|
31
|
-
tag: string;
|
|
32
|
-
classes?: string[] | undefined;
|
|
33
|
-
} | undefined;
|
|
34
|
-
minNodes?: number | undefined;
|
|
35
|
-
maxNodes?: number | undefined;
|
|
36
|
-
}, {
|
|
37
|
-
rootWrapper: {
|
|
38
|
-
tag: string;
|
|
39
|
-
classes?: string[] | undefined;
|
|
40
|
-
};
|
|
41
|
-
nodeWrapper?: {
|
|
42
|
-
tag: string;
|
|
43
|
-
classes?: string[] | undefined;
|
|
44
|
-
} | undefined;
|
|
45
|
-
minNodes?: number | undefined;
|
|
46
|
-
maxNodes?: number | undefined;
|
|
47
|
-
}>;
|
|
14
|
+
}, z.core.$strip>;
|
|
48
15
|
export declare const CustomLayout: z.ZodObject<{
|
|
49
16
|
name: z.ZodLiteral<"custom-layout">;
|
|
50
17
|
config: z.ZodObject<{
|
|
51
18
|
rootWrapper: z.ZodObject<{
|
|
52
19
|
tag: z.ZodString;
|
|
53
|
-
classes: z.ZodOptional<z.ZodArray<z.ZodString
|
|
54
|
-
},
|
|
55
|
-
tag: string;
|
|
56
|
-
classes?: string[] | undefined;
|
|
57
|
-
}, {
|
|
58
|
-
tag: string;
|
|
59
|
-
classes?: string[] | undefined;
|
|
60
|
-
}>;
|
|
20
|
+
classes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
21
|
+
}, z.core.$strip>;
|
|
61
22
|
nodeWrapper: z.ZodOptional<z.ZodObject<{
|
|
62
23
|
tag: z.ZodString;
|
|
63
|
-
classes: z.ZodOptional<z.ZodArray<z.ZodString
|
|
64
|
-
},
|
|
65
|
-
tag: string;
|
|
66
|
-
classes?: string[] | undefined;
|
|
67
|
-
}, {
|
|
68
|
-
tag: string;
|
|
69
|
-
classes?: string[] | undefined;
|
|
70
|
-
}>>;
|
|
24
|
+
classes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
25
|
+
}, z.core.$strip>>;
|
|
71
26
|
minNodes: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
72
27
|
maxNodes: z.ZodOptional<z.ZodNumber>;
|
|
73
|
-
},
|
|
74
|
-
rootWrapper: {
|
|
75
|
-
tag: string;
|
|
76
|
-
classes?: string[] | undefined;
|
|
77
|
-
};
|
|
78
|
-
nodeWrapper?: {
|
|
79
|
-
tag: string;
|
|
80
|
-
classes?: string[] | undefined;
|
|
81
|
-
} | undefined;
|
|
82
|
-
minNodes?: number | undefined;
|
|
83
|
-
maxNodes?: number | undefined;
|
|
84
|
-
}, {
|
|
85
|
-
rootWrapper: {
|
|
86
|
-
tag: string;
|
|
87
|
-
classes?: string[] | undefined;
|
|
88
|
-
};
|
|
89
|
-
nodeWrapper?: {
|
|
90
|
-
tag: string;
|
|
91
|
-
classes?: string[] | undefined;
|
|
92
|
-
} | undefined;
|
|
93
|
-
minNodes?: number | undefined;
|
|
94
|
-
maxNodes?: number | undefined;
|
|
95
|
-
}>;
|
|
28
|
+
}, z.core.$strip>;
|
|
96
29
|
content: z.ZodObject<{
|
|
97
|
-
main: z.ZodType<
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
}, {
|
|
101
|
-
main: unknown[];
|
|
102
|
-
}>;
|
|
103
|
-
}, "strip", z.ZodTypeAny, {
|
|
104
|
-
config: {
|
|
105
|
-
rootWrapper: {
|
|
106
|
-
tag: string;
|
|
107
|
-
classes?: string[] | undefined;
|
|
108
|
-
};
|
|
109
|
-
nodeWrapper?: {
|
|
110
|
-
tag: string;
|
|
111
|
-
classes?: string[] | undefined;
|
|
112
|
-
} | undefined;
|
|
113
|
-
minNodes?: number | undefined;
|
|
114
|
-
maxNodes?: number | undefined;
|
|
115
|
-
};
|
|
116
|
-
content: {
|
|
117
|
-
main: import("../layout-content").LayoutContentNodes[];
|
|
118
|
-
};
|
|
119
|
-
name: "custom-layout";
|
|
120
|
-
}, {
|
|
121
|
-
config: {
|
|
122
|
-
rootWrapper: {
|
|
123
|
-
tag: string;
|
|
124
|
-
classes?: string[] | undefined;
|
|
125
|
-
};
|
|
126
|
-
nodeWrapper?: {
|
|
127
|
-
tag: string;
|
|
128
|
-
classes?: string[] | undefined;
|
|
129
|
-
} | undefined;
|
|
130
|
-
minNodes?: number | undefined;
|
|
131
|
-
maxNodes?: number | undefined;
|
|
132
|
-
};
|
|
133
|
-
content: {
|
|
134
|
-
main: unknown[];
|
|
135
|
-
};
|
|
136
|
-
name: "custom-layout";
|
|
137
|
-
}>;
|
|
30
|
+
main: z.ZodType<PageLayoutContent, unknown, z.core.$ZodTypeInternals<PageLayoutContent, unknown>>;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
}, z.core.$strip>;
|
|
138
33
|
export type CustomLayout = z.infer<typeof CustomLayout>;
|
|
139
34
|
export declare const CUSTOM_LAYOUT_TEMPLATE = "\n<{{rootTag}} class=\"{{joinClasses rootClasses}}\">\n {{#each main}}\n {{#if ../nodeTag}}\n <{{../nodeTag}} class=\"{{joinClasses ../nodeClasses}}\">{{{this}}}</{{../nodeTag}}>\n {{else}}\n {{{this}}}\n {{/if}}\n {{/each}}\n</{{rootTag}}>\n";
|
package/lib/layouts/index.d.ts
CHANGED
|
@@ -1,156 +1,38 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const PageLayout: z.ZodDiscriminatedUnion<
|
|
2
|
+
export declare const PageLayout: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
3
|
name: z.ZodLiteral<"layout-raw">;
|
|
4
4
|
content: z.ZodObject<{
|
|
5
|
-
main: z.ZodType<import("../layout-content").
|
|
6
|
-
},
|
|
7
|
-
|
|
8
|
-
}, {
|
|
9
|
-
main: unknown[];
|
|
10
|
-
}>;
|
|
11
|
-
}, "strip", z.ZodTypeAny, {
|
|
12
|
-
content: {
|
|
13
|
-
main: import("../layout-content").LayoutContentNodes[];
|
|
14
|
-
};
|
|
15
|
-
name: "layout-raw";
|
|
16
|
-
}, {
|
|
17
|
-
content: {
|
|
18
|
-
main: unknown[];
|
|
19
|
-
};
|
|
20
|
-
name: "layout-raw";
|
|
21
|
-
}>, z.ZodObject<{
|
|
5
|
+
main: z.ZodType<import("../layout-content").PageLayoutContent, unknown, z.core.$ZodTypeInternals<import("../layout-content").PageLayoutContent, unknown>>;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
22
8
|
name: z.ZodLiteral<"single-column">;
|
|
23
9
|
content: z.ZodObject<{
|
|
24
|
-
main: z.ZodType<import("../layout-content").
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
}, {
|
|
28
|
-
main: unknown[];
|
|
29
|
-
}>;
|
|
30
|
-
}, "strip", z.ZodTypeAny, {
|
|
31
|
-
content: {
|
|
32
|
-
main: import("../layout-content").LayoutContentNodes[];
|
|
33
|
-
};
|
|
34
|
-
name: "single-column";
|
|
35
|
-
}, {
|
|
36
|
-
content: {
|
|
37
|
-
main: unknown[];
|
|
38
|
-
};
|
|
39
|
-
name: "single-column";
|
|
40
|
-
}>, z.ZodObject<{
|
|
10
|
+
main: z.ZodType<import("../layout-content").PageLayoutContent, unknown, z.core.$ZodTypeInternals<import("../layout-content").PageLayoutContent, unknown>>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
41
13
|
name: z.ZodLiteral<"two-column">;
|
|
42
14
|
content: z.ZodObject<{
|
|
43
|
-
left: z.ZodType<import("../layout-content").
|
|
44
|
-
right: z.ZodType<import("../layout-content").
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
right: import("../layout-content").LayoutContentNodes[];
|
|
48
|
-
}, {
|
|
49
|
-
left: unknown[];
|
|
50
|
-
right: unknown[];
|
|
51
|
-
}>;
|
|
52
|
-
}, "strip", z.ZodTypeAny, {
|
|
53
|
-
content: {
|
|
54
|
-
left: import("../layout-content").LayoutContentNodes[];
|
|
55
|
-
right: import("../layout-content").LayoutContentNodes[];
|
|
56
|
-
};
|
|
57
|
-
name: "two-column";
|
|
58
|
-
}, {
|
|
59
|
-
content: {
|
|
60
|
-
left: unknown[];
|
|
61
|
-
right: unknown[];
|
|
62
|
-
};
|
|
63
|
-
name: "two-column";
|
|
64
|
-
}>, z.ZodObject<{
|
|
15
|
+
left: z.ZodType<import("../layout-content").PageLayoutContent, unknown, z.core.$ZodTypeInternals<import("../layout-content").PageLayoutContent, unknown>>;
|
|
16
|
+
right: z.ZodType<import("../layout-content").PageLayoutContent, unknown, z.core.$ZodTypeInternals<import("../layout-content").PageLayoutContent, unknown>>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
65
19
|
name: z.ZodLiteral<"custom-layout">;
|
|
66
20
|
config: z.ZodObject<{
|
|
67
21
|
rootWrapper: z.ZodObject<{
|
|
68
22
|
tag: z.ZodString;
|
|
69
|
-
classes: z.ZodOptional<z.ZodArray<z.ZodString
|
|
70
|
-
},
|
|
71
|
-
tag: string;
|
|
72
|
-
classes?: string[] | undefined;
|
|
73
|
-
}, {
|
|
74
|
-
tag: string;
|
|
75
|
-
classes?: string[] | undefined;
|
|
76
|
-
}>;
|
|
23
|
+
classes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
24
|
+
}, z.core.$strip>;
|
|
77
25
|
nodeWrapper: z.ZodOptional<z.ZodObject<{
|
|
78
26
|
tag: z.ZodString;
|
|
79
|
-
classes: z.ZodOptional<z.ZodArray<z.ZodString
|
|
80
|
-
},
|
|
81
|
-
tag: string;
|
|
82
|
-
classes?: string[] | undefined;
|
|
83
|
-
}, {
|
|
84
|
-
tag: string;
|
|
85
|
-
classes?: string[] | undefined;
|
|
86
|
-
}>>;
|
|
27
|
+
classes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
28
|
+
}, z.core.$strip>>;
|
|
87
29
|
minNodes: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
88
30
|
maxNodes: z.ZodOptional<z.ZodNumber>;
|
|
89
|
-
},
|
|
90
|
-
rootWrapper: {
|
|
91
|
-
tag: string;
|
|
92
|
-
classes?: string[] | undefined;
|
|
93
|
-
};
|
|
94
|
-
nodeWrapper?: {
|
|
95
|
-
tag: string;
|
|
96
|
-
classes?: string[] | undefined;
|
|
97
|
-
} | undefined;
|
|
98
|
-
minNodes?: number | undefined;
|
|
99
|
-
maxNodes?: number | undefined;
|
|
100
|
-
}, {
|
|
101
|
-
rootWrapper: {
|
|
102
|
-
tag: string;
|
|
103
|
-
classes?: string[] | undefined;
|
|
104
|
-
};
|
|
105
|
-
nodeWrapper?: {
|
|
106
|
-
tag: string;
|
|
107
|
-
classes?: string[] | undefined;
|
|
108
|
-
} | undefined;
|
|
109
|
-
minNodes?: number | undefined;
|
|
110
|
-
maxNodes?: number | undefined;
|
|
111
|
-
}>;
|
|
31
|
+
}, z.core.$strip>;
|
|
112
32
|
content: z.ZodObject<{
|
|
113
|
-
main: z.ZodType<import("../layout-content").
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
}, {
|
|
117
|
-
main: unknown[];
|
|
118
|
-
}>;
|
|
119
|
-
}, "strip", z.ZodTypeAny, {
|
|
120
|
-
config: {
|
|
121
|
-
rootWrapper: {
|
|
122
|
-
tag: string;
|
|
123
|
-
classes?: string[] | undefined;
|
|
124
|
-
};
|
|
125
|
-
nodeWrapper?: {
|
|
126
|
-
tag: string;
|
|
127
|
-
classes?: string[] | undefined;
|
|
128
|
-
} | undefined;
|
|
129
|
-
minNodes?: number | undefined;
|
|
130
|
-
maxNodes?: number | undefined;
|
|
131
|
-
};
|
|
132
|
-
content: {
|
|
133
|
-
main: import("../layout-content").LayoutContentNodes[];
|
|
134
|
-
};
|
|
135
|
-
name: "custom-layout";
|
|
136
|
-
}, {
|
|
137
|
-
config: {
|
|
138
|
-
rootWrapper: {
|
|
139
|
-
tag: string;
|
|
140
|
-
classes?: string[] | undefined;
|
|
141
|
-
};
|
|
142
|
-
nodeWrapper?: {
|
|
143
|
-
tag: string;
|
|
144
|
-
classes?: string[] | undefined;
|
|
145
|
-
} | undefined;
|
|
146
|
-
minNodes?: number | undefined;
|
|
147
|
-
maxNodes?: number | undefined;
|
|
148
|
-
};
|
|
149
|
-
content: {
|
|
150
|
-
main: unknown[];
|
|
151
|
-
};
|
|
152
|
-
name: "custom-layout";
|
|
153
|
-
}>]>;
|
|
33
|
+
main: z.ZodType<import("../layout-content").PageLayoutContent, unknown, z.core.$ZodTypeInternals<import("../layout-content").PageLayoutContent, unknown>>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
}, z.core.$strip>], "name">;
|
|
154
36
|
export type PageLayout = z.infer<typeof PageLayout>;
|
|
155
37
|
export declare const LAYOUT_TEMPLATES: {
|
|
156
38
|
'layout-raw': string;
|
|
@@ -1,22 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { PageLayoutContent } from '../layout-content';
|
|
2
3
|
export declare const RawLayout: z.ZodObject<{
|
|
3
4
|
name: z.ZodLiteral<"layout-raw">;
|
|
4
5
|
content: z.ZodObject<{
|
|
5
|
-
main: z.ZodType<
|
|
6
|
-
},
|
|
7
|
-
|
|
8
|
-
}, {
|
|
9
|
-
main: unknown[];
|
|
10
|
-
}>;
|
|
11
|
-
}, "strip", z.ZodTypeAny, {
|
|
12
|
-
content: {
|
|
13
|
-
main: import("../layout-content").LayoutContentNodes[];
|
|
14
|
-
};
|
|
15
|
-
name: "layout-raw";
|
|
16
|
-
}, {
|
|
17
|
-
content: {
|
|
18
|
-
main: unknown[];
|
|
19
|
-
};
|
|
20
|
-
name: "layout-raw";
|
|
21
|
-
}>;
|
|
6
|
+
main: z.ZodType<PageLayoutContent, unknown, z.core.$ZodTypeInternals<PageLayoutContent, unknown>>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
}, z.core.$strip>;
|
|
22
9
|
export declare const TEMPLATE = "{{main}}";
|
|
@@ -1,22 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { PageLayoutContent } from '../layout-content';
|
|
2
3
|
export declare const SingleColumnLayout: z.ZodObject<{
|
|
3
4
|
name: z.ZodLiteral<"single-column">;
|
|
4
5
|
content: z.ZodObject<{
|
|
5
|
-
main: z.ZodType<
|
|
6
|
-
},
|
|
7
|
-
|
|
8
|
-
}, {
|
|
9
|
-
main: unknown[];
|
|
10
|
-
}>;
|
|
11
|
-
}, "strip", z.ZodTypeAny, {
|
|
12
|
-
content: {
|
|
13
|
-
main: import("../layout-content").LayoutContentNodes[];
|
|
14
|
-
};
|
|
15
|
-
name: "single-column";
|
|
16
|
-
}, {
|
|
17
|
-
content: {
|
|
18
|
-
main: unknown[];
|
|
19
|
-
};
|
|
20
|
-
name: "single-column";
|
|
21
|
-
}>;
|
|
6
|
+
main: z.ZodType<PageLayoutContent, unknown, z.core.$ZodTypeInternals<PageLayoutContent, unknown>>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
}, z.core.$strip>;
|
|
22
9
|
export declare const TEMPLATE = "\n<div class=\"container\">{{main}}</div>\n";
|
|
@@ -1,27 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { PageLayoutContent } from '../layout-content';
|
|
2
3
|
export declare const TwoColumnLayout: z.ZodObject<{
|
|
3
4
|
name: z.ZodLiteral<"two-column">;
|
|
4
5
|
content: z.ZodObject<{
|
|
5
|
-
left: z.ZodType<
|
|
6
|
-
right: z.ZodType<
|
|
7
|
-
},
|
|
8
|
-
|
|
9
|
-
right: import("../layout-content").LayoutContentNodes[];
|
|
10
|
-
}, {
|
|
11
|
-
left: unknown[];
|
|
12
|
-
right: unknown[];
|
|
13
|
-
}>;
|
|
14
|
-
}, "strip", z.ZodTypeAny, {
|
|
15
|
-
content: {
|
|
16
|
-
left: import("../layout-content").LayoutContentNodes[];
|
|
17
|
-
right: import("../layout-content").LayoutContentNodes[];
|
|
18
|
-
};
|
|
19
|
-
name: "two-column";
|
|
20
|
-
}, {
|
|
21
|
-
content: {
|
|
22
|
-
left: unknown[];
|
|
23
|
-
right: unknown[];
|
|
24
|
-
};
|
|
25
|
-
name: "two-column";
|
|
26
|
-
}>;
|
|
6
|
+
left: z.ZodType<PageLayoutContent, unknown, z.core.$ZodTypeInternals<PageLayoutContent, unknown>>;
|
|
7
|
+
right: z.ZodType<PageLayoutContent, unknown, z.core.$ZodTypeInternals<PageLayoutContent, unknown>>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
}, z.core.$strip>;
|
|
27
10
|
export declare const TEMPLATE = "\n<div class=\"container\"><div class=\"left\">{{left}}</div><div class=\"right\">{{right}}</div></div>\n";
|