@hyperframes/studio 0.9.21 → 0.9.23
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/codec-DYZ1sJnW.js +314 -0
- package/dist/assets/{hyperframes-player-DqxUNa9H.js → hyperframes-player-BOxJo7Nx.js} +1 -1
- package/dist/assets/{index-Cq43Ovkf.js → index-Ccf4_r8m.js} +120 -119
- package/dist/assets/index-DKEq8iSv.js +150 -0
- package/dist/assets/{index-Bgfyny02.css → index-dsfjBidg.css} +1 -1
- package/dist/assets/pausedVideoDecoder-B65VVvs_.js +1 -0
- package/dist/{chunk-3EAFE522.js → chunk-45KKBU63.js} +1 -1
- package/dist/chunk-4SPHDECE.js +165 -0
- package/dist/{chunk-OGIOFEC7.js → chunk-63DH4LRB.js} +13 -2
- package/dist/{chunk-7HZGKFFU.js → chunk-J3VJE463.js} +1 -1
- package/dist/{chunk-NUS5R2HO.js → chunk-LRTUWOR4.js} +12 -2
- package/dist/{domEditingLayers-7Z6J4UOK.js → domEditingLayers-7Q56QAU5.js} +2 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.html +2 -2
- package/dist/index.js +105 -196
- package/dist/pausedVideoDecoder-W2SVMXDS.js +404 -0
- package/dist/player.js +3 -3
- package/dist/styles.css +1 -1
- package/dist/ui.js +1 -1
- package/package.json +9 -9
- package/src/components/editor/domEditingDom.preview.test.ts +75 -0
- package/src/components/editor/domEditingDom.ts +19 -2
- package/src/components/nle/NLEContext.tsx +4 -1
- package/src/components/ui/Menu.test.tsx +8 -0
- package/src/components/ui/Menu.tsx +1 -1
- package/src/hooks/useElementPicker.test.ts +13 -0
- package/src/hooks/useElementPicker.ts +3 -2
- package/src/player/components/PlayerControls.test.tsx +1 -1
- package/src/player/components/PlayerControls.tsx +1 -1
- package/src/player/components/PreviewSeekBar.test.tsx +42 -0
- package/src/player/components/PreviewSeekBar.tsx +20 -3
- package/src/player/hooks/usePlaybackKeyboard.test.ts +1 -1
- package/src/player/hooks/usePlaybackKeyboard.ts +2 -1
- package/src/player/hooks/useTimelinePlayer.ts +3 -1
- package/src/player/lib/mediaFetch.test.ts +3 -4
- package/src/player/lib/pausedVideoDecoder.test.ts +717 -0
- package/src/player/lib/pausedVideoDecoder.ts +439 -0
- package/src/player/lib/pausedVideoProvider.test.ts +53 -0
- package/src/player/lib/pausedVideoProvider.ts +54 -0
- package/src/player/lib/playbackTypes.ts +8 -2
- package/src/player/lib/previewVideoTime.test.ts +38 -0
- package/src/player/lib/previewVideoTime.ts +39 -0
- package/src/player/store/previewQualitySlice.test.ts +27 -0
- package/src/player/store/previewQualitySlice.ts +12 -0
- package/src/utils/authoredSource.test.ts +11 -0
- package/src/utils/authoredSource.ts +2 -0
- package/dist/assets/index-CFUJyYA1.js +0 -531
package/dist/index.js
CHANGED
|
@@ -74,7 +74,7 @@ import {
|
|
|
74
74
|
whileScriptWrites,
|
|
75
75
|
writeStudioUiPreferences,
|
|
76
76
|
zoomToSelectedClips
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-LRTUWOR4.js";
|
|
78
78
|
import {
|
|
79
79
|
Button,
|
|
80
80
|
ContextMenu,
|
|
@@ -106,7 +106,7 @@ import {
|
|
|
106
106
|
fieldBase,
|
|
107
107
|
fieldText,
|
|
108
108
|
popupSurface
|
|
109
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-J3VJE463.js";
|
|
110
110
|
import {
|
|
111
111
|
DOM_EDIT_LAYER_OBSERVER_INIT,
|
|
112
112
|
buildDefaultDomEditTextField,
|
|
@@ -132,7 +132,7 @@ import {
|
|
|
132
132
|
resolveAllVisualDomEditTargets,
|
|
133
133
|
resolveDomEditSelection,
|
|
134
134
|
serializeDomEditTextFields
|
|
135
|
-
} from "./chunk-
|
|
135
|
+
} from "./chunk-45KKBU63.js";
|
|
136
136
|
import {
|
|
137
137
|
LAYER_REVEAL_PRIOR_POSITION_ATTR,
|
|
138
138
|
LAYER_REVEAL_PRIOR_Z_ATTR,
|
|
@@ -156,6 +156,7 @@ import {
|
|
|
156
156
|
furthestClipEndFromDocument,
|
|
157
157
|
getAdapterDuration,
|
|
158
158
|
getDefaultStaticSeekPlaybackClock,
|
|
159
|
+
getLogicalOpacity,
|
|
159
160
|
getSelectorIndex,
|
|
160
161
|
getSourceFileForElement,
|
|
161
162
|
getTimelineElementDisplayLabel,
|
|
@@ -200,7 +201,12 @@ import {
|
|
|
200
201
|
toHexColor,
|
|
201
202
|
withSelectorIndexPass,
|
|
202
203
|
wrapTimeline
|
|
203
|
-
} from "./chunk-
|
|
204
|
+
} from "./chunk-63DH4LRB.js";
|
|
205
|
+
import {
|
|
206
|
+
MediaFetchError,
|
|
207
|
+
mediaUrlSourceOptions,
|
|
208
|
+
reportMediaFetchFailure
|
|
209
|
+
} from "./chunk-4SPHDECE.js";
|
|
204
210
|
import "./chunk-MLKGABMK.js";
|
|
205
211
|
|
|
206
212
|
// src/components/EditorShell.tsx
|
|
@@ -1345,6 +1351,12 @@ var PreviewSeekBar = memo4(function PreviewSeekBar2({
|
|
|
1345
1351
|
onSeek
|
|
1346
1352
|
}) {
|
|
1347
1353
|
const inputRef = useRef3(null);
|
|
1354
|
+
const settledRef = useRef3(true);
|
|
1355
|
+
const finishPointerSeek = (event) => {
|
|
1356
|
+
if (settledRef.current) return;
|
|
1357
|
+
settledRef.current = true;
|
|
1358
|
+
onSeek(event.currentTarget.valueAsNumber, { settled: true });
|
|
1359
|
+
};
|
|
1348
1360
|
useEffect2(() => {
|
|
1349
1361
|
const input = inputRef.current;
|
|
1350
1362
|
if (!input) return;
|
|
@@ -1370,7 +1382,15 @@ var PreviewSeekBar = memo4(function PreviewSeekBar2({
|
|
|
1370
1382
|
defaultValue: 0,
|
|
1371
1383
|
disabled: disabled || duration <= 0,
|
|
1372
1384
|
"aria-label": "Seek preview",
|
|
1373
|
-
|
|
1385
|
+
onPointerDown: () => {
|
|
1386
|
+
settledRef.current = false;
|
|
1387
|
+
},
|
|
1388
|
+
onPointerUp: finishPointerSeek,
|
|
1389
|
+
onPointerCancel: finishPointerSeek,
|
|
1390
|
+
onKeyDown: () => {
|
|
1391
|
+
settledRef.current = true;
|
|
1392
|
+
},
|
|
1393
|
+
onChange: (event) => onSeek(event.currentTarget.valueAsNumber, { settled: settledRef.current }),
|
|
1374
1394
|
className: "h-6 w-full cursor-pointer accent-neutral-300 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent-ink disabled:cursor-default disabled:opacity-30"
|
|
1375
1395
|
}
|
|
1376
1396
|
) });
|
|
@@ -3528,13 +3548,13 @@ function resolveBlockedTimelineEditIntent(input) {
|
|
|
3528
3548
|
return "move";
|
|
3529
3549
|
}
|
|
3530
3550
|
function buildTimelineAgentPrompt({
|
|
3531
|
-
rangeStart
|
|
3551
|
+
rangeStart,
|
|
3532
3552
|
rangeEnd,
|
|
3533
3553
|
elements,
|
|
3534
3554
|
prompt
|
|
3535
3555
|
}) {
|
|
3536
|
-
const start = Math.min(
|
|
3537
|
-
const end = Math.max(
|
|
3556
|
+
const start = Math.min(rangeStart, rangeEnd);
|
|
3557
|
+
const end = Math.max(rangeStart, rangeEnd);
|
|
3538
3558
|
const elementLines = elements.map(
|
|
3539
3559
|
(el) => `- #${el.id} (${el.tag}) - ${formatTime(el.start)} to ${formatTime(el.start + el.duration)}, track ${el.track}`
|
|
3540
3560
|
).join("\n");
|
|
@@ -17483,6 +17503,7 @@ import { GSAP_BASE_URL_META, motionPathPluginUrl } from "@hyperframes/core/gsap-
|
|
|
17483
17503
|
import { ensureHfIds, isCompositionTemplate } from "@hyperframes/parsers/hf-ids";
|
|
17484
17504
|
import {
|
|
17485
17505
|
PREVIEW_ONLY_ATTRS,
|
|
17506
|
+
PREVIEW_VIDEO_CANVAS_ATTR,
|
|
17486
17507
|
STUDIO_PREVIEW_LAZY_ATTR
|
|
17487
17508
|
} from "@hyperframes/core/studio-preview-mark";
|
|
17488
17509
|
function parseSavedSource(html2) {
|
|
@@ -17563,6 +17584,7 @@ function authoredMarkup(authored, live, sourceFile) {
|
|
|
17563
17584
|
}
|
|
17564
17585
|
function liveMarkupWithoutPreviewMarks(live) {
|
|
17565
17586
|
const copy = live.cloneNode(true);
|
|
17587
|
+
for (const canvas of copy.querySelectorAll(`[${PREVIEW_VIDEO_CANVAS_ATTR}]`)) canvas.remove();
|
|
17566
17588
|
for (const el of [copy, ...Array.from(copy.querySelectorAll("*"))]) {
|
|
17567
17589
|
if (el.hasAttribute(STUDIO_PREVIEW_LAZY_ATTR)) el.removeAttribute("loading");
|
|
17568
17590
|
for (const attr of PREVIEW_ONLY_ATTRS) el.removeAttribute(attr);
|
|
@@ -25699,10 +25721,10 @@ function writeDraft(key2, value) {
|
|
|
25699
25721
|
} catch {
|
|
25700
25722
|
}
|
|
25701
25723
|
}
|
|
25702
|
-
function EditPopover({ rangeStart
|
|
25724
|
+
function EditPopover({ rangeStart, rangeEnd, anchorX, anchorY, onClose }) {
|
|
25703
25725
|
const elements = usePlayerStore((s) => s.elements);
|
|
25704
|
-
const start = Math.min(
|
|
25705
|
-
const end = Math.max(
|
|
25726
|
+
const start = Math.min(rangeStart, rangeEnd);
|
|
25727
|
+
const end = Math.max(rangeStart, rangeEnd);
|
|
25706
25728
|
const storageKey = draftKey(start, end);
|
|
25707
25729
|
const [prompt, setPromptState] = useState30(() => readDraft(storageKey));
|
|
25708
25730
|
const setPrompt = (value) => {
|
|
@@ -27937,166 +27959,6 @@ function bindThumbnailPlaybackHold(store, scheduler) {
|
|
|
27937
27959
|
return store.subscribe((state) => scheduler.setPlaybackActive(state.isPlaying));
|
|
27938
27960
|
}
|
|
27939
27961
|
|
|
27940
|
-
// src/player/lib/mediaFetch.ts
|
|
27941
|
-
var describe = (reader, status, code, retries) => `${reader} range fetch failed: ${status === null ? `network ${code}` : `HTTP ${status}`} after ${retries} retries`;
|
|
27942
|
-
var MediaFetchError = class extends Error {
|
|
27943
|
-
constructor(reader, status, code, start = null) {
|
|
27944
|
-
super(describe(reader, status, code, 0));
|
|
27945
|
-
this.reader = reader;
|
|
27946
|
-
this.status = status;
|
|
27947
|
-
this.code = code;
|
|
27948
|
-
this.start = start;
|
|
27949
|
-
}
|
|
27950
|
-
reader;
|
|
27951
|
-
status;
|
|
27952
|
-
code;
|
|
27953
|
-
start;
|
|
27954
|
-
name = "MediaFetchError";
|
|
27955
|
-
retries = 0;
|
|
27956
|
-
setRetries(retries) {
|
|
27957
|
-
this.retries = retries;
|
|
27958
|
-
this.message = describe(this.reader, this.status, this.code, retries);
|
|
27959
|
-
}
|
|
27960
|
-
};
|
|
27961
|
-
var MAX_RETRIES = 2;
|
|
27962
|
-
var SILENT_BODY_STALL_MS = 8e3;
|
|
27963
|
-
var THUMBNAIL_RANGE_BYTES = 512 * 1024;
|
|
27964
|
-
var POOLED_READER_CACHE_BYTES = 16 * 1024 * 1024;
|
|
27965
|
-
var rangeStart = (init, closed) => (closed ? /^bytes=(\d+)-\d*$/ : /^bytes=(\d+)-$/).exec(
|
|
27966
|
-
new Headers(init?.headers).get("Range") ?? ""
|
|
27967
|
-
)?.[1];
|
|
27968
|
-
function boundedRange(init) {
|
|
27969
|
-
const start = rangeStart(init, false);
|
|
27970
|
-
if (start === void 0) return init;
|
|
27971
|
-
const headers = new Headers(init?.headers);
|
|
27972
|
-
headers.set("Range", `bytes=${start}-${Number(start) + THUMBNAIL_RANGE_BYTES - 1}`);
|
|
27973
|
-
return { ...init, headers };
|
|
27974
|
-
}
|
|
27975
|
-
function rangesReadable(init, response) {
|
|
27976
|
-
const asked = rangeStart(init, true);
|
|
27977
|
-
const shown3 = /^bytes (\d+)-\d+\/\d+$/.exec(response.headers.get("Content-Range") ?? "")?.[1];
|
|
27978
|
-
return response.status === 206 && asked !== void 0 && shown3 === asked;
|
|
27979
|
-
}
|
|
27980
|
-
var isAbort = (error) => error?.name === "AbortError";
|
|
27981
|
-
function networkCode(error) {
|
|
27982
|
-
const cause = error?.cause;
|
|
27983
|
-
if (typeof cause?.code === "string") return cause.code;
|
|
27984
|
-
const name = error?.name;
|
|
27985
|
-
return typeof name === "string" ? name : "unknown";
|
|
27986
|
-
}
|
|
27987
|
-
var typedFailure = (reader, error, start) => isAbort(error) ? error : new MediaFetchError(reader, null, networkCode(error), start);
|
|
27988
|
-
function watchedRequest(reader, parents, end) {
|
|
27989
|
-
const controller = new AbortController();
|
|
27990
|
-
let stalled = false;
|
|
27991
|
-
let timer;
|
|
27992
|
-
const unlinks = parents.map((parent) => {
|
|
27993
|
-
const follow = () => controller.abort(parent.reason);
|
|
27994
|
-
parent.addEventListener("abort", follow, { once: true });
|
|
27995
|
-
return () => parent.removeEventListener("abort", follow);
|
|
27996
|
-
});
|
|
27997
|
-
const done = () => {
|
|
27998
|
-
clearTimeout(timer);
|
|
27999
|
-
for (const unlink of unlinks.splice(0)) unlink();
|
|
28000
|
-
};
|
|
28001
|
-
controller.signal.addEventListener("abort", done, { once: true });
|
|
28002
|
-
for (const parent of parents) if (parent.aborted) controller.abort(parent.reason);
|
|
28003
|
-
const wait = (pending2) => {
|
|
28004
|
-
if (reader !== "thumbnail") return pending2;
|
|
28005
|
-
return new Promise((resolve2, reject) => {
|
|
28006
|
-
timer = setTimeout(() => {
|
|
28007
|
-
stalled = true;
|
|
28008
|
-
const reason = new DOMException(`No bytes for ${SILENT_BODY_STALL_MS} ms`, "TimeoutError");
|
|
28009
|
-
reject(reason);
|
|
28010
|
-
controller.abort(reason);
|
|
28011
|
-
}, SILENT_BODY_STALL_MS);
|
|
28012
|
-
void pending2.then(resolve2, reject).finally(() => clearTimeout(timer));
|
|
28013
|
-
});
|
|
28014
|
-
};
|
|
28015
|
-
const failure = (error, start) => stalled ? new MediaFetchError(reader, null, "stalled", start) : typedFailure(reader, error, start);
|
|
28016
|
-
return { signal: controller.signal, wait, done, failure, end };
|
|
28017
|
-
}
|
|
28018
|
-
function typedBody(body, start, request2) {
|
|
28019
|
-
const source = body.getReader();
|
|
28020
|
-
const stopped = () => request2.end?.atTarget?.aborted && request2.end.ended(start);
|
|
28021
|
-
request2.signal.addEventListener("abort", stopped, { once: true });
|
|
28022
|
-
return new ReadableStream({
|
|
28023
|
-
async pull(controller) {
|
|
28024
|
-
try {
|
|
28025
|
-
const { done, value } = await request2.wait(source.read());
|
|
28026
|
-
if (!done) return controller.enqueue(value);
|
|
28027
|
-
request2.done();
|
|
28028
|
-
request2.end?.ended(start);
|
|
28029
|
-
controller.close();
|
|
28030
|
-
} catch (error) {
|
|
28031
|
-
request2.done();
|
|
28032
|
-
controller.error(request2.failure(error, start));
|
|
28033
|
-
}
|
|
28034
|
-
},
|
|
28035
|
-
cancel: (reason) => {
|
|
28036
|
-
request2.done();
|
|
28037
|
-
return source.cancel(reason);
|
|
28038
|
-
}
|
|
28039
|
-
});
|
|
28040
|
-
}
|
|
28041
|
-
async function typedFetch(reader, input, sent, asked, request2) {
|
|
28042
|
-
let response;
|
|
28043
|
-
try {
|
|
28044
|
-
response = await fetch(input, { ...sent, signal: request2.signal });
|
|
28045
|
-
} catch (error) {
|
|
28046
|
-
request2.done();
|
|
28047
|
-
throw request2.failure(error, asked);
|
|
28048
|
-
}
|
|
28049
|
-
if (response.ok) return response;
|
|
28050
|
-
request2.done();
|
|
28051
|
-
throw new MediaFetchError(reader, response.status, null, asked);
|
|
28052
|
-
}
|
|
28053
|
-
function typedResponse(response, asked, request2) {
|
|
28054
|
-
if (!response.body) {
|
|
28055
|
-
request2.done();
|
|
28056
|
-
return response;
|
|
28057
|
-
}
|
|
28058
|
-
const { status, statusText, headers } = response;
|
|
28059
|
-
const body = typedBody(response.body, status === 206 ? asked : 0, request2);
|
|
28060
|
-
return new Response(body, { status, statusText, headers });
|
|
28061
|
-
}
|
|
28062
|
-
function mediaUrlSourceOptions(reader) {
|
|
28063
|
-
const failuresByStart = /* @__PURE__ */ new Map();
|
|
28064
|
-
const inFlightReads = new AbortController();
|
|
28065
|
-
let ranges = reader === "thumbnail" ? "unknown" : "hidden";
|
|
28066
|
-
let etag;
|
|
28067
|
-
const noteEtag = (response) => void (etag ??= response.headers.get("ETag") ?? void 0);
|
|
28068
|
-
const fetchFn = async (input, init) => {
|
|
28069
|
-
const sent = ranges === "readable" ? boundedRange(init) : init;
|
|
28070
|
-
const asked = Number(rangeStart(sent, true) ?? 0);
|
|
28071
|
-
const request2 = watchedRequest(
|
|
28072
|
-
reader,
|
|
28073
|
-
init?.signal ? [inFlightReads.signal, init.signal] : [inFlightReads.signal],
|
|
28074
|
-
{ ended: (start) => failuresByStart.delete(start), atTarget: init?.signal }
|
|
28075
|
-
);
|
|
28076
|
-
const response = await typedFetch(reader, input, sent ?? {}, asked, request2);
|
|
28077
|
-
if (ranges !== "hidden") ranges = rangesReadable(sent, response) ? "readable" : "hidden";
|
|
28078
|
-
noteEtag(response);
|
|
28079
|
-
return typedResponse(response, asked, request2);
|
|
28080
|
-
};
|
|
28081
|
-
const getRetryDelay = (_previousAttempts, error) => {
|
|
28082
|
-
const start = error instanceof MediaFetchError ? error.start : null;
|
|
28083
|
-
const failed2 = failuresByStart.get(start) ?? 0;
|
|
28084
|
-
const clientError = error instanceof MediaFetchError && error.status !== null && error.status < 500;
|
|
28085
|
-
if (error instanceof MediaFetchError) error.setRetries(failed2);
|
|
28086
|
-
if (clientError || failed2 >= MAX_RETRIES) return null;
|
|
28087
|
-
failuresByStart.set(start, failed2 + 1);
|
|
28088
|
-
return 0.5 * (failed2 + 1);
|
|
28089
|
-
};
|
|
28090
|
-
const cancelReads = () => inFlightReads.abort(new DOMException("Media reads cancelled", "AbortError"));
|
|
28091
|
-
const etagOf = () => etag;
|
|
28092
|
-
if (reader === "probe") return { fetchFn, getRetryDelay, cancelReads, etagOf };
|
|
28093
|
-
return { fetchFn, getRetryDelay, cancelReads, etagOf, maxCacheSize: POOLED_READER_CACHE_BYTES };
|
|
28094
|
-
}
|
|
28095
|
-
function reportMediaFetchFailure(error) {
|
|
28096
|
-
if (!(error instanceof MediaFetchError)) return;
|
|
28097
|
-
console.warn(`[Studio] ${error.message}`);
|
|
28098
|
-
}
|
|
28099
|
-
|
|
28100
27962
|
// src/player/lib/thumbnailSourcePool.ts
|
|
28101
27963
|
var pool = /* @__PURE__ */ new Map();
|
|
28102
27964
|
var mediabunnyModule = null;
|
|
@@ -29452,7 +29314,8 @@ function usePlaybackKeyboard({
|
|
|
29452
29314
|
const adapter = getAdapter();
|
|
29453
29315
|
const currentTime = adapter?.getTime() ?? usePlayerStore.getState().currentTime;
|
|
29454
29316
|
seek(
|
|
29455
|
-
stepFrameTime(currentTime, deltaFrames, useLinkedClipPreferences.getState().compositionFps)
|
|
29317
|
+
stepFrameTime(currentTime, deltaFrames, useLinkedClipPreferences.getState().compositionFps),
|
|
29318
|
+
{ settled: true }
|
|
29456
29319
|
);
|
|
29457
29320
|
},
|
|
29458
29321
|
[getAdapter, seek]
|
|
@@ -32408,6 +32271,51 @@ function useTimelinePlayerLoop({
|
|
|
32408
32271
|
return { startRAFLoop, stopRAFLoop, stopReverseLoop };
|
|
32409
32272
|
}
|
|
32410
32273
|
|
|
32274
|
+
// src/player/lib/pausedVideoProvider.ts
|
|
32275
|
+
var installed = /* @__PURE__ */ new WeakMap();
|
|
32276
|
+
function attachPausedVideoProvider(iframe, win) {
|
|
32277
|
+
if (!win.__hf?.setPausedVideoFrameProvider || !iframe.contentDocument) return;
|
|
32278
|
+
const previous = installed.get(iframe);
|
|
32279
|
+
const setter = win.__hf.setPausedVideoFrameProvider;
|
|
32280
|
+
if (previous?.document === iframe.contentDocument && previous.setter === setter) return;
|
|
32281
|
+
previous?.provider.dispose();
|
|
32282
|
+
let disposed = false;
|
|
32283
|
+
let decoder = null;
|
|
32284
|
+
const provider = {
|
|
32285
|
+
async decode(requests, signal) {
|
|
32286
|
+
signal.throwIfAborted();
|
|
32287
|
+
if (disposed) throw new DOMException("Preview disposed", "AbortError");
|
|
32288
|
+
decoder ??= import("./pausedVideoDecoder-W2SVMXDS.js").then(
|
|
32289
|
+
({ createPausedVideoDecoder }) => createPausedVideoDecoder(iframe)
|
|
32290
|
+
);
|
|
32291
|
+
const actual = await decoder;
|
|
32292
|
+
if (disposed) {
|
|
32293
|
+
actual.dispose();
|
|
32294
|
+
throw new DOMException("Preview disposed", "AbortError");
|
|
32295
|
+
}
|
|
32296
|
+
return actual.decode(requests, signal);
|
|
32297
|
+
},
|
|
32298
|
+
async suspend() {
|
|
32299
|
+
const actual = await decoder?.catch(() => null);
|
|
32300
|
+
await actual?.suspend?.();
|
|
32301
|
+
},
|
|
32302
|
+
dispose() {
|
|
32303
|
+
if (disposed) return;
|
|
32304
|
+
disposed = true;
|
|
32305
|
+
void decoder?.then((actual) => actual.dispose()).catch(() => {
|
|
32306
|
+
});
|
|
32307
|
+
win.removeEventListener("pagehide", onPageHide);
|
|
32308
|
+
}
|
|
32309
|
+
};
|
|
32310
|
+
const onPageHide = () => {
|
|
32311
|
+
provider.dispose();
|
|
32312
|
+
installed.delete(iframe);
|
|
32313
|
+
};
|
|
32314
|
+
win.addEventListener("pagehide", onPageHide, { once: true });
|
|
32315
|
+
installed.set(iframe, { document: iframe.contentDocument, provider, setter });
|
|
32316
|
+
setter(provider);
|
|
32317
|
+
}
|
|
32318
|
+
|
|
32411
32319
|
// src/player/lib/playbackScrub.ts
|
|
32412
32320
|
function scrubMusicAtSeek(iframe, nextTime) {
|
|
32413
32321
|
const s = usePlayerStore.getState();
|
|
@@ -32897,6 +32805,7 @@ function useTimelinePlayer({
|
|
|
32897
32805
|
const iframe = overrideIframe !== void 0 ? overrideIframe : iframeRef.current;
|
|
32898
32806
|
const win = iframe?.contentWindow;
|
|
32899
32807
|
if (!iframe || !win) return null;
|
|
32808
|
+
attachPausedVideoProvider(iframe, win);
|
|
32900
32809
|
const adapter = resolvePlaybackAdapter(iframe, win, {
|
|
32901
32810
|
cache: staticSeekAdapterRef,
|
|
32902
32811
|
warned: staticSeekWarnedRef
|
|
@@ -35761,8 +35670,8 @@ function subtitleOf(p) {
|
|
|
35761
35670
|
function DownloadStep({ progress, onDownload }) {
|
|
35762
35671
|
const { context, downloadUrl } = progress.route;
|
|
35763
35672
|
const where = platformName(context.os);
|
|
35764
|
-
const
|
|
35765
|
-
if (!progress.downloaded && !
|
|
35673
|
+
const installed2 = isInstalled(progress);
|
|
35674
|
+
if (!progress.downloaded && !installed2)
|
|
35766
35675
|
return /* @__PURE__ */ jsxs62(Step, { n: 1, state: NOW, title: `Download HyperFrames for ${where}`, children: [
|
|
35767
35676
|
/* @__PURE__ */ jsx91("p", { className: NOTE, children: "Free. Opens hyperframes.studio in a new tab." }),
|
|
35768
35677
|
/* @__PURE__ */ jsxs62(
|
|
@@ -35780,8 +35689,8 @@ function DownloadStep({ progress, onDownload }) {
|
|
|
35780
35689
|
)
|
|
35781
35690
|
] });
|
|
35782
35691
|
return /* @__PURE__ */ jsx91(Step, { n: 1, state: DONE, title: `Download HyperFrames for ${where}`, children: /* @__PURE__ */ jsxs62("p", { className: NOTE, children: [
|
|
35783
|
-
|
|
35784
|
-
!
|
|
35692
|
+
installed2 ? `Already on this ${deviceName(context.os)}.` : "Started in your browser.",
|
|
35693
|
+
!installed2 && downloadUrl && /* @__PURE__ */ jsx91(
|
|
35785
35694
|
"button",
|
|
35786
35695
|
{
|
|
35787
35696
|
type: "button",
|
|
@@ -35817,13 +35726,13 @@ function OpenStep({ progress, projectDir, onOpen }) {
|
|
|
35817
35726
|
folder,
|
|
35818
35727
|
/* @__PURE__ */ jsx91(Button, { variant: "primary", className: "mt-2", loading: progress.opening, onClick: onOpen, children: "Try again" })
|
|
35819
35728
|
] });
|
|
35820
|
-
const
|
|
35821
|
-
if (
|
|
35729
|
+
const installed2 = isInstalled(progress);
|
|
35730
|
+
if (installed2 && !progress.route.handoff)
|
|
35822
35731
|
return /* @__PURE__ */ jsxs62(Step, { n: 3, state: NOW, title, children: [
|
|
35823
35732
|
/* @__PURE__ */ jsx91("p", { className: NOTE, children: "Open HyperFrames and drop this folder in:" }),
|
|
35824
35733
|
folder
|
|
35825
35734
|
] });
|
|
35826
|
-
return /* @__PURE__ */ jsxs62(Step, { n: 3, state:
|
|
35735
|
+
return /* @__PURE__ */ jsxs62(Step, { n: 3, state: installed2 ? NOW : TODO, title, children: [
|
|
35827
35736
|
/* @__PURE__ */ jsx91("p", { className: NOTE, children: boardFirst(progress) ? "Same project, same files. It opens on this storyboard." : "Same project, same files, in the desktop app." }),
|
|
35828
35737
|
/* @__PURE__ */ jsx91(
|
|
35829
35738
|
Button,
|
|
@@ -35975,7 +35884,7 @@ function useGuide(route, setRoute, placement) {
|
|
|
35975
35884
|
const [downloaded, setDownloaded] = useState45(false);
|
|
35976
35885
|
const [slow, setSlow] = useState45(false);
|
|
35977
35886
|
const [arrived, setArrived] = useState45(false);
|
|
35978
|
-
const
|
|
35887
|
+
const installed2 = route?.context.app_installed === true;
|
|
35979
35888
|
const installCounted = useRef62(false);
|
|
35980
35889
|
const onAnswer = useCallback53(
|
|
35981
35890
|
(answered) => {
|
|
@@ -35988,13 +35897,13 @@ function useGuide(route, setRoute, placement) {
|
|
|
35988
35897
|
},
|
|
35989
35898
|
[setRoute]
|
|
35990
35899
|
);
|
|
35991
|
-
useInstallWatch(cardOpen && route !== null && !
|
|
35900
|
+
useInstallWatch(cardOpen && route !== null && !installed2, placement, onAnswer);
|
|
35992
35901
|
useEffect44(() => {
|
|
35993
|
-
if (!downloaded ||
|
|
35902
|
+
if (!downloaded || installed2) return;
|
|
35994
35903
|
setSlow(false);
|
|
35995
35904
|
const timer = setTimeout(() => setSlow(true), SLOW_MS);
|
|
35996
35905
|
return () => clearTimeout(timer);
|
|
35997
|
-
}, [downloaded,
|
|
35906
|
+
}, [downloaded, installed2]);
|
|
35998
35907
|
if (!route) return null;
|
|
35999
35908
|
const context = route.context;
|
|
36000
35909
|
const guideStep = (step) => trackStudioEvent("desktop_cta_guide", { step, ...context });
|
|
@@ -39343,7 +39252,7 @@ function OffCanvasIndicators({
|
|
|
39343
39252
|
const selectOffCanvas = async () => {
|
|
39344
39253
|
const el = elements.current.get(r.key);
|
|
39345
39254
|
if (!el) return;
|
|
39346
|
-
const { resolveDomEditSelection: resolveDomEditSelection2 } = await import("./domEditingLayers-
|
|
39255
|
+
const { resolveDomEditSelection: resolveDomEditSelection2 } = await import("./domEditingLayers-7Q56QAU5.js");
|
|
39347
39256
|
const acp = activeCompositionPathRef.current ?? "index.html";
|
|
39348
39257
|
const sel = await resolveDomEditSelection2(el, {
|
|
39349
39258
|
activeCompositionPath: acp,
|
|
@@ -52415,7 +52324,7 @@ function getAnimationEditingBlock(isCurrentSelection, diagnostics) {
|
|
|
52415
52324
|
}
|
|
52416
52325
|
return null;
|
|
52417
52326
|
}
|
|
52418
|
-
function
|
|
52327
|
+
function describe(selection, deps, isCurrentSelection, resolvedHandle) {
|
|
52419
52328
|
const { capabilities } = selection;
|
|
52420
52329
|
const gsap3 = deps.getGsapDiagnostics();
|
|
52421
52330
|
const animations = isCurrentSelection ? gsap3.animations.map(describeAnimation) : [];
|
|
@@ -52466,7 +52375,7 @@ async function studioInspect(deps, input = {}) {
|
|
|
52466
52375
|
"Pass a handle from studio_look, or call studio_select first."
|
|
52467
52376
|
);
|
|
52468
52377
|
}
|
|
52469
|
-
return
|
|
52378
|
+
return describe(current2, deps, true);
|
|
52470
52379
|
}
|
|
52471
52380
|
if (!elementHandleMatchesProject(input.handle, deps.getProjectId())) {
|
|
52472
52381
|
return toolFailure(
|
|
@@ -52500,7 +52409,7 @@ async function studioInspect(deps, input = {}) {
|
|
|
52500
52409
|
"Call studio_look again."
|
|
52501
52410
|
);
|
|
52502
52411
|
}
|
|
52503
|
-
return
|
|
52412
|
+
return describe(
|
|
52504
52413
|
resolved2.selection,
|
|
52505
52414
|
deps,
|
|
52506
52415
|
current2?.element === resolved2.selection.element,
|
|
@@ -59099,7 +59008,7 @@ function loadFontLists() {
|
|
|
59099
59008
|
fontListsRequest ??= Promise.all([
|
|
59100
59009
|
fetchFontList("/api/fonts"),
|
|
59101
59010
|
fetchFontList("/api/fonts/google")
|
|
59102
|
-
]).then(([
|
|
59011
|
+
]).then(([installed2, google]) => {
|
|
59103
59012
|
const names = google.concat(POPULAR_GOOGLE_FONT_FAMILIES);
|
|
59104
59013
|
const families = [];
|
|
59105
59014
|
const googleKeys = /* @__PURE__ */ new Set();
|
|
@@ -59111,7 +59020,7 @@ function loadFontLists() {
|
|
|
59111
59020
|
families.push(...uniqueFontFamilies(batch, googleKeys));
|
|
59112
59021
|
}
|
|
59113
59022
|
if (next < names.length) return false;
|
|
59114
|
-
fontLists = { loaded: true, google: families, googleKeys, installed };
|
|
59023
|
+
fontLists = { loaded: true, google: families, googleKeys, installed: installed2 };
|
|
59115
59024
|
for (const listener2 of fontListListeners) listener2();
|
|
59116
59025
|
return true;
|
|
59117
59026
|
});
|
|
@@ -88775,10 +88684,10 @@ function useSdkSession(projectId, activeCompPath, fileTree = [], fileTreeLoaded
|
|
|
88775
88684
|
return;
|
|
88776
88685
|
}
|
|
88777
88686
|
const displaced = ownedSessionRef.current;
|
|
88778
|
-
const
|
|
88687
|
+
const installed2 = { ...owner, session: comp };
|
|
88779
88688
|
sessionOwnersRef.current.set(comp, owner);
|
|
88780
|
-
ownedSessionRef.current =
|
|
88781
|
-
setOwnedSession(
|
|
88689
|
+
ownedSessionRef.current = installed2;
|
|
88690
|
+
setOwnedSession(installed2);
|
|
88782
88691
|
if (displaced && displaced.session !== comp) disposeSdkSession(displaced.session);
|
|
88783
88692
|
}).catch((error) => {
|
|
88784
88693
|
if (!cancelled && generationRef.current === generation) {
|
|
@@ -89542,9 +89451,9 @@ async function addBlockToProject(opts) {
|
|
|
89542
89451
|
showToast
|
|
89543
89452
|
} = opts;
|
|
89544
89453
|
try {
|
|
89545
|
-
const
|
|
89546
|
-
if (!
|
|
89547
|
-
const { block, compositionFile: compositionFile2 } =
|
|
89454
|
+
const installed2 = await installRegistryItem({ projectId, blockName, showToast });
|
|
89455
|
+
if (!installed2) return null;
|
|
89456
|
+
const { block, compositionFile: compositionFile2 } = installed2;
|
|
89548
89457
|
await makeComponentBackgroundTransparent(
|
|
89549
89458
|
block,
|
|
89550
89459
|
compositionFile2,
|
|
@@ -102999,7 +102908,7 @@ function readComputedStyles(iframe, selector) {
|
|
|
102999
102908
|
"z-index"
|
|
103000
102909
|
];
|
|
103001
102910
|
for (const prop of props) {
|
|
103002
|
-
const val = computed.getPropertyValue(prop);
|
|
102911
|
+
const val = prop === "opacity" ? getLogicalOpacity(el, computed) : computed.getPropertyValue(prop);
|
|
103003
102912
|
if (val) styles[prop] = val;
|
|
103004
102913
|
}
|
|
103005
102914
|
} catch {
|