@kgalexander/mcreate 0.0.11 → 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-TDZCSKBT.mjs → chunk-LAW7VVEQ.mjs} +445 -174
- package/dist/{core-F5E63TCH.mjs → core-GBVVYXAB.mjs} +1 -1
- package/dist/index.d.mts +15 -3
- package/dist/index.d.ts +15 -3
- package/dist/index.js +3427 -2626
- package/dist/index.mjs +1334 -835
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -259,7 +259,17 @@ 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>;
|
|
272
|
+
type PaidLevel = 0 | 1 | 2 | 3;
|
|
263
273
|
|
|
264
274
|
interface EditorProps {
|
|
265
275
|
setEditorLoading?: (loading: boolean) => void;
|
|
@@ -267,10 +277,12 @@ interface EditorProps {
|
|
|
267
277
|
}
|
|
268
278
|
declare function Editor({ setEditorLoading }: EditorProps): react_jsx_runtime.JSX.Element;
|
|
269
279
|
|
|
270
|
-
declare function TemplatePage({ templateId, initialTemplate, onSave }: {
|
|
280
|
+
declare function TemplatePage({ templateId, initialTemplate, onSave, onToast, isPaidLevel }: {
|
|
271
281
|
templateId: string;
|
|
272
282
|
initialTemplate: TemplateJSON;
|
|
273
283
|
onSave?: OnSaveCallback;
|
|
284
|
+
onToast?: OnToastCallback;
|
|
285
|
+
isPaidLevel?: PaidLevel;
|
|
274
286
|
}): react_jsx_runtime.JSX.Element;
|
|
275
287
|
|
|
276
288
|
/**
|
|
@@ -280,7 +292,7 @@ declare function TemplatePage({ templateId, initialTemplate, onSave }: {
|
|
|
280
292
|
|
|
281
293
|
type RenderMode = 'production' | 'editing';
|
|
282
294
|
interface RenderOptions {
|
|
283
|
-
|
|
295
|
+
isPaidLevel?: number;
|
|
284
296
|
}
|
|
285
297
|
/**
|
|
286
298
|
* Convert template JSON to MJML string
|
|
@@ -291,4 +303,4 @@ interface RenderOptions {
|
|
|
291
303
|
*/
|
|
292
304
|
declare function json2mjml(template: TemplateJSON, mode?: RenderMode, options?: RenderOptions): string;
|
|
293
305
|
|
|
294
|
-
export { Editor, type OnSaveCallback, 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,7 +259,17 @@ 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>;
|
|
272
|
+
type PaidLevel = 0 | 1 | 2 | 3;
|
|
263
273
|
|
|
264
274
|
interface EditorProps {
|
|
265
275
|
setEditorLoading?: (loading: boolean) => void;
|
|
@@ -267,10 +277,12 @@ interface EditorProps {
|
|
|
267
277
|
}
|
|
268
278
|
declare function Editor({ setEditorLoading }: EditorProps): react_jsx_runtime.JSX.Element;
|
|
269
279
|
|
|
270
|
-
declare function TemplatePage({ templateId, initialTemplate, onSave }: {
|
|
280
|
+
declare function TemplatePage({ templateId, initialTemplate, onSave, onToast, isPaidLevel }: {
|
|
271
281
|
templateId: string;
|
|
272
282
|
initialTemplate: TemplateJSON;
|
|
273
283
|
onSave?: OnSaveCallback;
|
|
284
|
+
onToast?: OnToastCallback;
|
|
285
|
+
isPaidLevel?: PaidLevel;
|
|
274
286
|
}): react_jsx_runtime.JSX.Element;
|
|
275
287
|
|
|
276
288
|
/**
|
|
@@ -280,7 +292,7 @@ declare function TemplatePage({ templateId, initialTemplate, onSave }: {
|
|
|
280
292
|
|
|
281
293
|
type RenderMode = 'production' | 'editing';
|
|
282
294
|
interface RenderOptions {
|
|
283
|
-
|
|
295
|
+
isPaidLevel?: number;
|
|
284
296
|
}
|
|
285
297
|
/**
|
|
286
298
|
* Convert template JSON to MJML string
|
|
@@ -291,4 +303,4 @@ interface RenderOptions {
|
|
|
291
303
|
*/
|
|
292
304
|
declare function json2mjml(template: TemplateJSON, mode?: RenderMode, options?: RenderOptions): string;
|
|
293
305
|
|
|
294
|
-
export { Editor, type OnSaveCallback, type TemplateJSON, TemplatePage, json2mjml };
|
|
306
|
+
export { Editor, type OnSaveCallback, type OnToastCallback, type PaidLevel, type TemplateJSON, TemplatePage, type ToastOptions, type ToastType, json2mjml };
|