@react-email/editor 0.0.0-experimental.39 → 0.0.0-experimental.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/core/index.cjs +1 -1
  2. package/dist/core/index.mjs +1 -1
  3. package/dist/{extension-CnC8y63H.mjs → extension-DyY8_bh4.mjs} +8 -17
  4. package/dist/{extension-CnC8y63H.mjs.map → extension-DyY8_bh4.mjs.map} +1 -1
  5. package/dist/{extension-dGpPpEvD.cjs → extension-w5VaUeSw.cjs} +6 -15
  6. package/dist/extensions/index.cjs +6 -3
  7. package/dist/extensions/index.d.cts +44 -1
  8. package/dist/extensions/index.d.cts.map +1 -1
  9. package/dist/extensions/index.d.mts +44 -1
  10. package/dist/extensions/index.d.mts.map +1 -1
  11. package/dist/extensions/index.mjs +3 -3
  12. package/dist/{extensions-DWsu9kwZ.mjs → extensions-BvfmaKCn.mjs} +196 -22
  13. package/dist/extensions-BvfmaKCn.mjs.map +1 -0
  14. package/dist/{extensions-aMMnHcs9.cjs → extensions-CkjPj2JO.cjs} +211 -19
  15. package/dist/{global-content-5rAU84QT.mjs → global-content-D_WYaFgX.mjs} +2 -2
  16. package/dist/global-content-D_WYaFgX.mjs.map +1 -0
  17. package/dist/{global-content-62RO9uoQ.cjs → global-content-bJgotqmA.cjs} +1 -1
  18. package/dist/index-C4KcMQ0R.d.cts.map +1 -1
  19. package/dist/index-CxX7W63O.d.mts.map +1 -1
  20. package/dist/index.cjs +2 -2
  21. package/dist/index.mjs +2 -2
  22. package/dist/plugins/index.cjs +1 -1
  23. package/dist/plugins/index.d.cts +6 -6
  24. package/dist/plugins/index.d.cts.map +1 -1
  25. package/dist/plugins/index.d.mts +6 -6
  26. package/dist/plugins/index.d.mts.map +1 -1
  27. package/dist/plugins/index.mjs +1 -1
  28. package/dist/ui/index.d.cts +70 -70
  29. package/dist/ui/index.d.cts.map +1 -1
  30. package/dist/ui/index.d.mts +70 -70
  31. package/dist/ui/index.d.mts.map +1 -1
  32. package/package.json +11 -5
  33. package/dist/extensions-DWsu9kwZ.mjs.map +0 -1
  34. package/dist/global-content-5rAU84QT.mjs.map +0 -1
@@ -1,5 +1,5 @@
1
1
  const require_event_bus = require('../event-bus-fb8U7hrl.cjs');
2
- const require_extensions = require('../extensions-aMMnHcs9.cjs');
2
+ const require_extensions = require('../extensions-CkjPj2JO.cjs');
3
3
 
4
4
  exports.EmailMark = require_extensions.EmailMark;
5
5
  exports.EmailNode = require_event_bus.EmailNode;
@@ -1,4 +1,4 @@
1
- import { D as isDocumentVisuallyEmpty, E as useEditor, R as composeReactEmail, z as EmailMark } from "../extensions-DWsu9kwZ.mjs";
1
+ import { H as EmailMark, O as useEditor, V as composeReactEmail, k as isDocumentVisuallyEmpty } from "../extensions-BvfmaKCn.mjs";
2
2
  import { h as EmailNode, t as editorEventBus } from "../event-bus-CHEzOS_O.mjs";
3
3
 
4
4
  export { EmailMark, EmailNode, composeReactEmail, editorEventBus, isDocumentVisuallyEmpty, useEditor };
@@ -1,7 +1,7 @@
1
1
  import { t as ensureBorderStyleFallback } from "./styles-_TMw3YxC.mjs";
2
- import { n as getGlobalContent } from "./global-content-5rAU84QT.mjs";
2
+ import { n as getGlobalContent } from "./global-content-D_WYaFgX.mjs";
3
3
  import { useEditorState } from "@tiptap/react";
4
- import { Body, Head, Html, Preview, Section } from "@react-email/components";
4
+ import { Body, Head, Html, Preview } from "@react-email/components";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { Extension } from "@tiptap/core";
7
7
  import { Plugin, PluginKey } from "@tiptap/pm/state";
@@ -893,6 +893,7 @@ function getThemeComponentKey(nodeType, depth, attrs = {}) {
893
893
  case "heading": return `h${attrs.level ?? 1}`;
894
894
  case "blockquote": return "blockquote";
895
895
  case "button": return "button";
896
+ case "container": return "container";
896
897
  case "section": return "section";
897
898
  case "footer": return "footer";
898
899
  case "image": return "image";
@@ -926,6 +927,7 @@ function getMergedCssJs(theme, panelStyles) {
926
927
  const RESET_NODE_TYPES = new Set([
927
928
  "body",
928
929
  "bulletList",
930
+ "container",
929
931
  "button",
930
932
  "columns",
931
933
  "div",
@@ -1045,21 +1047,10 @@ const EmailTheming = Extension.create({
1045
1047
  globalCss && /* @__PURE__ */ jsx("style", { children: globalCss })
1046
1048
  ] }),
1047
1049
  previewText && previewText !== "" && /* @__PURE__ */ jsx(Preview, { children: previewText }),
1048
- /* @__PURE__ */ jsx(Body, { children: /* @__PURE__ */ jsx(Section, {
1049
- width: "100%",
1050
- align: "center",
1050
+ /* @__PURE__ */ jsx(Body, {
1051
1051
  style: mergedStyles.body,
1052
- children: /* @__PURE__ */ jsx(Section, {
1053
- align: mergedStyles.container?.align,
1054
- style: {
1055
- ...mergedStyles.container,
1056
- width: "100%",
1057
- maxWidth: mergedStyles.container?.width,
1058
- fontFamily: mergedStyles.body?.fontFamily
1059
- },
1060
- children
1061
- })
1062
- }) })
1052
+ children
1053
+ })
1063
1054
  ] });
1064
1055
  }
1065
1056
  }
@@ -1116,4 +1107,4 @@ const EmailTheming = Extension.create({
1116
1107
 
1117
1108
  //#endregion
1118
1109
  export { resolveResetValue as _, setCurrentTheme as a, mergeCssJs as b, stylesToCss as c, EDITOR_THEMES as d, INBOX_EMAIL_DEFAULTS as f, getThemeBodyFontSizePx as g, getPanelTitle as h, getThemeComponentKey as i, useEmailTheming as l, SUPPORTED_CSS_PROPERTIES as m, getMergedCssJs as n, setGlobalCssInjected as o, RESET_THEMES as p, getResolvedNodeStyles as r, setGlobalStyles as s, EmailTheming as t, DEFAULT_INBOX_FONT_SIZE_PX as u, injectGlobalPlainCss as v, transformToCssJs as x, injectThemeCss as y };
1119
- //# sourceMappingURL=extension-CnC8y63H.mjs.map
1110
+ //# sourceMappingURL=extension-DyY8_bh4.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"extension-CnC8y63H.mjs","names":["acc"],"sources":["../src/plugins/email-theming/css-transforms.ts","../src/plugins/email-theming/themes.ts","../src/plugins/email-theming/normalization.ts","../src/plugins/email-theming/extension.tsx"],"sourcesContent":["import { ensureBorderStyleFallback } from '../../utils/styles';\nimport type { CssJs, PanelGroup } from './types';\n\nexport function transformToCssJs(\n styleArray: PanelGroup[],\n baseFontSize: number,\n): CssJs {\n const cssJS = {} as CssJs;\n\n if (!Array.isArray(styleArray)) {\n return cssJS;\n }\n\n for (const style of styleArray) {\n for (const input of style.inputs) {\n let value = input.value;\n\n // If there's a unit property, append it to the value\n if (input.unit && typeof value === 'number') {\n // if font size prop convert px unit to em to adjust size in mobile\n if (input.prop === 'fontSize') {\n value = `${value / baseFontSize}em`;\n } else {\n value = `${value}${input.unit}`;\n }\n }\n\n if (!input.classReference) {\n continue;\n }\n\n if (!cssJS[input.classReference]) {\n cssJS[input.classReference] = {};\n }\n\n // @ts-expect-error -- backward compatibility: 'h-padding' is a legacy prop not in KnownCssProperties\n if (input.prop === 'h-padding') {\n cssJS[input.classReference].paddingLeft = value;\n cssJS[input.classReference].paddingRight = value;\n\n continue;\n }\n\n // @ts-expect-error -- input.prop is KnownCssProperties but CssJs values are React.CSSProperties; dynamic assignment is intentional\n cssJS[input.classReference][input.prop] = value;\n }\n }\n\n for (const key of Object.keys(cssJS)) {\n ensureBorderStyleFallback(\n cssJS[key as keyof CssJs] as Record<string, string | number>,\n );\n }\n\n return cssJS;\n}\n\nexport function mergeCssJs(original: CssJs, newCssJs: CssJs) {\n const merged = { ...original };\n\n for (const key in newCssJs) {\n const keyType = key as keyof CssJs;\n\n if (\n Object.hasOwn(merged, key) &&\n typeof merged[keyType] === 'object' &&\n !Array.isArray(merged[keyType])\n ) {\n merged[keyType] = {\n ...merged[keyType],\n ...newCssJs[keyType],\n };\n } else {\n merged[keyType] = newCssJs[keyType];\n }\n }\n\n return merged;\n}\n\nexport function injectThemeCss(\n styles: CssJs,\n options: { styleId?: string; scopeSelector?: string } = {},\n) {\n const container =\n options.scopeSelector ?? '.tiptap-extended .tiptap.ProseMirror';\n const prefix = '.node-';\n const styleId = options.styleId ?? 'tiptap-extended-theme-css';\n\n const css = Object.entries(styles).reduce((acc, [key, value]) => {\n const className =\n key === 'body' ? container : `${container} ${prefix}${key}`;\n\n const cssString = Object.entries(value).reduce((acc, [prop, val]) => {\n const normalizeProp = prop.replace(/([A-Z])/g, '-$1').toLowerCase();\n\n return `${acc}${normalizeProp}:${val};`;\n }, '');\n\n return `${acc}${className}{${cssString}}`;\n }, '');\n\n let styleTag = document.getElementById(styleId) as HTMLStyleElement;\n\n if (!styleTag) {\n styleTag = document.createElement('style');\n styleTag.textContent = css;\n styleTag.id = styleId;\n\n document.head.appendChild(styleTag);\n\n return;\n }\n\n styleTag.textContent = css;\n}\n\nexport function injectGlobalPlainCss(\n css?: string | null,\n options: { styleId?: string; scopeSelector?: string } = {},\n) {\n if (!css) {\n return;\n }\n\n const styleId = options.styleId ?? 'global-editor-style';\n const container = options.scopeSelector ?? '.tiptap-extended .ProseMirror';\n let styleElement = document.getElementById(styleId);\n\n if (!styleElement) {\n styleElement = document.createElement('style');\n styleElement.id = styleId;\n document.head.appendChild(styleElement);\n }\n\n // Remove CSS within @media (prefers-color-scheme: dark) blocks\n const cleanedCSS = css.replace(\n /@media\\s?\\(prefers-color-scheme:\\s?dark\\)\\s?{([\\s\\S]+?})\\s*}/g,\n '',\n );\n\n // TODO: Figure out a way to extract the body and apply the styles out of the nested .tiptap-extended\n styleElement.textContent = `${container} { ${cleanedCSS} }`;\n}\n","import type {\n EditorTheme,\n PanelGroup,\n PanelSectionId,\n ResetTheme,\n SupportedCssProperties,\n} from './types';\n\n/**\n * Single source of truth for panel section display titles.\n * Titles are resolved from here at render time via `getPanelTitle`,\n * so they never depend on what's persisted in the DB.\n */\nconst PANEL_SECTION_TITLES: Record<PanelSectionId, string> = {\n body: 'Background',\n container: 'Body',\n typography: 'Text',\n h1: 'Title',\n h2: 'Subtitle',\n h3: 'Heading',\n link: 'Link',\n image: 'Image',\n button: 'Button',\n 'code-block': 'Code Block',\n 'inline-code': 'Inline Code',\n};\n\n/**\n * Resolves the display title for a panel group.\n * Uses the `id` lookup when available, falls back to the\n * DB-persisted `title` for backwards compatibility.\n */\nexport function getPanelTitle(group: PanelGroup): string {\n if (group.id && group.id in PANEL_SECTION_TITLES) {\n return PANEL_SECTION_TITLES[group.id];\n }\n return group.title;\n}\n\nconst THEME_BASIC: PanelGroup[] = [\n {\n id: 'body',\n title: 'Background',\n classReference: 'body',\n inputs: [],\n },\n {\n id: 'container',\n title: 'Content',\n classReference: 'container',\n inputs: [\n {\n label: 'Align',\n type: 'select',\n value: 'left',\n options: {\n left: 'Left',\n center: 'Center',\n right: 'Right',\n },\n prop: 'align',\n classReference: 'container',\n },\n {\n label: 'Width',\n type: 'number',\n value: 600,\n unit: 'px',\n prop: 'width',\n classReference: 'container',\n },\n {\n label: 'Padding Left',\n type: 'number',\n value: 0,\n unit: 'px',\n prop: 'paddingLeft',\n classReference: 'container',\n },\n {\n label: 'Padding Right',\n type: 'number',\n value: 0,\n unit: 'px',\n prop: 'paddingRight',\n classReference: 'container',\n },\n ],\n },\n {\n id: 'typography',\n title: 'Text',\n classReference: 'body',\n inputs: [\n {\n label: 'Font size',\n type: 'number',\n value: 14,\n unit: 'px',\n prop: 'fontSize',\n classReference: 'body',\n },\n {\n label: 'Line Height',\n type: 'number',\n value: 155,\n unit: '%',\n prop: 'lineHeight',\n classReference: 'container',\n },\n ],\n },\n {\n id: 'h1',\n title: 'Title',\n category: 'Text',\n classReference: 'h1',\n inputs: [],\n },\n {\n id: 'h2',\n title: 'Subtitle',\n category: 'Text',\n classReference: 'h2',\n inputs: [],\n },\n {\n id: 'h3',\n title: 'Heading',\n category: 'Text',\n classReference: 'h3',\n inputs: [],\n },\n {\n id: 'link',\n title: 'Link',\n classReference: 'link',\n inputs: [\n {\n label: 'Color',\n type: 'color',\n value: '#0670DB',\n prop: 'color',\n classReference: 'link',\n },\n {\n label: 'Decoration',\n type: 'select',\n value: 'underline',\n prop: 'textDecoration',\n options: {\n underline: 'Underline',\n none: 'None',\n },\n classReference: 'link',\n },\n ],\n },\n {\n id: 'image',\n title: 'Image',\n classReference: 'image',\n inputs: [\n {\n label: 'Border radius',\n type: 'number',\n value: 8,\n unit: 'px',\n prop: 'borderRadius',\n classReference: 'image',\n },\n ],\n },\n {\n id: 'button',\n title: 'Button',\n classReference: 'button',\n inputs: [\n {\n label: 'Background',\n type: 'color',\n value: '#000000',\n prop: 'backgroundColor',\n classReference: 'button',\n },\n {\n label: 'Text color',\n type: 'color',\n value: '#ffffff',\n prop: 'color',\n classReference: 'button',\n },\n {\n label: 'Radius',\n type: 'number',\n value: 4,\n unit: 'px',\n prop: 'borderRadius',\n classReference: 'button',\n },\n {\n label: 'Padding Top',\n type: 'number',\n value: 7,\n unit: 'px',\n prop: 'paddingTop',\n classReference: 'button',\n },\n {\n label: 'Padding Right',\n type: 'number',\n value: 12,\n unit: 'px',\n prop: 'paddingRight',\n classReference: 'button',\n },\n {\n label: 'Padding Bottom',\n type: 'number',\n value: 7,\n unit: 'px',\n prop: 'paddingBottom',\n classReference: 'button',\n },\n {\n label: 'Padding Left',\n type: 'number',\n value: 12,\n unit: 'px',\n prop: 'paddingLeft',\n classReference: 'button',\n },\n ],\n },\n {\n id: 'code-block',\n title: 'Code Block',\n classReference: 'codeBlock',\n inputs: [\n {\n label: 'Border Radius',\n type: 'number',\n value: 4,\n unit: 'px',\n prop: 'borderRadius',\n classReference: 'codeBlock',\n },\n {\n label: 'Padding Top',\n type: 'number',\n value: 12,\n unit: 'px',\n prop: 'paddingTop',\n classReference: 'codeBlock',\n },\n {\n label: 'Padding Bottom',\n type: 'number',\n value: 12,\n unit: 'px',\n prop: 'paddingBottom',\n classReference: 'codeBlock',\n },\n {\n label: 'Padding Left',\n type: 'number',\n value: 16,\n unit: 'px',\n prop: 'paddingLeft',\n classReference: 'codeBlock',\n },\n {\n label: 'Padding Right',\n type: 'number',\n value: 16,\n unit: 'px',\n prop: 'paddingRight',\n classReference: 'codeBlock',\n },\n ],\n },\n {\n id: 'inline-code',\n title: 'Inline Code',\n classReference: 'inlineCode',\n inputs: [\n {\n label: 'Background',\n type: 'color',\n value: '#e5e7eb',\n prop: 'backgroundColor',\n classReference: 'inlineCode',\n },\n {\n label: 'Text color',\n type: 'color',\n value: '#1e293b',\n prop: 'color',\n classReference: 'inlineCode',\n },\n {\n label: 'Radius',\n type: 'number',\n value: 4,\n unit: 'px',\n prop: 'borderRadius',\n classReference: 'inlineCode',\n },\n ],\n },\n];\n\nconst THEME_MINIMAL = THEME_BASIC.map((item) => ({ ...item, inputs: [] }));\n\nconst RESET_BASIC: ResetTheme = {\n reset: {\n margin: '0',\n padding: '0',\n },\n body: {\n fontFamily:\n \"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif\",\n fontSize: '14px',\n minHeight: '100%',\n lineHeight: '155%',\n },\n container: {},\n h1: {\n fontSize: '2.25em',\n lineHeight: '1.44em',\n paddingTop: '0.389em',\n fontWeight: 600,\n },\n h2: {\n fontSize: '1.8em',\n lineHeight: '1.44em',\n paddingTop: '0.389em',\n fontWeight: 600,\n },\n h3: {\n fontSize: '1.4em',\n lineHeight: '1.08em',\n paddingTop: '0.389em',\n fontWeight: 600,\n },\n paragraph: {\n fontSize: '1em',\n paddingTop: '0.5em',\n paddingBottom: '0.5em',\n },\n list: {\n paddingLeft: '1.1em',\n paddingBottom: '1em',\n },\n nestedList: {\n paddingLeft: '1.1em',\n paddingBottom: '0',\n },\n listItem: {\n marginLeft: '1em',\n marginBottom: '0.3em',\n marginTop: '0.3em',\n },\n listParagraph: { padding: '0', margin: '0' },\n blockquote: {\n borderLeft: '3px solid #acb3be',\n color: '#7e8a9a',\n marginLeft: 0,\n paddingLeft: '0.8em',\n fontSize: '1.1em',\n fontFamily:\n \"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif\",\n },\n link: { textDecoration: 'underline' },\n footer: {\n fontSize: '0.8em',\n },\n hr: {\n paddingBottom: '1em',\n borderWidth: '2px',\n },\n image: {\n maxWidth: '100%',\n },\n button: {\n lineHeight: '100%',\n display: 'inline-block',\n },\n inlineCode: {\n paddingTop: '0.25em',\n paddingBottom: '0.25em',\n paddingLeft: '0.4em',\n paddingRight: '0.4em',\n background: '#e5e7eb',\n color: '#1e293b',\n borderRadius: '4px',\n },\n codeBlock: {\n fontFamily: 'monospace',\n fontWeight: '500',\n fontSize: '.92em',\n },\n codeTag: {\n lineHeight: '130%',\n fontFamily: 'monospace',\n fontSize: '.92em',\n },\n section: {\n padding: '10px 20px 10px 20px',\n boxSizing: 'border-box' as const,\n },\n};\n\nconst RESET_MINIMAL: ResetTheme = {\n ...Object.keys(RESET_BASIC).reduce<ResetTheme>((acc, key) => {\n acc[key as keyof ResetTheme] = {};\n return acc;\n }, {} as ResetTheme),\n reset: RESET_BASIC.reset,\n};\n\nexport const RESET_THEMES: Record<EditorTheme, ResetTheme> = {\n basic: RESET_BASIC,\n minimal: RESET_MINIMAL,\n};\n\nexport function resolveResetValue(\n value: string | number | undefined,\n targetUnit: 'px' | '%',\n bodyFontSizePx: number,\n): number | undefined {\n if (value === undefined) {\n return undefined;\n }\n const str = String(value);\n const num = Number.parseFloat(str);\n if (Number.isNaN(num)) {\n return undefined;\n }\n if (str.endsWith('em')) {\n return targetUnit === 'px' ? Math.floor(num * bodyFontSizePx) : num * 100;\n }\n return num;\n}\n\nexport const EDITOR_THEMES: Record<EditorTheme, PanelGroup[]> = {\n minimal: THEME_MINIMAL,\n basic: THEME_BASIC,\n};\n\nexport function getThemeBodyFontSizePx(theme: EditorTheme): number {\n for (const group of EDITOR_THEMES[theme]) {\n if (group.classReference !== 'body') {\n continue;\n }\n for (const input of group.inputs) {\n if (input.prop === 'fontSize' && typeof input.value === 'number') {\n return input.value;\n }\n }\n }\n return 14;\n}\n\n/**\n * Use to make the preview nicer once the theme might miss some\n * important properties to make layout accurate\n */\nexport const DEFAULT_INBOX_FONT_SIZE_PX = 14;\nexport const INBOX_EMAIL_DEFAULTS: Partial<ResetTheme> = {\n body: {\n color: '#000000',\n fontFamily:\n \"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif\",\n fontSize: `${DEFAULT_INBOX_FONT_SIZE_PX}px`,\n lineHeight: '155%',\n },\n container: {\n width: 600,\n },\n};\n\nexport const SUPPORTED_CSS_PROPERTIES: SupportedCssProperties = {\n align: {\n label: 'Align',\n type: 'select',\n options: {\n left: 'Left',\n center: 'Center',\n right: 'Right',\n },\n defaultValue: 'left',\n category: 'layout',\n },\n backgroundColor: {\n label: 'Background',\n type: 'color',\n excludeNodes: ['image', 'youtube'],\n defaultValue: '#ffffff',\n category: 'appearance',\n },\n color: {\n label: 'Text color',\n type: 'color',\n excludeNodes: ['image', 'youtube'],\n defaultValue: '#000000',\n category: 'typography',\n },\n fontSize: {\n label: 'Font size',\n type: 'number',\n unit: 'px',\n excludeNodes: ['image', 'youtube'],\n defaultValue: 14,\n category: 'typography',\n },\n fontWeight: {\n label: 'Font weight',\n type: 'select',\n options: {\n 300: 'Light',\n 400: 'Normal',\n 600: 'Semi Bold',\n 700: 'Bold',\n 800: 'Extra Bold',\n },\n excludeNodes: ['image', 'youtube'],\n defaultValue: 400,\n category: 'typography',\n },\n letterSpacing: {\n label: 'Letter spacing',\n type: 'number',\n unit: 'px',\n excludeNodes: ['image', 'youtube'],\n defaultValue: 0,\n category: 'typography',\n },\n lineHeight: {\n label: 'Line height',\n type: 'number',\n unit: '%',\n defaultValue: 155,\n category: 'typography',\n },\n textDecoration: {\n label: 'Text decoration',\n type: 'select',\n options: {\n none: 'None',\n underline: 'Underline',\n 'line-through': 'Line-through',\n },\n defaultValue: 'none',\n category: 'typography',\n },\n borderRadius: {\n label: 'Border Radius',\n type: 'number',\n unit: 'px',\n defaultValue: 8,\n category: 'appearance',\n },\n borderTopLeftRadius: {\n label: 'Border Radius (Top-Left)',\n type: 'number',\n unit: 'px',\n defaultValue: 8,\n category: 'appearance',\n },\n borderTopRightRadius: {\n label: 'Border Radius (Top-Right)',\n type: 'number',\n unit: 'px',\n defaultValue: 8,\n category: 'appearance',\n },\n borderBottomLeftRadius: {\n label: 'Border Radius (Bottom-Left)',\n type: 'number',\n unit: 'px',\n defaultValue: 8,\n category: 'appearance',\n },\n borderBottomRightRadius: {\n label: 'Border Radius (Bottom-Right)',\n type: 'number',\n unit: 'px',\n defaultValue: 8,\n category: 'appearance',\n },\n borderWidth: {\n label: 'Border Width',\n type: 'number',\n unit: 'px',\n defaultValue: 1,\n category: 'appearance',\n },\n borderTopWidth: {\n label: 'Border Top Width',\n type: 'number',\n unit: 'px',\n defaultValue: 1,\n category: 'appearance',\n },\n borderRightWidth: {\n label: 'Border Right Width',\n type: 'number',\n unit: 'px',\n defaultValue: 1,\n category: 'appearance',\n },\n borderBottomWidth: {\n label: 'Border Bottom Width',\n type: 'number',\n unit: 'px',\n defaultValue: 1,\n category: 'appearance',\n },\n borderLeftWidth: {\n label: 'Border Left Width',\n type: 'number',\n unit: 'px',\n defaultValue: 1,\n category: 'appearance',\n },\n borderStyle: {\n label: 'Border Style',\n type: 'select',\n options: {\n solid: 'Solid',\n dashed: 'Dashed',\n dotted: 'Dotted',\n },\n defaultValue: 'solid',\n category: 'appearance',\n },\n borderTopStyle: {\n label: 'Border Top Style',\n type: 'select',\n options: {\n solid: 'Solid',\n dashed: 'Dashed',\n dotted: 'Dotted',\n },\n defaultValue: 'solid',\n category: 'appearance',\n },\n borderRightStyle: {\n label: 'Border Right Style',\n type: 'select',\n options: {\n solid: 'Solid',\n dashed: 'Dashed',\n dotted: 'Dotted',\n },\n defaultValue: 'solid',\n category: 'appearance',\n },\n borderBottomStyle: {\n label: 'Border Bottom Style',\n type: 'select',\n options: {\n solid: 'Solid',\n dashed: 'Dashed',\n dotted: 'Dotted',\n },\n defaultValue: 'solid',\n category: 'appearance',\n },\n borderLeftStyle: {\n label: 'Border Left Style',\n type: 'select',\n options: {\n solid: 'Solid',\n dashed: 'Dashed',\n dotted: 'Dotted',\n },\n defaultValue: 'solid',\n category: 'appearance',\n },\n borderColor: {\n label: 'Border Color',\n type: 'color',\n defaultValue: '#000000',\n category: 'appearance',\n },\n borderTopColor: {\n label: 'Border Top Color',\n type: 'color',\n defaultValue: '#000000',\n category: 'appearance',\n },\n borderRightColor: {\n label: 'Border Right Color',\n type: 'color',\n defaultValue: '#000000',\n category: 'appearance',\n },\n borderBottomColor: {\n label: 'Border Bottom Color',\n type: 'color',\n defaultValue: '#000000',\n category: 'appearance',\n },\n borderLeftColor: {\n label: 'Border Left Color',\n type: 'color',\n defaultValue: '#000000',\n category: 'appearance',\n },\n padding: {\n label: 'Padding',\n type: 'number',\n unit: 'px',\n defaultValue: 8,\n category: 'layout',\n },\n paddingTop: {\n label: 'Padding Top',\n type: 'number',\n unit: 'px',\n defaultValue: 8,\n category: 'layout',\n },\n paddingLeft: {\n label: 'Padding Left',\n type: 'number',\n unit: 'px',\n defaultValue: 8,\n category: 'layout',\n },\n paddingBottom: {\n label: 'Padding Bottom',\n type: 'number',\n unit: 'px',\n defaultValue: 8,\n category: 'layout',\n },\n paddingRight: {\n label: 'Padding Right',\n type: 'number',\n unit: 'px',\n defaultValue: 8,\n category: 'layout',\n },\n width: {\n label: 'Width',\n type: 'number',\n unit: 'px',\n defaultValue: 600,\n category: 'layout',\n },\n height: {\n label: 'Height',\n type: 'number',\n unit: 'px',\n defaultValue: 400,\n category: 'layout',\n },\n};\n","import { EDITOR_THEMES } from './themes';\nimport type {\n EditorTheme,\n KnownThemeComponents,\n PanelGroup,\n PanelSectionId,\n} from './types';\n\nconst PANEL_SECTION_IDS = new Set<PanelSectionId>([\n 'body',\n 'container',\n 'typography',\n 'link',\n 'image',\n 'button',\n 'code-block',\n 'inline-code',\n]);\n\nconst PANEL_SECTION_IDS_BY_TITLE: Record<string, PanelSectionId> = {\n background: 'body',\n body: 'body',\n content: 'container',\n container: 'container',\n typography: 'typography',\n link: 'link',\n image: 'image',\n button: 'button',\n 'code block': 'code-block',\n 'inline code': 'inline-code',\n};\n\nconst PANEL_SECTION_IDS_BY_CLASS_REFERENCE: Partial<\n Record<KnownThemeComponents, PanelSectionId>\n> = {\n container: 'container',\n link: 'link',\n image: 'image',\n button: 'button',\n codeBlock: 'code-block',\n inlineCode: 'inline-code',\n};\n\nfunction isPanelSectionId(value: unknown): value is PanelSectionId {\n return (\n typeof value === 'string' && PANEL_SECTION_IDS.has(value as PanelSectionId)\n );\n}\n\nfunction normalizeTitle(title: string | undefined): string {\n return title?.trim().toLowerCase().replace(/\\s+/g, ' ') ?? '';\n}\n\nfunction resolvePanelSectionId(group: PanelGroup): PanelSectionId | null {\n if (isPanelSectionId(group.id)) {\n return group.id;\n }\n\n const normalizedTitle = normalizeTitle(group.title);\n\n if (group.classReference === 'body') {\n if (normalizedTitle === 'typography') {\n return 'typography';\n }\n\n return 'body';\n }\n\n if (\n group.classReference &&\n PANEL_SECTION_IDS_BY_CLASS_REFERENCE[group.classReference]\n ) {\n return PANEL_SECTION_IDS_BY_CLASS_REFERENCE[group.classReference] ?? null;\n }\n\n return PANEL_SECTION_IDS_BY_TITLE[normalizedTitle] ?? null;\n}\n\nfunction normalizePanelInputs(\n inputs: PanelGroup['inputs'],\n defaultInputs: PanelGroup['inputs'],\n fallbackClassReference?: KnownThemeComponents,\n): PanelGroup['inputs'] {\n if (!Array.isArray(inputs)) {\n return [];\n }\n\n return inputs.map((input) => {\n const defaultInput = defaultInputs.find(\n (candidate) => candidate.prop === input.prop,\n );\n\n return {\n ...defaultInput,\n ...input,\n classReference:\n input.classReference ??\n defaultInput?.classReference ??\n fallbackClassReference,\n };\n });\n}\n\nexport function inferThemeFromPanelStyles(\n panelStyles: PanelGroup[] | null | undefined,\n): EditorTheme | null {\n if (!Array.isArray(panelStyles) || panelStyles.length === 0) {\n return null;\n }\n\n let finalTheme: EditorTheme | null = null;\n for (const group of panelStyles) {\n if (!Array.isArray(group?.inputs)) {\n finalTheme = null;\n break;\n }\n\n if (group.inputs.length !== 0) {\n finalTheme = 'basic';\n break;\n }\n\n finalTheme = 'minimal';\n }\n\n return finalTheme;\n}\n\nexport function normalizeThemePanelStyles(\n theme: EditorTheme,\n panelStyles: PanelGroup[] | null | undefined,\n): PanelGroup[] | null {\n if (!Array.isArray(panelStyles)) {\n return null;\n }\n\n return panelStyles.map((group) => {\n const panelId = resolvePanelSectionId(group);\n\n if (!panelId) {\n return group;\n }\n\n const defaultGroup = EDITOR_THEMES[theme].find(\n (candidate) => candidate.id === panelId,\n );\n\n if (!defaultGroup) {\n return group;\n }\n\n return {\n ...group,\n id: panelId,\n title: defaultGroup.title,\n classReference: defaultGroup.classReference,\n inputs: normalizePanelInputs(\n group.inputs,\n defaultGroup.inputs,\n defaultGroup.classReference,\n ),\n };\n });\n}\n","import { Body, Head, Html, Preview, Section } from '@react-email/components';\nimport type { Editor, JSONContent } from '@tiptap/core';\nimport { Extension } from '@tiptap/core';\nimport { Plugin, PluginKey } from '@tiptap/pm/state';\nimport { useEditorState } from '@tiptap/react';\nimport type * as React from 'react';\nimport type { SerializerPlugin } from '../../core/serializer/serializer-plugin';\nimport { getGlobalContent } from '../../extensions/global-content';\nimport {\n injectGlobalPlainCss,\n injectThemeCss,\n mergeCssJs,\n transformToCssJs,\n} from './css-transforms';\nimport {\n inferThemeFromPanelStyles,\n normalizeThemePanelStyles,\n} from './normalization';\nimport {\n DEFAULT_INBOX_FONT_SIZE_PX,\n EDITOR_THEMES,\n RESET_THEMES,\n} from './themes';\nimport type {\n CssJs,\n EditorTheme,\n KnownThemeComponents,\n PanelGroup,\n} from './types';\n\n/**\n * Maps a document node (type + attrs) to the theme component key used for style lookup.\n * Centralizes all node-type → theme-component knowledge.\n */\nexport function getThemeComponentKey(\n nodeType: string,\n depth: number,\n attrs: Record<string, unknown> = {},\n): KnownThemeComponents | null {\n switch (nodeType) {\n case 'paragraph':\n if (depth > 0) {\n return 'listParagraph';\n }\n return 'paragraph';\n case 'heading': {\n const level = attrs.level as number | undefined;\n return `h${level ?? 1}` as KnownThemeComponents;\n }\n case 'blockquote':\n return 'blockquote';\n case 'button':\n return 'button';\n case 'section':\n return 'section';\n case 'footer':\n return 'footer';\n case 'image':\n return 'image';\n case 'youtube':\n case 'twitter':\n return 'image';\n case 'orderedList':\n case 'bulletList':\n if (depth > 0) {\n return 'nestedList';\n }\n return 'list';\n case 'listItem':\n return 'listItem';\n case 'codeBlock':\n return 'codeBlock';\n case 'code':\n return 'inlineCode';\n case 'link':\n return 'link';\n case 'horizontalRule':\n return 'hr';\n default:\n return null;\n }\n}\n\n/**\n * Returns merged theme styles (reset + panel styles) for the given editor.\n * Use when you have editor access and need the full CssJs map.\n */\nexport function getMergedCssJs(\n theme: EditorTheme,\n panelStyles: PanelGroup[] | undefined,\n): CssJs {\n const panels: PanelGroup[] =\n normalizeThemePanelStyles(theme, panelStyles) ?? EDITOR_THEMES[theme];\n const parsed = transformToCssJs(panels, DEFAULT_INBOX_FONT_SIZE_PX);\n const merged = mergeCssJs(RESET_THEMES[theme], parsed);\n\n return merged;\n}\n\n/**\n * Returns resolved React.CSSProperties for a node when you already have merged CssJs\n * (e.g. in the serializer where there is no editor). Centralizes which theme keys\n * apply to which node type.\n */\nconst RESET_NODE_TYPES = new Set([\n 'body',\n 'bulletList',\n 'button',\n 'columns',\n 'div',\n 'h1',\n 'h2',\n 'h3',\n 'list',\n 'listItem',\n 'listParagraph',\n 'nestedList',\n 'orderedList',\n 'table',\n 'paragraph',\n 'tableCell',\n 'tableHeader',\n 'tableRow',\n 'youtube',\n]);\n\nexport function getResolvedNodeStyles(\n node: JSONContent,\n depth: number,\n mergedCssJs: CssJs,\n): React.CSSProperties {\n const key = getThemeComponentKey(node.type ?? '', depth, node.attrs ?? {});\n if (!key) {\n if (RESET_NODE_TYPES.has(node.type ?? '')) {\n return mergedCssJs.reset ?? {};\n }\n return {};\n }\n const component = mergedCssJs[key] ?? {};\n const shouldReset =\n RESET_NODE_TYPES.has(key) || RESET_NODE_TYPES.has(node.type ?? '');\n if (shouldReset) {\n const reset = mergedCssJs.reset ?? {};\n return { ...reset, ...component };\n }\n return { ...component };\n}\n\nexport function stylesToCss(\n styles: PanelGroup[],\n theme: EditorTheme,\n): Record<KnownThemeComponents, React.CSSProperties> {\n const parsed = transformToCssJs(\n normalizeThemePanelStyles(theme, styles) ?? EDITOR_THEMES[theme],\n DEFAULT_INBOX_FONT_SIZE_PX,\n );\n return mergeCssJs(RESET_THEMES[theme], parsed);\n}\n\nfunction getEmailTheming(editor: Editor) {\n const theme = getEmailTheme(editor);\n const normalizedStyles =\n normalizeThemePanelStyles(theme, getEmailStyles(editor)) ??\n EDITOR_THEMES[theme];\n\n return {\n styles: normalizedStyles,\n theme,\n css: getEmailCss(editor),\n };\n}\n\nexport function useEmailTheming(editor: Editor | null) {\n return useEditorState({\n editor,\n selector({ editor: ed }) {\n if (!ed) {\n return null;\n }\n return getEmailTheming(ed);\n },\n });\n}\n\nfunction getEmailStyles(editor: Editor) {\n return getGlobalContent('styles', editor) as PanelGroup[] | null;\n}\n\n/**\n * Sets the global panel styles on the editor document.\n * Persists into the `GlobalContent` node under the `'styles'` key.\n */\nexport function setGlobalStyles(editor: Editor, styles: PanelGroup[]): boolean {\n return editor.commands.setGlobalContent('styles', styles);\n}\n\n/**\n * Sets the current email theme on the editor document.\n * Persists into the `GlobalContent` node under the `'theme'` key.\n */\nexport function setCurrentTheme(editor: Editor, theme: EditorTheme): boolean {\n return editor.commands.setGlobalContent('theme', theme);\n}\n\n/**\n * Sets the global CSS string injected into the email `<head>`.\n * Persists into the `GlobalContent` node under the `'css'` key.\n */\nexport function setGlobalCssInjected(editor: Editor, css: string): boolean {\n return editor.commands.setGlobalContent('css', css);\n}\n\nfunction getEmailTheme(editor: Editor) {\n const extensionTheme = (\n editor.extensionManager.extensions.find(\n (extension) => extension.name === 'theming',\n ) as { options?: { theme?: EditorTheme } }\n )?.options?.theme;\n if (extensionTheme === 'basic' || extensionTheme === 'minimal') {\n return extensionTheme;\n }\n\n const globalTheme = getGlobalContent('theme', editor) as EditorTheme | null;\n if (globalTheme === 'basic' || globalTheme === 'minimal') {\n return globalTheme;\n }\n\n const inferredTheme = inferThemeFromPanelStyles(getEmailStyles(editor));\n if (inferredTheme) {\n return inferredTheme;\n }\n\n return 'basic';\n}\n\nfunction getEmailCss(editor: Editor) {\n return getGlobalContent('css', editor) as string | null;\n}\n\nexport const EmailTheming = Extension.create<{\n theme?: EditorTheme;\n serializerPlugin: SerializerPlugin;\n}>({\n name: 'theming',\n\n addOptions() {\n return {\n theme: undefined as EditorTheme | undefined,\n serializerPlugin: {\n getNodeStyles(\n node: JSONContent,\n depth: number,\n editor: Editor,\n ): React.CSSProperties {\n const theming = getEmailTheming(editor);\n\n return getResolvedNodeStyles(\n node,\n depth,\n getMergedCssJs(theming.theme, theming.styles),\n );\n },\n BaseTemplate({\n previewText,\n children,\n editor,\n }: {\n previewText: string | null;\n children: React.ReactNode;\n editor: Editor;\n }) {\n const { css: globalCss, styles, theme } = getEmailTheming(editor);\n const mergedStyles = getMergedCssJs(theme, styles);\n\n return (\n <Html>\n <Head>\n <meta content=\"width=device-width\" name=\"viewport\" />\n <meta content=\"IE=edge\" httpEquiv=\"X-UA-Compatible\" />\n <meta name=\"x-apple-disable-message-reformatting\" />\n <meta\n content=\"telephone=no,address=no,email=no,date=no,url=no\"\n name=\"format-detection\"\n />\n\n {globalCss && <style>{globalCss}</style>}\n </Head>\n {previewText && previewText !== '' && (\n <Preview>{previewText}</Preview>\n )}\n\n <Body>\n <Section width=\"100%\" align=\"center\" style={mergedStyles.body}>\n <Section\n align={mergedStyles.container?.align}\n style={{\n ...mergedStyles.container,\n width: '100%',\n maxWidth: mergedStyles.container?.width,\n fontFamily: mergedStyles.body?.fontFamily,\n }}\n >\n {children}\n </Section>\n </Section>\n </Body>\n </Html>\n );\n },\n } satisfies SerializerPlugin,\n };\n },\n\n addProseMirrorPlugins() {\n const { editor } = this;\n const scopeId = `tiptap-theme-${Math.random().toString(36).slice(2, 10)}`;\n const scopeAttribute = 'data-editor-theme-scope';\n const scopeSelector = `.tiptap.ProseMirror[${scopeAttribute}=\"${scopeId}\"]`;\n const themeStyleId = `${scopeId}-theme`;\n const globalStyleId = `${scopeId}-global`;\n\n return [\n new Plugin({\n key: new PluginKey('themingStyleInjector'),\n view(view) {\n let prevStyles: PanelGroup[] | null = null;\n let prevTheme: EditorTheme | null = null;\n let prevCss: string | null = null;\n\n view.dom.setAttribute(scopeAttribute, scopeId);\n\n const sync = () => {\n const theme = getEmailTheme(editor);\n const styles = getEmailStyles(editor);\n const resolvedStyles = styles ?? EDITOR_THEMES[theme];\n const css = getEmailCss(editor);\n\n if (styles !== prevStyles || theme !== prevTheme) {\n prevStyles = styles as PanelGroup[] | null;\n prevTheme = theme;\n const mergedCssJs = getMergedCssJs(theme, resolvedStyles);\n injectThemeCss(mergedCssJs, {\n scopeSelector,\n styleId: themeStyleId,\n });\n }\n\n if (css !== prevCss) {\n prevCss = css;\n injectGlobalPlainCss(css, {\n scopeSelector,\n styleId: globalStyleId,\n });\n }\n };\n\n sync();\n\n return {\n update: sync,\n destroy() {\n document.getElementById(themeStyleId)?.remove();\n document.getElementById(globalStyleId)?.remove();\n view.dom.removeAttribute(scopeAttribute);\n },\n };\n },\n }),\n ];\n },\n});\n"],"mappings":";;;;;;;;;AAGA,SAAgB,iBACd,YACA,cACO;CACP,MAAM,QAAQ,EAAE;AAEhB,KAAI,CAAC,MAAM,QAAQ,WAAW,CAC5B,QAAO;AAGT,MAAK,MAAM,SAAS,WAClB,MAAK,MAAM,SAAS,MAAM,QAAQ;EAChC,IAAI,QAAQ,MAAM;AAGlB,MAAI,MAAM,QAAQ,OAAO,UAAU,SAEjC,KAAI,MAAM,SAAS,WACjB,SA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AAgB;IACjB;GACF;EACF;CACD;EACE,IAAI;EACJ,OAAO;EACP,gBAAgB;EAChB,QAAQ,CACN;GACE,OAAO;GACP,MAAM;GACN,OAAO;GACP,MAAM;GACN,MAAM;GACN,gBAAgB;GACjB,EACD;GACE,OAAO;GACP,MAAM;GACN,OAAO;GACP,MAAM;GACN,MAAM;GACN,gBAAgB;GACjB,CACF;EACF;CACD;EACE,IAAI;EACJ,OAAO;EACP,UAAU;EACV,gBAAgB;EAChB,QAAQ,EAAE;EACX;CACD;EACE,IAAI;EACJ,OAAO;EACP,UAAU;EACV,gBAAgB;EAChB,QAAQ,EAAE;EACX;CACD;EACE,IAAI;EACJ,OAAO;EACP,UAAU;EACV,gBAAgB;EAChB,QAAQ,EAAE;EACX;CACD;EACE,IAAI;EACJ,OAAO;EACP,gBAAgB;EAChB,QAAQ,CACN;GACE,OAAO;GACP,MAAM;GACN,OAAO;GACP,MAAM;GACN,gBAAgB;GACjB,EACD;GACE,OAAO;GACP,MAAM;GACN,OAAO;GACP,MAAM;GACN,SAAS;IACP,WAAW;IACX,MAAM;IACP;GACD,gBAAgB;GACjB,CACF;EACF;CACD;EACE,IAAI;EACJ,OAAO;EACP,gBAAgB;EAChB,QAAQ,CACN;GACE,OAAO;GACP,MAAM;GACN,OAAO;GACP,MAAM;GACN,MAAM;GACN,gBAAgB;GACjB,CACF;EACF;CACD;EACE,IAAI;EACJ,OAAO;EACP,gBAAgB;EAChB,QAAQ;GACN;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACF;EACF;CACD;EACE,IAAI;EACJ,OAAO;EACP,gBAAgB;EAChB,QAAQ;GACN;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACF;EACF;CACD;EACE,IAAI;EACJ,OAAO;EACP,gBAAgB;EAChB,QAAQ;GACN;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACF;EACF;CACF;AAED,MAAM,gBAAgB,YAAY,KAAK,UAAU;CAAE,GAAG;CAAM,QAAQ,EAAE;CAAE,EAAE;AAE1E,MAAM,cAA0B;CAC9B,OAAO;EACL,QAAQ;EACR,SAAS;EACV;CACD,MAAM;EACJ,YACE;EACF,UAAU;EACV,WAAW;EACX,YAAY;EACb;CACD,WAAW,EAAE;CACb,IAAI;EACF,UAAU;EACV,YAAY;EACZ,YAAY;EACZ,YAAY;EACb;CACD,IAAI;E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,MAAM;EACN,SAAS;GACP,MAAM;GACN,WAAW;GACX,gBAAgB;GACjB;EACD,cAAc;EACd,UAAU;EACX;CACD,cAAc;EACZ,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,qBAAqB;EACnB,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,sBAAsB;EACpB,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,wBAAwB;EACtB,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,yBAAyB;EACvB,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,aAAa;EACX,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,gBAAgB;EACd,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,kBAAkB;EAChB,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,mBAAmB;EACjB,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,iBAAiB;EACf,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,aAAa;EACX,OAAO;EACP,MAAM;EACN,SAAS;GACP,OAAO;GACP,QAAQ;GACR,QAAQ;GACT;EACD,cAAc;EACd,UAAU;EACX;CACD,gBAAgB;EACd,OAAO;EACP,MAAM;EACN,SAAS;GACP,OAAO;GACP,QAAQ;GACR,QAAQ;GACT;EACD,cAAc;EACd,UAAU;EACX;CACD,kBAAkB;EAChB,OAAO;EACP,MAAM;EACN,SAAS;GACP,OAAO;GACP,QAAQ;GACR,QAAQ;GACT;EACD,cAAc;EACd,UAAU;EACX;CACD,mBAAmB;EACjB,OAAO;EACP,MAAM;EACN,SAAS;GACP,OAAO;GACP,QAAQ;GACR,QAAQ;GACT;EACD,cAAc;EACd,UAAU;EACX;CACD,iBAAiB;EACf,OAAO;EACP,MAAM;EACN,SAAS;GACP,OAAO;GACP,QAAQ;GACR,QAAQ;GACT;EACD,cAAc;EACd,UAAU;EACX;CACD,aAAa;EACX,OAAO;EACP,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,gBAAgB;EACd,OAAO;EACP,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,kBAAkB;EAChB,OAAO;EACP,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,mBAAmB;EACjB,OAAO;EACP,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,iBAAiB;EACf,OAAO;EACP,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,SAAS;EACP,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,YAAY;EACV,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,aAAa;EACX,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,eAAe;EACb,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,cAAc;EACZ,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,OAAO;EACL,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,QAAQ;EACN,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACF;;;;AChvBD,MAAM,oBAAoB,IAAI,IAAoB;CAChD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,MAAM,6BAA6D;CACjE,YAAY;CACZ,MAAM;CACN,SAAS;CACT,WAAW;CACX,YAAY;CACZ,MAAM;CACN,OAAO;CACP,QAAQ;CACR,cAAc;CACd,eAAe;CAChB;AAED,MAAM,uCAEF;CACF,WAAW;CACX,MAAM;CACN,OAAO;CACP,QAAQ;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;EAChC,MAAM,gBAAgB,GAAG,QAAQ;AAEjC,SAAO,CACL,IAAI,OAAO;GACT,KAAK,IAAI,UAAU,uBAAuB;GAC1C,KAAK,MAAM;IACT,IAAI,aAAkC;IACtC,IAAI,YAAgC;IACpC,IAAI,UAAyB;AAE7B,SAAK,IAAI,aAAa,gBAAgB,QAAQ;IAE9C,MAAM,aAAa;KACjB,MAAM,QAAQ,cAAc,OAAO;KACnC,MAAM,SAAS,eAAe,OAAO;KACrC,MAAM,iBAAiB,UAAU,cAAc;KAC/C,MAAM,MAAM,YAAY,OAAO;AAE/B,SAAI,WAAW,cAAc,UAAU,WAAW;AAChD,mBAAa;AACb,kBAAY;AAEZ,qBADoB,eAAe,OAAO,eAAe,EAC7B;OAC1B;OACA,SAAS;OACV,CAAC;;AAGJ,SAAI,QAAQ,SAAS;AACnB,gBAAU;AACV,2BAAqB,KAAK;OACxB;OACA,SAAS;OACV,CAAC;;;AAIN,UAAM;AAEN,WAAO;KACL,QAAQ;KACR,UAAU;AACR,eAAS,eAAe,aAAa,EAAE,QAAQ;AAC/C,eAAS,eAAe,cAAc,EAAE,QAAQ;AAChD,WAAK,IAAI,gBAAgB,eAAe;;KAE3C;;GAEJ,CAAC,CACH;;CAEJ,CAAC"}
1
+ {"version":3,"file":"extension-DyY8_bh4.mjs","names":["acc"],"sources":["../src/plugins/email-theming/css-transforms.ts","../src/plugins/email-theming/themes.ts","../src/plugins/email-theming/normalization.ts","../src/plugins/email-theming/extension.tsx"],"sourcesContent":["import { ensureBorderStyleFallback } from '../../utils/styles';\nimport type { CssJs, PanelGroup } from './types';\n\nexport function transformToCssJs(\n styleArray: PanelGroup[],\n baseFontSize: number,\n): CssJs {\n const cssJS = {} as CssJs;\n\n if (!Array.isArray(styleArray)) {\n return cssJS;\n }\n\n for (const style of styleArray) {\n for (const input of style.inputs) {\n let value = input.value;\n\n // If there's a unit property, append it to the value\n if (input.unit && typeof value === 'number') {\n // if font size prop convert px unit to em to adjust size in mobile\n if (input.prop === 'fontSize') {\n value = `${value / baseFontSize}em`;\n } else {\n value = `${value}${input.unit}`;\n }\n }\n\n if (!input.classReference) {\n continue;\n }\n\n if (!cssJS[input.classReference]) {\n cssJS[input.classReference] = {};\n }\n\n // @ts-expect-error -- backward compatibility: 'h-padding' is a legacy prop not in KnownCssProperties\n if (input.prop === 'h-padding') {\n cssJS[input.classReference].paddingLeft = value;\n cssJS[input.classReference].paddingRight = value;\n\n continue;\n }\n\n // @ts-expect-error -- input.prop is KnownCssProperties but CssJs values are React.CSSProperties; dynamic assignment is intentional\n cssJS[input.classReference][input.prop] = value;\n }\n }\n\n for (const key of Object.keys(cssJS)) {\n ensureBorderStyleFallback(\n cssJS[key as keyof CssJs] as Record<string, string | number>,\n );\n }\n\n return cssJS;\n}\n\nexport function mergeCssJs(original: CssJs, newCssJs: CssJs) {\n const merged = { ...original };\n\n for (const key in newCssJs) {\n const keyType = key as keyof CssJs;\n\n if (\n Object.hasOwn(merged, key) &&\n typeof merged[keyType] === 'object' &&\n !Array.isArray(merged[keyType])\n ) {\n merged[keyType] = {\n ...merged[keyType],\n ...newCssJs[keyType],\n };\n } else {\n merged[keyType] = newCssJs[keyType];\n }\n }\n\n return merged;\n}\n\nexport function injectThemeCss(\n styles: CssJs,\n options: { styleId?: string; scopeSelector?: string } = {},\n) {\n const container =\n options.scopeSelector ?? '.tiptap-extended .tiptap.ProseMirror';\n const prefix = '.node-';\n const styleId = options.styleId ?? 'tiptap-extended-theme-css';\n\n const css = Object.entries(styles).reduce((acc, [key, value]) => {\n const className =\n key === 'body' ? container : `${container} ${prefix}${key}`;\n\n const cssString = Object.entries(value).reduce((acc, [prop, val]) => {\n const normalizeProp = prop.replace(/([A-Z])/g, '-$1').toLowerCase();\n\n return `${acc}${normalizeProp}:${val};`;\n }, '');\n\n return `${acc}${className}{${cssString}}`;\n }, '');\n\n let styleTag = document.getElementById(styleId) as HTMLStyleElement;\n\n if (!styleTag) {\n styleTag = document.createElement('style');\n styleTag.textContent = css;\n styleTag.id = styleId;\n\n document.head.appendChild(styleTag);\n\n return;\n }\n\n styleTag.textContent = css;\n}\n\nexport function injectGlobalPlainCss(\n css?: string | null,\n options: { styleId?: string; scopeSelector?: string } = {},\n) {\n if (!css) {\n return;\n }\n\n const styleId = options.styleId ?? 'global-editor-style';\n const container = options.scopeSelector ?? '.tiptap-extended .ProseMirror';\n let styleElement = document.getElementById(styleId);\n\n if (!styleElement) {\n styleElement = document.createElement('style');\n styleElement.id = styleId;\n document.head.appendChild(styleElement);\n }\n\n // Remove CSS within @media (prefers-color-scheme: dark) blocks\n const cleanedCSS = css.replace(\n /@media\\s?\\(prefers-color-scheme:\\s?dark\\)\\s?{([\\s\\S]+?})\\s*}/g,\n '',\n );\n\n // TODO: Figure out a way to extract the body and apply the styles out of the nested .tiptap-extended\n styleElement.textContent = `${container} { ${cleanedCSS} }`;\n}\n","import type {\n EditorTheme,\n PanelGroup,\n PanelSectionId,\n ResetTheme,\n SupportedCssProperties,\n} from './types';\n\n/**\n * Single source of truth for panel section display titles.\n * Titles are resolved from here at render time via `getPanelTitle`,\n * so they never depend on what's persisted in the DB.\n */\nconst PANEL_SECTION_TITLES: Record<PanelSectionId, string> = {\n body: 'Background',\n container: 'Body',\n typography: 'Text',\n h1: 'Title',\n h2: 'Subtitle',\n h3: 'Heading',\n link: 'Link',\n image: 'Image',\n button: 'Button',\n 'code-block': 'Code Block',\n 'inline-code': 'Inline Code',\n};\n\n/**\n * Resolves the display title for a panel group.\n * Uses the `id` lookup when available, falls back to the\n * DB-persisted `title` for backwards compatibility.\n */\nexport function getPanelTitle(group: PanelGroup): string {\n if (group.id && group.id in PANEL_SECTION_TITLES) {\n return PANEL_SECTION_TITLES[group.id];\n }\n return group.title;\n}\n\nconst THEME_BASIC: PanelGroup[] = [\n {\n id: 'body',\n title: 'Background',\n classReference: 'body',\n inputs: [],\n },\n {\n id: 'container',\n title: 'Content',\n classReference: 'container',\n inputs: [\n {\n label: 'Align',\n type: 'select',\n value: 'left',\n options: {\n left: 'Left',\n center: 'Center',\n right: 'Right',\n },\n prop: 'align',\n classReference: 'container',\n },\n {\n label: 'Width',\n type: 'number',\n value: 600,\n unit: 'px',\n prop: 'width',\n classReference: 'container',\n },\n {\n label: 'Padding Left',\n type: 'number',\n value: 0,\n unit: 'px',\n prop: 'paddingLeft',\n classReference: 'container',\n },\n {\n label: 'Padding Right',\n type: 'number',\n value: 0,\n unit: 'px',\n prop: 'paddingRight',\n classReference: 'container',\n },\n ],\n },\n {\n id: 'typography',\n title: 'Text',\n classReference: 'body',\n inputs: [\n {\n label: 'Font size',\n type: 'number',\n value: 14,\n unit: 'px',\n prop: 'fontSize',\n classReference: 'body',\n },\n {\n label: 'Line Height',\n type: 'number',\n value: 155,\n unit: '%',\n prop: 'lineHeight',\n classReference: 'container',\n },\n ],\n },\n {\n id: 'h1',\n title: 'Title',\n category: 'Text',\n classReference: 'h1',\n inputs: [],\n },\n {\n id: 'h2',\n title: 'Subtitle',\n category: 'Text',\n classReference: 'h2',\n inputs: [],\n },\n {\n id: 'h3',\n title: 'Heading',\n category: 'Text',\n classReference: 'h3',\n inputs: [],\n },\n {\n id: 'link',\n title: 'Link',\n classReference: 'link',\n inputs: [\n {\n label: 'Color',\n type: 'color',\n value: '#0670DB',\n prop: 'color',\n classReference: 'link',\n },\n {\n label: 'Decoration',\n type: 'select',\n value: 'underline',\n prop: 'textDecoration',\n options: {\n underline: 'Underline',\n none: 'None',\n },\n classReference: 'link',\n },\n ],\n },\n {\n id: 'image',\n title: 'Image',\n classReference: 'image',\n inputs: [\n {\n label: 'Border radius',\n type: 'number',\n value: 8,\n unit: 'px',\n prop: 'borderRadius',\n classReference: 'image',\n },\n ],\n },\n {\n id: 'button',\n title: 'Button',\n classReference: 'button',\n inputs: [\n {\n label: 'Background',\n type: 'color',\n value: '#000000',\n prop: 'backgroundColor',\n classReference: 'button',\n },\n {\n label: 'Text color',\n type: 'color',\n value: '#ffffff',\n prop: 'color',\n classReference: 'button',\n },\n {\n label: 'Radius',\n type: 'number',\n value: 4,\n unit: 'px',\n prop: 'borderRadius',\n classReference: 'button',\n },\n {\n label: 'Padding Top',\n type: 'number',\n value: 7,\n unit: 'px',\n prop: 'paddingTop',\n classReference: 'button',\n },\n {\n label: 'Padding Right',\n type: 'number',\n value: 12,\n unit: 'px',\n prop: 'paddingRight',\n classReference: 'button',\n },\n {\n label: 'Padding Bottom',\n type: 'number',\n value: 7,\n unit: 'px',\n prop: 'paddingBottom',\n classReference: 'button',\n },\n {\n label: 'Padding Left',\n type: 'number',\n value: 12,\n unit: 'px',\n prop: 'paddingLeft',\n classReference: 'button',\n },\n ],\n },\n {\n id: 'code-block',\n title: 'Code Block',\n classReference: 'codeBlock',\n inputs: [\n {\n label: 'Border Radius',\n type: 'number',\n value: 4,\n unit: 'px',\n prop: 'borderRadius',\n classReference: 'codeBlock',\n },\n {\n label: 'Padding Top',\n type: 'number',\n value: 12,\n unit: 'px',\n prop: 'paddingTop',\n classReference: 'codeBlock',\n },\n {\n label: 'Padding Bottom',\n type: 'number',\n value: 12,\n unit: 'px',\n prop: 'paddingBottom',\n classReference: 'codeBlock',\n },\n {\n label: 'Padding Left',\n type: 'number',\n value: 16,\n unit: 'px',\n prop: 'paddingLeft',\n classReference: 'codeBlock',\n },\n {\n label: 'Padding Right',\n type: 'number',\n value: 16,\n unit: 'px',\n prop: 'paddingRight',\n classReference: 'codeBlock',\n },\n ],\n },\n {\n id: 'inline-code',\n title: 'Inline Code',\n classReference: 'inlineCode',\n inputs: [\n {\n label: 'Background',\n type: 'color',\n value: '#e5e7eb',\n prop: 'backgroundColor',\n classReference: 'inlineCode',\n },\n {\n label: 'Text color',\n type: 'color',\n value: '#1e293b',\n prop: 'color',\n classReference: 'inlineCode',\n },\n {\n label: 'Radius',\n type: 'number',\n value: 4,\n unit: 'px',\n prop: 'borderRadius',\n classReference: 'inlineCode',\n },\n ],\n },\n];\n\nconst THEME_MINIMAL = THEME_BASIC.map((item) => ({ ...item, inputs: [] }));\n\nconst RESET_BASIC: ResetTheme = {\n reset: {\n margin: '0',\n padding: '0',\n },\n body: {\n fontFamily:\n \"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif\",\n fontSize: '14px',\n minHeight: '100%',\n lineHeight: '155%',\n },\n container: {},\n h1: {\n fontSize: '2.25em',\n lineHeight: '1.44em',\n paddingTop: '0.389em',\n fontWeight: 600,\n },\n h2: {\n fontSize: '1.8em',\n lineHeight: '1.44em',\n paddingTop: '0.389em',\n fontWeight: 600,\n },\n h3: {\n fontSize: '1.4em',\n lineHeight: '1.08em',\n paddingTop: '0.389em',\n fontWeight: 600,\n },\n paragraph: {\n fontSize: '1em',\n paddingTop: '0.5em',\n paddingBottom: '0.5em',\n },\n list: {\n paddingLeft: '1.1em',\n paddingBottom: '1em',\n },\n nestedList: {\n paddingLeft: '1.1em',\n paddingBottom: '0',\n },\n listItem: {\n marginLeft: '1em',\n marginBottom: '0.3em',\n marginTop: '0.3em',\n },\n listParagraph: { padding: '0', margin: '0' },\n blockquote: {\n borderLeft: '3px solid #acb3be',\n color: '#7e8a9a',\n marginLeft: 0,\n paddingLeft: '0.8em',\n fontSize: '1.1em',\n fontFamily:\n \"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif\",\n },\n link: { textDecoration: 'underline' },\n footer: {\n fontSize: '0.8em',\n },\n hr: {\n paddingBottom: '1em',\n borderWidth: '2px',\n },\n image: {\n maxWidth: '100%',\n },\n button: {\n lineHeight: '100%',\n display: 'inline-block',\n },\n inlineCode: {\n paddingTop: '0.25em',\n paddingBottom: '0.25em',\n paddingLeft: '0.4em',\n paddingRight: '0.4em',\n background: '#e5e7eb',\n color: '#1e293b',\n borderRadius: '4px',\n },\n codeBlock: {\n fontFamily: 'monospace',\n fontWeight: '500',\n fontSize: '.92em',\n },\n codeTag: {\n lineHeight: '130%',\n fontFamily: 'monospace',\n fontSize: '.92em',\n },\n section: {\n padding: '10px 20px 10px 20px',\n boxSizing: 'border-box' as const,\n },\n};\n\nconst RESET_MINIMAL: ResetTheme = {\n ...Object.keys(RESET_BASIC).reduce<ResetTheme>((acc, key) => {\n acc[key as keyof ResetTheme] = {};\n return acc;\n }, {} as ResetTheme),\n reset: RESET_BASIC.reset,\n};\n\nexport const RESET_THEMES: Record<EditorTheme, ResetTheme> = {\n basic: RESET_BASIC,\n minimal: RESET_MINIMAL,\n};\n\nexport function resolveResetValue(\n value: string | number | undefined,\n targetUnit: 'px' | '%',\n bodyFontSizePx: number,\n): number | undefined {\n if (value === undefined) {\n return undefined;\n }\n const str = String(value);\n const num = Number.parseFloat(str);\n if (Number.isNaN(num)) {\n return undefined;\n }\n if (str.endsWith('em')) {\n return targetUnit === 'px' ? Math.floor(num * bodyFontSizePx) : num * 100;\n }\n return num;\n}\n\nexport const EDITOR_THEMES: Record<EditorTheme, PanelGroup[]> = {\n minimal: THEME_MINIMAL,\n basic: THEME_BASIC,\n};\n\nexport function getThemeBodyFontSizePx(theme: EditorTheme): number {\n for (const group of EDITOR_THEMES[theme]) {\n if (group.classReference !== 'body') {\n continue;\n }\n for (const input of group.inputs) {\n if (input.prop === 'fontSize' && typeof input.value === 'number') {\n return input.value;\n }\n }\n }\n return 14;\n}\n\n/**\n * Use to make the preview nicer once the theme might miss some\n * important properties to make layout accurate\n */\nexport const DEFAULT_INBOX_FONT_SIZE_PX = 14;\nexport const INBOX_EMAIL_DEFAULTS: Partial<ResetTheme> = {\n body: {\n color: '#000000',\n fontFamily:\n \"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif\",\n fontSize: `${DEFAULT_INBOX_FONT_SIZE_PX}px`,\n lineHeight: '155%',\n },\n container: {\n width: 600,\n },\n};\n\nexport const SUPPORTED_CSS_PROPERTIES: SupportedCssProperties = {\n align: {\n label: 'Align',\n type: 'select',\n options: {\n left: 'Left',\n center: 'Center',\n right: 'Right',\n },\n defaultValue: 'left',\n category: 'layout',\n },\n backgroundColor: {\n label: 'Background',\n type: 'color',\n excludeNodes: ['image', 'youtube'],\n defaultValue: '#ffffff',\n category: 'appearance',\n },\n color: {\n label: 'Text color',\n type: 'color',\n excludeNodes: ['image', 'youtube'],\n defaultValue: '#000000',\n category: 'typography',\n },\n fontSize: {\n label: 'Font size',\n type: 'number',\n unit: 'px',\n excludeNodes: ['image', 'youtube'],\n defaultValue: 14,\n category: 'typography',\n },\n fontWeight: {\n label: 'Font weight',\n type: 'select',\n options: {\n 300: 'Light',\n 400: 'Normal',\n 600: 'Semi Bold',\n 700: 'Bold',\n 800: 'Extra Bold',\n },\n excludeNodes: ['image', 'youtube'],\n defaultValue: 400,\n category: 'typography',\n },\n letterSpacing: {\n label: 'Letter spacing',\n type: 'number',\n unit: 'px',\n excludeNodes: ['image', 'youtube'],\n defaultValue: 0,\n category: 'typography',\n },\n lineHeight: {\n label: 'Line height',\n type: 'number',\n unit: '%',\n defaultValue: 155,\n category: 'typography',\n },\n textDecoration: {\n label: 'Text decoration',\n type: 'select',\n options: {\n none: 'None',\n underline: 'Underline',\n 'line-through': 'Line-through',\n },\n defaultValue: 'none',\n category: 'typography',\n },\n borderRadius: {\n label: 'Border Radius',\n type: 'number',\n unit: 'px',\n defaultValue: 8,\n category: 'appearance',\n },\n borderTopLeftRadius: {\n label: 'Border Radius (Top-Left)',\n type: 'number',\n unit: 'px',\n defaultValue: 8,\n category: 'appearance',\n },\n borderTopRightRadius: {\n label: 'Border Radius (Top-Right)',\n type: 'number',\n unit: 'px',\n defaultValue: 8,\n category: 'appearance',\n },\n borderBottomLeftRadius: {\n label: 'Border Radius (Bottom-Left)',\n type: 'number',\n unit: 'px',\n defaultValue: 8,\n category: 'appearance',\n },\n borderBottomRightRadius: {\n label: 'Border Radius (Bottom-Right)',\n type: 'number',\n unit: 'px',\n defaultValue: 8,\n category: 'appearance',\n },\n borderWidth: {\n label: 'Border Width',\n type: 'number',\n unit: 'px',\n defaultValue: 1,\n category: 'appearance',\n },\n borderTopWidth: {\n label: 'Border Top Width',\n type: 'number',\n unit: 'px',\n defaultValue: 1,\n category: 'appearance',\n },\n borderRightWidth: {\n label: 'Border Right Width',\n type: 'number',\n unit: 'px',\n defaultValue: 1,\n category: 'appearance',\n },\n borderBottomWidth: {\n label: 'Border Bottom Width',\n type: 'number',\n unit: 'px',\n defaultValue: 1,\n category: 'appearance',\n },\n borderLeftWidth: {\n label: 'Border Left Width',\n type: 'number',\n unit: 'px',\n defaultValue: 1,\n category: 'appearance',\n },\n borderStyle: {\n label: 'Border Style',\n type: 'select',\n options: {\n solid: 'Solid',\n dashed: 'Dashed',\n dotted: 'Dotted',\n },\n defaultValue: 'solid',\n category: 'appearance',\n },\n borderTopStyle: {\n label: 'Border Top Style',\n type: 'select',\n options: {\n solid: 'Solid',\n dashed: 'Dashed',\n dotted: 'Dotted',\n },\n defaultValue: 'solid',\n category: 'appearance',\n },\n borderRightStyle: {\n label: 'Border Right Style',\n type: 'select',\n options: {\n solid: 'Solid',\n dashed: 'Dashed',\n dotted: 'Dotted',\n },\n defaultValue: 'solid',\n category: 'appearance',\n },\n borderBottomStyle: {\n label: 'Border Bottom Style',\n type: 'select',\n options: {\n solid: 'Solid',\n dashed: 'Dashed',\n dotted: 'Dotted',\n },\n defaultValue: 'solid',\n category: 'appearance',\n },\n borderLeftStyle: {\n label: 'Border Left Style',\n type: 'select',\n options: {\n solid: 'Solid',\n dashed: 'Dashed',\n dotted: 'Dotted',\n },\n defaultValue: 'solid',\n category: 'appearance',\n },\n borderColor: {\n label: 'Border Color',\n type: 'color',\n defaultValue: '#000000',\n category: 'appearance',\n },\n borderTopColor: {\n label: 'Border Top Color',\n type: 'color',\n defaultValue: '#000000',\n category: 'appearance',\n },\n borderRightColor: {\n label: 'Border Right Color',\n type: 'color',\n defaultValue: '#000000',\n category: 'appearance',\n },\n borderBottomColor: {\n label: 'Border Bottom Color',\n type: 'color',\n defaultValue: '#000000',\n category: 'appearance',\n },\n borderLeftColor: {\n label: 'Border Left Color',\n type: 'color',\n defaultValue: '#000000',\n category: 'appearance',\n },\n padding: {\n label: 'Padding',\n type: 'number',\n unit: 'px',\n defaultValue: 8,\n category: 'layout',\n },\n paddingTop: {\n label: 'Padding Top',\n type: 'number',\n unit: 'px',\n defaultValue: 8,\n category: 'layout',\n },\n paddingLeft: {\n label: 'Padding Left',\n type: 'number',\n unit: 'px',\n defaultValue: 8,\n category: 'layout',\n },\n paddingBottom: {\n label: 'Padding Bottom',\n type: 'number',\n unit: 'px',\n defaultValue: 8,\n category: 'layout',\n },\n paddingRight: {\n label: 'Padding Right',\n type: 'number',\n unit: 'px',\n defaultValue: 8,\n category: 'layout',\n },\n width: {\n label: 'Width',\n type: 'number',\n unit: 'px',\n defaultValue: 600,\n category: 'layout',\n },\n height: {\n label: 'Height',\n type: 'number',\n unit: 'px',\n defaultValue: 400,\n category: 'layout',\n },\n};\n","import { EDITOR_THEMES } from './themes';\nimport type {\n EditorTheme,\n KnownThemeComponents,\n PanelGroup,\n PanelSectionId,\n} from './types';\n\nconst PANEL_SECTION_IDS = new Set<PanelSectionId>([\n 'body',\n 'container',\n 'typography',\n 'link',\n 'image',\n 'button',\n 'code-block',\n 'inline-code',\n]);\n\nconst PANEL_SECTION_IDS_BY_TITLE: Record<string, PanelSectionId> = {\n background: 'body',\n body: 'body',\n content: 'container',\n container: 'container',\n typography: 'typography',\n link: 'link',\n image: 'image',\n button: 'button',\n 'code block': 'code-block',\n 'inline code': 'inline-code',\n};\n\nconst PANEL_SECTION_IDS_BY_CLASS_REFERENCE: Partial<\n Record<KnownThemeComponents, PanelSectionId>\n> = {\n container: 'container',\n link: 'link',\n image: 'image',\n button: 'button',\n codeBlock: 'code-block',\n inlineCode: 'inline-code',\n};\n\nfunction isPanelSectionId(value: unknown): value is PanelSectionId {\n return (\n typeof value === 'string' && PANEL_SECTION_IDS.has(value as PanelSectionId)\n );\n}\n\nfunction normalizeTitle(title: string | undefined): string {\n return title?.trim().toLowerCase().replace(/\\s+/g, ' ') ?? '';\n}\n\nfunction resolvePanelSectionId(group: PanelGroup): PanelSectionId | null {\n if (isPanelSectionId(group.id)) {\n return group.id;\n }\n\n const normalizedTitle = normalizeTitle(group.title);\n\n if (group.classReference === 'body') {\n if (normalizedTitle === 'typography') {\n return 'typography';\n }\n\n return 'body';\n }\n\n if (\n group.classReference &&\n PANEL_SECTION_IDS_BY_CLASS_REFERENCE[group.classReference]\n ) {\n return PANEL_SECTION_IDS_BY_CLASS_REFERENCE[group.classReference] ?? null;\n }\n\n return PANEL_SECTION_IDS_BY_TITLE[normalizedTitle] ?? null;\n}\n\nfunction normalizePanelInputs(\n inputs: PanelGroup['inputs'],\n defaultInputs: PanelGroup['inputs'],\n fallbackClassReference?: KnownThemeComponents,\n): PanelGroup['inputs'] {\n if (!Array.isArray(inputs)) {\n return [];\n }\n\n return inputs.map((input) => {\n const defaultInput = defaultInputs.find(\n (candidate) => candidate.prop === input.prop,\n );\n\n return {\n ...defaultInput,\n ...input,\n classReference:\n input.classReference ??\n defaultInput?.classReference ??\n fallbackClassReference,\n };\n });\n}\n\nexport function inferThemeFromPanelStyles(\n panelStyles: PanelGroup[] | null | undefined,\n): EditorTheme | null {\n if (!Array.isArray(panelStyles) || panelStyles.length === 0) {\n return null;\n }\n\n let finalTheme: EditorTheme | null = null;\n for (const group of panelStyles) {\n if (!Array.isArray(group?.inputs)) {\n finalTheme = null;\n break;\n }\n\n if (group.inputs.length !== 0) {\n finalTheme = 'basic';\n break;\n }\n\n finalTheme = 'minimal';\n }\n\n return finalTheme;\n}\n\nexport function normalizeThemePanelStyles(\n theme: EditorTheme,\n panelStyles: PanelGroup[] | null | undefined,\n): PanelGroup[] | null {\n if (!Array.isArray(panelStyles)) {\n return null;\n }\n\n return panelStyles.map((group) => {\n const panelId = resolvePanelSectionId(group);\n\n if (!panelId) {\n return group;\n }\n\n const defaultGroup = EDITOR_THEMES[theme].find(\n (candidate) => candidate.id === panelId,\n );\n\n if (!defaultGroup) {\n return group;\n }\n\n return {\n ...group,\n id: panelId,\n title: defaultGroup.title,\n classReference: defaultGroup.classReference,\n inputs: normalizePanelInputs(\n group.inputs,\n defaultGroup.inputs,\n defaultGroup.classReference,\n ),\n };\n });\n}\n","import { Body, Head, Html, Preview } from '@react-email/components';\nimport type { Editor, JSONContent } from '@tiptap/core';\nimport { Extension } from '@tiptap/core';\nimport { Plugin, PluginKey } from '@tiptap/pm/state';\nimport { useEditorState } from '@tiptap/react';\nimport type * as React from 'react';\nimport type { SerializerPlugin } from '../../core/serializer/serializer-plugin';\nimport { getGlobalContent } from '../../extensions/global-content';\nimport {\n injectGlobalPlainCss,\n injectThemeCss,\n mergeCssJs,\n transformToCssJs,\n} from './css-transforms';\nimport {\n inferThemeFromPanelStyles,\n normalizeThemePanelStyles,\n} from './normalization';\nimport {\n DEFAULT_INBOX_FONT_SIZE_PX,\n EDITOR_THEMES,\n RESET_THEMES,\n} from './themes';\nimport type {\n CssJs,\n EditorTheme,\n KnownThemeComponents,\n PanelGroup,\n} from './types';\n\n/**\n * Maps a document node (type + attrs) to the theme component key used for style lookup.\n * Centralizes all node-type → theme-component knowledge.\n */\nexport function getThemeComponentKey(\n nodeType: string,\n depth: number,\n attrs: Record<string, unknown> = {},\n): KnownThemeComponents | null {\n switch (nodeType) {\n case 'paragraph':\n if (depth > 0) {\n return 'listParagraph';\n }\n return 'paragraph';\n case 'heading': {\n const level = attrs.level as number | undefined;\n return `h${level ?? 1}` as KnownThemeComponents;\n }\n case 'blockquote':\n return 'blockquote';\n case 'button':\n return 'button';\n case 'container':\n return 'container';\n case 'section':\n return 'section';\n case 'footer':\n return 'footer';\n case 'image':\n return 'image';\n case 'youtube':\n case 'twitter':\n return 'image';\n case 'orderedList':\n case 'bulletList':\n if (depth > 0) {\n return 'nestedList';\n }\n return 'list';\n case 'listItem':\n return 'listItem';\n case 'codeBlock':\n return 'codeBlock';\n case 'code':\n return 'inlineCode';\n case 'link':\n return 'link';\n case 'horizontalRule':\n return 'hr';\n default:\n return null;\n }\n}\n\n/**\n * Returns merged theme styles (reset + panel styles) for the given editor.\n * Use when you have editor access and need the full CssJs map.\n */\nexport function getMergedCssJs(\n theme: EditorTheme,\n panelStyles: PanelGroup[] | undefined,\n): CssJs {\n const panels: PanelGroup[] =\n normalizeThemePanelStyles(theme, panelStyles) ?? EDITOR_THEMES[theme];\n const parsed = transformToCssJs(panels, DEFAULT_INBOX_FONT_SIZE_PX);\n const merged = mergeCssJs(RESET_THEMES[theme], parsed);\n\n return merged;\n}\n\n/**\n * Returns resolved React.CSSProperties for a node when you already have merged CssJs\n * (e.g. in the serializer where there is no editor). Centralizes which theme keys\n * apply to which node type.\n */\nconst RESET_NODE_TYPES = new Set([\n 'body',\n 'bulletList',\n 'container',\n 'button',\n 'columns',\n 'div',\n 'h1',\n 'h2',\n 'h3',\n 'list',\n 'listItem',\n 'listParagraph',\n 'nestedList',\n 'orderedList',\n 'table',\n 'paragraph',\n 'tableCell',\n 'tableHeader',\n 'tableRow',\n 'youtube',\n]);\n\nexport function getResolvedNodeStyles(\n node: JSONContent,\n depth: number,\n mergedCssJs: CssJs,\n): React.CSSProperties {\n const key = getThemeComponentKey(node.type ?? '', depth, node.attrs ?? {});\n if (!key) {\n if (RESET_NODE_TYPES.has(node.type ?? '')) {\n return mergedCssJs.reset ?? {};\n }\n return {};\n }\n const component = mergedCssJs[key] ?? {};\n const shouldReset =\n RESET_NODE_TYPES.has(key) || RESET_NODE_TYPES.has(node.type ?? '');\n if (shouldReset) {\n const reset = mergedCssJs.reset ?? {};\n return { ...reset, ...component };\n }\n return { ...component };\n}\n\nexport function stylesToCss(\n styles: PanelGroup[],\n theme: EditorTheme,\n): Record<KnownThemeComponents, React.CSSProperties> {\n const parsed = transformToCssJs(\n normalizeThemePanelStyles(theme, styles) ?? EDITOR_THEMES[theme],\n DEFAULT_INBOX_FONT_SIZE_PX,\n );\n return mergeCssJs(RESET_THEMES[theme], parsed);\n}\n\nfunction getEmailTheming(editor: Editor) {\n const theme = getEmailTheme(editor);\n const normalizedStyles =\n normalizeThemePanelStyles(theme, getEmailStyles(editor)) ??\n EDITOR_THEMES[theme];\n\n return {\n styles: normalizedStyles,\n theme,\n css: getEmailCss(editor),\n };\n}\n\nexport function useEmailTheming(editor: Editor | null) {\n return useEditorState({\n editor,\n selector({ editor: ed }) {\n if (!ed) {\n return null;\n }\n return getEmailTheming(ed);\n },\n });\n}\n\nfunction getEmailStyles(editor: Editor) {\n return getGlobalContent('styles', editor) as PanelGroup[] | null;\n}\n\n/**\n * Sets the global panel styles on the editor document.\n * Persists into the `GlobalContent` node under the `'styles'` key.\n */\nexport function setGlobalStyles(editor: Editor, styles: PanelGroup[]): boolean {\n return editor.commands.setGlobalContent('styles', styles);\n}\n\n/**\n * Sets the current email theme on the editor document.\n * Persists into the `GlobalContent` node under the `'theme'` key.\n */\nexport function setCurrentTheme(editor: Editor, theme: EditorTheme): boolean {\n return editor.commands.setGlobalContent('theme', theme);\n}\n\n/**\n * Sets the global CSS string injected into the email `<head>`.\n * Persists into the `GlobalContent` node under the `'css'` key.\n */\nexport function setGlobalCssInjected(editor: Editor, css: string): boolean {\n return editor.commands.setGlobalContent('css', css);\n}\n\nfunction getEmailTheme(editor: Editor) {\n const extensionTheme = (\n editor.extensionManager.extensions.find(\n (extension) => extension.name === 'theming',\n ) as { options?: { theme?: EditorTheme } }\n )?.options?.theme;\n if (extensionTheme === 'basic' || extensionTheme === 'minimal') {\n return extensionTheme;\n }\n\n const globalTheme = getGlobalContent('theme', editor) as EditorTheme | null;\n if (globalTheme === 'basic' || globalTheme === 'minimal') {\n return globalTheme;\n }\n\n const inferredTheme = inferThemeFromPanelStyles(getEmailStyles(editor));\n if (inferredTheme) {\n return inferredTheme;\n }\n\n return 'basic';\n}\n\nfunction getEmailCss(editor: Editor) {\n return getGlobalContent('css', editor) as string | null;\n}\n\nexport const EmailTheming = Extension.create<{\n theme?: EditorTheme;\n serializerPlugin: SerializerPlugin;\n}>({\n name: 'theming',\n\n addOptions() {\n return {\n theme: undefined as EditorTheme | undefined,\n serializerPlugin: {\n getNodeStyles(node, depth, editor): React.CSSProperties {\n const theming = getEmailTheming(editor);\n\n return getResolvedNodeStyles(\n node,\n depth,\n getMergedCssJs(theming.theme, theming.styles),\n );\n },\n BaseTemplate({ previewText, children, editor }) {\n const { css: globalCss, styles, theme } = getEmailTheming(editor);\n const mergedStyles = getMergedCssJs(theme, styles);\n\n return (\n <Html>\n <Head>\n <meta content=\"width=device-width\" name=\"viewport\" />\n <meta content=\"IE=edge\" httpEquiv=\"X-UA-Compatible\" />\n <meta name=\"x-apple-disable-message-reformatting\" />\n <meta\n content=\"telephone=no,address=no,email=no,date=no,url=no\"\n name=\"format-detection\"\n />\n\n {globalCss && <style>{globalCss}</style>}\n </Head>\n {previewText && previewText !== '' && (\n <Preview>{previewText}</Preview>\n )}\n\n <Body style={mergedStyles.body}>{children}</Body>\n </Html>\n );\n },\n } satisfies SerializerPlugin,\n };\n },\n\n addProseMirrorPlugins() {\n const { editor } = this;\n const scopeId = `tiptap-theme-${Math.random().toString(36).slice(2, 10)}`;\n const scopeAttribute = 'data-editor-theme-scope';\n const scopeSelector = `.tiptap.ProseMirror[${scopeAttribute}=\"${scopeId}\"]`;\n const themeStyleId = `${scopeId}-theme`;\n const globalStyleId = `${scopeId}-global`;\n\n return [\n new Plugin({\n key: new PluginKey('themingStyleInjector'),\n view(view) {\n let prevStyles: PanelGroup[] | null = null;\n let prevTheme: EditorTheme | null = null;\n let prevCss: string | null = null;\n\n view.dom.setAttribute(scopeAttribute, scopeId);\n\n const sync = () => {\n const theme = getEmailTheme(editor);\n const styles = getEmailStyles(editor);\n const resolvedStyles = styles ?? EDITOR_THEMES[theme];\n const css = getEmailCss(editor);\n\n if (styles !== prevStyles || theme !== prevTheme) {\n prevStyles = styles as PanelGroup[] | null;\n prevTheme = theme;\n const mergedCssJs = getMergedCssJs(theme, resolvedStyles);\n injectThemeCss(mergedCssJs, {\n scopeSelector,\n styleId: themeStyleId,\n });\n }\n\n if (css !== prevCss) {\n prevCss = css;\n injectGlobalPlainCss(css, {\n scopeSelector,\n styleId: globalStyleId,\n });\n }\n };\n\n sync();\n\n return {\n update: sync,\n destroy() {\n document.getElementById(themeStyleId)?.remove();\n document.getElementById(globalStyleId)?.remove();\n view.dom.removeAttribute(scopeAttribute);\n },\n };\n },\n }),\n ];\n },\n});\n"],"mappings":";;;;;;;;;AAGA,SAAgB,iBACd,YACA,cACO;CACP,MAAM,QAAQ,EAAE;AAEhB,KAAI,CAAC,MAAM,QAAQ,WAAW,CAC5B,QAAO;AAGT,MAAK,MAAM,SAAS,WAClB,MAAK,MAAM,SAAS,MAAM,QAAQ;EAChC,IAAI,QAAQ,MAAM;AAGlB,MAAI,MAAM,QAAQ,OAAO,UAAU,SAEjC,KAAI,MAAM,SAAS,WACjB,SAAQ,GAAG,QAAQ,aAAa;MAEhC,SAAQ,GAAG,QAAQ,MAAM;AAI7B,MAAI,CAAC,MAAM,eACT;AAGF,MAAI,CAAC,MAAM,MAAM,gBACf,OAAM,MAAM,kBAAkB,EAAE;AAIlC,MAAI,MAAM,SAAS,aAAa;AAC9B,SAAM,MAAM,gBAAgB,cAAc;AAC1C,SAAM,MAAM,gBAAgB,eAAe;AAE3C;;AAIF,QAAM,MAAM,gBAAgB,MAAM,QAAQ;;AAI9C,MAAK,MAAM,OAAO,OAAO,KAAK,MAAM,CAClC,2BACE,MAAM,KACP;AAGH,QAAO;;AAGT,SAAgB,WAAW,UAAiB,UAAiB;CAC3D,MAAM,SAAS,EAAE,GAAG,UAAU;AAE9B,MAAK,MAAM,OAAO,UAAU;EAC1B,MAAM,UAAU;AAEhB,MACE,OAAO,OAAO,QAAQ,IAAI,IAC1B,OAAO,OAAO,aAAa,YAC3B,CAAC,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,gBAAgB;GACjB,EACD;GACE,OAAO;GACP,MAAM;GACN,OAAO;GACP,MAAM;GACN,SAAS;IACP,WAAW;IACX,MAAM;IACP;GACD,gBAAgB;GACjB,CACF;EACF;CACD;EACE,IAAI;EACJ,OAAO;EACP,gBAAgB;EAChB,QAAQ,CACN;GACE,OAAO;GACP,MAAM;GACN,OAAO;GACP,MAAM;GACN,MAAM;GACN,gBAAgB;GACjB,CACF;EACF;CACD;EACE,IAAI;EACJ,OAAO;EACP,gBAAgB;EAChB,QAAQ;GACN;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACF;EACF;CACD;EACE,IAAI;EACJ,OAAO;EACP,gBAAgB;EAChB,QAAQ;GACN;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACD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AAc;EACd,UAAU;EACX;CACD,iBAAiB;EACf,OAAO;EACP,MAAM;EACN,cAAc,CAAC,SAAS,UAAU;EAClC,cAAc;EACd,UAAU;EACX;CACD,OAAO;EACL,OAAO;EACP,MAAM;EACN,cAAc,CAAC,SAAS,UAAU;EAClC,cAAc;EACd,UAAU;EACX;CACD,UAAU;EACR,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc,CAAC,SAAS,UAAU;EAClC,cAAc;EACd,UAAU;EACX;CACD,YAAY;EACV,OAAO;EACP,MAAM;EACN,SAAS;GACP,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACL,KAAK;GACN;EACD,cAAc,CAAC,SAAS,UAAU;EAClC,cAAc;EACd,UAAU;EACX;CACD,eAAe;EACb,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc,CAAC,SAAS,UAAU;EAClC,cAAc;EACd,UAAU;EACX;CACD,YAAY;EACV,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,gBAAgB;EACd,OAAO;EACP,MAAM;EACN,SAAS;GACP,MAAM;GACN,WAAW;GACX,gBAAgB;GACjB;EACD,cAAc;EACd,UAAU;EACX;CACD,cAAc;EACZ,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,qBAAqB;EACnB,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,sBAAsB;EACpB,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,wBAAwB;EACtB,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,yBAAyB;EACvB,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,aAAa;EACX,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,gBAAgB;EACd,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,kBAAkB;EAChB,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,mBAAmB;EACjB,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,iBAAiB;EACf,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,aAAa;EACX,OAAO;EACP,MAAM;EACN,SAAS;GACP,OAAO;GACP,QAAQ;GACR,QAAQ;GACT;EACD,cAAc;EACd,UAAU;EACX;CACD,gBAAgB;EACd,OAAO;EACP,MAAM;EACN,SAAS;GACP,OAAO;GACP,QAAQ;GACR,QAAQ;GACT;EACD,cAAc;EACd,UAAU;EACX;CACD,kBAAkB;EAChB,OAAO;EACP,MAAM;EACN,SAAS;GACP,OAAO;GACP,QAAQ;GACR,QAAQ;GACT;EACD,cAAc;EACd,UAAU;EACX;CACD,mBAAmB;EACjB,OAAO;EACP,MAAM;EACN,SAAS;GACP,OAAO;GACP,QAAQ;GACR,QAAQ;GACT;EACD,cAAc;EACd,UAAU;EACX;CACD,iBAAiB;EACf,OAAO;EACP,MAAM;EACN,SAAS;GACP,OAAO;GACP,QAAQ;GACR,QAAQ;GACT;EACD,cAAc;EACd,UAAU;EACX;CACD,aAAa;EACX,OAAO;EACP,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,gBAAgB;EACd,OAAO;EACP,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,kBAAkB;EAChB,OAAO;EACP,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,mBAAmB;EACjB,OAAO;EACP,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,iBAAiB;EACf,OAAO;EACP,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,SAAS;EACP,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc;EACd,UAAU;EACX;CACD,YAAY;EACV,OAAO;EACP,MAAM;EACN,MAAM;EACN,cAAc;EACd,U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IAAI,gBAAgB,eAAe;;KAE3C;;GAEJ,CAAC,CACH;;CAEJ,CAAC"}
@@ -1,6 +1,6 @@
1
1
  const require_event_bus = require('./event-bus-fb8U7hrl.cjs');
2
2
  const require_styles = require('./styles-C-cCyJCn.cjs');
3
- const require_global_content = require('./global-content-62RO9uoQ.cjs');
3
+ const require_global_content = require('./global-content-bJgotqmA.cjs');
4
4
  let _tiptap_react = require("@tiptap/react");
5
5
  let _react_email_components = require("@react-email/components");
6
6
  let react_jsx_runtime = require("react/jsx-runtime");
@@ -894,6 +894,7 @@ function getThemeComponentKey(nodeType, depth, attrs = {}) {
894
894
  case "heading": return `h${attrs.level ?? 1}`;
895
895
  case "blockquote": return "blockquote";
896
896
  case "button": return "button";
897
+ case "container": return "container";
897
898
  case "section": return "section";
898
899
  case "footer": return "footer";
899
900
  case "image": return "image";
@@ -927,6 +928,7 @@ function getMergedCssJs(theme, panelStyles) {
927
928
  const RESET_NODE_TYPES = new Set([
928
929
  "body",
929
930
  "bulletList",
931
+ "container",
930
932
  "button",
931
933
  "columns",
932
934
  "div",
@@ -1046,21 +1048,10 @@ const EmailTheming = _tiptap_core.Extension.create({
1046
1048
  globalCss && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("style", { children: globalCss })
1047
1049
  ] }),
1048
1050
  previewText && previewText !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_email_components.Preview, { children: previewText }),
1049
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_email_components.Body, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_email_components.Section, {
1050
- width: "100%",
1051
- align: "center",
1051
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_email_components.Body, {
1052
1052
  style: mergedStyles.body,
1053
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_email_components.Section, {
1054
- align: mergedStyles.container?.align,
1055
- style: {
1056
- ...mergedStyles.container,
1057
- width: "100%",
1058
- maxWidth: mergedStyles.container?.width,
1059
- fontFamily: mergedStyles.body?.fontFamily
1060
- },
1061
- children
1062
- })
1063
- }) })
1053
+ children
1054
+ })
1064
1055
  ] });
1065
1056
  }
1066
1057
  }
@@ -1,6 +1,6 @@
1
1
  const require_event_bus = require('../event-bus-fb8U7hrl.cjs');
2
- const require_extensions = require('../extensions-aMMnHcs9.cjs');
3
- const require_global_content = require('../global-content-62RO9uoQ.cjs');
2
+ const require_extensions = require('../extensions-CkjPj2JO.cjs');
3
+ const require_global_content = require('../global-content-bJgotqmA.cjs');
4
4
 
5
5
  exports.AlignmentAttribute = require_extensions.AlignmentAttribute;
6
6
  exports.Blockquote = require_extensions.Blockquote;
@@ -13,6 +13,7 @@ exports.ClassAttribute = require_extensions.ClassAttribute;
13
13
  exports.Code = require_extensions.Code;
14
14
  exports.CodeBlockPrism = require_extensions.CodeBlockPrism;
15
15
  exports.ColumnsColumn = require_event_bus.ColumnsColumn;
16
+ exports.Container = require_extensions.Container;
16
17
  exports.Div = require_extensions.Div;
17
18
  exports.Divider = require_extensions.Divider;
18
19
  exports.FourColumns = require_event_bus.FourColumns;
@@ -40,9 +41,11 @@ exports.TableHeader = require_extensions.TableHeader;
40
41
  exports.TableRow = require_extensions.TableRow;
41
42
  exports.Text = require_extensions.Text;
42
43
  exports.ThreeColumns = require_event_bus.ThreeColumns;
44
+ exports.TrailingNode = require_extensions.TrailingNode;
43
45
  exports.TwoColumns = require_event_bus.TwoColumns;
44
46
  exports.Underline = require_extensions.Underline;
45
47
  exports.Uppercase = require_extensions.Uppercase;
46
48
  exports.getColumnsDepth = require_event_bus.getColumnsDepth;
47
49
  exports.getGlobalContent = require_global_content.getGlobalContent;
48
- exports.processStylesForUnlink = require_extensions.processStylesForUnlink;
50
+ exports.processStylesForUnlink = require_extensions.processStylesForUnlink;
51
+ exports.skipTrailingNodeMeta = require_extensions.skipTrailingNodeMeta;
@@ -91,6 +91,12 @@ interface CodeBlockPrismOptions extends CodeBlockOptions {
91
91
  }
92
92
  declare const CodeBlockPrism: EmailNode<CodeBlockPrismOptions, any>;
93
93
  //#endregion
94
+ //#region src/extensions/container.d.ts
95
+ interface ContainerOptions {
96
+ HTMLAttributes: Record<string, unknown>;
97
+ }
98
+ declare const Container: EmailNode<ContainerOptions, Record<string, never>>;
99
+ //#endregion
94
100
  //#region src/extensions/div.d.ts
95
101
  interface DivOptions {
96
102
  HTMLAttributes: Record<string, unknown>;
@@ -234,6 +240,41 @@ interface TableCellOptions extends Record<string, unknown> {
234
240
  declare const TableCell: EmailNode<TableCellOptions, Record<string, never>>;
235
241
  declare const TableHeader: Node$1<any, any>;
236
242
  //#endregion
243
+ //#region src/extensions/trailing-node.d.ts
244
+ declare const skipTrailingNodeMeta = "skipTrailingNode";
245
+ /**
246
+ * Extension based on:
247
+ * - https://github.com/ueberdosis/tiptap/blob/v1/packages/tiptap-extensions/src/extensions/TrailingNode.js
248
+ * - https://github.com/remirror/remirror/blob/e0f1bec4a1e8073ce8f5500d62193e52321155b9/packages/prosemirror-trailing-node/src/trailing-node-plugin.ts
249
+ */
250
+ interface TrailingNodeOptions {
251
+ /**
252
+ * The node type that should be inserted at the end of the document.
253
+ * @note the node will always be added to the `notAfter` lists to
254
+ * prevent an infinite loop.
255
+ * @default undefined
256
+ */
257
+ node?: string;
258
+ /**
259
+ * The node that the trailing node should be appended to. The default is the 'doc', giving the same behavior as TipTap's extension.
260
+ */
261
+ appendTo?: string;
262
+ /**
263
+ * The node types after which the trailing node should not be inserted.
264
+ * @default ['paragraph']
265
+ */
266
+ notAfter?: string | string[];
267
+ }
268
+ /**
269
+ * This extension allows you to add an extra node at the end of a node.
270
+ *
271
+ * Differently from TipTap's native one, it allows you to pick which node to append the trailing node to.
272
+ * @see https://www.tiptap.dev/api/extensions/trailing-node
273
+ *
274
+ * We could contribute this to TipTap's core extensions and I think we should at some once we get some time.
275
+ */
276
+ declare const TrailingNode: Extension<TrailingNodeOptions, any>;
277
+ //#endregion
237
278
  //#region src/extensions/underline.d.ts
238
279
  type UnderlineOptions = UnderlineOptions$1;
239
280
  declare const Underline: EmailMark<UnderlineOptions$1, any>;
@@ -319,6 +360,7 @@ type StarterKitOptions = {
319
360
  Paragraph: Partial<ParagraphOptions> | false;
320
361
  BulletList: Partial<BulletListOptions> | false;
321
362
  OrderedList: Partial<OrderedListOptions> | false;
363
+ TrailingNode: Partial<TrailingNodeOptions> | false;
322
364
  Blockquote: Partial<BlockquoteOptions> | false;
323
365
  ListItem: Partial<ListItemOptions> | false;
324
366
  HardBreak: Partial<HardBreakOptions> | false;
@@ -339,6 +381,7 @@ type StarterKitOptions = {
339
381
  TableCell: Partial<TableCellOptions> | false;
340
382
  TableHeader: Partial<Record<string, any>> | false;
341
383
  Body: Partial<BodyOptions> | false;
384
+ Container: Partial<ContainerOptions> | false;
342
385
  Div: Partial<DivOptions> | false;
343
386
  Text: Record<string, never> | false;
344
387
  Button: Partial<EditorButtonOptions> | false;
@@ -352,5 +395,5 @@ type StarterKitOptions = {
352
395
  };
353
396
  declare const StarterKit: Extension<StarterKitOptions, any>;
354
397
  //#endregion
355
- export { AlignmentAttribute, AlignmentOptions, Blockquote, Body, BodyOptions, Bold, BoldOptions, BulletList, Button, COLUMN_PARENT_TYPES, ClassAttribute, ClassAttributeOptions, Code, CodeBlockPrism, CodeBlockPrismOptions, ColumnsColumn, Div, DivOptions, Divider, DividerOptions, EditorButtonOptions, FourColumns, GlobalContent, GlobalContentOptions, HardBreak, Heading, HeadingOptions, Italic, Link, LinkOptions, ListItem, MAX_COLUMNS_DEPTH, MaxNesting, MaxNestingOptions, OrderedList, Paragraph, Placeholder, PlaceholderOptions, PreservedStyle, PreviewText, PreviewTextOptions, Section, SectionOptions, StarterKit, StarterKitOptions, Strike, StyleAttribute, StyleAttributeOptions, Sup, SupOptions, Table, TableCell, TableCellOptions, TableHeader, TableOptions, TableRow, TableRowOptions, Text, ThreeColumns, TwoColumns, Underline, UnderlineOptions, Uppercase, UppercaseOptions, getColumnsDepth, getGlobalContent, processStylesForUnlink };
398
+ export { AlignmentAttribute, AlignmentOptions, Blockquote, Body, BodyOptions, Bold, BoldOptions, BulletList, Button, COLUMN_PARENT_TYPES, ClassAttribute, ClassAttributeOptions, Code, CodeBlockPrism, CodeBlockPrismOptions, ColumnsColumn, Container, ContainerOptions, Div, DivOptions, Divider, DividerOptions, EditorButtonOptions, FourColumns, GlobalContent, GlobalContentOptions, HardBreak, Heading, HeadingOptions, Italic, Link, LinkOptions, ListItem, MAX_COLUMNS_DEPTH, MaxNesting, MaxNestingOptions, OrderedList, Paragraph, Placeholder, PlaceholderOptions, PreservedStyle, PreviewText, PreviewTextOptions, Section, SectionOptions, StarterKit, StarterKitOptions, Strike, StyleAttribute, StyleAttributeOptions, Sup, SupOptions, Table, TableCell, TableCellOptions, TableHeader, TableOptions, TableRow, TableRowOptions, Text, ThreeColumns, TrailingNode, TrailingNodeOptions, TwoColumns, Underline, UnderlineOptions, Uppercase, UppercaseOptions, getColumnsDepth, getGlobalContent, processStylesForUnlink, skipTrailingNodeMeta };
356
399
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/extensions/alignment-attribute.tsx","../../src/extensions/body.tsx","../../src/extensions/bold.tsx","../../src/extensions/button.tsx","../../src/extensions/class-attribute.tsx","../../src/extensions/code-block.tsx","../../src/extensions/div.tsx","../../src/extensions/divider.tsx","../../src/extensions/global-content.ts","../../src/extensions/heading.tsx","../../src/extensions/link.tsx","../../src/extensions/max-nesting.ts","../../src/extensions/placeholder.ts","../../src/extensions/preview-text.ts","../../src/extensions/section.tsx","../../src/extensions/style-attribute.tsx","../../src/extensions/sup.tsx","../../src/extensions/table.tsx","../../src/extensions/underline.tsx","../../src/extensions/uppercase.tsx","../../src/extensions/blockquote.tsx","../../src/extensions/bullet-list.tsx","../../src/extensions/code.tsx","../../src/extensions/columns.tsx","../../src/extensions/hard-break.tsx","../../src/extensions/italic.tsx","../../src/extensions/list-item.tsx","../../src/extensions/ordered-list.tsx","../../src/extensions/paragraph.tsx","../../src/extensions/preserved-style.tsx","../../src/extensions/strike.tsx","../../src/extensions/text.tsx","../../src/extensions/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;UAEiB,gBAAA;;;;;;;;;;2CAW0B;;;;cAK9B,oBAAkB,UAAA;;;UCTd,WAAA;kBACC;;cAGL,MAAI,UAAA,aAAA;;;KCTL,WAAA,GAAc;cAqBb,MAAM,UAAU;;;UChBZ,mBAAA;kBACC;;;;;;uBAOK;iCACU,4BAA4B;;;;cAKhD,QAAM,UAAA,qBAAA;;;UCrBF,qBAAA;;;;;;;;;;uCAWsB;;;;wBAIf;;;;cAKX,gBAAc,UAAA;;;UCVV,qBAAA,SAA8B;;;;cAKlC,gBAAc,UAAA;;;UCRV,UAAA;kBACC;;cAGL,KAAG,UAAA,YAAA;;;KCRJ,cAAA,GAAiB;cAMhB,SAAS,UAAU;;;UCPf,oBAAA;;QAET;;;;uDAK+C;;;mBAIpC,cAAc;;;iBAoCjB,gBAAA,sBAAsC;cAQzC,eAAa,OAAA;;;KCvDd,cAAA,GAAiB;cAWhB,SAAS,UAAU;;;KCXpB,WAAA,GAAc;cAOb,MAAM,UAAU;;;UCPZ,iBAAA;;;;cAKJ,YAAU,UAAA;;;UCJN,kBAAA;;UACyB;;;;cAI7B,aAAa,UAAU;;;UCRnB,kBAAA;kBACC;;cAGL,aAAW,OAAA;;;UCCP,cAAA;kBACC;;;;;;2BAOS;;;;cAKd,SAAO,UAAA,gBAAA;;;UClBH,qBAAA;;;;;;;;;;mCAWkB;;;;wBAIX;;;;cAKX,gBAAc,UAAA;;;KClBf,UAAA,GAAa;;;;;;;oBAQL;;;;uBAIG;;;;sBAID;;;;cA8BT,KAAK,UAAU;;;;;;;;;;;;eCzBT;eACA;cACD,aAAa,WAAW;;;;UAKzB,YAAA;kBACC;;cAGL,OAAK,UAAA,cAAA;UAwED,eAAA,SAAwB;mBACtB;AjB3GnB;AAGC,ciB2GY,Qj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d,QAAQ;OACT,QAAQ;QACP;ExB5KS,MAAA,EwB6KP,OxB7KO,CwB6KC,mBxB3KV,CAAA,GAAA,KAAM;EACb,OAAA,EwB2KU,OxB3KV,CwB2KkB,cxB3KlB,CAAA,GAAA,KAAA;EAAA,aAAA,EwB4KgB,OxB5KhB,CwB4KwB,oBxB5KxB,CAAA,GAAA,KAAA;EAAA,kBAAA,EwB6KqB,OxB7KrB,CwB6K6B,gBxB7K7B,CAAA,GAAA,KAAA;EAIsD,cAAA,EwB0KrC,OxB1KqC,CwB0K7B,qBxB1K6B,CAAA,GAAA,KAAA;EAItB,cAAA,EwBuKf,OxBvKe,CwBuKP,qBxBvKO,CAAA,GAAA,KAAA;EAAd,UAAA,EwBwKL,OxBxKK,CwBwKG,iBxBxKH,CAAA,GAAA,KAAA;EAAa,gBAAA,EwByKZ,OxBzKY,CwByKJ,mBxBzKI,CAAA,GAAA,KAAA;CAAA;AAAA,cwB4KnB,UxB5KmB,EwB4KT,SxB5KS,CwB4KT,iBxB5KS,EAAA,GAAA,CAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/extensions/alignment-attribute.tsx","../../src/extensions/body.tsx","../../src/extensions/bold.tsx","../../src/extensions/button.tsx","../../src/extensions/class-attribute.tsx","../../src/extensions/code-block.tsx","../../src/extensions/container.tsx","../../src/extensions/div.tsx","../../src/extensions/divider.tsx","../../src/extensions/global-content.ts","../../src/extensions/heading.tsx","../../src/extensions/link.tsx","../../src/extensions/max-nesting.ts","../../src/extensions/placeholder.ts","../../src/extensions/preview-text.ts","../../src/extensions/section.tsx","../../src/extensions/style-attribute.tsx","../../src/extensions/sup.tsx","../../src/extensions/table.tsx","../../src/extensions/trailing-node.tsx","../../src/extensions/underline.tsx","../../src/extensions/uppercase.tsx","../../src/extensions/blockquote.tsx","../../src/extensions/bullet-list.tsx","../../src/extensions/code.tsx","../../src/extensions/columns.tsx","../../src/extensions/hard-break.tsx","../../src/extensions/italic.tsx","../../src/extensions/list-item.tsx","../../src/extensions/ordered-list.tsx","../../src/extensions/paragraph.tsx","../../src/extensions/preserved-style.tsx","../../src/extensions/strike.tsx","../../src/extensions/text.tsx","../../src/extensions/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;UAEiB,gBAAA;;;;;;;;;;2CAW0B;;;;cAK9B,oBAAkB,UAAA;;;UCTd,WAAA;kBACC;;cAGL,MAAI,UAAA,aAAA;;;KCTL,WAAA,GAAc;cAqBb,MAAM,UAAU;;;UChBZ,mBAAA;kBACC;;;;;;uBAOK;iCACU,4BAA4B;;;;cAKhD,QAAM,UAAA,qBAAA;;;UCrBF,qBAAA;;;;;;;;;;uCAWsB;;;;wBAIf;;;;cAKX,gBAAc,UAAA;;;UCVV,qBAAA,SAA8B;;;;cAKlC,gBAAc,UAAA;;;UCgCV,gBAAA;kBACC;;cAGL,WAAS,UAAA,kBAAA;;;UC5CL,UAAA;kBACC;;cAGL,KAAG,UAAA,YAAA;;;KCRJ,cAAA,GAAiB;cAMhB,SAAS,UAAU;;;UCPf,oBAAA;;QAET;;;;uDAK+C;;;mBAIpC,cAAc;;;iBAoCjB,gBAAA,sBAAsC;cAQzC,eAAa,OAAA;;;KCvDd,cAAA,GAAiB;cAWhB,SAAS,UAAU;;;KCXpB,WAAA,GAAc;cAOb,MAAM,UAAU;;;UCPZ,iBAAA;;;;cAKJ,YAAU,UAAA;;;UCJN,kBAAA;;UACyB;;;;cAI7B,aAAa,UAAU;;;UCRnB,kBAAA;kBACC;;cAGL,aAAW,OAAA;;;UCCP,cAAA;kBACC;;;;;;2BAOS;;;;cAKd,SAAO,UAAA,gBAAA;;;UClBH,qBAAA;;;;;;;;;;mCAWkB;;;;wBAIX;;;;cAKX,gBAAc,UAAA;;;KClBf,UAAA,GAAa;;;;;;;oBAQL;;;;uBAIG;;;;sBAID;;;;cA8BT,KAAK,UAAU;;;;;;;;;;;;eCzBT;eACA;cACD,aAAa,WAAW;;;;UAKzB,YAAA;kBACC;;c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BoKU,M3BpKV,CAAA,MAAA,EAAA,KAAA,CAAA,CAAA,GAAA,KAAA;EAAA,KAAA,E2BqKP,O3BrKO,C2BqKC,Y3BrKD,CAAA,GAAA,KAAA;EAAA,QAAA,E2BsKJ,O3BtKI,C2BsKI,e3BtKJ,CAAA,GAAA,KAAA;EAAA,SAAA,E2BuKH,O3BvKG,C2BuKK,gB3BvKL,CAAA,GAAA,KAAA;e2BwKD,QAAQ;QACf,QAAQ;aACH,QAAQ;E1BlLT,GAAA,E0BmLL,O1BnLK,C0BmLG,U1BnLW,CAAA,GAAA,KAAG;EAMhB,IAAA,E0B8KL,M1BtHP,CAAA,MAAA,EAAA,KAxD+B,CAAA,GAAA,KAAA;U0B+KtB,QAAQ;WACP,QAAQ;iBACF,QAAQ;EzBxLR,kBAAA,EyByLK,OzBzLe,CyByLP,gBzBvLhB,CAAA,GAAA,KAAA;EACb,cAAA,EyBuLiB,OzBvLjB,CyBuLyB,qBzBvLzB,CAAA,GAAA,KAAA;EAAA,cAAA,EyBwLiB,OzBxLjB,CyBwLyB,qBzBxLzB,CAAA,GAAA,KAAA;EAAA,UAAA,EyByLa,OzBzLb,CyByLqB,iBzBzLrB,CAAA,GAAA,KAAA;EAIsD,gBAAA,EyBsLnC,OzBtLmC,CyBsL3B,mBzBtL2B,CAAA,GAAA,KAAA;;AAIpC,cyBqLN,UzBrLM,EyBqLI,SzBrLJ,CyBqLI,iBzBrLJ,EAAA,GAAA,CAAA"}
@@ -92,6 +92,12 @@ interface CodeBlockPrismOptions extends CodeBlockOptions {
92
92
  }
93
93
  declare const CodeBlockPrism: EmailNode<CodeBlockPrismOptions, any>;
94
94
  //#endregion
95
+ //#region src/extensions/container.d.ts
96
+ interface ContainerOptions {
97
+ HTMLAttributes: Record<string, unknown>;
98
+ }
99
+ declare const Container: EmailNode<ContainerOptions, Record<string, never>>;
100
+ //#endregion
95
101
  //#region src/extensions/div.d.ts
96
102
  interface DivOptions {
97
103
  HTMLAttributes: Record<string, unknown>;
@@ -235,6 +241,41 @@ interface TableCellOptions extends Record<string, unknown> {
235
241
  declare const TableCell: EmailNode<TableCellOptions, Record<string, never>>;
236
242
  declare const TableHeader: Node<any, any>;
237
243
  //#endregion
244
+ //#region src/extensions/trailing-node.d.ts
245
+ declare const skipTrailingNodeMeta = "skipTrailingNode";
246
+ /**
247
+ * Extension based on:
248
+ * - https://github.com/ueberdosis/tiptap/blob/v1/packages/tiptap-extensions/src/extensions/TrailingNode.js
249
+ * - https://github.com/remirror/remirror/blob/e0f1bec4a1e8073ce8f5500d62193e52321155b9/packages/prosemirror-trailing-node/src/trailing-node-plugin.ts
250
+ */
251
+ interface TrailingNodeOptions {
252
+ /**
253
+ * The node type that should be inserted at the end of the document.
254
+ * @note the node will always be added to the `notAfter` lists to
255
+ * prevent an infinite loop.
256
+ * @default undefined
257
+ */
258
+ node?: string;
259
+ /**
260
+ * The node that the trailing node should be appended to. The default is the 'doc', giving the same behavior as TipTap's extension.
261
+ */
262
+ appendTo?: string;
263
+ /**
264
+ * The node types after which the trailing node should not be inserted.
265
+ * @default ['paragraph']
266
+ */
267
+ notAfter?: string | string[];
268
+ }
269
+ /**
270
+ * This extension allows you to add an extra node at the end of a node.
271
+ *
272
+ * Differently from TipTap's native one, it allows you to pick which node to append the trailing node to.
273
+ * @see https://www.tiptap.dev/api/extensions/trailing-node
274
+ *
275
+ * We could contribute this to TipTap's core extensions and I think we should at some once we get some time.
276
+ */
277
+ declare const TrailingNode: Extension<TrailingNodeOptions, any>;
278
+ //#endregion
238
279
  //#region src/extensions/underline.d.ts
239
280
  type UnderlineOptions = UnderlineOptions$1;
240
281
  declare const Underline: EmailMark<UnderlineOptions$1, any>;
@@ -320,6 +361,7 @@ type StarterKitOptions = {
320
361
  Paragraph: Partial<ParagraphOptions> | false;
321
362
  BulletList: Partial<BulletListOptions> | false;
322
363
  OrderedList: Partial<OrderedListOptions> | false;
364
+ TrailingNode: Partial<TrailingNodeOptions> | false;
323
365
  Blockquote: Partial<BlockquoteOptions> | false;
324
366
  ListItem: Partial<ListItemOptions> | false;
325
367
  HardBreak: Partial<HardBreakOptions> | false;
@@ -340,6 +382,7 @@ type StarterKitOptions = {
340
382
  TableCell: Partial<TableCellOptions> | false;
341
383
  TableHeader: Partial<Record<string, any>> | false;
342
384
  Body: Partial<BodyOptions> | false;
385
+ Container: Partial<ContainerOptions> | false;
343
386
  Div: Partial<DivOptions> | false;
344
387
  Text: Record<string, never> | false;
345
388
  Button: Partial<EditorButtonOptions> | false;
@@ -353,5 +396,5 @@ type StarterKitOptions = {
353
396
  };
354
397
  declare const StarterKit: Extension<StarterKitOptions, any>;
355
398
  //#endregion
356
- export { AlignmentAttribute, AlignmentOptions, Blockquote, Body, BodyOptions, Bold, BoldOptions, BulletList, Button, COLUMN_PARENT_TYPES, ClassAttribute, ClassAttributeOptions, Code, CodeBlockPrism, CodeBlockPrismOptions, ColumnsColumn, Div, DivOptions, Divider, DividerOptions, EditorButtonOptions, FourColumns, GlobalContent, GlobalContentOptions, HardBreak, Heading, HeadingOptions, Italic, Link, LinkOptions, ListItem, MAX_COLUMNS_DEPTH, MaxNesting, MaxNestingOptions, OrderedList, Paragraph, Placeholder, PlaceholderOptions, PreservedStyle, PreviewText, PreviewTextOptions, Section, SectionOptions, StarterKit, StarterKitOptions, Strike, StyleAttribute, StyleAttributeOptions, Sup, SupOptions, Table, TableCell, TableCellOptions, TableHeader, TableOptions, TableRow, TableRowOptions, Text, ThreeColumns, TwoColumns, Underline, UnderlineOptions, Uppercase, UppercaseOptions, getColumnsDepth, getGlobalContent, processStylesForUnlink };
399
+ export { AlignmentAttribute, AlignmentOptions, Blockquote, Body, BodyOptions, Bold, BoldOptions, BulletList, Button, COLUMN_PARENT_TYPES, ClassAttribute, ClassAttributeOptions, Code, CodeBlockPrism, CodeBlockPrismOptions, ColumnsColumn, Container, ContainerOptions, Div, DivOptions, Divider, DividerOptions, EditorButtonOptions, FourColumns, GlobalContent, GlobalContentOptions, HardBreak, Heading, HeadingOptions, Italic, Link, LinkOptions, ListItem, MAX_COLUMNS_DEPTH, MaxNesting, MaxNestingOptions, OrderedList, Paragraph, Placeholder, PlaceholderOptions, PreservedStyle, PreviewText, PreviewTextOptions, Section, SectionOptions, StarterKit, StarterKitOptions, Strike, StyleAttribute, StyleAttributeOptions, Sup, SupOptions, Table, TableCell, TableCellOptions, TableHeader, TableOptions, TableRow, TableRowOptions, Text, ThreeColumns, TrailingNode, TrailingNodeOptions, TwoColumns, Underline, UnderlineOptions, Uppercase, UppercaseOptions, getColumnsDepth, getGlobalContent, processStylesForUnlink, skipTrailingNodeMeta };
357
400
  //# sourceMappingURL=index.d.mts.map