Skip to content

Commit b77d4b2

Browse files
committed
bugfix for command handlers and keyboard control
1 parent b9965cc commit b77d4b2

File tree

2 files changed

+31
-51
lines changed

2 files changed

+31
-51
lines changed

examples-test-flows/google-gemini-flash-simple-prompt.json

Lines changed: 29 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -11,68 +11,59 @@
1111
"x": 3386.346667223463,
1212
"y": 1554.3181419509813,
1313
"width": 111.7109375,
14-
"height": 112,
14+
"height": 96,
1515
"nodeType": "Shape",
1616
"nodeInfo": {
1717
"type": "json-node",
1818
"formValues": {
1919
"json": "{\n \"contents\": [{\n \"parts\":[{\"@set:text\": \"input\"}]\n }]\n}"
20-
},
21-
"nodeCannotBeReplaced": true,
22-
"showFormOnlyInPopup": true,
23-
"useInCompositionOnly": false,
24-
"keepPopupOpenAfterUpdate": true
20+
}
2521
}
2622
},
2723
{
2824
"id": "e8bad215-deb0-42d9-a3e1-156090717777",
29-
"x": 3663.063721988264,
30-
"y": 1511.6351069890657,
25+
"x": 3663.063443291062,
26+
"y": 1511.6350381660247,
3127
"width": 200,
3228
"height": 200,
3329
"nodeType": "Shape",
3430
"nodeInfo": {
3531
"type": "fetch",
3632
"formValues": {
37-
"url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent?key=[openai-key]",
33+
"url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent?key=[googleGeminiAI-key]",
3834
"http-method": "post",
3935
"headers": ""
40-
},
41-
"isSettingsPopup": true
36+
}
4237
}
4338
},
4439
{
4540
"id": "8144d095-7110-43d4-96fb-8683bb78c353",
4641
"x": 4003.48228233086,
4742
"y": 1511.442820331771,
48-
"width": 120.000073931365,
49-
"height": 271.9999777546536,
43+
"width": 120.00014325456367,
44+
"height": 271.99997072762085,
5045
"nodeType": "Shape",
5146
"nodeInfo": {
5247
"type": "show-input",
5348
"formValues": {
5449
"name": "",
5550
"data-type": "default"
56-
},
57-
"initializeOnStartFlow": true,
58-
"isSettingsPopup": true
51+
}
5952
}
6053
},
6154
{
6255
"id": "c3a8bd9e-f4d5-46db-9384-b1de17a33c5f",
6356
"x": 4673.813291479845,
6457
"y": 1515.2823102709674,
65-
"width": 120.000073931365,
66-
"height": 271.9999777546536,
58+
"width": 119.99971847529551,
59+
"height": 271.99997072762085,
6760
"nodeType": "Shape",
6861
"nodeInfo": {
6962
"type": "show-input",
7063
"formValues": {
7164
"name": "",
7265
"data-type": "default"
73-
},
74-
"initializeOnStartFlow": true,
75-
"isSettingsPopup": true
66+
}
7667
}
7768
},
7869
{
@@ -87,36 +78,29 @@
8778
"formValues": {
8879
"expression": "candidates[0].content.parts[0].text",
8980
"inputType": "number"
90-
},
91-
"showFormOnlyInPopup": true,
92-
"isSettingsPopup": true,
93-
"supportsPreview": true
81+
}
9482
}
9583
},
9684
{
9785
"id": "9f1f3e1c-787f-406f-b52b-b6db3e7b85dd",
9886
"x": 3116.814739534093,
9987
"y": 1576.3308286951303,
10088
"width": 74.7109375,
101-
"height": 80,
89+
"height": 64,
10290
"nodeType": "Shape",
10391
"nodeInfo": {
10492
"type": "text-node",
10593
"formValues": {
10694
"text": "Input data is received in a typescript object specified below, it is in the subject property:\n\n```ts\nconst input = {\n subject: \"{{subject}}\"\n}\n```\n\n```ts\nconst input = {\n subject: \"{{anothersubject}}\"\n}\n```\n\nExplain in detail the relation between the subjects that are in the subject properties in the incoming input data objects, specified above"
107-
},
108-
"nodeCannotBeReplaced": true,
109-
"showFormOnlyInPopup": true,
110-
"useInCompositionOnly": false,
111-
"keepPopupOpenAfterUpdate": true
95+
}
11296
}
11397
},
11498
{
11599
"id": "8b7d6c8d-1806-4596-a47a-514038cffe13",
116100
"x": 3149.2124074033727,
117101
"y": 1326.8614491593612,
118-
"width": 174.4218591768426,
119-
"height": 84.00002177988597,
102+
"width": 174.4217358717848,
103+
"height": 84.00000484223884,
120104
"nodeType": "Shape",
121105
"nodeInfo": {
122106
"type": "scope-variable",
@@ -127,17 +111,15 @@
127111
"fieldValueType": "string",
128112
"enumValues": [],
129113
"initialEnumValue": ""
130-
},
131-
"isVariable": true,
132-
"nodeCannotBeReplaced": true
114+
}
133115
}
134116
},
135117
{
136118
"id": "342b786f-955e-4ef8-968e-60b24427b75a",
137119
"x": 3466.3939102846325,
138120
"y": 1255.3912207892486,
139-
"width": 174.4218591768426,
140-
"height": 83.99994684971215,
121+
"width": 174.421938322169,
122+
"height": 84.00000484223884,
141123
"nodeType": "Shape",
142124
"nodeInfo": {
143125
"type": "scope-variable",
@@ -148,17 +130,15 @@
148130
"fieldValueType": "string",
149131
"enumValues": [],
150132
"initialEnumValue": ""
151-
},
152-
"isVariable": true,
153-
"nodeCannotBeReplaced": true
133+
}
154134
}
155135
},
156136
{
157137
"id": "6a22f828-b47c-4123-bde9-6ebe2940cc0a",
158138
"x": 3498.057604723463,
159-
"y": 1610.3181419509813,
160-
"endX": 3663.063721988264,
161-
"endY": 1611.6351069890657,
139+
"y": 1602.3181419509813,
140+
"endX": 3663.063443291062,
141+
"endY": 1611.6350381660247,
162142
"startNodeId": "1bc4104f-6c09-4bd2-9a65-9ed23137a1db",
163143
"endNodeId": "e8bad215-deb0-42d9-a3e1-156090717777",
164144
"startThumbName": "output",
@@ -170,8 +150,8 @@
170150
},
171151
{
172152
"id": "41770511-b5bf-4014-9b95-1dee2abd53de",
173-
"x": 3863.063721988264,
174-
"y": 1541.6351069890657,
153+
"x": 3863.063443291062,
154+
"y": 1541.6350381660247,
175155
"endX": 4003.48228233086,
176156
"endY": 1541.442820331771,
177157
"startNodeId": "e8bad215-deb0-42d9-a3e1-156090717777",
@@ -185,7 +165,7 @@
185165
},
186166
{
187167
"id": "ea98148d-52be-473c-be87-8f0fbd6e771b",
188-
"x": 4123.482356262225,
168+
"x": 4123.482425585424,
189169
"y": 1541.442820331771,
190170
"endX": 4313.803391261389,
191171
"endY": 1544.0914007909573,
@@ -216,9 +196,9 @@
216196
{
217197
"id": "3595bb23-681a-43d1-b8c5-0a3cd2b68bfc",
218198
"x": 3191.525677034093,
219-
"y": 1616.3308286951303,
199+
"y": 1608.3308286951303,
220200
"endX": 3386.346667223463,
221-
"endY": 1610.3181419509813,
201+
"endY": 1602.3181419509813,
222202
"startNodeId": "9f1f3e1c-787f-406f-b52b-b6db3e7b85dd",
223203
"endNodeId": "1bc4104f-6c09-4bd2-9a65-9ed23137a1db",
224204
"startThumbName": "output",

libs/app-canvas/src/app/app.element.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ export class AppElement<T extends BaseNodeInfo> {
413413
['A', 'BUTTON', 'INPUT', 'SELECT', 'TEXTAREA'].indexOf(
414414
(event.target as HTMLElement)?.tagName
415415
) >= 0;
416-
if (!inInputControle || !(event.target as HTMLElement)?.isContentEditable) {
416+
if (!inInputControle && !(event.target as HTMLElement)?.isContentEditable) {
417417
if ((event.ctrlKey || event.metaKey || this.metaKeyDown) && key === 'c') {
418418
event.preventDefault();
419419
this.removeFormElement();
@@ -433,7 +433,7 @@ export class AppElement<T extends BaseNodeInfo> {
433433
executeCommand(
434434
this.commandRegistry,
435435
'paste-node',
436-
this.getSelectTaskElement().value,
436+
this.getSelectTaskElement?.()?.value,
437437
selectedNodeInfo?.id
438438
);
439439
return false;

0 commit comments

Comments
 (0)