@hyperframes/core 0.9.20 → 0.9.22
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/compiler/htmlDocument.d.ts +1 -1
- package/dist/compiler/htmlDocument.js +2 -2
- package/dist/generated/runtime-inline.js +1 -1
- package/dist/hyperframe.runtime.iife.js +74 -74
- package/dist/index.d.ts +1 -0
- package/dist/previewProxyBox.d.ts +2 -0
- package/dist/runtime/bridge.js +2 -1
- package/dist/runtime/clock.d.ts +5 -0
- package/dist/runtime/clock.js +49 -3
- package/dist/runtime/mediaSteer.d.ts +1 -1
- package/dist/runtime/mediaSteer.js +1 -10
- package/dist/runtime/pausedVideoCallbacks.d.ts +10 -0
- package/dist/runtime/pausedVideoCallbacks.js +157 -0
- package/dist/runtime/pausedVideoFrames.d.ts +52 -0
- package/dist/runtime/pausedVideoFrames.js +366 -0
- package/dist/runtime/types.d.ts +1 -0
- package/dist/runtime/wallClock.d.ts +8 -0
- package/dist/runtime/wallClock.js +13 -0
- package/dist/studioPreviewMark.d.ts +5 -1
- package/dist/studioPreviewMark.js +7 -0
- package/package.json +4 -4
|
@@ -17,7 +17,7 @@ export declare function findStartTags(html: string, name: string): number[];
|
|
|
17
17
|
export declare function hasCompositionOutsideTemplates(html: string): boolean;
|
|
18
18
|
/** Insert markup before the document's own `</head>`, `</body>` or `</template>`; null if it has none. */
|
|
19
19
|
export declare function insertBeforeCloseTag(html: string, name: "head" | "body" | "template", markup: string): string | null;
|
|
20
|
-
export declare function insertRuntimeTag(html: string, tag: string): string;
|
|
20
|
+
export declare function insertRuntimeTag(html: string, tag: string, atHeadStart?: boolean): string;
|
|
21
21
|
/**
|
|
22
22
|
* Insert raw tag markup at the very start of `<head>`, ahead of every author
|
|
23
23
|
* script (inline or external). Falls back to just before `<body>`, then to the
|
|
@@ -346,8 +346,8 @@ function insertTagInHead(html, tag) {
|
|
|
346
346
|
}
|
|
347
347
|
const ACCEL_TRACKER_ATTR = "data-hf-accel-tracker";
|
|
348
348
|
const OPTS_INTO_MOTION_BLUR = /\sdata-motion-blur\s*=\s*["']?on[\s"'>]/i;
|
|
349
|
-
export function insertRuntimeTag(html, tag) {
|
|
350
|
-
const withRuntime = insertTagInHead(html, tag);
|
|
349
|
+
export function insertRuntimeTag(html, tag, atHeadStart = false) {
|
|
350
|
+
const withRuntime = atHeadStart ? injectTagsAtHeadStart(html, tag) : insertTagInHead(html, tag);
|
|
351
351
|
if (!OPTS_INTO_MOTION_BLUR.test(html) || html.includes(ACCEL_TRACKER_ATTR))
|
|
352
352
|
return withRuntime;
|
|
353
353
|
const tracker = `<script ${ACCEL_TRACKER_ATTR}>${acceleratedCanvasTrackerSource()}</script>`;
|