@hyperframes/studio 0.8.51 → 0.8.53-desktop.0

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 (160) hide show
  1. package/dist/assets/{hyperframes-player-Cn_PpHqP.js → hyperframes-player-PTEnAHhg.js} +1 -1
  2. package/dist/assets/{index-CPS3Cvj8.js → index--myXp8ui.js} +1 -1
  3. package/dist/assets/{index-Clrb11lj.js → index-BjslOS9g.js} +1 -1
  4. package/dist/assets/index-BnXZuIJD.css +1 -0
  5. package/dist/assets/index-CNyviK_l.js +390 -0
  6. package/dist/index.css +29 -0
  7. package/dist/index.css.map +1 -0
  8. package/dist/index.d.ts +808 -12
  9. package/dist/index.html +2 -2
  10. package/dist/index.js +8109 -7583
  11. package/dist/index.js.map +1 -1
  12. package/package.json +9 -7
  13. package/src/App.tsx +45 -50
  14. package/src/captions/components/CaptionOverlay.sender.test.tsx +52 -0
  15. package/src/captions/components/CaptionOverlay.tsx +8 -4
  16. package/src/components/EditorShell.selectionSync.test.tsx +9 -4
  17. package/src/components/EditorShell.tsx +56 -56
  18. package/src/components/RightPanelTabs.test.tsx +151 -0
  19. package/src/components/RightPanelTabs.tsx +59 -0
  20. package/src/components/StudioHeader.dom.test.tsx +181 -0
  21. package/src/components/StudioHeader.test.ts +0 -12
  22. package/src/components/StudioHeader.tsx +117 -160
  23. package/src/components/StudioLeftPanels.tsx +202 -0
  24. package/src/components/{StudioRightPanel.tsx → StudioRightPanels.tsx} +57 -194
  25. package/src/components/{StudioRightPanel.types.ts → StudioRightPanels.types.ts} +4 -3
  26. package/src/components/TimelineHistoryButtons.dom.test.tsx +117 -0
  27. package/src/components/TimelineHistoryButtons.tsx +54 -0
  28. package/src/components/TimelineToolbar.test.tsx +8 -0
  29. package/src/components/TimelineToolbar.tsx +3 -7
  30. package/src/components/dock/Dock.test.tsx +100 -18
  31. package/src/components/dock/Dock.tsx +32 -5
  32. package/src/components/dock/dock.css +5 -0
  33. package/src/components/dock/dockAccessibility.test.ts +166 -0
  34. package/src/components/dock/dockAccessibility.ts +98 -0
  35. package/src/components/dock/dockLayout.test.ts +134 -0
  36. package/src/components/dock/dockLayout.ts +53 -6
  37. package/src/components/dock/dockLayoutStore.test.ts +28 -0
  38. package/src/components/dock/dockLayoutStore.ts +21 -4
  39. package/src/components/dock/dockTestHarness.ts +11 -0
  40. package/src/components/editor/LayersPanel.test.ts +97 -1
  41. package/src/components/editor/LayersPanel.tsx +4 -2
  42. package/src/components/editor/PreviewGuides.tsx +1 -1
  43. package/src/components/editor/SnapToolbar.test.tsx +0 -3
  44. package/src/components/editor/TopologyLens.test.tsx +28 -0
  45. package/src/components/editor/TopologyLens.tsx +3 -1
  46. package/src/components/editor/useColorGradingController.test.ts +38 -0
  47. package/src/components/editor/useColorGradingController.ts +9 -1
  48. package/src/components/editor/useColorGradingPreviews.test.ts +76 -0
  49. package/src/components/editor/useColorGradingPreviews.ts +11 -1
  50. package/src/components/editor/usePreviewCompositionRect.test.tsx +95 -0
  51. package/src/components/editor/usePreviewCompositionRect.ts +21 -0
  52. package/src/components/nle/NLEContext.tsx +0 -43
  53. package/src/components/nle/NLEPreview.tsx +1 -1
  54. package/src/components/nle/PreviewPane.tsx +1 -1
  55. package/src/components/nle/TimelinePane.tsx +53 -67
  56. package/src/components/panels/SlideshowPanel.tsx +1 -1
  57. package/src/components/panels/VariablesPanel.tsx +1 -1
  58. package/src/components/pointerTargetSize.test.tsx +8 -0
  59. package/src/components/renders/RenderQueue.tsx +1 -1
  60. package/src/components/renders/RenderQueuePanel.tsx +1 -1
  61. package/src/components/sidebar/{LeftSidebar.masterComposition.test.tsx → CompositionsPanel.masterComposition.test.tsx} +6 -9
  62. package/src/components/sidebar/CompositionsPanel.tsx +15 -0
  63. package/src/components/sidebar/{LeftSidebar.lintBadge.test.tsx → SidebarLintButton.test.tsx} +6 -11
  64. package/src/components/sidebar/SidebarLintButton.tsx +50 -0
  65. package/src/components/timelineToolbarStyles.ts +5 -0
  66. package/src/components/ui/Button.test.tsx +222 -30
  67. package/src/components/ui/Button.tsx +88 -125
  68. package/src/components/ui/IconButton.tsx +38 -0
  69. package/src/components/ui/Input.tsx +115 -0
  70. package/src/components/ui/Menu.test.tsx +374 -0
  71. package/src/components/ui/Menu.tsx +213 -0
  72. package/src/components/ui/NumberField.tsx +122 -0
  73. package/src/components/ui/Popover.tsx +74 -0
  74. package/src/components/ui/Select.tsx +100 -0
  75. package/src/components/ui/Slider.tsx +153 -0
  76. package/src/components/ui/Tabs.test.tsx +98 -0
  77. package/src/components/ui/Tabs.tsx +71 -0
  78. package/src/components/ui/Toggle.tsx +63 -0
  79. package/src/components/ui/Tooltip.test.tsx +110 -0
  80. package/src/components/ui/Tooltip.tsx +38 -112
  81. package/src/components/ui/cn.test.ts +30 -0
  82. package/src/components/ui/cn.ts +25 -0
  83. package/src/components/ui/index.ts +29 -2
  84. package/src/components/ui/mountHost.testHelpers.ts +24 -0
  85. package/src/components/ui/valueControls.test.tsx +524 -0
  86. package/src/contexts/PanelLayoutContext.tsx +3 -57
  87. package/src/hooks/appHotkeysDispatch.ts +3 -4
  88. package/src/hooks/timelineEditPermission.ts +31 -0
  89. package/src/hooks/useAppHotkeys.previewForwarding.test.tsx +0 -2
  90. package/src/hooks/useAppHotkeys.test.ts +0 -1
  91. package/src/hooks/useAppHotkeys.textEditing.test.tsx +0 -3
  92. package/src/hooks/useAppHotkeys.ts +20 -83
  93. package/src/hooks/useCaptionDetection.sender.test.tsx +46 -0
  94. package/src/hooks/useCaptionDetection.ts +3 -1
  95. package/src/hooks/useDomEditPreviewSync.ts +4 -6
  96. package/src/hooks/useDomEditSession.ts +0 -7
  97. package/src/hooks/useDomEditWiring.ts +4 -9
  98. package/src/hooks/useEditHistoryActions.test.tsx +90 -0
  99. package/src/hooks/useEditHistoryActions.ts +106 -0
  100. package/src/hooks/useFileManager.ts +21 -123
  101. package/src/hooks/usePanelLayout.test.ts +108 -296
  102. package/src/hooks/usePanelLayout.ts +50 -255
  103. package/src/hooks/usePersistentEditHistory.ts +1 -1
  104. package/src/hooks/useProjectFileWriter.ts +150 -0
  105. package/src/hooks/useRightPanelIntents.test.ts +181 -0
  106. package/src/hooks/useRightPanelIntents.ts +63 -0
  107. package/src/hooks/useServerConnection.hashProject.test.tsx +94 -0
  108. package/src/hooks/useServerConnection.ts +43 -10
  109. package/src/hooks/useSlideshowTabState.test.ts +9 -31
  110. package/src/hooks/useSlideshowTabState.ts +6 -19
  111. package/src/hooks/useStudioContextValue.test.ts +6 -18
  112. package/src/hooks/useStudioContextValue.ts +5 -26
  113. package/src/hooks/useTimelineDeleteOps.test.tsx +111 -0
  114. package/src/hooks/useTimelineEditing.test.tsx +322 -3
  115. package/src/hooks/useTimelineEditing.ts +103 -16
  116. package/src/hooks/useTimelineEditingTypes.ts +3 -0
  117. package/src/hooks/useTrackPendingTimelineEdit.test.tsx +62 -0
  118. package/src/hooks/useTrackPendingTimelineEdit.ts +22 -0
  119. package/src/hostMount.test.tsx +222 -0
  120. package/src/index.ts +87 -0
  121. package/src/player/components/AutomationSelectionMenu.tsx +1 -1
  122. package/src/player/components/Timeline.tsx +1 -1
  123. package/src/player/components/TimelineCanvas.tsx +4 -4
  124. package/src/player/components/TimelineClip.tsx +0 -1
  125. package/src/player/components/TimelineTrackHeader.test.tsx +26 -5
  126. package/src/player/components/TimelineTrackHeader.tsx +1 -1
  127. package/src/player/components/timelineTheme.test.ts +4 -4
  128. package/src/player/components/timelineTheme.ts +30 -30
  129. package/src/player/lib/playbackShortcuts.ts +2 -0
  130. package/src/player/lib/timelinePerformanceDiagnostics.test.ts +3 -2
  131. package/src/player/lib/timelinePerformanceDiagnostics.ts +1 -1
  132. package/src/player/store/previewIframeStore.notify.test.tsx +75 -0
  133. package/src/player/store/previewIframeStore.test.tsx +29 -0
  134. package/src/player/store/previewIframeStore.ts +25 -0
  135. package/src/renderQueueExports.test.tsx +58 -0
  136. package/src/styles/classCandidates.test.ts +105 -0
  137. package/src/styles/classCandidates.ts +281 -0
  138. package/src/styles/hex-baseline.json +84 -0
  139. package/src/styles/hexRatchet.test.ts +201 -0
  140. package/src/styles/styleSources.test.ts +20 -0
  141. package/src/styles/styleSources.ts +47 -0
  142. package/src/styles/theme.css +57 -0
  143. package/src/styles/theme.test.ts +2 -15
  144. package/src/styles/tokenGate.test.ts +109 -0
  145. package/src/utils/sourcePatcher.ts +1 -1
  146. package/src/utils/studioHelpers.test.ts +18 -0
  147. package/src/utils/studioHelpers.ts +11 -8
  148. package/src/utils/studioUiPreferences.test.ts +10 -16
  149. package/src/utils/studioUiPreferences.ts +0 -16
  150. package/src/utils/typingTarget.ts +4 -0
  151. package/dist/assets/index-C05SNrvY.js +0 -360
  152. package/dist/assets/index-DUR9qzQM.css +0 -1
  153. package/src/components/PanelTabButton.tsx +0 -31
  154. package/src/components/StudioLeftSidebar.tsx +0 -207
  155. package/src/components/nle/TimelineResizeDivider.tsx +0 -101
  156. package/src/components/sidebar/LeftSidebar.storage.test.ts +0 -28
  157. package/src/components/sidebar/LeftSidebar.tsx +0 -348
  158. package/src/hooks/useInspectorSplitResize.ts +0 -51
  159. package/src/utils/fitPanels.test.ts +0 -164
  160. package/src/utils/fitPanels.ts +0 -151
@@ -1,151 +0,0 @@
1
- /**
2
- * Panel reconciliation for the Studio shell.
3
- *
4
- * The shell is `[sidebar | preview | inspector]` over a full-width timeline.
5
- * Only the preview is flexible (`flex-1 min-w-0`), so without an explicit floor
6
- * it absorbs every squeeze: at a 560px window the old 240/320 panel floors alone
7
- * overflowed the viewport and the preview rendered at 2px, on a *fresh* load.
8
- * The same held vertically once the window was resized after mount.
9
- *
10
- * Every caller (mount, resize, drag, keyboard nudge, preference restore) routes
11
- * through {@link fitPanelWidths} / {@link fitTimelineHeight} so exactly one place
12
- * decides who yields. The rule is: the preview gets its floor first, panels
13
- * shrink toward their minimums, then collapse to rails.
14
- */
15
-
16
- /** Smallest preview box worth editing in. Chosen, not derived — see the plan. */
17
- export const MIN_PREVIEW_W = 360;
18
- export const MIN_PREVIEW_H = 200;
19
-
20
- const MIN_LEFT = 200;
21
- const MIN_RIGHT = 280;
22
- /**
23
- * Collapsed sidebar rail, as a layout FOOTPRINT: the `w-10` box (40) plus the
24
- * `mr-0.5` gap (2) it contributes to the flex row. Measured in the browser at a
25
- * 760px window: rail box 40, margin-right 2, preview starts at x=43.
26
- */
27
- export const RAIL_W = 42;
28
- export const MIN_TIMELINE_H = 100;
29
-
30
- /** The two 3px resize seams between the three top-row panels. */
31
- const PANEL_SEAM_W = 6;
32
-
33
- /** No single panel may claim more than this share of the window. */
34
- const PANEL_MAX_RATIO = 0.4;
35
-
36
- /*
37
- * Thresholds below are DERIVED from the minimums above, not chosen:
38
- *
39
- * MIN_LEFT 200 + MIN_RIGHT 280 + MIN_PREVIEW_W 360 + PANEL_SEAM_W 6 = 846
40
- * -> below ~860 the sidebar can no longer fit at its minimum.
41
- * RAIL_W 40 + MIN_RIGHT 280 + MIN_PREVIEW_W 360 + PANEL_SEAM_W 6 = 686
42
- * -> below ~700 the inspector can no longer fit either.
43
- *
44
- * Change a minimum and move the matching threshold with it.
45
- */
46
- const RAIL_LEFT_BELOW = 860;
47
- const RAIL_RIGHT_BELOW = 700;
48
-
49
- /**
50
- * True when the window is narrow enough to force at least one panel to a rail.
51
- * The sidebar threshold is the wider of the two, so it is the whole condition.
52
- */
53
- export function railsEngaged(viewportWidth: number): boolean {
54
- return viewportWidth < RAIL_LEFT_BELOW;
55
- }
56
-
57
- export interface PanelWidths {
58
- left: number;
59
- right: number;
60
- }
61
-
62
- export interface FittedPanelWidths extends PanelWidths {
63
- preview: number;
64
- /**
65
- * Width-driven collapse. Derived per render; NEVER persisted and never written
66
- * back to the user's own collapse preference — `leftCollapsed` lives in
67
- * localStorage and `rightCollapsed` is synced into the shareable Studio URL,
68
- * so a ten-second window drag must not rewrite either.
69
- */
70
- autoCollapseLeft: boolean;
71
- autoCollapseRight: boolean;
72
- }
73
-
74
- function clamp(value: number, min: number, max: number): number {
75
- return Math.max(min, Math.min(max, value));
76
- }
77
-
78
- /**
79
- * The width each panel wants on a given viewport, before reconciliation.
80
- * Upper bounds (384 / 424) are unchanged from the original implementation, which
81
- * is what keeps windows at or above 1280px byte-identical to before.
82
- */
83
- export function defaultPanelWidths(viewportWidth: number): PanelWidths {
84
- return {
85
- left: Math.max(MIN_LEFT, Math.min(384, Math.round(viewportWidth * 0.257))),
86
- right: Math.max(MIN_RIGHT, Math.min(424, Math.round(viewportWidth * 0.284))),
87
- };
88
- }
89
-
90
- /**
91
- * Resolve preferred panel widths against the viewport, reserving the preview.
92
- *
93
- * Order of yielding: window-relative cap, then the inspector shrinks toward its
94
- * minimum, then the sidebar, then rails. A viewport of 0 (element not measured
95
- * yet) returns the preferences untouched so a pre-measurement frame cannot
96
- * clobber a real preference.
97
- */
98
- // fallow-ignore-next-line complexity
99
- export function fitPanelWidths(
100
- viewportWidth: number,
101
- preferred: PanelWidths,
102
- /**
103
- * Sides the user explicitly reopened while the window was narrow. A side
104
- * listed here keeps its real width instead of the rail: without this the
105
- * panel would render expanded at 42px and squash its own content.
106
- */
107
- reopened: { left: boolean; right: boolean } = { left: false, right: false },
108
- ): FittedPanelWidths {
109
- const vw = Number.isFinite(viewportWidth) ? Math.max(0, viewportWidth) : 0;
110
- if (vw <= 0) {
111
- return { ...preferred, preview: 0, autoCollapseLeft: false, autoCollapseRight: false };
112
- }
113
-
114
- const autoCollapseLeft = vw < RAIL_LEFT_BELOW && !reopened.left;
115
- const autoCollapseRight = vw < RAIL_RIGHT_BELOW && !reopened.right;
116
- const cap = Math.floor(vw * PANEL_MAX_RATIO);
117
-
118
- // A railed panel's floor is its rail width; an open panel's floor is its
119
- // minimum usable width. Without this split the squeeze fallback below would
120
- // drive an *expanded* sidebar down to 40px and render its content unusable.
121
- const leftFloor = autoCollapseLeft ? RAIL_W : MIN_LEFT;
122
- const rightFloor = autoCollapseRight ? 0 : MIN_RIGHT;
123
-
124
- let left = autoCollapseLeft ? RAIL_W : clamp(preferred.left, MIN_LEFT, Math.max(MIN_LEFT, cap));
125
- let right = autoCollapseRight ? 0 : clamp(preferred.right, MIN_RIGHT, Math.max(MIN_RIGHT, cap));
126
-
127
- const budget = vw - MIN_PREVIEW_W - PANEL_SEAM_W;
128
- if (left + right > budget) right = Math.max(rightFloor, budget - left);
129
- if (left + right > budget) left = Math.max(leftFloor, budget - right);
130
-
131
- return {
132
- left,
133
- right,
134
- preview: Math.max(0, vw - left - right - PANEL_SEAM_W),
135
- autoCollapseLeft,
136
- autoCollapseRight,
137
- };
138
- }
139
-
140
- /**
141
- * Resolve a preferred timeline height against the shell's measured height.
142
- *
143
- * Subsumes the clamping that used to be inlined in TimelineResizeDivider's
144
- * pointer and keyboard handlers and duplicated (mount-only) in NLEContext.
145
- */
146
- export function fitTimelineHeight(containerHeight: number, preferred: number): number {
147
- const h = Number.isFinite(containerHeight) ? containerHeight : 0;
148
- const wanted = Number.isFinite(preferred) ? preferred : MIN_TIMELINE_H;
149
- if (h <= 0) return Math.max(MIN_TIMELINE_H, wanted);
150
- return clamp(wanted, MIN_TIMELINE_H, Math.max(MIN_TIMELINE_H, h - MIN_PREVIEW_H));
151
- }