@hyperframes/studio 0.9.55 → 0.9.58
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-BroIQA4E.js → hyperframes-player-B78JDyI_.js} +1 -1
- package/dist/assets/{index-Be7DZynj.js → index-D7ICtobF.js} +190 -190
- package/dist/assets/{index-CiF0D62S.js → index-ww7-RmuM.js} +1 -1
- package/dist/assets/{pausedVideoDecoder-RXcvblHS.js → pausedVideoDecoder-Dbe8Cmab.js} +1 -1
- package/dist/{chunk-JMM2CSEL.js → chunk-5EEM5WO4.js} +5 -1
- package/dist/index.d.ts +87 -3
- package/dist/index.html +1 -1
- package/dist/index.js +872 -778
- package/dist/player.js +1 -1
- package/package.json +8 -8
- package/src/components/nle/NLEPreview.test.ts +35 -3
- package/src/components/nle/NLEPreview.tsx +5 -4
- package/src/hooks/gsapRuntimePatch.ts +2 -3
- package/src/hooks/gsapRuntimeReaders.test.ts +5 -40
- package/src/hooks/gsapRuntimeReaders.ts +3 -27
- package/src/hooks/useExternalFileChangeCoordinator.test.tsx +20 -0
- package/src/hooks/useExternalFileChangeCoordinator.ts +1 -1
- package/src/index.ts +17 -0
- package/src/player/components/Player.test.ts +10 -0
- package/src/player/components/Player.tsx +2 -2
- package/src/player/components/studioShortcuts.ts +3 -2
- package/src/player/hooks/previewMessageRouter.manifest.test.ts +1 -0
- package/src/player/hooks/previewMessageRouter.test.ts +90 -12
- package/src/player/hooks/previewMessageRouter.ts +6 -4
- package/src/player/hooks/timelinePlayerTestHarness.ts +2 -0
- package/src/player/hooks/timelineSyncHydration.test.ts +28 -2
- package/src/player/hooks/timelineSyncHydration.ts +3 -7
- package/src/player/hooks/usePlaybackKeyboard.test.ts +107 -2
- package/src/player/hooks/usePlaybackKeyboard.ts +38 -1
- package/src/player/hooks/useShadowPreviewReload.ts +131 -14
- package/src/player/hooks/useTimelinePlayer.metadata.test.ts +1 -0
- package/src/player/hooks/useTimelinePlayer.play.test.ts +1 -0
- package/src/player/hooks/useTimelinePlayer.reloadStill.test.ts +241 -0
- package/src/player/hooks/useTimelinePlayer.seek.test.ts +3 -0
- package/src/player/hooks/useTimelinePlayer.ts +13 -1
- package/src/player/hooks/useTimelineSyncCallbacks.ts +4 -0
- package/src/player/lib/bridgePlayback.ts +7 -1
- package/src/player/lib/previewChannel.test.ts +13 -0
- package/src/sealedPreviewExports.test.ts +20 -0
- package/src/utils/externalConflictStorage.test.ts +66 -14
- package/src/utils/externalConflictStorage.ts +36 -82
- package/src/utils/gsapSoftReload.ts +2 -14
package/dist/index.js
CHANGED
|
@@ -91,7 +91,7 @@ import {
|
|
|
91
91
|
whileScriptWrites,
|
|
92
92
|
writeStudioUiPreferences,
|
|
93
93
|
zoomToSelectedClips
|
|
94
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-5EEM5WO4.js";
|
|
95
95
|
import {
|
|
96
96
|
Button,
|
|
97
97
|
ContextMenu,
|
|
@@ -312,11 +312,12 @@ function setStudioKeys(overrides) {
|
|
|
312
312
|
for (const listener2 of listeners) listener2();
|
|
313
313
|
}
|
|
314
314
|
var getStudioKeys = () => current;
|
|
315
|
-
|
|
315
|
+
var getStudioKey = (action) => current[action];
|
|
316
|
+
function subscribeStudioKeys(listener2) {
|
|
316
317
|
listeners.add(listener2);
|
|
317
318
|
return () => listeners.delete(listener2);
|
|
318
319
|
}
|
|
319
|
-
var useStudioKeys = () => useSyncExternalStore(
|
|
320
|
+
var useStudioKeys = () => useSyncExternalStore(subscribeStudioKeys, getStudioKeys);
|
|
320
321
|
function useShortcutSections(host) {
|
|
321
322
|
const keys = useStudioKeys();
|
|
322
323
|
return host ?? buildShortcutSections(keys);
|
|
@@ -461,9 +462,9 @@ function getCliDistinctId() {
|
|
|
461
462
|
}
|
|
462
463
|
}
|
|
463
464
|
function persist(ls, id) {
|
|
464
|
-
for (const
|
|
465
|
+
for (const key of [DISTINCT_ID_KEY, LEGACY_STUDIO_ANON_ID_KEY]) {
|
|
465
466
|
try {
|
|
466
|
-
ls.setItem(
|
|
467
|
+
ls.setItem(key, id);
|
|
467
468
|
} catch {
|
|
468
469
|
}
|
|
469
470
|
}
|
|
@@ -504,9 +505,9 @@ var NOTICE_KEY = "hyperframes-studio:telemetryNoticeShown";
|
|
|
504
505
|
function getAnonymousId() {
|
|
505
506
|
return resolveStudioDistinctId();
|
|
506
507
|
}
|
|
507
|
-
function readStoredFlag(
|
|
508
|
+
function readStoredFlag(key) {
|
|
508
509
|
try {
|
|
509
|
-
return safeLocalStorage()?.getItem(
|
|
510
|
+
return safeLocalStorage()?.getItem(key) === "1";
|
|
510
511
|
} catch {
|
|
511
512
|
return false;
|
|
512
513
|
}
|
|
@@ -607,12 +608,12 @@ function resolveBucketUnit() {
|
|
|
607
608
|
var STORAGE_PREFIX = "hyperframes-studio:canary:";
|
|
608
609
|
function readOverride(name) {
|
|
609
610
|
if (typeof window === "undefined") return void 0;
|
|
610
|
-
const
|
|
611
|
+
const key = canaryParamName(name);
|
|
611
612
|
const storageKey = `${STORAGE_PREFIX}${name}`;
|
|
612
613
|
const store = safeSessionStorage();
|
|
613
614
|
let raw = null;
|
|
614
615
|
try {
|
|
615
|
-
raw = new URLSearchParams(window.location.search).get(
|
|
616
|
+
raw = new URLSearchParams(window.location.search).get(key);
|
|
616
617
|
} catch {
|
|
617
618
|
raw = null;
|
|
618
619
|
}
|
|
@@ -2314,14 +2315,14 @@ function createTimelineRowGeometry(rowKeys, rowHeights, padding = {}) {
|
|
|
2314
2315
|
const heights = Object.freeze(rowHeights.map(validRowHeight));
|
|
2315
2316
|
const keys = Object.freeze(
|
|
2316
2317
|
heights.map((_, row) => {
|
|
2317
|
-
const
|
|
2318
|
-
return
|
|
2318
|
+
const key = rowKeys[row];
|
|
2319
|
+
return key !== void 0 && Number.isFinite(key) ? key : row;
|
|
2319
2320
|
})
|
|
2320
2321
|
);
|
|
2321
2322
|
const offsets = [0];
|
|
2322
2323
|
for (const height of heights) offsets.push((offsets.at(-1) ?? 0) + height);
|
|
2323
2324
|
Object.freeze(offsets);
|
|
2324
|
-
const rowIndexByKey = new Map(keys.map((
|
|
2325
|
+
const rowIndexByKey = new Map(keys.map((key, row) => [key, row]));
|
|
2325
2326
|
const getRowHeight = (row) => validRowHeight(heights[row]);
|
|
2326
2327
|
const getRowOffset = (row) => {
|
|
2327
2328
|
if (heights.length === 0) return row * TRACK_H;
|
|
@@ -2921,8 +2922,8 @@ var ONTO_ROW_THRESHOLD = 0.35;
|
|
|
2921
2922
|
function isAudioElement(element) {
|
|
2922
2923
|
return element.tag?.toLowerCase() === "audio";
|
|
2923
2924
|
}
|
|
2924
|
-
function layerContainsElement(layer,
|
|
2925
|
-
return layer.elements.some((element) => getTimelineElementIdentity(element) ===
|
|
2925
|
+
function layerContainsElement(layer, key) {
|
|
2926
|
+
return layer.elements.some((element) => getTimelineElementIdentity(element) === key);
|
|
2926
2927
|
}
|
|
2927
2928
|
function layerConflictsWithElement(layer, element, draggedKey) {
|
|
2928
2929
|
return layer.elements.some(
|
|
@@ -2943,8 +2944,8 @@ function addElementChange(changes, element, zIndex) {
|
|
|
2943
2944
|
function addLayerChanges(changes, layer, zIndex, excludedKey) {
|
|
2944
2945
|
let count = 0;
|
|
2945
2946
|
for (const element of layer.elements) {
|
|
2946
|
-
const
|
|
2947
|
-
if (
|
|
2947
|
+
const key = getTimelineElementIdentity(element);
|
|
2948
|
+
if (key === excludedKey) continue;
|
|
2948
2949
|
const before = changes.length;
|
|
2949
2950
|
addElementChange(changes, element, zIndex);
|
|
2950
2951
|
if (changes.length > before) count += 1;
|
|
@@ -5000,7 +5001,7 @@ function useTimelineClipCapabilities() {
|
|
|
5000
5001
|
}
|
|
5001
5002
|
function refuseWhenReadOnly(readOnlyPress, callbacks) {
|
|
5002
5003
|
if (!readOnlyPress) return callbacks;
|
|
5003
|
-
return Object.fromEntries(Object.keys(callbacks).map((
|
|
5004
|
+
return Object.fromEntries(Object.keys(callbacks).map((key) => [key, readOnlyPress]));
|
|
5004
5005
|
}
|
|
5005
5006
|
function useAbandonEditsOnReadOnly(readOnly, abandon) {
|
|
5006
5007
|
const abandonNow = useEffectEvent(abandon);
|
|
@@ -5037,11 +5038,11 @@ function timelineKeyframeSelectionKey(elementId2, target) {
|
|
|
5037
5038
|
target.tweenPercentage ?? target.percentage
|
|
5038
5039
|
]);
|
|
5039
5040
|
}
|
|
5040
|
-
function timelineKeyframeTargetFromSelectionKey(elementId2,
|
|
5041
|
-
if (
|
|
5041
|
+
function timelineKeyframeTargetFromSelectionKey(elementId2, key) {
|
|
5042
|
+
if (key.startsWith("[")) {
|
|
5042
5043
|
let decoded;
|
|
5043
5044
|
try {
|
|
5044
|
-
decoded = JSON.parse(
|
|
5045
|
+
decoded = JSON.parse(key);
|
|
5045
5046
|
} catch {
|
|
5046
5047
|
return null;
|
|
5047
5048
|
}
|
|
@@ -5057,9 +5058,9 @@ function timelineKeyframeTargetFromSelectionKey(elementId2, key2) {
|
|
|
5057
5058
|
tweenPercentage
|
|
5058
5059
|
};
|
|
5059
5060
|
}
|
|
5060
|
-
const separator =
|
|
5061
|
-
if (separator < 0 ||
|
|
5062
|
-
const percentage = Number(
|
|
5061
|
+
const separator = key.lastIndexOf(":");
|
|
5062
|
+
if (separator < 0 || key.slice(0, separator) !== elementId2) return null;
|
|
5063
|
+
const percentage = Number(key.slice(separator + 1));
|
|
5063
5064
|
return Number.isFinite(percentage) ? { percentage } : null;
|
|
5064
5065
|
}
|
|
5065
5066
|
|
|
@@ -5398,12 +5399,12 @@ function parsePercentageKeyframes(kfObj) {
|
|
|
5398
5399
|
});
|
|
5399
5400
|
return keyframes.length > 0 ? { keyframes } : null;
|
|
5400
5401
|
}
|
|
5401
|
-
for (const [
|
|
5402
|
-
if (
|
|
5402
|
+
for (const [key, val] of Object.entries(kfObj)) {
|
|
5403
|
+
if (key === "easeEach") {
|
|
5403
5404
|
if (typeof val === "string") easeEach = val;
|
|
5404
5405
|
continue;
|
|
5405
5406
|
}
|
|
5406
|
-
const pctMatch =
|
|
5407
|
+
const pctMatch = key.match(/^(\d+(?:\.\d+)?)%$/);
|
|
5407
5408
|
if (!pctMatch || !val || typeof val !== "object") continue;
|
|
5408
5409
|
const percentage = parseFloat(pctMatch[1]);
|
|
5409
5410
|
const properties = collectAnimatableKeyframeProperties(val);
|
|
@@ -6042,9 +6043,9 @@ function parseMotionValues(value) {
|
|
|
6042
6043
|
if (!value || typeof value !== "object") return null;
|
|
6043
6044
|
const record2 = value;
|
|
6044
6045
|
const parsed = {};
|
|
6045
|
-
for (const
|
|
6046
|
-
const next = finiteNumber(record2[
|
|
6047
|
-
if (next != null) parsed[
|
|
6046
|
+
for (const key of ["x", "y", "scale", "rotation", "opacity", "autoAlpha"]) {
|
|
6047
|
+
const next = finiteNumber(record2[key]);
|
|
6048
|
+
if (next != null) parsed[key] = next;
|
|
6048
6049
|
}
|
|
6049
6050
|
return Object.keys(parsed).length > 0 ? parsed : null;
|
|
6050
6051
|
}
|
|
@@ -6806,9 +6807,9 @@ var xToSvg = (px) => PADH + S * px;
|
|
|
6806
6807
|
var yToSvg = (py) => HR + S * (1 - py);
|
|
6807
6808
|
var clampView = (py) => Math.max(VMIN, Math.min(VMAX, py));
|
|
6808
6809
|
var clampDragY = (py) => Math.max(DRAG_VMIN, Math.min(DRAG_VMAX, py));
|
|
6809
|
-
function nudgeCurve(tuple, handle,
|
|
6810
|
-
const deltaX =
|
|
6811
|
-
const deltaY =
|
|
6810
|
+
function nudgeCurve(tuple, handle, key, step) {
|
|
6811
|
+
const deltaX = key === "ArrowLeft" ? -step : key === "ArrowRight" ? step : 0;
|
|
6812
|
+
const deltaY = key === "ArrowDown" ? -step : key === "ArrowUp" ? step : 0;
|
|
6812
6813
|
if (deltaX === 0 && deltaY === 0) return null;
|
|
6813
6814
|
const next = [...tuple];
|
|
6814
6815
|
const xIndex = handle === "p1" ? 0 : 2;
|
|
@@ -7061,7 +7062,7 @@ function EaseCurveSection({
|
|
|
7061
7062
|
),
|
|
7062
7063
|
/* @__PURE__ */ jsx12("circle", { cx: a0.x, cy: a0.y, r: "3", className: "fill-accent-ink" }),
|
|
7063
7064
|
/* @__PURE__ */ jsx12("circle", { cx: a1.x, cy: a1.y, r: "3", className: "fill-accent-ink" }),
|
|
7064
|
-
showHandles && [["p1", p1], ["p2", p2]].map(([
|
|
7065
|
+
showHandles && [["p1", p1], ["p2", p2]].map(([key, pt]) => /* @__PURE__ */ jsxs9("g", { children: [
|
|
7065
7066
|
/* @__PURE__ */ jsx12(
|
|
7066
7067
|
"circle",
|
|
7067
7068
|
{
|
|
@@ -7071,16 +7072,16 @@ function EaseCurveSection({
|
|
|
7071
7072
|
fill: "transparent",
|
|
7072
7073
|
role: "slider",
|
|
7073
7074
|
tabIndex: 0,
|
|
7074
|
-
"aria-label": `${
|
|
7075
|
+
"aria-label": `${key === "p1" ? "First" : "Second"} bezier control point`,
|
|
7075
7076
|
"aria-valuemin": 0,
|
|
7076
7077
|
"aria-valuemax": 1,
|
|
7077
|
-
"aria-valuenow":
|
|
7078
|
-
"aria-valuetext": `x ${
|
|
7078
|
+
"aria-valuenow": key === "p1" ? x1 : x2,
|
|
7079
|
+
"aria-valuetext": `x ${key === "p1" ? x1 : x2}, y ${key === "p1" ? y1 : y2}`,
|
|
7079
7080
|
className: "cursor-grab stroke-transparent outline-hidden active:cursor-grabbing focus-visible:stroke-text-0 focus-visible:stroke-[2px]",
|
|
7080
|
-
onPointerDown: (e) => handlePointerDown(
|
|
7081
|
-
onKeyDown: (event) => handleKeyDown(
|
|
7082
|
-
onPointerEnter: () => setHover(
|
|
7083
|
-
onPointerLeave: () => setHover((h) => h ===
|
|
7081
|
+
onPointerDown: (e) => handlePointerDown(key, e),
|
|
7082
|
+
onKeyDown: (event) => handleKeyDown(key, event),
|
|
7083
|
+
onPointerEnter: () => setHover(key),
|
|
7084
|
+
onPointerLeave: () => setHover((h) => h === key ? null : h)
|
|
7084
7085
|
}
|
|
7085
7086
|
),
|
|
7086
7087
|
/* @__PURE__ */ jsx12(
|
|
@@ -7088,12 +7089,12 @@ function EaseCurveSection({
|
|
|
7088
7089
|
{
|
|
7089
7090
|
cx: pt.x,
|
|
7090
7091
|
cy: pt.y,
|
|
7091
|
-
r: hover ===
|
|
7092
|
+
r: hover === key || draggingRef.current === key ? 7 : 5.5,
|
|
7092
7093
|
strokeWidth: "2.5",
|
|
7093
7094
|
className: "pointer-events-none fill-input stroke-accent-ink transition-[r]"
|
|
7094
7095
|
}
|
|
7095
7096
|
)
|
|
7096
|
-
] },
|
|
7097
|
+
] }, key))
|
|
7097
7098
|
]
|
|
7098
7099
|
}
|
|
7099
7100
|
)
|
|
@@ -7545,8 +7546,8 @@ var DETAIL_KEYS = [
|
|
|
7545
7546
|
var trail = [];
|
|
7546
7547
|
var startedAt = Date.now();
|
|
7547
7548
|
function detailFor(properties) {
|
|
7548
|
-
for (const
|
|
7549
|
-
const value = properties[
|
|
7549
|
+
for (const key of DETAIL_KEYS) {
|
|
7550
|
+
const value = properties[key];
|
|
7550
7551
|
if (typeof value === "string" && value.length > 0 && value.length <= 24) return `:${value}`;
|
|
7551
7552
|
if (typeof value === "number" || typeof value === "boolean") return `:${String(value)}`;
|
|
7552
7553
|
}
|
|
@@ -7818,14 +7819,14 @@ function beginTimelineKeyframeRetime(input) {
|
|
|
7818
7819
|
actor2.phase = "complete";
|
|
7819
7820
|
};
|
|
7820
7821
|
if (coordinator.actor) cancel(coordinator.actor);
|
|
7821
|
-
for (const [
|
|
7822
|
-
if (pending3.sessionEpoch !== sessionEpoch) coordinator.pending.delete(
|
|
7822
|
+
for (const [key, pending3] of coordinator.pending) {
|
|
7823
|
+
if (pending3.sessionEpoch !== sessionEpoch) coordinator.pending.delete(key);
|
|
7823
7824
|
}
|
|
7824
|
-
for (const [
|
|
7825
|
+
for (const [key, pending3] of coordinator.pending) {
|
|
7825
7826
|
if (pending3.elementId === input.elementId && input.keyframes.some(
|
|
7826
7827
|
(keyframe) => input.keyframeKeyOf(keyframe) === pending3.destinationKeyframeKey && Math.abs(keyframe.percentage - pending3.clipPercentage) < 0.2
|
|
7827
7828
|
)) {
|
|
7828
|
-
coordinator.pending.delete(
|
|
7829
|
+
coordinator.pending.delete(key);
|
|
7829
7830
|
}
|
|
7830
7831
|
}
|
|
7831
7832
|
const pending2 = coordinator.pending.get(input.keyframeKey);
|
|
@@ -8018,8 +8019,8 @@ function beginTimelineKeyframeRetime(input) {
|
|
|
8018
8019
|
coordinator.latest = null;
|
|
8019
8020
|
cancel(actor);
|
|
8020
8021
|
} else if (actor.sourceWasPresent && !sourceStillPresent) {
|
|
8021
|
-
for (const [
|
|
8022
|
-
if (pending3.elementId === actor.elementId) coordinator.pending.delete(
|
|
8022
|
+
for (const [key, pending3] of coordinator.pending) {
|
|
8023
|
+
if (pending3.elementId === actor.elementId) coordinator.pending.delete(key);
|
|
8023
8024
|
}
|
|
8024
8025
|
if (coordinator.latest?.elementId === actor.elementId) coordinator.latest = null;
|
|
8025
8026
|
cancel(actor);
|
|
@@ -8587,11 +8588,11 @@ var EMPTY = { version: 1, lanes: [] };
|
|
|
8587
8588
|
var chainCache = /* @__PURE__ */ new Map();
|
|
8588
8589
|
var automationCache = /* @__PURE__ */ new Map();
|
|
8589
8590
|
var CACHE_LIMIT = 64;
|
|
8590
|
-
function cached3(store,
|
|
8591
|
-
const hit = store.get(
|
|
8591
|
+
function cached3(store, key, build) {
|
|
8592
|
+
const hit = store.get(key);
|
|
8592
8593
|
if (hit !== void 0) {
|
|
8593
|
-
store.delete(
|
|
8594
|
-
store.set(
|
|
8594
|
+
store.delete(key);
|
|
8595
|
+
store.set(key, hit);
|
|
8595
8596
|
return hit;
|
|
8596
8597
|
}
|
|
8597
8598
|
const value = build();
|
|
@@ -8599,7 +8600,7 @@ function cached3(store, key2, build) {
|
|
|
8599
8600
|
const oldest = store.keys().next();
|
|
8600
8601
|
if (!oldest.done) store.delete(oldest.value);
|
|
8601
8602
|
}
|
|
8602
|
-
store.set(
|
|
8603
|
+
store.set(key, value);
|
|
8603
8604
|
return value;
|
|
8604
8605
|
}
|
|
8605
8606
|
function elementFxChain(element) {
|
|
@@ -8676,14 +8677,14 @@ function groupAutomationLanes(elements) {
|
|
|
8676
8677
|
if (!isAudioOrVideoTimelineElement(element)) continue;
|
|
8677
8678
|
const chain = elementFxChain(element);
|
|
8678
8679
|
for (const lane of elementAutomationLanes(element)) {
|
|
8679
|
-
const
|
|
8680
|
+
const key = laneGroupKey(lane.target, chain);
|
|
8680
8681
|
const parts = automationLaneLabelParts(lane.target, chain);
|
|
8681
|
-
if (!
|
|
8682
|
-
const group = groups.get(
|
|
8682
|
+
if (!key || !parts) continue;
|
|
8683
|
+
const group = groups.get(key);
|
|
8683
8684
|
if (group) group.entries.push({ element, lane });
|
|
8684
8685
|
else {
|
|
8685
|
-
groups.set(
|
|
8686
|
-
key
|
|
8686
|
+
groups.set(key, {
|
|
8687
|
+
key,
|
|
8687
8688
|
name: parts.name,
|
|
8688
8689
|
param: parts.param,
|
|
8689
8690
|
entries: [{ element, lane }]
|
|
@@ -8826,7 +8827,7 @@ function useTimelineTrackDerivations(expandedElements) {
|
|
|
8826
8827
|
|
|
8827
8828
|
// src/player/components/timelineTrackInsertLayout.ts
|
|
8828
8829
|
function timelineTrackOrderChanged(previous, current2) {
|
|
8829
|
-
return current2.length !== previous.length || current2.some((
|
|
8830
|
+
return current2.length !== previous.length || current2.some((key, row) => key !== previous[row]);
|
|
8830
8831
|
}
|
|
8831
8832
|
function keyboardPickupInsertRow(row, allowed2) {
|
|
8832
8833
|
while (row > 0 && allowed2 && !allowed2.has(row)) row--;
|
|
@@ -8846,17 +8847,17 @@ function nextKeyboardInsertRow(input) {
|
|
|
8846
8847
|
function buildTimelineTrackInsertLayout(order, groups) {
|
|
8847
8848
|
const allowedRows = new Set(Array.from({ length: order.length + 1 }, (_, row) => row));
|
|
8848
8849
|
const anchors = new Map(groups.map((group) => [group.anchorKey, group.memberTracks]));
|
|
8849
|
-
const positions = new Map(order.map((
|
|
8850
|
+
const positions = new Map(order.map((key, row) => [key, row]));
|
|
8850
8851
|
for (const group of groups) {
|
|
8851
8852
|
const anchor2 = positions.get(group.anchorKey);
|
|
8852
8853
|
if (anchor2 === void 0) continue;
|
|
8853
|
-
const end = Math.max(anchor2, ...group.memberTracks.map((
|
|
8854
|
+
const end = Math.max(anchor2, ...group.memberTracks.map((key) => positions.get(key) ?? anchor2));
|
|
8854
8855
|
for (let row = anchor2 + 1; row <= end; row++) allowedRows.delete(row);
|
|
8855
8856
|
}
|
|
8856
8857
|
const tracks = /* @__PURE__ */ new Set();
|
|
8857
8858
|
const topologyRows = [0];
|
|
8858
|
-
for (const
|
|
8859
|
-
for (const track2 of anchors.get(
|
|
8859
|
+
for (const key of order) {
|
|
8860
|
+
for (const track2 of anchors.get(key) ?? [key]) tracks.add(track2);
|
|
8860
8861
|
topologyRows.push(tracks.size);
|
|
8861
8862
|
}
|
|
8862
8863
|
return {
|
|
@@ -8912,8 +8913,8 @@ function resolveTrackKeyframeClip(elements, laneCounts, selectedElementId, selec
|
|
|
8912
8913
|
const keyframed = elements.filter((element) => disclosable(element) >= 1);
|
|
8913
8914
|
if (keyframed.length === 0) return null;
|
|
8914
8915
|
const selected = keyframed.find((element) => {
|
|
8915
|
-
const
|
|
8916
|
-
return
|
|
8916
|
+
const key = element.key ?? element.id;
|
|
8917
|
+
return key === selectedElementId || selectedElementIds.has(key);
|
|
8917
8918
|
});
|
|
8918
8919
|
if (selected) return selected;
|
|
8919
8920
|
return keyframed.reduce(
|
|
@@ -9048,12 +9049,12 @@ function useDisplayRowHeights(displayTrackOrder2, rowGeometry) {
|
|
|
9048
9049
|
function insertPreviewTrack(trackOrder, preview2) {
|
|
9049
9050
|
const result = [];
|
|
9050
9051
|
let inserted = false;
|
|
9051
|
-
for (const
|
|
9052
|
-
if (!inserted && Number.isInteger(
|
|
9052
|
+
for (const key of trackOrder) {
|
|
9053
|
+
if (!inserted && Number.isInteger(key) && key > preview2) {
|
|
9053
9054
|
result.push(preview2);
|
|
9054
9055
|
inserted = true;
|
|
9055
9056
|
}
|
|
9056
|
-
result.push(
|
|
9057
|
+
result.push(key);
|
|
9057
9058
|
}
|
|
9058
9059
|
if (!inserted) result.push(preview2);
|
|
9059
9060
|
return result;
|
|
@@ -9065,7 +9066,7 @@ function useDisplayTrackOrder(draggedClip, trackOrder) {
|
|
|
9065
9066
|
return useMemo5(() => {
|
|
9066
9067
|
if (!started || previewTrack === void 0) return trackOrder;
|
|
9067
9068
|
if (insertRow !== null) {
|
|
9068
|
-
const pendingKey = trackOrder.reduce((lowest,
|
|
9069
|
+
const pendingKey = trackOrder.reduce((lowest, key) => Math.min(lowest, key), 0) - 1;
|
|
9069
9070
|
const displayOrder = [...trackOrder];
|
|
9070
9071
|
displayOrder.splice(insertRow, 0, pendingKey);
|
|
9071
9072
|
return displayOrder;
|
|
@@ -9105,8 +9106,8 @@ var NAVIGATION_KEYS = /* @__PURE__ */ new Set([
|
|
|
9105
9106
|
"PageUp",
|
|
9106
9107
|
"PageDown"
|
|
9107
9108
|
]);
|
|
9108
|
-
function isTimelineNavigationKey(
|
|
9109
|
-
return NAVIGATION_KEYS.has(
|
|
9109
|
+
function isTimelineNavigationKey(key) {
|
|
9110
|
+
return NAVIGATION_KEYS.has(key);
|
|
9110
9111
|
}
|
|
9111
9112
|
function elementId(element) {
|
|
9112
9113
|
return element.key ?? element.id;
|
|
@@ -9155,9 +9156,9 @@ function propertyItems(rowId, clip, keyframes) {
|
|
|
9155
9156
|
const unique = /* @__PURE__ */ new Map();
|
|
9156
9157
|
for (const keyframe of keyframes) {
|
|
9157
9158
|
const target = keyframeTarget2(keyframe);
|
|
9158
|
-
const
|
|
9159
|
-
if (!unique.has(
|
|
9160
|
-
unique.set(
|
|
9159
|
+
const key = timelineKeyframeSelectionKey(id, target);
|
|
9160
|
+
if (!unique.has(key)) {
|
|
9161
|
+
unique.set(key, {
|
|
9161
9162
|
target,
|
|
9162
9163
|
time: clip.start + keyframe.percentage / 100 * clip.duration
|
|
9163
9164
|
});
|
|
@@ -9293,14 +9294,14 @@ function buildTimelineLogicalRows({
|
|
|
9293
9294
|
if (!groupExpanded) return;
|
|
9294
9295
|
for (const track2 of group.memberTracks) emitTrack(track2, 2, groupRowId);
|
|
9295
9296
|
}
|
|
9296
|
-
for (const
|
|
9297
|
-
const group = groupByAnchor.get(
|
|
9297
|
+
for (const key of displayTrackOrder2) {
|
|
9298
|
+
const group = groupByAnchor.get(key);
|
|
9298
9299
|
if (group) {
|
|
9299
9300
|
emitGroup(group);
|
|
9300
9301
|
continue;
|
|
9301
9302
|
}
|
|
9302
|
-
if (trackGroupOf.has(
|
|
9303
|
-
emitTrack(
|
|
9303
|
+
if (trackGroupOf.has(key)) continue;
|
|
9304
|
+
emitTrack(key, 1, null);
|
|
9304
9305
|
}
|
|
9305
9306
|
return rows;
|
|
9306
9307
|
}
|
|
@@ -9318,29 +9319,29 @@ function nearestTarget(row, time) {
|
|
|
9318
9319
|
(left, right) => Math.abs(left.time - time) - Math.abs(right.time - time) || left.time - right.time || left.id.localeCompare(right.id)
|
|
9319
9320
|
)[0] ?? row;
|
|
9320
9321
|
}
|
|
9321
|
-
function resolveTimelineNavigationTarget(rows, currentId,
|
|
9322
|
+
function resolveTimelineNavigationTarget(rows, currentId, key, options = {}) {
|
|
9322
9323
|
const current2 = locateTimelineLogicalTarget(rows, currentId);
|
|
9323
9324
|
if (!current2) return null;
|
|
9324
9325
|
const { row, rowIndex, itemIndex, target } = current2;
|
|
9325
|
-
if (
|
|
9326
|
-
const boundaryRow = options.timelineBoundary ?
|
|
9326
|
+
if (key === "Home" || key === "End") {
|
|
9327
|
+
const boundaryRow = options.timelineBoundary ? key === "Home" ? rows[0] : rows.at(-1) : row;
|
|
9327
9328
|
if (!boundaryRow) return target;
|
|
9328
9329
|
if (options.timelineBoundary) return boundaryRow;
|
|
9329
|
-
return
|
|
9330
|
+
return key === "Home" ? boundaryRow : boundaryRow.items.at(-1) ?? boundaryRow;
|
|
9330
9331
|
}
|
|
9331
|
-
if (
|
|
9332
|
+
if (key === "ArrowLeft") {
|
|
9332
9333
|
if (itemIndex < 0) {
|
|
9333
9334
|
if (!row.parentId) return row;
|
|
9334
9335
|
return locateTimelineLogicalTarget(rows, row.parentId)?.target ?? row;
|
|
9335
9336
|
}
|
|
9336
9337
|
return itemIndex === 0 ? row : row.items[itemIndex - 1];
|
|
9337
9338
|
}
|
|
9338
|
-
if (
|
|
9339
|
+
if (key === "ArrowRight") {
|
|
9339
9340
|
if (itemIndex < 0) return row.items[0] ?? row;
|
|
9340
9341
|
return row.items[itemIndex + 1] ?? target;
|
|
9341
9342
|
}
|
|
9342
|
-
const direction =
|
|
9343
|
-
const pageKey =
|
|
9343
|
+
const direction = key === "ArrowUp" || key === "PageUp" ? -1 : 1;
|
|
9344
|
+
const pageKey = key === "PageUp" || key === "PageDown";
|
|
9344
9345
|
const pageSize = options.pageSize;
|
|
9345
9346
|
if (pageKey && (pageSize === void 0 || !Number.isFinite(pageSize) || pageSize < 1)) {
|
|
9346
9347
|
return target;
|
|
@@ -9771,15 +9772,15 @@ function beginTimelineOptimisticGesture(updateElement, keys, scope = "timing") {
|
|
|
9771
9772
|
scopes.set(scope, revisions);
|
|
9772
9773
|
}
|
|
9773
9774
|
const gesture = /* @__PURE__ */ new Map();
|
|
9774
|
-
for (const
|
|
9775
|
-
const revision = (revisions.get(
|
|
9776
|
-
revisions.set(
|
|
9777
|
-
gesture.set(
|
|
9775
|
+
for (const key of keys) {
|
|
9776
|
+
const revision = (revisions.get(key) ?? 0) + 1;
|
|
9777
|
+
revisions.set(key, revision);
|
|
9778
|
+
gesture.set(key, revision);
|
|
9778
9779
|
}
|
|
9779
9780
|
return gesture;
|
|
9780
9781
|
}
|
|
9781
|
-
function isLatestTimelineOptimisticGesture(updateElement, gesture,
|
|
9782
|
-
return gesture.has(
|
|
9782
|
+
function isLatestTimelineOptimisticGesture(updateElement, gesture, key, scope = "timing") {
|
|
9783
|
+
return gesture.has(key) && revisionsByUpdater.get(updateElement)?.get(scope)?.get(key) === gesture.get(key);
|
|
9783
9784
|
}
|
|
9784
9785
|
function rollbackLatestTimelineOptimisticGesture(updateElement, gesture, rollbacks) {
|
|
9785
9786
|
batchElementUpdates(() => {
|
|
@@ -9873,9 +9874,9 @@ var StudioFileConflictError = class extends StudioSaveHttpError {
|
|
|
9873
9874
|
this.attemptedContent = input.attemptedContent;
|
|
9874
9875
|
}
|
|
9875
9876
|
};
|
|
9876
|
-
function readNumericProperty(value,
|
|
9877
|
+
function readNumericProperty(value, key) {
|
|
9877
9878
|
const record2 = value;
|
|
9878
|
-
const property = record2[
|
|
9879
|
+
const property = record2[key];
|
|
9879
9880
|
return typeof property === "number" && Number.isFinite(property) ? property : void 0;
|
|
9880
9881
|
}
|
|
9881
9882
|
function createStudioSaveAbortError() {
|
|
@@ -10308,15 +10309,15 @@ function persistMoveEdits(edits, deps, coalesceKey, operation = "timing") {
|
|
|
10308
10309
|
);
|
|
10309
10310
|
const applyEdit = (e, reassert = false) => {
|
|
10310
10311
|
const { timing, detach } = moveStoreUpdates(e);
|
|
10311
|
-
const
|
|
10312
|
+
const key = keyOf6(e.element);
|
|
10312
10313
|
const updates = {};
|
|
10313
|
-
if (!reassert || isLatestTimelineOptimisticGesture(updateElement, revision,
|
|
10314
|
+
if (!reassert || isLatestTimelineOptimisticGesture(updateElement, revision, key)) {
|
|
10314
10315
|
Object.assign(updates, timing);
|
|
10315
10316
|
}
|
|
10316
|
-
if (detach && (!reassert || isLatestTimelineOptimisticGesture(updateElement, membershipRevision,
|
|
10317
|
+
if (detach && (!reassert || isLatestTimelineOptimisticGesture(updateElement, membershipRevision, key, "membership"))) {
|
|
10317
10318
|
updates.audioGroup = void 0;
|
|
10318
10319
|
}
|
|
10319
|
-
if (Object.keys(updates).length) updateElement(
|
|
10320
|
+
if (Object.keys(updates).length) updateElement(key, updates);
|
|
10320
10321
|
};
|
|
10321
10322
|
const applyEdits = (reassert = false) => batchElementUpdates(() => edits.forEach((e) => applyEdit(e, reassert)));
|
|
10322
10323
|
applyEdits();
|
|
@@ -11320,9 +11321,9 @@ function useTimelineClipDrag({
|
|
|
11320
11321
|
};
|
|
11321
11322
|
const pickup = (event, viewport2) => {
|
|
11322
11323
|
const target = timelineKeyboardEventTarget(event.target, viewport2);
|
|
11323
|
-
const
|
|
11324
|
-
if (
|
|
11325
|
-
const element = getTimelineElementIndexes(elementsRef.current).byKey.get(
|
|
11324
|
+
const key = target?.dataset.elId;
|
|
11325
|
+
if (key === void 0 || !onMoveElementRef.current) return;
|
|
11326
|
+
const element = getTimelineElementIndexes(elementsRef.current).byKey.get(key);
|
|
11326
11327
|
if (!element || !getClipCapabilities(element).canMove) return;
|
|
11327
11328
|
event.preventDefault();
|
|
11328
11329
|
event.stopImmediatePropagation();
|
|
@@ -11596,29 +11597,29 @@ function useTimelineDragPreviewState(draggedClip, resizingClip, selectedElementI
|
|
|
11596
11597
|
import { useCallback as useCallback11 } from "react";
|
|
11597
11598
|
|
|
11598
11599
|
// src/player/components/timelineLinkSelection.ts
|
|
11599
|
-
function selectClipWithLinks(
|
|
11600
|
+
function selectClipWithLinks(key, altKey, setSelectedElementId) {
|
|
11600
11601
|
const state = usePlayerStore.getState();
|
|
11601
11602
|
if (altKey || !isLinkedSelectionOn()) {
|
|
11602
|
-
state.setSelection([
|
|
11603
|
+
state.setSelection([key], key);
|
|
11603
11604
|
return;
|
|
11604
11605
|
}
|
|
11605
|
-
setSelectedElementId(
|
|
11606
|
+
setSelectedElementId(key);
|
|
11606
11607
|
const { selectedElementIds, elements } = usePlayerStore.getState();
|
|
11607
11608
|
const expanded = expandToLinkedMembers(selectedElementIds, elements);
|
|
11608
|
-
if (expanded.size > selectedElementIds.size) state.setSelection(expanded,
|
|
11609
|
+
if (expanded.size > selectedElementIds.size) state.setSelection(expanded, key);
|
|
11609
11610
|
}
|
|
11610
|
-
function toggleClipWithLinks(
|
|
11611
|
+
function toggleClipWithLinks(key, altKey) {
|
|
11611
11612
|
const state = usePlayerStore.getState();
|
|
11612
|
-
const element = state.elements.find((el) => (el.key ?? el.id) ===
|
|
11613
|
+
const element = state.elements.find((el) => (el.key ?? el.id) === key);
|
|
11613
11614
|
const members = element ? linkedMembersOf(element, state.elements, !altKey && isLinkedSelectionOn()) : [];
|
|
11614
|
-
const memberKeys = members.length > 0 ? members.map((el) => el.key ?? el.id) : [
|
|
11615
|
+
const memberKeys = members.length > 0 ? members.map((el) => el.key ?? el.id) : [key];
|
|
11615
11616
|
const next = new Set(state.selectedElementIds);
|
|
11616
|
-
const removing = next.has(
|
|
11617
|
+
const removing = next.has(key);
|
|
11617
11618
|
for (const memberKey of memberKeys) {
|
|
11618
11619
|
if (removing) next.delete(memberKey);
|
|
11619
11620
|
else next.add(memberKey);
|
|
11620
11621
|
}
|
|
11621
|
-
state.setSelection(next, removing ? state.selectedElementId :
|
|
11622
|
+
state.setSelection(next, removing ? state.selectedElementId : key);
|
|
11622
11623
|
const primary = usePlayerStore.getState().selectedElementId;
|
|
11623
11624
|
return state.elements.find((el) => (el.key ?? el.id) === primary) ?? null;
|
|
11624
11625
|
}
|
|
@@ -12810,9 +12811,9 @@ var SAVES_AN_EDIT = {
|
|
|
12810
12811
|
};
|
|
12811
12812
|
function trackEditCommits(actions) {
|
|
12812
12813
|
const tracked = { ...actions };
|
|
12813
|
-
for (const
|
|
12814
|
-
if (!SAVES_AN_EDIT[
|
|
12815
|
-
tracked[
|
|
12814
|
+
for (const key of Object.keys(SAVES_AN_EDIT)) {
|
|
12815
|
+
if (!SAVES_AN_EDIT[key]) continue;
|
|
12816
|
+
tracked[key] = trackedStudioEdit(actions[key], {
|
|
12816
12817
|
afterOlderSaves: true
|
|
12817
12818
|
});
|
|
12818
12819
|
}
|
|
@@ -13624,13 +13625,13 @@ function useTimelineGeometry({
|
|
|
13624
13625
|
// src/player/components/useAutoExpandKeyframedClips.ts
|
|
13625
13626
|
import { useEffect as useEffect18, useRef as useRef20 } from "react";
|
|
13626
13627
|
function freshLaneClips(gsapAnimations, clips) {
|
|
13627
|
-
for (const
|
|
13628
|
-
if (!gsapAnimations.has(
|
|
13628
|
+
for (const key of clips) {
|
|
13629
|
+
if (!gsapAnimations.has(key)) clips.delete(key);
|
|
13629
13630
|
}
|
|
13630
13631
|
const fresh = [];
|
|
13631
|
-
for (const [
|
|
13632
|
-
if (clips.has(
|
|
13633
|
-
if (animations.some(animationContributesLane)) fresh.push(
|
|
13632
|
+
for (const [key, animations] of gsapAnimations) {
|
|
13633
|
+
if (clips.has(key)) continue;
|
|
13634
|
+
if (animations.some(animationContributesLane)) fresh.push(key);
|
|
13634
13635
|
}
|
|
13635
13636
|
return fresh;
|
|
13636
13637
|
}
|
|
@@ -13648,7 +13649,7 @@ function useAutoExpandKeyframedClips(gsapAnimations) {
|
|
|
13648
13649
|
}
|
|
13649
13650
|
const fresh = freshLaneClips(gsapAnimations, seen.current.clips);
|
|
13650
13651
|
if (fresh.length === 0) return;
|
|
13651
|
-
for (const
|
|
13652
|
+
for (const key of fresh) seen.current.clips.add(key);
|
|
13652
13653
|
expandClips(fresh);
|
|
13653
13654
|
}, [gsapAnimations, expandClips, projectId]);
|
|
13654
13655
|
}
|
|
@@ -13885,7 +13886,7 @@ function TimelineEditProvider({
|
|
|
13885
13886
|
// Each callback is a stable reference from the parent — memoize the bag
|
|
13886
13887
|
// so consumers don't re-render when unrelated parent state changes.
|
|
13887
13888
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13888
|
-
EDIT_CALLBACK_KEYS.map((
|
|
13889
|
+
EDIT_CALLBACK_KEYS.map((key) => value[key])
|
|
13889
13890
|
);
|
|
13890
13891
|
return /* @__PURE__ */ jsx23(TimelineEditContext.Provider, { value: memoized, children });
|
|
13891
13892
|
}
|
|
@@ -14241,7 +14242,7 @@ function useTimelineActiveClips({
|
|
|
14241
14242
|
import { useCallback as useCallback19 } from "react";
|
|
14242
14243
|
function useTimelineLaneMoveRefresh() {
|
|
14243
14244
|
const setRefreshKey = useStudioPlaybackContextOptional()?.setRefreshKey;
|
|
14244
|
-
return useCallback19(() => setRefreshKey?.((
|
|
14245
|
+
return useCallback19(() => setRefreshKey?.((key) => key + 1), [setRefreshKey]);
|
|
14245
14246
|
}
|
|
14246
14247
|
|
|
14247
14248
|
// src/player/components/useTimelineFocusCoordinator.ts
|
|
@@ -14512,7 +14513,7 @@ function sameData(a, b) {
|
|
|
14512
14513
|
if ("nodeType" in a || "nodeType" in b || Array.isArray(a) !== Array.isArray(b)) return false;
|
|
14513
14514
|
const keys = Object.keys(a);
|
|
14514
14515
|
if (keys.length !== Object.keys(b).length) return false;
|
|
14515
|
-
return keys.every((
|
|
14516
|
+
return keys.every((key) => sameData(a[key], b[key]));
|
|
14516
14517
|
}
|
|
14517
14518
|
|
|
14518
14519
|
// src/player/components/timelineFocusIdentity.ts
|
|
@@ -14558,7 +14559,7 @@ function useTimelineVirtualRows({
|
|
|
14558
14559
|
() => [
|
|
14559
14560
|
...new Set(
|
|
14560
14561
|
[...pinnedRowKeys, ...focusedRowKey === void 0 ? [] : [focusedRowKey]].map(
|
|
14561
|
-
(
|
|
14562
|
+
(key) => rowGeometry.getRowIndex(key)
|
|
14562
14563
|
)
|
|
14563
14564
|
)
|
|
14564
14565
|
],
|
|
@@ -15355,7 +15356,7 @@ import { useCallback as useCallback24, useRef as useRef28, useSyncExternalStore
|
|
|
15355
15356
|
function useSettledScrollLeft(scrollRef) {
|
|
15356
15357
|
const scrollingRef = useRef28(false);
|
|
15357
15358
|
const settledRef = useRef28(0);
|
|
15358
|
-
const
|
|
15359
|
+
const subscribe2 = useCallback24(
|
|
15359
15360
|
(onChange) => {
|
|
15360
15361
|
const el = scrollRef.current;
|
|
15361
15362
|
settledRef.current = el?.scrollLeft ?? 0;
|
|
@@ -15383,7 +15384,7 @@ function useSettledScrollLeft(scrollRef) {
|
|
|
15383
15384
|
[scrollRef]
|
|
15384
15385
|
);
|
|
15385
15386
|
return useSyncExternalStore5(
|
|
15386
|
-
|
|
15387
|
+
subscribe2,
|
|
15387
15388
|
() => scrollingRef.current ? null : settledRef.current,
|
|
15388
15389
|
() => null
|
|
15389
15390
|
);
|
|
@@ -15789,8 +15790,8 @@ var FADE_KEYS = {
|
|
|
15789
15790
|
End: (_current, _step, limit) => limit,
|
|
15790
15791
|
Enter: (current2) => current2 === 0 ? DEFAULT_FADE_SECONDS : null
|
|
15791
15792
|
};
|
|
15792
|
-
function keyedFadeSeconds(
|
|
15793
|
-
return FADE_KEYS[
|
|
15793
|
+
function keyedFadeSeconds(key, shift, current2, limit) {
|
|
15794
|
+
return FADE_KEYS[key]?.(current2, shift ? 1 : 0.1, limit) ?? null;
|
|
15794
15795
|
}
|
|
15795
15796
|
function TimelineClipFades({
|
|
15796
15797
|
el,
|
|
@@ -16190,7 +16191,7 @@ function useThumbnailLease(request2, scheduler = thumbnailScheduler) {
|
|
|
16190
16191
|
const leaseRef = useRef30(null);
|
|
16191
16192
|
const identity = request2 ? createThumbnailRequestIdentity(request2) : null;
|
|
16192
16193
|
const priority = request2?.priority;
|
|
16193
|
-
const
|
|
16194
|
+
const subscribe2 = useCallback25(
|
|
16194
16195
|
(listener2) => {
|
|
16195
16196
|
const current2 = requestRef.current;
|
|
16196
16197
|
if (!current2 || identity === null) return () => {
|
|
@@ -16211,7 +16212,7 @@ function useThumbnailLease(request2, scheduler = thumbnailScheduler) {
|
|
|
16211
16212
|
useLayoutEffect8(() => {
|
|
16212
16213
|
if (priority) leaseRef.current?.updatePriority(priority);
|
|
16213
16214
|
}, [priority]);
|
|
16214
|
-
return useSyncExternalStore6(
|
|
16215
|
+
return useSyncExternalStore6(subscribe2, getSnapshot, () => IDLE);
|
|
16215
16216
|
}
|
|
16216
16217
|
|
|
16217
16218
|
// src/hooks/useThumbnailStripSize.ts
|
|
@@ -16235,7 +16236,7 @@ var merge = (prev, patch) => {
|
|
|
16235
16236
|
const width = next.width > 0 ? Math.ceil(next.width) : Infinity;
|
|
16236
16237
|
next.inViewStart = isShort(width) ? 0 : Math.min(next.inViewStart, width);
|
|
16237
16238
|
next.inViewEnd = isShort(width) ? width : Math.min(next.inViewEnd, width);
|
|
16238
|
-
return Object.keys(next).every((
|
|
16239
|
+
return Object.keys(next).every((key) => next[key] === prev[key]) ? prev : next;
|
|
16239
16240
|
};
|
|
16240
16241
|
var NEAR_PX = IN_VIEW_CHUNK_PX / 2;
|
|
16241
16242
|
var strips = /* @__PURE__ */ new Map();
|
|
@@ -17096,9 +17097,9 @@ function patchInlineStyleInTag(tag, prop, value) {
|
|
|
17096
17097
|
for (const part of splitInlineStyleDeclarations(existingStyle)) {
|
|
17097
17098
|
const colon = part.indexOf(":");
|
|
17098
17099
|
if (colon < 0) continue;
|
|
17099
|
-
const
|
|
17100
|
+
const key = part.slice(0, colon).trim();
|
|
17100
17101
|
const val = part.slice(colon + 1).trim();
|
|
17101
|
-
if (
|
|
17102
|
+
if (key) props.set(key, val);
|
|
17102
17103
|
}
|
|
17103
17104
|
if (value === null) {
|
|
17104
17105
|
props.delete(prop);
|
|
@@ -17418,7 +17419,6 @@ async function writeProjectFilesWithHistoryInQueue({
|
|
|
17418
17419
|
}
|
|
17419
17420
|
|
|
17420
17421
|
// src/utils/gsapSoftReload.ts
|
|
17421
|
-
import { COLOR_GRADING_SOURCE_HIDDEN_ATTR as COLOR_GRADING_SOURCE_HIDDEN_ATTR2 } from "@hyperframes/core/color-grading";
|
|
17422
17422
|
import { parseGsapScript as parseGsapScript2 } from "@hyperframes/parsers/gsap-parser";
|
|
17423
17423
|
import { GSAP_BASE_URL_META, motionPathPluginUrl } from "@hyperframes/core/gsap-cdn";
|
|
17424
17424
|
|
|
@@ -17560,9 +17560,9 @@ function elementTargets(tween) {
|
|
|
17560
17560
|
var NESTED_VARS = /* @__PURE__ */ new Set(["css", "startAt", "keyframes"]);
|
|
17561
17561
|
function tweenedProps(vars) {
|
|
17562
17562
|
if (!vars || typeof vars !== "object") return [];
|
|
17563
|
-
return Object.entries(vars).flatMap(([
|
|
17564
|
-
|
|
17565
|
-
...NESTED_VARS.has(
|
|
17563
|
+
return Object.entries(vars).flatMap(([key, value]) => [
|
|
17564
|
+
key.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`),
|
|
17565
|
+
...NESTED_VARS.has(key) || /^\d|%$/.test(key) ? tweenedProps(value) : []
|
|
17566
17566
|
]);
|
|
17567
17567
|
}
|
|
17568
17568
|
function ownTweens(tl, nested) {
|
|
@@ -17586,11 +17586,11 @@ function collectResetTargets(win, doc, targetKeys, outgoingScripts = []) {
|
|
|
17586
17586
|
const targets = /* @__PURE__ */ new Map();
|
|
17587
17587
|
const timelines = win.__timelines ?? {};
|
|
17588
17588
|
const others = new Set(
|
|
17589
|
-
Object.entries(timelines).flatMap(([
|
|
17589
|
+
Object.entries(timelines).flatMap(([key, tl]) => targetKeys.includes(key) ? [] : [tl])
|
|
17590
17590
|
);
|
|
17591
|
-
for (const
|
|
17591
|
+
for (const key of targetKeys) {
|
|
17592
17592
|
try {
|
|
17593
|
-
for (const tween of ownTweens(timelines[
|
|
17593
|
+
for (const tween of ownTweens(timelines[key] ?? {}, others)) addTweenTargets(tween, targets);
|
|
17594
17594
|
} catch {
|
|
17595
17595
|
}
|
|
17596
17596
|
}
|
|
@@ -17611,11 +17611,11 @@ function tweenTargetsIn(timelines) {
|
|
|
17611
17611
|
}
|
|
17612
17612
|
return els;
|
|
17613
17613
|
}
|
|
17614
|
-
function compositionRoot(doc,
|
|
17615
|
-
return doc.querySelectorAll(`[data-composition-id="${CSS.escape(
|
|
17614
|
+
function compositionRoot(doc, key) {
|
|
17615
|
+
return doc.querySelectorAll(`[data-composition-id="${CSS.escape(key)}"]`)[0];
|
|
17616
17616
|
}
|
|
17617
17617
|
function compositionFile(doc, targetKeys) {
|
|
17618
|
-
const root = targetKeys.map((
|
|
17618
|
+
const root = targetKeys.map((key) => compositionRoot(doc, key)).find(Boolean);
|
|
17619
17619
|
return root?.closest("[data-composition-file]")?.getAttribute("data-composition-file") ?? null;
|
|
17620
17620
|
}
|
|
17621
17621
|
function sweepHeldElements(doc, targetKeys, others, targets) {
|
|
@@ -17758,7 +17758,7 @@ function verifyTimelinesPopulated(win, targetKeys) {
|
|
|
17758
17758
|
const timelines = win.__timelines;
|
|
17759
17759
|
if (!timelines) return false;
|
|
17760
17760
|
if (targetKeys.length > 0) {
|
|
17761
|
-
return targetKeys.every((
|
|
17761
|
+
return targetKeys.every((key) => timelines[key] != null);
|
|
17762
17762
|
}
|
|
17763
17763
|
return Object.keys(timelines).filter((k) => k !== "__proxied").length > 0;
|
|
17764
17764
|
}
|
|
@@ -17823,13 +17823,13 @@ function repaintDroppedTweenStyle(win, doc, authored, targetKeys, restoredScript
|
|
|
17823
17823
|
}
|
|
17824
17824
|
}
|
|
17825
17825
|
function timelineKeys(scriptText) {
|
|
17826
|
-
return [...scriptText.matchAll(/__timelines\s*\[\s*["'`]([^"'`]+)["'`]\s*\]/g)].map((m) => m[1]).filter((
|
|
17826
|
+
return [...scriptText.matchAll(/__timelines\s*\[\s*["'`]([^"'`]+)["'`]\s*\]/g)].map((m) => m[1]).filter((key) => key !== "__proxied");
|
|
17827
17827
|
}
|
|
17828
17828
|
function scriptsRegistering(scripts, keys) {
|
|
17829
17829
|
return scripts.filter((script) => {
|
|
17830
17830
|
const text3 = script.textContent || "";
|
|
17831
17831
|
return keys.some(
|
|
17832
|
-
(
|
|
17832
|
+
(key) => text3.includes(`__timelines["${key}"]`) || text3.includes(`__timelines['${key}']`)
|
|
17833
17833
|
);
|
|
17834
17834
|
});
|
|
17835
17835
|
}
|
|
@@ -17866,15 +17866,15 @@ function applySoftReload(iframe, scriptText, options = {}) {
|
|
|
17866
17866
|
staleScripts.map((script) => script.textContent ?? "")
|
|
17867
17867
|
);
|
|
17868
17868
|
if (timelines) {
|
|
17869
|
-
for (const
|
|
17870
|
-
const tl = timelines[
|
|
17869
|
+
for (const key of targetKeys) {
|
|
17870
|
+
const tl = timelines[key];
|
|
17871
17871
|
if (!tl) continue;
|
|
17872
17872
|
try {
|
|
17873
17873
|
tl.clear?.();
|
|
17874
17874
|
tl.kill?.();
|
|
17875
17875
|
} catch {
|
|
17876
17876
|
}
|
|
17877
|
-
delete timelines[
|
|
17877
|
+
delete timelines[key];
|
|
17878
17878
|
}
|
|
17879
17879
|
}
|
|
17880
17880
|
const allTargets = [...targets.keys()];
|
|
@@ -17888,11 +17888,7 @@ function applySoftReload(iframe, scriptText, options = {}) {
|
|
|
17888
17888
|
s.cssText = css2;
|
|
17889
17889
|
restoreAuthoredStyle(s, findAuthoredStyle(el), targets.get(el));
|
|
17890
17890
|
const authored = readAuthoredOpacity(el);
|
|
17891
|
-
if (authored !== null)
|
|
17892
|
-
applyAuthoredInlineOpacity(s, authored);
|
|
17893
|
-
} else if (el.hasAttribute(COLOR_GRADING_SOURCE_HIDDEN_ATTR2) && s.getPropertyValue("opacity") === "0" && s.getPropertyPriority("opacity") === "important") {
|
|
17894
|
-
s.removeProperty("opacity");
|
|
17895
|
-
}
|
|
17891
|
+
if (authored !== null) applyAuthoredInlineOpacity(s, authored);
|
|
17896
17892
|
}
|
|
17897
17893
|
}
|
|
17898
17894
|
forgetLiveSets(targets);
|
|
@@ -18133,9 +18129,9 @@ function planLiveRetime(before, after) {
|
|
|
18133
18129
|
}
|
|
18134
18130
|
function planLiveRetimeFromPreview(iframe, after) {
|
|
18135
18131
|
const doc = iframe?.contentDocument;
|
|
18136
|
-
const [
|
|
18137
|
-
if (!doc || !
|
|
18138
|
-
const [script, ...extra] = scriptsRegistering(findGsapScriptElements(doc), [
|
|
18132
|
+
const [key] = timelineKeys(after);
|
|
18133
|
+
if (!doc || !key) return RERUN;
|
|
18134
|
+
const [script, ...extra] = scriptsRegistering(findGsapScriptElements(doc), [key]);
|
|
18139
18135
|
if (!script || extra.length > 0) return RERUN;
|
|
18140
18136
|
const plan = planLiveRetime(script.textContent ?? "", after);
|
|
18141
18137
|
return plan.kind === "retime" ? { ...plan, script } : RERUN;
|
|
@@ -18565,8 +18561,8 @@ function deleteSelectedKeyframes(session) {
|
|
|
18565
18561
|
const fallbackAnimation = keyframedAnimations.length === 1 ? keyframedAnimations[0] : void 0;
|
|
18566
18562
|
const animationsById = new Map(keyframedAnimations.map((animation2) => [animation2.id, animation2]));
|
|
18567
18563
|
const removals = /* @__PURE__ */ new Map();
|
|
18568
|
-
for (const
|
|
18569
|
-
const target = timelineKeyframeTargetFromSelectionKey(selectedElementId,
|
|
18564
|
+
for (const key of selectedKeyframes) {
|
|
18565
|
+
const target = timelineKeyframeTargetFromSelectionKey(selectedElementId, key);
|
|
18570
18566
|
if (!target) continue;
|
|
18571
18567
|
const animation2 = target.animationId ? animationsById.get(target.animationId) : fallbackAnimation;
|
|
18572
18568
|
if (!animation2) continue;
|
|
@@ -19651,8 +19647,8 @@ import { jsx as jsx37 } from "react/jsx-runtime";
|
|
|
19651
19647
|
var sameCapabilities = (a, b) => a.canMove === b.canMove && a.canTrimStart === b.canTrimStart && a.canTrimEnd === b.canTrimEnd && a.readOnly === b.readOnly;
|
|
19652
19648
|
var zoomKey = (p) => clipZoomKey(p.previewElement, p.pps, p.isSelected || p.isHovered);
|
|
19653
19649
|
function sameClip(prev, next) {
|
|
19654
|
-
for (const
|
|
19655
|
-
if (
|
|
19650
|
+
for (const key of Object.keys(next)) {
|
|
19651
|
+
if (key === "pps" || key === "capabilities" || prev[key] === next[key]) continue;
|
|
19656
19652
|
return false;
|
|
19657
19653
|
}
|
|
19658
19654
|
return sameCapabilities(prev.capabilities, next.capabilities) && zoomKey(prev) === zoomKey(next);
|
|
@@ -21430,10 +21426,10 @@ function TimelineAutomationLaneSlot({
|
|
|
21430
21426
|
const rowsByClip = /* @__PURE__ */ new Map();
|
|
21431
21427
|
groupAutomationLanes(clips).forEach((group, rowIndex) => {
|
|
21432
21428
|
for (const entry3 of group.entries) {
|
|
21433
|
-
const
|
|
21434
|
-
const rows = rowsByClip.get(
|
|
21429
|
+
const key = getTimelineElementIdentity(entry3.element);
|
|
21430
|
+
const rows = rowsByClip.get(key);
|
|
21435
21431
|
if (rows) rows.push({ lane: entry3.lane, rowIndex });
|
|
21436
|
-
else rowsByClip.set(
|
|
21432
|
+
else rowsByClip.set(key, [{ lane: entry3.lane, rowIndex }]);
|
|
21437
21433
|
}
|
|
21438
21434
|
});
|
|
21439
21435
|
const top = topOffset ?? getTimelineLaneTop(laneCount);
|
|
@@ -21767,7 +21763,7 @@ function resolveTimelineIdForSelection(selection, elements, activeCompPath, byCl
|
|
|
21767
21763
|
);
|
|
21768
21764
|
}
|
|
21769
21765
|
function timelineKeysForSelections(selections, elements, activeCompPath) {
|
|
21770
|
-
return selections.map((selection) => resolveTimelineIdForSelection(selection, elements, activeCompPath)).filter((
|
|
21766
|
+
return selections.map((selection) => resolveTimelineIdForSelection(selection, elements, activeCompPath)).filter((key) => key !== null);
|
|
21771
21767
|
}
|
|
21772
21768
|
function resolveTimelineSelectionSeekTime(currentTime, element) {
|
|
21773
21769
|
if (!element) return null;
|
|
@@ -21846,9 +21842,9 @@ import { isTypingTarget as isTypingTarget4 } from "@hyperframes/core/typing-targ
|
|
|
21846
21842
|
function elementKeyOf(element) {
|
|
21847
21843
|
return element.key ?? element.id;
|
|
21848
21844
|
}
|
|
21849
|
-
function findElement(elements,
|
|
21850
|
-
if (!
|
|
21851
|
-
return elements.find((el) => elementKeyOf(el) ===
|
|
21845
|
+
function findElement(elements, key) {
|
|
21846
|
+
if (!key) return null;
|
|
21847
|
+
return elements.find((el) => elementKeyOf(el) === key) ?? null;
|
|
21852
21848
|
}
|
|
21853
21849
|
function resolveSelectionContext(state, lanes, sel) {
|
|
21854
21850
|
const element = findElement(state.elements, sel.elementKey);
|
|
@@ -24066,14 +24062,14 @@ function useTimelineClipDisclosure() {
|
|
|
24066
24062
|
const toggleClipExpanded = usePlayerStore((s) => s.toggleClipExpanded);
|
|
24067
24063
|
return {
|
|
24068
24064
|
toggleRowExpanded: (keys) => {
|
|
24069
|
-
const willExpand = !keys.some((
|
|
24065
|
+
const willExpand = !keys.some((key) => expandedClipIds.has(key));
|
|
24070
24066
|
trackStudioKeyframeLaneExpand({ expanded: willExpand });
|
|
24071
24067
|
if (willExpand) expandClips(keys);
|
|
24072
|
-
else for (const
|
|
24068
|
+
else for (const key of keys) setClipExpanded(key, false);
|
|
24073
24069
|
},
|
|
24074
|
-
toggleClipExpanded: (
|
|
24075
|
-
trackStudioKeyframeLaneExpand({ expanded: !expandedClipIds.has(
|
|
24076
|
-
toggleClipExpanded(
|
|
24070
|
+
toggleClipExpanded: (key) => {
|
|
24071
|
+
trackStudioKeyframeLaneExpand({ expanded: !expandedClipIds.has(key) });
|
|
24072
|
+
toggleClipExpanded(key);
|
|
24077
24073
|
}
|
|
24078
24074
|
};
|
|
24079
24075
|
}
|
|
@@ -24669,8 +24665,8 @@ function TimelineLanes({
|
|
|
24669
24665
|
{
|
|
24670
24666
|
elements: automationElements,
|
|
24671
24667
|
isSelected: (element) => {
|
|
24672
|
-
const
|
|
24673
|
-
return selectedElementId ===
|
|
24668
|
+
const key = getTimelineElementIdentity(element);
|
|
24669
|
+
return selectedElementId === key || selectedElementIds.has(key);
|
|
24674
24670
|
},
|
|
24675
24671
|
lanes: automationLanes,
|
|
24676
24672
|
pps,
|
|
@@ -25275,7 +25271,7 @@ function normalizeToastText(plan) {
|
|
|
25275
25271
|
function isNormalizePlan(value) {
|
|
25276
25272
|
if (typeof value !== "object" || value === null) return false;
|
|
25277
25273
|
return ["targetLufs", "projectedLufs", "volume", "changeDb"].every(
|
|
25278
|
-
(
|
|
25274
|
+
(key) => typeof Reflect.get(value, key) === "number"
|
|
25279
25275
|
);
|
|
25280
25276
|
}
|
|
25281
25277
|
async function requestNormalizePlan(projectId, el, fetchImpl = studioApiFetch) {
|
|
@@ -25469,8 +25465,8 @@ function AudioGainDialog({
|
|
|
25469
25465
|
}
|
|
25470
25466
|
const byKey = new Map(elements.map((el) => [keyOf10(el), el]));
|
|
25471
25467
|
const plan = planAudioGain(clips, { mode, db: values[mode] });
|
|
25472
|
-
const edits = plan.flatMap(({ key
|
|
25473
|
-
const element = byKey.get(
|
|
25468
|
+
const edits = plan.flatMap(({ key, gain }) => {
|
|
25469
|
+
const element = byKey.get(key);
|
|
25474
25470
|
return element ? [{ element, gain }] : [];
|
|
25475
25471
|
});
|
|
25476
25472
|
await writeClipGains(edits, edit, AUDIO_GAIN_LABEL);
|
|
@@ -25645,17 +25641,17 @@ import { jsx as jsx65, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
|
25645
25641
|
function draftKey(start, end) {
|
|
25646
25642
|
return `hf-edit-draft:${start.toFixed(2)}:${end.toFixed(2)}`;
|
|
25647
25643
|
}
|
|
25648
|
-
function readDraft(
|
|
25644
|
+
function readDraft(key) {
|
|
25649
25645
|
try {
|
|
25650
|
-
return sessionStorage.getItem(
|
|
25646
|
+
return sessionStorage.getItem(key) ?? "";
|
|
25651
25647
|
} catch {
|
|
25652
25648
|
return "";
|
|
25653
25649
|
}
|
|
25654
25650
|
}
|
|
25655
|
-
function writeDraft(
|
|
25651
|
+
function writeDraft(key, value) {
|
|
25656
25652
|
try {
|
|
25657
|
-
if (value) sessionStorage.setItem(
|
|
25658
|
-
else sessionStorage.removeItem(
|
|
25653
|
+
if (value) sessionStorage.setItem(key, value);
|
|
25654
|
+
else sessionStorage.removeItem(key);
|
|
25659
25655
|
} catch {
|
|
25660
25656
|
}
|
|
25661
25657
|
}
|
|
@@ -26571,7 +26567,7 @@ function formatBoundingBox(bounds) {
|
|
|
26571
26567
|
return `x=${Math.round(bounds.x)}, y=${Math.round(bounds.y)}, width=${Math.round(bounds.width)}, height=${Math.round(bounds.height)}`;
|
|
26572
26568
|
}
|
|
26573
26569
|
function formatStyleBlock(styles) {
|
|
26574
|
-
return Object.entries(styles).filter(([, value]) => value && value !== "initial").map(([
|
|
26570
|
+
return Object.entries(styles).filter(([, value]) => value && value !== "initial").map(([key, value]) => `${key}: ${value}`).join("\n");
|
|
26575
26571
|
}
|
|
26576
26572
|
function formatTextFields(fields) {
|
|
26577
26573
|
return fields.map(
|
|
@@ -28060,38 +28056,38 @@ function use(frame3) {
|
|
|
28060
28056
|
if (frame3.users++ === 0 && released.delete(frame3)) releasedBytes -= frame3.bytes;
|
|
28061
28057
|
return frame3;
|
|
28062
28058
|
}
|
|
28063
|
-
function takeSharedFrame(
|
|
28064
|
-
const frame3 = sharedFrames.get(
|
|
28059
|
+
function takeSharedFrame(key, accepts2) {
|
|
28060
|
+
const frame3 = sharedFrames.get(key)?.find((shared2) => accepts2(shared2.decodedAt));
|
|
28065
28061
|
return frame3 && use(frame3);
|
|
28066
28062
|
}
|
|
28067
|
-
function shareFrame(
|
|
28068
|
-
const frames = sharedFrames.get(
|
|
28063
|
+
function shareFrame(key, decodedAt, url, bytes) {
|
|
28064
|
+
const frames = sharedFrames.get(key) ?? [];
|
|
28069
28065
|
const existing = frames.find((shared2) => shared2.decodedAt === decodedAt);
|
|
28070
28066
|
if (existing) {
|
|
28071
28067
|
URL.revokeObjectURL(url);
|
|
28072
28068
|
return use(existing);
|
|
28073
28069
|
}
|
|
28074
28070
|
const frame3 = { url, decodedAt, bytes, users: 1 };
|
|
28075
|
-
sharedFrames.set(
|
|
28071
|
+
sharedFrames.set(key, [...frames, frame3]);
|
|
28076
28072
|
return frame3;
|
|
28077
28073
|
}
|
|
28078
|
-
function evict(frame3,
|
|
28074
|
+
function evict(frame3, key) {
|
|
28079
28075
|
released.delete(frame3);
|
|
28080
28076
|
releasedBytes -= frame3.bytes;
|
|
28081
|
-
const rest = sharedFrames.get(
|
|
28082
|
-
if (rest.length > 0) sharedFrames.set(
|
|
28083
|
-
else sharedFrames.delete(
|
|
28077
|
+
const rest = sharedFrames.get(key)?.filter((shared2) => shared2 !== frame3) ?? [];
|
|
28078
|
+
if (rest.length > 0) sharedFrames.set(key, rest);
|
|
28079
|
+
else sharedFrames.delete(key);
|
|
28084
28080
|
URL.revokeObjectURL(frame3.url);
|
|
28085
28081
|
}
|
|
28086
28082
|
function releaseSharedFrames(held, budgetBytes) {
|
|
28087
|
-
for (const { key
|
|
28083
|
+
for (const { key, frame: frame3 } of held.splice(0)) {
|
|
28088
28084
|
if (--frame3.users > 0) continue;
|
|
28089
|
-
released.set(frame3,
|
|
28085
|
+
released.set(frame3, key);
|
|
28090
28086
|
releasedBytes += frame3.bytes;
|
|
28091
28087
|
}
|
|
28092
|
-
for (const [frame3,
|
|
28088
|
+
for (const [frame3, key] of released) {
|
|
28093
28089
|
if (releasedBytes <= budgetBytes) break;
|
|
28094
|
-
evict(frame3,
|
|
28090
|
+
evict(frame3, key);
|
|
28095
28091
|
}
|
|
28096
28092
|
}
|
|
28097
28093
|
|
|
@@ -28140,7 +28136,7 @@ function laterOf(own, theirs) {
|
|
|
28140
28136
|
}
|
|
28141
28137
|
function savedEtagsButThisTabsMoves(mine, theirs) {
|
|
28142
28138
|
const etags = { ...mine, ...theirs };
|
|
28143
|
-
for (const
|
|
28139
|
+
for (const key of sourcesThisTabMovedOn) etags[key] = mine[key];
|
|
28144
28140
|
sourcesThisTabMovedOn.clear();
|
|
28145
28141
|
return etags;
|
|
28146
28142
|
}
|
|
@@ -28179,15 +28175,15 @@ var storedVersion = (source) => quietly(async () => {
|
|
|
28179
28175
|
return response.status === 304 ? { source, etag } : void 0;
|
|
28180
28176
|
});
|
|
28181
28177
|
var rememberVersion = (stored) => quietly(async () => {
|
|
28182
|
-
const
|
|
28178
|
+
const key = await digest(stored.source);
|
|
28183
28179
|
const saved2 = loadIndex();
|
|
28184
|
-
if (saved2.etags[
|
|
28185
|
-
saved2.etags[
|
|
28186
|
-
sourcesThisTabMovedOn.add(
|
|
28180
|
+
if (saved2.etags[key] === stored.etag) return;
|
|
28181
|
+
saved2.etags[key] = stored.etag;
|
|
28182
|
+
sourcesThisTabMovedOn.add(key);
|
|
28187
28183
|
saveIndexSoon();
|
|
28188
28184
|
const keep = await cacheNameOf(stored);
|
|
28189
28185
|
for (const name of await caches.keys()) {
|
|
28190
|
-
if (!name.startsWith(`${CACHE_PREFIX}${
|
|
28186
|
+
if (!name.startsWith(`${CACHE_PREFIX}${key}:`) || name === keep) continue;
|
|
28191
28187
|
await caches.delete(name);
|
|
28192
28188
|
delete saved2.caches[name];
|
|
28193
28189
|
dropped.add(name);
|
|
@@ -28343,11 +28339,11 @@ function stripTimes(request2, info, budgets) {
|
|
|
28343
28339
|
function takeDecodedFrames({ timestamps, window: window2 }, keyOf17, resources) {
|
|
28344
28340
|
const missing = [];
|
|
28345
28341
|
timestamps.forEach((time, slot) => {
|
|
28346
|
-
const
|
|
28347
|
-
const frame3 = takeSharedFrame(
|
|
28342
|
+
const key = keyOf17(time);
|
|
28343
|
+
const frame3 = takeSharedFrame(key, (decodedAt) => accepts(window2, time, decodedAt));
|
|
28348
28344
|
if (!frame3) return void missing.push(slot);
|
|
28349
28345
|
resources.urls[slot] = frame3.url;
|
|
28350
|
-
resources.held.push({ key
|
|
28346
|
+
resources.held.push({ key, frame: frame3 });
|
|
28351
28347
|
});
|
|
28352
28348
|
return missing;
|
|
28353
28349
|
}
|
|
@@ -28397,10 +28393,10 @@ async function takeStoredFrames({ timestamps, window: window2 }, slots, keyOf17,
|
|
|
28397
28393
|
const time = timestamps[slot];
|
|
28398
28394
|
const hit = found[i];
|
|
28399
28395
|
if (!hit || !accepts(window2, time, hit.decodedAt)) return true;
|
|
28400
|
-
const
|
|
28401
|
-
const frame3 = shareFrame(
|
|
28396
|
+
const key = keyOf17(time);
|
|
28397
|
+
const frame3 = shareFrame(key, hit.decodedAt, URL.createObjectURL(hit.blob), hit.blob.size);
|
|
28402
28398
|
resources.urls[slot] = frame3.url;
|
|
28403
|
-
resources.held.push({ key
|
|
28399
|
+
resources.held.push({ key, frame: frame3 });
|
|
28404
28400
|
return false;
|
|
28405
28401
|
});
|
|
28406
28402
|
}
|
|
@@ -28492,9 +28488,9 @@ async function decodeMissingFrames(request2, signal, budgets, keyOf17, resources
|
|
|
28492
28488
|
async function* decodeTimesAtNearbyKeyframes() {
|
|
28493
28489
|
for (const target2 of slots) {
|
|
28494
28490
|
const time = timestamps[target2.slot];
|
|
28495
|
-
const
|
|
28491
|
+
const key = await keys.getKeyPacket(time, { metadataOnly: true });
|
|
28496
28492
|
if (signal.aborted) return;
|
|
28497
|
-
target2.decodedAt =
|
|
28493
|
+
target2.decodedAt = key && accepts(window2, time, key.timestamp) ? key.timestamp : time;
|
|
28498
28494
|
yield target2.decodedAt;
|
|
28499
28495
|
}
|
|
28500
28496
|
}
|
|
@@ -28908,14 +28904,14 @@ var initialState = {
|
|
|
28908
28904
|
};
|
|
28909
28905
|
var lastHistoryKey = null;
|
|
28910
28906
|
var lastHistoryAt = 0;
|
|
28911
|
-
function pushHistory(state,
|
|
28907
|
+
function pushHistory(state, key) {
|
|
28912
28908
|
if (!state.model) return {};
|
|
28913
28909
|
const now2 = Date.now();
|
|
28914
|
-
if (lastHistoryKey ===
|
|
28910
|
+
if (lastHistoryKey === key && now2 - lastHistoryAt < HISTORY_COALESCE_MS) {
|
|
28915
28911
|
lastHistoryAt = now2;
|
|
28916
28912
|
return { future: [] };
|
|
28917
28913
|
}
|
|
28918
|
-
lastHistoryKey =
|
|
28914
|
+
lastHistoryKey = key;
|
|
28919
28915
|
lastHistoryAt = now2;
|
|
28920
28916
|
const past = [...state.past, state.model].slice(-HISTORY_CAP);
|
|
28921
28917
|
return { past, future: [] };
|
|
@@ -29239,6 +29235,22 @@ function ignoresPlaybackKey(e) {
|
|
|
29239
29235
|
selectedCaptionSegmentCount: captionState.selectedSegmentIds.size
|
|
29240
29236
|
});
|
|
29241
29237
|
}
|
|
29238
|
+
function forwardSealedFrameKeys(iframe, keyDown, keyUp) {
|
|
29239
|
+
const client = previewEditingClient(iframe);
|
|
29240
|
+
const watch = (combos) => void client.request("watch-keys", { combos }).catch(() => {
|
|
29241
|
+
});
|
|
29242
|
+
const watchPlayback = () => watch(PLAYBACK_ACTIONS.map(getStudioKey));
|
|
29243
|
+
watchPlayback();
|
|
29244
|
+
const stopRebinds = subscribeStudioKeys(watchPlayback);
|
|
29245
|
+
const stopKeys = client.onKey(
|
|
29246
|
+
(key) => (key.type === "keydown" ? keyDown : keyUp).current(new KeyboardEvent(key.type, key))
|
|
29247
|
+
);
|
|
29248
|
+
return () => {
|
|
29249
|
+
stopRebinds();
|
|
29250
|
+
stopKeys();
|
|
29251
|
+
watch([]);
|
|
29252
|
+
};
|
|
29253
|
+
}
|
|
29242
29254
|
function handleWorkAreaKey(e, action, getAdapter, seek) {
|
|
29243
29255
|
const store = usePlayerStore.getState();
|
|
29244
29256
|
const time = () => getAdapter()?.getTime() ?? store.currentTime;
|
|
@@ -29353,6 +29365,15 @@ function usePlaybackKeyboard({
|
|
|
29353
29365
|
const attachIframeShortcutListeners = useCallback37(() => {
|
|
29354
29366
|
iframeShortcutCleanupRef.current?.();
|
|
29355
29367
|
iframeShortcutCleanupRef.current = null;
|
|
29368
|
+
const iframe = iframeRef.current;
|
|
29369
|
+
if (iframe && previewFrameOpaque(iframe)) {
|
|
29370
|
+
iframeShortcutCleanupRef.current = forwardSealedFrameKeys(
|
|
29371
|
+
iframe,
|
|
29372
|
+
playbackKeyDownRef,
|
|
29373
|
+
playbackKeyUpRef
|
|
29374
|
+
);
|
|
29375
|
+
return;
|
|
29376
|
+
}
|
|
29356
29377
|
let iframeWin = null;
|
|
29357
29378
|
let iframeDoc = null;
|
|
29358
29379
|
try {
|
|
@@ -30339,11 +30360,10 @@ function isPreviewReadinessMessage(e, iframe) {
|
|
|
30339
30360
|
if (data?.type !== "state" && data?.type !== "timeline") return false;
|
|
30340
30361
|
return inspectStudioRuntimeMessage(data).status !== "unsupported";
|
|
30341
30362
|
}
|
|
30342
|
-
function normalizePreviewDom(doc, iframeWin
|
|
30363
|
+
function normalizePreviewDom(doc, iframeWin) {
|
|
30343
30364
|
if (!doc || !iframeWin) return;
|
|
30344
30365
|
normalizePreviewViewport(doc, iframeWin);
|
|
30345
30366
|
autoHealMissingCompositionIds(doc);
|
|
30346
|
-
attachIframeShortcutListeners();
|
|
30347
30367
|
}
|
|
30348
30368
|
function applyRuntimeClipManifest(iframeWin, processTimelineMessage) {
|
|
30349
30369
|
const manifest = iframeWin?.__clipManifest;
|
|
@@ -30354,7 +30374,8 @@ function hydrateTimelineFromPreview(input) {
|
|
|
30354
30374
|
try {
|
|
30355
30375
|
const doc = safeContentDocument(iframe);
|
|
30356
30376
|
const iframeWin = iframe?.contentWindow ?? null;
|
|
30357
|
-
normalizePreviewDom(doc, iframeWin
|
|
30377
|
+
normalizePreviewDom(doc, iframeWin);
|
|
30378
|
+
input.attachIframeShortcutListeners();
|
|
30358
30379
|
applyRuntimeClipManifest(iframeWin, input.processTimelineMessage);
|
|
30359
30380
|
input.enrichMissingCompositions();
|
|
30360
30381
|
input.applyPreviewAudioState();
|
|
@@ -30379,6 +30400,9 @@ function planShadowReload(slots, nextGen, url) {
|
|
|
30379
30400
|
const live = slots.find((slot) => slot.role === "live");
|
|
30380
30401
|
return live ? [live, { gen: nextGen, role: "shadow", url }] : [{ gen: nextGen, role: "live" }];
|
|
30381
30402
|
}
|
|
30403
|
+
function planShadowAlone(nextGen, url) {
|
|
30404
|
+
return [{ gen: nextGen, role: "shadow", url }];
|
|
30405
|
+
}
|
|
30382
30406
|
function planShadowDiscard(slots) {
|
|
30383
30407
|
return slots.filter((slot) => slot.role === "live");
|
|
30384
30408
|
}
|
|
@@ -30673,9 +30697,9 @@ function withTweenIndex(run) {
|
|
|
30673
30697
|
}
|
|
30674
30698
|
function indexTweens(children) {
|
|
30675
30699
|
const index2 = { byElement: /* @__PURE__ */ new Map(), byId: /* @__PURE__ */ new Map() };
|
|
30676
|
-
const add = (map,
|
|
30677
|
-
const list = map.get(
|
|
30678
|
-
if (!list) map.set(
|
|
30700
|
+
const add = (map, key, tween) => {
|
|
30701
|
+
const list = map.get(key);
|
|
30702
|
+
if (!list) map.set(key, [tween]);
|
|
30679
30703
|
else if (list.at(-1) !== tween) list.push(tween);
|
|
30680
30704
|
};
|
|
30681
30705
|
for (const tween of children) {
|
|
@@ -30812,7 +30836,7 @@ function restoreAttributes(layer, attributes) {
|
|
|
30812
30836
|
if (layer.getAttribute(name) !== value) layer.setAttribute(name, value);
|
|
30813
30837
|
}
|
|
30814
30838
|
function restoreCache(live, cache2) {
|
|
30815
|
-
for (const
|
|
30839
|
+
for (const key of Object.keys(live)) if (!(key in cache2)) delete live[key];
|
|
30816
30840
|
Object.assign(live, cache2);
|
|
30817
30841
|
}
|
|
30818
30842
|
function parsedImplicitEndValue(tween) {
|
|
@@ -31203,7 +31227,7 @@ function gsapWritesRotation(el) {
|
|
|
31203
31227
|
function gsapHoldsTranslate(el) {
|
|
31204
31228
|
const cache2 = el._gsap;
|
|
31205
31229
|
return ["x", "y", "xPercent", "yPercent"].some(
|
|
31206
|
-
(
|
|
31230
|
+
(key) => !!Number.parseFloat(String(cache2?.[key]))
|
|
31207
31231
|
);
|
|
31208
31232
|
}
|
|
31209
31233
|
var BOX_CHANNELS = [
|
|
@@ -31771,6 +31795,19 @@ function useShadowReloadRetry(generation, url, begin) {
|
|
|
31771
31795
|
// src/player/hooks/useShadowPreviewReload.ts
|
|
31772
31796
|
var SHADOW_READY_TIMEOUT_MS = 15e3;
|
|
31773
31797
|
var SHADOW_READY_BUDGETS = 3;
|
|
31798
|
+
var STILL_RELEASE_MAX_MS = 3e3;
|
|
31799
|
+
function releaseAfterPaint(iframe, release2) {
|
|
31800
|
+
let done = false;
|
|
31801
|
+
const go = () => {
|
|
31802
|
+
if (done) return;
|
|
31803
|
+
done = true;
|
|
31804
|
+
release2();
|
|
31805
|
+
};
|
|
31806
|
+
setTimeout(go, STILL_RELEASE_MAX_MS);
|
|
31807
|
+
void (restoreSeekPainted(iframe) ?? Promise.resolve()).then(
|
|
31808
|
+
() => requestAnimationFrame(() => requestAnimationFrame(go))
|
|
31809
|
+
);
|
|
31810
|
+
}
|
|
31774
31811
|
function restoreSeekPainted(iframe) {
|
|
31775
31812
|
if (!iframe) return void 0;
|
|
31776
31813
|
if (previewFrameOpaque(iframe)) return previewSeekPainted(iframe, SHADOW_READY_TIMEOUT_MS);
|
|
@@ -31813,7 +31850,8 @@ function useShadowPreviewReload({
|
|
|
31813
31850
|
applyPreviewAudioState,
|
|
31814
31851
|
onPromoted,
|
|
31815
31852
|
onReloadFailed,
|
|
31816
|
-
handOverPlayback
|
|
31853
|
+
handOverPlayback,
|
|
31854
|
+
holdStill
|
|
31817
31855
|
}) {
|
|
31818
31856
|
const shadowIframeRef = useRef49(null);
|
|
31819
31857
|
const shadowProbeIntervalRef = useRef49(void 0);
|
|
@@ -31843,6 +31881,36 @@ function useShadowPreviewReload({
|
|
|
31843
31881
|
const promoteWhenReadyRef = useRef49(() => {
|
|
31844
31882
|
});
|
|
31845
31883
|
const [previewSlots, setPreviewSlots] = useState35([{ gen: 0, role: "live" }]);
|
|
31884
|
+
const slotsRef = useRef49(previewSlots);
|
|
31885
|
+
slotsRef.current = previewSlots;
|
|
31886
|
+
const holdStillRef = useRef49(holdStill);
|
|
31887
|
+
holdStillRef.current = holdStill;
|
|
31888
|
+
const heldRef = useRef49(null);
|
|
31889
|
+
const holdingUrlRef = useRef49(null);
|
|
31890
|
+
const holdTokenRef = useRef49(0);
|
|
31891
|
+
const restoringRef = useRef49(null);
|
|
31892
|
+
const dropRestoring = useCallback40(() => {
|
|
31893
|
+
const release2 = restoringRef.current;
|
|
31894
|
+
restoringRef.current = null;
|
|
31895
|
+
release2?.();
|
|
31896
|
+
}, []);
|
|
31897
|
+
const restoreLive = useCallback40(
|
|
31898
|
+
(held) => {
|
|
31899
|
+
dropRestoring();
|
|
31900
|
+
setPreviewSlots([held.liveSlot]);
|
|
31901
|
+
pendingSeekRef.current = held.time;
|
|
31902
|
+
restoringRef.current = held.release;
|
|
31903
|
+
setTimeout(() => {
|
|
31904
|
+
if (restoringRef.current === held.release) dropRestoring();
|
|
31905
|
+
}, SHADOW_READY_TIMEOUT_MS);
|
|
31906
|
+
},
|
|
31907
|
+
[pendingSeekRef, dropRestoring]
|
|
31908
|
+
);
|
|
31909
|
+
const onLiveLoaded = useCallback40(() => {
|
|
31910
|
+
const release2 = restoringRef.current;
|
|
31911
|
+
restoringRef.current = null;
|
|
31912
|
+
if (release2) releaseAfterPaint(iframeRef.current, release2);
|
|
31913
|
+
}, [iframeRef]);
|
|
31846
31914
|
const stopPendingShadow = useCallback40(() => {
|
|
31847
31915
|
clearTimeout(readyTimerRef.current);
|
|
31848
31916
|
budgetGenRef.current = null;
|
|
@@ -31863,7 +31931,10 @@ function useShadowPreviewReload({
|
|
|
31863
31931
|
shadowIframeRef.current = null;
|
|
31864
31932
|
isRefreshingRef.current = false;
|
|
31865
31933
|
pendingSeekRef.current = null;
|
|
31866
|
-
|
|
31934
|
+
const held = heldRef.current;
|
|
31935
|
+
heldRef.current = null;
|
|
31936
|
+
if (held) restoreLive(held);
|
|
31937
|
+
else setPreviewSlots(planShadowDiscard);
|
|
31867
31938
|
setPreviewReloading(false);
|
|
31868
31939
|
const message = `The preview did not reload (${cause}). It was still waiting for ${waitingFor}.${got} The previous preview is still showing.`;
|
|
31869
31940
|
logReload("shadow-failed", { cause, waitingFor });
|
|
@@ -31873,7 +31944,7 @@ function useShadowPreviewReload({
|
|
|
31873
31944
|
onReloadFailedRef.current?.(message);
|
|
31874
31945
|
retry.afterFailure(cause, failedGen);
|
|
31875
31946
|
},
|
|
31876
|
-
[stopPendingShadow, retry, isRefreshingRef, pendingSeekRef]
|
|
31947
|
+
[stopPendingShadow, retry, isRefreshingRef, pendingSeekRef, restoreLive]
|
|
31877
31948
|
);
|
|
31878
31949
|
const gestureSavesOnScreen = useCallback40(() => {
|
|
31879
31950
|
const liveDoc = iframeRef.current?.contentDocument;
|
|
@@ -31902,8 +31973,8 @@ function useShadowPreviewReload({
|
|
|
31902
31973
|
"gesture",
|
|
31903
31974
|
(retry2) => afterStudioManualEditGestures(liveDoc, retry2)
|
|
31904
31975
|
);
|
|
31905
|
-
|
|
31906
|
-
|
|
31976
|
+
const savesSame = heldRef.current !== null || gestureSavesOnScreen() === savesAtRequestRef.current;
|
|
31977
|
+
if (savesSame && studioFileRevision() === revisionAtRequestRef.current) return false;
|
|
31907
31978
|
if (isStudioEditSaving()) return waitThenRetry(gen, "save", afterStudioPendingEdits);
|
|
31908
31979
|
logReload("shadow-reloaded-after-gesture-save", { gen });
|
|
31909
31980
|
const url = new URL(shadowUrlRef.current, window.location.origin);
|
|
@@ -31925,9 +31996,11 @@ function useShadowPreviewReload({
|
|
|
31925
31996
|
if (!promotable || heldOrStale(gen)) return;
|
|
31926
31997
|
const { shadow, pending: pending2 } = promotable;
|
|
31927
31998
|
stopPendingShadow();
|
|
31999
|
+
const held = heldRef.current;
|
|
32000
|
+
heldRef.current = null;
|
|
31928
32001
|
const live = getAdapter();
|
|
31929
|
-
const liveTime2 = live?.getTime();
|
|
31930
|
-
const playing = usePlayerStore.getState().isPlaying;
|
|
32002
|
+
const liveTime2 = held ? held.time : live?.getTime();
|
|
32003
|
+
const playing = held ? held.playing : usePlayerStore.getState().isPlaying;
|
|
31931
32004
|
live?.pause();
|
|
31932
32005
|
const retired = iframeRef.current;
|
|
31933
32006
|
iframeRef.current = shadow;
|
|
@@ -31937,6 +32010,7 @@ function useShadowPreviewReload({
|
|
|
31937
32010
|
applyPreviewAudioState();
|
|
31938
32011
|
setPreviewSlots((prev) => planShadowPromotion(prev, gen));
|
|
31939
32012
|
if (liveTime2 != null) handOverPlaybackRef.current(liveTime2, playing);
|
|
32013
|
+
if (held) releaseAfterPaint(shadow, held.release);
|
|
31940
32014
|
announcePreviewPromoted({ retired, live: shadow });
|
|
31941
32015
|
onPromotedRef.current?.();
|
|
31942
32016
|
setPreviewReloading(false);
|
|
@@ -32044,8 +32118,8 @@ function useShadowPreviewReload({
|
|
|
32044
32118
|
logReload("shadow-reattached", { gen });
|
|
32045
32119
|
armReadyTimerRef.current(gen);
|
|
32046
32120
|
}, []);
|
|
32047
|
-
const
|
|
32048
|
-
(url) => {
|
|
32121
|
+
const startShadowReload = useCallback40(
|
|
32122
|
+
(url, alone) => {
|
|
32049
32123
|
retry.started();
|
|
32050
32124
|
shadowGenRef.current += 1;
|
|
32051
32125
|
const gen = shadowGenRef.current;
|
|
@@ -32056,11 +32130,49 @@ function useShadowPreviewReload({
|
|
|
32056
32130
|
savesAtRequestRef.current = gestureSavesOnScreen();
|
|
32057
32131
|
revisionAtRequestRef.current = studioFileRevision();
|
|
32058
32132
|
armReadyTimer(gen);
|
|
32059
|
-
setPreviewSlots(
|
|
32133
|
+
setPreviewSlots(
|
|
32134
|
+
(prev) => alone ? planShadowAlone(gen, url) : planShadowReload(prev, gen, url)
|
|
32135
|
+
);
|
|
32060
32136
|
setPreviewReloading(true);
|
|
32061
32137
|
},
|
|
32062
32138
|
[retry, stopPendingShadow, armReadyTimer, gestureSavesOnScreen]
|
|
32063
32139
|
);
|
|
32140
|
+
const beginShadowReload = useCallback40(
|
|
32141
|
+
(url) => {
|
|
32142
|
+
const live = iframeRef.current;
|
|
32143
|
+
const take = holdStillRef.current;
|
|
32144
|
+
if (heldRef.current || !take || !live?.isConnected) {
|
|
32145
|
+
startShadowReload(url, heldRef.current !== null);
|
|
32146
|
+
return;
|
|
32147
|
+
}
|
|
32148
|
+
if (holdingUrlRef.current !== null) {
|
|
32149
|
+
holdingUrlRef.current = url;
|
|
32150
|
+
return;
|
|
32151
|
+
}
|
|
32152
|
+
holdingUrlRef.current = url;
|
|
32153
|
+
const token = ++holdTokenRef.current;
|
|
32154
|
+
const playing = usePlayerStore.getState().isPlaying;
|
|
32155
|
+
getAdapter()?.pause();
|
|
32156
|
+
const time = getAdapter()?.getTime() ?? null;
|
|
32157
|
+
const liveSlot = slotsRef.current.find((slot) => slot.role === "live");
|
|
32158
|
+
void new Promise((resolve2) => resolve2(take(live))).catch(() => null).then((release2) => {
|
|
32159
|
+
if (token !== holdTokenRef.current) {
|
|
32160
|
+
release2?.();
|
|
32161
|
+
return;
|
|
32162
|
+
}
|
|
32163
|
+
const latest2 = holdingUrlRef.current ?? url;
|
|
32164
|
+
holdingUrlRef.current = null;
|
|
32165
|
+
if (release2 && liveSlot && iframeRef.current === live) {
|
|
32166
|
+
heldRef.current = { release: release2, time, playing, liveSlot, liveIframe: live };
|
|
32167
|
+
} else {
|
|
32168
|
+
release2?.();
|
|
32169
|
+
if (playing) getAdapter()?.play();
|
|
32170
|
+
}
|
|
32171
|
+
startShadowReload(latest2, heldRef.current !== null);
|
|
32172
|
+
});
|
|
32173
|
+
},
|
|
32174
|
+
[iframeRef, getAdapter, startShadowReload]
|
|
32175
|
+
);
|
|
32064
32176
|
beginShadowReloadRef.current = beginShadowReload;
|
|
32065
32177
|
const resetPreviewSlots = useCallback40(() => {
|
|
32066
32178
|
retry.cancel();
|
|
@@ -32070,9 +32182,15 @@ function useShadowPreviewReload({
|
|
|
32070
32182
|
isRefreshingRef.current = false;
|
|
32071
32183
|
pendingSeekRef.current = null;
|
|
32072
32184
|
usePlayerStore.getState().setTimelineReady(false);
|
|
32073
|
-
|
|
32185
|
+
const held = heldRef.current;
|
|
32186
|
+
heldRef.current = null;
|
|
32187
|
+
holdingUrlRef.current = null;
|
|
32188
|
+
holdTokenRef.current += 1;
|
|
32189
|
+
dropRestoring();
|
|
32190
|
+
setPreviewSlots(held ? [held.liveSlot] : planShadowDiscard);
|
|
32191
|
+
held?.release();
|
|
32074
32192
|
setPreviewReloading(false);
|
|
32075
|
-
}, [retry, stopPendingShadow, isRefreshingRef, pendingSeekRef]);
|
|
32193
|
+
}, [retry, stopPendingShadow, isRefreshingRef, pendingSeekRef, dropRestoring]);
|
|
32076
32194
|
useMountEffect(() => {
|
|
32077
32195
|
const onVisibilityChange = () => {
|
|
32078
32196
|
if (isDocumentHidden()) {
|
|
@@ -32087,6 +32205,10 @@ function useShadowPreviewReload({
|
|
|
32087
32205
|
document.removeEventListener("visibilitychange", onVisibilityChange);
|
|
32088
32206
|
retry.cancel();
|
|
32089
32207
|
stopPendingShadow();
|
|
32208
|
+
heldRef.current?.release();
|
|
32209
|
+
heldRef.current = null;
|
|
32210
|
+
holdTokenRef.current += 1;
|
|
32211
|
+
dropRestoring();
|
|
32090
32212
|
setPreviewReloading(false);
|
|
32091
32213
|
};
|
|
32092
32214
|
});
|
|
@@ -32098,7 +32220,8 @@ function useShadowPreviewReload({
|
|
|
32098
32220
|
setShadowIframeNode,
|
|
32099
32221
|
beginShadowReload,
|
|
32100
32222
|
resetPreviewSlots,
|
|
32101
|
-
previewGeneration
|
|
32223
|
+
previewGeneration,
|
|
32224
|
+
onLiveLoaded
|
|
32102
32225
|
};
|
|
32103
32226
|
}
|
|
32104
32227
|
|
|
@@ -32162,8 +32285,8 @@ function* timelineCandidates(iframe, win) {
|
|
|
32162
32285
|
const keys = win.__timelines ? Object.keys(win.__timelines) : [];
|
|
32163
32286
|
if (!win.__timelines || keys.length === 0) return;
|
|
32164
32287
|
const rootId = iframe.contentDocument?.querySelector("[data-composition-id]")?.getAttribute("data-composition-id");
|
|
32165
|
-
const
|
|
32166
|
-
yield wrapTimeline(win.__timelines[
|
|
32288
|
+
const key = rootId && rootId in win.__timelines ? rootId : keys[keys.length - 1];
|
|
32289
|
+
yield wrapTimeline(win.__timelines[key]);
|
|
32167
32290
|
}
|
|
32168
32291
|
function resolvePlaybackAdapter(iframe, win, refs) {
|
|
32169
32292
|
const playerAdapter = win.__player && typeof win.__player.play === "function" ? win.__player : null;
|
|
@@ -32444,8 +32567,8 @@ function evictMetadataOverflow() {
|
|
|
32444
32567
|
const overflow = cache.size + failed.size - TIMELINE_VIEWPORT_BUDGETS.metadataRegistryEntries;
|
|
32445
32568
|
if (overflow <= 0) return;
|
|
32446
32569
|
const entries = [
|
|
32447
|
-
...Array.from(cache, ([
|
|
32448
|
-
...Array.from(failed, ([
|
|
32570
|
+
...Array.from(cache, ([key, value]) => ({ key, at: value.lastAccess, failed: false })),
|
|
32571
|
+
...Array.from(failed, ([key, value]) => ({ key, at: value.lastAccess, failed: true }))
|
|
32449
32572
|
].sort((left, right) => left.at - right.at);
|
|
32450
32573
|
for (const entry3 of entries.slice(0, overflow)) {
|
|
32451
32574
|
if (entry3.failed) failed.delete(entry3.key);
|
|
@@ -32475,32 +32598,32 @@ async function probeMissingSourceDurations(elements, projectId, apply) {
|
|
|
32475
32598
|
await Promise.allSettled(
|
|
32476
32599
|
[...keysBySource].map(async ([source, keys]) => {
|
|
32477
32600
|
const result = await probeMediaUrl(source);
|
|
32478
|
-
if (result) apply(new Map(keys.map((
|
|
32601
|
+
if (result) apply(new Map(keys.map((key) => [key, result.duration])));
|
|
32479
32602
|
})
|
|
32480
32603
|
);
|
|
32481
32604
|
}
|
|
32482
|
-
function hasFreshFailure(
|
|
32483
|
-
const failedAt = failed.get(
|
|
32605
|
+
function hasFreshFailure(key) {
|
|
32606
|
+
const failedAt = failed.get(key);
|
|
32484
32607
|
if (failedAt === void 0) return false;
|
|
32485
32608
|
if (Date.now() - failedAt.failedAt < TIMELINE_VIEWPORT_BUDGETS.metadataFailureTtlMs) {
|
|
32486
32609
|
failedAt.lastAccess = ++accessSequence;
|
|
32487
32610
|
return true;
|
|
32488
32611
|
}
|
|
32489
|
-
failed.delete(
|
|
32612
|
+
failed.delete(key);
|
|
32490
32613
|
return false;
|
|
32491
32614
|
}
|
|
32492
32615
|
async function probeMediaUrl(url) {
|
|
32493
|
-
const
|
|
32494
|
-
const cached5 = getCachedProbe(
|
|
32616
|
+
const key = normalizeUrl(url);
|
|
32617
|
+
const cached5 = getCachedProbe(key);
|
|
32495
32618
|
if (cached5) return cached5;
|
|
32496
|
-
if (hasFreshFailure(
|
|
32497
|
-
let pending2 = inflight.get(
|
|
32619
|
+
if (hasFreshFailure(key)) return null;
|
|
32620
|
+
let pending2 = inflight.get(key);
|
|
32498
32621
|
if (pending2) return pending2;
|
|
32499
32622
|
pending2 = new Promise((resolve2) => {
|
|
32500
|
-
probeQueue.push({ key
|
|
32623
|
+
probeQueue.push({ key, epoch: registryEpoch, resolve: resolve2 });
|
|
32501
32624
|
pumpProbeQueue();
|
|
32502
32625
|
});
|
|
32503
|
-
inflight.set(
|
|
32626
|
+
inflight.set(key, pending2);
|
|
32504
32627
|
return pending2;
|
|
32505
32628
|
}
|
|
32506
32629
|
function pumpProbeQueue() {
|
|
@@ -32539,12 +32662,13 @@ import {
|
|
|
32539
32662
|
parseMediaLoadFailure,
|
|
32540
32663
|
RUNTIME_MEDIA_LOAD_FAILED
|
|
32541
32664
|
} from "@hyperframes/core/runtime/protocol";
|
|
32542
|
-
function
|
|
32543
|
-
|
|
32665
|
+
function fromOurPreview(e, iframe) {
|
|
32666
|
+
if (!iframe || !e.source || e.source !== iframe.contentWindow) return false;
|
|
32667
|
+
return frameOrigins(iframe).includes(e.origin);
|
|
32544
32668
|
}
|
|
32545
32669
|
function acceptedPreviewMessage(e, iframe) {
|
|
32546
32670
|
if (hasTimelinePerformanceFixtureLease()) return null;
|
|
32547
|
-
if (
|
|
32671
|
+
if (!fromOurPreview(e, iframe)) return null;
|
|
32548
32672
|
const data = e.data;
|
|
32549
32673
|
if (data?.source !== "hf-preview") return null;
|
|
32550
32674
|
return acceptStudioRuntimeMessage(data) ? data : null;
|
|
@@ -32684,7 +32808,7 @@ function timelineElementsChanged(previous, next) {
|
|
|
32684
32808
|
if (next.length !== previous.length) return true;
|
|
32685
32809
|
return next.some((element, index2) => {
|
|
32686
32810
|
const prior = previous[index2];
|
|
32687
|
-
return !prior || RENDERED_FIELDS.some((
|
|
32811
|
+
return !prior || RENDERED_FIELDS.some((key) => element[key] !== prior[key]) || !sameTimelineText(element.text, prior.text);
|
|
32688
32812
|
});
|
|
32689
32813
|
}
|
|
32690
32814
|
|
|
@@ -32692,7 +32816,8 @@ function timelineElementsChanged(previous, next) {
|
|
|
32692
32816
|
var publishSeek = (time, options) => options?.follow === false ? liveTime.notify(time) : liveTime.notifySeek(time);
|
|
32693
32817
|
function useTimelinePlayer({
|
|
32694
32818
|
onShadowPromoted,
|
|
32695
|
-
onPreviewReloadFailed
|
|
32819
|
+
onPreviewReloadFailed,
|
|
32820
|
+
holdPreviewStill
|
|
32696
32821
|
} = {}) {
|
|
32697
32822
|
const iframeRef = useRef50(null);
|
|
32698
32823
|
const rafRef = useRef50(0);
|
|
@@ -33010,7 +33135,8 @@ function useTimelinePlayer({
|
|
|
33010
33135
|
setShadowIframeNode,
|
|
33011
33136
|
beginShadowReload,
|
|
33012
33137
|
resetPreviewSlots,
|
|
33013
|
-
previewGeneration
|
|
33138
|
+
previewGeneration,
|
|
33139
|
+
onLiveLoaded
|
|
33014
33140
|
} = useShadowPreviewReload({
|
|
33015
33141
|
iframeRef,
|
|
33016
33142
|
getAdapter,
|
|
@@ -33025,6 +33151,7 @@ function useTimelinePlayer({
|
|
|
33025
33151
|
applyPreviewAudioState,
|
|
33026
33152
|
onPromoted: onShadowPromoted,
|
|
33027
33153
|
onReloadFailed: onPreviewReloadFailed,
|
|
33154
|
+
holdStill: holdPreviewStill,
|
|
33028
33155
|
handOverPlayback: (time, playing) => {
|
|
33029
33156
|
seek(time, { keepPlaying: true, follow: false });
|
|
33030
33157
|
const adapter = getAdapter();
|
|
@@ -33130,13 +33257,20 @@ function useTimelinePlayer({
|
|
|
33130
33257
|
applyPreviewAudioState();
|
|
33131
33258
|
});
|
|
33132
33259
|
}, [applyPlaybackRate, applyPreviewAudioState]);
|
|
33260
|
+
const onLiveIframeLoad = useCallback42(
|
|
33261
|
+
(context) => {
|
|
33262
|
+
onIframeLoad(context);
|
|
33263
|
+
onLiveLoaded();
|
|
33264
|
+
},
|
|
33265
|
+
[onIframeLoad, onLiveLoaded]
|
|
33266
|
+
);
|
|
33133
33267
|
return {
|
|
33134
33268
|
iframeRef,
|
|
33135
33269
|
play,
|
|
33136
33270
|
pause,
|
|
33137
33271
|
togglePlay,
|
|
33138
33272
|
seek,
|
|
33139
|
-
onIframeLoad,
|
|
33273
|
+
onIframeLoad: onLiveIframeLoad,
|
|
33140
33274
|
refreshPlayer,
|
|
33141
33275
|
saveSeekPosition,
|
|
33142
33276
|
resetPlayer,
|
|
@@ -33521,7 +33655,7 @@ function usePlayerHandle() {
|
|
|
33521
33655
|
},
|
|
33522
33656
|
[ready, seekPlayer]
|
|
33523
33657
|
);
|
|
33524
|
-
const
|
|
33658
|
+
const subscribe2 = useCallback45((listener2) => {
|
|
33525
33659
|
let previous = usePlayerStore.getState();
|
|
33526
33660
|
return usePlayerStore.subscribe((state) => {
|
|
33527
33661
|
const structuralChange = state.timelineReady !== previous.timelineReady || state.isPlaying !== previous.isPlaying || state.duration !== previous.duration || state.elements !== previous.elements;
|
|
@@ -33545,7 +33679,7 @@ function usePlayerHandle() {
|
|
|
33545
33679
|
},
|
|
33546
33680
|
duration,
|
|
33547
33681
|
elements: handleElements,
|
|
33548
|
-
subscribe:
|
|
33682
|
+
subscribe: subscribe2,
|
|
33549
33683
|
subscribeTime
|
|
33550
33684
|
};
|
|
33551
33685
|
}
|
|
@@ -33576,6 +33710,7 @@ import {
|
|
|
33576
33710
|
useRef as useRef56,
|
|
33577
33711
|
useState as useState40
|
|
33578
33712
|
} from "react";
|
|
33713
|
+
import { flushSync as flushSync3 } from "react-dom";
|
|
33579
33714
|
|
|
33580
33715
|
// src/components/nle/previewZoom.ts
|
|
33581
33716
|
var MIN_PREVIEW_ZOOM_PERCENT = 25;
|
|
@@ -33740,10 +33875,10 @@ var usePreviewGuidesStore = create8((set, get) => {
|
|
|
33740
33875
|
return {
|
|
33741
33876
|
rulerVisible: stored.rulerVisible ?? false,
|
|
33742
33877
|
safeMarginsVisible: stored.safeMarginsVisible ?? false,
|
|
33743
|
-
toggle: (
|
|
33744
|
-
const next = !get()[
|
|
33745
|
-
writeStudioUiPreferences({ [
|
|
33746
|
-
set({ [
|
|
33878
|
+
toggle: (key) => {
|
|
33879
|
+
const next = !get()[key];
|
|
33880
|
+
writeStudioUiPreferences({ [key]: next });
|
|
33881
|
+
set({ [key]: next });
|
|
33747
33882
|
}
|
|
33748
33883
|
};
|
|
33749
33884
|
});
|
|
@@ -34132,10 +34267,10 @@ function renderPosterForNextOpen(projectId) {
|
|
|
34132
34267
|
});
|
|
34133
34268
|
if (settled()) lease.release();
|
|
34134
34269
|
}
|
|
34135
|
-
function useVisitNumber(
|
|
34136
|
-
const [seen, setSeen] = useState39({ key
|
|
34137
|
-
if (seen.key ===
|
|
34138
|
-
setSeen({ key
|
|
34270
|
+
function useVisitNumber(key) {
|
|
34271
|
+
const [seen, setSeen] = useState39({ key, visit: 0 });
|
|
34272
|
+
if (seen.key === key) return seen.visit;
|
|
34273
|
+
setSeen({ key, visit: seen.visit + 1 });
|
|
34139
34274
|
return seen.visit + 1;
|
|
34140
34275
|
}
|
|
34141
34276
|
|
|
@@ -34210,11 +34345,10 @@ var NLEPreview = memo24(function NLEPreview2({
|
|
|
34210
34345
|
const viewport2 = viewportRef.current;
|
|
34211
34346
|
if (!viewport2) return;
|
|
34212
34347
|
const updateStageSize = () => {
|
|
34213
|
-
const rect = viewport2.getBoundingClientRect();
|
|
34214
34348
|
setStageSize(
|
|
34215
34349
|
resolvePreviewStageSize(
|
|
34216
|
-
|
|
34217
|
-
|
|
34350
|
+
viewport2.clientWidth,
|
|
34351
|
+
viewport2.clientHeight,
|
|
34218
34352
|
compositionSize ?? (hintWidth && hintHeight ? { width: hintWidth, height: hintHeight } : null),
|
|
34219
34353
|
portrait,
|
|
34220
34354
|
gutterPx,
|
|
@@ -34223,7 +34357,8 @@ var NLEPreview = memo24(function NLEPreview2({
|
|
|
34223
34357
|
);
|
|
34224
34358
|
};
|
|
34225
34359
|
updateStageSize();
|
|
34226
|
-
const
|
|
34360
|
+
const resizeBeforePaint = () => flushSync3(updateStageSize);
|
|
34361
|
+
const observer = new ResizeObserver(resizeBeforePaint);
|
|
34227
34362
|
observer.observe(viewport2);
|
|
34228
34363
|
return () => observer.disconnect();
|
|
34229
34364
|
}, [compositionSize, hintWidth, hintHeight, portrait, gutterPx, insetPx]);
|
|
@@ -37733,16 +37868,16 @@ function framePointer(iframe, clientX, clientY) {
|
|
|
37733
37868
|
function objectLike(value) {
|
|
37734
37869
|
return value && (typeof value === "object" || typeof value === "function") ? value : null;
|
|
37735
37870
|
}
|
|
37736
|
-
function callPlaybackMethod(target,
|
|
37737
|
-
const method = target ? Reflect.get(target,
|
|
37871
|
+
function callPlaybackMethod(target, key) {
|
|
37872
|
+
const method = target ? Reflect.get(target, key) : null;
|
|
37738
37873
|
if (typeof method !== "function") return;
|
|
37739
37874
|
try {
|
|
37740
37875
|
method.call(target);
|
|
37741
37876
|
} catch {
|
|
37742
37877
|
}
|
|
37743
37878
|
}
|
|
37744
|
-
function readPlaybackTime(target,
|
|
37745
|
-
const method = target ? Reflect.get(target,
|
|
37879
|
+
function readPlaybackTime(target, key) {
|
|
37880
|
+
const method = target ? Reflect.get(target, key) : null;
|
|
37746
37881
|
if (typeof method !== "function") return null;
|
|
37747
37882
|
try {
|
|
37748
37883
|
const value = method.call(target);
|
|
@@ -38104,11 +38239,11 @@ function createOverlayMeasurePass() {
|
|
|
38104
38239
|
sourceBoundaryRect: /* @__PURE__ */ new Map()
|
|
38105
38240
|
};
|
|
38106
38241
|
}
|
|
38107
|
-
function readThroughPass(memo64,
|
|
38108
|
-
const answered = memo64.get(
|
|
38242
|
+
function readThroughPass(memo64, key, compute) {
|
|
38243
|
+
const answered = memo64.get(key);
|
|
38109
38244
|
if (answered !== void 0) return answered;
|
|
38110
38245
|
const value = compute();
|
|
38111
|
-
memo64.set(
|
|
38246
|
+
memo64.set(key, value);
|
|
38112
38247
|
return value;
|
|
38113
38248
|
}
|
|
38114
38249
|
|
|
@@ -38341,13 +38476,13 @@ function selectionCacheKey(selection) {
|
|
|
38341
38476
|
].join("|");
|
|
38342
38477
|
}
|
|
38343
38478
|
function resolveElementForOverlay(doc, sel, activeCompositionPath, cacheRef) {
|
|
38344
|
-
const
|
|
38479
|
+
const key = selectionCacheKey(sel);
|
|
38345
38480
|
const cached5 = cacheRef.current;
|
|
38346
|
-
if (cached5?.key ===
|
|
38481
|
+
if (cached5?.key === key && cached5.element.isConnected && cached5.element.ownerDocument === doc) {
|
|
38347
38482
|
return cached5.element;
|
|
38348
38483
|
}
|
|
38349
38484
|
const next = findElementForSelection(doc, sel, activeCompositionPath);
|
|
38350
|
-
cacheRef.current = next ? { key
|
|
38485
|
+
cacheRef.current = next ? { key, element: next } : null;
|
|
38351
38486
|
return next;
|
|
38352
38487
|
}
|
|
38353
38488
|
|
|
@@ -38455,6 +38590,12 @@ function readPreviewElement(value) {
|
|
|
38455
38590
|
if (!isTextRecord(value.inlineStyles) || !isText(value.text)) return null;
|
|
38456
38591
|
return hasPlainFields(value) ? value : null;
|
|
38457
38592
|
}
|
|
38593
|
+
async function previewElementsAtPoint(iframe, x, y) {
|
|
38594
|
+
const reply = await previewRequest(iframe, "elements-at-point", { x, y });
|
|
38595
|
+
const elements = reply?.elements;
|
|
38596
|
+
if (!Array.isArray(elements)) return null;
|
|
38597
|
+
return elements.map(readHit).filter((element) => element !== null);
|
|
38598
|
+
}
|
|
38458
38599
|
async function previewPointerTargets(iframe, rootFractionX, rootFractionY) {
|
|
38459
38600
|
const params = { x: rootFractionX, y: rootFractionY };
|
|
38460
38601
|
const reply = await previewRequest(iframe, "pointer-targets", params);
|
|
@@ -38523,7 +38664,7 @@ async function previewGeometry(iframe, handles, children) {
|
|
|
38523
38664
|
};
|
|
38524
38665
|
}
|
|
38525
38666
|
var isFlag = (value) => typeof value === "boolean";
|
|
38526
|
-
var isFiniteFields = (value, keys) => isFields(value) && keys.every((
|
|
38667
|
+
var isFiniteFields = (value, keys) => isFields(value) && keys.every((key) => Number.isFinite(value[key]));
|
|
38527
38668
|
var readGestureStart = (value) => {
|
|
38528
38669
|
if (!readGeometry(value) || !isFields(value)) return null;
|
|
38529
38670
|
const { layout, move, gsap: gsap3 } = value;
|
|
@@ -38941,7 +39082,7 @@ function readable(element) {
|
|
|
38941
39082
|
probe2.textContent = element.text;
|
|
38942
39083
|
return probe2;
|
|
38943
39084
|
}
|
|
38944
|
-
var attr = (element, name) => element.attributes.find(([
|
|
39085
|
+
var attr = (element, name) => element.attributes.find(([key]) => key === name)?.[1] ?? null;
|
|
38945
39086
|
var mayBeCut = (value) => value.length >= MAX_ELEMENT_VALUE2 || value.startsWith("data:") && value.endsWith(",");
|
|
38946
39087
|
function valuesWhole(element) {
|
|
38947
39088
|
if (!element.truncated) return true;
|
|
@@ -39261,7 +39402,7 @@ async function compositionViewport(iframe) {
|
|
|
39261
39402
|
const root = roots?.matches[0] ?? (await queryPreviewElements(iframe, "html"))?.matches[0];
|
|
39262
39403
|
const [described] = root && await describePreviewElements(iframe, [root.handle]) || [];
|
|
39263
39404
|
if (!described) return null;
|
|
39264
|
-
const declared = (name) => Number.parseFloat(described.attributes.find(([
|
|
39405
|
+
const declared = (name) => Number.parseFloat(described.attributes.find(([key]) => key === name)?.[1] ?? "");
|
|
39265
39406
|
const [width, height] = [declared("data-width"), declared("data-height")];
|
|
39266
39407
|
return {
|
|
39267
39408
|
width: width > 0 ? width : described.rect.width || 1,
|
|
@@ -39707,14 +39848,14 @@ function useDomEditOverlayRects({
|
|
|
39707
39848
|
setGroupOverlayItemsState(next);
|
|
39708
39849
|
};
|
|
39709
39850
|
const resolveGroupElement = (doc, sel) => {
|
|
39710
|
-
const
|
|
39711
|
-
const cached5 = resolvedGroupElementRef.current.get(
|
|
39851
|
+
const key = selectionCacheKey(sel);
|
|
39852
|
+
const cached5 = resolvedGroupElementRef.current.get(key);
|
|
39712
39853
|
if (cached5?.isConnected && cached5.ownerDocument === doc) return cached5;
|
|
39713
39854
|
const next = findElementForSelection(doc, sel, activeCompositionPathRef.current);
|
|
39714
39855
|
if (next) {
|
|
39715
|
-
resolvedGroupElementRef.current.set(
|
|
39856
|
+
resolvedGroupElementRef.current.set(key, next);
|
|
39716
39857
|
} else {
|
|
39717
|
-
resolvedGroupElementRef.current.delete(
|
|
39858
|
+
resolvedGroupElementRef.current.delete(key);
|
|
39718
39859
|
}
|
|
39719
39860
|
return next;
|
|
39720
39861
|
};
|
|
@@ -39726,16 +39867,16 @@ function useDomEditOverlayRects({
|
|
|
39726
39867
|
const distinctGroup = (group) => {
|
|
39727
39868
|
const keys = /* @__PURE__ */ new Set();
|
|
39728
39869
|
return group.flatMap((selection) => {
|
|
39729
|
-
const
|
|
39730
|
-
if (keys.has(
|
|
39731
|
-
keys.add(
|
|
39732
|
-
return [{ key
|
|
39870
|
+
const key = selectionCacheKey(selection);
|
|
39871
|
+
if (keys.has(key)) return [];
|
|
39872
|
+
keys.add(key);
|
|
39873
|
+
return [{ key, selection }];
|
|
39733
39874
|
});
|
|
39734
39875
|
};
|
|
39735
39876
|
const hoverShown = (sel, group) => {
|
|
39736
39877
|
const hoverSel = hoverSelectionRef.current;
|
|
39737
|
-
const
|
|
39738
|
-
const covered = sel && selectionCacheKey(sel) ===
|
|
39878
|
+
const key = hoverSel && selectionCacheKey(hoverSel);
|
|
39879
|
+
const covered = sel && selectionCacheKey(sel) === key || group.some((entry3) => selectionCacheKey(entry3) === key);
|
|
39739
39880
|
return covered ? null : hoverSel;
|
|
39740
39881
|
};
|
|
39741
39882
|
const updateOverChannel = (iframe, overlayEl) => {
|
|
@@ -39763,9 +39904,9 @@ function useDomEditOverlayRects({
|
|
|
39763
39904
|
setOverlayRect(rects.selection);
|
|
39764
39905
|
setChildRects(rects.children);
|
|
39765
39906
|
setGroupOverlayItems(
|
|
39766
|
-
members.flatMap(({ key
|
|
39907
|
+
members.flatMap(({ key, selection }, index2) => {
|
|
39767
39908
|
const rect = rects.group[index2];
|
|
39768
|
-
return rect ? [{ key
|
|
39909
|
+
return rect ? [{ key, selection, element: selection.element, rect }] : [];
|
|
39769
39910
|
})
|
|
39770
39911
|
);
|
|
39771
39912
|
setHoverRect(rects.hover);
|
|
@@ -39853,17 +39994,17 @@ function useDomEditOverlayRects({
|
|
|
39853
39994
|
const nextGroupItems = [];
|
|
39854
39995
|
const liveGroupKeys = /* @__PURE__ */ new Set();
|
|
39855
39996
|
for (const groupSelection of group) {
|
|
39856
|
-
const
|
|
39857
|
-
if (liveGroupKeys.has(
|
|
39858
|
-
liveGroupKeys.add(
|
|
39997
|
+
const key = selectionCacheKey(groupSelection);
|
|
39998
|
+
if (liveGroupKeys.has(key)) continue;
|
|
39999
|
+
liveGroupKeys.add(key);
|
|
39859
40000
|
const el = resolveGroupElement(doc, groupSelection);
|
|
39860
40001
|
const base2 = el ? groupAwareOverlayRect(overlayEl, iframe, el, scale) : null;
|
|
39861
40002
|
const rect = base2 && el ? { ...base2, ...hugRectForElement(base2, el) } : base2;
|
|
39862
40003
|
if (el && rect)
|
|
39863
|
-
nextGroupItems.push({ key
|
|
40004
|
+
nextGroupItems.push({ key, selection: groupSelection, element: el, rect });
|
|
39864
40005
|
}
|
|
39865
|
-
for (const
|
|
39866
|
-
if (!liveGroupKeys.has(
|
|
40006
|
+
for (const key of resolvedGroupElementRef.current.keys()) {
|
|
40007
|
+
if (!liveGroupKeys.has(key)) resolvedGroupElementRef.current.delete(key);
|
|
39867
40008
|
}
|
|
39868
40009
|
setGroupOverlayItems(nextGroupItems);
|
|
39869
40010
|
} else {
|
|
@@ -40151,8 +40292,8 @@ function normalizeStudioFileChangePath(path) {
|
|
|
40151
40292
|
function asPayloadRecord(payload) {
|
|
40152
40293
|
return payload && typeof payload === "object" ? payload : null;
|
|
40153
40294
|
}
|
|
40154
|
-
function readFileChangeField(payload,
|
|
40155
|
-
const value = asPayloadRecord(payload)?.[
|
|
40295
|
+
function readFileChangeField(payload, key) {
|
|
40296
|
+
const value = asPayloadRecord(payload)?.[key];
|
|
40156
40297
|
return typeof value === "string" ? value : null;
|
|
40157
40298
|
}
|
|
40158
40299
|
function readStudioFileChangePath(payload) {
|
|
@@ -40526,8 +40667,8 @@ function markWrapped(fn) {
|
|
|
40526
40667
|
function isWrapped(fn) {
|
|
40527
40668
|
return Boolean(fn[STUDIO_MANUAL_EDITS_WRAPPED_PROP]);
|
|
40528
40669
|
}
|
|
40529
|
-
function wrapSeekReapplyFunction(win, owner,
|
|
40530
|
-
const fn = owner?.[
|
|
40670
|
+
function wrapSeekReapplyFunction(win, owner, key, reapplyWhenHeldSeekLands = false) {
|
|
40671
|
+
const fn = owner?.[key];
|
|
40531
40672
|
if (!owner || typeof fn !== "function") return false;
|
|
40532
40673
|
const seek = fn;
|
|
40533
40674
|
if (isWrapped(seek)) return true;
|
|
@@ -40540,14 +40681,14 @@ function wrapSeekReapplyFunction(win, owner, key2, reapplyWhenHeldSeekLands = fa
|
|
|
40540
40681
|
};
|
|
40541
40682
|
markWrapped(wrappedSeek);
|
|
40542
40683
|
try {
|
|
40543
|
-
owner[
|
|
40684
|
+
owner[key] = wrappedSeek;
|
|
40544
40685
|
} catch {
|
|
40545
40686
|
return false;
|
|
40546
40687
|
}
|
|
40547
40688
|
return true;
|
|
40548
40689
|
}
|
|
40549
|
-
function readOwnerNumber(owner,
|
|
40550
|
-
const fn = owner[
|
|
40690
|
+
function readOwnerNumber(owner, key) {
|
|
40691
|
+
const fn = owner[key];
|
|
40551
40692
|
if (typeof fn !== "function") return null;
|
|
40552
40693
|
try {
|
|
40553
40694
|
return finiteNumber2(fn.call(owner));
|
|
@@ -40633,8 +40774,8 @@ function startStudioManualEditPlaybackReapply(win) {
|
|
|
40633
40774
|
};
|
|
40634
40775
|
win[STUDIO_MANUAL_EDITS_PLAYBACK_FRAME_PROP] = win.requestAnimationFrame(tick);
|
|
40635
40776
|
}
|
|
40636
|
-
function wrapPlayReapplyFunction(win, owner,
|
|
40637
|
-
const fn = owner?.[
|
|
40777
|
+
function wrapPlayReapplyFunction(win, owner, key) {
|
|
40778
|
+
const fn = owner?.[key];
|
|
40638
40779
|
if (!owner || typeof fn !== "function") return false;
|
|
40639
40780
|
const play = fn;
|
|
40640
40781
|
if (isWrapped(play)) return true;
|
|
@@ -40645,14 +40786,14 @@ function wrapPlayReapplyFunction(win, owner, key2) {
|
|
|
40645
40786
|
};
|
|
40646
40787
|
markWrapped(wrappedPlay);
|
|
40647
40788
|
try {
|
|
40648
|
-
owner[
|
|
40789
|
+
owner[key] = wrappedPlay;
|
|
40649
40790
|
} catch {
|
|
40650
40791
|
return false;
|
|
40651
40792
|
}
|
|
40652
40793
|
return true;
|
|
40653
40794
|
}
|
|
40654
|
-
function wrapApplyAfterFunction(win, owner,
|
|
40655
|
-
const fn = owner?.[
|
|
40795
|
+
function wrapApplyAfterFunction(win, owner, key) {
|
|
40796
|
+
const fn = owner?.[key];
|
|
40656
40797
|
if (!owner || typeof fn !== "function") return false;
|
|
40657
40798
|
const applyAfter = fn;
|
|
40658
40799
|
if (isWrapped(applyAfter)) return true;
|
|
@@ -40663,7 +40804,7 @@ function wrapApplyAfterFunction(win, owner, key2) {
|
|
|
40663
40804
|
};
|
|
40664
40805
|
markWrapped(wrappedApplyAfter);
|
|
40665
40806
|
try {
|
|
40666
|
-
owner[
|
|
40807
|
+
owner[key] = wrappedApplyAfter;
|
|
40667
40808
|
} catch {
|
|
40668
40809
|
return false;
|
|
40669
40810
|
}
|
|
@@ -41622,19 +41763,19 @@ function resetDragMoveLog() {
|
|
|
41622
41763
|
}
|
|
41623
41764
|
function readDragPositions(elements) {
|
|
41624
41765
|
const positions = {};
|
|
41625
|
-
for (const { key
|
|
41766
|
+
for (const { key, element } of elements) {
|
|
41626
41767
|
const rect = element.getBoundingClientRect();
|
|
41627
|
-
positions[
|
|
41768
|
+
positions[key] = `${Math.round(rect.left)},${Math.round(rect.top)}`;
|
|
41628
41769
|
}
|
|
41629
41770
|
return positions;
|
|
41630
41771
|
}
|
|
41631
41772
|
function findNonRigidMembers(before, after) {
|
|
41632
41773
|
const moves = /* @__PURE__ */ new Map();
|
|
41633
|
-
for (const
|
|
41634
|
-
const from = before[
|
|
41635
|
-
const to = after[
|
|
41774
|
+
for (const key of Object.keys(after)) {
|
|
41775
|
+
const from = before[key]?.split(",").map(Number);
|
|
41776
|
+
const to = after[key]?.split(",").map(Number);
|
|
41636
41777
|
if (!from || !to || from.length !== 2 || to.length !== 2) continue;
|
|
41637
|
-
moves.set(
|
|
41778
|
+
moves.set(key, `${Math.round(to[0] - from[0])},${Math.round(to[1] - from[1])}`);
|
|
41638
41779
|
}
|
|
41639
41780
|
const counts = /* @__PURE__ */ new Map();
|
|
41640
41781
|
for (const move of moves.values()) counts.set(move, (counts.get(move) ?? 0) + 1);
|
|
@@ -41643,7 +41784,7 @@ function findNonRigidMembers(before, after) {
|
|
|
41643
41784
|
for (const [move, count] of counts) {
|
|
41644
41785
|
if (count > best) [common, best] = [move, count];
|
|
41645
41786
|
}
|
|
41646
|
-
return [...moves].filter(([, move]) => move !== common).map(([
|
|
41787
|
+
return [...moves].filter(([, move]) => move !== common).map(([key, move]) => `${key.split("|")[2] ?? key} moved ${move}, group moved ${common}`);
|
|
41647
41788
|
}
|
|
41648
41789
|
function logDragSettle(stage, elements) {
|
|
41649
41790
|
logDrag(stage, () => {
|
|
@@ -44143,8 +44284,8 @@ function InlineTextCaret({
|
|
|
44143
44284
|
let composing = false;
|
|
44144
44285
|
let side = "after";
|
|
44145
44286
|
const update = () => setPlacement(composing ? null : placeAtCaret(element, iframe, color, side));
|
|
44146
|
-
const onKey = ({ key
|
|
44147
|
-
if (!MODIFIERS.has(
|
|
44287
|
+
const onKey = ({ key }) => {
|
|
44288
|
+
if (!MODIFIERS.has(key)) side = SIDE_OF_KEY[key] ?? "after";
|
|
44148
44289
|
};
|
|
44149
44290
|
const onPress = () => void (side = "after");
|
|
44150
44291
|
const composition = (on) => () => {
|
|
@@ -44511,18 +44652,18 @@ function runNodes(doc, runs) {
|
|
|
44511
44652
|
return nodes;
|
|
44512
44653
|
}
|
|
44513
44654
|
function runNode(doc, run, carried) {
|
|
44514
|
-
const
|
|
44655
|
+
const key = styleKey(run.style);
|
|
44515
44656
|
const nodes = [];
|
|
44516
44657
|
for (const [index2, piece] of run.text.split(BREAK).entries()) {
|
|
44517
44658
|
if (index2 > 0) nodes.push(doc.createElement("br"));
|
|
44518
44659
|
if (!piece) continue;
|
|
44519
|
-
if (!
|
|
44660
|
+
if (!key && carried.size === 0) {
|
|
44520
44661
|
nodes.push(doc.createTextNode(piece));
|
|
44521
44662
|
continue;
|
|
44522
44663
|
}
|
|
44523
44664
|
const span = doc.createElement("span");
|
|
44524
44665
|
for (const [name, value] of carried) span.setAttribute(name, value);
|
|
44525
|
-
if (
|
|
44666
|
+
if (key) span.setAttribute("style", key);
|
|
44526
44667
|
span.textContent = piece;
|
|
44527
44668
|
nodes.push(span);
|
|
44528
44669
|
carried.clear();
|
|
@@ -45422,13 +45563,13 @@ function renderFields(label, text3) {
|
|
|
45422
45563
|
const [name = "", ...value] = field.split(" ");
|
|
45423
45564
|
const cells = document.createElement("span");
|
|
45424
45565
|
cells.className = "flex items-baseline gap-1.5";
|
|
45425
|
-
const
|
|
45426
|
-
|
|
45427
|
-
|
|
45566
|
+
const key = document.createElement("span");
|
|
45567
|
+
key.className = "text-text-4";
|
|
45568
|
+
key.textContent = name;
|
|
45428
45569
|
const figure = document.createElement("span");
|
|
45429
45570
|
figure.className = "min-w-[4ch] text-right font-medium";
|
|
45430
45571
|
figure.textContent = value.join(" ");
|
|
45431
|
-
cells.append(
|
|
45572
|
+
cells.append(key, figure);
|
|
45432
45573
|
if (index2 === 0) return [cells];
|
|
45433
45574
|
const divider = document.createElement("span");
|
|
45434
45575
|
divider.className = "h-3.5 w-px bg-border";
|
|
@@ -46213,9 +46354,9 @@ function flushAttemptCounts() {
|
|
|
46213
46354
|
const keys = Object.keys(attemptCounts);
|
|
46214
46355
|
if (keys.length === 0) return null;
|
|
46215
46356
|
const snapshot3 = {};
|
|
46216
|
-
for (const
|
|
46217
|
-
snapshot3[
|
|
46218
|
-
delete attemptCounts[
|
|
46357
|
+
for (const key of keys) {
|
|
46358
|
+
snapshot3[key] = attemptCounts[key];
|
|
46359
|
+
delete attemptCounts[key];
|
|
46219
46360
|
}
|
|
46220
46361
|
return snapshot3;
|
|
46221
46362
|
}
|
|
@@ -47542,9 +47683,9 @@ function resolveRepositionLaneMove(input) {
|
|
|
47542
47683
|
const selfKey = keyOf13(element);
|
|
47543
47684
|
const selfIdx = desiredOrderKeys.indexOf(selfKey);
|
|
47544
47685
|
if (selfIdx === -1) return null;
|
|
47545
|
-
const clipLaneForKey = (
|
|
47546
|
-
if (
|
|
47547
|
-
const el = elements.find((candidate) => keyOf13(candidate) ===
|
|
47686
|
+
const clipLaneForKey = (key) => {
|
|
47687
|
+
if (key == null) return null;
|
|
47688
|
+
const el = elements.find((candidate) => keyOf13(candidate) === key);
|
|
47548
47689
|
return el && classifyZone(el) === "visual" && el.duration > 0 && samePaintScope(el, element) && keyOf13(el) !== selfKey ? el.track : null;
|
|
47549
47690
|
};
|
|
47550
47691
|
let aboveLane = null;
|
|
@@ -47685,7 +47826,7 @@ function useMirrorLaneMoveCommit() {
|
|
|
47685
47826
|
{
|
|
47686
47827
|
elements: els,
|
|
47687
47828
|
trackOrder: timelineTrackOrder(els),
|
|
47688
|
-
updateElement: (
|
|
47829
|
+
updateElement: (key, updates) => usePlayerStore.getState().updateElement(key, updates),
|
|
47689
47830
|
onMoveElements
|
|
47690
47831
|
// NO readZIndex / onStackingPatches: see the hook doc — the lane→z
|
|
47691
47832
|
// stacking sync must not re-trigger and fight the just-set z values.
|
|
@@ -48825,15 +48966,15 @@ function TopologyLens({ iframeRef, activeCompositionPath }) {
|
|
|
48825
48966
|
|
|
48826
48967
|
// src/hooks/gsapKeyframeCacheHelpers.ts
|
|
48827
48968
|
function keepEqualEntries(before, draft) {
|
|
48828
|
-
for (const [
|
|
48829
|
-
const shown3 = before.get(
|
|
48830
|
-
if (shown3 !== void 0 && shown3 !== value && sameData(shown3, value)) draft.set(
|
|
48969
|
+
for (const [key, value] of draft) {
|
|
48970
|
+
const shown3 = before.get(key);
|
|
48971
|
+
if (shown3 !== void 0 && shown3 !== value && sameData(shown3, value)) draft.set(key, shown3);
|
|
48831
48972
|
}
|
|
48832
48973
|
}
|
|
48833
48974
|
function sameEntries(before, after) {
|
|
48834
48975
|
if (before.size !== after.size) return false;
|
|
48835
|
-
for (const [
|
|
48836
|
-
if (after.get(
|
|
48976
|
+
for (const [key, value] of before) {
|
|
48977
|
+
if (after.get(key) !== value) return false;
|
|
48837
48978
|
}
|
|
48838
48979
|
return true;
|
|
48839
48980
|
}
|
|
@@ -48896,16 +49037,16 @@ function updateKeyframeCacheFromParsed(animations, targetPath, selectionId, muta
|
|
|
48896
49037
|
});
|
|
48897
49038
|
}
|
|
48898
49039
|
function writeElementIntoDraft(draft, sourceFile, elementId2, entry3, animations) {
|
|
48899
|
-
for (const
|
|
48900
|
-
draft.keyframeCache.set(
|
|
48901
|
-
if (animations) draft.gsapAnimations.set(
|
|
48902
|
-
else draft.gsapAnimations.delete(
|
|
49040
|
+
for (const key of elementCacheKeys(sourceFile, elementId2)) {
|
|
49041
|
+
draft.keyframeCache.set(key, entry3);
|
|
49042
|
+
if (animations) draft.gsapAnimations.set(key, animations);
|
|
49043
|
+
else draft.gsapAnimations.delete(key);
|
|
48903
49044
|
}
|
|
48904
49045
|
}
|
|
48905
49046
|
function deleteElementFromDraft(draft, sourceFile, elementId2) {
|
|
48906
|
-
for (const
|
|
48907
|
-
draft.keyframeCache.delete(
|
|
48908
|
-
draft.gsapAnimations.delete(
|
|
49047
|
+
for (const key of elementCacheKeys(sourceFile, elementId2)) {
|
|
49048
|
+
draft.keyframeCache.delete(key);
|
|
49049
|
+
draft.gsapAnimations.delete(key);
|
|
48909
49050
|
}
|
|
48910
49051
|
}
|
|
48911
49052
|
function clearKeyframeCacheForElement(sourceFile, elementId2) {
|
|
@@ -48914,14 +49055,14 @@ function clearKeyframeCacheForElement(sourceFile, elementId2) {
|
|
|
48914
49055
|
function cachedElementIdsForFile(sourceFile, keyframeCache, gsapAnimations) {
|
|
48915
49056
|
const sfPrefix = `${sourceFile}#`;
|
|
48916
49057
|
const ids = /* @__PURE__ */ new Set();
|
|
48917
|
-
for (const
|
|
48918
|
-
if (
|
|
49058
|
+
for (const key of [...keyframeCache.keys(), ...gsapAnimations.keys()]) {
|
|
49059
|
+
if (key.startsWith(sfPrefix)) ids.add(key.slice(sfPrefix.length));
|
|
48919
49060
|
}
|
|
48920
49061
|
if (sourceFile !== "index.html") return ids;
|
|
48921
|
-
for (const [
|
|
48922
|
-
const hash =
|
|
48923
|
-
const id =
|
|
48924
|
-
if (hash > 0 && !
|
|
49062
|
+
for (const [key, entry3] of keyframeCache) {
|
|
49063
|
+
const hash = key.indexOf("#");
|
|
49064
|
+
const id = key.slice(hash + 1);
|
|
49065
|
+
if (hash > 0 && !key.startsWith(sfPrefix) && keyframeCache.get(sfPrefix + id) === entry3) {
|
|
48925
49066
|
ids.delete(id);
|
|
48926
49067
|
}
|
|
48927
49068
|
}
|
|
@@ -48931,13 +49072,13 @@ function pruneKeyframeCacheToFiles(files) {
|
|
|
48931
49072
|
const keep = new Set(files);
|
|
48932
49073
|
const { keyframeCache, gsapAnimations } = usePlayerStore.getState();
|
|
48933
49074
|
const stale = /* @__PURE__ */ new Map();
|
|
48934
|
-
for (const
|
|
48935
|
-
const hash =
|
|
49075
|
+
for (const key of [...keyframeCache.keys(), ...gsapAnimations.keys()]) {
|
|
49076
|
+
const hash = key.indexOf("#");
|
|
48936
49077
|
if (hash < 0) continue;
|
|
48937
|
-
const sourceFile =
|
|
49078
|
+
const sourceFile = key.slice(0, hash);
|
|
48938
49079
|
if (keep.has(sourceFile)) continue;
|
|
48939
49080
|
const ids = stale.get(sourceFile) ?? /* @__PURE__ */ new Set();
|
|
48940
|
-
ids.add(
|
|
49081
|
+
ids.add(key.slice(hash + 1));
|
|
48941
49082
|
stale.set(sourceFile, ids);
|
|
48942
49083
|
}
|
|
48943
49084
|
publishKeyframeCache((draft) => {
|
|
@@ -48980,9 +49121,9 @@ function replaceKeyframeCacheForFile(sourceFile, entries, animationsByElement) {
|
|
|
48980
49121
|
}
|
|
48981
49122
|
function writeGsapAnimationsForElement(sourceFile, elementId2, animations) {
|
|
48982
49123
|
publishKeyframeCache((draft) => {
|
|
48983
|
-
for (const
|
|
48984
|
-
if (animations) draft.gsapAnimations.set(
|
|
48985
|
-
else draft.gsapAnimations.delete(
|
|
49124
|
+
for (const key of elementCacheKeys(sourceFile, elementId2)) {
|
|
49125
|
+
if (animations) draft.gsapAnimations.set(key, animations);
|
|
49126
|
+
else draft.gsapAnimations.delete(key);
|
|
48986
49127
|
}
|
|
48987
49128
|
});
|
|
48988
49129
|
}
|
|
@@ -49376,10 +49517,10 @@ async function materializeIfDynamic(anim, iframe, commitMutation, selection) {
|
|
|
49376
49517
|
void selection;
|
|
49377
49518
|
throw new GsapEditBlockedError("source-uneditable", "geometry-unresolved-source");
|
|
49378
49519
|
}
|
|
49379
|
-
function stepBlock([
|
|
49380
|
-
if (
|
|
49381
|
-
if (/^on[A-Z]/.test(
|
|
49382
|
-
if (isTweenConfigKey(
|
|
49520
|
+
function stepBlock([key, value]) {
|
|
49521
|
+
if (key === "delay") return "array-step-delay";
|
|
49522
|
+
if (/^on[A-Z]/.test(key)) return "array-step-callback";
|
|
49523
|
+
if (isTweenConfigKey(key)) return "array-step-config";
|
|
49383
49524
|
if (typeof value === "number") return null;
|
|
49384
49525
|
return STEP_VALUE_BLOCKS.find(([pattern]) => pattern.test(value))?.[1] ?? null;
|
|
49385
49526
|
}
|
|
@@ -50239,7 +50380,7 @@ async function commitWholePropertyOffset(selection, anim, newValues, currentPct,
|
|
|
50239
50380
|
const ts = resolveTweenStart(effectiveAnim);
|
|
50240
50381
|
const td = resolveTweenDuration(effectiveAnim);
|
|
50241
50382
|
const keys = Object.keys(newValues);
|
|
50242
|
-
const at = (props,
|
|
50383
|
+
const at = (props, key) => typeof props[key] === "number" ? props[key] : KEYFRAME_PROPERTY_DEFAULTS[key] ?? 0;
|
|
50243
50384
|
const kfs = effectiveAnim.keyframes?.keyframes ?? synthesizeFlatTweenKeyframes(effectiveAnim)?.keyframes;
|
|
50244
50385
|
if (!kfs || kfs.length === 0) {
|
|
50245
50386
|
await callbacks.commitMutation(
|
|
@@ -50254,9 +50395,9 @@ async function commitWholePropertyOffset(selection, anim, newValues, currentPct,
|
|
|
50254
50395
|
);
|
|
50255
50396
|
const shifted = kfs.map((kf) => {
|
|
50256
50397
|
const properties = { ...kf.properties };
|
|
50257
|
-
for (const
|
|
50258
|
-
properties[
|
|
50259
|
-
at(properties,
|
|
50398
|
+
for (const key of keys) {
|
|
50399
|
+
properties[key] = roundTo3(
|
|
50400
|
+
at(properties, key) + (newValues[key] - at(nearest.properties, key))
|
|
50260
50401
|
);
|
|
50261
50402
|
}
|
|
50262
50403
|
return { percentage: kf.percentage, properties, ...kf.ease ? { ease: kf.ease } : {} };
|
|
@@ -50963,9 +51104,9 @@ var SnapToolbar = memo32(function SnapToolbar2() {
|
|
|
50963
51104
|
[
|
|
50964
51105
|
["rulerVisible", "Ruler", Ruler],
|
|
50965
51106
|
["safeMarginsVisible", "Safe margins", FrameCorners]
|
|
50966
|
-
].map(([
|
|
50967
|
-
const visible =
|
|
50968
|
-
const toggle =
|
|
51107
|
+
].map(([key, label, Icon]) => {
|
|
51108
|
+
const visible = key === "rulerVisible" ? rulerVisible : safeMarginsVisible;
|
|
51109
|
+
const toggle = key === "rulerVisible" ? actions.toggleRulers : actions.toggleSafeMargins;
|
|
50969
51110
|
return /* @__PURE__ */ jsx117(
|
|
50970
51111
|
"button",
|
|
50971
51112
|
{
|
|
@@ -50973,14 +51114,14 @@ var SnapToolbar = memo32(function SnapToolbar2() {
|
|
|
50973
51114
|
className: `rounded-md p-1.5 transition-colors active:scale-[0.95] ${visible ? "bg-studio-accent/20 text-accent-ink" : "bg-black/40 text-white/60 hover:bg-black/60 hover:text-white/80"}`,
|
|
50974
51115
|
onClick: () => {
|
|
50975
51116
|
toggle();
|
|
50976
|
-
trackPreviewFeatureUsed(
|
|
51117
|
+
trackPreviewFeatureUsed(key === "rulerVisible" ? "ruler" : "safe_margins", "button");
|
|
50977
51118
|
},
|
|
50978
51119
|
title: `${label} ${visible ? "on" : "off"}`,
|
|
50979
51120
|
"aria-label": `Toggle ${label.toLowerCase()}`,
|
|
50980
51121
|
"aria-pressed": visible,
|
|
50981
51122
|
children: /* @__PURE__ */ jsx117(Icon, { size: 16, weight: visible ? "fill" : "regular" })
|
|
50982
51123
|
},
|
|
50983
|
-
|
|
51124
|
+
key
|
|
50984
51125
|
);
|
|
50985
51126
|
}),
|
|
50986
51127
|
/* @__PURE__ */ jsx117(
|
|
@@ -51319,21 +51460,6 @@ import { isXYPositionWrite, PROPERTY_GROUPS } from "@hyperframes/parsers/gsap-co
|
|
|
51319
51460
|
|
|
51320
51461
|
// src/hooks/gsapRuntimeReaders.ts
|
|
51321
51462
|
import { classifyPropertyGroup as classifyPropertyGroup3 } from "@hyperframes/core/gsap-parser";
|
|
51322
|
-
import {
|
|
51323
|
-
COLOR_GRADING_SOURCE_HIDDEN_ATTR as COLOR_GRADING_SOURCE_HIDDEN_ATTR3,
|
|
51324
|
-
HF_COLOR_GRADING_CANVAS_ID_PREFIX
|
|
51325
|
-
} from "@hyperframes/core/color-grading";
|
|
51326
|
-
function readLiveGsapValue(gsap3, el, prop) {
|
|
51327
|
-
if (prop === "opacity" && el.getAttribute(COLOR_GRADING_SOURCE_HIDDEN_ATTR3) != null && el.id) {
|
|
51328
|
-
const canvas = el.ownerDocument.getElementById(HF_COLOR_GRADING_CANVAS_ID_PREFIX + el.id);
|
|
51329
|
-
const win = el.ownerDocument.defaultView;
|
|
51330
|
-
if (canvas && win) {
|
|
51331
|
-
const val = Number(win.getComputedStyle(canvas).opacity);
|
|
51332
|
-
if (Number.isFinite(val)) return val;
|
|
51333
|
-
}
|
|
51334
|
-
}
|
|
51335
|
-
return Number(gsap3.getProperty(el, prop));
|
|
51336
|
-
}
|
|
51337
51463
|
function readGsapProperty(iframe, selector, prop) {
|
|
51338
51464
|
if (!selector) return null;
|
|
51339
51465
|
const gsap3 = getIframeGsap(iframe);
|
|
@@ -51341,7 +51467,7 @@ function readGsapProperty(iframe, selector, prop) {
|
|
|
51341
51467
|
const el = queryIframeElement(iframe, selector);
|
|
51342
51468
|
if (!el) return null;
|
|
51343
51469
|
try {
|
|
51344
|
-
const val =
|
|
51470
|
+
const val = Number(gsap3.getProperty(el, prop));
|
|
51345
51471
|
if (!Number.isFinite(val)) return null;
|
|
51346
51472
|
return POSITION_PROPS.has(prop) ? Math.round(val) : roundTo3(val);
|
|
51347
51473
|
} catch {
|
|
@@ -51374,7 +51500,7 @@ function readAllAnimatedProperties(iframe, selector, anim, group) {
|
|
|
51374
51500
|
const inGroup = (p) => !group || classifyPropertyGroup3(p) === group;
|
|
51375
51501
|
const groupedPropKeys = new Set([...propKeys].filter(inGroup));
|
|
51376
51502
|
for (const prop of groupedPropKeys) {
|
|
51377
|
-
const val =
|
|
51503
|
+
const val = Number(gsap3.getProperty(el, prop));
|
|
51378
51504
|
if (Number.isFinite(val)) {
|
|
51379
51505
|
result[prop] = POSITION_PROPS.has(prop) ? Math.round(val) : roundTo3(val);
|
|
51380
51506
|
}
|
|
@@ -51880,14 +52006,14 @@ function hasAnimations(value) {
|
|
|
51880
52006
|
var inFlightParses = /* @__PURE__ */ new Map();
|
|
51881
52007
|
var parseCacheKey = (projectId, sourceFile) => `${projectId}|${sourceFile}`;
|
|
51882
52008
|
function fetchParsedAnimations(projectId, sourceFile, options = {}) {
|
|
51883
|
-
const
|
|
51884
|
-
if (options.fresh) inFlightParses.delete(
|
|
51885
|
-
const inFlight = inFlightParses.get(
|
|
52009
|
+
const key = parseCacheKey(projectId, sourceFile);
|
|
52010
|
+
if (options.fresh) inFlightParses.delete(key);
|
|
52011
|
+
const inFlight = inFlightParses.get(key);
|
|
51886
52012
|
if (inFlight) return inFlight;
|
|
51887
52013
|
const request2 = requestParsedAnimations(projectId, sourceFile).finally(() => {
|
|
51888
|
-
if (inFlightParses.get(
|
|
52014
|
+
if (inFlightParses.get(key) === request2) inFlightParses.delete(key);
|
|
51889
52015
|
});
|
|
51890
|
-
inFlightParses.set(
|
|
52016
|
+
inFlightParses.set(key, request2);
|
|
51891
52017
|
return request2;
|
|
51892
52018
|
}
|
|
51893
52019
|
async function requestParsedAnimations(projectId, sourceFile) {
|
|
@@ -52065,7 +52191,7 @@ function useGsapAnimationsForElement(projectId, sourceFile, target, version, ifr
|
|
|
52065
52191
|
if (allKeyframes.length === 0) {
|
|
52066
52192
|
const { keyframeCache } = usePlayerStore.getState();
|
|
52067
52193
|
const hasCached = elementCacheKeys(sourceFile, elementId2).some(
|
|
52068
|
-
(
|
|
52194
|
+
(key) => keyframeCache.has(key)
|
|
52069
52195
|
);
|
|
52070
52196
|
if (!hasCached) clearKeyframeCacheForElement(sourceFile, elementId2);
|
|
52071
52197
|
return;
|
|
@@ -52078,8 +52204,8 @@ function useGsapAnimationsForElement(projectId, sourceFile, target, version, ifr
|
|
|
52078
52204
|
...easeEach ? { easeEach } : {}
|
|
52079
52205
|
};
|
|
52080
52206
|
publishKeyframeCache((draft) => {
|
|
52081
|
-
for (const
|
|
52082
|
-
draft.keyframeCache.set(
|
|
52207
|
+
for (const key of elementCacheKeys(sourceFile, elementId2)) {
|
|
52208
|
+
draft.keyframeCache.set(key, merged);
|
|
52083
52209
|
}
|
|
52084
52210
|
});
|
|
52085
52211
|
}, [elementId2, sourceFile, animations, domClipChildrenKey]);
|
|
@@ -52141,7 +52267,7 @@ function usePopulateKeyframeCacheForFile(projectId, sourceFile, version, iframeR
|
|
|
52141
52267
|
publishKeyframeCache((draft) => {
|
|
52142
52268
|
for (const [id, data] of scanned) {
|
|
52143
52269
|
const keys = elementCacheKeys(sf, id);
|
|
52144
|
-
if (keys.some((
|
|
52270
|
+
if (keys.some((key) => draft.keyframeCache.has(key))) continue;
|
|
52145
52271
|
const isPosOnly = data.keyframes.length === 1 && Object.keys(data.keyframes[0].properties).every((k) => k === "x" || k === "y");
|
|
52146
52272
|
if (isPosOnly) {
|
|
52147
52273
|
continue;
|
|
@@ -52151,7 +52277,7 @@ function usePopulateKeyframeCacheForFile(projectId, sourceFile, version, iframeR
|
|
|
52151
52277
|
keyframes: data.keyframes,
|
|
52152
52278
|
...data.easeEach ? { easeEach: data.easeEach } : {}
|
|
52153
52279
|
};
|
|
52154
|
-
for (const
|
|
52280
|
+
for (const key of keys) draft.keyframeCache.set(key, entry3);
|
|
52155
52281
|
}
|
|
52156
52282
|
});
|
|
52157
52283
|
runtimeScanDoneRef.current = `kf-cache:${projectId}:${sf}:${version}`;
|
|
@@ -52282,8 +52408,8 @@ function useTimelineEditCallbacks({
|
|
|
52282
52408
|
const { gsapAnimations } = usePlayerStore.getState();
|
|
52283
52409
|
const { sourceFile, domId } = splitTimelineElementKey(elementKey3);
|
|
52284
52410
|
const scope = sourceFile ?? activeCompPath ?? "index.html";
|
|
52285
|
-
for (const
|
|
52286
|
-
const animations = gsapAnimations.get(
|
|
52411
|
+
for (const key of elementCacheKeys(scope, domId)) {
|
|
52412
|
+
const animations = gsapAnimations.get(key);
|
|
52287
52413
|
if (animations) return animations;
|
|
52288
52414
|
}
|
|
52289
52415
|
return [];
|
|
@@ -53498,8 +53624,8 @@ function transformReceipt(request2, initial, box, observations, failure2) {
|
|
|
53498
53624
|
const unchanged = Object.fromEntries(
|
|
53499
53625
|
observations.flatMap((item) => {
|
|
53500
53626
|
if (!item.unchangedReason) return [];
|
|
53501
|
-
const
|
|
53502
|
-
return [[
|
|
53627
|
+
const key = item.operation === "rotate" ? "rotation" : item.operation;
|
|
53628
|
+
return [[key, item.unchangedReason]];
|
|
53503
53629
|
})
|
|
53504
53630
|
);
|
|
53505
53631
|
const value = {
|
|
@@ -53711,14 +53837,14 @@ async function studioAddKeyframe(deps, input, signal = new AbortController().sig
|
|
|
53711
53837
|
);
|
|
53712
53838
|
}
|
|
53713
53839
|
const properties = {};
|
|
53714
|
-
for (const [
|
|
53840
|
+
for (const [key, value] of Object.entries(raw)) {
|
|
53715
53841
|
if (isRawGsapExpression(value)) {
|
|
53716
53842
|
return preDispatchFailure2(
|
|
53717
53843
|
"add-keyframe",
|
|
53718
53844
|
toolFailure("invalid", "raw JavaScript expressions are not accepted")
|
|
53719
53845
|
);
|
|
53720
53846
|
}
|
|
53721
|
-
if (typeof value === "number" || typeof value === "string") properties[
|
|
53847
|
+
if (typeof value === "number" || typeof value === "string") properties[key] = value;
|
|
53722
53848
|
}
|
|
53723
53849
|
if (Object.keys(properties).length === 0) {
|
|
53724
53850
|
return preDispatchFailure2(
|
|
@@ -53992,12 +54118,12 @@ function buildStudioTools(depsRef) {
|
|
|
53992
54118
|
}
|
|
53993
54119
|
];
|
|
53994
54120
|
}
|
|
53995
|
-
function readStringInput(input,
|
|
53996
|
-
const value = Reflect.get(input,
|
|
54121
|
+
function readStringInput(input, key) {
|
|
54122
|
+
const value = Reflect.get(input, key);
|
|
53997
54123
|
return typeof value === "string" ? value : "";
|
|
53998
54124
|
}
|
|
53999
|
-
function readNumberInput(input,
|
|
54000
|
-
const value = Reflect.get(input,
|
|
54125
|
+
function readNumberInput(input, key) {
|
|
54126
|
+
const value = Reflect.get(input, key);
|
|
54001
54127
|
return typeof value === "number" ? value : Number.NaN;
|
|
54002
54128
|
}
|
|
54003
54129
|
function useStudioAgentTools(deps) {
|
|
@@ -54342,14 +54468,14 @@ function DockStripActions({
|
|
|
54342
54468
|
panels,
|
|
54343
54469
|
isGroupActive
|
|
54344
54470
|
}) {
|
|
54345
|
-
const
|
|
54471
|
+
const subscribe2 = useCallback75(
|
|
54346
54472
|
(onChange) => {
|
|
54347
54473
|
const subscription = containerApi.onDidMaximizedGroupChange(onChange);
|
|
54348
54474
|
return () => subscription.dispose();
|
|
54349
54475
|
},
|
|
54350
54476
|
[containerApi]
|
|
54351
54477
|
);
|
|
54352
|
-
const maximized = useSyncExternalStore9(
|
|
54478
|
+
const maximized = useSyncExternalStore9(subscribe2, () => api.isMaximized());
|
|
54353
54479
|
const openPanels = useDockLayoutStore((state) => state.openPanels);
|
|
54354
54480
|
const togglePanel = useDockLayoutStore((state) => state.togglePanel);
|
|
54355
54481
|
const resetLayout = useDockLayoutStore((state) => state.resetLayout);
|
|
@@ -54432,14 +54558,14 @@ var TAB_ICONS = {
|
|
|
54432
54558
|
motionBlur: Aperture
|
|
54433
54559
|
};
|
|
54434
54560
|
function DockTab({ api }) {
|
|
54435
|
-
const
|
|
54561
|
+
const subscribe2 = useCallback76(
|
|
54436
54562
|
(onChange) => {
|
|
54437
54563
|
const subscription = api.onDidTitleChange(onChange);
|
|
54438
54564
|
return () => subscription.dispose();
|
|
54439
54565
|
},
|
|
54440
54566
|
[api]
|
|
54441
54567
|
);
|
|
54442
|
-
const title = useSyncExternalStore10(
|
|
54568
|
+
const title = useSyncExternalStore10(subscribe2, () => api.title ?? "");
|
|
54443
54569
|
const TypeIcon = isPanelId(api.id) ? TAB_ICONS[api.id] : null;
|
|
54444
54570
|
return /* @__PURE__ */ jsxs86("div", { className: "hf-dock-tab", children: [
|
|
54445
54571
|
TypeIcon ? /* @__PURE__ */ jsx122(TypeIcon, { className: "hf-dock-tab-icon", size: 14, "aria-hidden": true }) : null,
|
|
@@ -55863,11 +55989,11 @@ function trackDesignInput(descriptor) {
|
|
|
55863
55989
|
const section = slugifyDesignInput(descriptor.section) || "unknown";
|
|
55864
55990
|
const name = slugifyDesignInput(descriptor.name);
|
|
55865
55991
|
const control = descriptor.control || "unknown";
|
|
55866
|
-
const
|
|
55992
|
+
const key = `${descriptor.ui}:${section}:${control}:${name || "unnamed"}`;
|
|
55867
55993
|
const t2 = now();
|
|
55868
|
-
const last = lastFiredByKey.get(
|
|
55994
|
+
const last = lastFiredByKey.get(key);
|
|
55869
55995
|
if (last !== void 0 && t2 - last < COALESCE_WINDOW_MS) return;
|
|
55870
|
-
lastFiredByKey.set(
|
|
55996
|
+
lastFiredByKey.set(key, t2);
|
|
55871
55997
|
trackStudioEvent("design_input", {
|
|
55872
55998
|
ui: descriptor.ui,
|
|
55873
55999
|
section,
|
|
@@ -56179,9 +56305,9 @@ function uniqueFontFamilies(values, seen = /* @__PURE__ */ new Set()) {
|
|
|
56179
56305
|
return values.reduce((result, value) => {
|
|
56180
56306
|
const family = value.trim();
|
|
56181
56307
|
if (!family) return result;
|
|
56182
|
-
const
|
|
56183
|
-
if (seen.has(
|
|
56184
|
-
seen.add(
|
|
56308
|
+
const key = family.toLowerCase();
|
|
56309
|
+
if (seen.has(key)) return result;
|
|
56310
|
+
seen.add(key);
|
|
56185
56311
|
result.push(family);
|
|
56186
56312
|
return result;
|
|
56187
56313
|
}, []);
|
|
@@ -56191,9 +56317,9 @@ function uniqueFontOptions(values) {
|
|
|
56191
56317
|
return values.reduce((result, value) => {
|
|
56192
56318
|
const family = value.family.trim();
|
|
56193
56319
|
if (!family) return result;
|
|
56194
|
-
const
|
|
56195
|
-
if (seen.has(
|
|
56196
|
-
seen.add(
|
|
56320
|
+
const key = family.toLowerCase();
|
|
56321
|
+
if (seen.has(key)) return result;
|
|
56322
|
+
seen.add(key);
|
|
56197
56323
|
result.push({ family, source: value.source });
|
|
56198
56324
|
return result;
|
|
56199
56325
|
}, []);
|
|
@@ -56629,9 +56755,9 @@ function useInspectorGestureDraft({
|
|
|
56629
56755
|
|
|
56630
56756
|
// src/components/editor/propertyPanelCommitField.tsx
|
|
56631
56757
|
import { jsx as jsx132 } from "react/jsx-runtime";
|
|
56632
|
-
function arrowDirection(
|
|
56633
|
-
if (
|
|
56634
|
-
if (
|
|
56758
|
+
function arrowDirection(key) {
|
|
56759
|
+
if (key === "ArrowUp") return 1;
|
|
56760
|
+
if (key === "ArrowDown") return -1;
|
|
56635
56761
|
return null;
|
|
56636
56762
|
}
|
|
56637
56763
|
function CommitField({
|
|
@@ -57945,21 +58071,21 @@ function colorGradingWithLut(grading, src, intensity = 1) {
|
|
|
57945
58071
|
lut: src ? { src, intensity } : null
|
|
57946
58072
|
};
|
|
57947
58073
|
}
|
|
57948
|
-
function colorGradingWithDetail(grading,
|
|
58074
|
+
function colorGradingWithDetail(grading, key, value) {
|
|
57949
58075
|
return {
|
|
57950
58076
|
...grading,
|
|
57951
58077
|
intensity: visibleColorGradingIntensity(grading),
|
|
57952
|
-
details: { ...grading.details, [
|
|
58078
|
+
details: { ...grading.details, [key]: value }
|
|
57953
58079
|
};
|
|
57954
58080
|
}
|
|
57955
58081
|
function colorGradingWithIntensity(grading, intensity) {
|
|
57956
58082
|
return { ...grading, intensity };
|
|
57957
58083
|
}
|
|
57958
|
-
function colorGradingWithAdjust(grading,
|
|
58084
|
+
function colorGradingWithAdjust(grading, key, value) {
|
|
57959
58085
|
return {
|
|
57960
58086
|
...grading,
|
|
57961
58087
|
intensity: visibleColorGradingIntensity(grading),
|
|
57962
|
-
adjust: { ...grading.adjust, [
|
|
58088
|
+
adjust: { ...grading.adjust, [key]: value }
|
|
57963
58089
|
};
|
|
57964
58090
|
}
|
|
57965
58091
|
async function importFirstLut(files, onImportAssets) {
|
|
@@ -60610,7 +60736,7 @@ function VariablePromoteProvider({
|
|
|
60610
60736
|
}
|
|
60611
60737
|
function useVariablePromoteChannel(channel) {
|
|
60612
60738
|
const ctx3 = useContext14(VariablePromoteContext);
|
|
60613
|
-
const
|
|
60739
|
+
const key = channel.kind === "style" ? `style:${channel.prop}` : channel.kind;
|
|
60614
60740
|
return useMemo56(() => {
|
|
60615
60741
|
if (!ctx3 || !ctx3.session || !ctx3.selection?.hfId) return null;
|
|
60616
60742
|
const { session, selection, actions, declarations, persist: persist2, onPersistError } = ctx3;
|
|
@@ -60640,7 +60766,7 @@ function useVariablePromoteChannel(channel) {
|
|
|
60640
60766
|
).catch(onPersistError);
|
|
60641
60767
|
}
|
|
60642
60768
|
};
|
|
60643
|
-
}, [ctx3,
|
|
60769
|
+
}, [ctx3, key]);
|
|
60644
60770
|
}
|
|
60645
60771
|
|
|
60646
60772
|
// src/components/editor/PromotableControl.tsx
|
|
@@ -63586,10 +63712,10 @@ var ANIMATION_META_LABELS = {
|
|
|
63586
63712
|
easeEach: { control: "select", name: "Speed" }
|
|
63587
63713
|
};
|
|
63588
63714
|
function trackAnimationMetaUpdate(track2, updates) {
|
|
63589
|
-
for (const
|
|
63590
|
-
const mapped = ANIMATION_META_LABELS[
|
|
63715
|
+
for (const key of Object.keys(updates)) {
|
|
63716
|
+
const mapped = ANIMATION_META_LABELS[key];
|
|
63591
63717
|
if (mapped) track2(mapped.control, mapped.name);
|
|
63592
|
-
else track2("select",
|
|
63718
|
+
else track2("select", key);
|
|
63593
63719
|
}
|
|
63594
63720
|
}
|
|
63595
63721
|
function withTrackedGsapAnimationCallbacks(callbacks, track2) {
|
|
@@ -64954,9 +65080,9 @@ function FlatGroupHeader({
|
|
|
64954
65080
|
}
|
|
64955
65081
|
);
|
|
64956
65082
|
}
|
|
64957
|
-
function sliderKeyTarget(
|
|
64958
|
-
if (
|
|
64959
|
-
if (
|
|
65083
|
+
function sliderKeyTarget(key, current2, min, max, step) {
|
|
65084
|
+
if (key === "Home") return min;
|
|
65085
|
+
if (key === "End") return max;
|
|
64960
65086
|
const deltas = {
|
|
64961
65087
|
ArrowLeft: -step,
|
|
64962
65088
|
ArrowDown: -step,
|
|
@@ -64965,7 +65091,7 @@ function sliderKeyTarget(key2, current2, min, max, step) {
|
|
|
64965
65091
|
PageDown: -step * 10,
|
|
64966
65092
|
PageUp: step * 10
|
|
64967
65093
|
};
|
|
64968
|
-
const delta = deltas[
|
|
65094
|
+
const delta = deltas[key];
|
|
64969
65095
|
if (delta === void 0) return null;
|
|
64970
65096
|
return Math.max(min, Math.min(max, current2 + delta));
|
|
64971
65097
|
}
|
|
@@ -66877,11 +67003,11 @@ function FxParams({
|
|
|
66877
67003
|
onRemoveAutomation
|
|
66878
67004
|
}) {
|
|
66879
67005
|
const set = useCallback92(
|
|
66880
|
-
(
|
|
67006
|
+
(key, value) => onChange({ ...params, [key]: value }),
|
|
66881
67007
|
[params, onChange]
|
|
66882
67008
|
);
|
|
66883
67009
|
const commit2 = useCallback92(
|
|
66884
|
-
(
|
|
67010
|
+
(key, value) => onCommit?.({ ...params, [key]: value }),
|
|
66885
67011
|
[params, onCommit]
|
|
66886
67012
|
);
|
|
66887
67013
|
return /* @__PURE__ */ jsx171("div", { className: "hf-fx-params space-y-0.5 border-t border-panel-border-input px-1.5 py-1.5", children: def.params.map((p) => {
|
|
@@ -67668,21 +67794,21 @@ function FxNodeParams({
|
|
|
67668
67794
|
onChange: (params) => onPreview(index2, params),
|
|
67669
67795
|
onCommit: (next) => {
|
|
67670
67796
|
const before = node.params ?? defaultAudioFxParams3(node.type);
|
|
67671
|
-
for (const [
|
|
67672
|
-
if (before[
|
|
67797
|
+
for (const [key, value] of Object.entries(next)) {
|
|
67798
|
+
if (before[key] === value) continue;
|
|
67673
67799
|
if (typeof value !== "number" && typeof value !== "string") continue;
|
|
67674
|
-
trackParamCommitted(node.type,
|
|
67675
|
-
trackInput(typeof value === "number" ? "slider" : "select",
|
|
67800
|
+
trackParamCommitted(node.type, key, value, "details", { trackKind });
|
|
67801
|
+
trackInput(typeof value === "number" ? "slider" : "select", key);
|
|
67676
67802
|
}
|
|
67677
67803
|
onUpdate(index2, { params: next });
|
|
67678
67804
|
},
|
|
67679
67805
|
automatedKeys: automatedKeysOf(node, def.params, automatedTargets),
|
|
67680
|
-
onAutomate: nodeId && onAutomateParam ? (
|
|
67681
|
-
onAutomateParam(nodeId,
|
|
67806
|
+
onAutomate: nodeId && onAutomateParam ? (key) => {
|
|
67807
|
+
onAutomateParam(nodeId, key);
|
|
67682
67808
|
trackInput("button", "automate-param");
|
|
67683
67809
|
} : void 0,
|
|
67684
|
-
onRemoveAutomation: nodeId && onRemoveParamAutomation ? (
|
|
67685
|
-
onRemoveParamAutomation(nodeId,
|
|
67810
|
+
onRemoveAutomation: nodeId && onRemoveParamAutomation ? (key) => {
|
|
67811
|
+
onRemoveParamAutomation(nodeId, key);
|
|
67686
67812
|
trackInput("button", "remove-param-automation");
|
|
67687
67813
|
} : void 0
|
|
67688
67814
|
}
|
|
@@ -70182,19 +70308,19 @@ function movePoint(points, index2, input, output, tab) {
|
|
|
70182
70308
|
return { points: next, selected: next.indexOf(moved) };
|
|
70183
70309
|
}
|
|
70184
70310
|
var ARROW_KEYS = ["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown"];
|
|
70185
|
-
function isArrowKey(
|
|
70186
|
-
return ARROW_KEYS.includes(
|
|
70311
|
+
function isArrowKey(key) {
|
|
70312
|
+
return ARROW_KEYS.includes(key);
|
|
70187
70313
|
}
|
|
70188
70314
|
function curveOutputStep(tab, large) {
|
|
70189
70315
|
if (tab.kind === "rgb") return large ? 0.05 : 0.01;
|
|
70190
70316
|
if (tab.key === "hueVsHue") return large ? 10 : 1;
|
|
70191
70317
|
return large ? 0.1 : 0.01;
|
|
70192
70318
|
}
|
|
70193
|
-
function keyboardPointPosition(point,
|
|
70319
|
+
function keyboardPointPosition(point, key, tab, large) {
|
|
70194
70320
|
const inputStep = tab.kind === "rgb" ? large ? 0.05 : 0.01 : large ? 10 : 1;
|
|
70195
70321
|
const outputStep = curveOutputStep(tab, large);
|
|
70196
|
-
const inputDelta =
|
|
70197
|
-
const outputDelta =
|
|
70322
|
+
const inputDelta = key === "ArrowLeft" ? -inputStep : key === "ArrowRight" ? inputStep : 0;
|
|
70323
|
+
const outputDelta = key === "ArrowDown" ? -outputStep : key === "ArrowUp" ? outputStep : 0;
|
|
70198
70324
|
return { input: point[0] + inputDelta, output: point[1] + outputDelta };
|
|
70199
70325
|
}
|
|
70200
70326
|
function CurveGraph({
|
|
@@ -70231,11 +70357,11 @@ function CurveGraph({
|
|
|
70231
70357
|
onPreview(inserted.points, inserted.selected);
|
|
70232
70358
|
onSettle();
|
|
70233
70359
|
};
|
|
70234
|
-
const moveSelectedByKeyboard = (
|
|
70360
|
+
const moveSelectedByKeyboard = (key, large) => {
|
|
70235
70361
|
if (selectedIndex === null) return false;
|
|
70236
70362
|
const selected = points[selectedIndex];
|
|
70237
70363
|
if (!selected) return false;
|
|
70238
|
-
const position = keyboardPointPosition(selected,
|
|
70364
|
+
const position = keyboardPointPosition(selected, key, tab, large);
|
|
70239
70365
|
const moved = movePoint(points, selectedIndex, position.input, position.output, tab);
|
|
70240
70366
|
onBegin();
|
|
70241
70367
|
onPreview(moved.points, moved.selected);
|
|
@@ -70740,16 +70866,16 @@ function rgbToHsv2(red, green, blue) {
|
|
|
70740
70866
|
value: max
|
|
70741
70867
|
};
|
|
70742
70868
|
}
|
|
70743
|
-
function colorGradingSecondaryMask(red, green, blue,
|
|
70869
|
+
function colorGradingSecondaryMask(red, green, blue, key) {
|
|
70744
70870
|
const hsv = rgbToHsv2(red / BYTE_MAX, green / BYTE_MAX, blue / BYTE_MAX);
|
|
70745
70871
|
return calculateHfColorGradingSecondaryMask(
|
|
70746
70872
|
hsv.hue,
|
|
70747
70873
|
hsv.saturation,
|
|
70748
70874
|
rec709Luma(red / BYTE_MAX, green / BYTE_MAX, blue / BYTE_MAX),
|
|
70749
|
-
|
|
70875
|
+
key
|
|
70750
70876
|
);
|
|
70751
70877
|
}
|
|
70752
|
-
function buildColorGradingSecondaryMatte(pixels, width, height,
|
|
70878
|
+
function buildColorGradingSecondaryMatte(pixels, width, height, key) {
|
|
70753
70879
|
const matte = new Uint8ClampedArray(width * height * 4);
|
|
70754
70880
|
for (let offset = 0; offset < pixels.length; offset += 4) {
|
|
70755
70881
|
const alpha = pixels[offset + 3] ?? 0;
|
|
@@ -70757,7 +70883,7 @@ function buildColorGradingSecondaryMatte(pixels, width, height, key2) {
|
|
|
70757
70883
|
pixels[offset] ?? 0,
|
|
70758
70884
|
pixels[offset + 1] ?? 0,
|
|
70759
70885
|
pixels[offset + 2] ?? 0,
|
|
70760
|
-
|
|
70886
|
+
key
|
|
70761
70887
|
);
|
|
70762
70888
|
const value = Math.round(mask * BYTE_MAX);
|
|
70763
70889
|
matte[offset] = value;
|
|
@@ -71332,14 +71458,14 @@ function PropertyPanelColorSecondary({
|
|
|
71332
71458
|
"aria-label": "Sample color from captured frame",
|
|
71333
71459
|
onClick: (event) => {
|
|
71334
71460
|
const pointer = event.detail === 0 ? [] : [event.clientX, event.clientY];
|
|
71335
|
-
const
|
|
71461
|
+
const key = sampleCapturedFrame(
|
|
71336
71462
|
samplePixels,
|
|
71337
71463
|
sampleFrame,
|
|
71338
71464
|
event.currentTarget,
|
|
71339
71465
|
...pointer
|
|
71340
71466
|
);
|
|
71341
|
-
if (!
|
|
71342
|
-
replaceSelected({ ...selected, key
|
|
71467
|
+
if (!key) return;
|
|
71468
|
+
replaceSelected({ ...selected, key });
|
|
71343
71469
|
setShowMatte(true);
|
|
71344
71470
|
},
|
|
71345
71471
|
children: /* @__PURE__ */ jsx189(
|
|
@@ -71417,10 +71543,10 @@ function PropertyPanelColorSecondary({
|
|
|
71417
71543
|
})
|
|
71418
71544
|
}
|
|
71419
71545
|
),
|
|
71420
|
-
["saturation", "luma"].flatMap((
|
|
71421
|
-
const label =
|
|
71422
|
-
const range = selected.key[
|
|
71423
|
-
const capability = SECONDARY_CAPABILITIES[
|
|
71546
|
+
["saturation", "luma"].flatMap((key) => {
|
|
71547
|
+
const label = key === "saturation" ? "Saturation" : "Luma";
|
|
71548
|
+
const range = selected.key[key];
|
|
71549
|
+
const capability = SECONDARY_CAPABILITIES[key];
|
|
71424
71550
|
return [
|
|
71425
71551
|
/* @__PURE__ */ jsx189(
|
|
71426
71552
|
FlatSlider,
|
|
@@ -71435,7 +71561,7 @@ function PropertyPanelColorSecondary({
|
|
|
71435
71561
|
...selected,
|
|
71436
71562
|
key: {
|
|
71437
71563
|
...selected.key,
|
|
71438
|
-
[
|
|
71564
|
+
[key]: {
|
|
71439
71565
|
...range,
|
|
71440
71566
|
min: Math.max(
|
|
71441
71567
|
capability.min.min,
|
|
@@ -71445,7 +71571,7 @@ function PropertyPanelColorSecondary({
|
|
|
71445
71571
|
}
|
|
71446
71572
|
})
|
|
71447
71573
|
},
|
|
71448
|
-
`${
|
|
71574
|
+
`${key}-min`
|
|
71449
71575
|
),
|
|
71450
71576
|
/* @__PURE__ */ jsx189(
|
|
71451
71577
|
FlatSlider,
|
|
@@ -71460,7 +71586,7 @@ function PropertyPanelColorSecondary({
|
|
|
71460
71586
|
...selected,
|
|
71461
71587
|
key: {
|
|
71462
71588
|
...selected.key,
|
|
71463
|
-
[
|
|
71589
|
+
[key]: {
|
|
71464
71590
|
...range,
|
|
71465
71591
|
max: Math.min(
|
|
71466
71592
|
capability.max.max,
|
|
@@ -71470,7 +71596,7 @@ function PropertyPanelColorSecondary({
|
|
|
71470
71596
|
}
|
|
71471
71597
|
})
|
|
71472
71598
|
},
|
|
71473
|
-
`${
|
|
71599
|
+
`${key}-max`
|
|
71474
71600
|
),
|
|
71475
71601
|
/* @__PURE__ */ jsx189(
|
|
71476
71602
|
FlatSlider,
|
|
@@ -71485,18 +71611,18 @@ function PropertyPanelColorSecondary({
|
|
|
71485
71611
|
...selected,
|
|
71486
71612
|
key: {
|
|
71487
71613
|
...selected.key,
|
|
71488
|
-
[
|
|
71614
|
+
[key]: { ...range, softness: value / PERCENT_SCALE }
|
|
71489
71615
|
}
|
|
71490
71616
|
})
|
|
71491
71617
|
},
|
|
71492
|
-
`${
|
|
71618
|
+
`${key}-softness`
|
|
71493
71619
|
)
|
|
71494
71620
|
];
|
|
71495
71621
|
}),
|
|
71496
71622
|
/* @__PURE__ */ jsx189("div", { className: "pt-1 text-[9px] font-semibold uppercase tracking-[0.12em] text-panel-text-5", children: "Correction" }),
|
|
71497
|
-
CORRECTION_CONTROLS.map(([
|
|
71498
|
-
const limit = SECONDARY_CAPABILITIES.correction[
|
|
71499
|
-
const value = selected.correction[
|
|
71623
|
+
CORRECTION_CONTROLS.map(([key, label, scale, suffix]) => {
|
|
71624
|
+
const limit = SECONDARY_CAPABILITIES.correction[key];
|
|
71625
|
+
const value = selected.correction[key] * scale;
|
|
71500
71626
|
return /* @__PURE__ */ jsx189(
|
|
71501
71627
|
FlatSlider,
|
|
71502
71628
|
{
|
|
@@ -71509,14 +71635,14 @@ function PropertyPanelColorSecondary({
|
|
|
71509
71635
|
displayValue: `${Math.round(value)}${suffix}`,
|
|
71510
71636
|
onCommit: (next) => replaceSelected({
|
|
71511
71637
|
...selected,
|
|
71512
|
-
correction: { ...selected.correction, [
|
|
71638
|
+
correction: { ...selected.correction, [key]: next / scale }
|
|
71513
71639
|
}),
|
|
71514
71640
|
onReset: () => replaceSelected({
|
|
71515
71641
|
...selected,
|
|
71516
|
-
correction: { ...selected.correction, [
|
|
71642
|
+
correction: { ...selected.correction, [key]: 0 }
|
|
71517
71643
|
})
|
|
71518
71644
|
},
|
|
71519
|
-
|
|
71645
|
+
key
|
|
71520
71646
|
);
|
|
71521
71647
|
})
|
|
71522
71648
|
] })
|
|
@@ -71561,13 +71687,13 @@ function wheelFromPointer(wheel, clientX, clientY, rect) {
|
|
|
71561
71687
|
amount: clampNumber(Math.hypot(x, y), WHEEL_CONTROLS.amount.min, WHEEL_CONTROLS.amount.max)
|
|
71562
71688
|
};
|
|
71563
71689
|
}
|
|
71564
|
-
function updateWheel(value,
|
|
71565
|
-
return { ...value, [
|
|
71690
|
+
function updateWheel(value, key, wheel) {
|
|
71691
|
+
return { ...value, [key]: wheel };
|
|
71566
71692
|
}
|
|
71567
|
-
function wheelFromKey(wheel,
|
|
71693
|
+
function wheelFromKey(wheel, key, large) {
|
|
71568
71694
|
const hueStep = large ? 10 : 1;
|
|
71569
71695
|
const amountStep = large ? 0.1 : 0.01;
|
|
71570
|
-
switch (
|
|
71696
|
+
switch (key) {
|
|
71571
71697
|
case "ArrowLeft":
|
|
71572
71698
|
return { ...wheel, hue: wrapHue(wheel.hue - hueStep) };
|
|
71573
71699
|
case "ArrowRight":
|
|
@@ -71796,10 +71922,10 @@ function ColorWheels({
|
|
|
71796
71922
|
onPreview,
|
|
71797
71923
|
onCommit
|
|
71798
71924
|
});
|
|
71799
|
-
const previewWheel = (
|
|
71800
|
-
const resetWheel = (
|
|
71925
|
+
const previewWheel = (key, wheel) => transaction.preview(updateWheel(draft, key, wheel));
|
|
71926
|
+
const resetWheel = (key) => {
|
|
71801
71927
|
transaction.cancel();
|
|
71802
|
-
const next = updateWheel(draft,
|
|
71928
|
+
const next = updateWheel(draft, key, RESET_WHEEL);
|
|
71803
71929
|
setDraft(next);
|
|
71804
71930
|
onCommit(next);
|
|
71805
71931
|
};
|
|
@@ -71808,19 +71934,19 @@ function ColorWheels({
|
|
|
71808
71934
|
{
|
|
71809
71935
|
"data-color-wheels": "true",
|
|
71810
71936
|
className: "grid grid-cols-[repeat(auto-fit,minmax(88px,1fr))] gap-2",
|
|
71811
|
-
children: WHEELS.map(({ key
|
|
71937
|
+
children: WHEELS.map(({ key, label }) => /* @__PURE__ */ jsx190(
|
|
71812
71938
|
TonalWheel,
|
|
71813
71939
|
{
|
|
71814
71940
|
label,
|
|
71815
|
-
wheel: draft[
|
|
71941
|
+
wheel: draft[key],
|
|
71816
71942
|
disabled,
|
|
71817
71943
|
onBegin: transaction.begin,
|
|
71818
|
-
onPreview: (wheel) => previewWheel(
|
|
71944
|
+
onPreview: (wheel) => previewWheel(key, wheel),
|
|
71819
71945
|
onSettle: transaction.settle,
|
|
71820
71946
|
onCancel: transaction.cancel,
|
|
71821
|
-
onReset: () => resetWheel(
|
|
71947
|
+
onReset: () => resetWheel(key)
|
|
71822
71948
|
},
|
|
71823
|
-
|
|
71949
|
+
key
|
|
71824
71950
|
))
|
|
71825
71951
|
}
|
|
71826
71952
|
);
|
|
@@ -71936,16 +72062,16 @@ function FlatColorGradingAccessory({
|
|
|
71936
72062
|
|
|
71937
72063
|
// src/components/editor/propertyPanelFlatColorGradingSection.tsx
|
|
71938
72064
|
import { jsx as jsx192, jsxs as jsxs147 } from "react/jsx-runtime";
|
|
71939
|
-
function formatAdjustValue(
|
|
71940
|
-
if (
|
|
72065
|
+
function formatAdjustValue(key, rawPercent) {
|
|
72066
|
+
if (key === "exposure") {
|
|
71941
72067
|
const stops = rawPercent / 100;
|
|
71942
72068
|
return `${stops >= 0 ? "+" : ""}${stops.toFixed(2)}`;
|
|
71943
72069
|
}
|
|
71944
72070
|
return `${Math.round(rawPercent)}%`;
|
|
71945
72071
|
}
|
|
71946
|
-
var detailByKey = (
|
|
71947
|
-
const spec = COLOR_GRADING_DETAIL_SLIDERS.find((candidate) => candidate.key ===
|
|
71948
|
-
if (!spec) throw new Error(`Unknown color grading detail key: ${
|
|
72072
|
+
var detailByKey = (key) => {
|
|
72073
|
+
const spec = COLOR_GRADING_DETAIL_SLIDERS.find((candidate) => candidate.key === key);
|
|
72074
|
+
if (!spec) throw new Error(`Unknown color grading detail key: ${key}`);
|
|
71949
72075
|
return spec;
|
|
71950
72076
|
};
|
|
71951
72077
|
function resolveColorGrading(grading) {
|
|
@@ -72039,9 +72165,9 @@ function FlatColorGradingSection({
|
|
|
72039
72165
|
} : grading;
|
|
72040
72166
|
};
|
|
72041
72167
|
useEffect107(() => () => onPreviewColorGrading(null), [onPreviewColorGrading]);
|
|
72042
|
-
const renderDetailSlider = (
|
|
72043
|
-
const spec = detailByKey(
|
|
72044
|
-
const value = grading.details[
|
|
72168
|
+
const renderDetailSlider = (key) => {
|
|
72169
|
+
const spec = detailByKey(key);
|
|
72170
|
+
const value = grading.details[key];
|
|
72045
72171
|
const defaultValue = normalizedColorGradingDefault(spec);
|
|
72046
72172
|
const isSet = Math.abs(value - defaultValue) > 1e-4;
|
|
72047
72173
|
return /* @__PURE__ */ jsx192(
|
|
@@ -72054,11 +72180,11 @@ function FlatColorGradingSection({
|
|
|
72054
72180
|
step: spec.step,
|
|
72055
72181
|
tier: isSet ? "explicitCustom" : "default",
|
|
72056
72182
|
displayValue: `${Math.round(value * spec.scale)}${spec.suffix}`,
|
|
72057
|
-
centerTick:
|
|
72058
|
-
onCommit: (next) => onCommitColorGrading(colorGradingWithDetail(grading,
|
|
72059
|
-
onReset: () => onCommitColorGrading(colorGradingWithDetail(grading,
|
|
72183
|
+
centerTick: key === "vignetteRoundness",
|
|
72184
|
+
onCommit: (next) => onCommitColorGrading(colorGradingWithDetail(grading, key, next / spec.scale)),
|
|
72185
|
+
onReset: () => onCommitColorGrading(colorGradingWithDetail(grading, key, defaultValue))
|
|
72060
72186
|
},
|
|
72061
|
-
|
|
72187
|
+
key
|
|
72062
72188
|
);
|
|
72063
72189
|
};
|
|
72064
72190
|
return /* @__PURE__ */ jsxs147("div", { className: "space-y-1.5", children: [
|
|
@@ -72404,28 +72530,28 @@ var EFFECT_CONTROL_LIMITS = new Map(
|
|
|
72404
72530
|
(effect) => effect.controls.map((control) => [control.key, control])
|
|
72405
72531
|
)
|
|
72406
72532
|
);
|
|
72407
|
-
function controlRange(
|
|
72408
|
-
const control = EFFECT_CONTROL_LIMITS.get(
|
|
72533
|
+
function controlRange(key, scale) {
|
|
72534
|
+
const control = EFFECT_CONTROL_LIMITS.get(key);
|
|
72409
72535
|
return control ? { min: control.min * scale, max: control.max * scale, scale } : { scale };
|
|
72410
72536
|
}
|
|
72411
|
-
var percent2 = (
|
|
72537
|
+
var percent2 = (key, label) => ({
|
|
72412
72538
|
kind: "slider",
|
|
72413
|
-
key
|
|
72539
|
+
key,
|
|
72414
72540
|
label,
|
|
72415
|
-
...controlRange(
|
|
72541
|
+
...controlRange(key, 100)
|
|
72416
72542
|
});
|
|
72417
|
-
var degrees = (
|
|
72543
|
+
var degrees = (key, label, max) => ({
|
|
72418
72544
|
kind: "slider",
|
|
72419
|
-
key
|
|
72545
|
+
key,
|
|
72420
72546
|
label,
|
|
72421
|
-
...controlRange(
|
|
72547
|
+
...controlRange(key, max),
|
|
72422
72548
|
unit: "deg"
|
|
72423
72549
|
});
|
|
72424
|
-
function enumOptions(
|
|
72425
|
-
const control = EFFECT_CONTROL_LIMITS.get(
|
|
72550
|
+
function enumOptions(key, labels) {
|
|
72551
|
+
const control = EFFECT_CONTROL_LIMITS.get(key);
|
|
72426
72552
|
const first = control?.min ?? 0;
|
|
72427
72553
|
const count = (control?.max ?? labels.length - 1) - first + 1;
|
|
72428
|
-
if (labels.length !== count) throw new Error(`${
|
|
72554
|
+
if (labels.length !== count) throw new Error(`${key} labels do not match Core capabilities`);
|
|
72429
72555
|
return labels.map((label, index2) => ({ value: String(first + index2), label }));
|
|
72430
72556
|
}
|
|
72431
72557
|
var ASCII_STYLES = enumOptions("asciiStyle", [
|
|
@@ -72796,8 +72922,8 @@ function FlatEffectsSection({
|
|
|
72796
72922
|
effects
|
|
72797
72923
|
});
|
|
72798
72924
|
};
|
|
72799
|
-
const commitEffect = (
|
|
72800
|
-
commitEffects({ ...grading.effects, [
|
|
72925
|
+
const commitEffect = (key, value) => {
|
|
72926
|
+
commitEffects({ ...grading.effects, [key]: value });
|
|
72801
72927
|
};
|
|
72802
72928
|
const resolveEffect = (effect) => ({
|
|
72803
72929
|
...grading,
|
|
@@ -75446,17 +75572,17 @@ function useStableHandlers(value, scope) {
|
|
|
75446
75572
|
const current2 = epoch.current;
|
|
75447
75573
|
current2.latest = value;
|
|
75448
75574
|
const next = {};
|
|
75449
|
-
for (const [
|
|
75575
|
+
for (const [key, field] of Object.entries(value)) {
|
|
75450
75576
|
if (typeof field !== "function") {
|
|
75451
|
-
next[
|
|
75577
|
+
next[key] = field;
|
|
75452
75578
|
continue;
|
|
75453
75579
|
}
|
|
75454
|
-
let wrapper = current2.wrappers.get(
|
|
75580
|
+
let wrapper = current2.wrappers.get(key);
|
|
75455
75581
|
if (!wrapper) {
|
|
75456
|
-
wrapper = (...args) => current2.latest[
|
|
75457
|
-
current2.wrappers.set(
|
|
75582
|
+
wrapper = (...args) => current2.latest[key](...args);
|
|
75583
|
+
current2.wrappers.set(key, wrapper);
|
|
75458
75584
|
}
|
|
75459
|
-
next[
|
|
75585
|
+
next[key] = wrapper;
|
|
75460
75586
|
}
|
|
75461
75587
|
const prev = current2.previous;
|
|
75462
75588
|
const keys = Object.keys(next);
|
|
@@ -75727,16 +75853,16 @@ function isDisabled() {
|
|
|
75727
75853
|
return false;
|
|
75728
75854
|
}
|
|
75729
75855
|
}
|
|
75730
|
-
function readTimestamp(
|
|
75856
|
+
function readTimestamp(key) {
|
|
75731
75857
|
try {
|
|
75732
|
-
return parseInt(window.localStorage.getItem(
|
|
75858
|
+
return parseInt(window.localStorage.getItem(key) || "0", 10) || 0;
|
|
75733
75859
|
} catch {
|
|
75734
75860
|
return 0;
|
|
75735
75861
|
}
|
|
75736
75862
|
}
|
|
75737
|
-
function writeTimestamp(
|
|
75863
|
+
function writeTimestamp(key, now2) {
|
|
75738
75864
|
try {
|
|
75739
|
-
window.localStorage.setItem(
|
|
75865
|
+
window.localStorage.setItem(key, String(now2));
|
|
75740
75866
|
} catch {
|
|
75741
75867
|
}
|
|
75742
75868
|
}
|
|
@@ -77531,7 +77657,7 @@ function usePersistentEditHistory({ projectId }) {
|
|
|
77531
77657
|
projectIdRef.current = projectId;
|
|
77532
77658
|
const [own] = useState121(createOwnHistory);
|
|
77533
77659
|
const [pageKeyScope] = useState121(generateId);
|
|
77534
|
-
const claimKey = useCallback104((
|
|
77660
|
+
const claimKey = useCallback104((key) => `${pageKeyScope}:${key}`, [pageKeyScope]);
|
|
77535
77661
|
const refresh2 = useCallback104(async () => {
|
|
77536
77662
|
if (!projectId) return;
|
|
77537
77663
|
const seen = own.changes();
|
|
@@ -78470,10 +78596,10 @@ var IDENTITY_SELECTOR = "[id], [data-hf-id]";
|
|
|
78470
78596
|
function identityElementMap(root) {
|
|
78471
78597
|
const map = /* @__PURE__ */ new Map();
|
|
78472
78598
|
for (const el of root.querySelectorAll(IDENTITY_SELECTOR)) {
|
|
78473
|
-
const
|
|
78474
|
-
if (!
|
|
78475
|
-
if (map.has(
|
|
78476
|
-
map.set(
|
|
78599
|
+
const key = elementIdentityKey(el);
|
|
78600
|
+
if (!key) continue;
|
|
78601
|
+
if (map.has(key)) return null;
|
|
78602
|
+
map.set(key, el);
|
|
78477
78603
|
}
|
|
78478
78604
|
return map;
|
|
78479
78605
|
}
|
|
@@ -78513,10 +78639,10 @@ function diffRestoreDocs(prevDoc, nextDoc) {
|
|
|
78513
78639
|
if (!prevByKey || !nextByKey) return null;
|
|
78514
78640
|
if (prevByKey.size !== nextByKey.size) return null;
|
|
78515
78641
|
const changedElementKeys = [];
|
|
78516
|
-
for (const [
|
|
78517
|
-
const prevEl = prevByKey.get(
|
|
78642
|
+
for (const [key, nextEl] of nextByKey) {
|
|
78643
|
+
const prevEl = prevByKey.get(key);
|
|
78518
78644
|
if (!prevEl || prevEl.tagName !== nextEl.tagName) return null;
|
|
78519
|
-
if (!attributesEqual(prevEl, nextEl)) changedElementKeys.push(
|
|
78645
|
+
if (!attributesEqual(prevEl, nextEl)) changedElementKeys.push(key);
|
|
78520
78646
|
}
|
|
78521
78647
|
const [prevRest, nextRest] = [prevDoc, nextDoc].map((doc) => {
|
|
78522
78648
|
const root = doc.documentElement.cloneNode(true);
|
|
@@ -78585,11 +78711,11 @@ function scopeTargets(scope, keys, restoredByKey, previousByKey) {
|
|
|
78585
78711
|
const liveByKey = identityElementMap(scope);
|
|
78586
78712
|
if (!liveByKey) return null;
|
|
78587
78713
|
const targets = [];
|
|
78588
|
-
for (const
|
|
78589
|
-
const live = liveByKey.get(
|
|
78590
|
-
const restored = restoredByKey.get(
|
|
78714
|
+
for (const key of keys) {
|
|
78715
|
+
const live = liveByKey.get(key);
|
|
78716
|
+
const restored = restoredByKey.get(key);
|
|
78591
78717
|
if (!live || !restored || live.hasAttribute("data-hf-inner-root")) return null;
|
|
78592
|
-
targets.push({ live, restored, previous: previousByKey.get(
|
|
78718
|
+
targets.push({ live, restored, previous: previousByKey.get(key) });
|
|
78593
78719
|
}
|
|
78594
78720
|
return targets;
|
|
78595
78721
|
}
|
|
@@ -78743,7 +78869,7 @@ function syncStoredAutomationFromPreview(doc) {
|
|
|
78743
78869
|
if (!node) return element;
|
|
78744
78870
|
const fields = syncedFields(doc, element, node);
|
|
78745
78871
|
const keys = Object.keys(fields);
|
|
78746
|
-
if (keys.every((
|
|
78872
|
+
if (keys.every((key) => fields[key] === element[key])) return element;
|
|
78747
78873
|
changed = true;
|
|
78748
78874
|
return { ...element, ...fields };
|
|
78749
78875
|
});
|
|
@@ -78762,12 +78888,12 @@ var STORED_FIELD = {
|
|
|
78762
78888
|
function syncStoredElementAttribute(target, attr2, value) {
|
|
78763
78889
|
const fields = STORED_FIELD[attr2]?.(value);
|
|
78764
78890
|
if (!fields) return;
|
|
78765
|
-
const
|
|
78891
|
+
const key = getTimelineElementIdentity(target);
|
|
78766
78892
|
const same2 = (element) => Object.keys(fields).every((k) => element[k] === fields[k]);
|
|
78767
78893
|
usePlayerStore.setState((state) => {
|
|
78768
78894
|
let changed = false;
|
|
78769
78895
|
const elements = state.elements.map((element) => {
|
|
78770
|
-
if (getTimelineElementIdentity(element) !==
|
|
78896
|
+
if (getTimelineElementIdentity(element) !== key || same2(element)) return element;
|
|
78771
78897
|
changed = true;
|
|
78772
78898
|
return { ...element, ...fields };
|
|
78773
78899
|
});
|
|
@@ -79357,9 +79483,9 @@ function planDropTrackInsert(input) {
|
|
|
79357
79483
|
const byKey = new Map(elements.map((e) => [e.key ?? e.id, e]));
|
|
79358
79484
|
const renumbers = [];
|
|
79359
79485
|
for (const norm of layout.normalized) {
|
|
79360
|
-
const
|
|
79361
|
-
if (
|
|
79362
|
-
const src = byKey.get(
|
|
79486
|
+
const key = norm.key ?? norm.id;
|
|
79487
|
+
if (key === dropped2.id) continue;
|
|
79488
|
+
const src = byKey.get(key);
|
|
79363
79489
|
if (!src || norm.track === (src.authoredTrack ?? src.track)) continue;
|
|
79364
79490
|
if (!canMoveTimelineElement(src)) return null;
|
|
79365
79491
|
renumbers.push({ element: src, track: norm.track });
|
|
@@ -79468,10 +79594,10 @@ async function commitTimelineCompositionInsertion(input) {
|
|
|
79468
79594
|
}
|
|
79469
79595
|
|
|
79470
79596
|
// src/player/components/timelineDropReveal.ts
|
|
79471
|
-
function selectAndRevealTimelineElement(
|
|
79597
|
+
function selectAndRevealTimelineElement(key) {
|
|
79472
79598
|
const store = usePlayerStore.getState();
|
|
79473
|
-
store.setSelectedElementId(
|
|
79474
|
-
store.requestTimelineFocus(timelineClipFocusId(
|
|
79599
|
+
store.setSelectedElementId(key);
|
|
79600
|
+
store.requestTimelineFocus(timelineClipFocusId(key));
|
|
79475
79601
|
}
|
|
79476
79602
|
|
|
79477
79603
|
// src/hooks/useTimelineAssetDropOps.ts
|
|
@@ -79772,71 +79898,71 @@ function createLiveLanes(project, composition) {
|
|
|
79772
79898
|
const verified2 = /* @__PURE__ */ new Map();
|
|
79773
79899
|
const clean = /* @__PURE__ */ new Set();
|
|
79774
79900
|
let saves = 0;
|
|
79775
|
-
const take = (
|
|
79776
|
-
const claimed = before.has(
|
|
79777
|
-
before.delete(
|
|
79778
|
-
clean.delete(
|
|
79779
|
-
if (!pending2.has(
|
|
79901
|
+
const take = (key) => {
|
|
79902
|
+
const claimed = before.has(key) ? before.get(key) ?? null : void 0;
|
|
79903
|
+
before.delete(key);
|
|
79904
|
+
clean.delete(key);
|
|
79905
|
+
if (!pending2.has(key)) sources.delete(key);
|
|
79780
79906
|
return claimed;
|
|
79781
79907
|
};
|
|
79782
|
-
const overtaken = (
|
|
79783
|
-
const rebase = (
|
|
79908
|
+
const overtaken = (key, save) => [...pending2.get(key) ?? []].some((newer) => newer > save);
|
|
79909
|
+
const rebase = (key, value) => {
|
|
79784
79910
|
if (value === void 0) {
|
|
79785
|
-
clean.delete(
|
|
79786
|
-
verified2.delete(
|
|
79911
|
+
clean.delete(key);
|
|
79912
|
+
verified2.delete(key);
|
|
79787
79913
|
return;
|
|
79788
79914
|
}
|
|
79789
|
-
if (before.has(
|
|
79790
|
-
if (pending2.has(
|
|
79791
|
-
if (pending2.has(
|
|
79792
|
-
else clean.add(
|
|
79915
|
+
if (before.has(key)) before.set(key, value);
|
|
79916
|
+
if (pending2.has(key)) verified2.set(key, value);
|
|
79917
|
+
if (pending2.has(key)) clean.delete(key);
|
|
79918
|
+
else clean.add(key);
|
|
79793
79919
|
};
|
|
79794
79920
|
const scoped = (laneKey) => `${project()}
|
|
79795
79921
|
${composition()}
|
|
79796
79922
|
${laneKey}`;
|
|
79797
79923
|
return {
|
|
79798
79924
|
preview(laneKey, readCurrent, source) {
|
|
79799
|
-
const
|
|
79800
|
-
if (before.has(
|
|
79801
|
-
before.set(
|
|
79802
|
-
sources.set(
|
|
79803
|
-
if (!pending2.has(
|
|
79925
|
+
const key = scoped(laneKey);
|
|
79926
|
+
if (before.has(key)) return;
|
|
79927
|
+
before.set(key, readCurrent());
|
|
79928
|
+
sources.set(key, source);
|
|
79929
|
+
if (!pending2.has(key)) clean.add(key);
|
|
79804
79930
|
},
|
|
79805
79931
|
// A save. Its settle records what the file holds: `saved`, else the last value verified on
|
|
79806
79932
|
// this lane (a landed save, a read-back, or a clean before-value), never an unsaved one.
|
|
79807
79933
|
// Store and preview follow only while no newer save is pending and its composition is open,
|
|
79808
79934
|
// and the preview only while no drag is live.
|
|
79809
79935
|
claim(laneKey, apply, source) {
|
|
79810
|
-
const
|
|
79811
|
-
const open2 = () => scoped(laneKey) ===
|
|
79812
|
-
const trusted = clean.has(
|
|
79813
|
-
const claimed = take(
|
|
79936
|
+
const key = scoped(laneKey);
|
|
79937
|
+
const open2 = () => scoped(laneKey) === key;
|
|
79938
|
+
const trusted = clean.has(key);
|
|
79939
|
+
const claimed = take(key);
|
|
79814
79940
|
const mine = ++saves;
|
|
79815
|
-
sources.set(
|
|
79816
|
-
if (claimed !== void 0 && trusted) verified2.set(
|
|
79817
|
-
pending2.set(
|
|
79941
|
+
sources.set(key, source);
|
|
79942
|
+
if (claimed !== void 0 && trusted) verified2.set(key, claimed);
|
|
79943
|
+
pending2.set(key, (pending2.get(key) ?? /* @__PURE__ */ new Set()).add(mine));
|
|
79818
79944
|
const preview2 = (value) => {
|
|
79819
|
-
if (open2() && !before.has(
|
|
79945
|
+
if (open2() && !before.has(key) && !overtaken(key, mine)) apply.preview(value);
|
|
79820
79946
|
};
|
|
79821
79947
|
return {
|
|
79822
79948
|
preview: preview2,
|
|
79823
79949
|
read(value) {
|
|
79824
|
-
verified2.set(
|
|
79950
|
+
verified2.set(key, value);
|
|
79825
79951
|
},
|
|
79826
79952
|
settle(saved2) {
|
|
79827
|
-
const inFlight = pending2.get(
|
|
79953
|
+
const inFlight = pending2.get(key);
|
|
79828
79954
|
inFlight?.delete(mine);
|
|
79829
|
-
if (saved2 !== void 0) verified2.set(
|
|
79830
|
-
const value = verified2.get(
|
|
79955
|
+
if (saved2 !== void 0) verified2.set(key, saved2);
|
|
79956
|
+
const value = verified2.get(key);
|
|
79831
79957
|
if (!inFlight?.size) {
|
|
79832
|
-
pending2.delete(
|
|
79833
|
-
verified2.delete(
|
|
79834
|
-
if (!before.has(
|
|
79958
|
+
pending2.delete(key);
|
|
79959
|
+
verified2.delete(key);
|
|
79960
|
+
if (!before.has(key)) sources.delete(key);
|
|
79835
79961
|
}
|
|
79836
|
-
if (value === void 0 || overtaken(
|
|
79837
|
-
if (before.has(
|
|
79838
|
-
before.set(
|
|
79839
|
-
clean.add(
|
|
79962
|
+
if (value === void 0 || overtaken(key, mine) || !open2()) return;
|
|
79963
|
+
if (before.has(key)) {
|
|
79964
|
+
before.set(key, value);
|
|
79965
|
+
clean.add(key);
|
|
79840
79966
|
}
|
|
79841
79967
|
apply.store(value);
|
|
79842
79968
|
preview2(value);
|
|
@@ -79856,9 +79982,9 @@ ${laneKey}`;
|
|
|
79856
79982
|
restore({ paths = [], files }) {
|
|
79857
79983
|
const inProject = `${project()}
|
|
79858
79984
|
`;
|
|
79859
|
-
for (const [
|
|
79860
|
-
if (
|
|
79861
|
-
rebase(
|
|
79985
|
+
for (const [key, source] of sources) {
|
|
79986
|
+
if (key.startsWith(inProject) && paths.includes(source.path)) {
|
|
79987
|
+
rebase(key, restoredValue(source, files));
|
|
79862
79988
|
}
|
|
79863
79989
|
}
|
|
79864
79990
|
}
|
|
@@ -79984,10 +80110,10 @@ function useSetAudioGroupAttribute({
|
|
|
79984
80110
|
const liveLanes = useLiveLanes(projectIdRef, activeCompPath);
|
|
79985
80111
|
const setLive = useCallback116(
|
|
79986
80112
|
(groupId, attr2, value) => {
|
|
79987
|
-
const
|
|
80113
|
+
const key = audioGroupAttributeLiveKey(groupId, attr2);
|
|
79988
80114
|
const target = previewIframeRef.current?.contentDocument?.getElementById(groupId);
|
|
79989
80115
|
liveLanes.preview(
|
|
79990
|
-
|
|
80116
|
+
key,
|
|
79991
80117
|
() => target?.getAttribute(attr2) ?? null,
|
|
79992
80118
|
groupLiveSource(previewIframeRef.current, groupId, activeCompPath, attr2)
|
|
79993
80119
|
);
|
|
@@ -80127,10 +80253,10 @@ function useSetElementAttribute({
|
|
|
80127
80253
|
const liveLanes = useLiveLanes(projectIdRef, activeCompPath);
|
|
80128
80254
|
const setLive = useCallback117(
|
|
80129
80255
|
(element, attr2, value) => {
|
|
80130
|
-
const
|
|
80256
|
+
const key = elementAttributeLiveKey(element, activeCompPath, attr2);
|
|
80131
80257
|
const target = findTimelineElementInIframe(previewIframeRef.current, element, activeCompPath);
|
|
80132
80258
|
liveLanes.preview(
|
|
80133
|
-
|
|
80259
|
+
key,
|
|
80134
80260
|
() => target?.getAttribute(attr2) ?? null,
|
|
80135
80261
|
elementLiveSource(element, activeCompPath, attr2)
|
|
80136
80262
|
);
|
|
@@ -80470,8 +80596,8 @@ function useTimelineEditGuard(canEdit, showToast) {
|
|
|
80470
80596
|
const guardedRef = useRef144(/* @__PURE__ */ new WeakMap());
|
|
80471
80597
|
const guard = useCallback120(
|
|
80472
80598
|
(resolveTargets, fn, onRefused) => {
|
|
80473
|
-
const
|
|
80474
|
-
const cached5 = guardedRef.current.get(
|
|
80599
|
+
const key = fn;
|
|
80600
|
+
const cached5 = guardedRef.current.get(key);
|
|
80475
80601
|
if (cached5) {
|
|
80476
80602
|
cached5.resolveTargets = resolveTargets;
|
|
80477
80603
|
cached5.onRefused = onRefused;
|
|
@@ -80486,7 +80612,7 @@ function useTimelineEditGuard(canEdit, showToast) {
|
|
|
80486
80612
|
return Promise.resolve(entry3.onRefused?.(reason, ...args));
|
|
80487
80613
|
return fn(...args);
|
|
80488
80614
|
});
|
|
80489
|
-
guardedRef.current.set(
|
|
80615
|
+
guardedRef.current.set(key, entry3);
|
|
80490
80616
|
return entry3.wrapped;
|
|
80491
80617
|
},
|
|
80492
80618
|
[]
|
|
@@ -80714,11 +80840,11 @@ import { useCallback as useCallback122, useRef as useRef145 } from "react";
|
|
|
80714
80840
|
function useTrackPendingTimelineEdit() {
|
|
80715
80841
|
const wrappedRef = useRef145(/* @__PURE__ */ new WeakMap());
|
|
80716
80842
|
return useCallback122((fn) => {
|
|
80717
|
-
const
|
|
80718
|
-
const cached5 = wrappedRef.current.get(
|
|
80843
|
+
const key = fn;
|
|
80844
|
+
const cached5 = wrappedRef.current.get(key);
|
|
80719
80845
|
if (cached5) return cached5;
|
|
80720
80846
|
const wrapped = trackedStudioEdit(fn);
|
|
80721
|
-
wrappedRef.current.set(
|
|
80847
|
+
wrappedRef.current.set(key, wrapped);
|
|
80722
80848
|
return wrapped;
|
|
80723
80849
|
}, []);
|
|
80724
80850
|
}
|
|
@@ -84342,8 +84468,8 @@ function stagePlainTranslate(commitPositionPatchToHtml, selection, next, coalesc
|
|
|
84342
84468
|
const rollback = () => {
|
|
84343
84469
|
if (el.style.getPropertyValue("translate") === written) restoreStudioPathOffset(el, before);
|
|
84344
84470
|
};
|
|
84345
|
-
const
|
|
84346
|
-
const options = { label: "Move layer", coalesceKey:
|
|
84471
|
+
const key = coalesceKey ?? `move:${++plainMoveCounter}`;
|
|
84472
|
+
const options = { label: "Move layer", coalesceKey: key, coalesceMs: Number.POSITIVE_INFINITY };
|
|
84347
84473
|
const save = () => commitPositionPatchToHtml(selection, patches, options).catch((error) => {
|
|
84348
84474
|
rollback();
|
|
84349
84475
|
throw error;
|
|
@@ -84937,16 +85063,16 @@ function patchKeyframes(tween, keyframes) {
|
|
|
84937
85063
|
function mergeKeyframeStep(map, pct, props) {
|
|
84938
85064
|
const next = {};
|
|
84939
85065
|
for (const [k, step] of Object.entries(map)) next[k] = { ...step };
|
|
84940
|
-
let
|
|
85066
|
+
let key = null;
|
|
84941
85067
|
for (const k of Object.keys(next)) {
|
|
84942
85068
|
const n = parseFloat(k);
|
|
84943
85069
|
if (Number.isFinite(n) && Math.abs(n - pct) < 0.05) {
|
|
84944
|
-
|
|
85070
|
+
key = k;
|
|
84945
85071
|
break;
|
|
84946
85072
|
}
|
|
84947
85073
|
}
|
|
84948
|
-
if (
|
|
84949
|
-
next[
|
|
85074
|
+
if (key === null) key = `${pct}%`;
|
|
85075
|
+
next[key] = { ...next[key] ?? {}, ...props };
|
|
84950
85076
|
return next;
|
|
84951
85077
|
}
|
|
84952
85078
|
function rebuildKeyframeTween(tween, pct, props) {
|
|
@@ -85033,16 +85159,16 @@ function patchRuntimeTweenInPlace(iframe, selector, change, compositionId, defer
|
|
|
85033
85159
|
// src/hooks/serializeByKey.ts
|
|
85034
85160
|
function createKeyedSerializer() {
|
|
85035
85161
|
const inFlight = /* @__PURE__ */ new Map();
|
|
85036
|
-
return function run(
|
|
85037
|
-
const prior = inFlight.get(
|
|
85162
|
+
return function run(key, task) {
|
|
85163
|
+
const prior = inFlight.get(key) ?? Promise.resolve();
|
|
85038
85164
|
const next = prior.then(task, task);
|
|
85039
|
-
inFlight.set(
|
|
85165
|
+
inFlight.set(key, next);
|
|
85040
85166
|
void next.then(
|
|
85041
85167
|
() => {
|
|
85042
|
-
if (inFlight.get(
|
|
85168
|
+
if (inFlight.get(key) === next) inFlight.delete(key);
|
|
85043
85169
|
},
|
|
85044
85170
|
() => {
|
|
85045
|
-
if (inFlight.get(
|
|
85171
|
+
if (inFlight.get(key) === next) inFlight.delete(key);
|
|
85046
85172
|
}
|
|
85047
85173
|
);
|
|
85048
85174
|
return next;
|
|
@@ -85346,8 +85472,8 @@ async function commitKeyframeAtTimeImpl(selection, absoluteTime, animations, pro
|
|
|
85346
85472
|
);
|
|
85347
85473
|
}
|
|
85348
85474
|
const backfillDefaults = {};
|
|
85349
|
-
for (const
|
|
85350
|
-
backfillDefaults[
|
|
85475
|
+
for (const key of Object.keys(properties)) {
|
|
85476
|
+
backfillDefaults[key] = KEYFRAME_PROPERTY_DEFAULTS[key] ?? 0;
|
|
85351
85477
|
}
|
|
85352
85478
|
await commitMutation(
|
|
85353
85479
|
selection,
|
|
@@ -86804,8 +86930,8 @@ function useDomEditWiring(params) {
|
|
|
86804
86930
|
const matchKey = elements.find(
|
|
86805
86931
|
(el) => el.domId === domEditSelection.id || el.id === domEditSelection.id
|
|
86806
86932
|
);
|
|
86807
|
-
const
|
|
86808
|
-
if (
|
|
86933
|
+
const key = matchKey ? matchKey.key ?? matchKey.id : null;
|
|
86934
|
+
if (key && key !== selectedElementId) setSelectedElementId(key);
|
|
86809
86935
|
}, [domEditSelection?.id]);
|
|
86810
86936
|
const prevRefreshKeyRef = useRef158(refreshKey);
|
|
86811
86937
|
useEffect127(() => {
|
|
@@ -87110,8 +87236,8 @@ function isPlayheadWithinTween(anim, currentTime) {
|
|
|
87110
87236
|
async function replaceSetWithSingleKeyframe(session, sel, setAnim, t2, iframe, selector) {
|
|
87111
87237
|
const position = readElementPosition(iframe, sel, setAnim);
|
|
87112
87238
|
if (Object.keys(position).length === 0) {
|
|
87113
|
-
for (const [
|
|
87114
|
-
if (typeof held === "number") position[
|
|
87239
|
+
for (const [key, held] of Object.entries(setAnim.properties ?? {})) {
|
|
87240
|
+
if (typeof held === "number") position[key] = held;
|
|
87115
87241
|
}
|
|
87116
87242
|
}
|
|
87117
87243
|
if (Object.keys(position).length === 0 || !session.commitMutation) return;
|
|
@@ -87257,9 +87383,9 @@ async function promoteSetToKeyframes(session, sel, setAnim, t2, iframe) {
|
|
|
87257
87383
|
const endPosition = readElementPosition(iframe, sel, setAnim);
|
|
87258
87384
|
if (Object.keys(endPosition).length === 0) return;
|
|
87259
87385
|
const startPosition = {};
|
|
87260
|
-
for (const
|
|
87261
|
-
const held = setAnim.properties?.[
|
|
87262
|
-
if (typeof held === "number") startPosition[
|
|
87386
|
+
for (const key of Object.keys(endPosition)) {
|
|
87387
|
+
const held = setAnim.properties?.[key];
|
|
87388
|
+
if (typeof held === "number") startPosition[key] = held;
|
|
87263
87389
|
}
|
|
87264
87390
|
await session.commitMutation(
|
|
87265
87391
|
{
|
|
@@ -88680,19 +88806,19 @@ function useCommitPreflightCapabilities({
|
|
|
88680
88806
|
if (!enabled || !projectId) return;
|
|
88681
88807
|
const targets = selection ? [selection, ...groupSelections] : groupSelections;
|
|
88682
88808
|
for (const file of new Set(targets.map(gsapSourceFileForSelection))) {
|
|
88683
|
-
const
|
|
88684
|
-
const known = parsesRef.current.get(
|
|
88809
|
+
const key = parseCacheKey(projectId, file);
|
|
88810
|
+
const known = parsesRef.current.get(key);
|
|
88685
88811
|
if (known?.version === version) continue;
|
|
88686
|
-
parsesRef.current.set(
|
|
88812
|
+
parsesRef.current.set(key, { version, animations: known?.animations ?? null });
|
|
88687
88813
|
void fetchParsedAnimations(projectId, file).then((parsed) => {
|
|
88688
|
-
if (parsesRef.current.get(
|
|
88814
|
+
if (parsesRef.current.get(key)?.version !== version) return;
|
|
88689
88815
|
if (parsed) {
|
|
88690
|
-
parsesRef.current.set(
|
|
88816
|
+
parsesRef.current.set(key, { version, animations: parsed.animations });
|
|
88691
88817
|
setParseTick((tick) => tick + 1);
|
|
88692
88818
|
return;
|
|
88693
88819
|
}
|
|
88694
|
-
if (known?.animations) parsesRef.current.set(
|
|
88695
|
-
else parsesRef.current.delete(
|
|
88820
|
+
if (known?.animations) parsesRef.current.set(key, known);
|
|
88821
|
+
else parsesRef.current.delete(key);
|
|
88696
88822
|
});
|
|
88697
88823
|
}
|
|
88698
88824
|
}, [enabled, projectId, selection, groupSelections, version]);
|
|
@@ -89433,9 +89559,9 @@ function useSdkSession(projectId, activeCompPath, fileTree = [], fileTreeLoaded
|
|
|
89433
89559
|
setUnreachableProject(reportReadFailure(read2, forProjectId, pathInTree));
|
|
89434
89560
|
setCompositionMissing(read2.reason === "absent");
|
|
89435
89561
|
if (read2.reason !== "absent") return;
|
|
89436
|
-
const
|
|
89437
|
-
if (refreshedAbsentPathsRef.current.has(
|
|
89438
|
-
refreshedAbsentPathsRef.current.add(
|
|
89562
|
+
const key = `${forProjectId}:${forPath}`;
|
|
89563
|
+
if (refreshedAbsentPathsRef.current.has(key)) return;
|
|
89564
|
+
refreshedAbsentPathsRef.current.add(key);
|
|
89439
89565
|
onAbsentRead?.(forPath);
|
|
89440
89566
|
}
|
|
89441
89567
|
useEffect132(
|
|
@@ -89564,75 +89690,32 @@ function useStudioSdkSessions(projectId, activeCompPath, masterCompPath, fileTre
|
|
|
89564
89690
|
import { useCallback as useCallback156 } from "react";
|
|
89565
89691
|
|
|
89566
89692
|
// src/utils/externalConflictStorage.ts
|
|
89567
|
-
|
|
89568
|
-
|
|
89569
|
-
|
|
89570
|
-
function
|
|
89571
|
-
|
|
89572
|
-
}
|
|
89573
|
-
|
|
89574
|
-
|
|
89575
|
-
|
|
89576
|
-
|
|
89577
|
-
|
|
89578
|
-
|
|
89579
|
-
|
|
89580
|
-
|
|
89581
|
-
|
|
89582
|
-
|
|
89583
|
-
}
|
|
89584
|
-
|
|
89585
|
-
|
|
89586
|
-
|
|
89587
|
-
|
|
89588
|
-
}
|
|
89589
|
-
|
|
89590
|
-
|
|
89591
|
-
(db) => new Promise((resolve2, reject) => {
|
|
89592
|
-
const transaction = db.transaction(STORE_NAME, mode);
|
|
89593
|
-
const request2 = callback(transaction.objectStore(STORE_NAME));
|
|
89594
|
-
let result;
|
|
89595
|
-
request2.onerror = () => reject(request2.error ?? new Error("Conflict storage failed"));
|
|
89596
|
-
request2.onsuccess = () => {
|
|
89597
|
-
result = request2.result;
|
|
89598
|
-
};
|
|
89599
|
-
transaction.oncomplete = () => {
|
|
89600
|
-
db.close();
|
|
89601
|
-
resolve2(result);
|
|
89602
|
-
};
|
|
89603
|
-
transaction.onerror = () => {
|
|
89604
|
-
db.close();
|
|
89605
|
-
reject(transaction.error ?? new Error("Conflict storage transaction failed"));
|
|
89606
|
-
};
|
|
89607
|
-
transaction.onabort = () => {
|
|
89608
|
-
db.close();
|
|
89609
|
-
reject(transaction.error ?? new Error("Conflict storage transaction was aborted"));
|
|
89610
|
-
};
|
|
89611
|
-
})
|
|
89612
|
-
);
|
|
89613
|
-
}
|
|
89614
|
-
function createIndexedDbExternalConflictStorage() {
|
|
89615
|
-
return {
|
|
89616
|
-
async get(projectId, filePath) {
|
|
89617
|
-
return await withStore(
|
|
89618
|
-
"readonly",
|
|
89619
|
-
(store) => store.get(key(projectId, filePath))
|
|
89620
|
-
) ?? null;
|
|
89621
|
-
},
|
|
89622
|
-
async set(snapshot3) {
|
|
89623
|
-
await withStore(
|
|
89624
|
-
"readwrite",
|
|
89625
|
-
(store) => store.put(snapshot3, key(snapshot3.projectId, snapshot3.filePath))
|
|
89626
|
-
);
|
|
89627
|
-
},
|
|
89628
|
-
async delete(projectId, filePath) {
|
|
89629
|
-
await withStore("readwrite", (store) => store.delete(key(projectId, filePath)));
|
|
89630
|
-
}
|
|
89631
|
-
};
|
|
89632
|
-
}
|
|
89633
|
-
var indexedDbStorage = createIndexedDbExternalConflictStorage();
|
|
89693
|
+
function draftUrl(projectId, filePath) {
|
|
89694
|
+
return `/api/projects/${encodeURIComponent(projectId)}/recovery-drafts/${encodeURIComponent(filePath)}`;
|
|
89695
|
+
}
|
|
89696
|
+
async function draftRequest(projectId, filePath, init) {
|
|
89697
|
+
const res = await studioApiFetch(draftUrl(projectId, filePath), init);
|
|
89698
|
+
if (!res.ok) throw new Error(`Recovery draft storage failed (${res.status})`);
|
|
89699
|
+
return res;
|
|
89700
|
+
}
|
|
89701
|
+
var projectStorage = {
|
|
89702
|
+
async get(projectId, filePath) {
|
|
89703
|
+
const { draft } = await (await draftRequest(projectId, filePath)).json();
|
|
89704
|
+
return draft?.projectId === projectId && draft.filePath === filePath ? draft : null;
|
|
89705
|
+
},
|
|
89706
|
+
async set(snapshot3) {
|
|
89707
|
+
await draftRequest(snapshot3.projectId, snapshot3.filePath, {
|
|
89708
|
+
method: "PUT",
|
|
89709
|
+
headers: { "content-type": "application/json" },
|
|
89710
|
+
body: JSON.stringify(snapshot3)
|
|
89711
|
+
});
|
|
89712
|
+
},
|
|
89713
|
+
async delete(projectId, filePath) {
|
|
89714
|
+
await draftRequest(projectId, filePath, { method: "DELETE" });
|
|
89715
|
+
}
|
|
89716
|
+
};
|
|
89634
89717
|
async function persistExternalConflictSnapshot(projectId, conflict) {
|
|
89635
|
-
await
|
|
89718
|
+
await projectStorage.set({
|
|
89636
89719
|
kind: "conflict",
|
|
89637
89720
|
projectId,
|
|
89638
89721
|
filePath: conflict.filePath,
|
|
@@ -89643,7 +89726,7 @@ async function persistExternalConflictSnapshot(projectId, conflict) {
|
|
|
89643
89726
|
});
|
|
89644
89727
|
}
|
|
89645
89728
|
async function persistExternalFailureSnapshot(projectId, filePath, studioContent, externalVersion, externalContent, error) {
|
|
89646
|
-
await
|
|
89729
|
+
await projectStorage.set({
|
|
89647
89730
|
kind: "failed",
|
|
89648
89731
|
projectId,
|
|
89649
89732
|
filePath,
|
|
@@ -89655,10 +89738,10 @@ async function persistExternalFailureSnapshot(projectId, filePath, studioContent
|
|
|
89655
89738
|
});
|
|
89656
89739
|
}
|
|
89657
89740
|
async function loadExternalConflictSnapshot(projectId, filePath) {
|
|
89658
|
-
return
|
|
89741
|
+
return projectStorage.get(projectId, filePath);
|
|
89659
89742
|
}
|
|
89660
89743
|
async function deleteExternalConflictSnapshot(projectId, filePath) {
|
|
89661
|
-
await
|
|
89744
|
+
await projectStorage.delete(projectId, filePath);
|
|
89662
89745
|
}
|
|
89663
89746
|
|
|
89664
89747
|
// src/hooks/useExternalFileChangeCoordinator.ts
|
|
@@ -89785,7 +89868,7 @@ function useExternalFileChangeCoordinator({
|
|
|
89785
89868
|
return () => {
|
|
89786
89869
|
cancelled = true;
|
|
89787
89870
|
};
|
|
89788
|
-
}, [loadConflictSnapshot, projectId, recoveryFilePath, setBlocked]);
|
|
89871
|
+
}, [loadConflictSnapshot, projectId, activeCompPath, recoveryFilePath, setBlocked]);
|
|
89789
89872
|
const deliverOwed = useCallback155(
|
|
89790
89873
|
(owed, accept = true) => {
|
|
89791
89874
|
const path = readStudioFileChangePath(owed) ?? ".";
|
|
@@ -90889,10 +90972,10 @@ function useAppHotkeys({
|
|
|
90889
90972
|
};
|
|
90890
90973
|
const handleAppKeyDown = useCallback159((event) => {
|
|
90891
90974
|
const cb = cbRef.current;
|
|
90892
|
-
const
|
|
90975
|
+
const key = event.key.toLowerCase();
|
|
90893
90976
|
if (dispatchLinkShortcut(event, cb)) return;
|
|
90894
|
-
if (dispatchModifierKey(event,
|
|
90895
|
-
dispatchPlainKey(event,
|
|
90977
|
+
if (dispatchModifierKey(event, key, cb)) return;
|
|
90978
|
+
dispatchPlainKey(event, key, cb);
|
|
90896
90979
|
}, []);
|
|
90897
90980
|
useEffect135(() => {
|
|
90898
90981
|
window.addEventListener("keydown", handleAppKeyDown, true);
|
|
@@ -91695,11 +91778,11 @@ function readStaticProperty(property) {
|
|
|
91695
91778
|
if (property.type !== "Property" || property.kind !== "init" || property.method || property.shorthand || property.computed) {
|
|
91696
91779
|
throw new SyntaxError("Transcript properties must be static data");
|
|
91697
91780
|
}
|
|
91698
|
-
const
|
|
91699
|
-
if (typeof
|
|
91781
|
+
const key = property.key.type === "Identifier" ? property.key.name : readStaticValue(property.key);
|
|
91782
|
+
if (typeof key !== "string" && typeof key !== "number") {
|
|
91700
91783
|
throw new SyntaxError("Transcript property keys must be names or literals");
|
|
91701
91784
|
}
|
|
91702
|
-
return [
|
|
91785
|
+
return [key, readStaticValue(property.value)];
|
|
91703
91786
|
}
|
|
91704
91787
|
function parseTranscriptArray(parsed) {
|
|
91705
91788
|
if (!Array.isArray(parsed)) {
|
|
@@ -92107,12 +92190,12 @@ function useLintModal(projectId, refreshKey) {
|
|
|
92107
92190
|
(keyFn) => {
|
|
92108
92191
|
const map = /* @__PURE__ */ new Map();
|
|
92109
92192
|
for (const f of backgroundFindings) {
|
|
92110
|
-
const
|
|
92111
|
-
if (!
|
|
92112
|
-
const prev = map.get(
|
|
92193
|
+
const key = keyFn(f);
|
|
92194
|
+
if (!key) continue;
|
|
92195
|
+
const prev = map.get(key) ?? { count: 0, messages: [] };
|
|
92113
92196
|
prev.count += 1;
|
|
92114
92197
|
prev.messages.push(f.message);
|
|
92115
|
-
map.set(
|
|
92198
|
+
map.set(key, prev);
|
|
92116
92199
|
}
|
|
92117
92200
|
return map;
|
|
92118
92201
|
},
|
|
@@ -92304,8 +92387,8 @@ function toPersistedSelection(selection, group = []) {
|
|
|
92304
92387
|
for (const member of group) {
|
|
92305
92388
|
const target = toPersistedTarget(member);
|
|
92306
92389
|
if (!target) continue;
|
|
92307
|
-
const
|
|
92308
|
-
if (
|
|
92390
|
+
const key = selectionTargetKey(target);
|
|
92391
|
+
if (key !== primaryKey) members.set(key, target);
|
|
92309
92392
|
}
|
|
92310
92393
|
return {
|
|
92311
92394
|
...primary,
|
|
@@ -93387,13 +93470,13 @@ function setStudioTheme(theme) {
|
|
|
93387
93470
|
if (theme === "light") root.dataset.theme = "paper";
|
|
93388
93471
|
else delete root.dataset.theme;
|
|
93389
93472
|
}
|
|
93390
|
-
function
|
|
93473
|
+
function subscribe(listener2) {
|
|
93391
93474
|
const observer = new MutationObserver(listener2);
|
|
93392
93475
|
observer.observe(document.documentElement, { attributeFilter: ["data-theme"] });
|
|
93393
93476
|
return () => observer.disconnect();
|
|
93394
93477
|
}
|
|
93395
93478
|
function useShownStudioTheme() {
|
|
93396
|
-
return useSyncExternalStore12(
|
|
93479
|
+
return useSyncExternalStore12(subscribe, shownStudioTheme);
|
|
93397
93480
|
}
|
|
93398
93481
|
|
|
93399
93482
|
// src/components/ThemeToggle.tsx
|
|
@@ -93649,7 +93732,7 @@ function connectGsapRuntime(element, iframeEl, elementEndTime) {
|
|
|
93649
93732
|
try {
|
|
93650
93733
|
const win = iframeEl.contentWindow;
|
|
93651
93734
|
const tl = win?.__timelines ? Object.entries(win.__timelines).find(
|
|
93652
|
-
([
|
|
93735
|
+
([key, value]) => key !== "__proxied" && typeof value?.seek === "function"
|
|
93653
93736
|
)?.[1] ?? null : null;
|
|
93654
93737
|
if (win?.gsap?.set && tl?.seek && element.id) {
|
|
93655
93738
|
const tlDuration = tl.duration();
|
|
@@ -93952,19 +94035,19 @@ function simplifyGestureSamples(samples, totalDuration, epsilon) {
|
|
|
93952
94035
|
if (totalDuration <= 0) return /* @__PURE__ */ new Map();
|
|
93953
94036
|
const propertyKeys = /* @__PURE__ */ new Set();
|
|
93954
94037
|
for (const s of samples) {
|
|
93955
|
-
for (const
|
|
93956
|
-
propertyKeys.add(
|
|
94038
|
+
for (const key of Object.keys(s.properties)) {
|
|
94039
|
+
propertyKeys.add(key);
|
|
93957
94040
|
}
|
|
93958
94041
|
}
|
|
93959
94042
|
const survivingTimes = /* @__PURE__ */ new Set();
|
|
93960
|
-
for (const
|
|
94043
|
+
for (const key of propertyKeys) {
|
|
93961
94044
|
const series = [];
|
|
93962
94045
|
for (const s of samples) {
|
|
93963
|
-
if (
|
|
93964
|
-
series.push({ time: s.time, value: s.properties[
|
|
94046
|
+
if (key in s.properties) {
|
|
94047
|
+
series.push({ time: s.time, value: s.properties[key] });
|
|
93965
94048
|
}
|
|
93966
94049
|
}
|
|
93967
|
-
const keyEpsilon = typeof epsilon === "function" ? epsilon(
|
|
94050
|
+
const keyEpsilon = typeof epsilon === "function" ? epsilon(key) : epsilon;
|
|
93968
94051
|
const simplified = simplifyTimeSeries(series, keyEpsilon);
|
|
93969
94052
|
for (const pt of simplified) {
|
|
93970
94053
|
survivingTimes.add(pt.time);
|
|
@@ -93975,19 +94058,19 @@ function simplifyGestureSamples(samples, totalDuration, epsilon) {
|
|
|
93975
94058
|
for (const t2 of sortedTimes) {
|
|
93976
94059
|
const pct = Math.round(t2 / totalDuration * 1e3) / 10;
|
|
93977
94060
|
const props = {};
|
|
93978
|
-
for (const
|
|
93979
|
-
props[
|
|
94061
|
+
for (const key of propertyKeys) {
|
|
94062
|
+
props[key] = interpolatePropertyAtTime(samples, key, t2);
|
|
93980
94063
|
}
|
|
93981
94064
|
result.set(pct, props);
|
|
93982
94065
|
}
|
|
93983
94066
|
return result;
|
|
93984
94067
|
}
|
|
93985
|
-
function interpolatePropertyAtTime(samples,
|
|
94068
|
+
function interpolatePropertyAtTime(samples, key, t2) {
|
|
93986
94069
|
let before;
|
|
93987
94070
|
let after;
|
|
93988
94071
|
for (const s of samples) {
|
|
93989
|
-
if (!(
|
|
93990
|
-
const v = s.properties[
|
|
94072
|
+
if (!(key in s.properties)) continue;
|
|
94073
|
+
const v = s.properties[key];
|
|
93991
94074
|
if (s.time <= t2) {
|
|
93992
94075
|
before = { time: s.time, value: v };
|
|
93993
94076
|
}
|
|
@@ -94089,17 +94172,17 @@ function smoothGestureKeyframes(keyframes, radius) {
|
|
|
94089
94172
|
return keyframes.map((kf, i) => {
|
|
94090
94173
|
if (i === 0 || i === keyframes.length - 1) return kf;
|
|
94091
94174
|
const smoothed = { ...kf.properties };
|
|
94092
|
-
for (const
|
|
94175
|
+
for (const key of numericKeys) {
|
|
94093
94176
|
let weightSum = 0;
|
|
94094
94177
|
let valueSum = 0;
|
|
94095
94178
|
for (let j = Math.max(0, i - radius); j <= Math.min(keyframes.length - 1, i + radius); j++) {
|
|
94096
|
-
const v = keyframes[j].properties[
|
|
94179
|
+
const v = keyframes[j].properties[key];
|
|
94097
94180
|
if (typeof v !== "number") continue;
|
|
94098
94181
|
const w = gaussianWeight(j - i, sigma);
|
|
94099
94182
|
weightSum += w;
|
|
94100
94183
|
valueSum += v * w;
|
|
94101
94184
|
}
|
|
94102
|
-
if (weightSum > 0) smoothed[
|
|
94185
|
+
if (weightSum > 0) smoothed[key] = Math.round(valueSum / weightSum * 1e3) / 1e3;
|
|
94103
94186
|
}
|
|
94104
94187
|
return { percentage: kf.percentage, properties: smoothed };
|
|
94105
94188
|
});
|
|
@@ -94112,14 +94195,14 @@ function partitionKeyframesByGroup(keyframes) {
|
|
|
94112
94195
|
const byGroup = /* @__PURE__ */ new Map();
|
|
94113
94196
|
for (const kf of keyframes) {
|
|
94114
94197
|
const perGroup = /* @__PURE__ */ new Map();
|
|
94115
|
-
for (const [
|
|
94116
|
-
const group = classifyPropertyGroup5(
|
|
94198
|
+
for (const [key, value] of Object.entries(kf.properties)) {
|
|
94199
|
+
const group = classifyPropertyGroup5(key);
|
|
94117
94200
|
let props = perGroup.get(group);
|
|
94118
94201
|
if (!props) {
|
|
94119
94202
|
props = {};
|
|
94120
94203
|
perGroup.set(group, props);
|
|
94121
94204
|
}
|
|
94122
|
-
props[
|
|
94205
|
+
props[key] = value;
|
|
94123
94206
|
}
|
|
94124
94207
|
for (const [group, props] of perGroup) {
|
|
94125
94208
|
let set = byGroup.get(group);
|
|
@@ -94209,9 +94292,9 @@ function useGestureCommit({
|
|
|
94209
94292
|
showToast("Recording too short. Try again", "error");
|
|
94210
94293
|
return;
|
|
94211
94294
|
}
|
|
94212
|
-
const simplified = simplifyGestureSamples(frozenSamples, duration, (
|
|
94213
|
-
if (
|
|
94214
|
-
if (
|
|
94295
|
+
const simplified = simplifyGestureSamples(frozenSamples, duration, (key) => {
|
|
94296
|
+
if (key === "opacity") return 0.01;
|
|
94297
|
+
if (key === "scale" || key === "scaleX" || key === "scaleY") return 0.01;
|
|
94215
94298
|
return 5;
|
|
94216
94299
|
});
|
|
94217
94300
|
const sortedPcts = Array.from(simplified.keys()).sort((a, b) => a - b);
|
|
@@ -97658,9 +97741,9 @@ var LayersPanel = memo52(function LayersPanel2({ host }) {
|
|
|
97658
97741
|
},
|
|
97659
97742
|
[resolveSelection, updateDomEditHoverSelection]
|
|
97660
97743
|
);
|
|
97661
|
-
const toggleCollapse = useCallback176((
|
|
97744
|
+
const toggleCollapse = useCallback176((key, e) => {
|
|
97662
97745
|
e.stopPropagation();
|
|
97663
|
-
setCollapsed((prev) => ({ ...prev, [
|
|
97746
|
+
setCollapsed((prev) => ({ ...prev, [key]: !prev[key] }));
|
|
97664
97747
|
}, []);
|
|
97665
97748
|
const handleReorder = useCallback176(
|
|
97666
97749
|
(event) => {
|
|
@@ -98167,12 +98250,12 @@ var CaptionAnimationPanel = memo53(function CaptionAnimationPanel2() {
|
|
|
98167
98250
|
|
|
98168
98251
|
// src/captions/components/CaptionPropertyPanel.tsx
|
|
98169
98252
|
import { jsx as jsx238, jsxs as jsxs187 } from "react/jsx-runtime";
|
|
98170
|
-
function isMixedValue(model, selectedSegmentIds,
|
|
98253
|
+
function isMixedValue(model, selectedSegmentIds, key, fallback) {
|
|
98171
98254
|
if (!model || selectedSegmentIds.size < 2) return false;
|
|
98172
98255
|
let first;
|
|
98173
98256
|
let seen = false;
|
|
98174
98257
|
for (const segId of selectedSegmentIds) {
|
|
98175
|
-
const v = model.segments.get(segId)?.style[
|
|
98258
|
+
const v = model.segments.get(segId)?.style[key] ?? fallback;
|
|
98176
98259
|
if (!seen) {
|
|
98177
98260
|
first = v;
|
|
98178
98261
|
seen = true;
|
|
@@ -98412,9 +98495,9 @@ var BlockParamsPanel = memo55(function BlockParamsPanel2({
|
|
|
98412
98495
|
const [commitState, setCommitState] = useState156({ tone: "idle" });
|
|
98413
98496
|
const commitTimersRef = useRef186(/* @__PURE__ */ new Map());
|
|
98414
98497
|
const commitParamNow = useCallback179(
|
|
98415
|
-
async (
|
|
98498
|
+
async (key, nextValue) => {
|
|
98416
98499
|
if (!fileManager) return;
|
|
98417
|
-
const previous = appliedRef.current[
|
|
98500
|
+
const previous = appliedRef.current[key];
|
|
98418
98501
|
if (previous === void 0 || previous === nextValue || !nextValue.trim()) return;
|
|
98419
98502
|
setCommitState({ tone: "saving" });
|
|
98420
98503
|
try {
|
|
@@ -98429,7 +98512,7 @@ var BlockParamsPanel = memo55(function BlockParamsPanel2({
|
|
|
98429
98512
|
tone: "error",
|
|
98430
98513
|
message: `Couldn't find the current value in ${compositionPath}. It may have been edited by hand.`
|
|
98431
98514
|
});
|
|
98432
|
-
trackBlockParamCommit({ tone: "error", blockName, key
|
|
98515
|
+
trackBlockParamCommit({ tone: "error", blockName, key });
|
|
98433
98516
|
return;
|
|
98434
98517
|
}
|
|
98435
98518
|
if (matches > 1) {
|
|
@@ -98437,7 +98520,7 @@ var BlockParamsPanel = memo55(function BlockParamsPanel2({
|
|
|
98437
98520
|
tone: "error",
|
|
98438
98521
|
message: `"${previous}" appears ${matches}\xD7 in ${compositionPath}. The panel can't tell which one belongs to this parameter, so it won't risk changing unrelated content. Edit the file directly to disambiguate.`
|
|
98439
98522
|
});
|
|
98440
|
-
trackBlockParamCommit({ tone: "error", blockName, key
|
|
98523
|
+
trackBlockParamCommit({ tone: "error", blockName, key });
|
|
98441
98524
|
return;
|
|
98442
98525
|
}
|
|
98443
98526
|
await fileManager.writeProjectFile(
|
|
@@ -98445,36 +98528,36 @@ var BlockParamsPanel = memo55(function BlockParamsPanel2({
|
|
|
98445
98528
|
content.replace(matcher, nextValue),
|
|
98446
98529
|
content
|
|
98447
98530
|
);
|
|
98448
|
-
appliedRef.current[
|
|
98531
|
+
appliedRef.current[key] = nextValue;
|
|
98449
98532
|
setCommitState({ tone: "saved" });
|
|
98450
|
-
trackBlockParamCommit({ tone: "saved", blockName, key
|
|
98533
|
+
trackBlockParamCommit({ tone: "saved", blockName, key });
|
|
98451
98534
|
setRefreshKey((k) => k + 1);
|
|
98452
98535
|
} catch {
|
|
98453
98536
|
setCommitState({ tone: "error", message: "Couldn't save the block file. Retry?" });
|
|
98454
|
-
trackBlockParamCommit({ tone: "error", blockName, key
|
|
98537
|
+
trackBlockParamCommit({ tone: "error", blockName, key });
|
|
98455
98538
|
}
|
|
98456
98539
|
},
|
|
98457
98540
|
[fileManager, compositionPath, setRefreshKey, blockName]
|
|
98458
98541
|
);
|
|
98459
98542
|
const commitParam = useCallback179(
|
|
98460
|
-
(
|
|
98543
|
+
(key, nextValue) => fileManager ? serializeStudioFileMutation(
|
|
98461
98544
|
fileManager.writeProjectFile,
|
|
98462
98545
|
compositionPath,
|
|
98463
|
-
() => commitParamNow(
|
|
98546
|
+
() => commitParamNow(key, nextValue)
|
|
98464
98547
|
) : Promise.resolve(),
|
|
98465
98548
|
[commitParamNow, compositionPath, fileManager]
|
|
98466
98549
|
);
|
|
98467
98550
|
const handleChange = useCallback179(
|
|
98468
|
-
(
|
|
98469
|
-
setValues((prev) => ({ ...prev, [
|
|
98551
|
+
(key, value) => {
|
|
98552
|
+
setValues((prev) => ({ ...prev, [key]: value }));
|
|
98470
98553
|
const timers = commitTimersRef.current;
|
|
98471
|
-
const existing = timers.get(
|
|
98554
|
+
const existing = timers.get(key);
|
|
98472
98555
|
if (existing) clearTimeout(existing);
|
|
98473
98556
|
timers.set(
|
|
98474
|
-
|
|
98557
|
+
key,
|
|
98475
98558
|
setTimeout(() => {
|
|
98476
|
-
timers.delete(
|
|
98477
|
-
void commitParam(
|
|
98559
|
+
timers.delete(key);
|
|
98560
|
+
void commitParam(key, value);
|
|
98478
98561
|
}, 300)
|
|
98479
98562
|
);
|
|
98480
98563
|
},
|
|
@@ -98483,10 +98566,10 @@ var BlockParamsPanel = memo55(function BlockParamsPanel2({
|
|
|
98483
98566
|
const flushRef = useRef186(() => {
|
|
98484
98567
|
});
|
|
98485
98568
|
flushRef.current = () => {
|
|
98486
|
-
for (const [
|
|
98569
|
+
for (const [key, timer] of commitTimersRef.current) {
|
|
98487
98570
|
clearTimeout(timer);
|
|
98488
|
-
const value = values[
|
|
98489
|
-
if (value !== void 0) void commitParam(
|
|
98571
|
+
const value = values[key];
|
|
98572
|
+
if (value !== void 0) void commitParam(key, value);
|
|
98490
98573
|
}
|
|
98491
98574
|
commitTimersRef.current.clear();
|
|
98492
98575
|
};
|
|
@@ -100297,13 +100380,13 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
|
|
|
100297
100380
|
ctrl.flush();
|
|
100298
100381
|
};
|
|
100299
100382
|
}, []);
|
|
100300
|
-
const toggleSection = useCallback182((
|
|
100383
|
+
const toggleSection = useCallback182((key) => {
|
|
100301
100384
|
setExpandedSections((prev) => {
|
|
100302
100385
|
const next = new Set(prev);
|
|
100303
|
-
if (next.has(
|
|
100304
|
-
next.delete(
|
|
100386
|
+
if (next.has(key)) {
|
|
100387
|
+
next.delete(key);
|
|
100305
100388
|
} else {
|
|
100306
|
-
next.add(
|
|
100389
|
+
next.add(key);
|
|
100307
100390
|
}
|
|
100308
100391
|
return next;
|
|
100309
100392
|
});
|
|
@@ -100715,11 +100798,11 @@ function draftFromDeclaration(decl) {
|
|
|
100715
100798
|
function numberDeclFromDraft(base2, draft) {
|
|
100716
100799
|
const value = Number(draft.defaultRaw);
|
|
100717
100800
|
if (!Number.isFinite(value)) return "Default must be a number.";
|
|
100718
|
-
const constraint = (
|
|
100719
|
-
const raw = draft[
|
|
100801
|
+
const constraint = (key) => {
|
|
100802
|
+
const raw = draft[key].trim();
|
|
100720
100803
|
if (!raw) return {};
|
|
100721
100804
|
const parsed = Number(raw);
|
|
100722
|
-
return Number.isFinite(parsed) ? { [
|
|
100805
|
+
return Number.isFinite(parsed) ? { [key]: parsed } : {};
|
|
100723
100806
|
};
|
|
100724
100807
|
return {
|
|
100725
100808
|
...base2,
|
|
@@ -100755,8 +100838,8 @@ var FORM_OWNED_KEYS = /* @__PURE__ */ new Set([
|
|
|
100755
100838
|
function mergeDeclarationEdit(original, edited) {
|
|
100756
100839
|
if (original.type !== edited.type) return edited;
|
|
100757
100840
|
const passthrough = {};
|
|
100758
|
-
for (const [
|
|
100759
|
-
if (!FORM_OWNED_KEYS.has(
|
|
100841
|
+
for (const [key, value] of Object.entries(original)) {
|
|
100842
|
+
if (!FORM_OWNED_KEYS.has(key)) passthrough[key] = value;
|
|
100760
100843
|
}
|
|
100761
100844
|
return { ...passthrough, ...edited };
|
|
100762
100845
|
}
|
|
@@ -100885,15 +100968,15 @@ function DeclarationForm({
|
|
|
100885
100968
|
) }),
|
|
100886
100969
|
/* @__PURE__ */ jsx250(Field, { label: "Default", children: /* @__PURE__ */ jsx250(DefaultField, { draft, onChange: (defaultRaw) => set({ defaultRaw }) }) })
|
|
100887
100970
|
] }),
|
|
100888
|
-
draft.type === "number" && /* @__PURE__ */ jsx250("div", { className: "grid grid-cols-3 gap-2", children: ["min", "max", "step"].map((
|
|
100971
|
+
draft.type === "number" && /* @__PURE__ */ jsx250("div", { className: "grid grid-cols-3 gap-2", children: ["min", "max", "step"].map((key) => /* @__PURE__ */ jsx250(Field, { label: key, children: /* @__PURE__ */ jsx250(
|
|
100889
100972
|
"input",
|
|
100890
100973
|
{
|
|
100891
100974
|
type: "text",
|
|
100892
|
-
value: draft[
|
|
100893
|
-
onChange: (e) => set({ [
|
|
100975
|
+
value: draft[key],
|
|
100976
|
+
onChange: (e) => set({ [key]: e.target.value }),
|
|
100894
100977
|
className: `${VARIABLES_INPUT_CLASS} tabular-nums`
|
|
100895
100978
|
}
|
|
100896
|
-
) },
|
|
100979
|
+
) }, key)) }),
|
|
100897
100980
|
draft.type === "enum" && /* @__PURE__ */ jsx250(Field, { label: "Options (one per line, value:Label)", children: /* @__PURE__ */ jsx250(
|
|
100898
100981
|
"textarea",
|
|
100899
100982
|
{
|
|
@@ -100975,8 +101058,8 @@ function CompositionSection({
|
|
|
100975
101058
|
}
|
|
100976
101059
|
),
|
|
100977
101060
|
group.variables.map((decl) => {
|
|
100978
|
-
const
|
|
100979
|
-
const editing = editingKey ===
|
|
101061
|
+
const key = `${group.path}::${decl.id}`;
|
|
101062
|
+
const editing = editingKey === key;
|
|
100980
101063
|
return /* @__PURE__ */ jsxs200("div", { className: "space-y-1.5 rounded-lg border border-neutral-800/70 p-2", children: [
|
|
100981
101064
|
/* @__PURE__ */ jsxs200("div", { className: "flex items-center gap-1.5", children: [
|
|
100982
101065
|
/* @__PURE__ */ jsx252("span", { className: "truncate text-[10px] font-medium text-neutral-300", children: decl.label }),
|
|
@@ -100987,7 +101070,7 @@ function CompositionSection({
|
|
|
100987
101070
|
{
|
|
100988
101071
|
label: "Edit",
|
|
100989
101072
|
title: "Edit declaration",
|
|
100990
|
-
onClick: () => onToggleEdit(editing ? null :
|
|
101073
|
+
onClick: () => onToggleEdit(editing ? null : key)
|
|
100991
101074
|
}
|
|
100992
101075
|
),
|
|
100993
101076
|
/* @__PURE__ */ jsx252(
|
|
@@ -101011,7 +101094,7 @@ function CompositionSection({
|
|
|
101011
101094
|
onCancel: () => onToggleEdit(null)
|
|
101012
101095
|
}
|
|
101013
101096
|
)
|
|
101014
|
-
] },
|
|
101097
|
+
] }, key);
|
|
101015
101098
|
})
|
|
101016
101099
|
] });
|
|
101017
101100
|
}
|
|
@@ -104422,9 +104505,9 @@ function parseStyleString(style) {
|
|
|
104422
104505
|
for (const decl of style.split(";")) {
|
|
104423
104506
|
const colonIdx = decl.indexOf(":");
|
|
104424
104507
|
if (colonIdx < 0) continue;
|
|
104425
|
-
const
|
|
104508
|
+
const key = decl.slice(0, colonIdx).trim();
|
|
104426
104509
|
const value = decl.slice(colonIdx + 1).trim();
|
|
104427
|
-
if (
|
|
104510
|
+
if (key && value) result[key] = value;
|
|
104428
104511
|
}
|
|
104429
104512
|
return result;
|
|
104430
104513
|
}
|
|
@@ -104791,6 +104874,7 @@ export {
|
|
|
104791
104874
|
collectSnapContext,
|
|
104792
104875
|
collectStudioLookScene,
|
|
104793
104876
|
currentTimelineRange,
|
|
104877
|
+
describePreviewElements,
|
|
104794
104878
|
dispatchLinkShortcut,
|
|
104795
104879
|
displayTrackOrder,
|
|
104796
104880
|
extractSnapTargets,
|
|
@@ -104798,6 +104882,8 @@ export {
|
|
|
104798
104882
|
fieldBase,
|
|
104799
104883
|
fieldText,
|
|
104800
104884
|
findElementBlock,
|
|
104885
|
+
findPreviewElementForSelection,
|
|
104886
|
+
findPreviewElementForTimelineElement,
|
|
104801
104887
|
flushStudioPendingEdits,
|
|
104802
104888
|
formatCombo2 as formatCombo,
|
|
104803
104889
|
formatTime,
|
|
@@ -104813,8 +104899,15 @@ export {
|
|
|
104813
104899
|
persistRenderSettings,
|
|
104814
104900
|
playSeamTransitionLoop,
|
|
104815
104901
|
popupSurface,
|
|
104902
|
+
previewAncestors,
|
|
104816
104903
|
previewEditingClient,
|
|
104904
|
+
previewElementsAtPoint,
|
|
104817
104905
|
previewFrameOpaque,
|
|
104906
|
+
previewGeometry,
|
|
104907
|
+
previewLayers,
|
|
104908
|
+
previewPointerTargets,
|
|
104909
|
+
queryPreviewElements,
|
|
104910
|
+
readable,
|
|
104818
104911
|
resolveDomEditSelection,
|
|
104819
104912
|
resolveEquidistanceGuides,
|
|
104820
104913
|
resolveGuideLineRect,
|
|
@@ -104825,6 +104918,7 @@ export {
|
|
|
104825
104918
|
revertNewestStudioPendingEdit,
|
|
104826
104919
|
setStudioKeys,
|
|
104827
104920
|
snapEngagedForTravel,
|
|
104921
|
+
standInFor,
|
|
104828
104922
|
studioKeyClash,
|
|
104829
104923
|
useAudioGainDialogStore,
|
|
104830
104924
|
useAudioMetersVisible,
|