@thebuoyant-tsdev/mui-ts-library 3.24.1 → 3.26.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.
@@ -15,31 +15,31 @@ function h(e) {
15
15
  return !1;
16
16
  }
17
17
  }
18
- function g({ value: g, onChange: _, onValidChange: v, placeholder: y, height: b, width: x, disabled: S = !1, readonly: C = !1, error: w = !1, helperText: T, name: E, indent: D = 2, schema: O, showLineNumbers: k = !0, showLineColumn: A = !0, showMinimap: j = !1, showFolding: M = !0, showValidation: N = !1, enablePathFinder: P = !0, toolbarConfig: F, translation: I, highlightColors: L, onBlur: R, onFocus: ee, onPathCopy: z }) {
19
- let B = {
18
+ function g({ value: g, onChange: _, onValidChange: v, placeholder: y, height: b, width: x, disabled: S = !1, readonly: C = !1, error: w = !1, helperText: T, name: E, indent: D = 2, schema: O, showLineNumbers: k = !0, showLineColumn: A = !0, showMinimap: j = !1, showFolding: M = !0, showValidation: N = !1, enablePathFinder: P = !0, downloadFilename: F = "file.json", toolbarConfig: I, translation: L, highlightColors: R, onBlur: ee, onFocus: z, onPathCopy: B }) {
19
+ let V = {
20
20
  ...t,
21
- ...I
22
- }, V = {
21
+ ...L
22
+ }, H = {
23
23
  ...e,
24
- ...F
25
- }, H = a(b), U = a(x), W = H === "auto", G = W ? void 0 : H ?? 300, K = s(null), [q, J] = c(null), [Y, X] = c({
24
+ ...I
25
+ }, U = a(b), W = a(x), G = U === "auto", K = G ? void 0 : U ?? 300, q = s(null), [J, Y] = c(null), [X, Z] = c({
26
26
  line: 1,
27
27
  col: 1
28
- }), [Z, Q] = c(() => h(g ?? "")), $ = o((e) => {
29
- K.current = e, J(e);
30
- }, []), te = o((e, t) => {
31
- X({
28
+ }), [Q, $] = c(() => h(g ?? "")), te = o((e) => {
29
+ q.current = e, Y(e);
30
+ }, []), ne = o((e, t) => {
31
+ Z({
32
32
  line: e,
33
33
  col: t
34
34
  });
35
- }, []), ne = o((e) => {
35
+ }, []), re = o((e) => {
36
36
  let t = h(e);
37
- Q(t), v?.(t), _?.(e);
38
- }, [_, v]), re = A || N || !!T;
37
+ $(t), v?.(t), _?.(e);
38
+ }, [_, v]), ie = A || N || !!T;
39
39
  return /* @__PURE__ */ m(l, {
40
40
  sx: {
41
- width: U ?? "100%",
42
- ...W ? {
41
+ width: W ?? "100%",
42
+ ...G ? {
43
43
  display: "flex",
44
44
  flexDirection: "column",
45
45
  flex: 1
@@ -52,7 +52,7 @@ function g({ value: g, onChange: _, onValidChange: v, placeholder: y, height: b,
52
52
  display: "flex",
53
53
  flexDirection: "column",
54
54
  overflow: "hidden",
55
- ...W ? { flex: 1 } : { height: G },
55
+ ...G ? { flex: 1 } : { height: K },
56
56
  borderColor: w ? "error.main" : void 0,
57
57
  "&:focus-within": {
58
58
  borderColor: w ? "error.main" : "primary.main",
@@ -60,14 +60,15 @@ function g({ value: g, onChange: _, onValidChange: v, placeholder: y, height: b,
60
60
  }
61
61
  },
62
62
  children: [!C && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(r, {
63
- editorView: q,
64
- toolbarConfig: V,
65
- translation: B,
63
+ editorView: J,
64
+ toolbarConfig: H,
65
+ translation: V,
66
66
  indent: D,
67
+ downloadFilename: F,
67
68
  disabled: S
68
69
  }), /* @__PURE__ */ p(u, {})] }), /* @__PURE__ */ p(n, {
69
70
  value: g,
70
- onChange: ne,
71
+ onChange: re,
71
72
  placeholder: y,
72
73
  disabled: S,
73
74
  readonly: C,
@@ -76,23 +77,23 @@ function g({ value: g, onChange: _, onValidChange: v, placeholder: y, height: b,
76
77
  showMinimap: j,
77
78
  showFolding: M,
78
79
  enablePathFinder: P,
79
- highlightColors: L,
80
- onViewReady: $,
81
- onCursorChange: te,
82
- onBlur: R,
83
- onFocus: ee,
84
- onPathCopy: z
80
+ highlightColors: R,
81
+ onViewReady: te,
82
+ onCursorChange: ne,
83
+ onBlur: ee,
84
+ onFocus: z,
85
+ onPathCopy: B
85
86
  })]
86
87
  }),
87
- re && /* @__PURE__ */ p(i, {
88
+ ie && /* @__PURE__ */ p(i, {
88
89
  helperText: T,
89
90
  error: w,
90
91
  showLineColumn: A,
91
92
  showValidation: N,
92
- isValid: Z,
93
- cursorLine: Y.line,
94
- cursorCol: Y.col,
95
- translation: B
93
+ isValid: Q,
94
+ cursorLine: X.line,
95
+ cursorCol: X.col,
96
+ translation: V
96
97
  }),
97
98
  E && /* @__PURE__ */ p("input", {
98
99
  type: "hidden",
@@ -2,6 +2,7 @@ export type JsonEditorToolbarConfig = {
2
2
  showFormat?: boolean;
3
3
  showCompact?: boolean;
4
4
  showCopy?: boolean;
5
+ showDownload?: boolean;
5
6
  showClear?: boolean;
6
7
  showUndoRedo?: boolean;
7
8
  };
@@ -11,6 +12,8 @@ export type JsonEditorTranslation = {
11
12
  compact: string;
12
13
  copy: string;
13
14
  copySuccess: string;
15
+ download: string;
16
+ downloadSuccess: string;
14
17
  clear: string;
15
18
  undo: string;
16
19
  redo: string;
@@ -72,6 +75,8 @@ export type JsonEditorProps = {
72
75
  showFolding?: boolean;
73
76
  /** Shows a Valid / Invalid JSON indicator in the footer. */
74
77
  showValidation?: boolean;
78
+ /** Filename for the Download button export. Default: "file.json". */
79
+ downloadFilename?: string;
75
80
  toolbarConfig?: JsonEditorToolbarConfig;
76
81
  translation?: Partial<JsonEditorTranslation>;
77
82
  value?: string;
@@ -3,6 +3,7 @@ var e = {
3
3
  showFormat: !0,
4
4
  showCompact: !0,
5
5
  showCopy: !0,
6
+ showDownload: !0,
6
7
  showClear: !0,
7
8
  showUndoRedo: !0
8
9
  }, t = {
@@ -10,6 +11,8 @@ var e = {
10
11
  compact: "Compact JSON",
11
12
  copy: "Copy",
12
13
  copySuccess: "Copied!",
14
+ download: "Download",
15
+ downloadSuccess: "Downloaded!",
13
16
  clear: "Clear",
14
17
  undo: "Undo",
15
18
  redo: "Redo",
@@ -2,30 +2,30 @@ 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 u, keymap as re, lineNumbers as d, placeholder as f } from "@codemirror/view";
6
- import { Compartment as p, EditorState as m } from "@codemirror/state";
5
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
6
+ import { EditorView as d, highlightActiveLine as ne, highlightActiveLineGutter as f, keymap as re, lineNumbers as p, placeholder as m } from "@codemirror/view";
7
+ import { Compartment as h, EditorState as g } from "@codemirror/state";
7
8
  import { json as ie, jsonParseLinter as ae } from "@codemirror/lang-json";
8
9
  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";
10
+ import { HighlightStyle as le, foldGutter as _, foldKeymap as ue, syntaxHighlighting as de } from "@codemirror/language";
11
+ import { forceLinting as fe, lintGutter as pe, linter as v } from "@codemirror/lint";
12
+ import { tags as y } from "@lezer/highlight";
12
13
  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
15
  function b(e) {
16
- return e ? [d(), u()] : [];
16
+ return e ? [p(), f()] : [];
17
17
  }
18
18
  function x(e) {
19
- return e ? [h()] : [];
19
+ return e ? [_()] : [];
20
20
  }
21
21
  function S(e) {
22
- return e ? [f(e)] : [];
22
+ return e ? [m(e)] : [];
23
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;
24
+ function C({ value: f, onChange: p, placeholder: m, disabled: _ = !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(p), 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 h()), J = i(new h()), Y = i(new h()), X = i(new h()), Z = i(new h()), 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;
26
26
  return r(() => {
27
- R.current = d;
28
- }, [d]), r(() => {
27
+ R.current = p;
28
+ }, [p]), r(() => {
29
29
  z.current = j;
30
30
  }, [j]), r(() => {
31
31
  he.current = M;
@@ -41,44 +41,44 @@ function C({ value: u, onChange: d, placeholder: f, disabled: h = !1, readonly:
41
41
  W.current = w, L.current && fe(L.current);
42
42
  }, [w]), r(() => {
43
43
  if (!I.current) return;
44
- let r = L.current?.state.doc.toString() ?? u ?? "", i = le.define([
44
+ let r = L.current?.state.doc.toString() ?? f ?? "", i = le.define([
45
45
  {
46
- tag: _.propertyName,
46
+ tag: y.propertyName,
47
47
  color: ge,
48
48
  fontWeight: "bold"
49
49
  },
50
50
  {
51
- tag: _.string,
51
+ tag: y.string,
52
52
  color: _e
53
53
  },
54
54
  {
55
- tag: _.number,
55
+ tag: y.number,
56
56
  color: ve
57
57
  },
58
58
  {
59
- tag: _.bool,
59
+ tag: y.bool,
60
60
  color: ye,
61
61
  fontWeight: "bold"
62
62
  },
63
63
  {
64
- tag: _.null,
64
+ tag: y.null,
65
65
  color: be,
66
66
  fontStyle: "italic"
67
67
  },
68
68
  {
69
- tag: _.bracket,
69
+ tag: y.bracket,
70
70
  color: Q.palette.text.secondary
71
71
  },
72
72
  {
73
- tag: _.punctuation,
73
+ tag: y.punctuation,
74
74
  color: Q.palette.text.disabled
75
75
  },
76
76
  {
77
- tag: _.invalid,
77
+ tag: y.invalid,
78
78
  color: Q.palette.error.main,
79
79
  textDecoration: "underline wavy"
80
80
  }
81
- ]), a = l.theme({
81
+ ]), a = d.theme({
82
82
  "&": {
83
83
  height: "100%",
84
84
  fontFamily: "'Fira Code', 'JetBrains Mono', 'Consolas', monospace",
@@ -141,8 +141,8 @@ function C({ value: u, onChange: d, placeholder: f, disabled: h = !1, readonly:
141
141
  de(i),
142
142
  ie(),
143
143
  pe(),
144
- g(ae()),
145
- g((e) => {
144
+ v(ae()),
145
+ v((e) => {
146
146
  let r = W.current;
147
147
  if (!r) return [];
148
148
  let i;
@@ -169,19 +169,19 @@ function C({ value: u, onChange: d, placeholder: f, disabled: h = !1, readonly:
169
169
  ...ce,
170
170
  ...ue
171
171
  ]),
172
- q.current.of(l.editable.of(!h && !C)),
173
- J.current.of(m.readOnly.of(C)),
172
+ q.current.of(d.editable.of(!_ && !C)),
173
+ J.current.of(g.readOnly.of(C)),
174
174
  ne(),
175
175
  X.current.of(b(T)),
176
176
  Y.current.of(x(D)),
177
- Z.current.of(S(f)),
177
+ Z.current.of(S(m)),
178
178
  ...o,
179
- l.updateListener.of((e) => {
179
+ d.updateListener.of((e) => {
180
180
  e.docChanged && R.current?.(e.state.doc.toString());
181
181
  let t = e.state.selection.main.head, n = e.state.doc.lineAt(t);
182
182
  z.current(n.number, t - n.from + 1);
183
183
  }),
184
- l.domEventHandlers({
184
+ d.domEventHandlers({
185
185
  blur: () => {
186
186
  he.current?.();
187
187
  },
@@ -211,8 +211,8 @@ function C({ value: u, onChange: d, placeholder: f, disabled: h = !1, readonly:
211
211
  }), !0) : !1;
212
212
  }
213
213
  })
214
- ], c = new l({
215
- state: m.create({
214
+ ], c = new d({
215
+ state: g.create({
216
216
  doc: r,
217
217
  extensions: s
218
218
  }),
@@ -233,24 +233,24 @@ function C({ value: u, onChange: d, placeholder: f, disabled: h = !1, readonly:
233
233
  let e = L.current;
234
234
  if (!e) return;
235
235
  let t = e.state.doc.toString();
236
- t !== (u ?? "") && e.dispatch({ changes: {
236
+ t !== (f ?? "") && e.dispatch({ changes: {
237
237
  from: 0,
238
238
  to: t.length,
239
- insert: u ?? ""
239
+ insert: f ?? ""
240
240
  } });
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(() => {
241
+ }, [f]), r(() => {
242
+ L.current?.dispatch({ effects: [q.current.reconfigure(d.editable.of(!_ && !C)), J.current.reconfigure(g.readOnly.of(C))] });
243
+ }, [_, C]), r(() => {
244
244
  L.current?.dispatch({ effects: X.current.reconfigure(b(T)) });
245
245
  }, [T]), r(() => {
246
246
  L.current?.dispatch({ effects: Y.current.reconfigure(x(D)) });
247
247
  }, [D]), r(() => {
248
- L.current?.dispatch({ effects: Z.current.reconfigure(S(f)) });
249
- }, [f]), r(() => {
248
+ L.current?.dispatch({ effects: Z.current.reconfigure(S(m)) });
249
+ }, [m]), r(() => {
250
250
  if (!G) return;
251
251
  let e = setTimeout(() => K(null), 1500);
252
252
  return () => clearTimeout(e);
253
- }, [G]), /* @__PURE__ */ y(o, {
253
+ }, [G]), /* @__PURE__ */ u(o, {
254
254
  ref: F,
255
255
  sx: {
256
256
  position: "relative",
@@ -258,14 +258,14 @@ function C({ value: u, onChange: d, placeholder: f, disabled: h = !1, readonly:
258
258
  overflow: "hidden",
259
259
  display: "flex"
260
260
  },
261
- children: [/* @__PURE__ */ v(o, {
261
+ children: [/* @__PURE__ */ l(o, {
262
262
  ref: I,
263
263
  sx: {
264
264
  flex: 1,
265
265
  overflow: "hidden",
266
266
  display: "flex",
267
267
  flexDirection: "column",
268
- opacity: h ? .5 : 1,
268
+ opacity: _ ? .5 : 1,
269
269
  backgroundColor: Q.palette.background.paper,
270
270
  "& .cm-editor": {
271
271
  flex: 1,
@@ -273,9 +273,9 @@ function C({ value: u, onChange: d, placeholder: f, disabled: h = !1, readonly:
273
273
  flexDirection: "column"
274
274
  }
275
275
  }
276
- }), G && /* @__PURE__ */ v(s, {
276
+ }), G && /* @__PURE__ */ l(s, {
277
277
  in: !0,
278
- children: /* @__PURE__ */ v(c, {
278
+ children: /* @__PURE__ */ l(c, {
279
279
  elevation: 3,
280
280
  sx: {
281
281
  position: "absolute",
@@ -289,7 +289,7 @@ function C({ value: u, onChange: d, placeholder: f, disabled: h = !1, readonly:
289
289
  bgcolor: "grey.900",
290
290
  color: "common.white"
291
291
  },
292
- children: /* @__PURE__ */ y(ee, {
292
+ children: /* @__PURE__ */ u(ee, {
293
293
  variant: "caption",
294
294
  sx: { fontFamily: "monospace" },
295
295
  children: ["Copied: ", G.path]
@@ -5,7 +5,8 @@ type JsonEditorToolbarProps = {
5
5
  toolbarConfig: Required<JsonEditorToolbarConfig>;
6
6
  translation: JsonEditorTranslation;
7
7
  indent: number;
8
+ downloadFilename: string;
8
9
  disabled?: boolean;
9
10
  };
10
- export declare function JsonEditorToolbar({ editorView, toolbarConfig: tc, translation: t, indent, disabled, }: JsonEditorToolbarProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function JsonEditorToolbar({ editorView, toolbarConfig: tc, translation: t, indent, downloadFilename, disabled, }: JsonEditorToolbarProps): import("react/jsx-runtime").JSX.Element;
11
12
  export {};
@@ -1,24 +1,25 @@
1
1
  import { ToolbarButton as e } from "../shared/ToolbarButton.js";
2
2
  import { useTimedFlag as t } from "../shared/useTimedFlag.js";
3
3
  import { Box as n, Divider as r } from "@mui/material";
4
- import { redo as i, undo as a } from "@codemirror/commands";
5
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
4
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
+ import { redo as o, undo as s } from "@codemirror/commands";
6
6
  import c from "@mui/icons-material/ContentCopy";
7
- import l from "@mui/icons-material/Check";
8
- import u from "@mui/icons-material/Delete";
9
- import d from "@mui/icons-material/Undo";
10
- import f from "@mui/icons-material/Redo";
11
- import p from "@mui/icons-material/AutoFixHigh";
12
- import m from "@mui/icons-material/Compress";
7
+ import l from "@mui/icons-material/Download";
8
+ import u from "@mui/icons-material/Check";
9
+ import d from "@mui/icons-material/Delete";
10
+ import f from "@mui/icons-material/Undo";
11
+ import p from "@mui/icons-material/Redo";
12
+ import m from "@mui/icons-material/AutoFixHigh";
13
+ import h from "@mui/icons-material/Compress";
13
14
  //#region src/components/json-editor/JsonEditorToolbar.tsx
14
- function h({ editorView: h, toolbarConfig: g, translation: _, indent: v, disabled: y }) {
15
- let [b, x] = t(), S = y || !h;
16
- function C() {
17
- let e = h;
15
+ function g({ editorView: g, toolbarConfig: _, translation: v, indent: y, downloadFilename: b, disabled: x }) {
16
+ let [S, C] = t(), [w, T] = t(), E = x || !g;
17
+ function D() {
18
+ let e = g;
18
19
  if (!e) return;
19
20
  let t = e.state.doc.toString();
20
21
  try {
21
- let n = JSON.stringify(JSON.parse(t), null, v);
22
+ let n = JSON.stringify(JSON.parse(t), null, y);
22
23
  e.dispatch({ changes: {
23
24
  from: 0,
24
25
  to: e.state.doc.length,
@@ -27,8 +28,8 @@ function h({ editorView: h, toolbarConfig: g, translation: _, indent: v, disable
27
28
  } catch {}
28
29
  e.focus();
29
30
  }
30
- function w() {
31
- let e = h;
31
+ function O() {
32
+ let e = g;
32
33
  if (!e) return;
33
34
  let t = e.state.doc.toString();
34
35
  try {
@@ -41,30 +42,34 @@ function h({ editorView: h, toolbarConfig: g, translation: _, indent: v, disable
41
42
  } catch {}
42
43
  e.focus();
43
44
  }
44
- function T() {
45
- let e = h?.state.doc.toString() ?? "";
45
+ function k() {
46
+ let e = g?.state.doc.toString() ?? "";
46
47
  navigator.clipboard.writeText(e).then(() => {
47
- x();
48
+ C();
48
49
  });
49
50
  }
50
- function E() {
51
- let e = h;
51
+ function A() {
52
+ let e = g?.state.doc.toString() ?? "", t = new Blob([e], { type: "application/json" }), n = URL.createObjectURL(t), r = document.createElement("a");
53
+ r.href = n, r.download = b, r.click(), URL.revokeObjectURL(n), T();
54
+ }
55
+ function j() {
56
+ let e = g;
52
57
  e && (e.dispatch({ changes: {
53
58
  from: 0,
54
59
  to: e.state.doc.length,
55
60
  insert: ""
56
61
  } }), e.focus());
57
62
  }
58
- function D() {
59
- let e = h;
60
- e && (a(e), e.focus());
63
+ function M() {
64
+ let e = g;
65
+ e && (s(e), e.focus());
61
66
  }
62
- function O() {
63
- let e = h;
64
- e && (i(e), e.focus());
67
+ function N() {
68
+ let e = g;
69
+ e && (o(e), e.focus());
65
70
  }
66
- let k = g.showFormat || g.showCompact, A = g.showCopy || g.showClear, j = g.showUndoRedo;
67
- return /* @__PURE__ */ s(n, {
71
+ let P = _.showFormat || _.showCompact, F = _.showCopy || _.showDownload || _.showClear, I = _.showUndoRedo;
72
+ return /* @__PURE__ */ a(n, {
68
73
  sx: {
69
74
  display: "flex",
70
75
  flexWrap: "wrap",
@@ -76,73 +81,85 @@ function h({ editorView: h, toolbarConfig: g, translation: _, indent: v, disable
76
81
  role: "toolbar",
77
82
  "aria-label": "JSON editor actions",
78
83
  children: [
79
- k && /* @__PURE__ */ s(n, {
84
+ P && /* @__PURE__ */ a(n, {
80
85
  sx: {
81
86
  display: "flex",
82
87
  gap: .25
83
88
  },
84
- children: [g.showFormat && /* @__PURE__ */ o(e, {
85
- label: _.format,
86
- icon: /* @__PURE__ */ o(p, { fontSize: "small" }),
87
- onClick: C,
88
- disabled: S
89
- }), g.showCompact && /* @__PURE__ */ o(e, {
90
- label: _.compact,
91
- icon: /* @__PURE__ */ o(m, { fontSize: "small" }),
92
- onClick: w,
93
- disabled: S
89
+ children: [_.showFormat && /* @__PURE__ */ i(e, {
90
+ label: v.format,
91
+ icon: /* @__PURE__ */ i(m, { fontSize: "small" }),
92
+ onClick: D,
93
+ disabled: E
94
+ }), _.showCompact && /* @__PURE__ */ i(e, {
95
+ label: v.compact,
96
+ icon: /* @__PURE__ */ i(h, { fontSize: "small" }),
97
+ onClick: O,
98
+ disabled: E
94
99
  })]
95
100
  }),
96
- k && (A || j) && /* @__PURE__ */ o(r, {
101
+ P && (F || I) && /* @__PURE__ */ i(r, {
97
102
  orientation: "vertical",
98
103
  flexItem: !0,
99
104
  sx: { mx: .5 }
100
105
  }),
101
- A && /* @__PURE__ */ s(n, {
106
+ F && /* @__PURE__ */ a(n, {
102
107
  sx: {
103
108
  display: "flex",
104
109
  gap: .25
105
110
  },
106
- children: [g.showCopy && /* @__PURE__ */ o(e, {
107
- label: b ? _.copySuccess : _.copy,
108
- icon: b ? /* @__PURE__ */ o(l, {
109
- fontSize: "small",
110
- color: "success"
111
- }) : /* @__PURE__ */ o(c, { fontSize: "small" }),
112
- onClick: T,
113
- disabled: S
114
- }), g.showClear && /* @__PURE__ */ o(e, {
115
- label: _.clear,
116
- icon: /* @__PURE__ */ o(u, { fontSize: "small" }),
117
- onClick: E,
118
- disabled: S
119
- })]
111
+ children: [
112
+ _.showCopy && /* @__PURE__ */ i(e, {
113
+ label: S ? v.copySuccess : v.copy,
114
+ icon: S ? /* @__PURE__ */ i(u, {
115
+ fontSize: "small",
116
+ color: "success"
117
+ }) : /* @__PURE__ */ i(c, { fontSize: "small" }),
118
+ onClick: k,
119
+ disabled: E
120
+ }),
121
+ _.showDownload && /* @__PURE__ */ i(e, {
122
+ label: w ? v.downloadSuccess : v.download,
123
+ icon: w ? /* @__PURE__ */ i(u, {
124
+ fontSize: "small",
125
+ color: "success"
126
+ }) : /* @__PURE__ */ i(l, { fontSize: "small" }),
127
+ onClick: A,
128
+ disabled: E
129
+ }),
130
+ _.showClear && /* @__PURE__ */ i(e, {
131
+ label: v.clear,
132
+ icon: /* @__PURE__ */ i(d, { fontSize: "small" }),
133
+ onClick: j,
134
+ disabled: E
135
+ })
136
+ ]
120
137
  }),
121
- A && j && /* @__PURE__ */ o(r, {
138
+ F && I && /* @__PURE__ */ i(r, {
122
139
  orientation: "vertical",
123
140
  flexItem: !0,
124
141
  sx: { mx: .5 }
125
142
  }),
126
- j && /* @__PURE__ */ s(n, {
143
+ I && /* @__PURE__ */ a(n, {
127
144
  sx: {
128
145
  display: "flex",
129
146
  gap: .25
130
147
  },
131
- children: [/* @__PURE__ */ o(e, {
132
- label: _.undo,
133
- icon: /* @__PURE__ */ o(d, { fontSize: "small" }),
134
- onClick: D,
135
- disabled: S
136
- }), /* @__PURE__ */ o(e, {
137
- label: _.redo,
138
- icon: /* @__PURE__ */ o(f, { fontSize: "small" }),
139
- onClick: O,
140
- disabled: S
148
+ children: [/* @__PURE__ */ i(e, {
149
+ label: v.undo,
150
+ icon: /* @__PURE__ */ i(f, { fontSize: "small" }),
151
+ onClick: M,
152
+ disabled: E
153
+ }), /* @__PURE__ */ i(e, {
154
+ label: v.redo,
155
+ icon: /* @__PURE__ */ i(p, { fontSize: "small" }),
156
+ onClick: N,
157
+ disabled: E
141
158
  })]
142
159
  }),
143
- !k && !A && !j && /* @__PURE__ */ o(n, { sx: { height: 32 } })
160
+ !P && !F && !I && /* @__PURE__ */ i(n, { sx: { height: 32 } })
144
161
  ]
145
162
  });
146
163
  }
147
164
  //#endregion
148
- export { h as JsonEditorToolbar };
165
+ export { g as JsonEditorToolbar };