react-email-studio 3.1.1 → 3.3.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 +27 -0
- package/README.md +5 -1
- package/TUTORIAL.md +1 -2
- package/dist/index.cjs +278 -152
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -5
- package/dist/index.d.ts +13 -5
- package/dist/index.js +282 -158
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.d.cts
CHANGED
|
@@ -108,10 +108,6 @@ type ReactEmailEditorOptions = EmailHtmlOptions & {
|
|
|
108
108
|
customThemes?: Record<string, ThemeColors>;
|
|
109
109
|
};
|
|
110
110
|
locale?: string;
|
|
111
|
-
mergeTags?: {
|
|
112
|
-
name: string;
|
|
113
|
-
value: string;
|
|
114
|
-
}[];
|
|
115
111
|
features?: {
|
|
116
112
|
autoSave?: {
|
|
117
113
|
enabled?: boolean;
|
|
@@ -290,6 +286,18 @@ type JsonToHtmlOptions = EmailHtmlOptions;
|
|
|
290
286
|
*/
|
|
291
287
|
declare function jsonToHtml(designInput: unknown, opts?: JsonToHtmlOptions): string;
|
|
292
288
|
|
|
289
|
+
/**
|
|
290
|
+
* Pull usable HTML from a full document (`<!DOCTYPE` / `<html>`) or a fragment string.
|
|
291
|
+
*/
|
|
292
|
+
declare function extractHtmlForDesign(html: string): string;
|
|
293
|
+
/**
|
|
294
|
+
* Wrap HTML (fragment or full email/page document) in a minimal `email_document`
|
|
295
|
+
* with one row, one column, and a single **html** block — suitable for `loadJson`.
|
|
296
|
+
*
|
|
297
|
+
* @returns `null` when there is no non-empty HTML after extraction/normalization.
|
|
298
|
+
*/
|
|
299
|
+
declare function htmlToEmailDesignTemplate(html: string): EmailDocument | null;
|
|
300
|
+
|
|
293
301
|
declare function utf8ToBase64(raw: string): string;
|
|
294
302
|
declare function base64ToUtf8(b64: string): string;
|
|
295
303
|
|
|
@@ -417,4 +425,4 @@ declare const DEVICES: ({
|
|
|
417
425
|
})[];
|
|
418
426
|
declare function PreviewModal({ html, contentWidth, rowCount, blockCount, editorZoom, locale, initialDevice, initialMobileVariant, onClose, C, title, secondaryActionLabel, onSecondaryAction, }: EmailPreviewModalProps): react_jsx_runtime.JSX.Element;
|
|
419
427
|
|
|
420
|
-
export { type BlockBase, type EmailDocument, type EmailDocumentColumn, type EmailDocumentRow, type EmailDocumentSettings, type EmailHtmlOptions, PreviewModal as EmailPreviewModal, type EmailPreviewModalProps, type JsonToHtmlOptions, type MobilePreviewVariant, ReactEmailEditor, type ReactEmailEditorOptions, type ReactEmailEditorProps, type ReactEmailEditorRef, base64ToUtf8, DEVICES as emailPreviewDevices, jsonToHtml, utf8ToBase64 };
|
|
428
|
+
export { type BlockBase, type EmailDocument, type EmailDocumentColumn, type EmailDocumentRow, type EmailDocumentSettings, type EmailHtmlOptions, PreviewModal as EmailPreviewModal, type EmailPreviewModalProps, type JsonToHtmlOptions, type MobilePreviewVariant, ReactEmailEditor, type ReactEmailEditorOptions, type ReactEmailEditorProps, type ReactEmailEditorRef, base64ToUtf8, DEVICES as emailPreviewDevices, extractHtmlForDesign, htmlToEmailDesignTemplate, jsonToHtml, utf8ToBase64 };
|
package/dist/index.d.ts
CHANGED
|
@@ -108,10 +108,6 @@ type ReactEmailEditorOptions = EmailHtmlOptions & {
|
|
|
108
108
|
customThemes?: Record<string, ThemeColors>;
|
|
109
109
|
};
|
|
110
110
|
locale?: string;
|
|
111
|
-
mergeTags?: {
|
|
112
|
-
name: string;
|
|
113
|
-
value: string;
|
|
114
|
-
}[];
|
|
115
111
|
features?: {
|
|
116
112
|
autoSave?: {
|
|
117
113
|
enabled?: boolean;
|
|
@@ -290,6 +286,18 @@ type JsonToHtmlOptions = EmailHtmlOptions;
|
|
|
290
286
|
*/
|
|
291
287
|
declare function jsonToHtml(designInput: unknown, opts?: JsonToHtmlOptions): string;
|
|
292
288
|
|
|
289
|
+
/**
|
|
290
|
+
* Pull usable HTML from a full document (`<!DOCTYPE` / `<html>`) or a fragment string.
|
|
291
|
+
*/
|
|
292
|
+
declare function extractHtmlForDesign(html: string): string;
|
|
293
|
+
/**
|
|
294
|
+
* Wrap HTML (fragment or full email/page document) in a minimal `email_document`
|
|
295
|
+
* with one row, one column, and a single **html** block — suitable for `loadJson`.
|
|
296
|
+
*
|
|
297
|
+
* @returns `null` when there is no non-empty HTML after extraction/normalization.
|
|
298
|
+
*/
|
|
299
|
+
declare function htmlToEmailDesignTemplate(html: string): EmailDocument | null;
|
|
300
|
+
|
|
293
301
|
declare function utf8ToBase64(raw: string): string;
|
|
294
302
|
declare function base64ToUtf8(b64: string): string;
|
|
295
303
|
|
|
@@ -417,4 +425,4 @@ declare const DEVICES: ({
|
|
|
417
425
|
})[];
|
|
418
426
|
declare function PreviewModal({ html, contentWidth, rowCount, blockCount, editorZoom, locale, initialDevice, initialMobileVariant, onClose, C, title, secondaryActionLabel, onSecondaryAction, }: EmailPreviewModalProps): react_jsx_runtime.JSX.Element;
|
|
419
427
|
|
|
420
|
-
export { type BlockBase, type EmailDocument, type EmailDocumentColumn, type EmailDocumentRow, type EmailDocumentSettings, type EmailHtmlOptions, PreviewModal as EmailPreviewModal, type EmailPreviewModalProps, type JsonToHtmlOptions, type MobilePreviewVariant, ReactEmailEditor, type ReactEmailEditorOptions, type ReactEmailEditorProps, type ReactEmailEditorRef, base64ToUtf8, DEVICES as emailPreviewDevices, jsonToHtml, utf8ToBase64 };
|
|
428
|
+
export { type BlockBase, type EmailDocument, type EmailDocumentColumn, type EmailDocumentRow, type EmailDocumentSettings, type EmailHtmlOptions, PreviewModal as EmailPreviewModal, type EmailPreviewModalProps, type JsonToHtmlOptions, type MobilePreviewVariant, ReactEmailEditor, type ReactEmailEditorOptions, type ReactEmailEditorProps, type ReactEmailEditorRef, base64ToUtf8, DEVICES as emailPreviewDevices, extractHtmlForDesign, htmlToEmailDesignTemplate, jsonToHtml, utf8ToBase64 };
|