@koda-sl/baker-cli 0.182.0-dev.3c0641b3f → 0.182.0-dev.c8185c1b5
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 +39 -12
- package/dist/cli.js.map +1 -1
- package/package.json +2 -1
package/dist/cli.js
CHANGED
|
@@ -33846,7 +33846,10 @@ async function toGreyGrid(image) {
|
|
|
33846
33846
|
// src/engine/landing-library/motion.ts
|
|
33847
33847
|
var EMPTY_MOTION = {
|
|
33848
33848
|
hasMotion: false,
|
|
33849
|
-
|
|
33849
|
+
// `none` rather than "no motion": it is the `MOTION_KINDS` member for this,
|
|
33850
|
+
// so a section with no movement is findable by the same facet as everything
|
|
33851
|
+
// else instead of being a special case only prose describes.
|
|
33852
|
+
summary: "none",
|
|
33850
33853
|
entrance: [],
|
|
33851
33854
|
hover: [],
|
|
33852
33855
|
scroll: [],
|
|
@@ -33862,19 +33865,43 @@ async function collectMotion(page, selector) {
|
|
|
33862
33865
|
if (!raw) return EMPTY_MOTION;
|
|
33863
33866
|
return { ...raw, summary: summarizeMotion(raw) };
|
|
33864
33867
|
}
|
|
33865
|
-
|
|
33866
|
-
|
|
33867
|
-
|
|
33868
|
-
|
|
33869
|
-
|
|
33870
|
-
|
|
33868
|
+
var HOVER_TRANSFORMS = /* @__PURE__ */ new Set(["lift", "grow", "tilt", "shift", "spin", "shadow", "animate"]);
|
|
33869
|
+
var KEYFRAME_PATTERNS = [
|
|
33870
|
+
[/marquee|ticker|scroll(ing)?-?(x|left|right)/, "marquee"],
|
|
33871
|
+
[/parallax/, "parallax"],
|
|
33872
|
+
[/sticky|pin(ned)?/, "sticky-pin"],
|
|
33873
|
+
[/count(er|up)/, "counter"],
|
|
33874
|
+
[/zoom|scale|pulse|grow/, "zoom"],
|
|
33875
|
+
[/fade|opacity|appear/, "fade"],
|
|
33876
|
+
[/slide|translate|in-?(left|right|up|down)/, "slide-in"]
|
|
33877
|
+
];
|
|
33878
|
+
function toMotionKinds(kind, channel) {
|
|
33879
|
+
if (channel === "hover") return [HOVER_TRANSFORMS.has(kind) ? "hover-lift" : "fade"];
|
|
33880
|
+
const name = kind.toLowerCase();
|
|
33881
|
+
const matched = KEYFRAME_PATTERNS.filter(([pattern]) => pattern.test(name)).map(([, motionKind]) => motionKind);
|
|
33882
|
+
if (matched.length > 0) return matched;
|
|
33883
|
+
return [channel === "loop" ? "marquee" : "scroll-reveal"];
|
|
33884
|
+
}
|
|
33885
|
+
function motionKindsOf(motion) {
|
|
33886
|
+
const kinds = /* @__PURE__ */ new Set();
|
|
33887
|
+
const collect = (effects, channel) => {
|
|
33888
|
+
for (const effect of effects) {
|
|
33889
|
+
for (const kind of toMotionKinds(effect.kind, channel)) kinds.add(kind);
|
|
33890
|
+
}
|
|
33871
33891
|
};
|
|
33872
|
-
|
|
33873
|
-
|
|
33874
|
-
|
|
33875
|
-
|
|
33892
|
+
collect(motion.entrance, "entrance");
|
|
33893
|
+
collect(motion.hover, "hover");
|
|
33894
|
+
collect(motion.scroll, "scroll");
|
|
33895
|
+
collect(motion.loop, "loop");
|
|
33896
|
+
const delays = new Set(motion.entrance.map((effect) => effect.delayMs ?? 0).filter((ms) => ms > 0));
|
|
33897
|
+
if (delays.size > 1) kinds.add("stagger");
|
|
33898
|
+
return [...kinds];
|
|
33899
|
+
}
|
|
33900
|
+
function summarizeMotion(motion) {
|
|
33901
|
+
const kinds = motionKindsOf(motion);
|
|
33902
|
+
if (kinds.length === 0 && motion.libraries.length === 0) return "none";
|
|
33903
|
+
const parts = [...kinds];
|
|
33876
33904
|
if (motion.libraries.length > 0) parts.push(`via ${motion.libraries.join("/")}`);
|
|
33877
|
-
if (parts.length === 0) return "no motion";
|
|
33878
33905
|
return parts.join(", ") + (motion.respectsReducedMotion ? "" : " (ignores reduced-motion)");
|
|
33879
33906
|
}
|
|
33880
33907
|
var inPageCollectMotion = (selector) => {
|