hyperframes 0.8.142 → 0.8.144
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-CWRTVGDB.js} +18 -17
- package/dist/{animatedGifPrep-SAMCDT7T.js → animatedGifPrep-JTOHIWI4.js} +15 -14
- package/dist/{asset-BLWC2NWB.js → asset-KU2Z4UFM.js} +4 -4
- package/dist/{assetCataloger-FVNBBRP3.js → assetCataloger-3CS2P7PA.js} +8 -7
- package/dist/{auth-DRZB7OAC.js → auth-IDSOIQWG.js} +1 -1
- package/dist/{autoUpdate-I5I3BOJK.js → autoUpdate-373B4BA2.js} +2 -2
- package/dist/{backgroundChecks-VR2QHGNY.js → backgroundChecks-53Q3NAMG.js} +3 -3
- package/dist/backgroundChecksWorker.js +3 -3
- package/dist/{batchRender-4YUHQI6X.js → batchRender-UKZA6BME.js} +11 -10
- package/dist/{beats-7OT7ALV3.js → beats-N5JGEOFR.js} +33 -28
- package/dist/{benchmark-Q2XQCRTR.js → benchmark-CUN3LN4V.js} +15 -14
- package/dist/{browser-7VAWQQZC.js → browser-NCZT5AP6.js} +40 -56
- package/dist/{bundleWithLocalizedFonts-DDMLLL2R.js → bundleWithLocalizedFonts-FWC7PE2D.js} +2 -2
- package/dist/{capture-HEJS6M5A.js → capture-QBLG3VJR.js} +26 -25
- package/dist/{capture-U7ABPKS5.js → capture-YLS32UHT.js} +2 -2
- package/dist/{catalog-DVJ3XPDN.js → catalog-HIWNAFHW.js} +19 -18
- package/dist/{catch-up-DF6AVSN2.js → catch-up-HGS7KIAC.js} +5 -5
- package/dist/{check-KXORRWAE.js → check-FH6UYYLO.js} +78 -66
- package/dist/{checkBrowser-J7HZJTRH.js → checkBrowser-RNWNOMCZ.js} +93 -41
- package/dist/{chunk-R2JEKLDZ.js → chunk-2DA2BBNY.js} +3 -3
- package/dist/{chunk-TQFG7HTI.js → chunk-3RM2ETQT.js} +0 -168
- package/dist/{chunk-YFT3BL7N.js → chunk-3VYNNWVA.js} +30 -12
- package/dist/{chunk-7FCDA4RH.js → chunk-3XTEXWNN.js} +8 -5
- package/dist/{chunk-PFCFR3KZ.js → chunk-442JNXRM.js} +1 -1
- package/dist/{chunk-BPZVDBHY.js → chunk-4LAR447G.js} +1 -1
- package/dist/{chunk-AM5L5YIA.js → chunk-4OA4LDTU.js} +1 -1
- package/dist/{chunk-DZEVA7DI.js → chunk-4OC7MQNB.js} +2 -2
- package/dist/{chunk-75JJVANE.js → chunk-54QISXOC.js} +3 -3
- package/dist/{chunk-FZK35GT4.js → chunk-5HJ343GH.js} +1 -1
- package/dist/{chunk-IDX52YJN.js → chunk-5VMR4WBS.js} +458 -159
- package/dist/{chunk-OSUKETIH.js → chunk-5WADG7PR.js} +1 -1
- package/dist/{chunk-JYYOAKHS.js → chunk-6IIGT7BX.js} +1 -1
- package/dist/{chunk-6UYZB4TY.js → chunk-7RAYSCYT.js} +4 -4
- package/dist/{chunk-WTMUCJ6Z.js → chunk-7SDCIWHQ.js} +11 -2
- package/dist/{chunk-LAOCA3MQ.js → chunk-A4Q7W4LV.js} +13 -8
- package/dist/{chunk-B6SMSALD.js → chunk-A53CBD24.js} +18 -12
- package/dist/{chunk-4PFZPP2N.js → chunk-A6S35NYA.js} +54 -16
- package/dist/{chunk-JOTLPC6S.js → chunk-AUBOF2PN.js} +1 -1
- package/dist/{chunk-WCJGTLPF.js → chunk-BHVFTYSI.js} +6 -3
- package/dist/chunk-BSQ7XANM.js +210 -0
- package/dist/{chunk-LCSMOLGX.js → chunk-BYSBRF24.js} +69 -8
- package/dist/{chunk-U7E736AJ.js → chunk-DDIVWXN7.js} +32 -14
- package/dist/{chunk-KOEWEFHK.js → chunk-DIRJ322I.js} +10 -5
- package/dist/{chunk-HMUF7FEO.js → chunk-EX6C672Y.js} +2 -2
- package/dist/{chunk-QGRFOOLE.js → chunk-F2SMS24Q.js} +288 -85
- package/dist/{chunk-5Z63TBTX.js → chunk-FH7WODJH.js} +1 -1
- package/dist/{chunk-XTLBLWOV.js → chunk-GEWKFRFI.js} +1 -1
- package/dist/{chunk-RVCWIIZ7.js → chunk-GV5R5B7Q.js} +1 -1
- package/dist/{chunk-TY6XOHEM.js → chunk-GZM2EFOE.js} +3 -3
- package/dist/chunk-GZVP4TWN.js +76 -0
- package/dist/{chunk-QXPCARFE.js → chunk-I5KY7EZP.js} +1 -1
- package/dist/{chunk-IW2CKH6A.js → chunk-IEIJRMLZ.js} +94 -59
- package/dist/chunk-IR35BCLK.js +13 -0
- package/dist/{chunk-JFKL3WAE.js → chunk-IWFLMU2N.js} +104 -19
- package/dist/{chunk-EFDXGAAD.js → chunk-JEHFZQYT.js} +1 -1
- package/dist/{chunk-IHFUKJOR.js → chunk-K2FLNJVB.js} +8 -2
- package/dist/{chunk-KDPYVTEU.js → chunk-KBB4RG6F.js} +6 -1
- package/dist/{chunk-LJAU4TPS.js → chunk-KFKZ3ISO.js} +2 -2
- package/dist/{sherpa-ZYTNFHD5.js → chunk-L5TUCXWR.js} +11 -44
- package/dist/{chunk-KYN364DU.js → chunk-LC3RQURJ.js} +7 -9
- package/dist/{chunk-IMY4QQTQ.js → chunk-LFX2HEYP.js} +8 -8
- package/dist/{chunk-PXSM4HPB.js → chunk-MAYCCGMQ.js} +12 -3
- package/dist/{chunk-OZUQF4NB.js → chunk-MQZVBHEY.js} +123 -8
- package/dist/{chunk-FWRNQOLT.js → chunk-MXNDKDFT.js} +3 -3
- package/dist/{chunk-A4KQZXZI.js → chunk-NE55C6S5.js} +4 -2
- package/dist/{chunk-GYE63V4P.js → chunk-NOPBBSLA.js} +24 -19
- package/dist/{chunk-H2X52H2N.js → chunk-NV4RXIQ7.js} +3 -3
- package/dist/{chunk-WGVOWWVK.js → chunk-OIDN7G42.js} +3 -3
- package/dist/{chunk-DPHJKWP5.js → chunk-OUSLVRO4.js} +107 -108
- package/dist/{chunk-JLKMWY2T.js → chunk-P6WH6QTV.js} +8 -5
- package/dist/{chunk-7M4KAPAA.js → chunk-PUGIRFPX.js} +2 -2
- package/dist/{chunk-6RAD4BCC.js → chunk-QATWIE4K.js} +2 -2
- package/dist/{chunk-D2KNWIQ6.js → chunk-QFSCCQIR.js} +1 -1
- package/dist/{chunk-XGMNQQTJ.js → chunk-RG3QWWIE.js} +1 -1
- package/dist/{chunk-MVTUV4TP.js → chunk-RI53TS2Y.js} +14 -6
- package/dist/{chunk-LQASVU3I.js → chunk-RVFEDAUV.js} +12 -4
- package/dist/{chunk-GK4AIFIH.js → chunk-SDYDNHEE.js} +34 -3
- package/dist/{chunk-WSGY5CDQ.js → chunk-SLCFKB3Y.js} +14 -10
- package/dist/{chunk-2NCHQUPX.js → chunk-SQLK7SJL.js} +1 -1
- package/dist/{chunk-PMRBLBUP.js → chunk-T42U2W2R.js} +14 -2
- package/dist/chunk-UPFUC4DB.js +136 -0
- package/dist/{chunk-IXCTG2WY.js → chunk-VYSUZEJG.js} +5 -5
- package/dist/chunk-WJB7WI4J.js +3753 -0
- package/dist/{chunk-YEIFI443.js → chunk-WPNE5NEP.js} +1 -1
- package/dist/{chunk-YHRZQJXH.js → chunk-XGFHYAYN.js} +265 -68
- package/dist/{chunk-LBKDQKWV.js → chunk-XU5GGV6R.js} +1 -1
- package/dist/{chunk-LTGGTEMA.js → chunk-Y6UPYWJS.js} +2 -2
- package/dist/{chunk-OKCR3JTO.js → chunk-YJXHMIZA.js} +13 -10
- package/dist/{chunk-JU6Y5TTZ.js → chunk-YUAXFWSQ.js} +3 -3
- package/dist/{chunk-TVCRUG2S.js → chunk-ZEUONDQG.js} +1 -1
- package/dist/{chunk-THXFSPLV.js → chunk-ZIRIDSDB.js} +1 -1
- package/dist/{chunk-6UM3R7PP.js → chunk-ZOA2SC4P.js} +129 -60
- package/dist/{clean-KTHTV5G5.js → clean-KPX27IKJ.js} +27 -26
- package/dist/cli.js +70 -160
- package/dist/{cloud-ARSZWALC.js → cloud-P7DAOISN.js} +4 -4
- package/dist/{cloudrun-NM7RXOCL.js → cloudrun-XM56TBOH.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-F6YAFZZM.js} +37 -36
- package/dist/{compiler-VTH2D3ID.js → compiler-JZ4GNFMG.js} +16 -10
- package/dist/{component-FRUIAXIR.js → component-3CFOGIQA.js} +5 -5
- package/dist/{compositions-CUSY6ZYY.js → compositions-CPCMWF24.js} +38 -33
- package/dist/{delete-KT3VHP4L.js → delete-GYVKOKB6.js} +4 -4
- package/dist/{deterministicFonts-F6WIVL2W.js → deterministicFonts-U2BIMGPG.js} +3 -3
- package/dist/{dist-7SZU7MA7.js → dist-KDJTFJHA.js} +7 -6
- package/dist/{dist-2GC6XKRQ.js → dist-YPWQDWJ4.js} +42 -40
- package/dist/{doctor-4ROTBL5U.js → doctor-GWI3B6JT.js} +21 -20
- package/dist/{dom-IROKGVJI.js → dom-37K6YOH4.js} +2 -2
- package/dist/{events-QJDVMKSR.js → events-BRRUDPPT.js} +3 -3
- package/dist/{events-Q5PXT5UC.js → events-V2QFN4YM.js} +2 -2
- package/dist/{feedback-PQ7TWESA.js → feedback-CXMD7FWL.js} +14 -13
- package/dist/{ffmpeg-QIUFEFTY.js → ffmpeg-T5SH2EFJ.js} +3 -2
- package/dist/{figma-JN5DDBDS.js → figma-YABDWD66.js} +3 -3
- package/dist/fontLocalizeCli.js +18 -17
- package/dist/{get-KT6OTERO.js → get-L2SOQKHX.js} +4 -4
- package/dist/{gpuPolicy-LCBWVGEH.js → gpuPolicy-NBJNWHYS.js} +19 -16
- package/dist/{grade-compare-VS3RP73G.js → grade-compare-STXQPKYQ.js} +39 -38
- package/dist/{help-AD6FIZIO.js → help-4H6BSFLB.js} +2 -2
- package/dist/{history-ZRWYRY7R.js → history-4IQOLTHJ.js} +6 -6
- package/dist/hyperframe-runtime.js +56 -56
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +56 -56
- package/dist/hyperframes-player.global.js +3 -3
- package/dist/hyperframes-slideshow.global.js +23 -23
- package/dist/{info-WBBQA2AX.js → info-2CZOTNBC.js} +17 -16
- package/dist/{init-A2XBDFGF.js → init-6BXK42VS.js} +46 -46
- package/dist/{inspect-CLTZHA5O.js → inspect-VKU47TBH.js} +38 -37
- package/dist/{installer-WQDRVXH4.js → installer-T2BSSUDY.js} +11 -10
- package/dist/{keyframes-3FYOK6H6.js → keyframes-IEYVHRPI.js} +10 -10
- package/dist/{lambda-Y2PA2BGS.js → lambda-TIKG25CK.js} +12 -11
- package/dist/{layout-4KP5O7IJ.js → layout-XOI4PT7A.js} +38 -37
- package/dist/{lint-V4GRFHOJ.js → lint-DWCMVIX5.js} +14 -13
- package/dist/{lintProject-RG2KGAXB.js → lintProject-UBZ3TDHU.js} +7 -6
- package/dist/{list-OQ4VED6E.js → list-7GXKG5QM.js} +5 -5
- package/dist/{login-W47NKN5S.js → login-BQ5L2UHX.js} +4 -4
- package/dist/{manager-CT3D67CG.js → manager-BPSR6D3V.js} +2 -2
- package/dist/{manager-524RPYO7.js → manager-RFZNG5YT.js} +2 -2
- package/dist/{manager-DXB7JDHU.js → manager-YKMHR6LN.js} +9 -6
- package/dist/{media-treatment-HJYL3EME.js → media-treatment-IFB7OSZ3.js} +24 -22
- package/dist/{models-DYBAD2GQ.js → models-TY4PJ545.js} +68 -27
- package/dist/{motionShot-7NE2YBB3.js → motionShot-WXMFHICW.js} +33 -33
- package/dist/{normalize-IGLHCWTF.js → normalize-U3SL5VG3.js} +19 -8
- package/dist/{normalize-audio-INKCLMS2.js → normalize-audio-RFD776HQ.js} +10 -6
- package/dist/{open-TYC5THVY.js → open-7IXXGO2E.js} +5 -5
- package/dist/parakeetRunner-IHLYYMTZ.js +67 -0
- package/dist/{pipeline-EVKEPQEW.js → pipeline-TXKPLL2U.js} +20 -18
- package/dist/{play-QMZEM6X3.js → play-J2KP64UK.js} +31 -29
- package/dist/{preflight-Y5DN5D37.js → preflight-B4AFK3RG.js} +4 -4
- package/dist/{present-Y7IK3C4W.js → present-MHHNRVRA.js} +26 -25
- package/dist/{preview-5OQRYE6A.js → preview-CONUOFFQ.js} +28 -27
- package/dist/{producer-Q6G6JU7B.js → producer-ZI46K7HH.js} +1 -1
- package/dist/{projectConfig-RJN3DKDB.js → projectConfig-FGGVG5MV.js} +13 -12
- package/dist/{publication-QCPGGN3U.js → publication-TXFBMW6B.js} +8 -7
- package/dist/{publish-VZLFIGYY.js → publish-YZSPBFRD.js} +18 -17
- package/dist/{remove-background-TKOEHBA5.js → remove-background-4ATVLHLG.js} +22 -20
- package/dist/{render-KIIIF6PS.js → render-6FBYLYGJ.js} +20 -19
- package/dist/{render-XTXE5CRU.js → render-GFW5BPES.js} +13 -12
- package/dist/{render-X3NFNVEQ.js → render-MH4IUPWB.js} +41 -40
- package/dist/{render-batch-M55YZLZ5.js → render-batch-XUCZ2PUJ.js} +13 -12
- package/dist/{renderCancellation-X5BEHAZU.js → renderCancellation-XF7M7IUP.js} +18 -16
- package/dist/renderSetupWorker.js +37 -48
- package/dist/{resolver-GAMXRA42.js → resolver-W7AYCQGS.js} +10 -9
- package/dist/sherpa-LDUB5NLY.js +75 -0
- package/dist/sherpaWorker.js +2 -1
- package/dist/skills/hyperframes-cli/references/doctor-browser.md +24 -1
- package/dist/skills/hyperframes-cli/references/lint-validate-inspect.md +1 -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-VENERS5X.js} +7 -7
- package/dist/{skillsUpdateCheck-6WLLX53A.js → skillsUpdateCheck-UXFYTACG.js} +3 -3
- package/dist/{slideshow-EJ4IMY6P.js → slideshow-4OJEPWNZ.js} +1 -1
- package/dist/{snapshot-K7BTJPYQ.js → snapshot-C6T74HTI.js} +44 -40
- package/dist/{src-YUW26JU5.js → src-FS5RSVEI.js} +17 -16
- package/dist/{src-3I3RH3V5.js → src-VUJ2FUFK.js} +18 -13
- package/dist/{staticProjectServer-IKCSGN2B.js → staticProjectServer-V2RZ4DWD.js} +23 -22
- package/dist/studio/assets/hyperframes-player-Bw_jIaSX.js +473 -0
- package/dist/studio/assets/{index-B-wffzRH.js → index-BVM9NuWl.js} +153 -153
- package/dist/studio/assets/{index-D3Vij9t1.js → index-Cj7W_c7p.js} +1 -1
- package/dist/studio/assets/{index-D5q2_7Gw.js → index-DyH9dT7b.js} +1 -1
- package/dist/studio/{chunk-TFLU2MGI.js → chunk-3GHTHPZD.js} +8 -1
- package/dist/studio/chunk-3GHTHPZD.js.map +1 -0
- package/dist/studio/{chunk-H2DUOXTF.js → chunk-G3EDKRZH.js} +3 -3
- package/dist/studio/{chunk-UYWON5AX.js → chunk-PEAKCOUW.js} +7 -3
- package/dist/studio/chunk-PEAKCOUW.js.map +1 -0
- package/dist/studio/{chunk-LOVBLSMR.js → chunk-Y2OHHNM2.js} +35 -19
- package/dist/studio/chunk-Y2OHHNM2.js.map +1 -0
- package/dist/studio/{domEditingLayers-KBTPQKGA.js → domEditingLayers-PYST4G45.js} +3 -3
- package/dist/studio/index.html +1 -1
- package/dist/studio/index.js +261 -230
- package/dist/studio/index.js.map +1 -1
- package/dist/studio/player.js +3 -3
- package/dist/studio/ui.d.ts +4 -5
- package/dist/studio/ui.js +1 -1
- package/dist/{studio-api-SQ3NXFSM.js → studio-api-TQE7KWKO.js} +22 -17
- package/dist/{studioServer-VVEO7XCH.js → studioServer-CYKSQK7L.js} +81 -64
- package/dist/{synthesize-77PTU6C5.js → synthesize-UCI4X5O7.js} +6 -6
- package/dist/{telemetry-FQDKR5XA.js → telemetry-A23PPRD6.js} +3 -3
- package/dist/{timeline-N6ZASFNE.js → timeline-T3QSGT3A.js} +143 -99
- package/dist/{tokens-2OIIBBCW.js → tokens-RT5HWA6C.js} +4 -4
- package/dist/{transcribe-7YTUCXDX.js → transcribe-FOLNOC5G.js} +116 -52
- package/dist/{transcribe-4F6MK73N.js → transcribe-HCF64LQK.js} +23 -20
- package/dist/{tts-TOHSPWEG.js → tts-B6AHFQEO.js} +6 -6
- package/dist/{updateCheck-AZ2COZFR.js → updateCheck-27PIP3AA.js} +2 -2
- package/dist/{upgrade-QAJEYB4X.js → upgrade-TVGXBUPJ.js} +2 -2
- package/dist/{urlDownloader-LSMFEO3R.js → urlDownloader-KBLBJKRL.js} +14 -13
- package/dist/{validate-GW5MDL36.js → validate-ZMYGK4QI.js} +40 -27
- package/dist/{video-PRNOKUK3.js → video-AVE5GIGM.js} +15 -14
- package/package.json +1 -1
- package/dist/chunk-J4UX3RS3.js +0 -3717
- package/dist/studio/assets/hyperframes-player-sAsRuV73.js +0 -473
- package/dist/studio/chunk-LOVBLSMR.js.map +0 -1
- package/dist/studio/chunk-TFLU2MGI.js.map +0 -1
- package/dist/studio/chunk-UYWON5AX.js.map +0 -1
- package/dist/{chunk-HBBJFK6I.js → chunk-APDLWWFG.js} +0 -0
- package/dist/{screenshotCapture-TEUIWXWN.js → screenshotCapture-3JXXUZND.js} +3 -3
- /package/dist/studio/{chunk-H2DUOXTF.js.map → chunk-G3EDKRZH.js.map} +0 -0
- /package/dist/studio/{domEditingLayers-KBTPQKGA.js.map → domEditingLayers-PYST4G45.js.map} +0 -0
|
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
|
|
|
6
6
|
var __dirname = __hf_dirname(__filename);
|
|
7
7
|
import {
|
|
8
8
|
ensureHfIds
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NE55C6S5.js";
|
|
10
10
|
import {
|
|
11
11
|
HF_COLOR_GRADING_ATTR,
|
|
12
12
|
INLINED_FILE_ATTR,
|
|
@@ -17,8 +17,11 @@ import {
|
|
|
17
17
|
compositionStyle,
|
|
18
18
|
cssStyleMergeKey,
|
|
19
19
|
deferScriptsUntilFonts,
|
|
20
|
+
enumerateNestedCompositionHosts,
|
|
20
21
|
escapeInlineScriptSource,
|
|
22
|
+
executableScripts,
|
|
21
23
|
extractResolvedMedia,
|
|
24
|
+
extractedCompositionAssets,
|
|
22
25
|
getHyperframeRuntimeScript,
|
|
23
26
|
hasSameLink,
|
|
24
27
|
headStyleRuns,
|
|
@@ -29,13 +32,13 @@ import {
|
|
|
29
32
|
isJavaScriptType,
|
|
30
33
|
parseHTMLContent,
|
|
31
34
|
parseHostVariableValues,
|
|
32
|
-
|
|
35
|
+
planCompositionAssembly,
|
|
33
36
|
readDeclaredDefaults,
|
|
34
37
|
shouldClampResolvedMediaDuration,
|
|
35
38
|
stripEmbeddedRuntimeScripts,
|
|
36
39
|
styleElementsFor,
|
|
37
40
|
warnUnknownEnumValues
|
|
38
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-WJB7WI4J.js";
|
|
39
42
|
import {
|
|
40
43
|
cssVariableName
|
|
41
44
|
} from "./chunk-VC76R6W2.js";
|
|
@@ -45,25 +48,35 @@ import {
|
|
|
45
48
|
} from "./chunk-OFQWTKPW.js";
|
|
46
49
|
import {
|
|
47
50
|
lintHyperframeHtml
|
|
48
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-IEIJRMLZ.js";
|
|
49
52
|
import {
|
|
50
|
-
CSS_URL_RE,
|
|
51
53
|
checkSubCompositionUsability,
|
|
54
|
+
resolveSubCompositionContent
|
|
55
|
+
} from "./chunk-3RM2ETQT.js";
|
|
56
|
+
import {
|
|
57
|
+
CSS_URL_RE,
|
|
58
|
+
decodeCssEscapes,
|
|
59
|
+
decodeWellFormedEscapes,
|
|
60
|
+
decodedUrlPath,
|
|
61
|
+
encodeUrlPath,
|
|
52
62
|
isNonRelativeUrl,
|
|
53
|
-
resolveSubCompositionContent,
|
|
54
63
|
rewriteAssetPath,
|
|
55
64
|
rewriteAssetPaths,
|
|
56
65
|
rewriteCssAssetUrls,
|
|
57
|
-
rewriteInlineStyleAssetUrls
|
|
58
|
-
|
|
66
|
+
rewriteInlineStyleAssetUrls,
|
|
67
|
+
splitUrlSuffix
|
|
68
|
+
} from "./chunk-BSQ7XANM.js";
|
|
59
69
|
import {
|
|
60
70
|
parseHTML
|
|
61
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-SDYDNHEE.js";
|
|
72
|
+
import {
|
|
73
|
+
parse
|
|
74
|
+
} from "./chunk-2PSPARWP.js";
|
|
62
75
|
|
|
63
76
|
// ../core/dist/compiler/htmlCompiler.js
|
|
64
77
|
import { resolve } from "path";
|
|
65
78
|
function resolveMediaSrc(src, projectDir) {
|
|
66
|
-
return src.startsWith("http://") || src.startsWith("https://") ? src : resolve(projectDir, src);
|
|
79
|
+
return src.startsWith("http://") || src.startsWith("https://") ? src : resolve(projectDir, decodedUrlPath(src));
|
|
67
80
|
}
|
|
68
81
|
async function compileHtml(rawHtml, projectDir, probeMediaDuration) {
|
|
69
82
|
const { html: staticCompiled, unresolved } = compileTimingAttrs(rawHtml);
|
|
@@ -88,6 +101,9 @@ async function compileHtml(rawHtml, projectDir, probeMediaDuration) {
|
|
|
88
101
|
html = injectDurations(html, resolutions);
|
|
89
102
|
}
|
|
90
103
|
}
|
|
104
|
+
return clampProbedMedia(html, projectDir, probeMediaDuration);
|
|
105
|
+
}
|
|
106
|
+
async function clampProbedMedia(html, projectDir, probeMediaDuration) {
|
|
91
107
|
const preResolved = extractResolvedMedia(html);
|
|
92
108
|
const clampList = [];
|
|
93
109
|
for (const el of preResolved) {
|
|
@@ -1429,65 +1445,6 @@ function rewriteSvgIdReferencesInCss(css, idMap, references = []) {
|
|
|
1429
1445
|
return mutated ? root.toResult({ map: false }).css : css;
|
|
1430
1446
|
}
|
|
1431
1447
|
|
|
1432
|
-
// ../core/dist/compiler/compositionAssembly.js
|
|
1433
|
-
var COMPOSITION_ID_ATTR = "data-composition-id";
|
|
1434
|
-
var COMPOSITION_SRC_ATTR = "data-composition-src";
|
|
1435
|
-
var COMPOSITION_ROOT_SELECTOR = `[${COMPOSITION_ID_ATTR}]`;
|
|
1436
|
-
var COMPOSITION_HOST_SELECTOR = `[${COMPOSITION_SRC_ATTR}]`;
|
|
1437
|
-
var STYLE_SELECTOR = "style";
|
|
1438
|
-
var SCRIPT_SELECTOR = "script";
|
|
1439
|
-
var HOISTED_LINK_SELECTOR = 'link[rel="stylesheet"], link[rel="preconnect"]';
|
|
1440
|
-
var EXTRACTED_COMPOSITION_ASSET_SELECTOR = `${STYLE_SELECTOR}, ${SCRIPT_SELECTOR}, ${HOISTED_LINK_SELECTOR}`;
|
|
1441
|
-
var MAX_SUB_COMPOSITION_DEPTH = 20;
|
|
1442
|
-
function toArray(items) {
|
|
1443
|
-
return items ? Array.from(items) : [];
|
|
1444
|
-
}
|
|
1445
|
-
function planCompositionAssembly(input) {
|
|
1446
|
-
const { contentNode, head, documentElement, hasTemplate, compositionId } = input;
|
|
1447
|
-
const compositionRoots = toArray(contentNode.querySelectorAll(COMPOSITION_ROOT_SELECTOR));
|
|
1448
|
-
const innerRoot = compositionId ? compositionRoots.find((root) => root.getAttribute(COMPOSITION_ID_ATTR) === compositionId) ?? null : compositionRoots[0] ?? null;
|
|
1449
|
-
const declaredCompositionId = (innerRoot ?? compositionRoots[0])?.getAttribute(COMPOSITION_ID_ATTR)?.trim() || "";
|
|
1450
|
-
const assetHead = hasTemplate ? null : head ?? null;
|
|
1451
|
-
return {
|
|
1452
|
-
innerRoot,
|
|
1453
|
-
authoredCompositionId: compositionId || declaredCompositionId || null,
|
|
1454
|
-
scriptCompositionId: declaredCompositionId || compositionId || null,
|
|
1455
|
-
authoredRootId: innerRoot?.getAttribute("id")?.trim() || null,
|
|
1456
|
-
styleSources: [
|
|
1457
|
-
...toArray(assetHead?.querySelectorAll(STYLE_SELECTOR)),
|
|
1458
|
-
...toArray(contentNode.querySelectorAll(STYLE_SELECTOR))
|
|
1459
|
-
],
|
|
1460
|
-
scriptSources: [
|
|
1461
|
-
...toArray(assetHead?.querySelectorAll(SCRIPT_SELECTOR)),
|
|
1462
|
-
...toArray(contentNode.querySelectorAll(SCRIPT_SELECTOR))
|
|
1463
|
-
],
|
|
1464
|
-
linkSources: [
|
|
1465
|
-
...toArray(head?.querySelectorAll(HOISTED_LINK_SELECTOR)),
|
|
1466
|
-
...toArray(contentNode.querySelectorAll(HOISTED_LINK_SELECTOR))
|
|
1467
|
-
],
|
|
1468
|
-
variableDefaultCarriers: [documentElement, innerRoot].filter((carrier) => carrier != null)
|
|
1469
|
-
};
|
|
1470
|
-
}
|
|
1471
|
-
function enumerateNestedCompositionHosts(assembledHost, ancestry) {
|
|
1472
|
-
const hosts = [];
|
|
1473
|
-
const skipped = [];
|
|
1474
|
-
for (const nestedHost of assembledHost.querySelectorAll(COMPOSITION_HOST_SELECTOR)) {
|
|
1475
|
-
const src = nestedHost.getAttribute(COMPOSITION_SRC_ATTR);
|
|
1476
|
-
if (!src)
|
|
1477
|
-
continue;
|
|
1478
|
-
if (ancestry.includes(src)) {
|
|
1479
|
-
skipped.push({ src, reason: "circular composition reference" });
|
|
1480
|
-
continue;
|
|
1481
|
-
}
|
|
1482
|
-
if (ancestry.length >= MAX_SUB_COMPOSITION_DEPTH) {
|
|
1483
|
-
skipped.push({ src, reason: "nesting depth exceeded" });
|
|
1484
|
-
continue;
|
|
1485
|
-
}
|
|
1486
|
-
hosts.push({ host: nestedHost, src });
|
|
1487
|
-
}
|
|
1488
|
-
return { hosts, skipped };
|
|
1489
|
-
}
|
|
1490
|
-
|
|
1491
1448
|
// ../core/dist/compiler/inlineSubCompositions.js
|
|
1492
1449
|
var SIDE_EFFECT_RE = /\b(addEventListener|requestAnimationFrame|requestIdleCallback|setTimeout|setInterval|queueMicrotask|getContext|WebGL\w*|WebGPU\w*|gpu|Worker|WebSocket|EventSource|Audio\w*|\w*Observer|fetch|import|eval|Function|Promise|async|await|delayedCall|ScrollTrigger|Draggable|anime|customElements|registerProperty|addListener|BroadcastChannel|pushState|replaceState|adoptedStyleSheets|documentElement|getElementsByTagName|lottie|THREE|__hf[A-Z]\w*)\b|\.then\s*\(|\.animate\s*\(|\.ticker\b|repeat\s*:\s*-1|\.repeat\s*\(\s*-1|defineProperty\s*\(\s*(window|globalThis|self|document)\b|\bfonts\s*\.\s*add\b|\.on[a-z]+\s*=(?!=)|\bon(resize|scroll|message|key\w+|click|pointer\w+|mouse\w+|wheel|visibilitychange|hashchange|popstate|error|load)\s*=(?!=)|\[\s*["']on[a-z]+["']\s*\]|document\s*\.\s*(head|body)\b|querySelector(All)?\(\s*["'](head|body)["']|\bgsap\s*\.\s*(?:to|from|fromTo)\s*\(|\bgsap\s*\.\s*timeline\s*\((?:[^()]|\([^()]*\))*\)\s*\.\s*(?:to|from|fromTo|set|add|call)\s*\(/;
|
|
1493
1450
|
var SWAP_SAFE_LIBRARY_URL = /^https:\/\/(cdn\.jsdelivr\.net\/npm|unpkg\.com)\/(gsap|three|d3|d3-[a-z-]+|topojson-client|clipper-lib)(@[^/]+)?\//;
|
|
@@ -1736,7 +1693,7 @@ function inlineSubCompositions(document, hosts, options) {
|
|
|
1736
1693
|
}
|
|
1737
1694
|
if (innerRoot) {
|
|
1738
1695
|
innerRoot.setAttribute("data-composition-file", src);
|
|
1739
|
-
for (const child of
|
|
1696
|
+
for (const child of extractedCompositionAssets(innerRoot))
|
|
1740
1697
|
child.remove();
|
|
1741
1698
|
if (flattenInnerRoot) {
|
|
1742
1699
|
const prepared = flattenInnerRoot(innerRoot);
|
|
@@ -1751,11 +1708,13 @@ function inlineSubCompositions(document, hosts, options) {
|
|
|
1751
1708
|
}
|
|
1752
1709
|
}
|
|
1753
1710
|
} else {
|
|
1754
|
-
for (const child of
|
|
1711
|
+
for (const child of extractedCompositionAssets(contentDoc))
|
|
1755
1712
|
child.remove();
|
|
1756
1713
|
const bodyHtml = contentDoc.body?.innerHTML || "";
|
|
1757
1714
|
hostEl.innerHTML = bodyHtml || contentDoc.documentElement?.outerHTML || "";
|
|
1758
1715
|
}
|
|
1716
|
+
for (const el of plan.inertScriptsOutsideRoot)
|
|
1717
|
+
hostEl.insertAdjacentHTML("beforeend", el.outerHTML);
|
|
1759
1718
|
hostEl.setAttribute("data-composition-file", src);
|
|
1760
1719
|
hostEl.removeAttribute("data-composition-src");
|
|
1761
1720
|
const nestedAncestry = [...ancestry, src];
|
|
@@ -1870,30 +1829,35 @@ function withCommentsStripped(css, fn) {
|
|
|
1870
1829
|
};
|
|
1871
1830
|
return { result, restore };
|
|
1872
1831
|
}
|
|
1832
|
+
function resolveRelativeUrlPath(fromDir, basePath) {
|
|
1833
|
+
return resolve2(fromDir, decodeWellFormedEscapes(basePath.replaceAll("\\", "/")));
|
|
1834
|
+
}
|
|
1873
1835
|
function rebaseCssUrls(css, cssFileDir, projectDir) {
|
|
1874
1836
|
const resolvedRoot = resolve2(projectDir);
|
|
1875
1837
|
const resolvedDir = resolve2(cssFileDir);
|
|
1876
1838
|
if (resolvedDir === resolvedRoot)
|
|
1877
1839
|
return css;
|
|
1878
1840
|
return css.replace(CSS_URL_RE, (full, quote, urlValue) => {
|
|
1879
|
-
|
|
1841
|
+
const decoded = decodeCssEscapes(urlValue);
|
|
1842
|
+
if (!decoded || !isRelativeUrl(decoded))
|
|
1880
1843
|
return full;
|
|
1881
|
-
const { basePath, suffix } = splitUrlSuffix(
|
|
1844
|
+
const { basePath, suffix } = splitUrlSuffix(decoded);
|
|
1882
1845
|
if (!basePath)
|
|
1883
1846
|
return full;
|
|
1884
|
-
const absolutePath =
|
|
1885
|
-
const rebased = relative(resolvedRoot, absolutePath).split(sep).join("/");
|
|
1847
|
+
const absolutePath = resolveRelativeUrlPath(resolvedDir, basePath);
|
|
1848
|
+
const rebased = encodeUrlPath(relative(resolvedRoot, absolutePath).split(sep).join("/"));
|
|
1886
1849
|
if (rebased === basePath)
|
|
1887
1850
|
return full;
|
|
1888
|
-
|
|
1851
|
+
const escapedSuffix = suffix.replace(/[\s\p{Cc}"'()\\<>]/gu, (char) => `\\${char.codePointAt(0).toString(16).padStart(6, "0")}`);
|
|
1852
|
+
return `url(${quote || ""}${rebased}${escapedSuffix}${quote || ""})`;
|
|
1889
1853
|
});
|
|
1890
1854
|
}
|
|
1891
1855
|
function rebaseRelativePath(urlValue, fromDir, toDir) {
|
|
1892
1856
|
const { basePath, suffix } = splitUrlSuffix(urlValue.trim());
|
|
1893
1857
|
if (!basePath)
|
|
1894
1858
|
return urlValue;
|
|
1895
|
-
const absolutePath =
|
|
1896
|
-
const rebased = relative(resolve2(toDir), absolutePath).split(sep).join("/");
|
|
1859
|
+
const absolutePath = resolveRelativeUrlPath(fromDir, basePath);
|
|
1860
|
+
const rebased = encodeUrlPath(relative(resolve2(toDir), absolutePath).split(sep).join("/"));
|
|
1897
1861
|
return appendSuffixToUrl(rebased, suffix);
|
|
1898
1862
|
}
|
|
1899
1863
|
function rebaseSrcsetPaths(srcsetValue, fromDir, toDir) {
|
|
@@ -1976,7 +1940,7 @@ function inlineCssFile(css, cssFileDir, projectDir, visited = /* @__PURE__ */ ne
|
|
|
1976
1940
|
const importPath = urlPath ?? barePath;
|
|
1977
1941
|
if (!importPath || !isRelativeUrl(importPath))
|
|
1978
1942
|
return full;
|
|
1979
|
-
const resolved = resolve2(cssFileDir, importPath);
|
|
1943
|
+
const resolved = resolve2(cssFileDir, decodedUrlPath(importPath));
|
|
1980
1944
|
if (!isSafePath(projectDir, resolved))
|
|
1981
1945
|
return full;
|
|
1982
1946
|
if (visited.has(resolved))
|
|
@@ -2012,14 +1976,6 @@ function safeReadFileBuffer(filePath) {
|
|
|
2012
1976
|
return null;
|
|
2013
1977
|
}
|
|
2014
1978
|
}
|
|
2015
|
-
function splitUrlSuffix(urlValue) {
|
|
2016
|
-
const queryIdx = urlValue.indexOf("?");
|
|
2017
|
-
const hashIdx = urlValue.indexOf("#");
|
|
2018
|
-
if (queryIdx < 0 && hashIdx < 0)
|
|
2019
|
-
return { basePath: urlValue, suffix: "" };
|
|
2020
|
-
const cutIdx = queryIdx < 0 ? hashIdx : hashIdx < 0 ? queryIdx : Math.min(queryIdx, hashIdx);
|
|
2021
|
-
return { basePath: urlValue.slice(0, cutIdx), suffix: urlValue.slice(cutIdx) };
|
|
2022
|
-
}
|
|
2023
1979
|
function appendSuffixToUrl(baseUrl, suffix) {
|
|
2024
1980
|
if (!suffix)
|
|
2025
1981
|
return baseUrl;
|
|
@@ -2081,7 +2037,7 @@ function maybeInlineRelativeAssetUrl(urlValue, projectDir, inlineAssets) {
|
|
|
2081
2037
|
const { basePath, suffix } = splitUrlSuffix(urlValue.trim());
|
|
2082
2038
|
if (!basePath)
|
|
2083
2039
|
return null;
|
|
2084
|
-
const filePath = resolveWithinProject(projectDir, basePath);
|
|
2040
|
+
const filePath = resolveWithinProject(projectDir, decodeWellFormedEscapes(basePath));
|
|
2085
2041
|
if (!filePath)
|
|
2086
2042
|
return null;
|
|
2087
2043
|
const ext = filePath.toLowerCase().match(/\.[^.]+$/)?.[0] ?? "";
|
|
@@ -2396,12 +2352,17 @@ function coalesceHeadStylesAndBodyScripts(document) {
|
|
|
2396
2352
|
const isPinned = (el) => el.hasAttribute(RUNTIME_BOOTSTRAP_ATTR) || el.hasAttribute(SCENE_PART_ATTR);
|
|
2397
2353
|
for (const { members, anchor } of inlineScriptRuns([...document.querySelectorAll("body script")], isPinned)) {
|
|
2398
2354
|
const mergedJs = joinJsChunks(members.map((el) => el.textContent || ""));
|
|
2355
|
+
if (mergedJs && !parsesAsScript(mergedJs)) {
|
|
2356
|
+
for (const el of members)
|
|
2357
|
+
el.textContent = inlineScriptSource(el.textContent || "");
|
|
2358
|
+
continue;
|
|
2359
|
+
}
|
|
2399
2360
|
for (const el of members)
|
|
2400
2361
|
el.remove();
|
|
2401
2362
|
if (!mergedJs)
|
|
2402
2363
|
continue;
|
|
2403
2364
|
const inlineScript = document.createElement("script");
|
|
2404
|
-
inlineScript.textContent =
|
|
2365
|
+
inlineScript.textContent = inlineScriptSource(mergedJs);
|
|
2405
2366
|
if (anchor)
|
|
2406
2367
|
anchor.before(inlineScript);
|
|
2407
2368
|
else
|
|
@@ -2422,6 +2383,14 @@ function injectTextRenderingRule(document) {
|
|
|
2422
2383
|
function joinJsChunks(chunks) {
|
|
2423
2384
|
return chunks.map((chunk) => chunk.trim()).filter((chunk) => chunk.length > 0).map((chunk) => chunk.endsWith(";") ? chunk : chunk + "\n;").join("\n");
|
|
2424
2385
|
}
|
|
2386
|
+
function parsesAsScript(source) {
|
|
2387
|
+
try {
|
|
2388
|
+
parse(source, { ecmaVersion: "latest", sourceType: "script" });
|
|
2389
|
+
return true;
|
|
2390
|
+
} catch {
|
|
2391
|
+
return false;
|
|
2392
|
+
}
|
|
2393
|
+
}
|
|
2425
2394
|
function stripJsCommentsParserSafe(source) {
|
|
2426
2395
|
if (!source)
|
|
2427
2396
|
return source;
|
|
@@ -2432,6 +2401,9 @@ function stripJsCommentsParserSafe(source) {
|
|
|
2432
2401
|
return source;
|
|
2433
2402
|
}
|
|
2434
2403
|
}
|
|
2404
|
+
function inlineScriptSource(js) {
|
|
2405
|
+
return escapeInlineScriptSource(stripJsCommentsParserSafe(js));
|
|
2406
|
+
}
|
|
2435
2407
|
function preserveLocalScriptIntegrity(doc, src, resolvePath) {
|
|
2436
2408
|
const path = resolvePath(src);
|
|
2437
2409
|
if (!path)
|
|
@@ -2454,19 +2426,29 @@ function hoistExternalScript(src, projectDir, doc, seenSrcs, chunks, attributes)
|
|
|
2454
2426
|
return;
|
|
2455
2427
|
seenSrcs.add(src);
|
|
2456
2428
|
if (!isNonRelativeUrl(src) && !isAbsolute(src) && attributes.type !== "module") {
|
|
2457
|
-
const jsPath = resolveWithinProject(projectDir, src);
|
|
2429
|
+
const jsPath = resolveWithinProject(projectDir, decodedUrlPath(src));
|
|
2458
2430
|
const js = jsPath ? safeReadFile(jsPath) : null;
|
|
2459
2431
|
if (js != null) {
|
|
2460
|
-
chunks.push(() => preserveLocalScriptIntegrity(doc, src, (value) => resolveWithinProject(projectDir, value)) ? "" : js);
|
|
2432
|
+
chunks.push(() => preserveLocalScriptIntegrity(doc, src, (value) => resolveWithinProject(projectDir, decodedUrlPath(value))) ? "" : js);
|
|
2461
2433
|
return;
|
|
2462
2434
|
}
|
|
2463
2435
|
}
|
|
2464
2436
|
ensureExternalScriptTag(doc, src, attributes);
|
|
2465
2437
|
}
|
|
2466
2438
|
function hoistCompositionScripts(container, opts) {
|
|
2467
|
-
for (const scriptEl of
|
|
2439
|
+
for (const scriptEl of executableScripts(container)) {
|
|
2468
2440
|
const externalSrc = (scriptEl.getAttribute("src") || "").trim();
|
|
2469
|
-
|
|
2441
|
+
const type = (scriptEl.getAttribute("type") || "").trim().toLowerCase();
|
|
2442
|
+
if (!externalSrc && type === "importmap") {
|
|
2443
|
+
const map = parseImportMap(scriptEl.textContent || "", (url) => url);
|
|
2444
|
+
if (map)
|
|
2445
|
+
opts.importMaps.push(map);
|
|
2446
|
+
else
|
|
2447
|
+
console.warn(`[HyperFrames] ${opts.compId}: import map is not valid JSON, so it is skipped.`);
|
|
2448
|
+
} else if (!externalSrc && type === "module") {
|
|
2449
|
+
const prelude = opts.compId ? scopedModulePrelude(opts.runtimeCompId || opts.compId) : "";
|
|
2450
|
+
opts.moduleScripts.push(prelude + (scriptEl.textContent || ""));
|
|
2451
|
+
} else if (externalSrc) {
|
|
2470
2452
|
hoistExternalScript(externalSrc, opts.projectDir, opts.document, opts.seenCompScriptSrcs, opts.compScriptChunks, readExternalScriptAttributes(scriptEl));
|
|
2471
2453
|
} else {
|
|
2472
2454
|
opts.compScriptChunks.push(opts.compId ? wrapScopedCompositionScript(scriptEl.textContent || "", opts.compId, "[HyperFrames] composition script error:", opts.runtimeScope, opts.runtimeCompId || opts.compId, opts.authoredRootId) : wrapInlineScriptWithErrorBoundary(scriptEl.textContent || "", "[HyperFrames] composition script error:"));
|
|
@@ -2489,6 +2471,7 @@ async function bundleProject(projectDir, options) {
|
|
|
2489
2471
|
const resolved = resolve2(sourceDir, relativePath);
|
|
2490
2472
|
return isSafePath(projectDir, resolved) ? resolved : null;
|
|
2491
2473
|
};
|
|
2474
|
+
const resolveEntryUrl = (url) => resolveEntryPath(decodedUrlPath(url));
|
|
2492
2475
|
const readSource = options?.stampHfIds ? ensureHfIds : (html) => html;
|
|
2493
2476
|
noteRead(indexPath);
|
|
2494
2477
|
const rawHtml = readSource(readFileSync(indexPath, "utf-8"));
|
|
@@ -2510,7 +2493,7 @@ async function bundleProject(projectDir, options) {
|
|
|
2510
2493
|
continue;
|
|
2511
2494
|
if (el.hasAttribute("disabled"))
|
|
2512
2495
|
continue;
|
|
2513
|
-
const cssPath =
|
|
2496
|
+
const cssPath = resolveEntryUrl(href);
|
|
2514
2497
|
if (!cssPath)
|
|
2515
2498
|
continue;
|
|
2516
2499
|
const css = safeReadFile(cssPath);
|
|
@@ -2532,7 +2515,7 @@ async function bundleProject(projectDir, options) {
|
|
|
2532
2515
|
])
|
|
2533
2516
|
].map((el) => {
|
|
2534
2517
|
const src = el.getAttribute("src");
|
|
2535
|
-
const path = src && isRelativeUrl(src) ?
|
|
2518
|
+
const path = src && isRelativeUrl(src) ? resolveEntryUrl(src) : null;
|
|
2536
2519
|
return src ? path && safeReadFile(path) || "" : el.textContent || "";
|
|
2537
2520
|
}) : [];
|
|
2538
2521
|
const trackedCompositionHosts = getBundledTrackedCompositionHosts(document);
|
|
@@ -2594,10 +2577,10 @@ async function bundleProject(projectDir, options) {
|
|
|
2594
2577
|
continue;
|
|
2595
2578
|
seenCompScriptSrcs.add(extSrc);
|
|
2596
2579
|
if (isRelativeUrl(extSrc) && scriptItem.type !== "module") {
|
|
2597
|
-
const jsPath =
|
|
2580
|
+
const jsPath = resolveEntryUrl(extSrc);
|
|
2598
2581
|
const js = jsPath ? safeReadFile(jsPath) : null;
|
|
2599
2582
|
if (js != null) {
|
|
2600
|
-
const chunk = () => preserveLocalScriptIntegrity(document, extSrc,
|
|
2583
|
+
const chunk = () => preserveLocalScriptIntegrity(document, extSrc, resolveEntryUrl) ? "" : js;
|
|
2601
2584
|
pushRun(scriptRuns, scriptItem.scene, chunk);
|
|
2602
2585
|
continue;
|
|
2603
2586
|
}
|
|
@@ -2621,8 +2604,12 @@ async function bundleProject(projectDir, options) {
|
|
|
2621
2604
|
const hostIdentity = hostIdentityByElement.get(host);
|
|
2622
2605
|
const runtimeCompId = hostIdentity?.runtimeCompositionId || compId;
|
|
2623
2606
|
const innerDoc = parseHTMLContent(templateHtml);
|
|
2624
|
-
const
|
|
2625
|
-
|
|
2607
|
+
const plan = planCompositionAssembly({
|
|
2608
|
+
contentNode: innerDoc,
|
|
2609
|
+
hasTemplate: true,
|
|
2610
|
+
compositionId: compId
|
|
2611
|
+
});
|
|
2612
|
+
const { innerRoot, authoredRootId } = plan;
|
|
2626
2613
|
const runtimeScope = runtimeCompId ? cssAttributeSelector("data-composition-id", runtimeCompId) : "";
|
|
2627
2614
|
const mergedVariables = runtimeCompId ? parseHostVariableValues(host) : {};
|
|
2628
2615
|
if (runtimeCompId && Object.keys(mergedVariables).length > 0) {
|
|
@@ -2651,7 +2638,9 @@ async function bundleProject(projectDir, options) {
|
|
|
2651
2638
|
runtimeCompId,
|
|
2652
2639
|
authoredRootId: authoredRootId ?? void 0,
|
|
2653
2640
|
seenCompScriptSrcs,
|
|
2654
|
-
compScriptChunks
|
|
2641
|
+
compScriptChunks,
|
|
2642
|
+
importMaps: subCompResult.importMaps,
|
|
2643
|
+
moduleScripts: subCompResult.moduleScripts
|
|
2655
2644
|
});
|
|
2656
2645
|
const innerW = innerRoot.getAttribute("data-width");
|
|
2657
2646
|
const innerH = innerRoot.getAttribute("data-height");
|
|
@@ -2679,10 +2668,14 @@ async function bundleProject(projectDir, options) {
|
|
|
2679
2668
|
runtimeCompId,
|
|
2680
2669
|
authoredRootId: void 0,
|
|
2681
2670
|
seenCompScriptSrcs,
|
|
2682
|
-
compScriptChunks
|
|
2671
|
+
compScriptChunks,
|
|
2672
|
+
importMaps: subCompResult.importMaps,
|
|
2673
|
+
moduleScripts: subCompResult.moduleScripts
|
|
2683
2674
|
});
|
|
2684
2675
|
host.innerHTML = innerDoc.body.innerHTML || "";
|
|
2685
2676
|
}
|
|
2677
|
+
for (const el of plan.inertScriptsOutsideRoot)
|
|
2678
|
+
host.insertAdjacentHTML("beforeend", el.outerHTML);
|
|
2686
2679
|
}
|
|
2687
2680
|
templateEl.remove();
|
|
2688
2681
|
}
|
|
@@ -2690,11 +2683,11 @@ async function bundleProject(projectDir, options) {
|
|
|
2690
2683
|
const src = el.getAttribute("src");
|
|
2691
2684
|
if (!src || !isRelativeUrl(src))
|
|
2692
2685
|
continue;
|
|
2693
|
-
if (preserveLocalScriptIntegrity(document, src,
|
|
2686
|
+
if (preserveLocalScriptIntegrity(document, src, resolveEntryUrl))
|
|
2694
2687
|
continue;
|
|
2695
2688
|
if ((el.getAttribute("type") || "").trim().toLowerCase() === "module")
|
|
2696
2689
|
continue;
|
|
2697
|
-
const jsPath =
|
|
2690
|
+
const jsPath = resolveEntryUrl(src);
|
|
2698
2691
|
const js = jsPath ? safeReadFile(jsPath) : null;
|
|
2699
2692
|
if (js == null)
|
|
2700
2693
|
continue;
|
|
@@ -2724,11 +2717,16 @@ async function bundleProject(projectDir, options) {
|
|
|
2724
2717
|
}
|
|
2725
2718
|
}
|
|
2726
2719
|
for (const { scene, chunks } of scriptRuns) {
|
|
2727
|
-
const
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2720
|
+
const texts = chunks.map((chunk) => typeof chunk === "string" ? chunk : chunk());
|
|
2721
|
+
const joined = joinJsChunks(texts);
|
|
2722
|
+
const skipsRunMerge = Boolean(scene);
|
|
2723
|
+
for (const text of parsesAsScript(joined) ? [joined] : texts.filter(Boolean)) {
|
|
2724
|
+
const script = document.createElement("script");
|
|
2725
|
+
if (scene)
|
|
2726
|
+
script.setAttribute(SCENE_PART_ATTR, scene);
|
|
2727
|
+
script.textContent = skipsRunMerge ? inlineScriptSource(text) : text;
|
|
2728
|
+
document.body.appendChild(script);
|
|
2729
|
+
}
|
|
2732
2730
|
}
|
|
2733
2731
|
emitMountedModuleScripts(document, subCompResult.importMaps, subCompResult.moduleScripts);
|
|
2734
2732
|
emitRootCompositionVariableStyles(document, compVariablesByComp);
|
|
@@ -3027,6 +3025,7 @@ export {
|
|
|
3027
3025
|
inlineSubCompositions,
|
|
3028
3026
|
assignBundledRuntimeCompositionIds,
|
|
3029
3027
|
prepareFlattenedInnerRoot,
|
|
3028
|
+
parsesAsScript,
|
|
3030
3029
|
bundleToSingleHtml,
|
|
3031
3030
|
emitRootCompositionVariableStyles,
|
|
3032
3031
|
extractCompiledHtmlParityContract,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from "./chunk-ISN5GRYI.js";
|
|
18
18
|
import {
|
|
19
19
|
VERSION
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-4OC7MQNB.js";
|
|
21
21
|
|
|
22
22
|
// src/utils/updateCheck.ts
|
|
23
23
|
import { existsSync, readFileSync } from "fs";
|
|
@@ -229,19 +229,22 @@ function cachedUpdateCheck() {
|
|
|
229
229
|
return fallbackResult(readConfig().latestVersion);
|
|
230
230
|
}
|
|
231
231
|
function fallbackResult(cachedLatest) {
|
|
232
|
-
const safeCached =
|
|
232
|
+
const safeCached = safeCachedVersion(cachedLatest);
|
|
233
233
|
return {
|
|
234
234
|
current: VERSION,
|
|
235
235
|
latest: safeCached ?? VERSION,
|
|
236
236
|
updateAvailable: safeCached ? isNewerSemver(safeCached, VERSION) : false
|
|
237
237
|
};
|
|
238
238
|
}
|
|
239
|
+
function safeCachedVersion(value) {
|
|
240
|
+
return typeof value === "string" && isSafeVersion(value) ? value : void 0;
|
|
241
|
+
}
|
|
239
242
|
function getUpdateMeta() {
|
|
240
|
-
const
|
|
243
|
+
const latestVersion = safeCachedVersion(readConfig().latestVersion);
|
|
241
244
|
return {
|
|
242
245
|
version: VERSION,
|
|
243
|
-
latestVersion
|
|
244
|
-
updateAvailable:
|
|
246
|
+
latestVersion,
|
|
247
|
+
updateAvailable: latestVersion ? isNewerSemver(latestVersion, VERSION) : false
|
|
245
248
|
};
|
|
246
249
|
}
|
|
247
250
|
function withMeta(data, options) {
|
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
FONT_ALIAS_MAP,
|
|
16
16
|
resolveAliasDisplayName
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-MQZVBHEY.js";
|
|
18
18
|
import {
|
|
19
19
|
parseHTML
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-SDYDNHEE.js";
|
|
21
21
|
import {
|
|
22
22
|
__commonJS,
|
|
23
23
|
__require,
|
|
@@ -18,10 +18,10 @@ import {
|
|
|
18
18
|
CSS_URL_RE,
|
|
19
19
|
isNonRelativeUrl,
|
|
20
20
|
isPathInside
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-BSQ7XANM.js";
|
|
22
22
|
import {
|
|
23
23
|
parseHTML
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-SDYDNHEE.js";
|
|
25
25
|
|
|
26
26
|
// src/utils/projectLink.ts
|
|
27
27
|
import { randomUUID } from "crypto";
|
|
@@ -7,7 +7,7 @@ var __dirname = __hf_dirname(__filename);
|
|
|
7
7
|
import {
|
|
8
8
|
VALID_CANVAS_RESOLUTIONS,
|
|
9
9
|
resolveResolutionFlagPair
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-MQZVBHEY.js";
|
|
11
11
|
|
|
12
12
|
// src/utils/parseOutputResolution.ts
|
|
13
13
|
function parseOutputResolutionFlag(raw, options) {
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
typeDirPath,
|
|
21
21
|
updateRecord,
|
|
22
22
|
withFigmaErrors
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-2DA2BBNY.js";
|
|
24
24
|
import {
|
|
25
25
|
defineCommand
|
|
26
26
|
} from "./chunk-S3S4TGEH.js";
|
|
@@ -119,7 +119,13 @@ async function runAssetImportMany(refInputs, opts, deps) {
|
|
|
119
119
|
const slots = refs.map(
|
|
120
120
|
(r) => reuseExisting(fileKey, r.nodeId, opts, version, deps, description, entity)
|
|
121
121
|
);
|
|
122
|
-
const
|
|
122
|
+
const nodeIndexes = /* @__PURE__ */ new Map();
|
|
123
|
+
const missIndexes = [];
|
|
124
|
+
for (const [i, ref] of refs.entries()) {
|
|
125
|
+
if (nodeIndexes.has(ref.nodeId)) continue;
|
|
126
|
+
nodeIndexes.set(ref.nodeId, i);
|
|
127
|
+
if (slots[i] === null) missIndexes.push(i);
|
|
128
|
+
}
|
|
123
129
|
try {
|
|
124
130
|
if (missIndexes.length > 0) {
|
|
125
131
|
const missNodeIds = missIndexes.map((i) => refs[i].nodeId);
|
|
@@ -151,9 +157,11 @@ async function runAssetImportMany(refInputs, opts, deps) {
|
|
|
151
157
|
} finally {
|
|
152
158
|
safeRegenerateIndex(deps.projectDir);
|
|
153
159
|
}
|
|
154
|
-
return
|
|
155
|
-
|
|
156
|
-
|
|
160
|
+
return refs.map((ref, i) => {
|
|
161
|
+
const firstIndex = nodeIndexes.get(ref.nodeId) ?? i;
|
|
162
|
+
const result = slots[firstIndex];
|
|
163
|
+
if (!result) throw new Error(`figma asset import produced no result for "${refInputs[i]}"`);
|
|
164
|
+
return firstIndex === i ? result : { ...result, reused: true };
|
|
157
165
|
});
|
|
158
166
|
}
|
|
159
167
|
function normalizeMeta(value) {
|
|
@@ -221,7 +229,7 @@ var asset_default = defineCommand({
|
|
|
221
229
|
rendered > 0 ? `(${results.length} nodes, ${rendered} rendered in 1 figma request)` : `(${results.length} nodes, all reused from cache \u2014 no figma request)`
|
|
222
230
|
);
|
|
223
231
|
}
|
|
224
|
-
const { trackFigmaImport } = await import("./telemetry-
|
|
232
|
+
const { trackFigmaImport } = await import("./telemetry-A23PPRD6.js");
|
|
225
233
|
trackFigmaImport({
|
|
226
234
|
phase: "asset",
|
|
227
235
|
reused: results.every((r) => r.reused),
|
|
@@ -7,7 +7,7 @@ var __dirname = __hf_dirname(__filename);
|
|
|
7
7
|
import {
|
|
8
8
|
getMimeType,
|
|
9
9
|
injectMediaCodecMapIntoHtml
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-XGFHYAYN.js";
|
|
11
11
|
import {
|
|
12
12
|
PROXY_VARIANT_CONFIG,
|
|
13
13
|
ProxyCapacityError,
|
|
@@ -18,10 +18,13 @@ import {
|
|
|
18
18
|
recordProxyRequest,
|
|
19
19
|
resolveProxy,
|
|
20
20
|
resolveProxyVariantRequest
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-ZOA2SC4P.js";
|
|
22
22
|
import {
|
|
23
23
|
resolveAutoProxy
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-JEHFZQYT.js";
|
|
25
|
+
import {
|
|
26
|
+
decodeWellFormedEscapes
|
|
27
|
+
} from "./chunk-BSQ7XANM.js";
|
|
25
28
|
|
|
26
29
|
// src/utils/staticProjectServer.ts
|
|
27
30
|
import { createServer } from "http";
|
|
@@ -51,6 +54,11 @@ function serveFileWithRange(filePath, rangeHeader, res, contentType = getMimeTyp
|
|
|
51
54
|
headers["Content-Range"] = `bytes ${start}-${end}/${size}`;
|
|
52
55
|
}
|
|
53
56
|
headers["Content-Length"] = String(end - start + 1);
|
|
57
|
+
if (size === 0) {
|
|
58
|
+
res.writeHead(status, headers);
|
|
59
|
+
res.end();
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
54
62
|
const stream = createReadStream(filePath, { start, end });
|
|
55
63
|
stream.on("open", () => {
|
|
56
64
|
res.writeHead(status, headers);
|
|
@@ -125,7 +133,7 @@ async function serveStaticProjectHtml(projectDir, html, bindErrorMessage = "Fail
|
|
|
125
133
|
const pathOnly = queryIndex === -1 ? url : url.slice(0, queryIndex);
|
|
126
134
|
const proxyParam = queryIndex === -1 ? null : new URLSearchParams(url.slice(queryIndex + 1)).get("hf-proxy");
|
|
127
135
|
const proxyRequest = proxyParam !== null && isProxyVariantRequest(proxyParam) ? proxyParam : null;
|
|
128
|
-
const requestPath =
|
|
136
|
+
const requestPath = decodeWellFormedEscapes(pathOnly).replace(/^\//, "");
|
|
129
137
|
for (const root of roots) {
|
|
130
138
|
const filePath = resolve(root, requestPath);
|
|
131
139
|
const rel = relative(root, filePath);
|