mjml-blocks 4.11.0 → 4.12.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 +2 -5
- 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 +2 -2
- 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 +1 -1
- package/dist/services/MjmlContentKindSchemaMap.js +3 -3
- package/dist/services/checkMjmlAlternativeText.d.ts +2 -2
- package/dist/services/components/createMjmlAccordionTextType.js +2 -2
- package/dist/services/components/createMjmlRichTextType.js +3 -3
- package/dist/services/components/createMjmlTextType.js +2 -2
- package/dist/services/components/mjAccordion.js +4 -4
- package/dist/services/components/mjAccordionElement.js +6 -6
- package/dist/services/components/mjAccordionTitle.js +7 -7
- package/dist/services/components/mjButton.js +7 -7
- package/dist/services/components/mjCarousel.js +4 -4
- package/dist/services/components/mjCarouselImage.js +3 -3
- package/dist/services/components/mjColumn.js +14 -14
- package/dist/services/components/mjDivider.js +3 -3
- package/dist/services/components/mjGroup.js +4 -4
- package/dist/services/components/mjHero.js +14 -14
- package/dist/services/components/mjImage.js +3 -3
- package/dist/services/components/mjNavbar.js +4 -4
- package/dist/services/components/mjNavbarLink.js +7 -7
- package/dist/services/components/mjRaw.js +7 -7
- package/dist/services/components/mjSection.js +6 -6
- package/dist/services/components/mjSocial.js +4 -4
- package/dist/services/components/mjSocialElement.js +7 -7
- package/dist/services/components/mjSpacer.js +3 -3
- package/dist/services/components/mjTable.js +7 -7
- package/dist/services/components/mjWrapper.js +6 -6
- package/dist/services/constants.js +5 -5
- package/dist/services/createTypeSchema.js +7 -7
- package/dist/services/mjmlNodeChildren.js +23 -23
- package/dist/services/mjmlNodeSchema.js +23 -23
- package/dist/services/parseMjmlAttributeType.js +7 -7
- package/dist/services/readMjmlContent.js +4 -4
- package/dist/services/readMjmlNode.js +2 -1
- package/dist/services/readMjmlNodes.js +2 -1
- package/dist/services/renderMjmlNode.js +8 -8
- package/package.json +7 -6
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { BlockNodeProps } from "vue-block-editor-headless";
|
|
2
2
|
export interface MjmlTableProps extends BlockNodeProps {
|
|
3
|
-
align?: string;
|
|
4
|
-
border?: string;
|
|
5
|
-
cellpadding?: string;
|
|
6
|
-
cellspacing?: string;
|
|
7
|
-
color?: string;
|
|
8
|
-
"container-background-color"?: string;
|
|
3
|
+
align?: string | undefined;
|
|
4
|
+
border?: string | undefined;
|
|
5
|
+
cellpadding?: string | undefined;
|
|
6
|
+
cellspacing?: string | undefined;
|
|
7
|
+
color?: string | undefined;
|
|
8
|
+
"container-background-color"?: string | undefined;
|
|
9
9
|
content: string;
|
|
10
|
-
"font-family"?: string;
|
|
11
|
-
"font-size"?: string;
|
|
12
|
-
"font-weight"?: string;
|
|
13
|
-
"line-height"?: string;
|
|
14
|
-
padding?: string;
|
|
15
|
-
"padding-bottom"?: string;
|
|
16
|
-
"padding-left"?: string;
|
|
17
|
-
"padding-right"?: string;
|
|
18
|
-
"padding-top"?: string;
|
|
19
|
-
role?: string;
|
|
20
|
-
"table-layout"?: string;
|
|
21
|
-
"vertical-align"?: string;
|
|
22
|
-
width?: string;
|
|
10
|
+
"font-family"?: string | undefined;
|
|
11
|
+
"font-size"?: string | undefined;
|
|
12
|
+
"font-weight"?: string | undefined;
|
|
13
|
+
"line-height"?: string | undefined;
|
|
14
|
+
padding?: string | undefined;
|
|
15
|
+
"padding-bottom"?: string | undefined;
|
|
16
|
+
"padding-left"?: string | undefined;
|
|
17
|
+
"padding-right"?: string | undefined;
|
|
18
|
+
"padding-top"?: string | undefined;
|
|
19
|
+
role?: string | undefined;
|
|
20
|
+
"table-layout"?: string | undefined;
|
|
21
|
+
"vertical-align"?: string | undefined;
|
|
22
|
+
width?: string | undefined;
|
|
23
23
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { MjmlNodeType } from "./MjmlNodeType.js";
|
|
2
2
|
import { MjmlTextProps } from "./MjmlTextProps.js";
|
|
3
3
|
import { BlockNode } from "vue-block-editor-headless";
|
|
4
|
-
export type MjmlTextNode = BlockNode<MjmlNodeType.Text, MjmlTextProps>;
|
|
4
|
+
export type MjmlTextNode = BlockNode<typeof MjmlNodeType.Text, MjmlTextProps>;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { MjmlRichText } from "./MjmlRichText.js";
|
|
2
2
|
import { BlockNodeProps } from "vue-block-editor-headless";
|
|
3
3
|
export interface MjmlTextProps extends BlockNodeProps {
|
|
4
|
-
align?: string;
|
|
5
|
-
"background-color"?: string;
|
|
6
|
-
color?: string;
|
|
7
|
-
"container-background-color"?: string;
|
|
4
|
+
align?: string | undefined;
|
|
5
|
+
"background-color"?: string | undefined;
|
|
6
|
+
color?: string | undefined;
|
|
7
|
+
"container-background-color"?: string | undefined;
|
|
8
8
|
content: MjmlRichText;
|
|
9
|
-
"font-family"?: string;
|
|
10
|
-
"font-size"?: string;
|
|
11
|
-
"font-style"?: string;
|
|
12
|
-
"font-weight"?: string;
|
|
13
|
-
height?: string;
|
|
14
|
-
"letter-spacing"?: string;
|
|
15
|
-
"line-height"?: string;
|
|
16
|
-
padding?: string;
|
|
17
|
-
"padding-bottom"?: string;
|
|
18
|
-
"padding-left"?: string;
|
|
19
|
-
"padding-right"?: string;
|
|
20
|
-
"padding-top"?: string;
|
|
21
|
-
"text-decoration"?: string;
|
|
22
|
-
"text-transform"?: string;
|
|
23
|
-
"vertical-align"?: string;
|
|
9
|
+
"font-family"?: string | undefined;
|
|
10
|
+
"font-size"?: string | undefined;
|
|
11
|
+
"font-style"?: string | undefined;
|
|
12
|
+
"font-weight"?: string | undefined;
|
|
13
|
+
height?: string | undefined;
|
|
14
|
+
"letter-spacing"?: string | undefined;
|
|
15
|
+
"line-height"?: string | undefined;
|
|
16
|
+
padding?: string | undefined;
|
|
17
|
+
"padding-bottom"?: string | undefined;
|
|
18
|
+
"padding-left"?: string | undefined;
|
|
19
|
+
"padding-right"?: string | undefined;
|
|
20
|
+
"padding-top"?: string | undefined;
|
|
21
|
+
"text-decoration"?: string | undefined;
|
|
22
|
+
"text-transform"?: string | undefined;
|
|
23
|
+
"vertical-align"?: string | undefined;
|
|
24
24
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { MjmlNodeType } from "./MjmlNodeType.js";
|
|
2
2
|
import { MjmlWrapperProps } from "./MjmlWrapperProps.js";
|
|
3
3
|
import { BlockNode } from "vue-block-editor-headless";
|
|
4
|
-
export type MjmlWrapperNode = BlockNode<MjmlNodeType.Wrapper, MjmlWrapperProps>;
|
|
4
|
+
export type MjmlWrapperNode = BlockNode<typeof MjmlNodeType.Wrapper, MjmlWrapperProps>;
|
|
@@ -3,29 +3,29 @@ import { MjmlRawNode } from "./MjmlRawNode.js";
|
|
|
3
3
|
import { MjmlSectionNode } from "./MjmlSectionNode.js";
|
|
4
4
|
import { BlockNodeProps } from "vue-block-editor-headless";
|
|
5
5
|
export interface MjmlWrapperProps extends BlockNodeProps {
|
|
6
|
-
"background-color"?: string;
|
|
7
|
-
"background-position"?: string;
|
|
8
|
-
"background-position-x"?: string;
|
|
9
|
-
"background-position-y"?: string;
|
|
10
|
-
"background-repeat"?: string;
|
|
11
|
-
"background-size"?: string;
|
|
12
|
-
"background-url"?: string;
|
|
13
|
-
border?: string;
|
|
14
|
-
"border-bottom"?: string;
|
|
15
|
-
"border-left"?: string;
|
|
16
|
-
"border-radius"?: string;
|
|
17
|
-
"border-right"?: string;
|
|
18
|
-
"border-top"?: string;
|
|
6
|
+
"background-color"?: string | undefined;
|
|
7
|
+
"background-position"?: string | undefined;
|
|
8
|
+
"background-position-x"?: string | undefined;
|
|
9
|
+
"background-position-y"?: string | undefined;
|
|
10
|
+
"background-repeat"?: string | undefined;
|
|
11
|
+
"background-size"?: string | undefined;
|
|
12
|
+
"background-url"?: string | undefined;
|
|
13
|
+
border?: string | undefined;
|
|
14
|
+
"border-bottom"?: string | undefined;
|
|
15
|
+
"border-left"?: string | undefined;
|
|
16
|
+
"border-radius"?: string | undefined;
|
|
17
|
+
"border-right"?: string | undefined;
|
|
18
|
+
"border-top"?: string | undefined;
|
|
19
19
|
children: (MjmlHeroNode | MjmlRawNode | MjmlSectionNode)[];
|
|
20
|
-
direction?: string;
|
|
21
|
-
"full-width"?: string;
|
|
22
|
-
gap?: string;
|
|
23
|
-
gutter?: string;
|
|
24
|
-
padding?: string;
|
|
25
|
-
"padding-bottom"?: string;
|
|
26
|
-
"padding-left"?: string;
|
|
27
|
-
"padding-right"?: string;
|
|
28
|
-
"padding-top"?: string;
|
|
29
|
-
"text-align"?: string;
|
|
30
|
-
"text-padding"?: string;
|
|
20
|
+
direction?: string | undefined;
|
|
21
|
+
"full-width"?: string | undefined;
|
|
22
|
+
gap?: string | undefined;
|
|
23
|
+
gutter?: string | undefined;
|
|
24
|
+
padding?: string | undefined;
|
|
25
|
+
"padding-bottom"?: string | undefined;
|
|
26
|
+
"padding-left"?: string | undefined;
|
|
27
|
+
"padding-right"?: string | undefined;
|
|
28
|
+
"padding-top"?: string | undefined;
|
|
29
|
+
"text-align"?: string | undefined;
|
|
30
|
+
"text-padding"?: string | undefined;
|
|
31
31
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { MjmlContentKind } from "../models/MjmlContentKind.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
export declare const MjmlContentKindSchemaMap: Record<Exclude<MjmlContentKind, MjmlContentKind.RichText>, z.ZodString>;
|
|
3
|
+
export declare const MjmlContentKindSchemaMap: Record<Exclude<MjmlContentKind, typeof MjmlContentKind.RichText>, z.ZodString>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "../models/MjmlContentKind.js";
|
|
1
|
+
import { MjmlContentKind } from "../models/MjmlContentKind.js";
|
|
2
2
|
import { createMjmlRawContentSchema } from "./createMjmlRawContentSchema.js";
|
|
3
3
|
import { labelContentSchema } from "./labelContentSchema.js";
|
|
4
4
|
// src/services/MjmlContentKindSchemaMap.ts
|
|
5
5
|
const MjmlContentKindSchemaMap = {
|
|
6
|
-
[
|
|
7
|
-
[
|
|
6
|
+
[MjmlContentKind.Label]: labelContentSchema,
|
|
7
|
+
[MjmlContentKind.Raw]: createMjmlRawContentSchema()
|
|
8
8
|
};
|
|
9
9
|
export { MjmlContentKindSchemaMap };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../models/MjmlNodeType.js";
|
|
1
|
+
import { MjmlNodeType } from "../../models/MjmlNodeType.js";
|
|
2
2
|
import { createMjmlAccordionTextPropsSchema } from "./createMjmlAccordionTextPropsSchema.js";
|
|
3
3
|
import { createMjmlRichTextType } from "./createMjmlRichTextType.js";
|
|
4
4
|
import { accordionTextAttributes } from "./mjAccordionText.js";
|
|
@@ -12,6 +12,6 @@ const createMjmlAccordionTextType = (richText) => createMjmlRichTextType({
|
|
|
12
12
|
},
|
|
13
13
|
propsSchema: createMjmlAccordionTextPropsSchema(richText),
|
|
14
14
|
slots: {},
|
|
15
|
-
type:
|
|
15
|
+
type: MjmlNodeType.AccordionText
|
|
16
16
|
}, richText);
|
|
17
17
|
export { createMjmlAccordionTextType };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import "../../models/MjmlContentKind.js";
|
|
1
|
+
import { MjmlContentKind } from "../../models/MjmlContentKind.js";
|
|
2
2
|
import { renderMjmlNode } from "../renderMjmlNode.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
// src/services/components/createMjmlRichTextType.ts
|
|
5
5
|
const createMjmlRichTextType = ({ allowedAttributes, defaultAttributes, propsSchema, slots, type }, richText) => ({
|
|
6
6
|
allowedAttributes,
|
|
7
|
-
contentKind:
|
|
7
|
+
contentKind: MjmlContentKind.RichText,
|
|
8
8
|
defaultAttributes,
|
|
9
9
|
formSchema: z.strictObject({}),
|
|
10
10
|
hasAlternativeText: false,
|
|
11
11
|
propsSchema,
|
|
12
12
|
render: renderMjmlNode({
|
|
13
13
|
allowedAttributes,
|
|
14
|
-
contentKind:
|
|
14
|
+
contentKind: MjmlContentKind.RichText,
|
|
15
15
|
hasAlternativeText: false,
|
|
16
16
|
hasChildren: false,
|
|
17
17
|
tagName: type
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../models/MjmlNodeType.js";
|
|
1
|
+
import { MjmlNodeType } from "../../models/MjmlNodeType.js";
|
|
2
2
|
import { createMjmlRichTextType } from "./createMjmlRichTextType.js";
|
|
3
3
|
import { createMjmlTextPropsSchema } from "./createMjmlTextPropsSchema.js";
|
|
4
4
|
import { textAttributes } from "./mjText.js";
|
|
@@ -15,6 +15,6 @@ const createMjmlTextType = (richText) => createMjmlRichTextType({
|
|
|
15
15
|
},
|
|
16
16
|
propsSchema: createMjmlTextPropsSchema(richText),
|
|
17
17
|
slots: {},
|
|
18
|
-
type:
|
|
18
|
+
type: MjmlNodeType.Text
|
|
19
19
|
}, richText);
|
|
20
20
|
export { createMjmlTextType };
|
|
@@ -1,4 +1,4 @@
|
|
|
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";
|
|
@@ -38,15 +38,15 @@ const mjmlAccordionTypeFields = {
|
|
|
38
38
|
formSchema: z.strictObject({}),
|
|
39
39
|
hasAlternativeText: false,
|
|
40
40
|
propsSchema: accordionPropsSchema,
|
|
41
|
-
slots: { children: [
|
|
42
|
-
type:
|
|
41
|
+
slots: { children: [MjmlNodeType.AccordionElement, MjmlNodeType.Raw] },
|
|
42
|
+
type: MjmlNodeType.Accordion
|
|
43
43
|
};
|
|
44
44
|
const mjmlAccordionType = {
|
|
45
45
|
...mjmlAccordionTypeFields,
|
|
46
46
|
render: renderMjmlNode({
|
|
47
47
|
...mjmlAccordionTypeFields,
|
|
48
48
|
hasChildren: true,
|
|
49
|
-
tagName:
|
|
49
|
+
tagName: MjmlNodeType.Accordion
|
|
50
50
|
})
|
|
51
51
|
};
|
|
52
52
|
export { accordionAttributes, accordionPropsSchema, mjmlAccordionType };
|
|
@@ -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";
|
|
@@ -25,18 +25,18 @@ const mjmlAccordionElementTypeFields = {
|
|
|
25
25
|
hasAlternativeText: false,
|
|
26
26
|
propsSchema: accordionElementPropsSchema,
|
|
27
27
|
slots: { children: [
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
MjmlNodeType.AccordionTitle,
|
|
29
|
+
MjmlNodeType.AccordionText,
|
|
30
|
+
MjmlNodeType.Raw
|
|
31
31
|
] },
|
|
32
|
-
type:
|
|
32
|
+
type: MjmlNodeType.AccordionElement
|
|
33
33
|
};
|
|
34
34
|
const mjmlAccordionElementType = {
|
|
35
35
|
...mjmlAccordionElementTypeFields,
|
|
36
36
|
render: renderMjmlNode({
|
|
37
37
|
...mjmlAccordionElementTypeFields,
|
|
38
38
|
hasChildren: true,
|
|
39
|
-
tagName:
|
|
39
|
+
tagName: MjmlNodeType.AccordionElement
|
|
40
40
|
})
|
|
41
41
|
};
|
|
42
42
|
export { accordionElementAttributes, accordionElementPropsSchema, mjmlAccordionElementType };
|
|
@@ -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 { MJML_PADDING_ATTRIBUTES } from "../constants.js";
|
|
4
4
|
import { createMjmlAttributeShape } from "../createMjmlAttributeShape.js";
|
|
5
5
|
import { MjmlContentKindSchemaMap } from "../MjmlContentKindSchemaMap.js";
|
|
@@ -16,27 +16,27 @@ const accordionTitleAttributes = {
|
|
|
16
16
|
};
|
|
17
17
|
const accordionTitlePropsSchema = z.strictObject({
|
|
18
18
|
...createMjmlAttributeShape(accordionTitleAttributes),
|
|
19
|
-
content: MjmlContentKindSchemaMap[
|
|
19
|
+
content: MjmlContentKindSchemaMap[MjmlContentKind.Label]
|
|
20
20
|
});
|
|
21
21
|
const mjmlAccordionTitleTypeFields = {
|
|
22
22
|
allowedAttributes: accordionTitleAttributes,
|
|
23
|
-
contentKind:
|
|
23
|
+
contentKind: MjmlContentKind.Label,
|
|
24
24
|
defaultAttributes: {
|
|
25
25
|
"font-size": "13px",
|
|
26
26
|
padding: "16px"
|
|
27
27
|
},
|
|
28
|
-
formSchema: z.strictObject({ content: MjmlContentKindSchemaMap[
|
|
28
|
+
formSchema: z.strictObject({ content: MjmlContentKindSchemaMap[MjmlContentKind.Label] }),
|
|
29
29
|
hasAlternativeText: false,
|
|
30
30
|
propsSchema: accordionTitlePropsSchema,
|
|
31
31
|
slots: {},
|
|
32
|
-
type:
|
|
32
|
+
type: MjmlNodeType.AccordionTitle
|
|
33
33
|
};
|
|
34
34
|
const mjmlAccordionTitleType = {
|
|
35
35
|
...mjmlAccordionTitleTypeFields,
|
|
36
36
|
render: renderMjmlNode({
|
|
37
37
|
...mjmlAccordionTitleTypeFields,
|
|
38
38
|
hasChildren: false,
|
|
39
|
-
tagName:
|
|
39
|
+
tagName: MjmlNodeType.AccordionTitle
|
|
40
40
|
})
|
|
41
41
|
};
|
|
42
42
|
export { accordionTitleAttributes, accordionTitlePropsSchema, mjmlAccordionTitleType };
|
|
@@ -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 { MJML_PADDING_ATTRIBUTES } from "../constants.js";
|
|
4
4
|
import { createMjmlAttributeShape } from "../createMjmlAttributeShape.js";
|
|
5
5
|
import { MjmlContentKindSchemaMap } from "../MjmlContentKindSchemaMap.js";
|
|
@@ -39,11 +39,11 @@ const buttonAttributes = {
|
|
|
39
39
|
};
|
|
40
40
|
const buttonPropsSchema = z.strictObject({
|
|
41
41
|
...createMjmlAttributeShape(buttonAttributes),
|
|
42
|
-
content: MjmlContentKindSchemaMap[
|
|
42
|
+
content: MjmlContentKindSchemaMap[MjmlContentKind.Label]
|
|
43
43
|
});
|
|
44
44
|
const mjmlButtonTypeFields = {
|
|
45
45
|
allowedAttributes: buttonAttributes,
|
|
46
|
-
contentKind:
|
|
46
|
+
contentKind: MjmlContentKind.Label,
|
|
47
47
|
defaultAttributes: {
|
|
48
48
|
align: "center",
|
|
49
49
|
"background-color": "#414141",
|
|
@@ -61,18 +61,18 @@ const mjmlButtonTypeFields = {
|
|
|
61
61
|
"text-transform": "none",
|
|
62
62
|
"vertical-align": "middle"
|
|
63
63
|
},
|
|
64
|
-
formSchema: z.strictObject({ content: MjmlContentKindSchemaMap[
|
|
64
|
+
formSchema: z.strictObject({ content: MjmlContentKindSchemaMap[MjmlContentKind.Label] }),
|
|
65
65
|
hasAlternativeText: false,
|
|
66
66
|
propsSchema: buttonPropsSchema,
|
|
67
67
|
slots: {},
|
|
68
|
-
type:
|
|
68
|
+
type: MjmlNodeType.Button
|
|
69
69
|
};
|
|
70
70
|
const mjmlButtonType = {
|
|
71
71
|
...mjmlButtonTypeFields,
|
|
72
72
|
render: renderMjmlNode({
|
|
73
73
|
...mjmlButtonTypeFields,
|
|
74
74
|
hasChildren: false,
|
|
75
|
-
tagName:
|
|
75
|
+
tagName: MjmlNodeType.Button
|
|
76
76
|
})
|
|
77
77
|
};
|
|
78
78
|
export { buttonAttributes, buttonPropsSchema, mjmlButtonType };
|
|
@@ -1,4 +1,4 @@
|
|
|
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";
|
|
@@ -38,15 +38,15 @@ const mjmlCarouselTypeFields = {
|
|
|
38
38
|
formSchema: z.strictObject({}),
|
|
39
39
|
hasAlternativeText: false,
|
|
40
40
|
propsSchema: carouselPropsSchema,
|
|
41
|
-
slots: { children: [
|
|
42
|
-
type:
|
|
41
|
+
slots: { children: [MjmlNodeType.CarouselImage] },
|
|
42
|
+
type: MjmlNodeType.Carousel
|
|
43
43
|
};
|
|
44
44
|
const mjmlCarouselType = {
|
|
45
45
|
...mjmlCarouselTypeFields,
|
|
46
46
|
render: renderMjmlNode({
|
|
47
47
|
...mjmlCarouselTypeFields,
|
|
48
48
|
hasChildren: true,
|
|
49
|
-
tagName:
|
|
49
|
+
tagName: MjmlNodeType.Carousel
|
|
50
50
|
})
|
|
51
51
|
};
|
|
52
52
|
export { carouselAttributes, carouselPropsSchema, mjmlCarouselType };
|
|
@@ -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
44
|
export { carouselImageAttributes, carouselImagePropsSchema, mjmlCarouselImageType };
|
|
@@ -1,4 +1,4 @@
|
|
|
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";
|
|
@@ -37,27 +37,27 @@ const createMjmlColumnType = (leafTypes) => {
|
|
|
37
37
|
hasAlternativeText: false,
|
|
38
38
|
propsSchema: columnPropsSchema,
|
|
39
39
|
slots: { children: [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
40
|
+
MjmlNodeType.Accordion,
|
|
41
|
+
MjmlNodeType.Button,
|
|
42
|
+
MjmlNodeType.Carousel,
|
|
43
|
+
MjmlNodeType.Divider,
|
|
44
|
+
MjmlNodeType.Image,
|
|
45
|
+
MjmlNodeType.Raw,
|
|
46
|
+
MjmlNodeType.Social,
|
|
47
|
+
MjmlNodeType.Spacer,
|
|
48
|
+
MjmlNodeType.Table,
|
|
49
|
+
MjmlNodeType.Text,
|
|
50
|
+
MjmlNodeType.Navbar,
|
|
51
51
|
...leafTypes
|
|
52
52
|
] },
|
|
53
|
-
type:
|
|
53
|
+
type: MjmlNodeType.Column
|
|
54
54
|
};
|
|
55
55
|
return {
|
|
56
56
|
...columnTypeFields,
|
|
57
57
|
render: renderMjmlNode({
|
|
58
58
|
...columnTypeFields,
|
|
59
59
|
hasChildren: true,
|
|
60
|
-
tagName:
|
|
60
|
+
tagName: MjmlNodeType.Column
|
|
61
61
|
})
|
|
62
62
|
};
|
|
63
63
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
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";
|
|
@@ -29,14 +29,14 @@ const mjmlDividerTypeFields = {
|
|
|
29
29
|
hasAlternativeText: false,
|
|
30
30
|
propsSchema: dividerPropsSchema,
|
|
31
31
|
slots: {},
|
|
32
|
-
type:
|
|
32
|
+
type: MjmlNodeType.Divider
|
|
33
33
|
};
|
|
34
34
|
const mjmlDividerType = {
|
|
35
35
|
...mjmlDividerTypeFields,
|
|
36
36
|
render: renderMjmlNode({
|
|
37
37
|
...mjmlDividerTypeFields,
|
|
38
38
|
hasChildren: false,
|
|
39
|
-
tagName:
|
|
39
|
+
tagName: MjmlNodeType.Divider
|
|
40
40
|
})
|
|
41
41
|
};
|
|
42
42
|
export { dividerAttributes, dividerPropsSchema, mjmlDividerType };
|
|
@@ -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
31
|
export { groupAttributes, groupPropsSchema, mjmlGroupType };
|
|
@@ -1,4 +1,4 @@
|
|
|
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";
|
|
@@ -39,27 +39,27 @@ const createMjmlHeroType = (leafTypes) => {
|
|
|
39
39
|
hasAlternativeText: false,
|
|
40
40
|
propsSchema: heroPropsSchema,
|
|
41
41
|
slots: { children: [
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
42
|
+
MjmlNodeType.Accordion,
|
|
43
|
+
MjmlNodeType.Button,
|
|
44
|
+
MjmlNodeType.Carousel,
|
|
45
|
+
MjmlNodeType.Divider,
|
|
46
|
+
MjmlNodeType.Image,
|
|
47
|
+
MjmlNodeType.Social,
|
|
48
|
+
MjmlNodeType.Spacer,
|
|
49
|
+
MjmlNodeType.Table,
|
|
50
|
+
MjmlNodeType.Text,
|
|
51
|
+
MjmlNodeType.Navbar,
|
|
52
|
+
MjmlNodeType.Raw,
|
|
53
53
|
...leafTypes
|
|
54
54
|
] },
|
|
55
|
-
type:
|
|
55
|
+
type: MjmlNodeType.Hero
|
|
56
56
|
};
|
|
57
57
|
return {
|
|
58
58
|
...heroTypeFields,
|
|
59
59
|
render: renderMjmlNode({
|
|
60
60
|
...heroTypeFields,
|
|
61
61
|
hasChildren: true,
|
|
62
|
-
tagName:
|
|
62
|
+
tagName: MjmlNodeType.Hero
|
|
63
63
|
})
|
|
64
64
|
};
|
|
65
65
|
};
|
|
@@ -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 { MJML_PADDING_ATTRIBUTES } from "../constants.js";
|
|
4
4
|
import { createMjmlAttributeShape } from "../createMjmlAttributeShape.js";
|
|
@@ -51,14 +51,14 @@ const mjmlImageTypeFields = {
|
|
|
51
51
|
hasAlternativeText: true,
|
|
52
52
|
propsSchema: imagePropsSchema,
|
|
53
53
|
slots: {},
|
|
54
|
-
type:
|
|
54
|
+
type: MjmlNodeType.Image
|
|
55
55
|
};
|
|
56
56
|
const mjmlImageType = {
|
|
57
57
|
...mjmlImageTypeFields,
|
|
58
58
|
render: renderMjmlNode({
|
|
59
59
|
...mjmlImageTypeFields,
|
|
60
60
|
hasChildren: false,
|
|
61
|
-
tagName:
|
|
61
|
+
tagName: MjmlNodeType.Image
|
|
62
62
|
})
|
|
63
63
|
};
|
|
64
64
|
export { imageAttributes, imagePropsSchema, mjmlImageType };
|
|
@@ -1,4 +1,4 @@
|
|
|
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";
|
|
@@ -44,15 +44,15 @@ const mjmlNavbarTypeFields = {
|
|
|
44
44
|
formSchema: z.strictObject({}),
|
|
45
45
|
hasAlternativeText: false,
|
|
46
46
|
propsSchema: navbarPropsSchema,
|
|
47
|
-
slots: { children: [
|
|
48
|
-
type:
|
|
47
|
+
slots: { children: [MjmlNodeType.NavbarLink, MjmlNodeType.Raw] },
|
|
48
|
+
type: MjmlNodeType.Navbar
|
|
49
49
|
};
|
|
50
50
|
const mjmlNavbarType = {
|
|
51
51
|
...mjmlNavbarTypeFields,
|
|
52
52
|
render: renderMjmlNode({
|
|
53
53
|
...mjmlNavbarTypeFields,
|
|
54
54
|
hasChildren: true,
|
|
55
|
-
tagName:
|
|
55
|
+
tagName: MjmlNodeType.Navbar
|
|
56
56
|
})
|
|
57
57
|
};
|
|
58
58
|
export { mjmlNavbarType, navbarAttributes, navbarPropsSchema };
|