@genfeedai/workflow-ui 0.1.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 (86) hide show
  1. package/dist/canvas.d.mts +27 -0
  2. package/dist/canvas.d.ts +27 -0
  3. package/dist/canvas.js +45 -0
  4. package/dist/canvas.mjs +16 -0
  5. package/dist/chunk-22PDGHNQ.mjs +737 -0
  6. package/dist/chunk-3SPPKCWR.js +458 -0
  7. package/dist/chunk-3YFFDHC5.js +300 -0
  8. package/dist/chunk-5HJFQVUR.js +61 -0
  9. package/dist/chunk-5LQ4QBR5.js +2 -0
  10. package/dist/chunk-6DOEUDD5.js +254 -0
  11. package/dist/chunk-7SKSRSS7.mjs +57 -0
  12. package/dist/chunk-AC6TWLRT.mjs +27 -0
  13. package/dist/chunk-ADWNF7V3.js +120 -0
  14. package/dist/chunk-BJ3R5R32.mjs +2163 -0
  15. package/dist/chunk-CETJJ73S.js +1555 -0
  16. package/dist/chunk-CSUBLSKZ.mjs +1002 -0
  17. package/dist/chunk-CV4M7CNU.mjs +251 -0
  18. package/dist/chunk-E323WAZG.mjs +272 -0
  19. package/dist/chunk-E544XUBL.js +378 -0
  20. package/dist/chunk-EC2ZIWOK.js +1007 -0
  21. package/dist/chunk-EFXQT23N.mjs +99 -0
  22. package/dist/chunk-EMUMKW5C.js +107 -0
  23. package/dist/chunk-FOMOOERN.js +2 -0
  24. package/dist/chunk-FT33LFII.mjs +21 -0
  25. package/dist/chunk-FT64PCUP.mjs +533 -0
  26. package/dist/chunk-H6LZKSLY.js +5678 -0
  27. package/dist/chunk-HPQT36RR.js +543 -0
  28. package/dist/chunk-JLWKW3G5.js +2 -0
  29. package/dist/chunk-L5TF4EHW.mjs +1 -0
  30. package/dist/chunk-LAJ34AH2.mjs +374 -0
  31. package/dist/chunk-LDN7IX4Y.mjs +1 -0
  32. package/dist/chunk-MLJJBBTB.mjs +1 -0
  33. package/dist/chunk-NSDLGLAQ.js +2166 -0
  34. package/dist/chunk-RJ262NXS.js +24 -0
  35. package/dist/chunk-RXNEDWK2.js +141 -0
  36. package/dist/chunk-SW7QNEZU.js +744 -0
  37. package/dist/chunk-UQQUWGHW.mjs +118 -0
  38. package/dist/chunk-VOGL2WCE.mjs +1542 -0
  39. package/dist/chunk-VRN3UWE5.mjs +138 -0
  40. package/dist/chunk-XV5Z5XYR.mjs +5640 -0
  41. package/dist/chunk-Z7PWFZG5.js +30 -0
  42. package/dist/chunk-ZJD5WMR3.mjs +418 -0
  43. package/dist/hooks.d.mts +255 -0
  44. package/dist/hooks.d.ts +255 -0
  45. package/dist/hooks.js +56 -0
  46. package/dist/hooks.mjs +11 -0
  47. package/dist/index.d.mts +29 -0
  48. package/dist/index.d.ts +29 -0
  49. package/dist/index.js +180 -0
  50. package/dist/index.mjs +19 -0
  51. package/dist/lib.d.mts +164 -0
  52. package/dist/lib.d.ts +164 -0
  53. package/dist/lib.js +144 -0
  54. package/dist/lib.mjs +3 -0
  55. package/dist/nodes.d.mts +128 -0
  56. package/dist/nodes.d.ts +128 -0
  57. package/dist/nodes.js +151 -0
  58. package/dist/nodes.mjs +14 -0
  59. package/dist/panels.d.mts +22 -0
  60. package/dist/panels.d.ts +22 -0
  61. package/dist/panels.js +21 -0
  62. package/dist/panels.mjs +4 -0
  63. package/dist/promptLibraryStore-BZnfmEkc.d.ts +464 -0
  64. package/dist/promptLibraryStore-zqb59nsu.d.mts +464 -0
  65. package/dist/provider.d.mts +29 -0
  66. package/dist/provider.d.ts +29 -0
  67. package/dist/provider.js +17 -0
  68. package/dist/provider.mjs +4 -0
  69. package/dist/stores.d.mts +96 -0
  70. package/dist/stores.d.ts +96 -0
  71. package/dist/stores.js +113 -0
  72. package/dist/stores.mjs +43 -0
  73. package/dist/toolbar.d.mts +73 -0
  74. package/dist/toolbar.d.ts +73 -0
  75. package/dist/toolbar.js +34 -0
  76. package/dist/toolbar.mjs +5 -0
  77. package/dist/types-ipAnBzAJ.d.mts +46 -0
  78. package/dist/types-ipAnBzAJ.d.ts +46 -0
  79. package/dist/ui.d.mts +67 -0
  80. package/dist/ui.d.ts +67 -0
  81. package/dist/ui.js +84 -0
  82. package/dist/ui.mjs +3 -0
  83. package/dist/workflowStore-4EGKJLYK.mjs +3 -0
  84. package/dist/workflowStore-KM32FDL7.js +12 -0
  85. package/package.json +117 -0
  86. package/src/styles/workflow-ui.css +186 -0
@@ -0,0 +1,120 @@
1
+ 'use strict';
2
+
3
+ var chunkNSDLGLAQ_js = require('./chunk-NSDLGLAQ.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
+ chunkNSDLGLAQ_js.useWorkflowStore.temporal.getState().undo();
96
+ }
97
+ if (e.key === "z" && isMod && e.shiftKey) {
98
+ e.preventDefault();
99
+ chunkNSDLGLAQ_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;