@uipath/apollo-react 6.72.0 → 6.74.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/JsonTree/JsonTree.cjs +256 -214
- package/dist/canvas/components/JsonTree/JsonTree.d.ts +31 -25
- package/dist/canvas/components/JsonTree/JsonTree.d.ts.map +1 -1
- package/dist/canvas/components/JsonTree/JsonTree.js +238 -217
- package/dist/canvas/components/JsonTree/index.cjs +67 -58
- package/dist/canvas/components/JsonTree/index.d.ts +2 -8
- package/dist/canvas/components/JsonTree/index.d.ts.map +1 -1
- package/dist/canvas/components/JsonTree/index.js +2 -8
- package/dist/canvas/components/NodeIOView/NodeIOView.types.d.ts +1 -1
- package/dist/canvas/components/NodeIOView/NodeIOView.types.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNode.types.d.ts +1 -1
- package/dist/canvas/components/StageNode/StageNode.types.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNodeHeader.cjs +15 -6
- package/dist/canvas/components/StageNode/StageNodeHeader.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNodeHeader.js +15 -6
- package/dist/canvas/stories/templates/LayoutPreviewsPage.cjs +1257 -0
- package/dist/canvas/stories/templates/LayoutPreviewsPage.d.ts +2 -0
- package/dist/canvas/stories/templates/LayoutPreviewsPage.d.ts.map +1 -0
- package/dist/canvas/stories/templates/LayoutPreviewsPage.js +1223 -0
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/package.json +2 -2
- package/dist/canvas/components/JsonTree/DecorationChip.cjs +0 -81
- package/dist/canvas/components/JsonTree/DecorationChip.d.ts +0 -5
- package/dist/canvas/components/JsonTree/DecorationChip.d.ts.map +0 -1
- package/dist/canvas/components/JsonTree/DecorationChip.js +0 -47
- package/dist/canvas/components/JsonTree/EditorChrome.cjs +0 -93
- package/dist/canvas/components/JsonTree/EditorChrome.d.ts +0 -18
- package/dist/canvas/components/JsonTree/EditorChrome.d.ts.map +0 -1
- package/dist/canvas/components/JsonTree/EditorChrome.js +0 -56
- package/dist/canvas/components/JsonTree/JsonContainerEditor.cjs +0 -103
- package/dist/canvas/components/JsonTree/JsonContainerEditor.d.ts +0 -10
- package/dist/canvas/components/JsonTree/JsonContainerEditor.d.ts.map +0 -1
- package/dist/canvas/components/JsonTree/JsonContainerEditor.js +0 -69
- package/dist/canvas/components/JsonTree/JsonLeafValueEditor.cjs +0 -98
- package/dist/canvas/components/JsonTree/JsonLeafValueEditor.d.ts +0 -9
- package/dist/canvas/components/JsonTree/JsonLeafValueEditor.d.ts.map +0 -1
- package/dist/canvas/components/JsonTree/JsonLeafValueEditor.js +0 -64
- package/dist/canvas/components/JsonTree/JsonMultilineLeafEditor.cjs +0 -86
- package/dist/canvas/components/JsonTree/JsonMultilineLeafEditor.d.ts +0 -9
- package/dist/canvas/components/JsonTree/JsonMultilineLeafEditor.d.ts.map +0 -1
- package/dist/canvas/components/JsonTree/JsonMultilineLeafEditor.js +0 -52
- package/dist/canvas/components/JsonTree/JsonTree.types.cjs +0 -18
- package/dist/canvas/components/JsonTree/JsonTree.types.d.ts +0 -110
- package/dist/canvas/components/JsonTree/JsonTree.types.d.ts.map +0 -1
- package/dist/canvas/components/JsonTree/JsonTree.types.js +0 -0
- package/dist/canvas/components/JsonTree/JsonTreeRow.cjs +0 -358
- package/dist/canvas/components/JsonTree/JsonTreeRow.d.ts +0 -36
- package/dist/canvas/components/JsonTree/JsonTreeRow.d.ts.map +0 -1
- package/dist/canvas/components/JsonTree/JsonTreeRow.js +0 -318
- package/dist/canvas/components/JsonTree/JsonTreeToolbar.cjs +0 -224
- package/dist/canvas/components/JsonTree/JsonTreeToolbar.d.ts +0 -17
- package/dist/canvas/components/JsonTree/JsonTreeToolbar.d.ts.map +0 -1
- package/dist/canvas/components/JsonTree/JsonTreeToolbar.js +0 -190
- package/dist/canvas/components/JsonTree/JsonTypeBadge.cjs +0 -70
- package/dist/canvas/components/JsonTree/JsonTypeBadge.d.ts +0 -10
- package/dist/canvas/components/JsonTree/JsonTypeBadge.d.ts.map +0 -1
- package/dist/canvas/components/JsonTree/JsonTypeBadge.js +0 -36
- package/dist/canvas/components/JsonTree/NodeKey.cjs +0 -86
- package/dist/canvas/components/JsonTree/NodeKey.d.ts +0 -10
- package/dist/canvas/components/JsonTree/NodeKey.d.ts.map +0 -1
- package/dist/canvas/components/JsonTree/NodeKey.js +0 -52
- package/dist/canvas/components/JsonTree/RowActions.cjs +0 -121
- package/dist/canvas/components/JsonTree/RowActions.d.ts +0 -8
- package/dist/canvas/components/JsonTree/RowActions.d.ts.map +0 -1
- package/dist/canvas/components/JsonTree/RowActions.js +0 -87
- package/dist/canvas/components/JsonTree/ScalarValueCell.cjs +0 -132
- package/dist/canvas/components/JsonTree/ScalarValueCell.d.ts +0 -12
- package/dist/canvas/components/JsonTree/ScalarValueCell.d.ts.map +0 -1
- package/dist/canvas/components/JsonTree/ScalarValueCell.js +0 -95
- package/dist/canvas/components/JsonTree/buildJsonTree.cjs +0 -321
- package/dist/canvas/components/JsonTree/buildJsonTree.d.ts +0 -39
- package/dist/canvas/components/JsonTree/buildJsonTree.d.ts.map +0 -1
- package/dist/canvas/components/JsonTree/buildJsonTree.js +0 -254
- package/dist/canvas/components/JsonTree/clipboard.cjs +0 -63
- package/dist/canvas/components/JsonTree/clipboard.d.ts +0 -2
- package/dist/canvas/components/JsonTree/clipboard.d.ts.map +0 -1
- package/dist/canvas/components/JsonTree/clipboard.js +0 -29
- package/dist/canvas/components/JsonTree/leafEditTypes.cjs +0 -74
- package/dist/canvas/components/JsonTree/leafEditTypes.d.ts +0 -6
- package/dist/canvas/components/JsonTree/leafEditTypes.d.ts.map +0 -1
- package/dist/canvas/components/JsonTree/leafEditTypes.js +0 -34
|
@@ -1,225 +1,246 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { TooltipProvider } from "@uipath/apollo-wind/components/ui/tooltip";
|
|
5
|
-
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { JsonContainerEditor, JsonLeafValueEditor, JsonMultilineLeafEditor, JsonTreeToolbar, JsonTreeView, JsonTreeViewProvider, JsonTypeBadge } from "@uipath/apollo-wind";
|
|
3
|
+
import { createContext, useContext, useMemo } from "react";
|
|
6
4
|
import { useSafeLingui } from "../../../i18n/index.js";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import { flattenJsonTree } from "./buildJsonTree.js";
|
|
10
|
-
import { copyTextToClipboard } from "./clipboard.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, container, 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 ?? container,
|
|
24
|
-
estimateSize: ()=>ROW_MIN_HEIGHT_PX,
|
|
25
|
-
getItemKey,
|
|
26
|
-
overscan: VIRTUAL_OVERSCAN,
|
|
27
|
-
scrollMargin
|
|
28
|
-
});
|
|
29
|
-
useIsomorphicLayoutEffect(()=>{
|
|
30
|
-
if (!container || !scrollElement) {
|
|
31
|
-
if (0 !== scrollMargin) setScrollMargin(0);
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
if (virtualizer.isScrolling) return;
|
|
35
|
-
const next = scrollMarginOf(container, scrollElement);
|
|
36
|
-
if (next !== scrollMargin) setScrollMargin(next);
|
|
37
|
-
});
|
|
38
|
-
const isPinning = pinnedPaths.length > 0;
|
|
39
|
-
const indexByPath = useMemo(()=>{
|
|
40
|
-
if (!isPinning) return;
|
|
41
|
-
const byPath = new Map();
|
|
42
|
-
rows.forEach((row, index)=>byPath.set(row.node.path, index));
|
|
43
|
-
return byPath;
|
|
44
|
-
}, [
|
|
45
|
-
isPinning,
|
|
46
|
-
rows
|
|
47
|
-
]);
|
|
48
|
-
const items = virtualizer.getVirtualItems();
|
|
49
|
-
const firstWindowed = items[0]?.index ?? -1;
|
|
50
|
-
const lastWindowed = items[items.length - 1]?.index ?? -2;
|
|
51
|
-
const pinnedItems = [];
|
|
52
|
-
if (indexByPath) for (const path of pinnedPaths){
|
|
53
|
-
const index = indexByPath.get(path);
|
|
54
|
-
if (void 0 === index || index >= firstWindowed && index <= lastWindowed) continue;
|
|
55
|
-
const measurement = virtualizer.measurementsCache[index];
|
|
56
|
-
if (measurement) pinnedItems.push(measurement);
|
|
57
|
-
}
|
|
58
|
-
const rendered = 0 === pinnedItems.length ? items : [
|
|
59
|
-
...pinnedItems.filter((item)=>item.index < firstWindowed),
|
|
60
|
-
...items,
|
|
61
|
-
...pinnedItems.filter((item)=>item.index > lastWindowed)
|
|
62
|
-
];
|
|
63
|
-
return /*#__PURE__*/ jsx("div", {
|
|
64
|
-
className: "relative",
|
|
65
|
-
style: {
|
|
66
|
-
height: virtualizer.getTotalSize()
|
|
67
|
-
},
|
|
68
|
-
children: rendered.map((item)=>{
|
|
69
|
-
const row = rows[item.index];
|
|
70
|
-
if (!row) return null;
|
|
71
|
-
return /*#__PURE__*/ jsx("div", {
|
|
72
|
-
"data-index": item.index,
|
|
73
|
-
ref: virtualizer.measureElement,
|
|
74
|
-
className: "absolute top-0 left-0 w-full",
|
|
75
|
-
style: {
|
|
76
|
-
transform: `translateY(${item.start - virtualizer.options.scrollMargin}px)`
|
|
77
|
-
},
|
|
78
|
-
children: /*#__PURE__*/ jsx(JsonTreeRow, {
|
|
79
|
-
node: row.node,
|
|
80
|
-
depth: row.depth
|
|
81
|
-
})
|
|
82
|
-
}, item.key);
|
|
83
|
-
})
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
function valueAsText(node) {
|
|
87
|
-
if ('string' == typeof node.value) return node.value;
|
|
88
|
-
if (void 0 === node.value) return 'null';
|
|
89
|
-
return JSON.stringify(node.value, null, 2);
|
|
90
|
-
}
|
|
91
|
-
const DefaultRowWrapper = ({ className, style, onClick, children })=>/*#__PURE__*/ jsx("div", {
|
|
92
|
-
className: className,
|
|
93
|
-
style: style,
|
|
94
|
-
onClick: onClick,
|
|
95
|
-
children: children
|
|
96
|
-
});
|
|
97
|
-
function JsonTreeView({ nodes, collapsed = {}, onToggleCollapsed, query, filterPredicate, readOnly = false, onEdit, rowWrapper, decorateNode, deriveTypeIcon, renderValue, nodeActions, maxInlineActions = 3, renderCodeEditor, pathForCopy, onCopy, virtualized = false, scrollElement, emptyMessage, className }) {
|
|
5
|
+
const CANVAS_TOOLTIP_CLASS = 'z-1200!';
|
|
6
|
+
function useCanvasJsonTreeViewStrings() {
|
|
98
7
|
const { _ } = useSafeLingui();
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
8
|
+
return useMemo(()=>({
|
|
9
|
+
arrayItem: _({
|
|
10
|
+
id: 'canvas.json_value_panel.array_item',
|
|
11
|
+
message: 'item'
|
|
12
|
+
}),
|
|
13
|
+
emptySearch: _({
|
|
14
|
+
id: 'canvas.json_value_panel.empty_search',
|
|
15
|
+
message: 'No fields match your search.'
|
|
16
|
+
}),
|
|
17
|
+
emptyDefault: _({
|
|
18
|
+
id: 'canvas.json_value_panel.empty_default',
|
|
19
|
+
message: 'No fields to display.'
|
|
20
|
+
}),
|
|
21
|
+
expandKey: (key)=>_({
|
|
22
|
+
id: 'canvas.json_value_panel.expand_key',
|
|
23
|
+
message: 'Expand {key}',
|
|
24
|
+
values: {
|
|
25
|
+
key
|
|
26
|
+
}
|
|
27
|
+
}),
|
|
28
|
+
collapseKey: (key)=>_({
|
|
29
|
+
id: 'canvas.json_value_panel.collapse_key',
|
|
30
|
+
message: 'Collapse {key}',
|
|
31
|
+
values: {
|
|
32
|
+
key
|
|
33
|
+
}
|
|
34
|
+
}),
|
|
35
|
+
itemCount: (count)=>_({
|
|
36
|
+
id: 'canvas.json_value_panel.item_count',
|
|
37
|
+
message: '{count, plural, one {# item} other {# items}}',
|
|
38
|
+
values: {
|
|
39
|
+
count
|
|
40
|
+
}
|
|
41
|
+
}),
|
|
42
|
+
keyCount: (count)=>_({
|
|
43
|
+
id: 'canvas.json_value_panel.key_count',
|
|
44
|
+
message: '{count, plural, one {# key} other {# keys}}',
|
|
45
|
+
values: {
|
|
46
|
+
count
|
|
47
|
+
}
|
|
48
|
+
}),
|
|
49
|
+
requiredMarker: _({
|
|
50
|
+
id: 'canvas.json_value_panel.required_marker',
|
|
51
|
+
message: 'required'
|
|
52
|
+
}),
|
|
53
|
+
pathCopied: _({
|
|
54
|
+
id: 'canvas.json_value_panel.path_copied',
|
|
55
|
+
message: 'Path copied'
|
|
56
|
+
}),
|
|
57
|
+
copyPathHint: _({
|
|
58
|
+
id: 'canvas.json_value_panel.copy_path_hint',
|
|
59
|
+
message: 'Click to copy this path'
|
|
60
|
+
}),
|
|
61
|
+
copyPathFor: (path)=>_({
|
|
62
|
+
id: 'canvas.json_value_panel.copy_path_for',
|
|
63
|
+
message: 'Copy path for {path}',
|
|
64
|
+
values: {
|
|
65
|
+
path
|
|
66
|
+
}
|
|
67
|
+
}),
|
|
68
|
+
wrapValue: _({
|
|
69
|
+
id: 'canvas.json_value_panel.wrap_value',
|
|
70
|
+
message: 'Wrap value'
|
|
71
|
+
}),
|
|
72
|
+
unwrapValue: _({
|
|
73
|
+
id: 'canvas.json_value_panel.unwrap_value',
|
|
74
|
+
message: 'Unwrap value'
|
|
75
|
+
}),
|
|
76
|
+
wrapValueOf: (key)=>_({
|
|
77
|
+
id: 'canvas.json_value_panel.wrap_value_of',
|
|
78
|
+
message: 'Wrap value of {key}',
|
|
79
|
+
values: {
|
|
80
|
+
key
|
|
81
|
+
}
|
|
82
|
+
}),
|
|
83
|
+
unwrapValueOf: (key)=>_({
|
|
84
|
+
id: 'canvas.json_value_panel.unwrap_value_of',
|
|
85
|
+
message: 'Unwrap value of {key}',
|
|
86
|
+
values: {
|
|
87
|
+
key
|
|
88
|
+
}
|
|
89
|
+
}),
|
|
90
|
+
editAsJson: _({
|
|
91
|
+
id: 'canvas.json_value_panel.edit_as_json',
|
|
92
|
+
message: 'Edit as JSON'
|
|
93
|
+
}),
|
|
94
|
+
editKeyAsJson: (key)=>_({
|
|
95
|
+
id: 'canvas.json_value_panel.edit_key_as_json',
|
|
96
|
+
message: 'Edit {key} as JSON',
|
|
97
|
+
values: {
|
|
98
|
+
key
|
|
99
|
+
}
|
|
100
|
+
}),
|
|
101
|
+
copyValue: _({
|
|
102
|
+
id: 'canvas.json_value_panel.copy_value',
|
|
103
|
+
message: 'Copy value'
|
|
104
|
+
}),
|
|
105
|
+
copyValueOf: (key)=>_({
|
|
106
|
+
id: 'canvas.json_value_panel.copy_value_of',
|
|
107
|
+
message: 'Copy value of {key}',
|
|
108
|
+
values: {
|
|
109
|
+
key
|
|
110
|
+
}
|
|
111
|
+
}),
|
|
112
|
+
moreActions: _({
|
|
113
|
+
id: 'canvas.json_value_panel.more_actions',
|
|
114
|
+
message: 'More actions'
|
|
115
|
+
}),
|
|
116
|
+
unsetValue: _({
|
|
117
|
+
id: 'canvas.json_value_panel.unset_value',
|
|
118
|
+
message: 'unset'
|
|
119
|
+
}),
|
|
120
|
+
editValueOf: (key)=>_({
|
|
121
|
+
id: 'canvas.json_value_panel.edit_value_of',
|
|
122
|
+
message: 'Edit value of {key}',
|
|
123
|
+
values: {
|
|
124
|
+
key
|
|
125
|
+
}
|
|
126
|
+
}),
|
|
127
|
+
editJsonOf: (key)=>_({
|
|
128
|
+
id: 'canvas.json_value_panel.edit_json_of',
|
|
129
|
+
message: 'Edit JSON of {key}',
|
|
130
|
+
values: {
|
|
131
|
+
key
|
|
132
|
+
}
|
|
133
|
+
}),
|
|
134
|
+
editHint: _({
|
|
135
|
+
id: 'canvas.json_value_panel.edit_hint',
|
|
136
|
+
message: 'Click to edit'
|
|
137
|
+
}),
|
|
138
|
+
toggleHint: _({
|
|
139
|
+
id: 'canvas.json_value_panel.toggle_hint',
|
|
140
|
+
message: 'Click to toggle'
|
|
141
|
+
}),
|
|
142
|
+
unsetEditHint: _({
|
|
143
|
+
id: 'canvas.json_value_panel.unset_edit_hint',
|
|
144
|
+
message: 'Click to set a value'
|
|
145
|
+
}),
|
|
146
|
+
enterNumber: _({
|
|
147
|
+
id: 'canvas.json_value_panel.enter_number',
|
|
148
|
+
message: 'Enter a number'
|
|
149
|
+
}),
|
|
150
|
+
enterValue: _({
|
|
151
|
+
id: 'canvas.json_value_panel.enter_value',
|
|
152
|
+
message: 'Enter a value'
|
|
153
|
+
}),
|
|
154
|
+
invalidJson: _({
|
|
155
|
+
id: 'canvas.json_value_panel.invalid_json',
|
|
156
|
+
message: 'Invalid JSON'
|
|
157
|
+
}),
|
|
158
|
+
apply: _({
|
|
159
|
+
id: 'canvas.json_value_panel.apply',
|
|
160
|
+
message: 'Apply'
|
|
161
|
+
}),
|
|
162
|
+
cancel: _({
|
|
163
|
+
id: 'canvas.json_value_panel.cancel',
|
|
164
|
+
message: 'Cancel'
|
|
165
|
+
}),
|
|
166
|
+
searchFields: _({
|
|
167
|
+
id: 'canvas.json_value_panel.search_fields',
|
|
168
|
+
message: 'Search fields and values...'
|
|
169
|
+
}),
|
|
170
|
+
searchFieldsAction: _({
|
|
171
|
+
id: 'canvas.json_value_panel.search_fields_action',
|
|
172
|
+
message: 'Search fields and values'
|
|
173
|
+
}),
|
|
174
|
+
clearSearch: _({
|
|
175
|
+
id: 'canvas.json_value_panel.clear_search',
|
|
176
|
+
message: 'Clear search'
|
|
177
|
+
}),
|
|
178
|
+
filter: _({
|
|
179
|
+
id: 'canvas.json_value_panel.filter',
|
|
180
|
+
message: 'Filter'
|
|
181
|
+
}),
|
|
182
|
+
filterActive: (label)=>_({
|
|
183
|
+
id: 'canvas.json_value_panel.filter_active',
|
|
184
|
+
message: 'Filter: {label}',
|
|
185
|
+
values: {
|
|
186
|
+
label
|
|
187
|
+
}
|
|
188
|
+
}),
|
|
189
|
+
filterAll: _({
|
|
190
|
+
id: 'canvas.json_value_panel.filter_all',
|
|
191
|
+
message: 'All'
|
|
192
|
+
}),
|
|
193
|
+
expandAll: _({
|
|
194
|
+
id: 'canvas.json_value_panel.expand_all',
|
|
195
|
+
message: 'Expand all'
|
|
196
|
+
}),
|
|
197
|
+
collapseAll: _({
|
|
198
|
+
id: 'canvas.json_value_panel.collapse_all',
|
|
199
|
+
message: 'Collapse all'
|
|
200
|
+
})
|
|
151
201
|
}), [
|
|
152
|
-
|
|
153
|
-
collapsed,
|
|
154
|
-
query,
|
|
155
|
-
filterPredicate,
|
|
156
|
-
decorateNode
|
|
202
|
+
_
|
|
157
203
|
]);
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
204
|
+
}
|
|
205
|
+
const InsideCanvasProviderContext = /*#__PURE__*/ createContext(false);
|
|
206
|
+
function JsonTree_JsonTreeViewProvider({ strings, tooltipContentClassName, children }) {
|
|
207
|
+
const insideCanvasProvider = useContext(InsideCanvasProviderContext);
|
|
208
|
+
const canvasStrings = useCanvasJsonTreeViewStrings();
|
|
209
|
+
const overrides = /*#__PURE__*/ jsx(JsonTreeViewProvider, {
|
|
210
|
+
strings: strings,
|
|
211
|
+
tooltipContentClassName: tooltipContentClassName,
|
|
212
|
+
children: /*#__PURE__*/ jsx(InsideCanvasProviderContext.Provider, {
|
|
213
|
+
value: true,
|
|
214
|
+
children: children
|
|
215
|
+
})
|
|
161
216
|
});
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
id: 'canvas.json_value_panel.empty_default',
|
|
168
|
-
message: 'No fields to display.'
|
|
217
|
+
if (insideCanvasProvider) return overrides;
|
|
218
|
+
return /*#__PURE__*/ jsx(JsonTreeViewProvider, {
|
|
219
|
+
strings: canvasStrings,
|
|
220
|
+
tooltipContentClassName: CANVAS_TOOLTIP_CLASS,
|
|
221
|
+
children: overrides
|
|
169
222
|
});
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
pathForCopy,
|
|
181
|
-
canEdit,
|
|
182
|
-
RowWrapper,
|
|
183
|
-
templateItemLabel,
|
|
184
|
-
editingPath,
|
|
185
|
-
jsonEditingPath,
|
|
186
|
-
wrappedPaths,
|
|
187
|
-
copied,
|
|
188
|
-
setEditingPath,
|
|
189
|
-
setJsonEditingPath,
|
|
190
|
-
copyPath,
|
|
191
|
-
copyValue,
|
|
192
|
-
toggleWrapped,
|
|
193
|
-
commitEdit
|
|
194
|
-
};
|
|
195
|
-
return /*#__PURE__*/ jsx(TooltipProvider, {
|
|
196
|
-
delayDuration: 300,
|
|
197
|
-
skipDelayDuration: 100,
|
|
198
|
-
children: /*#__PURE__*/ jsx(CanvasTooltipProviderMarker, {
|
|
199
|
-
children: /*#__PURE__*/ jsx(JsonTreeRowContextProvider, {
|
|
200
|
-
value: rowContext,
|
|
201
|
-
children: /*#__PURE__*/ jsxs("div", {
|
|
202
|
-
ref: setContainer,
|
|
203
|
-
className: cn(usesAncestorScroller ? 'overflow-x-clip' : 'h-full overflow-y-auto overflow-x-hidden', virtualized && !usesAncestorScroller && 'max-h-screen', virtualized && '[overflow-anchor:none]', className),
|
|
204
|
-
children: [
|
|
205
|
-
virtualized ? /*#__PURE__*/ jsx(VirtualRows, {
|
|
206
|
-
rows: rows,
|
|
207
|
-
container: container,
|
|
208
|
-
scrollElement: scrollElement,
|
|
209
|
-
pinnedPaths: pinnedPaths
|
|
210
|
-
}) : rows.map(({ node, depth })=>/*#__PURE__*/ jsx(JsonTreeRow, {
|
|
211
|
-
node: node,
|
|
212
|
-
depth: depth
|
|
213
|
-
}, node.path)),
|
|
214
|
-
0 === rows.length && /*#__PURE__*/ jsx("span", {
|
|
215
|
-
className: "p-4 text-center text-xs text-foreground-subtle",
|
|
216
|
-
children: resolvedEmptyMessage
|
|
217
|
-
})
|
|
218
|
-
]
|
|
219
|
-
})
|
|
223
|
+
}
|
|
224
|
+
function withCanvasStrings(Component, name) {
|
|
225
|
+
const Wrapped = (props)=>{
|
|
226
|
+
const insideCanvasProvider = useContext(InsideCanvasProviderContext);
|
|
227
|
+
if (insideCanvasProvider) return /*#__PURE__*/ jsx(Component, {
|
|
228
|
+
...props
|
|
229
|
+
});
|
|
230
|
+
return /*#__PURE__*/ jsx(JsonTree_JsonTreeViewProvider, {
|
|
231
|
+
children: /*#__PURE__*/ jsx(Component, {
|
|
232
|
+
...props
|
|
220
233
|
})
|
|
221
|
-
})
|
|
222
|
-
}
|
|
234
|
+
});
|
|
235
|
+
};
|
|
236
|
+
Wrapped.displayName = name;
|
|
237
|
+
return Wrapped;
|
|
223
238
|
}
|
|
224
|
-
const
|
|
225
|
-
|
|
239
|
+
const JsonTree_JsonTreeView = withCanvasStrings(JsonTreeView, 'JsonTreeView');
|
|
240
|
+
const JsonTree_JsonTreeToolbar = withCanvasStrings(JsonTreeToolbar, 'JsonTreeToolbar');
|
|
241
|
+
const JsonTree_JsonContainerEditor = withCanvasStrings(JsonContainerEditor, 'JsonContainerEditor');
|
|
242
|
+
const JsonTree_JsonLeafValueEditor = withCanvasStrings(JsonLeafValueEditor, 'JsonLeafValueEditor');
|
|
243
|
+
const JsonTree_JsonMultilineLeafEditor = withCanvasStrings(JsonMultilineLeafEditor, 'JsonMultilineLeafEditor');
|
|
244
|
+
const JsonTree_JsonTypeBadge = withCanvasStrings(JsonTypeBadge, 'JsonTypeBadge');
|
|
245
|
+
const JsonTree = JsonTree_JsonTreeView;
|
|
246
|
+
export { JsonTree_JsonContainerEditor as JsonContainerEditor, JsonTree_JsonLeafValueEditor as JsonLeafValueEditor, JsonTree_JsonMultilineLeafEditor as JsonMultilineLeafEditor, JsonTree, JsonTree_JsonTreeToolbar as JsonTreeToolbar, JsonTree_JsonTreeView as JsonTreeView, JsonTree_JsonTreeViewProvider as JsonTreeViewProvider, JsonTree_JsonTypeBadge as JsonTypeBadge, useCanvasJsonTreeViewStrings };
|
|
@@ -1,31 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
-
"./JsonContainerEditor" (module) {
|
|
4
|
-
module.exports = require("./JsonContainerEditor.cjs");
|
|
5
|
-
},
|
|
6
|
-
"./JsonLeafValueEditor" (module) {
|
|
7
|
-
module.exports = require("./JsonLeafValueEditor.cjs");
|
|
8
|
-
},
|
|
9
|
-
"./JsonMultilineLeafEditor" (module) {
|
|
10
|
-
module.exports = require("./JsonMultilineLeafEditor.cjs");
|
|
11
|
-
},
|
|
12
3
|
"./JsonTree?811b" (module) {
|
|
13
4
|
module.exports = require("./JsonTree.cjs");
|
|
14
5
|
},
|
|
15
|
-
"
|
|
16
|
-
module.exports = require("
|
|
17
|
-
},
|
|
18
|
-
"./JsonTreeToolbar" (module) {
|
|
19
|
-
module.exports = require("./JsonTreeToolbar.cjs");
|
|
20
|
-
},
|
|
21
|
-
"./JsonTypeBadge" (module) {
|
|
22
|
-
module.exports = require("./JsonTypeBadge.cjs");
|
|
23
|
-
},
|
|
24
|
-
"./buildJsonTree" (module) {
|
|
25
|
-
module.exports = require("./buildJsonTree.cjs");
|
|
26
|
-
},
|
|
27
|
-
"./clipboard" (module) {
|
|
28
|
-
module.exports = require("./clipboard.cjs");
|
|
6
|
+
"@uipath/apollo-wind" (module) {
|
|
7
|
+
module.exports = require("@uipath/apollo-wind");
|
|
29
8
|
}
|
|
30
9
|
};
|
|
31
10
|
var __webpack_module_cache__ = {};
|
|
@@ -71,44 +50,74 @@ function __webpack_require__(moduleId) {
|
|
|
71
50
|
var __webpack_exports__ = {};
|
|
72
51
|
(()=>{
|
|
73
52
|
__webpack_require__.r(__webpack_exports__);
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
var
|
|
91
|
-
var
|
|
92
|
-
for(const __rspack_import_key in _JsonMultilineLeafEditor__rspack_import_4)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_JsonMultilineLeafEditor__rspack_import_4[__rspack_import_key];
|
|
93
|
-
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
94
|
-
var _JsonTree__rspack_import_5 = __webpack_require__("./JsonTree?811b");
|
|
95
|
-
var __rspack_reexport = {};
|
|
96
|
-
for(const __rspack_import_key in _JsonTree__rspack_import_5)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_JsonTree__rspack_import_5[__rspack_import_key];
|
|
97
|
-
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
98
|
-
var _JsonTree_types__rspack_import_6 = __webpack_require__("./JsonTree.types");
|
|
99
|
-
var __rspack_reexport = {};
|
|
100
|
-
for(const __rspack_import_key in _JsonTree_types__rspack_import_6)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_JsonTree_types__rspack_import_6[__rspack_import_key];
|
|
101
|
-
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
102
|
-
var _JsonTreeToolbar__rspack_import_7 = __webpack_require__("./JsonTreeToolbar");
|
|
103
|
-
var __rspack_reexport = {};
|
|
104
|
-
for(const __rspack_import_key in _JsonTreeToolbar__rspack_import_7)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_JsonTreeToolbar__rspack_import_7[__rspack_import_key];
|
|
105
|
-
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
106
|
-
var _JsonTypeBadge__rspack_import_8 = __webpack_require__("./JsonTypeBadge");
|
|
53
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
54
|
+
DEFAULT_JSON_TREE_VIEW_STRINGS: ()=>_uipath_apollo_wind__rspack_import_0.DEFAULT_JSON_TREE_VIEW_STRINGS,
|
|
55
|
+
appendPathSegment: ()=>_uipath_apollo_wind__rspack_import_0.appendPathSegment,
|
|
56
|
+
buildJsonTree: ()=>_uipath_apollo_wind__rspack_import_0.buildJsonTree,
|
|
57
|
+
collectContainerPaths: ()=>_uipath_apollo_wind__rspack_import_0.collectContainerPaths,
|
|
58
|
+
copyTextToClipboard: ()=>_uipath_apollo_wind__rspack_import_0.copyTextToClipboard,
|
|
59
|
+
flattenJsonTree: ()=>_uipath_apollo_wind__rspack_import_0.flattenJsonTree,
|
|
60
|
+
formatLeafValue: ()=>_uipath_apollo_wind__rspack_import_0.formatLeafValue,
|
|
61
|
+
getValueAtPath: ()=>_uipath_apollo_wind__rspack_import_0.getValueAtPath,
|
|
62
|
+
inferValueType: ()=>_uipath_apollo_wind__rspack_import_0.inferValueType,
|
|
63
|
+
isArrayItemTemplateRoot: ()=>_uipath_apollo_wind__rspack_import_0.isArrayItemTemplateRoot,
|
|
64
|
+
isJsonObject: ()=>_uipath_apollo_wind__rspack_import_0.isJsonObject,
|
|
65
|
+
removeValueAtPath: ()=>_uipath_apollo_wind__rspack_import_0.removeValueAtPath,
|
|
66
|
+
schemaDisplayType: ()=>_uipath_apollo_wind__rspack_import_0.schemaDisplayType,
|
|
67
|
+
setValueAtPath: ()=>_uipath_apollo_wind__rspack_import_0.setValueAtPath
|
|
68
|
+
});
|
|
69
|
+
var _uipath_apollo_wind__rspack_import_0 = __webpack_require__("@uipath/apollo-wind");
|
|
70
|
+
var _JsonTree__rspack_import_1 = __webpack_require__("./JsonTree?811b");
|
|
107
71
|
var __rspack_reexport = {};
|
|
108
|
-
for(const __rspack_import_key in
|
|
72
|
+
for(const __rspack_import_key in _JsonTree__rspack_import_1)if ([
|
|
73
|
+
"appendPathSegment",
|
|
74
|
+
"formatLeafValue",
|
|
75
|
+
"inferValueType",
|
|
76
|
+
"isJsonObject",
|
|
77
|
+
"buildJsonTree",
|
|
78
|
+
"removeValueAtPath",
|
|
79
|
+
"schemaDisplayType",
|
|
80
|
+
"flattenJsonTree",
|
|
81
|
+
"DEFAULT_JSON_TREE_VIEW_STRINGS",
|
|
82
|
+
"getValueAtPath",
|
|
83
|
+
"default",
|
|
84
|
+
"collectContainerPaths",
|
|
85
|
+
"isArrayItemTemplateRoot",
|
|
86
|
+
"copyTextToClipboard",
|
|
87
|
+
"setValueAtPath"
|
|
88
|
+
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_JsonTree__rspack_import_1[__rspack_import_key];
|
|
109
89
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
110
90
|
})();
|
|
111
|
-
|
|
91
|
+
exports.DEFAULT_JSON_TREE_VIEW_STRINGS = __webpack_exports__.DEFAULT_JSON_TREE_VIEW_STRINGS;
|
|
92
|
+
exports.appendPathSegment = __webpack_exports__.appendPathSegment;
|
|
93
|
+
exports.buildJsonTree = __webpack_exports__.buildJsonTree;
|
|
94
|
+
exports.collectContainerPaths = __webpack_exports__.collectContainerPaths;
|
|
95
|
+
exports.copyTextToClipboard = __webpack_exports__.copyTextToClipboard;
|
|
96
|
+
exports.flattenJsonTree = __webpack_exports__.flattenJsonTree;
|
|
97
|
+
exports.formatLeafValue = __webpack_exports__.formatLeafValue;
|
|
98
|
+
exports.getValueAtPath = __webpack_exports__.getValueAtPath;
|
|
99
|
+
exports.inferValueType = __webpack_exports__.inferValueType;
|
|
100
|
+
exports.isArrayItemTemplateRoot = __webpack_exports__.isArrayItemTemplateRoot;
|
|
101
|
+
exports.isJsonObject = __webpack_exports__.isJsonObject;
|
|
102
|
+
exports.removeValueAtPath = __webpack_exports__.removeValueAtPath;
|
|
103
|
+
exports.schemaDisplayType = __webpack_exports__.schemaDisplayType;
|
|
104
|
+
exports.setValueAtPath = __webpack_exports__.setValueAtPath;
|
|
105
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
106
|
+
"DEFAULT_JSON_TREE_VIEW_STRINGS",
|
|
107
|
+
"appendPathSegment",
|
|
108
|
+
"buildJsonTree",
|
|
109
|
+
"collectContainerPaths",
|
|
110
|
+
"copyTextToClipboard",
|
|
111
|
+
"flattenJsonTree",
|
|
112
|
+
"formatLeafValue",
|
|
113
|
+
"getValueAtPath",
|
|
114
|
+
"inferValueType",
|
|
115
|
+
"isArrayItemTemplateRoot",
|
|
116
|
+
"isJsonObject",
|
|
117
|
+
"removeValueAtPath",
|
|
118
|
+
"schemaDisplayType",
|
|
119
|
+
"setValueAtPath"
|
|
120
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
112
121
|
Object.defineProperty(exports, '__esModule', {
|
|
113
122
|
value: true
|
|
114
123
|
});
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export * from './JsonContainerEditor';
|
|
4
|
-
export * from './JsonLeafValueEditor';
|
|
5
|
-
export * from './JsonMultilineLeafEditor';
|
|
1
|
+
export type { BuildJsonTreeOptions, ContainerPath, CopyEvent, DeriveTypeIcon, FlatJsonTreeRow, FlattenOptions, JsonCodeEditorRenderProps, JsonContainer, JsonContainerEditorProps, JsonLeafValueEditorProps, JsonMultilineLeafEditorProps, JsonObject, JsonSchema, JsonSchemaTypeName, JsonTreeChange, JsonTreeFilterOption, JsonTreeNode, JsonTreeNodeType, JsonTreeRowWrapper, JsonTreeRowWrapperProps, JsonTreeToolbarProps, JsonTreeViewStrings, JsonTreeViewProps, JsonTreeViewProviderProps, JsonTypeBadgeProps, JsonValue, NodeAction, NodeActionContext, NodeActionsResolver, NodeDecoration, NodeDecorationBadge, NodeDecorationChip, NodeDecorationTone, NodeDisplayTexts, PathSegment, RenderCodeEditor, RenderValueCell, RenderValueContext, } from '@uipath/apollo-wind';
|
|
2
|
+
export { appendPathSegment, buildJsonTree, collectContainerPaths, copyTextToClipboard, DEFAULT_JSON_TREE_VIEW_STRINGS, flattenJsonTree, formatLeafValue, getValueAtPath, inferValueType, isArrayItemTemplateRoot, isJsonObject, removeValueAtPath, schemaDisplayType, setValueAtPath, } from '@uipath/apollo-wind';
|
|
6
3
|
export * from './JsonTree';
|
|
7
|
-
export * from './JsonTree.types';
|
|
8
|
-
export * from './JsonTreeToolbar';
|
|
9
|
-
export * from './JsonTypeBadge';
|
|
10
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/JsonTree/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/JsonTree/index.ts"],"names":[],"mappings":"AAEA,YAAY,EACV,oBAAoB,EACpB,aAAa,EACb,SAAS,EACT,cAAc,EACd,eAAe,EACf,cAAc,EACd,yBAAyB,EACzB,aAAa,EACb,wBAAwB,EACxB,wBAAwB,EACxB,4BAA4B,EAC5B,UAAU,EACV,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,yBAAyB,EACzB,kBAAkB,EAClB,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,qBAAqB,EACrB,mBAAmB,EACnB,8BAA8B,EAC9B,eAAe,EACf,eAAe,EACf,cAAc,EACd,cAAc,EACd,uBAAuB,EACvB,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,GACf,MAAM,qBAAqB,CAAC;AAC7B,cAAc,YAAY,CAAC"}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export * from "./clipboard.js";
|
|
3
|
-
export * from "./JsonContainerEditor.js";
|
|
4
|
-
export * from "./JsonLeafValueEditor.js";
|
|
5
|
-
export * from "./JsonMultilineLeafEditor.js";
|
|
1
|
+
import { DEFAULT_JSON_TREE_VIEW_STRINGS, appendPathSegment, buildJsonTree, collectContainerPaths, copyTextToClipboard, flattenJsonTree, formatLeafValue, getValueAtPath, inferValueType, isArrayItemTemplateRoot, isJsonObject, removeValueAtPath, schemaDisplayType, setValueAtPath } from "@uipath/apollo-wind";
|
|
6
2
|
export * from "./JsonTree.js";
|
|
7
|
-
export
|
|
8
|
-
export * from "./JsonTreeToolbar.js";
|
|
9
|
-
export * from "./JsonTypeBadge.js";
|
|
3
|
+
export { DEFAULT_JSON_TREE_VIEW_STRINGS, appendPathSegment, buildJsonTree, collectContainerPaths, copyTextToClipboard, flattenJsonTree, formatLeafValue, getValueAtPath, inferValueType, isArrayItemTemplateRoot, isJsonObject, removeValueAtPath, schemaDisplayType, setValueAtPath };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { CopyEvent, DeriveTypeIcon, JsonContainer, JsonSchema, JsonTreeChange, JsonTreeFilterOption, JsonTreeNode, JsonTreeRowWrapper, NodeActionsResolver, NodeDecoration, RenderCodeEditor, RenderValueCell } from '../JsonTree
|
|
2
|
+
import type { CopyEvent, DeriveTypeIcon, JsonContainer, JsonSchema, JsonTreeChange, JsonTreeFilterOption, JsonTreeNode, JsonTreeRowWrapper, NodeActionsResolver, NodeDecoration, RenderCodeEditor, RenderValueCell } from '../JsonTree';
|
|
3
3
|
export interface NodeIOViewTab {
|
|
4
4
|
id: string;
|
|
5
5
|
label: string;
|