@pixerate/editor-react 0.105.0 → 0.107.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 (45) hide show
  1. package/dist/animation-editor/index.cjs +2 -1
  2. package/dist/animation-editor/index.js +1 -1
  3. package/dist/canvas/index.cjs +2 -1
  4. package/dist/canvas/index.js +1 -1
  5. package/dist/{chunk-CEV4OEOY.js → chunk-6XI62THS.js} +1 -1
  6. package/dist/{chunk-Q7LAFHGP.js → chunk-ZQ6H2C7N.js} +2 -1
  7. package/dist/effects/EffectParameters.d.cts +4 -2
  8. package/dist/effects/EffectParameters.d.ts +4 -2
  9. package/dist/effects/index.cjs +2 -1
  10. package/dist/effects/index.js +1 -1
  11. package/dist/image-editor/index.cjs +2 -1
  12. package/dist/image-editor/index.js +2 -2
  13. package/dist/index.cjs +2 -1
  14. package/dist/index.js +2 -2
  15. package/dist/paint-editor/index.cjs +2 -1
  16. package/dist/paint-editor/index.js +1 -1
  17. package/dist/typography/FontPicker.d.cts +48 -0
  18. package/dist/typography/FontPicker.d.ts +48 -0
  19. package/dist/typography/TypographyControl.d.cts +11 -0
  20. package/dist/typography/TypographyControl.d.ts +11 -0
  21. package/dist/typography/index.cjs +328 -0
  22. package/dist/typography/index.d.cts +7 -0
  23. package/dist/typography/index.d.ts +7 -0
  24. package/dist/typography/index.js +299 -0
  25. package/dist/typography/useFontPicker.d.cts +17 -0
  26. package/dist/typography/useFontPicker.d.ts +17 -0
  27. package/dist/vector/index.cjs +2 -1
  28. package/dist/vector/index.js +1 -1
  29. package/dist/video-editor/EditPlanPreview.d.cts +16 -0
  30. package/dist/video-editor/EditPlanPreview.d.ts +16 -0
  31. package/dist/video-editor/TranscriptEditor.d.cts +20 -0
  32. package/dist/video-editor/TranscriptEditor.d.ts +20 -0
  33. package/dist/video-editor/VideoEditor.d.cts +7 -1
  34. package/dist/video-editor/VideoEditor.d.ts +7 -1
  35. package/dist/video-editor/VideoTransport.d.cts +2 -1
  36. package/dist/video-editor/VideoTransport.d.ts +2 -1
  37. package/dist/video-editor/index.cjs +1054 -260
  38. package/dist/video-editor/index.d.cts +3 -0
  39. package/dist/video-editor/index.d.ts +3 -0
  40. package/dist/video-editor/index.js +438 -70
  41. package/dist/video-editor/useTranscriptVideo.d.cts +8 -0
  42. package/dist/video-editor/useTranscriptVideo.d.ts +8 -0
  43. package/dist/video-editor/useVideoEditor.d.cts +12 -1
  44. package/dist/video-editor/useVideoEditor.d.ts +12 -1
  45. package/package.json +16 -3
@@ -2699,10 +2699,11 @@ function EffectParameters({
2699
2699
  onPreset,
2700
2700
  onPresetName,
2701
2701
  renderControlAddon,
2702
+ fonts,
2702
2703
  disabled = false,
2703
2704
  className = ""
2704
2705
  }) {
2705
- const fields = (0, import_react19.useMemo)(() => (0, import_effects3.effectParameterFields)(description), [description]);
2706
+ const fields = (0, import_react19.useMemo)(() => (0, import_effects3.effectParameterFields)(description, { fonts }), [description, fonts]);
2706
2707
  const idBase = (0, import_react19.useId)();
2707
2708
  const gesture = import_react19.default.useRef(null);
2708
2709
  const count = import_react19.default.useRef(0);
@@ -3,7 +3,7 @@ import {
3
3
  EffectsBrowser,
4
4
  useEffectDescription,
5
5
  useEffects
6
- } from "../chunk-Q7LAFHGP.js";
6
+ } from "../chunk-ZQ6H2C7N.js";
7
7
  import "../chunk-5LFQ2UQZ.js";
8
8
  import "../chunk-KIRIU53A.js";
9
9
  import "../chunk-3I7FOSLF.js";
@@ -3454,10 +3454,11 @@ function EffectParameters({
3454
3454
  onPreset,
3455
3455
  onPresetName,
3456
3456
  renderControlAddon,
3457
+ fonts,
3457
3458
  disabled = false,
3458
3459
  className = ""
3459
3460
  }) {
3460
- const fields = (0, import_react27.useMemo)(() => (0, import_effects3.effectParameterFields)(description), [description]);
3461
+ const fields = (0, import_react27.useMemo)(() => (0, import_effects3.effectParameterFields)(description, { fonts }), [description, fonts]);
3461
3462
  const idBase = (0, import_react27.useId)();
3462
3463
  const gesture = import_react27.default.useRef(null);
3463
3464
  const count = import_react27.default.useRef(0);
@@ -2,7 +2,7 @@ import {
2
2
  EffectParameters,
3
3
  EffectsBrowser,
4
4
  useEffectDescription
5
- } from "../chunk-Q7LAFHGP.js";
5
+ } from "../chunk-ZQ6H2C7N.js";
6
6
  import "../chunk-5LFQ2UQZ.js";
7
7
  import "../chunk-KIRIU53A.js";
8
8
  import "../chunk-3I7FOSLF.js";
@@ -6,7 +6,7 @@ import {
6
6
  EffectsBrowser,
7
7
  useEffectDescription,
8
8
  useEffects
9
- } from "./chunk-Q7LAFHGP.js";
9
+ } from "./chunk-ZQ6H2C7N.js";
10
10
  import {
11
11
  PresenceLayer,
12
12
  useAgentPlayback,
@@ -152,10 +152,11 @@ function EffectParameters({
152
152
  onPreset,
153
153
  onPresetName,
154
154
  renderControlAddon,
155
+ fonts,
155
156
  disabled = false,
156
157
  className = ""
157
158
  }) {
158
- const fields = useMemo2(() => effectParameterFields(description), [description]);
159
+ const fields = useMemo2(() => effectParameterFields(description, { fonts }), [description, fonts]);
159
160
  const idBase = useId();
160
161
  const gesture = React3.useRef(null);
161
162
  const count = React3.useRef(0);
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { type EffectDescription } from '@pixerate/editor/effects';
2
+ import { type EffectDescription, type EffectFieldOptions } from '@pixerate/editor/effects';
3
3
  import { type ParameterValue } from '@pixerate/editor/parameters';
4
4
  export interface EffectParametersProps {
5
5
  /** The effect's description (`describe`). */
@@ -21,6 +21,8 @@ export interface EffectParametersProps {
21
21
  onPresetName?: (name: string) => void;
22
22
  /** Optional addon rendered next to the control label (e.g. keyframe toggle button). */
23
23
  renderControlAddon?: (control: string) => React.ReactNode;
24
+ /** Families offered by font controls (`format: "font"`); default the system font catalog. */
25
+ fonts?: EffectFieldOptions['fonts'];
24
26
  disabled?: boolean;
25
27
  className?: string;
26
28
  }
@@ -29,4 +31,4 @@ export interface EffectParametersProps {
29
31
  * numbers, switches, choices, colour pickers, vectors and text, with each control's description,
30
32
  * per-control reset and the effect's presets.
31
33
  */
32
- export declare function EffectParameters({ description, values, onChange, onReset, keyframed, onPreset, onPresetName, renderControlAddon, disabled, className }: EffectParametersProps): React.JSX.Element;
34
+ export declare function EffectParameters({ description, values, onChange, onReset, keyframed, onPreset, onPresetName, renderControlAddon, fonts, disabled, className }: EffectParametersProps): React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { type EffectDescription } from '@pixerate/editor/effects';
2
+ import { type EffectDescription, type EffectFieldOptions } from '@pixerate/editor/effects';
3
3
  import { type ParameterValue } from '@pixerate/editor/parameters';
4
4
  export interface EffectParametersProps {
5
5
  /** The effect's description (`describe`). */
@@ -21,6 +21,8 @@ export interface EffectParametersProps {
21
21
  onPresetName?: (name: string) => void;
22
22
  /** Optional addon rendered next to the control label (e.g. keyframe toggle button). */
23
23
  renderControlAddon?: (control: string) => React.ReactNode;
24
+ /** Families offered by font controls (`format: "font"`); default the system font catalog. */
25
+ fonts?: EffectFieldOptions['fonts'];
24
26
  disabled?: boolean;
25
27
  className?: string;
26
28
  }
@@ -29,4 +31,4 @@ export interface EffectParametersProps {
29
31
  * numbers, switches, choices, colour pickers, vectors and text, with each control's description,
30
32
  * per-control reset and the effect's presets.
31
33
  */
32
- export declare function EffectParameters({ description, values, onChange, onReset, keyframed, onPreset, onPresetName, renderControlAddon, disabled, className }: EffectParametersProps): React.JSX.Element;
34
+ export declare function EffectParameters({ description, values, onChange, onReset, keyframed, onPreset, onPresetName, renderControlAddon, fonts, disabled, className }: EffectParametersProps): React.JSX.Element;
@@ -1599,10 +1599,11 @@ function EffectParameters({
1599
1599
  onPreset,
1600
1600
  onPresetName,
1601
1601
  renderControlAddon,
1602
+ fonts,
1602
1603
  disabled = false,
1603
1604
  className = ""
1604
1605
  }) {
1605
- const fields = (0, import_react8.useMemo)(() => (0, import_effects3.effectParameterFields)(description), [description]);
1606
+ const fields = (0, import_react8.useMemo)(() => (0, import_effects3.effectParameterFields)(description, { fonts }), [description, fonts]);
1606
1607
  const idBase = (0, import_react8.useId)();
1607
1608
  const gesture = import_react8.default.useRef(null);
1608
1609
  const count = import_react8.default.useRef(0);
@@ -6,7 +6,7 @@ import {
6
6
  useEffectAuthoring,
7
7
  useEffectDescription,
8
8
  useEffects
9
- } from "../chunk-Q7LAFHGP.js";
9
+ } from "../chunk-ZQ6H2C7N.js";
10
10
  import "../chunk-5LFQ2UQZ.js";
11
11
  import "../chunk-KIRIU53A.js";
12
12
  import "../chunk-3I7FOSLF.js";
@@ -3677,10 +3677,11 @@ function EffectParameters({
3677
3677
  onPreset,
3678
3678
  onPresetName,
3679
3679
  renderControlAddon,
3680
+ fonts,
3680
3681
  disabled = false,
3681
3682
  className = ""
3682
3683
  }) {
3683
- const fields = (0, import_react18.useMemo)(() => (0, import_effects3.effectParameterFields)(description), [description]);
3684
+ const fields = (0, import_react18.useMemo)(() => (0, import_effects3.effectParameterFields)(description, { fonts }), [description, fonts]);
3684
3685
  const idBase = (0, import_react18.useId)();
3685
3686
  const gesture = import_react18.default.useRef(null);
3686
3687
  const count = import_react18.default.useRef(0);
@@ -20,9 +20,9 @@ import {
20
20
  useImageEditor,
21
21
  useImageEffectsTools,
22
22
  useImageHistogram
23
- } from "../chunk-CEV4OEOY.js";
23
+ } from "../chunk-6XI62THS.js";
24
24
  import "../chunk-AJCWF6SN.js";
25
- import "../chunk-Q7LAFHGP.js";
25
+ import "../chunk-ZQ6H2C7N.js";
26
26
  import "../chunk-5LFQ2UQZ.js";
27
27
  import "../chunk-KIRIU53A.js";
28
28
  import "../chunk-3I7FOSLF.js";
package/dist/index.cjs CHANGED
@@ -7384,10 +7384,11 @@ function EffectParameters({
7384
7384
  onPreset,
7385
7385
  onPresetName,
7386
7386
  renderControlAddon,
7387
+ fonts,
7387
7388
  disabled = false,
7388
7389
  className = ""
7389
7390
  }) {
7390
- const fields = (0, import_react54.useMemo)(() => (0, import_effects3.effectParameterFields)(description), [description]);
7391
+ const fields = (0, import_react54.useMemo)(() => (0, import_effects3.effectParameterFields)(description, { fonts }), [description, fonts]);
7391
7392
  const idBase = (0, import_react54.useId)();
7392
7393
  const gesture = import_react54.default.useRef(null);
7393
7394
  const count = import_react54.default.useRef(0);
package/dist/index.js CHANGED
@@ -44,9 +44,9 @@ import {
44
44
  useImageEditor,
45
45
  useImageEffectsTools,
46
46
  useImageHistogram
47
- } from "./chunk-CEV4OEOY.js";
47
+ } from "./chunk-6XI62THS.js";
48
48
  import "./chunk-AJCWF6SN.js";
49
- import "./chunk-Q7LAFHGP.js";
49
+ import "./chunk-ZQ6H2C7N.js";
50
50
  import "./chunk-5LFQ2UQZ.js";
51
51
  import "./chunk-KIRIU53A.js";
52
52
  import "./chunk-3I7FOSLF.js";
@@ -2987,10 +2987,11 @@ function EffectParameters({
2987
2987
  onPreset,
2988
2988
  onPresetName,
2989
2989
  renderControlAddon,
2990
+ fonts,
2990
2991
  disabled = false,
2991
2992
  className = ""
2992
2993
  }) {
2993
- const fields = (0, import_react21.useMemo)(() => (0, import_effects3.effectParameterFields)(description), [description]);
2994
+ const fields = (0, import_react21.useMemo)(() => (0, import_effects3.effectParameterFields)(description, { fonts }), [description, fonts]);
2994
2995
  const idBase = (0, import_react21.useId)();
2995
2996
  const gesture = import_react21.default.useRef(null);
2996
2997
  const count = import_react21.default.useRef(0);
@@ -5,7 +5,7 @@ import {
5
5
  EffectParameters,
6
6
  EffectsBrowser,
7
7
  useEffectDescription
8
- } from "../chunk-Q7LAFHGP.js";
8
+ } from "../chunk-ZQ6H2C7N.js";
9
9
  import "../chunk-5LFQ2UQZ.js";
10
10
  import "../chunk-KIRIU53A.js";
11
11
  import "../chunk-3I7FOSLF.js";
@@ -0,0 +1,48 @@
1
+ import React from "react";
2
+ import { type FontPickerModel, type FontProvider, type FontSpec, type FontSummary } from "@pixerate/editor/typography";
3
+ export interface FontPickerProps {
4
+ /** The selected font (controlled). */
5
+ value?: Partial<FontSpec>;
6
+ /** Called when the user (or an agent through the model's tools) picks a different font, weight or style. */
7
+ onChange?: (value: FontSpec) => void;
8
+ /** An existing model; when given, `provider`, `fonts` and `previewText` are ignored. */
9
+ model?: FontPickerModel;
10
+ /** Where fonts come from (fetched on mount). */
11
+ provider?: FontProvider;
12
+ /** A fixed list of fonts. */
13
+ fonts?: readonly FontSummary[];
14
+ /** Text for the live preview. */
15
+ previewText?: string;
16
+ /** Show the live preview (default true). */
17
+ showPreview?: boolean;
18
+ /** Show the category filter (default true). */
19
+ showCategories?: boolean;
20
+ /** Show the weight and style selects (default true). */
21
+ showWeight?: boolean;
22
+ /** Most options rendered at once (default 200); search to reach the rest. */
23
+ maxResults?: number;
24
+ disabled?: boolean;
25
+ className?: string;
26
+ id?: string;
27
+ /** Accessible label for the group (default "Font picker"). */
28
+ "aria-label"?: string;
29
+ }
30
+ /** Body of the picker, driven by a model (shared with {@link TypographyControl}). */
31
+ export declare function FontPickerView({ model, showPreview, showCategories, showWeight, maxResults, disabled, className, id, "aria-label": ariaLabel, children, }: {
32
+ model: FontPickerModel;
33
+ showPreview?: boolean;
34
+ showCategories?: boolean;
35
+ showWeight?: boolean;
36
+ maxResults?: number;
37
+ disabled?: boolean;
38
+ className?: string;
39
+ id?: string;
40
+ "aria-label"?: string;
41
+ children?: React.ReactNode;
42
+ }): React.JSX.Element;
43
+ /**
44
+ * Searchable font picker: a combobox over a listbox of families rendered in their own face, a
45
+ * category filter, weight and style selects, and a live preview. Arrow keys, Home, End, Enter and
46
+ * Escape work in the search field.
47
+ */
48
+ export declare function FontPicker({ value, onChange, model, provider, fonts, previewText, ...view }: FontPickerProps): React.JSX.Element;
@@ -0,0 +1,48 @@
1
+ import React from "react";
2
+ import { type FontPickerModel, type FontProvider, type FontSpec, type FontSummary } from "@pixerate/editor/typography";
3
+ export interface FontPickerProps {
4
+ /** The selected font (controlled). */
5
+ value?: Partial<FontSpec>;
6
+ /** Called when the user (or an agent through the model's tools) picks a different font, weight or style. */
7
+ onChange?: (value: FontSpec) => void;
8
+ /** An existing model; when given, `provider`, `fonts` and `previewText` are ignored. */
9
+ model?: FontPickerModel;
10
+ /** Where fonts come from (fetched on mount). */
11
+ provider?: FontProvider;
12
+ /** A fixed list of fonts. */
13
+ fonts?: readonly FontSummary[];
14
+ /** Text for the live preview. */
15
+ previewText?: string;
16
+ /** Show the live preview (default true). */
17
+ showPreview?: boolean;
18
+ /** Show the category filter (default true). */
19
+ showCategories?: boolean;
20
+ /** Show the weight and style selects (default true). */
21
+ showWeight?: boolean;
22
+ /** Most options rendered at once (default 200); search to reach the rest. */
23
+ maxResults?: number;
24
+ disabled?: boolean;
25
+ className?: string;
26
+ id?: string;
27
+ /** Accessible label for the group (default "Font picker"). */
28
+ "aria-label"?: string;
29
+ }
30
+ /** Body of the picker, driven by a model (shared with {@link TypographyControl}). */
31
+ export declare function FontPickerView({ model, showPreview, showCategories, showWeight, maxResults, disabled, className, id, "aria-label": ariaLabel, children, }: {
32
+ model: FontPickerModel;
33
+ showPreview?: boolean;
34
+ showCategories?: boolean;
35
+ showWeight?: boolean;
36
+ maxResults?: number;
37
+ disabled?: boolean;
38
+ className?: string;
39
+ id?: string;
40
+ "aria-label"?: string;
41
+ children?: React.ReactNode;
42
+ }): React.JSX.Element;
43
+ /**
44
+ * Searchable font picker: a combobox over a listbox of families rendered in their own face, a
45
+ * category filter, weight and style selects, and a live preview. Arrow keys, Home, End, Enter and
46
+ * Escape work in the search field.
47
+ */
48
+ export declare function FontPicker({ value, onChange, model, provider, fonts, previewText, ...view }: FontPickerProps): React.JSX.Element;
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import { type FontPickerProps } from "./FontPicker.cjs";
3
+ export interface TypographyControlProps extends FontPickerProps {
4
+ /** Accessible label for the group (default "Typography"). */
5
+ "aria-label"?: string;
6
+ }
7
+ /**
8
+ * Composite inspector control: the {@link FontPicker} plus size (px), line height and letter
9
+ * spacing (em). Emits the whole {@link FontSpec} through `onChange`.
10
+ */
11
+ export declare function TypographyControl({ value, onChange, model, provider, fonts, previewText, disabled, "aria-label": ariaLabel, ...view }: TypographyControlProps): React.JSX.Element;
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import { type FontPickerProps } from "./FontPicker.js";
3
+ export interface TypographyControlProps extends FontPickerProps {
4
+ /** Accessible label for the group (default "Typography"). */
5
+ "aria-label"?: string;
6
+ }
7
+ /**
8
+ * Composite inspector control: the {@link FontPicker} plus size (px), line height and letter
9
+ * spacing (em). Emits the whole {@link FontSpec} through `onChange`.
10
+ */
11
+ export declare function TypographyControl({ value, onChange, model, provider, fonts, previewText, disabled, "aria-label": ariaLabel, ...view }: TypographyControlProps): React.JSX.Element;