@kgalexander/mcreate 1.0.1 → 1.0.3

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.
@@ -815,15 +815,15 @@ function propertyCardTripleMockMjml(block, context) {
815
815
  ${responsiveStyles}
816
816
  <mj-table align="center" width="${width}" padding="0" css-class="${trackingClasses}">
817
817
  <tr class="property-triple-row-${uniqueId}">
818
- <th class="property-triple-card-wrapper-${uniqueId}" valign="top" align="center" width="100px"">
818
+ <th class="property-triple-card-wrapper-${uniqueId}" valign="top" align="center" width="100px">
819
819
  ${cards[0] || ""}
820
820
  </th>
821
821
  <th class="property-triple-spacer-${uniqueId}" style="font-size:0px;line-height:16px;font-weight:normal;width:4px; height:4px">&nbsp;</th>
822
- <th class="property-triple-card-wrapper-${uniqueId}" valign="top" align="center" width="100px" ">
822
+ <th class="property-triple-card-wrapper-${uniqueId}" valign="top" align="center" width="100px">
823
823
  ${cards[1] || ""}
824
824
  </th>
825
825
  <th class="property-triple-spacer-${uniqueId}" style="font-size:0px;line-height:16px;font-weight:normal;width:4px; height:4px">&nbsp;</th>
826
- <th class="property-triple-card-wrapper-${uniqueId}" valign="top" align="center" width="100px" ">
826
+ <th class="property-triple-card-wrapper-${uniqueId}" valign="top" align="center" width="100px">
827
827
  ${cards[2] || ""}
828
828
  </th>
829
829
  </tr>
@@ -1823,6 +1823,7 @@ var useEditorStore = create()(
1823
1823
  onImageUpload: null,
1824
1824
  onDuplicate: null,
1825
1825
  onDelete: null,
1826
+ onTemplateCapture: null,
1826
1827
  previewMode: false,
1827
1828
  focusIdx: null,
1828
1829
  hoverIdx: null,
@@ -1863,7 +1864,7 @@ var useEditorStore = create()(
1863
1864
  });
1864
1865
  },
1865
1866
  // Initialize store with external template (for npm package usage)
1866
- initializeWithTemplate: (templateId, template, onSave, onToast, data, onExit, onImageUpload, onDuplicate, onDelete) => {
1867
+ initializeWithTemplate: (templateId, template, onSave, onToast, data, onExit, onImageUpload, onDuplicate, onDelete, onTemplateCapture) => {
1867
1868
  set((state) => {
1868
1869
  state.templateId = templateId;
1869
1870
  state.template = template;
@@ -1873,6 +1874,7 @@ var useEditorStore = create()(
1873
1874
  state.onImageUpload = onImageUpload ?? null;
1874
1875
  state.onDuplicate = onDuplicate ?? null;
1875
1876
  state.onDelete = onDelete ?? null;
1877
+ state.onTemplateCapture = onTemplateCapture ?? null;
1876
1878
  state.isPaidLevel = data?.isPaidLevel ?? 0;
1877
1879
  state.images = data?.images ?? [];
1878
1880
  state.userData = data?.userData ?? null;
@@ -5,7 +5,7 @@ import {
5
5
  MAILLOW_EMAIL_EDITOR_VERSION,
6
6
  Preview,
7
7
  useEditorStore
8
- } from "./chunk-G7F7GRJC.mjs";
8
+ } from "./chunk-JWS6HO2H.mjs";
9
9
  export {
10
10
  Editor,
11
11
  History,
package/dist/index.d.mts CHANGED
@@ -292,6 +292,7 @@ type OnExitCallback = () => void;
292
292
  type OnImageUploadCallback = (file: File) => Promise<ImageData>;
293
293
  type OnDuplicateCallback = (templateId: string, template: TemplateJSON) => void | Promise<void>;
294
294
  type OnDeleteCallback = (templateId: string) => void | Promise<void>;
295
+ type OnTemplateCaptureCallback = (templateId: string, imageDataUrl: string) => void | Promise<void>;
295
296
  type PaidLevel = 0 | 1 | 2 | 3;
296
297
 
297
298
  interface EditorProps {
@@ -300,7 +301,7 @@ interface EditorProps {
300
301
  }
301
302
  declare function Editor({ setEditorLoading }: EditorProps): react_jsx_runtime.JSX.Element;
302
303
 
303
- declare function TemplatePage({ templateId, initialTemplate, onSave, onToast, onExit, onImageUpload, onDuplicate, onDelete, data, }: {
304
+ declare function TemplatePage({ templateId, initialTemplate, onSave, onToast, onExit, onImageUpload, onDuplicate, onDelete, onTemplateCapture, data, }: {
304
305
  templateId: string;
305
306
  initialTemplate: TemplateJSON;
306
307
  onSave?: OnSaveCallback;
@@ -309,6 +310,7 @@ declare function TemplatePage({ templateId, initialTemplate, onSave, onToast, on
309
310
  onImageUpload?: OnImageUploadCallback;
310
311
  onDuplicate?: OnDuplicateCallback;
311
312
  onDelete?: OnDeleteCallback;
313
+ onTemplateCapture?: OnTemplateCaptureCallback;
312
314
  data?: {
313
315
  isPaidLevel?: PaidLevel;
314
316
  images?: ImageData[];
@@ -337,4 +339,4 @@ interface RenderOptions {
337
339
  */
338
340
  declare function json2mjml(template: TemplateJSON, mode?: RenderMode, options?: RenderOptions): string;
339
341
 
340
- export { Editor, type ImageData, MAX_TEMPLATE_SIZE, type MergeField, type OnDeleteCallback, type OnDuplicateCallback, type OnExitCallback, type OnImageUploadCallback, type OnSaveCallback, type OnToastCallback, type PaidLevel, type TemplateJSON, TemplatePage, type ToastOptions, type ToastType, json2mjml };
342
+ export { Editor, type ImageData, MAX_TEMPLATE_SIZE, type MergeField, type OnDeleteCallback, type OnDuplicateCallback, type OnExitCallback, type OnImageUploadCallback, type OnSaveCallback, type OnTemplateCaptureCallback, type OnToastCallback, type PaidLevel, type TemplateJSON, TemplatePage, type ToastOptions, type ToastType, json2mjml };
package/dist/index.d.ts CHANGED
@@ -292,6 +292,7 @@ type OnExitCallback = () => void;
292
292
  type OnImageUploadCallback = (file: File) => Promise<ImageData>;
293
293
  type OnDuplicateCallback = (templateId: string, template: TemplateJSON) => void | Promise<void>;
294
294
  type OnDeleteCallback = (templateId: string) => void | Promise<void>;
295
+ type OnTemplateCaptureCallback = (templateId: string, imageDataUrl: string) => void | Promise<void>;
295
296
  type PaidLevel = 0 | 1 | 2 | 3;
296
297
 
297
298
  interface EditorProps {
@@ -300,7 +301,7 @@ interface EditorProps {
300
301
  }
301
302
  declare function Editor({ setEditorLoading }: EditorProps): react_jsx_runtime.JSX.Element;
302
303
 
303
- declare function TemplatePage({ templateId, initialTemplate, onSave, onToast, onExit, onImageUpload, onDuplicate, onDelete, data, }: {
304
+ declare function TemplatePage({ templateId, initialTemplate, onSave, onToast, onExit, onImageUpload, onDuplicate, onDelete, onTemplateCapture, data, }: {
304
305
  templateId: string;
305
306
  initialTemplate: TemplateJSON;
306
307
  onSave?: OnSaveCallback;
@@ -309,6 +310,7 @@ declare function TemplatePage({ templateId, initialTemplate, onSave, onToast, on
309
310
  onImageUpload?: OnImageUploadCallback;
310
311
  onDuplicate?: OnDuplicateCallback;
311
312
  onDelete?: OnDeleteCallback;
313
+ onTemplateCapture?: OnTemplateCaptureCallback;
312
314
  data?: {
313
315
  isPaidLevel?: PaidLevel;
314
316
  images?: ImageData[];
@@ -337,4 +339,4 @@ interface RenderOptions {
337
339
  */
338
340
  declare function json2mjml(template: TemplateJSON, mode?: RenderMode, options?: RenderOptions): string;
339
341
 
340
- export { Editor, type ImageData, MAX_TEMPLATE_SIZE, type MergeField, type OnDeleteCallback, type OnDuplicateCallback, type OnExitCallback, type OnImageUploadCallback, type OnSaveCallback, type OnToastCallback, type PaidLevel, type TemplateJSON, TemplatePage, type ToastOptions, type ToastType, json2mjml };
342
+ export { Editor, type ImageData, MAX_TEMPLATE_SIZE, type MergeField, type OnDeleteCallback, type OnDuplicateCallback, type OnExitCallback, type OnImageUploadCallback, type OnSaveCallback, type OnTemplateCaptureCallback, type OnToastCallback, type PaidLevel, type TemplateJSON, TemplatePage, type ToastOptions, type ToastType, json2mjml };