@pixerate/editor-react 0.152.1 → 0.153.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.
@@ -1688,6 +1688,7 @@ function useCanvasDraw(options) {
1688
1688
  cancelStroke: controller.cancelStroke,
1689
1689
  eraseAt: controller.eraseAt,
1690
1690
  drawStroke: controller.drawStroke,
1691
+ nodeBounds: controller.nodeBounds,
1691
1692
  listBrushes: controller.listBrushes
1692
1693
  }),
1693
1694
  [tool, style, activeStroke, controller]
@@ -1234,6 +1234,7 @@ function useCanvasDraw(options) {
1234
1234
  cancelStroke: controller.cancelStroke,
1235
1235
  eraseAt: controller.eraseAt,
1236
1236
  drawStroke: controller.drawStroke,
1237
+ nodeBounds: controller.nodeBounds,
1237
1238
  listBrushes: controller.listBrushes
1238
1239
  }),
1239
1240
  [tool, style, activeStroke, controller]
@@ -27,6 +27,13 @@ export interface CanvasDrawActions<TNode extends CanvasNode = CanvasNode> {
27
27
  eraseAt: (point: [number, number], radius?: number) => TNode[];
28
28
  /** Draws a whole stroke at once (agents, code); validates the brush first. One undo step. */
29
29
  drawStroke: (input: DrawStrokeInput) => Promise<DrawStrokeResult<TNode>>;
30
+ /** A node's box in canvas coordinates (lets gesture commands such as `canvas.circle` take `{ nodeId }`). */
31
+ nodeBounds: (id: string) => {
32
+ x: number;
33
+ y: number;
34
+ width: number;
35
+ height: number;
36
+ } | undefined;
30
37
  /** The dry paint presets `style.brush` accepts (loads the paint engine). */
31
38
  listBrushes: () => Promise<CanvasBrushPreset[]>;
32
39
  }
@@ -27,6 +27,13 @@ export interface CanvasDrawActions<TNode extends CanvasNode = CanvasNode> {
27
27
  eraseAt: (point: [number, number], radius?: number) => TNode[];
28
28
  /** Draws a whole stroke at once (agents, code); validates the brush first. One undo step. */
29
29
  drawStroke: (input: DrawStrokeInput) => Promise<DrawStrokeResult<TNode>>;
30
+ /** A node's box in canvas coordinates (lets gesture commands such as `canvas.circle` take `{ nodeId }`). */
31
+ nodeBounds: (id: string) => {
32
+ x: number;
33
+ y: number;
34
+ width: number;
35
+ height: number;
36
+ } | undefined;
30
37
  /** The dry paint presets `style.brush` accepts (loads the paint engine). */
31
38
  listBrushes: () => Promise<CanvasBrushPreset[]>;
32
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixerate/editor-react",
3
- "version": "0.152.1",
3
+ "version": "0.153.0",
4
4
  "description": "React bindings and prompt/rich-text components for @pixerate/editor",
5
5
  "author": "Pixerate",
6
6
  "license": "MIT",
@@ -254,7 +254,7 @@
254
254
  "dependencies": {},
255
255
  "peerDependencies": {
256
256
  "@dagrejs/dagre": "^1.1.8",
257
- "@pixerate/editor": ">=0.227.1 <1.0.0-0",
257
+ "@pixerate/editor": ">=0.228.0 <1.0.0-0",
258
258
  "@tiptap/core": "^2.27.3",
259
259
  "@tiptap/extension-bubble-menu": "^2.27.3",
260
260
  "@tiptap/extension-placeholder": "^2.27.3",
@@ -305,7 +305,7 @@
305
305
  "tsup": "^9.0.0",
306
306
  "typescript": "^5.7.3",
307
307
  "vitest": "^5.0.5",
308
- "@pixerate/editor": "0.227.1"
308
+ "@pixerate/editor": "0.228.0"
309
309
  },
310
310
  "scripts": {
311
311
  "build": "tsup && tsc -p tsconfig.build.json && node ../../scripts/finalize-declarations.mjs dist",