@hyperframes/studio 0.8.205 → 0.8.206
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-lCVwx9d3.js +478 -0
- package/dist/assets/{index-C8hp9Y7c.js → index-BNuxGFZK.js} +1 -1
- package/dist/assets/{index-dy6GQJn4.js → index-CwreIGoq.js} +93 -93
- package/dist/{chunk-Z5NKM57J.js → chunk-3EAFE522.js} +8 -4
- package/dist/{chunk-2YCKGJFD.js → chunk-DAZTBGYM.js} +1 -1
- package/dist/{chunk-T43DM7Q6.js → chunk-OGIOFEC7.js} +4 -2
- package/dist/{domEditingLayers-WMDSHU5P.js → domEditingLayers-7Z6J4UOK.js} +2 -2
- package/dist/index.html +1 -1
- package/dist/index.js +92 -77
- package/dist/player.js +2 -2
- package/package.json +8 -8
- package/src/components/MediaPreview.test.tsx +69 -0
- package/src/components/MediaPreview.tsx +10 -5
- package/src/components/editor/domEditLayerWalkCache.test.ts +48 -0
- package/src/components/editor/domEditLayerWalkCache.ts +6 -0
- package/src/components/editor/domEditingLayers.ts +3 -2
- package/src/components/sidebar/PromptPreviewModal.test.tsx +22 -0
- package/src/components/sidebar/PromptPreviewModal.tsx +1 -0
- package/src/player/hooks/previewMessageRouter.test.ts +34 -0
- package/src/player/hooks/previewMessageRouter.ts +14 -3
- package/src/utils/sourceScopedSelectorIndex.ts +5 -2
- package/dist/assets/hyperframes-player-DzdSmJdB.js +0 -478
package/dist/index.js
CHANGED
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
whenPreviewBooted,
|
|
55
55
|
writeStudioUiPreferences,
|
|
56
56
|
zoomToSelectedClips
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-DAZTBGYM.js";
|
|
58
58
|
import {
|
|
59
59
|
Button,
|
|
60
60
|
ContextMenu,
|
|
@@ -112,7 +112,7 @@ import {
|
|
|
112
112
|
resolveAllVisualDomEditTargets,
|
|
113
113
|
resolveDomEditSelection,
|
|
114
114
|
serializeDomEditTextFields
|
|
115
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-3EAFE522.js";
|
|
116
116
|
import {
|
|
117
117
|
LAYER_REVEAL_PRIOR_POSITION_ATTR,
|
|
118
118
|
LAYER_REVEAL_PRIOR_Z_ATTR,
|
|
@@ -179,7 +179,7 @@ import {
|
|
|
179
179
|
studioApiFetch,
|
|
180
180
|
toHexColor,
|
|
181
181
|
wrapTimeline
|
|
182
|
-
} from "./chunk-
|
|
182
|
+
} from "./chunk-OGIOFEC7.js";
|
|
183
183
|
import "./chunk-MLKGABMK.js";
|
|
184
184
|
|
|
185
185
|
// src/components/EditorShell.tsx
|
|
@@ -32294,7 +32294,13 @@ function acceptedPreviewMessage(e, iframe) {
|
|
|
32294
32294
|
if (data?.source !== "hf-preview") return null;
|
|
32295
32295
|
return acceptStudioRuntimeMessage(data) ? data : null;
|
|
32296
32296
|
}
|
|
32297
|
-
function
|
|
32297
|
+
function enrichDue(lastTimelineMessage, enriched) {
|
|
32298
|
+
const now2 = Date.now();
|
|
32299
|
+
if (now2 - lastTimelineMessage <= 500 || now2 - enriched.at <= 500) return false;
|
|
32300
|
+
enriched.at = now2;
|
|
32301
|
+
return true;
|
|
32302
|
+
}
|
|
32303
|
+
function handleStateMessage(deps, iframe, playingHoldsClipListPosts, enriched) {
|
|
32298
32304
|
try {
|
|
32299
32305
|
if (usePlayerStore.getState().elements.length === 0) {
|
|
32300
32306
|
const manifest = iframe?.contentWindow?.__clipManifest;
|
|
@@ -32302,7 +32308,7 @@ function handleStateMessage(deps, iframe, playingHoldsClipListPosts) {
|
|
|
32302
32308
|
deps.processTimelineMessageRef.current(manifest);
|
|
32303
32309
|
}
|
|
32304
32310
|
}
|
|
32305
|
-
if (!playingHoldsClipListPosts &&
|
|
32311
|
+
if (!playingHoldsClipListPosts && enrichDue(deps.lastTimelineMessageRef.current, enriched)) {
|
|
32306
32312
|
deps.enrichMissingCompositionsRef.current();
|
|
32307
32313
|
}
|
|
32308
32314
|
} catch {
|
|
@@ -32339,11 +32345,13 @@ function applyStoreReport(data) {
|
|
|
32339
32345
|
}
|
|
32340
32346
|
}
|
|
32341
32347
|
function createPreviewMessageHandler(deps) {
|
|
32348
|
+
const enriched = { at: 0 };
|
|
32342
32349
|
return (e) => {
|
|
32343
32350
|
const iframe = deps.iframeRef.current;
|
|
32344
32351
|
const data = acceptedPreviewMessage(e, iframe);
|
|
32345
32352
|
if (!data) return;
|
|
32346
|
-
if (data.type === "state")
|
|
32353
|
+
if (data.type === "state")
|
|
32354
|
+
return handleStateMessage(deps, iframe, data.isPlaying === true, enriched);
|
|
32347
32355
|
if (applyStoreReport(data)) return;
|
|
32348
32356
|
if (data.type === "ready") {
|
|
32349
32357
|
const level = usePlayerStore.getState().previewQuality;
|
|
@@ -37672,7 +37680,7 @@ function OffCanvasIndicators({
|
|
|
37672
37680
|
const selectOffCanvas = async () => {
|
|
37673
37681
|
const el = elements.current.get(r.key);
|
|
37674
37682
|
if (!el) return;
|
|
37675
|
-
const { resolveDomEditSelection: resolveDomEditSelection2 } = await import("./domEditingLayers-
|
|
37683
|
+
const { resolveDomEditSelection: resolveDomEditSelection2 } = await import("./domEditingLayers-7Z6J4UOK.js");
|
|
37676
37684
|
const acp = activeCompositionPathRef.current ?? "index.html";
|
|
37677
37685
|
const sel = await resolveDomEditSelection2(el, {
|
|
37678
37686
|
activeCompositionPath: acp,
|
|
@@ -91981,7 +91989,7 @@ import { useMemo as useMemo89 } from "react";
|
|
|
91981
91989
|
import { memo as memo51, useCallback as useCallback172 } from "react";
|
|
91982
91990
|
|
|
91983
91991
|
// src/components/MediaPreview.tsx
|
|
91984
|
-
import { useState as useState137 } from "react";
|
|
91992
|
+
import { useEffect as useEffect138, useState as useState137 } from "react";
|
|
91985
91993
|
import { encodeUrlPath as encodeUrlPath7 } from "@hyperframes/parsers";
|
|
91986
91994
|
import { jsx as jsx214, jsxs as jsxs167 } from "react/jsx-runtime";
|
|
91987
91995
|
function MediaErrorPanel({ name, filePath }) {
|
|
@@ -92012,9 +92020,15 @@ function MediaErrorPanel({ name, filePath }) {
|
|
|
92012
92020
|
function MediaPreview({ projectId, filePath }) {
|
|
92013
92021
|
const serveUrl = buildProjectApiPath(projectId, `/preview/${encodeUrlPath7(filePath)}`);
|
|
92014
92022
|
const name = filePath.split("/").pop() ?? filePath;
|
|
92015
|
-
const [
|
|
92016
|
-
|
|
92017
|
-
|
|
92023
|
+
const [failure, setFailure] = useState137({
|
|
92024
|
+
source: serveUrl,
|
|
92025
|
+
failed: false
|
|
92026
|
+
});
|
|
92027
|
+
useEffect138(() => {
|
|
92028
|
+
setFailure({ source: serveUrl, failed: false });
|
|
92029
|
+
}, [serveUrl]);
|
|
92030
|
+
const failed2 = failure.source === serveUrl && failure.failed;
|
|
92031
|
+
const setFailed = () => setFailure({ source: serveUrl, failed: true });
|
|
92018
92032
|
if (failed2) return /* @__PURE__ */ jsx214(MediaErrorPanel, { name, filePath });
|
|
92019
92033
|
if (IMAGE_EXT.test(filePath)) {
|
|
92020
92034
|
return /* @__PURE__ */ jsxs167("div", { className: "flex flex-col items-center justify-center h-full p-4 bg-neutral-950", children: [
|
|
@@ -92098,7 +92112,7 @@ function MediaPreview({ projectId, filePath }) {
|
|
|
92098
92112
|
}
|
|
92099
92113
|
|
|
92100
92114
|
// src/components/sidebar/AssetsTab.tsx
|
|
92101
|
-
import { memo as memo48, useState as useState143, useCallback as useCallback168, useRef as useRef174, useMemo as useMemo84, useEffect as
|
|
92115
|
+
import { memo as memo48, useState as useState143, useCallback as useCallback168, useRef as useRef174, useMemo as useMemo84, useEffect as useEffect144 } from "react";
|
|
92102
92116
|
|
|
92103
92117
|
// src/components/ui/SearchInput.tsx
|
|
92104
92118
|
import { jsx as jsx215, jsxs as jsxs168 } from "react/jsx-runtime";
|
|
@@ -92209,11 +92223,11 @@ var CATEGORY_LABELS = {
|
|
|
92209
92223
|
var FILTER_ORDER = ["audio", "images", "video", "fonts"];
|
|
92210
92224
|
|
|
92211
92225
|
// src/components/sidebar/AudioRow.tsx
|
|
92212
|
-
import { useState as useState139, useRef as useRef172, useEffect as
|
|
92226
|
+
import { useState as useState139, useRef as useRef172, useEffect as useEffect140, useCallback as useCallback166 } from "react";
|
|
92213
92227
|
import { classifyWebAudioMediaRoute } from "@hyperframes/core/runtime/web-audio-route";
|
|
92214
92228
|
|
|
92215
92229
|
// src/components/sidebar/AssetContextMenu.tsx
|
|
92216
|
-
import { useCallback as useCallback165, useEffect as
|
|
92230
|
+
import { useCallback as useCallback165, useEffect as useEffect139, useLayoutEffect as useLayoutEffect14, useRef as useRef171, useState as useState138 } from "react";
|
|
92217
92231
|
import { Fragment as Fragment59, jsx as jsx216, jsxs as jsxs169 } from "react/jsx-runtime";
|
|
92218
92232
|
function isValidAssetName(name) {
|
|
92219
92233
|
return name.length > 0 && !/[/\\]/.test(name) && !name.includes("..");
|
|
@@ -92243,7 +92257,7 @@ function ContextMenu3({
|
|
|
92243
92257
|
y: Math.min(y, window.innerHeight - rect.height - margin)
|
|
92244
92258
|
});
|
|
92245
92259
|
}, [x, y, mode]);
|
|
92246
|
-
|
|
92260
|
+
useEffect139(() => {
|
|
92247
92261
|
const onKeyDown = (e) => {
|
|
92248
92262
|
if (e.key === "Escape") {
|
|
92249
92263
|
e.stopPropagation();
|
|
@@ -92268,7 +92282,7 @@ function ContextMenu3({
|
|
|
92268
92282
|
document.addEventListener("keydown", onKeyDown, true);
|
|
92269
92283
|
return () => document.removeEventListener("keydown", onKeyDown, true);
|
|
92270
92284
|
}, [mode, onClose]);
|
|
92271
|
-
|
|
92285
|
+
useEffect139(() => {
|
|
92272
92286
|
if (mode === "menu") {
|
|
92273
92287
|
menuRef.current?.querySelector('[role="menuitem"]')?.focus();
|
|
92274
92288
|
}
|
|
@@ -92535,7 +92549,7 @@ function AudioRow({
|
|
|
92535
92549
|
},
|
|
92536
92550
|
[activateRow]
|
|
92537
92551
|
);
|
|
92538
|
-
|
|
92552
|
+
useEffect140(() => {
|
|
92539
92553
|
return () => {
|
|
92540
92554
|
cancelAnimationFrame(animRef.current);
|
|
92541
92555
|
audioRef.current?.pause();
|
|
@@ -92543,7 +92557,7 @@ function AudioRow({
|
|
|
92543
92557
|
if (stopCurrentPreview === stopPlayback) stopCurrentPreview = null;
|
|
92544
92558
|
};
|
|
92545
92559
|
}, [stopPlayback]);
|
|
92546
|
-
|
|
92560
|
+
useEffect140(() => {
|
|
92547
92561
|
if (playing) {
|
|
92548
92562
|
const barCount = 24;
|
|
92549
92563
|
const loop = () => {
|
|
@@ -92710,7 +92724,7 @@ function AudioRow({
|
|
|
92710
92724
|
}
|
|
92711
92725
|
|
|
92712
92726
|
// src/components/sidebar/GlobalAssetsView.tsx
|
|
92713
|
-
import { useEffect as
|
|
92727
|
+
import { useEffect as useEffect141, useMemo as useMemo83, useState as useState140 } from "react";
|
|
92714
92728
|
import { jsx as jsx218, jsxs as jsxs171 } from "react/jsx-runtime";
|
|
92715
92729
|
function globalAssetRows(records, query = "") {
|
|
92716
92730
|
const q = query.trim().toLowerCase();
|
|
@@ -92726,7 +92740,7 @@ function globalAssetRows(records, query = "") {
|
|
|
92726
92740
|
}
|
|
92727
92741
|
function GlobalAssetsView({ searchQuery }) {
|
|
92728
92742
|
const [records, setRecords] = useState140(null);
|
|
92729
|
-
|
|
92743
|
+
useEffect141(() => {
|
|
92730
92744
|
let cancelled = false;
|
|
92731
92745
|
studioApiFetch("/api/assets/global").then((r) => r.ok ? r.json() : { assets: [] }).then((d) => {
|
|
92732
92746
|
if (!cancelled) setRecords(Array.isArray(d.assets) ? d.assets : []);
|
|
@@ -92769,10 +92783,10 @@ function GlobalAssetsView({ searchQuery }) {
|
|
|
92769
92783
|
}
|
|
92770
92784
|
|
|
92771
92785
|
// src/components/sidebar/AssetCard.tsx
|
|
92772
|
-
import { useState as useState142, useEffect as
|
|
92786
|
+
import { useState as useState142, useEffect as useEffect143, useRef as useRef173, useCallback as useCallback167 } from "react";
|
|
92773
92787
|
|
|
92774
92788
|
// src/components/ui/VideoFrameThumbnail.tsx
|
|
92775
|
-
import { useState as useState141, useEffect as
|
|
92789
|
+
import { useState as useState141, useEffect as useEffect142 } from "react";
|
|
92776
92790
|
import { jsx as jsx219 } from "react/jsx-runtime";
|
|
92777
92791
|
function VideoFrameThumbnail({
|
|
92778
92792
|
src,
|
|
@@ -92780,7 +92794,7 @@ function VideoFrameThumbnail({
|
|
|
92780
92794
|
}) {
|
|
92781
92795
|
const [frame3, setFrame] = useState141(null);
|
|
92782
92796
|
const [failed2, setFailed] = useState141(false);
|
|
92783
|
-
|
|
92797
|
+
useEffect142(() => {
|
|
92784
92798
|
setFailed(false);
|
|
92785
92799
|
const video = document.createElement("video");
|
|
92786
92800
|
video.crossOrigin = "anonymous";
|
|
@@ -92847,7 +92861,7 @@ function openAssetContextMenu(e, setContextMenu) {
|
|
|
92847
92861
|
}
|
|
92848
92862
|
function useProbedDuration(src, skip) {
|
|
92849
92863
|
const [duration, setDuration] = useState142(void 0);
|
|
92850
|
-
|
|
92864
|
+
useEffect143(() => {
|
|
92851
92865
|
if (skip) return;
|
|
92852
92866
|
let cancelled = false;
|
|
92853
92867
|
let retryTimer;
|
|
@@ -93246,7 +93260,7 @@ var AssetsTab = memo48(function AssetsTab2({
|
|
|
93246
93260
|
const [manifest, setManifest] = useState143(/* @__PURE__ */ new Map());
|
|
93247
93261
|
const manifest404Ref = useRef174(/* @__PURE__ */ new Set());
|
|
93248
93262
|
const assetsKey = assets.join("|");
|
|
93249
|
-
|
|
93263
|
+
useEffect144(() => {
|
|
93250
93264
|
if (manifest404Ref.current.has(projectId)) return;
|
|
93251
93265
|
let cancelled = false;
|
|
93252
93266
|
studioApiFetch(buildProjectApiPath(projectId, `/preview/.media/manifest.jsonl`)).then((r) => {
|
|
@@ -93503,11 +93517,11 @@ var AssetsTab = memo48(function AssetsTab2({
|
|
|
93503
93517
|
});
|
|
93504
93518
|
|
|
93505
93519
|
// src/components/sidebar/BlocksTab.tsx
|
|
93506
|
-
import { memo as memo49, useState as useState145, useCallback as useCallback170, useRef as useRef176, useEffect as
|
|
93520
|
+
import { memo as memo49, useState as useState145, useCallback as useCallback170, useRef as useRef176, useEffect as useEffect146 } from "react";
|
|
93507
93521
|
import { createPortal as createPortal14 } from "react-dom";
|
|
93508
93522
|
|
|
93509
93523
|
// src/components/sidebar/PromptPreviewModal.tsx
|
|
93510
|
-
import { useState as useState144, useCallback as useCallback169, useEffect as
|
|
93524
|
+
import { useState as useState144, useCallback as useCallback169, useEffect as useEffect145, useRef as useRef175 } from "react";
|
|
93511
93525
|
import { jsx as jsx222, jsxs as jsxs174 } from "react/jsx-runtime";
|
|
93512
93526
|
function PromptPreviewModal({
|
|
93513
93527
|
title,
|
|
@@ -93527,7 +93541,7 @@ function PromptPreviewModal({
|
|
|
93527
93541
|
containerRef,
|
|
93528
93542
|
canClose: () => valueRef.current === prompt
|
|
93529
93543
|
});
|
|
93530
|
-
|
|
93544
|
+
useEffect145(() => {
|
|
93531
93545
|
requestAnimationFrame(() => {
|
|
93532
93546
|
setEntered(true);
|
|
93533
93547
|
textareaRef.current?.focus();
|
|
@@ -93595,6 +93609,7 @@ function PromptPreviewModal({
|
|
|
93595
93609
|
"textarea",
|
|
93596
93610
|
{
|
|
93597
93611
|
ref: textareaRef,
|
|
93612
|
+
"aria-label": "Prompt",
|
|
93598
93613
|
value,
|
|
93599
93614
|
onChange: (e) => setValue(e.target.value),
|
|
93600
93615
|
onKeyDown: (e) => {
|
|
@@ -93833,7 +93848,7 @@ function BlockCard({
|
|
|
93833
93848
|
setHovered(false);
|
|
93834
93849
|
onPreview?.(null);
|
|
93835
93850
|
}, [onPreview]);
|
|
93836
|
-
|
|
93851
|
+
useEffect146(() => {
|
|
93837
93852
|
return () => {
|
|
93838
93853
|
if (hoverTimer.current) clearTimeout(hoverTimer.current);
|
|
93839
93854
|
};
|
|
@@ -93994,7 +94009,7 @@ function BlockCard({
|
|
|
93994
94009
|
}
|
|
93995
94010
|
|
|
93996
94011
|
// src/components/sidebar/CompositionsTab.tsx
|
|
93997
|
-
import { memo as memo50, useCallback as useCallback171, useEffect as
|
|
94012
|
+
import { memo as memo50, useCallback as useCallback171, useEffect as useEffect147, useLayoutEffect as useLayoutEffect15, useMemo as useMemo85, useRef as useRef177, useState as useState146 } from "react";
|
|
93998
94013
|
import { jsx as jsx224, jsxs as jsxs176 } from "react/jsx-runtime";
|
|
93999
94014
|
var DEFAULT_PREVIEW_STAGE = { width: 1920, height: 1080 };
|
|
94000
94015
|
var CARD_W = 80;
|
|
@@ -94073,7 +94088,7 @@ function useLastFrame(request2, snapshot3) {
|
|
|
94073
94088
|
function useNearViewport() {
|
|
94074
94089
|
const [element, setElement] = useState146(null);
|
|
94075
94090
|
const [near4, setNear] = useState146(false);
|
|
94076
|
-
|
|
94091
|
+
useEffect147(() => {
|
|
94077
94092
|
if (!element || near4) return;
|
|
94078
94093
|
if (typeof IntersectionObserver === "undefined") return setNear(true);
|
|
94079
94094
|
const observer = new IntersectionObserver(
|
|
@@ -94154,13 +94169,13 @@ function CompCard({
|
|
|
94154
94169
|
});
|
|
94155
94170
|
const thumbnailOffsetX = (CARD_W - stageSize.width * previewScale) / 2;
|
|
94156
94171
|
const thumbnailOffsetY = (CARD_H - stageSize.height * previewScale) / 2;
|
|
94157
|
-
|
|
94172
|
+
useEffect147(() => {
|
|
94158
94173
|
if (hovered) requestIframePlaybackSync(true);
|
|
94159
94174
|
}, [hovered, requestIframePlaybackSync]);
|
|
94160
|
-
|
|
94175
|
+
useEffect147(() => {
|
|
94161
94176
|
if (livePreviewLoaded) postFrameDisplayScale(iframeRef.current);
|
|
94162
94177
|
}, [livePreviewLoaded, previewScale]);
|
|
94163
|
-
|
|
94178
|
+
useEffect147(() => {
|
|
94164
94179
|
if (!hovered) return;
|
|
94165
94180
|
const onRuntimeReady = (event) => {
|
|
94166
94181
|
const frame3 = iframeRef.current;
|
|
@@ -94171,7 +94186,7 @@ function CompCard({
|
|
|
94171
94186
|
window.addEventListener("message", onRuntimeReady);
|
|
94172
94187
|
return () => window.removeEventListener("message", onRuntimeReady);
|
|
94173
94188
|
}, [hovered]);
|
|
94174
|
-
|
|
94189
|
+
useEffect147(() => {
|
|
94175
94190
|
return () => {
|
|
94176
94191
|
if (hoverTimer.current) clearTimeout(hoverTimer.current);
|
|
94177
94192
|
if (syncTimer.current) clearTimeout(syncTimer.current);
|
|
@@ -94650,7 +94665,7 @@ function CodeBody({
|
|
|
94650
94665
|
import { memo as memo62, useCallback as useCallback190 } from "react";
|
|
94651
94666
|
|
|
94652
94667
|
// src/components/editor/LayersPanel.tsx
|
|
94653
|
-
import { memo as memo52, useState as useState148, useCallback as useCallback174, useEffect as
|
|
94668
|
+
import { memo as memo52, useState as useState148, useCallback as useCallback174, useEffect as useEffect148, useRef as useRef179 } from "react";
|
|
94654
94669
|
|
|
94655
94670
|
// src/components/editor/layerKind.ts
|
|
94656
94671
|
function isCompositionHost(el) {
|
|
@@ -94969,10 +94984,10 @@ var LayersPanel = memo52(function LayersPanel2({ host }) {
|
|
|
94969
94984
|
);
|
|
94970
94985
|
setLayers(sortLayersByZIndex(items));
|
|
94971
94986
|
}, [previewIframeRef, activeCompPath, isMasterView, activeGroupElement, setActiveGroupElement]);
|
|
94972
|
-
|
|
94987
|
+
useEffect148(() => {
|
|
94973
94988
|
collectLayers();
|
|
94974
94989
|
}, [collectLayers, refreshKey, zEditVersion, livePreviewIframe]);
|
|
94975
|
-
|
|
94990
|
+
useEffect148(() => {
|
|
94976
94991
|
const iframe = previewIframeRef.current;
|
|
94977
94992
|
if (!iframe) return;
|
|
94978
94993
|
const handleLoad = () => {
|
|
@@ -94981,13 +94996,13 @@ var LayersPanel = memo52(function LayersPanel2({ host }) {
|
|
|
94981
94996
|
};
|
|
94982
94997
|
return onPreviewContentReplaced(iframe, handleLoad);
|
|
94983
94998
|
}, [previewIframeRef, livePreviewIframe, collectLayers]);
|
|
94984
|
-
|
|
94999
|
+
useEffect148(() => {
|
|
94985
95000
|
if (!compositionLoading) {
|
|
94986
95001
|
const timer = setTimeout(collectLayers, 100);
|
|
94987
95002
|
return () => clearTimeout(timer);
|
|
94988
95003
|
}
|
|
94989
95004
|
}, [compositionLoading, collectLayers]);
|
|
94990
|
-
|
|
95005
|
+
useEffect148(() => {
|
|
94991
95006
|
const throttle = createRafThrottle(collectLayers, 100);
|
|
94992
95007
|
const unsubscribe = liveTime.subscribe(throttle.invoke);
|
|
94993
95008
|
return () => {
|
|
@@ -95280,7 +95295,7 @@ import { memo as memo54, useCallback as useCallback176, useState as useState150
|
|
|
95280
95295
|
import { memo as memo53, useCallback as useCallback175 } from "react";
|
|
95281
95296
|
|
|
95282
95297
|
// src/captions/components/shared.tsx
|
|
95283
|
-
import { useEffect as
|
|
95298
|
+
import { useEffect as useEffect149, useRef as useRef180, useState as useState149 } from "react";
|
|
95284
95299
|
import { jsx as jsx229, jsxs as jsxs180 } from "react/jsx-runtime";
|
|
95285
95300
|
var inputCls = "w-full bg-neutral-900 border border-neutral-800 rounded-sm px-1.5 py-0.5 text-2xs text-neutral-200 font-mono outline-hidden focus:border-studio-accent disabled:opacity-40 disabled:cursor-not-allowed";
|
|
95286
95301
|
function Section2({ label, children }) {
|
|
@@ -95307,7 +95322,7 @@ function NumberField2({
|
|
|
95307
95322
|
}) {
|
|
95308
95323
|
const [draft, setDraft] = useState149(null);
|
|
95309
95324
|
const focusedRef = useRef180(false);
|
|
95310
|
-
|
|
95325
|
+
useEffect149(() => {
|
|
95311
95326
|
if (!focusedRef.current) setDraft(null);
|
|
95312
95327
|
}, [value]);
|
|
95313
95328
|
const display2 = draft !== null ? draft : mixed ? "" : String(value ?? 0);
|
|
@@ -95799,7 +95814,7 @@ var CaptionPropertyPanel = memo54(function CaptionPropertyPanel2({
|
|
|
95799
95814
|
});
|
|
95800
95815
|
|
|
95801
95816
|
// src/components/editor/BlockParamsPanel.tsx
|
|
95802
|
-
import { memo as memo55, useCallback as useCallback177, useEffect as
|
|
95817
|
+
import { memo as memo55, useCallback as useCallback177, useEffect as useEffect150, useRef as useRef181, useState as useState151 } from "react";
|
|
95803
95818
|
import { jsx as jsx232, jsxs as jsxs183 } from "react/jsx-runtime";
|
|
95804
95819
|
var BlockParamsPanel = memo55(function BlockParamsPanel2({
|
|
95805
95820
|
blockName,
|
|
@@ -95901,7 +95916,7 @@ var BlockParamsPanel = memo55(function BlockParamsPanel2({
|
|
|
95901
95916
|
}
|
|
95902
95917
|
commitTimersRef.current.clear();
|
|
95903
95918
|
};
|
|
95904
|
-
|
|
95919
|
+
useEffect150(() => () => flushRef.current(), []);
|
|
95905
95920
|
return /* @__PURE__ */ jsxs183("div", { className: "flex flex-col h-full", children: [
|
|
95906
95921
|
/* @__PURE__ */ jsxs183("div", { className: "flex items-center justify-between px-3 py-2 border-b border-neutral-800", children: [
|
|
95907
95922
|
/* @__PURE__ */ jsx232("div", { className: "text-[11px] font-semibold text-neutral-200 truncate", children: blockTitle }),
|
|
@@ -96033,7 +96048,7 @@ function ParamControl({
|
|
|
96033
96048
|
import { memo as memo59 } from "react";
|
|
96034
96049
|
|
|
96035
96050
|
// src/components/renders/RenderQueue.tsx
|
|
96036
|
-
import { memo as memo58, useState as useState154, useRef as useRef183, useEffect as
|
|
96051
|
+
import { memo as memo58, useState as useState154, useRef as useRef183, useEffect as useEffect152, useLayoutEffect as useLayoutEffect16, useId as useId4 } from "react";
|
|
96037
96052
|
import { createPortal as createPortal15 } from "react-dom";
|
|
96038
96053
|
import { CANVAS_DIMENSIONS } from "@hyperframes/parsers";
|
|
96039
96054
|
|
|
@@ -96314,7 +96329,7 @@ var RenderQueueItem = memo56(function RenderQueueItem2({
|
|
|
96314
96329
|
});
|
|
96315
96330
|
|
|
96316
96331
|
// src/components/renders/FfmpegRequiredNotice.tsx
|
|
96317
|
-
import { memo as memo57, useEffect as
|
|
96332
|
+
import { memo as memo57, useEffect as useEffect151, useRef as useRef182, useState as useState153 } from "react";
|
|
96318
96333
|
import { jsx as jsx236, jsxs as jsxs188 } from "react/jsx-runtime";
|
|
96319
96334
|
var DOWNLOAD_URL = "https://ffmpeg.org/download.html";
|
|
96320
96335
|
var CUE_MS = 1600;
|
|
@@ -96328,16 +96343,16 @@ var FfmpegRequiredNotice = memo57(function FfmpegRequiredNotice2({
|
|
|
96328
96343
|
const [recheckFailed, setRecheckFailed] = useState153(false);
|
|
96329
96344
|
const wasChecking = useRef182(false);
|
|
96330
96345
|
const cueTimer = useRef182(void 0);
|
|
96331
|
-
|
|
96346
|
+
useEffect151(() => {
|
|
96332
96347
|
if (wasChecking.current && !checking) setRecheckFailed(true);
|
|
96333
96348
|
wasChecking.current = checking;
|
|
96334
96349
|
}, [checking]);
|
|
96335
|
-
|
|
96350
|
+
useEffect151(() => {
|
|
96336
96351
|
if (!recheckFailed) return;
|
|
96337
96352
|
cueTimer.current = setTimeout(() => setRecheckFailed(false), CUE_MS);
|
|
96338
96353
|
return () => clearTimeout(cueTimer.current);
|
|
96339
96354
|
}, [recheckFailed]);
|
|
96340
|
-
|
|
96355
|
+
useEffect151(() => () => clearTimeout(cueTimer.current), []);
|
|
96341
96356
|
const copy = async (command) => {
|
|
96342
96357
|
const ok = await copyTextToClipboard(command);
|
|
96343
96358
|
if (!ok) return;
|
|
@@ -96522,7 +96537,7 @@ function FormatInfoTooltip({ format }) {
|
|
|
96522
96537
|
const hide = () => {
|
|
96523
96538
|
timeoutRef.current = setTimeout(() => setOpen(false), 120);
|
|
96524
96539
|
};
|
|
96525
|
-
|
|
96540
|
+
useEffect152(() => () => clearTimeout(timeoutRef.current), []);
|
|
96526
96541
|
useLayoutEffect16(() => {
|
|
96527
96542
|
if (!open) return;
|
|
96528
96543
|
const el = triggerRef.current;
|
|
@@ -96536,7 +96551,7 @@ function FormatInfoTooltip({ format }) {
|
|
|
96536
96551
|
)
|
|
96537
96552
|
);
|
|
96538
96553
|
}, [open]);
|
|
96539
|
-
|
|
96554
|
+
useEffect152(() => {
|
|
96540
96555
|
if (!open) return;
|
|
96541
96556
|
const onKeyDown = (e) => {
|
|
96542
96557
|
if (e.key === "Escape") setOpen(false);
|
|
@@ -96787,7 +96802,7 @@ var RenderQueue = memo58(function RenderQueue2({
|
|
|
96787
96802
|
onRecheckFfmpeg
|
|
96788
96803
|
}) {
|
|
96789
96804
|
const listRef = useRef183(null);
|
|
96790
|
-
|
|
96805
|
+
useEffect152(() => {
|
|
96791
96806
|
if (listRef.current) {
|
|
96792
96807
|
listRef.current.scrollTo({ top: listRef.current.scrollHeight, behavior: "smooth" });
|
|
96793
96808
|
}
|
|
@@ -96943,7 +96958,7 @@ var RenderQueuePanel = memo59(function RenderQueuePanel2() {
|
|
|
96943
96958
|
});
|
|
96944
96959
|
|
|
96945
96960
|
// src/components/panels/SlideshowPanel.tsx
|
|
96946
|
-
import { useState as useState156, useEffect as
|
|
96961
|
+
import { useState as useState156, useEffect as useEffect153, useCallback as useCallback180, useRef as useRef184 } from "react";
|
|
96947
96962
|
import { parseSlideshowManifest } from "@hyperframes/core/slideshow";
|
|
96948
96963
|
|
|
96949
96964
|
// src/components/panels/SlideshowSubPanels.tsx
|
|
@@ -97639,7 +97654,7 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
|
|
|
97639
97654
|
const { domEditSelection } = useDomEditSelectionContext();
|
|
97640
97655
|
const manifestRef = useRef184(manifest);
|
|
97641
97656
|
const notesCtrlRef = useRef184(makeSlideshowNotesController());
|
|
97642
|
-
|
|
97657
|
+
useEffect153(() => {
|
|
97643
97658
|
if (!compHtml) {
|
|
97644
97659
|
notesCtrlRef.current.flush();
|
|
97645
97660
|
setManifest({ slides: [] });
|
|
@@ -97701,7 +97716,7 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
|
|
|
97701
97716
|
},
|
|
97702
97717
|
[onPersistNotes]
|
|
97703
97718
|
);
|
|
97704
|
-
|
|
97719
|
+
useEffect153(() => {
|
|
97705
97720
|
const ctrl = notesCtrlRef.current;
|
|
97706
97721
|
return () => {
|
|
97707
97722
|
ctrl.flush();
|
|
@@ -97960,7 +97975,7 @@ function SlideshowPanel({ scenes, onPersist, onPersistNotes }) {
|
|
|
97960
97975
|
}
|
|
97961
97976
|
|
|
97962
97977
|
// src/components/panels/VariablesPanel.tsx
|
|
97963
|
-
import { memo as memo60, useCallback as useCallback184, useEffect as
|
|
97978
|
+
import { memo as memo60, useCallback as useCallback184, useEffect as useEffect155, useMemo as useMemo86, useState as useState160 } from "react";
|
|
97964
97979
|
|
|
97965
97980
|
// src/hooks/useVariablesPersist.ts
|
|
97966
97981
|
import { useCallback as useCallback181 } from "react";
|
|
@@ -98011,7 +98026,7 @@ function useVariablesPersist({
|
|
|
98011
98026
|
import { useCallback as useCallback183, useState as useState159 } from "react";
|
|
98012
98027
|
|
|
98013
98028
|
// src/hooks/useProjectCompositionVariables.ts
|
|
98014
|
-
import { useCallback as useCallback182, useEffect as
|
|
98029
|
+
import { useCallback as useCallback182, useEffect as useEffect154, useState as useState157 } from "react";
|
|
98015
98030
|
import { openComposition as openComposition4 } from "@hyperframes/sdk";
|
|
98016
98031
|
async function readGroup(path, readProjectFile) {
|
|
98017
98032
|
let content;
|
|
@@ -98035,7 +98050,7 @@ async function readGroup(path, readProjectFile) {
|
|
|
98035
98050
|
}
|
|
98036
98051
|
function useProjectCompositionVariables(compositionPaths, excludePath, readProjectFile, refreshKey) {
|
|
98037
98052
|
const [groups, setGroups] = useState157([]);
|
|
98038
|
-
|
|
98053
|
+
useEffect154(() => {
|
|
98039
98054
|
let cancelled = false;
|
|
98040
98055
|
const htmlFiles = compositionPaths.filter((p) => p !== excludePath);
|
|
98041
98056
|
void (async () => {
|
|
@@ -98658,7 +98673,7 @@ var VariablesPanel = memo60(function VariablesPanel2({
|
|
|
98658
98673
|
const previewValues = usePreviewVariablesStore((s) => s.values);
|
|
98659
98674
|
const setPreviewValues = usePreviewVariablesStore((s) => s.setValues);
|
|
98660
98675
|
const [revision, setRevision] = useState160(0);
|
|
98661
|
-
|
|
98676
|
+
useEffect155(() => {
|
|
98662
98677
|
if (!sdkSession) return;
|
|
98663
98678
|
return sdkSession.on("change", () => setRevision((r) => r + 1));
|
|
98664
98679
|
}, [sdkSession]);
|
|
@@ -98913,7 +98928,7 @@ var VariablesPanel = memo60(function VariablesPanel2({
|
|
|
98913
98928
|
});
|
|
98914
98929
|
|
|
98915
98930
|
// src/components/panels/MotionBlurPanel.tsx
|
|
98916
|
-
import { memo as memo61, useCallback as useCallback185, useEffect as
|
|
98931
|
+
import { memo as memo61, useCallback as useCallback185, useEffect as useEffect156, useMemo as useMemo87, useReducer as useReducer2, useRef as useRef185, useState as useState161 } from "react";
|
|
98917
98932
|
|
|
98918
98933
|
// src/components/panels/motionBlurPanelModel.ts
|
|
98919
98934
|
import {
|
|
@@ -98983,7 +98998,7 @@ var NothingToChange = class extends Error {
|
|
|
98983
98998
|
function useLivePreviewAttributes(previewIframeRef, refreshKey) {
|
|
98984
98999
|
const [live, setLive] = useState161(null);
|
|
98985
99000
|
const holdUntil = useRef185(0);
|
|
98986
|
-
|
|
99001
|
+
useEffect156(() => {
|
|
98987
99002
|
const read2 = () => {
|
|
98988
99003
|
const found = readPreviewRootAttributes(previewIframeRef.current);
|
|
98989
99004
|
if (found && Date.now() >= holdUntil.current) {
|
|
@@ -99011,7 +99026,7 @@ var MotionBlurPanel = memo61(function MotionBlurPanel2({
|
|
|
99011
99026
|
const { readProjectFile, writeProjectFile, compositions } = useFileManagerContext();
|
|
99012
99027
|
const [, rerender] = useReducer2((n) => n + 1, 0);
|
|
99013
99028
|
const [live, hold] = useLivePreviewAttributes(previewIframeRef, refreshKey);
|
|
99014
|
-
|
|
99029
|
+
useEffect156(() => sdkSession?.on("change", rerender), [sdkSession]);
|
|
99015
99030
|
const root = sdkSession ? findCompositionRoot(sdkSession.getRootElements()) : null;
|
|
99016
99031
|
const attributes = live ?? root?.attributes ?? null;
|
|
99017
99032
|
const settings = useMemo87(() => attributes ? settingsOf(attributes) : null, [attributes]);
|
|
@@ -99239,7 +99254,7 @@ function DesignPanelPromoteProvider({
|
|
|
99239
99254
|
}
|
|
99240
99255
|
|
|
99241
99256
|
// src/hooks/useRemoveBackground.ts
|
|
99242
|
-
import { useCallback as useCallback188, useEffect as
|
|
99257
|
+
import { useCallback as useCallback188, useEffect as useEffect157, useRef as useRef186 } from "react";
|
|
99243
99258
|
|
|
99244
99259
|
// src/components/studioMediaJobs.ts
|
|
99245
99260
|
var MEDIA_JOB_RECONNECT_TIMEOUT_MS = 15e3;
|
|
@@ -99346,7 +99361,7 @@ function waitForMediaJob(jobId, onProgress, signal) {
|
|
|
99346
99361
|
// src/hooks/useRemoveBackground.ts
|
|
99347
99362
|
function useRemoveBackground(projectId, refreshFileTree, showToast) {
|
|
99348
99363
|
const abortRef = useRef186(null);
|
|
99349
|
-
|
|
99364
|
+
useEffect157(
|
|
99350
99365
|
() => () => {
|
|
99351
99366
|
abortRef.current?.abort();
|
|
99352
99367
|
},
|
|
@@ -99812,7 +99827,7 @@ function useStudioSidePanels(left, right, projectId) {
|
|
|
99812
99827
|
}
|
|
99813
99828
|
|
|
99814
99829
|
// src/components/TimelineToolbar.tsx
|
|
99815
|
-
import { memo as memo63, useEffect as
|
|
99830
|
+
import { memo as memo63, useEffect as useEffect159, useRef as useRef187 } from "react";
|
|
99816
99831
|
import {
|
|
99817
99832
|
ArrowsOutLineHorizontal,
|
|
99818
99833
|
FrameCorners as FrameCorners2,
|
|
@@ -99823,7 +99838,7 @@ import {
|
|
|
99823
99838
|
} from "@phosphor-icons/react";
|
|
99824
99839
|
|
|
99825
99840
|
// src/hooks/useKeyframeKeyboard.ts
|
|
99826
|
-
import { useEffect as
|
|
99841
|
+
import { useEffect as useEffect158, useCallback as useCallback191 } from "react";
|
|
99827
99842
|
function useKeyframeKeyboard({ enabled, onAddKeyframe }) {
|
|
99828
99843
|
const handler = useCallback191(
|
|
99829
99844
|
(e) => {
|
|
@@ -99837,7 +99852,7 @@ function useKeyframeKeyboard({ enabled, onAddKeyframe }) {
|
|
|
99837
99852
|
},
|
|
99838
99853
|
[enabled, onAddKeyframe]
|
|
99839
99854
|
);
|
|
99840
|
-
|
|
99855
|
+
useEffect158(() => {
|
|
99841
99856
|
if (!enabled) return;
|
|
99842
99857
|
window.addEventListener("keydown", handler, { capture: true });
|
|
99843
99858
|
return () => window.removeEventListener("keydown", handler, { capture: true });
|
|
@@ -100189,10 +100204,10 @@ var TimelineToolbar = memo63(function TimelineToolbar2({
|
|
|
100189
100204
|
enabled: showKeyframes && Boolean(onToggleKeyframe),
|
|
100190
100205
|
onAddKeyframe: onToggleKeyframe
|
|
100191
100206
|
});
|
|
100192
|
-
|
|
100207
|
+
useEffect159(() => {
|
|
100193
100208
|
if (!showKeyframes) setAutoKeyframeEnabled(false);
|
|
100194
100209
|
}, [showKeyframes, setAutoKeyframeEnabled]);
|
|
100195
|
-
|
|
100210
|
+
useEffect159(() => {
|
|
100196
100211
|
const onKeyDown = (e) => {
|
|
100197
100212
|
if (e.key !== "n" && e.key !== "N") return;
|
|
100198
100213
|
if (e.metaKey || e.ctrlKey || e.altKey) return;
|
|
@@ -100490,7 +100505,7 @@ function StudioSplash({ waiting }) {
|
|
|
100490
100505
|
}
|
|
100491
100506
|
|
|
100492
100507
|
// src/hooks/useServerConnection.ts
|
|
100493
|
-
import { useEffect as
|
|
100508
|
+
import { useEffect as useEffect160, useState as useState163 } from "react";
|
|
100494
100509
|
async function resolveHashProject(id) {
|
|
100495
100510
|
try {
|
|
100496
100511
|
const res = await studioApiFetch(`/api/projects/${encodeURIComponent(id)}`);
|
|
@@ -100564,7 +100579,7 @@ function useServerConnection() {
|
|
|
100564
100579
|
if (retryTimer !== null) clearTimeout(retryTimer);
|
|
100565
100580
|
};
|
|
100566
100581
|
});
|
|
100567
|
-
|
|
100582
|
+
useEffect160(() => {
|
|
100568
100583
|
const onHashChange = () => {
|
|
100569
100584
|
const next = parseProjectIdFromHash(window.location.hash);
|
|
100570
100585
|
if (!next || next === projectId) return;
|
|
@@ -100590,9 +100605,9 @@ function useServerConnection() {
|
|
|
100590
100605
|
}
|
|
100591
100606
|
|
|
100592
100607
|
// src/hooks/useStudioSessionStart.ts
|
|
100593
|
-
import { useEffect as
|
|
100608
|
+
import { useEffect as useEffect161 } from "react";
|
|
100594
100609
|
function useStudioSessionStart(projectId, resolving, waitingForServer) {
|
|
100595
|
-
|
|
100610
|
+
useEffect161(() => {
|
|
100596
100611
|
if (resolving || waitingForServer || hasFiredSessionStart()) return;
|
|
100597
100612
|
markSessionStartFired();
|
|
100598
100613
|
trackStudioSessionStart({ has_project: projectId != null });
|
|
@@ -100619,7 +100634,7 @@ function useTimelineAddAtPlayhead(addAsset, addComposition, projectId) {
|
|
|
100619
100634
|
import { useState as useState164 } from "react";
|
|
100620
100635
|
|
|
100621
100636
|
// src/hooks/useHydrateActiveCompPathFromUrl.ts
|
|
100622
|
-
import { useEffect as
|
|
100637
|
+
import { useEffect as useEffect162 } from "react";
|
|
100623
100638
|
function useHydrateActiveCompPathFromUrl({
|
|
100624
100639
|
hydrated,
|
|
100625
100640
|
fileTreeLoaded,
|
|
@@ -100628,7 +100643,7 @@ function useHydrateActiveCompPathFromUrl({
|
|
|
100628
100643
|
setActiveCompPath,
|
|
100629
100644
|
setHydrated
|
|
100630
100645
|
}) {
|
|
100631
|
-
|
|
100646
|
+
useEffect162(() => {
|
|
100632
100647
|
if (hydrated) return;
|
|
100633
100648
|
if (!fileTreeLoaded) return;
|
|
100634
100649
|
const nextCompPath = normalizeStudioCompositionPath(
|
|
@@ -100641,7 +100656,7 @@ function useHydrateActiveCompPathFromUrl({
|
|
|
100641
100656
|
}
|
|
100642
100657
|
|
|
100643
100658
|
// src/hooks/useAutoOpenRootComposition.ts
|
|
100644
|
-
import { useEffect as
|
|
100659
|
+
import { useEffect as useEffect163, useRef as useRef188 } from "react";
|
|
100645
100660
|
function useAutoOpenRootComposition({
|
|
100646
100661
|
projectId,
|
|
100647
100662
|
activeCompPath,
|
|
@@ -100650,7 +100665,7 @@ function useAutoOpenRootComposition({
|
|
|
100650
100665
|
onSelectComposition
|
|
100651
100666
|
}) {
|
|
100652
100667
|
const settledForProjectRef = useRef188(void 0);
|
|
100653
|
-
|
|
100668
|
+
useEffect163(() => {
|
|
100654
100669
|
if (settledForProjectRef.current === projectId) return;
|
|
100655
100670
|
if (!activeCompPathHydrated) return;
|
|
100656
100671
|
if (activeCompPath !== null) {
|