@mjmx/core 1.2.0 → 2.1.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 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -15
- package/dist/index.d.ts +17 -15
- package/dist/index.js.map +1 -1
- package/dist/{jsx-dev-runtime-CIghYpt3.d.cts → jsx-dev-runtime-B3GH8Uon.d.cts} +3 -0
- package/dist/{jsx-dev-runtime-CIghYpt3.d.ts → jsx-dev-runtime-B3GH8Uon.d.ts} +3 -0
- package/dist/jsx-dev-runtime.d.cts +1 -1
- package/dist/jsx-dev-runtime.d.ts +1 -1
- package/dist/jsx-runtime.d.cts +1 -1
- package/dist/jsx-runtime.d.ts +1 -1
- package/package.json +33 -34
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<a href="https://codecov.io/
|
|
2
|
+
<a href="https://codecov.io/gl/skwee357/mjmx"><img src="https://codecov.io/gl/skwee357/mjmx/branch/main/graph/badge.svg" alt="codecov"></a>
|
|
3
3
|
<a href="https://www.npmjs.com/package/@mjmx/core"><img src="https://img.shields.io/npm/v/@mjmx/core" alt="npm version"></a>
|
|
4
4
|
<img src="https://img.shields.io/npm/l/@mjmx/core" alt="license">
|
|
5
|
-
<a href="https://
|
|
5
|
+
<a href="https://gitlab.com/skwee357/mjmx/-/pipelines"><img src="https://gitlab.com/skwee357/mjmx/badges/main/pipeline.svg" alt="CI"></a>
|
|
6
6
|
</div>
|
|
7
7
|
|
|
8
8
|
# mjmx
|
|
@@ -13,8 +13,6 @@
|
|
|
13
13
|
<b>No dependency on react</b>
|
|
14
14
|
</p>
|
|
15
15
|
|
|
16
|
-
> This project was developed with the help of [Claude Code](https://claude.ai/).
|
|
17
|
-
|
|
18
16
|
## Table of Contents
|
|
19
17
|
|
|
20
18
|
- [Installation](#installation)
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/ast.ts","../src/jsx-runtime.ts","../src/render.ts","../src/serialize.ts"],"sourcesContent":["export { Fragment, type MjmlChild, type MjmlNode } from './ast';\nexport type {\n HtmlAnchorAttributes,\n HtmlGlobalAttributes,\n HtmlImgAttributes,\n HtmlListAttributes,\n HtmlMetaAttributes,\n HtmlTableCellAttributes,\n} from './html-types';\nexport { jsx, jsxs, type JSX, type PropsWithChildren } from './jsx-runtime';\nexport { render, type RenderOptions, type RenderResult } from './render';\nexport { serialize } from './serialize';\n\nexport type {\n Align,\n CSSPixel,\n CSSSpacing,\n CSSUnit,\n CSSWidth,\n Color,\n Direction,\n HexColor,\n MjAccordionAttributes,\n MjAccordionElementAttributes,\n MjAccordionTextAttributes,\n MjAccordionTitleAttributes,\n MjAllAttributes,\n MjAttributesAttributes,\n MjBodyAttributes,\n MjBreakpointAttributes,\n MjButtonAttributes,\n MjCarouselAttributes,\n MjCarouselImageAttributes,\n MjClassAttributes,\n MjColumnAttributes,\n MjDividerAttributes,\n MjFontAttributes,\n MjGroupAttributes,\n MjHeadAttributes,\n MjHeroAttributes,\n MjHtmlAttributeAttributes,\n MjHtmlAttributesAttributes,\n MjImageAttributes,\n MjIncludeAttributes,\n MjNavbarAttributes,\n MjNavbarLinkAttributes,\n MjPreviewAttributes,\n MjRawAttributes,\n MjSectionAttributes,\n MjSelectorAttributes,\n MjSocialAttributes,\n MjSocialElementAttributes,\n MjSpacerAttributes,\n MjStyleAttributes,\n MjTableAttributes,\n MjTextAttributes,\n MjTitleAttributes,\n MjWrapperAttributes,\n MjmlAttributes,\n URLString,\n VerticalAlign,\n} from './types';\n","export const MJML_NODE_TYPE = Symbol.for('mjmx.node');\n\nexport const Fragment = Symbol.for('mjmx.fragment');\n\nexport interface MjmlNode {\n readonly $$typeof: typeof MJML_NODE_TYPE;\n readonly tag: string | typeof Fragment;\n readonly attributes: Record<string, string | undefined>;\n readonly children: MjmlChild[];\n}\n\nexport type MjmlChild =\n | MjmlNode\n | string\n | number\n | boolean\n | null\n | undefined\n | MjmlChild[];\n\nexport function isMjmlNode(value: unknown): value is MjmlNode {\n return (\n typeof value === 'object' &&\n value !== null &&\n '$$typeof' in value &&\n value.$$typeof === MJML_NODE_TYPE\n );\n}\n\nexport function createNode(\n tag: string | typeof Fragment,\n attributes: Record<string, unknown>,\n children: MjmlChild[]\n): MjmlNode {\n const stringAttributes: Record<string, string | undefined> = {};\n\n for (const [key, value] of Object.entries(attributes)) {\n if (value === undefined || value === null) {\n continue;\n }\n if (value instanceof URL) {\n stringAttributes[key] = value.toString();\n } else {\n stringAttributes[key] = String(value);\n }\n }\n\n return {\n $$typeof: MJML_NODE_TYPE,\n tag,\n attributes: stringAttributes,\n children,\n };\n}\n","import { createNode, Fragment, type MjmlChild, type MjmlNode } from './ast';\nimport type {\n HtmlAnchorAttributes,\n HtmlGlobalAttributes,\n HtmlImgAttributes,\n HtmlListAttributes,\n HtmlMetaAttributes,\n HtmlTableCellAttributes,\n} from './html-types';\nimport type {\n MjAccordionAttributes,\n MjAccordionElementAttributes,\n MjAccordionTextAttributes,\n MjAccordionTitleAttributes,\n MjAllAttributes,\n MjAttributesAttributes,\n MjBodyAttributes,\n MjBreakpointAttributes,\n MjButtonAttributes,\n MjCarouselAttributes,\n MjCarouselImageAttributes,\n MjClassAttributes,\n MjColumnAttributes,\n MjDividerAttributes,\n MjFontAttributes,\n MjGroupAttributes,\n MjHeadAttributes,\n MjHeroAttributes,\n MjHtmlAttributeAttributes,\n MjHtmlAttributesAttributes,\n MjImageAttributes,\n MjIncludeAttributes,\n MjmlAttributes,\n MjNavbarAttributes,\n MjNavbarLinkAttributes,\n MjPreviewAttributes,\n MjRawAttributes,\n MjSectionAttributes,\n MjSelectorAttributes,\n MjSocialAttributes,\n MjSocialElementAttributes,\n MjSpacerAttributes,\n MjStyleAttributes,\n MjTableAttributes,\n MjTextAttributes,\n MjTitleAttributes,\n MjWrapperAttributes,\n} from './types';\n\nexport { Fragment };\n\nexport type PropsWithChildren<T = object> = T & { children?: MjmlChild };\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype Component = (props: any) => MjmlNode;\n\nexport function jsx(\n tag: string | typeof Fragment | Component,\n props: Record<string, unknown>,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _key?: string\n): MjmlNode {\n if (typeof tag === 'function') {\n return tag(props);\n }\n\n const { children, ...attributes } = props;\n\n const childArray: MjmlChild[] =\n children === undefined\n ? []\n : Array.isArray(children)\n ? children\n : [children as MjmlChild];\n\n return createNode(tag, attributes, childArray);\n}\n\nexport const jsxs = jsx;\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace JSX {\n export type Element = MjmlNode;\n export type ElementType = string | typeof Fragment | Component;\n\n export interface ElementChildrenAttribute {\n children: MjmlChild;\n }\n\n export interface IntrinsicElements {\n mjml: PropsWithChildren<MjmlAttributes>;\n 'mj-head': PropsWithChildren<MjHeadAttributes>;\n 'mj-body': PropsWithChildren<MjBodyAttributes>;\n 'mj-attributes': PropsWithChildren<MjAttributesAttributes>;\n 'mj-breakpoint': MjBreakpointAttributes;\n 'mj-font': MjFontAttributes;\n 'mj-html-attributes': PropsWithChildren<MjHtmlAttributesAttributes>;\n 'mj-preview': PropsWithChildren<MjPreviewAttributes>;\n 'mj-style': PropsWithChildren<MjStyleAttributes>;\n 'mj-title': PropsWithChildren<MjTitleAttributes>;\n 'mj-all': MjAllAttributes;\n 'mj-class': MjClassAttributes;\n 'mj-section': PropsWithChildren<MjSectionAttributes>;\n 'mj-column': PropsWithChildren<MjColumnAttributes>;\n 'mj-group': PropsWithChildren<MjGroupAttributes>;\n 'mj-wrapper': PropsWithChildren<MjWrapperAttributes>;\n 'mj-text': PropsWithChildren<MjTextAttributes>;\n 'mj-button': PropsWithChildren<MjButtonAttributes>;\n 'mj-image': MjImageAttributes;\n 'mj-divider': MjDividerAttributes;\n 'mj-spacer': MjSpacerAttributes;\n 'mj-table': PropsWithChildren<MjTableAttributes>;\n 'mj-raw': PropsWithChildren<MjRawAttributes>;\n 'mj-hero': PropsWithChildren<MjHeroAttributes>;\n 'mj-accordion': PropsWithChildren<MjAccordionAttributes>;\n 'mj-accordion-element': PropsWithChildren<MjAccordionElementAttributes>;\n 'mj-accordion-title': PropsWithChildren<MjAccordionTitleAttributes>;\n 'mj-accordion-text': PropsWithChildren<MjAccordionTextAttributes>;\n 'mj-carousel': PropsWithChildren<MjCarouselAttributes>;\n 'mj-carousel-image': MjCarouselImageAttributes;\n 'mj-navbar': PropsWithChildren<MjNavbarAttributes>;\n 'mj-navbar-link': PropsWithChildren<MjNavbarLinkAttributes>;\n 'mj-social': PropsWithChildren<MjSocialAttributes>;\n 'mj-social-element': PropsWithChildren<MjSocialElementAttributes>;\n 'mj-include': MjIncludeAttributes;\n 'mj-selector': PropsWithChildren<MjSelectorAttributes>;\n 'mj-html-attribute': PropsWithChildren<MjHtmlAttributeAttributes>;\n\n // HTML inline text elements (for mj-text)\n a: PropsWithChildren<HtmlAnchorAttributes>;\n span: PropsWithChildren<HtmlGlobalAttributes>;\n strong: PropsWithChildren<HtmlGlobalAttributes>;\n b: PropsWithChildren<HtmlGlobalAttributes>;\n em: PropsWithChildren<HtmlGlobalAttributes>;\n i: PropsWithChildren<HtmlGlobalAttributes>;\n u: PropsWithChildren<HtmlGlobalAttributes>;\n s: PropsWithChildren<HtmlGlobalAttributes>;\n small: PropsWithChildren<HtmlGlobalAttributes>;\n code: PropsWithChildren<HtmlGlobalAttributes>;\n sub: PropsWithChildren<HtmlGlobalAttributes>;\n sup: PropsWithChildren<HtmlGlobalAttributes>;\n br: HtmlGlobalAttributes;\n\n // HTML block text elements (for mj-text)\n div: PropsWithChildren<HtmlGlobalAttributes>;\n p: PropsWithChildren<HtmlGlobalAttributes>;\n h1: PropsWithChildren<HtmlGlobalAttributes>;\n h2: PropsWithChildren<HtmlGlobalAttributes>;\n h3: PropsWithChildren<HtmlGlobalAttributes>;\n h4: PropsWithChildren<HtmlGlobalAttributes>;\n h5: PropsWithChildren<HtmlGlobalAttributes>;\n h6: PropsWithChildren<HtmlGlobalAttributes>;\n ul: PropsWithChildren<HtmlListAttributes>;\n ol: PropsWithChildren<HtmlListAttributes>;\n li: PropsWithChildren<HtmlGlobalAttributes>;\n blockquote: PropsWithChildren<HtmlGlobalAttributes>;\n pre: PropsWithChildren<HtmlGlobalAttributes>;\n hr: HtmlGlobalAttributes;\n\n // HTML table elements (for mj-table - use mj-table instead of <table>)\n tr: PropsWithChildren<HtmlGlobalAttributes>;\n td: PropsWithChildren<HtmlTableCellAttributes>;\n th: PropsWithChildren<HtmlTableCellAttributes>;\n thead: PropsWithChildren<HtmlGlobalAttributes>;\n tbody: PropsWithChildren<HtmlGlobalAttributes>;\n\n // HTML media elements (for mj-table - mj-image can't be used inside mj-table)\n img: HtmlImgAttributes;\n\n // HTML head elements (for mj-raw in mj-head - dark mode support)\n meta: HtmlMetaAttributes;\n }\n}\n","import mjml2html from 'mjml';\nimport type { MjmlNode } from './ast';\nimport { isMjmlNode } from './ast';\nimport { serialize } from './serialize';\n\nexport interface RenderOptions {\n /**\n * Default fonts imported in the HTML rendered by HTML\n * ie. { 'Open Sans': 'https://fonts.googleapis.com/css?family=Open+Sans:300,400,500,700' }\n *\n * default: @see https://github.com/mjmlio/mjml/blob/master/packages/mjml-core/src/index.js\n */\n fonts?: { [key: string]: string } | undefined;\n\n /**\n * Option to keep comments in the HTML output\n * default: true\n */\n keepComments?: boolean | undefined;\n\n /**\n * @deprecated use js-beautify directly after processing the MJML\n *\n * Option to beautify the HTML output\n * default: false\n */\n beautify?: boolean | undefined;\n\n /**\n * @deprecated use html-minifier directly after processing the MJML\n *\n * Option to minify the HTML output\n *\n * default: false\n */\n minify?: boolean | undefined;\n /**\n * @deprecated @see minify\n *\n * Options for html minifier, see mjml-cli documentation for more info\n * Passed directly to html-minifier as options\n *\n * default: @see htmlMinify usage in mjml-core/src/index.js\n */\n minifyOptions?:\n | {\n collapseWhitespace?: boolean | undefined;\n minifyCSS?: boolean | undefined;\n removeEmptyAttributes?: boolean | undefined;\n }\n | undefined;\n\n /**\n * How to validate your MJML\n *\n * skip: your document is rendered without going through validation\n * soft: your document is going through validation and is rendered, even if it has errors\n * strict: your document is going through validation and is not rendered if it has any error\n *\n * default: soft\n */\n validationLevel?: 'strict' | 'soft' | 'skip' | undefined;\n\n /**\n * Full path of the specified file to use when resolving paths from mj-include components\n * default: '.'\n */\n filePath?: string | undefined;\n /**\n * The path or directory of the .mjmlconfig file\n * default: process.cwd()\n */\n mjmlConfigPath?: string | undefined;\n\n /**\n * Use the config attribute defined in the .mjmlconfig file.\n * The config passed into mjml2html overrides the .mjmlconfig.\n * default: false\n */\n useMjmlConfigOptions?: boolean | undefined;\n\n /**\n * optional setting when inlining css, see mjml-cli documentation for more info\n *\n */\n juicePreserveTags?:\n | { [index: string]: { start: string; end: string } }\n | undefined;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n juiceOptions?: any;\n\n /**\n * undocumented\n * a function returning html skeleton\n * default: see mjml-core/src/helpers/skeleton.js\n */\n skeleton?: string | (() => string) | undefined;\n\n actualPath?: string | undefined;\n /**\n * undocumented\n * ignore mj-include elements\n * default: false\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ignoreIncludes?: any;\n\n /**\n * see mjml-parser-xml\n */\n preprocessors?: Array<(xml: string) => string> | undefined;\n\n /**\n * Add media queries specific to printer when converting mjml into html. When enabling this option,\n * the html might not be compatible with all email clients anymore.\n */\n printerSupport?: boolean | undefined;\n}\n\ninterface MJMLJsonWithChildren {\n tagName: string;\n attributes: Record<string, unknown>;\n children: MJMLJsonObject[];\n}\n\ninterface MJMLJsonWithContent {\n tagName: string;\n attributes: Record<string, unknown>;\n content: string;\n}\n\ninterface MJMLJsonSelfClosingTag {\n tagName: string;\n attributes: Record<string, unknown>;\n}\n\ntype MJMLJsonObject =\n | MJMLJsonWithChildren\n | MJMLJsonWithContent\n | MJMLJsonSelfClosingTag;\n\ninterface MJMLParseError {\n line: number;\n message: string;\n tagName: string;\n formattedMessage: string;\n}\n\nexport interface RenderResult {\n html: string;\n json: MJMLJsonObject;\n errors: MJMLParseError[];\n}\n\nexport function render(\n mjml: MjmlNode | string,\n options?: RenderOptions\n): RenderResult {\n const str = isMjmlNode(mjml) ? serialize(mjml) : mjml;\n return mjml2html(str, options);\n}\n","import { Fragment, isMjmlNode, type MjmlChild, type MjmlNode } from './ast';\n\nconst SELF_CLOSING_TAGS = new Set([\n // MJML\n 'mj-all',\n 'mj-breakpoint',\n 'mj-carousel-image',\n 'mj-class',\n 'mj-divider',\n 'mj-font',\n 'mj-image',\n 'mj-include',\n 'mj-spacer',\n // HTML void elements\n 'br',\n 'hr',\n 'img',\n 'meta',\n]);\n\nfunction serializeAttributes(\n attributes: Record<string, string | undefined>\n): string {\n const parts: string[] = [];\n\n for (const [key, value] of Object.entries(attributes)) {\n if (value !== undefined) {\n parts.push(`${key}=\"${value}\"`);\n }\n }\n\n return parts.length > 0 ? ' ' + parts.join(' ') : '';\n}\n\nfunction serializeChildren(children: MjmlChild[]): string {\n const parts: string[] = [];\n\n for (const child of children) {\n if (\n child === null ||\n child === undefined ||\n child === true ||\n child === false\n ) {\n continue;\n }\n\n if (Array.isArray(child)) {\n parts.push(serializeChildren(child));\n } else if (isMjmlNode(child)) {\n parts.push(serializeNode(child));\n } else {\n parts.push(String(child));\n }\n }\n\n return parts.join('');\n}\n\nfunction serializeNode(node: MjmlNode): string {\n if (node.tag === Fragment) {\n return serializeChildren(node.children);\n }\n\n const tag = node.tag as string;\n const attrs = serializeAttributes(node.attributes);\n\n if (SELF_CLOSING_TAGS.has(tag)) {\n return `<${tag}${attrs} />`;\n }\n\n const content = serializeChildren(node.children);\n return `<${tag}${attrs}>${content}</${tag}>`;\n}\n\nexport function serialize(node: MjmlNode): string {\n return serializeNode(node);\n}\n\nexport const toMjmlString = serialize;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;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serialize.ts"],"sourcesContent":["export { Fragment, type MjmlChild, type MjmlNode } from './ast';\nexport type {\n HtmlAnchorAttributes,\n HtmlGlobalAttributes,\n HtmlImgAttributes,\n HtmlListAttributes,\n HtmlMetaAttributes,\n HtmlTableCellAttributes,\n} from './html-types';\nexport { jsx, jsxs, type JSX, type PropsWithChildren } from './jsx-runtime';\nexport { render, type RenderOptions, type RenderResult } from './render';\nexport { serialize } from './serialize';\n\nexport type {\n Align,\n CSSPixel,\n CSSSpacing,\n CSSUnit,\n CSSWidth,\n Color,\n Direction,\n HexColor,\n MjAccordionAttributes,\n MjAccordionElementAttributes,\n MjAccordionTextAttributes,\n MjAccordionTitleAttributes,\n MjAllAttributes,\n MjAttributesAttributes,\n MjBodyAttributes,\n MjBreakpointAttributes,\n MjButtonAttributes,\n MjCarouselAttributes,\n MjCarouselImageAttributes,\n MjClassAttributes,\n MjColumnAttributes,\n MjDividerAttributes,\n MjFontAttributes,\n MjGroupAttributes,\n MjHeadAttributes,\n MjHeroAttributes,\n MjHtmlAttributeAttributes,\n MjHtmlAttributesAttributes,\n MjImageAttributes,\n MjIncludeAttributes,\n MjNavbarAttributes,\n MjNavbarLinkAttributes,\n MjPreviewAttributes,\n MjRawAttributes,\n MjSectionAttributes,\n MjSelectorAttributes,\n MjSocialAttributes,\n MjSocialElementAttributes,\n MjSpacerAttributes,\n MjStyleAttributes,\n MjTableAttributes,\n MjTextAttributes,\n MjTitleAttributes,\n MjWrapperAttributes,\n MjmlAttributes,\n URLString,\n VerticalAlign,\n} from './types';\n","export const MJML_NODE_TYPE = Symbol.for('mjmx.node');\n\nexport const Fragment = Symbol.for('mjmx.fragment');\n\nexport interface MjmlNode {\n readonly $$typeof: typeof MJML_NODE_TYPE;\n readonly tag: string | typeof Fragment;\n readonly attributes: Record<string, string | undefined>;\n readonly children: MjmlChild[];\n}\n\nexport type MjmlChild =\n | MjmlNode\n | string\n | number\n | boolean\n | null\n | undefined\n | MjmlChild[];\n\nexport function isMjmlNode(value: unknown): value is MjmlNode {\n return (\n typeof value === 'object' &&\n value !== null &&\n '$$typeof' in value &&\n value.$$typeof === MJML_NODE_TYPE\n );\n}\n\nexport function createNode(\n tag: string | typeof Fragment,\n attributes: Record<string, unknown>,\n children: MjmlChild[]\n): MjmlNode {\n const stringAttributes: Record<string, string | undefined> = {};\n\n for (const [key, value] of Object.entries(attributes)) {\n if (value === undefined || value === null) {\n continue;\n }\n if (value instanceof URL) {\n stringAttributes[key] = value.toString();\n } else {\n stringAttributes[key] = String(value);\n }\n }\n\n return {\n $$typeof: MJML_NODE_TYPE,\n tag,\n attributes: stringAttributes,\n children,\n };\n}\n","import { createNode, Fragment, type MjmlChild, type MjmlNode } from './ast';\nimport type {\n HtmlAnchorAttributes,\n HtmlGlobalAttributes,\n HtmlImgAttributes,\n HtmlListAttributes,\n HtmlMetaAttributes,\n HtmlTableCellAttributes,\n} from './html-types';\nimport type {\n MjAccordionAttributes,\n MjAccordionElementAttributes,\n MjAccordionTextAttributes,\n MjAccordionTitleAttributes,\n MjAllAttributes,\n MjAttributesAttributes,\n MjBodyAttributes,\n MjBreakpointAttributes,\n MjButtonAttributes,\n MjCarouselAttributes,\n MjCarouselImageAttributes,\n MjClassAttributes,\n MjColumnAttributes,\n MjDividerAttributes,\n MjFontAttributes,\n MjGroupAttributes,\n MjHeadAttributes,\n MjHeroAttributes,\n MjHtmlAttributeAttributes,\n MjHtmlAttributesAttributes,\n MjImageAttributes,\n MjIncludeAttributes,\n MjmlAttributes,\n MjNavbarAttributes,\n MjNavbarLinkAttributes,\n MjPreviewAttributes,\n MjRawAttributes,\n MjSectionAttributes,\n MjSelectorAttributes,\n MjSocialAttributes,\n MjSocialElementAttributes,\n MjSpacerAttributes,\n MjStyleAttributes,\n MjTableAttributes,\n MjTextAttributes,\n MjTitleAttributes,\n MjWrapperAttributes,\n} from './types';\n\nexport { Fragment };\n\nexport type PropsWithChildren<T = object> = T & { children?: MjmlChild };\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype Component = (props: any) => MjmlNode;\n\nexport function jsx(\n tag: string | typeof Fragment | Component,\n props: Record<string, unknown>,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _key?: string\n): MjmlNode {\n if (typeof tag === 'function') {\n return tag(props);\n }\n\n const { children, ...attributes } = props;\n\n const childArray: MjmlChild[] =\n children === undefined\n ? []\n : Array.isArray(children)\n ? children\n : [children as MjmlChild];\n\n return createNode(tag, attributes, childArray);\n}\n\nexport const jsxs = jsx;\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace JSX {\n export type Element = MjmlNode;\n export type ElementType = string | typeof Fragment | Component;\n\n export interface ElementChildrenAttribute {\n children: MjmlChild;\n }\n\n export interface IntrinsicElements {\n mjml: PropsWithChildren<MjmlAttributes>;\n 'mj-head': PropsWithChildren<MjHeadAttributes>;\n 'mj-body': PropsWithChildren<MjBodyAttributes>;\n 'mj-attributes': PropsWithChildren<MjAttributesAttributes>;\n 'mj-breakpoint': MjBreakpointAttributes;\n 'mj-font': MjFontAttributes;\n 'mj-html-attributes': PropsWithChildren<MjHtmlAttributesAttributes>;\n 'mj-preview': PropsWithChildren<MjPreviewAttributes>;\n 'mj-style': PropsWithChildren<MjStyleAttributes>;\n 'mj-title': PropsWithChildren<MjTitleAttributes>;\n 'mj-all': MjAllAttributes;\n 'mj-class': MjClassAttributes;\n 'mj-section': PropsWithChildren<MjSectionAttributes>;\n 'mj-column': PropsWithChildren<MjColumnAttributes>;\n 'mj-group': PropsWithChildren<MjGroupAttributes>;\n 'mj-wrapper': PropsWithChildren<MjWrapperAttributes>;\n 'mj-text': PropsWithChildren<MjTextAttributes>;\n 'mj-button': PropsWithChildren<MjButtonAttributes>;\n 'mj-image': MjImageAttributes;\n 'mj-divider': MjDividerAttributes;\n 'mj-spacer': MjSpacerAttributes;\n 'mj-table': PropsWithChildren<MjTableAttributes>;\n 'mj-raw': PropsWithChildren<MjRawAttributes>;\n 'mj-hero': PropsWithChildren<MjHeroAttributes>;\n 'mj-accordion': PropsWithChildren<MjAccordionAttributes>;\n 'mj-accordion-element': PropsWithChildren<MjAccordionElementAttributes>;\n 'mj-accordion-title': PropsWithChildren<MjAccordionTitleAttributes>;\n 'mj-accordion-text': PropsWithChildren<MjAccordionTextAttributes>;\n 'mj-carousel': PropsWithChildren<MjCarouselAttributes>;\n 'mj-carousel-image': MjCarouselImageAttributes;\n 'mj-navbar': PropsWithChildren<MjNavbarAttributes>;\n 'mj-navbar-link': PropsWithChildren<MjNavbarLinkAttributes>;\n 'mj-social': PropsWithChildren<MjSocialAttributes>;\n 'mj-social-element': PropsWithChildren<MjSocialElementAttributes>;\n 'mj-include': MjIncludeAttributes;\n 'mj-selector': PropsWithChildren<MjSelectorAttributes>;\n 'mj-html-attribute': PropsWithChildren<MjHtmlAttributeAttributes>;\n\n // HTML inline text elements (for mj-text)\n a: PropsWithChildren<HtmlAnchorAttributes>;\n span: PropsWithChildren<HtmlGlobalAttributes>;\n strong: PropsWithChildren<HtmlGlobalAttributes>;\n b: PropsWithChildren<HtmlGlobalAttributes>;\n em: PropsWithChildren<HtmlGlobalAttributes>;\n i: PropsWithChildren<HtmlGlobalAttributes>;\n u: PropsWithChildren<HtmlGlobalAttributes>;\n s: PropsWithChildren<HtmlGlobalAttributes>;\n small: PropsWithChildren<HtmlGlobalAttributes>;\n code: PropsWithChildren<HtmlGlobalAttributes>;\n sub: PropsWithChildren<HtmlGlobalAttributes>;\n sup: PropsWithChildren<HtmlGlobalAttributes>;\n br: HtmlGlobalAttributes;\n\n // HTML block text elements (for mj-text)\n div: PropsWithChildren<HtmlGlobalAttributes>;\n p: PropsWithChildren<HtmlGlobalAttributes>;\n h1: PropsWithChildren<HtmlGlobalAttributes>;\n h2: PropsWithChildren<HtmlGlobalAttributes>;\n h3: PropsWithChildren<HtmlGlobalAttributes>;\n h4: PropsWithChildren<HtmlGlobalAttributes>;\n h5: PropsWithChildren<HtmlGlobalAttributes>;\n h6: PropsWithChildren<HtmlGlobalAttributes>;\n ul: PropsWithChildren<HtmlListAttributes>;\n ol: PropsWithChildren<HtmlListAttributes>;\n li: PropsWithChildren<HtmlGlobalAttributes>;\n blockquote: PropsWithChildren<HtmlGlobalAttributes>;\n pre: PropsWithChildren<HtmlGlobalAttributes>;\n hr: HtmlGlobalAttributes;\n\n // HTML table elements (for mj-table - use mj-table instead of <table>)\n tr: PropsWithChildren<HtmlGlobalAttributes>;\n td: PropsWithChildren<HtmlTableCellAttributes>;\n th: PropsWithChildren<HtmlTableCellAttributes>;\n thead: PropsWithChildren<HtmlGlobalAttributes>;\n tbody: PropsWithChildren<HtmlGlobalAttributes>;\n\n // HTML media elements (for mj-table - mj-image can't be used inside mj-table)\n img: HtmlImgAttributes;\n\n // HTML head elements (for mj-raw in mj-head - dark mode support)\n meta: HtmlMetaAttributes;\n }\n}\n","import mjml2html from 'mjml';\nimport type { MjmlNode } from './ast';\nimport { isMjmlNode } from './ast';\nimport { serialize } from './serialize';\n\nexport interface RenderOptions {\n /**\n * Default fonts imported in the HTML rendered by HTML\n * ie. { 'Open Sans': 'https://fonts.googleapis.com/css?family=Open+Sans:300,400,500,700' }\n *\n * default: @see https://github.com/mjmlio/mjml/blob/master/packages/mjml-core/src/index.js\n */\n fonts?: { [key: string]: string } | undefined;\n\n /**\n * Option to keep comments in the HTML output\n * default: true\n */\n keepComments?: boolean | undefined;\n\n /**\n * Beautify the HTML output using js-beautify.\n * Mutually exclusive with minify — if minify is true, beautify is skipped.\n * default: false\n */\n beautify?: boolean | undefined;\n\n /**\n * Minify the HTML output using htmlnano (with cssnano-preset-lite for CSS).\n * Takes priority over beautify when both are true.\n *\n * default: false\n */\n minify?: boolean | undefined;\n /**\n * Options passed to htmlnano when minify is true.\n * The minifyCss field accepts false, true, 'lite', or a cssnano options object.\n */\n minifyOptions?:\n | {\n collapseWhitespace?: boolean | undefined;\n minifyCss?:\n | boolean\n | 'lite'\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | { preset?: any; plugins?: any[]; configFile?: string }\n | undefined;\n /** @deprecated use minifyCss instead */\n minifyCSS?: boolean | undefined;\n removeEmptyAttributes?: boolean | undefined;\n minifyJs?: boolean | undefined;\n removeComments?: false | 'safe' | 'all' | undefined;\n }\n | undefined;\n\n /**\n * How to validate your MJML\n *\n * skip: your document is rendered without going through validation\n * soft: your document is going through validation and is rendered, even if it has errors\n * strict: your document is going through validation and is not rendered if it has any error\n *\n * default: soft\n */\n validationLevel?: 'strict' | 'soft' | 'skip' | undefined;\n\n /**\n * Full path of the specified file to use when resolving paths from mj-include components\n * default: '.'\n */\n filePath?: string | undefined;\n /**\n * The path or directory of the .mjmlconfig file\n * default: process.cwd()\n */\n mjmlConfigPath?: string | undefined;\n\n /**\n * Use the config attribute defined in the .mjmlconfig file.\n * The config passed into mjml2html overrides the .mjmlconfig.\n * default: false\n */\n useMjmlConfigOptions?: boolean | undefined;\n\n /**\n * optional setting when inlining css, see mjml-cli documentation for more info\n *\n */\n juicePreserveTags?:\n | { [index: string]: { start: string; end: string } }\n | undefined;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n juiceOptions?: any;\n\n /**\n * undocumented\n * a function returning html skeleton\n * default: see mjml-core/src/helpers/skeleton.js\n */\n skeleton?: string | (() => string) | undefined;\n\n actualPath?: string | undefined;\n /**\n * undocumented\n * ignore mj-include elements\n * default: false\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ignoreIncludes?: any;\n\n /**\n * see mjml-parser-xml\n */\n preprocessors?: Array<(xml: string) => string> | undefined;\n\n /**\n * Add media queries specific to printer when converting mjml into html. When enabling this option,\n * the html might not be compatible with all email clients anymore.\n */\n printerSupport?: boolean | undefined;\n}\n\ninterface MJMLJsonWithChildren {\n tagName: string;\n attributes: Record<string, unknown>;\n children: MJMLJsonObject[];\n}\n\ninterface MJMLJsonWithContent {\n tagName: string;\n attributes: Record<string, unknown>;\n content: string;\n}\n\ninterface MJMLJsonSelfClosingTag {\n tagName: string;\n attributes: Record<string, unknown>;\n}\n\ntype MJMLJsonObject =\n | MJMLJsonWithChildren\n | MJMLJsonWithContent\n | MJMLJsonSelfClosingTag;\n\ninterface MJMLParseError {\n line: number;\n message: string;\n tagName: string;\n formattedMessage: string;\n}\n\nexport interface RenderResult {\n html: string;\n json: MJMLJsonObject;\n errors: MJMLParseError[];\n}\n\nexport function render(\n mjml: MjmlNode | string,\n options?: RenderOptions\n): Promise<RenderResult> {\n const str = isMjmlNode(mjml) ? serialize(mjml) : mjml;\n return mjml2html(str, options);\n}\n","import { Fragment, isMjmlNode, type MjmlChild, type MjmlNode } from './ast';\n\nconst SELF_CLOSING_TAGS = new Set([\n // MJML\n 'mj-all',\n 'mj-breakpoint',\n 'mj-carousel-image',\n 'mj-class',\n 'mj-divider',\n 'mj-font',\n 'mj-image',\n 'mj-include',\n 'mj-spacer',\n // HTML void elements\n 'br',\n 'hr',\n 'img',\n 'meta',\n]);\n\nfunction serializeAttributes(\n attributes: Record<string, string | undefined>\n): string {\n const parts: string[] = [];\n\n for (const [key, value] of Object.entries(attributes)) {\n if (value !== undefined) {\n parts.push(`${key}=\"${value}\"`);\n }\n }\n\n return parts.length > 0 ? ' ' + parts.join(' ') : '';\n}\n\nfunction serializeChildren(children: MjmlChild[]): string {\n const parts: string[] = [];\n\n for (const child of children) {\n if (\n child === null ||\n child === undefined ||\n child === true ||\n child === false\n ) {\n continue;\n }\n\n if (Array.isArray(child)) {\n parts.push(serializeChildren(child));\n } else if (isMjmlNode(child)) {\n parts.push(serializeNode(child));\n } else {\n parts.push(String(child));\n }\n }\n\n return parts.join('');\n}\n\nfunction serializeNode(node: MjmlNode): string {\n if (node.tag === Fragment) {\n return serializeChildren(node.children);\n }\n\n const tag = node.tag as string;\n const attrs = serializeAttributes(node.attributes);\n\n if (SELF_CLOSING_TAGS.has(tag)) {\n return `<${tag}${attrs} />`;\n }\n\n const content = serializeChildren(node.children);\n return `<${tag}${attrs}>${content}</${tag}>`;\n}\n\nexport function serialize(node: MjmlNode): string {\n return serializeNode(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2html"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as MjmlNode } from './jsx-dev-runtime-
|
|
2
|
-
export { A as Align, C as CSSPixel, a as CSSSpacing, b as CSSUnit, c as CSSWidth, d as Color, D as Direction, F as Fragment, H as HexColor, e as HtmlAnchorAttributes, f as HtmlGlobalAttributes, g as HtmlImgAttributes, h as HtmlListAttributes, i as HtmlMetaAttributes, j as HtmlTableCellAttributes, J as JSX, k as MjAccordionAttributes, l as MjAccordionElementAttributes, m as MjAccordionTextAttributes, n as MjAccordionTitleAttributes, o as MjAllAttributes, p as MjAttributesAttributes, q as MjBodyAttributes, r as MjBreakpointAttributes, s as MjButtonAttributes, t as MjCarouselAttributes, u as MjCarouselImageAttributes, v as MjClassAttributes, w as MjColumnAttributes, x as MjDividerAttributes, y as MjFontAttributes, z as MjGroupAttributes, B as MjHeadAttributes, E as MjHeroAttributes, G as MjHtmlAttributeAttributes, I as MjHtmlAttributesAttributes, K as MjImageAttributes, L as MjIncludeAttributes, N as MjNavbarAttributes, O as MjNavbarLinkAttributes, P as MjPreviewAttributes, Q as MjRawAttributes, R as MjSectionAttributes, S as MjSelectorAttributes, T as MjSocialAttributes, U as MjSocialElementAttributes, V as MjSpacerAttributes, W as MjStyleAttributes, X as MjTableAttributes, Y as MjTextAttributes, Z as MjTitleAttributes, _ as MjWrapperAttributes, $ as MjmlAttributes, a0 as MjmlChild, a1 as PropsWithChildren, a2 as URLString, a3 as VerticalAlign, a4 as jsx, a5 as jsxs } from './jsx-dev-runtime-
|
|
1
|
+
import { M as MjmlNode } from './jsx-dev-runtime-B3GH8Uon.cjs';
|
|
2
|
+
export { A as Align, C as CSSPixel, a as CSSSpacing, b as CSSUnit, c as CSSWidth, d as Color, D as Direction, F as Fragment, H as HexColor, e as HtmlAnchorAttributes, f as HtmlGlobalAttributes, g as HtmlImgAttributes, h as HtmlListAttributes, i as HtmlMetaAttributes, j as HtmlTableCellAttributes, J as JSX, k as MjAccordionAttributes, l as MjAccordionElementAttributes, m as MjAccordionTextAttributes, n as MjAccordionTitleAttributes, o as MjAllAttributes, p as MjAttributesAttributes, q as MjBodyAttributes, r as MjBreakpointAttributes, s as MjButtonAttributes, t as MjCarouselAttributes, u as MjCarouselImageAttributes, v as MjClassAttributes, w as MjColumnAttributes, x as MjDividerAttributes, y as MjFontAttributes, z as MjGroupAttributes, B as MjHeadAttributes, E as MjHeroAttributes, G as MjHtmlAttributeAttributes, I as MjHtmlAttributesAttributes, K as MjImageAttributes, L as MjIncludeAttributes, N as MjNavbarAttributes, O as MjNavbarLinkAttributes, P as MjPreviewAttributes, Q as MjRawAttributes, R as MjSectionAttributes, S as MjSelectorAttributes, T as MjSocialAttributes, U as MjSocialElementAttributes, V as MjSpacerAttributes, W as MjStyleAttributes, X as MjTableAttributes, Y as MjTextAttributes, Z as MjTitleAttributes, _ as MjWrapperAttributes, $ as MjmlAttributes, a0 as MjmlChild, a1 as PropsWithChildren, a2 as URLString, a3 as VerticalAlign, a4 as jsx, a5 as jsxs } from './jsx-dev-runtime-B3GH8Uon.cjs';
|
|
3
3
|
|
|
4
4
|
interface RenderOptions {
|
|
5
5
|
/**
|
|
@@ -17,32 +17,34 @@ interface RenderOptions {
|
|
|
17
17
|
*/
|
|
18
18
|
keepComments?: boolean | undefined;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* Option to beautify the HTML output
|
|
20
|
+
* Beautify the HTML output using js-beautify.
|
|
21
|
+
* Mutually exclusive with minify — if minify is true, beautify is skipped.
|
|
23
22
|
* default: false
|
|
24
23
|
*/
|
|
25
24
|
beautify?: boolean | undefined;
|
|
26
25
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* Option to minify the HTML output
|
|
26
|
+
* Minify the HTML output using htmlnano (with cssnano-preset-lite for CSS).
|
|
27
|
+
* Takes priority over beautify when both are true.
|
|
30
28
|
*
|
|
31
29
|
* default: false
|
|
32
30
|
*/
|
|
33
31
|
minify?: boolean | undefined;
|
|
34
32
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* Options for html minifier, see mjml-cli documentation for more info
|
|
38
|
-
* Passed directly to html-minifier as options
|
|
39
|
-
*
|
|
40
|
-
* default: @see htmlMinify usage in mjml-core/src/index.js
|
|
33
|
+
* Options passed to htmlnano when minify is true.
|
|
34
|
+
* The minifyCss field accepts false, true, 'lite', or a cssnano options object.
|
|
41
35
|
*/
|
|
42
36
|
minifyOptions?: {
|
|
43
37
|
collapseWhitespace?: boolean | undefined;
|
|
38
|
+
minifyCss?: boolean | 'lite' | {
|
|
39
|
+
preset?: any;
|
|
40
|
+
plugins?: any[];
|
|
41
|
+
configFile?: string;
|
|
42
|
+
} | undefined;
|
|
43
|
+
/** @deprecated use minifyCss instead */
|
|
44
44
|
minifyCSS?: boolean | undefined;
|
|
45
45
|
removeEmptyAttributes?: boolean | undefined;
|
|
46
|
+
minifyJs?: boolean | undefined;
|
|
47
|
+
removeComments?: false | 'safe' | 'all' | undefined;
|
|
46
48
|
} | undefined;
|
|
47
49
|
/**
|
|
48
50
|
* How to validate your MJML
|
|
@@ -130,7 +132,7 @@ interface RenderResult {
|
|
|
130
132
|
json: MJMLJsonObject;
|
|
131
133
|
errors: MJMLParseError[];
|
|
132
134
|
}
|
|
133
|
-
declare function render(mjml: MjmlNode | string, options?: RenderOptions): RenderResult
|
|
135
|
+
declare function render(mjml: MjmlNode | string, options?: RenderOptions): Promise<RenderResult>;
|
|
134
136
|
|
|
135
137
|
declare function serialize(node: MjmlNode): string;
|
|
136
138
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as MjmlNode } from './jsx-dev-runtime-
|
|
2
|
-
export { A as Align, C as CSSPixel, a as CSSSpacing, b as CSSUnit, c as CSSWidth, d as Color, D as Direction, F as Fragment, H as HexColor, e as HtmlAnchorAttributes, f as HtmlGlobalAttributes, g as HtmlImgAttributes, h as HtmlListAttributes, i as HtmlMetaAttributes, j as HtmlTableCellAttributes, J as JSX, k as MjAccordionAttributes, l as MjAccordionElementAttributes, m as MjAccordionTextAttributes, n as MjAccordionTitleAttributes, o as MjAllAttributes, p as MjAttributesAttributes, q as MjBodyAttributes, r as MjBreakpointAttributes, s as MjButtonAttributes, t as MjCarouselAttributes, u as MjCarouselImageAttributes, v as MjClassAttributes, w as MjColumnAttributes, x as MjDividerAttributes, y as MjFontAttributes, z as MjGroupAttributes, B as MjHeadAttributes, E as MjHeroAttributes, G as MjHtmlAttributeAttributes, I as MjHtmlAttributesAttributes, K as MjImageAttributes, L as MjIncludeAttributes, N as MjNavbarAttributes, O as MjNavbarLinkAttributes, P as MjPreviewAttributes, Q as MjRawAttributes, R as MjSectionAttributes, S as MjSelectorAttributes, T as MjSocialAttributes, U as MjSocialElementAttributes, V as MjSpacerAttributes, W as MjStyleAttributes, X as MjTableAttributes, Y as MjTextAttributes, Z as MjTitleAttributes, _ as MjWrapperAttributes, $ as MjmlAttributes, a0 as MjmlChild, a1 as PropsWithChildren, a2 as URLString, a3 as VerticalAlign, a4 as jsx, a5 as jsxs } from './jsx-dev-runtime-
|
|
1
|
+
import { M as MjmlNode } from './jsx-dev-runtime-B3GH8Uon.js';
|
|
2
|
+
export { A as Align, C as CSSPixel, a as CSSSpacing, b as CSSUnit, c as CSSWidth, d as Color, D as Direction, F as Fragment, H as HexColor, e as HtmlAnchorAttributes, f as HtmlGlobalAttributes, g as HtmlImgAttributes, h as HtmlListAttributes, i as HtmlMetaAttributes, j as HtmlTableCellAttributes, J as JSX, k as MjAccordionAttributes, l as MjAccordionElementAttributes, m as MjAccordionTextAttributes, n as MjAccordionTitleAttributes, o as MjAllAttributes, p as MjAttributesAttributes, q as MjBodyAttributes, r as MjBreakpointAttributes, s as MjButtonAttributes, t as MjCarouselAttributes, u as MjCarouselImageAttributes, v as MjClassAttributes, w as MjColumnAttributes, x as MjDividerAttributes, y as MjFontAttributes, z as MjGroupAttributes, B as MjHeadAttributes, E as MjHeroAttributes, G as MjHtmlAttributeAttributes, I as MjHtmlAttributesAttributes, K as MjImageAttributes, L as MjIncludeAttributes, N as MjNavbarAttributes, O as MjNavbarLinkAttributes, P as MjPreviewAttributes, Q as MjRawAttributes, R as MjSectionAttributes, S as MjSelectorAttributes, T as MjSocialAttributes, U as MjSocialElementAttributes, V as MjSpacerAttributes, W as MjStyleAttributes, X as MjTableAttributes, Y as MjTextAttributes, Z as MjTitleAttributes, _ as MjWrapperAttributes, $ as MjmlAttributes, a0 as MjmlChild, a1 as PropsWithChildren, a2 as URLString, a3 as VerticalAlign, a4 as jsx, a5 as jsxs } from './jsx-dev-runtime-B3GH8Uon.js';
|
|
3
3
|
|
|
4
4
|
interface RenderOptions {
|
|
5
5
|
/**
|
|
@@ -17,32 +17,34 @@ interface RenderOptions {
|
|
|
17
17
|
*/
|
|
18
18
|
keepComments?: boolean | undefined;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* Option to beautify the HTML output
|
|
20
|
+
* Beautify the HTML output using js-beautify.
|
|
21
|
+
* Mutually exclusive with minify — if minify is true, beautify is skipped.
|
|
23
22
|
* default: false
|
|
24
23
|
*/
|
|
25
24
|
beautify?: boolean | undefined;
|
|
26
25
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* Option to minify the HTML output
|
|
26
|
+
* Minify the HTML output using htmlnano (with cssnano-preset-lite for CSS).
|
|
27
|
+
* Takes priority over beautify when both are true.
|
|
30
28
|
*
|
|
31
29
|
* default: false
|
|
32
30
|
*/
|
|
33
31
|
minify?: boolean | undefined;
|
|
34
32
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* Options for html minifier, see mjml-cli documentation for more info
|
|
38
|
-
* Passed directly to html-minifier as options
|
|
39
|
-
*
|
|
40
|
-
* default: @see htmlMinify usage in mjml-core/src/index.js
|
|
33
|
+
* Options passed to htmlnano when minify is true.
|
|
34
|
+
* The minifyCss field accepts false, true, 'lite', or a cssnano options object.
|
|
41
35
|
*/
|
|
42
36
|
minifyOptions?: {
|
|
43
37
|
collapseWhitespace?: boolean | undefined;
|
|
38
|
+
minifyCss?: boolean | 'lite' | {
|
|
39
|
+
preset?: any;
|
|
40
|
+
plugins?: any[];
|
|
41
|
+
configFile?: string;
|
|
42
|
+
} | undefined;
|
|
43
|
+
/** @deprecated use minifyCss instead */
|
|
44
44
|
minifyCSS?: boolean | undefined;
|
|
45
45
|
removeEmptyAttributes?: boolean | undefined;
|
|
46
|
+
minifyJs?: boolean | undefined;
|
|
47
|
+
removeComments?: false | 'safe' | 'all' | undefined;
|
|
46
48
|
} | undefined;
|
|
47
49
|
/**
|
|
48
50
|
* How to validate your MJML
|
|
@@ -130,7 +132,7 @@ interface RenderResult {
|
|
|
130
132
|
json: MJMLJsonObject;
|
|
131
133
|
errors: MJMLParseError[];
|
|
132
134
|
}
|
|
133
|
-
declare function render(mjml: MjmlNode | string, options?: RenderOptions): RenderResult
|
|
135
|
+
declare function render(mjml: MjmlNode | string, options?: RenderOptions): Promise<RenderResult>;
|
|
134
136
|
|
|
135
137
|
declare function serialize(node: MjmlNode): string;
|
|
136
138
|
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/render.ts","../src/serialize.ts"],"sourcesContent":["import mjml2html from 'mjml';\nimport type { MjmlNode } from './ast';\nimport { isMjmlNode } from './ast';\nimport { serialize } from './serialize';\n\nexport interface RenderOptions {\n /**\n * Default fonts imported in the HTML rendered by HTML\n * ie. { 'Open Sans': 'https://fonts.googleapis.com/css?family=Open+Sans:300,400,500,700' }\n *\n * default: @see https://github.com/mjmlio/mjml/blob/master/packages/mjml-core/src/index.js\n */\n fonts?: { [key: string]: string } | undefined;\n\n /**\n * Option to keep comments in the HTML output\n * default: true\n */\n keepComments?: boolean | undefined;\n\n /**\n *
|
|
1
|
+
{"version":3,"sources":["../src/render.ts","../src/serialize.ts"],"sourcesContent":["import mjml2html from 'mjml';\nimport type { MjmlNode } from './ast';\nimport { isMjmlNode } from './ast';\nimport { serialize } from './serialize';\n\nexport interface RenderOptions {\n /**\n * Default fonts imported in the HTML rendered by HTML\n * ie. { 'Open Sans': 'https://fonts.googleapis.com/css?family=Open+Sans:300,400,500,700' }\n *\n * default: @see https://github.com/mjmlio/mjml/blob/master/packages/mjml-core/src/index.js\n */\n fonts?: { [key: string]: string } | undefined;\n\n /**\n * Option to keep comments in the HTML output\n * default: true\n */\n keepComments?: boolean | undefined;\n\n /**\n * Beautify the HTML output using js-beautify.\n * Mutually exclusive with minify — if minify is true, beautify is skipped.\n * default: false\n */\n beautify?: boolean | undefined;\n\n /**\n * Minify the HTML output using htmlnano (with cssnano-preset-lite for CSS).\n * Takes priority over beautify when both are true.\n *\n * default: false\n */\n minify?: boolean | undefined;\n /**\n * Options passed to htmlnano when minify is true.\n * The minifyCss field accepts false, true, 'lite', or a cssnano options object.\n */\n minifyOptions?:\n | {\n collapseWhitespace?: boolean | undefined;\n minifyCss?:\n | boolean\n | 'lite'\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | { preset?: any; plugins?: any[]; configFile?: string }\n | undefined;\n /** @deprecated use minifyCss instead */\n minifyCSS?: boolean | undefined;\n removeEmptyAttributes?: boolean | undefined;\n minifyJs?: boolean | undefined;\n removeComments?: false | 'safe' | 'all' | undefined;\n }\n | undefined;\n\n /**\n * How to validate your MJML\n *\n * skip: your document is rendered without going through validation\n * soft: your document is going through validation and is rendered, even if it has errors\n * strict: your document is going through validation and is not rendered if it has any error\n *\n * default: soft\n */\n validationLevel?: 'strict' | 'soft' | 'skip' | undefined;\n\n /**\n * Full path of the specified file to use when resolving paths from mj-include components\n * default: '.'\n */\n filePath?: string | undefined;\n /**\n * The path or directory of the .mjmlconfig file\n * default: process.cwd()\n */\n mjmlConfigPath?: string | undefined;\n\n /**\n * Use the config attribute defined in the .mjmlconfig file.\n * The config passed into mjml2html overrides the .mjmlconfig.\n * default: false\n */\n useMjmlConfigOptions?: boolean | undefined;\n\n /**\n * optional setting when inlining css, see mjml-cli documentation for more info\n *\n */\n juicePreserveTags?:\n | { [index: string]: { start: string; end: string } }\n | undefined;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n juiceOptions?: any;\n\n /**\n * undocumented\n * a function returning html skeleton\n * default: see mjml-core/src/helpers/skeleton.js\n */\n skeleton?: string | (() => string) | undefined;\n\n actualPath?: string | undefined;\n /**\n * undocumented\n * ignore mj-include elements\n * default: false\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ignoreIncludes?: any;\n\n /**\n * see mjml-parser-xml\n */\n preprocessors?: Array<(xml: string) => string> | undefined;\n\n /**\n * Add media queries specific to printer when converting mjml into html. When enabling this option,\n * the html might not be compatible with all email clients anymore.\n */\n printerSupport?: boolean | undefined;\n}\n\ninterface MJMLJsonWithChildren {\n tagName: string;\n attributes: Record<string, unknown>;\n children: MJMLJsonObject[];\n}\n\ninterface MJMLJsonWithContent {\n tagName: string;\n attributes: Record<string, unknown>;\n content: string;\n}\n\ninterface MJMLJsonSelfClosingTag {\n tagName: string;\n attributes: Record<string, unknown>;\n}\n\ntype MJMLJsonObject =\n | MJMLJsonWithChildren\n | MJMLJsonWithContent\n | MJMLJsonSelfClosingTag;\n\ninterface MJMLParseError {\n line: number;\n message: string;\n tagName: string;\n formattedMessage: string;\n}\n\nexport interface RenderResult {\n html: string;\n json: MJMLJsonObject;\n errors: MJMLParseError[];\n}\n\nexport function render(\n mjml: MjmlNode | string,\n options?: RenderOptions\n): Promise<RenderResult> {\n const str = isMjmlNode(mjml) ? serialize(mjml) : mjml;\n return mjml2html(str, options);\n}\n","import { Fragment, isMjmlNode, type MjmlChild, type MjmlNode } from './ast';\n\nconst SELF_CLOSING_TAGS = new Set([\n // MJML\n 'mj-all',\n 'mj-breakpoint',\n 'mj-carousel-image',\n 'mj-class',\n 'mj-divider',\n 'mj-font',\n 'mj-image',\n 'mj-include',\n 'mj-spacer',\n // HTML void elements\n 'br',\n 'hr',\n 'img',\n 'meta',\n]);\n\nfunction serializeAttributes(\n attributes: Record<string, string | undefined>\n): string {\n const parts: string[] = [];\n\n for (const [key, value] of Object.entries(attributes)) {\n if (value !== undefined) {\n parts.push(`${key}=\"${value}\"`);\n }\n }\n\n return parts.length > 0 ? ' ' + parts.join(' ') : '';\n}\n\nfunction serializeChildren(children: MjmlChild[]): string {\n const parts: string[] = [];\n\n for (const child of children) {\n if (\n child === null ||\n child === undefined ||\n child === true ||\n child === false\n ) {\n continue;\n }\n\n if (Array.isArray(child)) {\n parts.push(serializeChildren(child));\n } else if (isMjmlNode(child)) {\n parts.push(serializeNode(child));\n } else {\n parts.push(String(child));\n }\n }\n\n return parts.join('');\n}\n\nfunction serializeNode(node: MjmlNode): string {\n if (node.tag === Fragment) {\n return serializeChildren(node.children);\n }\n\n const tag = node.tag as string;\n const attrs = serializeAttributes(node.attributes);\n\n if (SELF_CLOSING_TAGS.has(tag)) {\n return `<${tag}${attrs} />`;\n }\n\n const content = serializeChildren(node.children);\n return `<${tag}${attrs}>${content}</${tag}>`;\n}\n\nexport function serialize(node: MjmlNode): string {\n return serializeNode(node);\n}\n\nexport const toMjmlString = serialize;\n"],"mappings":";;;;;;;;AAAA,OAAO,eAAe;;;ACEtB,IAAM,oBAAoB,oBAAI,IAAI;AAAA;AAAA,EAEhC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,SAAS,oBACP,YACQ;AACR,QAAM,QAAkB,CAAC;AAEzB,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,UAAU,GAAG;AACrD,QAAI,UAAU,QAAW;AACvB,YAAM,KAAK,GAAG,GAAG,KAAK,KAAK,GAAG;AAAA,IAChC;AAAA,EACF;AAEA,SAAO,MAAM,SAAS,IAAI,MAAM,MAAM,KAAK,GAAG,IAAI;AACpD;AAEA,SAAS,kBAAkB,UAA+B;AACxD,QAAM,QAAkB,CAAC;AAEzB,aAAW,SAAS,UAAU;AAC5B,QACE,UAAU,QACV,UAAU,UACV,UAAU,QACV,UAAU,OACV;AACA;AAAA,IACF;AAEA,QAAI,MAAM,QAAQ,KAAK,GAAG;AACxB,YAAM,KAAK,kBAAkB,KAAK,CAAC;AAAA,IACrC,WAAW,WAAW,KAAK,GAAG;AAC5B,YAAM,KAAK,cAAc,KAAK,CAAC;AAAA,IACjC,OAAO;AACL,YAAM,KAAK,OAAO,KAAK,CAAC;AAAA,IAC1B;AAAA,EACF;AAEA,SAAO,MAAM,KAAK,EAAE;AACtB;AAEA,SAAS,cAAc,MAAwB;AAC7C,MAAI,KAAK,QAAQ,UAAU;AACzB,WAAO,kBAAkB,KAAK,QAAQ;AAAA,EACxC;AAEA,QAAM,MAAM,KAAK;AACjB,QAAM,QAAQ,oBAAoB,KAAK,UAAU;AAEjD,MAAI,kBAAkB,IAAI,GAAG,GAAG;AAC9B,WAAO,IAAI,GAAG,GAAG,KAAK;AAAA,EACxB;AAEA,QAAM,UAAU,kBAAkB,KAAK,QAAQ;AAC/C,SAAO,IAAI,GAAG,GAAG,KAAK,IAAI,OAAO,KAAK,GAAG;AAC3C;AAEO,SAAS,UAAU,MAAwB;AAChD,SAAO,cAAc,IAAI;AAC3B;;;ADiFO,SAAS,OACd,MACA,SACuB;AACvB,QAAM,MAAM,WAAW,IAAI,IAAI,UAAU,IAAI,IAAI;AACjD,SAAO,UAAU,KAAK,OAAO;AAC/B;","names":[]}
|
|
@@ -311,11 +311,13 @@ interface MjSectionAttributes extends PaddingProps, BorderProps {
|
|
|
311
311
|
'background-url'?: URLString;
|
|
312
312
|
direction?: Direction;
|
|
313
313
|
'full-width'?: 'full-width';
|
|
314
|
+
gutter?: CSSWidth;
|
|
314
315
|
'text-align'?: Align;
|
|
315
316
|
'css-class'?: string;
|
|
316
317
|
}
|
|
317
318
|
interface MjSocialAttributes extends PaddingProps {
|
|
318
319
|
align?: Align;
|
|
320
|
+
border?: string;
|
|
319
321
|
'border-radius'?: CSSUnit;
|
|
320
322
|
color?: Color;
|
|
321
323
|
'container-background-color'?: Color;
|
|
@@ -337,6 +339,7 @@ interface MjSocialElementAttributes extends PaddingProps {
|
|
|
337
339
|
align?: Align;
|
|
338
340
|
alt?: string;
|
|
339
341
|
'background-color'?: Color;
|
|
342
|
+
border?: string;
|
|
340
343
|
'border-radius'?: CSSUnit;
|
|
341
344
|
color?: Color;
|
|
342
345
|
'font-family'?: string;
|
|
@@ -311,11 +311,13 @@ interface MjSectionAttributes extends PaddingProps, BorderProps {
|
|
|
311
311
|
'background-url'?: URLString;
|
|
312
312
|
direction?: Direction;
|
|
313
313
|
'full-width'?: 'full-width';
|
|
314
|
+
gutter?: CSSWidth;
|
|
314
315
|
'text-align'?: Align;
|
|
315
316
|
'css-class'?: string;
|
|
316
317
|
}
|
|
317
318
|
interface MjSocialAttributes extends PaddingProps {
|
|
318
319
|
align?: Align;
|
|
320
|
+
border?: string;
|
|
319
321
|
'border-radius'?: CSSUnit;
|
|
320
322
|
color?: Color;
|
|
321
323
|
'container-background-color'?: Color;
|
|
@@ -337,6 +339,7 @@ interface MjSocialElementAttributes extends PaddingProps {
|
|
|
337
339
|
align?: Align;
|
|
338
340
|
alt?: string;
|
|
339
341
|
'background-color'?: Color;
|
|
342
|
+
border?: string;
|
|
340
343
|
'border-radius'?: CSSUnit;
|
|
341
344
|
color?: Color;
|
|
342
345
|
'font-family'?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { F as Fragment, J as JSX, a4 as jsx, a4 as jsxDEV, a5 as jsxs } from './jsx-dev-runtime-
|
|
1
|
+
export { F as Fragment, J as JSX, a4 as jsx, a4 as jsxDEV, a5 as jsxs } from './jsx-dev-runtime-B3GH8Uon.cjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { F as Fragment, J as JSX, a4 as jsx, a4 as jsxDEV, a5 as jsxs } from './jsx-dev-runtime-
|
|
1
|
+
export { F as Fragment, J as JSX, a4 as jsx, a4 as jsxDEV, a5 as jsxs } from './jsx-dev-runtime-B3GH8Uon.js';
|
package/dist/jsx-runtime.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { F as Fragment, J as JSX, a1 as PropsWithChildren, a4 as jsx, a5 as jsxs } from './jsx-dev-runtime-
|
|
1
|
+
export { F as Fragment, J as JSX, a1 as PropsWithChildren, a4 as jsx, a5 as jsxs } from './jsx-dev-runtime-B3GH8Uon.cjs';
|
package/dist/jsx-runtime.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { F as Fragment, J as JSX, a1 as PropsWithChildren, a4 as jsx, a5 as jsxs } from './jsx-dev-runtime-
|
|
1
|
+
export { F as Fragment, J as JSX, a1 as PropsWithChildren, a4 as jsx, a5 as jsxs } from './jsx-dev-runtime-B3GH8Uon.js';
|
package/package.json
CHANGED
|
@@ -1,23 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mjmx/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Write mjml using JSX syntax",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"mjml",
|
|
7
|
-
"jsx",
|
|
8
6
|
"email",
|
|
7
|
+
"jsx",
|
|
8
|
+
"mjml",
|
|
9
9
|
"typescript"
|
|
10
10
|
],
|
|
11
|
+
"homepage": "https://mjmx.dev",
|
|
11
12
|
"bugs": {
|
|
12
|
-
"url": "https://
|
|
13
|
+
"url": "https://gitlab.com/skwee357/mjmx/-/issues"
|
|
13
14
|
},
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"author": "Dmitry Kudryavtsev <contact@kudmitry.com>",
|
|
14
17
|
"repository": {
|
|
15
18
|
"type": "git",
|
|
16
|
-
"url": "https://
|
|
19
|
+
"url": "https://gitlab.com/skwee357/mjmx"
|
|
17
20
|
},
|
|
18
|
-
"
|
|
19
|
-
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"README.md",
|
|
24
|
+
"LICENSE",
|
|
25
|
+
"package.json"
|
|
26
|
+
],
|
|
20
27
|
"type": "module",
|
|
28
|
+
"main": "./dist/index.cjs",
|
|
29
|
+
"module": "./dist/index.js",
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
21
31
|
"exports": {
|
|
22
32
|
".": {
|
|
23
33
|
"import": {
|
|
@@ -50,43 +60,32 @@
|
|
|
50
60
|
}
|
|
51
61
|
}
|
|
52
62
|
},
|
|
53
|
-
"
|
|
54
|
-
"module": "./dist/index.js",
|
|
55
|
-
"types": "./dist/index.d.ts",
|
|
56
|
-
"files": [
|
|
57
|
-
"dist",
|
|
58
|
-
"README.md",
|
|
59
|
-
"LICENSE",
|
|
60
|
-
"package.json"
|
|
61
|
-
],
|
|
63
|
+
"dependencies": {},
|
|
62
64
|
"devDependencies": {
|
|
63
|
-
"@changesets/changelog-
|
|
64
|
-
"@changesets/cli": "^2.
|
|
65
|
-
"@
|
|
66
|
-
"@types/mjml": "^
|
|
67
|
-
"@types/node": "^25.
|
|
68
|
-
"@vitest/coverage-v8": "^4.
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"prettier-plugin-organize-imports": "^4.3.0",
|
|
72
|
-
"prettier-plugin-packagejson": "^3.0.0",
|
|
65
|
+
"@changesets/changelog-git": "^0.2.0",
|
|
66
|
+
"@changesets/cli": "^2.31.0",
|
|
67
|
+
"@types/mjml": "^5.0.0",
|
|
68
|
+
"@types/mjml-core": "^5.0.0",
|
|
69
|
+
"@types/node": "^25.6.0",
|
|
70
|
+
"@vitest/coverage-v8": "^4.1.5",
|
|
71
|
+
"oxfmt": "^0.46.0",
|
|
72
|
+
"oxlint": "^1.61.0",
|
|
73
73
|
"tsup": "^8.5.1",
|
|
74
|
-
"typescript": "^
|
|
75
|
-
"
|
|
76
|
-
"vitest": "^4.0.18"
|
|
74
|
+
"typescript": "^6.0.2",
|
|
75
|
+
"vitest": "^4.1.5"
|
|
77
76
|
},
|
|
78
77
|
"peerDependencies": {
|
|
79
|
-
"mjml": "^
|
|
78
|
+
"mjml": "^5.0.0"
|
|
80
79
|
},
|
|
81
80
|
"engines": {
|
|
82
81
|
"node": ">=20"
|
|
83
82
|
},
|
|
84
83
|
"scripts": {
|
|
85
84
|
"build": "tsup",
|
|
86
|
-
"format": "
|
|
87
|
-
"format:check": "
|
|
88
|
-
"lint": "
|
|
89
|
-
"lint:fix": "
|
|
85
|
+
"format": "oxfmt --write",
|
|
86
|
+
"format:check": "oxfmt --check",
|
|
87
|
+
"lint": "oxlint",
|
|
88
|
+
"lint:fix": "oxlint --fix",
|
|
90
89
|
"test": "vitest run",
|
|
91
90
|
"test:coverage": "vitest run --coverage"
|
|
92
91
|
}
|