@hyperframes/studio 0.7.35 → 0.7.37
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/assets/{index-xm9qFODm.js → index-BXYJbIax.js} +1 -1
- package/dist/assets/{index-BqeN8dYQ.js → index-Ct-X2wlf.js} +1 -1
- package/dist/assets/{index-B12MRH9w.js → index-SYSbQyK4.js} +95 -95
- package/dist/index.html +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/src/utils/sdkResolverShadow.test.ts +17 -0
- package/src/utils/sdkResolverShadow.ts +6 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperframes/studio",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.37",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
"gsap": "^3.13.0",
|
|
47
47
|
"marked": "^14.1.4",
|
|
48
48
|
"mediabunny": "^1.45.3",
|
|
49
|
-
"@hyperframes/
|
|
50
|
-
"@hyperframes/
|
|
51
|
-
"@hyperframes/
|
|
52
|
-
"@hyperframes/
|
|
53
|
-
"@hyperframes/
|
|
49
|
+
"@hyperframes/core": "0.7.37",
|
|
50
|
+
"@hyperframes/parsers": "0.7.37",
|
|
51
|
+
"@hyperframes/player": "0.7.37",
|
|
52
|
+
"@hyperframes/sdk": "0.7.37",
|
|
53
|
+
"@hyperframes/studio-server": "0.7.37"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/react": "19",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"vite": "^6.4.2",
|
|
66
66
|
"vitest": "^3.2.4",
|
|
67
67
|
"zustand": "^5.0.0",
|
|
68
|
-
"@hyperframes/producer": "0.7.
|
|
68
|
+
"@hyperframes/producer": "0.7.37"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"react": "19",
|
|
@@ -469,6 +469,12 @@ const GSAP_HTML = /* html */ `<!DOCTYPE html>
|
|
|
469
469
|
<script>var tl = gsap.timeline({ paused: true }); tl.to("[data-hf-id=\\"hf-box\\"]", { x: 100, duration: 1 }, 0);</script>
|
|
470
470
|
</body></html>`;
|
|
471
471
|
|
|
472
|
+
const GSAP_UNMATCHED_SELECTOR_HTML = /* html */ `<!DOCTYPE html>
|
|
473
|
+
<html><body>
|
|
474
|
+
<div data-hf-id="hf-box" style="color: red">Hello</div>
|
|
475
|
+
<script>var tl = gsap.timeline({ paused: true }); tl.to("#coral-band", { x: 100, duration: 1 }, 3);</script>
|
|
476
|
+
</body></html>`;
|
|
477
|
+
|
|
472
478
|
describe("G. recordAnimationResolverParity", () => {
|
|
473
479
|
it("emits animation_not_found when the SDK cannot resolve the animationId", async () => {
|
|
474
480
|
mockFlags.STUDIO_SDK_RESOLVER_SHADOW_ENABLED = true;
|
|
@@ -495,6 +501,17 @@ describe("G. recordAnimationResolverParity", () => {
|
|
|
495
501
|
recordAnimationResolverParity(session, "no-such-anim", "setGsapTween");
|
|
496
502
|
expect(trackedEvents).toHaveLength(0);
|
|
497
503
|
});
|
|
504
|
+
|
|
505
|
+
it("emits nothing when the animationId only resolves via getAllAnimationIds (no live DOM match) — repro of the v0.7.31 false-positive", async () => {
|
|
506
|
+
mockFlags.STUDIO_SDK_RESOLVER_SHADOW_ENABLED = true;
|
|
507
|
+
const session = await openComposition(GSAP_UNMATCHED_SELECTOR_HTML);
|
|
508
|
+
const unmatchedId = [...session.getAllAnimationIds()][0] ?? "";
|
|
509
|
+
expect(unmatchedId).not.toBe("");
|
|
510
|
+
// Confirms the bug this fixes: the id is NOT attached to any element.
|
|
511
|
+
expect(session.getElements().some((el) => el.animationIds.includes(unmatchedId))).toBe(false);
|
|
512
|
+
recordAnimationResolverParity(session, unmatchedId, "removeAllKeyframes");
|
|
513
|
+
expect(trackedEvents.filter((e) => e.event === "sdk_resolver_shadow")).toHaveLength(0);
|
|
514
|
+
});
|
|
498
515
|
});
|
|
499
516
|
|
|
500
517
|
// ─── H. Inlined sub-composition: bare leaf id resolves (regression) ───────────
|
|
@@ -459,8 +459,9 @@ export async function recordResolverParity(
|
|
|
459
459
|
* dispatching. Read-only: emits `animation_not_found` when the SDK can't resolve
|
|
460
460
|
* the animationId the server GSAP path is addressing — the GSAP-edit-surface
|
|
461
461
|
* analogue of element_not_found. The SDK's resolvable animation ids are the
|
|
462
|
-
* located ids attached to elements (buildAnimationIdMap)
|
|
463
|
-
*
|
|
462
|
+
* located ids attached to elements (buildAnimationIdMap) OR any id parsed from
|
|
463
|
+
* the script regardless of DOM match (getAllAnimationIds) — a target absent
|
|
464
|
+
* from both is a resolver divergence.
|
|
464
465
|
*
|
|
465
466
|
* No-op when the shadow flag is off; never throws; never mutates the session.
|
|
466
467
|
*/
|
|
@@ -474,7 +475,9 @@ export function recordAnimationResolverParity(
|
|
|
474
475
|
try {
|
|
475
476
|
recordAttempt(opLabel);
|
|
476
477
|
const elements = session.getElements();
|
|
477
|
-
const resolves =
|
|
478
|
+
const resolves =
|
|
479
|
+
elements.some((el) => el.animationIds.includes(animationId)) ||
|
|
480
|
+
session.getAllAnimationIds().has(animationId);
|
|
478
481
|
if (resolves) return; // SDK locates the animation — parity
|
|
479
482
|
trackStudioEvent("sdk_resolver_shadow", {
|
|
480
483
|
animationId,
|