@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.cjs
CHANGED
|
@@ -80,13 +80,13 @@ var __async = (__this, __arguments, generator) => {
|
|
|
80
80
|
// src/index.ts
|
|
81
81
|
var src_exports = {};
|
|
82
82
|
__export(src_exports, {
|
|
83
|
-
Editor: () =>
|
|
83
|
+
Editor: () => Editor12
|
|
84
84
|
});
|
|
85
85
|
module.exports = __toCommonJS(src_exports);
|
|
86
86
|
|
|
87
87
|
// src/editor/index.tsx
|
|
88
|
-
var
|
|
89
|
-
var
|
|
88
|
+
var import_react62 = require("@tiptap/react");
|
|
89
|
+
var import_react63 = require("react");
|
|
90
90
|
|
|
91
91
|
// src/editor/components/column-menu/columns-bubble-menu.tsx
|
|
92
92
|
var import_react8 = require("@tiptap/react");
|
|
@@ -3586,7 +3586,14 @@ function BubbleMenuButton(item) {
|
|
|
3586
3586
|
if (tooltip) {
|
|
3587
3587
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Tooltip, { children: [
|
|
3588
3588
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TooltipTrigger, { asChild: true, children: content }),
|
|
3589
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3589
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
3590
|
+
TooltipContent,
|
|
3591
|
+
{
|
|
3592
|
+
sideOffset: 8,
|
|
3593
|
+
className: "mly:border-gray-300 mly:bg-transparent mly:p-0 mly:text-gray-700 mly:shadow-sm",
|
|
3594
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "mly:block mly:rounded-md mly:bg-soft-gray mly:!px-2 mly:!py-1.5", children: tooltip })
|
|
3595
|
+
}
|
|
3596
|
+
)
|
|
3590
3597
|
] });
|
|
3591
3598
|
}
|
|
3592
3599
|
return content;
|
|
@@ -4114,7 +4121,14 @@ function Select(props) {
|
|
|
4114
4121
|
}
|
|
4115
4122
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Tooltip, { children: [
|
|
4116
4123
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TooltipTrigger, { asChild: true, children: content }),
|
|
4117
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4124
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4125
|
+
TooltipContent,
|
|
4126
|
+
{
|
|
4127
|
+
sideOffset: 8,
|
|
4128
|
+
className: "mly:border-gray-300 mly:bg-transparent mly:p-0 mly:text-gray-700 mly:shadow-sm",
|
|
4129
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "mly:block mly:rounded-md mly:bg-soft-gray mly:!px-2 mly:!py-1.5", children: tooltip })
|
|
4130
|
+
}
|
|
4131
|
+
)
|
|
4118
4132
|
] });
|
|
4119
4133
|
}
|
|
4120
4134
|
|
|
@@ -5007,129 +5021,9 @@ var EditorMenuBar = (props) => {
|
|
|
5007
5021
|
);
|
|
5008
5022
|
};
|
|
5009
5023
|
|
|
5010
|
-
// src/editor/components/html-menu/html-menu.tsx
|
|
5011
|
-
var import_react14 = require("@tiptap/react");
|
|
5012
|
-
var import_lucide_react9 = require("lucide-react");
|
|
5013
|
-
var import_react15 = require("react");
|
|
5014
|
-
var import_tippy3 = require("tippy.js");
|
|
5015
|
-
|
|
5016
|
-
// src/editor/components/html-menu/use-html-state.ts
|
|
5017
|
-
var import_react13 = require("@tiptap/react");
|
|
5018
|
-
var import_fast_deep_equal2 = __toESM(require("fast-deep-equal"), 1);
|
|
5019
|
-
var useHtmlState = (editor) => {
|
|
5020
|
-
const states = (0, import_react13.useEditorState)({
|
|
5021
|
-
editor,
|
|
5022
|
-
selector: (ctx) => {
|
|
5023
|
-
var _a, _b;
|
|
5024
|
-
return {
|
|
5025
|
-
activeTab: ((_a = ctx.editor.getAttributes("htmlCodeBlock")) == null ? void 0 : _a.activeTab) || "code",
|
|
5026
|
-
currentShowIfKey: ((_b = ctx.editor.getAttributes("htmlCodeBlock")) == null ? void 0 : _b.showIfKey) || ""
|
|
5027
|
-
};
|
|
5028
|
-
},
|
|
5029
|
-
equalityFn: import_fast_deep_equal2.default
|
|
5030
|
-
});
|
|
5031
|
-
return states;
|
|
5032
|
-
};
|
|
5033
|
-
|
|
5034
|
-
// src/editor/components/html-menu/html-menu.tsx
|
|
5035
|
-
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
5036
|
-
function HTMLBubbleMenu(props) {
|
|
5037
|
-
const { appendTo, editor } = props;
|
|
5038
|
-
if (!editor) {
|
|
5039
|
-
return null;
|
|
5040
|
-
}
|
|
5041
|
-
const state = useHtmlState(editor);
|
|
5042
|
-
const getReferenceClientRect = (0, import_react15.useCallback)(() => {
|
|
5043
|
-
const renderContainer = getRenderContainer(editor, "htmlCodeBlock");
|
|
5044
|
-
const rect = (renderContainer == null ? void 0 : renderContainer.getBoundingClientRect()) || new DOMRect(-1e3, -1e3, 0, 0);
|
|
5045
|
-
return rect;
|
|
5046
|
-
}, [editor]);
|
|
5047
|
-
const bubbleMenuProps = __spreadProps(__spreadValues(__spreadValues({}, props), appendTo ? { appendTo: appendTo.current } : {}), {
|
|
5048
|
-
shouldShow: ({ editor: editor2 }) => {
|
|
5049
|
-
return editor2.isActive("htmlCodeBlock");
|
|
5050
|
-
},
|
|
5051
|
-
tippyOptions: {
|
|
5052
|
-
offset: [0, 8],
|
|
5053
|
-
popperOptions: {
|
|
5054
|
-
modifiers: [{ name: "flip", enabled: false }]
|
|
5055
|
-
},
|
|
5056
|
-
getReferenceClientRect,
|
|
5057
|
-
appendTo: () => appendTo == null ? void 0 : appendTo.current,
|
|
5058
|
-
plugins: [import_tippy3.sticky],
|
|
5059
|
-
sticky: "popper",
|
|
5060
|
-
maxWidth: "auto"
|
|
5061
|
-
},
|
|
5062
|
-
pluginKey: "htmlCodeBlockBubbleMenu"
|
|
5063
|
-
});
|
|
5064
|
-
const { activeTab = "code" } = state;
|
|
5065
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5066
|
-
import_react14.BubbleMenu,
|
|
5067
|
-
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
5068
|
-
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",
|
|
5069
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(TooltipProvider, { children: [
|
|
5070
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "mly:flex mly:items-center mly:h-7 mly:rounded-md mly:bg-soft-gray mly:px-0.5", children: [
|
|
5071
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Tooltip, { children: [
|
|
5072
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5073
|
-
"button",
|
|
5074
|
-
{
|
|
5075
|
-
className: cn(
|
|
5076
|
-
"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",
|
|
5077
|
-
activeTab === "code" && "mly:bg-white"
|
|
5078
|
-
),
|
|
5079
|
-
disabled: activeTab === "code",
|
|
5080
|
-
onClick: () => {
|
|
5081
|
-
var _a;
|
|
5082
|
-
(_a = editor == null ? void 0 : editor.commands) == null ? void 0 : _a.updateHtmlCodeBlock({
|
|
5083
|
-
activeTab: "code"
|
|
5084
|
-
});
|
|
5085
|
-
},
|
|
5086
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react9.CodeXmlIcon, { className: "mly:size-3 mly:shrink-0 mly:stroke-[2.5]" })
|
|
5087
|
-
}
|
|
5088
|
-
) }),
|
|
5089
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(TooltipContent, { sideOffset: 8, children: "HTML Code" })
|
|
5090
|
-
] }),
|
|
5091
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Tooltip, { children: [
|
|
5092
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5093
|
-
"button",
|
|
5094
|
-
{
|
|
5095
|
-
className: cn(
|
|
5096
|
-
"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",
|
|
5097
|
-
activeTab === "preview" && "mly:bg-white"
|
|
5098
|
-
),
|
|
5099
|
-
disabled: activeTab === "preview",
|
|
5100
|
-
onClick: () => {
|
|
5101
|
-
var _a;
|
|
5102
|
-
(_a = editor == null ? void 0 : editor.commands) == null ? void 0 : _a.updateHtmlCodeBlock({
|
|
5103
|
-
activeTab: "preview"
|
|
5104
|
-
});
|
|
5105
|
-
},
|
|
5106
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react9.ViewIcon, { className: "mly:size-3 mly:shrink-0 mly:stroke-[2.5]" })
|
|
5107
|
-
}
|
|
5108
|
-
) }),
|
|
5109
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(TooltipContent, { sideOffset: 8, children: "Preview" })
|
|
5110
|
-
] })
|
|
5111
|
-
] }),
|
|
5112
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Divider, {}),
|
|
5113
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5114
|
-
ShowPopover,
|
|
5115
|
-
{
|
|
5116
|
-
showIfKey: state.currentShowIfKey,
|
|
5117
|
-
onShowIfKeyValueChange: (value) => {
|
|
5118
|
-
editor.commands.updateHtmlCodeBlock({
|
|
5119
|
-
showIfKey: value
|
|
5120
|
-
});
|
|
5121
|
-
},
|
|
5122
|
-
editor
|
|
5123
|
-
}
|
|
5124
|
-
)
|
|
5125
|
-
] })
|
|
5126
|
-
})
|
|
5127
|
-
);
|
|
5128
|
-
}
|
|
5129
|
-
|
|
5130
5024
|
// src/editor/nodes/logo/logo.ts
|
|
5131
5025
|
var import_extension_image = __toESM(require("@tiptap/extension-image"), 1);
|
|
5132
|
-
var
|
|
5026
|
+
var import_react20 = require("@tiptap/react");
|
|
5133
5027
|
|
|
5134
5028
|
// src/editor/nodes/section/section.ts
|
|
5135
5029
|
var import_core5 = require("@tiptap/core");
|
|
@@ -5430,14 +5324,14 @@ var SectionExtension = import_core5.Node.create({
|
|
|
5430
5324
|
});
|
|
5431
5325
|
|
|
5432
5326
|
// src/editor/nodes/logo/logo-view.tsx
|
|
5433
|
-
var
|
|
5434
|
-
var
|
|
5435
|
-
var
|
|
5327
|
+
var import_react17 = require("@tiptap/react");
|
|
5328
|
+
var import_react18 = require("react");
|
|
5329
|
+
var import_react19 = require("react");
|
|
5436
5330
|
|
|
5437
5331
|
// src/editor/nodes/image/image-view.tsx
|
|
5438
|
-
var
|
|
5439
|
-
var
|
|
5440
|
-
var
|
|
5332
|
+
var import_react15 = require("react");
|
|
5333
|
+
var import_react16 = require("@tiptap/react");
|
|
5334
|
+
var import_lucide_react9 = require("lucide-react");
|
|
5441
5335
|
|
|
5442
5336
|
// src/editor/plugins/image-upload/image-upload-plugin.ts
|
|
5443
5337
|
var import_state3 = require("@tiptap/pm/state");
|
|
@@ -5531,7 +5425,7 @@ function ImageUploadPlugin(options) {
|
|
|
5531
5425
|
|
|
5532
5426
|
// src/editor/extensions/image-upload/image-upload.ts
|
|
5533
5427
|
var import_core6 = require("@tiptap/core");
|
|
5534
|
-
var
|
|
5428
|
+
var import_react13 = require("react");
|
|
5535
5429
|
var ImageUploadExtension = import_core6.Extension.create({
|
|
5536
5430
|
name: "imageUpload",
|
|
5537
5431
|
addOptions() {
|
|
@@ -5566,7 +5460,7 @@ var ImageUploadExtension = import_core6.Extension.create({
|
|
|
5566
5460
|
}
|
|
5567
5461
|
});
|
|
5568
5462
|
function useImageUploadOptions(editor) {
|
|
5569
|
-
return (0,
|
|
5463
|
+
return (0, import_react13.useMemo)(() => {
|
|
5570
5464
|
const node = editor.extensionManager.extensions.find(
|
|
5571
5465
|
(extension) => extension.name === "imageUpload"
|
|
5572
5466
|
);
|
|
@@ -5575,13 +5469,13 @@ function useImageUploadOptions(editor) {
|
|
|
5575
5469
|
}
|
|
5576
5470
|
|
|
5577
5471
|
// src/editor/utils/use-event.ts
|
|
5578
|
-
var
|
|
5472
|
+
var import_react14 = require("react");
|
|
5579
5473
|
var useEvent = (handler) => {
|
|
5580
|
-
const handlerRef = (0,
|
|
5581
|
-
(0,
|
|
5474
|
+
const handlerRef = (0, import_react14.useRef)(null);
|
|
5475
|
+
(0, import_react14.useLayoutEffect)(() => {
|
|
5582
5476
|
handlerRef.current = handler;
|
|
5583
5477
|
}, [handler]);
|
|
5584
|
-
return (0,
|
|
5478
|
+
return (0, import_react14.useCallback)((...args) => {
|
|
5585
5479
|
if (handlerRef.current === null) {
|
|
5586
5480
|
throw new Error("Handler is not assigned");
|
|
5587
5481
|
}
|
|
@@ -5604,19 +5498,19 @@ function getNewWidth(height, aspectRatio) {
|
|
|
5604
5498
|
}
|
|
5605
5499
|
|
|
5606
5500
|
// src/editor/nodes/image/image-view.tsx
|
|
5607
|
-
var
|
|
5501
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
5608
5502
|
var MIN_WIDTH = 20;
|
|
5609
5503
|
var IMAGE_MAX_WIDTH = 600;
|
|
5610
5504
|
var IMAGE_MAX_HEIGHT = 400;
|
|
5611
5505
|
function ImageView(props) {
|
|
5612
5506
|
const { node, updateAttributes: updateAttributes2, selected, editor } = props;
|
|
5613
|
-
const [status, setStatus] = (0,
|
|
5614
|
-
const [isPlaceholderImage, setIsPlaceholderImage] = (0,
|
|
5507
|
+
const [status, setStatus] = (0, import_react15.useState)("idle");
|
|
5508
|
+
const [isPlaceholderImage, setIsPlaceholderImage] = (0, import_react15.useState)(false);
|
|
5615
5509
|
const { onImageUpload, allowedMimeTypes = [] } = useImageUploadOptions(editor);
|
|
5616
|
-
const wrapperRef = (0,
|
|
5617
|
-
const imgRef = (0,
|
|
5618
|
-
const [resizingStyle, setResizingStyle] = (0,
|
|
5619
|
-
const [isDraggingOver, setIsDraggingOver] = (0,
|
|
5510
|
+
const wrapperRef = (0, import_react15.useRef)(null);
|
|
5511
|
+
const imgRef = (0, import_react15.useRef)(null);
|
|
5512
|
+
const [resizingStyle, setResizingStyle] = (0, import_react15.useState)();
|
|
5513
|
+
const [isDraggingOver, setIsDraggingOver] = (0, import_react15.useState)(false);
|
|
5620
5514
|
const handleMouseDown = useEvent(
|
|
5621
5515
|
(event) => {
|
|
5622
5516
|
const imageParent = document.querySelector(
|
|
@@ -5673,12 +5567,12 @@ function ImageView(props) {
|
|
|
5673
5567
|
window.addEventListener("mouseup", removeListeners);
|
|
5674
5568
|
}
|
|
5675
5569
|
);
|
|
5676
|
-
const dragCornerButton = (0,
|
|
5570
|
+
const dragCornerButton = (0, import_react15.useCallback)(
|
|
5677
5571
|
(direction) => {
|
|
5678
5572
|
if (isPlaceholderImage) {
|
|
5679
5573
|
return null;
|
|
5680
5574
|
}
|
|
5681
|
-
return /* @__PURE__ */ (0,
|
|
5575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5682
5576
|
"div",
|
|
5683
5577
|
{
|
|
5684
5578
|
role: "button",
|
|
@@ -5731,7 +5625,7 @@ function ImageView(props) {
|
|
|
5731
5625
|
const file = e.target.files[0];
|
|
5732
5626
|
yield handleImageUpload(file);
|
|
5733
5627
|
});
|
|
5734
|
-
const handleImageUpload = (0,
|
|
5628
|
+
const handleImageUpload = (0, import_react15.useCallback)(
|
|
5735
5629
|
(file) => __async(this, null, function* () {
|
|
5736
5630
|
if (!isDroppable) {
|
|
5737
5631
|
return;
|
|
@@ -5749,7 +5643,7 @@ function ImageView(props) {
|
|
|
5749
5643
|
}),
|
|
5750
5644
|
[onImageUpload, updateAttributes2]
|
|
5751
5645
|
);
|
|
5752
|
-
(0,
|
|
5646
|
+
(0, import_react15.useEffect)(() => {
|
|
5753
5647
|
var _a2, _b, _c, _d;
|
|
5754
5648
|
if (!src || isSrcVariable) {
|
|
5755
5649
|
return;
|
|
@@ -5787,7 +5681,7 @@ function ImageView(props) {
|
|
|
5787
5681
|
img.onerror = null;
|
|
5788
5682
|
};
|
|
5789
5683
|
}, [src]);
|
|
5790
|
-
const handleDragOver = (0,
|
|
5684
|
+
const handleDragOver = (0, import_react15.useCallback)(
|
|
5791
5685
|
(e) => {
|
|
5792
5686
|
if (!isDroppable) {
|
|
5793
5687
|
return;
|
|
@@ -5798,7 +5692,7 @@ function ImageView(props) {
|
|
|
5798
5692
|
},
|
|
5799
5693
|
[onImageUpload]
|
|
5800
5694
|
);
|
|
5801
|
-
const handleDragLeave = (0,
|
|
5695
|
+
const handleDragLeave = (0, import_react15.useCallback)(
|
|
5802
5696
|
(e) => {
|
|
5803
5697
|
if (!isDroppable) {
|
|
5804
5698
|
return;
|
|
@@ -5809,7 +5703,7 @@ function ImageView(props) {
|
|
|
5809
5703
|
},
|
|
5810
5704
|
[onImageUpload]
|
|
5811
5705
|
);
|
|
5812
|
-
const handleDrop = (0,
|
|
5706
|
+
const handleDrop = (0, import_react15.useCallback)(
|
|
5813
5707
|
(e) => __async(this, null, function* () {
|
|
5814
5708
|
var _a2;
|
|
5815
5709
|
if (!isDroppable) {
|
|
@@ -5834,8 +5728,8 @@ function ImageView(props) {
|
|
|
5834
5728
|
const heightValue = height && height !== "auto" ? `${height}px` : void 0;
|
|
5835
5729
|
const hasExplicitWidth = Boolean(widthValue || (resizingStyle == null ? void 0 : resizingStyle.width));
|
|
5836
5730
|
const hasExplicitHeight = Boolean(heightValue || (resizingStyle == null ? void 0 : resizingStyle.height));
|
|
5837
|
-
return /* @__PURE__ */ (0,
|
|
5838
|
-
|
|
5731
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
5732
|
+
import_react16.NodeViewWrapper,
|
|
5839
5733
|
__spreadProps(__spreadValues({
|
|
5840
5734
|
as: "div",
|
|
5841
5735
|
draggable: editor.isEditable,
|
|
@@ -5863,7 +5757,7 @@ function ImageView(props) {
|
|
|
5863
5757
|
onDrop: handleDrop
|
|
5864
5758
|
} : {}), {
|
|
5865
5759
|
children: [
|
|
5866
|
-
!hasImageSrc && status === "idle" && /* @__PURE__ */ (0,
|
|
5760
|
+
!hasImageSrc && status === "idle" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5867
5761
|
ImageStatusLabel,
|
|
5868
5762
|
{
|
|
5869
5763
|
status: "idle",
|
|
@@ -5871,11 +5765,11 @@ function ImageView(props) {
|
|
|
5871
5765
|
isDropZone: isDroppable
|
|
5872
5766
|
}
|
|
5873
5767
|
),
|
|
5874
|
-
!hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */ (0,
|
|
5875
|
-
hasImageSrc && isSrcVariable && /* @__PURE__ */ (0,
|
|
5876
|
-
hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */ (0,
|
|
5877
|
-
hasImageSrc && status === "error" && !isSrcVariable && /* @__PURE__ */ (0,
|
|
5878
|
-
isDroppable && /* @__PURE__ */ (0,
|
|
5768
|
+
!hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ImageStatusLabel, { status: "loading", minHeight: height }),
|
|
5769
|
+
hasImageSrc && isSrcVariable && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ImageStatusLabel, { status: "variable", minHeight: height }),
|
|
5770
|
+
hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ImageStatusLabel, { status: "loading", minHeight: height }),
|
|
5771
|
+
hasImageSrc && status === "error" && !isSrcVariable && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ImageStatusLabel, { status: "error", minHeight: height }),
|
|
5772
|
+
isDroppable && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5879
5773
|
"input",
|
|
5880
5774
|
{
|
|
5881
5775
|
type: "file",
|
|
@@ -5885,8 +5779,8 @@ function ImageView(props) {
|
|
|
5885
5779
|
multiple: false
|
|
5886
5780
|
}
|
|
5887
5781
|
),
|
|
5888
|
-
hasImageSrc && status === "loaded" && !isSrcVariable && /* @__PURE__ */ (0,
|
|
5889
|
-
/* @__PURE__ */ (0,
|
|
5782
|
+
hasImageSrc && status === "loaded" && !isSrcVariable && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
5783
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5890
5784
|
"img",
|
|
5891
5785
|
__spreadProps(__spreadValues({}, attrs), {
|
|
5892
5786
|
ref: imgRef,
|
|
@@ -5906,13 +5800,13 @@ function ImageView(props) {
|
|
|
5906
5800
|
)
|
|
5907
5801
|
})
|
|
5908
5802
|
),
|
|
5909
|
-
selected && editor.isEditable && !isPlaceholderImage && /* @__PURE__ */ (0,
|
|
5803
|
+
selected && editor.isEditable && !isPlaceholderImage && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
5910
5804
|
[
|
|
5911
5805
|
{ left: 0, top: 0, height: "100%", width: "1px" },
|
|
5912
5806
|
{ right: 0, top: 0, height: "100%", width: "1px" },
|
|
5913
5807
|
{ top: 0, left: 0, width: "100%", height: "1px" },
|
|
5914
5808
|
{ bottom: 0, left: 0, width: "100%", height: "1px" }
|
|
5915
|
-
].map((style, i) => /* @__PURE__ */ (0,
|
|
5809
|
+
].map((style, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
5916
5810
|
"div",
|
|
5917
5811
|
{
|
|
5918
5812
|
className: "mly:bg-rose-500",
|
|
@@ -5936,7 +5830,7 @@ function ImageStatusLabel(props) {
|
|
|
5936
5830
|
const _a = props, { status, minHeight, className, style, isDropZone } = _a, rest = __objRest(_a, ["status", "minHeight", "className", "style", "isDropZone"]);
|
|
5937
5831
|
const resolvedMinHeight = minHeight != null ? minHeight : isDropZone ? 36 : void 0;
|
|
5938
5832
|
const resolvedPaddingY = isDropZone ? 8 : void 0;
|
|
5939
|
-
return /* @__PURE__ */ (0,
|
|
5833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
5940
5834
|
"div",
|
|
5941
5835
|
__spreadProps(__spreadValues({}, rest), {
|
|
5942
5836
|
className: cn(
|
|
@@ -5954,25 +5848,25 @@ function ImageStatusLabel(props) {
|
|
|
5954
5848
|
paddingBottom: resolvedPaddingY
|
|
5955
5849
|
} : {}), style),
|
|
5956
5850
|
children: [
|
|
5957
|
-
status === "idle" && !isDropZone && /* @__PURE__ */ (0,
|
|
5958
|
-
/* @__PURE__ */ (0,
|
|
5959
|
-
/* @__PURE__ */ (0,
|
|
5851
|
+
status === "idle" && !isDropZone && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
5852
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react9.ImageOffIcon, { className: "mly:size-4 mly:stroke-[2.5]" }),
|
|
5853
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: "No image selected" })
|
|
5960
5854
|
] }),
|
|
5961
|
-
status === "idle" && isDropZone && /* @__PURE__ */ (0,
|
|
5962
|
-
/* @__PURE__ */ (0,
|
|
5963
|
-
/* @__PURE__ */ (0,
|
|
5855
|
+
status === "idle" && isDropZone && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
5856
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react9.GrabIcon, { className: "mly:size-4 mly:stroke-[2.5]" }),
|
|
5857
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: "Click or Drop image here" })
|
|
5964
5858
|
] }),
|
|
5965
|
-
status === "loading" && /* @__PURE__ */ (0,
|
|
5966
|
-
/* @__PURE__ */ (0,
|
|
5967
|
-
/* @__PURE__ */ (0,
|
|
5859
|
+
status === "loading" && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
5860
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react9.Loader2, { className: "mly:size-4 mly:animate-spin mly:stroke-[2.5]" }),
|
|
5861
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: "Loading image..." })
|
|
5968
5862
|
] }),
|
|
5969
|
-
status === "error" && /* @__PURE__ */ (0,
|
|
5970
|
-
/* @__PURE__ */ (0,
|
|
5971
|
-
/* @__PURE__ */ (0,
|
|
5863
|
+
status === "error" && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
5864
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react9.Ban, { className: "mly:size-4 mly:stroke-[2.5]" }),
|
|
5865
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: "Error loading image" })
|
|
5972
5866
|
] }),
|
|
5973
|
-
status === "variable" && /* @__PURE__ */ (0,
|
|
5974
|
-
/* @__PURE__ */ (0,
|
|
5975
|
-
/* @__PURE__ */ (0,
|
|
5867
|
+
status === "variable" && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
5868
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react9.BracesIcon, { className: "mly:size-4 mly:stroke-[2.5]" }),
|
|
5869
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: "Variable Image URL" })
|
|
5976
5870
|
] })
|
|
5977
5871
|
]
|
|
5978
5872
|
})
|
|
@@ -5980,12 +5874,12 @@ function ImageStatusLabel(props) {
|
|
|
5980
5874
|
}
|
|
5981
5875
|
|
|
5982
5876
|
// src/editor/nodes/logo/logo-view.tsx
|
|
5983
|
-
var
|
|
5877
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
5984
5878
|
function LogoView(props) {
|
|
5985
5879
|
const { node, editor, updateAttributes: updateAttributes2 } = props;
|
|
5986
|
-
const [status, setStatus] = (0,
|
|
5987
|
-
const [isPlaceholderImage, setIsPlaceholderImage] = (0,
|
|
5988
|
-
const [isDraggingOver, setIsDraggingOver] = (0,
|
|
5880
|
+
const [status, setStatus] = (0, import_react19.useState)("idle");
|
|
5881
|
+
const [isPlaceholderImage, setIsPlaceholderImage] = (0, import_react19.useState)(false);
|
|
5882
|
+
const [isDraggingOver, setIsDraggingOver] = (0, import_react19.useState)(false);
|
|
5989
5883
|
const { onImageUpload, allowedMimeTypes = [] } = useImageUploadOptions(editor);
|
|
5990
5884
|
let {
|
|
5991
5885
|
alignment = "center",
|
|
@@ -6002,7 +5896,7 @@ function LogoView(props) {
|
|
|
6002
5896
|
const file = e.target.files[0];
|
|
6003
5897
|
yield handleImageUpload(file);
|
|
6004
5898
|
});
|
|
6005
|
-
const handleImageUpload = (0,
|
|
5899
|
+
const handleImageUpload = (0, import_react18.useCallback)(
|
|
6006
5900
|
(file) => __async(this, null, function* () {
|
|
6007
5901
|
if (!isDroppable) {
|
|
6008
5902
|
return;
|
|
@@ -6020,7 +5914,7 @@ function LogoView(props) {
|
|
|
6020
5914
|
}),
|
|
6021
5915
|
[onImageUpload, updateAttributes2]
|
|
6022
5916
|
);
|
|
6023
|
-
const handleDragOver = (0,
|
|
5917
|
+
const handleDragOver = (0, import_react18.useCallback)(
|
|
6024
5918
|
(e) => {
|
|
6025
5919
|
if (!isDroppable) {
|
|
6026
5920
|
return;
|
|
@@ -6031,7 +5925,7 @@ function LogoView(props) {
|
|
|
6031
5925
|
},
|
|
6032
5926
|
[onImageUpload]
|
|
6033
5927
|
);
|
|
6034
|
-
const handleDragLeave = (0,
|
|
5928
|
+
const handleDragLeave = (0, import_react18.useCallback)(
|
|
6035
5929
|
(e) => {
|
|
6036
5930
|
if (!isDroppable) {
|
|
6037
5931
|
return;
|
|
@@ -6042,7 +5936,7 @@ function LogoView(props) {
|
|
|
6042
5936
|
},
|
|
6043
5937
|
[onImageUpload]
|
|
6044
5938
|
);
|
|
6045
|
-
const handleDrop = (0,
|
|
5939
|
+
const handleDrop = (0, import_react18.useCallback)(
|
|
6046
5940
|
(e) => __async(this, null, function* () {
|
|
6047
5941
|
var _a;
|
|
6048
5942
|
if (!isDroppable) {
|
|
@@ -6063,7 +5957,7 @@ function LogoView(props) {
|
|
|
6063
5957
|
}),
|
|
6064
5958
|
[handleImageUpload]
|
|
6065
5959
|
);
|
|
6066
|
-
(0,
|
|
5960
|
+
(0, import_react18.useEffect)(() => {
|
|
6067
5961
|
var _a, _b, _c, _d;
|
|
6068
5962
|
if (!logoSrc) {
|
|
6069
5963
|
return;
|
|
@@ -6086,8 +5980,8 @@ function LogoView(props) {
|
|
|
6086
5980
|
};
|
|
6087
5981
|
}, [logoSrc]);
|
|
6088
5982
|
const logoSize = logoSizes[size];
|
|
6089
|
-
return /* @__PURE__ */ (0,
|
|
6090
|
-
|
|
5983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
5984
|
+
import_react17.NodeViewWrapper,
|
|
6091
5985
|
__spreadProps(__spreadValues({
|
|
6092
5986
|
as: "div",
|
|
6093
5987
|
draggable: editor.isEditable,
|
|
@@ -6106,7 +6000,7 @@ function LogoView(props) {
|
|
|
6106
6000
|
onDrop: handleDrop
|
|
6107
6001
|
} : {}), {
|
|
6108
6002
|
children: [
|
|
6109
|
-
!hasImageSrc && status === "idle" && /* @__PURE__ */ (0,
|
|
6003
|
+
!hasImageSrc && status === "idle" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6110
6004
|
ImageStatusLabel,
|
|
6111
6005
|
{
|
|
6112
6006
|
status: "idle",
|
|
@@ -6114,11 +6008,11 @@ function LogoView(props) {
|
|
|
6114
6008
|
isDropZone: isDroppable
|
|
6115
6009
|
}
|
|
6116
6010
|
),
|
|
6117
|
-
!hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */ (0,
|
|
6118
|
-
hasImageSrc && isSrcVariable && /* @__PURE__ */ (0,
|
|
6119
|
-
hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */ (0,
|
|
6120
|
-
hasImageSrc && status === "error" && !isSrcVariable && /* @__PURE__ */ (0,
|
|
6121
|
-
isDroppable && /* @__PURE__ */ (0,
|
|
6011
|
+
!hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ImageStatusLabel, { status: "loading", minHeight: logoSize }),
|
|
6012
|
+
hasImageSrc && isSrcVariable && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ImageStatusLabel, { status: "variable", minHeight: logoSize }),
|
|
6013
|
+
hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ImageStatusLabel, { status: "loading", minHeight: logoSize }),
|
|
6014
|
+
hasImageSrc && status === "error" && !isSrcVariable && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ImageStatusLabel, { status: "error", minHeight: logoSize }),
|
|
6015
|
+
isDroppable && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6122
6016
|
"input",
|
|
6123
6017
|
{
|
|
6124
6018
|
type: "file",
|
|
@@ -6128,7 +6022,7 @@ function LogoView(props) {
|
|
|
6128
6022
|
multiple: false
|
|
6129
6023
|
}
|
|
6130
6024
|
),
|
|
6131
|
-
hasImageSrc && status === "loaded" && !isSrcVariable && /* @__PURE__ */ (0,
|
|
6025
|
+
hasImageSrc && status === "loaded" && !isSrcVariable && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
6132
6026
|
"img",
|
|
6133
6027
|
{
|
|
6134
6028
|
src: logoSrc,
|
|
@@ -6248,7 +6142,7 @@ var LogoExtension = import_extension_image.default.extend({
|
|
|
6248
6142
|
];
|
|
6249
6143
|
},
|
|
6250
6144
|
addNodeView() {
|
|
6251
|
-
return (0,
|
|
6145
|
+
return (0, import_react20.ReactNodeViewRenderer)(LogoView, {
|
|
6252
6146
|
className: "mly:relative"
|
|
6253
6147
|
});
|
|
6254
6148
|
}
|
|
@@ -6279,13 +6173,13 @@ var borderRadius = [
|
|
|
6279
6173
|
];
|
|
6280
6174
|
|
|
6281
6175
|
// src/editor/components/image-menu/image-bubble-menu.tsx
|
|
6282
|
-
var
|
|
6283
|
-
var
|
|
6284
|
-
var
|
|
6176
|
+
var import_react29 = require("@tiptap/react");
|
|
6177
|
+
var import_lucide_react22 = require("lucide-react");
|
|
6178
|
+
var import_tippy3 = require("tippy.js");
|
|
6285
6179
|
|
|
6286
6180
|
// src/editor/components/alignment-switch.tsx
|
|
6287
|
-
var
|
|
6288
|
-
var
|
|
6181
|
+
var import_lucide_react10 = require("lucide-react");
|
|
6182
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
6289
6183
|
function AlignmentSwitch(props) {
|
|
6290
6184
|
const { alignment: rawAlignment, onAlignmentChange } = props;
|
|
6291
6185
|
const alignment = allowedLogoAlignment.includes(
|
|
@@ -6293,21 +6187,21 @@ function AlignmentSwitch(props) {
|
|
|
6293
6187
|
) ? rawAlignment : "left";
|
|
6294
6188
|
const alignments = {
|
|
6295
6189
|
left: {
|
|
6296
|
-
icon:
|
|
6190
|
+
icon: import_lucide_react10.AlignLeft,
|
|
6297
6191
|
tooltip: "Align Left",
|
|
6298
6192
|
onClick: () => {
|
|
6299
6193
|
onAlignmentChange("left");
|
|
6300
6194
|
}
|
|
6301
6195
|
},
|
|
6302
6196
|
center: {
|
|
6303
|
-
icon:
|
|
6197
|
+
icon: import_lucide_react10.AlignCenter,
|
|
6304
6198
|
tooltip: "Align Center",
|
|
6305
6199
|
onClick: () => {
|
|
6306
6200
|
onAlignmentChange("center");
|
|
6307
6201
|
}
|
|
6308
6202
|
},
|
|
6309
6203
|
right: {
|
|
6310
|
-
icon:
|
|
6204
|
+
icon: import_lucide_react10.AlignRight,
|
|
6311
6205
|
tooltip: "Align Right",
|
|
6312
6206
|
onClick: () => {
|
|
6313
6207
|
onAlignmentChange("right");
|
|
@@ -6315,20 +6209,27 @@ function AlignmentSwitch(props) {
|
|
|
6315
6209
|
}
|
|
6316
6210
|
};
|
|
6317
6211
|
const activeAlignment = alignments[alignment];
|
|
6318
|
-
return /* @__PURE__ */ (0,
|
|
6319
|
-
/* @__PURE__ */ (0,
|
|
6320
|
-
/* @__PURE__ */ (0,
|
|
6212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Popover, { children: [
|
|
6213
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Tooltip, { children: [
|
|
6214
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
6321
6215
|
PopoverTrigger,
|
|
6322
6216
|
{
|
|
6323
6217
|
className: cn(
|
|
6324
6218
|
"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"
|
|
6325
6219
|
),
|
|
6326
|
-
children: /* @__PURE__ */ (0,
|
|
6220
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(activeAlignment.icon, { className: "mly:h-3 mly:w-3 mly:stroke-[2.5]" })
|
|
6327
6221
|
}
|
|
6328
6222
|
) }),
|
|
6329
|
-
/* @__PURE__ */ (0,
|
|
6223
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
6224
|
+
TooltipContent,
|
|
6225
|
+
{
|
|
6226
|
+
sideOffset: 8,
|
|
6227
|
+
className: "mly:border-gray-300 mly:bg-transparent mly:p-0 mly:text-gray-700 mly:shadow-sm",
|
|
6228
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "mly:block mly:rounded-md mly:bg-soft-gray mly:!px-2 mly:!py-1.5", children: "Alignment" })
|
|
6229
|
+
}
|
|
6230
|
+
)
|
|
6330
6231
|
] }),
|
|
6331
|
-
/* @__PURE__ */ (0,
|
|
6232
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
6332
6233
|
PopoverContent,
|
|
6333
6234
|
{
|
|
6334
6235
|
className: "mly:flex mly:w-max mly:gap-0.5 mly:rounded-lg mly:p-0.5!",
|
|
@@ -6342,7 +6243,7 @@ function AlignmentSwitch(props) {
|
|
|
6342
6243
|
e.preventDefault();
|
|
6343
6244
|
},
|
|
6344
6245
|
children: Object.entries(alignments).map(([key, value]) => {
|
|
6345
|
-
return /* @__PURE__ */ (0,
|
|
6246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
6346
6247
|
BubbleMenuButton,
|
|
6347
6248
|
{
|
|
6348
6249
|
icon: value.icon,
|
|
@@ -6359,23 +6260,23 @@ function AlignmentSwitch(props) {
|
|
|
6359
6260
|
}
|
|
6360
6261
|
|
|
6361
6262
|
// src/editor/components/ui/link-input-popover.tsx
|
|
6362
|
-
var
|
|
6363
|
-
var
|
|
6263
|
+
var import_lucide_react21 = require("lucide-react");
|
|
6264
|
+
var import_react26 = require("react");
|
|
6364
6265
|
|
|
6365
6266
|
// src/editor/provider.tsx
|
|
6366
|
-
var
|
|
6267
|
+
var import_react21 = require("react");
|
|
6367
6268
|
|
|
6368
6269
|
// src/editor/extensions/slash-command/default-slash-commands.tsx
|
|
6369
|
-
var
|
|
6270
|
+
var import_lucide_react18 = require("lucide-react");
|
|
6370
6271
|
|
|
6371
6272
|
// src/blocks/button.tsx
|
|
6372
|
-
var
|
|
6373
|
-
var
|
|
6273
|
+
var import_lucide_react11 = require("lucide-react");
|
|
6274
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
6374
6275
|
var button = {
|
|
6375
6276
|
title: "Button",
|
|
6376
6277
|
description: "Add a call to action button to email.",
|
|
6377
6278
|
searchTerms: ["link", "button", "cta"],
|
|
6378
|
-
icon: /* @__PURE__ */ (0,
|
|
6279
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react11.MousePointer, { className: "mly:h-4 mly:w-4" }),
|
|
6379
6280
|
command: ({ editor, range }) => {
|
|
6380
6281
|
editor.chain().focus().deleteRange(range).setButton().run();
|
|
6381
6282
|
}
|
|
@@ -6384,7 +6285,7 @@ var linkCard = {
|
|
|
6384
6285
|
title: "Link Card",
|
|
6385
6286
|
description: "Add a link card to email.",
|
|
6386
6287
|
searchTerms: ["link", "button", "image"],
|
|
6387
|
-
icon: /* @__PURE__ */ (0,
|
|
6288
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react11.ArrowUpRightSquare, { className: "mly:h-4 mly:w-4" }),
|
|
6388
6289
|
command: ({ editor, range }) => {
|
|
6389
6290
|
editor.chain().focus().deleteRange(range).setLinkCard().run();
|
|
6390
6291
|
},
|
|
@@ -6396,13 +6297,13 @@ var linkCard = {
|
|
|
6396
6297
|
};
|
|
6397
6298
|
|
|
6398
6299
|
// src/blocks/code.tsx
|
|
6399
|
-
var
|
|
6400
|
-
var
|
|
6300
|
+
var import_lucide_react12 = require("lucide-react");
|
|
6301
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
6401
6302
|
var htmlCodeBlock = {
|
|
6402
6303
|
title: "Custom HTML",
|
|
6403
6304
|
description: "Insert a custom HTML block",
|
|
6404
6305
|
searchTerms: ["html", "code", "custom"],
|
|
6405
|
-
icon: /* @__PURE__ */ (0,
|
|
6306
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react12.CodeXmlIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6406
6307
|
command: ({ editor, range }) => {
|
|
6407
6308
|
editor.chain().focus().deleteRange(range).setHtmlCodeBlock({ language: "html" }).run();
|
|
6408
6309
|
}
|
|
@@ -6410,13 +6311,13 @@ var htmlCodeBlock = {
|
|
|
6410
6311
|
|
|
6411
6312
|
// src/blocks/image.tsx
|
|
6412
6313
|
var import_state4 = require("@tiptap/pm/state");
|
|
6413
|
-
var
|
|
6414
|
-
var
|
|
6314
|
+
var import_lucide_react13 = require("lucide-react");
|
|
6315
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
6415
6316
|
var image = {
|
|
6416
6317
|
title: "Image",
|
|
6417
6318
|
description: "Full width image",
|
|
6418
6319
|
searchTerms: ["image"],
|
|
6419
|
-
icon: /* @__PURE__ */ (0,
|
|
6320
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react13.ImageIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6420
6321
|
command: ({ editor, range }) => {
|
|
6421
6322
|
editor.chain().focus().deleteRange(range).setImage({ src: "" }).run();
|
|
6422
6323
|
}
|
|
@@ -6425,7 +6326,7 @@ var logo = {
|
|
|
6425
6326
|
title: "Logo",
|
|
6426
6327
|
description: "Add your brand logo",
|
|
6427
6328
|
searchTerms: ["image", "logo"],
|
|
6428
|
-
icon: /* @__PURE__ */ (0,
|
|
6329
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react13.ImageIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6429
6330
|
command: ({ editor, range }) => {
|
|
6430
6331
|
editor.chain().focus().deleteRange(range).setLogoImage({ src: "" }).run();
|
|
6431
6332
|
}
|
|
@@ -6434,7 +6335,7 @@ var inlineImage = {
|
|
|
6434
6335
|
title: "Inline Image",
|
|
6435
6336
|
description: "Inline image",
|
|
6436
6337
|
searchTerms: ["image", "inline"],
|
|
6437
|
-
icon: /* @__PURE__ */ (0,
|
|
6338
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react13.ImageIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6438
6339
|
command: ({ editor, range }) => {
|
|
6439
6340
|
editor.chain().focus().deleteRange(range).setInlineImage({
|
|
6440
6341
|
src: "https://maily.to/brand/logo.png"
|
|
@@ -6457,13 +6358,13 @@ var inlineImage = {
|
|
|
6457
6358
|
};
|
|
6458
6359
|
|
|
6459
6360
|
// src/blocks/layout.tsx
|
|
6460
|
-
var
|
|
6461
|
-
var
|
|
6361
|
+
var import_lucide_react14 = require("lucide-react");
|
|
6362
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
6462
6363
|
var columns = {
|
|
6463
6364
|
title: "Columns",
|
|
6464
6365
|
description: "Add columns to email.",
|
|
6465
6366
|
searchTerms: ["layout", "columns"],
|
|
6466
|
-
icon: /* @__PURE__ */ (0,
|
|
6367
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react14.ColumnsIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6467
6368
|
command: ({ editor, range }) => {
|
|
6468
6369
|
editor.chain().focus().deleteRange(range).setColumns().focus(editor.state.selection.head - 2).run();
|
|
6469
6370
|
}
|
|
@@ -6472,7 +6373,7 @@ var section = {
|
|
|
6472
6373
|
title: "Section",
|
|
6473
6374
|
description: "Add a section to email.",
|
|
6474
6375
|
searchTerms: ["layout", "section"],
|
|
6475
|
-
icon: /* @__PURE__ */ (0,
|
|
6376
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react14.RectangleHorizontal, { className: "mly:h-4 mly:w-4" }),
|
|
6476
6377
|
command: ({ editor, range }) => {
|
|
6477
6378
|
editor.chain().focus().deleteRange(range).setSection().run();
|
|
6478
6379
|
}
|
|
@@ -6481,7 +6382,7 @@ var repeat = {
|
|
|
6481
6382
|
title: "Repeat",
|
|
6482
6383
|
description: "Loop over an array of items.",
|
|
6483
6384
|
searchTerms: ["repeat", "for", "loop"],
|
|
6484
|
-
icon: /* @__PURE__ */ (0,
|
|
6385
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react14.Repeat2, { className: "mly:h-4 mly:w-4" }),
|
|
6485
6386
|
command: ({ editor, range }) => {
|
|
6486
6387
|
editor.chain().focus().deleteRange(range).setRepeat().run();
|
|
6487
6388
|
}
|
|
@@ -6490,7 +6391,7 @@ var spacer = {
|
|
|
6490
6391
|
title: "Spacer",
|
|
6491
6392
|
description: "Add space between blocks.",
|
|
6492
6393
|
searchTerms: ["space", "gap", "divider"],
|
|
6493
|
-
icon: /* @__PURE__ */ (0,
|
|
6394
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react14.MoveVertical, { className: "mly:h-4 mly:w-4" }),
|
|
6494
6395
|
command: ({ editor, range }) => {
|
|
6495
6396
|
editor.chain().focus().deleteRange(range).setSpacer({ height: "sm" }).run();
|
|
6496
6397
|
}
|
|
@@ -6499,20 +6400,20 @@ var divider = {
|
|
|
6499
6400
|
title: "Divider",
|
|
6500
6401
|
description: "Add a horizontal divider.",
|
|
6501
6402
|
searchTerms: ["divider", "line"],
|
|
6502
|
-
icon: /* @__PURE__ */ (0,
|
|
6403
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react14.Minus, { className: "mly:h-4 mly:w-4" }),
|
|
6503
6404
|
command: ({ editor, range }) => {
|
|
6504
6405
|
editor.chain().focus().deleteRange(range).setHorizontalRule().run();
|
|
6505
6406
|
}
|
|
6506
6407
|
};
|
|
6507
6408
|
|
|
6508
6409
|
// src/blocks/list.tsx
|
|
6509
|
-
var
|
|
6510
|
-
var
|
|
6410
|
+
var import_lucide_react15 = require("lucide-react");
|
|
6411
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
6511
6412
|
var bulletList = {
|
|
6512
6413
|
title: "Bullet List",
|
|
6513
6414
|
description: "Create a simple bullet list.",
|
|
6514
6415
|
searchTerms: ["unordered", "point"],
|
|
6515
|
-
icon: /* @__PURE__ */ (0,
|
|
6416
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react15.List, { className: "mly:h-4 mly:w-4" }),
|
|
6516
6417
|
command: ({ editor, range }) => {
|
|
6517
6418
|
editor.chain().focus().deleteRange(range).toggleBulletList().run();
|
|
6518
6419
|
}
|
|
@@ -6521,20 +6422,20 @@ var orderedList = {
|
|
|
6521
6422
|
title: "Numbered List",
|
|
6522
6423
|
description: "Create a list with numbering.",
|
|
6523
6424
|
searchTerms: ["ordered"],
|
|
6524
|
-
icon: /* @__PURE__ */ (0,
|
|
6425
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react15.ListOrdered, { className: "mly:h-4 mly:w-4" }),
|
|
6525
6426
|
command: ({ editor, range }) => {
|
|
6526
6427
|
editor.chain().focus().deleteRange(range).toggleOrderedList().run();
|
|
6527
6428
|
}
|
|
6528
6429
|
};
|
|
6529
6430
|
|
|
6530
6431
|
// src/blocks/typography.tsx
|
|
6531
|
-
var
|
|
6532
|
-
var
|
|
6432
|
+
var import_lucide_react16 = require("lucide-react");
|
|
6433
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
6533
6434
|
var text = {
|
|
6534
6435
|
title: "Text",
|
|
6535
6436
|
description: "Just start typing with plain text.",
|
|
6536
6437
|
searchTerms: ["p", "paragraph"],
|
|
6537
|
-
icon: /* @__PURE__ */ (0,
|
|
6438
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react16.Text, { className: "mly:h-4 mly:w-4" }),
|
|
6538
6439
|
command: ({ editor, range }) => {
|
|
6539
6440
|
editor.chain().focus().deleteRange(range).toggleNode("paragraph", "paragraph").run();
|
|
6540
6441
|
}
|
|
@@ -6543,7 +6444,7 @@ var heading1 = {
|
|
|
6543
6444
|
title: "Heading 1",
|
|
6544
6445
|
description: "Big heading.",
|
|
6545
6446
|
searchTerms: ["h1", "title", "big", "large"],
|
|
6546
|
-
icon: /* @__PURE__ */ (0,
|
|
6447
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react16.Heading1, { className: "mly:h-4 mly:w-4" }),
|
|
6547
6448
|
command: ({ editor, range }) => {
|
|
6548
6449
|
editor.chain().focus().deleteRange(range).setNode("heading", { level: 1 }).run();
|
|
6549
6450
|
}
|
|
@@ -6552,7 +6453,7 @@ var heading2 = {
|
|
|
6552
6453
|
title: "Heading 2",
|
|
6553
6454
|
description: "Medium heading.",
|
|
6554
6455
|
searchTerms: ["h2", "subtitle", "medium"],
|
|
6555
|
-
icon: /* @__PURE__ */ (0,
|
|
6456
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react16.Heading2, { className: "mly:h-4 mly:w-4" }),
|
|
6556
6457
|
command: ({ editor, range }) => {
|
|
6557
6458
|
editor.chain().focus().deleteRange(range).setNode("heading", { level: 2 }).run();
|
|
6558
6459
|
}
|
|
@@ -6561,7 +6462,7 @@ var heading3 = {
|
|
|
6561
6462
|
title: "Heading 3",
|
|
6562
6463
|
description: "Small heading.",
|
|
6563
6464
|
searchTerms: ["h3", "subtitle", "small"],
|
|
6564
|
-
icon: /* @__PURE__ */ (0,
|
|
6465
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react16.Heading3, { className: "mly:h-4 mly:w-4" }),
|
|
6565
6466
|
command: ({ editor, range }) => {
|
|
6566
6467
|
editor.chain().focus().deleteRange(range).setNode("heading", { level: 3 }).run();
|
|
6567
6468
|
}
|
|
@@ -6570,7 +6471,7 @@ var hardBreak = {
|
|
|
6570
6471
|
title: "Hard Break",
|
|
6571
6472
|
description: "Add a break between lines.",
|
|
6572
6473
|
searchTerms: ["break", "line"],
|
|
6573
|
-
icon: /* @__PURE__ */ (0,
|
|
6474
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react16.DivideIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6574
6475
|
command: ({ editor, range }) => {
|
|
6575
6476
|
editor.chain().focus().deleteRange(range).setHardBreak().run();
|
|
6576
6477
|
}
|
|
@@ -6579,7 +6480,7 @@ var blockquote = {
|
|
|
6579
6480
|
title: "Blockquote",
|
|
6580
6481
|
description: "Add blockquote.",
|
|
6581
6482
|
searchTerms: ["quote", "blockquote"],
|
|
6582
|
-
icon: /* @__PURE__ */ (0,
|
|
6483
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react16.TextQuote, { className: "mly:h-4 mly:w-4" }),
|
|
6583
6484
|
command: ({ editor, range }) => {
|
|
6584
6485
|
editor.chain().focus().deleteRange(range).toggleBlockquote().run();
|
|
6585
6486
|
}
|
|
@@ -6588,7 +6489,7 @@ var footer = {
|
|
|
6588
6489
|
title: "Footer",
|
|
6589
6490
|
description: "Add a footer text to email.",
|
|
6590
6491
|
searchTerms: ["footer", "text"],
|
|
6591
|
-
icon: /* @__PURE__ */ (0,
|
|
6492
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react16.FootprintsIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6592
6493
|
command: ({ editor, range }) => {
|
|
6593
6494
|
editor.chain().focus().deleteRange(range).setFooter().run();
|
|
6594
6495
|
}
|
|
@@ -6597,16 +6498,16 @@ var clearLine = {
|
|
|
6597
6498
|
title: "Clear Line",
|
|
6598
6499
|
description: "Clear the current line.",
|
|
6599
6500
|
searchTerms: ["clear", "line"],
|
|
6600
|
-
icon: /* @__PURE__ */ (0,
|
|
6501
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react16.EraserIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6601
6502
|
command: ({ editor, range }) => {
|
|
6602
6503
|
editor.chain().focus().selectParentNode().deleteSelection().run();
|
|
6603
6504
|
}
|
|
6604
6505
|
};
|
|
6605
6506
|
|
|
6606
6507
|
// src/editor/components/icons/logo-with-cover-image.tsx
|
|
6607
|
-
var
|
|
6508
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
6608
6509
|
function LogoWithCoverImageIcon(props) {
|
|
6609
|
-
return /* @__PURE__ */ (0,
|
|
6510
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
6610
6511
|
"svg",
|
|
6611
6512
|
__spreadProps(__spreadValues({
|
|
6612
6513
|
width: "14",
|
|
@@ -6616,7 +6517,7 @@ function LogoWithCoverImageIcon(props) {
|
|
|
6616
6517
|
xmlns: "http://www.w3.org/2000/svg"
|
|
6617
6518
|
}, props), {
|
|
6618
6519
|
children: [
|
|
6619
|
-
/* @__PURE__ */ (0,
|
|
6520
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
6620
6521
|
"path",
|
|
6621
6522
|
{
|
|
6622
6523
|
fillRule: "evenodd",
|
|
@@ -6625,7 +6526,7 @@ function LogoWithCoverImageIcon(props) {
|
|
|
6625
6526
|
fill: "currentColor"
|
|
6626
6527
|
}
|
|
6627
6528
|
),
|
|
6628
|
-
/* @__PURE__ */ (0,
|
|
6529
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
6629
6530
|
"path",
|
|
6630
6531
|
{
|
|
6631
6532
|
fillRule: "evenodd",
|
|
@@ -6634,7 +6535,7 @@ function LogoWithCoverImageIcon(props) {
|
|
|
6634
6535
|
fill: "currentColor"
|
|
6635
6536
|
}
|
|
6636
6537
|
),
|
|
6637
|
-
/* @__PURE__ */ (0,
|
|
6538
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
6638
6539
|
"path",
|
|
6639
6540
|
{
|
|
6640
6541
|
fillRule: "evenodd",
|
|
@@ -6643,8 +6544,8 @@ function LogoWithCoverImageIcon(props) {
|
|
|
6643
6544
|
fill: "currentColor"
|
|
6644
6545
|
}
|
|
6645
6546
|
),
|
|
6646
|
-
/* @__PURE__ */ (0,
|
|
6647
|
-
/* @__PURE__ */ (0,
|
|
6547
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("mask", { id: "path-4-inside-1_1046_19527", fill: "white", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("rect", { x: "3", y: "4", width: "8", height: "3", rx: "0.5" }) }),
|
|
6548
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
6648
6549
|
"rect",
|
|
6649
6550
|
{
|
|
6650
6551
|
x: "3",
|
|
@@ -6657,7 +6558,7 @@ function LogoWithCoverImageIcon(props) {
|
|
|
6657
6558
|
mask: "url(#path-4-inside-1_1046_19527)"
|
|
6658
6559
|
}
|
|
6659
6560
|
),
|
|
6660
|
-
/* @__PURE__ */ (0,
|
|
6561
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
6661
6562
|
"rect",
|
|
6662
6563
|
{
|
|
6663
6564
|
x: "6.25",
|
|
@@ -6669,16 +6570,16 @@ function LogoWithCoverImageIcon(props) {
|
|
|
6669
6570
|
strokeWidth: "0.5"
|
|
6670
6571
|
}
|
|
6671
6572
|
),
|
|
6672
|
-
/* @__PURE__ */ (0,
|
|
6573
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("rect", { x: "3", y: "8", width: "2", height: "1", rx: "0.5", fill: "currentColor" })
|
|
6673
6574
|
]
|
|
6674
6575
|
})
|
|
6675
6576
|
);
|
|
6676
6577
|
}
|
|
6677
6578
|
|
|
6678
6579
|
// src/editor/components/icons/logo-with-text-horizon.tsx
|
|
6679
|
-
var
|
|
6580
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
6680
6581
|
function LogoWithTextHorizonIcon(props) {
|
|
6681
|
-
return /* @__PURE__ */ (0,
|
|
6582
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
6682
6583
|
"svg",
|
|
6683
6584
|
__spreadProps(__spreadValues({
|
|
6684
6585
|
width: "14",
|
|
@@ -6688,7 +6589,7 @@ function LogoWithTextHorizonIcon(props) {
|
|
|
6688
6589
|
xmlns: "http://www.w3.org/2000/svg"
|
|
6689
6590
|
}, props), {
|
|
6690
6591
|
children: [
|
|
6691
|
-
/* @__PURE__ */ (0,
|
|
6592
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
6692
6593
|
"path",
|
|
6693
6594
|
{
|
|
6694
6595
|
fillRule: "evenodd",
|
|
@@ -6697,7 +6598,7 @@ function LogoWithTextHorizonIcon(props) {
|
|
|
6697
6598
|
fill: "currentColor"
|
|
6698
6599
|
}
|
|
6699
6600
|
),
|
|
6700
|
-
/* @__PURE__ */ (0,
|
|
6601
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
6701
6602
|
"rect",
|
|
6702
6603
|
{
|
|
6703
6604
|
x: "6.25",
|
|
@@ -6709,8 +6610,8 @@ function LogoWithTextHorizonIcon(props) {
|
|
|
6709
6610
|
strokeWidth: "0.5"
|
|
6710
6611
|
}
|
|
6711
6612
|
),
|
|
6712
|
-
/* @__PURE__ */ (0,
|
|
6713
|
-
/* @__PURE__ */ (0,
|
|
6613
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("rect", { x: "3", y: "6.5", width: "2", height: "1", rx: "0.5", fill: "currentColor" }),
|
|
6614
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
6714
6615
|
"path",
|
|
6715
6616
|
{
|
|
6716
6617
|
fillRule: "evenodd",
|
|
@@ -6719,7 +6620,7 @@ function LogoWithTextHorizonIcon(props) {
|
|
|
6719
6620
|
fill: "currentColor"
|
|
6720
6621
|
}
|
|
6721
6622
|
),
|
|
6722
|
-
/* @__PURE__ */ (0,
|
|
6623
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
6723
6624
|
"path",
|
|
6724
6625
|
{
|
|
6725
6626
|
fillRule: "evenodd",
|
|
@@ -6734,9 +6635,9 @@ function LogoWithTextHorizonIcon(props) {
|
|
|
6734
6635
|
}
|
|
6735
6636
|
|
|
6736
6637
|
// src/editor/components/icons/logo-with-text-vertical.tsx
|
|
6737
|
-
var
|
|
6638
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
6738
6639
|
function LogoWithTextVerticalIcon(props) {
|
|
6739
|
-
return /* @__PURE__ */ (0,
|
|
6640
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
6740
6641
|
"svg",
|
|
6741
6642
|
__spreadProps(__spreadValues({
|
|
6742
6643
|
width: "14",
|
|
@@ -6746,7 +6647,7 @@ function LogoWithTextVerticalIcon(props) {
|
|
|
6746
6647
|
xmlns: "http://www.w3.org/2000/svg"
|
|
6747
6648
|
}, props), {
|
|
6748
6649
|
children: [
|
|
6749
|
-
/* @__PURE__ */ (0,
|
|
6650
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
6750
6651
|
"path",
|
|
6751
6652
|
{
|
|
6752
6653
|
fillRule: "evenodd",
|
|
@@ -6755,7 +6656,7 @@ function LogoWithTextVerticalIcon(props) {
|
|
|
6755
6656
|
fill: "currentColor"
|
|
6756
6657
|
}
|
|
6757
6658
|
),
|
|
6758
|
-
/* @__PURE__ */ (0,
|
|
6659
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
6759
6660
|
"rect",
|
|
6760
6661
|
{
|
|
6761
6662
|
x: "4.25",
|
|
@@ -6767,8 +6668,8 @@ function LogoWithTextVerticalIcon(props) {
|
|
|
6767
6668
|
strokeWidth: "0.5"
|
|
6768
6669
|
}
|
|
6769
6670
|
),
|
|
6770
|
-
/* @__PURE__ */ (0,
|
|
6771
|
-
/* @__PURE__ */ (0,
|
|
6671
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("rect", { x: "6", y: "6", width: "2", height: "1", rx: "0.5", fill: "currentColor" }),
|
|
6672
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
6772
6673
|
"path",
|
|
6773
6674
|
{
|
|
6774
6675
|
fillRule: "evenodd",
|
|
@@ -6777,7 +6678,7 @@ function LogoWithTextVerticalIcon(props) {
|
|
|
6777
6678
|
fill: "currentColor"
|
|
6778
6679
|
}
|
|
6779
6680
|
),
|
|
6780
|
-
/* @__PURE__ */ (0,
|
|
6681
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
6781
6682
|
"path",
|
|
6782
6683
|
{
|
|
6783
6684
|
fillRule: "evenodd",
|
|
@@ -6792,12 +6693,12 @@ function LogoWithTextVerticalIcon(props) {
|
|
|
6792
6693
|
}
|
|
6793
6694
|
|
|
6794
6695
|
// src/blocks/headers.tsx
|
|
6795
|
-
var
|
|
6696
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
6796
6697
|
var headerLogoWithTextHorizontal = {
|
|
6797
6698
|
title: "Logo with Text (Horizontal)",
|
|
6798
6699
|
description: "Logo and a text horizontally",
|
|
6799
6700
|
searchTerms: ["logo", "text"],
|
|
6800
|
-
icon: /* @__PURE__ */ (0,
|
|
6701
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(LogoWithTextHorizonIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6801
6702
|
command: ({ editor, range }) => {
|
|
6802
6703
|
editor.chain().deleteRange(range).insertContent({
|
|
6803
6704
|
type: "columns",
|
|
@@ -6861,7 +6762,7 @@ var headerLogoWithTextVertical = {
|
|
|
6861
6762
|
title: "Logo with Text (Vertical)",
|
|
6862
6763
|
description: "Logo and a text vertically",
|
|
6863
6764
|
searchTerms: ["logo", "text"],
|
|
6864
|
-
icon: /* @__PURE__ */ (0,
|
|
6765
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(LogoWithTextVerticalIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6865
6766
|
command: ({ editor, range }) => {
|
|
6866
6767
|
editor.chain().deleteRange(range).insertContent([
|
|
6867
6768
|
{
|
|
@@ -6892,7 +6793,7 @@ var headerLogoWithCoverImage = {
|
|
|
6892
6793
|
title: "Logo with Cover Image",
|
|
6893
6794
|
description: "Logo and a cover image",
|
|
6894
6795
|
searchTerms: ["logo", "cover", "image"],
|
|
6895
|
-
icon: /* @__PURE__ */ (0,
|
|
6796
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(LogoWithCoverImageIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6896
6797
|
command: ({ editor, range }) => {
|
|
6897
6798
|
const todayFormatted = (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", {
|
|
6898
6799
|
year: "numeric",
|
|
@@ -6980,13 +6881,13 @@ var headerLogoWithCoverImage = {
|
|
|
6980
6881
|
};
|
|
6981
6882
|
|
|
6982
6883
|
// src/blocks/footers.tsx
|
|
6983
|
-
var
|
|
6984
|
-
var
|
|
6884
|
+
var import_lucide_react17 = require("lucide-react");
|
|
6885
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
6985
6886
|
var footerCopyrightText = {
|
|
6986
6887
|
title: "Footer Copyright",
|
|
6987
6888
|
description: "Copyright text for the footer.",
|
|
6988
6889
|
searchTerms: ["footer", "copyright"],
|
|
6989
|
-
icon: /* @__PURE__ */ (0,
|
|
6890
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react17.CopyrightIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6990
6891
|
command: ({ editor, range }) => {
|
|
6991
6892
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
6992
6893
|
editor.chain().focus().deleteRange(range).insertContent({
|
|
@@ -7006,7 +6907,7 @@ var footerCommunityFeedbackCta = {
|
|
|
7006
6907
|
title: "Footer Community Feedback CTA",
|
|
7007
6908
|
description: "Community feedback CTA for the footer.",
|
|
7008
6909
|
searchTerms: ["footer", "community", "feedback", "cta"],
|
|
7009
|
-
icon: /* @__PURE__ */ (0,
|
|
6910
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react17.RectangleHorizontalIcon, { className: "mly:h-4 mly:w-4" }),
|
|
7010
6911
|
command: ({ editor, range }) => {
|
|
7011
6912
|
editor.chain().focus().deleteRange(range).insertContent([
|
|
7012
6913
|
{
|
|
@@ -7049,7 +6950,7 @@ var footerCompanySignature = {
|
|
|
7049
6950
|
title: "Footer Company Signature",
|
|
7050
6951
|
description: "Company signature for the footer.",
|
|
7051
6952
|
searchTerms: ["footer", "company", "signature"],
|
|
7052
|
-
icon: /* @__PURE__ */ (0,
|
|
6953
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react17.LayoutTemplateIcon, { className: "mly:h-4 mly:w-4" }),
|
|
7053
6954
|
command: ({ editor, range }) => {
|
|
7054
6955
|
editor.chain().focus().deleteRange(range).insertContent([
|
|
7055
6956
|
{ type: "horizontalRule" },
|
|
@@ -7203,7 +7104,7 @@ var footerCompanySignature = {
|
|
|
7203
7104
|
};
|
|
7204
7105
|
|
|
7205
7106
|
// src/editor/extensions/slash-command/default-slash-commands.tsx
|
|
7206
|
-
var
|
|
7107
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
7207
7108
|
var DEFAULT_SLASH_COMMANDS = [
|
|
7208
7109
|
{
|
|
7209
7110
|
title: "Blocks",
|
|
@@ -7238,7 +7139,7 @@ var DEFAULT_SLASH_COMMANDS = [
|
|
|
7238
7139
|
title: "Headers",
|
|
7239
7140
|
description: "Add pre-designed headers block",
|
|
7240
7141
|
searchTerms: ["header", "headers"],
|
|
7241
|
-
icon: /* @__PURE__ */ (0,
|
|
7142
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react18.Heading1, { className: "mly:h-4 mly:w-4" }),
|
|
7242
7143
|
preview: "https://cdn.usemaily.com/previews/header-preview-xyz.png",
|
|
7243
7144
|
commands: [
|
|
7244
7145
|
headerLogoWithTextVertical,
|
|
@@ -7251,7 +7152,7 @@ var DEFAULT_SLASH_COMMANDS = [
|
|
|
7251
7152
|
title: "Footers",
|
|
7252
7153
|
description: "Add pre-designed footers block",
|
|
7253
7154
|
searchTerms: ["footers"],
|
|
7254
|
-
icon: /* @__PURE__ */ (0,
|
|
7155
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react18.FootprintsIcon, { className: "mly:h-4 mly:w-4" }),
|
|
7255
7156
|
commands: [
|
|
7256
7157
|
footerCopyrightText,
|
|
7257
7158
|
footerCommunityFeedbackCta,
|
|
@@ -7264,18 +7165,18 @@ var DEFAULT_SLASH_COMMANDS = [
|
|
|
7264
7165
|
];
|
|
7265
7166
|
|
|
7266
7167
|
// src/editor/provider.tsx
|
|
7267
|
-
var
|
|
7168
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
7268
7169
|
var DEFAULT_PLACEHOLDER_URL = "https://maily.to/";
|
|
7269
|
-
var MailyContext = (0,
|
|
7170
|
+
var MailyContext = (0, import_react21.createContext)({
|
|
7270
7171
|
placeholderUrl: DEFAULT_PLACEHOLDER_URL,
|
|
7271
7172
|
blocks: DEFAULT_SLASH_COMMANDS
|
|
7272
7173
|
});
|
|
7273
7174
|
function MailyProvider(props) {
|
|
7274
7175
|
const _a = props, { children } = _a, defaultValues = __objRest(_a, ["children"]);
|
|
7275
|
-
return /* @__PURE__ */ (0,
|
|
7176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(MailyContext.Provider, { value: defaultValues, children });
|
|
7276
7177
|
}
|
|
7277
7178
|
function useMailyContext() {
|
|
7278
|
-
const values = (0,
|
|
7179
|
+
const values = (0, import_react21.useContext)(MailyContext);
|
|
7279
7180
|
if (!values) {
|
|
7280
7181
|
throw new Error("Missing MailyContext.Provider in the component tree");
|
|
7281
7182
|
}
|
|
@@ -7283,23 +7184,23 @@ function useMailyContext() {
|
|
|
7283
7184
|
}
|
|
7284
7185
|
|
|
7285
7186
|
// src/editor/components/ui/link-input-popover.tsx
|
|
7286
|
-
var
|
|
7187
|
+
var import_react27 = require("react");
|
|
7287
7188
|
|
|
7288
7189
|
// src/editor/nodes/variable/variable.ts
|
|
7289
7190
|
var import_core7 = require("@tiptap/core");
|
|
7290
7191
|
var import_state5 = require("@tiptap/pm/state");
|
|
7291
|
-
var
|
|
7192
|
+
var import_react25 = require("@tiptap/react");
|
|
7292
7193
|
var import_suggestion = __toESM(require("@tiptap/suggestion"), 1);
|
|
7293
7194
|
|
|
7294
7195
|
// src/editor/nodes/variable/variable-suggestions-popover.tsx
|
|
7295
|
-
var
|
|
7296
|
-
var
|
|
7297
|
-
var
|
|
7298
|
-
var VariableSuggestionsPopover = (0,
|
|
7196
|
+
var import_lucide_react19 = require("lucide-react");
|
|
7197
|
+
var import_react22 = require("react");
|
|
7198
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
7199
|
+
var VariableSuggestionsPopover = (0, import_react22.forwardRef)((props, ref) => {
|
|
7299
7200
|
const { items, onSelectItem } = props;
|
|
7300
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
7301
|
-
const scrollContainerRef = (0,
|
|
7302
|
-
const itemRefs = (0,
|
|
7201
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react22.useState)(0);
|
|
7202
|
+
const scrollContainerRef = (0, import_react22.useRef)(null);
|
|
7203
|
+
const itemRefs = (0, import_react22.useRef)([]);
|
|
7303
7204
|
const scrollSelectedIntoView = (index) => {
|
|
7304
7205
|
const container = scrollContainerRef.current;
|
|
7305
7206
|
const selectedItem = itemRefs.current[index];
|
|
@@ -7315,17 +7216,17 @@ var VariableSuggestionsPopover = (0, import_react25.forwardRef)((props, ref) =>
|
|
|
7315
7216
|
container.scrollTop += itemRect.top - containerRect.top - padding;
|
|
7316
7217
|
}
|
|
7317
7218
|
};
|
|
7318
|
-
(0,
|
|
7219
|
+
(0, import_react22.useEffect)(() => {
|
|
7319
7220
|
setSelectedIndex(0);
|
|
7320
7221
|
if (scrollContainerRef.current) {
|
|
7321
7222
|
scrollContainerRef.current.scrollTop = 0;
|
|
7322
7223
|
}
|
|
7323
7224
|
itemRefs.current = items.map(() => null);
|
|
7324
7225
|
}, [items]);
|
|
7325
|
-
(0,
|
|
7226
|
+
(0, import_react22.useEffect)(() => {
|
|
7326
7227
|
scrollSelectedIntoView(selectedIndex);
|
|
7327
7228
|
}, [selectedIndex]);
|
|
7328
|
-
(0,
|
|
7229
|
+
(0, import_react22.useImperativeHandle)(ref, () => ({
|
|
7329
7230
|
moveUp: () => {
|
|
7330
7231
|
setSelectedIndex((selectedIndex + items.length - 1) % items.length);
|
|
7331
7232
|
},
|
|
@@ -7340,17 +7241,17 @@ var VariableSuggestionsPopover = (0, import_react25.forwardRef)((props, ref) =>
|
|
|
7340
7241
|
onSelectItem(item);
|
|
7341
7242
|
}
|
|
7342
7243
|
}));
|
|
7343
|
-
return /* @__PURE__ */ (0,
|
|
7344
|
-
/* @__PURE__ */ (0,
|
|
7345
|
-
/* @__PURE__ */ (0,
|
|
7346
|
-
/* @__PURE__ */ (0,
|
|
7244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("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: [
|
|
7245
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("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: [
|
|
7246
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "mly:text-xs mly:uppercase", children: "Variables" }),
|
|
7247
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(VariableIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react19.Braces, { className: "mly:size-3 mly:stroke-[2.5]" }) })
|
|
7347
7248
|
] }),
|
|
7348
|
-
/* @__PURE__ */ (0,
|
|
7249
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
7349
7250
|
"div",
|
|
7350
7251
|
{
|
|
7351
7252
|
ref: scrollContainerRef,
|
|
7352
7253
|
className: "mly:max-h-52 mly:overflow-y-auto mly:scrollbar-thin mly:scrollbar-track-transparent mly:scrollbar-thumb-gray-200",
|
|
7353
|
-
children: /* @__PURE__ */ (0,
|
|
7254
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("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__ */ (0, import_jsx_runtime32.jsxs)(
|
|
7354
7255
|
"button",
|
|
7355
7256
|
{
|
|
7356
7257
|
ref: (el) => itemRefs.current[index] = el,
|
|
@@ -7360,27 +7261,27 @@ var VariableSuggestionsPopover = (0, import_react25.forwardRef)((props, ref) =>
|
|
|
7360
7261
|
index === selectedIndex ? "mly:bg-soft-gray" : "mly:bg-white"
|
|
7361
7262
|
),
|
|
7362
7263
|
children: [
|
|
7363
|
-
/* @__PURE__ */ (0,
|
|
7264
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react19.Braces, { className: "mly:size-3 mly:stroke-[2.5] mly:text-rose-600" }),
|
|
7364
7265
|
(item == null ? void 0 : item.label) || item.name
|
|
7365
7266
|
]
|
|
7366
7267
|
},
|
|
7367
7268
|
index
|
|
7368
|
-
)) : /* @__PURE__ */ (0,
|
|
7269
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "mly:flex mly:h-7 mly:w-full mly:items-center mly:gap-2 mly:rounded-md mly:px-2 mly:py-1 mly:text-left mly:font-mono mly:text-[13px] mly:text-gray-900 mly:hover:bg-soft-gray", children: "No result" }) })
|
|
7369
7270
|
}
|
|
7370
7271
|
),
|
|
7371
|
-
/* @__PURE__ */ (0,
|
|
7372
|
-
/* @__PURE__ */ (0,
|
|
7373
|
-
/* @__PURE__ */ (0,
|
|
7374
|
-
/* @__PURE__ */ (0,
|
|
7375
|
-
/* @__PURE__ */ (0,
|
|
7272
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("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: [
|
|
7273
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "mly:flex mly:items-center mly:gap-1", children: [
|
|
7274
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(VariableIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react19.ArrowDownIcon, { className: "mly:size-3 mly:stroke-[2.5]" }) }),
|
|
7275
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(VariableIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react19.ArrowUpIcon, { className: "mly:size-3 mly:stroke-[2.5]" }) }),
|
|
7276
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "mly:text-xs mly:text-gray-500", children: "Navigate" })
|
|
7376
7277
|
] }),
|
|
7377
|
-
/* @__PURE__ */ (0,
|
|
7278
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(VariableIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react19.CornerDownLeftIcon, { className: "mly:size-3 mly:stroke-[2.5]" }) })
|
|
7378
7279
|
] })
|
|
7379
7280
|
] });
|
|
7380
7281
|
});
|
|
7381
7282
|
function VariableIcon(props) {
|
|
7382
7283
|
const { className, children } = props;
|
|
7383
|
-
return /* @__PURE__ */ (0,
|
|
7284
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
7384
7285
|
"div",
|
|
7385
7286
|
{
|
|
7386
7287
|
className: cn(
|
|
@@ -7393,10 +7294,10 @@ function VariableIcon(props) {
|
|
|
7393
7294
|
}
|
|
7394
7295
|
|
|
7395
7296
|
// src/editor/nodes/variable/variable-view.tsx
|
|
7396
|
-
var
|
|
7397
|
-
var
|
|
7398
|
-
var
|
|
7399
|
-
var
|
|
7297
|
+
var import_react23 = require("@tiptap/react");
|
|
7298
|
+
var import_lucide_react20 = require("lucide-react");
|
|
7299
|
+
var import_react24 = require("react");
|
|
7300
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
7400
7301
|
function VariableView(props) {
|
|
7401
7302
|
const { node, updateAttributes: updateAttributes2, editor } = props;
|
|
7402
7303
|
const {
|
|
@@ -7406,24 +7307,24 @@ function VariableView(props) {
|
|
|
7406
7307
|
hideDefaultValue = false,
|
|
7407
7308
|
label
|
|
7408
7309
|
} = node.attrs;
|
|
7409
|
-
const renderVariable = (0,
|
|
7310
|
+
const renderVariable = (0, import_react24.useMemo)(() => {
|
|
7410
7311
|
var _a, _b;
|
|
7411
7312
|
const variableRender = (_b = (_a = getNodeOptions(editor, "variable")) == null ? void 0 : _a.renderVariable) != null ? _b : DEFAULT_RENDER_VARIABLE_FUNCTION;
|
|
7412
7313
|
return variableRender;
|
|
7413
7314
|
}, [editor]);
|
|
7414
|
-
return /* @__PURE__ */ (0,
|
|
7415
|
-
|
|
7315
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
7316
|
+
import_react23.NodeViewWrapper,
|
|
7416
7317
|
{
|
|
7417
7318
|
className: "react-component mly:inline-block mly:leading-none",
|
|
7418
7319
|
draggable: "false",
|
|
7419
|
-
children: /* @__PURE__ */ (0,
|
|
7320
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
7420
7321
|
Popover,
|
|
7421
7322
|
{
|
|
7422
7323
|
onOpenChange: (open) => {
|
|
7423
7324
|
editor.storage.variable.popover = open;
|
|
7424
7325
|
},
|
|
7425
7326
|
children: [
|
|
7426
|
-
/* @__PURE__ */ (0,
|
|
7327
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(PopoverTrigger, { children: renderVariable({
|
|
7427
7328
|
variable: {
|
|
7428
7329
|
name: id,
|
|
7429
7330
|
required,
|
|
@@ -7434,7 +7335,7 @@ function VariableView(props) {
|
|
|
7434
7335
|
editor,
|
|
7435
7336
|
from: "content-variable"
|
|
7436
7337
|
}) }),
|
|
7437
|
-
/* @__PURE__ */ (0,
|
|
7338
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
7438
7339
|
PopoverContent,
|
|
7439
7340
|
{
|
|
7440
7341
|
align: "start",
|
|
@@ -7443,10 +7344,10 @@ function VariableView(props) {
|
|
|
7443
7344
|
sideOffset: 8,
|
|
7444
7345
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
7445
7346
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
7446
|
-
children: /* @__PURE__ */ (0,
|
|
7447
|
-
/* @__PURE__ */ (0,
|
|
7448
|
-
/* @__PURE__ */ (0,
|
|
7449
|
-
/* @__PURE__ */ (0,
|
|
7347
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "mly:flex mly:items-stretch mly:text-midnight-gray", children: [
|
|
7348
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "mly:relative", children: [
|
|
7349
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "mly:inline-block mly:px-2 mly:text-xs mly:text-midnight-gray", children: "Variable" }),
|
|
7350
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
7450
7351
|
"input",
|
|
7451
7352
|
__spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
|
|
7452
7353
|
value: id != null ? id : "",
|
|
@@ -7460,11 +7361,11 @@ function VariableView(props) {
|
|
|
7460
7361
|
})
|
|
7461
7362
|
)
|
|
7462
7363
|
] }),
|
|
7463
|
-
!hideDefaultValue && /* @__PURE__ */ (0,
|
|
7464
|
-
/* @__PURE__ */ (0,
|
|
7465
|
-
/* @__PURE__ */ (0,
|
|
7466
|
-
/* @__PURE__ */ (0,
|
|
7467
|
-
/* @__PURE__ */ (0,
|
|
7364
|
+
!hideDefaultValue && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
7365
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Divider, { className: "mly:mx-1.5" }),
|
|
7366
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("label", { className: "mly:relative", children: [
|
|
7367
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "mly:inline-block mly:px-2 mly:pl-1 mly:text-xs mly:text-midnight-gray", children: "Default" }),
|
|
7368
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
7468
7369
|
"input",
|
|
7469
7370
|
__spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
|
|
7470
7371
|
value: fallback != null ? fallback : "",
|
|
@@ -7477,7 +7378,7 @@ function VariableView(props) {
|
|
|
7477
7378
|
className: "mly:h-7 mly:w-32 mly:rounded-md mly:bg-soft-gray mly:px-2 mly:pr-6 mly:text-sm mly:text-midnight-gray mly:focus:bg-soft-gray mly:focus:outline-none"
|
|
7478
7379
|
})
|
|
7479
7380
|
),
|
|
7480
|
-
/* @__PURE__ */ (0,
|
|
7381
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "mly:absolute mly:inset-y-0 mly:right-1 mly:flex mly:items-center", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react20.Pencil, { className: "mly:h-3 mly:w-3 mly:stroke-[2.5] mly:text-midnight-gray" }) })
|
|
7481
7382
|
] })
|
|
7482
7383
|
] })
|
|
7483
7384
|
] }) })
|
|
@@ -7494,13 +7395,13 @@ var DefaultRenderVariable = (props) => {
|
|
|
7494
7395
|
const { name, required, valid, label } = variable;
|
|
7495
7396
|
const variableLabel = label || name;
|
|
7496
7397
|
if (from === "button-variable") {
|
|
7497
|
-
return /* @__PURE__ */ (0,
|
|
7498
|
-
/* @__PURE__ */ (0,
|
|
7499
|
-
/* @__PURE__ */ (0,
|
|
7398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("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: [
|
|
7399
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react20.Braces, { className: "mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5]" }),
|
|
7400
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "mly:min-w-0 mly:truncate mly:text-left", children: variableLabel })
|
|
7500
7401
|
] });
|
|
7501
7402
|
}
|
|
7502
7403
|
if (from === "bubble-variable") {
|
|
7503
|
-
return /* @__PURE__ */ (0,
|
|
7404
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
7504
7405
|
"div",
|
|
7505
7406
|
{
|
|
7506
7407
|
className: cn(
|
|
@@ -7508,21 +7409,21 @@ var DefaultRenderVariable = (props) => {
|
|
|
7508
7409
|
!valid && "mly:border-rose-400 mly:bg-rose-50 mly:text-rose-600 mly:hover:bg-rose-100"
|
|
7509
7410
|
),
|
|
7510
7411
|
children: [
|
|
7511
|
-
/* @__PURE__ */ (0,
|
|
7512
|
-
/* @__PURE__ */ (0,
|
|
7412
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react20.Braces, { className: "mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5] mly:text-rose-600" }),
|
|
7413
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "mly:min-w-0 mly:truncate mly:text-left", children: variableLabel })
|
|
7513
7414
|
]
|
|
7514
7415
|
}
|
|
7515
7416
|
);
|
|
7516
7417
|
}
|
|
7517
|
-
return /* @__PURE__ */ (0,
|
|
7418
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
7518
7419
|
"span",
|
|
7519
7420
|
{
|
|
7520
7421
|
tabIndex: -1,
|
|
7521
7422
|
className: "mly:inline-flex mly:items-center mly:gap-(--variable-icon-gap) mly:rounded-full mly:border mly:border-gray-200 mly:px-1.5 mly:py-0.5 mly:leading-none",
|
|
7522
7423
|
children: [
|
|
7523
|
-
/* @__PURE__ */ (0,
|
|
7424
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react20.Braces, { className: "mly:size-[var(--variable-icon-size)] mly:shrink-0 mly:stroke-[2.5] mly:text-rose-600" }),
|
|
7524
7425
|
variableLabel,
|
|
7525
|
-
required && !fallback && /* @__PURE__ */ (0,
|
|
7426
|
+
required && !fallback && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react20.AlertTriangle, { className: "mly:size-[var(--variable-icon-size)] mly:shrink-0 mly:stroke-[2.5]" })
|
|
7526
7427
|
]
|
|
7527
7428
|
}
|
|
7528
7429
|
);
|
|
@@ -7695,7 +7596,7 @@ var VariableExtension = import_core7.Node.create({
|
|
|
7695
7596
|
];
|
|
7696
7597
|
},
|
|
7697
7598
|
addNodeView() {
|
|
7698
|
-
return (0,
|
|
7599
|
+
return (0, import_react25.ReactNodeViewRenderer)(VariableView, {
|
|
7699
7600
|
className: "mly:relative mly:inline-block",
|
|
7700
7601
|
as: "div"
|
|
7701
7602
|
});
|
|
@@ -7703,26 +7604,26 @@ var VariableExtension = import_core7.Node.create({
|
|
|
7703
7604
|
});
|
|
7704
7605
|
|
|
7705
7606
|
// src/editor/components/ui/link-input-popover.tsx
|
|
7706
|
-
var
|
|
7607
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
7707
7608
|
function LinkInputPopover(props) {
|
|
7708
7609
|
var _a, _b;
|
|
7709
7610
|
const {
|
|
7710
7611
|
defaultValue = "",
|
|
7711
7612
|
onValueChange,
|
|
7712
7613
|
tooltip,
|
|
7713
|
-
icon: Icon =
|
|
7614
|
+
icon: Icon = import_lucide_react21.Link,
|
|
7714
7615
|
editor,
|
|
7715
7616
|
isVariable
|
|
7716
7617
|
} = props;
|
|
7717
|
-
const [isOpen, setIsOpen] = (0,
|
|
7718
|
-
const [isEditing, setIsEditing] = (0,
|
|
7719
|
-
const linkInputRef = (0,
|
|
7618
|
+
const [isOpen, setIsOpen] = (0, import_react26.useState)(false);
|
|
7619
|
+
const [isEditing, setIsEditing] = (0, import_react26.useState)(!isVariable);
|
|
7620
|
+
const linkInputRef = (0, import_react26.useRef)(null);
|
|
7720
7621
|
const { placeholderUrl = DEFAULT_PLACEHOLDER_URL } = useMailyContext();
|
|
7721
7622
|
const options = useVariableOptions(editor);
|
|
7722
7623
|
const renderVariable = options == null ? void 0 : options.renderVariable;
|
|
7723
7624
|
const variables = options == null ? void 0 : options.variables;
|
|
7724
7625
|
const variableTriggerCharacter = (_b = (_a = options == null ? void 0 : options.suggestion) == null ? void 0 : _a.char) != null ? _b : DEFAULT_VARIABLE_TRIGGER_CHAR;
|
|
7725
|
-
const autoCompleteOptions = (0,
|
|
7626
|
+
const autoCompleteOptions = (0, import_react27.useMemo)(() => {
|
|
7726
7627
|
const withoutTrigger = defaultValue.replace(
|
|
7727
7628
|
new RegExp(variableTriggerCharacter, "g"),
|
|
7728
7629
|
""
|
|
@@ -7733,7 +7634,7 @@ function LinkInputPopover(props) {
|
|
|
7733
7634
|
editor
|
|
7734
7635
|
}).map((variable) => variable.name);
|
|
7735
7636
|
}, [variables, variableTriggerCharacter, defaultValue, editor]);
|
|
7736
|
-
const popoverButton = /* @__PURE__ */ (0,
|
|
7637
|
+
const popoverButton = /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
7737
7638
|
BaseButton,
|
|
7738
7639
|
{
|
|
7739
7640
|
variant: "ghost",
|
|
@@ -7741,10 +7642,10 @@ function LinkInputPopover(props) {
|
|
|
7741
7642
|
type: "button",
|
|
7742
7643
|
className: "mly:h-7! mly:w-7!",
|
|
7743
7644
|
"data-state": !!defaultValue,
|
|
7744
|
-
children: /* @__PURE__ */ (0,
|
|
7645
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Icon, { className: "mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5] mly:text-midnight-gray" })
|
|
7745
7646
|
}
|
|
7746
7647
|
) });
|
|
7747
|
-
return /* @__PURE__ */ (0,
|
|
7648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
7748
7649
|
Popover,
|
|
7749
7650
|
{
|
|
7750
7651
|
open: isOpen,
|
|
@@ -7758,11 +7659,18 @@ function LinkInputPopover(props) {
|
|
|
7758
7659
|
}
|
|
7759
7660
|
},
|
|
7760
7661
|
children: [
|
|
7761
|
-
tooltip ? /* @__PURE__ */ (0,
|
|
7762
|
-
/* @__PURE__ */ (0,
|
|
7763
|
-
/* @__PURE__ */ (0,
|
|
7662
|
+
tooltip ? /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Tooltip, { children: [
|
|
7663
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TooltipTrigger, { asChild: true, children: popoverButton }),
|
|
7664
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
7665
|
+
TooltipContent,
|
|
7666
|
+
{
|
|
7667
|
+
sideOffset: 8,
|
|
7668
|
+
className: "mly:border-gray-300 mly:bg-transparent mly:p-0 mly:text-gray-700 mly:shadow-sm",
|
|
7669
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "mly:block mly:rounded-md mly:bg-soft-gray mly:!px-2 mly:!py-1.5", children: tooltip })
|
|
7670
|
+
}
|
|
7671
|
+
)
|
|
7764
7672
|
] }) : popoverButton,
|
|
7765
|
-
/* @__PURE__ */ (0,
|
|
7673
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
7766
7674
|
PopoverContent,
|
|
7767
7675
|
{
|
|
7768
7676
|
align: "end",
|
|
@@ -7770,7 +7678,7 @@ function LinkInputPopover(props) {
|
|
|
7770
7678
|
className: "mly:w-max mly:rounded-none mly:border-none mly:bg-transparent mly:p-0! mly:shadow-none",
|
|
7771
7679
|
sideOffset: 8,
|
|
7772
7680
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
7773
|
-
children: /* @__PURE__ */ (0,
|
|
7681
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
7774
7682
|
"form",
|
|
7775
7683
|
{
|
|
7776
7684
|
onSubmit: (e) => {
|
|
@@ -7782,8 +7690,8 @@ function LinkInputPopover(props) {
|
|
|
7782
7690
|
onValueChange == null ? void 0 : onValueChange(input.value);
|
|
7783
7691
|
setIsOpen(false);
|
|
7784
7692
|
},
|
|
7785
|
-
children: /* @__PURE__ */ (0,
|
|
7786
|
-
!isEditing && /* @__PURE__ */ (0,
|
|
7693
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "mly:isolate mly:flex mly:rounded-lg", children: [
|
|
7694
|
+
!isEditing && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("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__ */ (0, import_jsx_runtime34.jsx)(
|
|
7787
7695
|
"button",
|
|
7788
7696
|
{
|
|
7789
7697
|
onClick: () => {
|
|
@@ -7804,9 +7712,9 @@ function LinkInputPopover(props) {
|
|
|
7804
7712
|
})
|
|
7805
7713
|
}
|
|
7806
7714
|
) }),
|
|
7807
|
-
isEditing && /* @__PURE__ */ (0,
|
|
7808
|
-
/* @__PURE__ */ (0,
|
|
7809
|
-
/* @__PURE__ */ (0,
|
|
7715
|
+
isEditing && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "mly:relative", children: [
|
|
7716
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "mly:absolute mly:inset-y-0 mly:left-1.5 mly:z-10 mly:flex mly:items-center", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react21.LinkIcon, { className: "mly:h-3 mly:w-3 mly:stroke-[2.5] mly:text-midnight-gray" }) }),
|
|
7717
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
7810
7718
|
InputAutocomplete,
|
|
7811
7719
|
{
|
|
7812
7720
|
editor,
|
|
@@ -7842,12 +7750,12 @@ function LinkInputPopover(props) {
|
|
|
7842
7750
|
}
|
|
7843
7751
|
|
|
7844
7752
|
// src/editor/components/image-menu/image-size.tsx
|
|
7845
|
-
var
|
|
7753
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
7846
7754
|
function ImageSize(props) {
|
|
7847
7755
|
const { value, onValueChange, dimension } = props;
|
|
7848
|
-
return /* @__PURE__ */ (0,
|
|
7849
|
-
/* @__PURE__ */ (0,
|
|
7850
|
-
/* @__PURE__ */ (0,
|
|
7756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("label", { className: "mly:relative mly:flex mly:items-center", children: [
|
|
7757
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("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" }),
|
|
7758
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
7851
7759
|
"input",
|
|
7852
7760
|
__spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
|
|
7853
7761
|
className: "hide-number-controls mly:h-auto mly:max-w-20 mly:appearance-none mly:border-0 mly:border-none mly:p-1 mly:px-[26px] mly:text-sm mly:uppercase mly:tabular-nums mly:outline-hidden mly:focus-visible:outline-hidden",
|
|
@@ -7856,15 +7764,15 @@ function ImageSize(props) {
|
|
|
7856
7764
|
onChange: (e) => onValueChange(e.target.value)
|
|
7857
7765
|
})
|
|
7858
7766
|
),
|
|
7859
|
-
/* @__PURE__ */ (0,
|
|
7767
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "mly:absolute mly:inset-y-0 mly:right-1 mly:flex mly:items-center mly:text-xs mly:leading-none mly:text-gray-400", children: "PX" })
|
|
7860
7768
|
] });
|
|
7861
7769
|
}
|
|
7862
7770
|
|
|
7863
7771
|
// src/editor/components/image-menu/use-image-state.tsx
|
|
7864
|
-
var
|
|
7865
|
-
var
|
|
7772
|
+
var import_react28 = require("@tiptap/react");
|
|
7773
|
+
var import_fast_deep_equal2 = __toESM(require("fast-deep-equal"), 1);
|
|
7866
7774
|
var useImageState = (editor) => {
|
|
7867
|
-
const states = (0,
|
|
7775
|
+
const states = (0, import_react28.useEditorState)({
|
|
7868
7776
|
editor,
|
|
7869
7777
|
selector: ({ editor: editor2 }) => {
|
|
7870
7778
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
@@ -7885,13 +7793,13 @@ var useImageState = (editor) => {
|
|
|
7885
7793
|
currentShowIfKey: ((_o = editor2.getAttributes("image")) == null ? void 0 : _o.showIfKey) || ((_p = editor2.getAttributes("logo")) == null ? void 0 : _p.showIfKey) || ""
|
|
7886
7794
|
};
|
|
7887
7795
|
},
|
|
7888
|
-
equalityFn:
|
|
7796
|
+
equalityFn: import_fast_deep_equal2.default
|
|
7889
7797
|
});
|
|
7890
7798
|
return states;
|
|
7891
7799
|
};
|
|
7892
7800
|
|
|
7893
7801
|
// src/editor/components/image-menu/image-bubble-menu.tsx
|
|
7894
|
-
var
|
|
7802
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
7895
7803
|
function ImageBubbleMenu(props) {
|
|
7896
7804
|
var _a, _b, _c, _d;
|
|
7897
7805
|
const { editor, appendTo } = props;
|
|
@@ -7910,19 +7818,19 @@ function ImageBubbleMenu(props) {
|
|
|
7910
7818
|
popperOptions: {
|
|
7911
7819
|
modifiers: [{ name: "flip", enabled: false }]
|
|
7912
7820
|
},
|
|
7913
|
-
plugins: [
|
|
7821
|
+
plugins: [import_tippy3.sticky],
|
|
7914
7822
|
sticky: "popper",
|
|
7915
7823
|
maxWidth: "100%"
|
|
7916
7824
|
}
|
|
7917
7825
|
});
|
|
7918
7826
|
const { lockAspectRatio } = state;
|
|
7919
|
-
return /* @__PURE__ */ (0,
|
|
7920
|
-
|
|
7827
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
7828
|
+
import_react29.BubbleMenu,
|
|
7921
7829
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
7922
7830
|
className: "mly:flex mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:p-0.5 mly:shadow-md",
|
|
7923
|
-
children: /* @__PURE__ */ (0,
|
|
7924
|
-
state.isLogoActive && state.imageSrc && /* @__PURE__ */ (0,
|
|
7925
|
-
/* @__PURE__ */ (0,
|
|
7831
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(TooltipProvider, { children: [
|
|
7832
|
+
state.isLogoActive && state.imageSrc && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
7833
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
7926
7834
|
Select,
|
|
7927
7835
|
{
|
|
7928
7836
|
label: "Size",
|
|
@@ -7937,10 +7845,10 @@ function ImageBubbleMenu(props) {
|
|
|
7937
7845
|
}
|
|
7938
7846
|
}
|
|
7939
7847
|
),
|
|
7940
|
-
/* @__PURE__ */ (0,
|
|
7848
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Divider, {})
|
|
7941
7849
|
] }),
|
|
7942
|
-
/* @__PURE__ */ (0,
|
|
7943
|
-
/* @__PURE__ */ (0,
|
|
7850
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
7851
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
7944
7852
|
AlignmentSwitch,
|
|
7945
7853
|
{
|
|
7946
7854
|
alignment: state.alignment,
|
|
@@ -7954,7 +7862,7 @@ function ImageBubbleMenu(props) {
|
|
|
7954
7862
|
}
|
|
7955
7863
|
}
|
|
7956
7864
|
),
|
|
7957
|
-
/* @__PURE__ */ (0,
|
|
7865
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
7958
7866
|
LinkInputPopover,
|
|
7959
7867
|
{
|
|
7960
7868
|
defaultValue: (_a = state == null ? void 0 : state.imageSrc) != null ? _a : "",
|
|
@@ -7972,12 +7880,12 @@ function ImageBubbleMenu(props) {
|
|
|
7972
7880
|
}
|
|
7973
7881
|
},
|
|
7974
7882
|
tooltip: "Source URL",
|
|
7975
|
-
icon:
|
|
7883
|
+
icon: import_lucide_react22.ImageDown,
|
|
7976
7884
|
editor,
|
|
7977
7885
|
isVariable: state.isSrcVariable
|
|
7978
7886
|
}
|
|
7979
7887
|
),
|
|
7980
|
-
state.isImageActive && /* @__PURE__ */ (0,
|
|
7888
|
+
state.isImageActive && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
7981
7889
|
LinkInputPopover,
|
|
7982
7890
|
{
|
|
7983
7891
|
defaultValue: (_b = state == null ? void 0 : state.imageExternalLink) != null ? _b : "",
|
|
@@ -7993,9 +7901,9 @@ function ImageBubbleMenu(props) {
|
|
|
7993
7901
|
}
|
|
7994
7902
|
)
|
|
7995
7903
|
] }),
|
|
7996
|
-
state.isImageActive && state.imageSrc && /* @__PURE__ */ (0,
|
|
7997
|
-
/* @__PURE__ */ (0,
|
|
7998
|
-
/* @__PURE__ */ (0,
|
|
7904
|
+
state.isImageActive && state.imageSrc && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
7905
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Divider, {}),
|
|
7906
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
7999
7907
|
Select,
|
|
8000
7908
|
{
|
|
8001
7909
|
label: "Border Radius",
|
|
@@ -8013,8 +7921,8 @@ function ImageBubbleMenu(props) {
|
|
|
8013
7921
|
className: "mly:capitalize"
|
|
8014
7922
|
}
|
|
8015
7923
|
),
|
|
8016
|
-
/* @__PURE__ */ (0,
|
|
8017
|
-
/* @__PURE__ */ (0,
|
|
7924
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
7925
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8018
7926
|
ImageSize,
|
|
8019
7927
|
{
|
|
8020
7928
|
dimension: "width",
|
|
@@ -8034,7 +7942,7 @@ function ImageBubbleMenu(props) {
|
|
|
8034
7942
|
}
|
|
8035
7943
|
}
|
|
8036
7944
|
),
|
|
8037
|
-
/* @__PURE__ */ (0,
|
|
7945
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8038
7946
|
ImageSize,
|
|
8039
7947
|
{
|
|
8040
7948
|
dimension: "height",
|
|
@@ -8054,7 +7962,7 @@ function ImageBubbleMenu(props) {
|
|
|
8054
7962
|
}
|
|
8055
7963
|
}
|
|
8056
7964
|
),
|
|
8057
|
-
/* @__PURE__ */ (0,
|
|
7965
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
8058
7966
|
BubbleMenuButton,
|
|
8059
7967
|
{
|
|
8060
7968
|
isActive: () => lockAspectRatio,
|
|
@@ -8067,7 +7975,7 @@ function ImageBubbleMenu(props) {
|
|
|
8067
7975
|
aspectRatio
|
|
8068
7976
|
}).run();
|
|
8069
7977
|
},
|
|
8070
|
-
icon: lockAspectRatio ?
|
|
7978
|
+
icon: lockAspectRatio ? import_lucide_react22.LockIcon : import_lucide_react22.LockOpenIcon,
|
|
8071
7979
|
tooltip: "Lock Aspect Ratio"
|
|
8072
7980
|
}
|
|
8073
7981
|
)
|
|
@@ -8079,8 +7987,8 @@ function ImageBubbleMenu(props) {
|
|
|
8079
7987
|
}
|
|
8080
7988
|
|
|
8081
7989
|
// src/editor/components/inline-image-menu/inline-image-bubble-menu.tsx
|
|
8082
|
-
var
|
|
8083
|
-
var
|
|
7990
|
+
var import_react31 = require("@tiptap/react");
|
|
7991
|
+
var import_tippy4 = require("tippy.js");
|
|
8084
7992
|
|
|
8085
7993
|
// src/editor/nodes/inline-image/inline-image.tsx
|
|
8086
7994
|
var import_core8 = require("@tiptap/core");
|
|
@@ -8197,10 +8105,10 @@ var InlineImageExtension = import_core8.Node.create({
|
|
|
8197
8105
|
});
|
|
8198
8106
|
|
|
8199
8107
|
// src/editor/components/inline-image-menu/use-inline-image-state.tsx
|
|
8200
|
-
var
|
|
8201
|
-
var
|
|
8108
|
+
var import_react30 = require("@tiptap/react");
|
|
8109
|
+
var import_fast_deep_equal3 = __toESM(require("fast-deep-equal"), 1);
|
|
8202
8110
|
var useInlineImageState = (editor) => {
|
|
8203
|
-
const states = (0,
|
|
8111
|
+
const states = (0, import_react30.useEditorState)({
|
|
8204
8112
|
editor,
|
|
8205
8113
|
selector: ({ editor: editor2 }) => {
|
|
8206
8114
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -8213,14 +8121,14 @@ var useInlineImageState = (editor) => {
|
|
|
8213
8121
|
isExternalLinkVariable: (_h = (_g = editor2.getAttributes("inlineImage")) == null ? void 0 : _g.isExternalLinkVariable) != null ? _h : false
|
|
8214
8122
|
};
|
|
8215
8123
|
},
|
|
8216
|
-
equalityFn:
|
|
8124
|
+
equalityFn: import_fast_deep_equal3.default
|
|
8217
8125
|
});
|
|
8218
8126
|
return states;
|
|
8219
8127
|
};
|
|
8220
8128
|
|
|
8221
8129
|
// src/editor/components/inline-image-menu/inline-image-bubble-menu.tsx
|
|
8222
|
-
var
|
|
8223
|
-
var
|
|
8130
|
+
var import_lucide_react23 = require("lucide-react");
|
|
8131
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
8224
8132
|
function InlineImageBubbleMenu(props) {
|
|
8225
8133
|
var _a, _b;
|
|
8226
8134
|
const { editor, appendTo } = props;
|
|
@@ -8239,17 +8147,17 @@ function InlineImageBubbleMenu(props) {
|
|
|
8239
8147
|
popperOptions: {
|
|
8240
8148
|
modifiers: [{ name: "flip", enabled: false }]
|
|
8241
8149
|
},
|
|
8242
|
-
plugins: [
|
|
8150
|
+
plugins: [import_tippy4.sticky],
|
|
8243
8151
|
sticky: "popper",
|
|
8244
8152
|
maxWidth: "100%"
|
|
8245
8153
|
}
|
|
8246
8154
|
});
|
|
8247
|
-
return /* @__PURE__ */ (0,
|
|
8248
|
-
|
|
8155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
8156
|
+
import_react31.BubbleMenu,
|
|
8249
8157
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
8250
8158
|
className: "mly:flex mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:p-0.5 mly:shadow-md",
|
|
8251
|
-
children: /* @__PURE__ */ (0,
|
|
8252
|
-
/* @__PURE__ */ (0,
|
|
8159
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
8160
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
8253
8161
|
LinkInputPopover,
|
|
8254
8162
|
{
|
|
8255
8163
|
defaultValue: (_a = state == null ? void 0 : state.src) != null ? _a : "",
|
|
@@ -8260,12 +8168,12 @@ function InlineImageBubbleMenu(props) {
|
|
|
8260
8168
|
}).run();
|
|
8261
8169
|
},
|
|
8262
8170
|
tooltip: "Source URL",
|
|
8263
|
-
icon:
|
|
8171
|
+
icon: import_lucide_react23.ImageDownIcon,
|
|
8264
8172
|
editor,
|
|
8265
8173
|
isVariable: state.isSrcVariable
|
|
8266
8174
|
}
|
|
8267
8175
|
),
|
|
8268
|
-
/* @__PURE__ */ (0,
|
|
8176
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
8269
8177
|
LinkInputPopover,
|
|
8270
8178
|
{
|
|
8271
8179
|
defaultValue: (_b = state == null ? void 0 : state.imageExternalLink) != null ? _b : "",
|
|
@@ -8280,7 +8188,7 @@ function InlineImageBubbleMenu(props) {
|
|
|
8280
8188
|
isVariable: state.isExternalLinkVariable
|
|
8281
8189
|
}
|
|
8282
8190
|
),
|
|
8283
|
-
/* @__PURE__ */ (0,
|
|
8191
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
8284
8192
|
ImageSize,
|
|
8285
8193
|
{
|
|
8286
8194
|
dimension: "height",
|
|
@@ -8299,16 +8207,16 @@ function InlineImageBubbleMenu(props) {
|
|
|
8299
8207
|
}
|
|
8300
8208
|
|
|
8301
8209
|
// src/editor/components/repeat-menu/repeat-bubble-menu.tsx
|
|
8302
|
-
var
|
|
8303
|
-
var
|
|
8304
|
-
var
|
|
8305
|
-
var
|
|
8210
|
+
var import_react33 = require("@tiptap/react");
|
|
8211
|
+
var import_lucide_react24 = require("lucide-react");
|
|
8212
|
+
var import_react34 = require("react");
|
|
8213
|
+
var import_tippy5 = require("tippy.js");
|
|
8306
8214
|
|
|
8307
8215
|
// src/editor/components/repeat-menu/use-repeat-state.ts
|
|
8308
|
-
var
|
|
8309
|
-
var
|
|
8216
|
+
var import_react32 = require("@tiptap/react");
|
|
8217
|
+
var import_fast_deep_equal4 = __toESM(require("fast-deep-equal"), 1);
|
|
8310
8218
|
var useRepeatState = (editor) => {
|
|
8311
|
-
const states = (0,
|
|
8219
|
+
const states = (0, import_react32.useEditorState)({
|
|
8312
8220
|
editor,
|
|
8313
8221
|
selector: (ctx) => {
|
|
8314
8222
|
var _a, _b;
|
|
@@ -8318,20 +8226,20 @@ var useRepeatState = (editor) => {
|
|
|
8318
8226
|
isSectionActive: ctx.editor.isActive("section")
|
|
8319
8227
|
};
|
|
8320
8228
|
},
|
|
8321
|
-
equalityFn:
|
|
8229
|
+
equalityFn: import_fast_deep_equal4.default
|
|
8322
8230
|
});
|
|
8323
8231
|
return states;
|
|
8324
8232
|
};
|
|
8325
8233
|
|
|
8326
8234
|
// src/editor/components/repeat-menu/repeat-bubble-menu.tsx
|
|
8327
|
-
var
|
|
8235
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
8328
8236
|
function RepeatBubbleMenu(props) {
|
|
8329
8237
|
const { appendTo, editor } = props;
|
|
8330
8238
|
if (!editor) {
|
|
8331
8239
|
return null;
|
|
8332
8240
|
}
|
|
8333
8241
|
const state = useRepeatState(editor);
|
|
8334
|
-
const getReferenceClientRect = (0,
|
|
8242
|
+
const getReferenceClientRect = (0, import_react34.useCallback)(() => {
|
|
8335
8243
|
const renderContainer = getRenderContainer(editor, "repeat");
|
|
8336
8244
|
const rect = (renderContainer == null ? void 0 : renderContainer.getBoundingClientRect()) || new DOMRect(-1e3, -1e3, 0, 0);
|
|
8337
8245
|
return rect;
|
|
@@ -8340,7 +8248,7 @@ function RepeatBubbleMenu(props) {
|
|
|
8340
8248
|
shouldShow: ({ editor: editor2 }) => {
|
|
8341
8249
|
var _a;
|
|
8342
8250
|
const activeForNode = getClosestNodeByName(editor2, "repeat");
|
|
8343
|
-
const sectionNodeChildren = activeForNode ? (_a = (0,
|
|
8251
|
+
const sectionNodeChildren = activeForNode ? (_a = (0, import_react33.findChildren)(activeForNode == null ? void 0 : activeForNode.node, (node) => {
|
|
8344
8252
|
return node.type.name === "section";
|
|
8345
8253
|
})) == null ? void 0 : _a[0] : null;
|
|
8346
8254
|
const hasActiveSectionNodeChildren = sectionNodeChildren && editor2.isActive("section");
|
|
@@ -8356,7 +8264,7 @@ function RepeatBubbleMenu(props) {
|
|
|
8356
8264
|
},
|
|
8357
8265
|
getReferenceClientRect,
|
|
8358
8266
|
appendTo: () => appendTo == null ? void 0 : appendTo.current,
|
|
8359
|
-
plugins: [
|
|
8267
|
+
plugins: [import_tippy5.sticky],
|
|
8360
8268
|
sticky: "popper",
|
|
8361
8269
|
maxWidth: "auto"
|
|
8362
8270
|
},
|
|
@@ -8365,10 +8273,10 @@ function RepeatBubbleMenu(props) {
|
|
|
8365
8273
|
const opts = useVariableOptions(editor);
|
|
8366
8274
|
const variables = opts == null ? void 0 : opts.variables;
|
|
8367
8275
|
const renderVariable = opts == null ? void 0 : opts.renderVariable;
|
|
8368
|
-
const inputRef = (0,
|
|
8369
|
-
const [isUpdatingKey, setIsUpdatingKey] = (0,
|
|
8276
|
+
const inputRef = (0, import_react34.useRef)(null);
|
|
8277
|
+
const [isUpdatingKey, setIsUpdatingKey] = (0, import_react34.useState)(false);
|
|
8370
8278
|
const eachKey = (state == null ? void 0 : state.each) || "";
|
|
8371
|
-
const autoCompleteOptions = (0,
|
|
8279
|
+
const autoCompleteOptions = (0, import_react34.useMemo)(() => {
|
|
8372
8280
|
return processVariables(variables, {
|
|
8373
8281
|
query: eachKey || "",
|
|
8374
8282
|
editor,
|
|
@@ -8376,21 +8284,21 @@ function RepeatBubbleMenu(props) {
|
|
|
8376
8284
|
}).map((variable) => variable.name);
|
|
8377
8285
|
}, [variables, eachKey, editor]);
|
|
8378
8286
|
const isValidEachKey = eachKey;
|
|
8379
|
-
return /* @__PURE__ */ (0,
|
|
8380
|
-
|
|
8287
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8288
|
+
import_react33.BubbleMenu,
|
|
8381
8289
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
8382
8290
|
className: "mly:flex mly:items-stretch mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:p-0.5 mly:shadow-md",
|
|
8383
|
-
children: /* @__PURE__ */ (0,
|
|
8384
|
-
/* @__PURE__ */ (0,
|
|
8291
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(TooltipProvider, { children: [
|
|
8292
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "mly:flex mly:items-center mly:gap-1.5 mly:px-1.5 mly:text-sm mly:leading-none", children: [
|
|
8385
8293
|
"Repeat",
|
|
8386
|
-
/* @__PURE__ */ (0,
|
|
8387
|
-
/* @__PURE__ */ (0,
|
|
8388
|
-
|
|
8294
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(Tooltip, { children: [
|
|
8295
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(TooltipTrigger, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8296
|
+
import_lucide_react24.InfoIcon,
|
|
8389
8297
|
{
|
|
8390
8298
|
className: cn("mly:size-3 mly:stroke-[2.5] mly:text-gray-500")
|
|
8391
8299
|
}
|
|
8392
8300
|
) }),
|
|
8393
|
-
/* @__PURE__ */ (0,
|
|
8301
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8394
8302
|
TooltipContent,
|
|
8395
8303
|
{
|
|
8396
8304
|
sideOffset: 14,
|
|
@@ -8401,7 +8309,7 @@ function RepeatBubbleMenu(props) {
|
|
|
8401
8309
|
)
|
|
8402
8310
|
] })
|
|
8403
8311
|
] }),
|
|
8404
|
-
!isUpdatingKey && /* @__PURE__ */ (0,
|
|
8312
|
+
!isUpdatingKey && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8405
8313
|
"button",
|
|
8406
8314
|
{
|
|
8407
8315
|
onClick: () => {
|
|
@@ -8422,7 +8330,7 @@ function RepeatBubbleMenu(props) {
|
|
|
8422
8330
|
})
|
|
8423
8331
|
}
|
|
8424
8332
|
),
|
|
8425
|
-
isUpdatingKey && /* @__PURE__ */ (0,
|
|
8333
|
+
isUpdatingKey && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8426
8334
|
"form",
|
|
8427
8335
|
{
|
|
8428
8336
|
onSubmit: (e) => {
|
|
@@ -8434,7 +8342,7 @@ function RepeatBubbleMenu(props) {
|
|
|
8434
8342
|
setIsUpdatingKey(false);
|
|
8435
8343
|
}
|
|
8436
8344
|
},
|
|
8437
|
-
children: /* @__PURE__ */ (0,
|
|
8345
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8438
8346
|
InputAutocomplete,
|
|
8439
8347
|
{
|
|
8440
8348
|
editor,
|
|
@@ -8460,8 +8368,8 @@ function RepeatBubbleMenu(props) {
|
|
|
8460
8368
|
)
|
|
8461
8369
|
}
|
|
8462
8370
|
),
|
|
8463
|
-
/* @__PURE__ */ (0,
|
|
8464
|
-
/* @__PURE__ */ (0,
|
|
8371
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Divider, {}),
|
|
8372
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
8465
8373
|
ShowPopover,
|
|
8466
8374
|
{
|
|
8467
8375
|
showIfKey: state.currentShowIfKey,
|
|
@@ -8479,16 +8387,16 @@ function RepeatBubbleMenu(props) {
|
|
|
8479
8387
|
}
|
|
8480
8388
|
|
|
8481
8389
|
// src/editor/components/section-menu/section-bubble-menu.tsx
|
|
8482
|
-
var
|
|
8483
|
-
var
|
|
8484
|
-
var
|
|
8485
|
-
var
|
|
8390
|
+
var import_react36 = require("@tiptap/react");
|
|
8391
|
+
var import_lucide_react25 = require("lucide-react");
|
|
8392
|
+
var import_react37 = require("react");
|
|
8393
|
+
var import_tippy6 = require("tippy.js");
|
|
8486
8394
|
|
|
8487
8395
|
// src/editor/components/icons/border-color.tsx
|
|
8488
|
-
var
|
|
8396
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
8489
8397
|
function BorderColor(props) {
|
|
8490
8398
|
const _a = props, { topBarClassName } = _a, rest = __objRest(_a, ["topBarClassName"]);
|
|
8491
|
-
return /* @__PURE__ */ (0,
|
|
8399
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
8492
8400
|
"svg",
|
|
8493
8401
|
__spreadProps(__spreadValues({
|
|
8494
8402
|
width: 11,
|
|
@@ -8498,8 +8406,8 @@ function BorderColor(props) {
|
|
|
8498
8406
|
xmlns: "http://www.w3.org/2000/svg"
|
|
8499
8407
|
}, rest), {
|
|
8500
8408
|
children: [
|
|
8501
|
-
/* @__PURE__ */ (0,
|
|
8502
|
-
/* @__PURE__ */ (0,
|
|
8409
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("path", { d: "M0 11H10.6667", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
8410
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
8503
8411
|
"path",
|
|
8504
8412
|
{
|
|
8505
8413
|
d: "M0.666504 9V6.33333C0.666504 3.38781 3.05432 1 5.99984 1H10.6665",
|
|
@@ -8513,9 +8421,9 @@ function BorderColor(props) {
|
|
|
8513
8421
|
}
|
|
8514
8422
|
|
|
8515
8423
|
// src/editor/components/icons/margin-icon.tsx
|
|
8516
|
-
var
|
|
8424
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
8517
8425
|
function MarginIcon(props) {
|
|
8518
|
-
return /* @__PURE__ */ (0,
|
|
8426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
8519
8427
|
"svg",
|
|
8520
8428
|
__spreadProps(__spreadValues({
|
|
8521
8429
|
width: 12,
|
|
@@ -8524,7 +8432,7 @@ function MarginIcon(props) {
|
|
|
8524
8432
|
fill: "none",
|
|
8525
8433
|
xmlns: "http://www.w3.org/2000/svg"
|
|
8526
8434
|
}, props), {
|
|
8527
|
-
children: /* @__PURE__ */ (0,
|
|
8435
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
8528
8436
|
"path",
|
|
8529
8437
|
{
|
|
8530
8438
|
d: "M10.5 10.499V1.49902M1.5 10.499V1.49902M4.5 5.99902C4.5 5.53308 4.5 5.30011 4.57612 5.11634C4.67761 4.87131 4.87229 4.67664 5.11732 4.57514C5.30109 4.49902 5.53406 4.49902 6 4.49902C6.46594 4.49902 6.69891 4.49902 6.88268 4.57514C7.12771 4.67664 7.32239 4.87131 7.42388 5.11634C7.5 5.30011 7.5 5.53308 7.5 5.99902C7.5 6.46496 7.5 6.69794 7.42388 6.88171C7.32239 7.12673 7.12771 7.32141 6.88268 7.4229C6.69891 7.49902 6.46594 7.49902 6 7.49902C5.53406 7.49902 5.30109 7.49902 5.11732 7.4229C4.87229 7.32141 4.67761 7.12673 4.57612 6.88171C4.5 6.69794 4.5 6.46496 4.5 5.99902Z",
|
|
@@ -8538,9 +8446,9 @@ function MarginIcon(props) {
|
|
|
8538
8446
|
}
|
|
8539
8447
|
|
|
8540
8448
|
// src/editor/components/icons/padding-icon.tsx
|
|
8541
|
-
var
|
|
8449
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
8542
8450
|
function PaddingIcon(props) {
|
|
8543
|
-
return /* @__PURE__ */ (0,
|
|
8451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
8544
8452
|
"svg",
|
|
8545
8453
|
__spreadProps(__spreadValues({
|
|
8546
8454
|
width: 10,
|
|
@@ -8549,7 +8457,7 @@ function PaddingIcon(props) {
|
|
|
8549
8457
|
fill: "none",
|
|
8550
8458
|
xmlns: "http://www.w3.org/2000/svg"
|
|
8551
8459
|
}, props), {
|
|
8552
|
-
children: /* @__PURE__ */ (0,
|
|
8460
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
8553
8461
|
"path",
|
|
8554
8462
|
{
|
|
8555
8463
|
d: "M9.50244 0.501526L9.10244 0.501526C8.54239 0.501526 8.26236 0.501526 8.04845 0.610519C7.86029 0.706392 7.70731 0.859373 7.61144 1.04754C7.50244 1.26145 7.50244 1.54147 7.50244 2.10153V7.90153C7.50244 8.46158 7.50244 8.74161 7.61144 8.95552C7.70731 9.14368 7.86029 9.29666 8.04845 9.39253C8.26236 9.50153 8.54239 9.50153 9.10244 9.50153H9.50244M0.502441 0.501527L0.902441 0.501527C1.46249 0.501527 1.74252 0.501527 1.95643 0.61052C2.14459 0.706393 2.29757 0.859374 2.39345 1.04754C2.50244 1.26145 2.50244 1.54147 2.50244 2.10153L2.50244 7.90153C2.50244 8.46158 2.50244 8.74161 2.39345 8.95552C2.29757 9.14368 2.14459 9.29666 1.95643 9.39253C1.74252 9.50153 1.46249 9.50153 0.902442 9.50153H0.502442M4.99994 7.99903V1.99903",
|
|
@@ -8564,7 +8472,7 @@ function PaddingIcon(props) {
|
|
|
8564
8472
|
|
|
8565
8473
|
// src/editor/components/ui/color-picker.tsx
|
|
8566
8474
|
var import_react_colorful = require("react-colorful");
|
|
8567
|
-
var
|
|
8475
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
8568
8476
|
function ColorPicker(props) {
|
|
8569
8477
|
const {
|
|
8570
8478
|
color,
|
|
@@ -8582,14 +8490,14 @@ function ColorPicker(props) {
|
|
|
8582
8490
|
onColorChange(color2);
|
|
8583
8491
|
});
|
|
8584
8492
|
};
|
|
8585
|
-
const popoverButton = /* @__PURE__ */ (0,
|
|
8493
|
+
const popoverButton = /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(PopoverTrigger, { asChild: true, children: children || /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
8586
8494
|
BaseButton,
|
|
8587
8495
|
{
|
|
8588
8496
|
variant: "ghost",
|
|
8589
8497
|
className: "mly:h-7 mly:w-7 mly:shrink-0",
|
|
8590
8498
|
size: "sm",
|
|
8591
8499
|
type: "button",
|
|
8592
|
-
children: /* @__PURE__ */ (0,
|
|
8500
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
8593
8501
|
"div",
|
|
8594
8502
|
{
|
|
8595
8503
|
className: cn(
|
|
@@ -8603,7 +8511,7 @@ function ColorPicker(props) {
|
|
|
8603
8511
|
)
|
|
8604
8512
|
}
|
|
8605
8513
|
) });
|
|
8606
|
-
return /* @__PURE__ */ (0,
|
|
8514
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
8607
8515
|
Popover,
|
|
8608
8516
|
{
|
|
8609
8517
|
onOpenChange: (open) => {
|
|
@@ -8612,17 +8520,24 @@ function ColorPicker(props) {
|
|
|
8612
8520
|
}
|
|
8613
8521
|
},
|
|
8614
8522
|
children: [
|
|
8615
|
-
tooltip ? /* @__PURE__ */ (0,
|
|
8616
|
-
/* @__PURE__ */ (0,
|
|
8617
|
-
/* @__PURE__ */ (0,
|
|
8523
|
+
tooltip ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Tooltip, { children: [
|
|
8524
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TooltipTrigger, { asChild: true, children: popoverButton }),
|
|
8525
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
8526
|
+
TooltipContent,
|
|
8527
|
+
{
|
|
8528
|
+
sideOffset: 8,
|
|
8529
|
+
className: "mly:border-gray-300 mly:bg-transparent mly:p-0 mly:text-gray-700 mly:shadow-sm",
|
|
8530
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "mly:block mly:rounded-md mly:bg-soft-gray mly:!px-2 mly:!py-1.5", children: tooltip })
|
|
8531
|
+
}
|
|
8532
|
+
)
|
|
8618
8533
|
] }) : popoverButton,
|
|
8619
|
-
/* @__PURE__ */ (0,
|
|
8534
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
8620
8535
|
PopoverContent,
|
|
8621
8536
|
{
|
|
8622
8537
|
className: "mly:w-full mly:rounded-none mly:border-0 mly:bg-transparent! mly:p-0! mly:shadow-none mly:drop-shadow-md",
|
|
8623
8538
|
sideOffset: 8,
|
|
8624
|
-
children: /* @__PURE__ */ (0,
|
|
8625
|
-
/* @__PURE__ */ (0,
|
|
8539
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "mly:min-w-[260px] mly:rounded-xl mly:border mly:border-gray-200 mly:bg-white mly:p-4", children: [
|
|
8540
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
8626
8541
|
import_react_colorful.HexColorPicker,
|
|
8627
8542
|
{
|
|
8628
8543
|
color,
|
|
@@ -8630,7 +8545,7 @@ function ColorPicker(props) {
|
|
|
8630
8545
|
className: "mly:flex mly:w-full! mly:flex-col mly:gap-4"
|
|
8631
8546
|
}
|
|
8632
8547
|
),
|
|
8633
|
-
/* @__PURE__ */ (0,
|
|
8548
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
8634
8549
|
import_react_colorful.HexColorInput,
|
|
8635
8550
|
{
|
|
8636
8551
|
alpha: true,
|
|
@@ -8640,10 +8555,10 @@ function ColorPicker(props) {
|
|
|
8640
8555
|
prefixed: true
|
|
8641
8556
|
}
|
|
8642
8557
|
),
|
|
8643
|
-
suggestedColors.length > 0 && /* @__PURE__ */ (0,
|
|
8644
|
-
/* @__PURE__ */ (0,
|
|
8645
|
-
/* @__PURE__ */ (0,
|
|
8646
|
-
/* @__PURE__ */ (0,
|
|
8558
|
+
suggestedColors.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { children: [
|
|
8559
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "-mly:mx-4 mly:my-4 mly:h-px mly:bg-gray-200" }),
|
|
8560
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("h2", { className: "mly:text-xs mly:text-gray-500", children: "Recently used" }),
|
|
8561
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "mly:mt-2 mly:flex mly:flex-wrap mly:gap-0.5", children: suggestedColors.map((suggestedColor) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
8647
8562
|
BaseButton,
|
|
8648
8563
|
{
|
|
8649
8564
|
variant: "ghost",
|
|
@@ -8651,7 +8566,7 @@ function ColorPicker(props) {
|
|
|
8651
8566
|
className: "!mly:size-7 mly:shrink-0",
|
|
8652
8567
|
type: "button",
|
|
8653
8568
|
onClick: () => handleColorChange(suggestedColor),
|
|
8654
|
-
children: /* @__PURE__ */ (0,
|
|
8569
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
8655
8570
|
"div",
|
|
8656
8571
|
{
|
|
8657
8572
|
className: "mly:h-4 mly:w-4 mly:shrink-0 mly:rounded",
|
|
@@ -8673,10 +8588,10 @@ function ColorPicker(props) {
|
|
|
8673
8588
|
}
|
|
8674
8589
|
|
|
8675
8590
|
// src/editor/components/section-menu/use-section-state.tsx
|
|
8676
|
-
var
|
|
8677
|
-
var
|
|
8591
|
+
var import_react35 = require("@tiptap/react");
|
|
8592
|
+
var import_fast_deep_equal5 = __toESM(require("fast-deep-equal"), 1);
|
|
8678
8593
|
var useSectionState = (editor) => {
|
|
8679
|
-
const states = (0,
|
|
8594
|
+
const states = (0, import_react35.useEditorState)({
|
|
8680
8595
|
editor,
|
|
8681
8596
|
selector: (ctx) => {
|
|
8682
8597
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
@@ -8698,19 +8613,19 @@ var useSectionState = (editor) => {
|
|
|
8698
8613
|
currentShowIfKey: ((_n = ctx.editor.getAttributes("section")) == null ? void 0 : _n.showIfKey) || ""
|
|
8699
8614
|
};
|
|
8700
8615
|
},
|
|
8701
|
-
equalityFn:
|
|
8616
|
+
equalityFn: import_fast_deep_equal5.default
|
|
8702
8617
|
});
|
|
8703
8618
|
return states;
|
|
8704
8619
|
};
|
|
8705
8620
|
|
|
8706
8621
|
// src/editor/components/section-menu/section-bubble-menu.tsx
|
|
8707
|
-
var
|
|
8622
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
8708
8623
|
function SectionBubbleMenu(props) {
|
|
8709
8624
|
const { appendTo, editor } = props;
|
|
8710
8625
|
if (!editor) {
|
|
8711
8626
|
return null;
|
|
8712
8627
|
}
|
|
8713
|
-
const getReferenceClientRect = (0,
|
|
8628
|
+
const getReferenceClientRect = (0, import_react37.useCallback)(() => {
|
|
8714
8629
|
const renderContainer = getRenderContainer(editor, "section");
|
|
8715
8630
|
const rect = (renderContainer == null ? void 0 : renderContainer.getBoundingClientRect()) || new DOMRect(-1e3, -1e3, 0, 0);
|
|
8716
8631
|
return rect;
|
|
@@ -8719,10 +8634,10 @@ function SectionBubbleMenu(props) {
|
|
|
8719
8634
|
shouldShow: ({ editor: editor2 }) => {
|
|
8720
8635
|
var _a, _b;
|
|
8721
8636
|
const activeSectionNode = getClosestNodeByName(editor2, "section");
|
|
8722
|
-
const repeatNodeChildren = activeSectionNode ? (_a = (0,
|
|
8637
|
+
const repeatNodeChildren = activeSectionNode ? (_a = (0, import_react36.findChildren)(activeSectionNode == null ? void 0 : activeSectionNode.node, (node) => {
|
|
8723
8638
|
return node.type.name === "repeat";
|
|
8724
8639
|
})) == null ? void 0 : _a[0] : null;
|
|
8725
|
-
const inlineImageNodeChildren = activeSectionNode ? (_b = (0,
|
|
8640
|
+
const inlineImageNodeChildren = activeSectionNode ? (_b = (0, import_react36.findChildren)(activeSectionNode == null ? void 0 : activeSectionNode.node, (node) => {
|
|
8726
8641
|
return node.type.name === "inlineImage";
|
|
8727
8642
|
})) == null ? void 0 : _b[0] : null;
|
|
8728
8643
|
const hasActiveRepeatNodeChildren = repeatNodeChildren && editor2.isActive("repeat");
|
|
@@ -8739,7 +8654,7 @@ function SectionBubbleMenu(props) {
|
|
|
8739
8654
|
},
|
|
8740
8655
|
getReferenceClientRect,
|
|
8741
8656
|
appendTo: () => appendTo == null ? void 0 : appendTo.current,
|
|
8742
|
-
plugins: [
|
|
8657
|
+
plugins: [import_tippy6.sticky],
|
|
8743
8658
|
sticky: "popper",
|
|
8744
8659
|
maxWidth: "auto"
|
|
8745
8660
|
},
|
|
@@ -8751,12 +8666,12 @@ function SectionBubbleMenu(props) {
|
|
|
8751
8666
|
{ value: "6", label: "Smooth" },
|
|
8752
8667
|
{ value: "9999", label: "Round" }
|
|
8753
8668
|
];
|
|
8754
|
-
return /* @__PURE__ */ (0,
|
|
8755
|
-
|
|
8669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
8670
|
+
import_react36.BubbleMenu,
|
|
8756
8671
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
8757
8672
|
className: "mly:flex mly:items-stretch mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:p-0.5 mly:shadow-md",
|
|
8758
|
-
children: /* @__PURE__ */ (0,
|
|
8759
|
-
/* @__PURE__ */ (0,
|
|
8673
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(TooltipProvider, { children: [
|
|
8674
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
8760
8675
|
AlignmentSwitch,
|
|
8761
8676
|
{
|
|
8762
8677
|
alignment: state.currentAlignment,
|
|
@@ -8768,9 +8683,9 @@ function SectionBubbleMenu(props) {
|
|
|
8768
8683
|
}
|
|
8769
8684
|
}
|
|
8770
8685
|
),
|
|
8771
|
-
/* @__PURE__ */ (0,
|
|
8772
|
-
/* @__PURE__ */ (0,
|
|
8773
|
-
/* @__PURE__ */ (0,
|
|
8686
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Divider, {}),
|
|
8687
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
8688
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
8774
8689
|
Select,
|
|
8775
8690
|
{
|
|
8776
8691
|
label: "Border Radius",
|
|
@@ -8786,7 +8701,7 @@ function SectionBubbleMenu(props) {
|
|
|
8786
8701
|
className: "mly:capitalize"
|
|
8787
8702
|
}
|
|
8788
8703
|
),
|
|
8789
|
-
/* @__PURE__ */ (0,
|
|
8704
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
8790
8705
|
Select,
|
|
8791
8706
|
{
|
|
8792
8707
|
label: "Border Width",
|
|
@@ -8808,8 +8723,8 @@ function SectionBubbleMenu(props) {
|
|
|
8808
8723
|
}
|
|
8809
8724
|
)
|
|
8810
8725
|
] }),
|
|
8811
|
-
/* @__PURE__ */ (0,
|
|
8812
|
-
/* @__PURE__ */ (0,
|
|
8726
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Divider, {}),
|
|
8727
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
8813
8728
|
Select,
|
|
8814
8729
|
{
|
|
8815
8730
|
icon: MarginIcon,
|
|
@@ -8837,8 +8752,8 @@ function SectionBubbleMenu(props) {
|
|
|
8837
8752
|
className: "mly:capitalize"
|
|
8838
8753
|
}
|
|
8839
8754
|
),
|
|
8840
|
-
/* @__PURE__ */ (0,
|
|
8841
|
-
/* @__PURE__ */ (0,
|
|
8755
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Divider, {}),
|
|
8756
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
8842
8757
|
Select,
|
|
8843
8758
|
{
|
|
8844
8759
|
icon: PaddingIcon,
|
|
@@ -8866,9 +8781,9 @@ function SectionBubbleMenu(props) {
|
|
|
8866
8781
|
className: "mly:capitalize"
|
|
8867
8782
|
}
|
|
8868
8783
|
),
|
|
8869
|
-
/* @__PURE__ */ (0,
|
|
8870
|
-
/* @__PURE__ */ (0,
|
|
8871
|
-
/* @__PURE__ */ (0,
|
|
8784
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Divider, {}),
|
|
8785
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
8786
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
8872
8787
|
ColorPicker,
|
|
8873
8788
|
{
|
|
8874
8789
|
color: state.currentBorderColor,
|
|
@@ -8879,14 +8794,14 @@ function SectionBubbleMenu(props) {
|
|
|
8879
8794
|
});
|
|
8880
8795
|
},
|
|
8881
8796
|
tooltip: "Border Color",
|
|
8882
|
-
children: /* @__PURE__ */ (0,
|
|
8797
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
8883
8798
|
BaseButton,
|
|
8884
8799
|
{
|
|
8885
8800
|
variant: "ghost",
|
|
8886
8801
|
className: "mly:h-7 mly:w-7 mly:shrink-0",
|
|
8887
8802
|
size: "sm",
|
|
8888
8803
|
type: "button",
|
|
8889
|
-
children: /* @__PURE__ */ (0,
|
|
8804
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
8890
8805
|
BorderColor,
|
|
8891
8806
|
{
|
|
8892
8807
|
className: "mly:size-3 mly:shrink-0",
|
|
@@ -8900,7 +8815,7 @@ function SectionBubbleMenu(props) {
|
|
|
8900
8815
|
)
|
|
8901
8816
|
}
|
|
8902
8817
|
),
|
|
8903
|
-
/* @__PURE__ */ (0,
|
|
8818
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
8904
8819
|
ColorPicker,
|
|
8905
8820
|
{
|
|
8906
8821
|
color: state.currentBackgroundColor,
|
|
@@ -8916,25 +8831,25 @@ function SectionBubbleMenu(props) {
|
|
|
8916
8831
|
}
|
|
8917
8832
|
)
|
|
8918
8833
|
] }),
|
|
8919
|
-
/* @__PURE__ */ (0,
|
|
8920
|
-
/* @__PURE__ */ (0,
|
|
8834
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Divider, {}),
|
|
8835
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
8921
8836
|
BubbleMenuButton,
|
|
8922
8837
|
{
|
|
8923
|
-
icon:
|
|
8838
|
+
icon: import_lucide_react25.Trash,
|
|
8924
8839
|
tooltip: "Delete Section",
|
|
8925
8840
|
command: () => {
|
|
8926
8841
|
deleteNode(editor, "section");
|
|
8927
8842
|
}
|
|
8928
8843
|
}
|
|
8929
8844
|
),
|
|
8930
|
-
state.isColumnsActive && /* @__PURE__ */ (0,
|
|
8931
|
-
/* @__PURE__ */ (0,
|
|
8932
|
-
/* @__PURE__ */ (0,
|
|
8933
|
-
/* @__PURE__ */ (0,
|
|
8845
|
+
state.isColumnsActive && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
|
|
8846
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Divider, {}),
|
|
8847
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(Popover, { children: [
|
|
8848
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(PopoverTrigger, { className: "mly:flex mly:items-center mly:gap-1 mly:rounded-md mly:px-1.5 mly:text-sm mly:data-[state=open]:bg-soft-gray mly:hover:bg-soft-gray", children: [
|
|
8934
8849
|
"Column",
|
|
8935
|
-
/* @__PURE__ */ (0,
|
|
8850
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_lucide_react25.ChevronUp, { className: "mly:h-3 mly:w-3" })
|
|
8936
8851
|
] }),
|
|
8937
|
-
/* @__PURE__ */ (0,
|
|
8852
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
8938
8853
|
PopoverContent,
|
|
8939
8854
|
{
|
|
8940
8855
|
className: "mly:w-max mly:rounded-lg mly:p-0.5!",
|
|
@@ -8947,7 +8862,7 @@ function SectionBubbleMenu(props) {
|
|
|
8947
8862
|
onCloseAutoFocus: (e) => {
|
|
8948
8863
|
e.preventDefault();
|
|
8949
8864
|
},
|
|
8950
|
-
children: /* @__PURE__ */ (0,
|
|
8865
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ColumnsBubbleMenuContent, { editor })
|
|
8951
8866
|
}
|
|
8952
8867
|
)
|
|
8953
8868
|
] })
|
|
@@ -8958,13 +8873,13 @@ function SectionBubbleMenu(props) {
|
|
|
8958
8873
|
}
|
|
8959
8874
|
|
|
8960
8875
|
// src/editor/components/spacer-menu/spacer-bubble-menu.tsx
|
|
8961
|
-
var
|
|
8876
|
+
var import_react39 = require("@tiptap/react");
|
|
8962
8877
|
|
|
8963
8878
|
// src/editor/components/spacer-menu/use-spacer-state.ts
|
|
8964
|
-
var
|
|
8965
|
-
var
|
|
8879
|
+
var import_react38 = require("@tiptap/react");
|
|
8880
|
+
var import_fast_deep_equal6 = __toESM(require("fast-deep-equal"), 1);
|
|
8966
8881
|
var useSpacerState = (editor) => {
|
|
8967
|
-
const states = (0,
|
|
8882
|
+
const states = (0, import_react38.useEditorState)({
|
|
8968
8883
|
editor,
|
|
8969
8884
|
selector: (ctx) => {
|
|
8970
8885
|
var _a;
|
|
@@ -8972,20 +8887,20 @@ var useSpacerState = (editor) => {
|
|
|
8972
8887
|
currentShowIfKey: ((_a = ctx.editor.getAttributes("spacer")) == null ? void 0 : _a.showIfKey) || ""
|
|
8973
8888
|
};
|
|
8974
8889
|
},
|
|
8975
|
-
equalityFn:
|
|
8890
|
+
equalityFn: import_fast_deep_equal6.default
|
|
8976
8891
|
});
|
|
8977
8892
|
return states;
|
|
8978
8893
|
};
|
|
8979
8894
|
|
|
8980
8895
|
// src/editor/components/spacer-menu/spacer-bubble-menu.tsx
|
|
8981
|
-
var
|
|
8982
|
-
var
|
|
8896
|
+
var import_react40 = require("react");
|
|
8897
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
8983
8898
|
function SpacerBubbleMenu(props) {
|
|
8984
8899
|
const { editor, appendTo } = props;
|
|
8985
8900
|
if (!editor) {
|
|
8986
8901
|
return null;
|
|
8987
8902
|
}
|
|
8988
|
-
const items = (0,
|
|
8903
|
+
const items = (0, import_react40.useMemo)(
|
|
8989
8904
|
() => spacing.map((space) => {
|
|
8990
8905
|
const { value: height, short: name } = space;
|
|
8991
8906
|
return {
|
|
@@ -9011,11 +8926,11 @@ function SpacerBubbleMenu(props) {
|
|
|
9011
8926
|
}
|
|
9012
8927
|
});
|
|
9013
8928
|
const state = useSpacerState(editor);
|
|
9014
|
-
return /* @__PURE__ */ (0,
|
|
9015
|
-
|
|
8929
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
8930
|
+
import_react39.BubbleMenu,
|
|
9016
8931
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
9017
8932
|
className: "mly:flex mly:gap-0.5 mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:p-0.5 mly:shadow-md",
|
|
9018
|
-
children: /* @__PURE__ */ (0,
|
|
8933
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(TooltipProvider, { children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
9019
8934
|
BubbleMenuButton,
|
|
9020
8935
|
__spreadValues({
|
|
9021
8936
|
className: "!mly:h-7 mly:w-7 mly:shrink-0 mly:p-0",
|
|
@@ -9249,18 +9164,18 @@ var Spacer = import_core12.Node.create({
|
|
|
9249
9164
|
|
|
9250
9165
|
// src/editor/extensions/link-card.ts
|
|
9251
9166
|
var import_core13 = require("@tiptap/core");
|
|
9252
|
-
var
|
|
9167
|
+
var import_react42 = require("@tiptap/react");
|
|
9253
9168
|
|
|
9254
9169
|
// src/editor/nodes/link-card.tsx
|
|
9255
|
-
var
|
|
9170
|
+
var import_react41 = require("@tiptap/react");
|
|
9256
9171
|
|
|
9257
9172
|
// src/editor/components/input.tsx
|
|
9258
9173
|
var React5 = __toESM(require("react"), 1);
|
|
9259
|
-
var
|
|
9174
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
9260
9175
|
var Input = React5.forwardRef(
|
|
9261
9176
|
(_a, ref) => {
|
|
9262
9177
|
var _b = _a, { className, type } = _b, props = __objRest(_b, ["className", "type"]);
|
|
9263
|
-
return /* @__PURE__ */ (0,
|
|
9178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
9264
9179
|
"input",
|
|
9265
9180
|
__spreadValues(__spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
|
|
9266
9181
|
type,
|
|
@@ -9278,11 +9193,11 @@ Input.displayName = "Input";
|
|
|
9278
9193
|
|
|
9279
9194
|
// src/editor/components/textarea.tsx
|
|
9280
9195
|
var React6 = __toESM(require("react"), 1);
|
|
9281
|
-
var
|
|
9196
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
9282
9197
|
var Textarea = React6.forwardRef(
|
|
9283
9198
|
(_a, ref) => {
|
|
9284
9199
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
9285
|
-
return /* @__PURE__ */ (0,
|
|
9200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
9286
9201
|
"textarea",
|
|
9287
9202
|
__spreadValues({
|
|
9288
9203
|
className: cn(
|
|
@@ -9298,18 +9213,18 @@ var Textarea = React6.forwardRef(
|
|
|
9298
9213
|
Textarea.displayName = "Textarea";
|
|
9299
9214
|
|
|
9300
9215
|
// src/editor/nodes/link-card.tsx
|
|
9301
|
-
var
|
|
9216
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
9302
9217
|
function LinkCardComponent(props) {
|
|
9303
9218
|
const { title, description, link, linkTitle, image: image2, badgeText, subTitle } = props.node.attrs;
|
|
9304
9219
|
const { getPos, editor } = props;
|
|
9305
|
-
return /* @__PURE__ */ (0,
|
|
9306
|
-
|
|
9220
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
9221
|
+
import_react41.NodeViewWrapper,
|
|
9307
9222
|
{
|
|
9308
9223
|
className: `react-component ${props.selected && "ProseMirror-selectednode"}`,
|
|
9309
9224
|
draggable: editor.isEditable,
|
|
9310
9225
|
"data-drag-handle": editor.isEditable,
|
|
9311
|
-
children: /* @__PURE__ */ (0,
|
|
9312
|
-
/* @__PURE__ */ (0,
|
|
9226
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Popover, { open: props.selected, children: [
|
|
9227
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
9313
9228
|
"div",
|
|
9314
9229
|
{
|
|
9315
9230
|
tabIndex: -1,
|
|
@@ -9318,8 +9233,8 @@ function LinkCardComponent(props) {
|
|
|
9318
9233
|
const pos = getPos();
|
|
9319
9234
|
editor.commands.setNodeSelection(pos);
|
|
9320
9235
|
},
|
|
9321
|
-
children: /* @__PURE__ */ (0,
|
|
9322
|
-
image2 && /* @__PURE__ */ (0,
|
|
9236
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "mly:no-prose mly:flex mly:flex-col mly:rounded-lg mly:border mly:border-gray-300", children: [
|
|
9237
|
+
image2 && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "mly:relative mly:mb-1.5 mly:w-full mly:shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
9323
9238
|
"img",
|
|
9324
9239
|
{
|
|
9325
9240
|
src: image2,
|
|
@@ -9328,23 +9243,23 @@ function LinkCardComponent(props) {
|
|
|
9328
9243
|
draggable: editor.isEditable
|
|
9329
9244
|
}
|
|
9330
9245
|
) }),
|
|
9331
|
-
/* @__PURE__ */ (0,
|
|
9332
|
-
/* @__PURE__ */ (0,
|
|
9333
|
-
/* @__PURE__ */ (0,
|
|
9334
|
-
badgeText && /* @__PURE__ */ (0,
|
|
9246
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "mly:flex mly:items-stretch mly:p-3", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: cn("mly:flex mly:flex-col"), children: [
|
|
9247
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "!mly:mb-1.5 mly:flex mly:items-center mly:gap-1.5", children: [
|
|
9248
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("h2", { className: "!mly:mb-0 mly:text-lg! mly:font-semibold", children: title }),
|
|
9249
|
+
badgeText && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "!mly:font-base mly:rounded-md mly:bg-yellow-200 mly:px-2 mly:py-1 mly:font-semibold mly:leading-none text-xs", children: badgeText }),
|
|
9335
9250
|
" ",
|
|
9336
|
-
subTitle && !badgeText && /* @__PURE__ */ (0,
|
|
9251
|
+
subTitle && !badgeText && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "!mly:font-base mly:font-regular mly:rounded-md mly:leading-none mly:text-gray-400 text-xs", children: subTitle })
|
|
9337
9252
|
] }),
|
|
9338
|
-
/* @__PURE__ */ (0,
|
|
9253
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("p", { className: "!mly:my-0 mly:text-base! mly:text-gray-500", children: [
|
|
9339
9254
|
description,
|
|
9340
9255
|
" ",
|
|
9341
|
-
linkTitle ? /* @__PURE__ */ (0,
|
|
9256
|
+
linkTitle ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("a", { href: link, className: "mly:font-semibold", children: linkTitle }) : null
|
|
9342
9257
|
] })
|
|
9343
9258
|
] }) })
|
|
9344
9259
|
] })
|
|
9345
9260
|
}
|
|
9346
9261
|
) }),
|
|
9347
|
-
/* @__PURE__ */ (0,
|
|
9262
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
9348
9263
|
PopoverContent,
|
|
9349
9264
|
{
|
|
9350
9265
|
align: "end",
|
|
@@ -9353,9 +9268,9 @@ function LinkCardComponent(props) {
|
|
|
9353
9268
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
9354
9269
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
9355
9270
|
children: [
|
|
9356
|
-
/* @__PURE__ */ (0,
|
|
9357
|
-
/* @__PURE__ */ (0,
|
|
9358
|
-
/* @__PURE__ */ (0,
|
|
9271
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("label", { className: "mly:w-full mly:space-y-1", children: [
|
|
9272
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "mly:text-xs mly:font-normal mly:text-slate-400", children: "Image" }),
|
|
9273
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
9359
9274
|
Input,
|
|
9360
9275
|
{
|
|
9361
9276
|
placeholder: "Add Image",
|
|
@@ -9369,9 +9284,9 @@ function LinkCardComponent(props) {
|
|
|
9369
9284
|
}
|
|
9370
9285
|
)
|
|
9371
9286
|
] }),
|
|
9372
|
-
/* @__PURE__ */ (0,
|
|
9373
|
-
/* @__PURE__ */ (0,
|
|
9374
|
-
/* @__PURE__ */ (0,
|
|
9287
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("label", { className: "mly:w-full mly:space-y-1", children: [
|
|
9288
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "mly:text-xs mly:font-normal mly:text-slate-400", children: "Title" }),
|
|
9289
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
9375
9290
|
Input,
|
|
9376
9291
|
{
|
|
9377
9292
|
placeholder: "Add title",
|
|
@@ -9384,9 +9299,9 @@ function LinkCardComponent(props) {
|
|
|
9384
9299
|
}
|
|
9385
9300
|
)
|
|
9386
9301
|
] }),
|
|
9387
|
-
/* @__PURE__ */ (0,
|
|
9388
|
-
/* @__PURE__ */ (0,
|
|
9389
|
-
/* @__PURE__ */ (0,
|
|
9302
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("label", { className: "mly:w-full mly:space-y-1", children: [
|
|
9303
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "mly:text-xs mly:font-normal mly:text-slate-400", children: "Description" }),
|
|
9304
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
9390
9305
|
Textarea,
|
|
9391
9306
|
{
|
|
9392
9307
|
placeholder: "Add description here",
|
|
@@ -9399,10 +9314,10 @@ function LinkCardComponent(props) {
|
|
|
9399
9314
|
}
|
|
9400
9315
|
)
|
|
9401
9316
|
] }),
|
|
9402
|
-
/* @__PURE__ */ (0,
|
|
9403
|
-
/* @__PURE__ */ (0,
|
|
9404
|
-
/* @__PURE__ */ (0,
|
|
9405
|
-
/* @__PURE__ */ (0,
|
|
9317
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "mly:grid mly:grid-cols-2 mly:gap-2", children: [
|
|
9318
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("label", { className: "mly:w-full mly:space-y-1", children: [
|
|
9319
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "mly:text-xs mly:font-normal mly:text-slate-400", children: "Link Title" }),
|
|
9320
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
9406
9321
|
Input,
|
|
9407
9322
|
{
|
|
9408
9323
|
placeholder: "Add link title here",
|
|
@@ -9415,9 +9330,9 @@ function LinkCardComponent(props) {
|
|
|
9415
9330
|
}
|
|
9416
9331
|
)
|
|
9417
9332
|
] }),
|
|
9418
|
-
/* @__PURE__ */ (0,
|
|
9419
|
-
/* @__PURE__ */ (0,
|
|
9420
|
-
/* @__PURE__ */ (0,
|
|
9333
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("label", { className: "mly:w-full mly:space-y-1", children: [
|
|
9334
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "mly:text-xs mly:font-normal mly:text-slate-400", children: "Link" }),
|
|
9335
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
9421
9336
|
Input,
|
|
9422
9337
|
{
|
|
9423
9338
|
placeholder: "Add link here",
|
|
@@ -9431,10 +9346,10 @@ function LinkCardComponent(props) {
|
|
|
9431
9346
|
)
|
|
9432
9347
|
] })
|
|
9433
9348
|
] }),
|
|
9434
|
-
/* @__PURE__ */ (0,
|
|
9435
|
-
/* @__PURE__ */ (0,
|
|
9436
|
-
/* @__PURE__ */ (0,
|
|
9437
|
-
/* @__PURE__ */ (0,
|
|
9349
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "mly:grid mly:grid-cols-2 mly:gap-2", children: [
|
|
9350
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("label", { className: "mly:w-full mly:space-y-1", children: [
|
|
9351
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "mly:text-xs mly:font-normal mly:text-slate-400", children: "Badge Text" }),
|
|
9352
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
9438
9353
|
Input,
|
|
9439
9354
|
{
|
|
9440
9355
|
placeholder: "Add badge text here",
|
|
@@ -9447,9 +9362,9 @@ function LinkCardComponent(props) {
|
|
|
9447
9362
|
}
|
|
9448
9363
|
)
|
|
9449
9364
|
] }),
|
|
9450
|
-
/* @__PURE__ */ (0,
|
|
9451
|
-
/* @__PURE__ */ (0,
|
|
9452
|
-
/* @__PURE__ */ (0,
|
|
9365
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("label", { className: "mly:w-full mly:space-y-1", children: [
|
|
9366
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "mly:text-xs mly:font-normal mly:text-slate-400", children: "Sub Title" }),
|
|
9367
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
9453
9368
|
Input,
|
|
9454
9369
|
{
|
|
9455
9370
|
placeholder: "Add sub title here",
|
|
@@ -9536,7 +9451,7 @@ var LinkCardExtension = import_core13.Node.create({
|
|
|
9536
9451
|
};
|
|
9537
9452
|
},
|
|
9538
9453
|
addNodeView() {
|
|
9539
|
-
return (0,
|
|
9454
|
+
return (0, import_react42.ReactNodeViewRenderer)(LinkCardComponent, {
|
|
9540
9455
|
className: "mly:relative"
|
|
9541
9456
|
});
|
|
9542
9457
|
}
|
|
@@ -9544,26 +9459,26 @@ var LinkCardExtension = import_core13.Node.create({
|
|
|
9544
9459
|
|
|
9545
9460
|
// src/editor/nodes/button/button.tsx
|
|
9546
9461
|
var import_core14 = require("@tiptap/core");
|
|
9547
|
-
var
|
|
9462
|
+
var import_react46 = require("@tiptap/react");
|
|
9548
9463
|
|
|
9549
9464
|
// src/editor/nodes/button/button-view.tsx
|
|
9550
|
-
var
|
|
9551
|
-
var
|
|
9465
|
+
var import_react44 = require("@tiptap/react");
|
|
9466
|
+
var import_react45 = require("react");
|
|
9552
9467
|
|
|
9553
9468
|
// src/editor/nodes/button/button-label-input.tsx
|
|
9554
|
-
var
|
|
9555
|
-
var
|
|
9469
|
+
var import_react43 = require("react");
|
|
9470
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
9556
9471
|
function ButtonLabelInput(props) {
|
|
9557
9472
|
var _a, _b;
|
|
9558
9473
|
const { value, onValueChange, isVariable, editor } = props;
|
|
9559
|
-
const linkInputRef = (0,
|
|
9560
|
-
const [isEditing, setIsEditing] = (0,
|
|
9474
|
+
const linkInputRef = (0, import_react43.useRef)(null);
|
|
9475
|
+
const [isEditing, setIsEditing] = (0, import_react43.useState)(!isVariable);
|
|
9561
9476
|
const { placeholderUrl = DEFAULT_PLACEHOLDER_URL } = useMailyContext();
|
|
9562
9477
|
const otps = useVariableOptions(editor);
|
|
9563
9478
|
const variables = otps == null ? void 0 : otps.variables;
|
|
9564
9479
|
const variableTriggerCharacter = (_b = (_a = otps == null ? void 0 : otps.suggestion) == null ? void 0 : _a.char) != null ? _b : DEFAULT_VARIABLE_TRIGGER_CHAR;
|
|
9565
9480
|
const renderVariable = otps == null ? void 0 : otps.renderVariable;
|
|
9566
|
-
const autoCompleteOptions = (0,
|
|
9481
|
+
const autoCompleteOptions = (0, import_react43.useMemo)(() => {
|
|
9567
9482
|
const withoutTrigger = value.replace(
|
|
9568
9483
|
new RegExp(variableTriggerCharacter, "g"),
|
|
9569
9484
|
""
|
|
@@ -9574,8 +9489,8 @@ function ButtonLabelInput(props) {
|
|
|
9574
9489
|
editor
|
|
9575
9490
|
}).map((variable) => variable.name);
|
|
9576
9491
|
}, [variables, value, editor]);
|
|
9577
|
-
return /* @__PURE__ */ (0,
|
|
9578
|
-
!isEditing && /* @__PURE__ */ (0,
|
|
9492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "mly:isolate mly:flex mly:items-center mly:rounded-lg", children: [
|
|
9493
|
+
!isEditing && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
9579
9494
|
"button",
|
|
9580
9495
|
{
|
|
9581
9496
|
onClick: () => {
|
|
@@ -9596,7 +9511,7 @@ function ButtonLabelInput(props) {
|
|
|
9596
9511
|
})
|
|
9597
9512
|
}
|
|
9598
9513
|
),
|
|
9599
|
-
isEditing && /* @__PURE__ */ (0,
|
|
9514
|
+
isEditing && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
9600
9515
|
InputAutocomplete,
|
|
9601
9516
|
{
|
|
9602
9517
|
editor,
|
|
@@ -9623,7 +9538,7 @@ function ButtonLabelInput(props) {
|
|
|
9623
9538
|
}
|
|
9624
9539
|
|
|
9625
9540
|
// src/editor/nodes/button/button-view.tsx
|
|
9626
|
-
var
|
|
9541
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
9627
9542
|
function ButtonView(props) {
|
|
9628
9543
|
const { node, editor, getPos, updateAttributes: updateAttributes2 } = props;
|
|
9629
9544
|
const {
|
|
@@ -9643,7 +9558,7 @@ function ButtonView(props) {
|
|
|
9643
9558
|
} = node.attrs;
|
|
9644
9559
|
const opts = useVariableOptions(editor);
|
|
9645
9560
|
const renderVariable = opts == null ? void 0 : opts.renderVariable;
|
|
9646
|
-
const sizes = (0,
|
|
9561
|
+
const sizes = (0, import_react45.useMemo)(
|
|
9647
9562
|
() => ({
|
|
9648
9563
|
small: {
|
|
9649
9564
|
paddingX: 24,
|
|
@@ -9660,14 +9575,14 @@ function ButtonView(props) {
|
|
|
9660
9575
|
}),
|
|
9661
9576
|
[]
|
|
9662
9577
|
);
|
|
9663
|
-
const size = (0,
|
|
9578
|
+
const size = (0, import_react45.useMemo)(() => {
|
|
9664
9579
|
var _a;
|
|
9665
9580
|
return (_a = Object.entries(sizes).find(
|
|
9666
9581
|
([, { paddingX, paddingY }]) => paddingRight === paddingX && paddingTop === paddingY
|
|
9667
9582
|
)) == null ? void 0 : _a[0];
|
|
9668
9583
|
}, [paddingRight, paddingTop, sizes]);
|
|
9669
|
-
return /* @__PURE__ */ (0,
|
|
9670
|
-
|
|
9584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
9585
|
+
import_react44.NodeViewWrapper,
|
|
9671
9586
|
{
|
|
9672
9587
|
draggable: editor.isEditable,
|
|
9673
9588
|
"data-drag-handle": editor.isEditable,
|
|
@@ -9675,8 +9590,8 @@ function ButtonView(props) {
|
|
|
9675
9590
|
style: {
|
|
9676
9591
|
textAlign: alignment
|
|
9677
9592
|
},
|
|
9678
|
-
children: /* @__PURE__ */ (0,
|
|
9679
|
-
/* @__PURE__ */ (0,
|
|
9593
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Popover, { open: props.selected && editor.isEditable, children: [
|
|
9594
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
9680
9595
|
"button",
|
|
9681
9596
|
{
|
|
9682
9597
|
className: cn(
|
|
@@ -9719,7 +9634,7 @@ function ButtonView(props) {
|
|
|
9719
9634
|
}) : text2
|
|
9720
9635
|
}
|
|
9721
9636
|
) }) }),
|
|
9722
|
-
/* @__PURE__ */ (0,
|
|
9637
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
9723
9638
|
PopoverContent,
|
|
9724
9639
|
{
|
|
9725
9640
|
align: "end",
|
|
@@ -9728,8 +9643,8 @@ function ButtonView(props) {
|
|
|
9728
9643
|
sideOffset: 8,
|
|
9729
9644
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
9730
9645
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
9731
|
-
children: /* @__PURE__ */ (0,
|
|
9732
|
-
/* @__PURE__ */ (0,
|
|
9646
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "mly:flex mly:items-stretch mly:text-midnight-gray", children: [
|
|
9647
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
9733
9648
|
ButtonLabelInput,
|
|
9734
9649
|
{
|
|
9735
9650
|
value: text2,
|
|
@@ -9743,9 +9658,9 @@ function ButtonView(props) {
|
|
|
9743
9658
|
editor
|
|
9744
9659
|
}
|
|
9745
9660
|
),
|
|
9746
|
-
/* @__PURE__ */ (0,
|
|
9747
|
-
/* @__PURE__ */ (0,
|
|
9748
|
-
/* @__PURE__ */ (0,
|
|
9661
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Divider, {}),
|
|
9662
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
9663
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
9749
9664
|
Select,
|
|
9750
9665
|
{
|
|
9751
9666
|
label: "Border Radius",
|
|
@@ -9763,7 +9678,7 @@ function ButtonView(props) {
|
|
|
9763
9678
|
className: "mly:capitalize"
|
|
9764
9679
|
}
|
|
9765
9680
|
),
|
|
9766
|
-
/* @__PURE__ */ (0,
|
|
9681
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
9767
9682
|
Select,
|
|
9768
9683
|
{
|
|
9769
9684
|
label: "Style",
|
|
@@ -9781,7 +9696,7 @@ function ButtonView(props) {
|
|
|
9781
9696
|
className: "mly:capitalize"
|
|
9782
9697
|
}
|
|
9783
9698
|
),
|
|
9784
|
-
/* @__PURE__ */ (0,
|
|
9699
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
9785
9700
|
Select,
|
|
9786
9701
|
{
|
|
9787
9702
|
label: "Size",
|
|
@@ -9805,9 +9720,9 @@ function ButtonView(props) {
|
|
|
9805
9720
|
}
|
|
9806
9721
|
)
|
|
9807
9722
|
] }),
|
|
9808
|
-
/* @__PURE__ */ (0,
|
|
9809
|
-
/* @__PURE__ */ (0,
|
|
9810
|
-
/* @__PURE__ */ (0,
|
|
9723
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Divider, {}),
|
|
9724
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
9725
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
9811
9726
|
AlignmentSwitch,
|
|
9812
9727
|
{
|
|
9813
9728
|
alignment,
|
|
@@ -9818,7 +9733,7 @@ function ButtonView(props) {
|
|
|
9818
9733
|
}
|
|
9819
9734
|
}
|
|
9820
9735
|
),
|
|
9821
|
-
/* @__PURE__ */ (0,
|
|
9736
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
9822
9737
|
LinkInputPopover,
|
|
9823
9738
|
{
|
|
9824
9739
|
defaultValue: externalLink || "",
|
|
@@ -9834,9 +9749,9 @@ function ButtonView(props) {
|
|
|
9834
9749
|
}
|
|
9835
9750
|
)
|
|
9836
9751
|
] }),
|
|
9837
|
-
/* @__PURE__ */ (0,
|
|
9838
|
-
/* @__PURE__ */ (0,
|
|
9839
|
-
/* @__PURE__ */ (0,
|
|
9752
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Divider, {}),
|
|
9753
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
9754
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
9840
9755
|
BackgroundColorPickerPopup,
|
|
9841
9756
|
{
|
|
9842
9757
|
variant,
|
|
@@ -9848,7 +9763,7 @@ function ButtonView(props) {
|
|
|
9848
9763
|
}
|
|
9849
9764
|
}
|
|
9850
9765
|
),
|
|
9851
|
-
/* @__PURE__ */ (0,
|
|
9766
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
9852
9767
|
TextColorPickerPopup,
|
|
9853
9768
|
{
|
|
9854
9769
|
color: textColor || "transparent",
|
|
@@ -9869,20 +9784,20 @@ function ButtonView(props) {
|
|
|
9869
9784
|
}
|
|
9870
9785
|
function BackgroundColorPickerPopup(props) {
|
|
9871
9786
|
const { color, onChange, variant } = props;
|
|
9872
|
-
return /* @__PURE__ */ (0,
|
|
9787
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
9873
9788
|
ColorPicker,
|
|
9874
9789
|
{
|
|
9875
9790
|
color,
|
|
9876
9791
|
onColorChange: onChange,
|
|
9877
9792
|
tooltip: "Background Color",
|
|
9878
|
-
children: /* @__PURE__ */ (0,
|
|
9793
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
9879
9794
|
BaseButton,
|
|
9880
9795
|
{
|
|
9881
9796
|
variant: "ghost",
|
|
9882
9797
|
size: "sm",
|
|
9883
9798
|
type: "button",
|
|
9884
9799
|
className: "mly:size-7",
|
|
9885
|
-
children: /* @__PURE__ */ (0,
|
|
9800
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
9886
9801
|
"div",
|
|
9887
9802
|
{
|
|
9888
9803
|
className: "mly:h-4 mly:w-4 mly:shrink-0 mly:rounded-full mly:shadow",
|
|
@@ -9901,16 +9816,16 @@ function BackgroundColorPickerPopup(props) {
|
|
|
9901
9816
|
}
|
|
9902
9817
|
function TextColorPickerPopup(props) {
|
|
9903
9818
|
const { color, onChange } = props;
|
|
9904
|
-
return /* @__PURE__ */ (0,
|
|
9819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ColorPicker, { color, onColorChange: onChange, tooltip: "Text Color", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
9905
9820
|
BaseButton,
|
|
9906
9821
|
{
|
|
9907
9822
|
variant: "ghost",
|
|
9908
9823
|
size: "sm",
|
|
9909
9824
|
type: "button",
|
|
9910
9825
|
className: "mly:size-7",
|
|
9911
|
-
children: /* @__PURE__ */ (0,
|
|
9912
|
-
/* @__PURE__ */ (0,
|
|
9913
|
-
/* @__PURE__ */ (0,
|
|
9826
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "mly:flex mly:flex-col mly:items-center mly:justify-center mly:gap-px", children: [
|
|
9827
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "mly:font-bolder mly:font-mono mly:text-xs mly:text-midnight-gray", children: "A" }),
|
|
9828
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
9914
9829
|
"div",
|
|
9915
9830
|
{
|
|
9916
9831
|
className: "mly:h-[2px] mly:w-3 mly:shrink-0 mly:rounded-md mly:shadow",
|
|
@@ -10077,7 +9992,7 @@ var ButtonExtension = import_core14.Node.create({
|
|
|
10077
9992
|
};
|
|
10078
9993
|
},
|
|
10079
9994
|
addNodeView() {
|
|
10080
|
-
return (0,
|
|
9995
|
+
return (0, import_react46.ReactNodeViewRenderer)(ButtonView, {
|
|
10081
9996
|
contentDOMElementTag: "div",
|
|
10082
9997
|
className: "mly:relative"
|
|
10083
9998
|
});
|
|
@@ -10086,7 +10001,7 @@ var ButtonExtension = import_core14.Node.create({
|
|
|
10086
10001
|
|
|
10087
10002
|
// src/editor/nodes/image/image.ts
|
|
10088
10003
|
var import_extension_image2 = __toESM(require("@tiptap/extension-image"), 1);
|
|
10089
|
-
var
|
|
10004
|
+
var import_react47 = require("@tiptap/react");
|
|
10090
10005
|
var DEFAULT_IMAGE_BORDER_RADIUS = 0;
|
|
10091
10006
|
var ImageExtension = import_extension_image2.default.extend({
|
|
10092
10007
|
addAttributes() {
|
|
@@ -10224,7 +10139,7 @@ var ImageExtension = import_extension_image2.default.extend({
|
|
|
10224
10139
|
});
|
|
10225
10140
|
},
|
|
10226
10141
|
addNodeView() {
|
|
10227
|
-
return (0,
|
|
10142
|
+
return (0, import_react47.ReactNodeViewRenderer)(ImageView, {
|
|
10228
10143
|
className: "mly:relative"
|
|
10229
10144
|
});
|
|
10230
10145
|
}
|
|
@@ -10233,89 +10148,30 @@ var ImageExtension = import_extension_image2.default.extend({
|
|
|
10233
10148
|
// src/editor/nodes/html/html.tsx
|
|
10234
10149
|
var import_extension_code_block_lowlight = __toESM(require("@tiptap/extension-code-block-lowlight"), 1);
|
|
10235
10150
|
var import_state7 = require("@tiptap/pm/state");
|
|
10236
|
-
var
|
|
10151
|
+
var import_react56 = require("@tiptap/react");
|
|
10237
10152
|
var import_xml = __toESM(require("highlight.js/lib/languages/xml"), 1);
|
|
10238
10153
|
var import_lowlight = require("lowlight");
|
|
10239
10154
|
|
|
10240
10155
|
// src/editor/nodes/html/html-view.tsx
|
|
10241
|
-
var
|
|
10242
|
-
var
|
|
10243
|
-
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
10156
|
+
var import_react48 = require("@tiptap/react");
|
|
10157
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
10244
10158
|
function HTMLCodeBlockView(props) {
|
|
10245
|
-
const { node
|
|
10246
|
-
|
|
10247
|
-
activeTab || (activeTab = "code");
|
|
10159
|
+
const { node } = props;
|
|
10160
|
+
const { language } = node.attrs;
|
|
10248
10161
|
const languageClass = language ? `language-${language}` : "";
|
|
10249
|
-
|
|
10250
|
-
|
|
10251
|
-
if (cur.type.name === "text") {
|
|
10252
|
-
return acc + cur.text;
|
|
10253
|
-
} else if (cur.type.name === "variable") {
|
|
10254
|
-
const { id: variable, fallback } = (cur == null ? void 0 : cur.attrs) || {};
|
|
10255
|
-
const formattedVariable = fallback ? `{{${variable},fallback=${fallback}}}` : `{{${variable}}}`;
|
|
10256
|
-
return acc + formattedVariable;
|
|
10257
|
-
}
|
|
10258
|
-
return acc;
|
|
10259
|
-
}, "");
|
|
10260
|
-
const htmlParser = new DOMParser();
|
|
10261
|
-
const htmlDoc = htmlParser.parseFromString(text2, "text/html");
|
|
10262
|
-
const style = htmlDoc.querySelectorAll("style");
|
|
10263
|
-
const body = htmlDoc.body;
|
|
10264
|
-
const combinedStyle = Array.from(style).map((s) => s.innerHTML).join("\n");
|
|
10265
|
-
return `<style>${combinedStyle}</style>${body.innerHTML}`;
|
|
10266
|
-
}, [activeTab]);
|
|
10267
|
-
const isEmpty = html2 === "";
|
|
10268
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
10269
|
-
import_react51.NodeViewWrapper,
|
|
10162
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
10163
|
+
import_react48.NodeViewWrapper,
|
|
10270
10164
|
{
|
|
10271
10165
|
draggable: false,
|
|
10272
10166
|
"data-drag-handle": false,
|
|
10273
10167
|
"data-type": "htmlCodeBlock",
|
|
10274
|
-
children:
|
|
10275
|
-
|
|
10276
|
-
|
|
10277
|
-
|
|
10278
|
-
|
|
10279
|
-
|
|
10280
|
-
|
|
10281
|
-
) }),
|
|
10282
|
-
activeTab === "preview" && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
10283
|
-
"div",
|
|
10284
|
-
{
|
|
10285
|
-
className: cn(
|
|
10286
|
-
"mly:not-prose mly:rounded-lg mly:border mly:border-gray-200 mly:p-2",
|
|
10287
|
-
isEmpty && "mly:min-h-[42px]"
|
|
10288
|
-
),
|
|
10289
|
-
ref: (node2) => {
|
|
10290
|
-
if (!node2 || (node2 == null ? void 0 : node2.shadowRoot)) {
|
|
10291
|
-
return;
|
|
10292
|
-
}
|
|
10293
|
-
const shadow = node2.attachShadow({ mode: "open" });
|
|
10294
|
-
const sheet = new CSSStyleSheet();
|
|
10295
|
-
sheet.replaceSync(`
|
|
10296
|
-
* { font-family: 'Inter', sans-serif; }
|
|
10297
|
-
blockquote, h1, h2, h3, img, li, ol, p, ul {
|
|
10298
|
-
margin-top: 0;
|
|
10299
|
-
margin-bottom: 0;
|
|
10300
|
-
}
|
|
10301
|
-
`);
|
|
10302
|
-
shadow.adoptedStyleSheets = [sheet];
|
|
10303
|
-
const container = document.createElement("div");
|
|
10304
|
-
container.innerHTML = html2;
|
|
10305
|
-
shadow.appendChild(container);
|
|
10306
|
-
},
|
|
10307
|
-
contentEditable: false,
|
|
10308
|
-
onClick: () => {
|
|
10309
|
-
if (!isEmpty) {
|
|
10310
|
-
return;
|
|
10311
|
-
}
|
|
10312
|
-
updateAttributes2({
|
|
10313
|
-
activeTab: "code"
|
|
10314
|
-
});
|
|
10315
|
-
}
|
|
10316
|
-
}
|
|
10317
|
-
)
|
|
10318
|
-
]
|
|
10168
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("pre", { className: "mly-html-code-pre", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
10169
|
+
import_react48.NodeViewContent,
|
|
10170
|
+
{
|
|
10171
|
+
as: "code",
|
|
10172
|
+
className: cn("is-editable", languageClass)
|
|
10173
|
+
}
|
|
10174
|
+
) })
|
|
10319
10175
|
}
|
|
10320
10176
|
);
|
|
10321
10177
|
}
|
|
@@ -10454,24 +10310,24 @@ var ParagraphExtension = import_extension_paragraph.default.extend({
|
|
|
10454
10310
|
|
|
10455
10311
|
// src/editor/nodes/repeat/repeat.ts
|
|
10456
10312
|
var import_core16 = require("@tiptap/core");
|
|
10457
|
-
var
|
|
10313
|
+
var import_react50 = require("@tiptap/react");
|
|
10458
10314
|
|
|
10459
10315
|
// src/editor/nodes/repeat/repeat-view.tsx
|
|
10460
|
-
var
|
|
10461
|
-
var
|
|
10462
|
-
var
|
|
10316
|
+
var import_react49 = require("@tiptap/react");
|
|
10317
|
+
var import_lucide_react26 = require("lucide-react");
|
|
10318
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
10463
10319
|
function RepeatView(props) {
|
|
10464
10320
|
const { editor, getPos } = props;
|
|
10465
|
-
return /* @__PURE__ */ (0,
|
|
10466
|
-
|
|
10321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
10322
|
+
import_react49.NodeViewWrapper,
|
|
10467
10323
|
{
|
|
10468
10324
|
"data-type": "repeat",
|
|
10469
10325
|
draggable: editor.isEditable,
|
|
10470
10326
|
"data-drag-handle": editor.isEditable,
|
|
10471
10327
|
className: "mly:relative",
|
|
10472
10328
|
children: [
|
|
10473
|
-
/* @__PURE__ */ (0,
|
|
10474
|
-
/* @__PURE__ */ (0,
|
|
10329
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_react49.NodeViewContent, { className: "is-editable" }),
|
|
10330
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
10475
10331
|
"div",
|
|
10476
10332
|
{
|
|
10477
10333
|
role: "button",
|
|
@@ -10482,8 +10338,8 @@ function RepeatView(props) {
|
|
|
10482
10338
|
editor.commands.setNodeSelection(getPos());
|
|
10483
10339
|
},
|
|
10484
10340
|
children: [
|
|
10485
|
-
/* @__PURE__ */ (0,
|
|
10486
|
-
/* @__PURE__ */ (0,
|
|
10341
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react26.Repeat2, { className: "mly:size-3 mly:stroke-[2.5] mly:text-midnight-gray" }),
|
|
10342
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mly:w-[1.5px] mly:grow mly:rounded-full mly:bg-rose-300" })
|
|
10487
10343
|
]
|
|
10488
10344
|
}
|
|
10489
10345
|
)
|
|
@@ -10567,7 +10423,7 @@ var RepeatExtension = import_core16.Node.create({
|
|
|
10567
10423
|
};
|
|
10568
10424
|
},
|
|
10569
10425
|
addNodeView() {
|
|
10570
|
-
return (0,
|
|
10426
|
+
return (0, import_react50.ReactNodeViewRenderer)(RepeatView, {
|
|
10571
10427
|
contentDOMElementTag: "div",
|
|
10572
10428
|
className: "mly:relative"
|
|
10573
10429
|
});
|
|
@@ -10724,14 +10580,14 @@ var SlashCommandExtension = import_core18.Extension.create({
|
|
|
10724
10580
|
});
|
|
10725
10581
|
|
|
10726
10582
|
// src/editor/extensions/slash-command/slash-command-view.tsx
|
|
10727
|
-
var
|
|
10728
|
-
var
|
|
10729
|
-
var
|
|
10583
|
+
var import_react52 = require("@tiptap/react");
|
|
10584
|
+
var import_react53 = require("react");
|
|
10585
|
+
var import_tippy7 = __toESM(require("tippy.js"), 1);
|
|
10730
10586
|
|
|
10731
10587
|
// src/editor/extensions/slash-command/slash-command-item.tsx
|
|
10732
|
-
var
|
|
10733
|
-
var
|
|
10734
|
-
var
|
|
10588
|
+
var import_lucide_react27 = require("lucide-react");
|
|
10589
|
+
var import_react51 = require("react");
|
|
10590
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
10735
10591
|
function SlashCommandItem(props) {
|
|
10736
10592
|
var _a;
|
|
10737
10593
|
const {
|
|
@@ -10746,7 +10602,7 @@ function SlashCommandItem(props) {
|
|
|
10746
10602
|
hoveredItemKey,
|
|
10747
10603
|
onHover
|
|
10748
10604
|
} = props;
|
|
10749
|
-
const [open, setOpen] = (0,
|
|
10605
|
+
const [open, setOpen] = (0, import_react51.useState)(false);
|
|
10750
10606
|
const isActive = groupIndex === selectedGroupIndex && commandIndex === selectedCommandIndex;
|
|
10751
10607
|
const itemKey = `${groupIndex}-${commandIndex}`;
|
|
10752
10608
|
const isHovered = hoveredItemKey === itemKey;
|
|
@@ -10754,19 +10610,19 @@ function SlashCommandItem(props) {
|
|
|
10754
10610
|
const shouldOpenTooltip = !!(item == null ? void 0 : item.preview) && (isHovered || isActive && !hoveredItemKey);
|
|
10755
10611
|
const hasRenderFunction = typeof item.render === "function";
|
|
10756
10612
|
const renderFunctionValue = hasRenderFunction ? (_a = item.render) == null ? void 0 : _a.call(item, editor) : null;
|
|
10757
|
-
let value = /* @__PURE__ */ (0,
|
|
10758
|
-
/* @__PURE__ */ (0,
|
|
10759
|
-
/* @__PURE__ */ (0,
|
|
10760
|
-
/* @__PURE__ */ (0,
|
|
10761
|
-
/* @__PURE__ */ (0,
|
|
10613
|
+
let value = /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
|
|
10614
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "mly:flex mly:h-6 mly:w-6 mly:shrink-0 mly:items-center mly:justify-center", children: item.icon }),
|
|
10615
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "mly:grow", children: [
|
|
10616
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "mly:font-medium", children: item.title }),
|
|
10617
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "mly:text-xs mly:text-gray-400", children: item.description })
|
|
10762
10618
|
] }),
|
|
10763
|
-
isSubCommand2 && /* @__PURE__ */ (0,
|
|
10619
|
+
isSubCommand2 && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "mly:block mly:px-1 mly:text-gray-400", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_lucide_react27.ChevronRightIcon, { className: "mly:size-3.5 mly:stroke-[2.5]" }) })
|
|
10764
10620
|
] });
|
|
10765
10621
|
if (renderFunctionValue !== null && renderFunctionValue !== true) {
|
|
10766
10622
|
value = renderFunctionValue;
|
|
10767
10623
|
}
|
|
10768
|
-
const openTimerRef = (0,
|
|
10769
|
-
const handleDelayedOpen = (0,
|
|
10624
|
+
const openTimerRef = (0, import_react51.useRef)(0);
|
|
10625
|
+
const handleDelayedOpen = (0, import_react51.useCallback)(() => {
|
|
10770
10626
|
window.clearTimeout(openTimerRef.current);
|
|
10771
10627
|
const delay = 200;
|
|
10772
10628
|
openTimerRef.current = window.setTimeout(() => {
|
|
@@ -10774,7 +10630,7 @@ function SlashCommandItem(props) {
|
|
|
10774
10630
|
openTimerRef.current = 0;
|
|
10775
10631
|
}, delay);
|
|
10776
10632
|
}, [setOpen]);
|
|
10777
|
-
(0,
|
|
10633
|
+
(0, import_react51.useEffect)(() => {
|
|
10778
10634
|
if (shouldOpenTooltip) {
|
|
10779
10635
|
handleDelayedOpen();
|
|
10780
10636
|
} else {
|
|
@@ -10783,7 +10639,7 @@ function SlashCommandItem(props) {
|
|
|
10783
10639
|
setOpen(false);
|
|
10784
10640
|
}
|
|
10785
10641
|
}, [shouldOpenTooltip]);
|
|
10786
|
-
(0,
|
|
10642
|
+
(0, import_react51.useEffect)(() => {
|
|
10787
10643
|
return () => {
|
|
10788
10644
|
if (openTimerRef.current) {
|
|
10789
10645
|
window.clearTimeout(openTimerRef.current);
|
|
@@ -10791,8 +10647,8 @@ function SlashCommandItem(props) {
|
|
|
10791
10647
|
}
|
|
10792
10648
|
};
|
|
10793
10649
|
}, []);
|
|
10794
|
-
return /* @__PURE__ */ (0,
|
|
10795
|
-
/* @__PURE__ */ (0,
|
|
10650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Tooltip, { open, children: [
|
|
10651
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
10796
10652
|
"button",
|
|
10797
10653
|
{
|
|
10798
10654
|
className: cn(
|
|
@@ -10807,14 +10663,14 @@ function SlashCommandItem(props) {
|
|
|
10807
10663
|
children: value
|
|
10808
10664
|
}
|
|
10809
10665
|
) }),
|
|
10810
|
-
/* @__PURE__ */ (0,
|
|
10666
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
10811
10667
|
TooltipContent,
|
|
10812
10668
|
{
|
|
10813
10669
|
side: "right",
|
|
10814
10670
|
sideOffset: 10,
|
|
10815
10671
|
className: "mly:w-52 mly:rounded-lg mly:border-none mly:p-1 mly:shadow",
|
|
10816
|
-
children: typeof item.preview === "function" ? item == null ? void 0 : item.preview(editor) : /* @__PURE__ */ (0,
|
|
10817
|
-
/* @__PURE__ */ (0,
|
|
10672
|
+
children: typeof item.preview === "function" ? item == null ? void 0 : item.preview(editor) : /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
|
|
10673
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("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__ */ (0, import_jsx_runtime52.jsx)(
|
|
10818
10674
|
"img",
|
|
10819
10675
|
{
|
|
10820
10676
|
src: item == null ? void 0 : item.preview,
|
|
@@ -10822,7 +10678,7 @@ function SlashCommandItem(props) {
|
|
|
10822
10678
|
className: "mly:absolute mly:inset-0 mly:h-full mly:w-full mly:object-cover"
|
|
10823
10679
|
}
|
|
10824
10680
|
) }),
|
|
10825
|
-
/* @__PURE__ */ (0,
|
|
10681
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { className: "mly:mt-2 mly:px-0.5 mly:text-gray-500", children: item.description })
|
|
10826
10682
|
] })
|
|
10827
10683
|
}
|
|
10828
10684
|
)
|
|
@@ -10911,16 +10767,16 @@ function processCommand(options) {
|
|
|
10911
10767
|
}
|
|
10912
10768
|
|
|
10913
10769
|
// src/editor/extensions/slash-command/slash-command-view.tsx
|
|
10914
|
-
var
|
|
10915
|
-
var CommandList = (0,
|
|
10770
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
10771
|
+
var CommandList = (0, import_react53.forwardRef)((props, ref) => {
|
|
10916
10772
|
const { items: groups, command, editor, range, query } = props;
|
|
10917
|
-
const [selectedGroupIndex, setSelectedGroupIndex] = (0,
|
|
10918
|
-
const [selectedCommandIndex, setSelectedCommandIndex] = (0,
|
|
10919
|
-
const [hoveredItemKey, setHoveredItemKey] = (0,
|
|
10920
|
-
const prevQuery = (0,
|
|
10921
|
-
const prevSelectedGroupIndex = (0,
|
|
10922
|
-
const prevSelectedCommandIndex = (0,
|
|
10923
|
-
const selectItem = (0,
|
|
10773
|
+
const [selectedGroupIndex, setSelectedGroupIndex] = (0, import_react53.useState)(0);
|
|
10774
|
+
const [selectedCommandIndex, setSelectedCommandIndex] = (0, import_react53.useState)(0);
|
|
10775
|
+
const [hoveredItemKey, setHoveredItemKey] = (0, import_react53.useState)(null);
|
|
10776
|
+
const prevQuery = (0, import_react53.useRef)("");
|
|
10777
|
+
const prevSelectedGroupIndex = (0, import_react53.useRef)(0);
|
|
10778
|
+
const prevSelectedCommandIndex = (0, import_react53.useRef)(0);
|
|
10779
|
+
const selectItem = (0, import_react53.useCallback)(
|
|
10924
10780
|
(groupIndex, commandIndex) => {
|
|
10925
10781
|
const item = groups[groupIndex].commands[commandIndex];
|
|
10926
10782
|
if (!item) {
|
|
@@ -10930,7 +10786,7 @@ var CommandList = (0, import_react57.forwardRef)((props, ref) => {
|
|
|
10930
10786
|
},
|
|
10931
10787
|
[command]
|
|
10932
10788
|
);
|
|
10933
|
-
(0,
|
|
10789
|
+
(0, import_react53.useImperativeHandle)(ref, () => ({
|
|
10934
10790
|
onKeyDown: ({ event }) => {
|
|
10935
10791
|
var _a, _b, _c, _d;
|
|
10936
10792
|
const navigationKeys = [
|
|
@@ -11018,9 +10874,9 @@ var CommandList = (0, import_react57.forwardRef)((props, ref) => {
|
|
|
11018
10874
|
}
|
|
11019
10875
|
}
|
|
11020
10876
|
}));
|
|
11021
|
-
const commandListContainer = (0,
|
|
11022
|
-
const activeCommandRef = (0,
|
|
11023
|
-
(0,
|
|
10877
|
+
const commandListContainer = (0, import_react53.useRef)(null);
|
|
10878
|
+
const activeCommandRef = (0, import_react53.useRef)(null);
|
|
10879
|
+
(0, import_react53.useLayoutEffect)(() => {
|
|
11024
10880
|
const container = commandListContainer == null ? void 0 : commandListContainer.current;
|
|
11025
10881
|
const activeCommandContainer = activeCommandRef == null ? void 0 : activeCommandRef.current;
|
|
11026
10882
|
if (!container || !activeCommandContainer) {
|
|
@@ -11035,11 +10891,11 @@ var CommandList = (0, import_react57.forwardRef)((props, ref) => {
|
|
|
11035
10891
|
commandListContainer,
|
|
11036
10892
|
activeCommandRef
|
|
11037
10893
|
]);
|
|
11038
|
-
(0,
|
|
10894
|
+
(0, import_react53.useEffect)(() => {
|
|
11039
10895
|
setSelectedGroupIndex(0);
|
|
11040
10896
|
setSelectedCommandIndex(0);
|
|
11041
10897
|
}, [groups]);
|
|
11042
|
-
(0,
|
|
10898
|
+
(0, import_react53.useEffect)(() => {
|
|
11043
10899
|
return () => {
|
|
11044
10900
|
prevQuery.current = "";
|
|
11045
10901
|
prevSelectedGroupIndex.current = 0;
|
|
@@ -11049,15 +10905,15 @@ var CommandList = (0, import_react57.forwardRef)((props, ref) => {
|
|
|
11049
10905
|
if (!groups || groups.length === 0) {
|
|
11050
10906
|
return null;
|
|
11051
10907
|
}
|
|
11052
|
-
return /* @__PURE__ */ (0,
|
|
11053
|
-
/* @__PURE__ */ (0,
|
|
10908
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("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: [
|
|
10909
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
11054
10910
|
"div",
|
|
11055
10911
|
{
|
|
11056
10912
|
id: "slash-command",
|
|
11057
10913
|
ref: commandListContainer,
|
|
11058
10914
|
className: "mly:no-scrollbar mly:h-auto mly:max-h-[330px] mly:overflow-y-auto",
|
|
11059
|
-
children: groups.map((group, groupIndex) => /* @__PURE__ */ (0,
|
|
11060
|
-
/* @__PURE__ */ (0,
|
|
10915
|
+
children: groups.map((group, groupIndex) => /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_react53.Fragment, { children: [
|
|
10916
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
11061
10917
|
"span",
|
|
11062
10918
|
{
|
|
11063
10919
|
className: cn(
|
|
@@ -11067,9 +10923,9 @@ var CommandList = (0, import_react57.forwardRef)((props, ref) => {
|
|
|
11067
10923
|
children: group.title
|
|
11068
10924
|
}
|
|
11069
10925
|
),
|
|
11070
|
-
/* @__PURE__ */ (0,
|
|
10926
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "mly:space-y-0.5 mly:p-1", children: group.commands.map((item, commandIndex) => {
|
|
11071
10927
|
const itemKey = `${groupIndex}-${commandIndex}`;
|
|
11072
|
-
return /* @__PURE__ */ (0,
|
|
10928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
11073
10929
|
SlashCommandItem,
|
|
11074
10930
|
{
|
|
11075
10931
|
item,
|
|
@@ -11089,16 +10945,16 @@ var CommandList = (0, import_react57.forwardRef)((props, ref) => {
|
|
|
11089
10945
|
] }, groupIndex))
|
|
11090
10946
|
}
|
|
11091
10947
|
),
|
|
11092
|
-
/* @__PURE__ */ (0,
|
|
11093
|
-
/* @__PURE__ */ (0,
|
|
11094
|
-
/* @__PURE__ */ (0,
|
|
11095
|
-
/* @__PURE__ */ (0,
|
|
10948
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "mly:border-t mly:border-gray-200 mly:px-1 mly:py-3 mly:pl-4", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "mly:flex mly:items-center", children: [
|
|
10949
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("p", { className: "mly:text-center mly:text-xs mly:text-gray-400", children: [
|
|
10950
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("kbd", { className: "mly:rounded mly:border mly:border-gray-200 mly:p-1 mly:px-2 mly:font-medium", children: "\u2191" }),
|
|
10951
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("kbd", { className: "mly:ml-1 mly:rounded mly:border mly:border-gray-200 mly:p-1 mly:px-2 mly:font-medium", children: "\u2193" }),
|
|
11096
10952
|
" ",
|
|
11097
10953
|
"to navigate"
|
|
11098
10954
|
] }),
|
|
11099
|
-
/* @__PURE__ */ (0,
|
|
11100
|
-
/* @__PURE__ */ (0,
|
|
11101
|
-
/* @__PURE__ */ (0,
|
|
10955
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { "aria-hidden": "true", className: "mly:select-none mly:px-1", children: "\xB7" }),
|
|
10956
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("p", { className: "mly:text-center mly:text-xs mly:text-gray-400", children: [
|
|
10957
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("kbd", { className: "mly:rounded mly:border mly:border-gray-200 mly:p-1 mly:px-1.5 mly:font-medium", children: "Enter" }),
|
|
11102
10958
|
" ",
|
|
11103
10959
|
"to select"
|
|
11104
10960
|
] })
|
|
@@ -11122,11 +10978,11 @@ function getSlashCommandSuggestions(groups = DEFAULT_SLASH_COMMANDS) {
|
|
|
11122
10978
|
let popup = null;
|
|
11123
10979
|
return {
|
|
11124
10980
|
onStart: (props) => {
|
|
11125
|
-
component = new
|
|
10981
|
+
component = new import_react52.ReactRenderer(CommandList, {
|
|
11126
10982
|
props,
|
|
11127
10983
|
editor: props.editor
|
|
11128
10984
|
});
|
|
11129
|
-
popup = (0,
|
|
10985
|
+
popup = (0, import_tippy7.default)("body", {
|
|
11130
10986
|
getReferenceClientRect: props.clientRect,
|
|
11131
10987
|
appendTo: () => document.body,
|
|
11132
10988
|
content: component.element,
|
|
@@ -11175,16 +11031,16 @@ function getSlashCommandSuggestions(groups = DEFAULT_SLASH_COMMANDS) {
|
|
|
11175
11031
|
}
|
|
11176
11032
|
|
|
11177
11033
|
// src/editor/nodes/variable/variable-suggestions.tsx
|
|
11178
|
-
var
|
|
11179
|
-
var
|
|
11180
|
-
var
|
|
11181
|
-
var
|
|
11182
|
-
var VariableList = (0,
|
|
11034
|
+
var import_react54 = require("@tiptap/react");
|
|
11035
|
+
var import_react55 = require("react");
|
|
11036
|
+
var import_tippy8 = __toESM(require("tippy.js"), 1);
|
|
11037
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
11038
|
+
var VariableList = (0, import_react55.forwardRef)((props, ref) => {
|
|
11183
11039
|
var _a;
|
|
11184
11040
|
const { items = [], editor } = props;
|
|
11185
|
-
const popoverRef = (0,
|
|
11041
|
+
const popoverRef = (0, import_react55.useRef)(null);
|
|
11186
11042
|
const VariableSuggestionPopoverComponent = (_a = useVariableOptions(editor)) == null ? void 0 : _a.variableSuggestionsPopover;
|
|
11187
|
-
(0,
|
|
11043
|
+
(0, import_react55.useImperativeHandle)(ref, () => ({
|
|
11188
11044
|
onKeyDown: ({ event }) => {
|
|
11189
11045
|
if (!popoverRef.current) {
|
|
11190
11046
|
return false;
|
|
@@ -11207,7 +11063,7 @@ var VariableList = (0, import_react59.forwardRef)((props, ref) => {
|
|
|
11207
11063
|
return false;
|
|
11208
11064
|
}
|
|
11209
11065
|
}));
|
|
11210
|
-
return /* @__PURE__ */ (0,
|
|
11066
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
11211
11067
|
VariableSuggestionPopoverComponent,
|
|
11212
11068
|
{
|
|
11213
11069
|
items,
|
|
@@ -11242,14 +11098,14 @@ function getVariableSuggestions(char = DEFAULT_VARIABLE_TRIGGER_CHAR) {
|
|
|
11242
11098
|
let popup = null;
|
|
11243
11099
|
return {
|
|
11244
11100
|
onStart: (props) => {
|
|
11245
|
-
component = new
|
|
11101
|
+
component = new import_react54.ReactRenderer(VariableList, {
|
|
11246
11102
|
props,
|
|
11247
11103
|
editor: props.editor
|
|
11248
11104
|
});
|
|
11249
11105
|
if (!props.clientRect) {
|
|
11250
11106
|
return;
|
|
11251
11107
|
}
|
|
11252
|
-
popup = (0,
|
|
11108
|
+
popup = (0, import_tippy8.default)("body", {
|
|
11253
11109
|
getReferenceClientRect: props.clientRect,
|
|
11254
11110
|
appendTo: () => document.body,
|
|
11255
11111
|
content: component.element,
|
|
@@ -11316,7 +11172,7 @@ var HTMLCodeBlockExtension = import_extension_code_block_lowlight.default.extend
|
|
|
11316
11172
|
});
|
|
11317
11173
|
},
|
|
11318
11174
|
addNodeView() {
|
|
11319
|
-
return (0,
|
|
11175
|
+
return (0, import_react56.ReactNodeViewRenderer)(HTMLCodeBlockView, {
|
|
11320
11176
|
className: "mly:relative",
|
|
11321
11177
|
attrs: ({ node }) => {
|
|
11322
11178
|
var _a;
|
|
@@ -11391,17 +11247,17 @@ var isCustomNodeSelected = (editor, node) => {
|
|
|
11391
11247
|
};
|
|
11392
11248
|
|
|
11393
11249
|
// src/editor/components/text-menu/text-bubble-menu.tsx
|
|
11394
|
-
var
|
|
11250
|
+
var import_react60 = require("@tiptap/react");
|
|
11395
11251
|
|
|
11396
11252
|
// src/editor/components/text-menu/text-bubble-content.tsx
|
|
11397
|
-
var
|
|
11253
|
+
var import_lucide_react28 = require("lucide-react");
|
|
11398
11254
|
|
|
11399
11255
|
// src/editor/components/text-menu/use-text-menu-state.tsx
|
|
11400
|
-
var
|
|
11401
|
-
var
|
|
11256
|
+
var import_react57 = require("@tiptap/react");
|
|
11257
|
+
var import_fast_deep_equal7 = __toESM(require("fast-deep-equal"), 1);
|
|
11402
11258
|
var DEFAULT_TEXT_COLOR = "#374151";
|
|
11403
11259
|
var useTextMenuState = (editor) => {
|
|
11404
|
-
const states = (0,
|
|
11260
|
+
const states = (0, import_react57.useEditorState)({
|
|
11405
11261
|
editor,
|
|
11406
11262
|
selector: (ctx) => {
|
|
11407
11263
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -11417,13 +11273,13 @@ var useTextMenuState = (editor) => {
|
|
|
11417
11273
|
paragraphShowIfKey: ((_h = ctx.editor.getAttributes("paragraph")) == null ? void 0 : _h.showIfKey) || ""
|
|
11418
11274
|
};
|
|
11419
11275
|
},
|
|
11420
|
-
equalityFn:
|
|
11276
|
+
equalityFn: import_fast_deep_equal7.default
|
|
11421
11277
|
});
|
|
11422
11278
|
return states;
|
|
11423
11279
|
};
|
|
11424
11280
|
|
|
11425
11281
|
// src/editor/components/text-menu/text-bubble-content.tsx
|
|
11426
|
-
var
|
|
11282
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
11427
11283
|
function TextBubbleContent(props) {
|
|
11428
11284
|
var _a, _b, _c, _d;
|
|
11429
11285
|
const { editor, showListMenu = true } = props;
|
|
@@ -11435,41 +11291,41 @@ function TextBubbleContent(props) {
|
|
|
11435
11291
|
name: "bold",
|
|
11436
11292
|
isActive: () => editor == null ? void 0 : editor.isActive("bold"),
|
|
11437
11293
|
command: () => editor == null ? void 0 : editor.chain().focus().toggleBold().run(),
|
|
11438
|
-
icon:
|
|
11294
|
+
icon: import_lucide_react28.BoldIcon,
|
|
11439
11295
|
tooltip: "Bold"
|
|
11440
11296
|
},
|
|
11441
11297
|
{
|
|
11442
11298
|
name: "italic",
|
|
11443
11299
|
isActive: () => editor == null ? void 0 : editor.isActive("italic"),
|
|
11444
11300
|
command: () => editor == null ? void 0 : editor.chain().focus().toggleItalic().run(),
|
|
11445
|
-
icon:
|
|
11301
|
+
icon: import_lucide_react28.ItalicIcon,
|
|
11446
11302
|
tooltip: "Italic"
|
|
11447
11303
|
},
|
|
11448
11304
|
{
|
|
11449
11305
|
name: "underline",
|
|
11450
11306
|
isActive: () => editor == null ? void 0 : editor.isActive("underline"),
|
|
11451
11307
|
command: () => editor == null ? void 0 : editor.chain().focus().toggleUnderline().run(),
|
|
11452
|
-
icon:
|
|
11308
|
+
icon: import_lucide_react28.UnderlineIcon,
|
|
11453
11309
|
tooltip: "Underline"
|
|
11454
11310
|
},
|
|
11455
11311
|
{
|
|
11456
11312
|
name: "strike",
|
|
11457
11313
|
isActive: () => editor == null ? void 0 : editor.isActive("strike"),
|
|
11458
11314
|
command: () => editor == null ? void 0 : editor.chain().focus().toggleStrike().run(),
|
|
11459
|
-
icon:
|
|
11315
|
+
icon: import_lucide_react28.StrikethroughIcon,
|
|
11460
11316
|
tooltip: "Strikethrough"
|
|
11461
11317
|
},
|
|
11462
11318
|
{
|
|
11463
11319
|
name: "code",
|
|
11464
11320
|
isActive: () => editor == null ? void 0 : editor.isActive("code"),
|
|
11465
11321
|
command: () => editor == null ? void 0 : editor.chain().focus().toggleCode().run(),
|
|
11466
|
-
icon:
|
|
11322
|
+
icon: import_lucide_react28.CodeIcon,
|
|
11467
11323
|
tooltip: "Code"
|
|
11468
11324
|
}
|
|
11469
11325
|
];
|
|
11470
|
-
return /* @__PURE__ */ (0,
|
|
11471
|
-
items.map((item, index) => /* @__PURE__ */ (0,
|
|
11472
|
-
/* @__PURE__ */ (0,
|
|
11326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
|
|
11327
|
+
items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(BubbleMenuButton, __spreadValues({}, item), index)),
|
|
11328
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
11473
11329
|
AlignmentSwitch,
|
|
11474
11330
|
{
|
|
11475
11331
|
alignment: state.textAlign,
|
|
@@ -11478,21 +11334,21 @@ function TextBubbleContent(props) {
|
|
|
11478
11334
|
}
|
|
11479
11335
|
}
|
|
11480
11336
|
),
|
|
11481
|
-
!state.isListActive && showListMenu && /* @__PURE__ */ (0,
|
|
11482
|
-
/* @__PURE__ */ (0,
|
|
11337
|
+
!state.isListActive && showListMenu && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
|
|
11338
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
11483
11339
|
BubbleMenuButton,
|
|
11484
11340
|
{
|
|
11485
|
-
icon:
|
|
11341
|
+
icon: import_lucide_react28.List,
|
|
11486
11342
|
command: () => {
|
|
11487
11343
|
editor.chain().focus().toggleBulletList().run();
|
|
11488
11344
|
},
|
|
11489
11345
|
tooltip: "Bullet List"
|
|
11490
11346
|
}
|
|
11491
11347
|
),
|
|
11492
|
-
/* @__PURE__ */ (0,
|
|
11348
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
11493
11349
|
BubbleMenuButton,
|
|
11494
11350
|
{
|
|
11495
|
-
icon:
|
|
11351
|
+
icon: import_lucide_react28.ListOrdered,
|
|
11496
11352
|
command: () => {
|
|
11497
11353
|
editor.chain().focus().toggleOrderedList().run();
|
|
11498
11354
|
},
|
|
@@ -11500,7 +11356,7 @@ function TextBubbleContent(props) {
|
|
|
11500
11356
|
}
|
|
11501
11357
|
)
|
|
11502
11358
|
] }),
|
|
11503
|
-
/* @__PURE__ */ (0,
|
|
11359
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
11504
11360
|
LinkInputPopover,
|
|
11505
11361
|
{
|
|
11506
11362
|
defaultValue: (_d = state == null ? void 0 : state.linkUrl) != null ? _d : "",
|
|
@@ -11516,8 +11372,8 @@ function TextBubbleContent(props) {
|
|
|
11516
11372
|
isVariable: state.isUrlVariable
|
|
11517
11373
|
}
|
|
11518
11374
|
),
|
|
11519
|
-
/* @__PURE__ */ (0,
|
|
11520
|
-
/* @__PURE__ */ (0,
|
|
11375
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Divider, {}),
|
|
11376
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
11521
11377
|
ColorPicker,
|
|
11522
11378
|
{
|
|
11523
11379
|
color: state.currentTextColor,
|
|
@@ -11526,16 +11382,16 @@ function TextBubbleContent(props) {
|
|
|
11526
11382
|
},
|
|
11527
11383
|
tooltip: "Text Color",
|
|
11528
11384
|
suggestedColors,
|
|
11529
|
-
children: /* @__PURE__ */ (0,
|
|
11385
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
11530
11386
|
BaseButton,
|
|
11531
11387
|
{
|
|
11532
11388
|
variant: "ghost",
|
|
11533
11389
|
size: "sm",
|
|
11534
11390
|
type: "button",
|
|
11535
11391
|
className: "mly:h-7 mly:w-7 mly:shrink-0 mly:p-0",
|
|
11536
|
-
children: /* @__PURE__ */ (0,
|
|
11537
|
-
/* @__PURE__ */ (0,
|
|
11538
|
-
/* @__PURE__ */ (0,
|
|
11392
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "mly:flex mly:flex-col mly:items-center mly:justify-center mly:gap-px", children: [
|
|
11393
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "mly:font-bolder mly:font-mono mly:text-xs mly:text-slate-700", children: "A" }),
|
|
11394
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
11539
11395
|
"div",
|
|
11540
11396
|
{
|
|
11541
11397
|
className: "mly:h-[2px] mly:w-3",
|
|
@@ -11551,35 +11407,42 @@ function TextBubbleContent(props) {
|
|
|
11551
11407
|
}
|
|
11552
11408
|
|
|
11553
11409
|
// src/editor/components/text-menu/turn-into-block.tsx
|
|
11554
|
-
var
|
|
11555
|
-
var
|
|
11556
|
-
var
|
|
11410
|
+
var import_lucide_react29 = require("lucide-react");
|
|
11411
|
+
var import_react58 = require("react");
|
|
11412
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
11557
11413
|
var isOption = (option) => option.type === "option";
|
|
11558
11414
|
var isCategory = (option) => option.type === "category";
|
|
11559
11415
|
function TurnIntoBlock(props) {
|
|
11560
11416
|
const { options } = props;
|
|
11561
|
-
const activeItem = (0,
|
|
11417
|
+
const activeItem = (0, import_react58.useMemo)(
|
|
11562
11418
|
() => options.find((option) => option.type === "option" && option.isActive()),
|
|
11563
11419
|
[options]
|
|
11564
11420
|
);
|
|
11565
|
-
const { icon: ActiveIcon =
|
|
11566
|
-
return /* @__PURE__ */ (0,
|
|
11567
|
-
/* @__PURE__ */ (0,
|
|
11568
|
-
/* @__PURE__ */ (0,
|
|
11421
|
+
const { icon: ActiveIcon = import_lucide_react29.PilcrowIcon } = activeItem || {};
|
|
11422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Popover, { children: [
|
|
11423
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Tooltip, { children: [
|
|
11424
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
11569
11425
|
PopoverTrigger,
|
|
11570
11426
|
{
|
|
11571
11427
|
className: cn(
|
|
11572
11428
|
"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"
|
|
11573
11429
|
),
|
|
11574
11430
|
children: [
|
|
11575
|
-
/* @__PURE__ */ (0,
|
|
11576
|
-
/* @__PURE__ */ (0,
|
|
11431
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ActiveIcon, { className: "mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5]" }),
|
|
11432
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react29.ChevronDownIcon, { className: "mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5]" })
|
|
11577
11433
|
]
|
|
11578
11434
|
}
|
|
11579
11435
|
) }),
|
|
11580
|
-
/* @__PURE__ */ (0,
|
|
11436
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
11437
|
+
TooltipContent,
|
|
11438
|
+
{
|
|
11439
|
+
sideOffset: 8,
|
|
11440
|
+
className: "mly:border-gray-300 mly:bg-transparent mly:p-0 mly:text-gray-700 mly:shadow-sm",
|
|
11441
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "mly:block mly:rounded-md mly:bg-soft-gray mly:!px-2 mly:!py-1.5", children: "Turn into" })
|
|
11442
|
+
}
|
|
11443
|
+
)
|
|
11581
11444
|
] }),
|
|
11582
|
-
/* @__PURE__ */ (0,
|
|
11445
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
11583
11446
|
PopoverContent,
|
|
11584
11447
|
{
|
|
11585
11448
|
align: "start",
|
|
@@ -11588,21 +11451,21 @@ function TurnIntoBlock(props) {
|
|
|
11588
11451
|
className: "mly:flex mly:w-[160px] mly:flex-col mly:rounded-md mly:p-1",
|
|
11589
11452
|
children: options.map((option, index) => {
|
|
11590
11453
|
if (isOption(option)) {
|
|
11591
|
-
return /* @__PURE__ */ (0,
|
|
11454
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
11592
11455
|
BaseButton,
|
|
11593
11456
|
{
|
|
11594
11457
|
onClick: option.onClick,
|
|
11595
11458
|
variant: "ghost",
|
|
11596
11459
|
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",
|
|
11597
11460
|
children: [
|
|
11598
|
-
/* @__PURE__ */ (0,
|
|
11461
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(option.icon, { className: "mly:size-[15px] mly:shrink-0" }),
|
|
11599
11462
|
option.label
|
|
11600
11463
|
]
|
|
11601
11464
|
},
|
|
11602
11465
|
option.id
|
|
11603
11466
|
);
|
|
11604
11467
|
} else if (isCategory(option)) {
|
|
11605
|
-
return /* @__PURE__ */ (0,
|
|
11468
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
11606
11469
|
"label",
|
|
11607
11470
|
{
|
|
11608
11471
|
className: cn(
|
|
@@ -11621,10 +11484,10 @@ function TurnIntoBlock(props) {
|
|
|
11621
11484
|
}
|
|
11622
11485
|
|
|
11623
11486
|
// src/editor/components/text-menu/use-turn-into-block-options.tsx
|
|
11624
|
-
var
|
|
11625
|
-
var
|
|
11487
|
+
var import_react59 = require("@tiptap/react");
|
|
11488
|
+
var import_lucide_react30 = require("lucide-react");
|
|
11626
11489
|
function useTurnIntoBlockOptions(editor) {
|
|
11627
|
-
return (0,
|
|
11490
|
+
return (0, import_react59.useEditorState)({
|
|
11628
11491
|
editor,
|
|
11629
11492
|
selector: ({ editor: editor2 }) => [
|
|
11630
11493
|
{
|
|
@@ -11633,7 +11496,7 @@ function useTurnIntoBlockOptions(editor) {
|
|
|
11633
11496
|
id: "hierarchy"
|
|
11634
11497
|
},
|
|
11635
11498
|
{
|
|
11636
|
-
icon:
|
|
11499
|
+
icon: import_lucide_react30.PilcrowIcon,
|
|
11637
11500
|
onClick: () => editor2.chain().focus().liftListItem("listItem").setParagraph().run(),
|
|
11638
11501
|
id: "paragraph",
|
|
11639
11502
|
disabled: () => !editor2.can().setParagraph(),
|
|
@@ -11642,7 +11505,7 @@ function useTurnIntoBlockOptions(editor) {
|
|
|
11642
11505
|
type: "option"
|
|
11643
11506
|
},
|
|
11644
11507
|
{
|
|
11645
|
-
icon:
|
|
11508
|
+
icon: import_lucide_react30.Heading1Icon,
|
|
11646
11509
|
onClick: () => editor2.chain().focus().liftListItem("listItem").setHeading({ level: 1 }).run(),
|
|
11647
11510
|
id: "heading1",
|
|
11648
11511
|
disabled: () => !editor2.can().setHeading({ level: 1 }),
|
|
@@ -11651,7 +11514,7 @@ function useTurnIntoBlockOptions(editor) {
|
|
|
11651
11514
|
type: "option"
|
|
11652
11515
|
},
|
|
11653
11516
|
{
|
|
11654
|
-
icon:
|
|
11517
|
+
icon: import_lucide_react30.Heading2Icon,
|
|
11655
11518
|
onClick: () => editor2.chain().focus().liftListItem("listItem").setHeading({ level: 2 }).run(),
|
|
11656
11519
|
id: "heading2",
|
|
11657
11520
|
disabled: () => !editor2.can().setHeading({ level: 2 }),
|
|
@@ -11660,7 +11523,7 @@ function useTurnIntoBlockOptions(editor) {
|
|
|
11660
11523
|
type: "option"
|
|
11661
11524
|
},
|
|
11662
11525
|
{
|
|
11663
|
-
icon:
|
|
11526
|
+
icon: import_lucide_react30.Heading3Icon,
|
|
11664
11527
|
onClick: () => editor2.chain().focus().liftListItem("listItem").setHeading({ level: 3 }).run(),
|
|
11665
11528
|
id: "heading3",
|
|
11666
11529
|
disabled: () => !editor2.can().setHeading({ level: 3 }),
|
|
@@ -11674,7 +11537,7 @@ function useTurnIntoBlockOptions(editor) {
|
|
|
11674
11537
|
id: "lists"
|
|
11675
11538
|
},
|
|
11676
11539
|
{
|
|
11677
|
-
icon:
|
|
11540
|
+
icon: import_lucide_react30.ListIcon,
|
|
11678
11541
|
onClick: () => editor2.chain().focus().toggleBulletList().run(),
|
|
11679
11542
|
id: "bulletList",
|
|
11680
11543
|
disabled: () => !editor2.can().toggleBulletList(),
|
|
@@ -11683,7 +11546,7 @@ function useTurnIntoBlockOptions(editor) {
|
|
|
11683
11546
|
type: "option"
|
|
11684
11547
|
},
|
|
11685
11548
|
{
|
|
11686
|
-
icon:
|
|
11549
|
+
icon: import_lucide_react30.ListOrderedIcon,
|
|
11687
11550
|
onClick: () => editor2.chain().focus().toggleOrderedList().run(),
|
|
11688
11551
|
id: "orderedList",
|
|
11689
11552
|
disabled: () => !editor2.can().toggleOrderedList(),
|
|
@@ -11696,7 +11559,7 @@ function useTurnIntoBlockOptions(editor) {
|
|
|
11696
11559
|
}
|
|
11697
11560
|
|
|
11698
11561
|
// src/editor/components/text-menu/text-bubble-menu.tsx
|
|
11699
|
-
var
|
|
11562
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
11700
11563
|
function TextBubbleMenu(props) {
|
|
11701
11564
|
const { editor, appendTo } = props;
|
|
11702
11565
|
if (!editor) {
|
|
@@ -11747,23 +11610,23 @@ function TextBubbleMenu(props) {
|
|
|
11747
11610
|
}
|
|
11748
11611
|
});
|
|
11749
11612
|
const turnIntoBlockOptions = useTurnIntoBlockOptions(editor);
|
|
11750
|
-
return /* @__PURE__ */ (0,
|
|
11751
|
-
|
|
11613
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
11614
|
+
import_react60.BubbleMenu,
|
|
11752
11615
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
11753
11616
|
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",
|
|
11754
|
-
children: /* @__PURE__ */ (0,
|
|
11755
|
-
/* @__PURE__ */ (0,
|
|
11756
|
-
/* @__PURE__ */ (0,
|
|
11757
|
-
/* @__PURE__ */ (0,
|
|
11617
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(TooltipProvider, { children: [
|
|
11618
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(TurnIntoBlock, { options: turnIntoBlockOptions }),
|
|
11619
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Divider, { className: "mly:mx-0" }),
|
|
11620
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(TextBubbleContent, { editor })
|
|
11758
11621
|
] })
|
|
11759
11622
|
})
|
|
11760
11623
|
);
|
|
11761
11624
|
}
|
|
11762
11625
|
|
|
11763
11626
|
// src/editor/components/variable-menu/variable-bubble-menu.tsx
|
|
11764
|
-
var
|
|
11765
|
-
var
|
|
11766
|
-
var
|
|
11627
|
+
var import_react61 = require("@tiptap/react");
|
|
11628
|
+
var import_tippy9 = require("tippy.js");
|
|
11629
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
11767
11630
|
function VariableBubbleMenu(props) {
|
|
11768
11631
|
const { editor, appendTo } = props;
|
|
11769
11632
|
if (!editor) {
|
|
@@ -11779,18 +11642,18 @@ function VariableBubbleMenu(props) {
|
|
|
11779
11642
|
popperOptions: {
|
|
11780
11643
|
modifiers: [{ name: "flip", enabled: false }]
|
|
11781
11644
|
},
|
|
11782
|
-
plugins: [
|
|
11645
|
+
plugins: [import_tippy9.sticky],
|
|
11783
11646
|
sticky: "popper",
|
|
11784
11647
|
maxWidth: "100%",
|
|
11785
11648
|
appendTo: () => (appendTo == null ? void 0 : appendTo.current) || "parent",
|
|
11786
11649
|
placement: "top-start"
|
|
11787
11650
|
}
|
|
11788
11651
|
});
|
|
11789
|
-
return /* @__PURE__ */ (0,
|
|
11790
|
-
|
|
11652
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
11653
|
+
import_react61.BubbleMenu,
|
|
11791
11654
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
11792
11655
|
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",
|
|
11793
|
-
children: /* @__PURE__ */ (0,
|
|
11656
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(TextBubbleContent, { showListMenu: false, editor }) })
|
|
11794
11657
|
})
|
|
11795
11658
|
);
|
|
11796
11659
|
}
|
|
@@ -11876,8 +11739,8 @@ function replaceDeprecatedNode(json) {
|
|
|
11876
11739
|
}
|
|
11877
11740
|
|
|
11878
11741
|
// src/editor/index.tsx
|
|
11879
|
-
var
|
|
11880
|
-
function
|
|
11742
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
11743
|
+
function Editor12(props) {
|
|
11881
11744
|
const {
|
|
11882
11745
|
config: {
|
|
11883
11746
|
wrapClassName = "",
|
|
@@ -11900,7 +11763,7 @@ function Editor13(props) {
|
|
|
11900
11763
|
scrollThreshold = 40,
|
|
11901
11764
|
scrollMargin = 40
|
|
11902
11765
|
} = props;
|
|
11903
|
-
const formattedContent = (0,
|
|
11766
|
+
const formattedContent = (0, import_react63.useMemo)(() => {
|
|
11904
11767
|
if (contentJson) {
|
|
11905
11768
|
const json = (contentJson == null ? void 0 : contentJson.type) === "doc" ? contentJson : {
|
|
11906
11769
|
type: "doc",
|
|
@@ -11921,8 +11784,8 @@ function Editor13(props) {
|
|
|
11921
11784
|
};
|
|
11922
11785
|
}
|
|
11923
11786
|
}, [contentHtml, contentJson, replaceDeprecatedNode]);
|
|
11924
|
-
const menuContainerRef = (0,
|
|
11925
|
-
const editor = (0,
|
|
11787
|
+
const menuContainerRef = (0, import_react63.useRef)(null);
|
|
11788
|
+
const editor = (0, import_react62.useEditor)({
|
|
11926
11789
|
editorProps: {
|
|
11927
11790
|
scrollThreshold,
|
|
11928
11791
|
scrollMargin,
|
|
@@ -11949,7 +11812,7 @@ function Editor13(props) {
|
|
|
11949
11812
|
if (!editor) {
|
|
11950
11813
|
return null;
|
|
11951
11814
|
}
|
|
11952
|
-
return /* @__PURE__ */ (0,
|
|
11815
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(MailyProvider, { placeholderUrl, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
11953
11816
|
"div",
|
|
11954
11817
|
{
|
|
11955
11818
|
id: "mly-editor",
|
|
@@ -11960,8 +11823,8 @@ function Editor13(props) {
|
|
|
11960
11823
|
),
|
|
11961
11824
|
ref: menuContainerRef,
|
|
11962
11825
|
children: [
|
|
11963
|
-
hasMenuBar && /* @__PURE__ */ (0,
|
|
11964
|
-
/* @__PURE__ */ (0,
|
|
11826
|
+
hasMenuBar && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(EditorMenuBar, { config: props.config, editor }),
|
|
11827
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
11965
11828
|
"div",
|
|
11966
11829
|
{
|
|
11967
11830
|
className: cn(
|
|
@@ -11969,17 +11832,16 @@ function Editor13(props) {
|
|
|
11969
11832
|
bodyClassName
|
|
11970
11833
|
),
|
|
11971
11834
|
children: [
|
|
11972
|
-
/* @__PURE__ */ (0,
|
|
11973
|
-
/* @__PURE__ */ (0,
|
|
11974
|
-
/* @__PURE__ */ (0,
|
|
11975
|
-
/* @__PURE__ */ (0,
|
|
11976
|
-
/* @__PURE__ */ (0,
|
|
11977
|
-
/* @__PURE__ */ (0,
|
|
11978
|
-
!hideContextMenu && /* @__PURE__ */ (0,
|
|
11979
|
-
/* @__PURE__ */ (0,
|
|
11980
|
-
/* @__PURE__ */ (0,
|
|
11981
|
-
/* @__PURE__ */ (0,
|
|
11982
|
-
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(InlineImageBubbleMenu, { editor, appendTo: menuContainerRef })
|
|
11835
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(TextBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
11836
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(ImageBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
11837
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SpacerBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
11838
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react62.EditorContent, { editor }),
|
|
11839
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SectionBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
11840
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(ColumnsBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
11841
|
+
!hideContextMenu && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(ContentMenu, { editor }),
|
|
11842
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(VariableBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
11843
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(RepeatBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
11844
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(InlineImageBubbleMenu, { editor, appendTo: menuContainerRef })
|
|
11983
11845
|
]
|
|
11984
11846
|
}
|
|
11985
11847
|
)
|