@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.
@@ -5,7 +5,7 @@ import {
5
5
  MAILLOW_EMAIL_EDITOR_VERSION,
6
6
  Preview,
7
7
  useEditorStore
8
- } from "./chunk-LAW7VVEQ.mjs";
8
+ } from "./chunk-QGWWLZOW.mjs";
9
9
  export {
10
10
  Editor,
11
11
  History,
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, isPaidLevel }: {
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
- isPaidLevel?: PaidLevel;
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, isPaidLevel }: {
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
- isPaidLevel?: PaidLevel;
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 };