@pixerate/editor-react 0.188.0 → 0.190.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.
@@ -1,4 +1,4 @@
1
- import { PaintDirector, PaintEditorController, PaintPresence, type PaintChange, type PaintChangeFeed, type PaintDirectorOptions, type PaintEditorOptions, type PaintEditorState, type PaintProposal, type PaintProposals, type PaintProposalsOptions, type SerializedPaintDocument } from '@pixerate/editor/paint-editor';
1
+ import { PaintDirector, PaintEditorController, PaintPresence, type PaintChange, type PaintChangeFeed, type PaintDirectorOptions, type PaintEditorOptions, type PaintEditorState, type PaintMutationInfo, type PaintMutationRequestListener, type PaintProposal, type PaintProposals, type PaintProposalsOptions, type SerializedPaintDocument } from '@pixerate/editor/paint-editor';
2
2
  import type { EditorDocument } from '@pixerate/editor/persistence';
3
3
  export interface UsePaintEditorReturn {
4
4
  controller: PaintEditorController;
@@ -23,6 +23,20 @@ export declare function usePaintDirector(controller: PaintEditorController, opti
23
23
  presence: PaintPresence;
24
24
  director: PaintDirector;
25
25
  };
26
+ export interface UseMutationRequestsReturn {
27
+ /** Pending mutations waiting for an agent to claim them (`state === 'pending'`). */
28
+ pending: readonly PaintMutationInfo[];
29
+ /** Every active or completed mutation in the session. */
30
+ mutations: readonly PaintMutationInfo[];
31
+ /** The most recently raised pending mutation, or `null`. */
32
+ last: PaintMutationInfo | null;
33
+ }
34
+ /**
35
+ * Subscribes to mutation requests raised when a user finishes a stroke with a `mutation` brush
36
+ * and pauses for `settle` seconds. While mounted, marks an agent listener as connected on the
37
+ * controller so the brush panel does not warn that no agent is listening.
38
+ */
39
+ export declare function useMutationRequests(controller: PaintEditorController, onRequest?: PaintMutationRequestListener): UseMutationRequestsReturn;
26
40
  export interface PaintProposalsHandle {
27
41
  /** The framework-free store (for `createPaintProposalToolProvider` and agents). */
28
42
  readonly store: PaintProposals;
@@ -1,4 +1,4 @@
1
- import { PaintDirector, PaintEditorController, PaintPresence, type PaintChange, type PaintChangeFeed, type PaintDirectorOptions, type PaintEditorOptions, type PaintEditorState, type PaintProposal, type PaintProposals, type PaintProposalsOptions, type SerializedPaintDocument } from '@pixerate/editor/paint-editor';
1
+ import { PaintDirector, PaintEditorController, PaintPresence, type PaintChange, type PaintChangeFeed, type PaintDirectorOptions, type PaintEditorOptions, type PaintEditorState, type PaintMutationInfo, type PaintMutationRequestListener, type PaintProposal, type PaintProposals, type PaintProposalsOptions, type SerializedPaintDocument } from '@pixerate/editor/paint-editor';
2
2
  import type { EditorDocument } from '@pixerate/editor/persistence';
3
3
  export interface UsePaintEditorReturn {
4
4
  controller: PaintEditorController;
@@ -23,6 +23,20 @@ export declare function usePaintDirector(controller: PaintEditorController, opti
23
23
  presence: PaintPresence;
24
24
  director: PaintDirector;
25
25
  };
26
+ export interface UseMutationRequestsReturn {
27
+ /** Pending mutations waiting for an agent to claim them (`state === 'pending'`). */
28
+ pending: readonly PaintMutationInfo[];
29
+ /** Every active or completed mutation in the session. */
30
+ mutations: readonly PaintMutationInfo[];
31
+ /** The most recently raised pending mutation, or `null`. */
32
+ last: PaintMutationInfo | null;
33
+ }
34
+ /**
35
+ * Subscribes to mutation requests raised when a user finishes a stroke with a `mutation` brush
36
+ * and pauses for `settle` seconds. While mounted, marks an agent listener as connected on the
37
+ * controller so the brush panel does not warn that no agent is listening.
38
+ */
39
+ export declare function useMutationRequests(controller: PaintEditorController, onRequest?: PaintMutationRequestListener): UseMutationRequestsReturn;
26
40
  export interface PaintProposalsHandle {
27
41
  /** The framework-free store (for `createPaintProposalToolProvider` and agents). */
28
42
  readonly store: PaintProposals;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixerate/editor-react",
3
- "version": "0.188.0",
3
+ "version": "0.190.0",
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.273.0 <1.0.0-0",
286
+ "@pixerate/editor": ">=0.275.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.0.5",
337
- "@pixerate/editor": "0.273.0"
337
+ "@pixerate/editor": "0.275.0"
338
338
  },
339
339
  "scripts": {
340
340
  "build": "tsup && tsc -p tsconfig.build.json && node ../../scripts/finalize-declarations.mjs dist",