@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.
- package/dist/browserMarker.d.ts +3 -0
- package/dist/browserMarker.js +7 -0
- package/dist/compiler/compositionScoping.js +10 -4
- package/dist/compiler/htmlDocument.d.ts +1 -0
- package/dist/compiler/htmlDocument.js +3 -0
- package/dist/compiler/standaloneEntry.d.ts +1 -1
- package/dist/compiler/standaloneEntry.js +1 -3
- package/dist/generated/runtime-inline.js +1 -1
- package/dist/gsapCdn.d.ts +5 -2
- package/dist/gsapCdn.js +20 -4
- package/dist/hyperframe.runtime.iife.js +69 -63
- package/dist/runtime/media.js +8 -1
- package/dist/runtime/preloadMedia.d.ts +1 -0
- package/dist/runtime/preloadMedia.js +43 -1
- package/dist/runtime/startResolver.js +10 -2
- package/package.json +8 -4
|
@@ -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
|
|
487
|
-
|
|
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
|
|
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
|
|
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
|
}
|