@hyperframes/studio 0.9.59 → 0.9.61
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-bya4hgms.js → hyperframes-player-Cm0hYGm2.js} +1 -1
- package/dist/assets/{index-Bxh5lW0C.js → index-BGrNWeLK.js} +199 -199
- package/dist/assets/{index--dcfSUzI.js → index-REqr_dLu.js} +1 -1
- package/dist/assets/{pausedVideoDecoder-BKym1jA6.js → pausedVideoDecoder-DqLDSq8J.js} +1 -1
- package/dist/{chunk-5EEM5WO4.js → chunk-3KCEIESB.js} +1 -1
- package/dist/{chunk-G6FJSL7X.js → chunk-JTUKMELR.js} +34 -6
- package/dist/index.d.ts +28 -1
- package/dist/index.html +1 -1
- package/dist/index.js +689 -177
- package/dist/player.js +2 -2
- package/dist/ui.js +1 -1
- package/package.json +8 -8
- package/src/captions/components/CaptionOverlay.sealed.test.ts +273 -0
- package/src/captions/components/CaptionOverlay.tsx +112 -57
- package/src/captions/components/CaptionOverlayUtils.ts +319 -33
- package/src/captions/components/CaptionPropertyPanel.tsx +17 -0
- package/src/components/editor/LayersPanel.opaque.test.ts +2 -2
- package/src/components/editor/previewDrafts.test.ts +2 -2
- package/src/components/editor/previewGestureStartRead.test.ts +2 -2
- package/src/components/editor/previewLayers.test.ts +2 -2
- package/src/components/editor/previewOverlayRects.test.ts +2 -2
- package/src/components/editor/previewPointerTargets.test.ts +2 -2
- package/src/components/editor/previewSelection.test.ts +2 -2
- package/src/components/editor/useColorGradingController.sealed.test.ts +165 -0
- package/src/components/editor/useColorGradingController.ts +20 -1
- package/src/components/editor/useColorGradingPreviews.ts +127 -43
- package/src/components/nle/NLEPreview.test.ts +24 -0
- package/src/components/nle/NLEPreview.tsx +2 -6
- package/src/components/nle/previewStage.ts +11 -1
- package/src/components/panels/VariablesPanel.test.tsx +90 -1
- package/src/components/panels/VariablesPanel.tsx +41 -17
- package/src/components/panels/renderHandoff.test.ts +86 -0
- package/src/components/panels/renderHandoff.ts +28 -0
- package/src/components/ui/Menu.test.tsx +77 -0
- package/src/components/ui/Menu.tsx +47 -4
- package/src/components/ui/Popover.tsx +5 -2
- package/src/elementAnimations.test.ts +13 -0
- package/src/hooks/useCaptionDetection.ts +175 -54
- package/src/hooks/usePersistentEditHistory.test.ts +84 -0
- package/src/hooks/usePersistentEditHistory.ts +36 -3
- package/src/index.ts +1 -0
- package/src/player/hooks/useShadowPreviewReload.ts +7 -0
- package/src/player/hooks/useTimelinePlayer.shadowReload.test.ts +20 -0
- package/src/utils/gsapUndoRestore.sealed.test.ts +73 -0
- package/src/utils/gsapUndoRestore.ts +66 -0
- package/src/utils/studioPendingEdits.test.ts +20 -0
- package/src/utils/studioPendingEdits.ts +11 -4
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// @vitest-environment jsdom
|
|
2
2
|
import { describe, expect, it, vi } from "vitest";
|
|
3
3
|
import {
|
|
4
|
+
setStudioPendingEditsSettled,
|
|
4
5
|
addStudioPendingEditFlushListener,
|
|
5
6
|
adoptingStudioPendingEdit,
|
|
6
7
|
beginStudioPendingEdit,
|
|
@@ -514,3 +515,22 @@ it("counts an edit whose later write failed as saved once an earlier write lande
|
|
|
514
515
|
const shown = paintBackNewestStudioPendingEdit()!;
|
|
515
516
|
await expect(shown.landed()).resolves.toBe(true);
|
|
516
517
|
});
|
|
518
|
+
|
|
519
|
+
describe("every pending edit settled", () => {
|
|
520
|
+
it("is told once, when the last of two overlapping edits settles", async () => {
|
|
521
|
+
const told = vi.fn();
|
|
522
|
+
setStudioPendingEditsSettled(told);
|
|
523
|
+
try {
|
|
524
|
+
const first = beginStudioPendingEdit(null);
|
|
525
|
+
const second = beginStudioPendingEdit(null);
|
|
526
|
+
first.settle();
|
|
527
|
+
await Promise.resolve();
|
|
528
|
+
await Promise.resolve();
|
|
529
|
+
expect(told).not.toHaveBeenCalled();
|
|
530
|
+
second.settle();
|
|
531
|
+
await vi.waitFor(() => expect(told).toHaveBeenCalledOnce());
|
|
532
|
+
} finally {
|
|
533
|
+
setStudioPendingEditsSettled(null);
|
|
534
|
+
}
|
|
535
|
+
});
|
|
536
|
+
});
|
|
@@ -33,6 +33,12 @@ let historyClaims: () => number = () => 0;
|
|
|
33
33
|
export function setStudioPendingEditClaimClock(read: (() => number) | null): void {
|
|
34
34
|
historyClaims = read ?? (() => 0);
|
|
35
35
|
}
|
|
36
|
+
|
|
37
|
+
let allSettled: (() => void) | null = null;
|
|
38
|
+
|
|
39
|
+
export function setStudioPendingEditsSettled(run: (() => void) | null): void {
|
|
40
|
+
allSettled = run;
|
|
41
|
+
}
|
|
36
42
|
const NOT_SAVED = () => Promise.resolve(false);
|
|
37
43
|
let cancelWaitingPress: (() => boolean) | null = null;
|
|
38
44
|
|
|
@@ -119,10 +125,11 @@ export function trackStudioPendingEdit(
|
|
|
119
125
|
showAgain: null,
|
|
120
126
|
claimsAtBegin: historyClaims(),
|
|
121
127
|
});
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
()
|
|
125
|
-
|
|
128
|
+
const done = () => {
|
|
129
|
+
pendingEdits.delete(promise);
|
|
130
|
+
if (!pendingEdits.size) allSettled?.();
|
|
131
|
+
};
|
|
132
|
+
promise.then(done, done);
|
|
126
133
|
return promise;
|
|
127
134
|
}
|
|
128
135
|
|