@kgalexander/mcreate 0.0.12 → 0.0.13
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/{chunk-PL5EKNN6.mjs → chunk-LAW7VVEQ.mjs} +409 -145
- package/dist/{core-UL57QVFL.mjs → core-GBVVYXAB.mjs} +1 -1
- package/dist/index.d.mts +12 -2
- package/dist/index.d.ts +12 -2
- package/dist/index.js +2657 -1866
- package/dist/index.mjs +1318 -829
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -259,6 +259,15 @@ type TemplateJSON = {
|
|
|
259
259
|
content: PageElement[];
|
|
260
260
|
};
|
|
261
261
|
|
|
262
|
+
type ToastType = 'default' | 'success' | 'info' | 'warning' | 'error' | 'promise';
|
|
263
|
+
interface ToastOptions {
|
|
264
|
+
type: ToastType;
|
|
265
|
+
message: string;
|
|
266
|
+
description?: string;
|
|
267
|
+
duration?: number;
|
|
268
|
+
}
|
|
269
|
+
type OnToastCallback = (options: ToastOptions) => void;
|
|
270
|
+
|
|
262
271
|
type OnSaveCallback = (templateId: string, template: TemplateJSON) => void | Promise<void>;
|
|
263
272
|
type PaidLevel = 0 | 1 | 2 | 3;
|
|
264
273
|
|
|
@@ -268,10 +277,11 @@ interface EditorProps {
|
|
|
268
277
|
}
|
|
269
278
|
declare function Editor({ setEditorLoading }: EditorProps): react_jsx_runtime.JSX.Element;
|
|
270
279
|
|
|
271
|
-
declare function TemplatePage({ templateId, initialTemplate, onSave, isPaidLevel }: {
|
|
280
|
+
declare function TemplatePage({ templateId, initialTemplate, onSave, onToast, isPaidLevel }: {
|
|
272
281
|
templateId: string;
|
|
273
282
|
initialTemplate: TemplateJSON;
|
|
274
283
|
onSave?: OnSaveCallback;
|
|
284
|
+
onToast?: OnToastCallback;
|
|
275
285
|
isPaidLevel?: PaidLevel;
|
|
276
286
|
}): react_jsx_runtime.JSX.Element;
|
|
277
287
|
|
|
@@ -293,4 +303,4 @@ interface RenderOptions {
|
|
|
293
303
|
*/
|
|
294
304
|
declare function json2mjml(template: TemplateJSON, mode?: RenderMode, options?: RenderOptions): string;
|
|
295
305
|
|
|
296
|
-
export { Editor, type OnSaveCallback, type PaidLevel, type TemplateJSON, TemplatePage, json2mjml };
|
|
306
|
+
export { Editor, type OnSaveCallback, type OnToastCallback, type PaidLevel, type TemplateJSON, TemplatePage, type ToastOptions, type ToastType, json2mjml };
|
package/dist/index.d.ts
CHANGED
|
@@ -259,6 +259,15 @@ type TemplateJSON = {
|
|
|
259
259
|
content: PageElement[];
|
|
260
260
|
};
|
|
261
261
|
|
|
262
|
+
type ToastType = 'default' | 'success' | 'info' | 'warning' | 'error' | 'promise';
|
|
263
|
+
interface ToastOptions {
|
|
264
|
+
type: ToastType;
|
|
265
|
+
message: string;
|
|
266
|
+
description?: string;
|
|
267
|
+
duration?: number;
|
|
268
|
+
}
|
|
269
|
+
type OnToastCallback = (options: ToastOptions) => void;
|
|
270
|
+
|
|
262
271
|
type OnSaveCallback = (templateId: string, template: TemplateJSON) => void | Promise<void>;
|
|
263
272
|
type PaidLevel = 0 | 1 | 2 | 3;
|
|
264
273
|
|
|
@@ -268,10 +277,11 @@ interface EditorProps {
|
|
|
268
277
|
}
|
|
269
278
|
declare function Editor({ setEditorLoading }: EditorProps): react_jsx_runtime.JSX.Element;
|
|
270
279
|
|
|
271
|
-
declare function TemplatePage({ templateId, initialTemplate, onSave, isPaidLevel }: {
|
|
280
|
+
declare function TemplatePage({ templateId, initialTemplate, onSave, onToast, isPaidLevel }: {
|
|
272
281
|
templateId: string;
|
|
273
282
|
initialTemplate: TemplateJSON;
|
|
274
283
|
onSave?: OnSaveCallback;
|
|
284
|
+
onToast?: OnToastCallback;
|
|
275
285
|
isPaidLevel?: PaidLevel;
|
|
276
286
|
}): react_jsx_runtime.JSX.Element;
|
|
277
287
|
|
|
@@ -293,4 +303,4 @@ interface RenderOptions {
|
|
|
293
303
|
*/
|
|
294
304
|
declare function json2mjml(template: TemplateJSON, mode?: RenderMode, options?: RenderOptions): string;
|
|
295
305
|
|
|
296
|
-
export { Editor, type OnSaveCallback, type PaidLevel, type TemplateJSON, TemplatePage, json2mjml };
|
|
306
|
+
export { Editor, type OnSaveCallback, type OnToastCallback, type PaidLevel, type TemplateJSON, TemplatePage, type ToastOptions, type ToastType, json2mjml };
|