@foblex/flow 19.1.3 → 19.1.5
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/AI.md +14 -8
- package/README.md +17 -4
- package/fesm2022/foblex-flow.mjs +117 -22
- package/fesm2022/foblex-flow.mjs.map +1 -1
- package/index.d.ts +34 -13
- package/package.json +1 -1
- package/schematics/ng-add/index.js +4 -2
- package/schematics/ng-add/index.js.map +1 -1
package/index.d.ts
CHANGED
|
@@ -361,6 +361,13 @@ declare class FCanvasComponent extends FCanvasBase implements OnInit, OnDestroy
|
|
|
361
361
|
*/
|
|
362
362
|
private _warnWhenCalledBeforeNodesRender;
|
|
363
363
|
centerGroupOrNode(groupOrNodeId: string, animated?: boolean, emitCanvasChange?: boolean): void;
|
|
364
|
+
/**
|
|
365
|
+
* Resets the canvas scale to `1` and centers the specified group or node.
|
|
366
|
+
* @param groupOrNodeId - The ID of the group or node to center.
|
|
367
|
+
* @param animated - If true, the centering will be animated; otherwise, it will be instantaneous.
|
|
368
|
+
* @param emitCanvasChange - If false, does not emit `fCanvasChange` for this programmatic move.
|
|
369
|
+
*/
|
|
370
|
+
resetScaleAndCenterGroupOrNode(groupOrNodeId: string, animated?: boolean, emitCanvasChange?: boolean): void;
|
|
364
371
|
/**
|
|
365
372
|
* Fits the canvas to the screen by adjusting the scale and position.
|
|
366
373
|
* @param padding - paddings from the bounds of the canvas
|
|
@@ -396,6 +403,7 @@ declare class FCanvasComponent extends FCanvasBase implements OnInit, OnDestroy
|
|
|
396
403
|
resetScale(): void;
|
|
397
404
|
ngOnDestroy(): void;
|
|
398
405
|
private _afterRedraw;
|
|
406
|
+
private _centerGroupOrNode;
|
|
399
407
|
static ɵfac: i0.ɵɵFactoryDeclaration<FCanvasComponent, never>;
|
|
400
408
|
static ɵcmp: i0.ɵɵComponentDeclaration<FCanvasComponent, "f-canvas", never, { "position": { "alias": "position"; "required": false; "isSignal": true; }; "scale": { "alias": "scale"; "required": false; "isSignal": true; }; "debounceTime": { "alias": "debounceTime"; "required": false; "isSignal": true; }; "fLayers": { "alias": "fLayers"; "required": false; "isSignal": true; }; }, { "fCanvasChange": "fCanvasChange"; }, never, ["[fGroup], [fGroups]", "f-snap-connection", "f-connection, [fConnections]", "f-connection-for-create", "[fNode], [fNodes]"], true, never>;
|
|
401
409
|
}
|
|
@@ -463,8 +471,9 @@ declare class CenterGroupOrNodeRequest {
|
|
|
463
471
|
id: string;
|
|
464
472
|
animated: boolean;
|
|
465
473
|
emitCanvasChange: boolean;
|
|
474
|
+
resetScale: boolean;
|
|
466
475
|
static readonly fToken: unique symbol;
|
|
467
|
-
constructor(id: string, animated: boolean, emitCanvasChange?: boolean);
|
|
476
|
+
constructor(id: string, animated: boolean, emitCanvasChange?: boolean, resetScale?: boolean);
|
|
468
477
|
}
|
|
469
478
|
|
|
470
479
|
/**
|
|
@@ -474,7 +483,7 @@ declare class CenterGroupOrNode implements IExecution<CenterGroupOrNodeRequest,
|
|
|
474
483
|
private readonly _store;
|
|
475
484
|
private readonly _mediator;
|
|
476
485
|
private get _transform();
|
|
477
|
-
handle({ id, animated, emitCanvasChange }: CenterGroupOrNodeRequest): void;
|
|
486
|
+
handle({ id, animated, emitCanvasChange, resetScale }: CenterGroupOrNodeRequest): void;
|
|
478
487
|
private _toCenter;
|
|
479
488
|
private _getNodeRect;
|
|
480
489
|
private _getFlowRect;
|
|
@@ -7882,6 +7891,12 @@ declare class FA11yController {
|
|
|
7882
7891
|
private _matchesKey;
|
|
7883
7892
|
/** Keys must never hijack typing or native controls inside a node. */
|
|
7884
7893
|
private _isInteractiveContent;
|
|
7894
|
+
/**
|
|
7895
|
+
* Selection can be restored from state or replaced by a pointer-driven render before
|
|
7896
|
+
* this layer receives a stable DOM target. In that case there is no active descendant,
|
|
7897
|
+
* so use the single selected item as the spatial-navigation anchor.
|
|
7898
|
+
*/
|
|
7899
|
+
private _syncActiveItemFromSelection;
|
|
7885
7900
|
/**
|
|
7886
7901
|
* Plain arrows travel over nodes AND connections as equal stops — a connection is
|
|
7887
7902
|
* represented by its midpoint, so walking a chain reads node → connection → node.
|
|
@@ -9260,11 +9275,22 @@ interface IFStateTransform {
|
|
|
9260
9275
|
position?: IPoint;
|
|
9261
9276
|
scale: number;
|
|
9262
9277
|
}
|
|
9278
|
+
/** The selected graph items, as persisted by `snapshot()` and restored by `load()`. */
|
|
9279
|
+
interface IFStateSelection {
|
|
9280
|
+
nodeIds: string[];
|
|
9281
|
+
groupIds: string[];
|
|
9282
|
+
connectionIds: string[];
|
|
9283
|
+
}
|
|
9263
9284
|
/** The whole graph, as it goes in (`load`) and comes out (`snapshot`). */
|
|
9264
9285
|
interface IFStateData<TNode extends IFStateNode = IFStateNode, TConnection extends IFStateConnection = IFStateConnection, TGroup extends IFStateGroup = IFStateGroup> {
|
|
9265
9286
|
nodes: TNode[];
|
|
9266
9287
|
connections: TConnection[];
|
|
9267
9288
|
groups: TGroup[];
|
|
9289
|
+
/**
|
|
9290
|
+
* The current selection. Restored on `load` and present in every `snapshot`.
|
|
9291
|
+
* Omitted on load clears the selection for backward compatibility.
|
|
9292
|
+
*/
|
|
9293
|
+
selection?: IFStateSelection;
|
|
9268
9294
|
/**
|
|
9269
9295
|
* The canvas pan/zoom. Restored on `load` and present in every `snapshot`.
|
|
9270
9296
|
* Omitted on load resets it to the identity transform.
|
|
@@ -9272,12 +9298,6 @@ interface IFStateData<TNode extends IFStateNode = IFStateNode, TConnection exten
|
|
|
9272
9298
|
transform?: IFStateTransform;
|
|
9273
9299
|
}
|
|
9274
9300
|
|
|
9275
|
-
/** The selected items, mirrored from the flow. */
|
|
9276
|
-
interface IFStateSelection {
|
|
9277
|
-
nodeIds: string[];
|
|
9278
|
-
groupIds: string[];
|
|
9279
|
-
connectionIds: string[];
|
|
9280
|
-
}
|
|
9281
9301
|
/** The whole graph at one point in time; records are updated immutably. */
|
|
9282
9302
|
interface IFStateShape<TNode extends IFStateNode = IFStateNode, TConnection extends IFStateConnection = IFStateConnection, TGroup extends IFStateGroup = IFStateGroup> {
|
|
9283
9303
|
nodes: Record<string, TNode>;
|
|
@@ -9584,9 +9604,9 @@ declare class FFlowStateController {
|
|
|
9584
9604
|
private _openBatch;
|
|
9585
9605
|
private _closeBatch;
|
|
9586
9606
|
/**
|
|
9587
|
-
*
|
|
9588
|
-
*
|
|
9589
|
-
*
|
|
9607
|
+
* Pushes state selection into the flow after `load`, `undo` or `redo` so the
|
|
9608
|
+
* rendered highlight follows the persisted state. `isSelectedChanged: false`
|
|
9609
|
+
* keeps this from re-emitting a selection change.
|
|
9590
9610
|
*/
|
|
9591
9611
|
private _wireSelectionRestore;
|
|
9592
9612
|
private _restoreSelection;
|
|
@@ -9609,7 +9629,8 @@ interface IFFlowStateConfig {
|
|
|
9609
9629
|
* `undo`/`redo` also walk selection (Figma/Photoshop style), and a drag's
|
|
9610
9630
|
* leading selection folds into the same step as the move. Set `false` to
|
|
9611
9631
|
* keep selection out of the history (like xyflow or tldraw);
|
|
9612
|
-
* `state.selection()` reflects the current selection either way
|
|
9632
|
+
* `state.selection()` reflects the current selection either way, and the
|
|
9633
|
+
* current value is still saved by `snapshot()` and restored by `load()`.
|
|
9613
9634
|
*/
|
|
9614
9635
|
selectionInHistory?: boolean;
|
|
9615
9636
|
/**
|
|
@@ -9691,7 +9712,7 @@ declare const F_FLOW_STATE_CONFIG: InjectionToken<IFFlowStateResolvedConfig>;
|
|
|
9691
9712
|
* connection, node moves, drops into groups, external-item drops, delete
|
|
9692
9713
|
* requests) are applied to the state automatically, each as one undoable
|
|
9693
9714
|
* step. `undo()`/`redo()` with `canUndo`/`canRedo` signals come built in;
|
|
9694
|
-
* `snapshot()` returns the graph
|
|
9715
|
+
* `snapshot()` returns the graph, selection and viewport for persistence.
|
|
9695
9716
|
*
|
|
9696
9717
|
* Every store behavior is overridable: subclass `FFlowState` (any CRUD
|
|
9697
9718
|
* method, any `apply*` gesture handler, any protected building block) and
|
package/package.json
CHANGED
|
@@ -20,8 +20,10 @@ const AGENT_RULES_BLOCK = `${AGENT_RULES_BEGIN}
|
|
|
20
20
|
|
|
21
21
|
Before writing any code that uses \`@foblex/flow\`, read the AI guide bundled with the
|
|
22
22
|
package: \`node_modules/@foblex/flow/AI.md\`. It contains the verified API surface, hard
|
|
23
|
-
rules (no React Flow patterns
|
|
24
|
-
checklist of common
|
|
23
|
+
rules (no React Flow patterns), a current \`fConnector\` setup, the choice between classic
|
|
24
|
+
app-owned records and opt-in \`withFlowState()\` managed records, and a checklist of common
|
|
25
|
+
silent failures. Domain validation, permissions, and persistence remain application
|
|
26
|
+
concerns in both state modes.
|
|
25
27
|
|
|
26
28
|
Additional references:
|
|
27
29
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/f-flow/schematics/ng-add/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/f-flow/schematics/ng-add/index.ts"],"names":[],"mappings":";;AA2CA,sBAOC;AAjDD,2DAAiF;AACjF,4DAA0E;AAC1E,yDAA8D;AAC9D,2EAGkD;AAClD,uEAAmE;AAEnE,MAAM,wBAAwB,GAAG,+CAA+C,CAAC;AACjF,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAC;IACtC,wBAAwB;IACxB,kCAAkC;CACnC,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAG,WAAW,CAAC;AACrC,MAAM,iBAAiB,GAAG,wCAAwC,CAAC;AACnE,MAAM,eAAe,GAAG,sCAAsC,CAAC;AAC/D,MAAM,iBAAiB,GAAG,GAAG,iBAAiB;;;;;;;;;;;;;;;;;;EAkB5C,eAAe,EAAE,CAAC;AAMpB,SAAgB,KAAK,CAAC,UAAwB,EAAE;IAC9C,OAAO,IAAA,kBAAK,EAAC;QACX,eAAe,EAAE;QACjB,eAAe,EAAE;QACjB,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC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