@genfeedai/workflow-ui 0.1.3 → 0.1.4

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 (84) hide show
  1. package/dist/canvas.d.mts +16 -2
  2. package/dist/canvas.mjs +10 -8
  3. package/dist/chunk-6PSJTBNV.mjs +638 -0
  4. package/dist/chunk-7H3WJJYS.mjs +52 -0
  5. package/dist/{chunk-HCXI63ME.mjs → chunk-AUQGOJOQ.mjs} +27 -4
  6. package/dist/{chunk-AOTUCJMA.mjs → chunk-GWBGK3KL.mjs} +2 -2
  7. package/dist/chunk-JTPADIUO.mjs +130 -0
  8. package/dist/{chunk-SQK4JDYY.mjs → chunk-LT3ZJJL6.mjs} +9 -2
  9. package/dist/{chunk-7P2JWDC7.mjs → chunk-O5II6BOJ.mjs} +1198 -254
  10. package/dist/{chunk-AUZR6REQ.mjs → chunk-OQREHJXK.mjs} +1 -1
  11. package/dist/chunk-OY7BRSGG.mjs +60 -0
  12. package/dist/{chunk-E3YBVMYZ.mjs → chunk-PANZDSP6.mjs} +274 -305
  13. package/dist/chunk-PCIWWD37.mjs +90 -0
  14. package/dist/{chunk-RIGVIEYB.mjs → chunk-R727OFBR.mjs} +11 -1
  15. package/dist/chunk-ZD2BADZO.mjs +1294 -0
  16. package/dist/contextMenuStore-DMg0hJQ1.d.mts +22 -0
  17. package/dist/hooks.d.mts +53 -244
  18. package/dist/hooks.mjs +6 -6
  19. package/dist/index.d.mts +11 -7
  20. package/dist/index.mjs +13 -11
  21. package/dist/lib.d.mts +250 -4
  22. package/dist/lib.mjs +562 -2
  23. package/dist/nodes.d.mts +3 -1
  24. package/dist/nodes.mjs +6 -6
  25. package/dist/panels.mjs +3 -4
  26. package/dist/{promptLibraryStore-zqb59nsu.d.mts → promptLibraryStore-Bgw5LzvD.d.mts} +33 -5
  27. package/dist/provider.d.mts +2 -2
  28. package/dist/provider.mjs +0 -1
  29. package/dist/stores.d.mts +4 -3
  30. package/dist/stores.mjs +3 -40
  31. package/dist/toolbar.d.mts +3 -1
  32. package/dist/toolbar.mjs +5 -4
  33. package/dist/{types-ipAnBzAJ.d.mts → types-CF6DPx0P.d.mts} +8 -3
  34. package/dist/ui.d.mts +1 -1
  35. package/dist/ui.mjs +0 -1
  36. package/dist/{hooks.d.ts → useCommentNavigation-NzJjkaj2.d.mts} +15 -2
  37. package/dist/workflowStore-UAAKOOIK.mjs +2 -0
  38. package/package.json +30 -24
  39. package/dist/canvas.d.ts +0 -27
  40. package/dist/canvas.js +0 -45
  41. package/dist/chunk-3SPPKCWR.js +0 -458
  42. package/dist/chunk-3TMV3K34.js +0 -534
  43. package/dist/chunk-3YFFDHC5.js +0 -300
  44. package/dist/chunk-4MZ62VMF.js +0 -37
  45. package/dist/chunk-5HJFQVUR.js +0 -61
  46. package/dist/chunk-5LQ4QBR5.js +0 -2
  47. package/dist/chunk-6DOEUDD5.js +0 -254
  48. package/dist/chunk-AXFOCPPP.js +0 -998
  49. package/dist/chunk-BMFRA6GK.js +0 -1546
  50. package/dist/chunk-E323WAZG.mjs +0 -272
  51. package/dist/chunk-ECD5J2BA.js +0 -6022
  52. package/dist/chunk-EMGXUNBL.js +0 -120
  53. package/dist/chunk-EMUMKW5C.js +0 -107
  54. package/dist/chunk-FOMOOERN.js +0 -2
  55. package/dist/chunk-IASLG6IA.mjs +0 -118
  56. package/dist/chunk-IHF35QZD.js +0 -1095
  57. package/dist/chunk-JLWKW3G5.js +0 -2
  58. package/dist/chunk-KDIWRSYV.js +0 -375
  59. package/dist/chunk-L5TF4EHW.mjs +0 -1
  60. package/dist/chunk-RJ262NXS.js +0 -24
  61. package/dist/chunk-RXNEDWK2.js +0 -141
  62. package/dist/chunk-SEV2DWKF.js +0 -744
  63. package/dist/chunk-ZJWP5KGZ.mjs +0 -33
  64. package/dist/hooks.js +0 -56
  65. package/dist/index.d.ts +0 -29
  66. package/dist/index.js +0 -180
  67. package/dist/lib.d.ts +0 -164
  68. package/dist/lib.js +0 -144
  69. package/dist/nodes.d.ts +0 -128
  70. package/dist/nodes.js +0 -151
  71. package/dist/panels.d.ts +0 -22
  72. package/dist/panels.js +0 -21
  73. package/dist/promptLibraryStore-BZnfmEkc.d.ts +0 -464
  74. package/dist/provider.d.ts +0 -29
  75. package/dist/provider.js +0 -17
  76. package/dist/stores.d.ts +0 -96
  77. package/dist/stores.js +0 -113
  78. package/dist/toolbar.d.ts +0 -73
  79. package/dist/toolbar.js +0 -34
  80. package/dist/types-ipAnBzAJ.d.ts +0 -46
  81. package/dist/ui.d.ts +0 -67
  82. package/dist/ui.js +0 -84
  83. package/dist/workflowStore-7SDJC4UR.mjs +0 -3
  84. package/dist/workflowStore-LNJQ5RZG.js +0 -12
@@ -1,120 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkIHF35QZD_js = require('./chunk-IHF35QZD.js');
4
- var react = require('react');
5
-
6
- function useCanvasKeyboardShortcuts({
7
- selectedNodeIds,
8
- groups,
9
- nodes,
10
- toggleNodeLock,
11
- createGroup,
12
- deleteGroup,
13
- unlockAllNodes,
14
- addNode,
15
- togglePalette,
16
- fitView,
17
- openShortcutHelp,
18
- openNodeSearch
19
- }) {
20
- react.useEffect(() => {
21
- const handleKeyDown = (e) => {
22
- if (e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement) {
23
- return;
24
- }
25
- const isMod = e.ctrlKey || e.metaKey;
26
- if (e.key === "m" && !isMod && !e.shiftKey) {
27
- e.preventDefault();
28
- togglePalette();
29
- }
30
- if (e.key === "f" && !isMod && !e.shiftKey) {
31
- e.preventDefault();
32
- if (selectedNodeIds.length > 0) {
33
- const selectedNodes = nodes.filter((n) => selectedNodeIds.includes(n.id));
34
- fitView({ nodes: selectedNodes, padding: 0.3, duration: 200 });
35
- } else {
36
- fitView({ padding: 0.2, duration: 200 });
37
- }
38
- }
39
- if (e.key === "?" && e.shiftKey && !isMod) {
40
- e.preventDefault();
41
- openShortcutHelp();
42
- }
43
- if (e.key === "f" && isMod && !e.shiftKey) {
44
- e.preventDefault();
45
- openNodeSearch();
46
- }
47
- if (e.key === "l" && !isMod && !e.shiftKey) {
48
- e.preventDefault();
49
- for (const nodeId of selectedNodeIds) {
50
- toggleNodeLock(nodeId);
51
- }
52
- }
53
- if (e.key === "g" && isMod && !e.shiftKey) {
54
- e.preventDefault();
55
- if (selectedNodeIds.length > 1) {
56
- createGroup(selectedNodeIds);
57
- }
58
- }
59
- if (e.key === "g" && isMod && e.shiftKey) {
60
- e.preventDefault();
61
- for (const nodeId of selectedNodeIds) {
62
- const group = groups.find((g) => g.nodeIds.includes(nodeId));
63
- if (group) {
64
- deleteGroup(group.id);
65
- break;
66
- }
67
- }
68
- }
69
- if (e.key === "l" && isMod && e.shiftKey) {
70
- e.preventDefault();
71
- unlockAllNodes();
72
- }
73
- if (e.key === "I" && e.shiftKey && !isMod) {
74
- e.preventDefault();
75
- const position = { x: window.innerWidth / 2 - 150, y: window.innerHeight / 2 - 150 };
76
- addNode("imageGen", position);
77
- }
78
- if (e.key === "V" && e.shiftKey && !isMod) {
79
- e.preventDefault();
80
- const position = { x: window.innerWidth / 2 - 150, y: window.innerHeight / 2 - 150 };
81
- addNode("videoGen", position);
82
- }
83
- if (e.key === "P" && e.shiftKey && !isMod) {
84
- e.preventDefault();
85
- const position = { x: window.innerWidth / 2 - 150, y: window.innerHeight / 2 - 150 };
86
- addNode("prompt", position);
87
- }
88
- if ((e.key === "L" || e.key === "l") && e.shiftKey && !isMod) {
89
- e.preventDefault();
90
- const position = { x: window.innerWidth / 2 - 150, y: window.innerHeight / 2 - 150 };
91
- addNode("llm", position);
92
- }
93
- if (e.key === "z" && isMod && !e.shiftKey) {
94
- e.preventDefault();
95
- chunkIHF35QZD_js.useWorkflowStore.temporal.getState().undo();
96
- }
97
- if (e.key === "z" && isMod && e.shiftKey) {
98
- e.preventDefault();
99
- chunkIHF35QZD_js.useWorkflowStore.temporal.getState().redo();
100
- }
101
- };
102
- window.addEventListener("keydown", handleKeyDown);
103
- return () => window.removeEventListener("keydown", handleKeyDown);
104
- }, [
105
- selectedNodeIds,
106
- toggleNodeLock,
107
- createGroup,
108
- deleteGroup,
109
- unlockAllNodes,
110
- groups,
111
- nodes,
112
- addNode,
113
- togglePalette,
114
- fitView,
115
- openShortcutHelp,
116
- openNodeSearch
117
- ]);
118
- }
119
-
120
- exports.useCanvasKeyboardShortcuts = useCanvasKeyboardShortcuts;
@@ -1,107 +0,0 @@
1
- 'use strict';
2
-
3
- // src/lib/schemaUtils.ts
4
- function getSchemaDefaults(schema) {
5
- if (!schema) return {};
6
- const properties = schema.properties;
7
- if (!properties) return {};
8
- const defaults = {};
9
- for (const [key, prop] of Object.entries(properties)) {
10
- if (prop.default !== void 0) {
11
- defaults[key] = prop.default;
12
- }
13
- }
14
- return defaults;
15
- }
16
- function supportsImageInput(schema) {
17
- if (!schema) return true;
18
- const properties = schema.properties;
19
- if (!properties) return true;
20
- return !!(properties.image || properties.image_input || properties.start_image || properties.first_frame_image || properties.reference_images);
21
- }
22
- function extractEnumValues(componentSchemas) {
23
- if (!componentSchemas) return void 0;
24
- const result = {};
25
- for (const [key, schema] of Object.entries(componentSchemas)) {
26
- if (schema.enum && Array.isArray(schema.enum)) {
27
- result[key] = schema.enum.map((v) => String(v));
28
- }
29
- }
30
- return Object.keys(result).length > 0 ? result : void 0;
31
- }
32
-
33
- // src/lib/schemaValidation.ts
34
- function validateRequiredSchemaFields(inputSchema, values, skipFields) {
35
- if (!inputSchema) {
36
- return { isValid: true, missingFields: [] };
37
- }
38
- const schema = inputSchema;
39
- const requiredFields = schema.required ?? [];
40
- if (requiredFields.length === 0) {
41
- return { isValid: true, missingFields: [] };
42
- }
43
- const missingFields = [];
44
- for (const field of requiredFields) {
45
- if (skipFields.has(field)) {
46
- continue;
47
- }
48
- const value = values[field];
49
- if (value === void 0 || value === null || value === "") {
50
- missingFields.push(field);
51
- }
52
- }
53
- return {
54
- isValid: missingFields.length === 0,
55
- missingFields
56
- };
57
- }
58
- var CONNECTION_FIELDS = /* @__PURE__ */ new Set([
59
- "prompt",
60
- "image",
61
- "image_input",
62
- "video",
63
- "audio",
64
- "start_image",
65
- "first_frame_image",
66
- "last_frame",
67
- "reference_images",
68
- "image_url",
69
- "video_url",
70
- "end_image",
71
- "start_video_id",
72
- "end_video_id",
73
- "subject_reference",
74
- "image_prompt",
75
- "mask"
76
- ]);
77
-
78
- // src/lib/media.ts
79
- function getImageDimensions(src) {
80
- return new Promise((resolve) => {
81
- const img = new window.Image();
82
- img.crossOrigin = "anonymous";
83
- img.onload = () => resolve({ width: img.width, height: img.height });
84
- img.onerror = () => resolve({ width: 0, height: 0 });
85
- img.src = src;
86
- });
87
- }
88
- function getVideoMetadata(src) {
89
- return new Promise((resolve) => {
90
- const video = document.createElement("video");
91
- video.crossOrigin = "anonymous";
92
- video.onloadedmetadata = () => resolve({
93
- duration: video.duration,
94
- dimensions: { width: video.videoWidth, height: video.videoHeight }
95
- });
96
- video.onerror = () => resolve({ duration: 0, dimensions: { width: 0, height: 0 } });
97
- video.src = src;
98
- });
99
- }
100
-
101
- exports.CONNECTION_FIELDS = CONNECTION_FIELDS;
102
- exports.extractEnumValues = extractEnumValues;
103
- exports.getImageDimensions = getImageDimensions;
104
- exports.getSchemaDefaults = getSchemaDefaults;
105
- exports.getVideoMetadata = getVideoMetadata;
106
- exports.supportsImageInput = supportsImageInput;
107
- exports.validateRequiredSchemaFields = validateRequiredSchemaFields;
@@ -1,2 +0,0 @@
1
- 'use strict';
2
-
@@ -1,118 +0,0 @@
1
- import { useWorkflowStore } from './chunk-RIGVIEYB.mjs';
2
- import { useEffect } from 'react';
3
-
4
- function useCanvasKeyboardShortcuts({
5
- selectedNodeIds,
6
- groups,
7
- nodes,
8
- toggleNodeLock,
9
- createGroup,
10
- deleteGroup,
11
- unlockAllNodes,
12
- addNode,
13
- togglePalette,
14
- fitView,
15
- openShortcutHelp,
16
- openNodeSearch
17
- }) {
18
- useEffect(() => {
19
- const handleKeyDown = (e) => {
20
- if (e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement) {
21
- return;
22
- }
23
- const isMod = e.ctrlKey || e.metaKey;
24
- if (e.key === "m" && !isMod && !e.shiftKey) {
25
- e.preventDefault();
26
- togglePalette();
27
- }
28
- if (e.key === "f" && !isMod && !e.shiftKey) {
29
- e.preventDefault();
30
- if (selectedNodeIds.length > 0) {
31
- const selectedNodes = nodes.filter((n) => selectedNodeIds.includes(n.id));
32
- fitView({ nodes: selectedNodes, padding: 0.3, duration: 200 });
33
- } else {
34
- fitView({ padding: 0.2, duration: 200 });
35
- }
36
- }
37
- if (e.key === "?" && e.shiftKey && !isMod) {
38
- e.preventDefault();
39
- openShortcutHelp();
40
- }
41
- if (e.key === "f" && isMod && !e.shiftKey) {
42
- e.preventDefault();
43
- openNodeSearch();
44
- }
45
- if (e.key === "l" && !isMod && !e.shiftKey) {
46
- e.preventDefault();
47
- for (const nodeId of selectedNodeIds) {
48
- toggleNodeLock(nodeId);
49
- }
50
- }
51
- if (e.key === "g" && isMod && !e.shiftKey) {
52
- e.preventDefault();
53
- if (selectedNodeIds.length > 1) {
54
- createGroup(selectedNodeIds);
55
- }
56
- }
57
- if (e.key === "g" && isMod && e.shiftKey) {
58
- e.preventDefault();
59
- for (const nodeId of selectedNodeIds) {
60
- const group = groups.find((g) => g.nodeIds.includes(nodeId));
61
- if (group) {
62
- deleteGroup(group.id);
63
- break;
64
- }
65
- }
66
- }
67
- if (e.key === "l" && isMod && e.shiftKey) {
68
- e.preventDefault();
69
- unlockAllNodes();
70
- }
71
- if (e.key === "I" && e.shiftKey && !isMod) {
72
- e.preventDefault();
73
- const position = { x: window.innerWidth / 2 - 150, y: window.innerHeight / 2 - 150 };
74
- addNode("imageGen", position);
75
- }
76
- if (e.key === "V" && e.shiftKey && !isMod) {
77
- e.preventDefault();
78
- const position = { x: window.innerWidth / 2 - 150, y: window.innerHeight / 2 - 150 };
79
- addNode("videoGen", position);
80
- }
81
- if (e.key === "P" && e.shiftKey && !isMod) {
82
- e.preventDefault();
83
- const position = { x: window.innerWidth / 2 - 150, y: window.innerHeight / 2 - 150 };
84
- addNode("prompt", position);
85
- }
86
- if ((e.key === "L" || e.key === "l") && e.shiftKey && !isMod) {
87
- e.preventDefault();
88
- const position = { x: window.innerWidth / 2 - 150, y: window.innerHeight / 2 - 150 };
89
- addNode("llm", position);
90
- }
91
- if (e.key === "z" && isMod && !e.shiftKey) {
92
- e.preventDefault();
93
- useWorkflowStore.temporal.getState().undo();
94
- }
95
- if (e.key === "z" && isMod && e.shiftKey) {
96
- e.preventDefault();
97
- useWorkflowStore.temporal.getState().redo();
98
- }
99
- };
100
- window.addEventListener("keydown", handleKeyDown);
101
- return () => window.removeEventListener("keydown", handleKeyDown);
102
- }, [
103
- selectedNodeIds,
104
- toggleNodeLock,
105
- createGroup,
106
- deleteGroup,
107
- unlockAllNodes,
108
- groups,
109
- nodes,
110
- addNode,
111
- togglePalette,
112
- fitView,
113
- openShortcutHelp,
114
- openNodeSearch
115
- ]);
116
- }
117
-
118
- export { useCanvasKeyboardShortcuts };