@ultrst-armada/floks 1.2.5 → 1.2.6

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 (38) hide show
  1. package/package.json +8 -10
  2. package/packages/canvas-ui/dist/chunk-QRYNQ36L.js +123 -0
  3. package/packages/canvas-ui/dist/{chunk-OOTTFWXA.js → chunk-RH5NINIT.js} +1 -122
  4. package/packages/canvas-ui/dist/chunk-VESG3VP3.js +1522 -0
  5. package/packages/canvas-ui/dist/frnl-editable-node-graph/index.d.ts +110 -0
  6. package/packages/canvas-ui/dist/frnl-editable-node-graph/index.js +9 -0
  7. package/packages/canvas-ui/dist/index.d.ts +13 -2
  8. package/packages/canvas-ui/dist/index.js +62 -484
  9. package/packages/canvas-ui/dist/predictive/index.js +4 -2
  10. package/packages/canvas-ui/floks.manifest.json +25 -4
  11. package/packages/canvas-ui/package.json +11 -7
  12. package/packages/ui/dist/chunk-2SD6BIUX.js +0 -0
  13. package/packages/ui/dist/{chunk-YDOKOBRJ.js → chunk-DGZBP3ND.js} +106 -491
  14. package/packages/ui/dist/{chunk-2SFOC7KZ.js → chunk-KQAFKNQH.js} +77 -67
  15. package/packages/ui/dist/chunk-PH4NEHWR.js +99 -0
  16. package/packages/ui/dist/chunk-PRMOURNW.js +324 -0
  17. package/packages/ui/dist/{chunk-DT6DZU63.js → chunk-X67KXI3H.js} +190 -152
  18. package/packages/ui/dist/chunk-YVWJ4SW7.js +394 -0
  19. package/packages/ui/dist/components/auth/index.d.ts +56 -14
  20. package/packages/ui/dist/components/auth/index.js +12 -3
  21. package/packages/ui/dist/components/composite/index.js +1 -1
  22. package/packages/ui/dist/components/graph/index.d.ts +29 -0
  23. package/packages/ui/dist/components/graph/index.js +10 -0
  24. package/packages/ui/dist/components/layout/index.js +2 -2
  25. package/packages/ui/dist/components/settings/index.js +2 -2
  26. package/packages/ui/dist/components/tiles/index.d.ts +83 -0
  27. package/packages/ui/dist/components/tiles/index.js +10 -0
  28. package/packages/ui/dist/components/workspace/index.d.ts +108 -33
  29. package/packages/ui/dist/components/workspace/index.js +15 -3
  30. package/packages/ui/dist/frnl/index.js +9 -7
  31. package/packages/ui/dist/hierarchy/index.js +2 -2
  32. package/packages/ui/dist/index.d.ts +5 -2
  33. package/packages/ui/dist/index.js +68 -39
  34. package/packages/ui/floks.manifest.json +99 -17
  35. package/packages/ui/package.json +18 -3
  36. package/packages/ui/dist/{chunk-MYXPGPI3.js → chunk-GWW3BGOB.js} +3 -3
  37. package/packages/ui/dist/{chunk-TORWRS3V.js → chunk-SXRIBCJX.js} +3 -3
  38. package/packages/ui/dist/{chunk-NPIMIWVO.js → chunk-ZPQC46RO.js} +4 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultrst-armada/floks",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -66,8 +66,8 @@
66
66
  "@types/node": "^22.0.0",
67
67
  "@types/react": "^19.0.0",
68
68
  "@types/react-dom": "^19.0.0",
69
- "@ultrst-armada/kloks": "^1.4.0",
70
- "@ultrst-armada/frnlts": "^0.2.2",
69
+ "@ultrst-armada/kloks": "^1.4.4",
70
+ "@ultrst-armada/frnlts": "^0.2.4",
71
71
  "happy-dom": "^21.0.3",
72
72
  "lucide-react": "^1.55.0",
73
73
  "react": "^19.0.1",
@@ -77,11 +77,9 @@
77
77
  "vitest": "^3.1.0",
78
78
  "zustand": "^5.0.3"
79
79
  },
80
- "pnpm": {
81
- "overrides": {
82
- "@ultrst-armada/kloks": "file:../Kloks",
83
- "@ultrst-armada/frnlts": "file:../FrnlTS"
84
- }
85
- },
86
- "packageManager": "pnpm@9.15.0"
80
+ "packageManager": "pnpm@9.15.0",
81
+ "repository": {
82
+ "type": "git",
83
+ "url": "git+https://github.com/dinilmusick/Floks.git"
84
+ }
87
85
  }
@@ -0,0 +1,123 @@
1
+ // src/predictive/usePredictiveGraph2D.ts
2
+ import { useState, useEffect, useMemo, useCallback } from "react";
3
+ import { computePredictiveGraph } from "@ultrst-armada/kloks/state-graph";
4
+ function usePredictiveGraph2D({
5
+ nodes,
6
+ connections,
7
+ selectedNodeId,
8
+ selectedNodeIds = [],
9
+ onSolidifyPredictiveNodes
10
+ }) {
11
+ const [isActive, setIsActive] = useState(false);
12
+ const [scenarioIndex, setScenarioIndex] = useState(0);
13
+ const targetNodes = useMemo(() => {
14
+ const idSet = new Set(selectedNodeIds || []);
15
+ if (selectedNodeId) idSet.add(selectedNodeId);
16
+ return nodes.filter((n) => idSet.has(n.id));
17
+ }, [nodes, selectedNodeId, selectedNodeIds]);
18
+ useEffect(() => {
19
+ if (targetNodes.length === 0 && isActive) {
20
+ setIsActive(false);
21
+ setScenarioIndex(0);
22
+ }
23
+ }, [targetNodes.length, isActive]);
24
+ const { ghostNodes, traces, selectedNodesWithGhosts } = useMemo(() => {
25
+ if (!isActive || targetNodes.length === 0) {
26
+ return {
27
+ ghostNodes: [],
28
+ traces: [],
29
+ selectedNodesWithGhosts: /* @__PURE__ */ new Map()
30
+ };
31
+ }
32
+ return computePredictiveGraph(targetNodes, connections, scenarioIndex);
33
+ }, [isActive, targetNodes, connections, scenarioIndex]);
34
+ useEffect(() => {
35
+ const handleKeyDown = (e) => {
36
+ const activeEl = document.activeElement;
37
+ if (activeEl && ["INPUT", "TEXTAREA", "SELECT"].includes(activeEl.tagName)) {
38
+ return;
39
+ }
40
+ const isExplicitToggleKey = (e.ctrlKey || e.metaKey || e.altKey) && ["Tab", "p", "P", "g", "G"].includes(e.key) || ["p", "P", "g", "G", "`", "~"].includes(e.key);
41
+ if (!isActive && targetNodes.length > 0 && (e.key === "Tab" || isExplicitToggleKey)) {
42
+ e.preventDefault();
43
+ e.stopPropagation();
44
+ setIsActive(true);
45
+ return;
46
+ }
47
+ if (isActive && isExplicitToggleKey) {
48
+ e.preventDefault();
49
+ e.stopPropagation();
50
+ setIsActive((prev) => !prev);
51
+ return;
52
+ }
53
+ if (isActive && e.key === "Tab") {
54
+ e.preventDefault();
55
+ e.stopPropagation();
56
+ if (e.shiftKey) {
57
+ setScenarioIndex((i) => i <= 0 ? 12 : i - 1);
58
+ } else {
59
+ setScenarioIndex((i) => i + 1);
60
+ }
61
+ return;
62
+ }
63
+ if (isActive && e.key === "Escape") {
64
+ e.preventDefault();
65
+ setIsActive(false);
66
+ }
67
+ };
68
+ window.addEventListener("keydown", handleKeyDown, { capture: true });
69
+ return () => {
70
+ window.removeEventListener("keydown", handleKeyDown, { capture: true });
71
+ };
72
+ }, [isActive, targetNodes.length]);
73
+ const toggleActive = useCallback(() => {
74
+ if (targetNodes.length > 0) {
75
+ setIsActive((prev) => !prev);
76
+ }
77
+ }, [targetNodes.length]);
78
+ const nextScenario = useCallback(() => {
79
+ setScenarioIndex((i) => i + 1);
80
+ }, []);
81
+ const prevScenario = useCallback(() => {
82
+ setScenarioIndex((i) => i <= 0 ? 12 : i - 1);
83
+ }, []);
84
+ const solidifyGhost = useCallback(
85
+ (ghost) => {
86
+ onSolidifyPredictiveNodes?.([ghost]);
87
+ },
88
+ [onSolidifyPredictiveNodes]
89
+ );
90
+ const solidifyAllForNode = useCallback(
91
+ (parentNodeId) => {
92
+ const ghosts = selectedNodesWithGhosts.get(parentNodeId);
93
+ if (ghosts && ghosts.length > 0) {
94
+ onSolidifyPredictiveNodes?.(ghosts);
95
+ }
96
+ },
97
+ [selectedNodesWithGhosts, onSolidifyPredictiveNodes]
98
+ );
99
+ const solidifyAll = useCallback(() => {
100
+ if (ghostNodes.length > 0) {
101
+ onSolidifyPredictiveNodes?.(ghostNodes);
102
+ }
103
+ }, [ghostNodes, onSolidifyPredictiveNodes]);
104
+ return {
105
+ isActive,
106
+ scenarioIndex,
107
+ targetNodes,
108
+ ghostNodes,
109
+ traces,
110
+ selectedNodesWithGhosts,
111
+ toggleActive,
112
+ nextScenario,
113
+ prevScenario,
114
+ solidifyGhost,
115
+ solidifyAllForNode,
116
+ solidifyAll,
117
+ close: () => setIsActive(false)
118
+ };
119
+ }
120
+
121
+ export {
122
+ usePredictiveGraph2D
123
+ };
@@ -380,129 +380,8 @@ var PredictiveLayer2D = ({
380
380
  ] });
381
381
  };
382
382
 
383
- // src/predictive/usePredictiveGraph2D.ts
384
- import { useState as useState2, useEffect, useMemo, useCallback } from "react";
385
- import { computePredictiveGraph } from "@ultrst-armada/kloks/state-graph";
386
- function usePredictiveGraph2D({
387
- nodes,
388
- connections,
389
- selectedNodeId,
390
- selectedNodeIds = [],
391
- onSolidifyPredictiveNodes
392
- }) {
393
- const [isActive, setIsActive] = useState2(false);
394
- const [scenarioIndex, setScenarioIndex] = useState2(0);
395
- const targetNodes = useMemo(() => {
396
- const idSet = new Set(selectedNodeIds || []);
397
- if (selectedNodeId) idSet.add(selectedNodeId);
398
- return nodes.filter((n) => idSet.has(n.id));
399
- }, [nodes, selectedNodeId, selectedNodeIds]);
400
- useEffect(() => {
401
- if (targetNodes.length === 0 && isActive) {
402
- setIsActive(false);
403
- setScenarioIndex(0);
404
- }
405
- }, [targetNodes.length, isActive]);
406
- const { ghostNodes, traces, selectedNodesWithGhosts } = useMemo(() => {
407
- if (!isActive || targetNodes.length === 0) {
408
- return {
409
- ghostNodes: [],
410
- traces: [],
411
- selectedNodesWithGhosts: /* @__PURE__ */ new Map()
412
- };
413
- }
414
- return computePredictiveGraph(targetNodes, connections, scenarioIndex);
415
- }, [isActive, targetNodes, connections, scenarioIndex]);
416
- useEffect(() => {
417
- const handleKeyDown = (e) => {
418
- const activeEl = document.activeElement;
419
- if (activeEl && ["INPUT", "TEXTAREA", "SELECT"].includes(activeEl.tagName)) {
420
- return;
421
- }
422
- const isExplicitToggleKey = (e.ctrlKey || e.metaKey || e.altKey) && ["Tab", "p", "P", "g", "G"].includes(e.key) || ["p", "P", "g", "G", "`", "~"].includes(e.key);
423
- if (!isActive && targetNodes.length > 0 && (e.key === "Tab" || isExplicitToggleKey)) {
424
- e.preventDefault();
425
- e.stopPropagation();
426
- setIsActive(true);
427
- return;
428
- }
429
- if (isActive && isExplicitToggleKey) {
430
- e.preventDefault();
431
- e.stopPropagation();
432
- setIsActive((prev) => !prev);
433
- return;
434
- }
435
- if (isActive && e.key === "Tab") {
436
- e.preventDefault();
437
- e.stopPropagation();
438
- if (e.shiftKey) {
439
- setScenarioIndex((i) => i <= 0 ? 12 : i - 1);
440
- } else {
441
- setScenarioIndex((i) => i + 1);
442
- }
443
- return;
444
- }
445
- if (isActive && e.key === "Escape") {
446
- e.preventDefault();
447
- setIsActive(false);
448
- }
449
- };
450
- window.addEventListener("keydown", handleKeyDown, { capture: true });
451
- return () => {
452
- window.removeEventListener("keydown", handleKeyDown, { capture: true });
453
- };
454
- }, [isActive, targetNodes.length]);
455
- const toggleActive = useCallback(() => {
456
- if (targetNodes.length > 0) {
457
- setIsActive((prev) => !prev);
458
- }
459
- }, [targetNodes.length]);
460
- const nextScenario = useCallback(() => {
461
- setScenarioIndex((i) => i + 1);
462
- }, []);
463
- const prevScenario = useCallback(() => {
464
- setScenarioIndex((i) => i <= 0 ? 12 : i - 1);
465
- }, []);
466
- const solidifyGhost = useCallback(
467
- (ghost) => {
468
- onSolidifyPredictiveNodes?.([ghost]);
469
- },
470
- [onSolidifyPredictiveNodes]
471
- );
472
- const solidifyAllForNode = useCallback(
473
- (parentNodeId) => {
474
- const ghosts = selectedNodesWithGhosts.get(parentNodeId);
475
- if (ghosts && ghosts.length > 0) {
476
- onSolidifyPredictiveNodes?.(ghosts);
477
- }
478
- },
479
- [selectedNodesWithGhosts, onSolidifyPredictiveNodes]
480
- );
481
- const solidifyAll = useCallback(() => {
482
- if (ghostNodes.length > 0) {
483
- onSolidifyPredictiveNodes?.(ghostNodes);
484
- }
485
- }, [ghostNodes, onSolidifyPredictiveNodes]);
486
- return {
487
- isActive,
488
- scenarioIndex,
489
- targetNodes,
490
- ghostNodes,
491
- traces,
492
- selectedNodesWithGhosts,
493
- toggleActive,
494
- nextScenario,
495
- prevScenario,
496
- solidifyGhost,
497
- solidifyAllForNode,
498
- solidifyAll,
499
- close: () => setIsActive(false)
500
- };
501
- }
502
-
503
383
  export {
504
384
  PredictiveGhostNodeCard,
505
385
  PredictiveHudToolbar,
506
- PredictiveLayer2D,
507
- usePredictiveGraph2D
386
+ PredictiveLayer2D
508
387
  };