@uipath/apollo-wind 2.79.0 → 2.79.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/dist/components/ui/index.cjs +24 -24
- package/dist/components/ui/json-tree-view/EditorChrome.cjs +5 -2
- package/dist/components/ui/json-tree-view/EditorChrome.js +5 -2
- package/dist/components/ui/json-tree-view/JsonLeafValueEditor.cjs +6 -3
- package/dist/components/ui/json-tree-view/JsonLeafValueEditor.js +6 -3
- package/dist/components/ui/json-tree-view/JsonTree.cjs +66 -38
- package/dist/components/ui/json-tree-view/JsonTree.d.ts +6 -1
- package/dist/components/ui/json-tree-view/JsonTree.js +66 -38
- package/dist/components/ui/json-tree-view/JsonTree.types.d.ts +6 -1
- package/dist/components/ui/json-tree-view/JsonTreeRow.cjs +116 -81
- package/dist/components/ui/json-tree-view/JsonTreeRow.d.ts +16 -8
- package/dist/components/ui/json-tree-view/JsonTreeRow.js +116 -81
- package/dist/components/ui/json-tree-view/NodeKey.cjs +2 -2
- package/dist/components/ui/json-tree-view/NodeKey.js +2 -2
- package/dist/components/ui/json-tree-view/RowActions.cjs +6 -6
- package/dist/components/ui/json-tree-view/RowActions.js +6 -6
- package/dist/components/ui/json-tree-view/buildJsonTree.cjs +20 -1
- package/dist/components/ui/json-tree-view/buildJsonTree.d.ts +4 -0
- package/dist/components/ui/json-tree-view/buildJsonTree.js +20 -1
- package/dist/components/ui/json-tree-view/strings.cjs +2 -0
- package/dist/components/ui/json-tree-view/strings.d.ts +12 -0
- package/dist/components/ui/json-tree-view/strings.js +2 -0
- package/dist/components/ui/json-tree-view/treeGrid.cjs +306 -0
- package/dist/components/ui/json-tree-view/treeGrid.d.ts +36 -0
- package/dist/components/ui/json-tree-view/treeGrid.js +269 -0
- package/dist/components/ui/tool-call.cjs +2 -2
- package/dist/components/ui/tool-call.js +2 -2
- package/dist/lib/clipboard.cjs +4 -0
- package/dist/lib/clipboard.js +4 -0
- package/dist/lib/use-ancestor-density.cjs +2 -2
- package/dist/lib/use-ancestor-density.js +2 -2
- package/dist/lib/use-isomorphic-layout-effect.cjs +37 -0
- package/dist/lib/use-isomorphic-layout-effect.d.ts +3 -0
- package/dist/lib/use-isomorphic-layout-effect.js +3 -0
- package/dist/styles.css +13 -13
- package/package.json +1 -1
|
@@ -36,7 +36,7 @@ var __webpack_modules__ = {
|
|
|
36
36
|
"./button" (module) {
|
|
37
37
|
module.exports = require("./button.cjs");
|
|
38
38
|
},
|
|
39
|
-
"
|
|
39
|
+
"./calendar" (module) {
|
|
40
40
|
module.exports = require("./calendar.cjs");
|
|
41
41
|
},
|
|
42
42
|
"@/components/ui/card" (module) {
|
|
@@ -51,7 +51,7 @@ var __webpack_modules__ = {
|
|
|
51
51
|
"./chat-hero" (module) {
|
|
52
52
|
module.exports = require("./chat-hero.cjs");
|
|
53
53
|
},
|
|
54
|
-
"
|
|
54
|
+
"./checkbox" (module) {
|
|
55
55
|
module.exports = require("./checkbox.cjs");
|
|
56
56
|
},
|
|
57
57
|
"./citation" (module) {
|
|
@@ -60,7 +60,7 @@ var __webpack_modules__ = {
|
|
|
60
60
|
"@/components/ui/code-block" (module) {
|
|
61
61
|
module.exports = require("./code-block.cjs");
|
|
62
62
|
},
|
|
63
|
-
"
|
|
63
|
+
"@/components/ui/collapsible" (module) {
|
|
64
64
|
module.exports = require("./collapsible.cjs");
|
|
65
65
|
},
|
|
66
66
|
"./combobox" (module) {
|
|
@@ -90,7 +90,7 @@ var __webpack_modules__ = {
|
|
|
90
90
|
"./drawer" (module) {
|
|
91
91
|
module.exports = require("./drawer.cjs");
|
|
92
92
|
},
|
|
93
|
-
"
|
|
93
|
+
"@/components/ui/dropdown-menu" (module) {
|
|
94
94
|
module.exports = require("./dropdown-menu.cjs");
|
|
95
95
|
},
|
|
96
96
|
"./dropzone-overlay" (module) {
|
|
@@ -117,25 +117,25 @@ var __webpack_modules__ = {
|
|
|
117
117
|
"./form-field" (module) {
|
|
118
118
|
module.exports = require("./form-field.cjs");
|
|
119
119
|
},
|
|
120
|
-
"
|
|
120
|
+
"@/components/ui/hover-card" (module) {
|
|
121
121
|
module.exports = require("./hover-card.cjs");
|
|
122
122
|
},
|
|
123
|
-
"
|
|
123
|
+
"@/components/ui/info-tooltip" (module) {
|
|
124
124
|
module.exports = require("./info-tooltip.cjs");
|
|
125
125
|
},
|
|
126
126
|
"@/components/ui/input-group" (module) {
|
|
127
127
|
module.exports = require("./input-group.cjs");
|
|
128
128
|
},
|
|
129
|
-
"
|
|
129
|
+
"./input" (module) {
|
|
130
130
|
module.exports = require("./input.cjs");
|
|
131
131
|
},
|
|
132
132
|
"./json-tree-view" (module) {
|
|
133
133
|
module.exports = require("./json-tree-view/index.cjs");
|
|
134
134
|
},
|
|
135
|
-
"
|
|
135
|
+
"@/components/ui/label" (module) {
|
|
136
136
|
module.exports = require("./label.cjs");
|
|
137
137
|
},
|
|
138
|
-
"
|
|
138
|
+
"@/components/ui/layout" (module) {
|
|
139
139
|
module.exports = require("./layout/index.cjs");
|
|
140
140
|
},
|
|
141
141
|
"./live-region" (module) {
|
|
@@ -174,7 +174,7 @@ var __webpack_modules__ = {
|
|
|
174
174
|
"./panel-tabs" (module) {
|
|
175
175
|
module.exports = require("./panel-tabs.cjs");
|
|
176
176
|
},
|
|
177
|
-
"
|
|
177
|
+
"./popover" (module) {
|
|
178
178
|
module.exports = require("./popover.cjs");
|
|
179
179
|
},
|
|
180
180
|
"@/components/ui/portal-container" (module) {
|
|
@@ -249,7 +249,7 @@ var __webpack_modules__ = {
|
|
|
249
249
|
"./switch" (module) {
|
|
250
250
|
module.exports = require("./switch.cjs");
|
|
251
251
|
},
|
|
252
|
-
"
|
|
252
|
+
"./table" (module) {
|
|
253
253
|
module.exports = require("./table.cjs");
|
|
254
254
|
},
|
|
255
255
|
"./tabs" (module) {
|
|
@@ -270,7 +270,7 @@ var __webpack_modules__ = {
|
|
|
270
270
|
"./tool-call" (module) {
|
|
271
271
|
module.exports = require("./tool-call.cjs");
|
|
272
272
|
},
|
|
273
|
-
"
|
|
273
|
+
"@/components/ui/tooltip" (module) {
|
|
274
274
|
module.exports = require("./tooltip.cjs");
|
|
275
275
|
},
|
|
276
276
|
"./tree-view" (module) {
|
|
@@ -452,7 +452,7 @@ var __webpack_exports__ = {};
|
|
|
452
452
|
"ReferenceChip"
|
|
453
453
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_button_group__rspack_import_11[__rspack_import_key];
|
|
454
454
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
455
|
-
var _calendar__rspack_import_12 = __webpack_require__("
|
|
455
|
+
var _calendar__rspack_import_12 = __webpack_require__("./calendar");
|
|
456
456
|
var __rspack_reexport = {};
|
|
457
457
|
for(const __rspack_import_key in _calendar__rspack_import_12)if ([
|
|
458
458
|
"getReferenceChipColors",
|
|
@@ -502,7 +502,7 @@ var __webpack_exports__ = {};
|
|
|
502
502
|
"ReferenceChip"
|
|
503
503
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_chat_hero__rspack_import_16[__rspack_import_key];
|
|
504
504
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
505
|
-
var _checkbox__rspack_import_17 = __webpack_require__("
|
|
505
|
+
var _checkbox__rspack_import_17 = __webpack_require__("./checkbox");
|
|
506
506
|
var __rspack_reexport = {};
|
|
507
507
|
for(const __rspack_import_key in _checkbox__rspack_import_17)if ([
|
|
508
508
|
"getReferenceChipColors",
|
|
@@ -532,7 +532,7 @@ var __webpack_exports__ = {};
|
|
|
532
532
|
"ReferenceChip"
|
|
533
533
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_code_block__rspack_import_19[__rspack_import_key];
|
|
534
534
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
535
|
-
var _collapsible__rspack_import_20 = __webpack_require__("
|
|
535
|
+
var _collapsible__rspack_import_20 = __webpack_require__("@/components/ui/collapsible");
|
|
536
536
|
var __rspack_reexport = {};
|
|
537
537
|
for(const __rspack_import_key in _collapsible__rspack_import_20)if ([
|
|
538
538
|
"getReferenceChipColors",
|
|
@@ -632,7 +632,7 @@ var __webpack_exports__ = {};
|
|
|
632
632
|
"ReferenceChip"
|
|
633
633
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_drawer__rspack_import_29[__rspack_import_key];
|
|
634
634
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
635
|
-
var _dropdown_menu__rspack_import_30 = __webpack_require__("
|
|
635
|
+
var _dropdown_menu__rspack_import_30 = __webpack_require__("@/components/ui/dropdown-menu");
|
|
636
636
|
var __rspack_reexport = {};
|
|
637
637
|
for(const __rspack_import_key in _dropdown_menu__rspack_import_30)if ([
|
|
638
638
|
"getReferenceChipColors",
|
|
@@ -722,7 +722,7 @@ var __webpack_exports__ = {};
|
|
|
722
722
|
"ReferenceChip"
|
|
723
723
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_form_field__rspack_import_38[__rspack_import_key];
|
|
724
724
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
725
|
-
var _hover_card__rspack_import_39 = __webpack_require__("
|
|
725
|
+
var _hover_card__rspack_import_39 = __webpack_require__("@/components/ui/hover-card");
|
|
726
726
|
var __rspack_reexport = {};
|
|
727
727
|
for(const __rspack_import_key in _hover_card__rspack_import_39)if ([
|
|
728
728
|
"getReferenceChipColors",
|
|
@@ -732,7 +732,7 @@ var __webpack_exports__ = {};
|
|
|
732
732
|
"ReferenceChip"
|
|
733
733
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_hover_card__rspack_import_39[__rspack_import_key];
|
|
734
734
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
735
|
-
var _info_tooltip__rspack_import_40 = __webpack_require__("
|
|
735
|
+
var _info_tooltip__rspack_import_40 = __webpack_require__("@/components/ui/info-tooltip");
|
|
736
736
|
var __rspack_reexport = {};
|
|
737
737
|
for(const __rspack_import_key in _info_tooltip__rspack_import_40)if ([
|
|
738
738
|
"getReferenceChipColors",
|
|
@@ -742,7 +742,7 @@ var __webpack_exports__ = {};
|
|
|
742
742
|
"ReferenceChip"
|
|
743
743
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_info_tooltip__rspack_import_40[__rspack_import_key];
|
|
744
744
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
745
|
-
var _input__rspack_import_41 = __webpack_require__("
|
|
745
|
+
var _input__rspack_import_41 = __webpack_require__("./input");
|
|
746
746
|
var __rspack_reexport = {};
|
|
747
747
|
for(const __rspack_import_key in _input__rspack_import_41)if ([
|
|
748
748
|
"getReferenceChipColors",
|
|
@@ -772,7 +772,7 @@ var __webpack_exports__ = {};
|
|
|
772
772
|
"ReferenceChip"
|
|
773
773
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_json_tree_view__rspack_import_43[__rspack_import_key];
|
|
774
774
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
775
|
-
var _label__rspack_import_44 = __webpack_require__("
|
|
775
|
+
var _label__rspack_import_44 = __webpack_require__("@/components/ui/label");
|
|
776
776
|
var __rspack_reexport = {};
|
|
777
777
|
for(const __rspack_import_key in _label__rspack_import_44)if ([
|
|
778
778
|
"getReferenceChipColors",
|
|
@@ -782,7 +782,7 @@ var __webpack_exports__ = {};
|
|
|
782
782
|
"ReferenceChip"
|
|
783
783
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_label__rspack_import_44[__rspack_import_key];
|
|
784
784
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
785
|
-
var _layout__rspack_import_45 = __webpack_require__("
|
|
785
|
+
var _layout__rspack_import_45 = __webpack_require__("@/components/ui/layout");
|
|
786
786
|
var __rspack_reexport = {};
|
|
787
787
|
for(const __rspack_import_key in _layout__rspack_import_45)if ([
|
|
788
788
|
"getReferenceChipColors",
|
|
@@ -912,7 +912,7 @@ var __webpack_exports__ = {};
|
|
|
912
912
|
"ReferenceChip"
|
|
913
913
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_panel_tabs__rspack_import_57[__rspack_import_key];
|
|
914
914
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
915
|
-
var _popover__rspack_import_58 = __webpack_require__("
|
|
915
|
+
var _popover__rspack_import_58 = __webpack_require__("./popover");
|
|
916
916
|
var __rspack_reexport = {};
|
|
917
917
|
for(const __rspack_import_key in _popover__rspack_import_58)if ([
|
|
918
918
|
"getReferenceChipColors",
|
|
@@ -1144,7 +1144,7 @@ var __webpack_exports__ = {};
|
|
|
1144
1144
|
"ReferenceChip"
|
|
1145
1145
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_switch__rspack_import_82[__rspack_import_key];
|
|
1146
1146
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
1147
|
-
var _table__rspack_import_83 = __webpack_require__("
|
|
1147
|
+
var _table__rspack_import_83 = __webpack_require__("./table");
|
|
1148
1148
|
var __rspack_reexport = {};
|
|
1149
1149
|
for(const __rspack_import_key in _table__rspack_import_83)if ([
|
|
1150
1150
|
"getReferenceChipColors",
|
|
@@ -1214,7 +1214,7 @@ var __webpack_exports__ = {};
|
|
|
1214
1214
|
"ReferenceChip"
|
|
1215
1215
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_tool_call__rspack_import_89[__rspack_import_key];
|
|
1216
1216
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
1217
|
-
var _tooltip__rspack_import_90 = __webpack_require__("
|
|
1217
|
+
var _tooltip__rspack_import_90 = __webpack_require__("@/components/ui/tooltip");
|
|
1218
1218
|
var __rspack_reexport = {};
|
|
1219
1219
|
for(const __rspack_import_key in _tooltip__rspack_import_90)if ([
|
|
1220
1220
|
"getReferenceChipColors",
|
|
@@ -28,9 +28,9 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
28
28
|
EditorTextarea: ()=>EditorTextarea
|
|
29
29
|
});
|
|
30
30
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
|
+
const external_react_namespaceObject = require("react");
|
|
31
32
|
const external_button_cjs_namespaceObject = require("../button.cjs");
|
|
32
33
|
const index_cjs_namespaceObject = require("../../../lib/index.cjs");
|
|
33
|
-
const external_react_namespaceObject = require("react");
|
|
34
34
|
const external_strings_cjs_namespaceObject = require("./strings.cjs");
|
|
35
35
|
function EditorActions({ onApply, onCancel, applyDisabled = false }) {
|
|
36
36
|
const strings = (0, external_strings_cjs_namespaceObject.useJsonTreeViewStrings)();
|
|
@@ -67,7 +67,10 @@ function EditorTextarea({ value, onChange, onApply, onCancel, invalid, rows, ari
|
|
|
67
67
|
e.stopPropagation();
|
|
68
68
|
onCancel();
|
|
69
69
|
}
|
|
70
|
-
if ('Enter' === e.key && (e.metaKey || e.ctrlKey))
|
|
70
|
+
if ('Enter' === e.key && (e.metaKey || e.ctrlKey)) {
|
|
71
|
+
e.preventDefault();
|
|
72
|
+
onApply();
|
|
73
|
+
}
|
|
71
74
|
},
|
|
72
75
|
rows: rows,
|
|
73
76
|
spellCheck: false,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
2
3
|
import { Button } from "../button.js";
|
|
3
4
|
import { cn } from "../../../lib/index.js";
|
|
4
|
-
import { useEffect, useRef } from "react";
|
|
5
5
|
import { useJsonTreeViewStrings } from "./strings.js";
|
|
6
6
|
function EditorActions({ onApply, onCancel, applyDisabled = false }) {
|
|
7
7
|
const strings = useJsonTreeViewStrings();
|
|
@@ -38,7 +38,10 @@ function EditorTextarea({ value, onChange, onApply, onCancel, invalid, rows, ari
|
|
|
38
38
|
e.stopPropagation();
|
|
39
39
|
onCancel();
|
|
40
40
|
}
|
|
41
|
-
if ('Enter' === e.key && (e.metaKey || e.ctrlKey))
|
|
41
|
+
if ('Enter' === e.key && (e.metaKey || e.ctrlKey)) {
|
|
42
|
+
e.preventDefault();
|
|
43
|
+
onApply();
|
|
44
|
+
}
|
|
42
45
|
},
|
|
43
46
|
rows: rows,
|
|
44
47
|
spellCheck: false,
|
|
@@ -27,10 +27,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
27
27
|
JsonLeafValueEditor: ()=>JsonLeafValueEditor
|
|
28
28
|
});
|
|
29
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
-
const index_cjs_namespaceObject = require("../../../lib/index.cjs");
|
|
31
30
|
const external_react_namespaceObject = require("react");
|
|
32
|
-
const
|
|
31
|
+
const index_cjs_namespaceObject = require("../../../lib/index.cjs");
|
|
33
32
|
const external_leafEditTypes_cjs_namespaceObject = require("./leafEditTypes.cjs");
|
|
33
|
+
const external_strings_cjs_namespaceObject = require("./strings.cjs");
|
|
34
34
|
function JsonLeafValueEditor({ node, onCommit, onCancel, className }) {
|
|
35
35
|
const strings = (0, external_strings_cjs_namespaceObject.useJsonTreeViewStrings)();
|
|
36
36
|
const editType = (0, external_leafEditTypes_cjs_namespaceObject.resolveLeafEditType)(node.type, node.schema);
|
|
@@ -63,7 +63,10 @@ function JsonLeafValueEditor({ node, onCommit, onCancel, className }) {
|
|
|
63
63
|
else commit();
|
|
64
64
|
},
|
|
65
65
|
onKeyDown: (e)=>{
|
|
66
|
-
if ('Enter' === e.key)
|
|
66
|
+
if ('Enter' === e.key) {
|
|
67
|
+
e.preventDefault();
|
|
68
|
+
commit();
|
|
69
|
+
}
|
|
67
70
|
if ('Escape' === e.key) {
|
|
68
71
|
e.preventDefault();
|
|
69
72
|
e.stopPropagation();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "../../../lib/index.js";
|
|
3
2
|
import { useEffect, useRef, useState } from "react";
|
|
4
|
-
import {
|
|
3
|
+
import { cn } from "../../../lib/index.js";
|
|
5
4
|
import { isNumericEdit, parseLeafValue, resolveLeafEditType } from "./leafEditTypes.js";
|
|
5
|
+
import { useJsonTreeViewStrings } from "./strings.js";
|
|
6
6
|
function JsonLeafValueEditor({ node, onCommit, onCancel, className }) {
|
|
7
7
|
const strings = useJsonTreeViewStrings();
|
|
8
8
|
const editType = resolveLeafEditType(node.type, node.schema);
|
|
@@ -35,7 +35,10 @@ function JsonLeafValueEditor({ node, onCommit, onCancel, className }) {
|
|
|
35
35
|
else commit();
|
|
36
36
|
},
|
|
37
37
|
onKeyDown: (e)=>{
|
|
38
|
-
if ('Enter' === e.key)
|
|
38
|
+
if ('Enter' === e.key) {
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
commit();
|
|
41
|
+
}
|
|
39
42
|
if ('Escape' === e.key) {
|
|
40
43
|
e.preventDefault();
|
|
41
44
|
e.stopPropagation();
|
|
@@ -31,16 +31,17 @@ const react_virtual_namespaceObject = require("@tanstack/react-virtual");
|
|
|
31
31
|
const external_react_namespaceObject = require("react");
|
|
32
32
|
const index_cjs_namespaceObject = require("../../../lib/index.cjs");
|
|
33
33
|
const clipboard_cjs_namespaceObject = require("../../../lib/clipboard.cjs");
|
|
34
|
+
const use_isomorphic_layout_effect_cjs_namespaceObject = require("../../../lib/use-isomorphic-layout-effect.cjs");
|
|
34
35
|
const external_buildJsonTree_cjs_namespaceObject = require("./buildJsonTree.cjs");
|
|
35
36
|
const external_JsonTreeRow_cjs_namespaceObject = require("./JsonTreeRow.cjs");
|
|
36
37
|
const external_JsonTreeTooltip_cjs_namespaceObject = require("./JsonTreeTooltip.cjs");
|
|
37
38
|
const external_strings_cjs_namespaceObject = require("./strings.cjs");
|
|
38
|
-
const
|
|
39
|
+
const external_treeGrid_cjs_namespaceObject = require("./treeGrid.cjs");
|
|
39
40
|
const VIRTUAL_OVERSCAN = 10;
|
|
40
41
|
function scrollMarginOf(element, scrollElement) {
|
|
41
42
|
return Math.round(element.getBoundingClientRect().top - scrollElement.getBoundingClientRect().top + scrollElement.scrollTop);
|
|
42
43
|
}
|
|
43
|
-
function VirtualRows({ rows, container, scrollElement, pinnedPaths }) {
|
|
44
|
+
function VirtualRows({ rows, indexByPath, container, scrollElement, pinnedPaths, gridProps }) {
|
|
44
45
|
const [scrollMargin, setScrollMargin] = (0, external_react_namespaceObject.useState)(0);
|
|
45
46
|
const getItemKey = (0, external_react_namespaceObject.useCallback)((index)=>rows[index]?.node.path ?? index, [
|
|
46
47
|
rows
|
|
@@ -53,7 +54,7 @@ function VirtualRows({ rows, container, scrollElement, pinnedPaths }) {
|
|
|
53
54
|
overscan: VIRTUAL_OVERSCAN,
|
|
54
55
|
scrollMargin
|
|
55
56
|
});
|
|
56
|
-
useIsomorphicLayoutEffect(()=>{
|
|
57
|
+
(0, use_isomorphic_layout_effect_cjs_namespaceObject.useIsomorphicLayoutEffect)(()=>{
|
|
57
58
|
if (!container || !scrollElement) {
|
|
58
59
|
if (0 !== scrollMargin) setScrollMargin(0);
|
|
59
60
|
return;
|
|
@@ -62,21 +63,11 @@ function VirtualRows({ rows, container, scrollElement, pinnedPaths }) {
|
|
|
62
63
|
const next = scrollMarginOf(container, scrollElement);
|
|
63
64
|
if (next !== scrollMargin) setScrollMargin(next);
|
|
64
65
|
});
|
|
65
|
-
const isPinning = pinnedPaths.length > 0;
|
|
66
|
-
const indexByPath = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
67
|
-
if (!isPinning) return;
|
|
68
|
-
const byPath = new Map();
|
|
69
|
-
for (const [index, row] of rows.entries())byPath.set(row.node.path, index);
|
|
70
|
-
return byPath;
|
|
71
|
-
}, [
|
|
72
|
-
isPinning,
|
|
73
|
-
rows
|
|
74
|
-
]);
|
|
75
66
|
const items = virtualizer.getVirtualItems();
|
|
76
67
|
const firstWindowed = items[0]?.index ?? -1;
|
|
77
68
|
const lastWindowed = items[items.length - 1]?.index ?? -2;
|
|
78
69
|
const pinnedItems = [];
|
|
79
|
-
|
|
70
|
+
for (const path of pinnedPaths){
|
|
80
71
|
const index = indexByPath.get(path);
|
|
81
72
|
if (void 0 === index || index >= firstWindowed && index <= lastWindowed) continue;
|
|
82
73
|
const measurement = virtualizer.measurementsCache[index];
|
|
@@ -88,6 +79,7 @@ function VirtualRows({ rows, container, scrollElement, pinnedPaths }) {
|
|
|
88
79
|
...pinnedItems.filter((item)=>item.index > lastWindowed)
|
|
89
80
|
];
|
|
90
81
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
82
|
+
...gridProps,
|
|
91
83
|
className: "relative",
|
|
92
84
|
style: {
|
|
93
85
|
height: virtualizer.getTotalSize()
|
|
@@ -103,8 +95,8 @@ function VirtualRows({ rows, container, scrollElement, pinnedPaths }) {
|
|
|
103
95
|
transform: `translateY(${item.start - virtualizer.options.scrollMargin}px)`
|
|
104
96
|
},
|
|
105
97
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_JsonTreeRow_cjs_namespaceObject.JsonTreeRow, {
|
|
106
|
-
|
|
107
|
-
|
|
98
|
+
row: row,
|
|
99
|
+
index: item.index
|
|
108
100
|
})
|
|
109
101
|
}, item.key);
|
|
110
102
|
})
|
|
@@ -130,7 +122,7 @@ function JsonTreeView({ strings, tooltipContentClassName, ...props }) {
|
|
|
130
122
|
})
|
|
131
123
|
});
|
|
132
124
|
}
|
|
133
|
-
function JsonTreeViewContent({ nodes, collapsed = {}, onToggleCollapsed, query, filterPredicate, readOnly = false, onEdit, rowWrapper, decorateNode, deriveTypeIcon, renderValue, nodeActions, maxInlineActions = 3, renderCodeEditor, pathForCopy, onCopy, virtualized = false, scrollElement, emptyMessage, className }) {
|
|
125
|
+
function JsonTreeViewContent({ nodes, collapsed = {}, onToggleCollapsed, query, filterPredicate, readOnly = false, onEdit, rowWrapper, decorateNode, deriveTypeIcon, renderValue, nodeActions, maxInlineActions = 3, renderCodeEditor, pathForCopy, onCopy, virtualized = false, scrollElement, emptyMessage, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, className }) {
|
|
134
126
|
const strings = (0, external_strings_cjs_namespaceObject.useJsonTreeViewStrings)();
|
|
135
127
|
const [container, setContainer] = (0, external_react_namespaceObject.useState)(null);
|
|
136
128
|
const usesAncestorScroller = virtualized && !!scrollElement;
|
|
@@ -138,15 +130,6 @@ function JsonTreeViewContent({ nodes, collapsed = {}, onToggleCollapsed, query,
|
|
|
138
130
|
const [editingPath, setEditingPath] = (0, external_react_namespaceObject.useState)(null);
|
|
139
131
|
const [jsonEditingPath, setJsonEditingPath] = (0, external_react_namespaceObject.useState)(null);
|
|
140
132
|
const [wrappedPaths, setWrappedPaths] = (0, external_react_namespaceObject.useState)({});
|
|
141
|
-
const pinnedPaths = (0, external_react_namespaceObject.useMemo)(()=>[
|
|
142
|
-
...new Set([
|
|
143
|
-
editingPath,
|
|
144
|
-
jsonEditingPath
|
|
145
|
-
].filter((path)=>null !== path))
|
|
146
|
-
], [
|
|
147
|
-
editingPath,
|
|
148
|
-
jsonEditingPath
|
|
149
|
-
]);
|
|
150
133
|
const [copied, setCopied] = (0, external_react_namespaceObject.useState)(null);
|
|
151
134
|
const copyTimerRef = (0, external_react_namespaceObject.useRef)(null);
|
|
152
135
|
(0, external_react_namespaceObject.useEffect)(()=>()=>{
|
|
@@ -155,10 +138,11 @@ function JsonTreeViewContent({ nodes, collapsed = {}, onToggleCollapsed, query,
|
|
|
155
138
|
const copy = (node, kind, text)=>{
|
|
156
139
|
(0, clipboard_cjs_namespaceObject.copyTextToClipboard)(text).then((ok)=>{
|
|
157
140
|
if (!ok) return;
|
|
158
|
-
setCopied({
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
141
|
+
setCopied((prev)=>({
|
|
142
|
+
path: node.path,
|
|
143
|
+
kind,
|
|
144
|
+
id: (prev?.id ?? 0) + 1
|
|
145
|
+
}));
|
|
162
146
|
if (copyTimerRef.current) clearTimeout(copyTimerRef.current);
|
|
163
147
|
copyTimerRef.current = setTimeout(()=>setCopied(null), 1500);
|
|
164
148
|
onCopy?.({
|
|
@@ -191,6 +175,37 @@ function JsonTreeViewContent({ nodes, collapsed = {}, onToggleCollapsed, query,
|
|
|
191
175
|
filterPredicate,
|
|
192
176
|
decorateNode
|
|
193
177
|
]);
|
|
178
|
+
const indexByPath = (0, external_react_namespaceObject.useMemo)(()=>new Map(rows.map((row, index)=>[
|
|
179
|
+
row.node.path,
|
|
180
|
+
index
|
|
181
|
+
])), [
|
|
182
|
+
rows
|
|
183
|
+
]);
|
|
184
|
+
const { activePath, gridHandlers, trackEditor } = (0, external_treeGrid_cjs_namespaceObject.useTreeGrid)({
|
|
185
|
+
rows,
|
|
186
|
+
indexByPath,
|
|
187
|
+
collapsed,
|
|
188
|
+
toggle: onToggleCollapsed
|
|
189
|
+
});
|
|
190
|
+
const pinnedPaths = (0, external_react_namespaceObject.useMemo)(()=>[
|
|
191
|
+
...new Set([
|
|
192
|
+
editingPath,
|
|
193
|
+
jsonEditingPath,
|
|
194
|
+
activePath
|
|
195
|
+
].filter((path)=>null !== path))
|
|
196
|
+
], [
|
|
197
|
+
editingPath,
|
|
198
|
+
jsonEditingPath,
|
|
199
|
+
activePath
|
|
200
|
+
]);
|
|
201
|
+
const gridProps = {
|
|
202
|
+
...gridHandlers,
|
|
203
|
+
role: 'treegrid',
|
|
204
|
+
'aria-label': ariaLabelledBy ? void 0 : ariaLabel ?? strings.treeLabel,
|
|
205
|
+
'aria-labelledby': ariaLabelledBy,
|
|
206
|
+
'aria-readonly': !canEdit || void 0,
|
|
207
|
+
'aria-rowcount': rows.length
|
|
208
|
+
};
|
|
194
209
|
const templateItemLabel = strings.arrayItem;
|
|
195
210
|
const filtering = !!query?.trim() || !!filterPredicate;
|
|
196
211
|
const resolvedEmptyMessage = filtering ? strings.emptySearch : emptyMessage ?? strings.emptyDefault;
|
|
@@ -212,8 +227,9 @@ function JsonTreeViewContent({ nodes, collapsed = {}, onToggleCollapsed, query,
|
|
|
212
227
|
jsonEditingPath,
|
|
213
228
|
wrappedPaths,
|
|
214
229
|
copied,
|
|
215
|
-
|
|
216
|
-
|
|
230
|
+
activePath,
|
|
231
|
+
setEditingPath: trackEditor('leaf', setEditingPath),
|
|
232
|
+
setJsonEditingPath: trackEditor('json', setJsonEditingPath),
|
|
217
233
|
copyPath,
|
|
218
234
|
copyValue,
|
|
219
235
|
toggleWrapped,
|
|
@@ -226,15 +242,27 @@ function JsonTreeViewContent({ nodes, collapsed = {}, onToggleCollapsed, query,
|
|
|
226
242
|
ref: setContainer,
|
|
227
243
|
className: (0, index_cjs_namespaceObject.cn)(usesAncestorScroller ? 'overflow-x-clip' : 'h-full overflow-y-auto overflow-x-hidden', virtualized && !usesAncestorScroller && 'max-h-screen', virtualized && '[overflow-anchor:none]', className),
|
|
228
244
|
children: [
|
|
229
|
-
|
|
245
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
246
|
+
role: "status",
|
|
247
|
+
className: "sr-only",
|
|
248
|
+
children: copied && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
249
|
+
children: 'path' === copied.kind ? strings.pathCopied : strings.valueCopied
|
|
250
|
+
}, copied.id)
|
|
251
|
+
}),
|
|
252
|
+
rows.length > 0 && (virtualized ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(VirtualRows, {
|
|
230
253
|
rows: rows,
|
|
254
|
+
indexByPath: indexByPath,
|
|
231
255
|
container: container,
|
|
232
256
|
scrollElement: scrollElement,
|
|
233
|
-
pinnedPaths: pinnedPaths
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
257
|
+
pinnedPaths: pinnedPaths,
|
|
258
|
+
gridProps: gridProps
|
|
259
|
+
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
260
|
+
...gridProps,
|
|
261
|
+
children: rows.map((row, index)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_JsonTreeRow_cjs_namespaceObject.JsonTreeRow, {
|
|
262
|
+
row: row,
|
|
263
|
+
index: index
|
|
264
|
+
}, row.node.path))
|
|
265
|
+
})),
|
|
238
266
|
0 === rows.length && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
239
267
|
className: "p-4 text-center text-xs text-foreground-subtle",
|
|
240
268
|
children: resolvedEmptyMessage
|
|
@@ -51,7 +51,8 @@ export interface JsonTreeViewProps {
|
|
|
51
51
|
* for values with thousands of fields. Rows are measured, so wrapped values
|
|
52
52
|
* and inline editors keep their height. The tree scrolls inside its own box,
|
|
53
53
|
* capped at the viewport height, unless `scrollElement` names the scroller.
|
|
54
|
-
*
|
|
54
|
+
* Also keeps arrow-key navigation quick in large trees, since each focus move
|
|
55
|
+
* re-renders the mounted rows. Off by default.
|
|
55
56
|
*/
|
|
56
57
|
virtualized?: boolean;
|
|
57
58
|
/**
|
|
@@ -70,6 +71,10 @@ export interface JsonTreeViewProps {
|
|
|
70
71
|
strings?: Partial<JsonTreeViewStrings>;
|
|
71
72
|
/** Extra classes for every tooltip panel (e.g. a z-index above a host's overlays). */
|
|
72
73
|
tooltipContentClassName?: string;
|
|
74
|
+
/** Accessible name of the tree grid. Defaults to the `treeLabel` string. */
|
|
75
|
+
'aria-label'?: string;
|
|
76
|
+
/** Id of a visible heading naming the tree grid; takes precedence over `aria-label`. */
|
|
77
|
+
'aria-labelledby'?: string;
|
|
73
78
|
className?: string;
|
|
74
79
|
}
|
|
75
80
|
/**
|