@hyperframes/core 0.8.193 → 0.8.194

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;
@@ -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
  }