hyperframes 0.8.159 → 0.8.161
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/README.md +10 -0
- package/dist/{add-7UMRT6IJ.js → add-7U5TQGSQ.js} +11 -11
- package/dist/{animatedGifPrep-COFZMEVD.js → animatedGifPrep-YAJTDXB7.js} +6 -6
- package/dist/api.js +16 -16
- package/dist/{asset-N37XIJTB.js → asset-N3JO5LHY.js} +2 -2
- package/dist/{assetCataloger-ZOQ67MGR.js → assetCataloger-BIDQA34M.js} +2 -2
- package/dist/audio-QNPSENQR.js +1131 -0
- package/dist/{auth-GKFS2PL6.js → auth-HINUM4A7.js} +1 -1
- package/dist/{autoUpdate-V4PLREDQ.js → autoUpdate-AAMND4XK.js} +2 -2
- package/dist/{backgroundChecks-TVOKARY2.js → backgroundChecks-FXIEHPND.js} +3 -3
- package/dist/backgroundChecksWorker.js +3 -3
- package/dist/{batchRender-IARQXQHN.js → batchRender-C2JCG5EK.js} +3 -3
- package/dist/beats-UZNREIRU.js +239 -0
- package/dist/{benchmark-ZJYFRFYF.js → benchmark-YM3QXPH6.js} +8 -8
- package/dist/{browser-WRZOH4PD.js → browser-SD3T2XMH.js} +5 -5
- package/dist/{bundleWithLocalizedFonts-SFHKZZAX.js → bundleWithLocalizedFonts-SLBVWQ7O.js} +2 -2
- package/dist/{capture-LLLIHYEF.js → capture-GUO23PVN.js} +2 -2
- package/dist/{capture-KFYPMVTT.js → capture-M5ZAD3BI.js} +10 -10
- package/dist/{catalog-QO762U7V.js → catalog-6PF7KZAZ.js} +11 -11
- package/dist/{catch-up-MELHNTGB.js → catch-up-5LTQTD3X.js} +4 -4
- package/dist/{check-RX3LTKYB.js → check-NE2YXJR2.js} +130 -119
- package/dist/{checkBrowser-EUUMEILI.js → checkBrowser-XDTXDEYO.js} +33 -31
- package/dist/{chunk-YIJMVFEJ.js → chunk-22QHO26F.js} +1 -1
- package/dist/{chunk-7F3B5YYT.js → chunk-2742O5DO.js} +178 -23
- package/dist/{chunk-HEEN6X6O.js → chunk-2ZLYSXZC.js} +8 -8
- package/dist/{chunk-5RSV6DWB.js → chunk-4ID635FL.js} +1 -1
- package/dist/{chunk-ODE7HHNN.js → chunk-5YSHR4XC.js} +11 -9
- package/dist/chunk-6JR2XUEE.js +127 -0
- package/dist/{chunk-DLQQA25O.js → chunk-7ZKEOQ5N.js} +1 -1
- package/dist/{chunk-BB2SFTMY.js → chunk-A2DMF2Q6.js} +6 -5
- package/dist/{chunk-K5BMHQOU.js → chunk-AHNJMWMU.js} +14 -14
- package/dist/{chunk-IJ7JPX4W.js → chunk-AY2FEJDR.js} +3 -3
- package/dist/{chunk-MMYY4KV3.js → chunk-B5FZ2CQM.js} +1 -1
- package/dist/{chunk-IWOEAWIP.js → chunk-B7RUGHBT.js} +1 -1
- package/dist/{chunk-AFYZWHR7.js → chunk-CGOGEA62.js} +2 -2
- package/dist/{chunk-7RTTPSXG.js → chunk-D33YJZOH.js} +1 -1
- package/dist/{chunk-54DMWFQZ.js → chunk-D3ZWBHZP.js} +2 -15
- package/dist/{chunk-WWMFR4SH.js → chunk-DJZEIVAP.js} +3 -3
- package/dist/{chunk-EGJVFPUX.js → chunk-ERTJPFCH.js} +1 -1
- package/dist/{chunk-FEKRMXT6.js → chunk-EVRUR7DW.js} +1 -1
- package/dist/chunk-FFJ5TDRD.js +1181 -0
- package/dist/{chunk-BEW7RCCW.js → chunk-G5AZMSQP.js} +2 -2
- package/dist/{chunk-UK4KRTIX.js → chunk-G642IIVK.js} +2 -2
- package/dist/{chunk-AEQWF7PE.js → chunk-GG37I7B3.js} +1 -1
- package/dist/{chunk-A5RDOXZE.js → chunk-GIPNECWL.js} +17 -129
- package/dist/chunk-GJQHHAAX.js +336 -0
- package/dist/{chunk-4IKI2RYR.js → chunk-H4VXLZ6O.js} +10 -10
- package/dist/{chunk-NCVGBBWC.js → chunk-HM4PLNTX.js} +1 -1
- package/dist/{chunk-24N3BB5M.js → chunk-I6CVW5CA.js} +5 -5
- package/dist/{chunk-KEGTYA7V.js → chunk-IK3SOMZ4.js} +5 -3
- package/dist/{chunk-YITZFHRJ.js → chunk-IL6C7T5X.js} +1 -1
- package/dist/{chunk-6PIGOKTE.js → chunk-JGYHWVXQ.js} +339 -67
- package/dist/{chunk-HO3SITVT.js → chunk-KZPG4DXX.js} +1 -1
- package/dist/{chunk-INNBWSZK.js → chunk-LYIG2GZ5.js} +2 -2
- package/dist/{chunk-ESOAYGIT.js → chunk-MMV6IY6U.js} +2 -2
- package/dist/{chunk-4DEBDQD4.js → chunk-MP676E4B.js} +2 -2
- package/dist/{chunk-3W3MOLRL.js → chunk-N2NDDTYW.js} +2 -2
- package/dist/{chunk-GGDCBVXK.js → chunk-OMJA7JP6.js} +5 -5
- package/dist/{chunk-4D5RBIX6.js → chunk-ON2HYNGB.js} +10 -10
- package/dist/chunk-P47XYVEQ.js +3795 -0
- package/dist/{chunk-NIGOOCVS.js → chunk-P4QE7SSN.js} +1 -1
- package/dist/{chunk-AQXJC64X.js → chunk-PBNV5V5G.js} +1 -1
- package/dist/{chunk-2CEH75X3.js → chunk-PLEMSN3E.js} +2 -2
- package/dist/{chunk-DVAEX52Q.js → chunk-PPF65XAF.js} +1 -1
- package/dist/{chunk-5GPX4X4L.js → chunk-PYMYGIZ4.js} +2 -2
- package/dist/{chunk-7XEVZDKU.js → chunk-PZH7FTRZ.js} +7 -7
- package/dist/{chunk-V5J4XEBG.js → chunk-Q3TFX4OZ.js} +1 -1
- package/dist/{chunk-XSEGMQYA.js → chunk-QABAVWEX.js} +26 -3
- package/dist/{chunk-IKDBT5WT.js → chunk-RGYEL7QD.js} +3 -3
- package/dist/{chunk-76NO4ZRM.js → chunk-RTS7BGEC.js} +1 -1
- package/dist/{chunk-6TDZJ43G.js → chunk-SAS6XBY5.js} +1 -1
- package/dist/{chunk-H6BKVVU4.js → chunk-SB5DX6AD.js} +2 -2
- package/dist/{chunk-JZLFHF2M.js → chunk-TXG6W4X4.js} +3 -3
- package/dist/{chunk-EWAAH7AU.js → chunk-VYTGK5YA.js} +1 -1
- package/dist/{chunk-5HNZQSO4.js → chunk-WDUEIP22.js} +1 -1
- package/dist/{chunk-MTUC2Z32.js → chunk-WNXVPPMV.js} +2 -2
- package/dist/{chunk-SQHWDFTV.js → chunk-X3SCQP2A.js} +1 -1
- package/dist/{chunk-LBT4AMSF.js → chunk-XRKMITSS.js} +1 -1
- package/dist/{chunk-5O6I5ZV7.js → chunk-XTLV6UVP.js} +3 -3
- package/dist/{chunk-5YCFHCD4.js → chunk-XWWYGXJ5.js} +2 -2
- package/dist/{clean-RW7Z4XM6.js → clean-4Y4G3YV3.js} +18 -17
- package/dist/cli.js +54 -53
- package/dist/{cloud-EEOV7JKB.js → cloud-BWXJB2B7.js} +4 -4
- package/dist/{cloudrun-EZAXYVXG.js → cloudrun-BIQXBUDO.js} +3 -3
- package/dist/{compare-5UARQFXX.js → compare-OLLJBVNL.js} +25 -24
- package/dist/{compiler-THI7BXZU.js → compiler-57M6W5WY.js} +3 -3
- package/dist/{component-AYOFPL33.js → component-ULSAC45J.js} +3 -3
- package/dist/{compositions-XJNJBOMG.js → compositions-G2JTQBTJ.js} +10 -10
- package/dist/{delete-653AOR25.js → delete-BONV4XUI.js} +2 -2
- package/dist/{dist-DLR4X3KN.js → dist-4JFB3WAR.js} +2 -2
- package/dist/{dist-2VXSQLXO.js → dist-ROVMAL74.js} +1 -1
- package/dist/{doctor-WA6VRRE7.js → doctor-EMLC4VZ4.js} +12 -12
- package/dist/{events-XXBCP2I4.js → events-LF2J436R.js} +3 -3
- package/dist/{events-U5COLUWT.js → events-ZFGAA5UD.js} +2 -2
- package/dist/{feedback-DX6Q3LN7.js → feedback-WKCUQE6T.js} +6 -6
- package/dist/{ffmpeg-2ROTISBL.js → ffmpeg-7BYARPLM.js} +4 -2
- package/dist/{figma-LCQVLBXF.js → figma-VJKG252Z.js} +3 -3
- package/dist/fontLocalizeCli.js +8 -8
- package/dist/{get-UYNPFMHX.js → get-OINAGI2B.js} +2 -2
- package/dist/{gpuPolicy-YIW3HL3B.js → gpuPolicy-VGE3I5J4.js} +6 -6
- package/dist/{grade-compare-YQEYATJV.js → grade-compare-DY5VFXPK.js} +27 -26
- package/dist/{help-FDURC7WR.js → help-HHB7JRZA.js} +2 -1
- package/dist/{history-EU5UZLHT.js → history-D44JJBBC.js} +8 -7
- package/dist/hyperframe-runtime.js +55 -55
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +55 -55
- package/dist/hyperframes-player.global.js +3 -3
- package/dist/{info-7T6CK6CL.js → info-2WZLISAR.js} +7 -7
- package/dist/{init-KQYSKFVU.js → init-UYZS2WXQ.js} +28 -28
- package/dist/{inspect-HQBV7VHS.js → inspect-IEFCB4PT.js} +26 -25
- package/dist/{installer-OKKPQNKS.js → installer-T3STEB4U.js} +4 -4
- package/dist/{keyframes-SK74JHOA.js → keyframes-FS43QHM2.js} +6 -6
- package/dist/{lambda-S2N4VTRO.js → lambda-RAJA6ZNA.js} +4 -4
- package/dist/{layout-MTE5Y6DE.js → layout-AK2A7Q46.js} +26 -25
- package/dist/{lint-FJGGJYB7.js → lint-JRJUSZO7.js} +7 -7
- package/dist/{lintProject-JGHKRO5L.js → lintProject-BGDYHF3F.js} +1 -1
- package/dist/{list-MBPALK5U.js → list-BKKGPT7E.js} +2 -2
- package/dist/{login-HDN4T5E4.js → login-QJZTUDDO.js} +4 -4
- package/dist/{manager-JNJE54OQ.js → manager-B6MVBM2E.js} +3 -3
- package/dist/{manager-ZLJD3EAY.js → manager-HEUPD2YB.js} +2 -2
- package/dist/{media-treatment-IP34DXWN.js → media-treatment-473OM7G7.js} +12 -11
- package/dist/{models-W5TASRHD.js → models-OA4MXEYG.js} +12 -12
- package/dist/{motionShot-2WYEMOPJ.js → motionShot-C2YDYRNB.js} +16 -16
- package/dist/{normalize-audio-F4NQPXII.js → normalize-audio-M3KVTFTQ.js} +4 -4
- package/dist/{open-DRXNALDE.js → open-363TDMEP.js} +4 -4
- package/dist/{parakeetRunner-VISBF2EA.js → parakeetRunner-DBLHMD5T.js} +13 -13
- package/dist/{pipeline-A2XOVZOM.js → pipeline-FSY65OQ4.js} +8 -8
- package/dist/{play-W2QELQX7.js → play-2UB33EGB.js} +19 -18
- package/dist/{preflight-BH2XUQBS.js → preflight-G5KP7ZKA.js} +4 -4
- package/dist/{present-NHYRS4F4.js → present-F3ASSDJX.js} +15 -14
- package/dist/{preview-SMJVUPXE.js → preview-EF76WIHK.js} +18 -18
- package/dist/{producer-276O3CKW.js → producer-C5V2A3YL.js} +1 -1
- package/dist/{projectConfig-FXFUHFPZ.js → projectConfig-X2IEHCSK.js} +6 -6
- package/dist/{publication-SSQO6ECV.js → publication-JEANCWBW.js} +2 -2
- package/dist/{publish-UHDKDXZI.js → publish-VX5OH4ST.js} +8 -8
- package/dist/{remove-background-IG6U56HC.js → remove-background-IXCISD26.js} +9 -9
- package/dist/{render-6P5RSFS3.js → render-GL72Z2W2.js} +8 -8
- package/dist/{render-ZJPSLTKV.js → render-GUBYSVQD.js} +29 -28
- package/dist/{render-XQONIJEJ.js → render-ISUT7Q3X.js} +3 -3
- package/dist/{render-batch-MH3Z6IPT.js → render-batch-2C6RUP3F.js} +3 -3
- package/dist/renderSetupWorker.js +4 -4
- package/dist/{resolver-JMSGO2JF.js → resolver-KTNKZVIB.js} +4 -4
- package/dist/{sherpa-64JLV4YM.js → sherpa-GFRG3TMM.js} +12 -12
- package/dist/skills/hyperframes-cli/SKILL.md +5 -4
- package/dist/skills/hyperframes-cli/references/beats.md +2 -6
- package/dist/skills/hyperframes-cli/references/lint-validate-inspect.md +8 -0
- package/dist/skills/hyperframes-cli/references/upgrade-info-misc.md +1 -1
- package/dist/{skills-UXOL62PY.js → skills-7XI4DHLN.js} +5 -5
- package/dist/{skillsUpdateCheck-5Y6676K6.js → skillsUpdateCheck-34WOCMHV.js} +3 -3
- package/dist/{snapshot-SQBPCXOV.js → snapshot-SGTO2OQ4.js} +40 -30
- package/dist/{src-N42CT3YR.js → src-GPUDUKY6.js} +5 -5
- package/dist/{src-RQMK5INS.js → src-IMCQRH4P.js} +7 -7
- package/dist/{staticProjectServer-AQXVWMLU.js → staticProjectServer-4CQ3KDQK.js} +15 -14
- package/dist/studio/assets/{hyperframes-player-kqB1psAJ.js → hyperframes-player-C8VFb4NS.js} +1 -1
- package/dist/studio/assets/{index-X_d1b5vz.js → index-J8Bpbg6o.js} +118 -118
- package/dist/studio/assets/{index-BrViH8hj.js → index-RZnZPb-B.js} +1 -1
- package/dist/studio/index.html +1 -1
- package/dist/{studio-api-GY5D7RAP.js → studio-api-RYCDLEOR.js} +13 -8
- package/dist/{studioServer-O3VONODG.js → studioServer-VIIVGFZH.js} +45 -44
- package/dist/{telemetry-V2K5P7CI.js → telemetry-YKVYLJSB.js} +3 -3
- package/dist/{timeline-YU3YPLKB.js → timeline-LDRA7QZ3.js} +42 -347
- package/dist/{tokens-NPSSSG2A.js → tokens-ZAOFRU55.js} +2 -2
- package/dist/{transcribe-FNBDG24U.js → transcribe-CJXUHTAS.js} +17 -17
- package/dist/{transcribe-BXJNS3RZ.js → transcribe-FL6NGWHF.js} +11 -11
- package/dist/{updateCheck-MB3RHSVK.js → updateCheck-TIRFQBSI.js} +2 -2
- package/dist/{upgrade-5VNRUR37.js → upgrade-7R5G3MNO.js} +2 -2
- package/dist/{urlDownloader-WCT7FMLA.js → urlDownloader-KDJGLR2Y.js} +5 -5
- package/dist/{usage-EC3KFUIJ.js → usage-HG4WMM7A.js} +33 -5
- package/dist/{validate-UXSXRCE6.js → validate-VGEPWGQO.js} +20 -19
- package/dist/{video-NRNQBZMV.js → video-AHO4CDCK.js} +6 -6
- package/package.json +2 -3
- package/dist/beat-analyzer.global.js +0 -341
- package/dist/beats-FY4UDXBL.js +0 -322
- package/dist/chunk-TWBTXEDZ.js +0 -3795
- package/dist/lib-TPG2ZMAX.js +0 -128
- package/dist/studio/assets/index-C3AZLr-0.js +0 -1
|
@@ -6,10 +6,10 @@ var __filename = __hf_fileURLToPath(import.meta.url);
|
|
|
6
6
|
var __dirname = __hf_dirname(__filename);
|
|
7
7
|
import {
|
|
8
8
|
withOwner
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CGOGEA62.js";
|
|
10
10
|
import {
|
|
11
11
|
beginArtifactCapture
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-JGYHWVXQ.js";
|
|
13
13
|
|
|
14
14
|
// src/utils/artifactCapture.ts
|
|
15
15
|
async function captureArtifactRevision(projectDir) {
|
|
@@ -6,12 +6,12 @@ var __filename = __hf_fileURLToPath(import.meta.url);
|
|
|
6
6
|
var __dirname = __hf_dirname(__filename);
|
|
7
7
|
import {
|
|
8
8
|
setHostHandlesSigint
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-PLEMSN3E.js";
|
|
10
10
|
import {
|
|
11
11
|
processAncestorSnapshot,
|
|
12
12
|
processIdentity,
|
|
13
13
|
processParentPid
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-22QHO26F.js";
|
|
15
15
|
import {
|
|
16
16
|
processIsAlive
|
|
17
17
|
} from "./chunk-KGPLIH7B.js";
|
|
@@ -4,6 +4,9 @@ import { dirname as __hf_dirname } from "node:path";
|
|
|
4
4
|
var require = __hf_createRequire(import.meta.url);
|
|
5
5
|
var __filename = __hf_fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __hf_dirname(__filename);
|
|
7
|
+
import {
|
|
8
|
+
relinkSplitHalves
|
|
9
|
+
} from "./chunk-6JR2XUEE.js";
|
|
7
10
|
import {
|
|
8
11
|
EXCLUDED_TAGS,
|
|
9
12
|
ensureHfIds,
|
|
@@ -14,14 +17,14 @@ import {
|
|
|
14
17
|
isAllowedHtmlAttribute,
|
|
15
18
|
isSafeAttributeValue,
|
|
16
19
|
sanitizeRichTextChildren
|
|
17
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-Q3TFX4OZ.js";
|
|
18
21
|
import {
|
|
19
22
|
decodedUrlPath,
|
|
20
23
|
removeElementWithGsapCascade
|
|
21
24
|
} from "./chunk-ALLKNYC3.js";
|
|
22
25
|
import {
|
|
23
26
|
require_dist
|
|
24
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-2742O5DO.js";
|
|
25
28
|
import {
|
|
26
29
|
readClipTiming,
|
|
27
30
|
writeClipTiming
|
|
@@ -135,121 +138,9 @@ function replacementTimelineAssetId(document, element, newSrc) {
|
|
|
135
138
|
return buildTimelineAssetId(decodedUrlPath(newSrc), ids);
|
|
136
139
|
}
|
|
137
140
|
|
|
138
|
-
// ../studio-server/dist/chunk-
|
|
141
|
+
// ../studio-server/dist/chunk-WUNFUTHB.js
|
|
139
142
|
var import_postcss_selector_parser = __toESM(require_dist(), 1);
|
|
140
143
|
import postcss from "postcss";
|
|
141
|
-
|
|
142
|
-
// ../core/dist/mediaLink.js
|
|
143
|
-
var MEDIA_LINK_ATTR = "data-link";
|
|
144
|
-
function readNumber(el, names, fallback) {
|
|
145
|
-
for (const name of names) {
|
|
146
|
-
const raw = el.getAttribute(name);
|
|
147
|
-
if (raw === null || raw.trim() === "")
|
|
148
|
-
continue;
|
|
149
|
-
const value = Number(raw);
|
|
150
|
-
if (Number.isFinite(value))
|
|
151
|
-
return value;
|
|
152
|
-
}
|
|
153
|
-
return fallback;
|
|
154
|
-
}
|
|
155
|
-
function readLinkTiming(el) {
|
|
156
|
-
return {
|
|
157
|
-
start: readNumber(el, ["data-start"], 0),
|
|
158
|
-
duration: readNumber(el, ["data-duration"], 0),
|
|
159
|
-
mediaStart: readMediaOffsetSeconds((name) => el.getAttribute(name)),
|
|
160
|
-
playbackRate: readNumber(el, ["data-playback-rate"], 1)
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
var LINK_SCOPE_SELECTOR = "[data-composition-id], [data-composition-file]";
|
|
164
|
-
function mintLinkId(taken) {
|
|
165
|
-
const used = new Set(taken);
|
|
166
|
-
let n = 1;
|
|
167
|
-
while (used.has(`lk-${n}`))
|
|
168
|
-
n += 1;
|
|
169
|
-
return `lk-${n}`;
|
|
170
|
-
}
|
|
171
|
-
function takenLinkIds(doc) {
|
|
172
|
-
return Array.from(doc.querySelectorAll(`[id], [${MEDIA_LINK_ATTR}], [${SYNC_ORIGIN_ATTR}]`)).flatMap((el) => [
|
|
173
|
-
el.id,
|
|
174
|
-
el.getAttribute(MEDIA_LINK_ATTR) ?? "",
|
|
175
|
-
el.getAttribute(SYNC_ORIGIN_ATTR) ?? ""
|
|
176
|
-
]);
|
|
177
|
-
}
|
|
178
|
-
function renameShared(doc, ids, attr, taken) {
|
|
179
|
-
const renamed = /* @__PURE__ */ new Map();
|
|
180
|
-
for (const id of ids) {
|
|
181
|
-
const el = doc.getElementById(id);
|
|
182
|
-
const old = el?.getAttribute(attr);
|
|
183
|
-
if (!el || !old)
|
|
184
|
-
continue;
|
|
185
|
-
let fresh = renamed.get(old);
|
|
186
|
-
if (!fresh) {
|
|
187
|
-
fresh = mintLinkId(taken);
|
|
188
|
-
taken.add(fresh);
|
|
189
|
-
renamed.set(old, fresh);
|
|
190
|
-
}
|
|
191
|
-
el.setAttribute(attr, fresh);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
function relinkSplitHalves(doc, rightHalfIds) {
|
|
195
|
-
const taken = new Set(takenLinkIds(doc));
|
|
196
|
-
renameShared(doc, rightHalfIds, MEDIA_LINK_ATTR, taken);
|
|
197
|
-
renameShared(doc, idsWithBothSidesCut(doc, rightHalfIds), SYNC_ORIGIN_ATTR, taken);
|
|
198
|
-
}
|
|
199
|
-
function idsWithBothSidesCut(doc, rightHalfIds) {
|
|
200
|
-
const tagsByOrigin = /* @__PURE__ */ new Map();
|
|
201
|
-
const originOf = (id) => doc.getElementById(id)?.getAttribute(SYNC_ORIGIN_ATTR) ?? null;
|
|
202
|
-
for (const id of rightHalfIds) {
|
|
203
|
-
const origin = originOf(id);
|
|
204
|
-
const tag = doc.getElementById(id)?.tagName.toLowerCase();
|
|
205
|
-
if (!origin || !tag)
|
|
206
|
-
continue;
|
|
207
|
-
tagsByOrigin.set(origin, (tagsByOrigin.get(origin) ?? /* @__PURE__ */ new Set()).add(tag));
|
|
208
|
-
}
|
|
209
|
-
return rightHalfIds.filter((id) => {
|
|
210
|
-
const tags = tagsByOrigin.get(originOf(id) ?? "");
|
|
211
|
-
return tags?.has("video") === true && tags.has("audio");
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
var SYNC_ORIGIN_ATTR = "data-sync-origin";
|
|
215
|
-
var rateOf = (timing) => timing.playbackRate > 0 ? timing.playbackRate : 1;
|
|
216
|
-
function sourceZeroTime(timing) {
|
|
217
|
-
return timing.start - timing.mediaStart / rateOf(timing);
|
|
218
|
-
}
|
|
219
|
-
function syncOffsetFrames(clip, partner, fps) {
|
|
220
|
-
if (Math.abs(rateOf(clip) - rateOf(partner)) > 1e-6)
|
|
221
|
-
return null;
|
|
222
|
-
const frames = Math.round((sourceZeroTime(clip) - sourceZeroTime(partner)) * fps);
|
|
223
|
-
return Object.is(frames, -0) ? 0 : frames;
|
|
224
|
-
}
|
|
225
|
-
function sharedSeconds(a, b) {
|
|
226
|
-
return Math.min(a.start + a.duration, b.start + b.duration) - Math.max(a.start, b.start);
|
|
227
|
-
}
|
|
228
|
-
function sameOriginInScope(el, tag, origin) {
|
|
229
|
-
const scopeOf = (node) => node.closest(LINK_SCOPE_SELECTOR) ?? el.ownerDocument;
|
|
230
|
-
const scope = scopeOf(el);
|
|
231
|
-
return Array.from(scope.querySelectorAll(tag)).filter((candidate) => candidate.getAttribute(SYNC_ORIGIN_ATTR) === origin && scopeOf(candidate) === scope);
|
|
232
|
-
}
|
|
233
|
-
function findSyncPartner(el) {
|
|
234
|
-
const origin = el.getAttribute(SYNC_ORIGIN_ATTR);
|
|
235
|
-
const tag = el.tagName.toLowerCase();
|
|
236
|
-
if (!origin || tag !== "video" && tag !== "audio")
|
|
237
|
-
return null;
|
|
238
|
-
const partnerTag = tag === "video" ? "audio" : "video";
|
|
239
|
-
const own = readLinkTiming(el);
|
|
240
|
-
let best = null;
|
|
241
|
-
for (const candidate of sameOriginInScope(el, partnerTag, origin)) {
|
|
242
|
-
const timing = readLinkTiming(candidate);
|
|
243
|
-
const shared = sharedSeconds(own, timing);
|
|
244
|
-
const distance = Math.abs(timing.start - own.start);
|
|
245
|
-
if (!best || shared > best.shared || shared === best.shared && distance < best.distance) {
|
|
246
|
-
best = { el: candidate, shared, distance };
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
return best?.el ?? null;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
// ../studio-server/dist/chunk-JBFOY5SI.js
|
|
253
144
|
function parseStyleDecls(style) {
|
|
254
145
|
const props = /* @__PURE__ */ new Map();
|
|
255
146
|
const order = [];
|
|
@@ -298,16 +189,16 @@ function patchStyleAttrString(style, property, value) {
|
|
|
298
189
|
}
|
|
299
190
|
return serializeStyleDecls(props, order);
|
|
300
191
|
}
|
|
192
|
+
var pinnedInSource = /* @__PURE__ */ new WeakMap();
|
|
301
193
|
function parseSourceDocument(raw) {
|
|
302
194
|
const source = ensureHfIds(raw);
|
|
303
195
|
const hasDocumentShell = /<!doctype|<html[\s>]/i.test(source);
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
};
|
|
196
|
+
const document = hasDocumentShell ? parseHTML(source).document : parseHTML(`<!DOCTYPE html><html><head></head><body>${source}</body></html>`).document;
|
|
197
|
+
pinnedInSource.set(
|
|
198
|
+
document,
|
|
199
|
+
new Set(Array.from(raw.matchAll(/\bdata-hf-id\s*=\s*["']?([^"'\s>]+)/gi), (m) => m[1]))
|
|
200
|
+
);
|
|
201
|
+
return { document, wrappedFragment: !hasDocumentShell };
|
|
311
202
|
}
|
|
312
203
|
function duplicateCssRulesForId(document, originalId, newId) {
|
|
313
204
|
const idToken = `#${originalId}`;
|
|
@@ -372,14 +263,16 @@ function findTargetElement(document, target) {
|
|
|
372
263
|
const el = findByHfId(document, target.hfId);
|
|
373
264
|
if (el) return el;
|
|
374
265
|
}
|
|
266
|
+
const pinned = pinnedInSource.get(document);
|
|
267
|
+
const unlessPinnedElsewhere = (el) => el && !(target.hfId && pinned?.has(el.getAttribute("data-hf-id") ?? "")) ? el : null;
|
|
375
268
|
if (target.id) {
|
|
376
|
-
const byId = document.getElementById(target.id);
|
|
269
|
+
const byId = unlessPinnedElsewhere(document.getElementById(target.id));
|
|
377
270
|
if (byId) return byId;
|
|
378
271
|
}
|
|
379
272
|
if (!target.selector) return null;
|
|
380
273
|
try {
|
|
381
274
|
const matches = querySelectorAllWithTemplates(document, target.selector);
|
|
382
|
-
return matches[target.selectorIndex ?? 0]
|
|
275
|
+
return unlessPinnedElsewhere(matches[target.selectorIndex ?? 0]);
|
|
383
276
|
} catch {
|
|
384
277
|
return null;
|
|
385
278
|
}
|
|
@@ -753,11 +646,6 @@ function relinkSplitHalvesInHtml(source, rightHalfIds) {
|
|
|
753
646
|
}
|
|
754
647
|
|
|
755
648
|
export {
|
|
756
|
-
MEDIA_LINK_ATTR,
|
|
757
|
-
readLinkTiming,
|
|
758
|
-
relinkSplitHalves,
|
|
759
|
-
syncOffsetFrames,
|
|
760
|
-
findSyncPartner,
|
|
761
649
|
parseSourceDocument,
|
|
762
650
|
findTargetElement,
|
|
763
651
|
removeElementsFromHtml,
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
import { createRequire as __hf_createRequire } from "node:module";
|
|
2
|
+
import { fileURLToPath as __hf_fileURLToPath } from "node:url";
|
|
3
|
+
import { dirname as __hf_dirname } from "node:path";
|
|
4
|
+
var require = __hf_createRequire(import.meta.url);
|
|
5
|
+
var __filename = __hf_fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = __hf_dirname(__filename);
|
|
7
|
+
import {
|
|
8
|
+
readCompositionFps
|
|
9
|
+
} from "./chunk-WPNE5NEP.js";
|
|
10
|
+
import {
|
|
11
|
+
findSyncPartner,
|
|
12
|
+
readLinkTiming,
|
|
13
|
+
syncOffsetFrames
|
|
14
|
+
} from "./chunk-6JR2XUEE.js";
|
|
15
|
+
import {
|
|
16
|
+
HF_AUDIO_GROUP_ATTR,
|
|
17
|
+
extractAudioMetadata,
|
|
18
|
+
extractMediaMetadata,
|
|
19
|
+
resolveReferencedDuration,
|
|
20
|
+
resolveReferencedStart
|
|
21
|
+
} from "./chunk-PLEMSN3E.js";
|
|
22
|
+
import {
|
|
23
|
+
byStart,
|
|
24
|
+
compositionOriginSeconds,
|
|
25
|
+
cutToHostSlots,
|
|
26
|
+
fpsToNumber,
|
|
27
|
+
hostInPointSeconds,
|
|
28
|
+
parseFpsWithDefault,
|
|
29
|
+
resolveMediaStartSeconds
|
|
30
|
+
} from "./chunk-Q3TFX4OZ.js";
|
|
31
|
+
import {
|
|
32
|
+
HF_AUDIO_AUTOMATION_ATTR,
|
|
33
|
+
HF_AUDIO_FX_ATTR,
|
|
34
|
+
parseAudioFxChain,
|
|
35
|
+
parseAutomation,
|
|
36
|
+
resolveAutomation
|
|
37
|
+
} from "./chunk-P47XYVEQ.js";
|
|
38
|
+
import {
|
|
39
|
+
topLevelElements,
|
|
40
|
+
trackKindOf
|
|
41
|
+
} from "./chunk-ALLKNYC3.js";
|
|
42
|
+
import {
|
|
43
|
+
parseNumeric
|
|
44
|
+
} from "./chunk-3RM2ETQT.js";
|
|
45
|
+
import {
|
|
46
|
+
readMediaOffsetSeconds,
|
|
47
|
+
readPlaybackRate,
|
|
48
|
+
resolveMediaDuration
|
|
49
|
+
} from "./chunk-BSQ7XANM.js";
|
|
50
|
+
|
|
51
|
+
// src/timeline/describeProject.ts
|
|
52
|
+
import { readFileSync, realpathSync, statSync } from "fs";
|
|
53
|
+
import { basename, dirname, isAbsolute, relative, resolve, sep } from "path";
|
|
54
|
+
var TRACK_ORDER = ["video", "graphics", "captions", "audio"];
|
|
55
|
+
function toNode(el) {
|
|
56
|
+
const attrs = {};
|
|
57
|
+
for (const { name, value } of Array.from(el.attributes)) attrs[name] = value;
|
|
58
|
+
return { tag: el.tagName, attrs, children: Array.from(el.children).map(toNode), el };
|
|
59
|
+
}
|
|
60
|
+
function safeChain(raw) {
|
|
61
|
+
try {
|
|
62
|
+
return parseAudioFxChain(raw);
|
|
63
|
+
} catch {
|
|
64
|
+
return void 0;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function readLanes(el) {
|
|
68
|
+
const raw = el.getAttribute(HF_AUDIO_AUTOMATION_ATTR);
|
|
69
|
+
if (!raw) return { lanes: [], laneError: null };
|
|
70
|
+
try {
|
|
71
|
+
const fx = el.getAttribute(HF_AUDIO_FX_ATTR);
|
|
72
|
+
const chain = fx ? safeChain(fx) : void 0;
|
|
73
|
+
const lanes = resolveAutomation(parseAutomation(raw), chain).lanes.map((lane) => ({
|
|
74
|
+
target: lane.target,
|
|
75
|
+
points: lane.points.map(({ t, v }) => ({ t, v }))
|
|
76
|
+
}));
|
|
77
|
+
return { lanes, laneError: null };
|
|
78
|
+
} catch (err) {
|
|
79
|
+
return { lanes: [], laneError: err instanceof Error ? err.message : String(err) };
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
var measureWithFfprobe = async (file, tag) => (tag === "audio" ? await extractAudioMetadata(file) : await extractMediaMetadata(file)).durationSeconds;
|
|
83
|
+
var MEDIA_TAG = /^(video|audio|img)$/;
|
|
84
|
+
var PROBE_CONCURRENCY = 4;
|
|
85
|
+
function createProbeGate(max) {
|
|
86
|
+
let active = 0;
|
|
87
|
+
const waiting = [];
|
|
88
|
+
return async function withProbeSlot(fn) {
|
|
89
|
+
if (active >= max) await new Promise((wake) => waiting.push(wake));
|
|
90
|
+
else active += 1;
|
|
91
|
+
try {
|
|
92
|
+
return await fn();
|
|
93
|
+
} finally {
|
|
94
|
+
const next = waiting.shift();
|
|
95
|
+
if (next) next();
|
|
96
|
+
else active -= 1;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
async function probeSource(scope, el, tag) {
|
|
101
|
+
const src = el.getAttribute("src");
|
|
102
|
+
if (!src) return { ok: false, reason: "no src attribute" };
|
|
103
|
+
if (/^https?:\/\//i.test(src)) return { ok: false, reason: "remote source not probed" };
|
|
104
|
+
const file = realFileInside(scope.projectDir, resolve(scope.dir, src));
|
|
105
|
+
if (!file) return { ok: false, reason: "source file not found" };
|
|
106
|
+
return scope.withProbeSlot(async () => {
|
|
107
|
+
try {
|
|
108
|
+
return { ok: true, seconds: await scope.measure(file, tag) };
|
|
109
|
+
} catch (err) {
|
|
110
|
+
return { ok: false, reason: err instanceof Error ? err.message : String(err) };
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function resolveContainerDuration(authored, children) {
|
|
115
|
+
if (authored !== null)
|
|
116
|
+
return { duration: authored, durationSource: "authored", pendingReason: null };
|
|
117
|
+
if (children.length === 0) return { duration: 0, durationSource: null, pendingReason: null };
|
|
118
|
+
const inner = children.reduce((max, c) => Math.max(max, c.end), 0);
|
|
119
|
+
return { duration: inner, durationSource: "inner", pendingReason: null };
|
|
120
|
+
}
|
|
121
|
+
async function resolveMediaRowDuration(scope, el, tag, authored) {
|
|
122
|
+
const getAttr = (name) => el.getAttribute(name);
|
|
123
|
+
const input = {
|
|
124
|
+
tag,
|
|
125
|
+
authoredDurationSeconds: authored,
|
|
126
|
+
mediaStartSeconds: readMediaOffsetSeconds(getAttr),
|
|
127
|
+
playbackRate: readPlaybackRate(getAttr)
|
|
128
|
+
};
|
|
129
|
+
const unprobed = resolveMediaDuration({ ...input, sourceDurationSeconds: null });
|
|
130
|
+
if (unprobed.source !== "pending") {
|
|
131
|
+
return {
|
|
132
|
+
duration: unprobed.seconds ?? 0,
|
|
133
|
+
durationSource: unprobed.source,
|
|
134
|
+
pendingReason: null
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
const probe = await probeSource(scope, el, tag);
|
|
138
|
+
const measured = probe.ok && probe.seconds > 0 ? probe.seconds : null;
|
|
139
|
+
const result = resolveMediaDuration({ ...input, sourceDurationSeconds: measured });
|
|
140
|
+
return {
|
|
141
|
+
duration: result.seconds ?? 0,
|
|
142
|
+
durationSource: result.source,
|
|
143
|
+
pendingReason: result.source === "pending" ? pendingReason(probe, result.reason) : null
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function pendingReason(probe, resolverReason) {
|
|
147
|
+
if (!probe.ok) return probe.reason;
|
|
148
|
+
return probe.seconds > 0 ? resolverReason ?? "source duration unavailable" : "source reports no duration";
|
|
149
|
+
}
|
|
150
|
+
var roundMs = (v) => Math.round(v * 1e3) / 1e3;
|
|
151
|
+
function mainTimelineStart(scope, el, start) {
|
|
152
|
+
const ordinaryStart = () => scope.origin + start;
|
|
153
|
+
if (!/^(video|audio)$/i.test(el.tagName)) return ordinaryStart();
|
|
154
|
+
return resolveMediaStartSeconds({
|
|
155
|
+
authoredStart: parseNumeric(el.getAttribute("data-start")),
|
|
156
|
+
hostStart: scope.origin,
|
|
157
|
+
hasAutoStart: el.hasAttribute("data-hf-auto-start"),
|
|
158
|
+
basis: el.getAttribute("data-hf-media-start-basis"),
|
|
159
|
+
ordinaryStart
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
async function resolveRowTiming(scope, node, depth) {
|
|
163
|
+
const { el } = node;
|
|
164
|
+
const start = resolveReferencedStart(scope.doc, el, scope.startCache, /* @__PURE__ */ new Set());
|
|
165
|
+
const authored = resolveReferencedDuration(scope.doc, el, scope.startCache, /* @__PURE__ */ new Set());
|
|
166
|
+
const host = el.getAttribute("data-composition-src");
|
|
167
|
+
const absStart = mainTimelineStart(scope, el, start);
|
|
168
|
+
const slots = hostInPointSeconds(el) > 0 ? [{ start: absStart, end: absStart + (authored ?? Infinity) }] : [];
|
|
169
|
+
const children = host && depth === 0 ? await readSubComposition(host, scope, compositionOriginSeconds(absStart, el), slots) : [];
|
|
170
|
+
const kind = el.tagName.toLowerCase();
|
|
171
|
+
const duration = MEDIA_TAG.test(kind) ? await resolveMediaRowDuration(scope, el, kind, authored) : resolveContainerDuration(authored, children);
|
|
172
|
+
return { start, authored, absStart, children, duration };
|
|
173
|
+
}
|
|
174
|
+
function describeRowFields(scope, node, timing) {
|
|
175
|
+
const { el } = node;
|
|
176
|
+
const kind = el.tagName.toLowerCase();
|
|
177
|
+
const host = el.getAttribute("data-composition-src");
|
|
178
|
+
const rate = parseNumeric(el.getAttribute("data-playback-rate"));
|
|
179
|
+
return {
|
|
180
|
+
id: el.id || el.getAttribute("data-composition-id") || kind,
|
|
181
|
+
label: null,
|
|
182
|
+
kind,
|
|
183
|
+
trackKind: trackKindOf(node).kind,
|
|
184
|
+
start: timing.start,
|
|
185
|
+
duration: timing.duration.duration,
|
|
186
|
+
end: timing.start + timing.duration.duration,
|
|
187
|
+
absStart: roundMs(timing.absStart),
|
|
188
|
+
absEnd: roundMs(timing.absStart + timing.duration.duration),
|
|
189
|
+
file: scope.file,
|
|
190
|
+
trackIndex: parseNumeric(el.getAttribute("data-track-index")) ?? 0,
|
|
191
|
+
src: el.getAttribute("src") ?? host,
|
|
192
|
+
sourceFile: host,
|
|
193
|
+
volume: parseNumeric(el.getAttribute("data-volume")),
|
|
194
|
+
...readLanes(el),
|
|
195
|
+
playbackRate: rate === 1 ? null : rate,
|
|
196
|
+
audioGroup: el.getAttribute(HF_AUDIO_GROUP_ATTR),
|
|
197
|
+
role: null,
|
|
198
|
+
durationAuthored: timing.authored !== null,
|
|
199
|
+
durationSource: timing.duration.durationSource,
|
|
200
|
+
pendingReason: timing.duration.pendingReason,
|
|
201
|
+
children: timing.children,
|
|
202
|
+
ref: "",
|
|
203
|
+
warnings: [],
|
|
204
|
+
elementId: el.id || null,
|
|
205
|
+
hfId: el.getAttribute("data-hf-id"),
|
|
206
|
+
syncOffsetFrames: syncOffsetOf(el, scope.fps),
|
|
207
|
+
mediaStart: /^(video|audio)$/.test(kind) ? readMediaOffsetSeconds((name) => el.getAttribute(name)) : null
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
function syncOffsetOf(el, fps) {
|
|
211
|
+
const partner = findSyncPartner(el);
|
|
212
|
+
return partner ? syncOffsetFrames(readLinkTiming(el), readLinkTiming(partner), fps) : null;
|
|
213
|
+
}
|
|
214
|
+
async function describeRow(scope, node, depth) {
|
|
215
|
+
return describeRowFields(scope, node, await resolveRowTiming(scope, node, depth));
|
|
216
|
+
}
|
|
217
|
+
async function readSubComposition(src, parent, origin, slots) {
|
|
218
|
+
const authored = resolve(parent.dir, src);
|
|
219
|
+
const file = realFileInside(parent.projectDir, authored);
|
|
220
|
+
if (!file) return [];
|
|
221
|
+
const relativeFile = relative(parent.projectDir, authored).split(sep).join("/");
|
|
222
|
+
const source = parent.sourceOverrides.get(relativeFile) ?? readFileSync(file, "utf-8");
|
|
223
|
+
const doc = new DOMParser().parseFromString(source, "text/html");
|
|
224
|
+
const template = doc.querySelector("template");
|
|
225
|
+
const root = (template?.content ?? doc).querySelector("[data-composition-id]");
|
|
226
|
+
if (!root) return [];
|
|
227
|
+
const scope = {
|
|
228
|
+
doc,
|
|
229
|
+
dir: dirname(file),
|
|
230
|
+
startCache: /* @__PURE__ */ new Map(),
|
|
231
|
+
projectDir: parent.projectDir,
|
|
232
|
+
origin,
|
|
233
|
+
file: relative(parent.projectDir, authored).split(sep).join("/"),
|
|
234
|
+
withProbeSlot: parent.withProbeSlot,
|
|
235
|
+
measure: parent.measure,
|
|
236
|
+
sourceOverrides: parent.sourceOverrides,
|
|
237
|
+
fps: parent.fps
|
|
238
|
+
};
|
|
239
|
+
const rows = await Promise.all(
|
|
240
|
+
topLevelElements(toNode(root)).map((node) => describeRow(scope, node, 1))
|
|
241
|
+
);
|
|
242
|
+
return rows.flatMap((row) => cutRow(row, slots)).sort(byStart);
|
|
243
|
+
}
|
|
244
|
+
function cutRow(row, slots) {
|
|
245
|
+
const kept = cutToHostSlots({ start: row.absStart, end: row.absEnd }, slots);
|
|
246
|
+
if (kept.end === kept.start && row.absEnd > row.absStart) return [];
|
|
247
|
+
const skipped = (kept.start - row.absStart) * (row.playbackRate ?? 1);
|
|
248
|
+
const mediaStart = row.mediaStart === null ? null : roundMs(row.mediaStart + skipped);
|
|
249
|
+
return [{ ...row, absStart: roundMs(kept.start), absEnd: roundMs(kept.end), mediaStart }];
|
|
250
|
+
}
|
|
251
|
+
function realFileInside(projectDir, path) {
|
|
252
|
+
try {
|
|
253
|
+
const real = realpathSync(path);
|
|
254
|
+
const inside = relative(realpathSync(projectDir), real);
|
|
255
|
+
if (inside === ".." || inside.startsWith(`..${sep}`) || isAbsolute(inside)) return null;
|
|
256
|
+
return statSync(real).isFile() ? real : null;
|
|
257
|
+
} catch {
|
|
258
|
+
return null;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
function flatten(top) {
|
|
262
|
+
const entries = [
|
|
263
|
+
...top.map((clip) => ({ clip, host: null })),
|
|
264
|
+
...top.flatMap((host) => host.children.map((clip) => ({ clip, host })))
|
|
265
|
+
];
|
|
266
|
+
const byKind = TRACK_ORDER.map((kind) => ({
|
|
267
|
+
kind,
|
|
268
|
+
entries: entries.filter((e) => e.clip.trackKind === kind).sort((a, b) => a.clip.absStart - b.clip.absStart)
|
|
269
|
+
})).filter((t) => t.entries.length > 0);
|
|
270
|
+
const pointers = new Map(
|
|
271
|
+
byKind.flatMap((t) => t.entries.map((e, index) => [e.clip, { kind: t.kind, index }]))
|
|
272
|
+
);
|
|
273
|
+
const at = (clip) => pointers.get(clip);
|
|
274
|
+
const fileIds = /* @__PURE__ */ new Map();
|
|
275
|
+
for (const { entries: entries2 } of byKind) {
|
|
276
|
+
for (const { clip } of entries2) {
|
|
277
|
+
if (!clip.elementId) continue;
|
|
278
|
+
const ids = fileIds.get(clip.file) ?? /* @__PURE__ */ new Map();
|
|
279
|
+
ids.set(clip.elementId, (ids.get(clip.elementId) ?? 0) + 1);
|
|
280
|
+
fileIds.set(clip.file, ids);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
return byKind.map(({ kind, entries: kindEntries }) => ({
|
|
284
|
+
kind,
|
|
285
|
+
rows: kindEntries.map(({ clip, host }, index) => {
|
|
286
|
+
const uniqueId = clip.elementId && fileIds.get(clip.file)?.get(clip.elementId) === 1;
|
|
287
|
+
const ref = uniqueId ? `#${clip.elementId}` : clip.hfId ? `hf:${clip.hfId}` : `${kind}/${index}`;
|
|
288
|
+
const warnings = uniqueId || clip.hfId ? [] : [
|
|
289
|
+
'row has no stable name; add id="<name>" to the element in this file, then retry with #<name>'
|
|
290
|
+
];
|
|
291
|
+
return {
|
|
292
|
+
...clip,
|
|
293
|
+
index,
|
|
294
|
+
ref,
|
|
295
|
+
warnings,
|
|
296
|
+
nested: host !== null,
|
|
297
|
+
host: host && host.id,
|
|
298
|
+
hostRow: host && at(host),
|
|
299
|
+
children: clip.children.map(at)
|
|
300
|
+
};
|
|
301
|
+
})
|
|
302
|
+
}));
|
|
303
|
+
}
|
|
304
|
+
function projectFps(source) {
|
|
305
|
+
const parsed = parseFpsWithDefault(readCompositionFps(source) ?? void 0);
|
|
306
|
+
return fpsToNumber(parsed.ok ? parsed.value : { num: 30, den: 1 });
|
|
307
|
+
}
|
|
308
|
+
async function describeProject(indexPath, measure = measureWithFfprobe, sourceOverrides = /* @__PURE__ */ new Map()) {
|
|
309
|
+
const projectDir = dirname(indexPath);
|
|
310
|
+
const source = sourceOverrides.get(basename(indexPath)) ?? readFileSync(indexPath, "utf-8");
|
|
311
|
+
const doc = new DOMParser().parseFromString(source, "text/html");
|
|
312
|
+
const root = doc.querySelector("[data-composition-id]") ?? doc.body;
|
|
313
|
+
const dir = projectDir;
|
|
314
|
+
const scope = {
|
|
315
|
+
doc,
|
|
316
|
+
dir,
|
|
317
|
+
startCache: /* @__PURE__ */ new Map(),
|
|
318
|
+
projectDir: dir,
|
|
319
|
+
origin: 0,
|
|
320
|
+
file: basename(indexPath),
|
|
321
|
+
withProbeSlot: createProbeGate(PROBE_CONCURRENCY),
|
|
322
|
+
measure,
|
|
323
|
+
sourceOverrides,
|
|
324
|
+
fps: projectFps(source)
|
|
325
|
+
};
|
|
326
|
+
const rows = (await Promise.all(topLevelElements(toNode(root)).map((node) => describeRow(scope, node, 0)))).sort(byStart);
|
|
327
|
+
const declared = parseNumeric(root.getAttribute("data-duration"));
|
|
328
|
+
return {
|
|
329
|
+
duration: declared ?? rows.reduce((max, r) => Math.max(max, r.end), 0),
|
|
330
|
+
tracks: flatten(rows)
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export {
|
|
335
|
+
describeProject
|
|
336
|
+
};
|
|
@@ -10,20 +10,20 @@ import {
|
|
|
10
10
|
seekCompositionTimeline,
|
|
11
11
|
waitForCompositionFonts,
|
|
12
12
|
waitForRuntimeReady
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ON2HYNGB.js";
|
|
14
14
|
import {
|
|
15
15
|
launchManagedBrowser,
|
|
16
16
|
resolveManagedGpuMode
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-B5FZ2CQM.js";
|
|
18
18
|
import {
|
|
19
19
|
resolveDiagnosticNavigationTimeoutMs
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-ERTJPFCH.js";
|
|
21
21
|
import {
|
|
22
22
|
resolveProject
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-WDUEIP22.js";
|
|
24
24
|
import {
|
|
25
25
|
serveStaticProjectHtml
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-RGYEL7QD.js";
|
|
27
27
|
import {
|
|
28
28
|
defineCommand
|
|
29
29
|
} from "./chunk-S3S4TGEH.js";
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
import {
|
|
38
38
|
printDeprecationNotice,
|
|
39
39
|
withMeta
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-7ZKEOQ5N.js";
|
|
41
41
|
import {
|
|
42
42
|
normalizeErrorMessage
|
|
43
43
|
} from "./chunk-KNU5COPB.js";
|
|
@@ -708,7 +708,7 @@ async function collectTweenBoundaries(page) {
|
|
|
708
708
|
});
|
|
709
709
|
}
|
|
710
710
|
async function bundleProjectHtml(projectDir) {
|
|
711
|
-
const { bundleToSingleHtml } = await import("./compiler-
|
|
711
|
+
const { bundleToSingleHtml } = await import("./compiler-57M6W5WY.js");
|
|
712
712
|
return bundleToSingleHtml(projectDir);
|
|
713
713
|
}
|
|
714
714
|
async function alignViewportToComposition(page, url) {
|
|
@@ -728,15 +728,15 @@ async function alignViewportToComposition(page, url) {
|
|
|
728
728
|
});
|
|
729
729
|
}
|
|
730
730
|
async function runLayoutAudit(projectDir, opts) {
|
|
731
|
-
const { ensureBrowser } = await import("./manager-
|
|
731
|
+
const { ensureBrowser } = await import("./manager-HEUPD2YB.js");
|
|
732
732
|
const puppeteer = await import("puppeteer-core");
|
|
733
|
-
const { buildChromeArgs } = await import("./src-
|
|
733
|
+
const { buildChromeArgs } = await import("./src-GPUDUKY6.js");
|
|
734
734
|
const {
|
|
735
735
|
assertWebGpuAdapterAvailable,
|
|
736
736
|
compositionRequiresWebGpu,
|
|
737
737
|
resolveLocalBrowserGpuMode,
|
|
738
738
|
resolveLocalWebGpu
|
|
739
|
-
} = await import("./gpuPolicy-
|
|
739
|
+
} = await import("./gpuPolicy-VGE3I5J4.js");
|
|
740
740
|
const html = await bundleProjectHtml(projectDir);
|
|
741
741
|
const server = await serveStaticProjectHtml(
|
|
742
742
|
projectDir,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from "./chunk-5ETJX6WM.js";
|
|
17
17
|
import {
|
|
18
18
|
runEnvironmentChecks
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-A2DMF2Q6.js";
|
|
20
20
|
import {
|
|
21
21
|
getAvailableMemoryMb,
|
|
22
22
|
getFreeDiskMb,
|
|
@@ -32,21 +32,21 @@ import {
|
|
|
32
32
|
import {
|
|
33
33
|
getUpdateMeta,
|
|
34
34
|
withMeta
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-7ZKEOQ5N.js";
|
|
36
36
|
import {
|
|
37
37
|
CONFIG_PATH,
|
|
38
38
|
withFileLock
|
|
39
39
|
} from "./chunk-XUXGIA7H.js";
|
|
40
40
|
import {
|
|
41
41
|
VERSION
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-WNXVPPMV.js";
|
|
43
43
|
import {
|
|
44
44
|
OPTIONAL_PACKAGES,
|
|
45
45
|
installedOptionalPackageVersion
|
|
46
46
|
} from "./chunk-3DKN5WKL.js";
|
|
47
47
|
import {
|
|
48
48
|
resolveExtractCacheDir
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-PLEMSN3E.js";
|
|
50
50
|
import {
|
|
51
51
|
normalizeErrorMessage
|
|
52
52
|
} from "./chunk-KNU5COPB.js";
|
|
@@ -232,7 +232,7 @@ function checkEnvironment() {
|
|
|
232
232
|
return { ok: true, detail: parts.join(" \xB7 ") };
|
|
233
233
|
}
|
|
234
234
|
async function checkWhisper() {
|
|
235
|
-
const { findWhisper, getInstallInstructions } = await import("./manager-
|
|
235
|
+
const { findWhisper, getInstallInstructions } = await import("./manager-B6MVBM2E.js");
|
|
236
236
|
const result = findWhisper();
|
|
237
237
|
if (result) {
|
|
238
238
|
return { ok: true, detail: result.executablePath };
|