@hyperframes/studio 0.8.200 → 0.8.201
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-LmRUJE8q.js → hyperframes-player-BNeO6YSP.js} +1 -1
- package/dist/assets/{index-BmTWk8xf.js → index-CZWE0FI8.js} +162 -162
- package/dist/assets/{index-CKNiEwbW.js → index-DiNYtcMK.js} +1 -1
- package/dist/{chunk-ORLUDHTU.js → chunk-J6T4KD7Y.js} +33 -0
- package/dist/index.html +1 -1
- package/dist/index.js +202 -107
- package/dist/player.js +1 -1
- package/package.json +8 -8
- package/src/components/TimelineToolbar.test.tsx +117 -3
- package/src/components/TimelineToolbar.tsx +32 -1
- package/src/components/panels/VariablesBindElement.test.tsx +105 -0
- package/src/components/panels/VariablesBindElement.tsx +2 -2
- package/src/components/panels/VariablesDeclarationForm.test.ts +106 -0
- package/src/components/panels/VariablesDeclarationForm.tsx +21 -3
- package/src/components/panels/VariablesValueControls.tsx +6 -0
- package/src/components/ui/VideoFrameThumbnail.test.tsx +9 -0
- package/src/components/ui/VideoFrameThumbnail.tsx +1 -3
- package/src/hooks/appHotkeysDispatch.ts +7 -0
- package/src/hooks/useAppHotkeys.test.ts +75 -0
- package/src/player/components/EditModal.test.tsx +34 -0
- package/src/player/components/EditModal.tsx +4 -2
- package/src/player/components/studioShortcuts.ts +3 -0
- package/src/player/components/timelineMotion.test.ts +13 -0
- package/src/player/components/timelineMotion.ts +12 -6
- package/src/player/components/timelineZoom.test.ts +48 -0
- package/src/player/components/timelineZoom.ts +55 -0
- package/src/player/components/timelineZoomInput.test.ts +27 -0
- package/src/player/components/timelineZoomInput.ts +55 -8
- package/src/player/lib/timelineIframeHelpers.test.ts +41 -0
- package/src/player/lib/timelineIframeHelpers.ts +5 -2
|
@@ -309,6 +309,7 @@ function writeStudioUiPreferences(patch, storage = getBrowserStorage(), projectI
|
|
|
309
309
|
|
|
310
310
|
// src/player/components/timelineZoom.ts
|
|
311
311
|
var MIN_TIMELINE_ZOOM_PERCENT = 10;
|
|
312
|
+
var TIMELINE_RANGE_MARGIN_PX = 24;
|
|
312
313
|
var MAX_TIMELINE_FRAME_WIDTH_PX = 48;
|
|
313
314
|
var ZOOM_OUT_FACTOR = 0.5;
|
|
314
315
|
var ZOOM_IN_FACTOR = 2;
|
|
@@ -365,6 +366,35 @@ function timelineSliderToZoomPercent(slider, fitPixelsPerSecond) {
|
|
|
365
366
|
const logValue = LOG_MIN + clampedSlider / 100 * (logMax - LOG_MIN);
|
|
366
367
|
return clampTimelineZoomPercent(Math.exp(logValue), fitPixelsPerSecond);
|
|
367
368
|
}
|
|
369
|
+
function positiveClipSpan(clips) {
|
|
370
|
+
let start = Number.POSITIVE_INFINITY;
|
|
371
|
+
let end = Number.NEGATIVE_INFINITY;
|
|
372
|
+
for (const clip of clips) {
|
|
373
|
+
if (!Number.isFinite(clip.start) || !Number.isFinite(clip.end) || !(clip.end > clip.start)) {
|
|
374
|
+
continue;
|
|
375
|
+
}
|
|
376
|
+
if (clip.start < start) start = clip.start;
|
|
377
|
+
if (clip.end > end) end = clip.end;
|
|
378
|
+
}
|
|
379
|
+
if (!Number.isFinite(start) || !(end > start)) return null;
|
|
380
|
+
return { start, end };
|
|
381
|
+
}
|
|
382
|
+
function zoomToSelectedClips(input) {
|
|
383
|
+
const margin = input.marginPx ?? TIMELINE_RANGE_MARGIN_PX;
|
|
384
|
+
const span = positiveClipSpan(input.clips);
|
|
385
|
+
const fitPps = input.fitPixelsPerSecond;
|
|
386
|
+
const viewport = input.viewportWidth;
|
|
387
|
+
const origin = input.contentOrigin;
|
|
388
|
+
if (!span) return null;
|
|
389
|
+
if (!Number.isFinite(fitPps) || !(fitPps > 0)) return null;
|
|
390
|
+
if (!Number.isFinite(viewport) || !Number.isFinite(origin) || !(viewport > origin)) return null;
|
|
391
|
+
const usable = Math.max(1, viewport - origin - margin * 2);
|
|
392
|
+
const zoomPercent = clampTimelineZoomPercent(
|
|
393
|
+
usable / (span.end - span.start) / fitPps * 100,
|
|
394
|
+
fitPps
|
|
395
|
+
);
|
|
396
|
+
return { start: span.start, end: span.end, zoomPercent };
|
|
397
|
+
}
|
|
368
398
|
|
|
369
399
|
// src/player/store/keyframeSlice.ts
|
|
370
400
|
function isRevealedAudioFxRequestCurrent(request, state) {
|
|
@@ -1519,6 +1549,7 @@ export {
|
|
|
1519
1549
|
frameToSeconds,
|
|
1520
1550
|
stepFrameTime,
|
|
1521
1551
|
formatFrameTime,
|
|
1552
|
+
TIMELINE_RANGE_MARGIN_PX,
|
|
1522
1553
|
clampTimelineZoomPercent,
|
|
1523
1554
|
getTimelineZoomPercent,
|
|
1524
1555
|
computePinnedZoomPercent,
|
|
@@ -1527,6 +1558,8 @@ export {
|
|
|
1527
1558
|
getPinchTimelineZoomPercent,
|
|
1528
1559
|
timelineZoomPercentToSlider,
|
|
1529
1560
|
timelineSliderToZoomPercent,
|
|
1561
|
+
positiveClipSpan,
|
|
1562
|
+
zoomToSelectedClips,
|
|
1530
1563
|
isRevealedAudioFxRequestCurrent,
|
|
1531
1564
|
isFocusedEaseRequestCurrent,
|
|
1532
1565
|
effectiveThumbnailMode,
|
package/dist/index.html
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
document.documentElement.dataset.theme = "paper";
|
|
15
15
|
}
|
|
16
16
|
</script>
|
|
17
|
-
<script type="module" crossorigin src="/assets/index-
|
|
17
|
+
<script type="module" crossorigin src="/assets/index-CZWE0FI8.js"></script>
|
|
18
18
|
<link rel="stylesheet" crossorigin href="/assets/index-CYbvOVp-.css">
|
|
19
19
|
</head>
|
|
20
20
|
<body>
|