@kgalexander/mcreate 0.0.12 → 0.0.14
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-QGWWLZOW.mjs} +620 -276
- package/dist/{core-UL57QVFL.mjs → core-WHUOFMYJ.mjs} +1 -1
- package/dist/index.d.mts +34 -3
- package/dist/index.d.ts +34 -3
- package/dist/index.js +2946 -2080
- package/dist/index.mjs +1467 -988
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -259,7 +259,32 @@ type TemplateJSON = {
|
|
|
259
259
|
content: PageElement[];
|
|
260
260
|
};
|
|
261
261
|
|
|
262
|
+
interface ImageData {
|
|
263
|
+
id: string;
|
|
264
|
+
user_id: string;
|
|
265
|
+
filename: string;
|
|
266
|
+
original_name: string;
|
|
267
|
+
file_path: string;
|
|
268
|
+
file_size: number;
|
|
269
|
+
mime_type: string;
|
|
270
|
+
is_public: boolean;
|
|
271
|
+
created_at: string;
|
|
272
|
+
updated_at: string;
|
|
273
|
+
public_url: string;
|
|
274
|
+
image_type: string;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
type ToastType = 'default' | 'success' | 'info' | 'warning' | 'error' | 'promise';
|
|
278
|
+
interface ToastOptions {
|
|
279
|
+
type: ToastType;
|
|
280
|
+
message: string;
|
|
281
|
+
description?: string;
|
|
282
|
+
duration?: number;
|
|
283
|
+
}
|
|
284
|
+
type OnToastCallback = (options: ToastOptions) => void;
|
|
285
|
+
|
|
262
286
|
type OnSaveCallback = (templateId: string, template: TemplateJSON) => void | Promise<void>;
|
|
287
|
+
type OnExitCallback = () => void;
|
|
263
288
|
type PaidLevel = 0 | 1 | 2 | 3;
|
|
264
289
|
|
|
265
290
|
interface EditorProps {
|
|
@@ -268,11 +293,17 @@ interface EditorProps {
|
|
|
268
293
|
}
|
|
269
294
|
declare function Editor({ setEditorLoading }: EditorProps): react_jsx_runtime.JSX.Element;
|
|
270
295
|
|
|
271
|
-
declare function TemplatePage({ templateId, initialTemplate, onSave,
|
|
296
|
+
declare function TemplatePage({ templateId, initialTemplate, onSave, onToast, onExit, data, }: {
|
|
272
297
|
templateId: string;
|
|
273
298
|
initialTemplate: TemplateJSON;
|
|
274
299
|
onSave?: OnSaveCallback;
|
|
275
|
-
|
|
300
|
+
onToast?: OnToastCallback;
|
|
301
|
+
onExit?: OnExitCallback;
|
|
302
|
+
data?: {
|
|
303
|
+
isPaidLevel?: PaidLevel;
|
|
304
|
+
images?: ImageData[];
|
|
305
|
+
userData?: Record<string, unknown> | null;
|
|
306
|
+
};
|
|
276
307
|
}): react_jsx_runtime.JSX.Element;
|
|
277
308
|
|
|
278
309
|
/**
|
|
@@ -293,4 +324,4 @@ interface RenderOptions {
|
|
|
293
324
|
*/
|
|
294
325
|
declare function json2mjml(template: TemplateJSON, mode?: RenderMode, options?: RenderOptions): string;
|
|
295
326
|
|
|
296
|
-
export { Editor, type OnSaveCallback, type PaidLevel, type TemplateJSON, TemplatePage, json2mjml };
|
|
327
|
+
export { Editor, type ImageData, type OnExitCallback, type OnSaveCallback, type OnToastCallback, type PaidLevel, type TemplateJSON, TemplatePage, type ToastOptions, type ToastType, json2mjml };
|
package/dist/index.d.ts
CHANGED
|
@@ -259,7 +259,32 @@ type TemplateJSON = {
|
|
|
259
259
|
content: PageElement[];
|
|
260
260
|
};
|
|
261
261
|
|
|
262
|
+
interface ImageData {
|
|
263
|
+
id: string;
|
|
264
|
+
user_id: string;
|
|
265
|
+
filename: string;
|
|
266
|
+
original_name: string;
|
|
267
|
+
file_path: string;
|
|
268
|
+
file_size: number;
|
|
269
|
+
mime_type: string;
|
|
270
|
+
is_public: boolean;
|
|
271
|
+
created_at: string;
|
|
272
|
+
updated_at: string;
|
|
273
|
+
public_url: string;
|
|
274
|
+
image_type: string;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
type ToastType = 'default' | 'success' | 'info' | 'warning' | 'error' | 'promise';
|
|
278
|
+
interface ToastOptions {
|
|
279
|
+
type: ToastType;
|
|
280
|
+
message: string;
|
|
281
|
+
description?: string;
|
|
282
|
+
duration?: number;
|
|
283
|
+
}
|
|
284
|
+
type OnToastCallback = (options: ToastOptions) => void;
|
|
285
|
+
|
|
262
286
|
type OnSaveCallback = (templateId: string, template: TemplateJSON) => void | Promise<void>;
|
|
287
|
+
type OnExitCallback = () => void;
|
|
263
288
|
type PaidLevel = 0 | 1 | 2 | 3;
|
|
264
289
|
|
|
265
290
|
interface EditorProps {
|
|
@@ -268,11 +293,17 @@ interface EditorProps {
|
|
|
268
293
|
}
|
|
269
294
|
declare function Editor({ setEditorLoading }: EditorProps): react_jsx_runtime.JSX.Element;
|
|
270
295
|
|
|
271
|
-
declare function TemplatePage({ templateId, initialTemplate, onSave,
|
|
296
|
+
declare function TemplatePage({ templateId, initialTemplate, onSave, onToast, onExit, data, }: {
|
|
272
297
|
templateId: string;
|
|
273
298
|
initialTemplate: TemplateJSON;
|
|
274
299
|
onSave?: OnSaveCallback;
|
|
275
|
-
|
|
300
|
+
onToast?: OnToastCallback;
|
|
301
|
+
onExit?: OnExitCallback;
|
|
302
|
+
data?: {
|
|
303
|
+
isPaidLevel?: PaidLevel;
|
|
304
|
+
images?: ImageData[];
|
|
305
|
+
userData?: Record<string, unknown> | null;
|
|
306
|
+
};
|
|
276
307
|
}): react_jsx_runtime.JSX.Element;
|
|
277
308
|
|
|
278
309
|
/**
|
|
@@ -293,4 +324,4 @@ interface RenderOptions {
|
|
|
293
324
|
*/
|
|
294
325
|
declare function json2mjml(template: TemplateJSON, mode?: RenderMode, options?: RenderOptions): string;
|
|
295
326
|
|
|
296
|
-
export { Editor, type OnSaveCallback, type PaidLevel, type TemplateJSON, TemplatePage, json2mjml };
|
|
327
|
+
export { Editor, type ImageData, type OnExitCallback, type OnSaveCallback, type OnToastCallback, type PaidLevel, type TemplateJSON, TemplatePage, type ToastOptions, type ToastType, json2mjml };
|