@daisychainapp/maily-to-core 0.0.22 → 0.0.24
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/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +22 -68
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +70 -116
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1203,10 +1203,12 @@ var DefaultRenderVariable = (props) => {
|
|
|
1203
1203
|
|
|
1204
1204
|
// src/editor/provider.tsx
|
|
1205
1205
|
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1206
|
+
var DEFAULT_PLACEHOLDER_URL = "maily.to/";
|
|
1206
1207
|
var DEFAULT_VARIABLE_TRIGGER_CHAR = "@";
|
|
1207
1208
|
var DEFAULT_VARIABLES = [];
|
|
1208
1209
|
var DEFAULT_RENDER_VARIABLE_FUNCTION = DefaultRenderVariable;
|
|
1209
1210
|
var MailyContext = createContext({
|
|
1211
|
+
placeholderUrl: DEFAULT_PLACEHOLDER_URL,
|
|
1210
1212
|
variableTriggerCharacter: DEFAULT_VARIABLE_TRIGGER_CHAR,
|
|
1211
1213
|
variables: DEFAULT_VARIABLES,
|
|
1212
1214
|
blocks: DEFAULT_SLASH_COMMANDS,
|
|
@@ -2639,7 +2641,8 @@ function LinkInputPopover(props) {
|
|
|
2639
2641
|
const {
|
|
2640
2642
|
variables = [],
|
|
2641
2643
|
variableTriggerCharacter = DEFAULT_VARIABLE_TRIGGER_CHAR,
|
|
2642
|
-
renderVariable = DEFAULT_RENDER_VARIABLE_FUNCTION
|
|
2644
|
+
renderVariable = DEFAULT_RENDER_VARIABLE_FUNCTION,
|
|
2645
|
+
placeholderUrl = DEFAULT_PLACEHOLDER_URL
|
|
2643
2646
|
} = useMailyContext();
|
|
2644
2647
|
const autoCompleteOptions = useMemo5(() => {
|
|
2645
2648
|
const withoutTrigger = defaultUrlWithoutProtocol.replace(
|
|
@@ -2759,7 +2762,7 @@ function LinkInputPopover(props) {
|
|
|
2759
2762
|
},
|
|
2760
2763
|
autoCompleteOptions,
|
|
2761
2764
|
ref: linkInputRef,
|
|
2762
|
-
placeholder:
|
|
2765
|
+
placeholder: placeholderUrl,
|
|
2763
2766
|
className: "-mly-ms-px mly-block mly-h-8 mly-w-52 mly-rounded-lg mly-rounded-s-none mly-border mly-border-gray-300 mly-px-2 mly-py-1.5 mly-pr-6 mly-text-sm mly-shadow-sm mly-outline-none placeholder:mly-text-gray-400",
|
|
2764
2767
|
triggerChar: variableTriggerCharacter,
|
|
2765
2768
|
onSelectOption: (value) => {
|
|
@@ -3667,20 +3670,7 @@ function ImageBubbleMenu(props) {
|
|
|
3667
3670
|
}
|
|
3668
3671
|
)
|
|
3669
3672
|
] })
|
|
3670
|
-
] })
|
|
3671
|
-
/* @__PURE__ */ jsx30(Divider, {}),
|
|
3672
|
-
/* @__PURE__ */ jsx30(
|
|
3673
|
-
ShowPopover,
|
|
3674
|
-
{
|
|
3675
|
-
showIfKey: state.currentShowIfKey,
|
|
3676
|
-
onShowIfKeyValueChange: (value) => {
|
|
3677
|
-
editor == null ? void 0 : editor.chain().updateAttributes(state.isLogoActive ? "logo" : "image", {
|
|
3678
|
-
showIfKey: value
|
|
3679
|
-
}).run();
|
|
3680
|
-
},
|
|
3681
|
-
editor
|
|
3682
|
-
}
|
|
3683
|
-
)
|
|
3673
|
+
] })
|
|
3684
3674
|
] })
|
|
3685
3675
|
})
|
|
3686
3676
|
);
|
|
@@ -4129,19 +4119,6 @@ function SectionBubbleMenu(props) {
|
|
|
4129
4119
|
}
|
|
4130
4120
|
}
|
|
4131
4121
|
),
|
|
4132
|
-
/* @__PURE__ */ jsx35(Divider, {}),
|
|
4133
|
-
/* @__PURE__ */ jsx35(
|
|
4134
|
-
ShowPopover,
|
|
4135
|
-
{
|
|
4136
|
-
showIfKey: state.currentShowIfKey,
|
|
4137
|
-
onShowIfKeyValueChange: (value) => {
|
|
4138
|
-
editor.commands.updateSection({
|
|
4139
|
-
showIfKey: value
|
|
4140
|
-
});
|
|
4141
|
-
},
|
|
4142
|
-
editor
|
|
4143
|
-
}
|
|
4144
|
-
),
|
|
4145
4122
|
state.isColumnsActive && /* @__PURE__ */ jsxs18(Fragment6, { children: [
|
|
4146
4123
|
/* @__PURE__ */ jsx35(Divider, {}),
|
|
4147
4124
|
/* @__PURE__ */ jsxs18(Popover, { children: [
|
|
@@ -4280,7 +4257,7 @@ var useSpacerState = (editor) => {
|
|
|
4280
4257
|
};
|
|
4281
4258
|
|
|
4282
4259
|
// src/editor/components/spacer-menu/spacer-bubble-menu.tsx
|
|
4283
|
-
import { jsx as jsx36
|
|
4260
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
4284
4261
|
function SpacerBubbleMenu(props) {
|
|
4285
4262
|
const { editor, appendTo } = props;
|
|
4286
4263
|
if (!editor) {
|
|
@@ -4305,28 +4282,15 @@ function SpacerBubbleMenu(props) {
|
|
|
4305
4282
|
BubbleMenu5,
|
|
4306
4283
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
4307
4284
|
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",
|
|
4308
|
-
children: /* @__PURE__ */
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
)),
|
|
4318
|
-
/* @__PURE__ */ jsx36(Divider, {}),
|
|
4319
|
-
/* @__PURE__ */ jsx36(
|
|
4320
|
-
ShowPopover,
|
|
4321
|
-
{
|
|
4322
|
-
showIfKey: state.currentShowIfKey,
|
|
4323
|
-
onShowIfKeyValueChange: (value) => {
|
|
4324
|
-
editor.commands.setSpacerShowIfKey(value);
|
|
4325
|
-
},
|
|
4326
|
-
editor
|
|
4327
|
-
}
|
|
4328
|
-
)
|
|
4329
|
-
] })
|
|
4285
|
+
children: /* @__PURE__ */ jsx36(TooltipProvider, { children: items.map((item, index) => /* @__PURE__ */ jsx36(
|
|
4286
|
+
BubbleMenuButton,
|
|
4287
|
+
__spreadValues({
|
|
4288
|
+
className: "!mly-h-7 mly-w-7 mly-shrink-0 mly-p-0",
|
|
4289
|
+
iconClassName: "mly-w-3 mly-h-3",
|
|
4290
|
+
nameClassName: "mly-text-xs"
|
|
4291
|
+
}, item),
|
|
4292
|
+
index
|
|
4293
|
+
)) })
|
|
4330
4294
|
})
|
|
4331
4295
|
);
|
|
4332
4296
|
}
|
|
@@ -4449,7 +4413,7 @@ var Textarea = React6.forwardRef(
|
|
|
4449
4413
|
Textarea.displayName = "Textarea";
|
|
4450
4414
|
|
|
4451
4415
|
// src/editor/nodes/link-card.tsx
|
|
4452
|
-
import { jsx as jsx39, jsxs as
|
|
4416
|
+
import { jsx as jsx39, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4453
4417
|
function LinkCardComponent(props) {
|
|
4454
4418
|
const { title, description, link, linkTitle, image: image2, badgeText, subTitle } = props.node.attrs;
|
|
4455
4419
|
const { getPos, editor } = props;
|
|
@@ -4459,7 +4423,7 @@ function LinkCardComponent(props) {
|
|
|
4459
4423
|
className: `react-component ${props.selected && "ProseMirror-selectednode"}`,
|
|
4460
4424
|
draggable: "true",
|
|
4461
4425
|
"data-drag-handle": "",
|
|
4462
|
-
children: /* @__PURE__ */
|
|
4426
|
+
children: /* @__PURE__ */ jsxs19(Popover, { open: props.selected, children: [
|
|
4463
4427
|
/* @__PURE__ */ jsx39(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx39(
|
|
4464
4428
|
"div",
|
|
4465
4429
|
{
|
|
@@ -4469,7 +4433,7 @@ function LinkCardComponent(props) {
|
|
|
4469
4433
|
const pos = getPos();
|
|
4470
4434
|
editor.commands.setNodeSelection(pos);
|
|
4471
4435
|
},
|
|
4472
|
-
children: /* @__PURE__ */
|
|
4436
|
+
children: /* @__PURE__ */ jsxs19("div", { className: "mly-no-prose mly-flex mly-flex-col mly-rounded-lg mly-border mly-border-gray-300", children: [
|
|
4473
4437
|
image2 && /* @__PURE__ */ jsx39("div", { className: "mly-relative mly-mb-1.5 mly-w-full mly-shrink-0", children: /* @__PURE__ */ jsx39(
|
|
4474
4438
|
"img",
|
|
4475
4439
|
{
|
|
@@ -4478,14 +4442,14 @@ function LinkCardComponent(props) {
|
|
|
4478
4442
|
className: "mly-no-prose !mly-mb-0 mly-h-full mly-w-full mly-rounded-t-lg"
|
|
4479
4443
|
}
|
|
4480
4444
|
) }),
|
|
4481
|
-
/* @__PURE__ */ jsx39("div", { className: "mly-flex mly-items-stretch mly-p-3", children: /* @__PURE__ */
|
|
4482
|
-
/* @__PURE__ */
|
|
4445
|
+
/* @__PURE__ */ jsx39("div", { className: "mly-flex mly-items-stretch mly-p-3", children: /* @__PURE__ */ jsxs19("div", { className: cn("mly-flex mly-flex-col"), children: [
|
|
4446
|
+
/* @__PURE__ */ jsxs19("div", { className: "!mly-mb-1.5 mly-flex mly-items-center mly-gap-1.5", children: [
|
|
4483
4447
|
/* @__PURE__ */ jsx39("h2", { className: "!mly-mb-0 !mly-text-lg mly-font-semibold", children: title }),
|
|
4484
4448
|
badgeText && /* @__PURE__ */ jsx39("span", { className: "!mly-font-base text-xs mly-rounded-md mly-bg-yellow-200 mly-px-2 mly-py-1 mly-font-semibold mly-leading-none", children: badgeText }),
|
|
4485
4449
|
" ",
|
|
4486
4450
|
subTitle && !badgeText && /* @__PURE__ */ jsx39("span", { className: "!mly-font-base text-xs mly-font-regular mly-rounded-md mly-leading-none mly-text-gray-400", children: subTitle })
|
|
4487
4451
|
] }),
|
|
4488
|
-
/* @__PURE__ */
|
|
4452
|
+
/* @__PURE__ */ jsxs19("p", { className: "!mly-my-0 !mly-text-base mly-text-gray-500", children: [
|
|
4489
4453
|
description,
|
|
4490
4454
|
" ",
|
|
4491
4455
|
linkTitle ? /* @__PURE__ */ jsx39("a", { href: link, className: "mly-font-semibold", children: linkTitle }) : null
|
|
@@ -4494,7 +4458,7 @@ function LinkCardComponent(props) {
|
|
|
4494
4458
|
] })
|
|
4495
4459
|
}
|
|
4496
4460
|
) }),
|
|
4497
|
-
/* @__PURE__ */
|
|
4461
|
+
/* @__PURE__ */ jsxs19(
|
|
4498
4462
|
PopoverContent,
|
|
4499
4463
|
{
|
|
4500
4464
|
align: "end",
|
|
@@ -4503,7 +4467,7 @@ function LinkCardComponent(props) {
|
|
|
4503
4467
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
4504
4468
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
4505
4469
|
children: [
|
|
4506
|
-
/* @__PURE__ */
|
|
4470
|
+
/* @__PURE__ */ jsxs19("label", { className: "mly-w-full mly-space-y-1", children: [
|
|
4507
4471
|
/* @__PURE__ */ jsx39("span", { className: "mly-text-xs mly-font-normal mly-text-slate-400", children: "Image" }),
|
|
4508
4472
|
/* @__PURE__ */ jsx39(
|
|
4509
4473
|
Input,
|
|
@@ -4519,7 +4483,7 @@ function LinkCardComponent(props) {
|
|
|
4519
4483
|
}
|
|
4520
4484
|
)
|
|
4521
4485
|
] }),
|
|
4522
|
-
/* @__PURE__ */
|
|
4486
|
+
/* @__PURE__ */ jsxs19("label", { className: "mly-w-full mly-space-y-1", children: [
|
|
4523
4487
|
/* @__PURE__ */ jsx39("span", { className: "mly-text-xs mly-font-normal mly-text-slate-400", children: "Title" }),
|
|
4524
4488
|
/* @__PURE__ */ jsx39(
|
|
4525
4489
|
Input,
|
|
@@ -4534,7 +4498,7 @@ function LinkCardComponent(props) {
|
|
|
4534
4498
|
}
|
|
4535
4499
|
)
|
|
4536
4500
|
] }),
|
|
4537
|
-
/* @__PURE__ */
|
|
4501
|
+
/* @__PURE__ */ jsxs19("label", { className: "mly-w-full mly-space-y-1", children: [
|
|
4538
4502
|
/* @__PURE__ */ jsx39("span", { className: "mly-text-xs mly-font-normal mly-text-slate-400", children: "Description" }),
|
|
4539
4503
|
/* @__PURE__ */ jsx39(
|
|
4540
4504
|
Textarea,
|
|
@@ -4549,8 +4513,8 @@ function LinkCardComponent(props) {
|
|
|
4549
4513
|
}
|
|
4550
4514
|
)
|
|
4551
4515
|
] }),
|
|
4552
|
-
/* @__PURE__ */
|
|
4553
|
-
/* @__PURE__ */
|
|
4516
|
+
/* @__PURE__ */ jsxs19("div", { className: "mly-grid mly-grid-cols-2 mly-gap-2", children: [
|
|
4517
|
+
/* @__PURE__ */ jsxs19("label", { className: "mly-w-full mly-space-y-1", children: [
|
|
4554
4518
|
/* @__PURE__ */ jsx39("span", { className: "mly-text-xs mly-font-normal mly-text-slate-400", children: "Link Title" }),
|
|
4555
4519
|
/* @__PURE__ */ jsx39(
|
|
4556
4520
|
Input,
|
|
@@ -4565,7 +4529,7 @@ function LinkCardComponent(props) {
|
|
|
4565
4529
|
}
|
|
4566
4530
|
)
|
|
4567
4531
|
] }),
|
|
4568
|
-
/* @__PURE__ */
|
|
4532
|
+
/* @__PURE__ */ jsxs19("label", { className: "mly-w-full mly-space-y-1", children: [
|
|
4569
4533
|
/* @__PURE__ */ jsx39("span", { className: "mly-text-xs mly-font-normal mly-text-slate-400", children: "Link" }),
|
|
4570
4534
|
/* @__PURE__ */ jsx39(
|
|
4571
4535
|
Input,
|
|
@@ -4581,8 +4545,8 @@ function LinkCardComponent(props) {
|
|
|
4581
4545
|
)
|
|
4582
4546
|
] })
|
|
4583
4547
|
] }),
|
|
4584
|
-
/* @__PURE__ */
|
|
4585
|
-
/* @__PURE__ */
|
|
4548
|
+
/* @__PURE__ */ jsxs19("div", { className: "mly-grid mly-grid-cols-2 mly-gap-2", children: [
|
|
4549
|
+
/* @__PURE__ */ jsxs19("label", { className: "mly-w-full mly-space-y-1", children: [
|
|
4586
4550
|
/* @__PURE__ */ jsx39("span", { className: "mly-text-xs mly-font-normal mly-text-slate-400", children: "Badge Text" }),
|
|
4587
4551
|
/* @__PURE__ */ jsx39(
|
|
4588
4552
|
Input,
|
|
@@ -4597,7 +4561,7 @@ function LinkCardComponent(props) {
|
|
|
4597
4561
|
}
|
|
4598
4562
|
)
|
|
4599
4563
|
] }),
|
|
4600
|
-
/* @__PURE__ */
|
|
4564
|
+
/* @__PURE__ */ jsxs19("label", { className: "mly-w-full mly-space-y-1", children: [
|
|
4601
4565
|
/* @__PURE__ */ jsx39("span", { className: "mly-text-xs mly-font-normal mly-text-slate-400", children: "Sub Title" }),
|
|
4602
4566
|
/* @__PURE__ */ jsx39(
|
|
4603
4567
|
Input,
|
|
@@ -4703,7 +4667,7 @@ import { NodeViewWrapper as NodeViewWrapper5 } from "@tiptap/react";
|
|
|
4703
4667
|
import { useMemo as useMemo6 } from "react";
|
|
4704
4668
|
import { useState as useState10 } from "react";
|
|
4705
4669
|
import { useRef as useRef9 } from "react";
|
|
4706
|
-
import { jsx as jsx40, jsxs as
|
|
4670
|
+
import { jsx as jsx40, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4707
4671
|
function ButtonLabelInput(props) {
|
|
4708
4672
|
const { value, onValueChange, isVariable, editor } = props;
|
|
4709
4673
|
const linkInputRef = useRef9(null);
|
|
@@ -4711,7 +4675,8 @@ function ButtonLabelInput(props) {
|
|
|
4711
4675
|
const {
|
|
4712
4676
|
variables = [],
|
|
4713
4677
|
variableTriggerCharacter = DEFAULT_VARIABLE_TRIGGER_CHAR,
|
|
4714
|
-
renderVariable = DEFAULT_RENDER_VARIABLE_FUNCTION
|
|
4678
|
+
renderVariable = DEFAULT_RENDER_VARIABLE_FUNCTION,
|
|
4679
|
+
placeholderUrl = DEFAULT_PLACEHOLDER_URL
|
|
4715
4680
|
} = useMailyContext();
|
|
4716
4681
|
const autoCompleteOptions = useMemo6(() => {
|
|
4717
4682
|
const withoutTrigger = value.replace(
|
|
@@ -4724,7 +4689,7 @@ function ButtonLabelInput(props) {
|
|
|
4724
4689
|
editor
|
|
4725
4690
|
}).map((variable) => variable.name);
|
|
4726
4691
|
}, [variables, value, editor]);
|
|
4727
|
-
return /* @__PURE__ */
|
|
4692
|
+
return /* @__PURE__ */ jsxs20("div", { className: "mly-isolate mly-flex mly-rounded-lg", children: [
|
|
4728
4693
|
!isEditing && /* @__PURE__ */ jsx40(
|
|
4729
4694
|
"button",
|
|
4730
4695
|
{
|
|
@@ -4755,7 +4720,7 @@ function ButtonLabelInput(props) {
|
|
|
4755
4720
|
},
|
|
4756
4721
|
autoCompleteOptions,
|
|
4757
4722
|
ref: linkInputRef,
|
|
4758
|
-
placeholder:
|
|
4723
|
+
placeholder: placeholderUrl,
|
|
4759
4724
|
className: "mly-h-7 mly-w-40 mly-rounded-md mly-px-2 mly-pr-6 mly-text-sm mly-text-midnight-gray hover:mly-bg-soft-gray focus:mly-bg-soft-gray focus:mly-outline-none",
|
|
4760
4725
|
triggerChar: variableTriggerCharacter,
|
|
4761
4726
|
onSelectOption: (value2) => {
|
|
@@ -4772,7 +4737,7 @@ function ButtonLabelInput(props) {
|
|
|
4772
4737
|
}
|
|
4773
4738
|
|
|
4774
4739
|
// src/editor/nodes/button/button-view.tsx
|
|
4775
|
-
import { jsx as jsx41, jsxs as
|
|
4740
|
+
import { jsx as jsx41, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4776
4741
|
function ButtonView(props) {
|
|
4777
4742
|
const { node, editor, getPos, updateAttributes: updateAttributes2 } = props;
|
|
4778
4743
|
const {
|
|
@@ -4797,7 +4762,7 @@ function ButtonView(props) {
|
|
|
4797
4762
|
style: {
|
|
4798
4763
|
textAlign: alignment
|
|
4799
4764
|
},
|
|
4800
|
-
children: /* @__PURE__ */
|
|
4765
|
+
children: /* @__PURE__ */ jsxs21(Popover, { open: props.selected, children: [
|
|
4801
4766
|
/* @__PURE__ */ jsx41(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx41("div", { children: /* @__PURE__ */ jsx41(
|
|
4802
4767
|
"button",
|
|
4803
4768
|
{
|
|
@@ -4844,7 +4809,7 @@ function ButtonView(props) {
|
|
|
4844
4809
|
sideOffset: 8,
|
|
4845
4810
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
4846
4811
|
onCloseAutoFocus: (e) => e.preventDefault(),
|
|
4847
|
-
children: /* @__PURE__ */ jsx41(TooltipProvider, { children: /* @__PURE__ */
|
|
4812
|
+
children: /* @__PURE__ */ jsx41(TooltipProvider, { children: /* @__PURE__ */ jsxs21("div", { className: "mly-flex mly-items-stretch mly-text-midnight-gray", children: [
|
|
4848
4813
|
/* @__PURE__ */ jsx41(
|
|
4849
4814
|
ButtonLabelInput,
|
|
4850
4815
|
{
|
|
@@ -4860,7 +4825,7 @@ function ButtonView(props) {
|
|
|
4860
4825
|
}
|
|
4861
4826
|
),
|
|
4862
4827
|
/* @__PURE__ */ jsx41(Divider, {}),
|
|
4863
|
-
/* @__PURE__ */
|
|
4828
|
+
/* @__PURE__ */ jsxs21("div", { className: "mly-flex mly-space-x-0.5", children: [
|
|
4864
4829
|
/* @__PURE__ */ jsx41(
|
|
4865
4830
|
Select,
|
|
4866
4831
|
{
|
|
@@ -4899,7 +4864,7 @@ function ButtonView(props) {
|
|
|
4899
4864
|
)
|
|
4900
4865
|
] }),
|
|
4901
4866
|
/* @__PURE__ */ jsx41(Divider, {}),
|
|
4902
|
-
/* @__PURE__ */
|
|
4867
|
+
/* @__PURE__ */ jsxs21("div", { className: "mly-flex mly-space-x-0.5", children: [
|
|
4903
4868
|
/* @__PURE__ */ jsx41(
|
|
4904
4869
|
AlignmentSwitch,
|
|
4905
4870
|
{
|
|
@@ -4928,7 +4893,7 @@ function ButtonView(props) {
|
|
|
4928
4893
|
)
|
|
4929
4894
|
] }),
|
|
4930
4895
|
/* @__PURE__ */ jsx41(Divider, {}),
|
|
4931
|
-
/* @__PURE__ */
|
|
4896
|
+
/* @__PURE__ */ jsxs21("div", { className: "mly-flex mly-space-x-0.5", children: [
|
|
4932
4897
|
/* @__PURE__ */ jsx41(
|
|
4933
4898
|
BackgroundColorPickerPopup,
|
|
4934
4899
|
{
|
|
@@ -4952,20 +4917,7 @@ function ButtonView(props) {
|
|
|
4952
4917
|
}
|
|
4953
4918
|
}
|
|
4954
4919
|
)
|
|
4955
|
-
] })
|
|
4956
|
-
/* @__PURE__ */ jsx41(Divider, {}),
|
|
4957
|
-
/* @__PURE__ */ jsx41(
|
|
4958
|
-
ShowPopover,
|
|
4959
|
-
{
|
|
4960
|
-
showIfKey,
|
|
4961
|
-
onShowIfKeyValueChange: (value) => {
|
|
4962
|
-
updateAttributes2({
|
|
4963
|
-
showIfKey: value
|
|
4964
|
-
});
|
|
4965
|
-
},
|
|
4966
|
-
editor
|
|
4967
|
-
}
|
|
4968
|
-
)
|
|
4920
|
+
] })
|
|
4969
4921
|
] }) })
|
|
4970
4922
|
}
|
|
4971
4923
|
)
|
|
@@ -5014,7 +4966,7 @@ function TextColorPickerPopup(props) {
|
|
|
5014
4966
|
size: "sm",
|
|
5015
4967
|
type: "button",
|
|
5016
4968
|
className: "mly-size-7",
|
|
5017
|
-
children: /* @__PURE__ */
|
|
4969
|
+
children: /* @__PURE__ */ jsxs21("div", { className: "mly-flex mly-flex-col mly-items-center mly-justify-center mly-gap-[1px]", children: [
|
|
5018
4970
|
/* @__PURE__ */ jsx41("span", { className: "mly-font-bolder mly-font-mono mly-text-xs mly-text-midnight-gray", children: "A" }),
|
|
5019
4971
|
/* @__PURE__ */ jsx41(
|
|
5020
4972
|
"div",
|
|
@@ -5597,10 +5549,10 @@ import { ReactNodeViewRenderer as ReactNodeViewRenderer6 } from "@tiptap/react";
|
|
|
5597
5549
|
// src/editor/nodes/for/for-view.tsx
|
|
5598
5550
|
import { NodeViewWrapper as NodeViewWrapper6, NodeViewContent } from "@tiptap/react";
|
|
5599
5551
|
import { Repeat2 as Repeat22 } from "lucide-react";
|
|
5600
|
-
import { jsx as jsx42, jsxs as
|
|
5552
|
+
import { jsx as jsx42, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5601
5553
|
function ForView(props) {
|
|
5602
5554
|
const { editor, getPos } = props;
|
|
5603
|
-
return /* @__PURE__ */
|
|
5555
|
+
return /* @__PURE__ */ jsxs22(
|
|
5604
5556
|
NodeViewWrapper6,
|
|
5605
5557
|
{
|
|
5606
5558
|
draggable: "true",
|
|
@@ -5609,7 +5561,7 @@ function ForView(props) {
|
|
|
5609
5561
|
className: "mly-relative",
|
|
5610
5562
|
children: [
|
|
5611
5563
|
/* @__PURE__ */ jsx42(NodeViewContent, { className: "is-editable" }),
|
|
5612
|
-
/* @__PURE__ */
|
|
5564
|
+
/* @__PURE__ */ jsxs22(
|
|
5613
5565
|
"div",
|
|
5614
5566
|
{
|
|
5615
5567
|
role: "button",
|
|
@@ -5715,7 +5667,7 @@ var ForExtension = Node9.create({
|
|
|
5715
5667
|
// src/editor/components/text-menu/turn-into-block.tsx
|
|
5716
5668
|
import { ChevronDownIcon as ChevronDownIcon3, PilcrowIcon } from "lucide-react";
|
|
5717
5669
|
import { useMemo as useMemo7 } from "react";
|
|
5718
|
-
import { jsx as jsx43, jsxs as
|
|
5670
|
+
import { jsx as jsx43, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
5719
5671
|
var isOption = (option) => option.type === "option";
|
|
5720
5672
|
var isCategory = (option) => option.type === "category";
|
|
5721
5673
|
function TurnIntoBlock(props) {
|
|
@@ -5725,9 +5677,9 @@ function TurnIntoBlock(props) {
|
|
|
5725
5677
|
[options]
|
|
5726
5678
|
);
|
|
5727
5679
|
const { icon: ActiveIcon = PilcrowIcon } = activeItem || {};
|
|
5728
|
-
return /* @__PURE__ */
|
|
5729
|
-
/* @__PURE__ */
|
|
5730
|
-
/* @__PURE__ */ jsx43(TooltipTrigger, { asChild: true, children: /* @__PURE__ */
|
|
5680
|
+
return /* @__PURE__ */ jsxs23(Popover, { children: [
|
|
5681
|
+
/* @__PURE__ */ jsxs23(Tooltip, { children: [
|
|
5682
|
+
/* @__PURE__ */ jsx43(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs23(
|
|
5731
5683
|
PopoverTrigger,
|
|
5732
5684
|
{
|
|
5733
5685
|
className: cn(
|
|
@@ -5750,7 +5702,7 @@ function TurnIntoBlock(props) {
|
|
|
5750
5702
|
className: "mly-flex mly-w-[160px] mly-flex-col mly-rounded-md mly-p-1",
|
|
5751
5703
|
children: options.map((option, index) => {
|
|
5752
5704
|
if (isOption(option)) {
|
|
5753
|
-
return /* @__PURE__ */
|
|
5705
|
+
return /* @__PURE__ */ jsxs23(
|
|
5754
5706
|
BaseButton,
|
|
5755
5707
|
{
|
|
5756
5708
|
onClick: option.onClick,
|
|
@@ -5877,7 +5829,7 @@ function useTurnIntoBlockOptions(editor) {
|
|
|
5877
5829
|
}
|
|
5878
5830
|
|
|
5879
5831
|
// src/editor/components/text-menu/text-bubble-menu.tsx
|
|
5880
|
-
import { Fragment as Fragment7, jsx as jsx44, jsxs as
|
|
5832
|
+
import { Fragment as Fragment7, jsx as jsx44, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
5881
5833
|
function TextBubbleMenu(props) {
|
|
5882
5834
|
var _a, _b, _c, _d;
|
|
5883
5835
|
const { editor, appendTo } = props;
|
|
@@ -5973,7 +5925,7 @@ function TextBubbleMenu(props) {
|
|
|
5973
5925
|
BubbleMenu6,
|
|
5974
5926
|
__spreadProps(__spreadValues({}, bubbleMenuProps), {
|
|
5975
5927
|
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",
|
|
5976
|
-
children: /* @__PURE__ */
|
|
5928
|
+
children: /* @__PURE__ */ jsxs24(TooltipProvider, { children: [
|
|
5977
5929
|
/* @__PURE__ */ jsx44(TurnIntoBlock, { options: turnIntoBlockOptions }),
|
|
5978
5930
|
/* @__PURE__ */ jsx44(Divider, { className: "mly-mx-0" }),
|
|
5979
5931
|
items.map((item, index) => /* @__PURE__ */ jsx44(BubbleMenuButton, __spreadValues({}, item), index)),
|
|
@@ -5986,7 +5938,7 @@ function TextBubbleMenu(props) {
|
|
|
5986
5938
|
}
|
|
5987
5939
|
}
|
|
5988
5940
|
),
|
|
5989
|
-
!state.isListActive && /* @__PURE__ */
|
|
5941
|
+
!state.isListActive && /* @__PURE__ */ jsxs24(Fragment7, { children: [
|
|
5990
5942
|
/* @__PURE__ */ jsx44(
|
|
5991
5943
|
BubbleMenuButton,
|
|
5992
5944
|
{
|
|
@@ -6046,7 +5998,7 @@ function TextBubbleMenu(props) {
|
|
|
6046
5998
|
size: "sm",
|
|
6047
5999
|
type: "button",
|
|
6048
6000
|
className: "!mly-h-7 mly-w-7 mly-shrink-0 mly-p-0",
|
|
6049
|
-
children: /* @__PURE__ */
|
|
6001
|
+
children: /* @__PURE__ */ jsxs24("div", { className: "mly-flex mly-flex-col mly-items-center mly-justify-center mly-gap-[1px]", children: [
|
|
6050
6002
|
/* @__PURE__ */ jsx44("span", { className: "mly-font-bolder mly-font-mono mly-text-xs mly-text-slate-700", children: "A" }),
|
|
6051
6003
|
/* @__PURE__ */ jsx44(
|
|
6052
6004
|
"div",
|
|
@@ -6289,7 +6241,7 @@ import {
|
|
|
6289
6241
|
useState as useState12
|
|
6290
6242
|
} from "react";
|
|
6291
6243
|
import tippy3 from "tippy.js";
|
|
6292
|
-
import { jsx as jsx46, jsxs as
|
|
6244
|
+
import { jsx as jsx46, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
6293
6245
|
function CommandList(props) {
|
|
6294
6246
|
const { items, command, editor } = props;
|
|
6295
6247
|
const [selectedIndex, setSelectedIndex] = useState12(0);
|
|
@@ -6339,7 +6291,7 @@ function CommandList(props) {
|
|
|
6339
6291
|
updateScrollView(container, item);
|
|
6340
6292
|
}
|
|
6341
6293
|
}, [selectedIndex]);
|
|
6342
|
-
return items.length > 0 ? /* @__PURE__ */
|
|
6294
|
+
return items.length > 0 ? /* @__PURE__ */ jsxs25("div", { className: "mly-z-50 mly-w-72 mly-rounded-md mly-border mly-border-gray-200 mly-bg-white mly-shadow-md mly-transition-all", children: [
|
|
6343
6295
|
/* @__PURE__ */ jsx46(
|
|
6344
6296
|
"div",
|
|
6345
6297
|
{
|
|
@@ -6347,7 +6299,7 @@ function CommandList(props) {
|
|
|
6347
6299
|
ref: commandListContainer,
|
|
6348
6300
|
className: "mly-no-scrollbar mly-h-auto mly-max-h-[330px] mly-overflow-y-auto mly-scroll-smooth mly-p-1",
|
|
6349
6301
|
children: items.map((item, index) => {
|
|
6350
|
-
return /* @__PURE__ */
|
|
6302
|
+
return /* @__PURE__ */ jsxs25(
|
|
6351
6303
|
"button",
|
|
6352
6304
|
{
|
|
6353
6305
|
className: cn(
|
|
@@ -6358,7 +6310,7 @@ function CommandList(props) {
|
|
|
6358
6310
|
type: "button",
|
|
6359
6311
|
children: [
|
|
6360
6312
|
/* @__PURE__ */ jsx46("div", { className: "mly-flex mly-h-6 mly-w-6 mly-shrink-0 mly-items-center mly-justify-center", children: item.icon }),
|
|
6361
|
-
/* @__PURE__ */
|
|
6313
|
+
/* @__PURE__ */ jsxs25("div", { children: [
|
|
6362
6314
|
/* @__PURE__ */ jsx46("p", { className: "mly-font-medium", children: item.title }),
|
|
6363
6315
|
/* @__PURE__ */ jsx46("p", { className: "mly-text-xs mly-text-gray-400", children: item.description })
|
|
6364
6316
|
] })
|
|
@@ -6369,15 +6321,15 @@ function CommandList(props) {
|
|
|
6369
6321
|
})
|
|
6370
6322
|
}
|
|
6371
6323
|
),
|
|
6372
|
-
/* @__PURE__ */ jsx46("div", { className: "mly-border-t mly-border-gray-200 mly-px-1 mly-py-3 mly-pl-4", children: /* @__PURE__ */
|
|
6373
|
-
/* @__PURE__ */
|
|
6324
|
+
/* @__PURE__ */ jsx46("div", { className: "mly-border-t mly-border-gray-200 mly-px-1 mly-py-3 mly-pl-4", children: /* @__PURE__ */ jsxs25("div", { className: "mly-flex mly-items-center", children: [
|
|
6325
|
+
/* @__PURE__ */ jsxs25("p", { className: "mly-text-center mly-text-xs mly-text-gray-400", children: [
|
|
6374
6326
|
/* @__PURE__ */ jsx46("kbd", { className: "mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium", children: "\u2191" }),
|
|
6375
6327
|
/* @__PURE__ */ jsx46("kbd", { className: "mly-ml-1 mly-rounded mly-border mly-p-1 mly-px-2 mly-font-medium", children: "\u2193" }),
|
|
6376
6328
|
" ",
|
|
6377
6329
|
"to navigate"
|
|
6378
6330
|
] }),
|
|
6379
6331
|
/* @__PURE__ */ jsx46("span", { "aria-hidden": "true", className: "mly-select-none mly-px-1", children: "\xB7" }),
|
|
6380
|
-
/* @__PURE__ */
|
|
6332
|
+
/* @__PURE__ */ jsxs25("p", { className: "mly-text-center mly-text-xs mly-text-gray-400", children: [
|
|
6381
6333
|
/* @__PURE__ */ jsx46("kbd", { className: "mly-rounded mly-border mly-p-1 mly-px-1.5 mly-font-medium", children: "Enter" }),
|
|
6382
6334
|
" ",
|
|
6383
6335
|
"to select"
|
|
@@ -6565,7 +6517,7 @@ function extensions(props) {
|
|
|
6565
6517
|
}
|
|
6566
6518
|
|
|
6567
6519
|
// src/editor/index.tsx
|
|
6568
|
-
import { jsx as jsx47, jsxs as
|
|
6520
|
+
import { jsx as jsx47, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
6569
6521
|
function Editor9(props) {
|
|
6570
6522
|
const {
|
|
6571
6523
|
config: {
|
|
@@ -6585,7 +6537,8 @@ function Editor9(props) {
|
|
|
6585
6537
|
variables = DEFAULT_VARIABLES,
|
|
6586
6538
|
blocks = DEFAULT_SLASH_COMMANDS,
|
|
6587
6539
|
variableTriggerCharacter = DEFAULT_VARIABLE_TRIGGER_CHAR,
|
|
6588
|
-
renderVariable = DEFAULT_RENDER_VARIABLE_FUNCTION
|
|
6540
|
+
renderVariable = DEFAULT_RENDER_VARIABLE_FUNCTION,
|
|
6541
|
+
placeholderUrl = DEFAULT_PLACEHOLDER_URL
|
|
6589
6542
|
} = props;
|
|
6590
6543
|
let formattedContent = null;
|
|
6591
6544
|
if (contentJson) {
|
|
@@ -6652,14 +6605,15 @@ function Editor9(props) {
|
|
|
6652
6605
|
blocks,
|
|
6653
6606
|
variableTriggerCharacter,
|
|
6654
6607
|
renderVariable,
|
|
6655
|
-
|
|
6608
|
+
placeholderUrl,
|
|
6609
|
+
children: /* @__PURE__ */ jsxs26(
|
|
6656
6610
|
"div",
|
|
6657
6611
|
{
|
|
6658
6612
|
className: cn("mly-editor mly-antialiased", wrapClassName),
|
|
6659
6613
|
ref: menuContainerRef,
|
|
6660
6614
|
children: [
|
|
6661
6615
|
hasMenuBar && /* @__PURE__ */ jsx47(EditorMenuBar, { config: props.config, editor }),
|
|
6662
|
-
/* @__PURE__ */
|
|
6616
|
+
/* @__PURE__ */ jsxs26(
|
|
6663
6617
|
"div",
|
|
6664
6618
|
{
|
|
6665
6619
|
className: cn(
|