@kgalexander/mcreate 1.0.7 → 1.0.9

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.
@@ -1707,7 +1707,7 @@ var empty_default = {
1707
1707
  version: "1.0.0",
1708
1708
  published: true,
1709
1709
  creator: "Kevin Guerrero",
1710
- image: "https://mzyngaqmbvhpgmmipndy.supabase.co/storage/v1/object/public/Maillow/placeholder_image.png",
1710
+ image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mN88P/BfwAJhAPkD+pMGAAAAABJRU5ErkJggg==",
1711
1711
  content: [
1712
1712
  {
1713
1713
  id: "main-body",
@@ -3418,7 +3418,7 @@ function getEditorStyles(isDragButtonHovered, textEditingIdx) {
3418
3418
  /* Merge field tags - dashed underline for {{variable}} patterns */
3419
3419
  .merge-field-tag {
3420
3420
 
3421
- background-color: var(--background);
3421
+ background-color: white;
3422
3422
  border-radius: 4px;
3423
3423
  padding: 0px;
3424
3424
  border: 1px solid var(--border);
@@ -4286,7 +4286,7 @@ var DragButton = ({ getReferenceRect, focusIdx, elementType, isDragging }) => {
4286
4286
  zIndex: 49,
4287
4287
  opacity: isDragging ? 0.3 : 1
4288
4288
  },
4289
- className: "flex items-center justify-center bg-background border shadow-sm rounded-full cursor-grab hover:bg-blue-400 hover:border-blue-300 active:cursor-grabbing transition-colors",
4289
+ className: "flex items-center justify-center bg-white border shadow-sm rounded-full cursor-grab hover:bg-blue-400 hover:border-blue-300 active:cursor-grabbing transition-colors",
4290
4290
  children: /* @__PURE__ */ jsx2(Move, { className: "w-4 h-4pointer-events-none", color: isDragButtonHovered ? "white" : "gray" })
4291
4291
  }
4292
4292
  );
@@ -11303,7 +11303,7 @@ function Separator({
11303
11303
  }
11304
11304
 
11305
11305
  // src/core/editor/components/float-ui/helper.ts
11306
- var floatButtonVariants = "shadow-none transition-none cursor-pointer rounded-full h-[34px] w-[34px] p-0";
11306
+ var floatButtonVariants = "shadow-none transition-none cursor-pointer rounded-full h-[34px] w-[34px] p-0 text-black";
11307
11307
 
11308
11308
  // src/components/ui/popover.tsx
11309
11309
  import * as PopoverPrimitive from "@radix-ui/react-popover";
@@ -11407,7 +11407,7 @@ var TextLinkMenu = ({ editor }) => {
11407
11407
  Button,
11408
11408
  {
11409
11409
  variant: "ghost",
11410
- className: "shadow-none transition-none cursor-pointer rounded-full outline-none h-[34px]",
11410
+ className: "shadow-none transition-none cursor-pointer rounded-full outline-none h-[34px] text-black",
11411
11411
  onMouseDown: (e) => e.preventDefault(),
11412
11412
  children: [
11413
11413
  /* @__PURE__ */ jsx20(LinkIcon2, { className: "size-4" }),
@@ -12289,7 +12289,7 @@ var TiptapOverlayContent = ({ idx, getReferenceRect, getShadowElement, initialWi
12289
12289
  text-align: inherit;
12290
12290
  }
12291
12291
  .tiptap-overlay .ProseMirror .merge-field-tag {
12292
- background-color: var(--background);
12292
+ background-color: white;
12293
12293
  border-radius: 4px;
12294
12294
  padding: 0px;
12295
12295
  border: 1px solid var(--border);
@@ -12366,7 +12366,7 @@ var DeleteButton = () => {
12366
12366
  variant: "ghost",
12367
12367
  className: floatButtonVariants,
12368
12368
  onClick: handleDelete,
12369
- children: /* @__PURE__ */ jsx23(TrashIcon2, { className: "size-4" })
12369
+ children: /* @__PURE__ */ jsx23(TrashIcon2, { className: "size-4 " })
12370
12370
  }
12371
12371
  ) }),
12372
12372
  /* @__PURE__ */ jsx23(TooltipContent, { side: "bottom", children: "Delete" })
@@ -12663,7 +12663,7 @@ var HrefMenu = () => {
12663
12663
  Button,
12664
12664
  {
12665
12665
  variant: "ghost",
12666
- className: "shadow-none transition-none cursor-pointer rounded-full outline-none h-[34px]",
12666
+ className: "shadow-none transition-none cursor-pointer rounded-full outline-none h-[34px] text-black",
12667
12667
  children: [
12668
12668
  /* @__PURE__ */ jsx26(LinkIcon3, { className: "size-4" }),
12669
12669
  /* @__PURE__ */ jsx26("p", { children: "Add link" })
@@ -13472,7 +13472,7 @@ var MlsNumberMenu = () => {
13472
13472
  Button,
13473
13473
  {
13474
13474
  variant: "ghost",
13475
- className: "shadow-none transition-none cursor-pointer rounded-full outline-none h-[34px]",
13475
+ className: "shadow-none transition-none cursor-pointer rounded-full outline-none h-[34px] text-black",
13476
13476
  children: [
13477
13477
  /* @__PURE__ */ jsx38(HousePlusIcon, { className: "size-4" }),
13478
13478
  /* @__PURE__ */ jsx38("p", { children: "MLS" })
@@ -13821,14 +13821,14 @@ var DividerScale = ({ getReferenceRect }) => {
13821
13821
  "div",
13822
13822
  {
13823
13823
  onPointerDown: (e) => handlePointerDown(e, "left"),
13824
- className: `w-[18px] h-[18px] cursor-ew-resize bg-background shadow-md border rounded-full absolute -left-[9px] top-1/2 -translate-y-1/2 touch-none select-none ${activeSide === "left" ? "bg-blue-400 border-blue-300" : "hover:bg-blue-400 hover:border-blue-300"}`
13824
+ className: `w-[18px] h-[18px] cursor-ew-resize bg-white shadow-md border rounded-full absolute -left-[9px] top-1/2 -translate-y-1/2 touch-none select-none ${activeSide === "left" ? "bg-blue-400 border-blue-300" : "hover:bg-blue-400 hover:border-blue-300"}`
13825
13825
  }
13826
13826
  ),
13827
13827
  showRightHandle && (activeSide === null || activeSide === "right") && /* @__PURE__ */ jsx43(
13828
13828
  "div",
13829
13829
  {
13830
13830
  onPointerDown: (e) => handlePointerDown(e, "right"),
13831
- className: `w-[18px] h-[18px] cursor-ew-resize bg-background shadow-md border rounded-full absolute -right-[9px] top-1/2 -translate-y-1/2 touch-none select-none ${activeSide === "right" ? "bg-blue-400 border-blue-300" : "hover:bg-blue-400 hover:border-blue-300"}`
13831
+ className: `w-[18px] h-[18px] cursor-ew-resize bg-white shadow-md border rounded-full absolute -right-[9px] top-1/2 -translate-y-1/2 touch-none select-none ${activeSide === "right" ? "bg-blue-400 border-blue-300" : "hover:bg-blue-400 hover:border-blue-300"}`
13832
13832
  }
13833
13833
  )
13834
13834
  ]
@@ -13973,7 +13973,7 @@ var ButtonScale = ({ getReferenceRect }) => {
13973
13973
  }, [getReferenceRect, refs, update, virtualReference]);
13974
13974
  const showLeftHandle = currentAlign !== "left";
13975
13975
  const showRightHandle = currentAlign !== "right";
13976
- const handleBaseClass = "bg-background shadow-md border rounded-full absolute touch-none select-none pointer-events-auto";
13976
+ const handleBaseClass = "bg-white shadow-md border rounded-full absolute touch-none select-none pointer-events-auto";
13977
13977
  const getHandleActiveClass = (side) => activeSide === side ? "bg-blue-400 border-blue-300" : "hover:bg-blue-400 hover:border-blue-300";
13978
13978
  return /* @__PURE__ */ jsxs27(
13979
13979
  "div",
@@ -14186,7 +14186,7 @@ var ImageScale = ({ getReferenceRect }) => {
14186
14186
  const showTopRight = currentAlign !== "right";
14187
14187
  const showBottomLeft = currentAlign !== "left";
14188
14188
  const showBottomRight = currentAlign !== "right";
14189
- const handleBaseClass = "bg-background shadow-md border rounded-full absolute touch-none select-none pointer-events-auto";
14189
+ const handleBaseClass = "bg-white shadow-md border rounded-full absolute touch-none select-none pointer-events-auto";
14190
14190
  const getHandleActiveClass = (side) => activeSide === side ? "bg-blue-400 border-blue-300" : "hover:bg-blue-400 hover:border-blue-300";
14191
14191
  return /* @__PURE__ */ jsxs28(
14192
14192
  "div",
@@ -14364,7 +14364,7 @@ var SpacerScale = ({ getReferenceRect }) => {
14364
14364
  );
14365
14365
  return cleanup;
14366
14366
  }, [getReferenceRect, refs, update, virtualReference]);
14367
- const handleBaseClass = "bg-background shadow-md border rounded-full absolute touch-none select-none pointer-events-auto";
14367
+ const handleBaseClass = "bg-white shadow-md border rounded-full absolute touch-none select-none pointer-events-auto";
14368
14368
  const getHandleActiveClass = (side) => activeSide === side ? "bg-blue-400 border-blue-300" : "hover:bg-blue-400 hover:border-blue-300";
14369
14369
  return /* @__PURE__ */ jsxs29(
14370
14370
  "div",
@@ -14531,7 +14531,7 @@ var ColumnScale = ({ sectionColumnIdx, shadowRoot }) => {
14531
14531
  if (columnRects.length < 2 || columnWidths.length < 2) {
14532
14532
  return null;
14533
14533
  }
14534
- const handleBaseClass = "bg-background shadow-md border rounded-full touch-none select-none pointer-events-auto";
14534
+ const handleBaseClass = "bg-white shadow-md border rounded-full touch-none select-none pointer-events-auto";
14535
14535
  const getHandleActiveClass = (index) => activeDivider === index ? "bg-blue-400 border-blue-300" : "hover:bg-blue-400 hover:border-blue-300";
14536
14536
  return /* @__PURE__ */ jsx47(Fragment17, { children: columnRects.slice(0, -1).map((rect, index) => {
14537
14537
  const nextRect = columnRects[index + 1];
@@ -14702,6 +14702,16 @@ function validate_editor_onPreview(template, mergeFields) {
14702
14702
  const is_over_size_limit = templateSize > 50 * 1024;
14703
14703
  return { invalid_merge_fields, missing_links, is_over_size_limit, placeholder_property_images };
14704
14704
  }
14705
+ function validate_campaign_onCreate() {
14706
+ return true;
14707
+ }
14708
+ function campaign_validation_warnings() {
14709
+ return {
14710
+ invalid_merge_fields: true,
14711
+ missing_properties_attributes: true,
14712
+ missing_links: true
14713
+ };
14714
+ }
14705
14715
 
14706
14716
  // src/core/editor/components/preview.tsx
14707
14717
  import { jsx as jsx49, jsxs as jsxs30 } from "react/jsx-runtime";
@@ -16079,6 +16089,9 @@ export {
16079
16089
  SidebarProvider,
16080
16090
  useSidebarContext,
16081
16091
  Textarea,
16092
+ validate_editor_onPreview,
16093
+ validate_campaign_onCreate,
16094
+ campaign_validation_warnings,
16082
16095
  Preview,
16083
16096
  History,
16084
16097
  MAILLOW_EMAIL_EDITOR_VERSION,
@@ -5,7 +5,7 @@ import {
5
5
  MAILLOW_EMAIL_EDITOR_VERSION,
6
6
  Preview,
7
7
  useEditorStore
8
- } from "./chunk-B46UUREH.mjs";
8
+ } from "./chunk-R3LRNUKL.mjs";
9
9
  export {
10
10
  Editor,
11
11
  History,
package/dist/index.d.mts CHANGED
@@ -320,6 +320,38 @@ declare function TemplatePage({ templateId, initialTemplate, onSave, onToast, on
320
320
 
321
321
  declare const MAX_TEMPLATE_SIZE: number;
322
322
 
323
+ interface MergeFieldType {
324
+ label: string;
325
+ value: string;
326
+ }
327
+ interface MissingLinkType {
328
+ type: 'button' | 'social-item';
329
+ label: string;
330
+ }
331
+ interface PreviewValidationType {
332
+ invalid_merge_fields: string[];
333
+ missing_links: MissingLinkType[];
334
+ is_over_size_limit: boolean;
335
+ placeholder_property_images: number;
336
+ }
337
+
338
+ /**
339
+ * Validate a template when the user previews the template
340
+ */
341
+ declare function validate_editor_onPreview(template: any, mergeFields: MergeFieldType[]): PreviewValidationType;
342
+ /**
343
+ * Validate a campaign template when the user creates a new campaign
344
+ */
345
+ declare function validate_campaign_onCreate(): boolean;
346
+ /**
347
+ * Return validation warnings for a campaign template
348
+ */
349
+ declare function campaign_validation_warnings(): {
350
+ invalid_merge_fields: boolean;
351
+ missing_properties_attributes: boolean;
352
+ missing_links: boolean;
353
+ };
354
+
323
355
  /**
324
356
  * JSON to MJML Converter
325
357
  * Converts template JSON to MJML string for rendering
@@ -338,4 +370,4 @@ interface RenderOptions {
338
370
  */
339
371
  declare function json2mjml(template: TemplateJSON, mode?: RenderMode, options?: RenderOptions): string;
340
372
 
341
- 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 };
373
+ export { Editor, type ImageData, MAX_TEMPLATE_SIZE, type MergeField, type MergeFieldType, type MissingLinkType, type OnDeleteCallback, type OnDuplicateCallback, type OnExitCallback, type OnImageUploadCallback, type OnSaveCallback, type OnToastCallback, type PaidLevel, type PreviewValidationType, type TemplateJSON, TemplatePage, type ToastOptions, type ToastType, campaign_validation_warnings, json2mjml, validate_campaign_onCreate, validate_editor_onPreview };
package/dist/index.d.ts CHANGED
@@ -320,6 +320,38 @@ declare function TemplatePage({ templateId, initialTemplate, onSave, onToast, on
320
320
 
321
321
  declare const MAX_TEMPLATE_SIZE: number;
322
322
 
323
+ interface MergeFieldType {
324
+ label: string;
325
+ value: string;
326
+ }
327
+ interface MissingLinkType {
328
+ type: 'button' | 'social-item';
329
+ label: string;
330
+ }
331
+ interface PreviewValidationType {
332
+ invalid_merge_fields: string[];
333
+ missing_links: MissingLinkType[];
334
+ is_over_size_limit: boolean;
335
+ placeholder_property_images: number;
336
+ }
337
+
338
+ /**
339
+ * Validate a template when the user previews the template
340
+ */
341
+ declare function validate_editor_onPreview(template: any, mergeFields: MergeFieldType[]): PreviewValidationType;
342
+ /**
343
+ * Validate a campaign template when the user creates a new campaign
344
+ */
345
+ declare function validate_campaign_onCreate(): boolean;
346
+ /**
347
+ * Return validation warnings for a campaign template
348
+ */
349
+ declare function campaign_validation_warnings(): {
350
+ invalid_merge_fields: boolean;
351
+ missing_properties_attributes: boolean;
352
+ missing_links: boolean;
353
+ };
354
+
323
355
  /**
324
356
  * JSON to MJML Converter
325
357
  * Converts template JSON to MJML string for rendering
@@ -338,4 +370,4 @@ interface RenderOptions {
338
370
  */
339
371
  declare function json2mjml(template: TemplateJSON, mode?: RenderMode, options?: RenderOptions): string;
340
372
 
341
- 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 };
373
+ export { Editor, type ImageData, MAX_TEMPLATE_SIZE, type MergeField, type MergeFieldType, type MissingLinkType, type OnDeleteCallback, type OnDuplicateCallback, type OnExitCallback, type OnImageUploadCallback, type OnSaveCallback, type OnToastCallback, type PaidLevel, type PreviewValidationType, type TemplateJSON, TemplatePage, type ToastOptions, type ToastType, campaign_validation_warnings, json2mjml, validate_campaign_onCreate, validate_editor_onPreview };