@hyperframes/studio 0.8.97 → 0.8.98
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-Biu5_W0l.js → hyperframes-player-C6muFtfk.js} +1 -1
- package/dist/assets/{index-B5Z-1RW9.js → index-B6vU39NM.js} +1 -1
- package/dist/assets/{index-CWuozokW.js → index-BxnoLgxG.js} +1 -1
- package/dist/assets/{index-BdV5T-QI.js → index-itc1XziP.js} +174 -174
- package/dist/index.d.ts +16 -4
- package/dist/index.html +1 -1
- package/dist/index.js +216 -234
- package/dist/index.js.map +1 -1
- package/package.json +9 -8
- package/src/components/EditorShell.tsx +7 -0
- package/src/components/editor/DomEditOverlay.tsx +0 -27
- package/src/components/editor/DomEditSelectionChrome.test.tsx +0 -5
- package/src/components/editor/DomEditSelectionChrome.tsx +0 -6
- package/src/components/editor/clickAfterPreventedPress.test.tsx +122 -0
- package/src/components/editor/propertyPanelFont.test.tsx +48 -5
- package/src/components/editor/propertyPanelFont.tsx +2 -1
- package/src/components/editor/shiftDragAxisLock.test.tsx +0 -2
- package/src/components/nle/TimelinePane.tsx +4 -0
- package/src/hooks/useCommitPreflightCapabilities.ts +3 -11
- package/src/hooks/useGsapAnimationFetchFallback.test.ts +44 -3
- package/src/hooks/useGsapAnimationFetchFallback.ts +11 -35
- package/src/hooks/useGsapTweenCache.element.test.tsx +23 -1
- package/src/hooks/useGsapTweenCache.ts +0 -24
- package/src/index.ts +4 -1
- package/src/player/components/ClipContextMenu.test.tsx +182 -0
- package/src/player/components/ClipContextMenu.tsx +52 -10
- package/src/player/components/TimelineOverlays.test.ts +30 -7
- package/src/player/components/TimelineOverlays.tsx +7 -1
- package/src/player/components/TimelineProvider.tsx +1 -0
- package/src/player/components/TimelineTypes.ts +10 -0
- package/src/player/components/menuKeyboardNav.ts +12 -5
- package/src/player/components/useTimelineProviderState.tsx +2 -0
package/dist/index.js
CHANGED
|
@@ -12872,6 +12872,7 @@ function useTimelineProviderState({
|
|
|
12872
12872
|
onPasteClip,
|
|
12873
12873
|
onDuplicateClip,
|
|
12874
12874
|
canPasteClip,
|
|
12875
|
+
clipMenuItems,
|
|
12875
12876
|
theme: themeOverrides,
|
|
12876
12877
|
showAudioEffects = true,
|
|
12877
12878
|
showKeyframes = true,
|
|
@@ -13170,6 +13171,7 @@ function useTimelineProviderState({
|
|
|
13170
13171
|
onPasteClip,
|
|
13171
13172
|
onDuplicateClip,
|
|
13172
13173
|
canPasteClip,
|
|
13174
|
+
clipMenuItems,
|
|
13173
13175
|
onSelectElement,
|
|
13174
13176
|
selectedElementId,
|
|
13175
13177
|
setRangeSelectionRef,
|
|
@@ -21575,7 +21577,7 @@ var TimelineCanvas = memo13(function TimelineCanvas2() {
|
|
|
21575
21577
|
});
|
|
21576
21578
|
|
|
21577
21579
|
// src/player/components/TimelineOverlays.tsx
|
|
21578
|
-
import { useEffect as useEffect30 } from "react";
|
|
21580
|
+
import { useEffect as useEffect30, useMemo as useMemo32 } from "react";
|
|
21579
21581
|
|
|
21580
21582
|
// src/player/components/EditModal.tsx
|
|
21581
21583
|
import { useState as useState24, useCallback as useCallback33, useMemo as useMemo31, useRef as useRef40 } from "react";
|
|
@@ -21831,7 +21833,9 @@ function useMenuKeyboardNav(menuRef) {
|
|
|
21831
21833
|
menu.addEventListener("keydown", onKeyDown);
|
|
21832
21834
|
return () => {
|
|
21833
21835
|
menu.removeEventListener("keydown", onKeyDown);
|
|
21834
|
-
|
|
21836
|
+
const active = document.activeElement;
|
|
21837
|
+
const focusLeftWithMenu = active === null || active === document.body || menu.contains(active);
|
|
21838
|
+
if (focusLeftWithMenu && previouslyFocused instanceof HTMLElement && document.contains(previouslyFocused)) {
|
|
21835
21839
|
previouslyFocused.focus();
|
|
21836
21840
|
}
|
|
21837
21841
|
};
|
|
@@ -21967,6 +21971,36 @@ function KeyframeDiamondContextMenu({
|
|
|
21967
21971
|
import { memo as memo14 } from "react";
|
|
21968
21972
|
import { createPortal as createPortal4 } from "react-dom";
|
|
21969
21973
|
import { Fragment as Fragment18, jsx as jsx58, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
21974
|
+
var itemClass = (enabled) => `w-full flex items-center justify-between px-3 py-1.5 text-xs text-left outline-none${enabled ? " focus-visible:bg-neutral-800 text-neutral-300 hover:bg-neutral-800 cursor-pointer" : " text-neutral-600 cursor-not-allowed"}`;
|
|
21975
|
+
function HostItems({
|
|
21976
|
+
items,
|
|
21977
|
+
onClose
|
|
21978
|
+
}) {
|
|
21979
|
+
return /* @__PURE__ */ jsxs38(Fragment18, { children: [
|
|
21980
|
+
items.map((item) => /* @__PURE__ */ jsxs38(
|
|
21981
|
+
"button",
|
|
21982
|
+
{
|
|
21983
|
+
type: "button",
|
|
21984
|
+
role: "menuitem",
|
|
21985
|
+
className: itemClass(!item.disabled),
|
|
21986
|
+
disabled: item.disabled,
|
|
21987
|
+
onClick: () => {
|
|
21988
|
+
onClose();
|
|
21989
|
+
item.onSelect();
|
|
21990
|
+
},
|
|
21991
|
+
children: [
|
|
21992
|
+
/* @__PURE__ */ jsxs38("span", { className: "flex items-center gap-2", children: [
|
|
21993
|
+
item.icon,
|
|
21994
|
+
item.label
|
|
21995
|
+
] }),
|
|
21996
|
+
item.shortcut && /* @__PURE__ */ jsx58("span", { className: "text-neutral-500 text-[10px] ml-3", children: item.shortcut })
|
|
21997
|
+
]
|
|
21998
|
+
},
|
|
21999
|
+
item.id
|
|
22000
|
+
)),
|
|
22001
|
+
/* @__PURE__ */ jsx58("div", { className: "my-1 border-t border-neutral-700/60" })
|
|
22002
|
+
] });
|
|
22003
|
+
}
|
|
21970
22004
|
var ClipContextMenu = memo14(function ClipContextMenu2({
|
|
21971
22005
|
x,
|
|
21972
22006
|
y,
|
|
@@ -21978,7 +22012,8 @@ var ClipContextMenu = memo14(function ClipContextMenu2({
|
|
|
21978
22012
|
onCopy,
|
|
21979
22013
|
onPaste,
|
|
21980
22014
|
onDuplicate,
|
|
21981
|
-
canPaste
|
|
22015
|
+
canPaste,
|
|
22016
|
+
hostItems = []
|
|
21982
22017
|
}) {
|
|
21983
22018
|
const menuRef = useContextMenuDismiss(onClose);
|
|
21984
22019
|
useMenuKeyboardNav(menuRef);
|
|
@@ -21990,14 +22025,14 @@ var ClipContextMenu = memo14(function ClipContextMenu2({
|
|
|
21990
22025
|
const canSplit = isSplittable && currentTime > element.start && currentTime < element.start + element.duration;
|
|
21991
22026
|
const splitLabel = !isSplittable ? null : canSplit ? `Split at ${currentTime.toFixed(2)}s` : "Split (move playhead inside clip)";
|
|
21992
22027
|
const clipboardItemCount = [onCopy, onPaste, onDuplicate].filter(Boolean).length;
|
|
21993
|
-
const
|
|
21994
|
-
const
|
|
22028
|
+
const hostRows = hostItems.length;
|
|
22029
|
+
const rowCount = hostRows + (splitLabel ? 1 : 0) + clipboardItemCount + 1;
|
|
22030
|
+
const dividerCount = (hostRows > 0 ? 1 : 0) + (splitLabel ? 1 : 0) + (clipboardItemCount > 0 ? 1 : 0);
|
|
21995
22031
|
const menuWidth = 200;
|
|
21996
22032
|
const menuHeight = rowCount * 30 + dividerCount * 9 + 8;
|
|
21997
22033
|
const overflowY = y + menuHeight - window.innerHeight;
|
|
21998
22034
|
const adjustedX = x + menuWidth > window.innerWidth ? x - menuWidth : x;
|
|
21999
22035
|
const adjustedY = overflowY > 0 ? y - overflowY - 8 : y;
|
|
22000
|
-
const itemClass = (enabled) => `w-full flex items-center justify-between px-3 py-1.5 text-xs text-left outline-none${enabled ? " focus-visible:bg-neutral-800 text-neutral-300 hover:bg-neutral-800 cursor-pointer" : " text-neutral-600 cursor-not-allowed"}`;
|
|
22001
22036
|
return createPortal4(
|
|
22002
22037
|
/* @__PURE__ */ jsxs38(
|
|
22003
22038
|
"div",
|
|
@@ -22008,6 +22043,7 @@ var ClipContextMenu = memo14(function ClipContextMenu2({
|
|
|
22008
22043
|
className: "fixed z-200 bg-neutral-900 border border-neutral-700 rounded-md shadow-lg py-1 min-w-[180px]",
|
|
22009
22044
|
style: { left: adjustedX, top: adjustedY },
|
|
22010
22045
|
children: [
|
|
22046
|
+
hostRows > 0 && /* @__PURE__ */ jsx58(HostItems, { items: hostItems, onClose }),
|
|
22011
22047
|
splitLabel && /* @__PURE__ */ jsxs38(Fragment18, { children: [
|
|
22012
22048
|
/* @__PURE__ */ jsxs38(
|
|
22013
22049
|
"button",
|
|
@@ -22128,7 +22164,7 @@ var TrackGapContextMenu = memo15(function TrackGapContextMenu2({
|
|
|
22128
22164
|
const overflowY = y + menuHeight - window.innerHeight;
|
|
22129
22165
|
const adjustedX = x + menuWidth > window.innerWidth ? x - menuWidth : x;
|
|
22130
22166
|
const adjustedY = overflowY > 0 ? y - overflowY - 8 : y;
|
|
22131
|
-
const
|
|
22167
|
+
const itemClass2 = (enabled) => `w-full flex items-center justify-between px-3 py-1.5 text-xs text-left ${enabled ? "text-neutral-300 hover:bg-neutral-800 cursor-pointer" : "text-neutral-600 cursor-not-allowed"}`;
|
|
22132
22168
|
const closeGapTitle = canCloseGap ? void 0 : gapWidth == null ? "No gap here" : "A clip on this track can't be moved";
|
|
22133
22169
|
const closeAllTitle = canCloseAllGaps ? void 0 : hasAnyGaps ? "A clip on this track can't be moved" : "No gaps on this track";
|
|
22134
22170
|
return createPortal5(
|
|
@@ -22144,7 +22180,7 @@ var TrackGapContextMenu = memo15(function TrackGapContextMenu2({
|
|
|
22144
22180
|
"button",
|
|
22145
22181
|
{
|
|
22146
22182
|
type: "button",
|
|
22147
|
-
className:
|
|
22183
|
+
className: itemClass2(canCloseGap),
|
|
22148
22184
|
disabled: !canCloseGap,
|
|
22149
22185
|
title: closeGapTitle,
|
|
22150
22186
|
onPointerEnter: () => onHoverAction(canCloseGap ? "close-gap" : null),
|
|
@@ -22166,7 +22202,7 @@ var TrackGapContextMenu = memo15(function TrackGapContextMenu2({
|
|
|
22166
22202
|
"button",
|
|
22167
22203
|
{
|
|
22168
22204
|
type: "button",
|
|
22169
|
-
className:
|
|
22205
|
+
className: itemClass2(canCloseAllGaps),
|
|
22170
22206
|
disabled: !canCloseAllGaps,
|
|
22171
22207
|
title: closeAllTitle,
|
|
22172
22208
|
onPointerEnter: () => onHoverAction(canCloseAllGaps ? "close-all" : null),
|
|
@@ -22330,6 +22366,11 @@ function TimelineClipMenuOverlay() {
|
|
|
22330
22366
|
useEffect30(() => {
|
|
22331
22367
|
if (clipContextMenu && !element) setClipContextMenu(null);
|
|
22332
22368
|
}, [element, clipContextMenu, setClipContextMenu]);
|
|
22369
|
+
const { clipMenuItems } = overlay;
|
|
22370
|
+
const hostItems = useMemo32(
|
|
22371
|
+
() => element ? clipMenuItems?.(element) : void 0,
|
|
22372
|
+
[clipMenuItems, element]
|
|
22373
|
+
);
|
|
22333
22374
|
if (!clipContextMenu || !element) return null;
|
|
22334
22375
|
const readCurrentElement = () => resolveTimelineContextElement({
|
|
22335
22376
|
capturedElement: element,
|
|
@@ -22360,7 +22401,8 @@ function TimelineClipMenuOverlay() {
|
|
|
22360
22401
|
onCopy: overlay.onCopyClip,
|
|
22361
22402
|
onPaste: overlay.onPasteClip,
|
|
22362
22403
|
onDuplicate: overlay.onDuplicateClip,
|
|
22363
|
-
canPaste: overlay.canPasteClip?.() ?? false
|
|
22404
|
+
canPaste: overlay.canPasteClip?.() ?? false,
|
|
22405
|
+
hostItems
|
|
22364
22406
|
}
|
|
22365
22407
|
);
|
|
22366
22408
|
}
|
|
@@ -22570,7 +22612,7 @@ var Timeline = Object.assign(TimelineComposed, {
|
|
|
22570
22612
|
});
|
|
22571
22613
|
|
|
22572
22614
|
// src/player/components/VideoThumbnail.tsx
|
|
22573
|
-
import { memo as memo17, useMemo as
|
|
22615
|
+
import { memo as memo17, useMemo as useMemo33 } from "react";
|
|
22574
22616
|
|
|
22575
22617
|
// src/hooks/useThumbnailLease.ts
|
|
22576
22618
|
import { useCallback as useCallback34, useLayoutEffect as useLayoutEffect7, useRef as useRef41, useSyncExternalStore as useSyncExternalStore3 } from "react";
|
|
@@ -23260,7 +23302,7 @@ var VideoThumbnail = memo17(function VideoThumbnail2({
|
|
|
23260
23302
|
const requestFrameCount = quantizeThumbnailFrameCount(
|
|
23261
23303
|
computeThumbnailStrip(container.width, 16 / 9, container.height).frameCount
|
|
23262
23304
|
);
|
|
23263
|
-
const requestProps =
|
|
23305
|
+
const requestProps = useMemo33(
|
|
23264
23306
|
() => ({
|
|
23265
23307
|
videoSrc,
|
|
23266
23308
|
sourceStart,
|
|
@@ -23272,11 +23314,11 @@ var VideoThumbnail = memo17(function VideoThumbnail2({
|
|
|
23272
23314
|
}),
|
|
23273
23315
|
[duration, priority, projectId, sessionEpoch, sourceRangeDuration, sourceStart, videoSrc]
|
|
23274
23316
|
);
|
|
23275
|
-
const posterRequest =
|
|
23317
|
+
const posterRequest = useMemo33(
|
|
23276
23318
|
() => createVideoThumbnailRequest(requestProps, 1, false),
|
|
23277
23319
|
[requestProps]
|
|
23278
23320
|
);
|
|
23279
|
-
const richRequest =
|
|
23321
|
+
const richRequest = useMemo33(
|
|
23280
23322
|
() => createVideoThumbnailRequest(requestProps, requestFrameCount, true),
|
|
23281
23323
|
[requestFrameCount, requestProps]
|
|
23282
23324
|
);
|
|
@@ -23340,7 +23382,7 @@ var VideoThumbnail = memo17(function VideoThumbnail2({
|
|
|
23340
23382
|
});
|
|
23341
23383
|
|
|
23342
23384
|
// src/player/components/CompositionThumbnail.tsx
|
|
23343
|
-
import { memo as memo18, useMemo as
|
|
23385
|
+
import { memo as memo18, useMemo as useMemo34 } from "react";
|
|
23344
23386
|
import { jsx as jsx66, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
23345
23387
|
var THUMBNAIL_URL_VERSION = "v3";
|
|
23346
23388
|
var THUMBNAIL_SEEK_TIME_SECONDS = 3;
|
|
@@ -23419,7 +23461,7 @@ var CompositionThumbnail = memo18(function CompositionThumbnail2({
|
|
|
23419
23461
|
origin: window.location.origin,
|
|
23420
23462
|
contentRevision
|
|
23421
23463
|
});
|
|
23422
|
-
const request =
|
|
23464
|
+
const request = useMemo34(
|
|
23423
23465
|
() => ({
|
|
23424
23466
|
key: createThumbnailKey({ kind: "composition", url }),
|
|
23425
23467
|
projectId,
|
|
@@ -26406,7 +26448,7 @@ function useTimelinePlayer({
|
|
|
26406
26448
|
}
|
|
26407
26449
|
|
|
26408
26450
|
// src/player/hooks/usePlayerHandle.ts
|
|
26409
|
-
import { useCallback as useCallback43, useMemo as
|
|
26451
|
+
import { useCallback as useCallback43, useMemo as useMemo35 } from "react";
|
|
26410
26452
|
|
|
26411
26453
|
// src/components/nle/NLEContext.tsx
|
|
26412
26454
|
import { useContext as useContext7, useState as useState29, useCallback as useCallback42, useRef as useRef48, useEffect as useEffect33 } from "react";
|
|
@@ -26784,7 +26826,7 @@ function usePlayerHandle() {
|
|
|
26784
26826
|
const subscribeTime = useCallback43((listener2) => {
|
|
26785
26827
|
return liveTime.subscribe(listener2);
|
|
26786
26828
|
}, []);
|
|
26787
|
-
const handleElements =
|
|
26829
|
+
const handleElements = useMemo35(() => elements.map(toHandleElement), [elements]);
|
|
26788
26830
|
return {
|
|
26789
26831
|
ready,
|
|
26790
26832
|
playing,
|
|
@@ -27697,7 +27739,7 @@ function CompositionBreadcrumb({ stack, onNavigate }) {
|
|
|
27697
27739
|
import { useCallback as useCallback48, useRef as useRef53, useState as useState32 } from "react";
|
|
27698
27740
|
|
|
27699
27741
|
// src/components/editor/previewReadOnlyContext.tsx
|
|
27700
|
-
import { useContext as useContext8, useMemo as
|
|
27742
|
+
import { useContext as useContext8, useMemo as useMemo36 } from "react";
|
|
27701
27743
|
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
27702
27744
|
var DEFAULT_REASON = "Preview is read-only.";
|
|
27703
27745
|
var PreviewReadOnlyContext = createStableContext("PreviewReadOnlyContext", {
|
|
@@ -27709,7 +27751,7 @@ function PreviewReadOnlyProvider({
|
|
|
27709
27751
|
reason,
|
|
27710
27752
|
children
|
|
27711
27753
|
}) {
|
|
27712
|
-
const value =
|
|
27754
|
+
const value = useMemo36(() => ({ readOnly, reason: reason ?? DEFAULT_REASON }), [readOnly, reason]);
|
|
27713
27755
|
return /* @__PURE__ */ jsx72(PreviewReadOnlyContext, { value, children });
|
|
27714
27756
|
}
|
|
27715
27757
|
function usePreviewReadOnly() {
|
|
@@ -28457,7 +28499,7 @@ import {
|
|
|
28457
28499
|
memo as memo21,
|
|
28458
28500
|
useCallback as useCallback51,
|
|
28459
28501
|
useEffect as useEffect38,
|
|
28460
|
-
useMemo as
|
|
28502
|
+
useMemo as useMemo38,
|
|
28461
28503
|
useRef as useRef58
|
|
28462
28504
|
} from "react";
|
|
28463
28505
|
import {
|
|
@@ -28480,7 +28522,7 @@ var useAudioMetersVisible = create5((set) => ({
|
|
|
28480
28522
|
}));
|
|
28481
28523
|
|
|
28482
28524
|
// src/utils/audioMeterMath.ts
|
|
28483
|
-
import { useMemo as
|
|
28525
|
+
import { useMemo as useMemo37 } from "react";
|
|
28484
28526
|
import { audioDbToGain, audioGainToDb } from "@hyperframes/core/audio-gain";
|
|
28485
28527
|
var METER_DB_MARKS = [0, -3, -6, -12, -24];
|
|
28486
28528
|
var FLOOR_DB = -60;
|
|
@@ -28520,7 +28562,7 @@ function hasProjectAudio(elements) {
|
|
|
28520
28562
|
}
|
|
28521
28563
|
function useProjectHasAudio() {
|
|
28522
28564
|
const elements = usePlayerStore((s) => s.elements);
|
|
28523
|
-
return
|
|
28565
|
+
return useMemo37(() => hasProjectAudio(elements), [elements]);
|
|
28524
28566
|
}
|
|
28525
28567
|
|
|
28526
28568
|
// src/components/nle/AudioMeterStrip.tsx
|
|
@@ -28531,7 +28573,7 @@ var RED_AT = markFraction(-3);
|
|
|
28531
28573
|
function useStrips() {
|
|
28532
28574
|
const elements = usePlayerStore((s) => s.elements);
|
|
28533
28575
|
const masterVolume = usePlayerStore((s) => s.audioVolume);
|
|
28534
|
-
return
|
|
28576
|
+
return useMemo38(() => {
|
|
28535
28577
|
const labels = /* @__PURE__ */ new Map();
|
|
28536
28578
|
const volumes = /* @__PURE__ */ new Map();
|
|
28537
28579
|
for (const el of elements) {
|
|
@@ -28878,7 +28920,8 @@ function TimelinePane({
|
|
|
28878
28920
|
onCopyClip,
|
|
28879
28921
|
onPasteClip,
|
|
28880
28922
|
onDuplicateClip,
|
|
28881
|
-
canPasteClip
|
|
28923
|
+
canPasteClip,
|
|
28924
|
+
clipMenuItems
|
|
28882
28925
|
}) {
|
|
28883
28926
|
const {
|
|
28884
28927
|
seek,
|
|
@@ -28933,7 +28976,8 @@ function TimelinePane({
|
|
|
28933
28976
|
onCopyClip,
|
|
28934
28977
|
onPasteClip,
|
|
28935
28978
|
onDuplicateClip,
|
|
28936
|
-
canPasteClip
|
|
28979
|
+
canPasteClip,
|
|
28980
|
+
clipMenuItems
|
|
28937
28981
|
}
|
|
28938
28982
|
) }),
|
|
28939
28983
|
/* @__PURE__ */ jsx78(AudioMeterStrip, {})
|
|
@@ -29594,7 +29638,7 @@ var CaptionOverlay = memo22(function CaptionOverlay2({ iframeRef }) {
|
|
|
29594
29638
|
});
|
|
29595
29639
|
|
|
29596
29640
|
// src/components/editor/DomEditOverlay.tsx
|
|
29597
|
-
import { memo as memo25, useEffect as useEffect49, useMemo as
|
|
29641
|
+
import { memo as memo25, useEffect as useEffect49, useMemo as useMemo39, useRef as useRef69 } from "react";
|
|
29598
29642
|
|
|
29599
29643
|
// src/components/editor/marqueeCommit.ts
|
|
29600
29644
|
import { useCallback as useCallback53, useEffect as useEffect40, useRef as useRef60, useState as useState36 } from "react";
|
|
@@ -34600,7 +34644,6 @@ function DomEditGroupChrome({
|
|
|
34600
34644
|
allowBodyDrag,
|
|
34601
34645
|
groupCanMove,
|
|
34602
34646
|
gestures,
|
|
34603
|
-
onBoxMouseDown,
|
|
34604
34647
|
onBoxClick
|
|
34605
34648
|
}) {
|
|
34606
34649
|
const canManipulate = allowCanvasMovement && !usePreviewReadOnly();
|
|
@@ -34635,7 +34678,6 @@ function DomEditGroupChrome({
|
|
|
34635
34678
|
if (!canManipulate || !allowBodyDrag || e.shiftKey && !groupCanMove) return;
|
|
34636
34679
|
gestures.startGroupDrag(e);
|
|
34637
34680
|
},
|
|
34638
|
-
onMouseDown: onBoxMouseDown,
|
|
34639
34681
|
onClick: onBoxClick
|
|
34640
34682
|
}
|
|
34641
34683
|
)
|
|
@@ -34654,7 +34696,6 @@ function DomEditSelectionChrome({
|
|
|
34654
34696
|
groupSelectionCount,
|
|
34655
34697
|
gestures,
|
|
34656
34698
|
onStyleCommit,
|
|
34657
|
-
onBoxMouseDown,
|
|
34658
34699
|
onBoxClick,
|
|
34659
34700
|
inlineText
|
|
34660
34701
|
}) {
|
|
@@ -34709,7 +34750,6 @@ function DomEditSelectionChrome({
|
|
|
34709
34750
|
}
|
|
34710
34751
|
if (!e.shiftKey) gestures.startBlockedMove(e, selection);
|
|
34711
34752
|
},
|
|
34712
|
-
onMouseDown: onBoxMouseDown,
|
|
34713
34753
|
onClick: onBoxClick,
|
|
34714
34754
|
children: cropOutlineInsetPx && /* @__PURE__ */ jsx86(
|
|
34715
34755
|
"div",
|
|
@@ -36163,8 +36203,6 @@ var DomEditOverlay = memo25(function DomEditOverlay2({
|
|
|
36163
36203
|
const groupGestureRef = useRef69(null);
|
|
36164
36204
|
const blockedMoveRef = useRef69(null);
|
|
36165
36205
|
const suppressNextBoxClickRef = useRef69(false);
|
|
36166
|
-
const suppressNextBoxMouseDownRef = useRef69(false);
|
|
36167
|
-
const suppressNextOverlayMouseDownRef = useRef69(false);
|
|
36168
36206
|
const snapGuidesRef = useRef69(null);
|
|
36169
36207
|
const rafPausedRef = useRef69(false);
|
|
36170
36208
|
const selectionRef = useRef69(selection);
|
|
@@ -36295,11 +36333,11 @@ var DomEditOverlay = memo25(function DomEditOverlay2({
|
|
|
36295
36333
|
selectionRef,
|
|
36296
36334
|
gestures
|
|
36297
36335
|
});
|
|
36298
|
-
const selectionKey =
|
|
36336
|
+
const selectionKey = useMemo39(() => {
|
|
36299
36337
|
if (!selection) return "none";
|
|
36300
36338
|
return `${selection.sourceFile}:${selection.id ?? selection.selector ?? selection.label}:${selection.selectorIndex ?? 0}`;
|
|
36301
36339
|
}, [selection]);
|
|
36302
|
-
const groupBounds =
|
|
36340
|
+
const groupBounds = useMemo39(
|
|
36303
36341
|
() => resolveDomEditGroupOverlayRect(groupOverlayItems.map((item) => item.rect)),
|
|
36304
36342
|
[groupOverlayItems]
|
|
36305
36343
|
);
|
|
@@ -36307,24 +36345,11 @@ var DomEditOverlay = memo25(function DomEditOverlay2({
|
|
|
36307
36345
|
const groupCanMove = hasGroupSelection && groupOverlayItems.length > 1 && groupOverlayItems.every((item) => item.selection.capabilities.canApplyManualOffset);
|
|
36308
36346
|
const handleOverlayMouseDown = (event) => {
|
|
36309
36347
|
if (!allowCanvasMovement) return;
|
|
36310
|
-
if (suppressNextOverlayMouseDownRef.current) {
|
|
36311
|
-
logSelect("mousedown-suppressed", { shift: event.shiftKey });
|
|
36312
|
-
suppressNextOverlayMouseDownRef.current = false;
|
|
36313
|
-
suppressNextBoxMouseDownRef.current = false;
|
|
36314
|
-
suppressNextBoxClickRef.current = false;
|
|
36315
|
-
event.preventDefault();
|
|
36316
|
-
event.stopPropagation();
|
|
36317
|
-
return;
|
|
36318
|
-
}
|
|
36319
36348
|
const target = event.target;
|
|
36320
36349
|
const onBox = Boolean(target?.closest('[data-dom-edit-selection-box="true"]'));
|
|
36321
36350
|
logSelect("mousedown", { shift: event.shiftKey, onBox });
|
|
36322
36351
|
if (onBox) return;
|
|
36323
36352
|
onCanvasMouseDown(event, { hoverSelection: hoverSelectionRef.current });
|
|
36324
|
-
if (event.shiftKey) {
|
|
36325
|
-
suppressNextBoxMouseDownRef.current = true;
|
|
36326
|
-
suppressNextBoxClickRef.current = true;
|
|
36327
|
-
}
|
|
36328
36353
|
};
|
|
36329
36354
|
const handleOverlayPointerDown = (event) => {
|
|
36330
36355
|
if (!allowCanvasMovement || hostInput || event.button !== 0) return;
|
|
@@ -36342,8 +36367,6 @@ var DomEditOverlay = memo25(function DomEditOverlay2({
|
|
|
36342
36367
|
if (!candidate) return;
|
|
36343
36368
|
event.preventDefault();
|
|
36344
36369
|
event.stopPropagation();
|
|
36345
|
-
suppressNextOverlayMouseDownRef.current = true;
|
|
36346
|
-
suppressNextBoxMouseDownRef.current = true;
|
|
36347
36370
|
suppressNextBoxClickRef.current = true;
|
|
36348
36371
|
onSelectionChangeRef.current(candidate, { additive: true });
|
|
36349
36372
|
return;
|
|
@@ -36367,7 +36390,6 @@ var DomEditOverlay = memo25(function DomEditOverlay2({
|
|
|
36367
36390
|
if (overlayRef.current) {
|
|
36368
36391
|
event.preventDefault();
|
|
36369
36392
|
event.stopPropagation();
|
|
36370
|
-
suppressNextOverlayMouseDownRef.current = true;
|
|
36371
36393
|
marquee.begin(event);
|
|
36372
36394
|
return;
|
|
36373
36395
|
}
|
|
@@ -36383,12 +36405,6 @@ var DomEditOverlay = memo25(function DomEditOverlay2({
|
|
|
36383
36405
|
}
|
|
36384
36406
|
onCanvasMouseDown(event, { hoverSelection: hoverSelectionRef.current });
|
|
36385
36407
|
};
|
|
36386
|
-
const suppressBoxMouseDown = (e) => {
|
|
36387
|
-
if (!suppressNextBoxMouseDownRef.current) return;
|
|
36388
|
-
suppressNextBoxMouseDownRef.current = false;
|
|
36389
|
-
e.preventDefault();
|
|
36390
|
-
e.stopPropagation();
|
|
36391
|
-
};
|
|
36392
36408
|
const { contextMenu, closeContextMenu, handleContextMenu } = useCanvasContextMenuState({
|
|
36393
36409
|
selection,
|
|
36394
36410
|
selectionRef,
|
|
@@ -36446,7 +36462,6 @@ var DomEditOverlay = memo25(function DomEditOverlay2({
|
|
|
36446
36462
|
allowBodyDrag: bodyDrag,
|
|
36447
36463
|
groupCanMove,
|
|
36448
36464
|
gestures,
|
|
36449
|
-
onBoxMouseDown: suppressBoxMouseDown,
|
|
36450
36465
|
onBoxClick: handleBoxClick
|
|
36451
36466
|
}
|
|
36452
36467
|
),
|
|
@@ -36466,7 +36481,6 @@ var DomEditOverlay = memo25(function DomEditOverlay2({
|
|
|
36466
36481
|
groupSelectionCount: groupSelections.length,
|
|
36467
36482
|
gestures,
|
|
36468
36483
|
onStyleCommit: onStyleCommitRef.current,
|
|
36469
|
-
onBoxMouseDown: suppressBoxMouseDown,
|
|
36470
36484
|
onBoxClick: handleBoxClick
|
|
36471
36485
|
}
|
|
36472
36486
|
),
|
|
@@ -41558,10 +41572,10 @@ function PreviewOverlays({
|
|
|
41558
41572
|
}
|
|
41559
41573
|
|
|
41560
41574
|
// src/components/nle/useTimelineEditCallbacks.ts
|
|
41561
|
-
import { useCallback as useCallback65, useMemo as
|
|
41575
|
+
import { useCallback as useCallback65, useMemo as useMemo41 } from "react";
|
|
41562
41576
|
|
|
41563
41577
|
// src/hooks/useGsapTweenCache.ts
|
|
41564
|
-
import { useEffect as useEffect56, useMemo as
|
|
41578
|
+
import { useEffect as useEffect56, useMemo as useMemo40, useRef as useRef76, useState as useState49, useCallback as useCallback64 } from "react";
|
|
41565
41579
|
|
|
41566
41580
|
// src/hooks/gsapRuntimeReaders.ts
|
|
41567
41581
|
import { classifyPropertyGroup as classifyPropertyGroup3 } from "@hyperframes/core/gsap-parser";
|
|
@@ -42557,7 +42571,6 @@ function useGsapAnimationsForElement(projectId, sourceFile, target, version, ifr
|
|
|
42557
42571
|
const [multipleTimelines, setMultipleTimelines] = useState49(false);
|
|
42558
42572
|
const [unsupportedTimelinePattern, setUnsupportedTimelinePattern] = useState49(false);
|
|
42559
42573
|
const lastFetchKeyRef = useRef76("");
|
|
42560
|
-
const retryTimerRef = useRef76(null);
|
|
42561
42574
|
const domClipChildrenKey = usePlayerStore(
|
|
42562
42575
|
(s) => s.domClipChildren.map((c) => `${c.id}<${c.hostId}`).join("|")
|
|
42563
42576
|
);
|
|
@@ -42566,10 +42579,6 @@ function useGsapAnimationsForElement(projectId, sourceFile, target, version, ifr
|
|
|
42566
42579
|
const fetchKey = `${projectId}:${sourceFile}:${version}:${targetKey}`;
|
|
42567
42580
|
if (fetchKey === lastFetchKeyRef.current) return;
|
|
42568
42581
|
lastFetchKeyRef.current = fetchKey;
|
|
42569
|
-
if (retryTimerRef.current) {
|
|
42570
|
-
clearTimeout(retryTimerRef.current);
|
|
42571
|
-
retryTimerRef.current = null;
|
|
42572
|
-
}
|
|
42573
42582
|
if (!projectId) {
|
|
42574
42583
|
setAllAnimations([]);
|
|
42575
42584
|
setMultipleTimelines(false);
|
|
@@ -42590,29 +42599,14 @@ function useGsapAnimationsForElement(projectId, sourceFile, target, version, ifr
|
|
|
42590
42599
|
setAllAnimations(parsed.animations);
|
|
42591
42600
|
setMultipleTimelines(parsed.multipleTimelines === true);
|
|
42592
42601
|
setUnsupportedTimelinePattern(parsed.unsupportedTimelinePattern === true);
|
|
42593
|
-
if (parsed.animations.length === 0 && targetKey) {
|
|
42594
|
-
retryTimerRef.current = setTimeout(() => {
|
|
42595
|
-
if (cancelled) return;
|
|
42596
|
-
fetchParsedAnimations(projectId, sourceFile).then((retryParsed) => {
|
|
42597
|
-
if (cancelled) return;
|
|
42598
|
-
if (retryParsed && retryParsed.animations.length > 0) {
|
|
42599
|
-
setAllAnimations(retryParsed.animations);
|
|
42600
|
-
}
|
|
42601
|
-
});
|
|
42602
|
-
}, 800);
|
|
42603
|
-
}
|
|
42604
42602
|
});
|
|
42605
42603
|
return () => {
|
|
42606
42604
|
cancelled = true;
|
|
42607
|
-
if (retryTimerRef.current) {
|
|
42608
|
-
clearTimeout(retryTimerRef.current);
|
|
42609
|
-
retryTimerRef.current = null;
|
|
42610
|
-
}
|
|
42611
42605
|
};
|
|
42612
42606
|
}, [projectId, sourceFile, version, target?.id, target?.selector]);
|
|
42613
42607
|
const targetId = target?.id ?? null;
|
|
42614
42608
|
const targetSelector = target?.selector ?? null;
|
|
42615
|
-
const rawAnimations =
|
|
42609
|
+
const rawAnimations = useMemo40(() => {
|
|
42616
42610
|
if (!targetId && !targetSelector) return [];
|
|
42617
42611
|
const element = target ? findPreviewNode(iframeRef?.current?.contentDocument, target) : null;
|
|
42618
42612
|
return getAnimationsForElement(
|
|
@@ -42621,7 +42615,7 @@ function useGsapAnimationsForElement(projectId, sourceFile, target, version, ifr
|
|
|
42621
42615
|
element
|
|
42622
42616
|
);
|
|
42623
42617
|
}, [allAnimations, target, version, iframeRef]);
|
|
42624
|
-
const animations =
|
|
42618
|
+
const animations = useMemo40(() => {
|
|
42625
42619
|
const iframe = iframeRef?.current;
|
|
42626
42620
|
let result = rawAnimations;
|
|
42627
42621
|
if (iframe) {
|
|
@@ -42947,7 +42941,7 @@ function useTimelineEditCallbacks({
|
|
|
42947
42941
|
},
|
|
42948
42942
|
[handleGsapRemoveKeyframe]
|
|
42949
42943
|
);
|
|
42950
|
-
return
|
|
42944
|
+
return useMemo41(
|
|
42951
42945
|
() => ({
|
|
42952
42946
|
onMoveElement: handleTimelineElementMove,
|
|
42953
42947
|
onMoveElements: handleTimelineElementsMove,
|
|
@@ -43254,7 +43248,7 @@ var CaptionTimeline = memo29(function CaptionTimeline2({
|
|
|
43254
43248
|
});
|
|
43255
43249
|
|
|
43256
43250
|
// src/hooks/useTimelineSelectionPreviewSync.ts
|
|
43257
|
-
import { useEffect as useEffect57, useMemo as
|
|
43251
|
+
import { useEffect as useEffect57, useMemo as useMemo42, useRef as useRef77 } from "react";
|
|
43258
43252
|
var MAX_UNRESOLVED_SYNC_RETRIES = 3;
|
|
43259
43253
|
function orderSelectedIds(ids, anchor2) {
|
|
43260
43254
|
const ordered = [...ids];
|
|
@@ -43301,7 +43295,7 @@ function useTimelineSelectionPreviewSync({
|
|
|
43301
43295
|
applyMarqueeSelection,
|
|
43302
43296
|
onSelectionNotFound
|
|
43303
43297
|
}) {
|
|
43304
|
-
const selectedIds =
|
|
43298
|
+
const selectedIds = useMemo42(
|
|
43305
43299
|
() => orderSelectedIds(selectedElementIds, selectedElementId),
|
|
43306
43300
|
[selectedElementId, selectedElementIds]
|
|
43307
43301
|
);
|
|
@@ -43390,7 +43384,7 @@ function useTimelineSelectionPreviewSync({
|
|
|
43390
43384
|
}
|
|
43391
43385
|
|
|
43392
43386
|
// src/webmcp/StudioAgentTools.tsx
|
|
43393
|
-
import { useCallback as useCallback67, useEffect as useEffect59, useMemo as
|
|
43387
|
+
import { useCallback as useCallback67, useEffect as useEffect59, useMemo as useMemo43 } from "react";
|
|
43394
43388
|
|
|
43395
43389
|
// src/webmcp/useStudioAgentTools.ts
|
|
43396
43390
|
import { useEffect as useEffect58, useRef as useRef78 } from "react";
|
|
@@ -44713,7 +44707,7 @@ function StudioAgentTools() {
|
|
|
44713
44707
|
editHistory,
|
|
44714
44708
|
previewIframeRef
|
|
44715
44709
|
]);
|
|
44716
|
-
const deps =
|
|
44710
|
+
const deps = useMemo43(
|
|
44717
44711
|
() => ({
|
|
44718
44712
|
getSnapshot,
|
|
44719
44713
|
getPreviewDocument: () => previewIframeRef.current?.contentDocument ?? null,
|
|
@@ -45522,6 +45516,7 @@ function EditorShell({
|
|
|
45522
45516
|
onPasteClip,
|
|
45523
45517
|
onDuplicateClip,
|
|
45524
45518
|
canPasteClip,
|
|
45519
|
+
clipMenuItems,
|
|
45525
45520
|
setCompIdToSrc,
|
|
45526
45521
|
setCompositionLoading,
|
|
45527
45522
|
shouldShowMotionPath,
|
|
@@ -45609,6 +45604,7 @@ function EditorShell({
|
|
|
45609
45604
|
onPasteClip,
|
|
45610
45605
|
onDuplicateClip,
|
|
45611
45606
|
canPasteClip,
|
|
45607
|
+
clipMenuItems,
|
|
45612
45608
|
previewOverlay: /* @__PURE__ */ jsx102(
|
|
45613
45609
|
PreviewOverlays,
|
|
45614
45610
|
{
|
|
@@ -45643,7 +45639,8 @@ function EditorShellBody({
|
|
|
45643
45639
|
onCopyClip,
|
|
45644
45640
|
onPasteClip,
|
|
45645
45641
|
onDuplicateClip,
|
|
45646
|
-
canPasteClip
|
|
45642
|
+
canPasteClip,
|
|
45643
|
+
clipMenuItems
|
|
45647
45644
|
}) {
|
|
45648
45645
|
const { compositionStack, updateCompositionStack, containerRef } = useNLEContext();
|
|
45649
45646
|
const seekCaptionTime = useCallback71((time) => {
|
|
@@ -45689,6 +45686,7 @@ function EditorShellBody({
|
|
|
45689
45686
|
onPasteClip,
|
|
45690
45687
|
onDuplicateClip,
|
|
45691
45688
|
canPasteClip,
|
|
45689
|
+
clipMenuItems,
|
|
45692
45690
|
onSelectTimelineElement,
|
|
45693
45691
|
timelineFooter: captionEditMode ? /* @__PURE__ */ jsxs72("div", { className: "border-t border-neutral-800/30 shrink-0", style: { height: 60 }, children: [
|
|
45694
45692
|
/* @__PURE__ */ jsx102("div", { className: "flex items-center gap-1.5 px-2 py-0.5", children: /* @__PURE__ */ jsx102("span", { className: "text-[9px] font-medium text-neutral-500 uppercase tracking-wider", children: "Captions" }) }),
|
|
@@ -45704,7 +45702,7 @@ function EditorShellBody({
|
|
|
45704
45702
|
}
|
|
45705
45703
|
|
|
45706
45704
|
// src/player/components/AudioWaveform.tsx
|
|
45707
|
-
import { memo as memo30, useCallback as useCallback72, useEffect as useEffect61, useMemo as
|
|
45705
|
+
import { memo as memo30, useCallback as useCallback72, useEffect as useEffect61, useMemo as useMemo44, useRef as useRef80 } from "react";
|
|
45708
45706
|
|
|
45709
45707
|
// src/player/components/audioWaveformPeaks.ts
|
|
45710
45708
|
var LOUDNESS_OPACITY_FLOOR = 0.64;
|
|
@@ -45839,7 +45837,7 @@ var AudioWaveform = memo30(function AudioWaveform2({
|
|
|
45839
45837
|
const canvasRef = useRef80(null);
|
|
45840
45838
|
const observerRef = useRef80(null);
|
|
45841
45839
|
const cacheKey = waveformUrl ?? audioUrl;
|
|
45842
|
-
const request =
|
|
45840
|
+
const request = useMemo44(
|
|
45843
45841
|
() => ({
|
|
45844
45842
|
key: createThumbnailKey({ kind: "waveform", source: cacheKey }),
|
|
45845
45843
|
projectId,
|
|
@@ -45946,7 +45944,7 @@ var AudioWaveform = memo30(function AudioWaveform2({
|
|
|
45946
45944
|
});
|
|
45947
45945
|
|
|
45948
45946
|
// src/player/components/ImageThumbnail.tsx
|
|
45949
|
-
import { memo as memo31, useMemo as
|
|
45947
|
+
import { memo as memo31, useMemo as useMemo45 } from "react";
|
|
45950
45948
|
|
|
45951
45949
|
// src/player/lib/thumbnailImageDecoder.ts
|
|
45952
45950
|
function thumbnailSource(source) {
|
|
@@ -46024,7 +46022,7 @@ var ImageThumbnail = memo31(function ImageThumbnail2({
|
|
|
46024
46022
|
rich = false
|
|
46025
46023
|
}) {
|
|
46026
46024
|
const [container, setContainerRef] = useThumbnailStripSize();
|
|
46027
|
-
const request =
|
|
46025
|
+
const request = useMemo45(
|
|
46028
46026
|
() => ({
|
|
46029
46027
|
key: createThumbnailKey({ kind: "image", source: imageSrc, rich: Number(rich) }),
|
|
46030
46028
|
projectId,
|
|
@@ -46418,13 +46416,13 @@ var SourceEditor = memo32(function SourceEditor2({
|
|
|
46418
46416
|
});
|
|
46419
46417
|
|
|
46420
46418
|
// src/components/editor/PropertyPanel.tsx
|
|
46421
|
-
import { memo as memo36, useMemo as
|
|
46419
|
+
import { memo as memo36, useMemo as useMemo61, useRef as useRef112, useState as useState94 } from "react";
|
|
46422
46420
|
|
|
46423
46421
|
// src/components/editor/InspectorHeaderActions.tsx
|
|
46424
46422
|
import { Eye as Eye3, EyeSlash as EyeSlash2 } from "@phosphor-icons/react";
|
|
46425
46423
|
|
|
46426
46424
|
// src/contexts/DesignPanelInputContext.tsx
|
|
46427
|
-
import { useCallback as useCallback75, useContext as useContext11, useMemo as
|
|
46425
|
+
import { useCallback as useCallback75, useContext as useContext11, useMemo as useMemo46 } from "react";
|
|
46428
46426
|
|
|
46429
46427
|
// src/utils/designInputTracking.ts
|
|
46430
46428
|
var COALESCE_WINDOW_MS = 600;
|
|
@@ -46467,7 +46465,7 @@ function DesignPanelInputProvider({
|
|
|
46467
46465
|
children
|
|
46468
46466
|
}) {
|
|
46469
46467
|
const parent = useContext11(DesignPanelInputContext);
|
|
46470
|
-
const value =
|
|
46468
|
+
const value = useMemo46(
|
|
46471
46469
|
() => ({ ui: ui ?? parent.ui, section: section ?? parent.section }),
|
|
46472
46470
|
[ui, section, parent.ui, parent.section]
|
|
46473
46471
|
);
|
|
@@ -48084,7 +48082,7 @@ function MediaSection({
|
|
|
48084
48082
|
import { isHfColorGradingActive as isHfColorGradingActive2 } from "@hyperframes/core/color-grading";
|
|
48085
48083
|
|
|
48086
48084
|
// src/components/editor/propertyPanelColorGradingControls.tsx
|
|
48087
|
-
import { useMemo as
|
|
48085
|
+
import { useMemo as useMemo47, useRef as useRef86, useState as useState56 } from "react";
|
|
48088
48086
|
import {
|
|
48089
48087
|
HF_COLOR_GRADING_PRESETS,
|
|
48090
48088
|
normalizeHfColorGrading
|
|
@@ -48528,7 +48526,7 @@ function ColorGradingControls({
|
|
|
48528
48526
|
const [detailSettings, setDetailSettings] = useState56(null);
|
|
48529
48527
|
const [lutImporting, setLutImporting] = useState56(false);
|
|
48530
48528
|
const [lutImportError, setLutImportError] = useState56(null);
|
|
48531
|
-
const lutAssets =
|
|
48529
|
+
const lutAssets = useMemo47(
|
|
48532
48530
|
() => assets.filter((asset) => LUT_EXT.test(asset)).sort((a, b) => a.localeCompare(b)),
|
|
48533
48531
|
[assets]
|
|
48534
48532
|
);
|
|
@@ -48808,7 +48806,7 @@ function ColorGradingControls({
|
|
|
48808
48806
|
}
|
|
48809
48807
|
|
|
48810
48808
|
// src/components/editor/useColorGradingController.ts
|
|
48811
|
-
import { useCallback as useCallback80, useEffect as useEffect69, useMemo as
|
|
48809
|
+
import { useCallback as useCallback80, useEffect as useEffect69, useMemo as useMemo48, useRef as useRef88, useState as useState58 } from "react";
|
|
48812
48810
|
import {
|
|
48813
48811
|
HF_COLOR_GRADING_ATTR,
|
|
48814
48812
|
hasHfColorGradingAuthoredValues,
|
|
@@ -49229,7 +49227,7 @@ function useColorGradingController({
|
|
|
49229
49227
|
state: "pending",
|
|
49230
49228
|
message: "Waiting for runtime"
|
|
49231
49229
|
}));
|
|
49232
|
-
const selectedAssetPath =
|
|
49230
|
+
const selectedAssetPath = useMemo48(
|
|
49233
49231
|
() => selectedMediaAssetPath(element, projectId),
|
|
49234
49232
|
[element, projectId]
|
|
49235
49233
|
);
|
|
@@ -49276,7 +49274,7 @@ function useColorGradingController({
|
|
|
49276
49274
|
trackStudioPendingEdit(onSetAttributeLive(COLOR_GRADING_DATA_KEY, value));
|
|
49277
49275
|
};
|
|
49278
49276
|
}, [identityKey]);
|
|
49279
|
-
const target =
|
|
49277
|
+
const target = useMemo48(
|
|
49280
49278
|
() => ({
|
|
49281
49279
|
id: element.id ?? null,
|
|
49282
49280
|
hfId: element.hfId ?? null,
|
|
@@ -50256,7 +50254,7 @@ function ColorField({
|
|
|
50256
50254
|
}
|
|
50257
50255
|
|
|
50258
50256
|
// src/components/editor/propertyPanelFont.tsx
|
|
50259
|
-
import { useEffect as useEffect71, useMemo as
|
|
50257
|
+
import { useEffect as useEffect71, useMemo as useMemo49, useRef as useRef90, useState as useState60 } from "react";
|
|
50260
50258
|
|
|
50261
50259
|
// src/components/editor/fontAssets.ts
|
|
50262
50260
|
var FONT_EXT_RE = /\.(eot|otf|ttc|ttf|woff2?)$/i;
|
|
@@ -50480,13 +50478,14 @@ function FontFamilyField({
|
|
|
50480
50478
|
setImportingFonts(false);
|
|
50481
50479
|
}
|
|
50482
50480
|
};
|
|
50483
|
-
const projectFontAssets =
|
|
50481
|
+
const projectFontAssets = useMemo49(
|
|
50484
50482
|
() => uniqueFontOptions(
|
|
50485
50483
|
importedFonts.map((f) => ({ family: f.family, source: "Imported" }))
|
|
50486
50484
|
),
|
|
50487
50485
|
[importedFonts]
|
|
50488
50486
|
);
|
|
50489
|
-
const options =
|
|
50487
|
+
const options = useMemo49(() => {
|
|
50488
|
+
if (!open) return [];
|
|
50490
50489
|
const documentFonts = collectDocumentFontFamilies();
|
|
50491
50490
|
const googleSet = new Set(googleFonts.map((f) => f.toLowerCase()));
|
|
50492
50491
|
const taggedLocal = localFonts.map(
|
|
@@ -50505,8 +50504,8 @@ function FontFamilyField({
|
|
|
50505
50504
|
...DEFAULT_FONT_FAMILIES.map((f) => ({ family: f, source: "System" }))
|
|
50506
50505
|
])
|
|
50507
50506
|
);
|
|
50508
|
-
}, [currentFamily, googleFonts, localFonts, projectFontAssets]);
|
|
50509
|
-
const filteredOptions =
|
|
50507
|
+
}, [open, currentFamily, googleFonts, localFonts, projectFontAssets]);
|
|
50508
|
+
const filteredOptions = useMemo49(() => {
|
|
50510
50509
|
const matches = options.filter((o) => fontMatchesQuery(o.family, query));
|
|
50511
50510
|
if (query.trim()) return matches.slice(0, 200);
|
|
50512
50511
|
const bySource = /* @__PURE__ */ new Map();
|
|
@@ -50742,7 +50741,7 @@ function FontFamilyField({
|
|
|
50742
50741
|
import { useEffect as useEffect73 } from "react";
|
|
50743
50742
|
|
|
50744
50743
|
// src/components/panels/VariablesBindElement.tsx
|
|
50745
|
-
import { useMemo as
|
|
50744
|
+
import { useMemo as useMemo50, useState as useState62 } from "react";
|
|
50746
50745
|
|
|
50747
50746
|
// src/components/panels/VariablesValueControls.tsx
|
|
50748
50747
|
import { useState as useState61 } from "react";
|
|
@@ -51024,7 +51023,7 @@ function VariablesBindElement({
|
|
|
51024
51023
|
}) {
|
|
51025
51024
|
const [activeKey, setActiveKey] = useState62(null);
|
|
51026
51025
|
const [idDraft, setIdDraft] = useState62("");
|
|
51027
|
-
const actions =
|
|
51026
|
+
const actions = useMemo50(() => buildBindActions(selection, sdkSession), [selection, sdkSession]);
|
|
51028
51027
|
if (actions.length === 0) return null;
|
|
51029
51028
|
const active = actions.find((a) => a.key === activeKey) ?? null;
|
|
51030
51029
|
const trimmedId = sanitizeId(idDraft);
|
|
@@ -51135,7 +51134,7 @@ function uniqueId(base2, existing) {
|
|
|
51135
51134
|
}
|
|
51136
51135
|
|
|
51137
51136
|
// src/contexts/VariablePromoteContext.tsx
|
|
51138
|
-
import { useContext as useContext12, useEffect as useEffect72, useMemo as
|
|
51137
|
+
import { useContext as useContext12, useEffect as useEffect72, useMemo as useMemo51, useState as useState63 } from "react";
|
|
51139
51138
|
import { jsx as jsx118 } from "react/jsx-runtime";
|
|
51140
51139
|
var VariablePromoteContext = createStableContext(
|
|
51141
51140
|
"VariablePromoteContext",
|
|
@@ -51158,15 +51157,15 @@ function VariablePromoteProvider({
|
|
|
51158
51157
|
if (!session) return;
|
|
51159
51158
|
return session.on("change", () => setRevision((r) => r + 1));
|
|
51160
51159
|
}, [session]);
|
|
51161
|
-
const actions =
|
|
51160
|
+
const actions = useMemo51(() => {
|
|
51162
51161
|
if (!session || !selection) return [];
|
|
51163
51162
|
return buildBindActions(selection, session);
|
|
51164
51163
|
}, [session, selection, revision]);
|
|
51165
|
-
const declarations =
|
|
51164
|
+
const declarations = useMemo51(() => {
|
|
51166
51165
|
if (!session) return [];
|
|
51167
51166
|
return session.getVariableDeclarations();
|
|
51168
51167
|
}, [session, revision]);
|
|
51169
|
-
const value =
|
|
51168
|
+
const value = useMemo51(
|
|
51170
51169
|
() => ({ session, selection, actions, declarations, persist: persist2, onPersistError }),
|
|
51171
51170
|
[session, selection, actions, declarations, persist2, onPersistError]
|
|
51172
51171
|
);
|
|
@@ -51175,7 +51174,7 @@ function VariablePromoteProvider({
|
|
|
51175
51174
|
function useVariablePromoteChannel(channel) {
|
|
51176
51175
|
const ctx3 = useContext12(VariablePromoteContext);
|
|
51177
51176
|
const key2 = channel.kind === "style" ? `style:${channel.prop}` : channel.kind;
|
|
51178
|
-
return
|
|
51177
|
+
return useMemo51(() => {
|
|
51179
51178
|
if (!ctx3 || !ctx3.session || !ctx3.selection?.hfId) return null;
|
|
51180
51179
|
const { session, selection, actions, declarations, persist: persist2, onPersistError } = ctx3;
|
|
51181
51180
|
const hfId = selection.hfId;
|
|
@@ -51610,7 +51609,7 @@ function parseColorString(value) {
|
|
|
51610
51609
|
}
|
|
51611
51610
|
|
|
51612
51611
|
// src/components/editor/propertyPanelFill.tsx
|
|
51613
|
-
import { useMemo as
|
|
51612
|
+
import { useMemo as useMemo52, useRef as useRef91, useState as useState64 } from "react";
|
|
51614
51613
|
|
|
51615
51614
|
// src/components/icons/ReverseGradientIcon.tsx
|
|
51616
51615
|
import { jsx as jsx120, jsxs as jsxs86 } from "react/jsx-runtime";
|
|
@@ -51685,8 +51684,8 @@ function ImageFillField({
|
|
|
51685
51684
|
const fileInputRef = useRef91(null);
|
|
51686
51685
|
const [uploading, setUploading] = useState64(false);
|
|
51687
51686
|
const [uploadError, setUploadError] = useState64(null);
|
|
51688
|
-
const imageAssets =
|
|
51689
|
-
const selectedAsset =
|
|
51687
|
+
const imageAssets = useMemo52(() => assets.filter((a) => IMAGE_EXT.test(a)), [assets]);
|
|
51688
|
+
const selectedAsset = useMemo52(
|
|
51690
51689
|
() => resolveSelectedAsset(value, sourceFile, imageAssets),
|
|
51691
51690
|
[imageAssets, sourceFile, value]
|
|
51692
51691
|
);
|
|
@@ -53168,7 +53167,7 @@ import { useCallback as useCallback85, useState as useState69 } from "react";
|
|
|
53168
53167
|
import { useShallow } from "zustand/react/shallow";
|
|
53169
53168
|
|
|
53170
53169
|
// src/components/editor/AnimationCard.tsx
|
|
53171
|
-
import { memo as memo34, useCallback as useCallback84, useEffect as useEffect76, useMemo as
|
|
53170
|
+
import { memo as memo34, useCallback as useCallback84, useEffect as useEffect76, useMemo as useMemo53, useRef as useRef94, useState as useState68 } from "react";
|
|
53172
53171
|
import { SUPPORTED_EASES, SUPPORTED_PROPS } from "@hyperframes/core/gsap-constants";
|
|
53173
53172
|
|
|
53174
53173
|
// src/components/editor/gsapAnimationHelpers.ts
|
|
@@ -53709,21 +53708,21 @@ var AnimationCard = memo34(function AnimationCard2({
|
|
|
53709
53708
|
segment?.scrollIntoView({ block: "nearest", behavior: "smooth" });
|
|
53710
53709
|
pendingAutoScrollRef.current = false;
|
|
53711
53710
|
}, [expandedKfPct]);
|
|
53712
|
-
const usedProps =
|
|
53711
|
+
const usedProps = useMemo53(
|
|
53713
53712
|
() => new Set(Object.keys(animation.properties)),
|
|
53714
53713
|
[animation.properties]
|
|
53715
53714
|
);
|
|
53716
|
-
const availableProps =
|
|
53715
|
+
const availableProps = useMemo53(
|
|
53717
53716
|
() => SUPPORTED_PROPS.filter(
|
|
53718
53717
|
(p) => !usedProps.has(p) && (animation.method === "set" || !BOOLEAN_PROPS.has(p))
|
|
53719
53718
|
),
|
|
53720
53719
|
[usedProps, animation.method]
|
|
53721
53720
|
);
|
|
53722
|
-
const usedFromProps =
|
|
53721
|
+
const usedFromProps = useMemo53(
|
|
53723
53722
|
() => new Set(Object.keys(animation.fromProperties ?? {})),
|
|
53724
53723
|
[animation.fromProperties]
|
|
53725
53724
|
);
|
|
53726
|
-
const availableFromProps =
|
|
53725
|
+
const availableFromProps = useMemo53(
|
|
53727
53726
|
() => SUPPORTED_PROPS.filter((p) => !usedFromProps.has(p) && !BOOLEAN_PROPS.has(p)),
|
|
53728
53727
|
[usedFromProps]
|
|
53729
53728
|
);
|
|
@@ -53770,7 +53769,7 @@ var AnimationCard = memo34(function AnimationCard2({
|
|
|
53770
53769
|
const easeName = (animation.keyframes ? animation.keyframes.easeEach : void 0) ?? animation.ease ?? "none";
|
|
53771
53770
|
const easeLabel = easeName.startsWith("custom(") ? "Custom curve" : EASE_LABELS[easeName] ?? easeName;
|
|
53772
53771
|
const endTime = typeof animation.position === "number" ? animation.position + (animation.duration ?? 0) : animation.position;
|
|
53773
|
-
const summary =
|
|
53772
|
+
const summary = useMemo53(() => buildTweenSummary(animation), [animation]);
|
|
53774
53773
|
const setKeys = Object.keys(animation.properties);
|
|
53775
53774
|
if (animation.method === "set" && // `every` is vacuously true on an empty bag — require at least one key so a
|
|
53776
53775
|
// property-less set doesn't masquerade as a position row.
|
|
@@ -54918,7 +54917,7 @@ function PropertyPanel3dTransform({
|
|
|
54918
54917
|
}
|
|
54919
54918
|
|
|
54920
54919
|
// src/components/editor/PropertyPanelFlat.tsx
|
|
54921
|
-
import { useEffect as useEffect97, useMemo as
|
|
54920
|
+
import { useEffect as useEffect97, useMemo as useMemo60, useRef as useRef111, useState as useState93 } from "react";
|
|
54922
54921
|
import { useShallow as useShallow2 } from "zustand/react/shallow";
|
|
54923
54922
|
|
|
54924
54923
|
// src/components/editor/audioFxSummary.ts
|
|
@@ -57088,7 +57087,7 @@ function motionSectionLabel(args) {
|
|
|
57088
57087
|
}
|
|
57089
57088
|
|
|
57090
57089
|
// src/components/editor/propertyPanelAudioFxGroup.tsx
|
|
57091
|
-
import { useMemo as
|
|
57090
|
+
import { useMemo as useMemo56, useState as useState81 } from "react";
|
|
57092
57091
|
import {
|
|
57093
57092
|
HF_AUDIO_FX_ATTR as HF_AUDIO_FX_ATTR6,
|
|
57094
57093
|
HF_AUDIO_FX_DATA_KEY as HF_AUDIO_FX_DATA_KEY2,
|
|
@@ -57108,7 +57107,7 @@ import {
|
|
|
57108
57107
|
} from "@hyperframes/core/audio-automation";
|
|
57109
57108
|
|
|
57110
57109
|
// src/components/editor/propertyPanelFxSection.tsx
|
|
57111
|
-
import { useCallback as useCallback88, useEffect as useEffect84, useMemo as
|
|
57110
|
+
import { useCallback as useCallback88, useEffect as useEffect84, useMemo as useMemo55, useRef as useRef99, useState as useState79 } from "react";
|
|
57112
57111
|
|
|
57113
57112
|
// src/components/editor/audioFxRevealTarget.ts
|
|
57114
57113
|
import { parseAutomationTarget as parseAutomationTarget2 } from "@hyperframes/core/audio-automation";
|
|
@@ -58055,7 +58054,7 @@ function FxEqModule({
|
|
|
58055
58054
|
import { getAudioFxPreset as getAudioFxPreset3 } from "@hyperframes/core/audio-fx-presets";
|
|
58056
58055
|
|
|
58057
58056
|
// src/components/editor/propertyPanelFxNodeRow.tsx
|
|
58058
|
-
import { useMemo as
|
|
58057
|
+
import { useMemo as useMemo54, useState as useState78 } from "react";
|
|
58059
58058
|
import {
|
|
58060
58059
|
defaultAudioFxParams as defaultAudioFxParams3,
|
|
58061
58060
|
getAudioFxDef as getAudioFxDef3
|
|
@@ -58481,11 +58480,11 @@ function FxNodeRow({
|
|
|
58481
58480
|
trackKind
|
|
58482
58481
|
}) {
|
|
58483
58482
|
const registryDef = getAudioFxDef3(node.type);
|
|
58484
|
-
const def =
|
|
58483
|
+
const def = useMemo54(() => registryDef ? plainDef(registryDef) : null, [registryDef]);
|
|
58485
58484
|
const primary = registryDef ? primaryParamOf(registryDef) : null;
|
|
58486
58485
|
const profile = getAudioFxProfile2(node.type);
|
|
58487
|
-
const derived =
|
|
58488
|
-
const onlyPrimary =
|
|
58486
|
+
const derived = useMemo54(() => profileParam(node.type), [node.type]);
|
|
58487
|
+
const onlyPrimary = useMemo54(
|
|
58489
58488
|
() => def && primary ? { ...def, params: def.params.filter((p) => p.key === primary) } : def,
|
|
58490
58489
|
[def, primary]
|
|
58491
58490
|
);
|
|
@@ -59131,12 +59130,12 @@ function FxSection({
|
|
|
59131
59130
|
[chain.nodes, mutate, onRemoveNodeAutomation, trackKind]
|
|
59132
59131
|
);
|
|
59133
59132
|
const [carveOpen, setCarveOpen] = useState79(true);
|
|
59134
|
-
const carveNodes =
|
|
59135
|
-
const handBuilt =
|
|
59133
|
+
const carveNodes = useMemo55(() => chain.nodes.filter((n) => n.fromCarve), [chain.nodes]);
|
|
59134
|
+
const handBuilt = useMemo55(
|
|
59136
59135
|
() => chain.nodes.map((node, i) => ({ node, i })).filter(({ node }) => !node.fromCarve && !node.fromEq),
|
|
59137
59136
|
[chain.nodes]
|
|
59138
59137
|
);
|
|
59139
|
-
const runs =
|
|
59138
|
+
const runs = useMemo55(() => {
|
|
59140
59139
|
const out = [];
|
|
59141
59140
|
for (const item of handBuilt) {
|
|
59142
59141
|
const preset = item.node.fromPreset;
|
|
@@ -59147,8 +59146,8 @@ function FxSection({
|
|
|
59147
59146
|
return out;
|
|
59148
59147
|
}, [handBuilt]);
|
|
59149
59148
|
const [collapsedRuns, setCollapsedRuns] = useState79(/* @__PURE__ */ new Set());
|
|
59150
|
-
const eqIds =
|
|
59151
|
-
const positions =
|
|
59149
|
+
const eqIds = useMemo55(() => audioEqIds(chain), [chain]);
|
|
59150
|
+
const positions = useMemo55(() => {
|
|
59152
59151
|
const map = /* @__PURE__ */ new Map();
|
|
59153
59152
|
let at = (showCarve ? 1 : 0) + eqIds.length;
|
|
59154
59153
|
for (const { i } of handBuilt) map.set(i, ++at);
|
|
@@ -59941,7 +59940,7 @@ function AudioFxGroup({
|
|
|
59941
59940
|
const removeNodeAutomation = (nodeId) => removeNodesAutomation([nodeId]);
|
|
59942
59941
|
const [analysing, setAnalysing] = useState81(false);
|
|
59943
59942
|
const storeElements = usePlayerStore((s) => s.elements);
|
|
59944
|
-
const signalPath =
|
|
59943
|
+
const signalPath = useMemo56(() => {
|
|
59945
59944
|
const doc = element.element?.ownerDocument;
|
|
59946
59945
|
return audioFxSignalPath(
|
|
59947
59946
|
element.tagName?.toLowerCase(),
|
|
@@ -60609,7 +60608,7 @@ function createGsapLivePreview(iframeRef) {
|
|
|
60609
60608
|
}
|
|
60610
60609
|
|
|
60611
60610
|
// src/components/editor/propertyPanelFlatColorGradingSection.tsx
|
|
60612
|
-
import { useEffect as useEffect94, useMemo as
|
|
60611
|
+
import { useEffect as useEffect94, useMemo as useMemo58, useRef as useRef110, useState as useState89 } from "react";
|
|
60613
60612
|
import {
|
|
60614
60613
|
HF_COLOR_GRADING_GRADE_PRESETS,
|
|
60615
60614
|
normalizeHfColorGrading as normalizeHfColorGrading5,
|
|
@@ -60644,7 +60643,7 @@ function presetPreviewHandlers({
|
|
|
60644
60643
|
import { useState as useState85 } from "react";
|
|
60645
60644
|
|
|
60646
60645
|
// src/components/editor/propertyPanelColorCurveGraph.tsx
|
|
60647
|
-
import { useMemo as
|
|
60646
|
+
import { useMemo as useMemo57, useRef as useRef103 } from "react";
|
|
60648
60647
|
import {
|
|
60649
60648
|
compileHfColorCurve,
|
|
60650
60649
|
compileHfHueCurve,
|
|
@@ -60832,8 +60831,8 @@ function CurveGraph({
|
|
|
60832
60831
|
onCancel
|
|
60833
60832
|
}) {
|
|
60834
60833
|
const pointerRef = useRef103(null);
|
|
60835
|
-
const samples =
|
|
60836
|
-
const path =
|
|
60834
|
+
const samples = useMemo57(() => samplesFor(points, tab), [points, tab]);
|
|
60835
|
+
const path = useMemo57(() => curvePath(samples, tab), [samples, tab]);
|
|
60837
60836
|
const selectRelativePoint = (offset) => {
|
|
60838
60837
|
if (points.length === 0) return;
|
|
60839
60838
|
const current = selectedIndex ?? (offset > 0 ? -1 : 0);
|
|
@@ -62630,14 +62629,14 @@ function FlatColorGradingSection({
|
|
|
62630
62629
|
const lutInputRef = useRef110(null);
|
|
62631
62630
|
const [lutOpen, setLutOpen] = useState89(false);
|
|
62632
62631
|
const [detailSettingsOpen, setDetailSettingsOpen] = useState89(null);
|
|
62633
|
-
const lutAssets =
|
|
62632
|
+
const lutAssets = useMemo58(
|
|
62634
62633
|
() => assets.filter((asset) => LUT_EXT.test(asset)).sort((a, b) => a.localeCompare(b)),
|
|
62635
62634
|
[assets]
|
|
62636
62635
|
);
|
|
62637
62636
|
const lut = grading.lut;
|
|
62638
62637
|
const selectedLutName = lut?.src ? lut.src.split("/").pop() ?? lut.src : null;
|
|
62639
|
-
const resolvedGrading =
|
|
62640
|
-
const secondaryInputGrading =
|
|
62638
|
+
const resolvedGrading = useMemo58(() => resolveColorGrading(grading), [grading]);
|
|
62639
|
+
const secondaryInputGrading = useMemo58(
|
|
62641
62640
|
() => resolveColorGrading({
|
|
62642
62641
|
intensity: 1,
|
|
62643
62642
|
adjust: resolvedGrading.adjust,
|
|
@@ -62655,7 +62654,7 @@ function FlatColorGradingSection({
|
|
|
62655
62654
|
]
|
|
62656
62655
|
);
|
|
62657
62656
|
const actions = createColorGradingActions(grading, onCommitColorGrading);
|
|
62658
|
-
const scopesRefreshKey =
|
|
62657
|
+
const scopesRefreshKey = useMemo58(() => serializeHfColorGrading2(grading), [grading]);
|
|
62659
62658
|
useEffect94(() => {
|
|
62660
62659
|
if (presetPreviews.status === "idle") onRequestPresetPreviews();
|
|
62661
62660
|
}, [onRequestPresetPreviews, presetPreviews.status]);
|
|
@@ -63785,7 +63784,7 @@ function FlatEffectsSection({
|
|
|
63785
63784
|
import { useState as useState92 } from "react";
|
|
63786
63785
|
|
|
63787
63786
|
// src/hooks/useBlockCatalog.ts
|
|
63788
|
-
import { useState as useState91, useEffect as useEffect96, useMemo as
|
|
63787
|
+
import { useState as useState91, useEffect as useEffect96, useMemo as useMemo59 } from "react";
|
|
63789
63788
|
|
|
63790
63789
|
// src/utils/blockCategories.ts
|
|
63791
63790
|
import {
|
|
@@ -63852,7 +63851,7 @@ function useBlockCatalog() {
|
|
|
63852
63851
|
cancelled = true;
|
|
63853
63852
|
};
|
|
63854
63853
|
}, []);
|
|
63855
|
-
const filteredBlocks =
|
|
63854
|
+
const filteredBlocks = useMemo59(() => {
|
|
63856
63855
|
let result = blocks;
|
|
63857
63856
|
if (category) {
|
|
63858
63857
|
result = result.filter((b) => b.category === category);
|
|
@@ -64168,7 +64167,7 @@ function PropertyPanelFlat({
|
|
|
64168
64167
|
currentTime,
|
|
64169
64168
|
onSetAttributeQuiet ?? onSetAttributeLive
|
|
64170
64169
|
);
|
|
64171
|
-
const audioGroupLabel =
|
|
64170
|
+
const audioGroupLabel = useMemo60(() => {
|
|
64172
64171
|
const doc = element.element?.ownerDocument;
|
|
64173
64172
|
const id = element.id;
|
|
64174
64173
|
if (!doc || !id) return void 0;
|
|
@@ -64729,12 +64728,12 @@ var PropertyPanel = memo36(function PropertyPanel2(props) {
|
|
|
64729
64728
|
const cacheEntry = usePlayerStore((s) => s.keyframeCache.get(cacheElementKey));
|
|
64730
64729
|
const iframeRef = previewIframeRef ?? { current: null };
|
|
64731
64730
|
const gsapAnimIdForMemo = element ? gsapAnimations?.find((a) => a.keyframes)?.id ?? gsapAnimations?.[0]?.id ?? null : null;
|
|
64732
|
-
const gsapRuntimeValues =
|
|
64731
|
+
const gsapRuntimeValues = useMemo61(
|
|
64733
64732
|
() => element ? readGsapRuntimeValuesForPanel(gsapAnimIdForMemo, gsapAnimations, element, iframeRef) : null,
|
|
64734
64733
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- iframeRef is stable; currentTime drives re-reads during playback
|
|
64735
64734
|
[gsapAnimIdForMemo, gsapAnimations, element, currentTime]
|
|
64736
64735
|
);
|
|
64737
|
-
const gsapBorderRadius =
|
|
64736
|
+
const gsapBorderRadius = useMemo61(
|
|
64738
64737
|
() => element ? readGsapBorderRadiusForPanel(gsapRuntimeValues, gsapAnimations, element, iframeRef) : null,
|
|
64739
64738
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
64740
64739
|
[gsapRuntimeValues, gsapAnimations, element, currentTime]
|
|
@@ -65122,11 +65121,11 @@ var PropertyPanel = memo36(function PropertyPanel2(props) {
|
|
|
65122
65121
|
});
|
|
65123
65122
|
|
|
65124
65123
|
// src/components/editor/FileTree.tsx
|
|
65125
|
-
import { memo as memo38, useState as useState96, useCallback as useCallback90, useMemo as
|
|
65124
|
+
import { memo as memo38, useState as useState96, useCallback as useCallback90, useMemo as useMemo63, useRef as useRef114 } from "react";
|
|
65126
65125
|
import { Plus as Plus2, FolderSimplePlus as FolderSimplePlus2 } from "@phosphor-icons/react";
|
|
65127
65126
|
|
|
65128
65127
|
// src/components/editor/FileTreeNodes.tsx
|
|
65129
|
-
import { memo as memo37, useState as useState95, useCallback as useCallback89, useMemo as
|
|
65128
|
+
import { memo as memo37, useState as useState95, useCallback as useCallback89, useMemo as useMemo62, useRef as useRef113, useEffect as useEffect98 } from "react";
|
|
65130
65129
|
import {
|
|
65131
65130
|
PencilSimple,
|
|
65132
65131
|
Copy,
|
|
@@ -65609,7 +65608,7 @@ var TreeFolder = memo37(function TreeFolder2({
|
|
|
65609
65608
|
}) {
|
|
65610
65609
|
const [isOpen, setIsOpen] = useState95(defaultOpen);
|
|
65611
65610
|
const toggle = useCallback89(() => setIsOpen((v) => !v), []);
|
|
65612
|
-
const children =
|
|
65611
|
+
const children = useMemo62(() => sortChildren(node.children), [node.children]);
|
|
65613
65612
|
const Chevron = isOpen ? ChevronDown : ChevronRight;
|
|
65614
65613
|
const isDragOver = dragOverFolder === node.fullPath;
|
|
65615
65614
|
const isRenaming = inlineInput?.mode === "rename" && inlineInput.originalPath === node.fullPath;
|
|
@@ -65740,8 +65739,8 @@ var FileTree = memo38(function FileTree2({
|
|
|
65740
65739
|
onImportFiles,
|
|
65741
65740
|
lintFindingsByFile
|
|
65742
65741
|
}) {
|
|
65743
|
-
const tree =
|
|
65744
|
-
const children =
|
|
65742
|
+
const tree = useMemo63(() => buildTree(files), [files]);
|
|
65743
|
+
const children = useMemo63(() => sortChildren(tree.children), [tree]);
|
|
65745
65744
|
const [contextMenu, setContextMenu] = useState96(null);
|
|
65746
65745
|
const [inlineInput, setInlineInput] = useState96(null);
|
|
65747
65746
|
const [deleteTarget, setDeleteTarget] = useState96(null);
|
|
@@ -66008,7 +66007,7 @@ var FileTree = memo38(function FileTree2({
|
|
|
66008
66007
|
});
|
|
66009
66008
|
|
|
66010
66009
|
// src/App.tsx
|
|
66011
|
-
import { useState as useState149, useCallback as useCallback185, useRef as useRef181, useMemo as
|
|
66010
|
+
import { useState as useState149, useCallback as useCallback185, useRef as useRef181, useMemo as useMemo81, useLayoutEffect as useLayoutEffect13 } from "react";
|
|
66012
66011
|
|
|
66013
66012
|
// src/hooks/useRightPanelIntents.ts
|
|
66014
66013
|
import { useCallback as useCallback91, useEffect as useEffect99, useRef as useRef115 } from "react";
|
|
@@ -66059,7 +66058,7 @@ function useRightPanelIntent() {
|
|
|
66059
66058
|
}
|
|
66060
66059
|
|
|
66061
66060
|
// src/components/renders/useRenderQueue.ts
|
|
66062
|
-
import { useState as useState98, useEffect as useEffect101, useCallback as useCallback93, useRef as useRef117, useMemo as
|
|
66061
|
+
import { useState as useState98, useEffect as useEffect101, useCallback as useCallback93, useRef as useRef117, useMemo as useMemo64 } from "react";
|
|
66063
66062
|
|
|
66064
66063
|
// src/components/renders/serverError.ts
|
|
66065
66064
|
async function readServerError(res) {
|
|
@@ -66582,7 +66581,7 @@ function useRenderQueue(projectId, activeCompPathRef) {
|
|
|
66582
66581
|
};
|
|
66583
66582
|
}, [projectId]);
|
|
66584
66583
|
const isRendering = jobs.some((j) => j.status === "rendering");
|
|
66585
|
-
return
|
|
66584
|
+
return useMemo64(
|
|
66586
66585
|
() => ({
|
|
66587
66586
|
jobs,
|
|
66588
66587
|
isRendering,
|
|
@@ -67868,7 +67867,7 @@ function useCaptionSync(projectId) {
|
|
|
67868
67867
|
}
|
|
67869
67868
|
|
|
67870
67869
|
// src/hooks/usePersistentEditHistory.ts
|
|
67871
|
-
import { useCallback as useCallback97, useEffect as useEffect105, useMemo as
|
|
67870
|
+
import { useCallback as useCallback97, useEffect as useEffect105, useMemo as useMemo65, useRef as useRef124, useState as useState104 } from "react";
|
|
67872
67871
|
var EMPTY3 = { entries: [], back: null, forward: null };
|
|
67873
67872
|
var DEFAULT_COALESCE_MS = 300;
|
|
67874
67873
|
function historyUrl(projectId, path = "") {
|
|
@@ -67992,7 +67991,7 @@ function usePersistentEditHistory({ projectId }) {
|
|
|
67992
67991
|
);
|
|
67993
67992
|
const undo = useCallback97((callbacks) => step("undo", callbacks), [step]);
|
|
67994
67993
|
const redo = useCallback97((callbacks) => step("redo", callbacks), [step]);
|
|
67995
|
-
const state =
|
|
67994
|
+
const state = useMemo65(() => {
|
|
67996
67995
|
const backAt = Math.max(view.back?.endedAt ?? 0, heldClaimRef.current?.at ?? 0);
|
|
67997
67996
|
const redoAt = redoneAt(view);
|
|
67998
67997
|
return {
|
|
@@ -68072,7 +68071,7 @@ function usePanelLayout(initialState2) {
|
|
|
68072
68071
|
import { useState as useState106, useCallback as useCallback102, useRef as useRef128 } from "react";
|
|
68073
68072
|
|
|
68074
68073
|
// src/hooks/useFileTree.ts
|
|
68075
|
-
import { useState as useState105, useCallback as useCallback99, useEffect as useEffect107, useMemo as
|
|
68074
|
+
import { useState as useState105, useCallback as useCallback99, useEffect as useEffect107, useMemo as useMemo66, useRef as useRef126 } from "react";
|
|
68076
68075
|
var EMPTY_FILE_LIST = [];
|
|
68077
68076
|
function useFileTree({ projectId, projectIdRef }) {
|
|
68078
68077
|
const [fetched, setFetched] = useState105(null);
|
|
@@ -68136,11 +68135,11 @@ function useFileTree({ projectId, projectIdRef }) {
|
|
|
68136
68135
|
);
|
|
68137
68136
|
}
|
|
68138
68137
|
}, [projectIdRef]);
|
|
68139
|
-
const assets =
|
|
68138
|
+
const assets = useMemo66(
|
|
68140
68139
|
() => fileTree.filter((f) => !f.endsWith(".html") && !f.endsWith(".md") && !f.endsWith(".json")),
|
|
68141
68140
|
[fileTree]
|
|
68142
68141
|
);
|
|
68143
|
-
const fontAssets =
|
|
68142
|
+
const fontAssets = useMemo66(
|
|
68144
68143
|
() => (projectId ? assets : []).filter((asset) => FONT_EXT.test(asset)).map((asset) => ({
|
|
68145
68144
|
family: fontFamilyFromAssetPath(asset),
|
|
68146
68145
|
path: asset,
|
|
@@ -68284,9 +68283,9 @@ function useEditorSave({
|
|
|
68284
68283
|
}
|
|
68285
68284
|
|
|
68286
68285
|
// src/hooks/useProjectFileWriter.ts
|
|
68287
|
-
import { useCallback as useCallback101, useMemo as
|
|
68286
|
+
import { useCallback as useCallback101, useMemo as useMemo67 } from "react";
|
|
68288
68287
|
function useProjectFileWriter({ projectId }) {
|
|
68289
|
-
const fileVersionScope =
|
|
68288
|
+
const fileVersionScope = useMemo67(
|
|
68290
68289
|
() => ({ projectId, versions: /* @__PURE__ */ new Map() }),
|
|
68291
68290
|
[projectId]
|
|
68292
68291
|
);
|
|
@@ -68391,7 +68390,7 @@ function useProjectFileWriter({ projectId }) {
|
|
|
68391
68390
|
},
|
|
68392
68391
|
[fileVersions, projectId]
|
|
68393
68392
|
);
|
|
68394
|
-
return
|
|
68393
|
+
return useMemo67(
|
|
68395
68394
|
() => ({
|
|
68396
68395
|
fileVersions,
|
|
68397
68396
|
readProjectFile,
|
|
@@ -74664,7 +74663,7 @@ function useGroupCommits(params) {
|
|
|
74664
74663
|
}
|
|
74665
74664
|
|
|
74666
74665
|
// src/hooks/useGsapScriptCommits.ts
|
|
74667
|
-
import { useCallback as useCallback132, useMemo as
|
|
74666
|
+
import { useCallback as useCallback132, useMemo as useMemo68, useRef as useRef144 } from "react";
|
|
74668
74667
|
import { findUnsafeMutationValues } from "@hyperframes/core/studio-api/finite-mutation";
|
|
74669
74668
|
|
|
74670
74669
|
// src/hooks/gsapRuntimePatch.ts
|
|
@@ -75987,7 +75986,7 @@ function useGsapScriptCommits({ projectIdRef, activeCompPath, previewIframeRef,
|
|
|
75987
75986
|
const { instantPatch: _instantPatch, ...batchOptions } = options;
|
|
75988
75987
|
await finalizeSuccessfulMutation(pid, compositionPath, last.selection, last.mutation, targetPath, result, instantPatches.length > 0 ? { ...batchOptions, instantPatches } : batchOptions);
|
|
75989
75988
|
}, [showToast, finalizeSuccessfulMutation]);
|
|
75990
|
-
const commitMutation =
|
|
75989
|
+
const commitMutation = useMemo68(() => {
|
|
75991
75990
|
const serializeFile = (file, task) => {
|
|
75992
75991
|
if (writeProjectFile) {
|
|
75993
75992
|
return serializeStudioFileMutation(writeProjectFile, file, task);
|
|
@@ -76052,7 +76051,7 @@ function useGsapScriptCommits({ projectIdRef, activeCompPath, previewIframeRef,
|
|
|
76052
76051
|
},
|
|
76053
76052
|
[activeProjectId]
|
|
76054
76053
|
);
|
|
76055
|
-
const sdkDeps =
|
|
76054
|
+
const sdkDeps = useMemo68(
|
|
76056
76055
|
() => writeProjectFile ? {
|
|
76057
76056
|
editHistory: { recordEdit: editHistory.recordEdit },
|
|
76058
76057
|
writeProjectFile,
|
|
@@ -76199,8 +76198,6 @@ function useDomEditPreviewSync({
|
|
|
76199
76198
|
|
|
76200
76199
|
// src/hooks/useGsapAnimationFetchFallback.ts
|
|
76201
76200
|
import { useCallback as useCallback133 } from "react";
|
|
76202
|
-
var COLD_PARSE_RETRIES = 5;
|
|
76203
|
-
var COLD_PARSE_DELAY_MS = 120;
|
|
76204
76201
|
var FETCH_ERROR_RETRIES = 1;
|
|
76205
76202
|
var FETCH_ERROR_DELAY_MS = 120;
|
|
76206
76203
|
var delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
@@ -76209,32 +76206,22 @@ function gsapSourceFileForSelection(selection) {
|
|
|
76209
76206
|
}
|
|
76210
76207
|
function selectElementAnimationsOrRetry(parsed, target, element) {
|
|
76211
76208
|
if (!parsed) return { kind: "fetch-error" };
|
|
76212
|
-
if (parsed.animations.length === 0) return { kind: "cold" };
|
|
76213
76209
|
return {
|
|
76214
76210
|
kind: "resolved",
|
|
76215
76211
|
animations: getAnimationsForElement(parsed.animations, target, element)
|
|
76216
76212
|
};
|
|
76217
76213
|
}
|
|
76218
76214
|
async function fetchElementAnimationsWithRetry(projectId, gsapSourceFile, target, element, failOnFetchError, fresh) {
|
|
76219
|
-
let
|
|
76220
|
-
let errorAttempts = 0;
|
|
76221
|
-
for (; ; ) {
|
|
76215
|
+
for (let errorAttempts = 0; ; errorAttempts++) {
|
|
76222
76216
|
const parsed = await fetchParsedAnimations(projectId, gsapSourceFile, { fresh });
|
|
76223
76217
|
fresh = false;
|
|
76224
76218
|
const outcome = selectElementAnimationsOrRetry(parsed, target, element);
|
|
76225
76219
|
if (outcome.kind === "resolved") return outcome.animations;
|
|
76226
|
-
if (
|
|
76227
|
-
if (
|
|
76228
|
-
|
|
76229
|
-
return [];
|
|
76230
|
-
}
|
|
76231
|
-
errorAttempts++;
|
|
76232
|
-
await delay(FETCH_ERROR_DELAY_MS);
|
|
76233
|
-
continue;
|
|
76220
|
+
if (errorAttempts >= FETCH_ERROR_RETRIES) {
|
|
76221
|
+
if (failOnFetchError) throw new Error("GSAP animation ownership could not be verified");
|
|
76222
|
+
return [];
|
|
76234
76223
|
}
|
|
76235
|
-
|
|
76236
|
-
coldAttempts++;
|
|
76237
|
-
await delay(COLD_PARSE_DELAY_MS);
|
|
76224
|
+
await delay(FETCH_ERROR_DELAY_MS);
|
|
76238
76225
|
}
|
|
76239
76226
|
}
|
|
76240
76227
|
function useGsapAnimationFetchFallback(projectId) {
|
|
@@ -78005,15 +77992,10 @@ function useKeyframeEaseCommits({
|
|
|
78005
77992
|
}
|
|
78006
77993
|
|
|
78007
77994
|
// src/hooks/useCommitPreflightCapabilities.ts
|
|
78008
|
-
import { useEffect as useEffect116, useMemo as
|
|
77995
|
+
import { useEffect as useEffect116, useMemo as useMemo69, useRef as useRef149, useState as useState112 } from "react";
|
|
78009
77996
|
function runCommitPreflights(selection, fileAnimations, iframe, group) {
|
|
78010
77997
|
const target = { id: selection.id ?? null, selector: selection.selector ?? null };
|
|
78011
|
-
const
|
|
78012
|
-
{ animations: fileAnimations },
|
|
78013
|
-
target,
|
|
78014
|
-
selection.element
|
|
78015
|
-
);
|
|
78016
|
-
const animations = matched.kind === "resolved" ? matched.animations : [];
|
|
77998
|
+
const animations = getAnimationsForElement(fileAnimations, target, selection.element);
|
|
78017
77999
|
return {
|
|
78018
78000
|
offset: dragEditOutcome(selection, animations, iframe, [], group),
|
|
78019
78001
|
size: preflightGsapResizeIntercept(selection, animations, iframe),
|
|
@@ -78079,7 +78061,7 @@ function useCommitPreflightCapabilities({
|
|
|
78079
78061
|
});
|
|
78080
78062
|
}
|
|
78081
78063
|
}, [enabled, projectId, selection, groupSelections, version]);
|
|
78082
|
-
return
|
|
78064
|
+
return useMemo69(() => {
|
|
78083
78065
|
void parseTick;
|
|
78084
78066
|
if (!enabled || !projectId) return { selection, groupSelections };
|
|
78085
78067
|
const group = groupSelections.length > 1;
|
|
@@ -79411,7 +79393,7 @@ function useStudioExternalFileChanges({
|
|
|
79411
79393
|
}
|
|
79412
79394
|
|
|
79413
79395
|
// src/hooks/useBlockHandlers.ts
|
|
79414
|
-
import { useCallback as useCallback144, useMemo as
|
|
79396
|
+
import { useCallback as useCallback144, useMemo as useMemo70, useRef as useRef152, useState as useState115 } from "react";
|
|
79415
79397
|
|
|
79416
79398
|
// src/utils/blockInstaller.ts
|
|
79417
79399
|
function getMaxZIndexFromIframe(iframe) {
|
|
@@ -79605,7 +79587,7 @@ function useBlockHandlers({
|
|
|
79605
79587
|
setRightPanelTab
|
|
79606
79588
|
}) {
|
|
79607
79589
|
const [activeBlockParams, setActiveBlockParams] = useState115(null);
|
|
79608
|
-
const blockCtx =
|
|
79590
|
+
const blockCtx = useMemo70(
|
|
79609
79591
|
() => ({
|
|
79610
79592
|
activeCompPath: blockCtxDeps.activeCompPath,
|
|
79611
79593
|
timelineElements: blockCtxDeps.timelineElements,
|
|
@@ -79935,7 +79917,7 @@ function dispatchPlainKey(event, key2, cb) {
|
|
|
79935
79917
|
}
|
|
79936
79918
|
|
|
79937
79919
|
// src/hooks/useEditHistoryActions.ts
|
|
79938
|
-
import { useCallback as useCallback145, useMemo as
|
|
79920
|
+
import { useCallback as useCallback145, useMemo as useMemo71 } from "react";
|
|
79939
79921
|
function useEditHistoryActions({
|
|
79940
79922
|
editHistory,
|
|
79941
79923
|
readOptionalProjectFile,
|
|
@@ -79999,7 +79981,7 @@ function useEditHistoryActions({
|
|
|
79999
79981
|
);
|
|
80000
79982
|
const undo = useCallback145(() => apply("undo"), [apply]);
|
|
80001
79983
|
const redo = useCallback145(() => apply("redo"), [apply]);
|
|
80002
|
-
return
|
|
79984
|
+
return useMemo71(() => ({ undo, redo }), [undo, redo]);
|
|
80003
79985
|
}
|
|
80004
79986
|
|
|
80005
79987
|
// src/hooks/useAppHotkeys.ts
|
|
@@ -81192,7 +81174,7 @@ function useFrameCapture({
|
|
|
81192
81174
|
}
|
|
81193
81175
|
|
|
81194
81176
|
// src/hooks/useLintModal.ts
|
|
81195
|
-
import { useState as useState118, useCallback as useCallback150, useEffect as useEffect124, useRef as useRef158, useMemo as
|
|
81177
|
+
import { useState as useState118, useCallback as useCallback150, useEffect as useEffect124, useRef as useRef158, useMemo as useMemo72 } from "react";
|
|
81196
81178
|
function parseFinding(f) {
|
|
81197
81179
|
return {
|
|
81198
81180
|
severity: f.severity === "error" ? "error" : "warning",
|
|
@@ -81265,8 +81247,8 @@ function useLintModal(projectId, refreshKey) {
|
|
|
81265
81247
|
},
|
|
81266
81248
|
[backgroundFindings]
|
|
81267
81249
|
);
|
|
81268
|
-
const findingsByElement =
|
|
81269
|
-
const findingsByFile =
|
|
81250
|
+
const findingsByElement = useMemo72(() => groupFindings((f) => f.elementId), [groupFindings]);
|
|
81251
|
+
const findingsByFile = useMemo72(() => groupFindings((f) => f.file), [groupFindings]);
|
|
81270
81252
|
const badgeFindings = lintModal ?? backgroundFindings;
|
|
81271
81253
|
const lintFindingCount = badgeFindings.length;
|
|
81272
81254
|
const hasLintError = badgeFindings.some((f) => f.severity === "error");
|
|
@@ -81731,16 +81713,16 @@ function useStudioUrlState({
|
|
|
81731
81713
|
}
|
|
81732
81714
|
|
|
81733
81715
|
// src/hooks/useEffectiveTimelineDuration.ts
|
|
81734
|
-
import { useMemo as
|
|
81716
|
+
import { useMemo as useMemo73 } from "react";
|
|
81735
81717
|
function useEffectiveTimelineDuration(timelineDuration2, timelineElements) {
|
|
81736
|
-
return
|
|
81718
|
+
return useMemo73(
|
|
81737
81719
|
() => getEffectiveTimelineDuration(timelineDuration2, timelineElements),
|
|
81738
81720
|
[timelineDuration2, timelineElements]
|
|
81739
81721
|
);
|
|
81740
81722
|
}
|
|
81741
81723
|
|
|
81742
81724
|
// src/hooks/useStudioContextValue.ts
|
|
81743
|
-
import { useCallback as useCallback153, useMemo as
|
|
81725
|
+
import { useCallback as useCallback153, useMemo as useMemo74 } from "react";
|
|
81744
81726
|
function buildStudioContextValue(input) {
|
|
81745
81727
|
return {
|
|
81746
81728
|
projectId: input.projectId,
|
|
@@ -81768,7 +81750,7 @@ function buildStudioContextValue(input) {
|
|
|
81768
81750
|
};
|
|
81769
81751
|
}
|
|
81770
81752
|
function useInspectorState(rightPanel, isPlaying, domEditSelection, isGestureRecording) {
|
|
81771
|
-
return
|
|
81753
|
+
return useMemo74(() => {
|
|
81772
81754
|
const inspectorPanelActive = rightPanel === "layers" || rightPanel === "design";
|
|
81773
81755
|
return {
|
|
81774
81756
|
inspectorPanelActive,
|
|
@@ -81811,7 +81793,7 @@ function useGlobalFileDrop(handleTimelineFileDrop) {
|
|
|
81811
81793
|
}
|
|
81812
81794
|
|
|
81813
81795
|
// src/contexts/PanelLayoutContext.tsx
|
|
81814
|
-
import { useContext as useContext13, useMemo as
|
|
81796
|
+
import { useContext as useContext13, useMemo as useMemo75 } from "react";
|
|
81815
81797
|
import { jsx as jsx188 } from "react/jsx-runtime";
|
|
81816
81798
|
var PanelLayoutContext = createStableContext("PanelLayoutContext", null);
|
|
81817
81799
|
function usePanelLayoutContext() {
|
|
@@ -81823,7 +81805,7 @@ function PanelLayoutProvider({
|
|
|
81823
81805
|
value: { rightCollapsed, setRightCollapsed, rightPanelTab, setRightPanelTab },
|
|
81824
81806
|
children
|
|
81825
81807
|
}) {
|
|
81826
|
-
const stable =
|
|
81808
|
+
const stable = useMemo75(
|
|
81827
81809
|
() => ({ rightCollapsed, setRightCollapsed, rightPanelTab, setRightPanelTab }),
|
|
81828
81810
|
[rightCollapsed, setRightCollapsed, rightPanelTab, setRightPanelTab]
|
|
81829
81811
|
);
|
|
@@ -82766,7 +82748,7 @@ function useGestureCommit({
|
|
|
82766
82748
|
}
|
|
82767
82749
|
|
|
82768
82750
|
// src/components/editor/GestureTrailOverlay.tsx
|
|
82769
|
-
import { memo as memo40, useMemo as
|
|
82751
|
+
import { memo as memo40, useMemo as useMemo76 } from "react";
|
|
82770
82752
|
import { Fragment as Fragment53, jsx as jsx191, jsxs as jsxs150 } from "react/jsx-runtime";
|
|
82771
82753
|
var GestureTrailOverlay = memo40(function GestureTrailOverlay2({
|
|
82772
82754
|
samples,
|
|
@@ -82778,7 +82760,7 @@ var GestureTrailOverlay = memo40(function GestureTrailOverlay2({
|
|
|
82778
82760
|
mode,
|
|
82779
82761
|
accentColor = "#3CE6AC"
|
|
82780
82762
|
}) {
|
|
82781
|
-
const trailPoints =
|
|
82763
|
+
const trailPoints = useMemo76(() => {
|
|
82782
82764
|
if (!canvasRect) return "";
|
|
82783
82765
|
if (trail2 && trail2.length > 1) {
|
|
82784
82766
|
return trail2.map((p) => `${p.x - canvasRect.left},${p.y - canvasRect.top}`).join(" ");
|
|
@@ -82786,7 +82768,7 @@ var GestureTrailOverlay = memo40(function GestureTrailOverlay2({
|
|
|
82786
82768
|
if (samples.length === 0) return "";
|
|
82787
82769
|
return samples.filter((s) => s.properties.x != null && s.properties.y != null).map((s) => `${s.properties.x},${s.properties.y}`).join(" ");
|
|
82788
82770
|
}, [samples, trail2, sampleCount, canvasRect?.left, canvasRect?.top]);
|
|
82789
|
-
const simplifiedPath =
|
|
82771
|
+
const simplifiedPath = useMemo76(() => {
|
|
82790
82772
|
if (!simplifiedPoints || simplifiedPoints.size === 0) return "";
|
|
82791
82773
|
const pts = [];
|
|
82792
82774
|
for (const [pct, props] of simplifiedPoints) {
|
|
@@ -82798,7 +82780,7 @@ var GestureTrailOverlay = memo40(function GestureTrailOverlay2({
|
|
|
82798
82780
|
if (pts.length === 0) return "";
|
|
82799
82781
|
return pts.map((p) => `${p.x},${p.y}`).join(" ");
|
|
82800
82782
|
}, [simplifiedPoints]);
|
|
82801
|
-
const diamondPositions =
|
|
82783
|
+
const diamondPositions = useMemo76(() => {
|
|
82802
82784
|
if (!simplifiedPoints || simplifiedPoints.size === 0) return [];
|
|
82803
82785
|
const pts = [];
|
|
82804
82786
|
for (const [pct, props] of simplifiedPoints) {
|
|
@@ -82997,7 +82979,7 @@ function MediaPreview({ projectId, filePath }) {
|
|
|
82997
82979
|
}
|
|
82998
82980
|
|
|
82999
82981
|
// src/components/sidebar/AssetsTab.tsx
|
|
83000
|
-
import { memo as memo41, useState as useState129, useCallback as useCallback159, useRef as useRef166, useMemo as
|
|
82982
|
+
import { memo as memo41, useState as useState129, useCallback as useCallback159, useRef as useRef166, useMemo as useMemo78, useEffect as useEffect133 } from "react";
|
|
83001
82983
|
|
|
83002
82984
|
// src/components/ui/SearchInput.tsx
|
|
83003
82985
|
import { jsx as jsx193, jsxs as jsxs152 } from "react/jsx-runtime";
|
|
@@ -83609,7 +83591,7 @@ function AudioRow({
|
|
|
83609
83591
|
}
|
|
83610
83592
|
|
|
83611
83593
|
// src/components/sidebar/GlobalAssetsView.tsx
|
|
83612
|
-
import { useEffect as useEffect130, useMemo as
|
|
83594
|
+
import { useEffect as useEffect130, useMemo as useMemo77, useState as useState126 } from "react";
|
|
83613
83595
|
import { jsx as jsx196, jsxs as jsxs155 } from "react/jsx-runtime";
|
|
83614
83596
|
function globalAssetRows(records, query = "") {
|
|
83615
83597
|
const q = query.trim().toLowerCase();
|
|
@@ -83636,7 +83618,7 @@ function GlobalAssetsView({ searchQuery }) {
|
|
|
83636
83618
|
cancelled = true;
|
|
83637
83619
|
};
|
|
83638
83620
|
}, []);
|
|
83639
|
-
const rows =
|
|
83621
|
+
const rows = useMemo77(() => globalAssetRows(records ?? [], searchQuery), [records, searchQuery]);
|
|
83640
83622
|
if (records === null) {
|
|
83641
83623
|
return /* @__PURE__ */ jsx196("p", { className: "px-4 py-3 text-[11px] text-panel-text-5", children: "Loading global assets\u2026" });
|
|
83642
83624
|
}
|
|
@@ -84198,12 +84180,12 @@ var AssetsTab = memo41(function AssetsTab2({
|
|
|
84198
84180
|
setTimeout(() => setCopyFeedback(null), copied ? 1500 : 3e3);
|
|
84199
84181
|
}, []);
|
|
84200
84182
|
const elements = usePlayerStore((s) => s.elements);
|
|
84201
|
-
const usedPaths =
|
|
84202
|
-
const allMediaAssets =
|
|
84183
|
+
const usedPaths = useMemo78(() => deriveUsedPaths(elements), [elements]);
|
|
84184
|
+
const allMediaAssets = useMemo78(
|
|
84203
84185
|
() => assets.filter((a) => MEDIA_EXT.test(a) || FONT_EXT.test(a)),
|
|
84204
84186
|
[assets]
|
|
84205
84187
|
);
|
|
84206
|
-
const mediaAssets =
|
|
84188
|
+
const mediaAssets = useMemo78(() => {
|
|
84207
84189
|
const all = filterByUsage(allMediaAssets, usedPaths, usageFilter);
|
|
84208
84190
|
if (!searchQuery) return all;
|
|
84209
84191
|
const q = searchQuery.toLowerCase();
|
|
@@ -84213,7 +84195,7 @@ var AssetsTab = memo41(function AssetsTab2({
|
|
|
84213
84195
|
return rec?.description?.toLowerCase().includes(q);
|
|
84214
84196
|
});
|
|
84215
84197
|
}, [allMediaAssets, searchQuery, manifest, usageFilter, usedPaths]);
|
|
84216
|
-
const categorized =
|
|
84198
|
+
const categorized = useMemo78(() => {
|
|
84217
84199
|
const groups = { audio: [], images: [], video: [], fonts: [] };
|
|
84218
84200
|
for (const a of mediaAssets) {
|
|
84219
84201
|
const cat = getCategory(a);
|
|
@@ -84228,12 +84210,12 @@ var AssetsTab = memo41(function AssetsTab2({
|
|
|
84228
84210
|
}
|
|
84229
84211
|
return groups;
|
|
84230
84212
|
}, [mediaAssets, usedPaths]);
|
|
84231
|
-
const counts =
|
|
84213
|
+
const counts = useMemo78(() => {
|
|
84232
84214
|
const c = { all: mediaAssets.length };
|
|
84233
84215
|
for (const cat of FILTER_ORDER) c[cat] = categorized[cat].length;
|
|
84234
84216
|
return c;
|
|
84235
84217
|
}, [mediaAssets, categorized]);
|
|
84236
|
-
const usageCounts =
|
|
84218
|
+
const usageCounts = useMemo78(
|
|
84237
84219
|
() => countUsage(
|
|
84238
84220
|
assets.filter((a) => MEDIA_EXT.test(a) || FONT_EXT.test(a)),
|
|
84239
84221
|
usedPaths
|
|
@@ -88614,7 +88596,7 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
|
|
|
88614
88596
|
}
|
|
88615
88597
|
|
|
88616
88598
|
// src/components/panels/VariablesPanel.tsx
|
|
88617
|
-
import { memo as memo52, useCallback as useCallback175, useEffect as useEffect144, useMemo as
|
|
88599
|
+
import { memo as memo52, useCallback as useCallback175, useEffect as useEffect144, useMemo as useMemo79, useState as useState146 } from "react";
|
|
88618
88600
|
|
|
88619
88601
|
// src/hooks/useVariablesPersist.ts
|
|
88620
88602
|
import { useCallback as useCallback172 } from "react";
|
|
@@ -89310,22 +89292,22 @@ var VariablesPanel = memo52(function VariablesPanel2({
|
|
|
89310
89292
|
reloadPreview,
|
|
89311
89293
|
publishSdkSession
|
|
89312
89294
|
});
|
|
89313
|
-
const declarations =
|
|
89295
|
+
const declarations = useMemo79(
|
|
89314
89296
|
() => sdkSession?.getVariableDeclarations() ?? [],
|
|
89315
89297
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
89316
89298
|
[sdkSession, refreshKey, revision]
|
|
89317
89299
|
);
|
|
89318
|
-
const usage =
|
|
89300
|
+
const usage = useMemo79(
|
|
89319
89301
|
() => sdkSession?.getVariableUsage() ?? null,
|
|
89320
89302
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
89321
89303
|
[sdkSession, refreshKey, revision]
|
|
89322
89304
|
);
|
|
89323
|
-
const issues =
|
|
89305
|
+
const issues = useMemo79(
|
|
89324
89306
|
() => previewValues && sdkSession ? sdkSession.validateVariableValues(previewValues) : [],
|
|
89325
89307
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
89326
89308
|
[sdkSession, previewValues, refreshKey, revision]
|
|
89327
89309
|
);
|
|
89328
|
-
const effectiveValues =
|
|
89310
|
+
const effectiveValues = useMemo79(
|
|
89329
89311
|
() => sdkSession?.getVariableValues(previewValues ?? void 0) ?? {},
|
|
89330
89312
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
89331
89313
|
[sdkSession, previewValues, refreshKey, revision]
|
|
@@ -89640,15 +89622,15 @@ function useSlideshowPersist({
|
|
|
89640
89622
|
}
|
|
89641
89623
|
|
|
89642
89624
|
// src/hooks/useSlideshowTabState.ts
|
|
89643
|
-
import { useMemo as
|
|
89625
|
+
import { useMemo as useMemo80 } from "react";
|
|
89644
89626
|
import { SLIDESHOW_ISLAND_TYPE as SLIDESHOW_ISLAND_TYPE2, slideshowIslandRegex as slideshowIslandRegex2 } from "@hyperframes/core/slideshow";
|
|
89645
89627
|
function useSlideshowTabState(params) {
|
|
89646
89628
|
const { editingFileContent, previewIframeRef, refreshKey, slideshowVisible } = params;
|
|
89647
|
-
const isSlideshowComposition =
|
|
89629
|
+
const isSlideshowComposition = useMemo80(() => {
|
|
89648
89630
|
if (!editingFileContent || !editingFileContent.includes(SLIDESHOW_ISLAND_TYPE2)) return false;
|
|
89649
89631
|
return slideshowIslandRegex2("i").test(editingFileContent);
|
|
89650
89632
|
}, [editingFileContent]);
|
|
89651
|
-
const slideshowScenes =
|
|
89633
|
+
const slideshowScenes = useMemo80(() => {
|
|
89652
89634
|
try {
|
|
89653
89635
|
const win = previewIframeRef.current?.contentWindow;
|
|
89654
89636
|
return (win?.__clipManifest?.scenes ?? []).map((s) => ({
|
|
@@ -91501,7 +91483,7 @@ function StudioApp({ readOnlyPreview = false, readOnlyPreviewReason } = {}) {
|
|
|
91501
91483
|
recordEdit: editHistory.recordEdit,
|
|
91502
91484
|
setRefreshKey
|
|
91503
91485
|
});
|
|
91504
|
-
const masterCompPath =
|
|
91486
|
+
const masterCompPath = useMemo81(
|
|
91505
91487
|
() => resolveMasterCompositionPath(fileManager.compositions),
|
|
91506
91488
|
[fileManager.compositions]
|
|
91507
91489
|
);
|
|
@@ -91605,7 +91587,7 @@ function StudioApp({ readOnlyPreview = false, readOnlyPreviewReason } = {}) {
|
|
|
91605
91587
|
});
|
|
91606
91588
|
const dismissBlockParams = useCallback185(() => setActiveBlockParams(null), [setActiveBlockParams]);
|
|
91607
91589
|
const setRightPanelTab = useDismissingTabSetter(panelLayout.setRightPanelTab, dismissBlockParams);
|
|
91608
|
-
const layout =
|
|
91590
|
+
const layout = useMemo81(
|
|
91609
91591
|
() => ({ ...panelLayout, setRightPanelTab }),
|
|
91610
91592
|
[panelLayout, setRightPanelTab]
|
|
91611
91593
|
);
|
|
@@ -91823,7 +91805,7 @@ function StudioApp({ readOnlyPreview = false, readOnlyPreviewReason } = {}) {
|
|
|
91823
91805
|
handlePreviewIframeRef,
|
|
91824
91806
|
refreshPreviewDocumentVersion
|
|
91825
91807
|
});
|
|
91826
|
-
const timelineToolbar =
|
|
91808
|
+
const timelineToolbar = useMemo81(
|
|
91827
91809
|
() => /* @__PURE__ */ jsx229(
|
|
91828
91810
|
TimelineToolbar,
|
|
91829
91811
|
{
|
|
@@ -92340,7 +92322,7 @@ function findElementBlock(html2, elementId2) {
|
|
|
92340
92322
|
}
|
|
92341
92323
|
|
|
92342
92324
|
// src/hooks/useDomStyleCommit.ts
|
|
92343
|
-
import { useCallback as useCallback187, useMemo as
|
|
92325
|
+
import { useCallback as useCallback187, useMemo as useMemo82, useRef as useRef183, useState as useState151 } from "react";
|
|
92344
92326
|
var noop = () => {
|
|
92345
92327
|
};
|
|
92346
92328
|
function useDomStyleCommit({
|
|
@@ -92356,7 +92338,7 @@ function useDomStyleCommit({
|
|
|
92356
92338
|
const [queue2] = useState151(createDomEditSaveQueue);
|
|
92357
92339
|
useMountEffect(() => () => queue2.destroy());
|
|
92358
92340
|
const versions = useRef183(/* @__PURE__ */ new Map()).current;
|
|
92359
|
-
const editHistory =
|
|
92341
|
+
const editHistory = useMemo82(() => ({ recordEdit }), [recordEdit]);
|
|
92360
92342
|
const persistDomEditOperations = useDomEditPersist({
|
|
92361
92343
|
activeCompPath,
|
|
92362
92344
|
previewIframeRef: iframeRef,
|
|
@@ -92388,7 +92370,7 @@ function useDomStyleCommit({
|
|
|
92388
92370
|
}
|
|
92389
92371
|
|
|
92390
92372
|
// src/hooks/useDomGeometryCommit.ts
|
|
92391
|
-
import { useCallback as useCallback188, useMemo as
|
|
92373
|
+
import { useCallback as useCallback188, useMemo as useMemo83, useRef as useRef184, useState as useState152 } from "react";
|
|
92392
92374
|
var noop2 = () => {
|
|
92393
92375
|
};
|
|
92394
92376
|
var NO_SELECTED_ANIMATIONS = [];
|
|
@@ -92405,7 +92387,7 @@ function useDomGeometryCommit({
|
|
|
92405
92387
|
const projectIdRef = useRef184(projectId);
|
|
92406
92388
|
projectIdRef.current = projectId;
|
|
92407
92389
|
const pending2 = useRef184(/* @__PURE__ */ new Set()).current;
|
|
92408
|
-
const editHistory =
|
|
92390
|
+
const editHistory = useMemo83(() => ({ recordEdit }), [recordEdit]);
|
|
92409
92391
|
const reload = useCallback188(
|
|
92410
92392
|
() => reloadPreview ? reloadPreview() : iframeRef.current?.contentWindow?.location.reload(),
|
|
92411
92393
|
[reloadPreview, iframeRef]
|
|
@@ -92497,7 +92479,7 @@ function useDomGeometryCommit({
|
|
|
92497
92479
|
},
|
|
92498
92480
|
[pending2, showToast]
|
|
92499
92481
|
);
|
|
92500
|
-
return
|
|
92482
|
+
return useMemo83(
|
|
92501
92483
|
() => ({
|
|
92502
92484
|
commitPathOffset: (selection, next, modifiers) => saved2(() => handleGsapAwarePathOffsetCommit(selection, next, modifiers)),
|
|
92503
92485
|
commitGroupPathOffset: (updates) => saved2(() => handleGsapAwareGroupPathOffsetCommit(updates)),
|