reactjs-tiptap-editor 1.0.11 → 1.0.13
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-DNj0f_A4.cjs +1 -0
- package/lib/{ActionMenuButton-DTXFBdGX.js → ActionMenuButton-l5rSmAO_.js} +18 -14
- 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/Callout.cjs +1 -0
- package/lib/Callout.js +230 -0
- 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 +39 -39
- package/lib/CodeBlock.js +840 -945
- 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-D0yQ0wR7.js → Drawer-Cbi_MURj.js} +10 -9
- package/lib/Drawer-DKU32YW_.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-CO4IRHmG.js → Excalidraw-CWrVL5hs.js} +28 -27
- package/lib/Excalidraw-Kb-TRcWY.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 +20 -19
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +9 -7
- package/lib/History.cjs +1 -1
- package/lib/History.js +11 -8
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +7 -5
- package/lib/Icon-Ctva8VeB.js +12 -0
- package/lib/Icon-yqCglrdK.cjs +1 -0
- package/lib/Iframe-BczF8Hex.cjs +1 -0
- package/lib/{Iframe-BEO28NPs.js → Iframe-C942bNjs.js} +42 -40
- 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 +50 -48
- package/lib/ImportWord.cjs +31 -31
- package/lib/ImportWord.js +8 -6
- package/lib/{Indent-CXurBbOr.js → Indent-C_O5WdyR.js} +26 -24
- package/lib/Indent-CkEC7x36.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-Bvj469K1.js → Katex-D3PEWimM.js} +12 -10
- package/lib/Katex-DW_HjgNM.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 +10 -8
- package/lib/Link.cjs +1 -1
- package/lib/Link.js +2 -2
- package/lib/{LinkEditBlock-8ePAZ-G1.cjs → LinkEditBlock-DL1e2ILk.cjs} +1 -1
- package/lib/{LinkEditBlock-DjXUEubR.js → LinkEditBlock-h5054QDo.js} +22 -20
- package/lib/Mention.cjs +1 -1
- package/lib/Mention.js +3 -3
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.js +8 -8
- 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-BqrmHCpu.cjs +1 -0
- package/lib/{SlashCommandNodeView-CcqL8ymb.js → SlashCommandNodeView-DXUqkx82.js} +75 -66
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +7 -5
- package/lib/{Table-9Y0Cg8Ab.js → Table-DdrY4jcM.js} +10 -8
- package/lib/Table-kY0nbqJo.cjs +9 -0
- 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-DWwd0vHR.js → Twitter-B-JQ3ZJ1.js} +51 -49
- package/lib/Twitter-DjZcVa3l.cjs +1 -0
- 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 +2084 -1949
- package/lib/button-BS3n6_Aq.cjs +1 -0
- package/lib/{button-RnHbJfd-.js → button-Uv01FNnd.js} +9 -8
- package/lib/{checkbox-CTEN0q4y.cjs → checkbox-C8ByRi7-.cjs} +1 -1
- package/lib/{checkbox-CLSoR1Qj.js → checkbox-DEFNwGwb.js} +1 -1
- package/lib/{index-sVScpCFG.js → clsx-BWSGDJNJ.js} +224 -224
- package/lib/{index-BBNITgNi.cjs → clsx-CXbNJWDD.cjs} +13 -13
- package/lib/components/Bubble/RichTextBubbleCallout.d.ts +1 -0
- package/lib/components/Bubble/index.d.ts +1 -0
- package/lib/components/ui/index.d.ts +1 -0
- package/lib/{dialog-CMC9hsCo.cjs → dialog-Bt5zwGYB.cjs} +1 -1
- package/lib/{dialog-D_HCtKvc.js → dialog-DwTMZSt6.js} +1 -1
- package/lib/{dropdown-menu-66q7Ofc5.js → dropdown-menu-BetI14G6.js} +1 -1
- package/lib/{dropdown-menu-DKSAS-w_.cjs → dropdown-menu-Bo68IEOT.cjs} +1 -1
- package/lib/events.constant-Dq21NPdV.cjs +1 -0
- package/lib/events.constant-do95b767.js +21 -0
- package/lib/extensions/Callout/Callout.d.ts +18 -0
- package/lib/extensions/Callout/components/NodeViewCallout/NodeViewCallout.d.ts +1 -0
- package/lib/extensions/Callout/components/RichTextCallout.d.ts +1 -0
- package/lib/extensions/Callout/index.d.ts +1 -0
- package/lib/{index-CApXPpjF.cjs → index-BCzvbrf5.cjs} +1 -1
- package/lib/{index-9A6-kVBM.js → index-BDKHXe7R.js} +1 -1
- package/lib/{index-DmPwbBqm.js → index-CHKWG6E8.js} +1 -1
- package/lib/index-CcoWj0mF.js +426 -0
- package/lib/index-CjhjjJsN.cjs +1 -0
- package/lib/index-Cs6cp0Y6.cjs +1 -0
- package/lib/index-D3RLYf-J.cjs +1 -0
- package/lib/{index-C3zg3DPB.js → index-DF5ZPtWM.js} +371 -1177
- package/lib/{index-DRHrDScg.js → index-DJbmnBzK.js} +1 -1
- package/lib/index-Doks9cbR.cjs +1 -0
- package/lib/{index-0OnGZkVF.js → index-Dujzr6bY.js} +179 -317
- package/lib/index-VhKd73hZ.cjs +1 -0
- package/lib/{index-DKt5wfAc.js → index-mR8PNv5P.js} +1 -1
- 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-CvyMYMZG.js → input-DUBdJD3L.js} +5 -5
- package/lib/{input-D555880-.cjs → input-Dt_BA_9B.cjs} +1 -1
- package/lib/{isNumber-Bv1Qhmw8.cjs → isNumber-BTYSVlKo.cjs} +1 -1
- package/lib/{isNumber-DF0fU3ob.js → isNumber-CIgubz2e.js} +1 -1
- package/lib/label-JNOksCA-.cjs +1 -0
- package/lib/label-topD46-u.js +19 -0
- package/lib/locale-bundle.cjs +1 -1
- package/lib/locale-bundle.js +6 -7
- package/lib/locales/en.d.ts +16 -0
- package/lib/locales/fi.d.ts +16 -0
- package/lib/locales/hu.d.ts +16 -0
- package/lib/locales/index.d.ts +99 -4316
- package/lib/locales/pt-br.d.ts +16 -0
- package/lib/locales/vi.d.ts +16 -0
- package/lib/locales/zh-cn.d.ts +16 -0
- package/lib/{popover-B7ec5-u2.js → popover-LfNBhRyz.js} +1 -1
- package/lib/{popover-BSzR_R01.cjs → popover-mL-2sX5r.cjs} +1 -1
- package/lib/react-BEoMZB61.cjs +1 -0
- package/lib/react-c9FSfB30.js +27 -0
- package/lib/select-CwGYPsPq.cjs +1 -0
- package/lib/select-DctYuHLH.js +117 -0
- package/lib/separator-Ddfrhn4D.js +329 -0
- package/lib/separator-NoH_SLRW.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-CkjKIgjQ.cjs +1 -0
- package/lib/store-DNpS8vXA.js +10 -0
- package/lib/style.css +1 -1
- package/lib/{tabs-CWr9HYaM.js → tabs-BT3AeqQQ.js} +1 -1
- package/lib/{tabs-BTwiZkWd.cjs → tabs-DRSwUeKP.cjs} +1 -1
- package/lib/{textarea-Yetl_PZi.cjs → textarea-BDO6XQoF.cjs} +1 -1
- package/lib/{textarea-BdeLXbp8.js → textarea-DZzMEDfZ.js} +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-IERhwcLa.js} +1 -1
- package/lib/throttle-gTTvqDTW.cjs +1 -0
- package/lib/toggle-BQHMh_Q-.cjs +1 -0
- package/lib/toggle-DKHg5sLm.js +99 -0
- package/lib/tooltip-BYtGp6FM.cjs +1 -0
- package/lib/tooltip-DNKq7zgN.js +24 -0
- package/lib/{updatePosition-Bbd8ETMv.js → updatePosition-Bie75EFq.js} +2 -2
- package/lib/updatePosition-Cjuj2E26.cjs +1 -0
- package/lib/useButtonProps-DBJkNDS2.cjs +1 -0
- package/lib/{useButtonProps-cMoicZgd.js → useButtonProps-DVP4s_ER.js} +48 -36
- package/lib/utils/customEvents/events.constant.d.ts +0 -5
- package/package.json +3 -3
- package/lib/ActionMenuButton-BLlse5KO.cjs +0 -1
- package/lib/Drawer-kv6BU_6O.cjs +0 -1
- package/lib/Excalidraw-B82ThkJA.cjs +0 -1
- package/lib/Icon-DRuJhcHK.js +0 -10
- package/lib/Icon-DXePECFW.cjs +0 -1
- package/lib/Iframe-03dn9wcM.cjs +0 -1
- package/lib/Indent-Cqjdn3Jt.cjs +0 -1
- package/lib/Katex-DdWTV5NJ.cjs +0 -4
- package/lib/SlashCommandNodeView-Bl_gwZJB.cjs +0 -1
- package/lib/Table-DBGjezZK.cjs +0 -9
- package/lib/Twitter-Cnvt7GBg.cjs +0 -1
- package/lib/button-BW5bDPz_.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-C838s-or.cjs +0 -8
- package/lib/index-Cv9Z6dyV.cjs +0 -1
- package/lib/index-FSRjMsxW.cjs +0 -1
- package/lib/label-DsOYPjAo.js +0 -18
- package/lib/label-E6jF3Xud.cjs +0 -1
- package/lib/separator-JaTTqb3J.js +0 -241
- package/lib/separator-PGnA-6Hr.cjs +0 -1
- package/lib/store/ProviderUniqueId.d.ts +0 -6
- package/lib/store-Cf7tFiiI.js +0 -10
- package/lib/store-oDk-lTPM.cjs +0 -1
- package/lib/throttle-BM3Bmbf_.cjs +0 -1
- package/lib/updatePosition-M2IyqkI1.cjs +0 -1
- package/lib/useButtonProps-DfnJiJLV.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-C3zg3DPB.js";
|
|
7
|
-
import { u as v, C as $ } from "./index-0OnGZkVF.js";
|
|
8
|
-
import { P as b, a as g, b as C } from "./popover-B7ec5-u2.js";
|
|
9
|
-
import { I as j } from "./input-CvyMYMZG.js";
|
|
10
|
-
import * as L from "@radix-ui/react-separator";
|
|
11
|
-
import { B as D } from "./button-RnHbJfd-.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 } = v(), {
|
|
17
|
-
disabled: n = !1,
|
|
18
|
-
value: a,
|
|
19
|
-
onChange: i,
|
|
20
|
-
colors: 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
|
-
b,
|
|
40
|
-
{
|
|
41
|
-
modal: !0,
|
|
42
|
-
onOpenChange: u,
|
|
43
|
-
open: c,
|
|
44
|
-
children: [
|
|
45
|
-
/* @__PURE__ */ e(
|
|
46
|
-
g,
|
|
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
|
-
C,
|
|
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 } = v(), [n, a] = f(!1), [i, d] = f("#000000"), x = M(
|
|
161
|
-
(c) => {
|
|
162
|
-
d(c);
|
|
163
|
-
},
|
|
164
|
-
[]
|
|
165
|
-
);
|
|
166
|
-
return /* @__PURE__ */ s(
|
|
167
|
-
b,
|
|
168
|
-
{
|
|
169
|
-
onOpenChange: a,
|
|
170
|
-
open: n,
|
|
171
|
-
children: [
|
|
172
|
-
/* @__PURE__ */ e(g, { 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(C, { 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
|
-
D,
|
|
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
|
-
L.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 = L.Root.displayName;
|
|
238
|
-
export {
|
|
239
|
-
J as C,
|
|
240
|
-
N as S
|
|
241
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),a=require("react"),y=require("lucide-react"),P=require("react-colorful"),b=require("./index-C838s-or.cjs"),v=require("./index-FSRjMsxW.cjs"),h=require("./popover-BSzR_R01.cjs"),S=require("./input-D555880-.cjs"),O=require("@radix-ui/react-separator"),z=require("./button-BW5bDPz_.cjs");function g(r){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const n in r)if(n!=="default"){const x=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(o,n,x.get?x:{enumerable:!0,get:()=>r[n]})}}return o.default=r,Object.freeze(o)}const R=g(a),C=g(O);function q(){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:e.jsx("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"})})}function _(r){const{t:o}=v.useLocale(),{disabled:n=!1,value:x,onChange:i,colors:u=v.COLORS_LIST,highlight:d}=r,[s,m]=a.useState(!1),L=a.useMemo(()=>{const t=u,c=[];for(let l=0;l<t.length;l+=10)c.push(t.slice(l,l+10));return c},[u]),[p,N]=b.useLocalStorage(d?"richtext-recent-highlight":"richtext-recent-colors",[]),w=t=>{const c=[...p],l=c.indexOf(t);l!==-1&&c.splice(l,1),c.unshift(t),c.length>10&&c.pop(),N(c)};function f(t){if(t===void 0){i==null||i(t),m(!1);return}/^#([\da-f]{3}){1,2}$/i.test(t)&&(i==null||i(t),w(t),m(!1))}return e.jsxs(h.Popover,{modal:!0,onOpenChange:m,open:s,children:[e.jsx(h.PopoverTrigger,{asChild:!0,className:"!richtext-p-0",disabled:n,children:r==null?void 0:r.children}),e.jsx(h.PopoverContent,{align:"start",className:"richtext-size-full !richtext-p-2",hideWhenDetached:!0,side:"bottom",children:e.jsxs("div",{className:"richtext-flex richtext-flex-col",children:[e.jsxs("div",{className:"rd-1 richtext-flex richtext-cursor-pointer richtext-items-center richtext-gap-[4px] richtext-p-1 hover:richtext-bg-accent",onClick:()=>{f(void 0)},children:[e.jsx(q,{}),e.jsx("span",{className:"richtext-ml-1 richtext-text-sm",children:o(d?"editor.nofill":"editor.default")})]}),L.map((t,c)=>e.jsx("span",{className:"richtext-relative richtext-flex richtext-h-auto richtext-w-full richtext-p-0 last:richtext-pb-2",children:t.map((l,k)=>e.jsx("span",{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",onClick:()=>f(l),children:e.jsx("span",{className:"richtext-relative richtext-block richtext-size-[18px] richtext-rounded-[2px]",style:{backgroundColor:l},children:l===x?e.jsx("svg",{className:"richtext-absolute -richtext-top-px richtext-left-px richtext-block richtext-size-3",viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)"},children:e.jsx("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})}):e.jsx("svg",{viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)",display:"none"},children:e.jsx("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})})},`sub-color-${k}`))},`color-row-${c}`)),e.jsxs("div",{children:[e.jsx("div",{className:"richtext-my-1 richtext-text-sm",children:o("editor.recent")}),e.jsx("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,c)=>e.jsx("span",{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",onClick:()=>f(t),children:e.jsx("span",{className:"richtext-relative richtext-block richtext-size-[18px] richtext-rounded-[2px] richtext-border-transparent",style:{backgroundColor:t},children:e.jsx("svg",{viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)",display:"none"},children:e.jsx("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})})},`sub-color-recent-${c}`))})]}),e.jsx(M,{setColor:f})]})})]})}function M({setColor:r}){const{t:o}=v.useLocale(),[n,x]=a.useState(!1),[i,u]=a.useState("#000000"),d=a.useCallback(s=>{u(s)},[]);return e.jsxs(h.Popover,{onOpenChange:x,open:n,children:[e.jsx(h.PopoverTrigger,{asChild:!0,children:e.jsxs("div",{className:"richtext-p-1.5 richtext-text-sm hover:richtext-cursor-pointer hover:richtext-bg-accent",children:[o("editor.color.more"),"..."]})}),e.jsxs(h.PopoverContent,{children:[e.jsxs("div",{className:"richtext-flex richtext-flex-col richtext-items-center richtext-justify-center",children:[e.jsx(P.HexColorPicker,{color:i,onChange:s=>{d(s)}}),e.jsx(S.Input,{className:"richtext-mt-[8px] richtext-w-full",type:"text",value:i.replace("#",""),onChange:s=>{s.preventDefault(),s.stopPropagation(),d(`#${s.target.value}`)}})]}),e.jsx(j,{className:"richtext-my-[10px]"}),e.jsx(z.Button,{className:"richtext-w-full",onClick:s=>{s.preventDefault(),s.stopPropagation(),r(i),x(!1)},children:e.jsx(y.Plus,{size:16})})]})]})}const j=R.forwardRef(({className:r,orientation:o="horizontal",decorative:n=!0,...x},i)=>e.jsx(C.Root,{ref:i,decorative:n,orientation:o,className:b.cn("richtext-shrink-0 richtext-bg-border",o==="horizontal"?"richtext-h-[1px] richtext-w-full":"richtext-h-full richtext-w-[1px]",r),...x}));j.displayName=C.Root.displayName;exports.ColorPicker=_;exports.Separator=j;
|
package/lib/store-Cf7tFiiI.js
DELETED
package/lib/store-oDk-lTPM.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";require("./index-C838s-or.cjs");const e=require("./events.constant-DQYeJpu5.cjs"),a={setOpen:(t,n)=>{e.dispatchEvent(e.EVENTS.UPLOAD_IMAGE(t),n)}};exports.actionDialogImage=a;
|
|
@@ -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-C838s-or.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;
|