@trinityui/design-system 1.0.11 → 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.
Files changed (43) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/app-shell.js +3007 -2776
  3. package/dist/components/AI/InsightEngineInput.d.ts +9 -0
  4. package/dist/components/AI/InsightEngineInput.d.ts.map +1 -1
  5. package/dist/components/Carousel/Carousel.d.ts +35 -0
  6. package/dist/components/Carousel/Carousel.d.ts.map +1 -0
  7. package/dist/components/Carousel/index.d.ts +2 -0
  8. package/dist/components/Carousel/index.d.ts.map +1 -0
  9. package/dist/components/ChipsInput/ChipsInput.d.ts +69 -0
  10. package/dist/components/ChipsInput/ChipsInput.d.ts.map +1 -0
  11. package/dist/components/ChipsInput/index.d.ts +2 -0
  12. package/dist/components/ChipsInput/index.d.ts.map +1 -0
  13. package/dist/components/Combobox/Combobox.d.ts +4 -0
  14. package/dist/components/Combobox/Combobox.d.ts.map +1 -1
  15. package/dist/components/CommandPalette/CommandPalette.d.ts +4 -0
  16. package/dist/components/CommandPalette/CommandPalette.d.ts.map +1 -1
  17. package/dist/components/FilterBar/FilterBar.d.ts.map +1 -1
  18. package/dist/components/MentionsInput/MentionsInput.d.ts +80 -0
  19. package/dist/components/MentionsInput/MentionsInput.d.ts.map +1 -0
  20. package/dist/components/MentionsInput/index.d.ts +2 -0
  21. package/dist/components/MentionsInput/index.d.ts.map +1 -0
  22. package/dist/components/NestedMenu/NestedMenu.d.ts +53 -0
  23. package/dist/components/NestedMenu/NestedMenu.d.ts.map +1 -0
  24. package/dist/components/NestedMenu/index.d.ts +2 -0
  25. package/dist/components/NestedMenu/index.d.ts.map +1 -0
  26. package/dist/components/SearchInput/SearchInput.d.ts +2 -0
  27. package/dist/components/SearchInput/SearchInput.d.ts.map +1 -1
  28. package/dist/components/Tour/Tour.d.ts +53 -0
  29. package/dist/components/Tour/Tour.d.ts.map +1 -0
  30. package/dist/components/Tour/index.d.ts +2 -0
  31. package/dist/components/Tour/index.d.ts.map +1 -0
  32. package/dist/components/VirtualizedAutocomplete/VirtualizedAutocomplete.d.ts +50 -0
  33. package/dist/components/VirtualizedAutocomplete/VirtualizedAutocomplete.d.ts.map +1 -0
  34. package/dist/components/VirtualizedAutocomplete/index.d.ts +2 -0
  35. package/dist/components/VirtualizedAutocomplete/index.d.ts.map +1 -0
  36. package/dist/components/index.d.ts +12 -0
  37. package/dist/components/index.d.ts.map +1 -1
  38. package/dist/forms.js +681 -550
  39. package/dist/index.d.ts +12 -0
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +3074 -2116
  42. package/dist/tokens.js +3 -3
  43. package/package.json +2 -1
package/dist/forms.js CHANGED
@@ -1,21 +1,21 @@
1
- import { jsxs as L, Fragment as Se, jsx as e } from "react/jsx-runtime";
2
- import * as a from "react";
3
- import { createElement as Le, useState as ie, useRef as Ie, useCallback as K } from "react";
4
- import { useTheme as ce, Paper as oe, Divider as ge, Button as ae, alpha as de, Autocomplete as ze, Typography as te, ListItem as ye, ListItemIcon as se, Checkbox as we, Box as J, ListItemText as ve, Popper as Fe, Chip as Ce, TextField as De, Alert as ue, Stack as Be, List as Re, LinearProgress as Te, ListItemSecondaryAction as Ee, IconButton as V, Tooltip as g, ToggleButtonGroup as Pe, ToggleButton as q, FormControl as Ue, Select as Ae, MenuItem as X } from "@mui/material";
5
- import { Add as qe, Close as me, Check as he, FullscreenExit as Me, Fullscreen as Oe, FormatClear as je, Redo as He, Undo as We, FormatAlignLeft as $e, FormatAlignCenter as Ke, FormatAlignRight as Ve, FormatAlignJustify as Ge, Image as Ne, Link as _e, Code as Je, FormatQuote as Qe, FormatListNumbered as Ye, FormatListBulleted as Ze, StrikethroughS as Xe, FormatUnderlined as et, FormatItalic as tt, FormatBold as rt } from "@mui/icons-material";
6
- import le from "@mui/icons-material/CloudUpload";
7
- import nt from "@mui/icons-material/InsertDriveFile";
8
- import ot from "@mui/icons-material/Delete";
9
- import xe from "@mui/icons-material/CheckCircle";
10
- import it from "@mui/icons-material/Error";
11
- import lt from "@mui/icons-material/PictureAsPdf";
12
- import at from "@mui/icons-material/Image";
13
- import st from "@mui/icons-material/VideoLibrary";
14
- import ct from "@mui/icons-material/Description";
15
- const fe = () => `new-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, dt = (l) => /* @__PURE__ */ e(
16
- Fe,
1
+ import { jsxs as k, jsx as e, Fragment as Fe } from "react/jsx-runtime";
2
+ import * as l from "react";
3
+ import { createElement as De, useState as de, useRef as Re, useCallback as Q } from "react";
4
+ import { useTheme as ye, Paper as se, Box as E, ListItem as he, alpha as ce, ListItemIcon as ae, Checkbox as ve, ListItemText as pe, Divider as fe, Button as ge, Autocomplete as Be, Typography as oe, Popper as Te, Chip as Se, TextField as Pe, Alert as Ce, Stack as Ee, List as Ae, LinearProgress as Ue, ListItemSecondaryAction as Me, IconButton as Y, Tooltip as x, ToggleButtonGroup as Oe, ToggleButton as V, FormControl as je, Select as qe, MenuItem as ne } from "@mui/material";
5
+ import { Check as ue, Add as We, Close as xe, FullscreenExit as He, Fullscreen as $e, FormatClear as Ke, Redo as Ve, Undo as Ge, FormatAlignLeft as Ne, FormatAlignCenter as _e, FormatAlignRight as Je, FormatAlignJustify as Qe, Image as Ye, Link as Ze, Code as Xe, FormatQuote as et, FormatListNumbered as tt, FormatListBulleted as rt, StrikethroughS as nt, FormatUnderlined as ot, FormatItalic as it, FormatBold as lt } from "@mui/icons-material";
6
+ import me from "@mui/icons-material/CloudUpload";
7
+ import at from "@mui/icons-material/InsertDriveFile";
8
+ import st from "@mui/icons-material/Delete";
9
+ import Le from "@mui/icons-material/CheckCircle";
10
+ import ct from "@mui/icons-material/Error";
11
+ import dt from "@mui/icons-material/PictureAsPdf";
12
+ import ut from "@mui/icons-material/Image";
13
+ import mt from "@mui/icons-material/VideoLibrary";
14
+ import ht from "@mui/icons-material/Description";
15
+ const be = () => `new-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, pt = (i) => /* @__PURE__ */ e(
16
+ Te,
17
17
  {
18
- ...l,
18
+ ...i,
19
19
  placement: "bottom-start",
20
20
  modifiers: [
21
21
  {
@@ -26,76 +26,90 @@ const fe = () => `new-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
26
26
  }
27
27
  ]
28
28
  }
29
- ), wt = ({
30
- options: l,
31
- value: h,
32
- defaultValue: s,
29
+ ), Bt = ({
30
+ options: i,
31
+ value: f,
32
+ defaultValue: a,
33
33
  onChange: v,
34
- creatable: m = !1,
35
- onCreate: C,
36
- createText: I = 'Create "{value}"',
37
- multiple: f = !1,
38
- placeholder: G = "Select...",
39
- label: M,
40
- helperText: u,
41
- error: T = !1,
42
- errorMessage: Q,
43
- disabled: O = !1,
44
- fullWidth: p = !1,
45
- size: c = "medium",
46
- limitTags: d = 3,
47
- showCheckbox: j = !0,
48
- groupBy: E = !1,
49
- loading: w = !1,
50
- noOptionsText: H = "No options",
51
- filterOptions: x,
52
- renderOption: y,
53
- renderTag: k,
54
- freeSolo: F = !1,
55
- autoHighlight: re = !0,
56
- clearOnEscape: N = !0,
57
- className: ne,
58
- sx: ee
34
+ creatable: u = !1,
35
+ onCreate: L,
36
+ createText: D = 'Create "{value}"',
37
+ multiple: m = !1,
38
+ placeholder: Z = "Select...",
39
+ label: G,
40
+ helperText: d,
41
+ error: W = !1,
42
+ errorMessage: ee,
43
+ disabled: N = !1,
44
+ fullWidth: g = !1,
45
+ size: s = "medium",
46
+ limitTags: c = 3,
47
+ showCheckbox: A = !0,
48
+ groupBy: H = !1,
49
+ loading: B = !1,
50
+ noOptionsText: _ = "No options",
51
+ filterOptions: I,
52
+ renderOption: b,
53
+ renderTag: z,
54
+ freeSolo: T = !1,
55
+ autoHighlight: ie = !0,
56
+ clearOnEscape: X = !0,
57
+ showSelectAll: te = !1,
58
+ selectAllText: re = "Select All",
59
+ className: $,
60
+ sx: le
59
61
  }) => {
60
- const R = ce(), [D, P] = a.useState(""), [Y, W] = a.useState(
61
- s || []
62
- ), b = h !== void 0 ? h : Y, _ = a.useCallback(
63
- (t, o) => {
64
- if (x)
65
- return x(t, o);
66
- const i = o.inputValue.toLowerCase();
67
- return t.filter(
68
- (U) => U.label.toLowerCase().includes(i) || U.secondary?.toLowerCase().includes(i)
62
+ const U = ye(), [w, J] = l.useState(""), [M, O] = l.useState(
63
+ a || []
64
+ ), j = f !== void 0 ? f : M, r = l.useCallback(
65
+ (n, o) => {
66
+ if (I)
67
+ return I(n, o);
68
+ const p = o.inputValue.toLowerCase();
69
+ return n.filter(
70
+ (S) => S.label.toLowerCase().includes(p) || S.secondary?.toLowerCase().includes(p)
69
71
  );
70
72
  },
71
- [x]
72
- ), $ = a.useMemo(() => !m || !D.trim() ? !1 : !l.some(
73
- (o) => o.label.toLowerCase() === D.toLowerCase()
74
- ), [m, D, l]), n = async (t, o) => {
75
- let i;
76
- if (f) {
77
- const U = o || [];
78
- i = await Promise.all(
79
- U.map(async (A) => typeof A == "string" ? m && C ? await C(A) : { id: fe(), label: A } : A)
73
+ [I]
74
+ ), C = l.useMemo(() => !u || !w.trim() ? !1 : !i.some(
75
+ (o) => o.label.toLowerCase() === w.toLowerCase()
76
+ ), [u, w, i]), P = async (n, o) => {
77
+ let p;
78
+ if (m) {
79
+ const S = o || [];
80
+ p = await Promise.all(
81
+ S.map(async (K) => typeof K == "string" ? u && L ? await L(K) : { id: be(), label: K } : K)
80
82
  );
81
83
  } else
82
- o === null ? i = [] : typeof o == "string" ? m && C ? i = [await C(o)] : i = [{ id: fe(), label: o }] : i = [o];
83
- W(i), v?.(i);
84
- }, S = a.useCallback(async () => {
85
- if (!$ || !C) return;
86
- const t = await C(D), o = f ? [...b, t] : [t];
87
- W(o), v?.(o), P("");
88
- }, [$, C, D, f, b, v]), B = (t) => /* @__PURE__ */ e(
89
- De,
84
+ o === null ? p = [] : typeof o == "string" ? u && L ? p = [await L(o)] : p = [{ id: be(), label: o }] : p = [o];
85
+ O(p), v?.(p);
86
+ }, q = l.useMemo(() => {
87
+ const n = i.filter((o) => !o.disabled);
88
+ return n.length > 0 && n.every(
89
+ (o) => j.some((p) => p.id === o.id)
90
+ );
91
+ }, [i, j]), F = l.useCallback(() => {
92
+ if (q)
93
+ O([]), v?.([]);
94
+ else {
95
+ const n = i.filter((o) => !o.disabled);
96
+ O(n), v?.(n);
97
+ }
98
+ }, [q, i, v]), t = l.useCallback(async () => {
99
+ if (!C || !L) return;
100
+ const n = await L(w), o = m ? [...j, n] : [n];
101
+ O(o), v?.(o), J("");
102
+ }, [C, L, w, m, j, v]), h = (n) => /* @__PURE__ */ e(
103
+ Pe,
90
104
  {
91
- ...t,
92
- label: M,
93
- placeholder: b.length === 0 ? G : void 0,
94
- error: T,
95
- helperText: T ? Q : u,
96
- size: c,
105
+ ...n,
106
+ label: G,
107
+ placeholder: j.length === 0 ? Z : void 0,
108
+ error: W,
109
+ helperText: W ? ee : d,
110
+ size: s,
97
111
  InputProps: {
98
- ...t.InputProps,
112
+ ...n.InputProps,
99
113
  sx: {
100
114
  "& .MuiAutocomplete-input": {
101
115
  minWidth: "60px !important"
@@ -103,16 +117,16 @@ const fe = () => `new-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
103
117
  }
104
118
  }
105
119
  }
106
- ), Z = (t, o) => t.map((i, U) => {
107
- const A = o({ index: U });
108
- return k ? k(i, A.onDelete) : /* @__PURE__ */ Le(
109
- Ce,
120
+ ), R = (n, o) => n.map((p, S) => {
121
+ const K = o({ index: S });
122
+ return z ? z(p, K.onDelete) : /* @__PURE__ */ De(
123
+ Se,
110
124
  {
111
- ...A,
112
- key: i.id,
113
- label: i.label,
114
- size: c,
115
- deleteIcon: /* @__PURE__ */ e(me, { fontSize: "small" }),
125
+ ...K,
126
+ key: p.id,
127
+ label: p.label,
128
+ size: s,
129
+ deleteIcon: /* @__PURE__ */ e(xe, { fontSize: "small" }),
116
130
  sx: {
117
131
  maxWidth: 150,
118
132
  "& .MuiChip-label": {
@@ -122,80 +136,197 @@ const fe = () => `new-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
122
136
  }
123
137
  }
124
138
  );
125
- }), z = a.useCallback(
126
- (t) => /* @__PURE__ */ L(oe, { ...t, elevation: 8, children: [
127
- t.children,
128
- $ && /* @__PURE__ */ L(Se, { children: [
129
- /* @__PURE__ */ e(ge, {}),
130
- /* @__PURE__ */ e(
131
- ae,
139
+ }), y = l.useCallback(
140
+ (n) => {
141
+ const { children: o, ...p } = n;
142
+ return /* @__PURE__ */ k(se, { ...p, elevation: 8, children: [
143
+ m && te && /* @__PURE__ */ k(
144
+ E,
132
145
  {
133
- fullWidth: !0,
134
- startIcon: /* @__PURE__ */ e(qe, {}),
135
- onClick: S,
136
- sx: {
137
- justifyContent: "flex-start",
138
- py: 1.5,
139
- px: 2,
140
- textTransform: "none",
141
- color: "primary.main",
142
- borderRadius: 0,
143
- "&:hover": {
144
- backgroundColor: de(R.palette.primary.main, 0.08)
145
- }
146
+ onMouseDown: (S) => {
147
+ S.preventDefault(), S.stopPropagation();
148
+ },
149
+ onClick: (S) => {
150
+ S.preventDefault(), S.stopPropagation(), F();
146
151
  },
147
- children: I.replace("{value}", D)
152
+ children: [
153
+ /* @__PURE__ */ k(
154
+ he,
155
+ {
156
+ dense: !0,
157
+ sx: {
158
+ cursor: "pointer",
159
+ "&:hover": {
160
+ backgroundColor: ce(U.palette.primary.main, 0.08)
161
+ }
162
+ },
163
+ children: [
164
+ A && /* @__PURE__ */ e(ae, { sx: { minWidth: 36, pointerEvents: "none" }, children: /* @__PURE__ */ e(
165
+ ve,
166
+ {
167
+ icon: /* @__PURE__ */ e(
168
+ E,
169
+ {
170
+ sx: {
171
+ width: 18,
172
+ height: 18,
173
+ border: "2px solid",
174
+ borderColor: "action.active",
175
+ borderRadius: 0.5,
176
+ backgroundColor: "transparent"
177
+ }
178
+ }
179
+ ),
180
+ checkedIcon: /* @__PURE__ */ e(
181
+ E,
182
+ {
183
+ sx: {
184
+ width: 18,
185
+ height: 18,
186
+ border: "2px solid",
187
+ borderColor: "primary.main",
188
+ borderRadius: 0.5,
189
+ backgroundColor: "primary.main",
190
+ display: "flex",
191
+ alignItems: "center",
192
+ justifyContent: "center"
193
+ },
194
+ children: /* @__PURE__ */ e(
195
+ ue,
196
+ {
197
+ sx: {
198
+ width: 14,
199
+ height: 14,
200
+ color: "primary.contrastText"
201
+ }
202
+ }
203
+ )
204
+ }
205
+ ),
206
+ checked: q,
207
+ size: "small",
208
+ disableRipple: !0,
209
+ tabIndex: -1
210
+ }
211
+ ) }),
212
+ /* @__PURE__ */ e(
213
+ pe,
214
+ {
215
+ primary: q ? "Deselect All" : re,
216
+ primaryTypographyProps: {
217
+ variant: "body2",
218
+ fontWeight: 500
219
+ }
220
+ }
221
+ )
222
+ ]
223
+ }
224
+ ),
225
+ /* @__PURE__ */ e(fe, {})
226
+ ]
148
227
  }
149
- )
150
- ] })
151
- ] }),
152
- [$, I, D, R.palette.primary.main, S]
153
- ), r = l;
228
+ ),
229
+ o,
230
+ C && /* @__PURE__ */ k(Fe, { children: [
231
+ /* @__PURE__ */ e(fe, {}),
232
+ /* @__PURE__ */ e(
233
+ ge,
234
+ {
235
+ fullWidth: !0,
236
+ startIcon: /* @__PURE__ */ e(We, {}),
237
+ onClick: t,
238
+ sx: {
239
+ justifyContent: "flex-start",
240
+ py: 1.5,
241
+ px: 2,
242
+ textTransform: "none",
243
+ color: "primary.main",
244
+ borderRadius: 0,
245
+ "&:hover": {
246
+ backgroundColor: ce(U.palette.primary.main, 0.08)
247
+ }
248
+ },
249
+ children: D.replace("{value}", w)
250
+ }
251
+ )
252
+ ] })
253
+ ] });
254
+ },
255
+ [C, D, w, U.palette.primary.main, t, m, te, A, F, q, re]
256
+ ), we = i;
154
257
  return /* @__PURE__ */ e(
155
- ze,
258
+ Be,
156
259
  {
157
- className: ne,
260
+ className: $,
158
261
  sx: {
159
- width: p ? "100%" : 300,
160
- ...ee
262
+ width: g ? "100%" : 300,
263
+ ...le
161
264
  },
162
- multiple: f,
163
- options: r,
164
- value: f ? b : b[0] || null,
165
- onChange: n,
166
- inputValue: D,
167
- onInputChange: (t, o) => P(o),
168
- getOptionLabel: (t) => typeof t == "string" ? t : t.label,
169
- isOptionEqualToValue: (t, o) => t.id === o.id,
170
- getOptionDisabled: (t) => typeof t == "object" && t.disabled === !0,
171
- groupBy: E ? (t) => t.group || "" : void 0,
172
- filterOptions: _,
173
- renderInput: B,
174
- renderTags: f ? Z : void 0,
175
- renderOption: (t, o, { selected: i }) => {
176
- const { key: U, ...A } = t;
177
- return y ? /* @__PURE__ */ e("li", { ...A, children: y(o, { selected: i }) }, U) : /* @__PURE__ */ L(ye, { ...A, dense: !0, children: [
178
- f && j && /* @__PURE__ */ e(se, { sx: { minWidth: 36 }, children: /* @__PURE__ */ e(
179
- we,
265
+ multiple: m,
266
+ options: we,
267
+ value: m ? j : j[0] || null,
268
+ onChange: P,
269
+ inputValue: w,
270
+ onInputChange: (n, o) => J(o),
271
+ getOptionLabel: (n) => typeof n == "string" ? n : n.label,
272
+ isOptionEqualToValue: (n, o) => n.id === o.id,
273
+ getOptionDisabled: (n) => typeof n == "object" && n.disabled === !0,
274
+ groupBy: H ? (n) => n.group || "" : void 0,
275
+ filterOptions: r,
276
+ renderInput: h,
277
+ renderTags: m ? R : void 0,
278
+ renderOption: (n, o, { selected: p }) => {
279
+ const { key: S, ...K } = n;
280
+ return b ? /* @__PURE__ */ e("li", { ...K, children: b(o, { selected: p }) }, S) : /* @__PURE__ */ k(he, { ...K, dense: !0, children: [
281
+ m && A && /* @__PURE__ */ e(ae, { sx: { minWidth: 36 }, children: /* @__PURE__ */ e(
282
+ ve,
180
283
  {
181
- icon: /* @__PURE__ */ e(J, { sx: { width: 18, height: 18 } }),
182
- checkedIcon: /* @__PURE__ */ e(
183
- he,
284
+ icon: /* @__PURE__ */ e(
285
+ E,
184
286
  {
185
287
  sx: {
186
288
  width: 18,
187
289
  height: 18,
188
- color: "primary.main"
290
+ border: "2px solid",
291
+ borderColor: "action.active",
292
+ borderRadius: 0.5,
293
+ backgroundColor: "transparent"
189
294
  }
190
295
  }
191
296
  ),
192
- checked: i,
297
+ checkedIcon: /* @__PURE__ */ e(
298
+ E,
299
+ {
300
+ sx: {
301
+ width: 18,
302
+ height: 18,
303
+ border: "2px solid",
304
+ borderColor: "primary.main",
305
+ borderRadius: 0.5,
306
+ backgroundColor: "primary.main",
307
+ display: "flex",
308
+ alignItems: "center",
309
+ justifyContent: "center"
310
+ },
311
+ children: /* @__PURE__ */ e(
312
+ ue,
313
+ {
314
+ sx: {
315
+ width: 14,
316
+ height: 14,
317
+ color: "primary.contrastText"
318
+ }
319
+ }
320
+ )
321
+ }
322
+ ),
323
+ checked: p,
193
324
  size: "small"
194
325
  }
195
326
  ) }),
196
- o.icon && /* @__PURE__ */ e(se, { sx: { minWidth: 36 }, children: o.icon }),
327
+ o.icon && /* @__PURE__ */ e(ae, { sx: { minWidth: 36 }, children: o.icon }),
197
328
  /* @__PURE__ */ e(
198
- ve,
329
+ pe,
199
330
  {
200
331
  primary: o.label,
201
332
  secondary: o.secondary,
@@ -203,238 +334,238 @@ const fe = () => `new-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
203
334
  secondaryTypographyProps: { variant: "caption" }
204
335
  }
205
336
  ),
206
- !f && i && /* @__PURE__ */ e(he, { sx: { ml: 1, color: "primary.main" }, fontSize: "small" })
207
- ] }, U);
337
+ !m && p && /* @__PURE__ */ e(ue, { sx: { ml: 1, color: "primary.main" }, fontSize: "small" })
338
+ ] }, S);
208
339
  },
209
- PaperComponent: m ? z : oe,
210
- PopperComponent: dt,
211
- limitTags: d,
212
- disabled: O,
213
- loading: w,
214
- noOptionsText: $ ? /* @__PURE__ */ e(te, { variant: "body2", color: "text.secondary", children: "Press Enter or click below to create" }) : H,
215
- freeSolo: F || m,
216
- autoHighlight: re,
217
- clearOnEscape: N,
218
- disableCloseOnSelect: f,
340
+ PaperComponent: u || m && te ? y : se,
341
+ PopperComponent: pt,
342
+ limitTags: c,
343
+ disabled: N,
344
+ loading: B,
345
+ noOptionsText: C ? /* @__PURE__ */ e(oe, { variant: "body2", color: "text.secondary", children: "Press Enter or click below to create" }) : _,
346
+ freeSolo: T || u,
347
+ autoHighlight: ie,
348
+ clearOnEscape: X,
349
+ disableCloseOnSelect: m,
219
350
  ChipProps: {
220
- size: c,
221
- deleteIcon: /* @__PURE__ */ e(me, { fontSize: "small" })
351
+ size: s,
352
+ deleteIcon: /* @__PURE__ */ e(xe, { fontSize: "small" })
222
353
  }
223
354
  }
224
355
  );
225
- }, ke = (l) => {
226
- if (l === 0) return "0 Bytes";
227
- const h = 1024, s = ["Bytes", "KB", "MB", "GB"], v = Math.floor(Math.log(l) / Math.log(h));
228
- return parseFloat((l / Math.pow(h, v)).toFixed(2)) + " " + s[v];
229
- }, be = (l) => l.startsWith("image/") ? /* @__PURE__ */ e(at, {}) : l.startsWith("video/") ? /* @__PURE__ */ e(st, {}) : l === "application/pdf" ? /* @__PURE__ */ e(lt, {}) : l.includes("document") || l.includes("text") ? /* @__PURE__ */ e(ct, {}) : /* @__PURE__ */ e(nt, {}), ut = () => `file-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, Ft = ({
230
- variant: l = "dropzone",
231
- accept: h,
232
- multiple: s = !1,
356
+ }, Ie = (i) => {
357
+ if (i === 0) return "0 Bytes";
358
+ const f = 1024, a = ["Bytes", "KB", "MB", "GB"], v = Math.floor(Math.log(i) / Math.log(f));
359
+ return parseFloat((i / Math.pow(f, v)).toFixed(2)) + " " + a[v];
360
+ }, ze = (i) => i.startsWith("image/") ? /* @__PURE__ */ e(ut, {}) : i.startsWith("video/") ? /* @__PURE__ */ e(mt, {}) : i === "application/pdf" ? /* @__PURE__ */ e(dt, {}) : i.includes("document") || i.includes("text") ? /* @__PURE__ */ e(ht, {}) : /* @__PURE__ */ e(at, {}), ft = () => `file-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, Tt = ({
361
+ variant: i = "dropzone",
362
+ accept: f,
363
+ multiple: a = !1,
233
364
  maxSize: v,
234
- maxFiles: m,
235
- files: C,
236
- onFilesChange: I,
237
- onFileSelect: f,
238
- onFileRemove: G,
239
- onUpload: M,
240
- disabled: u = !1,
241
- helperText: T,
242
- error: Q,
243
- showFileList: O = !0,
244
- size: p = "medium",
245
- sx: c
365
+ maxFiles: u,
366
+ files: L,
367
+ onFilesChange: D,
368
+ onFileSelect: m,
369
+ onFileRemove: Z,
370
+ onUpload: G,
371
+ disabled: d = !1,
372
+ helperText: W,
373
+ error: ee,
374
+ showFileList: N = !0,
375
+ size: g = "medium",
376
+ sx: s
246
377
  }) => {
247
- const [d, j] = ie([]), [E, w] = ie(!1), [H, x] = ie(null), y = Ie(null), k = C ?? d, F = K((n) => {
248
- typeof n == "function" ? I ? I(n(C ?? d)) : j(n) : I ? I(n) : j(n);
249
- }, [C, d, I]), re = (n) => v && n.size > v ? `File "${n.name}" exceeds maximum size of ${ke(v)}` : m && k.length >= m ? `Maximum ${m} files allowed` : null, N = K(
250
- async (n) => {
251
- const S = Array.from(n), B = [], Z = [];
252
- for (const z of S) {
253
- const r = re(z);
254
- if (r) {
255
- Z.push(r);
378
+ const [c, A] = de([]), [H, B] = de(!1), [_, I] = de(null), b = Re(null), z = L ?? c, T = Q((r) => {
379
+ typeof r == "function" ? D ? D(r(L ?? c)) : A(r) : D ? D(r) : A(r);
380
+ }, [L, c, D]), ie = (r) => v && r.size > v ? `File "${r.name}" exceeds maximum size of ${Ie(v)}` : u && z.length >= u ? `Maximum ${u} files allowed` : null, X = Q(
381
+ async (r) => {
382
+ const C = Array.from(r), P = [], q = [];
383
+ for (const F of C) {
384
+ const t = ie(F);
385
+ if (t) {
386
+ q.push(t);
256
387
  continue;
257
388
  }
258
- const t = {
259
- id: ut(),
260
- file: z,
261
- name: z.name,
262
- size: z.size,
263
- type: z.type,
389
+ const h = {
390
+ id: ft(),
391
+ file: F,
392
+ name: F.name,
393
+ size: F.size,
394
+ type: F.type,
264
395
  progress: 0,
265
396
  status: "pending",
266
- preview: z.type.startsWith("image/") ? URL.createObjectURL(z) : void 0
397
+ preview: F.type.startsWith("image/") ? URL.createObjectURL(F) : void 0
267
398
  };
268
- B.push(t);
399
+ P.push(h);
269
400
  }
270
- if (Z.length > 0 ? x(Z[0]) : x(null), B.length > 0) {
271
- const z = s ? [...k, ...B] : B;
272
- if (F(z), f?.(B.map((r) => r.file)), M)
273
- for (const r of B)
401
+ if (q.length > 0 ? I(q[0]) : I(null), P.length > 0) {
402
+ const F = a ? [...z, ...P] : P;
403
+ if (T(F), m?.(P.map((t) => t.file)), G)
404
+ for (const t of P)
274
405
  try {
275
- F(
276
- (o) => o.map(
277
- (i) => i.id === r.id ? { ...i, status: "uploading" } : i
406
+ T(
407
+ (R) => R.map(
408
+ (y) => y.id === t.id ? { ...y, status: "uploading" } : y
278
409
  )
279
410
  );
280
- const t = setInterval(() => {
281
- F(
282
- (o) => o.map(
283
- (i) => i.id === r.id && i.progress < 90 ? { ...i, progress: i.progress + 10 } : i
411
+ const h = setInterval(() => {
412
+ T(
413
+ (R) => R.map(
414
+ (y) => y.id === t.id && y.progress < 90 ? { ...y, progress: y.progress + 10 } : y
284
415
  )
285
416
  );
286
417
  }, 200);
287
- await M(r.file), clearInterval(t), F(
288
- (o) => o.map(
289
- (i) => i.id === r.id ? { ...i, status: "complete", progress: 100 } : i
418
+ await G(t.file), clearInterval(h), T(
419
+ (R) => R.map(
420
+ (y) => y.id === t.id ? { ...y, status: "complete", progress: 100 } : y
290
421
  )
291
422
  );
292
- } catch (t) {
293
- F(
294
- (o) => o.map(
295
- (i) => i.id === r.id ? {
296
- ...i,
423
+ } catch (h) {
424
+ T(
425
+ (R) => R.map(
426
+ (y) => y.id === t.id ? {
427
+ ...y,
297
428
  status: "error",
298
- error: t instanceof Error ? t.message : "Upload failed"
299
- } : i
429
+ error: h instanceof Error ? h.message : "Upload failed"
430
+ } : y
300
431
  )
301
432
  );
302
433
  }
303
434
  }
304
435
  },
305
- [k, F, v, m, s, f, M]
306
- ), ne = K((n) => {
307
- n.preventDefault(), n.stopPropagation(), u || w(!0);
308
- }, [u]), ee = K((n) => {
309
- n.preventDefault(), n.stopPropagation(), w(!1);
310
- }, []), R = K((n) => {
311
- n.preventDefault(), n.stopPropagation();
312
- }, []), D = K(
313
- (n) => {
314
- if (n.preventDefault(), n.stopPropagation(), w(!1), u) return;
315
- const S = n.dataTransfer.files;
316
- S.length > 0 && N(S);
436
+ [z, T, v, u, a, m, G]
437
+ ), te = Q((r) => {
438
+ r.preventDefault(), r.stopPropagation(), d || B(!0);
439
+ }, [d]), re = Q((r) => {
440
+ r.preventDefault(), r.stopPropagation(), B(!1);
441
+ }, []), $ = Q((r) => {
442
+ r.preventDefault(), r.stopPropagation();
443
+ }, []), le = Q(
444
+ (r) => {
445
+ if (r.preventDefault(), r.stopPropagation(), B(!1), d) return;
446
+ const C = r.dataTransfer.files;
447
+ C.length > 0 && X(C);
317
448
  },
318
- [u, N]
319
- ), P = K(
320
- (n) => {
321
- const S = n.target.files;
322
- S && S.length > 0 && N(S), y.current && (y.current.value = "");
449
+ [d, X]
450
+ ), U = Q(
451
+ (r) => {
452
+ const C = r.target.files;
453
+ C && C.length > 0 && X(C), b.current && (b.current.value = "");
323
454
  },
324
- [N]
325
- ), Y = K(
326
- (n) => {
327
- n.preview && URL.revokeObjectURL(n.preview);
328
- const S = k.filter((B) => B.id !== n.id);
329
- F(S), G?.(n);
455
+ [X]
456
+ ), w = Q(
457
+ (r) => {
458
+ r.preview && URL.revokeObjectURL(r.preview);
459
+ const C = z.filter((P) => P.id !== r.id);
460
+ T(C), Z?.(r);
330
461
  },
331
- [k, F, G]
332
- ), W = () => {
333
- y.current?.click();
334
- }, b = Q || H, _ = /* @__PURE__ */ e(
462
+ [z, T, Z]
463
+ ), J = () => {
464
+ b.current?.click();
465
+ }, M = ee || _, O = /* @__PURE__ */ e(
335
466
  "input",
336
467
  {
337
- ref: y,
468
+ ref: b,
338
469
  type: "file",
339
- accept: h,
340
- multiple: s,
341
- onChange: P,
470
+ accept: f,
471
+ multiple: a,
472
+ onChange: U,
342
473
  style: { display: "none" },
343
- disabled: u
474
+ disabled: d
344
475
  }
345
- ), $ = K(
346
- (n) => {
347
- (n.key === "Enter" || n.key === " ") && !u && (n.preventDefault(), W());
476
+ ), j = Q(
477
+ (r) => {
478
+ (r.key === "Enter" || r.key === " ") && !d && (r.preventDefault(), J());
348
479
  },
349
- [u]
480
+ [d]
350
481
  );
351
- return l === "dropzone" ? /* @__PURE__ */ L(J, { sx: c, children: [
352
- _,
353
- /* @__PURE__ */ L(
354
- oe,
482
+ return i === "dropzone" ? /* @__PURE__ */ k(E, { sx: s, children: [
483
+ O,
484
+ /* @__PURE__ */ k(
485
+ se,
355
486
  {
356
487
  role: "button",
357
- tabIndex: u ? -1 : 0,
358
- "aria-label": `Upload files${h ? `. Accepted formats: ${h}` : ""}. Drag and drop or press Enter to browse`,
359
- "aria-disabled": u,
360
- onDragEnter: ne,
361
- onDragLeave: ee,
362
- onDragOver: R,
363
- onDrop: D,
364
- onClick: W,
365
- onKeyDown: $,
488
+ tabIndex: d ? -1 : 0,
489
+ "aria-label": `Upload files${f ? `. Accepted formats: ${f}` : ""}. Drag and drop or press Enter to browse`,
490
+ "aria-disabled": d,
491
+ onDragEnter: te,
492
+ onDragLeave: re,
493
+ onDragOver: $,
494
+ onDrop: le,
495
+ onClick: J,
496
+ onKeyDown: j,
366
497
  sx: {
367
- p: p === "small" ? 3 : 4,
498
+ p: g === "small" ? 3 : 4,
368
499
  border: "2px dashed",
369
- borderColor: b ? "error.main" : E ? "primary.main" : "divider",
500
+ borderColor: M ? "error.main" : H ? "primary.main" : "divider",
370
501
  borderRadius: "12px",
371
- bgcolor: E ? "action.hover" : u ? "action.disabledBackground" : "background.paper",
502
+ bgcolor: H ? "action.hover" : d ? "action.disabledBackground" : "background.paper",
372
503
  textAlign: "center",
373
- cursor: u ? "not-allowed" : "pointer",
504
+ cursor: d ? "not-allowed" : "pointer",
374
505
  transition: "all 0.2s ease",
375
506
  "&:hover": {
376
- bgcolor: u ? void 0 : "action.hover",
377
- borderColor: u ? void 0 : "primary.main"
507
+ bgcolor: d ? void 0 : "action.hover",
508
+ borderColor: d ? void 0 : "primary.main"
378
509
  }
379
510
  },
380
511
  children: [
381
512
  /* @__PURE__ */ e(
382
- le,
513
+ me,
383
514
  {
384
515
  sx: {
385
- fontSize: p === "small" ? 40 : 56,
386
- color: E ? "primary.main" : "action.active",
516
+ fontSize: g === "small" ? 40 : 56,
517
+ color: H ? "primary.main" : "action.active",
387
518
  mb: 2
388
519
  }
389
520
  }
390
521
  ),
391
- /* @__PURE__ */ e(te, { variant: p === "small" ? "body1" : "h6", gutterBottom: !0, children: E ? "Drop files here" : "Drag & drop files here" }),
392
- /* @__PURE__ */ e(te, { variant: "body2", color: "text.secondary", gutterBottom: !0, children: "or click to browse" }),
393
- T && /* @__PURE__ */ e(te, { variant: "caption", color: "text.secondary", children: T })
522
+ /* @__PURE__ */ e(oe, { variant: g === "small" ? "body1" : "h6", gutterBottom: !0, children: H ? "Drop files here" : "Drag & drop files here" }),
523
+ /* @__PURE__ */ e(oe, { variant: "body2", color: "text.secondary", gutterBottom: !0, children: "or click to browse" }),
524
+ W && /* @__PURE__ */ e(oe, { variant: "caption", color: "text.secondary", children: W })
394
525
  ]
395
526
  }
396
527
  ),
397
- b && /* @__PURE__ */ e(ue, { severity: "error", sx: { mt: 2 }, children: b }),
398
- O && k.length > 0 && /* @__PURE__ */ e(pe, { files: k, onRemove: Y })
399
- ] }) : l === "button" ? /* @__PURE__ */ L(J, { sx: c, children: [
400
- _,
401
- /* @__PURE__ */ L(
402
- ae,
528
+ M && /* @__PURE__ */ e(Ce, { severity: "error", sx: { mt: 2 }, children: M }),
529
+ N && z.length > 0 && /* @__PURE__ */ e(ke, { files: z, onRemove: w })
530
+ ] }) : i === "button" ? /* @__PURE__ */ k(E, { sx: s, children: [
531
+ O,
532
+ /* @__PURE__ */ k(
533
+ ge,
403
534
  {
404
535
  variant: "contained",
405
- startIcon: /* @__PURE__ */ e(le, {}),
406
- onClick: W,
407
- disabled: u,
408
- size: p,
536
+ startIcon: /* @__PURE__ */ e(me, {}),
537
+ onClick: J,
538
+ disabled: d,
539
+ size: g,
409
540
  children: [
410
541
  "Upload ",
411
- s ? "Files" : "File"
542
+ a ? "Files" : "File"
412
543
  ]
413
544
  }
414
545
  ),
415
- b && /* @__PURE__ */ e(ue, { severity: "error", sx: { mt: 2 }, children: b }),
416
- O && k.length > 0 && /* @__PURE__ */ e(pe, { files: k, onRemove: Y })
417
- ] }) : /* @__PURE__ */ L(J, { sx: c, children: [
418
- _,
419
- /* @__PURE__ */ L(Be, { direction: "row", spacing: 1, alignItems: "center", flexWrap: "wrap", useFlexGap: !0, children: [
546
+ M && /* @__PURE__ */ e(Ce, { severity: "error", sx: { mt: 2 }, children: M }),
547
+ N && z.length > 0 && /* @__PURE__ */ e(ke, { files: z, onRemove: w })
548
+ ] }) : /* @__PURE__ */ k(E, { sx: s, children: [
549
+ O,
550
+ /* @__PURE__ */ k(Ee, { direction: "row", spacing: 1, alignItems: "center", flexWrap: "wrap", useFlexGap: !0, children: [
420
551
  /* @__PURE__ */ e(
421
- ae,
552
+ ge,
422
553
  {
423
554
  variant: "outlined",
424
555
  size: "small",
425
- startIcon: /* @__PURE__ */ e(le, {}),
426
- onClick: W,
427
- disabled: u,
556
+ startIcon: /* @__PURE__ */ e(me, {}),
557
+ onClick: J,
558
+ disabled: d,
428
559
  children: "Browse"
429
560
  }
430
561
  ),
431
- k.map((n) => /* @__PURE__ */ e(
432
- Ce,
562
+ z.map((r) => /* @__PURE__ */ e(
563
+ Se,
433
564
  {
434
- icon: n.status === "complete" ? /* @__PURE__ */ e(xe, {}) : be(n.type),
435
- label: n.name,
436
- onDelete: () => Y(n),
437
- color: n.status === "error" ? "error" : n.status === "complete" ? "success" : "default",
565
+ icon: r.status === "complete" ? /* @__PURE__ */ e(Le, {}) : ze(r.type),
566
+ label: r.name,
567
+ onDelete: () => w(r),
568
+ color: r.status === "error" ? "error" : r.status === "complete" ? "success" : "default",
438
569
  size: "small",
439
570
  sx: {
440
571
  maxWidth: 200,
@@ -444,32 +575,32 @@ const fe = () => `new-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
444
575
  }
445
576
  }
446
577
  },
447
- n.id
578
+ r.id
448
579
  ))
449
580
  ] }),
450
- b && /* @__PURE__ */ e(te, { variant: "caption", color: "error", sx: { mt: 0.5, display: "block" }, children: b })
581
+ M && /* @__PURE__ */ e(oe, { variant: "caption", color: "error", sx: { mt: 0.5, display: "block" }, children: M })
451
582
  ] });
452
- }, pe = ({ files: l, onRemove: h }) => /* @__PURE__ */ e(Re, { dense: !0, sx: { mt: 2 }, children: l.map((s) => /* @__PURE__ */ L(
453
- ye,
583
+ }, ke = ({ files: i, onRemove: f }) => /* @__PURE__ */ e(Ae, { dense: !0, sx: { mt: 2 }, children: i.map((a) => /* @__PURE__ */ k(
584
+ he,
454
585
  {
455
586
  sx: {
456
587
  bgcolor: "background.paper",
457
588
  borderRadius: "8px",
458
589
  mb: 1,
459
590
  border: "1px solid",
460
- borderColor: s.status === "error" ? "error.light" : "divider"
591
+ borderColor: a.status === "error" ? "error.light" : "divider"
461
592
  },
462
593
  children: [
463
- /* @__PURE__ */ e(se, { children: s.status === "complete" ? /* @__PURE__ */ e(xe, { color: "success" }) : s.status === "error" ? /* @__PURE__ */ e(it, { color: "error" }) : be(s.type) }),
594
+ /* @__PURE__ */ e(ae, { children: a.status === "complete" ? /* @__PURE__ */ e(Le, { color: "success" }) : a.status === "error" ? /* @__PURE__ */ e(ct, { color: "error" }) : ze(a.type) }),
464
595
  /* @__PURE__ */ e(
465
- ve,
596
+ pe,
466
597
  {
467
- primary: s.name,
468
- secondary: /* @__PURE__ */ L(J, { component: "span", children: [
469
- ke(s.size),
470
- s.error && /* @__PURE__ */ L(te, { component: "span", color: "error", sx: { ml: 1 }, children: [
598
+ primary: a.name,
599
+ secondary: /* @__PURE__ */ k(E, { component: "span", children: [
600
+ Ie(a.size),
601
+ a.error && /* @__PURE__ */ k(oe, { component: "span", color: "error", sx: { ml: 1 }, children: [
471
602
  "• ",
472
- s.error
603
+ a.error
473
604
  ] })
474
605
  ] }),
475
606
  sx: {
@@ -481,12 +612,12 @@ const fe = () => `new-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
481
612
  }
482
613
  }
483
614
  ),
484
- s.status === "uploading" && /* @__PURE__ */ e(J, { sx: { width: 100, mr: 2 }, children: /* @__PURE__ */ e(Te, { variant: "determinate", value: s.progress }) }),
485
- /* @__PURE__ */ e(Ee, { children: /* @__PURE__ */ e(V, { edge: "end", onClick: () => h(s), size: "small", children: /* @__PURE__ */ e(ot, { fontSize: "small" }) }) })
615
+ a.status === "uploading" && /* @__PURE__ */ e(E, { sx: { width: 100, mr: 2 }, children: /* @__PURE__ */ e(Ue, { variant: "determinate", value: a.progress }) }),
616
+ /* @__PURE__ */ e(Me, { children: /* @__PURE__ */ e(Y, { edge: "end", onClick: () => f(a), size: "small", children: /* @__PURE__ */ e(st, { fontSize: "small" }) }) })
486
617
  ]
487
618
  },
488
- s.id
489
- )) }), mt = [
619
+ a.id
620
+ )) }), gt = [
490
621
  "heading",
491
622
  "divider",
492
623
  "bold",
@@ -509,44 +640,44 @@ const fe = () => `new-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
509
640
  "clearFormat",
510
641
  "divider",
511
642
  "fullscreen"
512
- ], ht = ({
513
- items: l,
514
- formats: h,
515
- headingLevel: s,
643
+ ], yt = ({
644
+ items: i,
645
+ formats: f,
646
+ headingLevel: a,
516
647
  textAlign: v,
517
- onFormat: m,
518
- onHeadingChange: C,
519
- onAlignChange: I,
520
- onUndo: f,
521
- onRedo: G,
522
- onClearFormat: M,
523
- onLinkInsert: u,
524
- onImageInsert: T,
525
- onFullscreen: Q,
526
- isFullscreen: O,
527
- canUndo: p,
528
- canRedo: c,
529
- disabled: d
648
+ onFormat: u,
649
+ onHeadingChange: L,
650
+ onAlignChange: D,
651
+ onUndo: m,
652
+ onRedo: Z,
653
+ onClearFormat: G,
654
+ onLinkInsert: d,
655
+ onImageInsert: W,
656
+ onFullscreen: ee,
657
+ isFullscreen: N,
658
+ canUndo: g,
659
+ canRedo: s,
660
+ disabled: c
530
661
  }) => {
531
- const j = ce(), E = (w, H) => {
532
- switch (w) {
662
+ const A = ye(), H = (B, _) => {
663
+ switch (B) {
533
664
  case "divider":
534
665
  return /* @__PURE__ */ e(
535
- ge,
666
+ fe,
536
667
  {
537
668
  orientation: "vertical",
538
669
  flexItem: !0,
539
670
  sx: { mx: 0.5 }
540
671
  },
541
- `divider-${H}`
672
+ `divider-${_}`
542
673
  );
543
674
  case "heading":
544
- return /* @__PURE__ */ e(Ue, { size: "small", sx: { minWidth: 100, mr: 1 }, children: /* @__PURE__ */ L(
545
- Ae,
675
+ return /* @__PURE__ */ e(je, { size: "small", sx: { minWidth: 100, mr: 1 }, children: /* @__PURE__ */ k(
676
+ qe,
546
677
  {
547
- value: s,
548
- onChange: (x) => C(x.target.value),
549
- disabled: d,
678
+ value: a,
679
+ onChange: (I) => L(I.target.value),
680
+ disabled: c,
550
681
  sx: {
551
682
  "& .MuiSelect-select": {
552
683
  py: 0.5,
@@ -554,184 +685,184 @@ const fe = () => `new-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
554
685
  }
555
686
  },
556
687
  children: [
557
- /* @__PURE__ */ e(X, { value: "p", children: "Paragraph" }),
558
- /* @__PURE__ */ e(X, { value: "h1", children: "Heading 1" }),
559
- /* @__PURE__ */ e(X, { value: "h2", children: "Heading 2" }),
560
- /* @__PURE__ */ e(X, { value: "h3", children: "Heading 3" }),
561
- /* @__PURE__ */ e(X, { value: "h4", children: "Heading 4" }),
562
- /* @__PURE__ */ e(X, { value: "h5", children: "Heading 5" }),
563
- /* @__PURE__ */ e(X, { value: "h6", children: "Heading 6" })
688
+ /* @__PURE__ */ e(ne, { value: "p", children: "Paragraph" }),
689
+ /* @__PURE__ */ e(ne, { value: "h1", children: "Heading 1" }),
690
+ /* @__PURE__ */ e(ne, { value: "h2", children: "Heading 2" }),
691
+ /* @__PURE__ */ e(ne, { value: "h3", children: "Heading 3" }),
692
+ /* @__PURE__ */ e(ne, { value: "h4", children: "Heading 4" }),
693
+ /* @__PURE__ */ e(ne, { value: "h5", children: "Heading 5" }),
694
+ /* @__PURE__ */ e(ne, { value: "h6", children: "Heading 6" })
564
695
  ]
565
696
  }
566
697
  ) }, "heading");
567
698
  case "bold":
568
- return /* @__PURE__ */ e(g, { title: "Bold (Ctrl+B)", children: /* @__PURE__ */ e(
569
- q,
699
+ return /* @__PURE__ */ e(x, { title: "Bold (Ctrl+B)", children: /* @__PURE__ */ e(
700
+ V,
570
701
  {
571
702
  value: "bold",
572
- selected: h.has("bold"),
573
- onChange: () => m("bold"),
574
- disabled: d,
703
+ selected: f.has("bold"),
704
+ onChange: () => u("bold"),
705
+ disabled: c,
575
706
  size: "small",
576
- children: /* @__PURE__ */ e(rt, { fontSize: "small" })
707
+ children: /* @__PURE__ */ e(lt, { fontSize: "small" })
577
708
  }
578
709
  ) }, "bold");
579
710
  case "italic":
580
- return /* @__PURE__ */ e(g, { title: "Italic (Ctrl+I)", children: /* @__PURE__ */ e(
581
- q,
711
+ return /* @__PURE__ */ e(x, { title: "Italic (Ctrl+I)", children: /* @__PURE__ */ e(
712
+ V,
582
713
  {
583
714
  value: "italic",
584
- selected: h.has("italic"),
585
- onChange: () => m("italic"),
586
- disabled: d,
715
+ selected: f.has("italic"),
716
+ onChange: () => u("italic"),
717
+ disabled: c,
587
718
  size: "small",
588
- children: /* @__PURE__ */ e(tt, { fontSize: "small" })
719
+ children: /* @__PURE__ */ e(it, { fontSize: "small" })
589
720
  }
590
721
  ) }, "italic");
591
722
  case "underline":
592
- return /* @__PURE__ */ e(g, { title: "Underline (Ctrl+U)", children: /* @__PURE__ */ e(
593
- q,
723
+ return /* @__PURE__ */ e(x, { title: "Underline (Ctrl+U)", children: /* @__PURE__ */ e(
724
+ V,
594
725
  {
595
726
  value: "underline",
596
- selected: h.has("underline"),
597
- onChange: () => m("underline"),
598
- disabled: d,
727
+ selected: f.has("underline"),
728
+ onChange: () => u("underline"),
729
+ disabled: c,
599
730
  size: "small",
600
- children: /* @__PURE__ */ e(et, { fontSize: "small" })
731
+ children: /* @__PURE__ */ e(ot, { fontSize: "small" })
601
732
  }
602
733
  ) }, "underline");
603
734
  case "strike":
604
- return /* @__PURE__ */ e(g, { title: "Strikethrough", children: /* @__PURE__ */ e(
605
- q,
735
+ return /* @__PURE__ */ e(x, { title: "Strikethrough", children: /* @__PURE__ */ e(
736
+ V,
606
737
  {
607
738
  value: "strikeThrough",
608
- selected: h.has("strikeThrough"),
609
- onChange: () => m("strikeThrough"),
610
- disabled: d,
739
+ selected: f.has("strikeThrough"),
740
+ onChange: () => u("strikeThrough"),
741
+ disabled: c,
611
742
  size: "small",
612
- children: /* @__PURE__ */ e(Xe, { fontSize: "small" })
743
+ children: /* @__PURE__ */ e(nt, { fontSize: "small" })
613
744
  }
614
745
  ) }, "strike");
615
746
  case "bulletList":
616
- return /* @__PURE__ */ e(g, { title: "Bullet List", children: /* @__PURE__ */ e(
617
- q,
747
+ return /* @__PURE__ */ e(x, { title: "Bullet List", children: /* @__PURE__ */ e(
748
+ V,
618
749
  {
619
750
  value: "insertUnorderedList",
620
- selected: h.has("insertUnorderedList"),
621
- onChange: () => m("insertUnorderedList"),
622
- disabled: d,
751
+ selected: f.has("insertUnorderedList"),
752
+ onChange: () => u("insertUnorderedList"),
753
+ disabled: c,
623
754
  size: "small",
624
- children: /* @__PURE__ */ e(Ze, { fontSize: "small" })
755
+ children: /* @__PURE__ */ e(rt, { fontSize: "small" })
625
756
  }
626
757
  ) }, "bulletList");
627
758
  case "numberList":
628
- return /* @__PURE__ */ e(g, { title: "Numbered List", children: /* @__PURE__ */ e(
629
- q,
759
+ return /* @__PURE__ */ e(x, { title: "Numbered List", children: /* @__PURE__ */ e(
760
+ V,
630
761
  {
631
762
  value: "insertOrderedList",
632
- selected: h.has("insertOrderedList"),
633
- onChange: () => m("insertOrderedList"),
634
- disabled: d,
763
+ selected: f.has("insertOrderedList"),
764
+ onChange: () => u("insertOrderedList"),
765
+ disabled: c,
635
766
  size: "small",
636
- children: /* @__PURE__ */ e(Ye, { fontSize: "small" })
767
+ children: /* @__PURE__ */ e(tt, { fontSize: "small" })
637
768
  }
638
769
  ) }, "numberList");
639
770
  case "quote":
640
- return /* @__PURE__ */ e(g, { title: "Block Quote", children: /* @__PURE__ */ e(
641
- V,
771
+ return /* @__PURE__ */ e(x, { title: "Block Quote", children: /* @__PURE__ */ e(
772
+ Y,
642
773
  {
643
- onClick: () => m("formatBlock"),
644
- disabled: d,
774
+ onClick: () => u("formatBlock"),
775
+ disabled: c,
645
776
  size: "small",
646
- children: /* @__PURE__ */ e(Qe, { fontSize: "small" })
777
+ children: /* @__PURE__ */ e(et, { fontSize: "small" })
647
778
  }
648
779
  ) }, "quote");
649
780
  case "code":
650
- return /* @__PURE__ */ e(g, { title: "Code Block", children: /* @__PURE__ */ e(
651
- V,
781
+ return /* @__PURE__ */ e(x, { title: "Code Block", children: /* @__PURE__ */ e(
782
+ Y,
652
783
  {
653
- onClick: () => m("code"),
654
- disabled: d,
784
+ onClick: () => u("code"),
785
+ disabled: c,
655
786
  size: "small",
656
- children: /* @__PURE__ */ e(Je, { fontSize: "small" })
787
+ children: /* @__PURE__ */ e(Xe, { fontSize: "small" })
657
788
  }
658
789
  ) }, "code");
659
790
  case "link":
660
- return /* @__PURE__ */ e(g, { title: "Insert Link", children: /* @__PURE__ */ e(
661
- V,
791
+ return /* @__PURE__ */ e(x, { title: "Insert Link", children: /* @__PURE__ */ e(
792
+ Y,
662
793
  {
663
- onClick: u,
664
- disabled: d,
794
+ onClick: d,
795
+ disabled: c,
665
796
  size: "small",
666
- children: /* @__PURE__ */ e(_e, { fontSize: "small" })
797
+ children: /* @__PURE__ */ e(Ze, { fontSize: "small" })
667
798
  }
668
799
  ) }, "link");
669
800
  case "image":
670
- return /* @__PURE__ */ e(g, { title: "Insert Image", children: /* @__PURE__ */ e(
671
- V,
801
+ return /* @__PURE__ */ e(x, { title: "Insert Image", children: /* @__PURE__ */ e(
802
+ Y,
672
803
  {
673
- onClick: T,
674
- disabled: d,
804
+ onClick: W,
805
+ disabled: c,
675
806
  size: "small",
676
- children: /* @__PURE__ */ e(Ne, { fontSize: "small" })
807
+ children: /* @__PURE__ */ e(Ye, { fontSize: "small" })
677
808
  }
678
809
  ) }, "image");
679
810
  case "align":
680
- return /* @__PURE__ */ L(
681
- Pe,
811
+ return /* @__PURE__ */ k(
812
+ Oe,
682
813
  {
683
814
  value: v,
684
815
  exclusive: !0,
685
- onChange: (x, y) => y && I(y),
816
+ onChange: (I, b) => b && D(b),
686
817
  size: "small",
687
- disabled: d,
818
+ disabled: c,
688
819
  children: [
689
- /* @__PURE__ */ e(q, { value: "left", children: /* @__PURE__ */ e(g, { title: "Align Left", children: /* @__PURE__ */ e($e, { fontSize: "small" }) }) }),
690
- /* @__PURE__ */ e(q, { value: "center", children: /* @__PURE__ */ e(g, { title: "Align Center", children: /* @__PURE__ */ e(Ke, { fontSize: "small" }) }) }),
691
- /* @__PURE__ */ e(q, { value: "right", children: /* @__PURE__ */ e(g, { title: "Align Right", children: /* @__PURE__ */ e(Ve, { fontSize: "small" }) }) }),
692
- /* @__PURE__ */ e(q, { value: "justify", children: /* @__PURE__ */ e(g, { title: "Justify", children: /* @__PURE__ */ e(Ge, { fontSize: "small" }) }) })
820
+ /* @__PURE__ */ e(V, { value: "left", children: /* @__PURE__ */ e(x, { title: "Align Left", children: /* @__PURE__ */ e(Ne, { fontSize: "small" }) }) }),
821
+ /* @__PURE__ */ e(V, { value: "center", children: /* @__PURE__ */ e(x, { title: "Align Center", children: /* @__PURE__ */ e(_e, { fontSize: "small" }) }) }),
822
+ /* @__PURE__ */ e(V, { value: "right", children: /* @__PURE__ */ e(x, { title: "Align Right", children: /* @__PURE__ */ e(Je, { fontSize: "small" }) }) }),
823
+ /* @__PURE__ */ e(V, { value: "justify", children: /* @__PURE__ */ e(x, { title: "Justify", children: /* @__PURE__ */ e(Qe, { fontSize: "small" }) }) })
693
824
  ]
694
825
  },
695
826
  "align"
696
827
  );
697
828
  case "undo":
698
- return /* @__PURE__ */ e(g, { title: "Undo (Ctrl+Z)", children: /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
699
- V,
829
+ return /* @__PURE__ */ e(x, { title: "Undo (Ctrl+Z)", children: /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
830
+ Y,
700
831
  {
701
- onClick: f,
702
- disabled: d || !p,
832
+ onClick: m,
833
+ disabled: c || !g,
703
834
  size: "small",
704
- children: /* @__PURE__ */ e(We, { fontSize: "small" })
835
+ children: /* @__PURE__ */ e(Ge, { fontSize: "small" })
705
836
  }
706
837
  ) }) }, "undo");
707
838
  case "redo":
708
- return /* @__PURE__ */ e(g, { title: "Redo (Ctrl+Y)", children: /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
709
- V,
839
+ return /* @__PURE__ */ e(x, { title: "Redo (Ctrl+Y)", children: /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
840
+ Y,
710
841
  {
711
- onClick: G,
712
- disabled: d || !c,
842
+ onClick: Z,
843
+ disabled: c || !s,
713
844
  size: "small",
714
- children: /* @__PURE__ */ e(He, { fontSize: "small" })
845
+ children: /* @__PURE__ */ e(Ve, { fontSize: "small" })
715
846
  }
716
847
  ) }) }, "redo");
717
848
  case "clearFormat":
718
- return /* @__PURE__ */ e(g, { title: "Clear Formatting", children: /* @__PURE__ */ e(
719
- V,
849
+ return /* @__PURE__ */ e(x, { title: "Clear Formatting", children: /* @__PURE__ */ e(
850
+ Y,
720
851
  {
721
- onClick: M,
722
- disabled: d,
852
+ onClick: G,
853
+ disabled: c,
723
854
  size: "small",
724
- children: /* @__PURE__ */ e(je, { fontSize: "small" })
855
+ children: /* @__PURE__ */ e(Ke, { fontSize: "small" })
725
856
  }
726
857
  ) }, "clearFormat");
727
858
  case "fullscreen":
728
- return /* @__PURE__ */ e(g, { title: O ? "Exit Fullscreen" : "Fullscreen", children: /* @__PURE__ */ e(
729
- V,
859
+ return /* @__PURE__ */ e(x, { title: N ? "Exit Fullscreen" : "Fullscreen", children: /* @__PURE__ */ e(
860
+ Y,
730
861
  {
731
- onClick: Q,
732
- disabled: d,
862
+ onClick: ee,
863
+ disabled: c,
733
864
  size: "small",
734
- children: O ? /* @__PURE__ */ e(Me, { fontSize: "small" }) : /* @__PURE__ */ e(Oe, { fontSize: "small" })
865
+ children: N ? /* @__PURE__ */ e(He, { fontSize: "small" }) : /* @__PURE__ */ e($e, { fontSize: "small" })
735
866
  }
736
867
  ) }, "fullscreen");
737
868
  default:
@@ -739,7 +870,7 @@ const fe = () => `new-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
739
870
  }
740
871
  };
741
872
  return /* @__PURE__ */ e(
742
- J,
873
+ E,
743
874
  {
744
875
  sx: {
745
876
  display: "flex",
@@ -747,8 +878,8 @@ const fe = () => `new-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
747
878
  gap: 0.5,
748
879
  px: 1,
749
880
  py: 0.5,
750
- borderBottom: `1px solid ${j.palette.divider}`,
751
- backgroundColor: de(j.palette.background.default, 0.5),
881
+ borderBottom: `1px solid ${A.palette.divider}`,
882
+ backgroundColor: ce(A.palette.background.default, 0.5),
752
883
  flexWrap: "wrap",
753
884
  "& .MuiToggleButton-root": {
754
885
  border: "none",
@@ -759,154 +890,154 @@ const fe = () => `new-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
759
890
  p: 0.5
760
891
  }
761
892
  },
762
- children: l.map((w, H) => E(w, H))
893
+ children: i.map((B, _) => H(B, _))
763
894
  }
764
895
  );
765
- }, Dt = ({
766
- value: l = "",
767
- onChange: h,
768
- placeholder: s = "Start typing...",
896
+ }, Pt = ({
897
+ value: i = "",
898
+ onChange: f,
899
+ placeholder: a = "Start typing...",
769
900
  height: v = 300,
770
- minHeight: m = 150,
771
- maxHeight: C,
772
- readOnly: I = !1,
773
- disabled: f = !1,
774
- showToolbar: G = !0,
775
- toolbarItems: M = mt,
776
- onImageUpload: u,
777
- autoFocus: T = !1,
778
- className: Q,
779
- sx: O
901
+ minHeight: u = 150,
902
+ maxHeight: L,
903
+ readOnly: D = !1,
904
+ disabled: m = !1,
905
+ showToolbar: Z = !0,
906
+ toolbarItems: G = gt,
907
+ onImageUpload: d,
908
+ autoFocus: W = !1,
909
+ className: ee,
910
+ sx: N
780
911
  }) => {
781
- const p = ce(), c = a.useRef(null), [d, j] = a.useState(/* @__PURE__ */ new Set()), [E, w] = a.useState("p"), [H, x] = a.useState("left"), [y, k] = a.useState(!1), [F, re] = a.useState(!1), [N, ne] = a.useState(!1), ee = a.useRef(null);
782
- a.useEffect(() => {
783
- c.current && l !== c.current.innerHTML && (c.current.innerHTML = l);
784
- }, [l]), a.useEffect(() => {
785
- T && c.current && c.current.focus();
786
- }, [T]);
787
- const R = a.useCallback(() => {
788
- const r = /* @__PURE__ */ new Set();
789
- document.queryCommandState("bold") && r.add("bold"), document.queryCommandState("italic") && r.add("italic"), document.queryCommandState("underline") && r.add("underline"), document.queryCommandState("strikeThrough") && r.add("strikeThrough"), document.queryCommandState("insertUnorderedList") && r.add("insertUnorderedList"), document.queryCommandState("insertOrderedList") && r.add("insertOrderedList"), j(r);
790
- const t = document.queryCommandValue("formatBlock");
791
- t && ["h1", "h2", "h3", "h4", "h5", "h6", "p"].includes(t.toLowerCase()) && w(t.toLowerCase()), document.queryCommandState("justifyLeft") ? x("left") : document.queryCommandState("justifyCenter") ? x("center") : document.queryCommandState("justifyRight") ? x("right") : document.queryCommandState("justifyFull") && x("justify");
792
- }, []), D = a.useCallback(() => {
793
- c.current && (h?.(c.current.innerHTML), R());
794
- }, [h, R]), P = a.useCallback((r) => {
795
- r === "code" ? document.execCommand("formatBlock", !1, "pre") : r === "formatBlock" ? document.execCommand("formatBlock", !1, "blockquote") : document.execCommand(r, !1), R(), c.current?.focus();
796
- }, [R]), Y = a.useCallback((r) => {
797
- document.execCommand("formatBlock", !1, r), w(r), c.current?.focus();
798
- }, []), W = a.useCallback((r) => {
799
- const t = {
912
+ const g = ye(), s = l.useRef(null), [c, A] = l.useState(/* @__PURE__ */ new Set()), [H, B] = l.useState("p"), [_, I] = l.useState("left"), [b, z] = l.useState(!1), [T, ie] = l.useState(!1), [X, te] = l.useState(!1), re = l.useRef(null);
913
+ l.useEffect(() => {
914
+ s.current && i !== s.current.innerHTML && (s.current.innerHTML = i);
915
+ }, [i]), l.useEffect(() => {
916
+ W && s.current && s.current.focus();
917
+ }, [W]);
918
+ const $ = l.useCallback(() => {
919
+ const t = /* @__PURE__ */ new Set();
920
+ document.queryCommandState("bold") && t.add("bold"), document.queryCommandState("italic") && t.add("italic"), document.queryCommandState("underline") && t.add("underline"), document.queryCommandState("strikeThrough") && t.add("strikeThrough"), document.queryCommandState("insertUnorderedList") && t.add("insertUnorderedList"), document.queryCommandState("insertOrderedList") && t.add("insertOrderedList"), A(t);
921
+ const h = document.queryCommandValue("formatBlock");
922
+ h && ["h1", "h2", "h3", "h4", "h5", "h6", "p"].includes(h.toLowerCase()) && B(h.toLowerCase()), document.queryCommandState("justifyLeft") ? I("left") : document.queryCommandState("justifyCenter") ? I("center") : document.queryCommandState("justifyRight") ? I("right") : document.queryCommandState("justifyFull") && I("justify");
923
+ }, []), le = l.useCallback(() => {
924
+ s.current && (f?.(s.current.innerHTML), $());
925
+ }, [f, $]), U = l.useCallback((t) => {
926
+ t === "code" ? document.execCommand("formatBlock", !1, "pre") : t === "formatBlock" ? document.execCommand("formatBlock", !1, "blockquote") : document.execCommand(t, !1), $(), s.current?.focus();
927
+ }, [$]), w = l.useCallback((t) => {
928
+ document.execCommand("formatBlock", !1, t), B(t), s.current?.focus();
929
+ }, []), J = l.useCallback((t) => {
930
+ const h = {
800
931
  left: "justifyLeft",
801
932
  center: "justifyCenter",
802
933
  right: "justifyRight",
803
934
  justify: "justifyFull"
804
935
  };
805
- document.execCommand(t[r], !1), x(r), c.current?.focus();
806
- }, []), b = () => document.execCommand("undo"), _ = () => document.execCommand("redo"), $ = () => {
807
- document.execCommand("removeFormat"), R();
808
- }, n = a.useCallback(() => {
809
- const r = window.prompt("Enter URL:");
810
- r && document.execCommand("createLink", !1, r), c.current?.focus();
811
- }, []), S = a.useCallback(() => {
812
- ee.current?.click();
813
- }, []), B = a.useCallback(async (r) => {
814
- const t = r.target.files?.[0];
815
- if (!t) return;
816
- let o;
817
- u ? o = await u(t) : o = URL.createObjectURL(t), document.execCommand("insertImage", !1, o), r.target.value = "", c.current?.focus();
818
- }, [u]), Z = () => {
819
- k(!y);
820
- }, z = a.useCallback((r) => {
821
- if (r.ctrlKey || r.metaKey)
822
- switch (r.key.toLowerCase()) {
936
+ document.execCommand(h[t], !1), I(t), s.current?.focus();
937
+ }, []), M = () => document.execCommand("undo"), O = () => document.execCommand("redo"), j = () => {
938
+ document.execCommand("removeFormat"), $();
939
+ }, r = l.useCallback(() => {
940
+ const t = window.prompt("Enter URL:");
941
+ t && document.execCommand("createLink", !1, t), s.current?.focus();
942
+ }, []), C = l.useCallback(() => {
943
+ re.current?.click();
944
+ }, []), P = l.useCallback(async (t) => {
945
+ const h = t.target.files?.[0];
946
+ if (!h) return;
947
+ let R;
948
+ d ? R = await d(h) : R = URL.createObjectURL(h), document.execCommand("insertImage", !1, R), t.target.value = "", s.current?.focus();
949
+ }, [d]), q = () => {
950
+ z(!b);
951
+ }, F = l.useCallback((t) => {
952
+ if (t.ctrlKey || t.metaKey)
953
+ switch (t.key.toLowerCase()) {
823
954
  case "b":
824
- r.preventDefault(), P("bold");
955
+ t.preventDefault(), U("bold");
825
956
  break;
826
957
  case "i":
827
- r.preventDefault(), P("italic");
958
+ t.preventDefault(), U("italic");
828
959
  break;
829
960
  case "u":
830
- r.preventDefault(), P("underline");
961
+ t.preventDefault(), U("underline");
831
962
  break;
832
963
  case "z":
833
- r.shiftKey && (r.preventDefault(), _());
964
+ t.shiftKey && (t.preventDefault(), O());
834
965
  break;
835
966
  }
836
- }, [P]);
837
- return a.useEffect(() => {
838
- const r = () => {
839
- re(document.queryCommandEnabled("undo")), ne(document.queryCommandEnabled("redo"));
840
- }, t = c.current;
841
- if (t)
842
- return t.addEventListener("input", r), () => t.removeEventListener("input", r);
843
- }, []), /* @__PURE__ */ L(
844
- oe,
967
+ }, [U]);
968
+ return l.useEffect(() => {
969
+ const t = () => {
970
+ ie(document.queryCommandEnabled("undo")), te(document.queryCommandEnabled("redo"));
971
+ }, h = s.current;
972
+ if (h)
973
+ return h.addEventListener("input", t), () => h.removeEventListener("input", t);
974
+ }, []), /* @__PURE__ */ k(
975
+ se,
845
976
  {
846
- className: Q,
977
+ className: ee,
847
978
  variant: "outlined",
848
979
  sx: {
849
980
  display: "flex",
850
981
  flexDirection: "column",
851
982
  overflow: "hidden",
852
- ...y && {
983
+ ...b && {
853
984
  position: "fixed",
854
985
  top: 0,
855
986
  left: 0,
856
987
  right: 0,
857
988
  bottom: 0,
858
- zIndex: p.zIndex.modal,
989
+ zIndex: g.zIndex.modal,
859
990
  borderRadius: 0
860
991
  },
861
- ...O
992
+ ...N
862
993
  },
863
994
  children: [
864
- G && !I && /* @__PURE__ */ e(
865
- ht,
995
+ Z && !D && /* @__PURE__ */ e(
996
+ yt,
866
997
  {
867
- items: M,
868
- formats: d,
869
- headingLevel: E,
870
- textAlign: H,
871
- onFormat: P,
872
- onHeadingChange: Y,
873
- onAlignChange: W,
874
- onUndo: b,
875
- onRedo: _,
876
- onClearFormat: $,
877
- onLinkInsert: n,
878
- onImageInsert: S,
879
- onFullscreen: Z,
880
- isFullscreen: y,
881
- canUndo: F,
882
- canRedo: N,
883
- disabled: f
998
+ items: G,
999
+ formats: c,
1000
+ headingLevel: H,
1001
+ textAlign: _,
1002
+ onFormat: U,
1003
+ onHeadingChange: w,
1004
+ onAlignChange: J,
1005
+ onUndo: M,
1006
+ onRedo: O,
1007
+ onClearFormat: j,
1008
+ onLinkInsert: r,
1009
+ onImageInsert: C,
1010
+ onFullscreen: q,
1011
+ isFullscreen: b,
1012
+ canUndo: T,
1013
+ canRedo: X,
1014
+ disabled: m
884
1015
  }
885
1016
  ),
886
1017
  /* @__PURE__ */ e(
887
- J,
1018
+ E,
888
1019
  {
889
- ref: c,
890
- contentEditable: !I && !f,
891
- onInput: D,
892
- onKeyDown: z,
893
- onSelect: R,
1020
+ ref: s,
1021
+ contentEditable: !D && !m,
1022
+ onInput: le,
1023
+ onKeyDown: F,
1024
+ onSelect: $,
894
1025
  sx: {
895
1026
  flex: 1,
896
1027
  p: 2,
897
1028
  overflow: "auto",
898
1029
  outline: "none",
899
- height: y ? "auto" : v,
900
- minHeight: y ? "auto" : m,
901
- maxHeight: y ? "none" : C,
902
- fontFamily: p.typography.fontFamily,
903
- fontSize: p.typography.body1.fontSize,
1030
+ height: b ? "auto" : v,
1031
+ minHeight: b ? "auto" : u,
1032
+ maxHeight: b ? "none" : L,
1033
+ fontFamily: g.typography.fontFamily,
1034
+ fontSize: g.typography.body1.fontSize,
904
1035
  lineHeight: 1.6,
905
- color: f ? p.palette.text.disabled : p.palette.text.primary,
906
- cursor: f ? "not-allowed" : "text",
1036
+ color: m ? g.palette.text.disabled : g.palette.text.primary,
1037
+ cursor: m ? "not-allowed" : "text",
907
1038
  "&:empty::before": {
908
- content: `"${s}"`,
909
- color: p.palette.text.secondary,
1039
+ content: `"${a}"`,
1040
+ color: g.palette.text.secondary,
910
1041
  fontStyle: "italic"
911
1042
  },
912
1043
  "& h1, & h2, & h3, & h4, & h5, & h6": {
@@ -924,21 +1055,21 @@ const fe = () => `new-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
924
1055
  marginBottom: "1em"
925
1056
  },
926
1057
  "& blockquote": {
927
- borderLeft: `4px solid ${p.palette.divider}`,
1058
+ borderLeft: `4px solid ${g.palette.divider}`,
928
1059
  paddingLeft: 2,
929
1060
  marginLeft: 0,
930
- color: p.palette.text.secondary,
1061
+ color: g.palette.text.secondary,
931
1062
  fontStyle: "italic"
932
1063
  },
933
1064
  "& pre": {
934
- backgroundColor: de(p.palette.text.primary, 0.05),
1065
+ backgroundColor: ce(g.palette.text.primary, 0.05),
935
1066
  padding: 2,
936
1067
  borderRadius: 1,
937
1068
  fontFamily: "monospace",
938
1069
  overflow: "auto"
939
1070
  },
940
1071
  "& a": {
941
- color: p.palette.primary.main,
1072
+ color: g.palette.primary.main,
942
1073
  textDecoration: "underline"
943
1074
  },
944
1075
  "& img": {
@@ -953,10 +1084,10 @@ const fe = () => `new-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
953
1084
  /* @__PURE__ */ e(
954
1085
  "input",
955
1086
  {
956
- ref: ee,
1087
+ ref: re,
957
1088
  type: "file",
958
1089
  accept: "image/*",
959
- onChange: B,
1090
+ onChange: P,
960
1091
  style: { display: "none" }
961
1092
  }
962
1093
  )
@@ -965,7 +1096,7 @@ const fe = () => `new-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
965
1096
  );
966
1097
  };
967
1098
  export {
968
- wt as C,
969
- Ft as F,
970
- Dt as R
1099
+ Bt as C,
1100
+ Tt as F,
1101
+ Pt as R
971
1102
  };