@thebuoyant-tsdev/mui-ts-library 3.7.1 → 3.8.0

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.
@@ -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 a } from "./RichTextEditorEmojiPicker.js";
7
- import { useState as o } from "react";
8
- import { Box as s, Divider as c, IconButton as l, Tooltip as u } from "@mui/material";
9
- import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
10
- import m from "@mui/icons-material/Undo";
11
- import h from "@mui/icons-material/Redo";
12
- import ee from "@mui/icons-material/Fullscreen";
13
- import g from "@mui/icons-material/FullscreenExit";
14
- import te from "@mui/icons-material/Image";
15
- import ne from "@mui/icons-material/EmojiEmotions";
16
- import re from "@mui/icons-material/FormatBold";
17
- import ie from "@mui/icons-material/FormatItalic";
18
- import ae from "@mui/icons-material/FormatUnderlined";
19
- import oe from "@mui/icons-material/StrikethroughS";
20
- import _ from "@mui/icons-material/FormatListBulleted";
21
- import v from "@mui/icons-material/FormatListNumbered";
22
- import y from "@mui/icons-material/FormatQuote";
23
- import se from "@mui/icons-material/Code";
24
- import b from "@mui/icons-material/InsertLink";
25
- import x from "@mui/icons-material/HorizontalRule";
26
- import S from "@mui/icons-material/FormatColorText";
27
- import C from "@mui/icons-material/BorderColor";
28
- import w from "@mui/icons-material/FormatClear";
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 T({ label: e, icon: t, activeColor: n, disabled: r, onClick: i }) {
31
- return /* @__PURE__ */ f(u, {
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__ */ f("span", { children: /* @__PURE__ */ p(l, {
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__ */ f(s, {
49
+ children: [/* @__PURE__ */ u(o, {
47
50
  sx: {
48
51
  display: "flex",
49
52
  alignItems: "center"
50
53
  },
51
54
  children: t
52
- }), /* @__PURE__ */ f(s, { sx: {
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 E({ level: e }) {
63
- return /* @__PURE__ */ p(s, {
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 D({ editor: D, toolbarConfig: O, translation: k, disabled: A, isFullscreen: j, onToggleFullscreen: ce }) {
74
- let [M, N] = o(!1), [P, F] = o(!1), [I, L] = o(null), [R, z] = o(null), [B, V] = o(null), H = A || !D, U = D?.getAttributes("textStyle")?.color, W = D?.getAttributes("highlight")?.color, G = O.showBold || O.showItalic || O.showUnderline || O.showStrike, K = O.showHeading1 || O.showHeading2 || O.showHeading3, q = O.showBulletList || O.showOrderedList, J = O.showBlockquote || O.showCodeBlock || O.showLink || O.showHorizontalRule, Y = O.showTextColor || O.showHighlight, X = O.showUndoRedo || O.showClearFormat, Z = O.showTableButton || O.showImageButton || O.showEmojiButton, Q = [
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
- ], le = Q.filter(Boolean).length;
85
+ ], ge = Q.filter(Boolean).length;
83
86
  function $(e, t) {
84
- return !e || Q.slice(t + 1).findIndex(Boolean) === -1 ? null : /* @__PURE__ */ f(c, {
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__ */ p(d, { children: [
91
- /* @__PURE__ */ p(s, {
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__ */ p(s, {
106
+ G && /* @__PURE__ */ d(o, {
104
107
  sx: {
105
108
  display: "flex",
106
109
  gap: .25
107
110
  },
108
111
  children: [
109
- O.showBold && /* @__PURE__ */ f(e, {
110
- label: k.bold,
111
- icon: /* @__PURE__ */ f(re, { fontSize: "small" }),
112
- onClick: () => D?.chain().focus().toggleBold().run(),
113
- active: D?.isActive("bold"),
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
- O.showItalic && /* @__PURE__ */ f(e, {
117
- label: k.italic,
118
- icon: /* @__PURE__ */ f(ie, { fontSize: "small" }),
119
- onClick: () => D?.chain().focus().toggleItalic().run(),
120
- active: D?.isActive("italic"),
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
- O.showUnderline && /* @__PURE__ */ f(e, {
124
- label: k.underline,
125
- icon: /* @__PURE__ */ f(ae, { fontSize: "small" }),
126
- onClick: () => D?.chain().focus().toggleUnderline().run(),
127
- active: D?.isActive("underline"),
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
- O.showStrike && /* @__PURE__ */ f(e, {
131
- label: k.strike,
132
- icon: /* @__PURE__ */ f(oe, { fontSize: "small" }),
133
- onClick: () => D?.chain().focus().toggleStrike().run(),
134
- active: D?.isActive("strike"),
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__ */ p(s, {
143
+ K && /* @__PURE__ */ d(o, {
141
144
  sx: {
142
145
  display: "flex",
143
146
  gap: .25
144
147
  },
145
148
  children: [
146
- O.showHeading1 && /* @__PURE__ */ f(e, {
147
- label: k.heading1,
148
- icon: /* @__PURE__ */ f(E, { level: 1 }),
149
- onClick: () => D?.chain().focus().toggleHeading({ level: 1 }).run(),
150
- active: D?.isActive("heading", { level: 1 }),
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
- O.showHeading2 && /* @__PURE__ */ f(e, {
154
- label: k.heading2,
155
- icon: /* @__PURE__ */ f(E, { level: 2 }),
156
- onClick: () => D?.chain().focus().toggleHeading({ level: 2 }).run(),
157
- active: D?.isActive("heading", { level: 2 }),
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
- O.showHeading3 && /* @__PURE__ */ f(e, {
161
- label: k.heading3,
162
- icon: /* @__PURE__ */ f(E, { level: 3 }),
163
- onClick: () => D?.chain().focus().toggleHeading({ level: 3 }).run(),
164
- active: D?.isActive("heading", { level: 3 }),
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__ */ p(s, {
173
+ q && /* @__PURE__ */ d(o, {
171
174
  sx: {
172
175
  display: "flex",
173
176
  gap: .25
174
177
  },
175
- children: [O.showBulletList && /* @__PURE__ */ f(e, {
176
- label: k.bulletList,
177
- icon: /* @__PURE__ */ f(_, { fontSize: "small" }),
178
- onClick: () => D?.chain().focus().toggleBulletList().run(),
179
- active: D?.isActive("bulletList"),
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
- }), O.showOrderedList && /* @__PURE__ */ f(e, {
182
- label: k.orderedList,
183
- icon: /* @__PURE__ */ f(v, { fontSize: "small" }),
184
- onClick: () => D?.chain().focus().toggleOrderedList().run(),
185
- active: D?.isActive("orderedList"),
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__ */ p(s, {
193
+ J && /* @__PURE__ */ d(o, {
191
194
  sx: {
192
195
  display: "flex",
193
196
  gap: .25
194
197
  },
195
198
  children: [
196
- O.showBlockquote && /* @__PURE__ */ f(e, {
197
- label: k.blockquote,
198
- icon: /* @__PURE__ */ f(y, { fontSize: "small" }),
199
- onClick: () => D?.chain().focus().toggleBlockquote().run(),
200
- active: D?.isActive("blockquote"),
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
- O.showCodeBlock && /* @__PURE__ */ f(e, {
204
- label: k.codeBlock,
205
- icon: /* @__PURE__ */ f(se, { fontSize: "small" }),
206
- onClick: () => D?.chain().focus().toggleCodeBlock().run(),
207
- active: D?.isActive("codeBlock"),
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
- O.showLink && /* @__PURE__ */ f(e, {
211
- label: k.link,
212
- icon: /* @__PURE__ */ f(b, { fontSize: "small" }),
213
- onClick: () => N(!0),
214
- active: D?.isActive("link"),
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
- O.showHorizontalRule && /* @__PURE__ */ f(e, {
218
- label: k.horizontalRule,
219
- icon: /* @__PURE__ */ f(x, { fontSize: "small" }),
220
- onClick: () => D?.chain().focus().setHorizontalRule().run(),
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__ */ p(s, {
229
+ Y && /* @__PURE__ */ d(o, {
227
230
  sx: {
228
231
  display: "flex",
229
232
  gap: .25
230
233
  },
231
- children: [O.showTextColor && /* @__PURE__ */ f(T, {
232
- label: k.textColor,
233
- icon: /* @__PURE__ */ f(S, { fontSize: "small" }),
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
- }), O.showHighlight && /* @__PURE__ */ f(T, {
238
- label: k.highlight,
239
- icon: /* @__PURE__ */ f(C, { fontSize: "small" }),
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__ */ p(s, {
249
+ X && /* @__PURE__ */ d(o, {
247
250
  sx: {
248
251
  display: "flex",
249
252
  gap: .25
250
253
  },
251
- children: [O.showUndoRedo && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(e, {
252
- label: k.undo,
253
- icon: /* @__PURE__ */ f(m, { fontSize: "small" }),
254
- onClick: () => D?.chain().focus().undo().run(),
255
- disabled: H || !D?.can().undo()
256
- }), /* @__PURE__ */ f(e, {
257
- label: k.redo,
258
- icon: /* @__PURE__ */ f(h, { fontSize: "small" }),
259
- onClick: () => D?.chain().focus().redo().run(),
260
- disabled: H || !D?.can().redo()
261
- })] }), O.showClearFormat && /* @__PURE__ */ f(e, {
262
- label: k.clearFormat,
263
- icon: /* @__PURE__ */ f(w, { fontSize: "small" }),
264
- onClick: () => D?.chain().focus().clearNodes().unsetAllMarks().run(),
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__ */ p(s, {
272
+ Z && /* @__PURE__ */ d(o, {
270
273
  sx: {
271
274
  display: "flex",
272
275
  gap: .25
273
276
  },
274
277
  children: [
275
- O.showTableButton && /* @__PURE__ */ f(r, {
276
- editor: D,
277
- translation: k,
278
+ C.showTableButton && /* @__PURE__ */ u(r, {
279
+ editor: S,
280
+ translation: w,
278
281
  disabled: H
279
282
  }),
280
- O.showImageButton && /* @__PURE__ */ f(e, {
281
- label: k.image,
282
- icon: /* @__PURE__ */ f(te, { fontSize: "small" }),
283
- onClick: () => F(!0),
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
- O.showEmojiButton && /* @__PURE__ */ f(u, {
287
- title: k.emoji,
289
+ C.showEmojiButton && /* @__PURE__ */ u(c, {
290
+ title: w.emoji,
288
291
  arrow: !0,
289
- children: /* @__PURE__ */ f("span", { children: /* @__PURE__ */ f(l, {
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": k.emoji,
296
- children: /* @__PURE__ */ f(ne, { fontSize: "small" })
298
+ "aria-label": w.emoji,
299
+ children: /* @__PURE__ */ u(se, { fontSize: "small" })
297
300
  }) })
298
301
  })
299
302
  ]
300
303
  }),
301
- le === 0 && /* @__PURE__ */ f(s, { sx: { height: 32 } }),
302
- O.showFullscreenButton && /* @__PURE__ */ f(s, {
303
- sx: { ml: "auto" },
304
- children: /* @__PURE__ */ f(u, {
305
- title: j ? k.exitFullscreen : k.fullscreen,
306
- arrow: !0,
307
- children: /* @__PURE__ */ f("span", { children: /* @__PURE__ */ f(l, {
308
- size: "small",
309
- onMouseDown: (e) => e.preventDefault(),
310
- onClick: ce,
311
- disabled: A || !D,
312
- sx: { borderRadius: 1 },
313
- "aria-label": j ? k.exitFullscreen : k.fullscreen,
314
- children: f(j ? g : ee, { fontSize: "small" })
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
- O.showLink && D && /* @__PURE__ */ f(t, {
321
- open: M,
322
- onClose: () => N(!1),
323
- editor: D,
324
- translation: k
350
+ C.showLink && S && /* @__PURE__ */ u(t, {
351
+ open: A,
352
+ onClose: () => j(!1),
353
+ editor: S,
354
+ translation: w
325
355
  }),
326
- O.showTextColor && /* @__PURE__ */ f(n, {
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) => D?.chain().focus().setColor(e).run(),
333
- onRemoveColor: () => D?.chain().focus().unsetColor().run(),
334
- removeLabel: k.removeTextColor
362
+ onSelectColor: (e) => S?.chain().focus().setColor(e).run(),
363
+ onRemoveColor: () => S?.chain().focus().unsetColor().run(),
364
+ removeLabel: w.removeTextColor
335
365
  }),
336
- O.showHighlight && /* @__PURE__ */ f(n, {
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) => D?.chain().focus().setHighlight({ color: e }).run(),
343
- onRemoveColor: () => D?.chain().focus().unsetHighlight().run(),
344
- removeLabel: k.removeHighlight
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
- O.showImageButton && D && /* @__PURE__ */ f(i, {
382
+ C.showMarkdownButton && S && /* @__PURE__ */ u(te, {
347
383
  open: P,
348
384
  onClose: () => F(!1),
349
- editor: D,
350
- translation: k
385
+ editor: S,
386
+ translation: w
351
387
  }),
352
- O.showEmojiButton && /* @__PURE__ */ f(a, {
388
+ C.showEmojiButton && /* @__PURE__ */ u(ee, {
353
389
  anchorEl: I,
354
390
  open: !!I,
355
391
  onClose: () => L(null),
356
- onSelect: (e) => D?.chain().focus().insertContent(e).run(),
357
- translation: k
392
+ onSelect: (e) => S?.chain().focus().insertContent(e).run(),
393
+ translation: w
358
394
  })
359
395
  ] });
360
396
  }
361
397
  //#endregion
362
- export { D as RichTextEditorToolbar };
398
+ export { S as RichTextEditorToolbar };