@pixerate/editor-react 0.153.0 → 0.155.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.
Files changed (41) hide show
  1. package/dist/animation-editor/ShotCameraMoves.d.cts +14 -0
  2. package/dist/animation-editor/ShotCameraMoves.d.ts +14 -0
  3. package/dist/animation-editor/ShotInspector.d.cts +2 -2
  4. package/dist/animation-editor/ShotInspector.d.ts +2 -2
  5. package/dist/animation-editor/index.cjs +519 -390
  6. package/dist/animation-editor/index.d.cts +1 -0
  7. package/dist/animation-editor/index.d.ts +1 -0
  8. package/dist/animation-editor/index.js +239 -113
  9. package/dist/canvas/index.cjs +3 -3
  10. package/dist/canvas/index.js +1 -1
  11. package/dist/chart/index.cjs +3 -3
  12. package/dist/chart/index.js +1 -1
  13. package/dist/{chunk-V2YC5T4R.js → chunk-6CJEJTQB.js} +1 -1
  14. package/dist/{chunk-VZ7HBWKL.js → chunk-EQ7Q5CBV.js} +1 -1
  15. package/dist/{chunk-GNO54NFG.js → chunk-W5CMGX3I.js} +4 -4
  16. package/dist/{chunk-M75ZC7DI.js → chunk-W7455SH4.js} +16 -7
  17. package/dist/image-editor/BrushOptionsBar.d.cts +2 -0
  18. package/dist/image-editor/BrushOptionsBar.d.ts +2 -0
  19. package/dist/image-editor/ImageEditorCanvas.d.cts +9 -4
  20. package/dist/image-editor/ImageEditorCanvas.d.ts +9 -4
  21. package/dist/image-editor/SelectionOptionsBar.d.cts +2 -0
  22. package/dist/image-editor/SelectionOptionsBar.d.ts +2 -0
  23. package/dist/image-editor/ShapeOptionsBar.d.cts +2 -0
  24. package/dist/image-editor/ShapeOptionsBar.d.ts +2 -0
  25. package/dist/image-editor/index.cjs +18 -9
  26. package/dist/image-editor/index.js +2 -2
  27. package/dist/index.cjs +18 -9
  28. package/dist/index.js +4 -4
  29. package/dist/paint-editor/index.cjs +3 -3
  30. package/dist/paint-editor/index.js +1 -1
  31. package/dist/parameters/index.cjs +3 -3
  32. package/dist/parameters/index.js +2 -2
  33. package/dist/playback/PresenceLayer.d.cts +7 -2
  34. package/dist/playback/PresenceLayer.d.ts +7 -2
  35. package/dist/spreadsheet/index.cjs +3 -3
  36. package/dist/spreadsheet/index.js +2 -2
  37. package/dist/vector/index.cjs +3 -3
  38. package/dist/vector/index.js +1 -1
  39. package/dist/video-editor/index.cjs +3 -3
  40. package/dist/video-editor/index.js +1 -1
  41. package/package.json +3 -3
@@ -1771,7 +1771,7 @@ function useElementPlaybackSurface(playback, id, element, options) {
1771
1771
  // src/playback/PresenceLayer.tsx
1772
1772
  var import_react10 = __toESM(require("react"), 1);
1773
1773
  var import_jsx_runtime6 = require("react/jsx-runtime");
1774
- function PresenceLayer({ presence, viewport, clip = true, className = "" }) {
1774
+ function PresenceLayer({ presence, viewport, clip = true, renderCursor, className = "" }) {
1775
1775
  const { actors } = (0, import_react10.useSyncExternalStore)(presence.subscribe, presence.getState, presence.getState);
1776
1776
  if (!actors.length) return null;
1777
1777
  const map = typeof viewport === "function" ? viewport : viewport ? (p) => ({ x: p.x * viewport.zoom + viewport.x, y: p.y * viewport.zoom + viewport.y }) : (p) => p;
@@ -1797,13 +1797,13 @@ function PresenceLayer({ presence, viewport, clip = true, className = "" }) {
1797
1797
  style: { position: "absolute", ...ring, borderRadius: 8, border: `2px solid ${a.color}`, background: `${a.color}14`, transition: "all 160ms ease-out" }
1798
1798
  }
1799
1799
  ),
1800
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { "data-actor": a.id, style: { position: "absolute", left: 0, top: 0, transform: `translate(${at.x}px, ${at.y}px)` }, children: [
1800
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { "data-actor": a.id, style: { position: "absolute", left: 0, top: 0, transform: `translate(${at.x}px, ${at.y}px)` }, children: renderCursor ? renderCursor(a) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
1801
1801
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("svg", { width: "18", height: "20", viewBox: "0 0 12 18", style: { display: "block", transform: a.pressed ? "scale(0.85)" : void 0, transformOrigin: "0 0", filter: "drop-shadow(0 1px 2px rgba(0,0,0,.35))" }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M0,0 L0,14 L4,10.5 L7,17 L9.5,16 L6.5,9.5 L11.5,9.5 Z", style: { fill: a.color, stroke: "#ffffff", strokeWidth: 1 } }) }),
1802
1802
  /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { style: { position: "absolute", left: 14, top: 16, display: "flex", flexDirection: "column", alignItems: "flex-start", gap: 4 }, children: [
1803
1803
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { style: { whiteSpace: "nowrap", borderRadius: 999, padding: "1px 7px", fontSize: 11, fontWeight: 600, color: "#ffffff", background: a.color }, children: a.name }),
1804
1804
  a.message && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { "data-actor-message": a.id, style: { width: "max-content", maxWidth: 240, borderRadius: 8, borderTopLeftRadius: 0, padding: "4px 8px", fontSize: 12, color: "#1e293b", background: "#ffffff", boxShadow: "0 4px 12px rgba(15,23,42,.18)" }, children: a.message })
1805
1805
  ] })
1806
- ] })
1806
+ ] }) })
1807
1807
  ] }, a.id);
1808
1808
  })
1809
1809
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useElementPlaybackSurface
3
- } from "../chunk-V2YC5T4R.js";
3
+ } from "../chunk-6CJEJTQB.js";
4
4
  import {
5
5
  KeyframeDiamond,
6
6
  ParameterColor,
@@ -28,7 +28,7 @@ import "../chunk-3I7FOSLF.js";
28
28
  import {
29
29
  PresenceLayer,
30
30
  useAgentPlayback
31
- } from "../chunk-GNO54NFG.js";
31
+ } from "../chunk-W5CMGX3I.js";
32
32
 
33
33
  // src/parameters/useParameters.ts
34
34
  import { useEffect, useMemo, useRef, useSyncExternalStore } from "react";
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import type { PresenceStore } from "@pixerate/editor/tools";
2
+ import type { PresenceActor, PresenceStore } from "@pixerate/editor/tools";
3
3
  export interface PresenceLayerProps {
4
4
  /** The cursors to draw, e.g. from `usePlaybackSurface` or a director. */
5
5
  presence: PresenceStore;
@@ -20,6 +20,11 @@ export interface PresenceLayerProps {
20
20
  });
21
21
  /** Clip the cursors to the layer's box (default true). `false` lets a cursor visit chrome outside it. */
22
22
  clip?: boolean;
23
+ /**
24
+ * Draws an actor's cursor in place of the default arrow, name tag and note (a host's own
25
+ * presence cursor). It is placed at the actor's point; the focus ring is still drawn.
26
+ */
27
+ renderCursor?: (actor: PresenceActor) => React.ReactNode;
23
28
  className?: string;
24
29
  }
25
30
  /**
@@ -27,4 +32,4 @@ export interface PresenceLayerProps {
27
32
  * in a `position: relative` box over the surface. It has the `pixerate-presence` class, so
28
33
  * snapshots and exports leave it out.
29
34
  */
30
- export declare function PresenceLayer({ presence, viewport, clip, className }: PresenceLayerProps): React.JSX.Element | null;
35
+ export declare function PresenceLayer({ presence, viewport, clip, renderCursor, className }: PresenceLayerProps): React.JSX.Element | null;
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import type { PresenceStore } from "@pixerate/editor/tools";
2
+ import type { PresenceActor, PresenceStore } from "@pixerate/editor/tools";
3
3
  export interface PresenceLayerProps {
4
4
  /** The cursors to draw, e.g. from `usePlaybackSurface` or a director. */
5
5
  presence: PresenceStore;
@@ -20,6 +20,11 @@ export interface PresenceLayerProps {
20
20
  });
21
21
  /** Clip the cursors to the layer's box (default true). `false` lets a cursor visit chrome outside it. */
22
22
  clip?: boolean;
23
+ /**
24
+ * Draws an actor's cursor in place of the default arrow, name tag and note (a host's own
25
+ * presence cursor). It is placed at the actor's point; the focus ring is still drawn.
26
+ */
27
+ renderCursor?: (actor: PresenceActor) => React.ReactNode;
23
28
  className?: string;
24
29
  }
25
30
  /**
@@ -27,4 +32,4 @@ export interface PresenceLayerProps {
27
32
  * in a `position: relative` box over the surface. It has the `pixerate-presence` class, so
28
33
  * snapshots and exports leave it out.
29
34
  */
30
- export declare function PresenceLayer({ presence, viewport, clip, className }: PresenceLayerProps): React.JSX.Element | null;
35
+ export declare function PresenceLayer({ presence, viewport, clip, renderCursor, className }: PresenceLayerProps): React.JSX.Element | null;
@@ -342,7 +342,7 @@ function usePlaybackSurface(playback, id, options = {}, sharedPresence) {
342
342
  // src/playback/PresenceLayer.tsx
343
343
  var import_react4 = __toESM(require("react"), 1);
344
344
  var import_jsx_runtime2 = require("react/jsx-runtime");
345
- function PresenceLayer({ presence, viewport, clip = true, className = "" }) {
345
+ function PresenceLayer({ presence, viewport, clip = true, renderCursor, className = "" }) {
346
346
  const { actors } = (0, import_react4.useSyncExternalStore)(presence.subscribe, presence.getState, presence.getState);
347
347
  if (!actors.length) return null;
348
348
  const map = typeof viewport === "function" ? viewport : viewport ? (p) => ({ x: p.x * viewport.zoom + viewport.x, y: p.y * viewport.zoom + viewport.y }) : (p) => p;
@@ -368,13 +368,13 @@ function PresenceLayer({ presence, viewport, clip = true, className = "" }) {
368
368
  style: { position: "absolute", ...ring, borderRadius: 8, border: `2px solid ${a.color}`, background: `${a.color}14`, transition: "all 160ms ease-out" }
369
369
  }
370
370
  ),
371
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { "data-actor": a.id, style: { position: "absolute", left: 0, top: 0, transform: `translate(${at.x}px, ${at.y}px)` }, children: [
371
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { "data-actor": a.id, style: { position: "absolute", left: 0, top: 0, transform: `translate(${at.x}px, ${at.y}px)` }, children: renderCursor ? renderCursor(a) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
372
372
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { width: "18", height: "20", viewBox: "0 0 12 18", style: { display: "block", transform: a.pressed ? "scale(0.85)" : void 0, transformOrigin: "0 0", filter: "drop-shadow(0 1px 2px rgba(0,0,0,.35))" }, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M0,0 L0,14 L4,10.5 L7,17 L9.5,16 L6.5,9.5 L11.5,9.5 Z", style: { fill: a.color, stroke: "#ffffff", strokeWidth: 1 } }) }),
373
373
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { style: { position: "absolute", left: 14, top: 16, display: "flex", flexDirection: "column", alignItems: "flex-start", gap: 4 }, children: [
374
374
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { style: { whiteSpace: "nowrap", borderRadius: 999, padding: "1px 7px", fontSize: 11, fontWeight: 600, color: "#ffffff", background: a.color }, children: a.name }),
375
375
  a.message && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { "data-actor-message": a.id, style: { width: "max-content", maxWidth: 240, borderRadius: 8, borderTopLeftRadius: 0, padding: "4px 8px", fontSize: 12, color: "#1e293b", background: "#ffffff", boxShadow: "0 4px 12px rgba(15,23,42,.18)" }, children: a.message })
376
376
  ] })
377
- ] })
377
+ ] }) })
378
378
  ] }, a.id);
379
379
  })
380
380
  }
@@ -12,8 +12,8 @@ import {
12
12
  useSpreadsheetClipboard,
13
13
  useSpreadsheetEditor,
14
14
  useSpreadsheetViewport
15
- } from "../chunk-VZ7HBWKL.js";
16
- import "../chunk-GNO54NFG.js";
15
+ } from "../chunk-EQ7Q5CBV.js";
16
+ import "../chunk-W5CMGX3I.js";
17
17
  export {
18
18
  FormulaHints,
19
19
  NameManager,
@@ -200,7 +200,7 @@ function usePlaybackSurface(playback, id, options = {}, sharedPresence) {
200
200
  // src/playback/PresenceLayer.tsx
201
201
  var import_react4 = __toESM(require("react"), 1);
202
202
  var import_jsx_runtime2 = require("react/jsx-runtime");
203
- function PresenceLayer({ presence, viewport, clip = true, className = "" }) {
203
+ function PresenceLayer({ presence, viewport, clip = true, renderCursor, className = "" }) {
204
204
  const { actors } = (0, import_react4.useSyncExternalStore)(presence.subscribe, presence.getState, presence.getState);
205
205
  if (!actors.length) return null;
206
206
  const map = typeof viewport === "function" ? viewport : viewport ? (p) => ({ x: p.x * viewport.zoom + viewport.x, y: p.y * viewport.zoom + viewport.y }) : (p) => p;
@@ -226,13 +226,13 @@ function PresenceLayer({ presence, viewport, clip = true, className = "" }) {
226
226
  style: { position: "absolute", ...ring, borderRadius: 8, border: `2px solid ${a.color}`, background: `${a.color}14`, transition: "all 160ms ease-out" }
227
227
  }
228
228
  ),
229
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { "data-actor": a.id, style: { position: "absolute", left: 0, top: 0, transform: `translate(${at.x}px, ${at.y}px)` }, children: [
229
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { "data-actor": a.id, style: { position: "absolute", left: 0, top: 0, transform: `translate(${at.x}px, ${at.y}px)` }, children: renderCursor ? renderCursor(a) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
230
230
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { width: "18", height: "20", viewBox: "0 0 12 18", style: { display: "block", transform: a.pressed ? "scale(0.85)" : void 0, transformOrigin: "0 0", filter: "drop-shadow(0 1px 2px rgba(0,0,0,.35))" }, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M0,0 L0,14 L4,10.5 L7,17 L9.5,16 L6.5,9.5 L11.5,9.5 Z", style: { fill: a.color, stroke: "#ffffff", strokeWidth: 1 } }) }),
231
231
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { style: { position: "absolute", left: 14, top: 16, display: "flex", flexDirection: "column", alignItems: "flex-start", gap: 4 }, children: [
232
232
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { style: { whiteSpace: "nowrap", borderRadius: 999, padding: "1px 7px", fontSize: 11, fontWeight: 600, color: "#ffffff", background: a.color }, children: a.name }),
233
233
  a.message && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { "data-actor-message": a.id, style: { width: "max-content", maxWidth: 240, borderRadius: 8, borderTopLeftRadius: 0, padding: "4px 8px", fontSize: 12, color: "#1e293b", background: "#ffffff", boxShadow: "0 4px 12px rgba(15,23,42,.18)" }, children: a.message })
234
234
  ] })
235
- ] })
235
+ ] }) })
236
236
  ] }, a.id);
237
237
  })
238
238
  }
@@ -11,7 +11,7 @@ import {
11
11
  PresenceLayer,
12
12
  useAgentPlayback,
13
13
  usePlaybackSurface
14
- } from "../chunk-GNO54NFG.js";
14
+ } from "../chunk-W5CMGX3I.js";
15
15
 
16
16
  // src/vector/useVectorEditor.ts
17
17
  import { useEffect, useMemo, useRef, useSyncExternalStore } from "react";
@@ -345,7 +345,7 @@ function usePlaybackSurface(playback, id, options = {}, sharedPresence) {
345
345
  // src/playback/PresenceLayer.tsx
346
346
  var import_react6 = __toESM(require("react"), 1);
347
347
  var import_jsx_runtime5 = require("react/jsx-runtime");
348
- function PresenceLayer({ presence, viewport, clip = true, className = "" }) {
348
+ function PresenceLayer({ presence, viewport, clip = true, renderCursor, className = "" }) {
349
349
  const { actors } = (0, import_react6.useSyncExternalStore)(presence.subscribe, presence.getState, presence.getState);
350
350
  if (!actors.length) return null;
351
351
  const map = typeof viewport === "function" ? viewport : viewport ? (p) => ({ x: p.x * viewport.zoom + viewport.x, y: p.y * viewport.zoom + viewport.y }) : (p) => p;
@@ -371,13 +371,13 @@ function PresenceLayer({ presence, viewport, clip = true, className = "" }) {
371
371
  style: { position: "absolute", ...ring, borderRadius: 8, border: `2px solid ${a.color}`, background: `${a.color}14`, transition: "all 160ms ease-out" }
372
372
  }
373
373
  ),
374
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { "data-actor": a.id, style: { position: "absolute", left: 0, top: 0, transform: `translate(${at.x}px, ${at.y}px)` }, children: [
374
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { "data-actor": a.id, style: { position: "absolute", left: 0, top: 0, transform: `translate(${at.x}px, ${at.y}px)` }, children: renderCursor ? renderCursor(a) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
375
375
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { width: "18", height: "20", viewBox: "0 0 12 18", style: { display: "block", transform: a.pressed ? "scale(0.85)" : void 0, transformOrigin: "0 0", filter: "drop-shadow(0 1px 2px rgba(0,0,0,.35))" }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("path", { d: "M0,0 L0,14 L4,10.5 L7,17 L9.5,16 L6.5,9.5 L11.5,9.5 Z", style: { fill: a.color, stroke: "#ffffff", strokeWidth: 1 } }) }),
376
376
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { style: { position: "absolute", left: 14, top: 16, display: "flex", flexDirection: "column", alignItems: "flex-start", gap: 4 }, children: [
377
377
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { style: { whiteSpace: "nowrap", borderRadius: 999, padding: "1px 7px", fontSize: 11, fontWeight: 600, color: "#ffffff", background: a.color }, children: a.name }),
378
378
  a.message && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { "data-actor-message": a.id, style: { width: "max-content", maxWidth: 240, borderRadius: 8, borderTopLeftRadius: 0, padding: "4px 8px", fontSize: 12, color: "#1e293b", background: "#ffffff", boxShadow: "0 4px 12px rgba(15,23,42,.18)" }, children: a.message })
379
379
  ] })
380
- ] })
380
+ ] }) })
381
381
  ] }, a.id);
382
382
  })
383
383
  }
@@ -12,7 +12,7 @@ import {
12
12
  PresenceLayer,
13
13
  useAgentPlayback,
14
14
  usePlaybackSurface
15
- } from "../chunk-GNO54NFG.js";
15
+ } from "../chunk-W5CMGX3I.js";
16
16
 
17
17
  // src/video-editor/useVideoEditor.ts
18
18
  import { useEffect, useMemo, useRef, useSyncExternalStore } from "react";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixerate/editor-react",
3
- "version": "0.153.0",
3
+ "version": "0.155.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.228.0 <1.0.0-0",
257
+ "@pixerate/editor": ">=0.230.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.228.0"
308
+ "@pixerate/editor": "0.230.0"
309
309
  },
310
310
  "scripts": {
311
311
  "build": "tsup && tsc -p tsconfig.build.json && node ../../scripts/finalize-declarations.mjs dist",