@pixerate/editor 0.252.0 → 0.254.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 (73) hide show
  1. package/dist/animation-editor/index.cjs +53 -53
  2. package/dist/animation-editor/index.js +2 -2
  3. package/dist/brushes/index.cjs +229 -2014
  4. package/dist/brushes/index.d.cts +5 -1
  5. package/dist/brushes/index.d.ts +5 -1
  6. package/dist/brushes/index.js +236 -2021
  7. package/dist/brushes/patch.d.cts +23 -0
  8. package/dist/brushes/patch.d.ts +23 -0
  9. package/dist/brushes/ui.d.cts +105 -0
  10. package/dist/brushes/ui.d.ts +105 -0
  11. package/dist/canvas/index.cjs +7 -7
  12. package/dist/canvas/index.js +1 -1
  13. package/dist/{chunk-QKXO6JPP.cjs → chunk-2OQGPEHH.cjs} +14 -14
  14. package/dist/chunk-34KLWUH4.cjs +2284 -0
  15. package/dist/{chunk-Z3BRH4JK.cjs → chunk-557BDWKO.cjs} +6 -6
  16. package/dist/{chunk-ZBCT5MEA.cjs → chunk-CBVNCWJM.cjs} +7 -7
  17. package/dist/{chunk-226QDRO3.js → chunk-DHQPRKXF.js} +1 -1
  18. package/dist/{chunk-ABL7IWFZ.js → chunk-GBEF2D4P.js} +1 -1
  19. package/dist/{chunk-ISIO63Q5.cjs → chunk-L2JTLW6B.cjs} +150 -25
  20. package/dist/{chunk-JA57JIT5.js → chunk-MV7CYFMJ.js} +133 -8
  21. package/dist/{chunk-5E2Q7ZHI.js → chunk-MWUZCEFT.js} +1 -1
  22. package/dist/chunk-QPHNVZHO.js +2284 -0
  23. package/dist/effects/conformance.d.cts +1 -0
  24. package/dist/effects/conformance.d.ts +1 -0
  25. package/dist/effects/fake.d.cts +7 -1
  26. package/dist/effects/fake.d.ts +7 -1
  27. package/dist/effects/helpers.d.cts +36 -4
  28. package/dist/effects/helpers.d.ts +36 -4
  29. package/dist/effects/index.cjs +331 -102
  30. package/dist/effects/index.js +238 -9
  31. package/dist/effects/types.d.cts +84 -5
  32. package/dist/effects/types.d.ts +84 -5
  33. package/dist/image-editor/index.cjs +15 -15
  34. package/dist/image-editor/index.js +1 -1
  35. package/dist/paint-editor/brush-controls.d.cts +57 -0
  36. package/dist/paint-editor/brush-controls.d.ts +57 -0
  37. package/dist/paint-editor/brush-library-tools.d.cts +15 -0
  38. package/dist/paint-editor/brush-library-tools.d.ts +15 -0
  39. package/dist/paint-editor/brush-library.d.cts +29 -0
  40. package/dist/paint-editor/brush-library.d.ts +29 -0
  41. package/dist/paint-editor/controller.d.cts +76 -17
  42. package/dist/paint-editor/controller.d.ts +76 -17
  43. package/dist/paint-editor/index.cjs +543 -858
  44. package/dist/paint-editor/index.d.cts +1 -0
  45. package/dist/paint-editor/index.d.ts +1 -0
  46. package/dist/paint-editor/index.js +329 -644
  47. package/dist/paint-editor/serialize.d.cts +7 -4
  48. package/dist/paint-editor/serialize.d.ts +7 -4
  49. package/dist/paint-editor/sticker-tools.d.cts +1 -1
  50. package/dist/paint-editor/sticker-tools.d.ts +1 -1
  51. package/dist/paint-editor/strokes.d.cts +10 -1
  52. package/dist/paint-editor/strokes.d.ts +10 -1
  53. package/dist/paint-editor/tools.d.cts +1 -1
  54. package/dist/paint-editor/tools.d.ts +1 -1
  55. package/dist/paint-editor/ui.d.cts +3 -51
  56. package/dist/paint-editor/ui.d.ts +3 -51
  57. package/dist/paint-editor/wet-tools.d.cts +1 -1
  58. package/dist/paint-editor/wet-tools.d.ts +1 -1
  59. package/dist/vector/index.cjs +6 -6
  60. package/dist/vector/index.js +1 -1
  61. package/dist/video-editor/index.cjs +344 -344
  62. package/dist/video-editor/index.js +4 -4
  63. package/package.json +1 -1
  64. package/skills/pixerate-brushes/SKILL.md +5 -3
  65. package/skills/pixerate-paint-editor/SKILL.md +26 -24
  66. package/skills/pixerate-paint-editor/references/brush-facets.md +30 -0
  67. package/skills/pixerate-paint-editor/references/gradient-paint.md +1 -1
  68. package/skills/pixerate-paint-editor/references/light-paint.md +2 -2
  69. package/skills/pixerate-paint-editor/references/oils.md +1 -1
  70. package/skills/pixerate-paint-editor/references/particle-brushes.md +8 -5
  71. package/skills/pixerate-paint-oil-impasto/SKILL.md +1 -1
  72. package/skills/pixerate-stickers/SKILL.md +1 -1
  73. package/skills/pixerate-video-editor/SKILL.md +1 -1
@@ -22,4 +22,5 @@ export interface EffectConformanceOptions {
22
22
  /** Also check sequence templates when supportsTemplates is true (default true). */
23
23
  templates?: boolean;
24
24
  }
25
+ /** Runs the contract checks against `provider` and returns every issue found (empty when it conforms). */
25
26
  export declare function checkEffectProvider(provider: EffectProvider, options?: EffectConformanceOptions): Promise<EffectConformanceIssue[]>;
@@ -22,4 +22,5 @@ export interface EffectConformanceOptions {
22
22
  /** Also check sequence templates when supportsTemplates is true (default true). */
23
23
  templates?: boolean;
24
24
  }
25
+ /** Runs the contract checks against `provider` and returns every issue found (empty when it conforms). */
25
26
  export declare function checkEffectProvider(provider: EffectProvider, options?: EffectConformanceOptions): Promise<EffectConformanceIssue[]>;
@@ -17,6 +17,10 @@
17
17
  * With `camera: true` it also has camera moves (no pixels): `glide` and `whip` (transitions; the
18
18
  * whip cuts halfway) and `drift` (a hold that zooms in slowly).
19
19
  *
20
+ * With `timing: true` it also has timing effects (no pixels; they retime video footage): `speed`
21
+ * (slow or fast, blending frames), `freeze` (holds one frame, then plays on) and `echo` (fading
22
+ * copies of the frames before, averaged or lightened).
23
+ *
20
24
  * With `templates: true` it also has two sequence templates (see `fake-templates.ts`):
21
25
  * `fake.title-sequence` and `fake.picture-reveal`.
22
26
  */
@@ -30,8 +34,10 @@ export interface FakeEffectProviderOptions {
30
34
  authoring?: boolean;
31
35
  /** Adds the camera moves and `cameraView` / `sampleCameraMove` (default false). */
32
36
  camera?: boolean;
37
+ /** Adds the timing effects and `timingLength` / `timingSample` (default false). */
38
+ timing?: boolean;
33
39
  /** Adds two sequence templates and `listTemplates` / `describeTemplate` / `instantiateTemplate` (default false). */
34
40
  templates?: boolean;
35
41
  }
36
- /** A deterministic CPU effects provider with seven effects, and camera moves and templates on request (see the module comment). */
42
+ /** A deterministic CPU effects provider with nine effects, and camera moves, timing effects and templates on request (see the module comment). */
37
43
  export declare function createFakeEffectProvider(options?: FakeEffectProviderOptions): EffectProvider;
@@ -17,6 +17,10 @@
17
17
  * With `camera: true` it also has camera moves (no pixels): `glide` and `whip` (transitions; the
18
18
  * whip cuts halfway) and `drift` (a hold that zooms in slowly).
19
19
  *
20
+ * With `timing: true` it also has timing effects (no pixels; they retime video footage): `speed`
21
+ * (slow or fast, blending frames), `freeze` (holds one frame, then plays on) and `echo` (fading
22
+ * copies of the frames before, averaged or lightened).
23
+ *
20
24
  * With `templates: true` it also has two sequence templates (see `fake-templates.ts`):
21
25
  * `fake.title-sequence` and `fake.picture-reveal`.
22
26
  */
@@ -30,8 +34,10 @@ export interface FakeEffectProviderOptions {
30
34
  authoring?: boolean;
31
35
  /** Adds the camera moves and `cameraView` / `sampleCameraMove` (default false). */
32
36
  camera?: boolean;
37
+ /** Adds the timing effects and `timingLength` / `timingSample` (default false). */
38
+ timing?: boolean;
33
39
  /** Adds two sequence templates and `listTemplates` / `describeTemplate` / `instantiateTemplate` (default false). */
34
40
  templates?: boolean;
35
41
  }
36
- /** A deterministic CPU effects provider with seven effects, and camera moves and templates on request (see the module comment). */
42
+ /** A deterministic CPU effects provider with nine effects, and camera moves, timing effects and templates on request (see the module comment). */
37
43
  export declare function createFakeEffectProvider(options?: FakeEffectProviderOptions): EffectProvider;
@@ -3,7 +3,7 @@
3
3
  * and a provider slot editors hold.
4
4
  */
5
5
  import { type SchemaValidationError } from '../tools/schema.cjs';
6
- import type { CameraMoveRole, CameraMoveSpec, CameraMoveSample, CameraMoveSampleRequest, CameraStage, CameraView, EffectDescription, EffectImageSource, EffectPixels, EffectProvider, EffectSearchOptions, EffectSummary, EffectUse, EffectValues } from './types.cjs';
6
+ import type { CameraMoveRole, CameraMoveSpec, CameraMoveSample, CameraMoveSampleRequest, CameraStage, CameraView, EffectDescription, EffectImageSource, EffectPixels, EffectProvider, EffectSearchOptions, EffectSummary, EffectUse, EffectValues, TimingBlend, TimingFrame, TimingSample, TimingSampleRequest } from './types.cjs';
7
7
  /** Problems with `values` against an effect's control schema (unknown controls, types, ranges). Partial values are fine. */
8
8
  export declare function effectValueErrors(description: Pick<EffectDescription, 'controls'>, values: unknown): SchemaValidationError[];
9
9
  /**
@@ -13,9 +13,9 @@ export declare function effectValueErrors(description: Pick<EffectDescription, '
13
13
  */
14
14
  export declare function resolveEffectValues(description: Pick<EffectDescription, 'id' | 'controls' | 'defaults'>, values?: EffectValues): Record<string, EffectValues[string]>;
15
15
  /**
16
- * Whether an editor offering `uses` should offer `e` (in a picker or an `effect` enum). Motion
17
- * and camera effects draw no picture of their own, so they are offered only where `uses` names
18
- * them (`motion`, `camera`); with no `uses`, every other effect is.
16
+ * Whether an editor offering `uses` should offer `e` (in a picker or an `effect` enum). Motion,
17
+ * camera and timing effects draw no picture of their own, so they are offered only where `uses`
18
+ * names them (`motion`, `camera`, `timing`); with no `uses`, every other effect is.
19
19
  */
20
20
  export declare function effectOffered(e: Pick<EffectSummary, 'kind' | 'uses'>, uses?: readonly EffectUse[]): boolean;
21
21
  /** A tag as tags are compared: trimmed, lower case, spaces and underscores as single hyphens (`"Game Boy"` → `game-boy`). */
@@ -128,3 +128,35 @@ export interface CameraBox {
128
128
  export declare function cameraViewOfBox(box: CameraBox, stage: CameraStage): CameraView;
129
129
  /** The box of the scene a view shows on `stage` (its tilt, turn, roll and blur aside). */
130
130
  export declare function cameraBoxOfView(view: CameraView, stage: CameraStage): CameraBox;
131
+ /** Throws `EffectUnsupportedError` unless `footageMs` is a footage length a timing effect takes (a number of ms > 0). */
132
+ export declare function checkTimingFootage(footageMs: number, id?: string): void;
133
+ /**
134
+ * Checks a timing request (footage, time and fps), throwing `EffectUnsupportedError` with a
135
+ * sentence naming the valid range, and gives its fps (default `TIMING_DEFAULT_FPS`).
136
+ */
137
+ export declare function checkTimingRequest(request: TimingSampleRequest, id?: string): number;
138
+ /**
139
+ * Raw footage frames (any times, any positive weights) as a `TimingSample`: each time held within
140
+ * the footage and moved to the start of its frame, frames on the same footage frame merged, at
141
+ * most `TIMING_MAX_FRAMES` (evenly spaced), weights scaled to add up to 1, earliest first. Frames
142
+ * with a time or weight that is not a finite number, or a weight ≤ 0, are dropped; with none left,
143
+ * the sample is the frame at `request.time`. Providers can build `timingSample` on it.
144
+ */
145
+ export declare function normaliseTimingSample(raw: readonly TimingFrame[], request: TimingSampleRequest, blend?: TimingBlend): TimingSample;
146
+ /**
147
+ * What is wrong with `sample` as the answer to `request` (see `TimingSample`), as sentences; empty
148
+ * when it keeps every rule. `checkEffectProvider` uses it; hosts can check a provider's samples
149
+ * with it.
150
+ */
151
+ export declare function timingSampleProblems(sample: unknown, request: TimingSampleRequest): string[];
152
+ /**
153
+ * Blends footage frames by weight as a timing sample says (see `TimingBlend`): the reference for
154
+ * hosts that blend in their own pipeline, and a ready blend for `EffectPixels`. Reads and writes
155
+ * 8-bit `data` (straight alpha, rounded); `float` is not used. Writes into `out` when given (the
156
+ * frames' size), else a new picture. Throws `EffectUnsupportedError` for no frames or frames of
157
+ * different sizes.
158
+ */
159
+ export declare function blendTimingFrames(frames: readonly {
160
+ pixels: EffectPixels;
161
+ weight: number;
162
+ }[], blend: TimingBlend, out?: EffectPixels): EffectPixels;
@@ -3,7 +3,7 @@
3
3
  * and a provider slot editors hold.
4
4
  */
5
5
  import { type SchemaValidationError } from '../tools/schema.js';
6
- import type { CameraMoveRole, CameraMoveSpec, CameraMoveSample, CameraMoveSampleRequest, CameraStage, CameraView, EffectDescription, EffectImageSource, EffectPixels, EffectProvider, EffectSearchOptions, EffectSummary, EffectUse, EffectValues } from './types.js';
6
+ import type { CameraMoveRole, CameraMoveSpec, CameraMoveSample, CameraMoveSampleRequest, CameraStage, CameraView, EffectDescription, EffectImageSource, EffectPixels, EffectProvider, EffectSearchOptions, EffectSummary, EffectUse, EffectValues, TimingBlend, TimingFrame, TimingSample, TimingSampleRequest } from './types.js';
7
7
  /** Problems with `values` against an effect's control schema (unknown controls, types, ranges). Partial values are fine. */
8
8
  export declare function effectValueErrors(description: Pick<EffectDescription, 'controls'>, values: unknown): SchemaValidationError[];
9
9
  /**
@@ -13,9 +13,9 @@ export declare function effectValueErrors(description: Pick<EffectDescription, '
13
13
  */
14
14
  export declare function resolveEffectValues(description: Pick<EffectDescription, 'id' | 'controls' | 'defaults'>, values?: EffectValues): Record<string, EffectValues[string]>;
15
15
  /**
16
- * Whether an editor offering `uses` should offer `e` (in a picker or an `effect` enum). Motion
17
- * and camera effects draw no picture of their own, so they are offered only where `uses` names
18
- * them (`motion`, `camera`); with no `uses`, every other effect is.
16
+ * Whether an editor offering `uses` should offer `e` (in a picker or an `effect` enum). Motion,
17
+ * camera and timing effects draw no picture of their own, so they are offered only where `uses`
18
+ * names them (`motion`, `camera`, `timing`); with no `uses`, every other effect is.
19
19
  */
20
20
  export declare function effectOffered(e: Pick<EffectSummary, 'kind' | 'uses'>, uses?: readonly EffectUse[]): boolean;
21
21
  /** A tag as tags are compared: trimmed, lower case, spaces and underscores as single hyphens (`"Game Boy"` → `game-boy`). */
@@ -128,3 +128,35 @@ export interface CameraBox {
128
128
  export declare function cameraViewOfBox(box: CameraBox, stage: CameraStage): CameraView;
129
129
  /** The box of the scene a view shows on `stage` (its tilt, turn, roll and blur aside). */
130
130
  export declare function cameraBoxOfView(view: CameraView, stage: CameraStage): CameraBox;
131
+ /** Throws `EffectUnsupportedError` unless `footageMs` is a footage length a timing effect takes (a number of ms > 0). */
132
+ export declare function checkTimingFootage(footageMs: number, id?: string): void;
133
+ /**
134
+ * Checks a timing request (footage, time and fps), throwing `EffectUnsupportedError` with a
135
+ * sentence naming the valid range, and gives its fps (default `TIMING_DEFAULT_FPS`).
136
+ */
137
+ export declare function checkTimingRequest(request: TimingSampleRequest, id?: string): number;
138
+ /**
139
+ * Raw footage frames (any times, any positive weights) as a `TimingSample`: each time held within
140
+ * the footage and moved to the start of its frame, frames on the same footage frame merged, at
141
+ * most `TIMING_MAX_FRAMES` (evenly spaced), weights scaled to add up to 1, earliest first. Frames
142
+ * with a time or weight that is not a finite number, or a weight ≤ 0, are dropped; with none left,
143
+ * the sample is the frame at `request.time`. Providers can build `timingSample` on it.
144
+ */
145
+ export declare function normaliseTimingSample(raw: readonly TimingFrame[], request: TimingSampleRequest, blend?: TimingBlend): TimingSample;
146
+ /**
147
+ * What is wrong with `sample` as the answer to `request` (see `TimingSample`), as sentences; empty
148
+ * when it keeps every rule. `checkEffectProvider` uses it; hosts can check a provider's samples
149
+ * with it.
150
+ */
151
+ export declare function timingSampleProblems(sample: unknown, request: TimingSampleRequest): string[];
152
+ /**
153
+ * Blends footage frames by weight as a timing sample says (see `TimingBlend`): the reference for
154
+ * hosts that blend in their own pipeline, and a ready blend for `EffectPixels`. Reads and writes
155
+ * 8-bit `data` (straight alpha, rounded); `float` is not used. Writes into `out` when given (the
156
+ * frames' size), else a new picture. Throws `EffectUnsupportedError` for no frames or frames of
157
+ * different sizes.
158
+ */
159
+ export declare function blendTimingFrames(frames: readonly {
160
+ pixels: EffectPixels;
161
+ weight: number;
162
+ }[], blend: TimingBlend, out?: EffectPixels): EffectPixels;