monto-email-core 0.0.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/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/Reader/core.d.ts +2096 -0
- package/dist/Reader/core.d.ts.map +1 -0
- package/dist/Reader/core.js +89 -0
- package/dist/blocks/ColumnsContainer/ColumnsContainerPropsSchema.d.ts +136 -0
- package/dist/blocks/ColumnsContainer/ColumnsContainerPropsSchema.d.ts.map +1 -0
- package/dist/blocks/ColumnsContainer/ColumnsContainerPropsSchema.js +15 -0
- package/dist/blocks/ColumnsContainer/ColumnsContainerReader.d.ts +4 -0
- package/dist/blocks/ColumnsContainer/ColumnsContainerReader.d.ts.map +1 -0
- package/dist/blocks/ColumnsContainer/ColumnsContainerReader.js +22 -0
- package/dist/blocks/Container/ContainerPropsSchema.d.ts +83 -0
- package/dist/blocks/Container/ContainerPropsSchema.d.ts.map +1 -0
- package/dist/blocks/Container/ContainerPropsSchema.js +11 -0
- package/dist/blocks/Container/ContainerReader.d.ts +4 -0
- package/dist/blocks/Container/ContainerReader.d.ts.map +1 -0
- package/dist/blocks/Container/ContainerReader.js +8 -0
- package/dist/blocks/EmailLayout/EmailLayoutPropsSchema.d.ts +28 -0
- package/dist/blocks/EmailLayout/EmailLayoutPropsSchema.d.ts.map +1 -0
- package/dist/blocks/EmailLayout/EmailLayoutPropsSchema.js +29 -0
- package/dist/blocks/EmailLayout/EmailLayoutReader.d.ts +4 -0
- package/dist/blocks/EmailLayout/EmailLayoutReader.d.ts.map +1 -0
- package/dist/blocks/EmailLayout/EmailLayoutReader.js +58 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/renderers/renderToStaticMarkup.d.ts +7 -0
- package/dist/renderers/renderToStaticMarkup.d.ts.map +1 -0
- package/dist/renderers/renderToStaticMarkup.js +9 -0
- package/package.json +50 -0
|
@@ -0,0 +1 @@
|
|
|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C,CAAC;iBAA2C,CAAC;oBAA8C,CAAC;;;SAtBvkC,CAAC;AAC5E,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;AAI3D,MAAM,MAAM,iBAAiB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAC/C,wBAAgB,WAAW,CAAC,EAAE,EAAE,EAAE,EAAE,iBAAiB,qBAGpD;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC;IAC5D,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AACF,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,YAAY,qBAMrE"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import React, { createContext, useContext } from 'react';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { Avatar, AvatarPropsSchema } from '@usewaypoint/block-avatar';
|
|
4
|
+
import { Button, ButtonPropsSchema } from '@usewaypoint/block-button';
|
|
5
|
+
import { Divider, DividerPropsSchema } from '@usewaypoint/block-divider';
|
|
6
|
+
import { Heading, HeadingPropsSchema } from '@usewaypoint/block-heading';
|
|
7
|
+
import { Html, HtmlPropsSchema } from '@usewaypoint/block-html';
|
|
8
|
+
import { Image, ImagePropsSchema } from '@usewaypoint/block-image';
|
|
9
|
+
import { Spacer, SpacerPropsSchema } from '@usewaypoint/block-spacer';
|
|
10
|
+
import { Text, TextPropsSchema } from '@usewaypoint/block-text';
|
|
11
|
+
import { Video, VideoPropsSchema } from 'monto-email-block-video';
|
|
12
|
+
import { buildBlockComponent, buildBlockConfigurationDictionary, buildBlockConfigurationSchema, } from '@usewaypoint/document-core';
|
|
13
|
+
import ColumnsContainerPropsSchema from '../blocks/ColumnsContainer/ColumnsContainerPropsSchema';
|
|
14
|
+
import ColumnsContainerReader from '../blocks/ColumnsContainer/ColumnsContainerReader';
|
|
15
|
+
import { ContainerPropsSchema } from '../blocks/Container/ContainerPropsSchema';
|
|
16
|
+
import ContainerReader from '../blocks/Container/ContainerReader';
|
|
17
|
+
import { EmailLayoutPropsSchema } from '../blocks/EmailLayout/EmailLayoutPropsSchema';
|
|
18
|
+
import EmailLayoutReader from '../blocks/EmailLayout/EmailLayoutReader';
|
|
19
|
+
// 包装 Video 组件以确保始终返回 Element 而不是 null
|
|
20
|
+
function VideoWrapper(props) {
|
|
21
|
+
const result = Video(props);
|
|
22
|
+
return result !== null && result !== void 0 ? result : React.createElement("div", null);
|
|
23
|
+
}
|
|
24
|
+
const ReaderContext = createContext({});
|
|
25
|
+
function useReaderDocument() {
|
|
26
|
+
return useContext(ReaderContext);
|
|
27
|
+
}
|
|
28
|
+
const READER_DICTIONARY = buildBlockConfigurationDictionary({
|
|
29
|
+
ColumnsContainer: {
|
|
30
|
+
schema: ColumnsContainerPropsSchema,
|
|
31
|
+
Component: ColumnsContainerReader,
|
|
32
|
+
},
|
|
33
|
+
Container: {
|
|
34
|
+
schema: ContainerPropsSchema,
|
|
35
|
+
Component: ContainerReader,
|
|
36
|
+
},
|
|
37
|
+
EmailLayout: {
|
|
38
|
+
schema: EmailLayoutPropsSchema,
|
|
39
|
+
Component: EmailLayoutReader,
|
|
40
|
+
},
|
|
41
|
+
//
|
|
42
|
+
Avatar: {
|
|
43
|
+
schema: AvatarPropsSchema,
|
|
44
|
+
Component: Avatar,
|
|
45
|
+
},
|
|
46
|
+
Button: {
|
|
47
|
+
schema: ButtonPropsSchema,
|
|
48
|
+
Component: Button,
|
|
49
|
+
},
|
|
50
|
+
Divider: {
|
|
51
|
+
schema: DividerPropsSchema,
|
|
52
|
+
Component: Divider,
|
|
53
|
+
},
|
|
54
|
+
Heading: {
|
|
55
|
+
schema: HeadingPropsSchema,
|
|
56
|
+
Component: Heading,
|
|
57
|
+
},
|
|
58
|
+
Html: {
|
|
59
|
+
schema: HtmlPropsSchema,
|
|
60
|
+
Component: Html,
|
|
61
|
+
},
|
|
62
|
+
Image: {
|
|
63
|
+
schema: ImagePropsSchema,
|
|
64
|
+
Component: Image,
|
|
65
|
+
},
|
|
66
|
+
Spacer: {
|
|
67
|
+
schema: SpacerPropsSchema,
|
|
68
|
+
Component: Spacer,
|
|
69
|
+
},
|
|
70
|
+
Text: {
|
|
71
|
+
schema: TextPropsSchema,
|
|
72
|
+
Component: Text,
|
|
73
|
+
},
|
|
74
|
+
Video: {
|
|
75
|
+
schema: VideoPropsSchema,
|
|
76
|
+
Component: VideoWrapper,
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
export const ReaderBlockSchema = buildBlockConfigurationSchema(READER_DICTIONARY);
|
|
80
|
+
export const ReaderDocumentSchema = z.record(z.string(), ReaderBlockSchema);
|
|
81
|
+
const BaseReaderBlock = buildBlockComponent(READER_DICTIONARY);
|
|
82
|
+
export function ReaderBlock({ id }) {
|
|
83
|
+
const document = useReaderDocument();
|
|
84
|
+
return React.createElement(BaseReaderBlock, Object.assign({}, document[id]));
|
|
85
|
+
}
|
|
86
|
+
export default function Reader({ document, rootBlockId }) {
|
|
87
|
+
return (React.createElement(ReaderContext.Provider, { value: document },
|
|
88
|
+
React.createElement(ReaderBlock, { id: rootBlockId })));
|
|
89
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
declare const ColumnsContainerPropsSchema: z.ZodObject<{
|
|
3
|
+
style: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
4
|
+
backgroundColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
5
|
+
padding: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
6
|
+
top: z.ZodNumber;
|
|
7
|
+
bottom: z.ZodNumber;
|
|
8
|
+
right: z.ZodNumber;
|
|
9
|
+
left: z.ZodNumber;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
top: number;
|
|
12
|
+
bottom: number;
|
|
13
|
+
right: number;
|
|
14
|
+
left: number;
|
|
15
|
+
}, {
|
|
16
|
+
top: number;
|
|
17
|
+
bottom: number;
|
|
18
|
+
right: number;
|
|
19
|
+
left: number;
|
|
20
|
+
}>>>;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
backgroundColor?: string | null | undefined;
|
|
23
|
+
padding?: {
|
|
24
|
+
top: number;
|
|
25
|
+
bottom: number;
|
|
26
|
+
right: number;
|
|
27
|
+
left: number;
|
|
28
|
+
} | null | undefined;
|
|
29
|
+
}, {
|
|
30
|
+
backgroundColor?: string | null | undefined;
|
|
31
|
+
padding?: {
|
|
32
|
+
top: number;
|
|
33
|
+
bottom: number;
|
|
34
|
+
right: number;
|
|
35
|
+
left: number;
|
|
36
|
+
} | null | undefined;
|
|
37
|
+
}>>>;
|
|
38
|
+
props: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
39
|
+
columns: z.ZodTuple<[z.ZodObject<{
|
|
40
|
+
childrenIds: z.ZodArray<z.ZodString, "many">;
|
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
|
42
|
+
childrenIds: string[];
|
|
43
|
+
}, {
|
|
44
|
+
childrenIds: string[];
|
|
45
|
+
}>, z.ZodObject<{
|
|
46
|
+
childrenIds: z.ZodArray<z.ZodString, "many">;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
childrenIds: string[];
|
|
49
|
+
}, {
|
|
50
|
+
childrenIds: string[];
|
|
51
|
+
}>, z.ZodObject<{
|
|
52
|
+
childrenIds: z.ZodArray<z.ZodString, "many">;
|
|
53
|
+
}, "strip", z.ZodTypeAny, {
|
|
54
|
+
childrenIds: string[];
|
|
55
|
+
}, {
|
|
56
|
+
childrenIds: string[];
|
|
57
|
+
}>], null>;
|
|
58
|
+
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>>>;
|
|
59
|
+
columnsCount: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<2>, z.ZodLiteral<3>]>>>;
|
|
60
|
+
columnsGap: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
61
|
+
contentAlignment: z.ZodNullable<z.ZodOptional<z.ZodEnum<["top", "middle", "bottom"]>>>;
|
|
62
|
+
}, "strip", z.ZodTypeAny, {
|
|
63
|
+
columns: [{
|
|
64
|
+
childrenIds: string[];
|
|
65
|
+
}, {
|
|
66
|
+
childrenIds: string[];
|
|
67
|
+
}, {
|
|
68
|
+
childrenIds: string[];
|
|
69
|
+
}];
|
|
70
|
+
fixedWidths?: [number | null | undefined, number | null | undefined, number | null | undefined] | null | undefined;
|
|
71
|
+
columnsCount?: 2 | 3 | null | undefined;
|
|
72
|
+
columnsGap?: number | null | undefined;
|
|
73
|
+
contentAlignment?: "top" | "middle" | "bottom" | null | undefined;
|
|
74
|
+
}, {
|
|
75
|
+
columns: [{
|
|
76
|
+
childrenIds: string[];
|
|
77
|
+
}, {
|
|
78
|
+
childrenIds: string[];
|
|
79
|
+
}, {
|
|
80
|
+
childrenIds: string[];
|
|
81
|
+
}];
|
|
82
|
+
fixedWidths?: [number | null | undefined, number | null | undefined, number | null | undefined] | null | undefined;
|
|
83
|
+
columnsCount?: 2 | 3 | null | undefined;
|
|
84
|
+
columnsGap?: number | null | undefined;
|
|
85
|
+
contentAlignment?: "top" | "middle" | "bottom" | null | undefined;
|
|
86
|
+
}>>>;
|
|
87
|
+
}, "strip", z.ZodTypeAny, {
|
|
88
|
+
style?: {
|
|
89
|
+
backgroundColor?: string | null | undefined;
|
|
90
|
+
padding?: {
|
|
91
|
+
top: number;
|
|
92
|
+
bottom: number;
|
|
93
|
+
right: number;
|
|
94
|
+
left: number;
|
|
95
|
+
} | null | undefined;
|
|
96
|
+
} | null | undefined;
|
|
97
|
+
props?: {
|
|
98
|
+
columns: [{
|
|
99
|
+
childrenIds: string[];
|
|
100
|
+
}, {
|
|
101
|
+
childrenIds: string[];
|
|
102
|
+
}, {
|
|
103
|
+
childrenIds: string[];
|
|
104
|
+
}];
|
|
105
|
+
fixedWidths?: [number | null | undefined, number | null | undefined, number | null | undefined] | null | undefined;
|
|
106
|
+
columnsCount?: 2 | 3 | null | undefined;
|
|
107
|
+
columnsGap?: number | null | undefined;
|
|
108
|
+
contentAlignment?: "top" | "middle" | "bottom" | null | undefined;
|
|
109
|
+
} | null | undefined;
|
|
110
|
+
}, {
|
|
111
|
+
style?: {
|
|
112
|
+
backgroundColor?: string | null | undefined;
|
|
113
|
+
padding?: {
|
|
114
|
+
top: number;
|
|
115
|
+
bottom: number;
|
|
116
|
+
right: number;
|
|
117
|
+
left: number;
|
|
118
|
+
} | null | undefined;
|
|
119
|
+
} | null | undefined;
|
|
120
|
+
props?: {
|
|
121
|
+
columns: [{
|
|
122
|
+
childrenIds: string[];
|
|
123
|
+
}, {
|
|
124
|
+
childrenIds: string[];
|
|
125
|
+
}, {
|
|
126
|
+
childrenIds: string[];
|
|
127
|
+
}];
|
|
128
|
+
fixedWidths?: [number | null | undefined, number | null | undefined, number | null | undefined] | null | undefined;
|
|
129
|
+
columnsCount?: 2 | 3 | null | undefined;
|
|
130
|
+
columnsGap?: number | null | undefined;
|
|
131
|
+
contentAlignment?: "top" | "middle" | "bottom" | null | undefined;
|
|
132
|
+
} | null | undefined;
|
|
133
|
+
}>;
|
|
134
|
+
export default ColumnsContainerPropsSchema;
|
|
135
|
+
export type ColumnsContainerProps = z.infer<typeof ColumnsContainerPropsSchema>;
|
|
136
|
+
//# sourceMappingURL=ColumnsContainerPropsSchema.d.ts.map
|
|
@@ -0,0 +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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAa/B,CAAC;AAEH,eAAe,2BAA2B,CAAC;AAC3C,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ColumnsContainerPropsSchema as BaseColumnsContainerPropsSchema } from '@usewaypoint/block-columns-container';
|
|
3
|
+
const BasePropsShape = BaseColumnsContainerPropsSchema.shape.props.unwrap().unwrap().shape;
|
|
4
|
+
const ColumnsContainerPropsSchema = z.object({
|
|
5
|
+
style: BaseColumnsContainerPropsSchema.shape.style,
|
|
6
|
+
props: z
|
|
7
|
+
.object(Object.assign(Object.assign({}, BasePropsShape), { columns: z.tuple([
|
|
8
|
+
z.object({ childrenIds: z.array(z.string()) }),
|
|
9
|
+
z.object({ childrenIds: z.array(z.string()) }),
|
|
10
|
+
z.object({ childrenIds: z.array(z.string()) }),
|
|
11
|
+
]) }))
|
|
12
|
+
.optional()
|
|
13
|
+
.nullable(),
|
|
14
|
+
});
|
|
15
|
+
export default ColumnsContainerPropsSchema;
|
|
@@ -0,0 +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,qBAQrF"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import { ColumnsContainer as BaseColumnsContainer } from '@usewaypoint/block-columns-container';
|
|
14
|
+
import { ReaderBlock } from '../../Reader/core';
|
|
15
|
+
export default function ColumnsContainerReader({ style, props }) {
|
|
16
|
+
const _a = props !== null && props !== void 0 ? props : {}, { columns } = _a, restProps = __rest(_a, ["columns"]);
|
|
17
|
+
let cols = undefined;
|
|
18
|
+
if (columns) {
|
|
19
|
+
cols = columns.map((col) => col.childrenIds.map((childId) => React.createElement(ReaderBlock, { key: childId, id: childId })));
|
|
20
|
+
}
|
|
21
|
+
return React.createElement(BaseColumnsContainer, { props: restProps, columns: cols, style: style });
|
|
22
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ContainerPropsSchema: z.ZodObject<{
|
|
3
|
+
style: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
4
|
+
backgroundColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
5
|
+
borderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
6
|
+
borderRadius: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
7
|
+
padding: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
8
|
+
top: z.ZodNumber;
|
|
9
|
+
bottom: z.ZodNumber;
|
|
10
|
+
right: z.ZodNumber;
|
|
11
|
+
left: z.ZodNumber;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
top: number;
|
|
14
|
+
bottom: number;
|
|
15
|
+
right: number;
|
|
16
|
+
left: number;
|
|
17
|
+
}, {
|
|
18
|
+
top: number;
|
|
19
|
+
bottom: number;
|
|
20
|
+
right: number;
|
|
21
|
+
left: number;
|
|
22
|
+
}>>>;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
backgroundColor?: string | null | undefined;
|
|
25
|
+
borderColor?: string | null | undefined;
|
|
26
|
+
borderRadius?: number | null | undefined;
|
|
27
|
+
padding?: {
|
|
28
|
+
top: number;
|
|
29
|
+
bottom: number;
|
|
30
|
+
right: number;
|
|
31
|
+
left: number;
|
|
32
|
+
} | null | undefined;
|
|
33
|
+
}, {
|
|
34
|
+
backgroundColor?: string | null | undefined;
|
|
35
|
+
borderColor?: string | null | undefined;
|
|
36
|
+
borderRadius?: number | null | undefined;
|
|
37
|
+
padding?: {
|
|
38
|
+
top: number;
|
|
39
|
+
bottom: number;
|
|
40
|
+
right: number;
|
|
41
|
+
left: number;
|
|
42
|
+
} | null | undefined;
|
|
43
|
+
}>>>;
|
|
44
|
+
props: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
45
|
+
childrenIds: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
46
|
+
}, "strip", z.ZodTypeAny, {
|
|
47
|
+
childrenIds?: string[] | null | undefined;
|
|
48
|
+
}, {
|
|
49
|
+
childrenIds?: string[] | null | undefined;
|
|
50
|
+
}>>>;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
style?: {
|
|
53
|
+
backgroundColor?: string | null | undefined;
|
|
54
|
+
borderColor?: string | null | undefined;
|
|
55
|
+
borderRadius?: number | null | undefined;
|
|
56
|
+
padding?: {
|
|
57
|
+
top: number;
|
|
58
|
+
bottom: number;
|
|
59
|
+
right: number;
|
|
60
|
+
left: number;
|
|
61
|
+
} | null | undefined;
|
|
62
|
+
} | null | undefined;
|
|
63
|
+
props?: {
|
|
64
|
+
childrenIds?: string[] | null | undefined;
|
|
65
|
+
} | null | undefined;
|
|
66
|
+
}, {
|
|
67
|
+
style?: {
|
|
68
|
+
backgroundColor?: string | null | undefined;
|
|
69
|
+
borderColor?: string | null | undefined;
|
|
70
|
+
borderRadius?: number | null | undefined;
|
|
71
|
+
padding?: {
|
|
72
|
+
top: number;
|
|
73
|
+
bottom: number;
|
|
74
|
+
right: number;
|
|
75
|
+
left: number;
|
|
76
|
+
} | null | undefined;
|
|
77
|
+
} | null | undefined;
|
|
78
|
+
props?: {
|
|
79
|
+
childrenIds?: string[] | null | undefined;
|
|
80
|
+
} | null | undefined;
|
|
81
|
+
}>;
|
|
82
|
+
export type ContainerProps = z.infer<typeof ContainerPropsSchema>;
|
|
83
|
+
//# sourceMappingURL=ContainerPropsSchema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContainerPropsSchema.d.ts","sourceRoot":"","sources":["../../../src/blocks/Container/ContainerPropsSchema.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQ/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ContainerPropsSchema as BaseContainerPropsSchema } from '@usewaypoint/block-container';
|
|
3
|
+
export const ContainerPropsSchema = z.object({
|
|
4
|
+
style: BaseContainerPropsSchema.shape.style,
|
|
5
|
+
props: z
|
|
6
|
+
.object({
|
|
7
|
+
childrenIds: z.array(z.string()).optional().nullable(),
|
|
8
|
+
})
|
|
9
|
+
.optional()
|
|
10
|
+
.nullable(),
|
|
11
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContainerReader.d.ts","sourceRoot":"","sources":["../../../src/blocks/Container/ContainerReader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,cAAc,qBASvE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Container as BaseContainer } from '@usewaypoint/block-container';
|
|
3
|
+
import { ReaderBlock } from '../../Reader/core';
|
|
4
|
+
export default function ContainerReader({ style, props }) {
|
|
5
|
+
var _a;
|
|
6
|
+
const childrenIds = (_a = props === null || props === void 0 ? void 0 : props.childrenIds) !== null && _a !== void 0 ? _a : [];
|
|
7
|
+
return (React.createElement(BaseContainer, { style: style }, childrenIds.map((childId) => (React.createElement(ReaderBlock, { key: childId, id: childId })))));
|
|
8
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const EmailLayoutPropsSchema: z.ZodObject<{
|
|
3
|
+
backdropColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
4
|
+
borderColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
5
|
+
borderRadius: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
6
|
+
canvasColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
7
|
+
textColor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8
|
+
fontFamily: z.ZodOptional<z.ZodNullable<z.ZodEnum<["MODERN_SANS", "BOOK_SANS", "ORGANIC_SANS", "GEOMETRIC_SANS", "HEAVY_SANS", "ROUNDED_SANS", "MODERN_SERIF", "BOOK_SERIF", "MONOSPACE"]>>>;
|
|
9
|
+
childrenIds: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
backdropColor?: string | null | undefined;
|
|
12
|
+
borderColor?: string | null | undefined;
|
|
13
|
+
borderRadius?: number | null | undefined;
|
|
14
|
+
canvasColor?: string | null | undefined;
|
|
15
|
+
textColor?: string | null | undefined;
|
|
16
|
+
fontFamily?: "MODERN_SANS" | "BOOK_SANS" | "ORGANIC_SANS" | "GEOMETRIC_SANS" | "HEAVY_SANS" | "ROUNDED_SANS" | "MODERN_SERIF" | "BOOK_SERIF" | "MONOSPACE" | null | undefined;
|
|
17
|
+
childrenIds?: string[] | null | undefined;
|
|
18
|
+
}, {
|
|
19
|
+
backdropColor?: string | null | undefined;
|
|
20
|
+
borderColor?: string | null | undefined;
|
|
21
|
+
borderRadius?: number | null | undefined;
|
|
22
|
+
canvasColor?: string | null | undefined;
|
|
23
|
+
textColor?: string | null | undefined;
|
|
24
|
+
fontFamily?: "MODERN_SANS" | "BOOK_SANS" | "ORGANIC_SANS" | "GEOMETRIC_SANS" | "HEAVY_SANS" | "ROUNDED_SANS" | "MODERN_SERIF" | "BOOK_SERIF" | "MONOSPACE" | null | undefined;
|
|
25
|
+
childrenIds?: string[] | null | undefined;
|
|
26
|
+
}>;
|
|
27
|
+
export type EmailLayoutProps = z.infer<typeof EmailLayoutPropsSchema>;
|
|
28
|
+
//# sourceMappingURL=EmailLayoutPropsSchema.d.ts.map
|
|
@@ -0,0 +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;;;;;;;;;;;;;;;;;;;;;;;;EAQjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const COLOR_SCHEMA = z
|
|
3
|
+
.string()
|
|
4
|
+
.regex(/^#[0-9a-fA-F]{6}$/)
|
|
5
|
+
.nullable()
|
|
6
|
+
.optional();
|
|
7
|
+
const FONT_FAMILY_SCHEMA = z
|
|
8
|
+
.enum([
|
|
9
|
+
'MODERN_SANS',
|
|
10
|
+
'BOOK_SANS',
|
|
11
|
+
'ORGANIC_SANS',
|
|
12
|
+
'GEOMETRIC_SANS',
|
|
13
|
+
'HEAVY_SANS',
|
|
14
|
+
'ROUNDED_SANS',
|
|
15
|
+
'MODERN_SERIF',
|
|
16
|
+
'BOOK_SERIF',
|
|
17
|
+
'MONOSPACE',
|
|
18
|
+
])
|
|
19
|
+
.nullable()
|
|
20
|
+
.optional();
|
|
21
|
+
export const EmailLayoutPropsSchema = z.object({
|
|
22
|
+
backdropColor: COLOR_SCHEMA,
|
|
23
|
+
borderColor: COLOR_SCHEMA,
|
|
24
|
+
borderRadius: z.number().optional().nullable(),
|
|
25
|
+
canvasColor: COLOR_SCHEMA,
|
|
26
|
+
textColor: COLOR_SCHEMA,
|
|
27
|
+
fontFamily: FONT_FAMILY_SCHEMA,
|
|
28
|
+
childrenIds: z.array(z.string()).optional().nullable(),
|
|
29
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmailLayoutReader.d.ts","sourceRoot":"","sources":["../../../src/blocks/EmailLayout/EmailLayoutReader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAiC5D,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,qBA6ChE"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ReaderBlock } from '../../Reader/core';
|
|
3
|
+
function getFontFamily(fontFamily) {
|
|
4
|
+
const f = fontFamily !== null && fontFamily !== void 0 ? fontFamily : 'MODERN_SANS';
|
|
5
|
+
switch (f) {
|
|
6
|
+
case 'MODERN_SANS':
|
|
7
|
+
return '"Helvetica Neue", "Arial Nova", "Nimbus Sans", Arial, sans-serif';
|
|
8
|
+
case 'BOOK_SANS':
|
|
9
|
+
return 'Optima, Candara, "Noto Sans", source-sans-pro, sans-serif';
|
|
10
|
+
case 'ORGANIC_SANS':
|
|
11
|
+
return 'Seravek, "Gill Sans Nova", Ubuntu, Calibri, "DejaVu Sans", source-sans-pro, sans-serif';
|
|
12
|
+
case 'GEOMETRIC_SANS':
|
|
13
|
+
return 'Avenir, "Avenir Next LT Pro", Montserrat, Corbel, "URW Gothic", source-sans-pro, sans-serif';
|
|
14
|
+
case 'HEAVY_SANS':
|
|
15
|
+
return 'Bahnschrift, "DIN Alternate", "Franklin Gothic Medium", "Nimbus Sans Narrow", sans-serif-condensed, sans-serif';
|
|
16
|
+
case 'ROUNDED_SANS':
|
|
17
|
+
return 'ui-rounded, "Hiragino Maru Gothic ProN", Quicksand, Comfortaa, Manjari, "Arial Rounded MT Bold", Calibri, source-sans-pro, sans-serif';
|
|
18
|
+
case 'MODERN_SERIF':
|
|
19
|
+
return 'Charter, "Bitstream Charter", "Sitka Text", Cambria, serif';
|
|
20
|
+
case 'BOOK_SERIF':
|
|
21
|
+
return '"Iowan Old Style", "Palatino Linotype", "URW Palladio L", P052, serif';
|
|
22
|
+
case 'MONOSPACE':
|
|
23
|
+
return '"Nimbus Mono PS", "Courier New", "Cutive Mono", monospace';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function getBorder({ borderColor }) {
|
|
27
|
+
if (!borderColor) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
return `1px solid ${borderColor}`;
|
|
31
|
+
}
|
|
32
|
+
export default function EmailLayoutReader(props) {
|
|
33
|
+
var _a, _b, _c, _d, _e;
|
|
34
|
+
const childrenIds = (_a = props.childrenIds) !== null && _a !== void 0 ? _a : [];
|
|
35
|
+
return (React.createElement("div", { style: {
|
|
36
|
+
backgroundColor: (_b = props.backdropColor) !== null && _b !== void 0 ? _b : '#F5F5F5',
|
|
37
|
+
color: (_c = props.textColor) !== null && _c !== void 0 ? _c : '#262626',
|
|
38
|
+
fontFamily: getFontFamily(props.fontFamily),
|
|
39
|
+
fontSize: '16px',
|
|
40
|
+
fontWeight: '400',
|
|
41
|
+
letterSpacing: '0.15008px',
|
|
42
|
+
lineHeight: '1.5',
|
|
43
|
+
margin: '0',
|
|
44
|
+
padding: '32px 0',
|
|
45
|
+
minHeight: '100%',
|
|
46
|
+
width: '100%',
|
|
47
|
+
} },
|
|
48
|
+
React.createElement("table", { align: "center", width: "100%", style: {
|
|
49
|
+
margin: '0 auto',
|
|
50
|
+
maxWidth: '600px',
|
|
51
|
+
backgroundColor: (_d = props.canvasColor) !== null && _d !== void 0 ? _d : '#FFFFFF',
|
|
52
|
+
borderRadius: (_e = props.borderRadius) !== null && _e !== void 0 ? _e : undefined,
|
|
53
|
+
border: getBorder(props),
|
|
54
|
+
}, role: "presentation", cellSpacing: "0", cellPadding: "0", border: 0 },
|
|
55
|
+
React.createElement("tbody", null,
|
|
56
|
+
React.createElement("tr", { style: { width: '100%' } },
|
|
57
|
+
React.createElement("td", null, childrenIds.map((childId) => (React.createElement(ReaderBlock, { key: childId, id: childId })))))))));
|
|
58
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as renderToStaticMarkup } from './renderers/renderToStaticMarkup';
|
|
2
|
+
export { ReaderBlockSchema, ReaderDocumentSchema, ReaderBlock, default as Reader, } from './Reader/core';
|
|
3
|
+
export type { TReaderBlock, TReaderDocument, TReaderBlockProps, TReaderProps, } from './Reader/core';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAEnF,OAAO,EACL,iBAAiB,EAEjB,oBAAoB,EAEpB,WAAW,EACX,OAAO,IAAI,MAAM,GAClB,MAAM,eAAe,CAAC;AAEvB,YAAY,EACV,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,YAAY,GACb,MAAM,eAAe,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TReaderDocument } from '../Reader/core';
|
|
2
|
+
type TOptions = {
|
|
3
|
+
rootBlockId: string;
|
|
4
|
+
};
|
|
5
|
+
export default function renderToStaticMarkup(document: TReaderDocument, { rootBlockId }: TOptions): string;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=renderToStaticMarkup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderToStaticMarkup.d.ts","sourceRoot":"","sources":["../../src/renderers/renderToStaticMarkup.tsx"],"names":[],"mappings":"AAGA,OAAe,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEzD,KAAK,QAAQ,GAAG;IACd,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AACF,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,QAAQ,EAAE,eAAe,EAAE,EAAE,WAAW,EAAE,EAAE,QAAQ,UAWhG"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { renderToStaticMarkup as baseRenderToStaticMarkup } from 'react-dom/server';
|
|
3
|
+
import Reader from '../Reader/core';
|
|
4
|
+
export default function renderToStaticMarkup(document, { rootBlockId }) {
|
|
5
|
+
return ('<!DOCTYPE html>' +
|
|
6
|
+
baseRenderToStaticMarkup(React.createElement("html", null,
|
|
7
|
+
React.createElement("body", null,
|
|
8
|
+
React.createElement(Reader, { document: document, rootBlockId: rootBlockId })))));
|
|
9
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "monto-email-core",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "React component to render email messages",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"require": "./dist/index.js",
|
|
11
|
+
"import": "./dist/index.mjs",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "npx tsc"
|
|
20
|
+
},
|
|
21
|
+
"author": "heiheihoho1213",
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"react": "^16 || ^17 || ^18",
|
|
25
|
+
"react-dom": "^16 || ^17 || ^18",
|
|
26
|
+
"zod": "^1 || ^2 || ^3"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/react": "^16 || ^17 || ^18",
|
|
30
|
+
"@types/react-dom": "^18.3.7",
|
|
31
|
+
"react": "^16 || ^17 || ^18",
|
|
32
|
+
"react-dom": "^16 || ^17 || ^18",
|
|
33
|
+
"typescript": "^5.0.0",
|
|
34
|
+
"zod": "^1 || ^2 || ^3"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@usewaypoint/block-avatar": "0.0.3",
|
|
38
|
+
"@usewaypoint/block-button": "0.0.3",
|
|
39
|
+
"@usewaypoint/block-columns-container": "0.0.3",
|
|
40
|
+
"@usewaypoint/block-container": "0.0.2",
|
|
41
|
+
"@usewaypoint/block-divider": "0.0.4",
|
|
42
|
+
"@usewaypoint/block-heading": "0.0.3",
|
|
43
|
+
"@usewaypoint/block-html": "0.0.3",
|
|
44
|
+
"@usewaypoint/block-image": "0.0.5",
|
|
45
|
+
"@usewaypoint/block-spacer": "0.0.3",
|
|
46
|
+
"@usewaypoint/block-text": "0.0.6",
|
|
47
|
+
"@usewaypoint/document-core": "0.0.6",
|
|
48
|
+
"monto-email-block-video": "0.0.1"
|
|
49
|
+
}
|
|
50
|
+
}
|