@cloudlet/toast 1.1.1 → 1.2.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 +34 -0
- package/README.md +7 -0
- package/dist/contracts/internal.d.ts +8 -0
- package/dist/contracts/internal.d.ts.map +1 -1
- package/dist/contracts/notifications.d.ts +1 -1
- package/dist/contracts/notifications.d.ts.map +1 -1
- package/dist/core/bridge.js +1 -0
- package/dist/core/bridge.js.map +1 -1
- package/dist/core/controller.d.ts +2 -1
- package/dist/core/controller.d.ts.map +1 -1
- package/dist/core/controller.js +45 -41
- package/dist/core/controller.js.map +1 -1
- package/dist/react/card.d.ts.map +1 -1
- package/dist/react/card.js +2 -0
- package/dist/react/card.js.map +1 -1
- package/dist/react/host.d.ts.map +1 -1
- package/dist/react/host.js +225 -194
- package/dist/react/host.js.map +1 -1
- package/dist/react.d.ts +7 -1
- package/dist/react.d.ts.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/contracts/internal.ts +4 -0
- package/src/contracts/notifications.ts +1 -0
- package/src/core/bridge.ts +2 -0
- package/src/core/controller.ts +23 -16
- package/src/react/card.tsx +2 -1
- package/src/react/host.tsx +41 -4
- package/src/react.ts +7 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controller.js","names":["freeze","handles","kernels","nextController","EMPTY","COLLAPSED","SERVER","RENDERER_SERVER","IDLE","NO_FORM_ERRORS","APPLIED","UNCHANGED","reject","getControllerKernel","kernel","controller","createCloudletCore","options","validateOptions","inputOptions","dependencies","clock","identity","records","listeners","eventListeners","operationSubscriptions","globalPauses","batches","focused","focusRequest","lease","lastLease","serial","autoId","revision","eventSequence","island","presented","hostDelay","hostAutoDismiss","attention","cancelAttention","attentionEpoch","overflow","overflowAnnounced","disposed","delivering","cancelTimer","timerEpoch","snapshot","rendererSnapshot","token","stackOrder","newest","retryable","operation","record","requiresAction","wantsAttention","rule","formOf","action","field","dirty","form","interacting","pauses","current","handleError","handle","withRecord","args","error","diagnostic","diagnosticValue","failure","source","notifyListeners","listener","set","enqueue","notify","delivery","deliveries","event","release","at","final","batch","settle","now","stopTimer","schedule","deadline","active","epoch","due","commit","publish","notifications","present","armAttention","mutate","apply","assign","retire","next","stopAttention","nominate","candidate","autoDismissing","host","setHostAutoDismiss","changed","value","budget","remove","order","index","onClose","notice","dismiss","reason","acknowledgeOverflow","subscribe","admit","issues","validateSpec","spec","insert","existing","occurrences","overflowValue","id","copyContent","initialize","emit","replaceContent","content","kind","track","factory","sourceThen","validateTrackOptions","input","key","cancelValue","cancelCallback","classifierValue","classifier","config","subscribers","notification","attached","snapshotValue","attemptNumber","createAttempt","cancellation","context","resolve","fail","result","fulfill","rejectResult","attempt","finish","first","getSnapshot","live","binding","run","deliver","initialStatus","status","fallback","mapper","mapped","validateContent","uiApplied","requestCancellation","patchContent","cancellationReason","cancel","start","restart","previous","admission","admitted","unsubscribe","validatePatch","patch","priority","durationChanged","previousBudget","nextBudget","count","target","copied"],"sources":["../../src/core/controller.ts"],"sourcesContent":["import type { CloudletController, ControllerOptions, FocusTarget } from '../contracts/controller.js';\nimport type { Diagnostic, EventBase, SemanticEvent } from '../contracts/events.js';\nimport type { ActionAttemptToken, ControllerIdentity, Generation, HandleRejection, NotificationHandle, OperationAttemptToken, Unsubscribe } from '../contracts/identity.js';\nimport type {\n FocusRequest, FocusRequestToken, ControllerDependencies, FormErrors, HostLease, OperationAnnouncementPhase, PresentationToken,\n RendererSnapshot,\n} from '../contracts/internal.js';\nimport type { AdmissionResult, CloseReason, FormAction, NotificationContent, NotificationKind, NotificationPatch, NotificationSpec, OperationAdmissionResult, Priority } from '../contracts/notifications.js';\nimport type { AttemptStartResult, CancellationSignal, CancelResult, OperationAttempt, OperationContext, OperationHandle, OperationSnapshot, OperationSource, OperationStatus, TrackOptions } from '../contracts/operations.js';\nimport type { ActionSnapshot, ControllerSnapshot, IslandReason, IslandSnapshot, PauseReason } from '../contracts/snapshots.js';\nimport { copyContent, patchContent, validateContent, validateOptions, validatePatch, validateSpec, validateTrackOptions } from './validation.js';\n\nexport interface OperationBinding {\n readonly getSnapshot: () => OperationSnapshot;\n readonly retry: () => AttemptStartResult<unknown>;\n readonly cancel: (reason?: unknown) => CancelResult;\n readonly detach: () => Delivery;\n}\n\ntype EventPayload = SemanticEvent extends infer E ? E extends SemanticEvent ? Omit<E, keyof EventBase> : never : never;\nexport type Delivery = EventPayload | { readonly callback: () => void; readonly source: string; readonly handle?: NotificationHandle };\n\nexport interface RecordState<Slot> {\n readonly handle: NotificationHandle;\n readonly dedupeKey: string | undefined;\n readonly onClose: NotificationSpec<Slot>['onClose'];\n content: Readonly<NotificationContent<Slot>>;\n kind: NotificationKind;\n priority: Priority;\n occurrences: number;\n remaining: number | null;\n activeSince: number | null;\n presentation: PresentationToken | null;\n readable: boolean;\n everPresented: boolean;\n readonly pauses: Set<PauseReason>;\n queuedAnnounced: boolean;\n firstAnnounced: boolean;\n occurrencesAnnounced: number;\n operation: OperationBinding | null;\n readonly operationAnnounced: Set<OperationAnnouncementPhase>;\n action: ActionSnapshot;\n actionAnnounced?: { readonly token: ActionAttemptToken; readonly status: 'pending' | 'failed' };\n /** Values of the form action the record holds; a new action object starts from its defaults. */\n form: FormState | null;\n}\n\nexport interface FormState {\n readonly action: FormAction;\n values: Readonly<Record<string, string>>;\n errors: FormErrors;\n}\n\n/** Open Island state; `null` is the collapsed stack. */\nexport interface IslandState<Slot> {\n readonly reason: IslandReason;\n current: RecordState<Slot>;\n}\n\nexport interface AttentionCandidate<Slot> {\n readonly record: RecordState<Slot>;\n due: number;\n /** Expired during user interaction or without a host; restarts the delay afterwards. */\n waiting: boolean;\n}\n\nexport const ATTENTION_DELAY = 600;\n\nconst freeze = Object.freeze;\n\n// Weak registries authenticate capabilities without retaining disposed controllers.\nconst handles = new WeakSet<object>();\nconst kernels = new WeakMap<object, ControllerKernel<unknown>>();\nlet nextController = 0;\nconst EMPTY: readonly never[] = freeze([]);\nconst COLLAPSED: IslandSnapshot = freeze({ open: false, reason: null, current: null });\nconst SERVER: ControllerSnapshot<never> = freeze({\n controller: null, revision: 0, disposed: false, notifications: EMPTY, stack: EMPTY,\n island: COLLAPSED, overflow: freeze({ count: 0, pending: false }),\n});\nexport const RENDERER_SERVER: RendererSnapshot<never> = freeze({\n ...SERVER, presentation: null, focusRequest: null, forms: EMPTY,\n announcements: freeze({ notifications: EMPTY, overflowCount: 0 }),\n});\nconst IDLE = freeze({ status: 'idle' as const });\nexport const NO_FORM_ERRORS: FormErrors = freeze({ form: null, fields: freeze({}) });\nexport const APPLIED = freeze({ status: 'applied' as const });\nexport const UNCHANGED = freeze({ status: 'unchanged' as const });\nexport const reject = <Reason extends string>(reason: Reason) => ({ status: 'rejected' as const, reason });\n\ntype Rejected<Reason extends string> = { status: 'rejected'; reason: Reason };\n\n/**\n * Controller state and transactions the renderer bridge needs (core/bridge.ts). The bridge travels\n * in the lazily loaded renderer chunk, so the start bundle carries only this accessor object.\n */\nexport interface ControllerKernel<Slot> {\n readonly options: ReturnType<typeof validateOptions>;\n readonly clock: ControllerDependencies<CancellationSignal>['clock'];\n readonly records: Map<string, RecordState<Slot>>;\n readonly globalPauses: Set<PauseReason>;\n readonly subscribe: CloudletController<Slot, CancellationSignal>['subscribe'];\n readonly onEvent: CloudletController<Slot, CancellationSignal>['onEvent'];\n readonly disposed: boolean;\n readonly presented: RecordState<Slot> | null;\n readonly rendererSnapshot: RendererSnapshot<Slot>;\n readonly overflow: number;\n lease: HostLease | null;\n lastLease: HostLease | null;\n hostDelay: number | undefined;\n hostAutoDismiss: boolean | undefined;\n island: IslandState<Slot> | null;\n attention: AttentionCandidate<Slot> | null;\n focusRequest: FocusRequest | null;\n focused: NotificationHandle | null;\n overflowAnnounced: number;\n readonly token: () => string;\n readonly diagnostic: (diagnostic: Diagnostic) => void;\n readonly failure: (code: Diagnostic['code'], source: string, error: unknown, handle?: NotificationHandle) => void;\n readonly mutate: (apply: (deliveries: Delivery[]) => void, final?: boolean) => typeof APPLIED;\n readonly commit: (deliveries?: readonly Delivery[], now?: number, final?: boolean) => void;\n readonly settle: () => number;\n readonly assign: (record: RecordState<Slot>) => void;\n readonly newest: () => RecordState<Slot> | null;\n readonly formOf: (record: RecordState<Slot>) => FormState | null;\n readonly handleError: (handle: NotificationHandle) => HandleRejection | 'disposed' | undefined;\n readonly withRecord: <Args extends unknown[], Result>(action: (record: RecordState<Slot>, ...args: Args) => Result)\n => (handle: NotificationHandle, ...args: Args) => Result | Rejected<HandleRejection | 'disposed'>;\n readonly autoDismissing: (host: boolean | undefined) => boolean;\n readonly setHostAutoDismiss: (value: boolean | undefined) => void;\n readonly dismiss: (handle: NotificationHandle, reason: CloseReason) => typeof APPLIED | Rejected<HandleRejection | 'disposed'>;\n readonly acknowledgeOverflow: () => typeof APPLIED | typeof UNCHANGED | Rejected<'disposed'>;\n readonly reportRendererLoadError: (error: unknown) => void;\n}\n\nexport function getControllerKernel<Slot>(controller: object): ControllerKernel<Slot> {\n const kernel = kernels.get(controller);\n if (!kernel) throw new TypeError('Controller was not created by this Cloudlet package instance');\n // The registry stores the kernel together with its controller's opaque Slot type.\n return kernel as ControllerKernel<Slot>;\n}\n\n/** The sole owner of notification state, the stack/Island, budgets, attention and host leases. */\nexport function createCloudletCore<Slot = never, Signal extends CancellationSignal = CancellationSignal>(\n inputOptions: ControllerOptions | undefined,\n dependencies: ControllerDependencies<Signal>,\n): CloudletController<Slot, Signal> {\n const options = validateOptions(inputOptions);\n if (!dependencies?.clock || typeof dependencies.clock.now !== 'function' || typeof dependencies.clock.schedule !== 'function') {\n throw new TypeError('Cloudlet requires a monotonic clock');\n }\n const clock = dependencies.clock;\n if (typeof dependencies.createCancellation !== 'function') throw new TypeError('Cloudlet requires a cancellation source factory');\n const identity = `cloudlet-${++nextController}` as ControllerIdentity;\n const records = new Map<string, RecordState<Slot>>();\n const listeners = new Set<() => void>();\n const eventListeners = new Set<(event: SemanticEvent) => void>();\n const operationSubscriptions = new Map<Set<() => void>, Delivery>();\n const globalPauses = new Set<PauseReason>();\n const batches: (() => void)[] = [];\n let focused: NotificationHandle | null = null;\n let focusRequest: FocusRequest | null = null;\n let lease: HostLease | null = null;\n let lastLease: HostLease | null = null;\n let serial = 0;\n let autoId = 0;\n let revision = 0;\n let eventSequence = 0;\n let island: IslandState<Slot> | null = null;\n // The presented record: Island current when open, otherwise the newest record.\n let presented: RecordState<Slot> | null = null;\n let hostDelay: number | undefined;\n /** `Toaster autoDismiss`: overrides ControllerOptions.autoDismiss while defined and attached. */\n let hostAutoDismiss: boolean | undefined;\n let attention: AttentionCandidate<Slot> | null = null;\n let cancelAttention: Unsubscribe | null = null;\n let attentionEpoch = 0;\n let overflow = 0;\n let overflowAnnounced = 0;\n let disposed = false;\n let delivering = false;\n let cancelTimer: Unsubscribe | null = null;\n let timerEpoch = 0;\n let snapshot: ControllerSnapshot<Slot>;\n let rendererSnapshot: RendererSnapshot<Slot>;\n\n const token = () => `${identity}:${++serial}`;\n // Map insertion order is admission order; the stack shows newest first.\n const stackOrder = () => [...records.values()].reverse();\n const newest = (): RecordState<Slot> | null => stackOrder()[0] ?? null;\n // A settled factory can always retry; only an unsuccessful attempt offers retry as an action.\n const retryable = (record: RecordState<Slot>) => {\n const operation = record.operation?.getSnapshot();\n return !!operation?.canRetry && operation.status !== 'fulfilled';\n };\n const requiresAction = (record: RecordState<Slot>) => !!record.content.action\n || retryable(record) || record.content.attention === 'open';\n const wantsAttention = (record: RecordState<Slot>) => {\n const rule = record.content.attention ?? 'auto';\n return rule === 'open' || (rule === 'auto' && (requiresAction(record) || !!record.content.description));\n };\n /** The record's form state, started from the field defaults whenever its form action object changes. */\n const formOf = (record: RecordState<Slot>): FormState | null => {\n const action = record.content.action;\n if (action?.kind !== 'form') return record.form = null;\n if (record.form?.action !== action) {\n record.form = { action, errors: NO_FORM_ERRORS,\n values: freeze(Object.fromEntries(action.fields.map((field) => [field.name, field.defaultValue ?? '']))) };\n }\n return record.form;\n };\n const dirty = (record: RecordState<Slot>) => {\n const form = formOf(record);\n return !!form && form.action.fields.some((field) => form.values[field.name] !== (field.defaultValue ?? ''));\n };\n // A draft in the open Island holds it like a hand on it: attention never switches it away.\n const interacting = () => globalPauses.has('hover') || globalPauses.has('focus')\n || [...records.values()].some((record) => record.pauses.has('gesture')) || (!!island && dirty(island.current));\n const pauses = (record: RecordState<Slot>): PauseReason[] => {\n const current = record === presented;\n return [\n ...(!current ? ['inactive' as const] : []),\n ...(lease === null ? ['no-host' as const] : []),\n ...(current && !record.readable ? ['presentation-pending' as const] : []),\n // An Island opened by the user, or a slide that asks for action, keeps its time.\n ...(current && island && (island.reason === 'user' || requiresAction(record)) ? ['island' as const] : []),\n ...(record.action.status === 'pending' ? ['action-pending' as const] : []),\n ...(dirty(record) ? ['draft' as const] : []),\n ...globalPauses, ...record.pauses,\n ];\n };\n const handleError = (handle: NotificationHandle): HandleRejection | 'disposed' | undefined => {\n if (disposed) return 'disposed';\n if (typeof handle !== 'object' || handle === null || !handles.has(handle)) return 'invalid-handle';\n if (handle.controller !== identity) return 'foreign-controller';\n if (records.get(handle.id)?.handle !== handle) return 'stale-handle';\n return undefined;\n };\n\n // Capability validation always precedes method-specific validation/mutation.\n function withRecord<Args extends unknown[], Result>(action: (record: RecordState<Slot>, ...args: Args) => Result) {\n return (handle: NotificationHandle, ...args: Args) => {\n const error = handleError(handle);\n return error ? reject(error) : action(records.get(handle.id)!, ...args);\n };\n }\n\n function diagnostic(diagnosticValue: Diagnostic): void {\n const value = freeze({ ...diagnosticValue });\n enqueue([{ type: 'diagnostic', diagnostic: value }]);\n }\n function failure(code: Diagnostic['code'], source: string, error: unknown, handle?: NotificationHandle): void {\n diagnostic({ code, source, message: `${source} failed`, error, ...(handle ? { handle } : {}) });\n }\n function notifyListeners(set: Set<() => void>, source: string): void {\n for (const listener of [...set]) {\n if (!set.has(listener)) continue;\n try { listener(); } catch (error) {\n failure('listener-error', source, error);\n }\n }\n }\n function enqueue(deliveries: readonly Delivery[], notify = false, at = clock.now(), final = false, release = false): void {\n batches.push(() => {\n if (notify) notifyListeners(listeners, 'subscribe');\n for (const delivery of deliveries) {\n if ('callback' in delivery) {\n try { delivery.callback(); } catch (error) {\n failure('callback-error', delivery.source, error, delivery.handle);\n }\n continue;\n }\n const event: SemanticEvent = freeze({ ...delivery, controller: identity, sequence: ++eventSequence,\n at: release ? clock.now() : at });\n for (const listener of [...eventListeners]) {\n if (!eventListeners.has(listener)) continue;\n try { listener(event); } catch (error) {\n if (event.type !== 'diagnostic') failure('listener-error', 'onEvent', error);\n }\n }\n if (event.type === 'diagnostic') {\n try { options.onDiagnostic?.(event.diagnostic); } catch { /* No recursive diagnostics. */ }\n }\n }\n // Close-callback diagnostics are queued before disposal releases observers.\n if (final) enqueue([{ type: 'disposed' }], false, at, false, true);\n if (release) {\n listeners.clear(); eventListeners.clear();\n for (const set of operationSubscriptions.keys()) set.clear();\n operationSubscriptions.clear();\n }\n });\n if (delivering) return;\n delivering = true;\n try {\n let batch: (() => void) | undefined;\n while ((batch = batches.shift())) batch();\n } finally { delivering = false; }\n }\n function settle(): number {\n const now = clock.now();\n for (const record of records.values()) {\n if (record.activeSince !== null && record.remaining !== null) {\n record.remaining = Math.max(0, record.remaining - Math.max(0, now - record.activeSince));\n record.activeSince = now;\n }\n }\n return now;\n }\n function stopTimer(): void {\n ++timerEpoch;\n cancelTimer?.();\n cancelTimer = null;\n }\n function schedule(now: number): void {\n stopTimer();\n let deadline = Infinity;\n for (const record of records.values()) {\n const active = record.remaining !== null && pauses(record).length === 0 && !disposed;\n record.activeSince = active ? now : null;\n if (active) deadline = Math.min(deadline, now + record.remaining!);\n }\n if (!Number.isFinite(deadline)) return;\n const epoch = timerEpoch;\n cancelTimer = clock.schedule(deadline, () => {\n if (disposed || epoch !== timerEpoch) return;\n const at = settle();\n const due = [...records.values()].filter((record) => record.activeSince !== null && record.remaining === 0);\n const deliveries: Delivery[] = [];\n for (const record of due) remove(record, 'timeout', deliveries);\n // An early delivery only rearms; a late delivery closes exactly the due generations.\n if (due.length) commit(deliveries, at);\n else schedule(at);\n });\n }\n function publish(): void {\n const current = [...records.values()];\n const notifications = freeze(current.map((record) => freeze({\n handle: record.handle, kind: record.kind, content: record.content, priority: record.priority,\n occurrences: record.occurrences, location: record === presented ? 'current' as const : 'stack' as const,\n remainingMs: record.remaining, pauseReasons: freeze(pauses(record)), operation: record.operation?.getSnapshot() ?? null, action: record.action,\n draft: dirty(record),\n })));\n snapshot = freeze({ controller: identity, revision, disposed, notifications,\n stack: freeze(stackOrder().map((record) => record.handle)),\n island: island ? freeze({ open: true, reason: island.reason, current: island.current.handle }) : COLLAPSED,\n overflow: freeze({ count: overflow, pending: overflow > 0 }),\n });\n rendererSnapshot = freeze({ ...snapshot,\n presentation: presented ? freeze({ handle: presented.handle, token: presented.presentation, readable: presented.readable }) : null,\n focusRequest,\n forms: freeze(current.flatMap((record) => {\n const form = formOf(record);\n return form ? [freeze({ handle: record.handle, values: form.values, errors: form.errors })] : [];\n })),\n announcements: freeze({ overflowCount: overflowAnnounced,\n notifications: freeze(current.map((record) => freeze({\n handle: record.handle, queued: record.queuedAnnounced, firstPresentation: record.firstAnnounced,\n occurrences: record.occurrencesAnnounced, action: record.actionAnnounced ?? null, operation: record.operation ? freeze({\n token: record.operation.getSnapshot().token, phases: freeze([...record.operationAnnounced]),\n }) : null,\n }))),\n }),\n });\n }\n function commit(deliveries: readonly Delivery[] = [], now = clock.now(), final = false): void {\n present();\n schedule(now);\n armAttention(now);\n ++revision;\n publish();\n enqueue(deliveries, true, now, final);\n }\n // Every state mutation settles the old budget, publishes once, then delivers.\n // The presented record is derived inside that transaction, before subscribers can reenter.\n function mutate(apply: (deliveries: Delivery[]) => void, final = false) {\n const now = settle();\n const deliveries: Delivery[] = [];\n apply(deliveries);\n commit(deliveries, now, final);\n return APPLIED;\n }\n function assign(record: RecordState<Slot>): void {\n record.readable = false;\n record.presentation = lease === null ? null : token() as PresentationToken;\n }\n function retire(record: RecordState<Slot>): void {\n record.presentation = null;\n record.readable = false;\n record.pauses.clear();\n if (focused === record.handle) focused = null;\n if (focusRequest?.target.kind === 'notification' && focusRequest.target.handle === record.handle) focusRequest = null;\n }\n /** A change of the presented record mints a new presentation token; its predecessor keeps its budget. */\n function present(): void {\n const next = island ? island.current : newest();\n if (next === presented) return;\n if (presented) retire(presented);\n presented = next;\n if (next) assign(next);\n }\n function stopAttention(): void {\n ++attentionEpoch;\n cancelAttention?.();\n cancelAttention = null;\n }\n /** Newest candidate wins: a new nomination replaces the pending one. */\n function nominate(record: RecordState<Slot>, now: number): void {\n if (wantsAttention(record)) attention = { record, due: now + (hostDelay ?? options.attentionDelay ?? ATTENTION_DELAY), waiting: false };\n }\n function armAttention(now: number): void {\n stopAttention();\n const candidate = attention;\n if (!candidate || disposed) return;\n // Without a host nothing has landed yet: wait without allocating a timer.\n if (lease === null) { candidate.waiting = true; return; }\n if (candidate.waiting) {\n if (interacting()) return;\n candidate.waiting = false;\n candidate.due = now + (hostDelay ?? options.attentionDelay ?? ATTENTION_DELAY);\n }\n const epoch = attentionEpoch;\n cancelAttention = clock.schedule(candidate.due, () => {\n if (disposed || epoch !== attentionEpoch || attention !== candidate) return;\n const at = clock.now();\n if (at < candidate.due) { armAttention(at); return; }\n cancelAttention = null;\n // Expiry during hover/focus/gesture waits; the next release restarts the delay.\n if (interacting()) { candidate.waiting = true; return; }\n attention = null;\n const record = candidate.record;\n if (!wantsAttention(record) || island?.current === record) return;\n mutate(() => {\n if (island) island.current = record;\n else island = { reason: 'attention', current: record };\n });\n });\n }\n const autoDismissing = (host: boolean | undefined) => (host ?? options.autoDismiss) !== false;\n /** Off stops every budget; on starts each one in full. */\n function setHostAutoDismiss(value: boolean | undefined): void {\n const changed = autoDismissing(value) !== autoDismissing(hostAutoDismiss);\n hostAutoDismiss = value;\n if (!changed) return;\n for (const record of records.values()) record.remaining = budget(record);\n }\n function budget(record: RecordState<Slot>): number | null {\n if (!autoDismissing(hostAutoDismiss)) return null;\n if (record.content.duration !== undefined) return record.content.duration;\n return (record.kind === 'info' || record.kind === 'success') && !record.content.action ? 6000 : null;\n }\n function remove(record: RecordState<Slot>, reason: CloseReason, deliveries: Delivery[]): void {\n if (island?.current === record) {\n // The next older slide, else the next newer one, else the Island closes.\n const order = stackOrder();\n const index = order.indexOf(record);\n const next = order[index + 1] ?? order[index - 1];\n if (next) island.current = next; else island = null;\n }\n if (attention?.record === record) attention = null;\n records.delete(record.handle.id);\n if (record.operation) deliveries.push(record.operation.detach());\n deliveries.push({ type: 'closed', handle: record.handle, reason });\n if (record.onClose) {\n const onClose = record.onClose;\n const notice = freeze({ handle: record.handle, reason });\n deliveries.push({ callback: () => onClose(notice), source: 'onClose', handle: record.handle });\n }\n }\n const dismiss = withRecord((record, reason: CloseReason) =>\n mutate((deliveries) => remove(record, reason, deliveries)));\n function acknowledgeOverflow() {\n if (disposed) return reject('disposed');\n if (!overflow) return UNCHANGED;\n return mutate((deliveries) => {\n deliveries.push({ type: 'overflow-acknowledged', count: overflow });\n overflow = overflowAnnounced = 0;\n if (focusRequest?.target.kind === 'overflow') focusRequest = null;\n });\n }\n function subscribe<T>(set: Set<T>, listener: T): Unsubscribe {\n if (typeof listener !== 'function') throw new TypeError('Listener must be a function');\n if (disposed) return () => {};\n set.add(listener);\n return () => { set.delete(listener); };\n }\n function admit(spec: NotificationSpec<Slot>): AdmissionResult {\n if (disposed) return reject('disposed');\n const issues = validateSpec(spec);\n if (issues.length) {\n diagnostic({ code: 'invalid-input', source: 'show', message: 'Invalid notification specification' });\n return { ...reject('invalid-input'), issues };\n }\n return insert(spec);\n }\n function insert(spec: NotificationSpec<Slot>, initialize?: (record: RecordState<Slot>) => void): AdmissionResult {\n if (spec.id !== undefined && records.has(spec.id)) return reject('id-conflict');\n const existing = spec.dedupeKey === undefined ? undefined : [...records.values()].find((record) => record.dedupeKey === spec.dedupeKey);\n if (existing) {\n let occurrences = existing.occurrences;\n mutate((deliveries) => {\n occurrences = existing.occurrences = Math.min(Number.MAX_SAFE_INTEGER, occurrences + 1);\n deliveries.push({ type: 'deduplicated', handle: existing.handle, occurrences });\n });\n return { status: 'deduplicated', handle: existing.handle, occurrences };\n }\n if (records.size >= 100) {\n mutate((deliveries) => {\n overflow = Math.min(Number.MAX_SAFE_INTEGER, overflow + 1);\n const overflowValue = freeze({ count: overflow, pending: true });\n deliveries.push({ type: 'overflow', count: overflow });\n if (options.onOverflow) deliveries.push({ callback: () => options.onOverflow!(overflowValue), source: 'onOverflow' });\n });\n return reject('capacity');\n }\n const now = settle();\n let id = spec.id;\n if (id === undefined) { do { id = `${identity}:notification-${++autoId}`; } while (records.has(id)); }\n const handle = freeze({ id, controller: identity, generation: token() as Generation }) as NotificationHandle;\n handles.add(handle);\n const record: RecordState<Slot> = {\n handle: handle,\n dedupeKey: spec.dedupeKey,\n onClose: spec.onClose,\n content: copyContent(spec),\n kind: spec.kind ?? 'info',\n priority: spec.priority ?? 'normal',\n occurrences: 1,\n remaining: null,\n activeSince: null,\n presentation: null,\n readable: false,\n everPresented: false,\n pauses: new Set(),\n queuedAnnounced: false,\n firstAnnounced: false,\n occurrencesAnnounced: 0,\n operation: null,\n operationAnnounced: new Set(),\n action: IDLE,\n form: null,\n };\n record.remaining = budget(record);\n records.set(id, record);\n initialize?.(record);\n nominate(record, now);\n const deliveries: Delivery[] = [{ type: 'admitted', handle }];\n if (record.operation) {\n const operation = record.operation.getSnapshot();\n deliveries.push({ type: 'operation-started', handle, token: operation.token, attempt: operation.attempt });\n }\n commit(deliveries, now);\n return { status: 'created', handle };\n }\n function emit(deliveries: readonly Delivery[]): void {\n if (disposed) return;\n enqueue(deliveries);\n }\n function replaceContent(record: RecordState<Slot>, content: Readonly<NotificationContent<Slot>>, kind: NotificationKind): void {\n record.content = content;\n record.kind = kind;\n record.remaining = kind === 'loading' ? null : budget(record);\n // A replacement owns a new action context; old completions cannot close it.\n record.action = IDLE;\n if (record === presented) assign(record);\n // A runner phase (terminal result or new attempt) is evaluated like an admission.\n nominate(record, clock.now());\n if (focusRequest?.target.kind === 'notification' && focusRequest.target.handle === record.handle &&\n focusRequest.target.control === 'action' && !content.action) focusRequest = null;\n }\n function track<T>(source: OperationSource<T, Signal>, input: TrackOptions<T, Slot, Signal>): OperationHandle<T> {\n const factory = typeof source === 'function' ? source : null;\n let sourceThen: PromiseLike<T>['then'] | undefined;\n if (!factory && (source === null || typeof source !== 'object' || typeof (sourceThen = source.then) !== 'function')) {\n throw new TypeError('Operation source must be a factory or thenable');\n }\n const issues = validateTrackOptions(input, factory !== null);\n // Invalid presentation options cannot suppress a valid business source. Read\n // only data properties here; validation never executes option accessors.\n const field = (key: keyof TrackOptions<T, Slot, Signal>): unknown => input && typeof input === 'object'\n ? Object.getOwnPropertyDescriptor(input, key)?.value : undefined;\n const cancelValue = field('cancel');\n const cancelCallback = !factory && typeof cancelValue === 'function' ? cancelValue as (reason: unknown) => void : null;\n const classifierValue = field('isCancellation');\n const classifier = typeof classifierValue === 'function' ? classifierValue as NonNullable<TrackOptions<T, Slot, Signal>['isCancellation']> : null;\n const config = issues.length ? null : freeze({ ...input,\n pending: copyContent(input.pending),\n success: typeof input.success === 'function' ? input.success : copyContent(input.success),\n error: typeof input.error === 'function' ? input.error : copyContent(input.error),\n ...(input.cancelled === undefined ? {} : { cancelled: typeof input.cancelled === 'function' ? input.cancelled : copyContent(input.cancelled) }),\n });\n const subscribers = new Set<() => void>();\n let notification: NotificationHandle | null = null;\n let attached = false;\n let snapshotValue: OperationSnapshot;\n let attemptNumber = 0;\n type Attempt = {\n readonly public: OperationAttempt<T>;\n readonly context: OperationContext<Signal>;\n readonly abort: (reason?: unknown) => void;\n readonly resolve: (value: T | PromiseLike<T>) => void;\n readonly reject: (reason: unknown) => void;\n status: OperationStatus;\n cancelRequested: boolean;\n };\n function createAttempt(): Attempt {\n const cancellation = dependencies.createCancellation();\n const context = freeze({ signal: cancellation.signal, token: token() as OperationAttemptToken, attempt: ++attemptNumber });\n let resolve!: Attempt['resolve'];\n let fail!: Attempt['reject'];\n const result = new Promise<T>((fulfill, rejectResult) => { resolve = fulfill; fail = rejectResult; });\n const attempt: Attempt = {\n public: freeze({ token: context.token, attempt: context.attempt, result }), context,\n abort: cancellation.abort, resolve, reject: fail, status: 'pending', cancelRequested: false,\n };\n // Observe both branches without altering the public promise's value/reason.\n // The derived internal chain is handled as well, even if a platform port fails.\n void result.then((value) => finish(attempt, 'fulfilled', value), (error: unknown) => finish(attempt, 'rejected', error))\n .catch((error: unknown) => {\n if (!disposed) failure('callback-error', 'operation-settlement', error);\n });\n return attempt;\n }\n const first = createAttempt();\n let current = first;\n function getSnapshot(): OperationSnapshot {\n const next = {\n token: current.context.token, attempt: current.context.attempt, status: current.status,\n cancelRequested: current.cancelRequested,\n canCancel: !disposed && current.status === 'pending' && !current.cancelRequested && (!!factory || !!cancelCallback),\n canRetry: !disposed && !!factory && current.status !== 'pending',\n notification: attached && !disposed ? notification : null,\n };\n if (!snapshotValue || Object.keys(next).some((key) => next[key as keyof OperationSnapshot] !== snapshotValue[key as keyof OperationSnapshot])) {\n snapshotValue = freeze(next);\n }\n return snapshotValue;\n }\n const notify: Delivery = { source: 'operation.subscribe',\n callback: () => notifyListeners(subscribers, 'operation.subscribe') };\n function live(attempt: Attempt): RecordState<Slot> | undefined {\n if (disposed || current !== attempt || !attached || !notification) return undefined;\n const record = records.get(notification.id);\n return record?.handle === notification && record.operation === binding ? record : undefined;\n }\n function run(attempt: Attempt): void {\n // Validate and assimilate the same then method once, preserving its receiver.\n // Reading a user accessor again could replace the business outcome.\n try { attempt.resolve(factory ? factory(attempt.context) : { then: sourceThen!.bind(source) }); }\n catch (error) { attempt.reject(error); }\n }\n function deliver(deliveries: Delivery[], apply?: () => void): void {\n if (apply) {\n const now = settle();\n apply();\n commit(deliveries, now);\n } else emit(deliveries);\n }\n function finish(attempt: Attempt, initialStatus: 'fulfilled' | 'rejected', value: unknown): void {\n attempt.status = initialStatus;\n if (initialStatus === 'rejected') {\n try {\n const cancelled = classifier ? classifier(value, attempt.context) === true\n : attempt.cancelRequested && value !== null && typeof value === 'object' && 'name' in value && value.name === 'AbortError';\n if (cancelled) attempt.status = 'cancelled';\n } catch (error) {\n if (!disposed) failure('cancellation-error', 'isCancellation', error);\n }\n }\n let content: Readonly<NotificationContent<Slot>> | undefined;\n if (live(attempt) && config) {\n const status = attempt.status;\n const fallback = status === 'fulfilled' ? options.messages?.operationSuccess ?? 'Completed'\n : status === 'cancelled' ? options.messages?.operationCancelled ?? 'Cancelled'\n : options.messages?.operationError ?? 'Something went wrong';\n try {\n const mapper = status === 'fulfilled' ? config.success : status === 'cancelled' ? config.cancelled : config.error;\n const mapped = typeof mapper === 'function' ? mapper(value as T) : mapper ?? { title: fallback };\n if (validateContent(mapped).length) throw new TypeError('Invalid terminal notification content');\n content = copyContent(mapped);\n } catch (error) {\n content = freeze({ title: fallback, announcementPriority: 'polite' });\n if (!disposed) failure('mapper-error', `track.${status}`, error, notification ?? undefined);\n }\n }\n // User mappers, classifiers and diagnostic listeners are reentrant.\n const record = live(attempt);\n const uiApplied = !!record && !!content;\n const deliveries: Delivery[] = [\n ...(current === attempt ? [notify] : []),\n { type: 'operation-settled', handle: notification, token: attempt.context.token, status: attempt.status, uiApplied },\n ];\n deliver(deliveries, record && content ? () => replaceContent(record, content,\n attempt.status === 'fulfilled' ? 'success' : attempt.status === 'cancelled' ? 'warning' : 'error') : undefined);\n }\n function requestCancellation(attempt: Attempt, reason: unknown): void {\n attempt.cancelRequested = true;\n const record = live(attempt);\n const deliveries: Delivery[] = [notify, { type: 'cancellation-requested', handle: notification, token: attempt.context.token }];\n deliver(deliveries, record ? () => {\n record.content = patchContent(record.content, { title: options.messages?.cancellationRequested ?? 'Cancellation requested' });\n } : undefined);\n try {\n attempt.abort(reason);\n cancelCallback?.(reason);\n } catch (error) {\n if (!disposed) failure('cancellation-error', 'cancel', error, notification ?? undefined);\n }\n }\n function cancellationReason(): Error {\n const error = new Error('Cancellation requested');\n error.name = 'AbortError';\n return error;\n }\n function cancel(reason: unknown = cancellationReason()): CancelResult {\n if (disposed) return reject('disposed');\n if (current.status !== 'pending') return { status: 'unchanged', reason: 'settled' };\n if (!factory && !cancelCallback) return reject('not-cancellable');\n if (current.cancelRequested) return { status: 'unchanged', reason: 'already-requested' };\n requestCancellation(current, reason);\n return { status: 'requested' };\n }\n function start(restart: boolean): AttemptStartResult<T> {\n if (disposed) return reject('disposed');\n if (!factory) return reject('not-retryable');\n if (current.status === 'pending' && !restart) return reject('already-pending');\n const previous = current;\n const next = createAttempt();\n current = next; // Invalidate old ownership before any observer or abort callback.\n const record = live(next);\n const deliveries: Delivery[] = [notify, { type: 'operation-started', handle: notification, token: next.context.token, attempt: next.context.attempt }];\n deliver(deliveries, record && config ? () => {\n record.operationAnnounced.clear();\n replaceContent(record, config.pending, 'loading');\n } : undefined);\n if (previous.status === 'pending' && !previous.cancelRequested) requestCancellation(previous, cancellationReason());\n run(next);\n return { status: 'started', attempt: next.public };\n }\n const binding: OperationBinding = {\n getSnapshot, retry: () => start(false), cancel,\n detach: () => { attached = false; return notify; },\n };\n let admission: OperationAdmissionResult;\n if (disposed) admission = reject('disposed');\n else if (!config) {\n admission = { ...reject('invalid-input'), issues };\n diagnostic({ code: 'invalid-input', source: 'track', message: 'Invalid operation options' });\n } else {\n const admitted = insert({ ...config.pending, ...config, kind: 'loading' }, (record) => {\n notification = record.handle;\n attached = true;\n record.operation = binding;\n });\n // No dedupe key can reach this path (validated TrackOptions).\n if (admitted.status === 'deduplicated') throw new Error('Tracked operation cannot be deduplicated');\n admission = admitted;\n }\n if (admission.status === 'rejected') emit([{ type: 'operation-started', handle: null, token: first.context.token, attempt: 1 }]);\n run(first);\n return freeze({ ...first.public, admission: freeze(admission), getSnapshot,\n subscribe(listener: () => void) {\n const unsubscribe = subscribe(subscribers, listener);\n if (subscribers.size) operationSubscriptions.set(subscribers, notify);\n return () => { unsubscribe(); if (!subscribers.size) operationSubscriptions.delete(subscribers); };\n },\n cancel, retry: () => start(false), restart: () => start(true),\n });\n }\n\n const controller = freeze<CloudletController<Slot, Signal>>({\n show: (spec) => admit(spec),\n track,\n update: withRecord((record, patch: NotificationPatch<Slot>) => {\n const handle = record.handle;\n const issues = validatePatch(patch);\n if (issues.length) {\n diagnostic({ code: 'invalid-input', source: 'update', message: 'Invalid notification patch', handle });\n return { ...reject('invalid-input'), issues };\n }\n if (record.action.status === 'pending' && Object.prototype.hasOwnProperty.call(patch, 'action')) return reject('action-pending');\n if (record.operation && (Object.prototype.hasOwnProperty.call(patch, 'kind') ||\n (record.operation.getSnapshot().status === 'pending' && Object.prototype.hasOwnProperty.call(patch, 'duration')))) return reject('operation-owned');\n const content = patchContent(record.content, patch);\n const kind = patch.kind ?? record.kind;\n const priority = patch.priority ?? record.priority;\n const durationChanged = Object.prototype.hasOwnProperty.call(patch, 'duration');\n if (content === record.content && kind === record.kind && priority === record.priority && !durationChanged &&\n !(Object.prototype.hasOwnProperty.call(patch, 'action') && record.action.status === 'failed')) return UNCHANGED;\n return mutate((deliveries) => {\n const previousBudget = budget(record);\n record.content = content;\n if (Object.prototype.hasOwnProperty.call(patch, 'action')) record.action = IDLE;\n record.kind = kind;\n record.priority = priority;\n const nextBudget = budget(record);\n if (durationChanged || previousBudget !== nextBudget) record.remaining = nextBudget;\n if (focusRequest?.target.kind === 'notification' && focusRequest.target.handle === handle && focusRequest.target.control === 'action' && !content.action) focusRequest = null;\n if (attention?.record === record && !wantsAttention(record)) attention = null;\n deliveries.push({ type: 'updated', handle });\n });\n }),\n getHandle: (id) => !disposed && typeof id === 'string' ? records.get(id)?.handle : undefined,\n dismiss: (handle) => dismiss(handle, 'programmatic'),\n clear() {\n if (disposed) return reject('disposed');\n const count = records.size;\n if (!count) return { status: 'cleared', count };\n mutate((deliveries) => {\n for (const record of records.values()) remove(record, 'clear', deliveries);\n });\n return { status: 'cleared', count };\n },\n requestFocus(target: FocusTarget = { kind: 'anchor' }) {\n if (disposed) return reject('disposed');\n if (target?.kind === 'notification') {\n const error = handleError(target.handle);\n if (error) return reject(error);\n }\n if (!lease) return reject('no-host');\n if (!target || !['anchor', 'notification', 'overflow'].includes(target.kind)) return reject('unavailable');\n if (target.kind === 'notification') {\n const record = records.get(target.handle.id)!;\n if (record !== presented) return reject('not-visible');\n if (target.control !== undefined && !['action', 'close'].includes(target.control)) return reject('unavailable');\n if (target.control === 'action' && !record.content.action) return reject('unavailable');\n // Card controls exist only inside the open Island; the collapsed pill has none.\n if (target.control !== undefined && !island) return reject('not-visible');\n }\n if (target.kind === 'overflow' && !overflow) return reject('unavailable');\n mutate(() => {\n const copied: FocusTarget = target.kind === 'notification'\n ? freeze({ kind: target.kind, handle: target.handle, ...(target.control ? { control: target.control } : {}) })\n : freeze({ kind: target.kind });\n focusRequest = freeze({ token: token() as FocusRequestToken, target: copied });\n });\n return { status: 'requested' };\n },\n acknowledgeOverflow,\n getSnapshot: () => snapshot,\n getServerSnapshot: () => SERVER,\n subscribe: (listener) => subscribe(listeners, listener),\n onEvent: (listener) => subscribe(eventListeners, listener),\n dispose() {\n if (disposed) return;\n mutate((deliveries) => {\n disposed = true;\n for (const record of records.values()) remove(record, 'dispose', deliveries);\n // Detached/admission-rejected handles also lose their capabilities.\n for (const notify of operationSubscriptions.values()) if (!deliveries.includes(notify)) deliveries.push(notify);\n lease = lastLease = null;\n island = null;\n attention = null;\n stopAttention();\n focusRequest = null;\n globalPauses.clear();\n overflow = overflowAnnounced = 0;\n }, true);\n },\n });\n\n publish();\n kernels.set(controller, freeze<ControllerKernel<Slot>>({\n options, clock, records, globalPauses, subscribe: controller.subscribe, onEvent: controller.onEvent,\n get disposed() { return disposed; },\n get presented() { return presented; },\n get rendererSnapshot() { return rendererSnapshot; },\n get overflow() { return overflow; },\n get lease() { return lease; }, set lease(value) { lease = value; },\n get lastLease() { return lastLease; }, set lastLease(value) { lastLease = value; },\n get hostDelay() { return hostDelay; }, set hostDelay(value) { hostDelay = value; },\n get hostAutoDismiss() { return hostAutoDismiss; }, set hostAutoDismiss(value) { hostAutoDismiss = value; },\n get island() { return island; }, set island(value) { island = value; },\n get attention() { return attention; }, set attention(value) { attention = value; },\n get focusRequest() { return focusRequest; }, set focusRequest(value) { focusRequest = value; },\n get focused() { return focused; }, set focused(value) { focused = value; },\n get overflowAnnounced() { return overflowAnnounced; }, set overflowAnnounced(value) { overflowAnnounced = value; },\n token, diagnostic, failure, mutate, commit, settle, assign, newest, formOf, handleError, withRecord,\n autoDismissing, setHostAutoDismiss, dismiss, acknowledgeOverflow,\n reportRendererLoadError(error) {\n if (!disposed) diagnostic({ code: 'renderer-load-error', source: 'Toaster', message: 'Toaster renderer failed to load', error });\n },\n }) as ControllerKernel<unknown>);\n return controller;\n}\n"],"mappings":";AAoEA,IAAMA,IAAS,OAAO,QAGhBC,oBAAU,IAAI,QAAgB,GAC9BC,oBAAU,IAAI,QAA2C,GAC3DC,IAAiB,GACfC,IAA0BJ,EAAO,CAAC,CAAC,GACnCK,IAA4BL,EAAO;CAAE,MAAM;CAAO,QAAQ;CAAM,SAAS;AAAK,CAAC,GAC/EM,IAAoCN,EAAO;CAC/C,YAAY;CAAM,UAAU;CAAG,UAAU;CAAO,eAAeI;CAAO,OAAOA;CAC7E,QAAQC;CAAW,UAAUL,EAAO;EAAE,OAAO;EAAG,SAAS;CAAM,CAAC;AAClE,CAAC,GACYO,IAA2CP,EAAO;CAC7D,GAAGM;CAAQ,cAAc;CAAM,cAAc;CAAM,OAAOF;CAC1D,eAAeJ,EAAO;EAAE,eAAeI;EAAO,eAAe;CAAE,CAAC;AAClE,CAAC,GACKI,IAAOR,EAAO,EAAE,QAAQ,OAAgB,CAAC,GAClCS,IAA6BT,EAAO;CAAE,MAAM;CAAM,QAAQA,EAAO,CAAC,CAAC;AAAE,CAAC,GACtEU,IAAUV,EAAO,EAAE,QAAQ,UAAmB,CAAC,GAC/CW,IAAYX,EAAO,EAAE,QAAQ,YAAqB,CAAC,GACnDY,KAAiC,OAAoB;CAAE,QAAQ;CAAqB;AAA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AAE,IAAeqF;EAAO;EAC7F,IAAI,UAAU;GAAE,OAAOtF;EAAS;EAAG,IAAI,QAAQ,GAAO;GAAE,IAAUsF;EAAO;EACzE,IAAI,oBAAoB;GAAE,OAAOtE;EAAmB;EAAG,IAAI,kBAAkB,GAAO;GAAE,IAAoBsE;EAAO;EACjH;EAAO;EAAY;EAAS;EAAQ;EAAQ;EAAQ;EAAQ;EAAQ;EAAQ;EAAa;EACzF;EAAgB;EAAoB;EAAS;EAC7C,wBAAwB,GAAO;GAC7B,AAAKrE,KAAU4B,EAAW;IAAE,MAAM;IAAuB,QAAQ;IAAW,SAAS;IAAmC;GAAM,CAAC;EACjI;CACF,CAAC,CAA8B,GACxB3D;AACT"}
|
|
1
|
+
{"version":3,"file":"controller.js","names":["freeze","handles","kernels","nextController","EMPTY","COLLAPSED","SERVER","RENDERER_SERVER","IDLE","NO_FORM_ERRORS","APPLIED","UNCHANGED","reject","getControllerKernel","kernel","controller","createCloudletCore","options","validateOptions","inputOptions","dependencies","clock","identity","records","listeners","eventListeners","operationSubscriptions","globalPauses","batches","focused","focusRequest","lease","lastLease","serial","autoId","revision","eventSequence","island","presented","hostDelay","hostAutoDismiss","attention","cancelAttention","attentionEpoch","overflow","overflowAnnounced","disposed","delivering","cancelTimer","timerEpoch","snapshot","rendererSnapshot","token","stackOrder","newest","retryable","operation","record","requiresAction","wantsAttention","rule","formOf","action","field","dirty","form","interacting","pauses","current","handleError","handle","withRecord","args","error","diagnostic","diagnosticValue","failure","source","notifyListeners","listener","set","enqueue","notify","delivery","deliveries","event","release","at","final","batch","settle","now","stopTimer","schedule","deadline","active","epoch","due","commit","publish","notifications","present","armAttention","mutate","apply","assign","retire","next","stopAttention","nominate","candidate","autoDismissing","host","setHostAutoDismiss","changed","value","budget","remove","order","index","onClose","notice","dismiss","reason","forgetOverflow","acknowledgeOverflow","clear","count","acknowledge","subscribe","admit","issues","validateSpec","spec","insert","existing","occurrences","overflowValue","id","copyContent","initialize","emit","replaceContent","content","kind","track","factory","sourceThen","validateTrackOptions","input","key","cancelValue","cancelCallback","classifierValue","classifier","config","subscribers","notification","attached","snapshotValue","attemptNumber","createAttempt","cancellation","context","resolve","fail","result","fulfill","rejectResult","attempt","finish","first","getSnapshot","live","binding","run","deliver","initialStatus","status","fallback","mapper","mapped","validateContent","uiApplied","requestCancellation","patchContent","cancellationReason","cancel","start","restart","previous","admission","admitted","unsubscribe","validatePatch","patch","priority","durationChanged","previousBudget","nextBudget","target","copied"],"sources":["../../src/core/controller.ts"],"sourcesContent":["import type { ClearResult, CloudletController, ControllerOptions, FocusTarget } from '../contracts/controller.js';\nimport type { Diagnostic, EventBase, SemanticEvent } from '../contracts/events.js';\nimport type { ActionAttemptToken, ControllerIdentity, Generation, HandleRejection, NotificationHandle, OperationAttemptToken, Unsubscribe } from '../contracts/identity.js';\nimport type {\n FocusRequest, FocusRequestToken, ControllerDependencies, FormErrors, HostLease, OperationAnnouncementPhase, PresentationToken,\n RendererSnapshot,\n} from '../contracts/internal.js';\nimport type { AdmissionResult, CloseReason, FormAction, NotificationContent, NotificationKind, NotificationPatch, NotificationSpec, OperationAdmissionResult, Priority } from '../contracts/notifications.js';\nimport type { AttemptStartResult, CancellationSignal, CancelResult, OperationAttempt, OperationContext, OperationHandle, OperationSnapshot, OperationSource, OperationStatus, TrackOptions } from '../contracts/operations.js';\nimport type { ActionSnapshot, ControllerSnapshot, IslandReason, IslandSnapshot, PauseReason } from '../contracts/snapshots.js';\nimport { copyContent, patchContent, validateContent, validateOptions, validatePatch, validateSpec, validateTrackOptions } from './validation.js';\n\nexport interface OperationBinding {\n readonly getSnapshot: () => OperationSnapshot;\n readonly retry: () => AttemptStartResult<unknown>;\n readonly cancel: (reason?: unknown) => CancelResult;\n readonly detach: () => Delivery;\n}\n\ntype EventPayload = SemanticEvent extends infer E ? E extends SemanticEvent ? Omit<E, keyof EventBase> : never : never;\nexport type Delivery = EventPayload | { readonly callback: () => void; readonly source: string; readonly handle?: NotificationHandle };\n\nexport interface RecordState<Slot> {\n readonly handle: NotificationHandle;\n readonly dedupeKey: string | undefined;\n readonly onClose: NotificationSpec<Slot>['onClose'];\n content: Readonly<NotificationContent<Slot>>;\n kind: NotificationKind;\n priority: Priority;\n occurrences: number;\n remaining: number | null;\n activeSince: number | null;\n presentation: PresentationToken | null;\n readable: boolean;\n everPresented: boolean;\n readonly pauses: Set<PauseReason>;\n queuedAnnounced: boolean;\n firstAnnounced: boolean;\n occurrencesAnnounced: number;\n operation: OperationBinding | null;\n readonly operationAnnounced: Set<OperationAnnouncementPhase>;\n action: ActionSnapshot;\n actionAnnounced?: { readonly token: ActionAttemptToken; readonly status: 'pending' | 'failed' };\n /** Values of the form action the record holds; a new action object starts from its defaults. */\n form: FormState | null;\n}\n\nexport interface FormState {\n readonly action: FormAction;\n values: Readonly<Record<string, string>>;\n errors: FormErrors;\n}\n\n/** Open Island state; `null` is the collapsed stack. */\nexport interface IslandState<Slot> {\n readonly reason: IslandReason;\n current: RecordState<Slot>;\n}\n\nexport interface AttentionCandidate<Slot> {\n readonly record: RecordState<Slot>;\n due: number;\n /** Expired during user interaction or without a host; restarts the delay afterwards. */\n waiting: boolean;\n}\n\nexport const ATTENTION_DELAY = 600;\n\nconst freeze = Object.freeze;\n\n// Weak registries authenticate capabilities without retaining disposed controllers.\nconst handles = new WeakSet<object>();\nconst kernels = new WeakMap<object, ControllerKernel<unknown>>();\nlet nextController = 0;\nconst EMPTY: readonly never[] = freeze([]);\nconst COLLAPSED: IslandSnapshot = freeze({ open: false, reason: null, current: null });\nconst SERVER: ControllerSnapshot<never> = freeze({\n controller: null, revision: 0, disposed: false, notifications: EMPTY, stack: EMPTY,\n island: COLLAPSED, overflow: freeze({ count: 0, pending: false }),\n});\nexport const RENDERER_SERVER: RendererSnapshot<never> = freeze({\n ...SERVER, presentation: null, focusRequest: null, forms: EMPTY,\n announcements: freeze({ notifications: EMPTY, overflowCount: 0 }),\n});\nconst IDLE = freeze({ status: 'idle' as const });\nexport const NO_FORM_ERRORS: FormErrors = freeze({ form: null, fields: freeze({}) });\nexport const APPLIED = freeze({ status: 'applied' as const });\nexport const UNCHANGED = freeze({ status: 'unchanged' as const });\nexport const reject = <Reason extends string>(reason: Reason) => ({ status: 'rejected' as const, reason });\n\ntype Rejected<Reason extends string> = { status: 'rejected'; reason: Reason };\n\n/**\n * Controller state and transactions the renderer bridge needs (core/bridge.ts). The bridge travels\n * in the lazily loaded renderer chunk, so the start bundle carries only this accessor object.\n */\nexport interface ControllerKernel<Slot> {\n readonly options: ReturnType<typeof validateOptions>;\n readonly clock: ControllerDependencies<CancellationSignal>['clock'];\n readonly records: Map<string, RecordState<Slot>>;\n readonly globalPauses: Set<PauseReason>;\n readonly subscribe: CloudletController<Slot, CancellationSignal>['subscribe'];\n readonly onEvent: CloudletController<Slot, CancellationSignal>['onEvent'];\n readonly disposed: boolean;\n readonly presented: RecordState<Slot> | null;\n readonly rendererSnapshot: RendererSnapshot<Slot>;\n readonly overflow: number;\n lease: HostLease | null;\n lastLease: HostLease | null;\n hostDelay: number | undefined;\n hostAutoDismiss: boolean | undefined;\n island: IslandState<Slot> | null;\n attention: AttentionCandidate<Slot> | null;\n focusRequest: FocusRequest | null;\n focused: NotificationHandle | null;\n overflowAnnounced: number;\n readonly token: () => string;\n readonly diagnostic: (diagnostic: Diagnostic) => void;\n readonly failure: (code: Diagnostic['code'], source: string, error: unknown, handle?: NotificationHandle) => void;\n readonly mutate: (apply: (deliveries: Delivery[]) => void, final?: boolean) => typeof APPLIED;\n readonly commit: (deliveries?: readonly Delivery[], now?: number, final?: boolean) => void;\n readonly settle: () => number;\n readonly assign: (record: RecordState<Slot>) => void;\n readonly newest: () => RecordState<Slot> | null;\n readonly formOf: (record: RecordState<Slot>) => FormState | null;\n readonly handleError: (handle: NotificationHandle) => HandleRejection | 'disposed' | undefined;\n readonly withRecord: <Args extends unknown[], Result>(action: (record: RecordState<Slot>, ...args: Args) => Result)\n => (handle: NotificationHandle, ...args: Args) => Result | Rejected<HandleRejection | 'disposed'>;\n readonly autoDismissing: (host: boolean | undefined) => boolean;\n readonly setHostAutoDismiss: (value: boolean | undefined) => void;\n readonly dismiss: (handle: NotificationHandle, reason: CloseReason) => typeof APPLIED | Rejected<HandleRejection | 'disposed'>;\n readonly acknowledgeOverflow: () => typeof APPLIED | typeof UNCHANGED | Rejected<'disposed'>;\n readonly clear: (reason: 'clear' | 'clear-button') => ClearResult;\n readonly reportRendererLoadError: (error: unknown) => void;\n}\n\nexport function getControllerKernel<Slot>(controller: object): ControllerKernel<Slot> {\n const kernel = kernels.get(controller);\n if (!kernel) throw new TypeError('Controller was not created by this Cloudlet package instance');\n // The registry stores the kernel together with its controller's opaque Slot type.\n return kernel as ControllerKernel<Slot>;\n}\n\n/** The sole owner of notification state, the stack/Island, budgets, attention and host leases. */\nexport function createCloudletCore<Slot = never, Signal extends CancellationSignal = CancellationSignal>(\n inputOptions: ControllerOptions | undefined,\n dependencies: ControllerDependencies<Signal>,\n): CloudletController<Slot, Signal> {\n const options = validateOptions(inputOptions);\n if (!dependencies?.clock || typeof dependencies.clock.now !== 'function' || typeof dependencies.clock.schedule !== 'function') {\n throw new TypeError('Cloudlet requires a monotonic clock');\n }\n const clock = dependencies.clock;\n if (typeof dependencies.createCancellation !== 'function') throw new TypeError('Cloudlet requires a cancellation source factory');\n const identity = `cloudlet-${++nextController}` as ControllerIdentity;\n const records = new Map<string, RecordState<Slot>>();\n const listeners = new Set<() => void>();\n const eventListeners = new Set<(event: SemanticEvent) => void>();\n const operationSubscriptions = new Map<Set<() => void>, Delivery>();\n const globalPauses = new Set<PauseReason>();\n const batches: (() => void)[] = [];\n let focused: NotificationHandle | null = null;\n let focusRequest: FocusRequest | null = null;\n let lease: HostLease | null = null;\n let lastLease: HostLease | null = null;\n let serial = 0;\n let autoId = 0;\n let revision = 0;\n let eventSequence = 0;\n let island: IslandState<Slot> | null = null;\n // The presented record: Island current when open, otherwise the newest record.\n let presented: RecordState<Slot> | null = null;\n let hostDelay: number | undefined;\n /** `Toaster autoDismiss`: overrides ControllerOptions.autoDismiss while defined and attached. */\n let hostAutoDismiss: boolean | undefined;\n let attention: AttentionCandidate<Slot> | null = null;\n let cancelAttention: Unsubscribe | null = null;\n let attentionEpoch = 0;\n let overflow = 0;\n let overflowAnnounced = 0;\n let disposed = false;\n let delivering = false;\n let cancelTimer: Unsubscribe | null = null;\n let timerEpoch = 0;\n let snapshot: ControllerSnapshot<Slot>;\n let rendererSnapshot: RendererSnapshot<Slot>;\n\n const token = () => `${identity}:${++serial}`;\n // Map insertion order is admission order; the stack shows newest first.\n const stackOrder = () => [...records.values()].reverse();\n const newest = (): RecordState<Slot> | null => stackOrder()[0] ?? null;\n // A settled factory can always retry; only an unsuccessful attempt offers retry as an action.\n const retryable = (record: RecordState<Slot>) => {\n const operation = record.operation?.getSnapshot();\n return !!operation?.canRetry && operation.status !== 'fulfilled';\n };\n const requiresAction = (record: RecordState<Slot>) => !!record.content.action\n || retryable(record) || record.content.attention === 'open';\n const wantsAttention = (record: RecordState<Slot>) => {\n const rule = record.content.attention ?? 'auto';\n return rule === 'open' || (rule === 'auto' && (requiresAction(record) || !!record.content.description));\n };\n /** The record's form state, started from the field defaults whenever its form action object changes. */\n const formOf = (record: RecordState<Slot>): FormState | null => {\n const action = record.content.action;\n if (action?.kind !== 'form') return record.form = null;\n if (record.form?.action !== action) {\n record.form = { action, errors: NO_FORM_ERRORS,\n values: freeze(Object.fromEntries(action.fields.map((field) => [field.name, field.defaultValue ?? '']))) };\n }\n return record.form;\n };\n const dirty = (record: RecordState<Slot>) => {\n const form = formOf(record);\n return !!form && form.action.fields.some((field) => form.values[field.name] !== (field.defaultValue ?? ''));\n };\n // A draft in the open Island holds it like a hand on it: attention never switches it away.\n const interacting = () => globalPauses.has('hover') || globalPauses.has('focus')\n || [...records.values()].some((record) => record.pauses.has('gesture')) || (!!island && dirty(island.current));\n const pauses = (record: RecordState<Slot>): PauseReason[] => {\n const current = record === presented;\n return [\n ...(!current ? ['inactive' as const] : []),\n ...(lease === null ? ['no-host' as const] : []),\n ...(current && !record.readable ? ['presentation-pending' as const] : []),\n // An Island opened by the user, or a slide that asks for action, keeps its time.\n ...(current && island && (island.reason === 'user' || requiresAction(record)) ? ['island' as const] : []),\n ...(record.action.status === 'pending' ? ['action-pending' as const] : []),\n ...(dirty(record) ? ['draft' as const] : []),\n ...globalPauses, ...record.pauses,\n ];\n };\n const handleError = (handle: NotificationHandle): HandleRejection | 'disposed' | undefined => {\n if (disposed) return 'disposed';\n if (typeof handle !== 'object' || handle === null || !handles.has(handle)) return 'invalid-handle';\n if (handle.controller !== identity) return 'foreign-controller';\n if (records.get(handle.id)?.handle !== handle) return 'stale-handle';\n return undefined;\n };\n\n // Capability validation always precedes method-specific validation/mutation.\n function withRecord<Args extends unknown[], Result>(action: (record: RecordState<Slot>, ...args: Args) => Result) {\n return (handle: NotificationHandle, ...args: Args) => {\n const error = handleError(handle);\n return error ? reject(error) : action(records.get(handle.id)!, ...args);\n };\n }\n\n function diagnostic(diagnosticValue: Diagnostic): void {\n const value = freeze({ ...diagnosticValue });\n enqueue([{ type: 'diagnostic', diagnostic: value }]);\n }\n function failure(code: Diagnostic['code'], source: string, error: unknown, handle?: NotificationHandle): void {\n diagnostic({ code, source, message: `${source} failed`, error, ...(handle ? { handle } : {}) });\n }\n function notifyListeners(set: Set<() => void>, source: string): void {\n for (const listener of [...set]) {\n if (!set.has(listener)) continue;\n try { listener(); } catch (error) {\n failure('listener-error', source, error);\n }\n }\n }\n function enqueue(deliveries: readonly Delivery[], notify = false, at = clock.now(), final = false, release = false): void {\n batches.push(() => {\n if (notify) notifyListeners(listeners, 'subscribe');\n for (const delivery of deliveries) {\n if ('callback' in delivery) {\n try { delivery.callback(); } catch (error) {\n failure('callback-error', delivery.source, error, delivery.handle);\n }\n continue;\n }\n const event: SemanticEvent = freeze({ ...delivery, controller: identity, sequence: ++eventSequence,\n at: release ? clock.now() : at });\n for (const listener of [...eventListeners]) {\n if (!eventListeners.has(listener)) continue;\n try { listener(event); } catch (error) {\n if (event.type !== 'diagnostic') failure('listener-error', 'onEvent', error);\n }\n }\n if (event.type === 'diagnostic') {\n try { options.onDiagnostic?.(event.diagnostic); } catch { /* No recursive diagnostics. */ }\n }\n }\n // Close-callback diagnostics are queued before disposal releases observers.\n if (final) enqueue([{ type: 'disposed' }], false, at, false, true);\n if (release) {\n listeners.clear(); eventListeners.clear();\n for (const set of operationSubscriptions.keys()) set.clear();\n operationSubscriptions.clear();\n }\n });\n if (delivering) return;\n delivering = true;\n try {\n let batch: (() => void) | undefined;\n while ((batch = batches.shift())) batch();\n } finally { delivering = false; }\n }\n function settle(): number {\n const now = clock.now();\n for (const record of records.values()) {\n if (record.activeSince !== null && record.remaining !== null) {\n record.remaining = Math.max(0, record.remaining - Math.max(0, now - record.activeSince));\n record.activeSince = now;\n }\n }\n return now;\n }\n function stopTimer(): void {\n ++timerEpoch;\n cancelTimer?.();\n cancelTimer = null;\n }\n function schedule(now: number): void {\n stopTimer();\n let deadline = Infinity;\n for (const record of records.values()) {\n const active = record.remaining !== null && pauses(record).length === 0 && !disposed;\n record.activeSince = active ? now : null;\n if (active) deadline = Math.min(deadline, now + record.remaining!);\n }\n if (!Number.isFinite(deadline)) return;\n const epoch = timerEpoch;\n cancelTimer = clock.schedule(deadline, () => {\n if (disposed || epoch !== timerEpoch) return;\n const at = settle();\n const due = [...records.values()].filter((record) => record.activeSince !== null && record.remaining === 0);\n const deliveries: Delivery[] = [];\n for (const record of due) remove(record, 'timeout', deliveries);\n // An early delivery only rearms; a late delivery closes exactly the due generations.\n if (due.length) commit(deliveries, at);\n else schedule(at);\n });\n }\n function publish(): void {\n const current = [...records.values()];\n const notifications = freeze(current.map((record) => freeze({\n handle: record.handle, kind: record.kind, content: record.content, priority: record.priority,\n occurrences: record.occurrences, location: record === presented ? 'current' as const : 'stack' as const,\n remainingMs: record.remaining, pauseReasons: freeze(pauses(record)), operation: record.operation?.getSnapshot() ?? null, action: record.action,\n draft: dirty(record),\n })));\n snapshot = freeze({ controller: identity, revision, disposed, notifications,\n stack: freeze(stackOrder().map((record) => record.handle)),\n island: island ? freeze({ open: true, reason: island.reason, current: island.current.handle }) : COLLAPSED,\n overflow: freeze({ count: overflow, pending: overflow > 0 }),\n });\n rendererSnapshot = freeze({ ...snapshot,\n presentation: presented ? freeze({ handle: presented.handle, token: presented.presentation, readable: presented.readable }) : null,\n focusRequest,\n forms: freeze(current.flatMap((record) => {\n const form = formOf(record);\n return form ? [freeze({ handle: record.handle, values: form.values, errors: form.errors })] : [];\n })),\n announcements: freeze({ overflowCount: overflowAnnounced,\n notifications: freeze(current.map((record) => freeze({\n handle: record.handle, queued: record.queuedAnnounced, firstPresentation: record.firstAnnounced,\n occurrences: record.occurrencesAnnounced, action: record.actionAnnounced ?? null, operation: record.operation ? freeze({\n token: record.operation.getSnapshot().token, phases: freeze([...record.operationAnnounced]),\n }) : null,\n }))),\n }),\n });\n }\n function commit(deliveries: readonly Delivery[] = [], now = clock.now(), final = false): void {\n present();\n schedule(now);\n armAttention(now);\n ++revision;\n publish();\n enqueue(deliveries, true, now, final);\n }\n // Every state mutation settles the old budget, publishes once, then delivers.\n // The presented record is derived inside that transaction, before subscribers can reenter.\n function mutate(apply: (deliveries: Delivery[]) => void, final = false) {\n const now = settle();\n const deliveries: Delivery[] = [];\n apply(deliveries);\n commit(deliveries, now, final);\n return APPLIED;\n }\n function assign(record: RecordState<Slot>): void {\n record.readable = false;\n record.presentation = lease === null ? null : token() as PresentationToken;\n }\n function retire(record: RecordState<Slot>): void {\n record.presentation = null;\n record.readable = false;\n record.pauses.clear();\n if (focused === record.handle) focused = null;\n if (focusRequest?.target.kind === 'notification' && focusRequest.target.handle === record.handle) focusRequest = null;\n }\n /** A change of the presented record mints a new presentation token; its predecessor keeps its budget. */\n function present(): void {\n const next = island ? island.current : newest();\n if (next === presented) return;\n if (presented) retire(presented);\n presented = next;\n if (next) assign(next);\n }\n function stopAttention(): void {\n ++attentionEpoch;\n cancelAttention?.();\n cancelAttention = null;\n }\n /** Newest candidate wins: a new nomination replaces the pending one. */\n function nominate(record: RecordState<Slot>, now: number): void {\n if (wantsAttention(record)) attention = { record, due: now + (hostDelay ?? options.attentionDelay ?? ATTENTION_DELAY), waiting: false };\n }\n function armAttention(now: number): void {\n stopAttention();\n const candidate = attention;\n if (!candidate || disposed) return;\n // Without a host nothing has landed yet: wait without allocating a timer.\n if (lease === null) { candidate.waiting = true; return; }\n if (candidate.waiting) {\n if (interacting()) return;\n candidate.waiting = false;\n candidate.due = now + (hostDelay ?? options.attentionDelay ?? ATTENTION_DELAY);\n }\n const epoch = attentionEpoch;\n cancelAttention = clock.schedule(candidate.due, () => {\n if (disposed || epoch !== attentionEpoch || attention !== candidate) return;\n const at = clock.now();\n if (at < candidate.due) { armAttention(at); return; }\n cancelAttention = null;\n // Expiry during hover/focus/gesture waits; the next release restarts the delay.\n if (interacting()) { candidate.waiting = true; return; }\n attention = null;\n const record = candidate.record;\n if (!wantsAttention(record) || island?.current === record) return;\n mutate(() => {\n if (island) island.current = record;\n else island = { reason: 'attention', current: record };\n });\n });\n }\n const autoDismissing = (host: boolean | undefined) => (host ?? options.autoDismiss) !== false;\n /** Off stops every budget; on starts each one in full. */\n function setHostAutoDismiss(value: boolean | undefined): void {\n const changed = autoDismissing(value) !== autoDismissing(hostAutoDismiss);\n hostAutoDismiss = value;\n if (!changed) return;\n for (const record of records.values()) record.remaining = budget(record);\n }\n function budget(record: RecordState<Slot>): number | null {\n if (!autoDismissing(hostAutoDismiss)) return null;\n if (record.content.duration !== undefined) return record.content.duration;\n return (record.kind === 'info' || record.kind === 'success') && !record.content.action ? 6000 : null;\n }\n function remove(record: RecordState<Slot>, reason: CloseReason, deliveries: Delivery[]): void {\n if (island?.current === record) {\n // The next older slide, else the next newer one, else the Island closes.\n const order = stackOrder();\n const index = order.indexOf(record);\n const next = order[index + 1] ?? order[index - 1];\n if (next) island.current = next; else island = null;\n }\n if (attention?.record === record) attention = null;\n records.delete(record.handle.id);\n if (record.operation) deliveries.push(record.operation.detach());\n deliveries.push({ type: 'closed', handle: record.handle, reason });\n if (record.onClose) {\n const onClose = record.onClose;\n const notice = freeze({ handle: record.handle, reason });\n deliveries.push({ callback: () => onClose(notice), source: 'onClose', handle: record.handle });\n }\n }\n const dismiss = withRecord((record, reason: CloseReason) =>\n mutate((deliveries) => remove(record, reason, deliveries)));\n function forgetOverflow(deliveries: Delivery[]) {\n deliveries.push({ type: 'overflow-acknowledged', count: overflow });\n overflow = overflowAnnounced = 0;\n if (focusRequest?.target.kind === 'overflow') focusRequest = null;\n }\n function acknowledgeOverflow() {\n if (disposed) return reject('disposed');\n if (!overflow) return UNCHANGED;\n return mutate(forgetOverflow);\n }\n /** `clear()`, or the Island's clear button, which also acknowledges the missed count: nothing is left. */\n function clear(reason: 'clear' | 'clear-button'): ClearResult {\n if (disposed) return reject('disposed');\n const count = records.size;\n const acknowledge = reason === 'clear-button' && overflow > 0;\n if (count || acknowledge) {\n mutate((deliveries) => {\n for (const record of records.values()) remove(record, reason, deliveries);\n if (acknowledge) forgetOverflow(deliveries);\n });\n }\n return { status: 'cleared', count };\n }\n function subscribe<T>(set: Set<T>, listener: T): Unsubscribe {\n if (typeof listener !== 'function') throw new TypeError('Listener must be a function');\n if (disposed) return () => {};\n set.add(listener);\n return () => { set.delete(listener); };\n }\n function admit(spec: NotificationSpec<Slot>): AdmissionResult {\n if (disposed) return reject('disposed');\n const issues = validateSpec(spec);\n if (issues.length) {\n diagnostic({ code: 'invalid-input', source: 'show', message: 'Invalid notification specification' });\n return { ...reject('invalid-input'), issues };\n }\n return insert(spec);\n }\n function insert(spec: NotificationSpec<Slot>, initialize?: (record: RecordState<Slot>) => void): AdmissionResult {\n if (spec.id !== undefined && records.has(spec.id)) return reject('id-conflict');\n const existing = spec.dedupeKey === undefined ? undefined : [...records.values()].find((record) => record.dedupeKey === spec.dedupeKey);\n if (existing) {\n let occurrences = existing.occurrences;\n mutate((deliveries) => {\n occurrences = existing.occurrences = Math.min(Number.MAX_SAFE_INTEGER, occurrences + 1);\n deliveries.push({ type: 'deduplicated', handle: existing.handle, occurrences });\n });\n return { status: 'deduplicated', handle: existing.handle, occurrences };\n }\n if (records.size >= 100) {\n mutate((deliveries) => {\n overflow = Math.min(Number.MAX_SAFE_INTEGER, overflow + 1);\n const overflowValue = freeze({ count: overflow, pending: true });\n deliveries.push({ type: 'overflow', count: overflow });\n if (options.onOverflow) deliveries.push({ callback: () => options.onOverflow!(overflowValue), source: 'onOverflow' });\n });\n return reject('capacity');\n }\n const now = settle();\n let id = spec.id;\n if (id === undefined) { do { id = `${identity}:notification-${++autoId}`; } while (records.has(id)); }\n const handle = freeze({ id, controller: identity, generation: token() as Generation }) as NotificationHandle;\n handles.add(handle);\n const record: RecordState<Slot> = {\n handle: handle,\n dedupeKey: spec.dedupeKey,\n onClose: spec.onClose,\n content: copyContent(spec),\n kind: spec.kind ?? 'info',\n priority: spec.priority ?? 'normal',\n occurrences: 1,\n remaining: null,\n activeSince: null,\n presentation: null,\n readable: false,\n everPresented: false,\n pauses: new Set(),\n queuedAnnounced: false,\n firstAnnounced: false,\n occurrencesAnnounced: 0,\n operation: null,\n operationAnnounced: new Set(),\n action: IDLE,\n form: null,\n };\n record.remaining = budget(record);\n records.set(id, record);\n initialize?.(record);\n nominate(record, now);\n const deliveries: Delivery[] = [{ type: 'admitted', handle }];\n if (record.operation) {\n const operation = record.operation.getSnapshot();\n deliveries.push({ type: 'operation-started', handle, token: operation.token, attempt: operation.attempt });\n }\n commit(deliveries, now);\n return { status: 'created', handle };\n }\n function emit(deliveries: readonly Delivery[]): void {\n if (disposed) return;\n enqueue(deliveries);\n }\n function replaceContent(record: RecordState<Slot>, content: Readonly<NotificationContent<Slot>>, kind: NotificationKind): void {\n record.content = content;\n record.kind = kind;\n record.remaining = kind === 'loading' ? null : budget(record);\n // A replacement owns a new action context; old completions cannot close it.\n record.action = IDLE;\n if (record === presented) assign(record);\n // A runner phase (terminal result or new attempt) is evaluated like an admission.\n nominate(record, clock.now());\n if (focusRequest?.target.kind === 'notification' && focusRequest.target.handle === record.handle &&\n focusRequest.target.control === 'action' && !content.action) focusRequest = null;\n }\n function track<T>(source: OperationSource<T, Signal>, input: TrackOptions<T, Slot, Signal>): OperationHandle<T> {\n const factory = typeof source === 'function' ? source : null;\n let sourceThen: PromiseLike<T>['then'] | undefined;\n if (!factory && (source === null || typeof source !== 'object' || typeof (sourceThen = source.then) !== 'function')) {\n throw new TypeError('Operation source must be a factory or thenable');\n }\n const issues = validateTrackOptions(input, factory !== null);\n // Invalid presentation options cannot suppress a valid business source. Read\n // only data properties here; validation never executes option accessors.\n const field = (key: keyof TrackOptions<T, Slot, Signal>): unknown => input && typeof input === 'object'\n ? Object.getOwnPropertyDescriptor(input, key)?.value : undefined;\n const cancelValue = field('cancel');\n const cancelCallback = !factory && typeof cancelValue === 'function' ? cancelValue as (reason: unknown) => void : null;\n const classifierValue = field('isCancellation');\n const classifier = typeof classifierValue === 'function' ? classifierValue as NonNullable<TrackOptions<T, Slot, Signal>['isCancellation']> : null;\n const config = issues.length ? null : freeze({ ...input,\n pending: copyContent(input.pending),\n success: typeof input.success === 'function' ? input.success : copyContent(input.success),\n error: typeof input.error === 'function' ? input.error : copyContent(input.error),\n ...(input.cancelled === undefined ? {} : { cancelled: typeof input.cancelled === 'function' ? input.cancelled : copyContent(input.cancelled) }),\n });\n const subscribers = new Set<() => void>();\n let notification: NotificationHandle | null = null;\n let attached = false;\n let snapshotValue: OperationSnapshot;\n let attemptNumber = 0;\n type Attempt = {\n readonly public: OperationAttempt<T>;\n readonly context: OperationContext<Signal>;\n readonly abort: (reason?: unknown) => void;\n readonly resolve: (value: T | PromiseLike<T>) => void;\n readonly reject: (reason: unknown) => void;\n status: OperationStatus;\n cancelRequested: boolean;\n };\n function createAttempt(): Attempt {\n const cancellation = dependencies.createCancellation();\n const context = freeze({ signal: cancellation.signal, token: token() as OperationAttemptToken, attempt: ++attemptNumber });\n let resolve!: Attempt['resolve'];\n let fail!: Attempt['reject'];\n const result = new Promise<T>((fulfill, rejectResult) => { resolve = fulfill; fail = rejectResult; });\n const attempt: Attempt = {\n public: freeze({ token: context.token, attempt: context.attempt, result }), context,\n abort: cancellation.abort, resolve, reject: fail, status: 'pending', cancelRequested: false,\n };\n // Observe both branches without altering the public promise's value/reason.\n // The derived internal chain is handled as well, even if a platform port fails.\n void result.then((value) => finish(attempt, 'fulfilled', value), (error: unknown) => finish(attempt, 'rejected', error))\n .catch((error: unknown) => {\n if (!disposed) failure('callback-error', 'operation-settlement', error);\n });\n return attempt;\n }\n const first = createAttempt();\n let current = first;\n function getSnapshot(): OperationSnapshot {\n const next = {\n token: current.context.token, attempt: current.context.attempt, status: current.status,\n cancelRequested: current.cancelRequested,\n canCancel: !disposed && current.status === 'pending' && !current.cancelRequested && (!!factory || !!cancelCallback),\n canRetry: !disposed && !!factory && current.status !== 'pending',\n notification: attached && !disposed ? notification : null,\n };\n if (!snapshotValue || Object.keys(next).some((key) => next[key as keyof OperationSnapshot] !== snapshotValue[key as keyof OperationSnapshot])) {\n snapshotValue = freeze(next);\n }\n return snapshotValue;\n }\n const notify: Delivery = { source: 'operation.subscribe',\n callback: () => notifyListeners(subscribers, 'operation.subscribe') };\n function live(attempt: Attempt): RecordState<Slot> | undefined {\n if (disposed || current !== attempt || !attached || !notification) return undefined;\n const record = records.get(notification.id);\n return record?.handle === notification && record.operation === binding ? record : undefined;\n }\n function run(attempt: Attempt): void {\n // Validate and assimilate the same then method once, preserving its receiver.\n // Reading a user accessor again could replace the business outcome.\n try { attempt.resolve(factory ? factory(attempt.context) : { then: sourceThen!.bind(source) }); }\n catch (error) { attempt.reject(error); }\n }\n function deliver(deliveries: Delivery[], apply?: () => void): void {\n if (apply) {\n const now = settle();\n apply();\n commit(deliveries, now);\n } else emit(deliveries);\n }\n function finish(attempt: Attempt, initialStatus: 'fulfilled' | 'rejected', value: unknown): void {\n attempt.status = initialStatus;\n if (initialStatus === 'rejected') {\n try {\n const cancelled = classifier ? classifier(value, attempt.context) === true\n : attempt.cancelRequested && value !== null && typeof value === 'object' && 'name' in value && value.name === 'AbortError';\n if (cancelled) attempt.status = 'cancelled';\n } catch (error) {\n if (!disposed) failure('cancellation-error', 'isCancellation', error);\n }\n }\n let content: Readonly<NotificationContent<Slot>> | undefined;\n if (live(attempt) && config) {\n const status = attempt.status;\n const fallback = status === 'fulfilled' ? options.messages?.operationSuccess ?? 'Completed'\n : status === 'cancelled' ? options.messages?.operationCancelled ?? 'Cancelled'\n : options.messages?.operationError ?? 'Something went wrong';\n try {\n const mapper = status === 'fulfilled' ? config.success : status === 'cancelled' ? config.cancelled : config.error;\n const mapped = typeof mapper === 'function' ? mapper(value as T) : mapper ?? { title: fallback };\n if (validateContent(mapped).length) throw new TypeError('Invalid terminal notification content');\n content = copyContent(mapped);\n } catch (error) {\n content = freeze({ title: fallback, announcementPriority: 'polite' });\n if (!disposed) failure('mapper-error', `track.${status}`, error, notification ?? undefined);\n }\n }\n // User mappers, classifiers and diagnostic listeners are reentrant.\n const record = live(attempt);\n const uiApplied = !!record && !!content;\n const deliveries: Delivery[] = [\n ...(current === attempt ? [notify] : []),\n { type: 'operation-settled', handle: notification, token: attempt.context.token, status: attempt.status, uiApplied },\n ];\n deliver(deliveries, record && content ? () => replaceContent(record, content,\n attempt.status === 'fulfilled' ? 'success' : attempt.status === 'cancelled' ? 'warning' : 'error') : undefined);\n }\n function requestCancellation(attempt: Attempt, reason: unknown): void {\n attempt.cancelRequested = true;\n const record = live(attempt);\n const deliveries: Delivery[] = [notify, { type: 'cancellation-requested', handle: notification, token: attempt.context.token }];\n deliver(deliveries, record ? () => {\n record.content = patchContent(record.content, { title: options.messages?.cancellationRequested ?? 'Cancellation requested' });\n } : undefined);\n try {\n attempt.abort(reason);\n cancelCallback?.(reason);\n } catch (error) {\n if (!disposed) failure('cancellation-error', 'cancel', error, notification ?? undefined);\n }\n }\n function cancellationReason(): Error {\n const error = new Error('Cancellation requested');\n error.name = 'AbortError';\n return error;\n }\n function cancel(reason: unknown = cancellationReason()): CancelResult {\n if (disposed) return reject('disposed');\n if (current.status !== 'pending') return { status: 'unchanged', reason: 'settled' };\n if (!factory && !cancelCallback) return reject('not-cancellable');\n if (current.cancelRequested) return { status: 'unchanged', reason: 'already-requested' };\n requestCancellation(current, reason);\n return { status: 'requested' };\n }\n function start(restart: boolean): AttemptStartResult<T> {\n if (disposed) return reject('disposed');\n if (!factory) return reject('not-retryable');\n if (current.status === 'pending' && !restart) return reject('already-pending');\n const previous = current;\n const next = createAttempt();\n current = next; // Invalidate old ownership before any observer or abort callback.\n const record = live(next);\n const deliveries: Delivery[] = [notify, { type: 'operation-started', handle: notification, token: next.context.token, attempt: next.context.attempt }];\n deliver(deliveries, record && config ? () => {\n record.operationAnnounced.clear();\n replaceContent(record, config.pending, 'loading');\n } : undefined);\n if (previous.status === 'pending' && !previous.cancelRequested) requestCancellation(previous, cancellationReason());\n run(next);\n return { status: 'started', attempt: next.public };\n }\n const binding: OperationBinding = {\n getSnapshot, retry: () => start(false), cancel,\n detach: () => { attached = false; return notify; },\n };\n let admission: OperationAdmissionResult;\n if (disposed) admission = reject('disposed');\n else if (!config) {\n admission = { ...reject('invalid-input'), issues };\n diagnostic({ code: 'invalid-input', source: 'track', message: 'Invalid operation options' });\n } else {\n const admitted = insert({ ...config.pending, ...config, kind: 'loading' }, (record) => {\n notification = record.handle;\n attached = true;\n record.operation = binding;\n });\n // No dedupe key can reach this path (validated TrackOptions).\n if (admitted.status === 'deduplicated') throw new Error('Tracked operation cannot be deduplicated');\n admission = admitted;\n }\n if (admission.status === 'rejected') emit([{ type: 'operation-started', handle: null, token: first.context.token, attempt: 1 }]);\n run(first);\n return freeze({ ...first.public, admission: freeze(admission), getSnapshot,\n subscribe(listener: () => void) {\n const unsubscribe = subscribe(subscribers, listener);\n if (subscribers.size) operationSubscriptions.set(subscribers, notify);\n return () => { unsubscribe(); if (!subscribers.size) operationSubscriptions.delete(subscribers); };\n },\n cancel, retry: () => start(false), restart: () => start(true),\n });\n }\n\n const controller = freeze<CloudletController<Slot, Signal>>({\n show: (spec) => admit(spec),\n track,\n update: withRecord((record, patch: NotificationPatch<Slot>) => {\n const handle = record.handle;\n const issues = validatePatch(patch);\n if (issues.length) {\n diagnostic({ code: 'invalid-input', source: 'update', message: 'Invalid notification patch', handle });\n return { ...reject('invalid-input'), issues };\n }\n if (record.action.status === 'pending' && Object.prototype.hasOwnProperty.call(patch, 'action')) return reject('action-pending');\n if (record.operation && (Object.prototype.hasOwnProperty.call(patch, 'kind') ||\n (record.operation.getSnapshot().status === 'pending' && Object.prototype.hasOwnProperty.call(patch, 'duration')))) return reject('operation-owned');\n const content = patchContent(record.content, patch);\n const kind = patch.kind ?? record.kind;\n const priority = patch.priority ?? record.priority;\n const durationChanged = Object.prototype.hasOwnProperty.call(patch, 'duration');\n if (content === record.content && kind === record.kind && priority === record.priority && !durationChanged &&\n !(Object.prototype.hasOwnProperty.call(patch, 'action') && record.action.status === 'failed')) return UNCHANGED;\n return mutate((deliveries) => {\n const previousBudget = budget(record);\n record.content = content;\n if (Object.prototype.hasOwnProperty.call(patch, 'action')) record.action = IDLE;\n record.kind = kind;\n record.priority = priority;\n const nextBudget = budget(record);\n if (durationChanged || previousBudget !== nextBudget) record.remaining = nextBudget;\n if (focusRequest?.target.kind === 'notification' && focusRequest.target.handle === handle && focusRequest.target.control === 'action' && !content.action) focusRequest = null;\n if (attention?.record === record && !wantsAttention(record)) attention = null;\n deliveries.push({ type: 'updated', handle });\n });\n }),\n getHandle: (id) => !disposed && typeof id === 'string' ? records.get(id)?.handle : undefined,\n dismiss: (handle) => dismiss(handle, 'programmatic'),\n clear: () => clear('clear'),\n requestFocus(target: FocusTarget = { kind: 'anchor' }) {\n if (disposed) return reject('disposed');\n if (target?.kind === 'notification') {\n const error = handleError(target.handle);\n if (error) return reject(error);\n }\n if (!lease) return reject('no-host');\n if (!target || !['anchor', 'notification', 'overflow'].includes(target.kind)) return reject('unavailable');\n if (target.kind === 'notification') {\n const record = records.get(target.handle.id)!;\n if (record !== presented) return reject('not-visible');\n if (target.control !== undefined && !['action', 'close'].includes(target.control)) return reject('unavailable');\n if (target.control === 'action' && !record.content.action) return reject('unavailable');\n // Card controls exist only inside the open Island; the collapsed pill has none.\n if (target.control !== undefined && !island) return reject('not-visible');\n }\n if (target.kind === 'overflow' && !overflow) return reject('unavailable');\n mutate(() => {\n const copied: FocusTarget = target.kind === 'notification'\n ? freeze({ kind: target.kind, handle: target.handle, ...(target.control ? { control: target.control } : {}) })\n : freeze({ kind: target.kind });\n focusRequest = freeze({ token: token() as FocusRequestToken, target: copied });\n });\n return { status: 'requested' };\n },\n acknowledgeOverflow,\n getSnapshot: () => snapshot,\n getServerSnapshot: () => SERVER,\n subscribe: (listener) => subscribe(listeners, listener),\n onEvent: (listener) => subscribe(eventListeners, listener),\n dispose() {\n if (disposed) return;\n mutate((deliveries) => {\n disposed = true;\n for (const record of records.values()) remove(record, 'dispose', deliveries);\n // Detached/admission-rejected handles also lose their capabilities.\n for (const notify of operationSubscriptions.values()) if (!deliveries.includes(notify)) deliveries.push(notify);\n lease = lastLease = null;\n island = null;\n attention = null;\n stopAttention();\n focusRequest = null;\n globalPauses.clear();\n overflow = overflowAnnounced = 0;\n }, true);\n },\n });\n\n publish();\n kernels.set(controller, freeze<ControllerKernel<Slot>>({\n options, clock, records, globalPauses, subscribe: controller.subscribe, onEvent: controller.onEvent,\n get disposed() { return disposed; },\n get presented() { return presented; },\n get rendererSnapshot() { return rendererSnapshot; },\n get overflow() { return overflow; },\n get lease() { return lease; }, set lease(value) { lease = value; },\n get lastLease() { return lastLease; }, set lastLease(value) { lastLease = value; },\n get hostDelay() { return hostDelay; }, set hostDelay(value) { hostDelay = value; },\n get hostAutoDismiss() { return hostAutoDismiss; }, set hostAutoDismiss(value) { hostAutoDismiss = value; },\n get island() { return island; }, set island(value) { island = value; },\n get attention() { return attention; }, set attention(value) { attention = value; },\n get focusRequest() { return focusRequest; }, set focusRequest(value) { focusRequest = value; },\n get focused() { return focused; }, set focused(value) { focused = value; },\n get overflowAnnounced() { return overflowAnnounced; }, set overflowAnnounced(value) { overflowAnnounced = value; },\n token, diagnostic, failure, mutate, commit, settle, assign, newest, formOf, handleError, withRecord,\n autoDismissing, setHostAutoDismiss, dismiss, acknowledgeOverflow, clear,\n reportRendererLoadError(error) {\n if (!disposed) diagnostic({ code: 'renderer-load-error', source: 'Toaster', message: 'Toaster renderer failed to load', error });\n },\n }) as ControllerKernel<unknown>);\n return controller;\n}\n"],"mappings":";AAoEA,IAAMA,IAAS,OAAO,QAGhBC,oBAAU,IAAI,QAAgB,GAC9BC,oBAAU,IAAI,QAA2C,GAC3DC,IAAiB,GACfC,IAA0BJ,EAAO,CAAC,CAAC,GACnCK,IAA4BL,EAAO;CAAE,MAAM;CAAO,QAAQ;CAAM,SAAS;AAAK,CAAC,GAC/EM,IAAoCN,EAAO;CAC/C,YAAY;CAAM,UAAU;CAAG,UAAU;CAAO,eAAeI;CAAO,OAAOA;CAC7E,QAAQC;CAAW,UAAUL,EAAO;EAAE,OAAO;EAAG,SAAS;CAAM,CAAC;AAClE,CAAC,GACYO,IAA2CP,EAAO;CAC7D,GAAGM;CAAQ,cAAc;CAAM,cAAc;CAAM,OAAOF;CAC1D,eAAeJ,EAAO;EAAE,eAAeI;EAAO,eAAe;CAAE,CAAC;AAClE,CAAC,GACKI,IAAOR,EAAO,EAAE,QAAQ,OAAgB,CAAC,GAClCS,IAA6BT,EAAO;CAAE,MAAM;CAAM,QAAQA,EAAO,CAAC,CAAC;AAAE,CAAC,GACtEU,IAAUV,EAAO,EAAE,QAAQ,UAAmB,CAAC,GAC/CW,IAAYX,EAAO,EAAE,QAAQ,YAAqB,CAAC,GACnDY,KAAiC,OAAoB;CAAE,QAAQ;CAAqB;AAAO;AAgDxG,SAAgBC,EAA0B,GAA4C;CACpF,IAAMC,IAASZ,EAAQ,IAAIa,CAAU;CACrC,IAAI,CAACD,GAAQ,MAAU,UAAU,8DAA8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AAc;EAAG,IAAI,aAAa,GAAO;GAAE,IAAeqF;EAAO;EAC7F,IAAI,UAAU;GAAE,OAAOtF;EAAS;EAAG,IAAI,QAAQ,GAAO;GAAE,IAAUsF;EAAO;EACzE,IAAI,oBAAoB;GAAE,OAAOtE;EAAmB;EAAG,IAAI,kBAAkB,GAAO;GAAE,IAAoBsE;EAAO;EACjH;EAAO;EAAY;EAAS;EAAQ;EAAQ;EAAQ;EAAQ;EAAQ;EAAQ;EAAa;EACzF;EAAgB;EAAoB;EAAS;EAAqB;EAClE,wBAAwB,GAAO;GAC7B,AAAKrE,KAAU4B,EAAW;IAAE,MAAM;IAAuB,QAAQ;IAAW,SAAS;IAAmC;GAAM,CAAC;EACjI;CACF,CAAC,CAA8B,GACxB3D;AACT"}
|
package/dist/react/card.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/react/card.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA8D,SAAS,EAAE,MAAM,OAAO,CAAC;AACnG,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE9E,eAAO,MAAM,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/react/card.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA8D,SAAS,EAAE,MAAM,OAAO,CAAC;AACnG,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0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S,gCAAiD,CAAC;AAM9F;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;IAAE,YAAY,EAAE,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAAC,MAAM,EAAE,cAAc,CAAC;IAAC,IAAI,EAAE,SAAS,CAAA;CAAE,+BAoBtJ;AAED,8EAA8E;AAC9E,wBAAgB,IAAI,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;IACjG,YAAY,EAAE,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAAC,IAAI,EAAE,SAAS,GAAG,SAAS,CAAC;IAAC,MAAM,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IAAC,KAAK,EAAE,SAAS,CAAC;IAChI,MAAM,EAAE,cAAc,CAAC;IAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAAC,IAAI,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,SAAS,CAAC;IAAC,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;CACjJ,+BAkCA;AAkFD,wBAAgB,WAAW,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,IAAI,+BAEvF"}
|
package/dist/react/card.js
CHANGED
|
@@ -11,6 +11,8 @@ var c = {
|
|
|
11
11
|
cancel: "Request cancellation",
|
|
12
12
|
cancellationRequested: "Cancellation requested",
|
|
13
13
|
acknowledgeOverflow: "Acknowledge missed notifications",
|
|
14
|
+
clearAll: "Clear all",
|
|
15
|
+
clearAllConfirm: (e) => `Clear ${e}`,
|
|
14
16
|
collapse: "Press Escape to collapse",
|
|
15
17
|
stackSummary: (e, t, n) => [
|
|
16
18
|
e,
|
package/dist/react/card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.js","names":["defaultLabels","title","count","missed","index","total","SlotBoundary","Component","props","state","Suspense","CheckedSlot","ref","useRef","invalidContent","setInvalidContent","useState","invalid","content","useEffect","element","reported","check","bridge","lease","Observer","observer","handle","rejectFocus","event","control","name","glyph","path","partClasses","extra","classNames","part","own","glyphs","StatusIcon","notification","determinate","progress","kind","preview","slot","slotRenderer","value","rejectSlotFocus","Heading","titleId","previewSlot","retryable","operation","SlidePreview","action","lookalike","primary","labels","Body","neutral","id","useId","command","activateLink","navigate","form","Form","formKey","formKeys","nextFormKey","key","TEXTAREA_ROWS","fitRows","fields","pending","failed","formError","draft","submit","result","first","field","fieldId","error","change","last","actionErrorId","item","closeButton","onClick"],"sources":["../../src/react/card.tsx"],"sourcesContent":["import { Component, Suspense, useEffect, useId, useRef, useState } from 'react';\nimport type { ComponentPropsWithRef, KeyboardEvent as ReactKeyboardEvent, ReactNode } from 'react';\nimport type { FormDraft, HostLease, RendererBridge } from '../contracts/internal.js';\nimport type { NotificationHandle } from '../contracts/identity.js';\nimport type { FormAction, FormField, NotificationKind } from '../contracts/notifications.js';\nimport type { NotificationSnapshot } from '../contracts/snapshots.js';\nimport type { CloudletLabels, CloudletPart, ToasterProps } from '../react.js';\n\nexport const defaultLabels: CloudletLabels = {\n region: 'Notifications', island: 'Current notifications', carousel: 'carousel', slide: 'slide',\n close: 'Close notification', retry: 'Retry',\n cancel: 'Request cancellation', cancellationRequested: 'Cancellation requested',\n acknowledgeOverflow: 'Acknowledge missed notifications', collapse: 'Press Escape to collapse',\n stackSummary: (title, count, missed) => [title, ...(count > 1 ? [`${count} notifications`] : []),\n ...(missed > 0 ? [`${missed} missed`] : [])].join(', '),\n page: (index, total) => `${index} of ${total}`,\n overflowCount: count => `${count} missed notifications`,\n draft: 'Draft',\n};\n\ninterface SlotProps {\n readonly content: ReactNode;\n readonly bridge: RendererBridge<ReactNode>;\n readonly lease: HostLease;\n readonly handle: NotificationHandle;\n readonly rejectFocus: (previous: EventTarget | null) => void;\n}\n\nclass SlotBoundary extends Component<SlotProps, { failed: boolean; content: ReactNode }> {\n override state = { failed: false, content: this.props.content };\n static getDerivedStateFromError() { return { failed: true }; }\n static getDerivedStateFromProps(props: SlotProps, state: { content: ReactNode }) {\n return props.content === state.content ? null : { failed: false, content: props.content };\n }\n override componentDidCatch(error: unknown) {\n this.props.bridge.reportDiagnostic(this.props.lease, { code: 'slot-error', source: 'Toaster.slot',\n message: 'A rich slot could not be rendered', handle: this.props.handle, error });\n }\n override render() {\n return this.state.failed ? this.props.bridge.renderError\n : <Suspense fallback={this.props.bridge.renderError}><CheckedSlot {...this.props} /></Suspense>;\n }\n}\n\nfunction CheckedSlot({ content, bridge, lease, handle, rejectFocus }: SlotProps) {\n const ref = useRef<HTMLDivElement>(null);\n const [invalidContent, setInvalidContent] = useState<{ content: ReactNode } | null>(null);\n const invalid = invalidContent?.content === content;\n useEffect(() => {\n const element = ref.current;\n if (!element) return;\n let reported = false;\n const check = () => {\n if (reported || !element.querySelector('a[href],button,input,select,textarea,summary,iframe,[tabindex],[contenteditable]:not([contenteditable=\"false\"]),audio[controls],video[controls]')) return;\n reported = true;\n setInvalidContent({ content });\n bridge.reportDiagnostic(lease, { code: 'slot-error', source: 'Toaster.slot',\n message: 'Rich slots must be non-interactive; use the notification action', handle });\n };\n check();\n const Observer = element.ownerDocument.defaultView?.MutationObserver;\n const observer = Observer ? new Observer(check) : null;\n observer?.observe(element, { childList: true, subtree: true, attributes: true });\n return () => observer?.disconnect();\n }, [content, bridge, lease, handle]);\n return <div ref={ref} className=\"cloudlet-slot\" onFocusCapture={event => rejectFocus(event.relatedTarget)}>\n {invalid ? bridge.renderError : content}\n </div>;\n}\n\nfunction control(name: string, children: ReactNode, onClick: () => void, props?: ComponentPropsWithRef<'button'>) {\n return <button type=\"button\" data-cloudlet-control={name} {...props} onClick={onClick}>{children}</button>;\n}\n\nfunction glyph(path: string) {\n return <svg aria-hidden=\"true\" viewBox=\"0 0 16 16\"><path d={path} /></svg>;\n}\n\n/** Adds the application's `classNames` part to an own `cloudlet-*` class, never replacing it. */\nexport type PartClass = (part: CloudletPart, own: string) => string;\nexport function partClasses(classNames: ToasterProps['classNames']): PartClass {\n return (part, own) => {\n const extra = classNames?.[part];\n return typeof extra === 'string' && extra.trim() ? `${own} ${extra.trim()}` : own;\n };\n}\n\n/** 16 px stroke glyphs drawn in the status colour. */\nconst glyphs: Record<Exclude<NotificationKind, 'loading'>, string> = {\n success: 'M4.5 8.5 7 11l4.5-5.5',\n error: 'm5.5 5.5 5 5m0-5-5 5',\n info: 'M8 7.5V11M8 5h.01',\n warning: 'M8 4.75V8.5M8 11.25h.01',\n};\n\n/**\n * The status icon: a 24 px tinted circle with a glyph, the loading spinner or the\n * notification's own icon, and the 2 px progress ring around it (pill and Island\n * share these nodes). With progress the icon is the accessible progressbar. The\n * determinate arc is owned by the host sampler (one RAF per host, 240 ms tween);\n * `preview` draws the value statically for the inert swipe neighbour.\n */\nexport function StatusIcon({ notification, slot, part, preview = false }: {\n notification: NotificationSnapshot<ReactNode>; slot: (value: ReactNode) => ReactNode; part: PartClass; preview?: boolean;\n}) {\n const { content, kind } = notification;\n const { progress } = content;\n const determinate = progress?.kind === 'determinate';\n return <div className={part('icon', 'cloudlet-icon')} data-kind={kind}\n {...(progress && !preview ? { role: 'progressbar', 'aria-valuemin': 0, 'aria-valuemax': 100,\n 'aria-valuenow': determinate ? Math.round(progress.value * 100) : undefined, 'aria-label': progress.label ?? content.title }\n : { 'aria-hidden': 'true' })}>\n {content.icon !== undefined\n ? <span className=\"cloudlet-glyph\" aria-hidden=\"true\">{slot(content.icon)}</span>\n // With progress the ring is the activity indicator of a loading record.\n : kind === 'loading' ? !progress && <svg aria-hidden=\"true\" viewBox=\"0 0 16 16\" className=\"cloudlet-glyph cloudlet-spinner\">\n <circle cx=\"8\" cy=\"8\" r=\"5.5\" strokeDasharray=\"22 13\" /></svg>\n : <svg aria-hidden=\"true\" viewBox=\"0 0 16 16\" className=\"cloudlet-glyph\"><path d={glyphs[kind]} /></svg>}\n {progress && <svg aria-hidden=\"true\" viewBox=\"0 0 32 32\" className=\"cloudlet-ring\" data-progress={progress.kind}>\n <circle className=\"cloudlet-ring-track\" cx=\"16\" cy=\"16\" r=\"15\" />\n <circle className=\"cloudlet-progress-fill\" cx=\"16\" cy=\"16\" r=\"15\" pathLength=\"100\" transform=\"rotate(-90 16 16)\"\n strokeDasharray={!determinate ? '25 75' : preview ? `${Math.round(progress.value * 10000) / 100} 100` : '0 100'} />\n </svg>}\n </div>;\n}\n\nexport function slotRenderer(bridge: RendererBridge<ReactNode>, lease: HostLease, handle: NotificationHandle,\n rejectSlotFocus: (previous: EventTarget | null) => void) {\n return (value: ReactNode) => <SlotBoundary content={value} bridge={bridge} lease={lease} handle={handle} rejectFocus={rejectSlotFocus} />;\n}\n\n/**\n * Status icon and title: the same DOM nodes in the pill and in the Island header,\n * so opening never re-creates them and the title can receive focus in place.\n */\nexport function Heading({ notification, slot, part, titleId }: {\n notification: NotificationSnapshot<ReactNode>; slot: (value: ReactNode) => ReactNode; part: PartClass;\n /** Omitted for the inert neighbour preview: no id, focus target, data hook or live progress. */\n titleId?: string;\n}) {\n const title = part('title', 'cloudlet-title');\n return <div className=\"cloudlet-heading\">\n <StatusIcon notification={notification} slot={slot} part={part} preview={titleId === undefined} />\n {titleId === undefined ? <h2 className={title}>{notification.content.title}</h2>\n : <h2 id={titleId} tabIndex={-1} data-cloudlet-title=\"\" className={title}>{notification.content.title}</h2>}\n </div>;\n}\n\n/** Rich content of the inert neighbour preview: rendered as is, never checked or reported twice. */\nexport const previewSlot = (value: ReactNode) => <div className=\"cloudlet-slot\">{value}</div>;\n\n/** A settled factory can always retry through the API; only an unsuccessful attempt offers the button. */\ntype Operation = NotificationSnapshot<ReactNode>['operation'];\nconst retryable = (operation: Operation): operation is NonNullable<Operation> => !!operation?.canRetry && operation.status !== 'fulfilled';\n\n/**\n * The neighbour shown only while a finger drags the Island content:\n * the same layout as a live slide, but every control is a lookalike without\n * handlers, ids, links or tab stops. The caller puts it in an `inert` container.\n */\nexport function SlidePreview({ notification, labels, part }: { notification: NotificationSnapshot<ReactNode>; labels: CloudletLabels; part: PartClass }) {\n const { content, operation, kind } = notification;\n const action = part('action', 'cloudlet-action');\n const lookalike = (children: ReactNode, primary = false) =>\n <button type=\"button\" tabIndex={-1} className={primary ? `${action} cloudlet-primary` : action}>{children}</button>;\n // Only the body slides: the preview shows the neighbour's body under the live heading.\n return <div className=\"cloudlet-slide\" data-kind={kind}>\n <div className={part('body', 'cloudlet-body')} data-kind={kind}>\n {content.description && <div className={part('description', 'cloudlet-description')}>\n {content.description.kind === 'text' ? <p>{content.description.text}</p> : previewSlot(content.description.content)}\n </div>}\n <div className={part('actions', 'cloudlet-actions')}>\n {content.action?.kind === 'command' && lookalike(content.action.label, true)}\n {content.action?.kind === 'link' && <a className={`${action} cloudlet-primary`}>{content.action.label}</a>}\n {retryable(operation) && lookalike(labels.retry)}\n {operation?.canCancel && lookalike(operation.cancelRequested ? labels.cancellationRequested : labels.cancel)}\n </div>\n {notification.action.status === 'failed' && <p className=\"cloudlet-action-error\">{notification.action.message}</p>}\n </div>\n </div>;\n}\n\n/** Island slide body: description, progress, actions and the action error. */\nexport function Body({ notification, form, bridge, lease, labels, navigate, slot, part, titleId }: {\n notification: NotificationSnapshot<ReactNode>; form: FormDraft | undefined; bridge: RendererBridge<ReactNode>; lease: HostLease;\n labels: CloudletLabels; navigate: (handle: NotificationHandle) => void; slot: (value: ReactNode) => ReactNode; part: PartClass; titleId: string;\n}) {\n const { handle, content, operation, action, kind } = notification;\n // The primary action is tinted with the status; retry and cancel stay neutral.\n const neutral = part('action', 'cloudlet-action');\n const primary = `${neutral} cloudlet-primary`;\n const id = useId();\n const command = content.action;\n const activateLink = (event: MouseEvent) => {\n // Observe cancellation after portal/application ancestors have handled activation.\n queueMicrotask(() => { if (!event.defaultPrevented) navigate(handle); });\n };\n return <div className={part('body', 'cloudlet-body')} data-kind={kind}>\n {content.description && <div className={part('description', 'cloudlet-description')}>\n {content.description.kind === 'text' && <p>{content.description.text}</p>}\n {content.description.kind === 'rich' && slot(content.description.content)}\n </div>}\n {command?.kind === 'form' && form && <Form key={formKey(command)} action={command} draft={form} notification={notification}\n bridge={bridge} lease={lease} part={part} titleId={titleId} actionErrorId={`${id}-action-error`} />}\n <div className={part('actions', 'cloudlet-actions')}>\n {command?.kind === 'command' && control('action', command.label, () => {\n if (action.status !== 'pending') bridge.invokeAction(lease, handle);\n }, { className: primary, 'aria-disabled': action.status === 'pending', 'aria-busy': action.status === 'pending',\n 'aria-describedby': action.status === 'failed' ? `${id}-action-error` : undefined })}\n {command?.kind === 'link' && <a data-cloudlet-control=\"action\" className={primary} href={command.href} target={command.target}\n rel={command.target === '_blank' ? [...new Set(`${command.rel ?? ''} noopener`.trim().split(/\\s+/u))].join(' ') : command.rel}\n onClick={event => activateLink(event.nativeEvent)}\n onAuxClick={event => { if (event.button === 1) activateLink(event.nativeEvent); }}>{command.label}</a>}\n {retryable(operation) && control('retry', labels.retry, () => bridge.retryOperation(lease, handle, operation.token), { className: neutral })}\n {operation?.canCancel && control('cancel', operation.cancelRequested ? labels.cancellationRequested : labels.cancel, () => {\n if (!operation.cancelRequested) bridge.cancelOperation(lease, handle, operation.token);\n }, { className: neutral, 'aria-disabled': operation.cancelRequested })}\n </div>\n {action.status === 'failed' && <p id={`${id}-action-error`} className=\"cloudlet-action-error\">{action.message}</p>}\n </div>;\n}\n\n// A new form action object starts a new draft in the controller, so its fields remount with the new defaults.\nconst formKeys = new WeakMap<FormAction, number>();\nlet nextFormKey = 0;\nfunction formKey(action: FormAction): number {\n let key = formKeys.get(action);\n if (key === undefined) formKeys.set(action, key = ++nextFormKey);\n return key;\n}\n\nconst TEXTAREA_ROWS = [3, 6] as const;\n\n/** Rows instead of a height: a strict CSP forbids style attributes, and rows grow with the text. */\nfunction fitRows(element: HTMLTextAreaElement): void {\n element.rows = TEXTAREA_ROWS[0];\n while (element.scrollHeight > element.clientHeight && element.rows < TEXTAREA_ROWS[1]) element.rows += 1;\n}\n\n/**\n * Look A: each field is a filled pill; the round submit button sits beside the last one. The fields\n * are uncontrolled: their text lives in the controller's draft and seeds them on mount, so typing\n * never waits for a snapshot round trip.\n */\nfunction Form({ action, draft, notification, bridge, lease, part, titleId, actionErrorId }: {\n action: FormAction; draft: FormDraft; notification: NotificationSnapshot<ReactNode>; bridge: RendererBridge<ReactNode>;\n lease: HostLease; part: PartClass; titleId: string; actionErrorId: string;\n}) {\n const id = useId();\n const fields = useRef(new Map<string, HTMLInputElement | HTMLTextAreaElement>());\n const pending = notification.action.status === 'pending';\n const failed = notification.action.status === 'failed';\n const formError = draft.errors.form;\n const submit = () => {\n if (pending) return;\n const result = bridge.invokeAction(lease, notification.handle);\n if (result.status !== 'invalid') return;\n const first = action.fields.find(field => result.errors.fields[field.name] !== undefined);\n if (first) fields.current.get(first.name)?.focus();\n };\n const field = (field: FormField, index: number, last: boolean) => {\n const fieldId = `${id}-${index}`;\n const error = draft.errors.fields[field.name];\n const props = {\n id: fieldId, name: field.name, className: part('field', 'cloudlet-field'), defaultValue: draft.values[field.name] ?? '',\n placeholder: field.placeholder ?? field.label, required: field.required, maxLength: field.maxLength,\n autoComplete: field.autoComplete, inputMode: field.inputMode, readOnly: pending,\n 'aria-invalid': error === undefined ? undefined : true, 'aria-describedby': error === undefined ? undefined : `${fieldId}-error`,\n };\n const change = (element: HTMLInputElement | HTMLTextAreaElement) => bridge.setFormValue(lease, notification.handle, field.name, element.value);\n return <div key={field.name} className=\"cloudlet-form-row\">\n <label htmlFor={fieldId} className=\"cloudlet-live\">{field.label}</label>\n {field.kind === 'text'\n ? <input type=\"text\" {...props} ref={element => { if (element) fields.current.set(field.name, element); }}\n onChange={event => change(event.currentTarget)} />\n : <textarea {...props} rows={TEXTAREA_ROWS[0]} ref={element => {\n if (!element) return;\n fields.current.set(field.name, element);\n fitRows(element);\n }} onChange={event => { change(event.currentTarget); fitRows(event.currentTarget); }}\n onKeyDown={(event: ReactKeyboardEvent<HTMLTextAreaElement>) => {\n // Enter starts a new line in a textarea; ⌘ or Ctrl with Enter sends.\n if (event.key !== 'Enter' || !(event.metaKey || event.ctrlKey) || event.nativeEvent.isComposing) return;\n event.preventDefault();\n submit();\n }} />}\n {last && <button type=\"submit\" data-cloudlet-control=\"action\" className={part('action', 'cloudlet-action cloudlet-submit')}\n aria-label={action.label} aria-disabled={pending} aria-busy={pending}\n aria-describedby={failed ? actionErrorId : formError ? `${id}-error` : undefined}>\n {pending ? <svg aria-hidden=\"true\" viewBox=\"0 0 16 16\" className=\"cloudlet-spinner\"><circle cx=\"8\" cy=\"8\" r=\"5.5\" strokeDasharray=\"22 13\" /></svg>\n : glyph('M8 13V3m0 0L3.5 7.5M8 3l4.5 4.5')}\n </button>}\n {error !== undefined && <p id={`${fieldId}-error`} className={part('field-error', 'cloudlet-field-error')}>{error}</p>}\n </div>;\n };\n return <form className={part('form', 'cloudlet-form')} noValidate aria-labelledby={titleId}\n onSubmit={event => { event.preventDefault(); submit(); }}>\n {action.fields.map((item, index) => field(item, index, index === action.fields.length - 1))}\n {formError && <p id={`${id}-error`} className=\"cloudlet-action-error\">{formError}</p>}\n </form>;\n}\n\nexport function closeButton(labels: CloudletLabels, part: PartClass, onClick: () => void) {\n return control('close', glyph('m4.5 4.5 7 7m0-7-7 7'), onClick, { 'aria-label': labels.close, className: part('close', 'cloudlet-close') });\n}\n"],"mappings":";;;AAQA,IAAaA,IAAgC;CAC3C,QAAQ;CAAiB,QAAQ;CAAyB,UAAU;CAAY,OAAO;CACvF,OAAO;CAAsB,OAAO;CACpC,QAAQ;CAAwB,uBAAuB;CACvD,qBAAqB;CAAoC,UAAU;CACnE,eAAe,GAAO,GAAO,MAAW;EAACC;EAAO,GAAIC,IAAQ,IAAI,CAAC,GAAGA,EAAM,eAAe,IAAI,CAAC;EAC5F,GAAIC,IAAS,IAAI,CAAC,GAAGA,E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I,IAAG;OAAI,GAAE;OAAM,iBAAgB;MAAS,CAAA;KAAM,CAAA,IAC7I5C,EAAM,iCAAiC;IACrC,CAAA;IACPqD,MAAU,KAAA,KAAa,kBAAC,KAAD;KAAG,IAAI,GAAGD,EAAQ;KAAS,WAAW/C,EAAK,eAAe,sBAAsB;KAAI,UAAAgD;IAAS,CAAA;GAClH;EAvBY,GAAAF,EAAM,IAuBlB;CACP;CACA,OAAO,kBAAC,QAAD;EAAM,WAAW9C,EAAK,QAAQ,eAAe;EAAG,YAAA;EAAW,mBAAiBc;EACjF,WAAU,MAAS;GAA0B,AAAxBtB,EAAM,eAAe,GAAGmD,EAAO;EAAG;EADlD,UAAA,CAEJxB,EAAO,OAAO,KAAK,GAAM,MAAU2B,EAAMM,GAAMrF,GAAOA,MAAUoD,EAAO,OAAO,SAAS,CAAC,CAAC,GACzFsB,KAAa,kBAAC,KAAD;GAAG,IAAI,GAAGhB,EAAG;GAAS,WAAU;GAAyB,UAAAgB;EAAa,CAAA,CAChF;;AACR;AAEA,SAAgBY,EAAY,GAAwB,GAAiB,GAAqB;CACxF,OAAO5D,EAAQ,SAASE,EAAM,sBAAsB,GAAG2D,GAAS;EAAE,cAAchC,EAAO;EAAO,WAAWtB,EAAK,SAAS,gBAAgB;CAAE,CAAC;AAC5I"}
|
|
1
|
+
{"version":3,"file":"card.js","names":["defaultLabels","count","title","missed","index","total","SlotBoundary","Component","props","state","Suspense","CheckedSlot","ref","useRef","invalidContent","setInvalidContent","useState","invalid","content","useEffect","element","reported","check","bridge","lease","Observer","observer","handle","rejectFocus","event","control","name","glyph","path","partClasses","extra","classNames","part","own","glyphs","StatusIcon","notification","determinate","progress","kind","preview","slot","slotRenderer","value","rejectSlotFocus","Heading","titleId","previewSlot","retryable","operation","SlidePreview","action","lookalike","primary","labels","Body","neutral","id","useId","command","activateLink","navigate","form","Form","formKey","formKeys","nextFormKey","key","TEXTAREA_ROWS","fitRows","fields","pending","failed","formError","draft","submit","result","first","field","fieldId","error","change","last","actionErrorId","item","closeButton","onClick"],"sources":["../../src/react/card.tsx"],"sourcesContent":["import { Component, Suspense, useEffect, useId, useRef, useState } from 'react';\nimport type { ComponentPropsWithRef, KeyboardEvent as ReactKeyboardEvent, ReactNode } from 'react';\nimport type { FormDraft, HostLease, RendererBridge } from '../contracts/internal.js';\nimport type { NotificationHandle } from '../contracts/identity.js';\nimport type { FormAction, FormField, NotificationKind } from '../contracts/notifications.js';\nimport type { NotificationSnapshot } from '../contracts/snapshots.js';\nimport type { CloudletLabels, CloudletPart, ToasterProps } from '../react.js';\n\nexport const defaultLabels: CloudletLabels = {\n region: 'Notifications', island: 'Current notifications', carousel: 'carousel', slide: 'slide',\n close: 'Close notification', retry: 'Retry',\n cancel: 'Request cancellation', cancellationRequested: 'Cancellation requested',\n acknowledgeOverflow: 'Acknowledge missed notifications', clearAll: 'Clear all', clearAllConfirm: count => `Clear ${count}`,\n collapse: 'Press Escape to collapse',\n stackSummary: (title, count, missed) => [title, ...(count > 1 ? [`${count} notifications`] : []),\n ...(missed > 0 ? [`${missed} missed`] : [])].join(', '),\n page: (index, total) => `${index} of ${total}`,\n overflowCount: count => `${count} missed notifications`,\n draft: 'Draft',\n};\n\ninterface SlotProps {\n readonly content: ReactNode;\n readonly bridge: RendererBridge<ReactNode>;\n readonly lease: HostLease;\n readonly handle: NotificationHandle;\n readonly rejectFocus: (previous: EventTarget | null) => void;\n}\n\nclass SlotBoundary extends Component<SlotProps, { failed: boolean; content: ReactNode }> {\n override state = { failed: false, content: this.props.content };\n static getDerivedStateFromError() { return { failed: true }; }\n static getDerivedStateFromProps(props: SlotProps, state: { content: ReactNode }) {\n return props.content === state.content ? null : { failed: false, content: props.content };\n }\n override componentDidCatch(error: unknown) {\n this.props.bridge.reportDiagnostic(this.props.lease, { code: 'slot-error', source: 'Toaster.slot',\n message: 'A rich slot could not be rendered', handle: this.props.handle, error });\n }\n override render() {\n return this.state.failed ? this.props.bridge.renderError\n : <Suspense fallback={this.props.bridge.renderError}><CheckedSlot {...this.props} /></Suspense>;\n }\n}\n\nfunction CheckedSlot({ content, bridge, lease, handle, rejectFocus }: SlotProps) {\n const ref = useRef<HTMLDivElement>(null);\n const [invalidContent, setInvalidContent] = useState<{ content: ReactNode } | null>(null);\n const invalid = invalidContent?.content === content;\n useEffect(() => {\n const element = ref.current;\n if (!element) return;\n let reported = false;\n const check = () => {\n if (reported || !element.querySelector('a[href],button,input,select,textarea,summary,iframe,[tabindex],[contenteditable]:not([contenteditable=\"false\"]),audio[controls],video[controls]')) return;\n reported = true;\n setInvalidContent({ content });\n bridge.reportDiagnostic(lease, { code: 'slot-error', source: 'Toaster.slot',\n message: 'Rich slots must be non-interactive; use the notification action', handle });\n };\n check();\n const Observer = element.ownerDocument.defaultView?.MutationObserver;\n const observer = Observer ? new Observer(check) : null;\n observer?.observe(element, { childList: true, subtree: true, attributes: true });\n return () => observer?.disconnect();\n }, [content, bridge, lease, handle]);\n return <div ref={ref} className=\"cloudlet-slot\" onFocusCapture={event => rejectFocus(event.relatedTarget)}>\n {invalid ? bridge.renderError : content}\n </div>;\n}\n\nfunction control(name: string, children: ReactNode, onClick: () => void, props?: ComponentPropsWithRef<'button'>) {\n return <button type=\"button\" data-cloudlet-control={name} {...props} onClick={onClick}>{children}</button>;\n}\n\nfunction glyph(path: string) {\n return <svg aria-hidden=\"true\" viewBox=\"0 0 16 16\"><path d={path} /></svg>;\n}\n\n/** Adds the application's `classNames` part to an own `cloudlet-*` class, never replacing it. */\nexport type PartClass = (part: CloudletPart, own: string) => string;\nexport function partClasses(classNames: ToasterProps['classNames']): PartClass {\n return (part, own) => {\n const extra = classNames?.[part];\n return typeof extra === 'string' && extra.trim() ? `${own} ${extra.trim()}` : own;\n };\n}\n\n/** 16 px stroke glyphs drawn in the status colour. */\nconst glyphs: Record<Exclude<NotificationKind, 'loading'>, string> = {\n success: 'M4.5 8.5 7 11l4.5-5.5',\n error: 'm5.5 5.5 5 5m0-5-5 5',\n info: 'M8 7.5V11M8 5h.01',\n warning: 'M8 4.75V8.5M8 11.25h.01',\n};\n\n/**\n * The status icon: a 24 px tinted circle with a glyph, the loading spinner or the\n * notification's own icon, and the 2 px progress ring around it (pill and Island\n * share these nodes). With progress the icon is the accessible progressbar. The\n * determinate arc is owned by the host sampler (one RAF per host, 240 ms tween);\n * `preview` draws the value statically for the inert swipe neighbour.\n */\nexport function StatusIcon({ notification, slot, part, preview = false }: {\n notification: NotificationSnapshot<ReactNode>; slot: (value: ReactNode) => ReactNode; part: PartClass; preview?: boolean;\n}) {\n const { content, kind } = notification;\n const { progress } = content;\n const determinate = progress?.kind === 'determinate';\n return <div className={part('icon', 'cloudlet-icon')} data-kind={kind}\n {...(progress && !preview ? { role: 'progressbar', 'aria-valuemin': 0, 'aria-valuemax': 100,\n 'aria-valuenow': determinate ? Math.round(progress.value * 100) : undefined, 'aria-label': progress.label ?? content.title }\n : { 'aria-hidden': 'true' })}>\n {content.icon !== undefined\n ? <span className=\"cloudlet-glyph\" aria-hidden=\"true\">{slot(content.icon)}</span>\n // With progress the ring is the activity indicator of a loading record.\n : kind === 'loading' ? !progress && <svg aria-hidden=\"true\" viewBox=\"0 0 16 16\" className=\"cloudlet-glyph cloudlet-spinner\">\n <circle cx=\"8\" cy=\"8\" r=\"5.5\" strokeDasharray=\"22 13\" /></svg>\n : <svg aria-hidden=\"true\" viewBox=\"0 0 16 16\" className=\"cloudlet-glyph\"><path d={glyphs[kind]} /></svg>}\n {progress && <svg aria-hidden=\"true\" viewBox=\"0 0 32 32\" className=\"cloudlet-ring\" data-progress={progress.kind}>\n <circle className=\"cloudlet-ring-track\" cx=\"16\" cy=\"16\" r=\"15\" />\n <circle className=\"cloudlet-progress-fill\" cx=\"16\" cy=\"16\" r=\"15\" pathLength=\"100\" transform=\"rotate(-90 16 16)\"\n strokeDasharray={!determinate ? '25 75' : preview ? `${Math.round(progress.value * 10000) / 100} 100` : '0 100'} />\n </svg>}\n </div>;\n}\n\nexport function slotRenderer(bridge: RendererBridge<ReactNode>, lease: HostLease, handle: NotificationHandle,\n rejectSlotFocus: (previous: EventTarget | null) => void) {\n return (value: ReactNode) => <SlotBoundary content={value} bridge={bridge} lease={lease} handle={handle} rejectFocus={rejectSlotFocus} />;\n}\n\n/**\n * Status icon and title: the same DOM nodes in the pill and in the Island header,\n * so opening never re-creates them and the title can receive focus in place.\n */\nexport function Heading({ notification, slot, part, titleId }: {\n notification: NotificationSnapshot<ReactNode>; slot: (value: ReactNode) => ReactNode; part: PartClass;\n /** Omitted for the inert neighbour preview: no id, focus target, data hook or live progress. */\n titleId?: string;\n}) {\n const title = part('title', 'cloudlet-title');\n return <div className=\"cloudlet-heading\">\n <StatusIcon notification={notification} slot={slot} part={part} preview={titleId === undefined} />\n {titleId === undefined ? <h2 className={title}>{notification.content.title}</h2>\n : <h2 id={titleId} tabIndex={-1} data-cloudlet-title=\"\" className={title}>{notification.content.title}</h2>}\n </div>;\n}\n\n/** Rich content of the inert neighbour preview: rendered as is, never checked or reported twice. */\nexport const previewSlot = (value: ReactNode) => <div className=\"cloudlet-slot\">{value}</div>;\n\n/** A settled factory can always retry through the API; only an unsuccessful attempt offers the button. */\ntype Operation = NotificationSnapshot<ReactNode>['operation'];\nconst retryable = (operation: Operation): operation is NonNullable<Operation> => !!operation?.canRetry && operation.status !== 'fulfilled';\n\n/**\n * The neighbour shown only while a finger drags the Island content:\n * the same layout as a live slide, but every control is a lookalike without\n * handlers, ids, links or tab stops. The caller puts it in an `inert` container.\n */\nexport function SlidePreview({ notification, labels, part }: { notification: NotificationSnapshot<ReactNode>; labels: CloudletLabels; part: PartClass }) {\n const { content, operation, kind } = notification;\n const action = part('action', 'cloudlet-action');\n const lookalike = (children: ReactNode, primary = false) =>\n <button type=\"button\" tabIndex={-1} className={primary ? `${action} cloudlet-primary` : action}>{children}</button>;\n // Only the body slides: the preview shows the neighbour's body under the live heading.\n return <div className=\"cloudlet-slide\" data-kind={kind}>\n <div className={part('body', 'cloudlet-body')} data-kind={kind}>\n {content.description && <div className={part('description', 'cloudlet-description')}>\n {content.description.kind === 'text' ? <p>{content.description.text}</p> : previewSlot(content.description.content)}\n </div>}\n <div className={part('actions', 'cloudlet-actions')}>\n {content.action?.kind === 'command' && lookalike(content.action.label, true)}\n {content.action?.kind === 'link' && <a className={`${action} cloudlet-primary`}>{content.action.label}</a>}\n {retryable(operation) && lookalike(labels.retry)}\n {operation?.canCancel && lookalike(operation.cancelRequested ? labels.cancellationRequested : labels.cancel)}\n </div>\n {notification.action.status === 'failed' && <p className=\"cloudlet-action-error\">{notification.action.message}</p>}\n </div>\n </div>;\n}\n\n/** Island slide body: description, progress, actions and the action error. */\nexport function Body({ notification, form, bridge, lease, labels, navigate, slot, part, titleId }: {\n notification: NotificationSnapshot<ReactNode>; form: FormDraft | undefined; bridge: RendererBridge<ReactNode>; lease: HostLease;\n labels: CloudletLabels; navigate: (handle: NotificationHandle) => void; slot: (value: ReactNode) => ReactNode; part: PartClass; titleId: string;\n}) {\n const { handle, content, operation, action, kind } = notification;\n // The primary action is tinted with the status; retry and cancel stay neutral.\n const neutral = part('action', 'cloudlet-action');\n const primary = `${neutral} cloudlet-primary`;\n const id = useId();\n const command = content.action;\n const activateLink = (event: MouseEvent) => {\n // Observe cancellation after portal/application ancestors have handled activation.\n queueMicrotask(() => { if (!event.defaultPrevented) navigate(handle); });\n };\n return <div className={part('body', 'cloudlet-body')} data-kind={kind}>\n {content.description && <div className={part('description', 'cloudlet-description')}>\n {content.description.kind === 'text' && <p>{content.description.text}</p>}\n {content.description.kind === 'rich' && slot(content.description.content)}\n </div>}\n {command?.kind === 'form' && form && <Form key={formKey(command)} action={command} draft={form} notification={notification}\n bridge={bridge} lease={lease} part={part} titleId={titleId} actionErrorId={`${id}-action-error`} />}\n <div className={part('actions', 'cloudlet-actions')}>\n {command?.kind === 'command' && control('action', command.label, () => {\n if (action.status !== 'pending') bridge.invokeAction(lease, handle);\n }, { className: primary, 'aria-disabled': action.status === 'pending', 'aria-busy': action.status === 'pending',\n 'aria-describedby': action.status === 'failed' ? `${id}-action-error` : undefined })}\n {command?.kind === 'link' && <a data-cloudlet-control=\"action\" className={primary} href={command.href} target={command.target}\n rel={command.target === '_blank' ? [...new Set(`${command.rel ?? ''} noopener`.trim().split(/\\s+/u))].join(' ') : command.rel}\n onClick={event => activateLink(event.nativeEvent)}\n onAuxClick={event => { if (event.button === 1) activateLink(event.nativeEvent); }}>{command.label}</a>}\n {retryable(operation) && control('retry', labels.retry, () => bridge.retryOperation(lease, handle, operation.token), { className: neutral })}\n {operation?.canCancel && control('cancel', operation.cancelRequested ? labels.cancellationRequested : labels.cancel, () => {\n if (!operation.cancelRequested) bridge.cancelOperation(lease, handle, operation.token);\n }, { className: neutral, 'aria-disabled': operation.cancelRequested })}\n </div>\n {action.status === 'failed' && <p id={`${id}-action-error`} className=\"cloudlet-action-error\">{action.message}</p>}\n </div>;\n}\n\n// A new form action object starts a new draft in the controller, so its fields remount with the new defaults.\nconst formKeys = new WeakMap<FormAction, number>();\nlet nextFormKey = 0;\nfunction formKey(action: FormAction): number {\n let key = formKeys.get(action);\n if (key === undefined) formKeys.set(action, key = ++nextFormKey);\n return key;\n}\n\nconst TEXTAREA_ROWS = [3, 6] as const;\n\n/** Rows instead of a height: a strict CSP forbids style attributes, and rows grow with the text. */\nfunction fitRows(element: HTMLTextAreaElement): void {\n element.rows = TEXTAREA_ROWS[0];\n while (element.scrollHeight > element.clientHeight && element.rows < TEXTAREA_ROWS[1]) element.rows += 1;\n}\n\n/**\n * Look A: each field is a filled pill; the round submit button sits beside the last one. The fields\n * are uncontrolled: their text lives in the controller's draft and seeds them on mount, so typing\n * never waits for a snapshot round trip.\n */\nfunction Form({ action, draft, notification, bridge, lease, part, titleId, actionErrorId }: {\n action: FormAction; draft: FormDraft; notification: NotificationSnapshot<ReactNode>; bridge: RendererBridge<ReactNode>;\n lease: HostLease; part: PartClass; titleId: string; actionErrorId: string;\n}) {\n const id = useId();\n const fields = useRef(new Map<string, HTMLInputElement | HTMLTextAreaElement>());\n const pending = notification.action.status === 'pending';\n const failed = notification.action.status === 'failed';\n const formError = draft.errors.form;\n const submit = () => {\n if (pending) return;\n const result = bridge.invokeAction(lease, notification.handle);\n if (result.status !== 'invalid') return;\n const first = action.fields.find(field => result.errors.fields[field.name] !== undefined);\n if (first) fields.current.get(first.name)?.focus();\n };\n const field = (field: FormField, index: number, last: boolean) => {\n const fieldId = `${id}-${index}`;\n const error = draft.errors.fields[field.name];\n const props = {\n id: fieldId, name: field.name, className: part('field', 'cloudlet-field'), defaultValue: draft.values[field.name] ?? '',\n placeholder: field.placeholder ?? field.label, required: field.required, maxLength: field.maxLength,\n autoComplete: field.autoComplete, inputMode: field.inputMode, readOnly: pending,\n 'aria-invalid': error === undefined ? undefined : true, 'aria-describedby': error === undefined ? undefined : `${fieldId}-error`,\n };\n const change = (element: HTMLInputElement | HTMLTextAreaElement) => bridge.setFormValue(lease, notification.handle, field.name, element.value);\n return <div key={field.name} className=\"cloudlet-form-row\">\n <label htmlFor={fieldId} className=\"cloudlet-live\">{field.label}</label>\n {field.kind === 'text'\n ? <input type=\"text\" {...props} ref={element => { if (element) fields.current.set(field.name, element); }}\n onChange={event => change(event.currentTarget)} />\n : <textarea {...props} rows={TEXTAREA_ROWS[0]} ref={element => {\n if (!element) return;\n fields.current.set(field.name, element);\n fitRows(element);\n }} onChange={event => { change(event.currentTarget); fitRows(event.currentTarget); }}\n onKeyDown={(event: ReactKeyboardEvent<HTMLTextAreaElement>) => {\n // Enter starts a new line in a textarea; ⌘ or Ctrl with Enter sends.\n if (event.key !== 'Enter' || !(event.metaKey || event.ctrlKey) || event.nativeEvent.isComposing) return;\n event.preventDefault();\n submit();\n }} />}\n {last && <button type=\"submit\" data-cloudlet-control=\"action\" className={part('action', 'cloudlet-action cloudlet-submit')}\n aria-label={action.label} aria-disabled={pending} aria-busy={pending}\n aria-describedby={failed ? actionErrorId : formError ? `${id}-error` : undefined}>\n {pending ? <svg aria-hidden=\"true\" viewBox=\"0 0 16 16\" className=\"cloudlet-spinner\"><circle cx=\"8\" cy=\"8\" r=\"5.5\" strokeDasharray=\"22 13\" /></svg>\n : glyph('M8 13V3m0 0L3.5 7.5M8 3l4.5 4.5')}\n </button>}\n {error !== undefined && <p id={`${fieldId}-error`} className={part('field-error', 'cloudlet-field-error')}>{error}</p>}\n </div>;\n };\n return <form className={part('form', 'cloudlet-form')} noValidate aria-labelledby={titleId}\n onSubmit={event => { event.preventDefault(); submit(); }}>\n {action.fields.map((item, index) => field(item, index, index === action.fields.length - 1))}\n {formError && <p id={`${id}-error`} className=\"cloudlet-action-error\">{formError}</p>}\n </form>;\n}\n\nexport function closeButton(labels: CloudletLabels, part: PartClass, onClick: () => void) {\n return control('close', glyph('m4.5 4.5 7 7m0-7-7 7'), onClick, { 'aria-label': labels.close, className: part('close', 'cloudlet-close') });\n}\n"],"mappings":";;;AAQA,IAAaA,IAAgC;CAC3C,QAAQ;CAAiB,QAAQ;CAAyB,UAAU;CAAY,OAAO;CACvF,OAAO;CAAsB,OAAO;CACpC,QAAQ;CAAwB,uBAAuB;CACvD,qBAAqB;CAAoC,UAAU;CAAa,kBAAiB,MAAS,SAASC;CACnH,UAAU;CACV,eAAe,GAAO,GAAO,MAAW;EAACC;EAAO,GAAID,IAAQ,IAAI,CAAC,GAAGA,EAAM,eAAe,IAAI,CAAC;EAC5F,GAAIE,IAAS,IAAI,CAAC,GAAGA,EAAO,QAAQ,IAAI,CAAC;CAAE,CAAC,CAAC,KAAK,IAAI;CACxD,OAAO,GAAO,MAAU,GAAGC,EAAM,MAAMC;CACvC,gBAAe,MAAS,GAAGJ,EAAM;CACjC,OAAO;AACT,GAUMK,IAAN,cAA2BC,EAA8D;CACvF,QAAiB;EAAE,QAAQ;EAAO,SAAS,KAAK,MAAM;CAAQ;CAC9D,OAAO,2BAA2B;EAAE,OAAO,EAAE,QAAQ,GAAK;CAAG;CAC7D,OAAO,yBAAyB,GAAkB,GAA+B;EAC/E,OAAOC,EAAM,YAAYC,EAAM,UAA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