@cloudlet/toast 1.4.0-rc.1 → 1.5.0

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.
Files changed (83) hide show
  1. package/CHANGELOG.md +181 -0
  2. package/README.md +30 -5
  3. package/dist/agent.d.ts.map +1 -1
  4. package/dist/agent.js +19 -15
  5. package/dist/agent.js.map +1 -1
  6. package/dist/center-react.d.ts +286 -0
  7. package/dist/center-react.d.ts.map +1 -0
  8. package/dist/center-react.js +2 -0
  9. package/dist/center.d.ts +3 -0
  10. package/dist/center.d.ts.map +1 -0
  11. package/dist/center.js +1 -0
  12. package/dist/core/agent-port.d.ts +2 -0
  13. package/dist/core/agent-port.d.ts.map +1 -1
  14. package/dist/core/agent-port.js +3 -0
  15. package/dist/core/agent-port.js.map +1 -1
  16. package/dist/react/card.d.ts +4 -0
  17. package/dist/react/card.d.ts.map +1 -1
  18. package/dist/react/card.js +3 -8
  19. package/dist/react/card.js.map +1 -1
  20. package/dist/react/center-backdrop.d.ts +69 -0
  21. package/dist/react/center-backdrop.d.ts.map +1 -0
  22. package/dist/react/center-backdrop.js +81 -0
  23. package/dist/react/center-backdrop.js.map +1 -0
  24. package/dist/react/center-clear.d.ts +16 -0
  25. package/dist/react/center-clear.d.ts.map +1 -0
  26. package/dist/react/center-clear.js +24 -0
  27. package/dist/react/center-clear.js.map +1 -0
  28. package/dist/react/center-gestures.d.ts +47 -0
  29. package/dist/react/center-gestures.d.ts.map +1 -0
  30. package/dist/react/center-gestures.js +74 -0
  31. package/dist/react/center-gestures.js.map +1 -0
  32. package/dist/react/center-motion.d.ts +174 -0
  33. package/dist/react/center-motion.d.ts.map +1 -0
  34. package/dist/react/center-motion.js +344 -0
  35. package/dist/react/center-motion.js.map +1 -0
  36. package/dist/react/center.d.ts +15 -0
  37. package/dist/react/center.d.ts.map +1 -0
  38. package/dist/react/center.js +1287 -0
  39. package/dist/react/center.js.map +1 -0
  40. package/dist/react/focus.d.ts +7 -0
  41. package/dist/react/focus.d.ts.map +1 -0
  42. package/dist/react/focus.js +14 -0
  43. package/dist/react/focus.js.map +1 -0
  44. package/dist/react/gestures.d.ts +33 -2
  45. package/dist/react/gestures.d.ts.map +1 -1
  46. package/dist/react/gestures.js +181 -149
  47. package/dist/react/gestures.js.map +1 -1
  48. package/dist/react/host.d.ts.map +1 -1
  49. package/dist/react/host.js +287 -283
  50. package/dist/react/host.js.map +1 -1
  51. package/dist/react/motion.d.ts +18 -11
  52. package/dist/react/motion.d.ts.map +1 -1
  53. package/dist/react/motion.js +6 -3
  54. package/dist/react/motion.js.map +1 -1
  55. package/dist/react/reduced.d.ts +24 -0
  56. package/dist/react/reduced.d.ts.map +1 -0
  57. package/dist/react/reduced.js +35 -0
  58. package/dist/react/reduced.js.map +1 -0
  59. package/dist/react/zoom.d.ts +12 -0
  60. package/dist/react/zoom.d.ts.map +1 -0
  61. package/dist/react/zoom.js +21 -0
  62. package/dist/react/zoom.js.map +1 -0
  63. package/dist/react.d.ts +4 -0
  64. package/dist/react.d.ts.map +1 -1
  65. package/dist/styles.css +1 -1
  66. package/package.json +3 -2
  67. package/src/agent.ts +11 -6
  68. package/src/center-react.ts +300 -0
  69. package/src/center.ts +27 -0
  70. package/src/core/agent-port.ts +3 -0
  71. package/src/react/card.tsx +5 -6
  72. package/src/react/center-backdrop.tsx +151 -0
  73. package/src/react/center-clear.ts +56 -0
  74. package/src/react/center-gestures.ts +143 -0
  75. package/src/react/center-motion.ts +504 -0
  76. package/src/react/center.tsx +1557 -0
  77. package/src/react/focus.ts +18 -0
  78. package/src/react/gestures.ts +127 -37
  79. package/src/react/host.tsx +17 -5
  80. package/src/react/motion.ts +16 -9
  81. package/src/react/reduced.ts +52 -0
  82. package/src/react/zoom.ts +26 -0
  83. package/src/react.ts +4 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"center-motion.js","names":["tweenGenerator","critical","stiffness","mass","CENTER_MOTION","positive","resolveCenterMotion","overrides","valid","value","key","resolve","source","override","result","base","delays","cascadeDelay","share","goal","PERMILLE","name","spec","delay","generator","spring","restClip","box","narrowing","geometry","stackVisual","clip","look","narrow","bottom","scale","stackLook","visual","c","resting","spatial","CARD_CHANNELS","validScale","createCenterMotion","channels","groups","changed","frame","disposed","reduced","options","timeScale","m","channel","state","busy","keys","sample","animation","elapsed","time","next","flush","schedule","tick","complete","group","jump","to","target","tween","set","velocity","after","done","request","change","enterSpring","exitSpring","fade","open","duration","p","delta","y","s","o","still","rebase","from","home","rest","fling","prefix","x"],"sources":["../../src/react/center-motion.ts"],"sourcesContent":["import type { NotificationCenterMotionConstants, NotificationCenterMotionOverrides } from '../center-react.js';\nimport { spring, tween as tweenGenerator } from './generators.js';\nimport type { Generator } from './generators.js';\n\nconst critical = (stiffness: number, mass = 1) => 2 * Math.sqrt(stiffness * mass);\n\n/**\n * The notification center's motion, the one place to tune it (as MOTION is the Toaster's).\n * Durations are milliseconds at `timeScale: 1`; offsets and blur are CSS px. Starting values, to\n * be tuned on the laboratory.\n */\nexport const CENTER_MOTION: NotificationCenterMotionConstants = {\n /** The drawer's position opening: critically damped. */\n open: { stiffness: 320, damping: critical(320), mass: 1 },\n /** Closing: one and a half times stiffer, still critical. */\n close: { stiffness: 480, damping: critical(480), mass: 1 },\n /** A closed card lies this far past the column's own width, off the screen with its shadow. */\n travel: 56,\n /** Each next card trails the previous one by this share of the way (up to the eighth card). */\n lag: 0.12,\n /** A card that arrives in the open center grows like the Toaster's first pill. */\n enter: { duration: 200, bounce: 0.25, scale: 0.25, fade: 160 },\n /** A cleared card leaves like the Toaster's dismissed pill. */\n exit: { duration: 300, bounce: 0 },\n /** The other cards move to their new places on this spring. */\n reflow: { stiffness: 448, damping: critical(448), mass: 1 },\n /** The time and the clear button in its place swap with a blur. */\n swap: 180, swapBlur: 4,\n /** Reduced motion: opening, closing and the list change opacity only, for this long. */\n reduced: 80,\n /**\n * A group: its cards move between the stack and the list on `expand` and `collapse` (the Island's\n * shape springs, a little under critical: the cards pass their places slightly and settle);\n * collapsed, each edge under the top card lies `step` px lower and `shrink` narrower than the one\n * above; an edge's content shows over `reveal` ms from a `blur` px blur, as the heading row and\n * the button under the stack swap; `cascade` 0 moves the cards together.\n */\n stack: {\n expand: { stiffness: 900, damping: 60, mass: 2 },\n collapse: { stiffness: 900, damping: 45, mass: 1 },\n step: 10, shrink: 0.06, reveal: 160, blur: 4, cascade: 0,\n },\n};\n\n/** Cards after the eighth trail like the eighth. */\nexport const LAG_CARDS = 8;\n\nconst positive = new Set(['stiffness', 'mass']);\n\n/**\n * Resolves `NotificationCenterMotion.overrides` (a debugging channel) onto the starting values with\n * the Toaster's contract: a field that is not a finite number in range (stiffness and mass > 0, the\n * rest ≥ 0) keeps its default; unknown keys are ignored.\n */\nexport function resolveCenterMotion(overrides: NotificationCenterMotionOverrides | undefined): NotificationCenterMotionConstants {\n if (!overrides || typeof overrides !== 'object') return CENTER_MOTION;\n const valid = (key: string, value: unknown): value is number =>\n typeof value === 'number' && Number.isFinite(value) && (positive.has(key) ? value > 0 : value >= 0);\n // Nested to any depth (the stack's springs sit inside `stack`): every number of the defaults is a field.\n const resolve = (base: Record<string, unknown>, override: unknown): Record<string, unknown> => {\n const source = override && typeof override === 'object' ? override as Record<string, unknown> : {};\n const result: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(base)) {\n result[key] = typeof value === 'number' ? valid(key, source[key]) ? source[key] : value : resolve(value as Record<string, unknown>, source[key]);\n }\n return result;\n };\n return resolve(CENTER_MOTION as unknown as Record<string, unknown>, overrides) as unknown as NotificationCenterMotionConstants;\n}\n\ntype Spring = NotificationCenterMotionConstants['reflow'];\nconst delays = new Map<string, number>();\n/**\n * How long (ms at `timeScale: 1`) a card waits so that it starts once the first card of its group\n * has covered `share` of its way on `spring` from rest: the stack's cascade. Cached per spring.\n */\nexport function cascadeDelay(spec: Spring, share: number): number {\n if (!(share > 0)) return 0;\n const goal = Math.min(share, 0.95) * PERMILLE;\n const name = `${spec.stiffness}/${spec.damping}/${spec.mass}/${goal}`;\n let delay = delays.get(name);\n if (delay === undefined) {\n const generator = spring({ from: 0, to: PERMILLE, velocity: 0, ...spec });\n delay = 0;\n while (delay < 5000 && generator.next(delay).value < goal) delay++;\n if (delays.size > 64) delays.clear();\n delays.set(name, delay);\n }\n return delay;\n}\n\n/**\n * A card of a group in the group's own terms (px from the top of its `li`, layout values untouched\n * by transforms). `plain` is a card in the flow, its look scaled from its top centre: the top card\n * of a stack and every card of an expanded group. `edge` (levels 1 and 2) and `hidden` (behind the\n * second edge, at level 2) are bottom-aligned with the top card (`list` + `first`), lowered by\n * `step × level` and narrowed from their bottom centre by the CSS, and clipped at rest to the top\n * card's height (`restClip`).\n */\nexport interface StackBox {\n readonly kind: 'plain' | 'edge' | 'hidden';\n /** Plain: the card's layout top. */\n readonly top: number;\n /** The card's own height. */\n readonly height: number;\n /** The top of the group's list, and the height of the stack's top card. */\n readonly list: number;\n readonly first: number;\n /** 0 for a plain card, 1 or 2 for an edge, 2 for a hidden card. */\n readonly level: number;\n}\n/** A card's channels in its box's terms: offset, scale and clip from the top, with the speeds (per second). */\nexport interface StackLook { readonly y: number; readonly s: number; readonly c: number; readonly vy: number; readonly vs: number }\n/** What a card looks like in the group: the visible top and bottom, its scale, and their speeds. */\nexport interface StackVisual { readonly top: number; readonly bottom: number; readonly scale: number; readonly vbottom: number; readonly vscale: number }\ntype StackGeometry = Pick<NotificationCenterMotionConstants['stack'], 'step' | 'shrink'>;\n\n/** The clip from the top a card's place gives it at rest: an edge shows the top card's height. */\nexport const restClip = (box: StackBox) => box.kind === 'plain' ? 0 : Math.max(0, box.height - box.first);\nconst narrowing = (box: StackBox, geometry: StackGeometry) => Math.max(0.05, 1 - box.level * geometry.shrink);\n\n/** How a card looks with `look` in `box`; the clip in force is the channel's while it runs (`clipping`), else the place's own. */\nexport function stackVisual(box: StackBox, look: StackLook & { readonly clipping: boolean }, geometry: StackGeometry): StackVisual {\n const clip = look.clipping ? look.c : restClip(box);\n if (box.kind === 'plain') {\n const base = box.top + look.y;\n return { top: base + clip * look.s, bottom: base + box.height * look.s, scale: look.s, vbottom: look.vy + box.height * look.vs, vscale: look.vs };\n }\n const narrow = narrowing(box, geometry);\n const bottom = box.list + box.first + box.level * geometry.step + narrow * look.y;\n const scale = narrow * look.s;\n return { top: bottom - scale * (box.height - clip), bottom, scale, vbottom: narrow * look.vy, vscale: narrow * look.vs };\n}\n\n/** The channels that give a card in `box` the look `visual`: the inverse of `stackVisual`, the clip within the card. */\nexport function stackLook(box: StackBox, visual: StackVisual, geometry: StackGeometry): StackLook {\n const scale = Math.max(1e-3, visual.scale);\n const c = Math.min(box.height, Math.max(0, box.height - (visual.bottom - visual.top) / scale));\n if (box.kind === 'plain') {\n return { y: visual.bottom - box.top - box.height * scale, s: scale, c, vy: visual.vbottom - box.height * visual.vscale, vs: visual.vscale };\n }\n const narrow = narrowing(box, geometry);\n return { y: (visual.bottom - box.list - box.first - box.level * geometry.step) / narrow, s: scale / narrow, c, vy: visual.vbottom / narrow, vs: visual.vscale / narrow };\n}\n\n/**\n * The drawer's position runs on the spring in thousandths: the generators stop a spring within\n * 0.5 units at under 2 units/s once its range is 5 units or more, so a 0–1000 range settles within\n * 0.05 % of the travel (a fraction of a pixel), where 0–1 would snap the last 0.5 %.\n */\nconst PERMILLE = 1000;\n\ntype Spec =\n | { readonly stiffness: number; readonly damping: number; readonly mass: number }\n | { readonly duration: number; readonly bounce: number }\n | { readonly tween: number };\ninterface ChannelState {\n value: number;\n target: number;\n /** Real-time units per second, independent of timeScale. */\n velocity: number;\n animation: { generator: Generator; start: number } | null;\n}\n\n/**\n * Channels: `p` (drawer position in thousandths), `fade` (the panel's opacity, reduced motion only),\n * `blur` (the backdrop's blur layers apart from the drawer: 0 while the page scrolls under the\n * center, with the backdrop's scroll tint) and per card `x:<key>` (sideways offset under a finger, px), `y:<key>` (offset from its layout\n * place, px), `s:<key>` (scale), `c:<key>` (clip from its top, px, while it moves in a group) and\n * `o:<key>` (opacity).\n */\nconst resting = (key: string) => key === 'p' || key.startsWith('x:') || key.startsWith('y:') || key.startsWith('c:') ? 0 : 1;\n/** Spatial channels jump under reduced motion; opacity channels fade for `reduced` ms. */\nconst spatial = (key: string) => key === 'p' || key.startsWith('x:') || key.startsWith('y:') || key.startsWith('s:') || key.startsWith('c:');\nconst CARD_CHANNELS = ['x:', 'y:', 's:', 'c:', 'o:'] as const;\n\ninterface CenterMotionOptions {\n readonly now: () => number;\n readonly requestFrame: (callback: (time: number) => void) => number;\n readonly cancelFrame: (frame: number) => void;\n /** The sole DOM writer (CSSOM rules), with the channels that changed since the last write. */\n readonly write: (changed: ReadonlySet<string>) => void;\n readonly reducedMotion?: boolean | undefined;\n readonly timeScale?: number | undefined;\n readonly constants?: NotificationCenterMotionConstants | undefined;\n}\n\nconst validScale = (value: number | undefined) => typeof value === 'number' && Number.isFinite(value) && value > 0 ? value : 1;\n\n/**\n * One RAF sampler per center over the generators of generators.ts. Every retarget starts from the\n * current value and velocity, so opening in the middle of closing turns the drawer without a jerk;\n * nothing is scheduled at rest; completion callbacks run from a frame, only for the latest request\n * of their group. A finger (the gestures) can take the position over: `grab`, `drag`, then\n * `release` back to the open position or `fling` before the center closes.\n */\nexport function createCenterMotion(options: CenterMotionOptions) {\n const channels = new Map<string, ChannelState>();\n const groups = new Map<string, { keys: readonly string[]; done: () => void }>();\n const changed = new Set<string>();\n let frame: number | null = null;\n let disposed = false;\n let reduced = options.reducedMotion ?? false;\n let timeScale = validScale(options.timeScale);\n let m = options.constants ?? CENTER_MOTION;\n\n function channel(key: string): ChannelState {\n let state = channels.get(key);\n if (!state) {\n const value = resting(key);\n channels.set(key, state = { value, target: value, velocity: 0, animation: null });\n }\n return state;\n }\n const busy = (keys: Iterable<string>) => { for (const key of keys) if (channels.get(key)?.animation) return true; return false; };\n function sample(time: number) {\n for (const [key, state] of channels) {\n const animation = state.animation;\n if (!animation) continue;\n const elapsed = Math.max(0, (time - animation.start) * timeScale);\n const next = animation.generator.next(elapsed);\n state.value = next.value;\n state.velocity = next.done ? 0 : (animation.generator.velocity?.(elapsed) ?? 0) * timeScale;\n if (next.done) { state.animation = null; state.value = state.target; }\n changed.add(key);\n }\n }\n function flush() {\n if (disposed || !changed.size) return;\n const keys = new Set(changed);\n changed.clear();\n options.write(keys);\n }\n function schedule() {\n if (!disposed && frame === null) frame = options.requestFrame(tick);\n }\n function complete() {\n for (const [name, group] of [...groups]) {\n if (disposed) return;\n if (groups.get(name) !== group || busy(group.keys)) continue;\n groups.delete(name);\n group.done();\n }\n }\n function tick() {\n frame = null;\n if (disposed) return;\n // The sampler's own clock, as every request reads it: a frame's timestamp can precede a request\n // made earlier in the same frame, which would step the curve back.\n sample(options.now());\n flush();\n complete();\n // A completion may place a channel (a hidden card's opacity back at rest).\n flush();\n if (groups.size || busy(channels.keys())) schedule();\n }\n function jump(key: string, value: number) {\n const state = channel(key);\n if (state.value !== value || state.animation) changed.add(key);\n state.value = state.target = value;\n state.velocity = 0;\n state.animation = null;\n }\n /** Retargets a channel from its value and speed; `delay` (ms at `timeScale: 1`) holds it where it is first. */\n function to(key: string, target: number, spec: Spec, time: number, delay = 0) {\n const state = channel(key);\n if (reduced) {\n if (spatial(key)) return jump(key, target);\n spec = { tween: m.reduced };\n delay = 0;\n }\n state.target = target;\n if (state.value === target && !state.animation) return;\n const generator = 'tween' in spec\n ? tweenGenerator(state.value, target, spec.tween)\n : spring({ from: state.value, to: target, velocity: state.velocity / timeScale, ...spec });\n state.animation = { generator, start: time + delay / timeScale };\n }\n /** Puts a channel at `value` with `velocity` (real-time units per second), for a retarget that follows. */\n function set(key: string, value: number, velocity: number) {\n const state = channel(key);\n const next = Number.isFinite(value) ? value : state.target;\n if (state.value !== next) changed.add(key);\n state.value = next;\n state.velocity = Number.isFinite(velocity) ? velocity : 0;\n }\n function after(name: string, keys: readonly string[], done?: () => void) {\n if (done) groups.set(name, { keys, done }); else groups.delete(name);\n }\n function request(change: (time: number) => void) {\n if (disposed) return;\n const time = options.now();\n sample(time);\n change(time);\n flush();\n if (groups.size || busy(channels.keys())) schedule();\n }\n const enterSpring = () => ({ duration: m.enter.duration, bounce: m.enter.bounce });\n const exitSpring = () => ({ duration: m.exit.duration, bounce: m.exit.bounce });\n\n return {\n /** The current value of a channel; `p` in 0–1 (a spring released with speed may pass 1). */\n value(key: string): number {\n const state = channels.get(key);\n const value = state ? state.value : resting(key);\n return key === 'p' ? value / PERMILLE : value;\n },\n /** Opens or closes on the position spring from where the drawer is and how fast it moves. */\n setOpen(open: boolean, done?: () => void) {\n request(time => {\n if (reduced) {\n // Calm: the cards stay in place and the panel fades in or out.\n const fade = channel('fade');\n if (open && fade.target === 1 && channel('p').value === 0) jump('fade', 0);\n jump('p', PERMILLE);\n to('fade', open ? 1 : 0, { tween: m.reduced }, time);\n } else {\n jump('fade', 1);\n to('p', open ? PERMILLE : 0, open ? m.open : m.close, time);\n }\n after('drawer', ['p', 'fade'], done);\n });\n },\n /**\n * Shows (1) or hides (0) the backdrop's blur layers apart from the drawer, over `duration` ms\n * from where they are; at once under reduced motion.\n */\n setBlur(shown: boolean, duration: number) {\n request(time => {\n if (reduced) jump('blur', shown ? 1 : 0);\n else to('blur', shown ? 1 : 0, { tween: duration }, time);\n });\n },\n /** Places the drawer without motion (an open center on the first client render). */\n place(open: boolean) {\n request(() => { jump('p', open ? PERMILLE : 0); jump('fade', 1); groups.delete('drawer'); });\n },\n /** A finger takes the position: the spring stops where it is. */\n grab() {\n request(() => { const state = channel('p'); jump('p', state.value); groups.delete('drawer'); });\n },\n /** The finger moves the drawer to `p` (0 closed, 1 open). */\n drag(p: number) {\n request(() => { if (Number.isFinite(p)) jump('p', p * PERMILLE); });\n },\n /** The finger lets go short of closing: back to open with its speed (p per second). */\n release(velocity: number, done?: () => void) {\n request(time => {\n const state = channel('p');\n state.velocity = Number.isFinite(velocity) ? velocity * PERMILLE : 0;\n to('p', PERMILLE, m.open, time);\n after('drawer', ['p', 'fade'], done);\n });\n },\n /** Sets the speed (p per second) the following `setOpen(false)` starts with. */\n fling(velocity: number) {\n const state = channel('p');\n if (!disposed && !state.animation) state.velocity = Number.isFinite(velocity) ? velocity * PERMILLE : 0;\n },\n /** A card that arrives in the open center grows in from the top. */\n enter(key: string) {\n request(time => {\n if (!reduced) { jump(`s:${key}`, m.enter.scale); to(`s:${key}`, 1, enterSpring(), time); }\n jump(`o:${key}`, 0);\n to(`o:${key}`, 1, { tween: m.enter.fade }, time);\n });\n },\n /** A card's layout place moved by `delta` px: it starts where it was and springs to the new place. */\n shift(key: string, delta: number) {\n request(time => {\n if (!Number.isFinite(delta) || Math.abs(delta) < 0.5) return;\n const state = channel(`y:${key}`);\n state.value += delta;\n changed.add(`y:${key}`);\n to(`y:${key}`, 0, m.reflow, time);\n });\n },\n /**\n * A card of a group moved between places (the stack's top, its edges, behind them, the list of\n * an expanded group): `rebase` turns its current channels into its new place's terms, so it\n * looks where it was and keeps its speed, and it springs to the place on `spring` (the clip to\n * `clip`, the place's own). `delay` holds a card that stands still (the cascade). `fade: 'in'`\n * shows a card that was hidden over `stack.reveal` ms; `'out'` fades it out, then leaves it to\n * its place's own hiding at full opacity.\n */\n fold(key: string, rebase: (look: StackLook & { readonly clipping: boolean }) => StackLook,\n options: { readonly spring: Spec; readonly clip: number; readonly delay?: number | undefined; readonly fade?: 'in' | 'out' | undefined }) {\n request(time => {\n const y = channel(`y:${key}`);\n const s = channel(`s:${key}`);\n const c = channel(`c:${key}`);\n const o = channel(`o:${key}`);\n const still = !y.animation && !s.animation && !c.animation;\n const next = rebase({ y: y.value, s: s.value, c: c.value, vy: y.velocity, vs: s.velocity, clipping: !!c.animation });\n const delay = still ? Math.max(0, options.delay ?? 0) : 0;\n set(`y:${key}`, next.y, next.vy);\n set(`s:${key}`, next.s, next.vs);\n set(`c:${key}`, next.c, 0);\n to(`y:${key}`, 0, options.spring, time, delay);\n to(`s:${key}`, 1, options.spring, time, delay);\n to(`c:${key}`, options.clip, options.spring, time, delay);\n const fade = { tween: m.stack.reveal };\n if (options.fade === 'out') {\n to(`o:${key}`, 0, fade, time, delay);\n after(`fade:${key}`, [`o:${key}`], () => jump(`o:${key}`, 1));\n return;\n }\n groups.delete(`fade:${key}`);\n if (options.fade === 'in' && !o.animation && o.value === 1) jump(`o:${key}`, 0);\n if (o.value !== 1 || o.animation) to(`o:${key}`, 1, fade, time, delay);\n });\n },\n /**\n * Starts a leaving card (its inert copy) from a card's current look, then fades and shrinks it.\n * A swiped card (`fling`) instead keeps flying sideways to `fling.to` px from where the finger let\n * it go, with the release speed (px per second), and fades. `rest` is where the copy's card lay,\n * in the copy's terms (an edge of a stack: lower, narrower, clipped); it shrinks from there.\n */\n exit(key: string, from: { x?: number; y: number; scale: number; opacity: number; clip?: number }, done: () => void,\n fling?: { readonly to: number; readonly velocity: number }, rest?: { readonly y: number; readonly s: number; readonly c: number }) {\n request(time => {\n jump(`x:${key}`, from.x ?? 0); jump(`y:${key}`, from.y); jump(`s:${key}`, from.scale); jump(`o:${key}`, from.opacity);\n jump(`c:${key}`, from.clip ?? 0);\n const home = rest ?? { y: 0, s: 1, c: 0 };\n // Calm: the copy only fades where it stands.\n if (!reduced && fling) {\n channel(`x:${key}`).velocity = Number.isFinite(fling.velocity) ? fling.velocity : 0;\n to(`x:${key}`, fling.to, m.reflow, time);\n to(`y:${key}`, home.y, m.reflow, time);\n } else if (!reduced) {\n to(`x:${key}`, 0, m.reflow, time);\n to(`y:${key}`, home.y, m.reflow, time);\n to(`s:${key}`, home.s * m.enter.scale, exitSpring(), time);\n to(`c:${key}`, home.c, m.reflow, time);\n }\n to(`o:${key}`, 0, exitSpring(), time);\n after(`exit:${key}`, CARD_CHANNELS.map(prefix => prefix + key), done);\n });\n },\n /** A finger moves a card sideways to `x` px. */\n dragCard(key: string, x: number) {\n request(() => { if (Number.isFinite(x)) jump(`x:${key}`, x); });\n },\n /** The finger lets a card go short of clearing it: back to its place with its speed (px per second). */\n releaseCard(key: string, velocity: number) {\n request(time => {\n const state = channel(`x:${key}`);\n state.velocity = Number.isFinite(velocity) ? velocity : 0;\n to(`x:${key}`, 0, m.reflow, time);\n });\n },\n /** Drops a card's channels (it left the list, or its copy finished leaving). */\n forget(key: string) {\n for (const prefix of CARD_CHANNELS) channels.delete(prefix + key);\n groups.delete(`exit:${key}`);\n groups.delete(`fade:${key}`);\n },\n /** True while a channel runs (or waits out its delay). */\n moving(key: string): boolean { return !!channels.get(key)?.animation; },\n setReducedMotion(next: boolean) {\n if (disposed || reduced === next) return;\n request(time => {\n reduced = next;\n if (!reduced) {\n // Leave the calm state: the panel is fully shown, the position carries on.\n if (channel('fade').target === 1) jump('fade', 1);\n return;\n }\n for (const [key, state] of channels) {\n if (!state.animation) continue;\n if (spatial(key) || key === 'blur') jump(key, state.target);\n else { state.animation = null; state.velocity = 0; to(key, state.target, { tween: m.reduced }, time); }\n }\n });\n },\n setTimeScale(next: number | undefined) {\n const scale = validScale(next);\n if (disposed || scale === timeScale) return;\n const time = options.now();\n sample(time);\n // Rebase running animations so their generator time stays continuous.\n for (const state of channels.values()) {\n if (state.animation) state.animation.start = time - (time - state.animation.start) * timeScale / scale;\n }\n timeScale = scale;\n },\n /** New constants apply to transitions started from now on; running ones keep their curves. */\n setConstants(next: NotificationCenterMotionConstants) { m = next; },\n get constants() { return m; },\n get reduced() { return reduced; },\n /** True while a frame is scheduled; a center at rest never keeps a RAF loop. */\n get running() { return frame !== null; },\n dispose() {\n if (disposed) return;\n disposed = true;\n if (frame !== null) options.cancelFrame(frame);\n frame = null;\n groups.clear();\n channels.clear();\n },\n };\n}\n\nexport type CenterMotion = ReturnType<typeof createCenterMotion>;\n"],"mappings":";;AAIA,IAAMC,KAAY,GAAmB,IAAO,MAAM,IAAI,KAAK,KAAKC,IAAYC,CAAI,GAOnEC,IAAmD;CAE9D,MAAM;EAAE,WAAW;EAAK,SAASH,EAAS,GAAG;EAAG,MAAM;CAAE;CAExD,OAAO;EAAE,WAAW;EAAK,SAASA,EAAS,GAAG;EAAG,MAAM;CAAE;CAEzD,QAAQ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Q,EAAE,OAAOF,EAAE,QAAQ,GAAGQ,CAAI;GAEvG,CAAC;EACH;EACA,aAAa,GAA0B;GACrC,IAAMzB,IAAQO,EAAWmB,CAAI;GAC7B,IAAIb,KAAYb,MAAUgB,GAAW;GACrC,IAAMS,IAAOV,EAAQ,IAAI;GACzB,EAAOU,CAAI;GAEX,KAAK,IAAMN,KAASV,EAAS,OAAO,GAClC,AAAIU,EAAM,cAAW,EAAM,UAAU,QAAQM,KAAQA,IAAON,EAAM,UAAU,SAASH,IAAYhB;GAEnG,IAAYA;EACd;EAEA,aAAa,GAAyC;GAAE,IAAI0B;EAAM;EAClE,IAAI,YAAY;GAAE,OAAOT;EAAG;EAC5B,IAAI,UAAU;GAAE,OAAOH;EAAS;EAEhC,IAAI,UAAU;GAAE,OAAOF,MAAU;EAAM;EACvC,UAAU;GACR,AAAIC,MACJ,IAAW,IACPD,MAAU,QAAMG,EAAQ,YAAYH,CAAK,GAC7C,IAAQ,MACRF,EAAO,MAAM,GACbD,EAAS,MAAM;EACjB;CACF;AACF"}
@@ -0,0 +1,15 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { NotificationCenterLabels, NotificationCenterOpenOptions, NotificationCenterProps, UseNotificationCenterResult } from '../center-react.js';
3
+ export declare const defaultCenterLabels: NotificationCenterLabels;
4
+ /**
5
+ * The center's open state and the props of the app's buttons that open and close it: uncontrolled
6
+ * (`defaultOpen`) or controlled (`open` with `onOpenChange`).
7
+ */
8
+ export declare function useNotificationCenter(options?: NotificationCenterOpenOptions): UseNotificationCenterResult;
9
+ /**
10
+ * The notification center's panel. Mount it once, anywhere under the app; it portals itself. Its
11
+ * open state comes from `center` (`useNotificationCenter()`), else from its own `open`,
12
+ * `defaultOpen` and `onOpenChange`.
13
+ */
14
+ export declare function NotificationCenter(props: NotificationCenterProps): ReactElement | null;
15
+ //# sourceMappingURL=center.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"center.d.ts","sourceRoot":"","sources":["../../src/react/center.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiC,YAAY,EAAwB,MAAM,OAAO,CAAC;AAE/F,OAAO,KAAK,EACV,wBAAwB,EAAE,6BAA6B,EAA0B,uBAAuB,EACxG,2BAA2B,EAC5B,MAAM,oBAAoB,CAAC;AA2E5B,eAAO,MAAM,mBAAmB,EAAE,wBAOjC,CAAC;AAsGF;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,CAAC,EAAE,6BAA6B,GAAG,2BAA2B,CAiC1G;AAMD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,GAAG,YAAY,GAAG,IAAI,CAgBtF"}