@ghchinoy/litflow 0.2.4 → 0.2.7

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
@@ -116,6 +116,7 @@ LitFlow leverages `@xyflow/system`, the same headless core that powers React Flo
116
116
  - `examples/multiple-handles/`: Nodes with multiple input/output ports.
117
117
  - `examples/dynamic-interactivity/`: Adding/removing nodes and edges at runtime.
118
118
  - `examples/subflows/`: Nested nodes and parent-child relationships.
119
+ - `examples/designer/`: A dual-pane authoring tool with live JSON sync.
119
120
  - **`<lit-flow>`**: The root component. It initializes the `XYPanZoom` instance for the viewport and manages the collection of nodes and edges.
120
121
  - **`<lit-node>`**: A reactive Lit component for individual nodes. Uses **Light DOM** to ensure compatibility with xyflow's system utilities (like hit-testing).
121
122
  - **`<lit-handle>`**: A connection port component. Also uses **Light DOM** to ensure discoverability during connection dragging.
@@ -126,6 +127,8 @@ LitFlow leverages `@xyflow/system`, the same headless core that powers React Flo
126
127
  ## 🛠️ Key Features
127
128
  - **Panning & Zooming**: Full support for viewport manipulation via d3-zoom (via xyflow).
128
129
  - **Node Dragging**: Individual nodes can be dragged, with positions synced back to the state.
130
+ - **Live Inspector Designer**: A comprehensive authoring example featuring a drag-and-drop palette and live JSON synchronization.
131
+ - **Global Change Observability**: A robust `change` event that fires on any graph mutation (drag, connect, delete) for external state syncing.
129
132
  - **Marquee Selection**: Bulk select nodes and edges by dragging a selection box (Shift + Drag).
130
133
  - **Edge Markers**: Support for arrowheads and other markers on edges.
131
134
  - **Manual Connections**: Drag-to-connect functionality between handles with a live connection line.
@@ -29,6 +29,7 @@ export declare class LitFlow extends LitFlow_base {
29
29
  private _height;
30
30
  set nodes(nodes: NodeBase[]);
31
31
  get nodes(): NodeBase[];
32
+ private _notifyChange;
32
33
  private _discoverNodes;
33
34
  set edges(edges: any[]);
34
35
  get edges(): any[];
@@ -48,6 +49,11 @@ export declare class LitFlow extends LitFlow_base {
48
49
  x: number;
49
50
  y: number;
50
51
  };
52
+ /**
53
+ * Fits the view to the current nodes.
54
+ * @param padding Optional padding in pixels (default: 50)
55
+ */
56
+ fitView(padding?: number): Promise<void>;
51
57
  private _updatePanZoom;
52
58
  firstUpdated(): void;
53
59
  updated(changedProperties: Map<string, any>): void;