@hyperframes/studio 0.6.110 → 0.6.111

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 (58) hide show
  1. package/dist/assets/index-B7S86vK1.js +370 -0
  2. package/dist/assets/index-DP8pPIk2.css +1 -0
  3. package/dist/assets/{index-CfiyaR7G.js → index-_IV-vm9l.js} +1 -1
  4. package/dist/assets/{index-CXy_mWnP.js → index-x0c2-zQN.js} +1 -1
  5. package/dist/index.html +2 -2
  6. package/package.json +8 -5
  7. package/src/App.tsx +133 -141
  8. package/src/components/StudioHeader.tsx +44 -0
  9. package/src/components/StudioOverlays.tsx +70 -0
  10. package/src/components/editor/SourceEditor.tsx +19 -16
  11. package/src/components/editor/manualEditingAvailability.ts +25 -7
  12. package/src/components/storyboard/FramePoster.tsx +56 -0
  13. package/src/components/storyboard/StoryboardDirection.tsx +45 -0
  14. package/src/components/storyboard/StoryboardFrameFocus.tsx +262 -0
  15. package/src/components/storyboard/StoryboardFrameTile.tsx +88 -0
  16. package/src/components/storyboard/StoryboardGrid.tsx +33 -0
  17. package/src/components/storyboard/StoryboardLoaded.tsx +136 -0
  18. package/src/components/storyboard/StoryboardScriptPanel.tsx +26 -0
  19. package/src/components/storyboard/StoryboardSourceEditor.tsx +231 -0
  20. package/src/components/storyboard/StoryboardStatusLegend.tsx +21 -0
  21. package/src/components/storyboard/StoryboardView.tsx +78 -0
  22. package/src/components/storyboard/frameStatus.ts +36 -0
  23. package/src/contexts/ViewModeContext.tsx +98 -0
  24. package/src/hooks/gsapScriptCommitTypes.ts +4 -7
  25. package/src/hooks/sdkSelfWriteRegistry.test.ts +67 -0
  26. package/src/hooks/sdkSelfWriteRegistry.ts +77 -0
  27. package/src/hooks/timelineEditingHelpers.ts +2 -0
  28. package/src/hooks/useAppHotkeys.ts +20 -0
  29. package/src/hooks/useDomEditCommits.ts +43 -14
  30. package/src/hooks/useDomEditSession.test.ts +41 -0
  31. package/src/hooks/useDomEditSession.ts +38 -6
  32. package/src/hooks/useDomGeometryCommits.ts +5 -9
  33. package/src/hooks/useElementLifecycleOps.ts +30 -0
  34. package/src/hooks/useGsapAnimationOps.ts +78 -51
  35. package/src/hooks/useGsapKeyframeOps.ts +127 -43
  36. package/src/hooks/useGsapPropertyDebounce.test.ts +70 -0
  37. package/src/hooks/useGsapPropertyDebounce.ts +201 -23
  38. package/src/hooks/useGsapPropertyDebounceFlush.test.ts +85 -0
  39. package/src/hooks/useGsapScriptCommits.ts +95 -40
  40. package/src/hooks/useSdkSession.test.ts +12 -0
  41. package/src/hooks/useSdkSession.ts +91 -25
  42. package/src/hooks/useStoryboard.ts +80 -0
  43. package/src/hooks/useTimelineEditing.ts +163 -68
  44. package/src/utils/gsapSoftReload.ts +14 -0
  45. package/src/utils/sdkCutover.gate.test.ts +61 -0
  46. package/src/utils/sdkCutover.test.ts +839 -0
  47. package/src/utils/sdkCutover.ts +465 -0
  48. package/src/utils/sdkOpMapping.ts +43 -0
  49. package/src/utils/sdkResolverShadow.test.ts +366 -0
  50. package/src/utils/sdkResolverShadow.ts +313 -0
  51. package/dist/assets/index-1C8oFiPi.css +0 -1
  52. package/dist/assets/index-D-3sGz65.js +0 -296
  53. package/src/utils/sdkShadow.test.ts +0 -606
  54. package/src/utils/sdkShadow.ts +0 -517
  55. package/src/utils/sdkShadowGsapFidelity.ts +0 -296
  56. package/src/utils/sdkShadowGsapKeyframe.test.ts +0 -265
  57. package/src/utils/sdkShadowGsapKeyframe.ts +0 -257
  58. package/src/utils/sdkShadowNumeric.ts +0 -11
@@ -0,0 +1,61 @@
1
+ import { describe, expect, it, vi } from "vitest";
2
+
3
+ // Dark-launch contract: with STUDIO_SDK_CUTOVER_ENABLED=false, EVERY cutover
4
+ // persist chokepoint must return false so the caller takes the legacy server
5
+ // path — even when a valid SDK session exists (one always does, for
6
+ // shadow/selection). This is the contract the prod flag-flip rests on; a future
7
+ // refactor of the gate guards that silently re-enables cutover on flag-off
8
+ // turns these red. (sdkCutover.test.ts mocks the flag TRUE; this is its sibling.)
9
+ vi.mock("../components/editor/manualEditingAvailability", () => ({
10
+ STUDIO_SDK_CUTOVER_ENABLED: false,
11
+ STUDIO_SDK_RESOLVER_SHADOW_ENABLED: false,
12
+ }));
13
+ vi.mock("./studioTelemetry", () => ({ trackStudioEvent: vi.fn() }));
14
+
15
+ import { sdkTimingPersist, sdkGsapTweenPersist, sdkDeletePersist } from "./sdkCutover";
16
+
17
+ const makeSession = () =>
18
+ ({
19
+ getElement: () => ({ inlineStyles: {} }),
20
+ serialize: () => "<html></html>",
21
+ batch: (fn: () => void) => fn(),
22
+ setTiming: vi.fn(),
23
+ dispatch: vi.fn(),
24
+ }) as never;
25
+
26
+ const makeDeps = () =>
27
+ ({
28
+ editHistory: { recordEdit: vi.fn().mockResolvedValue(undefined) },
29
+ writeProjectFile: vi.fn().mockResolvedValue(undefined),
30
+ reloadPreview: vi.fn(),
31
+ domEditSaveTimestampRef: { current: 0 },
32
+ }) as never;
33
+
34
+ describe("dark-launch gate — STUDIO_SDK_CUTOVER_ENABLED=false ⇒ persist returns false", () => {
35
+ it("sdkTimingPersist falls back without writing", async () => {
36
+ const deps = makeDeps();
37
+ expect(await sdkTimingPersist("hf-a", "/c.html", { start: 1 }, makeSession(), deps)).toBe(
38
+ false,
39
+ );
40
+ expect(
41
+ (deps as unknown as { writeProjectFile: ReturnType<typeof vi.fn> }).writeProjectFile,
42
+ ).not.toHaveBeenCalled();
43
+ });
44
+
45
+ it("sdkGsapTweenPersist (shared GSAP-op chokepoint) falls back", async () => {
46
+ expect(
47
+ await sdkGsapTweenPersist(
48
+ "/c.html",
49
+ { kind: "remove", animationId: "a" },
50
+ makeSession(),
51
+ makeDeps(),
52
+ ),
53
+ ).toBe(false);
54
+ });
55
+
56
+ it("sdkDeletePersist falls back", async () => {
57
+ expect(
58
+ await sdkDeletePersist("hf-a", "<html></html>", "/c.html", makeSession(), makeDeps()),
59
+ ).toBe(false);
60
+ });
61
+ });