@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/apollo-react",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.74.0",
|
|
4
4
|
"description": "Apollo Design System - React component library with Material UI theming",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -229,7 +229,7 @@
|
|
|
229
229
|
"zustand": "^5.0.9",
|
|
230
230
|
"@uipath/apollo-core": "5.15.1",
|
|
231
231
|
"@uipath/apollo-ui-icons": "1.2.0",
|
|
232
|
-
"@uipath/apollo-wind": "2.
|
|
232
|
+
"@uipath/apollo-wind": "2.61.0"
|
|
233
233
|
},
|
|
234
234
|
"devDependencies": {
|
|
235
235
|
"@lingui/cli": "^5.6.1",
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: definition[key]
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
(()=>{
|
|
12
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
})();
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
-
value: 'Module'
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
-
value: true
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
var __webpack_exports__ = {};
|
|
25
|
-
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
DecorationChip: ()=>DecorationChip
|
|
28
|
-
});
|
|
29
|
-
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
-
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
31
|
-
const external_CanvasTooltip_cjs_namespaceObject = require("../CanvasTooltip.cjs");
|
|
32
|
-
const CHIP_TONE_TEXT_CLASS = {
|
|
33
|
-
neutral: 'text-foreground-subtle',
|
|
34
|
-
info: 'text-info',
|
|
35
|
-
warning: 'text-warning',
|
|
36
|
-
error: 'text-error'
|
|
37
|
-
};
|
|
38
|
-
const CHIP_TONE_BORDER_CLASS = {
|
|
39
|
-
neutral: 'border-border',
|
|
40
|
-
info: 'border-info/40',
|
|
41
|
-
warning: 'border-warning/40',
|
|
42
|
-
error: 'border-error/40'
|
|
43
|
-
};
|
|
44
|
-
function DecorationChip({ decoration }) {
|
|
45
|
-
const chip = decoration?.chip;
|
|
46
|
-
if (!chip || null == chip.label && null == chip.icon) return null;
|
|
47
|
-
const tone = chip.tone ?? 'neutral';
|
|
48
|
-
const content = chip.label ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
|
|
49
|
-
className: (0, apollo_wind_namespaceObject.cn)('flex min-w-0 items-center gap-1 truncate rounded-full border px-1.5 py-px text-[10px] font-medium leading-none', CHIP_TONE_BORDER_CLASS[tone], CHIP_TONE_TEXT_CLASS[tone]),
|
|
50
|
-
children: [
|
|
51
|
-
chip.icon && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
52
|
-
className: "shrink-0",
|
|
53
|
-
children: chip.icon
|
|
54
|
-
}),
|
|
55
|
-
chip.label
|
|
56
|
-
]
|
|
57
|
-
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
58
|
-
className: (0, apollo_wind_namespaceObject.cn)('flex shrink-0 items-center', CHIP_TONE_TEXT_CLASS[tone]),
|
|
59
|
-
...chip.tooltip ? {
|
|
60
|
-
role: 'img',
|
|
61
|
-
'aria-label': chip.tooltip
|
|
62
|
-
} : {},
|
|
63
|
-
children: chip.icon
|
|
64
|
-
});
|
|
65
|
-
if (!chip.tooltip) return content;
|
|
66
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CanvasTooltip_cjs_namespaceObject.CanvasTooltip, {
|
|
67
|
-
placement: "top",
|
|
68
|
-
content: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
69
|
-
className: "text-xs",
|
|
70
|
-
children: chip.tooltip
|
|
71
|
-
}),
|
|
72
|
-
children: content
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
exports.DecorationChip = __webpack_exports__.DecorationChip;
|
|
76
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
77
|
-
"DecorationChip"
|
|
78
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
79
|
-
Object.defineProperty(exports, '__esModule', {
|
|
80
|
-
value: true
|
|
81
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DecorationChip.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/JsonTree/DecorationChip.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAsB,MAAM,kBAAkB,CAAC;AAgB3E,wBAAgB,cAAc,CAAC,EAAE,UAAU,EAAE,EAAE;IAAE,UAAU,CAAC,EAAE,cAAc,CAAA;CAAE,kDAkC7E"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "@uipath/apollo-wind";
|
|
3
|
-
import { CanvasTooltip } from "../CanvasTooltip.js";
|
|
4
|
-
const CHIP_TONE_TEXT_CLASS = {
|
|
5
|
-
neutral: 'text-foreground-subtle',
|
|
6
|
-
info: 'text-info',
|
|
7
|
-
warning: 'text-warning',
|
|
8
|
-
error: 'text-error'
|
|
9
|
-
};
|
|
10
|
-
const CHIP_TONE_BORDER_CLASS = {
|
|
11
|
-
neutral: 'border-border',
|
|
12
|
-
info: 'border-info/40',
|
|
13
|
-
warning: 'border-warning/40',
|
|
14
|
-
error: 'border-error/40'
|
|
15
|
-
};
|
|
16
|
-
function DecorationChip({ decoration }) {
|
|
17
|
-
const chip = decoration?.chip;
|
|
18
|
-
if (!chip || null == chip.label && null == chip.icon) return null;
|
|
19
|
-
const tone = chip.tone ?? 'neutral';
|
|
20
|
-
const content = chip.label ? /*#__PURE__*/ jsxs("span", {
|
|
21
|
-
className: cn('flex min-w-0 items-center gap-1 truncate rounded-full border px-1.5 py-px text-[10px] font-medium leading-none', CHIP_TONE_BORDER_CLASS[tone], CHIP_TONE_TEXT_CLASS[tone]),
|
|
22
|
-
children: [
|
|
23
|
-
chip.icon && /*#__PURE__*/ jsx("span", {
|
|
24
|
-
className: "shrink-0",
|
|
25
|
-
children: chip.icon
|
|
26
|
-
}),
|
|
27
|
-
chip.label
|
|
28
|
-
]
|
|
29
|
-
}) : /*#__PURE__*/ jsx("span", {
|
|
30
|
-
className: cn('flex shrink-0 items-center', CHIP_TONE_TEXT_CLASS[tone]),
|
|
31
|
-
...chip.tooltip ? {
|
|
32
|
-
role: 'img',
|
|
33
|
-
'aria-label': chip.tooltip
|
|
34
|
-
} : {},
|
|
35
|
-
children: chip.icon
|
|
36
|
-
});
|
|
37
|
-
if (!chip.tooltip) return content;
|
|
38
|
-
return /*#__PURE__*/ jsx(CanvasTooltip, {
|
|
39
|
-
placement: "top",
|
|
40
|
-
content: /*#__PURE__*/ jsx("span", {
|
|
41
|
-
className: "text-xs",
|
|
42
|
-
children: chip.tooltip
|
|
43
|
-
}),
|
|
44
|
-
children: content
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
export { DecorationChip };
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: definition[key]
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
(()=>{
|
|
12
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
})();
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
-
value: 'Module'
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
-
value: true
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
var __webpack_exports__ = {};
|
|
25
|
-
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
EditorActions: ()=>EditorActions,
|
|
28
|
-
EditorTextarea: ()=>EditorTextarea
|
|
29
|
-
});
|
|
30
|
-
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
|
-
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
32
|
-
const external_react_namespaceObject = require("react");
|
|
33
|
-
const index_cjs_namespaceObject = require("../../../i18n/index.cjs");
|
|
34
|
-
function EditorActions({ onApply, onCancel, applyDisabled = false }) {
|
|
35
|
-
const { _ } = (0, index_cjs_namespaceObject.useSafeLingui)();
|
|
36
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
37
|
-
className: "flex items-center gap-1.5",
|
|
38
|
-
children: [
|
|
39
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Button, {
|
|
40
|
-
size: "3xs",
|
|
41
|
-
onClick: onApply,
|
|
42
|
-
disabled: applyDisabled,
|
|
43
|
-
children: _({
|
|
44
|
-
id: 'canvas.json_value_panel.apply',
|
|
45
|
-
message: 'Apply'
|
|
46
|
-
})
|
|
47
|
-
}),
|
|
48
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Button, {
|
|
49
|
-
size: "3xs",
|
|
50
|
-
variant: "ghost",
|
|
51
|
-
onClick: onCancel,
|
|
52
|
-
children: _({
|
|
53
|
-
id: 'canvas.json_value_panel.cancel',
|
|
54
|
-
message: 'Cancel'
|
|
55
|
-
})
|
|
56
|
-
})
|
|
57
|
-
]
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
function EditorTextarea({ value, onChange, onApply, onCancel, invalid, rows, ariaLabel, placeholder, className }) {
|
|
61
|
-
const textareaRef = (0, external_react_namespaceObject.useRef)(null);
|
|
62
|
-
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
63
|
-
textareaRef.current?.focus();
|
|
64
|
-
}, []);
|
|
65
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("textarea", {
|
|
66
|
-
ref: textareaRef,
|
|
67
|
-
value: value,
|
|
68
|
-
onChange: (e)=>onChange(e.target.value),
|
|
69
|
-
onKeyDown: (e)=>{
|
|
70
|
-
if ('Escape' === e.key) {
|
|
71
|
-
e.preventDefault();
|
|
72
|
-
e.stopPropagation();
|
|
73
|
-
onCancel();
|
|
74
|
-
}
|
|
75
|
-
if ('Enter' === e.key && (e.metaKey || e.ctrlKey)) onApply();
|
|
76
|
-
},
|
|
77
|
-
rows: rows,
|
|
78
|
-
spellCheck: false,
|
|
79
|
-
"aria-label": ariaLabel,
|
|
80
|
-
"aria-invalid": invalid || void 0,
|
|
81
|
-
placeholder: placeholder,
|
|
82
|
-
className: (0, apollo_wind_namespaceObject.cn)('w-full resize-y rounded-lg border bg-surface p-2 font-mono text-xs leading-5 text-foreground outline-none', invalid ? 'border-error' : 'border-border-subtle focus:border-brand', className)
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
exports.EditorActions = __webpack_exports__.EditorActions;
|
|
86
|
-
exports.EditorTextarea = __webpack_exports__.EditorTextarea;
|
|
87
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
88
|
-
"EditorActions",
|
|
89
|
-
"EditorTextarea"
|
|
90
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
91
|
-
Object.defineProperty(exports, '__esModule', {
|
|
92
|
-
value: true
|
|
93
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare function EditorActions({ onApply, onCancel, applyDisabled, }: {
|
|
2
|
-
onApply: () => void;
|
|
3
|
-
onCancel: () => void;
|
|
4
|
-
applyDisabled?: boolean;
|
|
5
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export interface EditorTextareaProps {
|
|
7
|
-
value: string;
|
|
8
|
-
onChange: (value: string) => void;
|
|
9
|
-
onApply: () => void;
|
|
10
|
-
onCancel: () => void;
|
|
11
|
-
invalid: boolean;
|
|
12
|
-
rows: number;
|
|
13
|
-
ariaLabel: string;
|
|
14
|
-
placeholder?: string;
|
|
15
|
-
className?: string;
|
|
16
|
-
}
|
|
17
|
-
export declare function EditorTextarea({ value, onChange, onApply, onCancel, invalid, rows, ariaLabel, placeholder, className, }: EditorTextareaProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
//# sourceMappingURL=EditorChrome.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EditorChrome.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/JsonTree/EditorChrome.tsx"],"names":[],"mappings":"AAKA,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,QAAQ,EACR,aAAqB,GACtB,EAAE;IACD,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,2CAYA;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAElC,OAAO,EAAE,MAAM,IAAI,CAAC;IAEpB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAGD,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,OAAO,EACP,IAAI,EACJ,SAAS,EACT,WAAW,EACX,SAAS,GACV,EAAE,mBAAmB,2CAsCrB"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Button, cn } from "@uipath/apollo-wind";
|
|
3
|
-
import { useEffect, useRef } from "react";
|
|
4
|
-
import { useSafeLingui } from "../../../i18n/index.js";
|
|
5
|
-
function EditorActions({ onApply, onCancel, applyDisabled = false }) {
|
|
6
|
-
const { _ } = useSafeLingui();
|
|
7
|
-
return /*#__PURE__*/ jsxs("div", {
|
|
8
|
-
className: "flex items-center gap-1.5",
|
|
9
|
-
children: [
|
|
10
|
-
/*#__PURE__*/ jsx(Button, {
|
|
11
|
-
size: "3xs",
|
|
12
|
-
onClick: onApply,
|
|
13
|
-
disabled: applyDisabled,
|
|
14
|
-
children: _({
|
|
15
|
-
id: 'canvas.json_value_panel.apply',
|
|
16
|
-
message: 'Apply'
|
|
17
|
-
})
|
|
18
|
-
}),
|
|
19
|
-
/*#__PURE__*/ jsx(Button, {
|
|
20
|
-
size: "3xs",
|
|
21
|
-
variant: "ghost",
|
|
22
|
-
onClick: onCancel,
|
|
23
|
-
children: _({
|
|
24
|
-
id: 'canvas.json_value_panel.cancel',
|
|
25
|
-
message: 'Cancel'
|
|
26
|
-
})
|
|
27
|
-
})
|
|
28
|
-
]
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
function EditorTextarea({ value, onChange, onApply, onCancel, invalid, rows, ariaLabel, placeholder, className }) {
|
|
32
|
-
const textareaRef = useRef(null);
|
|
33
|
-
useEffect(()=>{
|
|
34
|
-
textareaRef.current?.focus();
|
|
35
|
-
}, []);
|
|
36
|
-
return /*#__PURE__*/ jsx("textarea", {
|
|
37
|
-
ref: textareaRef,
|
|
38
|
-
value: value,
|
|
39
|
-
onChange: (e)=>onChange(e.target.value),
|
|
40
|
-
onKeyDown: (e)=>{
|
|
41
|
-
if ('Escape' === e.key) {
|
|
42
|
-
e.preventDefault();
|
|
43
|
-
e.stopPropagation();
|
|
44
|
-
onCancel();
|
|
45
|
-
}
|
|
46
|
-
if ('Enter' === e.key && (e.metaKey || e.ctrlKey)) onApply();
|
|
47
|
-
},
|
|
48
|
-
rows: rows,
|
|
49
|
-
spellCheck: false,
|
|
50
|
-
"aria-label": ariaLabel,
|
|
51
|
-
"aria-invalid": invalid || void 0,
|
|
52
|
-
placeholder: placeholder,
|
|
53
|
-
className: cn('w-full resize-y rounded-lg border bg-surface p-2 font-mono text-xs leading-5 text-foreground outline-none', invalid ? 'border-error' : 'border-border-subtle focus:border-brand', className)
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
export { EditorActions, EditorTextarea };
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: definition[key]
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
(()=>{
|
|
12
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
})();
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
-
value: 'Module'
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
-
value: true
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
var __webpack_exports__ = {};
|
|
25
|
-
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
JsonContainerEditor: ()=>JsonContainerEditor
|
|
28
|
-
});
|
|
29
|
-
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
-
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
31
|
-
const external_react_namespaceObject = require("react");
|
|
32
|
-
const index_cjs_namespaceObject = require("../../../i18n/index.cjs");
|
|
33
|
-
const external_EditorChrome_cjs_namespaceObject = require("./EditorChrome.cjs");
|
|
34
|
-
function isValidJson(raw) {
|
|
35
|
-
try {
|
|
36
|
-
JSON.parse(raw);
|
|
37
|
-
return true;
|
|
38
|
-
} catch {
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
function JsonContainerEditor({ node, onCommit, onCancel, renderCodeEditor, className }) {
|
|
43
|
-
const { _ } = (0, index_cjs_namespaceObject.useSafeLingui)();
|
|
44
|
-
const initialValue = node.value ?? ('array' === node.type ? [] : {});
|
|
45
|
-
const [raw, setRaw] = (0, external_react_namespaceObject.useState)(()=>JSON.stringify(initialValue, null, 2));
|
|
46
|
-
const [error, setError] = (0, external_react_namespaceObject.useState)(null);
|
|
47
|
-
const handleChange = (value)=>{
|
|
48
|
-
setRaw(value);
|
|
49
|
-
setError(null);
|
|
50
|
-
};
|
|
51
|
-
const apply = ()=>{
|
|
52
|
-
try {
|
|
53
|
-
onCommit(JSON.parse(raw));
|
|
54
|
-
} catch (e) {
|
|
55
|
-
setError(e instanceof Error ? e.message : _({
|
|
56
|
-
id: 'canvas.json_value_panel.invalid_json',
|
|
57
|
-
message: 'Invalid JSON'
|
|
58
|
-
}));
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
62
|
-
className: (0, apollo_wind_namespaceObject.cn)('flex flex-col gap-1.5 [&>[data-slot=form-field-error]]:mt-0', className),
|
|
63
|
-
children: [
|
|
64
|
-
renderCodeEditor ? renderCodeEditor({
|
|
65
|
-
value: raw,
|
|
66
|
-
onChange: handleChange,
|
|
67
|
-
onApply: apply,
|
|
68
|
-
onCancel,
|
|
69
|
-
invalid: !isValidJson(raw),
|
|
70
|
-
language: 'json',
|
|
71
|
-
autoFocus: true
|
|
72
|
-
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_EditorChrome_cjs_namespaceObject.EditorTextarea, {
|
|
73
|
-
value: raw,
|
|
74
|
-
onChange: handleChange,
|
|
75
|
-
onApply: apply,
|
|
76
|
-
onCancel: onCancel,
|
|
77
|
-
invalid: !!error,
|
|
78
|
-
rows: Math.min(12, Math.max(3, raw.split('\n').length)),
|
|
79
|
-
ariaLabel: _({
|
|
80
|
-
id: 'canvas.json_value_panel.edit_json_of',
|
|
81
|
-
message: 'Edit JSON of {key}',
|
|
82
|
-
values: {
|
|
83
|
-
key: node.key
|
|
84
|
-
}
|
|
85
|
-
})
|
|
86
|
-
}),
|
|
87
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.FormFieldError, {
|
|
88
|
-
children: error
|
|
89
|
-
}),
|
|
90
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_EditorChrome_cjs_namespaceObject.EditorActions, {
|
|
91
|
-
onApply: apply,
|
|
92
|
-
onCancel: onCancel
|
|
93
|
-
})
|
|
94
|
-
]
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
exports.JsonContainerEditor = __webpack_exports__.JsonContainerEditor;
|
|
98
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
99
|
-
"JsonContainerEditor"
|
|
100
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
101
|
-
Object.defineProperty(exports, '__esModule', {
|
|
102
|
-
value: true
|
|
103
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { JsonTreeNode, JsonValue, RenderCodeEditor } from './JsonTree.types';
|
|
2
|
-
export interface JsonContainerEditorProps {
|
|
3
|
-
node: JsonTreeNode;
|
|
4
|
-
onCommit: (value: JsonValue) => void;
|
|
5
|
-
onCancel: () => void;
|
|
6
|
-
renderCodeEditor?: RenderCodeEditor;
|
|
7
|
-
className?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare function JsonContainerEditor({ node, onCommit, onCancel, renderCodeEditor, className, }: JsonContainerEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
//# sourceMappingURL=JsonContainerEditor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"JsonContainerEditor.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/JsonTree/JsonContainerEditor.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAElF,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IACrC,QAAQ,EAAE,MAAM,IAAI,CAAC;IAKrB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAgBD,wBAAgB,mBAAmB,CAAC,EAClC,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,SAAS,GACV,EAAE,wBAAwB,2CAyD1B"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { FormFieldError, cn } from "@uipath/apollo-wind";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import { useSafeLingui } from "../../../i18n/index.js";
|
|
5
|
-
import { EditorActions, EditorTextarea } from "./EditorChrome.js";
|
|
6
|
-
function isValidJson(raw) {
|
|
7
|
-
try {
|
|
8
|
-
JSON.parse(raw);
|
|
9
|
-
return true;
|
|
10
|
-
} catch {
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
function JsonContainerEditor({ node, onCommit, onCancel, renderCodeEditor, className }) {
|
|
15
|
-
const { _ } = useSafeLingui();
|
|
16
|
-
const initialValue = node.value ?? ('array' === node.type ? [] : {});
|
|
17
|
-
const [raw, setRaw] = useState(()=>JSON.stringify(initialValue, null, 2));
|
|
18
|
-
const [error, setError] = useState(null);
|
|
19
|
-
const handleChange = (value)=>{
|
|
20
|
-
setRaw(value);
|
|
21
|
-
setError(null);
|
|
22
|
-
};
|
|
23
|
-
const apply = ()=>{
|
|
24
|
-
try {
|
|
25
|
-
onCommit(JSON.parse(raw));
|
|
26
|
-
} catch (e) {
|
|
27
|
-
setError(e instanceof Error ? e.message : _({
|
|
28
|
-
id: 'canvas.json_value_panel.invalid_json',
|
|
29
|
-
message: 'Invalid JSON'
|
|
30
|
-
}));
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
return /*#__PURE__*/ jsxs("div", {
|
|
34
|
-
className: cn('flex flex-col gap-1.5 [&>[data-slot=form-field-error]]:mt-0', className),
|
|
35
|
-
children: [
|
|
36
|
-
renderCodeEditor ? renderCodeEditor({
|
|
37
|
-
value: raw,
|
|
38
|
-
onChange: handleChange,
|
|
39
|
-
onApply: apply,
|
|
40
|
-
onCancel,
|
|
41
|
-
invalid: !isValidJson(raw),
|
|
42
|
-
language: 'json',
|
|
43
|
-
autoFocus: true
|
|
44
|
-
}) : /*#__PURE__*/ jsx(EditorTextarea, {
|
|
45
|
-
value: raw,
|
|
46
|
-
onChange: handleChange,
|
|
47
|
-
onApply: apply,
|
|
48
|
-
onCancel: onCancel,
|
|
49
|
-
invalid: !!error,
|
|
50
|
-
rows: Math.min(12, Math.max(3, raw.split('\n').length)),
|
|
51
|
-
ariaLabel: _({
|
|
52
|
-
id: 'canvas.json_value_panel.edit_json_of',
|
|
53
|
-
message: 'Edit JSON of {key}',
|
|
54
|
-
values: {
|
|
55
|
-
key: node.key
|
|
56
|
-
}
|
|
57
|
-
})
|
|
58
|
-
}),
|
|
59
|
-
/*#__PURE__*/ jsx(FormFieldError, {
|
|
60
|
-
children: error
|
|
61
|
-
}),
|
|
62
|
-
/*#__PURE__*/ jsx(EditorActions, {
|
|
63
|
-
onApply: apply,
|
|
64
|
-
onCancel: onCancel
|
|
65
|
-
})
|
|
66
|
-
]
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
export { JsonContainerEditor };
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: definition[key]
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
})();
|
|
11
|
-
(()=>{
|
|
12
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
-
})();
|
|
14
|
-
(()=>{
|
|
15
|
-
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
-
value: 'Module'
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
-
value: true
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
})();
|
|
24
|
-
var __webpack_exports__ = {};
|
|
25
|
-
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
JsonLeafValueEditor: ()=>JsonLeafValueEditor
|
|
28
|
-
});
|
|
29
|
-
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
-
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
31
|
-
const external_react_namespaceObject = require("react");
|
|
32
|
-
const index_cjs_namespaceObject = require("../../../i18n/index.cjs");
|
|
33
|
-
const external_leafEditTypes_cjs_namespaceObject = require("./leafEditTypes.cjs");
|
|
34
|
-
function JsonLeafValueEditor({ node, onCommit, onCancel, className }) {
|
|
35
|
-
const { _ } = (0, index_cjs_namespaceObject.useSafeLingui)();
|
|
36
|
-
const editType = (0, external_leafEditTypes_cjs_namespaceObject.resolveLeafEditType)(node.type, node.schema);
|
|
37
|
-
const initial = void 0 === node.value || null === node.value ? String(node.schema?.default ?? '') : String(node.value);
|
|
38
|
-
const [raw, setRaw] = (0, external_react_namespaceObject.useState)(initial);
|
|
39
|
-
const cancelledRef = (0, external_react_namespaceObject.useRef)(false);
|
|
40
|
-
const inputRef = (0, external_react_namespaceObject.useRef)(null);
|
|
41
|
-
const invalid = void 0 === (0, external_leafEditTypes_cjs_namespaceObject.parseLeafValue)(raw, editType);
|
|
42
|
-
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
43
|
-
inputRef.current?.focus();
|
|
44
|
-
}, []);
|
|
45
|
-
const commit = ()=>{
|
|
46
|
-
const parsed = (0, external_leafEditTypes_cjs_namespaceObject.parseLeafValue)(raw, editType);
|
|
47
|
-
if (void 0 === parsed) return;
|
|
48
|
-
onCommit(parsed);
|
|
49
|
-
};
|
|
50
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("input", {
|
|
51
|
-
ref: inputRef,
|
|
52
|
-
type: "text",
|
|
53
|
-
value: raw,
|
|
54
|
-
inputMode: 'integer' === editType ? 'numeric' : 'number' === editType ? 'decimal' : void 0,
|
|
55
|
-
onChange: (e)=>setRaw(e.target.value),
|
|
56
|
-
onFocus: (e)=>e.target.select(),
|
|
57
|
-
onBlur: ()=>{
|
|
58
|
-
if (cancelledRef.current) {
|
|
59
|
-
cancelledRef.current = false;
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
if (invalid) onCancel();
|
|
63
|
-
else commit();
|
|
64
|
-
},
|
|
65
|
-
onKeyDown: (e)=>{
|
|
66
|
-
if ('Enter' === e.key) commit();
|
|
67
|
-
if ('Escape' === e.key) {
|
|
68
|
-
e.preventDefault();
|
|
69
|
-
e.stopPropagation();
|
|
70
|
-
cancelledRef.current = true;
|
|
71
|
-
onCancel();
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
"aria-label": _({
|
|
75
|
-
id: 'canvas.json_value_panel.edit_value_of',
|
|
76
|
-
message: 'Edit value of {key}',
|
|
77
|
-
values: {
|
|
78
|
-
key: node.key
|
|
79
|
-
}
|
|
80
|
-
}),
|
|
81
|
-
"aria-invalid": invalid || void 0,
|
|
82
|
-
placeholder: (0, external_leafEditTypes_cjs_namespaceObject.isNumericEdit)(editType) ? _({
|
|
83
|
-
id: 'canvas.json_value_panel.enter_number',
|
|
84
|
-
message: 'Enter a number'
|
|
85
|
-
}) : _({
|
|
86
|
-
id: 'canvas.json_value_panel.enter_value',
|
|
87
|
-
message: 'Enter a value'
|
|
88
|
-
}),
|
|
89
|
-
className: (0, apollo_wind_namespaceObject.cn)('min-w-0 flex-1 rounded bg-transparent font-mono text-xs text-foreground outline-none ring-1', invalid ? 'ring-error' : 'ring-brand', className)
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
exports.JsonLeafValueEditor = __webpack_exports__.JsonLeafValueEditor;
|
|
93
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
94
|
-
"JsonLeafValueEditor"
|
|
95
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
96
|
-
Object.defineProperty(exports, '__esModule', {
|
|
97
|
-
value: true
|
|
98
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { JsonTreeNode, JsonValue } from './JsonTree.types';
|
|
2
|
-
export interface JsonLeafValueEditorProps {
|
|
3
|
-
node: JsonTreeNode;
|
|
4
|
-
onCommit: (value: JsonValue) => void;
|
|
5
|
-
onCancel: () => void;
|
|
6
|
-
className?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare function JsonLeafValueEditor({ node, onCommit, onCancel, className, }: JsonLeafValueEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
//# sourceMappingURL=JsonLeafValueEditor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"JsonLeafValueEditor.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/JsonTree/JsonLeafValueEditor.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAGhE,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IACrC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAMD,wBAAgB,mBAAmB,CAAC,EAClC,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,SAAS,GACV,EAAE,wBAAwB,2CA8E1B"}
|