monto-email-core 0.0.4 → 0.0.6
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/dist/Reader/core.d.ts +26 -20
- package/dist/Reader/core.d.ts.map +1 -1
- package/dist/blocks/ColumnsContainer/ColumnsContainerPropsSchema.d.ts +10 -10
- package/dist/blocks/ColumnsContainer/ColumnsContainerPropsSchema.d.ts.map +1 -1
- package/dist/blocks/ColumnsContainer/ColumnsContainerPropsSchema.js +9 -1
- package/dist/blocks/ColumnsContainer/ColumnsContainerReader.d.ts.map +1 -1
- package/dist/blocks/ColumnsContainer/ColumnsContainerReader.js +53 -2
- package/dist/blocks/EmailLayout/EmailLayoutPropsSchema.d.ts +3 -0
- package/dist/blocks/EmailLayout/EmailLayoutPropsSchema.d.ts.map +1 -1
- package/dist/blocks/EmailLayout/EmailLayoutPropsSchema.js +1 -0
- package/dist/blocks/EmailLayout/EmailLayoutReader.js +1 -1
- package/package.json +2 -2
package/dist/Reader/core.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ export declare const ReaderBlockSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"ty
|
|
|
38
38
|
} | null | undefined;
|
|
39
39
|
}>>>;
|
|
40
40
|
props: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
41
|
+
columnsCount: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
41
42
|
columns: z.ZodArray<z.ZodObject<{
|
|
42
43
|
childrenIds: z.ZodArray<z.ZodString, "many">;
|
|
43
44
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -45,24 +46,23 @@ export declare const ReaderBlockSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"ty
|
|
|
45
46
|
}, {
|
|
46
47
|
childrenIds: string[];
|
|
47
48
|
}>, "many">;
|
|
48
|
-
fixedWidths: z.ZodNullable<z.ZodOptional<z.ZodTuple<[z.ZodOptional<z.ZodNullable<z.ZodNumber>>, z.ZodOptional<z.ZodNullable<z.ZodNumber>>, z.ZodOptional<z.ZodNullable<z.ZodNumber>>], null>>>;
|
|
49
|
-
columnsCount: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<2>, z.ZodLiteral<3>]>>>;
|
|
49
|
+
fixedWidths: z.ZodNullable<z.ZodOptional<z.ZodTuple<[z.ZodOptional<z.ZodNullable<z.ZodNumber>>, z.ZodOptional<z.ZodNullable<z.ZodNumber>>, z.ZodOptional<z.ZodNullable<z.ZodNumber>>, z.ZodOptional<z.ZodNullable<z.ZodNumber>>], null>>>;
|
|
50
50
|
columnsGap: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
51
51
|
contentAlignment: z.ZodNullable<z.ZodOptional<z.ZodEnum<["top", "middle", "bottom"]>>>;
|
|
52
52
|
}, "strip", z.ZodTypeAny, {
|
|
53
53
|
columns: {
|
|
54
54
|
childrenIds: string[];
|
|
55
55
|
}[];
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
columnsCount?: number | null | undefined;
|
|
57
|
+
fixedWidths?: [number | null | undefined, number | null | undefined, number | null | undefined, number | null | undefined] | null | undefined;
|
|
58
58
|
columnsGap?: number | null | undefined;
|
|
59
59
|
contentAlignment?: "top" | "middle" | "bottom" | null | undefined;
|
|
60
60
|
}, {
|
|
61
61
|
columns: {
|
|
62
62
|
childrenIds: string[];
|
|
63
63
|
}[];
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
columnsCount?: number | null | undefined;
|
|
65
|
+
fixedWidths?: [number | null | undefined, number | null | undefined, number | null | undefined, number | null | undefined] | null | undefined;
|
|
66
66
|
columnsGap?: number | null | undefined;
|
|
67
67
|
contentAlignment?: "top" | "middle" | "bottom" | null | undefined;
|
|
68
68
|
}>>>;
|
|
@@ -80,8 +80,8 @@ export declare const ReaderBlockSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"ty
|
|
|
80
80
|
columns: {
|
|
81
81
|
childrenIds: string[];
|
|
82
82
|
}[];
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
columnsCount?: number | null | undefined;
|
|
84
|
+
fixedWidths?: [number | null | undefined, number | null | undefined, number | null | undefined, number | null | undefined] | null | undefined;
|
|
85
85
|
columnsGap?: number | null | undefined;
|
|
86
86
|
contentAlignment?: "top" | "middle" | "bottom" | null | undefined;
|
|
87
87
|
} | null | undefined;
|
|
@@ -99,8 +99,8 @@ export declare const ReaderBlockSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"ty
|
|
|
99
99
|
columns: {
|
|
100
100
|
childrenIds: string[];
|
|
101
101
|
}[];
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
columnsCount?: number | null | undefined;
|
|
103
|
+
fixedWidths?: [number | null | undefined, number | null | undefined, number | null | undefined, number | null | undefined] | null | undefined;
|
|
104
104
|
columnsGap?: number | null | undefined;
|
|
105
105
|
contentAlignment?: "top" | "middle" | "bottom" | null | undefined;
|
|
106
106
|
} | null | undefined;
|
|
@@ -186,6 +186,7 @@ export declare const ReaderBlockSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"ty
|
|
|
186
186
|
} | null | undefined;
|
|
187
187
|
}>;
|
|
188
188
|
EmailLayout: z.ZodObject<{
|
|
189
|
+
width: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
189
190
|
backdropColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
190
191
|
borderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
191
192
|
borderRadius: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
@@ -195,6 +196,7 @@ export declare const ReaderBlockSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"ty
|
|
|
195
196
|
childrenIds: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
196
197
|
}, "strip", z.ZodTypeAny, {
|
|
197
198
|
childrenIds?: string[] | null | undefined;
|
|
199
|
+
width?: number | null | undefined;
|
|
198
200
|
backdropColor?: string | null | undefined;
|
|
199
201
|
borderColor?: string | null | undefined;
|
|
200
202
|
borderRadius?: number | null | undefined;
|
|
@@ -203,6 +205,7 @@ export declare const ReaderBlockSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"ty
|
|
|
203
205
|
fontFamily?: "MODERN_SANS" | "BOOK_SANS" | "ORGANIC_SANS" | "GEOMETRIC_SANS" | "HEAVY_SANS" | "ROUNDED_SANS" | "MODERN_SERIF" | "BOOK_SERIF" | "MONOSPACE" | null | undefined;
|
|
204
206
|
}, {
|
|
205
207
|
childrenIds?: string[] | null | undefined;
|
|
208
|
+
width?: number | null | undefined;
|
|
206
209
|
backdropColor?: string | null | undefined;
|
|
207
210
|
borderColor?: string | null | undefined;
|
|
208
211
|
borderRadius?: number | null | undefined;
|
|
@@ -1052,6 +1055,7 @@ export declare const ReaderDocumentSchema: z.ZodRecord<z.ZodString, z.ZodEffects
|
|
|
1052
1055
|
} | null | undefined;
|
|
1053
1056
|
}>>>;
|
|
1054
1057
|
props: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
1058
|
+
columnsCount: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
1055
1059
|
columns: z.ZodArray<z.ZodObject<{
|
|
1056
1060
|
childrenIds: z.ZodArray<z.ZodString, "many">;
|
|
1057
1061
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1059,24 +1063,23 @@ export declare const ReaderDocumentSchema: z.ZodRecord<z.ZodString, z.ZodEffects
|
|
|
1059
1063
|
}, {
|
|
1060
1064
|
childrenIds: string[];
|
|
1061
1065
|
}>, "many">;
|
|
1062
|
-
fixedWidths: z.ZodNullable<z.ZodOptional<z.ZodTuple<[z.ZodOptional<z.ZodNullable<z.ZodNumber>>, z.ZodOptional<z.ZodNullable<z.ZodNumber>>, z.ZodOptional<z.ZodNullable<z.ZodNumber>>], null>>>;
|
|
1063
|
-
columnsCount: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<2>, z.ZodLiteral<3>]>>>;
|
|
1066
|
+
fixedWidths: z.ZodNullable<z.ZodOptional<z.ZodTuple<[z.ZodOptional<z.ZodNullable<z.ZodNumber>>, z.ZodOptional<z.ZodNullable<z.ZodNumber>>, z.ZodOptional<z.ZodNullable<z.ZodNumber>>, z.ZodOptional<z.ZodNullable<z.ZodNumber>>], null>>>;
|
|
1064
1067
|
columnsGap: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
1065
1068
|
contentAlignment: z.ZodNullable<z.ZodOptional<z.ZodEnum<["top", "middle", "bottom"]>>>;
|
|
1066
1069
|
}, "strip", z.ZodTypeAny, {
|
|
1067
1070
|
columns: {
|
|
1068
1071
|
childrenIds: string[];
|
|
1069
1072
|
}[];
|
|
1070
|
-
|
|
1071
|
-
|
|
1073
|
+
columnsCount?: number | null | undefined;
|
|
1074
|
+
fixedWidths?: [number | null | undefined, number | null | undefined, number | null | undefined, number | null | undefined] | null | undefined;
|
|
1072
1075
|
columnsGap?: number | null | undefined;
|
|
1073
1076
|
contentAlignment?: "top" | "middle" | "bottom" | null | undefined;
|
|
1074
1077
|
}, {
|
|
1075
1078
|
columns: {
|
|
1076
1079
|
childrenIds: string[];
|
|
1077
1080
|
}[];
|
|
1078
|
-
|
|
1079
|
-
|
|
1081
|
+
columnsCount?: number | null | undefined;
|
|
1082
|
+
fixedWidths?: [number | null | undefined, number | null | undefined, number | null | undefined, number | null | undefined] | null | undefined;
|
|
1080
1083
|
columnsGap?: number | null | undefined;
|
|
1081
1084
|
contentAlignment?: "top" | "middle" | "bottom" | null | undefined;
|
|
1082
1085
|
}>>>;
|
|
@@ -1094,8 +1097,8 @@ export declare const ReaderDocumentSchema: z.ZodRecord<z.ZodString, z.ZodEffects
|
|
|
1094
1097
|
columns: {
|
|
1095
1098
|
childrenIds: string[];
|
|
1096
1099
|
}[];
|
|
1097
|
-
|
|
1098
|
-
|
|
1100
|
+
columnsCount?: number | null | undefined;
|
|
1101
|
+
fixedWidths?: [number | null | undefined, number | null | undefined, number | null | undefined, number | null | undefined] | null | undefined;
|
|
1099
1102
|
columnsGap?: number | null | undefined;
|
|
1100
1103
|
contentAlignment?: "top" | "middle" | "bottom" | null | undefined;
|
|
1101
1104
|
} | null | undefined;
|
|
@@ -1113,8 +1116,8 @@ export declare const ReaderDocumentSchema: z.ZodRecord<z.ZodString, z.ZodEffects
|
|
|
1113
1116
|
columns: {
|
|
1114
1117
|
childrenIds: string[];
|
|
1115
1118
|
}[];
|
|
1116
|
-
|
|
1117
|
-
|
|
1119
|
+
columnsCount?: number | null | undefined;
|
|
1120
|
+
fixedWidths?: [number | null | undefined, number | null | undefined, number | null | undefined, number | null | undefined] | null | undefined;
|
|
1118
1121
|
columnsGap?: number | null | undefined;
|
|
1119
1122
|
contentAlignment?: "top" | "middle" | "bottom" | null | undefined;
|
|
1120
1123
|
} | null | undefined;
|
|
@@ -1200,6 +1203,7 @@ export declare const ReaderDocumentSchema: z.ZodRecord<z.ZodString, z.ZodEffects
|
|
|
1200
1203
|
} | null | undefined;
|
|
1201
1204
|
}>;
|
|
1202
1205
|
EmailLayout: z.ZodObject<{
|
|
1206
|
+
width: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
1203
1207
|
backdropColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1204
1208
|
borderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1205
1209
|
borderRadius: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
@@ -1209,6 +1213,7 @@ export declare const ReaderDocumentSchema: z.ZodRecord<z.ZodString, z.ZodEffects
|
|
|
1209
1213
|
childrenIds: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
1210
1214
|
}, "strip", z.ZodTypeAny, {
|
|
1211
1215
|
childrenIds?: string[] | null | undefined;
|
|
1216
|
+
width?: number | null | undefined;
|
|
1212
1217
|
backdropColor?: string | null | undefined;
|
|
1213
1218
|
borderColor?: string | null | undefined;
|
|
1214
1219
|
borderRadius?: number | null | undefined;
|
|
@@ -1217,6 +1222,7 @@ export declare const ReaderDocumentSchema: z.ZodRecord<z.ZodString, z.ZodEffects
|
|
|
1217
1222
|
fontFamily?: "MODERN_SANS" | "BOOK_SANS" | "ORGANIC_SANS" | "GEOMETRIC_SANS" | "HEAVY_SANS" | "ROUNDED_SANS" | "MODERN_SERIF" | "BOOK_SERIF" | "MONOSPACE" | null | undefined;
|
|
1218
1223
|
}, {
|
|
1219
1224
|
childrenIds?: string[] | null | undefined;
|
|
1225
|
+
width?: number | null | undefined;
|
|
1220
1226
|
backdropColor?: string | null | undefined;
|
|
1221
1227
|
borderColor?: string | null | undefined;
|
|
1222
1228
|
borderRadius?: number | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/Reader/core.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwFxB,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/Reader/core.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwFxB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA3ErB,CAAC;mBAEL,CAAC;;;;;;;qBAG8B,CAAC;mBACvB,CAAC;;;;;;;;;;;;;gBAWoB,CAAC;iBAEjB,CAAC;oBAIA,CAAC;eACnB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props: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
39
|
+
columnsCount: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
39
40
|
columns: z.ZodArray<z.ZodObject<{
|
|
40
41
|
childrenIds: z.ZodArray<z.ZodString, "many">;
|
|
41
42
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -43,24 +44,23 @@ declare const ColumnsContainerPropsSchema: z.ZodObject<{
|
|
|
43
44
|
}, {
|
|
44
45
|
childrenIds: string[];
|
|
45
46
|
}>, "many">;
|
|
46
|
-
fixedWidths: z.ZodNullable<z.ZodOptional<z.ZodTuple<[z.ZodOptional<z.ZodNullable<z.ZodNumber>>, z.ZodOptional<z.ZodNullable<z.ZodNumber>>, z.ZodOptional<z.ZodNullable<z.ZodNumber>>], null>>>;
|
|
47
|
-
columnsCount: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<2>, z.ZodLiteral<3>]>>>;
|
|
47
|
+
fixedWidths: z.ZodNullable<z.ZodOptional<z.ZodTuple<[z.ZodOptional<z.ZodNullable<z.ZodNumber>>, z.ZodOptional<z.ZodNullable<z.ZodNumber>>, z.ZodOptional<z.ZodNullable<z.ZodNumber>>, z.ZodOptional<z.ZodNullable<z.ZodNumber>>], null>>>;
|
|
48
48
|
columnsGap: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
49
49
|
contentAlignment: z.ZodNullable<z.ZodOptional<z.ZodEnum<["top", "middle", "bottom"]>>>;
|
|
50
50
|
}, "strip", z.ZodTypeAny, {
|
|
51
51
|
columns: {
|
|
52
52
|
childrenIds: string[];
|
|
53
53
|
}[];
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
columnsCount?: number | null | undefined;
|
|
55
|
+
fixedWidths?: [number | null | undefined, number | null | undefined, number | null | undefined, number | null | undefined] | null | undefined;
|
|
56
56
|
columnsGap?: number | null | undefined;
|
|
57
57
|
contentAlignment?: "top" | "middle" | "bottom" | null | undefined;
|
|
58
58
|
}, {
|
|
59
59
|
columns: {
|
|
60
60
|
childrenIds: string[];
|
|
61
61
|
}[];
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
columnsCount?: number | null | undefined;
|
|
63
|
+
fixedWidths?: [number | null | undefined, number | null | undefined, number | null | undefined, number | null | undefined] | null | undefined;
|
|
64
64
|
columnsGap?: number | null | undefined;
|
|
65
65
|
contentAlignment?: "top" | "middle" | "bottom" | null | undefined;
|
|
66
66
|
}>>>;
|
|
@@ -78,8 +78,8 @@ declare const ColumnsContainerPropsSchema: z.ZodObject<{
|
|
|
78
78
|
columns: {
|
|
79
79
|
childrenIds: string[];
|
|
80
80
|
}[];
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
columnsCount?: number | null | undefined;
|
|
82
|
+
fixedWidths?: [number | null | undefined, number | null | undefined, number | null | undefined, number | null | undefined] | null | undefined;
|
|
83
83
|
columnsGap?: number | null | undefined;
|
|
84
84
|
contentAlignment?: "top" | "middle" | "bottom" | null | undefined;
|
|
85
85
|
} | null | undefined;
|
|
@@ -97,8 +97,8 @@ declare const ColumnsContainerPropsSchema: z.ZodObject<{
|
|
|
97
97
|
columns: {
|
|
98
98
|
childrenIds: string[];
|
|
99
99
|
}[];
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
columnsCount?: number | null | undefined;
|
|
101
|
+
fixedWidths?: [number | null | undefined, number | null | undefined, number | null | undefined, number | null | undefined] | null | undefined;
|
|
102
102
|
columnsGap?: number | null | undefined;
|
|
103
103
|
contentAlignment?: "top" | "middle" | "bottom" | null | undefined;
|
|
104
104
|
} | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColumnsContainerPropsSchema.d.ts","sourceRoot":"","sources":["../../../src/blocks/ColumnsContainer/ColumnsContainerPropsSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,QAAA,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"ColumnsContainerPropsSchema.d.ts","sourceRoot":"","sources":["../../../src/blocks/ColumnsContainer/ColumnsContainerPropsSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,QAAA,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmB/B,CAAC;AAEH,eAAe,2BAA2B,CAAC;AAC3C,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
|
|
@@ -4,7 +4,15 @@ const BasePropsShape = BaseColumnsContainerPropsSchema.shape.props.unwrap().unwr
|
|
|
4
4
|
const ColumnsContainerPropsSchema = z.object({
|
|
5
5
|
style: BaseColumnsContainerPropsSchema.shape.style,
|
|
6
6
|
props: z
|
|
7
|
-
.object(Object.assign(Object.assign({}, BasePropsShape), { columns: z.array(z.object({ childrenIds: z.array(z.string()) }))
|
|
7
|
+
.object(Object.assign(Object.assign({}, BasePropsShape), { columnsCount: z.number().min(1).max(4).optional().nullable(), columns: z.array(z.object({ childrenIds: z.array(z.string()) })).min(1).max(4), fixedWidths: z
|
|
8
|
+
.tuple([
|
|
9
|
+
z.number().nullable().optional(),
|
|
10
|
+
z.number().nullable().optional(),
|
|
11
|
+
z.number().nullable().optional(),
|
|
12
|
+
z.number().nullable().optional(),
|
|
13
|
+
])
|
|
14
|
+
.optional()
|
|
15
|
+
.nullable() }))
|
|
8
16
|
.optional()
|
|
9
17
|
.nullable(),
|
|
10
18
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColumnsContainerReader.d.ts","sourceRoot":"","sources":["../../../src/blocks/ColumnsContainer/ColumnsContainerReader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"ColumnsContainerReader.d.ts","sourceRoot":"","sources":["../../../src/blocks/ColumnsContainer/ColumnsContainerReader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,qBAAqB,qBAgGrF"}
|
|
@@ -13,10 +13,61 @@ import React from 'react';
|
|
|
13
13
|
import { ColumnsContainer as BaseColumnsContainer } from '@usewaypoint/block-columns-container';
|
|
14
14
|
import { ReaderBlock } from '../../Reader/core';
|
|
15
15
|
export default function ColumnsContainerReader({ style, props }) {
|
|
16
|
-
|
|
16
|
+
var _a, _b, _c;
|
|
17
|
+
const _d = props !== null && props !== void 0 ? props : {}, { columns, columnsCount } = _d, restProps = __rest(_d, ["columns", "columnsCount"]);
|
|
18
|
+
const count = columnsCount !== null && columnsCount !== void 0 ? columnsCount : ((_a = columns === null || columns === void 0 ? void 0 : columns.length) !== null && _a !== void 0 ? _a : 3);
|
|
17
19
|
let cols = undefined;
|
|
18
20
|
if (columns) {
|
|
19
21
|
cols = columns.map((col) => col.childrenIds.map((childId) => React.createElement(ReaderBlock, { key: childId, id: childId })));
|
|
20
22
|
}
|
|
21
|
-
|
|
23
|
+
// BaseColumnsContainer 只支持 2 或 3 列,对于 1 或 4 列,我们需要自定义渲染
|
|
24
|
+
if (count === 1 || count === 4) {
|
|
25
|
+
const columnsGap = (restProps && 'columnsGap' in restProps) ? (_b = restProps.columnsGap) !== null && _b !== void 0 ? _b : 0 : 0;
|
|
26
|
+
const contentAlignment = (restProps && 'contentAlignment' in restProps) ? (_c = restProps.contentAlignment) !== null && _c !== void 0 ? _c : 'middle' : 'middle';
|
|
27
|
+
const fixedWidths = (restProps && 'fixedWidths' in restProps) ? restProps.fixedWidths : undefined;
|
|
28
|
+
// 计算列宽
|
|
29
|
+
const getColumnWidth = (index) => {
|
|
30
|
+
if (fixedWidths && fixedWidths[index] !== null && fixedWidths[index] !== undefined) {
|
|
31
|
+
return `${fixedWidths[index]}%`;
|
|
32
|
+
}
|
|
33
|
+
return count === 1 ? '100%' : '25%';
|
|
34
|
+
};
|
|
35
|
+
// 对于HTML邮件,使用table布局
|
|
36
|
+
const paddingStyle = (style === null || style === void 0 ? void 0 : style.padding)
|
|
37
|
+
? {
|
|
38
|
+
paddingTop: `${style.padding.top}px`,
|
|
39
|
+
paddingRight: `${style.padding.right}px`,
|
|
40
|
+
paddingBottom: `${style.padding.bottom}px`,
|
|
41
|
+
paddingLeft: `${style.padding.left}px`,
|
|
42
|
+
}
|
|
43
|
+
: {};
|
|
44
|
+
const backgroundColorStyle = (style === null || style === void 0 ? void 0 : style.backgroundColor)
|
|
45
|
+
? { backgroundColor: style.backgroundColor }
|
|
46
|
+
: {};
|
|
47
|
+
return (React.createElement("table", { role: "presentation", cellSpacing: "0", cellPadding: "0", border: 0, width: "100%", style: Object.assign(Object.assign({ width: '100%', tableLayout: 'fixed' }, paddingStyle), backgroundColorStyle) },
|
|
48
|
+
React.createElement("tbody", null,
|
|
49
|
+
React.createElement("tr", null, cols === null || cols === void 0 ? void 0 : cols.map((col, index) => (React.createElement("td", { key: index, width: getColumnWidth(index), style: {
|
|
50
|
+
width: getColumnWidth(index),
|
|
51
|
+
verticalAlign: contentAlignment === 'top' ? 'top' : contentAlignment === 'bottom' ? 'bottom' : 'middle',
|
|
52
|
+
paddingLeft: index > 0 ? `${columnsGap / 2}px` : '0',
|
|
53
|
+
paddingRight: index < (count - 1) ? `${columnsGap / 2}px` : '0',
|
|
54
|
+
} }, col)))))));
|
|
55
|
+
}
|
|
56
|
+
// 对于 2 或 3 列,使用 BaseColumnsContainer
|
|
57
|
+
// 需要过滤掉 fixedWidths 的第4个元素(如果存在)
|
|
58
|
+
let baseFixedWidths = undefined;
|
|
59
|
+
if (restProps && 'fixedWidths' in restProps && restProps.fixedWidths) {
|
|
60
|
+
baseFixedWidths = [restProps.fixedWidths[0], restProps.fixedWidths[1], restProps.fixedWidths[2]];
|
|
61
|
+
}
|
|
62
|
+
// 创建不包含 fixedWidths 的 baseProps
|
|
63
|
+
const baseProps = Object.assign(Object.assign({}, (restProps && typeof restProps === 'object' ? restProps : {})), { columnsCount: count });
|
|
64
|
+
// 如果有 fixedWidths,只取前3个元素
|
|
65
|
+
if (baseFixedWidths !== undefined) {
|
|
66
|
+
baseProps.fixedWidths = baseFixedWidths;
|
|
67
|
+
}
|
|
68
|
+
else if (restProps && 'fixedWidths' in restProps) {
|
|
69
|
+
// 如果原 fixedWidths 是 null 或 undefined,也传递 null
|
|
70
|
+
baseProps.fixedWidths = null;
|
|
71
|
+
}
|
|
72
|
+
return React.createElement(BaseColumnsContainer, { props: baseProps, columns: cols, style: style });
|
|
22
73
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const EmailLayoutPropsSchema: z.ZodObject<{
|
|
3
|
+
width: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
3
4
|
backdropColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
4
5
|
borderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
5
6
|
borderRadius: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
@@ -9,6 +10,7 @@ export declare const EmailLayoutPropsSchema: z.ZodObject<{
|
|
|
9
10
|
childrenIds: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
10
11
|
}, "strip", z.ZodTypeAny, {
|
|
11
12
|
childrenIds?: string[] | null | undefined;
|
|
13
|
+
width?: number | null | undefined;
|
|
12
14
|
backdropColor?: string | null | undefined;
|
|
13
15
|
borderColor?: string | null | undefined;
|
|
14
16
|
borderRadius?: number | null | undefined;
|
|
@@ -17,6 +19,7 @@ export declare const EmailLayoutPropsSchema: z.ZodObject<{
|
|
|
17
19
|
fontFamily?: "MODERN_SANS" | "BOOK_SANS" | "ORGANIC_SANS" | "GEOMETRIC_SANS" | "HEAVY_SANS" | "ROUNDED_SANS" | "MODERN_SERIF" | "BOOK_SERIF" | "MONOSPACE" | null | undefined;
|
|
18
20
|
}, {
|
|
19
21
|
childrenIds?: string[] | null | undefined;
|
|
22
|
+
width?: number | null | undefined;
|
|
20
23
|
backdropColor?: string | null | undefined;
|
|
21
24
|
borderColor?: string | null | undefined;
|
|
22
25
|
borderRadius?: number | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmailLayoutPropsSchema.d.ts","sourceRoot":"","sources":["../../../src/blocks/EmailLayout/EmailLayoutPropsSchema.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAuBxB,eAAO,MAAM,sBAAsB
|
|
1
|
+
{"version":3,"file":"EmailLayoutPropsSchema.d.ts","sourceRoot":"","sources":["../../../src/blocks/EmailLayout/EmailLayoutPropsSchema.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAuBxB,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;EASjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -19,6 +19,7 @@ const FONT_FAMILY_SCHEMA = z
|
|
|
19
19
|
.nullable()
|
|
20
20
|
.optional();
|
|
21
21
|
export const EmailLayoutPropsSchema = z.object({
|
|
22
|
+
width: z.number().optional().nullable(),
|
|
22
23
|
backdropColor: COLOR_SCHEMA,
|
|
23
24
|
borderColor: COLOR_SCHEMA,
|
|
24
25
|
borderRadius: z.number().optional().nullable(),
|
|
@@ -47,7 +47,7 @@ export default function EmailLayoutReader(props) {
|
|
|
47
47
|
} },
|
|
48
48
|
React.createElement("table", { align: "center", width: "100%", style: {
|
|
49
49
|
margin: '0 auto',
|
|
50
|
-
maxWidth: '600px',
|
|
50
|
+
maxWidth: props.width ? `${props.width}px` : '600px',
|
|
51
51
|
backgroundColor: (_d = props.canvasColor) !== null && _d !== void 0 ? _d : '#FFFFFF',
|
|
52
52
|
borderRadius: (_e = props.borderRadius) !== null && _e !== void 0 ? _e : undefined,
|
|
53
53
|
border: getBorder(props),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "monto-email-core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "React component to render email messages",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -47,4 +47,4 @@
|
|
|
47
47
|
"@usewaypoint/document-core": "0.0.6",
|
|
48
48
|
"monto-email-block-video": "0.0.1"
|
|
49
49
|
}
|
|
50
|
-
}
|
|
50
|
+
}
|