@hyperframes/core 0.8.193 → 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.
@@ -0,0 +1,3 @@
1
+ /** An inert Chrome switch on every browser HyperFrames launches, so orphan cleanup can tell its own from other tools'. */
2
+ export declare const HYPERFRAMES_BROWSER_MARKER_ARG = "--hyperframes-owned-browser";
3
+ export declare function withHyperframesBrowserMarker(args?: readonly string[]): string[];
@@ -0,0 +1,7 @@
1
+ /** An inert Chrome switch on every browser HyperFrames launches, so orphan cleanup can tell its own from other tools'. */
2
+ export const HYPERFRAMES_BROWSER_MARKER_ARG = "--hyperframes-owned-browser";
3
+ export function withHyperframesBrowserMarker(args = []) {
4
+ return args.includes(HYPERFRAMES_BROWSER_MARKER_ARG)
5
+ ? [...args]
6
+ : [...args, HYPERFRAMES_BROWSER_MARKER_ARG];
7
+ }
@@ -483,16 +483,22 @@ export function wrapScopedCompositionScript(source, compositionId, errorLabel =
483
483
  })
484
484
  : window;
485
485
  var __hfResolveGsapTarget = function(target) {
486
- if (typeof target === "string") return __hfQueryAll(target);
487
- if (!Array.isArray(target)) return target;
488
- return target.reduce(function(resolved, item) {
486
+ if (typeof target !== "string" && !Array.isArray(target)) return target;
487
+ var resolved = typeof target === "string" ? __hfQueryAll(target) : target.reduce(function(resolved, item) {
489
488
  if (typeof item === "string") {
490
489
  return resolved.concat(Array.prototype.slice.call(__hfQueryAll(item)));
491
490
  }
492
491
  resolved.push(item);
493
492
  return resolved;
494
493
  }, []);
495
-
494
+ if (!resolved.length) {
495
+ // GSAP warns "GSAP target " + targets + " not found"; a bare empty match list prints an
496
+ // empty name. Keep the authored selector as the text while still targeting nothing here.
497
+ var originalTarget = String(target);
498
+ resolved = [];
499
+ resolved.toString = function() { return originalTarget; };
500
+ }
501
+ return resolved;
496
502
  };
497
503
  var __hfScopeTimeline = function(timeline) {
498
504
  if (!timeline || timeline.__hfScopedCompositionRoot === __hfFindRoot()) return timeline;
@@ -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.
@@ -1,4 +1,5 @@
1
1
  export declare const RUNTIME_BOOTSTRAP_ATTR = "data-hyperframes-preview-runtime";
2
+ export declare function isTemplateEntry(html: string): boolean;
2
3
  export declare function isFullHtmlDocument(html: string): boolean;
3
4
  /**
4
5
  * Parse a full HTML document or wrap a fragment so linkedom consistently puts
@@ -11,6 +11,9 @@ const SIMPLE_RUNTIME_FLAG_ASSIGNMENTS = [
11
11
  /^window\.__renderReady\s*=\s*(?:true|false)\s*;?$/,
12
12
  ];
13
13
  const LEADING_COMMENTS = /^(?:\s|<!--(?:>|->|[\s\S]*?-->))*/;
14
+ export function isTemplateEntry(html) {
15
+ return /^<template[\s>/]/i.test(html.replace(LEADING_COMMENTS, ""));
16
+ }
14
17
  export function isFullHtmlDocument(html) {
15
18
  return /^(?:<!doctype|<html[\s>/])/i.test(html.replace(LEADING_COMMENTS, ""));
16
19
  }
@@ -1,2 +1,2 @@
1
- export declare function isTemplateEntry(html: string): boolean;
1
+ export { isTemplateEntry } from "./htmlDocument.js";
2
2
  export declare function extractStandaloneEntryFromIndex(indexHtml: string, entryFile: string, entryHtml?: string): string | null;
@@ -1,8 +1,6 @@
1
1
  import { parseHTML } from "linkedom";
2
2
  import { HF_AUDIO_FX_ATTR } from "../audioFx.js";
3
- export function isTemplateEntry(html) {
4
- return html.trimStart().startsWith("<template");
5
- }
3
+ export { isTemplateEntry } from "./htmlDocument.js";
6
4
  function normalizeCompositionSrcPath(srcPath) {
7
5
  return srcPath.replace(/\\/g, "/").replace(/^\.\//, "");
8
6
  }