@splunk/react-ui 4.47.0 → 4.47.1

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/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  Change Log
2
2
  ============
3
3
 
4
+ 4.47.1 - September 2, 2025
5
+ ----------
6
+ Bug Fixes:
7
+ * `JSONTreeItem` now uses unique DOM `id`s by default (SUI-8159).
8
+
4
9
  4.47.0 - July 3, 2025
5
10
  ----------
6
11
  New Features:
package/JSONTree.js CHANGED
@@ -47,7 +47,7 @@
47
47
  light: "rgba(0, 0, 0, 0.03)"
48
48
  }));
49
49
  // CONCATENATED MODULE: ./src/Tree/TreeStyles.ts
50
- var m = d().ul.withConfig({
50
+ var b = d().ul.withConfig({
51
51
  displayName: "TreeStyles__StyledUnorderedList",
52
52
  componentId: "sc-13pokwt-0"
53
53
  })([ "", ";font-family:inherit;list-style:none;white-space:inherit;", ";" ], s.mixins.reset("ul"), (function(e) {
@@ -61,7 +61,7 @@
61
61
  * @param ref - The React callback or object ref. Can be `null` or `undefined`.
62
62
  * @param current - The new value of the ref.
63
63
  */
64
- function b(e, n) {
64
+ function m(e, n) {
65
65
  if (e) {
66
66
  if (typeof e === "function") {
67
67
  e(n);
@@ -203,7 +203,7 @@
203
203
  }
204
204
  return r;
205
205
  }
206
- var K = {
206
+ var D = {
207
207
  id: i().string,
208
208
  children: i().node,
209
209
  content: i().node,
@@ -217,12 +217,12 @@
217
217
  onToggleExpansion: i().func
218
218
  };
219
219
  /** @public */
220
- /** @public */ function D(e) {
220
+ /** @public */ function K(e) {
221
221
  var n = e.id, r = e.children, a = e.content, i = e.customIndent, l = e.elementRef, u = e.endAdornment, f = e.expanded, d = e.onFocus, s = e.onKeyDown, h = e.onToggleExpansion, S = e.onToggleSelection, O = A(e, [ "id", "children", "content", "customIndent", "elementRef", "endAdornment", "expanded", "onFocus", "onKeyDown", "onToggleExpansion", "onToggleSelection" ]);
222
222
  // @docs-props-type TreeItemPropsBase
223
- var w = (0, t.useContext)(c), I = w.defaultIndent, C = I === void 0 ? true : I, j = w.onItemKeyDown, E = w.onItemClick, T = w.removeNode, P = w.setNode, R = w.itemPaths, K = w.focusedItemId;
223
+ var w = (0, t.useContext)(c), I = w.defaultIndent, C = I === void 0 ? true : I, j = w.onItemKeyDown, E = w.onItemClick, T = w.removeNode, P = w.setNode, R = w.itemPaths, D = w.focusedItemId;
224
224
  // make first tree item tabbable
225
- var D = (0, t.useState)((R === null || R === void 0 ? void 0 : R.get("".concat(n))) === "0" ? 0 : -1), _ = x(D, 2), N = _[0], V = _[1];
225
+ var K = (0, t.useState)((R === null || R === void 0 ? void 0 : R.get("".concat(n))) === "0" ? 0 : -1), _ = x(K, 2), N = _[0], V = _[1];
226
226
  var L = (0, t.useRef)(null);
227
227
  var q = (0, t.useRef)(null);
228
228
  var F = t.Children.toArray(r).filter(t.isValidElement);
@@ -236,8 +236,8 @@
236
236
  }
237
237
  }));
238
238
  var M = (0, t.useCallback)((function(e) {
239
- b(L, e);
240
- b(l, e);
239
+ m(L, e);
240
+ m(l, e);
241
241
  }), [ l ]);
242
242
  var $ = (0, t.useCallback)((function(e) {
243
243
  var n;
@@ -265,11 +265,11 @@
265
265
  }
266
266
  }), [ n, R ]);
267
267
  (0, t.useEffect)((function() {
268
- if (K === n) {
268
+ if (D === n) {
269
269
  var e;
270
270
  L === null || L === void 0 ? void 0 : (e = L.current) === null || e === void 0 ? void 0 : e.focus();
271
271
  }
272
- }), [ K, n, L ]);
272
+ }), [ D, n, L ]);
273
273
  var B = (0, t.useCallback)((function(e) {
274
274
  e.stopPropagation();
275
275
  }), []);
@@ -309,13 +309,13 @@
309
309
  tabIndex: -1,
310
310
  onFocus: B,
311
311
  onClick: J
312
- }, a, !f && u)), f && o().createElement(o().Fragment, null, o().createElement(m, {
312
+ }, a, !f && u)), f && o().createElement(o().Fragment, null, o().createElement(b, {
313
313
  role: "group",
314
314
  $defaultIndent: C
315
315
  }, r), u));
316
316
  }
317
- D.propTypes = K;
318
- /* harmony default export */ const _ = D;
317
+ K.propTypes = D;
318
+ /* harmony default export */ const _ = K;
319
319
  // CONCATENATED MODULE: ./src/Tree/treeUtils.ts
320
320
  function N(e, n) {
321
321
  return M(e) || F(e, n) || L(e, n) || V();
@@ -644,7 +644,7 @@
644
644
  // do nothing
645
645
  }
646
646
  };
647
- var b = function e(n, r) {
647
+ var m = function e(n, r) {
648
648
  n.preventDefault();
649
649
  v(r);
650
650
  };
@@ -664,7 +664,7 @@
664
664
  return {
665
665
  defaultIndent: a,
666
666
  onItemKeyDown: y,
667
- onItemClick: b,
667
+ onItemClick: m,
668
668
  removeNode: h,
669
669
  setNode: g,
670
670
  itemPaths: p,
@@ -674,7 +674,7 @@
674
674
 
675
675
  return o().createElement(c.Provider, {
676
676
  value: k
677
- }, o().createElement(m, Z({
677
+ }, o().createElement(b, Z({
678
678
  "data-test": "tree",
679
679
  ref: i,
680
680
  role: "tree",
@@ -792,7 +792,7 @@
792
792
  r.r(t);
793
793
  // EXPORTS
794
794
  r.d(t, {
795
- default: () => /* reexport */ Ie
795
+ default: () => /* reexport */ xe
796
796
  });
797
797
  // EXTERNAL MODULE: external "react"
798
798
  var e = r(9497);
@@ -803,53 +803,55 @@
803
803
  // CONCATENATED MODULE: external "lodash/isString"
804
804
  const i = require("lodash/isString");
805
805
  var l = r.n(i);
806
+ // CONCATENATED MODULE: external "@splunk/ui-utils/id"
807
+ const u = require("@splunk/ui-utils/id");
806
808
  // EXTERNAL MODULE: external "styled-components"
807
- var u = r(232);
808
- var c = r.n(u);
809
+ var c = r(232);
810
+ var f = r.n(c);
809
811
  // EXTERNAL MODULE: external "@splunk/themes"
810
- var f = r(3563);
812
+ var d = r(3563);
811
813
  // CONCATENATED MODULE: ./src/JSONTree/JSONTreeStyles.ts
812
- var d = (0, u.css)([ "", ";", ";" ], f.mixins.reset("block"), f.mixins.typography({
814
+ var s = (0, c.css)([ "", ";", ";" ], d.mixins.reset("block"), d.mixins.typography({
813
815
  family: "monospace"
814
816
  }));
815
- var s = c().code.withConfig({
817
+ var v = f().code.withConfig({
816
818
  displayName: "JSONTreeStyles__StyledScrollCode",
817
819
  componentId: "vrdt21-0"
818
- })([ "", ";overflow-x:auto;white-space:nowrap;" ], d);
819
- var v = c().code.withConfig({
820
+ })([ "", ";overflow-x:auto;white-space:nowrap;" ], s);
821
+ var p = f().code.withConfig({
820
822
  displayName: "JSONTreeStyles__StyledWrapCode",
821
823
  componentId: "vrdt21-1"
822
- })([ "", ";white-space:pre-wrap;" ], d);
824
+ })([ "", ";white-space:pre-wrap;" ], s);
823
825
  // CONCATENATED MODULE: external "lodash/fill"
824
- const p = require("lodash/fill");
825
- var y = r.n(p);
826
+ const y = require("lodash/fill");
827
+ var b = r.n(y);
826
828
  // CONCATENATED MODULE: external "lodash/isArray"
827
829
  const m = require("lodash/isArray");
828
- var b = r.n(m);
830
+ var h = r.n(m);
829
831
  // CONCATENATED MODULE: external "lodash/isEmpty"
830
- const h = require("lodash/isEmpty");
831
- var g = r.n(h);
832
+ const g = require("lodash/isEmpty");
833
+ var S = r.n(g);
832
834
  // CONCATENATED MODULE: external "lodash/isNumber"
833
- const S = require("lodash/isNumber");
834
- var k = r.n(S);
835
+ const k = require("lodash/isNumber");
836
+ var O = r.n(k);
835
837
  // CONCATENATED MODULE: external "lodash/isObject"
836
- const O = require("lodash/isObject");
837
- var w = r.n(O);
838
+ const w = require("lodash/isObject");
839
+ var I = r.n(w);
838
840
  // CONCATENATED MODULE: external "lodash/keys"
839
- const I = require("lodash/keys");
840
- var x = r.n(I);
841
+ const x = require("lodash/keys");
842
+ var C = r.n(x);
841
843
  // CONCATENATED MODULE: external "lodash/repeat"
842
- const C = require("lodash/repeat");
843
- var j = r.n(C);
844
+ const j = require("lodash/repeat");
845
+ var E = r.n(j);
844
846
  // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
845
- const E = require("@splunk/ui-utils/i18n");
847
+ const T = require("@splunk/ui-utils/i18n");
846
848
  // EXTERNAL MODULE: external "@splunk/ui-utils/keyboard"
847
- var T = r(5295);
849
+ var P = r(5295);
848
850
  // EXTERNAL MODULE: ./src/Tree/index.ts + 7 modules
849
- var P = r(8655);
851
+ var A = r(8655);
850
852
  // CONCATENATED MODULE: ./src/JSONTree/JSONTreeItem.tsx
851
- function A() {
852
- return A = Object.assign ? Object.assign.bind() : function(e) {
853
+ function R() {
854
+ return R = Object.assign ? Object.assign.bind() : function(e) {
853
855
  for (var n = 1; n < arguments.length; n++) {
854
856
  var r = arguments[n];
855
857
  for (var t in r) {
@@ -857,29 +859,29 @@
857
859
  }
858
860
  }
859
861
  return e;
860
- }, A.apply(null, arguments);
862
+ }, R.apply(null, arguments);
861
863
  }
862
- function R(e, n) {
863
- return V(e) || N(e, n) || D(e, n) || K();
864
+ function D(e, n) {
865
+ return L(e) || V(e, n) || _(e, n) || K();
864
866
  }
865
867
  function K() {
866
868
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
867
869
  }
868
- function D(e, n) {
870
+ function _(e, n) {
869
871
  if (e) {
870
- if ("string" == typeof e) return _(e, n);
872
+ if ("string" == typeof e) return N(e, n);
871
873
  var r = {}.toString.call(e).slice(8, -1);
872
- return "Object" === r && e.constructor && (r = e.constructor.name), "Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? _(e, n) : void 0;
874
+ return "Object" === r && e.constructor && (r = e.constructor.name), "Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? N(e, n) : void 0;
873
875
  }
874
876
  }
875
- function _(e, n) {
877
+ function N(e, n) {
876
878
  (null == n || n > e.length) && (n = e.length);
877
879
  for (var r = 0, t = Array(n); r < n; r++) {
878
880
  t[r] = e[r];
879
881
  }
880
882
  return t;
881
883
  }
882
- function N(e, n) {
884
+ function V(e, n) {
883
885
  var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
884
886
  if (null != r) {
885
887
  var t, o, a, i, l = [], u = !0, c = !1;
@@ -901,12 +903,12 @@
901
903
  return l;
902
904
  }
903
905
  }
904
- function V(e) {
906
+ function L(e) {
905
907
  if (Array.isArray(e)) return e;
906
908
  }
907
- function L(e, n) {
909
+ function q(e, n) {
908
910
  if (null == e) return {};
909
- var r, t, o = q(e, n);
911
+ var r, t, o = F(e, n);
910
912
  if (Object.getOwnPropertySymbols) {
911
913
  var a = Object.getOwnPropertySymbols(e);
912
914
  for (t = 0; t < a.length; t++) {
@@ -915,7 +917,7 @@
915
917
  }
916
918
  return o;
917
919
  }
918
- function q(e, n) {
920
+ function F(e, n) {
919
921
  if (null == e) return {};
920
922
  var r = {};
921
923
  for (var t in e) {
@@ -926,13 +928,14 @@
926
928
  }
927
929
  return r;
928
930
  }
929
- var F = {
931
+ var M = {
930
932
  clickableKeyRef: a().object,
931
933
  clickableValRef: a().object,
932
934
  hasChildren: a().bool,
933
935
  indentArray: a().arrayOf(a().string),
934
936
  index: a().number,
935
937
  initialOpenState: a().bool,
938
+ isRoot: a().bool,
936
939
  properties: a().arrayOf(a().string),
937
940
  propertyDataPath: a().string,
938
941
  propertyElement: a().node,
@@ -940,43 +943,43 @@
940
943
  representation: a().node,
941
944
  value: a().oneOfType([ a().string, a().object, a().array, a().number, a().bool ])
942
945
  };
943
- function M(r) {
944
- var t = r.clickableKeyRef, o = r.clickableValRef, a = r.hasChildren, i = r.indentArray, l = r.index, u = r.initialOpenState, c = r.onFocus, f = r.properties, d = r.propertyDataPath, s = r.propertyElement, v = r.renderExpandLink, p = r.representation, y = r.value, m = L(r, [ "clickableKeyRef", "clickableValRef", "hasChildren", "indentArray", "index", "initialOpenState", "onFocus", "properties", "propertyDataPath", "propertyElement", "renderExpandLink", "representation", "value" ]);
945
- var h = (0, e.useState)(u), g = R(h, 2), S = g[0], k = g[1];
946
- var O = (0, e.useCallback)((function() {
947
- k((function(e) {
946
+ function $(r) {
947
+ var t = r.clickableKeyRef, o = r.clickableValRef, a = r.hasChildren, i = r.indentArray, l = r.index, u = r.initialOpenState, c = r.isRoot, f = r.onFocus, d = r.properties, s = r.propertyDataPath, v = r.propertyElement, p = r.renderExpandLink, y = r.representation, b = r.value, m = q(r, [ "clickableKeyRef", "clickableValRef", "hasChildren", "indentArray", "index", "initialOpenState", "isRoot", "onFocus", "properties", "propertyDataPath", "propertyElement", "renderExpandLink", "representation", "value" ]);
948
+ var g = (0, e.useState)(u), S = D(g, 2), k = S[0], O = S[1];
949
+ var w = (0, e.useCallback)((function() {
950
+ O((function(e) {
948
951
  return !e;
949
952
  }));
950
953
  }), []);
951
- var w = (0, e.useRef)(null);
952
- var I = v ? v({
953
- onToggleExpansion: O,
954
- open: S,
954
+ var I = (0, e.useRef)(null);
955
+ var x = p ? p({
956
+ onToggleExpansion: w,
957
+ open: k,
955
958
  withTooltip: true,
956
- expandLinkRef: w
959
+ expandLinkRef: I
957
960
  }) : {
958
961
  expandLink: undefined
959
- }, x = I.expandLink;
960
- var C = (f === null || f === void 0 ? void 0 : f.length) && l + 1 < (f === null || f === void 0 ? void 0 : f.length) ? "," : null;
962
+ }, C = x.expandLink;
963
+ var j = (d === null || d === void 0 ? void 0 : d.length) && l + 1 < (d === null || d === void 0 ? void 0 : d.length) ? "," : null;
961
964
 
962
- return n().createElement(P["default"].Item, A({
963
- content: n().createElement(n().Fragment, null, s, a && (b()(y) ? "[" : "{"), !a && n().createElement(n().Fragment, null, p, C), a && x),
965
+ return n().createElement(A["default"].Item, R({
966
+ content: n().createElement(n().Fragment, null, v, a && (h()(b) ? "[" : "{"), !a && n().createElement(n().Fragment, null, y, j), a && C),
964
967
  customIndent: i,
965
968
  "data-test": a ? "node" : null,
966
- "data-test-path": d,
967
- endAdornment: a && n().createElement(n().Fragment, null, S && i, b()(y) ? "]" : "}", C),
968
- expanded: S,
969
+ "data-test-path": s,
970
+ endAdornment: a && n().createElement(n().Fragment, null, k && i, h()(b) ? "]" : "}", j),
971
+ expanded: k,
969
972
  onFocus: function e(n) {
970
- c === null || c === void 0 ? void 0 : c(n);
973
+ f === null || f === void 0 ? void 0 : f(n);
971
974
  // check if onFocus was triggered by a click event or expand link
972
- var r = n.relatedTarget === (t === null || t === void 0 ? void 0 : t.current) || n.relatedTarget === (o === null || o === void 0 ? void 0 : o.current) || n.relatedTarget === (w === null || w === void 0 ? void 0 : w.current) ? n.relatedTarget : null;
973
- if (m.id === "root") {
975
+ var r = n.relatedTarget === (t === null || t === void 0 ? void 0 : t.current) || n.relatedTarget === (o === null || o === void 0 ? void 0 : o.current) || n.relatedTarget === (I === null || I === void 0 ? void 0 : I.current) ? n.relatedTarget : null;
976
+ if (c) {
974
977
  var a;
975
- w === null || w === void 0 ? void 0 : (a = w.current) === null || a === void 0 ? void 0 : a.focus();
978
+ I === null || I === void 0 ? void 0 : (a = I.current) === null || a === void 0 ? void 0 : a.focus();
976
979
  }
977
980
  if (!r) {
978
981
  // if JSONTreeItem contains clickable keys/vals, focus should go there
979
- if (s && (t === null || t === void 0 ? void 0 : t.current)) {
982
+ if (v && (t === null || t === void 0 ? void 0 : t.current)) {
980
983
  var i;
981
984
  (i = t.current) === null || i === void 0 ? void 0 : i.focus();
982
985
  } else if (o === null || o === void 0 ? void 0 : o.current) {
@@ -987,136 +990,136 @@
987
990
  r.focus();
988
991
  }
989
992
  },
990
- onToggleExpansion: O,
993
+ onToggleExpansion: w,
991
994
  tabIndex: 0
992
- }, m), a && p);
995
+ }, m), a && y);
993
996
  }
994
- M.propTypes = F;
997
+ $.propTypes = M;
995
998
  // CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
996
- const $ = require("@splunk/react-ui/Clickable");
997
- var J = r.n($);
999
+ const J = require("@splunk/react-ui/Clickable");
1000
+ var U = r.n(J);
998
1001
  // CONCATENATED MODULE: external "@splunk/react-ui/Tooltip"
999
- const U = require("@splunk/react-ui/Tooltip");
1000
- var H = r.n(U);
1002
+ const H = require("@splunk/react-ui/Tooltip");
1003
+ var B = r.n(H);
1001
1004
  // CONCATENATED MODULE: ./src/JSONTree/JSONTreeItemStyles.ts
1002
- var B = {
1003
- string: f.variables.syntaxTeal,
1004
- number: f.variables.syntaxBlue,
1005
- boolean: f.variables.syntaxPurple,
1006
- null: f.variables.syntaxBrown,
1007
- object: f.variables.contentColorDefault
1005
+ var X = {
1006
+ string: d.variables.syntaxTeal,
1007
+ number: d.variables.syntaxBlue,
1008
+ boolean: d.variables.syntaxPurple,
1009
+ null: d.variables.syntaxBrown,
1010
+ object: d.variables.contentColorDefault
1008
1011
  };
1009
- var X = (0, u.css)([ "word-break:break-word;word-wrap:break-word;" ]);
1010
- var W = (0, u.css)([ "white-space:nowrap;" ]);
1011
- var z = (0, u.css)([ "color:", ";", ";" ], (function(e) {
1012
+ var W = (0, c.css)([ "word-break:break-word;word-wrap:break-word;" ]);
1013
+ var z = (0, c.css)([ "white-space:nowrap;" ]);
1014
+ var G = (0, c.css)([ "color:", ";", ";" ], (function(e) {
1012
1015
  var n = e.valueType;
1013
- return B[n];
1016
+ return X[n];
1014
1017
  }), (function(e) {
1015
1018
  var n = e.overflowType;
1016
- return n === "wrap" ? X : W;
1019
+ return n === "wrap" ? W : z;
1017
1020
  }));
1018
- var G = c().span.withConfig({
1021
+ var Q = f().span.withConfig({
1019
1022
  displayName: "JSONTreeItemStyles__StyledValue",
1020
1023
  componentId: "o558h3-0"
1021
- })([ "", "" ], z);
1022
- var Q = c()(J()).withConfig({
1024
+ })([ "", "" ], G);
1025
+ var Y = f()(U()).withConfig({
1023
1026
  displayName: "JSONTreeItemStyles__StyledValueInteractiveClickable",
1024
1027
  componentId: "o558h3-1"
1025
- })([ "", " font-family:inherit;&:focus{box-shadow:0 0 1px 3px ", ";outline:0;&:active{box-shadow:none;}}&:hover{background-color:", ";}" ], z, f.variables.focusColor, (0,
1026
- f.pick)({
1027
- enterprise: f.variables.backgroundColorHover,
1028
- prisma: f.variables.interactiveColorOverlayHover
1028
+ })([ "", " font-family:inherit;&:focus{box-shadow:0 0 1px 3px ", ";outline:0;&:active{box-shadow:none;}}&:hover{background-color:", ";}" ], G, d.variables.focusColor, (0,
1029
+ d.pick)({
1030
+ enterprise: d.variables.backgroundColorHover,
1031
+ prisma: d.variables.interactiveColorOverlayHover
1029
1032
  }));
1030
- var Y = (0, u.css)([ "font-weight:bold;color:", ";" ], (0, f.pick)({
1033
+ var Z = (0, c.css)([ "font-weight:bold;color:", ";" ], (0, d.pick)({
1031
1034
  enterprise: {
1032
1035
  dark: "#ec9f98",
1033
- light: f.variables.syntaxRed
1036
+ light: d.variables.syntaxRed
1034
1037
  },
1035
- prisma: f.variables.syntaxRed
1038
+ prisma: d.variables.syntaxRed
1036
1039
  }));
1037
- var Z = c().span.withConfig({
1040
+ var ee = f().span.withConfig({
1038
1041
  displayName: "JSONTreeItemStyles__StyledProperty",
1039
1042
  componentId: "o558h3-2"
1040
- })([ "", "" ], Y);
1041
- var ee = c()(J()).withConfig({
1043
+ })([ "", "" ], Z);
1044
+ var ne = f()(U()).withConfig({
1042
1045
  displayName: "JSONTreeItemStyles__StyledPropertyInteractiveClickable",
1043
1046
  componentId: "o558h3-3"
1044
- })([ "", " font-family:inherit;&:focus{box-shadow:0 0 1px 3px ", ";outline:0;&:active{box-shadow:none;}}&:hover{background-color:", ";}" ], Y, f.variables.focusColor, (0,
1045
- f.pick)({
1046
- enterprise: f.variables.backgroundColorHover,
1047
- prisma: f.variables.interactiveColorOverlayHover
1047
+ })([ "", " font-family:inherit;&:focus{box-shadow:0 0 1px 3px ", ";outline:0;&:active{box-shadow:none;}}&:hover{background-color:", ";}" ], Z, d.variables.focusColor, (0,
1048
+ d.pick)({
1049
+ enterprise: d.variables.backgroundColorHover,
1050
+ prisma: d.variables.interactiveColorOverlayHover
1048
1051
  }));
1049
- var ne = c()(J()).withConfig({
1052
+ var re = f()(U()).withConfig({
1050
1053
  displayName: "JSONTreeItemStyles__StyledExpandLinkClickable",
1051
1054
  componentId: "o558h3-4"
1052
1055
  })([ "cursor:pointer;color:", ";font-family:inherit;&:hover{background-color:", ";text-decoration:none;}&:focus{box-shadow:", ";&:active{box-shadow:none;}}", "" ], (0,
1053
- f.pick)({
1056
+ d.pick)({
1054
1057
  enterprise: {
1055
- dark: f.variables.accentColorL20,
1056
- light: f.variables.accentColorD20
1058
+ dark: d.variables.accentColorL20,
1059
+ light: d.variables.accentColorD20
1057
1060
  },
1058
- prisma: f.variables.interactiveColorPrimary
1059
- }), (0, f.pick)({
1060
- enterprise: f.variables.backgroundColorHover,
1061
- prisma: f.variables.interactiveColorOverlayHover
1062
- }), f.variables.focusShadowInset, (0, f.pick)({
1063
- prisma: (0, u.css)([ "border-radius:", ";" ], f.variables.borderRadius)
1061
+ prisma: d.variables.interactiveColorPrimary
1062
+ }), (0, d.pick)({
1063
+ enterprise: d.variables.backgroundColorHover,
1064
+ prisma: d.variables.interactiveColorOverlayHover
1065
+ }), d.variables.focusShadowInset, (0, d.pick)({
1066
+ prisma: (0, c.css)([ "border-radius:", ";" ], d.variables.borderRadius)
1064
1067
  }));
1065
- var re = c()(H()).withConfig({
1068
+ var te = f()(B()).withConfig({
1066
1069
  displayName: "JSONTreeItemStyles__StyledTooltip",
1067
1070
  componentId: "o558h3-5"
1068
- })([ "font-family:", ";" ], f.variables.monoFontFamily);
1071
+ })([ "font-family:", ";" ], d.variables.monoFontFamily);
1069
1072
  // CONCATENATED MODULE: ./src/JSONTree/renderTreeItems.tsx
1070
- function te(e) {
1073
+ function oe(e) {
1071
1074
  "@babel/helpers - typeof";
1072
- return te = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
1075
+ return oe = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
1073
1076
  return typeof e;
1074
1077
  } : function(e) {
1075
1078
  return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
1076
- }, te(e);
1079
+ }, oe(e);
1077
1080
  }
1078
- function oe(e) {
1079
- return ue(e) || le(e) || ie(e) || ae();
1081
+ function ae(e) {
1082
+ return ce(e) || ue(e) || le(e) || ie();
1080
1083
  }
1081
- function ae() {
1084
+ function ie() {
1082
1085
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1083
1086
  }
1084
- function ie(e, n) {
1087
+ function le(e, n) {
1085
1088
  if (e) {
1086
- if ("string" == typeof e) return ce(e, n);
1089
+ if ("string" == typeof e) return fe(e, n);
1087
1090
  var r = {}.toString.call(e).slice(8, -1);
1088
- return "Object" === r && e.constructor && (r = e.constructor.name), "Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? ce(e, n) : void 0;
1091
+ return "Object" === r && e.constructor && (r = e.constructor.name), "Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? fe(e, n) : void 0;
1089
1092
  }
1090
1093
  }
1091
- function le(e) {
1094
+ function ue(e) {
1092
1095
  if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
1093
1096
  }
1094
- function ue(e) {
1095
- if (Array.isArray(e)) return ce(e);
1097
+ function ce(e) {
1098
+ if (Array.isArray(e)) return fe(e);
1096
1099
  }
1097
- function ce(e, n) {
1100
+ function fe(e, n) {
1098
1101
  (null == n || n > e.length) && (n = e.length);
1099
1102
  for (var r = 0, t = Array(n); r < n; r++) {
1100
1103
  t[r] = e[r];
1101
1104
  }
1102
1105
  return t;
1103
1106
  }
1104
- function fe(r) {
1107
+ function de(r) {
1105
1108
  var t = r.id, o = r.childKey, a = r.index, i = r.value, l = r.properties, u = r.propertyDataPath, c = r.obj, f = r.renderValue, d = r.renderKey, s = r.getInitialOpenState, v = r.indentArray, p = r.renderExpandLink, y = r.onFocus;
1109
+ var b = (0, e.useRef)(null);
1106
1110
  var m = (0, e.useRef)(null);
1107
- var h = (0, e.useRef)(null);
1108
- var S = f({
1111
+ var g = f({
1109
1112
  key: o,
1110
1113
  value: i,
1111
- clickValueRef: m
1112
- }), k = S.representation, O = S.clickableValRef;
1113
- var I = !b()(c) ? d(o, h) : {
1114
+ clickValueRef: b
1115
+ }), k = g.representation, O = g.clickableValRef;
1116
+ var w = !h()(c) ? d(o, m) : {
1114
1117
  propertyElement: undefined,
1115
1118
  clickableKeyRef: undefined
1116
- }, x = I.propertyElement, C = I.clickableKeyRef;
1117
- var j = w()(i) && !g()(i) || b()(i) && i.length > 0;
1119
+ }, x = w.propertyElement, C = w.clickableKeyRef;
1120
+ var j = I()(i) && !S()(i) || h()(i) && i.length > 0;
1118
1121
 
1119
- return n().createElement(M, {
1122
+ return n().createElement($, {
1120
1123
  id: t,
1121
1124
  propertyDataPath: u,
1122
1125
  propertyElement: x,
@@ -1135,99 +1138,99 @@
1135
1138
  }
1136
1139
  });
1137
1140
  }
1138
- function de(r) {
1139
- var t = r.renderValue, o = r.obj;
1140
- var a = (0, e.useRef)(null);
1141
- var i = t({
1142
- value: o,
1143
- clickValueRef: a
1144
- }), l = i.representation;
1141
+ function se(r) {
1142
+ var t = r.baseId, o = r.renderValue, a = r.obj;
1143
+ var i = (0, e.useRef)(null);
1144
+ var l = o({
1145
+ value: a,
1146
+ clickValueRef: i
1147
+ }), u = l.representation;
1145
1148
 
1146
- return n().createElement(P["default"].Item, {
1147
- id: "0",
1149
+ return n().createElement(A["default"].Item, {
1150
+ id: "".concat(t, "-0"),
1148
1151
  "data-test-path": ".",
1149
- content: l
1152
+ content: u
1150
1153
  });
1151
1154
  }
1152
- function se(e) {
1153
- var r = e.defaultOpen, t = r === void 0 ? false : r, o = e.expandChildren, a = o === void 0 ? false : o, i = e.expandChildrenOnShiftKey, u = i === void 0 ? false : i, c = e.indent, f = c === void 0 ? 4 : c, d = e.indentLevel, s = d === void 0 ? 1 : d, v = e.obj, p = e.onClickKey, m = e.onClickValue, h = e.overflow, S = h === void 0 ? "scroll" : h, O = e.path, I = O === void 0 ? [] : O, C = e.shift, P = e.updateShift;
1154
- var A = y()(Array(s), j()(" ", f));
1155
- var R;
1155
+ function ve(e) {
1156
+ var r = e.baseId, t = e.defaultOpen, o = t === void 0 ? false : t, a = e.expandChildren, i = a === void 0 ? false : a, u = e.expandChildrenOnShiftKey, c = u === void 0 ? false : u, f = e.indent, d = f === void 0 ? 4 : f, s = e.indentLevel, v = s === void 0 ? 1 : s, p = e.obj, y = e.onClickKey, m = e.onClickValue, g = e.overflow, k = g === void 0 ? "scroll" : g, w = e.path, x = w === void 0 ? [] : w, j = e.shift, A = e.updateShift;
1157
+ var R = b()(Array(v), E()(" ", d));
1158
+ var D;
1156
1159
  var K;
1157
- var D = function e() {
1158
- if (a === true) {
1159
- return t;
1160
+ var _ = function e() {
1161
+ if (i === true) {
1162
+ return o;
1160
1163
  }
1161
- if (a === "withShiftModifier" || u) {
1162
- return !!C;
1164
+ if (i === "withShiftModifier" || c) {
1165
+ return !!j;
1163
1166
  }
1164
1167
  return false;
1165
1168
  };
1166
- var _ = function e(n) {
1167
- if (a === "withShiftModifier" || u) {
1168
- if (P != null) {
1169
- P(n.shiftKey);
1169
+ var N = function e(n) {
1170
+ if (i === "withShiftModifier" || c) {
1171
+ if (A != null) {
1172
+ A(n.shiftKey);
1170
1173
  }
1171
1174
  }
1172
1175
  };
1173
- var N = function e(n, r) {
1176
+ var V = function e(n, r) {
1174
1177
  var t, o;
1175
1178
  // When rendering a single value key is not present, here we prevent `[undefined]` in path
1176
- var a = r !== undefined ? [].concat(oe(I), [ r ]) : oe(I);
1179
+ var a = r !== undefined ? [].concat(ae(x), [ r ]) : ae(x);
1177
1180
  var i = ".".concat(a.join("."));
1178
1181
  (t = K) === null || t === void 0 ? void 0 : (o = t.current) === null || o === void 0 ? void 0 : o.focus();
1179
- p === null || p === void 0 ? void 0 : p(n, {
1182
+ y === null || y === void 0 ? void 0 : y(n, {
1180
1183
  key: i,
1181
1184
  keyPath: a
1182
1185
  });
1183
1186
  };
1184
- var V = function e(n, r) {
1187
+ var L = function e(n, r) {
1185
1188
  var t, o;
1186
1189
  // When rendering a single value key is not present, here we prevent `[undefined]` in path
1187
- var a = r !== undefined ? [].concat(oe(I), [ r ]) : oe(I);
1190
+ var a = r !== undefined ? [].concat(ae(x), [ r ]) : ae(x);
1188
1191
  var i = ".".concat(a.join("."));
1189
- (t = R) === null || t === void 0 ? void 0 : (o = t.current) === null || o === void 0 ? void 0 : o.focus();
1192
+ (t = D) === null || t === void 0 ? void 0 : (o = t.current) === null || o === void 0 ? void 0 : o.focus();
1190
1193
  m === null || m === void 0 ? void 0 : m(n, {
1191
1194
  key: i,
1192
1195
  keyPath: a,
1193
1196
  value: n.target.textContent
1194
1197
  });
1195
1198
  };
1196
- var L = function e(n, r) {
1199
+ var q = function e(n, r) {
1197
1200
  var t, o;
1198
- var a = (0, T.keycode)(n.nativeEvent);
1199
- if (a === "left" && p && ((t = K) === null || t === void 0 ? void 0 : t.current) && !r) {
1201
+ var a = (0, P.keycode)(n.nativeEvent);
1202
+ if (a === "left" && y && ((t = K) === null || t === void 0 ? void 0 : t.current) && !r) {
1200
1203
  var i;
1201
1204
  n.stopPropagation();
1202
1205
  (i = K.current) === null || i === void 0 ? void 0 : i.focus();
1203
1206
  }
1204
- if (a === "right" && m && ((o = R) === null || o === void 0 ? void 0 : o.current) && r) {
1207
+ if (a === "right" && m && ((o = D) === null || o === void 0 ? void 0 : o.current) && r) {
1205
1208
  var l;
1206
1209
  n.stopPropagation();
1207
- (l = R.current) === null || l === void 0 ? void 0 : l.focus();
1210
+ (l = D.current) === null || l === void 0 ? void 0 : l.focus();
1208
1211
  }
1209
1212
  };
1210
- var q = function e(r) {
1213
+ var F = function e(r) {
1211
1214
  var t = r.onToggleExpansion, o = r.open, a = r.withTooltip, i = r.expandLinkRef;
1212
1215
  var l = o ? "[-]" : "[+]";
1213
- var c = o ? (0, E._)("Collapse all") : (0, E._)("Shift click to expand all");
1214
- var f = n().createElement(ne, {
1216
+ var u = o ? (0, T._)("Collapse all") : (0, T._)("Shift click to expand all");
1217
+ var f = n().createElement(re, {
1215
1218
  elementRef: i,
1216
1219
  tabIndex: -1,
1217
1220
  onClick: function e(n) {
1218
- _(n);
1221
+ N(n);
1219
1222
  t === null || t === void 0 ? void 0 : t(n);
1220
1223
  },
1221
1224
  "aria-expanded": o,
1222
1225
  "data-test": "toggle"
1223
1226
  }, " ", l, " ");
1224
- if (u && a) {
1227
+ if (c && a) {
1225
1228
  return {
1226
- expandLink: n().createElement(re, {
1229
+ expandLink: n().createElement(te, {
1227
1230
  contentRelationship: "description",
1228
1231
  openDelay: "secondary",
1229
1232
  defaultPlacement: "above",
1230
- content: (0, E._)(c)
1233
+ content: (0, T._)(u)
1231
1234
  }, f),
1232
1235
  expandLinkRef: i
1233
1236
  };
@@ -1237,144 +1240,147 @@
1237
1240
  expandLinkRef: i
1238
1241
  };
1239
1242
  };
1240
- var F = function e(r) {
1241
- var t = r.value, o = r.key, i = r.clickValueRef;
1242
- var c;
1243
- if (!w()(t)) {
1244
- if (typeof t === "string") {
1245
- c = '"'.concat(t, '"');
1246
- } else if (typeof t === "boolean") {
1247
- c = t.toString();
1248
- } else if (t === null) {
1249
- c = "null";
1243
+ var M = function e(t) {
1244
+ var o = t.value, a = t.key, u = t.clickValueRef;
1245
+ var f;
1246
+ if (!I()(o)) {
1247
+ if (typeof o === "string") {
1248
+ f = '"'.concat(o, '"');
1249
+ } else if (typeof o === "boolean") {
1250
+ f = o.toString();
1251
+ } else if (o === null) {
1252
+ f = "null";
1250
1253
  } else {
1251
- c = t;
1254
+ f = o;
1252
1255
  }
1253
- } else if (g()(t)) {
1256
+ } else if (S()(o)) {
1254
1257
  // isObject is true for arrays
1255
- c = b()(t) ? "[]" : "{}";
1258
+ f = h()(o) ? "[]" : "{}";
1256
1259
  } else {
1257
- c = se({
1258
- defaultOpen: a === true,
1259
- expandChildren: a,
1260
- expandChildrenOnShiftKey: u,
1261
- onClickKey: p,
1260
+ f = ve({
1261
+ baseId: r,
1262
+ defaultOpen: i === true,
1263
+ expandChildren: i,
1264
+ expandChildrenOnShiftKey: c,
1265
+ onClickKey: y,
1262
1266
  onClickValue: m,
1263
- overflow: S,
1264
- obj: t,
1265
- path: o !== undefined ? [].concat(oe(I), [ o ]) : oe(I),
1266
- indentLevel: s + 1,
1267
- shift: C,
1268
- updateShift: P
1267
+ overflow: k,
1268
+ obj: o,
1269
+ path: a !== undefined ? [].concat(ae(x), [ a ]) : ae(x),
1270
+ indentLevel: v + 1,
1271
+ shift: j,
1272
+ updateShift: A
1269
1273
  });
1270
1274
  }
1271
- if (l()(c) || k()(c)) {
1272
- var f = t === null ? "null" : // TS: bigint, function, symbol are prevented by JSONElement type
1273
- te(t);
1275
+ if (l()(f) || O()(f)) {
1276
+ var d = o === null ? "null" : // TS: bigint, function, symbol are prevented by JSONElement type
1277
+ oe(o);
1274
1278
  if (m) {
1275
1279
  return {
1276
- representation: n().createElement(Q, {
1277
- elementRef: i,
1278
- valueType: f,
1279
- overflowType: S,
1280
+ representation: n().createElement(Y, {
1281
+ elementRef: u,
1282
+ valueType: d,
1283
+ overflowType: k,
1280
1284
  onClick: function e(n) {
1281
- R = i;
1282
- V(n, o);
1285
+ D = u;
1286
+ L(n, a);
1283
1287
  },
1284
1288
  onKeyDown: function e(n) {
1285
- L(n, false);
1289
+ q(n, false);
1286
1290
  },
1287
1291
  tabIndex: -1
1288
- }, c),
1289
- clickableValRef: i
1292
+ }, f),
1293
+ clickableValRef: u
1290
1294
  };
1291
1295
  }
1292
1296
  return {
1293
- representation: n().createElement(G, {
1294
- valueType: f,
1295
- overflowType: S
1296
- }, c)
1297
+ representation: n().createElement(Q, {
1298
+ valueType: d,
1299
+ overflowType: k
1300
+ }, f)
1297
1301
  };
1298
1302
  }
1299
1303
  return {
1300
- representation: c
1304
+ representation: f
1301
1305
  };
1302
1306
  };
1303
- var $ = function e(r, t) {
1304
- if (p) {
1307
+ var J = function e(r, t) {
1308
+ if (y) {
1305
1309
  return {
1306
- propertyElement: n().createElement("span", null, n().createElement(ee, {
1310
+ propertyElement: n().createElement("span", null, n().createElement(ne, {
1307
1311
  elementRef: t,
1308
1312
  tabIndex: -1,
1309
1313
  onClick: function e(n) {
1310
1314
  K = t;
1311
- N(n, r);
1315
+ V(n, r);
1312
1316
  },
1313
1317
  onKeyDown: function e(n) {
1314
- L(n, true);
1318
+ q(n, true);
1315
1319
  }
1316
1320
  }, r), ":", " "),
1317
1321
  clickableKeyRef: t
1318
1322
  };
1319
1323
  }
1320
1324
  return {
1321
- propertyElement: n().createElement("span", null, n().createElement(Z, null, r), ":", " ")
1325
+ propertyElement: n().createElement("span", null, n().createElement(ee, null, r), ":", " ")
1322
1326
  };
1323
1327
  };
1324
- if (w()(v) && !g()(v) || b()(v) && v.length > 0) {
1325
- var J = x()(v).map((function(e, r, t) {
1326
- var o = v[e];
1328
+ if (I()(p) && !S()(p) || h()(p) && p.length > 0) {
1329
+ var U = C()(p).map((function(e, t, o) {
1330
+ var a = p[e];
1327
1331
  // TS: should be safe based on (recursive) JSONElement type
1328
- var a = b()(v) ? parseInt(e, 10) : e;
1329
- var i = I.length === 0 ? ".".concat(a) : ".".concat(I.join("."), ".").concat(a);
1332
+ var i = h()(p) ? parseInt(e, 10) : e;
1333
+ var l = x.length === 0 ? ".".concat(i) : ".".concat(x.join("."), ".").concat(i);
1330
1334
 
1331
- return n().createElement(fe, {
1332
- id: i,
1333
- key: i,
1334
- propertyDataPath: i,
1335
- childKey: a,
1336
- index: r,
1337
- value: o,
1338
- properties: t,
1339
- obj: v,
1340
- renderValue: F,
1341
- renderKey: $,
1342
- getInitialOpenState: D,
1343
- indentArray: A,
1344
- renderExpandLink: q,
1335
+ return n().createElement(de, {
1336
+ id: "".concat(r, "-").concat(l),
1337
+ key: l,
1338
+ propertyDataPath: l,
1339
+ childKey: i,
1340
+ index: t,
1341
+ value: a,
1342
+ properties: o,
1343
+ obj: p,
1344
+ renderValue: M,
1345
+ renderKey: J,
1346
+ getInitialOpenState: _,
1347
+ indentArray: R,
1348
+ renderExpandLink: F,
1345
1349
  onFocus: function e(n, r) {
1346
1350
  K = n;
1347
- R = r;
1351
+ D = r;
1348
1352
  }
1349
1353
  });
1350
1354
  }));
1351
- if (I.length === 0) {
1352
- var U = w()(v) && !g()(v) || b()(v) && v.length > 0;
1355
+ if (x.length === 0) {
1356
+ var H = I()(p) && !S()(p) || h()(p) && p.length > 0;
1353
1357
 
1354
- return n().createElement(M, {
1355
- id: "root",
1358
+ return n().createElement($, {
1359
+ id: "".concat(r, "-root"),
1360
+ isRoot: true,
1356
1361
  propertyDataPath: ".",
1357
1362
  key: ".",
1358
- hasChildren: U,
1359
- initialOpenState: t,
1360
- value: v,
1363
+ hasChildren: H,
1364
+ initialOpenState: o,
1365
+ value: p,
1361
1366
  index: 0,
1362
- renderExpandLink: q,
1363
- representation: J
1367
+ renderExpandLink: F,
1368
+ representation: U
1364
1369
  });
1365
1370
  }
1366
- return J;
1371
+ return U;
1367
1372
  }
1368
1373
  // edge case: a single number/string/boolean being rendered (still valid JSON)
1369
1374
 
1370
- return n().createElement(de, {
1371
- obj: v,
1372
- renderValue: F
1375
+ return n().createElement(se, {
1376
+ baseId: r,
1377
+ obj: p,
1378
+ renderValue: M
1373
1379
  });
1374
1380
  }
1375
1381
  // CONCATENATED MODULE: ./src/JSONTree/JSONTree.tsx
1376
- function ve() {
1377
- return ve = Object.assign ? Object.assign.bind() : function(e) {
1382
+ function pe() {
1383
+ return pe = Object.assign ? Object.assign.bind() : function(e) {
1378
1384
  for (var n = 1; n < arguments.length; n++) {
1379
1385
  var r = arguments[n];
1380
1386
  for (var t in r) {
@@ -1382,29 +1388,29 @@
1382
1388
  }
1383
1389
  }
1384
1390
  return e;
1385
- }, ve.apply(null, arguments);
1391
+ }, pe.apply(null, arguments);
1386
1392
  }
1387
- function pe(e, n) {
1388
- return ge(e) || he(e, n) || me(e, n) || ye();
1393
+ function ye(e, n) {
1394
+ return Se(e) || ge(e, n) || me(e, n) || be();
1389
1395
  }
1390
- function ye() {
1396
+ function be() {
1391
1397
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1392
1398
  }
1393
1399
  function me(e, n) {
1394
1400
  if (e) {
1395
- if ("string" == typeof e) return be(e, n);
1401
+ if ("string" == typeof e) return he(e, n);
1396
1402
  var r = {}.toString.call(e).slice(8, -1);
1397
- return "Object" === r && e.constructor && (r = e.constructor.name), "Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? be(e, n) : void 0;
1403
+ return "Object" === r && e.constructor && (r = e.constructor.name), "Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? he(e, n) : void 0;
1398
1404
  }
1399
1405
  }
1400
- function be(e, n) {
1406
+ function he(e, n) {
1401
1407
  (null == n || n > e.length) && (n = e.length);
1402
1408
  for (var r = 0, t = Array(n); r < n; r++) {
1403
1409
  t[r] = e[r];
1404
1410
  }
1405
1411
  return t;
1406
1412
  }
1407
- function he(e, n) {
1413
+ function ge(e, n) {
1408
1414
  var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
1409
1415
  if (null != r) {
1410
1416
  var t, o, a, i, l = [], u = !0, c = !1;
@@ -1426,12 +1432,12 @@
1426
1432
  return l;
1427
1433
  }
1428
1434
  }
1429
- function ge(e) {
1435
+ function Se(e) {
1430
1436
  if (Array.isArray(e)) return e;
1431
1437
  }
1432
- function Se(e, n) {
1438
+ function ke(e, n) {
1433
1439
  if (null == e) return {};
1434
- var r, t, o = ke(e, n);
1440
+ var r, t, o = Oe(e, n);
1435
1441
  if (Object.getOwnPropertySymbols) {
1436
1442
  var a = Object.getOwnPropertySymbols(e);
1437
1443
  for (t = 0; t < a.length; t++) {
@@ -1440,7 +1446,7 @@
1440
1446
  }
1441
1447
  return o;
1442
1448
  }
1443
- function ke(e, n) {
1449
+ function Oe(e, n) {
1444
1450
  if (null == e) return {};
1445
1451
  var r = {};
1446
1452
  for (var t in e) {
@@ -1453,7 +1459,7 @@
1453
1459
  }
1454
1460
  /** @public */
1455
1461
  /** @public */
1456
- /** @public */ var Oe = {
1462
+ /** @public */ var we = {
1457
1463
  elementRef: a().oneOfType([ a().func, a().object ]),
1458
1464
  expandChildren: a().oneOfType([ a().bool, a().oneOf([ "withShiftModifier" ]) ]),
1459
1465
  indent: a().number,
@@ -1465,38 +1471,45 @@
1465
1471
  };
1466
1472
  /**
1467
1473
  * Used to visualize a JSON string.
1468
- */ function we(r) {
1469
- var t = r.elementRef, o = r.expandChildren, a = o === void 0 ? false : o, i = r.indent, u = i === void 0 ? 4 : i, c = r.json, f = r.onClickKey, d = r.onClickValue, p = r.overflow, y = p === void 0 ? "scroll" : p, m = r.expandChildrenOnShiftKey, b = m === void 0 ? false : m, h = Se(r, [ "elementRef", "expandChildren", "indent", "json", "onClickKey", "onClickValue", "overflow", "expandChildrenOnShiftKey" ]);
1474
+ */ function Ie(r) {
1475
+ var t = r.elementRef, o = r.expandChildren, a = o === void 0 ? false : o, i = r.indent, c = i === void 0 ? 4 : i, f = r.json, d = r.onClickKey, s = r.onClickValue, y = r.overflow, b = y === void 0 ? "scroll" : y, m = r.expandChildrenOnShiftKey, h = m === void 0 ? false : m, g = ke(r, [ "elementRef", "expandChildren", "indent", "json", "onClickKey", "onClickValue", "overflow", "expandChildrenOnShiftKey" ]);
1470
1476
  // @docs-props-type JSONTreePropsBase
1471
- var g = l()(c) ? JSON.parse(c) : c;
1472
- var S = y === "wrap" ? v : s;
1473
- var k = (0, e.useState)(undefined), O = pe(k, 2), w = O[0], I = O[1];
1474
- var x = function e(n) {
1475
- I(n);
1476
- };
1477
+ var S = (0, e.useMemo)((function() {
1478
+ return g.id || (0, u.createDOMID)("json-tree");
1479
+ }), [ g.id ]);
1480
+ var k = l()(f) ? JSON.parse(f) : f;
1481
+ var O = b === "wrap" ? p : v;
1482
+ var w = (0, e.useState)(undefined), I = ye(w, 2), x = I[0], C = I[1];
1483
+ var j = (0, e.useCallback)((function(e) {
1484
+ C(e);
1485
+ }), []);
1486
+ var E = (0, e.useMemo)((function() {
1487
+ return ve({
1488
+ baseId: S,
1489
+ defaultOpen: true,
1490
+ expandChildren: a,
1491
+ expandChildrenOnShiftKey: h,
1492
+ indent: c,
1493
+ obj: k,
1494
+ onClickKey: d,
1495
+ onClickValue: s,
1496
+ overflow: b,
1497
+ shift: x,
1498
+ updateShift: j
1499
+ });
1500
+ }), [ S, a, h, c, k, d, s, b, x, j ]);
1477
1501
 
1478
- return n().createElement(S, ve({
1502
+ return n().createElement(O, pe({
1479
1503
  "data-language": "language-json",
1480
1504
  "data-test": "json-tree",
1481
1505
  ref: t,
1482
1506
  role: "tree"
1483
- }, h), n().createElement(P["default"], {
1507
+ }, g), n().createElement(A["default"], {
1484
1508
  defaultIndent: false
1485
- }, se({
1486
- defaultOpen: true,
1487
- expandChildren: a,
1488
- expandChildrenOnShiftKey: b,
1489
- indent: u,
1490
- obj: g,
1491
- onClickKey: f,
1492
- onClickValue: d,
1493
- overflow: y,
1494
- shift: w,
1495
- updateShift: x
1496
- })));
1509
+ }, E));
1497
1510
  }
1498
- we.propTypes = Oe;
1499
- /* harmony default export */ const Ie = we;
1511
+ Ie.propTypes = we;
1512
+ /* harmony default export */ const xe = Ie;
1500
1513
  }) // CONCATENATED MODULE: ./src/JSONTree/index.ts
1501
1514
  ();
1502
1515
  module.exports = t;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splunk/react-ui",
3
- "version": "4.47.0",
3
+ "version": "4.47.1",
4
4
  "description": "Library of React components that implement the Splunk design language",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Splunk Inc.",
@@ -20,6 +20,7 @@ interface JSONTreeItemPropsBase extends TreeItemPropsBase {
20
20
  indentArray?: string[];
21
21
  index: number;
22
22
  initialOpenState: boolean;
23
+ isRoot?: boolean;
23
24
  properties?: string[];
24
25
  propertyDataPath: string;
25
26
  propertyElement?: JSX.Element | undefined;
@@ -28,7 +29,7 @@ interface JSONTreeItemPropsBase extends TreeItemPropsBase {
28
29
  value?: JSONElement;
29
30
  }
30
31
  type JSONTreeItemProps = ComponentProps<JSONTreeItemPropsBase, 'li'>;
31
- export declare function JSONTreeItem({ clickableKeyRef, clickableValRef, hasChildren, indentArray, index, initialOpenState, onFocus, properties, propertyDataPath, propertyElement, renderExpandLink, representation, value, ...otherProps }: JSONTreeItemProps): JSX.Element;
32
+ export declare function JSONTreeItem({ clickableKeyRef, clickableValRef, hasChildren, indentArray, index, initialOpenState, isRoot, onFocus, properties, propertyDataPath, propertyElement, renderExpandLink, representation, value, ...otherProps }: JSONTreeItemProps): JSX.Element;
32
33
  export declare namespace JSONTreeItem {
33
34
  var propTypes: {
34
35
  clickableKeyRef: PropTypes.Requireable<object>;
@@ -37,6 +38,7 @@ export declare namespace JSONTreeItem {
37
38
  indentArray: PropTypes.Requireable<(string | null | undefined)[]>;
38
39
  index: PropTypes.Requireable<number>;
39
40
  initialOpenState: PropTypes.Requireable<boolean>;
41
+ isRoot: PropTypes.Requireable<boolean>;
40
42
  properties: PropTypes.Requireable<(string | null | undefined)[]>;
41
43
  propertyDataPath: PropTypes.Requireable<string>;
42
44
  propertyElement: PropTypes.Requireable<PropTypes.ReactNodeLike>;
@@ -1,5 +1,6 @@
1
1
  import { JSONElement, JSONTreeClickKeyHandler, JSONTreeClickValueHandler } from './JSONTree';
2
2
  type RenderTreeItemsProps = {
3
+ baseId: string;
3
4
  defaultOpen?: boolean;
4
5
  expandChildren?: boolean | 'withShiftModifier';
5
6
  expandChildrenOnShiftKey?: boolean;
@@ -13,5 +14,5 @@ type RenderTreeItemsProps = {
13
14
  shift?: boolean;
14
15
  updateShift: ((newShift: boolean) => void) | undefined;
15
16
  };
16
- export declare function renderTreeItems({ defaultOpen, expandChildren, expandChildrenOnShiftKey, indent, indentLevel, obj, onClickKey, onClickValue, overflow, path, shift, updateShift, }: RenderTreeItemsProps): JSX.Element | JSX.Element[];
17
+ export declare function renderTreeItems({ baseId, defaultOpen, expandChildren, expandChildrenOnShiftKey, indent, indentLevel, obj, onClickKey, onClickValue, overflow, path, shift, updateShift, }: RenderTreeItemsProps): JSX.Element | JSX.Element[];
17
18
  export {};