reactjs-tiptap-editor 1.0.10 → 1.0.12
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-CKTxYtl7.js → ActionMenuButton-BKqin6Kz.js} +17 -13
- package/lib/ActionMenuButton-CPPHERbq.cjs +1 -0
- package/lib/Attachment.cjs +2 -2
- package/lib/Attachment.js +24 -21
- package/lib/Blockquote.cjs +2 -2
- package/lib/Blockquote.js +7 -5
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.js +11 -9
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.js +14 -12
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.js +3 -3
- package/lib/Code.cjs +1 -1
- package/lib/Code.js +11 -9
- package/lib/CodeBlock.cjs +22 -22
- package/lib/CodeBlock.js +102 -100
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.js +10 -8
- package/lib/Color.cjs +1 -1
- package/lib/Color.js +20 -18
- package/lib/Column.cjs +1 -1
- package/lib/Column.js +7 -5
- package/lib/{Drawer-Cfx115up.js → Drawer-DUPsBE0H.js} +10 -9
- package/lib/Drawer-fplzqNI6.cjs +1 -0
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.js +3 -3
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.js +11 -9
- package/lib/{Excalidraw-CO93Tsmb.js → Excalidraw-BEzpvRLx.js} +20 -19
- package/lib/Excalidraw-qjnQspLq.cjs +1 -0
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.js +2 -2
- package/lib/ExportPdf.cjs +2 -2
- package/lib/ExportPdf.js +7 -5
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.js +7 -5
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.js +9 -8
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.js +13 -12
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.js +25 -24
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +9 -7
- package/lib/History.cjs +1 -1
- package/lib/History.js +18 -15
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +7 -5
- package/lib/Icon-CiR8RqdQ.cjs +1 -0
- package/lib/Icon-ONE1AwKo.js +12 -0
- package/lib/{Iframe-DwhclppJ.js → Iframe-CBTnv2mk.js} +41 -39
- package/lib/Iframe-DsUNJ2n2.cjs +1 -0
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.js +2 -2
- package/lib/Image.cjs +1 -1
- package/lib/Image.js +25 -23
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +53 -51
- package/lib/ImportWord.cjs +31 -31
- package/lib/ImportWord.js +8 -6
- package/lib/{Indent-BOsymiZ7.js → Indent-B00o0P0M.js} +26 -24
- package/lib/Indent-CaGP0qTp.cjs +1 -0
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.js +2 -2
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.js +12 -10
- package/lib/Katex-XsfpKgJU.cjs +4 -0
- package/lib/{Katex-BYK-b9X2.js → Katex-x370CSXZ.js} +12 -10
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.js +2 -2
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.js +10 -8
- package/lib/Link.cjs +1 -1
- package/lib/Link.js +2 -2
- package/lib/{LinkEditBlock-DgrLUMsJ.js → LinkEditBlock-C_ipl3EA.js} +23 -21
- package/lib/{LinkEditBlock-4-iRXH7m.cjs → LinkEditBlock-xt88G5fb.cjs} +2 -2
- package/lib/Mention.cjs +1 -1
- package/lib/Mention.js +3 -3
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.js +18 -17
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.js +25 -22
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.js +10 -8
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.js +43 -41
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.js +6 -6
- package/lib/SlashCommandNodeView-BT5ystah.cjs +1 -0
- package/lib/{SlashCommandNodeView-BpNNU7Sm.js → SlashCommandNodeView-DX6axvLs.js} +75 -66
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +7 -5
- package/lib/Table-DSRSwtXx.cjs +9 -0
- package/lib/{Table-CT9R9Sdq.js → Table-DidusYID.js} +10 -8
- package/lib/Table.cjs +1 -1
- package/lib/Table.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.js +15 -13
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.js +20 -17
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.js +20 -17
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.js +7 -5
- package/lib/Twitter-CBuVBQM1.cjs +1 -0
- package/lib/{Twitter-mowilxRd.js → Twitter-D58T0Zt3.js} +51 -49
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.js +2 -2
- package/lib/Video.cjs +1 -1
- package/lib/Video.js +13 -11
- package/lib/bubble.cjs +4 -4
- package/lib/bubble.js +403 -407
- package/lib/{button-CBO-WDXK.js → button-9_8t7ca7.js} +4 -3
- package/lib/button-Cs9TroWr.cjs +1 -0
- package/lib/{checkbox-DUcLSGZD.cjs → checkbox-BQRKTXXr.cjs} +1 -1
- package/lib/{checkbox-D1h32VWM.js → checkbox-DnkkV6qo.js} +1 -1
- package/lib/{index-BBNITgNi.cjs → clsx-CXbNJWDD.cjs} +13 -13
- package/lib/{index-sVScpCFG.js → clsx-DmuN0U_8.js} +228 -228
- package/lib/{dialog-DY868Uji.cjs → dialog-BS3zm-T9.cjs} +1 -1
- package/lib/{dialog-DSvgtlDI.js → dialog-DhayAPvV.js} +1 -1
- package/lib/{dropdown-menu-BripAeGB.cjs → dropdown-menu-CxwWX0yj.cjs} +1 -1
- package/lib/{dropdown-menu-B88Qn2KR.js → dropdown-menu-DQqKeZcx.js} +1 -1
- package/lib/events.constant-Dq21NPdV.cjs +1 -0
- package/lib/events.constant-do95b767.js +21 -0
- package/lib/{index-CApXPpjF.cjs → index-BCzvbrf5.cjs} +1 -1
- package/lib/{index-0OnGZkVF.js → index-BDX1uE62.js} +78 -312
- package/lib/index-CBFmXCcU.cjs +1 -0
- package/lib/{index-DmPwbBqm.js → index-CKmT9KAQ.js} +1 -1
- package/lib/index-CVFzP1Dc.cjs +1 -0
- package/lib/index-CX4pNJlH.cjs +1 -0
- package/lib/index-CjhjjJsN.cjs +1 -0
- package/lib/index-Cs6cp0Y6.cjs +1 -0
- package/lib/{index-9A6-kVBM.js → index-D1jd7elj.js} +1 -1
- package/lib/{index-BIqaogQg.js → index-D9JOHlso.js} +449 -1216
- package/lib/{index-DRHrDScg.js → index-DdEmgiAA.js} +1 -1
- package/lib/{index-DKt5wfAc.js → index-DvvwJvau.js} +23 -23
- package/lib/index-EAK64CCA.js +425 -0
- package/lib/{index--nUS7Y66.cjs → index-neeeY2o7.cjs} +3 -3
- package/lib/index.cjs +9 -2
- package/lib/index.js +142 -26
- package/lib/{input-BeD5GdMv.cjs → input-BJ7ihMq-.cjs} +1 -1
- package/lib/{input-Bx4uo4gO.js → input-YoheBL2D.js} +1 -1
- package/lib/{isNumber-Bv1Qhmw8.cjs → isNumber-BTYSVlKo.cjs} +1 -1
- package/lib/{isNumber-DF0fU3ob.js → isNumber-DmQXlKp3.js} +1 -1
- package/lib/label-C8PLcjFI.js +19 -0
- package/lib/label-Y7_hvqf2.cjs +1 -0
- package/lib/locale-bundle.cjs +1 -1
- package/lib/locale-bundle.js +6 -7
- package/lib/locales/index.d.ts +3 -4316
- package/lib/{popover-Csk538NC.cjs → popover-BiSrlM4j.cjs} +1 -1
- package/lib/{popover-BVX8otO9.js → popover-CWmTzHSy.js} +1 -1
- package/lib/react-BEoMZB61.cjs +1 -0
- package/lib/react-c9FSfB30.js +27 -0
- package/lib/separator-C-DKMYmg.js +329 -0
- package/lib/separator-CJ_adziN.cjs +1 -0
- package/lib/store/EditorEditableReactive.d.ts +1 -0
- package/lib/store/ThemeColorReactive.d.ts +1 -0
- package/lib/store/commandList.d.ts +1 -1
- package/lib/store/store.d.ts +6 -7
- package/lib/store-BKMaw1AW.cjs +1 -0
- package/lib/store-DG7cMfET.js +10 -0
- package/lib/style.css +1 -1
- package/lib/{tabs-DOasUMDU.cjs → tabs-DpHSMyF_.cjs} +1 -1
- package/lib/{tabs-BKpr0QQB.js → tabs-DxlKKM-N.js} +1 -1
- package/lib/{textarea-Ba9OOzba.js → textarea-D7m-apUh.js} +1 -1
- package/lib/{textarea-D9egO4qC.cjs → textarea-DU9RMi6u.cjs} +1 -1
- package/lib/theme/theme.d.ts +5 -0
- package/lib/theme.cjs +1 -1
- package/lib/theme.js +37 -8
- package/lib/{throttle-DsowOft0.js → throttle-BRtichEP.js} +1 -1
- package/lib/throttle-gTTvqDTW.cjs +1 -0
- package/lib/toggle-BYvLnjCL.cjs +1 -0
- package/lib/toggle-Bxwwb_Kp.js +99 -0
- package/lib/tooltip-BTy5CRrN.js +24 -0
- package/lib/tooltip-COvf4_R-.cjs +1 -0
- package/lib/{updatePosition-Bbd8ETMv.js → updatePosition-CUukgu-Q.js} +2 -2
- package/lib/updatePosition-Cjuj2E26.cjs +1 -0
- package/lib/{useButtonProps-C_bqxmHi.js → useButtonProps-CfYtuEnd.js} +48 -36
- package/lib/useButtonProps-CydzndG1.cjs +1 -0
- package/lib/utils/customEvents/events.constant.d.ts +0 -5
- package/package.json +3 -3
- package/lib/ActionMenuButton-BPdRqzDX.cjs +0 -1
- package/lib/Drawer-hHj4Opkg.cjs +0 -1
- package/lib/Excalidraw-8pWJ17Ye.cjs +0 -1
- package/lib/Icon-D7GJZzoa.js +0 -10
- package/lib/Icon-gtc3g-VK.cjs +0 -1
- package/lib/Iframe-BmXO2c65.cjs +0 -1
- package/lib/Indent-DPkMWfcv.cjs +0 -1
- package/lib/Katex-B1XbT8-X.cjs +0 -4
- package/lib/SlashCommandNodeView-CQvMTXys.cjs +0 -1
- package/lib/Table-LnWGm2m8.cjs +0 -9
- package/lib/Twitter-Bo4JkBTL.cjs +0 -1
- package/lib/button-wt49IYwP.cjs +0 -1
- package/lib/events.constant-DQYeJpu5.cjs +0 -1
- package/lib/events.constant-wrlJ_7JZ.js +0 -26
- package/lib/index-BZ6DfR2r.cjs +0 -1
- package/lib/index-BvIJKpX1.cjs +0 -8
- package/lib/index-Cv9Z6dyV.cjs +0 -1
- package/lib/index-FSRjMsxW.cjs +0 -1
- package/lib/label--161UPH6.cjs +0 -1
- package/lib/label-uKG7RzFU.js +0 -18
- package/lib/separator-DLRVddHS.cjs +0 -1
- package/lib/separator-DtrEdjAF.js +0 -241
- package/lib/store/ProviderUniqueId.d.ts +0 -6
- package/lib/store-B8IkVz1J.cjs +0 -1
- package/lib/store-CsIFDUKR.js +0 -10
- package/lib/throttle-BM3Bmbf_.cjs +0 -1
- package/lib/updatePosition-M2IyqkI1.cjs +0 -1
- package/lib/useButtonProps-DEtmDVPr.cjs +0 -1
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
|
-
import * as P from "react";
|
|
3
|
-
import { useState as f, useMemo as S, useCallback as M } from "react";
|
|
4
|
-
import { Plus as R } from "lucide-react";
|
|
5
|
-
import { HexColorPicker as O } from "react-colorful";
|
|
6
|
-
import { j as B, c as _ } from "./index-BIqaogQg.js";
|
|
7
|
-
import { B as $ } from "./button-CBO-WDXK.js";
|
|
8
|
-
import { I as j } from "./input-Bx4uo4gO.js";
|
|
9
|
-
import { P as v, a as b, b as g } from "./popover-BVX8otO9.js";
|
|
10
|
-
import * as C from "@radix-ui/react-separator";
|
|
11
|
-
import { u as L, C as D } from "./index-0OnGZkVF.js";
|
|
12
|
-
function I() {
|
|
13
|
-
return /* @__PURE__ */ e("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { fill: "currentColor", d: "M18 14c0-4-6-10.8-6-10.8s-1.33 1.51-2.73 3.52l8.59 8.59c.09-.42.14-.86.14-1.31m-.88 3.12L12.5 12.5L5.27 5.27L4 6.55l3.32 3.32C6.55 11.32 6 12.79 6 14c0 3.31 2.69 6 6 6c1.52 0 2.9-.57 3.96-1.5l2.63 2.63l1.27-1.27z" }) });
|
|
14
|
-
}
|
|
15
|
-
function J(l) {
|
|
16
|
-
const { t: h } = L(), {
|
|
17
|
-
disabled: n = !1,
|
|
18
|
-
value: a,
|
|
19
|
-
onChange: i,
|
|
20
|
-
colors: d = D,
|
|
21
|
-
highlight: x
|
|
22
|
-
} = l, [c, u] = f(!1), w = S(() => {
|
|
23
|
-
const t = d, r = [];
|
|
24
|
-
for (let o = 0; o < t.length; o += 10)
|
|
25
|
-
r.push(t.slice(o, o + 10));
|
|
26
|
-
return r;
|
|
27
|
-
}, [d]), [p, k] = B(x ? "richtext-recent-highlight" : "richtext-recent-colors", []), y = (t) => {
|
|
28
|
-
const r = [...p], o = r.indexOf(t);
|
|
29
|
-
o !== -1 && r.splice(o, 1), r.unshift(t), r.length > 10 && r.pop(), k(r);
|
|
30
|
-
};
|
|
31
|
-
function m(t) {
|
|
32
|
-
if (t === void 0) {
|
|
33
|
-
i == null || i(t), u(!1);
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
/^#([\da-f]{3}){1,2}$/i.test(t) && (i == null || i(t), y(t), u(!1));
|
|
37
|
-
}
|
|
38
|
-
return /* @__PURE__ */ s(
|
|
39
|
-
v,
|
|
40
|
-
{
|
|
41
|
-
modal: !0,
|
|
42
|
-
onOpenChange: u,
|
|
43
|
-
open: c,
|
|
44
|
-
children: [
|
|
45
|
-
/* @__PURE__ */ e(
|
|
46
|
-
b,
|
|
47
|
-
{
|
|
48
|
-
asChild: !0,
|
|
49
|
-
className: "!richtext-p-0",
|
|
50
|
-
disabled: n,
|
|
51
|
-
children: l == null ? void 0 : l.children
|
|
52
|
-
}
|
|
53
|
-
),
|
|
54
|
-
/* @__PURE__ */ e(
|
|
55
|
-
g,
|
|
56
|
-
{
|
|
57
|
-
align: "start",
|
|
58
|
-
className: "richtext-size-full !richtext-p-2",
|
|
59
|
-
hideWhenDetached: !0,
|
|
60
|
-
side: "bottom",
|
|
61
|
-
children: /* @__PURE__ */ s("div", { className: "richtext-flex richtext-flex-col", children: [
|
|
62
|
-
/* @__PURE__ */ s(
|
|
63
|
-
"div",
|
|
64
|
-
{
|
|
65
|
-
className: "rd-1 richtext-flex richtext-cursor-pointer richtext-items-center richtext-gap-[4px] richtext-p-1 hover:richtext-bg-accent",
|
|
66
|
-
onClick: () => {
|
|
67
|
-
m(void 0);
|
|
68
|
-
},
|
|
69
|
-
children: [
|
|
70
|
-
/* @__PURE__ */ e(I, {}),
|
|
71
|
-
/* @__PURE__ */ e("span", { className: "richtext-ml-1 richtext-text-sm", children: h(x ? "editor.nofill" : "editor.default") })
|
|
72
|
-
]
|
|
73
|
-
}
|
|
74
|
-
),
|
|
75
|
-
w.map((t, r) => /* @__PURE__ */ e(
|
|
76
|
-
"span",
|
|
77
|
-
{
|
|
78
|
-
className: "richtext-relative richtext-flex richtext-h-auto richtext-w-full richtext-p-0 last:richtext-pb-2",
|
|
79
|
-
children: t.map((o, z) => /* @__PURE__ */ e(
|
|
80
|
-
"span",
|
|
81
|
-
{
|
|
82
|
-
className: "richtext-inline-block richtext-size-6 richtext-flex-[0_0_auto] richtext-cursor-pointer richtext-rounded-sm !richtext-border richtext-border-solid !richtext-border-transparent richtext-p-0.5 hover:!richtext-border-border",
|
|
83
|
-
onClick: () => m(o),
|
|
84
|
-
children: /* @__PURE__ */ e(
|
|
85
|
-
"span",
|
|
86
|
-
{
|
|
87
|
-
className: "richtext-relative richtext-block richtext-size-[18px] richtext-rounded-[2px]",
|
|
88
|
-
style: {
|
|
89
|
-
backgroundColor: o
|
|
90
|
-
},
|
|
91
|
-
children: o === a ? /* @__PURE__ */ e(
|
|
92
|
-
"svg",
|
|
93
|
-
{
|
|
94
|
-
className: "richtext-absolute -richtext-top-px richtext-left-px richtext-block richtext-size-3",
|
|
95
|
-
viewBox: "0 0 18 18",
|
|
96
|
-
style: {
|
|
97
|
-
fill: "rgb(255, 255, 255)"
|
|
98
|
-
},
|
|
99
|
-
children: /* @__PURE__ */ e("path", { d: "M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" })
|
|
100
|
-
}
|
|
101
|
-
) : /* @__PURE__ */ e(
|
|
102
|
-
"svg",
|
|
103
|
-
{
|
|
104
|
-
viewBox: "0 0 18 18",
|
|
105
|
-
style: {
|
|
106
|
-
fill: "rgb(255, 255, 255)",
|
|
107
|
-
display: "none"
|
|
108
|
-
},
|
|
109
|
-
children: /* @__PURE__ */ e("path", { d: "M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" })
|
|
110
|
-
}
|
|
111
|
-
)
|
|
112
|
-
}
|
|
113
|
-
)
|
|
114
|
-
},
|
|
115
|
-
`sub-color-${z}`
|
|
116
|
-
))
|
|
117
|
-
},
|
|
118
|
-
`color-row-${r}`
|
|
119
|
-
)),
|
|
120
|
-
/* @__PURE__ */ s("div", { children: [
|
|
121
|
-
/* @__PURE__ */ e("div", { className: "richtext-my-1 richtext-text-sm", children: h("editor.recent") }),
|
|
122
|
-
/* @__PURE__ */ e("span", { className: "richtext-relative richtext-flex richtext-h-auto richtext-w-full richtext-flex-wrap richtext-p-0 last:richtext-pb-2", children: p == null ? void 0 : p.map((t, r) => /* @__PURE__ */ e(
|
|
123
|
-
"span",
|
|
124
|
-
{
|
|
125
|
-
className: "richtext-inline-block richtext-size-6 richtext-flex-[0_0_auto] richtext-cursor-pointer richtext-rounded-sm !richtext-border richtext-border-transparent richtext-p-0.5 hover:richtext-border-border hover:richtext-shadow-sm",
|
|
126
|
-
onClick: () => m(t),
|
|
127
|
-
children: /* @__PURE__ */ e(
|
|
128
|
-
"span",
|
|
129
|
-
{
|
|
130
|
-
className: "richtext-relative richtext-block richtext-size-[18px] richtext-rounded-[2px] richtext-border-transparent",
|
|
131
|
-
style: {
|
|
132
|
-
backgroundColor: t
|
|
133
|
-
},
|
|
134
|
-
children: /* @__PURE__ */ e(
|
|
135
|
-
"svg",
|
|
136
|
-
{
|
|
137
|
-
viewBox: "0 0 18 18",
|
|
138
|
-
style: {
|
|
139
|
-
fill: "rgb(255, 255, 255)",
|
|
140
|
-
display: "none"
|
|
141
|
-
},
|
|
142
|
-
children: /* @__PURE__ */ e("path", { d: "M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" })
|
|
143
|
-
}
|
|
144
|
-
)
|
|
145
|
-
}
|
|
146
|
-
)
|
|
147
|
-
},
|
|
148
|
-
`sub-color-recent-${r}`
|
|
149
|
-
)) })
|
|
150
|
-
] }),
|
|
151
|
-
/* @__PURE__ */ e(Z, { setColor: m })
|
|
152
|
-
] })
|
|
153
|
-
}
|
|
154
|
-
)
|
|
155
|
-
]
|
|
156
|
-
}
|
|
157
|
-
);
|
|
158
|
-
}
|
|
159
|
-
function Z({ setColor: l }) {
|
|
160
|
-
const { t: h } = L(), [n, a] = f(!1), [i, d] = f("#000000"), x = M(
|
|
161
|
-
(c) => {
|
|
162
|
-
d(c);
|
|
163
|
-
},
|
|
164
|
-
[]
|
|
165
|
-
);
|
|
166
|
-
return /* @__PURE__ */ s(
|
|
167
|
-
v,
|
|
168
|
-
{
|
|
169
|
-
onOpenChange: a,
|
|
170
|
-
open: n,
|
|
171
|
-
children: [
|
|
172
|
-
/* @__PURE__ */ e(b, { asChild: !0, children: /* @__PURE__ */ s(
|
|
173
|
-
"div",
|
|
174
|
-
{
|
|
175
|
-
className: "richtext-p-1.5 richtext-text-sm hover:richtext-cursor-pointer hover:richtext-bg-accent",
|
|
176
|
-
children: [
|
|
177
|
-
h("editor.color.more"),
|
|
178
|
-
"..."
|
|
179
|
-
]
|
|
180
|
-
}
|
|
181
|
-
) }),
|
|
182
|
-
/* @__PURE__ */ s(g, { children: [
|
|
183
|
-
/* @__PURE__ */ s("div", { className: "richtext-flex richtext-flex-col richtext-items-center richtext-justify-center", children: [
|
|
184
|
-
/* @__PURE__ */ e(
|
|
185
|
-
O,
|
|
186
|
-
{
|
|
187
|
-
color: i,
|
|
188
|
-
onChange: (c) => {
|
|
189
|
-
x(c);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
),
|
|
193
|
-
/* @__PURE__ */ e(
|
|
194
|
-
j,
|
|
195
|
-
{
|
|
196
|
-
className: "richtext-mt-[8px] richtext-w-full",
|
|
197
|
-
type: "text",
|
|
198
|
-
value: i.replace("#", ""),
|
|
199
|
-
onChange: (c) => {
|
|
200
|
-
c.preventDefault(), c.stopPropagation(), x(`#${c.target.value}`);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
)
|
|
204
|
-
] }),
|
|
205
|
-
/* @__PURE__ */ e(N, { className: "richtext-my-[10px]" }),
|
|
206
|
-
/* @__PURE__ */ e(
|
|
207
|
-
$,
|
|
208
|
-
{
|
|
209
|
-
className: "richtext-w-full",
|
|
210
|
-
onClick: (c) => {
|
|
211
|
-
c.preventDefault(), c.stopPropagation(), l(i), a(!1);
|
|
212
|
-
},
|
|
213
|
-
children: /* @__PURE__ */ e(R, { size: 16 })
|
|
214
|
-
}
|
|
215
|
-
)
|
|
216
|
-
] })
|
|
217
|
-
]
|
|
218
|
-
}
|
|
219
|
-
);
|
|
220
|
-
}
|
|
221
|
-
const N = P.forwardRef(
|
|
222
|
-
({ className: l, orientation: h = "horizontal", decorative: n = !0, ...a }, i) => /* @__PURE__ */ e(
|
|
223
|
-
C.Root,
|
|
224
|
-
{
|
|
225
|
-
ref: i,
|
|
226
|
-
decorative: n,
|
|
227
|
-
orientation: h,
|
|
228
|
-
className: _(
|
|
229
|
-
"richtext-shrink-0 richtext-bg-border",
|
|
230
|
-
h === "horizontal" ? "richtext-h-[1px] richtext-w-full" : "richtext-h-full richtext-w-[1px]",
|
|
231
|
-
l
|
|
232
|
-
),
|
|
233
|
-
...a
|
|
234
|
-
}
|
|
235
|
-
)
|
|
236
|
-
);
|
|
237
|
-
N.displayName = C.Root.displayName;
|
|
238
|
-
export {
|
|
239
|
-
J as C,
|
|
240
|
-
N as S
|
|
241
|
-
};
|
package/lib/store-B8IkVz1J.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";require("./index-BvIJKpX1.cjs");const e=require("./events.constant-DQYeJpu5.cjs"),a={setOpen:(t,n)=>{e.dispatchEvent(e.EVENTS.UPLOAD_IMAGE(t),n)}};exports.actionDialogImage=a;
|
package/lib/store-CsIFDUKR.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const T=require("./index-BBNITgNi.cjs");var B=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,H=T.Node3.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",T.mergeAttributes(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode("image",{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{var t,n,r,a,c,u;const o=(n=(t=e.attrs)==null?void 0:t.src)!=null?n:"",s=(a=(r=e.attrs)==null?void 0:r.alt)!=null?a:"",d=(u=(c=e.attrs)==null?void 0:c.title)!=null?u:"";return d?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:a,getPos:c,HTMLAttributes:u,editor:o})=>{const s=document.createElement("img");Object.entries(u).forEach(([l,f])=>{if(f!=null)switch(l){case"width":case"height":break;default:s.setAttribute(l,f);break}}),s.src=u.src;const d=new T.ResizableNodeView({element:s,editor:o,node:a,getPos:c,onResize:(l,f)=>{s.style.width=`${l}px`,s.style.height=`${f}px`},onCommit:(l,f)=>{const b=c();b!==void 0&&this.editor.chain().setNodeSelection(b).updateAttributes(this.name,{width:l,height:f}).run()},onUpdate:(l,f,b)=>l.type===a.type,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:r===!0}}),m=d.dom;return m.style.visibility="hidden",m.style.pointerEvents="none",s.onload=()=>{m.style.visibility="",m.style.pointerEvents=""},d}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[T.nodeInputRule({find:B,type:this.type,getAttributes:e=>{const[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),P=H,F=typeof global=="object"&&global&&global.Object===Object&&global,U=typeof self=="object"&&self&&self.Object===Object&&self,_=F||U||Function("return this")(),v=_.Symbol,A=Object.prototype,G=A.hasOwnProperty,V=A.toString,h=v?v.toStringTag:void 0;function D(e){var t=G.call(e,h),n=e[h];try{e[h]=void 0;var r=!0}catch{}var a=V.call(e);return r&&(t?e[h]=n:delete e[h]),a}var X=Object.prototype,q=X.toString;function J(e){return q.call(e)}var K="[object Null]",Q="[object Undefined]",$=v?v.toStringTag:void 0;function N(e){return e==null?e===void 0?Q:K:$&&$ in Object(e)?D(e):J(e)}function k(e){return e!=null&&typeof e=="object"}var Y="[object Symbol]";function Z(e){return typeof e=="symbol"||k(e)&&N(e)==Y}var ee=/\s/;function te(e){for(var t=e.length;t--&&ee.test(e.charAt(t)););return t}var ne=/^\s+/;function re(e){return e&&e.slice(0,te(e)+1).replace(ne,"")}function j(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var R=NaN,ie=/^[-+]0x[0-9a-f]+$/i,ae=/^0b[01]+$/i,oe=/^0o[0-7]+$/i,se=parseInt;function x(e){if(typeof e=="number")return e;if(Z(e))return R;if(j(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=j(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=re(e);var n=ae.test(e);return n||oe.test(e)?se(e.slice(2),n?2:8):ie.test(e)?R:+e}var S=function(){return _.Date.now()},le="Expected a function",ue=Math.max,ce=Math.min;function L(e,t,n){var r,a,c,u,o,s,d=0,m=!1,l=!1,f=!0;if(typeof e!="function")throw new TypeError(le);t=x(t)||0,j(n)&&(m=!!n.leading,l="maxWait"in n,c=l?ue(x(n.maxWait)||0,t):c,f="trailing"in n?!!n.trailing:f);function b(i){var g=r,p=a;return r=a=void 0,d=i,u=e.apply(p,g),u}function M(i){return d=i,o=setTimeout(y,t),m?b(i):u}function C(i){var g=i-s,p=i-d,I=t-g;return l?ce(I,c-p):I}function w(i){var g=i-s,p=i-d;return s===void 0||g>=t||g<0||l&&p>=c}function y(){var i=S();if(w(i))return E(i);o=setTimeout(y,C(i))}function E(i){return o=void 0,f&&r?b(i):(r=a=void 0,u)}function W(){o!==void 0&&clearTimeout(o),d=0,r=s=a=o=void 0}function z(){return o===void 0?u:E(S())}function O(){var i=S(),g=w(i);if(r=arguments,a=this,s=i,g){if(o===void 0)return M(s);if(l)return clearTimeout(o),o=setTimeout(y,t),b(s)}return o===void 0&&(o=setTimeout(y,t)),u}return O.cancel=W,O.flush=z,O}var de="Expected a function";function fe(e,t,n){var r=!0,a=!0;if(typeof e!="function")throw new TypeError(de);return j(n)&&(r="leading"in n?!!n.leading:r,a="trailing"in n?!!n.trailing:a),L(e,t,{leading:r,maxWait:t,trailing:a})}exports.baseGetTag=N;exports.debounce=L;exports.index_default=P;exports.isObjectLike=k;exports.throttle=fe;exports.toNumber=x;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("./index-Cv9Z6dyV.cjs"),a=require("./index-BBNITgNi.cjs");function l(o,t){const i={getBoundingClientRect:()=>a.posToDOMRect(o.view,o.state.selection.from,o.state.selection.to)};e.computePosition(i,t,{placement:"bottom-start",strategy:"absolute",middleware:[e.shift(),e.flip()]}).then(({x:s,y:n,strategy:c})=>{t.style.width="max-content",t.style.position=c,t.style.left=`${s}px`,t.style.top=`${n}px`})}exports.updatePosition=l;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const s=require("react"),p=require("./index-BvIJKpX1.cjs"),l=require("./index-BBNITgNi.cjs"),g=require("./index-FSRjMsxW.cjs");function E(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const S=E(s);function M(t){const{editor:e}=l.useCurrentEditor(),n=S.useMemo(()=>e,[t,e]);return l.useEditorState({editor:n,selector(o){return o.editor?{editor:o.editor,editorState:o.editor.state,canCommand:o.editor.can}:{editor:null,editorState:void 0,canCommand:void 0}}})||{editor:null}}function f(){return M().editor}const b=()=>!1;function x(t=b){const e=p.useEditableEditor(),[n,r]=s.useState(()=>{const u=t();return typeof u=="boolean"?!u:u}),o=f();s.useEffect(()=>{if(!o||!t)return;const u=()=>{const c=t();r(typeof c=="boolean"?!c:c)};return u(),o.on("selectionUpdate",u),o.on("transaction",u),()=>{o.off("selectionUpdate",u),o.off("transaction",u)}},[o,t]);const a=s.useMemo(()=>!e||!o?!0:typeof n=="boolean"?n:!1,[e,o,n]),i=s.useMemo(()=>!e||!o,[e,o]);return{disabled:a,dataState:n,editorDisabled:i}}function y(t=b){const e=p.useEditableEditor(),[n,r]=s.useState({}),[o,a]=s.useState(t()),i=f();s.useEffect(()=>{if(!i||!t)return;const d=()=>{a(t())};return d(),i.on("selectionUpdate",d),()=>{i.off("selectionUpdate",d)}},[n,i,t]);const u=s.useMemo(()=>!e||!i,[e,i]),c=s.useMemo(()=>!e||!i,[e,i]);return{disabled:u,dataState:o,editorDisabled:c,update:()=>r({})}}function m(t){const e=f();return s.useMemo(()=>e?e.extensionManager.extensions.find(r=>r.name===t):null,[e,t])}function D(t,e,n){return t<e?e:t>n?n:t}const N=t=>typeof t=="number",O=t=>typeof t=="string",U=t=>typeof t=="function";function h(t,e="px"){if(!t)return t;const n=N(t)?String(t):t,r=Number.parseFloat(n),o=n.match(/[%a-z]+$/i),a=o?o[0]:e;return Number.isNaN(r)?t:r+a}function P(t,e){if(!t)return!1;const{extensions:n=[]}=(t==null?void 0:t.extensionManager)??{};return!!n.find(o=>o.name===e)}function C(t){return t.map(e=>O(e)?{value:e,name:e}:e)}function j(t){const e=f(),n=m(t),{t:r}=g.useLocale();return s.useMemo(()=>{if(!e||!n)return null;const{button:o}=n.options;return!o||!U(o)?null:o({editor:e,extension:n,t:r})},[e,n,r])}exports.clamp=D;exports.ensureNameValueOptions=C;exports.getCssUnitWithDefault=h;exports.hasExtension=P;exports.useActive=x;exports.useButtonProps=j;exports.useEditorInstance=f;exports.useExtension=m;exports.useToggleActive=y;
|