@gridui/motion 1.0.3 → 1.0.4
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/{chunk-JV6HKGMG.js → chunk-QJGYDRDO.js} +11 -2
- package/dist/chunk-QJGYDRDO.js.map +7 -0
- package/dist/index.js +24 -11
- package/dist/index.js.map +2 -2
- package/dist/policy.js +1 -1
- package/dist/shared/use-motion-policy.d.ts +1 -1
- package/docs/catalog.json +2 -8
- package/docs/reference/layout-motion.md +1 -1
- package/docs/reference/motion-config.md +1 -1
- package/docs/reference/motion-layout-group.md +1 -1
- package/docs/reference/motion-reveal.md +1 -1
- package/docs/reference/motion-scope.md +1 -1
- package/docs/reference/motion-size.md +2 -2
- package/docs/reference/presence.md +1 -1
- package/package.json +2 -2
- package/dist/chunk-JV6HKGMG.js.map +0 -7
|
@@ -73,11 +73,20 @@ var subscribe = (notify) => {
|
|
|
73
73
|
};
|
|
74
74
|
var snapshot = () => window.matchMedia(query2).matches;
|
|
75
75
|
var serverSnapshot = () => void 0;
|
|
76
|
+
function getImmediateReason(settings, systemReduced) {
|
|
77
|
+
if (settings.disabled) {
|
|
78
|
+
return "disabled";
|
|
79
|
+
}
|
|
80
|
+
if (settings.reducedMotion === "always" || systemReduced) {
|
|
81
|
+
return "reduced-motion";
|
|
82
|
+
}
|
|
83
|
+
return systemReduced === void 0 ? "pending" : void 0;
|
|
84
|
+
}
|
|
76
85
|
var useMotionPolicy = () => {
|
|
77
86
|
const settings = useContext(MotionContext);
|
|
78
87
|
const systemReduced = useSyncExternalStore(subscribe, snapshot, serverSnapshot);
|
|
79
88
|
const ready = systemReduced !== void 0;
|
|
80
|
-
const reason = settings
|
|
89
|
+
const reason = getImmediateReason(settings, systemReduced);
|
|
81
90
|
return { ...settings, ready, reason, immediate: reason !== void 0 };
|
|
82
91
|
};
|
|
83
92
|
|
|
@@ -103,4 +112,4 @@ export {
|
|
|
103
112
|
useMotionPolicy,
|
|
104
113
|
useMotionStyle
|
|
105
114
|
};
|
|
106
|
-
//# sourceMappingURL=chunk-
|
|
115
|
+
//# sourceMappingURL=chunk-QJGYDRDO.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/shared/dom-policy.ts", "../src/shared/use-motion-policy.ts", "../src/motion-config/context.ts", "../src/shared/use-motion-style.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @author WMXPY\n * @package GridUI\n * @namespace Shared\n * @description Dom Policy\n */\n\nexport type DOMMotionPolicy = { readonly immediate: boolean; readonly tempo: number };\nconst query = \"(prefers-reduced-motion: reduce)\";\n\n/** Read base time tokens without applying tempo. CSS calc()/var() resolve in the browser. */\nexport const readMotionDuration = (element: Element, token = \"--gridui-motion-duration-normal\", fallback = 180): number => {\n const value = element.ownerDocument.defaultView!.getComputedStyle(element).getPropertyValue(token).trim();\n const parse = (time: string): number | undefined => {\n if (!/^(?:\\d*\\.)?\\d+(?:ms|s)$/.test(time)) {\n return undefined;\n }\n return Number.parseFloat(time) * (time.endsWith(\"ms\") ? 1 : 1000);\n };\n const direct = parse(value);\n if (direct !== undefined) {\n return direct;\n }\n if (!value || !element.ownerDocument.defaultView!.CSS.supports(\"transition-duration\", value)) {\n return fallback;\n }\n const probe = element.ownerDocument.createElement(\"span\");\n probe.style.cssText = \"position:absolute;visibility:hidden;pointer-events:none\";\n probe.style.transitionDuration = value;\n element.ownerDocument.body.append(probe);\n const result = parse(element.ownerDocument.defaultView!.getComputedStyle(probe).transitionDuration);\n probe.remove();\n return result ?? fallback;\n};\n\nexport const readMotionPolicy = (element: Element): DOMMotionPolicy => {\n const style = element.ownerDocument.defaultView!.getComputedStyle(element);\n const factor = Number.parseFloat(style.getPropertyValue(\"--gridui-motion-tempo\"));\n return {\n immediate: element.ownerDocument.defaultView!.matchMedia(query).matches\n || style.getPropertyValue(\"--gridui-motion-disabled\").trim() === \"1\",\n tempo: Number.isFinite(factor) && factor > 0 ? factor : 1,\n };\n};\n\n/**\n * Observe the current ancestor chain and document preference. Re-subscribe after\n * reparenting; stylesheet-only changes are read on the next explicit read/update.\n * Resource lifecycle stays independent. This observer never scans descendants.\n */\nexport const observeMotionPolicy = (element: Element, changed: (policy: DOMMotionPolicy) => void): (() => void) => {\n let previous = readMotionPolicy(element);\n const update = () => {\n const next = readMotionPolicy(element);\n if (next.immediate !== previous.immediate || next.tempo !== previous.tempo) {\n previous = next;\n changed(next);\n }\n };\n const observer = new element.ownerDocument.defaultView!.MutationObserver(update);\n for (let node: Element | null = element; node; node = node.parentElement) {\n observer.observe(node, { attributes: true, attributeFilter: [\"style\", \"class\"] });\n }\n const media = element.ownerDocument.defaultView!.matchMedia(query);\n media.addEventListener(\"change\", update);\n return () => {\n observer.disconnect();\n media.removeEventListener(\"change\", update);\n };\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace Shared\n * @description Use Motion Policy\n */\n\nimport { useContext, useSyncExternalStore } from \"react\";\nimport { MotionContext } from \"../motion-config/context\";\nimport type { MotionSettings } from \"../motion-config/types\";\n\nconst query = \"(prefers-reduced-motion: reduce)\";\nconst subscribe = (notify: () => void): (() => void) => {\n const preference = window.matchMedia(query);\n preference.addEventListener(\"change\", notify);\n return () => void preference.removeEventListener(\"change\", notify);\n};\nconst snapshot = (): boolean => window.matchMedia(query).matches;\nconst serverSnapshot = (): undefined => undefined;\n\nfunction getImmediateReason(\n settings: MotionSettings,\n systemReduced: boolean | undefined,\n): \"disabled\" | \"reduced-motion\" | \"pending\" | undefined {\n if (settings.disabled) {\n return \"disabled\";\n }\n if (settings.reducedMotion === \"always\" || systemReduced) {\n return \"reduced-motion\";\n }\n return systemReduced === undefined ? \"pending\" : undefined;\n}\n\n/** Unknown server preference is visually immediate but must not advance domain state. */\nexport const useMotionPolicy = () => {\n const settings = useContext(MotionContext);\n const systemReduced = useSyncExternalStore<boolean | undefined>(subscribe, snapshot, serverSnapshot);\n const ready = systemReduced !== undefined;\n const reason = getImmediateReason(settings, systemReduced);\n return { ...settings, ready, reason, immediate: reason !== undefined };\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace MotionConfig\n * @description Context\n */\n\nimport { createContext } from \"react\";\nimport type { MotionSettings } from \"./types\";\n\nexport const MotionContext = createContext<MotionSettings>({\n tempo: 1,\n reducedMotion: \"user\",\n disabled: false,\n transition: undefined,\n});\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace Shared\n * @description Use Motion Style\n */\n\nimport type { CSSProperties } from \"react\";\nimport { useMotionPolicy } from \"./use-motion-policy\";\n\n/** Bridge React policy to owned CSS, including nodes rendered through a portal. */\nexport const useMotionStyle = (style?: CSSProperties): CSSProperties => {\n const policy = useMotionPolicy();\n return {\n ...style,\n \"--gridui-motion-tempo\": policy.tempo,\n \"--gridui-motion-factor\": policy.immediate ? 0 : policy.tempo,\n \"--gridui-motion-disabled\": policy.immediate ? 1 : 0,\n \"--gridui-motion-animation\": policy.immediate ? \"none\" : \"initial\",\n \"--gridui-motion-transition\": policy.immediate ? \"none\" : \"initial\",\n \"--gridui-motion-transform\": policy.immediate ? \"none\" : \"initial\",\n } as CSSProperties;\n};\n"],
|
|
5
|
+
"mappings": ";AAQA,IAAM,QAAQ;AAGP,IAAM,qBAAqB,CAAC,SAAkB,QAAQ,mCAAmC,WAAW,QAAgB;AACvH,QAAM,QAAQ,QAAQ,cAAc,YAAa,iBAAiB,OAAO,EAAE,iBAAiB,KAAK,EAAE,KAAK;AACxG,QAAM,QAAQ,CAAC,SAAqC;AAChD,QAAI,CAAC,0BAA0B,KAAK,IAAI,GAAG;AACvC,aAAO;AAAA,IACX;AACA,WAAO,OAAO,WAAW,IAAI,KAAK,KAAK,SAAS,IAAI,IAAI,IAAI;AAAA,EAChE;AACA,QAAM,SAAS,MAAM,KAAK;AAC1B,MAAI,WAAW,QAAW;AACtB,WAAO;AAAA,EACX;AACA,MAAI,CAAC,SAAS,CAAC,QAAQ,cAAc,YAAa,IAAI,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ist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
readMotionPolicy,
|
|
6
6
|
useMotionPolicy,
|
|
7
7
|
useMotionStyle
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-QJGYDRDO.js";
|
|
9
9
|
|
|
10
10
|
// src/motion-config/motion-config.tsx
|
|
11
11
|
import { useContext, useMemo } from "react";
|
|
@@ -281,7 +281,15 @@ var createSpringValue = (initial, initialOptions = {}, initialPolicy = { tempo:
|
|
|
281
281
|
let target = initial;
|
|
282
282
|
let pending;
|
|
283
283
|
let run;
|
|
284
|
-
const getVelocity = () =>
|
|
284
|
+
const getVelocity = () => {
|
|
285
|
+
if (!run) {
|
|
286
|
+
return 0;
|
|
287
|
+
}
|
|
288
|
+
if (run.animation.time === 0) {
|
|
289
|
+
return run.initialVelocity * run.startTempo / tempo;
|
|
290
|
+
}
|
|
291
|
+
return value.getVelocity();
|
|
292
|
+
};
|
|
285
293
|
const stop = () => {
|
|
286
294
|
const previous = run;
|
|
287
295
|
run = void 0;
|
|
@@ -365,14 +373,18 @@ var createSpringValue = (initial, initialOptions = {}, initialPolicy = { tempo:
|
|
|
365
373
|
}
|
|
366
374
|
};
|
|
367
375
|
configure(initialOptions, initialPolicy);
|
|
368
|
-
return {
|
|
369
|
-
|
|
370
|
-
|
|
376
|
+
return {
|
|
377
|
+
...api,
|
|
378
|
+
configure,
|
|
379
|
+
dispose: () => {
|
|
380
|
+
if (disposed) {
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
disposed = true;
|
|
384
|
+
stop();
|
|
385
|
+
value.destroy();
|
|
371
386
|
}
|
|
372
|
-
|
|
373
|
-
stop();
|
|
374
|
-
value.destroy();
|
|
375
|
-
} };
|
|
387
|
+
};
|
|
376
388
|
};
|
|
377
389
|
|
|
378
390
|
// src/spring-value/use-spring-value.ts
|
|
@@ -646,7 +658,8 @@ var MotionReveal = ({
|
|
|
646
658
|
observer.observe(element);
|
|
647
659
|
return () => void observer.disconnect();
|
|
648
660
|
}, [immediate, focused, once, amount, root, rootMargin]);
|
|
649
|
-
const show = immediate || focused || visible !== false;
|
|
661
|
+
const show = immediate || focused || once && seen.current || visible !== false;
|
|
662
|
+
const revealTransition = !show || focused ? { duration: 0 } : transition;
|
|
650
663
|
return /* @__PURE__ */ jsx7(
|
|
651
664
|
LayoutMotion,
|
|
652
665
|
{
|
|
@@ -654,7 +667,7 @@ var MotionReveal = ({
|
|
|
654
667
|
ref: node,
|
|
655
668
|
layout: false,
|
|
656
669
|
animate: show ? { opacity: 1, x: 0, y: 0, scale: 1 } : enter,
|
|
657
|
-
|
|
670
|
+
...revealTransition ? { transition: revealTransition } : {},
|
|
658
671
|
onFocusCapture: (event) => {
|
|
659
672
|
setFocused(true);
|
|
660
673
|
onFocusCapture?.(event);
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/motion-config/motion-config.tsx", "../src/motion-config/validate-transition.ts", "../src/motion-layout-group/context.ts", "../src/presence/presence.tsx", "../src/layout-motion/layout-motion.tsx", "../src/shared/resolve-transition.ts", "../src/motion-scope/motion-scope.tsx", "../src/motion-layout-group/motion-layout-group.tsx", "../src/spring-value/use-spring-value.ts", "../src/spring-value/controller.ts", "../src/motion-size/motion-size.tsx", "../src/motion-sequence/use-motion-sequence.ts", "../src/motion-sequence/controller.ts", "../src/motion-reveal/motion-reveal.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * @author WMXPY\n * @package GridUI\n * @namespace MotionConfig\n * @description Motion Config\n */\n\nimport { useContext, useMemo } from \"react\";\nimport { MotionContext } from \"./context\";\nimport type { MotionConfigProps } from \"./types\";\nimport { validateTransition } from \"./validate-transition\";\n\nexport const MotionConfig = ({ children, tempo, reducedMotion, disabled, transition }: MotionConfigProps) => {\n const parent = useContext(MotionContext);\n if (tempo !== undefined && (!Number.isFinite(tempo) || tempo <= 0)) {\n throw new RangeError(\"MotionConfig tempo must be finite and positive.\");\n }\n if (transition) {validateTransition(transition);}\n const value = useMemo(() => ({\n tempo: tempo ?? parent.tempo,\n reducedMotion: parent.reducedMotion === \"always\" ? \"always\" : reducedMotion ?? parent.reducedMotion,\n disabled: parent.disabled || disabled === true,\n transition: transition ?? parent.transition,\n }), [parent, tempo, reducedMotion, disabled, transition]);\n return <MotionContext.Provider value={value}>{children}</MotionContext.Provider>;\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace MotionConfig\n * @description Validate Transition\n */\n\nimport type { MotionTransition } from \"./types\";\n\nexport const validateTransition = (transition: MotionTransition): void => {\n if (transition.type === \"spring\") {\n for (const value of [transition.stiffness, transition.damping, transition.mass]) {\n if (value !== undefined && (!Number.isFinite(value) || value <= 0)) {\n throw new RangeError(\"Motion spring parameters must be finite and positive.\");\n }\n }\n } else if (transition.duration !== undefined && (!Number.isFinite(transition.duration) || transition.duration < 0)) {\n throw new RangeError(\"Motion duration must be finite and nonnegative.\");\n }\n};\n\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace MotionLayoutGroup\n * @description Context\n */\n\nimport { createContext } from \"react\";\n\nexport const LayoutGroupContext = createContext(false);\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace Presence\n * @description Presence\n */\n\nimport { LayoutGroupContext } from \"../motion-layout-group/context\";\nimport { AnimatePresence, LayoutGroup } from \"motion/react\";\nimport { type ReactNode, useContext, useId } from \"react\";\n\nexport type PresenceProps = {\n readonly children: ReactNode;\n readonly mode?: \"sync\" | \"wait\" | \"popLayout\";\n readonly initial?: boolean;\n readonly onExitComplete?: () => void;\n};\n\n/** Keep this boundary mounted. Direct children need stable keys and forwarded refs for popLayout. */\nexport const Presence = ({ children, mode = \"sync\", initial = false, onExitComplete }: PresenceProps) => {\n const id = useId();\n const grouped = useContext(LayoutGroupContext);\n const presence = <AnimatePresence mode={mode} initial={initial} {...(onExitComplete ? { onExitComplete } : {})}>\n {children}\n </AnimatePresence>;\n return grouped ? presence : <LayoutGroup id={id}>{presence}</LayoutGroup>;\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace LayoutMotion\n * @description Layout Motion\n */\n\nimport type { MotionState } from \"../shared/state\";\nimport { animate as animateValue, motion, useMotionValue, usePresence, type MotionStyle, type AnimationPlaybackControlsWithThen } from \"motion/react\";\nimport { type ComponentPropsWithRef, type CSSProperties, useImperativeHandle, useEffect, useEffectEvent, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport type { MotionTransition } from \"../motion-config/types\";\nimport { fallbackTransition, readThemeTransition, resolveTransition } from \"../shared/resolve-transition\";\nimport { useMotionPolicy } from \"../shared/use-motion-policy\";\n\nexport type LayoutMotionProps = Omit<ComponentPropsWithRef<\"div\">,\n \"onAnimationStart\" | \"onDrag\" | \"onDragStart\" | \"onDragEnd\" | \"style\"> & {\n readonly style?: Omit<CSSProperties, \"transform\" | \"opacity\" | \"scale\" | \"translate\" | \"rotate\">;\n readonly layout?: boolean | \"position\" | \"size\";\n readonly layoutId?: string;\n /** Mark the scrolling element used by descendant layout measurements. */\n readonly layoutScroll?: boolean;\n /** Mark a fixed-position root used by descendant layout measurements. */\n readonly layoutRoot?: boolean;\n readonly enter?: MotionState;\n readonly animate?: MotionState;\n readonly exit?: MotionState;\n readonly transition?: MotionTransition;\n readonly exitTransition?: MotionTransition;\n readonly onAnimationComplete?: () => void;\n readonly onLayoutAnimationComplete?: () => void;\n};\n\nexport const LayoutMotion = ({\n layout = true, layoutId, layoutScroll, layoutRoot, enter, animate, exit,\n transition, exitTransition, ref, inert, style, onAnimationComplete,\n \"aria-hidden\": ariaHidden, ...props\n}: LayoutMotionProps) => {\n const policy = useMotionPolicy();\n const [present, safeToRemove] = usePresence();\n const node = useRef<HTMLDivElement>(null);\n const running = useRef<AnimationPlaybackControlsWithThen[]>([]);\n const [theme, setTheme] = useState(fallbackTransition);\n useImperativeHandle(ref, () => node.current!, []);\n useLayoutEffect(() => {\n const next = readThemeTransition(node.current!);\n setTheme(previous => next.duration === previous.duration && String(next.ease) === String(previous.ease)\n ? previous : next);\n }, [style, props.className, policy.transition, transition]);\n const opacity = animate?.opacity ?? 1;\n const x = animate?.x ?? 0;\n const y = animate?.y ?? 0;\n const scale = animate?.scale ?? 1;\n const opacityValue = useMotionValue(opacity);\n const xValue = useMotionValue(x);\n const yValue = useMotionValue(y);\n const scaleValue = useMotionValue(scale);\n const values = useMemo(() => ({ opacity: opacityValue, x: xValue, y: yValue, scale: scaleValue }),\n [opacityValue, xValue, yValue, scaleValue]);\n const exitOpacity = exit?.opacity;\n const exitX = exit?.x;\n const exitY = exit?.y;\n const exitScale = exit?.scale;\n const hasExit = exit !== undefined;\n // Timing is captured at each target change. Tempo changes update playback speed\n // independently, so a live configuration update never replays an entrance.\n const settings = useEffectEvent(() => ({\n timing: resolveTransition((!present ? exitTransition : undefined) ?? transition ?? policy.transition,\n readThemeTransition(node.current!), 1, policy.immediate),\n immediate: policy.immediate,\n tempo: policy.tempo,\n }));\n const complete = useEffectEvent(() => onAnimationComplete?.());\n useEffect(() => {\n const { timing, immediate, tempo } = settings();\n const target = present ? { opacity, x, y, scale } : {\n opacity: exitOpacity, x: exitX, y: exitY, scale: exitScale,\n };\n let active = true;\n const playback: AnimationPlaybackControlsWithThen[] = [];\n for (const key of [\"opacity\", \"x\", \"y\", \"scale\"] as const) {\n const next = target[key];\n if (next === undefined || next === values[key].get()) { continue; }\n if (immediate) { values[key].jump(next); continue; }\n const animation = animateValue(values[key], next, timing);\n animation.speed = 1 / tempo;\n playback.push(animation);\n }\n running.current = playback;\n if (playback.length) {\n void Promise.all(playback).then(() => {\n if (!active) { return; }\n running.current = [];\n complete();\n if (!present) { safeToRemove(); }\n });\n } else if (!present) {\n safeToRemove();\n }\n return () => {\n active = false;\n for (const animation of playback) { animation.stop(); }\n running.current = [];\n };\n }, [present, hasExit, safeToRemove, values, opacity, x, y, scale, exitOpacity, exitX, exitY, exitScale]);\n useLayoutEffect(() => {\n for (const animation of running.current) {\n if (policy.immediate) { animation.complete(); }\n else { animation.speed = 1 / policy.tempo; }\n }\n }, [policy.immediate, policy.tempo]);\n return <motion.div\n {...props}\n ref={node}\n style={{ ...style, ...values } as MotionStyle}\n inert={!present || inert || undefined}\n aria-hidden={!present ? true : ariaHidden}\n data-motion-present={present ? \"true\" : \"false\"}\n layout={policy.immediate ? false : layout}\n {...(layoutScroll === undefined ? {} : { layoutScroll })}\n {...(layoutRoot === undefined ? {} : { layoutRoot })}\n // Motion 14 can retain an in-flight projection after layout is disabled.\n // Suppress only that projection; MotionValues still own the base transform.\n {...(policy.immediate ? { transformTemplate: () => {\n return x === 0 && y === 0 && scale === 1 ? \"none\" : `translate(${x}px, ${y}px) scale(${scale})`;\n } } : {})}\n {...(layoutId === undefined ? {} : { layoutId })}\n initial={policy.immediate ? false : (enter ?? false)}\n transition={resolveTransition(transition ?? policy.transition, theme, policy.tempo, policy.immediate)}\n />;\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace Shared\n * @description Resolve Transition\n */\n\nimport { validateTransition } from \"../motion-config/validate-transition\";\nimport { readMotionDuration } from \"./dom-policy\";\nimport type { Transition } from \"motion/react\";\nimport type { MotionEase, MotionTransition } from \"../motion-config/types\";\n\nexport type ThemeTransition = { duration: number; ease: MotionEase };\nexport const fallbackTransition: ThemeTransition = { duration: 180, ease: [0.2, 0.8, 0.2, 1] };\n\nexport const readThemeTransition = (element: HTMLElement): ThemeTransition => {\n const style = getComputedStyle(element);\n const duration = readMotionDuration(element);\n const rawEase = style.getPropertyValue(\"--gridui-motion-ease-out\").trim();\n const values = /^cubic-bezier\\(([^)]+)\\)$/.exec(rawEase)?.[1]?.split(\",\").map(Number);\n let ease = fallbackTransition.ease;\n if (values?.length === 4 && values.every(Number.isFinite)\n && values[0]! >= 0 && values[0]! <= 1 && values[2]! >= 0 && values[2]! <= 1) {\n ease = [values[0]!, values[1]!, values[2]!, values[3]!];\n } else if (rawEase === \"linear\") {\n ease = \"linear\";\n } else if (rawEase === \"ease-in\") {\n ease = \"easeIn\";\n } else if (rawEase === \"ease-out\") {\n ease = \"easeOut\";\n } else if (rawEase === \"ease-in-out\") {\n ease = \"easeInOut\";\n }\n return { duration, ease };\n};\n\nexport const resolveTransition = (\n transition: MotionTransition | undefined, theme: ThemeTransition, tempo: number, immediate: boolean,\n): Transition => {\n if (transition) {validateTransition(transition);}\n if (immediate) {return { type: \"tween\", duration: 0 };}\n if (transition?.type === \"spring\") {\n return {\n type: \"spring\",\n stiffness: (transition.stiffness ?? 170) / (tempo * tempo),\n damping: (transition.damping ?? 26) / tempo,\n mass: transition.mass ?? 1,\n };\n }\n return {\n type: \"tween\",\n duration: (transition?.duration ?? theme.duration) * tempo / 1000,\n ease: transition?.ease ?? theme.ease,\n };\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace MotionScope\n * @description Motion Scope\n */\n\nimport { Slot } from \"@radix-ui/react-slot\";\nimport type { ComponentPropsWithRef } from \"react\";\nimport { useMotionStyle } from \"../shared/use-motion-style\";\n\nexport type MotionScopeProps = ComponentPropsWithRef<\"div\"> & { readonly asChild?: boolean };\n\n/** CSS policy boundary. asChild preserves the child's DOM, ref, and semantics. */\nexport const MotionScope = ({ asChild = false, style, ...props }: MotionScopeProps) => {\n const motionStyle = useMotionStyle(style);\n const Component = asChild ? Slot : \"div\";\n return <Component {...props} style={motionStyle} />;\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace MotionLayoutGroup\n * @description Motion Layout Group\n */\n\nimport { LayoutGroup } from \"motion/react\";\nimport { type ReactNode, useId } from \"react\";\nimport { LayoutGroupContext } from \"./context\";\n\nexport type MotionLayoutGroupProps = { readonly children: ReactNode };\n\n/** Deliberately share layout identities across nested Presence boundaries. No DOM. */\nexport const MotionLayoutGroup = ({ children }: MotionLayoutGroupProps) => {\n const id = useId();\n return <LayoutGroupContext.Provider value={true}>\n <LayoutGroup id={id}>{children}</LayoutGroup>\n </LayoutGroupContext.Provider>;\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace SpringValue\n * @description Use Spring Value\n */\n\nimport { useLayoutEffect, useState } from \"react\";\nimport { useMotionPolicy } from \"../shared/use-motion-policy\";\nimport { createSpringValue, type SpringValue, type SpringValueOptions } from \"./controller\";\n\n/** Initial value is captured once. Subscriptions update DOM without React frame renders. */\nexport const useSpringValue = (initial: number, options?: SpringValueOptions): SpringValue => {\n const policy = useMotionPolicy();\n const { tempo, immediate } = policy;\n const [controller] = useState(() => createSpringValue(initial));\n const spring: SpringValueOptions | undefined = options ?? (policy.transition?.type === \"spring\" ? policy.transition : undefined);\n const { stiffness, damping, mass, precision } = spring ?? {};\n useLayoutEffect(() => {\n controller.configure({ ...(stiffness === undefined ? {} : { stiffness }),\n ...(damping === undefined ? {} : { damping }), ...(mass === undefined ? {} : { mass }), ...(precision === undefined ? {} : { precision }) }, { tempo, immediate });\n }, [controller, stiffness, damping, mass, precision, tempo, immediate]);\n useLayoutEffect(() => () => void controller.stop(), [controller]);\n return controller;\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace SpringValue\n * @description Controller\n */\n\nimport { animate, motionValue, type AnimationPlaybackControlsWithThen } from \"motion/react\";\nimport type { MotionTransition } from \"../motion-config/types\";\nimport { validateTransition } from \"../motion-config/validate-transition\";\nimport type { MotionOutcome } from \"../shared/outcome\";\n\nexport type SpringValueOptions = Omit<Extract<MotionTransition, { type: \"spring\" }>, \"type\"> & {\n /** Rest distance and speed tolerance in value units and units per second. */\n readonly precision?: number;\n};\nexport type SpringValuePolicy = { readonly tempo: number; readonly immediate: boolean };\nexport type SpringValue = {\n readonly get: () => number;\n /** Units per real second, independent of tempo. */\n readonly getVelocity: () => number;\n readonly set: (target: number, velocity?: number) => Promise<MotionOutcome>;\n readonly jump: (target: number) => void;\n readonly stop: () => void;\n readonly subscribe: (changed: (value: number) => void) => () => void;\n};\nexport type SpringValueController = SpringValue & {\n readonly configure: (options: SpringValueOptions, policy: SpringValuePolicy) => void;\n readonly dispose: () => void;\n};\nconst finite = (value: number): void => {\n if (!Number.isFinite(value)) { throw new RangeError(\"Spring values and velocities must be finite.\"); }\n};\n\nexport const createSpringValue = (initial: number, initialOptions: SpringValueOptions = {},\n initialPolicy: SpringValuePolicy = { tempo: 1, immediate: false }): SpringValueController => {\n finite(initial);\n const value = motionValue(initial);\n let disposed = false;\n const assertActive = () => {\n if (disposed) { throw new Error(\"Cannot use a disposed spring value.\"); }\n };\n let options: SpringValueOptions = {};\n let tempo = 1;\n let immediate = true;\n let target = initial;\n let pending: Promise<MotionOutcome> | undefined;\n let run: { animation: AnimationPlaybackControlsWithThen; initialVelocity: number; startTempo: number; resolve: (result: MotionOutcome) => void } | undefined;\n // Before the first engine sample, MotionValue has no velocity history.\n const getVelocity = () => !run ? 0 : run.animation.time === 0\n ? run.initialVelocity * run.startTempo / tempo : value.getVelocity();\n const stop = () => {\n const previous = run;\n run = undefined;\n previous?.animation.stop();\n previous?.resolve(\"cancelled\");\n };\n const jump = (next: number) => {\n assertActive();\n finite(next);\n stop();\n target = next;\n value.jump(next);\n };\n const api: SpringValue = {\n get: () => value.get(),\n getVelocity,\n subscribe: changed => { assertActive(); return value.on(\"change\", changed); },\n stop, jump,\n set: (next, velocity) => {\n assertActive();\n finite(next);\n if (run && next === target && velocity === undefined) { return pending!; }\n const releaseVelocity = velocity ?? getVelocity();\n finite(releaseVelocity);\n stop();\n target = next;\n if (immediate || (value.get() === next && releaseVelocity === 0)) {\n value.jump(next);\n return Promise.resolve(\"finished\");\n }\n const { precision, ...spring } = options;\n const animation = animate(value, next, { type: \"spring\", stiffness: 170, damping: 26, mass: 1,\n ...spring, velocity: releaseVelocity * tempo,\n ...(precision === undefined ? {} : { restDelta: precision, restSpeed: precision * tempo }) });\n animation.speed = 1 / tempo;\n pending = new Promise<MotionOutcome>(resolve => {\n const current = { animation, initialVelocity: releaseVelocity, startTempo: tempo, resolve };\n run = current;\n void animation.then(() => {\n if (run !== current) { return; }\n run = undefined;\n resolve(\"finished\");\n });\n });\n return pending;\n },\n };\n const configure = (next: SpringValueOptions, policy: SpringValuePolicy) => {\n assertActive();\n validateTransition({ type: \"spring\", ...next });\n if (!Number.isFinite(policy.tempo) || policy.tempo <= 0\n || (next.precision !== undefined && (!Number.isFinite(next.precision) || next.precision <= 0))) {\n throw new RangeError(\"Spring tempo and precision must be finite and positive.\");\n }\n options = next;\n tempo = policy.tempo;\n immediate = policy.immediate;\n if (run) {\n if (immediate) {\n const previous = run;\n run = undefined;\n previous.animation.stop();\n value.jump(target);\n previous.resolve(\"finished\");\n } else { run.animation.speed = 1 / tempo; }\n }\n };\n configure(initialOptions, initialPolicy);\n return { ...api, configure, dispose: () => {\n if (disposed) { return; }\n disposed = true;\n stop();\n value.destroy();\n } };\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace MotionSize\n * @description Motion Size\n */\n\nimport { type ComponentPropsWithRef, type CSSProperties, useImperativeHandle, useLayoutEffect, useRef } from \"react\";\nimport { useSpringValue } from \"../spring-value/use-spring-value\";\nimport type { SpringValueOptions } from \"../spring-value/controller\";\n\nexport type MotionSizeProps = Omit<ComponentPropsWithRef<\"div\">, \"style\"> & {\n readonly style?: Omit<CSSProperties, \"height\" | \"overflow\" | \"overflowY\">;\n readonly spring?: SpringValueOptions;\n};\n\n/** Animate intrinsic content height. Width and content semantics stay with the caller. */\nexport const MotionSize = ({ children, spring, ref, style, ...props }: MotionSizeProps) => {\n const outer = useRef<HTMLDivElement>(null);\n const inner = useRef<HTMLDivElement>(null);\n const height = useSpringValue(0, spring);\n useImperativeHandle(ref, () => outer.current!, []);\n useLayoutEffect(() => {\n const node = outer.current!;\n const content = inner.current!;\n let revision = 0;\n height.jump(content.offsetHeight);\n let requested = height.get();\n const unsubscribe = height.subscribe(value => { node.style.height = `${Math.max(0, value)}px`; });\n const observer = new ResizeObserver(([entry]) => {\n const target = entry?.borderBoxSize[0]?.blockSize ?? content.offsetHeight;\n if (target === requested) { return; }\n requested = target;\n const run = ++revision;\n node.style.height = `${height.get()}px`;\n node.style.overflow = \"clip\";\n void height.set(target).then(result => {\n if (result === \"finished\" && run === revision) { node.style.height = \"auto\"; node.style.removeProperty(\"overflow\"); }\n });\n });\n observer.observe(content);\n return () => { revision++; observer.disconnect(); unsubscribe(); height.stop(); node.style.removeProperty(\"height\"); node.style.removeProperty(\"overflow\"); };\n }, [height]);\n return <div {...props} ref={outer} style={style}>\n <div ref={inner} style={{ display: \"flow-root\" }}>{children}</div>\n </div>;\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace MotionSequence\n * @description Use Motion Sequence\n */\n\nimport { type RefObject, useLayoutEffect, useState } from \"react\";\nimport { useMotionPolicy } from \"../shared/use-motion-policy\";\nimport { createSequenceController, type MotionSequence } from \"./controller\";\n\n/** Explicit element targets within one mounted scope. This hook owns their animated styles. */\nexport const useMotionSequence = (scope: RefObject<HTMLElement | null>): MotionSequence => {\n const { tempo, immediate, transition } = useMotionPolicy();\n const [controller] = useState(() => createSequenceController(scope));\n useLayoutEffect(() => void controller.configure({ tempo, immediate, transition }), [controller, tempo, immediate, transition]);\n useLayoutEffect(() => () => void controller.dispose(), [controller]);\n return controller.api;\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace MotionSequence\n * @description Controller\n */\n\nimport type { RefObject } from \"react\";\nimport type { MotionEase, MotionTransition } from \"../motion-config/types\";\nimport type { MotionOutcome } from \"../shared/outcome\";\nimport type { MotionState } from \"../shared/state\";\nimport { readThemeTransition } from \"../shared/resolve-transition\";\nimport { validateTransition } from \"../motion-config/validate-transition\";\n\nexport type MotionStep = {\n readonly element: HTMLElement;\n readonly from?: MotionState;\n readonly to: MotionState;\n readonly duration?: number;\n readonly ease?: MotionEase;\n};\nexport type MotionSequenceOptions = {\n readonly order?: \"sequence\" | \"parallel\";\n /** Milliseconds between starts in parallel, or between steps in sequence. */\n readonly stagger?: number;\n};\nexport type MotionRun = {\n readonly finished: Promise<MotionOutcome>;\n readonly cancel: () => void;\n readonly finish: () => void;\n};\nexport type MotionSequence = {\n readonly play: (steps: readonly MotionStep[], options?: MotionSequenceOptions) => MotionRun;\n};\ntype Policy = { tempo: number; immediate: boolean; transition: MotionTransition | undefined };\ntype Property = \"opacity\" | \"transform\";\nconst frames = (state: MotionState): Partial<Record<Property, string>> => ({\n ...(state.opacity === undefined ? {} : { opacity: String(state.opacity) }),\n ...(state.x === undefined && state.y === undefined && state.scale === undefined ? {} : {\n transform: `translate(${state.x ?? 0}px, ${state.y ?? 0}px) scale(${state.scale ?? 1})`,\n }),\n});\nconst easing = (ease: MotionEase): string => Array.isArray(ease) ? `cubic-bezier(${ease.join(\",\")})`\n : ({ linear: \"linear\", easeIn: \"ease-in\", easeOut: \"ease-out\", easeInOut: \"ease-in-out\" })[ease];\n\nexport const createSequenceController = (scope: RefObject<HTMLElement | null>) => {\n let policy: Policy = { tempo: 1, immediate: true, transition: undefined };\n let active: { run: MotionRun; animations: Animation[] } | undefined;\n const originals = new Map<HTMLElement, Map<Property, { value: string; priority: string }>>();\n const play: MotionSequence[\"play\"] = (steps, options = {}) => {\n const stagger = options.stagger ?? 0;\n if (!Number.isFinite(stagger) || stagger < 0) { throw new RangeError(\"Stagger must be finite and nonnegative.\"); }\n const root = scope.current;\n let offset = 0;\n const previous = new Map<HTMLElement, Map<Property, { end: number; value: string }>>();\n const plan = steps.map((step, index) => {\n if (!root?.contains(step.element)) { throw new RangeError(\"Sequence targets must belong to the mounted scope.\"); }\n const theme = readThemeTransition(step.element);\n const base = policy.transition?.type === \"spring\" ? undefined : policy.transition;\n const duration = step.duration ?? base?.duration ?? theme.duration;\n const ease = step.ease ?? base?.ease ?? theme.ease;\n validateTransition({ duration, ease });\n const to = frames(step.to);\n const requestedFrom = step.from ? frames(step.from) : {};\n const from: Partial<Record<Property, string>> = {};\n const delay = options.order === \"parallel\" ? index * stagger : offset;\n offset += duration + stagger;\n const properties = previous.get(step.element) ?? new Map();\n const backwards = (Object.keys(to) as Property[]).every(property => !properties.has(property));\n for (const property of Object.keys(to) as Property[]) {\n const last = properties.get(property);\n if (last && delay < last.end) { throw new RangeError(\"Parallel steps cannot own the same element property at the same time.\"); }\n const start = requestedFrom[property] ?? last?.value;\n if (start !== undefined) { from[property] = start; }\n properties.set(property, { end: delay + duration, value: to[property]! });\n }\n previous.set(step.element, properties);\n return { element: step.element, to, from, duration, ease: easing(ease), delay, backwards };\n });\n active?.run.cancel();\n let resolve!: (result: MotionOutcome) => void;\n const finished = new Promise<MotionOutcome>(done => { resolve = done; });\n const animations: Animation[] = [];\n let settled = false;\n const settle = (result: MotionOutcome) => {\n if (settled) { return; }\n settled = true;\n if (result === \"finished\") {\n for (const step of plan) {\n for (const property of Object.keys(step.to) as Property[]) {\n step.element.style.setProperty(property, step.to[property]!);\n }\n }\n } else {\n // Freeze only properties this scope owns before cancelling WAAPI fills.\n const current = new Map<HTMLElement, Partial<Record<Property, string>>>();\n for (const step of plan) {\n const style = step.element.ownerDocument.defaultView!.getComputedStyle(step.element);\n const values = current.get(step.element) ?? {};\n for (const property of Object.keys(step.to) as Property[]) { values[property] = style.getPropertyValue(property); }\n current.set(step.element, values);\n }\n for (const [element, values] of current) {\n for (const property of Object.keys(values) as Property[]) { element.style.setProperty(property, values[property]!); }\n }\n }\n for (const animation of animations) { animation.cancel(); }\n if (active?.run === run) { active = undefined; }\n resolve(result);\n };\n const run: MotionRun = { finished, cancel: () => void settle(\"cancelled\"), finish: () => void settle(\"finished\") };\n active = { run, animations };\n try {\n for (const step of plan) {\n const saved = originals.get(step.element) ?? new Map();\n for (const property of Object.keys(step.to) as Property[]) {\n if (!saved.has(property)) { saved.set(property, { value: step.element.style.getPropertyValue(property), priority: step.element.style.getPropertyPriority(property) }); }\n }\n originals.set(step.element, saved);\n if (policy.immediate) { continue; }\n // Later steps must not cover earlier steps during their delay.\n const animation = step.element.animate([step.from, step.to], {\n duration: step.duration, delay: step.delay, easing: step.ease, fill: step.backwards ? \"both\" : \"forwards\",\n });\n animation.playbackRate = 1 / policy.tempo;\n animations.push(animation);\n }\n void Promise.all(animations.map(animation => animation.finished)).then(() => void run.finish(), () => void run.cancel());\n if (policy.immediate || !plan.length) { run.finish(); }\n } catch (error) {\n run.cancel();\n throw error;\n }\n return run;\n };\n return {\n api: { play },\n configure: (next: Policy) => {\n policy = next;\n if (next.immediate) { active?.run.finish(); }\n else { for (const animation of active?.animations ?? []) { animation.updatePlaybackRate(1 / next.tempo); } }\n },\n dispose: () => {\n active?.run.cancel();\n for (const [element, properties] of originals) {\n for (const [property, original] of properties) { element.style.setProperty(property, original.value, original.priority); }\n }\n originals.clear();\n },\n };\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace MotionReveal\n * @description Motion Reveal\n */\n\nimport { type RefObject, useEffect, useImperativeHandle, useRef, useState } from \"react\";\nimport { LayoutMotion, type LayoutMotionProps } from \"../layout-motion/layout-motion\";\nimport { useMotionPolicy } from \"../shared/use-motion-policy\";\n\nexport type MotionRevealProps = Omit<LayoutMotionProps, \"animate\" | \"exit\" | \"layout\" | \"layoutId\" | \"layoutScroll\" | \"layoutRoot\"> & {\n readonly once?: boolean;\n readonly amount?: number;\n readonly root?: Element | null;\n readonly rootMargin?: string;\n};\n\n/** Offscreen decoration only. Initial visible content and keyboard access stay usable. */\nexport const MotionReveal = ({ once = true, amount = 0, root = null, rootMargin = \"0px\",\n enter = { opacity: 0, y: 12 }, transition, ref, onFocusCapture, ...props }: MotionRevealProps) => {\n if (!Number.isFinite(amount) || amount < 0 || amount > 1) { throw new RangeError(\"Reveal amount must be between zero and one.\"); }\n const node: RefObject<HTMLDivElement | null> = useRef(null);\n const seen = useRef(false);\n const [visible, setVisible] = useState<boolean | null>(null);\n const [focused, setFocused] = useState(false);\n const { immediate } = useMotionPolicy();\n useImperativeHandle(ref, () => node.current!, []);\n useEffect(() => {\n const element = node.current!;\n const Observer = element.ownerDocument.defaultView!.IntersectionObserver;\n if (immediate || focused || (once && seen.current)) { return; }\n const observer = new Observer(([entry]) => {\n if (!entry) { return; }\n const inside = entry.isIntersecting && entry.intersectionRatio >= amount;\n setVisible(inside);\n if (inside) {\n seen.current = true;\n if (once) { observer.disconnect(); }\n }\n }, { root, rootMargin, threshold: amount });\n observer.observe(element);\n return () => void observer.disconnect();\n }, [immediate, focused, once, amount, root, rootMargin]);\n const show = immediate || focused || visible !== false;\n return <LayoutMotion {...props} ref={node} layout={false}\n animate={show ? { opacity: 1, x: 0, y: 0, scale: 1 } : enter}\n {...((!show || focused) ? { transition: { duration: 0 } } : transition ? { transition } : {})}\n onFocusCapture={event => { setFocused(true); onFocusCapture?.(event); }} />;\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;AAOA,SAAS,YAAY,eAAe;;;ACE7B,IAAM,qBAAqB,CAAC,eAAuC;AACtE,MAAI,WAAW,SAAS,UAAU;AAC9B,eAAW,SAAS,CAAC,WAAW,WAAW,WAAW,SAAS,WAAW,IAAI,GAAG;AAC7E,UAAI,UAAU,WAAc,CAAC,OAAO,SAAS,KAAK,KAAK,SAAS,IAAI;AAChE,cAAM,IAAI,WAAW,uDAAuD;AAAA,MAChF;AAAA,IACJ;AAAA,EACJ,WAAW,WAAW,aAAa,WAAc,CAAC,OAAO,SAAS,WAAW,QAAQ,KAAK,WAAW,WAAW,IAAI;AAChH,UAAM,IAAI,WAAW,iDAAiD;AAAA,EAC1E;AACJ;;;ADKW;AAZJ,IAAM,eAAe,CAAC,EAAE,UAAU,OAAO,eAAe,UAAU,WAAW,MAAyB;AACzG,QAAM,SAAS,WAAW,aAAa;AACvC,MAAI,UAAU,WAAc,CAAC,OAAO,SAAS,KAAK,KAAK,SAAS,IAAI;AAChE,UAAM,IAAI,WAAW,iDAAiD;AAAA,EAC1E;AACA,MAAI,YAAY;AAAC,uBAAmB,UAAU;AAAA,EAAE;AAChD,QAAM,QAAQ,QAAQ,OAAO;AAAA,IACzB,OAAO,SAAS,OAAO;AAAA,IACvB,eAAe,OAAO,kBAAkB,WAAW,WAAW,iBAAiB,OAAO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Aa;AACpD,QAAI,aAAa,WAAY,QAAQ,KAAK,SAAU;AAAE;AAAA,IAAQ;AAC9D,UAAM,WAAW,IAAI,SAAS,CAAC,CAAC,KAAK,MAAM;AACvC,UAAI,CAAC,OAAO;AAAE;AAAA,MAAQ;AACtB,YAAM,SAAS,MAAM,kBAAkB,MAAM,qBAAqB;AAClE,iBAAW,MAAM;AACjB,UAAI,QAAQ;AACR,aAAK,UAAU;AACf,YAAI,MAAM;AAAE,mBAAS,WAAW;AAAA,QAAG;AAAA,MACvC;AAAA,IACJ,GAAG,EAAE,MAAM,YAAY,WAAW,OAAO,CAAC;AAC1C,aAAS,QAAQ,OAAO;AACxB,WAAO,MAAM,KAAK,SAAS,WAAW;AAAA,EAC1C,GAAG,CAAC,WAAW,SAAS,MAAM,QAAQ,MAAM,UAAU,CAAC;AACvD,QAAM,OAAO,aAAa,WAAW,YAAY;AACjD,SAAO,gBAAAJ;AAAA,IAAC;AAAA;AAAA,MAAc,GAAG;AAAA,MAAO,KAAK;AAAA,MAAM,QAAQ;AAAA,MAC/C,SAAS,OAAO,EAAE,SAAS,GAAG,GAAG,GAAG,GAAG,GAAG,OAAO,EAAE,IAAI;AAAA,MACtD,GAAK,CAAC,QAAQ,UAAW,EAAE,YAAY,EAAE,UAAU,EAAE,EAAE,IAAI,aAAa,EAAE,WAAW,IAAI,CAAC;AAAA,MAC3F,gBAAgB,WAAS;AAAE,mBAAW,IAAI;AAAG,yBAAiB,KAAK;AAAA,MAAG;AAAA;AAAA,EAAG;AACjF;",
|
|
4
|
+
"sourcesContent": ["/**\n * @author WMXPY\n * @package GridUI\n * @namespace MotionConfig\n * @description Motion Config\n */\n\nimport { useContext, useMemo } from \"react\";\nimport { MotionContext } from \"./context\";\nimport type { MotionConfigProps } from \"./types\";\nimport { validateTransition } from \"./validate-transition\";\n\nexport const MotionConfig = ({ children, tempo, reducedMotion, disabled, transition }: MotionConfigProps) => {\n const parent = useContext(MotionContext);\n if (tempo !== undefined && (!Number.isFinite(tempo) || tempo <= 0)) {\n throw new RangeError(\"MotionConfig tempo must be finite and positive.\");\n }\n if (transition) {\n validateTransition(transition);\n }\n const value = useMemo(() => ({\n tempo: tempo ?? parent.tempo,\n reducedMotion: parent.reducedMotion === \"always\" ? \"always\" : reducedMotion ?? parent.reducedMotion,\n disabled: parent.disabled || disabled === true,\n transition: transition ?? parent.transition,\n }), [parent, tempo, reducedMotion, disabled, transition]);\n return <MotionContext.Provider value={value}>{children}</MotionContext.Provider>;\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace MotionConfig\n * @description Validate Transition\n */\n\nimport type { MotionTransition } from \"./types\";\n\nexport const validateTransition = (transition: MotionTransition): void => {\n if (transition.type === \"spring\") {\n for (const value of [transition.stiffness, transition.damping, transition.mass]) {\n if (value !== undefined && (!Number.isFinite(value) || value <= 0)) {\n throw new RangeError(\"Motion spring parameters must be finite and positive.\");\n }\n }\n } else if (transition.duration !== undefined && (!Number.isFinite(transition.duration) || transition.duration < 0)) {\n throw new RangeError(\"Motion duration must be finite and nonnegative.\");\n }\n};\n\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace MotionLayoutGroup\n * @description Context\n */\n\nimport { createContext } from \"react\";\n\nexport const LayoutGroupContext = createContext(false);\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace Presence\n * @description Presence\n */\n\nimport { LayoutGroupContext } from \"../motion-layout-group/context\";\nimport { AnimatePresence, LayoutGroup } from \"motion/react\";\nimport { type ReactNode, useContext, useId } from \"react\";\n\nexport type PresenceProps = {\n readonly children: ReactNode;\n readonly mode?: \"sync\" | \"wait\" | \"popLayout\";\n readonly initial?: boolean;\n readonly onExitComplete?: () => void;\n};\n\n/** Keep this boundary mounted. Direct children need stable keys and forwarded refs for popLayout. */\nexport const Presence = ({ children, mode = \"sync\", initial = false, onExitComplete }: PresenceProps) => {\n const id = useId();\n const grouped = useContext(LayoutGroupContext);\n const presence = <AnimatePresence mode={mode} initial={initial} {...(onExitComplete ? { onExitComplete } : {})}>\n {children}\n </AnimatePresence>;\n return grouped ? presence : <LayoutGroup id={id}>{presence}</LayoutGroup>;\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace LayoutMotion\n * @description Layout Motion\n */\n\nimport type { MotionState } from \"../shared/state\";\nimport { animate as animateValue, motion, useMotionValue, usePresence, type MotionStyle, type AnimationPlaybackControlsWithThen } from \"motion/react\";\nimport { type ComponentPropsWithRef, type CSSProperties, useImperativeHandle, useEffect, useEffectEvent, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport type { MotionTransition } from \"../motion-config/types\";\nimport { fallbackTransition, readThemeTransition, resolveTransition } from \"../shared/resolve-transition\";\nimport { useMotionPolicy } from \"../shared/use-motion-policy\";\n\nexport type LayoutMotionProps = Omit<ComponentPropsWithRef<\"div\">,\n \"onAnimationStart\" | \"onDrag\" | \"onDragStart\" | \"onDragEnd\" | \"style\"> & {\n readonly style?: Omit<CSSProperties, \"transform\" | \"opacity\" | \"scale\" | \"translate\" | \"rotate\">;\n readonly layout?: boolean | \"position\" | \"size\";\n readonly layoutId?: string;\n /** Mark the scrolling element used by descendant layout measurements. */\n readonly layoutScroll?: boolean;\n /** Mark a fixed-position root used by descendant layout measurements. */\n readonly layoutRoot?: boolean;\n readonly enter?: MotionState;\n readonly animate?: MotionState;\n readonly exit?: MotionState;\n readonly transition?: MotionTransition;\n readonly exitTransition?: MotionTransition;\n readonly onAnimationComplete?: () => void;\n readonly onLayoutAnimationComplete?: () => void;\n };\n\nexport const LayoutMotion = ({\n layout = true, layoutId, layoutScroll, layoutRoot, enter, animate, exit,\n transition, exitTransition, ref, inert, style, onAnimationComplete,\n \"aria-hidden\": ariaHidden, ...props\n}: LayoutMotionProps) => {\n const policy = useMotionPolicy();\n const [present, safeToRemove] = usePresence();\n const node = useRef<HTMLDivElement>(null);\n const running = useRef<AnimationPlaybackControlsWithThen[]>([]);\n const [theme, setTheme] = useState(fallbackTransition);\n useImperativeHandle(ref, () => node.current!, []);\n useLayoutEffect(() => {\n const next = readThemeTransition(node.current!);\n setTheme(previous => next.duration === previous.duration && String(next.ease) === String(previous.ease)\n ? previous : next);\n }, [style, props.className, policy.transition, transition]);\n const opacity = animate?.opacity ?? 1;\n const x = animate?.x ?? 0;\n const y = animate?.y ?? 0;\n const scale = animate?.scale ?? 1;\n const opacityValue = useMotionValue(opacity);\n const xValue = useMotionValue(x);\n const yValue = useMotionValue(y);\n const scaleValue = useMotionValue(scale);\n const values = useMemo(() => ({ opacity: opacityValue, x: xValue, y: yValue, scale: scaleValue }),\n [opacityValue, xValue, yValue, scaleValue]);\n const exitOpacity = exit?.opacity;\n const exitX = exit?.x;\n const exitY = exit?.y;\n const exitScale = exit?.scale;\n const hasExit = exit !== undefined;\n // Timing is captured at each target change. Tempo changes update playback speed\n // independently, so a live configuration update never replays an entrance.\n const settings = useEffectEvent(() => ({\n timing: resolveTransition((!present ? exitTransition : undefined) ?? transition ?? policy.transition,\n readThemeTransition(node.current!), 1, policy.immediate),\n immediate: policy.immediate,\n tempo: policy.tempo,\n }));\n const complete = useEffectEvent(() => onAnimationComplete?.());\n useEffect(() => {\n const { timing, immediate, tempo } = settings();\n const target = present ? { opacity, x, y, scale } : {\n opacity: exitOpacity, x: exitX, y: exitY, scale: exitScale,\n };\n let active = true;\n const playback: AnimationPlaybackControlsWithThen[] = [];\n for (const key of [\"opacity\", \"x\", \"y\", \"scale\"] as const) {\n const next = target[key];\n if (next === undefined || next === values[key].get()) {\n continue;\n }\n if (immediate) {\n values[key].jump(next); continue;\n }\n const animation = animateValue(values[key], next, timing);\n animation.speed = 1 / tempo;\n playback.push(animation);\n }\n running.current = playback;\n if (playback.length) {\n void Promise.all(playback).then(() => {\n if (!active) {\n return;\n }\n running.current = [];\n complete();\n if (!present) {\n safeToRemove();\n }\n });\n } else if (!present) {\n safeToRemove();\n }\n return () => {\n active = false;\n for (const animation of playback) {\n animation.stop();\n }\n running.current = [];\n };\n }, [present, hasExit, safeToRemove, values, opacity, x, y, scale, exitOpacity, exitX, exitY, exitScale]);\n useLayoutEffect(() => {\n for (const animation of running.current) {\n if (policy.immediate) {\n animation.complete();\n } else {\n animation.speed = 1 / policy.tempo;\n }\n }\n }, [policy.immediate, policy.tempo]);\n return (<motion.div\n {...props}\n ref={node}\n style={{ ...style, ...values } as MotionStyle}\n inert={!present || inert || undefined}\n aria-hidden={!present ? true : ariaHidden}\n data-motion-present={present ? \"true\" : \"false\"}\n layout={policy.immediate ? false : layout}\n {...(layoutScroll === undefined ? {} : { layoutScroll })}\n {...(layoutRoot === undefined ? {} : { layoutRoot })}\n // Motion 14 can retain an in-flight projection after layout is disabled.\n // Suppress only that projection; MotionValues still own the base transform.\n {...(policy.immediate ? { transformTemplate: () => {\n return x === 0 && y === 0 && scale === 1 ? \"none\" : `translate(${x}px, ${y}px) scale(${scale})`;\n } } : {})}\n {...(layoutId === undefined ? {} : { layoutId })}\n initial={policy.immediate ? false : (enter ?? false)}\n transition={resolveTransition(transition ?? policy.transition, theme, policy.tempo, policy.immediate)}\n />\n );\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace Shared\n * @description Resolve Transition\n */\n\nimport { validateTransition } from \"../motion-config/validate-transition\";\nimport { readMotionDuration } from \"./dom-policy\";\nimport type { Transition } from \"motion/react\";\nimport type { MotionEase, MotionTransition } from \"../motion-config/types\";\n\nexport type ThemeTransition = { duration: number; ease: MotionEase };\nexport const fallbackTransition: ThemeTransition = { duration: 180, ease: [0.2, 0.8, 0.2, 1] };\n\nexport const readThemeTransition = (element: HTMLElement): ThemeTransition => {\n const style = getComputedStyle(element);\n const duration = readMotionDuration(element);\n const rawEase = style.getPropertyValue(\"--gridui-motion-ease-out\").trim();\n const values = /^cubic-bezier\\(([^)]+)\\)$/.exec(rawEase)?.[1]?.split(\",\").map(Number);\n let ease = fallbackTransition.ease;\n if (values?.length === 4 && values.every(Number.isFinite)\n && values[0]! >= 0 && values[0]! <= 1 && values[2]! >= 0 && values[2]! <= 1) {\n ease = [values[0]!, values[1]!, values[2]!, values[3]!];\n } else if (rawEase === \"linear\") {\n ease = \"linear\";\n } else if (rawEase === \"ease-in\") {\n ease = \"easeIn\";\n } else if (rawEase === \"ease-out\") {\n ease = \"easeOut\";\n } else if (rawEase === \"ease-in-out\") {\n ease = \"easeInOut\";\n }\n return { duration, ease };\n};\n\nexport const resolveTransition = (\n transition: MotionTransition | undefined, theme: ThemeTransition, tempo: number, immediate: boolean,\n): Transition => {\n if (transition) {\n validateTransition(transition);\n }\n if (immediate) {\n return { type: \"tween\", duration: 0 };\n }\n if (transition?.type === \"spring\") {\n return {\n type: \"spring\",\n stiffness: (transition.stiffness ?? 170) / (tempo * tempo),\n damping: (transition.damping ?? 26) / tempo,\n mass: transition.mass ?? 1,\n };\n }\n return {\n type: \"tween\",\n duration: (transition?.duration ?? theme.duration) * tempo / 1000,\n ease: transition?.ease ?? theme.ease,\n };\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace MotionScope\n * @description Motion Scope\n */\n\nimport { Slot } from \"@radix-ui/react-slot\";\nimport type { ComponentPropsWithRef } from \"react\";\nimport { useMotionStyle } from \"../shared/use-motion-style\";\n\nexport type MotionScopeProps = ComponentPropsWithRef<\"div\"> & { readonly asChild?: boolean };\n\n/** CSS policy boundary. asChild preserves the child's DOM, ref, and semantics. */\nexport const MotionScope = ({ asChild = false, style, ...props }: MotionScopeProps) => {\n const motionStyle = useMotionStyle(style);\n const Component = asChild ? Slot : \"div\";\n return <Component {...props} style={motionStyle} />;\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace MotionLayoutGroup\n * @description Motion Layout Group\n */\n\nimport { LayoutGroup } from \"motion/react\";\nimport { type ReactNode, useId } from \"react\";\nimport { LayoutGroupContext } from \"./context\";\n\nexport type MotionLayoutGroupProps = { readonly children: ReactNode };\n\n/** Deliberately share layout identities across nested Presence boundaries. No DOM. */\nexport const MotionLayoutGroup = ({ children }: MotionLayoutGroupProps) => {\n const id = useId();\n return (<LayoutGroupContext.Provider value={true}>\n <LayoutGroup id={id}>{children}</LayoutGroup>\n </LayoutGroupContext.Provider>\n );\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace SpringValue\n * @description Use Spring Value\n */\n\nimport { useLayoutEffect, useState } from \"react\";\nimport { useMotionPolicy } from \"../shared/use-motion-policy\";\nimport { createSpringValue, type SpringValue, type SpringValueOptions } from \"./controller\";\n\n/** Initial value is captured once. Subscriptions update DOM without React frame renders. */\nexport const useSpringValue = (initial: number, options?: SpringValueOptions): SpringValue => {\n const policy = useMotionPolicy();\n const { tempo, immediate } = policy;\n const [controller] = useState(() => createSpringValue(initial));\n const spring: SpringValueOptions | undefined = options ?? (policy.transition?.type === \"spring\" ? policy.transition : undefined);\n const { stiffness, damping, mass, precision } = spring ?? {};\n useLayoutEffect(() => {\n controller.configure({ ...(stiffness === undefined ? {} : { stiffness }),\n ...(damping === undefined ? {} : { damping }),\n ...(mass === undefined ? {} : { mass }),\n ...(precision === undefined ? {} : { precision }) }, { tempo, immediate });\n }, [controller, stiffness, damping, mass, precision, tempo, immediate]);\n useLayoutEffect(() => () => void controller.stop(), [controller]);\n return controller;\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace SpringValue\n * @description Controller\n */\n\nimport { animate, motionValue, type AnimationPlaybackControlsWithThen } from \"motion/react\";\nimport type { MotionTransition } from \"../motion-config/types\";\nimport { validateTransition } from \"../motion-config/validate-transition\";\nimport type { MotionOutcome } from \"../shared/outcome\";\n\nexport type SpringValueOptions = Omit<Extract<MotionTransition, { type: \"spring\" }>, \"type\"> & {\n /** Rest distance and speed tolerance in value units and units per second. */\n readonly precision?: number;\n};\nexport type SpringValuePolicy = { readonly tempo: number; readonly immediate: boolean };\nexport type SpringValue = {\n readonly get: () => number;\n /** Units per real second, independent of tempo. */\n readonly getVelocity: () => number;\n readonly set: (target: number, velocity?: number) => Promise<MotionOutcome>;\n readonly jump: (target: number) => void;\n readonly stop: () => void;\n readonly subscribe: (changed: (value: number) => void) => () => void;\n};\nexport type SpringValueController = SpringValue & {\n readonly configure: (options: SpringValueOptions, policy: SpringValuePolicy) => void;\n readonly dispose: () => void;\n};\nconst finite = (value: number): void => {\n if (!Number.isFinite(value)) {\n throw new RangeError(\"Spring values and velocities must be finite.\");\n }\n};\n\nexport const createSpringValue = (initial: number, initialOptions: SpringValueOptions = {},\n initialPolicy: SpringValuePolicy = { tempo: 1, immediate: false }): SpringValueController => {\n finite(initial);\n const value = motionValue(initial);\n let disposed = false;\n const assertActive = () => {\n if (disposed) {\n throw new Error(\"Cannot use a disposed spring value.\");\n }\n };\n let options: SpringValueOptions = {};\n let tempo = 1;\n let immediate = true;\n let target = initial;\n let pending: Promise<MotionOutcome> | undefined;\n let run: { animation: AnimationPlaybackControlsWithThen; initialVelocity: number; startTempo: number; resolve: (result: MotionOutcome) => void } | undefined;\n // Before the first engine sample, MotionValue has no velocity history.\n const getVelocity = () => {\n if (!run) {\n return 0;\n }\n if (run.animation.time === 0) {\n return run.initialVelocity * run.startTempo / tempo;\n }\n return value.getVelocity();\n };\n const stop = () => {\n const previous = run;\n run = undefined;\n previous?.animation.stop();\n previous?.resolve(\"cancelled\");\n };\n const jump = (next: number) => {\n assertActive();\n finite(next);\n stop();\n target = next;\n value.jump(next);\n };\n const api: SpringValue = {\n get: () => value.get(),\n getVelocity,\n subscribe: changed => {\n assertActive(); return value.on(\"change\", changed);\n },\n stop,\n jump,\n set: (next, velocity) => {\n assertActive();\n finite(next);\n if (run && next === target && velocity === undefined) {\n return pending!;\n }\n const releaseVelocity = velocity ?? getVelocity();\n finite(releaseVelocity);\n stop();\n target = next;\n if (immediate || (value.get() === next && releaseVelocity === 0)) {\n value.jump(next);\n return Promise.resolve(\"finished\");\n }\n const { precision, ...spring } = options;\n const animation = animate(value, next, { type: \"spring\",\n stiffness: 170,\n damping: 26,\n mass: 1,\n ...spring,\n velocity: releaseVelocity * tempo,\n ...(precision === undefined ? {} : { restDelta: precision, restSpeed: precision * tempo }) });\n animation.speed = 1 / tempo;\n pending = new Promise<MotionOutcome>(resolve => {\n const current = { animation, initialVelocity: releaseVelocity, startTempo: tempo, resolve };\n run = current;\n void animation.then(() => {\n if (run !== current) {\n return;\n }\n run = undefined;\n resolve(\"finished\");\n });\n });\n return pending;\n },\n };\n const configure = (next: SpringValueOptions, policy: SpringValuePolicy) => {\n assertActive();\n validateTransition({ type: \"spring\", ...next });\n if (!Number.isFinite(policy.tempo) || policy.tempo <= 0\n || (next.precision !== undefined && (!Number.isFinite(next.precision) || next.precision <= 0))) {\n throw new RangeError(\"Spring tempo and precision must be finite and positive.\");\n }\n options = next;\n tempo = policy.tempo;\n immediate = policy.immediate;\n if (run) {\n if (immediate) {\n const previous = run;\n run = undefined;\n previous.animation.stop();\n value.jump(target);\n previous.resolve(\"finished\");\n } else {\n run.animation.speed = 1 / tempo;\n }\n }\n };\n configure(initialOptions, initialPolicy);\n return { ...api,\n configure,\n dispose: () => {\n if (disposed) {\n return;\n }\n disposed = true;\n stop();\n value.destroy();\n } };\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace MotionSize\n * @description Motion Size\n */\n\nimport { type ComponentPropsWithRef, type CSSProperties, useImperativeHandle, useLayoutEffect, useRef } from \"react\";\nimport { useSpringValue } from \"../spring-value/use-spring-value\";\nimport type { SpringValueOptions } from \"../spring-value/controller\";\n\nexport type MotionSizeProps = Omit<ComponentPropsWithRef<\"div\">, \"style\"> & {\n readonly style?: Omit<CSSProperties, \"height\" | \"overflow\" | \"overflowY\">;\n readonly spring?: SpringValueOptions;\n};\n\n/** Animate intrinsic content height. Width and content semantics stay with the caller. */\nexport const MotionSize = ({ children, spring, ref, style, ...props }: MotionSizeProps) => {\n const outer = useRef<HTMLDivElement>(null);\n const inner = useRef<HTMLDivElement>(null);\n const height = useSpringValue(0, spring);\n useImperativeHandle(ref, () => outer.current!, []);\n useLayoutEffect(() => {\n const node = outer.current!;\n const content = inner.current!;\n let revision = 0;\n height.jump(content.offsetHeight);\n let requested = height.get();\n const unsubscribe = height.subscribe(value => {\n node.style.height = `${Math.max(0, value)}px`;\n });\n const observer = new ResizeObserver(([entry]) => {\n const target = entry?.borderBoxSize[0]?.blockSize ?? content.offsetHeight;\n if (target === requested) {\n return;\n }\n requested = target;\n const run = ++revision;\n node.style.height = `${height.get()}px`;\n node.style.overflow = \"clip\";\n void height.set(target).then(result => {\n if (result === \"finished\" && run === revision) {\n node.style.height = \"auto\"; node.style.removeProperty(\"overflow\");\n }\n });\n });\n observer.observe(content);\n return () => {\n revision++; observer.disconnect(); unsubscribe(); height.stop(); node.style.removeProperty(\"height\"); node.style.removeProperty(\"overflow\");\n };\n }, [height]);\n return (<div {...props} ref={outer} style={style}>\n <div ref={inner} style={{ display: \"flow-root\" }}>{children}</div>\n </div>\n );\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace MotionSequence\n * @description Use Motion Sequence\n */\n\nimport { type RefObject, useLayoutEffect, useState } from \"react\";\nimport { useMotionPolicy } from \"../shared/use-motion-policy\";\nimport { createSequenceController, type MotionSequence } from \"./controller\";\n\n/** Explicit element targets within one mounted scope. This hook owns their animated styles. */\nexport const useMotionSequence = (scope: RefObject<HTMLElement | null>): MotionSequence => {\n const { tempo, immediate, transition } = useMotionPolicy();\n const [controller] = useState(() => createSequenceController(scope));\n useLayoutEffect(() => void controller.configure({ tempo, immediate, transition }), [controller, tempo, immediate, transition]);\n useLayoutEffect(() => () => void controller.dispose(), [controller]);\n return controller.api;\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace MotionSequence\n * @description Controller\n */\n\nimport type { RefObject } from \"react\";\nimport type { MotionEase, MotionTransition } from \"../motion-config/types\";\nimport type { MotionOutcome } from \"../shared/outcome\";\nimport type { MotionState } from \"../shared/state\";\nimport { readThemeTransition } from \"../shared/resolve-transition\";\nimport { validateTransition } from \"../motion-config/validate-transition\";\n\nexport type MotionStep = {\n readonly element: HTMLElement;\n readonly from?: MotionState;\n readonly to: MotionState;\n readonly duration?: number;\n readonly ease?: MotionEase;\n};\nexport type MotionSequenceOptions = {\n readonly order?: \"sequence\" | \"parallel\";\n /** Milliseconds between starts in parallel, or between steps in sequence. */\n readonly stagger?: number;\n};\nexport type MotionRun = {\n readonly finished: Promise<MotionOutcome>;\n readonly cancel: () => void;\n readonly finish: () => void;\n};\nexport type MotionSequence = {\n readonly play: (steps: readonly MotionStep[], options?: MotionSequenceOptions) => MotionRun;\n};\ntype Policy = { tempo: number; immediate: boolean; transition: MotionTransition | undefined };\ntype Property = \"opacity\" | \"transform\";\nconst frames = (state: MotionState): Partial<Record<Property, string>> => ({\n ...(state.opacity === undefined ? {} : { opacity: String(state.opacity) }),\n ...(state.x === undefined && state.y === undefined && state.scale === undefined ? {} : {\n transform: `translate(${state.x ?? 0}px, ${state.y ?? 0}px) scale(${state.scale ?? 1})`,\n }),\n});\nconst easing = (ease: MotionEase): string => Array.isArray(ease) ? `cubic-bezier(${ease.join(\",\")})`\n : ({ linear: \"linear\", easeIn: \"ease-in\", easeOut: \"ease-out\", easeInOut: \"ease-in-out\" })[ease];\n\nexport const createSequenceController = (scope: RefObject<HTMLElement | null>) => {\n let policy: Policy = { tempo: 1, immediate: true, transition: undefined };\n let active: { run: MotionRun; animations: Animation[] } | undefined;\n const originals = new Map<HTMLElement, Map<Property, { value: string; priority: string }>>();\n const play: MotionSequence[\"play\"] = (steps, options = {}) => {\n const stagger = options.stagger ?? 0;\n if (!Number.isFinite(stagger) || stagger < 0) {\n throw new RangeError(\"Stagger must be finite and nonnegative.\");\n }\n const root = scope.current;\n let offset = 0;\n const previous = new Map<HTMLElement, Map<Property, { end: number; value: string }>>();\n const plan = steps.map((step, index) => {\n if (!root?.contains(step.element)) {\n throw new RangeError(\"Sequence targets must belong to the mounted scope.\");\n }\n const theme = readThemeTransition(step.element);\n const base = policy.transition?.type === \"spring\" ? undefined : policy.transition;\n const duration = step.duration ?? base?.duration ?? theme.duration;\n const ease = step.ease ?? base?.ease ?? theme.ease;\n validateTransition({ duration, ease });\n const to = frames(step.to);\n const requestedFrom = step.from ? frames(step.from) : {};\n const from: Partial<Record<Property, string>> = {};\n const delay = options.order === \"parallel\" ? index * stagger : offset;\n offset += duration + stagger;\n const properties = previous.get(step.element) ?? new Map();\n const backwards = (Object.keys(to) as Property[]).every(property => !properties.has(property));\n for (const property of Object.keys(to) as Property[]) {\n const last = properties.get(property);\n if (last && delay < last.end) {\n throw new RangeError(\"Parallel steps cannot own the same element property at the same time.\");\n }\n const start = requestedFrom[property] ?? last?.value;\n if (start !== undefined) {\n from[property] = start;\n }\n properties.set(property, { end: delay + duration, value: to[property]! });\n }\n previous.set(step.element, properties);\n return { element: step.element, to, from, duration, ease: easing(ease), delay, backwards };\n });\n active?.run.cancel();\n let resolve!: (result: MotionOutcome) => void;\n const finished = new Promise<MotionOutcome>(done => {\n resolve = done;\n });\n const animations: Animation[] = [];\n let settled = false;\n const settle = (result: MotionOutcome) => {\n if (settled) {\n return;\n }\n settled = true;\n if (result === \"finished\") {\n for (const step of plan) {\n for (const property of Object.keys(step.to) as Property[]) {\n step.element.style.setProperty(property, step.to[property]!);\n }\n }\n } else {\n // Freeze only properties this scope owns before cancelling WAAPI fills.\n const current = new Map<HTMLElement, Partial<Record<Property, string>>>();\n for (const step of plan) {\n const style = step.element.ownerDocument.defaultView!.getComputedStyle(step.element);\n const values = current.get(step.element) ?? {};\n for (const property of Object.keys(step.to) as Property[]) {\n values[property] = style.getPropertyValue(property);\n }\n current.set(step.element, values);\n }\n for (const [element, values] of current) {\n for (const property of Object.keys(values) as Property[]) {\n element.style.setProperty(property, values[property]!);\n }\n }\n }\n for (const animation of animations) {\n animation.cancel();\n }\n if (active?.run === run) {\n active = undefined;\n }\n resolve(result);\n };\n const run: MotionRun = { finished, cancel: () => void settle(\"cancelled\"), finish: () => void settle(\"finished\") };\n active = { run, animations };\n try {\n for (const step of plan) {\n const saved = originals.get(step.element) ?? new Map();\n for (const property of Object.keys(step.to) as Property[]) {\n if (!saved.has(property)) {\n saved.set(property, { value: step.element.style.getPropertyValue(property), priority: step.element.style.getPropertyPriority(property) });\n }\n }\n originals.set(step.element, saved);\n if (policy.immediate) {\n continue;\n }\n // Later steps must not cover earlier steps during their delay.\n const animation = step.element.animate([step.from, step.to], {\n duration: step.duration, delay: step.delay, easing: step.ease, fill: step.backwards ? \"both\" : \"forwards\",\n });\n animation.playbackRate = 1 / policy.tempo;\n animations.push(animation);\n }\n void Promise.all(animations.map(animation => animation.finished)).then(() => void run.finish(), () => void run.cancel());\n if (policy.immediate || !plan.length) {\n run.finish();\n }\n } catch (error) {\n run.cancel();\n throw error;\n }\n return run;\n };\n return {\n api: { play },\n configure: (next: Policy) => {\n policy = next;\n if (next.immediate) {\n active?.run.finish();\n } else {\n for (const animation of active?.animations ?? []) {\n animation.updatePlaybackRate(1 / next.tempo);\n }\n }\n },\n dispose: () => {\n active?.run.cancel();\n for (const [element, properties] of originals) {\n for (const [property, original] of properties) {\n element.style.setProperty(property, original.value, original.priority);\n }\n }\n originals.clear();\n },\n };\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace MotionReveal\n * @description Motion Reveal\n */\n\nimport { type RefObject, useEffect, useImperativeHandle, useRef, useState } from \"react\";\nimport { LayoutMotion, type LayoutMotionProps } from \"../layout-motion/layout-motion\";\nimport { useMotionPolicy } from \"../shared/use-motion-policy\";\n\nexport type MotionRevealProps = Omit<LayoutMotionProps, \"animate\" | \"exit\" | \"layout\" | \"layoutId\" | \"layoutScroll\" | \"layoutRoot\"> & {\n readonly once?: boolean;\n readonly amount?: number;\n readonly root?: Element | null;\n readonly rootMargin?: string;\n};\n\n/** Offscreen decoration only. Initial visible content and keyboard access stay usable. */\nexport const MotionReveal = ({ once = true, amount = 0, root = null, rootMargin = \"0px\",\n enter = { opacity: 0, y: 12 }, transition, ref, onFocusCapture, ...props }: MotionRevealProps) => {\n if (!Number.isFinite(amount) || amount < 0 || amount > 1) {\n throw new RangeError(\"Reveal amount must be between zero and one.\");\n }\n const node: RefObject<HTMLDivElement | null> = useRef(null);\n const seen = useRef(false);\n const [visible, setVisible] = useState<boolean | null>(null);\n const [focused, setFocused] = useState(false);\n const { immediate } = useMotionPolicy();\n useImperativeHandle(ref, () => node.current!, []);\n useEffect(() => {\n const element = node.current!;\n const Observer = element.ownerDocument.defaultView!.IntersectionObserver;\n if (immediate || focused || (once && seen.current)) {\n return;\n }\n const observer = new Observer(([entry]) => {\n if (!entry) {\n return;\n }\n const inside = entry.isIntersecting && entry.intersectionRatio >= amount;\n setVisible(inside);\n if (inside) {\n seen.current = true;\n if (once) {\n observer.disconnect();\n }\n }\n }, { root, rootMargin, threshold: amount });\n observer.observe(element);\n return () => void observer.disconnect();\n }, [immediate, focused, once, amount, root, rootMargin]);\n const show = immediate || focused || (once && seen.current) || visible !== false;\n const revealTransition = !show || focused ? { duration: 0 } : transition;\n return (<LayoutMotion {...props}\n ref={node}\n layout={false}\n animate={show ? { opacity: 1, x: 0, y: 0, scale: 1 } : enter}\n {...(revealTransition ? { transition: revealTransition } : {})}\n onFocusCapture={event => {\n setFocused(true); onFocusCapture?.(event);\n }} />\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;AAOA,SAAS,YAAY,eAAe;;;ACE7B,IAAM,qBAAqB,CAAC,eAAuC;AACtE,MAAI,WAAW,SAAS,UAAU;AAC9B,eAAW,SAAS,CAAC,WAAW,WAAW,WAAW,SAAS,WAAW,IAAI,GAAG;AAC7E,UAAI,UAAU,WAAc,CAAC,OAAO,SAAS,KAAK,KAAK,SAAS,IAAI;AAChE,cAAM,IAAI,WAAW,uDAAuD;AAAA,MAChF;AAAA,IACJ;AAAA,EACJ,WAAW,WAAW,aAAa,WAAc,CAAC,OAAO,SAAS,WAAW,QAAQ,KAAK,WAAW,WAAW,IAAI;AAChH,UAAM,IAAI,WAAW,iDAAiD;AAAA,EAC1E;AACJ;;;ADOW;AAdJ,IAAM,eAAe,CAAC,EAAE,UAAU,OAAO,eAAe,UAAU,WAAW,MAAyB;AACzG,QAAM,S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B,WAAS;AACrB,mBAAW,IAAI;AAAG,yBAAiB,KAAK;AAAA,MAC5C;AAAA;AAAA,EAAG;AAEX;",
|
|
6
6
|
"names": ["useContext", "jsx", "useMemo", "jsx", "animate", "useMemo", "jsx", "LayoutGroup", "useId", "jsx", "useId", "LayoutGroup", "useLayoutEffect", "useState", "useState", "useLayoutEffect", "useImperativeHandle", "useLayoutEffect", "useRef", "jsx", "useRef", "useImperativeHandle", "useLayoutEffect", "useLayoutEffect", "useState", "useState", "useLayoutEffect", "useEffect", "useImperativeHandle", "useRef", "useState", "jsx", "useRef", "useState", "useImperativeHandle", "useEffect"]
|
|
7
7
|
}
|
package/dist/policy.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
/** Unknown server preference is visually immediate but must not advance domain state. */
|
|
8
8
|
export declare const useMotionPolicy: () => {
|
|
9
9
|
ready: boolean;
|
|
10
|
-
reason:
|
|
10
|
+
reason: "disabled" | "reduced-motion" | "pending" | undefined;
|
|
11
11
|
immediate: boolean;
|
|
12
12
|
tempo: number;
|
|
13
13
|
reducedMotion: "user" | "always";
|
package/docs/catalog.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "@gridui/motion",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.4",
|
|
5
5
|
"category": "foundation",
|
|
6
6
|
"description": "Shared GridUI motion policy, layout, springs, and scoped animation",
|
|
7
7
|
"usage": "Shared React motion policy, presence/layout transitions, spring values, scoped sequences, intrinsic sizing, and visibility-triggered decoration. Import `MotionConfig`, `Presence`, and `LayoutMotion` from `@gridui/motion`. Load `@gridui/theme/styles.css`; Motion has no component stylesheet. The package uses Motion internally. Consumers do not need to import its engine directly.",
|
|
@@ -227,12 +227,6 @@
|
|
|
227
227
|
"@gridui/theme/styles.css"
|
|
228
228
|
],
|
|
229
229
|
"examples": [
|
|
230
|
-
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-foundation/motion/stories/getting-started.mdx"
|
|
231
|
-
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-foundation/motion/stories/layout.stories.tsx",
|
|
232
|
-
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-foundation/motion/stories/motion.stories.tsx",
|
|
233
|
-
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-foundation/motion/stories/policy.stories.tsx",
|
|
234
|
-
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-foundation/motion/stories/reveal.stories.tsx",
|
|
235
|
-
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-foundation/motion/stories/sequences.stories.tsx",
|
|
236
|
-
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-foundation/motion/stories/springs.stories.tsx"
|
|
230
|
+
"https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-foundation/motion/stories/getting-started.mdx"
|
|
237
231
|
]
|
|
238
232
|
}
|
|
@@ -12,7 +12,7 @@ import "@gridui/theme/styles.css";
|
|
|
12
12
|
|
|
13
13
|
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-foundation/motion/README.md) for shared behavior and stylesheet dependencies.
|
|
14
14
|
|
|
15
|
-
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/
|
|
15
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/storybook/scenarios/motion/layout-motion.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
16
16
|
|
|
17
17
|
## API
|
|
18
18
|
|
|
@@ -12,7 +12,7 @@ import "@gridui/theme/styles.css";
|
|
|
12
12
|
|
|
13
13
|
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-foundation/motion/README.md) for shared behavior and stylesheet dependencies.
|
|
14
14
|
|
|
15
|
-
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/
|
|
15
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/storybook/scenarios/motion/layout-motion.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
16
16
|
|
|
17
17
|
## API
|
|
18
18
|
|
|
@@ -12,7 +12,7 @@ import "@gridui/theme/styles.css";
|
|
|
12
12
|
|
|
13
13
|
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-foundation/motion/README.md) for shared behavior and stylesheet dependencies.
|
|
14
14
|
|
|
15
|
-
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/
|
|
15
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/storybook/scenarios/motion/layout.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
16
16
|
|
|
17
17
|
## API
|
|
18
18
|
|
|
@@ -12,7 +12,7 @@ import "@gridui/theme/styles.css";
|
|
|
12
12
|
|
|
13
13
|
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-foundation/motion/README.md) for shared behavior and stylesheet dependencies.
|
|
14
14
|
|
|
15
|
-
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/
|
|
15
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/storybook/scenarios/motion/reveal.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
16
16
|
|
|
17
17
|
## API
|
|
18
18
|
|
|
@@ -12,7 +12,7 @@ import "@gridui/theme/styles.css";
|
|
|
12
12
|
|
|
13
13
|
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-foundation/motion/README.md) for shared behavior and stylesheet dependencies.
|
|
14
14
|
|
|
15
|
-
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/
|
|
15
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/storybook/scenarios/motion/layout.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
16
16
|
|
|
17
17
|
## API
|
|
18
18
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
|
|
2
2
|
# MotionSize
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
Compose MotionSize with Tabs inside the same @gridui/motion component family.
|
|
5
5
|
|
|
6
6
|
Import from ``@gridui/motion`` and load Theme before this family's stylesheet.
|
|
7
7
|
|
|
@@ -12,7 +12,7 @@ import "@gridui/theme/styles.css";
|
|
|
12
12
|
|
|
13
13
|
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-foundation/motion/README.md) for shared behavior and stylesheet dependencies.
|
|
14
14
|
|
|
15
|
-
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-
|
|
15
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-navigation/tabs/stories/tabs.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
16
16
|
|
|
17
17
|
## API
|
|
18
18
|
|
|
@@ -12,7 +12,7 @@ import "@gridui/theme/styles.css";
|
|
|
12
12
|
|
|
13
13
|
Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-foundation/motion/README.md) for shared behavior and stylesheet dependencies.
|
|
14
14
|
|
|
15
|
-
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/
|
|
15
|
+
The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/storybook/scenarios/motion/layout.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
|
|
16
16
|
|
|
17
17
|
## API
|
|
18
18
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridui/motion",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Shared GridUI motion policy, layout, springs, and scoped animation",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@gridui/theme": "^5.
|
|
27
|
+
"@gridui/theme": "^5.1.0",
|
|
28
28
|
"@radix-ui/react-slot": "1.5.0",
|
|
29
29
|
"motion": "14.14.0"
|
|
30
30
|
},
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/shared/dom-policy.ts", "../src/shared/use-motion-policy.ts", "../src/motion-config/context.ts", "../src/shared/use-motion-style.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * @author WMXPY\n * @package GridUI\n * @namespace Shared\n * @description Dom Policy\n */\n\nexport type DOMMotionPolicy = { readonly immediate: boolean; readonly tempo: number };\nconst query = \"(prefers-reduced-motion: reduce)\";\n\n/** Read base time tokens without applying tempo. CSS calc()/var() resolve in the browser. */\nexport const readMotionDuration = (element: Element, token = \"--gridui-motion-duration-normal\", fallback = 180): number => {\n const value = element.ownerDocument.defaultView!.getComputedStyle(element).getPropertyValue(token).trim();\n const parse = (time: string): number | undefined => {\n if (!/^(?:\\d*\\.)?\\d+(?:ms|s)$/.test(time)) { return undefined; }\n return Number.parseFloat(time) * (time.endsWith(\"ms\") ? 1 : 1000);\n };\n const direct = parse(value);\n if (direct !== undefined) { return direct; }\n if (!value || !element.ownerDocument.defaultView!.CSS.supports(\"transition-duration\", value)) { return fallback; }\n const probe = element.ownerDocument.createElement(\"span\");\n probe.style.cssText = \"position:absolute;visibility:hidden;pointer-events:none\";\n probe.style.transitionDuration = value;\n element.ownerDocument.body.append(probe);\n const result = parse(element.ownerDocument.defaultView!.getComputedStyle(probe).transitionDuration);\n probe.remove();\n return result ?? fallback;\n};\n\nexport const readMotionPolicy = (element: Element): DOMMotionPolicy => {\n const style = element.ownerDocument.defaultView!.getComputedStyle(element);\n const factor = Number.parseFloat(style.getPropertyValue(\"--gridui-motion-tempo\"));\n return {\n immediate: element.ownerDocument.defaultView!.matchMedia(query).matches\n || style.getPropertyValue(\"--gridui-motion-disabled\").trim() === \"1\",\n tempo: Number.isFinite(factor) && factor > 0 ? factor : 1,\n };\n};\n\n/**\n * Observe the current ancestor chain and document preference. Re-subscribe after\n * reparenting; stylesheet-only changes are read on the next explicit read/update.\n * Resource lifecycle stays independent. This observer never scans descendants.\n */\nexport const observeMotionPolicy = (element: Element, changed: (policy: DOMMotionPolicy) => void): (() => void) => {\n let previous = readMotionPolicy(element);\n const update = () => {\n const next = readMotionPolicy(element);\n if (next.immediate !== previous.immediate || next.tempo !== previous.tempo) {\n previous = next;\n changed(next);\n }\n };\n const observer = new element.ownerDocument.defaultView!.MutationObserver(update);\n for (let node: Element | null = element; node; node = node.parentElement) {\n observer.observe(node, { attributes: true, attributeFilter: [\"style\", \"class\"] });\n }\n const media = element.ownerDocument.defaultView!.matchMedia(query);\n media.addEventListener(\"change\", update);\n return () => {\n observer.disconnect();\n media.removeEventListener(\"change\", update);\n };\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace Shared\n * @description Use Motion Policy\n */\n\nimport { useContext, useSyncExternalStore } from \"react\";\nimport { MotionContext } from \"../motion-config/context\";\n\nconst query = \"(prefers-reduced-motion: reduce)\";\nconst subscribe = (notify: () => void): (() => void) => {\n const preference = window.matchMedia(query);\n preference.addEventListener(\"change\", notify);\n return () => void preference.removeEventListener(\"change\", notify);\n};\nconst snapshot = (): boolean => window.matchMedia(query).matches;\nconst serverSnapshot = (): undefined => undefined;\n\n/** Unknown server preference is visually immediate but must not advance domain state. */\nexport const useMotionPolicy = () => {\n const settings = useContext(MotionContext);\n const systemReduced = useSyncExternalStore<boolean | undefined>(subscribe, snapshot, serverSnapshot);\n const ready = systemReduced !== undefined;\n const reason = settings.disabled ? \"disabled\" : settings.reducedMotion === \"always\" || systemReduced\n ? \"reduced-motion\" : !ready ? \"pending\" : undefined;\n return { ...settings, ready, reason, immediate: reason !== undefined };\n};\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace MotionConfig\n * @description Context\n */\n\nimport { createContext } from \"react\";\nimport type { MotionSettings } from \"./types\";\n\nexport const MotionContext = createContext<MotionSettings>({\n tempo: 1,\n reducedMotion: \"user\",\n disabled: false,\n transition: undefined,\n});\n", "/**\n * @author WMXPY\n * @package GridUI\n * @namespace Shared\n * @description Use Motion Style\n */\n\nimport type { CSSProperties } from \"react\";\nimport { useMotionPolicy } from \"./use-motion-policy\";\n\n/** Bridge React policy to owned CSS, including nodes rendered through a portal. */\nexport const useMotionStyle = (style?: CSSProperties): CSSProperties => {\n const policy = useMotionPolicy();\n return {\n ...style,\n \"--gridui-motion-tempo\": policy.tempo,\n \"--gridui-motion-factor\": policy.immediate ? 0 : policy.tempo,\n \"--gridui-motion-disabled\": policy.immediate ? 1 : 0,\n \"--gridui-motion-animation\": policy.immediate ? \"none\" : \"initial\",\n \"--gridui-motion-transition\": policy.immediate ? \"none\" : \"initial\",\n \"--gridui-motion-transform\": policy.immediate ? \"none\" : \"initial\",\n } as CSSProperties;\n};\n"],
|
|
5
|
-
"mappings": ";AAQA,IAAM,QAAQ;AAGP,IAAM,qBAAqB,CAAC,SAAkB,QAAQ,mCAAmC,WAAW,QAAgB;AACvH,QAAM,QAAQ,QAAQ,cAAc,YAAa,iBAAiB,OAAO,EAAE,iBAAiB,KAAK,EAAE,KAAK;AACxG,QAAM,QAAQ,CAAC,SAAqC;AAChD,QAAI,CAAC,0BAA0B,KAAK,IAAI,GAAG;AAAE,aAAO;AAAA,IAAW;AAC/D,WAAO,OAAO,WAAW,IAAI,KAAK,KAAK,SAAS,IAAI,IAAI,IAAI;AAAA,EAChE;AACA,QAAM,SAAS,MAAM,KAAK;AAC1B,MAAI,WAAW,QA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