@pixerate/editor-react 0.210.0 → 0.210.1

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.
@@ -1528,6 +1528,10 @@ function useCanvasCapture(options) {
1528
1528
  },
1529
1529
  getViewport: () => latest().getViewport(),
1530
1530
  getNodes: () => latest().getNodes(),
1531
+ layers: () => {
1532
+ const layers = latest().layers;
1533
+ return (typeof layers === "function" ? layers() : layers) ?? [];
1534
+ },
1531
1535
  getNodeRect: (node, nodes) => (latest().getNodeRect ?? import_canvas10.canvasNodeCaptureRect)(node, nodes),
1532
1536
  rasterize: (element, raster) => (latest().rasterize ?? import_tools3.rasterizeElement)(element, raster)
1533
1537
  });
@@ -1050,6 +1050,10 @@ function useCanvasCapture(options) {
1050
1050
  },
1051
1051
  getViewport: () => latest().getViewport(),
1052
1052
  getNodes: () => latest().getNodes(),
1053
+ layers: () => {
1054
+ const layers = latest().layers;
1055
+ return (typeof layers === "function" ? layers() : layers) ?? [];
1056
+ },
1053
1057
  getNodeRect: (node, nodes) => (latest().getNodeRect ?? canvasNodeCaptureRect)(node, nodes),
1054
1058
  rasterize: (element, raster) => (latest().rasterize ?? rasterizeElement)(element, raster)
1055
1059
  });
@@ -8,7 +8,8 @@ export interface UseCanvasCaptureOptions<TNode extends CanvasNode = CanvasNode>
8
8
  /**
9
9
  * The `capture_view` agent tool for a React Flow canvas: screenshots of the viewport, all
10
10
  * content, the selection, nodes by id or a rect in canvas units. Register the result with
11
- * `useAgentToolProvider`. The provider stays the same object across renders (it reads the
11
+ * `useAgentToolProvider`. Pass `layers` for ink or paint drawn outside the flow's viewport, so
12
+ * `content` frames their strokes too. The provider stays the same object across renders (it reads the
12
13
  * latest options on each call) and changes only with `id` / `namespace`.
13
14
  *
14
15
  * ```tsx
@@ -8,7 +8,8 @@ export interface UseCanvasCaptureOptions<TNode extends CanvasNode = CanvasNode>
8
8
  /**
9
9
  * The `capture_view` agent tool for a React Flow canvas: screenshots of the viewport, all
10
10
  * content, the selection, nodes by id or a rect in canvas units. Register the result with
11
- * `useAgentToolProvider`. The provider stays the same object across renders (it reads the
11
+ * `useAgentToolProvider`. Pass `layers` for ink or paint drawn outside the flow's viewport, so
12
+ * `content` frames their strokes too. The provider stays the same object across renders (it reads the
12
13
  * latest options on each call) and changes only with `id` / `namespace`.
13
14
  *
14
15
  * ```tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixerate/editor-react",
3
- "version": "0.210.0",
3
+ "version": "0.210.1",
4
4
  "description": "React bindings and prompt/rich-text components for @pixerate/editor",
5
5
  "author": "Pixerate",
6
6
  "license": "MIT",
@@ -283,7 +283,7 @@
283
283
  "dependencies": {},
284
284
  "peerDependencies": {
285
285
  "@dagrejs/dagre": "^1.1.8",
286
- "@pixerate/editor": ">=0.338.0 <1.0.0-0",
286
+ "@pixerate/editor": ">=0.339.0 <1.0.0-0",
287
287
  "@tiptap/core": "^2.27.3",
288
288
  "@tiptap/extension-bubble-menu": "^2.27.3",
289
289
  "@tiptap/extension-placeholder": "^2.27.3",
@@ -334,7 +334,7 @@
334
334
  "tsup": "^9.0.0",
335
335
  "typescript": "^5.7.3",
336
336
  "vitest": "^5.1.0",
337
- "@pixerate/editor": "0.338.0"
337
+ "@pixerate/editor": "0.339.0"
338
338
  },
339
339
  "scripts": {
340
340
  "build": "tsup && tsc -p tsconfig.build.json && node ../../scripts/finalize-declarations.mjs dist",