@hyperframes/core 0.8.167 → 0.8.169
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/compositionAssembly.d.ts +2 -0
- package/dist/compiler/compositionAssembly.js +8 -0
- package/dist/compiler/compositionScoping.js +10 -8
- package/dist/compiler/htmlBundler.js +2 -1
- package/dist/distributedFps.d.ts +4 -0
- package/dist/distributedFps.js +5 -0
- package/dist/generated/runtime-inline.js +1 -1
- package/dist/hyperframe.runtime.iife.js +73 -71
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +8 -4
|
@@ -142,3 +142,5 @@ export interface NestedCompositionHosts<TElement> {
|
|
|
142
142
|
* `src`, so a top-level host is enumerated with `[itsOwnSrc]`.
|
|
143
143
|
*/
|
|
144
144
|
export declare function enumerateNestedCompositionHosts<TElement extends AssemblyAttributed>(assembledHost: AssemblyQueryable<TElement>, ancestry: readonly string[]): NestedCompositionHosts<TElement>;
|
|
145
|
+
/** A mount sharing the page root's id counts as a repeat, so it is numbered instead of taking the root's timeline. */
|
|
146
|
+
export declare function countPageRoot(counts: Map<string, number>, hosts: readonly Element[]): void;
|
|
@@ -154,3 +154,11 @@ export function enumerateNestedCompositionHosts(assembledHost, ancestry) {
|
|
|
154
154
|
}
|
|
155
155
|
return { hosts, skipped };
|
|
156
156
|
}
|
|
157
|
+
/** A mount sharing the page root's id counts as a repeat, so it is numbered instead of taking the root's timeline. */
|
|
158
|
+
export function countPageRoot(counts, hosts) {
|
|
159
|
+
const root = hosts[0]?.ownerDocument.querySelector("[data-composition-id]");
|
|
160
|
+
const rootId = root && !hosts.includes(root) ? root.getAttribute("data-composition-id") : null;
|
|
161
|
+
const mounts = rootId ? counts.get(rootId) : undefined;
|
|
162
|
+
if (rootId && mounts)
|
|
163
|
+
counts.set(rootId, mounts + 1);
|
|
164
|
+
}
|
|
@@ -343,10 +343,8 @@ export function wrapScopedCompositionScript(source, compositionId, errorLabel =
|
|
|
343
343
|
if (prop !== __hfCompId) {
|
|
344
344
|
return Reflect.get(target, prop, target);
|
|
345
345
|
}
|
|
346
|
-
var
|
|
347
|
-
return
|
|
348
|
-
? Reflect.get(target, __hfTimelineCompId, target)
|
|
349
|
-
: authoredValue;
|
|
346
|
+
var runtimeValue = Reflect.get(target, __hfTimelineCompId, target);
|
|
347
|
+
return runtimeValue === undefined ? Reflect.get(target, prop, target) : runtimeValue;
|
|
350
348
|
},
|
|
351
349
|
set: function(target, prop, value, receiver) {
|
|
352
350
|
if (prop !== __hfCompId) {
|
|
@@ -354,11 +352,15 @@ export function wrapScopedCompositionScript(source, compositionId, errorLabel =
|
|
|
354
352
|
}
|
|
355
353
|
// The authored node remains in the compiled DOM when its local id
|
|
356
354
|
// differs from the runtime mount id, so readiness legitimately sees
|
|
357
|
-
// both compositions. Publish the same timeline under both identities
|
|
358
|
-
//
|
|
359
|
-
var
|
|
355
|
+
// both compositions. Publish the same timeline under both identities,
|
|
356
|
+
// unless another mount of the same file already owns the authored one.
|
|
357
|
+
var authoredValue = Reflect.get(target, __hfCompId, target);
|
|
358
|
+
var ownsAuthored =
|
|
359
|
+
authoredValue === undefined ||
|
|
360
|
+
authoredValue === Reflect.get(target, __hfTimelineCompId, target);
|
|
360
361
|
var runtimeSet = Reflect.set(target, __hfTimelineCompId, value, target);
|
|
361
|
-
|
|
362
|
+
if (!ownsAuthored) return runtimeSet;
|
|
363
|
+
return Reflect.set(target, __hfCompId, value, target) && runtimeSet;
|
|
362
364
|
},
|
|
363
365
|
});
|
|
364
366
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { compositionStyle, cssStyleMergeKey, deferScriptsUntilFonts, UNCONDITIONAL_CSS_KEY, headStyleRuns, INLINED_FILE_ATTR, inlineScriptRuns, styleElementsFor, } from "./scriptRuns.js";
|
|
3
|
-
import { executableScripts, isJavaScriptType, planCompositionAssembly, } from "./compositionAssembly.js";
|
|
3
|
+
import { countPageRoot, executableScripts, isJavaScriptType, planCompositionAssembly, } from "./compositionAssembly.js";
|
|
4
4
|
import { SCENE_PART_ATTR } from "../sceneParts.js";
|
|
5
5
|
import { ensureExternalScriptTag, readExternalScriptAttributes, } from "./externalScripts.js";
|
|
6
6
|
import { emitMountedModuleScripts, parseImportMap } from "./importMaps.js";
|
|
@@ -481,6 +481,7 @@ function countBundledAuthoredCompositionIds(hosts) {
|
|
|
481
481
|
continue;
|
|
482
482
|
counts.set(authoredCompositionId, (counts.get(authoredCompositionId) || 0) + 1);
|
|
483
483
|
}
|
|
484
|
+
countPageRoot(counts, hosts);
|
|
484
485
|
return counts;
|
|
485
486
|
}
|
|
486
487
|
// fallow-ignore-next-line complexity
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Integer rates the distributed renderer (Lambda, Cloud Run) accepts; fractional fps renders in-process only. */
|
|
2
|
+
export declare const DISTRIBUTED_FPS: readonly [24, 25, 30, 60];
|
|
3
|
+
export type DistributedFps = (typeof DISTRIBUTED_FPS)[number];
|
|
4
|
+
export declare function isDistributedFps(value: unknown): value is DistributedFps;
|