@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.
@@ -1,5 +1,5 @@
1
1
  // src/core/index.tsx
2
- import { useMemo as useMemo16, useState as useState16, useEffect as useEffect20, useCallback as useCallback16, useRef as useRef11 } from "react";
2
+ import { useMemo as useMemo17, useState as useState16, useEffect as useEffect20, useCallback as useCallback17, useRef as useRef11 } from "react";
3
3
  import { cloneDeep as cloneDeep2, isEqual, debounce } from "lodash";
4
4
 
5
5
  // src/core/utils/idx.ts
@@ -1871,7 +1871,6 @@ var defaultTemplate = {
1871
1871
  id: page.id || generateId()
1872
1872
  }))
1873
1873
  };
1874
- var MAX_PAID_LEVEL = 3;
1875
1874
  var useEditorStore = create()(
1876
1875
  devtools(
1877
1876
  immer((set) => ({
@@ -1880,6 +1879,7 @@ var useEditorStore = create()(
1880
1879
  templateId: null,
1881
1880
  onSave: null,
1882
1881
  onToast: null,
1882
+ onExit: null,
1883
1883
  previewMode: false,
1884
1884
  focusIdx: null,
1885
1885
  hoverIdx: null,
@@ -1903,14 +1903,20 @@ var useEditorStore = create()(
1903
1903
  isSaving: false,
1904
1904
  // Subscription level (0 = free, 1-3 = paid tiers)
1905
1905
  isPaidLevel: 0,
1906
+ // User data
1907
+ images: [],
1908
+ userData: null,
1906
1909
  // Initialize store with external template (for npm package usage)
1907
- initializeWithTemplate: (templateId, template, onSave, onToast, isPaidLevel) => {
1910
+ initializeWithTemplate: (templateId, template, onSave, onToast, data, onExit) => {
1908
1911
  set((state) => {
1909
1912
  state.templateId = templateId;
1910
1913
  state.template = template;
1911
1914
  state.onSave = onSave ?? null;
1912
1915
  state.onToast = onToast ?? null;
1913
- state.isPaidLevel = isPaidLevel ?? 0;
1916
+ state.onExit = onExit ?? null;
1917
+ state.isPaidLevel = data?.isPaidLevel ?? 0;
1918
+ state.images = data?.images ?? [];
1919
+ state.userData = data?.userData ?? null;
1914
1920
  state.templateSize = calculateTemplateSize(template);
1915
1921
  state.isAtSizeLimit = false;
1916
1922
  state.history = [cloneDeep(template)];
@@ -3138,6 +3144,17 @@ var LINK_TYPES = [
3138
3144
  prefix: "tel:"
3139
3145
  }
3140
3146
  ];
3147
+ var LINK_PRESETS = {
3148
+ Phone: [
3149
+ { label: "Personal Phone", key: "personal_phone_number" },
3150
+ { label: "Office Phone", key: "office_phone_number" },
3151
+ { label: "Business Phone", key: "business_phone_number" }
3152
+ ],
3153
+ Website: [
3154
+ { label: "Team Website", key: "team_website" },
3155
+ { label: "Brokerage Website", key: "brokerage_website" }
3156
+ ]
3157
+ };
3141
3158
  var detectLinkType = (href) => {
3142
3159
  if (href.startsWith("mailto:")) return LINK_TYPES[0];
3143
3160
  if (href.startsWith("tel:")) return LINK_TYPES[2];
@@ -3164,7 +3181,18 @@ var MAX_LINE_HEIGHT = 3;
3164
3181
  var LINE_HEIGHT_STEP = 0.1;
3165
3182
  var HIDDEN_SELECTION_VISUAL_ELEMENTS = ["text", "divider", "column"];
3166
3183
  var NOT_DRAGGABLE_ELEMENTS = ["page", "social-item", "text", "property-card", "property-card-single-two", "property-card-triple", "property-card-triple-item"];
3167
- var IMAGE_SELECTION_VALID_TYPES = ["section", "section-column", "image", "section-property-km", "section-property-single-two", "section-property-triple", "property-card", "property-card-single-two", "property-card-triple", "property-card-triple-item"];
3184
+ var EDITOR_COLORS = {
3185
+ /** Purple — drag/drop state */
3186
+ drag: {
3187
+ solid: "rgb(59, 130, 246)",
3188
+ half: "rgba(59, 130, 246, 0.5)"
3189
+ },
3190
+ /** Blue — hover/selection state */
3191
+ hover: {
3192
+ solid: "rgb(59, 130, 246)",
3193
+ half: "rgba(59, 130, 246, 0.5)"
3194
+ }
3195
+ };
3168
3196
 
3169
3197
  // src/core/editor/components/ShadowDomRenderer.tsx
3170
3198
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -3192,32 +3220,32 @@ function getEditorStyles(isDragButtonHovered, textEditingIdx) {
3192
3220
 
3193
3221
  /* Hover state - uses CSS variable for dynamic color */
3194
3222
  .${EMAIL_BLOCK_CLASS_NAME}.is-hovered {
3195
- outline-color: var(--outline-color-hover, rgba(59, 130, 246, 0.5));
3223
+ outline-color: var(--outline-color-hover, ${EDITOR_COLORS.hover.half});
3196
3224
  }
3197
3225
 
3198
3226
  /* Selected state - uses CSS variable for dynamic color */
3199
3227
  .${EMAIL_BLOCK_CLASS_NAME}.is-selected {
3200
- outline-color: var(--outline-color, rgb(59, 130, 246));
3228
+ outline-color: var(--outline-color, ${EDITOR_COLORS.hover.solid});
3201
3229
  }
3202
3230
 
3203
3231
  /* Drop target state - highlight section being dropped into */
3204
3232
  .${EMAIL_BLOCK_CLASS_NAME}.is-drop-target {
3205
- outline-color: rgb(147, 51, 234) !important;
3233
+ outline-color: ${EDITOR_COLORS.drag.solid} !important;
3206
3234
  }
3207
3235
 
3208
3236
  /* Column selection in section-column - 50% opacity blue */
3209
3237
  .${EMAIL_BLOCK_CLASS_NAME}.is-column-selected {
3210
- outline-color: rgba(59, 130, 246, 0.5);
3238
+ outline-color: ${EDITOR_COLORS.hover.half};
3211
3239
  }
3212
3240
 
3213
3241
  /* Column hover when child element is hovered - 50% opacity blue */
3214
3242
  .${EMAIL_BLOCK_CLASS_NAME}.is-column-hover-parent {
3215
- outline-color: rgba(59, 130, 246, 0.5);
3243
+ outline-color: ${EDITOR_COLORS.hover.half};
3216
3244
  }
3217
3245
 
3218
3246
  /* Card selection in property-card-triple - 50% opacity blue */
3219
3247
  .${EMAIL_BLOCK_CLASS_NAME}.is-card-selected {
3220
- outline-color: rgba(59, 130, 246, 0.5);
3248
+ outline-color: ${EDITOR_COLORS.hover.half};
3221
3249
  }
3222
3250
 
3223
3251
  /* Hide selection visual for configured elements (unless drag button hovered) */
@@ -3237,12 +3265,12 @@ function getEditorStyles(isDragButtonHovered, textEditingIdx) {
3237
3265
  outline-color: transparent !important;
3238
3266
  }
3239
3267
  .node-type-button.is-selected > table {
3240
- outline: 2px solid var(--outline-color, rgb(59, 130, 246));
3268
+ outline: 2px solid var(--outline-color, ${EDITOR_COLORS.hover.solid});
3241
3269
  outline-offset: -2px;
3242
3270
  border-radius: 2px;
3243
3271
  }
3244
3272
  .node-type-button.is-hovered:not(.is-selected) > table {
3245
- outline: 2px solid var(--outline-color-hover, rgba(59, 130, 246, 0.5));
3273
+ outline: 2px solid var(--outline-color-hover, ${EDITOR_COLORS.hover.half});
3246
3274
  outline-offset: -2px;
3247
3275
  border-radius: 2px;
3248
3276
  }
@@ -3255,12 +3283,12 @@ function getEditorStyles(isDragButtonHovered, textEditingIdx) {
3255
3283
  outline-color: transparent !important;
3256
3284
  }
3257
3285
  .node-type-image.is-selected table td {
3258
- outline: 2px solid var(--outline-color, rgb(59, 130, 246));
3286
+ outline: 2px solid var(--outline-color, ${EDITOR_COLORS.hover.solid});
3259
3287
  outline-offset: -2px;
3260
3288
  border-radius: 2px;
3261
3289
  }
3262
3290
  .node-type-image.is-hovered:not(.is-selected) table td {
3263
- outline: 2px solid var(--outline-color-hover, rgba(59, 130, 246, 0.5));
3291
+ outline: 2px solid var(--outline-color-hover, ${EDITOR_COLORS.hover.half});
3264
3292
  outline-offset: -2px;
3265
3293
  border-radius: 2px;
3266
3294
  }
@@ -3278,7 +3306,7 @@ function getEditorStyles(isDragButtonHovered, textEditingIdx) {
3278
3306
  /* Drop indicator - uses CSS variable for dynamic color */
3279
3307
  .drop-indicator {
3280
3308
  position: absolute;
3281
- background-color: var(--outline-color, rgb(59, 130, 246));
3309
+ background-color: var(--outline-color, ${EDITOR_COLORS.hover.solid});
3282
3310
  pointer-events: none;
3283
3311
  z-index: 1000;
3284
3312
  }
@@ -3589,8 +3617,8 @@ var ShadowDomRenderer = memo(function ShadowDomRenderer2({
3589
3617
  contentWrapper.className = "shadow-content";
3590
3618
  contentWrapper.innerHTML = html;
3591
3619
  contentWrapper.style.setProperty("--company-footer-opacity", showCompanyFooter ? "1" : "0.25");
3592
- contentWrapper.style.setProperty("--outline-color", isDragging ? "rgb(147, 51, 234)" : "rgb(59, 130, 246)");
3593
- contentWrapper.style.setProperty("--outline-color-hover", isDragging ? "rgba(147, 51, 234, 0.5)" : "rgba(59, 130, 246, 0.5)");
3620
+ contentWrapper.style.setProperty("--outline-color", isDragging ? EDITOR_COLORS.drag.solid : EDITOR_COLORS.hover.solid);
3621
+ contentWrapper.style.setProperty("--outline-color-hover", isDragging ? EDITOR_COLORS.drag.half : EDITOR_COLORS.hover.half);
3594
3622
  const template = useEditorStore.getState().template;
3595
3623
  const linkColor2 = template?.content?.[0]?.data?.value?.linkColor || "#0000ff";
3596
3624
  contentWrapper.style.setProperty("--link-color", linkColor2);
@@ -3610,8 +3638,8 @@ var ShadowDomRenderer = memo(function ShadowDomRenderer2({
3610
3638
  if (!shadowRootRef.current) return;
3611
3639
  const contentWrapper = shadowRootRef.current.querySelector(".shadow-content");
3612
3640
  if (contentWrapper) {
3613
- contentWrapper.style.setProperty("--outline-color", isDragging ? "rgb(147, 51, 234)" : "rgb(59, 130, 246)");
3614
- contentWrapper.style.setProperty("--outline-color-hover", isDragging ? "rgba(147, 51, 234, 0.5)" : "rgba(59, 130, 246, 0.5)");
3641
+ contentWrapper.style.setProperty("--outline-color", isDragging ? EDITOR_COLORS.drag.solid : EDITOR_COLORS.hover.solid);
3642
+ contentWrapper.style.setProperty("--outline-color-hover", isDragging ? EDITOR_COLORS.drag.half : EDITOR_COLORS.hover.half);
3615
3643
  contentWrapper.style.setProperty("--company-footer-opacity", showCompanyFooter ? "1" : "0.25");
3616
3644
  const template = useEditorStore.getState().template;
3617
3645
  const linkColor2 = template?.content?.[0]?.data?.value?.linkColor || "#0000ff";
@@ -4071,11 +4099,11 @@ var ShadowDomRenderer = memo(function ShadowDomRenderer2({
4071
4099
  width: 3,
4072
4100
  height: dropIndicator.height
4073
4101
  },
4074
- backgroundColor: isDragging ? "rgb(147, 51, 234)" : "#3b82f6",
4102
+ backgroundColor: isDragging ? EDITOR_COLORS.drag.solid : EDITOR_COLORS.hover.solid,
4075
4103
  borderRadius: 2,
4076
4104
  pointerEvents: "none",
4077
4105
  zIndex: 9999,
4078
- boxShadow: isDragging ? "0 0 4px rgba(147, 51, 234, 0.5)" : "0 0 4px rgba(59, 130, 246, 0.5)"
4106
+ boxShadow: isDragging ? `0 0 4px ${EDITOR_COLORS.drag.half}` : `0 0 4px ${EDITOR_COLORS.hover.half}`
4079
4107
  },
4080
4108
  children: (dropIndicator.isNewSection || dropIndicator.isSplitSection) && /* @__PURE__ */ jsx(
4081
4109
  "div",
@@ -4085,7 +4113,7 @@ var ShadowDomRenderer = memo(function ShadowDomRenderer2({
4085
4113
  top: "50%",
4086
4114
  left: "50%",
4087
4115
  transform: "translate(-50%, -50%)",
4088
- backgroundColor: "rgb(147, 51, 234)",
4116
+ backgroundColor: EDITOR_COLORS.drag.solid,
4089
4117
  color: "white",
4090
4118
  fontSize: 12,
4091
4119
  fontWeight: 600,
@@ -12091,7 +12119,7 @@ var TiptapOverlayContent = ({ idx, getReferenceRect, getShadowElement, initialWi
12091
12119
  };
12092
12120
 
12093
12121
  // src/core/editor/components/element-float.tsx
12094
- import { useEffect as useEffect12, useMemo as useMemo10 } from "react";
12122
+ import { useEffect as useEffect12, useMemo as useMemo11 } from "react";
12095
12123
  import { useFloating as useFloating4, offset as offset4, shift as shift3, flip as flip2, autoUpdate as autoUpdate3 } from "@floating-ui/react";
12096
12124
 
12097
12125
  // src/core/editor/components/float-ui/actions/delete-button.tsx
@@ -12145,7 +12173,7 @@ var DuplicateButton = () => {
12145
12173
  };
12146
12174
 
12147
12175
  // src/core/editor/components/href-menu.tsx
12148
- import { useState as useState3, useEffect as useEffect7 } from "react";
12176
+ import { useState as useState3, useEffect as useEffect7, useCallback as useCallback4, useMemo as useMemo5 } from "react";
12149
12177
 
12150
12178
  // src/components/ui/dropdown-menu.tsx
12151
12179
  import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
@@ -12322,19 +12350,36 @@ var useHref = () => {
12322
12350
  import { jsx as jsx25, jsxs as jsxs12 } from "react/jsx-runtime";
12323
12351
  var HrefMenu = () => {
12324
12352
  const { href, setHref, clearHref, copyHref, hasHref } = useHref();
12353
+ const userData = useEditorStore((s) => s.userData);
12325
12354
  const [isOpen, setIsOpen] = useState3(false);
12326
12355
  const [inputValue, setInputValue] = useState3("");
12327
12356
  const [showCopied, setShowCopied] = useState3(false);
12328
12357
  const [linkType, setLinkType] = useState3(LINK_TYPES[1]);
12329
12358
  const [isLinkTypeOpen, setIsLinkTypeOpen] = useState3(false);
12359
+ const [isPresetOpen, setIsPresetOpen] = useState3(false);
12360
+ console.log("userData", userData);
12361
+ const availablePresets = useMemo5(() => {
12362
+ const presetDefs = LINK_PRESETS[linkType.name] ?? [];
12363
+ if (!userData) return [];
12364
+ const all = presetDefs.filter((p) => userData[p.key]).map((p) => ({ ...p, value: String(userData[p.key]) }));
12365
+ if (!inputValue) return all;
12366
+ const query = inputValue.toLowerCase();
12367
+ return all.filter((p) => p.value.toLowerCase().includes(query));
12368
+ }, [linkType.name, userData, inputValue]);
12369
+ const handlePresetSelect = useCallback4((value) => {
12370
+ setInputValue(value);
12371
+ setIsPresetOpen(false);
12372
+ }, []);
12330
12373
  useEffect7(() => {
12331
12374
  if (isOpen) {
12332
12375
  setLinkType(detectLinkType(href));
12333
12376
  setInputValue(stripPrefix(href));
12377
+ setIsPresetOpen(true);
12334
12378
  }
12335
12379
  }, [isOpen, href]);
12336
12380
  const handleInputChange = (e) => {
12337
12381
  setInputValue(e.target.value);
12382
+ setIsPresetOpen(true);
12338
12383
  };
12339
12384
  const buildHref = (value) => {
12340
12385
  if (!value) return "";
@@ -12344,15 +12389,22 @@ var HrefMenu = () => {
12344
12389
  if (value.startsWith(linkType.prefix)) return value;
12345
12390
  return linkType.prefix + value;
12346
12391
  };
12392
+ const handleInputClick = () => {
12393
+ if (availablePresets.length > 0) {
12394
+ setIsPresetOpen(true);
12395
+ }
12396
+ };
12347
12397
  const handleInputBlur = () => {
12348
12398
  setHref(buildHref(inputValue));
12349
12399
  };
12350
12400
  const handleKeyDown = (e) => {
12351
12401
  if (e.key === "Enter") {
12352
12402
  setHref(buildHref(inputValue));
12403
+ setIsPresetOpen(false);
12353
12404
  setIsOpen(false);
12354
12405
  }
12355
12406
  if (e.key === "Escape") {
12407
+ setIsPresetOpen(false);
12356
12408
  setIsOpen(false);
12357
12409
  }
12358
12410
  };
@@ -12395,55 +12447,85 @@ var HrefMenu = () => {
12395
12447
  /* @__PURE__ */ jsxs12(DropdownMenuContent, { side: "bottom", className: "w-[250px] p-3 shadow-lg z-50001", children: [
12396
12448
  /* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-2", children: [
12397
12449
  /* @__PURE__ */ jsx25(Label, { children: "Enter a link" }),
12398
- /* @__PURE__ */ jsxs12("div", { className: "relative", children: [
12399
- /* @__PURE__ */ jsx25(
12400
- Input,
12401
- {
12402
- type: linkType.inputType,
12403
- placeholder: linkType.placeholder,
12404
- className: "w-full rounded-[12px] shadow-none pl-12 h-[44px]",
12405
- value: inputValue,
12406
- onChange: handleInputChange,
12407
- onBlur: handleInputBlur,
12408
- onKeyDown: handleKeyDown,
12409
- autoFocus: true
12410
- }
12411
- ),
12412
- /* @__PURE__ */ jsxs12(Popover, { open: isLinkTypeOpen, onOpenChange: setIsLinkTypeOpen, children: [
12413
- /* @__PURE__ */ jsxs12(Tooltip, { children: [
12414
- /* @__PURE__ */ jsx25(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx25(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx25(Button, { size: "icon", variant: "ghost", className: "absolute shadow-none rounded-[12px] left-1.5 top-1/2 -translate-y-1/2 h-[34px] w-[34px] cursor-pointer", children: /* @__PURE__ */ jsx25(linkType.icon, {}) }) }) }),
12415
- /* @__PURE__ */ jsx25(TooltipContent, { side: "top", className: "z-50001", children: "Link Type" })
12416
- ] }),
12450
+ /* @__PURE__ */ jsxs12(Popover, { open: isPresetOpen && availablePresets.length > 0, onOpenChange: setIsPresetOpen, children: [
12451
+ /* @__PURE__ */ jsx25(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs12("div", { className: "relative", children: [
12417
12452
  /* @__PURE__ */ jsx25(
12418
- PopoverContent,
12453
+ Input,
12419
12454
  {
12420
- side: "bottom",
12421
- align: "start",
12422
- className: "w-[160px] p-1 z-50001",
12423
- onPointerDownOutside: (e) => e.preventDefault(),
12424
- children: LINK_TYPES.map((type) => /* @__PURE__ */ jsxs12(
12425
- Button,
12426
- {
12427
- variant: "ghost",
12428
- className: "w-full justify-between shadow-none cursor-pointer",
12429
- onClick: (e) => {
12430
- e.stopPropagation();
12431
- setLinkType(type);
12432
- setIsLinkTypeOpen(false);
12455
+ type: linkType.inputType,
12456
+ placeholder: linkType.placeholder,
12457
+ className: "w-full rounded-[12px] shadow-none pl-12 h-[44px]",
12458
+ value: inputValue,
12459
+ onChange: handleInputChange,
12460
+ onClick: handleInputClick,
12461
+ onBlur: handleInputBlur,
12462
+ onKeyDown: handleKeyDown,
12463
+ autoFocus: true
12464
+ }
12465
+ ),
12466
+ /* @__PURE__ */ jsxs12(Popover, { open: isLinkTypeOpen, onOpenChange: setIsLinkTypeOpen, children: [
12467
+ /* @__PURE__ */ jsxs12(Tooltip, { children: [
12468
+ /* @__PURE__ */ jsx25(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx25(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx25(Button, { size: "icon", variant: "ghost", className: "absolute shadow-none rounded-[12px] left-1.5 top-1/2 -translate-y-1/2 h-[34px] w-[34px] cursor-pointer", children: /* @__PURE__ */ jsx25(linkType.icon, {}) }) }) }),
12469
+ /* @__PURE__ */ jsx25(TooltipContent, { side: "top", className: "z-50001", children: "Link Type" })
12470
+ ] }),
12471
+ /* @__PURE__ */ jsx25(
12472
+ PopoverContent,
12473
+ {
12474
+ side: "bottom",
12475
+ align: "start",
12476
+ className: "w-[160px] p-1 z-50001",
12477
+ onPointerDownOutside: (e) => e.preventDefault(),
12478
+ children: LINK_TYPES.map((type) => /* @__PURE__ */ jsxs12(
12479
+ Button,
12480
+ {
12481
+ variant: "ghost",
12482
+ className: "w-full justify-between shadow-none cursor-pointer",
12483
+ onClick: (e) => {
12484
+ e.stopPropagation();
12485
+ setLinkType(type);
12486
+ setIsLinkTypeOpen(false);
12487
+ },
12488
+ children: [
12489
+ /* @__PURE__ */ jsxs12("span", { className: "flex items-center gap-2", children: [
12490
+ /* @__PURE__ */ jsx25(type.icon, { className: "size-4" }),
12491
+ type.name
12492
+ ] }),
12493
+ linkType.name === type.name && /* @__PURE__ */ jsx25(CheckIcon3, { className: "size-4" })
12494
+ ]
12433
12495
  },
12434
- children: [
12435
- /* @__PURE__ */ jsxs12("span", { className: "flex items-center gap-2", children: [
12436
- /* @__PURE__ */ jsx25(type.icon, { className: "size-4" }),
12437
- type.name
12438
- ] }),
12439
- linkType.name === type.name && /* @__PURE__ */ jsx25(CheckIcon3, { className: "size-4" })
12440
- ]
12496
+ type.name
12497
+ ))
12498
+ }
12499
+ )
12500
+ ] })
12501
+ ] }) }),
12502
+ /* @__PURE__ */ jsx25(
12503
+ PopoverContent,
12504
+ {
12505
+ side: "bottom",
12506
+ align: "start",
12507
+ className: "w-[var(--radix-popover-trigger-width)] p-0 overflow-hidden z-50001",
12508
+ onOpenAutoFocus: (e) => e.preventDefault(),
12509
+ children: /* @__PURE__ */ jsx25("div", { className: "flex flex-col max-h-[200px] overflow-y-auto", children: availablePresets.map((preset) => /* @__PURE__ */ jsxs12(
12510
+ "button",
12511
+ {
12512
+ className: `flex items-center justify-between px-3 py-2 text-sm hover:bg-accent cursor-pointer ${inputValue === preset.value ? "bg-accent font-medium" : ""}`,
12513
+ onMouseDown: (e) => {
12514
+ e.preventDefault();
12515
+ handlePresetSelect(preset.value);
12441
12516
  },
12442
- type.name
12443
- ))
12444
- }
12445
- )
12446
- ] })
12517
+ children: [
12518
+ /* @__PURE__ */ jsxs12("div", { className: "flex flex-col items-start gap-0.5", children: [
12519
+ /* @__PURE__ */ jsx25("span", { className: "text-xs text-muted-foreground", children: preset.label }),
12520
+ /* @__PURE__ */ jsx25("span", { className: "text-sm", children: preset.value })
12521
+ ] }),
12522
+ inputValue === preset.value && /* @__PURE__ */ jsx25(CheckIcon3, { className: "w-4 h-4 shrink-0" })
12523
+ ]
12524
+ },
12525
+ preset.key
12526
+ )) })
12527
+ }
12528
+ )
12447
12529
  ] })
12448
12530
  ] }),
12449
12531
  /* @__PURE__ */ jsx25(Separator, { className: "my-2" }),
@@ -12508,11 +12590,11 @@ var ButtonFloat = () => {
12508
12590
  import { ChevronsLeftRightIcon, ChevronsRightLeftIcon, MoreHorizontalIcon } from "lucide-react";
12509
12591
 
12510
12592
  // src/core/editor/hooks/use-full-width-toggle.ts
12511
- import { useCallback as useCallback4, useMemo as useMemo5 } from "react";
12593
+ import { useCallback as useCallback5, useMemo as useMemo6 } from "react";
12512
12594
  import { get as lodashGet3 } from "lodash";
12513
12595
  function useFullWidthToggle() {
12514
12596
  const { focusIdx, template, updateElement } = useEditorStore();
12515
- const { element, isFullWidth } = useMemo5(() => {
12597
+ const { element, isFullWidth } = useMemo6(() => {
12516
12598
  if (!focusIdx || !template) return { element: null, isFullWidth: false };
12517
12599
  const path = focusIdx.startsWith("content.") ? focusIdx.replace("content.", "content[0].").replace(/\.\[(\d+)\]/g, "[$1]") : focusIdx;
12518
12600
  const el = lodashGet3(template, path);
@@ -12521,7 +12603,7 @@ function useFullWidthToggle() {
12521
12603
  isFullWidth: el?.attributes?.["full-width"] === "full-width"
12522
12604
  };
12523
12605
  }, [focusIdx, template]);
12524
- const handleToggleFullWidth = useCallback4(() => {
12606
+ const handleToggleFullWidth = useCallback5(() => {
12525
12607
  if (!focusIdx || !element) return;
12526
12608
  const newAttributes = { ...element.attributes };
12527
12609
  if (isFullWidth) {
@@ -12558,11 +12640,11 @@ var SectionFloat = () => {
12558
12640
  import { CheckIcon as CheckIcon4, ChevronsLeftRightIcon as ChevronsLeftRightIcon2, ChevronsRightLeftIcon as ChevronsRightLeftIcon2, Layers2Icon, MoreHorizontalIcon as MoreHorizontalIcon2 } from "lucide-react";
12559
12641
 
12560
12642
  // src/core/editor/hooks/use-no-wrap.ts
12561
- import { useCallback as useCallback5, useMemo as useMemo6 } from "react";
12643
+ import { useCallback as useCallback6, useMemo as useMemo7 } from "react";
12562
12644
  import { get as lodashGet4 } from "lodash";
12563
12645
  function useNoWrap() {
12564
12646
  const { focusIdx, template, updateElement } = useEditorStore();
12565
- const { element, noWrap } = useMemo6(() => {
12647
+ const { element, noWrap } = useMemo7(() => {
12566
12648
  if (!focusIdx || !template) return { element: null, noWrap: false };
12567
12649
  const path = focusIdx.startsWith("content.") ? focusIdx.replace("content.", "content[0].").replace(/\.\[(\d+)\]/g, "[$1]") : focusIdx;
12568
12650
  const el = lodashGet4(template, path);
@@ -12571,7 +12653,7 @@ function useNoWrap() {
12571
12653
  noWrap: el?.data?.value?.noWrap === true
12572
12654
  };
12573
12655
  }, [focusIdx, template]);
12574
- const handleToggleNoWrap = useCallback5(() => {
12656
+ const handleToggleNoWrap = useCallback6(() => {
12575
12657
  if (!focusIdx || !element) return;
12576
12658
  updateElement(focusIdx, {
12577
12659
  data: {
@@ -12702,7 +12784,7 @@ import { Accessibility, MoreHorizontalIcon as MoreHorizontalIcon4, TrashIcon as
12702
12784
  import { useState as useState6, useEffect as useEffect9 } from "react";
12703
12785
 
12704
12786
  // src/core/editor/components/social-item-menu.tsx
12705
- import { useState as useState5, useEffect as useEffect8, useMemo as useMemo7, useCallback as useCallback6 } from "react";
12787
+ import { useState as useState5, useEffect as useEffect8, useMemo as useMemo8, useCallback as useCallback7 } from "react";
12706
12788
  import { PencilIcon as PencilIcon3, CheckIcon as CheckIcon5, CopyIcon as CopyIcon4 } from "lucide-react";
12707
12789
  import { get as lodashGet5 } from "lodash";
12708
12790
  import { jsx as jsx33, jsxs as jsxs18 } from "react/jsx-runtime";
@@ -12713,7 +12795,7 @@ var SocialItemMenu = ({ hasHref }) => {
12713
12795
  const [contentInputValue, setContentInputValue] = useState5("");
12714
12796
  const { href, setHref, copyHref } = useHref();
12715
12797
  const { focusIdx, template, updateElement } = useEditorStore();
12716
- const element = useMemo7(() => {
12798
+ const element = useMemo8(() => {
12717
12799
  if (!focusIdx || !template) return null;
12718
12800
  const path = focusIdx.startsWith("content.") ? focusIdx.replace("content.", "content[0].").replace(/\.?\[(\d+)\]/g, "[$1]") : focusIdx;
12719
12801
  return lodashGet5(template, path);
@@ -12725,12 +12807,12 @@ var SocialItemMenu = ({ hasHref }) => {
12725
12807
  setContentInputValue(content);
12726
12808
  }
12727
12809
  }, [isOpen, href, content]);
12728
- const handleCopy = useCallback6(async () => {
12810
+ const handleCopy = useCallback7(async () => {
12729
12811
  await copyHref();
12730
12812
  setShowCopied(true);
12731
12813
  setTimeout(() => setShowCopied(false), 2e3);
12732
12814
  }, [copyHref]);
12733
- const handleDone = useCallback6(() => {
12815
+ const handleDone = useCallback7(() => {
12734
12816
  setHref(normalizeWebsiteUrl(hrefInputValue));
12735
12817
  if (focusIdx && element) {
12736
12818
  updateElement(focusIdx, {
@@ -12826,11 +12908,11 @@ var SocialItemMenu = ({ hasHref }) => {
12826
12908
  };
12827
12909
 
12828
12910
  // src/core/editor/hooks/use-alt.ts
12829
- import { useMemo as useMemo8, useCallback as useCallback7 } from "react";
12911
+ import { useMemo as useMemo9, useCallback as useCallback8 } from "react";
12830
12912
  import { get as lodashGet6 } from "lodash";
12831
12913
  var useAlt = () => {
12832
12914
  const { focusIdx, updateElement, template } = useEditorStore();
12833
- const { element, alt } = useMemo8(() => {
12915
+ const { element, alt } = useMemo9(() => {
12834
12916
  if (!focusIdx || !template) {
12835
12917
  return { element: null, alt: "" };
12836
12918
  }
@@ -12841,13 +12923,13 @@ var useAlt = () => {
12841
12923
  alt: el?.attributes?.alt || ""
12842
12924
  };
12843
12925
  }, [focusIdx, template]);
12844
- const setAlt = useCallback7((text2) => {
12926
+ const setAlt = useCallback8((text2) => {
12845
12927
  if (!focusIdx || !element) return;
12846
12928
  updateElement(focusIdx, {
12847
12929
  attributes: { ...element.attributes, alt: text2 }
12848
12930
  });
12849
12931
  }, [focusIdx, element, updateElement]);
12850
- const clearAlt = useCallback7(() => {
12932
+ const clearAlt = useCallback8(() => {
12851
12933
  if (!focusIdx || !element) return;
12852
12934
  updateElement(focusIdx, {
12853
12935
  attributes: { ...element.attributes, alt: "" }
@@ -12961,7 +13043,7 @@ var DividerFloat = () => {
12961
13043
  // src/core/editor/components/element-gear/image/float.tsx
12962
13044
  import { Accessibility as Accessibility2, CheckIcon as CheckIcon6, MoreHorizontalIcon as MoreHorizontalIcon5, Proportions } from "lucide-react";
12963
13045
  import lodashGet7 from "lodash/get";
12964
- import { useState as useState7, useEffect as useEffect10, useMemo as useMemo9, useCallback as useCallback8 } from "react";
13046
+ import { useState as useState7, useEffect as useEffect10, useMemo as useMemo10, useCallback as useCallback9 } from "react";
12965
13047
  import { Fragment as Fragment13, jsx as jsx36, jsxs as jsxs21 } from "react/jsx-runtime";
12966
13048
  var ImageFloat = () => {
12967
13049
  const { href, hasHref } = useHref();
@@ -12970,7 +13052,7 @@ var ImageFloat = () => {
12970
13052
  const [showMoreView, setShowMoreView] = useState7(null);
12971
13053
  const [dropdownOpen, setDropdownOpen] = useState7(false);
12972
13054
  const [altInputValue, setAltInputValue] = useState7("");
12973
- const { element, isFluidOnMobile } = useMemo9(() => {
13055
+ const { element, isFluidOnMobile } = useMemo10(() => {
12974
13056
  if (!focusIdx || !template) return { element: null, isFluidOnMobile: false };
12975
13057
  const path = focusIdx.startsWith("content.") ? focusIdx.replace("content.", "content[0].").replace(/\.\[(\d+)\]/g, "[$1]") : focusIdx;
12976
13058
  const el = lodashGet7(template, path);
@@ -12979,7 +13061,7 @@ var ImageFloat = () => {
12979
13061
  isFluidOnMobile: el?.attributes?.["fluid-on-mobile"] === "true"
12980
13062
  };
12981
13063
  }, [focusIdx, template]);
12982
- const toggleFluidOnMobile = useCallback8(() => {
13064
+ const toggleFluidOnMobile = useCallback9(() => {
12983
13065
  if (!focusIdx || !element) return;
12984
13066
  const newAttributes = { ...element.attributes };
12985
13067
  if (isFluidOnMobile) {
@@ -13338,7 +13420,7 @@ var ElementFloat = ({ getReferenceRect, focusIdx, elementType }) => {
13338
13420
  );
13339
13421
  };
13340
13422
  var ElementFloatContent = ({ getReferenceRect, FloatComponent }) => {
13341
- const virtualReference = useMemo10(() => ({
13423
+ const virtualReference = useMemo11(() => ({
13342
13424
  getBoundingClientRect: () => {
13343
13425
  const rect = getReferenceRect();
13344
13426
  if (!rect) {
@@ -13377,14 +13459,14 @@ var ElementFloatContent = ({ getReferenceRect, FloatComponent }) => {
13377
13459
  };
13378
13460
 
13379
13461
  // src/core/editor/components/scaling/divider-scale.tsx
13380
- import { useMemo as useMemo11, useEffect as useEffect13, useState as useState9, useRef as useRef5, useCallback as useCallback10 } from "react";
13462
+ import { useMemo as useMemo12, useEffect as useEffect13, useState as useState9, useRef as useRef5, useCallback as useCallback11 } from "react";
13381
13463
  import { useFloating as useFloating5, offset as offset5, autoUpdate as autoUpdate4 } from "@floating-ui/react";
13382
13464
  import { jsx as jsx42, jsxs as jsxs25 } from "react/jsx-runtime";
13383
13465
  var DividerScale = ({ getReferenceRect }) => {
13384
13466
  const [dimensions, setDimensions] = useState9({ width: 0, height: 0 });
13385
13467
  const [activeSide, setActiveSide] = useState9(null);
13386
13468
  const { focusIdx, template, setIsScaling } = useEditorStore();
13387
- const { currentWidth, currentAlign } = useMemo11(() => {
13469
+ const { currentWidth, currentAlign } = useMemo12(() => {
13388
13470
  if (!focusIdx || !template) return { currentWidth: 100, currentAlign: "center" };
13389
13471
  const element = getValueByIdx(template, focusIdx);
13390
13472
  const rawWidth = element?.attributes?.width;
@@ -13394,12 +13476,12 @@ var DividerScale = ({ getReferenceRect }) => {
13394
13476
  return { currentWidth: width, currentAlign: align };
13395
13477
  }, [focusIdx, template]);
13396
13478
  const dragRef = useRef5(null);
13397
- const getContainerWidth = useCallback10(() => {
13479
+ const getContainerWidth = useCallback11(() => {
13398
13480
  const rect = getReferenceRect();
13399
13481
  if (!rect || currentWidth <= 0) return null;
13400
13482
  return rect.width / (currentWidth / 100);
13401
13483
  }, [getReferenceRect, currentWidth]);
13402
- const handlePointerDown = useCallback10((e, side) => {
13484
+ const handlePointerDown = useCallback11((e, side) => {
13403
13485
  e.preventDefault();
13404
13486
  e.stopPropagation();
13405
13487
  const containerWidth = getContainerWidth();
@@ -13417,7 +13499,7 @@ var DividerScale = ({ getReferenceRect }) => {
13417
13499
  document.addEventListener("pointermove", handlePointerMove);
13418
13500
  document.addEventListener("pointerup", handlePointerUp);
13419
13501
  }, [getContainerWidth, currentWidth, currentAlign, setIsScaling]);
13420
- const handlePointerMove = useCallback10((e) => {
13502
+ const handlePointerMove = useCallback11((e) => {
13421
13503
  if (!dragRef.current) return;
13422
13504
  const { startX, startWidth, containerWidth, side, align } = dragRef.current;
13423
13505
  const deltaX = e.clientX - startX;
@@ -13437,7 +13519,7 @@ var DividerScale = ({ getReferenceRect }) => {
13437
13519
  }
13438
13520
  });
13439
13521
  }, []);
13440
- const handlePointerUp = useCallback10(() => {
13522
+ const handlePointerUp = useCallback11(() => {
13441
13523
  setActiveSide(null);
13442
13524
  setIsScaling(false);
13443
13525
  dragRef.current = null;
@@ -13450,7 +13532,7 @@ var DividerScale = ({ getReferenceRect }) => {
13450
13532
  document.removeEventListener("pointerup", handlePointerUp);
13451
13533
  };
13452
13534
  }, [handlePointerMove, handlePointerUp]);
13453
- const virtualReference = useMemo11(() => ({
13535
+ const virtualReference = useMemo12(() => ({
13454
13536
  getBoundingClientRect: () => {
13455
13537
  const rect = getReferenceRect();
13456
13538
  if (!rect) {
@@ -13524,14 +13606,14 @@ var DividerScale = ({ getReferenceRect }) => {
13524
13606
  };
13525
13607
 
13526
13608
  // src/core/editor/components/scaling/button-scale.tsx
13527
- import { useMemo as useMemo12, useEffect as useEffect14, useState as useState10, useRef as useRef6, useCallback as useCallback11 } from "react";
13609
+ import { useMemo as useMemo13, useEffect as useEffect14, useState as useState10, useRef as useRef6, useCallback as useCallback12 } from "react";
13528
13610
  import { useFloating as useFloating6, offset as offset6, autoUpdate as autoUpdate5 } from "@floating-ui/react";
13529
13611
  import { jsx as jsx43, jsxs as jsxs26 } from "react/jsx-runtime";
13530
13612
  var ButtonScale = ({ getReferenceRect }) => {
13531
13613
  const [dimensions, setDimensions] = useState10({ width: 0, height: 0 });
13532
13614
  const [activeSide, setActiveSide] = useState10(null);
13533
13615
  const { focusIdx, template, setIsScaling } = useEditorStore();
13534
- const { currentWidth, currentHeight, currentAlign } = useMemo12(() => {
13616
+ const { currentWidth, currentHeight, currentAlign } = useMemo13(() => {
13535
13617
  if (!focusIdx || !template) {
13536
13618
  return { currentWidth: 24, currentHeight: 44, currentAlign: "center" };
13537
13619
  }
@@ -13546,12 +13628,12 @@ var ButtonScale = ({ getReferenceRect }) => {
13546
13628
  return { currentWidth: width, currentHeight: height, currentAlign: align };
13547
13629
  }, [focusIdx, template]);
13548
13630
  const dragRef = useRef6(null);
13549
- const getContainerWidth = useCallback11(() => {
13631
+ const getContainerWidth = useCallback12(() => {
13550
13632
  const rect = getReferenceRect();
13551
13633
  if (!rect || currentWidth <= 0) return null;
13552
13634
  return rect.width / (currentWidth / 100);
13553
13635
  }, [getReferenceRect, currentWidth]);
13554
- const handlePointerDown = useCallback11((e, side) => {
13636
+ const handlePointerDown = useCallback12((e, side) => {
13555
13637
  e.preventDefault();
13556
13638
  e.stopPropagation();
13557
13639
  if (document.activeElement instanceof HTMLElement) {
@@ -13573,7 +13655,7 @@ var ButtonScale = ({ getReferenceRect }) => {
13573
13655
  document.addEventListener("pointermove", handlePointerMove);
13574
13656
  document.addEventListener("pointerup", handlePointerUp);
13575
13657
  }, [getContainerWidth, currentWidth, currentHeight, currentAlign, setIsScaling]);
13576
- const handlePointerMove = useCallback11((e) => {
13658
+ const handlePointerMove = useCallback12((e) => {
13577
13659
  if (!dragRef.current) return;
13578
13660
  const { startX, startY, startWidth, startHeight, containerWidth, side, align } = dragRef.current;
13579
13661
  const state = useEditorStore.getState();
@@ -13605,7 +13687,7 @@ var ButtonScale = ({ getReferenceRect }) => {
13605
13687
  });
13606
13688
  }
13607
13689
  }, []);
13608
- const handlePointerUp = useCallback11(() => {
13690
+ const handlePointerUp = useCallback12(() => {
13609
13691
  setActiveSide(null);
13610
13692
  setIsScaling(false);
13611
13693
  dragRef.current = null;
@@ -13618,7 +13700,7 @@ var ButtonScale = ({ getReferenceRect }) => {
13618
13700
  document.removeEventListener("pointerup", handlePointerUp);
13619
13701
  };
13620
13702
  }, [handlePointerMove, handlePointerUp]);
13621
- const virtualReference = useMemo12(() => ({
13703
+ const virtualReference = useMemo13(() => ({
13622
13704
  getBoundingClientRect: () => {
13623
13705
  const rect = getReferenceRect();
13624
13706
  if (!rect) {
@@ -13708,14 +13790,14 @@ var ButtonScale = ({ getReferenceRect }) => {
13708
13790
  };
13709
13791
 
13710
13792
  // src/core/editor/components/scaling/image-scale.tsx
13711
- import { useMemo as useMemo13, useEffect as useEffect15, useState as useState11, useRef as useRef7, useCallback as useCallback12 } from "react";
13793
+ import { useMemo as useMemo14, useEffect as useEffect15, useState as useState11, useRef as useRef7, useCallback as useCallback13 } from "react";
13712
13794
  import { useFloating as useFloating7, offset as offset7, autoUpdate as autoUpdate6 } from "@floating-ui/react";
13713
13795
  import { jsx as jsx44, jsxs as jsxs27 } from "react/jsx-runtime";
13714
13796
  var ImageScale = ({ getReferenceRect }) => {
13715
13797
  const [dimensions, setDimensions] = useState11({ width: 0, height: 0 });
13716
13798
  const [activeSide, setActiveSide] = useState11(null);
13717
13799
  const { focusIdx, template, setIsScaling } = useEditorStore();
13718
- const { currentWidth, currentHeight, currentAlign } = useMemo13(() => {
13800
+ const { currentWidth, currentHeight, currentAlign } = useMemo14(() => {
13719
13801
  if (!focusIdx || !template) {
13720
13802
  return { currentWidth: 0, currentHeight: 0, currentAlign: "center" };
13721
13803
  }
@@ -13730,7 +13812,7 @@ var ImageScale = ({ getReferenceRect }) => {
13730
13812
  return { currentWidth: width, currentHeight: height, currentAlign: align };
13731
13813
  }, [focusIdx, template]);
13732
13814
  const dragRef = useRef7(null);
13733
- const handlePointerDown = useCallback12((e, side) => {
13815
+ const handlePointerDown = useCallback13((e, side) => {
13734
13816
  e.preventDefault();
13735
13817
  e.stopPropagation();
13736
13818
  if (document.activeElement instanceof HTMLElement) {
@@ -13753,7 +13835,7 @@ var ImageScale = ({ getReferenceRect }) => {
13753
13835
  document.addEventListener("pointermove", handlePointerMove);
13754
13836
  document.addEventListener("pointerup", handlePointerUp);
13755
13837
  }, [getReferenceRect, currentWidth, currentHeight, currentAlign, setIsScaling]);
13756
- const handlePointerMove = useCallback12((e) => {
13838
+ const handlePointerMove = useCallback13((e) => {
13757
13839
  if (!dragRef.current) return;
13758
13840
  const { startX, startY, startWidth, startHeight, side, align } = dragRef.current;
13759
13841
  const state = useEditorStore.getState();
@@ -13784,7 +13866,7 @@ var ImageScale = ({ getReferenceRect }) => {
13784
13866
  });
13785
13867
  }
13786
13868
  }, []);
13787
- const handlePointerUp = useCallback12(() => {
13869
+ const handlePointerUp = useCallback13(() => {
13788
13870
  setActiveSide(null);
13789
13871
  setIsScaling(false);
13790
13872
  dragRef.current = null;
@@ -13797,7 +13879,7 @@ var ImageScale = ({ getReferenceRect }) => {
13797
13879
  document.removeEventListener("pointerup", handlePointerUp);
13798
13880
  };
13799
13881
  }, [handlePointerMove, handlePointerUp]);
13800
- const virtualReference = useMemo13(() => ({
13882
+ const virtualReference = useMemo14(() => ({
13801
13883
  getBoundingClientRect: () => {
13802
13884
  const rect = getReferenceRect();
13803
13885
  if (!rect) {
@@ -13887,14 +13969,14 @@ var ImageScale = ({ getReferenceRect }) => {
13887
13969
  };
13888
13970
 
13889
13971
  // src/core/editor/components/scaling/spacer-scale.tsx
13890
- import { useMemo as useMemo14, useEffect as useEffect16, useState as useState12, useRef as useRef8, useCallback as useCallback13 } from "react";
13972
+ import { useMemo as useMemo15, useEffect as useEffect16, useState as useState12, useRef as useRef8, useCallback as useCallback14 } from "react";
13891
13973
  import { useFloating as useFloating8, offset as offset8, autoUpdate as autoUpdate7 } from "@floating-ui/react";
13892
13974
  import { jsx as jsx45, jsxs as jsxs28 } from "react/jsx-runtime";
13893
13975
  var SpacerScale = ({ getReferenceRect }) => {
13894
13976
  const [dimensions, setDimensions] = useState12({ width: 0, height: 0 });
13895
13977
  const [activeSide, setActiveSide] = useState12(null);
13896
13978
  const { focusIdx, template, setIsScaling } = useEditorStore();
13897
- const currentHeight = useMemo14(() => {
13979
+ const currentHeight = useMemo15(() => {
13898
13980
  if (!focusIdx || !template) return 12;
13899
13981
  const element = getValueByIdx(template, focusIdx);
13900
13982
  const rawHeight = element?.attributes?.height;
@@ -13902,7 +13984,7 @@ var SpacerScale = ({ getReferenceRect }) => {
13902
13984
  return isNaN(parsedHeight) ? 12 : Math.max(12, Math.min(200, parsedHeight));
13903
13985
  }, [focusIdx, template]);
13904
13986
  const dragRef = useRef8(null);
13905
- const handlePointerDown = useCallback13((e, side) => {
13987
+ const handlePointerDown = useCallback14((e, side) => {
13906
13988
  e.preventDefault();
13907
13989
  e.stopPropagation();
13908
13990
  if (document.activeElement instanceof HTMLElement) {
@@ -13918,7 +14000,7 @@ var SpacerScale = ({ getReferenceRect }) => {
13918
14000
  document.addEventListener("pointermove", handlePointerMove);
13919
14001
  document.addEventListener("pointerup", handlePointerUp);
13920
14002
  }, [currentHeight, setIsScaling]);
13921
- const handlePointerMove = useCallback13((e) => {
14003
+ const handlePointerMove = useCallback14((e) => {
13922
14004
  if (!dragRef.current) return;
13923
14005
  const { startY, startHeight, side } = dragRef.current;
13924
14006
  const state = useEditorStore.getState();
@@ -13936,7 +14018,7 @@ var SpacerScale = ({ getReferenceRect }) => {
13936
14018
  }
13937
14019
  });
13938
14020
  }, []);
13939
- const handlePointerUp = useCallback13(() => {
14021
+ const handlePointerUp = useCallback14(() => {
13940
14022
  setActiveSide(null);
13941
14023
  setIsScaling(false);
13942
14024
  dragRef.current = null;
@@ -13949,7 +14031,7 @@ var SpacerScale = ({ getReferenceRect }) => {
13949
14031
  document.removeEventListener("pointerup", handlePointerUp);
13950
14032
  };
13951
14033
  }, [handlePointerMove, handlePointerUp]);
13952
- const virtualReference = useMemo14(() => ({
14034
+ const virtualReference = useMemo15(() => ({
13953
14035
  getBoundingClientRect: () => {
13954
14036
  const rect = getReferenceRect();
13955
14037
  if (!rect) {
@@ -14023,19 +14105,19 @@ var SpacerScale = ({ getReferenceRect }) => {
14023
14105
  };
14024
14106
 
14025
14107
  // src/core/editor/components/scaling/column-scale.tsx
14026
- import { useMemo as useMemo15, useEffect as useEffect17, useState as useState13, useRef as useRef9, useCallback as useCallback14 } from "react";
14108
+ import { useMemo as useMemo16, useEffect as useEffect17, useState as useState13, useRef as useRef9, useCallback as useCallback15 } from "react";
14027
14109
  import { Fragment as Fragment17, jsx as jsx46 } from "react/jsx-runtime";
14028
14110
  var ColumnScale = ({ sectionColumnIdx, shadowRoot }) => {
14029
14111
  const [activeDivider, setActiveDivider] = useState13(null);
14030
14112
  const [columnRects, setColumnRects] = useState13([]);
14031
14113
  const { template, setIsScaling, setFocusIdx, stopTextEditing } = useEditorStore();
14032
- const columnWidths = useMemo15(() => {
14114
+ const columnWidths = useMemo16(() => {
14033
14115
  if (!template) return [];
14034
14116
  const sectionColumn = getValueByIdx(template, sectionColumnIdx);
14035
14117
  return sectionColumn?.data?.value?.columnWidths || [];
14036
14118
  }, [template, sectionColumnIdx]);
14037
14119
  const dragRef = useRef9(null);
14038
- const updateColumnRects = useCallback14(() => {
14120
+ const updateColumnRects = useCallback15(() => {
14039
14121
  if (!shadowRoot) return;
14040
14122
  const allColumns = shadowRoot.querySelectorAll(".node-type-column");
14041
14123
  const matchingColumns = [];
@@ -14080,7 +14162,7 @@ var ColumnScale = ({ sectionColumnIdx, shadowRoot }) => {
14080
14162
  const parseWidth = (width) => {
14081
14163
  return parseFloat(width.replace("%", ""));
14082
14164
  };
14083
- const handlePointerDown = useCallback14((e, dividerIndex) => {
14165
+ const handlePointerDown = useCallback15((e, dividerIndex) => {
14084
14166
  e.preventDefault();
14085
14167
  e.stopPropagation();
14086
14168
  stopTextEditing();
@@ -14106,7 +14188,7 @@ var ColumnScale = ({ sectionColumnIdx, shadowRoot }) => {
14106
14188
  document.addEventListener("pointermove", handlePointerMove);
14107
14189
  document.addEventListener("pointerup", handlePointerUp);
14108
14190
  }, [columnRects, columnWidths, setIsScaling]);
14109
- const handlePointerMove = useCallback14((e) => {
14191
+ const handlePointerMove = useCallback15((e) => {
14110
14192
  if (!dragRef.current) return;
14111
14193
  const { startX, leftColIndex, rightColIndex, startLeftWidth, startRightWidth, sectionWidth, allWidths } = dragRef.current;
14112
14194
  const deltaX = e.clientX - startX;
@@ -14140,7 +14222,7 @@ var ColumnScale = ({ sectionColumnIdx, shadowRoot }) => {
14140
14222
  }
14141
14223
  });
14142
14224
  }, [sectionColumnIdx]);
14143
- const handlePointerUp = useCallback14(() => {
14225
+ const handlePointerUp = useCallback15(() => {
14144
14226
  setActiveDivider(null);
14145
14227
  setIsScaling(false);
14146
14228
  dragRef.current = null;
@@ -14227,7 +14309,7 @@ function Spinner({ className, ...props }) {
14227
14309
  import { EyeIcon } from "lucide-react";
14228
14310
 
14229
14311
  // src/render/useMjmlCompiler.ts
14230
- import { useState as useState14, useCallback as useCallback15 } from "react";
14312
+ import { useState as useState14, useCallback as useCallback16 } from "react";
14231
14313
  async function compileMjml(mjml) {
14232
14314
  console.log("Compiling MJML", mjml);
14233
14315
  const response = await fetch("/api/mrender", {
@@ -14544,13 +14626,13 @@ function Editor({ setEditorLoading }) {
14544
14626
  };
14545
14627
  convertMjml();
14546
14628
  }, [renderData]);
14547
- const debouncedUpdateContent = useMemo16(
14629
+ const debouncedUpdateContent = useMemo17(
14548
14630
  () => debounce((contentIdx, content) => {
14549
14631
  updateElementContent(contentIdx, content);
14550
14632
  }, 200),
14551
14633
  [updateElementContent]
14552
14634
  );
14553
- const handleElementClick = useCallback16(
14635
+ const handleElementClick = useCallback17(
14554
14636
  (idx) => {
14555
14637
  if (isInsideCompanyFooter(idx, template)) {
14556
14638
  return;
@@ -14563,7 +14645,7 @@ function Editor({ setEditorLoading }) {
14563
14645
  },
14564
14646
  [setFocusIdx, template]
14565
14647
  );
14566
- const handleElementHover = useCallback16(
14648
+ const handleElementHover = useCallback17(
14567
14649
  (idx) => {
14568
14650
  if (!isDragging) {
14569
14651
  if (idx) {
@@ -14577,19 +14659,19 @@ function Editor({ setEditorLoading }) {
14577
14659
  },
14578
14660
  [isDragging, setHoverIdx, template]
14579
14661
  );
14580
- const handleContentInput = useCallback16(
14662
+ const handleContentInput = useCallback17(
14581
14663
  (contentIdx, content) => {
14582
14664
  debouncedUpdateContent(contentIdx, content);
14583
14665
  },
14584
14666
  [debouncedUpdateContent]
14585
14667
  );
14586
- const handleEditingStart = useCallback16(() => {
14668
+ const handleEditingStart = useCallback17(() => {
14587
14669
  setIsEditing(true);
14588
14670
  }, []);
14589
- const handleEditingEnd = useCallback16(() => {
14671
+ const handleEditingEnd = useCallback17(() => {
14590
14672
  setIsEditing(false);
14591
14673
  }, []);
14592
- const handleSlashCommand = useCallback16(
14674
+ const handleSlashCommand = useCallback17(
14593
14675
  (cursorRect) => {
14594
14676
  setSlashCommand({
14595
14677
  isActive: true,
@@ -14604,10 +14686,10 @@ function Editor({ setEditorLoading }) {
14604
14686
  },
14605
14687
  [setSlashCommand]
14606
14688
  );
14607
- const handleSlashCommandClose = useCallback16(() => {
14689
+ const handleSlashCommandClose = useCallback17(() => {
14608
14690
  clearSlashCommand();
14609
14691
  }, [clearSlashCommand]);
14610
- const handleTextEditStart = useCallback16(
14692
+ const handleTextEditStart = useCallback17(
14611
14693
  (idx, initialWidth, initialHeight, clickX, clickY, content, styles) => {
14612
14694
  const getReferenceRect2 = () => {
14613
14695
  if (!shadowRootRef.current) return null;
@@ -14622,11 +14704,11 @@ function Editor({ setEditorLoading }) {
14622
14704
  },
14623
14705
  [startTextEditing]
14624
14706
  );
14625
- const findParentSectionIdx = useCallback16((idx) => {
14707
+ const findParentSectionIdx = useCallback17((idx) => {
14626
14708
  const match = /^(content\.children\.\[\d+\])/.exec(idx);
14627
14709
  return match ? match[1] : null;
14628
14710
  }, []);
14629
- const handleDragOver = useCallback16(
14711
+ const handleDragOver = useCallback17(
14630
14712
  (_e, dragInfo) => {
14631
14713
  const currentDataTransfer = useEditorStore.getState().dataTransfer;
14632
14714
  if (!currentDataTransfer) return;
@@ -15037,7 +15119,7 @@ function Editor({ setEditorLoading }) {
15037
15119
  [findParentSectionIdx]
15038
15120
  // Only dependency is the helper function
15039
15121
  );
15040
- const handleDrop = useCallback16(
15122
+ const handleDrop = useCallback17(
15041
15123
  (_e, _dragInfo) => {
15042
15124
  const currentDataTransfer = useEditorStore.getState().dataTransfer;
15043
15125
  if (!currentDataTransfer) return;
@@ -15176,7 +15258,7 @@ function Editor({ setEditorLoading }) {
15176
15258
  },
15177
15259
  [addElement, addElementInNewSection, moveElement, moveElementToNewSection, splitTextAndInsertElement, splitSectionAndInsertElement, setIsDragging, setIsDragButtonHovered, setDataTransfer, setHoverIdx]
15178
15260
  );
15179
- const handleDragLeave = useCallback16(() => {
15261
+ const handleDragLeave = useCallback17(() => {
15180
15262
  setDropIndicator(null);
15181
15263
  setDropTargetIdx(null);
15182
15264
  dragParentIdxRef.current = null;
@@ -15192,13 +15274,13 @@ function Editor({ setEditorLoading }) {
15192
15274
  sectionElementCacheRef.current.clear();
15193
15275
  sectionRectCacheRef.current.clear();
15194
15276
  }, []);
15195
- const handleShadowRootRef = useCallback16((shadowRoot) => {
15277
+ const handleShadowRootRef = useCallback17((shadowRoot) => {
15196
15278
  shadowRootRef.current = shadowRoot;
15197
15279
  }, []);
15198
- const handleSelectionRectChange = useCallback16((rect) => {
15280
+ const handleSelectionRectChange = useCallback17((rect) => {
15199
15281
  setHasSelectedElement(rect !== null);
15200
15282
  }, []);
15201
- const getReferenceRect = useCallback16(() => {
15283
+ const getReferenceRect = useCallback17(() => {
15202
15284
  if (!shadowRootRef.current || !focusIdx) return null;
15203
15285
  const selectedEl = shadowRootRef.current.querySelector(
15204
15286
  `.node-idx-${CSS.escape(focusIdx)}`
@@ -15226,7 +15308,7 @@ function Editor({ setEditorLoading }) {
15226
15308
  }, [focusIdx]);
15227
15309
  const selectedElement = focusIdx && renderData ? getValueByIdx(renderData, focusIdx) : null;
15228
15310
  const canDragSelectedElement = selectedElement && selectedElement.type !== "column" && !(focusIdx && renderData && isInsideCompanyFooter(focusIdx, renderData));
15229
- const showCompanyFooter = useMemo16(
15311
+ const showCompanyFooter = useMemo17(
15230
15312
  () => template.content[0]?.data?.value?.showCompanyFooter ?? true,
15231
15313
  [template.content[0]?.data?.value?.showCompanyFooter]
15232
15314
  );
@@ -15336,7 +15418,6 @@ export {
15336
15418
  parsePrice,
15337
15419
  json2mjml,
15338
15420
  MAX_TEMPLATE_SIZE,
15339
- MAX_PAID_LEVEL,
15340
15421
  useEditorStore,
15341
15422
  BUTTON_ALIGNMENTS,
15342
15423
  ALIGNMENT_ICONS,
@@ -15355,7 +15436,6 @@ export {
15355
15436
  MIN_LINE_HEIGHT,
15356
15437
  MAX_LINE_HEIGHT,
15357
15438
  LINE_HEIGHT_STEP,
15358
- IMAGE_SELECTION_VALID_TYPES,
15359
15439
  setupDragImage,
15360
15440
  getElementDisplayName,
15361
15441
  cn,