@kgalexander/mcreate 0.0.13 → 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-LAW7VVEQ.mjs → chunk-QGWWLZOW.mjs} +220 -140
- package/dist/{core-GBVVYXAB.mjs → core-WHUOFMYJ.mjs} +1 -1
- package/dist/index.d.mts +24 -3
- package/dist/index.d.ts +24 -3
- package/dist/index.js +318 -243
- package/dist/index.mjs +168 -178
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -259,6 +259,21 @@ 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
|
+
|
|
262
277
|
type ToastType = 'default' | 'success' | 'info' | 'warning' | 'error' | 'promise';
|
|
263
278
|
interface ToastOptions {
|
|
264
279
|
type: ToastType;
|
|
@@ -269,6 +284,7 @@ interface ToastOptions {
|
|
|
269
284
|
type OnToastCallback = (options: ToastOptions) => void;
|
|
270
285
|
|
|
271
286
|
type OnSaveCallback = (templateId: string, template: TemplateJSON) => void | Promise<void>;
|
|
287
|
+
type OnExitCallback = () => void;
|
|
272
288
|
type PaidLevel = 0 | 1 | 2 | 3;
|
|
273
289
|
|
|
274
290
|
interface EditorProps {
|
|
@@ -277,12 +293,17 @@ interface EditorProps {
|
|
|
277
293
|
}
|
|
278
294
|
declare function Editor({ setEditorLoading }: EditorProps): react_jsx_runtime.JSX.Element;
|
|
279
295
|
|
|
280
|
-
declare function TemplatePage({ templateId, initialTemplate, onSave, onToast,
|
|
296
|
+
declare function TemplatePage({ templateId, initialTemplate, onSave, onToast, onExit, data, }: {
|
|
281
297
|
templateId: string;
|
|
282
298
|
initialTemplate: TemplateJSON;
|
|
283
299
|
onSave?: OnSaveCallback;
|
|
284
300
|
onToast?: OnToastCallback;
|
|
285
|
-
|
|
301
|
+
onExit?: OnExitCallback;
|
|
302
|
+
data?: {
|
|
303
|
+
isPaidLevel?: PaidLevel;
|
|
304
|
+
images?: ImageData[];
|
|
305
|
+
userData?: Record<string, unknown> | null;
|
|
306
|
+
};
|
|
286
307
|
}): react_jsx_runtime.JSX.Element;
|
|
287
308
|
|
|
288
309
|
/**
|
|
@@ -303,4 +324,4 @@ interface RenderOptions {
|
|
|
303
324
|
*/
|
|
304
325
|
declare function json2mjml(template: TemplateJSON, mode?: RenderMode, options?: RenderOptions): string;
|
|
305
326
|
|
|
306
|
-
export { Editor, type OnSaveCallback, type OnToastCallback, type PaidLevel, type TemplateJSON, TemplatePage, type ToastOptions, type ToastType, 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,6 +259,21 @@ 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
|
+
|
|
262
277
|
type ToastType = 'default' | 'success' | 'info' | 'warning' | 'error' | 'promise';
|
|
263
278
|
interface ToastOptions {
|
|
264
279
|
type: ToastType;
|
|
@@ -269,6 +284,7 @@ interface ToastOptions {
|
|
|
269
284
|
type OnToastCallback = (options: ToastOptions) => void;
|
|
270
285
|
|
|
271
286
|
type OnSaveCallback = (templateId: string, template: TemplateJSON) => void | Promise<void>;
|
|
287
|
+
type OnExitCallback = () => void;
|
|
272
288
|
type PaidLevel = 0 | 1 | 2 | 3;
|
|
273
289
|
|
|
274
290
|
interface EditorProps {
|
|
@@ -277,12 +293,17 @@ interface EditorProps {
|
|
|
277
293
|
}
|
|
278
294
|
declare function Editor({ setEditorLoading }: EditorProps): react_jsx_runtime.JSX.Element;
|
|
279
295
|
|
|
280
|
-
declare function TemplatePage({ templateId, initialTemplate, onSave, onToast,
|
|
296
|
+
declare function TemplatePage({ templateId, initialTemplate, onSave, onToast, onExit, data, }: {
|
|
281
297
|
templateId: string;
|
|
282
298
|
initialTemplate: TemplateJSON;
|
|
283
299
|
onSave?: OnSaveCallback;
|
|
284
300
|
onToast?: OnToastCallback;
|
|
285
|
-
|
|
301
|
+
onExit?: OnExitCallback;
|
|
302
|
+
data?: {
|
|
303
|
+
isPaidLevel?: PaidLevel;
|
|
304
|
+
images?: ImageData[];
|
|
305
|
+
userData?: Record<string, unknown> | null;
|
|
306
|
+
};
|
|
286
307
|
}): react_jsx_runtime.JSX.Element;
|
|
287
308
|
|
|
288
309
|
/**
|
|
@@ -303,4 +324,4 @@ interface RenderOptions {
|
|
|
303
324
|
*/
|
|
304
325
|
declare function json2mjml(template: TemplateJSON, mode?: RenderMode, options?: RenderOptions): string;
|
|
305
326
|
|
|
306
|
-
export { Editor, type OnSaveCallback, type OnToastCallback, type PaidLevel, type TemplateJSON, TemplatePage, type ToastOptions, type ToastType, json2mjml };
|
|
327
|
+
export { Editor, type ImageData, type OnExitCallback, type OnSaveCallback, type OnToastCallback, type PaidLevel, type TemplateJSON, TemplatePage, type ToastOptions, type ToastType, json2mjml };
|