@remarkablejames/editor 0.0.2 → 0.0.3
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/lib/{ActionMenuButton-Bmn3RME4.js → ActionMenuButton-D5HLfRzv.js} +9 -10
- package/lib/ActionMenuButton-DN6VHLkp.cjs +1 -0
- package/lib/Attachment.cjs +2 -2
- package/lib/Attachment.js +31 -33
- package/lib/Blockquote.cjs +2 -2
- package/lib/Blockquote.js +13 -12
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.js +11 -10
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.js +9 -8
- package/lib/Callout.cjs +1 -1
- package/lib/Callout.js +41 -45
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.js +13 -14
- package/lib/Code.cjs +1 -1
- package/lib/Code.js +6 -5
- package/lib/CodeBlock.cjs +1 -1
- package/lib/CodeBlock.js +30 -31
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.js +9 -8
- package/lib/Color.cjs +1 -1
- package/lib/Color.js +18 -19
- package/lib/Column.cjs +1 -1
- package/lib/Column.js +9 -8
- package/lib/{Drawer-DvGh9aXG.js → Drawer-B9l1SoRJ.js} +41 -47
- package/lib/Drawer-BN0lYcnJ.cjs +2 -0
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.js +3 -3
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.js +14 -15
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.js +24 -28
- package/lib/ExportPdf.cjs +3 -3
- package/lib/ExportPdf.js +14 -13
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.js +6 -6
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.js +7 -6
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.js +15 -14
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.js +26 -26
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +22 -23
- package/lib/History.cjs +1 -1
- package/lib/History.js +11 -11
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +10 -9
- package/lib/Iframe-CXFk3GEq.cjs +1 -0
- package/lib/{Iframe-CnnvV6cK.js → Iframe-MjeJ2OOI.js} +11 -13
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.js +2 -2
- package/lib/Image.cjs +1 -1
- package/lib/Image.js +4 -5
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +79 -82
- package/lib/ImportWord.cjs +1 -1
- package/lib/ImportWord.js +25 -26
- package/lib/Indent-BPX9XRos.cjs +1 -0
- package/lib/{Indent-Bsj8gKvT.js → Indent-CgwDItIf.js} +31 -30
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.js +2 -2
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.js +12 -11
- package/lib/{Katex-CilGTz7u.js → Katex-CZ4g3vA9.js} +19 -22
- package/lib/Katex-DIgsR_dS.cjs +4 -0
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.js +2 -2
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.js +19 -20
- package/lib/Link.cjs +1 -1
- package/lib/Link.js +2 -2
- package/lib/LinkEditBlock-B2bU0Mcr.cjs +5 -0
- package/lib/{LinkEditBlock-BD_WvA3r.js → LinkEditBlock-CaDV3Vq5.js} +19 -24
- package/lib/Mention.js +3 -3
- package/lib/Mermaid-B9h7XKFo.cjs +2 -0
- package/lib/{Mermaid-BrjU75Bs.js → Mermaid-EhYj_ICn.js} +45 -48
- package/lib/Mermaid.cjs +1 -1
- package/lib/Mermaid.js +2 -2
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.js +26 -28
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.js +11 -10
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.js +37 -42
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.js +5 -5
- package/lib/SlashCommandNodeView-COlWSlnE.cjs +1 -0
- package/lib/{SlashCommandNodeView-COx5qZ2y.js → SlashCommandNodeView-CY3peX5x.js} +39 -41
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +12 -11
- package/lib/{Table-BlM8yMhr.js → Table-Bw7rLue7.js} +46 -46
- package/lib/Table-DLrtX6T7.cjs +5 -0
- package/lib/Table.cjs +1 -1
- package/lib/Table.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.js +12 -11
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.js +26 -27
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.js +18 -19
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.js +9 -8
- package/lib/Twitter-Ck6vGefg.cjs +1 -0
- package/lib/{Twitter-BP8sYXX7.js → Twitter-pM0y5Z-L.js} +18 -22
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.js +2 -2
- package/lib/Video.cjs +1 -1
- package/lib/Video.js +4 -5
- package/lib/bubble.cjs +3 -3
- package/lib/bubble.js +77 -86
- package/lib/{clsx-m_C5j3RU.js → clsx-CDyrfCnw.js} +24 -24
- package/lib/{dropdown-menu-CkHN04Mx.cjs → dropdown-menu-DwR8tTs9.cjs} +1 -1
- package/lib/{dropdown-menu-C1hdPLCZ.js → dropdown-menu-nX-u8e2w.js} +1 -1
- package/lib/extensions/Image/Image.d.ts +11 -0
- package/lib/extensions/Image/components/ImageCropper.d.ts +1 -1
- package/lib/{index-B3Ijnbxs.js → index-C-tDsIKJ.js} +1 -1
- package/lib/{index-C1KQsOcg.js → index-C1WCZhyA.js} +1 -1
- package/lib/{index-C8FjP66D.js → index-CsSfYR30.js} +1 -1
- package/lib/index-Dib4cXXf.cjs +10 -0
- package/lib/{index-s3l5RdyW.js → index-DjDf4BK8.js} +1 -1
- package/lib/index-_WrFM-Fk.js +5054 -0
- package/lib/index.cjs +4 -4
- package/lib/index.js +147 -392
- package/lib/{popover-B05Fd8lC.cjs → popover-BY7j9SiD.cjs} +1 -1
- package/lib/{popover-CsSXh7w6.js → popover-CSvY4C-l.js} +1 -1
- package/lib/{renderNodeView-C_hPIdEs.js → renderNodeView-BJSrgyGj.js} +2 -2
- package/lib/{select-B3-5wTqn.js → select-BelNLNvT.js} +1 -1
- package/lib/{select-7ubC1NF0.cjs → select-Bu-5iIA9.cjs} +1 -1
- package/lib/{separator-CYCA8tSn.js → separator-Br5kcIJa.js} +12 -13
- package/lib/separator-Cp9Lg3HU.cjs +1 -0
- package/lib/style.css +1 -1
- package/lib/{textarea-1FhpmBkP.js → textarea-Ceev4t42.js} +1 -1
- package/lib/{textarea-Bjhcpp76.cjs → textarea-DfqvYaA6.cjs} +1 -1
- package/lib/theme/theme.d.ts +1 -1
- package/lib/{updatePosition-DvfTZHcH.js → updatePosition-e90ZrFWW.js} +2 -2
- package/package.json +1 -1
- package/lib/ActionMenuButton-C5P0Kzrb.cjs +0 -1
- package/lib/Drawer-gz9U5ArC.cjs +0 -2
- package/lib/Icon-CKM0tYbW.js +0 -15
- package/lib/Icon-CQyFgXeo.cjs +0 -1
- package/lib/Iframe-Ds6gG2YO.cjs +0 -1
- package/lib/ImageCropper-BKhXlnXN.cjs +0 -1
- package/lib/ImageCropper-DUzu_9-6.js +0 -896
- package/lib/Indent-D_7HOYYd.cjs +0 -1
- package/lib/Katex-lL3bHXJd.cjs +0 -4
- package/lib/LinkEditBlock-D3HSHmsU.cjs +0 -5
- package/lib/Mermaid-BfeLPzoS.cjs +0 -2
- package/lib/SlashCommandNodeView-DD-nlhM-.cjs +0 -1
- package/lib/Table-C21AlUrh.cjs +0 -5
- package/lib/Twitter-D46MnvPr.cjs +0 -1
- package/lib/Video-Bpd8W8l6.js +0 -231
- package/lib/Video-BwrHx6B1.cjs +0 -1
- package/lib/button-BmTP96NR.cjs +0 -1
- package/lib/button-CDIxPURh.js +0 -35
- package/lib/checkbox-7sfSdzy9.js +0 -29
- package/lib/checkbox-DyVlLWHv.cjs +0 -1
- package/lib/dialog-B-jOQ5i3.cjs +0 -1
- package/lib/dialog-QWWUWOGP.js +0 -95
- package/lib/events.constant-Bh2uzJud.js +0 -71
- package/lib/events.constant-ELn21EzG.cjs +0 -1
- package/lib/file-BLas99n7.js +0 -43
- package/lib/file-i7e4nQY2.cjs +0 -1
- package/lib/index-CAiZY1nx.js +0 -2741
- package/lib/index-DWSAk_9a.cjs +0 -1
- package/lib/input-qvpuOf-3.js +0 -21
- package/lib/input-s0JD5kf2.cjs +0 -1
- package/lib/isNumber-BTYSVlKo.cjs +0 -1
- package/lib/isNumber-WaBzl_0s.js +0 -15
- package/lib/label-CFax-gzo.cjs +0 -1
- package/lib/label-DC37f2RQ.js +0 -11
- package/lib/separator-ncbdw4oq.cjs +0 -1
- package/lib/tabs-BeHxylKH.js +0 -46
- package/lib/tabs-DBqNpGAq.cjs +0 -1
- package/lib/throttle-CRNq0z-O.js +0 -249
- package/lib/throttle-gTTvqDTW.cjs +0 -1
- package/lib/toggle-DoJTBdvy.js +0 -89
- package/lib/toggle-oFwBZC4x.cjs +0 -1
- package/lib/useButtonProps-BE10eHkG.js +0 -165
- package/lib/useButtonProps-CFu0GHzW.cjs +0 -1
package/lib/index.js
CHANGED
|
@@ -1,36 +1,24 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import * as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import { C as Re } from "./checkbox-7sfSdzy9.js";
|
|
12
|
-
import { L as B } from "./label-DC37f2RQ.js";
|
|
13
|
-
import { I as _ } from "./input-qvpuOf-3.js";
|
|
14
|
-
import { B as M } from "./button-CDIxPURh.js";
|
|
15
|
-
import { I as De } from "./Icon-CKM0tYbW.js";
|
|
16
|
-
import { V as Ve, c as Le } from "./Video-Bpd8W8l6.js";
|
|
17
|
-
import * as p from "@radix-ui/react-toast";
|
|
18
|
-
import { c as T, a as Se } from "./index-CAiZY1nx.js";
|
|
19
|
-
import { X as Pe } from "lucide-react";
|
|
20
|
-
import { useTheme as je, THEME as H } from "./theme.js";
|
|
21
|
-
const Ae = p.Provider, ce = C.forwardRef(({ className: e, ...i }, t) => /* @__PURE__ */ r(
|
|
22
|
-
p.Viewport,
|
|
1
|
+
import { jsx as i, jsxs as f, Fragment as m } from "react/jsx-runtime";
|
|
2
|
+
import { K as O } from "./clsx-CDyrfCnw.js";
|
|
3
|
+
import * as u from "react";
|
|
4
|
+
import { useEffect as x, useId as z } from "react";
|
|
5
|
+
import { c as l, S as H, r as L, U as Q, V as _, W as I, X as K } from "./index-_WrFM-Fk.js";
|
|
6
|
+
import * as c from "@radix-ui/react-toast";
|
|
7
|
+
import { X as Y } from "lucide-react";
|
|
8
|
+
import { useTheme as q, THEME as y } from "./theme.js";
|
|
9
|
+
const B = c.Provider, T = u.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ i(
|
|
10
|
+
c.Viewport,
|
|
23
11
|
{
|
|
24
|
-
ref:
|
|
25
|
-
className:
|
|
12
|
+
ref: e,
|
|
13
|
+
className: l(
|
|
26
14
|
"richtext-fixed richtext-top-0 richtext-z-[100] richtext-flex richtext-max-h-screen richtext-w-full richtext-flex-col-reverse richtext-p-4 sm:richtext-bottom-0 sm:richtext-right-0 sm:richtext-top-auto sm:richtext-flex-col md:richtext-max-w-[420px]",
|
|
27
|
-
|
|
15
|
+
t
|
|
28
16
|
),
|
|
29
|
-
...
|
|
17
|
+
...r
|
|
30
18
|
}
|
|
31
19
|
));
|
|
32
|
-
|
|
33
|
-
const
|
|
20
|
+
T.displayName = c.Viewport.displayName;
|
|
21
|
+
const F = H(
|
|
34
22
|
"richtext-group richtext-pointer-events-auto richtext-relative richtext-flex richtext-w-full richtext-items-center richtext-justify-between richtext-space-x-4 richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-p-6 richtext-pr-8 richtext-shadow-lg richtext-transition-all data-[swipe=cancel]:richtext-translate-x-0 data-[swipe=end]:richtext-translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:richtext-translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:richtext-transition-none data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[swipe=end]:richtext-animate-out data-[state=closed]:richtext-fade-out-80 data-[state=closed]:richtext-slide-out-to-right-full data-[state=open]:richtext-slide-in-from-top-full data-[state=open]:sm:richtext-slide-in-from-bottom-full",
|
|
35
23
|
{
|
|
36
24
|
variants: {
|
|
@@ -43,307 +31,74 @@ const Me = Se(
|
|
|
43
31
|
variant: "default"
|
|
44
32
|
}
|
|
45
33
|
}
|
|
46
|
-
),
|
|
47
|
-
|
|
34
|
+
), R = u.forwardRef(({ className: t, variant: r, ...e }, n) => /* @__PURE__ */ i(
|
|
35
|
+
c.Root,
|
|
48
36
|
{
|
|
49
37
|
ref: n,
|
|
50
|
-
className:
|
|
51
|
-
...
|
|
38
|
+
className: l(F({ variant: r }), t),
|
|
39
|
+
...e
|
|
52
40
|
}
|
|
53
41
|
));
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
|
|
42
|
+
R.displayName = c.Root.displayName;
|
|
43
|
+
const W = u.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ i(
|
|
44
|
+
c.Action,
|
|
57
45
|
{
|
|
58
|
-
ref:
|
|
59
|
-
className:
|
|
46
|
+
ref: e,
|
|
47
|
+
className: l(
|
|
60
48
|
"richtext-inline-flex richtext-h-8 richtext-shrink-0 richtext-items-center richtext-justify-center richtext-rounded-md !richtext-border richtext-bg-transparent richtext-px-3 richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors hover:richtext-bg-secondary focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-1 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 group-[.destructive]:richtext-border-muted/40 group-[.destructive]:hover:richtext-border-destructive/30 group-[.destructive]:hover:richtext-bg-destructive group-[.destructive]:hover:richtext-text-destructive-foreground group-[.destructive]:focus:richtext-ring-destructive",
|
|
61
|
-
|
|
49
|
+
t
|
|
62
50
|
),
|
|
63
|
-
...
|
|
51
|
+
...r
|
|
64
52
|
}
|
|
65
53
|
));
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
|
|
54
|
+
W.displayName = c.Action.displayName;
|
|
55
|
+
const E = u.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ i(
|
|
56
|
+
c.Close,
|
|
69
57
|
{
|
|
70
|
-
ref:
|
|
71
|
-
className:
|
|
58
|
+
ref: e,
|
|
59
|
+
className: l(
|
|
72
60
|
"richtext-absolute richtext-right-2 richtext-top-2 richtext-rounded-md richtext-p-1 richtext-text-foreground/50 richtext-opacity-0 richtext-transition-opacity hover:richtext-text-foreground focus:richtext-opacity-100 focus:richtext-outline-none focus:richtext-ring-2 group-hover:richtext-opacity-100 group-[.destructive]:richtext-text-red-300 group-[.destructive]:hover:richtext-text-red-50 group-[.destructive]:focus:richtext-ring-red-400 group-[.destructive]:focus:richtext-ring-offset-red-600",
|
|
73
|
-
|
|
61
|
+
t
|
|
74
62
|
),
|
|
75
63
|
"toast-close": "",
|
|
76
|
-
...
|
|
77
|
-
children: /* @__PURE__ */
|
|
64
|
+
...r,
|
|
65
|
+
children: /* @__PURE__ */ i(Y, { className: "richtext-h-4 richtext-w-4" })
|
|
78
66
|
}
|
|
79
67
|
));
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
|
|
68
|
+
E.displayName = c.Close.displayName;
|
|
69
|
+
const S = u.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ i(
|
|
70
|
+
c.Title,
|
|
83
71
|
{
|
|
84
|
-
ref:
|
|
85
|
-
className:
|
|
86
|
-
...
|
|
72
|
+
ref: e,
|
|
73
|
+
className: l("richtext-text-sm richtext-font-semibold", t),
|
|
74
|
+
...r
|
|
87
75
|
}
|
|
88
76
|
));
|
|
89
|
-
|
|
90
|
-
const
|
|
91
|
-
|
|
77
|
+
S.displayName = c.Title.displayName;
|
|
78
|
+
const C = u.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ i(
|
|
79
|
+
c.Description,
|
|
92
80
|
{
|
|
93
|
-
ref:
|
|
94
|
-
className:
|
|
95
|
-
...
|
|
81
|
+
ref: e,
|
|
82
|
+
className: l("richtext-text-sm richtext-opacity-90", t),
|
|
83
|
+
...r
|
|
96
84
|
}
|
|
97
85
|
));
|
|
98
|
-
|
|
99
|
-
function
|
|
100
|
-
const {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
if (!t || t.isDestroyed || R.length === 0 || c) {
|
|
107
|
-
h.target.value = "";
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
const U = Te(R, {
|
|
111
|
-
acceptMimes: a == null ? void 0 : a.acceptMimes,
|
|
112
|
-
maxSize: a == null ? void 0 : a.maxSize,
|
|
113
|
-
t: e,
|
|
114
|
-
toast: i,
|
|
115
|
-
onError: a.onError
|
|
116
|
-
});
|
|
117
|
-
if (U.length <= 0) {
|
|
118
|
-
h.target.value = "";
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
x(!0);
|
|
122
|
-
try {
|
|
123
|
-
if (a != null && a.multiple) {
|
|
124
|
-
const E = U.map(async (P) => {
|
|
125
|
-
let z = "";
|
|
126
|
-
return a.upload ? z = await a.upload(P) : z = URL.createObjectURL(P), z;
|
|
127
|
-
});
|
|
128
|
-
(await Promise.all(E)).forEach((P) => {
|
|
129
|
-
t.chain().focus().setImageInline({ src: P, inline: u, alt: o }).run();
|
|
130
|
-
});
|
|
131
|
-
} else {
|
|
132
|
-
const E = U[0];
|
|
133
|
-
let S = "";
|
|
134
|
-
a.upload ? S = await a.upload(E) : S = URL.createObjectURL(E), t.chain().focus().setImageInline({ src: S, inline: u, alt: o }).run();
|
|
135
|
-
}
|
|
136
|
-
d(!1), w(""), g(k);
|
|
137
|
-
} catch (E) {
|
|
138
|
-
console.error("Error uploading image", E), a.onError ? a.onError({
|
|
139
|
-
type: "upload",
|
|
140
|
-
message: e("editor.upload.error")
|
|
141
|
-
}) : i({
|
|
142
|
-
variant: "destructive",
|
|
143
|
-
title: e("editor.upload.error")
|
|
144
|
-
});
|
|
145
|
-
} finally {
|
|
146
|
-
x(!1), h.target.value = "";
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
function L(h) {
|
|
150
|
-
h.preventDefault(), h.stopPropagation(), t.chain().focus().setImageInline({ src: b, inline: u, alt: o }).run(), d(!1), g(k), y(""), w("");
|
|
151
|
-
}
|
|
152
|
-
function ve(h) {
|
|
153
|
-
var R;
|
|
154
|
-
h.preventDefault(), (R = V.current) == null || R.click();
|
|
155
|
-
}
|
|
156
|
-
return n ? /* @__PURE__ */ r(N, {}) : /* @__PURE__ */ r(X, { onOpenChange: d, open: s, children: /* @__PURE__ */ l(J, { children: [
|
|
157
|
-
/* @__PURE__ */ r(Z, { children: e("editor.image.dialog.title") }),
|
|
158
|
-
/* @__PURE__ */ l(
|
|
159
|
-
ae,
|
|
160
|
-
{
|
|
161
|
-
activationMode: "manual",
|
|
162
|
-
defaultValue: a.resourceImage === "both" || a.resourceImage === "upload" ? "upload" : "link",
|
|
163
|
-
children: [
|
|
164
|
-
a.resourceImage === "both" && /* @__PURE__ */ l(ne, { className: "richtext-grid richtext-w-full richtext-grid-cols-2", children: [
|
|
165
|
-
/* @__PURE__ */ r(j, { value: "upload", children: e("editor.image.dialog.tab.upload") }),
|
|
166
|
-
/* @__PURE__ */ r(j, { value: "link", children: e("editor.image.dialog.tab.url") })
|
|
167
|
-
] }),
|
|
168
|
-
/* @__PURE__ */ l("div", { className: "richtext-my-[10px] richtext-flex richtext-items-center richtext-gap-[4px]", children: [
|
|
169
|
-
/* @__PURE__ */ r(
|
|
170
|
-
Re,
|
|
171
|
-
{
|
|
172
|
-
checked: u,
|
|
173
|
-
onCheckedChange: (h) => {
|
|
174
|
-
g(h);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
),
|
|
178
|
-
/* @__PURE__ */ r(B, { children: e("editor.link.dialog.inline") })
|
|
179
|
-
] }),
|
|
180
|
-
a.enableAlt && /* @__PURE__ */ l("div", { className: "richtext-my-[10px]", children: [
|
|
181
|
-
/* @__PURE__ */ r(B, { className: "mb-[6px]", children: e("editor.imageUpload.alt") }),
|
|
182
|
-
/* @__PURE__ */ r(_, { onChange: (h) => w(h.target.value), required: !0, type: "text", value: o })
|
|
183
|
-
] }),
|
|
184
|
-
/* @__PURE__ */ l(A, { value: "upload", children: [
|
|
185
|
-
/* @__PURE__ */ l("div", { className: "richtext-flex richtext-items-center richtext-gap-[10px]", children: [
|
|
186
|
-
/* @__PURE__ */ r(
|
|
187
|
-
M,
|
|
188
|
-
{
|
|
189
|
-
className: "richtext-mt-1 richtext-w-full",
|
|
190
|
-
disabled: c,
|
|
191
|
-
onClick: ve,
|
|
192
|
-
size: "sm",
|
|
193
|
-
children: c ? /* @__PURE__ */ l(N, { children: [
|
|
194
|
-
e("editor.imageUpload.uploading"),
|
|
195
|
-
/* @__PURE__ */ r(De, { className: "richtext-ml-1 richtext-animate-spin", name: "Loader" })
|
|
196
|
-
] }) : e("editor.image.dialog.tab.upload")
|
|
197
|
-
}
|
|
198
|
-
),
|
|
199
|
-
/* @__PURE__ */ r(
|
|
200
|
-
Ce,
|
|
201
|
-
{
|
|
202
|
-
alt: o,
|
|
203
|
-
disabled: c,
|
|
204
|
-
editor: t,
|
|
205
|
-
imageInline: u,
|
|
206
|
-
onClose: () => {
|
|
207
|
-
w("");
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
)
|
|
211
|
-
] }),
|
|
212
|
-
/* @__PURE__ */ r(
|
|
213
|
-
"input",
|
|
214
|
-
{
|
|
215
|
-
accept: a.acceptMimes.join(",") || "image/*",
|
|
216
|
-
multiple: a.multiple,
|
|
217
|
-
onChange: I,
|
|
218
|
-
ref: V,
|
|
219
|
-
style: { display: "none" },
|
|
220
|
-
type: "file"
|
|
221
|
-
}
|
|
222
|
-
)
|
|
223
|
-
] }),
|
|
224
|
-
/* @__PURE__ */ r(A, { value: "link", children: /* @__PURE__ */ r("form", { onSubmit: L, children: /* @__PURE__ */ l("div", { className: "richtext-flex richtext-items-center richtext-gap-2", children: [
|
|
225
|
-
/* @__PURE__ */ r(
|
|
226
|
-
_,
|
|
227
|
-
{
|
|
228
|
-
autoFocus: !0,
|
|
229
|
-
onChange: (h) => y(h.target.value),
|
|
230
|
-
placeholder: e("editor.image.dialog.placeholder"),
|
|
231
|
-
required: !0,
|
|
232
|
-
type: "url",
|
|
233
|
-
value: b
|
|
234
|
-
}
|
|
235
|
-
),
|
|
236
|
-
/* @__PURE__ */ r(M, { type: "submit", children: e("editor.image.dialog.button.apply") })
|
|
237
|
-
] }) }) })
|
|
238
|
-
]
|
|
239
|
-
}
|
|
240
|
-
)
|
|
241
|
-
] }) });
|
|
242
|
-
}
|
|
243
|
-
function _e() {
|
|
244
|
-
const { t: e } = oe(), i = te(), { editorDisabled: t } = re(), [n, s] = v(""), d = Y(null), [f, c] = v(""), [x, m] = v(!1), b = ie(Ve.name), y = G.UPLOAD_VIDEO(i.id);
|
|
245
|
-
W(m, [y]);
|
|
246
|
-
const o = K(() => (b == null ? void 0 : b.options) ?? {}, [b]);
|
|
247
|
-
async function w(u) {
|
|
248
|
-
var L;
|
|
249
|
-
const g = (L = u == null ? void 0 : u.target) == null ? void 0 : L.files;
|
|
250
|
-
if (!i || i.isDestroyed || g.length === 0)
|
|
251
|
-
return;
|
|
252
|
-
const a = g[0];
|
|
253
|
-
let I = "";
|
|
254
|
-
o.upload ? I = await o.upload(a) : I = URL.createObjectURL(a), i.chain().focus().setVideo({
|
|
255
|
-
src: I,
|
|
256
|
-
width: "100%"
|
|
257
|
-
}).run(), m(!1);
|
|
258
|
-
}
|
|
259
|
-
function V(u) {
|
|
260
|
-
u.preventDefault(), u.stopPropagation(), n && (i.chain().focus().setVideo({
|
|
261
|
-
src: n,
|
|
262
|
-
width: "100%"
|
|
263
|
-
}).run(), m(!1), s(""));
|
|
264
|
-
}
|
|
265
|
-
function k(u) {
|
|
266
|
-
var g;
|
|
267
|
-
u.preventDefault(), (g = d.current) == null || g.click();
|
|
268
|
-
}
|
|
269
|
-
return t ? /* @__PURE__ */ r(N, {}) : /* @__PURE__ */ r(X, { onOpenChange: m, open: x, children: /* @__PURE__ */ l(J, { children: [
|
|
270
|
-
/* @__PURE__ */ r(Z, { children: e("editor.video.dialog.title") }),
|
|
271
|
-
/* @__PURE__ */ l(
|
|
272
|
-
ae,
|
|
273
|
-
{
|
|
274
|
-
activationMode: "manual",
|
|
275
|
-
defaultValue: (o == null ? void 0 : o.resourceVideo) === "both" || (o == null ? void 0 : o.resourceVideo) === "upload" ? "upload" : "link",
|
|
276
|
-
children: [
|
|
277
|
-
/* @__PURE__ */ l(ne, { className: "richtext-grid richtext-w-full richtext-grid-cols-2", children: [
|
|
278
|
-
((o == null ? void 0 : o.resourceVideo) === "both" || (o == null ? void 0 : o.resourceVideo) === "upload") && /* @__PURE__ */ r(j, { value: "upload", children: e("editor.video.dialog.tab.upload") }),
|
|
279
|
-
((o == null ? void 0 : o.resourceVideo) === "both" || (o == null ? void 0 : o.resourceVideo) === "link") && /* @__PURE__ */ r(j, { value: "link", children: e("editor.video.dialog.link") })
|
|
280
|
-
] }),
|
|
281
|
-
/* @__PURE__ */ l(A, { value: "upload", children: [
|
|
282
|
-
/* @__PURE__ */ r("div", { className: "richtext-flex richtext-items-center richtext-gap-[10px]", children: /* @__PURE__ */ r(M, { className: "richtext-mt-1 richtext-w-full", onClick: k, size: "sm", children: e("editor.video.dialog.tab.upload") }) }),
|
|
283
|
-
/* @__PURE__ */ r(
|
|
284
|
-
"input",
|
|
285
|
-
{
|
|
286
|
-
accept: "video/*",
|
|
287
|
-
multiple: !0,
|
|
288
|
-
onChange: w,
|
|
289
|
-
ref: d,
|
|
290
|
-
type: "file",
|
|
291
|
-
style: {
|
|
292
|
-
display: "none"
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
)
|
|
296
|
-
] }),
|
|
297
|
-
/* @__PURE__ */ l(A, { value: "link", children: [
|
|
298
|
-
/* @__PURE__ */ r("div", { children: /* @__PURE__ */ l("div", { className: "richtext-flex richtext-items-center richtext-gap-2", children: [
|
|
299
|
-
/* @__PURE__ */ r(
|
|
300
|
-
_,
|
|
301
|
-
{
|
|
302
|
-
autoFocus: !0,
|
|
303
|
-
placeholder: e("editor.video.dialog.placeholder"),
|
|
304
|
-
required: !0,
|
|
305
|
-
type: "url",
|
|
306
|
-
value: n,
|
|
307
|
-
onBlur: (u) => {
|
|
308
|
-
const g = u.target.value, a = o.videoProviders || ["."];
|
|
309
|
-
g && !Le(g, a) ? c("Invalid video URL") : c("");
|
|
310
|
-
},
|
|
311
|
-
onChange: (u) => {
|
|
312
|
-
s(u.target.value);
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
),
|
|
316
|
-
/* @__PURE__ */ r(M, { onClick: V, type: "button", children: e("editor.video.dialog.button.apply") })
|
|
317
|
-
] }) }),
|
|
318
|
-
f && /* @__PURE__ */ r("div", { className: "richtext-my-[5px] richtext-text-red-500", children: f })
|
|
319
|
-
] })
|
|
320
|
-
]
|
|
321
|
-
}
|
|
322
|
-
)
|
|
323
|
-
] }) });
|
|
324
|
-
}
|
|
325
|
-
function he() {
|
|
326
|
-
return /* @__PURE__ */ l(N, { children: [
|
|
327
|
-
/* @__PURE__ */ r(ze, {}),
|
|
328
|
-
/* @__PURE__ */ r(_e, {})
|
|
329
|
-
] });
|
|
330
|
-
}
|
|
331
|
-
process.env.NODE_ENV !== "production" && (he.displayName = "SlashDialogTrigger");
|
|
332
|
-
function Fe() {
|
|
333
|
-
const { toasts: e } = ee();
|
|
334
|
-
return /* @__PURE__ */ l(Ae, { children: [
|
|
335
|
-
e.map(({ id: i, title: t, description: n, action: s, ...d }) => /* @__PURE__ */ l(se, { ...d, children: [
|
|
336
|
-
/* @__PURE__ */ l("div", { className: "richtext-grid richtext-gap-1", children: [
|
|
337
|
-
t && /* @__PURE__ */ r(de, { children: t }),
|
|
338
|
-
n && /* @__PURE__ */ r(ue, { children: n })
|
|
86
|
+
C.displayName = c.Description.displayName;
|
|
87
|
+
function X() {
|
|
88
|
+
const { toasts: t } = L();
|
|
89
|
+
return /* @__PURE__ */ f(B, { children: [
|
|
90
|
+
t.map(({ id: r, title: e, description: n, action: o, ...s }) => /* @__PURE__ */ f(R, { ...s, children: [
|
|
91
|
+
/* @__PURE__ */ f("div", { className: "richtext-grid richtext-gap-1", children: [
|
|
92
|
+
e && /* @__PURE__ */ i(S, { children: e }),
|
|
93
|
+
n && /* @__PURE__ */ i(C, { children: n })
|
|
339
94
|
] }),
|
|
340
|
-
|
|
341
|
-
/* @__PURE__ */
|
|
342
|
-
] },
|
|
343
|
-
/* @__PURE__ */
|
|
95
|
+
o,
|
|
96
|
+
/* @__PURE__ */ i(E, {})
|
|
97
|
+
] }, r)),
|
|
98
|
+
/* @__PURE__ */ i(T, {})
|
|
344
99
|
] });
|
|
345
100
|
}
|
|
346
|
-
const
|
|
101
|
+
const U = `
|
|
347
102
|
.remarkablejames-editor {
|
|
348
103
|
button,
|
|
349
104
|
input:where([type=button]),
|
|
@@ -451,106 +206,106 @@ const $e = `
|
|
|
451
206
|
}
|
|
452
207
|
}
|
|
453
208
|
`;
|
|
454
|
-
function
|
|
455
|
-
const
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
}, [
|
|
459
|
-
const
|
|
460
|
-
|
|
209
|
+
function G({ editor: t }) {
|
|
210
|
+
const r = Q();
|
|
211
|
+
x(() => {
|
|
212
|
+
r(t == null ? void 0 : t.isEditable);
|
|
213
|
+
}, [t == null ? void 0 : t.isEditable]);
|
|
214
|
+
const e = () => {
|
|
215
|
+
r(t == null ? void 0 : t.isEditable);
|
|
461
216
|
};
|
|
462
|
-
return
|
|
463
|
-
|
|
464
|
-
}), [
|
|
217
|
+
return x(() => (t && t.on("update", e), () => {
|
|
218
|
+
t && t.off("update", e);
|
|
219
|
+
}), [t]), /* @__PURE__ */ i(m, {});
|
|
465
220
|
}
|
|
466
|
-
const
|
|
467
|
-
function
|
|
468
|
-
if (!
|
|
221
|
+
const w = "data-rc-order", N = "data-rc-priority", J = "rc-util-key", p = /* @__PURE__ */ new Map();
|
|
222
|
+
function Z(t, r) {
|
|
223
|
+
if (!t)
|
|
469
224
|
return !1;
|
|
470
|
-
if (
|
|
471
|
-
return
|
|
472
|
-
let
|
|
473
|
-
for (;
|
|
474
|
-
if (
|
|
225
|
+
if (t.contains)
|
|
226
|
+
return t.contains(r);
|
|
227
|
+
let e = r;
|
|
228
|
+
for (; e; ) {
|
|
229
|
+
if (e === t)
|
|
475
230
|
return !0;
|
|
476
|
-
|
|
231
|
+
e = e.parentNode;
|
|
477
232
|
}
|
|
478
233
|
return !1;
|
|
479
234
|
}
|
|
480
|
-
function
|
|
481
|
-
return
|
|
235
|
+
function j({ mark: t } = {}) {
|
|
236
|
+
return t ? t.startsWith("data-") ? t : `data-${t}` : J;
|
|
482
237
|
}
|
|
483
|
-
function
|
|
484
|
-
return
|
|
238
|
+
function g(t) {
|
|
239
|
+
return t.attachTo ? t.attachTo : document.querySelector("head") || document.body;
|
|
485
240
|
}
|
|
486
|
-
function
|
|
487
|
-
return
|
|
241
|
+
function tt(t) {
|
|
242
|
+
return t === "queue" ? "prependQueue" : t ? "prepend" : "append";
|
|
488
243
|
}
|
|
489
|
-
function
|
|
490
|
-
return [...(
|
|
491
|
-
(
|
|
244
|
+
function P(t) {
|
|
245
|
+
return [...(p.get(t) || t).children].filter(
|
|
246
|
+
(r) => r.tagName === "STYLE"
|
|
492
247
|
);
|
|
493
248
|
}
|
|
494
|
-
function
|
|
495
|
-
const { csp:
|
|
496
|
-
|
|
497
|
-
const
|
|
249
|
+
function A(t, r = {}) {
|
|
250
|
+
const { csp: e, prepend: n, priority: o = 0 } = r, s = tt(n), d = s === "prependQueue", a = document.createElement("style");
|
|
251
|
+
a.setAttribute(w, s), d && o && a.setAttribute(N, `${o}`), e != null && e.nonce && (a.nonce = e == null ? void 0 : e.nonce), a.innerHTML = t;
|
|
252
|
+
const h = g(r), { firstChild: V } = h;
|
|
498
253
|
if (n) {
|
|
499
|
-
if (
|
|
500
|
-
const b =
|
|
501
|
-
if (!["prepend", "prependQueue"].includes(
|
|
254
|
+
if (d) {
|
|
255
|
+
const b = P(h).filter((v) => {
|
|
256
|
+
if (!["prepend", "prependQueue"].includes(v.getAttribute(w)))
|
|
502
257
|
return !1;
|
|
503
|
-
const
|
|
504
|
-
return
|
|
258
|
+
const $ = Number(v.getAttribute(N) || 0);
|
|
259
|
+
return o >= $;
|
|
505
260
|
});
|
|
506
261
|
if (b.length > 0)
|
|
507
|
-
return
|
|
262
|
+
return h.insertBefore(a, b.at(-1).nextSibling), a;
|
|
508
263
|
}
|
|
509
|
-
|
|
264
|
+
V.before(a);
|
|
510
265
|
} else
|
|
511
|
-
|
|
512
|
-
return
|
|
266
|
+
h.append(a);
|
|
267
|
+
return a;
|
|
513
268
|
}
|
|
514
|
-
function
|
|
515
|
-
const
|
|
516
|
-
return
|
|
269
|
+
function M(t, r = {}) {
|
|
270
|
+
const e = g(r);
|
|
271
|
+
return P(e).find((n) => n.getAttribute(j(r)) === t);
|
|
517
272
|
}
|
|
518
|
-
function
|
|
519
|
-
const
|
|
520
|
-
|
|
273
|
+
function k(t, r = {}) {
|
|
274
|
+
const e = M(t, r);
|
|
275
|
+
e && e.remove();
|
|
521
276
|
}
|
|
522
|
-
function
|
|
523
|
-
const
|
|
524
|
-
if (!
|
|
525
|
-
const n =
|
|
526
|
-
|
|
277
|
+
function et(t, r) {
|
|
278
|
+
const e = p.get(t);
|
|
279
|
+
if (!e || !Z(document, e)) {
|
|
280
|
+
const n = A("", r), { parentNode: o } = n;
|
|
281
|
+
p.set(t, o), n.remove();
|
|
527
282
|
}
|
|
528
283
|
}
|
|
529
|
-
function
|
|
530
|
-
var
|
|
531
|
-
const n =
|
|
532
|
-
|
|
533
|
-
const
|
|
534
|
-
if (
|
|
535
|
-
return (
|
|
536
|
-
const
|
|
537
|
-
return
|
|
284
|
+
function D(t, r, e = {}) {
|
|
285
|
+
var d, a, h;
|
|
286
|
+
const n = g(e);
|
|
287
|
+
et(n, e);
|
|
288
|
+
const o = M(r, e);
|
|
289
|
+
if (o)
|
|
290
|
+
return (d = e.csp) != null && d.nonce && o.nonce !== ((a = e.csp) == null ? void 0 : a.nonce) && (o.nonce = (h = e.csp) == null ? void 0 : h.nonce), o.innerHTML !== t && (o.innerHTML = t), o;
|
|
291
|
+
const s = A(t, e);
|
|
292
|
+
return s.setAttribute(j(e), r), s;
|
|
538
293
|
}
|
|
539
|
-
function
|
|
540
|
-
const { theme:
|
|
541
|
-
return
|
|
542
|
-
const n =
|
|
543
|
-
let
|
|
544
|
-
if (!
|
|
545
|
-
|
|
294
|
+
function rt() {
|
|
295
|
+
const { theme: t, color: r, borderRadius: e } = q();
|
|
296
|
+
return x(() => {
|
|
297
|
+
const n = t || "light", o = r || "default";
|
|
298
|
+
let s = y[n][o];
|
|
299
|
+
if (!s) {
|
|
300
|
+
s = y.light.default;
|
|
546
301
|
return;
|
|
547
302
|
}
|
|
548
|
-
return
|
|
303
|
+
return D(
|
|
549
304
|
`
|
|
550
305
|
.remarkablejames-editor, .remarkablejames-editor *,
|
|
551
306
|
.remarkablejames-editor-theme, .remarkablejames-editor-theme *,
|
|
552
307
|
div[data-richtext-portal], div[data-richtext-portal] * {
|
|
553
|
-
${Object.entries(
|
|
308
|
+
${Object.entries(s).map(([d, a]) => typeof e == "string" && d === "radius" ? `--${d}: ${e};` : `--${d}: ${a};`).join(`
|
|
554
309
|
`)}
|
|
555
310
|
}
|
|
556
311
|
`,
|
|
@@ -559,25 +314,25 @@ function Ye() {
|
|
|
559
314
|
priority: 50
|
|
560
315
|
}
|
|
561
316
|
), () => {
|
|
562
|
-
|
|
317
|
+
k("richtext-theme");
|
|
563
318
|
};
|
|
564
|
-
}, [
|
|
319
|
+
}, [t, r, e]), /* @__PURE__ */ i(m, {});
|
|
565
320
|
}
|
|
566
|
-
function
|
|
567
|
-
const
|
|
568
|
-
return
|
|
569
|
-
|
|
570
|
-
}), []),
|
|
571
|
-
|
|
572
|
-
}, [
|
|
573
|
-
/* @__PURE__ */
|
|
574
|
-
/* @__PURE__ */
|
|
575
|
-
/* @__PURE__ */
|
|
576
|
-
/* @__PURE__ */
|
|
577
|
-
/* @__PURE__ */
|
|
578
|
-
] }) }) }) : /* @__PURE__ */
|
|
321
|
+
function dt({ editor: t, children: r }) {
|
|
322
|
+
const e = z();
|
|
323
|
+
return x(() => (D(U, "react-tiptap-reset"), () => {
|
|
324
|
+
k("react-tiptap-reset");
|
|
325
|
+
}), []), x(() => {
|
|
326
|
+
t && (t.id = e);
|
|
327
|
+
}, [e, t]), t ? /* @__PURE__ */ i("div", { className: "remarkablejames-editor", children: /* @__PURE__ */ i(_, { children: /* @__PURE__ */ f(O.Provider, { value: { editor: t }, children: [
|
|
328
|
+
/* @__PURE__ */ i(I, { delayDuration: 0, disableHoverableContent: !0, children: r }),
|
|
329
|
+
/* @__PURE__ */ i(G, { editor: t }),
|
|
330
|
+
/* @__PURE__ */ i(K, {}),
|
|
331
|
+
/* @__PURE__ */ i(rt, {}),
|
|
332
|
+
/* @__PURE__ */ i(X, {})
|
|
333
|
+
] }) }) }) : /* @__PURE__ */ i(m, {});
|
|
579
334
|
}
|
|
580
335
|
export {
|
|
581
|
-
|
|
582
|
-
|
|
336
|
+
dt as RichTextProvider,
|
|
337
|
+
I as TooltipProvider
|
|
583
338
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const a=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";const a=require("react/jsx-runtime"),d=require("@radix-ui/react-popover"),p=require("react"),h=require("./index-Dib4cXXf.cjs");function n(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const o=n(d),l=n(p),x=o.Root,m=o.Trigger,c=l.forwardRef(({className:t,align:r="center",sideOffset:e=4,...i},s)=>a.jsx(o.Portal,{children:a.jsx(o.Content,{align:r,"data-richtext-portal":!0,ref:s,sideOffset:e,className:h.cn("richtext-z-50 richtext-w-72 richtext-rounded-md !richtext-border !richtext-border-border richtext-bg-popover richtext-p-4 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",t),...i})}));c.displayName=o.Content.displayName;exports.Popover=x;exports.PopoverContent=c;exports.PopoverTrigger=m;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import * as t from "@radix-ui/react-popover";
|
|
3
3
|
import * as c from "react";
|
|
4
|
-
import { c as s } from "./index-
|
|
4
|
+
import { c as s } from "./index-_WrFM-Fk.js";
|
|
5
5
|
const x = t.Root, p = t.Trigger, n = c.forwardRef(({ className: o, align: r = "center", sideOffset: i = 4, ...a }, d) => /* @__PURE__ */ e(t.Portal, { children: /* @__PURE__ */ e(
|
|
6
6
|
t.Content,
|
|
7
7
|
{
|