@hyperframes/studio 0.8.139 → 0.8.141
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/dist/assets/hyperframes-player-5Vx2AiUz.js +473 -0
- package/dist/assets/{index-DsEkE5_G.js → index-BAnh7cSQ.js} +1 -1
- package/dist/assets/{index-Br1Whc0f.js → index-C0thd4eM.js} +204 -204
- package/dist/assets/{index-BmIPrb8I.js → index-P8fgj_Xa.js} +1 -1
- package/dist/{chunk-E422JDF5.js → chunk-H2DUOXTF.js} +2 -1
- package/dist/index.d.ts +19 -3
- package/dist/index.html +1 -1
- package/dist/index.js +6518 -5813
- package/dist/index.js.map +1 -1
- package/dist/player.js +1 -1
- package/package.json +8 -8
- package/src/components/TimelineToolbar.test.tsx +79 -1
- package/src/components/TimelineToolbar.tsx +14 -29
- package/src/components/editor/DomEditOverlay.tsx +2 -2
- package/src/components/editor/PropertyPanel.tsx +1 -0
- package/src/components/editor/PropertyPanelFlat.tsx +1 -0
- package/src/components/editor/manualEdits.ts +1 -1
- package/src/components/editor/manualEditsParsing.ts +14 -2
- package/src/components/editor/previewReadOnly.overlay.test.tsx +3 -2
- package/src/components/editor/propertyPanelFill.tsx +36 -13
- package/src/components/editor/propertyPanelFlatStyleSections.test.tsx +4 -0
- package/src/components/editor/propertyPanelFlatStyleSections.tsx +13 -7
- package/src/components/editor/propertyPanelImageFill.test.tsx +164 -0
- package/src/components/editor/propertyPanelStyleSections.tsx +10 -7
- package/src/components/nle/NLEPreview.test.ts +60 -1
- package/src/components/nle/NLEPreview.tsx +9 -2
- package/src/components/sidebar/CompositionsTab.thumbnails.test.tsx +43 -0
- package/src/components/sidebar/CompositionsTab.tsx +17 -0
- package/src/hooks/externalFileChangeOwnership.test.ts +25 -4
- package/src/hooks/gsapValueAtPlayhead.browser.test.ts +3 -22
- package/src/hooks/useExternalFileChangeCoordinator.test.tsx +536 -10
- package/src/hooks/useExternalFileChangeCoordinator.ts +72 -45
- package/src/hooks/useMusicBeatAnalysis.ts +2 -1
- package/src/hooks/useSdkSession.lifecycle.test.tsx +20 -0
- package/src/hooks/useSdkSession.ts +4 -1
- package/src/hooks/useThumbnailStripSize.test.tsx +65 -0
- package/src/hooks/useThumbnailStripSize.ts +23 -1
- package/src/index.ts +1 -0
- package/src/player/components/AudioWaveform.test.tsx +153 -1
- package/src/player/components/AudioWaveform.tsx +93 -37
- package/src/player/components/Timeline.scrollRest.test.tsx +22 -0
- package/src/player/components/Timeline.test.ts +3 -1
- package/src/player/components/TimelineCanvas.tsx +4 -0
- package/src/player/components/TimelineClip.tsx +20 -6
- package/src/player/components/TimelineClipFades.test.tsx +11 -0
- package/src/player/components/TimelineClipFades.tsx +4 -4
- package/src/player/components/TimelineClipJoins.tsx +23 -18
- package/src/player/components/TimelineGestureOverlay.tsx +30 -27
- package/src/player/components/TimelineGroupRow.tsx +1 -0
- package/src/player/components/TimelineLaneClip.tsx +127 -0
- package/src/player/components/TimelineLanes.test.tsx +51 -6
- package/src/player/components/TimelineLanes.tsx +166 -178
- package/src/player/components/TimelineRuler.tsx +2 -0
- package/src/player/components/TimelineTimeLayer.tsx +25 -0
- package/src/player/components/VideoThumbnail.test.tsx +204 -12
- package/src/player/components/VideoThumbnail.tsx +37 -9
- package/src/player/components/thumbnailUtils.test.ts +17 -3
- package/src/player/components/thumbnailUtils.ts +17 -1
- package/src/player/components/timelineLayout.test.ts +3 -3
- package/src/player/components/timelineMotion.test.ts +27 -0
- package/src/player/components/timelineMotion.ts +62 -0
- package/src/player/components/timelineZoomInput.test.ts +438 -0
- package/src/player/components/timelineZoomInput.ts +456 -0
- package/src/player/components/useTimelineGeometry.ts +0 -3
- package/src/player/components/useTimelinePlayhead.test.tsx +97 -30
- package/src/player/components/useTimelinePlayhead.ts +53 -59
- package/src/player/components/useTimelineProviderState.tsx +16 -21
- package/src/player/components/useTimelineZoom.ts +7 -12
- package/src/player/lib/runtimeProtocol.ts +6 -0
- package/src/player/lib/thumbnailVideoDecoder.test.ts +230 -30
- package/src/player/lib/thumbnailVideoDecoder.ts +197 -54
- package/src/player/lib/timelineViewportBudgets.test.ts +1 -1
- package/src/player/lib/timelineViewportBudgets.ts +1 -1
- package/src/utils/gsapUndoRestore.browser.test.ts +4 -17
- package/dist/assets/hyperframes-player-CckOoCJ8.js +0 -473
- /package/dist/{chunk-E422JDF5.js.map → chunk-H2DUOXTF.js.map} +0 -0
|
@@ -2,6 +2,17 @@ import { useRef, useCallback, useEffect, useLayoutEffect } from "react";
|
|
|
2
2
|
import { liveTime, usePlayerStore, type ZoomMode } from "../store/playerStore";
|
|
3
3
|
import { useMountEffect } from "../../hooks/useMountEffect";
|
|
4
4
|
import { getPinchTimelineZoomPercent } from "./timelineZoom";
|
|
5
|
+
import {
|
|
6
|
+
currentTimelineZoomPercent,
|
|
7
|
+
requestTimelineZoom,
|
|
8
|
+
registerTimelineZoomViewport,
|
|
9
|
+
redrawTimelineZoomPreview,
|
|
10
|
+
settleTimelineZoom,
|
|
11
|
+
subscribeTimelineZoomPreview,
|
|
12
|
+
takeTimelineZoomAnchor,
|
|
13
|
+
timelineTimeAtX,
|
|
14
|
+
timelineZoomMapping,
|
|
15
|
+
} from "./timelineZoomInput";
|
|
5
16
|
import {
|
|
6
17
|
getTimelinePlaybackFollowScrollLeft,
|
|
7
18
|
getTimelineScrubTime,
|
|
@@ -36,17 +47,13 @@ interface UseTimelinePlayheadInput {
|
|
|
36
47
|
isDragging: React.RefObject<boolean>;
|
|
37
48
|
currentTime: number;
|
|
38
49
|
zoomMode: ZoomMode;
|
|
39
|
-
manualZoomPercent: number;
|
|
40
50
|
zoomModeRef: React.RefObject<ZoomMode>;
|
|
41
|
-
manualZoomPercentRef: React.RefObject<number>;
|
|
42
51
|
fitPps: number;
|
|
43
52
|
fitPpsRef: React.RefObject<number>;
|
|
44
53
|
effectiveDuration: number;
|
|
45
54
|
pps: number;
|
|
46
55
|
timelineReady: boolean;
|
|
47
56
|
elementsLength: number;
|
|
48
|
-
setZoomMode: (mode: ZoomMode) => void;
|
|
49
|
-
setManualZoomPercent: (percent: number) => void;
|
|
50
57
|
onSeek?: (time: number) => void;
|
|
51
58
|
contentOrigin: number;
|
|
52
59
|
}
|
|
@@ -60,28 +67,23 @@ export function useTimelinePlayhead({
|
|
|
60
67
|
currentTime,
|
|
61
68
|
zoomMode,
|
|
62
69
|
zoomModeRef,
|
|
63
|
-
manualZoomPercentRef,
|
|
64
70
|
fitPps: _fitPps,
|
|
65
71
|
fitPpsRef,
|
|
66
72
|
effectiveDuration,
|
|
67
73
|
pps,
|
|
68
74
|
timelineReady,
|
|
69
75
|
elementsLength,
|
|
70
|
-
setZoomMode,
|
|
71
|
-
setManualZoomPercent,
|
|
72
76
|
onSeek,
|
|
73
77
|
contentOrigin,
|
|
74
78
|
}: UseTimelinePlayheadInput) {
|
|
75
79
|
const dragScrollRaf = useRef(0);
|
|
76
80
|
const previousZoomModeRef = useRef<ZoomMode | null>(zoomMode);
|
|
77
|
-
// A
|
|
78
|
-
// The pinch handler anchors at the cursor instead, so it opts out via `skipCenterAnchorRef`.
|
|
81
|
+
// A zoom keeps its anchor (pinch: pointer, else playhead) in place; a resize keeps the centre.
|
|
79
82
|
const previousAnchorPpsRef = useRef(pps);
|
|
80
83
|
const userZoomCount = usePlayerStore((s) => s.userZoomCount);
|
|
81
84
|
const previousZoomCountRef = useRef(userZoomCount);
|
|
82
85
|
const lastLiveTimeRef = useRef(usePlayerStore.getState().currentTime);
|
|
83
86
|
const lastSeekCountRef = useRef(liveTime.seekCount());
|
|
84
|
-
const skipCenterAnchorRef = useRef(false);
|
|
85
87
|
const contentOriginRef = useRef(contentOrigin);
|
|
86
88
|
contentOriginRef.current = contentOrigin;
|
|
87
89
|
|
|
@@ -91,12 +93,15 @@ export function useTimelinePlayhead({
|
|
|
91
93
|
previousAnchorPpsRef.current = pps;
|
|
92
94
|
const prevZoomCount = previousZoomCountRef.current;
|
|
93
95
|
previousZoomCountRef.current = userZoomCount;
|
|
94
|
-
//
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
// Consumed even when pps didn't change (at the clamp), so it never lingers for a later zoom.
|
|
97
|
+
const anchor = takeTimelineZoomAnchor();
|
|
98
|
+
if (!scroll || pps === prevPps) return;
|
|
99
|
+
if (anchor) {
|
|
100
|
+
const maxScrollLeft = Math.max(0, scroll.scrollWidth - scroll.clientWidth);
|
|
101
|
+
const left = anchor.time * pps + contentOrigin - anchor.x;
|
|
102
|
+
scroll.scrollLeft = Math.max(0, Math.min(maxScrollLeft, left));
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
100
105
|
const zoomed = userZoomCount !== prevZoomCount;
|
|
101
106
|
if (!zoomed && scroll.scrollLeft < 1) return;
|
|
102
107
|
const time = Math.max(0, lastLiveTimeRef.current);
|
|
@@ -121,10 +126,11 @@ export function useTimelinePlayhead({
|
|
|
121
126
|
const syncPlayheadPosition = useCallback(
|
|
122
127
|
(time: number) => {
|
|
123
128
|
if (!playheadRef.current || durationRef.current <= 0) return;
|
|
129
|
+
const at = timelineZoomMapping(ppsRef.current, contentOrigin);
|
|
124
130
|
playheadRef.current.style.transform = getTimelinePlayheadTransform(
|
|
125
131
|
time,
|
|
126
|
-
|
|
127
|
-
contentOrigin,
|
|
132
|
+
at.pps,
|
|
133
|
+
at.contentOrigin,
|
|
128
134
|
!usePlayerStore.getState().isPlaying,
|
|
129
135
|
);
|
|
130
136
|
},
|
|
@@ -158,14 +164,18 @@ export function useTimelinePlayhead({
|
|
|
158
164
|
useMountEffect(() => {
|
|
159
165
|
const place = (t: number, atRest: boolean) => {
|
|
160
166
|
if (!playheadRef.current || durationRef.current <= 0) return false;
|
|
167
|
+
const at = timelineZoomMapping(ppsRef.current, contentOriginRef.current);
|
|
161
168
|
playheadRef.current.style.transform = getTimelinePlayheadTransform(
|
|
162
169
|
t,
|
|
163
|
-
|
|
164
|
-
|
|
170
|
+
at.pps,
|
|
171
|
+
at.contentOrigin,
|
|
165
172
|
atRest,
|
|
166
173
|
);
|
|
167
174
|
return true;
|
|
168
175
|
};
|
|
176
|
+
const unsubPreview = subscribeTimelineZoomPreview(() =>
|
|
177
|
+
place(lastLiveTimeRef.current, !usePlayerStore.getState().isPlaying),
|
|
178
|
+
);
|
|
169
179
|
const dragging = () => isDragging.current || usePlayerStore.getState().beatDragging;
|
|
170
180
|
const unsubPlaying = usePlayerStore.subscribe((state, prev) => {
|
|
171
181
|
if (prev.isPlaying && !state.isPlaying) place(lastLiveTimeRef.current, true);
|
|
@@ -177,7 +187,8 @@ export function useTimelinePlayhead({
|
|
|
177
187
|
lastLiveTimeRef.current = t;
|
|
178
188
|
const playing = usePlayerStore.getState().isPlaying;
|
|
179
189
|
if (!place(t, !playing)) return;
|
|
180
|
-
const
|
|
190
|
+
const at = timelineZoomMapping(ppsRef.current, contentOriginRef.current);
|
|
191
|
+
const playheadX = at.contentOrigin + Math.max(0, t) * at.pps;
|
|
181
192
|
const scroll = scrollRef.current;
|
|
182
193
|
// Paused, only a seek scrolls: a reload's republish, frame-rounded, must not undo a person's scroll.
|
|
183
194
|
if (!scroll || dragging() || zoomModeRef.current === "fit" || (!playing && !sought)) return;
|
|
@@ -197,6 +208,7 @@ export function useTimelinePlayhead({
|
|
|
197
208
|
return () => {
|
|
198
209
|
unsub();
|
|
199
210
|
unsubPlaying();
|
|
211
|
+
unsubPreview();
|
|
200
212
|
};
|
|
201
213
|
});
|
|
202
214
|
|
|
@@ -237,62 +249,44 @@ export function useTimelinePlayhead({
|
|
|
237
249
|
[scrollRef, isDragging, zoomModeRef, seekFromX],
|
|
238
250
|
);
|
|
239
251
|
|
|
252
|
+
// Trackpad pinch arrives as ctrl+wheel; Cmd+wheel zooms too, as Mac editors do.
|
|
240
253
|
const handlePinchWheel = useCallback(
|
|
241
254
|
(e: WheelEvent) => {
|
|
242
|
-
if (!e.ctrlKey) return;
|
|
255
|
+
if (!e.ctrlKey && !e.metaKey) return;
|
|
243
256
|
const scroll = scrollRef.current;
|
|
244
257
|
if (!scroll || durationRef.current <= 0 || fitPpsRef.current <= 0 || ppsRef.current <= 0)
|
|
245
258
|
return;
|
|
246
259
|
e.preventDefault();
|
|
247
260
|
e.stopPropagation();
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
261
|
+
const x = e.clientX - scroll.getBoundingClientRect().left;
|
|
262
|
+
requestTimelineZoom(
|
|
263
|
+
getPinchTimelineZoomPercent(
|
|
264
|
+
e.deltaY,
|
|
265
|
+
"manual",
|
|
266
|
+
currentTimelineZoomPercent(),
|
|
267
|
+
fitPpsRef.current,
|
|
268
|
+
),
|
|
269
|
+
{ time: Math.max(0, timelineTimeAtX(x) ?? 0), x },
|
|
254
270
|
);
|
|
255
|
-
if (nextZoomPercent === manualZoomPercentRef.current && zoomModeRef.current === "manual")
|
|
256
|
-
return;
|
|
257
|
-
const nextPps = fitPpsRef.current * (nextZoomPercent / 100);
|
|
258
|
-
const nextScrollLeft = getTimelineScrollLeftForZoomAnchor({
|
|
259
|
-
pointerX: e.clientX - rect.left,
|
|
260
|
-
currentScrollLeft: scroll.scrollLeft,
|
|
261
|
-
contentOrigin,
|
|
262
|
-
currentPixelsPerSecond: ppsRef.current,
|
|
263
|
-
nextPixelsPerSecond: nextPps,
|
|
264
|
-
duration: durationRef.current,
|
|
265
|
-
});
|
|
266
|
-
// Pinch anchors at the cursor (below), so skip the center-anchor effect.
|
|
267
|
-
skipCenterAnchorRef.current = true;
|
|
268
|
-
setZoomMode("manual");
|
|
269
|
-
setManualZoomPercent(nextZoomPercent);
|
|
270
|
-
requestAnimationFrame(() => {
|
|
271
|
-
const maxScrollLeft = Math.max(0, scroll.scrollWidth - scroll.clientWidth);
|
|
272
|
-
scroll.scrollLeft = Math.min(maxScrollLeft, nextScrollLeft);
|
|
273
|
-
});
|
|
274
271
|
},
|
|
275
|
-
[
|
|
276
|
-
scrollRef,
|
|
277
|
-
durationRef,
|
|
278
|
-
fitPpsRef,
|
|
279
|
-
ppsRef,
|
|
280
|
-
zoomModeRef,
|
|
281
|
-
manualZoomPercentRef,
|
|
282
|
-
setManualZoomPercent,
|
|
283
|
-
setZoomMode,
|
|
284
|
-
contentOrigin,
|
|
285
|
-
],
|
|
272
|
+
[scrollRef, durationRef, fitPpsRef, ppsRef],
|
|
286
273
|
);
|
|
287
274
|
|
|
288
275
|
useEffect(() => {
|
|
289
276
|
const scroll = scrollRef.current;
|
|
290
277
|
if (!scroll) return;
|
|
291
278
|
scroll.addEventListener("wheel", handlePinchWheel, { passive: false, capture: true });
|
|
279
|
+
// A press meets the zoom it sees, not the one still waiting to be laid out.
|
|
280
|
+
scroll.addEventListener("pointerdown", settleTimelineZoom, { capture: true });
|
|
281
|
+
scroll.addEventListener("scroll", redrawTimelineZoomPreview, { passive: true });
|
|
282
|
+
const unregisterZoomViewport = registerTimelineZoomViewport({ scroll, contentOrigin });
|
|
292
283
|
return () => {
|
|
293
284
|
scroll.removeEventListener("wheel", handlePinchWheel, { capture: true });
|
|
285
|
+
scroll.removeEventListener("pointerdown", settleTimelineZoom, { capture: true });
|
|
286
|
+
scroll.removeEventListener("scroll", redrawTimelineZoomPreview);
|
|
287
|
+
unregisterZoomViewport();
|
|
294
288
|
};
|
|
295
|
-
}, [handlePinchWheel, scrollRef, timelineReady, elementsLength]);
|
|
289
|
+
}, [handlePinchWheel, scrollRef, timelineReady, elementsLength, contentOrigin]);
|
|
296
290
|
|
|
297
291
|
return { seekFromX, autoScrollDuringDrag, dragScrollRaf };
|
|
298
292
|
}
|
|
@@ -131,7 +131,7 @@ export function useTimelineProviderState({
|
|
|
131
131
|
const timelineSessionEpoch = usePlayerStore((s) => s.timelineSessionEpoch);
|
|
132
132
|
const sessionEpoch = sessionEpochProp ?? timelineSessionEpoch;
|
|
133
133
|
const setFocusedEaseSegment = usePlayerStore((s) => s.setFocusedEaseSegment);
|
|
134
|
-
const { zoomMode, manualZoomPercent
|
|
134
|
+
const { zoomMode, manualZoomPercent } = useTimelineZoom();
|
|
135
135
|
const playheadRef = useRef<HTMLDivElement>(null);
|
|
136
136
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
137
137
|
const scrollRef = useRef<HTMLDivElement>(null);
|
|
@@ -258,22 +258,21 @@ export function useTimelineProviderState({
|
|
|
258
258
|
timelineElements.length,
|
|
259
259
|
displayLayout.totalH,
|
|
260
260
|
]);
|
|
261
|
-
const { pps, fitPps, displayContentWidth, displayDuration, zoomModeRef
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
});
|
|
261
|
+
const { pps, fitPps, displayContentWidth, displayDuration, zoomModeRef } = useTimelineGeometry({
|
|
262
|
+
viewportWidth: viewport.clientWidth,
|
|
263
|
+
effectiveDuration,
|
|
264
|
+
zoomMode,
|
|
265
|
+
manualZoomPercent,
|
|
266
|
+
ppsRef,
|
|
267
|
+
fitPpsRef,
|
|
268
|
+
draggedClip,
|
|
269
|
+
resizingClip,
|
|
270
|
+
expandedElements: timelineElements,
|
|
271
|
+
isDragging,
|
|
272
|
+
scrollRef,
|
|
273
|
+
lastScrollLeftRef,
|
|
274
|
+
contentOrigin,
|
|
275
|
+
});
|
|
277
276
|
const timelineFocus = useTimelineLogicalFocus({
|
|
278
277
|
scrollRef,
|
|
279
278
|
tracks,
|
|
@@ -342,17 +341,13 @@ export function useTimelineProviderState({
|
|
|
342
341
|
isDragging,
|
|
343
342
|
currentTime,
|
|
344
343
|
zoomMode,
|
|
345
|
-
manualZoomPercent,
|
|
346
344
|
zoomModeRef,
|
|
347
|
-
manualZoomPercentRef,
|
|
348
345
|
fitPps,
|
|
349
346
|
fitPpsRef,
|
|
350
347
|
effectiveDuration,
|
|
351
348
|
pps,
|
|
352
349
|
timelineReady,
|
|
353
350
|
elementsLength: timelineElements.length,
|
|
354
|
-
setZoomMode,
|
|
355
|
-
setManualZoomPercent,
|
|
356
351
|
onSeek,
|
|
357
352
|
contentOrigin,
|
|
358
353
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// fallow-ignore-file dead-code
|
|
2
|
-
import { useCallback } from "react";
|
|
3
2
|
import { usePlayerStore, type ZoomMode } from "../store/playerStore";
|
|
3
|
+
import { cancelTimelineZoom, requestTimelineZoom } from "./timelineZoomInput";
|
|
4
4
|
|
|
5
5
|
export interface TimelineZoomState {
|
|
6
6
|
zoomMode: ZoomMode;
|
|
@@ -9,18 +9,13 @@ export interface TimelineZoomState {
|
|
|
9
9
|
setManualZoomPercent: (percent: number) => void;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
/** Shared zoom-related store selectors used by Timeline and TimelineToolbar. */
|
|
13
12
|
export function useTimelineZoom(): TimelineZoomState {
|
|
14
13
|
const zoomMode = usePlayerStore((s) => s.zoomMode);
|
|
15
14
|
const manualZoomPercent = usePlayerStore((s) => s.manualZoomPercent);
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
[setStorePercent],
|
|
24
|
-
);
|
|
25
|
-
return { zoomMode, manualZoomPercent, setZoomMode, setManualZoomPercent };
|
|
15
|
+
const setStoreZoomMode = usePlayerStore((s) => s.setZoomMode);
|
|
16
|
+
const setZoomMode = (mode: ZoomMode) => {
|
|
17
|
+
cancelTimelineZoom();
|
|
18
|
+
setStoreZoomMode(mode);
|
|
19
|
+
};
|
|
20
|
+
return { zoomMode, manualZoomPercent, setZoomMode, setManualZoomPercent: requestTimelineZoom };
|
|
26
21
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
frameDisplayScale,
|
|
2
3
|
inspectRuntimeProtocol,
|
|
3
4
|
runtimeProtocolMetadata,
|
|
4
5
|
type RuntimeProtocolInspection,
|
|
@@ -34,6 +35,11 @@ export function postRuntimeControlMessage(
|
|
|
34
35
|
target?.postMessage(createRuntimeControlMessage(action, payload, fps), "*");
|
|
35
36
|
}
|
|
36
37
|
|
|
38
|
+
export function postFrameDisplayScale(iframe: HTMLIFrameElement | null | undefined): void {
|
|
39
|
+
const scale = iframe && frameDisplayScale(iframe);
|
|
40
|
+
if (scale) postRuntimeControlMessage(iframe.contentWindow, "set-display-scale", { scale });
|
|
41
|
+
}
|
|
42
|
+
|
|
37
43
|
export function inspectStudioRuntimeMessage(value: unknown): RuntimeProtocolInspection {
|
|
38
44
|
return inspectRuntimeProtocol(value, 30);
|
|
39
45
|
}
|