@maily-to/core 0.0.26 → 0.1.0

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,751 @@ 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
+ commands: [
2336
+ headerLogoWithTextVertical,
2337
+ headerLogoWithTextHorizontal,
2338
+ headerLogoWithCoverImage
2339
+ ]
2340
+ },
2341
+ {
2342
+ id: "footers",
2343
+ title: "Footers",
2344
+ description: "Add pre-designed footers block",
2345
+ searchTerms: ["footers"],
2346
+ icon: /* @__PURE__ */ jsx22(FootprintsIcon2, { className: "mly-h-4 mly-w-4" }),
2347
+ commands: [
2348
+ footerCopyrightText,
2349
+ footerCommunityFeedbackCta,
2350
+ footerCompanySignature
2351
+ ]
2352
+ },
2353
+ htmlCodeBlock
2354
+ ]
2355
+ }
1655
2356
  ];
1656
2357
 
1657
2358
  // src/editor/nodes/variable/variable-view.tsx
1658
2359
  import { NodeViewWrapper as NodeViewWrapper2 } from "@tiptap/react";
1659
2360
  import { AlertTriangle, Braces, Pencil } from "lucide-react";
1660
- import { jsx as jsx16, jsxs as jsxs4 } from "react/jsx-runtime";
2361
+ import { jsx as jsx23, jsxs as jsxs8 } from "react/jsx-runtime";
1661
2362
  function VariableView(props) {
1662
2363
  const { node, updateAttributes: updateAttributes2, editor } = props;
1663
2364
  const { id, fallback, required } = node.attrs;
1664
2365
  const { renderVariable = DEFAULT_RENDER_VARIABLE_FUNCTION } = useMailyContext();
1665
- return /* @__PURE__ */ jsx16(
2366
+ return /* @__PURE__ */ jsx23(
1666
2367
  NodeViewWrapper2,
1667
2368
  {
1668
2369
  className: "react-component mly-inline-block mly-leading-none",
1669
2370
  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({
2371
+ children: /* @__PURE__ */ jsxs8(
2372
+ Popover,
2373
+ {
2374
+ onOpenChange: (open) => {
2375
+ editor.storage.variable.popover = open;
2376
+ },
2377
+ children: [
2378
+ /* @__PURE__ */ jsx23(PopoverTrigger, { children: renderVariable({
1681
2379
  variable: { name: id, required, valid: true },
1682
2380
  fallback,
1683
2381
  editor,
1684
2382
  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
- ] })
2383
+ }) }),
2384
+ /* @__PURE__ */ jsx23(
2385
+ PopoverContent,
2386
+ {
2387
+ align: "start",
2388
+ side: "bottom",
2389
+ className: "mly-w-max mly-rounded-lg !mly-p-0.5",
2390
+ sideOffset: 8,
2391
+ onOpenAutoFocus: (e) => e.preventDefault(),
2392
+ onCloseAutoFocus: (e) => e.preventDefault(),
2393
+ children: /* @__PURE__ */ jsx23(TooltipProvider, { children: /* @__PURE__ */ jsxs8("div", { className: "mly-flex mly-items-stretch mly-text-midnight-gray", children: [
2394
+ /* @__PURE__ */ jsxs8("label", { className: "mly-relative", children: [
2395
+ /* @__PURE__ */ jsx23("span", { className: "mly-inline-block mly-px-2 mly-text-xs mly-text-midnight-gray", children: "Variable" }),
2396
+ /* @__PURE__ */ jsx23(
2397
+ "input",
2398
+ __spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
2399
+ value: id != null ? id : "",
2400
+ onChange: (e) => {
2401
+ updateAttributes2({
2402
+ id: e.target.value
2403
+ });
2404
+ },
2405
+ placeholder: "ie. name...",
2406
+ 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"
2407
+ })
2408
+ )
2409
+ ] }),
2410
+ /* @__PURE__ */ jsx23(Divider, { className: "mly-mx-1.5" }),
2411
+ /* @__PURE__ */ jsxs8("label", { className: "mly-relative", children: [
2412
+ /* @__PURE__ */ jsx23("span", { className: "mly-inline-block mly-px-2 mly-pl-1 mly-text-xs mly-text-midnight-gray", children: "Default" }),
2413
+ /* @__PURE__ */ jsx23(
2414
+ "input",
2415
+ __spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
2416
+ value: fallback != null ? fallback : "",
2417
+ onChange: (e) => {
2418
+ updateAttributes2({
2419
+ fallback: e.target.value
2420
+ });
2421
+ },
2422
+ placeholder: "ie. John Doe...",
2423
+ 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"
2424
+ })
2425
+ ),
2426
+ /* @__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" }) })
2427
+ ] })
2428
+ ] }) })
2429
+ }
2430
+ )
2431
+ ]
2432
+ }
2433
+ )
1736
2434
  }
1737
2435
  );
1738
2436
  }
@@ -1740,13 +2438,13 @@ var DefaultRenderVariable = (props) => {
1740
2438
  const { variable, fallback, from } = props;
1741
2439
  const { name, required, valid } = variable;
1742
2440
  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 })
2441
+ 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: [
2442
+ /* @__PURE__ */ jsx23(Braces, { className: "mly-h-3 mly-w-3 mly-shrink-0 mly-stroke-[2.5]" }),
2443
+ /* @__PURE__ */ jsx23("span", { className: "mly-min-w-0 mly-truncate mly-text-left", children: name })
1746
2444
  ] });
1747
2445
  }
1748
2446
  if (from === "bubble-variable") {
1749
- return /* @__PURE__ */ jsxs4(
2447
+ return /* @__PURE__ */ jsxs8(
1750
2448
  "div",
1751
2449
  {
1752
2450
  className: cn(
@@ -1754,28 +2452,28 @@ var DefaultRenderVariable = (props) => {
1754
2452
  !valid && "mly-border-rose-400 mly-bg-rose-50 mly-text-rose-600 hover:mly-bg-rose-100"
1755
2453
  ),
1756
2454
  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 })
2455
+ /* @__PURE__ */ jsx23(Braces, { className: "mly-h-3 mly-w-3 mly-shrink-0 mly-stroke-[2.5] mly-text-rose-600" }),
2456
+ /* @__PURE__ */ jsx23("span", { className: "mly-min-w-0 mly-truncate mly-text-left", children: name })
1759
2457
  ]
1760
2458
  }
1761
2459
  );
1762
2460
  }
1763
- return /* @__PURE__ */ jsxs4(
2461
+ return /* @__PURE__ */ jsxs8(
1764
2462
  "span",
1765
2463
  {
1766
2464
  tabIndex: -1,
1767
2465
  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
2466
  children: [
1769
- /* @__PURE__ */ jsx16(Braces, { className: "mly-size-[var(--variable-icon-size)] mly-shrink-0 mly-stroke-[2.5] mly-text-rose-600" }),
2467
+ /* @__PURE__ */ jsx23(Braces, { className: "mly-size-[var(--variable-icon-size)] mly-shrink-0 mly-stroke-[2.5] mly-text-rose-600" }),
1770
2468
  name,
1771
- required && !fallback && /* @__PURE__ */ jsx16(AlertTriangle, { className: "mly-size-[var(--variable-icon-size)] mly-shrink-0 mly-stroke-[2.5]" })
2469
+ required && !fallback && /* @__PURE__ */ jsx23(AlertTriangle, { className: "mly-size-[var(--variable-icon-size)] mly-shrink-0 mly-stroke-[2.5]" })
1772
2470
  ]
1773
2471
  }
1774
2472
  );
1775
2473
  };
1776
2474
 
1777
2475
  // src/editor/provider.tsx
1778
- import { jsx as jsx17 } from "react/jsx-runtime";
2476
+ import { jsx as jsx24 } from "react/jsx-runtime";
1779
2477
  var DEFAULT_PLACEHOLDER_URL = "maily.to/";
1780
2478
  var DEFAULT_VARIABLE_TRIGGER_CHAR = "@";
1781
2479
  var DEFAULT_VARIABLES = [];
@@ -1809,7 +2507,7 @@ import {
1809
2507
  useEffect,
1810
2508
  useRef
1811
2509
  } from "react";
1812
- import { jsx as jsx18, jsxs as jsxs5 } from "react/jsx-runtime";
2510
+ import { jsx as jsx25, jsxs as jsxs9 } from "react/jsx-runtime";
1813
2511
  var VariablePopover = forwardRef6((props, ref) => {
1814
2512
  const { items, onSelectItem } = props;
1815
2513
  const [selectedIndex, setSelectedIndex] = useState(0);
@@ -1855,17 +2553,17 @@ var VariablePopover = forwardRef6((props, ref) => {
1855
2553
  onSelectItem(item);
1856
2554
  }
1857
2555
  }));
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]" }) })
2556
+ 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: [
2557
+ /* @__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: [
2558
+ /* @__PURE__ */ jsx25("span", { className: "mly-text-xs mly-uppercase", children: "Variables" }),
2559
+ /* @__PURE__ */ jsx25(VariableIcon, { children: /* @__PURE__ */ jsx25(Braces2, { className: "mly-size-3 mly-stroke-[2.5]" }) })
1862
2560
  ] }),
1863
- /* @__PURE__ */ jsx18(
2561
+ /* @__PURE__ */ jsx25(
1864
2562
  "div",
1865
2563
  {
1866
2564
  ref: scrollContainerRef,
1867
2565
  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(
2566
+ 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
2567
  "button",
1870
2568
  {
1871
2569
  ref: (el) => itemRefs.current[index] = el,
@@ -1875,27 +2573,27 @@ var VariablePopover = forwardRef6((props, ref) => {
1875
2573
  index === selectedIndex ? "mly-bg-soft-gray" : "mly-bg-white"
1876
2574
  ),
1877
2575
  children: [
1878
- /* @__PURE__ */ jsx18(Braces2, { className: "mly-size-3 mly-stroke-[2.5] mly-text-rose-600" }),
2576
+ /* @__PURE__ */ jsx25(Braces2, { className: "mly-size-3 mly-stroke-[2.5] mly-text-rose-600" }),
1879
2577
  item.name
1880
2578
  ]
1881
2579
  },
1882
2580
  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" }) })
2581
+ )) : /* @__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
2582
  }
1885
2583
  ),
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" })
2584
+ /* @__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: [
2585
+ /* @__PURE__ */ jsxs9("div", { className: "mly-flex mly-items-center mly-gap-1", children: [
2586
+ /* @__PURE__ */ jsx25(VariableIcon, { children: /* @__PURE__ */ jsx25(ArrowDownIcon, { className: "mly-size-3 mly-stroke-[2.5]" }) }),
2587
+ /* @__PURE__ */ jsx25(VariableIcon, { children: /* @__PURE__ */ jsx25(ArrowUpIcon, { className: "mly-size-3 mly-stroke-[2.5]" }) }),
2588
+ /* @__PURE__ */ jsx25("span", { className: "mly-text-xs mly-text-gray-500", children: "Navigate" })
1891
2589
  ] }),
1892
- /* @__PURE__ */ jsx18(VariableIcon, { children: /* @__PURE__ */ jsx18(CornerDownLeftIcon, { className: "mly-size-3 mly-stroke-[2.5]" }) })
2590
+ /* @__PURE__ */ jsx25(VariableIcon, { children: /* @__PURE__ */ jsx25(CornerDownLeftIcon, { className: "mly-size-3 mly-stroke-[2.5]" }) })
1893
2591
  ] })
1894
2592
  ] });
1895
2593
  });
1896
2594
  function VariableIcon(props) {
1897
2595
  const { className, children } = props;
1898
- return /* @__PURE__ */ jsx18(
2596
+ return /* @__PURE__ */ jsx25(
1899
2597
  "div",
1900
2598
  {
1901
2599
  className: cn(
@@ -1932,7 +2630,7 @@ function useOutsideClick(ref, callback) {
1932
2630
  // src/editor/components/ui/input-autocomplete.tsx
1933
2631
  import { CornerDownLeft } from "lucide-react";
1934
2632
  import { forwardRef as forwardRef7, useRef as useRef2 } from "react";
1935
- import { jsx as jsx19, jsxs as jsxs6 } from "react/jsx-runtime";
2633
+ import { jsx as jsx26, jsxs as jsxs10 } from "react/jsx-runtime";
1936
2634
  var InputAutocomplete = forwardRef7((props, ref) => {
1937
2635
  const _a = props, {
1938
2636
  value = "",
@@ -1957,9 +2655,9 @@ var InputAutocomplete = forwardRef7((props, ref) => {
1957
2655
  onOutsideClick == null ? void 0 : onOutsideClick();
1958
2656
  });
1959
2657
  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(
2658
+ return /* @__PURE__ */ jsxs10("div", { className: cn("mly-relative"), ref: containerRef, children: [
2659
+ /* @__PURE__ */ jsxs10("label", { className: "mly-relative", children: [
2660
+ /* @__PURE__ */ jsx26(
1963
2661
  "input",
1964
2662
  __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
1965
2663
  placeholder: "e.g. items",
@@ -1971,7 +2669,7 @@ var InputAutocomplete = forwardRef7((props, ref) => {
1971
2669
  onValueChange(e.target.value);
1972
2670
  },
1973
2671
  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",
2672
+ "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
2673
  className
1976
2674
  ),
1977
2675
  onKeyDown: (e) => {
@@ -1993,9 +2691,9 @@ var InputAutocomplete = forwardRef7((props, ref) => {
1993
2691
  spellCheck: false
1994
2692
  })
1995
2693
  ),
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" }) })
2694
+ /* @__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
2695
  ] }),
1998
- isTriggeringVariable && /* @__PURE__ */ jsx19("div", { className: "mly-absolute mly-left-0 mly-top-8", children: /* @__PURE__ */ jsx19(
2696
+ isTriggeringVariable && /* @__PURE__ */ jsx26("div", { className: "mly-absolute mly-left-0 mly-top-8", children: /* @__PURE__ */ jsx26(
1999
2697
  VariablePopover,
2000
2698
  {
2001
2699
  items: autoCompleteOptions.map((option) => {
@@ -2037,7 +2735,7 @@ You can check out the documentation for more information: https://github.com/ari
2037
2735
 
2038
2736
  // src/editor/components/ui/link-input-popover.tsx
2039
2737
  import { useMemo as useMemo2 } from "react";
2040
- import { Fragment as Fragment2, jsx as jsx20, jsxs as jsxs7 } from "react/jsx-runtime";
2738
+ import { Fragment as Fragment2, jsx as jsx27, jsxs as jsxs11 } from "react/jsx-runtime";
2041
2739
  var LINK_PROTOCOL_REGEX = /https?:\/\//;
2042
2740
  function LinkInputPopover(props) {
2043
2741
  var _a;
@@ -2075,7 +2773,7 @@ function LinkInputPopover(props) {
2075
2773
  editor
2076
2774
  }).map((variable) => variable.name);
2077
2775
  }, [variables, defaultUrlWithoutProtocol, editor]);
2078
- const popoverButton = /* @__PURE__ */ jsx20(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx20(
2776
+ const popoverButton = /* @__PURE__ */ jsx27(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx27(
2079
2777
  BaseButton,
2080
2778
  {
2081
2779
  variant: "ghost",
@@ -2083,19 +2781,19 @@ function LinkInputPopover(props) {
2083
2781
  type: "button",
2084
2782
  className: "mly-size-7",
2085
2783
  "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" })
2784
+ children: /* @__PURE__ */ jsx27(Icon, { className: "mly-h-3 mly-w-3 mly-shrink-0 mly-stroke-[2.5] mly-text-midnight-gray" })
2087
2785
  }
2088
2786
  ) });
2089
2787
  const normalizeProtocol = (value, p = protocol) => {
2090
2788
  value = value == null ? void 0 : value.replace(LINK_PROTOCOL_REGEX, "");
2091
2789
  return p + value;
2092
2790
  };
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 })
2791
+ return /* @__PURE__ */ jsxs11(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [
2792
+ tooltip ? /* @__PURE__ */ jsxs11(Tooltip, { children: [
2793
+ /* @__PURE__ */ jsx27(TooltipTrigger, { asChild: true, children: popoverButton }),
2794
+ /* @__PURE__ */ jsx27(TooltipContent, { sideOffset: 8, children: tooltip })
2097
2795
  ] }) : popoverButton,
2098
- /* @__PURE__ */ jsx20(
2796
+ /* @__PURE__ */ jsx27(
2099
2797
  PopoverContent,
2100
2798
  {
2101
2799
  align: "end",
@@ -2103,7 +2801,7 @@ function LinkInputPopover(props) {
2103
2801
  className: "mly-w-max mly-rounded-none mly-border-none mly-bg-transparent !mly-p-0 mly-shadow-none",
2104
2802
  sideOffset: 8,
2105
2803
  onCloseAutoFocus: (e) => e.preventDefault(),
2106
- children: /* @__PURE__ */ jsx20(
2804
+ children: /* @__PURE__ */ jsx27(
2107
2805
  "form",
2108
2806
  {
2109
2807
  onSubmit: (e) => {
@@ -2116,8 +2814,8 @@ function LinkInputPopover(props) {
2116
2814
  onValueChange == null ? void 0 : onValueChange(value);
2117
2815
  setIsOpen(false);
2118
2816
  },
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(
2817
+ children: /* @__PURE__ */ jsxs11("div", { className: "mly-isolate mly-flex mly-rounded-lg", children: [
2818
+ !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
2819
  "button",
2122
2820
  {
2123
2821
  onClick: () => {
@@ -2138,9 +2836,9 @@ function LinkInputPopover(props) {
2138
2836
  })
2139
2837
  }
2140
2838
  ) }),
2141
- isEditing && /* @__PURE__ */ jsxs7(Fragment2, { children: [
2142
- /* @__PURE__ */ jsxs7("div", { className: "mly-relative", children: [
2143
- /* @__PURE__ */ jsxs7(
2839
+ isEditing && /* @__PURE__ */ jsxs11(Fragment2, { children: [
2840
+ /* @__PURE__ */ jsxs11("div", { className: "mly-relative", children: [
2841
+ /* @__PURE__ */ jsxs11(
2144
2842
  "select",
2145
2843
  {
2146
2844
  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 +2855,12 @@ function LinkInputPopover(props) {
2157
2855
  onValueChange == null ? void 0 : onValueChange(newValue);
2158
2856
  },
2159
2857
  children: [
2160
- /* @__PURE__ */ jsx20("option", { value: "https://", children: "https://" }),
2161
- /* @__PURE__ */ jsx20("option", { value: "http://", children: "http://" })
2858
+ /* @__PURE__ */ jsx27("option", { value: "https://", children: "https://" }),
2859
+ /* @__PURE__ */ jsx27("option", { value: "http://", children: "http://" })
2162
2860
  ]
2163
2861
  }
2164
2862
  ),
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(
2863
+ /* @__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
2864
  ChevronDownIcon,
2167
2865
  {
2168
2866
  size: 16,
@@ -2172,7 +2870,7 @@ function LinkInputPopover(props) {
2172
2870
  }
2173
2871
  ) })
2174
2872
  ] }),
2175
- /* @__PURE__ */ jsx20(
2873
+ /* @__PURE__ */ jsx27(
2176
2874
  InputAutocomplete,
2177
2875
  {
2178
2876
  value: defaultUrlWithoutProtocol,
@@ -2210,7 +2908,7 @@ function LinkInputPopover(props) {
2210
2908
  // src/editor/components/ui/select.tsx
2211
2909
  import { useId } from "react";
2212
2910
  import { ChevronDownIcon as ChevronDownIcon2 } from "lucide-react";
2213
- import { jsx as jsx21, jsxs as jsxs8 } from "react/jsx-runtime";
2911
+ import { jsx as jsx28, jsxs as jsxs12 } from "react/jsx-runtime";
2214
2912
  function Select(props) {
2215
2913
  const {
2216
2914
  label,
@@ -2223,10 +2921,10 @@ function Select(props) {
2223
2921
  iconClassName
2224
2922
  } = props;
2225
2923
  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(
2924
+ const content = /* @__PURE__ */ jsxs12("div", { className: "relative", children: [
2925
+ /* @__PURE__ */ jsx28("label", { htmlFor: selectId, className: "sr-only", children: label }),
2926
+ 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) }) }),
2927
+ /* @__PURE__ */ jsx28(
2230
2928
  "select",
2231
2929
  {
2232
2930
  id: selectId,
@@ -2237,10 +2935,10 @@ function Select(props) {
2237
2935
  ),
2238
2936
  value,
2239
2937
  onChange: (event) => onValueChange(event.target.value),
2240
- children: options.map((option) => /* @__PURE__ */ jsx21("option", { value: option.value, children: option.label }, option.value))
2938
+ children: options.map((option) => /* @__PURE__ */ jsx28("option", { value: option.value, children: option.label }, option.value))
2241
2939
  }
2242
2940
  ),
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(
2941
+ /* @__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
2942
  ChevronDownIcon2,
2245
2943
  {
2246
2944
  size: 16,
@@ -2253,9 +2951,9 @@ function Select(props) {
2253
2951
  if (!tooltip) {
2254
2952
  return content;
2255
2953
  }
2256
- return /* @__PURE__ */ jsxs8(Tooltip, { children: [
2257
- /* @__PURE__ */ jsx21(TooltipTrigger, { asChild: true, children: content }),
2258
- /* @__PURE__ */ jsx21(TooltipContent, { sideOffset: 8, children: tooltip })
2954
+ return /* @__PURE__ */ jsxs12(Tooltip, { children: [
2955
+ /* @__PURE__ */ jsx28(TooltipTrigger, { asChild: true, children: content }),
2956
+ /* @__PURE__ */ jsx28(TooltipContent, { sideOffset: 8, children: tooltip })
2259
2957
  ] });
2260
2958
  }
2261
2959
 
@@ -2263,11 +2961,9 @@ function Select(props) {
2263
2961
  import { NodeViewWrapper as NodeViewWrapper3 } from "@tiptap/react";
2264
2962
 
2265
2963
  // 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";
2964
+ import { Eye, InfoIcon } from "lucide-react";
2965
+ import { memo, useMemo as useMemo3, useRef as useRef4, useState as useState4 } from "react";
2966
+ import { jsx as jsx29, jsxs as jsxs13 } from "react/jsx-runtime";
2271
2967
  function _ShowPopover(props) {
2272
2968
  const { showIfKey = "", onShowIfKeyValueChange, editor } = props;
2273
2969
  const { variables = [], renderVariable = DEFAULT_RENDER_VARIABLE_FUNCTION } = useMailyContext();
@@ -2281,7 +2977,7 @@ function _ShowPopover(props) {
2281
2977
  }).map((variable) => variable.name);
2282
2978
  }, [variables, showIfKey, editor]);
2283
2979
  const isValidWhenKey = showIfKey || autoCompleteOptions.includes(showIfKey);
2284
- return /* @__PURE__ */ jsxs9(
2980
+ return /* @__PURE__ */ jsxs13(
2285
2981
  Popover,
2286
2982
  {
2287
2983
  onOpenChange: (open) => {
@@ -2291,20 +2987,20 @@ function _ShowPopover(props) {
2291
2987
  setIsUpdatingKey(false);
2292
2988
  },
2293
2989
  children: [
2294
- /* @__PURE__ */ jsxs9(Tooltip, { children: [
2295
- /* @__PURE__ */ jsx22(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx22(
2990
+ /* @__PURE__ */ jsxs13(Tooltip, { children: [
2991
+ /* @__PURE__ */ jsx29(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx29(
2296
2992
  PopoverTrigger,
2297
2993
  {
2298
2994
  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",
2995
+ "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
2996
  showIfKey && "mly-bg-rose-100 mly-text-rose-800 data-[state=open]:mly-bg-rose-100 hover:mly-bg-rose-100"
2301
2997
  ),
2302
- children: /* @__PURE__ */ jsx22(Eye, { className: "mly-h-4 mly-w-4 mly-stroke-[2.5]" })
2998
+ children: /* @__PURE__ */ jsx29(Eye, { className: "mly-h-3 mly-w-3 mly-stroke-[2.5]" })
2303
2999
  }
2304
3000
  ) }),
2305
- /* @__PURE__ */ jsx22(TooltipContent, { sideOffset: 8, children: "Show block conditionally" })
3001
+ /* @__PURE__ */ jsx29(TooltipContent, { sideOffset: 8, children: "Show block conditionally" })
2306
3002
  ] }),
2307
- /* @__PURE__ */ jsxs9(
3003
+ /* @__PURE__ */ jsxs13(
2308
3004
  PopoverContent,
2309
3005
  {
2310
3006
  className: "mly-flex mly-w-max mly-rounded-lg !mly-p-0.5",
@@ -2318,8 +3014,27 @@ function _ShowPopover(props) {
2318
3014
  e.preventDefault();
2319
3015
  },
2320
3016
  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(
3017
+ /* @__PURE__ */ jsxs13("div", { className: "mly-flex mly-items-center mly-gap-1.5 mly-px-1.5 mly-text-sm mly-leading-none", children: [
3018
+ "Show if",
3019
+ /* @__PURE__ */ jsxs13(Tooltip, { children: [
3020
+ /* @__PURE__ */ jsx29(TooltipTrigger, { children: /* @__PURE__ */ jsx29(
3021
+ InfoIcon,
3022
+ {
3023
+ className: cn("mly-size-3 mly-stroke-[2.5] mly-text-gray-500")
3024
+ }
3025
+ ) }),
3026
+ /* @__PURE__ */ jsx29(
3027
+ TooltipContent,
3028
+ {
3029
+ sideOffset: 14,
3030
+ className: "mly-max-w-[285px]",
3031
+ align: "start",
3032
+ children: "Show the block if the selected variable is true."
3033
+ }
3034
+ )
3035
+ ] })
3036
+ ] }),
3037
+ !isUpdatingKey && /* @__PURE__ */ jsx29(
2323
3038
  "button",
2324
3039
  {
2325
3040
  onClick: () => {
@@ -2340,7 +3055,7 @@ function _ShowPopover(props) {
2340
3055
  })
2341
3056
  }
2342
3057
  ),
2343
- isUpdatingKey && /* @__PURE__ */ jsx22(
3058
+ isUpdatingKey && /* @__PURE__ */ jsx29(
2344
3059
  "form",
2345
3060
  {
2346
3061
  onSubmit: (e) => {
@@ -2352,7 +3067,7 @@ function _ShowPopover(props) {
2352
3067
  setIsUpdatingKey(false);
2353
3068
  }
2354
3069
  },
2355
- children: /* @__PURE__ */ jsx22(
3070
+ children: /* @__PURE__ */ jsx29(
2356
3071
  InputAutocomplete,
2357
3072
  {
2358
3073
  value: showIfKey || "",
@@ -2385,7 +3100,7 @@ var ShowPopover = memo(_ShowPopover);
2385
3100
  import { useMemo as useMemo4 } from "react";
2386
3101
  import { useState as useState5 } from "react";
2387
3102
  import { useRef as useRef5 } from "react";
2388
- import { jsx as jsx23, jsxs as jsxs10 } from "react/jsx-runtime";
3103
+ import { jsx as jsx30, jsxs as jsxs14 } from "react/jsx-runtime";
2389
3104
  function ButtonLabelInput(props) {
2390
3105
  const { value, onValueChange, isVariable, editor } = props;
2391
3106
  const linkInputRef = useRef5(null);
@@ -2407,8 +3122,8 @@ function ButtonLabelInput(props) {
2407
3122
  editor
2408
3123
  }).map((variable) => variable.name);
2409
3124
  }, [variables, value, editor]);
2410
- return /* @__PURE__ */ jsxs10("div", { className: "mly-isolate mly-flex mly-rounded-lg", children: [
2411
- !isEditing && /* @__PURE__ */ jsx23(
3125
+ return /* @__PURE__ */ jsxs14("div", { className: "mly-isolate mly-flex mly-rounded-lg", children: [
3126
+ !isEditing && /* @__PURE__ */ jsx30(
2412
3127
  "button",
2413
3128
  {
2414
3129
  onClick: () => {
@@ -2429,7 +3144,7 @@ function ButtonLabelInput(props) {
2429
3144
  })
2430
3145
  }
2431
3146
  ),
2432
- isEditing && /* @__PURE__ */ jsx23(
3147
+ isEditing && /* @__PURE__ */ jsx30(
2433
3148
  InputAutocomplete,
2434
3149
  {
2435
3150
  value,
@@ -2456,7 +3171,7 @@ function ButtonLabelInput(props) {
2456
3171
 
2457
3172
  // src/editor/nodes/button/button-view.tsx
2458
3173
  import { useMemo as useMemo5 } from "react";
2459
- import { jsx as jsx24, jsxs as jsxs11 } from "react/jsx-runtime";
3174
+ import { jsx as jsx31, jsxs as jsxs15 } from "react/jsx-runtime";
2460
3175
  function ButtonView(props) {
2461
3176
  const { node, editor, getPos, updateAttributes: updateAttributes2 } = props;
2462
3177
  const {
@@ -2499,7 +3214,7 @@ function ButtonView(props) {
2499
3214
  ([, { paddingX, paddingY }]) => paddingRight === paddingX && paddingTop === paddingY
2500
3215
  )) == null ? void 0 : _a[0];
2501
3216
  }, [paddingRight, paddingTop, sizes]);
2502
- return /* @__PURE__ */ jsx24(
3217
+ return /* @__PURE__ */ jsx31(
2503
3218
  NodeViewWrapper3,
2504
3219
  {
2505
3220
  draggable: editor.isEditable,
@@ -2508,8 +3223,8 @@ function ButtonView(props) {
2508
3223
  style: {
2509
3224
  textAlign: alignment
2510
3225
  },
2511
- children: /* @__PURE__ */ jsxs11(Popover, { open: props.selected && editor.isEditable, children: [
2512
- /* @__PURE__ */ jsx24(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx24("div", { children: /* @__PURE__ */ jsx24(
3226
+ children: /* @__PURE__ */ jsxs15(Popover, { open: props.selected && editor.isEditable, children: [
3227
+ /* @__PURE__ */ jsx31(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx31("div", { children: /* @__PURE__ */ jsx31(
2513
3228
  "button",
2514
3229
  {
2515
3230
  className: cn(
@@ -2552,7 +3267,7 @@ function ButtonView(props) {
2552
3267
  }) : text2
2553
3268
  }
2554
3269
  ) }) }),
2555
- /* @__PURE__ */ jsx24(
3270
+ /* @__PURE__ */ jsx31(
2556
3271
  PopoverContent,
2557
3272
  {
2558
3273
  align: "end",
@@ -2561,8 +3276,8 @@ function ButtonView(props) {
2561
3276
  sideOffset: 8,
2562
3277
  onOpenAutoFocus: (e) => e.preventDefault(),
2563
3278
  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(
3279
+ children: /* @__PURE__ */ jsx31(TooltipProvider, { children: /* @__PURE__ */ jsxs15("div", { className: "mly-flex mly-items-stretch mly-text-midnight-gray", children: [
3280
+ /* @__PURE__ */ jsx31(
2566
3281
  ButtonLabelInput,
2567
3282
  {
2568
3283
  value: text2,
@@ -2576,9 +3291,9 @@ function ButtonView(props) {
2576
3291
  editor
2577
3292
  }
2578
3293
  ),
2579
- /* @__PURE__ */ jsx24(Divider, {}),
2580
- /* @__PURE__ */ jsxs11("div", { className: "mly-flex mly-space-x-0.5", children: [
2581
- /* @__PURE__ */ jsx24(
3294
+ /* @__PURE__ */ jsx31(Divider, {}),
3295
+ /* @__PURE__ */ jsxs15("div", { className: "mly-flex mly-space-x-0.5", children: [
3296
+ /* @__PURE__ */ jsx31(
2582
3297
  Select,
2583
3298
  {
2584
3299
  label: "Border Radius",
@@ -2596,7 +3311,7 @@ function ButtonView(props) {
2596
3311
  className: "mly-capitalize"
2597
3312
  }
2598
3313
  ),
2599
- /* @__PURE__ */ jsx24(
3314
+ /* @__PURE__ */ jsx31(
2600
3315
  Select,
2601
3316
  {
2602
3317
  label: "Style",
@@ -2614,7 +3329,7 @@ function ButtonView(props) {
2614
3329
  className: "mly-capitalize"
2615
3330
  }
2616
3331
  ),
2617
- /* @__PURE__ */ jsx24(
3332
+ /* @__PURE__ */ jsx31(
2618
3333
  Select,
2619
3334
  {
2620
3335
  label: "Size",
@@ -2637,9 +3352,9 @@ function ButtonView(props) {
2637
3352
  }
2638
3353
  )
2639
3354
  ] }),
2640
- /* @__PURE__ */ jsx24(Divider, {}),
2641
- /* @__PURE__ */ jsxs11("div", { className: "mly-flex mly-space-x-0.5", children: [
2642
- /* @__PURE__ */ jsx24(
3355
+ /* @__PURE__ */ jsx31(Divider, {}),
3356
+ /* @__PURE__ */ jsxs15("div", { className: "mly-flex mly-space-x-0.5", children: [
3357
+ /* @__PURE__ */ jsx31(
2643
3358
  AlignmentSwitch,
2644
3359
  {
2645
3360
  alignment,
@@ -2650,7 +3365,7 @@ function ButtonView(props) {
2650
3365
  }
2651
3366
  }
2652
3367
  ),
2653
- /* @__PURE__ */ jsx24(
3368
+ /* @__PURE__ */ jsx31(
2654
3369
  LinkInputPopover,
2655
3370
  {
2656
3371
  defaultValue: externalLink || "",
@@ -2666,9 +3381,9 @@ function ButtonView(props) {
2666
3381
  }
2667
3382
  )
2668
3383
  ] }),
2669
- /* @__PURE__ */ jsx24(Divider, {}),
2670
- /* @__PURE__ */ jsxs11("div", { className: "mly-flex mly-space-x-0.5", children: [
2671
- /* @__PURE__ */ jsx24(
3384
+ /* @__PURE__ */ jsx31(Divider, {}),
3385
+ /* @__PURE__ */ jsxs15("div", { className: "mly-flex mly-space-x-0.5", children: [
3386
+ /* @__PURE__ */ jsx31(
2672
3387
  BackgroundColorPickerPopup,
2673
3388
  {
2674
3389
  variant,
@@ -2680,7 +3395,7 @@ function ButtonView(props) {
2680
3395
  }
2681
3396
  }
2682
3397
  ),
2683
- /* @__PURE__ */ jsx24(
3398
+ /* @__PURE__ */ jsx31(
2684
3399
  TextColorPickerPopup,
2685
3400
  {
2686
3401
  color: textColor,
@@ -2692,8 +3407,8 @@ function ButtonView(props) {
2692
3407
  }
2693
3408
  )
2694
3409
  ] }),
2695
- /* @__PURE__ */ jsx24(Divider, {}),
2696
- /* @__PURE__ */ jsx24(
3410
+ /* @__PURE__ */ jsx31(Divider, {}),
3411
+ /* @__PURE__ */ jsx31(
2697
3412
  ShowPopover,
2698
3413
  {
2699
3414
  showIfKey,
@@ -2714,20 +3429,20 @@ function ButtonView(props) {
2714
3429
  }
2715
3430
  function BackgroundColorPickerPopup(props) {
2716
3431
  const { color, onChange, variant } = props;
2717
- return /* @__PURE__ */ jsx24(
3432
+ return /* @__PURE__ */ jsx31(
2718
3433
  ColorPicker,
2719
3434
  {
2720
3435
  color,
2721
3436
  onColorChange: onChange,
2722
3437
  tooltip: "Background Color",
2723
- children: /* @__PURE__ */ jsx24(
3438
+ children: /* @__PURE__ */ jsx31(
2724
3439
  BaseButton,
2725
3440
  {
2726
3441
  variant: "ghost",
2727
3442
  size: "sm",
2728
3443
  type: "button",
2729
3444
  className: "mly-size-7",
2730
- children: /* @__PURE__ */ jsx24(
3445
+ children: /* @__PURE__ */ jsx31(
2731
3446
  "div",
2732
3447
  {
2733
3448
  className: "mly-h-4 mly-w-4 mly-shrink-0 mly-rounded-full mly-shadow",
@@ -2746,16 +3461,16 @@ function BackgroundColorPickerPopup(props) {
2746
3461
  }
2747
3462
  function TextColorPickerPopup(props) {
2748
3463
  const { color, onChange } = props;
2749
- return /* @__PURE__ */ jsx24(ColorPicker, { color, onColorChange: onChange, tooltip: "Text Color", children: /* @__PURE__ */ jsx24(
3464
+ return /* @__PURE__ */ jsx31(ColorPicker, { color, onColorChange: onChange, tooltip: "Text Color", children: /* @__PURE__ */ jsx31(
2750
3465
  BaseButton,
2751
3466
  {
2752
3467
  variant: "ghost",
2753
3468
  size: "sm",
2754
3469
  type: "button",
2755
3470
  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(
3471
+ children: /* @__PURE__ */ jsxs15("div", { className: "mly-flex mly-flex-col mly-items-center mly-justify-center mly-gap-[1px]", children: [
3472
+ /* @__PURE__ */ jsx31("span", { className: "mly-font-bolder mly-font-mono mly-text-xs mly-text-midnight-gray", children: "A" }),
3473
+ /* @__PURE__ */ jsx31(
2759
3474
  "div",
2760
3475
  {
2761
3476
  className: "mly-h-[2px] mly-w-3 mly-shrink-0 mly-rounded-md mly-shadow",
@@ -3029,7 +3744,7 @@ var useEvent = (handler) => {
3029
3744
  import { NodeViewWrapper as NodeViewWrapper4 } from "@tiptap/react";
3030
3745
  import { Ban, BracesIcon as BracesIcon2, ImageOffIcon, Loader2 } from "lucide-react";
3031
3746
  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";
3747
+ import { Fragment as Fragment3, jsx as jsx32, jsxs as jsxs16 } from "react/jsx-runtime";
3033
3748
  var MIN_WIDTH = 20;
3034
3749
  var MAX_WIDTH = 600;
3035
3750
  function ImageView(props) {
@@ -3080,7 +3795,7 @@ function ImageView(props) {
3080
3795
  }
3081
3796
  );
3082
3797
  function dragCornerButton(direction) {
3083
- return /* @__PURE__ */ jsx25(
3798
+ return /* @__PURE__ */ jsx32(
3084
3799
  "div",
3085
3800
  {
3086
3801
  role: "button",
@@ -3145,7 +3860,7 @@ function ImageView(props) {
3145
3860
  img.onerror = null;
3146
3861
  };
3147
3862
  }, [src]);
3148
- return /* @__PURE__ */ jsxs12(
3863
+ return /* @__PURE__ */ jsxs16(
3149
3864
  NodeViewWrapper4,
3150
3865
  {
3151
3866
  as: "div",
@@ -3167,12 +3882,12 @@ function ImageView(props) {
3167
3882
  }[alignment] || {}),
3168
3883
  ref: wrapperRef,
3169
3884
  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(
3885
+ !hasImageSrc && /* @__PURE__ */ jsx32(ImageStatusLabel, { status: "idle", minHeight: height }),
3886
+ hasImageSrc && isSrcVariable && /* @__PURE__ */ jsx32(ImageStatusLabel, { status: "variable", minHeight: height }),
3887
+ hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */ jsx32(ImageStatusLabel, { status: "loading", minHeight: height }),
3888
+ hasImageSrc && status === "error" && !isSrcVariable && /* @__PURE__ */ jsx32(ImageStatusLabel, { status: "error", minHeight: height }),
3889
+ hasImageSrc && status === "loaded" && !isSrcVariable && /* @__PURE__ */ jsxs16(Fragment3, { children: [
3890
+ /* @__PURE__ */ jsx32(
3176
3891
  "img",
3177
3892
  __spreadProps(__spreadValues({}, attrs), {
3178
3893
  ref: imgRef,
@@ -3183,13 +3898,13 @@ function ImageView(props) {
3183
3898
  draggable: editor.isEditable
3184
3899
  })
3185
3900
  ),
3186
- selected && editor.isEditable && /* @__PURE__ */ jsxs12(Fragment3, { children: [
3901
+ selected && editor.isEditable && /* @__PURE__ */ jsxs16(Fragment3, { children: [
3187
3902
  [
3188
3903
  { left: 0, top: 0, height: "100%", width: "1px" },
3189
3904
  { right: 0, top: 0, height: "100%", width: "1px" },
3190
3905
  { top: 0, left: 0, width: "100%", height: "1px" },
3191
3906
  { bottom: 0, left: 0, width: "100%", height: "1px" }
3192
- ].map((style, i) => /* @__PURE__ */ jsx25(
3907
+ ].map((style, i) => /* @__PURE__ */ jsx32(
3193
3908
  "div",
3194
3909
  {
3195
3910
  className: "mly-bg-rose-500",
@@ -3210,33 +3925,36 @@ function ImageView(props) {
3210
3925
  );
3211
3926
  }
3212
3927
  function ImageStatusLabel(props) {
3213
- const { status } = props;
3214
- return /* @__PURE__ */ jsxs12(
3928
+ const { status, minHeight } = props;
3929
+ return /* @__PURE__ */ jsxs16(
3215
3930
  "div",
3216
3931
  {
3217
3932
  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",
3933
+ "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
3934
  {
3220
3935
  "mly-text-gray-500 hover:mly-bg-soft-gray/60": status === "loading",
3221
3936
  "mly-text-red-500 hover:mly-bg-soft-gray/60": status === "error"
3222
3937
  }
3223
3938
  ),
3939
+ style: __spreadValues({}, minHeight ? {
3940
+ minHeight
3941
+ } : {}),
3224
3942
  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" })
3943
+ status === "idle" && /* @__PURE__ */ jsxs16(Fragment3, { children: [
3944
+ /* @__PURE__ */ jsx32(ImageOffIcon, { className: "mly-size-4 mly-stroke-[2.5]" }),
3945
+ /* @__PURE__ */ jsx32("span", { children: "No image selected" })
3228
3946
  ] }),
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..." })
3947
+ status === "loading" && /* @__PURE__ */ jsxs16(Fragment3, { children: [
3948
+ /* @__PURE__ */ jsx32(Loader2, { className: "mly-size-4 mly-animate-spin mly-stroke-[2.5]" }),
3949
+ /* @__PURE__ */ jsx32("span", { children: "Loading image..." })
3232
3950
  ] }),
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" })
3951
+ status === "error" && /* @__PURE__ */ jsxs16(Fragment3, { children: [
3952
+ /* @__PURE__ */ jsx32(Ban, { className: "mly-size-4 mly-stroke-[2.5]" }),
3953
+ /* @__PURE__ */ jsx32("span", { children: "Error loading image" })
3236
3954
  ] }),
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" })
3955
+ status === "variable" && /* @__PURE__ */ jsxs16(Fragment3, { children: [
3956
+ /* @__PURE__ */ jsx32(BracesIcon2, { className: "mly-size-4 mly-stroke-[2.5]" }),
3957
+ /* @__PURE__ */ jsx32("span", { children: "Variable Image URL" })
3240
3958
  ] })
3241
3959
  ]
3242
3960
  }
@@ -3244,7 +3962,7 @@ function ImageStatusLabel(props) {
3244
3962
  }
3245
3963
 
3246
3964
  // src/editor/nodes/logo/logo-view.tsx
3247
- import { jsx as jsx26, jsxs as jsxs13 } from "react/jsx-runtime";
3965
+ import { jsx as jsx33, jsxs as jsxs17 } from "react/jsx-runtime";
3248
3966
  function LogoView(props) {
3249
3967
  const { node, editor } = props;
3250
3968
  const [status, setStatus] = useState7("idle");
@@ -3275,7 +3993,7 @@ function LogoView(props) {
3275
3993
  };
3276
3994
  }, [logoSrc]);
3277
3995
  const logoSize = logoSizes[size];
3278
- return /* @__PURE__ */ jsxs13(
3996
+ return /* @__PURE__ */ jsxs17(
3279
3997
  NodeViewWrapper5,
3280
3998
  {
3281
3999
  as: "div",
@@ -3289,11 +4007,11 @@ function LogoView(props) {
3289
4007
  display: "block"
3290
4008
  },
3291
4009
  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(
4010
+ !hasImageSrc && /* @__PURE__ */ jsx33(ImageStatusLabel, { status: "idle", minHeight: logoSize }),
4011
+ hasImageSrc && isSrcVariable && /* @__PURE__ */ jsx33(ImageStatusLabel, { status: "variable", minHeight: logoSize }),
4012
+ hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */ jsx33(ImageStatusLabel, { status: "loading", minHeight: logoSize }),
4013
+ hasImageSrc && status === "error" && !isSrcVariable && /* @__PURE__ */ jsx33(ImageStatusLabel, { status: "error", minHeight: logoSize }),
4014
+ hasImageSrc && status === "loaded" && !isSrcVariable && /* @__PURE__ */ jsx33(
3297
4015
  "img",
3298
4016
  {
3299
4017
  src: logoSrc,
@@ -3595,10 +4313,10 @@ import { ReactNodeViewRenderer as ReactNodeViewRenderer5 } from "@tiptap/react";
3595
4313
  // src/editor/nodes/repeat/repeat-view.tsx
3596
4314
  import { NodeViewWrapper as NodeViewWrapper6, NodeViewContent } from "@tiptap/react";
3597
4315
  import { Repeat2 as Repeat22 } from "lucide-react";
3598
- import { jsx as jsx27, jsxs as jsxs14 } from "react/jsx-runtime";
4316
+ import { jsx as jsx34, jsxs as jsxs18 } from "react/jsx-runtime";
3599
4317
  function RepeatView(props) {
3600
4318
  const { editor, getPos } = props;
3601
- return /* @__PURE__ */ jsxs14(
4319
+ return /* @__PURE__ */ jsxs18(
3602
4320
  NodeViewWrapper6,
3603
4321
  {
3604
4322
  "data-type": "repeat",
@@ -3606,8 +4324,8 @@ function RepeatView(props) {
3606
4324
  "data-drag-handle": editor.isEditable,
3607
4325
  className: "mly-relative",
3608
4326
  children: [
3609
- /* @__PURE__ */ jsx27(NodeViewContent, { className: "is-editable" }),
3610
- /* @__PURE__ */ jsxs14(
4327
+ /* @__PURE__ */ jsx34(NodeViewContent, { className: "is-editable" }),
4328
+ /* @__PURE__ */ jsxs18(
3611
4329
  "div",
3612
4330
  {
3613
4331
  role: "button",
@@ -3618,8 +4336,8 @@ function RepeatView(props) {
3618
4336
  editor.commands.setNodeSelection(getPos());
3619
4337
  },
3620
4338
  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" })
4339
+ /* @__PURE__ */ jsx34(Repeat22, { className: "mly-size-3 mly-stroke-[2.5] mly-text-midnight-gray" }),
4340
+ /* @__PURE__ */ jsx34("div", { className: "mly-w-[1.5px] mly-grow mly-rounded-full mly-bg-rose-300" })
3623
4341
  ]
3624
4342
  }
3625
4343
  )
@@ -3764,24 +4482,6 @@ var MailyKit = Extension.create({
3764
4482
  types: [Paragraph.name, Heading.name, Footer.name]
3765
4483
  }),
3766
4484
  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
4485
  Footer,
3786
4486
  Focus,
3787
4487
  Dropcursor.configure({
@@ -3859,139 +4559,252 @@ var SlashCommandExtension = Extension2.create({
3859
4559
  }
3860
4560
  });
3861
4561
 
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
4562
  // src/editor/extensions/slash-command/slash-command-view.tsx
3876
4563
  import { ReactRenderer } from "@tiptap/react";
3877
4564
  import {
4565
+ forwardRef as forwardRef8,
4566
+ Fragment as Fragment4,
3878
4567
  useCallback as useCallback3,
3879
4568
  useEffect as useEffect5,
4569
+ useImperativeHandle as useImperativeHandle2,
3880
4570
  useLayoutEffect as useLayoutEffect2,
3881
4571
  useRef as useRef8,
3882
4572
  useState as useState8
3883
4573
  } from "react";
3884
4574
  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);
4575
+ import { ChevronRightIcon } from "lucide-react";
4576
+ import { Fragment as Fragment5, jsx as jsx35, jsxs as jsxs19 } from "react/jsx-runtime";
4577
+ var CommandList = forwardRef8(function CommandList2(props, ref) {
4578
+ const { items: groups, command, editor } = props;
4579
+ const [selectedGroupIndex, setSelectedGroupIndex] = useState8(0);
4580
+ const [selectedCommandIndex, setSelectedCommandIndex] = useState8(0);
3889
4581
  const selectItem = useCallback3(
3890
- (index) => {
3891
- const item = items[index];
3892
- if (item) {
3893
- command(item);
4582
+ (groupIndex, commandIndex) => {
4583
+ const item = groups[groupIndex].commands[commandIndex];
4584
+ if (!item) {
4585
+ return;
3894
4586
  }
4587
+ command(item);
3895
4588
  },
3896
- // eslint-disable-next-line react-hooks/exhaustive-deps
3897
- [command, editor, items]
4589
+ [command]
3898
4590
  );
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);
4591
+ useImperativeHandle2(ref, () => ({
4592
+ onKeyDown: ({ event }) => {
4593
+ var _a, _b;
4594
+ const navigationKeys = ["ArrowUp", "ArrowDown", "Enter"];
4595
+ if (navigationKeys.includes(event.key)) {
4596
+ if (event.key === "ArrowUp") {
4597
+ if (!groups.length) {
4598
+ return false;
4599
+ }
4600
+ let newCommandIndex = selectedCommandIndex - 1;
4601
+ let newGroupIndex = selectedGroupIndex;
4602
+ if (newCommandIndex < 0) {
4603
+ newGroupIndex = selectedGroupIndex - 1;
4604
+ newCommandIndex = ((_a = groups[newGroupIndex]) == null ? void 0 : _a.commands.length) - 1 || 0;
4605
+ }
4606
+ if (newGroupIndex < 0) {
4607
+ newGroupIndex = groups.length - 1;
4608
+ newCommandIndex = ((_b = groups[newGroupIndex]) == null ? void 0 : _b.commands.length) - 1 || 0;
4609
+ }
4610
+ setSelectedGroupIndex(newGroupIndex);
4611
+ setSelectedCommandIndex(newCommandIndex);
3906
4612
  return true;
3907
4613
  }
3908
- if (e.key === "ArrowDown") {
3909
- setSelectedIndex((selectedIndex + 1) % items.length);
4614
+ if (event.key === "ArrowDown") {
4615
+ if (!groups.length) {
4616
+ return false;
4617
+ }
4618
+ const commands = groups[selectedGroupIndex].commands;
4619
+ let newCommandIndex = selectedCommandIndex + 1;
4620
+ let newGroupIndex = selectedGroupIndex;
4621
+ if (commands.length - 1 < newCommandIndex) {
4622
+ newCommandIndex = 0;
4623
+ newGroupIndex = selectedGroupIndex + 1;
4624
+ }
4625
+ if (groups.length - 1 < newGroupIndex) {
4626
+ newGroupIndex = 0;
4627
+ }
4628
+ setSelectedGroupIndex(newGroupIndex);
4629
+ setSelectedCommandIndex(newCommandIndex);
3910
4630
  return true;
3911
4631
  }
3912
- if (e.key === "Enter") {
3913
- selectItem(selectedIndex);
4632
+ if (event.key === "Enter") {
4633
+ if (!groups.length) {
4634
+ return false;
4635
+ }
4636
+ selectItem(selectedGroupIndex, selectedCommandIndex);
3914
4637
  return true;
3915
4638
  }
3916
4639
  return false;
3917
4640
  }
3918
- };
3919
- document.addEventListener("keydown", onKeyDown);
3920
- return () => {
3921
- document.removeEventListener("keydown", onKeyDown);
3922
- };
3923
- }, [items, selectedIndex, setSelectedIndex, selectItem]);
4641
+ }
4642
+ }));
3924
4643
  useEffect5(() => {
3925
- setSelectedIndex(0);
3926
- }, [items]);
4644
+ setSelectedGroupIndex(0);
4645
+ setSelectedCommandIndex(0);
4646
+ }, [groups]);
3927
4647
  const commandListContainer = useRef8(null);
4648
+ const activeCommandRef = useRef8(null);
3928
4649
  useLayoutEffect2(() => {
3929
4650
  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);
4651
+ const activeCommandContainer = activeCommandRef == null ? void 0 : activeCommandRef.current;
4652
+ if (!container || !activeCommandContainer) {
4653
+ return;
3933
4654
  }
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(
4655
+ const { offsetTop, offsetHeight } = activeCommandContainer;
4656
+ container.scrollTop = offsetTop - offsetHeight;
4657
+ }, [
4658
+ selectedGroupIndex,
4659
+ selectedCommandIndex,
4660
+ commandListContainer,
4661
+ activeCommandRef
4662
+ ]);
4663
+ return groups.length > 0 ? /* @__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: [
4664
+ /* @__PURE__ */ jsx35(
3937
4665
  "div",
3938
4666
  {
3939
4667
  id: "slash-command",
3940
4668
  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",
4669
+ className: "mly-no-scrollbar mly-h-auto mly-max-h-[330px] mly-overflow-y-auto mly-scroll-smooth",
4670
+ children: groups.map((group, groupIndex) => /* @__PURE__ */ jsxs19(Fragment4, { children: [
4671
+ /* @__PURE__ */ jsx35(
4672
+ "span",
3945
4673
  {
3946
4674
  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"
4675
+ "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",
4676
+ groupIndex > 0 ? "mly-border-t" : ""
3949
4677
  ),
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
- })
4678
+ children: group.title
4679
+ }
4680
+ ),
4681
+ /* @__PURE__ */ jsx35("div", { className: "mly-p-1", children: group.commands.map((item, commandIndex) => {
4682
+ var _a;
4683
+ const isActive = groupIndex === selectedGroupIndex && commandIndex === selectedCommandIndex;
4684
+ const isSubCommand = "commands" in item;
4685
+ const hasRenderFunction = typeof item.render === "function";
4686
+ const renderFunctionValue = hasRenderFunction ? (_a = item.render) == null ? void 0 : _a.call(item, editor) : null;
4687
+ let value = /* @__PURE__ */ jsxs19(Fragment5, { children: [
4688
+ /* @__PURE__ */ jsx35("div", { className: "mly-flex mly-h-6 mly-w-6 mly-shrink-0 mly-items-center mly-justify-center", children: item.icon }),
4689
+ /* @__PURE__ */ jsxs19("div", { className: "mly-grow", children: [
4690
+ /* @__PURE__ */ jsx35("p", { className: "mly-font-medium", children: item.title }),
4691
+ /* @__PURE__ */ jsx35("p", { className: "mly-text-xs mly-text-gray-400", children: item.description })
4692
+ ] }),
4693
+ 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]" }) })
4694
+ ] });
4695
+ if (renderFunctionValue !== null && renderFunctionValue !== true) {
4696
+ value = renderFunctionValue;
4697
+ }
4698
+ return /* @__PURE__ */ jsx35(
4699
+ "button",
4700
+ {
4701
+ className: cn(
4702
+ "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",
4703
+ isActive ? "mly-bg-gray-100 mly-text-gray-900" : "mly-bg-transparent"
4704
+ ),
4705
+ onClick: () => selectItem(groupIndex, commandIndex),
4706
+ type: "button",
4707
+ ref: isActive ? activeCommandRef : null,
4708
+ children: value
4709
+ },
4710
+ commandIndex
4711
+ );
4712
+ }) })
4713
+ ] }, groupIndex))
3963
4714
  }
3964
4715
  ),
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" }),
4716
+ /* @__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: [
4717
+ /* @__PURE__ */ jsxs19("p", { className: "mly-text-center mly-text-xs mly-text-gray-400", children: [
4718
+ /* @__PURE__ */ jsx35("kbd", { className: "mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium", children: "\u2191" }),
4719
+ /* @__PURE__ */ jsx35("kbd", { className: "mly-ml-1 mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium", children: "\u2193" }),
3969
4720
  " ",
3970
4721
  "to navigate"
3971
4722
  ] }),
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" }),
4723
+ /* @__PURE__ */ jsx35("span", { "aria-hidden": "true", className: "mly-select-none mly-px-1", children: "\xB7" }),
4724
+ /* @__PURE__ */ jsxs19("p", { className: "mly-text-center mly-text-xs mly-text-gray-400", children: [
4725
+ /* @__PURE__ */ jsx35("kbd", { className: "mly-rounded mly-border mly-p-1 mly-px-1.5 mly-font-medium", children: "Enter" }),
3975
4726
  " ",
3976
4727
  "to select"
3977
4728
  ] })
3978
4729
  ] }) })
3979
4730
  ] }) : null;
3980
- }
3981
- function getSlashCommandSuggestions(commands = DEFAULT_SLASH_COMMANDS) {
4731
+ });
4732
+ function getSlashCommandSuggestions(groups = DEFAULT_SLASH_COMMANDS) {
3982
4733
  return {
3983
4734
  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;
4735
+ var _a;
4736
+ let newGroups = groups;
4737
+ let search = query.toLowerCase();
4738
+ const subCommandIds = newGroups.map((group) => {
4739
+ return group.commands.filter((item) => "commands" in item).map((item) => item == null ? void 0 : item.id.toLowerCase());
4740
+ }).flat().map((id) => `${id}.`);
4741
+ const shouldEnterSubCommand = subCommandIds.some(
4742
+ (id) => search.startsWith(id)
4743
+ );
4744
+ if (shouldEnterSubCommand) {
4745
+ const subCommandId = subCommandIds.find((id) => search.startsWith(id));
4746
+ const sanitizedSubCommandId = subCommandId == null ? void 0 : subCommandId.slice(0, -1);
4747
+ const group = (_a = newGroups.find((group2) => {
4748
+ return group2.commands.some(
4749
+ // @ts-ignore
4750
+ (item) => {
4751
+ var _a2;
4752
+ return ((_a2 = item == null ? void 0 : item.id) == null ? void 0 : _a2.toLowerCase()) === sanitizedSubCommandId;
4753
+ }
4754
+ );
4755
+ })) == null ? void 0 : _a.commands.find(
4756
+ // @ts-ignore
4757
+ (item) => {
4758
+ var _a2;
4759
+ return ((_a2 = item == null ? void 0 : item.id) == null ? void 0 : _a2.toLowerCase()) === sanitizedSubCommandId;
3990
4760
  }
3991
- return item.title.toLowerCase().includes(search) || item.description.toLowerCase().includes(search) || item.searchTerms && item.searchTerms.some((term) => term.includes(search));
4761
+ );
4762
+ if (!group) {
4763
+ return groups;
3992
4764
  }
3993
- return true;
3994
- });
4765
+ search = search.replace(subCommandId || "", "");
4766
+ newGroups = [
4767
+ __spreadProps(__spreadValues({}, group), {
4768
+ commands: (group == null ? void 0 : group.commands) || []
4769
+ })
4770
+ ];
4771
+ }
4772
+ const filteredGroups = newGroups.map((group) => {
4773
+ return __spreadProps(__spreadValues({}, group), {
4774
+ commands: group.commands.filter((item) => {
4775
+ var _a2;
4776
+ if (typeof query === "string" && query.length > 0) {
4777
+ const show = (_a2 = item == null ? void 0 : item.render) == null ? void 0 : _a2.call(item, editor);
4778
+ if (show === null) {
4779
+ return false;
4780
+ }
4781
+ 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(
4782
+ (term) => term.includes(search)
4783
+ );
4784
+ }
4785
+ return true;
4786
+ }).map((item) => {
4787
+ const isSubCommandItem = "commands" in item;
4788
+ if (isSubCommandItem) {
4789
+ item = __spreadProps(__spreadValues({}, item), {
4790
+ command: (options) => {
4791
+ const { editor: editor2, range } = options;
4792
+ editor2.chain().focus().insertContentAt(range, `/${item.id}.`).run();
4793
+ }
4794
+ });
4795
+ }
4796
+ return item;
4797
+ })
4798
+ });
4799
+ }).filter((group) => group.commands.length > 0);
4800
+ return filteredGroups;
4801
+ },
4802
+ allow: ({ editor }) => {
4803
+ const isInsideHTMLCodeBlock = editor.isActive("htmlCodeBlock");
4804
+ if (isInsideHTMLCodeBlock) {
4805
+ return false;
4806
+ }
4807
+ return true;
3995
4808
  },
3996
4809
  render: () => {
3997
4810
  let component;
@@ -4049,6 +4862,11 @@ var VariableExtension = Node10.create({
4049
4862
  inline: true,
4050
4863
  selectable: true,
4051
4864
  atom: true,
4865
+ addStorage() {
4866
+ return {
4867
+ popover: false
4868
+ };
4869
+ },
4052
4870
  addOptions() {
4053
4871
  return {
4054
4872
  variables: [],
@@ -4202,14 +5020,13 @@ var VariableExtension = Node10.create({
4202
5020
 
4203
5021
  // src/editor/nodes/variable/variable-suggestions.tsx
4204
5022
  import { ReactRenderer as ReactRenderer2 } from "@tiptap/react";
4205
- import { forwardRef as forwardRef8, useImperativeHandle as useImperativeHandle2 } from "react";
5023
+ import { useRef as useRef9, forwardRef as forwardRef9, useImperativeHandle as useImperativeHandle3 } from "react";
4206
5024
  import tippy2 from "tippy.js";
4207
- import { useRef as useRef9 } from "react";
4208
- import { jsx as jsx29 } from "react/jsx-runtime";
4209
- var VariableList = forwardRef8((props, ref) => {
5025
+ import { jsx as jsx36 } from "react/jsx-runtime";
5026
+ var VariableList = forwardRef9((props, ref) => {
4210
5027
  const { items = [] } = props;
4211
5028
  const popoverRef = useRef9(null);
4212
- useImperativeHandle2(ref, () => ({
5029
+ useImperativeHandle3(ref, () => ({
4213
5030
  onKeyDown: ({ event }) => {
4214
5031
  if (!popoverRef.current) {
4215
5032
  return false;
@@ -4232,7 +5049,7 @@ var VariableList = forwardRef8((props, ref) => {
4232
5049
  return false;
4233
5050
  }
4234
5051
  }));
4235
- return /* @__PURE__ */ jsx29(
5052
+ return /* @__PURE__ */ jsx36(
4236
5053
  VariablePopover,
4237
5054
  {
4238
5055
  items,
@@ -4248,7 +5065,7 @@ var VariableList = forwardRef8((props, ref) => {
4248
5065
  );
4249
5066
  });
4250
5067
  VariableList.displayName = "VariableList";
4251
- function getVariableSuggestions(variables = DEFAULT_VARIABLES, char = DEFAULT_VARIABLE_TRIGGER_CHAR) {
5068
+ function getVariableSuggestions(variables = DEFAULT_VARIABLES, char = DEFAULT_VARIABLE_TRIGGER_CHAR, variableListComponent = VariableList) {
4252
5069
  return {
4253
5070
  char,
4254
5071
  items: ({ query, editor }) => {
@@ -4263,7 +5080,7 @@ function getVariableSuggestions(variables = DEFAULT_VARIABLES, char = DEFAULT_VA
4263
5080
  let popup = null;
4264
5081
  return {
4265
5082
  onStart: (props) => {
4266
- component = new ReactRenderer2(VariableList, {
5083
+ component = new ReactRenderer2(variableListComponent, {
4267
5084
  props,
4268
5085
  editor: props.editor
4269
5086
  });
@@ -4309,6 +5126,24 @@ function getVariableSuggestions(variables = DEFAULT_VARIABLES, char = DEFAULT_VA
4309
5126
  }
4310
5127
  };
4311
5128
  }
5129
+
5130
+ // src/editor/extensions/placeholder.ts
5131
+ import Placeholder from "@tiptap/extension-placeholder";
5132
+ var PlaceholderExtension = Placeholder.configure({
5133
+ placeholder: ({ node }) => {
5134
+ if (node.type.name === "heading") {
5135
+ return `Heading ${node.attrs.level}`;
5136
+ } else if (node.type.name === "htmlCodeBlock") {
5137
+ return "Type your HTML code...";
5138
+ } else if (["columns", "column", "section", "repeat", "show", "blockquote"].includes(
5139
+ node.type.name
5140
+ )) {
5141
+ return "";
5142
+ }
5143
+ return "Write something or / to see commands";
5144
+ },
5145
+ includeChildren: true
5146
+ });
4312
5147
  export {
4313
5148
  ButtonExtension,
4314
5149
  Color,
@@ -4341,12 +5176,14 @@ export {
4341
5176
  DEFAULT_SECTION_PADDING_RIGHT,
4342
5177
  DEFAULT_SECTION_PADDING_TOP,
4343
5178
  DEFAULT_SECTION_SHOW_IF_KEY,
5179
+ DEFAULT_SPACER_HEIGHT,
4344
5180
  Footer,
4345
5181
  HorizontalRule,
4346
5182
  ImageExtension,
4347
5183
  LinkExtension,
4348
5184
  LogoExtension,
4349
5185
  MailyKit,
5186
+ PlaceholderExtension,
4350
5187
  RepeatExtension,
4351
5188
  SectionExtension,
4352
5189
  SlashCommandExtension,
@@ -4358,7 +5195,6 @@ export {
4358
5195
  allowedButtonVariant,
4359
5196
  allowedLogoAlignment,
4360
5197
  allowedLogoSize,
4361
- allowedSpacerSize,
4362
5198
  getSlashCommandSuggestions,
4363
5199
  getVariableSuggestions,
4364
5200
  logoSizes