@hyperframes/studio 0.7.55 → 0.7.56
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/{index-BXaqaVKt.js → index-BWnOxAiH.js} +1 -1
- package/dist/assets/{index-CPetwHFV.js → index-C4csZims.js} +1 -1
- package/dist/assets/index-CmVCjZjp.js +423 -0
- package/dist/assets/index-D-GyYi2d.css +1 -0
- package/dist/{chunk-SOTCF4DF.js → chunk-5QSIMBEJ.js} +2 -1
- package/dist/chunk-5QSIMBEJ.js.map +1 -0
- package/dist/{domEditingLayers-2ECJK24D.js → domEditingLayers-6LQGKPOI.js} +2 -2
- package/dist/index.d.ts +146 -144
- package/dist/index.html +2 -2
- package/dist/index.js +40414 -37680
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/src/App.tsx +106 -96
- package/src/components/EditorShell.tsx +253 -0
- package/src/components/StudioGlobalDragOverlay.tsx +1 -3
- package/src/components/StudioLeftSidebar.tsx +13 -3
- package/src/components/StudioRightPanel.tsx +8 -3
- package/src/components/TimelineToolbar.test.tsx +2 -2
- package/src/components/TimelineToolbar.tsx +179 -121
- package/src/components/editor/DomEditCropHandles.test.tsx +74 -3
- package/src/components/editor/DomEditCropHandles.tsx +64 -29
- package/src/components/editor/DomEditOverlay.test.ts +245 -279
- package/src/components/editor/DomEditOverlay.tsx +158 -126
- package/src/components/editor/DomEditOverlayHover.test.tsx +90 -0
- package/src/components/editor/DomEditRotateHandle.tsx +38 -18
- package/src/components/editor/DomEditSelectionChrome.test.tsx +80 -0
- package/src/components/editor/DomEditSelectionChrome.tsx +257 -0
- package/src/components/editor/LayersPanel.test.ts +66 -2
- package/src/components/editor/LayersPanel.tsx +43 -1
- package/src/components/editor/OffCanvasIndicators.test.tsx +34 -0
- package/src/components/editor/OffCanvasIndicators.tsx +49 -10
- package/src/components/editor/SnapGuideOverlay.tsx +28 -23
- package/src/components/editor/SnapToolbar.test.tsx +0 -1
- package/src/components/editor/anchoredResizeCommitFeedsOffset.test.ts +214 -0
- package/src/components/editor/anchoredResizeReleaseShift.test.ts +106 -10
- package/src/components/editor/domEditNudge.test.ts +80 -0
- package/src/components/editor/domEditNudge.ts +44 -0
- package/src/components/editor/domEditOverlayGeometry.test.ts +167 -1
- package/src/components/editor/domEditOverlayGeometry.ts +280 -20
- package/src/components/editor/domEditOverlayGestures.ts +44 -41
- package/src/components/editor/domEditOverlayStartGesture.ts +62 -2
- package/src/components/editor/domEditResizeLocal.test.ts +131 -0
- package/src/components/editor/domEditResizeLocal.ts +125 -0
- package/src/components/editor/domEditingDom.ts +1 -1
- package/src/components/editor/manualEditsDomPatches.test.ts +47 -0
- package/src/components/editor/manualOffsetDrag.ts +55 -12
- package/src/components/editor/offCanvasIndicatorGeometry.ts +31 -10
- package/src/components/editor/offCanvasIndicatorRefresh.test.tsx +25 -1
- package/src/components/editor/resizeDraft.ts +108 -0
- package/src/components/editor/snapEngine.test.ts +12 -78
- package/src/components/editor/snapEngine.ts +13 -53
- package/src/components/editor/useDomEditNudge.test.tsx +228 -0
- package/src/components/editor/useDomEditNudge.ts +254 -0
- package/src/components/editor/useDomEditOverlayGestures.ts +115 -116
- package/src/components/editor/useDomEditOverlayRects.ts +9 -2
- package/src/components/nle/AssetPreviewOverlay.tsx +147 -0
- package/src/components/nle/NLEContext.test.ts +144 -0
- package/src/components/nle/NLEContext.tsx +328 -0
- package/src/components/nle/NLEPreview.tsx +1 -1
- package/src/components/nle/PreviewOverlays.tsx +240 -0
- package/src/components/nle/PreviewPane.tsx +163 -0
- package/src/components/nle/TimelinePane.test.ts +60 -0
- package/src/components/nle/TimelinePane.tsx +293 -0
- package/src/components/nle/TimelineResizeDivider.tsx +8 -2
- package/src/components/nle/useCompositionStack.test.tsx +44 -0
- package/src/components/nle/useCompositionStack.ts +17 -9
- package/src/components/nle/useTimelineEditCallbacks.ts +217 -0
- package/src/components/sidebar/AssetCard.tsx +326 -0
- package/src/components/sidebar/AssetContextMenu.tsx +15 -30
- package/src/components/sidebar/AssetsTab.test.ts +96 -0
- package/src/components/sidebar/AssetsTab.tsx +71 -206
- package/src/components/sidebar/AudioRow.tsx +39 -2
- package/src/components/sidebar/BlocksTab.tsx +8 -1
- package/src/components/sidebar/LeftSidebar.tsx +4 -1
- package/src/components/sidebar/assetHelpers.ts +29 -0
- package/src/contexts/DomEditContext.tsx +9 -0
- package/src/contexts/StudioContext.tsx +9 -8
- package/src/contexts/TimelineEditContext.tsx +3 -7
- package/src/hooks/deleteSelectedKeyframes.ts +35 -0
- package/src/hooks/domEditCommitTypes.ts +12 -1
- package/src/hooks/domSelectionTestHarness.ts +14 -0
- package/src/hooks/gestureTransaction.test.ts +311 -0
- package/src/hooks/gestureTransaction.ts +199 -0
- package/src/hooks/gsapDragCommit.test.ts +141 -41
- package/src/hooks/gsapDragCommit.ts +64 -74
- package/src/hooks/gsapDragStaticSetHelpers.ts +9 -21
- package/src/hooks/gsapResizeIntercept.test.ts +69 -0
- package/src/hooks/gsapResizeIntercept.ts +38 -10
- package/src/hooks/gsapRuntimeBridge.test.ts +49 -13
- package/src/hooks/gsapRuntimeBridge.ts +4 -4
- package/src/hooks/gsapScriptCommitTypes.ts +16 -5
- package/src/hooks/gsapShared.test.ts +19 -1
- package/src/hooks/gsapShared.ts +14 -0
- package/src/hooks/patchDocumentRootDuration.test.ts +71 -0
- package/src/hooks/timelineEditingGsap.ts +14 -0
- package/src/hooks/timelineEditingHelpers.test.ts +34 -1
- package/src/hooks/timelineEditingHelpers.ts +22 -48
- package/src/hooks/timelineMoveAdapter.test.ts +77 -0
- package/src/hooks/timelineMoveAdapter.ts +37 -0
- package/src/hooks/useAnimatedPropertyCommit.test.tsx +36 -8
- package/src/hooks/useAnimatedPropertyCommit.ts +31 -26
- package/src/hooks/useAppHotkeys.ts +16 -25
- package/src/hooks/useBlockHandlers.ts +55 -27
- package/src/hooks/useContextMenuDismiss.ts +31 -7
- package/src/hooks/useDomEditCommits.test.tsx +154 -1
- package/src/hooks/useDomEditCommits.ts +100 -3
- package/src/hooks/useDomEditPositionPatchCommit.ts +2 -0
- package/src/hooks/useDomEditSession.ts +2 -2
- package/src/hooks/useDomEditTextCommits.test.tsx +135 -0
- package/src/hooks/useDomEditTextCommits.ts +8 -3
- package/src/hooks/useDomEditWiring.ts +7 -9
- package/src/hooks/useDomGeometryCommits.ts +17 -2
- package/src/hooks/useDomSelection.test.ts +2 -36
- package/src/hooks/useDomSelection.ts +81 -51
- package/src/hooks/useDomSelectionSelectionGuards.test.ts +276 -0
- package/src/hooks/useElementLifecycleOps.test.tsx +258 -0
- package/src/hooks/useElementLifecycleOps.ts +40 -71
- package/src/hooks/useEnableKeyframes.test.ts +142 -1
- package/src/hooks/useEnableKeyframes.ts +73 -29
- package/src/hooks/useGestureCommit.test.tsx +130 -0
- package/src/hooks/useGestureCommit.ts +32 -8
- package/src/hooks/useGroupCommits.ts +7 -28
- package/src/hooks/useGsapAwareEditing.test.tsx +239 -0
- package/src/hooks/useGsapAwareEditing.ts +115 -20
- package/src/hooks/useGsapKeyframeOps.test.tsx +59 -0
- package/src/hooks/useGsapKeyframeOps.ts +38 -10
- package/src/hooks/useGsapScriptCommits.test.tsx +40 -1
- package/src/hooks/useGsapScriptCommits.ts +134 -50
- package/src/hooks/useGsapSelectionHandlers.ts +49 -16
- package/src/hooks/useMusicBeatAnalysis.ts +72 -36
- package/src/hooks/usePersistentEditHistory.test.ts +33 -0
- package/src/hooks/usePersistentEditHistory.ts +92 -58
- package/src/hooks/usePreviewPersistence.ts +25 -7
- package/src/hooks/useRazorSplit.history.test.tsx +148 -18
- package/src/hooks/useRazorSplit.test.ts +269 -0
- package/src/hooks/useRazorSplit.testHelpers.ts +64 -0
- package/src/hooks/useRazorSplit.ts +107 -36
- package/src/hooks/useRenderClipContent.ts +24 -6
- package/src/hooks/useStudioContextValue.ts +15 -5
- package/src/hooks/useStudioUrlState.ts +2 -4
- package/src/hooks/useTimelineEditing.test.tsx +20 -29
- package/src/hooks/useTimelineEditingTypes.ts +6 -0
- package/src/hooks/useTimelineGroupEditing.ts +18 -4
- package/src/index.ts +1 -1
- package/src/player/components/ImageThumbnail.test.tsx +173 -0
- package/src/player/components/ImageThumbnail.tsx +160 -0
- package/src/player/components/PlayheadIndicator.tsx +50 -5
- package/src/player/components/Timeline.test.ts +102 -19
- package/src/player/components/Timeline.tsx +194 -194
- package/src/player/components/TimelineCanvas.tsx +207 -521
- package/src/player/components/TimelineClip.tsx +4 -1
- package/src/player/components/TimelineClipDiamonds.tsx +9 -40
- package/src/player/components/TimelineEmptyState.tsx +3 -1
- package/src/player/components/TimelineLanes.tsx +487 -0
- package/src/player/components/TimelineOverlays.tsx +122 -0
- package/src/player/components/VideoThumbnail.test.tsx +152 -0
- package/src/player/components/VideoThumbnail.tsx +28 -7
- package/src/player/components/thumbnailUtils.test.ts +127 -0
- package/src/player/components/thumbnailUtils.ts +54 -0
- package/src/player/components/timelineCallbacks.ts +18 -18
- package/src/player/components/timelineClipChildren.tsx +39 -0
- package/src/player/components/timelineClipDragCommit.test.ts +943 -0
- package/src/player/components/timelineClipDragCommit.ts +401 -0
- package/src/player/components/timelineClipDragPreview.test.ts +144 -0
- package/src/player/components/timelineClipDragPreview.ts +323 -38
- package/src/player/components/timelineClipDragTypes.ts +65 -0
- package/src/player/components/timelineCollision.test.ts +42 -2
- package/src/player/components/timelineDragDrop.ts +69 -60
- package/src/player/components/timelineEditCapabilities.ts +52 -0
- package/src/player/components/timelineEditing.test.ts +1 -1
- package/src/player/components/timelineEditing.ts +76 -59
- package/src/player/components/timelineGroupEditing.test.ts +126 -0
- package/src/player/components/timelineGroupEditing.ts +133 -0
- package/src/player/components/timelineGroupResizeCommit.ts +54 -0
- package/src/player/components/timelineLayout.test.ts +95 -23
- package/src/player/components/timelineLayout.ts +120 -61
- package/src/player/components/timelineMarquee.test.ts +197 -0
- package/src/player/components/timelineMarquee.ts +112 -0
- package/src/player/components/timelineOptimisticRevision.ts +42 -0
- package/src/player/components/timelineTheme.ts +6 -1
- package/src/player/components/useResolvedTimelineEditCallbacks.ts +25 -3
- package/src/player/components/useTimelineClipDrag.resize.test.tsx +241 -0
- package/src/player/components/useTimelineClipDrag.ts +380 -386
- package/src/player/components/useTimelineEditPinning.ts +121 -0
- package/src/player/components/useTimelineGeometry.ts +129 -0
- package/src/player/components/useTimelinePlayhead.ts +4 -16
- package/src/player/components/useTimelineRangeSelection.ts +341 -50
- package/src/player/components/useTimelineStackingSync.test.tsx +67 -0
- package/src/player/components/useTimelineStackingSync.ts +83 -0
- package/src/player/hooks/useExpandedTimelineElements.ts +0 -3
- package/src/player/hooks/usePlaybackKeyboard.ts +5 -0
- package/src/player/hooks/useTimelinePlayer.ts +48 -53
- package/src/player/hooks/useTimelinePlayerLoop.ts +85 -0
- package/src/player/index.ts +3 -2
- package/src/player/lib/time.test.ts +19 -19
- package/src/player/lib/time.ts +6 -2
- package/src/player/lib/timelineDOM.test.ts +25 -98
- package/src/player/lib/timelineDOM.ts +12 -81
- package/src/player/lib/timelineElementHelpers.ts +54 -5
- package/src/player/lib/timelineIframeHelpers.ts +2 -0
- package/src/player/store/playerStore.ts +62 -3
- package/src/styles/studio.css +27 -0
- package/src/utils/assetPreviewStore.ts +33 -0
- package/src/utils/blockInstaller.ts +10 -2
- package/src/utils/editHistory.test.ts +35 -0
- package/src/utils/gsapSoftReload.test.ts +119 -1
- package/src/utils/gsapSoftReload.ts +153 -0
- package/src/utils/mediaTypes.ts +3 -2
- package/src/utils/resizeDebug.ts +55 -0
- package/src/utils/rootDuration.test.ts +90 -1
- package/src/utils/rootDuration.ts +76 -13
- package/src/utils/sdkCutover.ts +4 -0
- package/src/utils/studioFileHistory.ts +37 -7
- package/src/utils/studioHelpers.ts +62 -0
- package/src/utils/studioPreviewHelpers.test.ts +65 -8
- package/src/utils/studioPreviewHelpers.ts +10 -0
- package/src/utils/studioTelemetry.ts +4 -1
- package/src/utils/studioUrlState.test.ts +0 -1
- package/src/utils/timelineAssetDrop.ts +62 -0
- package/src/utils/timelineDiscovery.ts +0 -17
- package/dist/assets/index-BRwkMj0w.js +0 -423
- package/dist/assets/index-Dq7FEg0K.css +0 -1
- package/dist/chunk-SOTCF4DF.js.map +0 -1
- package/src/components/StudioPreviewArea.tsx +0 -500
- package/src/components/nle/NLELayout.test.ts +0 -12
- package/src/components/nle/NLELayout.tsx +0 -591
- package/src/player/components/TimelineLayerGutter.tsx +0 -61
- package/src/player/components/TimelineSelectionOverlays.tsx +0 -55
- package/src/player/components/timelineMarqueeSelection.test.ts +0 -87
- package/src/player/components/timelineSnapTargets.test.ts +0 -144
- package/src/player/components/timelineSnapTargets.ts +0 -164
- package/src/player/components/useTimelineClipDrag.test.tsx +0 -506
- package/src/player/components/useTimelineClipGroupDrag.ts +0 -417
- package/src/player/components/useTimelineMarqueeSelection.test.tsx +0 -231
- package/src/player/components/useTimelineMarqueeSelection.ts +0 -276
- package/src/utils/timelineDiscovery.test.ts +0 -90
- /package/dist/{domEditingLayers-2ECJK24D.js.map → domEditingLayers-6LQGKPOI.js.map} +0 -0
|
@@ -31,12 +31,16 @@ interface DomEditCropHandlesProps {
|
|
|
31
31
|
onStyleCommit?: (property: string, value: string) => Promise<void> | void;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
//
|
|
35
|
-
//
|
|
36
|
-
|
|
34
|
+
// Hit-strip size (px) for an edge crop handle: THICKNESS extends outward from
|
|
35
|
+
// the crop edge (flush against it, never over the element body, so a body
|
|
36
|
+
// drag always MOVES), LENGTH runs along the edge. The visible pill is smaller
|
|
37
|
+
// and centered inside the strip.
|
|
38
|
+
const EDGE_HIT_THICKNESS = 12;
|
|
39
|
+
const EDGE_HIT_LENGTH = 32;
|
|
37
40
|
|
|
38
|
-
/** Place an edge handle just OUTSIDE the given crop edge
|
|
39
|
-
* fully past the boundary). Keeps the element body free
|
|
41
|
+
/** Place an edge handle's hit strip just OUTSIDE the given crop edge
|
|
42
|
+
* (translate pushes it fully past the boundary). Keeps the element body free
|
|
43
|
+
* for moving. Corners stay free for the selection's own resize handles. */
|
|
40
44
|
function edgeHandlePlacement(
|
|
41
45
|
edge: CropEdge,
|
|
42
46
|
rect: { left: number; top: number; width: number; height: number },
|
|
@@ -44,27 +48,36 @@ function edgeHandlePlacement(
|
|
|
44
48
|
const cx = rect.left + rect.width / 2;
|
|
45
49
|
const cy = rect.top + rect.height / 2;
|
|
46
50
|
if (edge === "top") {
|
|
47
|
-
return { left: cx, top: rect.top
|
|
51
|
+
return { left: cx, top: rect.top, transform: "translate(-50%, -100%)" };
|
|
48
52
|
}
|
|
49
53
|
if (edge === "bottom") {
|
|
50
|
-
return {
|
|
51
|
-
left: cx,
|
|
52
|
-
top: rect.top + rect.height + EDGE_HANDLE_GAP,
|
|
53
|
-
transform: "translate(-50%, 0)",
|
|
54
|
-
};
|
|
54
|
+
return { left: cx, top: rect.top + rect.height, transform: "translate(-50%, 0)" };
|
|
55
55
|
}
|
|
56
56
|
if (edge === "left") {
|
|
57
|
-
return { left: rect.left
|
|
57
|
+
return { left: rect.left, top: cy, transform: "translate(-100%, -50%)" };
|
|
58
58
|
}
|
|
59
|
-
return {
|
|
60
|
-
left: rect.left + rect.width + EDGE_HANDLE_GAP,
|
|
61
|
-
top: cy,
|
|
62
|
-
transform: "translate(0, -50%)",
|
|
63
|
-
};
|
|
59
|
+
return { left: rect.left + rect.width, top: cy, transform: "translate(0, -50%)" };
|
|
64
60
|
}
|
|
65
61
|
|
|
66
62
|
const EDGES: CropEdge[] = ["top", "right", "bottom", "left"];
|
|
67
63
|
|
|
64
|
+
/** Hit-strip + pill dimensions for an edge handle, keyed on its orientation. */
|
|
65
|
+
function edgeHandleMetrics(vertical: boolean): {
|
|
66
|
+
hitWidth: number;
|
|
67
|
+
hitHeight: number;
|
|
68
|
+
cursor: string;
|
|
69
|
+
pillWidth: number;
|
|
70
|
+
pillHeight: number;
|
|
71
|
+
} {
|
|
72
|
+
return {
|
|
73
|
+
hitWidth: vertical ? EDGE_HIT_THICKNESS : EDGE_HIT_LENGTH,
|
|
74
|
+
hitHeight: vertical ? EDGE_HIT_LENGTH : EDGE_HIT_THICKNESS,
|
|
75
|
+
cursor: vertical ? "ew-resize" : "ns-resize",
|
|
76
|
+
pillWidth: vertical ? 4 : 24,
|
|
77
|
+
pillHeight: vertical ? 24 : 4,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
68
81
|
/**
|
|
69
82
|
* Always-on crop, integrated with the selection (no crop "mode"): while a
|
|
70
83
|
* croppable element is selected its clip is lifted so the FULL content shows and
|
|
@@ -83,6 +96,7 @@ export function DomEditCropHandles({
|
|
|
83
96
|
}: DomEditCropHandlesProps) {
|
|
84
97
|
const gestureRef = useRef<CropGestureState | null>(null);
|
|
85
98
|
const [dragging, setDragging] = useState(false);
|
|
99
|
+
const [hotEdge, setHotEdge] = useState<CropEdge | null>(null);
|
|
86
100
|
// readElementCropInsets returns null for a clip this tool can't represent
|
|
87
101
|
// (circle/polygon/non-px inset): the crop UI must fully stand down for that
|
|
88
102
|
// element — no lift, no handles — or select+deselect replaces the authored
|
|
@@ -209,10 +223,9 @@ export function DomEditCropHandles({
|
|
|
209
223
|
setDragging(false);
|
|
210
224
|
if (!gesture.didMove) return;
|
|
211
225
|
// Commit to the file. The commit path re-applies the value to the live
|
|
212
|
-
// element, so re-lift
|
|
213
|
-
//
|
|
214
|
-
//
|
|
215
|
-
// is handled rather than left unhandled).
|
|
226
|
+
// element synchronously, so re-lift in the same turn to keep showing the full
|
|
227
|
+
// content + dim while selected. Re-lift again on rejection so a failed commit
|
|
228
|
+
// still restores crop-mode presentation without an unhandled rejection.
|
|
216
229
|
const el = selection.element;
|
|
217
230
|
const reLift = () => {
|
|
218
231
|
if (liftedRef.current) el.style.setProperty("clip-path", "none");
|
|
@@ -223,12 +236,16 @@ export function DomEditCropHandles({
|
|
|
223
236
|
state.insets.right > 0 ||
|
|
224
237
|
state.insets.bottom > 0 ||
|
|
225
238
|
state.insets.left > 0;
|
|
226
|
-
|
|
239
|
+
const commit = onStyleCommit?.("clip-path", committedValue);
|
|
240
|
+
// handleDomStyleCommit applies the persisted value to the live element
|
|
241
|
+
// synchronously before its first await. Restore the crop-mode lift in this
|
|
242
|
+
// same turn so the browser never paints that intermediate cropped state.
|
|
243
|
+
reLift();
|
|
244
|
+
void Promise.resolve(commit).then(() => {
|
|
227
245
|
// Only a landed commit makes the rebuilt inset the restore value; a
|
|
228
246
|
// failed one keeps restoring the pre-lift clip. Store the value itself —
|
|
229
247
|
// by deselect time, render state describes the next selection.
|
|
230
248
|
committedClipRef.current = cropped ? committedValue : "";
|
|
231
|
-
reLift();
|
|
232
249
|
}, reLift);
|
|
233
250
|
};
|
|
234
251
|
|
|
@@ -304,6 +321,7 @@ export function DomEditCropHandles({
|
|
|
304
321
|
<button
|
|
305
322
|
type="button"
|
|
306
323
|
aria-label="Reposition crop"
|
|
324
|
+
title="Reposition crop"
|
|
307
325
|
data-dom-edit-crop-handle="true"
|
|
308
326
|
className="pointer-events-auto absolute rounded-full border-2 border-studio-accent bg-studio-accent/30 shadow-[0_0_0_1px_rgba(0,0,0,0.4)]"
|
|
309
327
|
style={{
|
|
@@ -323,31 +341,48 @@ export function DomEditCropHandles({
|
|
|
323
341
|
)}
|
|
324
342
|
{/* Edge handles — drag a side to crop it. Positioned just OUTSIDE the crop
|
|
325
343
|
edge (via edgeHandlePlacement) so they never overlap the element body:
|
|
326
|
-
dragging the body always MOVES, only a handle crops.
|
|
344
|
+
dragging the body always MOVES, only a handle crops. The pill is
|
|
345
|
+
hover-revealed (or shown while dragging / once a crop exists) so the
|
|
346
|
+
resting selection chrome stays uncluttered; the hit strip is always
|
|
347
|
+
live, and the title names the affordance. */}
|
|
327
348
|
{EDGES.map((edge) => {
|
|
328
349
|
const vertical = edge === "left" || edge === "right";
|
|
329
350
|
const place = edgeHandlePlacement(edge, cropRect);
|
|
351
|
+
const revealed = dragging || hasCrop || hotEdge === edge;
|
|
352
|
+
const m = edgeHandleMetrics(vertical);
|
|
330
353
|
return (
|
|
331
354
|
<button
|
|
332
355
|
key={edge}
|
|
333
356
|
type="button"
|
|
334
357
|
aria-label={`Crop ${edge}`}
|
|
358
|
+
title="Crop"
|
|
335
359
|
data-dom-edit-crop-handle="true"
|
|
336
|
-
className="pointer-events-auto absolute
|
|
360
|
+
className="pointer-events-auto absolute flex items-center justify-center border-0 bg-transparent p-0"
|
|
337
361
|
style={{
|
|
338
362
|
left: place.left,
|
|
339
363
|
top: place.top,
|
|
340
|
-
width:
|
|
341
|
-
height:
|
|
364
|
+
width: m.hitWidth,
|
|
365
|
+
height: m.hitHeight,
|
|
342
366
|
transform: place.transform,
|
|
343
|
-
cursor:
|
|
367
|
+
cursor: m.cursor,
|
|
344
368
|
touchAction: "none",
|
|
345
369
|
}}
|
|
370
|
+
onPointerEnter={() => setHotEdge(edge)}
|
|
371
|
+
onPointerLeave={() => setHotEdge((prev) => (prev === edge ? null : prev))}
|
|
346
372
|
onPointerDown={(event) => startCropGesture(edge, event)}
|
|
347
373
|
onPointerMove={updateCropGesture}
|
|
348
374
|
onPointerUp={finishCropGesture}
|
|
349
375
|
onPointerCancel={cancelCropGesture}
|
|
350
|
-
|
|
376
|
+
>
|
|
377
|
+
<span
|
|
378
|
+
className="pointer-events-none rounded-full bg-studio-accent/90 shadow-[0_0_0_1px_rgba(0,0,0,0.4)] transition-opacity duration-100"
|
|
379
|
+
style={{
|
|
380
|
+
width: m.pillWidth,
|
|
381
|
+
height: m.pillHeight,
|
|
382
|
+
opacity: revealed ? 1 : 0,
|
|
383
|
+
}}
|
|
384
|
+
/>
|
|
385
|
+
</button>
|
|
351
386
|
);
|
|
352
387
|
})}
|
|
353
388
|
</div>
|