@thebuoyant-tsdev/mui-ts-library 3.29.1 → 3.30.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.
- package/README.de.md +59 -1
- package/README.md +59 -1
- package/dist/components/chord-chart/ChordChart.js +112 -112
- package/dist/components/circle-packing-chart/CirclePackingChart.js +135 -135
- package/dist/components/color-picker/ColorPicker.js +217 -217
- package/dist/components/color-picker/PopoverColorPicker.js +7 -7
- package/dist/components/date-range-picker/DateRangePicker.js +9 -9
- package/dist/components/gantt-chart/GanttChart.js +18 -18
- package/dist/components/gantt-chart/GanttTaskDialog.js +43 -43
- package/dist/components/gantt-chart/GanttTaskPanel.js +128 -128
- package/dist/components/gantt-chart/GanttTimeline.js +16 -16
- package/dist/components/gantt-chart/GanttToolbar.js +24 -24
- package/dist/components/horizontal-tree-chart/HorizontalTreeChart.js +244 -244
- package/dist/components/json-editor/JsonEditor.js +9 -9
- package/dist/components/json-editor/JsonEditorContent.js +54 -54
- package/dist/components/json-editor/JsonEditorToolbar.js +12 -12
- package/dist/components/kanban-board/KanbanBoard.d.ts +2 -0
- package/dist/components/kanban-board/KanbanBoard.js +129 -0
- package/dist/components/kanban-board/KanbanBoard.types.d.ts +84 -0
- package/dist/components/kanban-board/KanbanBoard.types.js +19 -0
- package/dist/components/kanban-board/KanbanBoardCard.d.ts +13 -0
- package/dist/components/kanban-board/KanbanBoardCard.js +104 -0
- package/dist/components/kanban-board/KanbanBoardCardDialog.d.ts +23 -0
- package/dist/components/kanban-board/KanbanBoardCardDialog.js +120 -0
- package/dist/components/kanban-board/KanbanBoardColumn.d.ts +14 -0
- package/dist/components/kanban-board/KanbanBoardColumn.js +129 -0
- package/dist/components/kanban-board/kanbanBoardClasses.d.ts +47 -0
- package/dist/components/kanban-board/kanbanBoardClasses.js +18 -0
- package/dist/components/password-strength-meter/PasswordStrengthMeter.js +27 -27
- package/dist/components/radial-stacked-bar-chart/RadialStackedBarChart.js +48 -48
- package/dist/components/radial-tree-chart/RadialTreeChart.js +173 -173
- package/dist/components/rich-text-editor/RichTextEditor.js +32 -32
- package/dist/components/rich-text-editor/RichTextEditorColorPicker.js +20 -20
- package/dist/components/rich-text-editor/RichTextEditorEmojiPicker.js +12 -12
- package/dist/components/rich-text-editor/RichTextEditorImageDialog.js +11 -11
- package/dist/components/rich-text-editor/RichTextEditorLinkDialog.js +11 -11
- package/dist/components/rich-text-editor/RichTextEditorMarkdownDialog.js +14 -14
- package/dist/components/rich-text-editor/RichTextEditorMentionList.js +14 -14
- package/dist/components/rich-text-editor/RichTextEditorTableMenu.js +28 -28
- package/dist/components/rich-text-editor/RichTextEditorToolbar.js +35 -35
- package/dist/components/sql-editor/SqlEditor.js +24 -24
- package/dist/components/sql-editor/SqlEditorContent.js +16 -16
- package/dist/components/sql-editor/SqlEditorHistoryMenu.js +15 -15
- package/dist/components/sql-editor/SqlEditorToolbar.js +21 -21
- package/dist/components/sunburst-chart/SunburstChart.js +126 -126
- package/dist/components/tag-selection/TagSelection.js +18 -18
- package/dist/components/tag-selection/TagSelectionAutocomplete.js +120 -120
- package/dist/components/tag-selection/TagSelectionSelectedTags.js +10 -10
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +38 -35
- package/package.json +9 -2
|
@@ -2,22 +2,22 @@ import { normalizeSize as e } from "../shared/normalizeSize.js";
|
|
|
2
2
|
import { DEFAULT_RICH_TEXT_EDITOR_TOOLBAR_CONFIG as t, DEFAULT_RICH_TEXT_EDITOR_TRANSLATION as n } from "./RichTextEditor.types.js";
|
|
3
3
|
import { buildMentionSuggestion as r } from "./RichTextEditorMentionSuggestion.js";
|
|
4
4
|
import { RichTextEditorContent as ee } from "./RichTextEditorContent.js";
|
|
5
|
-
import { RichTextEditorToolbar as
|
|
6
|
-
import { RichTextEditorFooter as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { Fragment as
|
|
10
|
-
import { useEditor as
|
|
5
|
+
import { RichTextEditorToolbar as te } from "./RichTextEditorToolbar.js";
|
|
6
|
+
import { RichTextEditorFooter as i } from "./RichTextEditorFooter.js";
|
|
7
|
+
import { Box as a, Divider as ne, Paper as re } from "@mui/material";
|
|
8
|
+
import { useEffect as o, useMemo as ie, useRef as s, useState as c } from "react";
|
|
9
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
10
|
+
import { useEditor as f } from "@tiptap/react";
|
|
11
11
|
import { Mention as p } from "@tiptap/extension-mention";
|
|
12
|
-
import { StarterKit as
|
|
13
|
-
import { TextStyle as
|
|
14
|
-
import { Color as
|
|
15
|
-
import { Highlight as
|
|
16
|
-
import { Placeholder as
|
|
17
|
-
import { CharacterCount as
|
|
18
|
-
import { TableKit as
|
|
19
|
-
import { Image as
|
|
20
|
-
import { Markdown as
|
|
12
|
+
import { StarterKit as m } from "@tiptap/starter-kit";
|
|
13
|
+
import { TextStyle as h } from "@tiptap/extension-text-style";
|
|
14
|
+
import { Color as ae } from "@tiptap/extension-color";
|
|
15
|
+
import { Highlight as oe } from "@tiptap/extension-highlight";
|
|
16
|
+
import { Placeholder as se } from "@tiptap/extension-placeholder";
|
|
17
|
+
import { CharacterCount as g } from "@tiptap/extension-character-count";
|
|
18
|
+
import { TableKit as ce } from "@tiptap/extension-table";
|
|
19
|
+
import { Image as _ } from "@tiptap/extension-image";
|
|
20
|
+
import { Markdown as le } from "tiptap-markdown";
|
|
21
21
|
//#region src/components/rich-text-editor/RichTextEditor.tsx
|
|
22
22
|
function v({ defaultValue: v, disabled: y = !1, error: b = !1, height: ue, helperText: x, maxCharacters: S, mentionItems: C, mentionTriggerChar: w = "@", name: T, onMentionInserted: E, onMentionSearch: D, placeholder: de, readonly: O = !1, showCharacterCount: k = !1, showToolbar: A = !0, showWordCount: j = !1, toolbarConfig: M, translation: N, value: P, width: F, onBlur: I, onChange: L, onFocus: R, onMarkdownChange: z, onSave: B }) {
|
|
23
23
|
let V = {
|
|
@@ -38,7 +38,7 @@ function v({ defaultValue: v, disabled: y = !1, error: b = !1, height: ue, helpe
|
|
|
38
38
|
}, [W]), o(() => {
|
|
39
39
|
K.current = B;
|
|
40
40
|
}, [B]);
|
|
41
|
-
let Y = e(ue), me = e(F), X = Y === "auto", he = X ? void 0 : Y ?? 200, Z = C !== void 0 || D !== void 0, Q =
|
|
41
|
+
let Y = e(ue), me = e(F), X = Y === "auto", he = X ? void 0 : Y ?? 200, Z = C !== void 0 || D !== void 0, Q = ie(() => Z ? p.configure({
|
|
42
42
|
HTMLAttributes: { class: "rte-mention" },
|
|
43
43
|
renderHTML({ options: e, node: t }) {
|
|
44
44
|
return [
|
|
@@ -61,25 +61,25 @@ function v({ defaultValue: v, disabled: y = !1, error: b = !1, height: ue, helpe
|
|
|
61
61
|
Z,
|
|
62
62
|
w,
|
|
63
63
|
D
|
|
64
|
-
]), ge = S !== void 0 && S > 0 || k || j, $ =
|
|
64
|
+
]), ge = S !== void 0 && S > 0 || k || j, $ = f({
|
|
65
65
|
shouldRerenderOnTransaction: !0,
|
|
66
66
|
extensions: [
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
m.configure({ link: { openOnClick: !1 } }),
|
|
68
|
+
h,
|
|
69
|
+
ae,
|
|
70
|
+
oe.configure({ multicolor: !0 }),
|
|
71
|
+
le.configure({
|
|
72
72
|
transformPastedText: !0,
|
|
73
73
|
transformCopiedText: !1
|
|
74
74
|
}),
|
|
75
|
-
|
|
76
|
-
...H.showTableButton ? [
|
|
77
|
-
...H.showImageButton ? [
|
|
75
|
+
se.configure({ placeholder: de ?? "" }),
|
|
76
|
+
...H.showTableButton ? [ce] : [],
|
|
77
|
+
...H.showImageButton ? [_.configure({
|
|
78
78
|
inline: !1,
|
|
79
79
|
allowBase64: !0
|
|
80
80
|
})] : [],
|
|
81
81
|
...Q ? [Q] : [],
|
|
82
|
-
...ge ? S !== void 0 && S > 0 ? [
|
|
82
|
+
...ge ? S !== void 0 && S > 0 ? [g.configure({ limit: S })] : [g] : []
|
|
83
83
|
],
|
|
84
84
|
content: P ?? v ?? "",
|
|
85
85
|
editable: !y && !O,
|
|
@@ -116,7 +116,7 @@ function v({ defaultValue: v, disabled: y = !1, error: b = !1, height: ue, helpe
|
|
|
116
116
|
O
|
|
117
117
|
]);
|
|
118
118
|
let _e = $?.storage.characterCount?.characters?.() ?? 0, ve = $?.storage.characterCount?.words?.() ?? 0, ye = k || S !== void 0 && S > 0 || j || !!x;
|
|
119
|
-
return /* @__PURE__ */
|
|
119
|
+
return /* @__PURE__ */ d(a, {
|
|
120
120
|
sx: U ? {
|
|
121
121
|
position: "fixed",
|
|
122
122
|
top: 0,
|
|
@@ -137,7 +137,7 @@ function v({ defaultValue: v, disabled: y = !1, error: b = !1, height: ue, helpe
|
|
|
137
137
|
} : {}
|
|
138
138
|
},
|
|
139
139
|
children: [
|
|
140
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ d(re, {
|
|
141
141
|
variant: "outlined",
|
|
142
142
|
sx: {
|
|
143
143
|
display: "flex",
|
|
@@ -150,7 +150,7 @@ function v({ defaultValue: v, disabled: y = !1, error: b = !1, height: ue, helpe
|
|
|
150
150
|
borderWidth: 2
|
|
151
151
|
}
|
|
152
152
|
},
|
|
153
|
-
children: [A && !O && /* @__PURE__ */
|
|
153
|
+
children: [A && !O && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(te, {
|
|
154
154
|
editor: $,
|
|
155
155
|
toolbarConfig: H,
|
|
156
156
|
translation: V,
|
|
@@ -159,14 +159,14 @@ function v({ defaultValue: v, disabled: y = !1, error: b = !1, height: ue, helpe
|
|
|
159
159
|
onToggleFullscreen: () => fe((e) => !e),
|
|
160
160
|
pasteAsPlainText: W,
|
|
161
161
|
onTogglePasteAsPlainText: () => pe((e) => !e)
|
|
162
|
-
}), /* @__PURE__ */
|
|
162
|
+
}), /* @__PURE__ */ u(ne, {})] }), /* @__PURE__ */ u(ee, {
|
|
163
163
|
editor: $,
|
|
164
164
|
error: b,
|
|
165
165
|
disabled: y,
|
|
166
166
|
readonly: O
|
|
167
167
|
})]
|
|
168
168
|
}),
|
|
169
|
-
ye && /* @__PURE__ */
|
|
169
|
+
ye && /* @__PURE__ */ u(i, {
|
|
170
170
|
helperText: x,
|
|
171
171
|
error: b,
|
|
172
172
|
showCharacterCount: k || S !== void 0 && S > 0,
|
|
@@ -176,7 +176,7 @@ function v({ defaultValue: v, disabled: y = !1, error: b = !1, height: ue, helpe
|
|
|
176
176
|
wordCount: ve,
|
|
177
177
|
translation: V
|
|
178
178
|
}),
|
|
179
|
-
T && /* @__PURE__ */
|
|
179
|
+
T && /* @__PURE__ */ u("input", {
|
|
180
180
|
type: "hidden",
|
|
181
181
|
name: T,
|
|
182
182
|
value: $ ? $.getHTML() : ""
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Box as e, IconButton as t, Popover as n, Tooltip as r } from "@mui/material";
|
|
2
|
+
import { useRef as i } from "react";
|
|
3
3
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
4
4
|
import s from "@mui/icons-material/FormatColorReset";
|
|
5
5
|
//#region src/components/rich-text-editor/RichTextEditorColorPicker.tsx
|
|
@@ -42,23 +42,23 @@ var c = [
|
|
|
42
42
|
"#ffffff",
|
|
43
43
|
"#000000"
|
|
44
44
|
];
|
|
45
|
-
function u({ color:
|
|
46
|
-
return /* @__PURE__ */ a(
|
|
47
|
-
title:
|
|
45
|
+
function u({ color: t, active: n, onClick: i }) {
|
|
46
|
+
return /* @__PURE__ */ a(r, {
|
|
47
|
+
title: t,
|
|
48
48
|
placement: "top",
|
|
49
49
|
arrow: !0,
|
|
50
|
-
children: /* @__PURE__ */ a(
|
|
50
|
+
children: /* @__PURE__ */ a(e, {
|
|
51
51
|
component: "button",
|
|
52
52
|
type: "button",
|
|
53
|
-
onClick: () =>
|
|
54
|
-
"aria-label":
|
|
53
|
+
onClick: () => i(t),
|
|
54
|
+
"aria-label": t,
|
|
55
55
|
"aria-pressed": n,
|
|
56
56
|
sx: {
|
|
57
57
|
width: 22,
|
|
58
58
|
height: 22,
|
|
59
|
-
bgcolor:
|
|
59
|
+
bgcolor: t,
|
|
60
60
|
border: n ? "2px solid" : "1px solid",
|
|
61
|
-
borderColor: n ? "primary.main" :
|
|
61
|
+
borderColor: n ? "primary.main" : t === "#ffffff" || t === "#f5f5dc" ? "divider" : "transparent",
|
|
62
62
|
borderRadius: .5,
|
|
63
63
|
cursor: "pointer",
|
|
64
64
|
p: 0,
|
|
@@ -71,14 +71,14 @@ function u({ color: e, active: n, onClick: r }) {
|
|
|
71
71
|
zIndex: 1
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
|
-
children: n && /* @__PURE__ */ a(
|
|
74
|
+
children: n && /* @__PURE__ */ a(e, {
|
|
75
75
|
component: "span",
|
|
76
76
|
sx: {
|
|
77
77
|
width: 10,
|
|
78
78
|
height: 6,
|
|
79
79
|
borderLeft: "2px solid",
|
|
80
80
|
borderBottom: "2px solid",
|
|
81
|
-
borderColor:
|
|
81
|
+
borderColor: t === "#ffffff" || t === "#f5f5dc" || t === "#ffd700" || t === "#ffff00" || t === "#adff2f" || t === "#ffa500" || t === "#b7b7b7" || t === "#d2b48c" ? "#000" : "#fff",
|
|
82
82
|
transform: "rotate(-45deg) translateY(-1px)",
|
|
83
83
|
display: "block"
|
|
84
84
|
}
|
|
@@ -87,11 +87,11 @@ function u({ color: e, active: n, onClick: r }) {
|
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
89
|
function d({ anchorEl: d, open: f, onClose: p, mode: m, activeColor: h, onSelectColor: g, onRemoveColor: _, removeLabel: v }) {
|
|
90
|
-
let y =
|
|
90
|
+
let y = i(null), b = m === "highlight" ? l : c;
|
|
91
91
|
function x(e) {
|
|
92
92
|
g(e.target.value);
|
|
93
93
|
}
|
|
94
|
-
return /* @__PURE__ */ o(
|
|
94
|
+
return /* @__PURE__ */ o(n, {
|
|
95
95
|
open: f,
|
|
96
96
|
anchorEl: d,
|
|
97
97
|
onClose: p,
|
|
@@ -104,7 +104,7 @@ function d({ anchorEl: d, open: f, onClose: p, mode: m, activeColor: h, onSelect
|
|
|
104
104
|
horizontal: "left"
|
|
105
105
|
},
|
|
106
106
|
slotProps: { paper: { sx: { p: 1.5 } } },
|
|
107
|
-
children: [/* @__PURE__ */ a(
|
|
107
|
+
children: [/* @__PURE__ */ a(e, {
|
|
108
108
|
sx: {
|
|
109
109
|
display: "grid",
|
|
110
110
|
gridTemplateColumns: "repeat(6, 22px)",
|
|
@@ -118,17 +118,17 @@ function d({ anchorEl: d, open: f, onClose: p, mode: m, activeColor: h, onSelect
|
|
|
118
118
|
g(e), p();
|
|
119
119
|
}
|
|
120
120
|
}, e))
|
|
121
|
-
}), /* @__PURE__ */ o(
|
|
121
|
+
}), /* @__PURE__ */ o(e, {
|
|
122
122
|
sx: {
|
|
123
123
|
display: "flex",
|
|
124
124
|
alignItems: "center",
|
|
125
125
|
gap: .5
|
|
126
126
|
},
|
|
127
127
|
children: [
|
|
128
|
-
/* @__PURE__ */ a(
|
|
128
|
+
/* @__PURE__ */ a(r, {
|
|
129
129
|
title: "Custom color",
|
|
130
130
|
arrow: !0,
|
|
131
|
-
children: /* @__PURE__ */ a(
|
|
131
|
+
children: /* @__PURE__ */ a(e, {
|
|
132
132
|
component: "button",
|
|
133
133
|
type: "button",
|
|
134
134
|
onClick: () => y.current?.click(),
|
|
@@ -161,10 +161,10 @@ function d({ anchorEl: d, open: f, onClose: p, mode: m, activeColor: h, onSelect
|
|
|
161
161
|
position: "absolute"
|
|
162
162
|
}
|
|
163
163
|
}),
|
|
164
|
-
/* @__PURE__ */ a(
|
|
164
|
+
/* @__PURE__ */ a(r, {
|
|
165
165
|
title: v,
|
|
166
166
|
arrow: !0,
|
|
167
|
-
children: /* @__PURE__ */ a(
|
|
167
|
+
children: /* @__PURE__ */ a(t, {
|
|
168
168
|
size: "small",
|
|
169
169
|
onClick: () => {
|
|
170
170
|
_(), p();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { EMOJI_CATEGORIES as e } from "./util/emojis.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Box as t, InputAdornment as n, Popover as r, TextField as i, Typography as a } from "@mui/material";
|
|
3
|
+
import { useMemo as o, useState as s } from "react";
|
|
4
4
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
5
5
|
import u from "@mui/icons-material/Search";
|
|
6
6
|
//#region src/components/rich-text-editor/RichTextEditorEmojiPicker.tsx
|
|
7
7
|
function d({ anchorEl: d, open: f, onClose: p, onSelect: m, translation: h }) {
|
|
8
|
-
let [g, _] =
|
|
8
|
+
let [g, _] = s(""), v = o(() => {
|
|
9
9
|
let t = g.trim().toLowerCase();
|
|
10
10
|
return t ? e.map((e) => ({
|
|
11
11
|
...e,
|
|
@@ -18,7 +18,7 @@ function d({ anchorEl: d, open: f, onClose: p, onSelect: m, translation: h }) {
|
|
|
18
18
|
function b() {
|
|
19
19
|
p(), _("");
|
|
20
20
|
}
|
|
21
|
-
return /* @__PURE__ */ l(
|
|
21
|
+
return /* @__PURE__ */ l(r, {
|
|
22
22
|
open: f,
|
|
23
23
|
anchorEl: d,
|
|
24
24
|
onClose: b,
|
|
@@ -36,32 +36,32 @@ function d({ anchorEl: d, open: f, onClose: p, onSelect: m, translation: h }) {
|
|
|
36
36
|
display: "flex",
|
|
37
37
|
flexDirection: "column"
|
|
38
38
|
} } },
|
|
39
|
-
children: [/* @__PURE__ */ c(
|
|
39
|
+
children: [/* @__PURE__ */ c(t, {
|
|
40
40
|
sx: {
|
|
41
41
|
p: 1,
|
|
42
42
|
borderBottom: 1,
|
|
43
43
|
borderColor: "divider"
|
|
44
44
|
},
|
|
45
|
-
children: /* @__PURE__ */ c(
|
|
45
|
+
children: /* @__PURE__ */ c(i, {
|
|
46
46
|
autoFocus: !0,
|
|
47
47
|
fullWidth: !0,
|
|
48
48
|
size: "small",
|
|
49
49
|
placeholder: h.emojiSearchPlaceholder,
|
|
50
50
|
value: g,
|
|
51
51
|
onChange: (e) => _(e.target.value),
|
|
52
|
-
slotProps: { input: { startAdornment: /* @__PURE__ */ c(
|
|
52
|
+
slotProps: { input: { startAdornment: /* @__PURE__ */ c(n, {
|
|
53
53
|
position: "start",
|
|
54
54
|
children: /* @__PURE__ */ c(u, { fontSize: "small" })
|
|
55
55
|
}) } }
|
|
56
56
|
})
|
|
57
|
-
}), /* @__PURE__ */ l(
|
|
57
|
+
}), /* @__PURE__ */ l(t, {
|
|
58
58
|
sx: {
|
|
59
59
|
overflowY: "auto",
|
|
60
60
|
flex: 1,
|
|
61
61
|
px: 1,
|
|
62
62
|
pb: 1
|
|
63
63
|
},
|
|
64
|
-
children: [v.map((e) => /* @__PURE__ */ l(
|
|
64
|
+
children: [v.map((e) => /* @__PURE__ */ l(t, { children: [/* @__PURE__ */ c(a, {
|
|
65
65
|
variant: "caption",
|
|
66
66
|
sx: {
|
|
67
67
|
display: "block",
|
|
@@ -71,13 +71,13 @@ function d({ anchorEl: d, open: f, onClose: p, onSelect: m, translation: h }) {
|
|
|
71
71
|
px: .5
|
|
72
72
|
},
|
|
73
73
|
children: e.label
|
|
74
|
-
}), /* @__PURE__ */ c(
|
|
74
|
+
}), /* @__PURE__ */ c(t, {
|
|
75
75
|
sx: {
|
|
76
76
|
display: "flex",
|
|
77
77
|
flexWrap: "wrap",
|
|
78
78
|
gap: .25
|
|
79
79
|
},
|
|
80
|
-
children: e.emojis.map((e) => /* @__PURE__ */ c(
|
|
80
|
+
children: e.emojis.map((e) => /* @__PURE__ */ c(t, {
|
|
81
81
|
component: "button",
|
|
82
82
|
title: e.name,
|
|
83
83
|
"aria-label": e.name,
|
|
@@ -94,7 +94,7 @@ function d({ anchorEl: d, open: f, onClose: p, onSelect: m, translation: h }) {
|
|
|
94
94
|
},
|
|
95
95
|
children: e.emoji
|
|
96
96
|
}, e.emoji))
|
|
97
|
-
})] }, e.label)), v.length === 0 && /* @__PURE__ */ c(
|
|
97
|
+
})] }, e.label)), v.length === 0 && /* @__PURE__ */ c(a, {
|
|
98
98
|
variant: "body2",
|
|
99
99
|
color: "text.secondary",
|
|
100
100
|
sx: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Button as e, Dialog as t, DialogActions as n, DialogContent as r, DialogTitle as i, TextField as a } from "@mui/material";
|
|
2
|
+
import { useState as o } from "react";
|
|
3
3
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/rich-text-editor/RichTextEditorImageDialog.tsx
|
|
5
5
|
function l({ open: l, onClose: u, editor: d, translation: f }) {
|
|
6
|
-
let [p, m] =
|
|
6
|
+
let [p, m] = o(""), [h, g] = o("");
|
|
7
7
|
function _() {
|
|
8
8
|
let e = p.trim();
|
|
9
9
|
e && (d.chain().focus().setImage({
|
|
@@ -17,21 +17,21 @@ function l({ open: l, onClose: u, editor: d, translation: f }) {
|
|
|
17
17
|
function y(e) {
|
|
18
18
|
e.key === "Enter" && _();
|
|
19
19
|
}
|
|
20
|
-
return /* @__PURE__ */ c(
|
|
20
|
+
return /* @__PURE__ */ c(t, {
|
|
21
21
|
open: l,
|
|
22
22
|
onClose: v,
|
|
23
23
|
maxWidth: "sm",
|
|
24
24
|
fullWidth: !0,
|
|
25
25
|
children: [
|
|
26
|
-
/* @__PURE__ */ s(
|
|
27
|
-
/* @__PURE__ */ c(
|
|
26
|
+
/* @__PURE__ */ s(i, { children: f.imageDialogTitle }),
|
|
27
|
+
/* @__PURE__ */ c(r, {
|
|
28
28
|
sx: {
|
|
29
29
|
display: "flex",
|
|
30
30
|
flexDirection: "column",
|
|
31
31
|
gap: 2,
|
|
32
32
|
pt: "16px !important"
|
|
33
33
|
},
|
|
34
|
-
children: [/* @__PURE__ */ s(
|
|
34
|
+
children: [/* @__PURE__ */ s(a, {
|
|
35
35
|
autoFocus: !0,
|
|
36
36
|
fullWidth: !0,
|
|
37
37
|
label: f.imageDialogUrlLabel,
|
|
@@ -41,7 +41,7 @@ function l({ open: l, onClose: u, editor: d, translation: f }) {
|
|
|
41
41
|
variant: "outlined",
|
|
42
42
|
size: "small",
|
|
43
43
|
placeholder: "https://example.com/image.png"
|
|
44
|
-
}), /* @__PURE__ */ s(
|
|
44
|
+
}), /* @__PURE__ */ s(a, {
|
|
45
45
|
fullWidth: !0,
|
|
46
46
|
label: f.imageDialogAltLabel,
|
|
47
47
|
value: h,
|
|
@@ -51,16 +51,16 @@ function l({ open: l, onClose: u, editor: d, translation: f }) {
|
|
|
51
51
|
size: "small"
|
|
52
52
|
})]
|
|
53
53
|
}),
|
|
54
|
-
/* @__PURE__ */ c(
|
|
54
|
+
/* @__PURE__ */ c(n, {
|
|
55
55
|
sx: {
|
|
56
56
|
px: 3,
|
|
57
57
|
pb: 2,
|
|
58
58
|
gap: 1
|
|
59
59
|
},
|
|
60
|
-
children: [/* @__PURE__ */ s(
|
|
60
|
+
children: [/* @__PURE__ */ s(e, {
|
|
61
61
|
onClick: v,
|
|
62
62
|
children: f.imageDialogCancel
|
|
63
|
-
}), /* @__PURE__ */ s(
|
|
63
|
+
}), /* @__PURE__ */ s(e, {
|
|
64
64
|
onClick: _,
|
|
65
65
|
variant: "contained",
|
|
66
66
|
disabled: !p.trim(),
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Button as e, Dialog as t, DialogActions as n, DialogContent as r, DialogTitle as i, TextField as a } from "@mui/material";
|
|
2
|
+
import { useEffect as o, useState as s } from "react";
|
|
3
3
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/rich-text-editor/RichTextEditorLinkDialog.tsx
|
|
5
5
|
function u({ open: u, onClose: d, editor: f, translation: p }) {
|
|
6
|
-
let [m, h] =
|
|
7
|
-
|
|
6
|
+
let [m, h] = s("");
|
|
7
|
+
o(() => {
|
|
8
8
|
if (u) {
|
|
9
9
|
let e = f.getAttributes("link").href;
|
|
10
10
|
h(e ?? "");
|
|
@@ -20,14 +20,14 @@ function u({ open: u, onClose: d, editor: f, translation: p }) {
|
|
|
20
20
|
function y(e) {
|
|
21
21
|
e.key === "Enter" && _();
|
|
22
22
|
}
|
|
23
|
-
return /* @__PURE__ */ l(
|
|
23
|
+
return /* @__PURE__ */ l(t, {
|
|
24
24
|
open: u,
|
|
25
25
|
onClose: d,
|
|
26
26
|
maxWidth: "sm",
|
|
27
27
|
fullWidth: !0,
|
|
28
28
|
children: [
|
|
29
|
-
/* @__PURE__ */ c(
|
|
30
|
-
/* @__PURE__ */ c(
|
|
29
|
+
/* @__PURE__ */ c(i, { children: p.linkDialogTitle }),
|
|
30
|
+
/* @__PURE__ */ c(r, { children: /* @__PURE__ */ c(a, {
|
|
31
31
|
autoFocus: !0,
|
|
32
32
|
fullWidth: !0,
|
|
33
33
|
label: p.linkDialogUrlLabel,
|
|
@@ -39,24 +39,24 @@ function u({ open: u, onClose: d, editor: f, translation: p }) {
|
|
|
39
39
|
sx: { mt: 1 },
|
|
40
40
|
placeholder: "https://"
|
|
41
41
|
}) }),
|
|
42
|
-
/* @__PURE__ */ l(
|
|
42
|
+
/* @__PURE__ */ l(n, {
|
|
43
43
|
sx: {
|
|
44
44
|
px: 3,
|
|
45
45
|
pb: 2,
|
|
46
46
|
gap: 1
|
|
47
47
|
},
|
|
48
48
|
children: [
|
|
49
|
-
g && /* @__PURE__ */ c(
|
|
49
|
+
g && /* @__PURE__ */ c(e, {
|
|
50
50
|
onClick: v,
|
|
51
51
|
color: "error",
|
|
52
52
|
sx: { mr: "auto" },
|
|
53
53
|
children: p.linkDialogRemove
|
|
54
54
|
}),
|
|
55
|
-
/* @__PURE__ */ c(
|
|
55
|
+
/* @__PURE__ */ c(e, {
|
|
56
56
|
onClick: d,
|
|
57
57
|
children: p.linkDialogCancel
|
|
58
58
|
}),
|
|
59
|
-
/* @__PURE__ */ c(
|
|
59
|
+
/* @__PURE__ */ c(e, {
|
|
60
60
|
onClick: _,
|
|
61
61
|
variant: "contained",
|
|
62
62
|
children: p.linkDialogSave
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { useTimedFlag as e } from "../shared/useTimedFlag.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Box as t, Button as n, Dialog as r, DialogActions as i, DialogContent as a, DialogTitle as o, TextField as s, Typography as c } from "@mui/material";
|
|
3
|
+
import { useEffect as l, useState as u } from "react";
|
|
4
4
|
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
5
5
|
import p from "@mui/icons-material/ContentCopy";
|
|
6
6
|
import m from "@mui/icons-material/Check";
|
|
7
7
|
//#region src/components/rich-text-editor/RichTextEditorMarkdownDialog.tsx
|
|
8
8
|
function h({ open: h, onClose: g, editor: _, translation: v }) {
|
|
9
|
-
let [y, b] =
|
|
10
|
-
|
|
9
|
+
let [y, b] = u(""), [x, S] = e();
|
|
10
|
+
l(() => {
|
|
11
11
|
h && b(_.storage.markdown.getMarkdown());
|
|
12
12
|
}, [h, _]);
|
|
13
13
|
function C() {
|
|
@@ -18,25 +18,25 @@ function h({ open: h, onClose: g, editor: _, translation: v }) {
|
|
|
18
18
|
S();
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
return /* @__PURE__ */ f(
|
|
21
|
+
return /* @__PURE__ */ f(r, {
|
|
22
22
|
open: h,
|
|
23
23
|
onClose: g,
|
|
24
24
|
maxWidth: "sm",
|
|
25
25
|
fullWidth: !0,
|
|
26
26
|
children: [
|
|
27
|
-
/* @__PURE__ */ d(
|
|
28
|
-
/* @__PURE__ */ f(
|
|
27
|
+
/* @__PURE__ */ d(o, { children: v.markdownDialogTitle }),
|
|
28
|
+
/* @__PURE__ */ f(a, {
|
|
29
29
|
sx: {
|
|
30
30
|
display: "flex",
|
|
31
31
|
flexDirection: "column",
|
|
32
32
|
gap: 1.5,
|
|
33
33
|
pt: "16px !important"
|
|
34
34
|
},
|
|
35
|
-
children: [/* @__PURE__ */ d(
|
|
35
|
+
children: [/* @__PURE__ */ d(c, {
|
|
36
36
|
variant: "body2",
|
|
37
37
|
color: "text.secondary",
|
|
38
38
|
children: v.markdownDialogDescription
|
|
39
|
-
}), /* @__PURE__ */ d(
|
|
39
|
+
}), /* @__PURE__ */ d(s, {
|
|
40
40
|
autoFocus: !0,
|
|
41
41
|
fullWidth: !0,
|
|
42
42
|
multiline: !0,
|
|
@@ -53,16 +53,16 @@ function h({ open: h, onClose: g, editor: _, translation: v }) {
|
|
|
53
53
|
} } }
|
|
54
54
|
})]
|
|
55
55
|
}),
|
|
56
|
-
/* @__PURE__ */ f(
|
|
56
|
+
/* @__PURE__ */ f(i, {
|
|
57
57
|
sx: {
|
|
58
58
|
px: 3,
|
|
59
59
|
pb: 2,
|
|
60
60
|
gap: 1
|
|
61
61
|
},
|
|
62
62
|
children: [
|
|
63
|
-
/* @__PURE__ */ d(
|
|
63
|
+
/* @__PURE__ */ d(t, {
|
|
64
64
|
sx: { flex: 1 },
|
|
65
|
-
children: /* @__PURE__ */ d(
|
|
65
|
+
children: /* @__PURE__ */ d(n, {
|
|
66
66
|
onClick: w,
|
|
67
67
|
startIcon: x ? /* @__PURE__ */ d(m, {
|
|
68
68
|
fontSize: "small",
|
|
@@ -71,11 +71,11 @@ function h({ open: h, onClose: g, editor: _, translation: v }) {
|
|
|
71
71
|
children: x ? v.markdownDialogCopied : v.markdownDialogCopy
|
|
72
72
|
})
|
|
73
73
|
}),
|
|
74
|
-
/* @__PURE__ */ d(
|
|
74
|
+
/* @__PURE__ */ d(n, {
|
|
75
75
|
onClick: g,
|
|
76
76
|
children: v.markdownDialogCancel
|
|
77
77
|
}),
|
|
78
|
-
/* @__PURE__ */ d(
|
|
78
|
+
/* @__PURE__ */ d(n, {
|
|
79
79
|
onClick: C,
|
|
80
80
|
variant: "contained",
|
|
81
81
|
children: v.markdownDialogApply
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { List as e, ListItemButton as t, Paper as n, Popper as r, Typography as i } from "@mui/material";
|
|
2
|
+
import { forwardRef as a, useEffect as o, useImperativeHandle as s, useRef as c, useState as l } from "react";
|
|
3
3
|
import { jsx as u } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/rich-text-editor/RichTextEditorMentionList.tsx
|
|
5
|
-
var d =
|
|
6
|
-
let [h, g] =
|
|
7
|
-
|
|
5
|
+
var d = a(function({ items: a, noResultsLabel: d, clientRect: f, onSelect: p }, m) {
|
|
6
|
+
let [h, g] = l(0), [_, v] = l(a), y = c(null);
|
|
7
|
+
a !== _ && (v(a), g(0)), o(() => {
|
|
8
8
|
(y.current?.children[h])?.scrollIntoView({ block: "nearest" });
|
|
9
|
-
}, [h]),
|
|
10
|
-
return
|
|
9
|
+
}, [h]), s(m, () => ({ onKeyDown(e) {
|
|
10
|
+
return e.key === "ArrowUp" ? (g((e) => (e - 1 + a.length) % a.length), !0) : e.key === "ArrowDown" ? (g((e) => (e + 1) % a.length), !0) : e.key === "Enter" ? (a[h] && p(a[h]), !0) : !1;
|
|
11
11
|
} }));
|
|
12
12
|
let b = f ? { getBoundingClientRect: f } : null;
|
|
13
|
-
return /* @__PURE__ */ u(
|
|
13
|
+
return /* @__PURE__ */ u(r, {
|
|
14
14
|
open: !!b,
|
|
15
15
|
anchorEl: b,
|
|
16
16
|
placement: "bottom-start",
|
|
@@ -19,14 +19,14 @@ var d = e(function({ items: e, noResultsLabel: d, clientRect: f, onSelect: p },
|
|
|
19
19
|
options: { offset: [0, 4] }
|
|
20
20
|
}],
|
|
21
21
|
style: { zIndex: 1400 },
|
|
22
|
-
children: /* @__PURE__ */ u(
|
|
22
|
+
children: /* @__PURE__ */ u(n, {
|
|
23
23
|
elevation: 4,
|
|
24
24
|
sx: {
|
|
25
25
|
maxHeight: 240,
|
|
26
26
|
overflow: "auto",
|
|
27
27
|
minWidth: 180
|
|
28
28
|
},
|
|
29
|
-
children:
|
|
29
|
+
children: a.length === 0 ? /* @__PURE__ */ u(i, {
|
|
30
30
|
variant: "body2",
|
|
31
31
|
sx: {
|
|
32
32
|
px: 2,
|
|
@@ -34,16 +34,16 @@ var d = e(function({ items: e, noResultsLabel: d, clientRect: f, onSelect: p },
|
|
|
34
34
|
color: "text.secondary"
|
|
35
35
|
},
|
|
36
36
|
children: d
|
|
37
|
-
}) : /* @__PURE__ */ u(
|
|
37
|
+
}) : /* @__PURE__ */ u(e, {
|
|
38
38
|
ref: y,
|
|
39
39
|
dense: !0,
|
|
40
40
|
disablePadding: !0,
|
|
41
|
-
children:
|
|
42
|
-
selected:
|
|
41
|
+
children: a.map((e, n) => /* @__PURE__ */ u(t, {
|
|
42
|
+
selected: n === h,
|
|
43
43
|
onMouseDown: (t) => {
|
|
44
44
|
t.preventDefault(), p(e);
|
|
45
45
|
},
|
|
46
|
-
onMouseEnter: () => g(
|
|
46
|
+
onMouseEnter: () => g(n),
|
|
47
47
|
children: e.label
|
|
48
48
|
}, e.id))
|
|
49
49
|
})
|