@hyperframes/core 0.8.194 → 0.8.195

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.
@@ -221,7 +221,7 @@ function rebaseEntryAuthoredAssetPaths(document, sourceDir, projectDir) {
221
221
  el.setAttribute(HF_COLOR_GRADING_ATTR, rebaseColorGradingLutPath(value, sourceDir, projectDir));
222
222
  }
223
223
  }
224
- function inlineCssFile(css, cssFileDir, projectDir, visited = new Set()) {
224
+ function inlineCssFile(css, cssFileDir, projectDir, activeImports) {
225
225
  const { result: strippedCss, restore: restoreComments } = withCommentsStripped(css, (s) => s);
226
226
  const importPlaceholders = [];
227
227
  const withPlaceholders = strippedCss.replace(CSS_IMPORT_RE, (full, _q1, urlPath, _q2, barePath, mediaQuery) => {
@@ -233,13 +233,14 @@ function inlineCssFile(css, cssFileDir, projectDir, visited = new Set()) {
233
233
  // project root; isSafePath also blocks symlink escapes (content is inlined).
234
234
  if (!isSafePath(projectDir, resolved))
235
235
  return full;
236
- if (visited.has(resolved))
236
+ if (activeImports.has(resolved))
237
237
  return "";
238
238
  const content = safeReadFile(resolved);
239
239
  if (content == null)
240
240
  return full;
241
- visited.add(resolved);
242
- const inlined = inlineCssFile(content, dirname(resolved), projectDir, visited);
241
+ activeImports.add(resolved);
242
+ const inlined = inlineCssFile(content, dirname(resolved), projectDir, activeImports);
243
+ activeImports.delete(resolved);
243
244
  const trimmedMedia = (mediaQuery || "").trim();
244
245
  const block = trimmedMedia ? `@media ${trimmedMedia} {\n${inlined}\n}\n` : inlined + "\n";
245
246
  const idx = importPlaceholders.length;
@@ -951,7 +952,7 @@ async function bundleProject(projectDir, options) {
951
952
  if (value !== null)
952
953
  style.setAttribute(name, value);
953
954
  }
954
- style.textContent = inlineCssFile(css, dirname(cssPath), projectDir);
955
+ style.textContent = inlineCssFile(css, dirname(cssPath), projectDir, new Set([cssPath]));
955
956
  el.replaceWith(style);
956
957
  }
957
958
  // Read before sub-compositions add theirs: only the root's own scripts can reach into scenes.