@pixerate/editor-react 0.92.0 → 0.94.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 (51) hide show
  1. package/dist/animation-editor/AnimationEditor.d.cts +14 -3
  2. package/dist/animation-editor/AnimationEditor.d.ts +14 -3
  3. package/dist/animation-editor/AnimationRecordPanel.d.cts +17 -0
  4. package/dist/animation-editor/AnimationRecordPanel.d.ts +17 -0
  5. package/dist/animation-editor/AnimationStage.d.cts +8 -2
  6. package/dist/animation-editor/AnimationStage.d.ts +8 -2
  7. package/dist/animation-editor/index.cjs +607 -405
  8. package/dist/animation-editor/index.d.cts +1 -0
  9. package/dist/animation-editor/index.d.ts +1 -0
  10. package/dist/animation-editor/index.js +359 -242
  11. package/dist/canvas/index.cjs +3 -2
  12. package/dist/canvas/index.js +4 -4
  13. package/dist/chart/ChartEditor.d.cts +12 -1
  14. package/dist/chart/ChartEditor.d.ts +12 -1
  15. package/dist/chart/index.cjs +187 -29
  16. package/dist/chart/index.js +74 -10
  17. package/dist/{chunk-6MDTFAPY.js → chunk-6YRSQW2V.js} +5 -5
  18. package/dist/chunk-7I73DW4V.js +43 -0
  19. package/dist/{chunk-GML6BYCN.js → chunk-GECXTPSH.js} +53 -3
  20. package/dist/{chunk-ECBC4HD7.js → chunk-IPVWWVSF.js} +3 -2
  21. package/dist/image-editor/index.cjs +3 -2
  22. package/dist/image-editor/index.js +2 -2
  23. package/dist/index.cjs +609 -527
  24. package/dist/index.js +10 -6
  25. package/dist/paint-editor/PaintEditor.d.cts +12 -1
  26. package/dist/paint-editor/PaintEditor.d.ts +12 -1
  27. package/dist/paint-editor/index.cjs +319 -164
  28. package/dist/paint-editor/index.js +84 -11
  29. package/dist/parameters/ParametersPanel.d.cts +11 -1
  30. package/dist/parameters/ParametersPanel.d.ts +11 -1
  31. package/dist/parameters/index.cjs +190 -41
  32. package/dist/parameters/index.js +23 -4
  33. package/dist/playback/index.d.cts +1 -0
  34. package/dist/playback/index.d.ts +1 -0
  35. package/dist/playback/useElementPlaybackSurface.d.cts +19 -0
  36. package/dist/playback/useElementPlaybackSurface.d.ts +19 -0
  37. package/dist/playback/usePlaybackSurface.d.cts +3 -1
  38. package/dist/playback/usePlaybackSurface.d.ts +3 -1
  39. package/dist/spreadsheet/SpreadsheetEditor.d.cts +10 -0
  40. package/dist/spreadsheet/SpreadsheetEditor.d.ts +10 -0
  41. package/dist/spreadsheet/index.cjs +443 -313
  42. package/dist/spreadsheet/index.js +2 -1
  43. package/dist/vector/index.cjs +3 -2
  44. package/dist/vector/index.js +5 -5
  45. package/dist/video-editor/VideoEditor.d.cts +6 -1
  46. package/dist/video-editor/VideoEditor.d.ts +6 -1
  47. package/dist/video-editor/VideoTimeline.d.cts +11 -1
  48. package/dist/video-editor/VideoTimeline.d.ts +11 -1
  49. package/dist/video-editor/index.cjs +463 -332
  50. package/dist/video-editor/index.js +53 -5
  51. package/package.json +3 -3
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import type { AgentPlayback } from '@pixerate/editor/tools';
2
3
  import { type AnimationEditorController, type MotionFrameOptions, type MotionOnionSkin } from '@pixerate/editor/animation-editor';
3
4
  import type { EffectProvider } from '@pixerate/editor/effects';
4
5
  export interface AnimationEditorProps {
@@ -23,11 +24,21 @@ export interface AnimationEditorProps {
23
24
  */
24
25
  effects?: EffectProvider | null;
25
26
  className?: string;
27
+ /**
28
+ * Agent playback: act out the animation tools' calls here with the agent's cursor (default: the
29
+ * nearest `AgentPlaybackProvider`; `null` turns it off).
30
+ */
31
+ playback?: AgentPlayback | null;
32
+ /** The playback surface id (default `animation`, where the animation tool providers play). */
33
+ playbackId?: string;
34
+ /** Bring the editor on screen (switch to its tab) before the agent acts. */
35
+ onPlaybackReveal?: () => void | Promise<void>;
26
36
  }
27
37
  /**
28
38
  * A whole animation editor for an `AnimationEditorController`: the stage (click an element to
29
39
  * pick it, shift-click to add it to or remove it from the selected command's targets), the
30
- * playhead scrubber, and panels to edit commands, shots and scene settings by hand. Every edit
31
- * is one undo step.
40
+ * playhead scrubber, a Record button to perform changes live on the stage and keep them as a
41
+ * shot, and panels to edit commands, shots and scene settings by hand. Every edit is one undo
42
+ * step.
32
43
  */
33
- export declare function AnimationEditor({ controller, values, onionSkin, motionPaths, showIssues, editable, effects, className }: AnimationEditorProps): React.JSX.Element;
44
+ export declare function AnimationEditor({ controller, values, onionSkin, motionPaths, showIssues, editable, effects, className, playback, playbackId, onPlaybackReveal }: AnimationEditorProps): React.JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import type { AgentPlayback } from '@pixerate/editor/tools';
2
3
  import { type AnimationEditorController, type MotionFrameOptions, type MotionOnionSkin } from '@pixerate/editor/animation-editor';
3
4
  import type { EffectProvider } from '@pixerate/editor/effects';
4
5
  export interface AnimationEditorProps {
@@ -23,11 +24,21 @@ export interface AnimationEditorProps {
23
24
  */
24
25
  effects?: EffectProvider | null;
25
26
  className?: string;
27
+ /**
28
+ * Agent playback: act out the animation tools' calls here with the agent's cursor (default: the
29
+ * nearest `AgentPlaybackProvider`; `null` turns it off).
30
+ */
31
+ playback?: AgentPlayback | null;
32
+ /** The playback surface id (default `animation`, where the animation tool providers play). */
33
+ playbackId?: string;
34
+ /** Bring the editor on screen (switch to its tab) before the agent acts. */
35
+ onPlaybackReveal?: () => void | Promise<void>;
26
36
  }
27
37
  /**
28
38
  * A whole animation editor for an `AnimationEditorController`: the stage (click an element to
29
39
  * pick it, shift-click to add it to or remove it from the selected command's targets), the
30
- * playhead scrubber, and panels to edit commands, shots and scene settings by hand. Every edit
31
- * is one undo step.
40
+ * playhead scrubber, a Record button to perform changes live on the stage and keep them as a
41
+ * shot, and panels to edit commands, shots and scene settings by hand. Every edit is one undo
42
+ * step.
32
43
  */
33
- export declare function AnimationEditor({ controller, values, onionSkin, motionPaths, showIssues, editable, effects, className }: AnimationEditorProps): React.JSX.Element;
44
+ export declare function AnimationEditor({ controller, values, onionSkin, motionPaths, showIssues, editable, effects, className, playback, playbackId, onPlaybackReveal }: AnimationEditorProps): React.JSX.Element;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { type AnimationEditorController, type MotionRecordGestureMode } from '@pixerate/editor/animation-editor';
3
+ export interface AnimationRecordPanelProps {
4
+ controller: AnimationEditorController;
5
+ /** The element the paint and opacity controls record (e.g. the one picked on the stage). */
6
+ node?: string | null;
7
+ /** What a stage drag does while recording (pass the same to `<AnimationStage recordMode>`). */
8
+ mode: MotionRecordGestureMode;
9
+ onModeChange: (mode: MotionRecordGestureMode) => void;
10
+ className?: string;
11
+ }
12
+ /**
13
+ * Record a take: Record plays on from the end of the scene while you drag elements on the stage
14
+ * (moving, scaling or turning them, as `mode` says) and change the picked element's paint and
15
+ * opacity; Stop keeps the performance as a new shot of ordinary commands, one undo step.
16
+ */
17
+ export declare function AnimationRecordPanel({ controller, node, mode, onModeChange, className }: AnimationRecordPanelProps): React.JSX.Element;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { type AnimationEditorController, type MotionRecordGestureMode } from '@pixerate/editor/animation-editor';
3
+ export interface AnimationRecordPanelProps {
4
+ controller: AnimationEditorController;
5
+ /** The element the paint and opacity controls record (e.g. the one picked on the stage). */
6
+ node?: string | null;
7
+ /** What a stage drag does while recording (pass the same to `<AnimationStage recordMode>`). */
8
+ mode: MotionRecordGestureMode;
9
+ onModeChange: (mode: MotionRecordGestureMode) => void;
10
+ className?: string;
11
+ }
12
+ /**
13
+ * Record a take: Record plays on from the end of the scene while you drag elements on the stage
14
+ * (moving, scaling or turning them, as `mode` says) and change the picked element's paint and
15
+ * opacity; Stop keeps the performance as a new shot of ordinary commands, one undo step.
16
+ */
17
+ export declare function AnimationRecordPanel({ controller, node, mode, onModeChange, className }: AnimationRecordPanelProps): React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { type AnimationEditorController, type MotionFrameOptions, type MotionOnionSkin } from '@pixerate/editor/animation-editor';
2
+ import { type AnimationEditorController, type MotionFrameOptions, type MotionOnionSkin, type MotionRecordGestureMode } from '@pixerate/editor/animation-editor';
3
3
  export interface AnimationStageProps {
4
4
  controller: AnimationEditorController;
5
5
  /** Control values to preview (`{ accent: "#0ea5e9" }`). */
@@ -15,10 +15,16 @@ export interface AnimationStageProps {
15
15
  onPick?: (id: string | null, event: React.MouseEvent<HTMLDivElement>) => void;
16
16
  /** Node ids to outline (e.g. the picked element and the selected command's targets). */
17
17
  highlight?: readonly string[];
18
+ /**
19
+ * While the controller records a take (`startRecording`), what dragging an element does:
20
+ * `move` it, `scale` it about its centre or `rotate` it (default `move`). Each pointer move
21
+ * is a sample of the take.
22
+ */
23
+ recordMode?: MotionRecordGestureMode;
18
24
  className?: string;
19
25
  }
20
26
  /**
21
27
  * The animation's frame at the playhead, drawn as inline SVG scaled to the stage's width. The
22
28
  * SVG keeps the artwork's node ids, so `onPick` can say which element was clicked.
23
29
  */
24
- export declare function AnimationStage({ controller, values, onionSkin, motionPaths, onPick, highlight, className }: AnimationStageProps): React.JSX.Element;
30
+ export declare function AnimationStage({ controller, values, onionSkin, motionPaths, onPick, highlight, recordMode, className }: AnimationStageProps): React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { type AnimationEditorController, type MotionFrameOptions, type MotionOnionSkin } from '@pixerate/editor/animation-editor';
2
+ import { type AnimationEditorController, type MotionFrameOptions, type MotionOnionSkin, type MotionRecordGestureMode } from '@pixerate/editor/animation-editor';
3
3
  export interface AnimationStageProps {
4
4
  controller: AnimationEditorController;
5
5
  /** Control values to preview (`{ accent: "#0ea5e9" }`). */
@@ -15,10 +15,16 @@ export interface AnimationStageProps {
15
15
  onPick?: (id: string | null, event: React.MouseEvent<HTMLDivElement>) => void;
16
16
  /** Node ids to outline (e.g. the picked element and the selected command's targets). */
17
17
  highlight?: readonly string[];
18
+ /**
19
+ * While the controller records a take (`startRecording`), what dragging an element does:
20
+ * `move` it, `scale` it about its centre or `rotate` it (default `move`). Each pointer move
21
+ * is a sample of the take.
22
+ */
23
+ recordMode?: MotionRecordGestureMode;
18
24
  className?: string;
19
25
  }
20
26
  /**
21
27
  * The animation's frame at the playhead, drawn as inline SVG scaled to the stage's width. The
22
28
  * SVG keeps the artwork's node ids, so `onPick` can say which element was clicked.
23
29
  */
24
- export declare function AnimationStage({ controller, values, onionSkin, motionPaths, onPick, highlight, className }: AnimationStageProps): React.JSX.Element;
30
+ export declare function AnimationStage({ controller, values, onionSkin, motionPaths, onPick, highlight, recordMode, className }: AnimationStageProps): React.JSX.Element;