@uipath/apollo-react 6.78.1 → 6.80.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/Guardrails/__fixtures__/definitions-wire.fixtures.d.ts +2 -0
- package/dist/canvas/components/Guardrails/__fixtures__/definitions-wire.fixtures.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/__fixtures__/host-copy-baselines.d.ts +1 -0
- package/dist/canvas/components/Guardrails/__fixtures__/host-copy-baselines.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/components/enum-list-chips-field.cjs +2 -1
- package/dist/canvas/components/Guardrails/components/enum-list-chips-field.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/components/enum-list-chips-field.js +2 -1
- package/dist/canvas/components/Guardrails/components/map-enum-field.cjs +49 -22
- package/dist/canvas/components/Guardrails/components/map-enum-field.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/components/map-enum-field.js +50 -23
- package/dist/canvas/components/Guardrails/definitions-copy.cjs +536 -0
- package/dist/canvas/components/Guardrails/definitions-copy.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/definitions-copy.js +536 -0
- package/dist/canvas/components/Guardrails/definitions-enrich.cjs +3 -0
- package/dist/canvas/components/Guardrails/definitions-enrich.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/definitions-enrich.js +3 -0
- package/dist/canvas/components/Guardrails/definitions-parse.cjs +2 -1
- package/dist/canvas/components/Guardrails/definitions-parse.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/definitions-parse.js +2 -1
- package/dist/canvas/components/Guardrails/definitions-wire.d.ts +1 -0
- package/dist/canvas/components/Guardrails/definitions-wire.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/form-schema-builder.cjs +10 -1
- package/dist/canvas/components/Guardrails/form-schema-builder.d.ts +2 -1
- package/dist/canvas/components/Guardrails/form-schema-builder.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/form-schema-builder.js +8 -2
- package/dist/canvas/components/Guardrails/i18n.cjs +11 -0
- package/dist/canvas/components/Guardrails/i18n.d.ts +5 -3
- package/dist/canvas/components/Guardrails/i18n.d.ts.map +1 -1
- package/dist/canvas/components/Guardrails/i18n.js +11 -0
- package/dist/canvas/components/Guardrails/types.d.ts +1 -0
- package/dist/canvas/components/Guardrails/types.d.ts.map +1 -1
- package/dist/canvas/components/JsonTree/index.cjs +4 -0
- package/dist/canvas/components/JsonTree/index.d.ts +1 -1
- package/dist/canvas/components/JsonTree/index.d.ts.map +1 -1
- package/dist/canvas/components/JsonTree/index.js +2 -2
- package/dist/canvas/components/NodeIOView/NodeIOView.cjs +10 -12
- package/dist/canvas/components/NodeIOView/NodeIOView.d.ts +1 -1
- package/dist/canvas/components/NodeIOView/NodeIOView.d.ts.map +1 -1
- package/dist/canvas/components/NodeIOView/NodeIOView.js +12 -14
- package/dist/canvas/components/NodeIOView/NodeIOView.types.d.ts +2 -0
- package/dist/canvas/components/NodeIOView/NodeIOView.types.d.ts.map +1 -1
- package/dist/canvas/components/NodePropertyPanel/NodePropertyPanel.cjs +6 -6
- package/dist/canvas/components/NodePropertyPanel/NodePropertyPanel.d.ts.map +1 -1
- package/dist/canvas/components/NodePropertyPanel/NodePropertyPanel.js +6 -6
- package/dist/canvas/components/NodeVariablesPanel/NodeVariableEditDialog.cjs +405 -0
- package/dist/canvas/components/NodeVariablesPanel/NodeVariableEditDialog.d.ts +10 -0
- package/dist/canvas/components/NodeVariablesPanel/NodeVariableEditDialog.d.ts.map +1 -0
- package/dist/canvas/components/NodeVariablesPanel/NodeVariableEditDialog.js +371 -0
- package/dist/canvas/components/NodeVariablesPanel/NodeVariablesPanel.cjs +726 -0
- package/dist/canvas/components/NodeVariablesPanel/NodeVariablesPanel.d.ts +3 -0
- package/dist/canvas/components/NodeVariablesPanel/NodeVariablesPanel.d.ts.map +1 -0
- package/dist/canvas/components/NodeVariablesPanel/NodeVariablesPanel.js +692 -0
- package/dist/canvas/components/NodeVariablesPanel/NodeVariablesPanel.types.cjs +18 -0
- package/dist/canvas/components/NodeVariablesPanel/NodeVariablesPanel.types.d.ts +65 -0
- package/dist/canvas/components/NodeVariablesPanel/NodeVariablesPanel.types.d.ts.map +1 -0
- package/dist/canvas/components/NodeVariablesPanel/NodeVariablesPanel.types.js +0 -0
- package/dist/canvas/components/NodeVariablesPanel/index.cjs +36 -0
- package/dist/canvas/components/NodeVariablesPanel/index.d.ts +3 -0
- package/dist/canvas/components/NodeVariablesPanel/index.d.ts.map +1 -0
- package/dist/canvas/components/NodeVariablesPanel/index.js +2 -0
- package/dist/canvas/components/index.cjs +23 -16
- package/dist/canvas/components/index.d.ts +1 -0
- package/dist/canvas/components/index.d.ts.map +1 -1
- package/dist/canvas/components/index.js +1 -0
- package/dist/canvas/locales/en.cjs +1 -1
- package/dist/canvas/locales/en.d.ts.map +1 -1
- package/dist/canvas/locales/en.js +1 -1
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/dist/chat/styles/tailwind.chat.css +1 -1
- package/package.json +2 -2
|
@@ -10,7 +10,7 @@ function findFieldElement(root, name) {
|
|
|
10
10
|
for (const field of fields)if (field.getAttribute('data-field-name') === name) return field;
|
|
11
11
|
return null;
|
|
12
12
|
}
|
|
13
|
-
function NodePropertyPanel({ panelTitle, dragHandleProps, onClose, nodeIcon, nodeLabel, nodeCategory, nodeDescription, nodeLabelPlaceholder, nodeDescriptionPlaceholder, onNodeLabelChange, onNodeLabelSubmit, onNodeDescriptionChange, onNodeDescriptionSubmit, nodeLabelError, nodeDescriptionError, action, schema, plugins, onSubmit, disabled, autoComplete, resetKey, className, contentInset = '
|
|
13
|
+
function NodePropertyPanel({ panelTitle, dragHandleProps, onClose, nodeIcon, nodeLabel, nodeCategory, nodeDescription, nodeLabelPlaceholder, nodeDescriptionPlaceholder, onNodeLabelChange, onNodeLabelSubmit, onNodeDescriptionChange, onNodeDescriptionSubmit, nodeLabelError, nodeDescriptionError, action, schema, plugins, onSubmit, disabled, autoComplete, resetKey, className, contentInset = '1rem', children, headerExtra, sectionVariant, activeStepId, onActiveStepChange, changedFields }) {
|
|
14
14
|
const { _ } = useSafeLingui();
|
|
15
15
|
const rootRef = useRef(null);
|
|
16
16
|
const scrolledKeyRef = useRef(null);
|
|
@@ -81,7 +81,7 @@ function NodePropertyPanel({ panelTitle, dragHandleProps, onClose, nodeIcon, nod
|
|
|
81
81
|
children: [
|
|
82
82
|
panelTitle && /*#__PURE__*/ jsxs("div", {
|
|
83
83
|
"data-slot": "node-property-panel-titlebar",
|
|
84
|
-
className: "flex h-10 shrink-0 items-center justify-between
|
|
84
|
+
className: "flex h-10 shrink-0 items-center justify-between [padding-inline:var(--mf-content-inset,1rem)]",
|
|
85
85
|
children: [
|
|
86
86
|
/*#__PURE__*/ jsxs("div", {
|
|
87
87
|
className: "flex items-center gap-1",
|
|
@@ -89,7 +89,7 @@ function NodePropertyPanel({ panelTitle, dragHandleProps, onClose, nodeIcon, nod
|
|
|
89
89
|
/*#__PURE__*/ jsx("div", {
|
|
90
90
|
...dragHandleProps,
|
|
91
91
|
"data-slot": "node-property-panel-drag-handle",
|
|
92
|
-
className: "grid size-8 cursor-grab touch-none place-items-center text-foreground-subtle active:cursor-grabbing",
|
|
92
|
+
className: "ml-[calc(-1*min(14px,var(--mf-content-inset,1rem)))] grid size-8 cursor-grab touch-none place-items-center text-foreground-subtle active:cursor-grabbing",
|
|
93
93
|
children: /*#__PURE__*/ jsx(GripVertical, {
|
|
94
94
|
size: 14
|
|
95
95
|
})
|
|
@@ -115,7 +115,7 @@ function NodePropertyPanel({ panelTitle, dragHandleProps, onClose, nodeIcon, nod
|
|
|
115
115
|
id: 'canvas.node_property_panel.close',
|
|
116
116
|
message: 'Close'
|
|
117
117
|
}),
|
|
118
|
-
className: "grid size-6 place-items-center rounded text-foreground-muted transition hover:bg-surface-overlay hover:text-foreground",
|
|
118
|
+
className: "mr-[calc(-1*min(8px,var(--mf-content-inset,1rem)))] grid size-6 place-items-center rounded text-foreground-muted transition hover:bg-surface-overlay hover:text-foreground",
|
|
119
119
|
children: /*#__PURE__*/ jsx(X, {
|
|
120
120
|
size: 14
|
|
121
121
|
})
|
|
@@ -125,7 +125,7 @@ function NodePropertyPanel({ panelTitle, dragHandleProps, onClose, nodeIcon, nod
|
|
|
125
125
|
]
|
|
126
126
|
}),
|
|
127
127
|
hasNodeHeader && /*#__PURE__*/ jsxs("div", {
|
|
128
|
-
className: "flex shrink-0 items-center justify-between gap-4 py-4 [padding-inline:var(--mf-content-inset,
|
|
128
|
+
className: "flex shrink-0 items-center justify-between gap-4 py-4 [padding-inline:var(--mf-content-inset,1rem)]",
|
|
129
129
|
children: [
|
|
130
130
|
/*#__PURE__*/ jsxs("div", {
|
|
131
131
|
className: "flex min-w-0 flex-1 items-center gap-3.5",
|
|
@@ -226,7 +226,7 @@ function NodePropertyPanel({ panelTitle, dragHandleProps, onClose, nodeIcon, nod
|
|
|
226
226
|
}, resetKey)
|
|
227
227
|
})
|
|
228
228
|
}) : /*#__PURE__*/ jsx("div", {
|
|
229
|
-
className: "py-4 text-xs text-foreground-subtle [padding-inline:var(--mf-content-inset,
|
|
229
|
+
className: "py-4 text-xs text-foreground-subtle [padding-inline:var(--mf-content-inset,1rem)]",
|
|
230
230
|
children: "No form schema defined for this node."
|
|
231
231
|
})
|
|
232
232
|
]
|
|
@@ -0,0 +1,405 @@
|
|
|
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
|
+
NodeVariableEditDialog: ()=>NodeVariableEditDialog
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
31
|
+
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
32
|
+
const external_react_namespaceObject = require("react");
|
|
33
|
+
const index_cjs_namespaceObject = require("../../../i18n/index.cjs");
|
|
34
|
+
const VARIABLE_TYPES = [
|
|
35
|
+
'string',
|
|
36
|
+
'number',
|
|
37
|
+
'boolean',
|
|
38
|
+
'object',
|
|
39
|
+
'array'
|
|
40
|
+
];
|
|
41
|
+
const IDENTIFIER_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
42
|
+
function draftFor(type, value) {
|
|
43
|
+
if (null == value) return '';
|
|
44
|
+
if ('object' === type || 'array' === type) return JSON.stringify(value, null, 2);
|
|
45
|
+
return String(value);
|
|
46
|
+
}
|
|
47
|
+
function parseDefault(type, draft, checked) {
|
|
48
|
+
if ('boolean' === type) return {
|
|
49
|
+
value: checked
|
|
50
|
+
};
|
|
51
|
+
const text = draft.trim();
|
|
52
|
+
if (!text) return {
|
|
53
|
+
value: void 0
|
|
54
|
+
};
|
|
55
|
+
if ('string' === type) return {
|
|
56
|
+
value: draft
|
|
57
|
+
};
|
|
58
|
+
if ('number' === type) {
|
|
59
|
+
const value = Number(text);
|
|
60
|
+
return Number.isFinite(value) ? {
|
|
61
|
+
value
|
|
62
|
+
} : {
|
|
63
|
+
error: true
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
try {
|
|
67
|
+
const value = JSON.parse(text);
|
|
68
|
+
const isArray = Array.isArray(value);
|
|
69
|
+
const isObject = 'object' == typeof value && null !== value && !isArray;
|
|
70
|
+
return ('array' === type ? isArray : isObject) ? {
|
|
71
|
+
value
|
|
72
|
+
} : {
|
|
73
|
+
error: true
|
|
74
|
+
};
|
|
75
|
+
} catch {
|
|
76
|
+
return {
|
|
77
|
+
error: true
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function NodeVariableEditDialog({ variable, takenNames, referenceFor, onSave, onClose }) {
|
|
82
|
+
const { _ } = (0, index_cjs_namespaceObject.useSafeLingui)();
|
|
83
|
+
const fieldId = (0, external_react_namespaceObject.useId)();
|
|
84
|
+
const idInputRef = (0, external_react_namespaceObject.useRef)(null);
|
|
85
|
+
const [id, setId] = (0, external_react_namespaceObject.useState)(variable.id);
|
|
86
|
+
const [editingId, setEditingId] = (0, external_react_namespaceObject.useState)(()=>!IDENTIFIER_PATTERN.test(variable.id));
|
|
87
|
+
const [type, setType] = (0, external_react_namespaceObject.useState)(variable.type);
|
|
88
|
+
const [description, setDescription] = (0, external_react_namespaceObject.useState)(variable.description ?? '');
|
|
89
|
+
const [draft, setDraftState] = (0, external_react_namespaceObject.useState)(()=>draftFor(variable.type, variable.defaultValue));
|
|
90
|
+
const [checked, setCheckedState] = (0, external_react_namespaceObject.useState)('boolean' == typeof variable.defaultValue ? variable.defaultValue : void 0);
|
|
91
|
+
const [defaultEdited, setDefaultEdited] = (0, external_react_namespaceObject.useState)(false);
|
|
92
|
+
const setDraft = (next)=>{
|
|
93
|
+
setDraftState(next);
|
|
94
|
+
setDefaultEdited(true);
|
|
95
|
+
};
|
|
96
|
+
const setChecked = (next)=>{
|
|
97
|
+
setCheckedState(next);
|
|
98
|
+
setDefaultEdited(true);
|
|
99
|
+
};
|
|
100
|
+
const nullPlaceholder = null !== variable.defaultValue || defaultEdited ? void 0 : 'null';
|
|
101
|
+
const trimmedId = id.trim();
|
|
102
|
+
const idError = IDENTIFIER_PATTERN.test(trimmedId) ? trimmedId !== variable.id && takenNames.has(trimmedId) ? _({
|
|
103
|
+
id: 'canvas.node_variables_panel.edit_id_taken_error',
|
|
104
|
+
message: 'A variable named {name} already exists.',
|
|
105
|
+
values: {
|
|
106
|
+
name: trimmedId
|
|
107
|
+
}
|
|
108
|
+
}) : void 0 : _({
|
|
109
|
+
id: 'canvas.node_variables_panel.edit_id_pattern_error',
|
|
110
|
+
message: 'Use a letter or underscore first, then letters, numbers, or underscores.'
|
|
111
|
+
});
|
|
112
|
+
const parsed = parseDefault(type, draft, checked);
|
|
113
|
+
const defaultError = 'error' in parsed ? ({
|
|
114
|
+
number: _({
|
|
115
|
+
id: 'canvas.node_variables_panel.edit_default_number_error',
|
|
116
|
+
message: 'Enter a number.'
|
|
117
|
+
}),
|
|
118
|
+
object: _({
|
|
119
|
+
id: 'canvas.node_variables_panel.edit_default_object_error',
|
|
120
|
+
message: 'Enter a valid JSON object.'
|
|
121
|
+
}),
|
|
122
|
+
array: _({
|
|
123
|
+
id: 'canvas.node_variables_panel.edit_default_array_error',
|
|
124
|
+
message: 'Enter a valid JSON array.'
|
|
125
|
+
})
|
|
126
|
+
})[type] : void 0;
|
|
127
|
+
const changeType = (next)=>{
|
|
128
|
+
setType(next);
|
|
129
|
+
setDraft('');
|
|
130
|
+
setChecked(void 0);
|
|
131
|
+
};
|
|
132
|
+
const submit = (event)=>{
|
|
133
|
+
event.preventDefault();
|
|
134
|
+
if (idError || 'error' in parsed) return;
|
|
135
|
+
const untouched = !defaultEdited;
|
|
136
|
+
onSave({
|
|
137
|
+
id: trimmedId,
|
|
138
|
+
type,
|
|
139
|
+
description: description.trim() || void 0,
|
|
140
|
+
defaultValue: untouched ? variable.defaultValue : parsed.value
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
const typeLabel = {
|
|
144
|
+
string: _({
|
|
145
|
+
id: 'canvas.node_variables_panel.type_string',
|
|
146
|
+
message: 'String'
|
|
147
|
+
}),
|
|
148
|
+
number: _({
|
|
149
|
+
id: 'canvas.node_variables_panel.type_number',
|
|
150
|
+
message: 'Number'
|
|
151
|
+
}),
|
|
152
|
+
boolean: _({
|
|
153
|
+
id: 'canvas.node_variables_panel.type_boolean',
|
|
154
|
+
message: 'Boolean'
|
|
155
|
+
}),
|
|
156
|
+
object: _({
|
|
157
|
+
id: 'canvas.node_variables_panel.type_object',
|
|
158
|
+
message: 'Object'
|
|
159
|
+
}),
|
|
160
|
+
array: _({
|
|
161
|
+
id: 'canvas.node_variables_panel.type_array',
|
|
162
|
+
message: 'Array'
|
|
163
|
+
})
|
|
164
|
+
};
|
|
165
|
+
const defaultLabel = _({
|
|
166
|
+
id: 'canvas.node_variables_panel.edit_default_label',
|
|
167
|
+
message: 'Default value'
|
|
168
|
+
});
|
|
169
|
+
const reference = referenceFor(IDENTIFIER_PATTERN.test(trimmedId) ? trimmedId : variable.id);
|
|
170
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Dialog, {
|
|
171
|
+
open: true,
|
|
172
|
+
onOpenChange: (open)=>!open && onClose(),
|
|
173
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.DialogContent, {
|
|
174
|
+
"aria-describedby": void 0,
|
|
175
|
+
onKeyDown: (event)=>event.stopPropagation(),
|
|
176
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("form", {
|
|
177
|
+
onSubmit: submit,
|
|
178
|
+
noValidate: true,
|
|
179
|
+
className: "grid gap-4",
|
|
180
|
+
children: [
|
|
181
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.DialogHeader, {
|
|
182
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.DialogTitle, {
|
|
183
|
+
className: "flex items-center gap-2",
|
|
184
|
+
children: [
|
|
185
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Database, {
|
|
186
|
+
size: 16,
|
|
187
|
+
"aria-hidden": "true",
|
|
188
|
+
className: "text-foreground-muted"
|
|
189
|
+
}),
|
|
190
|
+
_({
|
|
191
|
+
id: 'canvas.node_variables_panel.edit_title',
|
|
192
|
+
message: 'Edit variable'
|
|
193
|
+
})
|
|
194
|
+
]
|
|
195
|
+
})
|
|
196
|
+
}),
|
|
197
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.FormField, {
|
|
198
|
+
children: [
|
|
199
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.FormFieldLabel, {
|
|
200
|
+
htmlFor: `${fieldId}-id`,
|
|
201
|
+
children: _({
|
|
202
|
+
id: 'canvas.node_variables_panel.edit_id_label',
|
|
203
|
+
message: 'ID'
|
|
204
|
+
})
|
|
205
|
+
}),
|
|
206
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
207
|
+
className: "flex items-start gap-2",
|
|
208
|
+
children: [
|
|
209
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Input, {
|
|
210
|
+
ref: idInputRef,
|
|
211
|
+
id: `${fieldId}-id`,
|
|
212
|
+
value: id,
|
|
213
|
+
disabled: !editingId,
|
|
214
|
+
onChange: (event)=>setId(event.target.value),
|
|
215
|
+
error: editingId ? idError : void 0,
|
|
216
|
+
"aria-describedby": `${fieldId}-id-hint`,
|
|
217
|
+
autoComplete: "off",
|
|
218
|
+
spellCheck: false,
|
|
219
|
+
className: "flex-1 font-mono"
|
|
220
|
+
}),
|
|
221
|
+
!editingId && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Button, {
|
|
222
|
+
type: "button",
|
|
223
|
+
variant: "outline",
|
|
224
|
+
size: "icon",
|
|
225
|
+
"aria-label": _({
|
|
226
|
+
id: 'canvas.node_variables_panel.edit_id_action',
|
|
227
|
+
message: 'Edit ID'
|
|
228
|
+
}),
|
|
229
|
+
onClick: ()=>{
|
|
230
|
+
setEditingId(true);
|
|
231
|
+
requestAnimationFrame(()=>idInputRef.current?.select());
|
|
232
|
+
},
|
|
233
|
+
className: "shrink-0",
|
|
234
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Pencil, {})
|
|
235
|
+
})
|
|
236
|
+
]
|
|
237
|
+
}),
|
|
238
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.FormFieldDescription, {
|
|
239
|
+
id: `${fieldId}-id-hint`,
|
|
240
|
+
children: [
|
|
241
|
+
_({
|
|
242
|
+
id: 'canvas.node_variables_panel.edit_id_hint',
|
|
243
|
+
message: 'Used in expressions as'
|
|
244
|
+
}),
|
|
245
|
+
' ',
|
|
246
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("code", {
|
|
247
|
+
className: "break-all rounded bg-surface-overlay px-1 py-0.5 font-mono text-xs",
|
|
248
|
+
children: reference
|
|
249
|
+
})
|
|
250
|
+
]
|
|
251
|
+
})
|
|
252
|
+
]
|
|
253
|
+
}),
|
|
254
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.FormField, {
|
|
255
|
+
children: [
|
|
256
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.FormFieldLabel, {
|
|
257
|
+
htmlFor: `${fieldId}-type`,
|
|
258
|
+
children: _({
|
|
259
|
+
id: 'canvas.node_variables_panel.edit_type_label',
|
|
260
|
+
message: 'Data type'
|
|
261
|
+
})
|
|
262
|
+
}),
|
|
263
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.Select, {
|
|
264
|
+
value: type,
|
|
265
|
+
onValueChange: (next)=>changeType(next),
|
|
266
|
+
children: [
|
|
267
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.SelectTrigger, {
|
|
268
|
+
id: `${fieldId}-type`,
|
|
269
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.SelectValue, {})
|
|
270
|
+
}),
|
|
271
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.SelectContent, {
|
|
272
|
+
children: VARIABLE_TYPES.map((option)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.SelectItem, {
|
|
273
|
+
value: option,
|
|
274
|
+
children: typeLabel[option]
|
|
275
|
+
}, option))
|
|
276
|
+
})
|
|
277
|
+
]
|
|
278
|
+
})
|
|
279
|
+
]
|
|
280
|
+
}),
|
|
281
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.FormField, {
|
|
282
|
+
children: [
|
|
283
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.FormFieldLabel, {
|
|
284
|
+
htmlFor: `${fieldId}-description`,
|
|
285
|
+
children: _({
|
|
286
|
+
id: "canvas.node_variables_panel.edit_description_label",
|
|
287
|
+
message: "Description"
|
|
288
|
+
})
|
|
289
|
+
}),
|
|
290
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Textarea, {
|
|
291
|
+
id: `${fieldId}-description`,
|
|
292
|
+
value: description,
|
|
293
|
+
onChange: (event)=>setDescription(event.target.value),
|
|
294
|
+
placeholder: _({
|
|
295
|
+
id: "canvas.node_variables_panel.edit_description_placeholder",
|
|
296
|
+
message: "Helpful description of what this variable represents"
|
|
297
|
+
}),
|
|
298
|
+
rows: 2
|
|
299
|
+
})
|
|
300
|
+
]
|
|
301
|
+
}),
|
|
302
|
+
'boolean' === type ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.FormField, {
|
|
303
|
+
children: [
|
|
304
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.FormFieldLabel, {
|
|
305
|
+
htmlFor: `${fieldId}-default`,
|
|
306
|
+
children: defaultLabel
|
|
307
|
+
}),
|
|
308
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
309
|
+
className: "flex items-center gap-2",
|
|
310
|
+
children: [
|
|
311
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Switch, {
|
|
312
|
+
id: `${fieldId}-default`,
|
|
313
|
+
checked: checked ?? false,
|
|
314
|
+
onCheckedChange: setChecked,
|
|
315
|
+
"aria-describedby": `${fieldId}-default-hint`
|
|
316
|
+
}),
|
|
317
|
+
void 0 !== checked && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Button, {
|
|
318
|
+
type: "button",
|
|
319
|
+
variant: "ghost",
|
|
320
|
+
size: "2xs",
|
|
321
|
+
onClick: ()=>setChecked(void 0),
|
|
322
|
+
"aria-label": _({
|
|
323
|
+
id: 'canvas.node_variables_panel.edit_default_clear_label',
|
|
324
|
+
message: 'Clear default value'
|
|
325
|
+
}),
|
|
326
|
+
children: _({
|
|
327
|
+
id: 'canvas.node_variables_panel.edit_default_clear',
|
|
328
|
+
message: 'Clear'
|
|
329
|
+
})
|
|
330
|
+
})
|
|
331
|
+
]
|
|
332
|
+
}),
|
|
333
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.FormFieldDescription, {
|
|
334
|
+
id: `${fieldId}-default-hint`,
|
|
335
|
+
children: void 0 === checked ? _({
|
|
336
|
+
id: 'canvas.node_variables_panel.edit_default_boolean_unset_hint',
|
|
337
|
+
message: 'No default. Toggle on for true, off for false'
|
|
338
|
+
}) : _({
|
|
339
|
+
id: 'canvas.node_variables_panel.edit_default_boolean_hint',
|
|
340
|
+
message: 'Toggle on for true, off for false'
|
|
341
|
+
})
|
|
342
|
+
})
|
|
343
|
+
]
|
|
344
|
+
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.FormField, {
|
|
345
|
+
children: [
|
|
346
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.FormFieldLabel, {
|
|
347
|
+
htmlFor: `${fieldId}-default`,
|
|
348
|
+
children: defaultLabel
|
|
349
|
+
}),
|
|
350
|
+
'object' === type || 'array' === type ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Textarea, {
|
|
351
|
+
id: `${fieldId}-default`,
|
|
352
|
+
value: draft,
|
|
353
|
+
onChange: (event)=>setDraft(event.target.value),
|
|
354
|
+
placeholder: nullPlaceholder ?? ('object' === type ? '{"key": "value"}' : '[1, 2, 3]'),
|
|
355
|
+
error: defaultError,
|
|
356
|
+
rows: 4,
|
|
357
|
+
spellCheck: false,
|
|
358
|
+
className: "font-mono"
|
|
359
|
+
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Input, {
|
|
360
|
+
id: `${fieldId}-default`,
|
|
361
|
+
value: draft,
|
|
362
|
+
onChange: (event)=>setDraft(event.target.value),
|
|
363
|
+
inputMode: 'number' === type ? 'decimal' : void 0,
|
|
364
|
+
placeholder: nullPlaceholder ?? ('number' === type ? '0' : _({
|
|
365
|
+
id: 'canvas.node_variables_panel.edit_default_string_placeholder',
|
|
366
|
+
message: 'Enter text value'
|
|
367
|
+
})),
|
|
368
|
+
error: defaultError,
|
|
369
|
+
autoComplete: "off"
|
|
370
|
+
})
|
|
371
|
+
]
|
|
372
|
+
}),
|
|
373
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(apollo_wind_namespaceObject.DialogFooter, {
|
|
374
|
+
children: [
|
|
375
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Button, {
|
|
376
|
+
type: "button",
|
|
377
|
+
variant: "outline",
|
|
378
|
+
onClick: onClose,
|
|
379
|
+
children: _({
|
|
380
|
+
id: 'canvas.node_variables_panel.edit_cancel',
|
|
381
|
+
message: 'Cancel'
|
|
382
|
+
})
|
|
383
|
+
}),
|
|
384
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Button, {
|
|
385
|
+
type: "submit",
|
|
386
|
+
disabled: !!idError || !!defaultError,
|
|
387
|
+
children: _({
|
|
388
|
+
id: 'canvas.node_variables_panel.edit_save',
|
|
389
|
+
message: 'Save'
|
|
390
|
+
})
|
|
391
|
+
})
|
|
392
|
+
]
|
|
393
|
+
})
|
|
394
|
+
]
|
|
395
|
+
})
|
|
396
|
+
})
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
exports.NodeVariableEditDialog = __webpack_exports__.NodeVariableEditDialog;
|
|
400
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
401
|
+
"NodeVariableEditDialog"
|
|
402
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
403
|
+
Object.defineProperty(exports, '__esModule', {
|
|
404
|
+
value: true
|
|
405
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { NodeVariableDetails } from './NodeVariablesPanel.types';
|
|
2
|
+
export interface NodeVariableEditDialogProps {
|
|
3
|
+
variable: NodeVariableDetails;
|
|
4
|
+
takenNames: ReadonlySet<string>;
|
|
5
|
+
referenceFor: (id: string) => string;
|
|
6
|
+
onSave: (next: NodeVariableDetails) => void;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function NodeVariableEditDialog({ variable, takenNames, referenceFor, onSave, onClose, }: NodeVariableEditDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=NodeVariableEditDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NodeVariableEditDialog.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/NodeVariablesPanel/NodeVariableEditDialog.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,mBAAmB,EAAoB,MAAM,4BAA4B,CAAC;AA6CxF,MAAM,WAAW,2BAA2B;IAE1C,QAAQ,EAAE,mBAAmB,CAAC;IAE9B,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAEhC,YAAY,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;IACrC,MAAM,EAAE,CAAC,IAAI,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC5C,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAOD,wBAAgB,sBAAsB,CAAC,EACrC,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,MAAM,EACN,OAAO,GACR,EAAE,2BAA2B,2CA+R7B"}
|