@squeed/flow-sdk 2.0.37 → 2.0.39

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.
package/README.md CHANGED
@@ -249,6 +249,16 @@ caption below the icon, so paths and arrowheads do not cross wrapped labels or
249
249
  subtitles. Horizontal connectors still attach to the icon surface. Unmarked
250
250
  custom views retain rectangular host bounds.
251
251
 
252
+ Node edit attribution is opt-in: provide `callbacks.getNodeEditMetadata()` returning
253
+ `{ userId, name, at }` from the editing session (`at` is an ISO timestamp).
254
+ JSON node edits persist it as `$edited`; raw graphs store the same object in
255
+ `data.config.edited`. Existing `$subtitle` text is preserved. The shared `NodeView`
256
+ renders the editor and relative time using one shared minute timer, including for
257
+ read-only viewers of the saved document. No-op edits leave the timestamp unchanged.
258
+ Use `stampNodeEdit(json, address, metadata)` for custom node commit handlers.
259
+ Metadata is display information, not an authorization or tamper-proof audit record;
260
+ remote mutations must supply their actual editor, never the receiving viewer.
261
+
252
262
  Edge-label placement is scoped to each canvas and skips empty label layers.
253
263
  The existing placement is reused while node bounds, edge paths, and label
254
264
  dimensions are unchanged. Geometry changes and font loading recheck placement;
@@ -574,6 +584,14 @@ model-space `position`. A workflow template creates a new step through the
574
584
  configured collection/identity/dependency fields; an existing reusable retains
575
585
  its shared state and connection. Node-mode drawing is unchanged.
576
586
 
587
+ Default Set and Array draws label new entries `Untitled 1`, `Untitled 2`, and
588
+ so on, using the next unused number among the parent's existing labels. Both
589
+ modes share that sequence. JSON keys such as `node_1`, `list_1`, and numeric
590
+ array indexes remain unchanged; the display name is stored in `$label` and
591
+ survives serialization. Existing names and form-generated labels are preserved.
592
+ Set mode creates one entry. The first Array draw from a source creates two
593
+ siblings in one update; later draws create one, including after reload.
594
+
577
595
  After layout, `engine.setNodePosition(id, position)` places a measured node at
578
596
  the draw endpoint without changing viewport zoom or pan. This renderer-local
579
597
  placement is retained across relayouts while the node remains rendered; pass
@@ -1411,16 +1429,32 @@ import { PiX } from "react-icons/pi";
1411
1429
 
1412
1430
  ## Keyboard Shortcuts
1413
1431
 
1414
- | Key | Action |
1415
- | ---------------------- | --------------------------------- |
1416
- | `Z` | Toggle zoom mode (scroll to zoom) |
1417
- | `M` | Toggle multi-select mode |
1418
- | `D` | Toggle drag/pan mode |
1419
- | `Delete` / `Backspace` | Delete selected non-root nodes |
1420
- | `Escape` | Cancel drawing or a label edit |
1432
+ | Key | Action |
1433
+ | ---------------------- | ----------------------------------------------------------------------------------- |
1434
+ | `Z` | Toggle zoom mode (scroll to zoom) |
1435
+ | `M` | Toggle multi-select mode |
1436
+ | `D` | Toggle drag/pan mode |
1437
+ | Arrow keys | Select a node in that direction and pan it to center without zooming |
1438
+ | `Delete` / `Backspace` | Delete selected non-root nodes |
1439
+ | `Escape` | Cancel an active editor/gesture first; otherwise reuse graph-background deselection |
1421
1440
 
1422
1441
  The canvas supports pointer panning, wheel zoom, and two-finger pinch zoom. Interactive inputs inside nodes retain their own keyboard behavior.
1423
1442
 
1443
+ Click empty canvas or an ordinary node surface to give the diagram keyboard
1444
+ focus. Unmodified arrows select the nearest rendered node in the requested direction, starting from the selected
1445
+ node or the viewport center when nothing is selected. Hidden nodes and nodes
1446
+ inside another canvas are excluded. Panning is immediate and preserves zoom.
1447
+ No candidate leaves selection and viewport unchanged. Forms, open menus,
1448
+ multi-selection, read-only mode, and disabled keyboard shortcuts retain their
1449
+ existing keyboard behavior. Selection callbacks receive
1450
+ `keyboardNavigation: true` in `NodeSelectionModifiers`; hosts should not apply
1451
+ their mouse-click fit/zoom behavior for that event.
1452
+
1453
+ Escape on a selected canvas node reuses the background-click action, including
1454
+ preview retraction and the host's viewport restoration. Editors, dialogs, menus,
1455
+ fullscreen, and active gestures retain priority. If preview opening focuses its
1456
+ label editor, press Escape once to cancel editing and again to close the preview.
1457
+
1424
1458
  ## Theme Utilities
1425
1459
 
1426
1460
  ```tsx