react-email-studio 3.3.1 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/index.cjs +4 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +55 -53
- package/dist/index.d.ts +55 -53
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -96,59 +96,6 @@ type EmailHtmlOptions = {
|
|
|
96
96
|
customCSS?: string;
|
|
97
97
|
};
|
|
98
98
|
|
|
99
|
-
/** Theme color tokens (subset used by the editor chrome). */
|
|
100
|
-
type ThemeColors = (typeof THEMES)["light"];
|
|
101
|
-
/** Known `options` keys for {@link ReactEmailEditor} — callers may pass extra keys; these are what the editor reads. */
|
|
102
|
-
type ReactEmailEditorOptions = EmailHtmlOptions & {
|
|
103
|
-
appearance?: {
|
|
104
|
-
theme?: string;
|
|
105
|
-
/** Shallow merge over the active theme (e.g. accent border). */
|
|
106
|
-
colors?: Partial<ThemeColors>;
|
|
107
|
-
/** Extra named palettes; keys appear in Settings → Color scheme. */
|
|
108
|
-
customThemes?: Record<string, ThemeColors>;
|
|
109
|
-
};
|
|
110
|
-
locale?: string;
|
|
111
|
-
features?: {
|
|
112
|
-
autoSave?: {
|
|
113
|
-
enabled?: boolean;
|
|
114
|
-
interval?: number;
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
tools?: Record<string, {
|
|
118
|
-
enabled?: boolean;
|
|
119
|
-
}>;
|
|
120
|
-
/** Optional labels for block-library sections (row layouts + content blocks). */
|
|
121
|
-
blockLibrary?: {
|
|
122
|
-
groupHeadings?: {
|
|
123
|
-
blocks?: string;
|
|
124
|
-
};
|
|
125
|
-
/** Override default palette group titles (keys: text, structure, media, actions, widgets). */
|
|
126
|
-
paletteGroupLabels?: Partial<Record<BlockPaletteGroupKey, string>>;
|
|
127
|
-
};
|
|
128
|
-
};
|
|
129
|
-
interface ReactEmailEditorRef {
|
|
130
|
-
loadJson(input: string | Record<string, unknown>): void;
|
|
131
|
-
/** Calls `cb` with the design as a JSON string (new `email_document` schema). */
|
|
132
|
-
exportJson(cb: (json: string) => void, pretty?: boolean): void;
|
|
133
|
-
}
|
|
134
|
-
type ReactEmailEditorProps = {
|
|
135
|
-
minHeight?: string;
|
|
136
|
-
editorId?: string;
|
|
137
|
-
options?: ReactEmailEditorOptions;
|
|
138
|
-
style?: CSSProperties;
|
|
139
|
-
onLoad?: (api: ReactEmailEditorRef) => void;
|
|
140
|
-
onReady?: (api: ReactEmailEditorRef) => void;
|
|
141
|
-
onUpload?: (file: File) => Promise<string>;
|
|
142
|
-
templates?: {
|
|
143
|
-
name: string;
|
|
144
|
-
design: unknown;
|
|
145
|
-
thumbnail?: string;
|
|
146
|
-
}[];
|
|
147
|
-
hideTemplates?: boolean;
|
|
148
|
-
children?: ReactNode;
|
|
149
|
-
};
|
|
150
|
-
declare const ReactEmailEditor: react.ForwardRefExoticComponent<ReactEmailEditorProps & react.RefAttributes<ReactEmailEditorRef>>;
|
|
151
|
-
|
|
152
99
|
type Padding = {
|
|
153
100
|
top?: number;
|
|
154
101
|
right?: number;
|
|
@@ -286,6 +233,61 @@ type JsonToHtmlOptions = EmailHtmlOptions;
|
|
|
286
233
|
*/
|
|
287
234
|
declare function jsonToHtml(designInput: unknown, opts?: JsonToHtmlOptions): string;
|
|
288
235
|
|
|
236
|
+
/** Theme color tokens (subset used by the editor chrome). */
|
|
237
|
+
type ThemeColors = (typeof THEMES)["light"];
|
|
238
|
+
/** Known `options` keys for {@link ReactEmailEditor} — callers may pass extra keys; these are what the editor reads. */
|
|
239
|
+
type ReactEmailEditorOptions = EmailHtmlOptions & {
|
|
240
|
+
appearance?: {
|
|
241
|
+
theme?: string;
|
|
242
|
+
/** Shallow merge over the active theme (e.g. accent border). */
|
|
243
|
+
colors?: Partial<ThemeColors>;
|
|
244
|
+
/** Extra named palettes; keys appear in Settings → Color scheme. */
|
|
245
|
+
customThemes?: Record<string, ThemeColors>;
|
|
246
|
+
};
|
|
247
|
+
locale?: string;
|
|
248
|
+
features?: {
|
|
249
|
+
autoSave?: {
|
|
250
|
+
enabled?: boolean;
|
|
251
|
+
interval?: number;
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
tools?: Record<string, {
|
|
255
|
+
enabled?: boolean;
|
|
256
|
+
}>;
|
|
257
|
+
/** Optional labels for block-library sections (row layouts + content blocks). */
|
|
258
|
+
blockLibrary?: {
|
|
259
|
+
groupHeadings?: {
|
|
260
|
+
blocks?: string;
|
|
261
|
+
};
|
|
262
|
+
/** Override default palette group titles (keys: text, structure, media, actions, widgets). */
|
|
263
|
+
paletteGroupLabels?: Partial<Record<BlockPaletteGroupKey, string>>;
|
|
264
|
+
};
|
|
265
|
+
};
|
|
266
|
+
interface ReactEmailEditorRef {
|
|
267
|
+
loadJson(input: string | Record<string, unknown>): void;
|
|
268
|
+
/** Calls `cb` with the design as a JSON string (new `email_document` schema). */
|
|
269
|
+
exportJson(cb: (json: string) => void, pretty?: boolean): void;
|
|
270
|
+
}
|
|
271
|
+
type ReactEmailEditorProps = {
|
|
272
|
+
minHeight?: string;
|
|
273
|
+
editorId?: string;
|
|
274
|
+
options?: ReactEmailEditorOptions;
|
|
275
|
+
style?: CSSProperties;
|
|
276
|
+
onLoad?: (api: ReactEmailEditorRef) => void;
|
|
277
|
+
onReady?: (api: ReactEmailEditorRef) => void;
|
|
278
|
+
onUpload?: (file: File) => Promise<string>;
|
|
279
|
+
templates?: {
|
|
280
|
+
name: string;
|
|
281
|
+
design: unknown;
|
|
282
|
+
thumbnail?: string;
|
|
283
|
+
}[];
|
|
284
|
+
hideTemplates?: boolean;
|
|
285
|
+
children?: ReactNode;
|
|
286
|
+
};
|
|
287
|
+
declare const ReactEmailEditor: react.ForwardRefExoticComponent<ReactEmailEditorProps & react.RefAttributes<ReactEmailEditorRef>> & {
|
|
288
|
+
jsonToHtml: typeof jsonToHtml;
|
|
289
|
+
};
|
|
290
|
+
|
|
289
291
|
/**
|
|
290
292
|
* Pull usable HTML from a full document (`<!DOCTYPE` / `<html>`) or a fragment string.
|
|
291
293
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -96,59 +96,6 @@ type EmailHtmlOptions = {
|
|
|
96
96
|
customCSS?: string;
|
|
97
97
|
};
|
|
98
98
|
|
|
99
|
-
/** Theme color tokens (subset used by the editor chrome). */
|
|
100
|
-
type ThemeColors = (typeof THEMES)["light"];
|
|
101
|
-
/** Known `options` keys for {@link ReactEmailEditor} — callers may pass extra keys; these are what the editor reads. */
|
|
102
|
-
type ReactEmailEditorOptions = EmailHtmlOptions & {
|
|
103
|
-
appearance?: {
|
|
104
|
-
theme?: string;
|
|
105
|
-
/** Shallow merge over the active theme (e.g. accent border). */
|
|
106
|
-
colors?: Partial<ThemeColors>;
|
|
107
|
-
/** Extra named palettes; keys appear in Settings → Color scheme. */
|
|
108
|
-
customThemes?: Record<string, ThemeColors>;
|
|
109
|
-
};
|
|
110
|
-
locale?: string;
|
|
111
|
-
features?: {
|
|
112
|
-
autoSave?: {
|
|
113
|
-
enabled?: boolean;
|
|
114
|
-
interval?: number;
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
tools?: Record<string, {
|
|
118
|
-
enabled?: boolean;
|
|
119
|
-
}>;
|
|
120
|
-
/** Optional labels for block-library sections (row layouts + content blocks). */
|
|
121
|
-
blockLibrary?: {
|
|
122
|
-
groupHeadings?: {
|
|
123
|
-
blocks?: string;
|
|
124
|
-
};
|
|
125
|
-
/** Override default palette group titles (keys: text, structure, media, actions, widgets). */
|
|
126
|
-
paletteGroupLabels?: Partial<Record<BlockPaletteGroupKey, string>>;
|
|
127
|
-
};
|
|
128
|
-
};
|
|
129
|
-
interface ReactEmailEditorRef {
|
|
130
|
-
loadJson(input: string | Record<string, unknown>): void;
|
|
131
|
-
/** Calls `cb` with the design as a JSON string (new `email_document` schema). */
|
|
132
|
-
exportJson(cb: (json: string) => void, pretty?: boolean): void;
|
|
133
|
-
}
|
|
134
|
-
type ReactEmailEditorProps = {
|
|
135
|
-
minHeight?: string;
|
|
136
|
-
editorId?: string;
|
|
137
|
-
options?: ReactEmailEditorOptions;
|
|
138
|
-
style?: CSSProperties;
|
|
139
|
-
onLoad?: (api: ReactEmailEditorRef) => void;
|
|
140
|
-
onReady?: (api: ReactEmailEditorRef) => void;
|
|
141
|
-
onUpload?: (file: File) => Promise<string>;
|
|
142
|
-
templates?: {
|
|
143
|
-
name: string;
|
|
144
|
-
design: unknown;
|
|
145
|
-
thumbnail?: string;
|
|
146
|
-
}[];
|
|
147
|
-
hideTemplates?: boolean;
|
|
148
|
-
children?: ReactNode;
|
|
149
|
-
};
|
|
150
|
-
declare const ReactEmailEditor: react.ForwardRefExoticComponent<ReactEmailEditorProps & react.RefAttributes<ReactEmailEditorRef>>;
|
|
151
|
-
|
|
152
99
|
type Padding = {
|
|
153
100
|
top?: number;
|
|
154
101
|
right?: number;
|
|
@@ -286,6 +233,61 @@ type JsonToHtmlOptions = EmailHtmlOptions;
|
|
|
286
233
|
*/
|
|
287
234
|
declare function jsonToHtml(designInput: unknown, opts?: JsonToHtmlOptions): string;
|
|
288
235
|
|
|
236
|
+
/** Theme color tokens (subset used by the editor chrome). */
|
|
237
|
+
type ThemeColors = (typeof THEMES)["light"];
|
|
238
|
+
/** Known `options` keys for {@link ReactEmailEditor} — callers may pass extra keys; these are what the editor reads. */
|
|
239
|
+
type ReactEmailEditorOptions = EmailHtmlOptions & {
|
|
240
|
+
appearance?: {
|
|
241
|
+
theme?: string;
|
|
242
|
+
/** Shallow merge over the active theme (e.g. accent border). */
|
|
243
|
+
colors?: Partial<ThemeColors>;
|
|
244
|
+
/** Extra named palettes; keys appear in Settings → Color scheme. */
|
|
245
|
+
customThemes?: Record<string, ThemeColors>;
|
|
246
|
+
};
|
|
247
|
+
locale?: string;
|
|
248
|
+
features?: {
|
|
249
|
+
autoSave?: {
|
|
250
|
+
enabled?: boolean;
|
|
251
|
+
interval?: number;
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
tools?: Record<string, {
|
|
255
|
+
enabled?: boolean;
|
|
256
|
+
}>;
|
|
257
|
+
/** Optional labels for block-library sections (row layouts + content blocks). */
|
|
258
|
+
blockLibrary?: {
|
|
259
|
+
groupHeadings?: {
|
|
260
|
+
blocks?: string;
|
|
261
|
+
};
|
|
262
|
+
/** Override default palette group titles (keys: text, structure, media, actions, widgets). */
|
|
263
|
+
paletteGroupLabels?: Partial<Record<BlockPaletteGroupKey, string>>;
|
|
264
|
+
};
|
|
265
|
+
};
|
|
266
|
+
interface ReactEmailEditorRef {
|
|
267
|
+
loadJson(input: string | Record<string, unknown>): void;
|
|
268
|
+
/** Calls `cb` with the design as a JSON string (new `email_document` schema). */
|
|
269
|
+
exportJson(cb: (json: string) => void, pretty?: boolean): void;
|
|
270
|
+
}
|
|
271
|
+
type ReactEmailEditorProps = {
|
|
272
|
+
minHeight?: string;
|
|
273
|
+
editorId?: string;
|
|
274
|
+
options?: ReactEmailEditorOptions;
|
|
275
|
+
style?: CSSProperties;
|
|
276
|
+
onLoad?: (api: ReactEmailEditorRef) => void;
|
|
277
|
+
onReady?: (api: ReactEmailEditorRef) => void;
|
|
278
|
+
onUpload?: (file: File) => Promise<string>;
|
|
279
|
+
templates?: {
|
|
280
|
+
name: string;
|
|
281
|
+
design: unknown;
|
|
282
|
+
thumbnail?: string;
|
|
283
|
+
}[];
|
|
284
|
+
hideTemplates?: boolean;
|
|
285
|
+
children?: ReactNode;
|
|
286
|
+
};
|
|
287
|
+
declare const ReactEmailEditor: react.ForwardRefExoticComponent<ReactEmailEditorProps & react.RefAttributes<ReactEmailEditorRef>> & {
|
|
288
|
+
jsonToHtml: typeof jsonToHtml;
|
|
289
|
+
};
|
|
290
|
+
|
|
289
291
|
/**
|
|
290
292
|
* Pull usable HTML from a full document (`<!DOCTYPE` / `<html>`) or a fragment string.
|
|
291
293
|
*/
|
package/dist/index.js
CHANGED
|
@@ -6509,8 +6509,8 @@ import { Fragment as Fragment7, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-ru
|
|
|
6509
6509
|
var RIGHT_RAIL_DEFAULT_W = 328;
|
|
6510
6510
|
var RIGHT_RAIL_MIN_W = 260;
|
|
6511
6511
|
var RIGHT_RAIL_MAX_W = 720;
|
|
6512
|
-
var
|
|
6513
|
-
function
|
|
6512
|
+
var ReactEmailEditorComponent = forwardRef(
|
|
6513
|
+
function ReactEmailEditor({
|
|
6514
6514
|
minHeight = "100vh",
|
|
6515
6515
|
editorId = "email-editor",
|
|
6516
6516
|
onLoad,
|
|
@@ -8162,6 +8162,7 @@ var ReactEmailEditor = forwardRef(
|
|
|
8162
8162
|
);
|
|
8163
8163
|
}
|
|
8164
8164
|
);
|
|
8165
|
+
var ReactEmailEditor2 = Object.assign(ReactEmailEditorComponent, { jsonToHtml });
|
|
8165
8166
|
|
|
8166
8167
|
// src/lib/htmlToEmailDesign.ts
|
|
8167
8168
|
var pad = (n) => ({ top: n, right: n, bottom: n, left: n });
|
|
@@ -8230,7 +8231,7 @@ function htmlToEmailDesignTemplate(html) {
|
|
|
8230
8231
|
}
|
|
8231
8232
|
export {
|
|
8232
8233
|
PreviewModal as EmailPreviewModal,
|
|
8233
|
-
ReactEmailEditor,
|
|
8234
|
+
ReactEmailEditor2 as ReactEmailEditor,
|
|
8234
8235
|
base64ToUtf8,
|
|
8235
8236
|
DEVICES as emailPreviewDevices,
|
|
8236
8237
|
extractHtmlForDesign,
|