@daisychainapp/maily-to-core 0.4.0 → 0.4.2
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 +52 -76
- package/dist/extensions/index.cjs.map +1 -1
- package/dist/extensions/index.mjs +51 -75
- package/dist/extensions/index.mjs.map +1 -1
- package/dist/index.cjs +701 -839
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +12 -19
- package/dist/index.css.map +1 -1
- package/dist/index.mjs +547 -685
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -10
- package/LICENSE +0 -21
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";
|
|
@@ -3557,7 +3557,14 @@ function BubbleMenuButton(item) {
|
|
|
3557
3557
|
if (tooltip) {
|
|
3558
3558
|
return /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
3559
3559
|
/* @__PURE__ */ jsx4(TooltipTrigger, { asChild: true, children: content }),
|
|
3560
|
-
/* @__PURE__ */ jsx4(
|
|
3560
|
+
/* @__PURE__ */ jsx4(
|
|
3561
|
+
TooltipContent,
|
|
3562
|
+
{
|
|
3563
|
+
sideOffset: 8,
|
|
3564
|
+
className: "mly:border-gray-300 mly:bg-transparent mly:p-0 mly:text-gray-700 mly:shadow-sm",
|
|
3565
|
+
children: /* @__PURE__ */ jsx4("span", { className: "mly:block mly:rounded-md mly:bg-soft-gray mly:!px-2 mly:!py-1.5", children: tooltip })
|
|
3566
|
+
}
|
|
3567
|
+
)
|
|
3561
3568
|
] });
|
|
3562
3569
|
}
|
|
3563
3570
|
return content;
|
|
@@ -4085,7 +4092,14 @@ function Select(props) {
|
|
|
4085
4092
|
}
|
|
4086
4093
|
return /* @__PURE__ */ jsxs5(Tooltip, { children: [
|
|
4087
4094
|
/* @__PURE__ */ jsx10(TooltipTrigger, { asChild: true, children: content }),
|
|
4088
|
-
/* @__PURE__ */ jsx10(
|
|
4095
|
+
/* @__PURE__ */ jsx10(
|
|
4096
|
+
TooltipContent,
|
|
4097
|
+
{
|
|
4098
|
+
sideOffset: 8,
|
|
4099
|
+
className: "mly:border-gray-300 mly:bg-transparent mly:p-0 mly:text-gray-700 mly:shadow-sm",
|
|
4100
|
+
children: /* @__PURE__ */ jsx10("span", { className: "mly:block mly:rounded-md mly:bg-soft-gray mly:!px-2 mly:!py-1.5", children: tooltip })
|
|
4101
|
+
}
|
|
4102
|
+
)
|
|
4089
4103
|
] });
|
|
4090
4104
|
}
|
|
4091
4105
|
|
|
@@ -4997,126 +5011,6 @@ var EditorMenuBar = (props) => {
|
|
|
4997
5011
|
);
|
|
4998
5012
|
};
|
|
4999
5013
|
|
|
5000
|
-
// src/editor/components/html-menu/html-menu.tsx
|
|
5001
|
-
import { BubbleMenu as BubbleMenu2 } from "@tiptap/react";
|
|
5002
|
-
import { CodeXmlIcon, ViewIcon } from "lucide-react";
|
|
5003
|
-
import { useCallback as useCallback4 } from "react";
|
|
5004
|
-
import { sticky as sticky2 } from "tippy.js";
|
|
5005
|
-
|
|
5006
|
-
// src/editor/components/html-menu/use-html-state.ts
|
|
5007
|
-
import { useEditorState as useEditorState2 } from "@tiptap/react";
|
|
5008
|
-
import deepEql2 from "fast-deep-equal";
|
|
5009
|
-
var useHtmlState = (editor) => {
|
|
5010
|
-
const states = useEditorState2({
|
|
5011
|
-
editor,
|
|
5012
|
-
selector: (ctx) => {
|
|
5013
|
-
var _a, _b;
|
|
5014
|
-
return {
|
|
5015
|
-
activeTab: ((_a = ctx.editor.getAttributes("htmlCodeBlock")) == null ? void 0 : _a.activeTab) || "code",
|
|
5016
|
-
currentShowIfKey: ((_b = ctx.editor.getAttributes("htmlCodeBlock")) == null ? void 0 : _b.showIfKey) || ""
|
|
5017
|
-
};
|
|
5018
|
-
},
|
|
5019
|
-
equalityFn: deepEql2
|
|
5020
|
-
});
|
|
5021
|
-
return states;
|
|
5022
|
-
};
|
|
5023
|
-
|
|
5024
|
-
// src/editor/components/html-menu/html-menu.tsx
|
|
5025
|
-
import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
5026
|
-
function HTMLBubbleMenu(props) {
|
|
5027
|
-
const { appendTo, editor } = props;
|
|
5028
|
-
if (!editor) {
|
|
5029
|
-
return null;
|
|
5030
|
-
}
|
|
5031
|
-
const state = useHtmlState(editor);
|
|
5032
|
-
const getReferenceClientRect = useCallback4(() => {
|
|
5033
|
-
const renderContainer = getRenderContainer(editor, "htmlCodeBlock");
|
|
5034
|
-
const rect = (renderContainer == null ? void 0 : renderContainer.getBoundingClientRect()) || new DOMRect(-1e3, -1e3, 0, 0);
|
|
5035
|
-
return rect;
|
|
5036
|
-
}, [editor]);
|
|
5037
|
-
const bubbleMenuProps = __spreadProps(__spreadValues(__spreadValues({}, props), appendTo ? { appendTo: appendTo.current } : {}), {
|
|
5038
|
-
shouldShow: ({ editor: editor2 }) => {
|
|
5039
|
-
return editor2.isActive("htmlCodeBlock");
|
|
5040
|
-
},
|
|
5041
|
-
tippyOptions: {
|
|
5042
|
-
offset: [0, 8],
|
|
5043
|
-
popperOptions: {
|
|
5044
|
-
modifiers: [{ name: "flip", enabled: false }]
|
|
5045
|
-
},
|
|
5046
|
-
getReferenceClientRect,
|
|
5047
|
-
appendTo: () => appendTo == null ? void 0 : appendTo.current,
|
|
5048
|
-
plugins: [sticky2],
|
|
5049
|
-
sticky: "popper",
|
|
5050
|
-
maxWidth: "auto"
|
|
5051
|
-
},
|
|
5052
|
-
pluginKey: "htmlCodeBlockBubbleMenu"
|
|
5053
|
-
});
|
|
5054
|
-
const { activeTab = "code" } = state;
|
|
5055
|
-
return /* @__PURE__ */ jsx16(
|
|
5056
|
-
BubbleMenu2,
|
|
5057
|
-
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
5058
|
-
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",
|
|
5059
|
-
children: /* @__PURE__ */ jsxs8(TooltipProvider, { children: [
|
|
5060
|
-
/* @__PURE__ */ jsxs8("div", { className: "mly:flex mly:items-center mly:h-7 mly:rounded-md mly:bg-soft-gray mly:px-0.5", children: [
|
|
5061
|
-
/* @__PURE__ */ jsxs8(Tooltip, { children: [
|
|
5062
|
-
/* @__PURE__ */ jsx16(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx16(
|
|
5063
|
-
"button",
|
|
5064
|
-
{
|
|
5065
|
-
className: cn(
|
|
5066
|
-
"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",
|
|
5067
|
-
activeTab === "code" && "mly:bg-white"
|
|
5068
|
-
),
|
|
5069
|
-
disabled: activeTab === "code",
|
|
5070
|
-
onClick: () => {
|
|
5071
|
-
var _a;
|
|
5072
|
-
(_a = editor == null ? void 0 : editor.commands) == null ? void 0 : _a.updateHtmlCodeBlock({
|
|
5073
|
-
activeTab: "code"
|
|
5074
|
-
});
|
|
5075
|
-
},
|
|
5076
|
-
children: /* @__PURE__ */ jsx16(CodeXmlIcon, { className: "mly:size-3 mly:shrink-0 mly:stroke-[2.5]" })
|
|
5077
|
-
}
|
|
5078
|
-
) }),
|
|
5079
|
-
/* @__PURE__ */ jsx16(TooltipContent, { sideOffset: 8, children: "HTML Code" })
|
|
5080
|
-
] }),
|
|
5081
|
-
/* @__PURE__ */ jsxs8(Tooltip, { children: [
|
|
5082
|
-
/* @__PURE__ */ jsx16(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx16(
|
|
5083
|
-
"button",
|
|
5084
|
-
{
|
|
5085
|
-
className: cn(
|
|
5086
|
-
"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",
|
|
5087
|
-
activeTab === "preview" && "mly:bg-white"
|
|
5088
|
-
),
|
|
5089
|
-
disabled: activeTab === "preview",
|
|
5090
|
-
onClick: () => {
|
|
5091
|
-
var _a;
|
|
5092
|
-
(_a = editor == null ? void 0 : editor.commands) == null ? void 0 : _a.updateHtmlCodeBlock({
|
|
5093
|
-
activeTab: "preview"
|
|
5094
|
-
});
|
|
5095
|
-
},
|
|
5096
|
-
children: /* @__PURE__ */ jsx16(ViewIcon, { className: "mly:size-3 mly:shrink-0 mly:stroke-[2.5]" })
|
|
5097
|
-
}
|
|
5098
|
-
) }),
|
|
5099
|
-
/* @__PURE__ */ jsx16(TooltipContent, { sideOffset: 8, children: "Preview" })
|
|
5100
|
-
] })
|
|
5101
|
-
] }),
|
|
5102
|
-
/* @__PURE__ */ jsx16(Divider, {}),
|
|
5103
|
-
/* @__PURE__ */ jsx16(
|
|
5104
|
-
ShowPopover,
|
|
5105
|
-
{
|
|
5106
|
-
showIfKey: state.currentShowIfKey,
|
|
5107
|
-
onShowIfKeyValueChange: (value) => {
|
|
5108
|
-
editor.commands.updateHtmlCodeBlock({
|
|
5109
|
-
showIfKey: value
|
|
5110
|
-
});
|
|
5111
|
-
},
|
|
5112
|
-
editor
|
|
5113
|
-
}
|
|
5114
|
-
)
|
|
5115
|
-
] })
|
|
5116
|
-
})
|
|
5117
|
-
);
|
|
5118
|
-
}
|
|
5119
|
-
|
|
5120
5014
|
// src/editor/nodes/logo/logo.ts
|
|
5121
5015
|
import TiptapImage from "@tiptap/extension-image";
|
|
5122
5016
|
import { ReactNodeViewRenderer } from "@tiptap/react";
|
|
@@ -5421,12 +5315,12 @@ var SectionExtension = Node3.create({
|
|
|
5421
5315
|
|
|
5422
5316
|
// src/editor/nodes/logo/logo-view.tsx
|
|
5423
5317
|
import { NodeViewWrapper as NodeViewWrapper2 } from "@tiptap/react";
|
|
5424
|
-
import { useCallback as
|
|
5318
|
+
import { useCallback as useCallback6, useEffect as useEffect5 } from "react";
|
|
5425
5319
|
import { useState as useState5 } from "react";
|
|
5426
5320
|
|
|
5427
5321
|
// src/editor/nodes/image/image-view.tsx
|
|
5428
5322
|
import {
|
|
5429
|
-
useCallback as
|
|
5323
|
+
useCallback as useCallback5,
|
|
5430
5324
|
useEffect as useEffect4,
|
|
5431
5325
|
useRef as useRef5,
|
|
5432
5326
|
useState as useState4
|
|
@@ -5570,13 +5464,13 @@ function useImageUploadOptions(editor) {
|
|
|
5570
5464
|
}
|
|
5571
5465
|
|
|
5572
5466
|
// src/editor/utils/use-event.ts
|
|
5573
|
-
import { useCallback as
|
|
5467
|
+
import { useCallback as useCallback4, useLayoutEffect, useRef as useRef4 } from "react";
|
|
5574
5468
|
var useEvent = (handler) => {
|
|
5575
5469
|
const handlerRef = useRef4(null);
|
|
5576
5470
|
useLayoutEffect(() => {
|
|
5577
5471
|
handlerRef.current = handler;
|
|
5578
5472
|
}, [handler]);
|
|
5579
|
-
return
|
|
5473
|
+
return useCallback4((...args) => {
|
|
5580
5474
|
if (handlerRef.current === null) {
|
|
5581
5475
|
throw new Error("Handler is not assigned");
|
|
5582
5476
|
}
|
|
@@ -5599,7 +5493,7 @@ function getNewWidth(height, aspectRatio) {
|
|
|
5599
5493
|
}
|
|
5600
5494
|
|
|
5601
5495
|
// src/editor/nodes/image/image-view.tsx
|
|
5602
|
-
import { Fragment as Fragment3, jsx as
|
|
5496
|
+
import { Fragment as Fragment3, jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
5603
5497
|
var MIN_WIDTH = 20;
|
|
5604
5498
|
var IMAGE_MAX_WIDTH = 600;
|
|
5605
5499
|
var IMAGE_MAX_HEIGHT = 400;
|
|
@@ -5668,12 +5562,12 @@ function ImageView(props) {
|
|
|
5668
5562
|
window.addEventListener("mouseup", removeListeners);
|
|
5669
5563
|
}
|
|
5670
5564
|
);
|
|
5671
|
-
const dragCornerButton =
|
|
5565
|
+
const dragCornerButton = useCallback5(
|
|
5672
5566
|
(direction) => {
|
|
5673
5567
|
if (isPlaceholderImage) {
|
|
5674
5568
|
return null;
|
|
5675
5569
|
}
|
|
5676
|
-
return /* @__PURE__ */
|
|
5570
|
+
return /* @__PURE__ */ jsx16(
|
|
5677
5571
|
"div",
|
|
5678
5572
|
{
|
|
5679
5573
|
role: "button",
|
|
@@ -5726,7 +5620,7 @@ function ImageView(props) {
|
|
|
5726
5620
|
const file = e.target.files[0];
|
|
5727
5621
|
yield handleImageUpload(file);
|
|
5728
5622
|
});
|
|
5729
|
-
const handleImageUpload =
|
|
5623
|
+
const handleImageUpload = useCallback5(
|
|
5730
5624
|
(file) => __async(this, null, function* () {
|
|
5731
5625
|
if (!isDroppable) {
|
|
5732
5626
|
return;
|
|
@@ -5782,7 +5676,7 @@ function ImageView(props) {
|
|
|
5782
5676
|
img.onerror = null;
|
|
5783
5677
|
};
|
|
5784
5678
|
}, [src]);
|
|
5785
|
-
const handleDragOver =
|
|
5679
|
+
const handleDragOver = useCallback5(
|
|
5786
5680
|
(e) => {
|
|
5787
5681
|
if (!isDroppable) {
|
|
5788
5682
|
return;
|
|
@@ -5793,7 +5687,7 @@ function ImageView(props) {
|
|
|
5793
5687
|
},
|
|
5794
5688
|
[onImageUpload]
|
|
5795
5689
|
);
|
|
5796
|
-
const handleDragLeave =
|
|
5690
|
+
const handleDragLeave = useCallback5(
|
|
5797
5691
|
(e) => {
|
|
5798
5692
|
if (!isDroppable) {
|
|
5799
5693
|
return;
|
|
@@ -5804,7 +5698,7 @@ function ImageView(props) {
|
|
|
5804
5698
|
},
|
|
5805
5699
|
[onImageUpload]
|
|
5806
5700
|
);
|
|
5807
|
-
const handleDrop =
|
|
5701
|
+
const handleDrop = useCallback5(
|
|
5808
5702
|
(e) => __async(this, null, function* () {
|
|
5809
5703
|
var _a2;
|
|
5810
5704
|
if (!isDroppable) {
|
|
@@ -5829,7 +5723,7 @@ function ImageView(props) {
|
|
|
5829
5723
|
const heightValue = height && height !== "auto" ? `${height}px` : void 0;
|
|
5830
5724
|
const hasExplicitWidth = Boolean(widthValue || (resizingStyle == null ? void 0 : resizingStyle.width));
|
|
5831
5725
|
const hasExplicitHeight = Boolean(heightValue || (resizingStyle == null ? void 0 : resizingStyle.height));
|
|
5832
|
-
return /* @__PURE__ */
|
|
5726
|
+
return /* @__PURE__ */ jsxs8(
|
|
5833
5727
|
NodeViewWrapper,
|
|
5834
5728
|
__spreadProps(__spreadValues({
|
|
5835
5729
|
as: "div",
|
|
@@ -5858,7 +5752,7 @@ function ImageView(props) {
|
|
|
5858
5752
|
onDrop: handleDrop
|
|
5859
5753
|
} : {}), {
|
|
5860
5754
|
children: [
|
|
5861
|
-
!hasImageSrc && status === "idle" && /* @__PURE__ */
|
|
5755
|
+
!hasImageSrc && status === "idle" && /* @__PURE__ */ jsx16(
|
|
5862
5756
|
ImageStatusLabel,
|
|
5863
5757
|
{
|
|
5864
5758
|
status: "idle",
|
|
@@ -5866,11 +5760,11 @@ function ImageView(props) {
|
|
|
5866
5760
|
isDropZone: isDroppable
|
|
5867
5761
|
}
|
|
5868
5762
|
),
|
|
5869
|
-
!hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */
|
|
5870
|
-
hasImageSrc && isSrcVariable && /* @__PURE__ */
|
|
5871
|
-
hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */
|
|
5872
|
-
hasImageSrc && status === "error" && !isSrcVariable && /* @__PURE__ */
|
|
5873
|
-
isDroppable && /* @__PURE__ */
|
|
5763
|
+
!hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */ jsx16(ImageStatusLabel, { status: "loading", minHeight: height }),
|
|
5764
|
+
hasImageSrc && isSrcVariable && /* @__PURE__ */ jsx16(ImageStatusLabel, { status: "variable", minHeight: height }),
|
|
5765
|
+
hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */ jsx16(ImageStatusLabel, { status: "loading", minHeight: height }),
|
|
5766
|
+
hasImageSrc && status === "error" && !isSrcVariable && /* @__PURE__ */ jsx16(ImageStatusLabel, { status: "error", minHeight: height }),
|
|
5767
|
+
isDroppable && /* @__PURE__ */ jsx16(
|
|
5874
5768
|
"input",
|
|
5875
5769
|
{
|
|
5876
5770
|
type: "file",
|
|
@@ -5880,8 +5774,8 @@ function ImageView(props) {
|
|
|
5880
5774
|
multiple: false
|
|
5881
5775
|
}
|
|
5882
5776
|
),
|
|
5883
|
-
hasImageSrc && status === "loaded" && !isSrcVariable && /* @__PURE__ */
|
|
5884
|
-
/* @__PURE__ */
|
|
5777
|
+
hasImageSrc && status === "loaded" && !isSrcVariable && /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
5778
|
+
/* @__PURE__ */ jsx16(
|
|
5885
5779
|
"img",
|
|
5886
5780
|
__spreadProps(__spreadValues({}, attrs), {
|
|
5887
5781
|
ref: imgRef,
|
|
@@ -5901,13 +5795,13 @@ function ImageView(props) {
|
|
|
5901
5795
|
)
|
|
5902
5796
|
})
|
|
5903
5797
|
),
|
|
5904
|
-
selected && editor.isEditable && !isPlaceholderImage && /* @__PURE__ */
|
|
5798
|
+
selected && editor.isEditable && !isPlaceholderImage && /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
5905
5799
|
[
|
|
5906
5800
|
{ left: 0, top: 0, height: "100%", width: "1px" },
|
|
5907
5801
|
{ right: 0, top: 0, height: "100%", width: "1px" },
|
|
5908
5802
|
{ top: 0, left: 0, width: "100%", height: "1px" },
|
|
5909
5803
|
{ bottom: 0, left: 0, width: "100%", height: "1px" }
|
|
5910
|
-
].map((style, i) => /* @__PURE__ */
|
|
5804
|
+
].map((style, i) => /* @__PURE__ */ jsx16(
|
|
5911
5805
|
"div",
|
|
5912
5806
|
{
|
|
5913
5807
|
className: "mly:bg-rose-500",
|
|
@@ -5931,7 +5825,7 @@ function ImageStatusLabel(props) {
|
|
|
5931
5825
|
const _a = props, { status, minHeight, className, style, isDropZone } = _a, rest = __objRest(_a, ["status", "minHeight", "className", "style", "isDropZone"]);
|
|
5932
5826
|
const resolvedMinHeight = minHeight != null ? minHeight : isDropZone ? 36 : void 0;
|
|
5933
5827
|
const resolvedPaddingY = isDropZone ? 8 : void 0;
|
|
5934
|
-
return /* @__PURE__ */
|
|
5828
|
+
return /* @__PURE__ */ jsxs8(
|
|
5935
5829
|
"div",
|
|
5936
5830
|
__spreadProps(__spreadValues({}, rest), {
|
|
5937
5831
|
className: cn(
|
|
@@ -5949,25 +5843,25 @@ function ImageStatusLabel(props) {
|
|
|
5949
5843
|
paddingBottom: resolvedPaddingY
|
|
5950
5844
|
} : {}), style),
|
|
5951
5845
|
children: [
|
|
5952
|
-
status === "idle" && !isDropZone && /* @__PURE__ */
|
|
5953
|
-
/* @__PURE__ */
|
|
5954
|
-
/* @__PURE__ */
|
|
5846
|
+
status === "idle" && !isDropZone && /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
5847
|
+
/* @__PURE__ */ jsx16(ImageOffIcon, { className: "mly:size-4 mly:stroke-[2.5]" }),
|
|
5848
|
+
/* @__PURE__ */ jsx16("span", { children: "No image selected" })
|
|
5955
5849
|
] }),
|
|
5956
|
-
status === "idle" && isDropZone && /* @__PURE__ */
|
|
5957
|
-
/* @__PURE__ */
|
|
5958
|
-
/* @__PURE__ */
|
|
5850
|
+
status === "idle" && isDropZone && /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
5851
|
+
/* @__PURE__ */ jsx16(GrabIcon, { className: "mly:size-4 mly:stroke-[2.5]" }),
|
|
5852
|
+
/* @__PURE__ */ jsx16("span", { children: "Click or Drop image here" })
|
|
5959
5853
|
] }),
|
|
5960
|
-
status === "loading" && /* @__PURE__ */
|
|
5961
|
-
/* @__PURE__ */
|
|
5962
|
-
/* @__PURE__ */
|
|
5854
|
+
status === "loading" && /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
5855
|
+
/* @__PURE__ */ jsx16(Loader2, { className: "mly:size-4 mly:animate-spin mly:stroke-[2.5]" }),
|
|
5856
|
+
/* @__PURE__ */ jsx16("span", { children: "Loading image..." })
|
|
5963
5857
|
] }),
|
|
5964
|
-
status === "error" && /* @__PURE__ */
|
|
5965
|
-
/* @__PURE__ */
|
|
5966
|
-
/* @__PURE__ */
|
|
5858
|
+
status === "error" && /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
5859
|
+
/* @__PURE__ */ jsx16(Ban, { className: "mly:size-4 mly:stroke-[2.5]" }),
|
|
5860
|
+
/* @__PURE__ */ jsx16("span", { children: "Error loading image" })
|
|
5967
5861
|
] }),
|
|
5968
|
-
status === "variable" && /* @__PURE__ */
|
|
5969
|
-
/* @__PURE__ */
|
|
5970
|
-
/* @__PURE__ */
|
|
5862
|
+
status === "variable" && /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
5863
|
+
/* @__PURE__ */ jsx16(BracesIcon, { className: "mly:size-4 mly:stroke-[2.5]" }),
|
|
5864
|
+
/* @__PURE__ */ jsx16("span", { children: "Variable Image URL" })
|
|
5971
5865
|
] })
|
|
5972
5866
|
]
|
|
5973
5867
|
})
|
|
@@ -5975,7 +5869,7 @@ function ImageStatusLabel(props) {
|
|
|
5975
5869
|
}
|
|
5976
5870
|
|
|
5977
5871
|
// src/editor/nodes/logo/logo-view.tsx
|
|
5978
|
-
import { jsx as
|
|
5872
|
+
import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
5979
5873
|
function LogoView(props) {
|
|
5980
5874
|
const { node, editor, updateAttributes: updateAttributes2 } = props;
|
|
5981
5875
|
const [status, setStatus] = useState5("idle");
|
|
@@ -5997,7 +5891,7 @@ function LogoView(props) {
|
|
|
5997
5891
|
const file = e.target.files[0];
|
|
5998
5892
|
yield handleImageUpload(file);
|
|
5999
5893
|
});
|
|
6000
|
-
const handleImageUpload =
|
|
5894
|
+
const handleImageUpload = useCallback6(
|
|
6001
5895
|
(file) => __async(this, null, function* () {
|
|
6002
5896
|
if (!isDroppable) {
|
|
6003
5897
|
return;
|
|
@@ -6015,7 +5909,7 @@ function LogoView(props) {
|
|
|
6015
5909
|
}),
|
|
6016
5910
|
[onImageUpload, updateAttributes2]
|
|
6017
5911
|
);
|
|
6018
|
-
const handleDragOver =
|
|
5912
|
+
const handleDragOver = useCallback6(
|
|
6019
5913
|
(e) => {
|
|
6020
5914
|
if (!isDroppable) {
|
|
6021
5915
|
return;
|
|
@@ -6026,7 +5920,7 @@ function LogoView(props) {
|
|
|
6026
5920
|
},
|
|
6027
5921
|
[onImageUpload]
|
|
6028
5922
|
);
|
|
6029
|
-
const handleDragLeave =
|
|
5923
|
+
const handleDragLeave = useCallback6(
|
|
6030
5924
|
(e) => {
|
|
6031
5925
|
if (!isDroppable) {
|
|
6032
5926
|
return;
|
|
@@ -6037,7 +5931,7 @@ function LogoView(props) {
|
|
|
6037
5931
|
},
|
|
6038
5932
|
[onImageUpload]
|
|
6039
5933
|
);
|
|
6040
|
-
const handleDrop =
|
|
5934
|
+
const handleDrop = useCallback6(
|
|
6041
5935
|
(e) => __async(this, null, function* () {
|
|
6042
5936
|
var _a;
|
|
6043
5937
|
if (!isDroppable) {
|
|
@@ -6081,7 +5975,7 @@ function LogoView(props) {
|
|
|
6081
5975
|
};
|
|
6082
5976
|
}, [logoSrc]);
|
|
6083
5977
|
const logoSize = logoSizes[size];
|
|
6084
|
-
return /* @__PURE__ */
|
|
5978
|
+
return /* @__PURE__ */ jsxs9(
|
|
6085
5979
|
NodeViewWrapper2,
|
|
6086
5980
|
__spreadProps(__spreadValues({
|
|
6087
5981
|
as: "div",
|
|
@@ -6101,7 +5995,7 @@ function LogoView(props) {
|
|
|
6101
5995
|
onDrop: handleDrop
|
|
6102
5996
|
} : {}), {
|
|
6103
5997
|
children: [
|
|
6104
|
-
!hasImageSrc && status === "idle" && /* @__PURE__ */
|
|
5998
|
+
!hasImageSrc && status === "idle" && /* @__PURE__ */ jsx17(
|
|
6105
5999
|
ImageStatusLabel,
|
|
6106
6000
|
{
|
|
6107
6001
|
status: "idle",
|
|
@@ -6109,11 +6003,11 @@ function LogoView(props) {
|
|
|
6109
6003
|
isDropZone: isDroppable
|
|
6110
6004
|
}
|
|
6111
6005
|
),
|
|
6112
|
-
!hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */
|
|
6113
|
-
hasImageSrc && isSrcVariable && /* @__PURE__ */
|
|
6114
|
-
hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */
|
|
6115
|
-
hasImageSrc && status === "error" && !isSrcVariable && /* @__PURE__ */
|
|
6116
|
-
isDroppable && /* @__PURE__ */
|
|
6006
|
+
!hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */ jsx17(ImageStatusLabel, { status: "loading", minHeight: logoSize }),
|
|
6007
|
+
hasImageSrc && isSrcVariable && /* @__PURE__ */ jsx17(ImageStatusLabel, { status: "variable", minHeight: logoSize }),
|
|
6008
|
+
hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */ jsx17(ImageStatusLabel, { status: "loading", minHeight: logoSize }),
|
|
6009
|
+
hasImageSrc && status === "error" && !isSrcVariable && /* @__PURE__ */ jsx17(ImageStatusLabel, { status: "error", minHeight: logoSize }),
|
|
6010
|
+
isDroppable && /* @__PURE__ */ jsx17(
|
|
6117
6011
|
"input",
|
|
6118
6012
|
{
|
|
6119
6013
|
type: "file",
|
|
@@ -6123,7 +6017,7 @@ function LogoView(props) {
|
|
|
6123
6017
|
multiple: false
|
|
6124
6018
|
}
|
|
6125
6019
|
),
|
|
6126
|
-
hasImageSrc && status === "loaded" && !isSrcVariable && /* @__PURE__ */
|
|
6020
|
+
hasImageSrc && status === "loaded" && !isSrcVariable && /* @__PURE__ */ jsx17(
|
|
6127
6021
|
"img",
|
|
6128
6022
|
{
|
|
6129
6023
|
src: logoSrc,
|
|
@@ -6274,13 +6168,13 @@ var borderRadius = [
|
|
|
6274
6168
|
];
|
|
6275
6169
|
|
|
6276
6170
|
// src/editor/components/image-menu/image-bubble-menu.tsx
|
|
6277
|
-
import { BubbleMenu as
|
|
6171
|
+
import { BubbleMenu as BubbleMenu2 } from "@tiptap/react";
|
|
6278
6172
|
import { ImageDown, LockIcon, LockOpenIcon } from "lucide-react";
|
|
6279
|
-
import { sticky as
|
|
6173
|
+
import { sticky as sticky2 } from "tippy.js";
|
|
6280
6174
|
|
|
6281
6175
|
// src/editor/components/alignment-switch.tsx
|
|
6282
6176
|
import { AlignCenter as AlignCenter2, AlignLeft as AlignLeft2, AlignRight as AlignRight2 } from "lucide-react";
|
|
6283
|
-
import { jsx as
|
|
6177
|
+
import { jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
6284
6178
|
function AlignmentSwitch(props) {
|
|
6285
6179
|
const { alignment: rawAlignment, onAlignmentChange } = props;
|
|
6286
6180
|
const alignment = allowedLogoAlignment.includes(
|
|
@@ -6310,20 +6204,27 @@ function AlignmentSwitch(props) {
|
|
|
6310
6204
|
}
|
|
6311
6205
|
};
|
|
6312
6206
|
const activeAlignment = alignments[alignment];
|
|
6313
|
-
return /* @__PURE__ */
|
|
6314
|
-
/* @__PURE__ */
|
|
6315
|
-
/* @__PURE__ */
|
|
6207
|
+
return /* @__PURE__ */ jsxs10(Popover, { children: [
|
|
6208
|
+
/* @__PURE__ */ jsxs10(Tooltip, { children: [
|
|
6209
|
+
/* @__PURE__ */ jsx18(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx18(
|
|
6316
6210
|
PopoverTrigger,
|
|
6317
6211
|
{
|
|
6318
6212
|
className: cn(
|
|
6319
6213
|
"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"
|
|
6320
6214
|
),
|
|
6321
|
-
children: /* @__PURE__ */
|
|
6215
|
+
children: /* @__PURE__ */ jsx18(activeAlignment.icon, { className: "mly:h-3 mly:w-3 mly:stroke-[2.5]" })
|
|
6322
6216
|
}
|
|
6323
6217
|
) }),
|
|
6324
|
-
/* @__PURE__ */
|
|
6218
|
+
/* @__PURE__ */ jsx18(
|
|
6219
|
+
TooltipContent,
|
|
6220
|
+
{
|
|
6221
|
+
sideOffset: 8,
|
|
6222
|
+
className: "mly:border-gray-300 mly:bg-transparent mly:p-0 mly:text-gray-700 mly:shadow-sm",
|
|
6223
|
+
children: /* @__PURE__ */ jsx18("span", { className: "mly:block mly:rounded-md mly:bg-soft-gray mly:!px-2 mly:!py-1.5", children: "Alignment" })
|
|
6224
|
+
}
|
|
6225
|
+
)
|
|
6325
6226
|
] }),
|
|
6326
|
-
/* @__PURE__ */
|
|
6227
|
+
/* @__PURE__ */ jsx18(
|
|
6327
6228
|
PopoverContent,
|
|
6328
6229
|
{
|
|
6329
6230
|
className: "mly:flex mly:w-max mly:gap-0.5 mly:rounded-lg mly:p-0.5!",
|
|
@@ -6337,7 +6238,7 @@ function AlignmentSwitch(props) {
|
|
|
6337
6238
|
e.preventDefault();
|
|
6338
6239
|
},
|
|
6339
6240
|
children: Object.entries(alignments).map(([key, value]) => {
|
|
6340
|
-
return /* @__PURE__ */
|
|
6241
|
+
return /* @__PURE__ */ jsx18(
|
|
6341
6242
|
BubbleMenuButton,
|
|
6342
6243
|
{
|
|
6343
6244
|
icon: value.icon,
|
|
@@ -6365,12 +6266,12 @@ import { FootprintsIcon as FootprintsIcon2, Heading1 as Heading12 } from "lucide
|
|
|
6365
6266
|
|
|
6366
6267
|
// src/blocks/button.tsx
|
|
6367
6268
|
import { MousePointer, ArrowUpRightSquare } from "lucide-react";
|
|
6368
|
-
import { jsx as
|
|
6269
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
6369
6270
|
var button = {
|
|
6370
6271
|
title: "Button",
|
|
6371
6272
|
description: "Add a call to action button to email.",
|
|
6372
6273
|
searchTerms: ["link", "button", "cta"],
|
|
6373
|
-
icon: /* @__PURE__ */
|
|
6274
|
+
icon: /* @__PURE__ */ jsx19(MousePointer, { className: "mly:h-4 mly:w-4" }),
|
|
6374
6275
|
command: ({ editor, range }) => {
|
|
6375
6276
|
editor.chain().focus().deleteRange(range).setButton().run();
|
|
6376
6277
|
}
|
|
@@ -6379,7 +6280,7 @@ var linkCard = {
|
|
|
6379
6280
|
title: "Link Card",
|
|
6380
6281
|
description: "Add a link card to email.",
|
|
6381
6282
|
searchTerms: ["link", "button", "image"],
|
|
6382
|
-
icon: /* @__PURE__ */
|
|
6283
|
+
icon: /* @__PURE__ */ jsx19(ArrowUpRightSquare, { className: "mly:h-4 mly:w-4" }),
|
|
6383
6284
|
command: ({ editor, range }) => {
|
|
6384
6285
|
editor.chain().focus().deleteRange(range).setLinkCard().run();
|
|
6385
6286
|
},
|
|
@@ -6391,13 +6292,13 @@ var linkCard = {
|
|
|
6391
6292
|
};
|
|
6392
6293
|
|
|
6393
6294
|
// src/blocks/code.tsx
|
|
6394
|
-
import { CodeXmlIcon
|
|
6395
|
-
import { jsx as
|
|
6295
|
+
import { CodeXmlIcon } from "lucide-react";
|
|
6296
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
6396
6297
|
var htmlCodeBlock = {
|
|
6397
6298
|
title: "Custom HTML",
|
|
6398
6299
|
description: "Insert a custom HTML block",
|
|
6399
6300
|
searchTerms: ["html", "code", "custom"],
|
|
6400
|
-
icon: /* @__PURE__ */
|
|
6301
|
+
icon: /* @__PURE__ */ jsx20(CodeXmlIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6401
6302
|
command: ({ editor, range }) => {
|
|
6402
6303
|
editor.chain().focus().deleteRange(range).setHtmlCodeBlock({ language: "html" }).run();
|
|
6403
6304
|
}
|
|
@@ -6406,12 +6307,12 @@ var htmlCodeBlock = {
|
|
|
6406
6307
|
// src/blocks/image.tsx
|
|
6407
6308
|
import { TextSelection as TextSelection2 } from "@tiptap/pm/state";
|
|
6408
6309
|
import { ImageIcon } from "lucide-react";
|
|
6409
|
-
import { jsx as
|
|
6310
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
6410
6311
|
var image = {
|
|
6411
6312
|
title: "Image",
|
|
6412
6313
|
description: "Full width image",
|
|
6413
6314
|
searchTerms: ["image"],
|
|
6414
|
-
icon: /* @__PURE__ */
|
|
6315
|
+
icon: /* @__PURE__ */ jsx21(ImageIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6415
6316
|
command: ({ editor, range }) => {
|
|
6416
6317
|
editor.chain().focus().deleteRange(range).setImage({ src: "" }).run();
|
|
6417
6318
|
}
|
|
@@ -6420,7 +6321,7 @@ var logo = {
|
|
|
6420
6321
|
title: "Logo",
|
|
6421
6322
|
description: "Add your brand logo",
|
|
6422
6323
|
searchTerms: ["image", "logo"],
|
|
6423
|
-
icon: /* @__PURE__ */
|
|
6324
|
+
icon: /* @__PURE__ */ jsx21(ImageIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6424
6325
|
command: ({ editor, range }) => {
|
|
6425
6326
|
editor.chain().focus().deleteRange(range).setLogoImage({ src: "" }).run();
|
|
6426
6327
|
}
|
|
@@ -6429,7 +6330,7 @@ var inlineImage = {
|
|
|
6429
6330
|
title: "Inline Image",
|
|
6430
6331
|
description: "Inline image",
|
|
6431
6332
|
searchTerms: ["image", "inline"],
|
|
6432
|
-
icon: /* @__PURE__ */
|
|
6333
|
+
icon: /* @__PURE__ */ jsx21(ImageIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6433
6334
|
command: ({ editor, range }) => {
|
|
6434
6335
|
editor.chain().focus().deleteRange(range).setInlineImage({
|
|
6435
6336
|
src: "https://maily.to/brand/logo.png"
|
|
@@ -6459,12 +6360,12 @@ import {
|
|
|
6459
6360
|
RectangleHorizontal,
|
|
6460
6361
|
Minus
|
|
6461
6362
|
} from "lucide-react";
|
|
6462
|
-
import { jsx as
|
|
6363
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
6463
6364
|
var columns = {
|
|
6464
6365
|
title: "Columns",
|
|
6465
6366
|
description: "Add columns to email.",
|
|
6466
6367
|
searchTerms: ["layout", "columns"],
|
|
6467
|
-
icon: /* @__PURE__ */
|
|
6368
|
+
icon: /* @__PURE__ */ jsx22(ColumnsIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6468
6369
|
command: ({ editor, range }) => {
|
|
6469
6370
|
editor.chain().focus().deleteRange(range).setColumns().focus(editor.state.selection.head - 2).run();
|
|
6470
6371
|
}
|
|
@@ -6473,7 +6374,7 @@ var section = {
|
|
|
6473
6374
|
title: "Section",
|
|
6474
6375
|
description: "Add a section to email.",
|
|
6475
6376
|
searchTerms: ["layout", "section"],
|
|
6476
|
-
icon: /* @__PURE__ */
|
|
6377
|
+
icon: /* @__PURE__ */ jsx22(RectangleHorizontal, { className: "mly:h-4 mly:w-4" }),
|
|
6477
6378
|
command: ({ editor, range }) => {
|
|
6478
6379
|
editor.chain().focus().deleteRange(range).setSection().run();
|
|
6479
6380
|
}
|
|
@@ -6482,7 +6383,7 @@ var repeat = {
|
|
|
6482
6383
|
title: "Repeat",
|
|
6483
6384
|
description: "Loop over an array of items.",
|
|
6484
6385
|
searchTerms: ["repeat", "for", "loop"],
|
|
6485
|
-
icon: /* @__PURE__ */
|
|
6386
|
+
icon: /* @__PURE__ */ jsx22(Repeat2, { className: "mly:h-4 mly:w-4" }),
|
|
6486
6387
|
command: ({ editor, range }) => {
|
|
6487
6388
|
editor.chain().focus().deleteRange(range).setRepeat().run();
|
|
6488
6389
|
}
|
|
@@ -6491,7 +6392,7 @@ var spacer = {
|
|
|
6491
6392
|
title: "Spacer",
|
|
6492
6393
|
description: "Add space between blocks.",
|
|
6493
6394
|
searchTerms: ["space", "gap", "divider"],
|
|
6494
|
-
icon: /* @__PURE__ */
|
|
6395
|
+
icon: /* @__PURE__ */ jsx22(MoveVertical, { className: "mly:h-4 mly:w-4" }),
|
|
6495
6396
|
command: ({ editor, range }) => {
|
|
6496
6397
|
editor.chain().focus().deleteRange(range).setSpacer({ height: "sm" }).run();
|
|
6497
6398
|
}
|
|
@@ -6500,7 +6401,7 @@ var divider = {
|
|
|
6500
6401
|
title: "Divider",
|
|
6501
6402
|
description: "Add a horizontal divider.",
|
|
6502
6403
|
searchTerms: ["divider", "line"],
|
|
6503
|
-
icon: /* @__PURE__ */
|
|
6404
|
+
icon: /* @__PURE__ */ jsx22(Minus, { className: "mly:h-4 mly:w-4" }),
|
|
6504
6405
|
command: ({ editor, range }) => {
|
|
6505
6406
|
editor.chain().focus().deleteRange(range).setHorizontalRule().run();
|
|
6506
6407
|
}
|
|
@@ -6508,12 +6409,12 @@ var divider = {
|
|
|
6508
6409
|
|
|
6509
6410
|
// src/blocks/list.tsx
|
|
6510
6411
|
import { List, ListOrdered } from "lucide-react";
|
|
6511
|
-
import { jsx as
|
|
6412
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
6512
6413
|
var bulletList = {
|
|
6513
6414
|
title: "Bullet List",
|
|
6514
6415
|
description: "Create a simple bullet list.",
|
|
6515
6416
|
searchTerms: ["unordered", "point"],
|
|
6516
|
-
icon: /* @__PURE__ */
|
|
6417
|
+
icon: /* @__PURE__ */ jsx23(List, { className: "mly:h-4 mly:w-4" }),
|
|
6517
6418
|
command: ({ editor, range }) => {
|
|
6518
6419
|
editor.chain().focus().deleteRange(range).toggleBulletList().run();
|
|
6519
6420
|
}
|
|
@@ -6522,7 +6423,7 @@ var orderedList = {
|
|
|
6522
6423
|
title: "Numbered List",
|
|
6523
6424
|
description: "Create a list with numbering.",
|
|
6524
6425
|
searchTerms: ["ordered"],
|
|
6525
|
-
icon: /* @__PURE__ */
|
|
6426
|
+
icon: /* @__PURE__ */ jsx23(ListOrdered, { className: "mly:h-4 mly:w-4" }),
|
|
6526
6427
|
command: ({ editor, range }) => {
|
|
6527
6428
|
editor.chain().focus().deleteRange(range).toggleOrderedList().run();
|
|
6528
6429
|
}
|
|
@@ -6539,12 +6440,12 @@ import {
|
|
|
6539
6440
|
FootprintsIcon,
|
|
6540
6441
|
EraserIcon as EraserIcon2
|
|
6541
6442
|
} from "lucide-react";
|
|
6542
|
-
import { jsx as
|
|
6443
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
6543
6444
|
var text = {
|
|
6544
6445
|
title: "Text",
|
|
6545
6446
|
description: "Just start typing with plain text.",
|
|
6546
6447
|
searchTerms: ["p", "paragraph"],
|
|
6547
|
-
icon: /* @__PURE__ */
|
|
6448
|
+
icon: /* @__PURE__ */ jsx24(Text, { className: "mly:h-4 mly:w-4" }),
|
|
6548
6449
|
command: ({ editor, range }) => {
|
|
6549
6450
|
editor.chain().focus().deleteRange(range).toggleNode("paragraph", "paragraph").run();
|
|
6550
6451
|
}
|
|
@@ -6553,7 +6454,7 @@ var heading1 = {
|
|
|
6553
6454
|
title: "Heading 1",
|
|
6554
6455
|
description: "Big heading.",
|
|
6555
6456
|
searchTerms: ["h1", "title", "big", "large"],
|
|
6556
|
-
icon: /* @__PURE__ */
|
|
6457
|
+
icon: /* @__PURE__ */ jsx24(Heading1, { className: "mly:h-4 mly:w-4" }),
|
|
6557
6458
|
command: ({ editor, range }) => {
|
|
6558
6459
|
editor.chain().focus().deleteRange(range).setNode("heading", { level: 1 }).run();
|
|
6559
6460
|
}
|
|
@@ -6562,7 +6463,7 @@ var heading2 = {
|
|
|
6562
6463
|
title: "Heading 2",
|
|
6563
6464
|
description: "Medium heading.",
|
|
6564
6465
|
searchTerms: ["h2", "subtitle", "medium"],
|
|
6565
|
-
icon: /* @__PURE__ */
|
|
6466
|
+
icon: /* @__PURE__ */ jsx24(Heading2, { className: "mly:h-4 mly:w-4" }),
|
|
6566
6467
|
command: ({ editor, range }) => {
|
|
6567
6468
|
editor.chain().focus().deleteRange(range).setNode("heading", { level: 2 }).run();
|
|
6568
6469
|
}
|
|
@@ -6571,7 +6472,7 @@ var heading3 = {
|
|
|
6571
6472
|
title: "Heading 3",
|
|
6572
6473
|
description: "Small heading.",
|
|
6573
6474
|
searchTerms: ["h3", "subtitle", "small"],
|
|
6574
|
-
icon: /* @__PURE__ */
|
|
6475
|
+
icon: /* @__PURE__ */ jsx24(Heading3, { className: "mly:h-4 mly:w-4" }),
|
|
6575
6476
|
command: ({ editor, range }) => {
|
|
6576
6477
|
editor.chain().focus().deleteRange(range).setNode("heading", { level: 3 }).run();
|
|
6577
6478
|
}
|
|
@@ -6580,7 +6481,7 @@ var hardBreak = {
|
|
|
6580
6481
|
title: "Hard Break",
|
|
6581
6482
|
description: "Add a break between lines.",
|
|
6582
6483
|
searchTerms: ["break", "line"],
|
|
6583
|
-
icon: /* @__PURE__ */
|
|
6484
|
+
icon: /* @__PURE__ */ jsx24(DivideIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6584
6485
|
command: ({ editor, range }) => {
|
|
6585
6486
|
editor.chain().focus().deleteRange(range).setHardBreak().run();
|
|
6586
6487
|
}
|
|
@@ -6589,7 +6490,7 @@ var blockquote = {
|
|
|
6589
6490
|
title: "Blockquote",
|
|
6590
6491
|
description: "Add blockquote.",
|
|
6591
6492
|
searchTerms: ["quote", "blockquote"],
|
|
6592
|
-
icon: /* @__PURE__ */
|
|
6493
|
+
icon: /* @__PURE__ */ jsx24(TextQuote, { className: "mly:h-4 mly:w-4" }),
|
|
6593
6494
|
command: ({ editor, range }) => {
|
|
6594
6495
|
editor.chain().focus().deleteRange(range).toggleBlockquote().run();
|
|
6595
6496
|
}
|
|
@@ -6598,7 +6499,7 @@ var footer = {
|
|
|
6598
6499
|
title: "Footer",
|
|
6599
6500
|
description: "Add a footer text to email.",
|
|
6600
6501
|
searchTerms: ["footer", "text"],
|
|
6601
|
-
icon: /* @__PURE__ */
|
|
6502
|
+
icon: /* @__PURE__ */ jsx24(FootprintsIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6602
6503
|
command: ({ editor, range }) => {
|
|
6603
6504
|
editor.chain().focus().deleteRange(range).setFooter().run();
|
|
6604
6505
|
}
|
|
@@ -6607,16 +6508,16 @@ var clearLine = {
|
|
|
6607
6508
|
title: "Clear Line",
|
|
6608
6509
|
description: "Clear the current line.",
|
|
6609
6510
|
searchTerms: ["clear", "line"],
|
|
6610
|
-
icon: /* @__PURE__ */
|
|
6511
|
+
icon: /* @__PURE__ */ jsx24(EraserIcon2, { className: "mly:h-4 mly:w-4" }),
|
|
6611
6512
|
command: ({ editor, range }) => {
|
|
6612
6513
|
editor.chain().focus().selectParentNode().deleteSelection().run();
|
|
6613
6514
|
}
|
|
6614
6515
|
};
|
|
6615
6516
|
|
|
6616
6517
|
// src/editor/components/icons/logo-with-cover-image.tsx
|
|
6617
|
-
import { jsx as
|
|
6518
|
+
import { jsx as jsx25, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
6618
6519
|
function LogoWithCoverImageIcon(props) {
|
|
6619
|
-
return /* @__PURE__ */
|
|
6520
|
+
return /* @__PURE__ */ jsxs11(
|
|
6620
6521
|
"svg",
|
|
6621
6522
|
__spreadProps(__spreadValues({
|
|
6622
6523
|
width: "14",
|
|
@@ -6626,7 +6527,7 @@ function LogoWithCoverImageIcon(props) {
|
|
|
6626
6527
|
xmlns: "http://www.w3.org/2000/svg"
|
|
6627
6528
|
}, props), {
|
|
6628
6529
|
children: [
|
|
6629
|
-
/* @__PURE__ */
|
|
6530
|
+
/* @__PURE__ */ jsx25(
|
|
6630
6531
|
"path",
|
|
6631
6532
|
{
|
|
6632
6533
|
fillRule: "evenodd",
|
|
@@ -6635,7 +6536,7 @@ function LogoWithCoverImageIcon(props) {
|
|
|
6635
6536
|
fill: "currentColor"
|
|
6636
6537
|
}
|
|
6637
6538
|
),
|
|
6638
|
-
/* @__PURE__ */
|
|
6539
|
+
/* @__PURE__ */ jsx25(
|
|
6639
6540
|
"path",
|
|
6640
6541
|
{
|
|
6641
6542
|
fillRule: "evenodd",
|
|
@@ -6644,7 +6545,7 @@ function LogoWithCoverImageIcon(props) {
|
|
|
6644
6545
|
fill: "currentColor"
|
|
6645
6546
|
}
|
|
6646
6547
|
),
|
|
6647
|
-
/* @__PURE__ */
|
|
6548
|
+
/* @__PURE__ */ jsx25(
|
|
6648
6549
|
"path",
|
|
6649
6550
|
{
|
|
6650
6551
|
fillRule: "evenodd",
|
|
@@ -6653,8 +6554,8 @@ function LogoWithCoverImageIcon(props) {
|
|
|
6653
6554
|
fill: "currentColor"
|
|
6654
6555
|
}
|
|
6655
6556
|
),
|
|
6656
|
-
/* @__PURE__ */
|
|
6657
|
-
/* @__PURE__ */
|
|
6557
|
+
/* @__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" }) }),
|
|
6558
|
+
/* @__PURE__ */ jsx25(
|
|
6658
6559
|
"rect",
|
|
6659
6560
|
{
|
|
6660
6561
|
x: "3",
|
|
@@ -6667,7 +6568,7 @@ function LogoWithCoverImageIcon(props) {
|
|
|
6667
6568
|
mask: "url(#path-4-inside-1_1046_19527)"
|
|
6668
6569
|
}
|
|
6669
6570
|
),
|
|
6670
|
-
/* @__PURE__ */
|
|
6571
|
+
/* @__PURE__ */ jsx25(
|
|
6671
6572
|
"rect",
|
|
6672
6573
|
{
|
|
6673
6574
|
x: "6.25",
|
|
@@ -6679,16 +6580,16 @@ function LogoWithCoverImageIcon(props) {
|
|
|
6679
6580
|
strokeWidth: "0.5"
|
|
6680
6581
|
}
|
|
6681
6582
|
),
|
|
6682
|
-
/* @__PURE__ */
|
|
6583
|
+
/* @__PURE__ */ jsx25("rect", { x: "3", y: "8", width: "2", height: "1", rx: "0.5", fill: "currentColor" })
|
|
6683
6584
|
]
|
|
6684
6585
|
})
|
|
6685
6586
|
);
|
|
6686
6587
|
}
|
|
6687
6588
|
|
|
6688
6589
|
// src/editor/components/icons/logo-with-text-horizon.tsx
|
|
6689
|
-
import { jsx as
|
|
6590
|
+
import { jsx as jsx26, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
6690
6591
|
function LogoWithTextHorizonIcon(props) {
|
|
6691
|
-
return /* @__PURE__ */
|
|
6592
|
+
return /* @__PURE__ */ jsxs12(
|
|
6692
6593
|
"svg",
|
|
6693
6594
|
__spreadProps(__spreadValues({
|
|
6694
6595
|
width: "14",
|
|
@@ -6698,7 +6599,7 @@ function LogoWithTextHorizonIcon(props) {
|
|
|
6698
6599
|
xmlns: "http://www.w3.org/2000/svg"
|
|
6699
6600
|
}, props), {
|
|
6700
6601
|
children: [
|
|
6701
|
-
/* @__PURE__ */
|
|
6602
|
+
/* @__PURE__ */ jsx26(
|
|
6702
6603
|
"path",
|
|
6703
6604
|
{
|
|
6704
6605
|
fillRule: "evenodd",
|
|
@@ -6707,7 +6608,7 @@ function LogoWithTextHorizonIcon(props) {
|
|
|
6707
6608
|
fill: "currentColor"
|
|
6708
6609
|
}
|
|
6709
6610
|
),
|
|
6710
|
-
/* @__PURE__ */
|
|
6611
|
+
/* @__PURE__ */ jsx26(
|
|
6711
6612
|
"rect",
|
|
6712
6613
|
{
|
|
6713
6614
|
x: "6.25",
|
|
@@ -6719,8 +6620,8 @@ function LogoWithTextHorizonIcon(props) {
|
|
|
6719
6620
|
strokeWidth: "0.5"
|
|
6720
6621
|
}
|
|
6721
6622
|
),
|
|
6722
|
-
/* @__PURE__ */
|
|
6723
|
-
/* @__PURE__ */
|
|
6623
|
+
/* @__PURE__ */ jsx26("rect", { x: "3", y: "6.5", width: "2", height: "1", rx: "0.5", fill: "currentColor" }),
|
|
6624
|
+
/* @__PURE__ */ jsx26(
|
|
6724
6625
|
"path",
|
|
6725
6626
|
{
|
|
6726
6627
|
fillRule: "evenodd",
|
|
@@ -6729,7 +6630,7 @@ function LogoWithTextHorizonIcon(props) {
|
|
|
6729
6630
|
fill: "currentColor"
|
|
6730
6631
|
}
|
|
6731
6632
|
),
|
|
6732
|
-
/* @__PURE__ */
|
|
6633
|
+
/* @__PURE__ */ jsx26(
|
|
6733
6634
|
"path",
|
|
6734
6635
|
{
|
|
6735
6636
|
fillRule: "evenodd",
|
|
@@ -6744,9 +6645,9 @@ function LogoWithTextHorizonIcon(props) {
|
|
|
6744
6645
|
}
|
|
6745
6646
|
|
|
6746
6647
|
// src/editor/components/icons/logo-with-text-vertical.tsx
|
|
6747
|
-
import { jsx as
|
|
6648
|
+
import { jsx as jsx27, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
6748
6649
|
function LogoWithTextVerticalIcon(props) {
|
|
6749
|
-
return /* @__PURE__ */
|
|
6650
|
+
return /* @__PURE__ */ jsxs13(
|
|
6750
6651
|
"svg",
|
|
6751
6652
|
__spreadProps(__spreadValues({
|
|
6752
6653
|
width: "14",
|
|
@@ -6756,7 +6657,7 @@ function LogoWithTextVerticalIcon(props) {
|
|
|
6756
6657
|
xmlns: "http://www.w3.org/2000/svg"
|
|
6757
6658
|
}, props), {
|
|
6758
6659
|
children: [
|
|
6759
|
-
/* @__PURE__ */
|
|
6660
|
+
/* @__PURE__ */ jsx27(
|
|
6760
6661
|
"path",
|
|
6761
6662
|
{
|
|
6762
6663
|
fillRule: "evenodd",
|
|
@@ -6765,7 +6666,7 @@ function LogoWithTextVerticalIcon(props) {
|
|
|
6765
6666
|
fill: "currentColor"
|
|
6766
6667
|
}
|
|
6767
6668
|
),
|
|
6768
|
-
/* @__PURE__ */
|
|
6669
|
+
/* @__PURE__ */ jsx27(
|
|
6769
6670
|
"rect",
|
|
6770
6671
|
{
|
|
6771
6672
|
x: "4.25",
|
|
@@ -6777,8 +6678,8 @@ function LogoWithTextVerticalIcon(props) {
|
|
|
6777
6678
|
strokeWidth: "0.5"
|
|
6778
6679
|
}
|
|
6779
6680
|
),
|
|
6780
|
-
/* @__PURE__ */
|
|
6781
|
-
/* @__PURE__ */
|
|
6681
|
+
/* @__PURE__ */ jsx27("rect", { x: "6", y: "6", width: "2", height: "1", rx: "0.5", fill: "currentColor" }),
|
|
6682
|
+
/* @__PURE__ */ jsx27(
|
|
6782
6683
|
"path",
|
|
6783
6684
|
{
|
|
6784
6685
|
fillRule: "evenodd",
|
|
@@ -6787,7 +6688,7 @@ function LogoWithTextVerticalIcon(props) {
|
|
|
6787
6688
|
fill: "currentColor"
|
|
6788
6689
|
}
|
|
6789
6690
|
),
|
|
6790
|
-
/* @__PURE__ */
|
|
6691
|
+
/* @__PURE__ */ jsx27(
|
|
6791
6692
|
"path",
|
|
6792
6693
|
{
|
|
6793
6694
|
fillRule: "evenodd",
|
|
@@ -6802,12 +6703,12 @@ function LogoWithTextVerticalIcon(props) {
|
|
|
6802
6703
|
}
|
|
6803
6704
|
|
|
6804
6705
|
// src/blocks/headers.tsx
|
|
6805
|
-
import { jsx as
|
|
6706
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
6806
6707
|
var headerLogoWithTextHorizontal = {
|
|
6807
6708
|
title: "Logo with Text (Horizontal)",
|
|
6808
6709
|
description: "Logo and a text horizontally",
|
|
6809
6710
|
searchTerms: ["logo", "text"],
|
|
6810
|
-
icon: /* @__PURE__ */
|
|
6711
|
+
icon: /* @__PURE__ */ jsx28(LogoWithTextHorizonIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6811
6712
|
command: ({ editor, range }) => {
|
|
6812
6713
|
editor.chain().deleteRange(range).insertContent({
|
|
6813
6714
|
type: "columns",
|
|
@@ -6871,7 +6772,7 @@ var headerLogoWithTextVertical = {
|
|
|
6871
6772
|
title: "Logo with Text (Vertical)",
|
|
6872
6773
|
description: "Logo and a text vertically",
|
|
6873
6774
|
searchTerms: ["logo", "text"],
|
|
6874
|
-
icon: /* @__PURE__ */
|
|
6775
|
+
icon: /* @__PURE__ */ jsx28(LogoWithTextVerticalIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6875
6776
|
command: ({ editor, range }) => {
|
|
6876
6777
|
editor.chain().deleteRange(range).insertContent([
|
|
6877
6778
|
{
|
|
@@ -6902,7 +6803,7 @@ var headerLogoWithCoverImage = {
|
|
|
6902
6803
|
title: "Logo with Cover Image",
|
|
6903
6804
|
description: "Logo and a cover image",
|
|
6904
6805
|
searchTerms: ["logo", "cover", "image"],
|
|
6905
|
-
icon: /* @__PURE__ */
|
|
6806
|
+
icon: /* @__PURE__ */ jsx28(LogoWithCoverImageIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6906
6807
|
command: ({ editor, range }) => {
|
|
6907
6808
|
const todayFormatted = (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", {
|
|
6908
6809
|
year: "numeric",
|
|
@@ -6995,12 +6896,12 @@ import {
|
|
|
6995
6896
|
LayoutTemplateIcon,
|
|
6996
6897
|
RectangleHorizontalIcon
|
|
6997
6898
|
} from "lucide-react";
|
|
6998
|
-
import { jsx as
|
|
6899
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
6999
6900
|
var footerCopyrightText = {
|
|
7000
6901
|
title: "Footer Copyright",
|
|
7001
6902
|
description: "Copyright text for the footer.",
|
|
7002
6903
|
searchTerms: ["footer", "copyright"],
|
|
7003
|
-
icon: /* @__PURE__ */
|
|
6904
|
+
icon: /* @__PURE__ */ jsx29(CopyrightIcon, { className: "mly:h-4 mly:w-4" }),
|
|
7004
6905
|
command: ({ editor, range }) => {
|
|
7005
6906
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
7006
6907
|
editor.chain().focus().deleteRange(range).insertContent({
|
|
@@ -7020,7 +6921,7 @@ var footerCommunityFeedbackCta = {
|
|
|
7020
6921
|
title: "Footer Community Feedback CTA",
|
|
7021
6922
|
description: "Community feedback CTA for the footer.",
|
|
7022
6923
|
searchTerms: ["footer", "community", "feedback", "cta"],
|
|
7023
|
-
icon: /* @__PURE__ */
|
|
6924
|
+
icon: /* @__PURE__ */ jsx29(RectangleHorizontalIcon, { className: "mly:h-4 mly:w-4" }),
|
|
7024
6925
|
command: ({ editor, range }) => {
|
|
7025
6926
|
editor.chain().focus().deleteRange(range).insertContent([
|
|
7026
6927
|
{
|
|
@@ -7063,7 +6964,7 @@ var footerCompanySignature = {
|
|
|
7063
6964
|
title: "Footer Company Signature",
|
|
7064
6965
|
description: "Company signature for the footer.",
|
|
7065
6966
|
searchTerms: ["footer", "company", "signature"],
|
|
7066
|
-
icon: /* @__PURE__ */
|
|
6967
|
+
icon: /* @__PURE__ */ jsx29(LayoutTemplateIcon, { className: "mly:h-4 mly:w-4" }),
|
|
7067
6968
|
command: ({ editor, range }) => {
|
|
7068
6969
|
editor.chain().focus().deleteRange(range).insertContent([
|
|
7069
6970
|
{ type: "horizontalRule" },
|
|
@@ -7217,7 +7118,7 @@ var footerCompanySignature = {
|
|
|
7217
7118
|
};
|
|
7218
7119
|
|
|
7219
7120
|
// src/editor/extensions/slash-command/default-slash-commands.tsx
|
|
7220
|
-
import { jsx as
|
|
7121
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
7221
7122
|
var DEFAULT_SLASH_COMMANDS = [
|
|
7222
7123
|
{
|
|
7223
7124
|
title: "Blocks",
|
|
@@ -7252,7 +7153,7 @@ var DEFAULT_SLASH_COMMANDS = [
|
|
|
7252
7153
|
title: "Headers",
|
|
7253
7154
|
description: "Add pre-designed headers block",
|
|
7254
7155
|
searchTerms: ["header", "headers"],
|
|
7255
|
-
icon: /* @__PURE__ */
|
|
7156
|
+
icon: /* @__PURE__ */ jsx30(Heading12, { className: "mly:h-4 mly:w-4" }),
|
|
7256
7157
|
preview: "https://cdn.usemaily.com/previews/header-preview-xyz.png",
|
|
7257
7158
|
commands: [
|
|
7258
7159
|
headerLogoWithTextVertical,
|
|
@@ -7265,7 +7166,7 @@ var DEFAULT_SLASH_COMMANDS = [
|
|
|
7265
7166
|
title: "Footers",
|
|
7266
7167
|
description: "Add pre-designed footers block",
|
|
7267
7168
|
searchTerms: ["footers"],
|
|
7268
|
-
icon: /* @__PURE__ */
|
|
7169
|
+
icon: /* @__PURE__ */ jsx30(FootprintsIcon2, { className: "mly:h-4 mly:w-4" }),
|
|
7269
7170
|
commands: [
|
|
7270
7171
|
footerCopyrightText,
|
|
7271
7172
|
footerCommunityFeedbackCta,
|
|
@@ -7278,7 +7179,7 @@ var DEFAULT_SLASH_COMMANDS = [
|
|
|
7278
7179
|
];
|
|
7279
7180
|
|
|
7280
7181
|
// src/editor/provider.tsx
|
|
7281
|
-
import { jsx as
|
|
7182
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
7282
7183
|
var DEFAULT_PLACEHOLDER_URL = "https://maily.to/";
|
|
7283
7184
|
var MailyContext = createContext({
|
|
7284
7185
|
placeholderUrl: DEFAULT_PLACEHOLDER_URL,
|
|
@@ -7286,7 +7187,7 @@ var MailyContext = createContext({
|
|
|
7286
7187
|
});
|
|
7287
7188
|
function MailyProvider(props) {
|
|
7288
7189
|
const _a = props, { children } = _a, defaultValues = __objRest(_a, ["children"]);
|
|
7289
|
-
return /* @__PURE__ */
|
|
7190
|
+
return /* @__PURE__ */ jsx31(MailyContext.Provider, { value: defaultValues, children });
|
|
7290
7191
|
}
|
|
7291
7192
|
function useMailyContext() {
|
|
7292
7193
|
const values = useContext(MailyContext);
|
|
@@ -7319,7 +7220,7 @@ import {
|
|
|
7319
7220
|
useRef as useRef6,
|
|
7320
7221
|
useState as useState6
|
|
7321
7222
|
} from "react";
|
|
7322
|
-
import { jsx as
|
|
7223
|
+
import { jsx as jsx32, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
7323
7224
|
var VariableSuggestionsPopover = forwardRef5((props, ref) => {
|
|
7324
7225
|
const { items, onSelectItem } = props;
|
|
7325
7226
|
const [selectedIndex, setSelectedIndex] = useState6(0);
|
|
@@ -7365,17 +7266,17 @@ var VariableSuggestionsPopover = forwardRef5((props, ref) => {
|
|
|
7365
7266
|
onSelectItem(item);
|
|
7366
7267
|
}
|
|
7367
7268
|
}));
|
|
7368
|
-
return /* @__PURE__ */
|
|
7369
|
-
/* @__PURE__ */
|
|
7370
|
-
/* @__PURE__ */
|
|
7371
|
-
/* @__PURE__ */
|
|
7269
|
+
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: [
|
|
7270
|
+
/* @__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: [
|
|
7271
|
+
/* @__PURE__ */ jsx32("span", { className: "mly:text-xs mly:uppercase", children: "Variables" }),
|
|
7272
|
+
/* @__PURE__ */ jsx32(VariableIcon, { children: /* @__PURE__ */ jsx32(Braces, { className: "mly:size-3 mly:stroke-[2.5]" }) })
|
|
7372
7273
|
] }),
|
|
7373
|
-
/* @__PURE__ */
|
|
7274
|
+
/* @__PURE__ */ jsx32(
|
|
7374
7275
|
"div",
|
|
7375
7276
|
{
|
|
7376
7277
|
ref: scrollContainerRef,
|
|
7377
7278
|
className: "mly:max-h-52 mly:overflow-y-auto mly:scrollbar-thin mly:scrollbar-track-transparent mly:scrollbar-thumb-gray-200",
|
|
7378
|
-
children: /* @__PURE__ */
|
|
7279
|
+
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(
|
|
7379
7280
|
"button",
|
|
7380
7281
|
{
|
|
7381
7282
|
ref: (el) => itemRefs.current[index] = el,
|
|
@@ -7385,27 +7286,27 @@ var VariableSuggestionsPopover = forwardRef5((props, ref) => {
|
|
|
7385
7286
|
index === selectedIndex ? "mly:bg-soft-gray" : "mly:bg-white"
|
|
7386
7287
|
),
|
|
7387
7288
|
children: [
|
|
7388
|
-
/* @__PURE__ */
|
|
7289
|
+
/* @__PURE__ */ jsx32(Braces, { className: "mly:size-3 mly:stroke-[2.5] mly:text-rose-600" }),
|
|
7389
7290
|
(item == null ? void 0 : item.label) || item.name
|
|
7390
7291
|
]
|
|
7391
7292
|
},
|
|
7392
7293
|
index
|
|
7393
|
-
)) : /* @__PURE__ */
|
|
7294
|
+
)) : /* @__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" }) })
|
|
7394
7295
|
}
|
|
7395
7296
|
),
|
|
7396
|
-
/* @__PURE__ */
|
|
7397
|
-
/* @__PURE__ */
|
|
7398
|
-
/* @__PURE__ */
|
|
7399
|
-
/* @__PURE__ */
|
|
7400
|
-
/* @__PURE__ */
|
|
7297
|
+
/* @__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: [
|
|
7298
|
+
/* @__PURE__ */ jsxs14("div", { className: "mly:flex mly:items-center mly:gap-1", children: [
|
|
7299
|
+
/* @__PURE__ */ jsx32(VariableIcon, { children: /* @__PURE__ */ jsx32(ArrowDownIcon, { className: "mly:size-3 mly:stroke-[2.5]" }) }),
|
|
7300
|
+
/* @__PURE__ */ jsx32(VariableIcon, { children: /* @__PURE__ */ jsx32(ArrowUpIcon, { className: "mly:size-3 mly:stroke-[2.5]" }) }),
|
|
7301
|
+
/* @__PURE__ */ jsx32("span", { className: "mly:text-xs mly:text-gray-500", children: "Navigate" })
|
|
7401
7302
|
] }),
|
|
7402
|
-
/* @__PURE__ */
|
|
7303
|
+
/* @__PURE__ */ jsx32(VariableIcon, { children: /* @__PURE__ */ jsx32(CornerDownLeftIcon, { className: "mly:size-3 mly:stroke-[2.5]" }) })
|
|
7403
7304
|
] })
|
|
7404
7305
|
] });
|
|
7405
7306
|
});
|
|
7406
7307
|
function VariableIcon(props) {
|
|
7407
7308
|
const { className, children } = props;
|
|
7408
|
-
return /* @__PURE__ */
|
|
7309
|
+
return /* @__PURE__ */ jsx32(
|
|
7409
7310
|
"div",
|
|
7410
7311
|
{
|
|
7411
7312
|
className: cn(
|
|
@@ -7421,7 +7322,7 @@ function VariableIcon(props) {
|
|
|
7421
7322
|
import { NodeViewWrapper as NodeViewWrapper3 } from "@tiptap/react";
|
|
7422
7323
|
import { AlertTriangle, Braces as Braces2, Pencil } from "lucide-react";
|
|
7423
7324
|
import { useMemo as useMemo5 } from "react";
|
|
7424
|
-
import { Fragment as Fragment4, jsx as
|
|
7325
|
+
import { Fragment as Fragment4, jsx as jsx33, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
7425
7326
|
function VariableView(props) {
|
|
7426
7327
|
const { node, updateAttributes: updateAttributes2, editor } = props;
|
|
7427
7328
|
const {
|
|
@@ -7436,19 +7337,19 @@ function VariableView(props) {
|
|
|
7436
7337
|
const variableRender = (_b = (_a = getNodeOptions(editor, "variable")) == null ? void 0 : _a.renderVariable) != null ? _b : DEFAULT_RENDER_VARIABLE_FUNCTION;
|
|
7437
7338
|
return variableRender;
|
|
7438
7339
|
}, [editor]);
|
|
7439
|
-
return /* @__PURE__ */
|
|
7340
|
+
return /* @__PURE__ */ jsx33(
|
|
7440
7341
|
NodeViewWrapper3,
|
|
7441
7342
|
{
|
|
7442
7343
|
className: "react-component mly:inline-block mly:leading-none",
|
|
7443
7344
|
draggable: "false",
|
|
7444
|
-
children: /* @__PURE__ */
|
|
7345
|
+
children: /* @__PURE__ */ jsxs15(
|
|
7445
7346
|
Popover,
|
|
7446
7347
|
{
|
|
7447
7348
|
onOpenChange: (open) => {
|
|
7448
7349
|
editor.storage.variable.popover = open;
|
|
7449
7350
|
},
|
|
7450
7351
|
children: [
|
|
7451
|
-
/* @__PURE__ */
|
|
7352
|
+
/* @__PURE__ */ jsx33(PopoverTrigger, { children: renderVariable({
|
|
7452
7353
|
variable: {
|
|
7453
7354
|
name: id,
|
|
7454
7355
|
required,
|
|
@@ -7459,7 +7360,7 @@ function VariableView(props) {
|
|
|
7459
7360
|
editor,
|
|
7460
7361
|
from: "content-variable"
|
|
7461
7362
|
}) }),
|
|
7462
|
-
/* @__PURE__ */
|
|
7363
|
+
/* @__PURE__ */ jsx33(
|
|
7463
7364
|
PopoverContent,
|
|
7464
7365
|
{
|
|
7465
7366
|
align: "start",
|
|
@@ -7468,10 +7369,10 @@ function VariableView(props) {
|
|
|
7468
7369
|
sideOffset: 8,
|
|
7469
7370
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
7470
7371
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
7471
|
-
children: /* @__PURE__ */
|
|
7472
|
-
/* @__PURE__ */
|
|
7473
|
-
/* @__PURE__ */
|
|
7474
|
-
/* @__PURE__ */
|
|
7372
|
+
children: /* @__PURE__ */ jsx33(TooltipProvider, { children: /* @__PURE__ */ jsxs15("div", { className: "mly:flex mly:items-stretch mly:text-midnight-gray", children: [
|
|
7373
|
+
/* @__PURE__ */ jsxs15("label", { className: "mly:relative", children: [
|
|
7374
|
+
/* @__PURE__ */ jsx33("span", { className: "mly:inline-block mly:px-2 mly:text-xs mly:text-midnight-gray", children: "Variable" }),
|
|
7375
|
+
/* @__PURE__ */ jsx33(
|
|
7475
7376
|
"input",
|
|
7476
7377
|
__spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
|
|
7477
7378
|
value: id != null ? id : "",
|
|
@@ -7485,11 +7386,11 @@ function VariableView(props) {
|
|
|
7485
7386
|
})
|
|
7486
7387
|
)
|
|
7487
7388
|
] }),
|
|
7488
|
-
!hideDefaultValue && /* @__PURE__ */
|
|
7489
|
-
/* @__PURE__ */
|
|
7490
|
-
/* @__PURE__ */
|
|
7491
|
-
/* @__PURE__ */
|
|
7492
|
-
/* @__PURE__ */
|
|
7389
|
+
!hideDefaultValue && /* @__PURE__ */ jsxs15(Fragment4, { children: [
|
|
7390
|
+
/* @__PURE__ */ jsx33(Divider, { className: "mly:mx-1.5" }),
|
|
7391
|
+
/* @__PURE__ */ jsxs15("label", { className: "mly:relative", children: [
|
|
7392
|
+
/* @__PURE__ */ jsx33("span", { className: "mly:inline-block mly:px-2 mly:pl-1 mly:text-xs mly:text-midnight-gray", children: "Default" }),
|
|
7393
|
+
/* @__PURE__ */ jsx33(
|
|
7493
7394
|
"input",
|
|
7494
7395
|
__spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
|
|
7495
7396
|
value: fallback != null ? fallback : "",
|
|
@@ -7502,7 +7403,7 @@ function VariableView(props) {
|
|
|
7502
7403
|
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"
|
|
7503
7404
|
})
|
|
7504
7405
|
),
|
|
7505
|
-
/* @__PURE__ */
|
|
7406
|
+
/* @__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" }) })
|
|
7506
7407
|
] })
|
|
7507
7408
|
] })
|
|
7508
7409
|
] }) })
|
|
@@ -7519,13 +7420,13 @@ var DefaultRenderVariable = (props) => {
|
|
|
7519
7420
|
const { name, required, valid, label } = variable;
|
|
7520
7421
|
const variableLabel = label || name;
|
|
7521
7422
|
if (from === "button-variable") {
|
|
7522
|
-
return /* @__PURE__ */
|
|
7523
|
-
/* @__PURE__ */
|
|
7524
|
-
/* @__PURE__ */
|
|
7423
|
+
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: [
|
|
7424
|
+
/* @__PURE__ */ jsx33(Braces2, { className: "mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5]" }),
|
|
7425
|
+
/* @__PURE__ */ jsx33("span", { className: "mly:min-w-0 mly:truncate mly:text-left", children: variableLabel })
|
|
7525
7426
|
] });
|
|
7526
7427
|
}
|
|
7527
7428
|
if (from === "bubble-variable") {
|
|
7528
|
-
return /* @__PURE__ */
|
|
7429
|
+
return /* @__PURE__ */ jsxs15(
|
|
7529
7430
|
"div",
|
|
7530
7431
|
{
|
|
7531
7432
|
className: cn(
|
|
@@ -7533,21 +7434,21 @@ var DefaultRenderVariable = (props) => {
|
|
|
7533
7434
|
!valid && "mly:border-rose-400 mly:bg-rose-50 mly:text-rose-600 mly:hover:bg-rose-100"
|
|
7534
7435
|
),
|
|
7535
7436
|
children: [
|
|
7536
|
-
/* @__PURE__ */
|
|
7537
|
-
/* @__PURE__ */
|
|
7437
|
+
/* @__PURE__ */ jsx33(Braces2, { className: "mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5] mly:text-rose-600" }),
|
|
7438
|
+
/* @__PURE__ */ jsx33("span", { className: "mly:min-w-0 mly:truncate mly:text-left", children: variableLabel })
|
|
7538
7439
|
]
|
|
7539
7440
|
}
|
|
7540
7441
|
);
|
|
7541
7442
|
}
|
|
7542
|
-
return /* @__PURE__ */
|
|
7443
|
+
return /* @__PURE__ */ jsxs15(
|
|
7543
7444
|
"span",
|
|
7544
7445
|
{
|
|
7545
7446
|
tabIndex: -1,
|
|
7546
7447
|
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",
|
|
7547
7448
|
children: [
|
|
7548
|
-
/* @__PURE__ */
|
|
7449
|
+
/* @__PURE__ */ jsx33(Braces2, { className: "mly:size-[var(--variable-icon-size)] mly:shrink-0 mly:stroke-[2.5] mly:text-rose-600" }),
|
|
7549
7450
|
variableLabel,
|
|
7550
|
-
required && !fallback && /* @__PURE__ */
|
|
7451
|
+
required && !fallback && /* @__PURE__ */ jsx33(AlertTriangle, { className: "mly:size-[var(--variable-icon-size)] mly:shrink-0 mly:stroke-[2.5]" })
|
|
7551
7452
|
]
|
|
7552
7453
|
}
|
|
7553
7454
|
);
|
|
@@ -7728,7 +7629,7 @@ var VariableExtension = Node4.create({
|
|
|
7728
7629
|
});
|
|
7729
7630
|
|
|
7730
7631
|
// src/editor/components/ui/link-input-popover.tsx
|
|
7731
|
-
import { jsx as
|
|
7632
|
+
import { jsx as jsx34, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
7732
7633
|
function LinkInputPopover(props) {
|
|
7733
7634
|
var _a, _b;
|
|
7734
7635
|
const {
|
|
@@ -7758,7 +7659,7 @@ function LinkInputPopover(props) {
|
|
|
7758
7659
|
editor
|
|
7759
7660
|
}).map((variable) => variable.name);
|
|
7760
7661
|
}, [variables, variableTriggerCharacter, defaultValue, editor]);
|
|
7761
|
-
const popoverButton = /* @__PURE__ */
|
|
7662
|
+
const popoverButton = /* @__PURE__ */ jsx34(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx34(
|
|
7762
7663
|
BaseButton,
|
|
7763
7664
|
{
|
|
7764
7665
|
variant: "ghost",
|
|
@@ -7766,10 +7667,10 @@ function LinkInputPopover(props) {
|
|
|
7766
7667
|
type: "button",
|
|
7767
7668
|
className: "mly:h-7! mly:w-7!",
|
|
7768
7669
|
"data-state": !!defaultValue,
|
|
7769
|
-
children: /* @__PURE__ */
|
|
7670
|
+
children: /* @__PURE__ */ jsx34(Icon, { className: "mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5] mly:text-midnight-gray" })
|
|
7770
7671
|
}
|
|
7771
7672
|
) });
|
|
7772
|
-
return /* @__PURE__ */
|
|
7673
|
+
return /* @__PURE__ */ jsxs16(
|
|
7773
7674
|
Popover,
|
|
7774
7675
|
{
|
|
7775
7676
|
open: isOpen,
|
|
@@ -7783,11 +7684,18 @@ function LinkInputPopover(props) {
|
|
|
7783
7684
|
}
|
|
7784
7685
|
},
|
|
7785
7686
|
children: [
|
|
7786
|
-
tooltip ? /* @__PURE__ */
|
|
7787
|
-
/* @__PURE__ */
|
|
7788
|
-
/* @__PURE__ */
|
|
7687
|
+
tooltip ? /* @__PURE__ */ jsxs16(Tooltip, { children: [
|
|
7688
|
+
/* @__PURE__ */ jsx34(TooltipTrigger, { asChild: true, children: popoverButton }),
|
|
7689
|
+
/* @__PURE__ */ jsx34(
|
|
7690
|
+
TooltipContent,
|
|
7691
|
+
{
|
|
7692
|
+
sideOffset: 8,
|
|
7693
|
+
className: "mly:border-gray-300 mly:bg-transparent mly:p-0 mly:text-gray-700 mly:shadow-sm",
|
|
7694
|
+
children: /* @__PURE__ */ jsx34("span", { className: "mly:block mly:rounded-md mly:bg-soft-gray mly:!px-2 mly:!py-1.5", children: tooltip })
|
|
7695
|
+
}
|
|
7696
|
+
)
|
|
7789
7697
|
] }) : popoverButton,
|
|
7790
|
-
/* @__PURE__ */
|
|
7698
|
+
/* @__PURE__ */ jsx34(
|
|
7791
7699
|
PopoverContent,
|
|
7792
7700
|
{
|
|
7793
7701
|
align: "end",
|
|
@@ -7795,7 +7703,7 @@ function LinkInputPopover(props) {
|
|
|
7795
7703
|
className: "mly:w-max mly:rounded-none mly:border-none mly:bg-transparent mly:p-0! mly:shadow-none",
|
|
7796
7704
|
sideOffset: 8,
|
|
7797
7705
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
7798
|
-
children: /* @__PURE__ */
|
|
7706
|
+
children: /* @__PURE__ */ jsx34(
|
|
7799
7707
|
"form",
|
|
7800
7708
|
{
|
|
7801
7709
|
onSubmit: (e) => {
|
|
@@ -7807,8 +7715,8 @@ function LinkInputPopover(props) {
|
|
|
7807
7715
|
onValueChange == null ? void 0 : onValueChange(input.value);
|
|
7808
7716
|
setIsOpen(false);
|
|
7809
7717
|
},
|
|
7810
|
-
children: /* @__PURE__ */
|
|
7811
|
-
!isEditing && /* @__PURE__ */
|
|
7718
|
+
children: /* @__PURE__ */ jsxs16("div", { className: "mly:isolate mly:flex mly:rounded-lg", children: [
|
|
7719
|
+
!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(
|
|
7812
7720
|
"button",
|
|
7813
7721
|
{
|
|
7814
7722
|
onClick: () => {
|
|
@@ -7829,9 +7737,9 @@ function LinkInputPopover(props) {
|
|
|
7829
7737
|
})
|
|
7830
7738
|
}
|
|
7831
7739
|
) }),
|
|
7832
|
-
isEditing && /* @__PURE__ */
|
|
7833
|
-
/* @__PURE__ */
|
|
7834
|
-
/* @__PURE__ */
|
|
7740
|
+
isEditing && /* @__PURE__ */ jsxs16("div", { className: "mly:relative", children: [
|
|
7741
|
+
/* @__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" }) }),
|
|
7742
|
+
/* @__PURE__ */ jsx34(
|
|
7835
7743
|
InputAutocomplete,
|
|
7836
7744
|
{
|
|
7837
7745
|
editor,
|
|
@@ -7867,12 +7775,12 @@ function LinkInputPopover(props) {
|
|
|
7867
7775
|
}
|
|
7868
7776
|
|
|
7869
7777
|
// src/editor/components/image-menu/image-size.tsx
|
|
7870
|
-
import { jsx as
|
|
7778
|
+
import { jsx as jsx35, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
7871
7779
|
function ImageSize(props) {
|
|
7872
7780
|
const { value, onValueChange, dimension } = props;
|
|
7873
|
-
return /* @__PURE__ */
|
|
7874
|
-
/* @__PURE__ */
|
|
7875
|
-
/* @__PURE__ */
|
|
7781
|
+
return /* @__PURE__ */ jsxs17("label", { className: "mly:relative mly:flex mly:items-center", children: [
|
|
7782
|
+
/* @__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" }),
|
|
7783
|
+
/* @__PURE__ */ jsx35(
|
|
7876
7784
|
"input",
|
|
7877
7785
|
__spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
|
|
7878
7786
|
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",
|
|
@@ -7881,15 +7789,15 @@ function ImageSize(props) {
|
|
|
7881
7789
|
onChange: (e) => onValueChange(e.target.value)
|
|
7882
7790
|
})
|
|
7883
7791
|
),
|
|
7884
|
-
/* @__PURE__ */
|
|
7792
|
+
/* @__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" })
|
|
7885
7793
|
] });
|
|
7886
7794
|
}
|
|
7887
7795
|
|
|
7888
7796
|
// src/editor/components/image-menu/use-image-state.tsx
|
|
7889
|
-
import { useEditorState as
|
|
7890
|
-
import
|
|
7797
|
+
import { useEditorState as useEditorState2 } from "@tiptap/react";
|
|
7798
|
+
import deepEql2 from "fast-deep-equal";
|
|
7891
7799
|
var useImageState = (editor) => {
|
|
7892
|
-
const states =
|
|
7800
|
+
const states = useEditorState2({
|
|
7893
7801
|
editor,
|
|
7894
7802
|
selector: ({ editor: editor2 }) => {
|
|
7895
7803
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
@@ -7910,13 +7818,13 @@ var useImageState = (editor) => {
|
|
|
7910
7818
|
currentShowIfKey: ((_o = editor2.getAttributes("image")) == null ? void 0 : _o.showIfKey) || ((_p = editor2.getAttributes("logo")) == null ? void 0 : _p.showIfKey) || ""
|
|
7911
7819
|
};
|
|
7912
7820
|
},
|
|
7913
|
-
equalityFn:
|
|
7821
|
+
equalityFn: deepEql2
|
|
7914
7822
|
});
|
|
7915
7823
|
return states;
|
|
7916
7824
|
};
|
|
7917
7825
|
|
|
7918
7826
|
// src/editor/components/image-menu/image-bubble-menu.tsx
|
|
7919
|
-
import { Fragment as Fragment5, jsx as
|
|
7827
|
+
import { Fragment as Fragment5, jsx as jsx36, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
7920
7828
|
function ImageBubbleMenu(props) {
|
|
7921
7829
|
var _a, _b, _c, _d;
|
|
7922
7830
|
const { editor, appendTo } = props;
|
|
@@ -7935,19 +7843,19 @@ function ImageBubbleMenu(props) {
|
|
|
7935
7843
|
popperOptions: {
|
|
7936
7844
|
modifiers: [{ name: "flip", enabled: false }]
|
|
7937
7845
|
},
|
|
7938
|
-
plugins: [
|
|
7846
|
+
plugins: [sticky2],
|
|
7939
7847
|
sticky: "popper",
|
|
7940
7848
|
maxWidth: "100%"
|
|
7941
7849
|
}
|
|
7942
7850
|
});
|
|
7943
7851
|
const { lockAspectRatio } = state;
|
|
7944
|
-
return /* @__PURE__ */
|
|
7945
|
-
|
|
7852
|
+
return /* @__PURE__ */ jsx36(
|
|
7853
|
+
BubbleMenu2,
|
|
7946
7854
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
7947
7855
|
className: "mly:flex mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:p-0.5 mly:shadow-md",
|
|
7948
|
-
children: /* @__PURE__ */
|
|
7949
|
-
state.isLogoActive && state.imageSrc && /* @__PURE__ */
|
|
7950
|
-
/* @__PURE__ */
|
|
7856
|
+
children: /* @__PURE__ */ jsxs18(TooltipProvider, { children: [
|
|
7857
|
+
state.isLogoActive && state.imageSrc && /* @__PURE__ */ jsxs18(Fragment5, { children: [
|
|
7858
|
+
/* @__PURE__ */ jsx36(
|
|
7951
7859
|
Select,
|
|
7952
7860
|
{
|
|
7953
7861
|
label: "Size",
|
|
@@ -7962,10 +7870,10 @@ function ImageBubbleMenu(props) {
|
|
|
7962
7870
|
}
|
|
7963
7871
|
}
|
|
7964
7872
|
),
|
|
7965
|
-
/* @__PURE__ */
|
|
7873
|
+
/* @__PURE__ */ jsx36(Divider, {})
|
|
7966
7874
|
] }),
|
|
7967
|
-
/* @__PURE__ */
|
|
7968
|
-
/* @__PURE__ */
|
|
7875
|
+
/* @__PURE__ */ jsxs18("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
7876
|
+
/* @__PURE__ */ jsx36(
|
|
7969
7877
|
AlignmentSwitch,
|
|
7970
7878
|
{
|
|
7971
7879
|
alignment: state.alignment,
|
|
@@ -7979,7 +7887,7 @@ function ImageBubbleMenu(props) {
|
|
|
7979
7887
|
}
|
|
7980
7888
|
}
|
|
7981
7889
|
),
|
|
7982
|
-
/* @__PURE__ */
|
|
7890
|
+
/* @__PURE__ */ jsx36(
|
|
7983
7891
|
LinkInputPopover,
|
|
7984
7892
|
{
|
|
7985
7893
|
defaultValue: (_a = state == null ? void 0 : state.imageSrc) != null ? _a : "",
|
|
@@ -8002,7 +7910,7 @@ function ImageBubbleMenu(props) {
|
|
|
8002
7910
|
isVariable: state.isSrcVariable
|
|
8003
7911
|
}
|
|
8004
7912
|
),
|
|
8005
|
-
state.isImageActive && /* @__PURE__ */
|
|
7913
|
+
state.isImageActive && /* @__PURE__ */ jsx36(
|
|
8006
7914
|
LinkInputPopover,
|
|
8007
7915
|
{
|
|
8008
7916
|
defaultValue: (_b = state == null ? void 0 : state.imageExternalLink) != null ? _b : "",
|
|
@@ -8018,9 +7926,9 @@ function ImageBubbleMenu(props) {
|
|
|
8018
7926
|
}
|
|
8019
7927
|
)
|
|
8020
7928
|
] }),
|
|
8021
|
-
state.isImageActive && state.imageSrc && /* @__PURE__ */
|
|
8022
|
-
/* @__PURE__ */
|
|
8023
|
-
/* @__PURE__ */
|
|
7929
|
+
state.isImageActive && state.imageSrc && /* @__PURE__ */ jsxs18(Fragment5, { children: [
|
|
7930
|
+
/* @__PURE__ */ jsx36(Divider, {}),
|
|
7931
|
+
/* @__PURE__ */ jsx36(
|
|
8024
7932
|
Select,
|
|
8025
7933
|
{
|
|
8026
7934
|
label: "Border Radius",
|
|
@@ -8038,8 +7946,8 @@ function ImageBubbleMenu(props) {
|
|
|
8038
7946
|
className: "mly:capitalize"
|
|
8039
7947
|
}
|
|
8040
7948
|
),
|
|
8041
|
-
/* @__PURE__ */
|
|
8042
|
-
/* @__PURE__ */
|
|
7949
|
+
/* @__PURE__ */ jsxs18("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
7950
|
+
/* @__PURE__ */ jsx36(
|
|
8043
7951
|
ImageSize,
|
|
8044
7952
|
{
|
|
8045
7953
|
dimension: "width",
|
|
@@ -8059,7 +7967,7 @@ function ImageBubbleMenu(props) {
|
|
|
8059
7967
|
}
|
|
8060
7968
|
}
|
|
8061
7969
|
),
|
|
8062
|
-
/* @__PURE__ */
|
|
7970
|
+
/* @__PURE__ */ jsx36(
|
|
8063
7971
|
ImageSize,
|
|
8064
7972
|
{
|
|
8065
7973
|
dimension: "height",
|
|
@@ -8079,7 +7987,7 @@ function ImageBubbleMenu(props) {
|
|
|
8079
7987
|
}
|
|
8080
7988
|
}
|
|
8081
7989
|
),
|
|
8082
|
-
/* @__PURE__ */
|
|
7990
|
+
/* @__PURE__ */ jsx36(
|
|
8083
7991
|
BubbleMenuButton,
|
|
8084
7992
|
{
|
|
8085
7993
|
isActive: () => lockAspectRatio,
|
|
@@ -8104,8 +8012,8 @@ function ImageBubbleMenu(props) {
|
|
|
8104
8012
|
}
|
|
8105
8013
|
|
|
8106
8014
|
// src/editor/components/inline-image-menu/inline-image-bubble-menu.tsx
|
|
8107
|
-
import { BubbleMenu as
|
|
8108
|
-
import { sticky as
|
|
8015
|
+
import { BubbleMenu as BubbleMenu3 } from "@tiptap/react";
|
|
8016
|
+
import { sticky as sticky3 } from "tippy.js";
|
|
8109
8017
|
|
|
8110
8018
|
// src/editor/nodes/inline-image/inline-image.tsx
|
|
8111
8019
|
import { mergeAttributes as mergeAttributes4, Node as Node5 } from "@tiptap/core";
|
|
@@ -8222,10 +8130,10 @@ var InlineImageExtension = Node5.create({
|
|
|
8222
8130
|
});
|
|
8223
8131
|
|
|
8224
8132
|
// src/editor/components/inline-image-menu/use-inline-image-state.tsx
|
|
8225
|
-
import { useEditorState as
|
|
8226
|
-
import
|
|
8133
|
+
import { useEditorState as useEditorState3 } from "@tiptap/react";
|
|
8134
|
+
import deepEql3 from "fast-deep-equal";
|
|
8227
8135
|
var useInlineImageState = (editor) => {
|
|
8228
|
-
const states =
|
|
8136
|
+
const states = useEditorState3({
|
|
8229
8137
|
editor,
|
|
8230
8138
|
selector: ({ editor: editor2 }) => {
|
|
8231
8139
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -8238,14 +8146,14 @@ var useInlineImageState = (editor) => {
|
|
|
8238
8146
|
isExternalLinkVariable: (_h = (_g = editor2.getAttributes("inlineImage")) == null ? void 0 : _g.isExternalLinkVariable) != null ? _h : false
|
|
8239
8147
|
};
|
|
8240
8148
|
},
|
|
8241
|
-
equalityFn:
|
|
8149
|
+
equalityFn: deepEql3
|
|
8242
8150
|
});
|
|
8243
8151
|
return states;
|
|
8244
8152
|
};
|
|
8245
8153
|
|
|
8246
8154
|
// src/editor/components/inline-image-menu/inline-image-bubble-menu.tsx
|
|
8247
8155
|
import { ImageDownIcon } from "lucide-react";
|
|
8248
|
-
import { jsx as
|
|
8156
|
+
import { jsx as jsx37, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
8249
8157
|
function InlineImageBubbleMenu(props) {
|
|
8250
8158
|
var _a, _b;
|
|
8251
8159
|
const { editor, appendTo } = props;
|
|
@@ -8264,17 +8172,17 @@ function InlineImageBubbleMenu(props) {
|
|
|
8264
8172
|
popperOptions: {
|
|
8265
8173
|
modifiers: [{ name: "flip", enabled: false }]
|
|
8266
8174
|
},
|
|
8267
|
-
plugins: [
|
|
8175
|
+
plugins: [sticky3],
|
|
8268
8176
|
sticky: "popper",
|
|
8269
8177
|
maxWidth: "100%"
|
|
8270
8178
|
}
|
|
8271
8179
|
});
|
|
8272
|
-
return /* @__PURE__ */
|
|
8273
|
-
|
|
8180
|
+
return /* @__PURE__ */ jsx37(
|
|
8181
|
+
BubbleMenu3,
|
|
8274
8182
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
8275
8183
|
className: "mly:flex mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:p-0.5 mly:shadow-md",
|
|
8276
|
-
children: /* @__PURE__ */
|
|
8277
|
-
/* @__PURE__ */
|
|
8184
|
+
children: /* @__PURE__ */ jsx37(TooltipProvider, { children: /* @__PURE__ */ jsxs19("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
8185
|
+
/* @__PURE__ */ jsx37(
|
|
8278
8186
|
LinkInputPopover,
|
|
8279
8187
|
{
|
|
8280
8188
|
defaultValue: (_a = state == null ? void 0 : state.src) != null ? _a : "",
|
|
@@ -8290,7 +8198,7 @@ function InlineImageBubbleMenu(props) {
|
|
|
8290
8198
|
isVariable: state.isSrcVariable
|
|
8291
8199
|
}
|
|
8292
8200
|
),
|
|
8293
|
-
/* @__PURE__ */
|
|
8201
|
+
/* @__PURE__ */ jsx37(
|
|
8294
8202
|
LinkInputPopover,
|
|
8295
8203
|
{
|
|
8296
8204
|
defaultValue: (_b = state == null ? void 0 : state.imageExternalLink) != null ? _b : "",
|
|
@@ -8305,7 +8213,7 @@ function InlineImageBubbleMenu(props) {
|
|
|
8305
8213
|
isVariable: state.isExternalLinkVariable
|
|
8306
8214
|
}
|
|
8307
8215
|
),
|
|
8308
|
-
/* @__PURE__ */
|
|
8216
|
+
/* @__PURE__ */ jsx37(
|
|
8309
8217
|
ImageSize,
|
|
8310
8218
|
{
|
|
8311
8219
|
dimension: "height",
|
|
@@ -8324,16 +8232,16 @@ function InlineImageBubbleMenu(props) {
|
|
|
8324
8232
|
}
|
|
8325
8233
|
|
|
8326
8234
|
// src/editor/components/repeat-menu/repeat-bubble-menu.tsx
|
|
8327
|
-
import { BubbleMenu as
|
|
8235
|
+
import { BubbleMenu as BubbleMenu4, findChildren } from "@tiptap/react";
|
|
8328
8236
|
import { InfoIcon as InfoIcon2 } from "lucide-react";
|
|
8329
|
-
import { useCallback as
|
|
8330
|
-
import { sticky as
|
|
8237
|
+
import { useCallback as useCallback7, useMemo as useMemo7, useRef as useRef8, useState as useState8 } from "react";
|
|
8238
|
+
import { sticky as sticky4 } from "tippy.js";
|
|
8331
8239
|
|
|
8332
8240
|
// src/editor/components/repeat-menu/use-repeat-state.ts
|
|
8333
|
-
import { useEditorState as
|
|
8334
|
-
import
|
|
8241
|
+
import { useEditorState as useEditorState4 } from "@tiptap/react";
|
|
8242
|
+
import deepEql4 from "fast-deep-equal";
|
|
8335
8243
|
var useRepeatState = (editor) => {
|
|
8336
|
-
const states =
|
|
8244
|
+
const states = useEditorState4({
|
|
8337
8245
|
editor,
|
|
8338
8246
|
selector: (ctx) => {
|
|
8339
8247
|
var _a, _b;
|
|
@@ -8343,20 +8251,20 @@ var useRepeatState = (editor) => {
|
|
|
8343
8251
|
isSectionActive: ctx.editor.isActive("section")
|
|
8344
8252
|
};
|
|
8345
8253
|
},
|
|
8346
|
-
equalityFn:
|
|
8254
|
+
equalityFn: deepEql4
|
|
8347
8255
|
});
|
|
8348
8256
|
return states;
|
|
8349
8257
|
};
|
|
8350
8258
|
|
|
8351
8259
|
// src/editor/components/repeat-menu/repeat-bubble-menu.tsx
|
|
8352
|
-
import { jsx as
|
|
8260
|
+
import { jsx as jsx38, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
8353
8261
|
function RepeatBubbleMenu(props) {
|
|
8354
8262
|
const { appendTo, editor } = props;
|
|
8355
8263
|
if (!editor) {
|
|
8356
8264
|
return null;
|
|
8357
8265
|
}
|
|
8358
8266
|
const state = useRepeatState(editor);
|
|
8359
|
-
const getReferenceClientRect =
|
|
8267
|
+
const getReferenceClientRect = useCallback7(() => {
|
|
8360
8268
|
const renderContainer = getRenderContainer(editor, "repeat");
|
|
8361
8269
|
const rect = (renderContainer == null ? void 0 : renderContainer.getBoundingClientRect()) || new DOMRect(-1e3, -1e3, 0, 0);
|
|
8362
8270
|
return rect;
|
|
@@ -8381,7 +8289,7 @@ function RepeatBubbleMenu(props) {
|
|
|
8381
8289
|
},
|
|
8382
8290
|
getReferenceClientRect,
|
|
8383
8291
|
appendTo: () => appendTo == null ? void 0 : appendTo.current,
|
|
8384
|
-
plugins: [
|
|
8292
|
+
plugins: [sticky4],
|
|
8385
8293
|
sticky: "popper",
|
|
8386
8294
|
maxWidth: "auto"
|
|
8387
8295
|
},
|
|
@@ -8401,21 +8309,21 @@ function RepeatBubbleMenu(props) {
|
|
|
8401
8309
|
}).map((variable) => variable.name);
|
|
8402
8310
|
}, [variables, eachKey, editor]);
|
|
8403
8311
|
const isValidEachKey = eachKey;
|
|
8404
|
-
return /* @__PURE__ */
|
|
8405
|
-
|
|
8312
|
+
return /* @__PURE__ */ jsx38(
|
|
8313
|
+
BubbleMenu4,
|
|
8406
8314
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
8407
8315
|
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",
|
|
8408
|
-
children: /* @__PURE__ */
|
|
8409
|
-
/* @__PURE__ */
|
|
8316
|
+
children: /* @__PURE__ */ jsxs20(TooltipProvider, { children: [
|
|
8317
|
+
/* @__PURE__ */ jsxs20("div", { className: "mly:flex mly:items-center mly:gap-1.5 mly:px-1.5 mly:text-sm mly:leading-none", children: [
|
|
8410
8318
|
"Repeat",
|
|
8411
|
-
/* @__PURE__ */
|
|
8412
|
-
/* @__PURE__ */
|
|
8319
|
+
/* @__PURE__ */ jsxs20(Tooltip, { children: [
|
|
8320
|
+
/* @__PURE__ */ jsx38(TooltipTrigger, { children: /* @__PURE__ */ jsx38(
|
|
8413
8321
|
InfoIcon2,
|
|
8414
8322
|
{
|
|
8415
8323
|
className: cn("mly:size-3 mly:stroke-[2.5] mly:text-gray-500")
|
|
8416
8324
|
}
|
|
8417
8325
|
) }),
|
|
8418
|
-
/* @__PURE__ */
|
|
8326
|
+
/* @__PURE__ */ jsx38(
|
|
8419
8327
|
TooltipContent,
|
|
8420
8328
|
{
|
|
8421
8329
|
sideOffset: 14,
|
|
@@ -8426,7 +8334,7 @@ function RepeatBubbleMenu(props) {
|
|
|
8426
8334
|
)
|
|
8427
8335
|
] })
|
|
8428
8336
|
] }),
|
|
8429
|
-
!isUpdatingKey && /* @__PURE__ */
|
|
8337
|
+
!isUpdatingKey && /* @__PURE__ */ jsx38(
|
|
8430
8338
|
"button",
|
|
8431
8339
|
{
|
|
8432
8340
|
onClick: () => {
|
|
@@ -8447,7 +8355,7 @@ function RepeatBubbleMenu(props) {
|
|
|
8447
8355
|
})
|
|
8448
8356
|
}
|
|
8449
8357
|
),
|
|
8450
|
-
isUpdatingKey && /* @__PURE__ */
|
|
8358
|
+
isUpdatingKey && /* @__PURE__ */ jsx38(
|
|
8451
8359
|
"form",
|
|
8452
8360
|
{
|
|
8453
8361
|
onSubmit: (e) => {
|
|
@@ -8459,7 +8367,7 @@ function RepeatBubbleMenu(props) {
|
|
|
8459
8367
|
setIsUpdatingKey(false);
|
|
8460
8368
|
}
|
|
8461
8369
|
},
|
|
8462
|
-
children: /* @__PURE__ */
|
|
8370
|
+
children: /* @__PURE__ */ jsx38(
|
|
8463
8371
|
InputAutocomplete,
|
|
8464
8372
|
{
|
|
8465
8373
|
editor,
|
|
@@ -8485,8 +8393,8 @@ function RepeatBubbleMenu(props) {
|
|
|
8485
8393
|
)
|
|
8486
8394
|
}
|
|
8487
8395
|
),
|
|
8488
|
-
/* @__PURE__ */
|
|
8489
|
-
/* @__PURE__ */
|
|
8396
|
+
/* @__PURE__ */ jsx38(Divider, {}),
|
|
8397
|
+
/* @__PURE__ */ jsx38(
|
|
8490
8398
|
ShowPopover,
|
|
8491
8399
|
{
|
|
8492
8400
|
showIfKey: state.currentShowIfKey,
|
|
@@ -8504,16 +8412,16 @@ function RepeatBubbleMenu(props) {
|
|
|
8504
8412
|
}
|
|
8505
8413
|
|
|
8506
8414
|
// src/editor/components/section-menu/section-bubble-menu.tsx
|
|
8507
|
-
import { BubbleMenu as
|
|
8415
|
+
import { BubbleMenu as BubbleMenu5, findChildren as findChildren2 } from "@tiptap/react";
|
|
8508
8416
|
import { ChevronUp, Trash as Trash3 } from "lucide-react";
|
|
8509
|
-
import { useCallback as
|
|
8510
|
-
import { sticky as
|
|
8417
|
+
import { useCallback as useCallback8 } from "react";
|
|
8418
|
+
import { sticky as sticky5 } from "tippy.js";
|
|
8511
8419
|
|
|
8512
8420
|
// src/editor/components/icons/border-color.tsx
|
|
8513
|
-
import { jsx as
|
|
8421
|
+
import { jsx as jsx39, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
8514
8422
|
function BorderColor(props) {
|
|
8515
8423
|
const _a = props, { topBarClassName } = _a, rest = __objRest(_a, ["topBarClassName"]);
|
|
8516
|
-
return /* @__PURE__ */
|
|
8424
|
+
return /* @__PURE__ */ jsxs21(
|
|
8517
8425
|
"svg",
|
|
8518
8426
|
__spreadProps(__spreadValues({
|
|
8519
8427
|
width: 11,
|
|
@@ -8523,8 +8431,8 @@ function BorderColor(props) {
|
|
|
8523
8431
|
xmlns: "http://www.w3.org/2000/svg"
|
|
8524
8432
|
}, rest), {
|
|
8525
8433
|
children: [
|
|
8526
|
-
/* @__PURE__ */
|
|
8527
|
-
/* @__PURE__ */
|
|
8434
|
+
/* @__PURE__ */ jsx39("path", { d: "M0 11H10.6667", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
8435
|
+
/* @__PURE__ */ jsx39(
|
|
8528
8436
|
"path",
|
|
8529
8437
|
{
|
|
8530
8438
|
d: "M0.666504 9V6.33333C0.666504 3.38781 3.05432 1 5.99984 1H10.6665",
|
|
@@ -8538,9 +8446,9 @@ function BorderColor(props) {
|
|
|
8538
8446
|
}
|
|
8539
8447
|
|
|
8540
8448
|
// src/editor/components/icons/margin-icon.tsx
|
|
8541
|
-
import { jsx as
|
|
8449
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
8542
8450
|
function MarginIcon(props) {
|
|
8543
|
-
return /* @__PURE__ */
|
|
8451
|
+
return /* @__PURE__ */ jsx40(
|
|
8544
8452
|
"svg",
|
|
8545
8453
|
__spreadProps(__spreadValues({
|
|
8546
8454
|
width: 12,
|
|
@@ -8549,7 +8457,7 @@ function MarginIcon(props) {
|
|
|
8549
8457
|
fill: "none",
|
|
8550
8458
|
xmlns: "http://www.w3.org/2000/svg"
|
|
8551
8459
|
}, props), {
|
|
8552
|
-
children: /* @__PURE__ */
|
|
8460
|
+
children: /* @__PURE__ */ jsx40(
|
|
8553
8461
|
"path",
|
|
8554
8462
|
{
|
|
8555
8463
|
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",
|
|
@@ -8563,9 +8471,9 @@ function MarginIcon(props) {
|
|
|
8563
8471
|
}
|
|
8564
8472
|
|
|
8565
8473
|
// src/editor/components/icons/padding-icon.tsx
|
|
8566
|
-
import { jsx as
|
|
8474
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
8567
8475
|
function PaddingIcon(props) {
|
|
8568
|
-
return /* @__PURE__ */
|
|
8476
|
+
return /* @__PURE__ */ jsx41(
|
|
8569
8477
|
"svg",
|
|
8570
8478
|
__spreadProps(__spreadValues({
|
|
8571
8479
|
width: 10,
|
|
@@ -8574,7 +8482,7 @@ function PaddingIcon(props) {
|
|
|
8574
8482
|
fill: "none",
|
|
8575
8483
|
xmlns: "http://www.w3.org/2000/svg"
|
|
8576
8484
|
}, props), {
|
|
8577
|
-
children: /* @__PURE__ */
|
|
8485
|
+
children: /* @__PURE__ */ jsx41(
|
|
8578
8486
|
"path",
|
|
8579
8487
|
{
|
|
8580
8488
|
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",
|
|
@@ -8589,7 +8497,7 @@ function PaddingIcon(props) {
|
|
|
8589
8497
|
|
|
8590
8498
|
// src/editor/components/ui/color-picker.tsx
|
|
8591
8499
|
import { HexColorPicker, HexColorInput } from "react-colorful";
|
|
8592
|
-
import { jsx as
|
|
8500
|
+
import { jsx as jsx42, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
8593
8501
|
function ColorPicker(props) {
|
|
8594
8502
|
const {
|
|
8595
8503
|
color,
|
|
@@ -8607,14 +8515,14 @@ function ColorPicker(props) {
|
|
|
8607
8515
|
onColorChange(color2);
|
|
8608
8516
|
});
|
|
8609
8517
|
};
|
|
8610
|
-
const popoverButton = /* @__PURE__ */
|
|
8518
|
+
const popoverButton = /* @__PURE__ */ jsx42(PopoverTrigger, { asChild: true, children: children || /* @__PURE__ */ jsx42(
|
|
8611
8519
|
BaseButton,
|
|
8612
8520
|
{
|
|
8613
8521
|
variant: "ghost",
|
|
8614
8522
|
className: "mly:h-7 mly:w-7 mly:shrink-0",
|
|
8615
8523
|
size: "sm",
|
|
8616
8524
|
type: "button",
|
|
8617
|
-
children: /* @__PURE__ */
|
|
8525
|
+
children: /* @__PURE__ */ jsx42(
|
|
8618
8526
|
"div",
|
|
8619
8527
|
{
|
|
8620
8528
|
className: cn(
|
|
@@ -8628,7 +8536,7 @@ function ColorPicker(props) {
|
|
|
8628
8536
|
)
|
|
8629
8537
|
}
|
|
8630
8538
|
) });
|
|
8631
|
-
return /* @__PURE__ */
|
|
8539
|
+
return /* @__PURE__ */ jsxs22(
|
|
8632
8540
|
Popover,
|
|
8633
8541
|
{
|
|
8634
8542
|
onOpenChange: (open) => {
|
|
@@ -8637,17 +8545,24 @@ function ColorPicker(props) {
|
|
|
8637
8545
|
}
|
|
8638
8546
|
},
|
|
8639
8547
|
children: [
|
|
8640
|
-
tooltip ? /* @__PURE__ */
|
|
8641
|
-
/* @__PURE__ */
|
|
8642
|
-
/* @__PURE__ */
|
|
8548
|
+
tooltip ? /* @__PURE__ */ jsxs22(Tooltip, { children: [
|
|
8549
|
+
/* @__PURE__ */ jsx42(TooltipTrigger, { asChild: true, children: popoverButton }),
|
|
8550
|
+
/* @__PURE__ */ jsx42(
|
|
8551
|
+
TooltipContent,
|
|
8552
|
+
{
|
|
8553
|
+
sideOffset: 8,
|
|
8554
|
+
className: "mly:border-gray-300 mly:bg-transparent mly:p-0 mly:text-gray-700 mly:shadow-sm",
|
|
8555
|
+
children: /* @__PURE__ */ jsx42("span", { className: "mly:block mly:rounded-md mly:bg-soft-gray mly:!px-2 mly:!py-1.5", children: tooltip })
|
|
8556
|
+
}
|
|
8557
|
+
)
|
|
8643
8558
|
] }) : popoverButton,
|
|
8644
|
-
/* @__PURE__ */
|
|
8559
|
+
/* @__PURE__ */ jsx42(
|
|
8645
8560
|
PopoverContent,
|
|
8646
8561
|
{
|
|
8647
8562
|
className: "mly:w-full mly:rounded-none mly:border-0 mly:bg-transparent! mly:p-0! mly:shadow-none mly:drop-shadow-md",
|
|
8648
8563
|
sideOffset: 8,
|
|
8649
|
-
children: /* @__PURE__ */
|
|
8650
|
-
/* @__PURE__ */
|
|
8564
|
+
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: [
|
|
8565
|
+
/* @__PURE__ */ jsx42(
|
|
8651
8566
|
HexColorPicker,
|
|
8652
8567
|
{
|
|
8653
8568
|
color,
|
|
@@ -8655,7 +8570,7 @@ function ColorPicker(props) {
|
|
|
8655
8570
|
className: "mly:flex mly:w-full! mly:flex-col mly:gap-4"
|
|
8656
8571
|
}
|
|
8657
8572
|
),
|
|
8658
|
-
/* @__PURE__ */
|
|
8573
|
+
/* @__PURE__ */ jsx42(
|
|
8659
8574
|
HexColorInput,
|
|
8660
8575
|
{
|
|
8661
8576
|
alpha: true,
|
|
@@ -8665,10 +8580,10 @@ function ColorPicker(props) {
|
|
|
8665
8580
|
prefixed: true
|
|
8666
8581
|
}
|
|
8667
8582
|
),
|
|
8668
|
-
suggestedColors.length > 0 && /* @__PURE__ */
|
|
8669
|
-
/* @__PURE__ */
|
|
8670
|
-
/* @__PURE__ */
|
|
8671
|
-
/* @__PURE__ */
|
|
8583
|
+
suggestedColors.length > 0 && /* @__PURE__ */ jsxs22("div", { children: [
|
|
8584
|
+
/* @__PURE__ */ jsx42("div", { className: "-mly:mx-4 mly:my-4 mly:h-px mly:bg-gray-200" }),
|
|
8585
|
+
/* @__PURE__ */ jsx42("h2", { className: "mly:text-xs mly:text-gray-500", children: "Recently used" }),
|
|
8586
|
+
/* @__PURE__ */ jsx42("div", { className: "mly:mt-2 mly:flex mly:flex-wrap mly:gap-0.5", children: suggestedColors.map((suggestedColor) => /* @__PURE__ */ jsx42(
|
|
8672
8587
|
BaseButton,
|
|
8673
8588
|
{
|
|
8674
8589
|
variant: "ghost",
|
|
@@ -8676,7 +8591,7 @@ function ColorPicker(props) {
|
|
|
8676
8591
|
className: "!mly:size-7 mly:shrink-0",
|
|
8677
8592
|
type: "button",
|
|
8678
8593
|
onClick: () => handleColorChange(suggestedColor),
|
|
8679
|
-
children: /* @__PURE__ */
|
|
8594
|
+
children: /* @__PURE__ */ jsx42(
|
|
8680
8595
|
"div",
|
|
8681
8596
|
{
|
|
8682
8597
|
className: "mly:h-4 mly:w-4 mly:shrink-0 mly:rounded",
|
|
@@ -8698,10 +8613,10 @@ function ColorPicker(props) {
|
|
|
8698
8613
|
}
|
|
8699
8614
|
|
|
8700
8615
|
// src/editor/components/section-menu/use-section-state.tsx
|
|
8701
|
-
import { useEditorState as
|
|
8702
|
-
import
|
|
8616
|
+
import { useEditorState as useEditorState5 } from "@tiptap/react";
|
|
8617
|
+
import deepEql5 from "fast-deep-equal";
|
|
8703
8618
|
var useSectionState = (editor) => {
|
|
8704
|
-
const states =
|
|
8619
|
+
const states = useEditorState5({
|
|
8705
8620
|
editor,
|
|
8706
8621
|
selector: (ctx) => {
|
|
8707
8622
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
@@ -8723,19 +8638,19 @@ var useSectionState = (editor) => {
|
|
|
8723
8638
|
currentShowIfKey: ((_n = ctx.editor.getAttributes("section")) == null ? void 0 : _n.showIfKey) || ""
|
|
8724
8639
|
};
|
|
8725
8640
|
},
|
|
8726
|
-
equalityFn:
|
|
8641
|
+
equalityFn: deepEql5
|
|
8727
8642
|
});
|
|
8728
8643
|
return states;
|
|
8729
8644
|
};
|
|
8730
8645
|
|
|
8731
8646
|
// src/editor/components/section-menu/section-bubble-menu.tsx
|
|
8732
|
-
import { Fragment as Fragment6, jsx as
|
|
8647
|
+
import { Fragment as Fragment6, jsx as jsx43, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
8733
8648
|
function SectionBubbleMenu(props) {
|
|
8734
8649
|
const { appendTo, editor } = props;
|
|
8735
8650
|
if (!editor) {
|
|
8736
8651
|
return null;
|
|
8737
8652
|
}
|
|
8738
|
-
const getReferenceClientRect =
|
|
8653
|
+
const getReferenceClientRect = useCallback8(() => {
|
|
8739
8654
|
const renderContainer = getRenderContainer(editor, "section");
|
|
8740
8655
|
const rect = (renderContainer == null ? void 0 : renderContainer.getBoundingClientRect()) || new DOMRect(-1e3, -1e3, 0, 0);
|
|
8741
8656
|
return rect;
|
|
@@ -8764,7 +8679,7 @@ function SectionBubbleMenu(props) {
|
|
|
8764
8679
|
},
|
|
8765
8680
|
getReferenceClientRect,
|
|
8766
8681
|
appendTo: () => appendTo == null ? void 0 : appendTo.current,
|
|
8767
|
-
plugins: [
|
|
8682
|
+
plugins: [sticky5],
|
|
8768
8683
|
sticky: "popper",
|
|
8769
8684
|
maxWidth: "auto"
|
|
8770
8685
|
},
|
|
@@ -8776,12 +8691,12 @@ function SectionBubbleMenu(props) {
|
|
|
8776
8691
|
{ value: "6", label: "Smooth" },
|
|
8777
8692
|
{ value: "9999", label: "Round" }
|
|
8778
8693
|
];
|
|
8779
|
-
return /* @__PURE__ */
|
|
8780
|
-
|
|
8694
|
+
return /* @__PURE__ */ jsx43(
|
|
8695
|
+
BubbleMenu5,
|
|
8781
8696
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
8782
8697
|
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",
|
|
8783
|
-
children: /* @__PURE__ */
|
|
8784
|
-
/* @__PURE__ */
|
|
8698
|
+
children: /* @__PURE__ */ jsxs23(TooltipProvider, { children: [
|
|
8699
|
+
/* @__PURE__ */ jsx43(
|
|
8785
8700
|
AlignmentSwitch,
|
|
8786
8701
|
{
|
|
8787
8702
|
alignment: state.currentAlignment,
|
|
@@ -8793,9 +8708,9 @@ function SectionBubbleMenu(props) {
|
|
|
8793
8708
|
}
|
|
8794
8709
|
}
|
|
8795
8710
|
),
|
|
8796
|
-
/* @__PURE__ */
|
|
8797
|
-
/* @__PURE__ */
|
|
8798
|
-
/* @__PURE__ */
|
|
8711
|
+
/* @__PURE__ */ jsx43(Divider, {}),
|
|
8712
|
+
/* @__PURE__ */ jsxs23("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
8713
|
+
/* @__PURE__ */ jsx43(
|
|
8799
8714
|
Select,
|
|
8800
8715
|
{
|
|
8801
8716
|
label: "Border Radius",
|
|
@@ -8811,7 +8726,7 @@ function SectionBubbleMenu(props) {
|
|
|
8811
8726
|
className: "mly:capitalize"
|
|
8812
8727
|
}
|
|
8813
8728
|
),
|
|
8814
|
-
/* @__PURE__ */
|
|
8729
|
+
/* @__PURE__ */ jsx43(
|
|
8815
8730
|
Select,
|
|
8816
8731
|
{
|
|
8817
8732
|
label: "Border Width",
|
|
@@ -8833,8 +8748,8 @@ function SectionBubbleMenu(props) {
|
|
|
8833
8748
|
}
|
|
8834
8749
|
)
|
|
8835
8750
|
] }),
|
|
8836
|
-
/* @__PURE__ */
|
|
8837
|
-
/* @__PURE__ */
|
|
8751
|
+
/* @__PURE__ */ jsx43(Divider, {}),
|
|
8752
|
+
/* @__PURE__ */ jsx43(
|
|
8838
8753
|
Select,
|
|
8839
8754
|
{
|
|
8840
8755
|
icon: MarginIcon,
|
|
@@ -8862,8 +8777,8 @@ function SectionBubbleMenu(props) {
|
|
|
8862
8777
|
className: "mly:capitalize"
|
|
8863
8778
|
}
|
|
8864
8779
|
),
|
|
8865
|
-
/* @__PURE__ */
|
|
8866
|
-
/* @__PURE__ */
|
|
8780
|
+
/* @__PURE__ */ jsx43(Divider, {}),
|
|
8781
|
+
/* @__PURE__ */ jsx43(
|
|
8867
8782
|
Select,
|
|
8868
8783
|
{
|
|
8869
8784
|
icon: PaddingIcon,
|
|
@@ -8891,9 +8806,9 @@ function SectionBubbleMenu(props) {
|
|
|
8891
8806
|
className: "mly:capitalize"
|
|
8892
8807
|
}
|
|
8893
8808
|
),
|
|
8894
|
-
/* @__PURE__ */
|
|
8895
|
-
/* @__PURE__ */
|
|
8896
|
-
/* @__PURE__ */
|
|
8809
|
+
/* @__PURE__ */ jsx43(Divider, {}),
|
|
8810
|
+
/* @__PURE__ */ jsxs23("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
8811
|
+
/* @__PURE__ */ jsx43(
|
|
8897
8812
|
ColorPicker,
|
|
8898
8813
|
{
|
|
8899
8814
|
color: state.currentBorderColor,
|
|
@@ -8904,14 +8819,14 @@ function SectionBubbleMenu(props) {
|
|
|
8904
8819
|
});
|
|
8905
8820
|
},
|
|
8906
8821
|
tooltip: "Border Color",
|
|
8907
|
-
children: /* @__PURE__ */
|
|
8822
|
+
children: /* @__PURE__ */ jsx43(
|
|
8908
8823
|
BaseButton,
|
|
8909
8824
|
{
|
|
8910
8825
|
variant: "ghost",
|
|
8911
8826
|
className: "mly:h-7 mly:w-7 mly:shrink-0",
|
|
8912
8827
|
size: "sm",
|
|
8913
8828
|
type: "button",
|
|
8914
|
-
children: /* @__PURE__ */
|
|
8829
|
+
children: /* @__PURE__ */ jsx43(
|
|
8915
8830
|
BorderColor,
|
|
8916
8831
|
{
|
|
8917
8832
|
className: "mly:size-3 mly:shrink-0",
|
|
@@ -8925,7 +8840,7 @@ function SectionBubbleMenu(props) {
|
|
|
8925
8840
|
)
|
|
8926
8841
|
}
|
|
8927
8842
|
),
|
|
8928
|
-
/* @__PURE__ */
|
|
8843
|
+
/* @__PURE__ */ jsx43(
|
|
8929
8844
|
ColorPicker,
|
|
8930
8845
|
{
|
|
8931
8846
|
color: state.currentBackgroundColor,
|
|
@@ -8941,8 +8856,8 @@ function SectionBubbleMenu(props) {
|
|
|
8941
8856
|
}
|
|
8942
8857
|
)
|
|
8943
8858
|
] }),
|
|
8944
|
-
/* @__PURE__ */
|
|
8945
|
-
/* @__PURE__ */
|
|
8859
|
+
/* @__PURE__ */ jsx43(Divider, {}),
|
|
8860
|
+
/* @__PURE__ */ jsx43(
|
|
8946
8861
|
BubbleMenuButton,
|
|
8947
8862
|
{
|
|
8948
8863
|
icon: Trash3,
|
|
@@ -8952,14 +8867,14 @@ function SectionBubbleMenu(props) {
|
|
|
8952
8867
|
}
|
|
8953
8868
|
}
|
|
8954
8869
|
),
|
|
8955
|
-
state.isColumnsActive && /* @__PURE__ */
|
|
8956
|
-
/* @__PURE__ */
|
|
8957
|
-
/* @__PURE__ */
|
|
8958
|
-
/* @__PURE__ */
|
|
8870
|
+
state.isColumnsActive && /* @__PURE__ */ jsxs23(Fragment6, { children: [
|
|
8871
|
+
/* @__PURE__ */ jsx43(Divider, {}),
|
|
8872
|
+
/* @__PURE__ */ jsxs23(Popover, { children: [
|
|
8873
|
+
/* @__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: [
|
|
8959
8874
|
"Column",
|
|
8960
|
-
/* @__PURE__ */
|
|
8875
|
+
/* @__PURE__ */ jsx43(ChevronUp, { className: "mly:h-3 mly:w-3" })
|
|
8961
8876
|
] }),
|
|
8962
|
-
/* @__PURE__ */
|
|
8877
|
+
/* @__PURE__ */ jsx43(
|
|
8963
8878
|
PopoverContent,
|
|
8964
8879
|
{
|
|
8965
8880
|
className: "mly:w-max mly:rounded-lg mly:p-0.5!",
|
|
@@ -8972,7 +8887,7 @@ function SectionBubbleMenu(props) {
|
|
|
8972
8887
|
onCloseAutoFocus: (e) => {
|
|
8973
8888
|
e.preventDefault();
|
|
8974
8889
|
},
|
|
8975
|
-
children: /* @__PURE__ */
|
|
8890
|
+
children: /* @__PURE__ */ jsx43(ColumnsBubbleMenuContent, { editor })
|
|
8976
8891
|
}
|
|
8977
8892
|
)
|
|
8978
8893
|
] })
|
|
@@ -8983,13 +8898,13 @@ function SectionBubbleMenu(props) {
|
|
|
8983
8898
|
}
|
|
8984
8899
|
|
|
8985
8900
|
// src/editor/components/spacer-menu/spacer-bubble-menu.tsx
|
|
8986
|
-
import { BubbleMenu as
|
|
8901
|
+
import { BubbleMenu as BubbleMenu6 } from "@tiptap/react";
|
|
8987
8902
|
|
|
8988
8903
|
// src/editor/components/spacer-menu/use-spacer-state.ts
|
|
8989
|
-
import { useEditorState as
|
|
8990
|
-
import
|
|
8904
|
+
import { useEditorState as useEditorState6 } from "@tiptap/react";
|
|
8905
|
+
import deepEql6 from "fast-deep-equal";
|
|
8991
8906
|
var useSpacerState = (editor) => {
|
|
8992
|
-
const states =
|
|
8907
|
+
const states = useEditorState6({
|
|
8993
8908
|
editor,
|
|
8994
8909
|
selector: (ctx) => {
|
|
8995
8910
|
var _a;
|
|
@@ -8997,14 +8912,14 @@ var useSpacerState = (editor) => {
|
|
|
8997
8912
|
currentShowIfKey: ((_a = ctx.editor.getAttributes("spacer")) == null ? void 0 : _a.showIfKey) || ""
|
|
8998
8913
|
};
|
|
8999
8914
|
},
|
|
9000
|
-
equalityFn:
|
|
8915
|
+
equalityFn: deepEql6
|
|
9001
8916
|
});
|
|
9002
8917
|
return states;
|
|
9003
8918
|
};
|
|
9004
8919
|
|
|
9005
8920
|
// src/editor/components/spacer-menu/spacer-bubble-menu.tsx
|
|
9006
8921
|
import { useMemo as useMemo8 } from "react";
|
|
9007
|
-
import { jsx as
|
|
8922
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
9008
8923
|
function SpacerBubbleMenu(props) {
|
|
9009
8924
|
const { editor, appendTo } = props;
|
|
9010
8925
|
if (!editor) {
|
|
@@ -9036,11 +8951,11 @@ function SpacerBubbleMenu(props) {
|
|
|
9036
8951
|
}
|
|
9037
8952
|
});
|
|
9038
8953
|
const state = useSpacerState(editor);
|
|
9039
|
-
return /* @__PURE__ */
|
|
9040
|
-
|
|
8954
|
+
return /* @__PURE__ */ jsx44(
|
|
8955
|
+
BubbleMenu6,
|
|
9041
8956
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
9042
8957
|
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",
|
|
9043
|
-
children: /* @__PURE__ */
|
|
8958
|
+
children: /* @__PURE__ */ jsx44(TooltipProvider, { children: items.map((item, index) => /* @__PURE__ */ jsx44(
|
|
9044
8959
|
BubbleMenuButton,
|
|
9045
8960
|
__spreadValues({
|
|
9046
8961
|
className: "!mly:h-7 mly:w-7 mly:shrink-0 mly:p-0",
|
|
@@ -9281,11 +9196,11 @@ import { NodeViewWrapper as NodeViewWrapper4 } from "@tiptap/react";
|
|
|
9281
9196
|
|
|
9282
9197
|
// src/editor/components/input.tsx
|
|
9283
9198
|
import * as React5 from "react";
|
|
9284
|
-
import { jsx as
|
|
9199
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
9285
9200
|
var Input = React5.forwardRef(
|
|
9286
9201
|
(_a, ref) => {
|
|
9287
9202
|
var _b = _a, { className, type } = _b, props = __objRest(_b, ["className", "type"]);
|
|
9288
|
-
return /* @__PURE__ */
|
|
9203
|
+
return /* @__PURE__ */ jsx45(
|
|
9289
9204
|
"input",
|
|
9290
9205
|
__spreadValues(__spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
|
|
9291
9206
|
type,
|
|
@@ -9303,11 +9218,11 @@ Input.displayName = "Input";
|
|
|
9303
9218
|
|
|
9304
9219
|
// src/editor/components/textarea.tsx
|
|
9305
9220
|
import * as React6 from "react";
|
|
9306
|
-
import { jsx as
|
|
9221
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
9307
9222
|
var Textarea = React6.forwardRef(
|
|
9308
9223
|
(_a, ref) => {
|
|
9309
9224
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
9310
|
-
return /* @__PURE__ */
|
|
9225
|
+
return /* @__PURE__ */ jsx46(
|
|
9311
9226
|
"textarea",
|
|
9312
9227
|
__spreadValues({
|
|
9313
9228
|
className: cn(
|
|
@@ -9323,18 +9238,18 @@ var Textarea = React6.forwardRef(
|
|
|
9323
9238
|
Textarea.displayName = "Textarea";
|
|
9324
9239
|
|
|
9325
9240
|
// src/editor/nodes/link-card.tsx
|
|
9326
|
-
import { jsx as
|
|
9241
|
+
import { jsx as jsx47, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
9327
9242
|
function LinkCardComponent(props) {
|
|
9328
9243
|
const { title, description, link, linkTitle, image: image2, badgeText, subTitle } = props.node.attrs;
|
|
9329
9244
|
const { getPos, editor } = props;
|
|
9330
|
-
return /* @__PURE__ */
|
|
9245
|
+
return /* @__PURE__ */ jsx47(
|
|
9331
9246
|
NodeViewWrapper4,
|
|
9332
9247
|
{
|
|
9333
9248
|
className: `react-component ${props.selected && "ProseMirror-selectednode"}`,
|
|
9334
9249
|
draggable: editor.isEditable,
|
|
9335
9250
|
"data-drag-handle": editor.isEditable,
|
|
9336
|
-
children: /* @__PURE__ */
|
|
9337
|
-
/* @__PURE__ */
|
|
9251
|
+
children: /* @__PURE__ */ jsxs24(Popover, { open: props.selected, children: [
|
|
9252
|
+
/* @__PURE__ */ jsx47(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx47(
|
|
9338
9253
|
"div",
|
|
9339
9254
|
{
|
|
9340
9255
|
tabIndex: -1,
|
|
@@ -9343,8 +9258,8 @@ function LinkCardComponent(props) {
|
|
|
9343
9258
|
const pos = getPos();
|
|
9344
9259
|
editor.commands.setNodeSelection(pos);
|
|
9345
9260
|
},
|
|
9346
|
-
children: /* @__PURE__ */
|
|
9347
|
-
image2 && /* @__PURE__ */
|
|
9261
|
+
children: /* @__PURE__ */ jsxs24("div", { className: "mly:no-prose mly:flex mly:flex-col mly:rounded-lg mly:border mly:border-gray-300", children: [
|
|
9262
|
+
image2 && /* @__PURE__ */ jsx47("div", { className: "mly:relative mly:mb-1.5 mly:w-full mly:shrink-0", children: /* @__PURE__ */ jsx47(
|
|
9348
9263
|
"img",
|
|
9349
9264
|
{
|
|
9350
9265
|
src: image2,
|
|
@@ -9353,23 +9268,23 @@ function LinkCardComponent(props) {
|
|
|
9353
9268
|
draggable: editor.isEditable
|
|
9354
9269
|
}
|
|
9355
9270
|
) }),
|
|
9356
|
-
/* @__PURE__ */
|
|
9357
|
-
/* @__PURE__ */
|
|
9358
|
-
/* @__PURE__ */
|
|
9359
|
-
badgeText && /* @__PURE__ */
|
|
9271
|
+
/* @__PURE__ */ jsx47("div", { className: "mly:flex mly:items-stretch mly:p-3", children: /* @__PURE__ */ jsxs24("div", { className: cn("mly:flex mly:flex-col"), children: [
|
|
9272
|
+
/* @__PURE__ */ jsxs24("div", { className: "!mly:mb-1.5 mly:flex mly:items-center mly:gap-1.5", children: [
|
|
9273
|
+
/* @__PURE__ */ jsx47("h2", { className: "!mly:mb-0 mly:text-lg! mly:font-semibold", children: title }),
|
|
9274
|
+
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 }),
|
|
9360
9275
|
" ",
|
|
9361
|
-
subTitle && !badgeText && /* @__PURE__ */
|
|
9276
|
+
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 })
|
|
9362
9277
|
] }),
|
|
9363
|
-
/* @__PURE__ */
|
|
9278
|
+
/* @__PURE__ */ jsxs24("p", { className: "!mly:my-0 mly:text-base! mly:text-gray-500", children: [
|
|
9364
9279
|
description,
|
|
9365
9280
|
" ",
|
|
9366
|
-
linkTitle ? /* @__PURE__ */
|
|
9281
|
+
linkTitle ? /* @__PURE__ */ jsx47("a", { href: link, className: "mly:font-semibold", children: linkTitle }) : null
|
|
9367
9282
|
] })
|
|
9368
9283
|
] }) })
|
|
9369
9284
|
] })
|
|
9370
9285
|
}
|
|
9371
9286
|
) }),
|
|
9372
|
-
/* @__PURE__ */
|
|
9287
|
+
/* @__PURE__ */ jsxs24(
|
|
9373
9288
|
PopoverContent,
|
|
9374
9289
|
{
|
|
9375
9290
|
align: "end",
|
|
@@ -9378,9 +9293,9 @@ function LinkCardComponent(props) {
|
|
|
9378
9293
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
9379
9294
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
9380
9295
|
children: [
|
|
9381
|
-
/* @__PURE__ */
|
|
9382
|
-
/* @__PURE__ */
|
|
9383
|
-
/* @__PURE__ */
|
|
9296
|
+
/* @__PURE__ */ jsxs24("label", { className: "mly:w-full mly:space-y-1", children: [
|
|
9297
|
+
/* @__PURE__ */ jsx47("span", { className: "mly:text-xs mly:font-normal mly:text-slate-400", children: "Image" }),
|
|
9298
|
+
/* @__PURE__ */ jsx47(
|
|
9384
9299
|
Input,
|
|
9385
9300
|
{
|
|
9386
9301
|
placeholder: "Add Image",
|
|
@@ -9394,9 +9309,9 @@ function LinkCardComponent(props) {
|
|
|
9394
9309
|
}
|
|
9395
9310
|
)
|
|
9396
9311
|
] }),
|
|
9397
|
-
/* @__PURE__ */
|
|
9398
|
-
/* @__PURE__ */
|
|
9399
|
-
/* @__PURE__ */
|
|
9312
|
+
/* @__PURE__ */ jsxs24("label", { className: "mly:w-full mly:space-y-1", children: [
|
|
9313
|
+
/* @__PURE__ */ jsx47("span", { className: "mly:text-xs mly:font-normal mly:text-slate-400", children: "Title" }),
|
|
9314
|
+
/* @__PURE__ */ jsx47(
|
|
9400
9315
|
Input,
|
|
9401
9316
|
{
|
|
9402
9317
|
placeholder: "Add title",
|
|
@@ -9409,9 +9324,9 @@ function LinkCardComponent(props) {
|
|
|
9409
9324
|
}
|
|
9410
9325
|
)
|
|
9411
9326
|
] }),
|
|
9412
|
-
/* @__PURE__ */
|
|
9413
|
-
/* @__PURE__ */
|
|
9414
|
-
/* @__PURE__ */
|
|
9327
|
+
/* @__PURE__ */ jsxs24("label", { className: "mly:w-full mly:space-y-1", children: [
|
|
9328
|
+
/* @__PURE__ */ jsx47("span", { className: "mly:text-xs mly:font-normal mly:text-slate-400", children: "Description" }),
|
|
9329
|
+
/* @__PURE__ */ jsx47(
|
|
9415
9330
|
Textarea,
|
|
9416
9331
|
{
|
|
9417
9332
|
placeholder: "Add description here",
|
|
@@ -9424,10 +9339,10 @@ function LinkCardComponent(props) {
|
|
|
9424
9339
|
}
|
|
9425
9340
|
)
|
|
9426
9341
|
] }),
|
|
9427
|
-
/* @__PURE__ */
|
|
9428
|
-
/* @__PURE__ */
|
|
9429
|
-
/* @__PURE__ */
|
|
9430
|
-
/* @__PURE__ */
|
|
9342
|
+
/* @__PURE__ */ jsxs24("div", { className: "mly:grid mly:grid-cols-2 mly:gap-2", children: [
|
|
9343
|
+
/* @__PURE__ */ jsxs24("label", { className: "mly:w-full mly:space-y-1", children: [
|
|
9344
|
+
/* @__PURE__ */ jsx47("span", { className: "mly:text-xs mly:font-normal mly:text-slate-400", children: "Link Title" }),
|
|
9345
|
+
/* @__PURE__ */ jsx47(
|
|
9431
9346
|
Input,
|
|
9432
9347
|
{
|
|
9433
9348
|
placeholder: "Add link title here",
|
|
@@ -9440,9 +9355,9 @@ function LinkCardComponent(props) {
|
|
|
9440
9355
|
}
|
|
9441
9356
|
)
|
|
9442
9357
|
] }),
|
|
9443
|
-
/* @__PURE__ */
|
|
9444
|
-
/* @__PURE__ */
|
|
9445
|
-
/* @__PURE__ */
|
|
9358
|
+
/* @__PURE__ */ jsxs24("label", { className: "mly:w-full mly:space-y-1", children: [
|
|
9359
|
+
/* @__PURE__ */ jsx47("span", { className: "mly:text-xs mly:font-normal mly:text-slate-400", children: "Link" }),
|
|
9360
|
+
/* @__PURE__ */ jsx47(
|
|
9446
9361
|
Input,
|
|
9447
9362
|
{
|
|
9448
9363
|
placeholder: "Add link here",
|
|
@@ -9456,10 +9371,10 @@ function LinkCardComponent(props) {
|
|
|
9456
9371
|
)
|
|
9457
9372
|
] })
|
|
9458
9373
|
] }),
|
|
9459
|
-
/* @__PURE__ */
|
|
9460
|
-
/* @__PURE__ */
|
|
9461
|
-
/* @__PURE__ */
|
|
9462
|
-
/* @__PURE__ */
|
|
9374
|
+
/* @__PURE__ */ jsxs24("div", { className: "mly:grid mly:grid-cols-2 mly:gap-2", children: [
|
|
9375
|
+
/* @__PURE__ */ jsxs24("label", { className: "mly:w-full mly:space-y-1", children: [
|
|
9376
|
+
/* @__PURE__ */ jsx47("span", { className: "mly:text-xs mly:font-normal mly:text-slate-400", children: "Badge Text" }),
|
|
9377
|
+
/* @__PURE__ */ jsx47(
|
|
9463
9378
|
Input,
|
|
9464
9379
|
{
|
|
9465
9380
|
placeholder: "Add badge text here",
|
|
@@ -9472,9 +9387,9 @@ function LinkCardComponent(props) {
|
|
|
9472
9387
|
}
|
|
9473
9388
|
)
|
|
9474
9389
|
] }),
|
|
9475
|
-
/* @__PURE__ */
|
|
9476
|
-
/* @__PURE__ */
|
|
9477
|
-
/* @__PURE__ */
|
|
9390
|
+
/* @__PURE__ */ jsxs24("label", { className: "mly:w-full mly:space-y-1", children: [
|
|
9391
|
+
/* @__PURE__ */ jsx47("span", { className: "mly:text-xs mly:font-normal mly:text-slate-400", children: "Sub Title" }),
|
|
9392
|
+
/* @__PURE__ */ jsx47(
|
|
9478
9393
|
Input,
|
|
9479
9394
|
{
|
|
9480
9395
|
placeholder: "Add sub title here",
|
|
@@ -9577,7 +9492,7 @@ import { useMemo as useMemo10 } from "react";
|
|
|
9577
9492
|
|
|
9578
9493
|
// src/editor/nodes/button/button-label-input.tsx
|
|
9579
9494
|
import { useMemo as useMemo9, useRef as useRef9, useState as useState9 } from "react";
|
|
9580
|
-
import { jsx as
|
|
9495
|
+
import { jsx as jsx48, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
9581
9496
|
function ButtonLabelInput(props) {
|
|
9582
9497
|
var _a, _b;
|
|
9583
9498
|
const { value, onValueChange, isVariable, editor } = props;
|
|
@@ -9599,8 +9514,8 @@ function ButtonLabelInput(props) {
|
|
|
9599
9514
|
editor
|
|
9600
9515
|
}).map((variable) => variable.name);
|
|
9601
9516
|
}, [variables, value, editor]);
|
|
9602
|
-
return /* @__PURE__ */
|
|
9603
|
-
!isEditing && /* @__PURE__ */
|
|
9517
|
+
return /* @__PURE__ */ jsxs25("div", { className: "mly:isolate mly:flex mly:items-center mly:rounded-lg", children: [
|
|
9518
|
+
!isEditing && /* @__PURE__ */ jsx48(
|
|
9604
9519
|
"button",
|
|
9605
9520
|
{
|
|
9606
9521
|
onClick: () => {
|
|
@@ -9621,7 +9536,7 @@ function ButtonLabelInput(props) {
|
|
|
9621
9536
|
})
|
|
9622
9537
|
}
|
|
9623
9538
|
),
|
|
9624
|
-
isEditing && /* @__PURE__ */
|
|
9539
|
+
isEditing && /* @__PURE__ */ jsx48(
|
|
9625
9540
|
InputAutocomplete,
|
|
9626
9541
|
{
|
|
9627
9542
|
editor,
|
|
@@ -9648,7 +9563,7 @@ function ButtonLabelInput(props) {
|
|
|
9648
9563
|
}
|
|
9649
9564
|
|
|
9650
9565
|
// src/editor/nodes/button/button-view.tsx
|
|
9651
|
-
import { jsx as
|
|
9566
|
+
import { jsx as jsx49, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
9652
9567
|
function ButtonView(props) {
|
|
9653
9568
|
const { node, editor, getPos, updateAttributes: updateAttributes2 } = props;
|
|
9654
9569
|
const {
|
|
@@ -9691,7 +9606,7 @@ function ButtonView(props) {
|
|
|
9691
9606
|
([, { paddingX, paddingY }]) => paddingRight === paddingX && paddingTop === paddingY
|
|
9692
9607
|
)) == null ? void 0 : _a[0];
|
|
9693
9608
|
}, [paddingRight, paddingTop, sizes]);
|
|
9694
|
-
return /* @__PURE__ */
|
|
9609
|
+
return /* @__PURE__ */ jsx49(
|
|
9695
9610
|
NodeViewWrapper5,
|
|
9696
9611
|
{
|
|
9697
9612
|
draggable: editor.isEditable,
|
|
@@ -9700,8 +9615,8 @@ function ButtonView(props) {
|
|
|
9700
9615
|
style: {
|
|
9701
9616
|
textAlign: alignment
|
|
9702
9617
|
},
|
|
9703
|
-
children: /* @__PURE__ */
|
|
9704
|
-
/* @__PURE__ */
|
|
9618
|
+
children: /* @__PURE__ */ jsxs26(Popover, { open: props.selected && editor.isEditable, children: [
|
|
9619
|
+
/* @__PURE__ */ jsx49(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx49("div", { children: /* @__PURE__ */ jsx49(
|
|
9705
9620
|
"button",
|
|
9706
9621
|
{
|
|
9707
9622
|
className: cn(
|
|
@@ -9744,7 +9659,7 @@ function ButtonView(props) {
|
|
|
9744
9659
|
}) : text2
|
|
9745
9660
|
}
|
|
9746
9661
|
) }) }),
|
|
9747
|
-
/* @__PURE__ */
|
|
9662
|
+
/* @__PURE__ */ jsx49(
|
|
9748
9663
|
PopoverContent,
|
|
9749
9664
|
{
|
|
9750
9665
|
align: "end",
|
|
@@ -9753,8 +9668,8 @@ function ButtonView(props) {
|
|
|
9753
9668
|
sideOffset: 8,
|
|
9754
9669
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
9755
9670
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
9756
|
-
children: /* @__PURE__ */
|
|
9757
|
-
/* @__PURE__ */
|
|
9671
|
+
children: /* @__PURE__ */ jsx49(TooltipProvider, { children: /* @__PURE__ */ jsxs26("div", { className: "mly:flex mly:items-stretch mly:text-midnight-gray", children: [
|
|
9672
|
+
/* @__PURE__ */ jsx49(
|
|
9758
9673
|
ButtonLabelInput,
|
|
9759
9674
|
{
|
|
9760
9675
|
value: text2,
|
|
@@ -9768,9 +9683,9 @@ function ButtonView(props) {
|
|
|
9768
9683
|
editor
|
|
9769
9684
|
}
|
|
9770
9685
|
),
|
|
9771
|
-
/* @__PURE__ */
|
|
9772
|
-
/* @__PURE__ */
|
|
9773
|
-
/* @__PURE__ */
|
|
9686
|
+
/* @__PURE__ */ jsx49(Divider, {}),
|
|
9687
|
+
/* @__PURE__ */ jsxs26("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
9688
|
+
/* @__PURE__ */ jsx49(
|
|
9774
9689
|
Select,
|
|
9775
9690
|
{
|
|
9776
9691
|
label: "Border Radius",
|
|
@@ -9788,7 +9703,7 @@ function ButtonView(props) {
|
|
|
9788
9703
|
className: "mly:capitalize"
|
|
9789
9704
|
}
|
|
9790
9705
|
),
|
|
9791
|
-
/* @__PURE__ */
|
|
9706
|
+
/* @__PURE__ */ jsx49(
|
|
9792
9707
|
Select,
|
|
9793
9708
|
{
|
|
9794
9709
|
label: "Style",
|
|
@@ -9806,7 +9721,7 @@ function ButtonView(props) {
|
|
|
9806
9721
|
className: "mly:capitalize"
|
|
9807
9722
|
}
|
|
9808
9723
|
),
|
|
9809
|
-
/* @__PURE__ */
|
|
9724
|
+
/* @__PURE__ */ jsx49(
|
|
9810
9725
|
Select,
|
|
9811
9726
|
{
|
|
9812
9727
|
label: "Size",
|
|
@@ -9830,9 +9745,9 @@ function ButtonView(props) {
|
|
|
9830
9745
|
}
|
|
9831
9746
|
)
|
|
9832
9747
|
] }),
|
|
9833
|
-
/* @__PURE__ */
|
|
9834
|
-
/* @__PURE__ */
|
|
9835
|
-
/* @__PURE__ */
|
|
9748
|
+
/* @__PURE__ */ jsx49(Divider, {}),
|
|
9749
|
+
/* @__PURE__ */ jsxs26("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
9750
|
+
/* @__PURE__ */ jsx49(
|
|
9836
9751
|
AlignmentSwitch,
|
|
9837
9752
|
{
|
|
9838
9753
|
alignment,
|
|
@@ -9843,7 +9758,7 @@ function ButtonView(props) {
|
|
|
9843
9758
|
}
|
|
9844
9759
|
}
|
|
9845
9760
|
),
|
|
9846
|
-
/* @__PURE__ */
|
|
9761
|
+
/* @__PURE__ */ jsx49(
|
|
9847
9762
|
LinkInputPopover,
|
|
9848
9763
|
{
|
|
9849
9764
|
defaultValue: externalLink || "",
|
|
@@ -9859,9 +9774,9 @@ function ButtonView(props) {
|
|
|
9859
9774
|
}
|
|
9860
9775
|
)
|
|
9861
9776
|
] }),
|
|
9862
|
-
/* @__PURE__ */
|
|
9863
|
-
/* @__PURE__ */
|
|
9864
|
-
/* @__PURE__ */
|
|
9777
|
+
/* @__PURE__ */ jsx49(Divider, {}),
|
|
9778
|
+
/* @__PURE__ */ jsxs26("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
9779
|
+
/* @__PURE__ */ jsx49(
|
|
9865
9780
|
BackgroundColorPickerPopup,
|
|
9866
9781
|
{
|
|
9867
9782
|
variant,
|
|
@@ -9873,7 +9788,7 @@ function ButtonView(props) {
|
|
|
9873
9788
|
}
|
|
9874
9789
|
}
|
|
9875
9790
|
),
|
|
9876
|
-
/* @__PURE__ */
|
|
9791
|
+
/* @__PURE__ */ jsx49(
|
|
9877
9792
|
TextColorPickerPopup,
|
|
9878
9793
|
{
|
|
9879
9794
|
color: textColor || "transparent",
|
|
@@ -9894,20 +9809,20 @@ function ButtonView(props) {
|
|
|
9894
9809
|
}
|
|
9895
9810
|
function BackgroundColorPickerPopup(props) {
|
|
9896
9811
|
const { color, onChange, variant } = props;
|
|
9897
|
-
return /* @__PURE__ */
|
|
9812
|
+
return /* @__PURE__ */ jsx49(
|
|
9898
9813
|
ColorPicker,
|
|
9899
9814
|
{
|
|
9900
9815
|
color,
|
|
9901
9816
|
onColorChange: onChange,
|
|
9902
9817
|
tooltip: "Background Color",
|
|
9903
|
-
children: /* @__PURE__ */
|
|
9818
|
+
children: /* @__PURE__ */ jsx49(
|
|
9904
9819
|
BaseButton,
|
|
9905
9820
|
{
|
|
9906
9821
|
variant: "ghost",
|
|
9907
9822
|
size: "sm",
|
|
9908
9823
|
type: "button",
|
|
9909
9824
|
className: "mly:size-7",
|
|
9910
|
-
children: /* @__PURE__ */
|
|
9825
|
+
children: /* @__PURE__ */ jsx49(
|
|
9911
9826
|
"div",
|
|
9912
9827
|
{
|
|
9913
9828
|
className: "mly:h-4 mly:w-4 mly:shrink-0 mly:rounded-full mly:shadow",
|
|
@@ -9926,16 +9841,16 @@ function BackgroundColorPickerPopup(props) {
|
|
|
9926
9841
|
}
|
|
9927
9842
|
function TextColorPickerPopup(props) {
|
|
9928
9843
|
const { color, onChange } = props;
|
|
9929
|
-
return /* @__PURE__ */
|
|
9844
|
+
return /* @__PURE__ */ jsx49(ColorPicker, { color, onColorChange: onChange, tooltip: "Text Color", children: /* @__PURE__ */ jsx49(
|
|
9930
9845
|
BaseButton,
|
|
9931
9846
|
{
|
|
9932
9847
|
variant: "ghost",
|
|
9933
9848
|
size: "sm",
|
|
9934
9849
|
type: "button",
|
|
9935
9850
|
className: "mly:size-7",
|
|
9936
|
-
children: /* @__PURE__ */
|
|
9937
|
-
/* @__PURE__ */
|
|
9938
|
-
/* @__PURE__ */
|
|
9851
|
+
children: /* @__PURE__ */ jsxs26("div", { className: "mly:flex mly:flex-col mly:items-center mly:justify-center mly:gap-px", children: [
|
|
9852
|
+
/* @__PURE__ */ jsx49("span", { className: "mly:font-bolder mly:font-mono mly:text-xs mly:text-midnight-gray", children: "A" }),
|
|
9853
|
+
/* @__PURE__ */ jsx49(
|
|
9939
9854
|
"div",
|
|
9940
9855
|
{
|
|
9941
9856
|
className: "mly:h-[2px] mly:w-3 mly:shrink-0 mly:rounded-md mly:shadow",
|
|
@@ -10266,83 +10181,24 @@ import { createLowlight, common } from "lowlight";
|
|
|
10266
10181
|
|
|
10267
10182
|
// src/editor/nodes/html/html-view.tsx
|
|
10268
10183
|
import { NodeViewContent, NodeViewWrapper as NodeViewWrapper6 } from "@tiptap/react";
|
|
10269
|
-
import {
|
|
10270
|
-
import { jsx as jsx51, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
10184
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
10271
10185
|
function HTMLCodeBlockView(props) {
|
|
10272
|
-
const { node
|
|
10273
|
-
|
|
10274
|
-
activeTab || (activeTab = "code");
|
|
10186
|
+
const { node } = props;
|
|
10187
|
+
const { language } = node.attrs;
|
|
10275
10188
|
const languageClass = language ? `language-${language}` : "";
|
|
10276
|
-
|
|
10277
|
-
const text2 = node.content.content.reduce((acc, cur) => {
|
|
10278
|
-
if (cur.type.name === "text") {
|
|
10279
|
-
return acc + cur.text;
|
|
10280
|
-
} else if (cur.type.name === "variable") {
|
|
10281
|
-
const { id: variable, fallback } = (cur == null ? void 0 : cur.attrs) || {};
|
|
10282
|
-
const formattedVariable = fallback ? `{{${variable},fallback=${fallback}}}` : `{{${variable}}}`;
|
|
10283
|
-
return acc + formattedVariable;
|
|
10284
|
-
}
|
|
10285
|
-
return acc;
|
|
10286
|
-
}, "");
|
|
10287
|
-
const htmlParser = new DOMParser();
|
|
10288
|
-
const htmlDoc = htmlParser.parseFromString(text2, "text/html");
|
|
10289
|
-
const style = htmlDoc.querySelectorAll("style");
|
|
10290
|
-
const body = htmlDoc.body;
|
|
10291
|
-
const combinedStyle = Array.from(style).map((s) => s.innerHTML).join("\n");
|
|
10292
|
-
return `<style>${combinedStyle}</style>${body.innerHTML}`;
|
|
10293
|
-
}, [activeTab]);
|
|
10294
|
-
const isEmpty = html2 === "";
|
|
10295
|
-
return /* @__PURE__ */ jsxs28(
|
|
10189
|
+
return /* @__PURE__ */ jsx50(
|
|
10296
10190
|
NodeViewWrapper6,
|
|
10297
10191
|
{
|
|
10298
10192
|
draggable: false,
|
|
10299
10193
|
"data-drag-handle": false,
|
|
10300
10194
|
"data-type": "htmlCodeBlock",
|
|
10301
|
-
children:
|
|
10302
|
-
|
|
10303
|
-
|
|
10304
|
-
|
|
10305
|
-
|
|
10306
|
-
|
|
10307
|
-
|
|
10308
|
-
) }),
|
|
10309
|
-
activeTab === "preview" && /* @__PURE__ */ jsx51(
|
|
10310
|
-
"div",
|
|
10311
|
-
{
|
|
10312
|
-
className: cn(
|
|
10313
|
-
"mly:not-prose mly:rounded-lg mly:border mly:border-gray-200 mly:p-2",
|
|
10314
|
-
isEmpty && "mly:min-h-[42px]"
|
|
10315
|
-
),
|
|
10316
|
-
ref: (node2) => {
|
|
10317
|
-
if (!node2 || (node2 == null ? void 0 : node2.shadowRoot)) {
|
|
10318
|
-
return;
|
|
10319
|
-
}
|
|
10320
|
-
const shadow = node2.attachShadow({ mode: "open" });
|
|
10321
|
-
const sheet = new CSSStyleSheet();
|
|
10322
|
-
sheet.replaceSync(`
|
|
10323
|
-
* { font-family: 'Inter', sans-serif; }
|
|
10324
|
-
blockquote, h1, h2, h3, img, li, ol, p, ul {
|
|
10325
|
-
margin-top: 0;
|
|
10326
|
-
margin-bottom: 0;
|
|
10327
|
-
}
|
|
10328
|
-
`);
|
|
10329
|
-
shadow.adoptedStyleSheets = [sheet];
|
|
10330
|
-
const container = document.createElement("div");
|
|
10331
|
-
container.innerHTML = html2;
|
|
10332
|
-
shadow.appendChild(container);
|
|
10333
|
-
},
|
|
10334
|
-
contentEditable: false,
|
|
10335
|
-
onClick: () => {
|
|
10336
|
-
if (!isEmpty) {
|
|
10337
|
-
return;
|
|
10338
|
-
}
|
|
10339
|
-
updateAttributes2({
|
|
10340
|
-
activeTab: "code"
|
|
10341
|
-
});
|
|
10342
|
-
}
|
|
10343
|
-
}
|
|
10344
|
-
)
|
|
10345
|
-
]
|
|
10195
|
+
children: /* @__PURE__ */ jsx50("pre", { className: "mly-html-code-pre", children: /* @__PURE__ */ jsx50(
|
|
10196
|
+
NodeViewContent,
|
|
10197
|
+
{
|
|
10198
|
+
as: "code",
|
|
10199
|
+
className: cn("is-editable", languageClass)
|
|
10200
|
+
}
|
|
10201
|
+
) })
|
|
10346
10202
|
}
|
|
10347
10203
|
);
|
|
10348
10204
|
}
|
|
@@ -10486,10 +10342,10 @@ import { ReactNodeViewRenderer as ReactNodeViewRenderer6 } from "@tiptap/react";
|
|
|
10486
10342
|
// src/editor/nodes/repeat/repeat-view.tsx
|
|
10487
10343
|
import { NodeViewWrapper as NodeViewWrapper7, NodeViewContent as NodeViewContent2 } from "@tiptap/react";
|
|
10488
10344
|
import { Repeat2 as Repeat22 } from "lucide-react";
|
|
10489
|
-
import { jsx as
|
|
10345
|
+
import { jsx as jsx51, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
10490
10346
|
function RepeatView(props) {
|
|
10491
10347
|
const { editor, getPos } = props;
|
|
10492
|
-
return /* @__PURE__ */
|
|
10348
|
+
return /* @__PURE__ */ jsxs27(
|
|
10493
10349
|
NodeViewWrapper7,
|
|
10494
10350
|
{
|
|
10495
10351
|
"data-type": "repeat",
|
|
@@ -10497,8 +10353,8 @@ function RepeatView(props) {
|
|
|
10497
10353
|
"data-drag-handle": editor.isEditable,
|
|
10498
10354
|
className: "mly:relative",
|
|
10499
10355
|
children: [
|
|
10500
|
-
/* @__PURE__ */
|
|
10501
|
-
/* @__PURE__ */
|
|
10356
|
+
/* @__PURE__ */ jsx51(NodeViewContent2, { className: "is-editable" }),
|
|
10357
|
+
/* @__PURE__ */ jsxs27(
|
|
10502
10358
|
"div",
|
|
10503
10359
|
{
|
|
10504
10360
|
role: "button",
|
|
@@ -10509,8 +10365,8 @@ function RepeatView(props) {
|
|
|
10509
10365
|
editor.commands.setNodeSelection(getPos());
|
|
10510
10366
|
},
|
|
10511
10367
|
children: [
|
|
10512
|
-
/* @__PURE__ */
|
|
10513
|
-
/* @__PURE__ */
|
|
10368
|
+
/* @__PURE__ */ jsx51(Repeat22, { className: "mly:size-3 mly:stroke-[2.5] mly:text-midnight-gray" }),
|
|
10369
|
+
/* @__PURE__ */ jsx51("div", { className: "mly:w-[1.5px] mly:grow mly:rounded-full mly:bg-rose-300" })
|
|
10514
10370
|
]
|
|
10515
10371
|
}
|
|
10516
10372
|
)
|
|
@@ -10755,7 +10611,7 @@ import { ReactRenderer } from "@tiptap/react";
|
|
|
10755
10611
|
import {
|
|
10756
10612
|
forwardRef as forwardRef8,
|
|
10757
10613
|
Fragment as Fragment8,
|
|
10758
|
-
useCallback as
|
|
10614
|
+
useCallback as useCallback10,
|
|
10759
10615
|
useEffect as useEffect8,
|
|
10760
10616
|
useImperativeHandle as useImperativeHandle2,
|
|
10761
10617
|
useLayoutEffect as useLayoutEffect2,
|
|
@@ -10766,8 +10622,8 @@ import tippy2 from "tippy.js";
|
|
|
10766
10622
|
|
|
10767
10623
|
// src/editor/extensions/slash-command/slash-command-item.tsx
|
|
10768
10624
|
import { ChevronRightIcon } from "lucide-react";
|
|
10769
|
-
import { useCallback as
|
|
10770
|
-
import { Fragment as Fragment7, jsx as
|
|
10625
|
+
import { useCallback as useCallback9, useState as useState10, useRef as useRef10, useEffect as useEffect7 } from "react";
|
|
10626
|
+
import { Fragment as Fragment7, jsx as jsx52, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
10771
10627
|
function SlashCommandItem(props) {
|
|
10772
10628
|
var _a;
|
|
10773
10629
|
const {
|
|
@@ -10790,19 +10646,19 @@ function SlashCommandItem(props) {
|
|
|
10790
10646
|
const shouldOpenTooltip = !!(item == null ? void 0 : item.preview) && (isHovered || isActive && !hoveredItemKey);
|
|
10791
10647
|
const hasRenderFunction = typeof item.render === "function";
|
|
10792
10648
|
const renderFunctionValue = hasRenderFunction ? (_a = item.render) == null ? void 0 : _a.call(item, editor) : null;
|
|
10793
|
-
let value = /* @__PURE__ */
|
|
10794
|
-
/* @__PURE__ */
|
|
10795
|
-
/* @__PURE__ */
|
|
10796
|
-
/* @__PURE__ */
|
|
10797
|
-
/* @__PURE__ */
|
|
10649
|
+
let value = /* @__PURE__ */ jsxs28(Fragment7, { children: [
|
|
10650
|
+
/* @__PURE__ */ jsx52("div", { className: "mly:flex mly:h-6 mly:w-6 mly:shrink-0 mly:items-center mly:justify-center", children: item.icon }),
|
|
10651
|
+
/* @__PURE__ */ jsxs28("div", { className: "mly:grow", children: [
|
|
10652
|
+
/* @__PURE__ */ jsx52("p", { className: "mly:font-medium", children: item.title }),
|
|
10653
|
+
/* @__PURE__ */ jsx52("p", { className: "mly:text-xs mly:text-gray-400", children: item.description })
|
|
10798
10654
|
] }),
|
|
10799
|
-
isSubCommand2 && /* @__PURE__ */
|
|
10655
|
+
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]" }) })
|
|
10800
10656
|
] });
|
|
10801
10657
|
if (renderFunctionValue !== null && renderFunctionValue !== true) {
|
|
10802
10658
|
value = renderFunctionValue;
|
|
10803
10659
|
}
|
|
10804
10660
|
const openTimerRef = useRef10(0);
|
|
10805
|
-
const handleDelayedOpen =
|
|
10661
|
+
const handleDelayedOpen = useCallback9(() => {
|
|
10806
10662
|
window.clearTimeout(openTimerRef.current);
|
|
10807
10663
|
const delay = 200;
|
|
10808
10664
|
openTimerRef.current = window.setTimeout(() => {
|
|
@@ -10827,8 +10683,8 @@ function SlashCommandItem(props) {
|
|
|
10827
10683
|
}
|
|
10828
10684
|
};
|
|
10829
10685
|
}, []);
|
|
10830
|
-
return /* @__PURE__ */
|
|
10831
|
-
/* @__PURE__ */
|
|
10686
|
+
return /* @__PURE__ */ jsxs28(Tooltip, { open, children: [
|
|
10687
|
+
/* @__PURE__ */ jsx52(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx52(
|
|
10832
10688
|
"button",
|
|
10833
10689
|
{
|
|
10834
10690
|
className: cn(
|
|
@@ -10843,14 +10699,14 @@ function SlashCommandItem(props) {
|
|
|
10843
10699
|
children: value
|
|
10844
10700
|
}
|
|
10845
10701
|
) }),
|
|
10846
|
-
/* @__PURE__ */
|
|
10702
|
+
/* @__PURE__ */ jsx52(
|
|
10847
10703
|
TooltipContent,
|
|
10848
10704
|
{
|
|
10849
10705
|
side: "right",
|
|
10850
10706
|
sideOffset: 10,
|
|
10851
10707
|
className: "mly:w-52 mly:rounded-lg mly:border-none mly:p-1 mly:shadow",
|
|
10852
|
-
children: typeof item.preview === "function" ? item == null ? void 0 : item.preview(editor) : /* @__PURE__ */
|
|
10853
|
-
/* @__PURE__ */
|
|
10708
|
+
children: typeof item.preview === "function" ? item == null ? void 0 : item.preview(editor) : /* @__PURE__ */ jsxs28(Fragment7, { children: [
|
|
10709
|
+
/* @__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(
|
|
10854
10710
|
"img",
|
|
10855
10711
|
{
|
|
10856
10712
|
src: item == null ? void 0 : item.preview,
|
|
@@ -10858,7 +10714,7 @@ function SlashCommandItem(props) {
|
|
|
10858
10714
|
className: "mly:absolute mly:inset-0 mly:h-full mly:w-full mly:object-cover"
|
|
10859
10715
|
}
|
|
10860
10716
|
) }),
|
|
10861
|
-
/* @__PURE__ */
|
|
10717
|
+
/* @__PURE__ */ jsx52("p", { className: "mly:mt-2 mly:px-0.5 mly:text-gray-500", children: item.description })
|
|
10862
10718
|
] })
|
|
10863
10719
|
}
|
|
10864
10720
|
)
|
|
@@ -10947,7 +10803,7 @@ function processCommand(options) {
|
|
|
10947
10803
|
}
|
|
10948
10804
|
|
|
10949
10805
|
// src/editor/extensions/slash-command/slash-command-view.tsx
|
|
10950
|
-
import { jsx as
|
|
10806
|
+
import { jsx as jsx53, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
10951
10807
|
var CommandList = forwardRef8((props, ref) => {
|
|
10952
10808
|
const { items: groups, command, editor, range, query } = props;
|
|
10953
10809
|
const [selectedGroupIndex, setSelectedGroupIndex] = useState11(0);
|
|
@@ -10956,7 +10812,7 @@ var CommandList = forwardRef8((props, ref) => {
|
|
|
10956
10812
|
const prevQuery = useRef11("");
|
|
10957
10813
|
const prevSelectedGroupIndex = useRef11(0);
|
|
10958
10814
|
const prevSelectedCommandIndex = useRef11(0);
|
|
10959
|
-
const selectItem =
|
|
10815
|
+
const selectItem = useCallback10(
|
|
10960
10816
|
(groupIndex, commandIndex) => {
|
|
10961
10817
|
const item = groups[groupIndex].commands[commandIndex];
|
|
10962
10818
|
if (!item) {
|
|
@@ -11085,15 +10941,15 @@ var CommandList = forwardRef8((props, ref) => {
|
|
|
11085
10941
|
if (!groups || groups.length === 0) {
|
|
11086
10942
|
return null;
|
|
11087
10943
|
}
|
|
11088
|
-
return /* @__PURE__ */
|
|
11089
|
-
/* @__PURE__ */
|
|
10944
|
+
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: [
|
|
10945
|
+
/* @__PURE__ */ jsx53(
|
|
11090
10946
|
"div",
|
|
11091
10947
|
{
|
|
11092
10948
|
id: "slash-command",
|
|
11093
10949
|
ref: commandListContainer,
|
|
11094
10950
|
className: "mly:no-scrollbar mly:h-auto mly:max-h-[330px] mly:overflow-y-auto",
|
|
11095
|
-
children: groups.map((group, groupIndex) => /* @__PURE__ */
|
|
11096
|
-
/* @__PURE__ */
|
|
10951
|
+
children: groups.map((group, groupIndex) => /* @__PURE__ */ jsxs29(Fragment8, { children: [
|
|
10952
|
+
/* @__PURE__ */ jsx53(
|
|
11097
10953
|
"span",
|
|
11098
10954
|
{
|
|
11099
10955
|
className: cn(
|
|
@@ -11103,9 +10959,9 @@ var CommandList = forwardRef8((props, ref) => {
|
|
|
11103
10959
|
children: group.title
|
|
11104
10960
|
}
|
|
11105
10961
|
),
|
|
11106
|
-
/* @__PURE__ */
|
|
10962
|
+
/* @__PURE__ */ jsx53("div", { className: "mly:space-y-0.5 mly:p-1", children: group.commands.map((item, commandIndex) => {
|
|
11107
10963
|
const itemKey = `${groupIndex}-${commandIndex}`;
|
|
11108
|
-
return /* @__PURE__ */
|
|
10964
|
+
return /* @__PURE__ */ jsx53(
|
|
11109
10965
|
SlashCommandItem,
|
|
11110
10966
|
{
|
|
11111
10967
|
item,
|
|
@@ -11125,16 +10981,16 @@ var CommandList = forwardRef8((props, ref) => {
|
|
|
11125
10981
|
] }, groupIndex))
|
|
11126
10982
|
}
|
|
11127
10983
|
),
|
|
11128
|
-
/* @__PURE__ */
|
|
11129
|
-
/* @__PURE__ */
|
|
11130
|
-
/* @__PURE__ */
|
|
11131
|
-
/* @__PURE__ */
|
|
10984
|
+
/* @__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: [
|
|
10985
|
+
/* @__PURE__ */ jsxs29("p", { className: "mly:text-center mly:text-xs mly:text-gray-400", children: [
|
|
10986
|
+
/* @__PURE__ */ jsx53("kbd", { className: "mly:rounded mly:border mly:border-gray-200 mly:p-1 mly:px-2 mly:font-medium", children: "\u2191" }),
|
|
10987
|
+
/* @__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" }),
|
|
11132
10988
|
" ",
|
|
11133
10989
|
"to navigate"
|
|
11134
10990
|
] }),
|
|
11135
|
-
/* @__PURE__ */
|
|
11136
|
-
/* @__PURE__ */
|
|
11137
|
-
/* @__PURE__ */
|
|
10991
|
+
/* @__PURE__ */ jsx53("span", { "aria-hidden": "true", className: "mly:select-none mly:px-1", children: "\xB7" }),
|
|
10992
|
+
/* @__PURE__ */ jsxs29("p", { className: "mly:text-center mly:text-xs mly:text-gray-400", children: [
|
|
10993
|
+
/* @__PURE__ */ jsx53("kbd", { className: "mly:rounded mly:border mly:border-gray-200 mly:p-1 mly:px-1.5 mly:font-medium", children: "Enter" }),
|
|
11138
10994
|
" ",
|
|
11139
10995
|
"to select"
|
|
11140
10996
|
] })
|
|
@@ -11214,7 +11070,7 @@ function getSlashCommandSuggestions(groups = DEFAULT_SLASH_COMMANDS) {
|
|
|
11214
11070
|
import { ReactRenderer as ReactRenderer2 } from "@tiptap/react";
|
|
11215
11071
|
import { forwardRef as forwardRef9, useImperativeHandle as useImperativeHandle3, useRef as useRef12 } from "react";
|
|
11216
11072
|
import tippy3 from "tippy.js";
|
|
11217
|
-
import { jsx as
|
|
11073
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
11218
11074
|
var VariableList = forwardRef9((props, ref) => {
|
|
11219
11075
|
var _a;
|
|
11220
11076
|
const { items = [], editor } = props;
|
|
@@ -11243,7 +11099,7 @@ var VariableList = forwardRef9((props, ref) => {
|
|
|
11243
11099
|
return false;
|
|
11244
11100
|
}
|
|
11245
11101
|
}));
|
|
11246
|
-
return /* @__PURE__ */
|
|
11102
|
+
return /* @__PURE__ */ jsx54(
|
|
11247
11103
|
VariableSuggestionPopoverComponent,
|
|
11248
11104
|
{
|
|
11249
11105
|
items,
|
|
@@ -11427,7 +11283,7 @@ var isCustomNodeSelected = (editor, node) => {
|
|
|
11427
11283
|
};
|
|
11428
11284
|
|
|
11429
11285
|
// src/editor/components/text-menu/text-bubble-menu.tsx
|
|
11430
|
-
import { BubbleMenu as
|
|
11286
|
+
import { BubbleMenu as BubbleMenu7 } from "@tiptap/react";
|
|
11431
11287
|
|
|
11432
11288
|
// src/editor/components/text-menu/text-bubble-content.tsx
|
|
11433
11289
|
import {
|
|
@@ -11441,11 +11297,11 @@ import {
|
|
|
11441
11297
|
} from "lucide-react";
|
|
11442
11298
|
|
|
11443
11299
|
// src/editor/components/text-menu/use-text-menu-state.tsx
|
|
11444
|
-
import { useEditorState as
|
|
11445
|
-
import
|
|
11300
|
+
import { useEditorState as useEditorState7 } from "@tiptap/react";
|
|
11301
|
+
import deepEql7 from "fast-deep-equal";
|
|
11446
11302
|
var DEFAULT_TEXT_COLOR = "#374151";
|
|
11447
11303
|
var useTextMenuState = (editor) => {
|
|
11448
|
-
const states =
|
|
11304
|
+
const states = useEditorState7({
|
|
11449
11305
|
editor,
|
|
11450
11306
|
selector: (ctx) => {
|
|
11451
11307
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -11461,13 +11317,13 @@ var useTextMenuState = (editor) => {
|
|
|
11461
11317
|
paragraphShowIfKey: ((_h = ctx.editor.getAttributes("paragraph")) == null ? void 0 : _h.showIfKey) || ""
|
|
11462
11318
|
};
|
|
11463
11319
|
},
|
|
11464
|
-
equalityFn:
|
|
11320
|
+
equalityFn: deepEql7
|
|
11465
11321
|
});
|
|
11466
11322
|
return states;
|
|
11467
11323
|
};
|
|
11468
11324
|
|
|
11469
11325
|
// src/editor/components/text-menu/text-bubble-content.tsx
|
|
11470
|
-
import { Fragment as Fragment9, jsx as
|
|
11326
|
+
import { Fragment as Fragment9, jsx as jsx55, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
11471
11327
|
function TextBubbleContent(props) {
|
|
11472
11328
|
var _a, _b, _c, _d;
|
|
11473
11329
|
const { editor, showListMenu = true } = props;
|
|
@@ -11511,9 +11367,9 @@ function TextBubbleContent(props) {
|
|
|
11511
11367
|
tooltip: "Code"
|
|
11512
11368
|
}
|
|
11513
11369
|
];
|
|
11514
|
-
return /* @__PURE__ */
|
|
11515
|
-
items.map((item, index) => /* @__PURE__ */
|
|
11516
|
-
/* @__PURE__ */
|
|
11370
|
+
return /* @__PURE__ */ jsxs30(Fragment9, { children: [
|
|
11371
|
+
items.map((item, index) => /* @__PURE__ */ jsx55(BubbleMenuButton, __spreadValues({}, item), index)),
|
|
11372
|
+
/* @__PURE__ */ jsx55(
|
|
11517
11373
|
AlignmentSwitch,
|
|
11518
11374
|
{
|
|
11519
11375
|
alignment: state.textAlign,
|
|
@@ -11522,8 +11378,8 @@ function TextBubbleContent(props) {
|
|
|
11522
11378
|
}
|
|
11523
11379
|
}
|
|
11524
11380
|
),
|
|
11525
|
-
!state.isListActive && showListMenu && /* @__PURE__ */
|
|
11526
|
-
/* @__PURE__ */
|
|
11381
|
+
!state.isListActive && showListMenu && /* @__PURE__ */ jsxs30(Fragment9, { children: [
|
|
11382
|
+
/* @__PURE__ */ jsx55(
|
|
11527
11383
|
BubbleMenuButton,
|
|
11528
11384
|
{
|
|
11529
11385
|
icon: List2,
|
|
@@ -11533,7 +11389,7 @@ function TextBubbleContent(props) {
|
|
|
11533
11389
|
tooltip: "Bullet List"
|
|
11534
11390
|
}
|
|
11535
11391
|
),
|
|
11536
|
-
/* @__PURE__ */
|
|
11392
|
+
/* @__PURE__ */ jsx55(
|
|
11537
11393
|
BubbleMenuButton,
|
|
11538
11394
|
{
|
|
11539
11395
|
icon: ListOrdered2,
|
|
@@ -11544,7 +11400,7 @@ function TextBubbleContent(props) {
|
|
|
11544
11400
|
}
|
|
11545
11401
|
)
|
|
11546
11402
|
] }),
|
|
11547
|
-
/* @__PURE__ */
|
|
11403
|
+
/* @__PURE__ */ jsx55(
|
|
11548
11404
|
LinkInputPopover,
|
|
11549
11405
|
{
|
|
11550
11406
|
defaultValue: (_d = state == null ? void 0 : state.linkUrl) != null ? _d : "",
|
|
@@ -11560,8 +11416,8 @@ function TextBubbleContent(props) {
|
|
|
11560
11416
|
isVariable: state.isUrlVariable
|
|
11561
11417
|
}
|
|
11562
11418
|
),
|
|
11563
|
-
/* @__PURE__ */
|
|
11564
|
-
/* @__PURE__ */
|
|
11419
|
+
/* @__PURE__ */ jsx55(Divider, {}),
|
|
11420
|
+
/* @__PURE__ */ jsx55(
|
|
11565
11421
|
ColorPicker,
|
|
11566
11422
|
{
|
|
11567
11423
|
color: state.currentTextColor,
|
|
@@ -11570,16 +11426,16 @@ function TextBubbleContent(props) {
|
|
|
11570
11426
|
},
|
|
11571
11427
|
tooltip: "Text Color",
|
|
11572
11428
|
suggestedColors,
|
|
11573
|
-
children: /* @__PURE__ */
|
|
11429
|
+
children: /* @__PURE__ */ jsx55(
|
|
11574
11430
|
BaseButton,
|
|
11575
11431
|
{
|
|
11576
11432
|
variant: "ghost",
|
|
11577
11433
|
size: "sm",
|
|
11578
11434
|
type: "button",
|
|
11579
11435
|
className: "mly:h-7 mly:w-7 mly:shrink-0 mly:p-0",
|
|
11580
|
-
children: /* @__PURE__ */
|
|
11581
|
-
/* @__PURE__ */
|
|
11582
|
-
/* @__PURE__ */
|
|
11436
|
+
children: /* @__PURE__ */ jsxs30("div", { className: "mly:flex mly:flex-col mly:items-center mly:justify-center mly:gap-px", children: [
|
|
11437
|
+
/* @__PURE__ */ jsx55("span", { className: "mly:font-bolder mly:font-mono mly:text-xs mly:text-slate-700", children: "A" }),
|
|
11438
|
+
/* @__PURE__ */ jsx55(
|
|
11583
11439
|
"div",
|
|
11584
11440
|
{
|
|
11585
11441
|
className: "mly:h-[2px] mly:w-3",
|
|
@@ -11596,34 +11452,41 @@ function TextBubbleContent(props) {
|
|
|
11596
11452
|
|
|
11597
11453
|
// src/editor/components/text-menu/turn-into-block.tsx
|
|
11598
11454
|
import { ChevronDownIcon as ChevronDownIcon2, PilcrowIcon } from "lucide-react";
|
|
11599
|
-
import { useMemo as
|
|
11600
|
-
import { jsx as
|
|
11455
|
+
import { useMemo as useMemo11 } from "react";
|
|
11456
|
+
import { jsx as jsx56, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
11601
11457
|
var isOption = (option) => option.type === "option";
|
|
11602
11458
|
var isCategory = (option) => option.type === "category";
|
|
11603
11459
|
function TurnIntoBlock(props) {
|
|
11604
11460
|
const { options } = props;
|
|
11605
|
-
const activeItem =
|
|
11461
|
+
const activeItem = useMemo11(
|
|
11606
11462
|
() => options.find((option) => option.type === "option" && option.isActive()),
|
|
11607
11463
|
[options]
|
|
11608
11464
|
);
|
|
11609
11465
|
const { icon: ActiveIcon = PilcrowIcon } = activeItem || {};
|
|
11610
|
-
return /* @__PURE__ */
|
|
11611
|
-
/* @__PURE__ */
|
|
11612
|
-
/* @__PURE__ */
|
|
11466
|
+
return /* @__PURE__ */ jsxs31(Popover, { children: [
|
|
11467
|
+
/* @__PURE__ */ jsxs31(Tooltip, { children: [
|
|
11468
|
+
/* @__PURE__ */ jsx56(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs31(
|
|
11613
11469
|
PopoverTrigger,
|
|
11614
11470
|
{
|
|
11615
11471
|
className: cn(
|
|
11616
11472
|
"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"
|
|
11617
11473
|
),
|
|
11618
11474
|
children: [
|
|
11619
|
-
/* @__PURE__ */
|
|
11620
|
-
/* @__PURE__ */
|
|
11475
|
+
/* @__PURE__ */ jsx56(ActiveIcon, { className: "mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5]" }),
|
|
11476
|
+
/* @__PURE__ */ jsx56(ChevronDownIcon2, { className: "mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5]" })
|
|
11621
11477
|
]
|
|
11622
11478
|
}
|
|
11623
11479
|
) }),
|
|
11624
|
-
/* @__PURE__ */
|
|
11480
|
+
/* @__PURE__ */ jsx56(
|
|
11481
|
+
TooltipContent,
|
|
11482
|
+
{
|
|
11483
|
+
sideOffset: 8,
|
|
11484
|
+
className: "mly:border-gray-300 mly:bg-transparent mly:p-0 mly:text-gray-700 mly:shadow-sm",
|
|
11485
|
+
children: /* @__PURE__ */ jsx56("span", { className: "mly:block mly:rounded-md mly:bg-soft-gray mly:!px-2 mly:!py-1.5", children: "Turn into" })
|
|
11486
|
+
}
|
|
11487
|
+
)
|
|
11625
11488
|
] }),
|
|
11626
|
-
/* @__PURE__ */
|
|
11489
|
+
/* @__PURE__ */ jsx56(
|
|
11627
11490
|
PopoverContent,
|
|
11628
11491
|
{
|
|
11629
11492
|
align: "start",
|
|
@@ -11632,21 +11495,21 @@ function TurnIntoBlock(props) {
|
|
|
11632
11495
|
className: "mly:flex mly:w-[160px] mly:flex-col mly:rounded-md mly:p-1",
|
|
11633
11496
|
children: options.map((option, index) => {
|
|
11634
11497
|
if (isOption(option)) {
|
|
11635
|
-
return /* @__PURE__ */
|
|
11498
|
+
return /* @__PURE__ */ jsxs31(
|
|
11636
11499
|
BaseButton,
|
|
11637
11500
|
{
|
|
11638
11501
|
onClick: option.onClick,
|
|
11639
11502
|
variant: "ghost",
|
|
11640
11503
|
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",
|
|
11641
11504
|
children: [
|
|
11642
|
-
/* @__PURE__ */
|
|
11505
|
+
/* @__PURE__ */ jsx56(option.icon, { className: "mly:size-[15px] mly:shrink-0" }),
|
|
11643
11506
|
option.label
|
|
11644
11507
|
]
|
|
11645
11508
|
},
|
|
11646
11509
|
option.id
|
|
11647
11510
|
);
|
|
11648
11511
|
} else if (isCategory(option)) {
|
|
11649
|
-
return /* @__PURE__ */
|
|
11512
|
+
return /* @__PURE__ */ jsx56(
|
|
11650
11513
|
"label",
|
|
11651
11514
|
{
|
|
11652
11515
|
className: cn(
|
|
@@ -11665,7 +11528,7 @@ function TurnIntoBlock(props) {
|
|
|
11665
11528
|
}
|
|
11666
11529
|
|
|
11667
11530
|
// src/editor/components/text-menu/use-turn-into-block-options.tsx
|
|
11668
|
-
import { useEditorState as
|
|
11531
|
+
import { useEditorState as useEditorState8 } from "@tiptap/react";
|
|
11669
11532
|
import {
|
|
11670
11533
|
Heading1Icon,
|
|
11671
11534
|
Heading2Icon,
|
|
@@ -11675,7 +11538,7 @@ import {
|
|
|
11675
11538
|
PilcrowIcon as PilcrowIcon2
|
|
11676
11539
|
} from "lucide-react";
|
|
11677
11540
|
function useTurnIntoBlockOptions(editor) {
|
|
11678
|
-
return
|
|
11541
|
+
return useEditorState8({
|
|
11679
11542
|
editor,
|
|
11680
11543
|
selector: ({ editor: editor2 }) => [
|
|
11681
11544
|
{
|
|
@@ -11747,7 +11610,7 @@ function useTurnIntoBlockOptions(editor) {
|
|
|
11747
11610
|
}
|
|
11748
11611
|
|
|
11749
11612
|
// src/editor/components/text-menu/text-bubble-menu.tsx
|
|
11750
|
-
import { jsx as
|
|
11613
|
+
import { jsx as jsx57, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
11751
11614
|
function TextBubbleMenu(props) {
|
|
11752
11615
|
const { editor, appendTo } = props;
|
|
11753
11616
|
if (!editor) {
|
|
@@ -11798,23 +11661,23 @@ function TextBubbleMenu(props) {
|
|
|
11798
11661
|
}
|
|
11799
11662
|
});
|
|
11800
11663
|
const turnIntoBlockOptions = useTurnIntoBlockOptions(editor);
|
|
11801
|
-
return /* @__PURE__ */
|
|
11802
|
-
|
|
11664
|
+
return /* @__PURE__ */ jsx57(
|
|
11665
|
+
BubbleMenu7,
|
|
11803
11666
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
11804
11667
|
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",
|
|
11805
|
-
children: /* @__PURE__ */
|
|
11806
|
-
/* @__PURE__ */
|
|
11807
|
-
/* @__PURE__ */
|
|
11808
|
-
/* @__PURE__ */
|
|
11668
|
+
children: /* @__PURE__ */ jsxs32(TooltipProvider, { children: [
|
|
11669
|
+
/* @__PURE__ */ jsx57(TurnIntoBlock, { options: turnIntoBlockOptions }),
|
|
11670
|
+
/* @__PURE__ */ jsx57(Divider, { className: "mly:mx-0" }),
|
|
11671
|
+
/* @__PURE__ */ jsx57(TextBubbleContent, { editor })
|
|
11809
11672
|
] })
|
|
11810
11673
|
})
|
|
11811
11674
|
);
|
|
11812
11675
|
}
|
|
11813
11676
|
|
|
11814
11677
|
// src/editor/components/variable-menu/variable-bubble-menu.tsx
|
|
11815
|
-
import { BubbleMenu as
|
|
11816
|
-
import { sticky as
|
|
11817
|
-
import { jsx as
|
|
11678
|
+
import { BubbleMenu as BubbleMenu8 } from "@tiptap/react";
|
|
11679
|
+
import { sticky as sticky6 } from "tippy.js";
|
|
11680
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
11818
11681
|
function VariableBubbleMenu(props) {
|
|
11819
11682
|
const { editor, appendTo } = props;
|
|
11820
11683
|
if (!editor) {
|
|
@@ -11830,18 +11693,18 @@ function VariableBubbleMenu(props) {
|
|
|
11830
11693
|
popperOptions: {
|
|
11831
11694
|
modifiers: [{ name: "flip", enabled: false }]
|
|
11832
11695
|
},
|
|
11833
|
-
plugins: [
|
|
11696
|
+
plugins: [sticky6],
|
|
11834
11697
|
sticky: "popper",
|
|
11835
11698
|
maxWidth: "100%",
|
|
11836
11699
|
appendTo: () => (appendTo == null ? void 0 : appendTo.current) || "parent",
|
|
11837
11700
|
placement: "top-start"
|
|
11838
11701
|
}
|
|
11839
11702
|
});
|
|
11840
|
-
return /* @__PURE__ */
|
|
11841
|
-
|
|
11703
|
+
return /* @__PURE__ */ jsx58(
|
|
11704
|
+
BubbleMenu8,
|
|
11842
11705
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
11843
11706
|
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",
|
|
11844
|
-
children: /* @__PURE__ */
|
|
11707
|
+
children: /* @__PURE__ */ jsx58(TooltipProvider, { children: /* @__PURE__ */ jsx58(TextBubbleContent, { showListMenu: false, editor }) })
|
|
11845
11708
|
})
|
|
11846
11709
|
);
|
|
11847
11710
|
}
|
|
@@ -11927,8 +11790,8 @@ function replaceDeprecatedNode(json) {
|
|
|
11927
11790
|
}
|
|
11928
11791
|
|
|
11929
11792
|
// src/editor/index.tsx
|
|
11930
|
-
import { jsx as
|
|
11931
|
-
function
|
|
11793
|
+
import { jsx as jsx59, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
11794
|
+
function Editor12(props) {
|
|
11932
11795
|
const {
|
|
11933
11796
|
config: {
|
|
11934
11797
|
wrapClassName = "",
|
|
@@ -11951,7 +11814,7 @@ function Editor13(props) {
|
|
|
11951
11814
|
scrollThreshold = 40,
|
|
11952
11815
|
scrollMargin = 40
|
|
11953
11816
|
} = props;
|
|
11954
|
-
const formattedContent =
|
|
11817
|
+
const formattedContent = useMemo12(() => {
|
|
11955
11818
|
if (contentJson) {
|
|
11956
11819
|
const json = (contentJson == null ? void 0 : contentJson.type) === "doc" ? contentJson : {
|
|
11957
11820
|
type: "doc",
|
|
@@ -12000,7 +11863,7 @@ function Editor13(props) {
|
|
|
12000
11863
|
if (!editor) {
|
|
12001
11864
|
return null;
|
|
12002
11865
|
}
|
|
12003
|
-
return /* @__PURE__ */
|
|
11866
|
+
return /* @__PURE__ */ jsx59(MailyProvider, { placeholderUrl, children: /* @__PURE__ */ jsxs33(
|
|
12004
11867
|
"div",
|
|
12005
11868
|
{
|
|
12006
11869
|
id: "mly-editor",
|
|
@@ -12011,8 +11874,8 @@ function Editor13(props) {
|
|
|
12011
11874
|
),
|
|
12012
11875
|
ref: menuContainerRef,
|
|
12013
11876
|
children: [
|
|
12014
|
-
hasMenuBar && /* @__PURE__ */
|
|
12015
|
-
/* @__PURE__ */
|
|
11877
|
+
hasMenuBar && /* @__PURE__ */ jsx59(EditorMenuBar, { config: props.config, editor }),
|
|
11878
|
+
/* @__PURE__ */ jsxs33(
|
|
12016
11879
|
"div",
|
|
12017
11880
|
{
|
|
12018
11881
|
className: cn(
|
|
@@ -12020,17 +11883,16 @@ function Editor13(props) {
|
|
|
12020
11883
|
bodyClassName
|
|
12021
11884
|
),
|
|
12022
11885
|
children: [
|
|
12023
|
-
/* @__PURE__ */
|
|
12024
|
-
/* @__PURE__ */
|
|
12025
|
-
/* @__PURE__ */
|
|
12026
|
-
/* @__PURE__ */
|
|
12027
|
-
/* @__PURE__ */
|
|
12028
|
-
/* @__PURE__ */
|
|
12029
|
-
!hideContextMenu && /* @__PURE__ */
|
|
12030
|
-
/* @__PURE__ */
|
|
12031
|
-
/* @__PURE__ */
|
|
12032
|
-
/* @__PURE__ */
|
|
12033
|
-
/* @__PURE__ */ jsx60(InlineImageBubbleMenu, { editor, appendTo: menuContainerRef })
|
|
11886
|
+
/* @__PURE__ */ jsx59(TextBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
11887
|
+
/* @__PURE__ */ jsx59(ImageBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
11888
|
+
/* @__PURE__ */ jsx59(SpacerBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
11889
|
+
/* @__PURE__ */ jsx59(EditorContent, { editor }),
|
|
11890
|
+
/* @__PURE__ */ jsx59(SectionBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
11891
|
+
/* @__PURE__ */ jsx59(ColumnsBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
11892
|
+
!hideContextMenu && /* @__PURE__ */ jsx59(ContentMenu, { editor }),
|
|
11893
|
+
/* @__PURE__ */ jsx59(VariableBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
11894
|
+
/* @__PURE__ */ jsx59(RepeatBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
11895
|
+
/* @__PURE__ */ jsx59(InlineImageBubbleMenu, { editor, appendTo: menuContainerRef })
|
|
12034
11896
|
]
|
|
12035
11897
|
}
|
|
12036
11898
|
)
|
|
@@ -12039,6 +11901,6 @@ function Editor13(props) {
|
|
|
12039
11901
|
) });
|
|
12040
11902
|
}
|
|
12041
11903
|
export {
|
|
12042
|
-
|
|
11904
|
+
Editor12 as Editor
|
|
12043
11905
|
};
|
|
12044
11906
|
//# sourceMappingURL=index.mjs.map
|