@hyperframes/studio 0.8.114 → 0.8.115
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-aXNJKiIg.js → hyperframes-player-C-9N8nk0.js} +1 -1
- package/dist/assets/{index-Bn2RJNTJ.js → index-BoUM6Xqb.js} +1 -1
- package/dist/assets/{index-Dz7doz9l.js → index-CAvZ0AA-.js} +201 -201
- package/dist/assets/{index-C9N-DGjC.js → index-CVuorIMv.js} +1 -1
- package/dist/assets/{index-BYnsJnJV.css → index-t1LH6H5H.css} +1 -1
- package/dist/{chunk-K47E2ZJA.js → chunk-5EKWJZLM.js} +504 -17
- package/dist/chunk-5EKWJZLM.js.map +1 -0
- package/dist/{chunk-VWT7STY3.js → chunk-J6Q572FA.js} +2 -2
- package/dist/{chunk-BIUXP3PG.js → chunk-TXZMMOMA.js} +43 -276
- package/dist/chunk-TXZMMOMA.js.map +1 -0
- package/dist/{domEditingLayers-V67MS4WP.js → domEditingLayers-D7VYFJJD.js} +3 -5
- package/dist/index.d.ts +43 -19
- package/dist/index.html +2 -2
- package/dist/index.js +2939 -2596
- package/dist/index.js.map +1 -1
- package/dist/player.js +2 -2
- package/dist/styles.css +1 -1
- package/package.json +9 -8
- package/src/App.tsx +2 -2
- package/src/components/LinkedSelectionToggle.tsx +3 -2
- package/src/components/dock/Dock.tsx +5 -7
- package/src/components/editor/CanvasContextMenu.tsx +3 -2
- package/src/components/editor/DomEditCropHandles.test.tsx +27 -0
- package/src/components/editor/DomEditCropHandles.tsx +7 -4
- package/src/components/editor/DomEditOverlay.tsx +5 -1
- package/src/components/editor/FileTreeNodes.tsx +13 -10
- package/src/components/editor/MotionPathOverlay.tsx +7 -2
- package/src/components/editor/PropertyPanelEmptyState.tsx +12 -2
- package/src/components/editor/SnapToolbar.test.tsx +100 -1
- package/src/components/editor/SnapToolbar.tsx +43 -5
- package/src/components/editor/anchoredResizeCommitFeedsOffset.test.ts +48 -1
- package/src/components/editor/audioFxTelemetry.ts +2 -3
- package/src/components/editor/commitPreflightHandles.test.tsx +2 -2
- package/src/components/editor/cropResize.ts +4 -3
- package/src/components/editor/domEditingDom.ts +4 -0
- package/src/components/editor/domEditingLayers.ts +1 -5
- package/src/components/editor/manualEdits.ts +1 -0
- package/src/components/editor/manualEditsParsing.ts +7 -0
- package/src/components/editor/marqueeCommit.test.tsx +106 -37
- package/src/components/editor/marqueeCommit.ts +24 -8
- package/src/components/editor/motionPathCommit.test.ts +29 -1
- package/src/components/editor/motionPathCommit.ts +21 -9
- package/src/components/editor/probeSourceElement.test.ts +45 -0
- package/src/components/editor/probeSourceElement.ts +39 -15
- package/src/components/editor/propertyPanelFlatTextSection.tsx +10 -7
- package/src/components/editor/propertyPanelFxAddMenu.tsx +11 -2
- package/src/components/editor/propertyPanelFxCarveModule.tsx +15 -5
- package/src/components/editor/propertyPanelFxNodeOpenBody.tsx +3 -0
- package/src/components/editor/propertyPanelFxNodeParams.tsx +15 -2
- package/src/components/editor/propertyPanelFxNodeRow.tsx +3 -0
- package/src/components/editor/propertyPanelFxPresetRun.tsx +10 -2
- package/src/components/editor/propertyPanelFxSection.test.tsx +56 -0
- package/src/components/editor/propertyPanelFxSection.tsx +30 -28
- package/src/components/editor/propertyPanelTypes.ts +6 -3
- package/src/components/editor/useDomEditNudge.test.tsx +37 -0
- package/src/components/editor/useDomEditNudge.ts +2 -0
- package/src/components/editor/useDomEditOverlayGestures.ts +5 -0
- package/src/components/editor/useDomEditZOrder.ts +12 -2
- package/src/components/nle/useTimelineEditCallbacks.test.tsx +1 -0
- package/src/components/nle/useTimelineEditCallbacks.ts +7 -1
- package/src/components/sidebar/AssetContextMenu.tsx +4 -4
- package/src/components/ui/menuStyle.test.ts +61 -0
- package/src/components/ui/menuStyle.ts +10 -0
- package/src/contexts/DomEditContext.tsx +1 -1
- package/src/contexts/TimelineEditContext.tsx +1 -0
- package/src/domEditExports.test.tsx +9 -1
- package/src/hooks/domEditCommitRunner.ts +1 -1
- package/src/hooks/elementOffsetStager.ts +5 -4
- package/src/hooks/gsapDragCommit.ts +2 -20
- package/src/hooks/gsapDragPositionCommit.ts +18 -3
- package/src/hooks/gsapGestureOutcome.test.ts +161 -0
- package/src/hooks/gsapGestureOutcome.ts +64 -0
- package/src/hooks/gsapKeyframeCommit.ts +3 -12
- package/src/hooks/gsapResizeIntercept.test.ts +33 -0
- package/src/hooks/gsapResizeIntercept.ts +1 -0
- package/src/hooks/gsapScriptCommitTypes.ts +5 -0
- package/src/hooks/gsapShared.writeTarget.test.ts +20 -0
- package/src/hooks/keyframeCacheAstLoad.ts +6 -5
- package/src/hooks/plainRotation.ts +3 -2
- package/src/hooks/previewPromotionSelection.test.tsx +1 -1
- package/src/hooks/refreshTimelineRowText.test.ts +65 -0
- package/src/hooks/refreshTimelineRowText.ts +29 -0
- package/src/hooks/useAnimatedPropertyCommit.test.tsx +46 -5
- package/src/hooks/useAnimatedPropertyCommit.ts +2 -2
- package/src/hooks/useBlockedTimelineEditToast.ts +12 -3
- package/src/hooks/useDomEditPositionPatchCommit.ts +18 -23
- package/src/hooks/useDomEditTextCommits.test.tsx +18 -0
- package/src/hooks/useDomEditTextCommits.ts +5 -1
- package/src/hooks/useDomEditWiring.ts +4 -2
- package/src/hooks/useDomGeometryCommit.test.tsx +25 -6
- package/src/hooks/useDomGeometryCommit.ts +7 -4
- package/src/hooks/useDomGeometryCommits.test.tsx +1 -0
- package/src/hooks/useDomGeometryCommits.ts +3 -2
- package/src/hooks/useDomSelection.test.ts +26 -0
- package/src/hooks/useDomSelection.ts +10 -3
- package/src/hooks/useDomSelectionTypes.ts +6 -1
- package/src/hooks/useEnableKeyframes.test.ts +2 -2
- package/src/hooks/useEnableKeyframes.ts +5 -3
- package/src/hooks/useExternalFileChangeCoordinator.test.tsx +102 -0
- package/src/hooks/useExternalFileChangeCoordinator.ts +31 -6
- package/src/hooks/useGestureCommit.test.tsx +225 -55
- package/src/hooks/useGestureCommit.ts +86 -55
- package/src/hooks/useGsapAwareEditing.test.tsx +11 -6
- package/src/hooks/useGsapAwareEditing.ts +96 -195
- package/src/hooks/useGsapAwareGroupMove.ts +179 -0
- package/src/hooks/useGsapKeyframeOps.sdkUsage.test.tsx +114 -0
- package/src/hooks/useGsapKeyframeOps.ts +36 -10
- package/src/hooks/useGsapScriptCommits.test.tsx +57 -0
- package/src/hooks/useGsapScriptCommits.ts +3 -0
- package/src/hooks/useGsapSelectionHandlers.test.tsx +1 -1
- package/src/hooks/useGsapSelectionHandlers.ts +24 -18
- package/src/hooks/useGsapTweenCache.ts +18 -12
- package/src/hooks/usePopulateKeyframeCacheForFile.test.tsx +76 -2
- package/src/hooks/usePreviewInteraction.test.ts +21 -0
- package/src/hooks/usePreviewInteraction.ts +2 -0
- package/src/hooks/useRenderClipContent.test.ts +18 -0
- package/src/hooks/useRenderClipContent.ts +4 -5
- package/src/hooks/useTimelineDeleteOps.test.tsx +30 -22
- package/src/hooks/useTimelineDeleteOps.ts +21 -27
- package/src/hooks/useTimelineEditing.test.tsx +1 -1
- package/src/player/components/AutomationSelectionMenu.tsx +3 -2
- package/src/player/components/ClipContextMenu.test.tsx +73 -0
- package/src/player/components/ClipContextMenu.tsx +33 -31
- package/src/player/components/KeyframeDiamondContextMenu.tsx +8 -9
- package/src/player/components/OutOfSyncBadge.tsx +5 -5
- package/src/player/components/TextClipContent.test.ts +19 -0
- package/src/player/components/TextClipContent.tsx +27 -0
- package/src/player/components/TrackGapContextMenu.tsx +3 -6
- package/src/player/components/clipMenuToolItems.test.tsx +23 -0
- package/src/player/components/clipMenuToolItems.tsx +13 -9
- package/src/player/components/timelineCallbacks.ts +1 -0
- package/src/player/components/timelineClipDragGestureLifecycle.ts +1 -1
- package/src/player/components/timelineClipGestureHandlers.test.ts +94 -0
- package/src/player/components/timelineClipGestureHandlers.ts +20 -2
- package/src/player/components/timelineEditing.ts +3 -1
- package/src/player/components/timelineLinkSelection.ts +35 -1
- package/src/player/components/useTimelineClipDrag.keyboard.test.tsx +14 -0
- package/src/player/components/useTimelineClipDrag.ts +6 -7
- package/src/player/hooks/timelinePlayerSync.test.ts +6 -0
- package/src/player/hooks/timelinePlayerSync.ts +6 -1
- package/src/player/lib/timelineElementHelpers.test.ts +87 -1
- package/src/player/lib/timelineElementHelpers.ts +6 -15
- package/src/player/lib/timelineText.ts +40 -0
- package/src/player/store/timelineElement.ts +12 -0
- package/src/styles/theme.css +3 -0
- package/src/utils/keyframeUsage.ts +79 -0
- package/src/utils/previewFeatureUsage.test.ts +32 -0
- package/src/utils/previewFeatureUsage.ts +46 -0
- package/src/utils/studioTelemetry.test.ts +107 -0
- package/src/utils/studioTelemetry.ts +49 -4
- package/src/webmcp/StudioAgentTools.tsx +2 -2
- package/dist/chunk-BIUXP3PG.js.map +0 -1
- package/dist/chunk-K47E2ZJA.js.map +0 -1
- /package/dist/{chunk-VWT7STY3.js.map → chunk-J6Q572FA.js.map} +0 -0
- /package/dist/{domEditingLayers-V67MS4WP.js.map → domEditingLayers-D7VYFJJD.js.map} +0 -0
|
@@ -11,6 +11,8 @@ import { usePlayerStore } from "../player";
|
|
|
11
11
|
import type { DomEditSelection } from "../components/editor/domEditing";
|
|
12
12
|
import type { GsapAnimation } from "@hyperframes/core/gsap-parser";
|
|
13
13
|
import type { CommitMutationOptions } from "./gsapScriptCommitTypes";
|
|
14
|
+
import { trackPreviewEditResult } from "../utils/previewFeatureUsage";
|
|
15
|
+
import { observeGsapGesture } from "./gsapGestureOutcome";
|
|
14
16
|
import { roundTo3 } from "../utils/rounding";
|
|
15
17
|
import { classifyPropertyGroup } from "@hyperframes/core/gsap-parser";
|
|
16
18
|
import { isInstantHold, idSelector, writeTargetSelector, tweenTargetsElement } from "./gsapShared";
|
|
@@ -72,6 +74,7 @@ interface GestureSessionRef {
|
|
|
72
74
|
commitMutation?: (
|
|
73
75
|
mutation: Record<string, unknown>,
|
|
74
76
|
options: CommitMutationOptions,
|
|
77
|
+
selection?: DomEditSelection,
|
|
75
78
|
) => Promise<void>;
|
|
76
79
|
}
|
|
77
80
|
|
|
@@ -81,6 +84,12 @@ function reloadOnlyLast(index: number, count: number): Partial<CommitMutationOpt
|
|
|
81
84
|
return index === count - 1 ? { softReload: true } : { skipReload: true };
|
|
82
85
|
}
|
|
83
86
|
|
|
87
|
+
function recordingEnd(selection: DomEditSelection): number | undefined {
|
|
88
|
+
const start = Number.parseFloat(selection.dataAttributes?.start ?? "0") || 0;
|
|
89
|
+
const duration = Number.parseFloat(selection.dataAttributes?.duration ?? "0") || 0;
|
|
90
|
+
return duration > 0 ? start + duration : undefined;
|
|
91
|
+
}
|
|
92
|
+
|
|
84
93
|
let gestureRecordingCommitCounter = 0;
|
|
85
94
|
|
|
86
95
|
interface UseGestureCommitParams {
|
|
@@ -95,7 +104,7 @@ interface UseGestureCommitParams {
|
|
|
95
104
|
export interface UseGestureCommitResult {
|
|
96
105
|
gestureState: "idle" | "recording";
|
|
97
106
|
gestureRecording: ReturnType<typeof useGestureRecording>;
|
|
98
|
-
handleToggleRecording: () => void;
|
|
107
|
+
handleToggleRecording: (method?: "button" | "keyboard") => void;
|
|
99
108
|
}
|
|
100
109
|
|
|
101
110
|
// fallow-ignore-next-line complexity
|
|
@@ -111,11 +120,13 @@ export function useGestureCommit({
|
|
|
111
120
|
const [gestureState, setGestureState] = useState<"idle" | "recording">("idle");
|
|
112
121
|
const gestureStateRef = useRef<"idle" | "recording">("idle");
|
|
113
122
|
const recordingAutoStopRef = useRef<ReturnType<typeof setInterval>>(undefined);
|
|
123
|
+
const recordingMethodRef = useRef<"button" | "keyboard">("button");
|
|
114
124
|
const recordingStartTimeRef = useRef(0);
|
|
115
125
|
const commitInFlightRef = useRef(false);
|
|
116
126
|
// Capture selection at recording start so commit always targets the recorded element,
|
|
117
127
|
// even if the user's selection changes mid-recording.
|
|
118
128
|
const capturedSelectionRef = useRef<DomEditSelection | null>(null);
|
|
129
|
+
const capturedAnimationsRef = useRef<GsapAnimation[]>([]);
|
|
119
130
|
|
|
120
131
|
// Unmount: clear auto-stop interval
|
|
121
132
|
useEffect(() => () => clearInterval(recordingAutoStopRef.current), []);
|
|
@@ -206,6 +217,12 @@ export function useGestureCommit({
|
|
|
206
217
|
return;
|
|
207
218
|
}
|
|
208
219
|
if (liveSession.commitMutation) {
|
|
220
|
+
const writer = liveSession.commitMutation;
|
|
221
|
+
const outcome = observeGsapGesture((_selection, mutation, options) =>
|
|
222
|
+
writer(mutation, options, sel),
|
|
223
|
+
);
|
|
224
|
+
const commit = (mutation: Record<string, unknown>, options: CommitMutationOptions) =>
|
|
225
|
+
outcome.commit!(sel, mutation, options);
|
|
209
226
|
const recStart = recordingStartTimeRef.current;
|
|
210
227
|
const rawKeyframes = sortedPcts.map((pct) => ({
|
|
211
228
|
percentage: pct,
|
|
@@ -216,7 +233,7 @@ export function useGestureCommit({
|
|
|
216
233
|
const hasPositionProps = keyframes.some((kf) =>
|
|
217
234
|
Object.keys(kf.properties).some((k) => classifyPropertyGroup(k) === "position"),
|
|
218
235
|
);
|
|
219
|
-
const allAnims =
|
|
236
|
+
const allAnims = capturedAnimationsRef.current;
|
|
220
237
|
const existingPositionTween = hasPositionProps
|
|
221
238
|
? allAnims.find(
|
|
222
239
|
(a) =>
|
|
@@ -228,7 +245,7 @@ export function useGestureCommit({
|
|
|
228
245
|
if (isInstantHold(existingPositionTween)) {
|
|
229
246
|
// An instant hold is not a tween to merge into — replace it with the
|
|
230
247
|
// recorded motion (which already starts from the held position).
|
|
231
|
-
await
|
|
248
|
+
await commit(
|
|
232
249
|
{
|
|
233
250
|
type: "replace-with-keyframes",
|
|
234
251
|
animationId: existingPositionTween.id,
|
|
@@ -237,7 +254,7 @@ export function useGestureCommit({
|
|
|
237
254
|
duration: roundTo3(duration),
|
|
238
255
|
keyframes,
|
|
239
256
|
},
|
|
240
|
-
{ label: "Gesture recording (replace set)", softReload: true },
|
|
257
|
+
{ label: "Gesture recording (replace set)", softReload: true, keyframeAction: "add" },
|
|
241
258
|
);
|
|
242
259
|
} else {
|
|
243
260
|
const tweenStart = existingPositionTween.resolvedStart ?? 0;
|
|
@@ -274,7 +291,7 @@ export function useGestureCommit({
|
|
|
274
291
|
|
|
275
292
|
const merged = [...preserved, ...mapped].sort((a, b) => a.percentage - b.percentage);
|
|
276
293
|
|
|
277
|
-
await
|
|
294
|
+
await commit(
|
|
278
295
|
{
|
|
279
296
|
type: "replace-with-keyframes",
|
|
280
297
|
animationId: existingPositionTween.id,
|
|
@@ -286,7 +303,7 @@ export function useGestureCommit({
|
|
|
286
303
|
duration: tweenDur,
|
|
287
304
|
keyframes: merged,
|
|
288
305
|
},
|
|
289
|
-
{ label: "Gesture recording (merge)", softReload: true },
|
|
306
|
+
{ label: "Gesture recording (merge)", softReload: true, keyframeAction: "add" },
|
|
290
307
|
);
|
|
291
308
|
} else {
|
|
292
309
|
// Emit one tween per property group so a mixed-prop gesture (e.g.
|
|
@@ -294,7 +311,7 @@ export function useGestureCommit({
|
|
|
294
311
|
// tween that the position-only drag intercept can't edit.
|
|
295
312
|
const keyframeGroups = partitionKeyframesByGroup(keyframes);
|
|
296
313
|
for (const [index, groupKfs] of keyframeGroups.entries()) {
|
|
297
|
-
await
|
|
314
|
+
await commit(
|
|
298
315
|
{
|
|
299
316
|
type: "add-with-keyframes",
|
|
300
317
|
targetSelector: writeSelector,
|
|
@@ -320,7 +337,7 @@ export function useGestureCommit({
|
|
|
320
337
|
// No existing tween — same per-group split as the new-range branch above.
|
|
321
338
|
const keyframeGroups = partitionKeyframesByGroup(keyframes);
|
|
322
339
|
for (const [index, groupKfs] of keyframeGroups.entries()) {
|
|
323
|
-
await
|
|
340
|
+
await commit(
|
|
324
341
|
{
|
|
325
342
|
type: "add-with-keyframes",
|
|
326
343
|
targetSelector: writeSelector,
|
|
@@ -338,6 +355,7 @@ export function useGestureCommit({
|
|
|
338
355
|
);
|
|
339
356
|
}
|
|
340
357
|
}
|
|
358
|
+
trackPreviewEditResult("gesture_recording", recordingMethodRef.current, outcome.finish());
|
|
341
359
|
}
|
|
342
360
|
showToast(`Recorded ${sortedPcts.length} keyframes`, "info");
|
|
343
361
|
} catch (err) {
|
|
@@ -351,58 +369,71 @@ export function useGestureCommit({
|
|
|
351
369
|
}
|
|
352
370
|
}, [gestureRecording, showToast, isGestureRecordingRef, domEditSessionRef]);
|
|
353
371
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
372
|
+
const armAutoStop = useCallback(
|
|
373
|
+
(elementEnd: number | undefined) => {
|
|
374
|
+
clearInterval(recordingAutoStopRef.current);
|
|
375
|
+
const autoStopAt = elementEnd ?? Infinity;
|
|
376
|
+
recordingAutoStopRef.current = setInterval(() => {
|
|
377
|
+
const { currentTime: t, duration: d } = usePlayerStore.getState();
|
|
378
|
+
const limit = Math.min(autoStopAt, d);
|
|
379
|
+
if (limit > 0 && t >= limit - 0.05) {
|
|
380
|
+
void stopAndCommitRecording();
|
|
381
|
+
}
|
|
382
|
+
}, 100);
|
|
383
|
+
},
|
|
384
|
+
[stopAndCommitRecording],
|
|
385
|
+
);
|
|
386
|
+
|
|
387
|
+
const startRecording = useCallback(
|
|
388
|
+
(method: "button" | "keyboard") => {
|
|
389
|
+
if (readOnlyPreview) return;
|
|
390
|
+
const sel = domEditSessionRef.current.domEditSelection;
|
|
391
|
+
if (!sel) {
|
|
392
|
+
showToast("Select an element first", "error");
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
const iframe = previewIframeRef.current;
|
|
396
|
+
if (!iframe) {
|
|
397
|
+
showToast("Preview not ready — try again", "error");
|
|
359
398
|
return;
|
|
360
399
|
}
|
|
361
|
-
void stopAndCommitRecording();
|
|
362
|
-
return;
|
|
363
|
-
}
|
|
364
|
-
if (readOnlyPreview) return;
|
|
365
|
-
const sel = domEditSessionRef.current.domEditSelection;
|
|
366
|
-
if (!sel) {
|
|
367
|
-
showToast("Select an element first", "error");
|
|
368
|
-
return;
|
|
369
|
-
}
|
|
370
|
-
const iframe = previewIframeRef.current;
|
|
371
|
-
if (!iframe) {
|
|
372
|
-
showToast("Preview not ready — try again", "error");
|
|
373
|
-
return;
|
|
374
|
-
}
|
|
375
400
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
401
|
+
const store = usePlayerStore.getState();
|
|
402
|
+
recordingMethodRef.current = method;
|
|
403
|
+
recordingStartTimeRef.current = store.currentTime;
|
|
404
|
+
const elementEnd = recordingEnd(sel);
|
|
405
|
+
capturedSelectionRef.current = sel;
|
|
406
|
+
capturedAnimationsRef.current = domEditSessionRef.current.selectedGsapAnimations ?? [];
|
|
407
|
+
gestureRecording.startRecording(sel.element, iframe, elementEnd);
|
|
408
|
+
gestureStateRef.current = "recording";
|
|
409
|
+
isGestureRecordingRef.current = true;
|
|
410
|
+
setGestureState("recording");
|
|
386
411
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
412
|
+
armAutoStop(elementEnd);
|
|
413
|
+
},
|
|
414
|
+
[
|
|
415
|
+
gestureRecording,
|
|
416
|
+
showToast,
|
|
417
|
+
previewIframeRef,
|
|
418
|
+
domEditSessionRef,
|
|
419
|
+
isGestureRecordingRef,
|
|
420
|
+
readOnlyPreview,
|
|
421
|
+
armAutoStop,
|
|
422
|
+
],
|
|
423
|
+
);
|
|
424
|
+
|
|
425
|
+
const handleToggleRecording = useCallback(
|
|
426
|
+
(method: "button" | "keyboard" = "button") => {
|
|
427
|
+
if (commitInFlightRef.current) return;
|
|
428
|
+
if (gestureStateRef.current === "recording") {
|
|
429
|
+
if (readOnlyPreview) cancelRecording();
|
|
430
|
+
else void stopAndCommitRecording();
|
|
431
|
+
return;
|
|
394
432
|
}
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
stopAndCommitRecording,
|
|
400
|
-
cancelRecording,
|
|
401
|
-
previewIframeRef,
|
|
402
|
-
domEditSessionRef,
|
|
403
|
-
isGestureRecordingRef,
|
|
404
|
-
readOnlyPreview,
|
|
405
|
-
]);
|
|
433
|
+
startRecording(method);
|
|
434
|
+
},
|
|
435
|
+
[cancelRecording, readOnlyPreview, startRecording, stopAndCommitRecording],
|
|
436
|
+
);
|
|
406
437
|
|
|
407
438
|
return useStableHandlers({ gestureState, gestureRecording, handleToggleRecording }, projectId);
|
|
408
439
|
}
|
|
@@ -74,7 +74,7 @@ function mountResizeHandler(
|
|
|
74
74
|
size: { width: number; height: number },
|
|
75
75
|
offset?: { x: number; y: number },
|
|
76
76
|
restore?: () => void,
|
|
77
|
-
) => Promise<void>)
|
|
77
|
+
) => Promise<void | import("../utils/previewFeatureUsage").GeometryCommitResult>)
|
|
78
78
|
| null = null;
|
|
79
79
|
let property: ReturnType<typeof useGsapAwareEditing>["commitAnimatedProperty"] | null = null;
|
|
80
80
|
function Harness() {
|
|
@@ -131,13 +131,18 @@ function mountGroupHandler({
|
|
|
131
131
|
"trackGsapInteractionFailure" | "stageElementPositionOffset" | "handleDomRotationCommit"
|
|
132
132
|
>
|
|
133
133
|
>) {
|
|
134
|
-
let groupCommit!: (
|
|
134
|
+
let groupCommit!: (
|
|
135
|
+
updates: DomEditGroupPathOffsetCommit[],
|
|
136
|
+
) => Promise<void | import("../utils/previewFeatureUsage").GeometryCommitResult>;
|
|
135
137
|
let pathOffsetCommit!: (
|
|
136
138
|
selection: DomEditSelection,
|
|
137
139
|
next: { x: number; y: number },
|
|
138
140
|
route?: { plainTranslate?: boolean },
|
|
139
|
-
) => Promise<void>;
|
|
140
|
-
let rotationCommit!: (
|
|
141
|
+
) => Promise<void | import("../utils/previewFeatureUsage").GeometryCommitResult>;
|
|
142
|
+
let rotationCommit!: (
|
|
143
|
+
selection: DomEditSelection,
|
|
144
|
+
next: RotationCommit,
|
|
145
|
+
) => Promise<void | import("../utils/previewFeatureUsage").GeometryCommitResult>;
|
|
141
146
|
function Harness() {
|
|
142
147
|
const editing = useGsapAwareEditing({
|
|
143
148
|
domEditSelection: null,
|
|
@@ -589,7 +594,7 @@ describe("useGsapAwareEditing anchored resize", () => {
|
|
|
589
594
|
h.selection.element.setAttribute("data-hf-drag-initial-offset-x", "0");
|
|
590
595
|
h.selection.element.setAttribute("data-hf-drag-initial-offset-y", "0");
|
|
591
596
|
|
|
592
|
-
let commit!: Promise<void>;
|
|
597
|
+
let commit!: Promise<void | import("../utils/previewFeatureUsage").GeometryCommitResult>;
|
|
593
598
|
act(() => {
|
|
594
599
|
commit = h.resize(h.selection, { width: 300, height: 200 }, { x: -50.2, y: -25.6 });
|
|
595
600
|
});
|
|
@@ -636,7 +641,7 @@ describe("useGsapAwareEditing anchored resize", () => {
|
|
|
636
641
|
s: DomEditSelection,
|
|
637
642
|
m: unknown,
|
|
638
643
|
o: { coalesceKey?: string; label?: string; softReload?: boolean },
|
|
639
|
-
) => Promise<void>,
|
|
644
|
+
) => Promise<void | import("../utils/previewFeatureUsage").GeometryCommitResult>,
|
|
640
645
|
_fetch: unknown,
|
|
641
646
|
options?: { preflightOnly?: boolean },
|
|
642
647
|
) => {
|