@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.
Files changed (81) hide show
  1. package/dist/canvas/components/JsonTree/JsonTree.cjs +256 -214
  2. package/dist/canvas/components/JsonTree/JsonTree.d.ts +31 -25
  3. package/dist/canvas/components/JsonTree/JsonTree.d.ts.map +1 -1
  4. package/dist/canvas/components/JsonTree/JsonTree.js +238 -217
  5. package/dist/canvas/components/JsonTree/index.cjs +67 -58
  6. package/dist/canvas/components/JsonTree/index.d.ts +2 -8
  7. package/dist/canvas/components/JsonTree/index.d.ts.map +1 -1
  8. package/dist/canvas/components/JsonTree/index.js +2 -8
  9. package/dist/canvas/components/NodeIOView/NodeIOView.types.d.ts +1 -1
  10. package/dist/canvas/components/NodeIOView/NodeIOView.types.d.ts.map +1 -1
  11. package/dist/canvas/components/StageNode/StageNode.types.d.ts +1 -1
  12. package/dist/canvas/components/StageNode/StageNode.types.d.ts.map +1 -1
  13. package/dist/canvas/components/StageNode/StageNodeHeader.cjs +15 -6
  14. package/dist/canvas/components/StageNode/StageNodeHeader.d.ts.map +1 -1
  15. package/dist/canvas/components/StageNode/StageNodeHeader.js +15 -6
  16. package/dist/canvas/stories/templates/LayoutPreviewsPage.cjs +1257 -0
  17. package/dist/canvas/stories/templates/LayoutPreviewsPage.d.ts +2 -0
  18. package/dist/canvas/stories/templates/LayoutPreviewsPage.d.ts.map +1 -0
  19. package/dist/canvas/stories/templates/LayoutPreviewsPage.js +1223 -0
  20. package/dist/canvas/styles/tailwind.canvas.css +1 -1
  21. package/package.json +2 -2
  22. package/dist/canvas/components/JsonTree/DecorationChip.cjs +0 -81
  23. package/dist/canvas/components/JsonTree/DecorationChip.d.ts +0 -5
  24. package/dist/canvas/components/JsonTree/DecorationChip.d.ts.map +0 -1
  25. package/dist/canvas/components/JsonTree/DecorationChip.js +0 -47
  26. package/dist/canvas/components/JsonTree/EditorChrome.cjs +0 -93
  27. package/dist/canvas/components/JsonTree/EditorChrome.d.ts +0 -18
  28. package/dist/canvas/components/JsonTree/EditorChrome.d.ts.map +0 -1
  29. package/dist/canvas/components/JsonTree/EditorChrome.js +0 -56
  30. package/dist/canvas/components/JsonTree/JsonContainerEditor.cjs +0 -103
  31. package/dist/canvas/components/JsonTree/JsonContainerEditor.d.ts +0 -10
  32. package/dist/canvas/components/JsonTree/JsonContainerEditor.d.ts.map +0 -1
  33. package/dist/canvas/components/JsonTree/JsonContainerEditor.js +0 -69
  34. package/dist/canvas/components/JsonTree/JsonLeafValueEditor.cjs +0 -98
  35. package/dist/canvas/components/JsonTree/JsonLeafValueEditor.d.ts +0 -9
  36. package/dist/canvas/components/JsonTree/JsonLeafValueEditor.d.ts.map +0 -1
  37. package/dist/canvas/components/JsonTree/JsonLeafValueEditor.js +0 -64
  38. package/dist/canvas/components/JsonTree/JsonMultilineLeafEditor.cjs +0 -86
  39. package/dist/canvas/components/JsonTree/JsonMultilineLeafEditor.d.ts +0 -9
  40. package/dist/canvas/components/JsonTree/JsonMultilineLeafEditor.d.ts.map +0 -1
  41. package/dist/canvas/components/JsonTree/JsonMultilineLeafEditor.js +0 -52
  42. package/dist/canvas/components/JsonTree/JsonTree.types.cjs +0 -18
  43. package/dist/canvas/components/JsonTree/JsonTree.types.d.ts +0 -110
  44. package/dist/canvas/components/JsonTree/JsonTree.types.d.ts.map +0 -1
  45. package/dist/canvas/components/JsonTree/JsonTree.types.js +0 -0
  46. package/dist/canvas/components/JsonTree/JsonTreeRow.cjs +0 -358
  47. package/dist/canvas/components/JsonTree/JsonTreeRow.d.ts +0 -36
  48. package/dist/canvas/components/JsonTree/JsonTreeRow.d.ts.map +0 -1
  49. package/dist/canvas/components/JsonTree/JsonTreeRow.js +0 -318
  50. package/dist/canvas/components/JsonTree/JsonTreeToolbar.cjs +0 -224
  51. package/dist/canvas/components/JsonTree/JsonTreeToolbar.d.ts +0 -17
  52. package/dist/canvas/components/JsonTree/JsonTreeToolbar.d.ts.map +0 -1
  53. package/dist/canvas/components/JsonTree/JsonTreeToolbar.js +0 -190
  54. package/dist/canvas/components/JsonTree/JsonTypeBadge.cjs +0 -70
  55. package/dist/canvas/components/JsonTree/JsonTypeBadge.d.ts +0 -10
  56. package/dist/canvas/components/JsonTree/JsonTypeBadge.d.ts.map +0 -1
  57. package/dist/canvas/components/JsonTree/JsonTypeBadge.js +0 -36
  58. package/dist/canvas/components/JsonTree/NodeKey.cjs +0 -86
  59. package/dist/canvas/components/JsonTree/NodeKey.d.ts +0 -10
  60. package/dist/canvas/components/JsonTree/NodeKey.d.ts.map +0 -1
  61. package/dist/canvas/components/JsonTree/NodeKey.js +0 -52
  62. package/dist/canvas/components/JsonTree/RowActions.cjs +0 -121
  63. package/dist/canvas/components/JsonTree/RowActions.d.ts +0 -8
  64. package/dist/canvas/components/JsonTree/RowActions.d.ts.map +0 -1
  65. package/dist/canvas/components/JsonTree/RowActions.js +0 -87
  66. package/dist/canvas/components/JsonTree/ScalarValueCell.cjs +0 -132
  67. package/dist/canvas/components/JsonTree/ScalarValueCell.d.ts +0 -12
  68. package/dist/canvas/components/JsonTree/ScalarValueCell.d.ts.map +0 -1
  69. package/dist/canvas/components/JsonTree/ScalarValueCell.js +0 -95
  70. package/dist/canvas/components/JsonTree/buildJsonTree.cjs +0 -321
  71. package/dist/canvas/components/JsonTree/buildJsonTree.d.ts +0 -39
  72. package/dist/canvas/components/JsonTree/buildJsonTree.d.ts.map +0 -1
  73. package/dist/canvas/components/JsonTree/buildJsonTree.js +0 -254
  74. package/dist/canvas/components/JsonTree/clipboard.cjs +0 -63
  75. package/dist/canvas/components/JsonTree/clipboard.d.ts +0 -2
  76. package/dist/canvas/components/JsonTree/clipboard.d.ts.map +0 -1
  77. package/dist/canvas/components/JsonTree/clipboard.js +0 -29
  78. package/dist/canvas/components/JsonTree/leafEditTypes.cjs +0 -74
  79. package/dist/canvas/components/JsonTree/leafEditTypes.d.ts +0 -6
  80. package/dist/canvas/components/JsonTree/leafEditTypes.d.ts.map +0 -1
  81. package/dist/canvas/components/JsonTree/leafEditTypes.js +0 -34
@@ -24,238 +24,280 @@ var __webpack_require__ = {};
24
24
  var __webpack_exports__ = {};
25
25
  __webpack_require__.r(__webpack_exports__);
26
26
  __webpack_require__.d(__webpack_exports__, {
27
+ useCanvasJsonTreeViewStrings: ()=>useCanvasJsonTreeViewStrings,
27
28
  JsonTree: ()=>JsonTree,
28
- JsonTreeView: ()=>JsonTreeView
29
+ JsonTreeToolbar: ()=>JsonTreeToolbar,
30
+ JsonLeafValueEditor: ()=>JsonLeafValueEditor,
31
+ JsonTypeBadge: ()=>JsonTypeBadge,
32
+ JsonTreeView: ()=>JsonTreeView,
33
+ JsonContainerEditor: ()=>JsonContainerEditor,
34
+ JsonTreeViewProvider: ()=>JsonTreeViewProvider,
35
+ JsonMultilineLeafEditor: ()=>JsonMultilineLeafEditor
29
36
  });
30
37
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
31
- const react_virtual_namespaceObject = require("@tanstack/react-virtual");
32
38
  const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
33
- const tooltip_namespaceObject = require("@uipath/apollo-wind/components/ui/tooltip");
34
39
  const external_react_namespaceObject = require("react");
35
40
  const index_cjs_namespaceObject = require("../../../i18n/index.cjs");
36
- const useIsomorphicLayoutEffect_cjs_namespaceObject = require("../../hooks/useIsomorphicLayoutEffect.cjs");
37
- const external_CanvasTooltip_cjs_namespaceObject = require("../CanvasTooltip.cjs");
38
- const external_buildJsonTree_cjs_namespaceObject = require("./buildJsonTree.cjs");
39
- const external_clipboard_cjs_namespaceObject = require("./clipboard.cjs");
40
- const external_JsonTreeRow_cjs_namespaceObject = require("./JsonTreeRow.cjs");
41
- const VIRTUAL_OVERSCAN = 10;
42
- function scrollMarginOf(element, scrollElement) {
43
- return Math.round(element.getBoundingClientRect().top - scrollElement.getBoundingClientRect().top + scrollElement.scrollTop);
44
- }
45
- function VirtualRows({ rows, container, scrollElement, pinnedPaths }) {
46
- const [scrollMargin, setScrollMargin] = (0, external_react_namespaceObject.useState)(0);
47
- const getItemKey = (0, external_react_namespaceObject.useCallback)((index)=>rows[index]?.node.path ?? index, [
48
- rows
49
- ]);
50
- const virtualizer = (0, react_virtual_namespaceObject.useVirtualizer)({
51
- count: rows.length,
52
- getScrollElement: ()=>scrollElement ?? container,
53
- estimateSize: ()=>external_JsonTreeRow_cjs_namespaceObject.ROW_MIN_HEIGHT_PX,
54
- getItemKey,
55
- overscan: VIRTUAL_OVERSCAN,
56
- scrollMargin
57
- });
58
- (0, useIsomorphicLayoutEffect_cjs_namespaceObject.useIsomorphicLayoutEffect)(()=>{
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
- }
115
- function valueAsText(node) {
116
- if ('string' == typeof node.value) return node.value;
117
- if (void 0 === node.value) return 'null';
118
- return JSON.stringify(node.value, null, 2);
119
- }
120
- const DefaultRowWrapper = ({ className, style, onClick, children })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
121
- className: className,
122
- style: style,
123
- onClick: onClick,
124
- children: children
125
- });
126
- 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 }) {
41
+ const CANVAS_TOOLTIP_CLASS = 'z-1200!';
42
+ function useCanvasJsonTreeViewStrings() {
127
43
  const { _ } = (0, index_cjs_namespaceObject.useSafeLingui)();
128
- const [container, setContainer] = (0, external_react_namespaceObject.useState)(null);
129
- const usesAncestorScroller = virtualized && !!scrollElement;
130
- const RowWrapper = rowWrapper ?? DefaultRowWrapper;
131
- const [editingPath, setEditingPath] = (0, external_react_namespaceObject.useState)(null);
132
- const [jsonEditingPath, setJsonEditingPath] = (0, external_react_namespaceObject.useState)(null);
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
- ]);
143
- const [copied, setCopied] = (0, external_react_namespaceObject.useState)(null);
144
- const copyTimerRef = (0, external_react_namespaceObject.useRef)(null);
145
- (0, external_react_namespaceObject.useEffect)(()=>()=>{
146
- if (copyTimerRef.current) clearTimeout(copyTimerRef.current);
147
- }, []);
148
- const copy = (node, kind, text)=>{
149
- (0, external_clipboard_cjs_namespaceObject.copyTextToClipboard)(text).then((ok)=>{
150
- if (!ok) return;
151
- setCopied({
152
- path: node.path,
153
- kind
154
- });
155
- if (copyTimerRef.current) clearTimeout(copyTimerRef.current);
156
- copyTimerRef.current = setTimeout(()=>setCopied(null), 1500);
157
- onCopy?.({
158
- kind,
159
- path: node.path,
160
- text
161
- });
162
- });
163
- };
164
- const copyPath = (node)=>copy(node, 'path', pathForCopy?.(node.path) ?? node.path);
165
- const copyValue = (node)=>copy(node, 'value', valueAsText(node));
166
- const toggleWrapped = (node)=>{
167
- setWrappedPaths((prev)=>({
168
- ...prev,
169
- [node.path]: !prev[node.path]
170
- }));
171
- if (editingPath === node.path) setEditingPath(null);
172
- };
173
- const commitEdit = (node, value)=>onEdit?.(node, value);
174
- const canEdit = !readOnly && !!onEdit;
175
- const rows = (0, external_react_namespaceObject.useMemo)(()=>(0, external_buildJsonTree_cjs_namespaceObject.flattenJsonTree)(nodes, {
176
- collapsed,
177
- query,
178
- filterPredicate,
179
- displayTexts: decorateNode
44
+ return (0, external_react_namespaceObject.useMemo)(()=>({
45
+ arrayItem: _({
46
+ id: 'canvas.json_value_panel.array_item',
47
+ message: 'item'
48
+ }),
49
+ emptySearch: _({
50
+ id: 'canvas.json_value_panel.empty_search',
51
+ message: 'No fields match your search.'
52
+ }),
53
+ emptyDefault: _({
54
+ id: 'canvas.json_value_panel.empty_default',
55
+ message: 'No fields to display.'
56
+ }),
57
+ expandKey: (key)=>_({
58
+ id: 'canvas.json_value_panel.expand_key',
59
+ message: 'Expand {key}',
60
+ values: {
61
+ key
62
+ }
63
+ }),
64
+ collapseKey: (key)=>_({
65
+ id: 'canvas.json_value_panel.collapse_key',
66
+ message: 'Collapse {key}',
67
+ values: {
68
+ key
69
+ }
70
+ }),
71
+ itemCount: (count)=>_({
72
+ id: 'canvas.json_value_panel.item_count',
73
+ message: '{count, plural, one {# item} other {# items}}',
74
+ values: {
75
+ count
76
+ }
77
+ }),
78
+ keyCount: (count)=>_({
79
+ id: 'canvas.json_value_panel.key_count',
80
+ message: '{count, plural, one {# key} other {# keys}}',
81
+ values: {
82
+ count
83
+ }
84
+ }),
85
+ requiredMarker: _({
86
+ id: 'canvas.json_value_panel.required_marker',
87
+ message: 'required'
88
+ }),
89
+ pathCopied: _({
90
+ id: 'canvas.json_value_panel.path_copied',
91
+ message: 'Path copied'
92
+ }),
93
+ copyPathHint: _({
94
+ id: 'canvas.json_value_panel.copy_path_hint',
95
+ message: 'Click to copy this path'
96
+ }),
97
+ copyPathFor: (path)=>_({
98
+ id: 'canvas.json_value_panel.copy_path_for',
99
+ message: 'Copy path for {path}',
100
+ values: {
101
+ path
102
+ }
103
+ }),
104
+ wrapValue: _({
105
+ id: 'canvas.json_value_panel.wrap_value',
106
+ message: 'Wrap value'
107
+ }),
108
+ unwrapValue: _({
109
+ id: 'canvas.json_value_panel.unwrap_value',
110
+ message: 'Unwrap value'
111
+ }),
112
+ wrapValueOf: (key)=>_({
113
+ id: 'canvas.json_value_panel.wrap_value_of',
114
+ message: 'Wrap value of {key}',
115
+ values: {
116
+ key
117
+ }
118
+ }),
119
+ unwrapValueOf: (key)=>_({
120
+ id: 'canvas.json_value_panel.unwrap_value_of',
121
+ message: 'Unwrap value of {key}',
122
+ values: {
123
+ key
124
+ }
125
+ }),
126
+ editAsJson: _({
127
+ id: 'canvas.json_value_panel.edit_as_json',
128
+ message: 'Edit as JSON'
129
+ }),
130
+ editKeyAsJson: (key)=>_({
131
+ id: 'canvas.json_value_panel.edit_key_as_json',
132
+ message: 'Edit {key} as JSON',
133
+ values: {
134
+ key
135
+ }
136
+ }),
137
+ copyValue: _({
138
+ id: 'canvas.json_value_panel.copy_value',
139
+ message: 'Copy value'
140
+ }),
141
+ copyValueOf: (key)=>_({
142
+ id: 'canvas.json_value_panel.copy_value_of',
143
+ message: 'Copy value of {key}',
144
+ values: {
145
+ key
146
+ }
147
+ }),
148
+ moreActions: _({
149
+ id: 'canvas.json_value_panel.more_actions',
150
+ message: 'More actions'
151
+ }),
152
+ unsetValue: _({
153
+ id: 'canvas.json_value_panel.unset_value',
154
+ message: 'unset'
155
+ }),
156
+ editValueOf: (key)=>_({
157
+ id: 'canvas.json_value_panel.edit_value_of',
158
+ message: 'Edit value of {key}',
159
+ values: {
160
+ key
161
+ }
162
+ }),
163
+ editJsonOf: (key)=>_({
164
+ id: 'canvas.json_value_panel.edit_json_of',
165
+ message: 'Edit JSON of {key}',
166
+ values: {
167
+ key
168
+ }
169
+ }),
170
+ editHint: _({
171
+ id: 'canvas.json_value_panel.edit_hint',
172
+ message: 'Click to edit'
173
+ }),
174
+ toggleHint: _({
175
+ id: 'canvas.json_value_panel.toggle_hint',
176
+ message: 'Click to toggle'
177
+ }),
178
+ unsetEditHint: _({
179
+ id: 'canvas.json_value_panel.unset_edit_hint',
180
+ message: 'Click to set a value'
181
+ }),
182
+ enterNumber: _({
183
+ id: 'canvas.json_value_panel.enter_number',
184
+ message: 'Enter a number'
185
+ }),
186
+ enterValue: _({
187
+ id: 'canvas.json_value_panel.enter_value',
188
+ message: 'Enter a value'
189
+ }),
190
+ invalidJson: _({
191
+ id: 'canvas.json_value_panel.invalid_json',
192
+ message: 'Invalid JSON'
193
+ }),
194
+ apply: _({
195
+ id: 'canvas.json_value_panel.apply',
196
+ message: 'Apply'
197
+ }),
198
+ cancel: _({
199
+ id: 'canvas.json_value_panel.cancel',
200
+ message: 'Cancel'
201
+ }),
202
+ searchFields: _({
203
+ id: 'canvas.json_value_panel.search_fields',
204
+ message: 'Search fields and values...'
205
+ }),
206
+ searchFieldsAction: _({
207
+ id: 'canvas.json_value_panel.search_fields_action',
208
+ message: 'Search fields and values'
209
+ }),
210
+ clearSearch: _({
211
+ id: 'canvas.json_value_panel.clear_search',
212
+ message: 'Clear search'
213
+ }),
214
+ filter: _({
215
+ id: 'canvas.json_value_panel.filter',
216
+ message: 'Filter'
217
+ }),
218
+ filterActive: (label)=>_({
219
+ id: 'canvas.json_value_panel.filter_active',
220
+ message: 'Filter: {label}',
221
+ values: {
222
+ label
223
+ }
224
+ }),
225
+ filterAll: _({
226
+ id: 'canvas.json_value_panel.filter_all',
227
+ message: 'All'
228
+ }),
229
+ expandAll: _({
230
+ id: 'canvas.json_value_panel.expand_all',
231
+ message: 'Expand all'
232
+ }),
233
+ collapseAll: _({
234
+ id: 'canvas.json_value_panel.collapse_all',
235
+ message: 'Collapse all'
236
+ })
180
237
  }), [
181
- nodes,
182
- collapsed,
183
- query,
184
- filterPredicate,
185
- decorateNode
238
+ _
186
239
  ]);
187
- const templateItemLabel = _({
188
- id: 'canvas.json_value_panel.array_item',
189
- message: 'item'
240
+ }
241
+ const InsideCanvasProviderContext = /*#__PURE__*/ (0, external_react_namespaceObject.createContext)(false);
242
+ function JsonTreeViewProvider({ strings, tooltipContentClassName, children }) {
243
+ const insideCanvasProvider = (0, external_react_namespaceObject.useContext)(InsideCanvasProviderContext);
244
+ const canvasStrings = useCanvasJsonTreeViewStrings();
245
+ const overrides = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.JsonTreeViewProvider, {
246
+ strings: strings,
247
+ tooltipContentClassName: tooltipContentClassName,
248
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(InsideCanvasProviderContext.Provider, {
249
+ value: true,
250
+ children: children
251
+ })
190
252
  });
191
- const filtering = !!query?.trim() || !!filterPredicate;
192
- const resolvedEmptyMessage = filtering ? _({
193
- id: 'canvas.json_value_panel.empty_search',
194
- message: 'No fields match your search.'
195
- }) : emptyMessage ?? _({
196
- id: 'canvas.json_value_panel.empty_default',
197
- message: 'No fields to display.'
253
+ if (insideCanvasProvider) return overrides;
254
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.JsonTreeViewProvider, {
255
+ strings: canvasStrings,
256
+ tooltipContentClassName: CANVAS_TOOLTIP_CLASS,
257
+ children: overrides
198
258
  });
199
- const rowContext = {
200
- collapsed,
201
- onToggleCollapsed,
202
- readOnly,
203
- decorateNode,
204
- deriveTypeIcon,
205
- renderValue,
206
- nodeActions,
207
- maxInlineActions,
208
- renderCodeEditor,
209
- pathForCopy,
210
- canEdit,
211
- RowWrapper,
212
- templateItemLabel,
213
- editingPath,
214
- jsonEditingPath,
215
- wrappedPaths,
216
- copied,
217
- setEditingPath,
218
- setJsonEditingPath,
219
- copyPath,
220
- copyValue,
221
- toggleWrapped,
222
- commitEdit
223
- };
224
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(tooltip_namespaceObject.TooltipProvider, {
225
- delayDuration: 300,
226
- skipDelayDuration: 100,
227
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CanvasTooltip_cjs_namespaceObject.CanvasTooltipProviderMarker, {
228
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_JsonTreeRow_cjs_namespaceObject.JsonTreeRowContextProvider, {
229
- value: rowContext,
230
- children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
231
- ref: setContainer,
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),
233
- children: [
234
- virtualized ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(VirtualRows, {
235
- rows: rows,
236
- container: container,
237
- scrollElement: scrollElement,
238
- pinnedPaths: pinnedPaths
239
- }) : rows.map(({ node, depth })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_JsonTreeRow_cjs_namespaceObject.JsonTreeRow, {
240
- node: node,
241
- depth: depth
242
- }, node.path)),
243
- 0 === rows.length && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
244
- className: "p-4 text-center text-xs text-foreground-subtle",
245
- children: resolvedEmptyMessage
246
- })
247
- ]
248
- })
259
+ }
260
+ function withCanvasStrings(Component, name) {
261
+ const Wrapped = (props)=>{
262
+ const insideCanvasProvider = (0, external_react_namespaceObject.useContext)(InsideCanvasProviderContext);
263
+ if (insideCanvasProvider) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Component, {
264
+ ...props
265
+ });
266
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(JsonTreeViewProvider, {
267
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Component, {
268
+ ...props
249
269
  })
250
- })
251
- });
270
+ });
271
+ };
272
+ Wrapped.displayName = name;
273
+ return Wrapped;
252
274
  }
275
+ const JsonTreeView = withCanvasStrings(apollo_wind_namespaceObject.JsonTreeView, 'JsonTreeView');
276
+ const JsonTreeToolbar = withCanvasStrings(apollo_wind_namespaceObject.JsonTreeToolbar, 'JsonTreeToolbar');
277
+ const JsonContainerEditor = withCanvasStrings(apollo_wind_namespaceObject.JsonContainerEditor, 'JsonContainerEditor');
278
+ const JsonLeafValueEditor = withCanvasStrings(apollo_wind_namespaceObject.JsonLeafValueEditor, 'JsonLeafValueEditor');
279
+ const JsonMultilineLeafEditor = withCanvasStrings(apollo_wind_namespaceObject.JsonMultilineLeafEditor, 'JsonMultilineLeafEditor');
280
+ const JsonTypeBadge = withCanvasStrings(apollo_wind_namespaceObject.JsonTypeBadge, 'JsonTypeBadge');
253
281
  const JsonTree = JsonTreeView;
282
+ exports.JsonContainerEditor = __webpack_exports__.JsonContainerEditor;
283
+ exports.JsonLeafValueEditor = __webpack_exports__.JsonLeafValueEditor;
284
+ exports.JsonMultilineLeafEditor = __webpack_exports__.JsonMultilineLeafEditor;
254
285
  exports.JsonTree = __webpack_exports__.JsonTree;
286
+ exports.JsonTreeToolbar = __webpack_exports__.JsonTreeToolbar;
255
287
  exports.JsonTreeView = __webpack_exports__.JsonTreeView;
288
+ exports.JsonTreeViewProvider = __webpack_exports__.JsonTreeViewProvider;
289
+ exports.JsonTypeBadge = __webpack_exports__.JsonTypeBadge;
290
+ exports.useCanvasJsonTreeViewStrings = __webpack_exports__.useCanvasJsonTreeViewStrings;
256
291
  for(var __rspack_i in __webpack_exports__)if (-1 === [
292
+ "JsonContainerEditor",
293
+ "JsonLeafValueEditor",
294
+ "JsonMultilineLeafEditor",
257
295
  "JsonTree",
258
- "JsonTreeView"
296
+ "JsonTreeToolbar",
297
+ "JsonTreeView",
298
+ "JsonTreeViewProvider",
299
+ "JsonTypeBadge",
300
+ "useCanvasJsonTreeViewStrings"
259
301
  ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
260
302
  Object.defineProperty(exports, '__esModule', {
261
303
  value: true
@@ -1,27 +1,33 @@
1
- import type { CopyEvent, DeriveTypeIcon, JsonTreeNode, JsonTreeRowWrapper, JsonValue, NodeActionsResolver, NodeDecoration, RenderCodeEditor, RenderValueCell } from './JsonTree.types';
2
- export interface JsonTreeViewProps {
3
- nodes: JsonTreeNode[];
4
- collapsed?: Record<string, boolean>;
5
- onToggleCollapsed?: (path: string) => void;
6
- query?: string;
7
- filterPredicate?: (node: JsonTreeNode) => boolean;
8
- readOnly?: boolean;
9
- onEdit?: (node: JsonTreeNode, value: JsonValue | undefined) => void;
10
- rowWrapper?: JsonTreeRowWrapper;
11
- decorateNode?: (node: JsonTreeNode) => NodeDecoration | undefined;
12
- deriveTypeIcon?: DeriveTypeIcon;
13
- renderValue?: RenderValueCell;
14
- nodeActions?: NodeActionsResolver;
15
- maxInlineActions?: number;
16
- renderCodeEditor?: RenderCodeEditor;
17
- pathForCopy?: (path: string) => string;
18
- onCopy?: (event: CopyEvent) => void;
19
- virtualized?: boolean;
20
- scrollElement?: HTMLElement | null;
21
- emptyMessage?: string;
22
- className?: string;
23
- }
24
- export declare function JsonTreeView({ nodes, collapsed, onToggleCollapsed, query, filterPredicate, readOnly, onEdit, rowWrapper, decorateNode, deriveTypeIcon, renderValue, nodeActions, maxInlineActions, renderCodeEditor, pathForCopy, onCopy, virtualized, scrollElement, emptyMessage, className, }: JsonTreeViewProps): import("react/jsx-runtime").JSX.Element;
1
+ import { type JsonTreeViewProps, type JsonTreeViewProviderProps, type JsonTreeViewStrings } from '@uipath/apollo-wind';
2
+ export declare function useCanvasJsonTreeViewStrings(): JsonTreeViewStrings;
3
+ export declare function JsonTreeViewProvider({ strings, tooltipContentClassName, children, }: JsonTreeViewProviderProps): import("react/jsx-runtime").JSX.Element;
4
+ export declare const JsonTreeView: {
5
+ (props: JsonTreeViewProps): import("react/jsx-runtime").JSX.Element;
6
+ displayName: string;
7
+ };
8
+ export declare const JsonTreeToolbar: {
9
+ (props: import("@uipath/apollo-wind").JsonTreeToolbarProps): import("react/jsx-runtime").JSX.Element;
10
+ displayName: string;
11
+ };
12
+ export declare const JsonContainerEditor: {
13
+ (props: import("@uipath/apollo-wind").JsonContainerEditorProps): import("react/jsx-runtime").JSX.Element;
14
+ displayName: string;
15
+ };
16
+ export declare const JsonLeafValueEditor: {
17
+ (props: import("@uipath/apollo-wind").JsonLeafValueEditorProps): import("react/jsx-runtime").JSX.Element;
18
+ displayName: string;
19
+ };
20
+ export declare const JsonMultilineLeafEditor: {
21
+ (props: import("@uipath/apollo-wind").JsonMultilineLeafEditorProps): import("react/jsx-runtime").JSX.Element;
22
+ displayName: string;
23
+ };
24
+ export declare const JsonTypeBadge: {
25
+ (props: import("@uipath/apollo-wind").JsonTypeBadgeProps): import("react/jsx-runtime").JSX.Element;
26
+ displayName: string;
27
+ };
25
28
  export type JsonTreeProps = JsonTreeViewProps;
26
- export declare const JsonTree: typeof JsonTreeView;
29
+ export declare const JsonTree: {
30
+ (props: JsonTreeViewProps): import("react/jsx-runtime").JSX.Element;
31
+ displayName: string;
32
+ };
27
33
  //# sourceMappingURL=JsonTree.d.ts.map
@@ -1 +1 @@
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,iBAAiB;IAEhC,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;AAqJD,wBAAgB,YAAY,CAAC,EAC3B,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,iBAAiB,2CA6JnB;AAGD,MAAM,MAAM,aAAa,GAAG,iBAAiB,CAAC;AAE9C,eAAO,MAAM,QAAQ,qBAAe,CAAC"}
1
+ {"version":3,"file":"JsonTree.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/JsonTree/JsonTree.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,iBAAiB,EAEtB,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EAEzB,MAAM,qBAAqB,CAAC;AAgB7B,wBAAgB,4BAA4B,IAAI,mBAAmB,CAwHlE;AAWD,wBAAgB,oBAAoB,CAAC,EACnC,OAAO,EACP,uBAAuB,EACvB,QAAQ,GACT,EAAE,yBAAyB,2CAqB3B;AAuBD,eAAO,MAAM,YAAY;;;CAAsD,CAAC;AAChF,eAAO,MAAM,eAAe;;;CAA4D,CAAC;AACzF,eAAO,MAAM,mBAAmB;;;CAG/B,CAAC;AACF,eAAO,MAAM,mBAAmB;;;CAG/B,CAAC;AACF,eAAO,MAAM,uBAAuB;;;CAGnC,CAAC;AAEF,eAAO,MAAM,aAAa;;;CAAwD,CAAC;AAGnF,MAAM,MAAM,aAAa,GAAG,iBAAiB,CAAC;AAE9C,eAAO,MAAM,QAAQ;;;CAAe,CAAC"}