@uipath/apollo-react 6.71.0 → 6.73.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 (98) 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/styles/tailwind.canvas.css +1 -1
  12. package/dist/canvas/utils/icon-registry.cjs +42 -25
  13. package/dist/canvas/utils/icon-registry.d.ts.map +1 -1
  14. package/dist/canvas/utils/icon-registry.js +18 -1
  15. package/dist/icons/ComponentBatch.cjs +71 -0
  16. package/dist/icons/ComponentBatch.d.ts +7 -0
  17. package/dist/icons/ComponentBatch.d.ts.map +1 -0
  18. package/dist/icons/ComponentBatch.js +24 -0
  19. package/dist/icons/ComponentBusinessRule.cjs +18 -4
  20. package/dist/icons/ComponentBusinessRule.d.ts.map +1 -1
  21. package/dist/icons/ComponentBusinessRule.js +18 -4
  22. package/dist/icons/ComponentDecisionTable.cjs +75 -0
  23. package/dist/icons/ComponentDecisionTable.d.ts +7 -0
  24. package/dist/icons/ComponentDecisionTable.d.ts.map +1 -0
  25. package/dist/icons/ComponentDecisionTable.js +28 -0
  26. package/dist/icons/ComponentDecisionTableRow.cjs +71 -0
  27. package/dist/icons/ComponentDecisionTableRow.d.ts +7 -0
  28. package/dist/icons/ComponentDecisionTableRow.d.ts.map +1 -0
  29. package/dist/icons/ComponentDecisionTableRow.js +24 -0
  30. package/dist/icons/ComponentLiteralExpression.cjs +71 -0
  31. package/dist/icons/ComponentLiteralExpression.d.ts +7 -0
  32. package/dist/icons/ComponentLiteralExpression.d.ts.map +1 -0
  33. package/dist/icons/ComponentLiteralExpression.js +24 -0
  34. package/dist/icons/index.cjs +42 -10
  35. package/dist/icons/index.d.ts +4 -0
  36. package/dist/icons/index.d.ts.map +1 -1
  37. package/dist/icons/index.js +5 -1
  38. package/package.json +4 -4
  39. package/dist/canvas/components/JsonTree/DecorationChip.cjs +0 -81
  40. package/dist/canvas/components/JsonTree/DecorationChip.d.ts +0 -5
  41. package/dist/canvas/components/JsonTree/DecorationChip.d.ts.map +0 -1
  42. package/dist/canvas/components/JsonTree/DecorationChip.js +0 -47
  43. package/dist/canvas/components/JsonTree/EditorChrome.cjs +0 -93
  44. package/dist/canvas/components/JsonTree/EditorChrome.d.ts +0 -18
  45. package/dist/canvas/components/JsonTree/EditorChrome.d.ts.map +0 -1
  46. package/dist/canvas/components/JsonTree/EditorChrome.js +0 -56
  47. package/dist/canvas/components/JsonTree/JsonContainerEditor.cjs +0 -103
  48. package/dist/canvas/components/JsonTree/JsonContainerEditor.d.ts +0 -10
  49. package/dist/canvas/components/JsonTree/JsonContainerEditor.d.ts.map +0 -1
  50. package/dist/canvas/components/JsonTree/JsonContainerEditor.js +0 -69
  51. package/dist/canvas/components/JsonTree/JsonLeafValueEditor.cjs +0 -98
  52. package/dist/canvas/components/JsonTree/JsonLeafValueEditor.d.ts +0 -9
  53. package/dist/canvas/components/JsonTree/JsonLeafValueEditor.d.ts.map +0 -1
  54. package/dist/canvas/components/JsonTree/JsonLeafValueEditor.js +0 -64
  55. package/dist/canvas/components/JsonTree/JsonMultilineLeafEditor.cjs +0 -86
  56. package/dist/canvas/components/JsonTree/JsonMultilineLeafEditor.d.ts +0 -9
  57. package/dist/canvas/components/JsonTree/JsonMultilineLeafEditor.d.ts.map +0 -1
  58. package/dist/canvas/components/JsonTree/JsonMultilineLeafEditor.js +0 -52
  59. package/dist/canvas/components/JsonTree/JsonTree.types.cjs +0 -18
  60. package/dist/canvas/components/JsonTree/JsonTree.types.d.ts +0 -110
  61. package/dist/canvas/components/JsonTree/JsonTree.types.d.ts.map +0 -1
  62. package/dist/canvas/components/JsonTree/JsonTree.types.js +0 -0
  63. package/dist/canvas/components/JsonTree/JsonTreeRow.cjs +0 -358
  64. package/dist/canvas/components/JsonTree/JsonTreeRow.d.ts +0 -36
  65. package/dist/canvas/components/JsonTree/JsonTreeRow.d.ts.map +0 -1
  66. package/dist/canvas/components/JsonTree/JsonTreeRow.js +0 -318
  67. package/dist/canvas/components/JsonTree/JsonTreeToolbar.cjs +0 -224
  68. package/dist/canvas/components/JsonTree/JsonTreeToolbar.d.ts +0 -17
  69. package/dist/canvas/components/JsonTree/JsonTreeToolbar.d.ts.map +0 -1
  70. package/dist/canvas/components/JsonTree/JsonTreeToolbar.js +0 -190
  71. package/dist/canvas/components/JsonTree/JsonTypeBadge.cjs +0 -70
  72. package/dist/canvas/components/JsonTree/JsonTypeBadge.d.ts +0 -10
  73. package/dist/canvas/components/JsonTree/JsonTypeBadge.d.ts.map +0 -1
  74. package/dist/canvas/components/JsonTree/JsonTypeBadge.js +0 -36
  75. package/dist/canvas/components/JsonTree/NodeKey.cjs +0 -86
  76. package/dist/canvas/components/JsonTree/NodeKey.d.ts +0 -10
  77. package/dist/canvas/components/JsonTree/NodeKey.d.ts.map +0 -1
  78. package/dist/canvas/components/JsonTree/NodeKey.js +0 -52
  79. package/dist/canvas/components/JsonTree/RowActions.cjs +0 -121
  80. package/dist/canvas/components/JsonTree/RowActions.d.ts +0 -8
  81. package/dist/canvas/components/JsonTree/RowActions.d.ts.map +0 -1
  82. package/dist/canvas/components/JsonTree/RowActions.js +0 -87
  83. package/dist/canvas/components/JsonTree/ScalarValueCell.cjs +0 -132
  84. package/dist/canvas/components/JsonTree/ScalarValueCell.d.ts +0 -12
  85. package/dist/canvas/components/JsonTree/ScalarValueCell.d.ts.map +0 -1
  86. package/dist/canvas/components/JsonTree/ScalarValueCell.js +0 -95
  87. package/dist/canvas/components/JsonTree/buildJsonTree.cjs +0 -321
  88. package/dist/canvas/components/JsonTree/buildJsonTree.d.ts +0 -39
  89. package/dist/canvas/components/JsonTree/buildJsonTree.d.ts.map +0 -1
  90. package/dist/canvas/components/JsonTree/buildJsonTree.js +0 -254
  91. package/dist/canvas/components/JsonTree/clipboard.cjs +0 -63
  92. package/dist/canvas/components/JsonTree/clipboard.d.ts +0 -2
  93. package/dist/canvas/components/JsonTree/clipboard.d.ts.map +0 -1
  94. package/dist/canvas/components/JsonTree/clipboard.js +0 -29
  95. package/dist/canvas/components/JsonTree/leafEditTypes.cjs +0 -74
  96. package/dist/canvas/components/JsonTree/leafEditTypes.d.ts +0 -6
  97. package/dist/canvas/components/JsonTree/leafEditTypes.d.ts.map +0 -1
  98. package/dist/canvas/components/JsonTree/leafEditTypes.js +0 -34
@@ -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"}
@@ -1,64 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { cn } from "@uipath/apollo-wind";
3
- import { useEffect, useRef, useState } from "react";
4
- import { useSafeLingui } from "../../../i18n/index.js";
5
- import { isNumericEdit, parseLeafValue, resolveLeafEditType } from "./leafEditTypes.js";
6
- function JsonLeafValueEditor({ node, onCommit, onCancel, className }) {
7
- const { _ } = useSafeLingui();
8
- const editType = resolveLeafEditType(node.type, node.schema);
9
- const initial = void 0 === node.value || null === node.value ? String(node.schema?.default ?? '') : String(node.value);
10
- const [raw, setRaw] = useState(initial);
11
- const cancelledRef = useRef(false);
12
- const inputRef = useRef(null);
13
- const invalid = void 0 === parseLeafValue(raw, editType);
14
- useEffect(()=>{
15
- inputRef.current?.focus();
16
- }, []);
17
- const commit = ()=>{
18
- const parsed = parseLeafValue(raw, editType);
19
- if (void 0 === parsed) return;
20
- onCommit(parsed);
21
- };
22
- return /*#__PURE__*/ jsx("input", {
23
- ref: inputRef,
24
- type: "text",
25
- value: raw,
26
- inputMode: 'integer' === editType ? 'numeric' : 'number' === editType ? 'decimal' : void 0,
27
- onChange: (e)=>setRaw(e.target.value),
28
- onFocus: (e)=>e.target.select(),
29
- onBlur: ()=>{
30
- if (cancelledRef.current) {
31
- cancelledRef.current = false;
32
- return;
33
- }
34
- if (invalid) onCancel();
35
- else commit();
36
- },
37
- onKeyDown: (e)=>{
38
- if ('Enter' === e.key) commit();
39
- if ('Escape' === e.key) {
40
- e.preventDefault();
41
- e.stopPropagation();
42
- cancelledRef.current = true;
43
- onCancel();
44
- }
45
- },
46
- "aria-label": _({
47
- id: 'canvas.json_value_panel.edit_value_of',
48
- message: 'Edit value of {key}',
49
- values: {
50
- key: node.key
51
- }
52
- }),
53
- "aria-invalid": invalid || void 0,
54
- placeholder: isNumericEdit(editType) ? _({
55
- id: 'canvas.json_value_panel.enter_number',
56
- message: 'Enter a number'
57
- }) : _({
58
- id: 'canvas.json_value_panel.enter_value',
59
- message: 'Enter a value'
60
- }),
61
- className: 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)
62
- });
63
- }
64
- export { JsonLeafValueEditor };
@@ -1,86 +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
- JsonMultilineLeafEditor: ()=>JsonMultilineLeafEditor
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
- const external_leafEditTypes_cjs_namespaceObject = require("./leafEditTypes.cjs");
35
- function JsonMultilineLeafEditor({ node, onCommit, onCancel, className }) {
36
- const { _ } = (0, index_cjs_namespaceObject.useSafeLingui)();
37
- const editType = (0, external_leafEditTypes_cjs_namespaceObject.resolveLeafEditType)(node.type, node.schema);
38
- const initial = void 0 === node.value || null === node.value ? String(node.schema?.default ?? '') : String(node.value);
39
- const [raw, setRaw] = (0, external_react_namespaceObject.useState)(initial);
40
- const invalid = void 0 === (0, external_leafEditTypes_cjs_namespaceObject.parseLeafValue)(raw, editType);
41
- const apply = ()=>{
42
- const parsed = (0, external_leafEditTypes_cjs_namespaceObject.parseLeafValue)(raw, editType);
43
- if (void 0 === parsed) return;
44
- onCommit(parsed);
45
- };
46
- return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
47
- className: (0, apollo_wind_namespaceObject.cn)('flex flex-col gap-1.5', className),
48
- children: [
49
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_EditorChrome_cjs_namespaceObject.EditorTextarea, {
50
- value: raw,
51
- onChange: setRaw,
52
- onApply: apply,
53
- onCancel: onCancel,
54
- invalid: invalid,
55
- rows: Math.min(10, Math.max(3, raw.split('\n').length + 1)),
56
- ariaLabel: _({
57
- id: 'canvas.json_value_panel.edit_value_of',
58
- message: 'Edit value of {key}',
59
- values: {
60
- key: node.key
61
- }
62
- }),
63
- placeholder: (0, external_leafEditTypes_cjs_namespaceObject.isNumericEdit)(editType) ? _({
64
- id: 'canvas.json_value_panel.enter_number',
65
- message: 'Enter a number'
66
- }) : _({
67
- id: 'canvas.json_value_panel.enter_value',
68
- message: 'Enter a value'
69
- }),
70
- className: "whitespace-pre-wrap"
71
- }),
72
- /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_EditorChrome_cjs_namespaceObject.EditorActions, {
73
- onApply: apply,
74
- onCancel: onCancel,
75
- applyDisabled: invalid
76
- })
77
- ]
78
- });
79
- }
80
- exports.JsonMultilineLeafEditor = __webpack_exports__.JsonMultilineLeafEditor;
81
- for(var __rspack_i in __webpack_exports__)if (-1 === [
82
- "JsonMultilineLeafEditor"
83
- ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
84
- Object.defineProperty(exports, '__esModule', {
85
- value: true
86
- });