@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.
package/dist/index.js CHANGED
@@ -1817,7 +1817,7 @@ var init_empty = __esm({
1817
1817
  version: "1.0.0",
1818
1818
  published: true,
1819
1819
  creator: "Kevin Guerrero",
1820
- image: "https://mzyngaqmbvhpgmmipndy.supabase.co/storage/v1/object/public/Maillow/placeholder_image.png",
1820
+ image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mN88P/BfwAJhAPkD+pMGAAAAABJRU5ErkJggg==",
1821
1821
  content: [
1822
1822
  {
1823
1823
  id: "main-body",
@@ -3544,7 +3544,7 @@ function getEditorStyles(isDragButtonHovered, textEditingIdx) {
3544
3544
  /* Merge field tags - dashed underline for {{variable}} patterns */
3545
3545
  .merge-field-tag {
3546
3546
 
3547
- background-color: var(--background);
3547
+ background-color: white;
3548
3548
  border-radius: 4px;
3549
3549
  padding: 0px;
3550
3550
  border: 1px solid var(--border);
@@ -4443,7 +4443,7 @@ var init_drag_button = __esm({
4443
4443
  zIndex: 49,
4444
4444
  opacity: isDragging ? 0.3 : 1
4445
4445
  },
4446
- 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",
4446
+ 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",
4447
4447
  children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react2.Move, { className: "w-4 h-4pointer-events-none", color: isDragButtonHovered ? "white" : "gray" })
4448
4448
  }
4449
4449
  );
@@ -11625,7 +11625,7 @@ var floatButtonVariants;
11625
11625
  var init_helper = __esm({
11626
11626
  "src/core/editor/components/float-ui/helper.ts"() {
11627
11627
  "use strict";
11628
- floatButtonVariants = "shadow-none transition-none cursor-pointer rounded-full h-[34px] w-[34px] p-0";
11628
+ floatButtonVariants = "shadow-none transition-none cursor-pointer rounded-full h-[34px] w-[34px] p-0 text-black";
11629
11629
  }
11630
11630
  });
11631
11631
 
@@ -11752,7 +11752,7 @@ var init_text_link_menu = __esm({
11752
11752
  Button,
11753
11753
  {
11754
11754
  variant: "ghost",
11755
- className: "shadow-none transition-none cursor-pointer rounded-full outline-none h-[34px]",
11755
+ className: "shadow-none transition-none cursor-pointer rounded-full outline-none h-[34px] text-black",
11756
11756
  onMouseDown: (e) => e.preventDefault(),
11757
11757
  children: [
11758
11758
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react14.LinkIcon, { className: "size-4" }),
@@ -12673,7 +12673,7 @@ var init_tiptap_overlay = __esm({
12673
12673
  text-align: inherit;
12674
12674
  }
12675
12675
  .tiptap-overlay .ProseMirror .merge-field-tag {
12676
- background-color: var(--background);
12676
+ background-color: white;
12677
12677
  border-radius: 4px;
12678
12678
  padding: 0px;
12679
12679
  border: 1px solid var(--border);
@@ -12756,7 +12756,7 @@ var init_delete_button = __esm({
12756
12756
  variant: "ghost",
12757
12757
  className: floatButtonVariants,
12758
12758
  onClick: handleDelete,
12759
- children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react16.TrashIcon, { className: "size-4" })
12759
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react16.TrashIcon, { className: "size-4 " })
12760
12760
  }
12761
12761
  ) }),
12762
12762
  /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TooltipContent, { side: "bottom", children: "Delete" })
@@ -13090,7 +13090,7 @@ var init_href_menu = __esm({
13090
13090
  Button,
13091
13091
  {
13092
13092
  variant: "ghost",
13093
- className: "shadow-none transition-none cursor-pointer rounded-full outline-none h-[34px]",
13093
+ className: "shadow-none transition-none cursor-pointer rounded-full outline-none h-[34px] text-black",
13094
13094
  children: [
13095
13095
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react19.LinkIcon, { className: "size-4" }),
13096
13096
  /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { children: "Add link" })
@@ -14067,7 +14067,7 @@ var init_mlsNumber_menu = __esm({
14067
14067
  Button,
14068
14068
  {
14069
14069
  variant: "ghost",
14070
- className: "shadow-none transition-none cursor-pointer rounded-full outline-none h-[34px]",
14070
+ className: "shadow-none transition-none cursor-pointer rounded-full outline-none h-[34px] text-black",
14071
14071
  children: [
14072
14072
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_lucide_react26.HousePlusIcon, { className: "size-4" }),
14073
14073
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { children: "MLS" })
@@ -14471,14 +14471,14 @@ var init_divider_scale = __esm({
14471
14471
  "div",
14472
14472
  {
14473
14473
  onPointerDown: (e) => handlePointerDown(e, "left"),
14474
- 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"}`
14474
+ 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"}`
14475
14475
  }
14476
14476
  ),
14477
14477
  showRightHandle && (activeSide === null || activeSide === "right") && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
14478
14478
  "div",
14479
14479
  {
14480
14480
  onPointerDown: (e) => handlePointerDown(e, "right"),
14481
- 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"}`
14481
+ 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"}`
14482
14482
  }
14483
14483
  )
14484
14484
  ]
@@ -14632,7 +14632,7 @@ var init_button_scale = __esm({
14632
14632
  }, [getReferenceRect, refs, update, virtualReference]);
14633
14633
  const showLeftHandle = currentAlign !== "left";
14634
14634
  const showRightHandle = currentAlign !== "right";
14635
- const handleBaseClass = "bg-background shadow-md border rounded-full absolute touch-none select-none pointer-events-auto";
14635
+ const handleBaseClass = "bg-white shadow-md border rounded-full absolute touch-none select-none pointer-events-auto";
14636
14636
  const getHandleActiveClass = (side) => activeSide === side ? "bg-blue-400 border-blue-300" : "hover:bg-blue-400 hover:border-blue-300";
14637
14637
  return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
14638
14638
  "div",
@@ -14854,7 +14854,7 @@ var init_image_scale = __esm({
14854
14854
  const showTopRight = currentAlign !== "right";
14855
14855
  const showBottomLeft = currentAlign !== "left";
14856
14856
  const showBottomRight = currentAlign !== "right";
14857
- const handleBaseClass = "bg-background shadow-md border rounded-full absolute touch-none select-none pointer-events-auto";
14857
+ const handleBaseClass = "bg-white shadow-md border rounded-full absolute touch-none select-none pointer-events-auto";
14858
14858
  const getHandleActiveClass = (side) => activeSide === side ? "bg-blue-400 border-blue-300" : "hover:bg-blue-400 hover:border-blue-300";
14859
14859
  return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
14860
14860
  "div",
@@ -15041,7 +15041,7 @@ var init_spacer_scale = __esm({
15041
15041
  );
15042
15042
  return cleanup;
15043
15043
  }, [getReferenceRect, refs, update, virtualReference]);
15044
- const handleBaseClass = "bg-background shadow-md border rounded-full absolute touch-none select-none pointer-events-auto";
15044
+ const handleBaseClass = "bg-white shadow-md border rounded-full absolute touch-none select-none pointer-events-auto";
15045
15045
  const getHandleActiveClass = (side) => activeSide === side ? "bg-blue-400 border-blue-300" : "hover:bg-blue-400 hover:border-blue-300";
15046
15046
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
15047
15047
  "div",
@@ -15217,7 +15217,7 @@ var init_column_scale = __esm({
15217
15217
  if (columnRects.length < 2 || columnWidths.length < 2) {
15218
15218
  return null;
15219
15219
  }
15220
- const handleBaseClass = "bg-background shadow-md border rounded-full touch-none select-none pointer-events-auto";
15220
+ const handleBaseClass = "bg-white shadow-md border rounded-full touch-none select-none pointer-events-auto";
15221
15221
  const getHandleActiveClass = (index) => activeDivider === index ? "bg-blue-400 border-blue-300" : "hover:bg-blue-400 hover:border-blue-300";
15222
15222
  return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_jsx_runtime47.Fragment, { children: columnRects.slice(0, -1).map((rect, index) => {
15223
15223
  const nextRect = columnRects[index + 1];
@@ -15409,6 +15409,16 @@ function validate_editor_onPreview(template, mergeFields) {
15409
15409
  const is_over_size_limit = templateSize > 50 * 1024;
15410
15410
  return { invalid_merge_fields, missing_links, is_over_size_limit, placeholder_property_images };
15411
15411
  }
15412
+ function validate_campaign_onCreate() {
15413
+ return true;
15414
+ }
15415
+ function campaign_validation_warnings() {
15416
+ return {
15417
+ invalid_merge_fields: true,
15418
+ missing_properties_attributes: true,
15419
+ missing_links: true
15420
+ };
15421
+ }
15412
15422
  var PROPERTY_CARD_TYPES;
15413
15423
  var init_validate = __esm({
15414
15424
  "src/validate/index.ts"() {
@@ -16804,7 +16814,10 @@ __export(index_exports, {
16804
16814
  Editor: () => Editor,
16805
16815
  MAX_TEMPLATE_SIZE: () => MAX_TEMPLATE_SIZE,
16806
16816
  TemplatePage: () => TemplatePage,
16807
- json2mjml: () => json2mjml
16817
+ campaign_validation_warnings: () => campaign_validation_warnings,
16818
+ json2mjml: () => json2mjml,
16819
+ validate_campaign_onCreate: () => validate_campaign_onCreate,
16820
+ validate_editor_onPreview: () => validate_editor_onPreview
16808
16821
  });
16809
16822
  module.exports = __toCommonJS(index_exports);
16810
16823
  init_core();
@@ -17024,19 +17037,23 @@ function TemplateHeader() {
17024
17037
  if (isSaving || !templateId || !onSave) return;
17025
17038
  setIsSaving(true);
17026
17039
  try {
17040
+ const PLACEHOLDER_IMAGE = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mN88P/BfwAJhAPkD+pMGAAAAABJRU5ErkJggg==";
17027
17041
  const template = useEditorStore.getState().template;
17042
+ const needsCapture = useEditorStore.getState().hasUnsavedChanges() || !template.image || template.image === PLACEHOLDER_IMAGE;
17028
17043
  let capturedImage;
17029
- try {
17030
- const { default: mjml2html } = await import("mjml-browser");
17031
- const mjmlString = json2mjml(template, "editing");
17032
- const result = mjml2html(mjmlString);
17033
- capturedImage = await captureTemplateImage(result.html);
17034
- } catch (err) {
17035
- console.error("[TemplateCapture] Failed:", err?.message || JSON.stringify(err) || err, err?.stack || "");
17044
+ if (needsCapture) {
17045
+ try {
17046
+ const { default: mjml2html } = await import("mjml-browser");
17047
+ const mjmlString = json2mjml(template, "editing");
17048
+ const result = mjml2html(mjmlString);
17049
+ capturedImage = await captureTemplateImage(result.html);
17050
+ } catch (err) {
17051
+ console.error("[TemplateCapture] Failed:", err?.message || JSON.stringify(err) || err, err?.stack || "");
17052
+ }
17036
17053
  }
17037
17054
  await onSave(templateId, template, capturedImage);
17038
- markAsSaved();
17039
17055
  onExit?.();
17056
+ markAsSaved();
17040
17057
  } catch (error) {
17041
17058
  console.error("Failed to save:", error);
17042
17059
  } finally {
@@ -19579,7 +19596,7 @@ init_editor();
19579
19596
  init_label();
19580
19597
  init_popover();
19581
19598
 
19582
- // node_modules/color-name/index.js
19599
+ // node_modules/color-string/node_modules/color-name/index.js
19583
19600
  var colors = {
19584
19601
  aliceblue: [240, 248, 255],
19585
19602
  antiquewhite: [250, 235, 215],
@@ -19901,10 +19918,164 @@ function hexDouble(number_) {
19901
19918
  }
19902
19919
  var color_string_default = cs;
19903
19920
 
19904
- // node_modules/color-convert/conversions.js
19921
+ // node_modules/color/node_modules/color-name/index.js
19922
+ var colors2 = {
19923
+ aliceblue: [240, 248, 255],
19924
+ antiquewhite: [250, 235, 215],
19925
+ aqua: [0, 255, 255],
19926
+ aquamarine: [127, 255, 212],
19927
+ azure: [240, 255, 255],
19928
+ beige: [245, 245, 220],
19929
+ bisque: [255, 228, 196],
19930
+ black: [0, 0, 0],
19931
+ blanchedalmond: [255, 235, 205],
19932
+ blue: [0, 0, 255],
19933
+ blueviolet: [138, 43, 226],
19934
+ brown: [165, 42, 42],
19935
+ burlywood: [222, 184, 135],
19936
+ cadetblue: [95, 158, 160],
19937
+ chartreuse: [127, 255, 0],
19938
+ chocolate: [210, 105, 30],
19939
+ coral: [255, 127, 80],
19940
+ cornflowerblue: [100, 149, 237],
19941
+ cornsilk: [255, 248, 220],
19942
+ crimson: [220, 20, 60],
19943
+ cyan: [0, 255, 255],
19944
+ darkblue: [0, 0, 139],
19945
+ darkcyan: [0, 139, 139],
19946
+ darkgoldenrod: [184, 134, 11],
19947
+ darkgray: [169, 169, 169],
19948
+ darkgreen: [0, 100, 0],
19949
+ darkgrey: [169, 169, 169],
19950
+ darkkhaki: [189, 183, 107],
19951
+ darkmagenta: [139, 0, 139],
19952
+ darkolivegreen: [85, 107, 47],
19953
+ darkorange: [255, 140, 0],
19954
+ darkorchid: [153, 50, 204],
19955
+ darkred: [139, 0, 0],
19956
+ darksalmon: [233, 150, 122],
19957
+ darkseagreen: [143, 188, 143],
19958
+ darkslateblue: [72, 61, 139],
19959
+ darkslategray: [47, 79, 79],
19960
+ darkslategrey: [47, 79, 79],
19961
+ darkturquoise: [0, 206, 209],
19962
+ darkviolet: [148, 0, 211],
19963
+ deeppink: [255, 20, 147],
19964
+ deepskyblue: [0, 191, 255],
19965
+ dimgray: [105, 105, 105],
19966
+ dimgrey: [105, 105, 105],
19967
+ dodgerblue: [30, 144, 255],
19968
+ firebrick: [178, 34, 34],
19969
+ floralwhite: [255, 250, 240],
19970
+ forestgreen: [34, 139, 34],
19971
+ fuchsia: [255, 0, 255],
19972
+ gainsboro: [220, 220, 220],
19973
+ ghostwhite: [248, 248, 255],
19974
+ gold: [255, 215, 0],
19975
+ goldenrod: [218, 165, 32],
19976
+ gray: [128, 128, 128],
19977
+ green: [0, 128, 0],
19978
+ greenyellow: [173, 255, 47],
19979
+ grey: [128, 128, 128],
19980
+ honeydew: [240, 255, 240],
19981
+ hotpink: [255, 105, 180],
19982
+ indianred: [205, 92, 92],
19983
+ indigo: [75, 0, 130],
19984
+ ivory: [255, 255, 240],
19985
+ khaki: [240, 230, 140],
19986
+ lavender: [230, 230, 250],
19987
+ lavenderblush: [255, 240, 245],
19988
+ lawngreen: [124, 252, 0],
19989
+ lemonchiffon: [255, 250, 205],
19990
+ lightblue: [173, 216, 230],
19991
+ lightcoral: [240, 128, 128],
19992
+ lightcyan: [224, 255, 255],
19993
+ lightgoldenrodyellow: [250, 250, 210],
19994
+ lightgray: [211, 211, 211],
19995
+ lightgreen: [144, 238, 144],
19996
+ lightgrey: [211, 211, 211],
19997
+ lightpink: [255, 182, 193],
19998
+ lightsalmon: [255, 160, 122],
19999
+ lightseagreen: [32, 178, 170],
20000
+ lightskyblue: [135, 206, 250],
20001
+ lightslategray: [119, 136, 153],
20002
+ lightslategrey: [119, 136, 153],
20003
+ lightsteelblue: [176, 196, 222],
20004
+ lightyellow: [255, 255, 224],
20005
+ lime: [0, 255, 0],
20006
+ limegreen: [50, 205, 50],
20007
+ linen: [250, 240, 230],
20008
+ magenta: [255, 0, 255],
20009
+ maroon: [128, 0, 0],
20010
+ mediumaquamarine: [102, 205, 170],
20011
+ mediumblue: [0, 0, 205],
20012
+ mediumorchid: [186, 85, 211],
20013
+ mediumpurple: [147, 112, 219],
20014
+ mediumseagreen: [60, 179, 113],
20015
+ mediumslateblue: [123, 104, 238],
20016
+ mediumspringgreen: [0, 250, 154],
20017
+ mediumturquoise: [72, 209, 204],
20018
+ mediumvioletred: [199, 21, 133],
20019
+ midnightblue: [25, 25, 112],
20020
+ mintcream: [245, 255, 250],
20021
+ mistyrose: [255, 228, 225],
20022
+ moccasin: [255, 228, 181],
20023
+ navajowhite: [255, 222, 173],
20024
+ navy: [0, 0, 128],
20025
+ oldlace: [253, 245, 230],
20026
+ olive: [128, 128, 0],
20027
+ olivedrab: [107, 142, 35],
20028
+ orange: [255, 165, 0],
20029
+ orangered: [255, 69, 0],
20030
+ orchid: [218, 112, 214],
20031
+ palegoldenrod: [238, 232, 170],
20032
+ palegreen: [152, 251, 152],
20033
+ paleturquoise: [175, 238, 238],
20034
+ palevioletred: [219, 112, 147],
20035
+ papayawhip: [255, 239, 213],
20036
+ peachpuff: [255, 218, 185],
20037
+ peru: [205, 133, 63],
20038
+ pink: [255, 192, 203],
20039
+ plum: [221, 160, 221],
20040
+ powderblue: [176, 224, 230],
20041
+ purple: [128, 0, 128],
20042
+ rebeccapurple: [102, 51, 153],
20043
+ red: [255, 0, 0],
20044
+ rosybrown: [188, 143, 143],
20045
+ royalblue: [65, 105, 225],
20046
+ saddlebrown: [139, 69, 19],
20047
+ salmon: [250, 128, 114],
20048
+ sandybrown: [244, 164, 96],
20049
+ seagreen: [46, 139, 87],
20050
+ seashell: [255, 245, 238],
20051
+ sienna: [160, 82, 45],
20052
+ silver: [192, 192, 192],
20053
+ skyblue: [135, 206, 235],
20054
+ slateblue: [106, 90, 205],
20055
+ slategray: [112, 128, 144],
20056
+ slategrey: [112, 128, 144],
20057
+ snow: [255, 250, 250],
20058
+ springgreen: [0, 255, 127],
20059
+ steelblue: [70, 130, 180],
20060
+ tan: [210, 180, 140],
20061
+ teal: [0, 128, 128],
20062
+ thistle: [216, 191, 216],
20063
+ tomato: [255, 99, 71],
20064
+ turquoise: [64, 224, 208],
20065
+ violet: [238, 130, 238],
20066
+ wheat: [245, 222, 179],
20067
+ white: [255, 255, 255],
20068
+ whitesmoke: [245, 245, 245],
20069
+ yellow: [255, 255, 0],
20070
+ yellowgreen: [154, 205, 50]
20071
+ };
20072
+ for (const key in colors2) Object.freeze(colors2[key]);
20073
+ var color_name_default2 = Object.freeze(colors2);
20074
+
20075
+ // node_modules/color/node_modules/color-convert/conversions.js
19905
20076
  var reverseKeywords = {};
19906
- for (const key of Object.keys(color_name_default)) {
19907
- reverseKeywords[color_name_default[key]] = key;
20077
+ for (const key of Object.keys(color_name_default2)) {
20078
+ reverseKeywords[color_name_default2[key]] = key;
19908
20079
  }
19909
20080
  var convert = {
19910
20081
  rgb: { channels: 3, labels: "rgb" },
@@ -20080,8 +20251,8 @@ convert.rgb.keyword = function(rgb) {
20080
20251
  }
20081
20252
  let currentClosestDistance = Number.POSITIVE_INFINITY;
20082
20253
  let currentClosestKeyword;
20083
- for (const keyword of Object.keys(color_name_default)) {
20084
- const value = color_name_default[keyword];
20254
+ for (const keyword of Object.keys(color_name_default2)) {
20255
+ const value = color_name_default2[keyword];
20085
20256
  const distance = comparativeDistance(rgb, value);
20086
20257
  if (distance < currentClosestDistance) {
20087
20258
  currentClosestDistance = distance;
@@ -20091,7 +20262,7 @@ convert.rgb.keyword = function(rgb) {
20091
20262
  return currentClosestKeyword;
20092
20263
  };
20093
20264
  convert.keyword.rgb = function(keyword) {
20094
- return [...color_name_default[keyword]];
20265
+ return [...color_name_default2[keyword]];
20095
20266
  };
20096
20267
  convert.rgb.xyz = function(rgb) {
20097
20268
  const r = srgbNonlinearTransformInv(rgb[0] / 255);
@@ -20649,7 +20820,7 @@ convert.rgb.gray = function(rgb) {
20649
20820
  return [value / 255 * 100];
20650
20821
  };
20651
20822
 
20652
- // node_modules/color-convert/route.js
20823
+ // node_modules/color/node_modules/color-convert/route.js
20653
20824
  function buildGraph() {
20654
20825
  const graph = {};
20655
20826
  const models2 = Object.keys(conversions_default);
@@ -20715,7 +20886,7 @@ function route(fromModel) {
20715
20886
  }
20716
20887
  var route_default = route;
20717
20888
 
20718
- // node_modules/color-convert/index.js
20889
+ // node_modules/color/node_modules/color-convert/index.js
20719
20890
  var convert2 = {};
20720
20891
  var models = Object.keys(conversions_default);
20721
20892
  function wrapRaw(fn) {
@@ -21352,7 +21523,7 @@ var ColorPickerEyeDropper = ({ className, ...props }) => {
21352
21523
  return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
21353
21524
  Button,
21354
21525
  {
21355
- className: cn("shrink-0 text-muted-foreground", className),
21526
+ className: cn("shrink-0 text-muted-foreground shadow-none", className),
21356
21527
  onClick: handleEyeDropper,
21357
21528
  size: "icon",
21358
21529
  type: "button",
@@ -21384,26 +21555,23 @@ var ColorPickerFormat = ({ className, ...props }) => {
21384
21555
  const color = color_default.hsl(hue, saturation, lightness, alpha2 / 100);
21385
21556
  if (mode === "hex") {
21386
21557
  const hex = color.hex();
21387
- return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
21558
+ return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
21388
21559
  "div",
21389
21560
  {
21390
21561
  className: cn(
21391
- "-space-x-px relative flex w-full items-center rounded-md shadow-sm",
21562
+ "-space-x-px relative flex w-full items-center rounded-[12px] shadow-none",
21392
21563
  className
21393
21564
  ),
21394
21565
  ...props,
21395
- children: [
21396
- /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
21397
- Input,
21398
- {
21399
- className: "h-8 rounded-r-none bg-secondary px-2 text-xs shadow-none",
21400
- readOnly: true,
21401
- type: "text",
21402
- value: hex
21403
- }
21404
- ),
21405
- /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(PercentageInput, { value: alpha2 })
21406
- ]
21566
+ children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
21567
+ Input,
21568
+ {
21569
+ className: "h-[32px] py-0 pr-10 bg-accent dark:bg-accent border-border placeholder:text-muted-foreground rounded-[12px] shadow-none w-full",
21570
+ readOnly: true,
21571
+ type: "text",
21572
+ value: hex
21573
+ }
21574
+ )
21407
21575
  }
21408
21576
  );
21409
21577
  }
@@ -21539,7 +21707,8 @@ var TRANSPARENT_ALLOWED_ELEMENTS = [
21539
21707
  "socialBgColor",
21540
21708
  "buttonBgColor",
21541
21709
  "highlightColor",
21542
- "propertyBgColor"
21710
+ "propertyBgColor",
21711
+ "dividerBgColor"
21543
21712
  ];
21544
21713
  var rgbToHex2 = (rgb) => {
21545
21714
  const match = rgb.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/i);
@@ -21631,14 +21800,11 @@ function ColorSelection({ setActiveView, lastView, onColorSelect, colorType = "C
21631
21800
  ] }) })
21632
21801
  ] }),
21633
21802
  colorPalettes.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "w-full mb-4", children: [
21634
- /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "flex flex-row items-center justify-between w-full mb-1", children: [
21635
- /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "flex flex-row items-center gap-2 h-[44px]", children: [
21636
- /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_lucide_react49.Hexagon, { className: "w-4 h-4 text-muted-foreground" }),
21637
- /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("p", { className: "text-sm font-medium", children: "Brand colors" })
21638
- ] }),
21639
- /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Button, { variant: "link", className: "text-sm pr-0 cursor-pointer", children: "Edit" })
21640
- ] }),
21641
- /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "w-full flex flex-col gap-4", children: colorPalettes.map((palette) => /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "flex flex-col gap-2", children: [
21803
+ /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "flex flex-row items-center justify-between w-full mb-1", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "flex flex-row items-center gap-2 h-[44px]", children: [
21804
+ /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_lucide_react49.Hexagon, { className: "w-4 h-4 text-muted-foreground" }),
21805
+ /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("p", { className: "text-sm font-medium", children: "Brand colors" })
21806
+ ] }) }),
21807
+ /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "w-full flex flex-col gap-4", children: colorPalettes.map((palette) => palette.colors.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "flex flex-col gap-2", children: [
21642
21808
  /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Label, { className: "text-xs font-medium text-muted-foreground", children: palette.name }),
21643
21809
  /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "w-full grid grid-cols-7 gap-2", children: palette.colors.map((c) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(ColorButton, { colorName: c.name, color: c.hex, onColorSelect, currentColor }, c.color_id)) })
21644
21810
  ] }, palette.palette_id)) })
@@ -22720,7 +22886,7 @@ function ParentBreadcrumb() {
22720
22886
  /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(BreadcrumbItem, { children: /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(Tooltip, { children: [
22721
22887
  /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: "relative", children: [
22722
22888
  /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Button, { variant: "ghost", disabled: true, className: "p-0 px-1.5 shadow-none transition-none cursor-pointer", children: currentName }),
22723
- /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { className: "absolute right-0 top-0 bottom-0 w-[50%] bg-gradient-to-r from-transparent to-white pointer-events-none" })
22889
+ /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { className: "absolute right-0 top-0 bottom-0 w-[50%] bg-gradient-to-r from-transparent to-background pointer-events-none" })
22724
22890
  ] }) }),
22725
22891
  /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: currentName })
22726
22892
  ] }) })
@@ -23341,7 +23507,7 @@ var FontSizeControl = (0, import_react65.memo)(function FontSizeControl2({
23341
23507
  Button,
23342
23508
  {
23343
23509
  variant: "ghost",
23344
- className: "shadow-none transition-none cursor-pointer bg-transparent border border-r-0 rounded-[12px]",
23510
+ className: "shadow-none transition-none cursor-pointer bg-transparent border border-border border-r-0 rounded-[12px]",
23345
23511
  size: "icon",
23346
23512
  "aria-label": "Decrease Font Size",
23347
23513
  onClick: handleDecrease,
@@ -23357,7 +23523,7 @@ var FontSizeControl = (0, import_react65.memo)(function FontSizeControl2({
23357
23523
  InputGroupInput,
23358
23524
  {
23359
23525
  type: "number",
23360
- className: "text-center w-12 border-0 shadow-none px-0",
23526
+ className: "text-center w-12 border-0 shadow-none px-0 bg-background",
23361
23527
  placeholder: "--",
23362
23528
  value: input.displayValue,
23363
23529
  onChange: (e) => input.setLocalValue(e.target.value),
@@ -23401,7 +23567,7 @@ var FontSizeControl = (0, import_react65.memo)(function FontSizeControl2({
23401
23567
  Button,
23402
23568
  {
23403
23569
  variant: "ghost",
23404
- className: "shadow-none transition-none cursor-pointer bg-transparent border border-l-0 rounded-[12px]",
23570
+ className: "shadow-none transition-none cursor-pointer bg-transparent border border-border border-l-0 rounded-[12px]",
23405
23571
  size: "icon",
23406
23572
  "aria-label": "Increase Font Size",
23407
23573
  onClick: handleIncrease,
@@ -24129,6 +24295,15 @@ var parseFontSize = (value) => {
24129
24295
  // src/core/editor/components/element-gear/text/toolbar.tsx
24130
24296
  var import_jsx_runtime102 = require("react/jsx-runtime");
24131
24297
  var ALIGNMENTS = ["left", "center", "right", "justify"];
24298
+ var TEXT_TYPE_TO_BRAND_FONT = {
24299
+ h1: "heading",
24300
+ h2: "subheading",
24301
+ h3: "subheading",
24302
+ paragraph: "body",
24303
+ list: "body",
24304
+ "numbered-list": "body",
24305
+ ordered: "body"
24306
+ };
24132
24307
  var HEADING_MULTIPLIERS = {
24133
24308
  paragraph: 1,
24134
24309
  h1: 2,
@@ -24148,7 +24323,16 @@ var TextToolbar = () => {
24148
24323
  const textEditingStyles = useEditorStore((s) => s.textEditing?.styles);
24149
24324
  const template = useEditorStore((s) => s.template);
24150
24325
  const mergeFields = useEditorStore((s) => s.mergeFields);
24326
+ const userData = useEditorStore((s) => s.userData);
24151
24327
  const { activeView, colorTarget, setActiveView, setColorType, setColorTarget } = useSidebarContext();
24328
+ const brandFonts = (0, import_react71.useMemo)(() => {
24329
+ const fonts = userData?.brand_kits?.[0]?.fonts ?? [];
24330
+ const map = {};
24331
+ for (const f of fonts) {
24332
+ map[f.type] = f;
24333
+ }
24334
+ return map;
24335
+ }, [userData]);
24152
24336
  const [updateCounter, forceUpdate] = (0, import_react71.useState)(0);
24153
24337
  const [overflowOpen, setOverflowOpen] = (0, import_react71.useState)(false);
24154
24338
  const isInSectionColumn = (0, import_react71.useMemo)(() => {
@@ -24272,8 +24456,28 @@ var TextToolbar = () => {
24272
24456
  };
24273
24457
  const level = levelMap[type];
24274
24458
  tiptapEditor.chain().focus().setHeadingLevel(level).run();
24459
+ const brandFontType = TEXT_TYPE_TO_BRAND_FONT[type];
24460
+ const brandFont = brandFontType ? brandFonts[brandFontType] : null;
24461
+ if (brandFont) {
24462
+ const { from, to } = tiptapEditor.state.selection;
24463
+ const $from = tiptapEditor.state.doc.resolve(from);
24464
+ const paragraphStart = $from.start($from.depth);
24465
+ const paragraphEnd = $from.end($from.depth);
24466
+ let chain = tiptapEditor.chain().setTextSelection({ from: paragraphStart, to: paragraphEnd }).setFontFamily(brandFont.family).setFontSize(`${brandFont.size}px`);
24467
+ if (level > 0 && !brandFont.isBold) {
24468
+ chain = chain.unsetMark("bold");
24469
+ } else if (level === 0 && brandFont.isBold) {
24470
+ chain = chain.setMark("bold");
24471
+ }
24472
+ if (brandFont.isItalic) {
24473
+ chain = chain.setMark("italic");
24474
+ } else {
24475
+ chain = chain.unsetMark("italic");
24476
+ }
24477
+ chain.setTextSelection({ from, to }).focus().run();
24478
+ }
24275
24479
  forceUpdate((n) => n + 1);
24276
- }, [tiptapEditor]);
24480
+ }, [tiptapEditor, brandFonts]);
24277
24481
  const handleDelete = () => {
24278
24482
  if (focusIdx) {
24279
24483
  deleteElement(focusIdx);
@@ -25458,7 +25662,7 @@ var ButtonToolbar = () => {
25458
25662
  className: "shadow-none transition-none cursor-pointer",
25459
25663
  size: "icon",
25460
25664
  onClick: handleCycleButtonAlign,
25461
- children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("img", { src: ALIGNMENT_ICONS[currentButtonAlign], alt: "Align", className: "w-4 h-4" })
25665
+ children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("img", { src: ALIGNMENT_ICONS[currentButtonAlign], alt: "Align", className: "w-4 h-4 dark:invert" })
25462
25666
  }
25463
25667
  ) }),
25464
25668
  /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(TooltipContent, { side: "bottom", children: "Align" })
@@ -26698,14 +26902,10 @@ var SocialToolbar = () => {
26698
26902
  className: "shadow-none transition-none cursor-pointer",
26699
26903
  size: "icon",
26700
26904
  onClick: handleCycleAlign,
26701
- children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("img", { src: ALIGNMENT_ICONS[currentAlign], alt: "Align", className: "w-4 h-4" })
26905
+ children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)("img", { src: ALIGNMENT_ICONS[currentAlign], alt: "Align", className: "w-4 h-4 dark:invert" })
26702
26906
  }
26703
26907
  ) }),
26704
- /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(TooltipContent, { side: "bottom", className: "z-51", children: [
26705
- "Align (",
26706
- currentAlign,
26707
- ")"
26708
- ] })
26908
+ /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: "Align" })
26709
26909
  ] })
26710
26910
  ] })
26711
26911
  ] });
@@ -27297,7 +27497,7 @@ var DividerToolbar = () => {
27297
27497
  className: "shadow-none transition-none cursor-pointer",
27298
27498
  size: "icon",
27299
27499
  onClick: handleCycleAlign,
27300
- children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("img", { src: ALIGNMENT_ICONS[currentAlign], alt: "Align", className: "w-4 h-4" })
27500
+ children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("img", { src: ALIGNMENT_ICONS[currentAlign], alt: "Align", className: "w-4 h-4 dark:invert" })
27301
27501
  }
27302
27502
  ) }),
27303
27503
  /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(TooltipContent, { side: "bottom", className: "z-51", children: "Align" })
@@ -27415,7 +27615,7 @@ var ImageToolbar = () => {
27415
27615
  className: "shadow-none transition-none cursor-pointer",
27416
27616
  size: "icon",
27417
27617
  onClick: handleCycleAlign,
27418
- children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("img", { src: ALIGNMENT_ICONS[currentAlign], alt: "Align", className: "w-4 h-4" })
27618
+ children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("img", { src: ALIGNMENT_ICONS[currentAlign], alt: "Align", className: "w-4 h-4 dark:invert" })
27419
27619
  }
27420
27620
  ) }),
27421
27621
  /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(TooltipContent, { side: "bottom", children: "Align" })
@@ -28811,11 +29011,15 @@ function TemplatePage({
28811
29011
 
28812
29012
  // src/index.tsx
28813
29013
  init_configuration();
29014
+ init_validate();
28814
29015
  init_json2mjml();
28815
29016
  // Annotate the CommonJS export names for ESM import in node:
28816
29017
  0 && (module.exports = {
28817
29018
  Editor,
28818
29019
  MAX_TEMPLATE_SIZE,
28819
29020
  TemplatePage,
28820
- json2mjml
29021
+ campaign_validation_warnings,
29022
+ json2mjml,
29023
+ validate_campaign_onCreate,
29024
+ validate_editor_onPreview
28821
29025
  });