@styleflow.app/flowpress-astro-core 1.0.0-beta.44 → 1.0.0-beta.45

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.0-beta.45 — 2026-11-04
4
+
5
+ - `sf/carousel` slides animate again. The track used `sf-motion-disable`, whose `transition: none !important` overrode the transition Splide writes inline on the list (slide) and on the slides (fade), so every move jumped. The track now uses the new `sf-reveal-skip`.
6
+ - New `sf-reveal-skip` class (`SF_REVEAL_SKIP_CLASS`): opts a subtree out of reveals exactly like `sf-motion-disable` (controller, pre-paint boot CSS, authored `.sf-reveal` kept visible) but leaves its transitions and animations running. `sf-motion-disable` is unchanged.
7
+ - New renderer fixture page `carousel-motion` and browser check `tests/browser/carousel-motion.js` (slide, centred loop and fade under the motion runtime, full and reduced motion).
8
+ - [Activity report](docs/activities/2026-11-04-1112-carousel-slide-transition.md).
9
+
3
10
  ## 1.0.0-beta.44 — 2026-11-04
4
11
 
5
12
  - `sf/carousel` follows the extended contract of Components beta.18: fractional items per view, fixed slide width and peek per breakpoint (`fixedWidth`, `padding`), centred focus, aspect ratio, equal height, fade, rewind, start index, free drag, wheel, arrow position/shape/size with a mobile position, dots, bars or a fraction counter, and controls background from StyleFlow tone and intensity. Carousels saved with the original fields mount with exactly the same Splide options.
@@ -77,7 +77,7 @@ if (!validChildren && import.meta.env.DEV) {
77
77
  ))}
78
78
  </div>
79
79
  ) : null}
80
- <div class="splide__track sf-motion-disable">
80
+ <div class="splide__track sf-reveal-skip">
81
81
  <ul class="splide__list">
82
82
  <slot />
83
83
  </ul>
@@ -1 +1 @@
1
- {"version":3,"file":"motion-controller.d.ts","sourceRoot":"","sources":["../../../src/astro/motion/motion-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAeL,KAAK,eAAe,EAErB,MAAM,aAAa,CAAC;AAmHrB;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,eAAoB,GAAG,IAAI,CA0PtE"}
1
+ {"version":3,"file":"motion-controller.d.ts","sourceRoot":"","sources":["../../../src/astro/motion/motion-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAgBL,KAAK,eAAe,EAErB,MAAM,aAAa,CAAC;AAmHrB;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,eAAoB,GAAG,IAAI,CA0PtE"}
@@ -1,4 +1,4 @@
1
- import { SF_MOTION_DISABLE_CLASS, SF_MOTION_PROTECTED_CONTENT_SELECTOR, SF_REVEAL_SELECTOR, SF_REVEAL_STAGGER_SELECTOR, automaticRevealClasses, hasEnoughVisibleArea, initialRevealState, maximumTransitionTimeMs, nextRevealState, resolveSfMotionOptions, ruleRevealClassChanges, staggerRevealDelayMs, shouldInitializeMotion, } from "./motion.js";
1
+ import { SF_MOTION_DISABLE_CLASS, SF_MOTION_PROTECTED_CONTENT_SELECTOR, SF_REVEAL_SKIP_CLASS, SF_REVEAL_SELECTOR, SF_REVEAL_STAGGER_SELECTOR, automaticRevealClasses, hasEnoughVisibleArea, initialRevealState, maximumTransitionTimeMs, nextRevealState, resolveSfMotionOptions, ruleRevealClassChanges, staggerRevealDelayMs, shouldInitializeMotion, } from "./motion.js";
2
2
  import { getMotionPreference, subscribeMotionPreference, } from "../../motion-preference.js";
3
3
  const REVEAL_STATE_ATTRIBUTE = "data-sf-reveal-state";
4
4
  const REVEAL_THRESHOLDS = Array.from({ length: 41 }, (_, index) => index / 40);
@@ -27,7 +27,7 @@ function revealState(element) {
27
27
  return "pending";
28
28
  }
29
29
  function isMotionDisabled(element) {
30
- return Boolean(element.closest(`.${SF_MOTION_DISABLE_CLASS}`));
30
+ return Boolean(element.closest(`.${SF_MOTION_DISABLE_CLASS}, .${SF_REVEAL_SKIP_CLASS}`));
31
31
  }
32
32
  function selectElements(selector) {
33
33
  try {
@@ -1 +1 @@
1
- {"version":3,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ealClasses,\n hasEnoughVisibleArea,\n initialRevealState,\n maximumTransitionTimeMs,\n nextRevealState,\n resolveSfMotionOptions,\n ruleRevealClassChanges,\n staggerRevealDelayMs,\n shouldInitializeMotion,\n type ResolvedSfMotionOptions,\n type SfMotionOptions,\n type SfRevealState,\n} from \"./motion.js\";\nimport {\n getMotionPreference,\n subscribeMotionPreference,\n type MotionPreference,\n} from \"../../motion-preference.js\";\n\nconst REVEAL_STATE_ATTRIBUTE = \"data-sf-reveal-state\";\nconst REVEAL_THRESHOLDS = Array.from({ length: 41 }, (_, index) => index / 40);\nconst REVEAL_SETTLE_BUFFER_MS = 50;\n\nfunction hashTarget(): HTMLElement | null {\n if (!window.location.hash || window.location.hash === \"#\") return null;\n\n try {\n return document.getElementById(\n decodeURIComponent(window.location.hash.slice(1)),\n );\n } catch {\n return null;\n }\n}\n\nfunction containsTarget(\n element: HTMLElement,\n target: HTMLElement | null,\n): boolean {\n return Boolean(target && (element === target || element.contains(target)));\n}\n\nfunction containsProtectedContent(element: HTMLElement): boolean {\n return (\n element.matches(SF_MOTION_PROTECTED_CONTENT_SELECTOR) ||\n Boolean(element.querySelector(SF_MOTION_PROTECTED_CONTENT_SELECTOR))\n );\n}\n\nfunction revealState(element: HTMLElement): SfRevealState {\n const state = element.getAttribute(REVEAL_STATE_ATTRIBUTE);\n if (state === \"visible\" || state === \"settled\") return state;\n return \"pending\";\n}\n\nfunction isMotionDisabled(element: HTMLElement): boolean {\n return Boolean(element.closest(`.${SF_MOTION_DISABLE_CLASS}`));\n}\n\nfunction selectElements(selector: string): NodeListOf<HTMLElement> | null {\n try {\n return document.querySelectorAll<HTMLElement>(selector);\n } catch {\n return null;\n }\n}\n\nfunction inheritAutomaticReveals({\n autoRevealSelectors,\n defaultReveal,\n revealRules,\n}: ResolvedSfMotionOptions): void {\n const ruleMatchedElements = new WeakSet<HTMLElement>();\n revealRules.forEach(({ selector, reveal }) => {\n selectElements(selector)?.forEach((element) => {\n if (isMotionDisabled(element) || ruleMatchedElements.has(element)) return;\n\n const classChanges = ruleRevealClassChanges(element.classList, reveal);\n element.classList.remove(...classChanges.remove);\n element.classList.add(...classChanges.add);\n ruleMatchedElements.add(element);\n });\n });\n\n if (defaultReveal === false) return;\n autoRevealSelectors.forEach((selector) => {\n selectElements(selector)?.forEach((element) => {\n if (isMotionDisabled(element)) return;\n\n element.classList.add(\n ...automaticRevealClasses(element.classList, defaultReveal),\n );\n });\n });\n}\n\n/**\n * Assigns delay by participating reveal, not by direct-child position. A\n * reveal belongs only to its nearest stagger group, so nested groups keep an\n * autonomous sequence even through arbitrary Gutenberg wrappers.\n */\nfunction applyRevealStaggers(): void {\n document\n .querySelectorAll<HTMLElement>(SF_REVEAL_STAGGER_SELECTOR)\n .forEach((group) => {\n const owned = Array.from(\n group.querySelectorAll<HTMLElement>(\".sf-reveal\"),\n ).filter((element) => element.closest(SF_REVEAL_STAGGER_SELECTOR) === group);\n\n owned.forEach((element) => {\n element.style.removeProperty(\"--sf-reveal-delay\");\n });\n owned\n .filter((element) => (\n !element.classList.contains(\"sf-motion-static\") &&\n !isMotionDisabled(element) &&\n !containsProtectedContent(element)\n ))\n .forEach((element, index) => {\n element.style.setProperty(\n \"--sf-reveal-delay\",\n `${staggerRevealDelayMs(index)}ms`,\n );\n });\n });\n}\n\n/**\n * Initializes the project reveal system once per document.\n *\n * Markup is visible by default. Initial-viewport content remains visible unless\n * `revealAboveFold` explicitly opts it into motion; every reveal completes once.\n * Reveals follow the shared motion preference (see `motion-preference.ts`):\n * reduced motion shows everything at once, and allowing it again re-arms the\n * reveals still below the fold without a reload.\n */\nexport function initializeSfMotion(options: SfMotionOptions = {}): void {\n const root = document.documentElement;\n if (!shouldInitializeMotion(root.dataset.sfMotionInitialized)) return;\n root.dataset.sfMotionInitialized = \"true\";\n\n const resolvedOptions = resolveSfMotionOptions(options);\n inheritAutomaticReveals(resolvedOptions);\n applyRevealStaggers();\n\n // Custom media classes may round the image instead of its block. Keep that\n // authored edge on the stationary frame while the inner pixels zoom.\n document.querySelectorAll<HTMLElement>(\".sf-reveal--zoom-in [data-flowpress-media-frame]\").forEach(frame => {\n const media = frame.querySelector(\"img, svg\");\n if (!media) return;\n const radius = window.getComputedStyle(media).borderRadius;\n if (radius && !/^0px(?: 0px)*$/.test(radius)) frame.style.borderRadius = radius;\n });\n\n const revealElements = (): HTMLElement[] =>\n Array.from(document.querySelectorAll<HTMLElement>(\".sf-reveal\"));\n const revealAll = (): void => {\n revealElements().forEach((element) => {\n element.setAttribute(REVEAL_STATE_ATTRIBUTE, \"settled\");\n });\n };\n\n const observed = new WeakSet<HTMLElement>();\n const pending = new Set<HTMLElement>();\n const settleTimers = new WeakMap<HTMLElement, number>();\n let observer: IntersectionObserver | null = null;\n let visibilityFrame = 0;\n\n const settleReveal = (element: HTMLElement): void => {\n const existingTimer = settleTimers.get(element);\n if (existingTimer !== undefined) window.clearTimeout(existingTimer);\n\n // Zoom animates the media inside an unmoving reveal box. Its transition,\n // including stagger delay, must finish before entering `settled`.\n const transitioning = element.classList.contains(\"sf-reveal--zoom-in\")\n ? [element, ...element.querySelectorAll<HTMLElement>(\"[data-flowpress-media-frame] > img, [data-flowpress-media-frame] > svg\")]\n : [element];\n const transitionTime = Math.max(...transitioning.map(target => {\n const styles = window.getComputedStyle(target);\n return maximumTransitionTimeMs(styles.transitionDuration, styles.transitionDelay);\n }));\n const settle = (): void => {\n if (revealState(element) === \"visible\") {\n element.setAttribute(REVEAL_STATE_ATTRIBUTE, \"settled\");\n }\n settleTimers.delete(element);\n };\n\n if (transitionTime === 0) {\n settle();\n return;\n }\n\n settleTimers.set(\n element,\n window.setTimeout(settle, transitionTime + REVEAL_SETTLE_BUFFER_MS),\n );\n };\n\n const revealOne = (\n element: HTMLElement,\n event: \"focus\" | \"intersect\",\n ): void => {\n const state = event === \"focus\" && element.classList.contains(\"sf-reveal--zoom-in\")\n ? \"settled\"\n : nextRevealState(revealState(element), event);\n element.setAttribute(REVEAL_STATE_ATTRIBUTE, state);\n pending.delete(element);\n if (state === \"visible\") settleReveal(element);\n if (observed.has(element)) {\n observer?.unobserve(element);\n observed.delete(element);\n }\n };\n\n /**\n * A reveal's opacity/filter/clip-path apply only to itself, but those\n * properties compose down the DOM: painted inside a still-pending ancestor,\n * an element renders invisible regardless of its own state. Revealing an\n * element therefore also reveals every pending `.sf-reveal` ancestor, so a\n * nested reveal can never end up stuck under a hidden parent.\n */\n const reveal = (\n element: HTMLElement,\n event: \"focus\" | \"intersect\" = \"focus\",\n ): void => {\n revealOne(element, event);\n let ancestor =\n element.parentElement?.closest<HTMLElement>(SF_REVEAL_SELECTOR) ?? null;\n while (ancestor) {\n if (revealState(ancestor) === \"pending\") revealOne(ancestor, event);\n ancestor =\n ancestor.parentElement?.closest<HTMLElement>(SF_REVEAL_SELECTOR) ??\n null;\n }\n };\n\n /**\n * A fully clipped reveal can intersect with a zero-area rectangle. Its first\n * observer entry may arrive before 20% of its height is in view, and no more\n * entries follow while that intersection ratio stays at zero. Check layout\n * bounds on scroll as well so those reveals cannot remain pending in view.\n */\n const checkPendingVisibility = (): void => {\n visibilityFrame = 0;\n const ready: HTMLElement[] = [];\n for (const element of pending) {\n const bounds = element.getBoundingClientRect();\n if (\n bounds.width <= 0 ||\n bounds.height <= 0 ||\n bounds.right <= 0 ||\n bounds.left >= window.innerWidth ||\n !hasEnoughVisibleArea({\n bottom: bounds.bottom,\n height: bounds.height,\n top: bounds.top,\n viewportHeight: window.innerHeight,\n })\n ) {\n continue;\n }\n\n ready.push(element);\n }\n ready.forEach((element) => {\n if (pending.has(element)) reveal(element, \"intersect\");\n });\n };\n\n const scheduleVisibilityCheck = (): void => {\n if (pending.size === 0 || visibilityFrame !== 0) return;\n visibilityFrame = window.requestAnimationFrame(checkPendingVisibility);\n };\n\n window.addEventListener(\"scroll\", scheduleVisibilityCheck, { passive: true });\n document.addEventListener(\"scroll\", scheduleVisibilityCheck, {\n capture: true,\n passive: true,\n });\n window.addEventListener(\"resize\", scheduleVisibilityCheck);\n\n /** Motion reduced: every reveal is simply there, nothing is hidden or animated. */\n const disarm = (): void => {\n observer?.disconnect();\n observer = null;\n pending.clear();\n revealAll();\n root.dataset.sfMotion = \"static\";\n };\n\n /**\n * Motion allowed: hide what is still below the fold and let it enter with the\n * viewport. When motion is allowed again mid-visit (`initial` is false)\n * everything already in view or behind stays put instead of replaying.\n */\n const arm = (initial: boolean): void => {\n if (typeof window.IntersectionObserver !== \"function\") {\n disarm();\n return;\n }\n\n observer?.disconnect();\n pending.clear();\n const entering = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n if (\n !entry.isIntersecting ||\n !(entry.target instanceof HTMLElement) ||\n !hasEnoughVisibleArea({\n bottom: entry.boundingClientRect.bottom,\n height: entry.boundingClientRect.height,\n top: entry.boundingClientRect.top,\n viewportHeight: window.innerHeight,\n })\n ) {\n return;\n }\n\n reveal(entry.target, \"intersect\");\n });\n },\n {\n rootMargin: \"0px\",\n threshold: REVEAL_THRESHOLDS,\n },\n );\n observer = entering;\n\n const target = hashTarget();\n document\n .querySelectorAll<HTMLElement>(SF_REVEAL_SELECTOR)\n .forEach((element) => {\n if (isMotionDisabled(element)) return;\n\n const bounds = element.getBoundingClientRect();\n const state = !initial && bounds.top < window.innerHeight\n ? \"visible\"\n : initialRevealState({\n bottom: bounds.bottom,\n containsHashTarget: containsTarget(element, target),\n protectedContent: containsProtectedContent(element),\n reducedMotion: false,\n revealAboveFold: resolvedOptions.revealAboveFold,\n top: bounds.top,\n viewportHeight: window.innerHeight,\n });\n element.setAttribute(\n REVEAL_STATE_ATTRIBUTE,\n state === \"visible\" ? \"settled\" : state,\n );\n\n if (state === \"pending\") {\n observed.add(element);\n pending.add(element);\n entering.observe(element);\n }\n });\n\n root.dataset.sfMotion = \"ready\";\n scheduleVisibilityCheck();\n };\n\n let initial = true;\n const applyPreference = (preference: MotionPreference): void => {\n if (preference === \"reduce\") disarm();\n else arm(initial);\n initial = false;\n };\n\n document.addEventListener(\"focusin\", (event) => {\n if (!observer || !(event.target instanceof Element)) return;\n const element = event.target.closest<HTMLElement>(SF_REVEAL_SELECTOR);\n if (element && !isMotionDisabled(element)) reveal(element);\n });\n\n window.addEventListener(\"hashchange\", () => {\n if (!observer) return;\n const targetElement = hashTarget();\n const element = targetElement?.closest<HTMLElement>(SF_REVEAL_SELECTOR);\n if (element && !isMotionDisabled(element)) reveal(element);\n });\n\n applyPreference(getMotionPreference());\n subscribeMotionPreference(applyPreference);\n}\n"]}
1
+ {"version":3,"file":"motion-controller.js","sourceRoot":"","sources":["../../../src/astro/motion/motion-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,oCAAoC,EACpC,oBAAoB,EACpB,kBAAkB,EAClB,0BAA0B,EAC1B,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,GAIvB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,mBAAmB,EACnB,yBAAyB,GAE1B,MAAM,4BAA4B,CAAC;AAEpC,MAAM,sBAAsB,GAAG,sBAAsB,CAAC;AACtD,MAAM,iBAAiB,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;AAC/E,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAEnC,SAAS,UAAU;IACjB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,KAAK,GAAG;QAAE,OAAO,IAAI,CAAC;IAEvE,IAAI,CAAC;QACH,OAAO,QAAQ,CAAC,cAAc,CAC5B,kBAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAClD,CAAC;IACJ,CAAC;IAAC,MAAM,C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AO,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;YAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;IAEH,eAAe,CAAC,mBAAmB,EAAE,CAAC,CAAC;IACvC,yBAAyB,CAAC,eAAe,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["import {\n SF_MOTION_DISABLE_CLASS,\n SF_MOTION_PROTECTED_CONTENT_SELECTOR,\n SF_REVEAL_SKIP_CLASS,\n SF_REVEAL_SELECTOR,\n SF_REVEAL_STAGGER_SELECTOR,\n automaticRevealClasses,\n hasEnoughVisibleArea,\n initialRevealState,\n maximumTransitionTimeMs,\n nextRevealState,\n resolveSfMotionOptions,\n ruleRevealClassChanges,\n staggerRevealDelayMs,\n shouldInitializeMotion,\n type ResolvedSfMotionOptions,\n type SfMotionOptions,\n type SfRevealState,\n} from \"./motion.js\";\nimport {\n getMotionPreference,\n subscribeMotionPreference,\n type MotionPreference,\n} from \"../../motion-preference.js\";\n\nconst REVEAL_STATE_ATTRIBUTE = \"data-sf-reveal-state\";\nconst REVEAL_THRESHOLDS = Array.from({ length: 41 }, (_, index) => index / 40);\nconst REVEAL_SETTLE_BUFFER_MS = 50;\n\nfunction hashTarget(): HTMLElement | null {\n if (!window.location.hash || window.location.hash === \"#\") return null;\n\n try {\n return document.getElementById(\n decodeURIComponent(window.location.hash.slice(1)),\n );\n } catch {\n return null;\n }\n}\n\nfunction containsTarget(\n element: HTMLElement,\n target: HTMLElement | null,\n): boolean {\n return Boolean(target && (element === target || element.contains(target)));\n}\n\nfunction containsProtectedContent(element: HTMLElement): boolean {\n return (\n element.matches(SF_MOTION_PROTECTED_CONTENT_SELECTOR) ||\n Boolean(element.querySelector(SF_MOTION_PROTECTED_CONTENT_SELECTOR))\n );\n}\n\nfunction revealState(element: HTMLElement): SfRevealState {\n const state = element.getAttribute(REVEAL_STATE_ATTRIBUTE);\n if (state === \"visible\" || state === \"settled\") return state;\n return \"pending\";\n}\n\nfunction isMotionDisabled(element: HTMLElement): boolean {\n return Boolean(element.closest(`.${SF_MOTION_DISABLE_CLASS}, .${SF_REVEAL_SKIP_CLASS}`));\n}\n\nfunction selectElements(selector: string): NodeListOf<HTMLElement> | null {\n try {\n return document.querySelectorAll<HTMLElement>(selector);\n } catch {\n return null;\n }\n}\n\nfunction inheritAutomaticReveals({\n autoRevealSelectors,\n defaultReveal,\n revealRules,\n}: ResolvedSfMotionOptions): void {\n const ruleMatchedElements = new WeakSet<HTMLElement>();\n revealRules.forEach(({ selector, reveal }) => {\n selectElements(selector)?.forEach((element) => {\n if (isMotionDisabled(element) || ruleMatchedElements.has(element)) return;\n\n const classChanges = ruleRevealClassChanges(element.classList, reveal);\n element.classList.remove(...classChanges.remove);\n element.classList.add(...classChanges.add);\n ruleMatchedElements.add(element);\n });\n });\n\n if (defaultReveal === false) return;\n autoRevealSelectors.forEach((selector) => {\n selectElements(selector)?.forEach((element) => {\n if (isMotionDisabled(element)) return;\n\n element.classList.add(\n ...automaticRevealClasses(element.classList, defaultReveal),\n );\n });\n });\n}\n\n/**\n * Assigns delay by participating reveal, not by direct-child position. A\n * reveal belongs only to its nearest stagger group, so nested groups keep an\n * autonomous sequence even through arbitrary Gutenberg wrappers.\n */\nfunction applyRevealStaggers(): void {\n document\n .querySelectorAll<HTMLElement>(SF_REVEAL_STAGGER_SELECTOR)\n .forEach((group) => {\n const owned = Array.from(\n group.querySelectorAll<HTMLElement>(\".sf-reveal\"),\n ).filter((element) => element.closest(SF_REVEAL_STAGGER_SELECTOR) === group);\n\n owned.forEach((element) => {\n element.style.removeProperty(\"--sf-reveal-delay\");\n });\n owned\n .filter((element) => (\n !element.classList.contains(\"sf-motion-static\") &&\n !isMotionDisabled(element) &&\n !containsProtectedContent(element)\n ))\n .forEach((element, index) => {\n element.style.setProperty(\n \"--sf-reveal-delay\",\n `${staggerRevealDelayMs(index)}ms`,\n );\n });\n });\n}\n\n/**\n * Initializes the project reveal system once per document.\n *\n * Markup is visible by default. Initial-viewport content remains visible unless\n * `revealAboveFold` explicitly opts it into motion; every reveal completes once.\n * Reveals follow the shared motion preference (see `motion-preference.ts`):\n * reduced motion shows everything at once, and allowing it again re-arms the\n * reveals still below the fold without a reload.\n */\nexport function initializeSfMotion(options: SfMotionOptions = {}): void {\n const root = document.documentElement;\n if (!shouldInitializeMotion(root.dataset.sfMotionInitialized)) return;\n root.dataset.sfMotionInitialized = \"true\";\n\n const resolvedOptions = resolveSfMotionOptions(options);\n inheritAutomaticReveals(resolvedOptions);\n applyRevealStaggers();\n\n // Custom media classes may round the image instead of its block. Keep that\n // authored edge on the stationary frame while the inner pixels zoom.\n document.querySelectorAll<HTMLElement>(\".sf-reveal--zoom-in [data-flowpress-media-frame]\").forEach(frame => {\n const media = frame.querySelector(\"img, svg\");\n if (!media) return;\n const radius = window.getComputedStyle(media).borderRadius;\n if (radius && !/^0px(?: 0px)*$/.test(radius)) frame.style.borderRadius = radius;\n });\n\n const revealElements = (): HTMLElement[] =>\n Array.from(document.querySelectorAll<HTMLElement>(\".sf-reveal\"));\n const revealAll = (): void => {\n revealElements().forEach((element) => {\n element.setAttribute(REVEAL_STATE_ATTRIBUTE, \"settled\");\n });\n };\n\n const observed = new WeakSet<HTMLElement>();\n const pending = new Set<HTMLElement>();\n const settleTimers = new WeakMap<HTMLElement, number>();\n let observer: IntersectionObserver | null = null;\n let visibilityFrame = 0;\n\n const settleReveal = (element: HTMLElement): void => {\n const existingTimer = settleTimers.get(element);\n if (existingTimer !== undefined) window.clearTimeout(existingTimer);\n\n // Zoom animates the media inside an unmoving reveal box. Its transition,\n // including stagger delay, must finish before entering `settled`.\n const transitioning = element.classList.contains(\"sf-reveal--zoom-in\")\n ? [element, ...element.querySelectorAll<HTMLElement>(\"[data-flowpress-media-frame] > img, [data-flowpress-media-frame] > svg\")]\n : [element];\n const transitionTime = Math.max(...transitioning.map(target => {\n const styles = window.getComputedStyle(target);\n return maximumTransitionTimeMs(styles.transitionDuration, styles.transitionDelay);\n }));\n const settle = (): void => {\n if (revealState(element) === \"visible\") {\n element.setAttribute(REVEAL_STATE_ATTRIBUTE, \"settled\");\n }\n settleTimers.delete(element);\n };\n\n if (transitionTime === 0) {\n settle();\n return;\n }\n\n settleTimers.set(\n element,\n window.setTimeout(settle, transitionTime + REVEAL_SETTLE_BUFFER_MS),\n );\n };\n\n const revealOne = (\n element: HTMLElement,\n event: \"focus\" | \"intersect\",\n ): void => {\n const state = event === \"focus\" && element.classList.contains(\"sf-reveal--zoom-in\")\n ? \"settled\"\n : nextRevealState(revealState(element), event);\n element.setAttribute(REVEAL_STATE_ATTRIBUTE, state);\n pending.delete(element);\n if (state === \"visible\") settleReveal(element);\n if (observed.has(element)) {\n observer?.unobserve(element);\n observed.delete(element);\n }\n };\n\n /**\n * A reveal's opacity/filter/clip-path apply only to itself, but those\n * properties compose down the DOM: painted inside a still-pending ancestor,\n * an element renders invisible regardless of its own state. Revealing an\n * element therefore also reveals every pending `.sf-reveal` ancestor, so a\n * nested reveal can never end up stuck under a hidden parent.\n */\n const reveal = (\n element: HTMLElement,\n event: \"focus\" | \"intersect\" = \"focus\",\n ): void => {\n revealOne(element, event);\n let ancestor =\n element.parentElement?.closest<HTMLElement>(SF_REVEAL_SELECTOR) ?? null;\n while (ancestor) {\n if (revealState(ancestor) === \"pending\") revealOne(ancestor, event);\n ancestor =\n ancestor.parentElement?.closest<HTMLElement>(SF_REVEAL_SELECTOR) ??\n null;\n }\n };\n\n /**\n * A fully clipped reveal can intersect with a zero-area rectangle. Its first\n * observer entry may arrive before 20% of its height is in view, and no more\n * entries follow while that intersection ratio stays at zero. Check layout\n * bounds on scroll as well so those reveals cannot remain pending in view.\n */\n const checkPendingVisibility = (): void => {\n visibilityFrame = 0;\n const ready: HTMLElement[] = [];\n for (const element of pending) {\n const bounds = element.getBoundingClientRect();\n if (\n bounds.width <= 0 ||\n bounds.height <= 0 ||\n bounds.right <= 0 ||\n bounds.left >= window.innerWidth ||\n !hasEnoughVisibleArea({\n bottom: bounds.bottom,\n height: bounds.height,\n top: bounds.top,\n viewportHeight: window.innerHeight,\n })\n ) {\n continue;\n }\n\n ready.push(element);\n }\n ready.forEach((element) => {\n if (pending.has(element)) reveal(element, \"intersect\");\n });\n };\n\n const scheduleVisibilityCheck = (): void => {\n if (pending.size === 0 || visibilityFrame !== 0) return;\n visibilityFrame = window.requestAnimationFrame(checkPendingVisibility);\n };\n\n window.addEventListener(\"scroll\", scheduleVisibilityCheck, { passive: true });\n document.addEventListener(\"scroll\", scheduleVisibilityCheck, {\n capture: true,\n passive: true,\n });\n window.addEventListener(\"resize\", scheduleVisibilityCheck);\n\n /** Motion reduced: every reveal is simply there, nothing is hidden or animated. */\n const disarm = (): void => {\n observer?.disconnect();\n observer = null;\n pending.clear();\n revealAll();\n root.dataset.sfMotion = \"static\";\n };\n\n /**\n * Motion allowed: hide what is still below the fold and let it enter with the\n * viewport. When motion is allowed again mid-visit (`initial` is false)\n * everything already in view or behind stays put instead of replaying.\n */\n const arm = (initial: boolean): void => {\n if (typeof window.IntersectionObserver !== \"function\") {\n disarm();\n return;\n }\n\n observer?.disconnect();\n pending.clear();\n const entering = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n if (\n !entry.isIntersecting ||\n !(entry.target instanceof HTMLElement) ||\n !hasEnoughVisibleArea({\n bottom: entry.boundingClientRect.bottom,\n height: entry.boundingClientRect.height,\n top: entry.boundingClientRect.top,\n viewportHeight: window.innerHeight,\n })\n ) {\n return;\n }\n\n reveal(entry.target, \"intersect\");\n });\n },\n {\n rootMargin: \"0px\",\n threshold: REVEAL_THRESHOLDS,\n },\n );\n observer = entering;\n\n const target = hashTarget();\n document\n .querySelectorAll<HTMLElement>(SF_REVEAL_SELECTOR)\n .forEach((element) => {\n if (isMotionDisabled(element)) return;\n\n const bounds = element.getBoundingClientRect();\n const state = !initial && bounds.top < window.innerHeight\n ? \"visible\"\n : initialRevealState({\n bottom: bounds.bottom,\n containsHashTarget: containsTarget(element, target),\n protectedContent: containsProtectedContent(element),\n reducedMotion: false,\n revealAboveFold: resolvedOptions.revealAboveFold,\n top: bounds.top,\n viewportHeight: window.innerHeight,\n });\n element.setAttribute(\n REVEAL_STATE_ATTRIBUTE,\n state === \"visible\" ? \"settled\" : state,\n );\n\n if (state === \"pending\") {\n observed.add(element);\n pending.add(element);\n entering.observe(element);\n }\n });\n\n root.dataset.sfMotion = \"ready\";\n scheduleVisibilityCheck();\n };\n\n let initial = true;\n const applyPreference = (preference: MotionPreference): void => {\n if (preference === \"reduce\") disarm();\n else arm(initial);\n initial = false;\n };\n\n document.addEventListener(\"focusin\", (event) => {\n if (!observer || !(event.target instanceof Element)) return;\n const element = event.target.closest<HTMLElement>(SF_REVEAL_SELECTOR);\n if (element && !isMotionDisabled(element)) reveal(element);\n });\n\n window.addEventListener(\"hashchange\", () => {\n if (!observer) return;\n const targetElement = hashTarget();\n const element = targetElement?.closest<HTMLElement>(SF_REVEAL_SELECTOR);\n if (element && !isMotionDisabled(element)) reveal(element);\n });\n\n applyPreference(getMotionPreference());\n subscribeMotionPreference(applyPreference);\n}\n"]}
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  SF_MOTION_DISABLE_CLASS,
3
3
  SF_MOTION_PROTECTED_CONTENT_SELECTOR,
4
+ SF_REVEAL_SKIP_CLASS,
4
5
  SF_REVEAL_SELECTOR,
5
6
  SF_REVEAL_STAGGER_SELECTOR,
6
7
  automaticRevealClasses,
@@ -59,7 +60,7 @@ function revealState(element: HTMLElement): SfRevealState {
59
60
  }
60
61
 
61
62
  function isMotionDisabled(element: HTMLElement): boolean {
62
- return Boolean(element.closest(`.${SF_MOTION_DISABLE_CLASS}`));
63
+ return Boolean(element.closest(`.${SF_MOTION_DISABLE_CLASS}, .${SF_REVEAL_SKIP_CLASS}`));
63
64
  }
64
65
 
65
66
  function selectElements(selector: string): NodeListOf<HTMLElement> | null {
@@ -91,8 +91,8 @@ html[data-sf-motion="ready"]
91
91
  }
92
92
 
93
93
  html[data-sf-motion="static"] .sf-reveal--zoom-in [data-flowpress-media-frame] > :is(img, svg),
94
- html[data-sf-motion] .sf-motion-disable .sf-reveal--zoom-in [data-flowpress-media-frame] > :is(img, svg),
95
- html[data-sf-motion] .sf-motion-disable.sf-reveal--zoom-in [data-flowpress-media-frame] > :is(img, svg) {
94
+ html[data-sf-motion] :is(.sf-motion-disable, .sf-reveal-skip) .sf-reveal--zoom-in [data-flowpress-media-frame] > :is(img, svg),
95
+ html[data-sf-motion] :is(.sf-motion-disable, .sf-reveal-skip).sf-reveal--zoom-in [data-flowpress-media-frame] > :is(img, svg) {
96
96
  transform: none !important;
97
97
  transition: none !important;
98
98
  }
@@ -259,8 +259,9 @@ html[data-sf-motion] .sf-reveal.sf-motion-static {
259
259
  transition: none;
260
260
  }
261
261
 
262
- html[data-sf-motion] .sf-motion-disable.sf-reveal,
263
- html[data-sf-motion] .sf-motion-disable .sf-reveal {
262
+ /* Both opt-outs keep reveals visible; only sf-motion-disable also stops every other motion. */
263
+ html[data-sf-motion] :is(.sf-motion-disable, .sf-reveal-skip).sf-reveal,
264
+ html[data-sf-motion] :is(.sf-motion-disable, .sf-reveal-skip) .sf-reveal {
264
265
  clip-path: none !important;
265
266
  filter: none !important;
266
267
  opacity: 1 !important;
@@ -2,6 +2,11 @@ export declare const SF_REVEAL_SELECTOR = ".sf-reveal:not(.sf-motion-static)";
2
2
  export declare const SF_REVEAL_CLASS = "sf-reveal";
3
3
  export declare const SF_MOTION_STATIC_CLASS = "sf-motion-static";
4
4
  export declare const SF_MOTION_DISABLE_CLASS = "sf-motion-disable";
5
+ /**
6
+ * Opts a subtree out of reveals only. Unlike `sf-motion-disable`, transitions
7
+ * and animations inside it keep running (a carousel track moves its slides).
8
+ */
9
+ export declare const SF_REVEAL_SKIP_CLASS = "sf-reveal-skip";
5
10
  export declare const SF_MOTION_DRAWER_EXIT_MS = 820;
6
11
  export declare const SF_REVEAL_VISIBLE_RATIO = 0.2;
7
12
  export declare const SF_REVEAL_STAGGER_SELECTOR =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AuF;AACvF,eAAO,MAAM,oBAAoB,SAAS,CAAC;AAE3C,+EAA+E;AAC/E,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C;;;GAGG;AACH,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CACjD,MAAM,CAAC,gBAAgB,EAAE,UAAU,GAAG,SAAS,CAAC,CAGjD,CAAC;AAgBF;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,mBAAmB,EAAE,MAAM,GAAG,MAAM,CAIpE;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,OAAO,GAAE,eAAoB,GAAG,MAAM,CA2CnE"}
@@ -2,6 +2,11 @@ export const SF_REVEAL_SELECTOR = ".sf-reveal:not(.sf-motion-static)";
2
2
  export const SF_REVEAL_CLASS = "sf-reveal";
3
3
  export const SF_MOTION_STATIC_CLASS = "sf-motion-static";
4
4
  export const SF_MOTION_DISABLE_CLASS = "sf-motion-disable";
5
+ /**
6
+ * Opts a subtree out of reveals only. Unlike `sf-motion-disable`, transitions
7
+ * and animations inside it keep running (a carousel track moves its slides).
8
+ */
9
+ export const SF_REVEAL_SKIP_CLASS = "sf-reveal-skip";
5
10
  export const SF_MOTION_DRAWER_EXIT_MS = 820;
6
11
  export const SF_REVEAL_VISIBLE_RATIO = 0.2;
7
12
  export const SF_REVEAL_STAGGER_SELECTOR = ".sf-reveal-stagger";
@@ -69,7 +74,8 @@ export function resolveSfMotionOptions(options = {}) {
69
74
  export function ruleRevealClassChanges(existingClasses, reveal) {
70
75
  const classes = Array.from(existingClasses);
71
76
  if (classes.includes(SF_MOTION_STATIC_CLASS) ||
72
- classes.includes(SF_MOTION_DISABLE_CLASS)) {
77
+ classes.includes(SF_MOTION_DISABLE_CLASS) ||
78
+ classes.includes(SF_REVEAL_SKIP_CLASS)) {
73
79
  return { add: [], remove: [] };
74
80
  }
75
81
  return {
@@ -98,7 +104,8 @@ export function automaticRevealClasses(existingClasses, defaultReveal) {
98
104
  return [];
99
105
  const classes = Array.from(existingClasses);
100
106
  if (classes.includes(SF_MOTION_STATIC_CLASS) ||
101
- classes.includes(SF_MOTION_DISABLE_CLASS)) {
107
+ classes.includes(SF_MOTION_DISABLE_CLASS) ||
108
+ classes.includes(SF_REVEAL_SKIP_CLASS)) {
102
109
  return [];
103
110
  }
104
111
  return [
@@ -197,6 +204,8 @@ const SF_MOTION_BOOT_EXCLUDED = [
197
204
  `.${SF_MOTION_STATIC_CLASS}`,
198
205
  `.${SF_MOTION_DISABLE_CLASS}`,
199
206
  `.${SF_MOTION_DISABLE_CLASS} *`,
207
+ `.${SF_REVEAL_SKIP_CLASS}`,
208
+ `.${SF_REVEAL_SKIP_CLASS} *`,
200
209
  SF_MOTION_PROTECTED_CONTENT_SELECTOR,
201
210
  `:has(${SF_MOTION_PROTECTED_CONTENT_SELECTOR})`,
202
211
  ":target",
@@ -1 +1 @@
1
- {"version":3,"file":"motion.js","sourceRoot":"","sources":["../../../src/astro/motion/motion.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,mCAAmC,CAAC;AAEtE,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAC;AAE3C,MAAM,CAAC,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;AAEzD,MAAM,CAAC,MAAM,uBAAuB,GAAG,mBAAmB,CAAC;AAE3D,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAE5C,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAE3C,MAAM,CAAC,MAAM,0BAA0B,GAAG,oBAAoB,CAAC;AAE/D,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAE5C,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAE5C,wEAAwE;AACxE,MAAM,CAAC,MAAM,oCAAoC,GAAG;IAClD,iBAAiB;IACjB,2BAA2B;IAC3B,sBAAsB;IACtB,iCAAiC;IACjC,iBAAiB;IACjB,MAAM;IACN,aAAa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AAQ,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;QACxF,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,IAAI,aAAa,KAAK,KAAK,EAAE,CAAC;QAC5B,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACtE,mBAAmB,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;YACvC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,QAAQ,SAAS,uBAAuB,GAAG,QAAQ,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC;QACjG,CAAC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,mDAAmD,CAAC,CAAC;IAChE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC","sourcesContent":["export const SF_REVEAL_SELECTOR = \".sf-reveal:not(.sf-motion-static)\";\n\nexport const SF_REVEAL_CLASS = \"sf-reveal\";\n\nexport const SF_MOTION_STATIC_CLASS = \"sf-motion-static\";\n\nexport const SF_MOTION_DISABLE_CLASS = \"sf-motion-disable\";\n\nexport const SF_MOTION_DRAWER_EXIT_MS = 820;\n\nexport const SF_REVEAL_VISIBLE_RATIO = 0.2;\n\nexport const SF_REVEAL_STAGGER_SELECTOR = \".sf-reveal-stagger\";\n\nexport const SF_REVEAL_STAGGER_STEP_MS = 90;\n\nexport const SF_REVEAL_STAGGER_MAX_MS = 450;\n\n/** Reveals matching or containing this content always start visible. */\nexport const SF_MOTION_PROTECTED_CONTENT_SELECTOR = [\n \".flowpress-hero\",\n 'img[fetchpriority=\"high\"]',\n 'img[loading=\"eager\"]',\n \"[data-flowpress-media-priority]\",\n \"video[autoplay]\",\n \"form\",\n \"[aria-live]\",\n '[role=\"alert\"]',\n '[role=\"status\"]',\n].join(\",\");\n\nconst SF_REVEAL_MODIFIER_PATTERN = /^sf-reveal--\\S+$/;\n\nexport type SfRevealModifier = `sf-reveal--${string}`;\n\nexport type SfDefaultReveal = false | SfRevealModifier;\n\nexport interface SfRevealRule {\n /** Any selector accepted by `document.querySelectorAll`. */\n selector: string;\n /** Reveal modifier enforced on every matching element. */\n reveal: SfRevealModifier;\n}\n\nexport interface SfRevealClassChanges {\n add: string[];\n remove: SfRevealModifier[];\n}\n\nexport interface SfMotionOptions {\n /**\n * Allows reveal elements already in the initial viewport to animate.\n * Defaults to `false`, so initial content is immediately available.\n */\n revealAboveFold?: boolean;\n /**\n * Ordered selector-specific reveal rules. The first matching rule wins and\n * enforces its modifier. Any valid CSS selector may be used.\n */\n revealRules?: readonly SfRevealRule[];\n /**\n * Preset applied to automatically selected elements. `false` keeps the\n * reveal system strictly opt-in.\n */\n defaultReveal?: SfDefaultReveal;\n /**\n * Standard CSS selectors. Tags, classes, IDs, attributes and combinations\n * can be mixed in the same array.\n */\n autoRevealSelectors?: readonly string[];\n}\n\nexport interface ResolvedSfMotionOptions {\n autoRevealSelectors: string[];\n defaultReveal: SfDefaultReveal;\n revealAboveFold: boolean;\n revealRules: SfRevealRule[];\n}\n\nexport type SfRevealState = \"pending\" | \"visible\" | \"settled\";\n\nexport interface InitialRevealStateInput {\n bottom: number;\n containsHashTarget: boolean;\n protectedContent: boolean;\n reducedMotion: boolean;\n revealAboveFold: boolean;\n top: number;\n viewportHeight: number;\n}\n\nexport interface RevealVisibilityInput {\n bottom: number;\n height: number;\n top: number;\n viewportHeight: number;\n}\n\nexport function isSfRevealModifier(value: unknown): value is SfRevealModifier {\n return typeof value === \"string\" && SF_REVEAL_MODIFIER_PATTERN.test(value);\n}\n\nfunction normalizeSelectors(value: unknown): string[] {\n if (!Array.isArray(value)) return [];\n\n return Array.from(\n new Set(\n value\n .filter((selector): selector is string => typeof selector === \"string\")\n .map((selector) => selector.trim())\n .filter(Boolean),\n ),\n );\n}\n\nfunction normalizeRevealRules(value: unknown): SfRevealRule[] {\n if (!Array.isArray(value)) return [];\n\n const seenSelectors = new Set<string>();\n return value.flatMap((rule: unknown) => {\n if (!rule || typeof rule !== \"object\") return [];\n\n const candidate = rule as Partial<SfRevealRule>;\n const selector =\n typeof candidate.selector === \"string\" ? candidate.selector.trim() : \"\";\n if (\n !selector ||\n seenSelectors.has(selector) ||\n !isSfRevealModifier(candidate.reveal)\n ) {\n return [];\n }\n\n seenSelectors.add(selector);\n return [{ selector, reveal: candidate.reveal }];\n });\n}\n\n/**\n * Normalizes server- or client-provided configuration. Invalid values fail\n * open by disabling automatic reveals; empty and duplicate selectors are\n * removed without changing their order.\n */\nexport function resolveSfMotionOptions(\n options: SfMotionOptions = {},\n): ResolvedSfMotionOptions {\n const defaultReveal = isSfRevealModifier(options.defaultReveal)\n ? options.defaultReveal\n : false;\n return {\n autoRevealSelectors: normalizeSelectors(options.autoRevealSelectors),\n defaultReveal,\n revealAboveFold: options.revealAboveFold === true,\n revealRules: normalizeRevealRules(options.revealRules),\n };\n}\n\n/** Exact class mutation required by an authoritative selector rule. */\nexport function ruleRevealClassChanges(\n existingClasses: Iterable<string>,\n reveal: SfRevealModifier,\n): SfRevealClassChanges {\n const classes = Array.from(existingClasses);\n if (\n classes.includes(SF_MOTION_STATIC_CLASS) ||\n classes.includes(SF_MOTION_DISABLE_CLASS)\n ) {\n return { add: [], remove: [] };\n }\n\n return {\n add: [\n ...(classes.includes(SF_REVEAL_CLASS) ? [] : [SF_REVEAL_CLASS]),\n ...(classes.includes(reveal) ? [] : [reveal]),\n ],\n remove: classes\n .filter(isSfRevealModifier)\n .filter((modifier) => modifier !== reveal),\n };\n}\n\n/** Delay for a zero-based participant index in a reveal stagger group. */\nexport function staggerRevealDelayMs(index: number): number {\n if (!Number.isFinite(index) || index <= 0) return 0;\n return Math.min(\n Math.floor(index) * SF_REVEAL_STAGGER_STEP_MS,\n SF_REVEAL_STAGGER_MAX_MS,\n );\n}\n\n/**\n * Returns only the classes that automatic inheritance must add. Explicit\n * modifiers win over the configured default and `sf-motion-static` remains a\n * complete opt-out.\n */\nexport function automaticRevealClasses(\n existingClasses: Iterable<string>,\n defaultReveal: SfDefaultReveal,\n): string[] {\n if (defaultReveal === false) return [];\n\n const classes = Array.from(existingClasses);\n if (\n classes.includes(SF_MOTION_STATIC_CLASS) ||\n classes.includes(SF_MOTION_DISABLE_CLASS)\n ) {\n return [];\n }\n\n return [\n ...(classes.includes(SF_REVEAL_CLASS) ? [] : [SF_REVEAL_CLASS]),\n ...(classes.some(isSfRevealModifier) ? [] : [defaultReveal]),\n ];\n}\n\nfunction cssTimeToMs(value: string): number {\n const normalized = value.trim();\n const amount = Number.parseFloat(normalized);\n if (!Number.isFinite(amount)) return 0;\n\n return normalized.endsWith(\"ms\") ? amount : amount * 1000;\n}\n\n/** Returns the longest combined CSS transition duration and delay. */\nexport function maximumTransitionTimeMs(\n transitionDuration: string,\n transitionDelay: string,\n): number {\n const durations = transitionDuration.split(\",\").map(cssTimeToMs);\n const delays = transitionDelay.split(\",\").map(cssTimeToMs);\n const itemCount = Math.max(durations.length, delays.length);\n\n return Array.from({ length: itemCount }, (_, index) => {\n const duration = durations[index % durations.length] ?? 0;\n const delay = delays[index % delays.length] ?? 0;\n return Math.max(0, duration + delay);\n }).reduce((maximum, value) => Math.max(maximum, value), 0);\n}\n\n/**\n * Initial viewport content stays static unless the project explicitly enables\n * above-the-fold reveals. Deep links and protected content remain visible.\n */\nexport function initialRevealState({\n bottom,\n containsHashTarget,\n protectedContent,\n reducedMotion,\n revealAboveFold,\n top,\n viewportHeight,\n}: InitialRevealStateInput): SfRevealState {\n if (\n reducedMotion ||\n containsHashTarget ||\n protectedContent\n ) {\n return \"visible\";\n }\n\n // reveal share of its height) waits for the scroll instead of appearing\n // statically; content already scrolled past the top stays visible.\n if (\n !revealAboveFold &&\n bottom > 0 &&\n top < viewportHeight &&\n (top < 0 ||\n hasEnoughVisibleArea({\n bottom,\n height: Math.max(0, bottom - top),\n top,\n viewportHeight,\n }))\n ) {\n return \"visible\";\n }\n\n return \"pending\";\n}\n\n/**\n * Reveal ordinary content once 20% of its perceivable height is visible.\n * For elements taller than the viewport, the viewport height is the reference.\n */\nexport function hasEnoughVisibleArea({\n bottom,\n height,\n top,\n viewportHeight,\n}: RevealVisibilityInput): boolean {\n if (height <= 0 || viewportHeight <= 0) return true;\n\n const visibleHeight = Math.max(\n 0,\n Math.min(bottom, viewportHeight) - Math.max(top, 0),\n );\n // The 1px tolerance below must not let thin elements such as a 1px <hr>\n // pass while they are still entirely outside the viewport.\n if (visibleHeight <= 0) return false;\n\n const requiredHeight =\n Math.min(height, viewportHeight) * SF_REVEAL_VISIBLE_RATIO;\n\n return visibleHeight + 1 >= requiredHeight;\n}\n\n/**\n * Reveal is deliberately one-way: focus and viewport entry can complete it,\n * while leaving the viewport never conceals content again.\n */\nexport function nextRevealState(\n current: SfRevealState,\n event: \"focus\" | \"intersect\" | \"leave\",\n): SfRevealState {\n if (current === \"settled\") return \"settled\";\n\n if (current === \"visible\" || event === \"focus\" || event === \"intersect\") {\n return \"visible\";\n }\n\n return \"pending\";\n}\n\nexport function shouldInitializeMotion(\n initialized: string | undefined,\n): boolean {\n return initialized !== \"true\";\n}\n\n/** `<html data-sf-motion>` value from the head bootstrap until the controller arms. */\nexport const SF_MOTION_BOOT_STATE = \"boot\";\n\n/** Failsafe: boot-hidden content shows anyway if the controller never arms. */\nexport const SF_MOTION_BOOT_FAILSAFE_MS = 3000;\n\n/**\n * Modifiers whose pending state keeps the element visible and hides only a\n * drawn decoration, mapped to the pseudo-element carrying it.\n */\nexport const SF_REVEAL_DECORATION_PSEUDOS: Readonly<\n Record<SfRevealModifier, \"::before\" | \"::after\">\n> = {\n \"sf-reveal--accordion-line\": \"::after\",\n};\n\n// Everything the controller leaves visible: opt-outs, protected content and the hash target.\n// :has() makes :not() invalid where unsupported, which drops the rule: content stays visible.\nconst SF_MOTION_BOOT_EXCLUDED = [\n `.${SF_MOTION_STATIC_CLASS}`,\n `.${SF_MOTION_DISABLE_CLASS}`,\n `.${SF_MOTION_DISABLE_CLASS} *`,\n SF_MOTION_PROTECTED_CONTENT_SELECTOR,\n `:has(${SF_MOTION_PROTECTED_CONTENT_SELECTOR})`,\n \":target\",\n \":has(:target)\",\n].join(\", \");\n\n/**\n * Inline `<head>` script, placed after the motion preference bootstrap: marks\n * the document as booting when the controller will arm reveals, so the CSS of\n * `motionBootCss` hides them before first paint.\n */\nexport function motionBootScript(preferenceAttribute: string): string {\n const attribute = JSON.stringify(preferenceAttribute);\n const state = JSON.stringify(SF_MOTION_BOOT_STATE);\n return `(()=>{const r=document.documentElement;if(r.getAttribute(${attribute})===\"full\"&&\"IntersectionObserver\"in window&&!r.dataset.sfMotion)r.dataset.sfMotion=${state}})()`;\n}\n\n/**\n * Pre-paint counterpart of the controller for `revealAboveFold`: hides what the\n * controller will arm (authored reveals, rule and automatic selectors) while\n * `<html data-sf-motion=\"boot\">`, so content is never painted, hidden, then\n * revealed. Each selector gets its own rule: an invalid one only drops itself.\n * Like the controller, the first matching rule decides the modifier.\n * Portabile in FlowPress: docs/pilots/primo-paint-stabile.md\n */\nexport function motionBootCss(options: SfMotionOptions = {}): string {\n const { autoRevealSelectors, defaultReveal, revealAboveFold, revealRules } =\n resolveSfMotionOptions(options);\n if (!revealAboveFold) return \"\";\n\n const root = `html[data-sf-motion=\"${SF_MOTION_BOOT_STATE}\"]`;\n const failsafe = `${SF_MOTION_BOOT_FAILSAFE_MS}ms`;\n const decorations = Object.entries(SF_REVEAL_DECORATION_PSEUDOS) as [\n SfRevealModifier,\n string,\n ][];\n const hide = (target: string, reveal: SfRevealModifier | null): string => {\n const pseudo = reveal ? (SF_REVEAL_DECORATION_PSEUDOS[reveal] ?? \"\") : \"\";\n return `${root} ${target}${pseudo}{opacity:0;animation:sf-motion-boot-failsafe 0s linear ${failsafe} forwards}`;\n };\n const rules: string[] = [];\n\n // Authored reveals keep their own modifier; decorations hide their pseudo.\n const decorationClasses = decorations.map(([modifier]) => `.${modifier}`);\n rules.push(hide(\n `.${SF_REVEAL_CLASS}:not(${[SF_MOTION_BOOT_EXCLUDED, ...decorationClasses].join(\", \")})`,\n null,\n ));\n decorations.forEach(([modifier]) => {\n rules.push(hide(`.${SF_REVEAL_CLASS}.${modifier}:not(${SF_MOTION_BOOT_EXCLUDED})`, modifier));\n });\n\n const earlier: string[] = [];\n revealRules.forEach(({ selector, reveal }) => {\n const shadowed = earlier.length ? `, :is(${earlier.join(\", \")})` : \"\";\n rules.push(hide(`:is(${selector}):not(${SF_MOTION_BOOT_EXCLUDED}${shadowed})`, reveal));\n earlier.push(selector);\n });\n\n if (defaultReveal !== false) {\n const shadowed = earlier.length ? `, :is(${earlier.join(\", \")})` : \"\";\n autoRevealSelectors.forEach((selector) => {\n rules.push(hide(`:is(${selector}):not(${SF_MOTION_BOOT_EXCLUDED}${shadowed})`, defaultReveal));\n });\n }\n\n rules.push(\"@keyframes sf-motion-boot-failsafe{to{opacity:1}}\");\n return rules.join(\"\\n\");\n}\n"]}
1
+ {"version":3,"file":"motion.js","sourceRoot":"","sources":["../../../src/astro/motion/motion.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,mCAAmC,CAAC;AAEtE,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAC;AAE3C,MAAM,CAAC,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;AAEzD,MAAM,CAAC,MAAM,uBAAuB,GAAG,mBAAmB,CAAC;AAE3D;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,gBAAgB,CAAC;AAErD,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAE5C,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAE3C,MAAM,CAAC,MAAM,0BAA0B,GAAG,oBAAoB,CAAC;AAE/D,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAE5C,MAAM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;IAEH,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,WAAW,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE;QAC3C,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACtE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,QAAQ,SAAS,uBAAuB,GAAG,QAAQ,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;QACxF,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,IAAI,aAAa,KAAK,KAAK,EAAE,CAAC;QAC5B,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACtE,mBAAmB,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;YACvC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,QAAQ,SAAS,uBAAuB,GAAG,QAAQ,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC;QACjG,CAAC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,mDAAmD,CAAC,CAAC;IAChE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC","sourcesContent":["export const SF_REVEAL_SELECTOR = \".sf-reveal:not(.sf-motion-static)\";\n\nexport const SF_REVEAL_CLASS = \"sf-reveal\";\n\nexport const SF_MOTION_STATIC_CLASS = \"sf-motion-static\";\n\nexport const SF_MOTION_DISABLE_CLASS = \"sf-motion-disable\";\n\n/**\n * Opts a subtree out of reveals only. Unlike `sf-motion-disable`, transitions\n * and animations inside it keep running (a carousel track moves its slides).\n */\nexport const SF_REVEAL_SKIP_CLASS = \"sf-reveal-skip\";\n\nexport const SF_MOTION_DRAWER_EXIT_MS = 820;\n\nexport const SF_REVEAL_VISIBLE_RATIO = 0.2;\n\nexport const SF_REVEAL_STAGGER_SELECTOR = \".sf-reveal-stagger\";\n\nexport const SF_REVEAL_STAGGER_STEP_MS = 90;\n\nexport const SF_REVEAL_STAGGER_MAX_MS = 450;\n\n/** Reveals matching or containing this content always start visible. */\nexport const SF_MOTION_PROTECTED_CONTENT_SELECTOR = [\n \".flowpress-hero\",\n 'img[fetchpriority=\"high\"]',\n 'img[loading=\"eager\"]',\n \"[data-flowpress-media-priority]\",\n \"video[autoplay]\",\n \"form\",\n \"[aria-live]\",\n '[role=\"alert\"]',\n '[role=\"status\"]',\n].join(\",\");\n\nconst SF_REVEAL_MODIFIER_PATTERN = /^sf-reveal--\\S+$/;\n\nexport type SfRevealModifier = `sf-reveal--${string}`;\n\nexport type SfDefaultReveal = false | SfRevealModifier;\n\nexport interface SfRevealRule {\n /** Any selector accepted by `document.querySelectorAll`. */\n selector: string;\n /** Reveal modifier enforced on every matching element. */\n reveal: SfRevealModifier;\n}\n\nexport interface SfRevealClassChanges {\n add: string[];\n remove: SfRevealModifier[];\n}\n\nexport interface SfMotionOptions {\n /**\n * Allows reveal elements already in the initial viewport to animate.\n * Defaults to `false`, so initial content is immediately available.\n */\n revealAboveFold?: boolean;\n /**\n * Ordered selector-specific reveal rules. The first matching rule wins and\n * enforces its modifier. Any valid CSS selector may be used.\n */\n revealRules?: readonly SfRevealRule[];\n /**\n * Preset applied to automatically selected elements. `false` keeps the\n * reveal system strictly opt-in.\n */\n defaultReveal?: SfDefaultReveal;\n /**\n * Standard CSS selectors. Tags, classes, IDs, attributes and combinations\n * can be mixed in the same array.\n */\n autoRevealSelectors?: readonly string[];\n}\n\nexport interface ResolvedSfMotionOptions {\n autoRevealSelectors: string[];\n defaultReveal: SfDefaultReveal;\n revealAboveFold: boolean;\n revealRules: SfRevealRule[];\n}\n\nexport type SfRevealState = \"pending\" | \"visible\" | \"settled\";\n\nexport interface InitialRevealStateInput {\n bottom: number;\n containsHashTarget: boolean;\n protectedContent: boolean;\n reducedMotion: boolean;\n revealAboveFold: boolean;\n top: number;\n viewportHeight: number;\n}\n\nexport interface RevealVisibilityInput {\n bottom: number;\n height: number;\n top: number;\n viewportHeight: number;\n}\n\nexport function isSfRevealModifier(value: unknown): value is SfRevealModifier {\n return typeof value === \"string\" && SF_REVEAL_MODIFIER_PATTERN.test(value);\n}\n\nfunction normalizeSelectors(value: unknown): string[] {\n if (!Array.isArray(value)) return [];\n\n return Array.from(\n new Set(\n value\n .filter((selector): selector is string => typeof selector === \"string\")\n .map((selector) => selector.trim())\n .filter(Boolean),\n ),\n );\n}\n\nfunction normalizeRevealRules(value: unknown): SfRevealRule[] {\n if (!Array.isArray(value)) return [];\n\n const seenSelectors = new Set<string>();\n return value.flatMap((rule: unknown) => {\n if (!rule || typeof rule !== \"object\") return [];\n\n const candidate = rule as Partial<SfRevealRule>;\n const selector =\n typeof candidate.selector === \"string\" ? candidate.selector.trim() : \"\";\n if (\n !selector ||\n seenSelectors.has(selector) ||\n !isSfRevealModifier(candidate.reveal)\n ) {\n return [];\n }\n\n seenSelectors.add(selector);\n return [{ selector, reveal: candidate.reveal }];\n });\n}\n\n/**\n * Normalizes server- or client-provided configuration. Invalid values fail\n * open by disabling automatic reveals; empty and duplicate selectors are\n * removed without changing their order.\n */\nexport function resolveSfMotionOptions(\n options: SfMotionOptions = {},\n): ResolvedSfMotionOptions {\n const defaultReveal = isSfRevealModifier(options.defaultReveal)\n ? options.defaultReveal\n : false;\n return {\n autoRevealSelectors: normalizeSelectors(options.autoRevealSelectors),\n defaultReveal,\n revealAboveFold: options.revealAboveFold === true,\n revealRules: normalizeRevealRules(options.revealRules),\n };\n}\n\n/** Exact class mutation required by an authoritative selector rule. */\nexport function ruleRevealClassChanges(\n existingClasses: Iterable<string>,\n reveal: SfRevealModifier,\n): SfRevealClassChanges {\n const classes = Array.from(existingClasses);\n if (\n classes.includes(SF_MOTION_STATIC_CLASS) ||\n classes.includes(SF_MOTION_DISABLE_CLASS) ||\n classes.includes(SF_REVEAL_SKIP_CLASS)\n ) {\n return { add: [], remove: [] };\n }\n\n return {\n add: [\n ...(classes.includes(SF_REVEAL_CLASS) ? [] : [SF_REVEAL_CLASS]),\n ...(classes.includes(reveal) ? [] : [reveal]),\n ],\n remove: classes\n .filter(isSfRevealModifier)\n .filter((modifier) => modifier !== reveal),\n };\n}\n\n/** Delay for a zero-based participant index in a reveal stagger group. */\nexport function staggerRevealDelayMs(index: number): number {\n if (!Number.isFinite(index) || index <= 0) return 0;\n return Math.min(\n Math.floor(index) * SF_REVEAL_STAGGER_STEP_MS,\n SF_REVEAL_STAGGER_MAX_MS,\n );\n}\n\n/**\n * Returns only the classes that automatic inheritance must add. Explicit\n * modifiers win over the configured default and `sf-motion-static` remains a\n * complete opt-out.\n */\nexport function automaticRevealClasses(\n existingClasses: Iterable<string>,\n defaultReveal: SfDefaultReveal,\n): string[] {\n if (defaultReveal === false) return [];\n\n const classes = Array.from(existingClasses);\n if (\n classes.includes(SF_MOTION_STATIC_CLASS) ||\n classes.includes(SF_MOTION_DISABLE_CLASS) ||\n classes.includes(SF_REVEAL_SKIP_CLASS)\n ) {\n return [];\n }\n\n return [\n ...(classes.includes(SF_REVEAL_CLASS) ? [] : [SF_REVEAL_CLASS]),\n ...(classes.some(isSfRevealModifier) ? [] : [defaultReveal]),\n ];\n}\n\nfunction cssTimeToMs(value: string): number {\n const normalized = value.trim();\n const amount = Number.parseFloat(normalized);\n if (!Number.isFinite(amount)) return 0;\n\n return normalized.endsWith(\"ms\") ? amount : amount * 1000;\n}\n\n/** Returns the longest combined CSS transition duration and delay. */\nexport function maximumTransitionTimeMs(\n transitionDuration: string,\n transitionDelay: string,\n): number {\n const durations = transitionDuration.split(\",\").map(cssTimeToMs);\n const delays = transitionDelay.split(\",\").map(cssTimeToMs);\n const itemCount = Math.max(durations.length, delays.length);\n\n return Array.from({ length: itemCount }, (_, index) => {\n const duration = durations[index % durations.length] ?? 0;\n const delay = delays[index % delays.length] ?? 0;\n return Math.max(0, duration + delay);\n }).reduce((maximum, value) => Math.max(maximum, value), 0);\n}\n\n/**\n * Initial viewport content stays static unless the project explicitly enables\n * above-the-fold reveals. Deep links and protected content remain visible.\n */\nexport function initialRevealState({\n bottom,\n containsHashTarget,\n protectedContent,\n reducedMotion,\n revealAboveFold,\n top,\n viewportHeight,\n}: InitialRevealStateInput): SfRevealState {\n if (\n reducedMotion ||\n containsHashTarget ||\n protectedContent\n ) {\n return \"visible\";\n }\n\n // reveal share of its height) waits for the scroll instead of appearing\n // statically; content already scrolled past the top stays visible.\n if (\n !revealAboveFold &&\n bottom > 0 &&\n top < viewportHeight &&\n (top < 0 ||\n hasEnoughVisibleArea({\n bottom,\n height: Math.max(0, bottom - top),\n top,\n viewportHeight,\n }))\n ) {\n return \"visible\";\n }\n\n return \"pending\";\n}\n\n/**\n * Reveal ordinary content once 20% of its perceivable height is visible.\n * For elements taller than the viewport, the viewport height is the reference.\n */\nexport function hasEnoughVisibleArea({\n bottom,\n height,\n top,\n viewportHeight,\n}: RevealVisibilityInput): boolean {\n if (height <= 0 || viewportHeight <= 0) return true;\n\n const visibleHeight = Math.max(\n 0,\n Math.min(bottom, viewportHeight) - Math.max(top, 0),\n );\n // The 1px tolerance below must not let thin elements such as a 1px <hr>\n // pass while they are still entirely outside the viewport.\n if (visibleHeight <= 0) return false;\n\n const requiredHeight =\n Math.min(height, viewportHeight) * SF_REVEAL_VISIBLE_RATIO;\n\n return visibleHeight + 1 >= requiredHeight;\n}\n\n/**\n * Reveal is deliberately one-way: focus and viewport entry can complete it,\n * while leaving the viewport never conceals content again.\n */\nexport function nextRevealState(\n current: SfRevealState,\n event: \"focus\" | \"intersect\" | \"leave\",\n): SfRevealState {\n if (current === \"settled\") return \"settled\";\n\n if (current === \"visible\" || event === \"focus\" || event === \"intersect\") {\n return \"visible\";\n }\n\n return \"pending\";\n}\n\nexport function shouldInitializeMotion(\n initialized: string | undefined,\n): boolean {\n return initialized !== \"true\";\n}\n\n/** `<html data-sf-motion>` value from the head bootstrap until the controller arms. */\nexport const SF_MOTION_BOOT_STATE = \"boot\";\n\n/** Failsafe: boot-hidden content shows anyway if the controller never arms. */\nexport const SF_MOTION_BOOT_FAILSAFE_MS = 3000;\n\n/**\n * Modifiers whose pending state keeps the element visible and hides only a\n * drawn decoration, mapped to the pseudo-element carrying it.\n */\nexport const SF_REVEAL_DECORATION_PSEUDOS: Readonly<\n Record<SfRevealModifier, \"::before\" | \"::after\">\n> = {\n \"sf-reveal--accordion-line\": \"::after\",\n};\n\n// Everything the controller leaves visible: opt-outs, protected content and the hash target.\n// :has() makes :not() invalid where unsupported, which drops the rule: content stays visible.\nconst SF_MOTION_BOOT_EXCLUDED = [\n `.${SF_MOTION_STATIC_CLASS}`,\n `.${SF_MOTION_DISABLE_CLASS}`,\n `.${SF_MOTION_DISABLE_CLASS} *`,\n `.${SF_REVEAL_SKIP_CLASS}`,\n `.${SF_REVEAL_SKIP_CLASS} *`,\n SF_MOTION_PROTECTED_CONTENT_SELECTOR,\n `:has(${SF_MOTION_PROTECTED_CONTENT_SELECTOR})`,\n \":target\",\n \":has(:target)\",\n].join(\", \");\n\n/**\n * Inline `<head>` script, placed after the motion preference bootstrap: marks\n * the document as booting when the controller will arm reveals, so the CSS of\n * `motionBootCss` hides them before first paint.\n */\nexport function motionBootScript(preferenceAttribute: string): string {\n const attribute = JSON.stringify(preferenceAttribute);\n const state = JSON.stringify(SF_MOTION_BOOT_STATE);\n return `(()=>{const r=document.documentElement;if(r.getAttribute(${attribute})===\"full\"&&\"IntersectionObserver\"in window&&!r.dataset.sfMotion)r.dataset.sfMotion=${state}})()`;\n}\n\n/**\n * Pre-paint counterpart of the controller for `revealAboveFold`: hides what the\n * controller will arm (authored reveals, rule and automatic selectors) while\n * `<html data-sf-motion=\"boot\">`, so content is never painted, hidden, then\n * revealed. Each selector gets its own rule: an invalid one only drops itself.\n * Like the controller, the first matching rule decides the modifier.\n * Portabile in FlowPress: docs/pilots/primo-paint-stabile.md\n */\nexport function motionBootCss(options: SfMotionOptions = {}): string {\n const { autoRevealSelectors, defaultReveal, revealAboveFold, revealRules } =\n resolveSfMotionOptions(options);\n if (!revealAboveFold) return \"\";\n\n const root = `html[data-sf-motion=\"${SF_MOTION_BOOT_STATE}\"]`;\n const failsafe = `${SF_MOTION_BOOT_FAILSAFE_MS}ms`;\n const decorations = Object.entries(SF_REVEAL_DECORATION_PSEUDOS) as [\n SfRevealModifier,\n string,\n ][];\n const hide = (target: string, reveal: SfRevealModifier | null): string => {\n const pseudo = reveal ? (SF_REVEAL_DECORATION_PSEUDOS[reveal] ?? \"\") : \"\";\n return `${root} ${target}${pseudo}{opacity:0;animation:sf-motion-boot-failsafe 0s linear ${failsafe} forwards}`;\n };\n const rules: string[] = [];\n\n // Authored reveals keep their own modifier; decorations hide their pseudo.\n const decorationClasses = decorations.map(([modifier]) => `.${modifier}`);\n rules.push(hide(\n `.${SF_REVEAL_CLASS}:not(${[SF_MOTION_BOOT_EXCLUDED, ...decorationClasses].join(\", \")})`,\n null,\n ));\n decorations.forEach(([modifier]) => {\n rules.push(hide(`.${SF_REVEAL_CLASS}.${modifier}:not(${SF_MOTION_BOOT_EXCLUDED})`, modifier));\n });\n\n const earlier: string[] = [];\n revealRules.forEach(({ selector, reveal }) => {\n const shadowed = earlier.length ? `, :is(${earlier.join(\", \")})` : \"\";\n rules.push(hide(`:is(${selector}):not(${SF_MOTION_BOOT_EXCLUDED}${shadowed})`, reveal));\n earlier.push(selector);\n });\n\n if (defaultReveal !== false) {\n const shadowed = earlier.length ? `, :is(${earlier.join(\", \")})` : \"\";\n autoRevealSelectors.forEach((selector) => {\n rules.push(hide(`:is(${selector}):not(${SF_MOTION_BOOT_EXCLUDED}${shadowed})`, defaultReveal));\n });\n }\n\n rules.push(\"@keyframes sf-motion-boot-failsafe{to{opacity:1}}\");\n return rules.join(\"\\n\");\n}\n"]}
@@ -6,6 +6,12 @@ export const SF_MOTION_STATIC_CLASS = "sf-motion-static";
6
6
 
7
7
  export const SF_MOTION_DISABLE_CLASS = "sf-motion-disable";
8
8
 
9
+ /**
10
+ * Opts a subtree out of reveals only. Unlike `sf-motion-disable`, transitions
11
+ * and animations inside it keep running (a carousel track moves its slides).
12
+ */
13
+ export const SF_REVEAL_SKIP_CLASS = "sf-reveal-skip";
14
+
9
15
  export const SF_MOTION_DRAWER_EXIT_MS = 820;
10
16
 
11
17
  export const SF_REVEAL_VISIBLE_RATIO = 0.2;
@@ -163,7 +169,8 @@ export function ruleRevealClassChanges(
163
169
  const classes = Array.from(existingClasses);
164
170
  if (
165
171
  classes.includes(SF_MOTION_STATIC_CLASS) ||
166
- classes.includes(SF_MOTION_DISABLE_CLASS)
172
+ classes.includes(SF_MOTION_DISABLE_CLASS) ||
173
+ classes.includes(SF_REVEAL_SKIP_CLASS)
167
174
  ) {
168
175
  return { add: [], remove: [] };
169
176
  }
@@ -202,7 +209,8 @@ export function automaticRevealClasses(
202
209
  const classes = Array.from(existingClasses);
203
210
  if (
204
211
  classes.includes(SF_MOTION_STATIC_CLASS) ||
205
- classes.includes(SF_MOTION_DISABLE_CLASS)
212
+ classes.includes(SF_MOTION_DISABLE_CLASS) ||
213
+ classes.includes(SF_REVEAL_SKIP_CLASS)
206
214
  ) {
207
215
  return [];
208
216
  }
@@ -349,6 +357,8 @@ const SF_MOTION_BOOT_EXCLUDED = [
349
357
  `.${SF_MOTION_STATIC_CLASS}`,
350
358
  `.${SF_MOTION_DISABLE_CLASS}`,
351
359
  `.${SF_MOTION_DISABLE_CLASS} *`,
360
+ `.${SF_REVEAL_SKIP_CLASS}`,
361
+ `.${SF_REVEAL_SKIP_CLASS} *`,
352
362
  SF_MOTION_PROTECTED_CONTENT_SELECTOR,
353
363
  `:has(${SF_MOTION_PROTECTED_CONTENT_SELECTOR})`,
354
364
  ":target",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@styleflow.app/flowpress-astro-core",
3
- "version": "1.0.0-beta.44",
3
+ "version": "1.0.0-beta.45",
4
4
  "description": "Project-agnostic WordPress routing, templates, SEO and GraphQL runtime for FlowPress Astro apps.",
5
5
  "type": "module",
6
6
  "private": false,