@maily-to/core 0.0.27 → 0.1.1

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.
@@ -35,7 +35,6 @@ import { Extension } from "@tiptap/core";
35
35
  import StarterKit from "@tiptap/starter-kit";
36
36
  import ListItem from "@tiptap/extension-list-item";
37
37
  import Paragraph from "@tiptap/extension-paragraph";
38
- import Placeholder from "@tiptap/extension-placeholder";
39
38
  import TextAlign from "@tiptap/extension-text-align";
40
39
  import TextStyle from "@tiptap/extension-text-style";
41
40
  import Heading from "@tiptap/extension-heading";
@@ -461,12 +460,7 @@ var SectionExtension = Node2.create({
461
460
  });
462
461
 
463
462
  // src/editor/nodes/spacer.ts
464
- var allowedSpacerSize = ["sm", "md", "lg", "xl"];
465
- var DEFAULT_HEIGHT = "sm";
466
- function getHeightStyle(height) {
467
- const heights = { sm: "8px", md: "16px", lg: "32px", xl: "64px" };
468
- return `width: 100%; height: ${heights[height] || heights[DEFAULT_HEIGHT]}`;
469
- }
463
+ var DEFAULT_SPACER_HEIGHT = 8;
470
464
  var Spacer = Node3.create({
471
465
  name: "spacer",
472
466
  priority: 1e3,
@@ -475,8 +469,8 @@ var Spacer = Node3.create({
475
469
  addAttributes() {
476
470
  return {
477
471
  height: {
478
- default: null,
479
- parseHTML: (element) => element.getAttribute("data-height"),
472
+ default: DEFAULT_SPACER_HEIGHT,
473
+ parseHTML: (element) => Number(element.getAttribute("data-height")),
480
474
  renderHTML: (attributes) => {
481
475
  return {
482
476
  "data-height": attributes.height
@@ -510,9 +504,6 @@ var Spacer = Node3.create({
510
504
  });
511
505
  },
512
506
  setSpacerSize: (height) => ({ commands }) => {
513
- if (!allowedSpacerSize.includes(height)) {
514
- throw new Error("Invalid spacer height");
515
- }
516
507
  return commands.updateAttributes("spacer", { height });
517
508
  },
518
509
  setSpacerShowIfKey: (showIfKey) => ({ commands }) => {
@@ -525,7 +516,6 @@ var Spacer = Node3.create({
525
516
  },
526
517
  renderHTML({ HTMLAttributes: HTMLAttributes2, node }) {
527
518
  const { height } = node.attrs;
528
- HTMLAttributes2.style = getHeightStyle(height);
529
519
  return [
530
520
  "div",
531
521
  mergeAttributes3(
@@ -535,8 +525,9 @@ var Spacer = Node3.create({
535
525
  this.options.HTMLAttributes,
536
526
  HTMLAttributes2,
537
527
  {
538
- class: "spacer mly-relative mly-z-50",
539
- contenteditable: false
528
+ class: "spacer mly-relative mly-full mly-z-50",
529
+ contenteditable: false,
530
+ style: `height: ${height}px;--spacer-height: ${height}px;`
540
531
  }
541
532
  )
542
533
  ];
@@ -1186,7 +1177,7 @@ var TooltipContent = React5.forwardRef((_a, ref) => {
1186
1177
  ref,
1187
1178
  sideOffset,
1188
1179
  className: cn(
1189
- "mly-z-50 mly-overflow-hidden mly-rounded-md mly-border mly-bg-white mly-px-2 mly-py-1 mly-text-xs mly-animate-in mly-fade-in-0 mly-zoom-in-95",
1180
+ "mly-z-50 mly-overflow-hidden mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-px-2 mly-py-1 mly-text-xs mly-animate-in mly-fade-in-0 mly-zoom-in-95",
1190
1181
  className
1191
1182
  )
1192
1183
  }, props)
@@ -1242,45 +1233,79 @@ function BubbleMenuButton(item) {
1242
1233
  }
1243
1234
 
1244
1235
  // src/editor/components/alignment-switch.tsx
1245
- import { jsx as jsx8 } from "react/jsx-runtime";
1236
+ import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
1246
1237
  function AlignmentSwitch(props) {
1247
1238
  const { alignment = "left", onAlignmentChange } = props;
1248
- const activeAlignment = {
1239
+ const alignments = {
1249
1240
  left: {
1250
1241
  icon: AlignLeft,
1251
1242
  tooltip: "Align Left",
1252
1243
  onClick: () => {
1253
- onAlignmentChange("center");
1244
+ onAlignmentChange("left");
1254
1245
  }
1255
1246
  },
1256
1247
  center: {
1257
1248
  icon: AlignCenter,
1258
1249
  tooltip: "Align Center",
1259
1250
  onClick: () => {
1260
- onAlignmentChange("right");
1251
+ onAlignmentChange("center");
1261
1252
  }
1262
1253
  },
1263
1254
  right: {
1264
1255
  icon: AlignRight,
1265
1256
  tooltip: "Align Right",
1266
1257
  onClick: () => {
1267
- onAlignmentChange("left");
1258
+ onAlignmentChange("right");
1268
1259
  }
1269
1260
  }
1270
- }[alignment];
1271
- return /* @__PURE__ */ jsx8(
1272
- BubbleMenuButton,
1273
- {
1274
- icon: activeAlignment.icon,
1275
- tooltip: activeAlignment.tooltip,
1276
- command: activeAlignment.onClick
1277
- }
1278
- );
1261
+ };
1262
+ const activeAlignment = alignments[alignment];
1263
+ return /* @__PURE__ */ jsxs3(Popover, { children: [
1264
+ /* @__PURE__ */ jsxs3(Tooltip, { children: [
1265
+ /* @__PURE__ */ jsx8(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx8(
1266
+ PopoverTrigger,
1267
+ {
1268
+ className: cn(
1269
+ "mly-flex mly-size-7 mly-items-center mly-justify-center mly-gap-1 mly-rounded-md mly-px-1.5 mly-text-sm data-[state=open]:mly-bg-soft-gray hover:mly-bg-soft-gray focus-visible:mly-relative focus-visible:mly-z-10 focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2"
1270
+ ),
1271
+ children: /* @__PURE__ */ jsx8(activeAlignment.icon, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5]" })
1272
+ }
1273
+ ) }),
1274
+ /* @__PURE__ */ jsx8(TooltipContent, { sideOffset: 8, children: "Alignment" })
1275
+ ] }),
1276
+ /* @__PURE__ */ jsx8(
1277
+ PopoverContent,
1278
+ {
1279
+ className: "mly-flex mly-w-max mly-gap-0.5 mly-rounded-lg !mly-p-0.5",
1280
+ side: "top",
1281
+ sideOffset: 8,
1282
+ align: "center",
1283
+ onOpenAutoFocus: (e) => {
1284
+ e.preventDefault();
1285
+ },
1286
+ onCloseAutoFocus: (e) => {
1287
+ e.preventDefault();
1288
+ },
1289
+ children: Object.entries(alignments).map(([key, value]) => {
1290
+ return /* @__PURE__ */ jsx8(
1291
+ BubbleMenuButton,
1292
+ {
1293
+ icon: value.icon,
1294
+ tooltip: value.tooltip,
1295
+ command: value.onClick,
1296
+ isActive: () => key === alignment
1297
+ },
1298
+ key
1299
+ );
1300
+ })
1301
+ }
1302
+ )
1303
+ ] });
1279
1304
  }
1280
1305
 
1281
1306
  // src/editor/components/ui/color-picker.tsx
1282
1307
  import { HexColorPicker, HexColorInput } from "react-colorful";
1283
- import { jsx as jsx9, jsxs as jsxs3 } from "react/jsx-runtime";
1308
+ import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
1284
1309
  function ColorPicker(props) {
1285
1310
  const {
1286
1311
  color,
@@ -1319,7 +1344,7 @@ function ColorPicker(props) {
1319
1344
  )
1320
1345
  }
1321
1346
  ) });
1322
- return /* @__PURE__ */ jsxs3(
1347
+ return /* @__PURE__ */ jsxs4(
1323
1348
  Popover,
1324
1349
  {
1325
1350
  onOpenChange: (open) => {
@@ -1328,7 +1353,7 @@ function ColorPicker(props) {
1328
1353
  }
1329
1354
  },
1330
1355
  children: [
1331
- tooltip ? /* @__PURE__ */ jsxs3(Tooltip, { children: [
1356
+ tooltip ? /* @__PURE__ */ jsxs4(Tooltip, { children: [
1332
1357
  /* @__PURE__ */ jsx9(TooltipTrigger, { asChild: true, children: popoverButton }),
1333
1358
  /* @__PURE__ */ jsx9(TooltipContent, { sideOffset: 8, children: tooltip })
1334
1359
  ] }) : popoverButton,
@@ -1337,7 +1362,7 @@ function ColorPicker(props) {
1337
1362
  {
1338
1363
  className: "mly-w-full mly-rounded-none mly-border-0 !mly-bg-transparent !mly-p-0 mly-shadow-none mly-drop-shadow-md",
1339
1364
  sideOffset: 8,
1340
- children: /* @__PURE__ */ jsxs3("div", { className: "mly-min-w-[260px] mly-rounded-xl mly-border mly-bg-white mly-p-4", children: [
1365
+ children: /* @__PURE__ */ jsxs4("div", { className: "mly-min-w-[260px] mly-rounded-xl mly-border mly-bg-white mly-p-4", children: [
1341
1366
  /* @__PURE__ */ jsx9(
1342
1367
  HexColorPicker,
1343
1368
  {
@@ -1356,7 +1381,7 @@ function ColorPicker(props) {
1356
1381
  prefixed: true
1357
1382
  }
1358
1383
  ),
1359
- suggestedColors.length > 0 && /* @__PURE__ */ jsxs3("div", { children: [
1384
+ suggestedColors.length > 0 && /* @__PURE__ */ jsxs4("div", { children: [
1360
1385
  /* @__PURE__ */ jsx9("div", { className: "-mly-mx-4 mly-my-4 mly-h-px mly-bg-gray-200" }),
1361
1386
  /* @__PURE__ */ jsx9("h2", { className: "mly-text-xs mly-text-gray-500", children: "Recently used" }),
1362
1387
  /* @__PURE__ */ jsx9("div", { className: "mly-mt-2 mly-flex mly-flex-wrap mly-gap-0.5", children: suggestedColors.map((suggestedColor) => /* @__PURE__ */ jsx9(
@@ -1414,6 +1439,9 @@ import { useRef as useRef3, useState as useState3 } from "react";
1414
1439
  // src/editor/provider.tsx
1415
1440
  import { createContext, useContext } from "react";
1416
1441
 
1442
+ // src/editor/extensions/slash-command/default-slash-commands.tsx
1443
+ import { FootprintsIcon as FootprintsIcon2, Heading1 as Heading12 } from "lucide-react";
1444
+
1417
1445
  // src/blocks/button.tsx
1418
1446
  import { MousePointer, ArrowUpRightSquare } from "lucide-react";
1419
1447
  import { jsx as jsx11 } from "react/jsx-runtime";
@@ -1434,21 +1462,35 @@ var linkCard = {
1434
1462
  command: ({ editor, range }) => {
1435
1463
  editor.chain().focus().deleteRange(range).setLinkCard().run();
1436
1464
  },
1437
- shouldBeHidden: (editor) => {
1465
+ render: (editor) => {
1438
1466
  return editor.extensionManager.extensions.findIndex(
1439
1467
  (ext) => ext.name === "linkCard"
1440
- ) === -1;
1468
+ ) === -1 ? null : true;
1469
+ }
1470
+ };
1471
+
1472
+ // src/blocks/code.tsx
1473
+ import { CodeXmlIcon } from "lucide-react";
1474
+ import { jsx as jsx12 } from "react/jsx-runtime";
1475
+ var htmlCodeBlock = {
1476
+ title: "Custom HTML",
1477
+ description: "Insert a custom HTML block",
1478
+ searchTerms: ["html", "code", "custom"],
1479
+ icon: /* @__PURE__ */ jsx12(CodeXmlIcon, { className: "mly-h-4 mly-w-4" }),
1480
+ command: ({ editor, range }) => {
1481
+ editor.chain().focus().deleteRange(range).setHtmlCodeBlock({ language: "html" }).run();
1441
1482
  }
1442
1483
  };
1443
1484
 
1444
1485
  // src/blocks/image.tsx
1486
+ import { TextSelection as TextSelection2 } from "@tiptap/pm/state";
1445
1487
  import { ImageIcon } from "lucide-react";
1446
- import { jsx as jsx12 } from "react/jsx-runtime";
1488
+ import { jsx as jsx13 } from "react/jsx-runtime";
1447
1489
  var image = {
1448
1490
  title: "Image",
1449
1491
  description: "Full width image",
1450
1492
  searchTerms: ["image"],
1451
- icon: /* @__PURE__ */ jsx12(ImageIcon, { className: "mly-h-4 mly-w-4" }),
1493
+ icon: /* @__PURE__ */ jsx13(ImageIcon, { className: "mly-h-4 mly-w-4" }),
1452
1494
  command: ({ editor, range }) => {
1453
1495
  editor.chain().focus().deleteRange(range).setImage({ src: "" }).run();
1454
1496
  }
@@ -1457,11 +1499,36 @@ var logo = {
1457
1499
  title: "Logo",
1458
1500
  description: "Add your brand logo",
1459
1501
  searchTerms: ["image", "logo"],
1460
- icon: /* @__PURE__ */ jsx12(ImageIcon, { className: "mly-h-4 mly-w-4" }),
1502
+ icon: /* @__PURE__ */ jsx13(ImageIcon, { className: "mly-h-4 mly-w-4" }),
1461
1503
  command: ({ editor, range }) => {
1462
1504
  editor.chain().focus().deleteRange(range).setLogoImage({ src: "" }).run();
1463
1505
  }
1464
1506
  };
1507
+ var inlineImage = {
1508
+ title: "Inline Image",
1509
+ description: "Inline image",
1510
+ searchTerms: ["image", "inline"],
1511
+ icon: /* @__PURE__ */ jsx13(ImageIcon, { className: "mly-h-4 mly-w-4" }),
1512
+ command: ({ editor, range }) => {
1513
+ editor.chain().focus().deleteRange(range).setInlineImage({
1514
+ src: ""
1515
+ }).command((props) => {
1516
+ const { tr, state, view, editor: editor2 } = props;
1517
+ const { from } = range;
1518
+ const node = state.doc.nodeAt(from);
1519
+ if (!node) {
1520
+ return false;
1521
+ }
1522
+ const selection = TextSelection2.create(
1523
+ tr.doc,
1524
+ from,
1525
+ from + node.nodeSize
1526
+ );
1527
+ tr.setSelection(selection);
1528
+ return true;
1529
+ }).run();
1530
+ }
1531
+ };
1465
1532
 
1466
1533
  // src/blocks/layout.tsx
1467
1534
  import {
@@ -1471,15 +1538,12 @@ import {
1471
1538
  RectangleHorizontal,
1472
1539
  Minus
1473
1540
  } from "lucide-react";
1474
- import { jsx as jsx13 } from "react/jsx-runtime";
1541
+ import { jsx as jsx14 } from "react/jsx-runtime";
1475
1542
  var columns = {
1476
1543
  title: "Columns",
1477
1544
  description: "Add columns to email.",
1478
1545
  searchTerms: ["layout", "columns"],
1479
- icon: /* @__PURE__ */ jsx13(ColumnsIcon, { className: "mly-h-4 mly-w-4" }),
1480
- shouldBeHidden: (editor) => {
1481
- return editor.isActive("columns");
1482
- },
1546
+ icon: /* @__PURE__ */ jsx14(ColumnsIcon, { className: "mly-h-4 mly-w-4" }),
1483
1547
  command: ({ editor, range }) => {
1484
1548
  editor.chain().focus().deleteRange(range).setColumns().focus(editor.state.selection.head - 2).run();
1485
1549
  }
@@ -1488,7 +1552,7 @@ var section = {
1488
1552
  title: "Section",
1489
1553
  description: "Add a section to email.",
1490
1554
  searchTerms: ["layout", "section"],
1491
- icon: /* @__PURE__ */ jsx13(RectangleHorizontal, { className: "mly-h-4 mly-w-4" }),
1555
+ icon: /* @__PURE__ */ jsx14(RectangleHorizontal, { className: "mly-h-4 mly-w-4" }),
1492
1556
  command: ({ editor, range }) => {
1493
1557
  editor.chain().focus().deleteRange(range).setSection().run();
1494
1558
  }
@@ -1497,10 +1561,7 @@ var repeat = {
1497
1561
  title: "Repeat",
1498
1562
  description: "Loop over an array of items.",
1499
1563
  searchTerms: ["repeat", "for", "loop"],
1500
- icon: /* @__PURE__ */ jsx13(Repeat2, { className: "mly-h-4 mly-w-4" }),
1501
- shouldBeHidden: (editor) => {
1502
- return editor.isActive("repeat");
1503
- },
1564
+ icon: /* @__PURE__ */ jsx14(Repeat2, { className: "mly-h-4 mly-w-4" }),
1504
1565
  command: ({ editor, range }) => {
1505
1566
  editor.chain().focus().deleteRange(range).setRepeat().run();
1506
1567
  }
@@ -1509,7 +1570,7 @@ var spacer = {
1509
1570
  title: "Spacer",
1510
1571
  description: "Add space between blocks.",
1511
1572
  searchTerms: ["space", "gap", "divider"],
1512
- icon: /* @__PURE__ */ jsx13(MoveVertical, { className: "mly-h-4 mly-w-4" }),
1573
+ icon: /* @__PURE__ */ jsx14(MoveVertical, { className: "mly-h-4 mly-w-4" }),
1513
1574
  command: ({ editor, range }) => {
1514
1575
  editor.chain().focus().deleteRange(range).setSpacer({ height: "sm" }).run();
1515
1576
  }
@@ -1518,7 +1579,7 @@ var divider = {
1518
1579
  title: "Divider",
1519
1580
  description: "Add a horizontal divider.",
1520
1581
  searchTerms: ["divider", "line"],
1521
- icon: /* @__PURE__ */ jsx13(Minus, { className: "mly-h-4 mly-w-4" }),
1582
+ icon: /* @__PURE__ */ jsx14(Minus, { className: "mly-h-4 mly-w-4" }),
1522
1583
  command: ({ editor, range }) => {
1523
1584
  editor.chain().focus().deleteRange(range).setHorizontalRule().run();
1524
1585
  }
@@ -1526,12 +1587,12 @@ var divider = {
1526
1587
 
1527
1588
  // src/blocks/list.tsx
1528
1589
  import { List, ListOrdered } from "lucide-react";
1529
- import { jsx as jsx14 } from "react/jsx-runtime";
1590
+ import { jsx as jsx15 } from "react/jsx-runtime";
1530
1591
  var bulletList = {
1531
1592
  title: "Bullet List",
1532
1593
  description: "Create a simple bullet list.",
1533
1594
  searchTerms: ["unordered", "point"],
1534
- icon: /* @__PURE__ */ jsx14(List, { className: "mly-h-4 mly-w-4" }),
1595
+ icon: /* @__PURE__ */ jsx15(List, { className: "mly-h-4 mly-w-4" }),
1535
1596
  command: ({ editor, range }) => {
1536
1597
  editor.chain().focus().deleteRange(range).toggleBulletList().run();
1537
1598
  }
@@ -1540,7 +1601,7 @@ var orderedList = {
1540
1601
  title: "Numbered List",
1541
1602
  description: "Create a list with numbering.",
1542
1603
  searchTerms: ["ordered"],
1543
- icon: /* @__PURE__ */ jsx14(ListOrdered, { className: "mly-h-4 mly-w-4" }),
1604
+ icon: /* @__PURE__ */ jsx15(ListOrdered, { className: "mly-h-4 mly-w-4" }),
1544
1605
  command: ({ editor, range }) => {
1545
1606
  editor.chain().focus().deleteRange(range).toggleOrderedList().run();
1546
1607
  }
@@ -1557,12 +1618,12 @@ import {
1557
1618
  FootprintsIcon,
1558
1619
  EraserIcon
1559
1620
  } from "lucide-react";
1560
- import { jsx as jsx15 } from "react/jsx-runtime";
1621
+ import { jsx as jsx16 } from "react/jsx-runtime";
1561
1622
  var text = {
1562
1623
  title: "Text",
1563
1624
  description: "Just start typing with plain text.",
1564
1625
  searchTerms: ["p", "paragraph"],
1565
- icon: /* @__PURE__ */ jsx15(Text, { className: "mly-h-4 mly-w-4" }),
1626
+ icon: /* @__PURE__ */ jsx16(Text, { className: "mly-h-4 mly-w-4" }),
1566
1627
  command: ({ editor, range }) => {
1567
1628
  editor.chain().focus().deleteRange(range).toggleNode("paragraph", "paragraph").run();
1568
1629
  }
@@ -1571,7 +1632,7 @@ var heading1 = {
1571
1632
  title: "Heading 1",
1572
1633
  description: "Big heading.",
1573
1634
  searchTerms: ["title", "big", "large"],
1574
- icon: /* @__PURE__ */ jsx15(Heading1, { className: "mly-h-4 mly-w-4" }),
1635
+ icon: /* @__PURE__ */ jsx16(Heading1, { className: "mly-h-4 mly-w-4" }),
1575
1636
  command: ({ editor, range }) => {
1576
1637
  editor.chain().focus().deleteRange(range).setNode("heading", { level: 1 }).run();
1577
1638
  }
@@ -1580,7 +1641,7 @@ var heading2 = {
1580
1641
  title: "Heading 2",
1581
1642
  description: "Medium heading.",
1582
1643
  searchTerms: ["subtitle", "medium"],
1583
- icon: /* @__PURE__ */ jsx15(Heading2, { className: "mly-h-4 mly-w-4" }),
1644
+ icon: /* @__PURE__ */ jsx16(Heading2, { className: "mly-h-4 mly-w-4" }),
1584
1645
  command: ({ editor, range }) => {
1585
1646
  editor.chain().focus().deleteRange(range).setNode("heading", { level: 2 }).run();
1586
1647
  }
@@ -1589,7 +1650,7 @@ var heading3 = {
1589
1650
  title: "Heading 3",
1590
1651
  description: "Small heading.",
1591
1652
  searchTerms: ["subtitle", "small"],
1592
- icon: /* @__PURE__ */ jsx15(Heading3, { className: "mly-h-4 mly-w-4" }),
1653
+ icon: /* @__PURE__ */ jsx16(Heading3, { className: "mly-h-4 mly-w-4" }),
1593
1654
  command: ({ editor, range }) => {
1594
1655
  editor.chain().focus().deleteRange(range).setNode("heading", { level: 3 }).run();
1595
1656
  }
@@ -1598,7 +1659,7 @@ var hardBreak = {
1598
1659
  title: "Hard Break",
1599
1660
  description: "Add a break between lines.",
1600
1661
  searchTerms: ["break", "line"],
1601
- icon: /* @__PURE__ */ jsx15(DivideIcon, { className: "mly-h-4 mly-w-4" }),
1662
+ icon: /* @__PURE__ */ jsx16(DivideIcon, { className: "mly-h-4 mly-w-4" }),
1602
1663
  command: ({ editor, range }) => {
1603
1664
  editor.chain().focus().deleteRange(range).setHardBreak().run();
1604
1665
  }
@@ -1607,7 +1668,7 @@ var blockquote = {
1607
1668
  title: "Blockquote",
1608
1669
  description: "Add blockquote.",
1609
1670
  searchTerms: ["quote", "blockquote"],
1610
- icon: /* @__PURE__ */ jsx15(TextQuote, { className: "mly-h-4 mly-w-4" }),
1671
+ icon: /* @__PURE__ */ jsx16(TextQuote, { className: "mly-h-4 mly-w-4" }),
1611
1672
  command: ({ editor, range }) => {
1612
1673
  editor.chain().focus().deleteRange(range).toggleBlockquote().run();
1613
1674
  }
@@ -1616,7 +1677,7 @@ var footer = {
1616
1677
  title: "Footer",
1617
1678
  description: "Add a footer text to email.",
1618
1679
  searchTerms: ["footer", "text"],
1619
- icon: /* @__PURE__ */ jsx15(FootprintsIcon, { className: "mly-h-4 mly-w-4" }),
1680
+ icon: /* @__PURE__ */ jsx16(FootprintsIcon, { className: "mly-h-4 mly-w-4" }),
1620
1681
  command: ({ editor, range }) => {
1621
1682
  editor.chain().focus().deleteRange(range).setFooter().run();
1622
1683
  }
@@ -1625,114 +1686,752 @@ var clearLine = {
1625
1686
  title: "Clear Line",
1626
1687
  description: "Clear the current line.",
1627
1688
  searchTerms: ["clear", "line"],
1628
- icon: /* @__PURE__ */ jsx15(EraserIcon, { className: "mly-h-4 mly-w-4" }),
1689
+ icon: /* @__PURE__ */ jsx16(EraserIcon, { className: "mly-h-4 mly-w-4" }),
1629
1690
  command: ({ editor, range }) => {
1630
1691
  editor.chain().focus().selectParentNode().deleteSelection().run();
1631
1692
  }
1632
1693
  };
1633
1694
 
1634
- // src/editor/extensions/slash-command/default-slash-commands.ts
1695
+ // src/editor/components/icons/logo-with-cover-image.tsx
1696
+ import { jsx as jsx17, jsxs as jsxs5 } from "react/jsx-runtime";
1697
+ function LogoWithCoverImageIcon(props) {
1698
+ return /* @__PURE__ */ jsxs5(
1699
+ "svg",
1700
+ __spreadProps(__spreadValues({
1701
+ width: "14",
1702
+ height: "14",
1703
+ viewBox: "0 0 14 14",
1704
+ fill: "none",
1705
+ xmlns: "http://www.w3.org/2000/svg"
1706
+ }, props), {
1707
+ children: [
1708
+ /* @__PURE__ */ jsx17(
1709
+ "path",
1710
+ {
1711
+ fillRule: "evenodd",
1712
+ clipRule: "evenodd",
1713
+ d: "M4.97634 1.4502H9.02405C9.70389 1.4502 10.2476 1.45019 10.687 1.48609C11.1379 1.52293 11.527 1.6003 11.8849 1.78263C12.4588 2.07504 12.9254 2.54164 13.2178 3.11553C13.4001 3.47338 13.4775 3.86253 13.5143 4.31342C13.5502 4.75277 13.5502 5.29652 13.5502 5.97637V8.02403C13.5502 8.70388 13.5502 9.24763 13.5143 9.68698C13.4775 10.1379 13.4001 10.527 13.2178 10.8849C12.9254 11.4588 12.4588 11.9254 11.8849 12.2178C11.527 12.4001 11.1379 12.4775 10.687 12.5143C10.2476 12.5502 9.70387 12.5502 9.02402 12.5502H4.97636C4.29651 12.5502 3.75276 12.5502 3.31341 12.5143C2.86252 12.4775 2.47337 12.4001 2.11552 12.2178C1.54163 11.9254 1.07504 11.4588 0.782626 10.8849C0.600293 10.527 0.522922 10.1379 0.486083 9.68698C0.450187 9.24764 0.45019 8.70389 0.450195 8.02405V5.97635C0.45019 5.29651 0.450187 4.75276 0.486083 4.31342C0.522922 3.86253 0.600293 3.47338 0.782626 3.11553C1.07504 2.54164 1.54163 2.07504 2.11552 1.78263C2.47337 1.6003 2.86252 1.52293 3.31341 1.48609C3.75276 1.45019 4.2965 1.4502 4.97634 1.4502ZM3.40298 2.58243C3.02012 2.61372 2.79184 2.67259 2.61491 2.76274C2.248 2.94969 1.94968 3.248 1.76273 3.61492C1.67258 3.79185 1.61371 4.02013 1.58243 4.40299C1.55062 4.79228 1.55019 5.29106 1.55019 6.0002V8.0002C1.55019 8.70934 1.55062 9.20812 1.58243 9.59741C1.61371 9.98028 1.67258 10.2086 1.76273 10.3855C1.94968 10.7524 2.248 11.0507 2.61491 11.2377C2.79184 11.3278 3.02012 11.3867 3.40298 11.418C3.79227 11.4498 4.29105 11.4502 5.00019 11.4502H9.00019C9.70933 11.4502 10.2081 11.4498 10.5974 11.418C10.9803 11.3867 11.2086 11.3278 11.3855 11.2377C11.7524 11.0507 12.0507 10.7524 12.2377 10.3855C12.3278 10.2086 12.3867 9.98028 12.418 9.59741C12.4498 9.20812 12.4502 8.70934 12.4502 8.0002V6.0002C12.4502 5.29106 12.4498 4.79228 12.418 4.40299C12.3867 4.02013 12.3278 3.79185 12.2377 3.61492C12.0507 3.248 11.7524 2.94969 11.3855 2.76274C11.2086 2.67259 10.9803 2.61372 10.5974 2.58243C10.2081 2.55063 9.70933 2.5502 9.00019 2.5502H5.00019C4.29105 2.5502 3.79227 2.55063 3.40298 2.58243Z",
1714
+ fill: "currentColor"
1715
+ }
1716
+ ),
1717
+ /* @__PURE__ */ jsx17(
1718
+ "path",
1719
+ {
1720
+ fillRule: "evenodd",
1721
+ clipRule: "evenodd",
1722
+ d: "M4.1999 0.450195C4.50366 0.450195 4.7499 0.696438 4.7499 1.00019V2.75019C4.7499 3.05395 4.50366 3.30019 4.1999 3.30019C3.89614 3.30019 3.6499 3.05395 3.6499 2.75019V1.00019C3.6499 0.696438 3.89614 0.450195 4.1999 0.450195Z",
1723
+ fill: "currentColor"
1724
+ }
1725
+ ),
1726
+ /* @__PURE__ */ jsx17(
1727
+ "path",
1728
+ {
1729
+ fillRule: "evenodd",
1730
+ clipRule: "evenodd",
1731
+ d: "M9.8 0.450195C10.1037 0.450195 10.35 0.696438 10.35 1.00019V2.75019C10.35 3.05395 10.1037 3.30019 9.8 3.30019C9.49625 3.30019 9.25 3.05395 9.25 2.75019V1.00019C9.25 0.696438 9.49625 0.450195 9.8 0.450195Z",
1732
+ fill: "currentColor"
1733
+ }
1734
+ ),
1735
+ /* @__PURE__ */ jsx17("mask", { id: "path-4-inside-1_1046_19527", fill: "white", children: /* @__PURE__ */ jsx17("rect", { x: "3", y: "4", width: "8", height: "3", rx: "0.5" }) }),
1736
+ /* @__PURE__ */ jsx17(
1737
+ "rect",
1738
+ {
1739
+ x: "3",
1740
+ y: "4",
1741
+ width: "8",
1742
+ height: "3",
1743
+ rx: "0.5",
1744
+ stroke: "black",
1745
+ strokeWidth: "2",
1746
+ mask: "url(#path-4-inside-1_1046_19527)"
1747
+ }
1748
+ ),
1749
+ /* @__PURE__ */ jsx17(
1750
+ "rect",
1751
+ {
1752
+ x: "6.25",
1753
+ y: "8.25",
1754
+ width: "4.5",
1755
+ height: "0.5",
1756
+ rx: "0.25",
1757
+ stroke: "black",
1758
+ strokeWidth: "0.5"
1759
+ }
1760
+ ),
1761
+ /* @__PURE__ */ jsx17("rect", { x: "3", y: "8", width: "2", height: "1", rx: "0.5", fill: "currentColor" })
1762
+ ]
1763
+ })
1764
+ );
1765
+ }
1766
+
1767
+ // src/editor/components/icons/logo-with-text-horizon.tsx
1768
+ import { jsx as jsx18, jsxs as jsxs6 } from "react/jsx-runtime";
1769
+ function LogoWithTextHorizonIcon(props) {
1770
+ return /* @__PURE__ */ jsxs6(
1771
+ "svg",
1772
+ __spreadProps(__spreadValues({
1773
+ width: "14",
1774
+ height: "14",
1775
+ viewBox: "0 0 14 14",
1776
+ fill: "none",
1777
+ xmlns: "http://www.w3.org/2000/svg"
1778
+ }, props), {
1779
+ children: [
1780
+ /* @__PURE__ */ jsx18(
1781
+ "path",
1782
+ {
1783
+ fillRule: "evenodd",
1784
+ clipRule: "evenodd",
1785
+ d: "M4.97634 1.4502H9.02405C9.70389 1.4502 10.2476 1.45019 10.687 1.48609C11.1379 1.52293 11.527 1.6003 11.8849 1.78263C12.4588 2.07504 12.9254 2.54164 13.2178 3.11553C13.4001 3.47338 13.4775 3.86253 13.5143 4.31342C13.5502 4.75277 13.5502 5.29652 13.5502 5.97637V8.02403C13.5502 8.70388 13.5502 9.24763 13.5143 9.68698C13.4775 10.1379 13.4001 10.527 13.2178 10.8849C12.9254 11.4588 12.4588 11.9254 11.8849 12.2178C11.527 12.4001 11.1379 12.4775 10.687 12.5143C10.2476 12.5502 9.70387 12.5502 9.02402 12.5502H4.97636C4.29651 12.5502 3.75276 12.5502 3.31341 12.5143C2.86252 12.4775 2.47337 12.4001 2.11552 12.2178C1.54163 11.9254 1.07504 11.4588 0.782626 10.8849C0.600293 10.527 0.522922 10.1379 0.486083 9.68698C0.450187 9.24764 0.45019 8.70389 0.450195 8.02405V5.97635C0.45019 5.29651 0.450187 4.75276 0.486083 4.31342C0.522922 3.86253 0.600293 3.47338 0.782626 3.11553C1.07504 2.54164 1.54163 2.07504 2.11552 1.78263C2.47337 1.6003 2.86252 1.52293 3.31341 1.48609C3.75276 1.45019 4.2965 1.4502 4.97634 1.4502ZM3.40298 2.58243C3.02012 2.61372 2.79184 2.67259 2.61491 2.76274C2.248 2.94969 1.94968 3.248 1.76273 3.61492C1.67258 3.79185 1.61371 4.02013 1.58243 4.40299C1.55062 4.79228 1.55019 5.29106 1.55019 6.0002V8.0002C1.55019 8.70934 1.55062 9.20812 1.58243 9.59741C1.61371 9.98028 1.67258 10.2086 1.76273 10.3855C1.94968 10.7524 2.248 11.0507 2.61491 11.2377C2.79184 11.3278 3.02012 11.3867 3.40298 11.418C3.79227 11.4498 4.29105 11.4502 5.00019 11.4502H9.00019C9.70933 11.4502 10.2081 11.4498 10.5974 11.418C10.9803 11.3867 11.2086 11.3278 11.3855 11.2377C11.7524 11.0507 12.0507 10.7524 12.2377 10.3855C12.3278 10.2086 12.3867 9.98028 12.418 9.59741C12.4498 9.20812 12.4502 8.70934 12.4502 8.0002V6.0002C12.4502 5.29106 12.4498 4.79228 12.418 4.40299C12.3867 4.02013 12.3278 3.79185 12.2377 3.61492C12.0507 3.248 11.7524 2.94969 11.3855 2.76274C11.2086 2.67259 10.9803 2.61372 10.5974 2.58243C10.2081 2.55063 9.70933 2.5502 9.00019 2.5502H5.00019C4.29105 2.5502 3.79227 2.55063 3.40298 2.58243Z",
1786
+ fill: "currentColor"
1787
+ }
1788
+ ),
1789
+ /* @__PURE__ */ jsx18(
1790
+ "rect",
1791
+ {
1792
+ x: "6.25",
1793
+ y: "6.75",
1794
+ width: "4.5",
1795
+ height: "0.5",
1796
+ rx: "0.25",
1797
+ stroke: "black",
1798
+ strokeWidth: "0.5"
1799
+ }
1800
+ ),
1801
+ /* @__PURE__ */ jsx18("rect", { x: "3", y: "6.5", width: "2", height: "1", rx: "0.5", fill: "currentColor" }),
1802
+ /* @__PURE__ */ jsx18(
1803
+ "path",
1804
+ {
1805
+ fillRule: "evenodd",
1806
+ clipRule: "evenodd",
1807
+ d: "M4.1999 0.450195C4.50366 0.450195 4.7499 0.696438 4.7499 1.00019V2.75019C4.7499 3.05395 4.50366 3.30019 4.1999 3.30019C3.89614 3.30019 3.6499 3.05395 3.6499 2.75019V1.00019C3.6499 0.696438 3.89614 0.450195 4.1999 0.450195Z",
1808
+ fill: "currentColor"
1809
+ }
1810
+ ),
1811
+ /* @__PURE__ */ jsx18(
1812
+ "path",
1813
+ {
1814
+ fillRule: "evenodd",
1815
+ clipRule: "evenodd",
1816
+ d: "M9.8 0.450195C10.1037 0.450195 10.35 0.696438 10.35 1.00019V2.75019C10.35 3.05395 10.1037 3.30019 9.8 3.30019C9.49625 3.30019 9.25 3.05395 9.25 2.75019V1.00019C9.25 0.696438 9.49625 0.450195 9.8 0.450195Z",
1817
+ fill: "currentColor"
1818
+ }
1819
+ )
1820
+ ]
1821
+ })
1822
+ );
1823
+ }
1824
+
1825
+ // src/editor/components/icons/logo-with-text-vertical.tsx
1826
+ import { jsx as jsx19, jsxs as jsxs7 } from "react/jsx-runtime";
1827
+ function LogoWithTextVerticalIcon(props) {
1828
+ return /* @__PURE__ */ jsxs7(
1829
+ "svg",
1830
+ __spreadProps(__spreadValues({
1831
+ width: "14",
1832
+ height: "14",
1833
+ viewBox: "0 0 14 14",
1834
+ fill: "none",
1835
+ xmlns: "http://www.w3.org/2000/svg"
1836
+ }, props), {
1837
+ children: [
1838
+ /* @__PURE__ */ jsx19(
1839
+ "path",
1840
+ {
1841
+ fillRule: "evenodd",
1842
+ clipRule: "evenodd",
1843
+ d: "M4.97634 1.4502H9.02405C9.70389 1.4502 10.2476 1.45019 10.687 1.48609C11.1379 1.52293 11.527 1.6003 11.8849 1.78263C12.4588 2.07504 12.9254 2.54164 13.2178 3.11553C13.4001 3.47338 13.4775 3.86253 13.5143 4.31342C13.5502 4.75277 13.5502 5.29652 13.5502 5.97637V8.02403C13.5502 8.70388 13.5502 9.24763 13.5143 9.68698C13.4775 10.1379 13.4001 10.527 13.2178 10.8849C12.9254 11.4588 12.4588 11.9254 11.8849 12.2178C11.527 12.4001 11.1379 12.4775 10.687 12.5143C10.2476 12.5502 9.70387 12.5502 9.02402 12.5502H4.97636C4.29651 12.5502 3.75276 12.5502 3.31341 12.5143C2.86252 12.4775 2.47337 12.4001 2.11552 12.2178C1.54163 11.9254 1.07504 11.4588 0.782626 10.8849C0.600293 10.527 0.522922 10.1379 0.486083 9.68698C0.450187 9.24764 0.45019 8.70389 0.450195 8.02405V5.97635C0.45019 5.29651 0.450187 4.75276 0.486083 4.31342C0.522922 3.86253 0.600293 3.47338 0.782626 3.11553C1.07504 2.54164 1.54163 2.07504 2.11552 1.78263C2.47337 1.6003 2.86252 1.52293 3.31341 1.48609C3.75276 1.45019 4.2965 1.4502 4.97634 1.4502ZM3.40298 2.58243C3.02012 2.61372 2.79184 2.67259 2.61491 2.76274C2.248 2.94969 1.94968 3.248 1.76273 3.61492C1.67258 3.79185 1.61371 4.02013 1.58243 4.40299C1.55062 4.79228 1.55019 5.29106 1.55019 6.0002V8.0002C1.55019 8.70934 1.55062 9.20812 1.58243 9.59741C1.61371 9.98028 1.67258 10.2086 1.76273 10.3855C1.94968 10.7524 2.248 11.0507 2.61491 11.2377C2.79184 11.3278 3.02012 11.3867 3.40298 11.418C3.79227 11.4498 4.29105 11.4502 5.00019 11.4502H9.00019C9.70933 11.4502 10.2081 11.4498 10.5974 11.418C10.9803 11.3867 11.2086 11.3278 11.3855 11.2377C11.7524 11.0507 12.0507 10.7524 12.2377 10.3855C12.3278 10.2086 12.3867 9.98028 12.418 9.59741C12.4498 9.20812 12.4502 8.70934 12.4502 8.0002V6.0002C12.4502 5.29106 12.4498 4.79228 12.418 4.40299C12.3867 4.02013 12.3278 3.79185 12.2377 3.61492C12.0507 3.248 11.7524 2.94969 11.3855 2.76274C11.2086 2.67259 10.9803 2.61372 10.5974 2.58243C10.2081 2.55063 9.70933 2.5502 9.00019 2.5502H5.00019C4.29105 2.5502 3.79227 2.55063 3.40298 2.58243Z",
1844
+ fill: "currentColor"
1845
+ }
1846
+ ),
1847
+ /* @__PURE__ */ jsx19(
1848
+ "rect",
1849
+ {
1850
+ x: "4.25",
1851
+ y: "8.25",
1852
+ width: "5.5",
1853
+ height: "0.5",
1854
+ rx: "0.25",
1855
+ stroke: "black",
1856
+ strokeWidth: "0.5"
1857
+ }
1858
+ ),
1859
+ /* @__PURE__ */ jsx19("rect", { x: "6", y: "6", width: "2", height: "1", rx: "0.5", fill: "currentColor" }),
1860
+ /* @__PURE__ */ jsx19(
1861
+ "path",
1862
+ {
1863
+ fillRule: "evenodd",
1864
+ clipRule: "evenodd",
1865
+ d: "M4.1999 0.450195C4.50366 0.450195 4.7499 0.696438 4.7499 1.00019V2.75019C4.7499 3.05395 4.50366 3.30019 4.1999 3.30019C3.89614 3.30019 3.6499 3.05395 3.6499 2.75019V1.00019C3.6499 0.696438 3.89614 0.450195 4.1999 0.450195Z",
1866
+ fill: "currentColor"
1867
+ }
1868
+ ),
1869
+ /* @__PURE__ */ jsx19(
1870
+ "path",
1871
+ {
1872
+ fillRule: "evenodd",
1873
+ clipRule: "evenodd",
1874
+ d: "M9.8 0.450195C10.1037 0.450195 10.35 0.696438 10.35 1.00019V2.75019C10.35 3.05395 10.1037 3.30019 9.8 3.30019C9.49625 3.30019 9.25 3.05395 9.25 2.75019V1.00019C9.25 0.696438 9.49625 0.450195 9.8 0.450195Z",
1875
+ fill: "currentColor"
1876
+ }
1877
+ )
1878
+ ]
1879
+ })
1880
+ );
1881
+ }
1882
+
1883
+ // src/blocks/headers.tsx
1884
+ import { jsx as jsx20 } from "react/jsx-runtime";
1885
+ var headerLogoWithTextHorizontal = {
1886
+ title: "Logo with Text (Horizontal)",
1887
+ description: "Logo and a text horizontally",
1888
+ searchTerms: ["logo", "text"],
1889
+ icon: /* @__PURE__ */ jsx20(LogoWithTextHorizonIcon, { className: "mly-h-4 mly-w-4" }),
1890
+ command: ({ editor, range }) => {
1891
+ editor.chain().deleteRange(range).insertContent({
1892
+ type: "columns",
1893
+ attrs: { showIfKey: null, gap: 8 },
1894
+ content: [
1895
+ {
1896
+ type: "column",
1897
+ attrs: {
1898
+ columnId: "36de3eda-0677-47c3-a8b7-e071dec9ce30",
1899
+ width: "auto",
1900
+ verticalAlign: "middle"
1901
+ },
1902
+ content: [
1903
+ {
1904
+ type: "image",
1905
+ attrs: {
1906
+ src: "https://maily.to/brand/logo.png",
1907
+ alt: null,
1908
+ title: null,
1909
+ width: "32",
1910
+ height: "32",
1911
+ alignment: "left",
1912
+ externalLink: null,
1913
+ isExternalLinkVariable: false,
1914
+ isSrcVariable: false,
1915
+ showIfKey: null
1916
+ }
1917
+ }
1918
+ ]
1919
+ },
1920
+ {
1921
+ type: "column",
1922
+ attrs: {
1923
+ columnId: "6feb593e-374a-4479-a1c7-872c60c2f4e0",
1924
+ width: "auto",
1925
+ verticalAlign: "bottom"
1926
+ },
1927
+ content: [
1928
+ {
1929
+ type: "heading",
1930
+ attrs: {
1931
+ textAlign: "right",
1932
+ level: 3,
1933
+ showIfKey: null
1934
+ },
1935
+ content: [
1936
+ {
1937
+ type: "text",
1938
+ marks: [{ type: "bold" }],
1939
+ text: "Weekly Newsletter"
1940
+ }
1941
+ ]
1942
+ }
1943
+ ]
1944
+ }
1945
+ ]
1946
+ }).run();
1947
+ }
1948
+ };
1949
+ var headerLogoWithTextVertical = {
1950
+ title: "Logo with Text (Vertical)",
1951
+ description: "Logo and a text vertically",
1952
+ searchTerms: ["logo", "text"],
1953
+ icon: /* @__PURE__ */ jsx20(LogoWithTextVerticalIcon, { className: "mly-h-4 mly-w-4" }),
1954
+ command: ({ editor, range }) => {
1955
+ editor.chain().deleteRange(range).insertContent([
1956
+ {
1957
+ type: "image",
1958
+ attrs: {
1959
+ src: "https://maily.to/brand/logo.png",
1960
+ alt: null,
1961
+ title: null,
1962
+ width: "48",
1963
+ height: "48",
1964
+ alignment: "center",
1965
+ externalLink: null,
1966
+ isExternalLinkVariable: false,
1967
+ isSrcVariable: false,
1968
+ showIfKey: null
1969
+ }
1970
+ },
1971
+ { type: "spacer", attrs: { height: 8, showIfKey: null } },
1972
+ {
1973
+ type: "heading",
1974
+ attrs: { textAlign: "center", level: 2, showIfKey: null },
1975
+ content: [{ type: "text", text: "Maily" }]
1976
+ }
1977
+ ]).run();
1978
+ }
1979
+ };
1980
+ var headerLogoWithCoverImage = {
1981
+ title: "Logo with Cover Image",
1982
+ description: "Logo and a cover image",
1983
+ searchTerms: ["logo", "cover", "image"],
1984
+ icon: /* @__PURE__ */ jsx20(LogoWithCoverImageIcon, { className: "mly-h-4 mly-w-4" }),
1985
+ command: ({ editor, range }) => {
1986
+ const todayFormatted = (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", {
1987
+ year: "numeric",
1988
+ month: "short",
1989
+ day: "numeric"
1990
+ });
1991
+ editor.chain().deleteRange(range).insertContent([
1992
+ {
1993
+ type: "image",
1994
+ attrs: {
1995
+ src: "https://maily.to/og-image.png",
1996
+ alt: null,
1997
+ title: null,
1998
+ width: 600,
1999
+ height: 314,
2000
+ alignment: "center",
2001
+ externalLink: null,
2002
+ isExternalLinkVariable: false,
2003
+ isSrcVariable: false,
2004
+ showIfKey: null
2005
+ }
2006
+ },
2007
+ {
2008
+ type: "columns",
2009
+ attrs: { showIfKey: null, gap: 8 },
2010
+ content: [
2011
+ {
2012
+ type: "column",
2013
+ attrs: {
2014
+ columnId: "36de3eda-0677-47c3-a8b7-e071dec9ce30",
2015
+ width: "auto",
2016
+ verticalAlign: "middle"
2017
+ },
2018
+ content: [
2019
+ {
2020
+ type: "image",
2021
+ attrs: {
2022
+ src: "https://maily.to/brand/logo.png",
2023
+ alt: null,
2024
+ title: null,
2025
+ width: "48",
2026
+ height: "48",
2027
+ alignment: "left",
2028
+ externalLink: null,
2029
+ isExternalLinkVariable: false,
2030
+ isSrcVariable: false,
2031
+ showIfKey: null
2032
+ }
2033
+ }
2034
+ ]
2035
+ },
2036
+ {
2037
+ type: "column",
2038
+ attrs: {
2039
+ columnId: "6feb593e-374a-4479-a1c7-872c60c2f4e0",
2040
+ width: "auto",
2041
+ verticalAlign: "middle"
2042
+ },
2043
+ content: [
2044
+ {
2045
+ type: "paragraph",
2046
+ attrs: { textAlign: "right", showIfKey: null },
2047
+ content: [
2048
+ {
2049
+ type: "text",
2050
+ marks: [{ type: "bold" }],
2051
+ text: "Weekly Newsletter"
2052
+ },
2053
+ { type: "hardBreak" },
2054
+ {
2055
+ type: "text",
2056
+ marks: [
2057
+ { type: "textStyle", attrs: { color: "#929292" } }
2058
+ ],
2059
+ text: todayFormatted
2060
+ }
2061
+ ]
2062
+ }
2063
+ ]
2064
+ }
2065
+ ]
2066
+ }
2067
+ ]).run();
2068
+ }
2069
+ };
2070
+
2071
+ // src/blocks/footers.tsx
2072
+ import {
2073
+ CopyrightIcon,
2074
+ LayoutTemplateIcon,
2075
+ RectangleHorizontalIcon
2076
+ } from "lucide-react";
2077
+ import { jsx as jsx21 } from "react/jsx-runtime";
2078
+ var footerCopyrightText = {
2079
+ title: "Footer Copyright",
2080
+ description: "Copyright text for the footer.",
2081
+ searchTerms: ["footer", "copyright"],
2082
+ icon: /* @__PURE__ */ jsx21(CopyrightIcon, { className: "mly-h-4 mly-w-4" }),
2083
+ command: ({ editor, range }) => {
2084
+ const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
2085
+ editor.chain().focus().deleteRange(range).insertContent({
2086
+ type: "paragraph",
2087
+ attrs: { textAlign: "center", showIfKey: null },
2088
+ content: [
2089
+ {
2090
+ type: "text",
2091
+ marks: [{ type: "textStyle", attrs: { color: "#AAAAAA" } }],
2092
+ text: `Maily \xA9 ${currentYear}. All rights reserved.`
2093
+ }
2094
+ ]
2095
+ }).run();
2096
+ }
2097
+ };
2098
+ var footerCommunityFeedbackCta = {
2099
+ title: "Footer Community Feedback CTA",
2100
+ description: "Community feedback CTA for the footer.",
2101
+ searchTerms: ["footer", "community", "feedback", "cta"],
2102
+ icon: /* @__PURE__ */ jsx21(RectangleHorizontalIcon, { className: "mly-h-4 mly-w-4" }),
2103
+ command: ({ editor, range }) => {
2104
+ editor.chain().focus().deleteRange(range).insertContent([
2105
+ {
2106
+ type: "image",
2107
+ attrs: {
2108
+ src: "https://maily.to/brand/logo.png",
2109
+ alt: null,
2110
+ title: null,
2111
+ width: "42",
2112
+ height: "42",
2113
+ alignment: "left",
2114
+ externalLink: null,
2115
+ isExternalLinkVariable: false,
2116
+ isSrcVariable: false,
2117
+ showIfKey: null
2118
+ }
2119
+ },
2120
+ { type: "spacer", attrs: { height: 16, showIfKey: null } },
2121
+ {
2122
+ type: "footer",
2123
+ attrs: { textAlign: null, "maily-component": "footer" },
2124
+ content: [
2125
+ {
2126
+ type: "text",
2127
+ marks: [{ type: "textStyle", attrs: { color: "" } }],
2128
+ text: "Enjoyed this month\u2019s update?"
2129
+ },
2130
+ { type: "hardBreak" },
2131
+ {
2132
+ type: "text",
2133
+ marks: [{ type: "textStyle", attrs: { color: "" } }],
2134
+ text: "And, as always, we'd love your feedback \u2013 simply reply to the email or reach out via the Discord community!"
2135
+ }
2136
+ ]
2137
+ }
2138
+ ]).run();
2139
+ }
2140
+ };
2141
+ var footerCompanySignature = {
2142
+ title: "Footer Company Signature",
2143
+ description: "Company signature for the footer.",
2144
+ searchTerms: ["footer", "company", "signature"],
2145
+ icon: /* @__PURE__ */ jsx21(LayoutTemplateIcon, { className: "mly-h-4 mly-w-4" }),
2146
+ command: ({ editor, range }) => {
2147
+ editor.chain().focus().deleteRange(range).insertContent([
2148
+ { type: "horizontalRule" },
2149
+ {
2150
+ type: "image",
2151
+ attrs: {
2152
+ src: "https://maily.to/brand/logo.png",
2153
+ alt: null,
2154
+ title: null,
2155
+ width: "48",
2156
+ height: "48",
2157
+ alignment: "center",
2158
+ externalLink: null,
2159
+ isExternalLinkVariable: false,
2160
+ isSrcVariable: false,
2161
+ showIfKey: null
2162
+ }
2163
+ },
2164
+ { type: "spacer", attrs: { height: 16, showIfKey: null } },
2165
+ {
2166
+ type: "heading",
2167
+ attrs: { textAlign: "center", level: 3, showIfKey: null },
2168
+ content: [{ type: "text", text: "Maily" }]
2169
+ },
2170
+ { type: "spacer", attrs: { height: 4, showIfKey: null } },
2171
+ {
2172
+ type: "footer",
2173
+ attrs: { textAlign: "center", "maily-component": "footer" },
2174
+ content: [
2175
+ {
2176
+ type: "text",
2177
+ marks: [{ type: "textStyle", attrs: { color: "" } }],
2178
+ text: "1234 Example Street, Example, DE 19801, United States"
2179
+ },
2180
+ { type: "hardBreak" },
2181
+ {
2182
+ type: "text",
2183
+ marks: [
2184
+ {
2185
+ type: "link",
2186
+ attrs: {
2187
+ href: "https://maily.to",
2188
+ target: "_blank",
2189
+ rel: "noopener noreferrer nofollow",
2190
+ class: "mly-no-underline",
2191
+ isUrlVariable: false
2192
+ }
2193
+ },
2194
+ { type: "textStyle", attrs: { color: "#64748b" } },
2195
+ { type: "underline" }
2196
+ ],
2197
+ text: "VISIT COMPANY"
2198
+ },
2199
+ {
2200
+ type: "text",
2201
+ marks: [{ type: "textStyle", attrs: { color: "#64748b" } }],
2202
+ text: " | "
2203
+ },
2204
+ {
2205
+ type: "text",
2206
+ marks: [
2207
+ {
2208
+ type: "link",
2209
+ attrs: {
2210
+ href: "https://maily.to",
2211
+ target: "_blank",
2212
+ rel: "noopener noreferrer nofollow",
2213
+ class: "mly-no-underline",
2214
+ isUrlVariable: false
2215
+ }
2216
+ },
2217
+ { type: "textStyle", attrs: { color: "#64748b" } },
2218
+ { type: "underline" }
2219
+ ],
2220
+ text: "VISIT OUR BLOG"
2221
+ },
2222
+ {
2223
+ type: "text",
2224
+ marks: [{ type: "textStyle", attrs: { color: "#64748b" } }],
2225
+ text: " | "
2226
+ },
2227
+ {
2228
+ type: "text",
2229
+ marks: [
2230
+ {
2231
+ type: "link",
2232
+ attrs: {
2233
+ href: "https://maily.to",
2234
+ target: "_blank",
2235
+ rel: "noopener noreferrer nofollow",
2236
+ class: "mly-no-underline",
2237
+ isUrlVariable: false
2238
+ }
2239
+ },
2240
+ { type: "textStyle", attrs: { color: "#64748b" } },
2241
+ { type: "underline" }
2242
+ ],
2243
+ text: "UNSUBSCRIBE"
2244
+ }
2245
+ ]
2246
+ },
2247
+ {
2248
+ type: "paragraph",
2249
+ attrs: { textAlign: "center", showIfKey: null },
2250
+ content: [
2251
+ {
2252
+ type: "inlineImage",
2253
+ attrs: {
2254
+ height: 20,
2255
+ width: 20,
2256
+ src: "https://cdn.usemaily.com/images/icons/linkedin.png",
2257
+ isSrcVariable: false,
2258
+ alt: null,
2259
+ title: null,
2260
+ externalLink: "https://www.linkedin.com/in/arikchakma/",
2261
+ isExternalLinkVariable: false
2262
+ }
2263
+ },
2264
+ { type: "text", text: " " },
2265
+ {
2266
+ type: "inlineImage",
2267
+ attrs: {
2268
+ height: 20,
2269
+ width: 20,
2270
+ src: "https://cdn.usemaily.com/images/icons/youtube.png",
2271
+ isSrcVariable: false,
2272
+ alt: null,
2273
+ title: null,
2274
+ externalLink: "https://www.youtube.com/arikchakma",
2275
+ isExternalLinkVariable: false
2276
+ }
2277
+ },
2278
+ { type: "text", text: " " },
2279
+ {
2280
+ type: "inlineImage",
2281
+ attrs: {
2282
+ height: 20,
2283
+ width: 20,
2284
+ src: "https://cdn.usemaily.com/images/icons/twitter.png",
2285
+ isSrcVariable: false,
2286
+ alt: null,
2287
+ title: null,
2288
+ externalLink: "https://x.com/imarikchakma",
2289
+ isExternalLinkVariable: false
2290
+ }
2291
+ }
2292
+ ]
2293
+ }
2294
+ ]).run();
2295
+ }
2296
+ };
2297
+
2298
+ // src/editor/extensions/slash-command/default-slash-commands.tsx
2299
+ import { jsx as jsx22 } from "react/jsx-runtime";
1635
2300
  var DEFAULT_SLASH_COMMANDS = [
1636
- text,
1637
- heading1,
1638
- heading2,
1639
- heading3,
1640
- bulletList,
1641
- orderedList,
1642
- image,
1643
- logo,
1644
- columns,
1645
- section,
1646
- repeat,
1647
- divider,
1648
- spacer,
1649
- button,
1650
- linkCard,
1651
- hardBreak,
1652
- blockquote,
1653
- footer,
1654
- clearLine
2301
+ {
2302
+ title: "Blocks",
2303
+ commands: [
2304
+ text,
2305
+ heading1,
2306
+ heading2,
2307
+ heading3,
2308
+ bulletList,
2309
+ orderedList,
2310
+ image,
2311
+ logo,
2312
+ inlineImage,
2313
+ columns,
2314
+ section,
2315
+ repeat,
2316
+ divider,
2317
+ spacer,
2318
+ button,
2319
+ linkCard,
2320
+ hardBreak,
2321
+ blockquote,
2322
+ footer,
2323
+ clearLine
2324
+ ]
2325
+ },
2326
+ {
2327
+ title: "Components",
2328
+ commands: [
2329
+ {
2330
+ id: "headers",
2331
+ title: "Headers",
2332
+ description: "Add pre-designed headers block",
2333
+ searchTerms: ["header", "headers"],
2334
+ icon: /* @__PURE__ */ jsx22(Heading12, { className: "mly-h-4 mly-w-4" }),
2335
+ preview: "https://cdn.usemaily.com/previews/header-preview-xyz.png",
2336
+ commands: [
2337
+ headerLogoWithTextVertical,
2338
+ headerLogoWithTextHorizontal,
2339
+ headerLogoWithCoverImage
2340
+ ]
2341
+ },
2342
+ {
2343
+ id: "footers",
2344
+ title: "Footers",
2345
+ description: "Add pre-designed footers block",
2346
+ searchTerms: ["footers"],
2347
+ icon: /* @__PURE__ */ jsx22(FootprintsIcon2, { className: "mly-h-4 mly-w-4" }),
2348
+ commands: [
2349
+ footerCopyrightText,
2350
+ footerCommunityFeedbackCta,
2351
+ footerCompanySignature
2352
+ ]
2353
+ },
2354
+ htmlCodeBlock
2355
+ ]
2356
+ }
1655
2357
  ];
1656
2358
 
1657
2359
  // src/editor/nodes/variable/variable-view.tsx
1658
2360
  import { NodeViewWrapper as NodeViewWrapper2 } from "@tiptap/react";
1659
2361
  import { AlertTriangle, Braces, Pencil } from "lucide-react";
1660
- import { jsx as jsx16, jsxs as jsxs4 } from "react/jsx-runtime";
2362
+ import { jsx as jsx23, jsxs as jsxs8 } from "react/jsx-runtime";
1661
2363
  function VariableView(props) {
1662
2364
  const { node, updateAttributes: updateAttributes2, editor } = props;
1663
2365
  const { id, fallback, required } = node.attrs;
1664
2366
  const { renderVariable = DEFAULT_RENDER_VARIABLE_FUNCTION } = useMailyContext();
1665
- return /* @__PURE__ */ jsx16(
2367
+ return /* @__PURE__ */ jsx23(
1666
2368
  NodeViewWrapper2,
1667
2369
  {
1668
2370
  className: "react-component mly-inline-block mly-leading-none",
1669
2371
  draggable: "false",
1670
- children: /* @__PURE__ */ jsxs4(Popover, { children: [
1671
- /* @__PURE__ */ jsx16(
1672
- PopoverTrigger,
1673
- {
1674
- onClick: (e) => {
1675
- if (!editor.isEditable) {
1676
- e.preventDefault();
1677
- return;
1678
- }
1679
- },
1680
- children: renderVariable({
2372
+ children: /* @__PURE__ */ jsxs8(
2373
+ Popover,
2374
+ {
2375
+ onOpenChange: (open) => {
2376
+ editor.storage.variable.popover = open;
2377
+ },
2378
+ children: [
2379
+ /* @__PURE__ */ jsx23(PopoverTrigger, { children: renderVariable({
1681
2380
  variable: { name: id, required, valid: true },
1682
2381
  fallback,
1683
2382
  editor,
1684
2383
  from: "content-variable"
1685
- })
1686
- }
1687
- ),
1688
- /* @__PURE__ */ jsx16(
1689
- PopoverContent,
1690
- {
1691
- align: "start",
1692
- side: "bottom",
1693
- className: "mly-w-max mly-rounded-lg !mly-p-0.5",
1694
- sideOffset: 8,
1695
- onOpenAutoFocus: (e) => e.preventDefault(),
1696
- onCloseAutoFocus: (e) => e.preventDefault(),
1697
- children: /* @__PURE__ */ jsx16(TooltipProvider, { children: /* @__PURE__ */ jsxs4("div", { className: "mly-flex mly-items-stretch mly-text-midnight-gray", children: [
1698
- /* @__PURE__ */ jsxs4("label", { className: "mly-relative", children: [
1699
- /* @__PURE__ */ jsx16("span", { className: "mly-inline-block mly-px-2 mly-text-xs mly-text-midnight-gray", children: "Variable" }),
1700
- /* @__PURE__ */ jsx16(
1701
- "input",
1702
- __spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
1703
- value: id != null ? id : "",
1704
- onChange: (e) => {
1705
- updateAttributes2({
1706
- id: e.target.value
1707
- });
1708
- },
1709
- placeholder: "ie. name...",
1710
- className: "mly-h-7 mly-w-36 mly-rounded-md mly-bg-soft-gray mly-px-2 mly-text-sm mly-text-midnight-gray focus:mly-bg-soft-gray focus:mly-outline-none"
1711
- })
1712
- )
1713
- ] }),
1714
- /* @__PURE__ */ jsx16(Divider, { className: "mly-mx-1.5" }),
1715
- /* @__PURE__ */ jsxs4("label", { className: "mly-relative", children: [
1716
- /* @__PURE__ */ jsx16("span", { className: "mly-inline-block mly-px-2 mly-pl-1 mly-text-xs mly-text-midnight-gray", children: "Default" }),
1717
- /* @__PURE__ */ jsx16(
1718
- "input",
1719
- __spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
1720
- value: fallback != null ? fallback : "",
1721
- onChange: (e) => {
1722
- updateAttributes2({
1723
- fallback: e.target.value
1724
- });
1725
- },
1726
- placeholder: "ie. John Doe...",
1727
- className: "mly-h-7 mly-w-32 mly-rounded-md mly-bg-soft-gray mly-px-2 mly-pr-6 mly-text-sm mly-text-midnight-gray focus:mly-bg-soft-gray focus:mly-outline-none"
1728
- })
1729
- ),
1730
- /* @__PURE__ */ jsx16("div", { className: "mly-absolute mly-inset-y-0 mly-right-1 mly-flex mly-items-center", children: /* @__PURE__ */ jsx16(Pencil, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray" }) })
1731
- ] })
1732
- ] }) })
1733
- }
1734
- )
1735
- ] })
2384
+ }) }),
2385
+ /* @__PURE__ */ jsx23(
2386
+ PopoverContent,
2387
+ {
2388
+ align: "start",
2389
+ side: "bottom",
2390
+ className: "mly-w-max mly-rounded-lg !mly-p-0.5",
2391
+ sideOffset: 8,
2392
+ onOpenAutoFocus: (e) => e.preventDefault(),
2393
+ onCloseAutoFocus: (e) => e.preventDefault(),
2394
+ children: /* @__PURE__ */ jsx23(TooltipProvider, { children: /* @__PURE__ */ jsxs8("div", { className: "mly-flex mly-items-stretch mly-text-midnight-gray", children: [
2395
+ /* @__PURE__ */ jsxs8("label", { className: "mly-relative", children: [
2396
+ /* @__PURE__ */ jsx23("span", { className: "mly-inline-block mly-px-2 mly-text-xs mly-text-midnight-gray", children: "Variable" }),
2397
+ /* @__PURE__ */ jsx23(
2398
+ "input",
2399
+ __spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
2400
+ value: id != null ? id : "",
2401
+ onChange: (e) => {
2402
+ updateAttributes2({
2403
+ id: e.target.value
2404
+ });
2405
+ },
2406
+ placeholder: "ie. name...",
2407
+ className: "mly-h-7 mly-w-36 mly-rounded-md mly-bg-soft-gray mly-px-2 mly-text-sm mly-text-midnight-gray focus:mly-bg-soft-gray focus:mly-outline-none"
2408
+ })
2409
+ )
2410
+ ] }),
2411
+ /* @__PURE__ */ jsx23(Divider, { className: "mly-mx-1.5" }),
2412
+ /* @__PURE__ */ jsxs8("label", { className: "mly-relative", children: [
2413
+ /* @__PURE__ */ jsx23("span", { className: "mly-inline-block mly-px-2 mly-pl-1 mly-text-xs mly-text-midnight-gray", children: "Default" }),
2414
+ /* @__PURE__ */ jsx23(
2415
+ "input",
2416
+ __spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
2417
+ value: fallback != null ? fallback : "",
2418
+ onChange: (e) => {
2419
+ updateAttributes2({
2420
+ fallback: e.target.value
2421
+ });
2422
+ },
2423
+ placeholder: "ie. John Doe...",
2424
+ className: "mly-h-7 mly-w-32 mly-rounded-md mly-bg-soft-gray mly-px-2 mly-pr-6 mly-text-sm mly-text-midnight-gray focus:mly-bg-soft-gray focus:mly-outline-none"
2425
+ })
2426
+ ),
2427
+ /* @__PURE__ */ jsx23("div", { className: "mly-absolute mly-inset-y-0 mly-right-1 mly-flex mly-items-center", children: /* @__PURE__ */ jsx23(Pencil, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray" }) })
2428
+ ] })
2429
+ ] }) })
2430
+ }
2431
+ )
2432
+ ]
2433
+ }
2434
+ )
1736
2435
  }
1737
2436
  );
1738
2437
  }
@@ -1740,13 +2439,13 @@ var DefaultRenderVariable = (props) => {
1740
2439
  const { variable, fallback, from } = props;
1741
2440
  const { name, required, valid } = variable;
1742
2441
  if (from === "button-variable") {
1743
- return /* @__PURE__ */ jsxs4("div", { className: "mly-inline-grid mly-h-7 mly-max-w-xs mly-grid-cols-[12px_1fr] mly-items-center mly-gap-1.5 mly-rounded-md mly-border mly-border-[var(--button-var-border-color)] mly-px-2 mly-font-mono mly-text-sm", children: [
1744
- /* @__PURE__ */ jsx16(Braces, { className: "mly-h-3 mly-w-3 mly-shrink-0 mly-stroke-[2.5]" }),
1745
- /* @__PURE__ */ jsx16("span", { className: "mly-min-w-0 mly-truncate mly-text-left", children: name })
2442
+ return /* @__PURE__ */ jsxs8("div", { className: "mly-inline-grid mly-h-7 mly-max-w-xs mly-grid-cols-[12px_1fr] mly-items-center mly-gap-1.5 mly-rounded-md mly-border mly-border-[var(--button-var-border-color)] mly-px-2 mly-font-mono mly-text-sm", children: [
2443
+ /* @__PURE__ */ jsx23(Braces, { className: "mly-h-3 mly-w-3 mly-shrink-0 mly-stroke-[2.5]" }),
2444
+ /* @__PURE__ */ jsx23("span", { className: "mly-min-w-0 mly-truncate mly-text-left", children: name })
1746
2445
  ] });
1747
2446
  }
1748
2447
  if (from === "bubble-variable") {
1749
- return /* @__PURE__ */ jsxs4(
2448
+ return /* @__PURE__ */ jsxs8(
1750
2449
  "div",
1751
2450
  {
1752
2451
  className: cn(
@@ -1754,28 +2453,28 @@ var DefaultRenderVariable = (props) => {
1754
2453
  !valid && "mly-border-rose-400 mly-bg-rose-50 mly-text-rose-600 hover:mly-bg-rose-100"
1755
2454
  ),
1756
2455
  children: [
1757
- /* @__PURE__ */ jsx16(Braces, { className: "mly-h-3 mly-w-3 mly-shrink-0 mly-stroke-[2.5] mly-text-rose-600" }),
1758
- /* @__PURE__ */ jsx16("span", { className: "mly-min-w-0 mly-truncate mly-text-left", children: name })
2456
+ /* @__PURE__ */ jsx23(Braces, { className: "mly-h-3 mly-w-3 mly-shrink-0 mly-stroke-[2.5] mly-text-rose-600" }),
2457
+ /* @__PURE__ */ jsx23("span", { className: "mly-min-w-0 mly-truncate mly-text-left", children: name })
1759
2458
  ]
1760
2459
  }
1761
2460
  );
1762
2461
  }
1763
- return /* @__PURE__ */ jsxs4(
2462
+ return /* @__PURE__ */ jsxs8(
1764
2463
  "span",
1765
2464
  {
1766
2465
  tabIndex: -1,
1767
2466
  className: "mly-inline-flex mly-items-center mly-gap-[var(--variable-icon-gap)] mly-rounded-full mly-border mly-px-1.5 mly-py-0.5 mly-leading-none",
1768
2467
  children: [
1769
- /* @__PURE__ */ jsx16(Braces, { className: "mly-size-[var(--variable-icon-size)] mly-shrink-0 mly-stroke-[2.5] mly-text-rose-600" }),
2468
+ /* @__PURE__ */ jsx23(Braces, { className: "mly-size-[var(--variable-icon-size)] mly-shrink-0 mly-stroke-[2.5] mly-text-rose-600" }),
1770
2469
  name,
1771
- required && !fallback && /* @__PURE__ */ jsx16(AlertTriangle, { className: "mly-size-[var(--variable-icon-size)] mly-shrink-0 mly-stroke-[2.5]" })
2470
+ required && !fallback && /* @__PURE__ */ jsx23(AlertTriangle, { className: "mly-size-[var(--variable-icon-size)] mly-shrink-0 mly-stroke-[2.5]" })
1772
2471
  ]
1773
2472
  }
1774
2473
  );
1775
2474
  };
1776
2475
 
1777
2476
  // src/editor/provider.tsx
1778
- import { jsx as jsx17 } from "react/jsx-runtime";
2477
+ import { jsx as jsx24 } from "react/jsx-runtime";
1779
2478
  var DEFAULT_PLACEHOLDER_URL = "maily.to/";
1780
2479
  var DEFAULT_VARIABLE_TRIGGER_CHAR = "@";
1781
2480
  var DEFAULT_VARIABLES = [];
@@ -1809,7 +2508,7 @@ import {
1809
2508
  useEffect,
1810
2509
  useRef
1811
2510
  } from "react";
1812
- import { jsx as jsx18, jsxs as jsxs5 } from "react/jsx-runtime";
2511
+ import { jsx as jsx25, jsxs as jsxs9 } from "react/jsx-runtime";
1813
2512
  var VariablePopover = forwardRef6((props, ref) => {
1814
2513
  const { items, onSelectItem } = props;
1815
2514
  const [selectedIndex, setSelectedIndex] = useState(0);
@@ -1855,17 +2554,17 @@ var VariablePopover = forwardRef6((props, ref) => {
1855
2554
  onSelectItem(item);
1856
2555
  }
1857
2556
  }));
1858
- return /* @__PURE__ */ jsxs5("div", { className: "mly-z-50 mly-w-64 mly-rounded-lg mly-border mly-border-gray-200 mly-bg-white mly-shadow-md mly-transition-all", children: [
1859
- /* @__PURE__ */ jsxs5("div", { className: "mly-flex mly-items-center mly-justify-between mly-gap-2 mly-border-b mly-border-gray-200 mly-bg-soft-gray/40 mly-px-1 mly-py-1.5 mly-text-gray-500", children: [
1860
- /* @__PURE__ */ jsx18("span", { className: "mly-text-xs mly-uppercase", children: "Variables" }),
1861
- /* @__PURE__ */ jsx18(VariableIcon, { children: /* @__PURE__ */ jsx18(Braces2, { className: "mly-size-3 mly-stroke-[2.5]" }) })
2557
+ return /* @__PURE__ */ jsxs9("div", { className: "mly-z-50 mly-w-64 mly-rounded-lg mly-border mly-border-gray-200 mly-bg-white mly-shadow-md mly-transition-all", children: [
2558
+ /* @__PURE__ */ jsxs9("div", { className: "mly-flex mly-items-center mly-justify-between mly-gap-2 mly-border-b mly-border-gray-200 mly-bg-soft-gray/40 mly-px-1 mly-py-1.5 mly-text-gray-500", children: [
2559
+ /* @__PURE__ */ jsx25("span", { className: "mly-text-xs mly-uppercase", children: "Variables" }),
2560
+ /* @__PURE__ */ jsx25(VariableIcon, { children: /* @__PURE__ */ jsx25(Braces2, { className: "mly-size-3 mly-stroke-[2.5]" }) })
1862
2561
  ] }),
1863
- /* @__PURE__ */ jsx18(
2562
+ /* @__PURE__ */ jsx25(
1864
2563
  "div",
1865
2564
  {
1866
2565
  ref: scrollContainerRef,
1867
2566
  className: "mly-max-h-52 mly-overflow-y-auto mly-scrollbar-thin mly-scrollbar-track-transparent mly-scrollbar-thumb-gray-200",
1868
- children: /* @__PURE__ */ jsx18("div", { className: "mly-flex mly-w-fit mly-min-w-full mly-flex-col mly-gap-0.5 mly-p-1", children: (items == null ? void 0 : items.length) ? items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ jsxs5(
2567
+ children: /* @__PURE__ */ jsx25("div", { className: "mly-flex mly-w-fit mly-min-w-full mly-flex-col mly-gap-0.5 mly-p-1", children: (items == null ? void 0 : items.length) ? items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ jsxs9(
1869
2568
  "button",
1870
2569
  {
1871
2570
  ref: (el) => itemRefs.current[index] = el,
@@ -1875,27 +2574,27 @@ var VariablePopover = forwardRef6((props, ref) => {
1875
2574
  index === selectedIndex ? "mly-bg-soft-gray" : "mly-bg-white"
1876
2575
  ),
1877
2576
  children: [
1878
- /* @__PURE__ */ jsx18(Braces2, { className: "mly-size-3 mly-stroke-[2.5] mly-text-rose-600" }),
2577
+ /* @__PURE__ */ jsx25(Braces2, { className: "mly-size-3 mly-stroke-[2.5] mly-text-rose-600" }),
1879
2578
  item.name
1880
2579
  ]
1881
2580
  },
1882
2581
  index
1883
- )) : /* @__PURE__ */ jsx18("div", { className: "mly-flex mly-h-7 mly-w-full mly-items-center mly-gap-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-font-mono mly-text-[13px] mly-text-gray-900 hover:mly-bg-soft-gray", children: "No result" }) })
2582
+ )) : /* @__PURE__ */ jsx25("div", { className: "mly-flex mly-h-7 mly-w-full mly-items-center mly-gap-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-font-mono mly-text-[13px] mly-text-gray-900 hover:mly-bg-soft-gray", children: "No result" }) })
1884
2583
  }
1885
2584
  ),
1886
- /* @__PURE__ */ jsxs5("div", { className: "mly-flex mly-items-center mly-justify-between mly-gap-2 mly-border-t mly-border-gray-200 mly-px-1 mly-py-1.5 mly-text-gray-500", children: [
1887
- /* @__PURE__ */ jsxs5("div", { className: "mly-flex mly-items-center mly-gap-1", children: [
1888
- /* @__PURE__ */ jsx18(VariableIcon, { children: /* @__PURE__ */ jsx18(ArrowDownIcon, { className: "mly-size-3 mly-stroke-[2.5]" }) }),
1889
- /* @__PURE__ */ jsx18(VariableIcon, { children: /* @__PURE__ */ jsx18(ArrowUpIcon, { className: "mly-size-3 mly-stroke-[2.5]" }) }),
1890
- /* @__PURE__ */ jsx18("span", { className: "mly-text-xs mly-text-gray-500", children: "Navigate" })
2585
+ /* @__PURE__ */ jsxs9("div", { className: "mly-flex mly-items-center mly-justify-between mly-gap-2 mly-border-t mly-border-gray-200 mly-px-1 mly-py-1.5 mly-text-gray-500", children: [
2586
+ /* @__PURE__ */ jsxs9("div", { className: "mly-flex mly-items-center mly-gap-1", children: [
2587
+ /* @__PURE__ */ jsx25(VariableIcon, { children: /* @__PURE__ */ jsx25(ArrowDownIcon, { className: "mly-size-3 mly-stroke-[2.5]" }) }),
2588
+ /* @__PURE__ */ jsx25(VariableIcon, { children: /* @__PURE__ */ jsx25(ArrowUpIcon, { className: "mly-size-3 mly-stroke-[2.5]" }) }),
2589
+ /* @__PURE__ */ jsx25("span", { className: "mly-text-xs mly-text-gray-500", children: "Navigate" })
1891
2590
  ] }),
1892
- /* @__PURE__ */ jsx18(VariableIcon, { children: /* @__PURE__ */ jsx18(CornerDownLeftIcon, { className: "mly-size-3 mly-stroke-[2.5]" }) })
2591
+ /* @__PURE__ */ jsx25(VariableIcon, { children: /* @__PURE__ */ jsx25(CornerDownLeftIcon, { className: "mly-size-3 mly-stroke-[2.5]" }) })
1893
2592
  ] })
1894
2593
  ] });
1895
2594
  });
1896
2595
  function VariableIcon(props) {
1897
2596
  const { className, children } = props;
1898
- return /* @__PURE__ */ jsx18(
2597
+ return /* @__PURE__ */ jsx25(
1899
2598
  "div",
1900
2599
  {
1901
2600
  className: cn(
@@ -1932,7 +2631,7 @@ function useOutsideClick(ref, callback) {
1932
2631
  // src/editor/components/ui/input-autocomplete.tsx
1933
2632
  import { CornerDownLeft } from "lucide-react";
1934
2633
  import { forwardRef as forwardRef7, useRef as useRef2 } from "react";
1935
- import { jsx as jsx19, jsxs as jsxs6 } from "react/jsx-runtime";
2634
+ import { jsx as jsx26, jsxs as jsxs10 } from "react/jsx-runtime";
1936
2635
  var InputAutocomplete = forwardRef7((props, ref) => {
1937
2636
  const _a = props, {
1938
2637
  value = "",
@@ -1957,9 +2656,9 @@ var InputAutocomplete = forwardRef7((props, ref) => {
1957
2656
  onOutsideClick == null ? void 0 : onOutsideClick();
1958
2657
  });
1959
2658
  const isTriggeringVariable = value.startsWith(triggerChar);
1960
- return /* @__PURE__ */ jsxs6("div", { className: cn("mly-relative"), ref: containerRef, children: [
1961
- /* @__PURE__ */ jsxs6("label", { className: "mly-relative", children: [
1962
- /* @__PURE__ */ jsx19(
2659
+ return /* @__PURE__ */ jsxs10("div", { className: cn("mly-relative"), ref: containerRef, children: [
2660
+ /* @__PURE__ */ jsxs10("label", { className: "mly-relative", children: [
2661
+ /* @__PURE__ */ jsx26(
1963
2662
  "input",
1964
2663
  __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
1965
2664
  placeholder: "e.g. items",
@@ -1971,7 +2670,7 @@ var InputAutocomplete = forwardRef7((props, ref) => {
1971
2670
  onValueChange(e.target.value);
1972
2671
  },
1973
2672
  className: cn(
1974
- "mly-h-7 mly-w-40 mly-rounded-md mly-px-2 mly-pr-6 mly-text-sm mly-text-midnight-gray hover:mly-bg-soft-gray focus:mly-bg-soft-gray focus:mly-outline-none",
2673
+ "mly-h-7 mly-w-40 mly-rounded-md mly-bg-white mly-px-2 mly-pr-6 mly-text-sm mly-text-midnight-gray hover:mly-bg-soft-gray focus:mly-bg-soft-gray focus:mly-outline-none",
1975
2674
  className
1976
2675
  ),
1977
2676
  onKeyDown: (e) => {
@@ -1993,9 +2692,9 @@ var InputAutocomplete = forwardRef7((props, ref) => {
1993
2692
  spellCheck: false
1994
2693
  })
1995
2694
  ),
1996
- /* @__PURE__ */ jsx19("div", { className: "mly-absolute mly-inset-y-0 mly-right-1 mly-flex mly-items-center", children: /* @__PURE__ */ jsx19(CornerDownLeft, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray" }) })
2695
+ /* @__PURE__ */ jsx26("div", { className: "mly-absolute mly-inset-y-0 mly-right-1 mly-flex mly-items-center", children: /* @__PURE__ */ jsx26(CornerDownLeft, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5] mly-text-midnight-gray" }) })
1997
2696
  ] }),
1998
- isTriggeringVariable && /* @__PURE__ */ jsx19("div", { className: "mly-absolute mly-left-0 mly-top-8", children: /* @__PURE__ */ jsx19(
2697
+ isTriggeringVariable && /* @__PURE__ */ jsx26("div", { className: "mly-absolute mly-left-0 mly-top-8", children: /* @__PURE__ */ jsx26(
1999
2698
  VariablePopover,
2000
2699
  {
2001
2700
  items: autoCompleteOptions.map((option) => {
@@ -2037,7 +2736,7 @@ You can check out the documentation for more information: https://github.com/ari
2037
2736
 
2038
2737
  // src/editor/components/ui/link-input-popover.tsx
2039
2738
  import { useMemo as useMemo2 } from "react";
2040
- import { Fragment as Fragment2, jsx as jsx20, jsxs as jsxs7 } from "react/jsx-runtime";
2739
+ import { Fragment as Fragment2, jsx as jsx27, jsxs as jsxs11 } from "react/jsx-runtime";
2041
2740
  var LINK_PROTOCOL_REGEX = /https?:\/\//;
2042
2741
  function LinkInputPopover(props) {
2043
2742
  var _a;
@@ -2075,7 +2774,7 @@ function LinkInputPopover(props) {
2075
2774
  editor
2076
2775
  }).map((variable) => variable.name);
2077
2776
  }, [variables, defaultUrlWithoutProtocol, editor]);
2078
- const popoverButton = /* @__PURE__ */ jsx20(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx20(
2777
+ const popoverButton = /* @__PURE__ */ jsx27(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx27(
2079
2778
  BaseButton,
2080
2779
  {
2081
2780
  variant: "ghost",
@@ -2083,19 +2782,19 @@ function LinkInputPopover(props) {
2083
2782
  type: "button",
2084
2783
  className: "mly-size-7",
2085
2784
  "data-state": !!defaultUrlWithoutProtocol,
2086
- children: /* @__PURE__ */ jsx20(Icon, { className: "mly-h-3 mly-w-3 mly-shrink-0 mly-stroke-[2.5] mly-text-midnight-gray" })
2785
+ children: /* @__PURE__ */ jsx27(Icon, { className: "mly-h-3 mly-w-3 mly-shrink-0 mly-stroke-[2.5] mly-text-midnight-gray" })
2087
2786
  }
2088
2787
  ) });
2089
2788
  const normalizeProtocol = (value, p = protocol) => {
2090
2789
  value = value == null ? void 0 : value.replace(LINK_PROTOCOL_REGEX, "");
2091
2790
  return p + value;
2092
2791
  };
2093
- return /* @__PURE__ */ jsxs7(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [
2094
- tooltip ? /* @__PURE__ */ jsxs7(Tooltip, { children: [
2095
- /* @__PURE__ */ jsx20(TooltipTrigger, { asChild: true, children: popoverButton }),
2096
- /* @__PURE__ */ jsx20(TooltipContent, { sideOffset: 8, children: tooltip })
2792
+ return /* @__PURE__ */ jsxs11(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [
2793
+ tooltip ? /* @__PURE__ */ jsxs11(Tooltip, { children: [
2794
+ /* @__PURE__ */ jsx27(TooltipTrigger, { asChild: true, children: popoverButton }),
2795
+ /* @__PURE__ */ jsx27(TooltipContent, { sideOffset: 8, children: tooltip })
2097
2796
  ] }) : popoverButton,
2098
- /* @__PURE__ */ jsx20(
2797
+ /* @__PURE__ */ jsx27(
2099
2798
  PopoverContent,
2100
2799
  {
2101
2800
  align: "end",
@@ -2103,7 +2802,7 @@ function LinkInputPopover(props) {
2103
2802
  className: "mly-w-max mly-rounded-none mly-border-none mly-bg-transparent !mly-p-0 mly-shadow-none",
2104
2803
  sideOffset: 8,
2105
2804
  onCloseAutoFocus: (e) => e.preventDefault(),
2106
- children: /* @__PURE__ */ jsx20(
2805
+ children: /* @__PURE__ */ jsx27(
2107
2806
  "form",
2108
2807
  {
2109
2808
  onSubmit: (e) => {
@@ -2116,8 +2815,8 @@ function LinkInputPopover(props) {
2116
2815
  onValueChange == null ? void 0 : onValueChange(value);
2117
2816
  setIsOpen(false);
2118
2817
  },
2119
- children: /* @__PURE__ */ jsxs7("div", { className: "mly-isolate mly-flex mly-rounded-lg", children: [
2120
- !isEditing && /* @__PURE__ */ jsx20("div", { className: "mly-flex mly-h-8 mly-items-center mly-rounded-lg mly-border mly-border-gray-300 mly-bg-white mly-px-0.5", children: /* @__PURE__ */ jsx20(
2818
+ children: /* @__PURE__ */ jsxs11("div", { className: "mly-isolate mly-flex mly-rounded-lg", children: [
2819
+ !isEditing && /* @__PURE__ */ jsx27("div", { className: "mly-flex mly-h-8 mly-items-center mly-rounded-lg mly-border mly-border-gray-300 mly-bg-white mly-px-0.5", children: /* @__PURE__ */ jsx27(
2121
2820
  "button",
2122
2821
  {
2123
2822
  onClick: () => {
@@ -2138,9 +2837,9 @@ function LinkInputPopover(props) {
2138
2837
  })
2139
2838
  }
2140
2839
  ) }),
2141
- isEditing && /* @__PURE__ */ jsxs7(Fragment2, { children: [
2142
- /* @__PURE__ */ jsxs7("div", { className: "mly-relative", children: [
2143
- /* @__PURE__ */ jsxs7(
2840
+ isEditing && /* @__PURE__ */ jsxs11(Fragment2, { children: [
2841
+ /* @__PURE__ */ jsxs11("div", { className: "mly-relative", children: [
2842
+ /* @__PURE__ */ jsxs11(
2144
2843
  "select",
2145
2844
  {
2146
2845
  className: "hover:text-accent-foreground mly-peer mly-inline-flex mly-h-full mly-appearance-none mly-items-center mly-rounded-none mly-rounded-s-lg mly-border mly-border-gray-300 mly-bg-gray-50 mly-pe-8 mly-ps-3 mly-text-sm mly-text-gray-700 mly-transition-shadow hover:mly-bg-gray-100 focus:mly-z-10 focus-visible:mly-outline-none disabled:mly-pointer-events-none disabled:mly-cursor-not-allowed disabled:mly-opacity-50",
@@ -2157,12 +2856,12 @@ function LinkInputPopover(props) {
2157
2856
  onValueChange == null ? void 0 : onValueChange(newValue);
2158
2857
  },
2159
2858
  children: [
2160
- /* @__PURE__ */ jsx20("option", { value: "https://", children: "https://" }),
2161
- /* @__PURE__ */ jsx20("option", { value: "http://", children: "http://" })
2859
+ /* @__PURE__ */ jsx27("option", { value: "https://", children: "https://" }),
2860
+ /* @__PURE__ */ jsx27("option", { value: "http://", children: "http://" })
2162
2861
  ]
2163
2862
  }
2164
2863
  ),
2165
- /* @__PURE__ */ jsx20("span", { className: "mly-pointer-events-none mly-absolute mly-inset-y-0 mly-right-0 mly-z-10 mly-flex mly-h-full mly-w-9 mly-items-center mly-justify-center mly-text-gray-600 peer-disabled:mly-opacity-50", children: /* @__PURE__ */ jsx20(
2864
+ /* @__PURE__ */ jsx27("span", { className: "mly-pointer-events-none mly-absolute mly-inset-y-0 mly-right-0 mly-z-10 mly-flex mly-h-full mly-w-9 mly-items-center mly-justify-center mly-text-gray-600 peer-disabled:mly-opacity-50", children: /* @__PURE__ */ jsx27(
2166
2865
  ChevronDownIcon,
2167
2866
  {
2168
2867
  size: 16,
@@ -2172,7 +2871,7 @@ function LinkInputPopover(props) {
2172
2871
  }
2173
2872
  ) })
2174
2873
  ] }),
2175
- /* @__PURE__ */ jsx20(
2874
+ /* @__PURE__ */ jsx27(
2176
2875
  InputAutocomplete,
2177
2876
  {
2178
2877
  value: defaultUrlWithoutProtocol,
@@ -2210,7 +2909,7 @@ function LinkInputPopover(props) {
2210
2909
  // src/editor/components/ui/select.tsx
2211
2910
  import { useId } from "react";
2212
2911
  import { ChevronDownIcon as ChevronDownIcon2 } from "lucide-react";
2213
- import { jsx as jsx21, jsxs as jsxs8 } from "react/jsx-runtime";
2912
+ import { jsx as jsx28, jsxs as jsxs12 } from "react/jsx-runtime";
2214
2913
  function Select(props) {
2215
2914
  const {
2216
2915
  label,
@@ -2223,10 +2922,10 @@ function Select(props) {
2223
2922
  iconClassName
2224
2923
  } = props;
2225
2924
  const selectId = `mly${useId()}`;
2226
- const content = /* @__PURE__ */ jsxs8("div", { className: "relative", children: [
2227
- /* @__PURE__ */ jsx21("label", { htmlFor: selectId, className: "sr-only", children: label }),
2228
- Icon && /* @__PURE__ */ jsx21("div", { className: "mly-pointer-events-none mly-absolute mly-inset-y-0 mly-left-2 mly-z-20 mly-flex mly-items-center", children: /* @__PURE__ */ jsx21(Icon, { className: cn("mly-size-3", iconClassName) }) }),
2229
- /* @__PURE__ */ jsx21(
2925
+ const content = /* @__PURE__ */ jsxs12("div", { className: "relative", children: [
2926
+ /* @__PURE__ */ jsx28("label", { htmlFor: selectId, className: "sr-only", children: label }),
2927
+ Icon && /* @__PURE__ */ jsx28("div", { className: "mly-pointer-events-none mly-absolute mly-inset-y-0 mly-left-2 mly-z-20 mly-flex mly-items-center", children: /* @__PURE__ */ jsx28(Icon, { className: cn("mly-size-3", iconClassName) }) }),
2928
+ /* @__PURE__ */ jsx28(
2230
2929
  "select",
2231
2930
  {
2232
2931
  id: selectId,
@@ -2237,10 +2936,10 @@ function Select(props) {
2237
2936
  ),
2238
2937
  value,
2239
2938
  onChange: (event) => onValueChange(event.target.value),
2240
- children: options.map((option) => /* @__PURE__ */ jsx21("option", { value: option.value, children: option.label }, option.value))
2939
+ children: options.map((option) => /* @__PURE__ */ jsx28("option", { value: option.value, children: option.label }, option.value))
2241
2940
  }
2242
2941
  ),
2243
- /* @__PURE__ */ jsx21("span", { className: "mly-pointer-events-none mly-absolute mly-inset-y-0 mly-right-0 mly-z-10 mly-flex mly-h-full mly-w-7 mly-items-center mly-justify-center mly-text-gray-600 peer-disabled:mly-opacity-50", children: /* @__PURE__ */ jsx21(
2942
+ /* @__PURE__ */ jsx28("span", { className: "mly-pointer-events-none mly-absolute mly-inset-y-0 mly-right-0 mly-z-10 mly-flex mly-h-full mly-w-7 mly-items-center mly-justify-center mly-text-gray-600 peer-disabled:mly-opacity-50", children: /* @__PURE__ */ jsx28(
2244
2943
  ChevronDownIcon2,
2245
2944
  {
2246
2945
  size: 16,
@@ -2253,9 +2952,9 @@ function Select(props) {
2253
2952
  if (!tooltip) {
2254
2953
  return content;
2255
2954
  }
2256
- return /* @__PURE__ */ jsxs8(Tooltip, { children: [
2257
- /* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: content }),
2258
- /* @__PURE__ */ jsx21(TooltipContent, { sideOffset: 8, children: tooltip })
2955
+ return /* @__PURE__ */ jsxs12(Tooltip, { children: [
2956
+ /* @__PURE__ */ jsx28(TooltipTrigger, { asChild: true, children: content }),
2957
+ /* @__PURE__ */ jsx28(TooltipContent, { sideOffset: 8, children: tooltip })
2259
2958
  ] });
2260
2959
  }
2261
2960
 
@@ -2263,11 +2962,9 @@ function Select(props) {
2263
2962
  import { NodeViewWrapper as NodeViewWrapper3 } from "@tiptap/react";
2264
2963
 
2265
2964
  // src/editor/components/show-popover.tsx
2266
- import { Eye } from "lucide-react";
2267
- import { useRef as useRef4, useState as useState4 } from "react";
2268
- import { useMemo as useMemo3 } from "react";
2269
- import { memo } from "react";
2270
- import { jsx as jsx22, jsxs as jsxs9 } from "react/jsx-runtime";
2965
+ import { Eye, InfoIcon } from "lucide-react";
2966
+ import { memo, useMemo as useMemo3, useRef as useRef4, useState as useState4 } from "react";
2967
+ import { jsx as jsx29, jsxs as jsxs13 } from "react/jsx-runtime";
2271
2968
  function _ShowPopover(props) {
2272
2969
  const { showIfKey = "", onShowIfKeyValueChange, editor } = props;
2273
2970
  const { variables = [], renderVariable = DEFAULT_RENDER_VARIABLE_FUNCTION } = useMailyContext();
@@ -2281,7 +2978,7 @@ function _ShowPopover(props) {
2281
2978
  }).map((variable) => variable.name);
2282
2979
  }, [variables, showIfKey, editor]);
2283
2980
  const isValidWhenKey = showIfKey || autoCompleteOptions.includes(showIfKey);
2284
- return /* @__PURE__ */ jsxs9(
2981
+ return /* @__PURE__ */ jsxs13(
2285
2982
  Popover,
2286
2983
  {
2287
2984
  onOpenChange: (open) => {
@@ -2291,20 +2988,20 @@ function _ShowPopover(props) {
2291
2988
  setIsUpdatingKey(false);
2292
2989
  },
2293
2990
  children: [
2294
- /* @__PURE__ */ jsxs9(Tooltip, { children: [
2295
- /* @__PURE__ */ jsx22(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx22(
2991
+ /* @__PURE__ */ jsxs13(Tooltip, { children: [
2992
+ /* @__PURE__ */ jsx29(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx29(
2296
2993
  PopoverTrigger,
2297
2994
  {
2298
2995
  className: cn(
2299
- "mly-flex mly-items-center mly-gap-1 mly-rounded-md mly-px-1.5 mly-text-sm data-[state=open]:mly-bg-soft-gray hover:mly-bg-soft-gray focus-visible:mly-relative focus-visible:mly-z-10 focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2",
2996
+ "mly-flex mly-size-7 mly-items-center mly-justify-center mly-gap-1 mly-rounded-md mly-px-1.5 mly-text-sm data-[state=open]:mly-bg-soft-gray hover:mly-bg-soft-gray focus-visible:mly-relative focus-visible:mly-z-10 focus-visible:mly-outline-none focus-visible:mly-ring-2 focus-visible:mly-ring-gray-400 focus-visible:mly-ring-offset-2",
2300
2997
  showIfKey && "mly-bg-rose-100 mly-text-rose-800 data-[state=open]:mly-bg-rose-100 hover:mly-bg-rose-100"
2301
2998
  ),
2302
- children: /* @__PURE__ */ jsx22(Eye, { className: "mly-h-4 mly-w-4 mly-stroke-[2.5]" })
2999
+ children: /* @__PURE__ */ jsx29(Eye, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5]" })
2303
3000
  }
2304
3001
  ) }),
2305
- /* @__PURE__ */ jsx22(TooltipContent, { sideOffset: 8, children: "Show block conditionally" })
3002
+ /* @__PURE__ */ jsx29(TooltipContent, { sideOffset: 8, children: "Show block conditionally" })
2306
3003
  ] }),
2307
- /* @__PURE__ */ jsxs9(
3004
+ /* @__PURE__ */ jsxs13(
2308
3005
  PopoverContent,
2309
3006
  {
2310
3007
  className: "mly-flex mly-w-max mly-rounded-lg !mly-p-0.5",
@@ -2318,8 +3015,27 @@ function _ShowPopover(props) {
2318
3015
  e.preventDefault();
2319
3016
  },
2320
3017
  children: [
2321
- /* @__PURE__ */ jsx22("span", { className: "mly-flex mly-items-center mly-px-1.5 mly-text-sm mly-leading-none", children: "Show if" }),
2322
- !isUpdatingKey && /* @__PURE__ */ jsx22(
3018
+ /* @__PURE__ */ jsxs13("div", { className: "mly-flex mly-items-center mly-gap-1.5 mly-px-1.5 mly-text-sm mly-leading-none", children: [
3019
+ "Show if",
3020
+ /* @__PURE__ */ jsxs13(Tooltip, { children: [
3021
+ /* @__PURE__ */ jsx29(TooltipTrigger, { children: /* @__PURE__ */ jsx29(
3022
+ InfoIcon,
3023
+ {
3024
+ className: cn("mly-size-3 mly-stroke-[2.5] mly-text-gray-500")
3025
+ }
3026
+ ) }),
3027
+ /* @__PURE__ */ jsx29(
3028
+ TooltipContent,
3029
+ {
3030
+ sideOffset: 14,
3031
+ className: "mly-max-w-[285px]",
3032
+ align: "start",
3033
+ children: "Show the block if the selected variable is true."
3034
+ }
3035
+ )
3036
+ ] })
3037
+ ] }),
3038
+ !isUpdatingKey && /* @__PURE__ */ jsx29(
2323
3039
  "button",
2324
3040
  {
2325
3041
  onClick: () => {
@@ -2340,7 +3056,7 @@ function _ShowPopover(props) {
2340
3056
  })
2341
3057
  }
2342
3058
  ),
2343
- isUpdatingKey && /* @__PURE__ */ jsx22(
3059
+ isUpdatingKey && /* @__PURE__ */ jsx29(
2344
3060
  "form",
2345
3061
  {
2346
3062
  onSubmit: (e) => {
@@ -2352,7 +3068,7 @@ function _ShowPopover(props) {
2352
3068
  setIsUpdatingKey(false);
2353
3069
  }
2354
3070
  },
2355
- children: /* @__PURE__ */ jsx22(
3071
+ children: /* @__PURE__ */ jsx29(
2356
3072
  InputAutocomplete,
2357
3073
  {
2358
3074
  value: showIfKey || "",
@@ -2385,7 +3101,7 @@ var ShowPopover = memo(_ShowPopover);
2385
3101
  import { useMemo as useMemo4 } from "react";
2386
3102
  import { useState as useState5 } from "react";
2387
3103
  import { useRef as useRef5 } from "react";
2388
- import { jsx as jsx23, jsxs as jsxs10 } from "react/jsx-runtime";
3104
+ import { jsx as jsx30, jsxs as jsxs14 } from "react/jsx-runtime";
2389
3105
  function ButtonLabelInput(props) {
2390
3106
  const { value, onValueChange, isVariable, editor } = props;
2391
3107
  const linkInputRef = useRef5(null);
@@ -2407,8 +3123,8 @@ function ButtonLabelInput(props) {
2407
3123
  editor
2408
3124
  }).map((variable) => variable.name);
2409
3125
  }, [variables, value, editor]);
2410
- return /* @__PURE__ */ jsxs10("div", { className: "mly-isolate mly-flex mly-rounded-lg", children: [
2411
- !isEditing && /* @__PURE__ */ jsx23(
3126
+ return /* @__PURE__ */ jsxs14("div", { className: "mly-isolate mly-flex mly-rounded-lg", children: [
3127
+ !isEditing && /* @__PURE__ */ jsx30(
2412
3128
  "button",
2413
3129
  {
2414
3130
  onClick: () => {
@@ -2429,7 +3145,7 @@ function ButtonLabelInput(props) {
2429
3145
  })
2430
3146
  }
2431
3147
  ),
2432
- isEditing && /* @__PURE__ */ jsx23(
3148
+ isEditing && /* @__PURE__ */ jsx30(
2433
3149
  InputAutocomplete,
2434
3150
  {
2435
3151
  value,
@@ -2456,7 +3172,7 @@ function ButtonLabelInput(props) {
2456
3172
 
2457
3173
  // src/editor/nodes/button/button-view.tsx
2458
3174
  import { useMemo as useMemo5 } from "react";
2459
- import { jsx as jsx24, jsxs as jsxs11 } from "react/jsx-runtime";
3175
+ import { jsx as jsx31, jsxs as jsxs15 } from "react/jsx-runtime";
2460
3176
  function ButtonView(props) {
2461
3177
  const { node, editor, getPos, updateAttributes: updateAttributes2 } = props;
2462
3178
  const {
@@ -2499,7 +3215,7 @@ function ButtonView(props) {
2499
3215
  ([, { paddingX, paddingY }]) => paddingRight === paddingX && paddingTop === paddingY
2500
3216
  )) == null ? void 0 : _a[0];
2501
3217
  }, [paddingRight, paddingTop, sizes]);
2502
- return /* @__PURE__ */ jsx24(
3218
+ return /* @__PURE__ */ jsx31(
2503
3219
  NodeViewWrapper3,
2504
3220
  {
2505
3221
  draggable: editor.isEditable,
@@ -2508,8 +3224,8 @@ function ButtonView(props) {
2508
3224
  style: {
2509
3225
  textAlign: alignment
2510
3226
  },
2511
- children: /* @__PURE__ */ jsxs11(Popover, { open: props.selected && editor.isEditable, children: [
2512
- /* @__PURE__ */ jsx24(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx24("div", { children: /* @__PURE__ */ jsx24(
3227
+ children: /* @__PURE__ */ jsxs15(Popover, { open: props.selected && editor.isEditable, children: [
3228
+ /* @__PURE__ */ jsx31(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx31("div", { children: /* @__PURE__ */ jsx31(
2513
3229
  "button",
2514
3230
  {
2515
3231
  className: cn(
@@ -2552,7 +3268,7 @@ function ButtonView(props) {
2552
3268
  }) : text2
2553
3269
  }
2554
3270
  ) }) }),
2555
- /* @__PURE__ */ jsx24(
3271
+ /* @__PURE__ */ jsx31(
2556
3272
  PopoverContent,
2557
3273
  {
2558
3274
  align: "end",
@@ -2561,8 +3277,8 @@ function ButtonView(props) {
2561
3277
  sideOffset: 8,
2562
3278
  onOpenAutoFocus: (e) => e.preventDefault(),
2563
3279
  onCloseAutoFocus: (e) => e.preventDefault(),
2564
- children: /* @__PURE__ */ jsx24(TooltipProvider, { children: /* @__PURE__ */ jsxs11("div", { className: "mly-flex mly-items-stretch mly-text-midnight-gray", children: [
2565
- /* @__PURE__ */ jsx24(
3280
+ children: /* @__PURE__ */ jsx31(TooltipProvider, { children: /* @__PURE__ */ jsxs15("div", { className: "mly-flex mly-items-stretch mly-text-midnight-gray", children: [
3281
+ /* @__PURE__ */ jsx31(
2566
3282
  ButtonLabelInput,
2567
3283
  {
2568
3284
  value: text2,
@@ -2576,9 +3292,9 @@ function ButtonView(props) {
2576
3292
  editor
2577
3293
  }
2578
3294
  ),
2579
- /* @__PURE__ */ jsx24(Divider, {}),
2580
- /* @__PURE__ */ jsxs11("div", { className: "mly-flex mly-space-x-0.5", children: [
2581
- /* @__PURE__ */ jsx24(
3295
+ /* @__PURE__ */ jsx31(Divider, {}),
3296
+ /* @__PURE__ */ jsxs15("div", { className: "mly-flex mly-space-x-0.5", children: [
3297
+ /* @__PURE__ */ jsx31(
2582
3298
  Select,
2583
3299
  {
2584
3300
  label: "Border Radius",
@@ -2596,7 +3312,7 @@ function ButtonView(props) {
2596
3312
  className: "mly-capitalize"
2597
3313
  }
2598
3314
  ),
2599
- /* @__PURE__ */ jsx24(
3315
+ /* @__PURE__ */ jsx31(
2600
3316
  Select,
2601
3317
  {
2602
3318
  label: "Style",
@@ -2614,7 +3330,7 @@ function ButtonView(props) {
2614
3330
  className: "mly-capitalize"
2615
3331
  }
2616
3332
  ),
2617
- /* @__PURE__ */ jsx24(
3333
+ /* @__PURE__ */ jsx31(
2618
3334
  Select,
2619
3335
  {
2620
3336
  label: "Size",
@@ -2637,9 +3353,9 @@ function ButtonView(props) {
2637
3353
  }
2638
3354
  )
2639
3355
  ] }),
2640
- /* @__PURE__ */ jsx24(Divider, {}),
2641
- /* @__PURE__ */ jsxs11("div", { className: "mly-flex mly-space-x-0.5", children: [
2642
- /* @__PURE__ */ jsx24(
3356
+ /* @__PURE__ */ jsx31(Divider, {}),
3357
+ /* @__PURE__ */ jsxs15("div", { className: "mly-flex mly-space-x-0.5", children: [
3358
+ /* @__PURE__ */ jsx31(
2643
3359
  AlignmentSwitch,
2644
3360
  {
2645
3361
  alignment,
@@ -2650,7 +3366,7 @@ function ButtonView(props) {
2650
3366
  }
2651
3367
  }
2652
3368
  ),
2653
- /* @__PURE__ */ jsx24(
3369
+ /* @__PURE__ */ jsx31(
2654
3370
  LinkInputPopover,
2655
3371
  {
2656
3372
  defaultValue: externalLink || "",
@@ -2666,9 +3382,9 @@ function ButtonView(props) {
2666
3382
  }
2667
3383
  )
2668
3384
  ] }),
2669
- /* @__PURE__ */ jsx24(Divider, {}),
2670
- /* @__PURE__ */ jsxs11("div", { className: "mly-flex mly-space-x-0.5", children: [
2671
- /* @__PURE__ */ jsx24(
3385
+ /* @__PURE__ */ jsx31(Divider, {}),
3386
+ /* @__PURE__ */ jsxs15("div", { className: "mly-flex mly-space-x-0.5", children: [
3387
+ /* @__PURE__ */ jsx31(
2672
3388
  BackgroundColorPickerPopup,
2673
3389
  {
2674
3390
  variant,
@@ -2680,7 +3396,7 @@ function ButtonView(props) {
2680
3396
  }
2681
3397
  }
2682
3398
  ),
2683
- /* @__PURE__ */ jsx24(
3399
+ /* @__PURE__ */ jsx31(
2684
3400
  TextColorPickerPopup,
2685
3401
  {
2686
3402
  color: textColor,
@@ -2692,8 +3408,8 @@ function ButtonView(props) {
2692
3408
  }
2693
3409
  )
2694
3410
  ] }),
2695
- /* @__PURE__ */ jsx24(Divider, {}),
2696
- /* @__PURE__ */ jsx24(
3411
+ /* @__PURE__ */ jsx31(Divider, {}),
3412
+ /* @__PURE__ */ jsx31(
2697
3413
  ShowPopover,
2698
3414
  {
2699
3415
  showIfKey,
@@ -2714,20 +3430,20 @@ function ButtonView(props) {
2714
3430
  }
2715
3431
  function BackgroundColorPickerPopup(props) {
2716
3432
  const { color, onChange, variant } = props;
2717
- return /* @__PURE__ */ jsx24(
3433
+ return /* @__PURE__ */ jsx31(
2718
3434
  ColorPicker,
2719
3435
  {
2720
3436
  color,
2721
3437
  onColorChange: onChange,
2722
3438
  tooltip: "Background Color",
2723
- children: /* @__PURE__ */ jsx24(
3439
+ children: /* @__PURE__ */ jsx31(
2724
3440
  BaseButton,
2725
3441
  {
2726
3442
  variant: "ghost",
2727
3443
  size: "sm",
2728
3444
  type: "button",
2729
3445
  className: "mly-size-7",
2730
- children: /* @__PURE__ */ jsx24(
3446
+ children: /* @__PURE__ */ jsx31(
2731
3447
  "div",
2732
3448
  {
2733
3449
  className: "mly-h-4 mly-w-4 mly-shrink-0 mly-rounded-full mly-shadow",
@@ -2746,16 +3462,16 @@ function BackgroundColorPickerPopup(props) {
2746
3462
  }
2747
3463
  function TextColorPickerPopup(props) {
2748
3464
  const { color, onChange } = props;
2749
- return /* @__PURE__ */ jsx24(ColorPicker, { color, onColorChange: onChange, tooltip: "Text Color", children: /* @__PURE__ */ jsx24(
3465
+ return /* @__PURE__ */ jsx31(ColorPicker, { color, onColorChange: onChange, tooltip: "Text Color", children: /* @__PURE__ */ jsx31(
2750
3466
  BaseButton,
2751
3467
  {
2752
3468
  variant: "ghost",
2753
3469
  size: "sm",
2754
3470
  type: "button",
2755
3471
  className: "mly-size-7",
2756
- children: /* @__PURE__ */ jsxs11("div", { className: "mly-flex mly-flex-col mly-items-center mly-justify-center mly-gap-[1px]", children: [
2757
- /* @__PURE__ */ jsx24("span", { className: "mly-font-bolder mly-font-mono mly-text-xs mly-text-midnight-gray", children: "A" }),
2758
- /* @__PURE__ */ jsx24(
3472
+ children: /* @__PURE__ */ jsxs15("div", { className: "mly-flex mly-flex-col mly-items-center mly-justify-center mly-gap-[1px]", children: [
3473
+ /* @__PURE__ */ jsx31("span", { className: "mly-font-bolder mly-font-mono mly-text-xs mly-text-midnight-gray", children: "A" }),
3474
+ /* @__PURE__ */ jsx31(
2759
3475
  "div",
2760
3476
  {
2761
3477
  className: "mly-h-[2px] mly-w-3 mly-shrink-0 mly-rounded-md mly-shadow",
@@ -3029,7 +3745,7 @@ var useEvent = (handler) => {
3029
3745
  import { NodeViewWrapper as NodeViewWrapper4 } from "@tiptap/react";
3030
3746
  import { Ban, BracesIcon as BracesIcon2, ImageOffIcon, Loader2 } from "lucide-react";
3031
3747
  import { useEffect as useEffect3, useRef as useRef7, useState as useState6 } from "react";
3032
- import { Fragment as Fragment3, jsx as jsx25, jsxs as jsxs12 } from "react/jsx-runtime";
3748
+ import { Fragment as Fragment3, jsx as jsx32, jsxs as jsxs16 } from "react/jsx-runtime";
3033
3749
  var MIN_WIDTH = 20;
3034
3750
  var MAX_WIDTH = 600;
3035
3751
  function ImageView(props) {
@@ -3080,7 +3796,7 @@ function ImageView(props) {
3080
3796
  }
3081
3797
  );
3082
3798
  function dragCornerButton(direction) {
3083
- return /* @__PURE__ */ jsx25(
3799
+ return /* @__PURE__ */ jsx32(
3084
3800
  "div",
3085
3801
  {
3086
3802
  role: "button",
@@ -3145,7 +3861,7 @@ function ImageView(props) {
3145
3861
  img.onerror = null;
3146
3862
  };
3147
3863
  }, [src]);
3148
- return /* @__PURE__ */ jsxs12(
3864
+ return /* @__PURE__ */ jsxs16(
3149
3865
  NodeViewWrapper4,
3150
3866
  {
3151
3867
  as: "div",
@@ -3167,12 +3883,12 @@ function ImageView(props) {
3167
3883
  }[alignment] || {}),
3168
3884
  ref: wrapperRef,
3169
3885
  children: [
3170
- !hasImageSrc && /* @__PURE__ */ jsx25(ImageStatusLabel, { status: "idle" }),
3171
- hasImageSrc && isSrcVariable && /* @__PURE__ */ jsx25(ImageStatusLabel, { status: "variable" }),
3172
- hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */ jsx25(ImageStatusLabel, { status: "loading" }),
3173
- hasImageSrc && status === "error" && !isSrcVariable && /* @__PURE__ */ jsx25(ImageStatusLabel, { status: "error" }),
3174
- hasImageSrc && status === "loaded" && !isSrcVariable && /* @__PURE__ */ jsxs12(Fragment3, { children: [
3175
- /* @__PURE__ */ jsx25(
3886
+ !hasImageSrc && /* @__PURE__ */ jsx32(ImageStatusLabel, { status: "idle", minHeight: height }),
3887
+ hasImageSrc && isSrcVariable && /* @__PURE__ */ jsx32(ImageStatusLabel, { status: "variable", minHeight: height }),
3888
+ hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */ jsx32(ImageStatusLabel, { status: "loading", minHeight: height }),
3889
+ hasImageSrc && status === "error" && !isSrcVariable && /* @__PURE__ */ jsx32(ImageStatusLabel, { status: "error", minHeight: height }),
3890
+ hasImageSrc && status === "loaded" && !isSrcVariable && /* @__PURE__ */ jsxs16(Fragment3, { children: [
3891
+ /* @__PURE__ */ jsx32(
3176
3892
  "img",
3177
3893
  __spreadProps(__spreadValues({}, attrs), {
3178
3894
  ref: imgRef,
@@ -3183,13 +3899,13 @@ function ImageView(props) {
3183
3899
  draggable: editor.isEditable
3184
3900
  })
3185
3901
  ),
3186
- selected && editor.isEditable && /* @__PURE__ */ jsxs12(Fragment3, { children: [
3902
+ selected && editor.isEditable && /* @__PURE__ */ jsxs16(Fragment3, { children: [
3187
3903
  [
3188
3904
  { left: 0, top: 0, height: "100%", width: "1px" },
3189
3905
  { right: 0, top: 0, height: "100%", width: "1px" },
3190
3906
  { top: 0, left: 0, width: "100%", height: "1px" },
3191
3907
  { bottom: 0, left: 0, width: "100%", height: "1px" }
3192
- ].map((style, i) => /* @__PURE__ */ jsx25(
3908
+ ].map((style, i) => /* @__PURE__ */ jsx32(
3193
3909
  "div",
3194
3910
  {
3195
3911
  className: "mly-bg-rose-500",
@@ -3210,33 +3926,36 @@ function ImageView(props) {
3210
3926
  );
3211
3927
  }
3212
3928
  function ImageStatusLabel(props) {
3213
- const { status } = props;
3214
- return /* @__PURE__ */ jsxs12(
3929
+ const { status, minHeight } = props;
3930
+ return /* @__PURE__ */ jsxs16(
3215
3931
  "div",
3216
3932
  {
3217
3933
  className: cn(
3218
- "mly-flex mly-items-center mly-gap-2 mly-rounded-lg mly-bg-soft-gray mly-p-4 mly-text-sm mly-font-medium",
3934
+ "mly-flex mly-items-center mly-justify-center mly-gap-2 mly-rounded-lg mly-bg-soft-gray mly-px-4 mly-py-2 mly-text-sm mly-font-medium",
3219
3935
  {
3220
3936
  "mly-text-gray-500 hover:mly-bg-soft-gray/60": status === "loading",
3221
3937
  "mly-text-red-500 hover:mly-bg-soft-gray/60": status === "error"
3222
3938
  }
3223
3939
  ),
3940
+ style: __spreadValues({}, minHeight ? {
3941
+ minHeight
3942
+ } : {}),
3224
3943
  children: [
3225
- status === "idle" && /* @__PURE__ */ jsxs12(Fragment3, { children: [
3226
- /* @__PURE__ */ jsx25(ImageOffIcon, { className: "mly-size-4 mly-stroke-[2.5]" }),
3227
- /* @__PURE__ */ jsx25("span", { children: "No image selected" })
3944
+ status === "idle" && /* @__PURE__ */ jsxs16(Fragment3, { children: [
3945
+ /* @__PURE__ */ jsx32(ImageOffIcon, { className: "mly-size-4 mly-stroke-[2.5]" }),
3946
+ /* @__PURE__ */ jsx32("span", { children: "No image selected" })
3228
3947
  ] }),
3229
- status === "loading" && /* @__PURE__ */ jsxs12(Fragment3, { children: [
3230
- /* @__PURE__ */ jsx25(Loader2, { className: "mly-size-4 mly-animate-spin mly-stroke-[2.5]" }),
3231
- /* @__PURE__ */ jsx25("span", { children: "Loading image..." })
3948
+ status === "loading" && /* @__PURE__ */ jsxs16(Fragment3, { children: [
3949
+ /* @__PURE__ */ jsx32(Loader2, { className: "mly-size-4 mly-animate-spin mly-stroke-[2.5]" }),
3950
+ /* @__PURE__ */ jsx32("span", { children: "Loading image..." })
3232
3951
  ] }),
3233
- status === "error" && /* @__PURE__ */ jsxs12(Fragment3, { children: [
3234
- /* @__PURE__ */ jsx25(Ban, { className: "mly-size-4 mly-stroke-[2.5]" }),
3235
- /* @__PURE__ */ jsx25("span", { children: "Error loading image" })
3952
+ status === "error" && /* @__PURE__ */ jsxs16(Fragment3, { children: [
3953
+ /* @__PURE__ */ jsx32(Ban, { className: "mly-size-4 mly-stroke-[2.5]" }),
3954
+ /* @__PURE__ */ jsx32("span", { children: "Error loading image" })
3236
3955
  ] }),
3237
- status === "variable" && /* @__PURE__ */ jsxs12(Fragment3, { children: [
3238
- /* @__PURE__ */ jsx25(BracesIcon2, { className: "mly-size-4 mly-stroke-[2.5]" }),
3239
- /* @__PURE__ */ jsx25("span", { children: "Variable Image URL" })
3956
+ status === "variable" && /* @__PURE__ */ jsxs16(Fragment3, { children: [
3957
+ /* @__PURE__ */ jsx32(BracesIcon2, { className: "mly-size-4 mly-stroke-[2.5]" }),
3958
+ /* @__PURE__ */ jsx32("span", { children: "Variable Image URL" })
3240
3959
  ] })
3241
3960
  ]
3242
3961
  }
@@ -3244,7 +3963,7 @@ function ImageStatusLabel(props) {
3244
3963
  }
3245
3964
 
3246
3965
  // src/editor/nodes/logo/logo-view.tsx
3247
- import { jsx as jsx26, jsxs as jsxs13 } from "react/jsx-runtime";
3966
+ import { jsx as jsx33, jsxs as jsxs17 } from "react/jsx-runtime";
3248
3967
  function LogoView(props) {
3249
3968
  const { node, editor } = props;
3250
3969
  const [status, setStatus] = useState7("idle");
@@ -3275,7 +3994,7 @@ function LogoView(props) {
3275
3994
  };
3276
3995
  }, [logoSrc]);
3277
3996
  const logoSize = logoSizes[size];
3278
- return /* @__PURE__ */ jsxs13(
3997
+ return /* @__PURE__ */ jsxs17(
3279
3998
  NodeViewWrapper5,
3280
3999
  {
3281
4000
  as: "div",
@@ -3289,11 +4008,11 @@ function LogoView(props) {
3289
4008
  display: "block"
3290
4009
  },
3291
4010
  children: [
3292
- !hasImageSrc && /* @__PURE__ */ jsx26(ImageStatusLabel, { status: "idle" }),
3293
- hasImageSrc && isSrcVariable && /* @__PURE__ */ jsx26(ImageStatusLabel, { status: "variable" }),
3294
- hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */ jsx26(ImageStatusLabel, { status: "loading" }),
3295
- hasImageSrc && status === "error" && !isSrcVariable && /* @__PURE__ */ jsx26(ImageStatusLabel, { status: "error" }),
3296
- hasImageSrc && status === "loaded" && !isSrcVariable && /* @__PURE__ */ jsx26(
4011
+ !hasImageSrc && /* @__PURE__ */ jsx33(ImageStatusLabel, { status: "idle", minHeight: logoSize }),
4012
+ hasImageSrc && isSrcVariable && /* @__PURE__ */ jsx33(ImageStatusLabel, { status: "variable", minHeight: logoSize }),
4013
+ hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */ jsx33(ImageStatusLabel, { status: "loading", minHeight: logoSize }),
4014
+ hasImageSrc && status === "error" && !isSrcVariable && /* @__PURE__ */ jsx33(ImageStatusLabel, { status: "error", minHeight: logoSize }),
4015
+ hasImageSrc && status === "loaded" && !isSrcVariable && /* @__PURE__ */ jsx33(
3297
4016
  "img",
3298
4017
  {
3299
4018
  src: logoSrc,
@@ -3595,10 +4314,10 @@ import { ReactNodeViewRenderer as ReactNodeViewRenderer5 } from "@tiptap/react";
3595
4314
  // src/editor/nodes/repeat/repeat-view.tsx
3596
4315
  import { NodeViewWrapper as NodeViewWrapper6, NodeViewContent } from "@tiptap/react";
3597
4316
  import { Repeat2 as Repeat22 } from "lucide-react";
3598
- import { jsx as jsx27, jsxs as jsxs14 } from "react/jsx-runtime";
4317
+ import { jsx as jsx34, jsxs as jsxs18 } from "react/jsx-runtime";
3599
4318
  function RepeatView(props) {
3600
4319
  const { editor, getPos } = props;
3601
- return /* @__PURE__ */ jsxs14(
4320
+ return /* @__PURE__ */ jsxs18(
3602
4321
  NodeViewWrapper6,
3603
4322
  {
3604
4323
  "data-type": "repeat",
@@ -3606,8 +4325,8 @@ function RepeatView(props) {
3606
4325
  "data-drag-handle": editor.isEditable,
3607
4326
  className: "mly-relative",
3608
4327
  children: [
3609
- /* @__PURE__ */ jsx27(NodeViewContent, { className: "is-editable" }),
3610
- /* @__PURE__ */ jsxs14(
4328
+ /* @__PURE__ */ jsx34(NodeViewContent, { className: "is-editable" }),
4329
+ /* @__PURE__ */ jsxs18(
3611
4330
  "div",
3612
4331
  {
3613
4332
  role: "button",
@@ -3618,8 +4337,8 @@ function RepeatView(props) {
3618
4337
  editor.commands.setNodeSelection(getPos());
3619
4338
  },
3620
4339
  children: [
3621
- /* @__PURE__ */ jsx27(Repeat22, { className: "mly-size-3 mly-stroke-[2.5] mly-text-midnight-gray" }),
3622
- /* @__PURE__ */ jsx27("div", { className: "mly-w-[1.5px] mly-grow mly-rounded-full mly-bg-rose-300" })
4340
+ /* @__PURE__ */ jsx34(Repeat22, { className: "mly-size-3 mly-stroke-[2.5] mly-text-midnight-gray" }),
4341
+ /* @__PURE__ */ jsx34("div", { className: "mly-w-[1.5px] mly-grow mly-rounded-full mly-bg-rose-300" })
3623
4342
  ]
3624
4343
  }
3625
4344
  )
@@ -3764,24 +4483,6 @@ var MailyKit = Extension.create({
3764
4483
  types: [Paragraph.name, Heading.name, Footer.name]
3765
4484
  }),
3766
4485
  HorizontalRule,
3767
- Placeholder.configure({
3768
- placeholder: ({ node }) => {
3769
- if (node.type.name === "heading") {
3770
- return `Heading ${node.attrs.level}`;
3771
- } else if ([
3772
- "columns",
3773
- "column",
3774
- "section",
3775
- "repeat",
3776
- "show",
3777
- "blockquote"
3778
- ].includes(node.type.name)) {
3779
- return "";
3780
- }
3781
- return "Write something or / to see commands";
3782
- },
3783
- includeChildren: true
3784
- }),
3785
4486
  Footer,
3786
4487
  Focus,
3787
4488
  Dropcursor.configure({
@@ -3859,139 +4560,273 @@ var SlashCommandExtension = Extension2.create({
3859
4560
  }
3860
4561
  });
3861
4562
 
3862
- // src/editor/utils/update-scroll-view.ts
3863
- var updateScrollView = (container, item) => {
3864
- const containerHeight = container.offsetHeight;
3865
- const itemHeight = item ? item.offsetHeight : 0;
3866
- const top = item.offsetTop;
3867
- const bottom = top + itemHeight;
3868
- if (top < container.scrollTop) {
3869
- container.scrollTop -= container.scrollTop - top + 5;
3870
- } else if (bottom > containerHeight + container.scrollTop) {
3871
- container.scrollTop += bottom - containerHeight - container.scrollTop + 5;
3872
- }
3873
- };
3874
-
3875
4563
  // src/editor/extensions/slash-command/slash-command-view.tsx
3876
4564
  import { ReactRenderer } from "@tiptap/react";
3877
4565
  import {
4566
+ forwardRef as forwardRef8,
4567
+ Fragment as Fragment4,
3878
4568
  useCallback as useCallback3,
3879
4569
  useEffect as useEffect5,
4570
+ useImperativeHandle as useImperativeHandle2,
3880
4571
  useLayoutEffect as useLayoutEffect2,
3881
4572
  useRef as useRef8,
3882
4573
  useState as useState8
3883
4574
  } from "react";
3884
4575
  import tippy from "tippy.js";
3885
- import { jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
3886
- function CommandList(props) {
3887
- const { items, command, editor } = props;
3888
- const [selectedIndex, setSelectedIndex] = useState8(0);
4576
+ import { ChevronRightIcon } from "lucide-react";
4577
+ import { Fragment as Fragment5, jsx as jsx35, jsxs as jsxs19 } from "react/jsx-runtime";
4578
+ var CommandList = forwardRef8(function CommandList2(props, ref) {
4579
+ const { items: groups, command, editor } = props;
4580
+ const [selectedGroupIndex, setSelectedGroupIndex] = useState8(0);
4581
+ const [selectedCommandIndex, setSelectedCommandIndex] = useState8(0);
3889
4582
  const selectItem = useCallback3(
3890
- (index) => {
3891
- const item = items[index];
3892
- if (item) {
3893
- command(item);
4583
+ (groupIndex, commandIndex) => {
4584
+ const item = groups[groupIndex].commands[commandIndex];
4585
+ if (!item) {
4586
+ return;
3894
4587
  }
4588
+ command(item);
3895
4589
  },
3896
- // eslint-disable-next-line react-hooks/exhaustive-deps
3897
- [command, editor, items]
4590
+ [command]
3898
4591
  );
3899
- useEffect5(() => {
3900
- const navigationKeys = ["ArrowUp", "ArrowDown", "Enter"];
3901
- const onKeyDown = (e) => {
3902
- if (navigationKeys.includes(e.key)) {
3903
- e.preventDefault();
3904
- if (e.key === "ArrowUp") {
3905
- setSelectedIndex((selectedIndex + items.length - 1) % items.length);
4592
+ useImperativeHandle2(ref, () => ({
4593
+ onKeyDown: ({ event }) => {
4594
+ var _a, _b;
4595
+ const navigationKeys = ["ArrowUp", "ArrowDown", "Enter"];
4596
+ if (navigationKeys.includes(event.key)) {
4597
+ if (event.key === "ArrowUp") {
4598
+ if (!groups.length) {
4599
+ return false;
4600
+ }
4601
+ let newCommandIndex = selectedCommandIndex - 1;
4602
+ let newGroupIndex = selectedGroupIndex;
4603
+ if (newCommandIndex < 0) {
4604
+ newGroupIndex = selectedGroupIndex - 1;
4605
+ newCommandIndex = ((_a = groups[newGroupIndex]) == null ? void 0 : _a.commands.length) - 1 || 0;
4606
+ }
4607
+ if (newGroupIndex < 0) {
4608
+ newGroupIndex = groups.length - 1;
4609
+ newCommandIndex = ((_b = groups[newGroupIndex]) == null ? void 0 : _b.commands.length) - 1 || 0;
4610
+ }
4611
+ setSelectedGroupIndex(newGroupIndex);
4612
+ setSelectedCommandIndex(newCommandIndex);
3906
4613
  return true;
3907
4614
  }
3908
- if (e.key === "ArrowDown") {
3909
- setSelectedIndex((selectedIndex + 1) % items.length);
4615
+ if (event.key === "ArrowDown") {
4616
+ if (!groups.length) {
4617
+ return false;
4618
+ }
4619
+ const commands = groups[selectedGroupIndex].commands;
4620
+ let newCommandIndex = selectedCommandIndex + 1;
4621
+ let newGroupIndex = selectedGroupIndex;
4622
+ if (commands.length - 1 < newCommandIndex) {
4623
+ newCommandIndex = 0;
4624
+ newGroupIndex = selectedGroupIndex + 1;
4625
+ }
4626
+ if (groups.length - 1 < newGroupIndex) {
4627
+ newGroupIndex = 0;
4628
+ }
4629
+ setSelectedGroupIndex(newGroupIndex);
4630
+ setSelectedCommandIndex(newCommandIndex);
3910
4631
  return true;
3911
4632
  }
3912
- if (e.key === "Enter") {
3913
- selectItem(selectedIndex);
4633
+ if (event.key === "Enter") {
4634
+ if (!groups.length) {
4635
+ return false;
4636
+ }
4637
+ selectItem(selectedGroupIndex, selectedCommandIndex);
3914
4638
  return true;
3915
4639
  }
3916
4640
  return false;
3917
4641
  }
3918
- };
3919
- document.addEventListener("keydown", onKeyDown);
3920
- return () => {
3921
- document.removeEventListener("keydown", onKeyDown);
3922
- };
3923
- }, [items, selectedIndex, setSelectedIndex, selectItem]);
4642
+ }
4643
+ }));
3924
4644
  useEffect5(() => {
3925
- setSelectedIndex(0);
3926
- }, [items]);
4645
+ setSelectedGroupIndex(0);
4646
+ setSelectedCommandIndex(0);
4647
+ }, [groups]);
3927
4648
  const commandListContainer = useRef8(null);
4649
+ const activeCommandRef = useRef8(null);
3928
4650
  useLayoutEffect2(() => {
3929
4651
  const container = commandListContainer == null ? void 0 : commandListContainer.current;
3930
- const item = container == null ? void 0 : container.children[selectedIndex];
3931
- if (item && container) {
3932
- updateScrollView(container, item);
4652
+ const activeCommandContainer = activeCommandRef == null ? void 0 : activeCommandRef.current;
4653
+ if (!container || !activeCommandContainer) {
4654
+ return;
3933
4655
  }
3934
- }, [selectedIndex]);
3935
- return items.length > 0 ? /* @__PURE__ */ jsxs15("div", { className: "mly-z-50 mly-w-72 mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-shadow-md mly-transition-all", children: [
3936
- /* @__PURE__ */ jsx28(
4656
+ const { offsetTop, offsetHeight } = activeCommandContainer;
4657
+ container.scrollTop = offsetTop - offsetHeight;
4658
+ }, [
4659
+ selectedGroupIndex,
4660
+ selectedCommandIndex,
4661
+ commandListContainer,
4662
+ activeCommandRef
4663
+ ]);
4664
+ return groups.length > 0 ? /* @__PURE__ */ jsx35(TooltipProvider, { children: /* @__PURE__ */ jsxs19("div", { className: "mly-z-50 mly-w-72 mly-overflow-hidden mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-shadow-md mly-transition-all", children: [
4665
+ /* @__PURE__ */ jsx35(
3937
4666
  "div",
3938
4667
  {
3939
4668
  id: "slash-command",
3940
4669
  ref: commandListContainer,
3941
- className: "mly-no-scrollbar mly-h-auto mly-max-h-[330px] mly-overflow-y-auto mly-scroll-smooth mly-p-1",
3942
- children: items.map((item, index) => {
3943
- return /* @__PURE__ */ jsxs15(
3944
- "button",
4670
+ className: "mly-no-scrollbar mly-h-auto mly-max-h-[330px] mly-overflow-y-auto mly-scroll-smooth",
4671
+ children: groups.map((group, groupIndex) => /* @__PURE__ */ jsxs19(Fragment4, { children: [
4672
+ /* @__PURE__ */ jsx35(
4673
+ "span",
3945
4674
  {
3946
4675
  className: cn(
3947
- "mly-flex mly-w-full mly-items-center mly-space-x-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100 hover:mly-text-gray-900",
3948
- index === selectedIndex ? "mly-bg-gray-100 mly-text-gray-900" : "mly-bg-transparent"
4676
+ "mly-block mly-border-b mly-border-gray-200 mly-bg-soft-gray mly-p-2 mly-text-xs mly-uppercase mly-text-gray-400",
4677
+ groupIndex > 0 ? "mly-border-t" : ""
3949
4678
  ),
3950
- onClick: () => selectItem(index),
3951
- type: "button",
3952
- children: [
3953
- /* @__PURE__ */ jsx28("div", { className: "mly-flex mly-h-6 mly-w-6 mly-shrink-0 mly-items-center mly-justify-center", children: item.icon }),
3954
- /* @__PURE__ */ jsxs15("div", { children: [
3955
- /* @__PURE__ */ jsx28("p", { className: "mly-font-medium", children: item.title }),
3956
- /* @__PURE__ */ jsx28("p", { className: "mly-text-xs mly-text-gray-400", children: item.description })
3957
- ] })
3958
- ]
3959
- },
3960
- index
3961
- );
3962
- })
4679
+ children: group.title
4680
+ }
4681
+ ),
4682
+ /* @__PURE__ */ jsx35("div", { className: "mly-space-y-0.5 mly-p-1", children: group.commands.map((item, commandIndex) => {
4683
+ var _a;
4684
+ const isActive = groupIndex === selectedGroupIndex && commandIndex === selectedCommandIndex;
4685
+ const isSubCommand = "commands" in item;
4686
+ const hasRenderFunction = typeof item.render === "function";
4687
+ const renderFunctionValue = hasRenderFunction ? (_a = item.render) == null ? void 0 : _a.call(item, editor) : null;
4688
+ let value = /* @__PURE__ */ jsxs19(Fragment5, { children: [
4689
+ /* @__PURE__ */ jsx35("div", { className: "mly-flex mly-h-6 mly-w-6 mly-shrink-0 mly-items-center mly-justify-center", children: item.icon }),
4690
+ /* @__PURE__ */ jsxs19("div", { className: "mly-grow", children: [
4691
+ /* @__PURE__ */ jsx35("p", { className: "mly-font-medium", children: item.title }),
4692
+ /* @__PURE__ */ jsx35("p", { className: "mly-text-xs mly-text-gray-400", children: item.description })
4693
+ ] }),
4694
+ isSubCommand && /* @__PURE__ */ jsx35("span", { className: "mly-block mly-px-1 mly-text-gray-400", children: /* @__PURE__ */ jsx35(ChevronRightIcon, { className: "mly-size-3.5 mly-stroke-[2.5]" }) })
4695
+ ] });
4696
+ if (renderFunctionValue !== null && renderFunctionValue !== true) {
4697
+ value = renderFunctionValue;
4698
+ }
4699
+ const shouldOpenTooltip = !!(item == null ? void 0 : item.preview) && isActive;
4700
+ return /* @__PURE__ */ jsxs19(Tooltip, { open: shouldOpenTooltip, children: [
4701
+ /* @__PURE__ */ jsx35(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx35(
4702
+ "button",
4703
+ {
4704
+ className: cn(
4705
+ "mly-flex mly-w-full mly-items-center mly-gap-2 mly-rounded-md mly-px-2 mly-py-1 mly-text-left mly-text-sm mly-text-gray-900 hover:mly-bg-gray-100 hover:mly-text-gray-900",
4706
+ isActive ? "mly-bg-gray-100 mly-text-gray-900" : "mly-bg-transparent"
4707
+ ),
4708
+ onClick: () => selectItem(groupIndex, commandIndex),
4709
+ type: "button",
4710
+ ref: isActive ? activeCommandRef : null,
4711
+ children: value
4712
+ }
4713
+ ) }),
4714
+ /* @__PURE__ */ jsx35(
4715
+ TooltipContent,
4716
+ {
4717
+ side: "right",
4718
+ sideOffset: 10,
4719
+ className: "mly-w-52 mly-rounded-lg mly-border-none mly-p-1 mly-shadow",
4720
+ children: typeof item.preview === "function" ? item == null ? void 0 : item.preview(editor) : /* @__PURE__ */ jsxs19(Fragment5, { children: [
4721
+ /* @__PURE__ */ jsx35("figure", { className: "mly-relative mly-aspect-[2.5] mly-w-full mly-overflow-hidden mly-rounded-md mly-border mly-border-gray-200", children: /* @__PURE__ */ jsx35(
4722
+ "img",
4723
+ {
4724
+ src: item == null ? void 0 : item.preview,
4725
+ alt: item == null ? void 0 : item.title,
4726
+ className: "mly-absolute mly-inset-0 mly-h-full mly-w-full mly-object-cover"
4727
+ }
4728
+ ) }),
4729
+ /* @__PURE__ */ jsx35("p", { className: "mly-mt-2 mly-px-0.5 mly-text-gray-500", children: item.description })
4730
+ ] })
4731
+ }
4732
+ )
4733
+ ] }, commandIndex);
4734
+ }) })
4735
+ ] }, groupIndex))
3963
4736
  }
3964
4737
  ),
3965
- /* @__PURE__ */ jsx28("div", { className: "mly-border-t mly-border-gray-200 mly-px-1 mly-py-3 mly-pl-4", children: /* @__PURE__ */ jsxs15("div", { className: "mly-flex mly-items-center", children: [
3966
- /* @__PURE__ */ jsxs15("p", { className: "mly-text-center mly-text-xs mly-text-gray-400", children: [
3967
- /* @__PURE__ */ jsx28("kbd", { className: "mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium", children: "\u2191" }),
3968
- /* @__PURE__ */ jsx28("kbd", { className: "mly-ml-1 mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium", children: "\u2193" }),
4738
+ /* @__PURE__ */ jsx35("div", { className: "mly-border-t mly-border-gray-200 mly-px-1 mly-py-3 mly-pl-4", children: /* @__PURE__ */ jsxs19("div", { className: "mly-flex mly-items-center", children: [
4739
+ /* @__PURE__ */ jsxs19("p", { className: "mly-text-center mly-text-xs mly-text-gray-400", children: [
4740
+ /* @__PURE__ */ jsx35("kbd", { className: "mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium", children: "\u2191" }),
4741
+ /* @__PURE__ */ jsx35("kbd", { className: "mly-ml-1 mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium", children: "\u2193" }),
3969
4742
  " ",
3970
4743
  "to navigate"
3971
4744
  ] }),
3972
- /* @__PURE__ */ jsx28("span", { "aria-hidden": "true", className: "mly-select-none mly-px-1", children: "\xB7" }),
3973
- /* @__PURE__ */ jsxs15("p", { className: "mly-text-center mly-text-xs mly-text-gray-400", children: [
3974
- /* @__PURE__ */ jsx28("kbd", { className: "mly-rounded mly-border mly-p-1 mly-px-1.5 mly-font-medium", children: "Enter" }),
4745
+ /* @__PURE__ */ jsx35("span", { "aria-hidden": "true", className: "mly-select-none mly-px-1", children: "\xB7" }),
4746
+ /* @__PURE__ */ jsxs19("p", { className: "mly-text-center mly-text-xs mly-text-gray-400", children: [
4747
+ /* @__PURE__ */ jsx35("kbd", { className: "mly-rounded mly-border mly-p-1 mly-px-1.5 mly-font-medium", children: "Enter" }),
3975
4748
  " ",
3976
4749
  "to select"
3977
4750
  ] })
3978
4751
  ] }) })
3979
- ] }) : null;
3980
- }
3981
- function getSlashCommandSuggestions(commands = DEFAULT_SLASH_COMMANDS) {
4752
+ ] }) }) : null;
4753
+ });
4754
+ function getSlashCommandSuggestions(groups = DEFAULT_SLASH_COMMANDS) {
3982
4755
  return {
3983
4756
  items: ({ query, editor }) => {
3984
- return commands.filter((item) => {
3985
- var _a;
3986
- if (typeof query === "string" && query.length > 0) {
3987
- const search = query.toLowerCase();
3988
- if ((_a = item == null ? void 0 : item.shouldBeHidden) == null ? void 0 : _a.call(item, editor)) {
3989
- return false;
4757
+ var _a;
4758
+ let newGroups = groups;
4759
+ let search = query.toLowerCase();
4760
+ const subCommandIds = newGroups.map((group) => {
4761
+ return group.commands.filter((item) => "commands" in item).map((item) => item == null ? void 0 : item.id.toLowerCase());
4762
+ }).flat().map((id) => `${id}.`);
4763
+ const shouldEnterSubCommand = subCommandIds.some(
4764
+ (id) => search.startsWith(id)
4765
+ );
4766
+ if (shouldEnterSubCommand) {
4767
+ const subCommandId = subCommandIds.find((id) => search.startsWith(id));
4768
+ const sanitizedSubCommandId = subCommandId == null ? void 0 : subCommandId.slice(0, -1);
4769
+ const group = (_a = newGroups.find((group2) => {
4770
+ return group2.commands.some(
4771
+ // @ts-ignore
4772
+ (item) => {
4773
+ var _a2;
4774
+ return ((_a2 = item == null ? void 0 : item.id) == null ? void 0 : _a2.toLowerCase()) === sanitizedSubCommandId;
4775
+ }
4776
+ );
4777
+ })) == null ? void 0 : _a.commands.find(
4778
+ // @ts-ignore
4779
+ (item) => {
4780
+ var _a2;
4781
+ return ((_a2 = item == null ? void 0 : item.id) == null ? void 0 : _a2.toLowerCase()) === sanitizedSubCommandId;
3990
4782
  }
3991
- return item.title.toLowerCase().includes(search) || item.description.toLowerCase().includes(search) || item.searchTerms && item.searchTerms.some((term) => term.includes(search));
4783
+ );
4784
+ if (!group) {
4785
+ return groups;
3992
4786
  }
3993
- return true;
3994
- });
4787
+ search = search.replace(subCommandId || "", "");
4788
+ newGroups = [
4789
+ __spreadProps(__spreadValues({}, group), {
4790
+ commands: (group == null ? void 0 : group.commands) || []
4791
+ })
4792
+ ];
4793
+ }
4794
+ const filteredGroups = newGroups.map((group) => {
4795
+ return __spreadProps(__spreadValues({}, group), {
4796
+ commands: group.commands.filter((item) => {
4797
+ var _a2;
4798
+ if (typeof query === "string" && query.length > 0) {
4799
+ const show = (_a2 = item == null ? void 0 : item.render) == null ? void 0 : _a2.call(item, editor);
4800
+ if (show === null) {
4801
+ return false;
4802
+ }
4803
+ return item.title.toLowerCase().includes(search) || (item == null ? void 0 : item.description) && (item == null ? void 0 : item.description.toLowerCase().includes(search)) || item.searchTerms && item.searchTerms.some(
4804
+ (term) => term.includes(search)
4805
+ );
4806
+ }
4807
+ return true;
4808
+ }).map((item) => {
4809
+ const isSubCommandItem = "commands" in item;
4810
+ if (isSubCommandItem) {
4811
+ item = __spreadProps(__spreadValues({}, item), {
4812
+ command: (options) => {
4813
+ const { editor: editor2, range } = options;
4814
+ editor2.chain().focus().insertContentAt(range, `/${item.id}.`).run();
4815
+ }
4816
+ });
4817
+ }
4818
+ return item;
4819
+ })
4820
+ });
4821
+ }).filter((group) => group.commands.length > 0);
4822
+ return filteredGroups;
4823
+ },
4824
+ allow: ({ editor }) => {
4825
+ const isInsideHTMLCodeBlock = editor.isActive("htmlCodeBlock");
4826
+ if (isInsideHTMLCodeBlock) {
4827
+ return false;
4828
+ }
4829
+ return true;
3995
4830
  },
3996
4831
  render: () => {
3997
4832
  let component;
@@ -4049,6 +4884,11 @@ var VariableExtension = Node10.create({
4049
4884
  inline: true,
4050
4885
  selectable: true,
4051
4886
  atom: true,
4887
+ addStorage() {
4888
+ return {
4889
+ popover: false
4890
+ };
4891
+ },
4052
4892
  addOptions() {
4053
4893
  return {
4054
4894
  variables: [],
@@ -4202,13 +5042,13 @@ var VariableExtension = Node10.create({
4202
5042
 
4203
5043
  // src/editor/nodes/variable/variable-suggestions.tsx
4204
5044
  import { ReactRenderer as ReactRenderer2 } from "@tiptap/react";
4205
- import { useRef as useRef9, forwardRef as forwardRef8, useImperativeHandle as useImperativeHandle2 } from "react";
5045
+ import { useRef as useRef9, forwardRef as forwardRef9, useImperativeHandle as useImperativeHandle3 } from "react";
4206
5046
  import tippy2 from "tippy.js";
4207
- import { jsx as jsx29 } from "react/jsx-runtime";
4208
- var VariableList = forwardRef8((props, ref) => {
5047
+ import { jsx as jsx36 } from "react/jsx-runtime";
5048
+ var VariableList = forwardRef9((props, ref) => {
4209
5049
  const { items = [] } = props;
4210
5050
  const popoverRef = useRef9(null);
4211
- useImperativeHandle2(ref, () => ({
5051
+ useImperativeHandle3(ref, () => ({
4212
5052
  onKeyDown: ({ event }) => {
4213
5053
  if (!popoverRef.current) {
4214
5054
  return false;
@@ -4231,7 +5071,7 @@ var VariableList = forwardRef8((props, ref) => {
4231
5071
  return false;
4232
5072
  }
4233
5073
  }));
4234
- return /* @__PURE__ */ jsx29(
5074
+ return /* @__PURE__ */ jsx36(
4235
5075
  VariablePopover,
4236
5076
  {
4237
5077
  items,
@@ -4308,6 +5148,24 @@ function getVariableSuggestions(variables = DEFAULT_VARIABLES, char = DEFAULT_VA
4308
5148
  }
4309
5149
  };
4310
5150
  }
5151
+
5152
+ // src/editor/extensions/placeholder.ts
5153
+ import Placeholder from "@tiptap/extension-placeholder";
5154
+ var PlaceholderExtension = Placeholder.configure({
5155
+ placeholder: ({ node }) => {
5156
+ if (node.type.name === "heading") {
5157
+ return `Heading ${node.attrs.level}`;
5158
+ } else if (node.type.name === "htmlCodeBlock") {
5159
+ return "Type your HTML code...";
5160
+ } else if (["columns", "column", "section", "repeat", "show", "blockquote"].includes(
5161
+ node.type.name
5162
+ )) {
5163
+ return "";
5164
+ }
5165
+ return "Write something or / to see commands";
5166
+ },
5167
+ includeChildren: true
5168
+ });
4311
5169
  export {
4312
5170
  ButtonExtension,
4313
5171
  Color,
@@ -4340,12 +5198,14 @@ export {
4340
5198
  DEFAULT_SECTION_PADDING_RIGHT,
4341
5199
  DEFAULT_SECTION_PADDING_TOP,
4342
5200
  DEFAULT_SECTION_SHOW_IF_KEY,
5201
+ DEFAULT_SPACER_HEIGHT,
4343
5202
  Footer,
4344
5203
  HorizontalRule,
4345
5204
  ImageExtension,
4346
5205
  LinkExtension,
4347
5206
  LogoExtension,
4348
5207
  MailyKit,
5208
+ PlaceholderExtension,
4349
5209
  RepeatExtension,
4350
5210
  SectionExtension,
4351
5211
  SlashCommandExtension,
@@ -4357,7 +5217,6 @@ export {
4357
5217
  allowedButtonVariant,
4358
5218
  allowedLogoAlignment,
4359
5219
  allowedLogoSize,
4360
- allowedSpacerSize,
4361
5220
  getSlashCommandSuggestions,
4362
5221
  getVariableSuggestions,
4363
5222
  logoSizes