hyperframes 0.8.142 → 0.8.143
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/{add-YS2RCWEK.js → add-Q5EYDUAY.js} +18 -17
- package/dist/{animatedGifPrep-SAMCDT7T.js → animatedGifPrep-H2DUQEZ3.js} +15 -14
- package/dist/{asset-BLWC2NWB.js → asset-C7JBYYX4.js} +4 -4
- package/dist/{assetCataloger-FVNBBRP3.js → assetCataloger-FRO4G6OU.js} +8 -7
- package/dist/{auth-DRZB7OAC.js → auth-FRWLCO36.js} +1 -1
- package/dist/{autoUpdate-I5I3BOJK.js → autoUpdate-E4OZXQK6.js} +2 -2
- package/dist/{backgroundChecks-VR2QHGNY.js → backgroundChecks-FSUVHN5L.js} +3 -3
- package/dist/backgroundChecksWorker.js +3 -3
- package/dist/{batchRender-4YUHQI6X.js → batchRender-4U73BYTU.js} +11 -10
- package/dist/{beats-7OT7ALV3.js → beats-U6KJWF35.js} +32 -27
- package/dist/{benchmark-Q2XQCRTR.js → benchmark-5ONT7V7B.js} +15 -14
- package/dist/{browser-7VAWQQZC.js → browser-R4DU46IE.js} +4 -4
- package/dist/{bundleWithLocalizedFonts-DDMLLL2R.js → bundleWithLocalizedFonts-VH55VOAL.js} +2 -2
- package/dist/{capture-HEJS6M5A.js → capture-26G2DPSI.js} +18 -17
- package/dist/{capture-U7ABPKS5.js → capture-OGQAEYKO.js} +2 -2
- package/dist/{catalog-DVJ3XPDN.js → catalog-RKORTIUE.js} +19 -18
- package/dist/{catch-up-DF6AVSN2.js → catch-up-4OBERRQO.js} +5 -5
- package/dist/{check-KXORRWAE.js → check-P2XDN57S.js} +43 -42
- package/dist/{checkBrowser-J7HZJTRH.js → checkBrowser-NTGJGAEA.js} +42 -41
- package/dist/{chunk-EFDXGAAD.js → chunk-2LBBHMKT.js} +1 -1
- package/dist/{chunk-IDX52YJN.js → chunk-33RZPZ4K.js} +189 -42
- package/dist/{chunk-JU6Y5TTZ.js → chunk-3NE7ZYU2.js} +2 -2
- package/dist/{chunk-TQFG7HTI.js → chunk-3RM2ETQT.js} +0 -168
- package/dist/{chunk-PFCFR3KZ.js → chunk-442JNXRM.js} +1 -1
- package/dist/{chunk-YFT3BL7N.js → chunk-4M4EC7JX.js} +19 -12
- package/dist/{chunk-AM5L5YIA.js → chunk-4OA4LDTU.js} +1 -1
- package/dist/{chunk-LQASVU3I.js → chunk-5FISWJ37.js} +12 -4
- package/dist/{chunk-JYYOAKHS.js → chunk-6IIGT7BX.js} +1 -1
- package/dist/chunk-6TPZSTCL.js +3681 -0
- package/dist/{chunk-QGRFOOLE.js → chunk-6XMFEICO.js} +263 -75
- package/dist/{chunk-YHRZQJXH.js → chunk-7UYBQ6NF.js} +260 -67
- package/dist/{chunk-U7E736AJ.js → chunk-BFDJ63J5.js} +32 -14
- package/dist/{chunk-WCJGTLPF.js → chunk-BHVFTYSI.js} +6 -3
- package/dist/{chunk-B6SMSALD.js → chunk-BT27OYYX.js} +9 -9
- package/dist/{chunk-IXCTG2WY.js → chunk-BYK73CR7.js} +4 -4
- package/dist/{chunk-75JJVANE.js → chunk-CLOH4LIB.js} +3 -3
- package/dist/{chunk-H2X52H2N.js → chunk-DF2BHILQ.js} +3 -3
- package/dist/{chunk-DPHJKWP5.js → chunk-F26LCYRY.js} +42 -34
- package/dist/{chunk-5Z63TBTX.js → chunk-FH7WODJH.js} +1 -1
- package/dist/{chunk-LTGGTEMA.js → chunk-FVYXDXEV.js} +2 -2
- package/dist/{chunk-KYN364DU.js → chunk-GNBGPUJ7.js} +6 -8
- package/dist/{chunk-RVCWIIZ7.js → chunk-GV5R5B7Q.js} +1 -1
- package/dist/{chunk-FZK35GT4.js → chunk-HC7EVDEL.js} +1 -1
- package/dist/{chunk-MVTUV4TP.js → chunk-HLYOEIWM.js} +14 -6
- package/dist/{chunk-WSGY5CDQ.js → chunk-HMT2RPZU.js} +6 -6
- package/dist/{chunk-JOTLPC6S.js → chunk-HW4AKJ5F.js} +1 -1
- package/dist/{chunk-IMY4QQTQ.js → chunk-I7QGQAZM.js} +8 -8
- package/dist/{chunk-JFKL3WAE.js → chunk-IWFLMU2N.js} +104 -19
- package/dist/{chunk-IHFUKJOR.js → chunk-K2FLNJVB.js} +8 -2
- package/dist/chunk-KJJLA674.js +121 -0
- package/dist/{chunk-BPZVDBHY.js → chunk-KO5QBV73.js} +1 -1
- package/dist/{chunk-WGVOWWVK.js → chunk-KQLGTGE5.js} +3 -3
- package/dist/{chunk-R2JEKLDZ.js → chunk-LVX6NK36.js} +3 -3
- package/dist/{chunk-6UYZB4TY.js → chunk-LW6HO6U3.js} +4 -4
- package/dist/{chunk-OZUQF4NB.js → chunk-MQZVBHEY.js} +123 -8
- package/dist/{chunk-7FCDA4RH.js → chunk-N3DQEVSI.js} +2 -2
- package/dist/{chunk-A4KQZXZI.js → chunk-NE55C6S5.js} +4 -2
- package/dist/{chunk-6RAD4BCC.js → chunk-OBXQRJWQ.js} +2 -2
- package/dist/{chunk-LBKDQKWV.js → chunk-OSSHSIMD.js} +1 -1
- package/dist/{chunk-TY6XOHEM.js → chunk-P7THMINS.js} +3 -3
- package/dist/{chunk-HMUF7FEO.js → chunk-PAGIICKN.js} +2 -2
- package/dist/{chunk-OSUKETIH.js → chunk-PJU63L6W.js} +1 -1
- package/dist/{chunk-GYE63V4P.js → chunk-POLR33RB.js} +20 -13
- package/dist/{chunk-7M4KAPAA.js → chunk-PUGIRFPX.js} +2 -2
- package/dist/{chunk-XGMNQQTJ.js → chunk-QFN7NVWM.js} +1 -1
- package/dist/{chunk-D2KNWIQ6.js → chunk-QFSCCQIR.js} +1 -1
- package/dist/{chunk-WTMUCJ6Z.js → chunk-QRKLPWEX.js} +1 -1
- package/dist/{chunk-XTLBLWOV.js → chunk-QVYVUCWD.js} +1 -1
- package/dist/{chunk-GK4AIFIH.js → chunk-SDYDNHEE.js} +34 -3
- package/dist/{chunk-2NCHQUPX.js → chunk-SQLK7SJL.js} +1 -1
- package/dist/{chunk-PMRBLBUP.js → chunk-T42U2W2R.js} +14 -2
- package/dist/{chunk-QXPCARFE.js → chunk-TAMQYQGJ.js} +1 -1
- package/dist/{chunk-PXSM4HPB.js → chunk-U3X3TPBW.js} +1 -1
- package/dist/{chunk-FWRNQOLT.js → chunk-UICWP23D.js} +1 -1
- package/dist/{chunk-OKCR3JTO.js → chunk-UM2GRYM3.js} +13 -10
- package/dist/{chunk-LJAU4TPS.js → chunk-VIVBA6E6.js} +2 -2
- package/dist/{chunk-DZEVA7DI.js → chunk-W35EKBS6.js} +2 -2
- package/dist/{chunk-YEIFI443.js → chunk-WPNE5NEP.js} +1 -1
- package/dist/{chunk-IW2CKH6A.js → chunk-XONFUK3M.js} +48 -25
- package/dist/{chunk-JLKMWY2T.js → chunk-Y6QL2LGO.js} +8 -5
- package/dist/{chunk-THXFSPLV.js → chunk-ZIRIDSDB.js} +1 -1
- package/dist/chunk-ZLW2V65P.js +209 -0
- package/dist/{chunk-6UM3R7PP.js → chunk-ZQQ3SEIE.js} +33 -32
- package/dist/{clean-KTHTV5G5.js → clean-YHGPY33K.js} +23 -22
- package/dist/cli.js +57 -159
- package/dist/{cloud-ARSZWALC.js → cloud-DOFI5ISR.js} +4 -4
- package/dist/{cloudrun-NM7RXOCL.js → cloudrun-KTZ4XDHL.js} +13 -12
- package/dist/commands/contrast-audit.browser.js +60 -4
- package/dist/commands/layout-audit.browser.js +68 -0
- package/dist/{compare-CY4UO3RW.js → compare-SMMIZN2C.js} +37 -36
- package/dist/{compiler-VTH2D3ID.js → compiler-TEXQWW6N.js} +14 -10
- package/dist/{component-FRUIAXIR.js → component-B3GCNGSS.js} +5 -5
- package/dist/{compositions-CUSY6ZYY.js → compositions-OQNZZTKF.js} +38 -33
- package/dist/{delete-KT3VHP4L.js → delete-EL5LVSEP.js} +4 -4
- package/dist/{deterministicFonts-F6WIVL2W.js → deterministicFonts-U2BIMGPG.js} +3 -3
- package/dist/{dist-7SZU7MA7.js → dist-5UVIRMSM.js} +7 -6
- package/dist/{dist-2GC6XKRQ.js → dist-XN234YFQ.js} +41 -39
- package/dist/{doctor-4ROTBL5U.js → doctor-UOL3OI2A.js} +17 -16
- package/dist/{dom-IROKGVJI.js → dom-37K6YOH4.js} +2 -2
- package/dist/{events-Q5PXT5UC.js → events-K2DB2PBC.js} +2 -2
- package/dist/{events-QJDVMKSR.js → events-NIZBS6S7.js} +3 -3
- package/dist/{feedback-PQ7TWESA.js → feedback-QMP4E6L7.js} +13 -12
- package/dist/{figma-JN5DDBDS.js → figma-2AUJRNVC.js} +3 -3
- package/dist/fontLocalizeCli.js +18 -17
- package/dist/{get-KT6OTERO.js → get-P5NC7SRM.js} +4 -4
- package/dist/{gpuPolicy-LCBWVGEH.js → gpuPolicy-7N5MCE2G.js} +15 -14
- package/dist/{grade-compare-VS3RP73G.js → grade-compare-HV5AFZ6P.js} +37 -36
- package/dist/{help-AD6FIZIO.js → help-3TSTXBLN.js} +1 -1
- package/dist/{history-ZRWYRY7R.js → history-D65XFJ6D.js} +6 -6
- package/dist/hyperframe-runtime.js +25 -25
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +25 -25
- package/dist/hyperframes-player.global.js +3 -3
- package/dist/hyperframes-slideshow.global.js +23 -23
- package/dist/{info-WBBQA2AX.js → info-TXV7MLFO.js} +17 -16
- package/dist/{init-A2XBDFGF.js → init-OSDMJZJV.js} +38 -37
- package/dist/{inspect-CLTZHA5O.js → inspect-RQQSAYIJ.js} +38 -37
- package/dist/{installer-WQDRVXH4.js → installer-CDOB32HE.js} +11 -10
- package/dist/{keyframes-3FYOK6H6.js → keyframes-V75Q6GRM.js} +10 -10
- package/dist/{lambda-Y2PA2BGS.js → lambda-RODV4RCX.js} +12 -11
- package/dist/{layout-4KP5O7IJ.js → layout-IZAI5SFC.js} +38 -37
- package/dist/{lint-V4GRFHOJ.js → lint-PLXOXY5R.js} +14 -13
- package/dist/{lintProject-RG2KGAXB.js → lintProject-OQ6H6XBR.js} +7 -6
- package/dist/{list-OQ4VED6E.js → list-BQBPNKDZ.js} +5 -5
- package/dist/{login-W47NKN5S.js → login-NP6F4FHC.js} +4 -4
- package/dist/{manager-DXB7JDHU.js → manager-GXYF4AVO.js} +2 -2
- package/dist/{manager-524RPYO7.js → manager-RFZNG5YT.js} +2 -2
- package/dist/{media-treatment-HJYL3EME.js → media-treatment-PXGMZ4A4.js} +22 -20
- package/dist/{models-DYBAD2GQ.js → models-CEZM6XZ7.js} +17 -16
- package/dist/{motionShot-7NE2YBB3.js → motionShot-R4GHYWYM.js} +25 -24
- package/dist/{normalize-IGLHCWTF.js → normalize-H6KUHHEI.js} +18 -7
- package/dist/{normalize-audio-INKCLMS2.js → normalize-audio-MQ7NFCOV.js} +10 -6
- package/dist/{open-TYC5THVY.js → open-AKQTGNXF.js} +5 -5
- package/dist/{pipeline-EVKEPQEW.js → pipeline-SYJYP2RM.js} +17 -16
- package/dist/{play-QMZEM6X3.js → play-NBH4B7PL.js} +31 -29
- package/dist/{present-Y7IK3C4W.js → present-XAX55CFS.js} +26 -25
- package/dist/{preview-5OQRYE6A.js → preview-OLANKNFA.js} +26 -25
- package/dist/{producer-Q6G6JU7B.js → producer-Q6YNZZUJ.js} +1 -1
- package/dist/{projectConfig-RJN3DKDB.js → projectConfig-EM26P45P.js} +13 -12
- package/dist/{publication-QCPGGN3U.js → publication-OXWJZKSX.js} +8 -7
- package/dist/{publish-VZLFIGYY.js → publish-4VBWP2UB.js} +17 -16
- package/dist/{remove-background-TKOEHBA5.js → remove-background-REB7427G.js} +19 -18
- package/dist/{render-XTXE5CRU.js → render-3CVZ2SZG.js} +13 -12
- package/dist/{render-KIIIF6PS.js → render-K25YOG3M.js} +19 -18
- package/dist/{render-X3NFNVEQ.js → render-TSE75QUL.js} +35 -34
- package/dist/{render-batch-M55YZLZ5.js → render-batch-GGUOK3DS.js} +13 -12
- package/dist/{renderCancellation-X5BEHAZU.js → renderCancellation-PZRWB53I.js} +15 -14
- package/dist/renderSetupWorker.js +7 -6
- package/dist/{resolver-GAMXRA42.js → resolver-S5VK6UCB.js} +10 -9
- package/dist/{sherpa-ZYTNFHD5.js → sherpa-LVIUEAGF.js} +18 -17
- package/dist/skills/hyperframes-cli/references/doctor-browser.md +24 -1
- package/dist/skills/media-use/scripts/lib/cache.mjs +28 -14
- package/dist/skills/media-use/scripts/lib/cache.test.mjs +110 -0
- package/dist/skills/media-use/scripts/lib/duck.mjs +2 -1
- package/dist/skills/media-use/scripts/lib/duck.test.mjs +87 -0
- package/dist/skills/media-use/scripts/lib/probe.mjs +6 -1
- package/dist/skills/media-use/scripts/lib/probe.test.mjs +73 -0
- package/dist/skills/media-use/scripts/lib/words.mjs +1 -1
- package/dist/{skills-CZHVAD3J.js → skills-I65FU5HD.js} +5 -5
- package/dist/{skillsUpdateCheck-6WLLX53A.js → skillsUpdateCheck-J57RNNIV.js} +3 -3
- package/dist/{slideshow-EJ4IMY6P.js → slideshow-4OJEPWNZ.js} +1 -1
- package/dist/{snapshot-K7BTJPYQ.js → snapshot-YROOGY22.js} +42 -38
- package/dist/{src-3I3RH3V5.js → src-JO5JOV7Y.js} +16 -13
- package/dist/{src-YUW26JU5.js → src-X426BZAG.js} +17 -16
- package/dist/{staticProjectServer-IKCSGN2B.js → staticProjectServer-5VMBS262.js} +23 -22
- package/dist/studio/assets/{hyperframes-player-sAsRuV73.js → hyperframes-player-BXSuksFh.js} +3 -3
- package/dist/studio/assets/{index-D3Vij9t1.js → index-BgOVCqjo.js} +1 -1
- package/dist/studio/assets/{index-D5q2_7Gw.js → index-FgyO_5Kv.js} +1 -1
- package/dist/studio/assets/{index-B-wffzRH.js → index-J7jpL4pj.js} +150 -150
- package/dist/studio/index.html +1 -1
- package/dist/studio/index.js +122 -160
- package/dist/studio/index.js.map +1 -1
- package/dist/{studio-api-SQ3NXFSM.js → studio-api-VRBZUGAE.js} +22 -17
- package/dist/{studioServer-VVEO7XCH.js → studioServer-DBNKZ6I6.js} +50 -49
- package/dist/{synthesize-77PTU6C5.js → synthesize-C3IWDAXF.js} +2 -2
- package/dist/{telemetry-FQDKR5XA.js → telemetry-CXAX3TO3.js} +3 -3
- package/dist/{timeline-N6ZASFNE.js → timeline-VQ34WH7J.js} +91 -69
- package/dist/{tokens-2OIIBBCW.js → tokens-62R7VFAZ.js} +4 -4
- package/dist/{transcribe-4F6MK73N.js → transcribe-7KR7IPJA.js} +18 -17
- package/dist/{transcribe-7YTUCXDX.js → transcribe-XOHPPL2O.js} +11 -11
- package/dist/{tts-TOHSPWEG.js → tts-MUV42JXT.js} +6 -6
- package/dist/{updateCheck-AZ2COZFR.js → updateCheck-POYNH3B5.js} +2 -2
- package/dist/{upgrade-QAJEYB4X.js → upgrade-NBNOT7J2.js} +2 -2
- package/dist/{urlDownloader-LSMFEO3R.js → urlDownloader-3NS63A7B.js} +14 -13
- package/dist/{validate-GW5MDL36.js → validate-Y2QDHAEP.js} +40 -27
- package/dist/{video-PRNOKUK3.js → video-SJDMTSTL.js} +15 -14
- package/package.json +1 -1
- package/dist/chunk-J4UX3RS3.js +0 -3717
- /package/dist/{chunk-HBBJFK6I.js → chunk-APDLWWFG.js} +0 -0
package/dist/studio/index.html
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
document.documentElement.dataset.theme = "paper";
|
|
15
15
|
}
|
|
16
16
|
</script>
|
|
17
|
-
<script type="module" crossorigin src="/assets/index-
|
|
17
|
+
<script type="module" crossorigin src="/assets/index-J7jpL4pj.js"></script>
|
|
18
18
|
<link rel="stylesheet" crossorigin href="/assets/index-CVd4O6eH.css">
|
|
19
19
|
</head>
|
|
20
20
|
<body>
|
package/dist/studio/index.js
CHANGED
|
@@ -3597,6 +3597,7 @@ function useTimelineZoom() {
|
|
|
3597
3597
|
import { useCallback as useCallback5, useEffect as useEffect6, useRef as useRef6, useState as useState4 } from "react";
|
|
3598
3598
|
|
|
3599
3599
|
// src/utils/timelineAssetDrop.ts
|
|
3600
|
+
import { encodeUrlPath } from "@hyperframes/parsers";
|
|
3600
3601
|
import { buildTimelineAssetId } from "@hyperframes/core/timeline-asset-id";
|
|
3601
3602
|
|
|
3602
3603
|
// src/utils/mediaTypes.ts
|
|
@@ -3701,7 +3702,7 @@ function fitTimelineAssetGeometry(natural, comp) {
|
|
|
3701
3702
|
};
|
|
3702
3703
|
}
|
|
3703
3704
|
function buildTimelineAssetInsertHtml(input) {
|
|
3704
|
-
const sharedAttrs = `id="${input.id}" data-hf-id="${input.hfId}" class="clip" src="${input.assetPath}" data-start="${input.start}" data-duration="${input.duration}" data-track-index="${input.track}"`;
|
|
3705
|
+
const sharedAttrs = `id="${input.id}" data-hf-id="${input.hfId}" class="clip" src="${encodeUrlPath(input.assetPath)}" data-start="${input.start}" data-duration="${input.duration}" data-track-index="${input.track}"`;
|
|
3705
3706
|
const geometry = input.geometry ?? { left: 0, top: 0, width: 640, height: 360 };
|
|
3706
3707
|
const visualStyles = `position: absolute; left: ${geometry.left}px; top: ${geometry.top}px; width: ${geometry.width}px; height: ${geometry.height}px; object-fit: contain; z-index: ${input.zIndex}`;
|
|
3707
3708
|
if (input.kind === "image") {
|
|
@@ -17143,17 +17144,41 @@ function useOwnPreviewIframe() {
|
|
|
17143
17144
|
import { isHtmlElement as isHtmlElement4 } from "@hyperframes/core/runtime/dom-realm";
|
|
17144
17145
|
|
|
17145
17146
|
// src/utils/sourcePatcher.ts
|
|
17147
|
+
import {
|
|
17148
|
+
scanHtmlOpeningTags,
|
|
17149
|
+
decodeAuthoredAttribute,
|
|
17150
|
+
HTML_ATTRIBUTE_ENTITIES
|
|
17151
|
+
} from "@hyperframes/parsers";
|
|
17146
17152
|
function escapeRegex(s) {
|
|
17147
17153
|
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
17148
17154
|
}
|
|
17155
|
+
function tagAttribute(tag, name) {
|
|
17156
|
+
return scanHtmlOpeningTags(tag)[0]?.attributes.find((attr) => attr.name === name.toLowerCase());
|
|
17157
|
+
}
|
|
17158
|
+
function patchTagAttribute(tag, name, edit) {
|
|
17159
|
+
if (edit.kind === "remove") {
|
|
17160
|
+
const attributes = scanHtmlOpeningTags(tag)[0]?.attributes.filter((attr2) => attr2.name === name.toLowerCase()) ?? [];
|
|
17161
|
+
const parts = [];
|
|
17162
|
+
let cursor = 0;
|
|
17163
|
+
for (const attribute of attributes) {
|
|
17164
|
+
let start = attribute.start;
|
|
17165
|
+
while (start > cursor && /[\t\n\f\r ]/.test(tag[start - 1])) start--;
|
|
17166
|
+
parts.push(tag.slice(cursor, start));
|
|
17167
|
+
cursor = attribute.end;
|
|
17168
|
+
}
|
|
17169
|
+
parts.push(tag.slice(cursor));
|
|
17170
|
+
return parts.join("");
|
|
17171
|
+
}
|
|
17172
|
+
const attr = tagAttribute(tag, name);
|
|
17173
|
+
const replacement = edit.kind === "boolean" ? name : `${name}="${escapeHtmlAttribute(edit.value)}"`;
|
|
17174
|
+
if (attr) return tag.slice(0, attr.start) + replacement + tag.slice(attr.end);
|
|
17175
|
+
return tag.endsWith("/") ? `${tag.slice(0, -1).trimEnd()} ${replacement} /` : `${tag} ${replacement}`;
|
|
17176
|
+
}
|
|
17149
17177
|
function escapeStyleAttributeValue(value, quote) {
|
|
17150
17178
|
return quote === '"' ? value.replace(/"/g, """) : value.replace(/'/g, "'");
|
|
17151
17179
|
}
|
|
17152
17180
|
function escapeHtmlAttribute(value) {
|
|
17153
|
-
return value.replace(
|
|
17154
|
-
}
|
|
17155
|
-
function unescapeHtmlAttribute(value) {
|
|
17156
|
-
return value.replace(/"/g, '"').replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&");
|
|
17181
|
+
return value.replace(/[&"<>]/g, (char) => HTML_ATTRIBUTE_ENTITIES[char][0]);
|
|
17157
17182
|
}
|
|
17158
17183
|
function splitInlineStyleDeclarations(style) {
|
|
17159
17184
|
const declarations = [];
|
|
@@ -17206,7 +17231,7 @@ function resolveSourceFile(elementId2, selector, files) {
|
|
|
17206
17231
|
if (!elementId2 && !selector) return null;
|
|
17207
17232
|
if (elementId2) {
|
|
17208
17233
|
for (const [path, content] of Object.entries(files)) {
|
|
17209
|
-
if (content
|
|
17234
|
+
if (findTagByAttribute(content, "id", elementId2)) {
|
|
17210
17235
|
return path;
|
|
17211
17236
|
}
|
|
17212
17237
|
}
|
|
@@ -17215,7 +17240,7 @@ function resolveSourceFile(elementId2, selector, files) {
|
|
|
17215
17240
|
if (compIdMatch) {
|
|
17216
17241
|
const compId = compIdMatch[1];
|
|
17217
17242
|
for (const [path, content] of Object.entries(files)) {
|
|
17218
|
-
if (content
|
|
17243
|
+
if (findTagByAttribute(content, "data-composition-id", compId)) {
|
|
17219
17244
|
return path;
|
|
17220
17245
|
}
|
|
17221
17246
|
}
|
|
@@ -17224,7 +17249,7 @@ function resolveSourceFile(elementId2, selector, files) {
|
|
|
17224
17249
|
if (classMatch) {
|
|
17225
17250
|
const cls = classMatch[1];
|
|
17226
17251
|
for (const [path, content] of Object.entries(files)) {
|
|
17227
|
-
if (content
|
|
17252
|
+
if (findTagByClass(content, { selector: `.${cls}` })) {
|
|
17228
17253
|
return path;
|
|
17229
17254
|
}
|
|
17230
17255
|
}
|
|
@@ -17233,18 +17258,14 @@ function resolveSourceFile(elementId2, selector, files) {
|
|
|
17233
17258
|
return null;
|
|
17234
17259
|
}
|
|
17235
17260
|
function patchInlineStyle(html2, elementId2, prop, value) {
|
|
17236
|
-
|
|
17237
|
-
|
|
17238
|
-
|
|
17239
|
-
|
|
17240
|
-
|
|
17241
|
-
|
|
17242
|
-
|
|
17243
|
-
|
|
17244
|
-
const styleMatch = /\bstyle=(")([^"]*)"|\bstyle=(')([^']*)'/.exec(tag);
|
|
17245
|
-
if (styleMatch) {
|
|
17246
|
-
const existingStyle = styleMatch[2] ?? styleMatch[4];
|
|
17247
|
-
const quote = styleMatch[1] ?? styleMatch[3];
|
|
17261
|
+
return patchInlineStyleByTarget(html2, { id: elementId2 }, prop, value);
|
|
17262
|
+
}
|
|
17263
|
+
function patchInlineStyleInTag(tag, prop, value) {
|
|
17264
|
+
if (!tag) return tag;
|
|
17265
|
+
const styleMatch = tagAttribute(tag, "style");
|
|
17266
|
+
if (styleMatch?.kind === "value") {
|
|
17267
|
+
const existingStyle = styleMatch.value;
|
|
17268
|
+
const quote = styleMatch.quote || '"';
|
|
17248
17269
|
const props = /* @__PURE__ */ new Map();
|
|
17249
17270
|
for (const part of splitInlineStyleDeclarations(existingStyle)) {
|
|
17250
17271
|
const colon = part.indexOf(":");
|
|
@@ -17259,67 +17280,54 @@ function patchInlineStyleInTag(html2, tag, prop, value) {
|
|
|
17259
17280
|
props.set(prop, value);
|
|
17260
17281
|
}
|
|
17261
17282
|
const newStyle = Array.from(props.entries()).map(([k, v]) => `${k}: ${escapeStyleAttributeValue(v, quote)}`).join("; ");
|
|
17262
|
-
const newTag = tag.
|
|
17263
|
-
return
|
|
17283
|
+
const newTag = tag.slice(0, styleMatch.start) + `style=${quote}${newStyle}${quote}` + tag.slice(styleMatch.end);
|
|
17284
|
+
return newTag;
|
|
17264
17285
|
} else {
|
|
17265
|
-
if (value === null) return
|
|
17286
|
+
if (value === null) return tag;
|
|
17266
17287
|
const selfClosing = tag.endsWith("/");
|
|
17267
17288
|
const base2 = selfClosing ? tag.slice(0, -1).trimEnd() : tag;
|
|
17268
17289
|
const newTag = `${base2} style="${prop}: ${escapeStyleAttributeValue(value, '"')}"${selfClosing ? " /" : ""}`;
|
|
17269
|
-
return
|
|
17290
|
+
return newTag;
|
|
17270
17291
|
}
|
|
17271
17292
|
}
|
|
17272
17293
|
function patchInlineStyleByTarget(html2, target, prop, value) {
|
|
17273
17294
|
const match = findTagByTarget(html2, target);
|
|
17274
17295
|
if (!match) return html2;
|
|
17275
|
-
const newTag = patchInlineStyleInTag(match.tag,
|
|
17296
|
+
const newTag = patchInlineStyleInTag(match.tag, prop, value);
|
|
17276
17297
|
return replaceTagAtMatch(html2, match, newTag);
|
|
17277
17298
|
}
|
|
17278
17299
|
function replaceTagAtMatch(html2, match, newTag) {
|
|
17279
17300
|
return `${html2.slice(0, match.start)}${newTag}${html2.slice(match.end)}`;
|
|
17280
17301
|
}
|
|
17281
|
-
function
|
|
17282
|
-
const
|
|
17283
|
-
|
|
17284
|
-
|
|
17285
|
-
|
|
17302
|
+
function findTagByAttribute(html2, name, value) {
|
|
17303
|
+
const found = scanHtmlOpeningTags(html2).find((tag) => {
|
|
17304
|
+
const attr = tag.attributes.find((attr2) => attr2.name === name);
|
|
17305
|
+
return tag.closed && attr?.kind === "value" && decodeAuthoredAttribute(attr.value) === value;
|
|
17306
|
+
});
|
|
17307
|
+
return found ? { tag: html2.slice(found.start, found.bodyEnd), start: found.start, end: found.bodyEnd } : null;
|
|
17286
17308
|
}
|
|
17287
17309
|
function findTagByClass(html2, target) {
|
|
17288
17310
|
const classMatch = target.selector?.match(/^\.([a-zA-Z0-9_-]+)$/);
|
|
17289
17311
|
if (!classMatch) return null;
|
|
17290
|
-
const
|
|
17291
|
-
|
|
17292
|
-
|
|
17293
|
-
|
|
17294
|
-
);
|
|
17295
|
-
const selectorIndex = target.selectorIndex ?? 0;
|
|
17296
|
-
let match;
|
|
17297
|
-
let currentIndex = 0;
|
|
17298
|
-
while ((match = pattern.exec(html2)) !== null) {
|
|
17299
|
-
if (currentIndex === selectorIndex && match.index != null) {
|
|
17300
|
-
return {
|
|
17301
|
-
tag: match[1],
|
|
17302
|
-
start: match.index,
|
|
17303
|
-
end: match.index + match[1].length
|
|
17304
|
-
};
|
|
17305
|
-
}
|
|
17306
|
-
currentIndex += 1;
|
|
17307
|
-
}
|
|
17308
|
-
return null;
|
|
17312
|
+
const found = scanHtmlOpeningTags(html2).filter((tag) => {
|
|
17313
|
+
const attr = tag.attributes.find((attr2) => attr2.name === "class");
|
|
17314
|
+
return tag.closed && attr?.kind === "value" && decodeAuthoredAttribute(attr.value).split(/\s+/).includes(classMatch[1]);
|
|
17315
|
+
})[target.selectorIndex ?? 0];
|
|
17316
|
+
return found ? { tag: html2.slice(found.start, found.bodyEnd), start: found.start, end: found.bodyEnd } : null;
|
|
17309
17317
|
}
|
|
17310
17318
|
function findTagByTarget(html2, target) {
|
|
17311
17319
|
if (target.hfId) {
|
|
17312
|
-
const result =
|
|
17320
|
+
const result = findTagByAttribute(html2, "data-hf-id", target.hfId);
|
|
17313
17321
|
if (result) return result;
|
|
17314
17322
|
}
|
|
17315
17323
|
if (target.id) {
|
|
17316
|
-
const result =
|
|
17324
|
+
const result = findTagByAttribute(html2, "id", target.id);
|
|
17317
17325
|
if (result) return result;
|
|
17318
17326
|
}
|
|
17319
17327
|
if (!target.selector) return null;
|
|
17320
17328
|
const compositionIdMatch = target.selector.match(/^\[data-composition-id="([^"]+)"\]$/);
|
|
17321
17329
|
if (compositionIdMatch) {
|
|
17322
|
-
const result =
|
|
17330
|
+
const result = findTagByAttribute(html2, "data-composition-id", compositionIdMatch[1]);
|
|
17323
17331
|
if (result) return result;
|
|
17324
17332
|
}
|
|
17325
17333
|
return findTagByClass(html2, target);
|
|
@@ -17327,9 +17335,11 @@ function findTagByTarget(html2, target) {
|
|
|
17327
17335
|
function readAttributeByTarget(html2, target, attr) {
|
|
17328
17336
|
const match = findTagByTarget(html2, target);
|
|
17329
17337
|
if (!match) return void 0;
|
|
17330
|
-
|
|
17331
|
-
|
|
17332
|
-
|
|
17338
|
+
return readTagAttribute(match.tag, attr.startsWith("data-") ? attr : `data-${attr}`);
|
|
17339
|
+
}
|
|
17340
|
+
function readTagAttribute(tag, attr) {
|
|
17341
|
+
const value = tagAttribute(tag, attr);
|
|
17342
|
+
return value?.kind === "value" ? decodeAuthoredAttribute(value.value) : void 0;
|
|
17333
17343
|
}
|
|
17334
17344
|
function readTagSnippetByTarget(html2, target) {
|
|
17335
17345
|
const match = findTagByTarget(html2, target);
|
|
@@ -17338,60 +17348,15 @@ function readTagSnippetByTarget(html2, target) {
|
|
|
17338
17348
|
function patchAttributeByTarget(html2, target, attr, value) {
|
|
17339
17349
|
const match = findTagByTarget(html2, target);
|
|
17340
17350
|
if (!match) return html2;
|
|
17341
|
-
const
|
|
17342
|
-
const
|
|
17343
|
-
|
|
17344
|
-
if (value === null) {
|
|
17345
|
-
const boolAttrPattern = new RegExp(`\\b${escapeRegex(fullAttr)}(?:=(["'])[^"']*\\1)?`);
|
|
17346
|
-
if (!boolAttrPattern.test(tag)) return html2;
|
|
17347
|
-
const removePattern = new RegExp(`\\s+${escapeRegex(fullAttr)}(?:=(["'])[^"']*\\1)?`);
|
|
17348
|
-
const newTag2 = tag.replace(removePattern, "");
|
|
17349
|
-
return replaceTagAtMatch(html2, match, newTag2);
|
|
17350
|
-
}
|
|
17351
|
-
const escaped = escapeHtmlAttribute(value);
|
|
17352
|
-
if (attrPattern.test(tag)) {
|
|
17353
|
-
const newTag2 = tag.replace(attrPattern, `${fullAttr}="${escaped}"`);
|
|
17354
|
-
return replaceTagAtMatch(html2, match, newTag2);
|
|
17355
|
-
}
|
|
17356
|
-
const newTag = tag + ` ${fullAttr}="${escaped}"`;
|
|
17357
|
-
return replaceTagAtMatch(html2, match, newTag);
|
|
17351
|
+
const name = attr.startsWith("data-") ? attr : `data-${attr}`;
|
|
17352
|
+
const edit = value === null ? { kind: "remove" } : { kind: "value", value };
|
|
17353
|
+
return replaceTagAtMatch(html2, match, patchTagAttribute(match.tag, name, edit));
|
|
17358
17354
|
}
|
|
17359
17355
|
function patchAttribute(html2, elementId2, attr, value) {
|
|
17360
|
-
|
|
17361
|
-
const match = idPattern.exec(html2);
|
|
17362
|
-
if (!match) return html2;
|
|
17363
|
-
const tag = match[1];
|
|
17364
|
-
const fullAttr = attr.startsWith("data-") ? attr : `data-${attr}`;
|
|
17365
|
-
const attrPattern = new RegExp(`\\b${escapeRegex(fullAttr)}=(["'])([^"']*)\\1`);
|
|
17366
|
-
if (value === null) {
|
|
17367
|
-
const boolAttrPattern = new RegExp(`\\b${escapeRegex(fullAttr)}(?:=(["'])[^"']*\\1)?`);
|
|
17368
|
-
if (!boolAttrPattern.test(tag)) return html2;
|
|
17369
|
-
const removePattern = new RegExp(`\\s+${escapeRegex(fullAttr)}(?:=(["'])[^"']*\\1)?`);
|
|
17370
|
-
const newTag = tag.replace(removePattern, "");
|
|
17371
|
-
return html2.replace(tag, newTag);
|
|
17372
|
-
}
|
|
17373
|
-
const escaped = escapeHtmlAttribute(value);
|
|
17374
|
-
if (attrPattern.test(tag)) {
|
|
17375
|
-
const newTag = tag.replace(attrPattern, `${fullAttr}="${escaped}"`);
|
|
17376
|
-
return html2.replace(tag, newTag);
|
|
17377
|
-
} else {
|
|
17378
|
-
const newTag = tag + ` ${fullAttr}="${escaped}"`;
|
|
17379
|
-
return html2.replace(tag, newTag);
|
|
17380
|
-
}
|
|
17356
|
+
return patchAttributeByTarget(html2, { id: elementId2 }, attr, value);
|
|
17381
17357
|
}
|
|
17382
17358
|
function patchTextContent(html2, elementId2, value) {
|
|
17383
|
-
|
|
17384
|
-
`(<([a-z0-9-]+)[^>]*\\bid=(["'])${escapeRegex(elementId2)}\\3[^>]*>)`,
|
|
17385
|
-
"i"
|
|
17386
|
-
);
|
|
17387
|
-
const match = openTagPattern.exec(html2);
|
|
17388
|
-
if (!match || match.index == null) return html2;
|
|
17389
|
-
const openingTag = match[1];
|
|
17390
|
-
const tagName = match[2];
|
|
17391
|
-
const contentStart = match.index + openingTag.length;
|
|
17392
|
-
const closingIndex = findMatchingClosingTagIndex(html2, tagName, contentStart);
|
|
17393
|
-
if (closingIndex < 0) return html2;
|
|
17394
|
-
return `${html2.slice(0, contentStart)}${value}${html2.slice(closingIndex)}`;
|
|
17359
|
+
return patchTextContentByTarget(html2, { id: elementId2 }, value);
|
|
17395
17360
|
}
|
|
17396
17361
|
function findMatchingClosingTagIndex(html2, tagName, contentStart) {
|
|
17397
17362
|
const tagPattern = new RegExp(`</?${escapeRegex(tagName)}\\b[^>]*>`, "gi");
|
|
@@ -17426,47 +17391,26 @@ var HTML_BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
|
17426
17391
|
"reversed",
|
|
17427
17392
|
"selected"
|
|
17428
17393
|
]);
|
|
17429
|
-
function patchHtmlAttributeInTag(
|
|
17430
|
-
if (!tag) return
|
|
17431
|
-
|
|
17432
|
-
if (
|
|
17433
|
-
|
|
17434
|
-
|
|
17435
|
-
|
|
17436
|
-
|
|
17437
|
-
|
|
17438
|
-
|
|
17439
|
-
|
|
17440
|
-
|
|
17441
|
-
if (hasBoolAttr) return html2;
|
|
17442
|
-
const newTag2 = tag + ` ${attr}`;
|
|
17443
|
-
return html2.replace(tag, newTag2);
|
|
17444
|
-
}
|
|
17445
|
-
const attrPattern = new RegExp(`\\b${escapeRegex(attr)}=(["'])([^"']*)\\1`);
|
|
17446
|
-
if (value === null) {
|
|
17447
|
-
if (!attrPattern.test(tag)) return html2;
|
|
17448
|
-
const removePattern = new RegExp(`\\s+${escapeRegex(attr)}=(["'])[^"']*\\1`);
|
|
17449
|
-
const newTag2 = tag.replace(removePattern, "");
|
|
17450
|
-
return html2.replace(tag, newTag2);
|
|
17451
|
-
}
|
|
17452
|
-
const escaped = escapeHtmlAttribute(value);
|
|
17453
|
-
if (attrPattern.test(tag)) {
|
|
17454
|
-
const newTag2 = tag.replace(attrPattern, `${attr}="${escaped}"`);
|
|
17455
|
-
return html2.replace(tag, newTag2);
|
|
17456
|
-
}
|
|
17457
|
-
const newTag = tag + ` ${attr}="${escaped}"`;
|
|
17458
|
-
return html2.replace(tag, newTag);
|
|
17394
|
+
function patchHtmlAttributeInTag(tag, attr, value) {
|
|
17395
|
+
if (!tag) return tag;
|
|
17396
|
+
let edit;
|
|
17397
|
+
if (HTML_BOOLEAN_ATTRIBUTES.has(attr)) {
|
|
17398
|
+
if (value === null || value === "" || value === "false") edit = { kind: "remove" };
|
|
17399
|
+
else {
|
|
17400
|
+
if (tagAttribute(tag, attr)) return tag;
|
|
17401
|
+
edit = { kind: "boolean" };
|
|
17402
|
+
}
|
|
17403
|
+
} else edit = value === null ? { kind: "remove" } : { kind: "value", value };
|
|
17404
|
+
const newTag = patchTagAttribute(tag, attr, edit);
|
|
17405
|
+
return newTag;
|
|
17459
17406
|
}
|
|
17460
17407
|
function patchHtmlAttribute(html2, elementId2, attr, value) {
|
|
17461
|
-
|
|
17462
|
-
const match = idPattern.exec(html2);
|
|
17463
|
-
if (!match) return html2;
|
|
17464
|
-
return patchHtmlAttributeInTag(html2, match[1], attr, value);
|
|
17408
|
+
return patchHtmlAttributeByTarget(html2, { id: elementId2 }, attr, value);
|
|
17465
17409
|
}
|
|
17466
17410
|
function patchHtmlAttributeByTarget(html2, target, attr, value) {
|
|
17467
17411
|
const match = findTagByTarget(html2, target);
|
|
17468
17412
|
if (!match) return html2;
|
|
17469
|
-
const newTag = patchHtmlAttributeInTag(match.tag,
|
|
17413
|
+
const newTag = patchHtmlAttributeInTag(match.tag, attr, value);
|
|
17470
17414
|
return replaceTagAtMatch(html2, match, newTag);
|
|
17471
17415
|
}
|
|
17472
17416
|
function patchTextContentByTarget(html2, target, value) {
|
|
@@ -21837,6 +21781,7 @@ import {
|
|
|
21837
21781
|
} from "@hyperframes/core/audio-automation";
|
|
21838
21782
|
|
|
21839
21783
|
// src/utils/studioHelpers.ts
|
|
21784
|
+
import { encodeUrlPath as encodeUrlPath2 } from "@hyperframes/parsers";
|
|
21840
21785
|
function getTimelineElementLabel(element) {
|
|
21841
21786
|
return element.label || element.id || element.tag;
|
|
21842
21787
|
}
|
|
@@ -21991,7 +21936,7 @@ async function resolveDroppedAssetDuration(projectId, assetPath, kind) {
|
|
|
21991
21936
|
if (kind === "image") return DEFAULT_TIMELINE_ASSET_DURATION.image;
|
|
21992
21937
|
const media = document.createElement(kind === "video" ? "video" : "audio");
|
|
21993
21938
|
media.preload = "metadata";
|
|
21994
|
-
media.src = buildProjectApiPath(projectId, `/preview/${assetPath}`);
|
|
21939
|
+
media.src = buildProjectApiPath(projectId, `/preview/${encodeUrlPath2(assetPath)}`);
|
|
21995
21940
|
const duration = await new Promise((resolve) => {
|
|
21996
21941
|
const timeout = window.setTimeout(() => resolve(DEFAULT_TIMELINE_ASSET_DURATION[kind]), 3e3);
|
|
21997
21942
|
const finalize = (value) => {
|
|
@@ -25307,6 +25252,7 @@ function isPeakMap(value) {
|
|
|
25307
25252
|
}
|
|
25308
25253
|
|
|
25309
25254
|
// src/player/components/thumbnailUtils.ts
|
|
25255
|
+
import { decodedUrlPath } from "@hyperframes/parsers";
|
|
25310
25256
|
function quantizeThumbnailFrameCount(frameCount) {
|
|
25311
25257
|
const safeCount = Math.max(1, Number.isFinite(frameCount) ? Math.ceil(frameCount) : 1);
|
|
25312
25258
|
const cap = 2 ** Math.floor(Math.log2(MAX_VISIBLE_THUMBNAIL_FRAMES));
|
|
@@ -25357,6 +25303,9 @@ function computeThumbnailStrip(containerWidth, aspect, clipHeight, minFrameWidth
|
|
|
25357
25303
|
const frameCount = measured ? Math.max(1, Math.ceil(containerWidth / frameW)) : 1;
|
|
25358
25304
|
return { frameW, frameCount };
|
|
25359
25305
|
}
|
|
25306
|
+
function authoredSrcPath(src) {
|
|
25307
|
+
return /^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(src) ? src : decodedUrlPath(src);
|
|
25308
|
+
}
|
|
25360
25309
|
function encodePreviewPath(relativePath) {
|
|
25361
25310
|
return relativePath.split("/").map(encodeURIComponent).join("/");
|
|
25362
25311
|
}
|
|
@@ -25401,7 +25350,7 @@ function loadPeakMap(url) {
|
|
|
25401
25350
|
function clipPeaksUrl(src, projectId) {
|
|
25402
25351
|
const origin2 = window.location.origin;
|
|
25403
25352
|
const relative = resolvePreviewRelative(
|
|
25404
|
-
resolveMediaPreviewUrl(src ?? "", projectId, origin2),
|
|
25353
|
+
resolveMediaPreviewUrl(authoredSrcPath(src ?? ""), projectId, origin2),
|
|
25405
25354
|
projectId,
|
|
25406
25355
|
origin2
|
|
25407
25356
|
);
|
|
@@ -25472,7 +25421,7 @@ function isNormalizePlan(value) {
|
|
|
25472
25421
|
async function requestNormalizePlan(projectId, el, fetchImpl = studioApiFetch) {
|
|
25473
25422
|
const origin2 = window.location.origin;
|
|
25474
25423
|
const relative = resolvePreviewRelative(
|
|
25475
|
-
resolveMediaPreviewUrl(el.src ?? "", projectId, origin2),
|
|
25424
|
+
resolveMediaPreviewUrl(authoredSrcPath(el.src ?? ""), projectId, origin2),
|
|
25476
25425
|
projectId,
|
|
25477
25426
|
origin2
|
|
25478
25427
|
);
|
|
@@ -26986,10 +26935,10 @@ function formatAttrs(attrs) {
|
|
|
26986
26935
|
function readAuthoredSrc(source, target) {
|
|
26987
26936
|
const tag = findTagByTarget(source, target);
|
|
26988
26937
|
if (!tag) return "";
|
|
26989
|
-
const own =
|
|
26990
|
-
if (own
|
|
26991
|
-
const firstSource = /^\s*<source\b[^>]
|
|
26992
|
-
return firstSource
|
|
26938
|
+
const own = readTagAttribute(tag.tag, "src");
|
|
26939
|
+
if (own) return own;
|
|
26940
|
+
const firstSource = /^\s*<source\b[^>]*>/i.exec(source.slice(tag.end + 1));
|
|
26941
|
+
return firstSource && readTagAttribute(firstSource[0], "src") || "";
|
|
26993
26942
|
}
|
|
26994
26943
|
function insertBeforeTarget(source, target, markup) {
|
|
26995
26944
|
const match = findTagByTarget(source, target);
|
|
@@ -32184,7 +32133,7 @@ function getCachedProbe(url) {
|
|
|
32184
32133
|
return cached5?.result;
|
|
32185
32134
|
}
|
|
32186
32135
|
function resolveProbeSource(src, projectId) {
|
|
32187
|
-
return projectId ? resolveMediaPreviewUrl(src, projectId, window.location.origin) : src;
|
|
32136
|
+
return projectId ? resolveMediaPreviewUrl(authoredSrcPath(src), projectId, window.location.origin) : src;
|
|
32188
32137
|
}
|
|
32189
32138
|
function evictMetadataOverflow() {
|
|
32190
32139
|
const overflow = cache.size + failed.size - TIMELINE_VIEWPORT_BUDGETS.metadataRegistryEntries;
|
|
@@ -52882,7 +52831,11 @@ function trimFractions(el) {
|
|
|
52882
52831
|
return { start, end };
|
|
52883
52832
|
}
|
|
52884
52833
|
function renderAudioClip(el, pid, sessionEpoch, labelColor, context, elements, labelInset) {
|
|
52885
|
-
const audioUrl = resolveMediaPreviewUrl(
|
|
52834
|
+
const audioUrl = resolveMediaPreviewUrl(
|
|
52835
|
+
authoredSrcPath(el.src ?? ""),
|
|
52836
|
+
pid,
|
|
52837
|
+
window.location.origin
|
|
52838
|
+
);
|
|
52886
52839
|
const srcRelative = resolvePreviewRelative(audioUrl, pid, window.location.origin);
|
|
52887
52840
|
const encodedRelative = srcRelative ? encodePreviewPath(srcRelative) : null;
|
|
52888
52841
|
const waveformUrl = encodedRelative ? buildProjectApiPath(pid, `/waveform/${encodedRelative}`) : void 0;
|
|
@@ -52982,7 +52935,11 @@ function useRenderClipContent({
|
|
|
52982
52935
|
}
|
|
52983
52936
|
const htmlPreviewEligible = el.duration > 0 && effectiveTimelineDuration > 0;
|
|
52984
52937
|
if ((el.tag === "video" || el.tag === "img") && el.src) {
|
|
52985
|
-
const mediaSrc = resolveMediaPreviewUrl(
|
|
52938
|
+
const mediaSrc = resolveMediaPreviewUrl(
|
|
52939
|
+
authoredSrcPath(el.src),
|
|
52940
|
+
pid,
|
|
52941
|
+
window.location.origin
|
|
52942
|
+
);
|
|
52986
52943
|
if (el.tag === "img") {
|
|
52987
52944
|
return createElement(ImageThumbnail, {
|
|
52988
52945
|
imageSrc: mediaSrc,
|
|
@@ -54700,8 +54657,8 @@ function MediaSection({
|
|
|
54700
54657
|
const [removeProgress, setRemoveProgress] = useState65(null);
|
|
54701
54658
|
const [createPlate, setCreatePlate] = useState65(false);
|
|
54702
54659
|
const [quality, setQuality] = useState65("balanced");
|
|
54703
|
-
const
|
|
54704
|
-
const
|
|
54660
|
+
const projectSrc = srcAttr && !/^(?:https?:|data:|blob:)/i.test(srcAttr) ? authoredSrcPath(srcAttr.startsWith("./") ? srcAttr.slice(2) : srcAttr) : "";
|
|
54661
|
+
const absoluteSrc = projectDir && projectSrc ? `${projectDir}/${projectSrc}` : srcAttr;
|
|
54705
54662
|
const canRemoveBackground = Boolean(onRemoveBackground && isVisualMedia && projectSrc);
|
|
54706
54663
|
const panelTitle = isImage ? "Image" : isVideo ? "Video" : "Audio";
|
|
54707
54664
|
useEffect72(() => {
|
|
@@ -56024,7 +55981,7 @@ function resolveProjectAssetPath(sourceFile, src, projectId) {
|
|
|
56024
55981
|
return stripPreviewAssetPath(trimmed, projectId);
|
|
56025
55982
|
}
|
|
56026
55983
|
const sourceDir = sourceFile.includes("/") ? sourceFile.slice(0, sourceFile.lastIndexOf("/")) : "";
|
|
56027
|
-
const parts = `${sourceDir}/${trimmed}`.split("/");
|
|
55984
|
+
const parts = `${sourceDir}/${authoredSrcPath(trimmed)}`.split("/");
|
|
56028
55985
|
const normalized = [];
|
|
56029
55986
|
for (const part of parts) {
|
|
56030
55987
|
if (!part || part === ".") continue;
|
|
@@ -58498,6 +58455,7 @@ function ReverseGradientIcon({ size = 16 }) {
|
|
|
58498
58455
|
}
|
|
58499
58456
|
|
|
58500
58457
|
// src/components/editor/propertyPanelFill.tsx
|
|
58458
|
+
import { encodeUrlPath as encodeUrlPath3 } from "@hyperframes/parsers";
|
|
58501
58459
|
import { jsx as jsx137, jsxs as jsxs99 } from "react/jsx-runtime";
|
|
58502
58460
|
function normalizeProjectPath(value) {
|
|
58503
58461
|
const trimmed = value.trim();
|
|
@@ -58624,7 +58582,7 @@ function ImageFillField({
|
|
|
58624
58582
|
selectedAsset && /* @__PURE__ */ jsx137("div", { className: "overflow-hidden rounded-xl border border-neutral-800 bg-neutral-900/80", children: /* @__PURE__ */ jsx137(
|
|
58625
58583
|
"img",
|
|
58626
58584
|
{
|
|
58627
|
-
src: buildProjectApiPath(projectId, `/preview/${selectedAsset}`),
|
|
58585
|
+
src: buildProjectApiPath(projectId, `/preview/${encodeUrlPath3(selectedAsset)}`),
|
|
58628
58586
|
alt: selectedAsset.split("/").pop() ?? selectedAsset,
|
|
58629
58587
|
className: "h-28 w-full object-contain bg-neutral-950/80"
|
|
58630
58588
|
}
|
|
@@ -67090,8 +67048,8 @@ function FlatMediaSection({
|
|
|
67090
67048
|
const [removeProgress, setRemoveProgress] = useState94(null);
|
|
67091
67049
|
const [createPlate, setCreatePlate] = useState94(false);
|
|
67092
67050
|
const [quality, setQuality] = useState94("balanced");
|
|
67093
|
-
const
|
|
67094
|
-
const
|
|
67051
|
+
const projectSrc = srcAttr && !/^(?:https?:|data:|blob:)/i.test(srcAttr) ? authoredSrcPath(srcAttr.startsWith("./") ? srcAttr.slice(2) : srcAttr) : "";
|
|
67052
|
+
const absoluteSrc = projectDir && projectSrc ? `${projectDir}/${projectSrc}` : srcAttr;
|
|
67095
67053
|
const canRemoveBackground = Boolean(onRemoveBackground && isVisualMedia && projectSrc);
|
|
67096
67054
|
useEffect94(() => {
|
|
67097
67055
|
setRemoveProgress(null);
|
|
@@ -75118,6 +75076,7 @@ import { useState as useState117, useCallback as useCallback104, useRef as useRe
|
|
|
75118
75076
|
|
|
75119
75077
|
// src/hooks/useFileTree.ts
|
|
75120
75078
|
import { useState as useState116, useCallback as useCallback101, useEffect as useEffect113, useMemo as useMemo71, useRef as useRef128 } from "react";
|
|
75079
|
+
import { encodeUrlPath as encodeUrlPath4 } from "@hyperframes/parsers";
|
|
75121
75080
|
var EMPTY_FILE_LIST = [];
|
|
75122
75081
|
function useFileTree({ projectId, projectIdRef }) {
|
|
75123
75082
|
const [fetched, setFetched] = useState116(null);
|
|
@@ -75189,7 +75148,7 @@ function useFileTree({ projectId, projectIdRef }) {
|
|
|
75189
75148
|
() => (projectId ? assets : []).filter((asset) => FONT_EXT.test(asset)).map((asset) => ({
|
|
75190
75149
|
family: fontFamilyFromAssetPath(asset),
|
|
75191
75150
|
path: asset,
|
|
75192
|
-
url: projectId ? buildProjectApiPath(projectId, `/preview/${asset}`) : ""
|
|
75151
|
+
url: projectId ? buildProjectApiPath(projectId, `/preview/${encodeUrlPath4(asset)}`) : ""
|
|
75193
75152
|
})),
|
|
75194
75153
|
[assets, projectId]
|
|
75195
75154
|
);
|
|
@@ -75454,6 +75413,7 @@ function useProjectFileWriter({ projectId }) {
|
|
|
75454
75413
|
}
|
|
75455
75414
|
|
|
75456
75415
|
// src/hooks/useFileManager.ts
|
|
75416
|
+
import { encodeUrlPath as encodeUrlPath5 } from "@hyperframes/parsers";
|
|
75457
75417
|
function useFileManager({
|
|
75458
75418
|
projectId,
|
|
75459
75419
|
showToast,
|
|
@@ -75763,7 +75723,7 @@ function useFileManager({
|
|
|
75763
75723
|
const imported = uploaded.filter((asset) => FONT_EXT.test(asset)).map((asset) => ({
|
|
75764
75724
|
family: fontFamilyFromAssetPath(asset),
|
|
75765
75725
|
path: asset,
|
|
75766
|
-
url: `/api/projects/${encodeURIComponent(pid)}/preview/${asset}`
|
|
75726
|
+
url: `/api/projects/${encodeURIComponent(pid)}/preview/${encodeUrlPath5(asset)}`
|
|
75767
75727
|
}));
|
|
75768
75728
|
importedFontAssetsRef.current = [
|
|
75769
75729
|
...imported,
|
|
@@ -81799,6 +81759,7 @@ function useDomGeometryCommits({
|
|
|
81799
81759
|
}
|
|
81800
81760
|
|
|
81801
81761
|
// src/hooks/useDomEditCommits.ts
|
|
81762
|
+
import { encodeUrlPath as encodeUrlPath6 } from "@hyperframes/parsers";
|
|
81802
81763
|
function useDomEditCommits({
|
|
81803
81764
|
activeCompPath,
|
|
81804
81765
|
previewIframeRef,
|
|
@@ -81837,7 +81798,7 @@ function useDomEditCommits({
|
|
|
81837
81798
|
return {
|
|
81838
81799
|
family: fontFamilyFromAssetPath(asset),
|
|
81839
81800
|
path: asset,
|
|
81840
|
-
url: buildProjectApiPath(projectId, `/preview/${asset}`)
|
|
81801
|
+
url: buildProjectApiPath(projectId, `/preview/${encodeUrlPath6(asset)}`)
|
|
81841
81802
|
};
|
|
81842
81803
|
},
|
|
81843
81804
|
[fileTree, projectId, importedFontAssetsRef]
|
|
@@ -91352,6 +91313,7 @@ import { memo as memo50, useCallback as useCallback171 } from "react";
|
|
|
91352
91313
|
|
|
91353
91314
|
// src/components/MediaPreview.tsx
|
|
91354
91315
|
import { useState as useState136 } from "react";
|
|
91316
|
+
import { encodeUrlPath as encodeUrlPath7 } from "@hyperframes/parsers";
|
|
91355
91317
|
import { jsx as jsx212, jsxs as jsxs166 } from "react/jsx-runtime";
|
|
91356
91318
|
function MediaErrorPanel({ name, filePath }) {
|
|
91357
91319
|
return /* @__PURE__ */ jsxs166("div", { className: "flex flex-col items-center justify-center h-full p-4 bg-neutral-950 gap-2", children: [
|
|
@@ -91379,7 +91341,7 @@ function MediaErrorPanel({ name, filePath }) {
|
|
|
91379
91341
|
] });
|
|
91380
91342
|
}
|
|
91381
91343
|
function MediaPreview({ projectId, filePath }) {
|
|
91382
|
-
const serveUrl = buildProjectApiPath(projectId, `/preview/${filePath}`);
|
|
91344
|
+
const serveUrl = buildProjectApiPath(projectId, `/preview/${encodeUrlPath7(filePath)}`);
|
|
91383
91345
|
const name = filePath.split("/").pop() ?? filePath;
|
|
91384
91346
|
const [failedPath, setFailedPath] = useState136(null);
|
|
91385
91347
|
const failed2 = failedPath === filePath;
|