hyperframes 0.8.124 → 0.8.126

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.
Files changed (148) hide show
  1. package/dist/{add-KDN5JOAP.js → add-7NBR6B3F.js} +14 -14
  2. package/dist/{animatedGifPrep-H6ZIMS3L.js → animatedGifPrep-L5V2GEUO.js} +5 -5
  3. package/dist/{asset-EJFBLFOA.js → asset-JBGYRDTW.js} +2 -2
  4. package/dist/{assetCataloger-3Z4RUM5K.js → assetCataloger-2DWSDIJG.js} +2 -2
  5. package/dist/{auth-QUOT4AVB.js → auth-6CYSAYBB.js} +2 -2
  6. package/dist/{autoUpdate-LM6YIFM4.js → autoUpdate-NOG7CHB6.js} +2 -2
  7. package/dist/{backgroundChecks-PZEX77KC.js → backgroundChecks-7CCDAF4Q.js} +3 -3
  8. package/dist/backgroundChecksWorker.js +3 -3
  9. package/dist/{batchRender-SYREZLNM.js → batchRender-KOMFN3WS.js} +3 -3
  10. package/dist/{beats-GAROPWZX.js → beats-TUAVN7GG.js} +11 -11
  11. package/dist/{benchmark-R27INLK2.js → benchmark-TE726E5O.js} +11 -11
  12. package/dist/{browser-UAMARUY3.js → browser-2LX4CSEG.js} +8 -8
  13. package/dist/{bundleWithLocalizedFonts-SJFCS4WH.js → bundleWithLocalizedFonts-5RRZNHVZ.js} +2 -2
  14. package/dist/{capture-NT33PXQT.js → capture-35UCVULB.js} +2 -2
  15. package/dist/{capture-42GHDJSH.js → capture-VP3NXL6L.js} +8 -8
  16. package/dist/{catalog-DDLMJXPU.js → catalog-AGTKIUQX.js} +14 -14
  17. package/dist/{check-IQJEGVTI.js → check-6FNESOS3.js} +30 -30
  18. package/dist/{checkBrowser-QDTOZNUM.js → checkBrowser-QSTDEWYE.js} +29 -29
  19. package/dist/{chunk-WCO25Y7W.js → chunk-2GIIUVKT.js} +2 -2
  20. package/dist/{chunk-SR2PZ7YB.js → chunk-2JJO2O4F.js} +2 -2
  21. package/dist/{chunk-UZKSKWYC.js → chunk-3GSNYSFF.js} +2 -2
  22. package/dist/{chunk-LVXNXV7G.js → chunk-3XZK3GNY.js} +1 -1
  23. package/dist/{chunk-ONB7D3WM.js → chunk-44ABPBX3.js} +2 -2
  24. package/dist/{chunk-RGAOEDD7.js → chunk-4X2UFVOK.js} +1 -1
  25. package/dist/{chunk-AIAHR2KP.js → chunk-5CJ3YWEE.js} +7 -7
  26. package/dist/{chunk-AOJIC4Z6.js → chunk-5WXI4DPS.js} +1 -1
  27. package/dist/{chunk-BDERXFDQ.js → chunk-67QQI7JH.js} +2 -2
  28. package/dist/chunk-AQIS2UNW.js +3578 -0
  29. package/dist/{chunk-RG4XNPAS.js → chunk-BE6X3G5C.js} +1 -1
  30. package/dist/{chunk-JTOXXJ2V.js → chunk-BKXZGOH7.js} +1 -1
  31. package/dist/{chunk-CSACVU42.js → chunk-BVY7I3HG.js} +1 -1
  32. package/dist/{chunk-KAG5RIH3.js → chunk-BW5F5OXO.js} +39 -47
  33. package/dist/{chunk-73KQTPK5.js → chunk-CHMDN7EH.js} +1 -1
  34. package/dist/{chunk-2X6IXODS.js → chunk-ECF5RGLH.js} +5 -5
  35. package/dist/{chunk-M73S37KU.js → chunk-G2XWQ4ZE.js} +1 -1
  36. package/dist/{chunk-RPVBIUYA.js → chunk-HWTQNKW5.js} +2 -2
  37. package/dist/{chunk-5JLKZMCL.js → chunk-I2AFLOPD.js} +1 -1
  38. package/dist/{chunk-TAVCXJDZ.js → chunk-INWZRXCW.js} +3 -3
  39. package/dist/{chunk-ORICANJF.js → chunk-IRAEOBDX.js} +1 -1
  40. package/dist/{chunk-PLQ4HJOO.js → chunk-JMI5PVKK.js} +1 -1
  41. package/dist/{chunk-W777U57N.js → chunk-JR73DPKV.js} +1 -1
  42. package/dist/{chunk-E5BAQVYP.js → chunk-KB37AHZU.js} +1 -1
  43. package/dist/{chunk-ZXKQI3CL.js → chunk-KTJUHHEQ.js} +1 -1
  44. package/dist/{chunk-5WAPJM7Q.js → chunk-NZWMOYQ4.js} +1 -1
  45. package/dist/{chunk-HHUXXGXS.js → chunk-ONACH4F6.js} +1 -1
  46. package/dist/{chunk-VFCR64GO.js → chunk-OQS3A7QF.js} +9 -8
  47. package/dist/{chunk-FFRD7C5Y.js → chunk-PWZANSLF.js} +21 -20
  48. package/dist/{chunk-N2NKZH5T.js → chunk-RHXKUUEP.js} +9 -9
  49. package/dist/{chunk-2C5KGTYX.js → chunk-STZBZXZT.js} +1 -1
  50. package/dist/{chunk-BTJLBKJM.js → chunk-SXPMTU6B.js} +5 -5
  51. package/dist/{chunk-PSUC7UH5.js → chunk-THTG3VL4.js} +1 -1
  52. package/dist/{chunk-4HC572SI.js → chunk-TKWTL6GV.js} +2 -2
  53. package/dist/{chunk-LHUITV7D.js → chunk-TO6DMAUZ.js} +1 -1
  54. package/dist/{chunk-W7MBO3OA.js → chunk-U4FYLOXY.js} +2 -2
  55. package/dist/{chunk-CMH5CSTH.js → chunk-UB7MYXCO.js} +2 -2
  56. package/dist/{chunk-72BGWI35.js → chunk-VVKADE6I.js} +3 -3
  57. package/dist/{chunk-HQWCFX5E.js → chunk-WYPGIFYA.js} +1 -1
  58. package/dist/{chunk-O2UUDQIA.js → chunk-X34RX267.js} +3 -3
  59. package/dist/{chunk-CQMEZZGB.js → chunk-YYMPS4RQ.js} +9 -9
  60. package/dist/{chunk-UB7TKYHI.js → chunk-ZKUDKJDT.js} +1 -1
  61. package/dist/{chunk-5UQEHMDX.js → chunk-ZZWX22ZL.js} +4 -4
  62. package/dist/{clean-JUJTGQLY.js → clean-AUQHQ42C.js} +14 -14
  63. package/dist/cli.js +51 -51
  64. package/dist/{cloud-OTGRJ55X.js → cloud-4AEBQ4XH.js} +4 -4
  65. package/dist/{cloudrun-MR2BDNIE.js → cloudrun-S7IW2H35.js} +3 -3
  66. package/dist/{compare-PI2BE6XG.js → compare-ZCPVJC7Y.js} +24 -24
  67. package/dist/{compiler-534QUPGQ.js → compiler-ONZBL2Z2.js} +6 -2
  68. package/dist/{component-23F5FX7F.js → component-D5WGH5CE.js} +3 -3
  69. package/dist/{compositions-QBMBMSWK.js → compositions-L5HA7YJU.js} +10 -10
  70. package/dist/{delete-OWPF7ECQ.js → delete-WWRSJ4KP.js} +2 -2
  71. package/dist/{dist-UBW5W3J6.js → dist-6YFMU2EX.js} +2 -2
  72. package/dist/{doctor-ET66NXTR.js → doctor-JISX7NCX.js} +9 -9
  73. package/dist/{events-YB7V7HKA.js → events-XD7RFVVW.js} +8 -8
  74. package/dist/{events-IF4ANAI4.js → events-YVGY4DDL.js} +7 -7
  75. package/dist/{feedback-BXKESP4T.js → feedback-S7GVNKI5.js} +9 -9
  76. package/dist/{figma-HNCCW27E.js → figma-PGHX2SST.js} +3 -3
  77. package/dist/fontLocalizeCli.js +7 -7
  78. package/dist/{get-BFS6LW4G.js → get-GCOZY5GX.js} +2 -2
  79. package/dist/{gpuPolicy-NTPPP3CY.js → gpuPolicy-PF25HSOC.js} +5 -5
  80. package/dist/{grade-compare-ZODD5CA2.js → grade-compare-6GXSZOQD.js} +24 -24
  81. package/dist/{help-PDKEUTLM.js → help-MGQRBCOB.js} +1 -1
  82. package/dist/{history-DPCZXCFM.js → history-OR4CFVKW.js} +14 -14
  83. package/dist/hyperframe-runtime.js +50 -50
  84. package/dist/hyperframe.manifest.json +1 -1
  85. package/dist/hyperframe.runtime.iife.js +50 -50
  86. package/dist/hyperframes-player.global.js +1 -1
  87. package/dist/{info-BZBRLNDJ.js → info-ORCBX5QT.js} +10 -10
  88. package/dist/{init-24RQT53L.js → init-2VMWQT7Q.js} +21 -21
  89. package/dist/{inspect-UUJSVALX.js → inspect-ESXETWYQ.js} +25 -25
  90. package/dist/{installer-3MYH2BBT.js → installer-DY5EJGH4.js} +4 -4
  91. package/dist/{keyframes-ZBT47ZXP.js → keyframes-SVZSP2IX.js} +11 -11
  92. package/dist/{lambda-254KZLDB.js → lambda-SU52VKMJ.js} +4 -4
  93. package/dist/{layout-D7VXT7ZZ.js → layout-2QQITNZH.js} +25 -25
  94. package/dist/{lint-CIMEKZSB.js → lint-JWDUEMAF.js} +11 -11
  95. package/dist/{list-WBRIEQZM.js → list-DMA3RMP3.js} +2 -2
  96. package/dist/{login-PBKOV6TK.js → login-L3YG6OGU.js} +4 -4
  97. package/dist/{media-treatment-XIBOCHGF.js → media-treatment-NVAU46UZ.js} +11 -11
  98. package/dist/{models-7UT4RZUL.js → models-ULNRSUPZ.js} +6 -6
  99. package/dist/{motionShot-WB7E5FU7.js → motionShot-UZ55EFYK.js} +11 -11
  100. package/dist/{normalize-audio-PMU2FXZA.js → normalize-audio-E5S32LB7.js} +10 -10
  101. package/dist/{open-AVSLHVOE.js → open-IF42Y7XZ.js} +9 -9
  102. package/dist/{pipeline-5E76S72B.js → pipeline-2SJBNWN6.js} +5 -5
  103. package/dist/{play-SVTXUB2Z.js → play-NWZVZ2VG.js} +19 -19
  104. package/dist/{preflight-LGJKUHUZ.js → preflight-DLBJ2ORQ.js} +6 -6
  105. package/dist/{present-NE6EYZY2.js → present-G3D32OYG.js} +15 -15
  106. package/dist/{preview-4EGR22E3.js → preview-2DFT6L5Y.js} +16 -16
  107. package/dist/{producer-2ZWSHMK3.js → producer-HDJFB63D.js} +1 -1
  108. package/dist/{projectConfig-VC5MAYSS.js → projectConfig-MNOSK2QD.js} +6 -6
  109. package/dist/{publication-YXOCJQ7B.js → publication-YDMJ7ZWP.js} +2 -2
  110. package/dist/{publish-GTXVX6O4.js → publish-2U3QFDUG.js} +7 -7
  111. package/dist/{remove-background-VOBXCXXJ.js → remove-background-WGQL5TTE.js} +6 -6
  112. package/dist/{render-4PBKSNC3.js → render-IP5YBVN3.js} +20 -20
  113. package/dist/{render-M446K7E4.js → render-KOZDACHF.js} +11 -11
  114. package/dist/{render-BNUTBDFX.js → render-Z2JVFMEG.js} +3 -3
  115. package/dist/{render-batch-WJKUYKUZ.js → render-batch-MLATEYNJ.js} +3 -3
  116. package/dist/{renderCancellation-QUEUCG6R.js → renderCancellation-GIVVJ4Y5.js} +5 -5
  117. package/dist/{resolver-3QPZA2X6.js → resolver-YPSQI4QB.js} +4 -4
  118. package/dist/{sherpa-LQHE6MT7.js → sherpa-XJUQMGO2.js} +6 -6
  119. package/dist/{skills-C6C23Z7M.js → skills-C4AYI3JQ.js} +10 -10
  120. package/dist/{skillsUpdateCheck-MR5TXEAX.js → skillsUpdateCheck-SZ5YHOKU.js} +3 -3
  121. package/dist/{snapshot-F5ZSC5FM.js → snapshot-ITGMVKHC.js} +25 -25
  122. package/dist/{src-HP5DTGMY.js → src-B2EJ6PDH.js} +6 -6
  123. package/dist/{src-WEETQ4CZ.js → src-T3KNHVM4.js} +4 -4
  124. package/dist/{staticProjectServer-REKZ3KBB.js → staticProjectServer-XMPCVKOC.js} +13 -13
  125. package/dist/{status-DKHWOUB4.js → status-26CCBKGN.js} +5 -5
  126. package/dist/studio/assets/{hyperframes-player-ColOZ_78.js → hyperframes-player-BbbN-wWN.js} +1 -1
  127. package/dist/studio/assets/{index-BuSTrK-Z.js → index-B8kU2xXl.js} +177 -177
  128. package/dist/studio/assets/{index-CVuUfURE.js → index-Cll7uTNy.js} +1 -1
  129. package/dist/studio/assets/{index-jQEqFKMk.js → index-nvLF29ZH.js} +1 -1
  130. package/dist/studio/index.d.ts +43 -35
  131. package/dist/studio/index.html +1 -1
  132. package/dist/studio/index.js +4458 -4072
  133. package/dist/studio/index.js.map +1 -1
  134. package/dist/{studio-api-SY5SFHZD.js → studio-api-RGD6QIM6.js} +7 -7
  135. package/dist/{studioServer-2ZWULGC5.js → studioServer-4KI47OI7.js} +37 -37
  136. package/dist/{system-L7VMXFIG.js → system-KCJSXBNN.js} +5 -5
  137. package/dist/{telemetry-XYNKPYSU.js → telemetry-4O4ERZUD.js} +8 -8
  138. package/dist/{timeline-MYGD5OEC.js → timeline-MFCQASNE.js} +14 -14
  139. package/dist/{tokens-6DZ73AXR.js → tokens-TI7WWQJ6.js} +2 -2
  140. package/dist/{transcribe-F4DDIZJO.js → transcribe-GUOLCXLE.js} +6 -6
  141. package/dist/{transcribe-3BUOOE6P.js → transcribe-P72V4E5C.js} +11 -11
  142. package/dist/{updateCheck-VH46SJ2X.js → updateCheck-GGXGOFYE.js} +2 -2
  143. package/dist/{upgrade-J4MZ4MLN.js → upgrade-CJRMDDJD.js} +2 -2
  144. package/dist/{urlDownloader-PCRAON2D.js → urlDownloader-F7DTZEP4.js} +4 -4
  145. package/dist/{validate-BOYSXZFW.js → validate-VJ4JRMM2.js} +15 -15
  146. package/dist/{video-GL7ZDEFL.js → video-KVK4KZPN.js} +5 -5
  147. package/package.json +1 -1
  148. package/dist/chunk-F6QGSVUR.js +0 -3571
@@ -8,7 +8,7 @@ import {
8
8
  MAX_AUDIO_GAIN_DB,
9
9
  formatAudioGain,
10
10
  isAudibleVideoElement
11
- } from "./chunk-F6QGSVUR.js";
11
+ } from "./chunk-AQIS2UNW.js";
12
12
  import {
13
13
  findFfBinary
14
14
  } from "./chunk-PJ3HDUCY.js";
@@ -7,7 +7,7 @@ var __dirname = __hf_dirname(__filename);
7
7
 
8
8
  // src/utils/producer.ts
9
9
  async function loadProducer() {
10
- return await import("./src-HP5DTGMY.js");
10
+ return await import("./src-B2EJ6PDH.js");
11
11
  }
12
12
 
13
13
  export {
@@ -1278,7 +1278,7 @@ async function withFigmaErrors(command, fn) {
1278
1278
  } catch (err) {
1279
1279
  if (err instanceof Error) {
1280
1280
  try {
1281
- const { trackCommandFailure } = await import("./events-YB7V7HKA.js");
1281
+ const { trackCommandFailure } = await import("./events-XD7RFVVW.js");
1282
1282
  trackCommandFailure(
1283
1283
  command,
1284
1284
  err,
@@ -9,11 +9,12 @@ import {
9
9
  RUNTIME_BOOTSTRAP_ATTR,
10
10
  clampDurations,
11
11
  compileTimingAttrs,
12
+ escapeInlineScriptSource,
12
13
  extractResolvedMedia,
13
14
  getHyperframeRuntimeScript,
14
15
  injectDurations,
15
16
  injectTagsAtHeadStart,
16
- insertBeforeCloseTag,
17
+ insertRuntimeTag,
17
18
  parseHTMLContent,
18
19
  parseHostVariableValues,
19
20
  queryByAttr,
@@ -21,7 +22,7 @@ import {
21
22
  shouldClampResolvedMediaDuration,
22
23
  stripEmbeddedRuntimeScripts,
23
24
  warnUnknownEnumValues
24
- } from "./chunk-F6QGSVUR.js";
25
+ } from "./chunk-AQIS2UNW.js";
25
26
  import {
26
27
  cssVariableName
27
28
  } from "./chunk-VC76R6W2.js";
@@ -97,12 +98,33 @@ async function compileHtml(rawHtml, projectDir, probeMediaDuration) {
97
98
  }
98
99
 
99
100
  // ../core/dist/compiler/scriptRuns.js
101
+ var JAVASCRIPT_TYPES = /* @__PURE__ */ new Set([
102
+ "",
103
+ "application/ecmascript",
104
+ "application/javascript",
105
+ "application/x-ecmascript",
106
+ "application/x-javascript",
107
+ "text/ecmascript",
108
+ "text/javascript",
109
+ "text/javascript1.0",
110
+ "text/javascript1.1",
111
+ "text/javascript1.2",
112
+ "text/javascript1.3",
113
+ "text/javascript1.4",
114
+ "text/javascript1.5",
115
+ "text/jscript",
116
+ "text/livescript",
117
+ "text/x-ecmascript",
118
+ "text/x-javascript"
119
+ ]);
120
+ function isJavaScriptType(el) {
121
+ return JAVASCRIPT_TYPES.has((el.getAttribute("type") || "").trim().toLowerCase());
122
+ }
100
123
  function isClassicInline(el) {
101
- const type = (el.getAttribute("type") || "").trim().toLowerCase();
102
- return !type || type === "text/javascript" || type === "application/javascript";
124
+ return !el.hasAttribute("nomodule") && isJavaScriptType(el);
103
125
  }
104
126
  function isSeparateExecution(el, isPinned) {
105
- return el.hasAttribute("src") || isPinned(el) || (el.getAttribute("type") || "").trim().toLowerCase() === "module";
127
+ return el.hasAttribute("src") || el.hasAttribute("defer") || el.hasAttribute("async") || isPinned(el) || (el.getAttribute("type") || "").trim().toLowerCase() === "module";
106
128
  }
107
129
  function inlineScriptRuns(scripts, isPinned = () => false) {
108
130
  const runs = [];
@@ -125,6 +147,8 @@ var AFTER_FONTS_SCRIPT_TYPE = "text/hf-after-fonts";
125
147
  var AFTER_FONTS_MODULE_TYPE = `${AFTER_FONTS_SCRIPT_TYPE}+module`;
126
148
  var AFTER_FONTS_SCRIPTS = `script[type="${AFTER_FONTS_SCRIPT_TYPE}"], script[type="${AFTER_FONTS_MODULE_TYPE}"]`;
127
149
  var AFTER_FONTS_CLAIM = "__hfAfterFontsClaimed";
150
+ var INLINED_FILE_ATTR = "data-hf-inlined-src";
151
+ var DEFERRED_FILE = `[defer][src], [defer][${INLINED_FILE_ATTR}]`;
128
152
  var AFTER_FONTS_FALLBACK_ATTR = "data-hf-after-fonts-fallback";
129
153
  var afterFontsFallback = () => `document.addEventListener("DOMContentLoaded", function () {
130
154
  if (window.${AFTER_FONTS_CLAIM}) return;
@@ -132,7 +156,7 @@ var afterFontsFallback = () => `document.addEventListener("DOMContentLoaded", fu
132
156
  var all = [].slice.call(document.querySelectorAll('${AFTER_FONTS_SCRIPTS}'));
133
157
  if (!all.length) return;
134
158
  console.warn("[hyperframes] the runtime has no web-font gate; composition scripts run without waiting for fonts");
135
- var late = function (el) { return el.type !== T || (el.hasAttribute("src") && el.hasAttribute("defer")); };
159
+ var late = function (el) { return el.type !== T || el.matches('${DEFERRED_FILE}'); };
136
160
  var queue = all.filter(function (el) { return !late(el); }).concat(all.filter(late));
137
161
  (function next() {
138
162
  var el = queue.shift();
@@ -1833,8 +1857,6 @@ function getRuntimeScriptUrl() {
1833
1857
  }
1834
1858
  function injectInterceptor(html, runtimeMode = "inline") {
1835
1859
  const sanitized = stripEmbeddedRuntimeScripts(html);
1836
- if (sanitized.includes(RUNTIME_BOOTSTRAP_ATTR))
1837
- return sanitized;
1838
1860
  const runtimeScriptUrl = getRuntimeScriptUrl();
1839
1861
  let tag;
1840
1862
  if (runtimeScriptUrl) {
@@ -1846,21 +1868,7 @@ function injectInterceptor(html, runtimeMode = "inline") {
1846
1868
  const inlinedRuntime = getHyperframeRuntimeScript();
1847
1869
  tag = `<script ${RUNTIME_BOOTSTRAP_ATTR}="1">${inlinedRuntime}</script>`;
1848
1870
  }
1849
- const withHead = insertBeforeCloseTag(sanitized, "head", `${tag}
1850
- `);
1851
- if (withHead !== null)
1852
- return withHead;
1853
- const htmlOpenMatch = sanitized.match(/<html\b[^>]*>/i);
1854
- if (htmlOpenMatch?.index != null) {
1855
- const insertPos = htmlOpenMatch.index + htmlOpenMatch[0].length;
1856
- return `${sanitized.slice(0, insertPos)}<head>${tag}</head>${sanitized.slice(insertPos)}`;
1857
- }
1858
- const doctypeIdx = sanitized.toLowerCase().indexOf("<!doctype");
1859
- if (doctypeIdx >= 0) {
1860
- const insertPos = sanitized.indexOf(">", doctypeIdx) + 1;
1861
- return sanitized.slice(0, insertPos) + tag + sanitized.slice(insertPos);
1862
- }
1863
- return tag + sanitized;
1871
+ return insertRuntimeTag(sanitized, tag);
1864
1872
  }
1865
1873
  function isRelativeUrl(url) {
1866
1874
  return !isNonRelativeUrl(url) && !isAbsolute(url);
@@ -2429,7 +2437,7 @@ function coalesceHeadStylesAndBodyScripts(document) {
2429
2437
  if (!mergedJs)
2430
2438
  continue;
2431
2439
  const inlineScript = document.createElement("script");
2432
- inlineScript.textContent = stripJsCommentsParserSafe(mergedJs);
2440
+ inlineScript.textContent = escapeInlineScriptSource(stripJsCommentsParserSafe(mergedJs));
2433
2441
  if (anchor)
2434
2442
  anchor.before(inlineScript);
2435
2443
  else
@@ -2714,8 +2722,6 @@ async function bundleProject(projectDir, options) {
2714
2722
  }
2715
2723
  templateEl.remove();
2716
2724
  }
2717
- const localJsChunks = [];
2718
- let jsAnchorPlaced = false;
2719
2725
  for (const el of [...document.querySelectorAll("script[src]")]) {
2720
2726
  const src = el.getAttribute("src");
2721
2727
  if (!src || !isRelativeUrl(src))
@@ -2728,27 +2734,9 @@ async function bundleProject(projectDir, options) {
2728
2734
  const js = jsPath ? safeReadFile(jsPath) : null;
2729
2735
  if (js == null)
2730
2736
  continue;
2731
- localJsChunks.push(js);
2732
- if (!jsAnchorPlaced) {
2733
- const anchor = document.createElement("script");
2734
- anchor.setAttribute("data-hf-bundled-local-js", "1");
2735
- el.replaceWith(anchor);
2736
- jsAnchorPlaced = true;
2737
- } else {
2738
- el.remove();
2739
- }
2740
- }
2741
- if (localJsChunks.length > 0) {
2742
- const anchor = document.querySelector('script[data-hf-bundled-local-js="1"]');
2743
- const joinedJs = joinJsChunks(localJsChunks);
2744
- if (anchor) {
2745
- anchor.removeAttribute("data-hf-bundled-local-js");
2746
- anchor.textContent = joinedJs;
2747
- } else {
2748
- const script = document.createElement("script");
2749
- script.textContent = joinedJs;
2750
- document.body.appendChild(script);
2751
- }
2737
+ el.setAttribute(INLINED_FILE_ATTR, src);
2738
+ el.removeAttribute("src");
2739
+ el.textContent = js;
2752
2740
  }
2753
2741
  for (const link of compExternalLinks)
2754
2742
  ensureExternalLinkTag(document, link);
@@ -2783,6 +2771,10 @@ async function bundleProject(projectDir, options) {
2783
2771
  enforceCompositionPixelSizing(document);
2784
2772
  autoHealMissingCompositionIds(document);
2785
2773
  coalesceHeadStylesAndBodyScripts(document);
2774
+ for (const el of document.querySelectorAll(`script[${INLINED_FILE_ATTR}]`)) {
2775
+ const js = el.textContent ?? "";
2776
+ el.textContent = escapeInlineScriptSource(isJavaScriptType(el) ? stripJsCommentsParserSafe(js) : js);
2777
+ }
2786
2778
  deferScriptsUntilFonts(document, (el) => el.hasAttribute(RUNTIME_BOOTSTRAP_ATTR));
2787
2779
  injectTextRenderingRule(document);
2788
2780
  const inlineAssets = options?.inlineAssets !== false;
@@ -8,7 +8,7 @@ import {
8
8
  firstFrameColourArgs,
9
9
  hdrToSdrToneMapFilter,
10
10
  parseFirstFrameColour
11
- } from "./chunk-LVXNXV7G.js";
11
+ } from "./chunk-3XZK3GNY.js";
12
12
  import {
13
13
  mkdirWithinProject,
14
14
  realProjectRoot,
@@ -10,21 +10,21 @@ import {
10
10
  import {
11
11
  launchManagedBrowser,
12
12
  resolveManagedGpuMode
13
- } from "./chunk-PLQ4HJOO.js";
13
+ } from "./chunk-JMI5PVKK.js";
14
14
  import {
15
15
  resolveDiagnosticNavigationTimeoutMs,
16
16
  windowsChromeCrashRemediation
17
- } from "./chunk-LHUITV7D.js";
17
+ } from "./chunk-TO6DMAUZ.js";
18
18
  import {
19
19
  resolveLocalBrowserGpuMode
20
- } from "./chunk-ZXKQI3CL.js";
20
+ } from "./chunk-KTJUHHEQ.js";
21
21
  import {
22
22
  c
23
23
  } from "./chunk-ZTZA4UWZ.js";
24
24
  import {
25
25
  assertWebGpuAdapterAvailable,
26
26
  compositionRequiresWebGpu
27
- } from "./chunk-CMH5CSTH.js";
27
+ } from "./chunk-UB7MYXCO.js";
28
28
  import {
29
29
  normalizeErrorMessage
30
30
  } from "./chunk-KNU5COPB.js";
@@ -103,7 +103,7 @@ async function openSettledCompositionPage(html, url, options) {
103
103
  const { ensureBrowser, findSystemBrowser } = await import("./manager-CT3D67CG.js");
104
104
  const browser = await ensureBrowser();
105
105
  const puppeteer = await import("puppeteer-core");
106
- const { buildChromeArgs } = await import("./src-WEETQ4CZ.js");
106
+ const { buildChromeArgs } = await import("./src-T3KNHVM4.js");
107
107
  const requestedGpuMode = options.browserGpuMode ?? resolveCliChromeGpuMode();
108
108
  const requiresWebGpu = compositionRequiresWebGpu(html);
109
109
  const launch = async (executablePath) => {
@@ -27,7 +27,7 @@ import {
27
27
  } from "./chunk-GMECXFAN.js";
28
28
  import {
29
29
  ITEM_TYPE_DIRS
30
- } from "./chunk-LVXNXV7G.js";
30
+ } from "./chunk-3XZK3GNY.js";
31
31
  import {
32
32
  realProjectRoot
33
33
  } from "./chunk-OFQWTKPW.js";
@@ -8,10 +8,10 @@ import {
8
8
  DEFAULT_VP9_CPU_USED,
9
9
  isHttpUrl,
10
10
  runFfmpeg
11
- } from "./chunk-CMH5CSTH.js";
11
+ } from "./chunk-UB7MYXCO.js";
12
12
  import {
13
13
  parseAnimatedGifMetadata
14
- } from "./chunk-LVXNXV7G.js";
14
+ } from "./chunk-3XZK3GNY.js";
15
15
  import {
16
16
  parseHTML
17
17
  } from "./chunk-GK4AIFIH.js";
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-HVW7ABXD.js";
13
13
  import {
14
14
  DEFAULT_REGISTRY_URL
15
- } from "./chunk-M73S37KU.js";
15
+ } from "./chunk-G2XWQ4ZE.js";
16
16
 
17
17
  // src/utils/projectConfig.ts
18
18
  import { readFileSync, writeFileSync } from "fs";
@@ -7,7 +7,7 @@ var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  getMimeType,
9
9
  injectMediaCodecMapIntoHtml
10
- } from "./chunk-FFRD7C5Y.js";
10
+ } from "./chunk-PWZANSLF.js";
11
11
  import {
12
12
  PROXY_VARIANT_CONFIG,
13
13
  ProxyCapacityError,
@@ -18,10 +18,10 @@ import {
18
18
  recordProxyRequest,
19
19
  resolveProxy,
20
20
  resolveProxyVariantRequest
21
- } from "./chunk-73KQTPK5.js";
21
+ } from "./chunk-CHMDN7EH.js";
22
22
  import {
23
23
  resolveAutoProxy
24
- } from "./chunk-5JLKZMCL.js";
24
+ } from "./chunk-I2AFLOPD.js";
25
25
 
26
26
  // src/utils/staticProjectServer.ts
27
27
  import { createServer } from "http";
@@ -13,7 +13,7 @@ import {
13
13
  } from "./chunk-TVCRUG2S.js";
14
14
  import {
15
15
  getFreeDiskMb
16
- } from "./chunk-E5BAQVYP.js";
16
+ } from "./chunk-KB37AHZU.js";
17
17
  import {
18
18
  ensureBrowser,
19
19
  findBrowser
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  resolveCaptureBrowserGpuMode
9
- } from "./chunk-ZXKQI3CL.js";
9
+ } from "./chunk-KTJUHHEQ.js";
10
10
  import {
11
11
  requestCliExit
12
12
  } from "./chunk-PBN6GBJE.js";
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  VERSION
9
- } from "./chunk-SR2PZ7YB.js";
9
+ } from "./chunk-2JJO2O4F.js";
10
10
 
11
11
  // src/registry/compatibility.ts
12
12
  import { compareVersions } from "compare-versions";
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-AMKC3AXA.js";
10
10
  import {
11
11
  getSystemTotalMb
12
- } from "./chunk-CMH5CSTH.js";
12
+ } from "./chunk-UB7MYXCO.js";
13
13
 
14
14
  // src/telemetry/system.ts
15
15
  import { cpus, freemem, platform as platform2, release as release2 } from "os";
@@ -13,7 +13,7 @@ function resolveLocalBrowserGpuMode(browserGpuArg, envMode = process.env.PRODUCE
13
13
  return "auto";
14
14
  }
15
15
  async function resolveCaptureBrowserGpuMode(requestedMode, chromePath) {
16
- const { resolveBrowserGpuMode } = await import("./src-WEETQ4CZ.js");
16
+ const { resolveBrowserGpuMode } = await import("./src-T3KNHVM4.js");
17
17
  return resolveBrowserGpuMode(requestedMode, { chromePath });
18
18
  }
19
19
 
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-IHFUKJOR.js";
10
10
  import {
11
11
  trackCommandFailure
12
- } from "./chunk-72BGWI35.js";
12
+ } from "./chunk-VVKADE6I.js";
13
13
  import {
14
14
  failCommand
15
15
  } from "./chunk-PBN6GBJE.js";
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk-AWDFDFI3.js";
15
15
  import {
16
16
  isBlockedNetworkHost
17
- } from "./chunk-CMH5CSTH.js";
17
+ } from "./chunk-UB7MYXCO.js";
18
18
  import {
19
19
  DOMParser,
20
20
  parseHTML
@@ -17,7 +17,7 @@ import {
17
17
  EncoderInterruptedError,
18
18
  encoderFailureError,
19
19
  prepareAnimatedGifInputs
20
- } from "./chunk-RPVBIUYA.js";
20
+ } from "./chunk-HWTQNKW5.js";
21
21
  import {
22
22
  createStudioPositionSeekReapplyScript
23
23
  } from "./chunk-KC5XXX3X.js";
@@ -145,7 +145,7 @@ import {
145
145
  validateEngineConfigSnapshot,
146
146
  verifyDiskDrawElementSamples,
147
147
  writeCapturedFrame
148
- } from "./chunk-CMH5CSTH.js";
148
+ } from "./chunk-UB7MYXCO.js";
149
149
  import {
150
150
  HF_VFX_ATTR,
151
151
  MEDIA_START_BASIS_ATTR,
@@ -163,7 +163,7 @@ import {
163
163
  resolveAbsoluteMediaStartSeconds,
164
164
  resolveAuthoredTimingWindow,
165
165
  toFps
166
- } from "./chunk-LVXNXV7G.js";
166
+ } from "./chunk-3XZK3GNY.js";
167
167
  import {
168
168
  CANVAS_DIMENSIONS,
169
169
  HTML_BODY_CSS_HEIGHT_FIRST_RE,
@@ -188,7 +188,7 @@ import {
188
188
  inlineSubCompositions,
189
189
  prepareFlattenedInnerRoot,
190
190
  styleElementsFor
191
- } from "./chunk-KAG5RIH3.js";
191
+ } from "./chunk-BW5F5OXO.js";
192
192
  import {
193
193
  HF_COLOR_GRADING_ATTR,
194
194
  MAX_AUDIO_GAIN,
@@ -201,6 +201,7 @@ import {
201
201
  injectScriptsAtHeadStart,
202
202
  injectScriptsIntoHtml,
203
203
  insertBeforeCloseTag,
204
+ isRuntimeFileUrl,
204
205
  normalizeRateSpec,
205
206
  parseHostVariableValues,
206
207
  parseStrictFiniteTimingNumber,
@@ -209,7 +210,7 @@ import {
209
210
  resolveNaturalMediaTimelineDurationFromValues,
210
211
  shouldClampResolvedMediaDuration,
211
212
  sourceTimeAt
212
- } from "./chunk-F6QGSVUR.js";
213
+ } from "./chunk-AQIS2UNW.js";
213
214
  import {
214
215
  chromeMajorCeiling
215
216
  } from "./chunk-TWWSYAKJ.js";
@@ -6039,7 +6040,7 @@ async function inlineExternalScripts(html) {
6039
6040
  const externalScripts = [];
6040
6041
  for (const el of scripts) {
6041
6042
  const src = (el.getAttribute("src") || "").trim();
6042
- if (src && isHttpUrl(src)) {
6043
+ if (src && isHttpUrl(src) && !isRuntimeFileUrl(src)) {
6043
6044
  externalScripts.push({ el, src });
6044
6045
  }
6045
6046
  }
@@ -14156,7 +14157,7 @@ function startServer(options = {}) {
14156
14157
  });
14157
14158
  async function shutdown(signal) {
14158
14159
  log.info(`Received ${signal}, shutting down`);
14159
- const { drainBrowserPool } = await import("./src-WEETQ4CZ.js");
14160
+ const { drainBrowserPool } = await import("./src-T3KNHVM4.js");
14160
14161
  await drainBrowserPool().catch(() => {
14161
14162
  });
14162
14163
  const handle = await Promise.race([
@@ -15279,7 +15280,7 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
15279
15280
  if (probeResult.fileServer) closeFileServerSafely(probeResult.fileServer, "plan", log);
15280
15281
  if (probeResult.probeSession) {
15281
15282
  try {
15282
- const { closeCaptureSession: closeCaptureSession2 } = await import("./src-WEETQ4CZ.js");
15283
+ const { closeCaptureSession: closeCaptureSession2 } = await import("./src-T3KNHVM4.js");
15283
15284
  await closeCaptureSession2(probeResult.probeSession);
15284
15285
  } catch (err) {
15285
15286
  log.warn("[plan] probe session close failed", {
@@ -21,7 +21,7 @@ import {
21
21
  splitElementInHtml,
22
22
  unwrapElementsFromHtml,
23
23
  wrapElementsInHtml
24
- } from "./chunk-W7MBO3OA.js";
24
+ } from "./chunk-U4FYLOXY.js";
25
25
  import {
26
26
  atomicTempPath,
27
27
  createFileAtomically,
@@ -34,7 +34,7 @@ import {
34
34
  measureAudio,
35
35
  requiredFfmpeg,
36
36
  resolveLocalAudioPath
37
- } from "./chunk-RG4XNPAS.js";
37
+ } from "./chunk-BE6X3G5C.js";
38
38
  import {
39
39
  PROXY_PARAMS_VERSION,
40
40
  PROXY_PENDING_RETRY_AFTER_SECONDS,
@@ -60,7 +60,7 @@ import {
60
60
  shouldPrewarmProxy,
61
61
  waitForProxy,
62
62
  walkDir
63
- } from "./chunk-73KQTPK5.js";
63
+ } from "./chunk-CHMDN7EH.js";
64
64
  import {
65
65
  findTimelineScript,
66
66
  parseGsapScriptAcorn
@@ -81,7 +81,7 @@ import {
81
81
  motionPathPluginUrl,
82
82
  parseFps,
83
83
  sameInstant
84
- } from "./chunk-LVXNXV7G.js";
84
+ } from "./chunk-3XZK3GNY.js";
85
85
  import {
86
86
  MagicString,
87
87
  VALID_CANVAS_RESOLUTIONS,
@@ -92,17 +92,19 @@ import {
92
92
  addScenePartsManifest,
93
93
  deferScriptsUntilFonts,
94
94
  ensureHfIds
95
- } from "./chunk-KAG5RIH3.js";
95
+ } from "./chunk-BW5F5OXO.js";
96
96
  import {
97
+ RUNTIME_BOOTSTRAP_ATTR,
97
98
  findStartTags,
98
99
  hasCompositionOutsideTemplates,
99
100
  injectTagsAtHeadStart,
100
101
  insertBeforeCloseTag,
102
+ insertRuntimeTag,
101
103
  isFullHtmlDocument,
102
104
  resolveRateSpec,
103
105
  sourceTimeAt,
104
106
  stripEmbeddedRuntimeScripts
105
- } from "./chunk-F6QGSVUR.js";
107
+ } from "./chunk-AQIS2UNW.js";
106
108
  import {
107
109
  ProjectRootMissingError,
108
110
  folderGone,
@@ -6620,7 +6622,7 @@ async function prepareGsapMutationScript(c, res, firstMutation) {
6620
6622
  let block = extractGsapScriptBlock(html);
6621
6623
  if (!block && (firstMutation.type === "add" || firstMutation.type === "add-with-keyframes")) {
6622
6624
  const compId = html.match(/data-composition-id="([^"]+)"/)?.[1] ?? "main";
6623
- const { GSAP_CDN } = await import("./dist-UBW5W3J6.js");
6625
+ const { GSAP_CDN } = await import("./dist-6YFMU2EX.js");
6624
6626
  const bootstrap = [
6625
6627
  `<script src="${GSAP_CDN}"></script>`,
6626
6628
  "<script>",
@@ -8473,10 +8475,8 @@ ${headContent}`;
8473
8475
  if (compHeadContent) headContent += `
8474
8476
  ${compHeadContent}`;
8475
8477
  headContent = stripEmbeddedRuntimeScripts(headContent);
8476
- if (!headContent.includes("hyperframe.runtime") && !headContent.includes("hyperframes-preview-runtime")) {
8477
- headContent += `
8478
- <script data-hyperframes-preview-runtime="1" src="${runtimeUrl}"></script>`;
8479
- }
8478
+ headContent += `
8479
+ <script ${RUNTIME_BOOTSTRAP_ATTR}="1" src="${runtimeUrl}"></script>`;
8480
8480
  if (!headContent.includes("gsap")) {
8481
8481
  headContent += `
8482
8482
  <script src="${gsapCdnDist()}gsap.min.js"></script>`;
@@ -8648,6 +8648,10 @@ function parseStudioMotionManifestContent(content) {
8648
8648
  return { hasMotion: false, hasCustomEase: false };
8649
8649
  }
8650
8650
  }
8651
+ function withPreviewRuntime(html, runtimeUrl) {
8652
+ const tag = `<script ${RUNTIME_BOOTSTRAP_ATTR}="1" src="${runtimeUrl}"></script>`;
8653
+ return insertRuntimeTag(stripEmbeddedRuntimeScripts(html), tag);
8654
+ }
8651
8655
  function injectScriptTagIntoHead(html, scriptTag) {
8652
8656
  return insertBeforeCloseTag(html, "head", `${scriptTag}
8653
8657
  `) ?? `${scriptTag}
@@ -8844,7 +8848,6 @@ function registerPreviewRoutes(api, adapter) {
8844
8848
  const previewBuilds = /* @__PURE__ */ new Map();
8845
8849
  async function buildPreview(project, previewVariables, builtKey, capture, signature) {
8846
8850
  const diskMain = resolveProjectMainHtml(project.dir, project.id);
8847
- const normalizedDisk = diskMain ? ensureHfIds(diskMain.html) : null;
8848
8851
  try {
8849
8852
  let bundled = await adapter.bundle(project.dir, {
8850
8853
  stampHfIds: true,
@@ -8853,17 +8856,12 @@ function registerPreviewRoutes(api, adapter) {
8853
8856
  let mainCompositionPath = "index.html";
8854
8857
  if (!bundled) {
8855
8858
  if (!diskMain) return null;
8856
- bundled = stripEmbeddedRuntimeScripts(normalizedDisk ?? diskMain.html);
8859
+ bundled = ensureHfIds(diskMain.html);
8857
8860
  mainCompositionPath = diskMain.compositionPath;
8858
8861
  }
8862
+ bundled = withPreviewRuntime(bundled, adapter.runtimeUrl);
8859
8863
  recordPreviewReferences(project.dir, bundled);
8860
8864
  recordPreviewBuilt(project.dir);
8861
- if (!bundled.includes("hyperframe.runtime") && !bundled.includes("hyperframes-preview-runtime")) {
8862
- const runtimeTag = `<script src="${adapter.runtimeUrl}"></script>`;
8863
- bundled = insertBeforeCloseTag(bundled, "body", `${runtimeTag}
8864
- `) ?? `${bundled}
8865
- ${runtimeTag}`;
8866
- }
8867
8865
  bundled = withPreviewBase(bundled, project.id);
8868
8866
  bundled = injectStudioPreviewAugmentations(
8869
8867
  ensureHfIds(await transformPreviewHtml(bundled, adapter, project, mainCompositionPath)),
@@ -8889,7 +8887,10 @@ ${runtimeTag}`;
8889
8887
  } catch {
8890
8888
  const fallback = resolveProjectMainHtml(project.dir, project.id);
8891
8889
  if (fallback) {
8892
- const fallbackHtml = withPreviewBase(ensureHfIds(fallback.html), project.id);
8890
+ const fallbackHtml = withPreviewBase(
8891
+ withPreviewRuntime(ensureHfIds(fallback.html), adapter.runtimeUrl),
8892
+ project.id
8893
+ );
8893
8894
  let fallbackAugmented = injectStudioPreviewAugmentations(
8894
8895
  await transformPreviewHtml(fallbackHtml, adapter, project, fallback.compositionPath),
8895
8896
  adapter,
@@ -6,24 +6,24 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  serveStaticProjectHtml
9
- } from "./chunk-TAVCXJDZ.js";
9
+ } from "./chunk-INWZRXCW.js";
10
10
  import {
11
11
  resolveProject
12
- } from "./chunk-5WAPJM7Q.js";
12
+ } from "./chunk-NZWMOYQ4.js";
13
13
  import {
14
14
  AUDIT_SEEK_OPTIONS,
15
15
  installPageFunctionGuard,
16
16
  seekCompositionTimeline,
17
17
  waitForCompositionFonts,
18
18
  waitForRuntimeReady
19
- } from "./chunk-2X6IXODS.js";
19
+ } from "./chunk-ECF5RGLH.js";
20
20
  import {
21
21
  launchManagedBrowser,
22
22
  resolveManagedGpuMode
23
- } from "./chunk-PLQ4HJOO.js";
23
+ } from "./chunk-JMI5PVKK.js";
24
24
  import {
25
25
  resolveDiagnosticNavigationTimeoutMs
26
- } from "./chunk-LHUITV7D.js";
26
+ } from "./chunk-TO6DMAUZ.js";
27
27
  import {
28
28
  c
29
29
  } from "./chunk-ZTZA4UWZ.js";
@@ -37,7 +37,7 @@ import {
37
37
  import {
38
38
  printDeprecationNotice,
39
39
  withMeta
40
- } from "./chunk-HQWCFX5E.js";
40
+ } from "./chunk-WYPGIFYA.js";
41
41
  import {
42
42
  normalizeErrorMessage
43
43
  } from "./chunk-KNU5COPB.js";
@@ -670,7 +670,7 @@ async function collectTweenBoundaries(page) {
670
670
  });
671
671
  }
672
672
  async function bundleProjectHtml(projectDir) {
673
- const { bundleToSingleHtml } = await import("./compiler-534QUPGQ.js");
673
+ const { bundleToSingleHtml } = await import("./compiler-ONZBL2Z2.js");
674
674
  return bundleToSingleHtml(projectDir);
675
675
  }
676
676
  async function alignViewportToComposition(page, url) {
@@ -692,8 +692,8 @@ async function alignViewportToComposition(page, url) {
692
692
  async function runLayoutAudit(projectDir, opts) {
693
693
  const { ensureBrowser } = await import("./manager-CT3D67CG.js");
694
694
  const puppeteer = await import("puppeteer-core");
695
- const { buildChromeArgs } = await import("./src-WEETQ4CZ.js");
696
- const { assertWebGpuAdapterAvailable, compositionRequiresWebGpu, resolveLocalBrowserGpuMode } = await import("./gpuPolicy-NTPPP3CY.js");
695
+ const { buildChromeArgs } = await import("./src-T3KNHVM4.js");
696
+ const { assertWebGpuAdapterAvailable, compositionRequiresWebGpu, resolveLocalBrowserGpuMode } = await import("./gpuPolicy-PF25HSOC.js");
697
697
  const html = await bundleProjectHtml(projectDir);
698
698
  const server = await serveStaticProjectHtml(
699
699
  projectDir,
@@ -8,7 +8,7 @@ import {
8
8
  DEFAULT_REGISTRY_URL,
9
9
  fetchItemManifest,
10
10
  fetchRegistryManifest
11
- } from "./chunk-M73S37KU.js";
11
+ } from "./chunk-G2XWQ4ZE.js";
12
12
 
13
13
  // src/registry/resolver.ts
14
14
  function defaultWarn(message) {