@thebuoyant-tsdev/mui-ts-library 3.9.1 → 3.11.2

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 (32) hide show
  1. package/README.de.md +93 -0
  2. package/README.md +93 -0
  3. package/dist/components/chord-chart/ChordChart.d.ts +1 -1
  4. package/dist/components/chord-chart/ChordChart.js +155 -137
  5. package/dist/components/chord-chart/ChordChart.types.d.ts +1 -1
  6. package/dist/components/circle-packing-chart/CirclePackingChart.d.ts +1 -1
  7. package/dist/components/circle-packing-chart/CirclePackingChart.js +134 -121
  8. package/dist/components/gantt-chart/hooks/useGanttDrag.js +44 -38
  9. package/dist/components/horizontal-tree-chart/HorizontalTreeChart.d.ts +1 -1
  10. package/dist/components/horizontal-tree-chart/HorizontalTreeChart.js +319 -247
  11. package/dist/components/horizontal-tree-chart/HorizontalTreeChart.types.d.ts +3 -1
  12. package/dist/components/json-editor/JsonEditorContent.js +134 -119
  13. package/dist/components/json-editor/JsonEditorToolbar.js +3 -3
  14. package/dist/components/password-strength-meter/PasswordStrengthMeter.js +131 -130
  15. package/dist/components/radial-tree-chart/RadialTreeChart.d.ts +1 -1
  16. package/dist/components/radial-tree-chart/RadialTreeChart.js +207 -146
  17. package/dist/components/radial-tree-chart/RadialTreeChart.types.d.ts +2 -0
  18. package/dist/components/rich-text-editor/RichTextEditor.js +1 -1
  19. package/dist/components/rich-text-editor/RichTextEditorMarkdownDialog.js +40 -39
  20. package/dist/components/shared/useTimedFlag.d.ts +6 -0
  21. package/dist/components/shared/useTimedFlag.js +14 -0
  22. package/dist/components/sql-editor/SqlEditorHistoryMenu.js +1 -1
  23. package/dist/components/sql-editor/useSqlQueryHistory.js +14 -12
  24. package/dist/components/sql-editor/util/sqlQueryHistory.util.d.ts +1 -0
  25. package/dist/components/sql-editor/util/sqlQueryHistory.util.js +21 -13
  26. package/dist/components/sunburst-chart/SunburstChart.d.ts +1 -1
  27. package/dist/components/sunburst-chart/SunburstChart.js +193 -150
  28. package/dist/components/sunburst-chart/SunburstChart.types.d.ts +2 -0
  29. package/dist/components/tag-selection/TagSelectionAutocomplete.js +7 -5
  30. package/dist/index.cjs +2 -2
  31. package/dist/index.js +7 -7
  32. package/package.json +1 -1
@@ -70,7 +70,7 @@ export type HorizontalTreeChartProps = {
70
70
  showIcons?: boolean;
71
71
  /** Per-depth color palette — falls back to MUI theme palette */
72
72
  chartColors?: string[];
73
- /** Link stroke opacity (default: 0.4) */
73
+ /** Link stroke opacity (default: 1) */
74
74
  linkStrokeOpacity?: number;
75
75
  /** Link stroke width in px (default: 1.5) */
76
76
  linkStrokeWidth?: number;
@@ -88,6 +88,8 @@ export type HorizontalTreeChartProps = {
88
88
  renderNodePopoverContent?: (info: HorizontalTreeNodeInfo) => React.ReactNode;
89
89
  /** Fires on every node click */
90
90
  onNodeClick?: (info: HorizontalTreeNodeInfo, event: React.MouseEvent<SVGGElement>) => void;
91
+ /** Drill-down/out crossfade duration in ms — set to 0 to disable (default: 750) */
92
+ duration?: number;
91
93
  /** Disables all interactions (default: false) */
92
94
  disabled?: boolean;
93
95
  /** Override translation strings */
@@ -2,71 +2,80 @@ import { computeJsonPath as e } from "./util/jsonPathFinder.js";
2
2
  import { findRangeForPath as t, validateAgainstSchema as n } from "./util/jsonSchemaValidator.js";
3
3
  import { useEffect as r, useRef as i, useState as a } from "react";
4
4
  import { Box as o, Fade as s, Paper as c, Typography as ee, useTheme as te } from "@mui/material";
5
- import { EditorView as l, highlightActiveLine as ne, highlightActiveLineGutter as re, keymap as ie, lineNumbers as ae, placeholder as oe } from "@codemirror/view";
6
- import { Compartment as u, EditorState as d } from "@codemirror/state";
7
- import { json as se, jsonParseLinter as f } from "@codemirror/lang-json";
8
- import { defaultKeymap as ce, history as le, historyKeymap as ue } from "@codemirror/commands";
9
- import { HighlightStyle as de, foldGutter as fe, foldKeymap as pe, syntaxHighlighting as me } from "@codemirror/language";
10
- import { forceLinting as he, lintGutter as ge, linter as p } from "@codemirror/lint";
11
- import { tags as m } from "@lezer/highlight";
12
- import { showMinimap as _e } from "@replit/codemirror-minimap";
13
- import { jsx as h, jsxs as g } from "react/jsx-runtime";
5
+ import { EditorView as l, highlightActiveLine as ne, highlightActiveLineGutter as u, keymap as re, lineNumbers as d, placeholder as f } from "@codemirror/view";
6
+ import { Compartment as p, EditorState as m } from "@codemirror/state";
7
+ import { json as ie, jsonParseLinter as ae } from "@codemirror/lang-json";
8
+ import { defaultKeymap as oe, history as se, historyKeymap as ce } from "@codemirror/commands";
9
+ import { HighlightStyle as le, foldGutter as h, foldKeymap as ue, syntaxHighlighting as de } from "@codemirror/language";
10
+ import { forceLinting as fe, lintGutter as pe, linter as g } from "@codemirror/lint";
11
+ import { tags as _ } from "@lezer/highlight";
12
+ import { showMinimap as me } from "@replit/codemirror-minimap";
13
+ import { jsx as v, jsxs as y } from "react/jsx-runtime";
14
14
  //#region src/components/json-editor/JsonEditorContent.tsx
15
- function _({ value: _, onChange: v, placeholder: y, disabled: b = !1, readonly: x = !1, schema: S, showLineNumbers: ve = !0, showMinimap: C = !1, showFolding: w = !0, enablePathFinder: T = !0, highlightColors: E, onViewReady: D, onCursorChange: O, onBlur: k, onFocus: A, onPathCopy: j }) {
16
- let M = i(null), N = i(null), P = i(null), F = i(v), I = i(O), L = i(k), R = i(A), z = i(D), B = i(j), V = i(T), H = i(S), [U, W] = a(null), G = i(new u()), K = i(new u()), q = te(), J = q.palette.mode === "dark", Y = E?.propertyName ?? q.palette.primary.main, X = E?.string ?? q.palette.success.main, Z = E?.number ?? q.palette.warning.main, Q = E?.boolean ?? q.palette.info.main, $ = E?.null ?? q.palette.text.secondary;
15
+ function b(e) {
16
+ return e ? [d(), u()] : [];
17
+ }
18
+ function x(e) {
19
+ return e ? [h()] : [];
20
+ }
21
+ function S(e) {
22
+ return e ? [f(e)] : [];
23
+ }
24
+ function C({ value: u, onChange: d, placeholder: f, disabled: h = !1, readonly: C = !1, schema: w, showLineNumbers: T = !0, showMinimap: E = !1, showFolding: D = !0, enablePathFinder: O = !0, highlightColors: k, onViewReady: A, onCursorChange: j, onBlur: M, onFocus: N, onPathCopy: P }) {
25
+ let F = i(null), I = i(null), L = i(null), R = i(d), z = i(j), he = i(M), B = i(N), V = i(A), H = i(P), U = i(O), W = i(w), [G, K] = a(null), q = i(new p()), J = i(new p()), Y = i(new p()), X = i(new p()), Z = i(new p()), Q = te(), $ = Q.palette.mode === "dark", ge = k?.propertyName ?? Q.palette.primary.main, _e = k?.string ?? Q.palette.success.main, ve = k?.number ?? Q.palette.warning.main, ye = k?.boolean ?? Q.palette.info.main, be = k?.null ?? Q.palette.text.secondary;
17
26
  return r(() => {
18
- F.current = v;
19
- }, [v]), r(() => {
20
- I.current = O;
21
- }, [O]), r(() => {
22
- L.current = k;
23
- }, [k]), r(() => {
24
- R.current = A;
25
- }, [A]), r(() => {
26
- z.current = D;
27
- }, [D]), r(() => {
28
- B.current = j;
27
+ R.current = d;
28
+ }, [d]), r(() => {
29
+ z.current = j;
29
30
  }, [j]), r(() => {
30
- V.current = T;
31
- }, [T]), r(() => {
32
- H.current = S, P.current && he(P.current);
33
- }, [S]), r(() => {
34
- if (!N.current) return;
35
- let r = P.current?.state.doc.toString() ?? _ ?? "", i = de.define([
31
+ he.current = M;
32
+ }, [M]), r(() => {
33
+ B.current = N;
34
+ }, [N]), r(() => {
35
+ V.current = A;
36
+ }, [A]), r(() => {
37
+ H.current = P;
38
+ }, [P]), r(() => {
39
+ U.current = O;
40
+ }, [O]), r(() => {
41
+ W.current = w, L.current && fe(L.current);
42
+ }, [w]), r(() => {
43
+ if (!I.current) return;
44
+ let r = L.current?.state.doc.toString() ?? u ?? "", i = le.define([
36
45
  {
37
- tag: m.propertyName,
38
- color: Y,
46
+ tag: _.propertyName,
47
+ color: ge,
39
48
  fontWeight: "bold"
40
49
  },
41
50
  {
42
- tag: m.string,
43
- color: X
51
+ tag: _.string,
52
+ color: _e
44
53
  },
45
54
  {
46
- tag: m.number,
47
- color: Z
55
+ tag: _.number,
56
+ color: ve
48
57
  },
49
58
  {
50
- tag: m.bool,
51
- color: Q,
59
+ tag: _.bool,
60
+ color: ye,
52
61
  fontWeight: "bold"
53
62
  },
54
63
  {
55
- tag: m.null,
56
- color: $,
64
+ tag: _.null,
65
+ color: be,
57
66
  fontStyle: "italic"
58
67
  },
59
68
  {
60
- tag: m.bracket,
61
- color: q.palette.text.secondary
69
+ tag: _.bracket,
70
+ color: Q.palette.text.secondary
62
71
  },
63
72
  {
64
- tag: m.punctuation,
65
- color: q.palette.text.disabled
73
+ tag: _.punctuation,
74
+ color: Q.palette.text.disabled
66
75
  },
67
76
  {
68
- tag: m.invalid,
69
- color: q.palette.error.main,
77
+ tag: _.invalid,
78
+ color: Q.palette.error.main,
70
79
  textDecoration: "underline wavy"
71
80
  }
72
81
  ]), a = l.theme({
@@ -78,63 +87,63 @@ function _({ value: _, onChange: v, placeholder: y, disabled: b = !1, readonly:
78
87
  ".cm-scroller": { overflow: "auto" },
79
88
  ".cm-content": {
80
89
  padding: "8px 4px",
81
- caretColor: q.palette.text.primary
90
+ caretColor: Q.palette.text.primary
82
91
  },
83
92
  ".cm-gutters": {
84
- backgroundColor: J ? q.palette.grey[900] : q.palette.grey[50],
85
- color: q.palette.text.disabled,
93
+ backgroundColor: $ ? Q.palette.grey[900] : Q.palette.grey[50],
94
+ color: Q.palette.text.disabled,
86
95
  border: "none",
87
- borderRight: `1px solid ${q.palette.divider}`
96
+ borderRight: `1px solid ${Q.palette.divider}`
88
97
  },
89
98
  ".cm-lineNumbers .cm-gutterElement": {
90
99
  paddingLeft: "4px",
91
100
  paddingRight: "8px"
92
101
  },
93
- ".cm-activeLineGutter": { backgroundColor: q.palette.action.selected },
94
- ".cm-activeLine": { backgroundColor: q.palette.action.hover },
95
- "&.cm-focused .cm-selectionBackground, .cm-selectionBackground": { backgroundColor: q.palette.primary.main + "40" },
96
- ".cm-cursor, .cm-dropCursor": { borderLeftColor: q.palette.text.primary },
102
+ ".cm-activeLineGutter": { backgroundColor: Q.palette.action.selected },
103
+ ".cm-activeLine": { backgroundColor: Q.palette.action.hover },
104
+ "&.cm-focused .cm-selectionBackground, .cm-selectionBackground": { backgroundColor: Q.palette.primary.main + "40" },
105
+ ".cm-cursor, .cm-dropCursor": { borderLeftColor: Q.palette.text.primary },
97
106
  "&.cm-focused": { outline: "none" },
98
107
  ".cm-placeholder": {
99
- color: q.palette.text.disabled,
108
+ color: Q.palette.text.disabled,
100
109
  fontStyle: "italic"
101
110
  },
102
111
  ".cm-gutter-lint": { width: "16px" },
103
- ".cm-lint-marker-error": { color: q.palette.error.main },
104
- ".cm-lint-marker-warning": { color: q.palette.warning.main },
112
+ ".cm-lint-marker-error": { color: Q.palette.error.main },
113
+ ".cm-lint-marker-warning": { color: Q.palette.warning.main },
105
114
  ".cm-foldGutter .cm-gutterElement": {
106
115
  cursor: "pointer",
107
- color: q.palette.text.disabled
116
+ color: Q.palette.text.disabled
108
117
  },
109
118
  ".cm-foldPlaceholder": {
110
- backgroundColor: q.palette.action.selected,
111
- border: `1px solid ${q.palette.divider}`,
119
+ backgroundColor: Q.palette.action.selected,
120
+ border: `1px solid ${Q.palette.divider}`,
112
121
  borderRadius: "3px",
113
- color: q.palette.text.secondary,
122
+ color: Q.palette.text.secondary,
114
123
  padding: "0 4px"
115
124
  },
116
125
  ".cm-tooltip.cm-tooltip-lint": {
117
- backgroundColor: q.palette.background.paper,
118
- border: `1px solid ${q.palette.divider}`,
126
+ backgroundColor: Q.palette.background.paper,
127
+ border: `1px solid ${Q.palette.divider}`,
119
128
  borderRadius: "4px"
120
129
  },
121
- ".cm-diagnostic-error": { borderLeft: `3px solid ${q.palette.error.main}` },
122
- ".cm-diagnostic-warning": { borderLeft: `3px solid ${q.palette.warning.main}` }
123
- }, { dark: J }), o = C ? [_e.of({
130
+ ".cm-diagnostic-error": { borderLeft: `3px solid ${Q.palette.error.main}` },
131
+ ".cm-diagnostic-warning": { borderLeft: `3px solid ${Q.palette.warning.main}` }
132
+ }, { dark: $ }), o = E ? [me.of({
124
133
  create: () => {
125
134
  let e = document.createElement("div");
126
- return e.style.width = "80px", e.style.overflow = "hidden", e.style.borderLeft = `1px solid ${q.palette.divider}`, e.style.backgroundColor = J ? q.palette.grey[900] : q.palette.grey[50], { dom: e };
135
+ return e.style.width = "80px", e.style.overflow = "hidden", e.style.borderLeft = `1px solid ${Q.palette.divider}`, e.style.backgroundColor = $ ? Q.palette.grey[900] : Q.palette.grey[50], { dom: e };
127
136
  },
128
137
  displayText: "blocks",
129
138
  showOverlay: "always"
130
139
  })] : [], s = [
131
140
  a,
132
- me(i),
133
- se(),
134
- ge(),
135
- p(f()),
136
- p((e) => {
137
- let r = H.current;
141
+ de(i),
142
+ ie(),
143
+ pe(),
144
+ g(ae()),
145
+ g((e) => {
146
+ let r = W.current;
138
147
  if (!r) return [];
139
148
  let i;
140
149
  try {
@@ -154,33 +163,33 @@ function _({ value: _, onChange: v, placeholder: y, disabled: b = !1, readonly:
154
163
  }
155
164
  return a;
156
165
  }),
157
- le(),
158
- ie.of([
166
+ se(),
167
+ re.of([
168
+ ...oe,
159
169
  ...ce,
160
- ...ue,
161
- ...pe
170
+ ...ue
162
171
  ]),
163
- G.current.of(l.editable.of(!b && !x)),
164
- K.current.of(d.readOnly.of(x)),
172
+ q.current.of(l.editable.of(!h && !C)),
173
+ J.current.of(m.readOnly.of(C)),
165
174
  ne(),
166
- ...ve ? [ae(), re()] : [],
167
- ...w ? [fe()] : [],
168
- ...y ? [oe(y)] : [],
175
+ X.current.of(b(T)),
176
+ Y.current.of(x(D)),
177
+ Z.current.of(S(f)),
169
178
  ...o,
170
179
  l.updateListener.of((e) => {
171
- e.docChanged && F.current?.(e.state.doc.toString());
180
+ e.docChanged && R.current?.(e.state.doc.toString());
172
181
  let t = e.state.selection.main.head, n = e.state.doc.lineAt(t);
173
- I.current(n.number, t - n.from + 1);
182
+ z.current(n.number, t - n.from + 1);
174
183
  }),
175
184
  l.domEventHandlers({
176
185
  blur: () => {
177
- L.current?.();
186
+ he.current?.();
178
187
  },
179
188
  focus: () => {
180
- R.current?.();
189
+ B.current?.();
181
190
  },
182
191
  click: (t, n) => {
183
- if (!V.current || !(t.ctrlKey || t.metaKey)) return !1;
192
+ if (!U.current || !(t.ctrlKey || t.metaKey)) return !1;
184
193
  let r;
185
194
  try {
186
195
  r = n.posAtCoords({
@@ -193,79 +202,85 @@ function _({ value: _, onChange: v, placeholder: y, disabled: b = !1, readonly:
193
202
  if (r === null) return !1;
194
203
  let i = e(n.state, r);
195
204
  return i ? (navigator.clipboard.writeText(i).then(() => {
196
- let e = M.current?.getBoundingClientRect();
197
- W({
205
+ let e = F.current?.getBoundingClientRect();
206
+ K({
198
207
  x: t.clientX - (e?.left ?? 0),
199
208
  y: t.clientY - (e?.top ?? 0),
200
209
  path: i
201
- }), B.current?.(i);
210
+ }), H.current?.(i);
202
211
  }), !0) : !1;
203
212
  }
204
213
  })
205
214
  ], c = new l({
206
- state: d.create({
215
+ state: m.create({
207
216
  doc: r,
208
217
  extensions: s
209
218
  }),
210
- parent: N.current
219
+ parent: I.current
211
220
  });
212
- return P.current = c, z.current(c), () => {
213
- z.current(null), c.destroy(), P.current = null;
221
+ return L.current = c, V.current(c), () => {
222
+ V.current(null), c.destroy(), L.current = null;
214
223
  };
215
224
  }, [
216
- J,
217
- Y,
218
- X,
219
- Z,
220
- Q,
221
225
  $,
222
- C
226
+ ge,
227
+ _e,
228
+ ve,
229
+ ye,
230
+ be,
231
+ E
223
232
  ]), r(() => {
224
- let e = P.current;
233
+ let e = L.current;
225
234
  if (!e) return;
226
235
  let t = e.state.doc.toString();
227
- t !== (_ ?? "") && e.dispatch({ changes: {
236
+ t !== (u ?? "") && e.dispatch({ changes: {
228
237
  from: 0,
229
238
  to: t.length,
230
- insert: _ ?? ""
239
+ insert: u ?? ""
231
240
  } });
232
- }, [_]), r(() => {
233
- P.current?.dispatch({ effects: [G.current.reconfigure(l.editable.of(!b && !x)), K.current.reconfigure(d.readOnly.of(x))] });
234
- }, [b, x]), r(() => {
235
- if (!U) return;
236
- let e = setTimeout(() => W(null), 1500);
241
+ }, [u]), r(() => {
242
+ L.current?.dispatch({ effects: [q.current.reconfigure(l.editable.of(!h && !C)), J.current.reconfigure(m.readOnly.of(C))] });
243
+ }, [h, C]), r(() => {
244
+ L.current?.dispatch({ effects: X.current.reconfigure(b(T)) });
245
+ }, [T]), r(() => {
246
+ L.current?.dispatch({ effects: Y.current.reconfigure(x(D)) });
247
+ }, [D]), r(() => {
248
+ L.current?.dispatch({ effects: Z.current.reconfigure(S(f)) });
249
+ }, [f]), r(() => {
250
+ if (!G) return;
251
+ let e = setTimeout(() => K(null), 1500);
237
252
  return () => clearTimeout(e);
238
- }, [U]), /* @__PURE__ */ g(o, {
239
- ref: M,
253
+ }, [G]), /* @__PURE__ */ y(o, {
254
+ ref: F,
240
255
  sx: {
241
256
  position: "relative",
242
257
  flex: 1,
243
258
  overflow: "hidden",
244
259
  display: "flex"
245
260
  },
246
- children: [/* @__PURE__ */ h(o, {
247
- ref: N,
261
+ children: [/* @__PURE__ */ v(o, {
262
+ ref: I,
248
263
  sx: {
249
264
  flex: 1,
250
265
  overflow: "hidden",
251
266
  display: "flex",
252
267
  flexDirection: "column",
253
- opacity: b ? .5 : 1,
254
- backgroundColor: q.palette.background.paper,
268
+ opacity: h ? .5 : 1,
269
+ backgroundColor: Q.palette.background.paper,
255
270
  "& .cm-editor": {
256
271
  flex: 1,
257
272
  display: "flex",
258
273
  flexDirection: "column"
259
274
  }
260
275
  }
261
- }), U && /* @__PURE__ */ h(s, {
276
+ }), G && /* @__PURE__ */ v(s, {
262
277
  in: !0,
263
- children: /* @__PURE__ */ h(c, {
278
+ children: /* @__PURE__ */ v(c, {
264
279
  elevation: 3,
265
280
  sx: {
266
281
  position: "absolute",
267
- left: U.x,
268
- top: U.y,
282
+ left: G.x,
283
+ top: G.y,
269
284
  transform: "translate(-50%, -130%)",
270
285
  px: 1,
271
286
  py: .5,
@@ -274,14 +289,14 @@ function _({ value: _, onChange: v, placeholder: y, disabled: b = !1, readonly:
274
289
  bgcolor: "grey.900",
275
290
  color: "common.white"
276
291
  },
277
- children: /* @__PURE__ */ g(ee, {
292
+ children: /* @__PURE__ */ y(ee, {
278
293
  variant: "caption",
279
294
  sx: { fontFamily: "monospace" },
280
- children: ["Copied: ", U.path]
295
+ children: ["Copied: ", G.path]
281
296
  })
282
297
  })
283
298
  })]
284
299
  });
285
300
  }
286
301
  //#endregion
287
- export { _ as JsonEditorContent };
302
+ export { C as JsonEditorContent };
@@ -1,5 +1,5 @@
1
1
  import { ToolbarButton as e } from "../shared/ToolbarButton.js";
2
- import { useState as t } from "react";
2
+ import { useTimedFlag as t } from "../shared/useTimedFlag.js";
3
3
  import { Box as n, Divider as r } from "@mui/material";
4
4
  import { redo as i, undo as a } from "@codemirror/commands";
5
5
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
@@ -12,7 +12,7 @@ import p from "@mui/icons-material/AutoFixHigh";
12
12
  import m from "@mui/icons-material/Compress";
13
13
  //#region src/components/json-editor/JsonEditorToolbar.tsx
14
14
  function h({ editorView: h, toolbarConfig: g, translation: _, indent: v, disabled: y }) {
15
- let [b, x] = t(!1), S = y || !h;
15
+ let [b, x] = t(), S = y || !h;
16
16
  function C() {
17
17
  let e = h;
18
18
  if (!e) return;
@@ -44,7 +44,7 @@ function h({ editorView: h, toolbarConfig: g, translation: _, indent: v, disable
44
44
  function T() {
45
45
  let e = h?.state.doc.toString() ?? "";
46
46
  navigator.clipboard.writeText(e).then(() => {
47
- x(!0), setTimeout(() => x(!1), 2e3);
47
+ x();
48
48
  });
49
49
  }
50
50
  function E() {