@thebuoyant-tsdev/mui-ts-library 3.7.1 → 3.9.1
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/README.de.md +23 -1
- package/README.md +23 -1
- package/dist/components/gantt-chart/GanttChart.d.ts +1 -1
- package/dist/components/gantt-chart/GanttChart.types.d.ts +7 -6
- package/dist/components/password-strength-meter/PasswordStrengthMeter.d.ts +1 -1
- package/dist/components/password-strength-meter/PasswordStrengthMeter.js +156 -134
- package/dist/components/password-strength-meter/PasswordStrengthMeter.types.d.ts +7 -1
- package/dist/components/password-strength-meter/PasswordStrengthMeter.types.js +3 -1
- package/dist/components/rich-text-editor/RichTextEditor.d.ts +7 -1
- package/dist/components/rich-text-editor/RichTextEditor.js +87 -73
- package/dist/components/rich-text-editor/RichTextEditor.types.d.ts +25 -1
- package/dist/components/rich-text-editor/RichTextEditor.types.js +13 -2
- package/dist/components/rich-text-editor/RichTextEditorEmojiPicker.d.ts +1 -1
- package/dist/components/rich-text-editor/RichTextEditorFooter.d.ts +1 -1
- package/dist/components/rich-text-editor/RichTextEditorImageDialog.d.ts +1 -1
- package/dist/components/rich-text-editor/RichTextEditorLinkDialog.d.ts +1 -1
- package/dist/components/rich-text-editor/RichTextEditorMarkdownDialog.d.ts +10 -0
- package/dist/components/rich-text-editor/RichTextEditorMarkdownDialog.js +88 -0
- package/dist/components/rich-text-editor/RichTextEditorTableMenu.d.ts +1 -1
- package/dist/components/rich-text-editor/RichTextEditorToolbar.d.ts +4 -2
- package/dist/components/rich-text-editor/RichTextEditorToolbar.js +211 -175
- package/dist/index.cjs +2 -2
- package/package.json +1 -1
|
@@ -3,35 +3,38 @@ import { RichTextEditorLinkDialog as t } from "./RichTextEditorLinkDialog.js";
|
|
|
3
3
|
import { RichTextEditorColorPicker as n } from "./RichTextEditorColorPicker.js";
|
|
4
4
|
import { RichTextEditorTableMenu as r } from "./RichTextEditorTableMenu.js";
|
|
5
5
|
import { RichTextEditorImageDialog as i } from "./RichTextEditorImageDialog.js";
|
|
6
|
-
import { RichTextEditorEmojiPicker as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
6
|
+
import { RichTextEditorEmojiPicker as ee } from "./RichTextEditorEmojiPicker.js";
|
|
7
|
+
import { RichTextEditorMarkdownDialog as te } from "./RichTextEditorMarkdownDialog.js";
|
|
8
|
+
import { useState as a } from "react";
|
|
9
|
+
import { Box as o, Divider as ne, IconButton as s, Tooltip as c } from "@mui/material";
|
|
10
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
11
|
+
import f from "@mui/icons-material/Undo";
|
|
12
|
+
import re from "@mui/icons-material/Redo";
|
|
13
|
+
import ie from "@mui/icons-material/Fullscreen";
|
|
14
|
+
import ae from "@mui/icons-material/FullscreenExit";
|
|
15
|
+
import oe from "@mui/icons-material/Image";
|
|
16
|
+
import se from "@mui/icons-material/EmojiEmotions";
|
|
17
|
+
import ce from "@mui/icons-material/FormatBold";
|
|
18
|
+
import le from "@mui/icons-material/FormatItalic";
|
|
19
|
+
import ue from "@mui/icons-material/FormatUnderlined";
|
|
20
|
+
import de from "@mui/icons-material/StrikethroughS";
|
|
21
|
+
import p from "@mui/icons-material/FormatListBulleted";
|
|
22
|
+
import m from "@mui/icons-material/FormatListNumbered";
|
|
23
|
+
import fe from "@mui/icons-material/FormatQuote";
|
|
24
|
+
import pe from "@mui/icons-material/Code";
|
|
25
|
+
import me from "@mui/icons-material/InsertLink";
|
|
26
|
+
import he from "@mui/icons-material/HorizontalRule";
|
|
27
|
+
import h from "@mui/icons-material/FormatColorText";
|
|
28
|
+
import g from "@mui/icons-material/BorderColor";
|
|
29
|
+
import _ from "@mui/icons-material/FormatClear";
|
|
30
|
+
import v from "@mui/icons-material/ContentPaste";
|
|
31
|
+
import y from "@mui/icons-material/ContentPasteOff";
|
|
29
32
|
//#region src/components/rich-text-editor/RichTextEditorToolbar.tsx
|
|
30
|
-
function
|
|
31
|
-
return /* @__PURE__ */
|
|
33
|
+
function b({ label: e, icon: t, activeColor: n, disabled: r, onClick: i }) {
|
|
34
|
+
return /* @__PURE__ */ u(c, {
|
|
32
35
|
title: e,
|
|
33
36
|
arrow: !0,
|
|
34
|
-
children: /* @__PURE__ */
|
|
37
|
+
children: /* @__PURE__ */ u("span", { children: /* @__PURE__ */ d(s, {
|
|
35
38
|
size: "small",
|
|
36
39
|
onMouseDown: (e) => e.preventDefault(),
|
|
37
40
|
onClick: i,
|
|
@@ -43,13 +46,13 @@ function T({ label: e, icon: t, activeColor: n, disabled: r, onClick: i }) {
|
|
|
43
46
|
pb: .25
|
|
44
47
|
},
|
|
45
48
|
"aria-label": e,
|
|
46
|
-
children: [/* @__PURE__ */
|
|
49
|
+
children: [/* @__PURE__ */ u(o, {
|
|
47
50
|
sx: {
|
|
48
51
|
display: "flex",
|
|
49
52
|
alignItems: "center"
|
|
50
53
|
},
|
|
51
54
|
children: t
|
|
52
|
-
}), /* @__PURE__ */
|
|
55
|
+
}), /* @__PURE__ */ u(o, { sx: {
|
|
53
56
|
width: "80%",
|
|
54
57
|
height: 3,
|
|
55
58
|
bgcolor: n ?? "text.primary",
|
|
@@ -59,8 +62,8 @@ function T({ label: e, icon: t, activeColor: n, disabled: r, onClick: i }) {
|
|
|
59
62
|
}) })
|
|
60
63
|
});
|
|
61
64
|
}
|
|
62
|
-
function
|
|
63
|
-
return /* @__PURE__ */
|
|
65
|
+
function x({ level: e }) {
|
|
66
|
+
return /* @__PURE__ */ d(o, {
|
|
64
67
|
component: "span",
|
|
65
68
|
sx: {
|
|
66
69
|
fontWeight: "bold",
|
|
@@ -70,8 +73,8 @@ function E({ level: e }) {
|
|
|
70
73
|
children: ["H", e]
|
|
71
74
|
});
|
|
72
75
|
}
|
|
73
|
-
function
|
|
74
|
-
let [M, N] =
|
|
76
|
+
function S({ editor: S, toolbarConfig: C, translation: w, disabled: T, isFullscreen: E, onToggleFullscreen: D, pasteAsPlainText: O, onTogglePasteAsPlainText: k }) {
|
|
77
|
+
let [A, j] = a(!1), [M, N] = a(!1), [P, F] = a(!1), [I, L] = a(null), [R, z] = a(null), [B, V] = a(null), H = T || !S, U = S?.getAttributes("textStyle")?.color, W = S?.getAttributes("highlight")?.color, G = C.showBold || C.showItalic || C.showUnderline || C.showStrike, K = C.showHeading1 || C.showHeading2 || C.showHeading3, q = C.showBulletList || C.showOrderedList, J = C.showBlockquote || C.showCodeBlock || C.showLink || C.showHorizontalRule, Y = C.showTextColor || C.showHighlight, X = C.showUndoRedo || C.showClearFormat, Z = C.showTableButton || C.showImageButton || C.showEmojiButton, Q = [
|
|
75
78
|
G,
|
|
76
79
|
K,
|
|
77
80
|
q,
|
|
@@ -79,16 +82,16 @@ function D({ editor: D, toolbarConfig: O, translation: k, disabled: A, isFullscr
|
|
|
79
82
|
Y,
|
|
80
83
|
X,
|
|
81
84
|
Z
|
|
82
|
-
],
|
|
85
|
+
], ge = Q.filter(Boolean).length;
|
|
83
86
|
function $(e, t) {
|
|
84
|
-
return !e || Q.slice(t + 1).findIndex(Boolean) === -1 ? null : /* @__PURE__ */
|
|
87
|
+
return !e || Q.slice(t + 1).findIndex(Boolean) === -1 ? null : /* @__PURE__ */ u(ne, {
|
|
85
88
|
orientation: "vertical",
|
|
86
89
|
flexItem: !0,
|
|
87
90
|
sx: { mx: .5 }
|
|
88
91
|
}, `div-${t}`);
|
|
89
92
|
}
|
|
90
|
-
return /* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */
|
|
93
|
+
return /* @__PURE__ */ d(l, { children: [
|
|
94
|
+
/* @__PURE__ */ d(o, {
|
|
92
95
|
sx: {
|
|
93
96
|
display: "flex",
|
|
94
97
|
flexWrap: "wrap",
|
|
@@ -100,263 +103,296 @@ function D({ editor: D, toolbarConfig: O, translation: k, disabled: A, isFullscr
|
|
|
100
103
|
role: "toolbar",
|
|
101
104
|
"aria-label": "Text formatting",
|
|
102
105
|
children: [
|
|
103
|
-
G && /* @__PURE__ */
|
|
106
|
+
G && /* @__PURE__ */ d(o, {
|
|
104
107
|
sx: {
|
|
105
108
|
display: "flex",
|
|
106
109
|
gap: .25
|
|
107
110
|
},
|
|
108
111
|
children: [
|
|
109
|
-
|
|
110
|
-
label:
|
|
111
|
-
icon: /* @__PURE__ */
|
|
112
|
-
onClick: () =>
|
|
113
|
-
active:
|
|
112
|
+
C.showBold && /* @__PURE__ */ u(e, {
|
|
113
|
+
label: w.bold,
|
|
114
|
+
icon: /* @__PURE__ */ u(ce, { fontSize: "small" }),
|
|
115
|
+
onClick: () => S?.chain().focus().toggleBold().run(),
|
|
116
|
+
active: S?.isActive("bold"),
|
|
114
117
|
disabled: H
|
|
115
118
|
}),
|
|
116
|
-
|
|
117
|
-
label:
|
|
118
|
-
icon: /* @__PURE__ */
|
|
119
|
-
onClick: () =>
|
|
120
|
-
active:
|
|
119
|
+
C.showItalic && /* @__PURE__ */ u(e, {
|
|
120
|
+
label: w.italic,
|
|
121
|
+
icon: /* @__PURE__ */ u(le, { fontSize: "small" }),
|
|
122
|
+
onClick: () => S?.chain().focus().toggleItalic().run(),
|
|
123
|
+
active: S?.isActive("italic"),
|
|
121
124
|
disabled: H
|
|
122
125
|
}),
|
|
123
|
-
|
|
124
|
-
label:
|
|
125
|
-
icon: /* @__PURE__ */
|
|
126
|
-
onClick: () =>
|
|
127
|
-
active:
|
|
126
|
+
C.showUnderline && /* @__PURE__ */ u(e, {
|
|
127
|
+
label: w.underline,
|
|
128
|
+
icon: /* @__PURE__ */ u(ue, { fontSize: "small" }),
|
|
129
|
+
onClick: () => S?.chain().focus().toggleUnderline().run(),
|
|
130
|
+
active: S?.isActive("underline"),
|
|
128
131
|
disabled: H
|
|
129
132
|
}),
|
|
130
|
-
|
|
131
|
-
label:
|
|
132
|
-
icon: /* @__PURE__ */
|
|
133
|
-
onClick: () =>
|
|
134
|
-
active:
|
|
133
|
+
C.showStrike && /* @__PURE__ */ u(e, {
|
|
134
|
+
label: w.strike,
|
|
135
|
+
icon: /* @__PURE__ */ u(de, { fontSize: "small" }),
|
|
136
|
+
onClick: () => S?.chain().focus().toggleStrike().run(),
|
|
137
|
+
active: S?.isActive("strike"),
|
|
135
138
|
disabled: H
|
|
136
139
|
})
|
|
137
140
|
]
|
|
138
141
|
}),
|
|
139
142
|
$(G, 0),
|
|
140
|
-
K && /* @__PURE__ */
|
|
143
|
+
K && /* @__PURE__ */ d(o, {
|
|
141
144
|
sx: {
|
|
142
145
|
display: "flex",
|
|
143
146
|
gap: .25
|
|
144
147
|
},
|
|
145
148
|
children: [
|
|
146
|
-
|
|
147
|
-
label:
|
|
148
|
-
icon: /* @__PURE__ */
|
|
149
|
-
onClick: () =>
|
|
150
|
-
active:
|
|
149
|
+
C.showHeading1 && /* @__PURE__ */ u(e, {
|
|
150
|
+
label: w.heading1,
|
|
151
|
+
icon: /* @__PURE__ */ u(x, { level: 1 }),
|
|
152
|
+
onClick: () => S?.chain().focus().toggleHeading({ level: 1 }).run(),
|
|
153
|
+
active: S?.isActive("heading", { level: 1 }),
|
|
151
154
|
disabled: H
|
|
152
155
|
}),
|
|
153
|
-
|
|
154
|
-
label:
|
|
155
|
-
icon: /* @__PURE__ */
|
|
156
|
-
onClick: () =>
|
|
157
|
-
active:
|
|
156
|
+
C.showHeading2 && /* @__PURE__ */ u(e, {
|
|
157
|
+
label: w.heading2,
|
|
158
|
+
icon: /* @__PURE__ */ u(x, { level: 2 }),
|
|
159
|
+
onClick: () => S?.chain().focus().toggleHeading({ level: 2 }).run(),
|
|
160
|
+
active: S?.isActive("heading", { level: 2 }),
|
|
158
161
|
disabled: H
|
|
159
162
|
}),
|
|
160
|
-
|
|
161
|
-
label:
|
|
162
|
-
icon: /* @__PURE__ */
|
|
163
|
-
onClick: () =>
|
|
164
|
-
active:
|
|
163
|
+
C.showHeading3 && /* @__PURE__ */ u(e, {
|
|
164
|
+
label: w.heading3,
|
|
165
|
+
icon: /* @__PURE__ */ u(x, { level: 3 }),
|
|
166
|
+
onClick: () => S?.chain().focus().toggleHeading({ level: 3 }).run(),
|
|
167
|
+
active: S?.isActive("heading", { level: 3 }),
|
|
165
168
|
disabled: H
|
|
166
169
|
})
|
|
167
170
|
]
|
|
168
171
|
}),
|
|
169
172
|
$(K, 1),
|
|
170
|
-
q && /* @__PURE__ */
|
|
173
|
+
q && /* @__PURE__ */ d(o, {
|
|
171
174
|
sx: {
|
|
172
175
|
display: "flex",
|
|
173
176
|
gap: .25
|
|
174
177
|
},
|
|
175
|
-
children: [
|
|
176
|
-
label:
|
|
177
|
-
icon: /* @__PURE__ */
|
|
178
|
-
onClick: () =>
|
|
179
|
-
active:
|
|
178
|
+
children: [C.showBulletList && /* @__PURE__ */ u(e, {
|
|
179
|
+
label: w.bulletList,
|
|
180
|
+
icon: /* @__PURE__ */ u(p, { fontSize: "small" }),
|
|
181
|
+
onClick: () => S?.chain().focus().toggleBulletList().run(),
|
|
182
|
+
active: S?.isActive("bulletList"),
|
|
180
183
|
disabled: H
|
|
181
|
-
}),
|
|
182
|
-
label:
|
|
183
|
-
icon: /* @__PURE__ */
|
|
184
|
-
onClick: () =>
|
|
185
|
-
active:
|
|
184
|
+
}), C.showOrderedList && /* @__PURE__ */ u(e, {
|
|
185
|
+
label: w.orderedList,
|
|
186
|
+
icon: /* @__PURE__ */ u(m, { fontSize: "small" }),
|
|
187
|
+
onClick: () => S?.chain().focus().toggleOrderedList().run(),
|
|
188
|
+
active: S?.isActive("orderedList"),
|
|
186
189
|
disabled: H
|
|
187
190
|
})]
|
|
188
191
|
}),
|
|
189
192
|
$(q, 2),
|
|
190
|
-
J && /* @__PURE__ */
|
|
193
|
+
J && /* @__PURE__ */ d(o, {
|
|
191
194
|
sx: {
|
|
192
195
|
display: "flex",
|
|
193
196
|
gap: .25
|
|
194
197
|
},
|
|
195
198
|
children: [
|
|
196
|
-
|
|
197
|
-
label:
|
|
198
|
-
icon: /* @__PURE__ */
|
|
199
|
-
onClick: () =>
|
|
200
|
-
active:
|
|
199
|
+
C.showBlockquote && /* @__PURE__ */ u(e, {
|
|
200
|
+
label: w.blockquote,
|
|
201
|
+
icon: /* @__PURE__ */ u(fe, { fontSize: "small" }),
|
|
202
|
+
onClick: () => S?.chain().focus().toggleBlockquote().run(),
|
|
203
|
+
active: S?.isActive("blockquote"),
|
|
201
204
|
disabled: H
|
|
202
205
|
}),
|
|
203
|
-
|
|
204
|
-
label:
|
|
205
|
-
icon: /* @__PURE__ */
|
|
206
|
-
onClick: () =>
|
|
207
|
-
active:
|
|
206
|
+
C.showCodeBlock && /* @__PURE__ */ u(e, {
|
|
207
|
+
label: w.codeBlock,
|
|
208
|
+
icon: /* @__PURE__ */ u(pe, { fontSize: "small" }),
|
|
209
|
+
onClick: () => S?.chain().focus().toggleCodeBlock().run(),
|
|
210
|
+
active: S?.isActive("codeBlock"),
|
|
208
211
|
disabled: H
|
|
209
212
|
}),
|
|
210
|
-
|
|
211
|
-
label:
|
|
212
|
-
icon: /* @__PURE__ */
|
|
213
|
-
onClick: () =>
|
|
214
|
-
active:
|
|
213
|
+
C.showLink && /* @__PURE__ */ u(e, {
|
|
214
|
+
label: w.link,
|
|
215
|
+
icon: /* @__PURE__ */ u(me, { fontSize: "small" }),
|
|
216
|
+
onClick: () => j(!0),
|
|
217
|
+
active: S?.isActive("link"),
|
|
215
218
|
disabled: H
|
|
216
219
|
}),
|
|
217
|
-
|
|
218
|
-
label:
|
|
219
|
-
icon: /* @__PURE__ */
|
|
220
|
-
onClick: () =>
|
|
220
|
+
C.showHorizontalRule && /* @__PURE__ */ u(e, {
|
|
221
|
+
label: w.horizontalRule,
|
|
222
|
+
icon: /* @__PURE__ */ u(he, { fontSize: "small" }),
|
|
223
|
+
onClick: () => S?.chain().focus().setHorizontalRule().run(),
|
|
221
224
|
disabled: H
|
|
222
225
|
})
|
|
223
226
|
]
|
|
224
227
|
}),
|
|
225
228
|
$(J, 3),
|
|
226
|
-
Y && /* @__PURE__ */
|
|
229
|
+
Y && /* @__PURE__ */ d(o, {
|
|
227
230
|
sx: {
|
|
228
231
|
display: "flex",
|
|
229
232
|
gap: .25
|
|
230
233
|
},
|
|
231
|
-
children: [
|
|
232
|
-
label:
|
|
233
|
-
icon: /* @__PURE__ */
|
|
234
|
+
children: [C.showTextColor && /* @__PURE__ */ u(b, {
|
|
235
|
+
label: w.textColor,
|
|
236
|
+
icon: /* @__PURE__ */ u(h, { fontSize: "small" }),
|
|
234
237
|
activeColor: U,
|
|
235
238
|
disabled: H,
|
|
236
239
|
onClick: (e) => z(e.currentTarget)
|
|
237
|
-
}),
|
|
238
|
-
label:
|
|
239
|
-
icon: /* @__PURE__ */
|
|
240
|
+
}), C.showHighlight && /* @__PURE__ */ u(b, {
|
|
241
|
+
label: w.highlight,
|
|
242
|
+
icon: /* @__PURE__ */ u(g, { fontSize: "small" }),
|
|
240
243
|
activeColor: W,
|
|
241
244
|
disabled: H,
|
|
242
245
|
onClick: (e) => V(e.currentTarget)
|
|
243
246
|
})]
|
|
244
247
|
}),
|
|
245
248
|
$(Y, 4),
|
|
246
|
-
X && /* @__PURE__ */
|
|
249
|
+
X && /* @__PURE__ */ d(o, {
|
|
247
250
|
sx: {
|
|
248
251
|
display: "flex",
|
|
249
252
|
gap: .25
|
|
250
253
|
},
|
|
251
|
-
children: [
|
|
252
|
-
label:
|
|
253
|
-
icon: /* @__PURE__ */ f
|
|
254
|
-
onClick: () =>
|
|
255
|
-
disabled: H || !
|
|
256
|
-
}), /* @__PURE__ */
|
|
257
|
-
label:
|
|
258
|
-
icon: /* @__PURE__ */
|
|
259
|
-
onClick: () =>
|
|
260
|
-
disabled: H || !
|
|
261
|
-
})] }),
|
|
262
|
-
label:
|
|
263
|
-
icon: /* @__PURE__ */
|
|
264
|
-
onClick: () =>
|
|
254
|
+
children: [C.showUndoRedo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(e, {
|
|
255
|
+
label: w.undo,
|
|
256
|
+
icon: /* @__PURE__ */ u(f, { fontSize: "small" }),
|
|
257
|
+
onClick: () => S?.chain().focus().undo().run(),
|
|
258
|
+
disabled: H || !S?.can().undo()
|
|
259
|
+
}), /* @__PURE__ */ u(e, {
|
|
260
|
+
label: w.redo,
|
|
261
|
+
icon: /* @__PURE__ */ u(re, { fontSize: "small" }),
|
|
262
|
+
onClick: () => S?.chain().focus().redo().run(),
|
|
263
|
+
disabled: H || !S?.can().redo()
|
|
264
|
+
})] }), C.showClearFormat && /* @__PURE__ */ u(e, {
|
|
265
|
+
label: w.clearFormat,
|
|
266
|
+
icon: /* @__PURE__ */ u(_, { fontSize: "small" }),
|
|
267
|
+
onClick: () => S?.chain().focus().clearNodes().unsetAllMarks().run(),
|
|
265
268
|
disabled: H
|
|
266
269
|
})]
|
|
267
270
|
}),
|
|
268
271
|
$(X, 5),
|
|
269
|
-
Z && /* @__PURE__ */
|
|
272
|
+
Z && /* @__PURE__ */ d(o, {
|
|
270
273
|
sx: {
|
|
271
274
|
display: "flex",
|
|
272
275
|
gap: .25
|
|
273
276
|
},
|
|
274
277
|
children: [
|
|
275
|
-
|
|
276
|
-
editor:
|
|
277
|
-
translation:
|
|
278
|
+
C.showTableButton && /* @__PURE__ */ u(r, {
|
|
279
|
+
editor: S,
|
|
280
|
+
translation: w,
|
|
278
281
|
disabled: H
|
|
279
282
|
}),
|
|
280
|
-
|
|
281
|
-
label:
|
|
282
|
-
icon: /* @__PURE__ */
|
|
283
|
-
onClick: () =>
|
|
283
|
+
C.showImageButton && /* @__PURE__ */ u(e, {
|
|
284
|
+
label: w.image,
|
|
285
|
+
icon: /* @__PURE__ */ u(oe, { fontSize: "small" }),
|
|
286
|
+
onClick: () => N(!0),
|
|
284
287
|
disabled: H
|
|
285
288
|
}),
|
|
286
|
-
|
|
287
|
-
title:
|
|
289
|
+
C.showEmojiButton && /* @__PURE__ */ u(c, {
|
|
290
|
+
title: w.emoji,
|
|
288
291
|
arrow: !0,
|
|
289
|
-
children: /* @__PURE__ */
|
|
292
|
+
children: /* @__PURE__ */ u("span", { children: /* @__PURE__ */ u(s, {
|
|
290
293
|
size: "small",
|
|
291
294
|
onMouseDown: (e) => e.preventDefault(),
|
|
292
295
|
onClick: (e) => L(e.currentTarget),
|
|
293
296
|
disabled: H,
|
|
294
297
|
sx: { borderRadius: 1 },
|
|
295
|
-
"aria-label":
|
|
296
|
-
children: /* @__PURE__ */
|
|
298
|
+
"aria-label": w.emoji,
|
|
299
|
+
children: /* @__PURE__ */ u(se, { fontSize: "small" })
|
|
297
300
|
}) })
|
|
298
301
|
})
|
|
299
302
|
]
|
|
300
303
|
}),
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
sx: {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
})
|
|
316
|
-
|
|
304
|
+
ge === 0 && /* @__PURE__ */ u(o, { sx: { height: 32 } }),
|
|
305
|
+
(C.showPasteAsPlainTextButton || C.showMarkdownButton || C.showFullscreenButton) && /* @__PURE__ */ d(o, {
|
|
306
|
+
sx: {
|
|
307
|
+
ml: "auto",
|
|
308
|
+
display: "flex",
|
|
309
|
+
gap: .25
|
|
310
|
+
},
|
|
311
|
+
children: [
|
|
312
|
+
C.showPasteAsPlainTextButton && /* @__PURE__ */ u(e, {
|
|
313
|
+
label: O ? w.pasteAsHtml : w.pasteAsPlainText,
|
|
314
|
+
icon: u(O ? y : v, { fontSize: "small" }),
|
|
315
|
+
onClick: k,
|
|
316
|
+
active: O,
|
|
317
|
+
disabled: T || !S
|
|
318
|
+
}),
|
|
319
|
+
C.showMarkdownButton && /* @__PURE__ */ u(e, {
|
|
320
|
+
label: w.markdown,
|
|
321
|
+
icon: /* @__PURE__ */ u(o, {
|
|
322
|
+
component: "span",
|
|
323
|
+
sx: {
|
|
324
|
+
fontWeight: "bold",
|
|
325
|
+
fontSize: "0.7rem",
|
|
326
|
+
lineHeight: 1
|
|
327
|
+
},
|
|
328
|
+
children: "MD"
|
|
329
|
+
}),
|
|
330
|
+
onClick: () => F(!0),
|
|
331
|
+
disabled: T || !S
|
|
332
|
+
}),
|
|
333
|
+
C.showFullscreenButton && /* @__PURE__ */ u(c, {
|
|
334
|
+
title: E ? w.exitFullscreen : w.fullscreen,
|
|
335
|
+
arrow: !0,
|
|
336
|
+
children: /* @__PURE__ */ u("span", { children: /* @__PURE__ */ u(s, {
|
|
337
|
+
size: "small",
|
|
338
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
339
|
+
onClick: D,
|
|
340
|
+
disabled: T || !S,
|
|
341
|
+
sx: { borderRadius: 1 },
|
|
342
|
+
"aria-label": E ? w.exitFullscreen : w.fullscreen,
|
|
343
|
+
children: u(E ? ae : ie, { fontSize: "small" })
|
|
344
|
+
}) })
|
|
345
|
+
})
|
|
346
|
+
]
|
|
317
347
|
})
|
|
318
348
|
]
|
|
319
349
|
}),
|
|
320
|
-
|
|
321
|
-
open:
|
|
322
|
-
onClose: () =>
|
|
323
|
-
editor:
|
|
324
|
-
translation:
|
|
350
|
+
C.showLink && S && /* @__PURE__ */ u(t, {
|
|
351
|
+
open: A,
|
|
352
|
+
onClose: () => j(!1),
|
|
353
|
+
editor: S,
|
|
354
|
+
translation: w
|
|
325
355
|
}),
|
|
326
|
-
|
|
356
|
+
C.showTextColor && /* @__PURE__ */ u(n, {
|
|
327
357
|
anchorEl: R,
|
|
328
358
|
open: !!R,
|
|
329
359
|
onClose: () => z(null),
|
|
330
360
|
mode: "textColor",
|
|
331
361
|
activeColor: U,
|
|
332
|
-
onSelectColor: (e) =>
|
|
333
|
-
onRemoveColor: () =>
|
|
334
|
-
removeLabel:
|
|
362
|
+
onSelectColor: (e) => S?.chain().focus().setColor(e).run(),
|
|
363
|
+
onRemoveColor: () => S?.chain().focus().unsetColor().run(),
|
|
364
|
+
removeLabel: w.removeTextColor
|
|
335
365
|
}),
|
|
336
|
-
|
|
366
|
+
C.showHighlight && /* @__PURE__ */ u(n, {
|
|
337
367
|
anchorEl: B,
|
|
338
368
|
open: !!B,
|
|
339
369
|
onClose: () => V(null),
|
|
340
370
|
mode: "highlight",
|
|
341
371
|
activeColor: W,
|
|
342
|
-
onSelectColor: (e) =>
|
|
343
|
-
onRemoveColor: () =>
|
|
344
|
-
removeLabel:
|
|
372
|
+
onSelectColor: (e) => S?.chain().focus().setHighlight({ color: e }).run(),
|
|
373
|
+
onRemoveColor: () => S?.chain().focus().unsetHighlight().run(),
|
|
374
|
+
removeLabel: w.removeHighlight
|
|
375
|
+
}),
|
|
376
|
+
C.showImageButton && S && /* @__PURE__ */ u(i, {
|
|
377
|
+
open: M,
|
|
378
|
+
onClose: () => N(!1),
|
|
379
|
+
editor: S,
|
|
380
|
+
translation: w
|
|
345
381
|
}),
|
|
346
|
-
|
|
382
|
+
C.showMarkdownButton && S && /* @__PURE__ */ u(te, {
|
|
347
383
|
open: P,
|
|
348
384
|
onClose: () => F(!1),
|
|
349
|
-
editor:
|
|
350
|
-
translation:
|
|
385
|
+
editor: S,
|
|
386
|
+
translation: w
|
|
351
387
|
}),
|
|
352
|
-
|
|
388
|
+
C.showEmojiButton && /* @__PURE__ */ u(ee, {
|
|
353
389
|
anchorEl: I,
|
|
354
390
|
open: !!I,
|
|
355
391
|
onClose: () => L(null),
|
|
356
|
-
onSelect: (e) =>
|
|
357
|
-
translation:
|
|
392
|
+
onSelect: (e) => S?.chain().focus().insertContent(e).run(),
|
|
393
|
+
translation: w
|
|
358
394
|
})
|
|
359
395
|
] });
|
|
360
396
|
}
|
|
361
397
|
//#endregion
|
|
362
|
-
export {
|
|
398
|
+
export { S as RichTextEditorToolbar };
|