@pixerate/editor-react 0.97.0 → 0.99.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.
- package/README.md +2 -2
- package/dist/animation-editor/index.cjs +13 -9
- package/dist/animation-editor/index.js +7 -7
- package/dist/canvas/index.cjs +22 -13
- package/dist/canvas/index.js +14 -9
- package/dist/canvas/useCanvasPlaybackSurface.d.cts +8 -2
- package/dist/canvas/useCanvasPlaybackSurface.d.ts +8 -2
- package/dist/chart/index.cjs +10 -6
- package/dist/chart/index.js +2 -2
- package/dist/{chunk-NC4RLZTK.js → chunk-EFF4YWJK.js} +3169 -3085
- package/dist/{chunk-GECXTPSH.js → chunk-EP6MSQN4.js} +1 -1
- package/dist/{chunk-AILJ4JOW.js → chunk-GDPWLGPD.js} +3 -3
- package/dist/{chunk-IPVWWVSF.js → chunk-GNO54NFG.js} +7 -3
- package/dist/{chunk-7I73DW4V.js → chunk-V2YC5T4R.js} +14 -8
- package/dist/image-editor/AdjustmentLayersPanel.d.cts +2 -0
- package/dist/image-editor/AdjustmentLayersPanel.d.ts +2 -0
- package/dist/image-editor/ControlSlider.d.cts +2 -0
- package/dist/image-editor/ControlSlider.d.ts +2 -0
- package/dist/image-editor/CurvesEditor.d.cts +2 -0
- package/dist/image-editor/CurvesEditor.d.ts +2 -0
- package/dist/image-editor/ImageEditor.d.cts +3 -1
- package/dist/image-editor/ImageEditor.d.ts +3 -1
- package/dist/image-editor/ImageEditorCanvas.d.cts +77 -0
- package/dist/image-editor/ImageEditorCanvas.d.ts +77 -0
- package/dist/image-editor/ImageEffectControls.d.cts +14 -0
- package/dist/image-editor/ImageEffectControls.d.ts +14 -0
- package/dist/image-editor/index.cjs +4659 -4576
- package/dist/image-editor/index.d.cts +2 -0
- package/dist/image-editor/index.d.ts +2 -0
- package/dist/image-editor/index.js +6 -2
- package/dist/image-editor/styles.d.cts +51 -0
- package/dist/image-editor/styles.d.ts +51 -0
- package/dist/index.cjs +5262 -5173
- package/dist/index.js +9 -5
- package/dist/paint-editor/index.cjs +10 -6
- package/dist/paint-editor/index.js +4 -4
- package/dist/parameters/index.cjs +20 -10
- package/dist/parameters/index.js +2 -2
- package/dist/playback/PresenceLayer.d.cts +3 -1
- package/dist/playback/PresenceLayer.d.ts +3 -1
- package/dist/playback/useElementPlaybackSurface.d.cts +5 -4
- package/dist/playback/useElementPlaybackSurface.d.ts +5 -4
- package/dist/spreadsheet/index.cjs +7 -3
- package/dist/spreadsheet/index.js +2 -2
- package/dist/vector/index.cjs +7 -3
- package/dist/vector/index.js +1 -1
- package/dist/video-editor/index.cjs +13 -9
- package/dist/video-editor/index.js +7 -7
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useElementPlaybackSurface
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-V2YC5T4R.js";
|
|
4
4
|
import {
|
|
5
5
|
ChartCanvas,
|
|
6
6
|
ChartDataGrid,
|
|
7
7
|
ChartInspector,
|
|
8
8
|
chartButtonClass
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-GDPWLGPD.js";
|
|
10
10
|
import {
|
|
11
11
|
FormulaHints,
|
|
12
12
|
NameManager,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
useSpreadsheetClipboard,
|
|
22
22
|
useSpreadsheetEditor,
|
|
23
23
|
useSpreadsheetViewport
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-EP6MSQN4.js";
|
|
25
25
|
import {
|
|
26
26
|
AdjustmentLayersPanel,
|
|
27
27
|
BrushOptionsBar,
|
|
@@ -31,6 +31,8 @@ import {
|
|
|
31
31
|
FreeTransformOptionsBar,
|
|
32
32
|
Histogram,
|
|
33
33
|
ImageEditor,
|
|
34
|
+
ImageEditorCanvas,
|
|
35
|
+
ImageEffectControls,
|
|
34
36
|
ImageProviderEffectsPanel,
|
|
35
37
|
LayerEffectsPanel,
|
|
36
38
|
LayersPanel,
|
|
@@ -42,7 +44,7 @@ import {
|
|
|
42
44
|
useImageEditor,
|
|
43
45
|
useImageEffectsTools,
|
|
44
46
|
useImageHistogram
|
|
45
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-EFF4YWJK.js";
|
|
46
48
|
import "./chunk-AJCWF6SN.js";
|
|
47
49
|
import "./chunk-Q7LAFHGP.js";
|
|
48
50
|
import "./chunk-5LFQ2UQZ.js";
|
|
@@ -53,7 +55,7 @@ import {
|
|
|
53
55
|
PresenceLayer,
|
|
54
56
|
useAgentPlayback,
|
|
55
57
|
usePlaybackSurface
|
|
56
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-GNO54NFG.js";
|
|
57
59
|
import {
|
|
58
60
|
CommandPalette,
|
|
59
61
|
useCommandPalette,
|
|
@@ -2417,6 +2419,8 @@ export {
|
|
|
2417
2419
|
Histogram,
|
|
2418
2420
|
HistoryManager2 as HistoryManager,
|
|
2419
2421
|
ImageEditor,
|
|
2422
|
+
ImageEditorCanvas,
|
|
2423
|
+
ImageEffectControls,
|
|
2420
2424
|
ImageProviderEffectsPanel,
|
|
2421
2425
|
InsertTableGrid,
|
|
2422
2426
|
JobProgress,
|
|
@@ -1369,7 +1369,11 @@ function usePlaybackSurface(playback, id, options = {}, sharedPresence) {
|
|
|
1369
1369
|
beginGesture: (key) => o().beginGesture?.(key),
|
|
1370
1370
|
endGesture: () => o().endGesture?.(),
|
|
1371
1371
|
reveal: () => o().reveal?.(),
|
|
1372
|
-
open
|
|
1372
|
+
// Only a surface whose options can open things has `open`, so playback skips `open` steps
|
|
1373
|
+
// (and their wait) everywhere else. Read per step, like the other options.
|
|
1374
|
+
get open() {
|
|
1375
|
+
return o().open ? (ref) => o().open?.(ref) : void 0;
|
|
1376
|
+
},
|
|
1373
1377
|
get defaultKind() {
|
|
1374
1378
|
return o().defaultKind;
|
|
1375
1379
|
}
|
|
@@ -1386,7 +1390,7 @@ function usePlaybackSurface(playback, id, options = {}, sharedPresence) {
|
|
|
1386
1390
|
// src/playback/PresenceLayer.tsx
|
|
1387
1391
|
var import_react13 = __toESM(require("react"), 1);
|
|
1388
1392
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1389
|
-
function PresenceLayer({ presence, viewport, className = "" }) {
|
|
1393
|
+
function PresenceLayer({ presence, viewport, clip = true, className = "" }) {
|
|
1390
1394
|
const { actors } = (0, import_react13.useSyncExternalStore)(presence.subscribe, presence.getState, presence.getState);
|
|
1391
1395
|
if (!actors.length) return null;
|
|
1392
1396
|
const map = typeof viewport === "function" ? viewport : viewport ? (p) => ({ x: p.x * viewport.zoom + viewport.x, y: p.y * viewport.zoom + viewport.y }) : (p) => p;
|
|
@@ -1396,7 +1400,7 @@ function PresenceLayer({ presence, viewport, className = "" }) {
|
|
|
1396
1400
|
className: `pixerate-presence ${className}`.trim(),
|
|
1397
1401
|
"aria-hidden": "true",
|
|
1398
1402
|
"data-testid": "presence-layer",
|
|
1399
|
-
style: { position: "absolute", inset: 0, pointerEvents: "none", overflow: "hidden", zIndex: 50 },
|
|
1403
|
+
style: { position: "absolute", inset: 0, pointerEvents: "none", overflow: clip ? "hidden" : "visible", zIndex: 50 },
|
|
1400
1404
|
children: actors.map((a) => {
|
|
1401
1405
|
const at = map(a);
|
|
1402
1406
|
const ring = a.focus && (() => {
|
|
@@ -3054,11 +3058,11 @@ function usePaintEffectsProvider(controller) {
|
|
|
3054
3058
|
return provider;
|
|
3055
3059
|
}
|
|
3056
3060
|
function usePaintEffectsTools(registry, controller, options = {}) {
|
|
3057
|
-
const { id, namespace, readOnly } = options;
|
|
3061
|
+
const { id, namespace, readOnly, playbackSurface } = options;
|
|
3058
3062
|
(0, import_react22.useEffect)(() => {
|
|
3059
3063
|
if (!registry) return;
|
|
3060
|
-
return registry.register((0, import_paint_editor13.createPaintEffectsToolProvider)(controller, { id, namespace, readOnly }));
|
|
3061
|
-
}, [registry, controller, id, namespace, readOnly]);
|
|
3064
|
+
return registry.register((0, import_paint_editor13.createPaintEffectsToolProvider)(controller, { id, namespace, readOnly, playbackSurface }));
|
|
3065
|
+
}, [registry, controller, id, namespace, readOnly, playbackSurface]);
|
|
3062
3066
|
}
|
|
3063
3067
|
function Controls({ provider, effect, name, values, apply }) {
|
|
3064
3068
|
const { description, error } = useEffectDescription(provider, effect);
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
PresenceLayer,
|
|
14
14
|
useAgentPlayback,
|
|
15
15
|
usePlaybackSurface
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-GNO54NFG.js";
|
|
17
17
|
|
|
18
18
|
// src/paint-editor/usePaintEditor.ts
|
|
19
19
|
import { useMemo, useState, useSyncExternalStore } from "react";
|
|
@@ -1238,11 +1238,11 @@ function usePaintEffectsProvider(controller) {
|
|
|
1238
1238
|
return provider;
|
|
1239
1239
|
}
|
|
1240
1240
|
function usePaintEffectsTools(registry, controller, options = {}) {
|
|
1241
|
-
const { id, namespace, readOnly } = options;
|
|
1241
|
+
const { id, namespace, readOnly, playbackSurface } = options;
|
|
1242
1242
|
useEffect3(() => {
|
|
1243
1243
|
if (!registry) return;
|
|
1244
|
-
return registry.register(createPaintEffectsToolProvider(controller, { id, namespace, readOnly }));
|
|
1245
|
-
}, [registry, controller, id, namespace, readOnly]);
|
|
1244
|
+
return registry.register(createPaintEffectsToolProvider(controller, { id, namespace, readOnly, playbackSurface }));
|
|
1245
|
+
}, [registry, controller, id, namespace, readOnly, playbackSurface]);
|
|
1246
1246
|
}
|
|
1247
1247
|
function Controls({ provider, effect, name, values, apply }) {
|
|
1248
1248
|
const { description, error } = useEffectDescription(provider, effect);
|
|
@@ -1547,6 +1547,7 @@ function useAgentPlayback() {
|
|
|
1547
1547
|
|
|
1548
1548
|
// src/playback/useElementPlaybackSurface.ts
|
|
1549
1549
|
var import_react8 = require("react");
|
|
1550
|
+
var import_tools2 = require("@pixerate/editor/tools");
|
|
1550
1551
|
|
|
1551
1552
|
// src/playback/usePlaybackSurface.ts
|
|
1552
1553
|
var import_react7 = require("react");
|
|
@@ -1571,7 +1572,11 @@ function usePlaybackSurface(playback, id, options = {}, sharedPresence) {
|
|
|
1571
1572
|
beginGesture: (key) => o().beginGesture?.(key),
|
|
1572
1573
|
endGesture: () => o().endGesture?.(),
|
|
1573
1574
|
reveal: () => o().reveal?.(),
|
|
1574
|
-
open
|
|
1575
|
+
// Only a surface whose options can open things has `open`, so playback skips `open` steps
|
|
1576
|
+
// (and their wait) everywhere else. Read per step, like the other options.
|
|
1577
|
+
get open() {
|
|
1578
|
+
return o().open ? (ref) => o().open?.(ref) : void 0;
|
|
1579
|
+
},
|
|
1575
1580
|
get defaultKind() {
|
|
1576
1581
|
return o().defaultKind;
|
|
1577
1582
|
}
|
|
@@ -1590,15 +1595,20 @@ function useElementPlaybackSurface(playback, id, element, options) {
|
|
|
1590
1595
|
const latest = (0, import_react8.useRef)(options);
|
|
1591
1596
|
latest.current = options;
|
|
1592
1597
|
const box = () => element.current?.getBoundingClientRect() ?? null;
|
|
1598
|
+
const fromViewport = (p) => {
|
|
1599
|
+
const r = box();
|
|
1600
|
+
return { x: p.x - (r?.left ?? 0), y: p.y - (r?.top ?? 0) };
|
|
1601
|
+
};
|
|
1593
1602
|
return usePlaybackSurface(playback, id, {
|
|
1594
1603
|
get defaultKind() {
|
|
1595
1604
|
return latest.current.defaultKind;
|
|
1596
1605
|
},
|
|
1597
1606
|
locate: (ref) => {
|
|
1598
|
-
const selector = latest.current.selectors[ref.kind]?.(ref.id);
|
|
1607
|
+
const selector = latest.current.selectors?.[ref.kind]?.(ref.id);
|
|
1599
1608
|
const b = box();
|
|
1600
1609
|
const r = selector ? element.current?.querySelector(selector)?.getBoundingClientRect() : null;
|
|
1601
|
-
|
|
1610
|
+
if (b && r && r.width > 0) return { x: r.left - b.left, y: r.top - b.top, width: r.width, height: r.height };
|
|
1611
|
+
return (0, import_tools2.locatePlaybackChrome)(ref, latest.current, fromViewport);
|
|
1602
1612
|
},
|
|
1603
1613
|
bounds: () => {
|
|
1604
1614
|
const r = box();
|
|
@@ -1612,18 +1622,18 @@ function useElementPlaybackSurface(playback, id, element, options) {
|
|
|
1612
1622
|
const r = box();
|
|
1613
1623
|
return { x: (r?.left ?? 0) + p.x, y: (r?.top ?? 0) + p.y };
|
|
1614
1624
|
},
|
|
1615
|
-
fromViewport
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1625
|
+
fromViewport,
|
|
1626
|
+
reveal: () => latest.current.reveal?.(),
|
|
1627
|
+
get open() {
|
|
1628
|
+
return latest.current.open ? (ref) => latest.current.open?.(ref) : void 0;
|
|
1629
|
+
}
|
|
1620
1630
|
});
|
|
1621
1631
|
}
|
|
1622
1632
|
|
|
1623
1633
|
// src/playback/PresenceLayer.tsx
|
|
1624
1634
|
var import_react9 = __toESM(require("react"), 1);
|
|
1625
1635
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1626
|
-
function PresenceLayer({ presence, viewport, className = "" }) {
|
|
1636
|
+
function PresenceLayer({ presence, viewport, clip = true, className = "" }) {
|
|
1627
1637
|
const { actors } = (0, import_react9.useSyncExternalStore)(presence.subscribe, presence.getState, presence.getState);
|
|
1628
1638
|
if (!actors.length) return null;
|
|
1629
1639
|
const map = typeof viewport === "function" ? viewport : viewport ? (p) => ({ x: p.x * viewport.zoom + viewport.x, y: p.y * viewport.zoom + viewport.y }) : (p) => p;
|
|
@@ -1633,7 +1643,7 @@ function PresenceLayer({ presence, viewport, className = "" }) {
|
|
|
1633
1643
|
className: `pixerate-presence ${className}`.trim(),
|
|
1634
1644
|
"aria-hidden": "true",
|
|
1635
1645
|
"data-testid": "presence-layer",
|
|
1636
|
-
style: { position: "absolute", inset: 0, pointerEvents: "none", overflow: "hidden", zIndex: 50 },
|
|
1646
|
+
style: { position: "absolute", inset: 0, pointerEvents: "none", overflow: clip ? "hidden" : "visible", zIndex: 50 },
|
|
1637
1647
|
children: actors.map((a) => {
|
|
1638
1648
|
const at = map(a);
|
|
1639
1649
|
const ring = a.focus && (() => {
|
package/dist/parameters/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useElementPlaybackSurface
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-V2YC5T4R.js";
|
|
4
4
|
import {
|
|
5
5
|
KeyframeDiamond,
|
|
6
6
|
ParameterColor,
|
|
@@ -21,7 +21,7 @@ import "../chunk-3I7FOSLF.js";
|
|
|
21
21
|
import {
|
|
22
22
|
PresenceLayer,
|
|
23
23
|
useAgentPlayback
|
|
24
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-GNO54NFG.js";
|
|
25
25
|
|
|
26
26
|
// src/parameters/useParameters.ts
|
|
27
27
|
import { useEffect, useMemo, useRef, useSyncExternalStore } from "react";
|
|
@@ -18,6 +18,8 @@ export interface PresenceLayerProps {
|
|
|
18
18
|
x: number;
|
|
19
19
|
y: number;
|
|
20
20
|
});
|
|
21
|
+
/** Clip the cursors to the layer's box (default true). `false` lets a cursor visit chrome outside it. */
|
|
22
|
+
clip?: boolean;
|
|
21
23
|
className?: string;
|
|
22
24
|
}
|
|
23
25
|
/**
|
|
@@ -25,4 +27,4 @@ export interface PresenceLayerProps {
|
|
|
25
27
|
* in a `position: relative` box over the surface. It has the `pixerate-presence` class, so
|
|
26
28
|
* snapshots and exports leave it out.
|
|
27
29
|
*/
|
|
28
|
-
export declare function PresenceLayer({ presence, viewport, className }: PresenceLayerProps): React.JSX.Element | null;
|
|
30
|
+
export declare function PresenceLayer({ presence, viewport, clip, className }: PresenceLayerProps): React.JSX.Element | null;
|
|
@@ -18,6 +18,8 @@ export interface PresenceLayerProps {
|
|
|
18
18
|
x: number;
|
|
19
19
|
y: number;
|
|
20
20
|
});
|
|
21
|
+
/** Clip the cursors to the layer's box (default true). `false` lets a cursor visit chrome outside it. */
|
|
22
|
+
clip?: boolean;
|
|
21
23
|
className?: string;
|
|
22
24
|
}
|
|
23
25
|
/**
|
|
@@ -25,4 +27,4 @@ export interface PresenceLayerProps {
|
|
|
25
27
|
* in a `position: relative` box over the surface. It has the `pixerate-presence` class, so
|
|
26
28
|
* snapshots and exports leave it out.
|
|
27
29
|
*/
|
|
28
|
-
export declare function PresenceLayer({ presence, viewport, className }: PresenceLayerProps): React.JSX.Element | null;
|
|
30
|
+
export declare function PresenceLayer({ presence, viewport, clip, className }: PresenceLayerProps): React.JSX.Element | null;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { type RefObject } from "react";
|
|
2
|
-
import type
|
|
3
|
-
export interface ElementPlaybackSurfaceOptions {
|
|
2
|
+
import { type AgentPlayback, type PlaybackChromeOptions, type PresenceStore } from "@pixerate/editor/tools";
|
|
3
|
+
export interface ElementPlaybackSurfaceOptions extends PlaybackChromeOptions {
|
|
4
4
|
/** The kind of a bare `id` / `ids` argument (e.g. `parameter`). */
|
|
5
5
|
defaultKind?: string;
|
|
6
6
|
/**
|
|
7
7
|
* A CSS selector for each ref kind the surface can find inside the element, e.g.
|
|
8
|
-
* `{ parameter: (id) => \`[data-parameter-id="${CSS.escape(id)}"]\` }`.
|
|
8
|
+
* `{ parameter: (id) => \`[data-parameter-id="${CSS.escape(id)}"]\` }`. Refs they miss go to
|
|
9
|
+
* `locate`, then `locateElement` (which may return an element outside this one).
|
|
9
10
|
*/
|
|
10
|
-
selectors
|
|
11
|
+
selectors?: Record<string, (id: string) => string>;
|
|
11
12
|
/** Bring the element on screen (switch to its tab) before the agent acts. */
|
|
12
13
|
reveal?: () => void | Promise<void>;
|
|
13
14
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { type RefObject } from "react";
|
|
2
|
-
import type
|
|
3
|
-
export interface ElementPlaybackSurfaceOptions {
|
|
2
|
+
import { type AgentPlayback, type PlaybackChromeOptions, type PresenceStore } from "@pixerate/editor/tools";
|
|
3
|
+
export interface ElementPlaybackSurfaceOptions extends PlaybackChromeOptions {
|
|
4
4
|
/** The kind of a bare `id` / `ids` argument (e.g. `parameter`). */
|
|
5
5
|
defaultKind?: string;
|
|
6
6
|
/**
|
|
7
7
|
* A CSS selector for each ref kind the surface can find inside the element, e.g.
|
|
8
|
-
* `{ parameter: (id) => \`[data-parameter-id="${CSS.escape(id)}"]\` }`.
|
|
8
|
+
* `{ parameter: (id) => \`[data-parameter-id="${CSS.escape(id)}"]\` }`. Refs they miss go to
|
|
9
|
+
* `locate`, then `locateElement` (which may return an element outside this one).
|
|
9
10
|
*/
|
|
10
|
-
selectors
|
|
11
|
+
selectors?: Record<string, (id: string) => string>;
|
|
11
12
|
/** Bring the element on screen (switch to its tab) before the agent acts. */
|
|
12
13
|
reveal?: () => void | Promise<void>;
|
|
13
14
|
}
|
|
@@ -317,7 +317,11 @@ function usePlaybackSurface(playback, id, options = {}, sharedPresence) {
|
|
|
317
317
|
beginGesture: (key) => o().beginGesture?.(key),
|
|
318
318
|
endGesture: () => o().endGesture?.(),
|
|
319
319
|
reveal: () => o().reveal?.(),
|
|
320
|
-
open
|
|
320
|
+
// Only a surface whose options can open things has `open`, so playback skips `open` steps
|
|
321
|
+
// (and their wait) everywhere else. Read per step, like the other options.
|
|
322
|
+
get open() {
|
|
323
|
+
return o().open ? (ref) => o().open?.(ref) : void 0;
|
|
324
|
+
},
|
|
321
325
|
get defaultKind() {
|
|
322
326
|
return o().defaultKind;
|
|
323
327
|
}
|
|
@@ -334,7 +338,7 @@ function usePlaybackSurface(playback, id, options = {}, sharedPresence) {
|
|
|
334
338
|
// src/playback/PresenceLayer.tsx
|
|
335
339
|
var import_react4 = __toESM(require("react"), 1);
|
|
336
340
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
337
|
-
function PresenceLayer({ presence, viewport, className = "" }) {
|
|
341
|
+
function PresenceLayer({ presence, viewport, clip = true, className = "" }) {
|
|
338
342
|
const { actors } = (0, import_react4.useSyncExternalStore)(presence.subscribe, presence.getState, presence.getState);
|
|
339
343
|
if (!actors.length) return null;
|
|
340
344
|
const map = typeof viewport === "function" ? viewport : viewport ? (p) => ({ x: p.x * viewport.zoom + viewport.x, y: p.y * viewport.zoom + viewport.y }) : (p) => p;
|
|
@@ -344,7 +348,7 @@ function PresenceLayer({ presence, viewport, className = "" }) {
|
|
|
344
348
|
className: `pixerate-presence ${className}`.trim(),
|
|
345
349
|
"aria-hidden": "true",
|
|
346
350
|
"data-testid": "presence-layer",
|
|
347
|
-
style: { position: "absolute", inset: 0, pointerEvents: "none", overflow: "hidden", zIndex: 50 },
|
|
351
|
+
style: { position: "absolute", inset: 0, pointerEvents: "none", overflow: clip ? "hidden" : "visible", zIndex: 50 },
|
|
348
352
|
children: actors.map((a) => {
|
|
349
353
|
const at = map(a);
|
|
350
354
|
const ring = a.focus && (() => {
|
|
@@ -12,8 +12,8 @@ import {
|
|
|
12
12
|
useSpreadsheetClipboard,
|
|
13
13
|
useSpreadsheetEditor,
|
|
14
14
|
useSpreadsheetViewport
|
|
15
|
-
} from "../chunk-
|
|
16
|
-
import "../chunk-
|
|
15
|
+
} from "../chunk-EP6MSQN4.js";
|
|
16
|
+
import "../chunk-GNO54NFG.js";
|
|
17
17
|
export {
|
|
18
18
|
FormulaHints,
|
|
19
19
|
NameManager,
|
package/dist/vector/index.cjs
CHANGED
|
@@ -177,7 +177,11 @@ function usePlaybackSurface(playback, id, options = {}, sharedPresence) {
|
|
|
177
177
|
beginGesture: (key) => o().beginGesture?.(key),
|
|
178
178
|
endGesture: () => o().endGesture?.(),
|
|
179
179
|
reveal: () => o().reveal?.(),
|
|
180
|
-
open
|
|
180
|
+
// Only a surface whose options can open things has `open`, so playback skips `open` steps
|
|
181
|
+
// (and their wait) everywhere else. Read per step, like the other options.
|
|
182
|
+
get open() {
|
|
183
|
+
return o().open ? (ref) => o().open?.(ref) : void 0;
|
|
184
|
+
},
|
|
181
185
|
get defaultKind() {
|
|
182
186
|
return o().defaultKind;
|
|
183
187
|
}
|
|
@@ -194,7 +198,7 @@ function usePlaybackSurface(playback, id, options = {}, sharedPresence) {
|
|
|
194
198
|
// src/playback/PresenceLayer.tsx
|
|
195
199
|
var import_react4 = __toESM(require("react"), 1);
|
|
196
200
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
197
|
-
function PresenceLayer({ presence, viewport, className = "" }) {
|
|
201
|
+
function PresenceLayer({ presence, viewport, clip = true, className = "" }) {
|
|
198
202
|
const { actors } = (0, import_react4.useSyncExternalStore)(presence.subscribe, presence.getState, presence.getState);
|
|
199
203
|
if (!actors.length) return null;
|
|
200
204
|
const map = typeof viewport === "function" ? viewport : viewport ? (p) => ({ x: p.x * viewport.zoom + viewport.x, y: p.y * viewport.zoom + viewport.y }) : (p) => p;
|
|
@@ -204,7 +208,7 @@ function PresenceLayer({ presence, viewport, className = "" }) {
|
|
|
204
208
|
className: `pixerate-presence ${className}`.trim(),
|
|
205
209
|
"aria-hidden": "true",
|
|
206
210
|
"data-testid": "presence-layer",
|
|
207
|
-
style: { position: "absolute", inset: 0, pointerEvents: "none", overflow: "hidden", zIndex: 50 },
|
|
211
|
+
style: { position: "absolute", inset: 0, pointerEvents: "none", overflow: clip ? "hidden" : "visible", zIndex: 50 },
|
|
208
212
|
children: actors.map((a) => {
|
|
209
213
|
const at = map(a);
|
|
210
214
|
const ring = a.focus && (() => {
|
package/dist/vector/index.js
CHANGED
|
@@ -88,18 +88,18 @@ function useVideoEditor(controllerOrOptions = {}) {
|
|
|
88
88
|
return { controller, state, ...actions };
|
|
89
89
|
}
|
|
90
90
|
function useVideoEditorTools(registry, controller, options = {}) {
|
|
91
|
-
const { id, namespace, readOnly, rasterize, framePixels, framePixelsTimeout } = options;
|
|
91
|
+
const { id, namespace, readOnly, rasterize, framePixels, framePixelsTimeout, playbackSurface } = options;
|
|
92
92
|
(0, import_react.useEffect)(() => {
|
|
93
93
|
if (!registry) return;
|
|
94
|
-
return registry.register((0, import_video_editor.createVideoEditorToolProvider)(controller, { id, namespace, readOnly, rasterize, framePixels, framePixelsTimeout }));
|
|
95
|
-
}, [registry, controller, id, namespace, readOnly, rasterize, framePixels, framePixelsTimeout]);
|
|
94
|
+
return registry.register((0, import_video_editor.createVideoEditorToolProvider)(controller, { id, namespace, readOnly, rasterize, framePixels, framePixelsTimeout, playbackSurface }));
|
|
95
|
+
}, [registry, controller, id, namespace, readOnly, rasterize, framePixels, framePixelsTimeout, playbackSurface]);
|
|
96
96
|
}
|
|
97
97
|
function useVideoEffectsTools(registry, controller, options = {}) {
|
|
98
|
-
const { id, namespace, readOnly } = options;
|
|
98
|
+
const { id, namespace, readOnly, playbackSurface } = options;
|
|
99
99
|
(0, import_react.useEffect)(() => {
|
|
100
100
|
if (!registry) return;
|
|
101
|
-
return registry.register((0, import_video_editor.createVideoEffectsToolProvider)(controller, { id, namespace, readOnly }));
|
|
102
|
-
}, [registry, controller, id, namespace, readOnly]);
|
|
101
|
+
return registry.register((0, import_video_editor.createVideoEffectsToolProvider)(controller, { id, namespace, readOnly, playbackSurface }));
|
|
102
|
+
}, [registry, controller, id, namespace, readOnly, playbackSurface]);
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
// src/video-editor/VideoPreview.tsx
|
|
@@ -284,7 +284,11 @@ function usePlaybackSurface(playback, id, options = {}, sharedPresence) {
|
|
|
284
284
|
beginGesture: (key) => o().beginGesture?.(key),
|
|
285
285
|
endGesture: () => o().endGesture?.(),
|
|
286
286
|
reveal: () => o().reveal?.(),
|
|
287
|
-
open
|
|
287
|
+
// Only a surface whose options can open things has `open`, so playback skips `open` steps
|
|
288
|
+
// (and their wait) everywhere else. Read per step, like the other options.
|
|
289
|
+
get open() {
|
|
290
|
+
return o().open ? (ref) => o().open?.(ref) : void 0;
|
|
291
|
+
},
|
|
288
292
|
get defaultKind() {
|
|
289
293
|
return o().defaultKind;
|
|
290
294
|
}
|
|
@@ -301,7 +305,7 @@ function usePlaybackSurface(playback, id, options = {}, sharedPresence) {
|
|
|
301
305
|
// src/playback/PresenceLayer.tsx
|
|
302
306
|
var import_react6 = __toESM(require("react"), 1);
|
|
303
307
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
304
|
-
function PresenceLayer({ presence, viewport, className = "" }) {
|
|
308
|
+
function PresenceLayer({ presence, viewport, clip = true, className = "" }) {
|
|
305
309
|
const { actors } = (0, import_react6.useSyncExternalStore)(presence.subscribe, presence.getState, presence.getState);
|
|
306
310
|
if (!actors.length) return null;
|
|
307
311
|
const map = typeof viewport === "function" ? viewport : viewport ? (p) => ({ x: p.x * viewport.zoom + viewport.x, y: p.y * viewport.zoom + viewport.y }) : (p) => p;
|
|
@@ -311,7 +315,7 @@ function PresenceLayer({ presence, viewport, className = "" }) {
|
|
|
311
315
|
className: `pixerate-presence ${className}`.trim(),
|
|
312
316
|
"aria-hidden": "true",
|
|
313
317
|
"data-testid": "presence-layer",
|
|
314
|
-
style: { position: "absolute", inset: 0, pointerEvents: "none", overflow: "hidden", zIndex: 50 },
|
|
318
|
+
style: { position: "absolute", inset: 0, pointerEvents: "none", overflow: clip ? "hidden" : "visible", zIndex: 50 },
|
|
315
319
|
children: actors.map((a) => {
|
|
316
320
|
const at = map(a);
|
|
317
321
|
const ring = a.focus && (() => {
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
PresenceLayer,
|
|
12
12
|
useAgentPlayback,
|
|
13
13
|
usePlaybackSurface
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-GNO54NFG.js";
|
|
15
15
|
|
|
16
16
|
// src/video-editor/useVideoEditor.ts
|
|
17
17
|
import { useEffect, useMemo, useRef, useSyncExternalStore } from "react";
|
|
@@ -57,18 +57,18 @@ function useVideoEditor(controllerOrOptions = {}) {
|
|
|
57
57
|
return { controller, state, ...actions };
|
|
58
58
|
}
|
|
59
59
|
function useVideoEditorTools(registry, controller, options = {}) {
|
|
60
|
-
const { id, namespace, readOnly, rasterize, framePixels, framePixelsTimeout } = options;
|
|
60
|
+
const { id, namespace, readOnly, rasterize, framePixels, framePixelsTimeout, playbackSurface } = options;
|
|
61
61
|
useEffect(() => {
|
|
62
62
|
if (!registry) return;
|
|
63
|
-
return registry.register(createVideoEditorToolProvider(controller, { id, namespace, readOnly, rasterize, framePixels, framePixelsTimeout }));
|
|
64
|
-
}, [registry, controller, id, namespace, readOnly, rasterize, framePixels, framePixelsTimeout]);
|
|
63
|
+
return registry.register(createVideoEditorToolProvider(controller, { id, namespace, readOnly, rasterize, framePixels, framePixelsTimeout, playbackSurface }));
|
|
64
|
+
}, [registry, controller, id, namespace, readOnly, rasterize, framePixels, framePixelsTimeout, playbackSurface]);
|
|
65
65
|
}
|
|
66
66
|
function useVideoEffectsTools(registry, controller, options = {}) {
|
|
67
|
-
const { id, namespace, readOnly } = options;
|
|
67
|
+
const { id, namespace, readOnly, playbackSurface } = options;
|
|
68
68
|
useEffect(() => {
|
|
69
69
|
if (!registry) return;
|
|
70
|
-
return registry.register(createVideoEffectsToolProvider(controller, { id, namespace, readOnly }));
|
|
71
|
-
}, [registry, controller, id, namespace, readOnly]);
|
|
70
|
+
return registry.register(createVideoEffectsToolProvider(controller, { id, namespace, readOnly, playbackSurface }));
|
|
71
|
+
}, [registry, controller, id, namespace, readOnly, playbackSurface]);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
// src/video-editor/VideoPreview.tsx
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixerate/editor-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.99.0",
|
|
4
4
|
"description": "React bindings and prompt/rich-text components for @pixerate/editor",
|
|
5
5
|
"author": "Pixerate",
|
|
6
6
|
"license": "MIT",
|
|
@@ -245,7 +245,7 @@
|
|
|
245
245
|
},
|
|
246
246
|
"peerDependencies": {
|
|
247
247
|
"@dagrejs/dagre": "^1.1.8",
|
|
248
|
-
"@pixerate/editor": ">=0.
|
|
248
|
+
"@pixerate/editor": ">=0.149.0 <1.0.0-0",
|
|
249
249
|
"@tiptap/core": "^2.27.3",
|
|
250
250
|
"@tiptap/pm": "^2.27.3",
|
|
251
251
|
"@tiptap/react": "^2.27.3",
|
|
@@ -272,7 +272,7 @@
|
|
|
272
272
|
"tsup": "^9.0.0",
|
|
273
273
|
"typescript": "^5.7.3",
|
|
274
274
|
"vitest": "^5.0.5",
|
|
275
|
-
"@pixerate/editor": "0.
|
|
275
|
+
"@pixerate/editor": "0.149.0"
|
|
276
276
|
},
|
|
277
277
|
"scripts": {
|
|
278
278
|
"build": "tsup && tsc -p tsconfig.build.json && node ../../scripts/finalize-declarations.mjs dist",
|