@react-email/editor 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{extension-BbjpP9mF.cjs → extension-CwQDXsq-.cjs} +19 -0
- package/dist/{extension-DlWknmE5.mjs → extension-DmSXZ1OQ.mjs} +20 -1
- package/dist/extension-DmSXZ1OQ.mjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/plugins/index.cjs +1 -1
- package/dist/plugins/index.d.cts +1 -1
- package/dist/plugins/index.d.cts.map +1 -1
- package/dist/plugins/index.d.mts +1 -1
- package/dist/plugins/index.d.mts.map +1 -1
- package/dist/plugins/index.mjs +1 -1
- package/dist/{types-DzPTbbDC.d.cts → types-CPfNU4D9.d.cts} +3 -3
- package/dist/{types-DnOcnDoO.d.mts.map → types-CPfNU4D9.d.cts.map} +1 -1
- package/dist/{types-DnOcnDoO.d.mts → types-DzqGGKXD.d.mts} +3 -3
- package/dist/{types-DzPTbbDC.d.cts.map → types-DzqGGKXD.d.mts.map} +1 -1
- package/dist/ui/index.cjs +1 -1
- package/dist/ui/index.d.cts +1 -1
- package/dist/ui/index.d.mts +1 -1
- package/dist/ui/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/extension-DlWknmE5.mjs.map +0 -1
|
@@ -86,6 +86,7 @@ const PANEL_SECTION_TITLES = {
|
|
|
86
86
|
h1: "Title",
|
|
87
87
|
h2: "Subtitle",
|
|
88
88
|
h3: "Heading",
|
|
89
|
+
paragraph: "Paragraph",
|
|
89
90
|
link: "Link",
|
|
90
91
|
image: "Image",
|
|
91
92
|
button: "Button",
|
|
@@ -284,6 +285,13 @@ const THEME_BASIC = [
|
|
|
284
285
|
classReference: "h3",
|
|
285
286
|
inputs: []
|
|
286
287
|
},
|
|
288
|
+
{
|
|
289
|
+
id: "paragraph",
|
|
290
|
+
title: "Paragraph",
|
|
291
|
+
category: "Text",
|
|
292
|
+
classReference: "paragraph",
|
|
293
|
+
inputs: []
|
|
294
|
+
},
|
|
287
295
|
{
|
|
288
296
|
id: "link",
|
|
289
297
|
title: "Link",
|
|
@@ -626,6 +634,13 @@ const THEME_MINIMAL = [
|
|
|
626
634
|
classReference: "h3",
|
|
627
635
|
inputs: []
|
|
628
636
|
},
|
|
637
|
+
{
|
|
638
|
+
id: "paragraph",
|
|
639
|
+
title: "Paragraph",
|
|
640
|
+
category: "Text",
|
|
641
|
+
classReference: "paragraph",
|
|
642
|
+
inputs: []
|
|
643
|
+
},
|
|
629
644
|
{
|
|
630
645
|
id: "link",
|
|
631
646
|
title: "Link",
|
|
@@ -1085,6 +1100,7 @@ const PANEL_SECTION_IDS = new Set([
|
|
|
1085
1100
|
"body",
|
|
1086
1101
|
"container",
|
|
1087
1102
|
"typography",
|
|
1103
|
+
"paragraph",
|
|
1088
1104
|
"link",
|
|
1089
1105
|
"image",
|
|
1090
1106
|
"button",
|
|
@@ -1097,6 +1113,7 @@ const PANEL_SECTION_IDS_BY_TITLE = {
|
|
|
1097
1113
|
content: "container",
|
|
1098
1114
|
container: "container",
|
|
1099
1115
|
typography: "typography",
|
|
1116
|
+
paragraph: "paragraph",
|
|
1100
1117
|
link: "link",
|
|
1101
1118
|
image: "image",
|
|
1102
1119
|
button: "button",
|
|
@@ -1105,6 +1122,7 @@ const PANEL_SECTION_IDS_BY_TITLE = {
|
|
|
1105
1122
|
};
|
|
1106
1123
|
const PANEL_SECTION_IDS_BY_CLASS_REFERENCE = {
|
|
1107
1124
|
container: "container",
|
|
1125
|
+
paragraph: "paragraph",
|
|
1108
1126
|
link: "link",
|
|
1109
1127
|
image: "image",
|
|
1110
1128
|
button: "button",
|
|
@@ -1178,6 +1196,7 @@ const CLASS_REFERENCE_TO_PANEL_ID = {
|
|
|
1178
1196
|
h1: "h1",
|
|
1179
1197
|
h2: "h2",
|
|
1180
1198
|
h3: "h3",
|
|
1199
|
+
paragraph: "paragraph",
|
|
1181
1200
|
link: "link",
|
|
1182
1201
|
image: "image",
|
|
1183
1202
|
button: "button",
|
|
@@ -85,6 +85,7 @@ const PANEL_SECTION_TITLES = {
|
|
|
85
85
|
h1: "Title",
|
|
86
86
|
h2: "Subtitle",
|
|
87
87
|
h3: "Heading",
|
|
88
|
+
paragraph: "Paragraph",
|
|
88
89
|
link: "Link",
|
|
89
90
|
image: "Image",
|
|
90
91
|
button: "Button",
|
|
@@ -283,6 +284,13 @@ const THEME_BASIC = [
|
|
|
283
284
|
classReference: "h3",
|
|
284
285
|
inputs: []
|
|
285
286
|
},
|
|
287
|
+
{
|
|
288
|
+
id: "paragraph",
|
|
289
|
+
title: "Paragraph",
|
|
290
|
+
category: "Text",
|
|
291
|
+
classReference: "paragraph",
|
|
292
|
+
inputs: []
|
|
293
|
+
},
|
|
286
294
|
{
|
|
287
295
|
id: "link",
|
|
288
296
|
title: "Link",
|
|
@@ -625,6 +633,13 @@ const THEME_MINIMAL = [
|
|
|
625
633
|
classReference: "h3",
|
|
626
634
|
inputs: []
|
|
627
635
|
},
|
|
636
|
+
{
|
|
637
|
+
id: "paragraph",
|
|
638
|
+
title: "Paragraph",
|
|
639
|
+
category: "Text",
|
|
640
|
+
classReference: "paragraph",
|
|
641
|
+
inputs: []
|
|
642
|
+
},
|
|
628
643
|
{
|
|
629
644
|
id: "link",
|
|
630
645
|
title: "Link",
|
|
@@ -1084,6 +1099,7 @@ const PANEL_SECTION_IDS = new Set([
|
|
|
1084
1099
|
"body",
|
|
1085
1100
|
"container",
|
|
1086
1101
|
"typography",
|
|
1102
|
+
"paragraph",
|
|
1087
1103
|
"link",
|
|
1088
1104
|
"image",
|
|
1089
1105
|
"button",
|
|
@@ -1096,6 +1112,7 @@ const PANEL_SECTION_IDS_BY_TITLE = {
|
|
|
1096
1112
|
content: "container",
|
|
1097
1113
|
container: "container",
|
|
1098
1114
|
typography: "typography",
|
|
1115
|
+
paragraph: "paragraph",
|
|
1099
1116
|
link: "link",
|
|
1100
1117
|
image: "image",
|
|
1101
1118
|
button: "button",
|
|
@@ -1104,6 +1121,7 @@ const PANEL_SECTION_IDS_BY_TITLE = {
|
|
|
1104
1121
|
};
|
|
1105
1122
|
const PANEL_SECTION_IDS_BY_CLASS_REFERENCE = {
|
|
1106
1123
|
container: "container",
|
|
1124
|
+
paragraph: "paragraph",
|
|
1107
1125
|
link: "link",
|
|
1108
1126
|
image: "image",
|
|
1109
1127
|
button: "button",
|
|
@@ -1177,6 +1195,7 @@ const CLASS_REFERENCE_TO_PANEL_ID = {
|
|
|
1177
1195
|
h1: "h1",
|
|
1178
1196
|
h2: "h2",
|
|
1179
1197
|
h3: "h3",
|
|
1198
|
+
paragraph: "paragraph",
|
|
1180
1199
|
link: "link",
|
|
1181
1200
|
image: "image",
|
|
1182
1201
|
button: "button",
|
|
@@ -1492,4 +1511,4 @@ const EmailTheming = Extension.create({
|
|
|
1492
1511
|
//#endregion
|
|
1493
1512
|
export { resolveResetValue as S, INBOX_EMAIL_DEFAULTS as _, setCurrentTheme as a, getPanelTitle as b, stylesToCss as c, extendTheme as d, isThemeConfig as f, EDITOR_THEMES as g, DEFAULT_INBOX_FONT_SIZE_PX as h, getThemeComponentKey as i, useEmailTheming as l, themeStylesToPanelOverrides as m, getMergedCssJs as n, setGlobalCssInjected as o, parseCssValue as p, getResolvedNodeStyles as r, setGlobalStyles as s, EmailTheming as t, createTheme as u, RESET_THEMES as v, getThemeBodyFontSizePx as x, SUPPORTED_CSS_PROPERTIES as y };
|
|
1494
1513
|
|
|
1495
|
-
//# sourceMappingURL=extension-
|
|
1514
|
+
//# sourceMappingURL=extension-DmSXZ1OQ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-DmSXZ1OQ.mjs","names":[],"sources":["../src/plugins/email-theming/css-transforms.ts","../src/plugins/email-theming/themes.ts","../src/plugins/email-theming/normalization.ts","../src/plugins/email-theming/theme-config.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 if (val === undefined) {\n return acc;\n }\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 paragraph: 'Paragraph',\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 label: 'Background',\n type: 'color',\n value: '#ffffff',\n prop: 'backgroundColor',\n classReference: 'body',\n },\n {\n label: 'Padding Top',\n type: 'number',\n value: undefined,\n unit: 'px',\n prop: 'paddingTop',\n classReference: 'body',\n },\n {\n label: 'Padding Right',\n type: 'number',\n value: undefined,\n unit: 'px',\n prop: 'paddingRight',\n classReference: 'body',\n },\n {\n label: 'Padding Bottom',\n type: 'number',\n value: undefined,\n unit: 'px',\n prop: 'paddingBottom',\n classReference: 'body',\n },\n {\n label: 'Padding Left',\n type: 'number',\n value: undefined,\n unit: 'px',\n prop: 'paddingLeft',\n classReference: 'body',\n },\n ],\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: 'Height',\n type: 'number',\n unit: 'px',\n prop: 'height',\n classReference: 'container',\n },\n {\n label: 'Text',\n type: 'color',\n value: '#000000',\n prop: 'color',\n classReference: 'container',\n },\n {\n label: 'Background',\n type: 'color',\n value: '#ffffff',\n prop: 'backgroundColor',\n classReference: 'container',\n },\n {\n label: 'Padding Top',\n type: 'number',\n value: 0,\n unit: 'px',\n prop: 'paddingTop',\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 label: 'Padding Bottom',\n type: 'number',\n value: 0,\n unit: 'px',\n prop: 'paddingBottom',\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: 'Corner radius',\n type: 'number',\n value: 0,\n unit: 'px',\n prop: 'borderRadius',\n classReference: 'container',\n },\n {\n label: 'Border color',\n type: 'color',\n value: '#000000',\n prop: 'borderColor',\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: 'paragraph',\n title: 'Paragraph',\n category: 'Text',\n classReference: 'paragraph',\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: PanelGroup[] = [\n {\n id: 'body',\n title: 'Background',\n classReference: 'body',\n inputs: [\n {\n label: 'Background',\n type: 'color',\n value: '#ffffff',\n prop: 'backgroundColor',\n classReference: 'body',\n },\n {\n label: 'Padding Top',\n type: 'number',\n value: undefined,\n unit: 'px',\n prop: 'paddingTop',\n classReference: 'body',\n },\n {\n label: 'Padding Right',\n type: 'number',\n value: undefined,\n unit: 'px',\n prop: 'paddingRight',\n classReference: 'body',\n },\n {\n label: 'Padding Bottom',\n type: 'number',\n value: undefined,\n unit: 'px',\n prop: 'paddingBottom',\n classReference: 'body',\n },\n {\n label: 'Padding Left',\n type: 'number',\n value: undefined,\n unit: 'px',\n prop: 'paddingLeft',\n classReference: 'body',\n },\n ],\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: 'Height',\n type: 'number',\n unit: 'px',\n prop: 'height',\n classReference: 'container',\n },\n {\n label: 'Text',\n type: 'color',\n value: '#000000',\n prop: 'color',\n classReference: 'container',\n },\n {\n label: 'Background',\n type: 'color',\n value: '#ffffff',\n prop: 'backgroundColor',\n classReference: 'container',\n },\n {\n label: 'Padding Top',\n type: 'number',\n value: 0,\n unit: 'px',\n prop: 'paddingTop',\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 label: 'Padding Bottom',\n type: 'number',\n value: 0,\n unit: 'px',\n prop: 'paddingBottom',\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: 'Corner radius',\n type: 'number',\n value: 0,\n unit: 'px',\n prop: 'borderRadius',\n classReference: 'container',\n },\n {\n label: 'Border color',\n type: 'color',\n value: '#000000',\n prop: 'borderColor',\n classReference: 'container',\n },\n ],\n },\n {\n id: 'typography',\n title: 'Text',\n classReference: 'body',\n inputs: [],\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: 'paragraph',\n title: 'Paragraph',\n category: 'Text',\n classReference: 'paragraph',\n inputs: [],\n },\n {\n id: 'link',\n title: 'Link',\n classReference: 'link',\n inputs: [],\n },\n {\n id: 'image',\n title: 'Image',\n classReference: 'image',\n inputs: [],\n },\n {\n id: 'button',\n title: 'Button',\n classReference: 'button',\n inputs: [],\n },\n {\n id: 'code-block',\n title: 'Code Block',\n classReference: 'codeBlock',\n inputs: [],\n },\n {\n id: 'inline-code',\n title: 'Inline Code',\n classReference: 'inlineCode',\n inputs: [],\n },\n];\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 button: RESET_BASIC.button,\n image: RESET_BASIC.image,\n list: RESET_BASIC.list,\n nestedList: RESET_BASIC.nestedList,\n listItem: RESET_BASIC.listItem,\n listParagraph: RESET_BASIC.listParagraph,\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 },\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 'paragraph',\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 paragraph: 'paragraph',\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 paragraph: 'paragraph',\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 { SUPPORTED_CSS_PROPERTIES } from './themes';\nimport type {\n EditorTheme,\n EditorThemeInput,\n KnownCssProperties,\n PanelGroup,\n ThemeableComponent,\n ThemeComponentStyles,\n ThemeConfig,\n} from './types';\n\nconst CLASS_REFERENCE_TO_PANEL_ID: Record<ThemeableComponent, string> = {\n body: 'body',\n container: 'container',\n h1: 'h1',\n h2: 'h2',\n h3: 'h3',\n paragraph: 'paragraph',\n link: 'link',\n image: 'image',\n button: 'button',\n codeBlock: 'code-block',\n inlineCode: 'inline-code',\n};\n\nexport function parseCssValue(value: string | number): {\n value: string | number;\n unit?: 'px' | '%';\n} {\n if (typeof value === 'number') {\n return { value };\n }\n const pxMatch = /^(-?\\d+(?:\\.\\d+)?)px$/.exec(value);\n if (pxMatch) {\n return { value: Number.parseFloat(pxMatch[1]), unit: 'px' };\n }\n const percentMatch = /^(-?\\d+(?:\\.\\d+)?)%$/.exec(value);\n if (percentMatch) {\n return { value: Number.parseFloat(percentMatch[1]), unit: '%' };\n }\n return { value };\n}\n\nexport function isThemeConfig(\n theme: EditorThemeInput | undefined,\n): theme is ThemeConfig {\n return typeof theme === 'object' && theme !== null && 'styles' in theme;\n}\n\nexport function themeStylesToPanelOverrides(\n styles: ThemeComponentStyles,\n basePanels: PanelGroup[],\n): PanelGroup[] {\n const result: PanelGroup[] = basePanels.map((group) => ({\n ...group,\n inputs: group.inputs.map((input) => ({ ...input })),\n }));\n\n for (const [component, cssProps] of Object.entries(styles) as [\n ThemeableComponent,\n React.CSSProperties,\n ][]) {\n if (!cssProps) continue;\n const panelId = CLASS_REFERENCE_TO_PANEL_ID[component];\n\n const group = result.find((g) => g.id === panelId);\n if (!group) continue;\n\n for (const [cssProp, cssValue] of Object.entries(cssProps) as [\n KnownCssProperties,\n string | number,\n ][]) {\n if (cssValue === undefined) continue;\n\n const existingInput = group.inputs.find(\n (i) => i.prop === cssProp && i.classReference === component,\n );\n\n const parsed = parseCssValue(cssValue);\n\n if (existingInput) {\n existingInput.value = parsed.value;\n if (parsed.unit !== undefined) {\n existingInput.unit = parsed.unit;\n }\n } else {\n const propMeta = SUPPORTED_CSS_PROPERTIES[cssProp];\n group.inputs.push({\n label: propMeta?.label ?? cssProp,\n type: propMeta?.type ?? 'text',\n prop: cssProp,\n classReference: component,\n value: parsed.value,\n unit: parsed.unit ?? propMeta?.unit,\n options: propMeta?.options,\n });\n }\n }\n }\n\n return result;\n}\n\nexport function createTheme(styles: ThemeComponentStyles): ThemeConfig {\n return { styles };\n}\n\nexport function extendTheme(\n base: EditorTheme,\n overrides: ThemeComponentStyles,\n): ThemeConfig {\n return { extends: base, styles: overrides };\n}\n","import 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 { Body, Head, Html, Preview } from 'react-email';\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 { isThemeConfig, themeStylesToPanelOverrides } from './theme-config';\nimport {\n DEFAULT_INBOX_FONT_SIZE_PX,\n EDITOR_THEMES,\n RESET_THEMES,\n} from './themes';\nimport type {\n CssJs,\n EditorTheme,\n EditorThemeInput,\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 '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 resolveThemeConfig(config: EditorThemeInput): {\n baseTheme: EditorTheme;\n panels: PanelGroup[] | undefined;\n} {\n if (!isThemeConfig(config)) {\n return { baseTheme: config, panels: undefined };\n }\n const baseTheme: EditorTheme = config.extends ?? 'minimal';\n const basePanels = EDITOR_THEMES[baseTheme];\n const panels = themeStylesToPanelOverrides(config.styles, basePanels);\n return { baseTheme, panels };\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): EditorTheme {\n const extensionOptions = (\n editor.extensionManager.extensions.find(\n (extension) => extension.name === 'theming',\n ) as { options?: { theme?: EditorThemeInput } }\n )?.options?.theme;\n\n if (isThemeConfig(extensionOptions)) {\n return extensionOptions.extends ?? 'minimal';\n }\n\n if (extensionOptions === 'basic' || extensionOptions === 'minimal') {\n return extensionOptions;\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?: EditorThemeInput;\n serializerPlugin: SerializerPlugin;\n}>({\n name: 'theming',\n\n addOptions() {\n return {\n theme: undefined as EditorThemeInput | 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 let seededFromConfig = false;\n\n view.dom.setAttribute(scopeAttribute, scopeId);\n\n const sync = () => {\n if (!seededFromConfig) {\n seededFromConfig = true;\n const extensionTheme = (\n editor.extensionManager.extensions.find(\n (ext) => ext.name === 'theming',\n ) as { options?: { theme?: EditorThemeInput } }\n )?.options?.theme;\n\n if (isThemeConfig(extensionTheme)) {\n const { baseTheme, panels } =\n resolveThemeConfig(extensionTheme);\n if (panels && !getGlobalContent('styles', editor)) {\n editor.commands.setGlobalContent('styles', panels);\n }\n if (!getGlobalContent('theme', editor)) {\n editor.commands.setGlobalContent('theme', baseTheme);\n }\n }\n }\n\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,C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gB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO,KAAA;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO,KAAA;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO,KAAA;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,SAAS;KACP,MAAM;KACN,QAAQ;KACR,OAAO;KACR;IACD,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,MAAM;IACN,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,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;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,gBAAgB;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,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,gBAA8B;CAClC;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,KAAA;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO,KAAA;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO,KAAA;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO,KAAA;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,SAAS;KACP,MAAM;KACN,QAAQ;KACR,OAAO;KACR;IACD,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,MAAM;IACN,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,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;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,gBAAgB;IACjB;GACF;EACF;CACD;EACE,IAAI;EACJ,OAAO;EACP,gBAAgB;EAChB,QAAQ,EAAE;EACX;CACD;EACE,IAAI;EACJ,OAAO;EACP,UAAU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Aa,6BAA6B;AAC1C,MAAa,uBAA4C;CACvD,MAAM;EACJ,OAAO;EACP,YACE;EACF,UAAU;EACX;CACD,WAAW,EACT,OAAO,KACR;CACF;AAED,MAAa,2BAAmD;CAC9D,OAAO;EACL,OAAO;EACP,MAAM;EACN,SAAS;GACP,MAAM;GACN,QAAQ;GACR,OAAO;GACR;EACD,cAAc;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,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BAAqB,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"}
|
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
require("./columns-DqFvXgmK.cjs");
|
|
3
3
|
const require_core = require("./core-D7AzzMLI.cjs");
|
|
4
4
|
const require_extensions = require("./extensions-DCrDvZ42.cjs");
|
|
5
|
-
const require_extension = require("./extension-
|
|
5
|
+
const require_extension = require("./extension-CwQDXsq-.cjs");
|
|
6
6
|
const require_extension$1 = require("./extension-Cs4Yq2gF.cjs");
|
|
7
7
|
const require_root = require("./root-CT5d4CKj.cjs");
|
|
8
8
|
let _tiptap_react = require("@tiptap/react");
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as EditorThemeInput } from "./types-
|
|
1
|
+
import { r as EditorThemeInput } from "./types-CPfNU4D9.cjs";
|
|
2
2
|
import { Content, Editor, Extensions, JSONContent } from "@tiptap/core";
|
|
3
3
|
import * as _$react from "react";
|
|
4
4
|
import { ReactNode } from "react";
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as EditorThemeInput } from "./types-
|
|
1
|
+
import { r as EditorThemeInput } from "./types-DzqGGKXD.mjs";
|
|
2
2
|
import * as _$react from "react";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
import { Content, Editor, Extensions, JSONContent } from "@tiptap/core";
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as composeReactEmail } from "./core-CbSTyrV4.mjs";
|
|
2
2
|
import { t as StarterKit } from "./extensions-CHIQO3d-.mjs";
|
|
3
|
-
import { t as EmailTheming } from "./extension-
|
|
3
|
+
import { t as EmailTheming } from "./extension-DmSXZ1OQ.mjs";
|
|
4
4
|
import { t as createImageExtension } from "./extension-C5qNDPZL.mjs";
|
|
5
5
|
import { t as SlashCommandRoot, x as BubbleMenu } from "./root-uvdshbyT.mjs";
|
|
6
6
|
import { EditorProvider, useCurrentEditor } from "@tiptap/react";
|
package/dist/plugins/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("../columns-DqFvXgmK.cjs");
|
|
3
|
-
const require_extension = require("../extension-
|
|
3
|
+
const require_extension = require("../extension-CwQDXsq-.cjs");
|
|
4
4
|
const require_extension$1 = require("../extension-Cs4Yq2gF.cjs");
|
|
5
5
|
const require_image = require("../image-KwEYzhji.cjs");
|
|
6
6
|
let react = require("react");
|
package/dist/plugins/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as EmailNode } from "../index-CHAPu71g.cjs";
|
|
2
|
-
import { a as KnownThemeComponents, c as PanelSectionId, d as ThemeComponentStyles, f as ThemeConfig, i as KnownCssProperties, l as ResetTheme, n as EditorTheme, o as PanelGroup, p as ThemeableComponent, r as EditorThemeInput, s as PanelInputProperty, t as CssJs, u as SupportedCssProperties } from "../types-
|
|
2
|
+
import { a as KnownThemeComponents, c as PanelSectionId, d as ThemeComponentStyles, f as ThemeConfig, i as KnownCssProperties, l as ResetTheme, n as EditorTheme, o as PanelGroup, p as ThemeableComponent, r as EditorThemeInput, s as PanelInputProperty, t as CssJs, u as SupportedCssProperties } from "../types-CPfNU4D9.cjs";
|
|
3
3
|
import { n as SlashCommandItem } from "../types-hURXpEIO.cjs";
|
|
4
4
|
import { Editor, Extension, JSONContent } from "@tiptap/core";
|
|
5
5
|
import * as React$2 from "react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/core/serializer/serializer-plugin.ts","../../src/plugins/email-theming/extension.tsx","../../src/plugins/email-theming/theme-config.ts","../../src/plugins/email-theming/themes.ts","../../src/plugins/image/types.ts","../../src/plugins/image/slash-command.tsx","../../src/plugins/image/index.ts"],"mappings":";;;;;;;UAEiB,gBAAA;EACf,aAAA,CACE,IAAA,EAAM,WAAA,EACN,KAAA,UACA,MAAA,EAAQ,MAAA,GACP,KAAA,CAAM,aAAA;EACT,YAAA,CAAa,KAAA;IACX,WAAA;IACA,QAAA,EAAU,KAAA,CAAM,SAAA;IAChB,MAAA,EAAQ,MAAA;EAAA,IACN,KAAA,CAAM,SAAA;AAAA;;;;;AAVZ;;iBCkCgB,oBAAA,CACd,QAAA,UACA,KAAA,UACA,KAAA,GAAO,MAAA,oBACN,oBAAA;;;;;iBAmDa,cAAA,CACd,KAAA,EAAO,WAAA,EACP,WAAA,EAAa,UAAA,iBACZ,KAAA;AAAA,iBAoCa,qBAAA,CACd,IAAA,EAAM,WAAA,EACN,KAAA,UACA,WAAA,EAAa,KAAA,GACZ,OAAA,CAAM,aAAA;AAAA,iBAkBO,WAAA,CACd,MAAA,EAAQ,UAAA,IACR,KAAA,EAAO,WAAA,GACN,MAAA,CAAO,oBAAA,EAAsB,OAAA,CAAM,aAAA;AAAA,iBAkCtB,eAAA,CAAgB,MAAA,EAAQ,MAAA;;;;;;;;;iBAoBxB,eAAA,CAAgB,MAAA,EAAQ,MAAA,EAAQ,MAAA,EAAQ,UAAA;;;;;iBAQxC,eAAA,CAAgB,MAAA,EAAQ,MAAA,EAAQ,KAAA,EAAO,WAAA;;;;;iBAQvC,oBAAA,CAAqB,MAAA,EAAQ,MAAA,EAAQ,GAAA;AAAA,cAoCxC,YAAA,EAAY,SAAA;UACf,gBAAA;oBACU,gBAAA;AAAA;;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/core/serializer/serializer-plugin.ts","../../src/plugins/email-theming/extension.tsx","../../src/plugins/email-theming/theme-config.ts","../../src/plugins/email-theming/themes.ts","../../src/plugins/image/types.ts","../../src/plugins/image/slash-command.tsx","../../src/plugins/image/index.ts"],"mappings":";;;;;;;UAEiB,gBAAA;EACf,aAAA,CACE,IAAA,EAAM,WAAA,EACN,KAAA,UACA,MAAA,EAAQ,MAAA,GACP,KAAA,CAAM,aAAA;EACT,YAAA,CAAa,KAAA;IACX,WAAA;IACA,QAAA,EAAU,KAAA,CAAM,SAAA;IAChB,MAAA,EAAQ,MAAA;EAAA,IACN,KAAA,CAAM,SAAA;AAAA;;;;;AAVZ;;iBCkCgB,oBAAA,CACd,QAAA,UACA,KAAA,UACA,KAAA,GAAO,MAAA,oBACN,oBAAA;;;;;iBAmDa,cAAA,CACd,KAAA,EAAO,WAAA,EACP,WAAA,EAAa,UAAA,iBACZ,KAAA;AAAA,iBAoCa,qBAAA,CACd,IAAA,EAAM,WAAA,EACN,KAAA,UACA,WAAA,EAAa,KAAA,GACZ,OAAA,CAAM,aAAA;AAAA,iBAkBO,WAAA,CACd,MAAA,EAAQ,UAAA,IACR,KAAA,EAAO,WAAA,GACN,MAAA,CAAO,oBAAA,EAAsB,OAAA,CAAM,aAAA;AAAA,iBAkCtB,eAAA,CAAgB,MAAA,EAAQ,MAAA;;;;;;;;;iBAoBxB,eAAA,CAAgB,MAAA,EAAQ,MAAA,EAAQ,MAAA,EAAQ,UAAA;;;;;iBAQxC,eAAA,CAAgB,MAAA,EAAQ,MAAA,EAAQ,KAAA,EAAO,WAAA;;;;;iBAQvC,oBAAA,CAAqB,MAAA,EAAQ,MAAA,EAAQ,GAAA;AAAA,cAoCxC,YAAA,EAAY,SAAA;UACf,gBAAA;oBACU,gBAAA;AAAA;;;iBC9OJ,aAAA,CAAc,KAAA;EAC5B,KAAA;EACA,IAAA;AAAA;AAAA,iBAgBc,aAAA,CACd,KAAA,EAAO,gBAAA,eACN,KAAA,IAAS,WAAA;AAAA,iBAII,2BAAA,CACd,MAAA,EAAQ,oBAAA,EACR,UAAA,EAAY,UAAA,KACX,UAAA;AAAA,iBAmDa,WAAA,CAAY,MAAA,EAAQ,oBAAA,GAAuB,WAAA;AAAA,iBAI3C,WAAA,CACd,IAAA,EAAM,WAAA,EACN,SAAA,EAAW,oBAAA,GACV,WAAA;;;;;;;;iBC7Ea,aAAA,CAAc,KAAA,EAAO,UAAA;AAAA,cA4rBxB,YAAA,EAAc,MAAA,CAAO,WAAA,EAAa,UAAA;AAAA,iBAK/B,iBAAA,CACd,KAAA,+BACA,UAAA,cACA,cAAA;AAAA,cAgBW,aAAA,EAAe,MAAA,CAAO,WAAA,EAAa,UAAA;AAAA,iBAKhC,sBAAA,CAAuB,KAAA,EAAO,WAAA;;;;;cAkBjC,0BAAA;AAAA,cACA,oBAAA,EAAsB,OAAA,CAAQ,UAAA;AAAA,cAY9B,wBAAA,EAA0B,sBAAA;;;UCzxBtB,iBAAA;EACf,GAAA;AAAA;AAAA,UAGe,qBAAA;EACf,WAAA,GAAc,IAAA,EAAM,IAAA,KAAS,OAAA,CAAQ,iBAAA;AAAA;;;cCF1B,iBAAA,EAAmB,gBAAA;;;;YCEpB,QAAA;IACR,KAAA;MACE,QAAA,GAAW,KAAA;QACT,GAAA;QACA,GAAA;QACA,KAAA;QACA,MAAA;QACA,SAAA;QACA,IAAA;MAAA,MACI,UAAA;MACN,WAAA,QAAmB,UAAA;IAAA;EAAA;AAAA;AAAA,iBAQT,cAAA,CAAe,OAAA,EAAS,qBAAA,GAAqB,SAAA,CAAA,MAAA,iBAAA,MAAA"}
|
package/dist/plugins/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as EmailNode } from "../index-D4UEWmJX.mjs";
|
|
2
|
-
import { a as KnownThemeComponents, c as PanelSectionId, d as ThemeComponentStyles, f as ThemeConfig, i as KnownCssProperties, l as ResetTheme, n as EditorTheme, o as PanelGroup, p as ThemeableComponent, r as EditorThemeInput, s as PanelInputProperty, t as CssJs, u as SupportedCssProperties } from "../types-
|
|
2
|
+
import { a as KnownThemeComponents, c as PanelSectionId, d as ThemeComponentStyles, f as ThemeConfig, i as KnownCssProperties, l as ResetTheme, n as EditorTheme, o as PanelGroup, p as ThemeableComponent, r as EditorThemeInput, s as PanelInputProperty, t as CssJs, u as SupportedCssProperties } from "../types-DzqGGKXD.mjs";
|
|
3
3
|
import { n as SlashCommandItem } from "../types-BG5XsXt9.mjs";
|
|
4
4
|
import * as React$2 from "react";
|
|
5
5
|
import { Editor, Extension, JSONContent } from "@tiptap/core";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/core/serializer/serializer-plugin.ts","../../src/plugins/email-theming/extension.tsx","../../src/plugins/email-theming/theme-config.ts","../../src/plugins/email-theming/themes.ts","../../src/plugins/image/types.ts","../../src/plugins/image/slash-command.tsx","../../src/plugins/image/index.ts"],"mappings":";;;;;;;UAEiB,gBAAA;EACf,aAAA,CACE,IAAA,EAAM,WAAA,EACN,KAAA,UACA,MAAA,EAAQ,MAAA,GACP,KAAA,CAAM,aAAA;EACT,YAAA,CAAa,KAAA;IACX,WAAA;IACA,QAAA,EAAU,KAAA,CAAM,SAAA;IAChB,MAAA,EAAQ,MAAA;EAAA,IACN,KAAA,CAAM,SAAA;AAAA;;;;;AAVZ;;iBCkCgB,oBAAA,CACd,QAAA,UACA,KAAA,UACA,KAAA,GAAO,MAAA,oBACN,oBAAA;;;;;iBAmDa,cAAA,CACd,KAAA,EAAO,WAAA,EACP,WAAA,EAAa,UAAA,iBACZ,KAAA;AAAA,iBAoCa,qBAAA,CACd,IAAA,EAAM,WAAA,EACN,KAAA,UACA,WAAA,EAAa,KAAA,GACZ,OAAA,CAAM,aAAA;AAAA,iBAkBO,WAAA,CACd,MAAA,EAAQ,UAAA,IACR,KAAA,EAAO,WAAA,GACN,MAAA,CAAO,oBAAA,EAAsB,OAAA,CAAM,aAAA;AAAA,iBAkCtB,eAAA,CAAgB,MAAA,EAAQ,MAAA;;;;;;;;;iBAoBxB,eAAA,CAAgB,MAAA,EAAQ,MAAA,EAAQ,MAAA,EAAQ,UAAA;;;;;iBAQxC,eAAA,CAAgB,MAAA,EAAQ,MAAA,EAAQ,KAAA,EAAO,WAAA;;;;;iBAQvC,oBAAA,CAAqB,MAAA,EAAQ,MAAA,EAAQ,GAAA;AAAA,cAoCxC,YAAA,EAAY,SAAA;UACf,gBAAA;oBACU,gBAAA;AAAA;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/core/serializer/serializer-plugin.ts","../../src/plugins/email-theming/extension.tsx","../../src/plugins/email-theming/theme-config.ts","../../src/plugins/email-theming/themes.ts","../../src/plugins/image/types.ts","../../src/plugins/image/slash-command.tsx","../../src/plugins/image/index.ts"],"mappings":";;;;;;;UAEiB,gBAAA;EACf,aAAA,CACE,IAAA,EAAM,WAAA,EACN,KAAA,UACA,MAAA,EAAQ,MAAA,GACP,KAAA,CAAM,aAAA;EACT,YAAA,CAAa,KAAA;IACX,WAAA;IACA,QAAA,EAAU,KAAA,CAAM,SAAA;IAChB,MAAA,EAAQ,MAAA;EAAA,IACN,KAAA,CAAM,SAAA;AAAA;;;;;AAVZ;;iBCkCgB,oBAAA,CACd,QAAA,UACA,KAAA,UACA,KAAA,GAAO,MAAA,oBACN,oBAAA;;;;;iBAmDa,cAAA,CACd,KAAA,EAAO,WAAA,EACP,WAAA,EAAa,UAAA,iBACZ,KAAA;AAAA,iBAoCa,qBAAA,CACd,IAAA,EAAM,WAAA,EACN,KAAA,UACA,WAAA,EAAa,KAAA,GACZ,OAAA,CAAM,aAAA;AAAA,iBAkBO,WAAA,CACd,MAAA,EAAQ,UAAA,IACR,KAAA,EAAO,WAAA,GACN,MAAA,CAAO,oBAAA,EAAsB,OAAA,CAAM,aAAA;AAAA,iBAkCtB,eAAA,CAAgB,MAAA,EAAQ,MAAA;;;;;;;;;iBAoBxB,eAAA,CAAgB,MAAA,EAAQ,MAAA,EAAQ,MAAA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;EAAA;AAAA;AAAA,iBAQT,cAAA,CAAe,OAAA,EAAS,qBAAA,GAAqB,SAAA,CAAA,MAAA,iBAAA,MAAA"}
|
package/dist/plugins/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as resolveResetValue, _ as INBOX_EMAIL_DEFAULTS, a as setCurrentTheme, b as getPanelTitle, c as stylesToCss, d as extendTheme, f as isThemeConfig, g as EDITOR_THEMES, h as DEFAULT_INBOX_FONT_SIZE_PX, i as getThemeComponentKey, l as useEmailTheming, m as themeStylesToPanelOverrides, n as getMergedCssJs, o as setGlobalCssInjected, p as parseCssValue, r as getResolvedNodeStyles, s as setGlobalStyles, t as EmailTheming, u as createTheme, v as RESET_THEMES, x as getThemeBodyFontSizePx, y as SUPPORTED_CSS_PROPERTIES } from "../extension-
|
|
1
|
+
import { S as resolveResetValue, _ as INBOX_EMAIL_DEFAULTS, a as setCurrentTheme, b as getPanelTitle, c as stylesToCss, d as extendTheme, f as isThemeConfig, g as EDITOR_THEMES, h as DEFAULT_INBOX_FONT_SIZE_PX, i as getThemeComponentKey, l as useEmailTheming, m as themeStylesToPanelOverrides, n as getMergedCssJs, o as setGlobalCssInjected, p as parseCssValue, r as getResolvedNodeStyles, s as setGlobalStyles, t as EmailTheming, u as createTheme, v as RESET_THEMES, x as getThemeBodyFontSizePx, y as SUPPORTED_CSS_PROPERTIES } from "../extension-DmSXZ1OQ.mjs";
|
|
2
2
|
import { t as createImageExtension } from "../extension-C5qNDPZL.mjs";
|
|
3
3
|
import { t as ImageIcon } from "../image-Oc789YjV.mjs";
|
|
4
4
|
import { useMemo, useRef } from "react";
|
|
@@ -5,7 +5,7 @@ type InputType = 'color' | 'number' | 'select' | 'text' | 'textarea';
|
|
|
5
5
|
type InputUnit = 'px' | '%';
|
|
6
6
|
type Options = Record<string, string>;
|
|
7
7
|
type EditorTheme = 'basic' | 'minimal';
|
|
8
|
-
type PanelSectionId = 'body' | 'container' | 'typography' | 'h1' | 'h2' | 'h3' | 'link' | 'image' | 'button' | 'code-block' | 'inline-code';
|
|
8
|
+
type PanelSectionId = 'body' | 'container' | 'typography' | 'h1' | 'h2' | 'h3' | 'paragraph' | 'link' | 'image' | 'button' | 'code-block' | 'inline-code';
|
|
9
9
|
type KnownThemeComponents = 'reset' | 'body' | 'container' | 'h1' | 'h2' | 'h3' | 'paragraph' | 'nestedList' | 'list' | 'listItem' | 'listParagraph' | 'blockquote' | 'codeBlock' | 'inlineCode' | 'codeTag' | 'link' | 'footer' | 'hr' | 'image' | 'button' | 'section';
|
|
10
10
|
type KnownCssProperties = 'align' | 'backgroundColor' | 'color' | 'fontSize' | 'fontWeight' | 'letterSpacing' | 'lineHeight' | 'textDecoration' | 'borderRadius' | 'borderTopLeftRadius' | 'borderTopRightRadius' | 'borderBottomLeftRadius' | 'borderBottomRightRadius' | 'borderWidth' | 'borderTopWidth' | 'borderRightWidth' | 'borderBottomWidth' | 'borderLeftWidth' | 'borderStyle' | 'borderTopStyle' | 'borderRightStyle' | 'borderBottomStyle' | 'borderLeftStyle' | 'borderColor' | 'borderTopColor' | 'borderRightColor' | 'borderBottomColor' | 'borderLeftColor' | 'padding' | 'paddingTop' | 'paddingRight' | 'paddingBottom' | 'paddingLeft' | 'width' | 'height';
|
|
11
11
|
type ResetTheme = Record<KnownThemeComponents, React$1.CSSProperties>;
|
|
@@ -42,7 +42,7 @@ interface PanelGroup {
|
|
|
42
42
|
classReference?: KnownThemeComponents;
|
|
43
43
|
inputs: Omit<PanelInputProperty, 'category'>[];
|
|
44
44
|
}
|
|
45
|
-
type ThemeableComponent = Extract<KnownThemeComponents, 'body' | 'container' | 'h1' | 'h2' | 'h3' | 'link' | 'image' | 'button' | 'codeBlock' | 'inlineCode'>;
|
|
45
|
+
type ThemeableComponent = Extract<KnownThemeComponents, 'body' | 'container' | 'h1' | 'h2' | 'h3' | 'link' | 'image' | 'button' | 'codeBlock' | 'inlineCode' | 'paragraph'>;
|
|
46
46
|
type ThemeComponentStyles = { [K in ThemeableComponent]?: React$1.CSSProperties & {
|
|
47
47
|
align?: 'center' | 'left' | 'right';
|
|
48
48
|
} };
|
|
@@ -53,4 +53,4 @@ interface ThemeConfig {
|
|
|
53
53
|
type EditorThemeInput = EditorTheme | ThemeConfig;
|
|
54
54
|
//#endregion
|
|
55
55
|
export { KnownThemeComponents as a, PanelSectionId as c, ThemeComponentStyles as d, ThemeConfig as f, KnownCssProperties as i, ResetTheme as l, EditorTheme as n, PanelGroup as o, ThemeableComponent as p, EditorThemeInput as r, PanelInputProperty as s, CssJs as t, SupportedCssProperties as u };
|
|
56
|
-
//# sourceMappingURL=types-
|
|
56
|
+
//# sourceMappingURL=types-CPfNU4D9.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
1
|
+
{"version":3,"file":"types-CPfNU4D9.d.cts","names":[],"sources":["../src/plugins/email-theming/types.ts"],"mappings":";;;KAEK,SAAA;AAAA,KACA,SAAA;AAAA,KACA,OAAA,GAAU,MAAA;AAAA,KAEH,WAAA;AAAA,KACA,cAAA;AAAA,KAaA,oBAAA;AAAA,KAuBA,kBAAA;AAAA,KAqCA,UAAA,GAAa,MAAA,CAAO,oBAAA,EAAsB,OAAA,CAAM,aAAA;AAAA,KAEhD,KAAA,WACJ,oBAAA,GAAuB,OAAA,CAAM,aAAA;EAEjC,KAAA;AAAA;AAAA,KAGQ,sBAAA,WACJ,kBAAA;EACJ,QAAA;EACA,KAAA;EACA,IAAA,EAAM,SAAA;EACN,YAAA;EACA,IAAA,GAAO,SAAA;EACP,OAAA,GAAU,OAAA;EACV,YAAA;EACA,WAAA;EACA,YAAA,IACE,KAAA,EAAO,MAAA,mBACP,MAAA,GAAS,IAAA,GAAO,IAAA,EAAM,UAAA,OAAiB,UAAA;AAAA;AAAA,UAK5B,kBAAA;EACf,KAAA;EACA,IAAA,EAAM,SAAA;EACN,KAAA;EACA,IAAA,EAAM,kBAAA;EACN,cAAA,GAAiB,oBAAA;EACjB,IAAA,GAAO,SAAA;EACP,OAAA,GAAU,OAAA;EACV,WAAA;EACA,QAAA,EAAU,sBAAA,CAAuB,kBAAA;AAAA;AAAA,UAGlB,UAAA;EACf,EAAA,GAAK,cAAA;EACL,KAAA;EACA,QAAA;EACA,UAAA,GAAa,OAAA,CAAM,SAAA;EACnB,cAAA,GAAiB,oBAAA;EACjB,MAAA,EAAQ,IAAA,CAAK,kBAAA;AAAA;AAAA,KAGH,kBAAA,GAAqB,OAAA,CAC/B,oBAAA;AAAA,KAcU,oBAAA,WACJ,kBAAA,IAAsB,OAAA,CAAM,aAAA;EAChC,KAAA;AAAA;AAAA,UAIa,WAAA;EACf,OAAA,GAAU,WAAA;EACV,MAAA,EAAQ,oBAAA;AAAA;AAAA,KAGE,gBAAA,GAAmB,WAAA,GAAc,WAAA"}
|
|
@@ -5,7 +5,7 @@ type InputType = 'color' | 'number' | 'select' | 'text' | 'textarea';
|
|
|
5
5
|
type InputUnit = 'px' | '%';
|
|
6
6
|
type Options = Record<string, string>;
|
|
7
7
|
type EditorTheme = 'basic' | 'minimal';
|
|
8
|
-
type PanelSectionId = 'body' | 'container' | 'typography' | 'h1' | 'h2' | 'h3' | 'link' | 'image' | 'button' | 'code-block' | 'inline-code';
|
|
8
|
+
type PanelSectionId = 'body' | 'container' | 'typography' | 'h1' | 'h2' | 'h3' | 'paragraph' | 'link' | 'image' | 'button' | 'code-block' | 'inline-code';
|
|
9
9
|
type KnownThemeComponents = 'reset' | 'body' | 'container' | 'h1' | 'h2' | 'h3' | 'paragraph' | 'nestedList' | 'list' | 'listItem' | 'listParagraph' | 'blockquote' | 'codeBlock' | 'inlineCode' | 'codeTag' | 'link' | 'footer' | 'hr' | 'image' | 'button' | 'section';
|
|
10
10
|
type KnownCssProperties = 'align' | 'backgroundColor' | 'color' | 'fontSize' | 'fontWeight' | 'letterSpacing' | 'lineHeight' | 'textDecoration' | 'borderRadius' | 'borderTopLeftRadius' | 'borderTopRightRadius' | 'borderBottomLeftRadius' | 'borderBottomRightRadius' | 'borderWidth' | 'borderTopWidth' | 'borderRightWidth' | 'borderBottomWidth' | 'borderLeftWidth' | 'borderStyle' | 'borderTopStyle' | 'borderRightStyle' | 'borderBottomStyle' | 'borderLeftStyle' | 'borderColor' | 'borderTopColor' | 'borderRightColor' | 'borderBottomColor' | 'borderLeftColor' | 'padding' | 'paddingTop' | 'paddingRight' | 'paddingBottom' | 'paddingLeft' | 'width' | 'height';
|
|
11
11
|
type ResetTheme = Record<KnownThemeComponents, React$1.CSSProperties>;
|
|
@@ -42,7 +42,7 @@ interface PanelGroup {
|
|
|
42
42
|
classReference?: KnownThemeComponents;
|
|
43
43
|
inputs: Omit<PanelInputProperty, 'category'>[];
|
|
44
44
|
}
|
|
45
|
-
type ThemeableComponent = Extract<KnownThemeComponents, 'body' | 'container' | 'h1' | 'h2' | 'h3' | 'link' | 'image' | 'button' | 'codeBlock' | 'inlineCode'>;
|
|
45
|
+
type ThemeableComponent = Extract<KnownThemeComponents, 'body' | 'container' | 'h1' | 'h2' | 'h3' | 'link' | 'image' | 'button' | 'codeBlock' | 'inlineCode' | 'paragraph'>;
|
|
46
46
|
type ThemeComponentStyles = { [K in ThemeableComponent]?: React$1.CSSProperties & {
|
|
47
47
|
align?: 'center' | 'left' | 'right';
|
|
48
48
|
} };
|
|
@@ -53,4 +53,4 @@ interface ThemeConfig {
|
|
|
53
53
|
type EditorThemeInput = EditorTheme | ThemeConfig;
|
|
54
54
|
//#endregion
|
|
55
55
|
export { KnownThemeComponents as a, PanelSectionId as c, ThemeComponentStyles as d, ThemeConfig as f, KnownCssProperties as i, ResetTheme as l, EditorTheme as n, PanelGroup as o, ThemeableComponent as p, EditorThemeInput as r, PanelInputProperty as s, CssJs as t, SupportedCssProperties as u };
|
|
56
|
-
//# sourceMappingURL=types-
|
|
56
|
+
//# sourceMappingURL=types-DzqGGKXD.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
1
|
+
{"version":3,"file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package/dist/ui/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_columns = require("../columns-DqFvXgmK.cjs");
|
|
3
3
|
const require_email_node = require("../email-node-hLU5bGnX.cjs");
|
|
4
|
-
const require_extension = require("../extension-
|
|
4
|
+
const require_extension = require("../extension-CwQDXsq-.cjs");
|
|
5
5
|
const require_root = require("../root-CT5d4CKj.cjs");
|
|
6
6
|
const require_image = require("../image-KwEYzhji.cjs");
|
|
7
7
|
let _tiptap_react = require("@tiptap/react");
|
package/dist/ui/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as KnownThemeComponents, i as KnownCssProperties, o as PanelGroup } from "../types-
|
|
1
|
+
import { a as KnownThemeComponents, i as KnownCssProperties, o as PanelGroup } from "../types-CPfNU4D9.cjs";
|
|
2
2
|
import { a as SlashCommandRootProps, i as SlashCommandRenderProps, n as SlashCommandItem, r as SlashCommandProps, t as SearchableItem } from "../types-hURXpEIO.cjs";
|
|
3
3
|
import { Attrs } from "@tiptap/pm/model";
|
|
4
4
|
import { Editor } from "@tiptap/core";
|
package/dist/ui/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as KnownThemeComponents, i as KnownCssProperties, o as PanelGroup } from "../types-
|
|
1
|
+
import { a as KnownThemeComponents, i as KnownCssProperties, o as PanelGroup } from "../types-DzqGGKXD.mjs";
|
|
2
2
|
import { a as SlashCommandRootProps, i as SlashCommandRenderProps, n as SlashCommandItem, r as SlashCommandProps, t as SearchableItem } from "../types-BG5XsXt9.mjs";
|
|
3
3
|
import { useCurrentEditor } from "@tiptap/react";
|
|
4
4
|
import * as React$2 from "react";
|
package/dist/ui/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as jsToInlineCss, i as inlineCssToJs, n as ensureBorderStyleFallback, r as expandShorthandProperties } from "../email-node-B-_g4X-S.mjs";
|
|
2
2
|
import { l as loadPrismTheme } from "../columns-BItFgD76.mjs";
|
|
3
|
-
import { c as stylesToCss, g as EDITOR_THEMES, i as getThemeComponentKey, l as useEmailTheming, s as setGlobalStyles, y as SUPPORTED_CSS_PROPERTIES } from "../extension-
|
|
3
|
+
import { c as stylesToCss, g as EDITOR_THEMES, i as getThemeComponentKey, l as useEmailTheming, s as setGlobalStyles, y as SUPPORTED_CSS_PROPERTIES } from "../extension-DmSXZ1OQ.mjs";
|
|
4
4
|
import { $ as BubbleMenuAlignCenter, A as BubbleMenuImageToolbar, At as AlignCenterIcon, B as NodeSelectorRoot, C as BubbleMenuLinkDefault, Ct as CodeIcon, D as BubbleMenuLinkForm, Dt as BoldIcon, E as BubbleMenuLinkOpenLink, Et as CaseUpperIcon, F as BubbleMenuUnderline, G as BubbleMenuCode, H as BubbleMenuLinkSelector, I as bubbleMenuTriggers, J as BubbleMenuButtonForm, K as BubbleMenuButtonUnlink, L as BubbleMenuStrike, M as BubbleMenuButtonDefault, N as RootWithDefault, O as BubbleMenuLinkEditLink, Ot as AlignRightIcon, P as BubbleMenuUppercase, Q as BubbleMenuAlignLeft, R as BubbleMenuNodeSelector, S as BubbleMenuSeparator, St as Columns2Icon, T as BubbleMenuLinkToolbar, Tt as CheckIcon, U as BubbleMenuItalic, V as NodeSelectorTrigger, W as BubbleMenuItemGroup, X as BubbleMenuBold, Y as BubbleMenuButtonEditLink, Z as BubbleMenuAlignRight, _ as TWO_COLUMNS, _t as Heading2Icon, a as BUTTON, at as TextIcon, b as isInsideNode, bt as Columns4Icon, c as FOUR_COLUMNS, ct as SplitSquareVerticalIcon, d as H3, dt as MousePointerIcon, et as BubbleMenuItem, f as NUMBERED_LIST, ft as ListOrderedIcon, g as THREE_COLUMNS, gt as Heading3Icon, h as TEXT, ht as ItalicIcon, i as BULLET_LIST, it as TextQuoteIcon, j as BubbleMenuImageEditLink, k as BubbleMenuImageDefault, kt as AlignLeftIcon, l as H1, lt as Rows2Icon, m as SECTION, mt as LinkIcon, n as filterAndRankItems, nt as UnlinkIcon, o as CODE, ot as StrikethroughIcon, p as QUOTE, pt as ListIcon, q as BubbleMenuButtonToolbar, r as scoreItem, rt as UnderlineIcon, s as DIVIDER, st as SquareCodeIcon, t as SlashCommandRoot, tt as useBubbleMenuContext, u as H2, ut as PencilIcon, v as defaultSlashCommands, vt as Heading1Icon, w as BubbleMenuLinkUnlink, wt as ChevronDownIcon, x as BubbleMenu, xt as Columns3Icon, y as isAtMaxColumnsDepth, yt as ExternalLinkIcon, z as NodeSelectorContent } from "../root-uvdshbyT.mjs";
|
|
5
5
|
import { t as ImageIcon } from "../image-Oc789YjV.mjs";
|
|
6
6
|
import { extensions, useCurrentEditor, useEditorState } from "@tiptap/react";
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extension-DlWknmE5.mjs","names":[],"sources":["../src/plugins/email-theming/css-transforms.ts","../src/plugins/email-theming/themes.ts","../src/plugins/email-theming/normalization.ts","../src/plugins/email-theming/theme-config.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 if (val === undefined) {\n return acc;\n }\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 label: 'Background',\n type: 'color',\n value: '#ffffff',\n prop: 'backgroundColor',\n classReference: 'body',\n },\n {\n label: 'Padding Top',\n type: 'number',\n value: undefined,\n unit: 'px',\n prop: 'paddingTop',\n classReference: 'body',\n },\n {\n label: 'Padding Right',\n type: 'number',\n value: undefined,\n unit: 'px',\n prop: 'paddingRight',\n classReference: 'body',\n },\n {\n label: 'Padding Bottom',\n type: 'number',\n value: undefined,\n unit: 'px',\n prop: 'paddingBottom',\n classReference: 'body',\n },\n {\n label: 'Padding Left',\n type: 'number',\n value: undefined,\n unit: 'px',\n prop: 'paddingLeft',\n classReference: 'body',\n },\n ],\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: 'Height',\n type: 'number',\n unit: 'px',\n prop: 'height',\n classReference: 'container',\n },\n {\n label: 'Text',\n type: 'color',\n value: '#000000',\n prop: 'color',\n classReference: 'container',\n },\n {\n label: 'Background',\n type: 'color',\n value: '#ffffff',\n prop: 'backgroundColor',\n classReference: 'container',\n },\n {\n label: 'Padding Top',\n type: 'number',\n value: 0,\n unit: 'px',\n prop: 'paddingTop',\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 label: 'Padding Bottom',\n type: 'number',\n value: 0,\n unit: 'px',\n prop: 'paddingBottom',\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: 'Corner radius',\n type: 'number',\n value: 0,\n unit: 'px',\n prop: 'borderRadius',\n classReference: 'container',\n },\n {\n label: 'Border color',\n type: 'color',\n value: '#000000',\n prop: 'borderColor',\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: PanelGroup[] = [\n {\n id: 'body',\n title: 'Background',\n classReference: 'body',\n inputs: [\n {\n label: 'Background',\n type: 'color',\n value: '#ffffff',\n prop: 'backgroundColor',\n classReference: 'body',\n },\n {\n label: 'Padding Top',\n type: 'number',\n value: undefined,\n unit: 'px',\n prop: 'paddingTop',\n classReference: 'body',\n },\n {\n label: 'Padding Right',\n type: 'number',\n value: undefined,\n unit: 'px',\n prop: 'paddingRight',\n classReference: 'body',\n },\n {\n label: 'Padding Bottom',\n type: 'number',\n value: undefined,\n unit: 'px',\n prop: 'paddingBottom',\n classReference: 'body',\n },\n {\n label: 'Padding Left',\n type: 'number',\n value: undefined,\n unit: 'px',\n prop: 'paddingLeft',\n classReference: 'body',\n },\n ],\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: 'Height',\n type: 'number',\n unit: 'px',\n prop: 'height',\n classReference: 'container',\n },\n {\n label: 'Text',\n type: 'color',\n value: '#000000',\n prop: 'color',\n classReference: 'container',\n },\n {\n label: 'Background',\n type: 'color',\n value: '#ffffff',\n prop: 'backgroundColor',\n classReference: 'container',\n },\n {\n label: 'Padding Top',\n type: 'number',\n value: 0,\n unit: 'px',\n prop: 'paddingTop',\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 label: 'Padding Bottom',\n type: 'number',\n value: 0,\n unit: 'px',\n prop: 'paddingBottom',\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: 'Corner radius',\n type: 'number',\n value: 0,\n unit: 'px',\n prop: 'borderRadius',\n classReference: 'container',\n },\n {\n label: 'Border color',\n type: 'color',\n value: '#000000',\n prop: 'borderColor',\n classReference: 'container',\n },\n ],\n },\n {\n id: 'typography',\n title: 'Text',\n classReference: 'body',\n inputs: [],\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 {\n id: 'image',\n title: 'Image',\n classReference: 'image',\n inputs: [],\n },\n {\n id: 'button',\n title: 'Button',\n classReference: 'button',\n inputs: [],\n },\n {\n id: 'code-block',\n title: 'Code Block',\n classReference: 'codeBlock',\n inputs: [],\n },\n {\n id: 'inline-code',\n title: 'Inline Code',\n classReference: 'inlineCode',\n inputs: [],\n },\n];\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 button: RESET_BASIC.button,\n image: RESET_BASIC.image,\n list: RESET_BASIC.list,\n nestedList: RESET_BASIC.nestedList,\n listItem: RESET_BASIC.listItem,\n listParagraph: RESET_BASIC.listParagraph,\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 },\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 { SUPPORTED_CSS_PROPERTIES } from './themes';\nimport type {\n EditorTheme,\n EditorThemeInput,\n KnownCssProperties,\n PanelGroup,\n ThemeableComponent,\n ThemeComponentStyles,\n ThemeConfig,\n} from './types';\n\nconst CLASS_REFERENCE_TO_PANEL_ID: Record<ThemeableComponent, string> = {\n body: 'body',\n container: 'container',\n h1: 'h1',\n h2: 'h2',\n h3: 'h3',\n link: 'link',\n image: 'image',\n button: 'button',\n codeBlock: 'code-block',\n inlineCode: 'inline-code',\n};\n\nexport function parseCssValue(value: string | number): {\n value: string | number;\n unit?: 'px' | '%';\n} {\n if (typeof value === 'number') {\n return { value };\n }\n const pxMatch = /^(-?\\d+(?:\\.\\d+)?)px$/.exec(value);\n if (pxMatch) {\n return { value: Number.parseFloat(pxMatch[1]), unit: 'px' };\n }\n const percentMatch = /^(-?\\d+(?:\\.\\d+)?)%$/.exec(value);\n if (percentMatch) {\n return { value: Number.parseFloat(percentMatch[1]), unit: '%' };\n }\n return { value };\n}\n\nexport function isThemeConfig(\n theme: EditorThemeInput | undefined,\n): theme is ThemeConfig {\n return typeof theme === 'object' && theme !== null && 'styles' in theme;\n}\n\nexport function themeStylesToPanelOverrides(\n styles: ThemeComponentStyles,\n basePanels: PanelGroup[],\n): PanelGroup[] {\n const result: PanelGroup[] = basePanels.map((group) => ({\n ...group,\n inputs: group.inputs.map((input) => ({ ...input })),\n }));\n\n for (const [component, cssProps] of Object.entries(styles) as [\n ThemeableComponent,\n React.CSSProperties,\n ][]) {\n if (!cssProps) continue;\n const panelId = CLASS_REFERENCE_TO_PANEL_ID[component];\n\n const group = result.find((g) => g.id === panelId);\n if (!group) continue;\n\n for (const [cssProp, cssValue] of Object.entries(cssProps) as [\n KnownCssProperties,\n string | number,\n ][]) {\n if (cssValue === undefined) continue;\n\n const existingInput = group.inputs.find(\n (i) => i.prop === cssProp && i.classReference === component,\n );\n\n const parsed = parseCssValue(cssValue);\n\n if (existingInput) {\n existingInput.value = parsed.value;\n if (parsed.unit !== undefined) {\n existingInput.unit = parsed.unit;\n }\n } else {\n const propMeta = SUPPORTED_CSS_PROPERTIES[cssProp];\n group.inputs.push({\n label: propMeta?.label ?? cssProp,\n type: propMeta?.type ?? 'text',\n prop: cssProp,\n classReference: component,\n value: parsed.value,\n unit: parsed.unit ?? propMeta?.unit,\n options: propMeta?.options,\n });\n }\n }\n }\n\n return result;\n}\n\nexport function createTheme(styles: ThemeComponentStyles): ThemeConfig {\n return { styles };\n}\n\nexport function extendTheme(\n base: EditorTheme,\n overrides: ThemeComponentStyles,\n): ThemeConfig {\n return { extends: base, styles: overrides };\n}\n","import 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 { Body, Head, Html, Preview } from 'react-email';\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 { isThemeConfig, themeStylesToPanelOverrides } from './theme-config';\nimport {\n DEFAULT_INBOX_FONT_SIZE_PX,\n EDITOR_THEMES,\n RESET_THEMES,\n} from './themes';\nimport type {\n CssJs,\n EditorTheme,\n EditorThemeInput,\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 '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 resolveThemeConfig(config: EditorThemeInput): {\n baseTheme: EditorTheme;\n panels: PanelGroup[] | undefined;\n} {\n if (!isThemeConfig(config)) {\n return { baseTheme: config, panels: undefined };\n }\n const baseTheme: EditorTheme = config.extends ?? 'minimal';\n const basePanels = EDITOR_THEMES[baseTheme];\n const panels = themeStylesToPanelOverrides(config.styles, basePanels);\n return { baseTheme, panels };\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): EditorTheme {\n const extensionOptions = (\n editor.extensionManager.extensions.find(\n (extension) => extension.name === 'theming',\n ) as { options?: { theme?: EditorThemeInput } }\n )?.options?.theme;\n\n if (isThemeConfig(extensionOptions)) {\n return extensionOptions.extends ?? 'minimal';\n }\n\n if (extensionOptions === 'basic' || extensionOptions === 'minimal') {\n return extensionOptions;\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?: EditorThemeInput;\n serializerPlugin: SerializerPlugin;\n}>({\n name: 'theming',\n\n addOptions() {\n return {\n theme: undefined as EditorThemeInput | 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 let seededFromConfig = false;\n\n view.dom.setAttribute(scopeAttribute, scopeId);\n\n const sync = () => {\n if (!seededFromConfig) {\n seededFromConfig = true;\n const extensionTheme = (\n editor.extensionManager.extensions.find(\n (ext) => ext.name === 'theming',\n ) as { options?: { theme?: EditorThemeInput } }\n )?.options?.theme;\n\n if (isThemeConfig(extensionTheme)) {\n const { baseTheme, panels } =\n resolveThemeConfig(extensionTheme);\n if (panels && !getGlobalContent('styles', editor)) {\n editor.commands.setGlobalContent('styles', panels);\n }\n if (!getGlobalContent('theme', editor)) {\n editor.commands.setGlobalContent('theme', baseTheme);\n }\n }\n }\n\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,M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ACN,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,gBAAgB;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,gBAA8B;CAClC;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,KAAA;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO,KAAA;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO,KAAA;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO,KAAA;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,SAAS;KACP,MAAM;KACN,QAAQ;KACR,OAAO;KACR;IACD,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,gBAAgB;IACjB;GACD;IACE,OAAO;IACP,MAAM;IACN,MAAM;IACN,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,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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ACjB;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;;;ACxhCD,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;CACR,WAAW;CACX,YAAY;CACb;AAED,SAAS,iBAAiB,OAAyC;A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