@maily-to/core 0.3.5 → 0.3.7
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/extensions/index.cjs +122 -59
- package/dist/extensions/index.cjs.map +1 -1
- package/dist/extensions/index.d.cts +11 -0
- package/dist/extensions/index.d.ts +11 -0
- package/dist/extensions/index.mjs +122 -59
- package/dist/extensions/index.mjs.map +1 -1
- package/dist/index.cjs +269 -69
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +4 -4
- package/dist/index.css.map +1 -1
- package/dist/index.mjs +269 -69
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -10380,6 +10380,59 @@ var import_extension_dropcursor = __toESM(require("@tiptap/extension-dropcursor"
|
|
|
10380
10380
|
|
|
10381
10381
|
// src/editor/nodes/footer.ts
|
|
10382
10382
|
var import_core15 = require("@tiptap/core");
|
|
10383
|
+
|
|
10384
|
+
// src/editor/nodes/paragraph/paragraph.ts
|
|
10385
|
+
var import_extension_paragraph = __toESM(require("@tiptap/extension-paragraph"), 1);
|
|
10386
|
+
var allowedTextDirection = ["ltr", "rtl"];
|
|
10387
|
+
var DEFAULT_TEXT_DIRECTION = "ltr";
|
|
10388
|
+
var ParagraphExtension = import_extension_paragraph.default.extend({
|
|
10389
|
+
addAttributes() {
|
|
10390
|
+
var _a;
|
|
10391
|
+
return __spreadProps(__spreadValues({}, ((_a = this == null ? void 0 : this.parent) == null ? void 0 : _a.call(this)) || {}), {
|
|
10392
|
+
textDirection: {
|
|
10393
|
+
default: DEFAULT_TEXT_DIRECTION,
|
|
10394
|
+
parseHTML: (element) => {
|
|
10395
|
+
return element.getAttribute("data-text-direction") || element.getAttribute("dir") || DEFAULT_TEXT_DIRECTION;
|
|
10396
|
+
},
|
|
10397
|
+
renderHTML(attributes) {
|
|
10398
|
+
if (!attributes.textDirection || attributes.textDirection === DEFAULT_TEXT_DIRECTION) {
|
|
10399
|
+
return {};
|
|
10400
|
+
}
|
|
10401
|
+
return {
|
|
10402
|
+
"data-text-direction": attributes.textDirection,
|
|
10403
|
+
dir: attributes.textDirection
|
|
10404
|
+
};
|
|
10405
|
+
}
|
|
10406
|
+
},
|
|
10407
|
+
showIfKey: {
|
|
10408
|
+
default: DEFAULT_SECTION_SHOW_IF_KEY,
|
|
10409
|
+
parseHTML: (element) => {
|
|
10410
|
+
return element.getAttribute("data-show-if-key") || DEFAULT_SECTION_SHOW_IF_KEY;
|
|
10411
|
+
},
|
|
10412
|
+
renderHTML(attributes) {
|
|
10413
|
+
if (!attributes.showIfKey) {
|
|
10414
|
+
return {};
|
|
10415
|
+
}
|
|
10416
|
+
return {
|
|
10417
|
+
"data-show-if-key": attributes.showIfKey
|
|
10418
|
+
};
|
|
10419
|
+
}
|
|
10420
|
+
}
|
|
10421
|
+
});
|
|
10422
|
+
},
|
|
10423
|
+
addCommands() {
|
|
10424
|
+
var _a;
|
|
10425
|
+
return __spreadProps(__spreadValues({}, (_a = this.parent) == null ? void 0 : _a.call(this)), {
|
|
10426
|
+
setTextDirection: (direction) => ({ commands }) => {
|
|
10427
|
+
return commands.updateAttributes(this.name, {
|
|
10428
|
+
textDirection: direction
|
|
10429
|
+
});
|
|
10430
|
+
}
|
|
10431
|
+
});
|
|
10432
|
+
}
|
|
10433
|
+
});
|
|
10434
|
+
|
|
10435
|
+
// src/editor/nodes/footer.ts
|
|
10383
10436
|
var Footer = import_core15.Node.create({
|
|
10384
10437
|
name: "footer",
|
|
10385
10438
|
group: "block",
|
|
@@ -10394,6 +10447,21 @@ var Footer = import_core15.Node.create({
|
|
|
10394
10447
|
};
|
|
10395
10448
|
},
|
|
10396
10449
|
parseHTML: (element) => element == null ? void 0 : element.getAttribute("data-maily-component")
|
|
10450
|
+
},
|
|
10451
|
+
textDirection: {
|
|
10452
|
+
default: DEFAULT_TEXT_DIRECTION,
|
|
10453
|
+
parseHTML: (element) => {
|
|
10454
|
+
return element.getAttribute("data-text-direction") || element.getAttribute("dir") || DEFAULT_TEXT_DIRECTION;
|
|
10455
|
+
},
|
|
10456
|
+
renderHTML(attributes) {
|
|
10457
|
+
if (!attributes.textDirection || attributes.textDirection === DEFAULT_TEXT_DIRECTION) {
|
|
10458
|
+
return {};
|
|
10459
|
+
}
|
|
10460
|
+
return {
|
|
10461
|
+
"data-text-direction": attributes.textDirection,
|
|
10462
|
+
dir: attributes.textDirection
|
|
10463
|
+
};
|
|
10464
|
+
}
|
|
10397
10465
|
}
|
|
10398
10466
|
};
|
|
10399
10467
|
},
|
|
@@ -10401,6 +10469,11 @@ var Footer = import_core15.Node.create({
|
|
|
10401
10469
|
return {
|
|
10402
10470
|
setFooter: () => ({ commands }) => {
|
|
10403
10471
|
return commands.setNode(this.name);
|
|
10472
|
+
},
|
|
10473
|
+
setFooterTextDirection: (direction) => ({ commands }) => {
|
|
10474
|
+
return commands.updateAttributes("footer", {
|
|
10475
|
+
textDirection: direction
|
|
10476
|
+
});
|
|
10404
10477
|
}
|
|
10405
10478
|
};
|
|
10406
10479
|
},
|
|
@@ -10445,30 +10518,21 @@ var HeadingExtension = import_extension_heading.default.extend({
|
|
|
10445
10518
|
addAttributes() {
|
|
10446
10519
|
var _a;
|
|
10447
10520
|
return __spreadProps(__spreadValues({}, ((_a = this == null ? void 0 : this.parent) == null ? void 0 : _a.call(this)) || {}), {
|
|
10448
|
-
|
|
10449
|
-
default:
|
|
10521
|
+
textDirection: {
|
|
10522
|
+
default: DEFAULT_TEXT_DIRECTION,
|
|
10450
10523
|
parseHTML: (element) => {
|
|
10451
|
-
return element.getAttribute("data-
|
|
10524
|
+
return element.getAttribute("data-text-direction") || element.getAttribute("dir") || DEFAULT_TEXT_DIRECTION;
|
|
10452
10525
|
},
|
|
10453
10526
|
renderHTML(attributes) {
|
|
10454
|
-
if (!attributes.
|
|
10527
|
+
if (!attributes.textDirection || attributes.textDirection === DEFAULT_TEXT_DIRECTION) {
|
|
10455
10528
|
return {};
|
|
10456
10529
|
}
|
|
10457
10530
|
return {
|
|
10458
|
-
"data-
|
|
10531
|
+
"data-text-direction": attributes.textDirection,
|
|
10532
|
+
dir: attributes.textDirection
|
|
10459
10533
|
};
|
|
10460
10534
|
}
|
|
10461
|
-
}
|
|
10462
|
-
});
|
|
10463
|
-
}
|
|
10464
|
-
});
|
|
10465
|
-
|
|
10466
|
-
// src/editor/nodes/paragraph/paragraph.ts
|
|
10467
|
-
var import_extension_paragraph = __toESM(require("@tiptap/extension-paragraph"), 1);
|
|
10468
|
-
var ParagraphExtension = import_extension_paragraph.default.extend({
|
|
10469
|
-
addAttributes() {
|
|
10470
|
-
var _a;
|
|
10471
|
-
return __spreadProps(__spreadValues({}, ((_a = this == null ? void 0 : this.parent) == null ? void 0 : _a.call(this)) || {}), {
|
|
10535
|
+
},
|
|
10472
10536
|
showIfKey: {
|
|
10473
10537
|
default: DEFAULT_SECTION_SHOW_IF_KEY,
|
|
10474
10538
|
parseHTML: (element) => {
|
|
@@ -11431,6 +11495,124 @@ var import_react64 = require("@tiptap/react");
|
|
|
11431
11495
|
// src/editor/components/text-menu/text-bubble-content.tsx
|
|
11432
11496
|
var import_lucide_react29 = require("lucide-react");
|
|
11433
11497
|
|
|
11498
|
+
// src/editor/components/icons/text-direction-icon.tsx
|
|
11499
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
11500
|
+
function LtrIcon(props) {
|
|
11501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
11502
|
+
"svg",
|
|
11503
|
+
__spreadProps(__spreadValues({
|
|
11504
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
11505
|
+
width: "16",
|
|
11506
|
+
height: "16",
|
|
11507
|
+
viewBox: "0 0 24 24",
|
|
11508
|
+
fill: "none",
|
|
11509
|
+
stroke: "currentColor",
|
|
11510
|
+
strokeWidth: "2",
|
|
11511
|
+
strokeLinecap: "round",
|
|
11512
|
+
strokeLinejoin: "round"
|
|
11513
|
+
}, props), {
|
|
11514
|
+
children: [
|
|
11515
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("path", { d: "M11 5h6" }),
|
|
11516
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("path", { d: "M11 5v14" }),
|
|
11517
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("path", { d: "M15 5v14" }),
|
|
11518
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("path", { d: "M6 18l-3-3 3-3" }),
|
|
11519
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("path", { d: "M3 15h5" })
|
|
11520
|
+
]
|
|
11521
|
+
})
|
|
11522
|
+
);
|
|
11523
|
+
}
|
|
11524
|
+
function RtlIcon(props) {
|
|
11525
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
11526
|
+
"svg",
|
|
11527
|
+
__spreadProps(__spreadValues({
|
|
11528
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
11529
|
+
width: "16",
|
|
11530
|
+
height: "16",
|
|
11531
|
+
viewBox: "0 0 24 24",
|
|
11532
|
+
fill: "none",
|
|
11533
|
+
stroke: "currentColor",
|
|
11534
|
+
strokeWidth: "2",
|
|
11535
|
+
strokeLinecap: "round",
|
|
11536
|
+
strokeLinejoin: "round"
|
|
11537
|
+
}, props), {
|
|
11538
|
+
children: [
|
|
11539
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("path", { d: "M8 5h6" }),
|
|
11540
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("path", { d: "M10 5v14" }),
|
|
11541
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("path", { d: "M14 5v14" }),
|
|
11542
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("path", { d: "M18 18l3-3-3-3" }),
|
|
11543
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("path", { d: "M16 15h5" })
|
|
11544
|
+
]
|
|
11545
|
+
})
|
|
11546
|
+
);
|
|
11547
|
+
}
|
|
11548
|
+
|
|
11549
|
+
// src/editor/components/text-direction-switch.tsx
|
|
11550
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
11551
|
+
function TextDirectionSwitch(props) {
|
|
11552
|
+
const { direction: rawDirection, onDirectionChange } = props;
|
|
11553
|
+
const direction = allowedTextDirection.includes(
|
|
11554
|
+
rawDirection
|
|
11555
|
+
) ? rawDirection : "ltr";
|
|
11556
|
+
const directions = {
|
|
11557
|
+
ltr: {
|
|
11558
|
+
icon: LtrIcon,
|
|
11559
|
+
tooltip: "Left to Right",
|
|
11560
|
+
onClick: () => {
|
|
11561
|
+
onDirectionChange("ltr");
|
|
11562
|
+
}
|
|
11563
|
+
},
|
|
11564
|
+
rtl: {
|
|
11565
|
+
icon: RtlIcon,
|
|
11566
|
+
tooltip: "Right to Left",
|
|
11567
|
+
onClick: () => {
|
|
11568
|
+
onDirectionChange("rtl");
|
|
11569
|
+
}
|
|
11570
|
+
}
|
|
11571
|
+
};
|
|
11572
|
+
const activeDirection = directions[direction];
|
|
11573
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Popover, { children: [
|
|
11574
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Tooltip, { children: [
|
|
11575
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
11576
|
+
PopoverTrigger,
|
|
11577
|
+
{
|
|
11578
|
+
className: cn(
|
|
11579
|
+
"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"
|
|
11580
|
+
),
|
|
11581
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(activeDirection.icon, { className: "mly:h-3 mly:w-3 mly:stroke-[2.5]" })
|
|
11582
|
+
}
|
|
11583
|
+
) }),
|
|
11584
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(TooltipContent, { sideOffset: 8, children: "Text Direction" })
|
|
11585
|
+
] }),
|
|
11586
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
11587
|
+
PopoverContent,
|
|
11588
|
+
{
|
|
11589
|
+
className: "mly:flex mly:w-max mly:gap-0.5 mly:rounded-lg mly:p-0.5!",
|
|
11590
|
+
side: "top",
|
|
11591
|
+
sideOffset: 8,
|
|
11592
|
+
align: "center",
|
|
11593
|
+
onOpenAutoFocus: (e) => {
|
|
11594
|
+
e.preventDefault();
|
|
11595
|
+
},
|
|
11596
|
+
onCloseAutoFocus: (e) => {
|
|
11597
|
+
e.preventDefault();
|
|
11598
|
+
},
|
|
11599
|
+
children: Object.entries(directions).map(([key, value]) => {
|
|
11600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
11601
|
+
BubbleMenuButton,
|
|
11602
|
+
{
|
|
11603
|
+
icon: value.icon,
|
|
11604
|
+
tooltip: value.tooltip,
|
|
11605
|
+
command: value.onClick,
|
|
11606
|
+
isActive: () => key === direction
|
|
11607
|
+
},
|
|
11608
|
+
key
|
|
11609
|
+
);
|
|
11610
|
+
})
|
|
11611
|
+
}
|
|
11612
|
+
)
|
|
11613
|
+
] });
|
|
11614
|
+
}
|
|
11615
|
+
|
|
11434
11616
|
// src/editor/components/text-menu/use-text-menu-state.tsx
|
|
11435
11617
|
var import_react61 = require("@tiptap/react");
|
|
11436
11618
|
var import_fast_deep_equal8 = __toESM(require("fast-deep-equal"), 1);
|
|
@@ -11439,17 +11621,20 @@ var useTextMenuState = (editor) => {
|
|
|
11439
11621
|
const states = (0, import_react61.useEditorState)({
|
|
11440
11622
|
editor,
|
|
11441
11623
|
selector: (ctx) => {
|
|
11442
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
11624
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
11443
11625
|
return {
|
|
11444
11626
|
currentTextColor: ctx.editor.getAttributes("textStyle").color || DEFAULT_TEXT_COLOR,
|
|
11445
11627
|
linkUrl: (_a = ctx.editor) == null ? void 0 : _a.getAttributes("link").href,
|
|
11446
11628
|
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",
|
|
11629
|
+
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,
|
|
11630
|
+
isFooterActive: ctx.editor.isActive("footer"),
|
|
11631
|
+
footerTextDirection: ((_i = ctx.editor.getAttributes("footer")) == null ? void 0 : _i.textDirection) || DEFAULT_TEXT_DIRECTION,
|
|
11447
11632
|
isListActive: ctx.editor.isActive("bulletList") || ctx.editor.isActive("orderedList"),
|
|
11448
|
-
isUrlVariable: (
|
|
11633
|
+
isUrlVariable: (_j = ctx.editor.getAttributes("link").isUrlVariable) != null ? _j : false,
|
|
11449
11634
|
isHeadingActive: ctx.editor.isActive("heading"),
|
|
11450
|
-
headingShowIfKey: ((
|
|
11635
|
+
headingShowIfKey: ((_k = ctx.editor.getAttributes("heading")) == null ? void 0 : _k.showIfKey) || "",
|
|
11451
11636
|
isParagraphActive: ctx.editor.isActive("paragraph"),
|
|
11452
|
-
paragraphShowIfKey: ((
|
|
11637
|
+
paragraphShowIfKey: ((_l = ctx.editor.getAttributes("paragraph")) == null ? void 0 : _l.showIfKey) || ""
|
|
11453
11638
|
};
|
|
11454
11639
|
},
|
|
11455
11640
|
equalityFn: import_fast_deep_equal8.default
|
|
@@ -11458,7 +11643,7 @@ var useTextMenuState = (editor) => {
|
|
|
11458
11643
|
};
|
|
11459
11644
|
|
|
11460
11645
|
// src/editor/components/text-menu/text-bubble-content.tsx
|
|
11461
|
-
var
|
|
11646
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
11462
11647
|
function TextBubbleContent(props) {
|
|
11463
11648
|
var _a, _b, _c, _d;
|
|
11464
11649
|
const { editor, showListMenu = true } = props;
|
|
@@ -11502,9 +11687,9 @@ function TextBubbleContent(props) {
|
|
|
11502
11687
|
tooltip: "Code"
|
|
11503
11688
|
}
|
|
11504
11689
|
];
|
|
11505
|
-
return /* @__PURE__ */ (0,
|
|
11506
|
-
items.map((item, index) => /* @__PURE__ */ (0,
|
|
11507
|
-
/* @__PURE__ */ (0,
|
|
11690
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
|
|
11691
|
+
items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(BubbleMenuButton, __spreadValues({}, item), index)),
|
|
11692
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
11508
11693
|
AlignmentSwitch,
|
|
11509
11694
|
{
|
|
11510
11695
|
alignment: state.textAlign,
|
|
@@ -11513,8 +11698,23 @@ function TextBubbleContent(props) {
|
|
|
11513
11698
|
}
|
|
11514
11699
|
}
|
|
11515
11700
|
),
|
|
11516
|
-
|
|
11517
|
-
|
|
11701
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
11702
|
+
TextDirectionSwitch,
|
|
11703
|
+
{
|
|
11704
|
+
direction: state.textDirection,
|
|
11705
|
+
onDirectionChange: (direction) => {
|
|
11706
|
+
if (state.isFooterActive) {
|
|
11707
|
+
editor == null ? void 0 : editor.chain().focus().setFooterTextDirection(direction).run();
|
|
11708
|
+
} else if (state.isHeadingActive) {
|
|
11709
|
+
editor == null ? void 0 : editor.chain().focus().updateAttributes("heading", { textDirection: direction }).run();
|
|
11710
|
+
} else {
|
|
11711
|
+
editor == null ? void 0 : editor.chain().focus().setTextDirection(direction).run();
|
|
11712
|
+
}
|
|
11713
|
+
}
|
|
11714
|
+
}
|
|
11715
|
+
),
|
|
11716
|
+
!state.isListActive && showListMenu && /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
|
|
11717
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
11518
11718
|
BubbleMenuButton,
|
|
11519
11719
|
{
|
|
11520
11720
|
icon: import_lucide_react29.List,
|
|
@@ -11524,7 +11724,7 @@ function TextBubbleContent(props) {
|
|
|
11524
11724
|
tooltip: "Bullet List"
|
|
11525
11725
|
}
|
|
11526
11726
|
),
|
|
11527
|
-
/* @__PURE__ */ (0,
|
|
11727
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
11528
11728
|
BubbleMenuButton,
|
|
11529
11729
|
{
|
|
11530
11730
|
icon: import_lucide_react29.ListOrdered,
|
|
@@ -11535,7 +11735,7 @@ function TextBubbleContent(props) {
|
|
|
11535
11735
|
}
|
|
11536
11736
|
)
|
|
11537
11737
|
] }),
|
|
11538
|
-
/* @__PURE__ */ (0,
|
|
11738
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
11539
11739
|
LinkInputPopover,
|
|
11540
11740
|
{
|
|
11541
11741
|
defaultValue: (_d = state == null ? void 0 : state.linkUrl) != null ? _d : "",
|
|
@@ -11551,8 +11751,8 @@ function TextBubbleContent(props) {
|
|
|
11551
11751
|
isVariable: state.isUrlVariable
|
|
11552
11752
|
}
|
|
11553
11753
|
),
|
|
11554
|
-
/* @__PURE__ */ (0,
|
|
11555
|
-
/* @__PURE__ */ (0,
|
|
11754
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Divider, {}),
|
|
11755
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
11556
11756
|
ColorPicker,
|
|
11557
11757
|
{
|
|
11558
11758
|
color: state.currentTextColor,
|
|
@@ -11561,16 +11761,16 @@ function TextBubbleContent(props) {
|
|
|
11561
11761
|
},
|
|
11562
11762
|
tooltip: "Text Color",
|
|
11563
11763
|
suggestedColors,
|
|
11564
|
-
children: /* @__PURE__ */ (0,
|
|
11764
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
11565
11765
|
BaseButton,
|
|
11566
11766
|
{
|
|
11567
11767
|
variant: "ghost",
|
|
11568
11768
|
size: "sm",
|
|
11569
11769
|
type: "button",
|
|
11570
11770
|
className: "mly:h-7 mly:w-7 mly:shrink-0 mly:p-0",
|
|
11571
|
-
children: /* @__PURE__ */ (0,
|
|
11572
|
-
/* @__PURE__ */ (0,
|
|
11573
|
-
/* @__PURE__ */ (0,
|
|
11771
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "mly:flex mly:flex-col mly:items-center mly:justify-center mly:gap-px", children: [
|
|
11772
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "mly:font-bolder mly:font-mono mly:text-xs mly:text-slate-700", children: "A" }),
|
|
11773
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
11574
11774
|
"div",
|
|
11575
11775
|
{
|
|
11576
11776
|
className: "mly:h-[2px] mly:w-3",
|
|
@@ -11588,7 +11788,7 @@ function TextBubbleContent(props) {
|
|
|
11588
11788
|
// src/editor/components/text-menu/turn-into-block.tsx
|
|
11589
11789
|
var import_lucide_react30 = require("lucide-react");
|
|
11590
11790
|
var import_react62 = require("react");
|
|
11591
|
-
var
|
|
11791
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
11592
11792
|
var isOption = (option) => option.type === "option";
|
|
11593
11793
|
var isCategory = (option) => option.type === "category";
|
|
11594
11794
|
function TurnIntoBlock(props) {
|
|
@@ -11598,23 +11798,23 @@ function TurnIntoBlock(props) {
|
|
|
11598
11798
|
[options]
|
|
11599
11799
|
);
|
|
11600
11800
|
const { icon: ActiveIcon = import_lucide_react30.PilcrowIcon } = activeItem || {};
|
|
11601
|
-
return /* @__PURE__ */ (0,
|
|
11602
|
-
/* @__PURE__ */ (0,
|
|
11603
|
-
/* @__PURE__ */ (0,
|
|
11801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(Popover, { children: [
|
|
11802
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(Tooltip, { children: [
|
|
11803
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
11604
11804
|
PopoverTrigger,
|
|
11605
11805
|
{
|
|
11606
11806
|
className: cn(
|
|
11607
11807
|
"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"
|
|
11608
11808
|
),
|
|
11609
11809
|
children: [
|
|
11610
|
-
/* @__PURE__ */ (0,
|
|
11611
|
-
/* @__PURE__ */ (0,
|
|
11810
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(ActiveIcon, { className: "mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5]" }),
|
|
11811
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_lucide_react30.ChevronDownIcon, { className: "mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5]" })
|
|
11612
11812
|
]
|
|
11613
11813
|
}
|
|
11614
11814
|
) }),
|
|
11615
|
-
/* @__PURE__ */ (0,
|
|
11815
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(TooltipContent, { sideOffset: 8, children: "Turn into" })
|
|
11616
11816
|
] }),
|
|
11617
|
-
/* @__PURE__ */ (0,
|
|
11817
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
11618
11818
|
PopoverContent,
|
|
11619
11819
|
{
|
|
11620
11820
|
align: "start",
|
|
@@ -11623,21 +11823,21 @@ function TurnIntoBlock(props) {
|
|
|
11623
11823
|
className: "mly:flex mly:w-[160px] mly:flex-col mly:rounded-md mly:p-1",
|
|
11624
11824
|
children: options.map((option, index) => {
|
|
11625
11825
|
if (isOption(option)) {
|
|
11626
|
-
return /* @__PURE__ */ (0,
|
|
11826
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
11627
11827
|
BaseButton,
|
|
11628
11828
|
{
|
|
11629
11829
|
onClick: option.onClick,
|
|
11630
11830
|
variant: "ghost",
|
|
11631
11831
|
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",
|
|
11632
11832
|
children: [
|
|
11633
|
-
/* @__PURE__ */ (0,
|
|
11833
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(option.icon, { className: "mly:size-[15px] mly:shrink-0" }),
|
|
11634
11834
|
option.label
|
|
11635
11835
|
]
|
|
11636
11836
|
},
|
|
11637
11837
|
option.id
|
|
11638
11838
|
);
|
|
11639
11839
|
} else if (isCategory(option)) {
|
|
11640
|
-
return /* @__PURE__ */ (0,
|
|
11840
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
11641
11841
|
"label",
|
|
11642
11842
|
{
|
|
11643
11843
|
className: cn(
|
|
@@ -11742,7 +11942,7 @@ function useTurnIntoBlockOptions(editor) {
|
|
|
11742
11942
|
}
|
|
11743
11943
|
|
|
11744
11944
|
// src/editor/components/text-menu/text-bubble-menu.tsx
|
|
11745
|
-
var
|
|
11945
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
11746
11946
|
function TextBubbleMenu(props) {
|
|
11747
11947
|
const { editor, appendTo } = props;
|
|
11748
11948
|
if (!editor) {
|
|
@@ -11793,14 +11993,14 @@ function TextBubbleMenu(props) {
|
|
|
11793
11993
|
}
|
|
11794
11994
|
});
|
|
11795
11995
|
const turnIntoBlockOptions = useTurnIntoBlockOptions(editor);
|
|
11796
|
-
return /* @__PURE__ */ (0,
|
|
11996
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
11797
11997
|
import_react64.BubbleMenu,
|
|
11798
11998
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
11799
11999
|
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",
|
|
11800
|
-
children: /* @__PURE__ */ (0,
|
|
11801
|
-
/* @__PURE__ */ (0,
|
|
11802
|
-
/* @__PURE__ */ (0,
|
|
11803
|
-
/* @__PURE__ */ (0,
|
|
12000
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(TooltipProvider, { children: [
|
|
12001
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TurnIntoBlock, { options: turnIntoBlockOptions }),
|
|
12002
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Divider, { className: "mly:mx-0" }),
|
|
12003
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(TextBubbleContent, { editor })
|
|
11804
12004
|
] })
|
|
11805
12005
|
})
|
|
11806
12006
|
);
|
|
@@ -11809,7 +12009,7 @@ function TextBubbleMenu(props) {
|
|
|
11809
12009
|
// src/editor/components/variable-menu/variable-bubble-menu.tsx
|
|
11810
12010
|
var import_react65 = require("@tiptap/react");
|
|
11811
12011
|
var import_tippy10 = require("tippy.js");
|
|
11812
|
-
var
|
|
12012
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
11813
12013
|
function VariableBubbleMenu(props) {
|
|
11814
12014
|
const { editor, appendTo } = props;
|
|
11815
12015
|
if (!editor) {
|
|
@@ -11832,11 +12032,11 @@ function VariableBubbleMenu(props) {
|
|
|
11832
12032
|
placement: "top-start"
|
|
11833
12033
|
}
|
|
11834
12034
|
});
|
|
11835
|
-
return /* @__PURE__ */ (0,
|
|
12035
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
11836
12036
|
import_react65.BubbleMenu,
|
|
11837
12037
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
11838
12038
|
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",
|
|
11839
|
-
children: /* @__PURE__ */ (0,
|
|
12039
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(TextBubbleContent, { showListMenu: false, editor }) })
|
|
11840
12040
|
})
|
|
11841
12041
|
);
|
|
11842
12042
|
}
|
|
@@ -11922,7 +12122,7 @@ function replaceDeprecatedNode(json) {
|
|
|
11922
12122
|
}
|
|
11923
12123
|
|
|
11924
12124
|
// src/editor/index.tsx
|
|
11925
|
-
var
|
|
12125
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
11926
12126
|
function Editor13(props) {
|
|
11927
12127
|
const {
|
|
11928
12128
|
config: {
|
|
@@ -11995,7 +12195,7 @@ function Editor13(props) {
|
|
|
11995
12195
|
if (!editor) {
|
|
11996
12196
|
return null;
|
|
11997
12197
|
}
|
|
11998
|
-
return /* @__PURE__ */ (0,
|
|
12198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(MailyProvider, { placeholderUrl, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
11999
12199
|
"div",
|
|
12000
12200
|
{
|
|
12001
12201
|
id: "mly-editor",
|
|
@@ -12006,8 +12206,8 @@ function Editor13(props) {
|
|
|
12006
12206
|
),
|
|
12007
12207
|
ref: menuContainerRef,
|
|
12008
12208
|
children: [
|
|
12009
|
-
hasMenuBar && /* @__PURE__ */ (0,
|
|
12010
|
-
/* @__PURE__ */ (0,
|
|
12209
|
+
hasMenuBar && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(EditorMenuBar, { config: props.config, editor }),
|
|
12210
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
12011
12211
|
"div",
|
|
12012
12212
|
{
|
|
12013
12213
|
className: cn(
|
|
@@ -12015,17 +12215,17 @@ function Editor13(props) {
|
|
|
12015
12215
|
bodyClassName
|
|
12016
12216
|
),
|
|
12017
12217
|
children: [
|
|
12018
|
-
/* @__PURE__ */ (0,
|
|
12019
|
-
/* @__PURE__ */ (0,
|
|
12020
|
-
/* @__PURE__ */ (0,
|
|
12021
|
-
/* @__PURE__ */ (0,
|
|
12022
|
-
/* @__PURE__ */ (0,
|
|
12023
|
-
/* @__PURE__ */ (0,
|
|
12024
|
-
!hideContextMenu && /* @__PURE__ */ (0,
|
|
12025
|
-
/* @__PURE__ */ (0,
|
|
12026
|
-
/* @__PURE__ */ (0,
|
|
12027
|
-
/* @__PURE__ */ (0,
|
|
12028
|
-
/* @__PURE__ */ (0,
|
|
12218
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(TextBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
12219
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ImageBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
12220
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(SpacerBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
12221
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react66.EditorContent, { editor }),
|
|
12222
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(SectionBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
12223
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ColumnsBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
12224
|
+
!hideContextMenu && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ContentMenu, { editor }),
|
|
12225
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(VariableBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
12226
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(RepeatBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
12227
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(HTMLBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
12228
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(InlineImageBubbleMenu, { editor, appendTo: menuContainerRef })
|
|
12029
12229
|
]
|
|
12030
12230
|
}
|
|
12031
12231
|
)
|