@hyperframes/studio 0.7.58 → 0.7.59

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 (156) hide show
  1. package/dist/assets/{hyperframes-player-CtTDO63S.js → hyperframes-player-Bm07FLkl.js} +1 -1
  2. package/dist/assets/{index-C47jAC3Q.js → index-B995FG46.js} +1 -1
  3. package/dist/assets/index-CrkAdJkb.js +426 -0
  4. package/dist/assets/index-Dj5p8U_A.css +1 -0
  5. package/dist/assets/{index-DeQPzqwH.js → index-FvzmPhfG.js} +1 -1
  6. package/dist/index.d.ts +12 -3
  7. package/dist/index.html +2 -2
  8. package/dist/index.js +13514 -8528
  9. package/dist/index.js.map +1 -1
  10. package/dist/styles/tailwind-preset.d.ts +5 -0
  11. package/dist/styles/tailwind-preset.js +8 -1
  12. package/dist/styles/tailwind-preset.js.map +1 -1
  13. package/package.json +7 -7
  14. package/src/App.tsx +3 -3
  15. package/src/components/DesignPanelPromoteProvider.tsx +15 -2
  16. package/src/components/StudioRightPanel.tsx +29 -51
  17. package/src/components/editor/AnimationCard.test.tsx +134 -0
  18. package/src/components/editor/AnimationCard.tsx +19 -4
  19. package/src/components/editor/ArcPathControls.tsx +1 -0
  20. package/src/components/editor/GestureRecordControl.tsx +7 -1
  21. package/src/components/editor/GsapAnimationSection.tsx +109 -14
  22. package/src/components/editor/InspectorHeaderActions.tsx +42 -4
  23. package/src/components/editor/PropertyPanel.test.tsx +948 -0
  24. package/src/components/editor/PropertyPanel.tsx +144 -148
  25. package/src/components/editor/PropertyPanelEmptyState.test.tsx +74 -0
  26. package/src/components/editor/PropertyPanelEmptyState.tsx +179 -1
  27. package/src/components/editor/PropertyPanelFlat.tsx +580 -0
  28. package/src/components/editor/PropertyPanelFlatFooter.test.tsx +83 -0
  29. package/src/components/editor/PropertyPanelFlatFooter.tsx +73 -0
  30. package/src/components/editor/PropertyPanelFlatHeader.test.tsx +79 -0
  31. package/src/components/editor/PropertyPanelFlatHeader.tsx +112 -0
  32. package/src/components/editor/gsapAnimationCallbacks.ts +27 -0
  33. package/src/components/editor/gsapLivePreview.ts +34 -0
  34. package/src/components/editor/manualEditingAvailability.test.ts +10 -0
  35. package/src/components/editor/manualEditingAvailability.ts +9 -0
  36. package/src/components/editor/propertyPanel3dTransform.tsx +5 -0
  37. package/src/components/editor/propertyPanelColor.test.tsx +28 -0
  38. package/src/components/editor/propertyPanelColor.tsx +31 -1
  39. package/src/components/editor/propertyPanelColorGradingControls.tsx +11 -2
  40. package/src/components/editor/propertyPanelColorGradingSection.tsx +45 -365
  41. package/src/components/editor/propertyPanelColorGradingSlider.tsx +19 -5
  42. package/src/components/editor/propertyPanelFill.tsx +22 -5
  43. package/src/components/editor/propertyPanelFlatColorGradingSection.test.tsx +622 -0
  44. package/src/components/editor/propertyPanelFlatColorGradingSection.tsx +570 -0
  45. package/src/components/editor/propertyPanelFlatLayoutSection.test.tsx +293 -0
  46. package/src/components/editor/propertyPanelFlatLayoutSection.tsx +383 -0
  47. package/src/components/editor/propertyPanelFlatMaskInsetRows.tsx +102 -0
  48. package/src/components/editor/propertyPanelFlatMediaSection.test.tsx +436 -0
  49. package/src/components/editor/propertyPanelFlatMediaSection.tsx +286 -0
  50. package/src/components/editor/propertyPanelFlatMotionSection.test.tsx +272 -0
  51. package/src/components/editor/propertyPanelFlatMotionSection.tsx +315 -0
  52. package/src/components/editor/propertyPanelFlatPrimitives.test.tsx +1174 -0
  53. package/src/components/editor/propertyPanelFlatPrimitives.tsx +563 -0
  54. package/src/components/editor/propertyPanelFlatSelectRow.tsx +101 -0
  55. package/src/components/editor/propertyPanelFlatStyleHelpers.test.ts +23 -0
  56. package/src/components/editor/propertyPanelFlatStyleHelpers.ts +27 -0
  57. package/src/components/editor/propertyPanelFlatStyleSections.test.tsx +598 -0
  58. package/src/components/editor/propertyPanelFlatStyleSections.tsx +516 -0
  59. package/src/components/editor/propertyPanelFlatTextSection.test.tsx +465 -0
  60. package/src/components/editor/propertyPanelFlatTextSection.tsx +407 -0
  61. package/src/components/editor/propertyPanelFlatTimingDerivation.test.ts +71 -0
  62. package/src/components/editor/propertyPanelFlatTimingDerivation.ts +59 -0
  63. package/src/components/editor/propertyPanelFlatToggle.test.tsx +63 -0
  64. package/src/components/editor/propertyPanelFlatToggle.tsx +53 -0
  65. package/src/components/editor/propertyPanelFont.test.tsx +30 -0
  66. package/src/components/editor/propertyPanelFont.tsx +136 -95
  67. package/src/components/editor/propertyPanelHelpers.ts +73 -0
  68. package/src/components/editor/propertyPanelInputCoverage.test.tsx +587 -0
  69. package/src/components/editor/propertyPanelMediaSection.tsx +10 -0
  70. package/src/components/editor/propertyPanelPrimitives.tsx +60 -29
  71. package/src/components/editor/propertyPanelSections.test.tsx +161 -0
  72. package/src/components/editor/propertyPanelSections.tsx +154 -90
  73. package/src/components/editor/propertyPanelStyleSections.tsx +12 -1
  74. package/src/components/editor/propertyPanelTimingSection.tsx +1 -1
  75. package/src/components/editor/propertyPanelTypes.ts +14 -1
  76. package/src/components/editor/propertyPanelValueTier.test.ts +32 -0
  77. package/src/components/editor/propertyPanelValueTier.ts +28 -0
  78. package/src/components/editor/useColorGradingController.test.ts +418 -0
  79. package/src/components/editor/useColorGradingController.ts +596 -0
  80. package/src/components/panels/VariablesPanel.tsx +4 -0
  81. package/src/components/sidebar/CompositionsTab.test.ts +28 -2
  82. package/src/components/sidebar/CompositionsTab.tsx +3 -1
  83. package/src/components/storyboard/FramePoster.tsx +24 -4
  84. package/src/components/storyboard/StoryboardFrameFocus.tsx +4 -0
  85. package/src/components/storyboard/StoryboardFrameTile.tsx +30 -1
  86. package/src/components/storyboard/StoryboardGrid.tsx +23 -1
  87. package/src/components/storyboard/StoryboardLoaded.tsx +58 -2
  88. package/src/components/storyboard/StoryboardView.tsx +9 -2
  89. package/src/components/storyboard/frameComments.test.ts +95 -0
  90. package/src/components/storyboard/frameComments.ts +115 -0
  91. package/src/components/storyboard/useFrameComments.ts +82 -0
  92. package/src/contexts/DesignPanelInputContext.test.tsx +81 -0
  93. package/src/contexts/DesignPanelInputContext.tsx +48 -0
  94. package/src/contexts/DomEditContext.tsx +4 -0
  95. package/src/contexts/VariablePromoteContext.test.tsx +67 -0
  96. package/src/contexts/VariablePromoteContext.tsx +10 -5
  97. package/src/hooks/domEditCommitRunner.ts +11 -0
  98. package/src/hooks/gsapScriptCommitTypes.ts +6 -4
  99. package/src/hooks/timelineTrackVisibility.test.ts +52 -0
  100. package/src/hooks/timelineTrackVisibility.ts +27 -10
  101. package/src/hooks/useAppHotkeys.ts +9 -0
  102. package/src/hooks/useDomEditAttributeCommits.ts +123 -1
  103. package/src/hooks/useDomEditCommits.ts +29 -175
  104. package/src/hooks/useDomEditCommitsHelpers.ts +158 -0
  105. package/src/hooks/useDomEditSession.ts +17 -5
  106. package/src/hooks/useDomEditTextCommits.ts +14 -9
  107. package/src/hooks/useDomEditWiring.ts +10 -9
  108. package/src/hooks/useElementLifecycleOps.ts +8 -3
  109. package/src/hooks/useFileManager.projectOwnership.test.tsx +98 -0
  110. package/src/hooks/useFileManager.ts +82 -60
  111. package/src/hooks/useGsapAnimationOps.ts +7 -6
  112. package/src/hooks/useGsapKeyframeOps.ts +6 -5
  113. package/src/hooks/useGsapPropertyDebounce.ts +43 -28
  114. package/src/hooks/useGsapPropertyDebounceFlush.test.ts +35 -0
  115. package/src/hooks/useGsapScriptCommits.test.tsx +48 -2
  116. package/src/hooks/useGsapScriptCommits.ts +150 -50
  117. package/src/hooks/useGsapSelectionHandlers.test.tsx +116 -0
  118. package/src/hooks/useGsapSelectionHandlers.ts +94 -31
  119. package/src/hooks/useInspectorSplitResize.ts +51 -0
  120. package/src/hooks/usePersistentEditHistory.projectOwnership.test.tsx +60 -0
  121. package/src/hooks/usePersistentEditHistory.test.ts +49 -1
  122. package/src/hooks/usePersistentEditHistory.ts +71 -31
  123. package/src/hooks/useProjectCompositionVariables.ts +10 -10
  124. package/src/hooks/useProjectSignaturePoll.test.tsx +135 -0
  125. package/src/hooks/useProjectSignaturePoll.ts +68 -0
  126. package/src/hooks/useSdkSession.lifecycle.test.tsx +137 -0
  127. package/src/hooks/useSdkSession.ts +155 -14
  128. package/src/hooks/useSlideshowPersist.ts +7 -1
  129. package/src/hooks/useStoryboard.ts +23 -4
  130. package/src/hooks/useTimelineEditing.test.tsx +4 -1
  131. package/src/hooks/useTimelineEditing.ts +16 -10
  132. package/src/hooks/useTimelineEditingTypes.ts +3 -0
  133. package/src/hooks/useTimelineGroupEditing.ts +16 -2
  134. package/src/hooks/useVariablesPersist.ts +9 -7
  135. package/src/icons/SystemIcons.tsx +2 -0
  136. package/src/styles/studio.css +22 -0
  137. package/src/styles/tailwind-preset.shared.js +7 -0
  138. package/src/utils/designInputTracking.test.ts +97 -0
  139. package/src/utils/designInputTracking.ts +80 -0
  140. package/src/utils/sdkCutover.gate.test.ts +7 -7
  141. package/src/utils/sdkCutover.test.ts +490 -57
  142. package/src/utils/sdkCutover.ts +181 -219
  143. package/src/utils/sdkEditTransaction.ts +292 -0
  144. package/src/utils/sdkResolverAttempts.ts +94 -0
  145. package/src/utils/sdkResolverShadow.test.ts +148 -0
  146. package/src/utils/sdkResolverShadow.ts +139 -106
  147. package/src/utils/setSlideshowManifest.test.ts +0 -9
  148. package/src/utils/setSlideshowManifest.ts +20 -27
  149. package/src/utils/studioFileHistory.test.ts +41 -0
  150. package/src/utils/studioFileHistory.ts +30 -27
  151. package/src/utils/studioFileMutationCoordinator.ts +45 -0
  152. package/src/utils/studioHelpers.test.ts +45 -0
  153. package/src/utils/studioHelpers.ts +45 -14
  154. package/src/utils/studioSaveDiagnostics.ts +17 -0
  155. package/dist/assets/index-B_UvTX3E.js +0 -423
  156. package/dist/assets/index-uahwWkgw.css +0 -1
@@ -4,7 +4,11 @@ import { Film } from "../../icons/SystemIcons";
4
4
  import { Section } from "./propertyPanelPrimitives";
5
5
  import { ADD_METHODS, ADD_METHOD_LABELS, METHOD_TOOLTIPS } from "./gsapAnimationConstants";
6
6
  import { AnimationCard } from "./AnimationCard";
7
- import type { GsapAnimationEditCallbacks } from "./gsapAnimationCallbacks";
7
+ import {
8
+ trackAnimationMetaUpdate,
9
+ type GsapAnimationEditCallbacks,
10
+ } from "./gsapAnimationCallbacks";
11
+ import { useTrackDesignInput } from "../../contexts/DesignPanelInputContext";
8
12
 
9
13
  interface GsapAnimationSectionProps extends GsapAnimationEditCallbacks {
10
14
  animations: GsapAnimation[];
@@ -34,7 +38,24 @@ export const GsapAnimationSection = memo(function GsapAnimationSection({
34
38
  onSetAllKeyframeEases,
35
39
  onUnroll,
36
40
  }: GsapAnimationSectionProps) {
41
+ const track = useTrackDesignInput();
37
42
  const [addMenuOpen, setAddMenuOpen] = useState(false);
43
+ const trackProperty = (property: string) => {
44
+ const control =
45
+ property === "visibility"
46
+ ? "toggle"
47
+ : property === "filter" || property === "clipPath"
48
+ ? "text"
49
+ : "metric";
50
+ track(control, property);
51
+ };
52
+ const updateMeta = (
53
+ animationId: string,
54
+ updates: { duration?: number; ease?: string; position?: number },
55
+ ) => {
56
+ trackAnimationMetaUpdate(track, updates);
57
+ onUpdateMeta(animationId, updates);
58
+ };
38
59
 
39
60
  return (
40
61
  <Section title="Animation" icon={<Film size={15} />}>
@@ -58,21 +79,94 @@ export const GsapAnimationSection = memo(function GsapAnimationSection({
58
79
  key={anim.id}
59
80
  animation={anim}
60
81
  defaultExpanded={index === 0}
61
- onUpdateProperty={onUpdateProperty}
62
- onUpdateMeta={onUpdateMeta}
63
- onDeleteAnimation={onDeleteAnimation}
64
- onAddProperty={onAddProperty}
65
- onRemoveProperty={onRemoveProperty}
66
- onUpdateFromProperty={onUpdateFromProperty}
67
- onAddFromProperty={onAddFromProperty}
68
- onRemoveFromProperty={onRemoveFromProperty}
82
+ onUpdateProperty={(animationId, property, value) => {
83
+ trackProperty(property);
84
+ onUpdateProperty(animationId, property, value);
85
+ }}
86
+ onUpdateMeta={updateMeta}
87
+ onDeleteAnimation={(animationId) => {
88
+ track("button", "Remove animation");
89
+ onDeleteAnimation(animationId);
90
+ }}
91
+ onAddProperty={(animationId, property) => {
92
+ track("select", "Add effect property");
93
+ onAddProperty(animationId, property);
94
+ }}
95
+ onRemoveProperty={(animationId, property) => {
96
+ track("button", `Remove ${property}`);
97
+ onRemoveProperty(animationId, property);
98
+ }}
99
+ onUpdateFromProperty={
100
+ onUpdateFromProperty
101
+ ? (animationId, property, value) => {
102
+ trackProperty(property);
103
+ onUpdateFromProperty(animationId, property, value);
104
+ }
105
+ : undefined
106
+ }
107
+ onAddFromProperty={
108
+ onAddFromProperty
109
+ ? (animationId, property) => {
110
+ track("select", "Add from property");
111
+ onAddFromProperty(animationId, property);
112
+ }
113
+ : undefined
114
+ }
115
+ onRemoveFromProperty={
116
+ onRemoveFromProperty
117
+ ? (animationId, property) => {
118
+ track("button", `Remove from ${property}`);
119
+ onRemoveFromProperty(animationId, property);
120
+ }
121
+ : undefined
122
+ }
69
123
  onLivePreview={onLivePreview}
70
124
  onLivePreviewEnd={onLivePreviewEnd}
71
- onSetArcPath={onSetArcPath}
72
- onUpdateArcSegment={onUpdateArcSegment}
73
- onUpdateKeyframeEase={onUpdateKeyframeEase}
74
- onSetAllKeyframeEases={onSetAllKeyframeEases}
75
- onUnroll={onUnroll}
125
+ onSetArcPath={
126
+ onSetArcPath
127
+ ? (animationId, config) => {
128
+ track(
129
+ "toggle",
130
+ config.autoRotate !== undefined ? "Auto rotate" : "Arc motion",
131
+ );
132
+ onSetArcPath(animationId, config);
133
+ }
134
+ : undefined
135
+ }
136
+ onUpdateArcSegment={
137
+ onUpdateArcSegment
138
+ ? (animationId, segmentIndex, update) => {
139
+ if (update.curviness === undefined) {
140
+ track("button", `Reset arc segment ${segmentIndex + 1}`);
141
+ }
142
+ onUpdateArcSegment(animationId, segmentIndex, update);
143
+ }
144
+ : undefined
145
+ }
146
+ onUpdateKeyframeEase={
147
+ onUpdateKeyframeEase
148
+ ? (animationId, percentage, ease) => {
149
+ track("select", "Keyframe ease");
150
+ onUpdateKeyframeEase(animationId, percentage, ease);
151
+ }
152
+ : undefined
153
+ }
154
+ onSetAllKeyframeEases={
155
+ onSetAllKeyframeEases
156
+ ? (animationId, ease) => {
157
+ track("select", "All keyframe eases");
158
+ onSetAllKeyframeEases(animationId, ease);
159
+ }
160
+ : undefined
161
+ }
162
+ onUnroll={
163
+ onUnroll
164
+ ? (animationId) => {
165
+ track("button", "Unroll animation");
166
+ onUnroll(animationId);
167
+ }
168
+ : undefined
169
+ }
76
170
  />
77
171
  ))}
78
172
 
@@ -85,6 +179,7 @@ export const GsapAnimationSection = memo(function GsapAnimationSection({
85
179
  type="button"
86
180
  title={METHOD_TOOLTIPS[method]}
87
181
  onClick={() => {
182
+ track("button", `Add ${method} animation`);
88
183
  onAddAnimation(method);
89
184
  setAddMenuOpen(false);
90
185
  }}
@@ -1,26 +1,58 @@
1
+ import { Eye, EyeSlash } from "@phosphor-icons/react";
1
2
  import { X } from "../../icons/SystemIcons";
3
+ import { useTrackDesignInput } from "../../contexts/DesignPanelInputContext";
2
4
  import type { DomEditSelection } from "./domEditingTypes";
3
5
 
4
- /** The action buttons in the inspector header: Ungroup (groups only), copy, clear. */
6
+ /** The action buttons in the inspector header: visibility, Ungroup (groups only), copy, clear. */
5
7
  export function InspectorHeaderActions({
6
8
  element,
7
9
  copied,
8
10
  onCopy,
9
11
  onClear,
10
12
  onUngroup,
13
+ selectedElementId,
14
+ selectedElementHidden,
15
+ visibilityLabel,
16
+ onToggleHidden,
11
17
  }: {
12
18
  element: DomEditSelection;
13
19
  copied: boolean;
14
20
  onCopy: () => void;
15
21
  onClear: () => void;
16
22
  onUngroup?: () => void;
23
+ selectedElementId?: string | null;
24
+ selectedElementHidden?: boolean;
25
+ visibilityLabel?: string;
26
+ onToggleHidden?: (id: string, hidden: boolean) => void;
17
27
  }) {
28
+ const track = useTrackDesignInput();
18
29
  return (
19
30
  <div className="flex items-center gap-1">
31
+ {selectedElementId && onToggleHidden && (
32
+ <button
33
+ type="button"
34
+ aria-label={visibilityLabel}
35
+ title={visibilityLabel}
36
+ onClick={() => {
37
+ track("toggle", "Element visibility");
38
+ void onToggleHidden(selectedElementId, !selectedElementHidden);
39
+ }}
40
+ className="flex h-6 w-6 items-center justify-center rounded text-neutral-500 transition-colors hover:bg-neutral-800 hover:text-neutral-300"
41
+ >
42
+ {selectedElementHidden ? (
43
+ <EyeSlash size={13} weight="bold" aria-hidden="true" />
44
+ ) : (
45
+ <Eye size={13} weight="bold" aria-hidden="true" />
46
+ )}
47
+ </button>
48
+ )}
20
49
  {onUngroup && element.dataAttributes["hf-group"] != null && (
21
50
  <button
22
51
  type="button"
23
- onClick={onUngroup}
52
+ onClick={() => {
53
+ track("button", "Ungroup");
54
+ onUngroup();
55
+ }}
24
56
  title="Ungroup (⌘⇧G)"
25
57
  className="flex h-6 items-center rounded px-2 text-[11px] font-medium text-neutral-400 transition-colors hover:bg-neutral-800 hover:text-neutral-200"
26
58
  >
@@ -29,7 +61,10 @@ export function InspectorHeaderActions({
29
61
  )}
30
62
  <button
31
63
  type="button"
32
- onClick={onCopy}
64
+ onClick={() => {
65
+ track("button", "Copy element info");
66
+ onCopy();
67
+ }}
33
68
  className={`flex h-6 w-6 items-center justify-center rounded transition-colors ${
34
69
  copied
35
70
  ? "text-studio-accent"
@@ -52,7 +87,10 @@ export function InspectorHeaderActions({
52
87
  <button
53
88
  type="button"
54
89
  aria-label="Clear selection"
55
- onClick={onClear}
90
+ onClick={() => {
91
+ track("button", "Clear selection");
92
+ onClear();
93
+ }}
56
94
  className="flex h-6 w-6 items-center justify-center rounded text-neutral-500 transition-colors hover:bg-neutral-800 hover:text-neutral-300"
57
95
  >
58
96
  <X size={13} />