@daisychainapp/maily-to-core 0.4.3 → 0.4.5
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/blocks/index.cjs +12 -0
- package/dist/blocks/index.cjs.map +1 -1
- package/dist/blocks/index.mjs +12 -0
- package/dist/blocks/index.mjs.map +1 -1
- package/dist/extensions/index.cjs +2950 -2953
- package/dist/extensions/index.cjs.map +1 -1
- package/dist/extensions/index.d.cts +6 -3
- package/dist/extensions/index.d.ts +6 -3
- package/dist/extensions/index.mjs +3028 -3032
- package/dist/extensions/index.mjs.map +1 -1
- package/dist/index.cjs +1604 -1542
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +164 -2
- package/dist/index.css.map +1 -1
- package/dist/index.mjs +884 -822
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -53,7 +53,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
53
53
|
|
|
54
54
|
// src/editor/index.tsx
|
|
55
55
|
import { EditorContent, useEditor } from "@tiptap/react";
|
|
56
|
-
import { useMemo as
|
|
56
|
+
import { useMemo as useMemo13, useRef as useRef13 } from "react";
|
|
57
57
|
|
|
58
58
|
// src/editor/components/column-menu/columns-bubble-menu.tsx
|
|
59
59
|
import { BubbleMenu } from "@tiptap/react";
|
|
@@ -3445,7 +3445,10 @@ function Divider(props) {
|
|
|
3445
3445
|
import * as React from "react";
|
|
3446
3446
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
3447
3447
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
3448
|
-
var TooltipProvider =
|
|
3448
|
+
var TooltipProvider = (_a) => {
|
|
3449
|
+
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
3450
|
+
return /* @__PURE__ */ jsx2(TooltipPrimitive.Provider, __spreadProps(__spreadValues({ delayDuration: 80, skipDelayDuration: 120 }, props), { children }));
|
|
3451
|
+
};
|
|
3449
3452
|
var Tooltip = TooltipPrimitive.Root;
|
|
3450
3453
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
3451
3454
|
var TooltipContent = React.forwardRef((_a, ref) => {
|
|
@@ -3495,7 +3498,7 @@ var BaseButton = React2.forwardRef(
|
|
|
3495
3498
|
destructive: "mly:bg-red-500 mly:text-gray-50 mly:hover:bg-red-500/90",
|
|
3496
3499
|
outline: "mly:border mly:border-gray-200 mly:bg-white mly:hover:bg-gray-100 mly:hover:text-gray-900",
|
|
3497
3500
|
secondary: "mly:bg-gray-100 mly:text-gray-900 mly:hover:bg-gray-100/80",
|
|
3498
|
-
ghost: "mly:hover:bg-soft-gray bg-transparent mly:hover:text-gray-900 mly:data-[state=true]:bg-soft-gray mly:data-[state=true]:text-gray-900",
|
|
3501
|
+
ghost: "mly:hover:bg-soft-gray mly:bg-transparent mly:hover:text-gray-900 mly:data-[state=true]:bg-soft-gray mly:data-[state=true]:text-gray-900",
|
|
3499
3502
|
link: "mly:text-gray-900 mly:underline-offset-4 mly:hover:underline"
|
|
3500
3503
|
};
|
|
3501
3504
|
const sizeClasses = {
|
|
@@ -3519,16 +3522,19 @@ BaseButton.displayName = "BaseButton";
|
|
|
3519
3522
|
// src/editor/components/bubble-menu-button.tsx
|
|
3520
3523
|
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
3521
3524
|
function BubbleMenuButton(item) {
|
|
3522
|
-
var _a;
|
|
3525
|
+
var _a, _b;
|
|
3523
3526
|
const { tooltip } = item;
|
|
3527
|
+
const isActive = (_b = (_a = item == null ? void 0 : item.isActive) == null ? void 0 : _a.call(item)) != null ? _b : false;
|
|
3524
3528
|
const content = /* @__PURE__ */ jsx4(
|
|
3525
3529
|
BaseButton,
|
|
3526
3530
|
__spreadProps(__spreadValues({
|
|
3527
3531
|
variant: "ghost",
|
|
3528
3532
|
size: "sm"
|
|
3529
3533
|
}, item.command ? { onClick: item.command } : {}), {
|
|
3530
|
-
"data-state":
|
|
3534
|
+
"data-state": isActive,
|
|
3531
3535
|
className: cn(
|
|
3536
|
+
"menu-option",
|
|
3537
|
+
isActive && "menu-active-option",
|
|
3532
3538
|
"mly:size-7! mly:px-2.5 mly:disabled:cursor-not-allowed",
|
|
3533
3539
|
item == null ? void 0 : item.className
|
|
3534
3540
|
),
|
|
@@ -3955,11 +3961,11 @@ function ColumnsWidthConfig(props) {
|
|
|
3955
3961
|
onColumnWidthChange
|
|
3956
3962
|
} = props;
|
|
3957
3963
|
return /* @__PURE__ */ jsxs4(Popover, { children: [
|
|
3958
|
-
/* @__PURE__ */ jsx9(PopoverTrigger, { className: "mly:flex mly:size-7 mly:items-center mly:justify-center mly:gap-1 mly:rounded-md mly:text-sm mly:data-[state=open]:bg-soft-gray mly:hover:bg-soft-gray", children: /* @__PURE__ */ jsx9(SlidersVertical, { className: "mly:h-3 mly:w-3 mly:stroke-[2.5]" }) }),
|
|
3964
|
+
/* @__PURE__ */ jsx9(PopoverTrigger, { className: "menu-option mly:flex mly:size-7 mly:items-center mly:justify-center mly:gap-1 mly:rounded-md mly:text-sm mly:data-[state=open]:bg-soft-gray mly:hover:bg-soft-gray", children: /* @__PURE__ */ jsx9(SlidersVertical, { className: "mly:h-3 mly:w-3 mly:stroke-[2.5]" }) }),
|
|
3959
3965
|
/* @__PURE__ */ jsxs4(
|
|
3960
3966
|
PopoverContent,
|
|
3961
3967
|
{
|
|
3962
|
-
className: "mly:w-[300px] mly:rounded-lg mly:p-0.5!",
|
|
3968
|
+
className: "menu-dropdown-surface mly:w-[300px] mly:rounded-lg mly:p-0.5!",
|
|
3963
3969
|
side: "top",
|
|
3964
3970
|
sideOffset: 8,
|
|
3965
3971
|
align: "center",
|
|
@@ -4038,8 +4044,8 @@ function SwitchButton(props) {
|
|
|
4038
4044
|
"button",
|
|
4039
4045
|
{
|
|
4040
4046
|
className: cn(
|
|
4041
|
-
"mly:flex mly:h-7 mly:items-center mly:gap-1 mly:rounded-md mly:px-2 mly:text-sm mly:text-gray-500 mly:hover:bg-soft-gray mly:hover:text-midnight-gray",
|
|
4042
|
-
isActive && "mly:bg-soft-gray mly:text-midnight-gray"
|
|
4047
|
+
"menu-option mly:flex mly:h-7 mly:items-center mly:gap-1 mly:rounded-md mly:px-2 mly:text-sm mly:text-gray-500 mly:hover:bg-soft-gray mly:hover:text-midnight-gray",
|
|
4048
|
+
isActive && "menu-active-option mly:bg-soft-gray mly:text-midnight-gray"
|
|
4043
4049
|
),
|
|
4044
4050
|
onClick,
|
|
4045
4051
|
children
|
|
@@ -4064,7 +4070,7 @@ function Select(props) {
|
|
|
4064
4070
|
placeholder
|
|
4065
4071
|
} = props;
|
|
4066
4072
|
const selectId = `mly${useId()}`;
|
|
4067
|
-
const content = /* @__PURE__ */ jsxs5("div", { className: "mly:relative mly:inline-flex mly:h-7 mly:items-center mly:overflow-hidden", children: [
|
|
4073
|
+
const content = /* @__PURE__ */ jsxs5("div", { className: "menu-select-wrap mly:relative mly:inline-flex mly:h-7 mly:items-center mly:overflow-hidden", children: [
|
|
4068
4074
|
/* @__PURE__ */ jsx10("label", { htmlFor: selectId, className: "mly:sr-only", children: label }),
|
|
4069
4075
|
Icon && /* @__PURE__ */ jsx10("div", { className: "mly:pointer-events-none mly:absolute mly:left-2 mly:top-1/2 mly:z-20 mly:flex mly:h-7 mly:-translate-y-1/2 mly:items-center", children: /* @__PURE__ */ jsx10(Icon, { className: cn("mly:size-3.5", iconClassName) }) }),
|
|
4070
4076
|
/* @__PURE__ */ jsxs5(
|
|
@@ -4072,7 +4078,7 @@ function Select(props) {
|
|
|
4072
4078
|
{
|
|
4073
4079
|
id: selectId,
|
|
4074
4080
|
className: cn(
|
|
4075
|
-
"mly-select-padding mly:flex mly:h-7 mly:max-w-max mly:appearance-none mly:items-center mly:rounded-md mly:bg-white mly:text-sm mly:leading-none mly:text-midnight-gray mly:ring-offset-white mly:transition-colors mly:hover:bg-soft-gray mly:focus-visible:relative mly:focus-visible:z-10 mly:focus-visible:outline-hidden mly:focus-visible:ring-2 mly:focus-visible:ring-gray-400 mly:focus-visible:ring-offset-2 mly:active:bg-soft-gray",
|
|
4081
|
+
"menu-option menu-select-control mly-select-padding mly:flex mly:h-7 mly:max-w-max mly:appearance-none mly:items-center mly:rounded-md mly:bg-white mly:text-sm mly:leading-none mly:text-midnight-gray mly:ring-offset-white mly:transition-colors mly:hover:bg-soft-gray mly:focus-visible:relative mly:focus-visible:z-10 mly:focus-visible:outline-hidden mly:focus-visible:ring-2 mly:focus-visible:ring-gray-400 mly:focus-visible:ring-offset-2 mly:active:bg-soft-gray",
|
|
4076
4082
|
!!Icon && "mly:pl-[25px]",
|
|
4077
4083
|
className
|
|
4078
4084
|
),
|
|
@@ -4797,14 +4803,14 @@ function ContentMenu(props) {
|
|
|
4797
4803
|
},
|
|
4798
4804
|
onNodeChange: handleNodeChange,
|
|
4799
4805
|
className: cn(editor.isEditable ? "mly:visible" : "mly:hidden"),
|
|
4800
|
-
children: /* @__PURE__ */ jsx14(TooltipProvider, { children: /* @__PURE__ */ jsxs7("div", { className: "mly:flex mly:items-center mly:pr-1.5", children: [
|
|
4806
|
+
children: /* @__PURE__ */ jsx14(TooltipProvider, { children: /* @__PURE__ */ jsxs7("div", { className: "menu-content-actions-offset mly:flex mly:items-center mly:pr-1.5", children: [
|
|
4801
4807
|
/* @__PURE__ */ jsxs7(Tooltip, { children: [
|
|
4802
4808
|
/* @__PURE__ */ jsx14(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx14(
|
|
4803
4809
|
BaseButton,
|
|
4804
4810
|
{
|
|
4805
4811
|
variant: "ghost",
|
|
4806
4812
|
size: "icon",
|
|
4807
|
-
className: "mly:size-5! mly:cursor-grab mly:text-gray-500 mly:hover:text-black",
|
|
4813
|
+
className: "menu-icon-button mly:size-5! mly:cursor-grab mly:text-gray-500 mly:hover:text-black",
|
|
4808
4814
|
onClick: handleAddNewNode,
|
|
4809
4815
|
type: "button",
|
|
4810
4816
|
children: /* @__PURE__ */ jsx14(Plus, { className: "mly:size-3.5 mly:shrink-0" })
|
|
@@ -4827,7 +4833,7 @@ function ContentMenu(props) {
|
|
|
4827
4833
|
{
|
|
4828
4834
|
variant: "ghost",
|
|
4829
4835
|
size: "icon",
|
|
4830
|
-
className: "mly:relative mly:z-1 mly:size-5! mly:cursor-grab mly:text-gray-500 mly:hover:text-black",
|
|
4836
|
+
className: "menu-icon-button mly:relative mly:z-1 mly:size-5! mly:cursor-grab mly:text-gray-500 mly:hover:text-black",
|
|
4831
4837
|
onClick: (e) => {
|
|
4832
4838
|
e.preventDefault();
|
|
4833
4839
|
setMenuOpen(true);
|
|
@@ -4854,26 +4860,26 @@ function ContentMenu(props) {
|
|
|
4854
4860
|
align: "start",
|
|
4855
4861
|
side: "bottom",
|
|
4856
4862
|
sideOffset: 8,
|
|
4857
|
-
className: "mly:flex mly:w-max mly:flex-col mly:rounded-md mly:border mly:border-gray-200 mly:bg-white mly:p-1 mly:shadow-md",
|
|
4863
|
+
className: "menu-actions-surface mly:flex mly:w-max mly:flex-col mly:rounded-md mly:border mly:border-gray-200 mly:bg-white mly:p-1 mly:shadow-md",
|
|
4858
4864
|
children: [
|
|
4859
4865
|
/* @__PURE__ */ jsxs7(
|
|
4860
4866
|
BaseButton,
|
|
4861
4867
|
{
|
|
4862
4868
|
variant: "ghost",
|
|
4863
4869
|
onClick: duplicateNode,
|
|
4864
|
-
className: "mly:h-auto mly:justify-start mly:gap-2 mly:rounded! mly:!px-2 mly:!py-1.5 mly:text-sm mly:font-normal mly:hover:bg-soft-gray",
|
|
4870
|
+
className: "menu-action-item mly:h-auto mly:justify-start mly:gap-2 mly:rounded! mly:!px-2 mly:!py-1.5 mly:text-sm mly:font-normal mly:hover:bg-soft-gray",
|
|
4865
4871
|
children: [
|
|
4866
4872
|
/* @__PURE__ */ jsx14(Copy, { className: "mly:size-[15px] mly:shrink-0" }),
|
|
4867
4873
|
"Duplicate"
|
|
4868
4874
|
]
|
|
4869
4875
|
}
|
|
4870
4876
|
),
|
|
4871
|
-
/* @__PURE__ */ jsx14(Divider, { type: "horizontal" }),
|
|
4877
|
+
/* @__PURE__ */ jsx14(Divider, { type: "horizontal", className: "menu-actions-divider" }),
|
|
4872
4878
|
/* @__PURE__ */ jsxs7(
|
|
4873
4879
|
BaseButton,
|
|
4874
4880
|
{
|
|
4875
4881
|
onClick: deleteCurrentNode,
|
|
4876
|
-
className: "mly:h-auto mly:justify-start mly:gap-2 mly:rounded! mly:bg-red-100 mly:!px-2 mly:!py-1.5 mly:text-sm mly:font-normal mly:text-red-600 mly:hover:bg-red-200 mly:focus:bg-red-200",
|
|
4882
|
+
className: "menu-action-item menu-action-item-danger mly:h-auto mly:justify-start mly:gap-2 mly:rounded! mly:bg-red-100 mly:!px-2 mly:!py-1.5 mly:text-sm mly:font-normal mly:text-red-600 mly:hover:bg-red-200 mly:focus:bg-red-200",
|
|
4877
4883
|
children: [
|
|
4878
4884
|
/* @__PURE__ */ jsx14(Trash2, { className: "mly:size-[15px] mly:shrink-0" }),
|
|
4879
4885
|
"Delete"
|
|
@@ -4889,8 +4895,59 @@ function ContentMenu(props) {
|
|
|
4889
4895
|
);
|
|
4890
4896
|
}
|
|
4891
4897
|
|
|
4892
|
-
// src/editor/components/
|
|
4898
|
+
// src/editor/components/divider-menu/divider-bubble-menu.tsx
|
|
4899
|
+
import { BubbleMenu as BubbleMenu2 } from "@tiptap/react";
|
|
4893
4900
|
import { useMemo as useMemo3 } from "react";
|
|
4901
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
4902
|
+
function DividerBubbleMenu(props) {
|
|
4903
|
+
const { editor, appendTo } = props;
|
|
4904
|
+
if (!editor) {
|
|
4905
|
+
return null;
|
|
4906
|
+
}
|
|
4907
|
+
const items = useMemo3(
|
|
4908
|
+
() => spacing.map((space) => {
|
|
4909
|
+
const { value: size, short: name } = space;
|
|
4910
|
+
return {
|
|
4911
|
+
name,
|
|
4912
|
+
isActive: () => editor.isActive("horizontalRule", { size }),
|
|
4913
|
+
command: () => {
|
|
4914
|
+
editor.chain().focus().updateAttributes("horizontalRule", { size }).run();
|
|
4915
|
+
}
|
|
4916
|
+
};
|
|
4917
|
+
}),
|
|
4918
|
+
[editor]
|
|
4919
|
+
);
|
|
4920
|
+
const bubbleMenuProps = __spreadProps(__spreadValues(__spreadValues({}, props), appendTo ? { appendTo: appendTo.current } : {}), {
|
|
4921
|
+
shouldShow: ({ editor: editor2 }) => {
|
|
4922
|
+
if (!editor2.isEditable) {
|
|
4923
|
+
return false;
|
|
4924
|
+
}
|
|
4925
|
+
return editor2.isActive("horizontalRule");
|
|
4926
|
+
},
|
|
4927
|
+
tippyOptions: {
|
|
4928
|
+
maxWidth: "100%",
|
|
4929
|
+
moveTransition: "mly:transform 0.15s mly:ease-out"
|
|
4930
|
+
}
|
|
4931
|
+
});
|
|
4932
|
+
return /* @__PURE__ */ jsx15(
|
|
4933
|
+
BubbleMenu2,
|
|
4934
|
+
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
4935
|
+
className: "menu-surface 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",
|
|
4936
|
+
children: /* @__PURE__ */ jsx15(TooltipProvider, { children: items.map((item, index) => /* @__PURE__ */ jsx15(
|
|
4937
|
+
BubbleMenuButton,
|
|
4938
|
+
__spreadValues({
|
|
4939
|
+
className: "!mly:h-7 mly:w-7 mly:shrink-0 mly:p-0",
|
|
4940
|
+
iconClassName: "mly:w-3 mly:h-3",
|
|
4941
|
+
nameClassName: "mly:text-xs"
|
|
4942
|
+
}, item),
|
|
4943
|
+
index
|
|
4944
|
+
)) })
|
|
4945
|
+
})
|
|
4946
|
+
);
|
|
4947
|
+
}
|
|
4948
|
+
|
|
4949
|
+
// src/editor/components/editor-menu-bar.tsx
|
|
4950
|
+
import { useMemo as useMemo4 } from "react";
|
|
4894
4951
|
import {
|
|
4895
4952
|
AlignCenter,
|
|
4896
4953
|
AlignLeft,
|
|
@@ -4903,10 +4960,10 @@ import {
|
|
|
4903
4960
|
StrikethroughIcon,
|
|
4904
4961
|
UnderlineIcon
|
|
4905
4962
|
} from "lucide-react";
|
|
4906
|
-
import { jsx as
|
|
4963
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
4907
4964
|
var EditorMenuBar = (props) => {
|
|
4908
4965
|
const { editor, config } = props;
|
|
4909
|
-
const items =
|
|
4966
|
+
const items = useMemo4(
|
|
4910
4967
|
() => [
|
|
4911
4968
|
{
|
|
4912
4969
|
name: "bold",
|
|
@@ -4945,7 +5002,21 @@ var EditorMenuBar = (props) => {
|
|
|
4945
5002
|
},
|
|
4946
5003
|
{
|
|
4947
5004
|
name: "divider",
|
|
4948
|
-
command: () =>
|
|
5005
|
+
command: () => {
|
|
5006
|
+
editor.chain().focus().setHorizontalRule().run();
|
|
5007
|
+
const { from } = editor.state.selection;
|
|
5008
|
+
const nearbyPositions = [from, from - 1, from - 2, from + 1];
|
|
5009
|
+
const dividerPos = nearbyPositions.find((pos) => {
|
|
5010
|
+
var _a;
|
|
5011
|
+
if (pos < 0) {
|
|
5012
|
+
return false;
|
|
5013
|
+
}
|
|
5014
|
+
return ((_a = editor.state.doc.nodeAt(pos)) == null ? void 0 : _a.type.name) === "horizontalRule";
|
|
5015
|
+
});
|
|
5016
|
+
if (dividerPos != null) {
|
|
5017
|
+
editor.chain().focus().setNodeSelection(dividerPos).run();
|
|
5018
|
+
}
|
|
5019
|
+
},
|
|
4949
5020
|
isActive: () => editor.isActive("horizontalRule"),
|
|
4950
5021
|
group: "custom",
|
|
4951
5022
|
icon: SeparatorHorizontal
|
|
@@ -4990,7 +5061,7 @@ var EditorMenuBar = (props) => {
|
|
|
4990
5061
|
],
|
|
4991
5062
|
[editor]
|
|
4992
5063
|
);
|
|
4993
|
-
const groups =
|
|
5064
|
+
const groups = useMemo4(
|
|
4994
5065
|
() => items.reduce((acc, item) => {
|
|
4995
5066
|
if (!acc.includes(item.group)) {
|
|
4996
5067
|
acc.push(item.group);
|
|
@@ -5002,15 +5073,15 @@ var EditorMenuBar = (props) => {
|
|
|
5002
5073
|
if (!editor) {
|
|
5003
5074
|
return null;
|
|
5004
5075
|
}
|
|
5005
|
-
return /* @__PURE__ */
|
|
5076
|
+
return /* @__PURE__ */ jsx16(
|
|
5006
5077
|
"div",
|
|
5007
5078
|
{
|
|
5008
5079
|
className: `mly:flex mly:items-center mly:gap-3 ${config == null ? void 0 : config.toolbarClassName}`,
|
|
5009
|
-
children: groups.map((group, index) => /* @__PURE__ */
|
|
5080
|
+
children: groups.map((group, index) => /* @__PURE__ */ jsx16(
|
|
5010
5081
|
"div",
|
|
5011
5082
|
{
|
|
5012
5083
|
className: "mly:flex mly:items-center mly:gap-1 mly:rounded-md mly:border mly:border-gray-200 mly:bg-white mly:p-1",
|
|
5013
|
-
children: items.filter((item) => item.group === group).map((item, index2) => /* @__PURE__ */
|
|
5084
|
+
children: items.filter((item) => item.group === group).map((item, index2) => /* @__PURE__ */ jsx16(BubbleMenuButton, __spreadValues({}, item), index2))
|
|
5014
5085
|
},
|
|
5015
5086
|
index
|
|
5016
5087
|
))
|
|
@@ -5427,7 +5498,7 @@ function ImageUploadPlugin(options) {
|
|
|
5427
5498
|
|
|
5428
5499
|
// src/editor/extensions/image-upload/image-upload.ts
|
|
5429
5500
|
import { Extension } from "@tiptap/core";
|
|
5430
|
-
import { useMemo as
|
|
5501
|
+
import { useMemo as useMemo5 } from "react";
|
|
5431
5502
|
var ImageUploadExtension = Extension.create({
|
|
5432
5503
|
name: "imageUpload",
|
|
5433
5504
|
addOptions() {
|
|
@@ -5462,7 +5533,7 @@ var ImageUploadExtension = Extension.create({
|
|
|
5462
5533
|
}
|
|
5463
5534
|
});
|
|
5464
5535
|
function useImageUploadOptions(editor) {
|
|
5465
|
-
return
|
|
5536
|
+
return useMemo5(() => {
|
|
5466
5537
|
const node = editor.extensionManager.extensions.find(
|
|
5467
5538
|
(extension) => extension.name === "imageUpload"
|
|
5468
5539
|
);
|
|
@@ -5495,12 +5566,9 @@ function getNewHeight(width, aspectRatio) {
|
|
|
5495
5566
|
}
|
|
5496
5567
|
return width / aspectRatio;
|
|
5497
5568
|
}
|
|
5498
|
-
function getNewWidth(height, aspectRatio) {
|
|
5499
|
-
return height * aspectRatio;
|
|
5500
|
-
}
|
|
5501
5569
|
|
|
5502
5570
|
// src/editor/nodes/image/image-view.tsx
|
|
5503
|
-
import { Fragment as Fragment3, jsx as
|
|
5571
|
+
import { Fragment as Fragment3, jsx as jsx17, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
5504
5572
|
var MIN_WIDTH = 20;
|
|
5505
5573
|
var IMAGE_MAX_WIDTH = 600;
|
|
5506
5574
|
var IMAGE_MAX_HEIGHT = 400;
|
|
@@ -5574,7 +5642,7 @@ function ImageView(props) {
|
|
|
5574
5642
|
if (isPlaceholderImage) {
|
|
5575
5643
|
return null;
|
|
5576
5644
|
}
|
|
5577
|
-
return /* @__PURE__ */
|
|
5645
|
+
return /* @__PURE__ */ jsx17(
|
|
5578
5646
|
"div",
|
|
5579
5647
|
{
|
|
5580
5648
|
role: "button",
|
|
@@ -5759,7 +5827,7 @@ function ImageView(props) {
|
|
|
5759
5827
|
onDrop: handleDrop
|
|
5760
5828
|
} : {}), {
|
|
5761
5829
|
children: [
|
|
5762
|
-
!hasImageSrc && status === "idle" && /* @__PURE__ */
|
|
5830
|
+
!hasImageSrc && status === "idle" && /* @__PURE__ */ jsx17(
|
|
5763
5831
|
ImageStatusLabel,
|
|
5764
5832
|
{
|
|
5765
5833
|
status: "idle",
|
|
@@ -5767,11 +5835,11 @@ function ImageView(props) {
|
|
|
5767
5835
|
isDropZone: isDroppable
|
|
5768
5836
|
}
|
|
5769
5837
|
),
|
|
5770
|
-
!hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */
|
|
5771
|
-
hasImageSrc && isSrcVariable && /* @__PURE__ */
|
|
5772
|
-
hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */
|
|
5773
|
-
hasImageSrc && status === "error" && !isSrcVariable && /* @__PURE__ */
|
|
5774
|
-
isDroppable && /* @__PURE__ */
|
|
5838
|
+
!hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */ jsx17(ImageStatusLabel, { status: "loading", minHeight: height }),
|
|
5839
|
+
hasImageSrc && isSrcVariable && /* @__PURE__ */ jsx17(ImageStatusLabel, { status: "variable", minHeight: height }),
|
|
5840
|
+
hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */ jsx17(ImageStatusLabel, { status: "loading", minHeight: height }),
|
|
5841
|
+
hasImageSrc && status === "error" && !isSrcVariable && /* @__PURE__ */ jsx17(ImageStatusLabel, { status: "error", minHeight: height }),
|
|
5842
|
+
isDroppable && /* @__PURE__ */ jsx17(
|
|
5775
5843
|
"input",
|
|
5776
5844
|
{
|
|
5777
5845
|
type: "file",
|
|
@@ -5782,7 +5850,7 @@ function ImageView(props) {
|
|
|
5782
5850
|
}
|
|
5783
5851
|
),
|
|
5784
5852
|
hasImageSrc && status === "loaded" && !isSrcVariable && /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
5785
|
-
/* @__PURE__ */
|
|
5853
|
+
/* @__PURE__ */ jsx17(
|
|
5786
5854
|
"img",
|
|
5787
5855
|
__spreadProps(__spreadValues({}, attrs), {
|
|
5788
5856
|
ref: imgRef,
|
|
@@ -5808,7 +5876,7 @@ function ImageView(props) {
|
|
|
5808
5876
|
{ right: 0, top: 0, height: "100%", width: "1px" },
|
|
5809
5877
|
{ top: 0, left: 0, width: "100%", height: "1px" },
|
|
5810
5878
|
{ bottom: 0, left: 0, width: "100%", height: "1px" }
|
|
5811
|
-
].map((style, i) => /* @__PURE__ */
|
|
5879
|
+
].map((style, i) => /* @__PURE__ */ jsx17(
|
|
5812
5880
|
"div",
|
|
5813
5881
|
{
|
|
5814
5882
|
className: "mly:bg-rose-500",
|
|
@@ -5851,24 +5919,24 @@ function ImageStatusLabel(props) {
|
|
|
5851
5919
|
} : {}), style),
|
|
5852
5920
|
children: [
|
|
5853
5921
|
status === "idle" && !isDropZone && /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
5854
|
-
/* @__PURE__ */
|
|
5855
|
-
/* @__PURE__ */
|
|
5922
|
+
/* @__PURE__ */ jsx17(ImageOffIcon, { className: "mly:size-4 mly:stroke-[2.5]" }),
|
|
5923
|
+
/* @__PURE__ */ jsx17("span", { children: "No image selected" })
|
|
5856
5924
|
] }),
|
|
5857
5925
|
status === "idle" && isDropZone && /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
5858
|
-
/* @__PURE__ */
|
|
5859
|
-
/* @__PURE__ */
|
|
5926
|
+
/* @__PURE__ */ jsx17(GrabIcon, { className: "mly:size-4 mly:stroke-[2.5]" }),
|
|
5927
|
+
/* @__PURE__ */ jsx17("span", { children: "Click or Drop image here" })
|
|
5860
5928
|
] }),
|
|
5861
5929
|
status === "loading" && /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
5862
|
-
/* @__PURE__ */
|
|
5863
|
-
/* @__PURE__ */
|
|
5930
|
+
/* @__PURE__ */ jsx17(Loader2, { className: "mly:size-4 mly:animate-spin mly:stroke-[2.5]" }),
|
|
5931
|
+
/* @__PURE__ */ jsx17("span", { children: "Loading image..." })
|
|
5864
5932
|
] }),
|
|
5865
5933
|
status === "error" && /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
5866
|
-
/* @__PURE__ */
|
|
5867
|
-
/* @__PURE__ */
|
|
5934
|
+
/* @__PURE__ */ jsx17(Ban, { className: "mly:size-4 mly:stroke-[2.5]" }),
|
|
5935
|
+
/* @__PURE__ */ jsx17("span", { children: "Error loading image" })
|
|
5868
5936
|
] }),
|
|
5869
5937
|
status === "variable" && /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
5870
|
-
/* @__PURE__ */
|
|
5871
|
-
/* @__PURE__ */
|
|
5938
|
+
/* @__PURE__ */ jsx17(BracesIcon, { className: "mly:size-4 mly:stroke-[2.5]" }),
|
|
5939
|
+
/* @__PURE__ */ jsx17("span", { children: "Variable Image URL" })
|
|
5872
5940
|
] })
|
|
5873
5941
|
]
|
|
5874
5942
|
})
|
|
@@ -5876,7 +5944,7 @@ function ImageStatusLabel(props) {
|
|
|
5876
5944
|
}
|
|
5877
5945
|
|
|
5878
5946
|
// src/editor/nodes/logo/logo-view.tsx
|
|
5879
|
-
import { jsx as
|
|
5947
|
+
import { jsx as jsx18, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
5880
5948
|
function LogoView(props) {
|
|
5881
5949
|
const { node, editor, updateAttributes: updateAttributes2 } = props;
|
|
5882
5950
|
const [status, setStatus] = useState5("idle");
|
|
@@ -6002,7 +6070,7 @@ function LogoView(props) {
|
|
|
6002
6070
|
onDrop: handleDrop
|
|
6003
6071
|
} : {}), {
|
|
6004
6072
|
children: [
|
|
6005
|
-
!hasImageSrc && status === "idle" && /* @__PURE__ */
|
|
6073
|
+
!hasImageSrc && status === "idle" && /* @__PURE__ */ jsx18(
|
|
6006
6074
|
ImageStatusLabel,
|
|
6007
6075
|
{
|
|
6008
6076
|
status: "idle",
|
|
@@ -6010,11 +6078,11 @@ function LogoView(props) {
|
|
|
6010
6078
|
isDropZone: isDroppable
|
|
6011
6079
|
}
|
|
6012
6080
|
),
|
|
6013
|
-
!hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */
|
|
6014
|
-
hasImageSrc && isSrcVariable && /* @__PURE__ */
|
|
6015
|
-
hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */
|
|
6016
|
-
hasImageSrc && status === "error" && !isSrcVariable && /* @__PURE__ */
|
|
6017
|
-
isDroppable && /* @__PURE__ */
|
|
6081
|
+
!hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */ jsx18(ImageStatusLabel, { status: "loading", minHeight: logoSize }),
|
|
6082
|
+
hasImageSrc && isSrcVariable && /* @__PURE__ */ jsx18(ImageStatusLabel, { status: "variable", minHeight: logoSize }),
|
|
6083
|
+
hasImageSrc && status === "loading" && !isSrcVariable && /* @__PURE__ */ jsx18(ImageStatusLabel, { status: "loading", minHeight: logoSize }),
|
|
6084
|
+
hasImageSrc && status === "error" && !isSrcVariable && /* @__PURE__ */ jsx18(ImageStatusLabel, { status: "error", minHeight: logoSize }),
|
|
6085
|
+
isDroppable && /* @__PURE__ */ jsx18(
|
|
6018
6086
|
"input",
|
|
6019
6087
|
{
|
|
6020
6088
|
type: "file",
|
|
@@ -6024,7 +6092,7 @@ function LogoView(props) {
|
|
|
6024
6092
|
multiple: false
|
|
6025
6093
|
}
|
|
6026
6094
|
),
|
|
6027
|
-
hasImageSrc && status === "loaded" && !isSrcVariable && /* @__PURE__ */
|
|
6095
|
+
hasImageSrc && status === "loaded" && !isSrcVariable && /* @__PURE__ */ jsx18(
|
|
6028
6096
|
"img",
|
|
6029
6097
|
{
|
|
6030
6098
|
src: logoSrc,
|
|
@@ -6175,13 +6243,13 @@ var borderRadius = [
|
|
|
6175
6243
|
];
|
|
6176
6244
|
|
|
6177
6245
|
// src/editor/components/image-menu/image-bubble-menu.tsx
|
|
6178
|
-
import { BubbleMenu as
|
|
6179
|
-
import {
|
|
6246
|
+
import { BubbleMenu as BubbleMenu3 } from "@tiptap/react";
|
|
6247
|
+
import { LockIcon, LockOpenIcon } from "lucide-react";
|
|
6180
6248
|
import { sticky as sticky2 } from "tippy.js";
|
|
6181
6249
|
|
|
6182
6250
|
// src/editor/components/alignment-switch.tsx
|
|
6183
6251
|
import { AlignCenter as AlignCenter2, AlignLeft as AlignLeft2, AlignRight as AlignRight2 } from "lucide-react";
|
|
6184
|
-
import { jsx as
|
|
6252
|
+
import { jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
6185
6253
|
function AlignmentSwitch(props) {
|
|
6186
6254
|
const { alignment: rawAlignment, onAlignmentChange } = props;
|
|
6187
6255
|
const alignment = allowedLogoAlignment.includes(
|
|
@@ -6213,16 +6281,16 @@ function AlignmentSwitch(props) {
|
|
|
6213
6281
|
const activeAlignment = alignments[alignment];
|
|
6214
6282
|
return /* @__PURE__ */ jsxs10(Popover, { children: [
|
|
6215
6283
|
/* @__PURE__ */ jsxs10(Tooltip, { children: [
|
|
6216
|
-
/* @__PURE__ */
|
|
6284
|
+
/* @__PURE__ */ jsx19(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx19(
|
|
6217
6285
|
PopoverTrigger,
|
|
6218
6286
|
{
|
|
6219
6287
|
className: cn(
|
|
6220
|
-
"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"
|
|
6288
|
+
"menu-option 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"
|
|
6221
6289
|
),
|
|
6222
|
-
children: /* @__PURE__ */
|
|
6290
|
+
children: /* @__PURE__ */ jsx19(activeAlignment.icon, { className: "mly:h-3 mly:w-3 mly:stroke-[2.5]" })
|
|
6223
6291
|
}
|
|
6224
6292
|
) }),
|
|
6225
|
-
/* @__PURE__ */
|
|
6293
|
+
/* @__PURE__ */ jsx19(
|
|
6226
6294
|
TooltipContent,
|
|
6227
6295
|
{
|
|
6228
6296
|
sideOffset: 8,
|
|
@@ -6231,7 +6299,7 @@ function AlignmentSwitch(props) {
|
|
|
6231
6299
|
}
|
|
6232
6300
|
)
|
|
6233
6301
|
] }),
|
|
6234
|
-
/* @__PURE__ */
|
|
6302
|
+
/* @__PURE__ */ jsx19(
|
|
6235
6303
|
PopoverContent,
|
|
6236
6304
|
{
|
|
6237
6305
|
className: "mly:flex mly:w-max mly:gap-0.5 mly:rounded-lg mly:p-0.5!",
|
|
@@ -6245,7 +6313,7 @@ function AlignmentSwitch(props) {
|
|
|
6245
6313
|
e.preventDefault();
|
|
6246
6314
|
},
|
|
6247
6315
|
children: Object.entries(alignments).map(([key, value]) => {
|
|
6248
|
-
return /* @__PURE__ */
|
|
6316
|
+
return /* @__PURE__ */ jsx19(
|
|
6249
6317
|
BubbleMenuButton,
|
|
6250
6318
|
{
|
|
6251
6319
|
icon: value.icon,
|
|
@@ -6261,6 +6329,300 @@ function AlignmentSwitch(props) {
|
|
|
6261
6329
|
] });
|
|
6262
6330
|
}
|
|
6263
6331
|
|
|
6332
|
+
// src/editor/components/image-menu/use-image-state.tsx
|
|
6333
|
+
import { useEditorState as useEditorState2 } from "@tiptap/react";
|
|
6334
|
+
import deepEql2 from "fast-deep-equal";
|
|
6335
|
+
var useImageState = (editor) => {
|
|
6336
|
+
const states = useEditorState2({
|
|
6337
|
+
editor,
|
|
6338
|
+
selector: ({ editor: editor2 }) => {
|
|
6339
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
6340
|
+
return {
|
|
6341
|
+
width: String(editor2.getAttributes("image").width),
|
|
6342
|
+
height: String(editor2.getAttributes("image").height),
|
|
6343
|
+
isImageActive: editor2.isActive("image"),
|
|
6344
|
+
isLogoActive: editor2.isActive("logo"),
|
|
6345
|
+
alignment: ((_a = editor2.getAttributes("image")) == null ? void 0 : _a.alignment) || ((_b = editor2.getAttributes("logo")) == null ? void 0 : _b.alignment),
|
|
6346
|
+
borderRadius: (_c = editor2.getAttributes("image")) == null ? void 0 : _c.borderRadius,
|
|
6347
|
+
logoSize: ((_d = editor2.getAttributes("logo")) == null ? void 0 : _d.size) || DEFAULT_LOGO_SIZE,
|
|
6348
|
+
imageSrc: ((_e = editor2.getAttributes("image")) == null ? void 0 : _e.src) || ((_f = editor2.getAttributes("logo")) == null ? void 0 : _f.src) || "",
|
|
6349
|
+
isSrcVariable: (_j = (_i = (_g = editor2.getAttributes("image")) == null ? void 0 : _g.isSrcVariable) != null ? _i : (_h = editor2.getAttributes("logo")) == null ? void 0 : _h.isSrcVariable) != null ? _j : false,
|
|
6350
|
+
imageExternalLink: ((_k = editor2.getAttributes("image")) == null ? void 0 : _k.externalLink) || "",
|
|
6351
|
+
isExternalLinkVariable: (_l = editor2.getAttributes("image")) == null ? void 0 : _l.isExternalLinkVariable,
|
|
6352
|
+
lockAspectRatio: (_m = editor2.getAttributes("image")) == null ? void 0 : _m.lockAspectRatio,
|
|
6353
|
+
aspectRatio: (_n = editor2.getAttributes("image")) == null ? void 0 : _n.aspectRatio,
|
|
6354
|
+
currentShowIfKey: ((_o = editor2.getAttributes("image")) == null ? void 0 : _o.showIfKey) || ((_p = editor2.getAttributes("logo")) == null ? void 0 : _p.showIfKey) || ""
|
|
6355
|
+
};
|
|
6356
|
+
},
|
|
6357
|
+
equalityFn: deepEql2
|
|
6358
|
+
});
|
|
6359
|
+
return states;
|
|
6360
|
+
};
|
|
6361
|
+
|
|
6362
|
+
// src/editor/components/image-menu/image-bubble-menu.tsx
|
|
6363
|
+
import { Fragment as Fragment4, jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
6364
|
+
function ImageBubbleMenu(props) {
|
|
6365
|
+
const { editor, appendTo } = props;
|
|
6366
|
+
if (!editor) {
|
|
6367
|
+
return null;
|
|
6368
|
+
}
|
|
6369
|
+
const state = useImageState(editor);
|
|
6370
|
+
const bubbleMenuProps = __spreadProps(__spreadValues(__spreadValues({}, props), appendTo ? { appendTo: appendTo.current } : {}), {
|
|
6371
|
+
shouldShow: ({ editor: editor2 }) => {
|
|
6372
|
+
if (!editor2.isEditable) {
|
|
6373
|
+
return false;
|
|
6374
|
+
}
|
|
6375
|
+
return editor2.isActive("logo") || editor2.isActive("image");
|
|
6376
|
+
},
|
|
6377
|
+
tippyOptions: {
|
|
6378
|
+
popperOptions: {
|
|
6379
|
+
modifiers: [{ name: "flip", enabled: false }]
|
|
6380
|
+
},
|
|
6381
|
+
plugins: [sticky2],
|
|
6382
|
+
sticky: "popper",
|
|
6383
|
+
maxWidth: "100%"
|
|
6384
|
+
}
|
|
6385
|
+
});
|
|
6386
|
+
const { lockAspectRatio } = state;
|
|
6387
|
+
return /* @__PURE__ */ jsx20(
|
|
6388
|
+
BubbleMenu3,
|
|
6389
|
+
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
6390
|
+
className: "menu-surface image-menu-surface mly:flex mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:p-0.5 mly:shadow-md",
|
|
6391
|
+
children: /* @__PURE__ */ jsxs11(TooltipProvider, { children: [
|
|
6392
|
+
state.isLogoActive && state.imageSrc && /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
6393
|
+
/* @__PURE__ */ jsx20(
|
|
6394
|
+
Select,
|
|
6395
|
+
{
|
|
6396
|
+
label: "Size",
|
|
6397
|
+
tooltip: "Size",
|
|
6398
|
+
value: state.logoSize,
|
|
6399
|
+
options: allowedLogoSize.map((size) => ({
|
|
6400
|
+
value: size,
|
|
6401
|
+
label: size
|
|
6402
|
+
})),
|
|
6403
|
+
onValueChange: (value) => {
|
|
6404
|
+
editor == null ? void 0 : editor.chain().focus().setLogoAttributes({ size: value }).run();
|
|
6405
|
+
}
|
|
6406
|
+
}
|
|
6407
|
+
),
|
|
6408
|
+
/* @__PURE__ */ jsx20(Divider, {})
|
|
6409
|
+
] }),
|
|
6410
|
+
/* @__PURE__ */ jsx20("div", { className: "menu-inline-gap mly:flex mly:gap-x-0.5", children: /* @__PURE__ */ jsx20(
|
|
6411
|
+
AlignmentSwitch,
|
|
6412
|
+
{
|
|
6413
|
+
alignment: state.alignment,
|
|
6414
|
+
onAlignmentChange: (alignment) => {
|
|
6415
|
+
const isCurrentNodeImage = state.isImageActive;
|
|
6416
|
+
if (!isCurrentNodeImage) {
|
|
6417
|
+
editor == null ? void 0 : editor.chain().focus().setLogoAttributes({ alignment }).run();
|
|
6418
|
+
} else {
|
|
6419
|
+
editor == null ? void 0 : editor.chain().focus().updateAttributes("image", { alignment }).run();
|
|
6420
|
+
}
|
|
6421
|
+
}
|
|
6422
|
+
}
|
|
6423
|
+
) }),
|
|
6424
|
+
state.isImageActive && state.imageSrc && /* @__PURE__ */ jsxs11(Fragment4, { children: [
|
|
6425
|
+
/* @__PURE__ */ jsx20(Divider, {}),
|
|
6426
|
+
/* @__PURE__ */ jsx20(
|
|
6427
|
+
Select,
|
|
6428
|
+
{
|
|
6429
|
+
label: "Border Radius",
|
|
6430
|
+
value: state == null ? void 0 : state.borderRadius,
|
|
6431
|
+
options: borderRadius.map((value) => ({
|
|
6432
|
+
value: String(value.value),
|
|
6433
|
+
label: value.name
|
|
6434
|
+
})),
|
|
6435
|
+
onValueChange: (value) => {
|
|
6436
|
+
editor == null ? void 0 : editor.chain().updateAttributes("image", {
|
|
6437
|
+
borderRadius: Number(value)
|
|
6438
|
+
}).run();
|
|
6439
|
+
},
|
|
6440
|
+
tooltip: "Border Radius",
|
|
6441
|
+
className: "mly:capitalize"
|
|
6442
|
+
}
|
|
6443
|
+
),
|
|
6444
|
+
/* @__PURE__ */ jsx20("div", { className: "menu-inline-gap mly:flex mly:gap-x-0.5", children: /* @__PURE__ */ jsx20(
|
|
6445
|
+
BubbleMenuButton,
|
|
6446
|
+
{
|
|
6447
|
+
isActive: () => lockAspectRatio,
|
|
6448
|
+
command: () => {
|
|
6449
|
+
const width = Number(state.width) || 0;
|
|
6450
|
+
const height = Number(state.height) || 0;
|
|
6451
|
+
const aspectRatio = width / height;
|
|
6452
|
+
editor == null ? void 0 : editor.chain().updateAttributes("image", {
|
|
6453
|
+
lockAspectRatio: !lockAspectRatio,
|
|
6454
|
+
aspectRatio
|
|
6455
|
+
}).run();
|
|
6456
|
+
},
|
|
6457
|
+
icon: lockAspectRatio ? LockIcon : LockOpenIcon,
|
|
6458
|
+
tooltip: "Lock Aspect Ratio"
|
|
6459
|
+
}
|
|
6460
|
+
) })
|
|
6461
|
+
] })
|
|
6462
|
+
] })
|
|
6463
|
+
})
|
|
6464
|
+
);
|
|
6465
|
+
}
|
|
6466
|
+
|
|
6467
|
+
// src/editor/components/inline-image-menu/inline-image-bubble-menu.tsx
|
|
6468
|
+
import { BubbleMenu as BubbleMenu4 } from "@tiptap/react";
|
|
6469
|
+
import { sticky as sticky3 } from "tippy.js";
|
|
6470
|
+
|
|
6471
|
+
// src/editor/components/image-menu/image-size.tsx
|
|
6472
|
+
import { jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
6473
|
+
function ImageSize(props) {
|
|
6474
|
+
const { value, onValueChange, dimension } = props;
|
|
6475
|
+
return /* @__PURE__ */ jsxs12("label", { className: "menu-option image-size-control mly:relative mly:flex mly:items-center", children: [
|
|
6476
|
+
/* @__PURE__ */ jsx21("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" }),
|
|
6477
|
+
/* @__PURE__ */ jsx21(
|
|
6478
|
+
"input",
|
|
6479
|
+
__spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
|
|
6480
|
+
className: "hide-number-controls image-size-input 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",
|
|
6481
|
+
type: "number",
|
|
6482
|
+
value,
|
|
6483
|
+
onChange: (e) => onValueChange(e.target.value)
|
|
6484
|
+
})
|
|
6485
|
+
),
|
|
6486
|
+
/* @__PURE__ */ jsx21("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" })
|
|
6487
|
+
] });
|
|
6488
|
+
}
|
|
6489
|
+
|
|
6490
|
+
// src/editor/nodes/inline-image/inline-image.tsx
|
|
6491
|
+
import { mergeAttributes as mergeAttributes3, Node as Node4 } from "@tiptap/core";
|
|
6492
|
+
import { PluginKey as PluginKey3, Plugin as Plugin3 } from "@tiptap/pm/state";
|
|
6493
|
+
var DEFAULT_INLINE_IMAGE_HEIGHT = 20;
|
|
6494
|
+
var DEFAULT_INLINE_IMAGE_WIDTH = 20;
|
|
6495
|
+
var InlineImageExtension = Node4.create({
|
|
6496
|
+
name: "inlineImage",
|
|
6497
|
+
inline: true,
|
|
6498
|
+
group: "inline",
|
|
6499
|
+
selectable: false,
|
|
6500
|
+
addOptions() {
|
|
6501
|
+
return {
|
|
6502
|
+
HTMLAttributes: {}
|
|
6503
|
+
};
|
|
6504
|
+
},
|
|
6505
|
+
addAttributes() {
|
|
6506
|
+
return {
|
|
6507
|
+
height: {
|
|
6508
|
+
default: DEFAULT_INLINE_IMAGE_HEIGHT
|
|
6509
|
+
},
|
|
6510
|
+
width: {
|
|
6511
|
+
default: DEFAULT_INLINE_IMAGE_WIDTH
|
|
6512
|
+
},
|
|
6513
|
+
src: {
|
|
6514
|
+
default: null
|
|
6515
|
+
},
|
|
6516
|
+
isSrcVariable: {
|
|
6517
|
+
default: false,
|
|
6518
|
+
renderHTML(attributes) {
|
|
6519
|
+
if (!attributes.isSrcVariable) {
|
|
6520
|
+
return {};
|
|
6521
|
+
}
|
|
6522
|
+
return {
|
|
6523
|
+
"data-is-src-variable": "true"
|
|
6524
|
+
};
|
|
6525
|
+
}
|
|
6526
|
+
},
|
|
6527
|
+
alt: {
|
|
6528
|
+
default: null
|
|
6529
|
+
},
|
|
6530
|
+
title: {
|
|
6531
|
+
default: null
|
|
6532
|
+
},
|
|
6533
|
+
externalLink: {
|
|
6534
|
+
default: null,
|
|
6535
|
+
renderHTML(attributes) {
|
|
6536
|
+
if (!attributes.externalLink) {
|
|
6537
|
+
return {};
|
|
6538
|
+
}
|
|
6539
|
+
return {
|
|
6540
|
+
"data-external-link": attributes.externalLink
|
|
6541
|
+
};
|
|
6542
|
+
}
|
|
6543
|
+
},
|
|
6544
|
+
isExternalLinkVariable: {
|
|
6545
|
+
default: false,
|
|
6546
|
+
renderHTML(attributes) {
|
|
6547
|
+
if (!attributes.isExternalLinkVariable) {
|
|
6548
|
+
return {};
|
|
6549
|
+
}
|
|
6550
|
+
return {
|
|
6551
|
+
"data-is-external-link-variable": "true"
|
|
6552
|
+
};
|
|
6553
|
+
}
|
|
6554
|
+
}
|
|
6555
|
+
};
|
|
6556
|
+
},
|
|
6557
|
+
parseHTML() {
|
|
6558
|
+
return [
|
|
6559
|
+
{
|
|
6560
|
+
tag: `img[data-type="${this.name}"]`
|
|
6561
|
+
}
|
|
6562
|
+
];
|
|
6563
|
+
},
|
|
6564
|
+
renderHTML({ HTMLAttributes: HTMLAttributes2 }) {
|
|
6565
|
+
const attrs = mergeAttributes3(this.options.HTMLAttributes, HTMLAttributes2, {
|
|
6566
|
+
"data-type": this.name,
|
|
6567
|
+
class: "mly:relative",
|
|
6568
|
+
style: `display: inline; --mly-inline-image-height: ${HTMLAttributes2.height}px; --mly-inline-image-width: ${HTMLAttributes2.width}px; margin:0; vertical-align: middle;`,
|
|
6569
|
+
draggable: "false",
|
|
6570
|
+
loading: "lazy"
|
|
6571
|
+
});
|
|
6572
|
+
return ["img", attrs];
|
|
6573
|
+
},
|
|
6574
|
+
addCommands() {
|
|
6575
|
+
return {
|
|
6576
|
+
setInlineImage: (options) => ({ commands }) => {
|
|
6577
|
+
return commands.insertContent({
|
|
6578
|
+
type: this.name,
|
|
6579
|
+
attrs: options
|
|
6580
|
+
});
|
|
6581
|
+
}
|
|
6582
|
+
};
|
|
6583
|
+
},
|
|
6584
|
+
addProseMirrorPlugins() {
|
|
6585
|
+
return [
|
|
6586
|
+
new Plugin3({
|
|
6587
|
+
key: new PluginKey3("inlineImage"),
|
|
6588
|
+
props: {
|
|
6589
|
+
handleClickOn: (_, pos, node) => {
|
|
6590
|
+
if (node.type !== this.type) {
|
|
6591
|
+
return false;
|
|
6592
|
+
}
|
|
6593
|
+
const from = pos;
|
|
6594
|
+
const to = pos + node.nodeSize;
|
|
6595
|
+
this.editor.commands.setTextSelection({ from, to });
|
|
6596
|
+
return true;
|
|
6597
|
+
}
|
|
6598
|
+
}
|
|
6599
|
+
})
|
|
6600
|
+
];
|
|
6601
|
+
}
|
|
6602
|
+
});
|
|
6603
|
+
|
|
6604
|
+
// src/editor/components/inline-image-menu/use-inline-image-state.tsx
|
|
6605
|
+
import { useEditorState as useEditorState3 } from "@tiptap/react";
|
|
6606
|
+
import deepEql3 from "fast-deep-equal";
|
|
6607
|
+
var useInlineImageState = (editor) => {
|
|
6608
|
+
const states = useEditorState3({
|
|
6609
|
+
editor,
|
|
6610
|
+
selector: ({ editor: editor2 }) => {
|
|
6611
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
6612
|
+
return {
|
|
6613
|
+
height: ((_a = editor2.getAttributes("inlineImage")) == null ? void 0 : _a.height) || DEFAULT_INLINE_IMAGE_HEIGHT,
|
|
6614
|
+
width: ((_b = editor2.getAttributes("inlineImage")) == null ? void 0 : _b.width) || DEFAULT_INLINE_IMAGE_WIDTH,
|
|
6615
|
+
src: ((_c = editor2.getAttributes("inlineImage")) == null ? void 0 : _c.src) || "",
|
|
6616
|
+
isSrcVariable: (_e = (_d = editor2.getAttributes("inlineImage")) == null ? void 0 : _d.isSrcVariable) != null ? _e : false,
|
|
6617
|
+
imageExternalLink: ((_f = editor2.getAttributes("inlineImage")) == null ? void 0 : _f.externalLink) || "",
|
|
6618
|
+
isExternalLinkVariable: (_h = (_g = editor2.getAttributes("inlineImage")) == null ? void 0 : _g.isExternalLinkVariable) != null ? _h : false
|
|
6619
|
+
};
|
|
6620
|
+
},
|
|
6621
|
+
equalityFn: deepEql3
|
|
6622
|
+
});
|
|
6623
|
+
return states;
|
|
6624
|
+
};
|
|
6625
|
+
|
|
6264
6626
|
// src/editor/components/ui/link-input-popover.tsx
|
|
6265
6627
|
import { Link, LinkIcon as LinkIcon2 } from "lucide-react";
|
|
6266
6628
|
import { useRef as useRef7, useState as useState7 } from "react";
|
|
@@ -6273,12 +6635,12 @@ import { FootprintsIcon as FootprintsIcon2, Heading1 as Heading12 } from "lucide
|
|
|
6273
6635
|
|
|
6274
6636
|
// src/blocks/button.tsx
|
|
6275
6637
|
import { MousePointer, ArrowUpRightSquare } from "lucide-react";
|
|
6276
|
-
import { jsx as
|
|
6638
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
6277
6639
|
var button = {
|
|
6278
6640
|
title: "Button",
|
|
6279
6641
|
description: "Add a call to action button to email.",
|
|
6280
6642
|
searchTerms: ["link", "button", "cta"],
|
|
6281
|
-
icon: /* @__PURE__ */
|
|
6643
|
+
icon: /* @__PURE__ */ jsx22(MousePointer, { className: "mly:h-4 mly:w-4" }),
|
|
6282
6644
|
command: ({ editor, range }) => {
|
|
6283
6645
|
editor.chain().focus().deleteRange(range).setButton().run();
|
|
6284
6646
|
}
|
|
@@ -6287,7 +6649,7 @@ var linkCard = {
|
|
|
6287
6649
|
title: "Link Card",
|
|
6288
6650
|
description: "Add a link card to email.",
|
|
6289
6651
|
searchTerms: ["link", "button", "image"],
|
|
6290
|
-
icon: /* @__PURE__ */
|
|
6652
|
+
icon: /* @__PURE__ */ jsx22(ArrowUpRightSquare, { className: "mly:h-4 mly:w-4" }),
|
|
6291
6653
|
command: ({ editor, range }) => {
|
|
6292
6654
|
editor.chain().focus().deleteRange(range).setLinkCard().run();
|
|
6293
6655
|
},
|
|
@@ -6300,12 +6662,12 @@ var linkCard = {
|
|
|
6300
6662
|
|
|
6301
6663
|
// src/blocks/code.tsx
|
|
6302
6664
|
import { CodeXmlIcon } from "lucide-react";
|
|
6303
|
-
import { jsx as
|
|
6665
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
6304
6666
|
var htmlCodeBlock = {
|
|
6305
6667
|
title: "Custom HTML",
|
|
6306
6668
|
description: "Insert a custom HTML block",
|
|
6307
6669
|
searchTerms: ["html", "code", "custom"],
|
|
6308
|
-
icon: /* @__PURE__ */
|
|
6670
|
+
icon: /* @__PURE__ */ jsx23(CodeXmlIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6309
6671
|
command: ({ editor, range }) => {
|
|
6310
6672
|
editor.chain().focus().deleteRange(range).setHtmlCodeBlock({ language: "html" }).run();
|
|
6311
6673
|
}
|
|
@@ -6314,12 +6676,12 @@ var htmlCodeBlock = {
|
|
|
6314
6676
|
// src/blocks/image.tsx
|
|
6315
6677
|
import { TextSelection as TextSelection2 } from "@tiptap/pm/state";
|
|
6316
6678
|
import { ImageIcon } from "lucide-react";
|
|
6317
|
-
import { jsx as
|
|
6679
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
6318
6680
|
var image = {
|
|
6319
6681
|
title: "Image",
|
|
6320
6682
|
description: "Full width image",
|
|
6321
6683
|
searchTerms: ["image"],
|
|
6322
|
-
icon: /* @__PURE__ */
|
|
6684
|
+
icon: /* @__PURE__ */ jsx24(ImageIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6323
6685
|
command: ({ editor, range }) => {
|
|
6324
6686
|
editor.chain().focus().deleteRange(range).setImage({ src: "" }).run();
|
|
6325
6687
|
}
|
|
@@ -6328,7 +6690,7 @@ var logo = {
|
|
|
6328
6690
|
title: "Logo",
|
|
6329
6691
|
description: "Add your brand logo",
|
|
6330
6692
|
searchTerms: ["image", "logo"],
|
|
6331
|
-
icon: /* @__PURE__ */
|
|
6693
|
+
icon: /* @__PURE__ */ jsx24(ImageIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6332
6694
|
command: ({ editor, range }) => {
|
|
6333
6695
|
editor.chain().focus().deleteRange(range).setLogoImage({ src: "" }).run();
|
|
6334
6696
|
}
|
|
@@ -6337,7 +6699,7 @@ var inlineImage = {
|
|
|
6337
6699
|
title: "Inline Image",
|
|
6338
6700
|
description: "Inline image",
|
|
6339
6701
|
searchTerms: ["image", "inline"],
|
|
6340
|
-
icon: /* @__PURE__ */
|
|
6702
|
+
icon: /* @__PURE__ */ jsx24(ImageIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6341
6703
|
command: ({ editor, range }) => {
|
|
6342
6704
|
editor.chain().focus().deleteRange(range).setInlineImage({
|
|
6343
6705
|
src: "https://maily.to/brand/logo.png"
|
|
@@ -6367,12 +6729,12 @@ import {
|
|
|
6367
6729
|
RectangleHorizontal,
|
|
6368
6730
|
Minus
|
|
6369
6731
|
} from "lucide-react";
|
|
6370
|
-
import { jsx as
|
|
6732
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
6371
6733
|
var columns = {
|
|
6372
6734
|
title: "Columns",
|
|
6373
6735
|
description: "Add columns to email.",
|
|
6374
6736
|
searchTerms: ["layout", "columns"],
|
|
6375
|
-
icon: /* @__PURE__ */
|
|
6737
|
+
icon: /* @__PURE__ */ jsx25(ColumnsIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6376
6738
|
command: ({ editor, range }) => {
|
|
6377
6739
|
editor.chain().focus().deleteRange(range).setColumns().focus(editor.state.selection.head - 2).run();
|
|
6378
6740
|
}
|
|
@@ -6381,7 +6743,7 @@ var section = {
|
|
|
6381
6743
|
title: "Section",
|
|
6382
6744
|
description: "Add a section to email.",
|
|
6383
6745
|
searchTerms: ["layout", "section"],
|
|
6384
|
-
icon: /* @__PURE__ */
|
|
6746
|
+
icon: /* @__PURE__ */ jsx25(RectangleHorizontal, { className: "mly:h-4 mly:w-4" }),
|
|
6385
6747
|
command: ({ editor, range }) => {
|
|
6386
6748
|
editor.chain().focus().deleteRange(range).setSection().run();
|
|
6387
6749
|
}
|
|
@@ -6390,7 +6752,7 @@ var repeat = {
|
|
|
6390
6752
|
title: "Repeat",
|
|
6391
6753
|
description: "Loop over an array of items.",
|
|
6392
6754
|
searchTerms: ["repeat", "for", "loop"],
|
|
6393
|
-
icon: /* @__PURE__ */
|
|
6755
|
+
icon: /* @__PURE__ */ jsx25(Repeat2, { className: "mly:h-4 mly:w-4" }),
|
|
6394
6756
|
command: ({ editor, range }) => {
|
|
6395
6757
|
editor.chain().focus().deleteRange(range).setRepeat().run();
|
|
6396
6758
|
}
|
|
@@ -6399,7 +6761,7 @@ var spacer = {
|
|
|
6399
6761
|
title: "Spacer",
|
|
6400
6762
|
description: "Add space between blocks.",
|
|
6401
6763
|
searchTerms: ["space", "gap", "divider"],
|
|
6402
|
-
icon: /* @__PURE__ */
|
|
6764
|
+
icon: /* @__PURE__ */ jsx25(MoveVertical, { className: "mly:h-4 mly:w-4" }),
|
|
6403
6765
|
command: ({ editor, range }) => {
|
|
6404
6766
|
editor.chain().focus().deleteRange(range).setSpacer({ height: "sm" }).run();
|
|
6405
6767
|
}
|
|
@@ -6408,20 +6770,32 @@ var divider = {
|
|
|
6408
6770
|
title: "Divider",
|
|
6409
6771
|
description: "Add a horizontal divider.",
|
|
6410
6772
|
searchTerms: ["divider", "line"],
|
|
6411
|
-
icon: /* @__PURE__ */
|
|
6773
|
+
icon: /* @__PURE__ */ jsx25(Minus, { className: "mly:h-4 mly:w-4" }),
|
|
6412
6774
|
command: ({ editor, range }) => {
|
|
6413
6775
|
editor.chain().focus().deleteRange(range).setHorizontalRule().run();
|
|
6776
|
+
const { from } = editor.state.selection;
|
|
6777
|
+
const nearbyPositions = [from, from - 1, from - 2, from + 1];
|
|
6778
|
+
const dividerPos = nearbyPositions.find((pos) => {
|
|
6779
|
+
var _a;
|
|
6780
|
+
if (pos < 0) {
|
|
6781
|
+
return false;
|
|
6782
|
+
}
|
|
6783
|
+
return ((_a = editor.state.doc.nodeAt(pos)) == null ? void 0 : _a.type.name) === "horizontalRule";
|
|
6784
|
+
});
|
|
6785
|
+
if (dividerPos != null) {
|
|
6786
|
+
editor.chain().focus().setNodeSelection(dividerPos).run();
|
|
6787
|
+
}
|
|
6414
6788
|
}
|
|
6415
6789
|
};
|
|
6416
6790
|
|
|
6417
6791
|
// src/blocks/list.tsx
|
|
6418
6792
|
import { List, ListOrdered } from "lucide-react";
|
|
6419
|
-
import { jsx as
|
|
6793
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
6420
6794
|
var bulletList = {
|
|
6421
6795
|
title: "Bullet List",
|
|
6422
6796
|
description: "Create a simple bullet list.",
|
|
6423
6797
|
searchTerms: ["unordered", "point"],
|
|
6424
|
-
icon: /* @__PURE__ */
|
|
6798
|
+
icon: /* @__PURE__ */ jsx26(List, { className: "mly:h-4 mly:w-4" }),
|
|
6425
6799
|
command: ({ editor, range }) => {
|
|
6426
6800
|
editor.chain().focus().deleteRange(range).toggleBulletList().run();
|
|
6427
6801
|
}
|
|
@@ -6430,7 +6804,7 @@ var orderedList = {
|
|
|
6430
6804
|
title: "Numbered List",
|
|
6431
6805
|
description: "Create a list with numbering.",
|
|
6432
6806
|
searchTerms: ["ordered"],
|
|
6433
|
-
icon: /* @__PURE__ */
|
|
6807
|
+
icon: /* @__PURE__ */ jsx26(ListOrdered, { className: "mly:h-4 mly:w-4" }),
|
|
6434
6808
|
command: ({ editor, range }) => {
|
|
6435
6809
|
editor.chain().focus().deleteRange(range).toggleOrderedList().run();
|
|
6436
6810
|
}
|
|
@@ -6447,12 +6821,12 @@ import {
|
|
|
6447
6821
|
FootprintsIcon,
|
|
6448
6822
|
EraserIcon as EraserIcon2
|
|
6449
6823
|
} from "lucide-react";
|
|
6450
|
-
import { jsx as
|
|
6824
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
6451
6825
|
var text = {
|
|
6452
6826
|
title: "Text",
|
|
6453
6827
|
description: "Just start typing with plain text.",
|
|
6454
6828
|
searchTerms: ["p", "paragraph"],
|
|
6455
|
-
icon: /* @__PURE__ */
|
|
6829
|
+
icon: /* @__PURE__ */ jsx27(Text, { className: "mly:h-4 mly:w-4" }),
|
|
6456
6830
|
command: ({ editor, range }) => {
|
|
6457
6831
|
editor.chain().focus().deleteRange(range).toggleNode("paragraph", "paragraph").run();
|
|
6458
6832
|
}
|
|
@@ -6461,7 +6835,7 @@ var heading1 = {
|
|
|
6461
6835
|
title: "Heading 1",
|
|
6462
6836
|
description: "Big heading.",
|
|
6463
6837
|
searchTerms: ["h1", "title", "big", "large"],
|
|
6464
|
-
icon: /* @__PURE__ */
|
|
6838
|
+
icon: /* @__PURE__ */ jsx27(Heading1, { className: "mly:h-4 mly:w-4" }),
|
|
6465
6839
|
command: ({ editor, range }) => {
|
|
6466
6840
|
editor.chain().focus().deleteRange(range).setNode("heading", { level: 1 }).run();
|
|
6467
6841
|
}
|
|
@@ -6470,7 +6844,7 @@ var heading2 = {
|
|
|
6470
6844
|
title: "Heading 2",
|
|
6471
6845
|
description: "Medium heading.",
|
|
6472
6846
|
searchTerms: ["h2", "subtitle", "medium"],
|
|
6473
|
-
icon: /* @__PURE__ */
|
|
6847
|
+
icon: /* @__PURE__ */ jsx27(Heading2, { className: "mly:h-4 mly:w-4" }),
|
|
6474
6848
|
command: ({ editor, range }) => {
|
|
6475
6849
|
editor.chain().focus().deleteRange(range).setNode("heading", { level: 2 }).run();
|
|
6476
6850
|
}
|
|
@@ -6479,7 +6853,7 @@ var heading3 = {
|
|
|
6479
6853
|
title: "Heading 3",
|
|
6480
6854
|
description: "Small heading.",
|
|
6481
6855
|
searchTerms: ["h3", "subtitle", "small"],
|
|
6482
|
-
icon: /* @__PURE__ */
|
|
6856
|
+
icon: /* @__PURE__ */ jsx27(Heading3, { className: "mly:h-4 mly:w-4" }),
|
|
6483
6857
|
command: ({ editor, range }) => {
|
|
6484
6858
|
editor.chain().focus().deleteRange(range).setNode("heading", { level: 3 }).run();
|
|
6485
6859
|
}
|
|
@@ -6488,7 +6862,7 @@ var hardBreak = {
|
|
|
6488
6862
|
title: "Hard Break",
|
|
6489
6863
|
description: "Add a break between lines.",
|
|
6490
6864
|
searchTerms: ["break", "line"],
|
|
6491
|
-
icon: /* @__PURE__ */
|
|
6865
|
+
icon: /* @__PURE__ */ jsx27(DivideIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6492
6866
|
command: ({ editor, range }) => {
|
|
6493
6867
|
editor.chain().focus().deleteRange(range).setHardBreak().run();
|
|
6494
6868
|
}
|
|
@@ -6497,7 +6871,7 @@ var blockquote = {
|
|
|
6497
6871
|
title: "Blockquote",
|
|
6498
6872
|
description: "Add blockquote.",
|
|
6499
6873
|
searchTerms: ["quote", "blockquote"],
|
|
6500
|
-
icon: /* @__PURE__ */
|
|
6874
|
+
icon: /* @__PURE__ */ jsx27(TextQuote, { className: "mly:h-4 mly:w-4" }),
|
|
6501
6875
|
command: ({ editor, range }) => {
|
|
6502
6876
|
editor.chain().focus().deleteRange(range).toggleBlockquote().run();
|
|
6503
6877
|
}
|
|
@@ -6506,7 +6880,7 @@ var footer = {
|
|
|
6506
6880
|
title: "Footer",
|
|
6507
6881
|
description: "Add a footer text to email.",
|
|
6508
6882
|
searchTerms: ["footer", "text"],
|
|
6509
|
-
icon: /* @__PURE__ */
|
|
6883
|
+
icon: /* @__PURE__ */ jsx27(FootprintsIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6510
6884
|
command: ({ editor, range }) => {
|
|
6511
6885
|
editor.chain().focus().deleteRange(range).setFooter().run();
|
|
6512
6886
|
}
|
|
@@ -6515,16 +6889,16 @@ var clearLine = {
|
|
|
6515
6889
|
title: "Clear Line",
|
|
6516
6890
|
description: "Clear the current line.",
|
|
6517
6891
|
searchTerms: ["clear", "line"],
|
|
6518
|
-
icon: /* @__PURE__ */
|
|
6892
|
+
icon: /* @__PURE__ */ jsx27(EraserIcon2, { className: "mly:h-4 mly:w-4" }),
|
|
6519
6893
|
command: ({ editor, range }) => {
|
|
6520
6894
|
editor.chain().focus().selectParentNode().deleteSelection().run();
|
|
6521
6895
|
}
|
|
6522
6896
|
};
|
|
6523
6897
|
|
|
6524
6898
|
// src/editor/components/icons/logo-with-cover-image.tsx
|
|
6525
|
-
import { jsx as
|
|
6899
|
+
import { jsx as jsx28, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
6526
6900
|
function LogoWithCoverImageIcon(props) {
|
|
6527
|
-
return /* @__PURE__ */
|
|
6901
|
+
return /* @__PURE__ */ jsxs13(
|
|
6528
6902
|
"svg",
|
|
6529
6903
|
__spreadProps(__spreadValues({
|
|
6530
6904
|
width: "14",
|
|
@@ -6534,7 +6908,7 @@ function LogoWithCoverImageIcon(props) {
|
|
|
6534
6908
|
xmlns: "http://www.w3.org/2000/svg"
|
|
6535
6909
|
}, props), {
|
|
6536
6910
|
children: [
|
|
6537
|
-
/* @__PURE__ */
|
|
6911
|
+
/* @__PURE__ */ jsx28(
|
|
6538
6912
|
"path",
|
|
6539
6913
|
{
|
|
6540
6914
|
fillRule: "evenodd",
|
|
@@ -6543,7 +6917,7 @@ function LogoWithCoverImageIcon(props) {
|
|
|
6543
6917
|
fill: "currentColor"
|
|
6544
6918
|
}
|
|
6545
6919
|
),
|
|
6546
|
-
/* @__PURE__ */
|
|
6920
|
+
/* @__PURE__ */ jsx28(
|
|
6547
6921
|
"path",
|
|
6548
6922
|
{
|
|
6549
6923
|
fillRule: "evenodd",
|
|
@@ -6552,7 +6926,7 @@ function LogoWithCoverImageIcon(props) {
|
|
|
6552
6926
|
fill: "currentColor"
|
|
6553
6927
|
}
|
|
6554
6928
|
),
|
|
6555
|
-
/* @__PURE__ */
|
|
6929
|
+
/* @__PURE__ */ jsx28(
|
|
6556
6930
|
"path",
|
|
6557
6931
|
{
|
|
6558
6932
|
fillRule: "evenodd",
|
|
@@ -6561,8 +6935,8 @@ function LogoWithCoverImageIcon(props) {
|
|
|
6561
6935
|
fill: "currentColor"
|
|
6562
6936
|
}
|
|
6563
6937
|
),
|
|
6564
|
-
/* @__PURE__ */
|
|
6565
|
-
/* @__PURE__ */
|
|
6938
|
+
/* @__PURE__ */ jsx28("mask", { id: "path-4-inside-1_1046_19527", fill: "white", children: /* @__PURE__ */ jsx28("rect", { x: "3", y: "4", width: "8", height: "3", rx: "0.5" }) }),
|
|
6939
|
+
/* @__PURE__ */ jsx28(
|
|
6566
6940
|
"rect",
|
|
6567
6941
|
{
|
|
6568
6942
|
x: "3",
|
|
@@ -6575,7 +6949,7 @@ function LogoWithCoverImageIcon(props) {
|
|
|
6575
6949
|
mask: "url(#path-4-inside-1_1046_19527)"
|
|
6576
6950
|
}
|
|
6577
6951
|
),
|
|
6578
|
-
/* @__PURE__ */
|
|
6952
|
+
/* @__PURE__ */ jsx28(
|
|
6579
6953
|
"rect",
|
|
6580
6954
|
{
|
|
6581
6955
|
x: "6.25",
|
|
@@ -6587,16 +6961,16 @@ function LogoWithCoverImageIcon(props) {
|
|
|
6587
6961
|
strokeWidth: "0.5"
|
|
6588
6962
|
}
|
|
6589
6963
|
),
|
|
6590
|
-
/* @__PURE__ */
|
|
6964
|
+
/* @__PURE__ */ jsx28("rect", { x: "3", y: "8", width: "2", height: "1", rx: "0.5", fill: "currentColor" })
|
|
6591
6965
|
]
|
|
6592
6966
|
})
|
|
6593
6967
|
);
|
|
6594
6968
|
}
|
|
6595
6969
|
|
|
6596
6970
|
// src/editor/components/icons/logo-with-text-horizon.tsx
|
|
6597
|
-
import { jsx as
|
|
6971
|
+
import { jsx as jsx29, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
6598
6972
|
function LogoWithTextHorizonIcon(props) {
|
|
6599
|
-
return /* @__PURE__ */
|
|
6973
|
+
return /* @__PURE__ */ jsxs14(
|
|
6600
6974
|
"svg",
|
|
6601
6975
|
__spreadProps(__spreadValues({
|
|
6602
6976
|
width: "14",
|
|
@@ -6606,7 +6980,7 @@ function LogoWithTextHorizonIcon(props) {
|
|
|
6606
6980
|
xmlns: "http://www.w3.org/2000/svg"
|
|
6607
6981
|
}, props), {
|
|
6608
6982
|
children: [
|
|
6609
|
-
/* @__PURE__ */
|
|
6983
|
+
/* @__PURE__ */ jsx29(
|
|
6610
6984
|
"path",
|
|
6611
6985
|
{
|
|
6612
6986
|
fillRule: "evenodd",
|
|
@@ -6615,7 +6989,7 @@ function LogoWithTextHorizonIcon(props) {
|
|
|
6615
6989
|
fill: "currentColor"
|
|
6616
6990
|
}
|
|
6617
6991
|
),
|
|
6618
|
-
/* @__PURE__ */
|
|
6992
|
+
/* @__PURE__ */ jsx29(
|
|
6619
6993
|
"rect",
|
|
6620
6994
|
{
|
|
6621
6995
|
x: "6.25",
|
|
@@ -6627,8 +7001,8 @@ function LogoWithTextHorizonIcon(props) {
|
|
|
6627
7001
|
strokeWidth: "0.5"
|
|
6628
7002
|
}
|
|
6629
7003
|
),
|
|
6630
|
-
/* @__PURE__ */
|
|
6631
|
-
/* @__PURE__ */
|
|
7004
|
+
/* @__PURE__ */ jsx29("rect", { x: "3", y: "6.5", width: "2", height: "1", rx: "0.5", fill: "currentColor" }),
|
|
7005
|
+
/* @__PURE__ */ jsx29(
|
|
6632
7006
|
"path",
|
|
6633
7007
|
{
|
|
6634
7008
|
fillRule: "evenodd",
|
|
@@ -6637,7 +7011,7 @@ function LogoWithTextHorizonIcon(props) {
|
|
|
6637
7011
|
fill: "currentColor"
|
|
6638
7012
|
}
|
|
6639
7013
|
),
|
|
6640
|
-
/* @__PURE__ */
|
|
7014
|
+
/* @__PURE__ */ jsx29(
|
|
6641
7015
|
"path",
|
|
6642
7016
|
{
|
|
6643
7017
|
fillRule: "evenodd",
|
|
@@ -6652,9 +7026,9 @@ function LogoWithTextHorizonIcon(props) {
|
|
|
6652
7026
|
}
|
|
6653
7027
|
|
|
6654
7028
|
// src/editor/components/icons/logo-with-text-vertical.tsx
|
|
6655
|
-
import { jsx as
|
|
7029
|
+
import { jsx as jsx30, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
6656
7030
|
function LogoWithTextVerticalIcon(props) {
|
|
6657
|
-
return /* @__PURE__ */
|
|
7031
|
+
return /* @__PURE__ */ jsxs15(
|
|
6658
7032
|
"svg",
|
|
6659
7033
|
__spreadProps(__spreadValues({
|
|
6660
7034
|
width: "14",
|
|
@@ -6664,7 +7038,7 @@ function LogoWithTextVerticalIcon(props) {
|
|
|
6664
7038
|
xmlns: "http://www.w3.org/2000/svg"
|
|
6665
7039
|
}, props), {
|
|
6666
7040
|
children: [
|
|
6667
|
-
/* @__PURE__ */
|
|
7041
|
+
/* @__PURE__ */ jsx30(
|
|
6668
7042
|
"path",
|
|
6669
7043
|
{
|
|
6670
7044
|
fillRule: "evenodd",
|
|
@@ -6673,7 +7047,7 @@ function LogoWithTextVerticalIcon(props) {
|
|
|
6673
7047
|
fill: "currentColor"
|
|
6674
7048
|
}
|
|
6675
7049
|
),
|
|
6676
|
-
/* @__PURE__ */
|
|
7050
|
+
/* @__PURE__ */ jsx30(
|
|
6677
7051
|
"rect",
|
|
6678
7052
|
{
|
|
6679
7053
|
x: "4.25",
|
|
@@ -6685,8 +7059,8 @@ function LogoWithTextVerticalIcon(props) {
|
|
|
6685
7059
|
strokeWidth: "0.5"
|
|
6686
7060
|
}
|
|
6687
7061
|
),
|
|
6688
|
-
/* @__PURE__ */
|
|
6689
|
-
/* @__PURE__ */
|
|
7062
|
+
/* @__PURE__ */ jsx30("rect", { x: "6", y: "6", width: "2", height: "1", rx: "0.5", fill: "currentColor" }),
|
|
7063
|
+
/* @__PURE__ */ jsx30(
|
|
6690
7064
|
"path",
|
|
6691
7065
|
{
|
|
6692
7066
|
fillRule: "evenodd",
|
|
@@ -6695,7 +7069,7 @@ function LogoWithTextVerticalIcon(props) {
|
|
|
6695
7069
|
fill: "currentColor"
|
|
6696
7070
|
}
|
|
6697
7071
|
),
|
|
6698
|
-
/* @__PURE__ */
|
|
7072
|
+
/* @__PURE__ */ jsx30(
|
|
6699
7073
|
"path",
|
|
6700
7074
|
{
|
|
6701
7075
|
fillRule: "evenodd",
|
|
@@ -6710,12 +7084,12 @@ function LogoWithTextVerticalIcon(props) {
|
|
|
6710
7084
|
}
|
|
6711
7085
|
|
|
6712
7086
|
// src/blocks/headers.tsx
|
|
6713
|
-
import { jsx as
|
|
7087
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
6714
7088
|
var headerLogoWithTextHorizontal = {
|
|
6715
7089
|
title: "Logo with Text (Horizontal)",
|
|
6716
7090
|
description: "Logo and a text horizontally",
|
|
6717
7091
|
searchTerms: ["logo", "text"],
|
|
6718
|
-
icon: /* @__PURE__ */
|
|
7092
|
+
icon: /* @__PURE__ */ jsx31(LogoWithTextHorizonIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6719
7093
|
command: ({ editor, range }) => {
|
|
6720
7094
|
editor.chain().deleteRange(range).insertContent({
|
|
6721
7095
|
type: "columns",
|
|
@@ -6779,7 +7153,7 @@ var headerLogoWithTextVertical = {
|
|
|
6779
7153
|
title: "Logo with Text (Vertical)",
|
|
6780
7154
|
description: "Logo and a text vertically",
|
|
6781
7155
|
searchTerms: ["logo", "text"],
|
|
6782
|
-
icon: /* @__PURE__ */
|
|
7156
|
+
icon: /* @__PURE__ */ jsx31(LogoWithTextVerticalIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6783
7157
|
command: ({ editor, range }) => {
|
|
6784
7158
|
editor.chain().deleteRange(range).insertContent([
|
|
6785
7159
|
{
|
|
@@ -6810,7 +7184,7 @@ var headerLogoWithCoverImage = {
|
|
|
6810
7184
|
title: "Logo with Cover Image",
|
|
6811
7185
|
description: "Logo and a cover image",
|
|
6812
7186
|
searchTerms: ["logo", "cover", "image"],
|
|
6813
|
-
icon: /* @__PURE__ */
|
|
7187
|
+
icon: /* @__PURE__ */ jsx31(LogoWithCoverImageIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6814
7188
|
command: ({ editor, range }) => {
|
|
6815
7189
|
const todayFormatted = (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", {
|
|
6816
7190
|
year: "numeric",
|
|
@@ -6903,12 +7277,12 @@ import {
|
|
|
6903
7277
|
LayoutTemplateIcon,
|
|
6904
7278
|
RectangleHorizontalIcon
|
|
6905
7279
|
} from "lucide-react";
|
|
6906
|
-
import { jsx as
|
|
7280
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
6907
7281
|
var footerCopyrightText = {
|
|
6908
7282
|
title: "Footer Copyright",
|
|
6909
7283
|
description: "Copyright text for the footer.",
|
|
6910
7284
|
searchTerms: ["footer", "copyright"],
|
|
6911
|
-
icon: /* @__PURE__ */
|
|
7285
|
+
icon: /* @__PURE__ */ jsx32(CopyrightIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6912
7286
|
command: ({ editor, range }) => {
|
|
6913
7287
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
6914
7288
|
editor.chain().focus().deleteRange(range).insertContent({
|
|
@@ -6928,7 +7302,7 @@ var footerCommunityFeedbackCta = {
|
|
|
6928
7302
|
title: "Footer Community Feedback CTA",
|
|
6929
7303
|
description: "Community feedback CTA for the footer.",
|
|
6930
7304
|
searchTerms: ["footer", "community", "feedback", "cta"],
|
|
6931
|
-
icon: /* @__PURE__ */
|
|
7305
|
+
icon: /* @__PURE__ */ jsx32(RectangleHorizontalIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6932
7306
|
command: ({ editor, range }) => {
|
|
6933
7307
|
editor.chain().focus().deleteRange(range).insertContent([
|
|
6934
7308
|
{
|
|
@@ -6971,7 +7345,7 @@ var footerCompanySignature = {
|
|
|
6971
7345
|
title: "Footer Company Signature",
|
|
6972
7346
|
description: "Company signature for the footer.",
|
|
6973
7347
|
searchTerms: ["footer", "company", "signature"],
|
|
6974
|
-
icon: /* @__PURE__ */
|
|
7348
|
+
icon: /* @__PURE__ */ jsx32(LayoutTemplateIcon, { className: "mly:h-4 mly:w-4" }),
|
|
6975
7349
|
command: ({ editor, range }) => {
|
|
6976
7350
|
editor.chain().focus().deleteRange(range).insertContent([
|
|
6977
7351
|
{ type: "horizontalRule" },
|
|
@@ -7125,7 +7499,7 @@ var footerCompanySignature = {
|
|
|
7125
7499
|
};
|
|
7126
7500
|
|
|
7127
7501
|
// src/editor/extensions/slash-command/default-slash-commands.tsx
|
|
7128
|
-
import { jsx as
|
|
7502
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
7129
7503
|
var DEFAULT_SLASH_COMMANDS = [
|
|
7130
7504
|
{
|
|
7131
7505
|
title: "Blocks",
|
|
@@ -7160,7 +7534,7 @@ var DEFAULT_SLASH_COMMANDS = [
|
|
|
7160
7534
|
title: "Headers",
|
|
7161
7535
|
description: "Add pre-designed headers block",
|
|
7162
7536
|
searchTerms: ["header", "headers"],
|
|
7163
|
-
icon: /* @__PURE__ */
|
|
7537
|
+
icon: /* @__PURE__ */ jsx33(Heading12, { className: "mly:h-4 mly:w-4" }),
|
|
7164
7538
|
preview: "https://cdn.usemaily.com/previews/header-preview-xyz.png",
|
|
7165
7539
|
commands: [
|
|
7166
7540
|
headerLogoWithTextVertical,
|
|
@@ -7173,7 +7547,7 @@ var DEFAULT_SLASH_COMMANDS = [
|
|
|
7173
7547
|
title: "Footers",
|
|
7174
7548
|
description: "Add pre-designed footers block",
|
|
7175
7549
|
searchTerms: ["footers"],
|
|
7176
|
-
icon: /* @__PURE__ */
|
|
7550
|
+
icon: /* @__PURE__ */ jsx33(FootprintsIcon2, { className: "mly:h-4 mly:w-4" }),
|
|
7177
7551
|
commands: [
|
|
7178
7552
|
footerCopyrightText,
|
|
7179
7553
|
footerCommunityFeedbackCta,
|
|
@@ -7186,7 +7560,7 @@ var DEFAULT_SLASH_COMMANDS = [
|
|
|
7186
7560
|
];
|
|
7187
7561
|
|
|
7188
7562
|
// src/editor/provider.tsx
|
|
7189
|
-
import { jsx as
|
|
7563
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
7190
7564
|
var DEFAULT_PLACEHOLDER_URL = "https://maily.to/";
|
|
7191
7565
|
var MailyContext = createContext({
|
|
7192
7566
|
placeholderUrl: DEFAULT_PLACEHOLDER_URL,
|
|
@@ -7194,7 +7568,7 @@ var MailyContext = createContext({
|
|
|
7194
7568
|
});
|
|
7195
7569
|
function MailyProvider(props) {
|
|
7196
7570
|
const _a = props, { children } = _a, defaultValues = __objRest(_a, ["children"]);
|
|
7197
|
-
return /* @__PURE__ */
|
|
7571
|
+
return /* @__PURE__ */ jsx34(MailyContext.Provider, { value: defaultValues, children });
|
|
7198
7572
|
}
|
|
7199
7573
|
function useMailyContext() {
|
|
7200
7574
|
const values = useContext(MailyContext);
|
|
@@ -7205,11 +7579,11 @@ function useMailyContext() {
|
|
|
7205
7579
|
}
|
|
7206
7580
|
|
|
7207
7581
|
// src/editor/components/ui/link-input-popover.tsx
|
|
7208
|
-
import { useMemo as
|
|
7582
|
+
import { useMemo as useMemo7 } from "react";
|
|
7209
7583
|
|
|
7210
7584
|
// src/editor/nodes/variable/variable.ts
|
|
7211
|
-
import { mergeAttributes as
|
|
7212
|
-
import { PluginKey as
|
|
7585
|
+
import { mergeAttributes as mergeAttributes4, Node as Node5 } from "@tiptap/core";
|
|
7586
|
+
import { PluginKey as PluginKey4 } from "@tiptap/pm/state";
|
|
7213
7587
|
import { ReactNodeViewRenderer as ReactNodeViewRenderer2 } from "@tiptap/react";
|
|
7214
7588
|
import Suggestion from "@tiptap/suggestion";
|
|
7215
7589
|
|
|
@@ -7227,7 +7601,7 @@ import {
|
|
|
7227
7601
|
useRef as useRef6,
|
|
7228
7602
|
useState as useState6
|
|
7229
7603
|
} from "react";
|
|
7230
|
-
import { jsx as
|
|
7604
|
+
import { jsx as jsx35, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
7231
7605
|
var VariableSuggestionsPopover = forwardRef5((props, ref) => {
|
|
7232
7606
|
const { items, onSelectItem } = props;
|
|
7233
7607
|
const [selectedIndex, setSelectedIndex] = useState6(0);
|
|
@@ -7273,17 +7647,17 @@ var VariableSuggestionsPopover = forwardRef5((props, ref) => {
|
|
|
7273
7647
|
onSelectItem(item);
|
|
7274
7648
|
}
|
|
7275
7649
|
}));
|
|
7276
|
-
return /* @__PURE__ */
|
|
7277
|
-
/* @__PURE__ */
|
|
7278
|
-
/* @__PURE__ */
|
|
7279
|
-
/* @__PURE__ */
|
|
7650
|
+
return /* @__PURE__ */ jsxs16("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: [
|
|
7651
|
+
/* @__PURE__ */ jsxs16("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: [
|
|
7652
|
+
/* @__PURE__ */ jsx35("span", { className: "mly:text-xs mly:uppercase", children: "Variables" }),
|
|
7653
|
+
/* @__PURE__ */ jsx35(VariableIcon, { children: /* @__PURE__ */ jsx35(Braces, { className: "mly:size-3 mly:stroke-[2.5]" }) })
|
|
7280
7654
|
] }),
|
|
7281
|
-
/* @__PURE__ */
|
|
7655
|
+
/* @__PURE__ */ jsx35(
|
|
7282
7656
|
"div",
|
|
7283
7657
|
{
|
|
7284
7658
|
ref: scrollContainerRef,
|
|
7285
7659
|
className: "mly:max-h-52 mly:overflow-y-auto mly:scrollbar-thin mly:scrollbar-track-transparent mly:scrollbar-thumb-gray-200",
|
|
7286
|
-
children: /* @__PURE__ */
|
|
7660
|
+
children: /* @__PURE__ */ jsx35("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__ */ jsxs16(
|
|
7287
7661
|
"button",
|
|
7288
7662
|
{
|
|
7289
7663
|
ref: (el) => itemRefs.current[index] = el,
|
|
@@ -7293,27 +7667,27 @@ var VariableSuggestionsPopover = forwardRef5((props, ref) => {
|
|
|
7293
7667
|
index === selectedIndex ? "mly:bg-soft-gray" : "mly:bg-white"
|
|
7294
7668
|
),
|
|
7295
7669
|
children: [
|
|
7296
|
-
/* @__PURE__ */
|
|
7670
|
+
/* @__PURE__ */ jsx35(Braces, { className: "mly:size-3 mly:stroke-[2.5] mly:text-rose-600" }),
|
|
7297
7671
|
(item == null ? void 0 : item.label) || item.name
|
|
7298
7672
|
]
|
|
7299
7673
|
},
|
|
7300
7674
|
index
|
|
7301
|
-
)) : /* @__PURE__ */
|
|
7675
|
+
)) : /* @__PURE__ */ jsx35("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" }) })
|
|
7302
7676
|
}
|
|
7303
7677
|
),
|
|
7304
|
-
/* @__PURE__ */
|
|
7305
|
-
/* @__PURE__ */
|
|
7306
|
-
/* @__PURE__ */
|
|
7307
|
-
/* @__PURE__ */
|
|
7308
|
-
/* @__PURE__ */
|
|
7678
|
+
/* @__PURE__ */ jsxs16("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: [
|
|
7679
|
+
/* @__PURE__ */ jsxs16("div", { className: "mly:flex mly:items-center mly:gap-1", children: [
|
|
7680
|
+
/* @__PURE__ */ jsx35(VariableIcon, { children: /* @__PURE__ */ jsx35(ArrowDownIcon, { className: "mly:size-3 mly:stroke-[2.5]" }) }),
|
|
7681
|
+
/* @__PURE__ */ jsx35(VariableIcon, { children: /* @__PURE__ */ jsx35(ArrowUpIcon, { className: "mly:size-3 mly:stroke-[2.5]" }) }),
|
|
7682
|
+
/* @__PURE__ */ jsx35("span", { className: "mly:text-xs mly:text-gray-500", children: "Navigate" })
|
|
7309
7683
|
] }),
|
|
7310
|
-
/* @__PURE__ */
|
|
7684
|
+
/* @__PURE__ */ jsx35(VariableIcon, { children: /* @__PURE__ */ jsx35(CornerDownLeftIcon, { className: "mly:size-3 mly:stroke-[2.5]" }) })
|
|
7311
7685
|
] })
|
|
7312
7686
|
] });
|
|
7313
7687
|
});
|
|
7314
7688
|
function VariableIcon(props) {
|
|
7315
7689
|
const { className, children } = props;
|
|
7316
|
-
return /* @__PURE__ */
|
|
7690
|
+
return /* @__PURE__ */ jsx35(
|
|
7317
7691
|
"div",
|
|
7318
7692
|
{
|
|
7319
7693
|
className: cn(
|
|
@@ -7328,8 +7702,8 @@ function VariableIcon(props) {
|
|
|
7328
7702
|
// src/editor/nodes/variable/variable-view.tsx
|
|
7329
7703
|
import { NodeViewWrapper as NodeViewWrapper3 } from "@tiptap/react";
|
|
7330
7704
|
import { AlertTriangle, Braces as Braces2, Pencil } from "lucide-react";
|
|
7331
|
-
import { useMemo as
|
|
7332
|
-
import { Fragment as
|
|
7705
|
+
import { useMemo as useMemo6 } from "react";
|
|
7706
|
+
import { Fragment as Fragment5, jsx as jsx36, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
7333
7707
|
function VariableView(props) {
|
|
7334
7708
|
const { node, updateAttributes: updateAttributes2, editor } = props;
|
|
7335
7709
|
const {
|
|
@@ -7339,24 +7713,24 @@ function VariableView(props) {
|
|
|
7339
7713
|
hideDefaultValue = false,
|
|
7340
7714
|
label
|
|
7341
7715
|
} = node.attrs;
|
|
7342
|
-
const renderVariable =
|
|
7716
|
+
const renderVariable = useMemo6(() => {
|
|
7343
7717
|
var _a, _b;
|
|
7344
7718
|
const variableRender = (_b = (_a = getNodeOptions(editor, "variable")) == null ? void 0 : _a.renderVariable) != null ? _b : DEFAULT_RENDER_VARIABLE_FUNCTION;
|
|
7345
7719
|
return variableRender;
|
|
7346
7720
|
}, [editor]);
|
|
7347
|
-
return /* @__PURE__ */
|
|
7721
|
+
return /* @__PURE__ */ jsx36(
|
|
7348
7722
|
NodeViewWrapper3,
|
|
7349
7723
|
{
|
|
7350
7724
|
className: "react-component mly:inline-block mly:leading-none",
|
|
7351
7725
|
draggable: "false",
|
|
7352
|
-
children: /* @__PURE__ */
|
|
7726
|
+
children: /* @__PURE__ */ jsxs17(
|
|
7353
7727
|
Popover,
|
|
7354
7728
|
{
|
|
7355
7729
|
onOpenChange: (open) => {
|
|
7356
7730
|
editor.storage.variable.popover = open;
|
|
7357
7731
|
},
|
|
7358
7732
|
children: [
|
|
7359
|
-
/* @__PURE__ */
|
|
7733
|
+
/* @__PURE__ */ jsx36(PopoverTrigger, { children: renderVariable({
|
|
7360
7734
|
variable: {
|
|
7361
7735
|
name: id,
|
|
7362
7736
|
required,
|
|
@@ -7367,7 +7741,7 @@ function VariableView(props) {
|
|
|
7367
7741
|
editor,
|
|
7368
7742
|
from: "content-variable"
|
|
7369
7743
|
}) }),
|
|
7370
|
-
/* @__PURE__ */
|
|
7744
|
+
/* @__PURE__ */ jsx36(
|
|
7371
7745
|
PopoverContent,
|
|
7372
7746
|
{
|
|
7373
7747
|
align: "start",
|
|
@@ -7376,10 +7750,10 @@ function VariableView(props) {
|
|
|
7376
7750
|
sideOffset: 8,
|
|
7377
7751
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
7378
7752
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
7379
|
-
children: /* @__PURE__ */
|
|
7380
|
-
/* @__PURE__ */
|
|
7381
|
-
/* @__PURE__ */
|
|
7382
|
-
/* @__PURE__ */
|
|
7753
|
+
children: /* @__PURE__ */ jsx36(TooltipProvider, { children: /* @__PURE__ */ jsxs17("div", { className: "mly:flex mly:items-stretch mly:text-midnight-gray", children: [
|
|
7754
|
+
/* @__PURE__ */ jsxs17("label", { className: "mly:relative", children: [
|
|
7755
|
+
/* @__PURE__ */ jsx36("span", { className: "mly:inline-block mly:px-2 mly:text-xs mly:text-midnight-gray", children: "Variable" }),
|
|
7756
|
+
/* @__PURE__ */ jsx36(
|
|
7383
7757
|
"input",
|
|
7384
7758
|
__spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
|
|
7385
7759
|
value: id != null ? id : "",
|
|
@@ -7393,11 +7767,11 @@ function VariableView(props) {
|
|
|
7393
7767
|
})
|
|
7394
7768
|
)
|
|
7395
7769
|
] }),
|
|
7396
|
-
!hideDefaultValue && /* @__PURE__ */
|
|
7397
|
-
/* @__PURE__ */
|
|
7398
|
-
/* @__PURE__ */
|
|
7399
|
-
/* @__PURE__ */
|
|
7400
|
-
/* @__PURE__ */
|
|
7770
|
+
!hideDefaultValue && /* @__PURE__ */ jsxs17(Fragment5, { children: [
|
|
7771
|
+
/* @__PURE__ */ jsx36(Divider, { className: "mly:mx-1.5" }),
|
|
7772
|
+
/* @__PURE__ */ jsxs17("label", { className: "mly:relative", children: [
|
|
7773
|
+
/* @__PURE__ */ jsx36("span", { className: "mly:inline-block mly:px-2 mly:pl-1 mly:text-xs mly:text-midnight-gray", children: "Default" }),
|
|
7774
|
+
/* @__PURE__ */ jsx36(
|
|
7401
7775
|
"input",
|
|
7402
7776
|
__spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
|
|
7403
7777
|
value: fallback != null ? fallback : "",
|
|
@@ -7410,7 +7784,7 @@ function VariableView(props) {
|
|
|
7410
7784
|
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"
|
|
7411
7785
|
})
|
|
7412
7786
|
),
|
|
7413
|
-
/* @__PURE__ */
|
|
7787
|
+
/* @__PURE__ */ jsx36("div", { className: "mly:absolute mly:inset-y-0 mly:right-1 mly:flex mly:items-center", children: /* @__PURE__ */ jsx36(Pencil, { className: "mly:h-3 mly:w-3 mly:stroke-[2.5] mly:text-midnight-gray" }) })
|
|
7414
7788
|
] })
|
|
7415
7789
|
] })
|
|
7416
7790
|
] }) })
|
|
@@ -7427,13 +7801,13 @@ var DefaultRenderVariable = (props) => {
|
|
|
7427
7801
|
const { name, required, valid, label } = variable;
|
|
7428
7802
|
const variableLabel = label || name;
|
|
7429
7803
|
if (from === "button-variable") {
|
|
7430
|
-
return /* @__PURE__ */
|
|
7431
|
-
/* @__PURE__ */
|
|
7432
|
-
/* @__PURE__ */
|
|
7804
|
+
return /* @__PURE__ */ jsxs17("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: [
|
|
7805
|
+
/* @__PURE__ */ jsx36(Braces2, { className: "mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5]" }),
|
|
7806
|
+
/* @__PURE__ */ jsx36("span", { className: "mly:min-w-0 mly:truncate mly:text-left", children: variableLabel })
|
|
7433
7807
|
] });
|
|
7434
7808
|
}
|
|
7435
7809
|
if (from === "bubble-variable") {
|
|
7436
|
-
return /* @__PURE__ */
|
|
7810
|
+
return /* @__PURE__ */ jsxs17(
|
|
7437
7811
|
"div",
|
|
7438
7812
|
{
|
|
7439
7813
|
className: cn(
|
|
@@ -7441,21 +7815,21 @@ var DefaultRenderVariable = (props) => {
|
|
|
7441
7815
|
!valid && "mly:border-rose-400 mly:bg-rose-50 mly:text-rose-600 mly:hover:bg-rose-100"
|
|
7442
7816
|
),
|
|
7443
7817
|
children: [
|
|
7444
|
-
/* @__PURE__ */
|
|
7445
|
-
/* @__PURE__ */
|
|
7818
|
+
/* @__PURE__ */ jsx36(Braces2, { className: "mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5] mly:text-rose-600" }),
|
|
7819
|
+
/* @__PURE__ */ jsx36("span", { className: "mly:min-w-0 mly:truncate mly:text-left", children: variableLabel })
|
|
7446
7820
|
]
|
|
7447
7821
|
}
|
|
7448
7822
|
);
|
|
7449
7823
|
}
|
|
7450
|
-
return /* @__PURE__ */
|
|
7824
|
+
return /* @__PURE__ */ jsxs17(
|
|
7451
7825
|
"span",
|
|
7452
7826
|
{
|
|
7453
7827
|
tabIndex: -1,
|
|
7454
7828
|
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",
|
|
7455
7829
|
children: [
|
|
7456
|
-
/* @__PURE__ */
|
|
7830
|
+
/* @__PURE__ */ jsx36(Braces2, { className: "mly:size-[var(--variable-icon-size)] mly:shrink-0 mly:stroke-[2.5] mly:text-rose-600" }),
|
|
7457
7831
|
variableLabel,
|
|
7458
|
-
required && !fallback && /* @__PURE__ */
|
|
7832
|
+
required && !fallback && /* @__PURE__ */ jsx36(AlertTriangle, { className: "mly:size-[var(--variable-icon-size)] mly:shrink-0 mly:stroke-[2.5]" })
|
|
7459
7833
|
]
|
|
7460
7834
|
}
|
|
7461
7835
|
);
|
|
@@ -7466,8 +7840,8 @@ var DEFAULT_VARIABLE_TRIGGER_CHAR = "@";
|
|
|
7466
7840
|
var DEFAULT_VARIABLES = [];
|
|
7467
7841
|
var DEFAULT_RENDER_VARIABLE_FUNCTION = DefaultRenderVariable;
|
|
7468
7842
|
var DEFAULT_VARIABLE_SUGGESTION_POPOVER = VariableSuggestionsPopover;
|
|
7469
|
-
var VariablePluginKey = new
|
|
7470
|
-
var VariableExtension =
|
|
7843
|
+
var VariablePluginKey = new PluginKey4("variable");
|
|
7844
|
+
var VariableExtension = Node5.create({
|
|
7471
7845
|
name: "variable",
|
|
7472
7846
|
group: "inline",
|
|
7473
7847
|
inline: true,
|
|
@@ -7583,7 +7957,7 @@ var VariableExtension = Node4.create({
|
|
|
7583
7957
|
renderHTML({ node, HTMLAttributes: HTMLAttributes2 }) {
|
|
7584
7958
|
return [
|
|
7585
7959
|
"div",
|
|
7586
|
-
|
|
7960
|
+
mergeAttributes4({ "data-type": this.name }, HTMLAttributes2),
|
|
7587
7961
|
this.options.renderLabel({
|
|
7588
7962
|
options: this.options,
|
|
7589
7963
|
node
|
|
@@ -7636,7 +8010,7 @@ var VariableExtension = Node4.create({
|
|
|
7636
8010
|
});
|
|
7637
8011
|
|
|
7638
8012
|
// src/editor/components/ui/link-input-popover.tsx
|
|
7639
|
-
import { jsx as
|
|
8013
|
+
import { jsx as jsx37, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
7640
8014
|
function LinkInputPopover(props) {
|
|
7641
8015
|
var _a, _b;
|
|
7642
8016
|
const {
|
|
@@ -7655,7 +8029,7 @@ function LinkInputPopover(props) {
|
|
|
7655
8029
|
const renderVariable = options == null ? void 0 : options.renderVariable;
|
|
7656
8030
|
const variables = options == null ? void 0 : options.variables;
|
|
7657
8031
|
const variableTriggerCharacter = (_b = (_a = options == null ? void 0 : options.suggestion) == null ? void 0 : _a.char) != null ? _b : DEFAULT_VARIABLE_TRIGGER_CHAR;
|
|
7658
|
-
const autoCompleteOptions =
|
|
8032
|
+
const autoCompleteOptions = useMemo7(() => {
|
|
7659
8033
|
const withoutTrigger = defaultValue.replace(
|
|
7660
8034
|
new RegExp(variableTriggerCharacter, "g"),
|
|
7661
8035
|
""
|
|
@@ -7666,18 +8040,18 @@ function LinkInputPopover(props) {
|
|
|
7666
8040
|
editor
|
|
7667
8041
|
}).map((variable) => variable.name);
|
|
7668
8042
|
}, [variables, variableTriggerCharacter, defaultValue, editor]);
|
|
7669
|
-
const popoverButton = /* @__PURE__ */
|
|
8043
|
+
const popoverButton = /* @__PURE__ */ jsx37(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx37(
|
|
7670
8044
|
BaseButton,
|
|
7671
8045
|
{
|
|
7672
8046
|
variant: "ghost",
|
|
7673
8047
|
size: "sm",
|
|
7674
8048
|
type: "button",
|
|
7675
|
-
className: "mly:h-7! mly:w-7!",
|
|
8049
|
+
className: "menu-option mly:h-7! mly:w-7!",
|
|
7676
8050
|
"data-state": !!defaultValue,
|
|
7677
|
-
children: /* @__PURE__ */
|
|
8051
|
+
children: /* @__PURE__ */ jsx37(Icon, { className: "mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5] mly:text-midnight-gray" })
|
|
7678
8052
|
}
|
|
7679
8053
|
) });
|
|
7680
|
-
return /* @__PURE__ */
|
|
8054
|
+
return /* @__PURE__ */ jsxs18(
|
|
7681
8055
|
Popover,
|
|
7682
8056
|
{
|
|
7683
8057
|
open: isOpen,
|
|
@@ -7691,9 +8065,9 @@ function LinkInputPopover(props) {
|
|
|
7691
8065
|
}
|
|
7692
8066
|
},
|
|
7693
8067
|
children: [
|
|
7694
|
-
tooltip ? /* @__PURE__ */
|
|
7695
|
-
/* @__PURE__ */
|
|
7696
|
-
/* @__PURE__ */
|
|
8068
|
+
tooltip ? /* @__PURE__ */ jsxs18(Tooltip, { children: [
|
|
8069
|
+
/* @__PURE__ */ jsx37(TooltipTrigger, { asChild: true, children: popoverButton }),
|
|
8070
|
+
/* @__PURE__ */ jsx37(
|
|
7697
8071
|
TooltipContent,
|
|
7698
8072
|
{
|
|
7699
8073
|
sideOffset: 8,
|
|
@@ -7702,7 +8076,7 @@ function LinkInputPopover(props) {
|
|
|
7702
8076
|
}
|
|
7703
8077
|
)
|
|
7704
8078
|
] }) : popoverButton,
|
|
7705
|
-
/* @__PURE__ */
|
|
8079
|
+
/* @__PURE__ */ jsx37(
|
|
7706
8080
|
PopoverContent,
|
|
7707
8081
|
{
|
|
7708
8082
|
align: "end",
|
|
@@ -7710,7 +8084,7 @@ function LinkInputPopover(props) {
|
|
|
7710
8084
|
className: "mly:w-max mly:rounded-none mly:border-none mly:bg-transparent mly:p-0! mly:shadow-none",
|
|
7711
8085
|
sideOffset: 8,
|
|
7712
8086
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
7713
|
-
children: /* @__PURE__ */
|
|
8087
|
+
children: /* @__PURE__ */ jsx37(
|
|
7714
8088
|
"form",
|
|
7715
8089
|
{
|
|
7716
8090
|
onSubmit: (e) => {
|
|
@@ -7722,8 +8096,8 @@ function LinkInputPopover(props) {
|
|
|
7722
8096
|
onValueChange == null ? void 0 : onValueChange(input.value);
|
|
7723
8097
|
setIsOpen(false);
|
|
7724
8098
|
},
|
|
7725
|
-
children: /* @__PURE__ */
|
|
7726
|
-
!isEditing && /* @__PURE__ */
|
|
8099
|
+
children: /* @__PURE__ */ jsxs18("div", { className: "mly:isolate mly:flex mly:rounded-lg", children: [
|
|
8100
|
+
!isEditing && /* @__PURE__ */ jsx37("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__ */ jsx37(
|
|
7727
8101
|
"button",
|
|
7728
8102
|
{
|
|
7729
8103
|
onClick: () => {
|
|
@@ -7744,9 +8118,9 @@ function LinkInputPopover(props) {
|
|
|
7744
8118
|
})
|
|
7745
8119
|
}
|
|
7746
8120
|
) }),
|
|
7747
|
-
isEditing && /* @__PURE__ */
|
|
7748
|
-
/* @__PURE__ */
|
|
7749
|
-
/* @__PURE__ */
|
|
8121
|
+
isEditing && /* @__PURE__ */ jsxs18("div", { className: "mly:relative", children: [
|
|
8122
|
+
/* @__PURE__ */ jsx37("div", { className: "mly:absolute mly:inset-y-0 mly:left-1.5 mly:z-10 mly:flex mly:items-center", children: /* @__PURE__ */ jsx37(LinkIcon2, { className: "mly:h-3 mly:w-3 mly:stroke-[2.5] mly:text-midnight-gray" }) }),
|
|
8123
|
+
/* @__PURE__ */ jsx37(
|
|
7750
8124
|
InputAutocomplete,
|
|
7751
8125
|
{
|
|
7752
8126
|
editor,
|
|
@@ -7768,399 +8142,22 @@ function LinkInputPopover(props) {
|
|
|
7768
8142
|
onValueChange == null ? void 0 : onValueChange(value, isVariable2);
|
|
7769
8143
|
setIsOpen(false);
|
|
7770
8144
|
}
|
|
7771
|
-
}
|
|
7772
|
-
)
|
|
7773
|
-
] })
|
|
7774
|
-
] })
|
|
7775
|
-
}
|
|
7776
|
-
)
|
|
7777
|
-
}
|
|
7778
|
-
)
|
|
7779
|
-
]
|
|
7780
|
-
}
|
|
7781
|
-
);
|
|
7782
|
-
}
|
|
7783
|
-
|
|
7784
|
-
// src/editor/components/image-menu/image-size.tsx
|
|
7785
|
-
import { jsx as jsx35, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
7786
|
-
function ImageSize(props) {
|
|
7787
|
-
const { value, onValueChange, dimension } = props;
|
|
7788
|
-
return /* @__PURE__ */ jsxs17("label", { className: "mly:relative mly:flex mly:items-center", children: [
|
|
7789
|
-
/* @__PURE__ */ jsx35("span", { className: "mly:absolute mly:inset-y-0 mly:left-2 mly:flex mly:items-center mly:text-xs mly:leading-none mly:text-gray-400", children: dimension === "width" ? "W" : "H" }),
|
|
7790
|
-
/* @__PURE__ */ jsx35(
|
|
7791
|
-
"input",
|
|
7792
|
-
__spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
|
|
7793
|
-
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",
|
|
7794
|
-
type: "number",
|
|
7795
|
-
value,
|
|
7796
|
-
onChange: (e) => onValueChange(e.target.value)
|
|
7797
|
-
})
|
|
7798
|
-
),
|
|
7799
|
-
/* @__PURE__ */ jsx35("span", { className: "mly:absolute mly:inset-y-0 mly:right-1 mly:flex mly:items-center mly:text-xs mly:leading-none mly:text-gray-400", children: "PX" })
|
|
7800
|
-
] });
|
|
7801
|
-
}
|
|
7802
|
-
|
|
7803
|
-
// src/editor/components/image-menu/use-image-state.tsx
|
|
7804
|
-
import { useEditorState as useEditorState2 } from "@tiptap/react";
|
|
7805
|
-
import deepEql2 from "fast-deep-equal";
|
|
7806
|
-
var useImageState = (editor) => {
|
|
7807
|
-
const states = useEditorState2({
|
|
7808
|
-
editor,
|
|
7809
|
-
selector: ({ editor: editor2 }) => {
|
|
7810
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
7811
|
-
return {
|
|
7812
|
-
width: String(editor2.getAttributes("image").width),
|
|
7813
|
-
height: String(editor2.getAttributes("image").height),
|
|
7814
|
-
isImageActive: editor2.isActive("image"),
|
|
7815
|
-
isLogoActive: editor2.isActive("logo"),
|
|
7816
|
-
alignment: ((_a = editor2.getAttributes("image")) == null ? void 0 : _a.alignment) || ((_b = editor2.getAttributes("logo")) == null ? void 0 : _b.alignment),
|
|
7817
|
-
borderRadius: (_c = editor2.getAttributes("image")) == null ? void 0 : _c.borderRadius,
|
|
7818
|
-
logoSize: ((_d = editor2.getAttributes("logo")) == null ? void 0 : _d.size) || DEFAULT_LOGO_SIZE,
|
|
7819
|
-
imageSrc: ((_e = editor2.getAttributes("image")) == null ? void 0 : _e.src) || ((_f = editor2.getAttributes("logo")) == null ? void 0 : _f.src) || "",
|
|
7820
|
-
isSrcVariable: (_j = (_i = (_g = editor2.getAttributes("image")) == null ? void 0 : _g.isSrcVariable) != null ? _i : (_h = editor2.getAttributes("logo")) == null ? void 0 : _h.isSrcVariable) != null ? _j : false,
|
|
7821
|
-
imageExternalLink: ((_k = editor2.getAttributes("image")) == null ? void 0 : _k.externalLink) || "",
|
|
7822
|
-
isExternalLinkVariable: (_l = editor2.getAttributes("image")) == null ? void 0 : _l.isExternalLinkVariable,
|
|
7823
|
-
lockAspectRatio: (_m = editor2.getAttributes("image")) == null ? void 0 : _m.lockAspectRatio,
|
|
7824
|
-
aspectRatio: (_n = editor2.getAttributes("image")) == null ? void 0 : _n.aspectRatio,
|
|
7825
|
-
currentShowIfKey: ((_o = editor2.getAttributes("image")) == null ? void 0 : _o.showIfKey) || ((_p = editor2.getAttributes("logo")) == null ? void 0 : _p.showIfKey) || ""
|
|
7826
|
-
};
|
|
7827
|
-
},
|
|
7828
|
-
equalityFn: deepEql2
|
|
7829
|
-
});
|
|
7830
|
-
return states;
|
|
7831
|
-
};
|
|
7832
|
-
|
|
7833
|
-
// src/editor/components/image-menu/image-bubble-menu.tsx
|
|
7834
|
-
import { Fragment as Fragment5, jsx as jsx36, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
7835
|
-
function ImageBubbleMenu(props) {
|
|
7836
|
-
var _a, _b, _c, _d;
|
|
7837
|
-
const { editor, appendTo } = props;
|
|
7838
|
-
if (!editor) {
|
|
7839
|
-
return null;
|
|
7840
|
-
}
|
|
7841
|
-
const state = useImageState(editor);
|
|
7842
|
-
const bubbleMenuProps = __spreadProps(__spreadValues(__spreadValues({}, props), appendTo ? { appendTo: appendTo.current } : {}), {
|
|
7843
|
-
shouldShow: ({ editor: editor2 }) => {
|
|
7844
|
-
if (!editor2.isEditable) {
|
|
7845
|
-
return false;
|
|
7846
|
-
}
|
|
7847
|
-
return editor2.isActive("logo") || editor2.isActive("image");
|
|
7848
|
-
},
|
|
7849
|
-
tippyOptions: {
|
|
7850
|
-
popperOptions: {
|
|
7851
|
-
modifiers: [{ name: "flip", enabled: false }]
|
|
7852
|
-
},
|
|
7853
|
-
plugins: [sticky2],
|
|
7854
|
-
sticky: "popper",
|
|
7855
|
-
maxWidth: "100%"
|
|
7856
|
-
}
|
|
7857
|
-
});
|
|
7858
|
-
const { lockAspectRatio } = state;
|
|
7859
|
-
return /* @__PURE__ */ jsx36(
|
|
7860
|
-
BubbleMenu2,
|
|
7861
|
-
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
7862
|
-
className: "mly:flex mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:p-0.5 mly:shadow-md",
|
|
7863
|
-
children: /* @__PURE__ */ jsxs18(TooltipProvider, { children: [
|
|
7864
|
-
state.isLogoActive && state.imageSrc && /* @__PURE__ */ jsxs18(Fragment5, { children: [
|
|
7865
|
-
/* @__PURE__ */ jsx36(
|
|
7866
|
-
Select,
|
|
7867
|
-
{
|
|
7868
|
-
label: "Size",
|
|
7869
|
-
tooltip: "Size",
|
|
7870
|
-
value: state.logoSize,
|
|
7871
|
-
options: allowedLogoSize.map((size) => ({
|
|
7872
|
-
value: size,
|
|
7873
|
-
label: size
|
|
7874
|
-
})),
|
|
7875
|
-
onValueChange: (value) => {
|
|
7876
|
-
editor == null ? void 0 : editor.chain().focus().setLogoAttributes({ size: value }).run();
|
|
7877
|
-
}
|
|
7878
|
-
}
|
|
7879
|
-
),
|
|
7880
|
-
/* @__PURE__ */ jsx36(Divider, {})
|
|
7881
|
-
] }),
|
|
7882
|
-
/* @__PURE__ */ jsxs18("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
7883
|
-
/* @__PURE__ */ jsx36(
|
|
7884
|
-
AlignmentSwitch,
|
|
7885
|
-
{
|
|
7886
|
-
alignment: state.alignment,
|
|
7887
|
-
onAlignmentChange: (alignment) => {
|
|
7888
|
-
const isCurrentNodeImage = state.isImageActive;
|
|
7889
|
-
if (!isCurrentNodeImage) {
|
|
7890
|
-
editor == null ? void 0 : editor.chain().focus().setLogoAttributes({ alignment }).run();
|
|
7891
|
-
} else {
|
|
7892
|
-
editor == null ? void 0 : editor.chain().focus().updateAttributes("image", { alignment }).run();
|
|
7893
|
-
}
|
|
7894
|
-
}
|
|
7895
|
-
}
|
|
7896
|
-
),
|
|
7897
|
-
/* @__PURE__ */ jsx36(
|
|
7898
|
-
LinkInputPopover,
|
|
7899
|
-
{
|
|
7900
|
-
defaultValue: (_a = state == null ? void 0 : state.imageSrc) != null ? _a : "",
|
|
7901
|
-
onValueChange: (value, isVariable) => {
|
|
7902
|
-
if (state.isLogoActive) {
|
|
7903
|
-
editor == null ? void 0 : editor.chain().setLogoAttributes({
|
|
7904
|
-
src: value,
|
|
7905
|
-
isSrcVariable: isVariable != null ? isVariable : false
|
|
7906
|
-
}).run();
|
|
7907
|
-
} else {
|
|
7908
|
-
editor == null ? void 0 : editor.chain().updateAttributes("image", {
|
|
7909
|
-
src: value,
|
|
7910
|
-
isSrcVariable: isVariable != null ? isVariable : false
|
|
7911
|
-
}).run();
|
|
7912
|
-
}
|
|
7913
|
-
},
|
|
7914
|
-
tooltip: "Source URL",
|
|
7915
|
-
icon: ImageDown,
|
|
7916
|
-
editor,
|
|
7917
|
-
isVariable: state.isSrcVariable
|
|
7918
|
-
}
|
|
7919
|
-
),
|
|
7920
|
-
state.isImageActive && /* @__PURE__ */ jsx36(
|
|
7921
|
-
LinkInputPopover,
|
|
7922
|
-
{
|
|
7923
|
-
defaultValue: (_b = state == null ? void 0 : state.imageExternalLink) != null ? _b : "",
|
|
7924
|
-
onValueChange: (value, isVariable) => {
|
|
7925
|
-
editor == null ? void 0 : editor.chain().updateAttributes("image", {
|
|
7926
|
-
externalLink: value,
|
|
7927
|
-
isExternalLinkVariable: isVariable != null ? isVariable : false
|
|
7928
|
-
}).run();
|
|
7929
|
-
},
|
|
7930
|
-
tooltip: "External URL",
|
|
7931
|
-
editor,
|
|
7932
|
-
isVariable: state.isExternalLinkVariable
|
|
7933
|
-
}
|
|
7934
|
-
)
|
|
7935
|
-
] }),
|
|
7936
|
-
state.isImageActive && state.imageSrc && /* @__PURE__ */ jsxs18(Fragment5, { children: [
|
|
7937
|
-
/* @__PURE__ */ jsx36(Divider, {}),
|
|
7938
|
-
/* @__PURE__ */ jsx36(
|
|
7939
|
-
Select,
|
|
7940
|
-
{
|
|
7941
|
-
label: "Border Radius",
|
|
7942
|
-
value: state == null ? void 0 : state.borderRadius,
|
|
7943
|
-
options: borderRadius.map((value) => ({
|
|
7944
|
-
value: String(value.value),
|
|
7945
|
-
label: value.name
|
|
7946
|
-
})),
|
|
7947
|
-
onValueChange: (value) => {
|
|
7948
|
-
editor == null ? void 0 : editor.chain().updateAttributes("image", {
|
|
7949
|
-
borderRadius: Number(value)
|
|
7950
|
-
}).run();
|
|
7951
|
-
},
|
|
7952
|
-
tooltip: "Border Radius",
|
|
7953
|
-
className: "mly:capitalize"
|
|
7954
|
-
}
|
|
7955
|
-
),
|
|
7956
|
-
/* @__PURE__ */ jsxs18("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
7957
|
-
/* @__PURE__ */ jsx36(
|
|
7958
|
-
ImageSize,
|
|
7959
|
-
{
|
|
7960
|
-
dimension: "width",
|
|
7961
|
-
value: (_c = state == null ? void 0 : state.width) != null ? _c : "",
|
|
7962
|
-
onValueChange: (value) => {
|
|
7963
|
-
const width = Math.min(Number(value) || 0, IMAGE_MAX_WIDTH);
|
|
7964
|
-
const currentHeight = Number(state.height) || 0;
|
|
7965
|
-
const currentWidth = Number(state.width) || 0;
|
|
7966
|
-
const currentAspectRatio = state.aspectRatio || currentWidth / currentHeight || 1;
|
|
7967
|
-
editor == null ? void 0 : editor.chain().updateAttributes("image", __spreadValues({
|
|
7968
|
-
width: String(width)
|
|
7969
|
-
}, lockAspectRatio && value ? {
|
|
7970
|
-
height: String(
|
|
7971
|
-
getNewHeight(width, currentAspectRatio)
|
|
7972
|
-
)
|
|
7973
|
-
} : {})).run();
|
|
7974
|
-
}
|
|
7975
|
-
}
|
|
7976
|
-
),
|
|
7977
|
-
/* @__PURE__ */ jsx36(
|
|
7978
|
-
ImageSize,
|
|
7979
|
-
{
|
|
7980
|
-
dimension: "height",
|
|
7981
|
-
value: (_d = state == null ? void 0 : state.height) != null ? _d : "",
|
|
7982
|
-
onValueChange: (value) => {
|
|
7983
|
-
const height = Number(value) || 0;
|
|
7984
|
-
const currentHeight = Number(state.height) || 0;
|
|
7985
|
-
const currentWidth = Number(state.width) || 0;
|
|
7986
|
-
const currentAspectRatio = state.aspectRatio || currentWidth / currentHeight || 1;
|
|
7987
|
-
editor == null ? void 0 : editor.chain().updateAttributes("image", __spreadValues({
|
|
7988
|
-
height: String(height)
|
|
7989
|
-
}, lockAspectRatio && value ? {
|
|
7990
|
-
width: String(
|
|
7991
|
-
getNewWidth(height, currentAspectRatio)
|
|
7992
|
-
)
|
|
7993
|
-
} : {})).run();
|
|
7994
|
-
}
|
|
7995
|
-
}
|
|
7996
|
-
),
|
|
7997
|
-
/* @__PURE__ */ jsx36(
|
|
7998
|
-
BubbleMenuButton,
|
|
7999
|
-
{
|
|
8000
|
-
isActive: () => lockAspectRatio,
|
|
8001
|
-
command: () => {
|
|
8002
|
-
const width = Number(state.width) || 0;
|
|
8003
|
-
const height = Number(state.height) || 0;
|
|
8004
|
-
const aspectRatio = width / height;
|
|
8005
|
-
editor == null ? void 0 : editor.chain().updateAttributes("image", {
|
|
8006
|
-
lockAspectRatio: !lockAspectRatio,
|
|
8007
|
-
aspectRatio
|
|
8008
|
-
}).run();
|
|
8009
|
-
},
|
|
8010
|
-
icon: lockAspectRatio ? LockIcon : LockOpenIcon,
|
|
8011
|
-
tooltip: "Lock Aspect Ratio"
|
|
8145
|
+
}
|
|
8146
|
+
)
|
|
8147
|
+
] })
|
|
8148
|
+
] })
|
|
8012
8149
|
}
|
|
8013
8150
|
)
|
|
8014
|
-
|
|
8015
|
-
|
|
8016
|
-
]
|
|
8017
|
-
}
|
|
8151
|
+
}
|
|
8152
|
+
)
|
|
8153
|
+
]
|
|
8154
|
+
}
|
|
8018
8155
|
);
|
|
8019
8156
|
}
|
|
8020
8157
|
|
|
8021
|
-
// src/editor/components/inline-image-menu/inline-image-bubble-menu.tsx
|
|
8022
|
-
import { BubbleMenu as BubbleMenu3 } from "@tiptap/react";
|
|
8023
|
-
import { sticky as sticky3 } from "tippy.js";
|
|
8024
|
-
|
|
8025
|
-
// src/editor/nodes/inline-image/inline-image.tsx
|
|
8026
|
-
import { mergeAttributes as mergeAttributes4, Node as Node5 } from "@tiptap/core";
|
|
8027
|
-
import { PluginKey as PluginKey4, Plugin as Plugin3 } from "@tiptap/pm/state";
|
|
8028
|
-
var DEFAULT_INLINE_IMAGE_HEIGHT = 20;
|
|
8029
|
-
var DEFAULT_INLINE_IMAGE_WIDTH = 20;
|
|
8030
|
-
var InlineImageExtension = Node5.create({
|
|
8031
|
-
name: "inlineImage",
|
|
8032
|
-
inline: true,
|
|
8033
|
-
group: "inline",
|
|
8034
|
-
selectable: false,
|
|
8035
|
-
addOptions() {
|
|
8036
|
-
return {
|
|
8037
|
-
HTMLAttributes: {}
|
|
8038
|
-
};
|
|
8039
|
-
},
|
|
8040
|
-
addAttributes() {
|
|
8041
|
-
return {
|
|
8042
|
-
height: {
|
|
8043
|
-
default: DEFAULT_INLINE_IMAGE_HEIGHT
|
|
8044
|
-
},
|
|
8045
|
-
width: {
|
|
8046
|
-
default: DEFAULT_INLINE_IMAGE_WIDTH
|
|
8047
|
-
},
|
|
8048
|
-
src: {
|
|
8049
|
-
default: null
|
|
8050
|
-
},
|
|
8051
|
-
isSrcVariable: {
|
|
8052
|
-
default: false,
|
|
8053
|
-
renderHTML(attributes) {
|
|
8054
|
-
if (!attributes.isSrcVariable) {
|
|
8055
|
-
return {};
|
|
8056
|
-
}
|
|
8057
|
-
return {
|
|
8058
|
-
"data-is-src-variable": "true"
|
|
8059
|
-
};
|
|
8060
|
-
}
|
|
8061
|
-
},
|
|
8062
|
-
alt: {
|
|
8063
|
-
default: null
|
|
8064
|
-
},
|
|
8065
|
-
title: {
|
|
8066
|
-
default: null
|
|
8067
|
-
},
|
|
8068
|
-
externalLink: {
|
|
8069
|
-
default: null,
|
|
8070
|
-
renderHTML(attributes) {
|
|
8071
|
-
if (!attributes.externalLink) {
|
|
8072
|
-
return {};
|
|
8073
|
-
}
|
|
8074
|
-
return {
|
|
8075
|
-
"data-external-link": attributes.externalLink
|
|
8076
|
-
};
|
|
8077
|
-
}
|
|
8078
|
-
},
|
|
8079
|
-
isExternalLinkVariable: {
|
|
8080
|
-
default: false,
|
|
8081
|
-
renderHTML(attributes) {
|
|
8082
|
-
if (!attributes.isExternalLinkVariable) {
|
|
8083
|
-
return {};
|
|
8084
|
-
}
|
|
8085
|
-
return {
|
|
8086
|
-
"data-is-external-link-variable": "true"
|
|
8087
|
-
};
|
|
8088
|
-
}
|
|
8089
|
-
}
|
|
8090
|
-
};
|
|
8091
|
-
},
|
|
8092
|
-
parseHTML() {
|
|
8093
|
-
return [
|
|
8094
|
-
{
|
|
8095
|
-
tag: `img[data-type="${this.name}"]`
|
|
8096
|
-
}
|
|
8097
|
-
];
|
|
8098
|
-
},
|
|
8099
|
-
renderHTML({ HTMLAttributes: HTMLAttributes2 }) {
|
|
8100
|
-
const attrs = mergeAttributes4(this.options.HTMLAttributes, HTMLAttributes2, {
|
|
8101
|
-
"data-type": this.name,
|
|
8102
|
-
class: "mly:relative",
|
|
8103
|
-
style: `display: inline; --mly-inline-image-height: ${HTMLAttributes2.height}px; --mly-inline-image-width: ${HTMLAttributes2.width}px; margin:0; vertical-align: middle;`,
|
|
8104
|
-
draggable: "false",
|
|
8105
|
-
loading: "lazy"
|
|
8106
|
-
});
|
|
8107
|
-
return ["img", attrs];
|
|
8108
|
-
},
|
|
8109
|
-
addCommands() {
|
|
8110
|
-
return {
|
|
8111
|
-
setInlineImage: (options) => ({ commands }) => {
|
|
8112
|
-
return commands.insertContent({
|
|
8113
|
-
type: this.name,
|
|
8114
|
-
attrs: options
|
|
8115
|
-
});
|
|
8116
|
-
}
|
|
8117
|
-
};
|
|
8118
|
-
},
|
|
8119
|
-
addProseMirrorPlugins() {
|
|
8120
|
-
return [
|
|
8121
|
-
new Plugin3({
|
|
8122
|
-
key: new PluginKey4("inlineImage"),
|
|
8123
|
-
props: {
|
|
8124
|
-
handleClickOn: (_, pos, node) => {
|
|
8125
|
-
if (node.type !== this.type) {
|
|
8126
|
-
return false;
|
|
8127
|
-
}
|
|
8128
|
-
const from = pos;
|
|
8129
|
-
const to = pos + node.nodeSize;
|
|
8130
|
-
this.editor.commands.setTextSelection({ from, to });
|
|
8131
|
-
return true;
|
|
8132
|
-
}
|
|
8133
|
-
}
|
|
8134
|
-
})
|
|
8135
|
-
];
|
|
8136
|
-
}
|
|
8137
|
-
});
|
|
8138
|
-
|
|
8139
|
-
// src/editor/components/inline-image-menu/use-inline-image-state.tsx
|
|
8140
|
-
import { useEditorState as useEditorState3 } from "@tiptap/react";
|
|
8141
|
-
import deepEql3 from "fast-deep-equal";
|
|
8142
|
-
var useInlineImageState = (editor) => {
|
|
8143
|
-
const states = useEditorState3({
|
|
8144
|
-
editor,
|
|
8145
|
-
selector: ({ editor: editor2 }) => {
|
|
8146
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
8147
|
-
return {
|
|
8148
|
-
height: ((_a = editor2.getAttributes("inlineImage")) == null ? void 0 : _a.height) || DEFAULT_INLINE_IMAGE_HEIGHT,
|
|
8149
|
-
width: ((_b = editor2.getAttributes("inlineImage")) == null ? void 0 : _b.width) || DEFAULT_INLINE_IMAGE_WIDTH,
|
|
8150
|
-
src: ((_c = editor2.getAttributes("inlineImage")) == null ? void 0 : _c.src) || "",
|
|
8151
|
-
isSrcVariable: (_e = (_d = editor2.getAttributes("inlineImage")) == null ? void 0 : _d.isSrcVariable) != null ? _e : false,
|
|
8152
|
-
imageExternalLink: ((_f = editor2.getAttributes("inlineImage")) == null ? void 0 : _f.externalLink) || "",
|
|
8153
|
-
isExternalLinkVariable: (_h = (_g = editor2.getAttributes("inlineImage")) == null ? void 0 : _g.isExternalLinkVariable) != null ? _h : false
|
|
8154
|
-
};
|
|
8155
|
-
},
|
|
8156
|
-
equalityFn: deepEql3
|
|
8157
|
-
});
|
|
8158
|
-
return states;
|
|
8159
|
-
};
|
|
8160
|
-
|
|
8161
8158
|
// src/editor/components/inline-image-menu/inline-image-bubble-menu.tsx
|
|
8162
8159
|
import { ImageDownIcon } from "lucide-react";
|
|
8163
|
-
import { jsx as
|
|
8160
|
+
import { jsx as jsx38, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
8164
8161
|
function InlineImageBubbleMenu(props) {
|
|
8165
8162
|
var _a, _b;
|
|
8166
8163
|
const { editor, appendTo } = props;
|
|
@@ -8184,12 +8181,12 @@ function InlineImageBubbleMenu(props) {
|
|
|
8184
8181
|
maxWidth: "100%"
|
|
8185
8182
|
}
|
|
8186
8183
|
});
|
|
8187
|
-
return /* @__PURE__ */
|
|
8188
|
-
|
|
8184
|
+
return /* @__PURE__ */ jsx38(
|
|
8185
|
+
BubbleMenu4,
|
|
8189
8186
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
8190
8187
|
className: "mly:flex mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:p-0.5 mly:shadow-md",
|
|
8191
|
-
children: /* @__PURE__ */
|
|
8192
|
-
/* @__PURE__ */
|
|
8188
|
+
children: /* @__PURE__ */ jsx38(TooltipProvider, { children: /* @__PURE__ */ jsxs19("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
8189
|
+
/* @__PURE__ */ jsx38(
|
|
8193
8190
|
LinkInputPopover,
|
|
8194
8191
|
{
|
|
8195
8192
|
defaultValue: (_a = state == null ? void 0 : state.src) != null ? _a : "",
|
|
@@ -8205,7 +8202,7 @@ function InlineImageBubbleMenu(props) {
|
|
|
8205
8202
|
isVariable: state.isSrcVariable
|
|
8206
8203
|
}
|
|
8207
8204
|
),
|
|
8208
|
-
/* @__PURE__ */
|
|
8205
|
+
/* @__PURE__ */ jsx38(
|
|
8209
8206
|
LinkInputPopover,
|
|
8210
8207
|
{
|
|
8211
8208
|
defaultValue: (_b = state == null ? void 0 : state.imageExternalLink) != null ? _b : "",
|
|
@@ -8220,7 +8217,7 @@ function InlineImageBubbleMenu(props) {
|
|
|
8220
8217
|
isVariable: state.isExternalLinkVariable
|
|
8221
8218
|
}
|
|
8222
8219
|
),
|
|
8223
|
-
/* @__PURE__ */
|
|
8220
|
+
/* @__PURE__ */ jsx38(
|
|
8224
8221
|
ImageSize,
|
|
8225
8222
|
{
|
|
8226
8223
|
dimension: "height",
|
|
@@ -8239,9 +8236,9 @@ function InlineImageBubbleMenu(props) {
|
|
|
8239
8236
|
}
|
|
8240
8237
|
|
|
8241
8238
|
// src/editor/components/repeat-menu/repeat-bubble-menu.tsx
|
|
8242
|
-
import { BubbleMenu as
|
|
8239
|
+
import { BubbleMenu as BubbleMenu5, findChildren } from "@tiptap/react";
|
|
8243
8240
|
import { InfoIcon as InfoIcon2 } from "lucide-react";
|
|
8244
|
-
import { useCallback as useCallback7, useMemo as
|
|
8241
|
+
import { useCallback as useCallback7, useMemo as useMemo8, useRef as useRef8, useState as useState8 } from "react";
|
|
8245
8242
|
import { sticky as sticky4 } from "tippy.js";
|
|
8246
8243
|
|
|
8247
8244
|
// src/editor/components/repeat-menu/use-repeat-state.ts
|
|
@@ -8264,7 +8261,7 @@ var useRepeatState = (editor) => {
|
|
|
8264
8261
|
};
|
|
8265
8262
|
|
|
8266
8263
|
// src/editor/components/repeat-menu/repeat-bubble-menu.tsx
|
|
8267
|
-
import { jsx as
|
|
8264
|
+
import { jsx as jsx39, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
8268
8265
|
function RepeatBubbleMenu(props) {
|
|
8269
8266
|
const { appendTo, editor } = props;
|
|
8270
8267
|
if (!editor) {
|
|
@@ -8308,7 +8305,7 @@ function RepeatBubbleMenu(props) {
|
|
|
8308
8305
|
const inputRef = useRef8(null);
|
|
8309
8306
|
const [isUpdatingKey, setIsUpdatingKey] = useState8(false);
|
|
8310
8307
|
const eachKey = (state == null ? void 0 : state.each) || "";
|
|
8311
|
-
const autoCompleteOptions =
|
|
8308
|
+
const autoCompleteOptions = useMemo8(() => {
|
|
8312
8309
|
return processVariables(variables, {
|
|
8313
8310
|
query: eachKey || "",
|
|
8314
8311
|
editor,
|
|
@@ -8316,21 +8313,21 @@ function RepeatBubbleMenu(props) {
|
|
|
8316
8313
|
}).map((variable) => variable.name);
|
|
8317
8314
|
}, [variables, eachKey, editor]);
|
|
8318
8315
|
const isValidEachKey = eachKey;
|
|
8319
|
-
return /* @__PURE__ */
|
|
8320
|
-
|
|
8316
|
+
return /* @__PURE__ */ jsx39(
|
|
8317
|
+
BubbleMenu5,
|
|
8321
8318
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
8322
8319
|
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",
|
|
8323
8320
|
children: /* @__PURE__ */ jsxs20(TooltipProvider, { children: [
|
|
8324
8321
|
/* @__PURE__ */ jsxs20("div", { className: "mly:flex mly:items-center mly:gap-1.5 mly:px-1.5 mly:text-sm mly:leading-none", children: [
|
|
8325
8322
|
"Repeat",
|
|
8326
8323
|
/* @__PURE__ */ jsxs20(Tooltip, { children: [
|
|
8327
|
-
/* @__PURE__ */
|
|
8324
|
+
/* @__PURE__ */ jsx39(TooltipTrigger, { children: /* @__PURE__ */ jsx39(
|
|
8328
8325
|
InfoIcon2,
|
|
8329
8326
|
{
|
|
8330
8327
|
className: cn("mly:size-3 mly:stroke-[2.5] mly:text-gray-500")
|
|
8331
8328
|
}
|
|
8332
8329
|
) }),
|
|
8333
|
-
/* @__PURE__ */
|
|
8330
|
+
/* @__PURE__ */ jsx39(
|
|
8334
8331
|
TooltipContent,
|
|
8335
8332
|
{
|
|
8336
8333
|
sideOffset: 14,
|
|
@@ -8341,7 +8338,7 @@ function RepeatBubbleMenu(props) {
|
|
|
8341
8338
|
)
|
|
8342
8339
|
] })
|
|
8343
8340
|
] }),
|
|
8344
|
-
!isUpdatingKey && /* @__PURE__ */
|
|
8341
|
+
!isUpdatingKey && /* @__PURE__ */ jsx39(
|
|
8345
8342
|
"button",
|
|
8346
8343
|
{
|
|
8347
8344
|
onClick: () => {
|
|
@@ -8362,7 +8359,7 @@ function RepeatBubbleMenu(props) {
|
|
|
8362
8359
|
})
|
|
8363
8360
|
}
|
|
8364
8361
|
),
|
|
8365
|
-
isUpdatingKey && /* @__PURE__ */
|
|
8362
|
+
isUpdatingKey && /* @__PURE__ */ jsx39(
|
|
8366
8363
|
"form",
|
|
8367
8364
|
{
|
|
8368
8365
|
onSubmit: (e) => {
|
|
@@ -8374,7 +8371,7 @@ function RepeatBubbleMenu(props) {
|
|
|
8374
8371
|
setIsUpdatingKey(false);
|
|
8375
8372
|
}
|
|
8376
8373
|
},
|
|
8377
|
-
children: /* @__PURE__ */
|
|
8374
|
+
children: /* @__PURE__ */ jsx39(
|
|
8378
8375
|
InputAutocomplete,
|
|
8379
8376
|
{
|
|
8380
8377
|
editor,
|
|
@@ -8400,8 +8397,8 @@ function RepeatBubbleMenu(props) {
|
|
|
8400
8397
|
)
|
|
8401
8398
|
}
|
|
8402
8399
|
),
|
|
8403
|
-
/* @__PURE__ */
|
|
8404
|
-
/* @__PURE__ */
|
|
8400
|
+
/* @__PURE__ */ jsx39(Divider, {}),
|
|
8401
|
+
/* @__PURE__ */ jsx39(
|
|
8405
8402
|
ShowPopover,
|
|
8406
8403
|
{
|
|
8407
8404
|
showIfKey: state.currentShowIfKey,
|
|
@@ -8419,13 +8416,13 @@ function RepeatBubbleMenu(props) {
|
|
|
8419
8416
|
}
|
|
8420
8417
|
|
|
8421
8418
|
// src/editor/components/section-menu/section-bubble-menu.tsx
|
|
8422
|
-
import { BubbleMenu as
|
|
8419
|
+
import { BubbleMenu as BubbleMenu6, findChildren as findChildren2 } from "@tiptap/react";
|
|
8423
8420
|
import { ChevronUp, Trash as Trash3 } from "lucide-react";
|
|
8424
8421
|
import { useCallback as useCallback8 } from "react";
|
|
8425
8422
|
import { sticky as sticky5 } from "tippy.js";
|
|
8426
8423
|
|
|
8427
8424
|
// src/editor/components/icons/border-color.tsx
|
|
8428
|
-
import { jsx as
|
|
8425
|
+
import { jsx as jsx40, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
8429
8426
|
function BorderColor(props) {
|
|
8430
8427
|
const _a = props, { topBarClassName } = _a, rest = __objRest(_a, ["topBarClassName"]);
|
|
8431
8428
|
return /* @__PURE__ */ jsxs21(
|
|
@@ -8438,8 +8435,8 @@ function BorderColor(props) {
|
|
|
8438
8435
|
xmlns: "http://www.w3.org/2000/svg"
|
|
8439
8436
|
}, rest), {
|
|
8440
8437
|
children: [
|
|
8441
|
-
/* @__PURE__ */
|
|
8442
|
-
/* @__PURE__ */
|
|
8438
|
+
/* @__PURE__ */ jsx40("path", { d: "M0 11H10.6667", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
8439
|
+
/* @__PURE__ */ jsx40(
|
|
8443
8440
|
"path",
|
|
8444
8441
|
{
|
|
8445
8442
|
d: "M0.666504 9V6.33333C0.666504 3.38781 3.05432 1 5.99984 1H10.6665",
|
|
@@ -8453,9 +8450,9 @@ function BorderColor(props) {
|
|
|
8453
8450
|
}
|
|
8454
8451
|
|
|
8455
8452
|
// src/editor/components/icons/margin-icon.tsx
|
|
8456
|
-
import { jsx as
|
|
8453
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
8457
8454
|
function MarginIcon(props) {
|
|
8458
|
-
return /* @__PURE__ */
|
|
8455
|
+
return /* @__PURE__ */ jsx41(
|
|
8459
8456
|
"svg",
|
|
8460
8457
|
__spreadProps(__spreadValues({
|
|
8461
8458
|
width: 12,
|
|
@@ -8464,7 +8461,7 @@ function MarginIcon(props) {
|
|
|
8464
8461
|
fill: "none",
|
|
8465
8462
|
xmlns: "http://www.w3.org/2000/svg"
|
|
8466
8463
|
}, props), {
|
|
8467
|
-
children: /* @__PURE__ */
|
|
8464
|
+
children: /* @__PURE__ */ jsx41(
|
|
8468
8465
|
"path",
|
|
8469
8466
|
{
|
|
8470
8467
|
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",
|
|
@@ -8478,9 +8475,9 @@ function MarginIcon(props) {
|
|
|
8478
8475
|
}
|
|
8479
8476
|
|
|
8480
8477
|
// src/editor/components/icons/padding-icon.tsx
|
|
8481
|
-
import { jsx as
|
|
8478
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
8482
8479
|
function PaddingIcon(props) {
|
|
8483
|
-
return /* @__PURE__ */
|
|
8480
|
+
return /* @__PURE__ */ jsx42(
|
|
8484
8481
|
"svg",
|
|
8485
8482
|
__spreadProps(__spreadValues({
|
|
8486
8483
|
width: 10,
|
|
@@ -8489,7 +8486,7 @@ function PaddingIcon(props) {
|
|
|
8489
8486
|
fill: "none",
|
|
8490
8487
|
xmlns: "http://www.w3.org/2000/svg"
|
|
8491
8488
|
}, props), {
|
|
8492
|
-
children: /* @__PURE__ */
|
|
8489
|
+
children: /* @__PURE__ */ jsx42(
|
|
8493
8490
|
"path",
|
|
8494
8491
|
{
|
|
8495
8492
|
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",
|
|
@@ -8504,7 +8501,7 @@ function PaddingIcon(props) {
|
|
|
8504
8501
|
|
|
8505
8502
|
// src/editor/components/ui/color-picker.tsx
|
|
8506
8503
|
import { HexColorPicker, HexColorInput } from "react-colorful";
|
|
8507
|
-
import { jsx as
|
|
8504
|
+
import { jsx as jsx43, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
8508
8505
|
function ColorPicker(props) {
|
|
8509
8506
|
const {
|
|
8510
8507
|
color,
|
|
@@ -8522,14 +8519,14 @@ function ColorPicker(props) {
|
|
|
8522
8519
|
onColorChange(color2);
|
|
8523
8520
|
});
|
|
8524
8521
|
};
|
|
8525
|
-
const popoverButton = /* @__PURE__ */
|
|
8522
|
+
const popoverButton = /* @__PURE__ */ jsx43(PopoverTrigger, { asChild: true, children: children || /* @__PURE__ */ jsx43(
|
|
8526
8523
|
BaseButton,
|
|
8527
8524
|
{
|
|
8528
8525
|
variant: "ghost",
|
|
8529
|
-
className: "mly:h-7 mly:w-7 mly:shrink-0",
|
|
8526
|
+
className: "menu-option mly:h-7 mly:w-7 mly:shrink-0",
|
|
8530
8527
|
size: "sm",
|
|
8531
8528
|
type: "button",
|
|
8532
|
-
children: /* @__PURE__ */
|
|
8529
|
+
children: /* @__PURE__ */ jsx43(
|
|
8533
8530
|
"div",
|
|
8534
8531
|
{
|
|
8535
8532
|
className: cn(
|
|
@@ -8553,8 +8550,8 @@ function ColorPicker(props) {
|
|
|
8553
8550
|
},
|
|
8554
8551
|
children: [
|
|
8555
8552
|
tooltip ? /* @__PURE__ */ jsxs22(Tooltip, { children: [
|
|
8556
|
-
/* @__PURE__ */
|
|
8557
|
-
/* @__PURE__ */
|
|
8553
|
+
/* @__PURE__ */ jsx43(TooltipTrigger, { asChild: true, children: popoverButton }),
|
|
8554
|
+
/* @__PURE__ */ jsx43(
|
|
8558
8555
|
TooltipContent,
|
|
8559
8556
|
{
|
|
8560
8557
|
sideOffset: 8,
|
|
@@ -8563,13 +8560,13 @@ function ColorPicker(props) {
|
|
|
8563
8560
|
}
|
|
8564
8561
|
)
|
|
8565
8562
|
] }) : popoverButton,
|
|
8566
|
-
/* @__PURE__ */
|
|
8563
|
+
/* @__PURE__ */ jsx43(
|
|
8567
8564
|
PopoverContent,
|
|
8568
8565
|
{
|
|
8569
|
-
className: "mly:w-full mly:rounded-none mly:border-0 mly:bg-transparent! mly:p-0! mly:shadow-none mly:drop-shadow-md",
|
|
8566
|
+
className: "menu-color-popover mly:w-full mly:rounded-none mly:border-0 mly:bg-transparent! mly:p-0! mly:shadow-none mly:drop-shadow-md",
|
|
8570
8567
|
sideOffset: 8,
|
|
8571
|
-
children: /* @__PURE__ */ jsxs22("div", { className: "mly:min-w-[260px] mly:rounded-xl mly:border mly:border-gray-200 mly:bg-white mly:p-4", children: [
|
|
8572
|
-
/* @__PURE__ */
|
|
8568
|
+
children: /* @__PURE__ */ jsxs22("div", { className: "menu-color-panel mly:min-w-[260px] mly:rounded-xl mly:border mly:border-gray-200 mly:bg-white mly:p-4", children: [
|
|
8569
|
+
/* @__PURE__ */ jsx43(
|
|
8573
8570
|
HexColorPicker,
|
|
8574
8571
|
{
|
|
8575
8572
|
color,
|
|
@@ -8577,20 +8574,20 @@ function ColorPicker(props) {
|
|
|
8577
8574
|
className: "mly:flex mly:w-full! mly:flex-col mly:gap-4"
|
|
8578
8575
|
}
|
|
8579
8576
|
),
|
|
8580
|
-
/* @__PURE__ */
|
|
8577
|
+
/* @__PURE__ */ jsx43(
|
|
8581
8578
|
HexColorInput,
|
|
8582
8579
|
{
|
|
8583
8580
|
alpha: true,
|
|
8584
8581
|
color,
|
|
8585
8582
|
onChange: handleColorChange,
|
|
8586
|
-
className: "mly:mt-4 mly:w-full mly:min-w-0 mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:px-2 mly:py-1.5 mly:text-sm mly:uppercase mly:focus-visible:border-gray-400 mly:focus-visible:outline-hidden",
|
|
8583
|
+
className: "menu-color-hex-input mly:mt-4 mly:w-full mly:min-w-0 mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:px-2 mly:py-1.5 mly:text-sm mly:uppercase mly:focus-visible:border-gray-400 mly:focus-visible:outline-hidden",
|
|
8587
8584
|
prefixed: true
|
|
8588
8585
|
}
|
|
8589
8586
|
),
|
|
8590
8587
|
suggestedColors.length > 0 && /* @__PURE__ */ jsxs22("div", { children: [
|
|
8591
|
-
/* @__PURE__ */
|
|
8592
|
-
/* @__PURE__ */
|
|
8593
|
-
/* @__PURE__ */
|
|
8588
|
+
/* @__PURE__ */ jsx43("div", { className: "-mly:mx-4 mly:my-4 mly:h-px mly:bg-gray-200" }),
|
|
8589
|
+
/* @__PURE__ */ jsx43("h2", { className: "mly:text-xs mly:text-gray-500", children: "Recently used" }),
|
|
8590
|
+
/* @__PURE__ */ jsx43("div", { className: "mly:mt-2 mly:flex mly:flex-wrap mly:gap-0.5", children: suggestedColors.map((suggestedColor) => /* @__PURE__ */ jsx43(
|
|
8594
8591
|
BaseButton,
|
|
8595
8592
|
{
|
|
8596
8593
|
variant: "ghost",
|
|
@@ -8598,7 +8595,7 @@ function ColorPicker(props) {
|
|
|
8598
8595
|
className: "!mly:size-7 mly:shrink-0",
|
|
8599
8596
|
type: "button",
|
|
8600
8597
|
onClick: () => handleColorChange(suggestedColor),
|
|
8601
|
-
children: /* @__PURE__ */
|
|
8598
|
+
children: /* @__PURE__ */ jsx43(
|
|
8602
8599
|
"div",
|
|
8603
8600
|
{
|
|
8604
8601
|
className: "mly:h-4 mly:w-4 mly:shrink-0 mly:rounded",
|
|
@@ -8651,7 +8648,7 @@ var useSectionState = (editor) => {
|
|
|
8651
8648
|
};
|
|
8652
8649
|
|
|
8653
8650
|
// src/editor/components/section-menu/section-bubble-menu.tsx
|
|
8654
|
-
import { Fragment as Fragment6, jsx as
|
|
8651
|
+
import { Fragment as Fragment6, jsx as jsx44, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
8655
8652
|
function SectionBubbleMenu(props) {
|
|
8656
8653
|
const { appendTo, editor } = props;
|
|
8657
8654
|
if (!editor) {
|
|
@@ -8698,12 +8695,12 @@ function SectionBubbleMenu(props) {
|
|
|
8698
8695
|
{ value: "6", label: "Smooth" },
|
|
8699
8696
|
{ value: "9999", label: "Round" }
|
|
8700
8697
|
];
|
|
8701
|
-
return /* @__PURE__ */
|
|
8702
|
-
|
|
8698
|
+
return /* @__PURE__ */ jsx44(
|
|
8699
|
+
BubbleMenu6,
|
|
8703
8700
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
8704
|
-
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",
|
|
8701
|
+
className: "menu-surface menu-inline-gap mly:flex mly:items-stretch mly:rounded-lg mly:border mly:border-gray-200 mly:bg-white mly:p-0.5 mly:shadow-md",
|
|
8705
8702
|
children: /* @__PURE__ */ jsxs23(TooltipProvider, { children: [
|
|
8706
|
-
/* @__PURE__ */
|
|
8703
|
+
/* @__PURE__ */ jsx44(
|
|
8707
8704
|
AlignmentSwitch,
|
|
8708
8705
|
{
|
|
8709
8706
|
alignment: state.currentAlignment,
|
|
@@ -8715,9 +8712,9 @@ function SectionBubbleMenu(props) {
|
|
|
8715
8712
|
}
|
|
8716
8713
|
}
|
|
8717
8714
|
),
|
|
8718
|
-
/* @__PURE__ */
|
|
8719
|
-
/* @__PURE__ */ jsxs23("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
8720
|
-
/* @__PURE__ */
|
|
8715
|
+
/* @__PURE__ */ jsx44(Divider, {}),
|
|
8716
|
+
/* @__PURE__ */ jsxs23("div", { className: "menu-inline-gap mly:flex mly:gap-x-0.5", children: [
|
|
8717
|
+
/* @__PURE__ */ jsx44(
|
|
8721
8718
|
Select,
|
|
8722
8719
|
{
|
|
8723
8720
|
label: "Border Radius",
|
|
@@ -8733,7 +8730,7 @@ function SectionBubbleMenu(props) {
|
|
|
8733
8730
|
className: "mly:capitalize"
|
|
8734
8731
|
}
|
|
8735
8732
|
),
|
|
8736
|
-
/* @__PURE__ */
|
|
8733
|
+
/* @__PURE__ */ jsx44(
|
|
8737
8734
|
Select,
|
|
8738
8735
|
{
|
|
8739
8736
|
label: "Border Width",
|
|
@@ -8755,8 +8752,8 @@ function SectionBubbleMenu(props) {
|
|
|
8755
8752
|
}
|
|
8756
8753
|
)
|
|
8757
8754
|
] }),
|
|
8758
|
-
/* @__PURE__ */
|
|
8759
|
-
/* @__PURE__ */
|
|
8755
|
+
/* @__PURE__ */ jsx44(Divider, {}),
|
|
8756
|
+
/* @__PURE__ */ jsx44(
|
|
8760
8757
|
Select,
|
|
8761
8758
|
{
|
|
8762
8759
|
icon: MarginIcon,
|
|
@@ -8784,8 +8781,8 @@ function SectionBubbleMenu(props) {
|
|
|
8784
8781
|
className: "mly:capitalize"
|
|
8785
8782
|
}
|
|
8786
8783
|
),
|
|
8787
|
-
/* @__PURE__ */
|
|
8788
|
-
/* @__PURE__ */
|
|
8784
|
+
/* @__PURE__ */ jsx44(Divider, {}),
|
|
8785
|
+
/* @__PURE__ */ jsx44(
|
|
8789
8786
|
Select,
|
|
8790
8787
|
{
|
|
8791
8788
|
icon: PaddingIcon,
|
|
@@ -8813,9 +8810,9 @@ function SectionBubbleMenu(props) {
|
|
|
8813
8810
|
className: "mly:capitalize"
|
|
8814
8811
|
}
|
|
8815
8812
|
),
|
|
8816
|
-
/* @__PURE__ */
|
|
8817
|
-
/* @__PURE__ */ jsxs23("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
8818
|
-
/* @__PURE__ */
|
|
8813
|
+
/* @__PURE__ */ jsx44(Divider, {}),
|
|
8814
|
+
/* @__PURE__ */ jsxs23("div", { className: "menu-inline-gap mly:flex mly:gap-x-0.5", children: [
|
|
8815
|
+
/* @__PURE__ */ jsx44(
|
|
8819
8816
|
ColorPicker,
|
|
8820
8817
|
{
|
|
8821
8818
|
color: state.currentBorderColor,
|
|
@@ -8826,14 +8823,14 @@ function SectionBubbleMenu(props) {
|
|
|
8826
8823
|
});
|
|
8827
8824
|
},
|
|
8828
8825
|
tooltip: "Border Color",
|
|
8829
|
-
children: /* @__PURE__ */
|
|
8826
|
+
children: /* @__PURE__ */ jsx44(
|
|
8830
8827
|
BaseButton,
|
|
8831
8828
|
{
|
|
8832
8829
|
variant: "ghost",
|
|
8833
|
-
className: "mly:h-7 mly:w-7 mly:shrink-0",
|
|
8830
|
+
className: "menu-option mly:h-7 mly:w-7 mly:shrink-0",
|
|
8834
8831
|
size: "sm",
|
|
8835
8832
|
type: "button",
|
|
8836
|
-
children: /* @__PURE__ */
|
|
8833
|
+
children: /* @__PURE__ */ jsx44(
|
|
8837
8834
|
BorderColor,
|
|
8838
8835
|
{
|
|
8839
8836
|
className: "mly:size-3 mly:shrink-0",
|
|
@@ -8847,7 +8844,7 @@ function SectionBubbleMenu(props) {
|
|
|
8847
8844
|
)
|
|
8848
8845
|
}
|
|
8849
8846
|
),
|
|
8850
|
-
/* @__PURE__ */
|
|
8847
|
+
/* @__PURE__ */ jsx44(
|
|
8851
8848
|
ColorPicker,
|
|
8852
8849
|
{
|
|
8853
8850
|
color: state.currentBackgroundColor,
|
|
@@ -8863,8 +8860,8 @@ function SectionBubbleMenu(props) {
|
|
|
8863
8860
|
}
|
|
8864
8861
|
)
|
|
8865
8862
|
] }),
|
|
8866
|
-
/* @__PURE__ */
|
|
8867
|
-
/* @__PURE__ */
|
|
8863
|
+
/* @__PURE__ */ jsx44(Divider, {}),
|
|
8864
|
+
/* @__PURE__ */ jsx44(
|
|
8868
8865
|
BubbleMenuButton,
|
|
8869
8866
|
{
|
|
8870
8867
|
icon: Trash3,
|
|
@@ -8875,16 +8872,16 @@ function SectionBubbleMenu(props) {
|
|
|
8875
8872
|
}
|
|
8876
8873
|
),
|
|
8877
8874
|
state.isColumnsActive && /* @__PURE__ */ jsxs23(Fragment6, { children: [
|
|
8878
|
-
/* @__PURE__ */
|
|
8875
|
+
/* @__PURE__ */ jsx44(Divider, {}),
|
|
8879
8876
|
/* @__PURE__ */ jsxs23(Popover, { children: [
|
|
8880
|
-
/* @__PURE__ */ jsxs23(PopoverTrigger, { className: "mly:flex mly:items-center mly:gap-1 mly:rounded-md mly:px-1.5 mly:text-sm mly:data-[state=open]:bg-soft-gray mly:hover:bg-soft-gray", children: [
|
|
8877
|
+
/* @__PURE__ */ jsxs23(PopoverTrigger, { className: "menu-option 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: [
|
|
8881
8878
|
"Column",
|
|
8882
|
-
/* @__PURE__ */
|
|
8879
|
+
/* @__PURE__ */ jsx44(ChevronUp, { className: "mly:h-3 mly:w-3" })
|
|
8883
8880
|
] }),
|
|
8884
|
-
/* @__PURE__ */
|
|
8881
|
+
/* @__PURE__ */ jsx44(
|
|
8885
8882
|
PopoverContent,
|
|
8886
8883
|
{
|
|
8887
|
-
className: "mly:w-max mly:rounded-lg mly:p-0.5!",
|
|
8884
|
+
className: "menu-dropdown-surface mly:w-max mly:rounded-lg mly:p-0.5!",
|
|
8888
8885
|
side: "top",
|
|
8889
8886
|
sideOffset: 8,
|
|
8890
8887
|
align: "end",
|
|
@@ -8894,7 +8891,7 @@ function SectionBubbleMenu(props) {
|
|
|
8894
8891
|
onCloseAutoFocus: (e) => {
|
|
8895
8892
|
e.preventDefault();
|
|
8896
8893
|
},
|
|
8897
|
-
children: /* @__PURE__ */
|
|
8894
|
+
children: /* @__PURE__ */ jsx44(ColumnsBubbleMenuContent, { editor })
|
|
8898
8895
|
}
|
|
8899
8896
|
)
|
|
8900
8897
|
] })
|
|
@@ -8905,7 +8902,7 @@ function SectionBubbleMenu(props) {
|
|
|
8905
8902
|
}
|
|
8906
8903
|
|
|
8907
8904
|
// src/editor/components/spacer-menu/spacer-bubble-menu.tsx
|
|
8908
|
-
import { BubbleMenu as
|
|
8905
|
+
import { BubbleMenu as BubbleMenu7 } from "@tiptap/react";
|
|
8909
8906
|
|
|
8910
8907
|
// src/editor/components/spacer-menu/use-spacer-state.ts
|
|
8911
8908
|
import { useEditorState as useEditorState6 } from "@tiptap/react";
|
|
@@ -8925,14 +8922,14 @@ var useSpacerState = (editor) => {
|
|
|
8925
8922
|
};
|
|
8926
8923
|
|
|
8927
8924
|
// src/editor/components/spacer-menu/spacer-bubble-menu.tsx
|
|
8928
|
-
import { useMemo as
|
|
8929
|
-
import { jsx as
|
|
8925
|
+
import { useMemo as useMemo9 } from "react";
|
|
8926
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
8930
8927
|
function SpacerBubbleMenu(props) {
|
|
8931
8928
|
const { editor, appendTo } = props;
|
|
8932
8929
|
if (!editor) {
|
|
8933
8930
|
return null;
|
|
8934
8931
|
}
|
|
8935
|
-
const items =
|
|
8932
|
+
const items = useMemo9(
|
|
8936
8933
|
() => spacing.map((space) => {
|
|
8937
8934
|
const { value: height, short: name } = space;
|
|
8938
8935
|
return {
|
|
@@ -8958,11 +8955,11 @@ function SpacerBubbleMenu(props) {
|
|
|
8958
8955
|
}
|
|
8959
8956
|
});
|
|
8960
8957
|
const state = useSpacerState(editor);
|
|
8961
|
-
return /* @__PURE__ */
|
|
8962
|
-
|
|
8958
|
+
return /* @__PURE__ */ jsx45(
|
|
8959
|
+
BubbleMenu7,
|
|
8963
8960
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
8964
|
-
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",
|
|
8965
|
-
children: /* @__PURE__ */
|
|
8961
|
+
className: "menu-surface 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",
|
|
8962
|
+
children: /* @__PURE__ */ jsx45(TooltipProvider, { children: items.map((item, index) => /* @__PURE__ */ jsx45(
|
|
8966
8963
|
BubbleMenuButton,
|
|
8967
8964
|
__spreadValues({
|
|
8968
8965
|
className: "!mly:h-7 mly:w-7 mly:shrink-0 mly:p-0",
|
|
@@ -9086,6 +9083,17 @@ var ColumnsExtension = Node6.create({
|
|
|
9086
9083
|
import { InputRule } from "@tiptap/core";
|
|
9087
9084
|
import { HorizontalRule as TipTapHorizontalRule } from "@tiptap/extension-horizontal-rule";
|
|
9088
9085
|
var HorizontalRule = TipTapHorizontalRule.extend({
|
|
9086
|
+
addAttributes() {
|
|
9087
|
+
return {
|
|
9088
|
+
size: {
|
|
9089
|
+
default: 32,
|
|
9090
|
+
parseHTML: (element) => Number(element.getAttribute("data-size") || 32),
|
|
9091
|
+
renderHTML: (attributes) => ({
|
|
9092
|
+
"data-size": attributes.size
|
|
9093
|
+
})
|
|
9094
|
+
}
|
|
9095
|
+
};
|
|
9096
|
+
},
|
|
9089
9097
|
addInputRules() {
|
|
9090
9098
|
return [
|
|
9091
9099
|
new InputRule({
|
|
@@ -9106,7 +9114,7 @@ var HorizontalRule = TipTapHorizontalRule.extend({
|
|
|
9106
9114
|
addOptions() {
|
|
9107
9115
|
return {
|
|
9108
9116
|
HTMLAttributes: {
|
|
9109
|
-
class: "mly:relative"
|
|
9117
|
+
class: "mly:relative mly-divider-node"
|
|
9110
9118
|
}
|
|
9111
9119
|
};
|
|
9112
9120
|
}
|
|
@@ -9203,11 +9211,11 @@ import { NodeViewWrapper as NodeViewWrapper4 } from "@tiptap/react";
|
|
|
9203
9211
|
|
|
9204
9212
|
// src/editor/components/input.tsx
|
|
9205
9213
|
import * as React5 from "react";
|
|
9206
|
-
import { jsx as
|
|
9214
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
9207
9215
|
var Input = React5.forwardRef(
|
|
9208
9216
|
(_a, ref) => {
|
|
9209
9217
|
var _b = _a, { className, type } = _b, props = __objRest(_b, ["className", "type"]);
|
|
9210
|
-
return /* @__PURE__ */
|
|
9218
|
+
return /* @__PURE__ */ jsx46(
|
|
9211
9219
|
"input",
|
|
9212
9220
|
__spreadValues(__spreadProps(__spreadValues({}, AUTOCOMPLETE_PASSWORD_MANAGERS_OFF), {
|
|
9213
9221
|
type,
|
|
@@ -9225,11 +9233,11 @@ Input.displayName = "Input";
|
|
|
9225
9233
|
|
|
9226
9234
|
// src/editor/components/textarea.tsx
|
|
9227
9235
|
import * as React6 from "react";
|
|
9228
|
-
import { jsx as
|
|
9236
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
9229
9237
|
var Textarea = React6.forwardRef(
|
|
9230
9238
|
(_a, ref) => {
|
|
9231
9239
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
9232
|
-
return /* @__PURE__ */
|
|
9240
|
+
return /* @__PURE__ */ jsx47(
|
|
9233
9241
|
"textarea",
|
|
9234
9242
|
__spreadValues({
|
|
9235
9243
|
className: cn(
|
|
@@ -9245,18 +9253,18 @@ var Textarea = React6.forwardRef(
|
|
|
9245
9253
|
Textarea.displayName = "Textarea";
|
|
9246
9254
|
|
|
9247
9255
|
// src/editor/nodes/link-card.tsx
|
|
9248
|
-
import { jsx as
|
|
9256
|
+
import { jsx as jsx48, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
9249
9257
|
function LinkCardComponent(props) {
|
|
9250
9258
|
const { title, description, link, linkTitle, image: image2, badgeText, subTitle } = props.node.attrs;
|
|
9251
9259
|
const { getPos, editor } = props;
|
|
9252
|
-
return /* @__PURE__ */
|
|
9260
|
+
return /* @__PURE__ */ jsx48(
|
|
9253
9261
|
NodeViewWrapper4,
|
|
9254
9262
|
{
|
|
9255
9263
|
className: `react-component ${props.selected && "ProseMirror-selectednode"}`,
|
|
9256
9264
|
draggable: editor.isEditable,
|
|
9257
9265
|
"data-drag-handle": editor.isEditable,
|
|
9258
9266
|
children: /* @__PURE__ */ jsxs24(Popover, { open: props.selected, children: [
|
|
9259
|
-
/* @__PURE__ */
|
|
9267
|
+
/* @__PURE__ */ jsx48(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx48(
|
|
9260
9268
|
"div",
|
|
9261
9269
|
{
|
|
9262
9270
|
tabIndex: -1,
|
|
@@ -9266,7 +9274,7 @@ function LinkCardComponent(props) {
|
|
|
9266
9274
|
editor.commands.setNodeSelection(pos);
|
|
9267
9275
|
},
|
|
9268
9276
|
children: /* @__PURE__ */ jsxs24("div", { className: "mly:no-prose mly:flex mly:flex-col mly:rounded-lg mly:border mly:border-gray-300", children: [
|
|
9269
|
-
image2 && /* @__PURE__ */
|
|
9277
|
+
image2 && /* @__PURE__ */ jsx48("div", { className: "mly:relative mly:mb-1.5 mly:w-full mly:shrink-0", children: /* @__PURE__ */ jsx48(
|
|
9270
9278
|
"img",
|
|
9271
9279
|
{
|
|
9272
9280
|
src: image2,
|
|
@@ -9275,17 +9283,17 @@ function LinkCardComponent(props) {
|
|
|
9275
9283
|
draggable: editor.isEditable
|
|
9276
9284
|
}
|
|
9277
9285
|
) }),
|
|
9278
|
-
/* @__PURE__ */
|
|
9286
|
+
/* @__PURE__ */ jsx48("div", { className: "mly:flex mly:items-stretch mly:p-3", children: /* @__PURE__ */ jsxs24("div", { className: cn("mly:flex mly:flex-col"), children: [
|
|
9279
9287
|
/* @__PURE__ */ jsxs24("div", { className: "!mly:mb-1.5 mly:flex mly:items-center mly:gap-1.5", children: [
|
|
9280
|
-
/* @__PURE__ */
|
|
9281
|
-
badgeText && /* @__PURE__ */
|
|
9288
|
+
/* @__PURE__ */ jsx48("h2", { className: "!mly:mb-0 mly:text-lg! mly:font-semibold", children: title }),
|
|
9289
|
+
badgeText && /* @__PURE__ */ jsx48("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 }),
|
|
9282
9290
|
" ",
|
|
9283
|
-
subTitle && !badgeText && /* @__PURE__ */
|
|
9291
|
+
subTitle && !badgeText && /* @__PURE__ */ jsx48("span", { className: "!mly:font-base mly:font-regular mly:rounded-md mly:leading-none mly:text-gray-400 text-xs", children: subTitle })
|
|
9284
9292
|
] }),
|
|
9285
9293
|
/* @__PURE__ */ jsxs24("p", { className: "!mly:my-0 mly:text-base! mly:text-gray-500", children: [
|
|
9286
9294
|
description,
|
|
9287
9295
|
" ",
|
|
9288
|
-
linkTitle ? /* @__PURE__ */
|
|
9296
|
+
linkTitle ? /* @__PURE__ */ jsx48("a", { href: link, className: "mly:font-semibold", children: linkTitle }) : null
|
|
9289
9297
|
] })
|
|
9290
9298
|
] }) })
|
|
9291
9299
|
] })
|
|
@@ -9301,8 +9309,8 @@ function LinkCardComponent(props) {
|
|
|
9301
9309
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
9302
9310
|
children: [
|
|
9303
9311
|
/* @__PURE__ */ jsxs24("label", { className: "mly:w-full mly:space-y-1", children: [
|
|
9304
|
-
/* @__PURE__ */
|
|
9305
|
-
/* @__PURE__ */
|
|
9312
|
+
/* @__PURE__ */ jsx48("span", { className: "mly:text-xs mly:font-normal mly:text-slate-400", children: "Image" }),
|
|
9313
|
+
/* @__PURE__ */ jsx48(
|
|
9306
9314
|
Input,
|
|
9307
9315
|
{
|
|
9308
9316
|
placeholder: "Add Image",
|
|
@@ -9317,8 +9325,8 @@ function LinkCardComponent(props) {
|
|
|
9317
9325
|
)
|
|
9318
9326
|
] }),
|
|
9319
9327
|
/* @__PURE__ */ jsxs24("label", { className: "mly:w-full mly:space-y-1", children: [
|
|
9320
|
-
/* @__PURE__ */
|
|
9321
|
-
/* @__PURE__ */
|
|
9328
|
+
/* @__PURE__ */ jsx48("span", { className: "mly:text-xs mly:font-normal mly:text-slate-400", children: "Title" }),
|
|
9329
|
+
/* @__PURE__ */ jsx48(
|
|
9322
9330
|
Input,
|
|
9323
9331
|
{
|
|
9324
9332
|
placeholder: "Add title",
|
|
@@ -9332,8 +9340,8 @@ function LinkCardComponent(props) {
|
|
|
9332
9340
|
)
|
|
9333
9341
|
] }),
|
|
9334
9342
|
/* @__PURE__ */ jsxs24("label", { className: "mly:w-full mly:space-y-1", children: [
|
|
9335
|
-
/* @__PURE__ */
|
|
9336
|
-
/* @__PURE__ */
|
|
9343
|
+
/* @__PURE__ */ jsx48("span", { className: "mly:text-xs mly:font-normal mly:text-slate-400", children: "Description" }),
|
|
9344
|
+
/* @__PURE__ */ jsx48(
|
|
9337
9345
|
Textarea,
|
|
9338
9346
|
{
|
|
9339
9347
|
placeholder: "Add description here",
|
|
@@ -9348,8 +9356,8 @@ function LinkCardComponent(props) {
|
|
|
9348
9356
|
] }),
|
|
9349
9357
|
/* @__PURE__ */ jsxs24("div", { className: "mly:grid mly:grid-cols-2 mly:gap-2", children: [
|
|
9350
9358
|
/* @__PURE__ */ jsxs24("label", { className: "mly:w-full mly:space-y-1", children: [
|
|
9351
|
-
/* @__PURE__ */
|
|
9352
|
-
/* @__PURE__ */
|
|
9359
|
+
/* @__PURE__ */ jsx48("span", { className: "mly:text-xs mly:font-normal mly:text-slate-400", children: "Link Title" }),
|
|
9360
|
+
/* @__PURE__ */ jsx48(
|
|
9353
9361
|
Input,
|
|
9354
9362
|
{
|
|
9355
9363
|
placeholder: "Add link title here",
|
|
@@ -9363,8 +9371,8 @@ function LinkCardComponent(props) {
|
|
|
9363
9371
|
)
|
|
9364
9372
|
] }),
|
|
9365
9373
|
/* @__PURE__ */ jsxs24("label", { className: "mly:w-full mly:space-y-1", children: [
|
|
9366
|
-
/* @__PURE__ */
|
|
9367
|
-
/* @__PURE__ */
|
|
9374
|
+
/* @__PURE__ */ jsx48("span", { className: "mly:text-xs mly:font-normal mly:text-slate-400", children: "Link" }),
|
|
9375
|
+
/* @__PURE__ */ jsx48(
|
|
9368
9376
|
Input,
|
|
9369
9377
|
{
|
|
9370
9378
|
placeholder: "Add link here",
|
|
@@ -9380,8 +9388,8 @@ function LinkCardComponent(props) {
|
|
|
9380
9388
|
] }),
|
|
9381
9389
|
/* @__PURE__ */ jsxs24("div", { className: "mly:grid mly:grid-cols-2 mly:gap-2", children: [
|
|
9382
9390
|
/* @__PURE__ */ jsxs24("label", { className: "mly:w-full mly:space-y-1", children: [
|
|
9383
|
-
/* @__PURE__ */
|
|
9384
|
-
/* @__PURE__ */
|
|
9391
|
+
/* @__PURE__ */ jsx48("span", { className: "mly:text-xs mly:font-normal mly:text-slate-400", children: "Badge Text" }),
|
|
9392
|
+
/* @__PURE__ */ jsx48(
|
|
9385
9393
|
Input,
|
|
9386
9394
|
{
|
|
9387
9395
|
placeholder: "Add badge text here",
|
|
@@ -9395,8 +9403,8 @@ function LinkCardComponent(props) {
|
|
|
9395
9403
|
)
|
|
9396
9404
|
] }),
|
|
9397
9405
|
/* @__PURE__ */ jsxs24("label", { className: "mly:w-full mly:space-y-1", children: [
|
|
9398
|
-
/* @__PURE__ */
|
|
9399
|
-
/* @__PURE__ */
|
|
9406
|
+
/* @__PURE__ */ jsx48("span", { className: "mly:text-xs mly:font-normal mly:text-slate-400", children: "Sub Title" }),
|
|
9407
|
+
/* @__PURE__ */ jsx48(
|
|
9400
9408
|
Input,
|
|
9401
9409
|
{
|
|
9402
9410
|
placeholder: "Add sub title here",
|
|
@@ -9495,11 +9503,12 @@ import { ReactNodeViewRenderer as ReactNodeViewRenderer4 } from "@tiptap/react";
|
|
|
9495
9503
|
|
|
9496
9504
|
// src/editor/nodes/button/button-view.tsx
|
|
9497
9505
|
import { NodeViewWrapper as NodeViewWrapper5 } from "@tiptap/react";
|
|
9498
|
-
import {
|
|
9506
|
+
import { AlignCenter as AlignCenter3, AlignLeft as AlignLeft3, AlignRight as AlignRight3 } from "lucide-react";
|
|
9507
|
+
import { useMemo as useMemo11 } from "react";
|
|
9499
9508
|
|
|
9500
9509
|
// src/editor/nodes/button/button-label-input.tsx
|
|
9501
|
-
import { useMemo as
|
|
9502
|
-
import { jsx as
|
|
9510
|
+
import { useMemo as useMemo10, useRef as useRef9, useState as useState9 } from "react";
|
|
9511
|
+
import { jsx as jsx49, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
9503
9512
|
function ButtonLabelInput(props) {
|
|
9504
9513
|
var _a, _b;
|
|
9505
9514
|
const { value, onValueChange, isVariable, editor } = props;
|
|
@@ -9510,7 +9519,7 @@ function ButtonLabelInput(props) {
|
|
|
9510
9519
|
const variables = otps == null ? void 0 : otps.variables;
|
|
9511
9520
|
const variableTriggerCharacter = (_b = (_a = otps == null ? void 0 : otps.suggestion) == null ? void 0 : _a.char) != null ? _b : DEFAULT_VARIABLE_TRIGGER_CHAR;
|
|
9512
9521
|
const renderVariable = otps == null ? void 0 : otps.renderVariable;
|
|
9513
|
-
const autoCompleteOptions =
|
|
9522
|
+
const autoCompleteOptions = useMemo10(() => {
|
|
9514
9523
|
const withoutTrigger = value.replace(
|
|
9515
9524
|
new RegExp(variableTriggerCharacter, "g"),
|
|
9516
9525
|
""
|
|
@@ -9522,7 +9531,7 @@ function ButtonLabelInput(props) {
|
|
|
9522
9531
|
}).map((variable) => variable.name);
|
|
9523
9532
|
}, [variables, value, editor]);
|
|
9524
9533
|
return /* @__PURE__ */ jsxs25("div", { className: "mly:isolate mly:flex mly:items-center mly:rounded-lg", children: [
|
|
9525
|
-
!isEditing && /* @__PURE__ */
|
|
9534
|
+
!isEditing && /* @__PURE__ */ jsx49(
|
|
9526
9535
|
"button",
|
|
9527
9536
|
{
|
|
9528
9537
|
onClick: () => {
|
|
@@ -9543,7 +9552,7 @@ function ButtonLabelInput(props) {
|
|
|
9543
9552
|
})
|
|
9544
9553
|
}
|
|
9545
9554
|
),
|
|
9546
|
-
isEditing && /* @__PURE__ */
|
|
9555
|
+
isEditing && /* @__PURE__ */ jsx49(
|
|
9547
9556
|
InputAutocomplete,
|
|
9548
9557
|
{
|
|
9549
9558
|
editor,
|
|
@@ -9554,7 +9563,7 @@ function ButtonLabelInput(props) {
|
|
|
9554
9563
|
autoCompleteOptions,
|
|
9555
9564
|
ref: linkInputRef,
|
|
9556
9565
|
placeholder: placeholderUrl,
|
|
9557
|
-
className: "mly:h-7 mly:w-40 mly:rounded-md mly:px-2 mly:pr-6 mly:text-sm mly:text-midnight-gray mly:hover:bg-soft-gray mly:focus:bg-soft-gray mly:focus:outline-hidden",
|
|
9566
|
+
className: "menu-option mly:h-7 mly:w-40 mly:rounded-md mly:px-2 mly:pr-6 mly:text-sm mly:text-midnight-gray mly:hover:bg-soft-gray mly:focus:bg-soft-gray mly:focus:outline-hidden",
|
|
9558
9567
|
triggerChar: variableTriggerCharacter,
|
|
9559
9568
|
onSelectOption: (value2) => {
|
|
9560
9569
|
var _a2;
|
|
@@ -9570,7 +9579,7 @@ function ButtonLabelInput(props) {
|
|
|
9570
9579
|
}
|
|
9571
9580
|
|
|
9572
9581
|
// src/editor/nodes/button/button-view.tsx
|
|
9573
|
-
import { jsx as
|
|
9582
|
+
import { jsx as jsx50, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
9574
9583
|
function ButtonView(props) {
|
|
9575
9584
|
const { node, editor, getPos, updateAttributes: updateAttributes2 } = props;
|
|
9576
9585
|
const {
|
|
@@ -9579,6 +9588,7 @@ function ButtonView(props) {
|
|
|
9579
9588
|
alignment,
|
|
9580
9589
|
variant,
|
|
9581
9590
|
borderRadius: _radius,
|
|
9591
|
+
size: rawSize,
|
|
9582
9592
|
buttonColor,
|
|
9583
9593
|
textColor,
|
|
9584
9594
|
url: externalLink,
|
|
@@ -9590,7 +9600,7 @@ function ButtonView(props) {
|
|
|
9590
9600
|
} = node.attrs;
|
|
9591
9601
|
const opts = useVariableOptions(editor);
|
|
9592
9602
|
const renderVariable = opts == null ? void 0 : opts.renderVariable;
|
|
9593
|
-
const sizes =
|
|
9603
|
+
const sizes = useMemo11(
|
|
9594
9604
|
() => ({
|
|
9595
9605
|
small: {
|
|
9596
9606
|
paddingX: 24,
|
|
@@ -9607,13 +9617,16 @@ function ButtonView(props) {
|
|
|
9607
9617
|
}),
|
|
9608
9618
|
[]
|
|
9609
9619
|
);
|
|
9610
|
-
const size =
|
|
9620
|
+
const size = useMemo11(() => {
|
|
9611
9621
|
var _a;
|
|
9612
|
-
|
|
9622
|
+
if (allowedButtonSize.includes(rawSize)) {
|
|
9623
|
+
return rawSize;
|
|
9624
|
+
}
|
|
9625
|
+
return ((_a = Object.entries(sizes).find(
|
|
9613
9626
|
([, { paddingX, paddingY }]) => paddingRight === paddingX && paddingTop === paddingY
|
|
9614
|
-
)) == null ? void 0 : _a[0];
|
|
9615
|
-
}, [paddingRight, paddingTop, sizes]);
|
|
9616
|
-
return /* @__PURE__ */
|
|
9627
|
+
)) == null ? void 0 : _a[0]) || "medium";
|
|
9628
|
+
}, [rawSize, paddingRight, paddingTop, sizes]);
|
|
9629
|
+
return /* @__PURE__ */ jsx50(
|
|
9617
9630
|
NodeViewWrapper5,
|
|
9618
9631
|
{
|
|
9619
9632
|
draggable: editor.isEditable,
|
|
@@ -9623,7 +9636,7 @@ function ButtonView(props) {
|
|
|
9623
9636
|
textAlign: alignment
|
|
9624
9637
|
},
|
|
9625
9638
|
children: /* @__PURE__ */ jsxs26(Popover, { open: props.selected && editor.isEditable, children: [
|
|
9626
|
-
/* @__PURE__ */
|
|
9639
|
+
/* @__PURE__ */ jsx50(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx50("div", { children: /* @__PURE__ */ jsx50(
|
|
9627
9640
|
"button",
|
|
9628
9641
|
{
|
|
9629
9642
|
className: cn(
|
|
@@ -9666,17 +9679,17 @@ function ButtonView(props) {
|
|
|
9666
9679
|
}) : text2
|
|
9667
9680
|
}
|
|
9668
9681
|
) }) }),
|
|
9669
|
-
/* @__PURE__ */
|
|
9682
|
+
/* @__PURE__ */ jsx50(
|
|
9670
9683
|
PopoverContent,
|
|
9671
9684
|
{
|
|
9672
9685
|
align: "end",
|
|
9673
9686
|
side: "top",
|
|
9674
|
-
className: "mly:w-max mly:rounded-lg mly:p-0.5!",
|
|
9687
|
+
className: "menu-dropdown-surface button-menu-surface mly:w-max mly:rounded-lg mly:p-0.5!",
|
|
9675
9688
|
sideOffset: 8,
|
|
9676
9689
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
9677
9690
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
9678
|
-
children: /* @__PURE__ */
|
|
9679
|
-
/* @__PURE__ */
|
|
9691
|
+
children: /* @__PURE__ */ jsx50(TooltipProvider, { children: /* @__PURE__ */ jsxs26("div", { className: "menu-surface menu-inline-gap mly:flex mly:items-stretch mly:text-midnight-gray", children: [
|
|
9692
|
+
/* @__PURE__ */ jsx50(
|
|
9680
9693
|
ButtonLabelInput,
|
|
9681
9694
|
{
|
|
9682
9695
|
value: text2,
|
|
@@ -9690,9 +9703,9 @@ function ButtonView(props) {
|
|
|
9690
9703
|
editor
|
|
9691
9704
|
}
|
|
9692
9705
|
),
|
|
9693
|
-
/* @__PURE__ */
|
|
9694
|
-
/* @__PURE__ */ jsxs26("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
9695
|
-
/* @__PURE__ */
|
|
9706
|
+
/* @__PURE__ */ jsx50(Divider, {}),
|
|
9707
|
+
/* @__PURE__ */ jsxs26("div", { className: "menu-inline-gap mly:flex mly:gap-x-0.5", children: [
|
|
9708
|
+
/* @__PURE__ */ jsx50(
|
|
9696
9709
|
Select,
|
|
9697
9710
|
{
|
|
9698
9711
|
label: "Border Radius",
|
|
@@ -9710,7 +9723,7 @@ function ButtonView(props) {
|
|
|
9710
9723
|
className: "mly:capitalize"
|
|
9711
9724
|
}
|
|
9712
9725
|
),
|
|
9713
|
-
/* @__PURE__ */
|
|
9726
|
+
/* @__PURE__ */ jsx50(
|
|
9714
9727
|
Select,
|
|
9715
9728
|
{
|
|
9716
9729
|
label: "Style",
|
|
@@ -9728,7 +9741,7 @@ function ButtonView(props) {
|
|
|
9728
9741
|
className: "mly:capitalize"
|
|
9729
9742
|
}
|
|
9730
9743
|
),
|
|
9731
|
-
/* @__PURE__ */
|
|
9744
|
+
/* @__PURE__ */ jsx50(
|
|
9732
9745
|
Select,
|
|
9733
9746
|
{
|
|
9734
9747
|
label: "Size",
|
|
@@ -9741,6 +9754,7 @@ function ButtonView(props) {
|
|
|
9741
9754
|
onValueChange: (value) => {
|
|
9742
9755
|
const { paddingX, paddingY } = sizes[value];
|
|
9743
9756
|
updateAttributes2({
|
|
9757
|
+
size: value,
|
|
9744
9758
|
paddingTop: paddingY,
|
|
9745
9759
|
paddingRight: paddingX,
|
|
9746
9760
|
paddingBottom: paddingY,
|
|
@@ -9752,20 +9766,48 @@ function ButtonView(props) {
|
|
|
9752
9766
|
}
|
|
9753
9767
|
)
|
|
9754
9768
|
] }),
|
|
9755
|
-
/* @__PURE__ */
|
|
9756
|
-
/* @__PURE__ */ jsxs26("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
9757
|
-
/* @__PURE__ */
|
|
9758
|
-
|
|
9769
|
+
/* @__PURE__ */ jsx50(Divider, {}),
|
|
9770
|
+
/* @__PURE__ */ jsxs26("div", { className: "menu-inline-gap mly:flex mly:gap-x-0.5", children: [
|
|
9771
|
+
/* @__PURE__ */ jsx50(
|
|
9772
|
+
BubbleMenuButton,
|
|
9759
9773
|
{
|
|
9760
|
-
|
|
9761
|
-
|
|
9774
|
+
icon: AlignLeft3,
|
|
9775
|
+
tooltip: "Align Left",
|
|
9776
|
+
command: () => {
|
|
9762
9777
|
updateAttributes2({
|
|
9763
|
-
alignment:
|
|
9778
|
+
alignment: "left"
|
|
9764
9779
|
});
|
|
9765
|
-
}
|
|
9780
|
+
},
|
|
9781
|
+
isActive: () => alignment === "left"
|
|
9782
|
+
}
|
|
9783
|
+
),
|
|
9784
|
+
/* @__PURE__ */ jsx50(
|
|
9785
|
+
BubbleMenuButton,
|
|
9786
|
+
{
|
|
9787
|
+
icon: AlignCenter3,
|
|
9788
|
+
tooltip: "Align Center",
|
|
9789
|
+
command: () => {
|
|
9790
|
+
updateAttributes2({
|
|
9791
|
+
alignment: "center"
|
|
9792
|
+
});
|
|
9793
|
+
},
|
|
9794
|
+
isActive: () => alignment === "center"
|
|
9766
9795
|
}
|
|
9767
9796
|
),
|
|
9768
|
-
/* @__PURE__ */
|
|
9797
|
+
/* @__PURE__ */ jsx50(
|
|
9798
|
+
BubbleMenuButton,
|
|
9799
|
+
{
|
|
9800
|
+
icon: AlignRight3,
|
|
9801
|
+
tooltip: "Align Right",
|
|
9802
|
+
command: () => {
|
|
9803
|
+
updateAttributes2({
|
|
9804
|
+
alignment: "right"
|
|
9805
|
+
});
|
|
9806
|
+
},
|
|
9807
|
+
isActive: () => alignment === "right"
|
|
9808
|
+
}
|
|
9809
|
+
),
|
|
9810
|
+
/* @__PURE__ */ jsx50(
|
|
9769
9811
|
LinkInputPopover,
|
|
9770
9812
|
{
|
|
9771
9813
|
defaultValue: externalLink || "",
|
|
@@ -9781,13 +9823,13 @@ function ButtonView(props) {
|
|
|
9781
9823
|
}
|
|
9782
9824
|
)
|
|
9783
9825
|
] }),
|
|
9784
|
-
/* @__PURE__ */
|
|
9785
|
-
/* @__PURE__ */ jsxs26("div", { className: "mly:flex mly:gap-x-0.5", children: [
|
|
9786
|
-
/* @__PURE__ */
|
|
9826
|
+
/* @__PURE__ */ jsx50(Divider, {}),
|
|
9827
|
+
/* @__PURE__ */ jsxs26("div", { className: "menu-inline-gap mly:flex mly:gap-x-0.5", children: [
|
|
9828
|
+
/* @__PURE__ */ jsx50(
|
|
9787
9829
|
BackgroundColorPickerPopup,
|
|
9788
9830
|
{
|
|
9789
9831
|
variant,
|
|
9790
|
-
color: buttonColor ||
|
|
9832
|
+
color: buttonColor || DEFAULT_BUTTON_BACKGROUND_COLOR,
|
|
9791
9833
|
onChange: (color) => {
|
|
9792
9834
|
updateAttributes2({
|
|
9793
9835
|
buttonColor: color
|
|
@@ -9795,10 +9837,10 @@ function ButtonView(props) {
|
|
|
9795
9837
|
}
|
|
9796
9838
|
}
|
|
9797
9839
|
),
|
|
9798
|
-
/* @__PURE__ */
|
|
9840
|
+
/* @__PURE__ */ jsx50(
|
|
9799
9841
|
TextColorPickerPopup,
|
|
9800
9842
|
{
|
|
9801
|
-
color: textColor ||
|
|
9843
|
+
color: textColor || DEFAULT_BUTTON_TEXT_COLOR,
|
|
9802
9844
|
onChange: (color) => {
|
|
9803
9845
|
updateAttributes2({
|
|
9804
9846
|
textColor: color
|
|
@@ -9816,20 +9858,20 @@ function ButtonView(props) {
|
|
|
9816
9858
|
}
|
|
9817
9859
|
function BackgroundColorPickerPopup(props) {
|
|
9818
9860
|
const { color, onChange, variant } = props;
|
|
9819
|
-
return /* @__PURE__ */
|
|
9861
|
+
return /* @__PURE__ */ jsx50(
|
|
9820
9862
|
ColorPicker,
|
|
9821
9863
|
{
|
|
9822
9864
|
color,
|
|
9823
9865
|
onColorChange: onChange,
|
|
9824
9866
|
tooltip: "Background Color",
|
|
9825
|
-
children: /* @__PURE__ */
|
|
9867
|
+
children: /* @__PURE__ */ jsx50(
|
|
9826
9868
|
BaseButton,
|
|
9827
9869
|
{
|
|
9828
9870
|
variant: "ghost",
|
|
9829
9871
|
size: "sm",
|
|
9830
9872
|
type: "button",
|
|
9831
|
-
className: "mly:size-7",
|
|
9832
|
-
children: /* @__PURE__ */
|
|
9873
|
+
className: "menu-option mly:size-7",
|
|
9874
|
+
children: /* @__PURE__ */ jsx50(
|
|
9833
9875
|
"div",
|
|
9834
9876
|
{
|
|
9835
9877
|
className: "mly:h-4 mly:w-4 mly:shrink-0 mly:rounded-full mly:shadow",
|
|
@@ -9848,16 +9890,16 @@ function BackgroundColorPickerPopup(props) {
|
|
|
9848
9890
|
}
|
|
9849
9891
|
function TextColorPickerPopup(props) {
|
|
9850
9892
|
const { color, onChange } = props;
|
|
9851
|
-
return /* @__PURE__ */
|
|
9893
|
+
return /* @__PURE__ */ jsx50(ColorPicker, { color, onColorChange: onChange, tooltip: "Text Color", children: /* @__PURE__ */ jsx50(
|
|
9852
9894
|
BaseButton,
|
|
9853
9895
|
{
|
|
9854
9896
|
variant: "ghost",
|
|
9855
9897
|
size: "sm",
|
|
9856
9898
|
type: "button",
|
|
9857
|
-
className: "mly:size-7",
|
|
9899
|
+
className: "menu-option mly:size-7",
|
|
9858
9900
|
children: /* @__PURE__ */ jsxs26("div", { className: "mly:flex mly:flex-col mly:items-center mly:justify-center mly:gap-px", children: [
|
|
9859
|
-
/* @__PURE__ */
|
|
9860
|
-
/* @__PURE__ */
|
|
9901
|
+
/* @__PURE__ */ jsx50("span", { className: "mly:font-bolder mly:font-mono mly:text-xs mly:text-midnight-gray", children: "A" }),
|
|
9902
|
+
/* @__PURE__ */ jsx50(
|
|
9861
9903
|
"div",
|
|
9862
9904
|
{
|
|
9863
9905
|
className: "mly:h-[2px] mly:w-3 mly:shrink-0 mly:rounded-md mly:shadow",
|
|
@@ -9873,14 +9915,15 @@ function TextColorPickerPopup(props) {
|
|
|
9873
9915
|
var DEFAULT_BUTTON_ALIGNMENT = "left";
|
|
9874
9916
|
var DEFAULT_BUTTON_VARIANT = "filled";
|
|
9875
9917
|
var DEFAULT_BUTTON_BORDER_RADIUS = "smooth";
|
|
9876
|
-
var DEFAULT_BUTTON_BACKGROUND_COLOR =
|
|
9877
|
-
var DEFAULT_BUTTON_TEXT_COLOR =
|
|
9918
|
+
var DEFAULT_BUTTON_BACKGROUND_COLOR = "#000000";
|
|
9919
|
+
var DEFAULT_BUTTON_TEXT_COLOR = "#ffffff";
|
|
9878
9920
|
var DEFAULT_BUTTON_PADDING_TOP = null;
|
|
9879
9921
|
var DEFAULT_BUTTON_PADDING_RIGHT = null;
|
|
9880
9922
|
var DEFAULT_BUTTON_PADDING_BOTTOM = null;
|
|
9881
9923
|
var DEFAULT_BUTTON_PADDING_LEFT = null;
|
|
9882
9924
|
var allowedButtonVariant = ["filled", "outline"];
|
|
9883
9925
|
var allowedButtonBorderRadius = ["sharp", "smooth", "round"];
|
|
9926
|
+
var allowedButtonSize = ["small", "medium", "large"];
|
|
9884
9927
|
var ButtonExtension = Node9.create({
|
|
9885
9928
|
name: "button",
|
|
9886
9929
|
group: "block",
|
|
@@ -9974,6 +10017,18 @@ var ButtonExtension = Node9.create({
|
|
|
9974
10017
|
};
|
|
9975
10018
|
}
|
|
9976
10019
|
},
|
|
10020
|
+
size: {
|
|
10021
|
+
default: "medium",
|
|
10022
|
+
parseHTML: (element) => {
|
|
10023
|
+
const value = element.getAttribute("data-size");
|
|
10024
|
+
return allowedButtonSize.includes(value) ? value : "medium";
|
|
10025
|
+
},
|
|
10026
|
+
renderHTML: (attributes) => {
|
|
10027
|
+
return {
|
|
10028
|
+
"data-size": attributes.size
|
|
10029
|
+
};
|
|
10030
|
+
}
|
|
10031
|
+
},
|
|
9977
10032
|
showIfKey: {
|
|
9978
10033
|
default: DEFAULT_SECTION_SHOW_IF_KEY,
|
|
9979
10034
|
parseHTML: (element) => {
|
|
@@ -10016,7 +10071,10 @@ var ButtonExtension = Node9.create({
|
|
|
10016
10071
|
setButton: () => ({ commands }) => {
|
|
10017
10072
|
return commands.insertContent({
|
|
10018
10073
|
type: this.name,
|
|
10019
|
-
attrs: {
|
|
10074
|
+
attrs: {
|
|
10075
|
+
buttonColor: DEFAULT_BUTTON_BACKGROUND_COLOR,
|
|
10076
|
+
textColor: DEFAULT_BUTTON_TEXT_COLOR
|
|
10077
|
+
},
|
|
10020
10078
|
content: []
|
|
10021
10079
|
});
|
|
10022
10080
|
},
|
|
@@ -10188,18 +10246,18 @@ import { createLowlight, common } from "lowlight";
|
|
|
10188
10246
|
|
|
10189
10247
|
// src/editor/nodes/html/html-view.tsx
|
|
10190
10248
|
import { NodeViewContent, NodeViewWrapper as NodeViewWrapper6 } from "@tiptap/react";
|
|
10191
|
-
import { jsx as
|
|
10249
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
10192
10250
|
function HTMLCodeBlockView(props) {
|
|
10193
10251
|
const { node } = props;
|
|
10194
10252
|
const { language } = node.attrs;
|
|
10195
10253
|
const languageClass = language ? `language-${language}` : "";
|
|
10196
|
-
return /* @__PURE__ */
|
|
10254
|
+
return /* @__PURE__ */ jsx51(
|
|
10197
10255
|
NodeViewWrapper6,
|
|
10198
10256
|
{
|
|
10199
10257
|
draggable: false,
|
|
10200
10258
|
"data-drag-handle": false,
|
|
10201
10259
|
"data-type": "htmlCodeBlock",
|
|
10202
|
-
children: /* @__PURE__ */
|
|
10260
|
+
children: /* @__PURE__ */ jsx51("pre", { className: "mly-html-code-pre", children: /* @__PURE__ */ jsx51(
|
|
10203
10261
|
NodeViewContent,
|
|
10204
10262
|
{
|
|
10205
10263
|
as: "code",
|
|
@@ -10349,7 +10407,7 @@ import { ReactNodeViewRenderer as ReactNodeViewRenderer6 } from "@tiptap/react";
|
|
|
10349
10407
|
// src/editor/nodes/repeat/repeat-view.tsx
|
|
10350
10408
|
import { NodeViewWrapper as NodeViewWrapper7, NodeViewContent as NodeViewContent2 } from "@tiptap/react";
|
|
10351
10409
|
import { Repeat2 as Repeat22 } from "lucide-react";
|
|
10352
|
-
import { jsx as
|
|
10410
|
+
import { jsx as jsx52, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
10353
10411
|
function RepeatView(props) {
|
|
10354
10412
|
const { editor, getPos } = props;
|
|
10355
10413
|
return /* @__PURE__ */ jsxs27(
|
|
@@ -10360,7 +10418,7 @@ function RepeatView(props) {
|
|
|
10360
10418
|
"data-drag-handle": editor.isEditable,
|
|
10361
10419
|
className: "mly:relative",
|
|
10362
10420
|
children: [
|
|
10363
|
-
/* @__PURE__ */
|
|
10421
|
+
/* @__PURE__ */ jsx52(NodeViewContent2, { className: "is-editable" }),
|
|
10364
10422
|
/* @__PURE__ */ jsxs27(
|
|
10365
10423
|
"div",
|
|
10366
10424
|
{
|
|
@@ -10372,8 +10430,8 @@ function RepeatView(props) {
|
|
|
10372
10430
|
editor.commands.setNodeSelection(getPos());
|
|
10373
10431
|
},
|
|
10374
10432
|
children: [
|
|
10375
|
-
/* @__PURE__ */
|
|
10376
|
-
/* @__PURE__ */
|
|
10433
|
+
/* @__PURE__ */ jsx52(Repeat22, { className: "mly:size-3 mly:stroke-[2.5] mly:text-midnight-gray" }),
|
|
10434
|
+
/* @__PURE__ */ jsx52("div", { className: "mly:w-[1.5px] mly:grow mly:rounded-full mly:bg-rose-300" })
|
|
10377
10435
|
]
|
|
10378
10436
|
}
|
|
10379
10437
|
)
|
|
@@ -10630,7 +10688,7 @@ import tippy2 from "tippy.js";
|
|
|
10630
10688
|
// src/editor/extensions/slash-command/slash-command-item.tsx
|
|
10631
10689
|
import { ChevronRightIcon } from "lucide-react";
|
|
10632
10690
|
import { useCallback as useCallback9, useState as useState10, useRef as useRef10, useEffect as useEffect7 } from "react";
|
|
10633
|
-
import { Fragment as Fragment7, jsx as
|
|
10691
|
+
import { Fragment as Fragment7, jsx as jsx53, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
10634
10692
|
function SlashCommandItem(props) {
|
|
10635
10693
|
var _a;
|
|
10636
10694
|
const {
|
|
@@ -10654,12 +10712,12 @@ function SlashCommandItem(props) {
|
|
|
10654
10712
|
const hasRenderFunction = typeof item.render === "function";
|
|
10655
10713
|
const renderFunctionValue = hasRenderFunction ? (_a = item.render) == null ? void 0 : _a.call(item, editor) : null;
|
|
10656
10714
|
let value = /* @__PURE__ */ jsxs28(Fragment7, { children: [
|
|
10657
|
-
/* @__PURE__ */
|
|
10715
|
+
/* @__PURE__ */ jsx53("div", { className: "mly:flex mly:h-6 mly:w-6 mly:shrink-0 mly:items-center mly:justify-center", children: item.icon }),
|
|
10658
10716
|
/* @__PURE__ */ jsxs28("div", { className: "mly:grow", children: [
|
|
10659
|
-
/* @__PURE__ */
|
|
10660
|
-
/* @__PURE__ */
|
|
10717
|
+
/* @__PURE__ */ jsx53("p", { className: "mly:font-medium", children: item.title }),
|
|
10718
|
+
/* @__PURE__ */ jsx53("p", { className: "mly:text-xs mly:text-gray-400", children: item.description })
|
|
10661
10719
|
] }),
|
|
10662
|
-
isSubCommand2 && /* @__PURE__ */
|
|
10720
|
+
isSubCommand2 && /* @__PURE__ */ jsx53("span", { className: "mly:block mly:px-1 mly:text-gray-400", children: /* @__PURE__ */ jsx53(ChevronRightIcon, { className: "mly:size-3.5 mly:stroke-[2.5]" }) })
|
|
10663
10721
|
] });
|
|
10664
10722
|
if (renderFunctionValue !== null && renderFunctionValue !== true) {
|
|
10665
10723
|
value = renderFunctionValue;
|
|
@@ -10691,7 +10749,7 @@ function SlashCommandItem(props) {
|
|
|
10691
10749
|
};
|
|
10692
10750
|
}, []);
|
|
10693
10751
|
return /* @__PURE__ */ jsxs28(Tooltip, { open, children: [
|
|
10694
|
-
/* @__PURE__ */
|
|
10752
|
+
/* @__PURE__ */ jsx53(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx53(
|
|
10695
10753
|
"button",
|
|
10696
10754
|
{
|
|
10697
10755
|
className: cn(
|
|
@@ -10706,14 +10764,14 @@ function SlashCommandItem(props) {
|
|
|
10706
10764
|
children: value
|
|
10707
10765
|
}
|
|
10708
10766
|
) }),
|
|
10709
|
-
/* @__PURE__ */
|
|
10767
|
+
/* @__PURE__ */ jsx53(
|
|
10710
10768
|
TooltipContent,
|
|
10711
10769
|
{
|
|
10712
10770
|
side: "right",
|
|
10713
10771
|
sideOffset: 10,
|
|
10714
10772
|
className: "mly:w-52 mly:rounded-lg mly:border-none mly:p-1 mly:shadow",
|
|
10715
10773
|
children: typeof item.preview === "function" ? item == null ? void 0 : item.preview(editor) : /* @__PURE__ */ jsxs28(Fragment7, { children: [
|
|
10716
|
-
/* @__PURE__ */
|
|
10774
|
+
/* @__PURE__ */ jsx53("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__ */ jsx53(
|
|
10717
10775
|
"img",
|
|
10718
10776
|
{
|
|
10719
10777
|
src: item == null ? void 0 : item.preview,
|
|
@@ -10721,7 +10779,7 @@ function SlashCommandItem(props) {
|
|
|
10721
10779
|
className: "mly:absolute mly:inset-0 mly:h-full mly:w-full mly:object-cover"
|
|
10722
10780
|
}
|
|
10723
10781
|
) }),
|
|
10724
|
-
/* @__PURE__ */
|
|
10782
|
+
/* @__PURE__ */ jsx53("p", { className: "mly:mt-2 mly:px-0.5 mly:text-gray-500", children: item.description })
|
|
10725
10783
|
] })
|
|
10726
10784
|
}
|
|
10727
10785
|
)
|
|
@@ -10810,7 +10868,7 @@ function processCommand(options) {
|
|
|
10810
10868
|
}
|
|
10811
10869
|
|
|
10812
10870
|
// src/editor/extensions/slash-command/slash-command-view.tsx
|
|
10813
|
-
import { jsx as
|
|
10871
|
+
import { jsx as jsx54, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
10814
10872
|
var CommandList = forwardRef8((props, ref) => {
|
|
10815
10873
|
const { items: groups, command, editor, range, query } = props;
|
|
10816
10874
|
const [selectedGroupIndex, setSelectedGroupIndex] = useState11(0);
|
|
@@ -10948,15 +11006,15 @@ var CommandList = forwardRef8((props, ref) => {
|
|
|
10948
11006
|
if (!groups || groups.length === 0) {
|
|
10949
11007
|
return null;
|
|
10950
11008
|
}
|
|
10951
|
-
return /* @__PURE__ */
|
|
10952
|
-
/* @__PURE__ */
|
|
11009
|
+
return /* @__PURE__ */ jsx54(TooltipProvider, { children: /* @__PURE__ */ jsxs29("div", { className: "mly:z-50 mly:w-72 mly:overflow-hidden mly:rounded-md mly:border mly:border-gray-200 mly:bg-white mly:shadow-md mly:transition-all", children: [
|
|
11010
|
+
/* @__PURE__ */ jsx54(
|
|
10953
11011
|
"div",
|
|
10954
11012
|
{
|
|
10955
11013
|
id: "slash-command",
|
|
10956
11014
|
ref: commandListContainer,
|
|
10957
11015
|
className: "mly:no-scrollbar mly:h-auto mly:max-h-[330px] mly:overflow-y-auto",
|
|
10958
11016
|
children: groups.map((group, groupIndex) => /* @__PURE__ */ jsxs29(Fragment8, { children: [
|
|
10959
|
-
/* @__PURE__ */
|
|
11017
|
+
/* @__PURE__ */ jsx54(
|
|
10960
11018
|
"span",
|
|
10961
11019
|
{
|
|
10962
11020
|
className: cn(
|
|
@@ -10966,9 +11024,9 @@ var CommandList = forwardRef8((props, ref) => {
|
|
|
10966
11024
|
children: group.title
|
|
10967
11025
|
}
|
|
10968
11026
|
),
|
|
10969
|
-
/* @__PURE__ */
|
|
11027
|
+
/* @__PURE__ */ jsx54("div", { className: "mly:space-y-0.5 mly:p-1", children: group.commands.map((item, commandIndex) => {
|
|
10970
11028
|
const itemKey = `${groupIndex}-${commandIndex}`;
|
|
10971
|
-
return /* @__PURE__ */
|
|
11029
|
+
return /* @__PURE__ */ jsx54(
|
|
10972
11030
|
SlashCommandItem,
|
|
10973
11031
|
{
|
|
10974
11032
|
item,
|
|
@@ -10988,16 +11046,16 @@ var CommandList = forwardRef8((props, ref) => {
|
|
|
10988
11046
|
] }, groupIndex))
|
|
10989
11047
|
}
|
|
10990
11048
|
),
|
|
10991
|
-
/* @__PURE__ */
|
|
11049
|
+
/* @__PURE__ */ jsx54("div", { className: "mly:border-t mly:border-gray-200 mly:px-1 mly:py-3 mly:pl-4", children: /* @__PURE__ */ jsxs29("div", { className: "mly:flex mly:items-center", children: [
|
|
10992
11050
|
/* @__PURE__ */ jsxs29("p", { className: "mly:text-center mly:text-xs mly:text-gray-400", children: [
|
|
10993
|
-
/* @__PURE__ */
|
|
10994
|
-
/* @__PURE__ */
|
|
11051
|
+
/* @__PURE__ */ jsx54("kbd", { className: "mly:rounded mly:border mly:border-gray-200 mly:p-1 mly:px-2 mly:font-medium", children: "\u2191" }),
|
|
11052
|
+
/* @__PURE__ */ jsx54("kbd", { className: "mly:ml-1 mly:rounded mly:border mly:border-gray-200 mly:p-1 mly:px-2 mly:font-medium", children: "\u2193" }),
|
|
10995
11053
|
" ",
|
|
10996
11054
|
"to navigate"
|
|
10997
11055
|
] }),
|
|
10998
|
-
/* @__PURE__ */
|
|
11056
|
+
/* @__PURE__ */ jsx54("span", { "aria-hidden": "true", className: "mly:select-none mly:px-1", children: "\xB7" }),
|
|
10999
11057
|
/* @__PURE__ */ jsxs29("p", { className: "mly:text-center mly:text-xs mly:text-gray-400", children: [
|
|
11000
|
-
/* @__PURE__ */
|
|
11058
|
+
/* @__PURE__ */ jsx54("kbd", { className: "mly:rounded mly:border mly:border-gray-200 mly:p-1 mly:px-1.5 mly:font-medium", children: "Enter" }),
|
|
11001
11059
|
" ",
|
|
11002
11060
|
"to select"
|
|
11003
11061
|
] })
|
|
@@ -11077,7 +11135,7 @@ function getSlashCommandSuggestions(groups = DEFAULT_SLASH_COMMANDS) {
|
|
|
11077
11135
|
import { ReactRenderer as ReactRenderer2 } from "@tiptap/react";
|
|
11078
11136
|
import { forwardRef as forwardRef9, useImperativeHandle as useImperativeHandle3, useRef as useRef12 } from "react";
|
|
11079
11137
|
import tippy3 from "tippy.js";
|
|
11080
|
-
import { jsx as
|
|
11138
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
11081
11139
|
var VariableList = forwardRef9((props, ref) => {
|
|
11082
11140
|
var _a;
|
|
11083
11141
|
const { items = [], editor } = props;
|
|
@@ -11106,7 +11164,7 @@ var VariableList = forwardRef9((props, ref) => {
|
|
|
11106
11164
|
return false;
|
|
11107
11165
|
}
|
|
11108
11166
|
}));
|
|
11109
|
-
return /* @__PURE__ */
|
|
11167
|
+
return /* @__PURE__ */ jsx55(
|
|
11110
11168
|
VariableSuggestionPopoverComponent,
|
|
11111
11169
|
{
|
|
11112
11170
|
items,
|
|
@@ -11290,7 +11348,7 @@ var isCustomNodeSelected = (editor, node) => {
|
|
|
11290
11348
|
};
|
|
11291
11349
|
|
|
11292
11350
|
// src/editor/components/text-menu/text-bubble-menu.tsx
|
|
11293
|
-
import { BubbleMenu as
|
|
11351
|
+
import { BubbleMenu as BubbleMenu8 } from "@tiptap/react";
|
|
11294
11352
|
|
|
11295
11353
|
// src/editor/components/text-menu/text-bubble-content.tsx
|
|
11296
11354
|
import {
|
|
@@ -11330,7 +11388,7 @@ var useTextMenuState = (editor) => {
|
|
|
11330
11388
|
};
|
|
11331
11389
|
|
|
11332
11390
|
// src/editor/components/text-menu/text-bubble-content.tsx
|
|
11333
|
-
import { Fragment as Fragment9, jsx as
|
|
11391
|
+
import { Fragment as Fragment9, jsx as jsx56, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
11334
11392
|
function TextBubbleContent(props) {
|
|
11335
11393
|
var _a, _b, _c, _d;
|
|
11336
11394
|
const { editor, showListMenu = true } = props;
|
|
@@ -11375,8 +11433,8 @@ function TextBubbleContent(props) {
|
|
|
11375
11433
|
}
|
|
11376
11434
|
];
|
|
11377
11435
|
return /* @__PURE__ */ jsxs30(Fragment9, { children: [
|
|
11378
|
-
items.map((item, index) => /* @__PURE__ */
|
|
11379
|
-
/* @__PURE__ */
|
|
11436
|
+
items.map((item, index) => /* @__PURE__ */ jsx56(BubbleMenuButton, __spreadValues({}, item), index)),
|
|
11437
|
+
/* @__PURE__ */ jsx56(
|
|
11380
11438
|
AlignmentSwitch,
|
|
11381
11439
|
{
|
|
11382
11440
|
alignment: state.textAlign,
|
|
@@ -11386,7 +11444,7 @@ function TextBubbleContent(props) {
|
|
|
11386
11444
|
}
|
|
11387
11445
|
),
|
|
11388
11446
|
!state.isListActive && showListMenu && /* @__PURE__ */ jsxs30(Fragment9, { children: [
|
|
11389
|
-
/* @__PURE__ */
|
|
11447
|
+
/* @__PURE__ */ jsx56(
|
|
11390
11448
|
BubbleMenuButton,
|
|
11391
11449
|
{
|
|
11392
11450
|
icon: List2,
|
|
@@ -11396,7 +11454,7 @@ function TextBubbleContent(props) {
|
|
|
11396
11454
|
tooltip: "Bullet List"
|
|
11397
11455
|
}
|
|
11398
11456
|
),
|
|
11399
|
-
/* @__PURE__ */
|
|
11457
|
+
/* @__PURE__ */ jsx56(
|
|
11400
11458
|
BubbleMenuButton,
|
|
11401
11459
|
{
|
|
11402
11460
|
icon: ListOrdered2,
|
|
@@ -11407,7 +11465,7 @@ function TextBubbleContent(props) {
|
|
|
11407
11465
|
}
|
|
11408
11466
|
)
|
|
11409
11467
|
] }),
|
|
11410
|
-
/* @__PURE__ */
|
|
11468
|
+
/* @__PURE__ */ jsx56(
|
|
11411
11469
|
LinkInputPopover,
|
|
11412
11470
|
{
|
|
11413
11471
|
defaultValue: (_d = state == null ? void 0 : state.linkUrl) != null ? _d : "",
|
|
@@ -11423,8 +11481,8 @@ function TextBubbleContent(props) {
|
|
|
11423
11481
|
isVariable: state.isUrlVariable
|
|
11424
11482
|
}
|
|
11425
11483
|
),
|
|
11426
|
-
/* @__PURE__ */
|
|
11427
|
-
/* @__PURE__ */
|
|
11484
|
+
/* @__PURE__ */ jsx56(Divider, {}),
|
|
11485
|
+
/* @__PURE__ */ jsx56(
|
|
11428
11486
|
ColorPicker,
|
|
11429
11487
|
{
|
|
11430
11488
|
color: state.currentTextColor,
|
|
@@ -11433,16 +11491,16 @@ function TextBubbleContent(props) {
|
|
|
11433
11491
|
},
|
|
11434
11492
|
tooltip: "Text Color",
|
|
11435
11493
|
suggestedColors,
|
|
11436
|
-
children: /* @__PURE__ */
|
|
11494
|
+
children: /* @__PURE__ */ jsx56(
|
|
11437
11495
|
BaseButton,
|
|
11438
11496
|
{
|
|
11439
11497
|
variant: "ghost",
|
|
11440
11498
|
size: "sm",
|
|
11441
11499
|
type: "button",
|
|
11442
|
-
className: "mly:h-7 mly:w-7 mly:shrink-0 mly:p-0",
|
|
11500
|
+
className: "menu-option mly:h-7 mly:w-7 mly:shrink-0 mly:p-0",
|
|
11443
11501
|
children: /* @__PURE__ */ jsxs30("div", { className: "mly:flex mly:flex-col mly:items-center mly:justify-center mly:gap-px", children: [
|
|
11444
|
-
/* @__PURE__ */
|
|
11445
|
-
/* @__PURE__ */
|
|
11502
|
+
/* @__PURE__ */ jsx56("span", { className: "mly:font-bolder mly:font-mono mly:text-xs mly:text-slate-700", children: "A" }),
|
|
11503
|
+
/* @__PURE__ */ jsx56(
|
|
11446
11504
|
"div",
|
|
11447
11505
|
{
|
|
11448
11506
|
className: "mly:h-[2px] mly:w-3",
|
|
@@ -11459,32 +11517,32 @@ function TextBubbleContent(props) {
|
|
|
11459
11517
|
|
|
11460
11518
|
// src/editor/components/text-menu/turn-into-block.tsx
|
|
11461
11519
|
import { ChevronDownIcon as ChevronDownIcon2, PilcrowIcon } from "lucide-react";
|
|
11462
|
-
import { useMemo as
|
|
11463
|
-
import { jsx as
|
|
11520
|
+
import { useMemo as useMemo12 } from "react";
|
|
11521
|
+
import { jsx as jsx57, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
11464
11522
|
var isOption = (option) => option.type === "option";
|
|
11465
11523
|
var isCategory = (option) => option.type === "category";
|
|
11466
11524
|
function TurnIntoBlock(props) {
|
|
11467
11525
|
const { options } = props;
|
|
11468
|
-
const activeItem =
|
|
11526
|
+
const activeItem = useMemo12(
|
|
11469
11527
|
() => options.find((option) => option.type === "option" && option.isActive()),
|
|
11470
11528
|
[options]
|
|
11471
11529
|
);
|
|
11472
11530
|
const { icon: ActiveIcon = PilcrowIcon } = activeItem || {};
|
|
11473
11531
|
return /* @__PURE__ */ jsxs31(Popover, { children: [
|
|
11474
11532
|
/* @__PURE__ */ jsxs31(Tooltip, { children: [
|
|
11475
|
-
/* @__PURE__ */
|
|
11533
|
+
/* @__PURE__ */ jsx57(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs31(
|
|
11476
11534
|
PopoverTrigger,
|
|
11477
11535
|
{
|
|
11478
11536
|
className: cn(
|
|
11479
|
-
"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"
|
|
11537
|
+
"menu-option 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"
|
|
11480
11538
|
),
|
|
11481
11539
|
children: [
|
|
11482
|
-
/* @__PURE__ */
|
|
11483
|
-
/* @__PURE__ */
|
|
11540
|
+
/* @__PURE__ */ jsx57(ActiveIcon, { className: "mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5]" }),
|
|
11541
|
+
/* @__PURE__ */ jsx57(ChevronDownIcon2, { className: "mly:h-3 mly:w-3 mly:shrink-0 mly:stroke-[2.5]" })
|
|
11484
11542
|
]
|
|
11485
11543
|
}
|
|
11486
11544
|
) }),
|
|
11487
|
-
/* @__PURE__ */
|
|
11545
|
+
/* @__PURE__ */ jsx57(
|
|
11488
11546
|
TooltipContent,
|
|
11489
11547
|
{
|
|
11490
11548
|
sideOffset: 8,
|
|
@@ -11493,13 +11551,13 @@ function TurnIntoBlock(props) {
|
|
|
11493
11551
|
}
|
|
11494
11552
|
)
|
|
11495
11553
|
] }),
|
|
11496
|
-
/* @__PURE__ */
|
|
11554
|
+
/* @__PURE__ */ jsx57(
|
|
11497
11555
|
PopoverContent,
|
|
11498
11556
|
{
|
|
11499
11557
|
align: "start",
|
|
11500
11558
|
side: "bottom",
|
|
11501
11559
|
sideOffset: 8,
|
|
11502
|
-
className: "mly:flex mly:w-[160px] mly:flex-col mly:rounded-md mly:p-1",
|
|
11560
|
+
className: "menu-dropdown-surface mly:flex mly:w-[160px] mly:flex-col mly:rounded-md mly:p-1",
|
|
11503
11561
|
children: options.map((option, index) => {
|
|
11504
11562
|
if (isOption(option)) {
|
|
11505
11563
|
return /* @__PURE__ */ jsxs31(
|
|
@@ -11507,20 +11565,23 @@ function TurnIntoBlock(props) {
|
|
|
11507
11565
|
{
|
|
11508
11566
|
onClick: option.onClick,
|
|
11509
11567
|
variant: "ghost",
|
|
11510
|
-
className:
|
|
11568
|
+
className: cn(
|
|
11569
|
+
"menu-option menu-dropdown-option 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",
|
|
11570
|
+
option.isActive() && "menu-active-option"
|
|
11571
|
+
),
|
|
11511
11572
|
children: [
|
|
11512
|
-
/* @__PURE__ */
|
|
11573
|
+
/* @__PURE__ */ jsx57(option.icon, { className: "mly:size-[15px] mly:shrink-0" }),
|
|
11513
11574
|
option.label
|
|
11514
11575
|
]
|
|
11515
11576
|
},
|
|
11516
11577
|
option.id
|
|
11517
11578
|
);
|
|
11518
11579
|
} else if (isCategory(option)) {
|
|
11519
|
-
return /* @__PURE__ */
|
|
11580
|
+
return /* @__PURE__ */ jsx57(
|
|
11520
11581
|
"label",
|
|
11521
11582
|
{
|
|
11522
11583
|
className: cn(
|
|
11523
|
-
"mly:!px-2.5 mly:!pl-3.5 mly:text-xs mly:font-medium mly:text-midnight-gray/60",
|
|
11584
|
+
"menu-dropdown-category mly:!px-2.5 mly:!pl-3.5 mly:text-xs mly:font-medium mly:text-midnight-gray/60",
|
|
11524
11585
|
index === 0 ? "mly:mb-2 mly:mt-1" : "mly:my-2"
|
|
11525
11586
|
),
|
|
11526
11587
|
children: option.label
|
|
@@ -11617,7 +11678,7 @@ function useTurnIntoBlockOptions(editor) {
|
|
|
11617
11678
|
}
|
|
11618
11679
|
|
|
11619
11680
|
// src/editor/components/text-menu/text-bubble-menu.tsx
|
|
11620
|
-
import { jsx as
|
|
11681
|
+
import { jsx as jsx58, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
11621
11682
|
function TextBubbleMenu(props) {
|
|
11622
11683
|
const { editor, appendTo } = props;
|
|
11623
11684
|
if (!editor) {
|
|
@@ -11668,23 +11729,23 @@ function TextBubbleMenu(props) {
|
|
|
11668
11729
|
}
|
|
11669
11730
|
});
|
|
11670
11731
|
const turnIntoBlockOptions = useTurnIntoBlockOptions(editor);
|
|
11671
|
-
return /* @__PURE__ */
|
|
11672
|
-
|
|
11732
|
+
return /* @__PURE__ */ jsx58(
|
|
11733
|
+
BubbleMenu8,
|
|
11673
11734
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
11674
|
-
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",
|
|
11735
|
+
className: "menu-surface 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",
|
|
11675
11736
|
children: /* @__PURE__ */ jsxs32(TooltipProvider, { children: [
|
|
11676
|
-
/* @__PURE__ */
|
|
11677
|
-
/* @__PURE__ */
|
|
11678
|
-
/* @__PURE__ */
|
|
11737
|
+
/* @__PURE__ */ jsx58(TurnIntoBlock, { options: turnIntoBlockOptions }),
|
|
11738
|
+
/* @__PURE__ */ jsx58(Divider, { className: "mly:mx-0" }),
|
|
11739
|
+
/* @__PURE__ */ jsx58(TextBubbleContent, { editor })
|
|
11679
11740
|
] })
|
|
11680
11741
|
})
|
|
11681
11742
|
);
|
|
11682
11743
|
}
|
|
11683
11744
|
|
|
11684
11745
|
// src/editor/components/variable-menu/variable-bubble-menu.tsx
|
|
11685
|
-
import { BubbleMenu as
|
|
11746
|
+
import { BubbleMenu as BubbleMenu9 } from "@tiptap/react";
|
|
11686
11747
|
import { sticky as sticky6 } from "tippy.js";
|
|
11687
|
-
import { jsx as
|
|
11748
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
11688
11749
|
function VariableBubbleMenu(props) {
|
|
11689
11750
|
const { editor, appendTo } = props;
|
|
11690
11751
|
if (!editor) {
|
|
@@ -11707,11 +11768,11 @@ function VariableBubbleMenu(props) {
|
|
|
11707
11768
|
placement: "top-start"
|
|
11708
11769
|
}
|
|
11709
11770
|
});
|
|
11710
|
-
return /* @__PURE__ */
|
|
11711
|
-
|
|
11771
|
+
return /* @__PURE__ */ jsx59(
|
|
11772
|
+
BubbleMenu9,
|
|
11712
11773
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
11713
11774
|
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",
|
|
11714
|
-
children: /* @__PURE__ */
|
|
11775
|
+
children: /* @__PURE__ */ jsx59(TooltipProvider, { children: /* @__PURE__ */ jsx59(TextBubbleContent, { showListMenu: false, editor }) })
|
|
11715
11776
|
})
|
|
11716
11777
|
);
|
|
11717
11778
|
}
|
|
@@ -11797,7 +11858,7 @@ function replaceDeprecatedNode(json) {
|
|
|
11797
11858
|
}
|
|
11798
11859
|
|
|
11799
11860
|
// src/editor/index.tsx
|
|
11800
|
-
import { jsx as
|
|
11861
|
+
import { jsx as jsx60, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
11801
11862
|
function Editor12(props) {
|
|
11802
11863
|
const {
|
|
11803
11864
|
config: {
|
|
@@ -11821,7 +11882,7 @@ function Editor12(props) {
|
|
|
11821
11882
|
scrollThreshold = 40,
|
|
11822
11883
|
scrollMargin = 40
|
|
11823
11884
|
} = props;
|
|
11824
|
-
const formattedContent =
|
|
11885
|
+
const formattedContent = useMemo13(() => {
|
|
11825
11886
|
if (contentJson) {
|
|
11826
11887
|
const json = (contentJson == null ? void 0 : contentJson.type) === "doc" ? contentJson : {
|
|
11827
11888
|
type: "doc",
|
|
@@ -11870,7 +11931,7 @@ function Editor12(props) {
|
|
|
11870
11931
|
if (!editor) {
|
|
11871
11932
|
return null;
|
|
11872
11933
|
}
|
|
11873
|
-
return /* @__PURE__ */
|
|
11934
|
+
return /* @__PURE__ */ jsx60(MailyProvider, { placeholderUrl, children: /* @__PURE__ */ jsxs33(
|
|
11874
11935
|
"div",
|
|
11875
11936
|
{
|
|
11876
11937
|
id: "mly-editor",
|
|
@@ -11881,7 +11942,7 @@ function Editor12(props) {
|
|
|
11881
11942
|
),
|
|
11882
11943
|
ref: menuContainerRef,
|
|
11883
11944
|
children: [
|
|
11884
|
-
hasMenuBar && /* @__PURE__ */
|
|
11945
|
+
hasMenuBar && /* @__PURE__ */ jsx60(EditorMenuBar, { config: props.config, editor }),
|
|
11885
11946
|
/* @__PURE__ */ jsxs33(
|
|
11886
11947
|
"div",
|
|
11887
11948
|
{
|
|
@@ -11890,16 +11951,17 @@ function Editor12(props) {
|
|
|
11890
11951
|
bodyClassName
|
|
11891
11952
|
),
|
|
11892
11953
|
children: [
|
|
11893
|
-
/* @__PURE__ */
|
|
11894
|
-
/* @__PURE__ */
|
|
11895
|
-
/* @__PURE__ */
|
|
11896
|
-
/* @__PURE__ */
|
|
11897
|
-
/* @__PURE__ */
|
|
11898
|
-
/* @__PURE__ */
|
|
11899
|
-
|
|
11900
|
-
/* @__PURE__ */
|
|
11901
|
-
/* @__PURE__ */
|
|
11902
|
-
/* @__PURE__ */
|
|
11954
|
+
/* @__PURE__ */ jsx60(TextBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
11955
|
+
/* @__PURE__ */ jsx60(ImageBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
11956
|
+
/* @__PURE__ */ jsx60(SpacerBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
11957
|
+
/* @__PURE__ */ jsx60(DividerBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
11958
|
+
/* @__PURE__ */ jsx60(EditorContent, { editor }),
|
|
11959
|
+
/* @__PURE__ */ jsx60(SectionBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
11960
|
+
/* @__PURE__ */ jsx60(ColumnsBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
11961
|
+
!hideContextMenu && /* @__PURE__ */ jsx60(ContentMenu, { editor }),
|
|
11962
|
+
/* @__PURE__ */ jsx60(VariableBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
11963
|
+
/* @__PURE__ */ jsx60(RepeatBubbleMenu, { editor, appendTo: menuContainerRef }),
|
|
11964
|
+
/* @__PURE__ */ jsx60(InlineImageBubbleMenu, { editor, appendTo: menuContainerRef })
|
|
11903
11965
|
]
|
|
11904
11966
|
}
|
|
11905
11967
|
)
|