@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.
Files changed (47) hide show
  1. package/dist/assets/{hyperframes-player-bya4hgms.js → hyperframes-player-Cm0hYGm2.js} +1 -1
  2. package/dist/assets/{index-Bxh5lW0C.js → index-BGrNWeLK.js} +199 -199
  3. package/dist/assets/{index--dcfSUzI.js → index-REqr_dLu.js} +1 -1
  4. package/dist/assets/{pausedVideoDecoder-BKym1jA6.js → pausedVideoDecoder-DqLDSq8J.js} +1 -1
  5. package/dist/{chunk-5EEM5WO4.js → chunk-3KCEIESB.js} +1 -1
  6. package/dist/{chunk-G6FJSL7X.js → chunk-JTUKMELR.js} +34 -6
  7. package/dist/index.d.ts +28 -1
  8. package/dist/index.html +1 -1
  9. package/dist/index.js +689 -177
  10. package/dist/player.js +2 -2
  11. package/dist/ui.js +1 -1
  12. package/package.json +8 -8
  13. package/src/captions/components/CaptionOverlay.sealed.test.ts +273 -0
  14. package/src/captions/components/CaptionOverlay.tsx +112 -57
  15. package/src/captions/components/CaptionOverlayUtils.ts +319 -33
  16. package/src/captions/components/CaptionPropertyPanel.tsx +17 -0
  17. package/src/components/editor/LayersPanel.opaque.test.ts +2 -2
  18. package/src/components/editor/previewDrafts.test.ts +2 -2
  19. package/src/components/editor/previewGestureStartRead.test.ts +2 -2
  20. package/src/components/editor/previewLayers.test.ts +2 -2
  21. package/src/components/editor/previewOverlayRects.test.ts +2 -2
  22. package/src/components/editor/previewPointerTargets.test.ts +2 -2
  23. package/src/components/editor/previewSelection.test.ts +2 -2
  24. package/src/components/editor/useColorGradingController.sealed.test.ts +165 -0
  25. package/src/components/editor/useColorGradingController.ts +20 -1
  26. package/src/components/editor/useColorGradingPreviews.ts +127 -43
  27. package/src/components/nle/NLEPreview.test.ts +24 -0
  28. package/src/components/nle/NLEPreview.tsx +2 -6
  29. package/src/components/nle/previewStage.ts +11 -1
  30. package/src/components/panels/VariablesPanel.test.tsx +90 -1
  31. package/src/components/panels/VariablesPanel.tsx +41 -17
  32. package/src/components/panels/renderHandoff.test.ts +86 -0
  33. package/src/components/panels/renderHandoff.ts +28 -0
  34. package/src/components/ui/Menu.test.tsx +77 -0
  35. package/src/components/ui/Menu.tsx +47 -4
  36. package/src/components/ui/Popover.tsx +5 -2
  37. package/src/elementAnimations.test.ts +13 -0
  38. package/src/hooks/useCaptionDetection.ts +175 -54
  39. package/src/hooks/usePersistentEditHistory.test.ts +84 -0
  40. package/src/hooks/usePersistentEditHistory.ts +36 -3
  41. package/src/index.ts +1 -0
  42. package/src/player/hooks/useShadowPreviewReload.ts +7 -0
  43. package/src/player/hooks/useTimelinePlayer.shadowReload.test.ts +20 -0
  44. package/src/utils/gsapUndoRestore.sealed.test.ts +73 -0
  45. package/src/utils/gsapUndoRestore.ts +66 -0
  46. package/src/utils/studioPendingEdits.test.ts +20 -0
  47. 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
- promise.then(
123
- () => pendingEdits.delete(promise),
124
- () => pendingEdits.delete(promise),
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