@mhamz.01/easyflow-whiteboard 2.174.0 → 2.177.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.
@@ -1 +1 @@
1
- {"version":3,"file":"custom-node-overlay-layer.d.ts","sourceRoot":"","sources":["../../../src/components/node/custom-node-overlay-layer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAUrE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;;AAE5D,wBA4KE"}
1
+ {"version":3,"file":"custom-node-overlay-layer.d.ts","sourceRoot":"","sources":["../../../src/components/node/custom-node-overlay-layer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAUrE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;;AAE5D,wBA6KE"}
@@ -20,6 +20,7 @@ export default React.memo(function CanvasOverlayLayer({ tasks, documents, onTask
20
20
  const { dragging, handleDragStart } = useNodeDrag({
21
21
  selectedIdsRef,
22
22
  dragSelectedIdsRef,
23
+ htmlNodesSelectedByBoxRef,
23
24
  localTasksRef,
24
25
  localDocumentsRef,
25
26
  fabricCanvas,
@@ -4,6 +4,7 @@ import type { Task, Document } from "../types/overlay-types";
4
4
  interface UseNodeDragProps {
5
5
  selectedIdsRef: MutableRefObject<Set<string>>;
6
6
  dragSelectedIdsRef: MutableRefObject<Set<string>>;
7
+ htmlNodesSelectedByBoxRef: MutableRefObject<boolean>;
7
8
  localTasksRef: MutableRefObject<Task[]>;
8
9
  localDocumentsRef: MutableRefObject<Document[]>;
9
10
  fabricCanvas?: RefObject<Canvas | null>;
@@ -25,7 +26,7 @@ interface UseNodeDragProps {
25
26
  * so they are always in ground-truth world coords, immune to Fabric v6's
26
27
  * matrix-decomposition vs matrix-multiplication divergence.
27
28
  */
28
- export declare function useNodeDrag({ selectedIdsRef, dragSelectedIdsRef, localTasksRef, localDocumentsRef, fabricCanvas, setLocalTasks, setLocalDocuments, onTasksUpdate, onDocumentsUpdate, }: UseNodeDragProps): {
29
+ export declare function useNodeDrag({ selectedIdsRef, dragSelectedIdsRef, htmlNodesSelectedByBoxRef, localTasksRef, localDocumentsRef, fabricCanvas, setLocalTasks, setLocalDocuments, onTasksUpdate, onDocumentsUpdate, }: UseNodeDragProps): {
29
30
  dragging: {
30
31
  itemIds: string[];
31
32
  } | null;
@@ -1 +1 @@
1
- {"version":3,"file":"useNodeDrag.d.ts","sourceRoot":"","sources":["../../../../src/components/node/hooks/useNodeDrag.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,SAAS,EACT,gBAAgB,EAChB,QAAQ,EACR,cAAc,EACd,UAAU,IAAI,eAAe,EAC7B,UAAU,IAAI,eAAe,EAC9B,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAA4B,MAAM,wBAAwB,CAAC;AAEvF,UAAU,gBAAgB;IACxB,cAAc,EAAE,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9C,kBAAkB,EAAE,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;IAClD,aAAa,EAAE,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAC;IACxC,iBAAiB,EAAE,gBAAgB,CAAC,QAAQ,EAAE,CAAC,CAAC;IAChD,YAAY,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACxC,aAAa,EAAE,QAAQ,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAChD,iBAAiB,EAAE,QAAQ,CAAC,cAAc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AAC;IAChD,YAAY,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACxC,aAAa,EAAE,QAAQ,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAChD,iBAAiB,EAAE,QAAQ,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IACxD,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IACxC,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;CACrD;AAcD;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,EAC1B,cAAc,EACd,kBAAkB,EAClB,yBAAyB,EACzB,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,iBAAiB,GAClB,EAAE,gBAAgB;;iBACmC,MAAM,EAAE;;0BAcrD,MAAM,KAAG;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS;8BAWzC,MAAM,KAAK,eAAe,GAAG,eAAe;EAqLxD"}
@@ -21,7 +21,7 @@ function readPointer(e) {
21
21
  * so they are always in ground-truth world coords, immune to Fabric v6's
22
22
  * matrix-decomposition vs matrix-multiplication divergence.
23
23
  */
24
- export function useNodeDrag({ selectedIdsRef, dragSelectedIdsRef, localTasksRef, localDocumentsRef, fabricCanvas, setLocalTasks, setLocalDocuments, onTasksUpdate, onDocumentsUpdate, }) {
24
+ export function useNodeDrag({ selectedIdsRef, dragSelectedIdsRef, htmlNodesSelectedByBoxRef, localTasksRef, localDocumentsRef, fabricCanvas, setLocalTasks, setLocalDocuments, onTasksUpdate, onDocumentsUpdate, }) {
25
25
  const [dragging, setDragging] = useState(null);
26
26
  const dragStateRef = useRef({
27
27
  isDragging: false,
@@ -86,7 +86,12 @@ export function useNodeDrag({ selectedIdsRef, dragSelectedIdsRef, localTasksRef,
86
86
  // accumulated float rounding — causing a visible position jump on frame 1.
87
87
  // Reading obj.left/top after discard is the ground-truth value: no
88
88
  // prediction, no mismatch.
89
- const liveActiveObjects = canvas.getActiveObjects();
89
+ // Only sync Fabric objects that were co-selected with HTML nodes via a
90
+ // joint box selection. If the user independently clicked a Fabric object
91
+ // and then starts dragging a custom node, those Fabric objects must stay.
92
+ const liveActiveObjects = htmlNodesSelectedByBoxRef.current
93
+ ? canvas.getActiveObjects()
94
+ : [];
90
95
  const canvasObjectsStartPos = new Map();
91
96
  const objectsToSync = [...liveActiveObjects];
92
97
  if (objectsToSync.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mhamz.01/easyflow-whiteboard",
3
- "version": "2.174.0",
3
+ "version": "2.177.0",
4
4
  "description": "A feature-rich whiteboard component built with Fabric.js and React",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",