mjml-blocks 4.11.0 → 4.13.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/README.md +4 -7
- package/dist/index.d.ts +23 -21
- package/dist/index.js +23 -21
- package/dist/models/MjmlAccordionElementNode.d.ts +1 -1
- package/dist/models/MjmlAccordionElementProps.d.ts +11 -11
- package/dist/models/MjmlAccordionNode.d.ts +1 -1
- package/dist/models/MjmlAccordionProps.d.ts +16 -16
- package/dist/models/MjmlAccordionTextNode.d.ts +1 -1
- package/dist/models/MjmlAccordionTextProps.d.ts +12 -12
- package/dist/models/MjmlAccordionTitleNode.d.ts +1 -1
- package/dist/models/MjmlAccordionTitleProps.d.ts +10 -10
- package/dist/models/MjmlAttributeField.d.ts +1 -1
- package/dist/models/MjmlAttributeKind.d.ts +9 -8
- package/dist/models/MjmlAttributeKind.js +8 -9
- package/dist/models/MjmlAttributeType.d.ts +6 -6
- package/dist/models/MjmlBlockTypeDefinition.d.ts +3 -3
- package/dist/models/MjmlButtonNode.d.ts +1 -1
- package/dist/models/MjmlButtonProps.d.ts +33 -33
- package/dist/models/MjmlCarouselImageNode.d.ts +1 -1
- package/dist/models/MjmlCarouselImageProps.d.ts +11 -11
- package/dist/models/MjmlCarouselNode.d.ts +1 -1
- package/dist/models/MjmlCarouselProps.d.ts +17 -17
- package/dist/models/MjmlColumnNode.d.ts +1 -1
- package/dist/models/MjmlColumnProps.d.ts +22 -22
- package/dist/models/MjmlContentKind.d.ts +6 -5
- package/dist/models/MjmlContentKind.js +5 -6
- package/dist/models/MjmlDirection.d.ts +6 -5
- package/dist/models/MjmlDirection.js +5 -6
- package/dist/models/MjmlDividerNode.d.ts +1 -1
- package/dist/models/MjmlDividerProps.d.ts +11 -11
- package/dist/models/MjmlGroupNode.d.ts +1 -1
- package/dist/models/MjmlGroupProps.d.ts +4 -4
- package/dist/models/MjmlHeroNode.d.ts +1 -1
- package/dist/models/MjmlHeroProps.d.ts +20 -20
- package/dist/models/MjmlImageNode.d.ts +1 -1
- package/dist/models/MjmlImageProps.d.ts +29 -29
- package/dist/models/MjmlNavbarLinkNode.d.ts +1 -1
- package/dist/models/MjmlNavbarLinkProps.d.ts +18 -18
- package/dist/models/MjmlNavbarNode.d.ts +1 -1
- package/dist/models/MjmlNavbarProps.d.ts +22 -22
- package/dist/models/MjmlNodeType.d.ts +25 -24
- package/dist/models/MjmlNodeType.js +24 -25
- package/dist/models/MjmlRawNode.d.ts +1 -1
- package/dist/models/MjmlRawProps.d.ts +1 -1
- package/dist/models/MjmlRenderSpecification.d.ts +1 -1
- package/dist/models/MjmlRichText.d.ts +1 -1
- package/dist/models/MjmlRootProps.d.ts +9 -9
- package/dist/models/MjmlSectionNode.d.ts +1 -1
- package/dist/models/MjmlSectionProps.d.ts +23 -23
- package/dist/models/MjmlSocialElementNode.d.ts +1 -1
- package/dist/models/MjmlSocialElementProps.d.ts +31 -31
- package/dist/models/MjmlSocialNode.d.ts +1 -1
- package/dist/models/MjmlSocialProps.d.ts +24 -24
- package/dist/models/MjmlSpacerNode.d.ts +1 -1
- package/dist/models/MjmlSpacerProps.d.ts +12 -12
- package/dist/models/MjmlTableNode.d.ts +1 -1
- package/dist/models/MjmlTableProps.d.ts +19 -19
- package/dist/models/MjmlTextNode.d.ts +1 -1
- package/dist/models/MjmlTextProps.d.ts +19 -19
- package/dist/models/MjmlWrapperNode.d.ts +1 -1
- package/dist/models/MjmlWrapperProps.d.ts +24 -24
- package/dist/services/MjmlContentKindSchemaMap.d.ts +2 -2
- package/dist/services/MjmlContentKindSchemaMap.js +3 -3
- package/dist/services/checkMjmlAlternativeText.d.ts +2 -2
- package/dist/services/components/createMjmlAccordionTextPropsSchema.d.ts +1 -1
- package/dist/services/components/createMjmlAccordionTextType.js +2 -2
- package/dist/services/components/createMjmlRichTextType.js +3 -3
- package/dist/services/components/createMjmlTextPropsSchema.d.ts +1 -1
- package/dist/services/components/createMjmlTextType.js +2 -2
- package/dist/services/components/mjAccordion.d.ts +1 -1
- package/dist/services/components/mjAccordion.js +6 -5
- package/dist/services/components/mjAccordionElement.d.ts +3 -2
- package/dist/services/components/mjAccordionElement.js +7 -7
- package/dist/services/components/mjAccordionTitle.d.ts +1 -1
- package/dist/services/components/mjAccordionTitle.js +9 -8
- package/dist/services/components/mjButton.d.ts +1 -1
- package/dist/services/components/mjButton.js +9 -8
- package/dist/services/components/mjCarousel.d.ts +1 -1
- package/dist/services/components/mjCarousel.js +6 -5
- package/dist/services/components/mjCarouselImage.d.ts +3 -2
- package/dist/services/components/mjCarouselImage.js +4 -4
- package/dist/services/components/mjColumn.d.ts +1 -1
- package/dist/services/components/mjColumn.js +16 -15
- package/dist/services/components/mjDivider.d.ts +1 -1
- package/dist/services/components/mjDivider.js +5 -4
- package/dist/services/components/mjGroup.d.ts +3 -2
- package/dist/services/components/mjGroup.js +5 -5
- package/dist/services/components/mjHero.d.ts +1 -1
- package/dist/services/components/mjHero.js +16 -15
- package/dist/services/components/mjImage.d.ts +1 -1
- package/dist/services/components/mjImage.js +5 -4
- package/dist/services/components/mjNavbar.d.ts +1 -1
- package/dist/services/components/mjNavbar.js +6 -5
- package/dist/services/components/mjNavbarLink.d.ts +1 -1
- package/dist/services/components/mjNavbarLink.js +9 -8
- package/dist/services/components/mjRaw.d.ts +3 -2
- package/dist/services/components/mjRaw.js +8 -8
- package/dist/services/components/mjSection.js +6 -6
- package/dist/services/components/mjSocial.d.ts +1 -1
- package/dist/services/components/mjSocial.js +6 -5
- package/dist/services/components/mjSocialElement.d.ts +1 -1
- package/dist/services/components/mjSocialElement.js +9 -8
- package/dist/services/components/mjSpacer.d.ts +1 -1
- package/dist/services/components/mjSpacer.js +5 -4
- package/dist/services/components/mjTable.d.ts +1 -1
- package/dist/services/components/mjTable.js +9 -8
- package/dist/services/components/mjWrapper.d.ts +0 -5
- package/dist/services/components/mjWrapper.js +7 -7
- package/dist/services/constants.d.ts +1 -1
- package/dist/services/constants.js +7 -11
- package/dist/services/createMjmlDocumentSchema.d.ts +1 -1
- package/dist/services/createMjmlRootPropsSchema.js +2 -1
- package/dist/services/createMjmlSlotSchema.js +1 -1
- package/dist/services/createTypeSchema.js +7 -7
- package/dist/services/getFilledMjmlAttributes.d.ts +1 -0
- package/dist/services/getFilledMjmlAttributes.js +3 -0
- package/dist/services/mjmlNodeChildren.js +23 -23
- package/dist/services/mjmlNodeSchema.js +23 -23
- package/dist/services/mjmlRootPropsSchema.d.ts +2 -2
- package/dist/services/mjmlRootPropsSchema.js +2 -2
- package/dist/services/parseMjmlAttributeType.js +7 -7
- package/dist/services/parseMjmlDocument.js +2 -1
- package/dist/services/readMjmlContent.d.ts +1 -1
- package/dist/services/readMjmlContent.js +4 -4
- package/dist/services/readMjmlNode.js +2 -1
- package/dist/services/readMjmlNodes.js +2 -1
- package/dist/services/readMjmlRoot.js +2 -1
- package/dist/services/readMjmlRootProps.d.ts +1 -0
- package/dist/services/readMjmlRootProps.js +7 -0
- package/dist/services/renderMjmlDocument.js +3 -2
- package/dist/services/renderMjmlHead.js +1 -1
- package/dist/services/renderMjmlNode.js +8 -8
- package/package.json +7 -6
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import "../../models/MjmlContentKind.js";
|
|
2
|
-
import "../../models/MjmlNodeType.js";
|
|
1
|
+
import { MjmlContentKind } from "../../models/MjmlContentKind.js";
|
|
2
|
+
import { MjmlNodeType } from "../../models/MjmlNodeType.js";
|
|
3
3
|
import { MJML_PADDING_ATTRIBUTES } from "../constants.js";
|
|
4
4
|
import { createMjmlAttributeShape } from "../createMjmlAttributeShape.js";
|
|
5
5
|
import { MjmlContentKindSchemaMap } from "../MjmlContentKindSchemaMap.js";
|
|
6
6
|
import { renderMjmlNode } from "../renderMjmlNode.js";
|
|
7
7
|
import { z } from "zod";
|
|
8
|
+
// src/services/components/mjAccordionTitle.ts
|
|
8
9
|
const accordionTitleAttributes = {
|
|
9
10
|
"background-color": "color",
|
|
10
11
|
color: "color",
|
|
@@ -16,27 +17,27 @@ const accordionTitleAttributes = {
|
|
|
16
17
|
};
|
|
17
18
|
const accordionTitlePropsSchema = z.strictObject({
|
|
18
19
|
...createMjmlAttributeShape(accordionTitleAttributes),
|
|
19
|
-
content: MjmlContentKindSchemaMap[
|
|
20
|
+
content: MjmlContentKindSchemaMap[MjmlContentKind.Label]
|
|
20
21
|
});
|
|
21
22
|
const mjmlAccordionTitleTypeFields = {
|
|
22
23
|
allowedAttributes: accordionTitleAttributes,
|
|
23
|
-
contentKind:
|
|
24
|
+
contentKind: MjmlContentKind.Label,
|
|
24
25
|
defaultAttributes: {
|
|
25
26
|
"font-size": "13px",
|
|
26
27
|
padding: "16px"
|
|
27
28
|
},
|
|
28
|
-
formSchema: z.strictObject({ content: MjmlContentKindSchemaMap[
|
|
29
|
+
formSchema: z.strictObject({ content: MjmlContentKindSchemaMap[MjmlContentKind.Label] }),
|
|
29
30
|
hasAlternativeText: false,
|
|
30
31
|
propsSchema: accordionTitlePropsSchema,
|
|
31
32
|
slots: {},
|
|
32
|
-
type:
|
|
33
|
+
type: MjmlNodeType.AccordionTitle
|
|
33
34
|
};
|
|
34
35
|
const mjmlAccordionTitleType = {
|
|
35
36
|
...mjmlAccordionTitleTypeFields,
|
|
36
37
|
render: renderMjmlNode({
|
|
37
38
|
...mjmlAccordionTitleTypeFields,
|
|
38
39
|
hasChildren: false,
|
|
39
|
-
tagName:
|
|
40
|
+
tagName: MjmlNodeType.AccordionTitle
|
|
40
41
|
})
|
|
41
42
|
};
|
|
42
|
-
export {
|
|
43
|
+
export { accordionTitlePropsSchema, mjmlAccordionTitleType };
|
|
@@ -34,7 +34,7 @@ declare const buttonBaseAttributes: {
|
|
|
34
34
|
"vertical-align": string;
|
|
35
35
|
width: string;
|
|
36
36
|
};
|
|
37
|
-
|
|
37
|
+
declare const buttonAttributes: typeof buttonBaseAttributes & typeof MJML_PADDING_ATTRIBUTES;
|
|
38
38
|
export declare const buttonPropsSchema: z.ZodObject<{ [K in keyof typeof buttonAttributes]: MjmlAttributeSchema; } & {
|
|
39
39
|
content: z.ZodString;
|
|
40
40
|
}, z.core.$strict>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import "../../models/MjmlContentKind.js";
|
|
2
|
-
import "../../models/MjmlNodeType.js";
|
|
1
|
+
import { MjmlContentKind } from "../../models/MjmlContentKind.js";
|
|
2
|
+
import { MjmlNodeType } from "../../models/MjmlNodeType.js";
|
|
3
3
|
import { MJML_PADDING_ATTRIBUTES } from "../constants.js";
|
|
4
4
|
import { createMjmlAttributeShape } from "../createMjmlAttributeShape.js";
|
|
5
5
|
import { MjmlContentKindSchemaMap } from "../MjmlContentKindSchemaMap.js";
|
|
6
6
|
import { renderMjmlNode } from "../renderMjmlNode.js";
|
|
7
7
|
import { z } from "zod";
|
|
8
|
+
// src/services/components/mjButton.ts
|
|
8
9
|
const buttonAttributes = {
|
|
9
10
|
align: "enum(left,center,right)",
|
|
10
11
|
"background-color": "color",
|
|
@@ -39,11 +40,11 @@ const buttonAttributes = {
|
|
|
39
40
|
};
|
|
40
41
|
const buttonPropsSchema = z.strictObject({
|
|
41
42
|
...createMjmlAttributeShape(buttonAttributes),
|
|
42
|
-
content: MjmlContentKindSchemaMap[
|
|
43
|
+
content: MjmlContentKindSchemaMap[MjmlContentKind.Label]
|
|
43
44
|
});
|
|
44
45
|
const mjmlButtonTypeFields = {
|
|
45
46
|
allowedAttributes: buttonAttributes,
|
|
46
|
-
contentKind:
|
|
47
|
+
contentKind: MjmlContentKind.Label,
|
|
47
48
|
defaultAttributes: {
|
|
48
49
|
align: "center",
|
|
49
50
|
"background-color": "#414141",
|
|
@@ -61,18 +62,18 @@ const mjmlButtonTypeFields = {
|
|
|
61
62
|
"text-transform": "none",
|
|
62
63
|
"vertical-align": "middle"
|
|
63
64
|
},
|
|
64
|
-
formSchema: z.strictObject({ content: MjmlContentKindSchemaMap[
|
|
65
|
+
formSchema: z.strictObject({ content: MjmlContentKindSchemaMap[MjmlContentKind.Label] }),
|
|
65
66
|
hasAlternativeText: false,
|
|
66
67
|
propsSchema: buttonPropsSchema,
|
|
67
68
|
slots: {},
|
|
68
|
-
type:
|
|
69
|
+
type: MjmlNodeType.Button
|
|
69
70
|
};
|
|
70
71
|
const mjmlButtonType = {
|
|
71
72
|
...mjmlButtonTypeFields,
|
|
72
73
|
render: renderMjmlNode({
|
|
73
74
|
...mjmlButtonTypeFields,
|
|
74
75
|
hasChildren: false,
|
|
75
|
-
tagName:
|
|
76
|
+
tagName: MjmlNodeType.Button
|
|
76
77
|
})
|
|
77
78
|
};
|
|
78
|
-
export {
|
|
79
|
+
export { buttonPropsSchema, mjmlButtonType };
|
|
@@ -18,7 +18,7 @@ declare const carouselBaseAttributes: {
|
|
|
18
18
|
"tb-width": string;
|
|
19
19
|
thumbnails: string;
|
|
20
20
|
};
|
|
21
|
-
|
|
21
|
+
declare const carouselAttributes: typeof carouselBaseAttributes & typeof MJML_PADDING_ATTRIBUTES;
|
|
22
22
|
export declare const carouselPropsSchema: z.ZodObject<{ [K in keyof typeof carouselAttributes]: MjmlAttributeSchema; }, z.core.$strict>;
|
|
23
23
|
export declare const mjmlCarouselType: MjmlBlockTypeDefinition<MjmlCarouselNode>;
|
|
24
24
|
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import "../../models/MjmlNodeType.js";
|
|
1
|
+
import { MjmlNodeType } from "../../models/MjmlNodeType.js";
|
|
2
2
|
import { MJML_PADDING_ATTRIBUTES } from "../constants.js";
|
|
3
3
|
import { createMjmlAttributeShape } from "../createMjmlAttributeShape.js";
|
|
4
4
|
import { renderMjmlNode } from "../renderMjmlNode.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
|
+
// src/services/components/mjCarousel.ts
|
|
6
7
|
const carouselAttributes = {
|
|
7
8
|
align: "enum(left,center,right)",
|
|
8
9
|
"border-radius": "string",
|
|
@@ -38,15 +39,15 @@ const mjmlCarouselTypeFields = {
|
|
|
38
39
|
formSchema: z.strictObject({}),
|
|
39
40
|
hasAlternativeText: false,
|
|
40
41
|
propsSchema: carouselPropsSchema,
|
|
41
|
-
slots: { children: [
|
|
42
|
-
type:
|
|
42
|
+
slots: { children: [MjmlNodeType.CarouselImage] },
|
|
43
|
+
type: MjmlNodeType.Carousel
|
|
43
44
|
};
|
|
44
45
|
const mjmlCarouselType = {
|
|
45
46
|
...mjmlCarouselTypeFields,
|
|
46
47
|
render: renderMjmlNode({
|
|
47
48
|
...mjmlCarouselTypeFields,
|
|
48
49
|
hasChildren: true,
|
|
49
|
-
tagName:
|
|
50
|
+
tagName: MjmlNodeType.Carousel
|
|
50
51
|
})
|
|
51
52
|
};
|
|
52
|
-
export {
|
|
53
|
+
export { carouselPropsSchema, mjmlCarouselType };
|
|
@@ -2,7 +2,7 @@ import { MjmlAttributeSchema } from "../../models/MjmlAttributeSchema.js";
|
|
|
2
2
|
import { MjmlBlockTypeDefinition } from "../../models/MjmlBlockTypeDefinition.js";
|
|
3
3
|
import { MjmlCarouselImageNode } from "../../models/MjmlCarouselImageNode.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
|
|
5
|
+
declare const carouselImageAttributes: {
|
|
6
6
|
alt: string;
|
|
7
7
|
"border-radius": string;
|
|
8
8
|
href: string;
|
|
@@ -17,4 +17,5 @@ export declare const carouselImageAttributes: {
|
|
|
17
17
|
export declare const carouselImagePropsSchema: z.ZodObject<{ [K in keyof typeof carouselImageAttributes]: MjmlAttributeSchema; } & {
|
|
18
18
|
decorative: z.ZodOptional<z.ZodBoolean>;
|
|
19
19
|
}, z.core.$strict>;
|
|
20
|
-
export declare const mjmlCarouselImageType: MjmlBlockTypeDefinition<MjmlCarouselImageNode>;
|
|
20
|
+
export declare const mjmlCarouselImageType: MjmlBlockTypeDefinition<MjmlCarouselImageNode>;
|
|
21
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../models/MjmlNodeType.js";
|
|
1
|
+
import { MjmlNodeType } from "../../models/MjmlNodeType.js";
|
|
2
2
|
import { checkMjmlAlternativeText } from "../checkMjmlAlternativeText.js";
|
|
3
3
|
import { createMjmlAttributeShape } from "../createMjmlAttributeShape.js";
|
|
4
4
|
import { renderMjmlNode } from "../renderMjmlNode.js";
|
|
@@ -31,14 +31,14 @@ const mjmlCarouselImageTypeFields = {
|
|
|
31
31
|
hasAlternativeText: true,
|
|
32
32
|
propsSchema: carouselImagePropsSchema,
|
|
33
33
|
slots: {},
|
|
34
|
-
type:
|
|
34
|
+
type: MjmlNodeType.CarouselImage
|
|
35
35
|
};
|
|
36
36
|
const mjmlCarouselImageType = {
|
|
37
37
|
...mjmlCarouselImageTypeFields,
|
|
38
38
|
render: renderMjmlNode({
|
|
39
39
|
...mjmlCarouselImageTypeFields,
|
|
40
40
|
hasChildren: false,
|
|
41
|
-
tagName:
|
|
41
|
+
tagName: MjmlNodeType.CarouselImage
|
|
42
42
|
})
|
|
43
43
|
};
|
|
44
|
-
export {
|
|
44
|
+
export { carouselImagePropsSchema, mjmlCarouselImageType };
|
|
@@ -24,7 +24,7 @@ declare const columnBaseAttributes: {
|
|
|
24
24
|
"vertical-align": string;
|
|
25
25
|
width: string;
|
|
26
26
|
};
|
|
27
|
-
|
|
27
|
+
declare const columnAttributes: typeof columnBaseAttributes & typeof MJML_PADDING_ATTRIBUTES;
|
|
28
28
|
export declare const columnPropsSchema: z.ZodObject<{ [K in keyof typeof columnAttributes]: MjmlAttributeSchema; }, z.core.$strict>;
|
|
29
29
|
export declare const createMjmlColumnType: (leafTypes: MjmlLeafNode["type"][]) => MjmlBlockTypeDefinition<MjmlColumnNode>;
|
|
30
30
|
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import "../../models/MjmlNodeType.js";
|
|
1
|
+
import { MjmlNodeType } from "../../models/MjmlNodeType.js";
|
|
2
2
|
import { MJML_PADDING_ATTRIBUTES } from "../constants.js";
|
|
3
3
|
import { createMjmlAttributeShape } from "../createMjmlAttributeShape.js";
|
|
4
4
|
import { renderMjmlNode } from "../renderMjmlNode.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
|
+
// src/services/components/mjColumn.ts
|
|
6
7
|
const columnAttributes = {
|
|
7
8
|
"background-color": "color",
|
|
8
9
|
border: "string",
|
|
@@ -37,28 +38,28 @@ const createMjmlColumnType = (leafTypes) => {
|
|
|
37
38
|
hasAlternativeText: false,
|
|
38
39
|
propsSchema: columnPropsSchema,
|
|
39
40
|
slots: { children: [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
41
|
+
MjmlNodeType.Accordion,
|
|
42
|
+
MjmlNodeType.Button,
|
|
43
|
+
MjmlNodeType.Carousel,
|
|
44
|
+
MjmlNodeType.Divider,
|
|
45
|
+
MjmlNodeType.Image,
|
|
46
|
+
MjmlNodeType.Raw,
|
|
47
|
+
MjmlNodeType.Social,
|
|
48
|
+
MjmlNodeType.Spacer,
|
|
49
|
+
MjmlNodeType.Table,
|
|
50
|
+
MjmlNodeType.Text,
|
|
51
|
+
MjmlNodeType.Navbar,
|
|
51
52
|
...leafTypes
|
|
52
53
|
] },
|
|
53
|
-
type:
|
|
54
|
+
type: MjmlNodeType.Column
|
|
54
55
|
};
|
|
55
56
|
return {
|
|
56
57
|
...columnTypeFields,
|
|
57
58
|
render: renderMjmlNode({
|
|
58
59
|
...columnTypeFields,
|
|
59
60
|
hasChildren: true,
|
|
60
|
-
tagName:
|
|
61
|
+
tagName: MjmlNodeType.Column
|
|
61
62
|
})
|
|
62
63
|
};
|
|
63
64
|
};
|
|
64
|
-
export {
|
|
65
|
+
export { columnPropsSchema, createMjmlColumnType };
|
|
@@ -12,7 +12,7 @@ declare const dividerBaseAttributes: {
|
|
|
12
12
|
padding: string;
|
|
13
13
|
width: string;
|
|
14
14
|
};
|
|
15
|
-
|
|
15
|
+
declare const dividerAttributes: typeof dividerBaseAttributes & typeof MJML_PADDING_ATTRIBUTES;
|
|
16
16
|
export declare const dividerPropsSchema: z.ZodObject<{ [K in keyof typeof dividerAttributes]: MjmlAttributeSchema; }, z.core.$strict>;
|
|
17
17
|
export declare const mjmlDividerType: MjmlBlockTypeDefinition<MjmlDividerNode>;
|
|
18
18
|
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import "../../models/MjmlNodeType.js";
|
|
1
|
+
import { MjmlNodeType } from "../../models/MjmlNodeType.js";
|
|
2
2
|
import { MJML_PADDING_ATTRIBUTES } from "../constants.js";
|
|
3
3
|
import { createMjmlAttributeShape } from "../createMjmlAttributeShape.js";
|
|
4
4
|
import { renderMjmlNode } from "../renderMjmlNode.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
|
+
// src/services/components/mjDivider.ts
|
|
6
7
|
const dividerAttributes = {
|
|
7
8
|
align: "enum(left,center,right)",
|
|
8
9
|
"border-color": "color",
|
|
@@ -29,14 +30,14 @@ const mjmlDividerTypeFields = {
|
|
|
29
30
|
hasAlternativeText: false,
|
|
30
31
|
propsSchema: dividerPropsSchema,
|
|
31
32
|
slots: {},
|
|
32
|
-
type:
|
|
33
|
+
type: MjmlNodeType.Divider
|
|
33
34
|
};
|
|
34
35
|
const mjmlDividerType = {
|
|
35
36
|
...mjmlDividerTypeFields,
|
|
36
37
|
render: renderMjmlNode({
|
|
37
38
|
...mjmlDividerTypeFields,
|
|
38
39
|
hasChildren: false,
|
|
39
|
-
tagName:
|
|
40
|
+
tagName: MjmlNodeType.Divider
|
|
40
41
|
})
|
|
41
42
|
};
|
|
42
|
-
export {
|
|
43
|
+
export { dividerPropsSchema, mjmlDividerType };
|
|
@@ -2,11 +2,12 @@ import { MjmlAttributeSchema } from "../../models/MjmlAttributeSchema.js";
|
|
|
2
2
|
import { MjmlBlockTypeDefinition } from "../../models/MjmlBlockTypeDefinition.js";
|
|
3
3
|
import { MjmlGroupNode } from "../../models/MjmlGroupNode.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
|
|
5
|
+
declare const groupAttributes: {
|
|
6
6
|
"background-color": string;
|
|
7
7
|
direction: string;
|
|
8
8
|
"vertical-align": string;
|
|
9
9
|
width: string;
|
|
10
10
|
};
|
|
11
11
|
export declare const groupPropsSchema: z.ZodObject<{ [K in keyof typeof groupAttributes]: MjmlAttributeSchema; }, z.core.$strict>;
|
|
12
|
-
export declare const mjmlGroupType: MjmlBlockTypeDefinition<MjmlGroupNode>;
|
|
12
|
+
export declare const mjmlGroupType: MjmlBlockTypeDefinition<MjmlGroupNode>;
|
|
13
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../models/MjmlNodeType.js";
|
|
1
|
+
import { MjmlNodeType } from "../../models/MjmlNodeType.js";
|
|
2
2
|
import { createMjmlAttributeShape } from "../createMjmlAttributeShape.js";
|
|
3
3
|
import { renderMjmlNode } from "../renderMjmlNode.js";
|
|
4
4
|
import { z } from "zod";
|
|
@@ -17,15 +17,15 @@ const mjmlGroupTypeFields = {
|
|
|
17
17
|
formSchema: z.strictObject({}),
|
|
18
18
|
hasAlternativeText: false,
|
|
19
19
|
propsSchema: groupPropsSchema,
|
|
20
|
-
slots: { children: [
|
|
21
|
-
type:
|
|
20
|
+
slots: { children: [MjmlNodeType.Column, MjmlNodeType.Raw] },
|
|
21
|
+
type: MjmlNodeType.Group
|
|
22
22
|
};
|
|
23
23
|
const mjmlGroupType = {
|
|
24
24
|
...mjmlGroupTypeFields,
|
|
25
25
|
render: renderMjmlNode({
|
|
26
26
|
...mjmlGroupTypeFields,
|
|
27
27
|
hasChildren: true,
|
|
28
|
-
tagName:
|
|
28
|
+
tagName: MjmlNodeType.Group
|
|
29
29
|
})
|
|
30
30
|
};
|
|
31
|
-
export {
|
|
31
|
+
export { groupPropsSchema, mjmlGroupType };
|
|
@@ -22,7 +22,7 @@ declare const heroBaseAttributes: {
|
|
|
22
22
|
padding: string;
|
|
23
23
|
"vertical-align": string;
|
|
24
24
|
};
|
|
25
|
-
|
|
25
|
+
declare const heroAttributes: typeof heroBaseAttributes & typeof MJML_PADDING_ATTRIBUTES;
|
|
26
26
|
export declare const heroPropsSchema: z.ZodObject<{ [K in keyof typeof heroAttributes]: MjmlAttributeSchema; }, z.core.$strict>;
|
|
27
27
|
export declare const createMjmlHeroType: (leafTypes: MjmlLeafNode["type"][]) => MjmlBlockTypeDefinition<MjmlHeroNode>;
|
|
28
28
|
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import "../../models/MjmlNodeType.js";
|
|
1
|
+
import { MjmlNodeType } from "../../models/MjmlNodeType.js";
|
|
2
2
|
import { MJML_PADDING_ATTRIBUTES } from "../constants.js";
|
|
3
3
|
import { createMjmlAttributeShape } from "../createMjmlAttributeShape.js";
|
|
4
4
|
import { renderMjmlNode } from "../renderMjmlNode.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
|
+
// src/services/components/mjHero.ts
|
|
6
7
|
const heroAttributes = {
|
|
7
8
|
"background-color": "color",
|
|
8
9
|
"background-height": "unit(px,%)",
|
|
@@ -39,28 +40,28 @@ const createMjmlHeroType = (leafTypes) => {
|
|
|
39
40
|
hasAlternativeText: false,
|
|
40
41
|
propsSchema: heroPropsSchema,
|
|
41
42
|
slots: { children: [
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
MjmlNodeType.Accordion,
|
|
44
|
+
MjmlNodeType.Button,
|
|
45
|
+
MjmlNodeType.Carousel,
|
|
46
|
+
MjmlNodeType.Divider,
|
|
47
|
+
MjmlNodeType.Image,
|
|
48
|
+
MjmlNodeType.Social,
|
|
49
|
+
MjmlNodeType.Spacer,
|
|
50
|
+
MjmlNodeType.Table,
|
|
51
|
+
MjmlNodeType.Text,
|
|
52
|
+
MjmlNodeType.Navbar,
|
|
53
|
+
MjmlNodeType.Raw,
|
|
53
54
|
...leafTypes
|
|
54
55
|
] },
|
|
55
|
-
type:
|
|
56
|
+
type: MjmlNodeType.Hero
|
|
56
57
|
};
|
|
57
58
|
return {
|
|
58
59
|
...heroTypeFields,
|
|
59
60
|
render: renderMjmlNode({
|
|
60
61
|
...heroTypeFields,
|
|
61
62
|
hasChildren: true,
|
|
62
|
-
tagName:
|
|
63
|
+
tagName: MjmlNodeType.Hero
|
|
63
64
|
})
|
|
64
65
|
};
|
|
65
66
|
};
|
|
66
|
-
export { createMjmlHeroType,
|
|
67
|
+
export { createMjmlHeroType, heroPropsSchema };
|
|
@@ -29,7 +29,7 @@ declare const imageBaseAttributes: {
|
|
|
29
29
|
usemap: string;
|
|
30
30
|
width: string;
|
|
31
31
|
};
|
|
32
|
-
|
|
32
|
+
declare const imageAttributes: typeof imageBaseAttributes & typeof MJML_PADDING_ATTRIBUTES;
|
|
33
33
|
export declare const imagePropsSchema: z.ZodObject<{ [K in keyof typeof imageAttributes]: MjmlAttributeSchema; } & {
|
|
34
34
|
decorative: z.ZodOptional<z.ZodBoolean>;
|
|
35
35
|
}, z.core.$strict>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import "../../models/MjmlNodeType.js";
|
|
1
|
+
import { MjmlNodeType } from "../../models/MjmlNodeType.js";
|
|
2
2
|
import { checkMjmlAlternativeText } from "../checkMjmlAlternativeText.js";
|
|
3
3
|
import { MJML_PADDING_ATTRIBUTES } from "../constants.js";
|
|
4
4
|
import { createMjmlAttributeShape } from "../createMjmlAttributeShape.js";
|
|
5
5
|
import { renderMjmlNode } from "../renderMjmlNode.js";
|
|
6
6
|
import { z } from "zod";
|
|
7
|
+
// src/services/components/mjImage.ts
|
|
7
8
|
const imageAttributes = {
|
|
8
9
|
align: "enum(left,center,right)",
|
|
9
10
|
alt: "string",
|
|
@@ -51,14 +52,14 @@ const mjmlImageTypeFields = {
|
|
|
51
52
|
hasAlternativeText: true,
|
|
52
53
|
propsSchema: imagePropsSchema,
|
|
53
54
|
slots: {},
|
|
54
|
-
type:
|
|
55
|
+
type: MjmlNodeType.Image
|
|
55
56
|
};
|
|
56
57
|
const mjmlImageType = {
|
|
57
58
|
...mjmlImageTypeFields,
|
|
58
59
|
render: renderMjmlNode({
|
|
59
60
|
...mjmlImageTypeFields,
|
|
60
61
|
hasChildren: false,
|
|
61
|
-
tagName:
|
|
62
|
+
tagName: MjmlNodeType.Image
|
|
62
63
|
})
|
|
63
64
|
};
|
|
64
|
-
export {
|
|
65
|
+
export { imagePropsSchema, mjmlImageType };
|
|
@@ -23,7 +23,7 @@ declare const navbarBaseAttributes: {
|
|
|
23
23
|
"ico-text-transform": string;
|
|
24
24
|
padding: string;
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
declare const navbarAttributes: typeof MJML_PADDING_ATTRIBUTES & typeof navbarBaseAttributes;
|
|
27
27
|
export declare const navbarPropsSchema: z.ZodObject<{ [K in keyof typeof navbarAttributes]: MjmlAttributeSchema; }, z.core.$strict>;
|
|
28
28
|
export declare const mjmlNavbarType: MjmlBlockTypeDefinition<MjmlNavbarNode>;
|
|
29
29
|
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import "../../models/MjmlNodeType.js";
|
|
1
|
+
import { MjmlNodeType } from "../../models/MjmlNodeType.js";
|
|
2
2
|
import { MJML_PADDING_ATTRIBUTES } from "../constants.js";
|
|
3
3
|
import { createMjmlAttributeShape } from "../createMjmlAttributeShape.js";
|
|
4
4
|
import { renderMjmlNode } from "../renderMjmlNode.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
|
+
// src/services/components/mjNavbar.ts
|
|
6
7
|
const navbarAttributes = {
|
|
7
8
|
align: "enum(left,center,right)",
|
|
8
9
|
"base-url": "string",
|
|
@@ -44,15 +45,15 @@ const mjmlNavbarTypeFields = {
|
|
|
44
45
|
formSchema: z.strictObject({}),
|
|
45
46
|
hasAlternativeText: false,
|
|
46
47
|
propsSchema: navbarPropsSchema,
|
|
47
|
-
slots: { children: [
|
|
48
|
-
type:
|
|
48
|
+
slots: { children: [MjmlNodeType.NavbarLink, MjmlNodeType.Raw] },
|
|
49
|
+
type: MjmlNodeType.Navbar
|
|
49
50
|
};
|
|
50
51
|
const mjmlNavbarType = {
|
|
51
52
|
...mjmlNavbarTypeFields,
|
|
52
53
|
render: renderMjmlNode({
|
|
53
54
|
...mjmlNavbarTypeFields,
|
|
54
55
|
hasChildren: true,
|
|
55
|
-
tagName:
|
|
56
|
+
tagName: MjmlNodeType.Navbar
|
|
56
57
|
})
|
|
57
58
|
};
|
|
58
|
-
export { mjmlNavbarType,
|
|
59
|
+
export { mjmlNavbarType, navbarPropsSchema };
|
|
@@ -19,7 +19,7 @@ declare const navbarLinkBaseAttributes: {
|
|
|
19
19
|
"text-decoration": string;
|
|
20
20
|
"text-transform": string;
|
|
21
21
|
};
|
|
22
|
-
|
|
22
|
+
declare const navbarLinkAttributes: typeof MJML_PADDING_ATTRIBUTES & typeof navbarLinkBaseAttributes;
|
|
23
23
|
export declare const navbarLinkPropsSchema: z.ZodObject<{ [K in keyof typeof navbarLinkAttributes]: MjmlAttributeSchema; } & {
|
|
24
24
|
content: z.ZodString;
|
|
25
25
|
}, z.core.$strict>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import "../../models/MjmlContentKind.js";
|
|
2
|
-
import "../../models/MjmlNodeType.js";
|
|
1
|
+
import { MjmlContentKind } from "../../models/MjmlContentKind.js";
|
|
2
|
+
import { MjmlNodeType } from "../../models/MjmlNodeType.js";
|
|
3
3
|
import { MJML_PADDING_ATTRIBUTES } from "../constants.js";
|
|
4
4
|
import { createMjmlAttributeShape } from "../createMjmlAttributeShape.js";
|
|
5
5
|
import { MjmlContentKindSchemaMap } from "../MjmlContentKindSchemaMap.js";
|
|
6
6
|
import { renderMjmlNode } from "../renderMjmlNode.js";
|
|
7
7
|
import { z } from "zod";
|
|
8
|
+
// src/services/components/mjNavbarLink.ts
|
|
8
9
|
const navbarLinkAttributes = {
|
|
9
10
|
color: "color",
|
|
10
11
|
"font-family": "string",
|
|
@@ -24,11 +25,11 @@ const navbarLinkAttributes = {
|
|
|
24
25
|
};
|
|
25
26
|
const navbarLinkPropsSchema = z.strictObject({
|
|
26
27
|
...createMjmlAttributeShape(navbarLinkAttributes),
|
|
27
|
-
content: MjmlContentKindSchemaMap[
|
|
28
|
+
content: MjmlContentKindSchemaMap[MjmlContentKind.Label]
|
|
28
29
|
});
|
|
29
30
|
const mjmlNavbarLinkTypeFields = {
|
|
30
31
|
allowedAttributes: navbarLinkAttributes,
|
|
31
|
-
contentKind:
|
|
32
|
+
contentKind: MjmlContentKind.Label,
|
|
32
33
|
defaultAttributes: {
|
|
33
34
|
color: "#000000",
|
|
34
35
|
"font-family": "Ubuntu, Helvetica, Arial, sans-serif",
|
|
@@ -40,18 +41,18 @@ const mjmlNavbarLinkTypeFields = {
|
|
|
40
41
|
"text-decoration": "none",
|
|
41
42
|
"text-transform": "uppercase"
|
|
42
43
|
},
|
|
43
|
-
formSchema: z.strictObject({ content: MjmlContentKindSchemaMap[
|
|
44
|
+
formSchema: z.strictObject({ content: MjmlContentKindSchemaMap[MjmlContentKind.Label] }),
|
|
44
45
|
hasAlternativeText: false,
|
|
45
46
|
propsSchema: navbarLinkPropsSchema,
|
|
46
47
|
slots: {},
|
|
47
|
-
type:
|
|
48
|
+
type: MjmlNodeType.NavbarLink
|
|
48
49
|
};
|
|
49
50
|
const mjmlNavbarLinkType = {
|
|
50
51
|
...mjmlNavbarLinkTypeFields,
|
|
51
52
|
render: renderMjmlNode({
|
|
52
53
|
...mjmlNavbarLinkTypeFields,
|
|
53
54
|
hasChildren: false,
|
|
54
|
-
tagName:
|
|
55
|
+
tagName: MjmlNodeType.NavbarLink
|
|
55
56
|
})
|
|
56
57
|
};
|
|
57
|
-
export { mjmlNavbarLinkType,
|
|
58
|
+
export { mjmlNavbarLinkType, navbarLinkPropsSchema };
|
|
@@ -2,10 +2,11 @@ import { MjmlAttributeSchema } from "../../models/MjmlAttributeSchema.js";
|
|
|
2
2
|
import { MjmlBlockTypeDefinition } from "../../models/MjmlBlockTypeDefinition.js";
|
|
3
3
|
import { MjmlRawNode } from "../../models/MjmlRawNode.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
|
|
5
|
+
declare const rawAttributes: {
|
|
6
6
|
position: string;
|
|
7
7
|
};
|
|
8
8
|
export declare const rawPropsSchema: z.ZodObject<{ [K in keyof typeof rawAttributes]: MjmlAttributeSchema; } & {
|
|
9
9
|
content: z.ZodString;
|
|
10
10
|
}, z.core.$strict>;
|
|
11
|
-
export declare const mjmlRawType: MjmlBlockTypeDefinition<MjmlRawNode>;
|
|
11
|
+
export declare const mjmlRawType: MjmlBlockTypeDefinition<MjmlRawNode>;
|
|
12
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../../models/MjmlContentKind.js";
|
|
2
|
-
import "../../models/MjmlNodeType.js";
|
|
1
|
+
import { MjmlContentKind } from "../../models/MjmlContentKind.js";
|
|
2
|
+
import { MjmlNodeType } from "../../models/MjmlNodeType.js";
|
|
3
3
|
import { createMjmlAttributeShape } from "../createMjmlAttributeShape.js";
|
|
4
4
|
import { MjmlContentKindSchemaMap } from "../MjmlContentKindSchemaMap.js";
|
|
5
5
|
import { renderMjmlNode } from "../renderMjmlNode.js";
|
|
@@ -7,25 +7,25 @@ import { z } from "zod";
|
|
|
7
7
|
// src/services/components/mjRaw.ts
|
|
8
8
|
const rawAttributes = { position: "enum(file-start)" };
|
|
9
9
|
const rawPropsSchema = z.strictObject({
|
|
10
|
-
content: MjmlContentKindSchemaMap[
|
|
10
|
+
content: MjmlContentKindSchemaMap[MjmlContentKind.Raw],
|
|
11
11
|
...createMjmlAttributeShape(rawAttributes)
|
|
12
12
|
});
|
|
13
13
|
const mjmlRawTypeFields = {
|
|
14
14
|
allowedAttributes: rawAttributes,
|
|
15
|
-
contentKind:
|
|
15
|
+
contentKind: MjmlContentKind.Raw,
|
|
16
16
|
defaultAttributes: {},
|
|
17
|
-
formSchema: z.strictObject({ content: MjmlContentKindSchemaMap[
|
|
17
|
+
formSchema: z.strictObject({ content: MjmlContentKindSchemaMap[MjmlContentKind.Raw] }),
|
|
18
18
|
hasAlternativeText: false,
|
|
19
19
|
propsSchema: rawPropsSchema,
|
|
20
20
|
slots: {},
|
|
21
|
-
type:
|
|
21
|
+
type: MjmlNodeType.Raw
|
|
22
22
|
};
|
|
23
23
|
const mjmlRawType = {
|
|
24
24
|
...mjmlRawTypeFields,
|
|
25
25
|
render: renderMjmlNode({
|
|
26
26
|
...mjmlRawTypeFields,
|
|
27
27
|
hasChildren: false,
|
|
28
|
-
tagName:
|
|
28
|
+
tagName: MjmlNodeType.Raw
|
|
29
29
|
})
|
|
30
30
|
};
|
|
31
|
-
export { mjmlRawType,
|
|
31
|
+
export { mjmlRawType, rawPropsSchema };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../models/MjmlNodeType.js";
|
|
1
|
+
import { MjmlNodeType } from "../../models/MjmlNodeType.js";
|
|
2
2
|
import { sectionAttributes } from "./sectionAttributes.js";
|
|
3
3
|
import { createMjmlAttributeShape } from "../createMjmlAttributeShape.js";
|
|
4
4
|
import { renderMjmlNode } from "../renderMjmlNode.js";
|
|
@@ -13,18 +13,18 @@ const mjmlSectionTypeFields = {
|
|
|
13
13
|
hasAlternativeText: false,
|
|
14
14
|
propsSchema: sectionPropsSchema,
|
|
15
15
|
slots: { children: [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
MjmlNodeType.Column,
|
|
17
|
+
MjmlNodeType.Group,
|
|
18
|
+
MjmlNodeType.Raw
|
|
19
19
|
] },
|
|
20
|
-
type:
|
|
20
|
+
type: MjmlNodeType.Section
|
|
21
21
|
};
|
|
22
22
|
const mjmlSectionType = {
|
|
23
23
|
...mjmlSectionTypeFields,
|
|
24
24
|
render: renderMjmlNode({
|
|
25
25
|
...mjmlSectionTypeFields,
|
|
26
26
|
hasChildren: true,
|
|
27
|
-
tagName:
|
|
27
|
+
tagName: MjmlNodeType.Section
|
|
28
28
|
})
|
|
29
29
|
};
|
|
30
30
|
export { mjmlSectionType, sectionPropsSchema };
|
|
@@ -25,7 +25,7 @@ declare const socialBaseAttributes: {
|
|
|
25
25
|
"text-padding": string;
|
|
26
26
|
"vertical-align": string;
|
|
27
27
|
};
|
|
28
|
-
|
|
28
|
+
declare const socialAttributes: typeof MJML_PADDING_ATTRIBUTES & typeof socialBaseAttributes;
|
|
29
29
|
export declare const socialPropsSchema: z.ZodObject<{ [K in keyof typeof socialAttributes]: MjmlAttributeSchema; }, z.core.$strict>;
|
|
30
30
|
export declare const mjmlSocialType: MjmlBlockTypeDefinition<MjmlSocialNode>;
|
|
31
31
|
export {};
|