@cloudlet/toast 1.0.0-rc.3 → 1.1.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.
- package/CHANGELOG.md +84 -16
- package/README.md +7 -5
- package/dist/contracts/controller.d.ts +7 -2
- package/dist/contracts/controller.d.ts.map +1 -1
- package/dist/contracts/events.d.ts +1 -1
- package/dist/contracts/events.d.ts.map +1 -1
- package/dist/contracts/internal.d.ts +23 -0
- package/dist/contracts/internal.d.ts.map +1 -1
- package/dist/contracts/notifications.d.ts +38 -6
- package/dist/contracts/notifications.d.ts.map +1 -1
- package/dist/contracts/snapshots.d.ts +3 -1
- package/dist/contracts/snapshots.d.ts.map +1 -1
- package/dist/core/bridge.d.ts +5 -0
- package/dist/core/bridge.d.ts.map +1 -0
- package/dist/core/bridge.js +345 -0
- package/dist/core/bridge.js.map +1 -0
- package/dist/core/controller.d.ts +122 -3
- package/dist/core/controller.d.ts.map +1 -1
- package/dist/core/controller.js +400 -541
- package/dist/core/controller.js.map +1 -1
- package/dist/core/validation.d.ts.map +1 -1
- package/dist/core/validation.js +181 -89
- package/dist/core/validation.js.map +1 -1
- package/dist/react/announcer.d.ts.map +1 -1
- package/dist/react/announcer.js +29 -23
- package/dist/react/announcer.js.map +1 -1
- package/dist/react/bindings.d.ts +9 -0
- package/dist/react/bindings.d.ts.map +1 -1
- package/dist/react/bindings.js +32 -69
- package/dist/react/bindings.js.map +1 -1
- package/dist/react/card.d.ts +5 -3
- package/dist/react/card.d.ts.map +1 -1
- package/dist/react/card.js +146 -34
- package/dist/react/card.js.map +1 -1
- package/dist/react/generators.d.ts +2 -2
- package/dist/react/generators.js.map +1 -1
- package/dist/react/gestures.js.map +1 -1
- package/dist/react/host.d.ts.map +1 -1
- package/dist/react/host.js +9 -5
- package/dist/react/host.js.map +1 -1
- package/dist/react/motion.d.ts +3 -3
- package/dist/react/motion.js.map +1 -1
- package/dist/react/plan.d.ts +1 -1
- package/dist/react/plan.d.ts.map +1 -1
- package/dist/react/plan.js +1 -0
- package/dist/react/plan.js.map +1 -1
- package/dist/react/renderer.d.ts +7 -0
- package/dist/react/renderer.d.ts.map +1 -0
- package/dist/react/renderer.js +62 -0
- package/dist/react/renderer.js.map +1 -0
- package/dist/react.d.ts +7 -5
- package/dist/react.d.ts.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +4 -2
- package/src/contracts/controller.ts +7 -2
- package/src/contracts/events.ts +2 -1
- package/src/contracts/internal.ts +20 -0
- package/src/contracts/notifications.ts +45 -6
- package/src/contracts/snapshots.ts +3 -0
- package/src/core/bridge.ts +336 -0
- package/src/core/controller.ts +118 -271
- package/src/core/validation.ts +49 -4
- package/src/react/announcer.ts +9 -0
- package/src/react/bindings.tsx +28 -72
- package/src/react/card.tsx +92 -9
- package/src/react/generators.ts +2 -2
- package/src/react/gestures.ts +1 -1
- package/src/react/host.tsx +22 -7
- package/src/react/motion.ts +4 -4
- package/src/react/plan.ts +4 -3
- package/src/react/renderer.tsx +77 -0
- package/src/react.ts +7 -5
package/dist/react/motion.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"motion.js","names":["tweenGenerator","tween","MOTION","tunable","positive","resolveMotion","overrides","valid","value","key","result","base","override","fields","field","channelKeys","spatial","initial","swaps","m","validScale","createShellMotion","values","groups","frame","disposed","measured","reduced","options","timeScale","slideDirection","slideWidth","active","keys","output","write","sample","state","animation","elapsed","time","next","schedule","tick","complete","name","group","jump","to","target","spec","tween","spring","after","done","request","change","enterSpring","exitSpring","badgeSpring","tween$1","duration","remaining","t","end","swap","incoming","outgoing","inMs","outMs","layer","incomingOnly","tails","index","slot","opacity","start","from","depth","delay","tailKeys","mode","delta","dx","dy","edge","offset","scale","fling","previousDepth","direction","width","channel","velocity","immediate"],"sources":["../../src/react/motion.ts"],"sourcesContent":["import type { CloudletMotionConstants, CloudletMotionOverrides } from '../react.js';\nimport { spring, tween as tweenGenerator } from './generators.js';\nimport type { Generator } from './generators.js';\n\n/**\n * Values of DESIGN §7 accepted by the owner on the laboratory (task 17, D47), the one place\n * to tune them. Durations are milliseconds at `timeScale: 1`; offsets are CSS px.\n */\nexport const MOTION = {\n /** First pill of an empty stack: scale and translateY on the spring, opacity on a `fade` ms tween (it grows, not fades). */\n enter: { duration: 200, bounce: 0.25, scale: 0.25, offset: 1, fade: 160 },\n /** Exit of the last record or of the dismissed top pill: the reverse of entering (same scale and offset). */\n exit: { duration: 300, bounce: 0 },\n /** Shape springs: opening, and collapsing or adjusting to new content. */\n shapeOpen: { stiffness: 900, damping: 60, mass: 2 },\n shapeClose: { stiffness: 900, damping: 45, mass: 1 },\n /** Tails retract in the first 150 ms of opening and return in the last 150 ms of collapsing. */\n tails: 150,\n /** Close button, body and indicator: delayed fade + 4 px on open, 70 ms fade on collapse. */\n chromeDelay: 100, chromeIn: 200, chromeOut: 70, chromeOffset: 4,\n /** Title and icon blur swap: outgoing 0→6 px and 1→0, incoming 6→0 px and 0→1. */\n headerOut: 200, headerIn: 260, blur: 6,\n /** Body crossfade: outgoing opacity, incoming opacity + translateY 4→0; a stream of updates (progress) crossfades once, then changes in place. */\n bodyOut: 120, bodyIn: 200, bodyOffset: 4, bodyQuiet: 600,\n /** Horizontal slide of the body between notifications (the heading blur-swaps in place); swipes release with it. */\n slide: { stiffness: 1200, damping: 60, mass: 1 },\n /** Badge presence (scale .6↔1, opacity), badge number and indicator text blur swap. */\n badge: { duration: 200, bounce: 0, scale: 0.6 }, countSwap: 160,\n /** Numeric progress value tween. */\n progress: 1000,\n /** Hover spreads the tails by 2 px per step. */\n hover: 200, hoverLift: 2,\n /** Reduced motion: every transition becomes an opacity change of this length; swipes are off. */\n reduced: 80,\n /**\n * Swipes (DESIGN §2–§3): the axis is decided after `intent` px; a release commits past\n * `distance` of the swiped dimension, or after `minDistance` px with `velocity` px/ms\n * towards the commit (a flick back cancels). Edges resist with the rubber-band\n * coefficient; a trackpad swipe ends after `wheelIdle` ms without wheel events and commits\n * as soon as its release would; for `wheelLock` ms after that the same stream cannot commit\n * again (one gesture keeps accelerating), later only a faster or reversed delta starts a new swipe.\n * Released offsets spring home with the `slide` spring and the release velocity.\n * Collapsing towards the screen edge has little room: it also commits after `edge` px.\n */\n swipe: { intent: 8, distance: 0.3, minDistance: 24, velocity: 0.5, edge: 32, rubberBand: 0.55, wheelIdle: 140, wheelLock: 400, suppressClick: 500 },\n} as const;\n\n/** The tunable part of MOTION: everything but the swipe thresholds. */\nconst tunable: CloudletMotionConstants = MOTION;\nconst positive = new Set(['stiffness', 'mass']);\n\n/**\n * Resolves `ToasterMotion.overrides` (a debugging channel, DESIGN §7) onto the starting\n * values. A field that is not a finite number in range (springs: stiffness and mass > 0,\n * everything else ≥ 0) keeps its default; unknown keys are ignored.\n */\nexport function resolveMotion(overrides: CloudletMotionOverrides | undefined): CloudletMotionConstants {\n if (!overrides || typeof overrides !== 'object') return tunable;\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 const result: Record<string, unknown> = {};\n for (const [key, base] of Object.entries(tunable) as [string, unknown][]) {\n if (key === 'swipe') continue;\n const override = (overrides as Record<string, unknown>)[key];\n if (typeof base === 'number') result[key] = valid(key, override) ? override : base;\n else {\n const fields = { ...(base as Record<string, number>) };\n if (override && typeof override === 'object') {\n for (const field of Object.keys(fields)) {\n const value = (override as Record<string, unknown>)[field];\n if (valid(field, value)) fields[field] = value;\n }\n }\n result[key] = fields;\n }\n }\n return result as unknown as CloudletMotionConstants;\n}\n\nconst channelKeys = [\n 'opacity', 'scale', 'y', 'width', 'height', 'radius',\n 'tail1', 'tail1Opacity', 'tail2', 'tail2Opacity', 'lift', 'badge',\n 'chrome', 'chromeOut', 'headerIn', 'headerOut', 'bodyIn', 'bodyOut',\n 'slide', 'slideIn', 'slideOut', 'badgeIn', 'badgeOut', 'pageIn', 'pageOut',\n 'progress', 'exitOpacity', 'exitScale', 'exitY', 'exitX', 'headX', 'headY', 'dragX', 'dragY',\n] as const;\nexport type Channel = typeof channelKeys[number];\n/** Spatial channels jump under reduced motion; every other channel fades for MOTION.reduced. */\nconst spatial = new Set<Channel>(['scale', 'y', 'width', 'height', 'radius', 'tail1', 'tail2', 'lift', 'slide', 'progress',\n 'exitScale', 'exitY', 'exitX', 'headX', 'headY', 'dragX', 'dragY']);\nconst initial: Partial<Record<Channel, number>> = { scale: 1, headerIn: 1, bodyIn: 1, slideIn: 1, badgeIn: 1, pageIn: 1, exitScale: 1 };\n\nexport type ShellFrame = Readonly<Record<Channel, number>> & {\n readonly reduced: boolean;\n /** +1 when the incoming slide arrives from the inline end, −1 from the start. */\n readonly slideDirection: number;\n readonly slideWidth: number;\n};\nexport type SwapLayer = 'header' | 'body' | 'badge' | 'page';\nexport type ShapeMode = 'open' | 'close' | 'instant';\nexport interface ShellGeometry { readonly width: number; readonly height: number; readonly radius: number }\n/** Channels a finger moves directly: the pill or Island (`dragX`, `dragY`) and the Island content (`slide`). */\nexport type DragChannel = 'dragX' | 'dragY' | 'slide';\n/** A swipe-dismissed pill keeps flying sideways from where the finger released it. */\nexport interface Fling { readonly direction: 1 | -1; readonly distance: number; readonly velocity: number }\n\ninterface ShellMotionOptions {\n readonly now: () => number;\n readonly requestFrame: (callback: (time: number) => void) => number;\n readonly cancelFrame: (frame: number) => void;\n /** The sole DOM writer: scoped CSSOM rules and SVG attributes, never a style attribute. */\n readonly write: (frame: ShellFrame) => void;\n readonly reducedMotion?: boolean;\n readonly timeScale?: number | undefined;\n /** Resolved constants (`resolveMotion`); MOTION when omitted. */\n readonly constants?: CloudletMotionConstants | undefined;\n}\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; delay: number } | null;\n}\n\nconst swaps = (m: CloudletMotionConstants): Record<SwapLayer | 'chrome', readonly [Channel, Channel, number, number]> => ({\n header: ['headerIn', 'headerOut', m.headerIn, m.headerOut],\n body: ['bodyIn', 'bodyOut', m.bodyIn, m.bodyOut],\n badge: ['badgeIn', 'badgeOut', m.countSwap, m.countSwap],\n page: ['pageIn', 'pageOut', m.countSwap, m.countSwap],\n chrome: ['chrome', 'chromeOut', m.chromeIn, m.chromeOut],\n});\nconst validScale = (value: number | undefined) => typeof value === 'number' && Number.isFinite(value) && value > 0 ? value : 1;\n\n/**\n * One RAF sampler per host over the generators of generators.ts (the numeric part of\n * Motion 14.3.0, frame-exact by the reference test): next() takes milliseconds,\n * velocity() returns the analytical units/s derivative accepted by the next\n * physical spring, so every retarget starts from the current value and speed.\n * Time-defined springs (duration/bounce) intentionally ignore velocity there.\n * `timeScale` stretches generator time for every channel at once. Nothing is\n * scheduled while idle; completion callbacks run only for the latest request\n * of their group and never synchronously.\n */\nexport function createShellMotion(options: ShellMotionOptions) {\n const values = Object.fromEntries(channelKeys.map(key => {\n const value = initial[key] ?? 0;\n return [key, { value, target: value, velocity: 0, animation: null } satisfies ChannelState];\n })) as Record<Channel, ChannelState>;\n const groups = new Map<string, { keys: readonly Channel[]; done: () => void }>();\n let frame: number | null = null;\n let disposed = false;\n let measured = false;\n let reduced = options.reducedMotion ?? false;\n let timeScale = validScale(options.timeScale);\n // Read at the start of every transition: new values apply live, running ones finish as started.\n let m = options.constants ?? tunable;\n let slideDirection = 1;\n let slideWidth = 0;\n\n const active = (keys: readonly Channel[]) => keys.some(key => values[key].animation !== null);\n const output = (): ShellFrame => {\n const result = { reduced, slideDirection, slideWidth } as Record<string, number | boolean>;\n for (const key of channelKeys) result[key] = values[key].value;\n return result as unknown as ShellFrame;\n };\n const write = () => { if (measured && !disposed) options.write(output()); };\n function sample(time: number) {\n for (const key of channelKeys) {\n const state = values[key];\n const animation = state.animation;\n if (!animation) continue;\n const elapsed = Math.max(0, (time - animation.start) * timeScale - animation.delay);\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 }\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 || active(group.keys)) continue;\n // Clear before invoking: completion can synchronously retarget or dispose.\n groups.delete(name);\n group.done();\n }\n }\n function tick(time: number) {\n frame = null;\n if (disposed) return;\n sample(time);\n write();\n complete();\n if (active(channelKeys)) schedule();\n }\n function jump(key: Channel, value: number) {\n const state = values[key];\n state.value = state.target = value;\n state.velocity = 0;\n state.animation = null;\n }\n function to(key: Channel, target: number, spec: Spec, time: number, delay = 0) {\n const state = values[key];\n if (reduced) {\n if (spatial.has(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 };\n }\n function after(name: string, keys: readonly Channel[], done?: () => void) {\n if (done) groups.set(name, { keys, done }); else groups.delete(name);\n }\n /** Shared entry for every public request: sample now, mutate, write the first frame, schedule. */\n function request(change: (time: number) => void) {\n if (disposed) return;\n const time = options.now();\n sample(time);\n change(time);\n write();\n // Completions are always delivered from a frame, never synchronously.\n if (groups.size || active(channelKeys)) 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 const badgeSpring = () => ({ duration: m.badge.duration, bounce: m.badge.bounce });\n const tween = (duration: number) => ({ tween: duration });\n\n /** Visual settle time of a running channel in real milliseconds (bounded, includes a pending delay). */\n function remaining(key: Channel, time: number): number {\n const animation = values[key].animation;\n if (!animation) return 0;\n const target = values[key].target;\n const elapsed = (time - animation.start) * timeScale - animation.delay;\n let t = Math.max(0, elapsed);\n for (const end = t + 2000; t < end; t += 8) {\n const next = animation.generator.next(t);\n if (next.done || Math.abs(next.value - target) < 0.5) break;\n }\n // Generators keep mutable iterator state: resample the current time.\n animation.generator.next(Math.max(0, elapsed));\n return (t - elapsed) / timeScale;\n }\n function swap(layer: SwapLayer | 'chrome', time: number, done?: () => void, incomingOnly = false) {\n const [incoming, outgoing, inMs, outMs] = swaps(m)[layer];\n // The live layer was just cloned: the snapshot continues from its current look.\n jump(outgoing, incomingOnly ? 0 : values[incoming].value);\n jump(incoming, 0);\n to(outgoing, 0, tween(outMs), time);\n to(incoming, 1, tween(inMs), time, layer === 'chrome' ? m.chromeDelay : 0);\n after(layer, [incoming, outgoing], done);\n }\n function tails(depth: number, time: number, spec: Spec, delay: number, from?: (index: number) => { slot?: number; opacity?: number }) {\n for (const index of [1, 2] as const) {\n const slot = `tail${index}` as const;\n const opacity = `tail${index}Opacity` as const;\n const start = from?.(index);\n if (start?.slot !== undefined) jump(slot, start.slot);\n if (start?.opacity !== undefined) jump(opacity, start.opacity);\n if (index <= depth) {\n to(slot, index, spec, time, delay);\n to(opacity, 1, 'tween' in spec ? spec : tween(m.tails), time, delay);\n } else to(opacity, 0, tween(m.tails), time);\n }\n }\n const tailKeys: readonly Channel[] = ['tail1', 'tail1Opacity', 'tail2', 'tail2Opacity', 'badge'];\n\n return {\n /** Target geometry measured from HTML; the first measurement and `instant` never animate. */\n setShape(target: ShellGeometry, mode: ShapeMode) {\n request(time => {\n const spec = mode === 'open' ? m.shapeOpen : m.shapeClose;\n for (const key of ['width', 'height', 'radius'] as const) {\n if (!measured || mode === 'instant') jump(key, target[key]);\n else if (values[key].target !== target[key]) to(key, target[key], spec, time);\n }\n measured = true;\n });\n },\n /**\n * The title and icon are the same nodes in both states, so a morph moves them\n * (FLIP): the layout jump is cancelled and springs back with the shape. Text never scales.\n */\n shiftHeading(dx: number, dy: number, mode: ShapeMode) {\n request(time => {\n const spec = mode === 'open' ? m.shapeOpen : m.shapeClose;\n for (const [key, delta] of [['headX', dx], ['headY', dy]] as const) {\n if (!Number.isFinite(delta) || Math.abs(delta) < 0.5) continue;\n values[key].value += delta;\n to(key, 0, spec, time);\n }\n });\n },\n /** The first pill: opacity 0→1 (tween), scale and translateY from the edge on the enter spring. */\n enter(edge: -1 | 1, done?: () => void) {\n request(time => {\n jump('opacity', 0); jump('scale', m.enter.scale); jump('y', edge * m.enter.offset);\n // The shell becomes opaque within `fade`; only scale and y follow the spring (D47).\n to('opacity', 1, tween(m.enter.fade), time);\n for (const key of ['scale', 'y'] as const) to(key, key === 'y' ? 0 : 1, enterSpring(), time);\n after('presence', ['opacity', 'scale', 'y'], done);\n });\n },\n /** The first tail moves up into the pill's place after the top pill was dismissed. */\n rise(offset: number, scale: number, done?: () => void) {\n request(time => {\n jump('y', offset); jump('scale', scale);\n to('y', 0, enterSpring(), time); to('scale', 1, enterSpring(), time); to('opacity', 1, enterSpring(), time);\n after('presence', ['opacity', 'scale', 'y'], done);\n });\n },\n /**\n * The exit layer leaves from the shell's current presence; the shell itself is free again.\n * With a fling (swipe dismiss) the snapshot continues sideways with the release velocity\n * (px/s) instead of falling back to the edge, and the live shell returns to the centre.\n */\n exit(edge: -1 | 1, done?: () => void, fling?: Fling) {\n request(time => {\n jump('exitOpacity', values.opacity.value); jump('exitScale', values.scale.value);\n jump('exitY', values.y.value + values.dragY.value); jump('exitX', fling ? values.dragX.value : 0);\n to('exitOpacity', 0, exitSpring(), time);\n if (fling) {\n values.exitX.velocity = fling.velocity;\n to('exitX', fling.direction * fling.distance, m.slide, time);\n } else {\n to('exitScale', m.enter.scale, exitSpring(), time);\n to('exitY', edge * m.enter.offset, exitSpring(), time);\n }\n jump('dragX', 0); jump('dragY', 0);\n after('exit', ['exitOpacity', 'exitScale', 'exitY', 'exitX'], done);\n });\n },\n /** Hides the live shell at once (its look moved to the exit layer). */\n hide() { request(() => jump('opacity', 0)); },\n /**\n * Collapsed stack depth (0–2 tails). `arrival`: tails shift back from the pill;\n * `rise`: they move up one step; `settle`: spring to their slots in place.\n */\n setTails(depth: number, change: 'arrival' | 'rise' | 'settle', previousDepth: number, done?: () => void) {\n request(time => {\n if (change === 'settle') tails(depth, time, enterSpring(), 0);\n else tails(depth, time, enterSpring(), 0, index => {\n if (index > depth) return { opacity: 0 };\n if (change === 'arrival') return { slot: index - 1, opacity: 1 };\n return { slot: index + 1, opacity: index + 1 <= previousDepth ? 1 : 0 };\n });\n after('tails', tailKeys, done);\n });\n },\n setBadge(visible: boolean) { request(time => to('badge', visible ? 1 : 0, badgeSpring(), time)); },\n /** True while the layer's incoming side is still fading in: a further update joins it instead of restarting. */\n swapping(layer: SwapLayer): boolean { return !!values[swaps(m)[layer][0]].animation; },\n /** The sampler's clock (real ms), so the host's update timing follows the same source. */\n now(): number { return options.now(); },\n /** Opening: tails and badge leave in 150 ms; close, body and indicator appear after 100 ms. */\n open(done?: () => void) {\n request(time => {\n for (const index of [1, 2] as const) { to(`tail${index}`, 0, tween(m.tails), time); to(`tail${index}Opacity`, 0, tween(m.tails), time); }\n to('badge', 0, tween(m.tails), time);\n jump('chromeOut', 0);\n jump('chrome', 0);\n to('chrome', 1, tween(m.chromeIn), time, m.chromeDelay);\n after('tails', tailKeys, done);\n });\n },\n /**\n * Collapsing: the chrome snapshot fades in 70 ms while the shape springs back;\n * tails and badge return during the last 150 ms of the shape spring.\n */\n collapse(depth: number, badge: boolean, done?: { chrome?: () => void; tails?: () => void }) {\n request(time => {\n jump('chrome', 0);\n jump('chromeOut', 1);\n to('chromeOut', 0, tween(m.chromeOut), time);\n after('chrome', ['chromeOut'], done?.chrome);\n const delay = Math.max(0, Math.max(remaining('width', time), remaining('height', time)) - m.tails) * timeScale;\n tails(depth, time, tween(m.tails), delay, () => ({ slot: 0, opacity: 0 }));\n to('badge', badge ? 1 : 0, tween(m.tails), time, delay);\n after('tails', tailKeys, done?.tails);\n });\n },\n /** One outgoing snapshot per layer: a new swap restarts from the live layer's current look. */\n swap(layer: SwapLayer, done?: () => void, incomingOnly = false) {\n request(time => swap(layer, time, done, incomingOnly));\n },\n /** Slide inside a fixed shell. The outgoing snapshot follows the incoming layer one width behind. */\n slide(direction: 1 | -1, width: number, done?: () => void) {\n request(time => {\n if (reduced) {\n jump('slide', 0);\n jump('slideOut', 1); jump('slideIn', 0);\n to('slideOut', 0, tween(m.reduced), time); to('slideIn', 1, tween(m.reduced), time);\n } else {\n jump('slideOut', 1); jump('slideIn', 1);\n // Keep the strip continuous and its velocity when a slide interrupts a slide.\n const state = values.slide;\n state.value += direction * width;\n to('slide', 0, m.slide, time);\n }\n slideDirection = direction;\n slideWidth = width;\n after('slide', ['slide', 'slideIn', 'slideOut'], done);\n });\n },\n /** The finger owns the channel: no spring, no velocity until `release`. */\n drag(channel: DragChannel, value: number) {\n request(() => { if (Number.isFinite(value)) jump(channel, value); });\n },\n /**\n * The finger lets go: the channel springs home (0) with the release velocity in px/s.\n * A committed navigation instead keeps the offset and velocity and calls `slide`.\n */\n release(channel: DragChannel, velocity: number, done?: () => void) {\n request(time => {\n values[channel].velocity = Number.isFinite(velocity) ? velocity : 0;\n to(channel, 0, m.slide, time);\n after(`release:${channel}`, [channel], done);\n });\n },\n /** Sets the speed a following `slide` starts with (a swipe released towards a neighbour). */\n fling(channel: DragChannel, velocity: number) {\n if (!disposed && !values[channel].animation) values[channel].velocity = Number.isFinite(velocity) ? velocity : 0;\n },\n setProgress(value: number | null, immediate: boolean) {\n request(time => { if (value === null || immediate) jump('progress', value ?? 0); else to('progress', value, tween(m.progress), time); });\n },\n setHover(active: boolean) { request(time => to('lift', active ? 1 : 0, tween(m.hover), time)); },\n setReducedMotion(next: boolean) {\n if (disposed || reduced === next) return;\n request(time => {\n reduced = next;\n if (!reduced) return;\n for (const key of channelKeys) {\n const state = values[key];\n if (!state.animation) continue;\n if (spatial.has(key)) 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 key of channelKeys) {\n const animation = values[key].animation;\n if (animation) animation.start = time - (time - 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: CloudletMotionConstants) { m = next; },\n /** The constants in effect (the renderer reads offsets and blur from them). */\n get constants() { return m; },\n /** True while a frame is scheduled; an idle host 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 for (const key of channelKeys) values[key].animation = null;\n },\n };\n}\n\nexport type ShellMotion = ReturnType<typeof createShellMotion>;\n"],"mappings":";;AAQA,IAAaE,IAAS;CAEpB,OAAO;EAAE,UAAU;EAAK,QAAQ;EAAM,OAAO;EAAM,QAAQ;EAAG,MAAM;CAAI;CAExE,MAAM;EAAE,UAAU;EAAK,QAAQ;CAAE;CAEjC,WAAW;EAAE,WAAW;EAAK,SAAS;EAAI,MAAM;CAAE;CAClD,YAAY;EAAE,WAAW;EAAK,SAAS;EAAI,MAAM;CAAE;CAEnD,OAAO;CAEP,aAAa;CAAK,UAAU;CAAK,WAAW;CAAI,cAAc;CAE9D,WAAW;CAAK,UAAU;CAAK,MAAM;CAErC,SAAS;CAAK,QAAQ;CAAK,YAAY;CAAG,WAAW;CAErD,OAAO;EAAE,WAAW;EAAM,SAAS;EAAI,MAAM;CAAE;CAE/C,OAAO;EAAE,UAAU;EAAK,QAAQ;EAAG,OAAO;CAAI;CAAG,WAAW;CAE5D,UAAU;CAEV,OAAO;CAAK,WAAW;CAEvB,SAAS;CAWT,OAAO;EAAE,QAAQ;EAAG,UAAU;EAAK,aAAa;EAAI,UAAU;EAAK,MAAM;EAAI,YAAY;EAAM,WAAW;EAAK,WAAW;EAAK,eAAe;CAAI;AACpJ,GAGMC,IAAmCD,GACn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5C;EAKb;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"motion.js","names":["tweenGenerator","tween","MOTION","tunable","positive","resolveMotion","overrides","valid","value","key","result","base","override","fields","field","channelKeys","spatial","initial","swaps","m","validScale","createShellMotion","values","groups","frame","disposed","measured","reduced","options","timeScale","slideDirection","slideWidth","active","keys","output","write","sample","state","animation","elapsed","time","next","schedule","tick","complete","name","group","jump","to","target","spec","tween","spring","after","done","request","change","enterSpring","exitSpring","badgeSpring","tween$1","duration","remaining","t","end","swap","incoming","outgoing","inMs","outMs","layer","incomingOnly","tails","index","slot","opacity","start","from","depth","delay","tailKeys","mode","delta","dx","dy","edge","offset","scale","fling","previousDepth","direction","width","channel","velocity","immediate"],"sources":["../../src/react/motion.ts"],"sourcesContent":["import type { CloudletMotionConstants, CloudletMotionOverrides } from '../react.js';\nimport { spring, tween as tweenGenerator } from './generators.js';\nimport type { Generator } from './generators.js';\n\n/**\n * Values tuned on the laboratory, the one place\n * to tune them. Durations are milliseconds at `timeScale: 1`; offsets are CSS px.\n */\nexport const MOTION = {\n /** First pill of an empty stack: scale and translateY on the spring, opacity on a `fade` ms tween (it grows, not fades). */\n enter: { duration: 200, bounce: 0.25, scale: 0.25, offset: 1, fade: 160 },\n /** Exit of the last record or of the dismissed top pill: the reverse of entering (same scale and offset). */\n exit: { duration: 300, bounce: 0 },\n /** Shape springs: opening, and collapsing or adjusting to new content. */\n shapeOpen: { stiffness: 900, damping: 60, mass: 2 },\n shapeClose: { stiffness: 900, damping: 45, mass: 1 },\n /** Tails retract in the first 150 ms of opening and return in the last 150 ms of collapsing. */\n tails: 150,\n /** Close button, body and indicator: delayed fade + 4 px on open, 70 ms fade on collapse. */\n chromeDelay: 100, chromeIn: 200, chromeOut: 70, chromeOffset: 4,\n /** Title and icon blur swap: outgoing 0→6 px and 1→0, incoming 6→0 px and 0→1. */\n headerOut: 200, headerIn: 260, blur: 6,\n /** Body crossfade: outgoing opacity, incoming opacity + translateY 4→0; a stream of updates (progress) crossfades once, then changes in place. */\n bodyOut: 120, bodyIn: 200, bodyOffset: 4, bodyQuiet: 600,\n /** Horizontal slide of the body between notifications (the heading blur-swaps in place); swipes release with it. */\n slide: { stiffness: 1200, damping: 60, mass: 1 },\n /** Badge presence (scale .6↔1, opacity), badge number and indicator text blur swap. */\n badge: { duration: 200, bounce: 0, scale: 0.6 }, countSwap: 160,\n /** Numeric progress value tween. */\n progress: 1000,\n /** Hover spreads the tails by 2 px per step. */\n hover: 200, hoverLift: 2,\n /** Reduced motion: every transition becomes an opacity change of this length; swipes are off. */\n reduced: 80,\n /**\n * Swipes: the axis is decided after `intent` px; a release commits past\n * `distance` of the swiped dimension, or after `minDistance` px with `velocity` px/ms\n * towards the commit (a flick back cancels). Edges resist with the rubber-band\n * coefficient; a trackpad swipe ends after `wheelIdle` ms without wheel events and commits\n * as soon as its release would; for `wheelLock` ms after that the same stream cannot commit\n * again (one gesture keeps accelerating), later only a faster or reversed delta starts a new swipe.\n * Released offsets spring home with the `slide` spring and the release velocity.\n * Collapsing towards the screen edge has little room: it also commits after `edge` px.\n */\n swipe: { intent: 8, distance: 0.3, minDistance: 24, velocity: 0.5, edge: 32, rubberBand: 0.55, wheelIdle: 140, wheelLock: 400, suppressClick: 500 },\n} as const;\n\n/** The tunable part of MOTION: everything but the swipe thresholds. */\nconst tunable: CloudletMotionConstants = MOTION;\nconst positive = new Set(['stiffness', 'mass']);\n\n/**\n * Resolves `ToasterMotion.overrides` (a debugging channel) onto the starting\n * values. A field that is not a finite number in range (springs: stiffness and mass > 0,\n * everything else ≥ 0) keeps its default; unknown keys are ignored.\n */\nexport function resolveMotion(overrides: CloudletMotionOverrides | undefined): CloudletMotionConstants {\n if (!overrides || typeof overrides !== 'object') return tunable;\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 const result: Record<string, unknown> = {};\n for (const [key, base] of Object.entries(tunable) as [string, unknown][]) {\n if (key === 'swipe') continue;\n const override = (overrides as Record<string, unknown>)[key];\n if (typeof base === 'number') result[key] = valid(key, override) ? override : base;\n else {\n const fields = { ...(base as Record<string, number>) };\n if (override && typeof override === 'object') {\n for (const field of Object.keys(fields)) {\n const value = (override as Record<string, unknown>)[field];\n if (valid(field, value)) fields[field] = value;\n }\n }\n result[key] = fields;\n }\n }\n return result as unknown as CloudletMotionConstants;\n}\n\nconst channelKeys = [\n 'opacity', 'scale', 'y', 'width', 'height', 'radius',\n 'tail1', 'tail1Opacity', 'tail2', 'tail2Opacity', 'lift', 'badge',\n 'chrome', 'chromeOut', 'headerIn', 'headerOut', 'bodyIn', 'bodyOut',\n 'slide', 'slideIn', 'slideOut', 'badgeIn', 'badgeOut', 'pageIn', 'pageOut',\n 'progress', 'exitOpacity', 'exitScale', 'exitY', 'exitX', 'headX', 'headY', 'dragX', 'dragY',\n] as const;\nexport type Channel = typeof channelKeys[number];\n/** Spatial channels jump under reduced motion; every other channel fades for MOTION.reduced. */\nconst spatial = new Set<Channel>(['scale', 'y', 'width', 'height', 'radius', 'tail1', 'tail2', 'lift', 'slide', 'progress',\n 'exitScale', 'exitY', 'exitX', 'headX', 'headY', 'dragX', 'dragY']);\nconst initial: Partial<Record<Channel, number>> = { scale: 1, headerIn: 1, bodyIn: 1, slideIn: 1, badgeIn: 1, pageIn: 1, exitScale: 1 };\n\nexport type ShellFrame = Readonly<Record<Channel, number>> & {\n readonly reduced: boolean;\n /** +1 when the incoming slide arrives from the inline end, −1 from the start. */\n readonly slideDirection: number;\n readonly slideWidth: number;\n};\nexport type SwapLayer = 'header' | 'body' | 'badge' | 'page';\nexport type ShapeMode = 'open' | 'close' | 'instant';\nexport interface ShellGeometry { readonly width: number; readonly height: number; readonly radius: number }\n/** Channels a finger moves directly: the pill or Island (`dragX`, `dragY`) and the Island content (`slide`). */\nexport type DragChannel = 'dragX' | 'dragY' | 'slide';\n/** A swipe-dismissed pill keeps flying sideways from where the finger released it. */\nexport interface Fling { readonly direction: 1 | -1; readonly distance: number; readonly velocity: number }\n\ninterface ShellMotionOptions {\n readonly now: () => number;\n readonly requestFrame: (callback: (time: number) => void) => number;\n readonly cancelFrame: (frame: number) => void;\n /** The sole DOM writer: scoped CSSOM rules and SVG attributes, never a style attribute. */\n readonly write: (frame: ShellFrame) => void;\n readonly reducedMotion?: boolean;\n readonly timeScale?: number | undefined;\n /** Resolved constants (`resolveMotion`); MOTION when omitted. */\n readonly constants?: CloudletMotionConstants | undefined;\n}\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; delay: number } | null;\n}\n\nconst swaps = (m: CloudletMotionConstants): Record<SwapLayer | 'chrome', readonly [Channel, Channel, number, number]> => ({\n header: ['headerIn', 'headerOut', m.headerIn, m.headerOut],\n body: ['bodyIn', 'bodyOut', m.bodyIn, m.bodyOut],\n badge: ['badgeIn', 'badgeOut', m.countSwap, m.countSwap],\n page: ['pageIn', 'pageOut', m.countSwap, m.countSwap],\n chrome: ['chrome', 'chromeOut', m.chromeIn, m.chromeOut],\n});\nconst validScale = (value: number | undefined) => typeof value === 'number' && Number.isFinite(value) && value > 0 ? value : 1;\n\n/**\n * One RAF sampler per host over the generators of generators.ts (the numeric part of\n * Motion 14.3.0, frame-exact by the reference test): next() takes milliseconds,\n * velocity() returns the analytical units/s derivative accepted by the next\n * physical spring, so every retarget starts from the current value and speed.\n * Time-defined springs (duration/bounce) intentionally ignore velocity there.\n * `timeScale` stretches generator time for every channel at once. Nothing is\n * scheduled while idle; completion callbacks run only for the latest request\n * of their group and never synchronously.\n */\nexport function createShellMotion(options: ShellMotionOptions) {\n const values = Object.fromEntries(channelKeys.map(key => {\n const value = initial[key] ?? 0;\n return [key, { value, target: value, velocity: 0, animation: null } satisfies ChannelState];\n })) as Record<Channel, ChannelState>;\n const groups = new Map<string, { keys: readonly Channel[]; done: () => void }>();\n let frame: number | null = null;\n let disposed = false;\n let measured = false;\n let reduced = options.reducedMotion ?? false;\n let timeScale = validScale(options.timeScale);\n // Read at the start of every transition: new values apply live, running ones finish as started.\n let m = options.constants ?? tunable;\n let slideDirection = 1;\n let slideWidth = 0;\n\n const active = (keys: readonly Channel[]) => keys.some(key => values[key].animation !== null);\n const output = (): ShellFrame => {\n const result = { reduced, slideDirection, slideWidth } as Record<string, number | boolean>;\n for (const key of channelKeys) result[key] = values[key].value;\n return result as unknown as ShellFrame;\n };\n const write = () => { if (measured && !disposed) options.write(output()); };\n function sample(time: number) {\n for (const key of channelKeys) {\n const state = values[key];\n const animation = state.animation;\n if (!animation) continue;\n const elapsed = Math.max(0, (time - animation.start) * timeScale - animation.delay);\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 }\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 || active(group.keys)) continue;\n // Clear before invoking: completion can synchronously retarget or dispose.\n groups.delete(name);\n group.done();\n }\n }\n function tick(time: number) {\n frame = null;\n if (disposed) return;\n sample(time);\n write();\n complete();\n if (active(channelKeys)) schedule();\n }\n function jump(key: Channel, value: number) {\n const state = values[key];\n state.value = state.target = value;\n state.velocity = 0;\n state.animation = null;\n }\n function to(key: Channel, target: number, spec: Spec, time: number, delay = 0) {\n const state = values[key];\n if (reduced) {\n if (spatial.has(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 };\n }\n function after(name: string, keys: readonly Channel[], done?: () => void) {\n if (done) groups.set(name, { keys, done }); else groups.delete(name);\n }\n /** Shared entry for every public request: sample now, mutate, write the first frame, schedule. */\n function request(change: (time: number) => void) {\n if (disposed) return;\n const time = options.now();\n sample(time);\n change(time);\n write();\n // Completions are always delivered from a frame, never synchronously.\n if (groups.size || active(channelKeys)) 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 const badgeSpring = () => ({ duration: m.badge.duration, bounce: m.badge.bounce });\n const tween = (duration: number) => ({ tween: duration });\n\n /** Visual settle time of a running channel in real milliseconds (bounded, includes a pending delay). */\n function remaining(key: Channel, time: number): number {\n const animation = values[key].animation;\n if (!animation) return 0;\n const target = values[key].target;\n const elapsed = (time - animation.start) * timeScale - animation.delay;\n let t = Math.max(0, elapsed);\n for (const end = t + 2000; t < end; t += 8) {\n const next = animation.generator.next(t);\n if (next.done || Math.abs(next.value - target) < 0.5) break;\n }\n // Generators keep mutable iterator state: resample the current time.\n animation.generator.next(Math.max(0, elapsed));\n return (t - elapsed) / timeScale;\n }\n function swap(layer: SwapLayer | 'chrome', time: number, done?: () => void, incomingOnly = false) {\n const [incoming, outgoing, inMs, outMs] = swaps(m)[layer];\n // The live layer was just cloned: the snapshot continues from its current look.\n jump(outgoing, incomingOnly ? 0 : values[incoming].value);\n jump(incoming, 0);\n to(outgoing, 0, tween(outMs), time);\n to(incoming, 1, tween(inMs), time, layer === 'chrome' ? m.chromeDelay : 0);\n after(layer, [incoming, outgoing], done);\n }\n function tails(depth: number, time: number, spec: Spec, delay: number, from?: (index: number) => { slot?: number; opacity?: number }) {\n for (const index of [1, 2] as const) {\n const slot = `tail${index}` as const;\n const opacity = `tail${index}Opacity` as const;\n const start = from?.(index);\n if (start?.slot !== undefined) jump(slot, start.slot);\n if (start?.opacity !== undefined) jump(opacity, start.opacity);\n if (index <= depth) {\n to(slot, index, spec, time, delay);\n to(opacity, 1, 'tween' in spec ? spec : tween(m.tails), time, delay);\n } else to(opacity, 0, tween(m.tails), time);\n }\n }\n const tailKeys: readonly Channel[] = ['tail1', 'tail1Opacity', 'tail2', 'tail2Opacity', 'badge'];\n\n return {\n /** Target geometry measured from HTML; the first measurement and `instant` never animate. */\n setShape(target: ShellGeometry, mode: ShapeMode) {\n request(time => {\n const spec = mode === 'open' ? m.shapeOpen : m.shapeClose;\n for (const key of ['width', 'height', 'radius'] as const) {\n if (!measured || mode === 'instant') jump(key, target[key]);\n else if (values[key].target !== target[key]) to(key, target[key], spec, time);\n }\n measured = true;\n });\n },\n /**\n * The title and icon are the same nodes in both states, so a morph moves them\n * (FLIP): the layout jump is cancelled and springs back with the shape. Text never scales.\n */\n shiftHeading(dx: number, dy: number, mode: ShapeMode) {\n request(time => {\n const spec = mode === 'open' ? m.shapeOpen : m.shapeClose;\n for (const [key, delta] of [['headX', dx], ['headY', dy]] as const) {\n if (!Number.isFinite(delta) || Math.abs(delta) < 0.5) continue;\n values[key].value += delta;\n to(key, 0, spec, time);\n }\n });\n },\n /** The first pill: opacity 0→1 (tween), scale and translateY from the edge on the enter spring. */\n enter(edge: -1 | 1, done?: () => void) {\n request(time => {\n jump('opacity', 0); jump('scale', m.enter.scale); jump('y', edge * m.enter.offset);\n // The shell becomes opaque within `fade`; only scale and y follow the spring.\n to('opacity', 1, tween(m.enter.fade), time);\n for (const key of ['scale', 'y'] as const) to(key, key === 'y' ? 0 : 1, enterSpring(), time);\n after('presence', ['opacity', 'scale', 'y'], done);\n });\n },\n /** The first tail moves up into the pill's place after the top pill was dismissed. */\n rise(offset: number, scale: number, done?: () => void) {\n request(time => {\n jump('y', offset); jump('scale', scale);\n to('y', 0, enterSpring(), time); to('scale', 1, enterSpring(), time); to('opacity', 1, enterSpring(), time);\n after('presence', ['opacity', 'scale', 'y'], done);\n });\n },\n /**\n * The exit layer leaves from the shell's current presence; the shell itself is free again.\n * With a fling (swipe dismiss) the snapshot continues sideways with the release velocity\n * (px/s) instead of falling back to the edge, and the live shell returns to the centre.\n */\n exit(edge: -1 | 1, done?: () => void, fling?: Fling) {\n request(time => {\n jump('exitOpacity', values.opacity.value); jump('exitScale', values.scale.value);\n jump('exitY', values.y.value + values.dragY.value); jump('exitX', fling ? values.dragX.value : 0);\n to('exitOpacity', 0, exitSpring(), time);\n if (fling) {\n values.exitX.velocity = fling.velocity;\n to('exitX', fling.direction * fling.distance, m.slide, time);\n } else {\n to('exitScale', m.enter.scale, exitSpring(), time);\n to('exitY', edge * m.enter.offset, exitSpring(), time);\n }\n jump('dragX', 0); jump('dragY', 0);\n after('exit', ['exitOpacity', 'exitScale', 'exitY', 'exitX'], done);\n });\n },\n /** Hides the live shell at once (its look moved to the exit layer). */\n hide() { request(() => jump('opacity', 0)); },\n /**\n * Collapsed stack depth (0–2 tails). `arrival`: tails shift back from the pill;\n * `rise`: they move up one step; `settle`: spring to their slots in place.\n */\n setTails(depth: number, change: 'arrival' | 'rise' | 'settle', previousDepth: number, done?: () => void) {\n request(time => {\n if (change === 'settle') tails(depth, time, enterSpring(), 0);\n else tails(depth, time, enterSpring(), 0, index => {\n if (index > depth) return { opacity: 0 };\n if (change === 'arrival') return { slot: index - 1, opacity: 1 };\n return { slot: index + 1, opacity: index + 1 <= previousDepth ? 1 : 0 };\n });\n after('tails', tailKeys, done);\n });\n },\n setBadge(visible: boolean) { request(time => to('badge', visible ? 1 : 0, badgeSpring(), time)); },\n /** True while the layer's incoming side is still fading in: a further update joins it instead of restarting. */\n swapping(layer: SwapLayer): boolean { return !!values[swaps(m)[layer][0]].animation; },\n /** The sampler's clock (real ms), so the host's update timing follows the same source. */\n now(): number { return options.now(); },\n /** Opening: tails and badge leave in 150 ms; close, body and indicator appear after 100 ms. */\n open(done?: () => void) {\n request(time => {\n for (const index of [1, 2] as const) { to(`tail${index}`, 0, tween(m.tails), time); to(`tail${index}Opacity`, 0, tween(m.tails), time); }\n to('badge', 0, tween(m.tails), time);\n jump('chromeOut', 0);\n jump('chrome', 0);\n to('chrome', 1, tween(m.chromeIn), time, m.chromeDelay);\n after('tails', tailKeys, done);\n });\n },\n /**\n * Collapsing: the chrome snapshot fades in 70 ms while the shape springs back;\n * tails and badge return during the last 150 ms of the shape spring.\n */\n collapse(depth: number, badge: boolean, done?: { chrome?: () => void; tails?: () => void }) {\n request(time => {\n jump('chrome', 0);\n jump('chromeOut', 1);\n to('chromeOut', 0, tween(m.chromeOut), time);\n after('chrome', ['chromeOut'], done?.chrome);\n const delay = Math.max(0, Math.max(remaining('width', time), remaining('height', time)) - m.tails) * timeScale;\n tails(depth, time, tween(m.tails), delay, () => ({ slot: 0, opacity: 0 }));\n to('badge', badge ? 1 : 0, tween(m.tails), time, delay);\n after('tails', tailKeys, done?.tails);\n });\n },\n /** One outgoing snapshot per layer: a new swap restarts from the live layer's current look. */\n swap(layer: SwapLayer, done?: () => void, incomingOnly = false) {\n request(time => swap(layer, time, done, incomingOnly));\n },\n /** Slide inside a fixed shell. The outgoing snapshot follows the incoming layer one width behind. */\n slide(direction: 1 | -1, width: number, done?: () => void) {\n request(time => {\n if (reduced) {\n jump('slide', 0);\n jump('slideOut', 1); jump('slideIn', 0);\n to('slideOut', 0, tween(m.reduced), time); to('slideIn', 1, tween(m.reduced), time);\n } else {\n jump('slideOut', 1); jump('slideIn', 1);\n // Keep the strip continuous and its velocity when a slide interrupts a slide.\n const state = values.slide;\n state.value += direction * width;\n to('slide', 0, m.slide, time);\n }\n slideDirection = direction;\n slideWidth = width;\n after('slide', ['slide', 'slideIn', 'slideOut'], done);\n });\n },\n /** The finger owns the channel: no spring, no velocity until `release`. */\n drag(channel: DragChannel, value: number) {\n request(() => { if (Number.isFinite(value)) jump(channel, value); });\n },\n /**\n * The finger lets go: the channel springs home (0) with the release velocity in px/s.\n * A committed navigation instead keeps the offset and velocity and calls `slide`.\n */\n release(channel: DragChannel, velocity: number, done?: () => void) {\n request(time => {\n values[channel].velocity = Number.isFinite(velocity) ? velocity : 0;\n to(channel, 0, m.slide, time);\n after(`release:${channel}`, [channel], done);\n });\n },\n /** Sets the speed a following `slide` starts with (a swipe released towards a neighbour). */\n fling(channel: DragChannel, velocity: number) {\n if (!disposed && !values[channel].animation) values[channel].velocity = Number.isFinite(velocity) ? velocity : 0;\n },\n setProgress(value: number | null, immediate: boolean) {\n request(time => { if (value === null || immediate) jump('progress', value ?? 0); else to('progress', value, tween(m.progress), time); });\n },\n setHover(active: boolean) { request(time => to('lift', active ? 1 : 0, tween(m.hover), time)); },\n setReducedMotion(next: boolean) {\n if (disposed || reduced === next) return;\n request(time => {\n reduced = next;\n if (!reduced) return;\n for (const key of channelKeys) {\n const state = values[key];\n if (!state.animation) continue;\n if (spatial.has(key)) 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 key of channelKeys) {\n const animation = values[key].animation;\n if (animation) animation.start = time - (time - 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: CloudletMotionConstants) { m = next; },\n /** The constants in effect (the renderer reads offsets and blur from them). */\n get constants() { return m; },\n /** True while a frame is scheduled; an idle host 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 for (const key of channelKeys) values[key].animation = null;\n },\n };\n}\n\nexport type ShellMotion = ReturnType<typeof createShellMotion>;\n"],"mappings":";;AAQA,IAAaE,IAAS;CAEpB,OAAO;EAAE,UAAU;EAAK,QAAQ;EAAM,OAAO;EAAM,QAAQ;EAAG,MAAM;CAAI;CAExE,MAAM;EAAE,UAAU;EAAK,QAAQ;CAAE;CAEjC,WAAW;EAAE,WAAW;EAAK,SAAS;EAAI,MAAM;CAAE;CAClD,YAAY;EAAE,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AAOZ,EAAQ,IAAI;GACzB,EAAOY,CAAI;GAEX,KAAK,IAAM/B,KAAOM,GAAa;IAC7B,IAAMuB,IAAYhB,EAAOb,EAAI,CAAC;IAC9B,AAAI6B,MAAW,EAAU,QAAQE,KAAQA,IAAOF,EAAU,SAAST,IAAY0D;GACjF;GACA,IAAYA;EACd;EAEA,aAAa,GAA+B;GAAE,IAAI9C;EAAM;EAExD,IAAI,YAAY;GAAE,OAAOtB;EAAG;EAE5B,IAAI,UAAU;GAAE,OAAOK,MAAU;EAAM;EACvC,UAAU;GACR,IAAI,IACJ;IAGA,AAHA,IAAW,IACPA,MAAU,QAAMI,EAAQ,YAAYJ,CAAK,GAC7C,IAAQ,MACRD,EAAO,MAAM;IACb,KAAK,IAAMd,KAAOM,GAAa,EAAON,EAAI,CAAC,YAAY;GAJ5C;EAKb;CACF;AACF"}
|
package/dist/react/plan.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export interface ShellView {
|
|
|
12
12
|
readonly total: number;
|
|
13
13
|
/** Tails behind the collapsed pill (0–2); none in the Island. */
|
|
14
14
|
readonly depth: number;
|
|
15
|
-
/** Missed notifications (overflow), part of the badge and the pill name
|
|
15
|
+
/** Missed notifications (overflow), part of the badge and the pill name. */
|
|
16
16
|
readonly missed: number;
|
|
17
17
|
/** Badge number: records in the stack plus missed ones; shown on the pill at ≥ 2 or with missed ones. */
|
|
18
18
|
readonly count: number;
|
package/dist/react/plan.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/react/plan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CA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AC;IACvB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED,wBAAgB,SAAS,CAAC,QAAQ,EAAE,gBAAgB,CAAC,SAAS,CAAC,GAAG,SAAS,CAQ1E;AAED,kDAAkD;AAClD,eAAO,MAAM,SAAS,EAAE,SAAyH,CAAC;AAElJ,6FAA6F;AAC7F,MAAM,WAAW,SAAS;IACxB;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;IAC9E,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IAC1C,gFAAgF;IAChF,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,uFAAuF;IACvF,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;CACxD;AAYD,wBAAgB,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,GAAG,SAAS,CAmCzE"}
|
package/dist/react/plan.js
CHANGED
package/dist/react/plan.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.js","names":["shellView","presented","snapshot","item","open","total","missed","emptyView","headerKey","bodyKey","description","content","action","operation","planShell","plan","before","previous","after","next"],"sources":["../../src/react/plan.ts"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { NotificationHandle } from '../contracts/identity.js';\nimport type { RendererSnapshot } from '../contracts/internal.js';\nimport type { NotificationSnapshot } from '../contracts/snapshots.js';\n\ntype Presented = NotificationSnapshot<ReactNode>;\n\n/** What the shell shows for one renderer snapshot. */\nexport interface ShellView {\n readonly presented: Presented | null;\n readonly open: boolean;\n readonly stack: readonly NotificationHandle[];\n readonly index: number;\n readonly total: number;\n /** Tails behind the collapsed pill (0–2); none in the Island. */\n readonly depth: number;\n /** Missed notifications (overflow), part of the badge and the pill name
|
|
1
|
+
{"version":3,"file":"plan.js","names":["shellView","presented","snapshot","item","open","total","missed","emptyView","headerKey","bodyKey","description","content","field","action","operation","planShell","plan","before","previous","after","next"],"sources":["../../src/react/plan.ts"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { NotificationHandle } from '../contracts/identity.js';\nimport type { RendererSnapshot } from '../contracts/internal.js';\nimport type { NotificationSnapshot } from '../contracts/snapshots.js';\n\ntype Presented = NotificationSnapshot<ReactNode>;\n\n/** What the shell shows for one renderer snapshot. */\nexport interface ShellView {\n readonly presented: Presented | null;\n readonly open: boolean;\n readonly stack: readonly NotificationHandle[];\n readonly index: number;\n readonly total: number;\n /** Tails behind the collapsed pill (0–2); none in the Island. */\n readonly depth: number;\n /** Missed notifications (overflow), part of the badge and the pill name. */\n readonly missed: number;\n /** Badge number: records in the stack plus missed ones; shown on the pill at ≥ 2 or with missed ones. */\n readonly count: number;\n readonly badge: boolean;\n}\n\nexport function shellView(snapshot: RendererSnapshot<ReactNode>): ShellView {\n const presented = snapshot.notifications.find(item => item.location === 'current') ?? null;\n const open = snapshot.island.open && presented !== null;\n const total = snapshot.stack.length;\n const missed = snapshot.overflow.pending ? snapshot.overflow.count : 0;\n return { presented, open, stack: snapshot.stack, total, index: presented ? snapshot.stack.indexOf(presented.handle) : -1,\n depth: open || !presented ? 0 : Math.min(2, Math.max(0, total - 1)),\n missed, count: total + missed, badge: !open && !!presented && (total > 1 || missed > 0) };\n}\n\n/** The collapsed view before the first commit. */\nexport const emptyView: ShellView = { presented: null, open: false, stack: [], index: -1, total: 0, depth: 0, missed: 0, count: 0, badge: false };\n\n/** Visual transition between two committed views; pure, so it is unit-tested without DOM. */\nexport interface ShellPlan {\n /**\n * enter: from the edge; exit: the shell leaves (last record); arrival: a new top\n * pill enters while the old one becomes the first tail; rise: the top pill leaves\n * and the first tail moves up; replace: the old pill leaves and a new one enters.\n */\n readonly presence: 'none' | 'enter' | 'exit' | 'arrival' | 'rise' | 'replace';\n readonly morph: 'none' | 'open' | 'close';\n /** +1: the incoming slide comes from the inline end (towards older records). */\n readonly slide: 0 | 1 | -1;\n readonly header: boolean;\n readonly body: boolean;\n readonly badge: boolean;\n readonly page: boolean;\n /** Same record, new message: hide it from the scheduler until the swap is readable. */\n readonly begin: boolean;\n readonly tails: 'none' | 'arrival' | 'rise' | 'settle';\n}\n\nconst headerKey = (item: Presented) => `${item.kind}\\u0000${item.content.title}`;\nfunction bodyKey(item: Presented) {\n const { content, operation, action } = item;\n const description = content.description;\n return [description?.kind, description?.kind === 'text' ? description.text : '', content.progress?.kind,\n content.action?.kind, content.action?.label, content.action?.kind === 'form' ? content.action.fields.map(field => field.name).join('\\u0001') : '',\n action.status === 'failed' ? action.message : '',\n operation?.status, operation?.canRetry, operation?.canCancel].join('\\u0000');\n}\n\nexport function planShell(previous: ShellView, next: ShellView): ShellPlan {\n const plan = { presence: 'none', morph: 'none', slide: 0, header: false, body: false, badge: false, page: false,\n begin: false, tails: 'none' } as { -readonly [Key in keyof ShellPlan]: ShellPlan[Key] };\n const before = previous.presented;\n const after = next.presented;\n if (!after) {\n if (before) plan.presence = 'exit';\n return plan;\n }\n if (!before) {\n plan.presence = 'enter';\n return plan;\n }\n if (previous.open !== next.open) plan.morph = next.open ? 'open' : 'close';\n if (before.handle !== after.handle) {\n if (previous.open && next.open) {\n // Only the body slides: the title and icon blur-swap in place.\n plan.slide = next.index >= previous.index ? 1 : -1;\n plan.header = headerKey(before) !== headerKey(after) || before.content.icon !== after.content.icon;\n }\n else if (plan.morph !== 'none') plan.header = true;\n else if (next.stack.includes(before.handle)) { plan.presence = 'arrival'; plan.tails = 'arrival'; plan.header = true; }\n else if (previous.stack.includes(after.handle)) { plan.presence = 'rise'; plan.tails = 'rise'; }\n else plan.presence = 'replace';\n } else {\n plan.header = headerKey(before) !== headerKey(after) || before.content.icon !== after.content.icon;\n plan.body = previous.open && next.open && (bodyKey(before) !== bodyKey(after)\n || (before.content.description?.kind === 'rich' && after.content.description?.kind === 'rich'\n && before.content.description.content !== after.content.description.content));\n plan.begin = before.kind !== after.kind || before.operation?.status !== after.operation?.status;\n }\n if (plan.tails === 'none' && plan.morph === 'none' && !next.open && previous.depth !== next.depth) plan.tails = 'settle';\n plan.badge = previous.badge && next.badge && previous.count !== next.count;\n plan.page = previous.open && next.open && next.total > 5 && (previous.index !== next.index || previous.total !== next.total);\n return plan;\n}\n"],"mappings":";AAuBA,SAAgBA,EAAU,GAAkD;CAC1E,IAAMC,IAAYC,EAAS,cAAc,MAAK,MAAQC,EAAK,aAAa,SAAS,KAAK,MAChFC,IAAOF,EAAS,OAAO,QAAQD,MAAc,MAC7CI,IAAQH,EAAS,MAAM,QACvBI,IAASJ,EAAS,SAAS,UAAUA,EAAS,SAAS,QAAQ;CACrE,OAAO;EAAE;EAAW;EAAM,OAAOA,EAAS;EAAO;EAAO,OAAOD,IAAYC,EAAS,MAAM,QAAQD,EAAU,MAAM,IAAI;EACpH,OAAOG,KAAQ,CAACH,IAAY,IAAI,KAAK,IAAI,GAAG,KAAK,IAAI,GAAGI,IAAQ,CAAC,CAAC;EAClE;EAAQ,OAAOA,IAAQC;EAAQ,OAAO,CAACF,KAAQ,CAAC,CAACH,MAAcI,IAAQ,KAAKC,IAAS;CAAG;AAC5F;AAGA,IAAaC,IAAuB;CAAE,WAAW;CAAM,MAAM;CAAO,OAAO,CAAC;CAAG,OAAO;CAAI,OAAO;CAAG,OAAO;CAAG,QAAQ;CAAG,OAAO;CAAG,OAAO;AAAM,GAsB1IC,KAAa,MAAoB,GAAGL,EAAK,KAAK,QAAQA,EAAK,QAAQ;AACzE,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AM,MAAMT,EAAUW,CAAK,KAAKF,EAAO,QAAQ,SAASE,EAAM,QAAQ,QAEvFH,EAAK,UAAU,SACfI,EAAK,MAAM,SAASH,EAAO,MAAM,KAAK,EAAK,WAAW,WAAW,EAAK,QAAQ,WAAW,EAAK,SAAS,MACvGC,EAAS,MAAM,SAASC,EAAM,MAAM,KAAK,EAAK,WAAW,QAAQ,EAAK,QAAQ,UAClF,EAAK,WAAW,YAHW,EAAK,SAAS,IAW5CH,EAAK,UAAU,UAAUA,EAAK,UAAU,UAAU,CAACI,EAAK,QAAQF,EAAS,UAAUE,EAAK,UAAO,EAAK,QAAQ,WAChH,EAAK,QAAQF,EAAS,SAASE,EAAK,SAASF,EAAS,UAAUE,EAAK,OACrE,EAAK,OAAOF,EAAS,QAAQE,EAAK,QAAQA,EAAK,QAAQ,MAAMF,EAAS,UAAUE,EAAK,SAASF,EAAS,UAAUE,EAAK,QAC/GJ,MAxBL,EAAK,WAAW,SACTA,MALHC,MAAQ,EAAK,WAAW,SACrBD;AA4BX"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import type { ReactCloudletController, ToasterProps } from '../react.js';
|
|
3
|
+
export declare function AttachedToaster({ controller, options }: {
|
|
4
|
+
controller: ReactCloudletController;
|
|
5
|
+
options: ToasterProps;
|
|
6
|
+
}): ReactElement | null;
|
|
7
|
+
//# sourceMappingURL=renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/react/renderer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAI1C,OAAO,KAAK,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAezE,wBAAgB,eAAe,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE;IAAE,UAAU,EAAE,uBAAuB,CAAC;IAAC,OAAO,EAAE,YAAY,CAAA;CAAE,GAAG,YAAY,GAAG,IAAI,CAwD5I"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { getRendererBridge as e } from "../core/bridge.js";
|
|
2
|
+
import { Host as t } from "./host.js";
|
|
3
|
+
import { useEffect as n, useRef as r, useState as i, useSyncExternalStore as a } from "react";
|
|
4
|
+
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
5
|
+
import { createPortal as l } from "react-dom";
|
|
6
|
+
//#region src/react/renderer.tsx
|
|
7
|
+
var u = () => () => {}, d = () => !0, f = () => !1;
|
|
8
|
+
function p({ controller: p, options: m }) {
|
|
9
|
+
let h = a(u, d, f), g = e(p), _ = a(g.subscribe, g.getSnapshot, g.getServerSnapshot), v = r(null), [y, b] = i(null);
|
|
10
|
+
n(() => {
|
|
11
|
+
if (!h || !v.current) return;
|
|
12
|
+
let e = v.current.ownerDocument, t;
|
|
13
|
+
try {
|
|
14
|
+
let n = (typeof m.container == "function" ? m.container() : m.container) ?? e.body;
|
|
15
|
+
if (!n || n.nodeType !== 1 || n.ownerDocument !== e || n.namespaceURI !== "http://www.w3.org/1999/xhtml" || !n.isConnected || n.getRootNode().nodeType === 11) {
|
|
16
|
+
g.reportInvalidContainer("Toaster container must be a connected HTML Element in the mounting document, outside Shadow DOM");
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
t = n;
|
|
20
|
+
} catch (e) {
|
|
21
|
+
g.reportInvalidContainer("Toaster container resolver failed", e);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
let n = m.attention?.delay, r = g.attach(n === void 0 ? void 0 : { attentionDelay: n }), i = r.status === "rejected" && r.reason === "invalid-input";
|
|
25
|
+
if (i && (r = g.attach()), r.status !== "attached") return;
|
|
26
|
+
i && g.reportDiagnostic(r.lease, {
|
|
27
|
+
code: "invalid-input",
|
|
28
|
+
source: "Toaster.attention",
|
|
29
|
+
message: "attention.delay must be a finite nonnegative number of milliseconds"
|
|
30
|
+
});
|
|
31
|
+
let a = {
|
|
32
|
+
controller: p,
|
|
33
|
+
lease: r.lease,
|
|
34
|
+
container: t,
|
|
35
|
+
document: e
|
|
36
|
+
};
|
|
37
|
+
return x(a.lease, !1), b(a), () => {
|
|
38
|
+
g.detach(a.lease);
|
|
39
|
+
};
|
|
40
|
+
}, [p, h]);
|
|
41
|
+
function x(e, t) {
|
|
42
|
+
let n = m.autoDismiss, r = n === void 0 || typeof n == "boolean";
|
|
43
|
+
g.setAutoDismiss(e, r ? n : void 0), !r && t && g.reportDiagnostic(e, {
|
|
44
|
+
code: "invalid-input",
|
|
45
|
+
source: "Toaster.autoDismiss",
|
|
46
|
+
message: "autoDismiss must be a boolean"
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return n(() => {
|
|
50
|
+
y && x(y.lease, !0);
|
|
51
|
+
}, [y, m.autoDismiss]), h ? /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("template", { ref: v }), y?.controller === p && !_.disposed ? l(/* @__PURE__ */ s(t, {
|
|
52
|
+
bridge: g,
|
|
53
|
+
lease: y.lease,
|
|
54
|
+
snapshot: _,
|
|
55
|
+
options: m,
|
|
56
|
+
document: y.document
|
|
57
|
+
}, y.lease), y.container) : null] }) : null;
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
export { p as AttachedToaster };
|
|
61
|
+
|
|
62
|
+
//# sourceMappingURL=renderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer.js","names":["_Fragment","subscribeMount","clientMounted","serverMounted","AttachedToaster","mounted","useSyncExternalStore","bridge","getRendererBridge","controller","snapshot","marker","useRef","attachment","setAttachment","useState","ownerDocument","container","candidate","options","error","delay","attached","invalidDelay","current","applyAutoDismiss","value","valid","lease","report","useEffect","Fragment","createPortal","Host"],"sources":["../../src/react/renderer.tsx"],"sourcesContent":["import { useEffect, useRef, useState, useSyncExternalStore } from 'react';\nimport type { ReactElement } from 'react';\nimport { createPortal } from 'react-dom';\nimport { getRendererBridge } from '../core/bridge.js';\nimport type { HostLease } from '../contracts/internal.js';\nimport type { ReactCloudletController, ToasterProps } from '../react.js';\nimport { Host } from './host.js';\n\n// The renderer chunk: Toaster in bindings.tsx loads this module on the client once, after mount.\nconst subscribeMount = () => () => {};\nconst clientMounted = () => true;\nconst serverMounted = () => false;\n\ninterface Attachment {\n readonly controller: ReactCloudletController;\n readonly lease: HostLease;\n readonly container: Element;\n readonly document: Document;\n}\n\nexport function AttachedToaster({ controller, options }: { controller: ReactCloudletController; options: ToasterProps }): ReactElement | null {\n // React supplies the server value during hydration, then the client value.\n // The inert marker can therefore identify the owner document without a store\n // or effect whose only purpose is an extra mounting render.\n const mounted = useSyncExternalStore(subscribeMount, clientMounted, serverMounted);\n const bridge = getRendererBridge(controller);\n const snapshot = useSyncExternalStore(bridge.subscribe, bridge.getSnapshot, bridge.getServerSnapshot);\n const marker = useRef<HTMLTemplateElement>(null);\n const [attachment, setAttachment] = useState<Attachment | null>(null);\n useEffect(() => {\n if (!mounted || !marker.current) return;\n const ownerDocument = marker.current.ownerDocument;\n let container: Element;\n try {\n const requested = typeof options.container === 'function' ? options.container() : options.container;\n const candidate = requested ?? ownerDocument.body;\n // nodeType/ownerDocument also work when the mounting React root is in another realm.\n if (!candidate || candidate.nodeType !== 1 || candidate.ownerDocument !== ownerDocument\n || candidate.namespaceURI !== 'http://www.w3.org/1999/xhtml' || !candidate.isConnected\n || candidate.getRootNode().nodeType === 11) {\n bridge.reportInvalidContainer('Toaster container must be a connected HTML Element in the mounting document, outside Shadow DOM');\n return;\n }\n container = candidate;\n } catch (error) {\n bridge.reportInvalidContainer('Toaster container resolver failed', error);\n return;\n }\n const delay = options.attention?.delay;\n let attached = bridge.attach(delay === undefined ? undefined : { attentionDelay: delay });\n // An invalid delay must not suppress the host: fall back to the controller default and report it.\n const invalidDelay = attached.status === 'rejected' && attached.reason === 'invalid-input';\n if (invalidDelay) attached = bridge.attach();\n if (attached.status !== 'attached') return;\n if (invalidDelay) bridge.reportDiagnostic(attached.lease, { code: 'invalid-input', source: 'Toaster.attention',\n message: 'attention.delay must be a finite nonnegative number of milliseconds' });\n const current = { controller, lease: attached.lease, container, document: ownerDocument };\n applyAutoDismiss(current.lease, false);\n setAttachment(current);\n return () => { bridge.detach(current.lease); };\n // Container and attention delay are fixed for this attachment; changing them requires remount.\n }, [controller, mounted]);\n // Applied before the first presentation, then whenever the prop changes (which reports an invalid value once).\n function applyAutoDismiss(lease: HostLease, report: boolean) {\n const value = options.autoDismiss;\n const valid = value === undefined || typeof value === 'boolean';\n bridge.setAutoDismiss(lease, valid ? value : undefined);\n if (!valid && report) bridge.reportDiagnostic(lease, { code: 'invalid-input', source: 'Toaster.autoDismiss',\n message: 'autoDismiss must be a boolean' });\n }\n useEffect(() => { if (attachment) applyAutoDismiss(attachment.lease, true); }, [attachment, options.autoDismiss]);\n\n if (!mounted) return null;\n return <><template ref={marker} />{attachment?.controller === controller && !snapshot.disposed\n ? createPortal(<Host key={attachment.lease} bridge={bridge} lease={attachment.lease} snapshot={snapshot}\n options={options} document={attachment.document} />, attachment.container) : null}</>;\n}\n"],"mappings":";;;;;;AASA,IAAMC,gBAA6B,CAAC,GAC9BC,UAAsB,IACtBC,UAAsB;AAS5B,SAAgBC,EAAgB,EAAE,eAAY,cAAgG;CAI5I,IAAMC,IAAUC,EAAqBL,GAAgBC,GAAeC,CAAa,GAC3EI,IAASC,EAAkBC,CAAU,GACrCC,IAAWJ,EAAqBC,EAAO,WAAWA,EAAO,aAAaA,EAAO,iBAAiB,GAC9FI,IAASC,EAA4B,IAAI,GACzC,CAACC,GAAYC,KAAiBC,EAA4B,IAAI;CACpE,QAAgB;EACd,IAAI,CAACV,KAAW,CAACM,EAAO,SAAS;EACjC,IAAMK,IAAgBL,EAAO,QAAQ,eACjCM;EACJ,IAAI;GAEF,IAAMC,KADY,OAAOC,EAAQ,aAAc,aAAaA,EAAQ,UAAU,IAAIA,EAAQ,cAC3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AL,GAAA,EAAA,UAAA,CAAE,kBAAC,YAAD,EAAU,KAAKW,EAAS,CAAA,GAAEE,GAAY,eAAeJ,KAAc,CAACC,EAAS,WAClFsB,EAAa,kBAACC,GAAD;EAAqC;EAAQ,OAAOpB,EAAW;EAAiB;EACpF;EAAS,UAAUA,EAAW;CAAW,GAD1BA,EAAW,KACe,GAAGA,EAAW,SAAS,IAAI,IAAO,EAAA,CAAA,IAHnE;AAIvB"}
|
package/dist/react.d.ts
CHANGED
|
@@ -49,6 +49,8 @@ export interface CloudletLabels {
|
|
|
49
49
|
/** 1-based slide position. */
|
|
50
50
|
readonly page: (index: number, total: number) => string;
|
|
51
51
|
readonly overflowCount: (count: number) => string;
|
|
52
|
+
/** Added to the collapsed stack button's name while the presented form holds unsent text. */
|
|
53
|
+
readonly draft: string;
|
|
52
54
|
}
|
|
53
55
|
export interface AnnouncementFormatters {
|
|
54
56
|
readonly notification: (notification: NotificationSnapshot<ReactNode>) => string;
|
|
@@ -66,7 +68,7 @@ export interface ToasterAttention {
|
|
|
66
68
|
/** Milliseconds from admission before an auto-open; default 600. */
|
|
67
69
|
readonly delay?: number;
|
|
68
70
|
}
|
|
69
|
-
/** A physical spring of
|
|
71
|
+
/** A physical spring of the motion system. */
|
|
70
72
|
export interface CloudletSpring {
|
|
71
73
|
readonly stiffness: number;
|
|
72
74
|
readonly damping: number;
|
|
@@ -78,7 +80,7 @@ export interface CloudletTimedSpring {
|
|
|
78
80
|
readonly bounce: number;
|
|
79
81
|
}
|
|
80
82
|
/**
|
|
81
|
-
* The motion constants
|
|
83
|
+
* The motion constants: durations in ms at `timeScale: 1`, offsets and blur in CSS px.
|
|
82
84
|
* Reported by the laboratory's tuning panel; see `ToasterMotion.overrides`.
|
|
83
85
|
*/
|
|
84
86
|
export interface CloudletMotionConstants {
|
|
@@ -138,15 +140,15 @@ export interface ToasterMotion {
|
|
|
138
140
|
*/
|
|
139
141
|
readonly timeScale?: number;
|
|
140
142
|
/**
|
|
141
|
-
* Debugging and laboratory channel
|
|
143
|
+
* Debugging and laboratory channel: replaces the motion constants live, for
|
|
142
144
|
* transitions started after the change. A field that is not a finite number in range
|
|
143
145
|
* (stiffness and mass > 0, the rest ≥ 0) keeps its default. Not a styling API: the
|
|
144
146
|
* values may change between releases; do not ship overrides to production.
|
|
145
147
|
*/
|
|
146
148
|
readonly overrides?: CloudletMotionOverrides;
|
|
147
149
|
}
|
|
148
|
-
/** Styling hooks of the renderer
|
|
149
|
-
export type CloudletPart = 'host' | 'stack' | 'pill' | 'tail' | 'badge' | 'island' | 'header' | 'icon' | 'title' | 'close' | 'body' | 'description' | 'actions' | 'action' | 'indicator' | 'overflow';
|
|
150
|
+
/** Styling hooks of the renderer; see `ToasterProps.classNames`. */
|
|
151
|
+
export type CloudletPart = 'host' | 'stack' | 'pill' | 'tail' | 'badge' | 'island' | 'header' | 'icon' | 'title' | 'close' | 'body' | 'description' | 'actions' | 'action' | 'indicator' | 'overflow' | 'form' | 'field' | 'field-error';
|
|
150
152
|
export interface ToasterProps {
|
|
151
153
|
readonly position?: 'auto' | 'top-center' | 'bottom-center';
|
|
152
154
|
readonly theme?: 'system' | 'light' | 'dark';
|
package/dist/react.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACpG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAClG,OAAO,KAAK,EA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CAAC;IACtC,6FAA6F;IAC7F,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,4BAA4B;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IAChC,kHAAkH;IAClH,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;CAC7D;AAED,4CAA4C;AAC5C,MAAM,MAAM,yBAAyB,GAAG,CAAC,KAAK,EAAE,qBAAqB,KAAK,YAAY,GAAG,IAAI,CAAC;AAC9F,MAAM,MAAM,WAAW,GAAG,MAAM,uBAAuB,CAAC;AACxD,MAAM,MAAM,mBAAmB,GAAG,MAAM,uBAAuB,GAAG,IAAI,CAAC;AACvE,MAAM,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,YAAY,KAAK,YAAY,GAAG,IAAI,CAAC;AAE5E,YAAY,EAAE,kBAAkB,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.cloudlet-host{--cloudlet-pill-height:44px;--cloudlet-pill-radius:9999px;--cloudlet-pill-max-width:22rem;--cloudlet-island-radius:24px;--cloudlet-island-max-width:26rem;--cloudlet-tail-offset:4px;--cloudlet-tail-scale:.9;--cloudlet-control-min-size:44px;--cloudlet-viewport-gutter:16px;--cloudlet-font-family:system-ui, sans-serif;--cloudlet-font-size:.875rem;--cloudlet-background:#fff;--cloudlet-foreground:#111113;--cloudlet-muted:#6e6e76;--cloudlet-border:color-mix(in oklab, var(--cloudlet-foreground) 10%, transparent);--cloudlet-action-background:color-mix(in oklab, var(--cloudlet-foreground) 8%, transparent);--cloudlet-shadow:0 10px 30px -12px #00000040, 0 1px 2px #00000014;--cloudlet-tail-background:var(--cloudlet-background);--cloudlet-tail-border:var(--cloudlet-border);--cloudlet-focus:#245cdb;--cloudlet-success:oklch(72.3% .219 142.136);--cloudlet-error:oklch(63.7% .237 25.331);--cloudlet-info:oklch(68.5% .169 237.323);--cloudlet-warning:oklch(79.5% .184 86.047);--cloudlet-loading:oklch(55.6% 0 0);--cloudlet-badge:#ff3b30;--cloudlet-badge-foreground:#fff;--cloudlet-z-index:1000;--cloudlet-safe-top:env(safe-area-inset-top,0px);--cloudlet-safe-right:env(safe-area-inset-right,0px);--cloudlet-safe-bottom:env(safe-area-inset-bottom,0px);--cloudlet-safe-left:env(safe-area-inset-left,0px);--cloudlet-top:calc(var(--cloudlet-safe-top) + var(--cloudlet-gutter-top,var(--cloudlet-viewport-gutter)) + var(--cloudlet-obstruction-top,0px));--cloudlet-bottom:calc(var(--cloudlet-safe-bottom) + var(--cloudlet-gutter-bottom,var(--cloudlet-viewport-gutter)) + var(--cloudlet-obstruction-bottom,0px));--cloudlet-left:calc(var(--cloudlet-safe-left) + var(--cloudlet-gutter-left,var(--cloudlet-viewport-gutter)) + var(--cloudlet-obstruction-left,0px));--cloudlet-right:calc(var(--cloudlet-safe-right) + var(--cloudlet-gutter-right,var(--cloudlet-viewport-gutter)) + var(--cloudlet-obstruction-right,0px));--cloudlet-host-height:max(0px, calc(var(--cloudlet-viewport-height,100dvh) - var(--cloudlet-top) - var(--cloudlet-bottom)));--cloudlet-available-height:max(0px, calc(var(--cloudlet-host-height) - var(--cloudlet-reserved-height,0px)));z-index:var(--cloudlet-z-index);left:calc(var(--cloudlet-viewport-left,0px) + var(--cloudlet-left));right:calc(var(--cloudlet-viewport-right,0px) + var(--cloudlet-right));bottom:calc(var(--cloudlet-viewport-bottom,0px) + var(--cloudlet-bottom));max-width:var(--cloudlet-island-max-width);max-height:var(--cloudlet-host-height);color:var(--cloudlet-foreground);font:400 var(--cloudlet-font-size)/1.43 var(--cloudlet-font-family);text-align:start;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;pointer-events:none;isolation:isolate;--cloudlet-status:var(--cloudlet-loading);flex-direction:column;margin-inline:auto;display:flex;position:fixed}.cloudlet-host,.cloudlet-host *,.cloudlet-host :before,.cloudlet-host :after{box-sizing:border-box}.cloudlet-host :where(h2,p,ol,li){margin:0;padding:0}.cloudlet-host :where(button,a){font:inherit;color:inherit;line-height:inherit;letter-spacing:inherit;text-transform:none;min-width:var(--cloudlet-control-min-size);min-height:var(--cloudlet-control-min-size);touch-action:manipulation}.cloudlet-host button{appearance:none;cursor:pointer;background:0 0;border:0;border-radius:24px;justify-content:center;align-items:center;margin:0;padding:10px;display:inline-flex}.cloudlet-host button[aria-disabled=true]{color:var(--cloudlet-muted);cursor:progress}.cloudlet-host a{border-radius:24px;align-items:center;padding:10px 16px;text-decoration:underline;display:inline-flex}.cloudlet-host :focus-visible{outline:2px solid var(--cloudlet-focus);outline-offset:2px}.cloudlet-host:focus-visible{outline:2px solid var(--cloudlet-focus);outline-offset:-2px}.cloudlet-host [hidden]{display:none!important}.cloudlet-host [data-kind=success]{--cloudlet-status:var(--cloudlet-success)}.cloudlet-host [data-kind=error]{--cloudlet-status:var(--cloudlet-error)}.cloudlet-host [data-kind=info]{--cloudlet-status:var(--cloudlet-info)}.cloudlet-host [data-kind=warning]{--cloudlet-status:var(--cloudlet-warning)}.cloudlet-host [data-kind=loading]{--cloudlet-status:var(--cloudlet-loading)}.cloudlet-host .cloudlet-stack{flex:none;align-self:center;width:fit-content;max-width:100%;position:relative}.cloudlet-host[data-state=island] .cloudlet-stack{width:100%}.cloudlet-host .cloudlet-shell{transform-origin:50% 0;z-index:1;position:relative}.cloudlet-host[data-edge=bottom] .cloudlet-shell{transform-origin:50% 100%}.cloudlet-host .cloudlet-bg{pointer-events:none;box-shadow:var(--cloudlet-shadow);position:absolute;top:0;left:50%;overflow:visible;transform:translate(-50%)}.cloudlet-host .cloudlet-bg path{fill:var(--cloudlet-background);stroke:var(--cloudlet-border);stroke-width:1px}.cloudlet-host :is(.cloudlet-tail,.cloudlet-exit){pointer-events:none;position:absolute;top:0;left:50%}.cloudlet-host .cloudlet-tail{z-index:0;border-radius:var(--cloudlet-pill-radius);background:var(--cloudlet-tail-background);border:1px solid var(--cloudlet-tail-border);box-shadow:var(--cloudlet-shadow);transform-origin:50% 100%;opacity:0}.cloudlet-host .cloudlet-tail[data-cloudlet-tail="2"]{z-index:-1;background:color-mix(in oklab, var(--cloudlet-tail-background) 60%, var(--cloudlet-background))}.cloudlet-host .cloudlet-exit{z-index:2;transform-origin:50% 0}.cloudlet-host[data-edge=bottom] :is(.cloudlet-bg,.cloudlet-tail,.cloudlet-exit,.cloudlet-badge){top:auto;bottom:0}.cloudlet-host[data-edge=bottom] .cloudlet-tail{transform-origin:50% 0}.cloudlet-host[data-edge=bottom] .cloudlet-exit{transform-origin:50% 100%}.cloudlet-host .cloudlet-exit:empty{display:none}.cloudlet-host .cloudlet-clip{pointer-events:auto;color:var(--cloudlet-foreground);overflow-wrap:anywhere;width:fit-content;min-width:0;max-width:min(100%, var(--cloudlet-pill-max-width));min-height:var(--cloudlet-pill-height);border-radius:var(--cloudlet-pill-radius);flex-direction:column;display:flex;position:relative}.cloudlet-host .cloudlet-shell[data-state=island]>.cloudlet-clip{width:100%;max-width:100%;max-height:var(--cloudlet-available-height);border-radius:var(--cloudlet-island-radius)}.cloudlet-host :is(.cloudlet-slide-out,.cloudlet-chrome-out){pointer-events:none;position:absolute;top:0;left:0}.cloudlet-host :is(.cloudlet-slide-out,.cloudlet-chrome-out):empty{display:none}.cloudlet-host .cloudlet-chrome-out .cloudlet-clip{width:100%;max-width:none}.cloudlet-host .cloudlet-ghost{visibility:hidden}.cloudlet-host .cloudlet-slide{flex-direction:column;flex:0 auto;min-height:0;display:flex;position:relative}.cloudlet-host .cloudlet-header{flex:none;min-width:0;display:flex;position:relative}.cloudlet-host .cloudlet-heading{min-width:0;min-height:var(--cloudlet-pill-height);flex:1;align-items:center;gap:10px;padding-block:6px;padding-inline:10px 16px;display:flex}.cloudlet-host .cloudlet-shell[data-state=island] .cloudlet-heading{padding-block:10px 6px;padding-inline:14px 52px}.cloudlet-host .cloudlet-heading-out{pointer-events:none;display:flex;position:absolute;inset:0}.cloudlet-host .cloudlet-heading-out:empty{display:none}.cloudlet-host .cloudlet-title{font:inherit;text-transform:none;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-weight:500;overflow:hidden}.cloudlet-host .cloudlet-shell[data-state=island] .cloudlet-title{white-space:normal;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box}.cloudlet-host .cloudlet-title:focus{outline:none}.cloudlet-host .cloudlet-title:focus-visible{outline:2px solid var(--cloudlet-focus);outline-offset:2px;border-radius:4px}.cloudlet-host .cloudlet-pill{z-index:1;pointer-events:auto;border-radius:var(--cloudlet-pill-radius);width:100%;height:100%;padding:0;position:absolute;inset:0}.cloudlet-host .cloudlet-pill,.cloudlet-host .cloudlet-shell[data-state=island]>.cloudlet-clip,.cloudlet-host .cloudlet-shell[data-state=island] .cloudlet-body{touch-action:pan-y}.cloudlet-host .cloudlet-shell[data-state=island]>.cloudlet-clip>.cloudlet-slide>.cloudlet-header{touch-action:none}.cloudlet-host[data-dragging]{-webkit-user-select:none;user-select:none}.cloudlet-host .cloudlet-peek{pointer-events:none;position:absolute;top:0;left:0}.cloudlet-host .cloudlet-badge{z-index:2;background:var(--cloudlet-badge);min-width:20px;height:20px;color:var(--cloudlet-badge-foreground);box-shadow:0 0 0 2px var(--cloudlet-background);font:600 .6875rem/20px var(--cloudlet-font-family);font-variant-numeric:tabular-nums;text-align:center;pointer-events:none;opacity:0;border-radius:9999px;padding-inline:6px;display:grid;position:absolute;top:0;left:50%}.cloudlet-host .cloudlet-badge>*{grid-area:1/1}.cloudlet-host .cloudlet-icon{width:24px;height:24px;color:var(--cloudlet-status);background:color-mix(in oklab, var(--cloudlet-status) 18%, transparent);border-radius:50%;flex:none;place-items:center;display:grid;position:relative}.cloudlet-host .cloudlet-glyph{place-items:center;width:16px;height:16px;display:grid;overflow:hidden}.cloudlet-host .cloudlet-glyph>.cloudlet-slot{place-items:center;width:100%;height:100%;display:grid}.cloudlet-host .cloudlet-glyph :is(svg,img){max-width:100%;max-height:100%;display:block}.cloudlet-host :is(svg.cloudlet-glyph,button>svg){fill:none;stroke:currentColor;stroke-width:1.75px;stroke-linecap:round;stroke-linejoin:round;display:block}.cloudlet-host .cloudlet-ring{fill:none;stroke-width:2px;width:32px;height:32px;position:absolute;inset:-4px;overflow:visible}.cloudlet-host .cloudlet-ring-track{stroke:color-mix(in oklab, var(--cloudlet-status) 18%, transparent)}.cloudlet-host .cloudlet-progress-fill{stroke:color-mix(in oklab, var(--cloudlet-status) 75%, var(--cloudlet-foreground));stroke-linecap:round}.cloudlet-host .cloudlet-close{top:8px;z-index:1;width:32px;min-width:0;height:32px;min-height:0;color:var(--cloudlet-muted);background:var(--cloudlet-action-background);border-radius:50%;padding:0;position:absolute;inset-inline-end:8px}.cloudlet-host .cloudlet-close>svg{width:16px;height:16px}.cloudlet-host :is(.cloudlet-close,.cloudlet-action,.cloudlet-overflow button):before{content:"";inset-block:calc((var(--cloudlet-control-min-size) - 32px) / -2);position:absolute;inset-inline:0}.cloudlet-host button.cloudlet-close:before{inset-inline:calc((var(--cloudlet-control-min-size) - 32px) / -2);border-radius:50%}.cloudlet-host .cloudlet-body{overscroll-behavior:contain;min-height:0;max-height:min(calc(var(--cloudlet-available-height) * .6), 24rem);flex-direction:column;padding-block:0 10px;padding-inline:48px 16px;display:flex;position:relative;overflow:auto}.cloudlet-host .cloudlet-body:not(:has(>:not(.cloudlet-actions:empty))){padding-bottom:4px}.cloudlet-host .cloudlet-body-out{pointer-events:none;position:absolute;left:0;right:0}.cloudlet-host .cloudlet-body-out:empty{display:none}.cloudlet-host .cloudlet-description{color:var(--cloudlet-muted);padding-block:0 4px;font-size:.8125rem;line-height:1.45}.cloudlet-host .cloudlet-actions{flex-wrap:wrap;flex:none;gap:12px 8px;display:flex}.cloudlet-host .cloudlet-actions:empty{display:none}.cloudlet-host .cloudlet-actions:not(:empty){margin-block:8px 2px}.cloudlet-host :is(.cloudlet-action,.cloudlet-overflow button){overflow-wrap:anywhere;min-width:0;max-width:100%;min-height:32px;color:var(--cloudlet-foreground);background:var(--cloudlet-action-background);border-radius:9999px;padding:6px 14px;font-size:.8125rem;font-weight:500;line-height:1.5;text-decoration:none;position:relative}.cloudlet-host .cloudlet-action.cloudlet-primary{color:color-mix(in oklab, var(--cloudlet-status) 55%, var(--cloudlet-foreground));background:color-mix(in oklab, var(--cloudlet-status) 12%, transparent)}.cloudlet-host :is(.cloudlet-action,.cloudlet-overflow button)[aria-disabled=true]{color:var(--cloudlet-muted)}@media (hover:hover){.cloudlet-host :is(.cloudlet-close,.cloudlet-action,.cloudlet-overflow button):hover{background:color-mix(in oklab, var(--cloudlet-foreground) 13%, transparent)}.cloudlet-host .cloudlet-close:hover{color:var(--cloudlet-foreground)}.cloudlet-host .cloudlet-action.cloudlet-primary:hover{background:color-mix(in oklab, var(--cloudlet-status) 20%, transparent)}}.cloudlet-host .cloudlet-action-error{color:var(--cloudlet-muted);padding-block:4px;font-size:.8125rem}.cloudlet-host .cloudlet-indicator{color:var(--cloudlet-muted);flex-wrap:wrap;flex:none;justify-content:center;align-items:center;column-gap:8px;padding-bottom:6px;font-size:.75rem;display:flex}.cloudlet-host .cloudlet-indicator .cloudlet-dot-button{min-width:24px;min-height:24px;padding:8px}.cloudlet-host .cloudlet-dot{background:color-mix(in oklab, var(--cloudlet-foreground) 25%, transparent);border-radius:50%;width:6px;height:6px;display:block}.cloudlet-host .cloudlet-indicator [aria-current=true] .cloudlet-dot{background:var(--cloudlet-foreground)}.cloudlet-host .cloudlet-page{font-variant-numeric:tabular-nums;padding:8px;display:grid}.cloudlet-host .cloudlet-page>*{grid-area:1/1}.cloudlet-host .cloudlet-overflow{flex-wrap:wrap;justify-content:center;align-items:center;gap:4px 8px;min-width:0;display:flex}.cloudlet-host .cloudlet-overflow button{font-size:.75rem}.cloudlet-host .cloudlet-live{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.cloudlet-announcer{clip-path:inset(50%);white-space:nowrap;pointer-events:none;border:0;width:1px;height:1px;margin:-1px;padding:0;position:fixed;top:0;left:0;overflow:hidden}.cloudlet-host[data-position=top-center]{top:calc(var(--cloudlet-viewport-top,0px) + var(--cloudlet-top));bottom:auto}@media (width>=48rem){.cloudlet-host[data-position=auto]{top:calc(var(--cloudlet-viewport-top,0px) + var(--cloudlet-top));bottom:auto}}.cloudlet-host[data-theme=dark]{--cloudlet-background:#1c1c1e;--cloudlet-foreground:#f5f5f7;--cloudlet-muted:#a1a1aa;--cloudlet-focus:#93b4ff;--cloudlet-shadow:0 12px 32px -12px #0009;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--cloudlet-tail-background:color-mix(in oklab, var(--cloudlet-foreground) 14%, var(--cloudlet-background));--cloudlet-tail-border:color-mix(in oklab, var(--cloudlet-foreground) 18%, transparent)}@media (prefers-color-scheme:dark){.cloudlet-host[data-theme=system]{--cloudlet-background:#1c1c1e;--cloudlet-foreground:#f5f5f7;--cloudlet-muted:#a1a1aa;--cloudlet-focus:#93b4ff;--cloudlet-shadow:0 12px 32px -12px #0009;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--cloudlet-tail-background:color-mix(in oklab, var(--cloudlet-foreground) 14%, var(--cloudlet-background));--cloudlet-tail-border:color-mix(in oklab, var(--cloudlet-foreground) 18%, transparent)}}@keyframes cloudlet-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:no-preference){.cloudlet-host .cloudlet-spinner{animation:.8s linear infinite cloudlet-spin}.cloudlet-host .cloudlet-ring[data-progress=indeterminate]{animation:1s linear infinite cloudlet-spin}.cloudlet-host[data-reduced-motion=true] :is(.cloudlet-spinner,.cloudlet-ring){animation:none}}@media (forced-colors:active){.cloudlet-host[data-theme]{--cloudlet-background:Canvas;--cloudlet-foreground:CanvasText;--cloudlet-muted:CanvasText;--cloudlet-border:CanvasText;--cloudlet-focus:Highlight;--cloudlet-action-background:Canvas;--cloudlet-status:CanvasText;--cloudlet-success:CanvasText;--cloudlet-error:CanvasText;--cloudlet-info:CanvasText;--cloudlet-warning:CanvasText;--cloudlet-loading:CanvasText;--cloudlet-badge:Highlight;--cloudlet-badge-foreground:HighlightText}.cloudlet-host :is(.cloudlet-bg,.cloudlet-icon,.cloudlet-badge,.cloudlet-dot){forced-color-adjust:none}.cloudlet-host .cloudlet-icon{outline-offset:-1px;background:canvas;outline:1px solid canvastext}.cloudlet-host .cloudlet-ring-track{stroke:graytext}.cloudlet-host .cloudlet-dot{background:canvas;outline:1px solid canvastext}.cloudlet-host .cloudlet-indicator [aria-current=true] .cloudlet-dot{background:canvastext}.cloudlet-host :is(.cloudlet-close,.cloudlet-action,.cloudlet-overflow button){border:1px solid buttontext}}
|
|
1
|
+
.cloudlet-host{--cloudlet-pill-height:44px;--cloudlet-pill-radius:9999px;--cloudlet-pill-max-width:22rem;--cloudlet-island-radius:24px;--cloudlet-island-max-width:26rem;--cloudlet-tail-offset:4px;--cloudlet-tail-scale:.9;--cloudlet-control-min-size:44px;--cloudlet-viewport-gutter:16px;--cloudlet-font-family:system-ui, sans-serif;--cloudlet-font-size:.875rem;--cloudlet-background:#fff;--cloudlet-foreground:#111113;--cloudlet-muted:#6e6e76;--cloudlet-border:color-mix(in oklab, var(--cloudlet-foreground) 10%, transparent);--cloudlet-action-background:color-mix(in oklab, var(--cloudlet-foreground) 8%, transparent);--cloudlet-shadow:0 10px 30px -12px #00000040, 0 1px 2px #00000014;--cloudlet-tail-background:var(--cloudlet-background);--cloudlet-tail-border:var(--cloudlet-border);--cloudlet-focus:#245cdb;--cloudlet-success:oklch(72.3% .219 142.136);--cloudlet-error:oklch(63.7% .237 25.331);--cloudlet-info:oklch(68.5% .169 237.323);--cloudlet-warning:oklch(79.5% .184 86.047);--cloudlet-loading:oklch(55.6% 0 0);--cloudlet-badge:#d70015;--cloudlet-badge-foreground:#fff;--cloudlet-field-background:var(--cloudlet-action-background);--cloudlet-field-border:transparent;--cloudlet-placeholder:color-mix(in oklab, var(--cloudlet-muted) 85%, var(--cloudlet-foreground));--cloudlet-z-index:1000;--cloudlet-safe-top:env(safe-area-inset-top,0px);--cloudlet-safe-right:env(safe-area-inset-right,0px);--cloudlet-safe-bottom:env(safe-area-inset-bottom,0px);--cloudlet-safe-left:env(safe-area-inset-left,0px);--cloudlet-top:calc(var(--cloudlet-safe-top) + var(--cloudlet-gutter-top,var(--cloudlet-viewport-gutter)) + var(--cloudlet-obstruction-top,0px));--cloudlet-bottom:calc(var(--cloudlet-safe-bottom) + var(--cloudlet-gutter-bottom,var(--cloudlet-viewport-gutter)) + var(--cloudlet-obstruction-bottom,0px));--cloudlet-left:calc(var(--cloudlet-safe-left) + var(--cloudlet-gutter-left,var(--cloudlet-viewport-gutter)) + var(--cloudlet-obstruction-left,0px));--cloudlet-right:calc(var(--cloudlet-safe-right) + var(--cloudlet-gutter-right,var(--cloudlet-viewport-gutter)) + var(--cloudlet-obstruction-right,0px));--cloudlet-host-height:max(0px, calc(var(--cloudlet-viewport-height,100dvh) - var(--cloudlet-top) - var(--cloudlet-bottom)));--cloudlet-available-height:max(0px, calc(var(--cloudlet-host-height) - var(--cloudlet-reserved-height,0px)));z-index:var(--cloudlet-z-index);left:calc(var(--cloudlet-viewport-left,0px) + var(--cloudlet-left));right:calc(var(--cloudlet-viewport-right,0px) + var(--cloudlet-right));bottom:calc(var(--cloudlet-viewport-bottom,0px) + var(--cloudlet-bottom));max-width:var(--cloudlet-island-max-width);max-height:var(--cloudlet-host-height);color:var(--cloudlet-foreground);font:400 var(--cloudlet-font-size)/1.43 var(--cloudlet-font-family);text-align:start;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;pointer-events:none;isolation:isolate;--cloudlet-status:var(--cloudlet-loading);flex-direction:column;margin-inline:auto;display:flex;position:fixed}.cloudlet-host,.cloudlet-host *,.cloudlet-host :before,.cloudlet-host :after{box-sizing:border-box}.cloudlet-host :where(h2,p,ol,li){margin:0;padding:0}.cloudlet-host :where(button,a){font:inherit;color:inherit;line-height:inherit;letter-spacing:inherit;text-transform:none;min-width:var(--cloudlet-control-min-size);min-height:var(--cloudlet-control-min-size);touch-action:manipulation}.cloudlet-host button{appearance:none;cursor:pointer;background:0 0;border:0;border-radius:24px;justify-content:center;align-items:center;margin:0;padding:10px;display:inline-flex}.cloudlet-host button[aria-disabled=true]{color:var(--cloudlet-muted);cursor:progress}.cloudlet-host a{border-radius:24px;align-items:center;padding:10px 16px;text-decoration:underline;display:inline-flex}.cloudlet-host :focus-visible{outline:2px solid var(--cloudlet-focus);outline-offset:2px}.cloudlet-host:focus-visible{outline:2px solid var(--cloudlet-focus);outline-offset:-2px}.cloudlet-host [hidden]{display:none!important}.cloudlet-host [data-kind=success]{--cloudlet-status:var(--cloudlet-success)}.cloudlet-host [data-kind=error]{--cloudlet-status:var(--cloudlet-error)}.cloudlet-host [data-kind=info]{--cloudlet-status:var(--cloudlet-info)}.cloudlet-host [data-kind=warning]{--cloudlet-status:var(--cloudlet-warning)}.cloudlet-host [data-kind=loading]{--cloudlet-status:var(--cloudlet-loading)}.cloudlet-host .cloudlet-stack{flex:none;align-self:center;width:fit-content;max-width:100%;position:relative}.cloudlet-host[data-state=island] .cloudlet-stack{width:100%}.cloudlet-host .cloudlet-shell{transform-origin:50% 0;z-index:1;position:relative}.cloudlet-host[data-edge=bottom] .cloudlet-shell{transform-origin:50% 100%}.cloudlet-host .cloudlet-bg{pointer-events:none;box-shadow:var(--cloudlet-shadow);position:absolute;top:0;left:50%;overflow:visible;transform:translate(-50%)}.cloudlet-host .cloudlet-bg path{fill:var(--cloudlet-background);stroke:var(--cloudlet-border);stroke-width:1px}.cloudlet-host :is(.cloudlet-tail,.cloudlet-exit){pointer-events:none;position:absolute;top:0;left:50%}.cloudlet-host .cloudlet-tail{z-index:0;border-radius:var(--cloudlet-pill-radius);background:var(--cloudlet-tail-background);border:1px solid var(--cloudlet-tail-border);box-shadow:var(--cloudlet-shadow);transform-origin:50% 100%;opacity:0}.cloudlet-host .cloudlet-tail[data-cloudlet-tail="2"]{z-index:-1;background:color-mix(in oklab, var(--cloudlet-tail-background) 60%, var(--cloudlet-background))}.cloudlet-host .cloudlet-exit{z-index:2;transform-origin:50% 0}.cloudlet-host[data-edge=bottom] :is(.cloudlet-bg,.cloudlet-tail,.cloudlet-exit,.cloudlet-badge){top:auto;bottom:0}.cloudlet-host[data-edge=bottom] .cloudlet-tail{transform-origin:50% 0}.cloudlet-host[data-edge=bottom] .cloudlet-exit{transform-origin:50% 100%}.cloudlet-host .cloudlet-exit:empty{display:none}.cloudlet-host .cloudlet-clip{pointer-events:auto;color:var(--cloudlet-foreground);overflow-wrap:anywhere;width:fit-content;min-width:0;max-width:min(100%, var(--cloudlet-pill-max-width));min-height:var(--cloudlet-pill-height);border-radius:var(--cloudlet-pill-radius);flex-direction:column;display:flex;position:relative}.cloudlet-host .cloudlet-shell[data-state=island]>.cloudlet-clip{width:100%;max-width:100%;max-height:var(--cloudlet-available-height);border-radius:var(--cloudlet-island-radius)}.cloudlet-host :is(.cloudlet-slide-out,.cloudlet-chrome-out){pointer-events:none;position:absolute;top:0;left:0}.cloudlet-host :is(.cloudlet-slide-out,.cloudlet-chrome-out):empty{display:none}.cloudlet-host .cloudlet-chrome-out .cloudlet-clip{width:100%;max-width:none}.cloudlet-host .cloudlet-ghost{visibility:hidden}.cloudlet-host .cloudlet-slide{flex-direction:column;flex:0 auto;min-height:0;display:flex;position:relative}.cloudlet-host .cloudlet-header{flex:none;min-width:0;display:flex;position:relative}.cloudlet-host .cloudlet-heading{min-width:0;min-height:var(--cloudlet-pill-height);flex:1;align-items:center;gap:10px;padding-block:6px;padding-inline:10px 16px;display:flex}.cloudlet-host .cloudlet-shell[data-state=island] .cloudlet-heading{padding-block:10px 6px;padding-inline:14px 52px}.cloudlet-host .cloudlet-heading-out{pointer-events:none;display:flex;position:absolute;inset:0}.cloudlet-host .cloudlet-heading-out:empty{display:none}.cloudlet-host .cloudlet-title{font:inherit;text-transform:none;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-weight:500;overflow:hidden}.cloudlet-host .cloudlet-shell[data-state=island] .cloudlet-title{white-space:normal;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box}.cloudlet-host .cloudlet-title:focus{outline:none}.cloudlet-host .cloudlet-title:focus-visible{outline:2px solid var(--cloudlet-focus);outline-offset:2px;border-radius:4px}.cloudlet-host .cloudlet-pill{z-index:1;pointer-events:auto;border-radius:var(--cloudlet-pill-radius);width:100%;height:100%;padding:0;position:absolute;inset:0}.cloudlet-host .cloudlet-pill,.cloudlet-host .cloudlet-shell[data-state=island]>.cloudlet-clip,.cloudlet-host .cloudlet-shell[data-state=island] .cloudlet-body{touch-action:pan-y}.cloudlet-host .cloudlet-shell[data-state=island]>.cloudlet-clip>.cloudlet-slide>.cloudlet-header{touch-action:none}.cloudlet-host[data-dragging]{-webkit-user-select:none;user-select:none}.cloudlet-host .cloudlet-peek{pointer-events:none;position:absolute;top:0;left:0}.cloudlet-host .cloudlet-badge{z-index:2;background:var(--cloudlet-badge);min-width:20px;height:20px;color:var(--cloudlet-badge-foreground);box-shadow:0 0 0 2px var(--cloudlet-background);font:600 .6875rem/20px var(--cloudlet-font-family);font-variant-numeric:tabular-nums;text-align:center;pointer-events:none;opacity:0;border-radius:9999px;padding-inline:6px;display:grid;position:absolute;top:0;left:50%}.cloudlet-host .cloudlet-badge>*{grid-area:1/1}.cloudlet-host .cloudlet-icon{width:24px;height:24px;color:var(--cloudlet-status);background:color-mix(in oklab, var(--cloudlet-status) 18%, transparent);border-radius:50%;flex:none;place-items:center;display:grid;position:relative}.cloudlet-host .cloudlet-glyph{place-items:center;width:16px;height:16px;display:grid;overflow:hidden}.cloudlet-host .cloudlet-glyph>.cloudlet-slot{place-items:center;width:100%;height:100%;display:grid}.cloudlet-host .cloudlet-glyph :is(svg,img){max-width:100%;max-height:100%;display:block}.cloudlet-host :is(svg.cloudlet-glyph,button>svg){fill:none;stroke:currentColor;stroke-width:1.75px;stroke-linecap:round;stroke-linejoin:round;display:block}.cloudlet-host .cloudlet-ring{fill:none;stroke-width:2px;width:32px;height:32px;position:absolute;inset:-4px;overflow:visible}.cloudlet-host .cloudlet-ring-track{stroke:color-mix(in oklab, var(--cloudlet-status) 18%, transparent)}.cloudlet-host .cloudlet-progress-fill{stroke:color-mix(in oklab, var(--cloudlet-status) 75%, var(--cloudlet-foreground));stroke-linecap:round}.cloudlet-host .cloudlet-close{top:8px;z-index:1;width:32px;min-width:0;height:32px;min-height:0;color:var(--cloudlet-muted);background:var(--cloudlet-action-background);border-radius:50%;padding:0;position:absolute;inset-inline-end:8px}.cloudlet-host .cloudlet-close>svg{width:16px;height:16px}.cloudlet-host :is(.cloudlet-close,.cloudlet-action,.cloudlet-overflow button):before{content:"";inset-block:calc((var(--cloudlet-control-min-size) - 32px) / -2);position:absolute;inset-inline:0}.cloudlet-host button.cloudlet-close:before{inset-inline:calc((var(--cloudlet-control-min-size) - 32px) / -2);border-radius:50%}.cloudlet-host .cloudlet-body{overscroll-behavior:contain;min-height:0;max-height:min(calc(var(--cloudlet-available-height) * .6), 24rem);flex-direction:column;padding-block:0 10px;padding-inline:48px 16px;display:flex;position:relative;overflow:auto}.cloudlet-host .cloudlet-body:not(:has(>:not(.cloudlet-actions:empty))){padding-bottom:4px}.cloudlet-host .cloudlet-body-out{pointer-events:none;position:absolute;left:0;right:0}.cloudlet-host .cloudlet-body-out:empty{display:none}.cloudlet-host .cloudlet-description{color:var(--cloudlet-muted);padding-block:0 4px;font-size:.8125rem;line-height:1.45}.cloudlet-host .cloudlet-actions{flex-wrap:wrap;flex:none;gap:12px 8px;display:flex}.cloudlet-host .cloudlet-actions:empty{display:none}.cloudlet-host .cloudlet-actions:not(:empty){margin-block:8px 2px}.cloudlet-host :is(.cloudlet-action,.cloudlet-overflow button){overflow-wrap:anywhere;min-width:0;max-width:100%;min-height:32px;color:var(--cloudlet-foreground);background:var(--cloudlet-action-background);border-radius:9999px;padding:6px 14px;font-size:.8125rem;font-weight:500;line-height:1.5;text-decoration:none;position:relative}.cloudlet-host .cloudlet-action.cloudlet-primary{color:color-mix(in oklab, var(--cloudlet-status) 55%, var(--cloudlet-foreground));background:color-mix(in oklab, var(--cloudlet-status) 12%, transparent)}.cloudlet-host :is(.cloudlet-action,.cloudlet-overflow button)[aria-disabled=true]{color:var(--cloudlet-muted)}@media (hover:hover){.cloudlet-host :is(.cloudlet-close,.cloudlet-action,.cloudlet-overflow button):hover{background:color-mix(in oklab, var(--cloudlet-foreground) 13%, transparent)}.cloudlet-host .cloudlet-close:hover{color:var(--cloudlet-foreground)}.cloudlet-host .cloudlet-action.cloudlet-primary:hover{background:color-mix(in oklab, var(--cloudlet-status) 20%, transparent)}.cloudlet-host .cloudlet-action.cloudlet-submit:hover{background:color-mix(in oklab, var(--cloudlet-status) 70%, #000)}}.cloudlet-host .cloudlet-action-error{color:var(--cloudlet-muted);padding-block:4px;font-size:.8125rem}.cloudlet-host .cloudlet-form{flex-direction:column;gap:8px;margin-block:4px 2px;display:flex}.cloudlet-host .cloudlet-form-row{grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:4px 8px;display:grid}.cloudlet-host .cloudlet-field{border:1px solid var(--cloudlet-field-border);width:100%;min-width:0;min-height:36px;color:var(--cloudlet-foreground);background:var(--cloudlet-field-background);font:inherit;resize:none;overflow-wrap:anywhere;border-radius:18px;grid-column:1;margin:0;padding:7px 13px;line-height:20px}.cloudlet-host .cloudlet-field::placeholder{color:var(--cloudlet-placeholder);opacity:1}.cloudlet-host .cloudlet-field:focus-visible{outline-offset:1px}.cloudlet-host .cloudlet-field[aria-invalid=true]{border-color:var(--cloudlet-error)}.cloudlet-host .cloudlet-field[aria-invalid=true]:focus-visible{outline-color:var(--cloudlet-error);border-color:#0000}.cloudlet-host .cloudlet-field[readonly]{color:var(--cloudlet-muted)}.cloudlet-host :is(.cloudlet-form>.cloudlet-action-error,.cloudlet-form~.cloudlet-action-error){padding-inline:14px}.cloudlet-host .cloudlet-field-error{color:color-mix(in oklab, var(--cloudlet-error) 70%, var(--cloudlet-foreground));grid-column:1/-1;padding-inline:14px;font-size:.8125rem}.cloudlet-host .cloudlet-action.cloudlet-submit{color:#fff;background:color-mix(in oklab, var(--cloudlet-status) 80%, #000);border-radius:50%;grid-column:2;place-items:center;width:36px;min-width:0;height:36px;min-height:0;padding:0;display:grid}.cloudlet-host .cloudlet-submit>svg{stroke-width:2px;width:16px;height:16px}.cloudlet-host button.cloudlet-submit:before{inset:calc((var(--cloudlet-control-min-size) - 36px) / -2);border-radius:50%}.cloudlet-host .cloudlet-indicator{color:var(--cloudlet-muted);flex-wrap:wrap;flex:none;justify-content:center;align-items:center;column-gap:8px;padding-bottom:6px;font-size:.75rem;display:flex}.cloudlet-host .cloudlet-indicator .cloudlet-dot-button{min-width:24px;min-height:24px;padding:8px}.cloudlet-host .cloudlet-dot{background:color-mix(in oklab, var(--cloudlet-foreground) 25%, transparent);border-radius:50%;width:6px;height:6px;display:block}.cloudlet-host .cloudlet-indicator [aria-current=true] .cloudlet-dot{background:var(--cloudlet-foreground)}.cloudlet-host .cloudlet-page{font-variant-numeric:tabular-nums;padding:8px;display:grid}.cloudlet-host .cloudlet-page>*{grid-area:1/1}.cloudlet-host .cloudlet-overflow{flex-wrap:wrap;justify-content:center;align-items:center;gap:4px 8px;min-width:0;display:flex}.cloudlet-host .cloudlet-overflow button{font-size:.75rem}.cloudlet-host .cloudlet-live{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.cloudlet-announcer{clip-path:inset(50%);white-space:nowrap;pointer-events:none;border:0;width:1px;height:1px;margin:-1px;padding:0;position:fixed;top:0;left:0;overflow:hidden}.cloudlet-host[data-position=top-center]{top:calc(var(--cloudlet-viewport-top,0px) + var(--cloudlet-top));bottom:auto}@media (width>=48rem){.cloudlet-host[data-position=auto]{top:calc(var(--cloudlet-viewport-top,0px) + var(--cloudlet-top));bottom:auto}}.cloudlet-host[data-theme=dark]{--cloudlet-background:#1c1c1e;--cloudlet-foreground:#f5f5f7;--cloudlet-muted:#a1a1aa;--cloudlet-focus:#93b4ff;--cloudlet-shadow:0 12px 32px -12px #0009;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--cloudlet-tail-background:color-mix(in oklab, var(--cloudlet-foreground) 14%, var(--cloudlet-background));--cloudlet-tail-border:color-mix(in oklab, var(--cloudlet-foreground) 18%, transparent)}@media (prefers-color-scheme:dark){.cloudlet-host[data-theme=system]{--cloudlet-background:#1c1c1e;--cloudlet-foreground:#f5f5f7;--cloudlet-muted:#a1a1aa;--cloudlet-focus:#93b4ff;--cloudlet-shadow:0 12px 32px -12px #0009;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--cloudlet-tail-background:color-mix(in oklab, var(--cloudlet-foreground) 14%, var(--cloudlet-background));--cloudlet-tail-border:color-mix(in oklab, var(--cloudlet-foreground) 18%, transparent)}}@keyframes cloudlet-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:no-preference){.cloudlet-host .cloudlet-spinner{animation:.8s linear infinite cloudlet-spin}.cloudlet-host .cloudlet-ring[data-progress=indeterminate]{animation:1s linear infinite cloudlet-spin}.cloudlet-host[data-reduced-motion=true] :is(.cloudlet-spinner,.cloudlet-ring){animation:none}}@media (forced-colors:active){.cloudlet-host[data-theme]{--cloudlet-background:Canvas;--cloudlet-foreground:CanvasText;--cloudlet-muted:CanvasText;--cloudlet-border:CanvasText;--cloudlet-focus:Highlight;--cloudlet-action-background:Canvas;--cloudlet-status:CanvasText;--cloudlet-success:CanvasText;--cloudlet-error:CanvasText;--cloudlet-info:CanvasText;--cloudlet-warning:CanvasText;--cloudlet-loading:CanvasText;--cloudlet-badge:Highlight;--cloudlet-badge-foreground:HighlightText}.cloudlet-host :is(.cloudlet-bg,.cloudlet-icon,.cloudlet-badge,.cloudlet-dot){forced-color-adjust:none}.cloudlet-host .cloudlet-icon{outline-offset:-1px;background:canvas;outline:1px solid canvastext}.cloudlet-host .cloudlet-ring-track{stroke:graytext}.cloudlet-host .cloudlet-dot{background:canvas;outline:1px solid canvastext}.cloudlet-host .cloudlet-indicator [aria-current=true] .cloudlet-dot{background:canvastext}.cloudlet-host :is(.cloudlet-close,.cloudlet-action,.cloudlet-overflow button){border:1px solid buttontext}.cloudlet-host .cloudlet-field{color:fieldtext;background:field;border-color:canvastext}.cloudlet-host .cloudlet-field[aria-invalid=true]{border-width:2px}.cloudlet-host .cloudlet-action.cloudlet-submit{forced-color-adjust:none;color:highlighttext;background:highlight;border-color:highlight}}
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudlet/toast",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Cloudlet notifications and async operations with an SSR-safe React renderer",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://cloudlet.dev/toaster",
|
|
7
|
+
"repository": { "type": "git", "url": "git+https://github.com/Meerzus/cloudlet.git", "directory": "packages/toast" },
|
|
8
|
+
"bugs": "https://github.com/Meerzus/cloudlet/issues",
|
|
7
9
|
"keywords": ["react", "notifications", "toast", "snackbar", "accessibility", "async", "operations", "ssr"],
|
|
8
|
-
"publishConfig": { "access": "public", "tag": "
|
|
10
|
+
"publishConfig": { "access": "public", "tag": "latest" },
|
|
9
11
|
"type": "module",
|
|
10
12
|
"types": "./dist/index.d.ts",
|
|
11
13
|
"exports": {
|
|
@@ -11,6 +11,10 @@ export interface FallbackMessages {
|
|
|
11
11
|
readonly cancellationRequested: string;
|
|
12
12
|
readonly actionError: string;
|
|
13
13
|
readonly renderError: string;
|
|
14
|
+
/** A required form field is empty. */
|
|
15
|
+
readonly fieldRequired: string;
|
|
16
|
+
/** A form field is longer than its `maxLength`. */
|
|
17
|
+
readonly fieldTooLong: string;
|
|
14
18
|
}
|
|
15
19
|
|
|
16
20
|
export interface ControllerOptions {
|
|
@@ -42,8 +46,9 @@ export type ClearResult =
|
|
|
42
46
|
| { readonly status: 'rejected'; readonly reason: 'disposed' };
|
|
43
47
|
|
|
44
48
|
export interface CloudletController<Slot = never, Signal extends CancellationSignal = CancellationSignal> {
|
|
45
|
-
|
|
46
|
-
readonly
|
|
49
|
+
/** `Name` is inferred from the field names of a form action. */
|
|
50
|
+
readonly show: <Name extends string = string>(spec: NotificationSpec<Slot, Name>) => AdmissionResult;
|
|
51
|
+
readonly update: <Name extends string = string>(handle: NotificationHandle, patch: NotificationPatch<Slot, Name>) => MutationResult;
|
|
47
52
|
readonly getHandle: (id: string) => NotificationHandle | undefined;
|
|
48
53
|
readonly track: <T>(source: OperationSource<T, Signal>, options: TrackOptions<T, Slot, Signal>) => OperationHandle<T>;
|
|
49
54
|
readonly dismiss: (handle: NotificationHandle) => MutationResult;
|
package/src/contracts/events.ts
CHANGED