mates 0.3.0-beta.2 → 0.3.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Directives/customEvent.d.ts +74 -0
- package/dist/Directives/customEvent.d.ts.map +1 -0
- package/dist/Directives/disappear.d.ts +23 -0
- package/dist/Directives/disappear.d.ts.map +1 -0
- package/dist/Directives/eleHook.d.ts.map +1 -1
- package/dist/Directives/index.d.ts +3 -1
- package/dist/Directives/index.d.ts.map +1 -1
- package/dist/Directives/timerDirective.d.ts +5 -5
- package/dist/Directives/timerDirective.d.ts.map +1 -1
- package/dist/Mutables/Extended Atoms/changeFlagAtom.d.ts +56 -0
- package/dist/Mutables/Extended Atoms/changeFlagAtom.d.ts.map +1 -0
- package/dist/Mutables/Extended Atoms/index.d.ts +1 -0
- package/dist/Mutables/Extended Atoms/index.d.ts.map +1 -1
- package/dist/Mutables/atom/delayAtom.d.ts +40 -0
- package/dist/Mutables/atom/delayAtom.d.ts.map +1 -0
- package/dist/Mutables/atom/index.d.ts +1 -0
- package/dist/Mutables/atom/index.d.ts.map +1 -1
- package/dist/Router/historyStateAtom.d.ts +40 -0
- package/dist/Router/historyStateAtom.d.ts.map +1 -0
- package/dist/Router/historyUtils.d.ts +25 -0
- package/dist/Router/historyUtils.d.ts.map +1 -0
- package/dist/Router/index.d.ts +3 -0
- package/dist/Router/index.d.ts.map +1 -1
- package/dist/Router/navigateTo.d.ts.map +1 -1
- package/dist/Router/navigationRequest.d.ts +75 -0
- package/dist/Router/navigationRequest.d.ts.map +1 -0
- package/dist/Router/pathAtom.d.ts.map +1 -1
- package/dist/Utils/countdown.d.ts +48 -0
- package/dist/Utils/countdown.d.ts.map +1 -0
- package/dist/Utils/index.d.ts +1 -0
- package/dist/Utils/index.d.ts.map +1 -1
- package/dist/index.d.ts +398 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +44 -41
- package/dist/index.esm.js.map +1 -1
- package/dist/portals/popup.d.ts +13 -2
- package/dist/portals/popup.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2351,6 +2351,102 @@ declare function attr(attrs: AttrMap): lit_html_directive.DirectiveResult<lit_ht
|
|
|
2351
2351
|
/** No-op — kept for backwards compatibility. */
|
|
2352
2352
|
declare function removeAttr(_el: Element): void;
|
|
2353
2353
|
|
|
2354
|
+
/**
|
|
2355
|
+
* A typed custom event handler. Receives the `detail` payload directly —
|
|
2356
|
+
* no need to unwrap `event.detail` manually.
|
|
2357
|
+
*/
|
|
2358
|
+
type EleEventHandler<T = unknown> = (detail: T, event: CustomEvent<T>) => void;
|
|
2359
|
+
declare function onEleEvent<T = unknown>(eventName: string, handler: EleEventHandler<T>): DirectiveResult;
|
|
2360
|
+
/**
|
|
2361
|
+
* `useEleEvent` — call in the **outer function** of a mates component to get
|
|
2362
|
+
* a `dispatch` function. Use `dispatch` anywhere in the component (event
|
|
2363
|
+
* handlers, effects, async callbacks) to fire a bubbling `CustomEvent` from
|
|
2364
|
+
* a specific element.
|
|
2365
|
+
*
|
|
2366
|
+
* The host element is passed as the first argument to `dispatch` — this is
|
|
2367
|
+
* typically the element the event should originate from (e.g. the clicked
|
|
2368
|
+
* `<li>`, the focused `<input>`). Events bubble upward and are composed, so
|
|
2369
|
+
* any ancestor listening with `onEleEvent` will receive them.
|
|
2370
|
+
*
|
|
2371
|
+
* No cleanup is needed — `dispatch` just calls `dispatchEvent`, there are no
|
|
2372
|
+
* persistent listeners to remove.
|
|
2373
|
+
*
|
|
2374
|
+
* @example
|
|
2375
|
+
* ```ts
|
|
2376
|
+
* import { onEleEvent, useEleEvent } from "mates";
|
|
2377
|
+
*
|
|
2378
|
+
* // ── Child ─────────────────────────────────────────────────────────────────
|
|
2379
|
+
* const ListItem = (propsFn) => {
|
|
2380
|
+
* const { dispatch } = useEleEvent();
|
|
2381
|
+
*
|
|
2382
|
+
* return () => html`
|
|
2383
|
+
* <li
|
|
2384
|
+
* @click=${(e: MouseEvent) =>
|
|
2385
|
+
* dispatch(e.currentTarget as HTMLElement, "item-select", {
|
|
2386
|
+
* id: propsFn().id,
|
|
2387
|
+
* label: propsFn().label,
|
|
2388
|
+
* })}
|
|
2389
|
+
* >
|
|
2390
|
+
* ${propsFn().label}
|
|
2391
|
+
* </li>
|
|
2392
|
+
* `;
|
|
2393
|
+
* };
|
|
2394
|
+
*
|
|
2395
|
+
* // ── Parent ────────────────────────────────────────────────────────────────
|
|
2396
|
+
* html`
|
|
2397
|
+
* <ul ${onEleEvent("item-select", (detail: { id: string }) => {
|
|
2398
|
+
* console.log("selected", detail.id);
|
|
2399
|
+
* })}>
|
|
2400
|
+
* ${items.map(item => x(ListItem, item))}
|
|
2401
|
+
* </ul>
|
|
2402
|
+
* `;
|
|
2403
|
+
*
|
|
2404
|
+
* // ── Dispatching without an element ref (from a button click) ─────────────
|
|
2405
|
+
* html`
|
|
2406
|
+
* <button @click=${(e: MouseEvent) =>
|
|
2407
|
+
* dispatch(e.currentTarget as HTMLElement, "form-submit", { value })}>
|
|
2408
|
+
* Submit
|
|
2409
|
+
* </button>
|
|
2410
|
+
* `;
|
|
2411
|
+
* ```
|
|
2412
|
+
*/
|
|
2413
|
+
declare function useEleEvent(): {
|
|
2414
|
+
/**
|
|
2415
|
+
* Dispatch a named `CustomEvent` from the component's host `<x-x>` element.
|
|
2416
|
+
*
|
|
2417
|
+
* The host is captured once when `useEleEvent()` is called (outer function).
|
|
2418
|
+
* The event bubbles and is composed so any ancestor with `onEleEvent` will
|
|
2419
|
+
* receive it.
|
|
2420
|
+
*
|
|
2421
|
+
* @param eventName The custom event name.
|
|
2422
|
+
* @param detail Optional typed payload attached as `event.detail`.
|
|
2423
|
+
*/
|
|
2424
|
+
dispatch<T = unknown>(eventName: string, detail?: T): void;
|
|
2425
|
+
};
|
|
2426
|
+
|
|
2427
|
+
/**
|
|
2428
|
+
* disappear — removes the host element from the DOM after `ms` milliseconds.
|
|
2429
|
+
*
|
|
2430
|
+
* Useful for self-dismissing messages, temporary overlays, or any element
|
|
2431
|
+
* that should vanish after a delay without any component re-render.
|
|
2432
|
+
*
|
|
2433
|
+
* The countdown is cancelled automatically if the element is removed from
|
|
2434
|
+
* the DOM before the delay elapses (e.g. parent unmounts).
|
|
2435
|
+
*
|
|
2436
|
+
* If `ms` changes on re-render a fresh countdown is started from the new value.
|
|
2437
|
+
*
|
|
2438
|
+
* @param ms Delay in milliseconds before the element is removed.
|
|
2439
|
+
*
|
|
2440
|
+
* @example
|
|
2441
|
+
* // Remove a toast message after 3 seconds
|
|
2442
|
+
* html`<div class="toast" ${disappear(3000)}>Saved!</div>`
|
|
2443
|
+
*
|
|
2444
|
+
* @example
|
|
2445
|
+
* // Configurable delay
|
|
2446
|
+
* html`<p class="hint" ${disappear(ttl)}>This hint disappears soon.</p>`
|
|
2447
|
+
*/
|
|
2448
|
+
declare const disappear: (nextMs: number) => lit_html_directive.DirectiveResult;
|
|
2449
|
+
|
|
2354
2450
|
/**
|
|
2355
2451
|
* Lifecycle object returned from the `eleHook` mount callback.
|
|
2356
2452
|
*
|
|
@@ -3086,12 +3182,12 @@ type TimerContent = () => unknown;
|
|
|
3086
3182
|
* @example
|
|
3087
3183
|
* ```ts
|
|
3088
3184
|
* import { html } from "mates";
|
|
3089
|
-
* import {
|
|
3185
|
+
* import { timerTemplate } from "mates";
|
|
3090
3186
|
*
|
|
3091
3187
|
* // Live clock — updates every second, no component re-render
|
|
3092
3188
|
* html`
|
|
3093
3189
|
* <div>
|
|
3094
|
-
* Time: ${
|
|
3190
|
+
* Time: ${timerTemplate(() => new Date().toLocaleTimeString(), 1000)}
|
|
3095
3191
|
* </div>
|
|
3096
3192
|
* `;
|
|
3097
3193
|
*
|
|
@@ -3099,7 +3195,7 @@ type TimerContent = () => unknown;
|
|
|
3099
3195
|
* const end = Date.now() + 60_000;
|
|
3100
3196
|
* html`
|
|
3101
3197
|
* <span>
|
|
3102
|
-
* ${
|
|
3198
|
+
* ${timerTemplate(() => {
|
|
3103
3199
|
* const remaining = Math.max(0, Math.ceil((end - Date.now()) / 1000));
|
|
3104
3200
|
* return remaining === 0 ? "Done!" : `${remaining}s`;
|
|
3105
3201
|
* }, 1000)}
|
|
@@ -3109,12 +3205,12 @@ type TimerContent = () => unknown;
|
|
|
3109
3205
|
* // Dynamic HTML content
|
|
3110
3206
|
* html`
|
|
3111
3207
|
* <div>
|
|
3112
|
-
* ${
|
|
3208
|
+
* ${timerTemplate(() => html`<strong>${new Date().toLocaleTimeString()}</strong>`, 500)}
|
|
3113
3209
|
* </div>
|
|
3114
3210
|
* `;
|
|
3115
3211
|
* ```
|
|
3116
3212
|
*/
|
|
3117
|
-
declare function
|
|
3213
|
+
declare function timerTemplate(callback: TimerContent, ms: number): lit_html_directive.DirectiveResult<lit_html_directive.DirectiveClass>;
|
|
3118
3214
|
|
|
3119
3215
|
/**
|
|
3120
3216
|
* Mates adapter for the virtualizer engine.
|
|
@@ -3486,6 +3582,45 @@ declare const createTimedAtom: <T>(initialAtomOrState: T | AtomType<T>, delay: n
|
|
|
3486
3582
|
*/
|
|
3487
3583
|
declare const debouncedAtom: <T>(initialAtomOrState: T | AtomType<T>, delay: number, config?: AtomConfig) => AtomType<T>;
|
|
3488
3584
|
|
|
3585
|
+
/**
|
|
3586
|
+
* delayAtom — a reactive atom whose `set()` and `update()` calls are applied
|
|
3587
|
+
* after a fixed `delay` in milliseconds.
|
|
3588
|
+
*
|
|
3589
|
+
* Unlike `debouncedAtom`, **every call fires** — there is no cancellation of
|
|
3590
|
+
* previous pending writes. Each call schedules its own independent timeout.
|
|
3591
|
+
* This makes it useful for "apply this value after N ms" patterns rather than
|
|
3592
|
+
* "apply only the last value after N ms of silence".
|
|
3593
|
+
*
|
|
3594
|
+
* Accepts either a plain initial value or a source {@link AtomType}. When a
|
|
3595
|
+
* source atom is provided the delay atom mirrors the source's value, applying
|
|
3596
|
+
* the delay to every propagated change.
|
|
3597
|
+
*
|
|
3598
|
+
* All pending timeouts are cancelled automatically when the atom is disposed
|
|
3599
|
+
* via `registerCleanup`.
|
|
3600
|
+
*
|
|
3601
|
+
* @param initialAtomOrState - A plain initial value, or a source atom to mirror.
|
|
3602
|
+
* @param delay - How long to wait (ms) before each `set` / `update` is applied.
|
|
3603
|
+
* @param config - Optional atom configuration forwarded to the underlying atom.
|
|
3604
|
+
*
|
|
3605
|
+
* @example
|
|
3606
|
+
* // Every set fires independently after 1 second:
|
|
3607
|
+
* const status = delayAtom("idle", 1000);
|
|
3608
|
+
* status.set("loading"); // applied after 1 s
|
|
3609
|
+
* status.set("done"); // also applied after 1 s (both fire, in order)
|
|
3610
|
+
*
|
|
3611
|
+
* @example
|
|
3612
|
+
* // Mirror a source with delay:
|
|
3613
|
+
* const immediate = atom(0);
|
|
3614
|
+
* const delayed = delayAtom(immediate, 500);
|
|
3615
|
+
* immediate.set(42); // delayed reflects 42 after 500 ms
|
|
3616
|
+
*
|
|
3617
|
+
* @example
|
|
3618
|
+
* // Useful with disappear — update state after the animation finishes:
|
|
3619
|
+
* const visible = delayAtom(true, 300);
|
|
3620
|
+
* visible.set(false); // hides the element 300 ms later (after CSS transition)
|
|
3621
|
+
*/
|
|
3622
|
+
declare function delayAtom<T>(initialAtomOrState: T | AtomType<T>, delay: number, config?: AtomConfig): AtomType<T>;
|
|
3623
|
+
|
|
3489
3624
|
/**
|
|
3490
3625
|
* A reactive `Map<K, V>` returned by `mapAtom`.
|
|
3491
3626
|
*
|
|
@@ -3950,6 +4085,61 @@ type CacheAtomType<T> = Omit<AtomType<Map<string, T>>, "set" | "update"> & {
|
|
|
3950
4085
|
*/
|
|
3951
4086
|
declare function cacheAtom<T>(config?: AtomConfig): CacheAtomType<T>;
|
|
3952
4087
|
|
|
4088
|
+
type ChangeFlagAtomType = AtomType<number> & {
|
|
4089
|
+
/**
|
|
4090
|
+
* Trigger a reactivity update.
|
|
4091
|
+
*
|
|
4092
|
+
* - Called with no argument: sets the value to `Math.random()`, guaranteeing
|
|
4093
|
+
* a new value every call and forcing all subscribers / effects / views to
|
|
4094
|
+
* re-run.
|
|
4095
|
+
* - Called with a number: sets the value to that number. Useful when you
|
|
4096
|
+
* want a meaningful version counter or a specific sentinel value.
|
|
4097
|
+
*
|
|
4098
|
+
* @example
|
|
4099
|
+
* flag.change(); // random — always triggers
|
|
4100
|
+
* flag.change(n + 1); // explicit increment
|
|
4101
|
+
*/
|
|
4102
|
+
change(value?: number): void;
|
|
4103
|
+
/** Discriminator tag — always `"changeFlagAtom"`. */
|
|
4104
|
+
readonly name: "changeFlagAtom";
|
|
4105
|
+
};
|
|
4106
|
+
/**
|
|
4107
|
+
* changeFlagAtom — a reactive number atom whose sole purpose is to force
|
|
4108
|
+
* re-renders, effect re-runs, and subscription callbacks.
|
|
4109
|
+
*
|
|
4110
|
+
* The stored number is intentionally meaningless by default — only the fact
|
|
4111
|
+
* that it changed matters. Call `change()` to trigger, or pass a value if
|
|
4112
|
+
* you want a meaningful version counter.
|
|
4113
|
+
*
|
|
4114
|
+
* Pairs well with `disappear` to bring back a disappeared element:
|
|
4115
|
+
*
|
|
4116
|
+
* @example
|
|
4117
|
+
* const flag = changeFlagAtom();
|
|
4118
|
+
*
|
|
4119
|
+
* // Re-render the element (and restart the disappear timer) each time flag changes
|
|
4120
|
+
* return () => html`
|
|
4121
|
+
* ${flag()} // read flag so the template re-runs when it changes
|
|
4122
|
+
* <div ${disappear(3000)}>I vanish in 3 s</div>
|
|
4123
|
+
* <button @click=${() => flag.change()}>Show again</button>
|
|
4124
|
+
* `;
|
|
4125
|
+
*
|
|
4126
|
+
* @example
|
|
4127
|
+
* // Explicit version counter
|
|
4128
|
+
* const version = changeFlagAtom(0);
|
|
4129
|
+
* version.change(version() + 1);
|
|
4130
|
+
*
|
|
4131
|
+
* @example
|
|
4132
|
+
* // Pair with effect
|
|
4133
|
+
* const refresh = changeFlagAtom();
|
|
4134
|
+
* effect(() => {
|
|
4135
|
+
* refresh(); // subscribe
|
|
4136
|
+
* fetchData();
|
|
4137
|
+
* });
|
|
4138
|
+
* // later:
|
|
4139
|
+
* refresh.change(); // re-triggers the effect
|
|
4140
|
+
*/
|
|
4141
|
+
declare function changeFlagAtom(initial?: number, config?: AtomConfig): ChangeFlagAtomType;
|
|
4142
|
+
|
|
3953
4143
|
type PaginationAtomType = AtomType<number> & {
|
|
3954
4144
|
readonly currentPage: number;
|
|
3955
4145
|
next(): void;
|
|
@@ -5050,6 +5240,13 @@ interface PopupOptions {
|
|
|
5050
5240
|
style?: Record<string, string>;
|
|
5051
5241
|
/** Set the floating panel's width to exactly match the anchor element's width. */
|
|
5052
5242
|
matchAnchorWidth?: boolean;
|
|
5243
|
+
/**
|
|
5244
|
+
* When true, the floating element is removed from `document.body` on close
|
|
5245
|
+
* and re-appended on open. This keeps the DOM clean when the panel content
|
|
5246
|
+
* is expensive (e.g. a calendar with 42 day cells).
|
|
5247
|
+
* Default: false (legacy behaviour — panel stays in DOM, display:none).
|
|
5248
|
+
*/
|
|
5249
|
+
destroyOnClose?: boolean;
|
|
5053
5250
|
/**
|
|
5054
5251
|
* Called after the panel is shown and positioned (each time it opens).
|
|
5055
5252
|
* Use to move focus into the panel for keyboard navigation.
|
|
@@ -5057,9 +5254,13 @@ interface PopupOptions {
|
|
|
5057
5254
|
onOpen?: (panel: HTMLElement) => void;
|
|
5058
5255
|
/**
|
|
5059
5256
|
* Called when the panel closes (outside click, Escape, or toggle).
|
|
5060
|
-
* Receives the anchor element
|
|
5257
|
+
* Receives the anchor element and the floating panel element.
|
|
5258
|
+
* With `destroyOnClose: true`, the floating element is passed so the
|
|
5259
|
+
* consumer can remove it after any exit animation completes.
|
|
5260
|
+
* If the consumer calls `floating.remove()` itself, `popup()` will NOT
|
|
5261
|
+
* call it again — it checks `floating.isConnected` before removing.
|
|
5061
5262
|
*/
|
|
5062
|
-
onClose?: (anchor: HTMLElement) => void;
|
|
5263
|
+
onClose?: (anchor: HTMLElement, floating: HTMLElement) => void;
|
|
5063
5264
|
/**
|
|
5064
5265
|
* **Controlled mode** — pass a boolean atom to take full control of
|
|
5065
5266
|
* open/close state. When provided:
|
|
@@ -5274,6 +5475,71 @@ declare function buildPath<Path extends string>(...args: BuildPathArgs<Path>): s
|
|
|
5274
5475
|
*/
|
|
5275
5476
|
declare const hashAtom: AtomType<Record<string, any>>;
|
|
5276
5477
|
|
|
5478
|
+
/**
|
|
5479
|
+
* `historyStateAtom` — a reactive atom that always reflects
|
|
5480
|
+
* `window.history.state`.
|
|
5481
|
+
*
|
|
5482
|
+
* Updated in two situations:
|
|
5483
|
+
*
|
|
5484
|
+
* 1. **`popstate`** — the user pressed back / forward. The browser restores
|
|
5485
|
+
* the state that was associated with that history entry and this atom is
|
|
5486
|
+
* set to `event.state`.
|
|
5487
|
+
*
|
|
5488
|
+
* 2. **`navigateTo(path, replace, data)`** — called directly from
|
|
5489
|
+
* `navigateTo.ts` before the pushState / replaceState call so any
|
|
5490
|
+
* subscriber reading the atom during the subsequent `pathAtom` update
|
|
5491
|
+
* already sees the new state.
|
|
5492
|
+
*
|
|
5493
|
+
* Hydrated from `window.history.state` at module load time so a hard
|
|
5494
|
+
* refresh or direct URL load with pre-existing state is reflected
|
|
5495
|
+
* correctly from the very first render.
|
|
5496
|
+
*
|
|
5497
|
+
* @example
|
|
5498
|
+
* // Pass state when navigating:
|
|
5499
|
+
* navigateTo("/users/42", false, { fromList: true, scrollY: 320 });
|
|
5500
|
+
*
|
|
5501
|
+
* // Read it on the destination page:
|
|
5502
|
+
* historyStateAtom(); // { fromList: true, scrollY: 320 }
|
|
5503
|
+
*
|
|
5504
|
+
* // Back / forward automatically restores the state for that entry.
|
|
5505
|
+
*
|
|
5506
|
+
* @example
|
|
5507
|
+
* // Drive slide direction based on navigation state:
|
|
5508
|
+
* const { direction } = historyStateAtom() ?? {};
|
|
5509
|
+
* html`<div class=${direction === "back" ? "slide-right" : "slide-left"}>…</div>`
|
|
5510
|
+
*
|
|
5511
|
+
* @example
|
|
5512
|
+
* // Guard: know whether the user arrived via in-app nav or direct load:
|
|
5513
|
+
* const state = historyStateAtom();
|
|
5514
|
+
* if (!state?.fromApp) navigateTo("/");
|
|
5515
|
+
*/
|
|
5516
|
+
declare const historyStateAtom: AtomType<unknown>;
|
|
5517
|
+
|
|
5518
|
+
/**
|
|
5519
|
+
* Replace dynamic route params in the current URL using a **pattern** that
|
|
5520
|
+
* describes which segments are params.
|
|
5521
|
+
*
|
|
5522
|
+
* The pattern tells `replaceParams` the *names* of the dynamic segments —
|
|
5523
|
+
* the current path provides the *positions*. Together they let you swap out
|
|
5524
|
+
* individual param values without touching the rest of the URL.
|
|
5525
|
+
*
|
|
5526
|
+
* Uses `replaceState` — no new history entry is created.
|
|
5527
|
+
*
|
|
5528
|
+
* ```ts
|
|
5529
|
+
* // Current path: /users/42/posts/7
|
|
5530
|
+
* replaceParams("/users/:id/posts/:postId", { id: 99 });
|
|
5531
|
+
* // → /users/99/posts/7
|
|
5532
|
+
*
|
|
5533
|
+
* replaceParams("/users/:id/posts/:postId", { id: 99, postId: 3 });
|
|
5534
|
+
* // → /users/99/posts/3
|
|
5535
|
+
* ```
|
|
5536
|
+
*
|
|
5537
|
+
* @param pattern Route pattern with `:param` segments (e.g. `"/users/:id"`).
|
|
5538
|
+
* @param params Param names → new values. Only provided keys are replaced;
|
|
5539
|
+
* all other segments are left unchanged.
|
|
5540
|
+
*/
|
|
5541
|
+
declare function replaceParams(pattern: string, params: Record<string, string | number | boolean>): void;
|
|
5542
|
+
|
|
5277
5543
|
/**
|
|
5278
5544
|
* Checks whether the current pathname matches a route pattern.
|
|
5279
5545
|
*
|
|
@@ -5440,6 +5706,81 @@ declare const location: {
|
|
|
5440
5706
|
*/
|
|
5441
5707
|
declare function navigateTo(path: string, replace?: boolean, data?: any): void;
|
|
5442
5708
|
|
|
5709
|
+
interface NavigationRequestDetail {
|
|
5710
|
+
/** The path the user is navigating to. */
|
|
5711
|
+
to: string;
|
|
5712
|
+
/** The path the user is currently on. */
|
|
5713
|
+
from: string;
|
|
5714
|
+
}
|
|
5715
|
+
/**
|
|
5716
|
+
* Fired by `navigateTo()` immediately before navigation is committed.
|
|
5717
|
+
*
|
|
5718
|
+
* Subscribe with `on()` in a component's outer function to react to every
|
|
5719
|
+
* navigation attempt — for example to show a "leave page?" confirmation dialog
|
|
5720
|
+
* before the route actually changes.
|
|
5721
|
+
*
|
|
5722
|
+
* The event carries `{ to, from }` so you always know both endpoints.
|
|
5723
|
+
*
|
|
5724
|
+
* @example
|
|
5725
|
+
* ```ts
|
|
5726
|
+
* import { navigationRequestEvent } from "mates";
|
|
5727
|
+
* import { on } from "mates";
|
|
5728
|
+
*
|
|
5729
|
+
* const MyPage = () => {
|
|
5730
|
+
* const confirm = useConfirmDialog({ danger: false });
|
|
5731
|
+
*
|
|
5732
|
+
* on(async ({ to }) => {
|
|
5733
|
+
* const ok = await confirm.show(`Leave to ${to}?`);
|
|
5734
|
+
* if (!ok) lockNavigation();
|
|
5735
|
+
* }, [navigationRequestEvent]);
|
|
5736
|
+
*
|
|
5737
|
+
* return () => html`…`;
|
|
5738
|
+
* };
|
|
5739
|
+
* ```
|
|
5740
|
+
*/
|
|
5741
|
+
declare const navigationRequestEvent: EventType<NavigationRequestDetail>;
|
|
5742
|
+
/**
|
|
5743
|
+
* `onNavigationRequest` — component-scoped hook that fires whenever
|
|
5744
|
+
* `navigateTo()` is called, **before** the navigation is committed.
|
|
5745
|
+
*
|
|
5746
|
+
* Exactly mirrors the `onNavigate` pattern but fires at request time rather
|
|
5747
|
+
* than after the route has already changed. Use it to:
|
|
5748
|
+
* - Show a "you have unsaved changes" dialog
|
|
5749
|
+
* - Conditionally lock navigation with `lockNavigation()`
|
|
5750
|
+
* - Log analytics for navigation intent
|
|
5751
|
+
*
|
|
5752
|
+
* The callback receives `{ to, from }` and may optionally return a cleanup
|
|
5753
|
+
* function that runs before the next invocation.
|
|
5754
|
+
*
|
|
5755
|
+
* Must be called in the **outer function** of a mates component.
|
|
5756
|
+
*
|
|
5757
|
+
* @example
|
|
5758
|
+
* ```ts
|
|
5759
|
+
* import { onNavigationRequest, lockNavigation, unlockNavigation } from "mates";
|
|
5760
|
+
*
|
|
5761
|
+
* const EditorPage = () => {
|
|
5762
|
+
* const isDirty = atom(false);
|
|
5763
|
+
* const confirm = useConfirmDialog();
|
|
5764
|
+
*
|
|
5765
|
+
* onNavigationRequest(async ({ to }) => {
|
|
5766
|
+
* if (!isDirty()) return;
|
|
5767
|
+
* const ok = await confirm.show("Leave without saving?", {
|
|
5768
|
+
* yesLabel: "Leave",
|
|
5769
|
+
* noLabel: "Stay",
|
|
5770
|
+
* });
|
|
5771
|
+
* if (!ok) {
|
|
5772
|
+
* lockNavigation();
|
|
5773
|
+
* // re-unlock so future navigation works after user decides to stay
|
|
5774
|
+
* Promise.resolve().then(unlockNavigation);
|
|
5775
|
+
* }
|
|
5776
|
+
* });
|
|
5777
|
+
*
|
|
5778
|
+
* return () => html`…`;
|
|
5779
|
+
* };
|
|
5780
|
+
* ```
|
|
5781
|
+
*/
|
|
5782
|
+
declare const onNavigationRequest: (fn: (detail: NavigationRequestDetail) => void | (() => void)) => void;
|
|
5783
|
+
|
|
5443
5784
|
/**
|
|
5444
5785
|
* @file pathAtom.ts
|
|
5445
5786
|
*
|
|
@@ -5794,6 +6135,54 @@ declare function restoreTracking(prev: TrackingSnapshot): Set<any>;
|
|
|
5794
6135
|
declare const startTracking: typeof saveAndEnableTracking;
|
|
5795
6136
|
declare const stopTracking: typeof restoreTracking;
|
|
5796
6137
|
|
|
6138
|
+
type CountdownState = "idle" | "running" | "paused" | "stopped";
|
|
6139
|
+
interface Countdown {
|
|
6140
|
+
/** Start the timer from the full duration. No-op if already running. */
|
|
6141
|
+
start(): void;
|
|
6142
|
+
/**
|
|
6143
|
+
* Pause the timer. The remaining time is frozen at the current value.
|
|
6144
|
+
* No-op if already paused, idle, or stopped.
|
|
6145
|
+
*/
|
|
6146
|
+
pause(): void;
|
|
6147
|
+
/**
|
|
6148
|
+
* Resume a paused timer. Restarts a `setTimeout` for the remaining duration.
|
|
6149
|
+
* No-op if already running, idle, or stopped.
|
|
6150
|
+
*/
|
|
6151
|
+
resume(): void;
|
|
6152
|
+
/**
|
|
6153
|
+
* Stop and reset the timer. The callback will never fire.
|
|
6154
|
+
* Remaining time is reset to the full duration.
|
|
6155
|
+
* Calling start() after stop() begins a fresh countdown.
|
|
6156
|
+
*/
|
|
6157
|
+
stop(): void;
|
|
6158
|
+
/** Current state of the timer. */
|
|
6159
|
+
readonly state: CountdownState;
|
|
6160
|
+
/**
|
|
6161
|
+
* Milliseconds remaining.
|
|
6162
|
+
* - While `running`: live value computed from wall-clock elapsed.
|
|
6163
|
+
* - While `paused` / `idle` / `stopped`: last frozen snapshot.
|
|
6164
|
+
*/
|
|
6165
|
+
readonly remaining: number;
|
|
6166
|
+
}
|
|
6167
|
+
/**
|
|
6168
|
+
* timer — precise pausable countdown timer.
|
|
6169
|
+
*
|
|
6170
|
+
* @param callback Called once when the full duration has elapsed.
|
|
6171
|
+
* @param duration Total countdown duration in milliseconds.
|
|
6172
|
+
*
|
|
6173
|
+
* @example
|
|
6174
|
+
* const { start, pause, resume, stop, remaining } = timer(() => {
|
|
6175
|
+
* dismiss(id);
|
|
6176
|
+
* }, 6000);
|
|
6177
|
+
*
|
|
6178
|
+
* start();
|
|
6179
|
+
* // user hovers card
|
|
6180
|
+
* pause();
|
|
6181
|
+
* // user leaves card
|
|
6182
|
+
* resume();
|
|
6183
|
+
*/
|
|
6184
|
+
declare function countdown(callback: () => void, duration: number): Countdown;
|
|
6185
|
+
|
|
5797
6186
|
/**
|
|
5798
6187
|
* Deep-clones a value. Uses native structuredClone when available (modern browsers),
|
|
5799
6188
|
* otherwise falls back to a recursive clone that supports primitives, plain objects,
|
|
@@ -6089,5 +6478,5 @@ declare function getMonths(locale?: string): MonthInfo[];
|
|
|
6089
6478
|
*/
|
|
6090
6479
|
declare function getCalendar(year: number, month: number): MatesDate[][];
|
|
6091
6480
|
|
|
6092
|
-
export { $, Component$1 as ComponentElement, Context, Delete, ErrorTypes, Fetch, FetchClient, Get, MA, NotificationManager, Patch, Post, Put, Router, SyncNotificationManager, ZeroPromise, _, _subToView, action, addStoreBeingRead, animatedIf, animatedRouter, animatedX, range as arrayRange, assertComponentOuterContext, assertNotInRestrictedContext, asyncAction, atom, attr, blurInPreset, blurOutPreset, bouncePreset, buildPath, buildRequestUrl, cacheAtom, createCacheManager as cacheFn, chunk, clamp, classes, cleanupScheduler, clearInterceptors, collapseWidthPreset, collectSSRStyles, componentRunningStatus, computeAutoPlacement, configureCSS, createCacheManager, createManagedTimer, createPollingManager, createReactiveRunner, createTimedAtom, date, debounce, debouncedAtom, deepClone, deepFreeze, deleteAction, deepFreeze as df, dialog, effect, effectScheduler, eleHook, event, expandWidthPreset, fadeInPreset, fadeOutPreset, fetchAction, fetchClient, flipInPreset, flipOutPreset, formAtom, get, getAction, getAllProps, getAllTimezones, getCalendar, getCoords, getCurrentHost, getLocale, getMonths, getParentScope, getParentScope as getScope, getStoresBeingRead, getTimezoneOffset, globalCSS, globalScheduler, globalTheme, groupBy, hashAtom, htmlHook, iAtom, injectMatesAnimations, installDevToolsHooks, interceptAfter, interceptBefore, interceptError, isAction, isApiResponseSuccess, isAsyncAction, isAsyncFunction, isAsyncValue, isAtom, isChannel, isConfirmationEvent, isDefinedAsGetter, isDevToolsInstalled, isEffectRunning, isEmail, isEmpty, isEvent, isFunction, isGetter, isInRestrictedContext, isMax, isMin, isPathMatching, isPattern, isReadTrackingEnabled, isRequired, isSSR, isSetter, isUnit, iterateDeeply, keyframes, lazyLoad, location, lockNavigation, logError, lsAtom, mapAtom, masonryGrid, maxLength, memo, memoTemplate, merge, minLength, navigateTo, navigationLocked, omit, on, onAllMount, onBlur, onCleanup, onClickAway, onConnect, onCopy, onCut, onDOMReady, onDisconnect, onError, on$1 as onEvent, onFileDrop, onFocus, onHidden, onIntersect, onInterval, onKeyDown, onKeyUp, onMount, onNavigate, onOffline, onOnline, onPaint, onParent, onPaste, onReferenceChange, onResize, onScroll, onScrolledIntoView, onSelectionChange, onSocket, onStorageChange, onTimeout, onUpdate, onVisibilityChange, onVisible, onWindow, onWindowCapture, onWindowResize, onWindowScroll, paginatedAsyncAction, paginationAtom, patchAction, pathAtom, pick, placementTransform, popEffect, popup, portal, postAction, pulsePreset, pushEffect, putAction, qsAtom, uuid as randomId, ref, registerCleanup, removeAttr, removeClasses, removeOn, removeStyle, renderSwitch, renderTemplate, renderX, resetComponentState, resolveAsyncValue, restoreTracking, rootCSS, route, runWithGlobalInterceptors, safeSVG, safetyCheck, saveAndEnableTracking, scaleInPreset, scaleOutPreset, scope, setAtom, setLocale, setRef, setSSRApiLookup, setSSRMode, setSSRRequest, setTimezone, setTimezoneOffset, setter, shakePreset, iAtom as signal, slideInPreset, slideOutPreset, spinPreset, springInPreset, ssAtom, startTracking, stopTracking, store, style, stylesheet, superAtom, taskAction, template, themeAtom, throttle, throttledAtom,
|
|
6093
|
-
export type { ActionAfterInterceptor, ActionBeforeInterceptor, ActionFn, ActionReturnType, ActionSubscriber, AfterInterceptor, AnimateDirectiveConfig, AnimateKeyframes, AnimateOptions, AnimatedIfConfig, AnimatedRouteConfig, AnimatedRouterOptions, AnimatedXConfig, AnimationHandle, AnimationPreset, AsyncActionAfterInterceptor, AsyncActionBeforeInterceptor, AsyncActionOptions, AsyncActionReturnType, AsyncActionStatus, AtomConfig, AtomType, AttrMap, AttrValue, BeforeInterceptor, C, CSSBlock, CSSKeyframeStops, CSSNestedBlock, CSSRulesInput, CacheAtomType, CacheManager, Cl, ClassEntry, ClassesInput, ClosureComponent, Component, ComponentFn, ComponentType, ConnectCallback, CssVars, DateInput, DateUnit, DateValues, DevToolsHooks, DialogOptions, DisconnectCallback, DollarChain, EleHookLifecycle, EleHookMountFn, ElementTarget, ErrorInterceptor, ErrorType, EventType, FetchActionConfig, FetchBody, FetchRequest, FormAtom, GlobalThemeResult, HostElement, HtmlHookLifecycle, HtmlHookMountFn, HtmlHookRenderFn, IAtomType, InnerFn, IntersectCallback, IntersectOptions, IterateDeeplyCallback, LazyComponent, LazyLoadCallback, LazyLoadOptions, MasonryGridOptions, MasonryItemTemplate, MasonryKeyFn, MatesAnimationClass, MatesCustomEventMap, MatesDate, Measurements, MemoKeys, MemoTemplateFn, MonthInfo, OnEventMap, OnParentMap, OuterFn, PaginatedAsyncActionReturnType, PaginationAtomType, Placement, PollingManager, PopupOpenAtom, PopupOptions, PopupPlacement, PortalOptions, Props, PropsType, MatesRef as Ref, RenderFn, ScrolledIntoViewCallback, ScrolledIntoViewOptions, SerializeOptions, Setter, SetterReturnType, SlideDirection, StorageAtomType, StorageValue, StyleMap, StyleValue, Subscribable, SuperAtomOptions, SuperAtomType, SvgConfig, SwitchCase, SwitchEntry, Task, TaskActionType, TaskStatus, TemplateComponent, TemplateFn, ThemeAtomType, ThemeMode, ThemeTokenMap, ThemeValue, ThemesInput, TimerContent, TimezoneEntry, TipContent, TipStyle, TrackingSnapshot, UpdateCallback, ValidateAllResult, ValidatorFn, View, ViewComponent, VirtualListOptions, VirtualMasonryOptions, WheelDirectionEvent, WindowHookEventName, WindowHookHandler, WsConfig, WsConnection, WsStatus, X, XTabEventType };
|
|
6481
|
+
export { $, Component$1 as ComponentElement, Context, Delete, ErrorTypes, Fetch, FetchClient, Get, MA, NotificationManager, Patch, Post, Put, Router, SyncNotificationManager, ZeroPromise, _, _subToView, action, addStoreBeingRead, animatedIf, animatedRouter, animatedX, range as arrayRange, assertComponentOuterContext, assertNotInRestrictedContext, asyncAction, atom, attr, blurInPreset, blurOutPreset, bouncePreset, buildPath, buildRequestUrl, cacheAtom, createCacheManager as cacheFn, changeFlagAtom, chunk, clamp, classes, cleanupScheduler, clearInterceptors, collapseWidthPreset, collectSSRStyles, componentRunningStatus, computeAutoPlacement, configureCSS, countdown, createCacheManager, createManagedTimer, createPollingManager, createReactiveRunner, createTimedAtom, date, debounce, debouncedAtom, deepClone, deepFreeze, delayAtom, deleteAction, deepFreeze as df, dialog, disappear, effect, effectScheduler, eleHook, event, expandWidthPreset, fadeInPreset, fadeOutPreset, fetchAction, fetchClient, flipInPreset, flipOutPreset, formAtom, get, getAction, getAllProps, getAllTimezones, getCalendar, getCoords, getCurrentHost, getLocale, getMonths, getParentScope, getParentScope as getScope, getStoresBeingRead, getTimezoneOffset, globalCSS, globalScheduler, globalTheme, groupBy, hashAtom, historyStateAtom, htmlHook, iAtom, injectMatesAnimations, installDevToolsHooks, interceptAfter, interceptBefore, interceptError, isAction, isApiResponseSuccess, isAsyncAction, isAsyncFunction, isAsyncValue, isAtom, isChannel, isConfirmationEvent, isDefinedAsGetter, isDevToolsInstalled, isEffectRunning, isEmail, isEmpty, isEvent, isFunction, isGetter, isInRestrictedContext, isMax, isMin, isPathMatching, isPattern, isReadTrackingEnabled, isRequired, isSSR, isSetter, isUnit, iterateDeeply, keyframes, lazyLoad, location, lockNavigation, logError, lsAtom, mapAtom, masonryGrid, maxLength, memo, memoTemplate, merge, minLength, navigateTo, navigationLocked, navigationRequestEvent, omit, on, onAllMount, onBlur, onCleanup, onClickAway, onConnect, onCopy, onCut, onDOMReady, onDisconnect, onEleEvent, onError, on$1 as onEvent, onFileDrop, onFocus, onHidden, onIntersect, onInterval, onKeyDown, onKeyUp, onMount, onNavigate, onNavigationRequest, onOffline, onOnline, onPaint, onParent, onPaste, onReferenceChange, onResize, onScroll, onScrolledIntoView, onSelectionChange, onSocket, onStorageChange, onTimeout, onUpdate, onVisibilityChange, onVisible, onWindow, onWindowCapture, onWindowResize, onWindowScroll, paginatedAsyncAction, paginationAtom, patchAction, pathAtom, pick, placementTransform, popEffect, popup, portal, postAction, pulsePreset, pushEffect, putAction, qsAtom, uuid as randomId, ref, registerCleanup, removeAttr, removeClasses, removeOn, removeStyle, renderSwitch, renderTemplate, renderX, replaceParams, resetComponentState, resolveAsyncValue, restoreTracking, rootCSS, route, runWithGlobalInterceptors, safeSVG, safetyCheck, saveAndEnableTracking, scaleInPreset, scaleOutPreset, scope, setAtom, setLocale, setRef, setSSRApiLookup, setSSRMode, setSSRRequest, setTimezone, setTimezoneOffset, setter, shakePreset, iAtom as signal, slideInPreset, slideOutPreset, spinPreset, springInPreset, ssAtom, startTracking, stopTracking, store, style, stylesheet, superAtom, taskAction, template, themeAtom, throttle, throttledAtom, timerTemplate, tip, titleAtom, tooltip, trackAndSubscribe, uniqBy, unlockNavigation, safeSVG as unsafeSVG, unwrapModule, useContext, useEleEvent, scope as useScope, useState, useStore, uuid, validateAll, validateReactiveFunction, view, virtualList, virtualMasonry, on as watch, withAuth, withBaseUrl, withHost, withLogging, withStaggerPreset, ws, x, xTabEvent };
|
|
6482
|
+
export type { ActionAfterInterceptor, ActionBeforeInterceptor, ActionFn, ActionReturnType, ActionSubscriber, AfterInterceptor, AnimateDirectiveConfig, AnimateKeyframes, AnimateOptions, AnimatedIfConfig, AnimatedRouteConfig, AnimatedRouterOptions, AnimatedXConfig, AnimationHandle, AnimationPreset, AsyncActionAfterInterceptor, AsyncActionBeforeInterceptor, AsyncActionOptions, AsyncActionReturnType, AsyncActionStatus, AtomConfig, AtomType, AttrMap, AttrValue, BeforeInterceptor, C, CSSBlock, CSSKeyframeStops, CSSNestedBlock, CSSRulesInput, CacheAtomType, CacheManager, ChangeFlagAtomType, Cl, ClassEntry, ClassesInput, ClosureComponent, Component, ComponentFn, ComponentType, ConnectCallback, Countdown, CountdownState, CssVars, DateInput, DateUnit, DateValues, DevToolsHooks, DialogOptions, DisconnectCallback, DollarChain, EleEventHandler, EleHookLifecycle, EleHookMountFn, ElementTarget, ErrorInterceptor, ErrorType, EventType, FetchActionConfig, FetchBody, FetchRequest, FormAtom, GlobalThemeResult, HostElement, HtmlHookLifecycle, HtmlHookMountFn, HtmlHookRenderFn, IAtomType, InnerFn, IntersectCallback, IntersectOptions, IterateDeeplyCallback, LazyComponent, LazyLoadCallback, LazyLoadOptions, MasonryGridOptions, MasonryItemTemplate, MasonryKeyFn, MatesAnimationClass, MatesCustomEventMap, MatesDate, Measurements, MemoKeys, MemoTemplateFn, MonthInfo, NavigationRequestDetail, OnEventMap, OnParentMap, OuterFn, PaginatedAsyncActionReturnType, PaginationAtomType, Placement, PollingManager, PopupOpenAtom, PopupOptions, PopupPlacement, PortalOptions, Props, PropsType, MatesRef as Ref, RenderFn, ScrolledIntoViewCallback, ScrolledIntoViewOptions, SerializeOptions, Setter, SetterReturnType, SlideDirection, StorageAtomType, StorageValue, StyleMap, StyleValue, Subscribable, SuperAtomOptions, SuperAtomType, SvgConfig, SwitchCase, SwitchEntry, Task, TaskActionType, TaskStatus, TemplateComponent, TemplateFn, ThemeAtomType, ThemeMode, ThemeTokenMap, ThemeValue, ThemesInput, TimerContent, TimezoneEntry, TipContent, TipStyle, TrackingSnapshot, UpdateCallback, ValidateAllResult, ValidatorFn, View, ViewComponent, VirtualListOptions, VirtualMasonryOptions, WheelDirectionEvent, WindowHookEventName, WindowHookHandler, WsConfig, WsConnection, WsStatus, X, XTabEventType };
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAKA,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,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