esender-email-editor 1.1.2 → 1.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/README.md +10 -37
- package/dist/index.cjs +6 -7
- package/dist/index.d.ts +50 -2
- package/dist/index.js +6 -7
- package/dist/styles.css +1 -1
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -83,7 +83,18 @@ interface LoadTemplateOptions {
|
|
|
83
83
|
interface EditorHandle {
|
|
84
84
|
getJson: () => any;
|
|
85
85
|
getHtml: () => any;
|
|
86
|
-
|
|
86
|
+
/**
|
|
87
|
+
* Restore a previously saved template from JSON. Accepts either the raw
|
|
88
|
+
* stringified output of `getJson()` or the deserialized object.
|
|
89
|
+
* Pass `null` to clear the canvas to an empty template.
|
|
90
|
+
*/
|
|
91
|
+
loadJson: (json: string | object | null, raw?: boolean) => void;
|
|
92
|
+
/**
|
|
93
|
+
* Load raw HTML into the editor. The HTML is wrapped in an MJML `mj-raw`
|
|
94
|
+
* block and rendered verbatim — the editor cannot break arbitrary HTML
|
|
95
|
+
* back into editable blocks, so for full editability prefer `loadJson`.
|
|
96
|
+
*/
|
|
97
|
+
loadHtml: (html: string) => void;
|
|
87
98
|
/**
|
|
88
99
|
* Export the current editor state (HTML + JSON) and persist it to the
|
|
89
100
|
* template API. apiKey comes from the Package's prop. Pass `templateId` to
|
|
@@ -109,5 +120,42 @@ interface PackageProps extends EditorEventCallbacks {
|
|
|
109
120
|
}
|
|
110
121
|
declare const Package: React.ForwardRefExoticComponent<PackageProps & React.RefAttributes<EditorHandle>>;
|
|
111
122
|
|
|
123
|
+
/**
|
|
124
|
+
* Public entry for @bitbeast-private-limited/antd-email-editor.
|
|
125
|
+
*
|
|
126
|
+
* This file is the rollup input — it intentionally exports ONLY the consumer
|
|
127
|
+
* surface. Do NOT export internal utilities, store, contexts, MJML helpers or
|
|
128
|
+
* any other implementation detail from here. Anything re-exported below
|
|
129
|
+
* becomes part of the SDK's public contract and breaks consumers on removal.
|
|
130
|
+
*/
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Imperative editor instance returned by `ref.current`. Alias for {@link EditorHandle}.
|
|
134
|
+
*/
|
|
135
|
+
type EditorInstance = EditorHandle;
|
|
136
|
+
/**
|
|
137
|
+
* Stored template record returned by the save/load APIs. Alias for {@link TemplateDocument}.
|
|
138
|
+
*/
|
|
139
|
+
type TemplateData = TemplateDocument;
|
|
140
|
+
/**
|
|
141
|
+
* MJML JSON tree describing a template. This is the shape `getJson()` produces
|
|
142
|
+
* once parsed back into an object — kept intentionally loose since the tree
|
|
143
|
+
* has many MJML-tag-specific variants.
|
|
144
|
+
*/
|
|
145
|
+
type TemplateJson = Record<string, unknown> & {
|
|
146
|
+
tagName: string;
|
|
147
|
+
attributes?: Record<string, unknown>;
|
|
148
|
+
children?: unknown[];
|
|
149
|
+
content?: string;
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Arguments accepted by {@link EditorHandle.saveTemplate}. Alias for {@link SaveTemplateOptions}.
|
|
153
|
+
*/
|
|
154
|
+
type SaveTemplatePayload = SaveTemplateOptions;
|
|
155
|
+
/**
|
|
156
|
+
* Arguments accepted by {@link EditorHandle.loadTemplate}. Alias for {@link LoadTemplateOptions}.
|
|
157
|
+
*/
|
|
158
|
+
type LoadTemplatePayload = LoadTemplateOptions;
|
|
159
|
+
|
|
112
160
|
export { Package, Package as default };
|
|
113
|
-
export type { EditorEventCallbacks, EditorHandle, LicenseError, LicenseErrorCode, LoadEvent, LoadTemplateOptions, MediaUploadEvent, PackageProps, RefreshTokenResponse, SaveEvent, SaveTemplateOptions, TemplateApiResponse, TemplateDocument, VerifyLicenseResponse };
|
|
161
|
+
export type { EditorEventCallbacks, EditorHandle, EditorInstance, LicenseError, LicenseErrorCode, LoadEvent, LoadTemplateOptions, LoadTemplatePayload, MediaUploadEvent, PackageProps, RefreshTokenResponse, SaveEvent, SaveTemplateOptions, SaveTemplatePayload, TemplateApiResponse, TemplateData, TemplateDocument, TemplateJson, VerifyLicenseResponse };
|