hyperframes 0.7.67 → 0.7.69
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/cli.js +23546 -23078
- package/dist/commands/layout-audit.browser.js +51 -0
- package/dist/hyperframe-runtime.js +14 -14
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +14 -14
- package/dist/hyperframes-player.global.js +1 -1
- package/dist/studio/assets/{hyperframes-player-DqhzqBZU.js → hyperframes-player-Cpsua-dD.js} +1 -1
- package/dist/studio/assets/{index-BJ0VzN-B.js → index-CQTrsiIr.js} +1 -1
- package/dist/studio/assets/{index-DszkK5mi.js → index-D6eWVL-m.js} +99 -97
- package/dist/studio/assets/{index-DGS1KaUl.js → index-Dgb6QcBu.js} +1 -1
- package/dist/studio/index.html +1 -1
- package/package.json +1 -1
|
@@ -1480,4 +1480,55 @@
|
|
|
1480
1480
|
}
|
|
1481
1481
|
return parts.join("|");
|
|
1482
1482
|
};
|
|
1483
|
+
|
|
1484
|
+
// Rotation-pivot sampling (rotation_pivot_drift). Per sample, report every
|
|
1485
|
+
// rotatable candidate's bbox center, size, and current rotation angle. Node
|
|
1486
|
+
// accumulates these across the seek grid and, after the run, flags any
|
|
1487
|
+
// element that spins (angle varies) while its bbox CENTER drifts — the
|
|
1488
|
+
// signature of a wrong transformOrigin/svgOrigin (spokes swinging off-axis
|
|
1489
|
+
// instead of spinning in place). Single frame can't tell spin from pivot
|
|
1490
|
+
// drift, so this is a cross-sample finder, not a per-sample one.
|
|
1491
|
+
function rotationAngleDeg(transform) {
|
|
1492
|
+
if (!transform || transform === "none") return null;
|
|
1493
|
+
const match = transform.match(/matrix(3d)?\(([^)]+)\)/);
|
|
1494
|
+
if (!match) return null;
|
|
1495
|
+
const values = match[2].split(",").map((part) => Number.parseFloat(part));
|
|
1496
|
+
// matrix(a,b,c,d,e,f) → a=values[0], b=values[1]. matrix3d shares the same
|
|
1497
|
+
// leading two entries for the in-plane 2D rotation component.
|
|
1498
|
+
const a = values[0];
|
|
1499
|
+
const b = values[1];
|
|
1500
|
+
if (!Number.isFinite(a) || !Number.isFinite(b)) return null;
|
|
1501
|
+
return (Math.atan2(b, a) * 180) / Math.PI;
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
window.__hyperframesRotationSample = function collectRotationSample() {
|
|
1505
|
+
const root =
|
|
1506
|
+
document.querySelector("[data-composition-id][data-width][data-height]") ||
|
|
1507
|
+
document.querySelector("[data-composition-id]") ||
|
|
1508
|
+
document.body;
|
|
1509
|
+
const samples = [];
|
|
1510
|
+
// Cap the candidate set so a pathological composition can't blow up the
|
|
1511
|
+
// per-sample payload; transformed elements above a minimum area only.
|
|
1512
|
+
const CANDIDATE_CAP = 200;
|
|
1513
|
+
for (const element of Array.from(root.querySelectorAll("*"))) {
|
|
1514
|
+
if (samples.length >= CANDIDATE_CAP) break;
|
|
1515
|
+
// Intended orbits/satellites opt out — their bbox center is SUPPOSED to
|
|
1516
|
+
// travel, so a drift finding there is a false positive.
|
|
1517
|
+
if (element.closest("[data-layout-allow-orbit]")) continue;
|
|
1518
|
+
if (!isVisibleElement(element, 0.05)) continue;
|
|
1519
|
+
const angle = rotationAngleDeg(getComputedStyle(element).transform);
|
|
1520
|
+
if (angle === null) continue; // identity / untransformed — not a candidate
|
|
1521
|
+
const box = element.getBoundingClientRect();
|
|
1522
|
+
if (box.width * box.height <= 400) continue;
|
|
1523
|
+
samples.push({
|
|
1524
|
+
selector: selectorFor(element),
|
|
1525
|
+
cx: round(box.left + box.width / 2),
|
|
1526
|
+
cy: round(box.top + box.height / 2),
|
|
1527
|
+
w: round(box.width),
|
|
1528
|
+
h: round(box.height),
|
|
1529
|
+
angle: round(angle),
|
|
1530
|
+
});
|
|
1531
|
+
}
|
|
1532
|
+
return samples;
|
|
1533
|
+
};
|
|
1483
1534
|
})();
|