@thebuoyant-tsdev/mui-ts-library 3.29.2 → 3.31.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 +49 -1
- package/README.md +49 -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 +132 -0
- package/dist/components/kanban-board/KanbanBoard.types.d.ts +93 -0
- package/dist/components/kanban-board/KanbanBoard.types.js +19 -0
- package/dist/components/kanban-board/KanbanBoardCard.d.ts +14 -0
- package/dist/components/kanban-board/KanbanBoardCard.js +118 -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 +15 -0
- package/dist/components/kanban-board/KanbanBoardColumn.js +132 -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
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Divider as e, IconButton as t, ListItemIcon as n, ListItemText as r, Menu as i, MenuItem as a, Tooltip as o } from "@mui/material";
|
|
2
|
+
import { useState as s } from "react";
|
|
3
3
|
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
4
4
|
import d from "@mui/icons-material/Delete";
|
|
5
5
|
import f from "@mui/icons-material/Add";
|
|
6
6
|
import p from "@mui/icons-material/TableChart";
|
|
7
7
|
//#region src/components/rich-text-editor/RichTextEditorTableMenu.tsx
|
|
8
8
|
function m({ editor: m, translation: h, disabled: g }) {
|
|
9
|
-
let [_, v] =
|
|
9
|
+
let [_, v] = s(null), y = g || !m, b = m?.isActive("table") ?? !1;
|
|
10
10
|
function x() {
|
|
11
11
|
v(null);
|
|
12
12
|
}
|
|
13
13
|
function S(e) {
|
|
14
14
|
e(), x();
|
|
15
15
|
}
|
|
16
|
-
return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(
|
|
16
|
+
return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(o, {
|
|
17
17
|
title: h.table,
|
|
18
18
|
arrow: !0,
|
|
19
|
-
children: /* @__PURE__ */ l("span", { children: /* @__PURE__ */ l(
|
|
19
|
+
children: /* @__PURE__ */ l("span", { children: /* @__PURE__ */ l(t, {
|
|
20
20
|
size: "small",
|
|
21
21
|
onMouseDown: (e) => e.preventDefault(),
|
|
22
22
|
onClick: (e) => v(e.currentTarget),
|
|
@@ -27,65 +27,65 @@ function m({ editor: m, translation: h, disabled: g }) {
|
|
|
27
27
|
"aria-pressed": b,
|
|
28
28
|
children: /* @__PURE__ */ l(p, { fontSize: "small" })
|
|
29
29
|
}) })
|
|
30
|
-
}), /* @__PURE__ */ u(
|
|
30
|
+
}), /* @__PURE__ */ u(i, {
|
|
31
31
|
anchorEl: _,
|
|
32
32
|
open: !!_,
|
|
33
33
|
onClose: x,
|
|
34
34
|
slotProps: { paper: { sx: { minWidth: 220 } } },
|
|
35
35
|
children: [
|
|
36
|
-
/* @__PURE__ */ u(
|
|
36
|
+
/* @__PURE__ */ u(a, {
|
|
37
37
|
onClick: () => S(() => m?.chain().focus().insertTable({
|
|
38
38
|
rows: 3,
|
|
39
39
|
cols: 3,
|
|
40
40
|
withHeaderRow: !0
|
|
41
41
|
}).run()),
|
|
42
|
-
children: [/* @__PURE__ */ l(
|
|
42
|
+
children: [/* @__PURE__ */ l(n, { children: /* @__PURE__ */ l(p, { fontSize: "small" }) }), /* @__PURE__ */ l(r, { children: h.insertTable })]
|
|
43
43
|
}),
|
|
44
|
-
b && /* @__PURE__ */ l(
|
|
45
|
-
b && /* @__PURE__ */ u(
|
|
44
|
+
b && /* @__PURE__ */ l(e, {}),
|
|
45
|
+
b && /* @__PURE__ */ u(a, {
|
|
46
46
|
onClick: () => S(() => m?.chain().focus().addRowBefore().run()),
|
|
47
|
-
children: [/* @__PURE__ */ l(
|
|
47
|
+
children: [/* @__PURE__ */ l(n, { children: /* @__PURE__ */ l(f, { fontSize: "small" }) }), /* @__PURE__ */ l(r, { children: h.addRowBefore })]
|
|
48
48
|
}),
|
|
49
|
-
b && /* @__PURE__ */ u(
|
|
49
|
+
b && /* @__PURE__ */ u(a, {
|
|
50
50
|
onClick: () => S(() => m?.chain().focus().addRowAfter().run()),
|
|
51
|
-
children: [/* @__PURE__ */ l(
|
|
51
|
+
children: [/* @__PURE__ */ l(n, { children: /* @__PURE__ */ l(f, { fontSize: "small" }) }), /* @__PURE__ */ l(r, { children: h.addRowAfter })]
|
|
52
52
|
}),
|
|
53
|
-
b && /* @__PURE__ */ u(
|
|
53
|
+
b && /* @__PURE__ */ u(a, {
|
|
54
54
|
onClick: () => S(() => m?.chain().focus().deleteRow().run()),
|
|
55
|
-
children: [/* @__PURE__ */ l(
|
|
55
|
+
children: [/* @__PURE__ */ l(n, { children: /* @__PURE__ */ l(d, {
|
|
56
56
|
fontSize: "small",
|
|
57
57
|
color: "error"
|
|
58
|
-
}) }), /* @__PURE__ */ l(
|
|
58
|
+
}) }), /* @__PURE__ */ l(r, {
|
|
59
59
|
sx: { color: "error.main" },
|
|
60
60
|
children: h.deleteRow
|
|
61
61
|
})]
|
|
62
62
|
}),
|
|
63
|
-
b && /* @__PURE__ */ l(
|
|
64
|
-
b && /* @__PURE__ */ u(
|
|
63
|
+
b && /* @__PURE__ */ l(e, {}),
|
|
64
|
+
b && /* @__PURE__ */ u(a, {
|
|
65
65
|
onClick: () => S(() => m?.chain().focus().addColumnBefore().run()),
|
|
66
|
-
children: [/* @__PURE__ */ l(
|
|
66
|
+
children: [/* @__PURE__ */ l(n, { children: /* @__PURE__ */ l(f, { fontSize: "small" }) }), /* @__PURE__ */ l(r, { children: h.addColumnBefore })]
|
|
67
67
|
}),
|
|
68
|
-
b && /* @__PURE__ */ u(
|
|
68
|
+
b && /* @__PURE__ */ u(a, {
|
|
69
69
|
onClick: () => S(() => m?.chain().focus().addColumnAfter().run()),
|
|
70
|
-
children: [/* @__PURE__ */ l(
|
|
70
|
+
children: [/* @__PURE__ */ l(n, { children: /* @__PURE__ */ l(f, { fontSize: "small" }) }), /* @__PURE__ */ l(r, { children: h.addColumnAfter })]
|
|
71
71
|
}),
|
|
72
|
-
b && /* @__PURE__ */ u(
|
|
72
|
+
b && /* @__PURE__ */ u(a, {
|
|
73
73
|
onClick: () => S(() => m?.chain().focus().deleteColumn().run()),
|
|
74
|
-
children: [/* @__PURE__ */ l(
|
|
74
|
+
children: [/* @__PURE__ */ l(n, { children: /* @__PURE__ */ l(d, {
|
|
75
75
|
fontSize: "small",
|
|
76
76
|
color: "error"
|
|
77
|
-
}) }), /* @__PURE__ */ l(
|
|
77
|
+
}) }), /* @__PURE__ */ l(r, {
|
|
78
78
|
sx: { color: "error.main" },
|
|
79
79
|
children: h.deleteColumn
|
|
80
80
|
})]
|
|
81
81
|
}),
|
|
82
|
-
b && /* @__PURE__ */ l(
|
|
83
|
-
b && /* @__PURE__ */ u(
|
|
82
|
+
b && /* @__PURE__ */ l(e, {}),
|
|
83
|
+
b && /* @__PURE__ */ u(a, {
|
|
84
84
|
onClick: () => S(() => m?.chain().focus().deleteTable().run()),
|
|
85
|
-
children: [/* @__PURE__ */ l(
|
|
85
|
+
children: [/* @__PURE__ */ l(n, { children: /* @__PURE__ */ l(d, {
|
|
86
86
|
fontSize: "small",
|
|
87
87
|
color: "error"
|
|
88
|
-
}) }), /* @__PURE__ */ l(
|
|
88
|
+
}) }), /* @__PURE__ */ l(r, {
|
|
89
89
|
sx: { color: "error.main" },
|
|
90
90
|
children: h.deleteTable
|
|
91
91
|
})]
|
|
@@ -5,14 +5,14 @@ import { RichTextEditorTableMenu as r } from "./RichTextEditorTableMenu.js";
|
|
|
5
5
|
import { RichTextEditorImageDialog as i } from "./RichTextEditorImageDialog.js";
|
|
6
6
|
import { RichTextEditorEmojiPicker as a } from "./RichTextEditorEmojiPicker.js";
|
|
7
7
|
import { RichTextEditorMarkdownDialog as ee } from "./RichTextEditorMarkdownDialog.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { Box as o, Divider as te, IconButton as s, Tooltip as c } from "@mui/material";
|
|
9
|
+
import { useState as l } from "react";
|
|
10
10
|
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
11
11
|
import ne from "@mui/icons-material/Undo";
|
|
12
12
|
import re from "@mui/icons-material/Redo";
|
|
13
13
|
import ie from "@mui/icons-material/Fullscreen";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
14
|
+
import ae from "@mui/icons-material/FullscreenExit";
|
|
15
|
+
import p from "@mui/icons-material/Image";
|
|
16
16
|
import oe from "@mui/icons-material/EmojiEmotions";
|
|
17
17
|
import se from "@mui/icons-material/FormatBold";
|
|
18
18
|
import ce from "@mui/icons-material/FormatItalic";
|
|
@@ -22,19 +22,19 @@ import de from "@mui/icons-material/FormatListBulleted";
|
|
|
22
22
|
import m from "@mui/icons-material/FormatListNumbered";
|
|
23
23
|
import fe from "@mui/icons-material/FormatQuote";
|
|
24
24
|
import pe from "@mui/icons-material/Code";
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
25
|
+
import h from "@mui/icons-material/InsertLink";
|
|
26
|
+
import g from "@mui/icons-material/HorizontalRule";
|
|
27
|
+
import _ from "@mui/icons-material/FormatColorText";
|
|
28
|
+
import v from "@mui/icons-material/BorderColor";
|
|
29
|
+
import me from "@mui/icons-material/FormatClear";
|
|
30
30
|
import he from "@mui/icons-material/ContentPaste";
|
|
31
31
|
import ge from "@mui/icons-material/ContentPasteOff";
|
|
32
32
|
//#region src/components/rich-text-editor/RichTextEditorToolbar.tsx
|
|
33
33
|
function y({ label: e, icon: t, activeColor: n, disabled: r, onClick: i }) {
|
|
34
|
-
return /* @__PURE__ */ d(
|
|
34
|
+
return /* @__PURE__ */ d(c, {
|
|
35
35
|
title: e,
|
|
36
36
|
arrow: !0,
|
|
37
|
-
children: /* @__PURE__ */ d("span", { children: /* @__PURE__ */ f(
|
|
37
|
+
children: /* @__PURE__ */ d("span", { children: /* @__PURE__ */ f(s, {
|
|
38
38
|
size: "small",
|
|
39
39
|
onMouseDown: (e) => e.preventDefault(),
|
|
40
40
|
onClick: i,
|
|
@@ -46,13 +46,13 @@ function y({ label: e, icon: t, activeColor: n, disabled: r, onClick: i }) {
|
|
|
46
46
|
pb: .25
|
|
47
47
|
},
|
|
48
48
|
"aria-label": e,
|
|
49
|
-
children: [/* @__PURE__ */ d(
|
|
49
|
+
children: [/* @__PURE__ */ d(o, {
|
|
50
50
|
sx: {
|
|
51
51
|
display: "flex",
|
|
52
52
|
alignItems: "center"
|
|
53
53
|
},
|
|
54
54
|
children: t
|
|
55
|
-
}), /* @__PURE__ */ d(
|
|
55
|
+
}), /* @__PURE__ */ d(o, { sx: {
|
|
56
56
|
width: "80%",
|
|
57
57
|
height: 3,
|
|
58
58
|
bgcolor: n ?? "text.primary",
|
|
@@ -86,7 +86,7 @@ function x({ level: e }) {
|
|
|
86
86
|
return /* @__PURE__ */ d(b, { text: `H${e}` });
|
|
87
87
|
}
|
|
88
88
|
function S({ editor: S, toolbarConfig: C, translation: w, disabled: T, isFullscreen: E, onToggleFullscreen: D, pasteAsPlainText: O, onTogglePasteAsPlainText: k }) {
|
|
89
|
-
let [A, j] =
|
|
89
|
+
let [A, j] = l(!1), [M, N] = l(!1), [P, F] = l(!1), [I, L] = l(null), [R, z] = l(null), [B, V] = l(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 = [
|
|
90
90
|
G,
|
|
91
91
|
K,
|
|
92
92
|
q,
|
|
@@ -103,7 +103,7 @@ function S({ editor: S, toolbarConfig: C, translation: w, disabled: T, isFullscr
|
|
|
103
103
|
}, `div-${t}`);
|
|
104
104
|
}
|
|
105
105
|
return /* @__PURE__ */ f(u, { children: [
|
|
106
|
-
/* @__PURE__ */ f(
|
|
106
|
+
/* @__PURE__ */ f(o, {
|
|
107
107
|
sx: {
|
|
108
108
|
display: "flex",
|
|
109
109
|
flexWrap: "wrap",
|
|
@@ -115,7 +115,7 @@ function S({ editor: S, toolbarConfig: C, translation: w, disabled: T, isFullscr
|
|
|
115
115
|
role: "toolbar",
|
|
116
116
|
"aria-label": "Text formatting",
|
|
117
117
|
children: [
|
|
118
|
-
G && /* @__PURE__ */ f(
|
|
118
|
+
G && /* @__PURE__ */ f(o, {
|
|
119
119
|
sx: {
|
|
120
120
|
display: "flex",
|
|
121
121
|
gap: .25
|
|
@@ -152,7 +152,7 @@ function S({ editor: S, toolbarConfig: C, translation: w, disabled: T, isFullscr
|
|
|
152
152
|
]
|
|
153
153
|
}),
|
|
154
154
|
$(G, 0),
|
|
155
|
-
K && /* @__PURE__ */ f(
|
|
155
|
+
K && /* @__PURE__ */ f(o, {
|
|
156
156
|
sx: {
|
|
157
157
|
display: "flex",
|
|
158
158
|
gap: .25
|
|
@@ -182,7 +182,7 @@ function S({ editor: S, toolbarConfig: C, translation: w, disabled: T, isFullscr
|
|
|
182
182
|
]
|
|
183
183
|
}),
|
|
184
184
|
$(K, 1),
|
|
185
|
-
q && /* @__PURE__ */ f(
|
|
185
|
+
q && /* @__PURE__ */ f(o, {
|
|
186
186
|
sx: {
|
|
187
187
|
display: "flex",
|
|
188
188
|
gap: .25
|
|
@@ -202,7 +202,7 @@ function S({ editor: S, toolbarConfig: C, translation: w, disabled: T, isFullscr
|
|
|
202
202
|
})]
|
|
203
203
|
}),
|
|
204
204
|
$(q, 2),
|
|
205
|
-
J && /* @__PURE__ */ f(
|
|
205
|
+
J && /* @__PURE__ */ f(o, {
|
|
206
206
|
sx: {
|
|
207
207
|
display: "flex",
|
|
208
208
|
gap: .25
|
|
@@ -224,41 +224,41 @@ function S({ editor: S, toolbarConfig: C, translation: w, disabled: T, isFullscr
|
|
|
224
224
|
}),
|
|
225
225
|
C.showLink && /* @__PURE__ */ d(e, {
|
|
226
226
|
label: w.link,
|
|
227
|
-
icon: /* @__PURE__ */ d(
|
|
227
|
+
icon: /* @__PURE__ */ d(h, { fontSize: "small" }),
|
|
228
228
|
onClick: () => j(!0),
|
|
229
229
|
active: S?.isActive("link"),
|
|
230
230
|
disabled: H
|
|
231
231
|
}),
|
|
232
232
|
C.showHorizontalRule && /* @__PURE__ */ d(e, {
|
|
233
233
|
label: w.horizontalRule,
|
|
234
|
-
icon: /* @__PURE__ */ d(
|
|
234
|
+
icon: /* @__PURE__ */ d(g, { fontSize: "small" }),
|
|
235
235
|
onClick: () => S?.chain().focus().setHorizontalRule().run(),
|
|
236
236
|
disabled: H
|
|
237
237
|
})
|
|
238
238
|
]
|
|
239
239
|
}),
|
|
240
240
|
$(J, 3),
|
|
241
|
-
Y && /* @__PURE__ */ f(
|
|
241
|
+
Y && /* @__PURE__ */ f(o, {
|
|
242
242
|
sx: {
|
|
243
243
|
display: "flex",
|
|
244
244
|
gap: .25
|
|
245
245
|
},
|
|
246
246
|
children: [C.showTextColor && /* @__PURE__ */ d(y, {
|
|
247
247
|
label: w.textColor,
|
|
248
|
-
icon: /* @__PURE__ */ d(
|
|
248
|
+
icon: /* @__PURE__ */ d(_, { fontSize: "small" }),
|
|
249
249
|
activeColor: U,
|
|
250
250
|
disabled: H,
|
|
251
251
|
onClick: (e) => z(e.currentTarget)
|
|
252
252
|
}), C.showHighlight && /* @__PURE__ */ d(y, {
|
|
253
253
|
label: w.highlight,
|
|
254
|
-
icon: /* @__PURE__ */ d(
|
|
254
|
+
icon: /* @__PURE__ */ d(v, { fontSize: "small" }),
|
|
255
255
|
activeColor: W,
|
|
256
256
|
disabled: H,
|
|
257
257
|
onClick: (e) => V(e.currentTarget)
|
|
258
258
|
})]
|
|
259
259
|
}),
|
|
260
260
|
$(Y, 4),
|
|
261
|
-
X && /* @__PURE__ */ f(
|
|
261
|
+
X && /* @__PURE__ */ f(o, {
|
|
262
262
|
sx: {
|
|
263
263
|
display: "flex",
|
|
264
264
|
gap: .25
|
|
@@ -275,13 +275,13 @@ function S({ editor: S, toolbarConfig: C, translation: w, disabled: T, isFullscr
|
|
|
275
275
|
disabled: H || !S?.can().redo()
|
|
276
276
|
})] }), C.showClearFormat && /* @__PURE__ */ d(e, {
|
|
277
277
|
label: w.clearFormat,
|
|
278
|
-
icon: /* @__PURE__ */ d(
|
|
278
|
+
icon: /* @__PURE__ */ d(me, { fontSize: "small" }),
|
|
279
279
|
onClick: () => S?.chain().focus().clearNodes().unsetAllMarks().run(),
|
|
280
280
|
disabled: H
|
|
281
281
|
})]
|
|
282
282
|
}),
|
|
283
283
|
$(X, 5),
|
|
284
|
-
Z && /* @__PURE__ */ f(
|
|
284
|
+
Z && /* @__PURE__ */ f(o, {
|
|
285
285
|
sx: {
|
|
286
286
|
display: "flex",
|
|
287
287
|
gap: .25
|
|
@@ -294,14 +294,14 @@ function S({ editor: S, toolbarConfig: C, translation: w, disabled: T, isFullscr
|
|
|
294
294
|
}),
|
|
295
295
|
C.showImageButton && /* @__PURE__ */ d(e, {
|
|
296
296
|
label: w.image,
|
|
297
|
-
icon: /* @__PURE__ */ d(
|
|
297
|
+
icon: /* @__PURE__ */ d(p, { fontSize: "small" }),
|
|
298
298
|
onClick: () => N(!0),
|
|
299
299
|
disabled: H
|
|
300
300
|
}),
|
|
301
|
-
C.showEmojiButton && /* @__PURE__ */ d(
|
|
301
|
+
C.showEmojiButton && /* @__PURE__ */ d(c, {
|
|
302
302
|
title: w.emoji,
|
|
303
303
|
arrow: !0,
|
|
304
|
-
children: /* @__PURE__ */ d("span", { children: /* @__PURE__ */ d(
|
|
304
|
+
children: /* @__PURE__ */ d("span", { children: /* @__PURE__ */ d(s, {
|
|
305
305
|
size: "small",
|
|
306
306
|
onMouseDown: (e) => e.preventDefault(),
|
|
307
307
|
onClick: (e) => L(e.currentTarget),
|
|
@@ -313,8 +313,8 @@ function S({ editor: S, toolbarConfig: C, translation: w, disabled: T, isFullscr
|
|
|
313
313
|
})
|
|
314
314
|
]
|
|
315
315
|
}),
|
|
316
|
-
_e === 0 && /* @__PURE__ */ d(
|
|
317
|
-
(C.showPasteAsPlainTextButton || C.showMarkdownButton || C.showFullscreenButton) && /* @__PURE__ */ f(
|
|
316
|
+
_e === 0 && /* @__PURE__ */ d(o, { sx: { height: 32 } }),
|
|
317
|
+
(C.showPasteAsPlainTextButton || C.showMarkdownButton || C.showFullscreenButton) && /* @__PURE__ */ f(o, {
|
|
318
318
|
sx: {
|
|
319
319
|
ml: "auto",
|
|
320
320
|
display: "flex",
|
|
@@ -334,17 +334,17 @@ function S({ editor: S, toolbarConfig: C, translation: w, disabled: T, isFullscr
|
|
|
334
334
|
onClick: () => F(!0),
|
|
335
335
|
disabled: T || !S
|
|
336
336
|
}),
|
|
337
|
-
C.showFullscreenButton && /* @__PURE__ */ d(
|
|
337
|
+
C.showFullscreenButton && /* @__PURE__ */ d(c, {
|
|
338
338
|
title: E ? w.exitFullscreen : w.fullscreen,
|
|
339
339
|
arrow: !0,
|
|
340
|
-
children: /* @__PURE__ */ d("span", { children: /* @__PURE__ */ d(
|
|
340
|
+
children: /* @__PURE__ */ d("span", { children: /* @__PURE__ */ d(s, {
|
|
341
341
|
size: "small",
|
|
342
342
|
onMouseDown: (e) => e.preventDefault(),
|
|
343
343
|
onClick: D,
|
|
344
344
|
disabled: T || !S,
|
|
345
345
|
sx: { borderRadius: 1 },
|
|
346
346
|
"aria-label": E ? w.exitFullscreen : w.fullscreen,
|
|
347
|
-
children: d(E ?
|
|
347
|
+
children: d(E ? ae : ie, { fontSize: "small" })
|
|
348
348
|
}) })
|
|
349
349
|
})
|
|
350
350
|
]
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { normalizeSize as e } from "../shared/normalizeSize.js";
|
|
2
2
|
import { DEFAULT_SQL_EDITOR_TOOLBAR_CONFIG as t, DEFAULT_SQL_EDITOR_TRANSLATION as n } from "./SqlEditor.types.js";
|
|
3
|
-
import { SqlEditorContent as
|
|
4
|
-
import { SqlEditorToolbar as
|
|
5
|
-
import { SqlEditorFooter as
|
|
3
|
+
import { SqlEditorContent as ee } from "./SqlEditorContent.js";
|
|
4
|
+
import { SqlEditorToolbar as r } from "./SqlEditorToolbar.js";
|
|
5
|
+
import { SqlEditorFooter as i } from "./SqlEditorFooter.js";
|
|
6
6
|
import { useSqlQueryHistory as a } from "./useSqlQueryHistory.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { Fragment as
|
|
10
|
-
import { format as
|
|
7
|
+
import { Box as o, Divider as s, Paper as c } from "@mui/material";
|
|
8
|
+
import { useCallback as l, useMemo as te, useRef as ne, useState as u } from "react";
|
|
9
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
10
|
+
import { format as m } from "sql-formatter";
|
|
11
11
|
//#region src/components/sql-editor/SqlEditor.tsx
|
|
12
|
-
var
|
|
12
|
+
var h = {
|
|
13
13
|
standard: "sql",
|
|
14
14
|
mysql: "mysql",
|
|
15
15
|
postgresql: "postgresql",
|
|
@@ -23,27 +23,27 @@ function g({ value: g, onChange: _, placeholder: re, height: v, width: y, disabl
|
|
|
23
23
|
}, B = {
|
|
24
24
|
...t,
|
|
25
25
|
...k
|
|
26
|
-
}, { history: V, addEntry: H, clearHistory: U } = a(N, P), W = e(v), G = e(y), K = W === "auto", q = K ? void 0 : W ?? 300, J =
|
|
26
|
+
}, { history: V, addEntry: H, clearHistory: U } = a(N, P), W = e(v), G = e(y), K = W === "auto", q = K ? void 0 : W ?? 300, J = ne(null), [Y, X] = u(null), [Z, ie] = u({
|
|
27
27
|
line: 1,
|
|
28
28
|
col: 1
|
|
29
|
-
}), [ae,
|
|
29
|
+
}), [ae, oe] = u(0), se = l((e) => {
|
|
30
30
|
J.current = e, X(e);
|
|
31
|
-
}, []),
|
|
31
|
+
}, []), Q = l((e, t) => {
|
|
32
32
|
ie({
|
|
33
33
|
line: e,
|
|
34
34
|
col: t
|
|
35
35
|
});
|
|
36
|
-
}, []), ce =
|
|
37
|
-
|
|
36
|
+
}, []), ce = l((e) => {
|
|
37
|
+
oe(e);
|
|
38
38
|
}, []), $ = F ? (e) => {
|
|
39
39
|
H(e), F(e);
|
|
40
|
-
} : void 0, le =
|
|
40
|
+
} : void 0, le = te(() => {
|
|
41
41
|
if (!(x || !B.showFormat)) return () => {
|
|
42
42
|
let e = J.current;
|
|
43
43
|
if (!e) return;
|
|
44
44
|
let t = e.state.doc.toString();
|
|
45
45
|
try {
|
|
46
|
-
let n =
|
|
46
|
+
let n = m(t, { language: h[T] });
|
|
47
47
|
e.dispatch({ changes: {
|
|
48
48
|
from: 0,
|
|
49
49
|
to: e.state.doc.length,
|
|
@@ -56,7 +56,7 @@ function g({ value: g, onChange: _, placeholder: re, height: v, width: y, disabl
|
|
|
56
56
|
T,
|
|
57
57
|
x,
|
|
58
58
|
B.showFormat
|
|
59
|
-
]), ue =
|
|
59
|
+
]), ue = l((e) => {
|
|
60
60
|
let t = J.current;
|
|
61
61
|
t && (t.dispatch({ changes: {
|
|
62
62
|
from: 0,
|
|
@@ -64,7 +64,7 @@ function g({ value: g, onChange: _, placeholder: re, height: v, width: y, disabl
|
|
|
64
64
|
insert: e
|
|
65
65
|
} }), t.focus()), _?.(e);
|
|
66
66
|
}, [_]), de = D || O || !!C;
|
|
67
|
-
return /* @__PURE__ */
|
|
67
|
+
return /* @__PURE__ */ p(o, {
|
|
68
68
|
sx: {
|
|
69
69
|
width: G ?? "100%",
|
|
70
70
|
...K ? {
|
|
@@ -74,7 +74,7 @@ function g({ value: g, onChange: _, placeholder: re, height: v, width: y, disabl
|
|
|
74
74
|
} : {}
|
|
75
75
|
},
|
|
76
76
|
children: [
|
|
77
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ p(c, {
|
|
78
78
|
variant: "outlined",
|
|
79
79
|
sx: {
|
|
80
80
|
display: "flex",
|
|
@@ -87,7 +87,7 @@ function g({ value: g, onChange: _, placeholder: re, height: v, width: y, disabl
|
|
|
87
87
|
borderWidth: 2
|
|
88
88
|
}
|
|
89
89
|
},
|
|
90
|
-
children: [!x && /* @__PURE__ */
|
|
90
|
+
children: [!x && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(r, {
|
|
91
91
|
editorView: Y,
|
|
92
92
|
toolbarConfig: B,
|
|
93
93
|
translation: z,
|
|
@@ -97,7 +97,7 @@ function g({ value: g, onChange: _, placeholder: re, height: v, width: y, disabl
|
|
|
97
97
|
queryHistory: V,
|
|
98
98
|
onSelectHistoryEntry: ue,
|
|
99
99
|
onClearHistory: U
|
|
100
|
-
}), /* @__PURE__ */
|
|
100
|
+
}), /* @__PURE__ */ f(s, {})] }), /* @__PURE__ */ f(ee, {
|
|
101
101
|
value: g,
|
|
102
102
|
onChange: _,
|
|
103
103
|
placeholder: re,
|
|
@@ -113,13 +113,13 @@ function g({ value: g, onChange: _, placeholder: re, height: v, width: y, disabl
|
|
|
113
113
|
onFormat: le,
|
|
114
114
|
onLint: I,
|
|
115
115
|
onDiagnosticsChange: I ? ce : void 0,
|
|
116
|
-
onViewReady:
|
|
117
|
-
onCursorChange:
|
|
116
|
+
onViewReady: se,
|
|
117
|
+
onCursorChange: Q,
|
|
118
118
|
onBlur: L,
|
|
119
119
|
onFocus: R
|
|
120
120
|
})]
|
|
121
121
|
}),
|
|
122
|
-
de && /* @__PURE__ */
|
|
122
|
+
de && /* @__PURE__ */ f(i, {
|
|
123
123
|
helperText: C,
|
|
124
124
|
error: S,
|
|
125
125
|
showLineColumn: D,
|
|
@@ -129,7 +129,7 @@ function g({ value: g, onChange: _, placeholder: re, height: v, width: y, disabl
|
|
|
129
129
|
cursorCol: Z.col,
|
|
130
130
|
translation: z
|
|
131
131
|
}),
|
|
132
|
-
w && /* @__PURE__ */
|
|
132
|
+
w && /* @__PURE__ */ f("input", {
|
|
133
133
|
type: "hidden",
|
|
134
134
|
name: w,
|
|
135
135
|
value: g ?? ""
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Box as e, useTheme as t } from "@mui/material";
|
|
2
|
+
import { useEffect as n, useRef as r } from "react";
|
|
3
3
|
import { jsx as i } from "react/jsx-runtime";
|
|
4
4
|
import { EditorView as a, highlightActiveLine as ee, highlightActiveLineGutter as te, keymap as o, lineNumbers as s, placeholder as c } from "@codemirror/view";
|
|
5
5
|
import { Compartment as l, EditorState as u } from "@codemirror/state";
|
|
@@ -18,26 +18,26 @@ var C = {
|
|
|
18
18
|
mssql: v
|
|
19
19
|
};
|
|
20
20
|
function w({ value: v, onChange: y, placeholder: b, disabled: x = !1, readonly: S = !1, showLineNumbers: w = !0, dialect: T = "standard", keywordColor: E, stringColor: D, identifierColor: O, schema: k, onExecute: A, onFormat: j, onLint: M, onDiagnosticsChange: N, onViewReady: P, onCursorChange: F, onBlur: I, onFocus: L }) {
|
|
21
|
-
let R =
|
|
22
|
-
return
|
|
21
|
+
let R = r(null), z = r(null), B = r(y), V = r(F), H = r(I), U = r(L), W = r(P), G = r(A), K = r(j), q = r(M), J = r(N), Y = r(new l()), X = r(new l()), Z = t(), Q = Z.palette.mode === "dark", $ = !!M, oe = JSON.stringify(k);
|
|
22
|
+
return n(() => {
|
|
23
23
|
B.current = y;
|
|
24
|
-
}, [y]),
|
|
24
|
+
}, [y]), n(() => {
|
|
25
25
|
V.current = F;
|
|
26
|
-
}, [F]),
|
|
26
|
+
}, [F]), n(() => {
|
|
27
27
|
H.current = I;
|
|
28
|
-
}, [I]),
|
|
28
|
+
}, [I]), n(() => {
|
|
29
29
|
U.current = L;
|
|
30
|
-
}, [L]),
|
|
30
|
+
}, [L]), n(() => {
|
|
31
31
|
W.current = P;
|
|
32
|
-
}, [P]),
|
|
32
|
+
}, [P]), n(() => {
|
|
33
33
|
G.current = A;
|
|
34
|
-
}, [A]),
|
|
34
|
+
}, [A]), n(() => {
|
|
35
35
|
K.current = j;
|
|
36
|
-
}, [j]),
|
|
36
|
+
}, [j]), n(() => {
|
|
37
37
|
q.current = M;
|
|
38
|
-
}, [M]),
|
|
38
|
+
}, [M]), n(() => {
|
|
39
39
|
J.current = N;
|
|
40
|
-
}, [N]),
|
|
40
|
+
}, [N]), n(() => {
|
|
41
41
|
if (!R.current) return;
|
|
42
42
|
let e = z.current?.state.doc.toString() ?? v ?? "", t = E ?? Z.palette.primary.main, n = D ?? Z.palette.success.main, r = O ?? Z.palette.info.main, i = p.define([
|
|
43
43
|
{
|
|
@@ -222,7 +222,7 @@ function w({ value: v, onChange: y, placeholder: b, disabled: x = !1, readonly:
|
|
|
222
222
|
D,
|
|
223
223
|
O,
|
|
224
224
|
oe
|
|
225
|
-
]),
|
|
225
|
+
]), n(() => {
|
|
226
226
|
let e = z.current;
|
|
227
227
|
if (!e) return;
|
|
228
228
|
let t = e.state.doc.toString();
|
|
@@ -231,9 +231,9 @@ function w({ value: v, onChange: y, placeholder: b, disabled: x = !1, readonly:
|
|
|
231
231
|
to: t.length,
|
|
232
232
|
insert: v ?? ""
|
|
233
233
|
} });
|
|
234
|
-
}, [v]),
|
|
234
|
+
}, [v]), n(() => {
|
|
235
235
|
z.current?.dispatch({ effects: [Y.current.reconfigure(a.editable.of(!x && !S)), X.current.reconfigure(u.readOnly.of(S))] });
|
|
236
|
-
}, [x, S]), /* @__PURE__ */ i(
|
|
236
|
+
}, [x, S]), /* @__PURE__ */ i(e, {
|
|
237
237
|
ref: R,
|
|
238
238
|
sx: {
|
|
239
239
|
flex: 1,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Divider as e, IconButton as t, ListItemIcon as n, ListItemText as r, Menu as i, MenuItem as a, Tooltip as o, Typography as s } from "@mui/material";
|
|
2
|
+
import { useState as c } from "react";
|
|
3
3
|
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
4
4
|
import f from "@mui/icons-material/History";
|
|
5
5
|
import p from "@mui/icons-material/DeleteSweep";
|
|
@@ -9,7 +9,7 @@ function m(e, t = 60) {
|
|
|
9
9
|
return n.length > t ? `${n.slice(0, t)}…` : n;
|
|
10
10
|
}
|
|
11
11
|
function h({ history: h, onSelect: g, onClear: _, translation: v, disabled: y }) {
|
|
12
|
-
let [b, x] =
|
|
12
|
+
let [b, x] = c(null);
|
|
13
13
|
function S() {
|
|
14
14
|
x(null);
|
|
15
15
|
}
|
|
@@ -19,17 +19,17 @@ function h({ history: h, onSelect: g, onClear: _, translation: v, disabled: y })
|
|
|
19
19
|
function w() {
|
|
20
20
|
_(), S();
|
|
21
21
|
}
|
|
22
|
-
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(
|
|
22
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(o, {
|
|
23
23
|
title: v.history,
|
|
24
24
|
arrow: !0,
|
|
25
|
-
children: /* @__PURE__ */ u("span", { children: /* @__PURE__ */ u(
|
|
25
|
+
children: /* @__PURE__ */ u("span", { children: /* @__PURE__ */ u(t, {
|
|
26
26
|
size: "small",
|
|
27
27
|
onClick: (e) => x(e.currentTarget),
|
|
28
28
|
disabled: y,
|
|
29
29
|
"aria-label": v.history,
|
|
30
30
|
children: /* @__PURE__ */ u(f, { fontSize: "small" })
|
|
31
31
|
}) })
|
|
32
|
-
}), /* @__PURE__ */ d(
|
|
32
|
+
}), /* @__PURE__ */ d(i, {
|
|
33
33
|
anchorEl: b,
|
|
34
34
|
open: !!b,
|
|
35
35
|
onClose: S,
|
|
@@ -38,15 +38,15 @@ function h({ history: h, onSelect: g, onClear: _, translation: v, disabled: y })
|
|
|
38
38
|
maxWidth: 400
|
|
39
39
|
} } },
|
|
40
40
|
children: [
|
|
41
|
-
h.length === 0 && /* @__PURE__ */ u(
|
|
41
|
+
h.length === 0 && /* @__PURE__ */ u(a, {
|
|
42
42
|
disabled: !0,
|
|
43
|
-
children: /* @__PURE__ */ u(
|
|
43
|
+
children: /* @__PURE__ */ u(r, { children: v.historyEmpty })
|
|
44
44
|
}),
|
|
45
|
-
h.map((e) => /* @__PURE__ */ u(
|
|
45
|
+
h.map((e) => /* @__PURE__ */ u(a, {
|
|
46
46
|
onClick: () => C(e.sql),
|
|
47
|
-
children: /* @__PURE__ */ u(
|
|
47
|
+
children: /* @__PURE__ */ u(r, {
|
|
48
48
|
primary: m(e.sql),
|
|
49
|
-
secondary: /* @__PURE__ */ u(
|
|
49
|
+
secondary: /* @__PURE__ */ u(s, {
|
|
50
50
|
variant: "caption",
|
|
51
51
|
color: "text.secondary",
|
|
52
52
|
children: new Date(e.timestamp).toLocaleString()
|
|
@@ -57,13 +57,13 @@ function h({ history: h, onSelect: g, onClear: _, translation: v, disabled: y })
|
|
|
57
57
|
} } }
|
|
58
58
|
})
|
|
59
59
|
}, e.id)),
|
|
60
|
-
h.length > 0 && /* @__PURE__ */ u(
|
|
61
|
-
h.length > 0 && /* @__PURE__ */ d(
|
|
60
|
+
h.length > 0 && /* @__PURE__ */ u(e, {}),
|
|
61
|
+
h.length > 0 && /* @__PURE__ */ d(a, {
|
|
62
62
|
onClick: w,
|
|
63
|
-
children: [/* @__PURE__ */ u(
|
|
63
|
+
children: [/* @__PURE__ */ u(n, { children: /* @__PURE__ */ u(p, {
|
|
64
64
|
fontSize: "small",
|
|
65
65
|
color: "error"
|
|
66
|
-
}) }), /* @__PURE__ */ u(
|
|
66
|
+
}) }), /* @__PURE__ */ u(r, {
|
|
67
67
|
sx: { color: "error.main" },
|
|
68
68
|
children: v.clearHistory
|
|
69
69
|
})]
|