@hyperframes/core 0.9.81 → 0.9.83
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/audibleVideo.d.ts +9 -0
- package/dist/audibleVideo.js +31 -0
- package/dist/compiler/index.d.ts +1 -1
- package/dist/compiler/index.js +1 -1
- package/dist/compiler/inlineSubCompositions.js +3 -2
- package/dist/compiler/timingCompiler.js +39 -35
- package/dist/compositionSource.d.ts +2 -0
- package/dist/compositionSource.js +2 -0
- package/dist/generated/runtime-inline.js +1 -1
- package/dist/gsapCdn.d.ts +11 -1
- package/dist/gsapCdn.js +24 -1
- package/dist/hyperframe.runtime.iife.js +69 -69
- package/dist/runtime/bridge.d.ts +1 -0
- package/dist/runtime/bridge.js +4 -1
- package/dist/runtime/editing/patchTween.d.ts +1 -1
- package/dist/runtime/editing/patchTween.js +34 -12
- package/dist/runtime/editing/softReload.d.ts +0 -1
- package/dist/runtime/editing/softReload.js +28 -5
- package/dist/runtime/editing/watchGeometry.js +5 -2
- package/dist/runtime/editingElement.d.ts +1 -0
- package/dist/runtime/editingElement.js +1 -0
- package/dist/runtime/editingGeometry.d.ts +4 -0
- package/dist/runtime/editingGeometry.js +10 -9
- package/dist/runtime/editingGestureStart.d.ts +0 -5
- package/dist/runtime/editingGestureStart.js +1 -4
- package/dist/runtime/editingPort.d.ts +2 -3
- package/dist/runtime/editingPort.js +2 -3
- package/dist/runtime/elementTransform.d.ts +12 -55
- package/dist/runtime/elementTransform.js +50 -75
- package/dist/runtime/protocol.d.ts +1 -1
- package/dist/runtime/protocol.js +1 -0
- package/dist/runtime/sceneRest.d.ts +4 -0
- package/dist/runtime/sceneRest.js +15 -0
- package/dist/runtime/state.d.ts +1 -5
- package/dist/runtime/transitionLabels.js +9 -2
- package/dist/runtime/types.d.ts +2 -0
- package/dist/utils/htmlAttrSafety.js +3 -0
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const RUNTIME_PROTOCOL_VERSION: 1;
|
|
2
2
|
export declare const RUNTIME_FILLER = "hf-runtime-filler";
|
|
3
3
|
export declare const RUNTIME_MEDIA_LOAD_FAILED = "runtime_media_load_failed";
|
|
4
|
-
export declare const RUNTIME_PROTOCOL_CAPABILITIES: readonly ["seconds-time", "rational-fps", "seek-keep-playing", "composition-manifest-v1", "runtime-data", "play-range"];
|
|
4
|
+
export declare const RUNTIME_PROTOCOL_CAPABILITIES: readonly ["seconds-time", "rational-fps", "seek-keep-playing", "composition-manifest-v1", "runtime-data", "play-range", "announce-timeline"];
|
|
5
5
|
export type RuntimeProtocolFps = {
|
|
6
6
|
numerator: number;
|
|
7
7
|
denominator: number;
|
package/dist/runtime/protocol.js
CHANGED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function restSceneAt(timeline: object, time: number): void;
|
|
2
|
+
export declare const sceneRestingAt: (timeline: object) => number | undefined;
|
|
3
|
+
export declare function takeSceneRedrawDue(timeline: object): boolean;
|
|
4
|
+
export declare function markRestingScenesForRedraw(timelines: readonly object[]): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// The local time each scene timeline was last drawn at: a seek that would draw it there again skips it.
|
|
2
|
+
const restingAt = new WeakMap();
|
|
3
|
+
const redrawDue = new WeakSet();
|
|
4
|
+
export function restSceneAt(timeline, time) {
|
|
5
|
+
restingAt.set(timeline, time);
|
|
6
|
+
}
|
|
7
|
+
export const sceneRestingAt = (timeline) => restingAt.get(timeline);
|
|
8
|
+
export function takeSceneRedrawDue(timeline) {
|
|
9
|
+
return redrawDue.delete(timeline);
|
|
10
|
+
}
|
|
11
|
+
export function markRestingScenesForRedraw(timelines) {
|
|
12
|
+
for (const timeline of timelines)
|
|
13
|
+
if (restingAt.has(timeline))
|
|
14
|
+
redrawDue.add(timeline);
|
|
15
|
+
}
|
package/dist/runtime/state.d.ts
CHANGED
|
@@ -31,11 +31,7 @@ export type RuntimeState = {
|
|
|
31
31
|
* audible presenter playback and remote sync.
|
|
32
32
|
*/
|
|
33
33
|
webAudioMediaDisabled: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Latch so the `media-autoplay-blocked` outbound message is posted at most
|
|
36
|
-
* once per runtime session. The parent only needs the first signal — it
|
|
37
|
-
* takes over playback and further rejections are the same problem.
|
|
38
|
-
*/
|
|
34
|
+
/** Latch: the first refusal starts `media-autoplay-blocked`, which then follows the media list. */
|
|
39
35
|
mediaAutoplayBlockedPosted: boolean;
|
|
40
36
|
/**
|
|
41
37
|
* One-shot flag: force a hard media sync on the next tick. Set on
|
|
@@ -16,13 +16,20 @@ function findTimedElement(doc, markerId) {
|
|
|
16
16
|
return (Array.from(doc.querySelectorAll("[data-start]")).find((element) => element.getAttribute("data-hf-id") === markerId ||
|
|
17
17
|
element.getAttribute("data-composition-id") === markerId) ?? null);
|
|
18
18
|
}
|
|
19
|
+
function labelsOf(timeline) {
|
|
20
|
+
try {
|
|
21
|
+
return timeline?.getLabels?.() ?? timeline?.labels ?? {};
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return {};
|
|
25
|
+
}
|
|
26
|
+
}
|
|
19
27
|
export function transitionLabelsForDocument(doc, timelines) {
|
|
20
28
|
const labels = new Map();
|
|
21
29
|
if (!timelines)
|
|
22
30
|
return labels;
|
|
23
31
|
for (const timeline of Object.values(timelines)) {
|
|
24
|
-
const
|
|
25
|
-
for (const label of Object.keys(timelineLabels)) {
|
|
32
|
+
for (const label of Object.keys(labelsOf(timeline))) {
|
|
26
33
|
const pair = transitionParts(label);
|
|
27
34
|
if (!pair)
|
|
28
35
|
continue;
|
package/dist/runtime/types.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { PreviewTarget } from "../studioPreviewMark.js";
|
|
|
3
3
|
import type { RuntimeAnalyticsEvent } from "./analytics.js";
|
|
4
4
|
import type { TextLayerRead } from "./editingElement.js";
|
|
5
5
|
import type { AudioFades } from "../audioFade.js";
|
|
6
|
+
import type { ParentCopy } from "../audibleVideo.js";
|
|
6
7
|
import type { RateSpec } from "../speedRamp.js";
|
|
7
8
|
import type { VolumeKeyframe } from "./mediaVolumeEnvelope.js";
|
|
8
9
|
export type RuntimeJson = string | number | boolean | null | RuntimeJson[] | {
|
|
@@ -156,6 +157,7 @@ export type RuntimeStageSizeMessage = {
|
|
|
156
157
|
export type RuntimeMediaAutoplayBlockedMessage = {
|
|
157
158
|
source: "hf-preview";
|
|
158
159
|
type: "media-autoplay-blocked";
|
|
160
|
+
media: ParentCopy[];
|
|
159
161
|
};
|
|
160
162
|
/**
|
|
161
163
|
* Posted by the runtime when `installRuntimeControlBridge` finishes registering
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* used by sourceMutation (core), sdkCutover (studio), and mutate (sdk).
|
|
6
6
|
*/
|
|
7
7
|
import { SVG_ATTRIBUTES, SVG_ELEMENTS } from "./svgAllowlist.js";
|
|
8
|
+
import { CODE_LOADING_ATTRS } from "../compositionSource.js";
|
|
8
9
|
export const ALLOWED_HTML_ATTRS = new Set([
|
|
9
10
|
"id",
|
|
10
11
|
"class",
|
|
@@ -98,6 +99,8 @@ function linkAsBrowsersReadIt(value) {
|
|
|
98
99
|
return value.slice(start, end).replace(/[\t\n\r]/g, "");
|
|
99
100
|
}
|
|
100
101
|
export function isSafeAttributeValue(name, value) {
|
|
102
|
+
if (CODE_LOADING_ATTRS.has(name.toLowerCase()))
|
|
103
|
+
return false;
|
|
101
104
|
if (URI_BEARING_ATTRS.has(name.toLowerCase())) {
|
|
102
105
|
const trimmed = linkAsBrowsersReadIt(value);
|
|
103
106
|
if (DANGEROUS_URI_SCHEMES.test(trimmed))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperframes/core",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.83",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -501,9 +501,9 @@
|
|
|
501
501
|
"linkedom": "^0.18.12",
|
|
502
502
|
"postcss": "^8.5.8",
|
|
503
503
|
"wawoff2": "^2.0.1",
|
|
504
|
-
"@hyperframes/lint": "0.9.
|
|
505
|
-
"@hyperframes/
|
|
506
|
-
"@hyperframes/
|
|
504
|
+
"@hyperframes/lint": "0.9.83",
|
|
505
|
+
"@hyperframes/studio-server": "0.9.83",
|
|
506
|
+
"@hyperframes/parsers": "0.9.83"
|
|
507
507
|
},
|
|
508
508
|
"devDependencies": {
|
|
509
509
|
"@fontsource/archivo-black": "^5.2.8",
|