@rudyzeinoun/email-builder 0.0.9 → 0.0.11

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.
Files changed (31) hide show
  1. package/dist/Reader/core.d.mts +1856 -0
  2. package/dist/Reader/core.mjs +80 -0
  3. package/dist/Reader/core.mjs.map +1 -0
  4. package/dist/blocks/ColumnsContainer/ColumnsContainerPropsSchema.d.mts +136 -0
  5. package/dist/blocks/ColumnsContainer/ColumnsContainerPropsSchema.mjs +16 -0
  6. package/dist/blocks/ColumnsContainer/ColumnsContainerPropsSchema.mjs.map +1 -0
  7. package/dist/blocks/ColumnsContainer/ColumnsContainerReader.d.mts +4 -0
  8. package/dist/blocks/ColumnsContainer/ColumnsContainerReader.mjs +23 -0
  9. package/dist/blocks/ColumnsContainer/ColumnsContainerReader.mjs.map +1 -0
  10. package/dist/blocks/Container/ContainerPropsSchema.d.mts +83 -0
  11. package/dist/blocks/Container/ContainerPropsSchema.mjs +12 -0
  12. package/dist/blocks/Container/ContainerPropsSchema.mjs.map +1 -0
  13. package/dist/blocks/Container/ContainerReader.d.mts +4 -0
  14. package/dist/blocks/Container/ContainerReader.mjs +9 -0
  15. package/dist/blocks/Container/ContainerReader.mjs.map +1 -0
  16. package/dist/blocks/EmailLayout/EmailLayoutPropsSchema.d.mts +28 -0
  17. package/dist/blocks/EmailLayout/EmailLayoutPropsSchema.mjs +30 -0
  18. package/dist/blocks/EmailLayout/EmailLayoutPropsSchema.mjs.map +1 -0
  19. package/dist/blocks/EmailLayout/EmailLayoutReader.d.mts +4 -0
  20. package/dist/blocks/EmailLayout/EmailLayoutReader.mjs +59 -0
  21. package/dist/blocks/EmailLayout/EmailLayoutReader.mjs.map +1 -0
  22. package/dist/index.d.mts +3 -0
  23. package/dist/index.mjs +7 -0
  24. package/dist/index.mjs.map +1 -0
  25. package/dist/renderers/renderToStaticMarkup.d.mts +7 -0
  26. package/dist/renderers/renderToStaticMarkup.mjs +10 -0
  27. package/dist/renderers/renderToStaticMarkup.mjs.map +1 -0
  28. package/dist/renderers/renderToStaticMarkup.spec.d.mts +5 -0
  29. package/dist/renderers/renderToStaticMarkup.spec.mjs +20 -0
  30. package/dist/renderers/renderToStaticMarkup.spec.mjs.map +1 -0
  31. package/package.json +2 -2
@@ -0,0 +1,80 @@
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 { buildBlockComponent, buildBlockConfigurationDictionary, buildBlockConfigurationSchema, } from '@usewaypoint/document-core';
12
+ import ColumnsContainerPropsSchema from '../blocks/ColumnsContainer/ColumnsContainerPropsSchema.mjs';
13
+ import ColumnsContainerReader from '../blocks/ColumnsContainer/ColumnsContainerReader.mjs';
14
+ import { ContainerPropsSchema } from '../blocks/Container/ContainerPropsSchema.mjs';
15
+ import ContainerReader from '../blocks/Container/ContainerReader.mjs';
16
+ import { EmailLayoutPropsSchema } from '../blocks/EmailLayout/EmailLayoutPropsSchema.mjs';
17
+ import EmailLayoutReader from '../blocks/EmailLayout/EmailLayoutReader.mjs';
18
+ const ReaderContext = createContext({});
19
+ function useReaderDocument() {
20
+ return useContext(ReaderContext);
21
+ }
22
+ const READER_DICTIONARY = buildBlockConfigurationDictionary({
23
+ ColumnsContainer: {
24
+ schema: ColumnsContainerPropsSchema,
25
+ Component: ColumnsContainerReader,
26
+ },
27
+ Container: {
28
+ schema: ContainerPropsSchema,
29
+ Component: ContainerReader,
30
+ },
31
+ EmailLayout: {
32
+ schema: EmailLayoutPropsSchema,
33
+ Component: EmailLayoutReader,
34
+ },
35
+ //
36
+ Avatar: {
37
+ schema: AvatarPropsSchema,
38
+ Component: Avatar,
39
+ },
40
+ Button: {
41
+ schema: ButtonPropsSchema,
42
+ Component: Button,
43
+ },
44
+ Divider: {
45
+ schema: DividerPropsSchema,
46
+ Component: Divider,
47
+ },
48
+ Heading: {
49
+ schema: HeadingPropsSchema,
50
+ Component: Heading,
51
+ },
52
+ Html: {
53
+ schema: HtmlPropsSchema,
54
+ Component: Html,
55
+ },
56
+ Image: {
57
+ schema: ImagePropsSchema,
58
+ Component: Image,
59
+ },
60
+ Spacer: {
61
+ schema: SpacerPropsSchema,
62
+ Component: Spacer,
63
+ },
64
+ Text: {
65
+ schema: TextPropsSchema,
66
+ Component: Text,
67
+ },
68
+ });
69
+ export const ReaderBlockSchema = buildBlockConfigurationSchema(READER_DICTIONARY);
70
+ export const ReaderDocumentSchema = z.record(z.string(), ReaderBlockSchema);
71
+ const BaseReaderBlock = buildBlockComponent(READER_DICTIONARY);
72
+ export function ReaderBlock({ id }) {
73
+ const document = useReaderDocument();
74
+ return React.createElement(BaseReaderBlock, Object.assign({}, document[id]));
75
+ }
76
+ export default function Reader({ document, rootBlockId }) {
77
+ return (React.createElement(ReaderContext.Provider, { value: document },
78
+ React.createElement(ReaderBlock, { id: rootBlockId })));
79
+ }
80
+ //# sourceMappingURL=core.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.mjs","sourceRoot":"","sources":["../../src/Reader/core.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,2BAA2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chema: 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,16 @@
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;
16
+ //# sourceMappingURL=ColumnsContainerPropsSchema.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColumnsContainerPropsSchema.mjs","sourceRoot":"","sources":["../../../src/blocks/ColumnsContainer/ColumnsContainerPropsSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,2BAA2B,IAAI,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AAEtH,MAAM,cAAc,GAAG,+BAA+B,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC;AAE3F,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,KAAK,EAAE,+BAA+B,CAAC,KAAK,CAAC,KAAK;IAClD,KAAK,EAAE,CAAC;SACL,MAAM,iCACF,cAAc,KACjB,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC;YACf,CAAC,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC;YAC9C,CAAC,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC;YAC9C,CAAC,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC;SAC/C,CAAC,IACF;SACD,QAAQ,EAAE;SACV,QAAQ,EAAE;CACd,CAAC,CAAC;AAEH,eAAe,2BAA2B,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { ColumnsContainerProps } from './ColumnsContainerPropsSchema';
3
+ export default function ColumnsContainerReader({ style, props }: ColumnsContainerProps): React.JSX.Element;
4
+ //# sourceMappingURL=ColumnsContainerReader.d.ts.map
@@ -0,0 +1,23 @@
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.mjs';
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
+ }
23
+ //# sourceMappingURL=ColumnsContainerReader.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColumnsContainerReader.mjs","sourceRoot":"","sources":["../../../src/blocks/ColumnsContainer/ColumnsContainerReader.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,gBAAgB,IAAI,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAEhG,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhD,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAyB;IACpF,MAAM,KAA4B,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,EAAvC,EAAE,OAAO,OAA8B,EAAzB,SAAS,cAAvB,WAAyB,CAAc,CAAC;IAC9C,IAAI,IAAI,GAAG,SAAS,CAAC;IACrB,IAAI,OAAO,EAAE,CAAC;QACZ,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,oBAAC,WAAW,IAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,GAAI,CAAC,CAAC,CAAC;IAC5G,CAAC;IAED,OAAO,oBAAC,oBAAoB,IAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,GAAI,CAAC;AACjF,CAAC"}
@@ -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,12 @@
1
+ import { z } from 'zod';
2
+ import { ContainerPropsSchema as BaseContainerPropsSchema } from '@rudyzeinoun/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
+ });
12
+ //# sourceMappingURL=ContainerPropsSchema.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContainerPropsSchema.mjs","sourceRoot":"","sources":["../../../src/blocks/Container/ContainerPropsSchema.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,oBAAoB,IAAI,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAEhG,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,KAAK,EAAE,wBAAwB,CAAC,KAAK,CAAC,KAAK;IAC3C,KAAK,EAAE,CAAC;SACL,MAAM,CAAC;QACN,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;KACvD,CAAC;SACD,QAAQ,EAAE;SACV,QAAQ,EAAE;CACd,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { ContainerProps } from './ContainerPropsSchema';
3
+ export default function ContainerReader({ style, props }: ContainerProps): React.JSX.Element;
4
+ //# sourceMappingURL=ContainerReader.d.ts.map
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { Container as BaseContainer } from '@rudyzeinoun/block-container';
3
+ import { ReaderBlock } from '../../Reader/core.mjs';
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
+ }
9
+ //# sourceMappingURL=ContainerReader.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContainerReader.mjs","sourceRoot":"","sources":["../../../src/blocks/Container/ContainerReader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE1E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhD,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EAAE,KAAK,EAAE,KAAK,EAAkB;;IACtE,MAAM,WAAW,GAAG,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,WAAW,mCAAI,EAAE,CAAC;IAC7C,OAAO,CACL,oBAAC,aAAa,IAAC,KAAK,EAAE,KAAK,IACxB,WAAW,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAC5B,oBAAC,WAAW,IAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,GAAI,CAC3C,CAAC,CACY,CACjB,CAAC;AACJ,CAAC"}
@@ -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,30 @@
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
+ });
30
+ //# sourceMappingURL=EmailLayoutPropsSchema.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmailLayoutPropsSchema.mjs","sourceRoot":"","sources":["../../../src/blocks/EmailLayout/EmailLayoutPropsSchema.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,YAAY,GAAG,CAAC;KACnB,MAAM,EAAE;KACR,KAAK,CAAC,mBAAmB,CAAC;KAC1B,QAAQ,EAAE;KACV,QAAQ,EAAE,CAAC;AAEd,MAAM,kBAAkB,GAAG,CAAC;KACzB,IAAI,CAAC;IACJ,aAAa;IACb,WAAW;IACX,cAAc;IACd,gBAAgB;IAChB,YAAY;IACZ,cAAc;IACd,cAAc;IACd,YAAY;IACZ,WAAW;CACZ,CAAC;KACD,QAAQ,EAAE;KACV,QAAQ,EAAE,CAAC;AAEd,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,aAAa,EAAE,YAAY;IAC3B,WAAW,EAAE,YAAY;IACzB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC9C,WAAW,EAAE,YAAY;IACzB,SAAS,EAAE,YAAY;IACvB,UAAU,EAAE,kBAAkB;IAC9B,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CACvD,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { EmailLayoutProps } from './EmailLayoutPropsSchema';
3
+ export default function EmailLayoutReader(props: EmailLayoutProps): React.JSX.Element;
4
+ //# sourceMappingURL=EmailLayoutReader.d.ts.map
@@ -0,0 +1,59 @@
1
+ import React from 'react';
2
+ import { ReaderBlock } from '../../Reader/core.mjs';
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
+ }
59
+ //# sourceMappingURL=EmailLayoutReader.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmailLayoutReader.mjs","sourceRoot":"","sources":["../../../src/blocks/EmailLayout/EmailLay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C1B,UAAU,EAAE,KAAK;YACjB,MAAM,EAAE,GAAG;YACX,OAAO,EAAE,QAAQ;YACjB,SAAS,EAAE,MAAM;YACjB,KAAK,EAAE,MAAM;SACd;QAED,+BACE,KAAK,EAAC,QAAQ,EACd,KAAK,EAAC,MAAM,EACZ,KAAK,EAAE;gBACL,MAAM,EAAE,QAAQ;gBAChB,QAAQ,EAAE,OAAO;gBACjB,eAAe,EAAE,MAAA,KAAK,CAAC,WAAW,mCAAI,SAAS;gBAC/C,YAAY,EAAE,MAAA,KAAK,CAAC,YAAY,mCAAI,SAAS;gBAC7C,MAAM,EAAE,SAAS,CAAC,KAAK,CAAC;aACzB,EACD,IAAI,EAAC,cAAc,EACnB,WAAW,EAAC,GAAG,EACf,WAAW,EAAC,GAAG,EACf,MAAM,EAAE,CAAC;YAET;gBACE,4BAAI,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;oBAC1B,gCACG,WAAW,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAC5B,oBAAC,WAAW,IAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,GAAI,CAC3C,CAAC,CACC,CACF,CACC,CACF,CACJ,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { default as renderToStaticMarkup } from './renderers/renderToStaticMarkup';
2
+ export { ReaderBlockSchema, TReaderBlock, ReaderDocumentSchema, TReaderDocument, ReaderBlock, TReaderBlockProps, TReaderProps, default as Reader, } from './Reader/core';
3
+ //# sourceMappingURL=index.d.ts.map
package/dist/index.mjs ADDED
@@ -0,0 +1,7 @@
1
+ export { default as renderToStaticMarkup } from './renderers/renderToStaticMarkup.mjs';
2
+ export { ReaderBlockSchema,
3
+ //
4
+ ReaderDocumentSchema,
5
+ //
6
+ ReaderBlock, default as Reader, } from './Reader/core.mjs';
7
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAEnF,OAAO,EACL,iBAAiB;AAEjB,EAAE;AACF,oBAAoB;AAEpB,EAAE;AACF,WAAW,EAIX,OAAO,IAAI,MAAM,GAClB,MAAM,eAAe,CAAC"}
@@ -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,10 @@
1
+ import React from 'react';
2
+ import { renderToStaticMarkup as baseRenderToStaticMarkup } from 'react-dom/server';
3
+ import Reader from '../Reader/core.mjs';
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
+ }
10
+ //# sourceMappingURL=renderToStaticMarkup.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderToStaticMarkup.mjs","sourceRoot":"","sources":["../../src/renderers/renderToStaticMarkup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,oBAAoB,IAAI,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAEpF,OAAO,MAA2B,MAAM,gBAAgB,CAAC;AAKzD,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,QAAyB,EAAE,EAAE,WAAW,EAAY;IAC/F,OAAO,CACL,iBAAiB;QACjB,wBAAwB,CACtB;YACE;gBACE,oBAAC,MAAM,IAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,GAAI,CACnD,CACF,CACR,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @jest-environment node
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=renderToStaticMarkup.spec.d.ts.map
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @jest-environment node
3
+ */
4
+ import renderToStaticMarkup from './renderToStaticMarkup.mjs';
5
+ describe('renderToStaticMarkup', () => {
6
+ it('renders into a string', () => {
7
+ const result = renderToStaticMarkup({
8
+ root: {
9
+ type: 'Container',
10
+ data: {
11
+ props: {
12
+ childrenIds: [],
13
+ },
14
+ },
15
+ },
16
+ }, { rootBlockId: 'root' });
17
+ expect(result).toEqual('<!DOCTYPE html><html><body><div></div></body></html>');
18
+ });
19
+ });
20
+ //# sourceMappingURL=renderToStaticMarkup.spec.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderToStaticMarkup.spec.mjs","sourceRoot":"","sources":["../../src/renderers/renderToStaticMarkup.spec.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAE1D,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,EAAE,CAAC,uBAAuB,EAAE,GAAG,EAAE;QAC/B,MAAM,MAAM,GAAG,oBAAoB,CACjC;YACE,IAAI,EAAE;gBACJ,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE;oBACJ,KAAK,EAAE;wBACL,WAAW,EAAE,EAAE;qBAChB;iBACF;aACF;SACF,EACD,EAAE,WAAW,EAAE,MAAM,EAAE,CACxB,CAAC;QACF,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,sDAAsD,CAAC,CAAC;IACjF,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rudyzeinoun/email-builder",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "description": "React component to render email messages",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -26,7 +26,7 @@
26
26
  "zod": "^1 || ^2 || ^3"
27
27
  },
28
28
  "dependencies": {
29
- "@rudyzeinoun/block-container": "^0.0.3",
29
+ "@rudyzeinoun/block-container": "^0.0.5",
30
30
  "@usewaypoint/block-avatar": "^0.0.3",
31
31
  "@usewaypoint/block-button": "^0.0.3",
32
32
  "@usewaypoint/block-columns-container": "^0.0.3",