@maily-to/core 0.3.5 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -10407,6 +10407,59 @@ import Dropcursor from "@tiptap/extension-dropcursor";
10407
10407
 
10408
10408
  // src/editor/nodes/footer.ts
10409
10409
  import { mergeAttributes as mergeAttributes9, Node as Node10 } from "@tiptap/core";
10410
+
10411
+ // src/editor/nodes/paragraph/paragraph.ts
10412
+ import TiptapParagraph from "@tiptap/extension-paragraph";
10413
+ var allowedTextDirection = ["ltr", "rtl"];
10414
+ var DEFAULT_TEXT_DIRECTION = "ltr";
10415
+ var ParagraphExtension = TiptapParagraph.extend({
10416
+ addAttributes() {
10417
+ var _a;
10418
+ return __spreadProps(__spreadValues({}, ((_a = this == null ? void 0 : this.parent) == null ? void 0 : _a.call(this)) || {}), {
10419
+ textDirection: {
10420
+ default: DEFAULT_TEXT_DIRECTION,
10421
+ parseHTML: (element) => {
10422
+ return element.getAttribute("data-text-direction") || element.getAttribute("dir") || DEFAULT_TEXT_DIRECTION;
10423
+ },
10424
+ renderHTML(attributes) {
10425
+ if (!attributes.textDirection || attributes.textDirection === DEFAULT_TEXT_DIRECTION) {
10426
+ return {};
10427
+ }
10428
+ return {
10429
+ "data-text-direction": attributes.textDirection,
10430
+ dir: attributes.textDirection
10431
+ };
10432
+ }
10433
+ },
10434
+ showIfKey: {
10435
+ default: DEFAULT_SECTION_SHOW_IF_KEY,
10436
+ parseHTML: (element) => {
10437
+ return element.getAttribute("data-show-if-key") || DEFAULT_SECTION_SHOW_IF_KEY;
10438
+ },
10439
+ renderHTML(attributes) {
10440
+ if (!attributes.showIfKey) {
10441
+ return {};
10442
+ }
10443
+ return {
10444
+ "data-show-if-key": attributes.showIfKey
10445
+ };
10446
+ }
10447
+ }
10448
+ });
10449
+ },
10450
+ addCommands() {
10451
+ var _a;
10452
+ return __spreadProps(__spreadValues({}, (_a = this.parent) == null ? void 0 : _a.call(this)), {
10453
+ setTextDirection: (direction) => ({ commands }) => {
10454
+ return commands.updateAttributes(this.name, {
10455
+ textDirection: direction
10456
+ });
10457
+ }
10458
+ });
10459
+ }
10460
+ });
10461
+
10462
+ // src/editor/nodes/footer.ts
10410
10463
  var Footer = Node10.create({
10411
10464
  name: "footer",
10412
10465
  group: "block",
@@ -10421,6 +10474,21 @@ var Footer = Node10.create({
10421
10474
  };
10422
10475
  },
10423
10476
  parseHTML: (element) => element == null ? void 0 : element.getAttribute("data-maily-component")
10477
+ },
10478
+ textDirection: {
10479
+ default: DEFAULT_TEXT_DIRECTION,
10480
+ parseHTML: (element) => {
10481
+ return element.getAttribute("data-text-direction") || element.getAttribute("dir") || DEFAULT_TEXT_DIRECTION;
10482
+ },
10483
+ renderHTML(attributes) {
10484
+ if (!attributes.textDirection || attributes.textDirection === DEFAULT_TEXT_DIRECTION) {
10485
+ return {};
10486
+ }
10487
+ return {
10488
+ "data-text-direction": attributes.textDirection,
10489
+ dir: attributes.textDirection
10490
+ };
10491
+ }
10424
10492
  }
10425
10493
  };
10426
10494
  },
@@ -10428,6 +10496,11 @@ var Footer = Node10.create({
10428
10496
  return {
10429
10497
  setFooter: () => ({ commands }) => {
10430
10498
  return commands.setNode(this.name);
10499
+ },
10500
+ setFooterTextDirection: (direction) => ({ commands }) => {
10501
+ return commands.updateAttributes("footer", {
10502
+ textDirection: direction
10503
+ });
10431
10504
  }
10432
10505
  };
10433
10506
  },
@@ -10472,30 +10545,21 @@ var HeadingExtension = TiptapHeading.extend({
10472
10545
  addAttributes() {
10473
10546
  var _a;
10474
10547
  return __spreadProps(__spreadValues({}, ((_a = this == null ? void 0 : this.parent) == null ? void 0 : _a.call(this)) || {}), {
10475
- showIfKey: {
10476
- default: DEFAULT_SECTION_SHOW_IF_KEY,
10548
+ textDirection: {
10549
+ default: DEFAULT_TEXT_DIRECTION,
10477
10550
  parseHTML: (element) => {
10478
- return element.getAttribute("data-show-if-key") || DEFAULT_SECTION_SHOW_IF_KEY;
10551
+ return element.getAttribute("data-text-direction") || element.getAttribute("dir") || DEFAULT_TEXT_DIRECTION;
10479
10552
  },
10480
10553
  renderHTML(attributes) {
10481
- if (!attributes.showIfKey) {
10554
+ if (!attributes.textDirection || attributes.textDirection === DEFAULT_TEXT_DIRECTION) {
10482
10555
  return {};
10483
10556
  }
10484
10557
  return {
10485
- "data-show-if-key": attributes.showIfKey
10558
+ "data-text-direction": attributes.textDirection,
10559
+ dir: attributes.textDirection
10486
10560
  };
10487
10561
  }
10488
- }
10489
- });
10490
- }
10491
- });
10492
-
10493
- // src/editor/nodes/paragraph/paragraph.ts
10494
- import TiptapParagraph from "@tiptap/extension-paragraph";
10495
- var ParagraphExtension = TiptapParagraph.extend({
10496
- addAttributes() {
10497
- var _a;
10498
- return __spreadProps(__spreadValues({}, ((_a = this == null ? void 0 : this.parent) == null ? void 0 : _a.call(this)) || {}), {
10562
+ },
10499
10563
  showIfKey: {
10500
10564
  default: DEFAULT_SECTION_SHOW_IF_KEY,
10501
10565
  parseHTML: (element) => {
@@ -11475,6 +11539,124 @@ import {
11475
11539
  UnderlineIcon as UnderlineIcon2
11476
11540
  } from "lucide-react";
11477
11541
 
11542
+ // src/editor/components/icons/text-direction-icon.tsx
11543
+ import { jsx as jsx56, jsxs as jsxs33 } from "react/jsx-runtime";
11544
+ function LtrIcon(props) {
11545
+ return /* @__PURE__ */ jsxs33(
11546
+ "svg",
11547
+ __spreadProps(__spreadValues({
11548
+ xmlns: "http://www.w3.org/2000/svg",
11549
+ width: "16",
11550
+ height: "16",
11551
+ viewBox: "0 0 24 24",
11552
+ fill: "none",
11553
+ stroke: "currentColor",
11554
+ strokeWidth: "2",
11555
+ strokeLinecap: "round",
11556
+ strokeLinejoin: "round"
11557
+ }, props), {
11558
+ children: [
11559
+ /* @__PURE__ */ jsx56("path", { d: "M11 5h6" }),
11560
+ /* @__PURE__ */ jsx56("path", { d: "M11 5v14" }),
11561
+ /* @__PURE__ */ jsx56("path", { d: "M15 5v14" }),
11562
+ /* @__PURE__ */ jsx56("path", { d: "M6 18l-3-3 3-3" }),
11563
+ /* @__PURE__ */ jsx56("path", { d: "M3 15h5" })
11564
+ ]
11565
+ })
11566
+ );
11567
+ }
11568
+ function RtlIcon(props) {
11569
+ return /* @__PURE__ */ jsxs33(
11570
+ "svg",
11571
+ __spreadProps(__spreadValues({
11572
+ xmlns: "http://www.w3.org/2000/svg",
11573
+ width: "16",
11574
+ height: "16",
11575
+ viewBox: "0 0 24 24",
11576
+ fill: "none",
11577
+ stroke: "currentColor",
11578
+ strokeWidth: "2",
11579
+ strokeLinecap: "round",
11580
+ strokeLinejoin: "round"
11581
+ }, props), {
11582
+ children: [
11583
+ /* @__PURE__ */ jsx56("path", { d: "M8 5h6" }),
11584
+ /* @__PURE__ */ jsx56("path", { d: "M10 5v14" }),
11585
+ /* @__PURE__ */ jsx56("path", { d: "M14 5v14" }),
11586
+ /* @__PURE__ */ jsx56("path", { d: "M18 18l3-3-3-3" }),
11587
+ /* @__PURE__ */ jsx56("path", { d: "M16 15h5" })
11588
+ ]
11589
+ })
11590
+ );
11591
+ }
11592
+
11593
+ // src/editor/components/text-direction-switch.tsx
11594
+ import { jsx as jsx57, jsxs as jsxs34 } from "react/jsx-runtime";
11595
+ function TextDirectionSwitch(props) {
11596
+ const { direction: rawDirection, onDirectionChange } = props;
11597
+ const direction = allowedTextDirection.includes(
11598
+ rawDirection
11599
+ ) ? rawDirection : "ltr";
11600
+ const directions = {
11601
+ ltr: {
11602
+ icon: LtrIcon,
11603
+ tooltip: "Left to Right",
11604
+ onClick: () => {
11605
+ onDirectionChange("ltr");
11606
+ }
11607
+ },
11608
+ rtl: {
11609
+ icon: RtlIcon,
11610
+ tooltip: "Right to Left",
11611
+ onClick: () => {
11612
+ onDirectionChange("rtl");
11613
+ }
11614
+ }
11615
+ };
11616
+ const activeDirection = directions[direction];
11617
+ return /* @__PURE__ */ jsxs34(Popover, { children: [
11618
+ /* @__PURE__ */ jsxs34(Tooltip, { children: [
11619
+ /* @__PURE__ */ jsx57(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx57(
11620
+ PopoverTrigger,
11621
+ {
11622
+ className: cn(
11623
+ "mly:flex mly:size-7 mly:items-center mly:justify-center mly:gap-1 mly:rounded-md mly:px-1.5 mly:text-sm mly:data-[state=open]:bg-soft-gray mly:hover:bg-soft-gray mly:focus-visible:relative mly:focus-visible:z-10 mly:focus-visible:outline-hidden mly:focus-visible:ring-2 mly:focus-visible:ring-gray-400 mly:focus-visible:ring-offset-2"
11624
+ ),
11625
+ children: /* @__PURE__ */ jsx57(activeDirection.icon, { className: "mly:h-3 mly:w-3 mly:stroke-[2.5]" })
11626
+ }
11627
+ ) }),
11628
+ /* @__PURE__ */ jsx57(TooltipContent, { sideOffset: 8, children: "Text Direction" })
11629
+ ] }),
11630
+ /* @__PURE__ */ jsx57(
11631
+ PopoverContent,
11632
+ {
11633
+ className: "mly:flex mly:w-max mly:gap-0.5 mly:rounded-lg mly:p-0.5!",
11634
+ side: "top",
11635
+ sideOffset: 8,
11636
+ align: "center",
11637
+ onOpenAutoFocus: (e) => {
11638
+ e.preventDefault();
11639
+ },
11640
+ onCloseAutoFocus: (e) => {
11641
+ e.preventDefault();
11642
+ },
11643
+ children: Object.entries(directions).map(([key, value]) => {
11644
+ return /* @__PURE__ */ jsx57(
11645
+ BubbleMenuButton,
11646
+ {
11647
+ icon: value.icon,
11648
+ tooltip: value.tooltip,
11649
+ command: value.onClick,
11650
+ isActive: () => key === direction
11651
+ },
11652
+ key
11653
+ );
11654
+ })
11655
+ }
11656
+ )
11657
+ ] });
11658
+ }
11659
+
11478
11660
  // src/editor/components/text-menu/use-text-menu-state.tsx
11479
11661
  import { useEditorState as useEditorState8 } from "@tiptap/react";
11480
11662
  import deepEql8 from "fast-deep-equal";
@@ -11483,17 +11665,20 @@ var useTextMenuState = (editor) => {
11483
11665
  const states = useEditorState8({
11484
11666
  editor,
11485
11667
  selector: (ctx) => {
11486
- var _a, _b, _c, _d, _e, _f, _g, _h;
11668
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
11487
11669
  return {
11488
11670
  currentTextColor: ctx.editor.getAttributes("textStyle").color || DEFAULT_TEXT_COLOR,
11489
11671
  linkUrl: (_a = ctx.editor) == null ? void 0 : _a.getAttributes("link").href,
11490
11672
  textAlign: ((_b = ctx.editor) == null ? void 0 : _b.isActive({ textAlign: "left" })) ? "left" : ((_c = ctx.editor) == null ? void 0 : _c.isActive({ textAlign: "center" })) ? "center" : ((_d = ctx.editor) == null ? void 0 : _d.isActive({ textAlign: "right" })) ? "right" : ((_e = ctx.editor) == null ? void 0 : _e.isActive({ textAlign: "justify" })) ? "justify" : "left",
11673
+ textDirection: ((_f = ctx.editor.getAttributes("paragraph")) == null ? void 0 : _f.textDirection) || ((_g = ctx.editor.getAttributes("heading")) == null ? void 0 : _g.textDirection) || ((_h = ctx.editor.getAttributes("footer")) == null ? void 0 : _h.textDirection) || DEFAULT_TEXT_DIRECTION,
11674
+ isFooterActive: ctx.editor.isActive("footer"),
11675
+ footerTextDirection: ((_i = ctx.editor.getAttributes("footer")) == null ? void 0 : _i.textDirection) || DEFAULT_TEXT_DIRECTION,
11491
11676
  isListActive: ctx.editor.isActive("bulletList") || ctx.editor.isActive("orderedList"),
11492
- isUrlVariable: (_f = ctx.editor.getAttributes("link").isUrlVariable) != null ? _f : false,
11677
+ isUrlVariable: (_j = ctx.editor.getAttributes("link").isUrlVariable) != null ? _j : false,
11493
11678
  isHeadingActive: ctx.editor.isActive("heading"),
11494
- headingShowIfKey: ((_g = ctx.editor.getAttributes("heading")) == null ? void 0 : _g.showIfKey) || "",
11679
+ headingShowIfKey: ((_k = ctx.editor.getAttributes("heading")) == null ? void 0 : _k.showIfKey) || "",
11495
11680
  isParagraphActive: ctx.editor.isActive("paragraph"),
11496
- paragraphShowIfKey: ((_h = ctx.editor.getAttributes("paragraph")) == null ? void 0 : _h.showIfKey) || ""
11681
+ paragraphShowIfKey: ((_l = ctx.editor.getAttributes("paragraph")) == null ? void 0 : _l.showIfKey) || ""
11497
11682
  };
11498
11683
  },
11499
11684
  equalityFn: deepEql8
@@ -11502,7 +11687,7 @@ var useTextMenuState = (editor) => {
11502
11687
  };
11503
11688
 
11504
11689
  // src/editor/components/text-menu/text-bubble-content.tsx
11505
- import { Fragment as Fragment9, jsx as jsx56, jsxs as jsxs33 } from "react/jsx-runtime";
11690
+ import { Fragment as Fragment9, jsx as jsx58, jsxs as jsxs35 } from "react/jsx-runtime";
11506
11691
  function TextBubbleContent(props) {
11507
11692
  var _a, _b, _c, _d;
11508
11693
  const { editor, showListMenu = true } = props;
@@ -11546,9 +11731,9 @@ function TextBubbleContent(props) {
11546
11731
  tooltip: "Code"
11547
11732
  }
11548
11733
  ];
11549
- return /* @__PURE__ */ jsxs33(Fragment9, { children: [
11550
- items.map((item, index) => /* @__PURE__ */ jsx56(BubbleMenuButton, __spreadValues({}, item), index)),
11551
- /* @__PURE__ */ jsx56(
11734
+ return /* @__PURE__ */ jsxs35(Fragment9, { children: [
11735
+ items.map((item, index) => /* @__PURE__ */ jsx58(BubbleMenuButton, __spreadValues({}, item), index)),
11736
+ /* @__PURE__ */ jsx58(
11552
11737
  AlignmentSwitch,
11553
11738
  {
11554
11739
  alignment: state.textAlign,
@@ -11557,8 +11742,23 @@ function TextBubbleContent(props) {
11557
11742
  }
11558
11743
  }
11559
11744
  ),
11560
- !state.isListActive && showListMenu && /* @__PURE__ */ jsxs33(Fragment9, { children: [
11561
- /* @__PURE__ */ jsx56(
11745
+ /* @__PURE__ */ jsx58(
11746
+ TextDirectionSwitch,
11747
+ {
11748
+ direction: state.textDirection,
11749
+ onDirectionChange: (direction) => {
11750
+ if (state.isFooterActive) {
11751
+ editor == null ? void 0 : editor.chain().focus().setFooterTextDirection(direction).run();
11752
+ } else if (state.isHeadingActive) {
11753
+ editor == null ? void 0 : editor.chain().focus().updateAttributes("heading", { textDirection: direction }).run();
11754
+ } else {
11755
+ editor == null ? void 0 : editor.chain().focus().setTextDirection(direction).run();
11756
+ }
11757
+ }
11758
+ }
11759
+ ),
11760
+ !state.isListActive && showListMenu && /* @__PURE__ */ jsxs35(Fragment9, { children: [
11761
+ /* @__PURE__ */ jsx58(
11562
11762
  BubbleMenuButton,
11563
11763
  {
11564
11764
  icon: List2,
@@ -11568,7 +11768,7 @@ function TextBubbleContent(props) {
11568
11768
  tooltip: "Bullet List"
11569
11769
  }
11570
11770
  ),
11571
- /* @__PURE__ */ jsx56(
11771
+ /* @__PURE__ */ jsx58(
11572
11772
  BubbleMenuButton,
11573
11773
  {
11574
11774
  icon: ListOrdered2,
@@ -11579,7 +11779,7 @@ function TextBubbleContent(props) {
11579
11779
  }
11580
11780
  )
11581
11781
  ] }),
11582
- /* @__PURE__ */ jsx56(
11782
+ /* @__PURE__ */ jsx58(
11583
11783
  LinkInputPopover,
11584
11784
  {
11585
11785
  defaultValue: (_d = state == null ? void 0 : state.linkUrl) != null ? _d : "",
@@ -11595,8 +11795,8 @@ function TextBubbleContent(props) {
11595
11795
  isVariable: state.isUrlVariable
11596
11796
  }
11597
11797
  ),
11598
- /* @__PURE__ */ jsx56(Divider, {}),
11599
- /* @__PURE__ */ jsx56(
11798
+ /* @__PURE__ */ jsx58(Divider, {}),
11799
+ /* @__PURE__ */ jsx58(
11600
11800
  ColorPicker,
11601
11801
  {
11602
11802
  color: state.currentTextColor,
@@ -11605,16 +11805,16 @@ function TextBubbleContent(props) {
11605
11805
  },
11606
11806
  tooltip: "Text Color",
11607
11807
  suggestedColors,
11608
- children: /* @__PURE__ */ jsx56(
11808
+ children: /* @__PURE__ */ jsx58(
11609
11809
  BaseButton,
11610
11810
  {
11611
11811
  variant: "ghost",
11612
11812
  size: "sm",
11613
11813
  type: "button",
11614
11814
  className: "mly:h-7 mly:w-7 mly:shrink-0 mly:p-0",
11615
- children: /* @__PURE__ */ jsxs33("div", { className: "mly:flex mly:flex-col mly:items-center mly:justify-center mly:gap-px", children: [
11616
- /* @__PURE__ */ jsx56("span", { className: "mly:font-bolder mly:font-mono mly:text-xs mly:text-slate-700", children: "A" }),
11617
- /* @__PURE__ */ jsx56(
11815
+ children: /* @__PURE__ */ jsxs35("div", { className: "mly:flex mly:flex-col mly:items-center mly:justify-center mly:gap-px", children: [
11816
+ /* @__PURE__ */ jsx58("span", { className: "mly:font-bolder mly:font-mono mly:text-xs mly:text-slate-700", children: "A" }),
11817
+ /* @__PURE__ */ jsx58(
11618
11818
  "div",
11619
11819
  {
11620
11820
  className: "mly:h-[2px] mly:w-3",
@@ -11632,7 +11832,7 @@ function TextBubbleContent(props) {
11632
11832
  // src/editor/components/text-menu/turn-into-block.tsx
11633
11833
  import { ChevronDownIcon as ChevronDownIcon2, PilcrowIcon } from "lucide-react";
11634
11834
  import { useMemo as useMemo12 } from "react";
11635
- import { jsx as jsx57, jsxs as jsxs34 } from "react/jsx-runtime";
11835
+ import { jsx as jsx59, jsxs as jsxs36 } from "react/jsx-runtime";
11636
11836
  var isOption = (option) => option.type === "option";
11637
11837
  var isCategory = (option) => option.type === "category";
11638
11838
  function TurnIntoBlock(props) {
@@ -11642,23 +11842,23 @@ function TurnIntoBlock(props) {
11642
11842
  [options]
11643
11843
  );
11644
11844
  const { icon: ActiveIcon = PilcrowIcon } = activeItem || {};
11645
- return /* @__PURE__ */ jsxs34(Popover, { children: [
11646
- /* @__PURE__ */ jsxs34(Tooltip, { children: [
11647
- /* @__PURE__ */ jsx57(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs34(
11845
+ return /* @__PURE__ */ jsxs36(Popover, { children: [
11846
+ /* @__PURE__ */ jsxs36(Tooltip, { children: [
11847
+ /* @__PURE__ */ jsx59(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs36(
11648
11848
  PopoverTrigger,
11649
11849
  {
11650
11850
  className: cn(
11651
11851
  "mly:flex mly:aspect-square mly:h-7 mly:items-center mly:justify-center mly:gap-1 mly:rounded-md mly:px-1.5 mly:text-sm mly:data-[state=open]:bg-soft-gray mly:hover:bg-soft-gray mly:focus-visible:relative mly:focus-visible:z-10 mly:focus-visible:outline-hidden mly:focus-visible:ring-2 mly:focus-visible:ring-gray-400 mly:focus-visible:ring-offset-2"
11652
11852
  ),
11653
11853
  children: [
11654
- /* @__PURE__ */ jsx57(ActiveIcon, { className: "mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5]" }),
11655
- /* @__PURE__ */ jsx57(ChevronDownIcon2, { className: "mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5]" })
11854
+ /* @__PURE__ */ jsx59(ActiveIcon, { className: "mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5]" }),
11855
+ /* @__PURE__ */ jsx59(ChevronDownIcon2, { className: "mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5]" })
11656
11856
  ]
11657
11857
  }
11658
11858
  ) }),
11659
- /* @__PURE__ */ jsx57(TooltipContent, { sideOffset: 8, children: "Turn into" })
11859
+ /* @__PURE__ */ jsx59(TooltipContent, { sideOffset: 8, children: "Turn into" })
11660
11860
  ] }),
11661
- /* @__PURE__ */ jsx57(
11861
+ /* @__PURE__ */ jsx59(
11662
11862
  PopoverContent,
11663
11863
  {
11664
11864
  align: "start",
@@ -11667,21 +11867,21 @@ function TurnIntoBlock(props) {
11667
11867
  className: "mly:flex mly:w-[160px] mly:flex-col mly:rounded-md mly:p-1",
11668
11868
  children: options.map((option, index) => {
11669
11869
  if (isOption(option)) {
11670
- return /* @__PURE__ */ jsxs34(
11870
+ return /* @__PURE__ */ jsxs36(
11671
11871
  BaseButton,
11672
11872
  {
11673
11873
  onClick: option.onClick,
11674
11874
  variant: "ghost",
11675
11875
  className: "mly:mb-0.5 mly:h-auto mly:justify-start mly:gap-2 mly:rounded! mly:px-2 mly:py-1 mly:text-sm mly:font-normal mly:text-midnight-gray",
11676
11876
  children: [
11677
- /* @__PURE__ */ jsx57(option.icon, { className: "mly:size-[15px] mly:shrink-0" }),
11877
+ /* @__PURE__ */ jsx59(option.icon, { className: "mly:size-[15px] mly:shrink-0" }),
11678
11878
  option.label
11679
11879
  ]
11680
11880
  },
11681
11881
  option.id
11682
11882
  );
11683
11883
  } else if (isCategory(option)) {
11684
- return /* @__PURE__ */ jsx57(
11884
+ return /* @__PURE__ */ jsx59(
11685
11885
  "label",
11686
11886
  {
11687
11887
  className: cn(
@@ -11794,7 +11994,7 @@ function useTurnIntoBlockOptions(editor) {
11794
11994
  }
11795
11995
 
11796
11996
  // src/editor/components/text-menu/text-bubble-menu.tsx
11797
- import { jsx as jsx58, jsxs as jsxs35 } from "react/jsx-runtime";
11997
+ import { jsx as jsx60, jsxs as jsxs37 } from "react/jsx-runtime";
11798
11998
  function TextBubbleMenu(props) {
11799
11999
  const { editor, appendTo } = props;
11800
12000
  if (!editor) {
@@ -11845,14 +12045,14 @@ function TextBubbleMenu(props) {
11845
12045
  }
11846
12046
  });
11847
12047
  const turnIntoBlockOptions = useTurnIntoBlockOptions(editor);
11848
- return /* @__PURE__ */ jsx58(
12048
+ return /* @__PURE__ */ jsx60(
11849
12049
  BubbleMenu8,
11850
12050
  __spreadProps(__spreadValues({}, bubbleMenuProps), {
11851
12051
  className: "mly:flex mly:gap-0.5 mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:p-0.5 mly:shadow-md",
11852
- children: /* @__PURE__ */ jsxs35(TooltipProvider, { children: [
11853
- /* @__PURE__ */ jsx58(TurnIntoBlock, { options: turnIntoBlockOptions }),
11854
- /* @__PURE__ */ jsx58(Divider, { className: "mly:mx-0" }),
11855
- /* @__PURE__ */ jsx58(TextBubbleContent, { editor })
12052
+ children: /* @__PURE__ */ jsxs37(TooltipProvider, { children: [
12053
+ /* @__PURE__ */ jsx60(TurnIntoBlock, { options: turnIntoBlockOptions }),
12054
+ /* @__PURE__ */ jsx60(Divider, { className: "mly:mx-0" }),
12055
+ /* @__PURE__ */ jsx60(TextBubbleContent, { editor })
11856
12056
  ] })
11857
12057
  })
11858
12058
  );
@@ -11861,7 +12061,7 @@ function TextBubbleMenu(props) {
11861
12061
  // src/editor/components/variable-menu/variable-bubble-menu.tsx
11862
12062
  import { BubbleMenu as BubbleMenu9 } from "@tiptap/react";
11863
12063
  import { sticky as sticky7 } from "tippy.js";
11864
- import { jsx as jsx59 } from "react/jsx-runtime";
12064
+ import { jsx as jsx61 } from "react/jsx-runtime";
11865
12065
  function VariableBubbleMenu(props) {
11866
12066
  const { editor, appendTo } = props;
11867
12067
  if (!editor) {
@@ -11884,11 +12084,11 @@ function VariableBubbleMenu(props) {
11884
12084
  placement: "top-start"
11885
12085
  }
11886
12086
  });
11887
- return /* @__PURE__ */ jsx59(
12087
+ return /* @__PURE__ */ jsx61(
11888
12088
  BubbleMenu9,
11889
12089
  __spreadProps(__spreadValues({}, bubbleMenuProps), {
11890
12090
  className: "mly:flex mly:gap-0.5 mly:rounded-lg mly:border mly:border-slate-200 mly:bg-white mly:p-0.5 mly:shadow-md",
11891
- children: /* @__PURE__ */ jsx59(TooltipProvider, { children: /* @__PURE__ */ jsx59(TextBubbleContent, { showListMenu: false, editor }) })
12091
+ children: /* @__PURE__ */ jsx61(TooltipProvider, { children: /* @__PURE__ */ jsx61(TextBubbleContent, { showListMenu: false, editor }) })
11892
12092
  })
11893
12093
  );
11894
12094
  }
@@ -11974,7 +12174,7 @@ function replaceDeprecatedNode(json) {
11974
12174
  }
11975
12175
 
11976
12176
  // src/editor/index.tsx
11977
- import { jsx as jsx60, jsxs as jsxs36 } from "react/jsx-runtime";
12177
+ import { jsx as jsx62, jsxs as jsxs38 } from "react/jsx-runtime";
11978
12178
  function Editor13(props) {
11979
12179
  const {
11980
12180
  config: {
@@ -12047,7 +12247,7 @@ function Editor13(props) {
12047
12247
  if (!editor) {
12048
12248
  return null;
12049
12249
  }
12050
- return /* @__PURE__ */ jsx60(MailyProvider, { placeholderUrl, children: /* @__PURE__ */ jsxs36(
12250
+ return /* @__PURE__ */ jsx62(MailyProvider, { placeholderUrl, children: /* @__PURE__ */ jsxs38(
12051
12251
  "div",
12052
12252
  {
12053
12253
  id: "mly-editor",
@@ -12058,8 +12258,8 @@ function Editor13(props) {
12058
12258
  ),
12059
12259
  ref: menuContainerRef,
12060
12260
  children: [
12061
- hasMenuBar && /* @__PURE__ */ jsx60(EditorMenuBar, { config: props.config, editor }),
12062
- /* @__PURE__ */ jsxs36(
12261
+ hasMenuBar && /* @__PURE__ */ jsx62(EditorMenuBar, { config: props.config, editor }),
12262
+ /* @__PURE__ */ jsxs38(
12063
12263
  "div",
12064
12264
  {
12065
12265
  className: cn(
@@ -12067,17 +12267,17 @@ function Editor13(props) {
12067
12267
  bodyClassName
12068
12268
  ),
12069
12269
  children: [
12070
- /* @__PURE__ */ jsx60(TextBubbleMenu, { editor, appendTo: menuContainerRef }),
12071
- /* @__PURE__ */ jsx60(ImageBubbleMenu, { editor, appendTo: menuContainerRef }),
12072
- /* @__PURE__ */ jsx60(SpacerBubbleMenu, { editor, appendTo: menuContainerRef }),
12073
- /* @__PURE__ */ jsx60(EditorContent, { editor }),
12074
- /* @__PURE__ */ jsx60(SectionBubbleMenu, { editor, appendTo: menuContainerRef }),
12075
- /* @__PURE__ */ jsx60(ColumnsBubbleMenu, { editor, appendTo: menuContainerRef }),
12076
- !hideContextMenu && /* @__PURE__ */ jsx60(ContentMenu, { editor }),
12077
- /* @__PURE__ */ jsx60(VariableBubbleMenu, { editor, appendTo: menuContainerRef }),
12078
- /* @__PURE__ */ jsx60(RepeatBubbleMenu, { editor, appendTo: menuContainerRef }),
12079
- /* @__PURE__ */ jsx60(HTMLBubbleMenu, { editor, appendTo: menuContainerRef }),
12080
- /* @__PURE__ */ jsx60(InlineImageBubbleMenu, { editor, appendTo: menuContainerRef })
12270
+ /* @__PURE__ */ jsx62(TextBubbleMenu, { editor, appendTo: menuContainerRef }),
12271
+ /* @__PURE__ */ jsx62(ImageBubbleMenu, { editor, appendTo: menuContainerRef }),
12272
+ /* @__PURE__ */ jsx62(SpacerBubbleMenu, { editor, appendTo: menuContainerRef }),
12273
+ /* @__PURE__ */ jsx62(EditorContent, { editor }),
12274
+ /* @__PURE__ */ jsx62(SectionBubbleMenu, { editor, appendTo: menuContainerRef }),
12275
+ /* @__PURE__ */ jsx62(ColumnsBubbleMenu, { editor, appendTo: menuContainerRef }),
12276
+ !hideContextMenu && /* @__PURE__ */ jsx62(ContentMenu, { editor }),
12277
+ /* @__PURE__ */ jsx62(VariableBubbleMenu, { editor, appendTo: menuContainerRef }),
12278
+ /* @__PURE__ */ jsx62(RepeatBubbleMenu, { editor, appendTo: menuContainerRef }),
12279
+ /* @__PURE__ */ jsx62(HTMLBubbleMenu, { editor, appendTo: menuContainerRef }),
12280
+ /* @__PURE__ */ jsx62(InlineImageBubbleMenu, { editor, appendTo: menuContainerRef })
12081
12281
  ]
12082
12282
  }
12083
12283
  )