richtor 1.0.4 → 1.0.7
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/editor.es.js +15 -14
- package/dist/editor.umd.js +3 -3
- package/dist/richtor.css +1 -1
- package/package.json +1 -1
package/dist/editor.es.js
CHANGED
|
@@ -40263,6 +40263,7 @@ const If = ({
|
|
|
40263
40263
|
/* @__PURE__ */ S("div", { className: "rte-cp__tabs", children: ["swatches", "custom"].map((c) => /* @__PURE__ */ S(
|
|
40264
40264
|
Hi,
|
|
40265
40265
|
{
|
|
40266
|
+
type: "button",
|
|
40266
40267
|
variant: "ghost",
|
|
40267
40268
|
"data-active": e === c || void 0,
|
|
40268
40269
|
onClick: () => n(c),
|
|
@@ -40285,8 +40286,8 @@ const If = ({
|
|
|
40285
40286
|
] })
|
|
40286
40287
|
] }),
|
|
40287
40288
|
/* @__PURE__ */ S(Bp, { asChild: !0, children: /* @__PURE__ */ me("div", { className: "rte-cp__actions", children: [
|
|
40288
|
-
/* @__PURE__ */ S(Hi, { variant: "secondary", iconOnly: !0, onClick: t.onReset, children: /* @__PURE__ */ S(oc, { name: "PaletteOff" }) }),
|
|
40289
|
-
/* @__PURE__ */ S(Hi, { style: { width: "100%" }, onClick: l, children: "Apply" })
|
|
40289
|
+
/* @__PURE__ */ S(Hi, { variant: "secondary", iconOnly: !0, type: "button", onClick: t.onReset, children: /* @__PURE__ */ S(oc, { name: "PaletteOff" }) }),
|
|
40290
|
+
/* @__PURE__ */ S(Hi, { style: { width: "100%" }, type: "button", onClick: l, children: "Apply" })
|
|
40290
40291
|
] }) })
|
|
40291
40292
|
] });
|
|
40292
40293
|
}, hse = () => {
|
|
@@ -43496,12 +43497,12 @@ const _oe = () => {
|
|
|
43496
43497
|
active: a.editor.isActive("youtube"),
|
|
43497
43498
|
disabled: !a.editor.isEditable
|
|
43498
43499
|
})
|
|
43499
|
-
}), o = (
|
|
43500
|
-
|
|
43500
|
+
}), o = () => {
|
|
43501
|
+
r.trim() && (t.chain().focus().embedYoutube({ src: r }).run(), i("https://www.youtube.com/watch?v=DupfnOCH-JI"), n(!1));
|
|
43501
43502
|
};
|
|
43502
43503
|
return /* @__PURE__ */ me(Soe, { open: e, onOpenChange: n, children: [
|
|
43503
43504
|
/* @__PURE__ */ S(Oe, { icon: "Youtube", tooltip: "Youtube", onClick: () => n(!0), ...s }),
|
|
43504
|
-
/* @__PURE__ */
|
|
43505
|
+
/* @__PURE__ */ me(xoe, { className: "sm:max-w-[425px]", children: [
|
|
43505
43506
|
/* @__PURE__ */ me(voe, { children: [
|
|
43506
43507
|
/* @__PURE__ */ S(Doe, { children: "Embed YouTube Video" }),
|
|
43507
43508
|
/* @__PURE__ */ S(Aoe, { children: "Enter the YouTube video URL to embed it in your content." })
|
|
@@ -43520,10 +43521,10 @@ const _oe = () => {
|
|
|
43520
43521
|
)
|
|
43521
43522
|
] }) }),
|
|
43522
43523
|
/* @__PURE__ */ me(koe, { children: [
|
|
43523
|
-
/* @__PURE__ */ S(Coe, { asChild: !0, children: /* @__PURE__ */ S(Hi, { variant: "outline", children: "Cancel" }) }),
|
|
43524
|
-
/* @__PURE__ */ S(Hi, { type: "
|
|
43524
|
+
/* @__PURE__ */ S(Coe, { asChild: !0, children: /* @__PURE__ */ S(Hi, { type: "button", variant: "outline", children: "Cancel" }) }),
|
|
43525
|
+
/* @__PURE__ */ S(Hi, { onClick: o, type: "button", variant: "primary", children: "Embed Video" })
|
|
43525
43526
|
] })
|
|
43526
|
-
] })
|
|
43527
|
+
] })
|
|
43527
43528
|
] });
|
|
43528
43529
|
}, Poe = () => {
|
|
43529
43530
|
const { editor: t } = Fe(), e = Ve({
|
|
@@ -45840,12 +45841,12 @@ const Qae = ({ initialText: t, onApply: e, onCancel: n }) => {
|
|
|
45840
45841
|
} else t instanceof de && (e = t.node, n = t.from, e.type.name === "imageFigure" && (e = e.firstChild, n += 1));
|
|
45841
45842
|
return { node: e, pos: n };
|
|
45842
45843
|
}, Vae = ({ initialUrl: t, initialText: e, isCreate: n, onApply: r, onCancel: i }) => {
|
|
45843
|
-
const [s, o] = ut(t || ""), [a, l] = ut(e || ""), [u, c] = ut(n), d = (
|
|
45844
|
-
|
|
45844
|
+
const [s, o] = ut(t || ""), [a, l] = ut(e || ""), [u, c] = ut(n), d = () => {
|
|
45845
|
+
u && r(s, a);
|
|
45845
45846
|
};
|
|
45846
45847
|
return Bt(() => {
|
|
45847
45848
|
n || c(s && s !== t || a !== e);
|
|
45848
|
-
}, [a, s]), /* @__PURE__ */ me("
|
|
45849
|
+
}, [a, s]), /* @__PURE__ */ me("div", { className: "rte-link__form", onSubmit: d, children: [
|
|
45849
45850
|
/* @__PURE__ */ S(If, { className: "rte-link__label", children: "URL" }),
|
|
45850
45851
|
/* @__PURE__ */ S(
|
|
45851
45852
|
qo,
|
|
@@ -45862,8 +45863,8 @@ const Qae = ({ initialText: t, onApply: e, onCancel: n }) => {
|
|
|
45862
45863
|
/* @__PURE__ */ S(If, { className: "rte-link__label", children: "Display Text" }),
|
|
45863
45864
|
/* @__PURE__ */ S(qo, { value: a, onChange: (h) => l(h.target.value), className: "rte-link__input", placeholder: "Enter link text" }),
|
|
45864
45865
|
/* @__PURE__ */ me("div", { className: "rte-link__actions", children: [
|
|
45865
|
-
/* @__PURE__ */ S(Hi, { variant: "secondary", onClick: i, children: "Cancel" }),
|
|
45866
|
-
/* @__PURE__ */ S(Hi, { type: "
|
|
45866
|
+
/* @__PURE__ */ S(Hi, { type: "button", variant: "secondary", onClick: i, children: "Cancel" }),
|
|
45867
|
+
/* @__PURE__ */ S(Hi, { type: "button", disabled: !u, onClick: d, children: "Apply" })
|
|
45867
45868
|
] })
|
|
45868
45869
|
] });
|
|
45869
45870
|
}, Xae = ({ url: t, onEdit: e, onRemove: n }) => {
|
|
@@ -61942,7 +61943,7 @@ function n5({ components: t } = {}) {
|
|
|
61942
61943
|
}
|
|
61943
61944
|
const Gpe = ({ code: t }) => {
|
|
61944
61945
|
const [e, n] = ut(!1);
|
|
61945
|
-
return /* @__PURE__ */ S("button", { onClick: async () => {
|
|
61946
|
+
return /* @__PURE__ */ S("button", { type: "button", onClick: async () => {
|
|
61946
61947
|
try {
|
|
61947
61948
|
await navigator.clipboard.writeText(t), n(!0), setTimeout(() => n(!1), 2e3);
|
|
61948
61949
|
} catch {
|