@uipath/apollo-react 6.41.0 → 6.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas/components/CanvasTakeoverModal/CanvasTakeoverModal.cjs +21 -104
- package/dist/canvas/components/CanvasTakeoverModal/CanvasTakeoverModal.d.ts +1 -1
- package/dist/canvas/components/CanvasTakeoverModal/CanvasTakeoverModal.d.ts.map +1 -1
- package/dist/canvas/components/CanvasTakeoverModal/CanvasTakeoverModal.js +24 -97
- package/dist/canvas/components/JsonTree/JsonTree.cjs +97 -3
- package/dist/canvas/components/JsonTree/JsonTree.d.ts +3 -1
- package/dist/canvas/components/JsonTree/JsonTree.d.ts.map +1 -1
- package/dist/canvas/components/JsonTree/JsonTree.js +99 -5
- package/dist/canvas/components/JsonTree/JsonTreeRow.cjs +6 -2
- package/dist/canvas/components/JsonTree/JsonTreeRow.d.ts +1 -0
- package/dist/canvas/components/JsonTree/JsonTreeRow.d.ts.map +1 -1
- package/dist/canvas/components/JsonTree/JsonTreeRow.js +2 -1
- package/dist/canvas/components/NodeIOView/NodeIOView.cjs +2 -1
- package/dist/canvas/components/NodeIOView/NodeIOView.d.ts +1 -1
- package/dist/canvas/components/NodeIOView/NodeIOView.d.ts.map +1 -1
- package/dist/canvas/components/NodeIOView/NodeIOView.js +2 -1
- package/dist/canvas/components/NodeIOView/NodeIOView.types.d.ts +1 -0
- package/dist/canvas/components/NodeIOView/NodeIOView.types.d.ts.map +1 -1
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/dist/material/components/ap-chat/locales/de.cjs +1 -1
- package/dist/material/components/ap-chat/locales/de.d.ts.map +1 -1
- package/dist/material/components/ap-chat/locales/de.js +1 -1
- package/dist/material/components/ap-chat/locales/es-MX.cjs +1 -1
- package/dist/material/components/ap-chat/locales/es-MX.d.ts.map +1 -1
- package/dist/material/components/ap-chat/locales/es-MX.js +1 -1
- package/dist/material/components/ap-chat/locales/es.cjs +1 -1
- package/dist/material/components/ap-chat/locales/es.d.ts.map +1 -1
- package/dist/material/components/ap-chat/locales/es.js +1 -1
- package/dist/material/components/ap-chat/locales/fr.cjs +1 -1
- package/dist/material/components/ap-chat/locales/fr.d.ts.map +1 -1
- package/dist/material/components/ap-chat/locales/fr.js +1 -1
- package/dist/material/components/ap-chat/locales/ja.cjs +1 -1
- package/dist/material/components/ap-chat/locales/ja.d.ts.map +1 -1
- package/dist/material/components/ap-chat/locales/ja.js +1 -1
- package/dist/material/components/ap-chat/locales/ko.cjs +1 -1
- package/dist/material/components/ap-chat/locales/ko.d.ts.map +1 -1
- package/dist/material/components/ap-chat/locales/ko.js +1 -1
- package/dist/material/components/ap-chat/locales/pt-BR.cjs +1 -1
- package/dist/material/components/ap-chat/locales/pt-BR.d.ts.map +1 -1
- package/dist/material/components/ap-chat/locales/pt-BR.js +1 -1
- package/dist/material/components/ap-chat/locales/pt.cjs +1 -1
- package/dist/material/components/ap-chat/locales/pt.d.ts.map +1 -1
- package/dist/material/components/ap-chat/locales/pt.js +1 -1
- package/dist/material/components/ap-chat/locales/ro.cjs +1 -1
- package/dist/material/components/ap-chat/locales/ro.d.ts.map +1 -1
- package/dist/material/components/ap-chat/locales/ro.js +1 -1
- package/dist/material/components/ap-chat/locales/tr.cjs +1 -1
- package/dist/material/components/ap-chat/locales/tr.d.ts.map +1 -1
- package/dist/material/components/ap-chat/locales/tr.js +1 -1
- package/dist/material/components/ap-chat/locales/zh-CN.cjs +1 -1
- package/dist/material/components/ap-chat/locales/zh-CN.d.ts.map +1 -1
- package/dist/material/components/ap-chat/locales/zh-CN.js +1 -1
- package/dist/material/components/ap-chat/locales/zh-TW.cjs +1 -1
- package/dist/material/components/ap-chat/locales/zh-TW.d.ts.map +1 -1
- package/dist/material/components/ap-chat/locales/zh-TW.js +1 -1
- package/package.json +3 -3
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.n = (module)=>{
|
|
5
|
-
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
-
__webpack_require__.d(getter, {
|
|
7
|
-
a: getter
|
|
8
|
-
});
|
|
9
|
-
return getter;
|
|
10
|
-
};
|
|
11
|
-
})();
|
|
12
3
|
(()=>{
|
|
13
4
|
__webpack_require__.d = (exports1, definition)=>{
|
|
14
5
|
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
@@ -37,113 +28,39 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
37
28
|
});
|
|
38
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
39
30
|
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
40
|
-
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
41
31
|
const external_react_namespaceObject = require("react");
|
|
42
|
-
|
|
43
|
-
var external_react_focus_lock_default = /*#__PURE__*/ __webpack_require__.n(external_react_focus_lock_namespaceObject);
|
|
44
|
-
function CanvasTakeoverModal({ open, onOpenChange, title, headerActions, sidebar, children, expanded: controlledExpanded, defaultExpanded = false, onExpandedChange, className, sidebarClassName, closeOnBackdropClick = true }) {
|
|
45
|
-
const titleId = (0, external_react_namespaceObject.useId)();
|
|
46
|
-
const expandButtonRef = (0, external_react_namespaceObject.useRef)(null);
|
|
32
|
+
function CanvasTakeoverModal({ open, onOpenChange, title, headerActions, sidebar, children, expanded, defaultExpanded, onExpandedChange, className, sidebarClassName, closeOnBackdropClick = true }) {
|
|
47
33
|
const previouslyFocusedElementRef = (0, external_react_namespaceObject.useRef)(null);
|
|
48
|
-
const [uncontrolledExpanded, setUncontrolledExpanded] = (0, external_react_namespaceObject.useState)(defaultExpanded);
|
|
49
|
-
const expanded = controlledExpanded ?? uncontrolledExpanded;
|
|
50
34
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
51
35
|
if (!open) return;
|
|
52
36
|
previouslyFocusedElementRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
53
|
-
const animationFrame = requestAnimationFrame(()=>expandButtonRef.current?.focus());
|
|
54
|
-
const handleKeyDown = (event)=>{
|
|
55
|
-
if ('Escape' === event.key) onOpenChange?.(false);
|
|
56
|
-
};
|
|
57
|
-
document.addEventListener('keydown', handleKeyDown);
|
|
58
37
|
return ()=>{
|
|
59
|
-
cancelAnimationFrame(animationFrame);
|
|
60
|
-
document.removeEventListener('keydown', handleKeyDown);
|
|
61
38
|
previouslyFocusedElementRef.current?.focus();
|
|
62
39
|
previouslyFocusedElementRef.current = null;
|
|
63
40
|
};
|
|
64
41
|
}, [
|
|
65
|
-
onOpenChange,
|
|
66
42
|
open
|
|
67
43
|
]);
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
className: (0, apollo_wind_namespaceObject.cn)('flex min-h-0 flex-col overflow-hidden border border-border-subtle bg-surface-raised text-foreground shadow-xl transition-[width,height,border-radius] duration-200', expanded ? 'h-full w-full rounded-none' : 'h-[95%] w-[95%] rounded-2xl', className),
|
|
89
|
-
children: [
|
|
90
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("header", {
|
|
91
|
-
className: "flex h-12 shrink-0 items-center gap-3 border-b border-border-subtle px-4",
|
|
92
|
-
children: [
|
|
93
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("h2", {
|
|
94
|
-
id: titleId,
|
|
95
|
-
className: "min-w-0 flex-1 truncate text-sm font-semibold",
|
|
96
|
-
children: title
|
|
97
|
-
}),
|
|
98
|
-
headerActions,
|
|
99
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
100
|
-
className: "-mr-1 flex shrink-0 items-center gap-1",
|
|
101
|
-
children: [
|
|
102
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
|
|
103
|
-
ref: expandButtonRef,
|
|
104
|
-
type: "button",
|
|
105
|
-
onClick: ()=>setExpanded(!expanded),
|
|
106
|
-
className: "grid size-8 place-items-center rounded-md text-foreground-muted transition-colors hover:bg-surface-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
107
|
-
"aria-label": expanded ? 'Collapse modal' : 'Expand modal',
|
|
108
|
-
title: expanded ? 'Collapse modal' : 'Expand modal',
|
|
109
|
-
children: expanded ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Minimize2, {
|
|
110
|
-
size: 16,
|
|
111
|
-
strokeWidth: 1.75
|
|
112
|
-
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Maximize2, {
|
|
113
|
-
size: 16,
|
|
114
|
-
strokeWidth: 1.75
|
|
115
|
-
})
|
|
116
|
-
}),
|
|
117
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
|
|
118
|
-
type: "button",
|
|
119
|
-
onClick: ()=>onOpenChange?.(false),
|
|
120
|
-
className: "grid size-8 place-items-center rounded-md text-foreground-muted transition-colors hover:bg-surface-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
121
|
-
"aria-label": "Close modal",
|
|
122
|
-
title: "Close modal",
|
|
123
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.X, {
|
|
124
|
-
size: 16,
|
|
125
|
-
strokeWidth: 1.75
|
|
126
|
-
})
|
|
127
|
-
})
|
|
128
|
-
]
|
|
129
|
-
})
|
|
130
|
-
]
|
|
131
|
-
}),
|
|
132
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
133
|
-
className: "flex min-h-0 flex-1",
|
|
134
|
-
children: [
|
|
135
|
-
null != sidebar && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("aside", {
|
|
136
|
-
className: (0, apollo_wind_namespaceObject.cn)('w-64 shrink-0 overflow-auto border-r border-border-subtle', sidebarClassName),
|
|
137
|
-
children: sidebar
|
|
138
|
-
}),
|
|
139
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("main", {
|
|
140
|
-
className: "min-w-0 flex-1 overflow-auto",
|
|
141
|
-
children: children
|
|
142
|
-
})
|
|
143
|
-
]
|
|
144
|
-
})
|
|
145
|
-
]
|
|
146
|
-
})
|
|
44
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Modal, {
|
|
45
|
+
open: open,
|
|
46
|
+
onOpenChange: onOpenChange,
|
|
47
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.ModalContent, {
|
|
48
|
+
variant: "takeover",
|
|
49
|
+
headerTitle: title,
|
|
50
|
+
headerActions: headerActions,
|
|
51
|
+
sidebar: sidebar,
|
|
52
|
+
expanded: expanded,
|
|
53
|
+
defaultExpanded: defaultExpanded,
|
|
54
|
+
onExpandedChange: onExpandedChange,
|
|
55
|
+
className: className,
|
|
56
|
+
sidebarClassName: sidebarClassName,
|
|
57
|
+
closeOnBackdropClick: closeOnBackdropClick,
|
|
58
|
+
overlayTestId: "canvas-takeover-backdrop",
|
|
59
|
+
onOpenAutoFocus: (event)=>{
|
|
60
|
+
event.preventDefault();
|
|
61
|
+
event.currentTarget.querySelector('[aria-label="Expand modal"], [aria-label="Collapse modal"]')?.focus();
|
|
62
|
+
},
|
|
63
|
+
children: children
|
|
147
64
|
})
|
|
148
65
|
});
|
|
149
66
|
}
|
|
@@ -13,5 +13,5 @@ export interface CanvasTakeoverModalProps {
|
|
|
13
13
|
sidebarClassName?: string;
|
|
14
14
|
closeOnBackdropClick?: boolean;
|
|
15
15
|
}
|
|
16
|
-
export declare function CanvasTakeoverModal({ open, onOpenChange, title, headerActions, sidebar, children, expanded
|
|
16
|
+
export declare function CanvasTakeoverModal({ open, onOpenChange, title, headerActions, sidebar, children, expanded, defaultExpanded, onExpandedChange, className, sidebarClassName, closeOnBackdropClick, }: CanvasTakeoverModalProps): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
//# sourceMappingURL=CanvasTakeoverModal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CanvasTakeoverModal.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/CanvasTakeoverModal/CanvasTakeoverModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CanvasTakeoverModal.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/CanvasTakeoverModal/CanvasTakeoverModal.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAE1D,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,KAAK,EAAE,SAAS,CAAC;IACjB,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAGD,wBAAgB,mBAAmB,CAAC,EAClC,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,aAAa,EACb,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,gBAAgB,EAChB,oBAA2B,GAC5B,EAAE,wBAAwB,2CAwC1B"}
|
|
@@ -1,111 +1,38 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import react_focus_lock from "react-focus-lock";
|
|
6
|
-
function CanvasTakeoverModal({ open, onOpenChange, title, headerActions, sidebar, children, expanded: controlledExpanded, defaultExpanded = false, onExpandedChange, className, sidebarClassName, closeOnBackdropClick = true }) {
|
|
7
|
-
const titleId = useId();
|
|
8
|
-
const expandButtonRef = useRef(null);
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Modal, ModalContent } from "@uipath/apollo-wind";
|
|
3
|
+
import { useEffect, useRef } from "react";
|
|
4
|
+
function CanvasTakeoverModal({ open, onOpenChange, title, headerActions, sidebar, children, expanded, defaultExpanded, onExpandedChange, className, sidebarClassName, closeOnBackdropClick = true }) {
|
|
9
5
|
const previouslyFocusedElementRef = useRef(null);
|
|
10
|
-
const [uncontrolledExpanded, setUncontrolledExpanded] = useState(defaultExpanded);
|
|
11
|
-
const expanded = controlledExpanded ?? uncontrolledExpanded;
|
|
12
6
|
useEffect(()=>{
|
|
13
7
|
if (!open) return;
|
|
14
8
|
previouslyFocusedElementRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
15
|
-
const animationFrame = requestAnimationFrame(()=>expandButtonRef.current?.focus());
|
|
16
|
-
const handleKeyDown = (event)=>{
|
|
17
|
-
if ('Escape' === event.key) onOpenChange?.(false);
|
|
18
|
-
};
|
|
19
|
-
document.addEventListener('keydown', handleKeyDown);
|
|
20
9
|
return ()=>{
|
|
21
|
-
cancelAnimationFrame(animationFrame);
|
|
22
|
-
document.removeEventListener('keydown', handleKeyDown);
|
|
23
10
|
previouslyFocusedElementRef.current?.focus();
|
|
24
11
|
previouslyFocusedElementRef.current = null;
|
|
25
12
|
};
|
|
26
13
|
}, [
|
|
27
|
-
onOpenChange,
|
|
28
14
|
open
|
|
29
15
|
]);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
className: cn('flex min-h-0 flex-col overflow-hidden border border-border-subtle bg-surface-raised text-foreground shadow-xl transition-[width,height,border-radius] duration-200', expanded ? 'h-full w-full rounded-none' : 'h-[95%] w-[95%] rounded-2xl', className),
|
|
51
|
-
children: [
|
|
52
|
-
/*#__PURE__*/ jsxs("header", {
|
|
53
|
-
className: "flex h-12 shrink-0 items-center gap-3 border-b border-border-subtle px-4",
|
|
54
|
-
children: [
|
|
55
|
-
/*#__PURE__*/ jsx("h2", {
|
|
56
|
-
id: titleId,
|
|
57
|
-
className: "min-w-0 flex-1 truncate text-sm font-semibold",
|
|
58
|
-
children: title
|
|
59
|
-
}),
|
|
60
|
-
headerActions,
|
|
61
|
-
/*#__PURE__*/ jsxs("div", {
|
|
62
|
-
className: "-mr-1 flex shrink-0 items-center gap-1",
|
|
63
|
-
children: [
|
|
64
|
-
/*#__PURE__*/ jsx("button", {
|
|
65
|
-
ref: expandButtonRef,
|
|
66
|
-
type: "button",
|
|
67
|
-
onClick: ()=>setExpanded(!expanded),
|
|
68
|
-
className: "grid size-8 place-items-center rounded-md text-foreground-muted transition-colors hover:bg-surface-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
69
|
-
"aria-label": expanded ? 'Collapse modal' : 'Expand modal',
|
|
70
|
-
title: expanded ? 'Collapse modal' : 'Expand modal',
|
|
71
|
-
children: expanded ? /*#__PURE__*/ jsx(Minimize2, {
|
|
72
|
-
size: 16,
|
|
73
|
-
strokeWidth: 1.75
|
|
74
|
-
}) : /*#__PURE__*/ jsx(Maximize2, {
|
|
75
|
-
size: 16,
|
|
76
|
-
strokeWidth: 1.75
|
|
77
|
-
})
|
|
78
|
-
}),
|
|
79
|
-
/*#__PURE__*/ jsx("button", {
|
|
80
|
-
type: "button",
|
|
81
|
-
onClick: ()=>onOpenChange?.(false),
|
|
82
|
-
className: "grid size-8 place-items-center rounded-md text-foreground-muted transition-colors hover:bg-surface-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
83
|
-
"aria-label": "Close modal",
|
|
84
|
-
title: "Close modal",
|
|
85
|
-
children: /*#__PURE__*/ jsx(X, {
|
|
86
|
-
size: 16,
|
|
87
|
-
strokeWidth: 1.75
|
|
88
|
-
})
|
|
89
|
-
})
|
|
90
|
-
]
|
|
91
|
-
})
|
|
92
|
-
]
|
|
93
|
-
}),
|
|
94
|
-
/*#__PURE__*/ jsxs("div", {
|
|
95
|
-
className: "flex min-h-0 flex-1",
|
|
96
|
-
children: [
|
|
97
|
-
null != sidebar && /*#__PURE__*/ jsx("aside", {
|
|
98
|
-
className: cn('w-64 shrink-0 overflow-auto border-r border-border-subtle', sidebarClassName),
|
|
99
|
-
children: sidebar
|
|
100
|
-
}),
|
|
101
|
-
/*#__PURE__*/ jsx("main", {
|
|
102
|
-
className: "min-w-0 flex-1 overflow-auto",
|
|
103
|
-
children: children
|
|
104
|
-
})
|
|
105
|
-
]
|
|
106
|
-
})
|
|
107
|
-
]
|
|
108
|
-
})
|
|
16
|
+
return /*#__PURE__*/ jsx(Modal, {
|
|
17
|
+
open: open,
|
|
18
|
+
onOpenChange: onOpenChange,
|
|
19
|
+
children: /*#__PURE__*/ jsx(ModalContent, {
|
|
20
|
+
variant: "takeover",
|
|
21
|
+
headerTitle: title,
|
|
22
|
+
headerActions: headerActions,
|
|
23
|
+
sidebar: sidebar,
|
|
24
|
+
expanded: expanded,
|
|
25
|
+
defaultExpanded: defaultExpanded,
|
|
26
|
+
onExpandedChange: onExpandedChange,
|
|
27
|
+
className: className,
|
|
28
|
+
sidebarClassName: sidebarClassName,
|
|
29
|
+
closeOnBackdropClick: closeOnBackdropClick,
|
|
30
|
+
overlayTestId: "canvas-takeover-backdrop",
|
|
31
|
+
onOpenAutoFocus: (event)=>{
|
|
32
|
+
event.preventDefault();
|
|
33
|
+
event.currentTarget.querySelector('[aria-label="Expand modal"], [aria-label="Collapse modal"]')?.focus();
|
|
34
|
+
},
|
|
35
|
+
children: children
|
|
109
36
|
})
|
|
110
37
|
});
|
|
111
38
|
}
|
|
@@ -27,14 +27,91 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
27
27
|
JsonTree: ()=>JsonTree
|
|
28
28
|
});
|
|
29
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const react_virtual_namespaceObject = require("@tanstack/react-virtual");
|
|
30
31
|
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
31
32
|
const tooltip_namespaceObject = require("@uipath/apollo-wind/components/ui/tooltip");
|
|
32
33
|
const external_react_namespaceObject = require("react");
|
|
33
34
|
const index_cjs_namespaceObject = require("../../../i18n/index.cjs");
|
|
35
|
+
const useIsomorphicLayoutEffect_cjs_namespaceObject = require("../../hooks/useIsomorphicLayoutEffect.cjs");
|
|
34
36
|
const external_CanvasTooltip_cjs_namespaceObject = require("../CanvasTooltip.cjs");
|
|
35
37
|
const external_buildJsonTree_cjs_namespaceObject = require("./buildJsonTree.cjs");
|
|
36
38
|
const external_clipboard_cjs_namespaceObject = require("./clipboard.cjs");
|
|
37
39
|
const external_JsonTreeRow_cjs_namespaceObject = require("./JsonTreeRow.cjs");
|
|
40
|
+
const VIRTUAL_OVERSCAN = 10;
|
|
41
|
+
function scrollMarginOf(element, scrollElement) {
|
|
42
|
+
return Math.round(element.getBoundingClientRect().top - scrollElement.getBoundingClientRect().top + scrollElement.scrollTop);
|
|
43
|
+
}
|
|
44
|
+
function VirtualRows({ rows, containerRef, scrollElement, pinnedPaths }) {
|
|
45
|
+
const [scrollMargin, setScrollMargin] = (0, external_react_namespaceObject.useState)(0);
|
|
46
|
+
const getItemKey = (0, external_react_namespaceObject.useCallback)((index)=>rows[index]?.node.path ?? index, [
|
|
47
|
+
rows
|
|
48
|
+
]);
|
|
49
|
+
const virtualizer = (0, react_virtual_namespaceObject.useVirtualizer)({
|
|
50
|
+
count: rows.length,
|
|
51
|
+
getScrollElement: ()=>scrollElement ?? containerRef.current,
|
|
52
|
+
estimateSize: ()=>external_JsonTreeRow_cjs_namespaceObject.ROW_MIN_HEIGHT_PX,
|
|
53
|
+
getItemKey,
|
|
54
|
+
overscan: VIRTUAL_OVERSCAN,
|
|
55
|
+
scrollMargin
|
|
56
|
+
});
|
|
57
|
+
(0, useIsomorphicLayoutEffect_cjs_namespaceObject.useIsomorphicLayoutEffect)(()=>{
|
|
58
|
+
const container = containerRef.current;
|
|
59
|
+
if (!container || !scrollElement) {
|
|
60
|
+
if (0 !== scrollMargin) setScrollMargin(0);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
if (virtualizer.isScrolling) return;
|
|
64
|
+
const next = scrollMarginOf(container, scrollElement);
|
|
65
|
+
if (next !== scrollMargin) setScrollMargin(next);
|
|
66
|
+
});
|
|
67
|
+
const isPinning = pinnedPaths.length > 0;
|
|
68
|
+
const indexByPath = (0, external_react_namespaceObject.useMemo)(()=>{
|
|
69
|
+
if (!isPinning) return;
|
|
70
|
+
const byPath = new Map();
|
|
71
|
+
rows.forEach((row, index)=>byPath.set(row.node.path, index));
|
|
72
|
+
return byPath;
|
|
73
|
+
}, [
|
|
74
|
+
isPinning,
|
|
75
|
+
rows
|
|
76
|
+
]);
|
|
77
|
+
const items = virtualizer.getVirtualItems();
|
|
78
|
+
const firstWindowed = items[0]?.index ?? -1;
|
|
79
|
+
const lastWindowed = items[items.length - 1]?.index ?? -2;
|
|
80
|
+
const pinnedItems = [];
|
|
81
|
+
if (indexByPath) for (const path of pinnedPaths){
|
|
82
|
+
const index = indexByPath.get(path);
|
|
83
|
+
if (void 0 === index || index >= firstWindowed && index <= lastWindowed) continue;
|
|
84
|
+
const measurement = virtualizer.measurementsCache[index];
|
|
85
|
+
if (measurement) pinnedItems.push(measurement);
|
|
86
|
+
}
|
|
87
|
+
const rendered = 0 === pinnedItems.length ? items : [
|
|
88
|
+
...pinnedItems.filter((item)=>item.index < firstWindowed),
|
|
89
|
+
...items,
|
|
90
|
+
...pinnedItems.filter((item)=>item.index > lastWindowed)
|
|
91
|
+
];
|
|
92
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
93
|
+
className: "relative",
|
|
94
|
+
style: {
|
|
95
|
+
height: virtualizer.getTotalSize()
|
|
96
|
+
},
|
|
97
|
+
children: rendered.map((item)=>{
|
|
98
|
+
const row = rows[item.index];
|
|
99
|
+
if (!row) return null;
|
|
100
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
101
|
+
"data-index": item.index,
|
|
102
|
+
ref: virtualizer.measureElement,
|
|
103
|
+
className: "absolute top-0 left-0 w-full",
|
|
104
|
+
style: {
|
|
105
|
+
transform: `translateY(${item.start - virtualizer.options.scrollMargin}px)`
|
|
106
|
+
},
|
|
107
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_JsonTreeRow_cjs_namespaceObject.JsonTreeRow, {
|
|
108
|
+
node: row.node,
|
|
109
|
+
depth: row.depth
|
|
110
|
+
})
|
|
111
|
+
}, item.key);
|
|
112
|
+
})
|
|
113
|
+
});
|
|
114
|
+
}
|
|
38
115
|
function valueAsText(node) {
|
|
39
116
|
if ('string' == typeof node.value) return node.value;
|
|
40
117
|
if (void 0 === node.value) return 'null';
|
|
@@ -46,12 +123,23 @@ const DefaultRowWrapper = ({ className, style, onClick, children })=>/*#__PURE__
|
|
|
46
123
|
onClick: onClick,
|
|
47
124
|
children: children
|
|
48
125
|
});
|
|
49
|
-
function JsonTree({ nodes, collapsed = {}, onToggleCollapsed, query, filterPredicate, readOnly = false, onEdit, rowWrapper, decorateNode, deriveTypeIcon, renderValue, nodeActions, maxInlineActions = 3, renderCodeEditor, pathForCopy, onCopy, emptyMessage, className }) {
|
|
126
|
+
function JsonTree({ nodes, collapsed = {}, onToggleCollapsed, query, filterPredicate, readOnly = false, onEdit, rowWrapper, decorateNode, deriveTypeIcon, renderValue, nodeActions, maxInlineActions = 3, renderCodeEditor, pathForCopy, onCopy, virtualized = false, scrollElement, emptyMessage, className }) {
|
|
50
127
|
const { _ } = (0, index_cjs_namespaceObject.useSafeLingui)();
|
|
128
|
+
const containerRef = (0, external_react_namespaceObject.useRef)(null);
|
|
129
|
+
const usesAncestorScroller = virtualized && !!scrollElement;
|
|
51
130
|
const RowWrapper = rowWrapper ?? DefaultRowWrapper;
|
|
52
131
|
const [editingPath, setEditingPath] = (0, external_react_namespaceObject.useState)(null);
|
|
53
132
|
const [jsonEditingPath, setJsonEditingPath] = (0, external_react_namespaceObject.useState)(null);
|
|
54
133
|
const [wrappedPaths, setWrappedPaths] = (0, external_react_namespaceObject.useState)({});
|
|
134
|
+
const pinnedPaths = (0, external_react_namespaceObject.useMemo)(()=>[
|
|
135
|
+
...new Set([
|
|
136
|
+
editingPath,
|
|
137
|
+
jsonEditingPath
|
|
138
|
+
].filter((path)=>null !== path))
|
|
139
|
+
], [
|
|
140
|
+
editingPath,
|
|
141
|
+
jsonEditingPath
|
|
142
|
+
]);
|
|
55
143
|
const [copied, setCopied] = (0, external_react_namespaceObject.useState)(null);
|
|
56
144
|
const copyTimerRef = (0, external_react_namespaceObject.useRef)(null);
|
|
57
145
|
(0, external_react_namespaceObject.useEffect)(()=>()=>{
|
|
@@ -140,9 +228,15 @@ function JsonTree({ nodes, collapsed = {}, onToggleCollapsed, query, filterPredi
|
|
|
140
228
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_JsonTreeRow_cjs_namespaceObject.JsonTreeRowContextProvider, {
|
|
141
229
|
value: rowContext,
|
|
142
230
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
143
|
-
|
|
231
|
+
ref: containerRef,
|
|
232
|
+
className: (0, apollo_wind_namespaceObject.cn)(usesAncestorScroller ? 'overflow-x-clip' : 'h-full overflow-y-auto overflow-x-hidden', virtualized && !usesAncestorScroller && 'max-h-screen', virtualized && '[overflow-anchor:none]', className),
|
|
144
233
|
children: [
|
|
145
|
-
|
|
234
|
+
virtualized ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(VirtualRows, {
|
|
235
|
+
rows: rows,
|
|
236
|
+
containerRef: containerRef,
|
|
237
|
+
scrollElement: scrollElement,
|
|
238
|
+
pinnedPaths: pinnedPaths
|
|
239
|
+
}) : rows.map(({ node, depth })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_JsonTreeRow_cjs_namespaceObject.JsonTreeRow, {
|
|
146
240
|
node: node,
|
|
147
241
|
depth: depth
|
|
148
242
|
}, node.path)),
|
|
@@ -16,8 +16,10 @@ export interface JsonTreeProps {
|
|
|
16
16
|
renderCodeEditor?: RenderCodeEditor;
|
|
17
17
|
pathForCopy?: (path: string) => string;
|
|
18
18
|
onCopy?: (event: CopyEvent) => void;
|
|
19
|
+
virtualized?: boolean;
|
|
20
|
+
scrollElement?: HTMLElement | null;
|
|
19
21
|
emptyMessage?: string;
|
|
20
22
|
className?: string;
|
|
21
23
|
}
|
|
22
|
-
export declare function JsonTree({ nodes, collapsed, onToggleCollapsed, query, filterPredicate, readOnly, onEdit, rowWrapper, decorateNode, deriveTypeIcon, renderValue, nodeActions, maxInlineActions, renderCodeEditor, pathForCopy, onCopy, emptyMessage, className, }: JsonTreeProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare function JsonTree({ nodes, collapsed, onToggleCollapsed, query, filterPredicate, readOnly, onEdit, rowWrapper, decorateNode, deriveTypeIcon, renderValue, nodeActions, maxInlineActions, renderCodeEditor, pathForCopy, onCopy, virtualized, scrollElement, emptyMessage, className, }: JsonTreeProps): import("react/jsx-runtime").JSX.Element;
|
|
23
25
|
//# sourceMappingURL=JsonTree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonTree.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/JsonTree/JsonTree.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"JsonTree.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/JsonTree/JsonTree.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,SAAS,EACT,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,SAAS,EACT,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAQ1B,MAAM,WAAW,aAAa;IAE5B,KAAK,EAAE,YAAY,EAAE,CAAC;IAEtB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAE3C,KAAK,CAAC,EAAE,MAAM,CAAC;IAKf,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC;IAElD,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,GAAG,SAAS,KAAK,IAAI,CAAC;IAMpE,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAEhC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,cAAc,GAAG,SAAS,CAAC;IAElE,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC,WAAW,CAAC,EAAE,eAAe,CAAC;IAM9B,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAKlC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IAEpC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAEvC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IAQpC,WAAW,CAAC,EAAE,OAAO,CAAC;IAQtB,aAAa,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA+ID,wBAAgB,QAAQ,CAAC,EACvB,KAAK,EACL,SAAc,EACd,iBAAiB,EACjB,KAAK,EACL,eAAe,EACf,QAAgB,EAChB,MAAM,EACN,UAAU,EACV,YAAY,EACZ,cAAc,EACd,WAAW,EACX,WAAW,EACX,gBAAoB,EACpB,gBAAgB,EAChB,WAAW,EACX,MAAM,EACN,WAAmB,EACnB,aAAa,EACb,YAAY,EACZ,SAAS,GACV,EAAE,aAAa,2CA4Jf"}
|
|
@@ -1,12 +1,89 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
2
3
|
import { cn } from "@uipath/apollo-wind";
|
|
3
4
|
import { TooltipProvider } from "@uipath/apollo-wind/components/ui/tooltip";
|
|
4
|
-
import { useEffect, useMemo, useRef, useState } from "react";
|
|
5
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
5
6
|
import { useSafeLingui } from "../../../i18n/index.js";
|
|
7
|
+
import { useIsomorphicLayoutEffect } from "../../hooks/useIsomorphicLayoutEffect.js";
|
|
6
8
|
import { CanvasTooltipProviderMarker } from "../CanvasTooltip.js";
|
|
7
9
|
import { flattenJsonTree } from "./buildJsonTree.js";
|
|
8
10
|
import { copyTextToClipboard } from "./clipboard.js";
|
|
9
|
-
import { JsonTreeRow, JsonTreeRowContextProvider } from "./JsonTreeRow.js";
|
|
11
|
+
import { JsonTreeRow, JsonTreeRowContextProvider, ROW_MIN_HEIGHT_PX } from "./JsonTreeRow.js";
|
|
12
|
+
const VIRTUAL_OVERSCAN = 10;
|
|
13
|
+
function scrollMarginOf(element, scrollElement) {
|
|
14
|
+
return Math.round(element.getBoundingClientRect().top - scrollElement.getBoundingClientRect().top + scrollElement.scrollTop);
|
|
15
|
+
}
|
|
16
|
+
function VirtualRows({ rows, containerRef, scrollElement, pinnedPaths }) {
|
|
17
|
+
const [scrollMargin, setScrollMargin] = useState(0);
|
|
18
|
+
const getItemKey = useCallback((index)=>rows[index]?.node.path ?? index, [
|
|
19
|
+
rows
|
|
20
|
+
]);
|
|
21
|
+
const virtualizer = useVirtualizer({
|
|
22
|
+
count: rows.length,
|
|
23
|
+
getScrollElement: ()=>scrollElement ?? containerRef.current,
|
|
24
|
+
estimateSize: ()=>ROW_MIN_HEIGHT_PX,
|
|
25
|
+
getItemKey,
|
|
26
|
+
overscan: VIRTUAL_OVERSCAN,
|
|
27
|
+
scrollMargin
|
|
28
|
+
});
|
|
29
|
+
useIsomorphicLayoutEffect(()=>{
|
|
30
|
+
const container = containerRef.current;
|
|
31
|
+
if (!container || !scrollElement) {
|
|
32
|
+
if (0 !== scrollMargin) setScrollMargin(0);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (virtualizer.isScrolling) return;
|
|
36
|
+
const next = scrollMarginOf(container, scrollElement);
|
|
37
|
+
if (next !== scrollMargin) setScrollMargin(next);
|
|
38
|
+
});
|
|
39
|
+
const isPinning = pinnedPaths.length > 0;
|
|
40
|
+
const indexByPath = useMemo(()=>{
|
|
41
|
+
if (!isPinning) return;
|
|
42
|
+
const byPath = new Map();
|
|
43
|
+
rows.forEach((row, index)=>byPath.set(row.node.path, index));
|
|
44
|
+
return byPath;
|
|
45
|
+
}, [
|
|
46
|
+
isPinning,
|
|
47
|
+
rows
|
|
48
|
+
]);
|
|
49
|
+
const items = virtualizer.getVirtualItems();
|
|
50
|
+
const firstWindowed = items[0]?.index ?? -1;
|
|
51
|
+
const lastWindowed = items[items.length - 1]?.index ?? -2;
|
|
52
|
+
const pinnedItems = [];
|
|
53
|
+
if (indexByPath) for (const path of pinnedPaths){
|
|
54
|
+
const index = indexByPath.get(path);
|
|
55
|
+
if (void 0 === index || index >= firstWindowed && index <= lastWindowed) continue;
|
|
56
|
+
const measurement = virtualizer.measurementsCache[index];
|
|
57
|
+
if (measurement) pinnedItems.push(measurement);
|
|
58
|
+
}
|
|
59
|
+
const rendered = 0 === pinnedItems.length ? items : [
|
|
60
|
+
...pinnedItems.filter((item)=>item.index < firstWindowed),
|
|
61
|
+
...items,
|
|
62
|
+
...pinnedItems.filter((item)=>item.index > lastWindowed)
|
|
63
|
+
];
|
|
64
|
+
return /*#__PURE__*/ jsx("div", {
|
|
65
|
+
className: "relative",
|
|
66
|
+
style: {
|
|
67
|
+
height: virtualizer.getTotalSize()
|
|
68
|
+
},
|
|
69
|
+
children: rendered.map((item)=>{
|
|
70
|
+
const row = rows[item.index];
|
|
71
|
+
if (!row) return null;
|
|
72
|
+
return /*#__PURE__*/ jsx("div", {
|
|
73
|
+
"data-index": item.index,
|
|
74
|
+
ref: virtualizer.measureElement,
|
|
75
|
+
className: "absolute top-0 left-0 w-full",
|
|
76
|
+
style: {
|
|
77
|
+
transform: `translateY(${item.start - virtualizer.options.scrollMargin}px)`
|
|
78
|
+
},
|
|
79
|
+
children: /*#__PURE__*/ jsx(JsonTreeRow, {
|
|
80
|
+
node: row.node,
|
|
81
|
+
depth: row.depth
|
|
82
|
+
})
|
|
83
|
+
}, item.key);
|
|
84
|
+
})
|
|
85
|
+
});
|
|
86
|
+
}
|
|
10
87
|
function valueAsText(node) {
|
|
11
88
|
if ('string' == typeof node.value) return node.value;
|
|
12
89
|
if (void 0 === node.value) return 'null';
|
|
@@ -18,12 +95,23 @@ const DefaultRowWrapper = ({ className, style, onClick, children })=>/*#__PURE__
|
|
|
18
95
|
onClick: onClick,
|
|
19
96
|
children: children
|
|
20
97
|
});
|
|
21
|
-
function JsonTree({ nodes, collapsed = {}, onToggleCollapsed, query, filterPredicate, readOnly = false, onEdit, rowWrapper, decorateNode, deriveTypeIcon, renderValue, nodeActions, maxInlineActions = 3, renderCodeEditor, pathForCopy, onCopy, emptyMessage, className }) {
|
|
98
|
+
function JsonTree({ nodes, collapsed = {}, onToggleCollapsed, query, filterPredicate, readOnly = false, onEdit, rowWrapper, decorateNode, deriveTypeIcon, renderValue, nodeActions, maxInlineActions = 3, renderCodeEditor, pathForCopy, onCopy, virtualized = false, scrollElement, emptyMessage, className }) {
|
|
22
99
|
const { _ } = useSafeLingui();
|
|
100
|
+
const containerRef = useRef(null);
|
|
101
|
+
const usesAncestorScroller = virtualized && !!scrollElement;
|
|
23
102
|
const RowWrapper = rowWrapper ?? DefaultRowWrapper;
|
|
24
103
|
const [editingPath, setEditingPath] = useState(null);
|
|
25
104
|
const [jsonEditingPath, setJsonEditingPath] = useState(null);
|
|
26
105
|
const [wrappedPaths, setWrappedPaths] = useState({});
|
|
106
|
+
const pinnedPaths = useMemo(()=>[
|
|
107
|
+
...new Set([
|
|
108
|
+
editingPath,
|
|
109
|
+
jsonEditingPath
|
|
110
|
+
].filter((path)=>null !== path))
|
|
111
|
+
], [
|
|
112
|
+
editingPath,
|
|
113
|
+
jsonEditingPath
|
|
114
|
+
]);
|
|
27
115
|
const [copied, setCopied] = useState(null);
|
|
28
116
|
const copyTimerRef = useRef(null);
|
|
29
117
|
useEffect(()=>()=>{
|
|
@@ -112,9 +200,15 @@ function JsonTree({ nodes, collapsed = {}, onToggleCollapsed, query, filterPredi
|
|
|
112
200
|
children: /*#__PURE__*/ jsx(JsonTreeRowContextProvider, {
|
|
113
201
|
value: rowContext,
|
|
114
202
|
children: /*#__PURE__*/ jsxs("div", {
|
|
115
|
-
|
|
203
|
+
ref: containerRef,
|
|
204
|
+
className: cn(usesAncestorScroller ? 'overflow-x-clip' : 'h-full overflow-y-auto overflow-x-hidden', virtualized && !usesAncestorScroller && 'max-h-screen', virtualized && '[overflow-anchor:none]', className),
|
|
116
205
|
children: [
|
|
117
|
-
|
|
206
|
+
virtualized ? /*#__PURE__*/ jsx(VirtualRows, {
|
|
207
|
+
rows: rows,
|
|
208
|
+
containerRef: containerRef,
|
|
209
|
+
scrollElement: scrollElement,
|
|
210
|
+
pinnedPaths: pinnedPaths
|
|
211
|
+
}) : rows.map(({ node, depth })=>/*#__PURE__*/ jsx(JsonTreeRow, {
|
|
118
212
|
node: node,
|
|
119
213
|
depth: depth
|
|
120
214
|
}, node.path)),
|
|
@@ -25,7 +25,8 @@ var __webpack_exports__ = {};
|
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
27
|
JsonTreeRowContextProvider: ()=>JsonTreeRowContextProvider,
|
|
28
|
-
JsonTreeRow: ()=>JsonTreeRow
|
|
28
|
+
JsonTreeRow: ()=>JsonTreeRow,
|
|
29
|
+
ROW_MIN_HEIGHT_PX: ()=>ROW_MIN_HEIGHT_PX
|
|
29
30
|
});
|
|
30
31
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
32
|
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
@@ -41,6 +42,7 @@ const external_NodeKey_cjs_namespaceObject = require("./NodeKey.cjs");
|
|
|
41
42
|
const external_RowActions_cjs_namespaceObject = require("./RowActions.cjs");
|
|
42
43
|
const external_ScalarValueCell_cjs_namespaceObject = require("./ScalarValueCell.cjs");
|
|
43
44
|
const ROW_CLASS = 'group flex min-h-7 cursor-default items-center gap-1.5 py-1 pr-1 transition hover:bg-surface-overlay';
|
|
45
|
+
const ROW_MIN_HEIGHT_PX = 28;
|
|
44
46
|
const VALUE_CELL_CLASS = 'flex min-w-8 flex-1 items-center';
|
|
45
47
|
function rowIndent(depth, extra = 0) {
|
|
46
48
|
return {
|
|
@@ -345,9 +347,11 @@ function JsonTreeRow({ node, depth }) {
|
|
|
345
347
|
}
|
|
346
348
|
exports.JsonTreeRow = __webpack_exports__.JsonTreeRow;
|
|
347
349
|
exports.JsonTreeRowContextProvider = __webpack_exports__.JsonTreeRowContextProvider;
|
|
350
|
+
exports.ROW_MIN_HEIGHT_PX = __webpack_exports__.ROW_MIN_HEIGHT_PX;
|
|
348
351
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
349
352
|
"JsonTreeRow",
|
|
350
|
-
"JsonTreeRowContextProvider"
|
|
353
|
+
"JsonTreeRowContextProvider",
|
|
354
|
+
"ROW_MIN_HEIGHT_PX"
|
|
351
355
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
352
356
|
Object.defineProperty(exports, '__esModule', {
|
|
353
357
|
value: true
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CopyEvent, DeriveTypeIcon, JsonTreeNode, JsonTreeRowWrapper, JsonValue, NodeActionsResolver, NodeDecoration, RenderCodeEditor, RenderValueCell } from './JsonTree.types';
|
|
2
|
+
export declare const ROW_MIN_HEIGHT_PX = 28;
|
|
2
3
|
export interface JsonTreeRowContextValue {
|
|
3
4
|
collapsed: Record<string, boolean>;
|
|
4
5
|
onToggleCollapsed?: (path: string) => void;
|