@daisychainapp/maily-to-core 0.3.6 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/extensions/index.cjs +36 -84
- package/dist/extensions/index.cjs.map +1 -1
- package/dist/extensions/index.mjs +35 -83
- package/dist/extensions/index.mjs.map +1 -1
- package/dist/index.cjs +702 -857
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1909 -1881
- package/dist/index.css.map +1 -1
- package/dist/index.mjs +548 -703
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
package/dist/index.mjs
CHANGED
|
@@ -53,7 +53,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
53
53
|
|
|
54
54
|
// src/editor/index.tsx
|
|
55
55
|
import { EditorContent, useEditor } from "@tiptap/react";
|
|
56
|
-
import { useMemo as
|
|
56
|
+
import { useMemo as useMemo12, useRef as useRef13 } from "react";
|
|
57
57
|
|
|
58
58
|
// src/editor/components/column-menu/columns-bubble-menu.tsx
|
|
59
59
|
import { BubbleMenu } from "@tiptap/react";
|
|
@@ -4050,16 +4050,16 @@ function Select(props) {
|
|
|
4050
4050
|
placeholder
|
|
4051
4051
|
} = props;
|
|
4052
4052
|
const selectId = `mly${useId()}`;
|
|
4053
|
-
const content = /* @__PURE__ */ jsxs5("div", { className: "mly:relative", children: [
|
|
4053
|
+
const content = /* @__PURE__ */ jsxs5("div", { className: "mly:relative mly:inline-flex mly:h-7 mly:items-center mly:overflow-hidden", children: [
|
|
4054
4054
|
/* @__PURE__ */ jsx10("label", { htmlFor: selectId, className: "mly:sr-only", children: label }),
|
|
4055
|
-
Icon && /* @__PURE__ */ jsx10("div", { className: "mly:pointer-events-none mly:absolute mly:
|
|
4055
|
+
Icon && /* @__PURE__ */ jsx10("div", { className: "mly:pointer-events-none mly:absolute mly:left-2 mly:top-1/2 mly:z-20 mly:flex mly:h-7 mly:-translate-y-1/2 mly:items-center", children: /* @__PURE__ */ jsx10(Icon, { className: cn("mly:size-3.5", iconClassName) }) }),
|
|
4056
4056
|
/* @__PURE__ */ jsxs5(
|
|
4057
4057
|
"select",
|
|
4058
4058
|
{
|
|
4059
4059
|
id: selectId,
|
|
4060
4060
|
className: cn(
|
|
4061
|
-
"mly-select-padding mly:flex mly:
|
|
4062
|
-
!!Icon && "mly:pl-
|
|
4061
|
+
"mly-select-padding mly:flex mly:h-7 mly:max-w-max mly:appearance-none mly:items-center mly:rounded-md mly:bg-white mly:text-sm mly:leading-none mly:text-midnight-gray mly:ring-offset-white mly:transition-colors 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 mly:active:bg-soft-gray",
|
|
4062
|
+
!!Icon && "mly:pl-[25px]",
|
|
4063
4063
|
className
|
|
4064
4064
|
),
|
|
4065
4065
|
value: value || "",
|
|
@@ -4789,7 +4789,14 @@ function ContentMenu(props) {
|
|
|
4789
4789
|
children: /* @__PURE__ */ jsx14(Plus, { className: "mly:size-3.5 mly:shrink-0" })
|
|
4790
4790
|
}
|
|
4791
4791
|
) }),
|
|
4792
|
-
/* @__PURE__ */ jsx14(
|
|
4792
|
+
/* @__PURE__ */ jsx14(
|
|
4793
|
+
TooltipContent,
|
|
4794
|
+
{
|
|
4795
|
+
sideOffset: 8,
|
|
4796
|
+
className: "mly:border-gray-300 mly:bg-transparent mly:p-0 mly:text-gray-700 mly:shadow-sm",
|
|
4797
|
+
children: /* @__PURE__ */ jsx14("span", { className: "mly:block mly:rounded-md mly:bg-soft-gray mly:!px-2 mly:!py-1.5", children: "Add new node" })
|
|
4798
|
+
}
|
|
4799
|
+
)
|
|
4793
4800
|
] }),
|
|
4794
4801
|
/* @__PURE__ */ jsxs7(Popover, { open: menuOpen, onOpenChange: setMenuOpen, children: [
|
|
4795
4802
|
/* @__PURE__ */ jsxs7("div", { className: "mly:relative mly:flex mly:flex-col", children: [
|
|
@@ -4809,7 +4816,14 @@ function ContentMenu(props) {
|
|
|
4809
4816
|
children: /* @__PURE__ */ jsx14(GripVertical, { className: "mly:size-3.5 mly:shrink-0" })
|
|
4810
4817
|
}
|
|
4811
4818
|
) }),
|
|
4812
|
-
/* @__PURE__ */ jsx14(
|
|
4819
|
+
/* @__PURE__ */ jsx14(
|
|
4820
|
+
TooltipContent,
|
|
4821
|
+
{
|
|
4822
|
+
sideOffset: 8,
|
|
4823
|
+
className: "mly:border-gray-300 mly:bg-transparent mly:p-0 mly:text-gray-700 mly:shadow-sm",
|
|
4824
|
+
children: /* @__PURE__ */ jsx14("span", { className: "mly:block mly:rounded-md mly:bg-soft-gray mly:!px-2 mly:!py-1.5", children: "Node actions" })
|
|
4825
|
+
}
|
|
4826
|
+
)
|
|
4813
4827
|
] }),
|
|
4814
4828
|
/* @__PURE__ */ jsx14(PopoverTrigger, { className: "mly:absolute mly:left-0 mly:top-0 mly:z-0 mly:h-5 mly:w-5" })
|
|
4815
4829
|
] }),
|
|
@@ -4819,14 +4833,14 @@ function ContentMenu(props) {
|
|
|
4819
4833
|
align: "start",
|
|
4820
4834
|
side: "bottom",
|
|
4821
4835
|
sideOffset: 8,
|
|
4822
|
-
className: "mly:flex mly:w-max mly:flex-col mly:rounded-md mly:p-1",
|
|
4836
|
+
className: "mly:flex mly:w-max mly:flex-col mly:rounded-md mly:border mly:border-gray-200 mly:bg-white mly:p-1 mly:shadow-md",
|
|
4823
4837
|
children: [
|
|
4824
4838
|
/* @__PURE__ */ jsxs7(
|
|
4825
4839
|
BaseButton,
|
|
4826
4840
|
{
|
|
4827
4841
|
variant: "ghost",
|
|
4828
4842
|
onClick: duplicateNode,
|
|
4829
|
-
className: "mly:h-auto mly:justify-start mly:gap-2 mly:rounded! mly
|
|
4843
|
+
className: "mly:h-auto mly:justify-start mly:gap-2 mly:rounded! mly:!px-2 mly:!py-1.5 mly:text-sm mly:font-normal mly:hover:bg-soft-gray",
|
|
4830
4844
|
children: [
|
|
4831
4845
|
/* @__PURE__ */ jsx14(Copy, { className: "mly:size-[15px] mly:shrink-0" }),
|
|
4832
4846
|
"Duplicate"
|
|
@@ -4838,7 +4852,7 @@ function ContentMenu(props) {
|
|
|
4838
4852
|
BaseButton,
|
|
4839
4853
|
{
|
|
4840
4854
|
onClick: deleteCurrentNode,
|
|
4841
|
-
className: "mly:h-auto mly:justify-start mly:gap-2 mly:rounded! mly:bg-red-100 mly
|
|
4855
|
+
className: "mly:h-auto mly:justify-start mly:gap-2 mly:rounded! mly:bg-red-100 mly:!px-2 mly:!py-1.5 mly:text-sm mly:font-normal mly:text-red-600 mly:hover:bg-red-200 mly:focus:bg-red-200",
|
|
4842
4856
|
children: [
|
|
4843
4857
|
/* @__PURE__ */ jsx14(Trash2, { className: "mly:size-[15px] mly:shrink-0" }),
|
|
4844
4858
|
"Delete"
|
|
@@ -4983,126 +4997,6 @@ var EditorMenuBar = (props) => {
|
|
|
4983
4997
|
);
|
|
4984
4998
|
};
|
|
4985
4999
|
|
|
4986
|
-
// src/editor/components/html-menu/html-menu.tsx
|
|
4987
|
-
import { BubbleMenu as BubbleMenu2 } from "@tiptap/react";
|
|
4988
|
-
import { CodeXmlIcon, ViewIcon } from "lucide-react";
|
|
4989
|
-
import { useCallback as useCallback4 } from "react";
|
|
4990
|
-
import { sticky as sticky2 } from "tippy.js";
|
|
4991
|
-
|
|
4992
|
-
// src/editor/components/html-menu/use-html-state.ts
|
|
4993
|
-
import { useEditorState as useEditorState2 } from "@tiptap/react";
|
|
4994
|
-
import deepEql2 from "fast-deep-equal";
|
|
4995
|
-
var useHtmlState = (editor) => {
|
|
4996
|
-
const states = useEditorState2({
|
|
4997
|
-
editor,
|
|
4998
|
-
selector: (ctx) => {
|
|
4999
|
-
var _a, _b;
|
|
5000
|
-
return {
|
|
5001
|
-
activeTab: ((_a = ctx.editor.getAttributes("htmlCodeBlock")) == null ? void 0 : _a.activeTab) || "code",
|
|
5002
|
-
currentShowIfKey: ((_b = ctx.editor.getAttributes("htmlCodeBlock")) == null ? void 0 : _b.showIfKey) || ""
|
|
5003
|
-
};
|
|
5004
|
-
},
|
|
5005
|
-
equalityFn: deepEql2
|
|
5006
|
-
});
|
|
5007
|
-
return states;
|
|
5008
|
-
};
|
|
5009
|
-
|
|
5010
|
-
// src/editor/components/html-menu/html-menu.tsx
|
|
5011
|
-
import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
5012
|
-
function HTMLBubbleMenu(props) {
|
|
5013
|
-
const { appendTo, editor } = props;
|
|
5014
|
-
if (!editor) {
|
|
5015
|
-
return null;
|
|
5016
|
-
}
|
|
5017
|
-
const state = useHtmlState(editor);
|
|
5018
|
-
const getReferenceClientRect = useCallback4(() => {
|
|
5019
|
-
const renderContainer = getRenderContainer(editor, "htmlCodeBlock");
|
|
5020
|
-
const rect = (renderContainer == null ? void 0 : renderContainer.getBoundingClientRect()) || new DOMRect(-1e3, -1e3, 0, 0);
|
|
5021
|
-
return rect;
|
|
5022
|
-
}, [editor]);
|
|
5023
|
-
const bubbleMenuProps = __spreadProps(__spreadValues(__spreadValues({}, props), appendTo ? { appendTo: appendTo.current } : {}), {
|
|
5024
|
-
shouldShow: ({ editor: editor2 }) => {
|
|
5025
|
-
return editor2.isActive("htmlCodeBlock");
|
|
5026
|
-
},
|
|
5027
|
-
tippyOptions: {
|
|
5028
|
-
offset: [0, 8],
|
|
5029
|
-
popperOptions: {
|
|
5030
|
-
modifiers: [{ name: "flip", enabled: false }]
|
|
5031
|
-
},
|
|
5032
|
-
getReferenceClientRect,
|
|
5033
|
-
appendTo: () => appendTo == null ? void 0 : appendTo.current,
|
|
5034
|
-
plugins: [sticky2],
|
|
5035
|
-
sticky: "popper",
|
|
5036
|
-
maxWidth: "auto"
|
|
5037
|
-
},
|
|
5038
|
-
pluginKey: "htmlCodeBlockBubbleMenu"
|
|
5039
|
-
});
|
|
5040
|
-
const { activeTab = "code" } = state;
|
|
5041
|
-
return /* @__PURE__ */ jsx16(
|
|
5042
|
-
BubbleMenu2,
|
|
5043
|
-
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
5044
|
-
className: "mly:flex mly:items-stretch mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:p-0.5 mly:shadow-md",
|
|
5045
|
-
children: /* @__PURE__ */ jsxs8(TooltipProvider, { children: [
|
|
5046
|
-
/* @__PURE__ */ jsxs8("div", { className: "mly:flex mly:items-center mly:h-7 mly:rounded-md mly:bg-soft-gray mly:px-0.5", children: [
|
|
5047
|
-
/* @__PURE__ */ jsxs8(Tooltip, { children: [
|
|
5048
|
-
/* @__PURE__ */ jsx16(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx16(
|
|
5049
|
-
"button",
|
|
5050
|
-
{
|
|
5051
|
-
className: cn(
|
|
5052
|
-
"mly:flex mly:size-6 mly:shrink-0 mly:items-center mly:justify-center mly:rounded 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",
|
|
5053
|
-
activeTab === "code" && "mly:bg-white"
|
|
5054
|
-
),
|
|
5055
|
-
disabled: activeTab === "code",
|
|
5056
|
-
onClick: () => {
|
|
5057
|
-
var _a;
|
|
5058
|
-
(_a = editor == null ? void 0 : editor.commands) == null ? void 0 : _a.updateHtmlCodeBlock({
|
|
5059
|
-
activeTab: "code"
|
|
5060
|
-
});
|
|
5061
|
-
},
|
|
5062
|
-
children: /* @__PURE__ */ jsx16(CodeXmlIcon, { className: "mly:size-3 mly:shrink-0 mly:stroke-[2.5]" })
|
|
5063
|
-
}
|
|
5064
|
-
) }),
|
|
5065
|
-
/* @__PURE__ */ jsx16(TooltipContent, { sideOffset: 8, children: "HTML Code" })
|
|
5066
|
-
] }),
|
|
5067
|
-
/* @__PURE__ */ jsxs8(Tooltip, { children: [
|
|
5068
|
-
/* @__PURE__ */ jsx16(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx16(
|
|
5069
|
-
"button",
|
|
5070
|
-
{
|
|
5071
|
-
className: cn(
|
|
5072
|
-
"mly:flex mly:size-6 mly:shrink-0 mly:items-center mly:justify-center mly:rounded 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",
|
|
5073
|
-
activeTab === "preview" && "mly:bg-white"
|
|
5074
|
-
),
|
|
5075
|
-
disabled: activeTab === "preview",
|
|
5076
|
-
onClick: () => {
|
|
5077
|
-
var _a;
|
|
5078
|
-
(_a = editor == null ? void 0 : editor.commands) == null ? void 0 : _a.updateHtmlCodeBlock({
|
|
5079
|
-
activeTab: "preview"
|
|
5080
|
-
});
|
|
5081
|
-
},
|
|
5082
|
-
children: /* @__PURE__ */ jsx16(ViewIcon, { className: "mly:size-3 mly:shrink-0 mly:stroke-[2.5]" })
|
|
5083
|
-
}
|
|
5084
|
-
) }),
|
|
5085
|
-
/* @__PURE__ */ jsx16(TooltipContent, { sideOffset: 8, children: "Preview" })
|
|
5086
|
-
] })
|
|
5087
|
-
] }),
|
|
5088
|
-
/* @__PURE__ */ jsx16(Divider, {}),
|
|
5089
|
-
/* @__PURE__ */ jsx16(
|
|
5090
|
-
ShowPopover,
|
|
5091
|
-
{
|
|
5092
|
-
showIfKey: state.currentShowIfKey,
|
|
5093
|
-
onShowIfKeyValueChange: (value) => {
|
|
5094
|
-
editor.commands.updateHtmlCodeBlock({
|
|
5095
|
-
showIfKey: value
|
|
5096
|
-
});
|
|
5097
|
-
},
|
|
5098
|
-
editor
|
|
5099
|
-
}
|
|
5100
|
-
)
|
|
5101
|
-
] })
|
|
5102
|
-
})
|
|
5103
|
-
);
|
|
5104
|
-
}
|
|
5105
|
-
|
|
5106
5000
|
// src/editor/nodes/logo/logo.ts
|
|
5107
5001
|
import TiptapImage from "@tiptap/extension-image";
|
|
5108
5002
|
import { ReactNodeViewRenderer } from "@tiptap/react";
|
|
@@ -5407,12 +5301,12 @@ var SectionExtension = Node3.create({
|
|
|
5407
5301
|
|
|
5408
5302
|
// src/editor/nodes/logo/logo-view.tsx
|
|
5409
5303
|
import { NodeViewWrapper as NodeViewWrapper2 } from "@tiptap/react";
|
|
5410
|
-
import { useCallback as
|
|
5304
|
+
import { useCallback as useCallback6, useEffect as useEffect5 } from "react";
|
|
5411
5305
|
import { useState as useState5 } from "react";
|
|
5412
5306
|
|
|
5413
5307
|
// src/editor/nodes/image/image-view.tsx
|
|
5414
5308
|
import {
|
|
5415
|
-
useCallback as
|
|
5309
|
+
useCallback as useCallback5,
|
|
5416
5310
|
useEffect as useEffect4,
|
|
5417
5311
|
useRef as useRef5,
|
|
5418
5312
|
useState as useState4
|
|
@@ -5556,13 +5450,13 @@ function useImageUploadOptions(editor) {
|
|
|
5556
5450
|
}
|
|
5557
5451
|
|
|
5558
5452
|
// src/editor/utils/use-event.ts
|
|
5559
|
-
import { useCallback as
|
|
5453
|
+
import { useCallback as useCallback4, useLayoutEffect, useRef as useRef4 } from "react";
|
|
5560
5454
|
var useEvent = (handler) => {
|
|
5561
5455
|
const handlerRef = useRef4(null);
|
|
5562
5456
|
useLayoutEffect(() => {
|
|
5563
5457
|
handlerRef.current = handler;
|
|
5564
5458
|
}, [handler]);
|
|
5565
|
-
return
|
|
5459
|
+
return useCallback4((...args) => {
|
|
5566
5460
|
if (handlerRef.current === null) {
|
|
5567
5461
|
throw new Error("Handler is not assigned");
|
|
5568
5462
|
}
|
|
@@ -5585,7 +5479,7 @@ function getNewWidth(height, aspectRatio) {
|
|
|
5585
5479
|
}
|
|
5586
5480
|
|
|
5587
5481
|
// src/editor/nodes/image/image-view.tsx
|
|
5588
|
-
import { Fragment as Fragment3, jsx as
|
|
5482
|
+
import { Fragment as Fragment3, jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
5589
5483
|
var MIN_WIDTH = 20;
|
|
5590
5484
|
var IMAGE_MAX_WIDTH = 600;
|
|
5591
5485
|
var IMAGE_MAX_HEIGHT = 400;
|
|
@@ -5654,12 +5548,12 @@ function ImageView(props) {
|
|
|
5654
5548
|
window.addEventListener("mouseup", removeListeners);
|
|
5655
5549
|
}
|
|
5656
5550
|
);
|
|
5657
|
-
const dragCornerButton =
|
|
5551
|
+
const dragCornerButton = useCallback5(
|
|
5658
5552
|
(direction) => {
|
|
5659
5553
|
if (isPlaceholderImage) {
|
|
5660
5554
|
return null;
|
|
5661
5555
|
}
|
|
5662
|
-
return /* @__PURE__ */
|
|
5556
|
+
return /* @__PURE__ */ jsx16(
|
|
5663
5557
|
"div",
|
|
5664
5558
|
{
|
|
5665
5559
|
role: "button",
|
|
@@ -5712,7 +5606,7 @@ function ImageView(props) {
|
|
|
5712
5606
|
const file = e.target.files[0];
|
|
5713
5607
|
yield handleImageUpload(file);
|
|
5714
5608
|
});
|
|
5715
|
-
const handleImageUpload =
|
|
5609
|
+
const handleImageUpload = useCallback5(
|
|
5716
5610
|
(file) => __async(this, null, function* () {
|
|
5717
5611
|
if (!isDroppable) {
|
|
5718
5612
|
return;
|
|
@@ -5768,7 +5662,7 @@ function ImageView(props) {
|
|
|
5768
5662
|
img.onerror = null;
|
|
5769
5663
|
};
|
|
5770
5664
|
}, [src]);
|
|
5771
|
-
const handleDragOver =
|
|
5665
|
+
const handleDragOver = useCallback5(
|
|
5772
5666
|
(e) => {
|
|
5773
5667
|
if (!isDroppable) {
|
|
5774
5668
|
return;
|
|
@@ -5779,7 +5673,7 @@ function ImageView(props) {
|
|
|
5779
5673
|
},
|
|
5780
5674
|
[onImageUpload]
|
|
5781
5675
|
);
|
|
5782
|
-
const handleDragLeave =
|
|
5676
|
+
const handleDragLeave = useCallback5(
|
|
5783
5677
|
(e) => {
|
|
5784
5678
|
if (!isDroppable) {
|
|
5785
5679
|
return;
|
|
@@ -5790,7 +5684,7 @@ function ImageView(props) {
|
|
|
5790
5684
|
},
|
|
5791
5685
|
[onImageUpload]
|
|
5792
5686
|
);
|
|
5793
|
-
const handleDrop =
|
|
5687
|
+
const handleDrop = useCallback5(
|
|
5794
5688
|
(e) => __async(this, null, function* () {
|
|
5795
5689
|
var _a2;
|
|
5796
5690
|
if (!isDroppable) {
|
|
@@ -5811,7 +5705,11 @@ function ImageView(props) {
|
|
|
5811
5705
|
}),
|
|
5812
5706
|
[handleImageUpload]
|
|
5813
5707
|
);
|
|
5814
|
-
|
|
5708
|
+
const widthValue = width && width !== "auto" ? `${width}px` : void 0;
|
|
5709
|
+
const heightValue = height && height !== "auto" ? `${height}px` : void 0;
|
|
5710
|
+
const hasExplicitWidth = Boolean(widthValue || (resizingStyle == null ? void 0 : resizingStyle.width));
|
|
5711
|
+
const hasExplicitHeight = Boolean(heightValue || (resizingStyle == null ? void 0 : resizingStyle.height));
|
|
5712
|
+
return /* @__PURE__ */ jsxs8(
|
|
5815
5713
|
NodeViewWrapper,
|
|
5816
5714
|
__spreadProps(__spreadValues({
|
|
5817
5715
|
as: "div",
|
|
@@ -5819,13 +5717,13 @@ function ImageView(props) {
|
|
|
5819
5717
|
"data-drag-handle": editor.isEditable,
|
|
5820
5718
|
className: cn("mly-image-drop-zone", isDraggingOver && "mly-drag-over"),
|
|
5821
5719
|
style: __spreadValues(__spreadProps(__spreadValues({}, hasImageSrc && status === "loaded" ? __spreadValues({
|
|
5822
|
-
width:
|
|
5823
|
-
height:
|
|
5720
|
+
width: widthValue,
|
|
5721
|
+
height: heightValue
|
|
5824
5722
|
}, resizingStyle) : {}), {
|
|
5825
5723
|
overflow: "hidden",
|
|
5826
5724
|
position: "relative",
|
|
5827
5725
|
// Weird! Basically tiptap/prose wraps this in a span and the line height causes an annoying buffer.
|
|
5828
|
-
lineHeight: "
|
|
5726
|
+
lineHeight: "normal",
|
|
5829
5727
|
display: "block",
|
|
5830
5728
|
maxWidth: "100%"
|
|
5831
5729
|
}), {
|
|
@@ -5840,7 +5738,7 @@ function ImageView(props) {
|
|
|
5840
5738
|
onDrop: handleDrop
|
|
5841
5739
|
} : {}), {
|
|
5842
5740
|
children: [
|
|
5843
|
-
!hasImageSrc && status === "idle" && /* @__PURE__ */
|
|
5741
|
+
!hasImageSrc && status === "idle" && /* @__PURE__ */ jsx16(
|
|
5844
5742
|
ImageStatusLabel,
|
|
5845
5743
|
{
|
|
5846
5744
|
status: "idle",
|
|
@@ -5848,32 +5746,34 @@ function ImageView(props) {
|
|
|
5848
5746
|
isDropZone: isDroppable
|
|
5849
5747
|
}
|
|
5850
5748
|
),
|
|
5851
|
-
!hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */
|
|
5852
|
-
hasImageSrc && isSrcVariable && /* @__PURE__ */
|
|
5853
|
-
hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */
|
|
5854
|
-
hasImageSrc && status === "error" && !isSrcVariable && /* @__PURE__ */
|
|
5855
|
-
isDroppable && /* @__PURE__ */
|
|
5749
|
+
!hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */ jsx16(ImageStatusLabel, { status: "loading", minHeight: height }),
|
|
5750
|
+
hasImageSrc && isSrcVariable && /* @__PURE__ */ jsx16(ImageStatusLabel, { status: "variable", minHeight: height }),
|
|
5751
|
+
hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */ jsx16(ImageStatusLabel, { status: "loading", minHeight: height }),
|
|
5752
|
+
hasImageSrc && status === "error" && !isSrcVariable && /* @__PURE__ */ jsx16(ImageStatusLabel, { status: "error", minHeight: height }),
|
|
5753
|
+
isDroppable && /* @__PURE__ */ jsx16(
|
|
5856
5754
|
"input",
|
|
5857
5755
|
{
|
|
5858
5756
|
type: "file",
|
|
5859
5757
|
accept: "image/*",
|
|
5860
5758
|
onChange: handleFileChange,
|
|
5861
|
-
className: "mly:absolute mly:inset-0 mly:opacity-0",
|
|
5759
|
+
className: "mly:absolute mly:inset-0 mly:z-10 mly:h-full mly:w-full mly:cursor-pointer mly:appearance-none mly:bg-transparent mly:opacity-0 mly:text-transparent",
|
|
5862
5760
|
multiple: false
|
|
5863
5761
|
}
|
|
5864
5762
|
),
|
|
5865
|
-
hasImageSrc && status === "loaded" && !isSrcVariable && /* @__PURE__ */
|
|
5866
|
-
/* @__PURE__ */
|
|
5763
|
+
hasImageSrc && status === "loaded" && !isSrcVariable && /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
5764
|
+
/* @__PURE__ */ jsx16(
|
|
5867
5765
|
"img",
|
|
5868
5766
|
__spreadProps(__spreadValues({}, attrs), {
|
|
5869
5767
|
ref: imgRef,
|
|
5870
5768
|
style: __spreadProps(__spreadValues({}, resizingStyle), {
|
|
5871
5769
|
cursor: "default",
|
|
5872
|
-
objectFit: "
|
|
5770
|
+
objectFit: "contain",
|
|
5873
5771
|
marginBottom: 0,
|
|
5874
5772
|
borderRadius: borderRadius2,
|
|
5875
|
-
width: (resizingStyle == null ? void 0 : resizingStyle.width) ? `${resizingStyle.width}px` :
|
|
5876
|
-
height: (resizingStyle == null ? void 0 : resizingStyle.height) ? `${resizingStyle.height}px` :
|
|
5773
|
+
width: (resizingStyle == null ? void 0 : resizingStyle.width) ? `${resizingStyle.width}px` : widthValue != null ? widthValue : "100%",
|
|
5774
|
+
height: (resizingStyle == null ? void 0 : resizingStyle.height) ? `${resizingStyle.height}px` : heightValue != null ? heightValue : "auto",
|
|
5775
|
+
maxWidth: hasExplicitWidth ? void 0 : "100%",
|
|
5776
|
+
maxHeight: hasExplicitHeight ? void 0 : "none"
|
|
5877
5777
|
}),
|
|
5878
5778
|
draggable: editor.isEditable,
|
|
5879
5779
|
className: cn(
|
|
@@ -5881,13 +5781,13 @@ function ImageView(props) {
|
|
|
5881
5781
|
)
|
|
5882
5782
|
})
|
|
5883
5783
|
),
|
|
5884
|
-
selected && editor.isEditable && !isPlaceholderImage && /* @__PURE__ */
|
|
5784
|
+
selected && editor.isEditable && !isPlaceholderImage && /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
5885
5785
|
[
|
|
5886
5786
|
{ left: 0, top: 0, height: "100%", width: "1px" },
|
|
5887
5787
|
{ right: 0, top: 0, height: "100%", width: "1px" },
|
|
5888
5788
|
{ top: 0, left: 0, width: "100%", height: "1px" },
|
|
5889
5789
|
{ bottom: 0, left: 0, width: "100%", height: "1px" }
|
|
5890
|
-
].map((style, i) => /* @__PURE__ */
|
|
5790
|
+
].map((style, i) => /* @__PURE__ */ jsx16(
|
|
5891
5791
|
"div",
|
|
5892
5792
|
{
|
|
5893
5793
|
className: "mly:bg-rose-500",
|
|
@@ -5909,7 +5809,9 @@ function ImageView(props) {
|
|
|
5909
5809
|
}
|
|
5910
5810
|
function ImageStatusLabel(props) {
|
|
5911
5811
|
const _a = props, { status, minHeight, className, style, isDropZone } = _a, rest = __objRest(_a, ["status", "minHeight", "className", "style", "isDropZone"]);
|
|
5912
|
-
|
|
5812
|
+
const resolvedMinHeight = minHeight != null ? minHeight : isDropZone ? 36 : void 0;
|
|
5813
|
+
const resolvedPaddingY = isDropZone ? 8 : void 0;
|
|
5814
|
+
return /* @__PURE__ */ jsxs8(
|
|
5913
5815
|
"div",
|
|
5914
5816
|
__spreadProps(__spreadValues({}, rest), {
|
|
5915
5817
|
className: cn(
|
|
@@ -5920,29 +5822,32 @@ function ImageStatusLabel(props) {
|
|
|
5920
5822
|
},
|
|
5921
5823
|
className
|
|
5922
5824
|
),
|
|
5923
|
-
style: __spreadValues(__spreadValues({},
|
|
5924
|
-
minHeight
|
|
5825
|
+
style: __spreadValues(__spreadValues(__spreadValues({}, resolvedMinHeight ? {
|
|
5826
|
+
minHeight: resolvedMinHeight
|
|
5827
|
+
} : {}), resolvedPaddingY ? {
|
|
5828
|
+
paddingTop: resolvedPaddingY,
|
|
5829
|
+
paddingBottom: resolvedPaddingY
|
|
5925
5830
|
} : {}), style),
|
|
5926
5831
|
children: [
|
|
5927
|
-
status === "idle" && !isDropZone && /* @__PURE__ */
|
|
5928
|
-
/* @__PURE__ */
|
|
5929
|
-
/* @__PURE__ */
|
|
5832
|
+
status === "idle" && !isDropZone && /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
5833
|
+
/* @__PURE__ */ jsx16(ImageOffIcon, { className: "mly:size-4 mly:stroke-[2.5]" }),
|
|
5834
|
+
/* @__PURE__ */ jsx16("span", { children: "No image selected" })
|
|
5930
5835
|
] }),
|
|
5931
|
-
status === "idle" && isDropZone && /* @__PURE__ */
|
|
5932
|
-
/* @__PURE__ */
|
|
5933
|
-
/* @__PURE__ */
|
|
5836
|
+
status === "idle" && isDropZone && /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
5837
|
+
/* @__PURE__ */ jsx16(GrabIcon, { className: "mly:size-4 mly:stroke-[2.5]" }),
|
|
5838
|
+
/* @__PURE__ */ jsx16("span", { children: "Click or Drop image here" })
|
|
5934
5839
|
] }),
|
|
5935
|
-
status === "loading" && /* @__PURE__ */
|
|
5936
|
-
/* @__PURE__ */
|
|
5937
|
-
/* @__PURE__ */
|
|
5840
|
+
status === "loading" && /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
5841
|
+
/* @__PURE__ */ jsx16(Loader2, { className: "mly:size-4 mly:animate-spin mly:stroke-[2.5]" }),
|
|
5842
|
+
/* @__PURE__ */ jsx16("span", { children: "Loading image..." })
|
|
5938
5843
|
] }),
|
|
5939
|
-
status === "error" && /* @__PURE__ */
|
|
5940
|
-
/* @__PURE__ */
|
|
5941
|
-
/* @__PURE__ */
|
|
5844
|
+
status === "error" && /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
5845
|
+
/* @__PURE__ */ jsx16(Ban, { className: "mly:size-4 mly:stroke-[2.5]" }),
|
|
5846
|
+
/* @__PURE__ */ jsx16("span", { children: "Error loading image" })
|
|
5942
5847
|
] }),
|
|
5943
|
-
status === "variable" && /* @__PURE__ */
|
|
5944
|
-
/* @__PURE__ */
|
|
5945
|
-
/* @__PURE__ */
|
|
5848
|
+
status === "variable" && /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
5849
|
+
/* @__PURE__ */ jsx16(BracesIcon, { className: "mly:size-4 mly:stroke-[2.5]" }),
|
|
5850
|
+
/* @__PURE__ */ jsx16("span", { children: "Variable Image URL" })
|
|
5946
5851
|
] })
|
|
5947
5852
|
]
|
|
5948
5853
|
})
|
|
@@ -5950,7 +5855,7 @@ function ImageStatusLabel(props) {
|
|
|
5950
5855
|
}
|
|
5951
5856
|
|
|
5952
5857
|
// src/editor/nodes/logo/logo-view.tsx
|
|
5953
|
-
import { jsx as
|
|
5858
|
+
import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
5954
5859
|
function LogoView(props) {
|
|
5955
5860
|
const { node, editor, updateAttributes: updateAttributes2 } = props;
|
|
5956
5861
|
const [status, setStatus] = useState5("idle");
|
|
@@ -5972,7 +5877,7 @@ function LogoView(props) {
|
|
|
5972
5877
|
const file = e.target.files[0];
|
|
5973
5878
|
yield handleImageUpload(file);
|
|
5974
5879
|
});
|
|
5975
|
-
const handleImageUpload =
|
|
5880
|
+
const handleImageUpload = useCallback6(
|
|
5976
5881
|
(file) => __async(this, null, function* () {
|
|
5977
5882
|
if (!isDroppable) {
|
|
5978
5883
|
return;
|
|
@@ -5990,7 +5895,7 @@ function LogoView(props) {
|
|
|
5990
5895
|
}),
|
|
5991
5896
|
[onImageUpload, updateAttributes2]
|
|
5992
5897
|
);
|
|
5993
|
-
const handleDragOver =
|
|
5898
|
+
const handleDragOver = useCallback6(
|
|
5994
5899
|
(e) => {
|
|
5995
5900
|
if (!isDroppable) {
|
|
5996
5901
|
return;
|
|
@@ -6001,7 +5906,7 @@ function LogoView(props) {
|
|
|
6001
5906
|
},
|
|
6002
5907
|
[onImageUpload]
|
|
6003
5908
|
);
|
|
6004
|
-
const handleDragLeave =
|
|
5909
|
+
const handleDragLeave = useCallback6(
|
|
6005
5910
|
(e) => {
|
|
6006
5911
|
if (!isDroppable) {
|
|
6007
5912
|
return;
|
|
@@ -6012,7 +5917,7 @@ function LogoView(props) {
|
|
|
6012
5917
|
},
|
|
6013
5918
|
[onImageUpload]
|
|
6014
5919
|
);
|
|
6015
|
-
const handleDrop =
|
|
5920
|
+
const handleDrop = useCallback6(
|
|
6016
5921
|
(e) => __async(this, null, function* () {
|
|
6017
5922
|
var _a;
|
|
6018
5923
|
if (!isDroppable) {
|
|
@@ -6056,7 +5961,7 @@ function LogoView(props) {
|
|
|
6056
5961
|
};
|
|
6057
5962
|
}, [logoSrc]);
|
|
6058
5963
|
const logoSize = logoSizes[size];
|
|
6059
|
-
return /* @__PURE__ */
|
|
5964
|
+
return /* @__PURE__ */ jsxs9(
|
|
6060
5965
|
NodeViewWrapper2,
|
|
6061
5966
|
__spreadProps(__spreadValues({
|
|
6062
5967
|
as: "div",
|
|
@@ -6076,7 +5981,7 @@ function LogoView(props) {
|
|
|
6076
5981
|
onDrop: handleDrop
|
|
6077
5982
|
} : {}), {
|
|
6078
5983
|
children: [
|
|
6079
|
-
!hasImageSrc && status === "idle" && /* @__PURE__ */
|
|
5984
|
+
!hasImageSrc && status === "idle" && /* @__PURE__ */ jsx17(
|
|
6080
5985
|
ImageStatusLabel,
|
|
6081
5986
|
{
|
|
6082
5987
|
status: "idle",
|
|
@@ -6084,11 +5989,11 @@ function LogoView(props) {
|
|
|
6084
5989
|
isDropZone: isDroppable
|
|
6085
5990
|
}
|
|
6086
5991
|
),
|
|
6087
|
-
!hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */
|
|
6088
|
-
hasImageSrc && isSrcVariable && /* @__PURE__ */
|
|
6089
|
-
hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */
|
|
6090
|
-
hasImageSrc && status === "error" && !isSrcVariable && /* @__PURE__ */
|
|
6091
|
-
isDroppable && /* @__PURE__ */
|
|
5992
|
+
!hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */ jsx17(ImageStatusLabel, { status: "loading", minHeight: logoSize }),
|
|
5993
|
+
hasImageSrc && isSrcVariable && /* @__PURE__ */ jsx17(ImageStatusLabel, { status: "variable", minHeight: logoSize }),
|
|
5994
|
+
hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */ jsx17(ImageStatusLabel, { status: "loading", minHeight: logoSize }),
|
|
5995
|
+
hasImageSrc && status === "error" && !isSrcVariable && /* @__PURE__ */ jsx17(ImageStatusLabel, { status: "error", minHeight: logoSize }),
|
|
5996
|
+
isDroppable && /* @__PURE__ */ jsx17(
|
|
6092
5997
|
"input",
|
|
6093
5998
|
{
|
|
6094
5999
|
type: "file",
|
|
@@ -6098,7 +6003,7 @@ function LogoView(props) {
|
|
|
6098
6003
|
multiple: false
|
|
6099
6004
|
}
|
|
6100
6005
|
),
|
|
6101
|
-
hasImageSrc && status === "loaded" && !isSrcVariable && /* @__PURE__ */
|
|
6006
|
+
hasImageSrc && status === "loaded" && !isSrcVariable && /* @__PURE__ */ jsx17(
|
|
6102
6007
|
"img",
|
|
6103
6008
|
{
|
|
6104
6009
|
src: logoSrc,
|
|
@@ -6249,13 +6154,13 @@ var borderRadius = [
|
|
|
6249
6154
|
];
|
|
6250
6155
|
|
|
6251
6156
|
// src/editor/components/image-menu/image-bubble-menu.tsx
|
|
6252
|
-
import { BubbleMenu as
|
|
6157
|
+
import { BubbleMenu as BubbleMenu2 } from "@tiptap/react";
|
|
6253
6158
|
import { ImageDown, LockIcon, LockOpenIcon } from "lucide-react";
|
|
6254
|
-
import { sticky as
|
|
6159
|
+
import { sticky as sticky2 } from "tippy.js";
|
|
6255
6160
|
|
|
6256
6161
|
// src/editor/components/alignment-switch.tsx
|
|
6257
6162
|
import { AlignCenter as AlignCenter2, AlignLeft as AlignLeft2, AlignRight as AlignRight2 } from "lucide-react";
|
|
6258
|
-
import { jsx as
|
|
6163
|
+
import { jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
6259
6164
|
function AlignmentSwitch(props) {
|
|
6260
6165
|
const { alignment: rawAlignment, onAlignmentChange } = props;
|
|
6261
6166
|
const alignment = allowedLogoAlignment.includes(
|
|
@@ -6285,20 +6190,20 @@ function AlignmentSwitch(props) {
|
|
|
6285
6190
|
}
|
|
6286
6191
|
};
|
|
6287
6192
|
const activeAlignment = alignments[alignment];
|
|
6288
|
-
return /* @__PURE__ */
|
|
6289
|
-
/* @__PURE__ */
|
|
6290
|
-
/* @__PURE__ */
|
|
6193
|
+
return /* @__PURE__ */ jsxs10(Popover, { children: [
|
|
6194
|
+
/* @__PURE__ */ jsxs10(Tooltip, { children: [
|
|
6195
|
+
/* @__PURE__ */ jsx18(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx18(
|
|
6291
6196
|
PopoverTrigger,
|
|
6292
6197
|
{
|
|
6293
6198
|
className: cn(
|
|
6294
6199
|
"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"
|
|
6295
6200
|
),
|
|
6296
|
-
children: /* @__PURE__ */
|
|
6201
|
+
children: /* @__PURE__ */ jsx18(activeAlignment.icon, { className: "mly:h-3 mly:w-3 mly:stroke-[2.5]" })
|
|
6297
6202
|
}
|
|
6298
6203
|
) }),
|
|
6299
|
-
/* @__PURE__ */
|
|
6204
|
+
/* @__PURE__ */ jsx18(TooltipContent, { sideOffset: 8, children: "Alignment" })
|
|
6300
6205
|
] }),
|
|
6301
|
-
/* @__PURE__ */
|
|
6206
|
+
/* @__PURE__ */ jsx18(
|
|
6302
6207
|
PopoverContent,
|
|
6303
6208
|
{
|
|
6304
6209
|
className: "mly:flex mly:w-max mly:gap-0.5 mly:rounded-lg mly:p-0.5!",
|
|
@@ -6312,7 +6217,7 @@ function AlignmentSwitch(props) {
|
|
|
6312
6217
|
e.preventDefault();
|
|
6313
6218
|
},
|
|
6314
6219
|
children: Object.entries(alignments).map(([key, value]) => {
|
|
6315
|
-
return /* @__PURE__ */
|
|
6220
|
+
return /* @__PURE__ */ jsx18(
|
|
6316
6221
|
BubbleMenuButton,
|
|
6317
6222
|
{
|
|
6318
6223
|
icon: value.icon,
|
|
@@ -6340,12 +6245,12 @@ import { FootprintsIcon as FootprintsIcon2, Heading1 as Heading12 } from "lucide
|
|
|
6340
6245
|
|
|
6341
6246
|
// src/blocks/button.tsx
|
|
6342
6247
|
import { MousePointer, ArrowUpRightSquare } from "lucide-react";
|
|
6343
|
-
import { jsx as
|
|
6248
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
6344
6249
|
var button = {
|
|
6345
6250
|
title: "Button",
|
|
6346
6251
|
description: "Add a call to action button to email.",
|
|
6347
6252
|
searchTerms: ["link", "button", "cta"],
|
|
6348
|
-
icon: /* @__PURE__ */
|
|
6253
|
+
icon: /* @__PURE__ */ jsx19(MousePointer, { className: "mly:h-4 mly:w-4" }),
|
|
6349
6254
|
command: ({ editor, range }) => {
|
|
6350
6255
|
editor.chain().focus().deleteRange(range).setButton().run();
|
|
6351
6256
|
}
|
|
@@ -6354,7 +6259,7 @@ var linkCard = {
|
|
|
6354
6259
|
title: "Link Card",
|
|
6355
6260
|
description: "Add a link card to email.",
|
|
6356
6261
|
searchTerms: ["link", "button", "image"],
|
|
6357
|
-
icon: /* @__PURE__ */
|
|
6262
|
+
icon: /* @__PURE__ */ jsx19(ArrowUpRightSquare, { className: "mly:h-4 mly:w-4" }),
|
|
6358
6263
|
command: ({ editor, range }) => {
|
|
6359
6264
|
editor.chain().focus().deleteRange(range).setLinkCard().run();
|
|
6360
6265
|
},
|
|
@@ -6366,13 +6271,13 @@ var linkCard = {
|
|
|
6366
6271
|
};
|
|
6367
6272
|
|
|
6368
6273
|
// src/blocks/code.tsx
|
|
6369
|
-
import { CodeXmlIcon
|
|
6370
|
-
import { jsx as
|
|
6274
|
+
import { CodeXmlIcon } from "lucide-react";
|
|
6275
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
6371
6276
|
var htmlCodeBlock = {
|
|
6372
6277
|
title: "Custom HTML",
|
|
6373
6278
|
description: "Insert a custom HTML block",
|
|
6374
6279
|
searchTerms: ["html", "code", "custom"],
|
|
6375
|
-
icon: /* @__PURE__ */
|
|
6280
|
+
icon: /* @__PURE__ */ jsx20(CodeXmlIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6376
6281
|
command: ({ editor, range }) => {
|
|
6377
6282
|
editor.chain().focus().deleteRange(range).setHtmlCodeBlock({ language: "html" }).run();
|
|
6378
6283
|
}
|
|
@@ -6381,12 +6286,12 @@ var htmlCodeBlock = {
|
|
|
6381
6286
|
// src/blocks/image.tsx
|
|
6382
6287
|
import { TextSelection as TextSelection2 } from "@tiptap/pm/state";
|
|
6383
6288
|
import { ImageIcon } from "lucide-react";
|
|
6384
|
-
import { jsx as
|
|
6289
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
6385
6290
|
var image = {
|
|
6386
6291
|
title: "Image",
|
|
6387
6292
|
description: "Full width image",
|
|
6388
6293
|
searchTerms: ["image"],
|
|
6389
|
-
icon: /* @__PURE__ */
|
|
6294
|
+
icon: /* @__PURE__ */ jsx21(ImageIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6390
6295
|
command: ({ editor, range }) => {
|
|
6391
6296
|
editor.chain().focus().deleteRange(range).setImage({ src: "" }).run();
|
|
6392
6297
|
}
|
|
@@ -6395,7 +6300,7 @@ var logo = {
|
|
|
6395
6300
|
title: "Logo",
|
|
6396
6301
|
description: "Add your brand logo",
|
|
6397
6302
|
searchTerms: ["image", "logo"],
|
|
6398
|
-
icon: /* @__PURE__ */
|
|
6303
|
+
icon: /* @__PURE__ */ jsx21(ImageIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6399
6304
|
command: ({ editor, range }) => {
|
|
6400
6305
|
editor.chain().focus().deleteRange(range).setLogoImage({ src: "" }).run();
|
|
6401
6306
|
}
|
|
@@ -6404,7 +6309,7 @@ var inlineImage = {
|
|
|
6404
6309
|
title: "Inline Image",
|
|
6405
6310
|
description: "Inline image",
|
|
6406
6311
|
searchTerms: ["image", "inline"],
|
|
6407
|
-
icon: /* @__PURE__ */
|
|
6312
|
+
icon: /* @__PURE__ */ jsx21(ImageIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6408
6313
|
command: ({ editor, range }) => {
|
|
6409
6314
|
editor.chain().focus().deleteRange(range).setInlineImage({
|
|
6410
6315
|
src: "https://maily.to/brand/logo.png"
|
|
@@ -6434,12 +6339,12 @@ import {
|
|
|
6434
6339
|
RectangleHorizontal,
|
|
6435
6340
|
Minus
|
|
6436
6341
|
} from "lucide-react";
|
|
6437
|
-
import { jsx as
|
|
6342
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
6438
6343
|
var columns = {
|
|
6439
6344
|
title: "Columns",
|
|
6440
6345
|
description: "Add columns to email.",
|
|
6441
6346
|
searchTerms: ["layout", "columns"],
|
|
6442
|
-
icon: /* @__PURE__ */
|
|
6347
|
+
icon: /* @__PURE__ */ jsx22(ColumnsIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6443
6348
|
command: ({ editor, range }) => {
|
|
6444
6349
|
editor.chain().focus().deleteRange(range).setColumns().focus(editor.state.selection.head - 2).run();
|
|
6445
6350
|
}
|
|
@@ -6448,7 +6353,7 @@ var section = {
|
|
|
6448
6353
|
title: "Section",
|
|
6449
6354
|
description: "Add a section to email.",
|
|
6450
6355
|
searchTerms: ["layout", "section"],
|
|
6451
|
-
icon: /* @__PURE__ */
|
|
6356
|
+
icon: /* @__PURE__ */ jsx22(RectangleHorizontal, { className: "mly:h-4 mly:w-4" }),
|
|
6452
6357
|
command: ({ editor, range }) => {
|
|
6453
6358
|
editor.chain().focus().deleteRange(range).setSection().run();
|
|
6454
6359
|
}
|
|
@@ -6457,7 +6362,7 @@ var repeat = {
|
|
|
6457
6362
|
title: "Repeat",
|
|
6458
6363
|
description: "Loop over an array of items.",
|
|
6459
6364
|
searchTerms: ["repeat", "for", "loop"],
|
|
6460
|
-
icon: /* @__PURE__ */
|
|
6365
|
+
icon: /* @__PURE__ */ jsx22(Repeat2, { className: "mly:h-4 mly:w-4" }),
|
|
6461
6366
|
command: ({ editor, range }) => {
|
|
6462
6367
|
editor.chain().focus().deleteRange(range).setRepeat().run();
|
|
6463
6368
|
}
|
|
@@ -6466,7 +6371,7 @@ var spacer = {
|
|
|
6466
6371
|
title: "Spacer",
|
|
6467
6372
|
description: "Add space between blocks.",
|
|
6468
6373
|
searchTerms: ["space", "gap", "divider"],
|
|
6469
|
-
icon: /* @__PURE__ */
|
|
6374
|
+
icon: /* @__PURE__ */ jsx22(MoveVertical, { className: "mly:h-4 mly:w-4" }),
|
|
6470
6375
|
command: ({ editor, range }) => {
|
|
6471
6376
|
editor.chain().focus().deleteRange(range).setSpacer({ height: "sm" }).run();
|
|
6472
6377
|
}
|
|
@@ -6475,7 +6380,7 @@ var divider = {
|
|
|
6475
6380
|
title: "Divider",
|
|
6476
6381
|
description: "Add a horizontal divider.",
|
|
6477
6382
|
searchTerms: ["divider", "line"],
|
|
6478
|
-
icon: /* @__PURE__ */
|
|
6383
|
+
icon: /* @__PURE__ */ jsx22(Minus, { className: "mly:h-4 mly:w-4" }),
|
|
6479
6384
|
command: ({ editor, range }) => {
|
|
6480
6385
|
editor.chain().focus().deleteRange(range).setHorizontalRule().run();
|
|
6481
6386
|
}
|
|
@@ -6483,12 +6388,12 @@ var divider = {
|
|
|
6483
6388
|
|
|
6484
6389
|
// src/blocks/list.tsx
|
|
6485
6390
|
import { List, ListOrdered } from "lucide-react";
|
|
6486
|
-
import { jsx as
|
|
6391
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
6487
6392
|
var bulletList = {
|
|
6488
6393
|
title: "Bullet List",
|
|
6489
6394
|
description: "Create a simple bullet list.",
|
|
6490
6395
|
searchTerms: ["unordered", "point"],
|
|
6491
|
-
icon: /* @__PURE__ */
|
|
6396
|
+
icon: /* @__PURE__ */ jsx23(List, { className: "mly:h-4 mly:w-4" }),
|
|
6492
6397
|
command: ({ editor, range }) => {
|
|
6493
6398
|
editor.chain().focus().deleteRange(range).toggleBulletList().run();
|
|
6494
6399
|
}
|
|
@@ -6497,7 +6402,7 @@ var orderedList = {
|
|
|
6497
6402
|
title: "Numbered List",
|
|
6498
6403
|
description: "Create a list with numbering.",
|
|
6499
6404
|
searchTerms: ["ordered"],
|
|
6500
|
-
icon: /* @__PURE__ */
|
|
6405
|
+
icon: /* @__PURE__ */ jsx23(ListOrdered, { className: "mly:h-4 mly:w-4" }),
|
|
6501
6406
|
command: ({ editor, range }) => {
|
|
6502
6407
|
editor.chain().focus().deleteRange(range).toggleOrderedList().run();
|
|
6503
6408
|
}
|
|
@@ -6514,12 +6419,12 @@ import {
|
|
|
6514
6419
|
FootprintsIcon,
|
|
6515
6420
|
EraserIcon as EraserIcon2
|
|
6516
6421
|
} from "lucide-react";
|
|
6517
|
-
import { jsx as
|
|
6422
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
6518
6423
|
var text = {
|
|
6519
6424
|
title: "Text",
|
|
6520
6425
|
description: "Just start typing with plain text.",
|
|
6521
6426
|
searchTerms: ["p", "paragraph"],
|
|
6522
|
-
icon: /* @__PURE__ */
|
|
6427
|
+
icon: /* @__PURE__ */ jsx24(Text, { className: "mly:h-4 mly:w-4" }),
|
|
6523
6428
|
command: ({ editor, range }) => {
|
|
6524
6429
|
editor.chain().focus().deleteRange(range).toggleNode("paragraph", "paragraph").run();
|
|
6525
6430
|
}
|
|
@@ -6528,7 +6433,7 @@ var heading1 = {
|
|
|
6528
6433
|
title: "Heading 1",
|
|
6529
6434
|
description: "Big heading.",
|
|
6530
6435
|
searchTerms: ["h1", "title", "big", "large"],
|
|
6531
|
-
icon: /* @__PURE__ */
|
|
6436
|
+
icon: /* @__PURE__ */ jsx24(Heading1, { className: "mly:h-4 mly:w-4" }),
|
|
6532
6437
|
command: ({ editor, range }) => {
|
|
6533
6438
|
editor.chain().focus().deleteRange(range).setNode("heading", { level: 1 }).run();
|
|
6534
6439
|
}
|
|
@@ -6537,7 +6442,7 @@ var heading2 = {
|
|
|
6537
6442
|
title: "Heading 2",
|
|
6538
6443
|
description: "Medium heading.",
|
|
6539
6444
|
searchTerms: ["h2", "subtitle", "medium"],
|
|
6540
|
-
icon: /* @__PURE__ */
|
|
6445
|
+
icon: /* @__PURE__ */ jsx24(Heading2, { className: "mly:h-4 mly:w-4" }),
|
|
6541
6446
|
command: ({ editor, range }) => {
|
|
6542
6447
|
editor.chain().focus().deleteRange(range).setNode("heading", { level: 2 }).run();
|
|
6543
6448
|
}
|
|
@@ -6546,7 +6451,7 @@ var heading3 = {
|
|
|
6546
6451
|
title: "Heading 3",
|
|
6547
6452
|
description: "Small heading.",
|
|
6548
6453
|
searchTerms: ["h3", "subtitle", "small"],
|
|
6549
|
-
icon: /* @__PURE__ */
|
|
6454
|
+
icon: /* @__PURE__ */ jsx24(Heading3, { className: "mly:h-4 mly:w-4" }),
|
|
6550
6455
|
command: ({ editor, range }) => {
|
|
6551
6456
|
editor.chain().focus().deleteRange(range).setNode("heading", { level: 3 }).run();
|
|
6552
6457
|
}
|
|
@@ -6555,7 +6460,7 @@ var hardBreak = {
|
|
|
6555
6460
|
title: "Hard Break",
|
|
6556
6461
|
description: "Add a break between lines.",
|
|
6557
6462
|
searchTerms: ["break", "line"],
|
|
6558
|
-
icon: /* @__PURE__ */
|
|
6463
|
+
icon: /* @__PURE__ */ jsx24(DivideIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6559
6464
|
command: ({ editor, range }) => {
|
|
6560
6465
|
editor.chain().focus().deleteRange(range).setHardBreak().run();
|
|
6561
6466
|
}
|
|
@@ -6564,7 +6469,7 @@ var blockquote = {
|
|
|
6564
6469
|
title: "Blockquote",
|
|
6565
6470
|
description: "Add blockquote.",
|
|
6566
6471
|
searchTerms: ["quote", "blockquote"],
|
|
6567
|
-
icon: /* @__PURE__ */
|
|
6472
|
+
icon: /* @__PURE__ */ jsx24(TextQuote, { className: "mly:h-4 mly:w-4" }),
|
|
6568
6473
|
command: ({ editor, range }) => {
|
|
6569
6474
|
editor.chain().focus().deleteRange(range).toggleBlockquote().run();
|
|
6570
6475
|
}
|
|
@@ -6573,7 +6478,7 @@ var footer = {
|
|
|
6573
6478
|
title: "Footer",
|
|
6574
6479
|
description: "Add a footer text to email.",
|
|
6575
6480
|
searchTerms: ["footer", "text"],
|
|
6576
|
-
icon: /* @__PURE__ */
|
|
6481
|
+
icon: /* @__PURE__ */ jsx24(FootprintsIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6577
6482
|
command: ({ editor, range }) => {
|
|
6578
6483
|
editor.chain().focus().deleteRange(range).setFooter().run();
|
|
6579
6484
|
}
|
|
@@ -6582,16 +6487,16 @@ var clearLine = {
|
|
|
6582
6487
|
title: "Clear Line",
|
|
6583
6488
|
description: "Clear the current line.",
|
|
6584
6489
|
searchTerms: ["clear", "line"],
|
|
6585
|
-
icon: /* @__PURE__ */
|
|
6490
|
+
icon: /* @__PURE__ */ jsx24(EraserIcon2, { className: "mly:h-4 mly:w-4" }),
|
|
6586
6491
|
command: ({ editor, range }) => {
|
|
6587
6492
|
editor.chain().focus().selectParentNode().deleteSelection().run();
|
|
6588
6493
|
}
|
|
6589
6494
|
};
|
|
6590
6495
|
|
|
6591
6496
|
// src/editor/components/icons/logo-with-cover-image.tsx
|
|
6592
|
-
import { jsx as
|
|
6497
|
+
import { jsx as jsx25, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
6593
6498
|
function LogoWithCoverImageIcon(props) {
|
|
6594
|
-
return /* @__PURE__ */
|
|
6499
|
+
return /* @__PURE__ */ jsxs11(
|
|
6595
6500
|
"svg",
|
|
6596
6501
|
__spreadProps(__spreadValues({
|
|
6597
6502
|
width: "14",
|
|
@@ -6601,7 +6506,7 @@ function LogoWithCoverImageIcon(props) {
|
|
|
6601
6506
|
xmlns: "http://www.w3.org/2000/svg"
|
|
6602
6507
|
}, props), {
|
|
6603
6508
|
children: [
|
|
6604
|
-
/* @__PURE__ */
|
|
6509
|
+
/* @__PURE__ */ jsx25(
|
|
6605
6510
|
"path",
|
|
6606
6511
|
{
|
|
6607
6512
|
fillRule: "evenodd",
|
|
@@ -6610,7 +6515,7 @@ function LogoWithCoverImageIcon(props) {
|
|
|
6610
6515
|
fill: "currentColor"
|
|
6611
6516
|
}
|
|
6612
6517
|
),
|
|
6613
|
-
/* @__PURE__ */
|
|
6518
|
+
/* @__PURE__ */ jsx25(
|
|
6614
6519
|
"path",
|
|
6615
6520
|
{
|
|
6616
6521
|
fillRule: "evenodd",
|
|
@@ -6619,7 +6524,7 @@ function LogoWithCoverImageIcon(props) {
|
|
|
6619
6524
|
fill: "currentColor"
|
|
6620
6525
|
}
|
|
6621
6526
|
),
|
|
6622
|
-
/* @__PURE__ */
|
|
6527
|
+
/* @__PURE__ */ jsx25(
|
|
6623
6528
|
"path",
|
|
6624
6529
|
{
|
|
6625
6530
|
fillRule: "evenodd",
|
|
@@ -6628,8 +6533,8 @@ function LogoWithCoverImageIcon(props) {
|
|
|
6628
6533
|
fill: "currentColor"
|
|
6629
6534
|
}
|
|
6630
6535
|
),
|
|
6631
|
-
/* @__PURE__ */
|
|
6632
|
-
/* @__PURE__ */
|
|
6536
|
+
/* @__PURE__ */ jsx25("mask", { id: "path-4-inside-1_1046_19527", fill: "white", children: /* @__PURE__ */ jsx25("rect", { x: "3", y: "4", width: "8", height: "3", rx: "0.5" }) }),
|
|
6537
|
+
/* @__PURE__ */ jsx25(
|
|
6633
6538
|
"rect",
|
|
6634
6539
|
{
|
|
6635
6540
|
x: "3",
|
|
@@ -6642,7 +6547,7 @@ function LogoWithCoverImageIcon(props) {
|
|
|
6642
6547
|
mask: "url(#path-4-inside-1_1046_19527)"
|
|
6643
6548
|
}
|
|
6644
6549
|
),
|
|
6645
|
-
/* @__PURE__ */
|
|
6550
|
+
/* @__PURE__ */ jsx25(
|
|
6646
6551
|
"rect",
|
|
6647
6552
|
{
|
|
6648
6553
|
x: "6.25",
|
|
@@ -6654,16 +6559,16 @@ function LogoWithCoverImageIcon(props) {
|
|
|
6654
6559
|
strokeWidth: "0.5"
|
|
6655
6560
|
}
|
|
6656
6561
|
),
|
|
6657
|
-
/* @__PURE__ */
|
|
6562
|
+
/* @__PURE__ */ jsx25("rect", { x: "3", y: "8", width: "2", height: "1", rx: "0.5", fill: "currentColor" })
|
|
6658
6563
|
]
|
|
6659
6564
|
})
|
|
6660
6565
|
);
|
|
6661
6566
|
}
|
|
6662
6567
|
|
|
6663
6568
|
// src/editor/components/icons/logo-with-text-horizon.tsx
|
|
6664
|
-
import { jsx as
|
|
6569
|
+
import { jsx as jsx26, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
6665
6570
|
function LogoWithTextHorizonIcon(props) {
|
|
6666
|
-
return /* @__PURE__ */
|
|
6571
|
+
return /* @__PURE__ */ jsxs12(
|
|
6667
6572
|
"svg",
|
|
6668
6573
|
__spreadProps(__spreadValues({
|
|
6669
6574
|
width: "14",
|
|
@@ -6673,7 +6578,7 @@ function LogoWithTextHorizonIcon(props) {
|
|
|
6673
6578
|
xmlns: "http://www.w3.org/2000/svg"
|
|
6674
6579
|
}, props), {
|
|
6675
6580
|
children: [
|
|
6676
|
-
/* @__PURE__ */
|
|
6581
|
+
/* @__PURE__ */ jsx26(
|
|
6677
6582
|
"path",
|
|
6678
6583
|
{
|
|
6679
6584
|
fillRule: "evenodd",
|
|
@@ -6682,7 +6587,7 @@ function LogoWithTextHorizonIcon(props) {
|
|
|
6682
6587
|
fill: "currentColor"
|
|
6683
6588
|
}
|
|
6684
6589
|
),
|
|
6685
|
-
/* @__PURE__ */
|
|
6590
|
+
/* @__PURE__ */ jsx26(
|
|
6686
6591
|
"rect",
|
|
6687
6592
|
{
|
|
6688
6593
|
x: "6.25",
|
|
@@ -6694,8 +6599,8 @@ function LogoWithTextHorizonIcon(props) {
|
|
|
6694
6599
|
strokeWidth: "0.5"
|
|
6695
6600
|
}
|
|
6696
6601
|
),
|
|
6697
|
-
/* @__PURE__ */
|
|
6698
|
-
/* @__PURE__ */
|
|
6602
|
+
/* @__PURE__ */ jsx26("rect", { x: "3", y: "6.5", width: "2", height: "1", rx: "0.5", fill: "currentColor" }),
|
|
6603
|
+
/* @__PURE__ */ jsx26(
|
|
6699
6604
|
"path",
|
|
6700
6605
|
{
|
|
6701
6606
|
fillRule: "evenodd",
|
|
@@ -6704,7 +6609,7 @@ function LogoWithTextHorizonIcon(props) {
|
|
|
6704
6609
|
fill: "currentColor"
|
|
6705
6610
|
}
|
|
6706
6611
|
),
|
|
6707
|
-
/* @__PURE__ */
|
|
6612
|
+
/* @__PURE__ */ jsx26(
|
|
6708
6613
|
"path",
|
|
6709
6614
|
{
|
|
6710
6615
|
fillRule: "evenodd",
|
|
@@ -6719,9 +6624,9 @@ function LogoWithTextHorizonIcon(props) {
|
|
|
6719
6624
|
}
|
|
6720
6625
|
|
|
6721
6626
|
// src/editor/components/icons/logo-with-text-vertical.tsx
|
|
6722
|
-
import { jsx as
|
|
6627
|
+
import { jsx as jsx27, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
6723
6628
|
function LogoWithTextVerticalIcon(props) {
|
|
6724
|
-
return /* @__PURE__ */
|
|
6629
|
+
return /* @__PURE__ */ jsxs13(
|
|
6725
6630
|
"svg",
|
|
6726
6631
|
__spreadProps(__spreadValues({
|
|
6727
6632
|
width: "14",
|
|
@@ -6731,7 +6636,7 @@ function LogoWithTextVerticalIcon(props) {
|
|
|
6731
6636
|
xmlns: "http://www.w3.org/2000/svg"
|
|
6732
6637
|
}, props), {
|
|
6733
6638
|
children: [
|
|
6734
|
-
/* @__PURE__ */
|
|
6639
|
+
/* @__PURE__ */ jsx27(
|
|
6735
6640
|
"path",
|
|
6736
6641
|
{
|
|
6737
6642
|
fillRule: "evenodd",
|
|
@@ -6740,7 +6645,7 @@ function LogoWithTextVerticalIcon(props) {
|
|
|
6740
6645
|
fill: "currentColor"
|
|
6741
6646
|
}
|
|
6742
6647
|
),
|
|
6743
|
-
/* @__PURE__ */
|
|
6648
|
+
/* @__PURE__ */ jsx27(
|
|
6744
6649
|
"rect",
|
|
6745
6650
|
{
|
|
6746
6651
|
x: "4.25",
|
|
@@ -6752,8 +6657,8 @@ function LogoWithTextVerticalIcon(props) {
|
|
|
6752
6657
|
strokeWidth: "0.5"
|
|
6753
6658
|
}
|
|
6754
6659
|
),
|
|
6755
|
-
/* @__PURE__ */
|
|
6756
|
-
/* @__PURE__ */
|
|
6660
|
+
/* @__PURE__ */ jsx27("rect", { x: "6", y: "6", width: "2", height: "1", rx: "0.5", fill: "currentColor" }),
|
|
6661
|
+
/* @__PURE__ */ jsx27(
|
|
6757
6662
|
"path",
|
|
6758
6663
|
{
|
|
6759
6664
|
fillRule: "evenodd",
|
|
@@ -6762,7 +6667,7 @@ function LogoWithTextVerticalIcon(props) {
|
|
|
6762
6667
|
fill: "currentColor"
|
|
6763
6668
|
}
|
|
6764
6669
|
),
|
|
6765
|
-
/* @__PURE__ */
|
|
6670
|
+
/* @__PURE__ */ jsx27(
|
|
6766
6671
|
"path",
|
|
6767
6672
|
{
|
|
6768
6673
|
fillRule: "evenodd",
|
|
@@ -6777,12 +6682,12 @@ function LogoWithTextVerticalIcon(props) {
|
|
|
6777
6682
|
}
|
|
6778
6683
|
|
|
6779
6684
|
// src/blocks/headers.tsx
|
|
6780
|
-
import { jsx as
|
|
6685
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
6781
6686
|
var headerLogoWithTextHorizontal = {
|
|
6782
6687
|
title: "Logo with Text (Horizontal)",
|
|
6783
6688
|
description: "Logo and a text horizontally",
|
|
6784
6689
|
searchTerms: ["logo", "text"],
|
|
6785
|
-
icon: /* @__PURE__ */
|
|
6690
|
+
icon: /* @__PURE__ */ jsx28(LogoWithTextHorizonIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6786
6691
|
command: ({ editor, range }) => {
|
|
6787
6692
|
editor.chain().deleteRange(range).insertContent({
|
|
6788
6693
|
type: "columns",
|
|
@@ -6846,7 +6751,7 @@ var headerLogoWithTextVertical = {
|
|
|
6846
6751
|
title: "Logo with Text (Vertical)",
|
|
6847
6752
|
description: "Logo and a text vertically",
|
|
6848
6753
|
searchTerms: ["logo", "text"],
|
|
6849
|
-
icon: /* @__PURE__ */
|
|
6754
|
+
icon: /* @__PURE__ */ jsx28(LogoWithTextVerticalIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6850
6755
|
command: ({ editor, range }) => {
|
|
6851
6756
|
editor.chain().deleteRange(range).insertContent([
|
|
6852
6757
|
{
|
|
@@ -6877,7 +6782,7 @@ var headerLogoWithCoverImage = {
|
|
|
6877
6782
|
title: "Logo with Cover Image",
|
|
6878
6783
|
description: "Logo and a cover image",
|
|
6879
6784
|
searchTerms: ["logo", "cover", "image"],
|
|
6880
|
-
icon: /* @__PURE__ */
|
|
6785
|
+
icon: /* @__PURE__ */ jsx28(LogoWithCoverImageIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6881
6786
|
command: ({ editor, range }) => {
|
|
6882
6787
|
const todayFormatted = (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", {
|
|
6883
6788
|
year: "numeric",
|
|
@@ -6970,12 +6875,12 @@ import {
|
|
|
6970
6875
|
LayoutTemplateIcon,
|
|
6971
6876
|
RectangleHorizontalIcon
|
|
6972
6877
|
} from "lucide-react";
|
|
6973
|
-
import { jsx as
|
|
6878
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
6974
6879
|
var footerCopyrightText = {
|
|
6975
6880
|
title: "Footer Copyright",
|
|
6976
6881
|
description: "Copyright text for the footer.",
|
|
6977
6882
|
searchTerms: ["footer", "copyright"],
|
|
6978
|
-
icon: /* @__PURE__ */
|
|
6883
|
+
icon: /* @__PURE__ */ jsx29(CopyrightIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6979
6884
|
command: ({ editor, range }) => {
|
|
6980
6885
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
6981
6886
|
editor.chain().focus().deleteRange(range).insertContent({
|
|
@@ -6995,7 +6900,7 @@ var footerCommunityFeedbackCta = {
|
|
|
6995
6900
|
title: "Footer Community Feedback CTA",
|
|
6996
6901
|
description: "Community feedback CTA for the footer.",
|
|
6997
6902
|
searchTerms: ["footer", "community", "feedback", "cta"],
|
|
6998
|
-
icon: /* @__PURE__ */
|
|
6903
|
+
icon: /* @__PURE__ */ jsx29(RectangleHorizontalIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6999
6904
|
command: ({ editor, range }) => {
|
|
7000
6905
|
editor.chain().focus().deleteRange(range).insertContent([
|
|
7001
6906
|
{
|
|
@@ -7038,7 +6943,7 @@ var footerCompanySignature = {
|
|
|
7038
6943
|
title: "Footer Company Signature",
|
|
7039
6944
|
description: "Company signature for the footer.",
|
|
7040
6945
|
searchTerms: ["footer", "company", "signature"],
|
|
7041
|
-
icon: /* @__PURE__ */
|
|
6946
|
+
icon: /* @__PURE__ */ jsx29(LayoutTemplateIcon, { className: "mly:h-4 mly:w-4" }),
|
|
7042
6947
|
command: ({ editor, range }) => {
|
|
7043
6948
|
editor.chain().focus().deleteRange(range).insertContent([
|
|
7044
6949
|
{ type: "horizontalRule" },
|
|
@@ -7192,7 +7097,7 @@ var footerCompanySignature = {
|
|
|
7192
7097
|
};
|
|
7193
7098
|
|
|
7194
7099
|
// src/editor/extensions/slash-command/default-slash-commands.tsx
|
|
7195
|
-
import { jsx as
|
|
7100
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
7196
7101
|
var DEFAULT_SLASH_COMMANDS = [
|
|
7197
7102
|
{
|
|
7198
7103
|
title: "Blocks",
|
|
@@ -7227,7 +7132,7 @@ var DEFAULT_SLASH_COMMANDS = [
|
|
|
7227
7132
|
title: "Headers",
|
|
7228
7133
|
description: "Add pre-designed headers block",
|
|
7229
7134
|
searchTerms: ["header", "headers"],
|
|
7230
|
-
icon: /* @__PURE__ */
|
|
7135
|
+
icon: /* @__PURE__ */ jsx30(Heading12, { className: "mly:h-4 mly:w-4" }),
|
|
7231
7136
|
preview: "https://cdn.usemaily.com/previews/header-preview-xyz.png",
|
|
7232
7137
|
commands: [
|
|
7233
7138
|
headerLogoWithTextVertical,
|
|
@@ -7240,7 +7145,7 @@ var DEFAULT_SLASH_COMMANDS = [
|
|
|
7240
7145
|
title: "Footers",
|
|
7241
7146
|
description: "Add pre-designed footers block",
|
|
7242
7147
|
searchTerms: ["footers"],
|
|
7243
|
-
icon: /* @__PURE__ */
|
|
7148
|
+
icon: /* @__PURE__ */ jsx30(FootprintsIcon2, { className: "mly:h-4 mly:w-4" }),
|
|
7244
7149
|
commands: [
|
|
7245
7150
|
footerCopyrightText,
|
|
7246
7151
|
footerCommunityFeedbackCta,
|
|
@@ -7253,7 +7158,7 @@ var DEFAULT_SLASH_COMMANDS = [
|
|
|
7253
7158
|
];
|
|
7254
7159
|
|
|
7255
7160
|
// src/editor/provider.tsx
|
|
7256
|
-
import { jsx as
|
|
7161
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
7257
7162
|
var DEFAULT_PLACEHOLDER_URL = "https://maily.to/";
|
|
7258
7163
|
var MailyContext = createContext({
|
|
7259
7164
|
placeholderUrl: DEFAULT_PLACEHOLDER_URL,
|
|
@@ -7261,7 +7166,7 @@ var MailyContext = createContext({
|
|
|
7261
7166
|
});
|
|
7262
7167
|
function MailyProvider(props) {
|
|
7263
7168
|
const _a = props, { children } = _a, defaultValues = __objRest(_a, ["children"]);
|
|
7264
|
-
return /* @__PURE__ */
|
|
7169
|
+
return /* @__PURE__ */ jsx31(MailyContext.Provider, { value: defaultValues, children });
|
|
7265
7170
|
}
|
|
7266
7171
|
function useMailyContext() {
|
|
7267
7172
|
const values = useContext(MailyContext);
|
|
@@ -7294,7 +7199,7 @@ import {
|
|
|
7294
7199
|
useRef as useRef6,
|
|
7295
7200
|
useState as useState6
|
|
7296
7201
|
} from "react";
|
|
7297
|
-
import { jsx as
|
|
7202
|
+
import { jsx as jsx32, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
7298
7203
|
var VariableSuggestionsPopover = forwardRef5((props, ref) => {
|
|
7299
7204
|
const { items, onSelectItem } = props;
|
|
7300
7205
|
const [selectedIndex, setSelectedIndex] = useState6(0);
|
|
@@ -7340,17 +7245,17 @@ var VariableSuggestionsPopover = forwardRef5((props, ref) => {
|
|
|
7340
7245
|
onSelectItem(item);
|
|
7341
7246
|
}
|
|
7342
7247
|
}));
|
|
7343
|
-
return /* @__PURE__ */
|
|
7344
|
-
/* @__PURE__ */
|
|
7345
|
-
/* @__PURE__ */
|
|
7346
|
-
/* @__PURE__ */
|
|
7248
|
+
return /* @__PURE__ */ jsxs14("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: [
|
|
7249
|
+
/* @__PURE__ */ jsxs14("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: [
|
|
7250
|
+
/* @__PURE__ */ jsx32("span", { className: "mly:text-xs mly:uppercase", children: "Variables" }),
|
|
7251
|
+
/* @__PURE__ */ jsx32(VariableIcon, { children: /* @__PURE__ */ jsx32(Braces, { className: "mly:size-3 mly:stroke-[2.5]" }) })
|
|
7347
7252
|
] }),
|
|
7348
|
-
/* @__PURE__ */
|
|
7253
|
+
/* @__PURE__ */ jsx32(
|
|
7349
7254
|
"div",
|
|
7350
7255
|
{
|
|
7351
7256
|
ref: scrollContainerRef,
|
|
7352
7257
|
className: "mly:max-h-52 mly:overflow-y-auto mly:scrollbar-thin mly:scrollbar-track-transparent mly:scrollbar-thumb-gray-200",
|
|
7353
|
-
children: /* @__PURE__ */
|
|
7258
|
+
children: /* @__PURE__ */ jsx32("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__ */ jsxs14(
|
|
7354
7259
|
"button",
|
|
7355
7260
|
{
|
|
7356
7261
|
ref: (el) => itemRefs.current[index] = el,
|
|
@@ -7360,27 +7265,27 @@ var VariableSuggestionsPopover = forwardRef5((props, ref) => {
|
|
|
7360
7265
|
index === selectedIndex ? "mly:bg-soft-gray" : "mly:bg-white"
|
|
7361
7266
|
),
|
|
7362
7267
|
children: [
|
|
7363
|
-
/* @__PURE__ */
|
|
7268
|
+
/* @__PURE__ */ jsx32(Braces, { className: "mly:size-3 mly:stroke-[2.5] mly:text-rose-600" }),
|
|
7364
7269
|
(item == null ? void 0 : item.label) || item.name
|
|
7365
7270
|
]
|
|
7366
7271
|
},
|
|
7367
7272
|
index
|
|
7368
|
-
)) : /* @__PURE__ */
|
|
7273
|
+
)) : /* @__PURE__ */ jsx32("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 mly:hover:bg-soft-gray", children: "No result" }) })
|
|
7369
7274
|
}
|
|
7370
7275
|
),
|
|
7371
|
-
/* @__PURE__ */
|
|
7372
|
-
/* @__PURE__ */
|
|
7373
|
-
/* @__PURE__ */
|
|
7374
|
-
/* @__PURE__ */
|
|
7375
|
-
/* @__PURE__ */
|
|
7276
|
+
/* @__PURE__ */ jsxs14("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: [
|
|
7277
|
+
/* @__PURE__ */ jsxs14("div", { className: "mly:flex mly:items-center mly:gap-1", children: [
|
|
7278
|
+
/* @__PURE__ */ jsx32(VariableIcon, { children: /* @__PURE__ */ jsx32(ArrowDownIcon, { className: "mly:size-3 mly:stroke-[2.5]" }) }),
|
|
7279
|
+
/* @__PURE__ */ jsx32(VariableIcon, { children: /* @__PURE__ */ jsx32(ArrowUpIcon, { className: "mly:size-3 mly:stroke-[2.5]" }) }),
|
|
7280
|
+
/* @__PURE__ */ jsx32("span", { className: "mly:text-xs mly:text-gray-500", children: "Navigate" })
|
|
7376
7281
|
] }),
|
|
7377
|
-
/* @__PURE__ */
|
|
7282
|
+
/* @__PURE__ */ jsx32(VariableIcon, { children: /* @__PURE__ */ jsx32(CornerDownLeftIcon, { className: "mly:size-3 mly:stroke-[2.5]" }) })
|
|
7378
7283
|
] })
|
|
7379
7284
|
] });
|
|
7380
7285
|
});
|
|
7381
7286
|
function VariableIcon(props) {
|
|
7382
7287
|
const { className, children } = props;
|
|
7383
|
-
return /* @__PURE__ */
|
|
7288
|
+
return /* @__PURE__ */ jsx32(
|
|
7384
7289
|
"div",
|
|
7385
7290
|
{
|
|
7386
7291
|
className: cn(
|
|
@@ -7396,7 +7301,7 @@ function VariableIcon(props) {
|
|
|
7396
7301
|
import { NodeViewWrapper as NodeViewWrapper3 } from "@tiptap/react";
|
|
7397
7302
|
import { AlertTriangle, Braces as Braces2, Pencil } from "lucide-react";
|
|
7398
7303
|
import { useMemo as useMemo5 } from "react";
|
|
7399
|
-
import { Fragment as Fragment4, jsx as
|
|
7304
|
+
import { Fragment as Fragment4, jsx as jsx33, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
7400
7305
|
function VariableView(props) {
|
|
7401
7306
|
const { node, updateAttributes: updateAttributes2, editor } = props;
|
|
7402
7307
|
const {
|
|
@@ -7411,19 +7316,19 @@ function VariableView(props) {
|
|
|
7411
7316
|
const variableRender = (_b = (_a = getNodeOptions(editor, "variable")) == null ? void 0 : _a.renderVariable) != null ? _b : DEFAULT_RENDER_VARIABLE_FUNCTION;
|
|
7412
7317
|
return variableRender;
|
|
7413
7318
|
}, [editor]);
|
|
7414
|
-
return /* @__PURE__ */
|
|
7319
|
+
return /* @__PURE__ */ jsx33(
|
|
7415
7320
|
NodeViewWrapper3,
|
|
7416
7321
|
{
|
|
7417
7322
|
className: "react-component mly:inline-block mly:leading-none",
|
|
7418
7323
|
draggable: "false",
|
|
7419
|
-
children: /* @__PURE__ */
|
|
7324
|
+
children: /* @__PURE__ */ jsxs15(
|
|
7420
7325
|
Popover,
|
|
7421
7326
|
{
|
|
7422
7327
|
onOpenChange: (open) => {
|
|
7423
7328
|
editor.storage.variable.popover = open;
|
|
7424
7329
|
},
|
|
7425
7330
|
children: [
|
|
7426
|
-
/* @__PURE__ */
|
|
7331
|
+
/* @__PURE__ */ jsx33(PopoverTrigger, { children: renderVariable({
|
|
7427
7332
|
variable: {
|
|
7428
7333
|
name: id,
|
|
7429
7334
|
required,
|
|
@@ -7434,7 +7339,7 @@ function VariableView(props) {
|
|
|
7434
7339
|
editor,
|
|
7435
7340
|
from: "content-variable"
|
|
7436
7341
|
}) }),
|
|
7437
|
-
/* @__PURE__ */
|
|
7342
|
+
/* @__PURE__ */ jsx33(
|
|
7438
7343
|
PopoverContent,
|
|
7439
7344
|
{
|
|
7440
7345
|
align: "start",
|
|
@@ -7443,10 +7348,10 @@ function VariableView(props) {
|
|
|
7443
7348
|
sideOffset: 8,
|
|
7444
7349
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
7445
7350
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
7446
|
-
children: /* @__PURE__ */
|
|
7447
|
-
/* @__PURE__ */
|
|
7448
|
-
/* @__PURE__ */
|
|
7449
|
-
/* @__PURE__ */
|
|
7351
|
+
children: /* @__PURE__ */ jsx33(TooltipProvider, { children: /* @__PURE__ */ jsxs15("div", { className: "mly:flex mly:items-stretch mly:text-midnight-gray", children: [
|
|
7352
|
+
/* @__PURE__ */ jsxs15("label", { className: "mly:relative", children: [
|
|
7353
|
+
/* @__PURE__ */ jsx33("span", { className: "mly:inline-block mly:px-2 mly:text-xs mly:text-midnight-gray", children: "Variable" }),
|
|
7354
|
+
/* @__PURE__ */ jsx33(
|
|
7450
7355
|
"input",
|
|
7451
7356
|
__spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
|
|
7452
7357
|
value: id != null ? id : "",
|
|
@@ -7460,11 +7365,11 @@ function VariableView(props) {
|
|
|
7460
7365
|
})
|
|
7461
7366
|
)
|
|
7462
7367
|
] }),
|
|
7463
|
-
!hideDefaultValue && /* @__PURE__ */
|
|
7464
|
-
/* @__PURE__ */
|
|
7465
|
-
/* @__PURE__ */
|
|
7466
|
-
/* @__PURE__ */
|
|
7467
|
-
/* @__PURE__ */
|
|
7368
|
+
!hideDefaultValue && /* @__PURE__ */ jsxs15(Fragment4, { children: [
|
|
7369
|
+
/* @__PURE__ */ jsx33(Divider, { className: "mly:mx-1.5" }),
|
|
7370
|
+
/* @__PURE__ */ jsxs15("label", { className: "mly:relative", children: [
|
|
7371
|
+
/* @__PURE__ */ jsx33("span", { className: "mly:inline-block mly:px-2 mly:pl-1 mly:text-xs mly:text-midnight-gray", children: "Default" }),
|
|
7372
|
+
/* @__PURE__ */ jsx33(
|
|
7468
7373
|
"input",
|
|
7469
7374
|
__spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
|
|
7470
7375
|
value: fallback != null ? fallback : "",
|
|
@@ -7477,7 +7382,7 @@ function VariableView(props) {
|
|
|
7477
7382
|
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 mly:focus:bg-soft-gray mly:focus:outline-none"
|
|
7478
7383
|
})
|
|
7479
7384
|
),
|
|
7480
|
-
/* @__PURE__ */
|
|
7385
|
+
/* @__PURE__ */ jsx33("div", { className: "mly:absolute mly:inset-y-0 mly:right-1 mly:flex mly:items-center", children: /* @__PURE__ */ jsx33(Pencil, { className: "mly:h-3 mly:w-3 mly:stroke-[2.5] mly:text-midnight-gray" }) })
|
|
7481
7386
|
] })
|
|
7482
7387
|
] })
|
|
7483
7388
|
] }) })
|
|
@@ -7494,13 +7399,13 @@ var DefaultRenderVariable = (props) => {
|
|
|
7494
7399
|
const { name, required, valid, label } = variable;
|
|
7495
7400
|
const variableLabel = label || name;
|
|
7496
7401
|
if (from === "button-variable") {
|
|
7497
|
-
return /* @__PURE__ */
|
|
7498
|
-
/* @__PURE__ */
|
|
7499
|
-
/* @__PURE__ */
|
|
7402
|
+
return /* @__PURE__ */ jsxs15("div", { className: "mly:inline-grid mly:max-w-xs mly:grid-cols-[12px_1fr] mly:items-center mly:gap-1.5 mly:rounded-md mly:border mly:border-(--button-var-border-color) mly:px-2 mly:py-px mly:font-mono mly:text-xs", children: [
|
|
7403
|
+
/* @__PURE__ */ jsx33(Braces2, { className: "mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5]" }),
|
|
7404
|
+
/* @__PURE__ */ jsx33("span", { className: "mly:min-w-0 mly:truncate mly:text-left", children: variableLabel })
|
|
7500
7405
|
] });
|
|
7501
7406
|
}
|
|
7502
7407
|
if (from === "bubble-variable") {
|
|
7503
|
-
return /* @__PURE__ */
|
|
7408
|
+
return /* @__PURE__ */ jsxs15(
|
|
7504
7409
|
"div",
|
|
7505
7410
|
{
|
|
7506
7411
|
className: cn(
|
|
@@ -7508,21 +7413,21 @@ var DefaultRenderVariable = (props) => {
|
|
|
7508
7413
|
!valid && "mly:border-rose-400 mly:bg-rose-50 mly:text-rose-600 mly:hover:bg-rose-100"
|
|
7509
7414
|
),
|
|
7510
7415
|
children: [
|
|
7511
|
-
/* @__PURE__ */
|
|
7512
|
-
/* @__PURE__ */
|
|
7416
|
+
/* @__PURE__ */ jsx33(Braces2, { className: "mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5] mly:text-rose-600" }),
|
|
7417
|
+
/* @__PURE__ */ jsx33("span", { className: "mly:min-w-0 mly:truncate mly:text-left", children: variableLabel })
|
|
7513
7418
|
]
|
|
7514
7419
|
}
|
|
7515
7420
|
);
|
|
7516
7421
|
}
|
|
7517
|
-
return /* @__PURE__ */
|
|
7422
|
+
return /* @__PURE__ */ jsxs15(
|
|
7518
7423
|
"span",
|
|
7519
7424
|
{
|
|
7520
7425
|
tabIndex: -1,
|
|
7521
7426
|
className: "mly:inline-flex mly:items-center mly:gap-(--variable-icon-gap) mly:rounded-full mly:border mly:border-gray-200 mly:px-1.5 mly:py-0.5 mly:leading-none",
|
|
7522
7427
|
children: [
|
|
7523
|
-
/* @__PURE__ */
|
|
7428
|
+
/* @__PURE__ */ jsx33(Braces2, { className: "mly:size-[var(--variable-icon-size)] mly:shrink-0 mly:stroke-[2.5] mly:text-rose-600" }),
|
|
7524
7429
|
variableLabel,
|
|
7525
|
-
required && !fallback && /* @__PURE__ */
|
|
7430
|
+
required && !fallback && /* @__PURE__ */ jsx33(AlertTriangle, { className: "mly:size-[var(--variable-icon-size)] mly:shrink-0 mly:stroke-[2.5]" })
|
|
7526
7431
|
]
|
|
7527
7432
|
}
|
|
7528
7433
|
);
|
|
@@ -7703,7 +7608,7 @@ var VariableExtension = Node4.create({
|
|
|
7703
7608
|
});
|
|
7704
7609
|
|
|
7705
7610
|
// src/editor/components/ui/link-input-popover.tsx
|
|
7706
|
-
import { jsx as
|
|
7611
|
+
import { jsx as jsx34, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
7707
7612
|
function LinkInputPopover(props) {
|
|
7708
7613
|
var _a, _b;
|
|
7709
7614
|
const {
|
|
@@ -7733,7 +7638,7 @@ function LinkInputPopover(props) {
|
|
|
7733
7638
|
editor
|
|
7734
7639
|
}).map((variable) => variable.name);
|
|
7735
7640
|
}, [variables, variableTriggerCharacter, defaultValue, editor]);
|
|
7736
|
-
const popoverButton = /* @__PURE__ */
|
|
7641
|
+
const popoverButton = /* @__PURE__ */ jsx34(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx34(
|
|
7737
7642
|
BaseButton,
|
|
7738
7643
|
{
|
|
7739
7644
|
variant: "ghost",
|
|
@@ -7741,10 +7646,10 @@ function LinkInputPopover(props) {
|
|
|
7741
7646
|
type: "button",
|
|
7742
7647
|
className: "mly:h-7! mly:w-7!",
|
|
7743
7648
|
"data-state": !!defaultValue,
|
|
7744
|
-
children: /* @__PURE__ */
|
|
7649
|
+
children: /* @__PURE__ */ jsx34(Icon, { className: "mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5] mly:text-midnight-gray" })
|
|
7745
7650
|
}
|
|
7746
7651
|
) });
|
|
7747
|
-
return /* @__PURE__ */
|
|
7652
|
+
return /* @__PURE__ */ jsxs16(
|
|
7748
7653
|
Popover,
|
|
7749
7654
|
{
|
|
7750
7655
|
open: isOpen,
|
|
@@ -7758,11 +7663,11 @@ function LinkInputPopover(props) {
|
|
|
7758
7663
|
}
|
|
7759
7664
|
},
|
|
7760
7665
|
children: [
|
|
7761
|
-
tooltip ? /* @__PURE__ */
|
|
7762
|
-
/* @__PURE__ */
|
|
7763
|
-
/* @__PURE__ */
|
|
7666
|
+
tooltip ? /* @__PURE__ */ jsxs16(Tooltip, { children: [
|
|
7667
|
+
/* @__PURE__ */ jsx34(TooltipTrigger, { asChild: true, children: popoverButton }),
|
|
7668
|
+
/* @__PURE__ */ jsx34(TooltipContent, { sideOffset: 8, children: tooltip })
|
|
7764
7669
|
] }) : popoverButton,
|
|
7765
|
-
/* @__PURE__ */
|
|
7670
|
+
/* @__PURE__ */ jsx34(
|
|
7766
7671
|
PopoverContent,
|
|
7767
7672
|
{
|
|
7768
7673
|
align: "end",
|
|
@@ -7770,7 +7675,7 @@ function LinkInputPopover(props) {
|
|
|
7770
7675
|
className: "mly:w-max mly:rounded-none mly:border-none mly:bg-transparent mly:p-0! mly:shadow-none",
|
|
7771
7676
|
sideOffset: 8,
|
|
7772
7677
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
7773
|
-
children: /* @__PURE__ */
|
|
7678
|
+
children: /* @__PURE__ */ jsx34(
|
|
7774
7679
|
"form",
|
|
7775
7680
|
{
|
|
7776
7681
|
onSubmit: (e) => {
|
|
@@ -7782,8 +7687,8 @@ function LinkInputPopover(props) {
|
|
|
7782
7687
|
onValueChange == null ? void 0 : onValueChange(input.value);
|
|
7783
7688
|
setIsOpen(false);
|
|
7784
7689
|
},
|
|
7785
|
-
children: /* @__PURE__ */
|
|
7786
|
-
!isEditing && /* @__PURE__ */
|
|
7690
|
+
children: /* @__PURE__ */ jsxs16("div", { className: "mly:isolate mly:flex mly:rounded-lg", children: [
|
|
7691
|
+
!isEditing && /* @__PURE__ */ jsx34("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__ */ jsx34(
|
|
7787
7692
|
"button",
|
|
7788
7693
|
{
|
|
7789
7694
|
onClick: () => {
|
|
@@ -7804,9 +7709,9 @@ function LinkInputPopover(props) {
|
|
|
7804
7709
|
})
|
|
7805
7710
|
}
|
|
7806
7711
|
) }),
|
|
7807
|
-
isEditing && /* @__PURE__ */
|
|
7808
|
-
/* @__PURE__ */
|
|
7809
|
-
/* @__PURE__ */
|
|
7712
|
+
isEditing && /* @__PURE__ */ jsxs16("div", { className: "mly:relative", children: [
|
|
7713
|
+
/* @__PURE__ */ jsx34("div", { className: "mly:absolute mly:inset-y-0 mly:left-1.5 mly:z-10 mly:flex mly:items-center", children: /* @__PURE__ */ jsx34(LinkIcon2, { className: "mly:h-3 mly:w-3 mly:stroke-[2.5] mly:text-midnight-gray" }) }),
|
|
7714
|
+
/* @__PURE__ */ jsx34(
|
|
7810
7715
|
InputAutocomplete,
|
|
7811
7716
|
{
|
|
7812
7717
|
editor,
|
|
@@ -7842,12 +7747,12 @@ function LinkInputPopover(props) {
|
|
|
7842
7747
|
}
|
|
7843
7748
|
|
|
7844
7749
|
// src/editor/components/image-menu/image-size.tsx
|
|
7845
|
-
import { jsx as
|
|
7750
|
+
import { jsx as jsx35, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
7846
7751
|
function ImageSize(props) {
|
|
7847
7752
|
const { value, onValueChange, dimension } = props;
|
|
7848
|
-
return /* @__PURE__ */
|
|
7849
|
-
/* @__PURE__ */
|
|
7850
|
-
/* @__PURE__ */
|
|
7753
|
+
return /* @__PURE__ */ jsxs17("label", { className: "mly:relative mly:flex mly:items-center", children: [
|
|
7754
|
+
/* @__PURE__ */ jsx35("span", { className: "mly:absolute mly:inset-y-0 mly:left-2 mly:flex mly:items-center mly:text-xs mly:leading-none mly:text-gray-400", children: dimension === "width" ? "W" : "H" }),
|
|
7755
|
+
/* @__PURE__ */ jsx35(
|
|
7851
7756
|
"input",
|
|
7852
7757
|
__spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
|
|
7853
7758
|
className: "hide-number-controls mly:h-auto mly:max-w-20 mly:appearance-none mly:border-0 mly:border-none mly:p-1 mly:px-[26px] mly:text-sm mly:uppercase mly:tabular-nums mly:outline-hidden mly:focus-visible:outline-hidden",
|
|
@@ -7856,15 +7761,15 @@ function ImageSize(props) {
|
|
|
7856
7761
|
onChange: (e) => onValueChange(e.target.value)
|
|
7857
7762
|
})
|
|
7858
7763
|
),
|
|
7859
|
-
/* @__PURE__ */
|
|
7764
|
+
/* @__PURE__ */ jsx35("span", { className: "mly:absolute mly:inset-y-0 mly:right-1 mly:flex mly:items-center mly:text-xs mly:leading-none mly:text-gray-400", children: "PX" })
|
|
7860
7765
|
] });
|
|
7861
7766
|
}
|
|
7862
7767
|
|
|
7863
7768
|
// src/editor/components/image-menu/use-image-state.tsx
|
|
7864
|
-
import { useEditorState as
|
|
7865
|
-
import
|
|
7769
|
+
import { useEditorState as useEditorState2 } from "@tiptap/react";
|
|
7770
|
+
import deepEql2 from "fast-deep-equal";
|
|
7866
7771
|
var useImageState = (editor) => {
|
|
7867
|
-
const states =
|
|
7772
|
+
const states = useEditorState2({
|
|
7868
7773
|
editor,
|
|
7869
7774
|
selector: ({ editor: editor2 }) => {
|
|
7870
7775
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
@@ -7885,13 +7790,13 @@ var useImageState = (editor) => {
|
|
|
7885
7790
|
currentShowIfKey: ((_o = editor2.getAttributes("image")) == null ? void 0 : _o.showIfKey) || ((_p = editor2.getAttributes("logo")) == null ? void 0 : _p.showIfKey) || ""
|
|
7886
7791
|
};
|
|
7887
7792
|
},
|
|
7888
|
-
equalityFn:
|
|
7793
|
+
equalityFn: deepEql2
|
|
7889
7794
|
});
|
|
7890
7795
|
return states;
|
|
7891
7796
|
};
|
|
7892
7797
|
|
|
7893
7798
|
// src/editor/components/image-menu/image-bubble-menu.tsx
|
|
7894
|
-
import { Fragment as Fragment5, jsx as
|
|
7799
|
+
import { Fragment as Fragment5, jsx as jsx36, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
7895
7800
|
function ImageBubbleMenu(props) {
|
|
7896
7801
|
var _a, _b, _c, _d;
|
|
7897
7802
|
const { editor, appendTo } = props;
|
|
@@ -7910,19 +7815,19 @@ function ImageBubbleMenu(props) {
|
|
|
7910
7815
|
popperOptions: {
|
|
7911
7816
|
modifiers: [{ name: "flip", enabled: false }]
|
|
7912
7817
|
},
|
|
7913
|
-
plugins: [
|
|
7818
|
+
plugins: [sticky2],
|
|
7914
7819
|
sticky: "popper",
|
|
7915
7820
|
maxWidth: "100%"
|
|
7916
7821
|
}
|
|
7917
7822
|
});
|
|
7918
7823
|
const { lockAspectRatio } = state;
|
|
7919
|
-
return /* @__PURE__ */
|
|
7920
|
-
|
|
7824
|
+
return /* @__PURE__ */ jsx36(
|
|
7825
|
+
BubbleMenu2,
|
|
7921
7826
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
7922
7827
|
className: "mly:flex mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:p-0.5 mly:shadow-md",
|
|
7923
|
-
children: /* @__PURE__ */
|
|
7924
|
-
state.isLogoActive && state.imageSrc && /* @__PURE__ */
|
|
7925
|
-
/* @__PURE__ */
|
|
7828
|
+
children: /* @__PURE__ */ jsxs18(TooltipProvider, { children: [
|
|
7829
|
+
state.isLogoActive && state.imageSrc && /* @__PURE__ */ jsxs18(Fragment5, { children: [
|
|
7830
|
+
/* @__PURE__ */ jsx36(
|
|
7926
7831
|
Select,
|
|
7927
7832
|
{
|
|
7928
7833
|
label: "Size",
|
|
@@ -7937,10 +7842,10 @@ function ImageBubbleMenu(props) {
|
|
|
7937
7842
|
}
|
|
7938
7843
|
}
|
|
7939
7844
|
),
|
|
7940
|
-
/* @__PURE__ */
|
|
7845
|
+
/* @__PURE__ */ jsx36(Divider, {})
|
|
7941
7846
|
] }),
|
|
7942
|
-
/* @__PURE__ */
|
|
7943
|
-
/* @__PURE__ */
|
|
7847
|
+
/* @__PURE__ */ jsxs18("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
7848
|
+
/* @__PURE__ */ jsx36(
|
|
7944
7849
|
AlignmentSwitch,
|
|
7945
7850
|
{
|
|
7946
7851
|
alignment: state.alignment,
|
|
@@ -7954,7 +7859,7 @@ function ImageBubbleMenu(props) {
|
|
|
7954
7859
|
}
|
|
7955
7860
|
}
|
|
7956
7861
|
),
|
|
7957
|
-
/* @__PURE__ */
|
|
7862
|
+
/* @__PURE__ */ jsx36(
|
|
7958
7863
|
LinkInputPopover,
|
|
7959
7864
|
{
|
|
7960
7865
|
defaultValue: (_a = state == null ? void 0 : state.imageSrc) != null ? _a : "",
|
|
@@ -7977,7 +7882,7 @@ function ImageBubbleMenu(props) {
|
|
|
7977
7882
|
isVariable: state.isSrcVariable
|
|
7978
7883
|
}
|
|
7979
7884
|
),
|
|
7980
|
-
state.isImageActive && /* @__PURE__ */
|
|
7885
|
+
state.isImageActive && /* @__PURE__ */ jsx36(
|
|
7981
7886
|
LinkInputPopover,
|
|
7982
7887
|
{
|
|
7983
7888
|
defaultValue: (_b = state == null ? void 0 : state.imageExternalLink) != null ? _b : "",
|
|
@@ -7993,9 +7898,9 @@ function ImageBubbleMenu(props) {
|
|
|
7993
7898
|
}
|
|
7994
7899
|
)
|
|
7995
7900
|
] }),
|
|
7996
|
-
state.isImageActive && state.imageSrc && /* @__PURE__ */
|
|
7997
|
-
/* @__PURE__ */
|
|
7998
|
-
/* @__PURE__ */
|
|
7901
|
+
state.isImageActive && state.imageSrc && /* @__PURE__ */ jsxs18(Fragment5, { children: [
|
|
7902
|
+
/* @__PURE__ */ jsx36(Divider, {}),
|
|
7903
|
+
/* @__PURE__ */ jsx36(
|
|
7999
7904
|
Select,
|
|
8000
7905
|
{
|
|
8001
7906
|
label: "Border Radius",
|
|
@@ -8013,8 +7918,8 @@ function ImageBubbleMenu(props) {
|
|
|
8013
7918
|
className: "mly:capitalize"
|
|
8014
7919
|
}
|
|
8015
7920
|
),
|
|
8016
|
-
/* @__PURE__ */
|
|
8017
|
-
/* @__PURE__ */
|
|
7921
|
+
/* @__PURE__ */ jsxs18("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
7922
|
+
/* @__PURE__ */ jsx36(
|
|
8018
7923
|
ImageSize,
|
|
8019
7924
|
{
|
|
8020
7925
|
dimension: "width",
|
|
@@ -8034,7 +7939,7 @@ function ImageBubbleMenu(props) {
|
|
|
8034
7939
|
}
|
|
8035
7940
|
}
|
|
8036
7941
|
),
|
|
8037
|
-
/* @__PURE__ */
|
|
7942
|
+
/* @__PURE__ */ jsx36(
|
|
8038
7943
|
ImageSize,
|
|
8039
7944
|
{
|
|
8040
7945
|
dimension: "height",
|
|
@@ -8054,7 +7959,7 @@ function ImageBubbleMenu(props) {
|
|
|
8054
7959
|
}
|
|
8055
7960
|
}
|
|
8056
7961
|
),
|
|
8057
|
-
/* @__PURE__ */
|
|
7962
|
+
/* @__PURE__ */ jsx36(
|
|
8058
7963
|
BubbleMenuButton,
|
|
8059
7964
|
{
|
|
8060
7965
|
isActive: () => lockAspectRatio,
|
|
@@ -8079,8 +7984,8 @@ function ImageBubbleMenu(props) {
|
|
|
8079
7984
|
}
|
|
8080
7985
|
|
|
8081
7986
|
// src/editor/components/inline-image-menu/inline-image-bubble-menu.tsx
|
|
8082
|
-
import { BubbleMenu as
|
|
8083
|
-
import { sticky as
|
|
7987
|
+
import { BubbleMenu as BubbleMenu3 } from "@tiptap/react";
|
|
7988
|
+
import { sticky as sticky3 } from "tippy.js";
|
|
8084
7989
|
|
|
8085
7990
|
// src/editor/nodes/inline-image/inline-image.tsx
|
|
8086
7991
|
import { mergeAttributes as mergeAttributes4, Node as Node5 } from "@tiptap/core";
|
|
@@ -8197,10 +8102,10 @@ var InlineImageExtension = Node5.create({
|
|
|
8197
8102
|
});
|
|
8198
8103
|
|
|
8199
8104
|
// src/editor/components/inline-image-menu/use-inline-image-state.tsx
|
|
8200
|
-
import { useEditorState as
|
|
8201
|
-
import
|
|
8105
|
+
import { useEditorState as useEditorState3 } from "@tiptap/react";
|
|
8106
|
+
import deepEql3 from "fast-deep-equal";
|
|
8202
8107
|
var useInlineImageState = (editor) => {
|
|
8203
|
-
const states =
|
|
8108
|
+
const states = useEditorState3({
|
|
8204
8109
|
editor,
|
|
8205
8110
|
selector: ({ editor: editor2 }) => {
|
|
8206
8111
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -8213,14 +8118,14 @@ var useInlineImageState = (editor) => {
|
|
|
8213
8118
|
isExternalLinkVariable: (_h = (_g = editor2.getAttributes("inlineImage")) == null ? void 0 : _g.isExternalLinkVariable) != null ? _h : false
|
|
8214
8119
|
};
|
|
8215
8120
|
},
|
|
8216
|
-
equalityFn:
|
|
8121
|
+
equalityFn: deepEql3
|
|
8217
8122
|
});
|
|
8218
8123
|
return states;
|
|
8219
8124
|
};
|
|
8220
8125
|
|
|
8221
8126
|
// src/editor/components/inline-image-menu/inline-image-bubble-menu.tsx
|
|
8222
8127
|
import { ImageDownIcon } from "lucide-react";
|
|
8223
|
-
import { jsx as
|
|
8128
|
+
import { jsx as jsx37, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
8224
8129
|
function InlineImageBubbleMenu(props) {
|
|
8225
8130
|
var _a, _b;
|
|
8226
8131
|
const { editor, appendTo } = props;
|
|
@@ -8239,17 +8144,17 @@ function InlineImageBubbleMenu(props) {
|
|
|
8239
8144
|
popperOptions: {
|
|
8240
8145
|
modifiers: [{ name: "flip", enabled: false }]
|
|
8241
8146
|
},
|
|
8242
|
-
plugins: [
|
|
8147
|
+
plugins: [sticky3],
|
|
8243
8148
|
sticky: "popper",
|
|
8244
8149
|
maxWidth: "100%"
|
|
8245
8150
|
}
|
|
8246
8151
|
});
|
|
8247
|
-
return /* @__PURE__ */
|
|
8248
|
-
|
|
8152
|
+
return /* @__PURE__ */ jsx37(
|
|
8153
|
+
BubbleMenu3,
|
|
8249
8154
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
8250
8155
|
className: "mly:flex mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:p-0.5 mly:shadow-md",
|
|
8251
|
-
children: /* @__PURE__ */
|
|
8252
|
-
/* @__PURE__ */
|
|
8156
|
+
children: /* @__PURE__ */ jsx37(TooltipProvider, { children: /* @__PURE__ */ jsxs19("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
8157
|
+
/* @__PURE__ */ jsx37(
|
|
8253
8158
|
LinkInputPopover,
|
|
8254
8159
|
{
|
|
8255
8160
|
defaultValue: (_a = state == null ? void 0 : state.src) != null ? _a : "",
|
|
@@ -8265,7 +8170,7 @@ function InlineImageBubbleMenu(props) {
|
|
|
8265
8170
|
isVariable: state.isSrcVariable
|
|
8266
8171
|
}
|
|
8267
8172
|
),
|
|
8268
|
-
/* @__PURE__ */
|
|
8173
|
+
/* @__PURE__ */ jsx37(
|
|
8269
8174
|
LinkInputPopover,
|
|
8270
8175
|
{
|
|
8271
8176
|
defaultValue: (_b = state == null ? void 0 : state.imageExternalLink) != null ? _b : "",
|
|
@@ -8280,7 +8185,7 @@ function InlineImageBubbleMenu(props) {
|
|
|
8280
8185
|
isVariable: state.isExternalLinkVariable
|
|
8281
8186
|
}
|
|
8282
8187
|
),
|
|
8283
|
-
/* @__PURE__ */
|
|
8188
|
+
/* @__PURE__ */ jsx37(
|
|
8284
8189
|
ImageSize,
|
|
8285
8190
|
{
|
|
8286
8191
|
dimension: "height",
|
|
@@ -8299,16 +8204,16 @@ function InlineImageBubbleMenu(props) {
|
|
|
8299
8204
|
}
|
|
8300
8205
|
|
|
8301
8206
|
// src/editor/components/repeat-menu/repeat-bubble-menu.tsx
|
|
8302
|
-
import { BubbleMenu as
|
|
8207
|
+
import { BubbleMenu as BubbleMenu4, findChildren } from "@tiptap/react";
|
|
8303
8208
|
import { InfoIcon as InfoIcon2 } from "lucide-react";
|
|
8304
|
-
import { useCallback as
|
|
8305
|
-
import { sticky as
|
|
8209
|
+
import { useCallback as useCallback7, useMemo as useMemo7, useRef as useRef8, useState as useState8 } from "react";
|
|
8210
|
+
import { sticky as sticky4 } from "tippy.js";
|
|
8306
8211
|
|
|
8307
8212
|
// src/editor/components/repeat-menu/use-repeat-state.ts
|
|
8308
|
-
import { useEditorState as
|
|
8309
|
-
import
|
|
8213
|
+
import { useEditorState as useEditorState4 } from "@tiptap/react";
|
|
8214
|
+
import deepEql4 from "fast-deep-equal";
|
|
8310
8215
|
var useRepeatState = (editor) => {
|
|
8311
|
-
const states =
|
|
8216
|
+
const states = useEditorState4({
|
|
8312
8217
|
editor,
|
|
8313
8218
|
selector: (ctx) => {
|
|
8314
8219
|
var _a, _b;
|
|
@@ -8318,20 +8223,20 @@ var useRepeatState = (editor) => {
|
|
|
8318
8223
|
isSectionActive: ctx.editor.isActive("section")
|
|
8319
8224
|
};
|
|
8320
8225
|
},
|
|
8321
|
-
equalityFn:
|
|
8226
|
+
equalityFn: deepEql4
|
|
8322
8227
|
});
|
|
8323
8228
|
return states;
|
|
8324
8229
|
};
|
|
8325
8230
|
|
|
8326
8231
|
// src/editor/components/repeat-menu/repeat-bubble-menu.tsx
|
|
8327
|
-
import { jsx as
|
|
8232
|
+
import { jsx as jsx38, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
8328
8233
|
function RepeatBubbleMenu(props) {
|
|
8329
8234
|
const { appendTo, editor } = props;
|
|
8330
8235
|
if (!editor) {
|
|
8331
8236
|
return null;
|
|
8332
8237
|
}
|
|
8333
8238
|
const state = useRepeatState(editor);
|
|
8334
|
-
const getReferenceClientRect =
|
|
8239
|
+
const getReferenceClientRect = useCallback7(() => {
|
|
8335
8240
|
const renderContainer = getRenderContainer(editor, "repeat");
|
|
8336
8241
|
const rect = (renderContainer == null ? void 0 : renderContainer.getBoundingClientRect()) || new DOMRect(-1e3, -1e3, 0, 0);
|
|
8337
8242
|
return rect;
|
|
@@ -8356,7 +8261,7 @@ function RepeatBubbleMenu(props) {
|
|
|
8356
8261
|
},
|
|
8357
8262
|
getReferenceClientRect,
|
|
8358
8263
|
appendTo: () => appendTo == null ? void 0 : appendTo.current,
|
|
8359
|
-
plugins: [
|
|
8264
|
+
plugins: [sticky4],
|
|
8360
8265
|
sticky: "popper",
|
|
8361
8266
|
maxWidth: "auto"
|
|
8362
8267
|
},
|
|
@@ -8376,21 +8281,21 @@ function RepeatBubbleMenu(props) {
|
|
|
8376
8281
|
}).map((variable) => variable.name);
|
|
8377
8282
|
}, [variables, eachKey, editor]);
|
|
8378
8283
|
const isValidEachKey = eachKey;
|
|
8379
|
-
return /* @__PURE__ */
|
|
8380
|
-
|
|
8284
|
+
return /* @__PURE__ */ jsx38(
|
|
8285
|
+
BubbleMenu4,
|
|
8381
8286
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
8382
8287
|
className: "mly:flex mly:items-stretch mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:p-0.5 mly:shadow-md",
|
|
8383
|
-
children: /* @__PURE__ */
|
|
8384
|
-
/* @__PURE__ */
|
|
8288
|
+
children: /* @__PURE__ */ jsxs20(TooltipProvider, { children: [
|
|
8289
|
+
/* @__PURE__ */ jsxs20("div", { className: "mly:flex mly:items-center mly:gap-1.5 mly:px-1.5 mly:text-sm mly:leading-none", children: [
|
|
8385
8290
|
"Repeat",
|
|
8386
|
-
/* @__PURE__ */
|
|
8387
|
-
/* @__PURE__ */
|
|
8291
|
+
/* @__PURE__ */ jsxs20(Tooltip, { children: [
|
|
8292
|
+
/* @__PURE__ */ jsx38(TooltipTrigger, { children: /* @__PURE__ */ jsx38(
|
|
8388
8293
|
InfoIcon2,
|
|
8389
8294
|
{
|
|
8390
8295
|
className: cn("mly:size-3 mly:stroke-[2.5] mly:text-gray-500")
|
|
8391
8296
|
}
|
|
8392
8297
|
) }),
|
|
8393
|
-
/* @__PURE__ */
|
|
8298
|
+
/* @__PURE__ */ jsx38(
|
|
8394
8299
|
TooltipContent,
|
|
8395
8300
|
{
|
|
8396
8301
|
sideOffset: 14,
|
|
@@ -8401,7 +8306,7 @@ function RepeatBubbleMenu(props) {
|
|
|
8401
8306
|
)
|
|
8402
8307
|
] })
|
|
8403
8308
|
] }),
|
|
8404
|
-
!isUpdatingKey && /* @__PURE__ */
|
|
8309
|
+
!isUpdatingKey && /* @__PURE__ */ jsx38(
|
|
8405
8310
|
"button",
|
|
8406
8311
|
{
|
|
8407
8312
|
onClick: () => {
|
|
@@ -8422,7 +8327,7 @@ function RepeatBubbleMenu(props) {
|
|
|
8422
8327
|
})
|
|
8423
8328
|
}
|
|
8424
8329
|
),
|
|
8425
|
-
isUpdatingKey && /* @__PURE__ */
|
|
8330
|
+
isUpdatingKey && /* @__PURE__ */ jsx38(
|
|
8426
8331
|
"form",
|
|
8427
8332
|
{
|
|
8428
8333
|
onSubmit: (e) => {
|
|
@@ -8434,7 +8339,7 @@ function RepeatBubbleMenu(props) {
|
|
|
8434
8339
|
setIsUpdatingKey(false);
|
|
8435
8340
|
}
|
|
8436
8341
|
},
|
|
8437
|
-
children: /* @__PURE__ */
|
|
8342
|
+
children: /* @__PURE__ */ jsx38(
|
|
8438
8343
|
InputAutocomplete,
|
|
8439
8344
|
{
|
|
8440
8345
|
editor,
|
|
@@ -8460,8 +8365,8 @@ function RepeatBubbleMenu(props) {
|
|
|
8460
8365
|
)
|
|
8461
8366
|
}
|
|
8462
8367
|
),
|
|
8463
|
-
/* @__PURE__ */
|
|
8464
|
-
/* @__PURE__ */
|
|
8368
|
+
/* @__PURE__ */ jsx38(Divider, {}),
|
|
8369
|
+
/* @__PURE__ */ jsx38(
|
|
8465
8370
|
ShowPopover,
|
|
8466
8371
|
{
|
|
8467
8372
|
showIfKey: state.currentShowIfKey,
|
|
@@ -8479,16 +8384,16 @@ function RepeatBubbleMenu(props) {
|
|
|
8479
8384
|
}
|
|
8480
8385
|
|
|
8481
8386
|
// src/editor/components/section-menu/section-bubble-menu.tsx
|
|
8482
|
-
import { BubbleMenu as
|
|
8387
|
+
import { BubbleMenu as BubbleMenu5, findChildren as findChildren2 } from "@tiptap/react";
|
|
8483
8388
|
import { ChevronUp, Trash as Trash3 } from "lucide-react";
|
|
8484
|
-
import { useCallback as
|
|
8485
|
-
import { sticky as
|
|
8389
|
+
import { useCallback as useCallback8 } from "react";
|
|
8390
|
+
import { sticky as sticky5 } from "tippy.js";
|
|
8486
8391
|
|
|
8487
8392
|
// src/editor/components/icons/border-color.tsx
|
|
8488
|
-
import { jsx as
|
|
8393
|
+
import { jsx as jsx39, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
8489
8394
|
function BorderColor(props) {
|
|
8490
8395
|
const _a = props, { topBarClassName } = _a, rest = __objRest(_a, ["topBarClassName"]);
|
|
8491
|
-
return /* @__PURE__ */
|
|
8396
|
+
return /* @__PURE__ */ jsxs21(
|
|
8492
8397
|
"svg",
|
|
8493
8398
|
__spreadProps(__spreadValues({
|
|
8494
8399
|
width: 11,
|
|
@@ -8498,8 +8403,8 @@ function BorderColor(props) {
|
|
|
8498
8403
|
xmlns: "http://www.w3.org/2000/svg"
|
|
8499
8404
|
}, rest), {
|
|
8500
8405
|
children: [
|
|
8501
|
-
/* @__PURE__ */
|
|
8502
|
-
/* @__PURE__ */
|
|
8406
|
+
/* @__PURE__ */ jsx39("path", { d: "M0 11H10.6667", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
8407
|
+
/* @__PURE__ */ jsx39(
|
|
8503
8408
|
"path",
|
|
8504
8409
|
{
|
|
8505
8410
|
d: "M0.666504 9V6.33333C0.666504 3.38781 3.05432 1 5.99984 1H10.6665",
|
|
@@ -8513,9 +8418,9 @@ function BorderColor(props) {
|
|
|
8513
8418
|
}
|
|
8514
8419
|
|
|
8515
8420
|
// src/editor/components/icons/margin-icon.tsx
|
|
8516
|
-
import { jsx as
|
|
8421
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
8517
8422
|
function MarginIcon(props) {
|
|
8518
|
-
return /* @__PURE__ */
|
|
8423
|
+
return /* @__PURE__ */ jsx40(
|
|
8519
8424
|
"svg",
|
|
8520
8425
|
__spreadProps(__spreadValues({
|
|
8521
8426
|
width: 12,
|
|
@@ -8524,7 +8429,7 @@ function MarginIcon(props) {
|
|
|
8524
8429
|
fill: "none",
|
|
8525
8430
|
xmlns: "http://www.w3.org/2000/svg"
|
|
8526
8431
|
}, props), {
|
|
8527
|
-
children: /* @__PURE__ */
|
|
8432
|
+
children: /* @__PURE__ */ jsx40(
|
|
8528
8433
|
"path",
|
|
8529
8434
|
{
|
|
8530
8435
|
d: "M10.5 10.499V1.49902M1.5 10.499V1.49902M4.5 5.99902C4.5 5.53308 4.5 5.30011 4.57612 5.11634C4.67761 4.87131 4.87229 4.67664 5.11732 4.57514C5.30109 4.49902 5.53406 4.49902 6 4.49902C6.46594 4.49902 6.69891 4.49902 6.88268 4.57514C7.12771 4.67664 7.32239 4.87131 7.42388 5.11634C7.5 5.30011 7.5 5.53308 7.5 5.99902C7.5 6.46496 7.5 6.69794 7.42388 6.88171C7.32239 7.12673 7.12771 7.32141 6.88268 7.4229C6.69891 7.49902 6.46594 7.49902 6 7.49902C5.53406 7.49902 5.30109 7.49902 5.11732 7.4229C4.87229 7.32141 4.67761 7.12673 4.57612 6.88171C4.5 6.69794 4.5 6.46496 4.5 5.99902Z",
|
|
@@ -8538,9 +8443,9 @@ function MarginIcon(props) {
|
|
|
8538
8443
|
}
|
|
8539
8444
|
|
|
8540
8445
|
// src/editor/components/icons/padding-icon.tsx
|
|
8541
|
-
import { jsx as
|
|
8446
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
8542
8447
|
function PaddingIcon(props) {
|
|
8543
|
-
return /* @__PURE__ */
|
|
8448
|
+
return /* @__PURE__ */ jsx41(
|
|
8544
8449
|
"svg",
|
|
8545
8450
|
__spreadProps(__spreadValues({
|
|
8546
8451
|
width: 10,
|
|
@@ -8549,7 +8454,7 @@ function PaddingIcon(props) {
|
|
|
8549
8454
|
fill: "none",
|
|
8550
8455
|
xmlns: "http://www.w3.org/2000/svg"
|
|
8551
8456
|
}, props), {
|
|
8552
|
-
children: /* @__PURE__ */
|
|
8457
|
+
children: /* @__PURE__ */ jsx41(
|
|
8553
8458
|
"path",
|
|
8554
8459
|
{
|
|
8555
8460
|
d: "M9.50244 0.501526L9.10244 0.501526C8.54239 0.501526 8.26236 0.501526 8.04845 0.610519C7.86029 0.706392 7.70731 0.859373 7.61144 1.04754C7.50244 1.26145 7.50244 1.54147 7.50244 2.10153V7.90153C7.50244 8.46158 7.50244 8.74161 7.61144 8.95552C7.70731 9.14368 7.86029 9.29666 8.04845 9.39253C8.26236 9.50153 8.54239 9.50153 9.10244 9.50153H9.50244M0.502441 0.501527L0.902441 0.501527C1.46249 0.501527 1.74252 0.501527 1.95643 0.61052C2.14459 0.706393 2.29757 0.859374 2.39345 1.04754C2.50244 1.26145 2.50244 1.54147 2.50244 2.10153L2.50244 7.90153C2.50244 8.46158 2.50244 8.74161 2.39345 8.95552C2.29757 9.14368 2.14459 9.29666 1.95643 9.39253C1.74252 9.50153 1.46249 9.50153 0.902442 9.50153H0.502442M4.99994 7.99903V1.99903",
|
|
@@ -8564,7 +8469,7 @@ function PaddingIcon(props) {
|
|
|
8564
8469
|
|
|
8565
8470
|
// src/editor/components/ui/color-picker.tsx
|
|
8566
8471
|
import { HexColorPicker, HexColorInput } from "react-colorful";
|
|
8567
|
-
import { jsx as
|
|
8472
|
+
import { jsx as jsx42, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
8568
8473
|
function ColorPicker(props) {
|
|
8569
8474
|
const {
|
|
8570
8475
|
color,
|
|
@@ -8582,14 +8487,14 @@ function ColorPicker(props) {
|
|
|
8582
8487
|
onColorChange(color2);
|
|
8583
8488
|
});
|
|
8584
8489
|
};
|
|
8585
|
-
const popoverButton = /* @__PURE__ */
|
|
8490
|
+
const popoverButton = /* @__PURE__ */ jsx42(PopoverTrigger, { asChild: true, children: children || /* @__PURE__ */ jsx42(
|
|
8586
8491
|
BaseButton,
|
|
8587
8492
|
{
|
|
8588
8493
|
variant: "ghost",
|
|
8589
8494
|
className: "mly:h-7 mly:w-7 mly:shrink-0",
|
|
8590
8495
|
size: "sm",
|
|
8591
8496
|
type: "button",
|
|
8592
|
-
children: /* @__PURE__ */
|
|
8497
|
+
children: /* @__PURE__ */ jsx42(
|
|
8593
8498
|
"div",
|
|
8594
8499
|
{
|
|
8595
8500
|
className: cn(
|
|
@@ -8603,7 +8508,7 @@ function ColorPicker(props) {
|
|
|
8603
8508
|
)
|
|
8604
8509
|
}
|
|
8605
8510
|
) });
|
|
8606
|
-
return /* @__PURE__ */
|
|
8511
|
+
return /* @__PURE__ */ jsxs22(
|
|
8607
8512
|
Popover,
|
|
8608
8513
|
{
|
|
8609
8514
|
onOpenChange: (open) => {
|
|
@@ -8612,17 +8517,17 @@ function ColorPicker(props) {
|
|
|
8612
8517
|
}
|
|
8613
8518
|
},
|
|
8614
8519
|
children: [
|
|
8615
|
-
tooltip ? /* @__PURE__ */
|
|
8616
|
-
/* @__PURE__ */
|
|
8617
|
-
/* @__PURE__ */
|
|
8520
|
+
tooltip ? /* @__PURE__ */ jsxs22(Tooltip, { children: [
|
|
8521
|
+
/* @__PURE__ */ jsx42(TooltipTrigger, { asChild: true, children: popoverButton }),
|
|
8522
|
+
/* @__PURE__ */ jsx42(TooltipContent, { sideOffset: 8, children: tooltip })
|
|
8618
8523
|
] }) : popoverButton,
|
|
8619
|
-
/* @__PURE__ */
|
|
8524
|
+
/* @__PURE__ */ jsx42(
|
|
8620
8525
|
PopoverContent,
|
|
8621
8526
|
{
|
|
8622
8527
|
className: "mly:w-full mly:rounded-none mly:border-0 mly:bg-transparent! mly:p-0! mly:shadow-none mly:drop-shadow-md",
|
|
8623
8528
|
sideOffset: 8,
|
|
8624
|
-
children: /* @__PURE__ */
|
|
8625
|
-
/* @__PURE__ */
|
|
8529
|
+
children: /* @__PURE__ */ jsxs22("div", { className: "mly:min-w-[260px] mly:rounded-xl mly:border mly:border-gray-200 mly:bg-white mly:p-4", children: [
|
|
8530
|
+
/* @__PURE__ */ jsx42(
|
|
8626
8531
|
HexColorPicker,
|
|
8627
8532
|
{
|
|
8628
8533
|
color,
|
|
@@ -8630,7 +8535,7 @@ function ColorPicker(props) {
|
|
|
8630
8535
|
className: "mly:flex mly:w-full! mly:flex-col mly:gap-4"
|
|
8631
8536
|
}
|
|
8632
8537
|
),
|
|
8633
|
-
/* @__PURE__ */
|
|
8538
|
+
/* @__PURE__ */ jsx42(
|
|
8634
8539
|
HexColorInput,
|
|
8635
8540
|
{
|
|
8636
8541
|
alpha: true,
|
|
@@ -8640,10 +8545,10 @@ function ColorPicker(props) {
|
|
|
8640
8545
|
prefixed: true
|
|
8641
8546
|
}
|
|
8642
8547
|
),
|
|
8643
|
-
suggestedColors.length > 0 && /* @__PURE__ */
|
|
8644
|
-
/* @__PURE__ */
|
|
8645
|
-
/* @__PURE__ */
|
|
8646
|
-
/* @__PURE__ */
|
|
8548
|
+
suggestedColors.length > 0 && /* @__PURE__ */ jsxs22("div", { children: [
|
|
8549
|
+
/* @__PURE__ */ jsx42("div", { className: "-mly:mx-4 mly:my-4 mly:h-px mly:bg-gray-200" }),
|
|
8550
|
+
/* @__PURE__ */ jsx42("h2", { className: "mly:text-xs mly:text-gray-500", children: "Recently used" }),
|
|
8551
|
+
/* @__PURE__ */ jsx42("div", { className: "mly:mt-2 mly:flex mly:flex-wrap mly:gap-0.5", children: suggestedColors.map((suggestedColor) => /* @__PURE__ */ jsx42(
|
|
8647
8552
|
BaseButton,
|
|
8648
8553
|
{
|
|
8649
8554
|
variant: "ghost",
|
|
@@ -8651,7 +8556,7 @@ function ColorPicker(props) {
|
|
|
8651
8556
|
className: "!mly:size-7 mly:shrink-0",
|
|
8652
8557
|
type: "button",
|
|
8653
8558
|
onClick: () => handleColorChange(suggestedColor),
|
|
8654
|
-
children: /* @__PURE__ */
|
|
8559
|
+
children: /* @__PURE__ */ jsx42(
|
|
8655
8560
|
"div",
|
|
8656
8561
|
{
|
|
8657
8562
|
className: "mly:h-4 mly:w-4 mly:shrink-0 mly:rounded",
|
|
@@ -8673,10 +8578,10 @@ function ColorPicker(props) {
|
|
|
8673
8578
|
}
|
|
8674
8579
|
|
|
8675
8580
|
// src/editor/components/section-menu/use-section-state.tsx
|
|
8676
|
-
import { useEditorState as
|
|
8677
|
-
import
|
|
8581
|
+
import { useEditorState as useEditorState5 } from "@tiptap/react";
|
|
8582
|
+
import deepEql5 from "fast-deep-equal";
|
|
8678
8583
|
var useSectionState = (editor) => {
|
|
8679
|
-
const states =
|
|
8584
|
+
const states = useEditorState5({
|
|
8680
8585
|
editor,
|
|
8681
8586
|
selector: (ctx) => {
|
|
8682
8587
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
@@ -8698,19 +8603,19 @@ var useSectionState = (editor) => {
|
|
|
8698
8603
|
currentShowIfKey: ((_n = ctx.editor.getAttributes("section")) == null ? void 0 : _n.showIfKey) || ""
|
|
8699
8604
|
};
|
|
8700
8605
|
},
|
|
8701
|
-
equalityFn:
|
|
8606
|
+
equalityFn: deepEql5
|
|
8702
8607
|
});
|
|
8703
8608
|
return states;
|
|
8704
8609
|
};
|
|
8705
8610
|
|
|
8706
8611
|
// src/editor/components/section-menu/section-bubble-menu.tsx
|
|
8707
|
-
import { Fragment as Fragment6, jsx as
|
|
8612
|
+
import { Fragment as Fragment6, jsx as jsx43, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
8708
8613
|
function SectionBubbleMenu(props) {
|
|
8709
8614
|
const { appendTo, editor } = props;
|
|
8710
8615
|
if (!editor) {
|
|
8711
8616
|
return null;
|
|
8712
8617
|
}
|
|
8713
|
-
const getReferenceClientRect =
|
|
8618
|
+
const getReferenceClientRect = useCallback8(() => {
|
|
8714
8619
|
const renderContainer = getRenderContainer(editor, "section");
|
|
8715
8620
|
const rect = (renderContainer == null ? void 0 : renderContainer.getBoundingClientRect()) || new DOMRect(-1e3, -1e3, 0, 0);
|
|
8716
8621
|
return rect;
|
|
@@ -8739,7 +8644,7 @@ function SectionBubbleMenu(props) {
|
|
|
8739
8644
|
},
|
|
8740
8645
|
getReferenceClientRect,
|
|
8741
8646
|
appendTo: () => appendTo == null ? void 0 : appendTo.current,
|
|
8742
|
-
plugins: [
|
|
8647
|
+
plugins: [sticky5],
|
|
8743
8648
|
sticky: "popper",
|
|
8744
8649
|
maxWidth: "auto"
|
|
8745
8650
|
},
|
|
@@ -8751,12 +8656,12 @@ function SectionBubbleMenu(props) {
|
|
|
8751
8656
|
{ value: "6", label: "Smooth" },
|
|
8752
8657
|
{ value: "9999", label: "Round" }
|
|
8753
8658
|
];
|
|
8754
|
-
return /* @__PURE__ */
|
|
8755
|
-
|
|
8659
|
+
return /* @__PURE__ */ jsx43(
|
|
8660
|
+
BubbleMenu5,
|
|
8756
8661
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
8757
8662
|
className: "mly:flex mly:items-stretch mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:p-0.5 mly:shadow-md",
|
|
8758
|
-
children: /* @__PURE__ */
|
|
8759
|
-
/* @__PURE__ */
|
|
8663
|
+
children: /* @__PURE__ */ jsxs23(TooltipProvider, { children: [
|
|
8664
|
+
/* @__PURE__ */ jsx43(
|
|
8760
8665
|
AlignmentSwitch,
|
|
8761
8666
|
{
|
|
8762
8667
|
alignment: state.currentAlignment,
|
|
@@ -8768,9 +8673,9 @@ function SectionBubbleMenu(props) {
|
|
|
8768
8673
|
}
|
|
8769
8674
|
}
|
|
8770
8675
|
),
|
|
8771
|
-
/* @__PURE__ */
|
|
8772
|
-
/* @__PURE__ */
|
|
8773
|
-
/* @__PURE__ */
|
|
8676
|
+
/* @__PURE__ */ jsx43(Divider, {}),
|
|
8677
|
+
/* @__PURE__ */ jsxs23("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
8678
|
+
/* @__PURE__ */ jsx43(
|
|
8774
8679
|
Select,
|
|
8775
8680
|
{
|
|
8776
8681
|
label: "Border Radius",
|
|
@@ -8786,7 +8691,7 @@ function SectionBubbleMenu(props) {
|
|
|
8786
8691
|
className: "mly:capitalize"
|
|
8787
8692
|
}
|
|
8788
8693
|
),
|
|
8789
|
-
/* @__PURE__ */
|
|
8694
|
+
/* @__PURE__ */ jsx43(
|
|
8790
8695
|
Select,
|
|
8791
8696
|
{
|
|
8792
8697
|
label: "Border Width",
|
|
@@ -8808,8 +8713,8 @@ function SectionBubbleMenu(props) {
|
|
|
8808
8713
|
}
|
|
8809
8714
|
)
|
|
8810
8715
|
] }),
|
|
8811
|
-
/* @__PURE__ */
|
|
8812
|
-
/* @__PURE__ */
|
|
8716
|
+
/* @__PURE__ */ jsx43(Divider, {}),
|
|
8717
|
+
/* @__PURE__ */ jsx43(
|
|
8813
8718
|
Select,
|
|
8814
8719
|
{
|
|
8815
8720
|
icon: MarginIcon,
|
|
@@ -8837,8 +8742,8 @@ function SectionBubbleMenu(props) {
|
|
|
8837
8742
|
className: "mly:capitalize"
|
|
8838
8743
|
}
|
|
8839
8744
|
),
|
|
8840
|
-
/* @__PURE__ */
|
|
8841
|
-
/* @__PURE__ */
|
|
8745
|
+
/* @__PURE__ */ jsx43(Divider, {}),
|
|
8746
|
+
/* @__PURE__ */ jsx43(
|
|
8842
8747
|
Select,
|
|
8843
8748
|
{
|
|
8844
8749
|
icon: PaddingIcon,
|
|
@@ -8866,9 +8771,9 @@ function SectionBubbleMenu(props) {
|
|
|
8866
8771
|
className: "mly:capitalize"
|
|
8867
8772
|
}
|
|
8868
8773
|
),
|
|
8869
|
-
/* @__PURE__ */
|
|
8870
|
-
/* @__PURE__ */
|
|
8871
|
-
/* @__PURE__ */
|
|
8774
|
+
/* @__PURE__ */ jsx43(Divider, {}),
|
|
8775
|
+
/* @__PURE__ */ jsxs23("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
8776
|
+
/* @__PURE__ */ jsx43(
|
|
8872
8777
|
ColorPicker,
|
|
8873
8778
|
{
|
|
8874
8779
|
color: state.currentBorderColor,
|
|
@@ -8879,14 +8784,14 @@ function SectionBubbleMenu(props) {
|
|
|
8879
8784
|
});
|
|
8880
8785
|
},
|
|
8881
8786
|
tooltip: "Border Color",
|
|
8882
|
-
children: /* @__PURE__ */
|
|
8787
|
+
children: /* @__PURE__ */ jsx43(
|
|
8883
8788
|
BaseButton,
|
|
8884
8789
|
{
|
|
8885
8790
|
variant: "ghost",
|
|
8886
8791
|
className: "mly:h-7 mly:w-7 mly:shrink-0",
|
|
8887
8792
|
size: "sm",
|
|
8888
8793
|
type: "button",
|
|
8889
|
-
children: /* @__PURE__ */
|
|
8794
|
+
children: /* @__PURE__ */ jsx43(
|
|
8890
8795
|
BorderColor,
|
|
8891
8796
|
{
|
|
8892
8797
|
className: "mly:size-3 mly:shrink-0",
|
|
@@ -8900,7 +8805,7 @@ function SectionBubbleMenu(props) {
|
|
|
8900
8805
|
)
|
|
8901
8806
|
}
|
|
8902
8807
|
),
|
|
8903
|
-
/* @__PURE__ */
|
|
8808
|
+
/* @__PURE__ */ jsx43(
|
|
8904
8809
|
ColorPicker,
|
|
8905
8810
|
{
|
|
8906
8811
|
color: state.currentBackgroundColor,
|
|
@@ -8916,8 +8821,8 @@ function SectionBubbleMenu(props) {
|
|
|
8916
8821
|
}
|
|
8917
8822
|
)
|
|
8918
8823
|
] }),
|
|
8919
|
-
/* @__PURE__ */
|
|
8920
|
-
/* @__PURE__ */
|
|
8824
|
+
/* @__PURE__ */ jsx43(Divider, {}),
|
|
8825
|
+
/* @__PURE__ */ jsx43(
|
|
8921
8826
|
BubbleMenuButton,
|
|
8922
8827
|
{
|
|
8923
8828
|
icon: Trash3,
|
|
@@ -8927,14 +8832,14 @@ function SectionBubbleMenu(props) {
|
|
|
8927
8832
|
}
|
|
8928
8833
|
}
|
|
8929
8834
|
),
|
|
8930
|
-
state.isColumnsActive && /* @__PURE__ */
|
|
8931
|
-
/* @__PURE__ */
|
|
8932
|
-
/* @__PURE__ */
|
|
8933
|
-
/* @__PURE__ */
|
|
8835
|
+
state.isColumnsActive && /* @__PURE__ */ jsxs23(Fragment6, { children: [
|
|
8836
|
+
/* @__PURE__ */ jsx43(Divider, {}),
|
|
8837
|
+
/* @__PURE__ */ jsxs23(Popover, { children: [
|
|
8838
|
+
/* @__PURE__ */ jsxs23(PopoverTrigger, { className: "mly:flex mly:items-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", children: [
|
|
8934
8839
|
"Column",
|
|
8935
|
-
/* @__PURE__ */
|
|
8840
|
+
/* @__PURE__ */ jsx43(ChevronUp, { className: "mly:h-3 mly:w-3" })
|
|
8936
8841
|
] }),
|
|
8937
|
-
/* @__PURE__ */
|
|
8842
|
+
/* @__PURE__ */ jsx43(
|
|
8938
8843
|
PopoverContent,
|
|
8939
8844
|
{
|
|
8940
8845
|
className: "mly:w-max mly:rounded-lg mly:p-0.5!",
|
|
@@ -8947,7 +8852,7 @@ function SectionBubbleMenu(props) {
|
|
|
8947
8852
|
onCloseAutoFocus: (e) => {
|
|
8948
8853
|
e.preventDefault();
|
|
8949
8854
|
},
|
|
8950
|
-
children: /* @__PURE__ */
|
|
8855
|
+
children: /* @__PURE__ */ jsx43(ColumnsBubbleMenuContent, { editor })
|
|
8951
8856
|
}
|
|
8952
8857
|
)
|
|
8953
8858
|
] })
|
|
@@ -8958,13 +8863,13 @@ function SectionBubbleMenu(props) {
|
|
|
8958
8863
|
}
|
|
8959
8864
|
|
|
8960
8865
|
// src/editor/components/spacer-menu/spacer-bubble-menu.tsx
|
|
8961
|
-
import { BubbleMenu as
|
|
8866
|
+
import { BubbleMenu as BubbleMenu6 } from "@tiptap/react";
|
|
8962
8867
|
|
|
8963
8868
|
// src/editor/components/spacer-menu/use-spacer-state.ts
|
|
8964
|
-
import { useEditorState as
|
|
8965
|
-
import
|
|
8869
|
+
import { useEditorState as useEditorState6 } from "@tiptap/react";
|
|
8870
|
+
import deepEql6 from "fast-deep-equal";
|
|
8966
8871
|
var useSpacerState = (editor) => {
|
|
8967
|
-
const states =
|
|
8872
|
+
const states = useEditorState6({
|
|
8968
8873
|
editor,
|
|
8969
8874
|
selector: (ctx) => {
|
|
8970
8875
|
var _a;
|
|
@@ -8972,14 +8877,14 @@ var useSpacerState = (editor) => {
|
|
|
8972
8877
|
currentShowIfKey: ((_a = ctx.editor.getAttributes("spacer")) == null ? void 0 : _a.showIfKey) || ""
|
|
8973
8878
|
};
|
|
8974
8879
|
},
|
|
8975
|
-
equalityFn:
|
|
8880
|
+
equalityFn: deepEql6
|
|
8976
8881
|
});
|
|
8977
8882
|
return states;
|
|
8978
8883
|
};
|
|
8979
8884
|
|
|
8980
8885
|
// src/editor/components/spacer-menu/spacer-bubble-menu.tsx
|
|
8981
8886
|
import { useMemo as useMemo8 } from "react";
|
|
8982
|
-
import { jsx as
|
|
8887
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
8983
8888
|
function SpacerBubbleMenu(props) {
|
|
8984
8889
|
const { editor, appendTo } = props;
|
|
8985
8890
|
if (!editor) {
|
|
@@ -9011,11 +8916,11 @@ function SpacerBubbleMenu(props) {
|
|
|
9011
8916
|
}
|
|
9012
8917
|
});
|
|
9013
8918
|
const state = useSpacerState(editor);
|
|
9014
|
-
return /* @__PURE__ */
|
|
9015
|
-
|
|
8919
|
+
return /* @__PURE__ */ jsx44(
|
|
8920
|
+
BubbleMenu6,
|
|
9016
8921
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
9017
8922
|
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",
|
|
9018
|
-
children: /* @__PURE__ */
|
|
8923
|
+
children: /* @__PURE__ */ jsx44(TooltipProvider, { children: items.map((item, index) => /* @__PURE__ */ jsx44(
|
|
9019
8924
|
BubbleMenuButton,
|
|
9020
8925
|
__spreadValues({
|
|
9021
8926
|
className: "!mly:h-7 mly:w-7 mly:shrink-0 mly:p-0",
|
|
@@ -9256,11 +9161,11 @@ import { NodeViewWrapper as NodeViewWrapper4 } from "@tiptap/react";
|
|
|
9256
9161
|
|
|
9257
9162
|
// src/editor/components/input.tsx
|
|
9258
9163
|
import * as React5 from "react";
|
|
9259
|
-
import { jsx as
|
|
9164
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
9260
9165
|
var Input = React5.forwardRef(
|
|
9261
9166
|
(_a, ref) => {
|
|
9262
9167
|
var _b = _a, { className, type } = _b, props = __objRest(_b, ["className", "type"]);
|
|
9263
|
-
return /* @__PURE__ */
|
|
9168
|
+
return /* @__PURE__ */ jsx45(
|
|
9264
9169
|
"input",
|
|
9265
9170
|
__spreadValues(__spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
|
|
9266
9171
|
type,
|
|
@@ -9278,11 +9183,11 @@ Input.displayName = "Input";
|
|
|
9278
9183
|
|
|
9279
9184
|
// src/editor/components/textarea.tsx
|
|
9280
9185
|
import * as React6 from "react";
|
|
9281
|
-
import { jsx as
|
|
9186
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
9282
9187
|
var Textarea = React6.forwardRef(
|
|
9283
9188
|
(_a, ref) => {
|
|
9284
9189
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
9285
|
-
return /* @__PURE__ */
|
|
9190
|
+
return /* @__PURE__ */ jsx46(
|
|
9286
9191
|
"textarea",
|
|
9287
9192
|
__spreadValues({
|
|
9288
9193
|
className: cn(
|
|
@@ -9298,18 +9203,18 @@ var Textarea = React6.forwardRef(
|
|
|
9298
9203
|
Textarea.displayName = "Textarea";
|
|
9299
9204
|
|
|
9300
9205
|
// src/editor/nodes/link-card.tsx
|
|
9301
|
-
import { jsx as
|
|
9206
|
+
import { jsx as jsx47, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
9302
9207
|
function LinkCardComponent(props) {
|
|
9303
9208
|
const { title, description, link, linkTitle, image: image2, badgeText, subTitle } = props.node.attrs;
|
|
9304
9209
|
const { getPos, editor } = props;
|
|
9305
|
-
return /* @__PURE__ */
|
|
9210
|
+
return /* @__PURE__ */ jsx47(
|
|
9306
9211
|
NodeViewWrapper4,
|
|
9307
9212
|
{
|
|
9308
9213
|
className: `react-component ${props.selected && "ProseMirror-selectednode"}`,
|
|
9309
9214
|
draggable: editor.isEditable,
|
|
9310
9215
|
"data-drag-handle": editor.isEditable,
|
|
9311
|
-
children: /* @__PURE__ */
|
|
9312
|
-
/* @__PURE__ */
|
|
9216
|
+
children: /* @__PURE__ */ jsxs24(Popover, { open: props.selected, children: [
|
|
9217
|
+
/* @__PURE__ */ jsx47(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx47(
|
|
9313
9218
|
"div",
|
|
9314
9219
|
{
|
|
9315
9220
|
tabIndex: -1,
|
|
@@ -9318,8 +9223,8 @@ function LinkCardComponent(props) {
|
|
|
9318
9223
|
const pos = getPos();
|
|
9319
9224
|
editor.commands.setNodeSelection(pos);
|
|
9320
9225
|
},
|
|
9321
|
-
children: /* @__PURE__ */
|
|
9322
|
-
image2 && /* @__PURE__ */
|
|
9226
|
+
children: /* @__PURE__ */ jsxs24("div", { className: "mly:no-prose mly:flex mly:flex-col mly:rounded-lg mly:border mly:border-gray-300", children: [
|
|
9227
|
+
image2 && /* @__PURE__ */ jsx47("div", { className: "mly:relative mly:mb-1.5 mly:w-full mly:shrink-0", children: /* @__PURE__ */ jsx47(
|
|
9323
9228
|
"img",
|
|
9324
9229
|
{
|
|
9325
9230
|
src: image2,
|
|
@@ -9328,23 +9233,23 @@ function LinkCardComponent(props) {
|
|
|
9328
9233
|
draggable: editor.isEditable
|
|
9329
9234
|
}
|
|
9330
9235
|
) }),
|
|
9331
|
-
/* @__PURE__ */
|
|
9332
|
-
/* @__PURE__ */
|
|
9333
|
-
/* @__PURE__ */
|
|
9334
|
-
badgeText && /* @__PURE__ */
|
|
9236
|
+
/* @__PURE__ */ jsx47("div", { className: "mly:flex mly:items-stretch mly:p-3", children: /* @__PURE__ */ jsxs24("div", { className: cn("mly:flex mly:flex-col"), children: [
|
|
9237
|
+
/* @__PURE__ */ jsxs24("div", { className: "!mly:mb-1.5 mly:flex mly:items-center mly:gap-1.5", children: [
|
|
9238
|
+
/* @__PURE__ */ jsx47("h2", { className: "!mly:mb-0 mly:text-lg! mly:font-semibold", children: title }),
|
|
9239
|
+
badgeText && /* @__PURE__ */ jsx47("span", { className: "!mly:font-base mly:rounded-md mly:bg-yellow-200 mly:px-2 mly:py-1 mly:font-semibold mly:leading-none text-xs", children: badgeText }),
|
|
9335
9240
|
" ",
|
|
9336
|
-
subTitle && !badgeText && /* @__PURE__ */
|
|
9241
|
+
subTitle && !badgeText && /* @__PURE__ */ jsx47("span", { className: "!mly:font-base mly:font-regular mly:rounded-md mly:leading-none mly:text-gray-400 text-xs", children: subTitle })
|
|
9337
9242
|
] }),
|
|
9338
|
-
/* @__PURE__ */
|
|
9243
|
+
/* @__PURE__ */ jsxs24("p", { className: "!mly:my-0 mly:text-base! mly:text-gray-500", children: [
|
|
9339
9244
|
description,
|
|
9340
9245
|
" ",
|
|
9341
|
-
linkTitle ? /* @__PURE__ */
|
|
9246
|
+
linkTitle ? /* @__PURE__ */ jsx47("a", { href: link, className: "mly:font-semibold", children: linkTitle }) : null
|
|
9342
9247
|
] })
|
|
9343
9248
|
] }) })
|
|
9344
9249
|
] })
|
|
9345
9250
|
}
|
|
9346
9251
|
) }),
|
|
9347
|
-
/* @__PURE__ */
|
|
9252
|
+
/* @__PURE__ */ jsxs24(
|
|
9348
9253
|
PopoverContent,
|
|
9349
9254
|
{
|
|
9350
9255
|
align: "end",
|
|
@@ -9353,9 +9258,9 @@ function LinkCardComponent(props) {
|
|
|
9353
9258
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
9354
9259
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
9355
9260
|
children: [
|
|
9356
|
-
/* @__PURE__ */
|
|
9357
|
-
/* @__PURE__ */
|
|
9358
|
-
/* @__PURE__ */
|
|
9261
|
+
/* @__PURE__ */ jsxs24("label", { className: "mly:w-full mly:space-y-1", children: [
|
|
9262
|
+
/* @__PURE__ */ jsx47("span", { className: "mly:text-xs mly:font-normal mly:text-slate-400", children: "Image" }),
|
|
9263
|
+
/* @__PURE__ */ jsx47(
|
|
9359
9264
|
Input,
|
|
9360
9265
|
{
|
|
9361
9266
|
placeholder: "Add Image",
|
|
@@ -9369,9 +9274,9 @@ function LinkCardComponent(props) {
|
|
|
9369
9274
|
}
|
|
9370
9275
|
)
|
|
9371
9276
|
] }),
|
|
9372
|
-
/* @__PURE__ */
|
|
9373
|
-
/* @__PURE__ */
|
|
9374
|
-
/* @__PURE__ */
|
|
9277
|
+
/* @__PURE__ */ jsxs24("label", { className: "mly:w-full mly:space-y-1", children: [
|
|
9278
|
+
/* @__PURE__ */ jsx47("span", { className: "mly:text-xs mly:font-normal mly:text-slate-400", children: "Title" }),
|
|
9279
|
+
/* @__PURE__ */ jsx47(
|
|
9375
9280
|
Input,
|
|
9376
9281
|
{
|
|
9377
9282
|
placeholder: "Add title",
|
|
@@ -9384,9 +9289,9 @@ function LinkCardComponent(props) {
|
|
|
9384
9289
|
}
|
|
9385
9290
|
)
|
|
9386
9291
|
] }),
|
|
9387
|
-
/* @__PURE__ */
|
|
9388
|
-
/* @__PURE__ */
|
|
9389
|
-
/* @__PURE__ */
|
|
9292
|
+
/* @__PURE__ */ jsxs24("label", { className: "mly:w-full mly:space-y-1", children: [
|
|
9293
|
+
/* @__PURE__ */ jsx47("span", { className: "mly:text-xs mly:font-normal mly:text-slate-400", children: "Description" }),
|
|
9294
|
+
/* @__PURE__ */ jsx47(
|
|
9390
9295
|
Textarea,
|
|
9391
9296
|
{
|
|
9392
9297
|
placeholder: "Add description here",
|
|
@@ -9399,10 +9304,10 @@ function LinkCardComponent(props) {
|
|
|
9399
9304
|
}
|
|
9400
9305
|
)
|
|
9401
9306
|
] }),
|
|
9402
|
-
/* @__PURE__ */
|
|
9403
|
-
/* @__PURE__ */
|
|
9404
|
-
/* @__PURE__ */
|
|
9405
|
-
/* @__PURE__ */
|
|
9307
|
+
/* @__PURE__ */ jsxs24("div", { className: "mly:grid mly:grid-cols-2 mly:gap-2", children: [
|
|
9308
|
+
/* @__PURE__ */ jsxs24("label", { className: "mly:w-full mly:space-y-1", children: [
|
|
9309
|
+
/* @__PURE__ */ jsx47("span", { className: "mly:text-xs mly:font-normal mly:text-slate-400", children: "Link Title" }),
|
|
9310
|
+
/* @__PURE__ */ jsx47(
|
|
9406
9311
|
Input,
|
|
9407
9312
|
{
|
|
9408
9313
|
placeholder: "Add link title here",
|
|
@@ -9415,9 +9320,9 @@ function LinkCardComponent(props) {
|
|
|
9415
9320
|
}
|
|
9416
9321
|
)
|
|
9417
9322
|
] }),
|
|
9418
|
-
/* @__PURE__ */
|
|
9419
|
-
/* @__PURE__ */
|
|
9420
|
-
/* @__PURE__ */
|
|
9323
|
+
/* @__PURE__ */ jsxs24("label", { className: "mly:w-full mly:space-y-1", children: [
|
|
9324
|
+
/* @__PURE__ */ jsx47("span", { className: "mly:text-xs mly:font-normal mly:text-slate-400", children: "Link" }),
|
|
9325
|
+
/* @__PURE__ */ jsx47(
|
|
9421
9326
|
Input,
|
|
9422
9327
|
{
|
|
9423
9328
|
placeholder: "Add link here",
|
|
@@ -9431,10 +9336,10 @@ function LinkCardComponent(props) {
|
|
|
9431
9336
|
)
|
|
9432
9337
|
] })
|
|
9433
9338
|
] }),
|
|
9434
|
-
/* @__PURE__ */
|
|
9435
|
-
/* @__PURE__ */
|
|
9436
|
-
/* @__PURE__ */
|
|
9437
|
-
/* @__PURE__ */
|
|
9339
|
+
/* @__PURE__ */ jsxs24("div", { className: "mly:grid mly:grid-cols-2 mly:gap-2", children: [
|
|
9340
|
+
/* @__PURE__ */ jsxs24("label", { className: "mly:w-full mly:space-y-1", children: [
|
|
9341
|
+
/* @__PURE__ */ jsx47("span", { className: "mly:text-xs mly:font-normal mly:text-slate-400", children: "Badge Text" }),
|
|
9342
|
+
/* @__PURE__ */ jsx47(
|
|
9438
9343
|
Input,
|
|
9439
9344
|
{
|
|
9440
9345
|
placeholder: "Add badge text here",
|
|
@@ -9447,9 +9352,9 @@ function LinkCardComponent(props) {
|
|
|
9447
9352
|
}
|
|
9448
9353
|
)
|
|
9449
9354
|
] }),
|
|
9450
|
-
/* @__PURE__ */
|
|
9451
|
-
/* @__PURE__ */
|
|
9452
|
-
/* @__PURE__ */
|
|
9355
|
+
/* @__PURE__ */ jsxs24("label", { className: "mly:w-full mly:space-y-1", children: [
|
|
9356
|
+
/* @__PURE__ */ jsx47("span", { className: "mly:text-xs mly:font-normal mly:text-slate-400", children: "Sub Title" }),
|
|
9357
|
+
/* @__PURE__ */ jsx47(
|
|
9453
9358
|
Input,
|
|
9454
9359
|
{
|
|
9455
9360
|
placeholder: "Add sub title here",
|
|
@@ -9552,7 +9457,7 @@ import { useMemo as useMemo10 } from "react";
|
|
|
9552
9457
|
|
|
9553
9458
|
// src/editor/nodes/button/button-label-input.tsx
|
|
9554
9459
|
import { useMemo as useMemo9, useRef as useRef9, useState as useState9 } from "react";
|
|
9555
|
-
import { jsx as
|
|
9460
|
+
import { jsx as jsx48, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
9556
9461
|
function ButtonLabelInput(props) {
|
|
9557
9462
|
var _a, _b;
|
|
9558
9463
|
const { value, onValueChange, isVariable, editor } = props;
|
|
@@ -9574,8 +9479,8 @@ function ButtonLabelInput(props) {
|
|
|
9574
9479
|
editor
|
|
9575
9480
|
}).map((variable) => variable.name);
|
|
9576
9481
|
}, [variables, value, editor]);
|
|
9577
|
-
return /* @__PURE__ */
|
|
9578
|
-
!isEditing && /* @__PURE__ */
|
|
9482
|
+
return /* @__PURE__ */ jsxs25("div", { className: "mly:isolate mly:flex mly:items-center mly:rounded-lg", children: [
|
|
9483
|
+
!isEditing && /* @__PURE__ */ jsx48(
|
|
9579
9484
|
"button",
|
|
9580
9485
|
{
|
|
9581
9486
|
onClick: () => {
|
|
@@ -9596,7 +9501,7 @@ function ButtonLabelInput(props) {
|
|
|
9596
9501
|
})
|
|
9597
9502
|
}
|
|
9598
9503
|
),
|
|
9599
|
-
isEditing && /* @__PURE__ */
|
|
9504
|
+
isEditing && /* @__PURE__ */ jsx48(
|
|
9600
9505
|
InputAutocomplete,
|
|
9601
9506
|
{
|
|
9602
9507
|
editor,
|
|
@@ -9623,7 +9528,7 @@ function ButtonLabelInput(props) {
|
|
|
9623
9528
|
}
|
|
9624
9529
|
|
|
9625
9530
|
// src/editor/nodes/button/button-view.tsx
|
|
9626
|
-
import { jsx as
|
|
9531
|
+
import { jsx as jsx49, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
9627
9532
|
function ButtonView(props) {
|
|
9628
9533
|
const { node, editor, getPos, updateAttributes: updateAttributes2 } = props;
|
|
9629
9534
|
const {
|
|
@@ -9666,7 +9571,7 @@ function ButtonView(props) {
|
|
|
9666
9571
|
([, { paddingX, paddingY }]) => paddingRight === paddingX && paddingTop === paddingY
|
|
9667
9572
|
)) == null ? void 0 : _a[0];
|
|
9668
9573
|
}, [paddingRight, paddingTop, sizes]);
|
|
9669
|
-
return /* @__PURE__ */
|
|
9574
|
+
return /* @__PURE__ */ jsx49(
|
|
9670
9575
|
NodeViewWrapper5,
|
|
9671
9576
|
{
|
|
9672
9577
|
draggable: editor.isEditable,
|
|
@@ -9675,8 +9580,8 @@ function ButtonView(props) {
|
|
|
9675
9580
|
style: {
|
|
9676
9581
|
textAlign: alignment
|
|
9677
9582
|
},
|
|
9678
|
-
children: /* @__PURE__ */
|
|
9679
|
-
/* @__PURE__ */
|
|
9583
|
+
children: /* @__PURE__ */ jsxs26(Popover, { open: props.selected && editor.isEditable, children: [
|
|
9584
|
+
/* @__PURE__ */ jsx49(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx49("div", { children: /* @__PURE__ */ jsx49(
|
|
9680
9585
|
"button",
|
|
9681
9586
|
{
|
|
9682
9587
|
className: cn(
|
|
@@ -9719,7 +9624,7 @@ function ButtonView(props) {
|
|
|
9719
9624
|
}) : text2
|
|
9720
9625
|
}
|
|
9721
9626
|
) }) }),
|
|
9722
|
-
/* @__PURE__ */
|
|
9627
|
+
/* @__PURE__ */ jsx49(
|
|
9723
9628
|
PopoverContent,
|
|
9724
9629
|
{
|
|
9725
9630
|
align: "end",
|
|
@@ -9728,8 +9633,8 @@ function ButtonView(props) {
|
|
|
9728
9633
|
sideOffset: 8,
|
|
9729
9634
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
9730
9635
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
9731
|
-
children: /* @__PURE__ */
|
|
9732
|
-
/* @__PURE__ */
|
|
9636
|
+
children: /* @__PURE__ */ jsx49(TooltipProvider, { children: /* @__PURE__ */ jsxs26("div", { className: "mly:flex mly:items-stretch mly:text-midnight-gray", children: [
|
|
9637
|
+
/* @__PURE__ */ jsx49(
|
|
9733
9638
|
ButtonLabelInput,
|
|
9734
9639
|
{
|
|
9735
9640
|
value: text2,
|
|
@@ -9743,9 +9648,9 @@ function ButtonView(props) {
|
|
|
9743
9648
|
editor
|
|
9744
9649
|
}
|
|
9745
9650
|
),
|
|
9746
|
-
/* @__PURE__ */
|
|
9747
|
-
/* @__PURE__ */
|
|
9748
|
-
/* @__PURE__ */
|
|
9651
|
+
/* @__PURE__ */ jsx49(Divider, {}),
|
|
9652
|
+
/* @__PURE__ */ jsxs26("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
9653
|
+
/* @__PURE__ */ jsx49(
|
|
9749
9654
|
Select,
|
|
9750
9655
|
{
|
|
9751
9656
|
label: "Border Radius",
|
|
@@ -9763,7 +9668,7 @@ function ButtonView(props) {
|
|
|
9763
9668
|
className: "mly:capitalize"
|
|
9764
9669
|
}
|
|
9765
9670
|
),
|
|
9766
|
-
/* @__PURE__ */
|
|
9671
|
+
/* @__PURE__ */ jsx49(
|
|
9767
9672
|
Select,
|
|
9768
9673
|
{
|
|
9769
9674
|
label: "Style",
|
|
@@ -9781,7 +9686,7 @@ function ButtonView(props) {
|
|
|
9781
9686
|
className: "mly:capitalize"
|
|
9782
9687
|
}
|
|
9783
9688
|
),
|
|
9784
|
-
/* @__PURE__ */
|
|
9689
|
+
/* @__PURE__ */ jsx49(
|
|
9785
9690
|
Select,
|
|
9786
9691
|
{
|
|
9787
9692
|
label: "Size",
|
|
@@ -9805,9 +9710,9 @@ function ButtonView(props) {
|
|
|
9805
9710
|
}
|
|
9806
9711
|
)
|
|
9807
9712
|
] }),
|
|
9808
|
-
/* @__PURE__ */
|
|
9809
|
-
/* @__PURE__ */
|
|
9810
|
-
/* @__PURE__ */
|
|
9713
|
+
/* @__PURE__ */ jsx49(Divider, {}),
|
|
9714
|
+
/* @__PURE__ */ jsxs26("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
9715
|
+
/* @__PURE__ */ jsx49(
|
|
9811
9716
|
AlignmentSwitch,
|
|
9812
9717
|
{
|
|
9813
9718
|
alignment,
|
|
@@ -9818,7 +9723,7 @@ function ButtonView(props) {
|
|
|
9818
9723
|
}
|
|
9819
9724
|
}
|
|
9820
9725
|
),
|
|
9821
|
-
/* @__PURE__ */
|
|
9726
|
+
/* @__PURE__ */ jsx49(
|
|
9822
9727
|
LinkInputPopover,
|
|
9823
9728
|
{
|
|
9824
9729
|
defaultValue: externalLink || "",
|
|
@@ -9834,9 +9739,9 @@ function ButtonView(props) {
|
|
|
9834
9739
|
}
|
|
9835
9740
|
)
|
|
9836
9741
|
] }),
|
|
9837
|
-
/* @__PURE__ */
|
|
9838
|
-
/* @__PURE__ */
|
|
9839
|
-
/* @__PURE__ */
|
|
9742
|
+
/* @__PURE__ */ jsx49(Divider, {}),
|
|
9743
|
+
/* @__PURE__ */ jsxs26("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
9744
|
+
/* @__PURE__ */ jsx49(
|
|
9840
9745
|
BackgroundColorPickerPopup,
|
|
9841
9746
|
{
|
|
9842
9747
|
variant,
|
|
@@ -9848,7 +9753,7 @@ function ButtonView(props) {
|
|
|
9848
9753
|
}
|
|
9849
9754
|
}
|
|
9850
9755
|
),
|
|
9851
|
-
/* @__PURE__ */
|
|
9756
|
+
/* @__PURE__ */ jsx49(
|
|
9852
9757
|
TextColorPickerPopup,
|
|
9853
9758
|
{
|
|
9854
9759
|
color: textColor || "transparent",
|
|
@@ -9869,20 +9774,20 @@ function ButtonView(props) {
|
|
|
9869
9774
|
}
|
|
9870
9775
|
function BackgroundColorPickerPopup(props) {
|
|
9871
9776
|
const { color, onChange, variant } = props;
|
|
9872
|
-
return /* @__PURE__ */
|
|
9777
|
+
return /* @__PURE__ */ jsx49(
|
|
9873
9778
|
ColorPicker,
|
|
9874
9779
|
{
|
|
9875
9780
|
color,
|
|
9876
9781
|
onColorChange: onChange,
|
|
9877
9782
|
tooltip: "Background Color",
|
|
9878
|
-
children: /* @__PURE__ */
|
|
9783
|
+
children: /* @__PURE__ */ jsx49(
|
|
9879
9784
|
BaseButton,
|
|
9880
9785
|
{
|
|
9881
9786
|
variant: "ghost",
|
|
9882
9787
|
size: "sm",
|
|
9883
9788
|
type: "button",
|
|
9884
9789
|
className: "mly:size-7",
|
|
9885
|
-
children: /* @__PURE__ */
|
|
9790
|
+
children: /* @__PURE__ */ jsx49(
|
|
9886
9791
|
"div",
|
|
9887
9792
|
{
|
|
9888
9793
|
className: "mly:h-4 mly:w-4 mly:shrink-0 mly:rounded-full mly:shadow",
|
|
@@ -9901,16 +9806,16 @@ function BackgroundColorPickerPopup(props) {
|
|
|
9901
9806
|
}
|
|
9902
9807
|
function TextColorPickerPopup(props) {
|
|
9903
9808
|
const { color, onChange } = props;
|
|
9904
|
-
return /* @__PURE__ */
|
|
9809
|
+
return /* @__PURE__ */ jsx49(ColorPicker, { color, onColorChange: onChange, tooltip: "Text Color", children: /* @__PURE__ */ jsx49(
|
|
9905
9810
|
BaseButton,
|
|
9906
9811
|
{
|
|
9907
9812
|
variant: "ghost",
|
|
9908
9813
|
size: "sm",
|
|
9909
9814
|
type: "button",
|
|
9910
9815
|
className: "mly:size-7",
|
|
9911
|
-
children: /* @__PURE__ */
|
|
9912
|
-
/* @__PURE__ */
|
|
9913
|
-
/* @__PURE__ */
|
|
9816
|
+
children: /* @__PURE__ */ jsxs26("div", { className: "mly:flex mly:flex-col mly:items-center mly:justify-center mly:gap-px", children: [
|
|
9817
|
+
/* @__PURE__ */ jsx49("span", { className: "mly:font-bolder mly:font-mono mly:text-xs mly:text-midnight-gray", children: "A" }),
|
|
9818
|
+
/* @__PURE__ */ jsx49(
|
|
9914
9819
|
"div",
|
|
9915
9820
|
{
|
|
9916
9821
|
className: "mly:h-[2px] mly:w-3 mly:shrink-0 mly:rounded-md mly:shadow",
|
|
@@ -10241,83 +10146,24 @@ import { createLowlight, common } from "lowlight";
|
|
|
10241
10146
|
|
|
10242
10147
|
// src/editor/nodes/html/html-view.tsx
|
|
10243
10148
|
import { NodeViewContent, NodeViewWrapper as NodeViewWrapper6 } from "@tiptap/react";
|
|
10244
|
-
import {
|
|
10245
|
-
import { jsx as jsx51, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
10149
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
10246
10150
|
function HTMLCodeBlockView(props) {
|
|
10247
|
-
const { node
|
|
10248
|
-
|
|
10249
|
-
activeTab || (activeTab = "code");
|
|
10151
|
+
const { node } = props;
|
|
10152
|
+
const { language } = node.attrs;
|
|
10250
10153
|
const languageClass = language ? `language-${language}` : "";
|
|
10251
|
-
|
|
10252
|
-
const text2 = node.content.content.reduce((acc, cur) => {
|
|
10253
|
-
if (cur.type.name === "text") {
|
|
10254
|
-
return acc + cur.text;
|
|
10255
|
-
} else if (cur.type.name === "variable") {
|
|
10256
|
-
const { id: variable, fallback } = (cur == null ? void 0 : cur.attrs) || {};
|
|
10257
|
-
const formattedVariable = fallback ? `{{${variable},fallback=${fallback}}}` : `{{${variable}}}`;
|
|
10258
|
-
return acc + formattedVariable;
|
|
10259
|
-
}
|
|
10260
|
-
return acc;
|
|
10261
|
-
}, "");
|
|
10262
|
-
const htmlParser = new DOMParser();
|
|
10263
|
-
const htmlDoc = htmlParser.parseFromString(text2, "text/html");
|
|
10264
|
-
const style = htmlDoc.querySelectorAll("style");
|
|
10265
|
-
const body = htmlDoc.body;
|
|
10266
|
-
const combinedStyle = Array.from(style).map((s) => s.innerHTML).join("\n");
|
|
10267
|
-
return `<style>${combinedStyle}</style>${body.innerHTML}`;
|
|
10268
|
-
}, [activeTab]);
|
|
10269
|
-
const isEmpty = html2 === "";
|
|
10270
|
-
return /* @__PURE__ */ jsxs28(
|
|
10154
|
+
return /* @__PURE__ */ jsx50(
|
|
10271
10155
|
NodeViewWrapper6,
|
|
10272
10156
|
{
|
|
10273
10157
|
draggable: false,
|
|
10274
10158
|
"data-drag-handle": false,
|
|
10275
10159
|
"data-type": "htmlCodeBlock",
|
|
10276
|
-
children:
|
|
10277
|
-
|
|
10278
|
-
|
|
10279
|
-
|
|
10280
|
-
|
|
10281
|
-
|
|
10282
|
-
|
|
10283
|
-
) }),
|
|
10284
|
-
activeTab === "preview" && /* @__PURE__ */ jsx51(
|
|
10285
|
-
"div",
|
|
10286
|
-
{
|
|
10287
|
-
className: cn(
|
|
10288
|
-
"mly:not-prose mly:rounded-lg mly:border mly:border-gray-200 mly:p-2",
|
|
10289
|
-
isEmpty && "mly:min-h-[42px]"
|
|
10290
|
-
),
|
|
10291
|
-
ref: (node2) => {
|
|
10292
|
-
if (!node2 || (node2 == null ? void 0 : node2.shadowRoot)) {
|
|
10293
|
-
return;
|
|
10294
|
-
}
|
|
10295
|
-
const shadow = node2.attachShadow({ mode: "open" });
|
|
10296
|
-
const sheet = new CSSStyleSheet();
|
|
10297
|
-
sheet.replaceSync(`
|
|
10298
|
-
* { font-family: 'Inter', sans-serif; }
|
|
10299
|
-
blockquote, h1, h2, h3, img, li, ol, p, ul {
|
|
10300
|
-
margin-top: 0;
|
|
10301
|
-
margin-bottom: 0;
|
|
10302
|
-
}
|
|
10303
|
-
`);
|
|
10304
|
-
shadow.adoptedStyleSheets = [sheet];
|
|
10305
|
-
const container = document.createElement("div");
|
|
10306
|
-
container.innerHTML = html2;
|
|
10307
|
-
shadow.appendChild(container);
|
|
10308
|
-
},
|
|
10309
|
-
contentEditable: false,
|
|
10310
|
-
onClick: () => {
|
|
10311
|
-
if (!isEmpty) {
|
|
10312
|
-
return;
|
|
10313
|
-
}
|
|
10314
|
-
updateAttributes2({
|
|
10315
|
-
activeTab: "code"
|
|
10316
|
-
});
|
|
10317
|
-
}
|
|
10318
|
-
}
|
|
10319
|
-
)
|
|
10320
|
-
]
|
|
10160
|
+
children: /* @__PURE__ */ jsx50("pre", { className: "mly-html-code-pre", children: /* @__PURE__ */ jsx50(
|
|
10161
|
+
NodeViewContent,
|
|
10162
|
+
{
|
|
10163
|
+
as: "code",
|
|
10164
|
+
className: cn("is-editable", languageClass)
|
|
10165
|
+
}
|
|
10166
|
+
) })
|
|
10321
10167
|
}
|
|
10322
10168
|
);
|
|
10323
10169
|
}
|
|
@@ -10461,10 +10307,10 @@ import { ReactNodeViewRenderer as ReactNodeViewRenderer6 } from "@tiptap/react";
|
|
|
10461
10307
|
// src/editor/nodes/repeat/repeat-view.tsx
|
|
10462
10308
|
import { NodeViewWrapper as NodeViewWrapper7, NodeViewContent as NodeViewContent2 } from "@tiptap/react";
|
|
10463
10309
|
import { Repeat2 as Repeat22 } from "lucide-react";
|
|
10464
|
-
import { jsx as
|
|
10310
|
+
import { jsx as jsx51, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
10465
10311
|
function RepeatView(props) {
|
|
10466
10312
|
const { editor, getPos } = props;
|
|
10467
|
-
return /* @__PURE__ */
|
|
10313
|
+
return /* @__PURE__ */ jsxs27(
|
|
10468
10314
|
NodeViewWrapper7,
|
|
10469
10315
|
{
|
|
10470
10316
|
"data-type": "repeat",
|
|
@@ -10472,8 +10318,8 @@ function RepeatView(props) {
|
|
|
10472
10318
|
"data-drag-handle": editor.isEditable,
|
|
10473
10319
|
className: "mly:relative",
|
|
10474
10320
|
children: [
|
|
10475
|
-
/* @__PURE__ */
|
|
10476
|
-
/* @__PURE__ */
|
|
10321
|
+
/* @__PURE__ */ jsx51(NodeViewContent2, { className: "is-editable" }),
|
|
10322
|
+
/* @__PURE__ */ jsxs27(
|
|
10477
10323
|
"div",
|
|
10478
10324
|
{
|
|
10479
10325
|
role: "button",
|
|
@@ -10484,8 +10330,8 @@ function RepeatView(props) {
|
|
|
10484
10330
|
editor.commands.setNodeSelection(getPos());
|
|
10485
10331
|
},
|
|
10486
10332
|
children: [
|
|
10487
|
-
/* @__PURE__ */
|
|
10488
|
-
/* @__PURE__ */
|
|
10333
|
+
/* @__PURE__ */ jsx51(Repeat22, { className: "mly:size-3 mly:stroke-[2.5] mly:text-midnight-gray" }),
|
|
10334
|
+
/* @__PURE__ */ jsx51("div", { className: "mly:w-[1.5px] mly:grow mly:rounded-full mly:bg-rose-300" })
|
|
10489
10335
|
]
|
|
10490
10336
|
}
|
|
10491
10337
|
)
|
|
@@ -10730,7 +10576,7 @@ import { ReactRenderer } from "@tiptap/react";
|
|
|
10730
10576
|
import {
|
|
10731
10577
|
forwardRef as forwardRef8,
|
|
10732
10578
|
Fragment as Fragment8,
|
|
10733
|
-
useCallback as
|
|
10579
|
+
useCallback as useCallback10,
|
|
10734
10580
|
useEffect as useEffect8,
|
|
10735
10581
|
useImperativeHandle as useImperativeHandle2,
|
|
10736
10582
|
useLayoutEffect as useLayoutEffect2,
|
|
@@ -10741,8 +10587,8 @@ import tippy2 from "tippy.js";
|
|
|
10741
10587
|
|
|
10742
10588
|
// src/editor/extensions/slash-command/slash-command-item.tsx
|
|
10743
10589
|
import { ChevronRightIcon } from "lucide-react";
|
|
10744
|
-
import { useCallback as
|
|
10745
|
-
import { Fragment as Fragment7, jsx as
|
|
10590
|
+
import { useCallback as useCallback9, useState as useState10, useRef as useRef10, useEffect as useEffect7 } from "react";
|
|
10591
|
+
import { Fragment as Fragment7, jsx as jsx52, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
10746
10592
|
function SlashCommandItem(props) {
|
|
10747
10593
|
var _a;
|
|
10748
10594
|
const {
|
|
@@ -10765,19 +10611,19 @@ function SlashCommandItem(props) {
|
|
|
10765
10611
|
const shouldOpenTooltip = !!(item == null ? void 0 : item.preview) && (isHovered || isActive && !hoveredItemKey);
|
|
10766
10612
|
const hasRenderFunction = typeof item.render === "function";
|
|
10767
10613
|
const renderFunctionValue = hasRenderFunction ? (_a = item.render) == null ? void 0 : _a.call(item, editor) : null;
|
|
10768
|
-
let value = /* @__PURE__ */
|
|
10769
|
-
/* @__PURE__ */
|
|
10770
|
-
/* @__PURE__ */
|
|
10771
|
-
/* @__PURE__ */
|
|
10772
|
-
/* @__PURE__ */
|
|
10614
|
+
let value = /* @__PURE__ */ jsxs28(Fragment7, { children: [
|
|
10615
|
+
/* @__PURE__ */ jsx52("div", { className: "mly:flex mly:h-6 mly:w-6 mly:shrink-0 mly:items-center mly:justify-center", children: item.icon }),
|
|
10616
|
+
/* @__PURE__ */ jsxs28("div", { className: "mly:grow", children: [
|
|
10617
|
+
/* @__PURE__ */ jsx52("p", { className: "mly:font-medium", children: item.title }),
|
|
10618
|
+
/* @__PURE__ */ jsx52("p", { className: "mly:text-xs mly:text-gray-400", children: item.description })
|
|
10773
10619
|
] }),
|
|
10774
|
-
isSubCommand2 && /* @__PURE__ */
|
|
10620
|
+
isSubCommand2 && /* @__PURE__ */ jsx52("span", { className: "mly:block mly:px-1 mly:text-gray-400", children: /* @__PURE__ */ jsx52(ChevronRightIcon, { className: "mly:size-3.5 mly:stroke-[2.5]" }) })
|
|
10775
10621
|
] });
|
|
10776
10622
|
if (renderFunctionValue !== null && renderFunctionValue !== true) {
|
|
10777
10623
|
value = renderFunctionValue;
|
|
10778
10624
|
}
|
|
10779
10625
|
const openTimerRef = useRef10(0);
|
|
10780
|
-
const handleDelayedOpen =
|
|
10626
|
+
const handleDelayedOpen = useCallback9(() => {
|
|
10781
10627
|
window.clearTimeout(openTimerRef.current);
|
|
10782
10628
|
const delay = 200;
|
|
10783
10629
|
openTimerRef.current = window.setTimeout(() => {
|
|
@@ -10802,8 +10648,8 @@ function SlashCommandItem(props) {
|
|
|
10802
10648
|
}
|
|
10803
10649
|
};
|
|
10804
10650
|
}, []);
|
|
10805
|
-
return /* @__PURE__ */
|
|
10806
|
-
/* @__PURE__ */
|
|
10651
|
+
return /* @__PURE__ */ jsxs28(Tooltip, { open, children: [
|
|
10652
|
+
/* @__PURE__ */ jsx52(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx52(
|
|
10807
10653
|
"button",
|
|
10808
10654
|
{
|
|
10809
10655
|
className: cn(
|
|
@@ -10818,14 +10664,14 @@ function SlashCommandItem(props) {
|
|
|
10818
10664
|
children: value
|
|
10819
10665
|
}
|
|
10820
10666
|
) }),
|
|
10821
|
-
/* @__PURE__ */
|
|
10667
|
+
/* @__PURE__ */ jsx52(
|
|
10822
10668
|
TooltipContent,
|
|
10823
10669
|
{
|
|
10824
10670
|
side: "right",
|
|
10825
10671
|
sideOffset: 10,
|
|
10826
10672
|
className: "mly:w-52 mly:rounded-lg mly:border-none mly:p-1 mly:shadow",
|
|
10827
|
-
children: typeof item.preview === "function" ? item == null ? void 0 : item.preview(editor) : /* @__PURE__ */
|
|
10828
|
-
/* @__PURE__ */
|
|
10673
|
+
children: typeof item.preview === "function" ? item == null ? void 0 : item.preview(editor) : /* @__PURE__ */ jsxs28(Fragment7, { children: [
|
|
10674
|
+
/* @__PURE__ */ jsx52("figure", { className: "mly:relative mly:aspect-[2.5] mly:w-full mly:overflow-hidden mly:rounded-md mly:border mly:border-gray-200", children: /* @__PURE__ */ jsx52(
|
|
10829
10675
|
"img",
|
|
10830
10676
|
{
|
|
10831
10677
|
src: item == null ? void 0 : item.preview,
|
|
@@ -10833,7 +10679,7 @@ function SlashCommandItem(props) {
|
|
|
10833
10679
|
className: "mly:absolute mly:inset-0 mly:h-full mly:w-full mly:object-cover"
|
|
10834
10680
|
}
|
|
10835
10681
|
) }),
|
|
10836
|
-
/* @__PURE__ */
|
|
10682
|
+
/* @__PURE__ */ jsx52("p", { className: "mly:mt-2 mly:px-0.5 mly:text-gray-500", children: item.description })
|
|
10837
10683
|
] })
|
|
10838
10684
|
}
|
|
10839
10685
|
)
|
|
@@ -10922,7 +10768,7 @@ function processCommand(options) {
|
|
|
10922
10768
|
}
|
|
10923
10769
|
|
|
10924
10770
|
// src/editor/extensions/slash-command/slash-command-view.tsx
|
|
10925
|
-
import { jsx as
|
|
10771
|
+
import { jsx as jsx53, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
10926
10772
|
var CommandList = forwardRef8((props, ref) => {
|
|
10927
10773
|
const { items: groups, command, editor, range, query } = props;
|
|
10928
10774
|
const [selectedGroupIndex, setSelectedGroupIndex] = useState11(0);
|
|
@@ -10931,7 +10777,7 @@ var CommandList = forwardRef8((props, ref) => {
|
|
|
10931
10777
|
const prevQuery = useRef11("");
|
|
10932
10778
|
const prevSelectedGroupIndex = useRef11(0);
|
|
10933
10779
|
const prevSelectedCommandIndex = useRef11(0);
|
|
10934
|
-
const selectItem =
|
|
10780
|
+
const selectItem = useCallback10(
|
|
10935
10781
|
(groupIndex, commandIndex) => {
|
|
10936
10782
|
const item = groups[groupIndex].commands[commandIndex];
|
|
10937
10783
|
if (!item) {
|
|
@@ -11060,15 +10906,15 @@ var CommandList = forwardRef8((props, ref) => {
|
|
|
11060
10906
|
if (!groups || groups.length === 0) {
|
|
11061
10907
|
return null;
|
|
11062
10908
|
}
|
|
11063
|
-
return /* @__PURE__ */
|
|
11064
|
-
/* @__PURE__ */
|
|
10909
|
+
return /* @__PURE__ */ jsx53(TooltipProvider, { children: /* @__PURE__ */ jsxs29("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: [
|
|
10910
|
+
/* @__PURE__ */ jsx53(
|
|
11065
10911
|
"div",
|
|
11066
10912
|
{
|
|
11067
10913
|
id: "slash-command",
|
|
11068
10914
|
ref: commandListContainer,
|
|
11069
10915
|
className: "mly:no-scrollbar mly:h-auto mly:max-h-[330px] mly:overflow-y-auto",
|
|
11070
|
-
children: groups.map((group, groupIndex) => /* @__PURE__ */
|
|
11071
|
-
/* @__PURE__ */
|
|
10916
|
+
children: groups.map((group, groupIndex) => /* @__PURE__ */ jsxs29(Fragment8, { children: [
|
|
10917
|
+
/* @__PURE__ */ jsx53(
|
|
11072
10918
|
"span",
|
|
11073
10919
|
{
|
|
11074
10920
|
className: cn(
|
|
@@ -11078,9 +10924,9 @@ var CommandList = forwardRef8((props, ref) => {
|
|
|
11078
10924
|
children: group.title
|
|
11079
10925
|
}
|
|
11080
10926
|
),
|
|
11081
|
-
/* @__PURE__ */
|
|
10927
|
+
/* @__PURE__ */ jsx53("div", { className: "mly:space-y-0.5 mly:p-1", children: group.commands.map((item, commandIndex) => {
|
|
11082
10928
|
const itemKey = `${groupIndex}-${commandIndex}`;
|
|
11083
|
-
return /* @__PURE__ */
|
|
10929
|
+
return /* @__PURE__ */ jsx53(
|
|
11084
10930
|
SlashCommandItem,
|
|
11085
10931
|
{
|
|
11086
10932
|
item,
|
|
@@ -11100,16 +10946,16 @@ var CommandList = forwardRef8((props, ref) => {
|
|
|
11100
10946
|
] }, groupIndex))
|
|
11101
10947
|
}
|
|
11102
10948
|
),
|
|
11103
|
-
/* @__PURE__ */
|
|
11104
|
-
/* @__PURE__ */
|
|
11105
|
-
/* @__PURE__ */
|
|
11106
|
-
/* @__PURE__ */
|
|
10949
|
+
/* @__PURE__ */ jsx53("div", { className: "mly:border-t mly:border-gray-200 mly:px-1 mly:py-3 mly:pl-4", children: /* @__PURE__ */ jsxs29("div", { className: "mly:flex mly:items-center", children: [
|
|
10950
|
+
/* @__PURE__ */ jsxs29("p", { className: "mly:text-center mly:text-xs mly:text-gray-400", children: [
|
|
10951
|
+
/* @__PURE__ */ jsx53("kbd", { className: "mly:rounded mly:border mly:border-gray-200 mly:p-1 mly:px-2 mly:font-medium", children: "\u2191" }),
|
|
10952
|
+
/* @__PURE__ */ jsx53("kbd", { className: "mly:ml-1 mly:rounded mly:border mly:border-gray-200 mly:p-1 mly:px-2 mly:font-medium", children: "\u2193" }),
|
|
11107
10953
|
" ",
|
|
11108
10954
|
"to navigate"
|
|
11109
10955
|
] }),
|
|
11110
|
-
/* @__PURE__ */
|
|
11111
|
-
/* @__PURE__ */
|
|
11112
|
-
/* @__PURE__ */
|
|
10956
|
+
/* @__PURE__ */ jsx53("span", { "aria-hidden": "true", className: "mly:select-none mly:px-1", children: "\xB7" }),
|
|
10957
|
+
/* @__PURE__ */ jsxs29("p", { className: "mly:text-center mly:text-xs mly:text-gray-400", children: [
|
|
10958
|
+
/* @__PURE__ */ jsx53("kbd", { className: "mly:rounded mly:border mly:border-gray-200 mly:p-1 mly:px-1.5 mly:font-medium", children: "Enter" }),
|
|
11113
10959
|
" ",
|
|
11114
10960
|
"to select"
|
|
11115
10961
|
] })
|
|
@@ -11189,7 +11035,7 @@ function getSlashCommandSuggestions(groups = DEFAULT_SLASH_COMMANDS) {
|
|
|
11189
11035
|
import { ReactRenderer as ReactRenderer2 } from "@tiptap/react";
|
|
11190
11036
|
import { forwardRef as forwardRef9, useImperativeHandle as useImperativeHandle3, useRef as useRef12 } from "react";
|
|
11191
11037
|
import tippy3 from "tippy.js";
|
|
11192
|
-
import { jsx as
|
|
11038
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
11193
11039
|
var VariableList = forwardRef9((props, ref) => {
|
|
11194
11040
|
var _a;
|
|
11195
11041
|
const { items = [], editor } = props;
|
|
@@ -11218,7 +11064,7 @@ var VariableList = forwardRef9((props, ref) => {
|
|
|
11218
11064
|
return false;
|
|
11219
11065
|
}
|
|
11220
11066
|
}));
|
|
11221
|
-
return /* @__PURE__ */
|
|
11067
|
+
return /* @__PURE__ */ jsx54(
|
|
11222
11068
|
VariableSuggestionPopoverComponent,
|
|
11223
11069
|
{
|
|
11224
11070
|
items,
|
|
@@ -11402,7 +11248,7 @@ var isCustomNodeSelected = (editor, node) => {
|
|
|
11402
11248
|
};
|
|
11403
11249
|
|
|
11404
11250
|
// src/editor/components/text-menu/text-bubble-menu.tsx
|
|
11405
|
-
import { BubbleMenu as
|
|
11251
|
+
import { BubbleMenu as BubbleMenu7 } from "@tiptap/react";
|
|
11406
11252
|
|
|
11407
11253
|
// src/editor/components/text-menu/text-bubble-content.tsx
|
|
11408
11254
|
import {
|
|
@@ -11416,11 +11262,11 @@ import {
|
|
|
11416
11262
|
} from "lucide-react";
|
|
11417
11263
|
|
|
11418
11264
|
// src/editor/components/text-menu/use-text-menu-state.tsx
|
|
11419
|
-
import { useEditorState as
|
|
11420
|
-
import
|
|
11265
|
+
import { useEditorState as useEditorState7 } from "@tiptap/react";
|
|
11266
|
+
import deepEql7 from "fast-deep-equal";
|
|
11421
11267
|
var DEFAULT_TEXT_COLOR = "#374151";
|
|
11422
11268
|
var useTextMenuState = (editor) => {
|
|
11423
|
-
const states =
|
|
11269
|
+
const states = useEditorState7({
|
|
11424
11270
|
editor,
|
|
11425
11271
|
selector: (ctx) => {
|
|
11426
11272
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -11436,13 +11282,13 @@ var useTextMenuState = (editor) => {
|
|
|
11436
11282
|
paragraphShowIfKey: ((_h = ctx.editor.getAttributes("paragraph")) == null ? void 0 : _h.showIfKey) || ""
|
|
11437
11283
|
};
|
|
11438
11284
|
},
|
|
11439
|
-
equalityFn:
|
|
11285
|
+
equalityFn: deepEql7
|
|
11440
11286
|
});
|
|
11441
11287
|
return states;
|
|
11442
11288
|
};
|
|
11443
11289
|
|
|
11444
11290
|
// src/editor/components/text-menu/text-bubble-content.tsx
|
|
11445
|
-
import { Fragment as Fragment9, jsx as
|
|
11291
|
+
import { Fragment as Fragment9, jsx as jsx55, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
11446
11292
|
function TextBubbleContent(props) {
|
|
11447
11293
|
var _a, _b, _c, _d;
|
|
11448
11294
|
const { editor, showListMenu = true } = props;
|
|
@@ -11486,9 +11332,9 @@ function TextBubbleContent(props) {
|
|
|
11486
11332
|
tooltip: "Code"
|
|
11487
11333
|
}
|
|
11488
11334
|
];
|
|
11489
|
-
return /* @__PURE__ */
|
|
11490
|
-
items.map((item, index) => /* @__PURE__ */
|
|
11491
|
-
/* @__PURE__ */
|
|
11335
|
+
return /* @__PURE__ */ jsxs30(Fragment9, { children: [
|
|
11336
|
+
items.map((item, index) => /* @__PURE__ */ jsx55(BubbleMenuButton, __spreadValues({}, item), index)),
|
|
11337
|
+
/* @__PURE__ */ jsx55(
|
|
11492
11338
|
AlignmentSwitch,
|
|
11493
11339
|
{
|
|
11494
11340
|
alignment: state.textAlign,
|
|
@@ -11497,8 +11343,8 @@ function TextBubbleContent(props) {
|
|
|
11497
11343
|
}
|
|
11498
11344
|
}
|
|
11499
11345
|
),
|
|
11500
|
-
!state.isListActive && showListMenu && /* @__PURE__ */
|
|
11501
|
-
/* @__PURE__ */
|
|
11346
|
+
!state.isListActive && showListMenu && /* @__PURE__ */ jsxs30(Fragment9, { children: [
|
|
11347
|
+
/* @__PURE__ */ jsx55(
|
|
11502
11348
|
BubbleMenuButton,
|
|
11503
11349
|
{
|
|
11504
11350
|
icon: List2,
|
|
@@ -11508,7 +11354,7 @@ function TextBubbleContent(props) {
|
|
|
11508
11354
|
tooltip: "Bullet List"
|
|
11509
11355
|
}
|
|
11510
11356
|
),
|
|
11511
|
-
/* @__PURE__ */
|
|
11357
|
+
/* @__PURE__ */ jsx55(
|
|
11512
11358
|
BubbleMenuButton,
|
|
11513
11359
|
{
|
|
11514
11360
|
icon: ListOrdered2,
|
|
@@ -11519,7 +11365,7 @@ function TextBubbleContent(props) {
|
|
|
11519
11365
|
}
|
|
11520
11366
|
)
|
|
11521
11367
|
] }),
|
|
11522
|
-
/* @__PURE__ */
|
|
11368
|
+
/* @__PURE__ */ jsx55(
|
|
11523
11369
|
LinkInputPopover,
|
|
11524
11370
|
{
|
|
11525
11371
|
defaultValue: (_d = state == null ? void 0 : state.linkUrl) != null ? _d : "",
|
|
@@ -11535,8 +11381,8 @@ function TextBubbleContent(props) {
|
|
|
11535
11381
|
isVariable: state.isUrlVariable
|
|
11536
11382
|
}
|
|
11537
11383
|
),
|
|
11538
|
-
/* @__PURE__ */
|
|
11539
|
-
/* @__PURE__ */
|
|
11384
|
+
/* @__PURE__ */ jsx55(Divider, {}),
|
|
11385
|
+
/* @__PURE__ */ jsx55(
|
|
11540
11386
|
ColorPicker,
|
|
11541
11387
|
{
|
|
11542
11388
|
color: state.currentTextColor,
|
|
@@ -11545,16 +11391,16 @@ function TextBubbleContent(props) {
|
|
|
11545
11391
|
},
|
|
11546
11392
|
tooltip: "Text Color",
|
|
11547
11393
|
suggestedColors,
|
|
11548
|
-
children: /* @__PURE__ */
|
|
11394
|
+
children: /* @__PURE__ */ jsx55(
|
|
11549
11395
|
BaseButton,
|
|
11550
11396
|
{
|
|
11551
11397
|
variant: "ghost",
|
|
11552
11398
|
size: "sm",
|
|
11553
11399
|
type: "button",
|
|
11554
11400
|
className: "mly:h-7 mly:w-7 mly:shrink-0 mly:p-0",
|
|
11555
|
-
children: /* @__PURE__ */
|
|
11556
|
-
/* @__PURE__ */
|
|
11557
|
-
/* @__PURE__ */
|
|
11401
|
+
children: /* @__PURE__ */ jsxs30("div", { className: "mly:flex mly:flex-col mly:items-center mly:justify-center mly:gap-px", children: [
|
|
11402
|
+
/* @__PURE__ */ jsx55("span", { className: "mly:font-bolder mly:font-mono mly:text-xs mly:text-slate-700", children: "A" }),
|
|
11403
|
+
/* @__PURE__ */ jsx55(
|
|
11558
11404
|
"div",
|
|
11559
11405
|
{
|
|
11560
11406
|
className: "mly:h-[2px] mly:w-3",
|
|
@@ -11571,34 +11417,34 @@ function TextBubbleContent(props) {
|
|
|
11571
11417
|
|
|
11572
11418
|
// src/editor/components/text-menu/turn-into-block.tsx
|
|
11573
11419
|
import { ChevronDownIcon as ChevronDownIcon2, PilcrowIcon } from "lucide-react";
|
|
11574
|
-
import { useMemo as
|
|
11575
|
-
import { jsx as
|
|
11420
|
+
import { useMemo as useMemo11 } from "react";
|
|
11421
|
+
import { jsx as jsx56, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
11576
11422
|
var isOption = (option) => option.type === "option";
|
|
11577
11423
|
var isCategory = (option) => option.type === "category";
|
|
11578
11424
|
function TurnIntoBlock(props) {
|
|
11579
11425
|
const { options } = props;
|
|
11580
|
-
const activeItem =
|
|
11426
|
+
const activeItem = useMemo11(
|
|
11581
11427
|
() => options.find((option) => option.type === "option" && option.isActive()),
|
|
11582
11428
|
[options]
|
|
11583
11429
|
);
|
|
11584
11430
|
const { icon: ActiveIcon = PilcrowIcon } = activeItem || {};
|
|
11585
|
-
return /* @__PURE__ */
|
|
11586
|
-
/* @__PURE__ */
|
|
11587
|
-
/* @__PURE__ */
|
|
11431
|
+
return /* @__PURE__ */ jsxs31(Popover, { children: [
|
|
11432
|
+
/* @__PURE__ */ jsxs31(Tooltip, { children: [
|
|
11433
|
+
/* @__PURE__ */ jsx56(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs31(
|
|
11588
11434
|
PopoverTrigger,
|
|
11589
11435
|
{
|
|
11590
11436
|
className: cn(
|
|
11591
11437
|
"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"
|
|
11592
11438
|
),
|
|
11593
11439
|
children: [
|
|
11594
|
-
/* @__PURE__ */
|
|
11595
|
-
/* @__PURE__ */
|
|
11440
|
+
/* @__PURE__ */ jsx56(ActiveIcon, { className: "mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5]" }),
|
|
11441
|
+
/* @__PURE__ */ jsx56(ChevronDownIcon2, { className: "mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5]" })
|
|
11596
11442
|
]
|
|
11597
11443
|
}
|
|
11598
11444
|
) }),
|
|
11599
|
-
/* @__PURE__ */
|
|
11445
|
+
/* @__PURE__ */ jsx56(TooltipContent, { sideOffset: 8, children: "Turn into" })
|
|
11600
11446
|
] }),
|
|
11601
|
-
/* @__PURE__ */
|
|
11447
|
+
/* @__PURE__ */ jsx56(
|
|
11602
11448
|
PopoverContent,
|
|
11603
11449
|
{
|
|
11604
11450
|
align: "start",
|
|
@@ -11607,25 +11453,25 @@ function TurnIntoBlock(props) {
|
|
|
11607
11453
|
className: "mly:flex mly:w-[160px] mly:flex-col mly:rounded-md mly:p-1",
|
|
11608
11454
|
children: options.map((option, index) => {
|
|
11609
11455
|
if (isOption(option)) {
|
|
11610
|
-
return /* @__PURE__ */
|
|
11456
|
+
return /* @__PURE__ */ jsxs31(
|
|
11611
11457
|
BaseButton,
|
|
11612
11458
|
{
|
|
11613
11459
|
onClick: option.onClick,
|
|
11614
11460
|
variant: "ghost",
|
|
11615
|
-
className: "mly:mb-0.5 mly:h-auto mly:justify-start mly:gap-2 mly:rounded! mly
|
|
11461
|
+
className: "mly:mb-0.5 mly:h-auto mly:justify-start mly:gap-2 mly:rounded! mly:!px-2.5 mly:py-1 mly:!pl-3.5 mly:text-sm mly:font-normal mly:text-midnight-gray",
|
|
11616
11462
|
children: [
|
|
11617
|
-
/* @__PURE__ */
|
|
11463
|
+
/* @__PURE__ */ jsx56(option.icon, { className: "mly:size-[15px] mly:shrink-0" }),
|
|
11618
11464
|
option.label
|
|
11619
11465
|
]
|
|
11620
11466
|
},
|
|
11621
11467
|
option.id
|
|
11622
11468
|
);
|
|
11623
11469
|
} else if (isCategory(option)) {
|
|
11624
|
-
return /* @__PURE__ */
|
|
11470
|
+
return /* @__PURE__ */ jsx56(
|
|
11625
11471
|
"label",
|
|
11626
11472
|
{
|
|
11627
11473
|
className: cn(
|
|
11628
|
-
"mly
|
|
11474
|
+
"mly:!px-2.5 mly:!pl-3.5 mly:text-xs mly:font-medium mly:text-midnight-gray/60",
|
|
11629
11475
|
index === 0 ? "mly:mb-2 mly:mt-1" : "mly:my-2"
|
|
11630
11476
|
),
|
|
11631
11477
|
children: option.label
|
|
@@ -11640,7 +11486,7 @@ function TurnIntoBlock(props) {
|
|
|
11640
11486
|
}
|
|
11641
11487
|
|
|
11642
11488
|
// src/editor/components/text-menu/use-turn-into-block-options.tsx
|
|
11643
|
-
import { useEditorState as
|
|
11489
|
+
import { useEditorState as useEditorState8 } from "@tiptap/react";
|
|
11644
11490
|
import {
|
|
11645
11491
|
Heading1Icon,
|
|
11646
11492
|
Heading2Icon,
|
|
@@ -11650,7 +11496,7 @@ import {
|
|
|
11650
11496
|
PilcrowIcon as PilcrowIcon2
|
|
11651
11497
|
} from "lucide-react";
|
|
11652
11498
|
function useTurnIntoBlockOptions(editor) {
|
|
11653
|
-
return
|
|
11499
|
+
return useEditorState8({
|
|
11654
11500
|
editor,
|
|
11655
11501
|
selector: ({ editor: editor2 }) => [
|
|
11656
11502
|
{
|
|
@@ -11722,7 +11568,7 @@ function useTurnIntoBlockOptions(editor) {
|
|
|
11722
11568
|
}
|
|
11723
11569
|
|
|
11724
11570
|
// src/editor/components/text-menu/text-bubble-menu.tsx
|
|
11725
|
-
import { jsx as
|
|
11571
|
+
import { jsx as jsx57, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
11726
11572
|
function TextBubbleMenu(props) {
|
|
11727
11573
|
const { editor, appendTo } = props;
|
|
11728
11574
|
if (!editor) {
|
|
@@ -11773,23 +11619,23 @@ function TextBubbleMenu(props) {
|
|
|
11773
11619
|
}
|
|
11774
11620
|
});
|
|
11775
11621
|
const turnIntoBlockOptions = useTurnIntoBlockOptions(editor);
|
|
11776
|
-
return /* @__PURE__ */
|
|
11777
|
-
|
|
11622
|
+
return /* @__PURE__ */ jsx57(
|
|
11623
|
+
BubbleMenu7,
|
|
11778
11624
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
11779
11625
|
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",
|
|
11780
|
-
children: /* @__PURE__ */
|
|
11781
|
-
/* @__PURE__ */
|
|
11782
|
-
/* @__PURE__ */
|
|
11783
|
-
/* @__PURE__ */
|
|
11626
|
+
children: /* @__PURE__ */ jsxs32(TooltipProvider, { children: [
|
|
11627
|
+
/* @__PURE__ */ jsx57(TurnIntoBlock, { options: turnIntoBlockOptions }),
|
|
11628
|
+
/* @__PURE__ */ jsx57(Divider, { className: "mly:mx-0" }),
|
|
11629
|
+
/* @__PURE__ */ jsx57(TextBubbleContent, { editor })
|
|
11784
11630
|
] })
|
|
11785
11631
|
})
|
|
11786
11632
|
);
|
|
11787
11633
|
}
|
|
11788
11634
|
|
|
11789
11635
|
// src/editor/components/variable-menu/variable-bubble-menu.tsx
|
|
11790
|
-
import { BubbleMenu as
|
|
11791
|
-
import { sticky as
|
|
11792
|
-
import { jsx as
|
|
11636
|
+
import { BubbleMenu as BubbleMenu8 } from "@tiptap/react";
|
|
11637
|
+
import { sticky as sticky6 } from "tippy.js";
|
|
11638
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
11793
11639
|
function VariableBubbleMenu(props) {
|
|
11794
11640
|
const { editor, appendTo } = props;
|
|
11795
11641
|
if (!editor) {
|
|
@@ -11805,18 +11651,18 @@ function VariableBubbleMenu(props) {
|
|
|
11805
11651
|
popperOptions: {
|
|
11806
11652
|
modifiers: [{ name: "flip", enabled: false }]
|
|
11807
11653
|
},
|
|
11808
|
-
plugins: [
|
|
11654
|
+
plugins: [sticky6],
|
|
11809
11655
|
sticky: "popper",
|
|
11810
11656
|
maxWidth: "100%",
|
|
11811
11657
|
appendTo: () => (appendTo == null ? void 0 : appendTo.current) || "parent",
|
|
11812
11658
|
placement: "top-start"
|
|
11813
11659
|
}
|
|
11814
11660
|
});
|
|
11815
|
-
return /* @__PURE__ */
|
|
11816
|
-
|
|
11661
|
+
return /* @__PURE__ */ jsx58(
|
|
11662
|
+
BubbleMenu8,
|
|
11817
11663
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
11818
11664
|
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",
|
|
11819
|
-
children: /* @__PURE__ */
|
|
11665
|
+
children: /* @__PURE__ */ jsx58(TooltipProvider, { children: /* @__PURE__ */ jsx58(TextBubbleContent, { showListMenu: false, editor }) })
|
|
11820
11666
|
})
|
|
11821
11667
|
);
|
|
11822
11668
|
}
|
|
@@ -11902,8 +11748,8 @@ function replaceDeprecatedNode(json) {
|
|
|
11902
11748
|
}
|
|
11903
11749
|
|
|
11904
11750
|
// src/editor/index.tsx
|
|
11905
|
-
import { jsx as
|
|
11906
|
-
function
|
|
11751
|
+
import { jsx as jsx59, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
11752
|
+
function Editor12(props) {
|
|
11907
11753
|
const {
|
|
11908
11754
|
config: {
|
|
11909
11755
|
wrapClassName = "",
|
|
@@ -11926,7 +11772,7 @@ function Editor13(props) {
|
|
|
11926
11772
|
scrollThreshold = 40,
|
|
11927
11773
|
scrollMargin = 40
|
|
11928
11774
|
} = props;
|
|
11929
|
-
const formattedContent =
|
|
11775
|
+
const formattedContent = useMemo12(() => {
|
|
11930
11776
|
if (contentJson) {
|
|
11931
11777
|
const json = (contentJson == null ? void 0 : contentJson.type) === "doc" ? contentJson : {
|
|
11932
11778
|
type: "doc",
|
|
@@ -11975,7 +11821,7 @@ function Editor13(props) {
|
|
|
11975
11821
|
if (!editor) {
|
|
11976
11822
|
return null;
|
|
11977
11823
|
}
|
|
11978
|
-
return /* @__PURE__ */
|
|
11824
|
+
return /* @__PURE__ */ jsx59(MailyProvider, { placeholderUrl, children: /* @__PURE__ */ jsxs33(
|
|
11979
11825
|
"div",
|
|
11980
11826
|
{
|
|
11981
11827
|
id: "mly-editor",
|
|
@@ -11986,8 +11832,8 @@ function Editor13(props) {
|
|
|
11986
11832
|
),
|
|
11987
11833
|
ref: menuContainerRef,
|
|
11988
11834
|
children: [
|
|
11989
|
-
hasMenuBar && /* @__PURE__ */
|
|
11990
|
-
/* @__PURE__ */
|
|
11835
|
+
hasMenuBar && /* @__PURE__ */ jsx59(EditorMenuBar, { config: props.config, editor }),
|
|
11836
|
+
/* @__PURE__ */ jsxs33(
|
|
11991
11837
|
"div",
|
|
11992
11838
|
{
|
|
11993
11839
|
className: cn(
|
|
@@ -11995,17 +11841,16 @@ function Editor13(props) {
|
|
|
11995
11841
|
bodyClassName
|
|
11996
11842
|
),
|
|
11997
11843
|
children: [
|
|
11998
|
-
/* @__PURE__ */
|
|
11999
|
-
/* @__PURE__ */
|
|
12000
|
-
/* @__PURE__ */
|
|
12001
|
-
/* @__PURE__ */
|
|
12002
|
-
/* @__PURE__ */
|
|
12003
|
-
/* @__PURE__ */
|
|
12004
|
-
!hideContextMenu && /* @__PURE__ */
|
|
12005
|
-
/* @__PURE__ */
|
|
12006
|
-
/* @__PURE__ */
|
|
12007
|
-
/* @__PURE__ */
|
|
12008
|
-
/* @__PURE__ */ jsx60(InlineImageBubbleMenu, { editor, appendTo: menuContainerRef })
|
|
11844
|
+
/* @__PURE__ */ jsx59(TextBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
11845
|
+
/* @__PURE__ */ jsx59(ImageBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
11846
|
+
/* @__PURE__ */ jsx59(SpacerBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
11847
|
+
/* @__PURE__ */ jsx59(EditorContent, { editor }),
|
|
11848
|
+
/* @__PURE__ */ jsx59(SectionBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
11849
|
+
/* @__PURE__ */ jsx59(ColumnsBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
11850
|
+
!hideContextMenu && /* @__PURE__ */ jsx59(ContentMenu, { editor }),
|
|
11851
|
+
/* @__PURE__ */ jsx59(VariableBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
11852
|
+
/* @__PURE__ */ jsx59(RepeatBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
11853
|
+
/* @__PURE__ */ jsx59(InlineImageBubbleMenu, { editor, appendTo: menuContainerRef })
|
|
12009
11854
|
]
|
|
12010
11855
|
}
|
|
12011
11856
|
)
|
|
@@ -12014,6 +11859,6 @@ function Editor13(props) {
|
|
|
12014
11859
|
) });
|
|
12015
11860
|
}
|
|
12016
11861
|
export {
|
|
12017
|
-
|
|
11862
|
+
Editor12 as Editor
|
|
12018
11863
|
};
|
|
12019
11864
|
//# sourceMappingURL=index.mjs.map
|