customizable-toast-notification 3.20.2 → 4.0.1
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 +29 -0
- package/README.md +56 -132
- package/dist/angular.cjs +126 -0
- package/dist/angular.cjs.map +1 -0
- package/dist/angular.d.ts +44 -0
- package/dist/angular.esm.mjs +126 -0
- package/dist/angular.esm.mjs.map +1 -0
- package/dist/index.cjs +115 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.d.ts +14 -12
- package/dist/index.css.map +2 -2
- package/dist/index.d.ts +28 -630
- package/dist/index.esm.mjs +114 -4
- package/dist/index.esm.mjs.map +1 -1
- package/dist/index.umd.js +114 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/react.cjs +126 -0
- package/dist/react.cjs.map +1 -0
- package/dist/react.d.ts +46 -0
- package/dist/react.esm.mjs +126 -0
- package/dist/react.esm.mjs.map +1 -0
- package/dist/solid.cjs +126 -0
- package/dist/solid.cjs.map +1 -0
- package/dist/solid.d.ts +45 -0
- package/dist/solid.esm.mjs +126 -0
- package/dist/solid.esm.mjs.map +1 -0
- package/dist/svelte.cjs +126 -0
- package/dist/svelte.cjs.map +1 -0
- package/dist/svelte.d.ts +50 -0
- package/dist/svelte.esm.mjs +126 -0
- package/dist/svelte.esm.mjs.map +1 -0
- package/dist/vue.cjs +126 -0
- package/dist/vue.cjs.map +1 -0
- package/dist/vue.d.ts +45 -0
- package/dist/vue.esm.mjs +126 -0
- package/dist/vue.esm.mjs.map +1 -0
- package/package.json +20 -28
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
## [4.0.1](https://github.com/sammy-cool/customizable-toast-notification/compare/v4.0.0...v4.0.1) (2026-10-27)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* fortify progress bar desync, pop animation, stacked margins, and theme overrides ([e7dceb7](https://github.com/sammy-cool/customizable-toast-notification/commit/e7dceb719585bbc1f010c0555e3a290e8c0736b5))
|
|
7
|
+
|
|
8
|
+
# [4.0.0](https://github.com/sammy-cool/customizable-toast-notification/compare/v3.20.2...v4.0.0) (2026-10-27)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
* feat!: streamline core engine to ultra-lightweight pure toast library ([8cbcc9a](https://github.com/sammy-cool/customizable-toast-notification/commit/8cbcc9a04bc86c3c6158f4f98b8c1863febd0dfc))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* **ci:** repair audit workflow yaml syntax, prune dead overrides, and achieve 100% test coverage ([4839726](https://github.com/sammy-cool/customizable-toast-notification/commit/4839726471394701916b63dea39c107b6a49a65b))
|
|
17
|
+
* fortify multi-config interactions, mobile overflow, and focus trap ([eefc61c](https://github.com/sammy-cool/customizable-toast-notification/commit/eefc61c8a2680f1d3393603a8bb52208d06e9cf4))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Performance Improvements
|
|
21
|
+
|
|
22
|
+
* migrate rollup pipeline to native esbuild and streamline package manifests ([e3523fd](https://github.com/sammy-cool/customizable-toast-notification/commit/e3523fde7384696cc9d338b6c53c1a59878edad1))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### BREAKING CHANGES
|
|
26
|
+
|
|
27
|
+
* removed audio synthesizer, ai-scorer, spring solver,
|
|
28
|
+
multi-touch pinch, and DOM pool utilities in favor of web standards.
|
|
29
|
+
|
|
1
30
|
## [3.20.2](https://github.com/sammy-cool/customizable-toast-notification/compare/v3.20.1...v3.20.2) (2026-10-27)
|
|
2
31
|
|
|
3
32
|
|
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
[](https://sonarcloud.io/summary/new_code?id=sammy-cool_customizable-toast-notification)
|
|
12
12
|
[](https://stackblitz.com/edit/customizable-toast-notification-demo?file=index.html)
|
|
13
13
|
|
|
14
|
-
**[▶ Try the interactive live playground](https://sammy-cool.github.io/customizable-toast-notification/)** — test
|
|
14
|
+
**[▶ Try the interactive live playground](https://sammy-cool.github.io/customizable-toast-notification/)** — test smooth cubic-bezier physics, audio notification hooks, dynamic action undo countdowns, and iOS-style card deck stacking in real time.
|
|
15
15
|
|
|
16
16
|
```
|
|
17
17
|
┌────────────────────────────────────────────────────────────────────────┐
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
┌───────────────────┬───────────┴───────────┬───────────────────┐
|
|
23
23
|
▼ ▼ ▼ ▼
|
|
24
24
|
┌──────────────┐ ┌───────────────┐ ┌───────────────┐ ┌───────────────┐
|
|
25
|
-
│
|
|
26
|
-
│
|
|
27
|
-
│
|
|
28
|
-
│
|
|
25
|
+
│ Sound Audio │ │ Natural Curve │ │ Action Undo │ │ Card Deck │
|
|
26
|
+
│ URL / Custom │ │ Cubic-Bezier │ │ Dynamic Live │ │ iOS-Style │
|
|
27
|
+
│ onSound Hook │ │ Spring Ease │ │ Countdown │ │ Expandable │
|
|
28
|
+
│ Playback │ │ Physics │ │ Badge (Xs) │ │ Stacking │
|
|
29
29
|
└──────────────┘ └───────────────┘ └───────────────┘ └───────────────┘
|
|
30
30
|
│ │ │ │
|
|
31
31
|
└───────────────────┴───────────┬───────────┴───────────────────┘
|
|
@@ -102,7 +102,7 @@ toast({
|
|
|
102
102
|
type: "success",
|
|
103
103
|
duration: 3000,
|
|
104
104
|
position: "bottom-right",
|
|
105
|
-
|
|
105
|
+
animationType: "spring",
|
|
106
106
|
sound: true,
|
|
107
107
|
});
|
|
108
108
|
```
|
|
@@ -116,7 +116,7 @@ Global Variable Name: `customizableToast`
|
|
|
116
116
|
<script src="https://cdn.jsdelivr.net/npm/customizable-toast-notification/dist/index.umd.js"></script>
|
|
117
117
|
|
|
118
118
|
<!-- OR pin to a specific version -->
|
|
119
|
-
<script src="https://cdn.jsdelivr.net/npm/customizable-toast-notification@
|
|
119
|
+
<script src="https://cdn.jsdelivr.net/npm/customizable-toast-notification@4.0.1/dist/index.umd.js"></script>
|
|
120
120
|
|
|
121
121
|
<script>
|
|
122
122
|
// Access the global UMD export
|
|
@@ -203,6 +203,7 @@ auto-dismissed on its own — they no-op gracefully rather than throwing. You ca
|
|
|
203
203
|
| `showProgressBar` | `boolean` | `true` | Show countdown progress bar |
|
|
204
204
|
| `animationDuration` | `string` | `"0.4s"` | CSS animation duration |
|
|
205
205
|
| `animationEasing` | `string` | `"ease"` | CSS animation easing function |
|
|
206
|
+
| `animationType` | `string` | `"default"` | Entrance & exit animation: `"default"`, `"fade"`, `"slide"`, `"zoom"`, `"bounce"`, `"spring"`, `"flip"` |
|
|
206
207
|
| `progressColor` | `string` | Falls back to `textColor` | Progress bar color |
|
|
207
208
|
| `progressHeight` | `string` | `"4px"` | Progress bar height |
|
|
208
209
|
| `progressPosition` | `string` | `"bottom"` | Progress bar position: `"top"` or `"bottom"` |
|
|
@@ -222,19 +223,19 @@ auto-dismissed on its own — they no-op gracefully rather than throwing. You ca
|
|
|
222
223
|
| `fontPadding` | `string` | `undefined` | Custom padding for message container (e.g. `"4px 8px"`) |
|
|
223
224
|
| `className` | `string` | `undefined` | Custom CSS class name(s) for animations / styling |
|
|
224
225
|
| `stacked` | `boolean` | `false` | Enable iOS-style card deck stacking for multiple toasts |
|
|
225
|
-
| `sound` | `boolean \| string`| `false` |
|
|
226
|
-
| `
|
|
227
|
-
| `
|
|
226
|
+
| `sound` | `boolean \| string`| `false` | Sound notification toggle or audio file URL (e.g. `"/chime.mp3"`) |
|
|
227
|
+
| `onSound` | `function` | `undefined` | Sound playback handler callback invoked on mount `(options) => void` |
|
|
228
|
+
| `priority` | `number` | `undefined` | Numeric queue priority (higher score displays ahead of lower priority toasts) |
|
|
229
|
+
| `swipeToDismiss` | `boolean` | `true` | Mobile touch & desktop mouse drag swipe-to-dismiss gesture |
|
|
228
230
|
| `progressDirection` | `string` | `"decreasing"` | Progress bar fill direction: `"decreasing"`, `"increasing"`, `"reverse"`, `"ltr"` |
|
|
229
231
|
| `progressBarColor` | `string` | Falls back to `textColor` | Alias for `progressColor` (accepts hex, rgb, hsl, CSS var) |
|
|
230
232
|
| `progress` | `number \| 'indeterminate'`| `undefined` | Explicit percentage (0 to 100) or `"indeterminate"` moving gradient |
|
|
231
|
-
| `usePool` | `boolean` | `false` | Virtual element pooling for DOM recycling in high-frequency rendering |
|
|
232
233
|
| `tag` / `groupId` | `string` | `undefined` | Thread grouping identifier to replace notification in-place instead of stacking |
|
|
233
234
|
| `trapFocus` | `boolean` | `false` | Modal keyboard focus trap (`Tab`/`Shift+Tab`) cycling for high-priority toasts |
|
|
234
235
|
| `shadowDom` | `boolean` | `false` | Render toast container inside isolated Shadow Root to prevent CSS bleed |
|
|
235
236
|
| `cta` | `object \| array` | `null` | Call-to-action configuration (see [CTA](#call-to-action)) |
|
|
236
237
|
| `undo` | `function \| object`| `null` | Action Undo button with live dynamic countdown badge (see [Undo](#️-action-undo-with-live-countdown)) |
|
|
237
|
-
| `spring` | `boolean
|
|
238
|
+
| `spring` | `boolean` | `false` | Natural cubic-bezier bounce curve (`cubic-bezier(0.34, 1.56, 0.64, 1)`) |
|
|
238
239
|
|
|
239
240
|
#### Position Options
|
|
240
241
|
|
|
@@ -360,41 +361,16 @@ createToast({
|
|
|
360
361
|
| `showCountdown` | `boolean` | `true` | Decays remaining duration in seconds in real-time |
|
|
361
362
|
| `onUndo` | `function` | `undefined` | Callback fired on click; supports async promises before auto-closing toast |
|
|
362
363
|
|
|
363
|
-
### 🌀
|
|
364
|
+
### 🌀 Natural Spring Easing Physics
|
|
364
365
|
|
|
365
|
-
|
|
366
|
+
Toasts support smooth cubic-bezier physics curves with natural overshoot and settling:
|
|
366
367
|
|
|
367
368
|
```js
|
|
368
|
-
//
|
|
369
|
+
// Enable natural spring overshoot:
|
|
369
370
|
createToast({
|
|
370
371
|
message: "Synced to cloud",
|
|
371
|
-
spring:
|
|
372
|
+
spring: true, // applies cubic-bezier(0.34, 1.56, 0.64, 1) at 400ms
|
|
372
373
|
});
|
|
373
|
-
|
|
374
|
-
// Or customize exact physical constants:
|
|
375
|
-
createToast({
|
|
376
|
-
message: "Physics simulated notification",
|
|
377
|
-
spring: {
|
|
378
|
-
stiffness: 180, // Spring tension (k)
|
|
379
|
-
damping: 12, // Friction resistance (c)
|
|
380
|
-
mass: 1.2, // Inertial mass (m)
|
|
381
|
-
},
|
|
382
|
-
});
|
|
383
|
-
```
|
|
384
|
-
|
|
385
|
-
| Preset | Stiffness ($k$) | Damping ($c$) | Mass ($m$) | Behavior |
|
|
386
|
-
| ------ | --------------- | ------------- | ---------- | -------- |
|
|
387
|
-
| `default` | 100 | 10 | 1 | Natural subtle bounce |
|
|
388
|
-
| `gentle` | 120 | 14 | 1 | Smooth with minimal overshoot |
|
|
389
|
-
| `wobbly` | 180 | 12 | 1 | Playful oscillation |
|
|
390
|
-
| `stiff` | 210 | 20 | 1 | Crisp, rapid settling |
|
|
391
|
-
| `bouncy` | 300 | 15 | 1.2 | High energy with dynamic bounce |
|
|
392
|
-
|
|
393
|
-
Register custom global presets or resolve spring curves directly:
|
|
394
|
-
```js
|
|
395
|
-
import { registerSpringPreset, getSpringTransition } from "customizable-toast-notification";
|
|
396
|
-
|
|
397
|
-
registerSpringPreset("snappy", { stiffness: 250, damping: 22, mass: 1 });
|
|
398
374
|
```
|
|
399
375
|
|
|
400
376
|
### Loader Options
|
|
@@ -434,21 +410,29 @@ createToast({ message: "Deploy finished successfully", type: "success", stacked:
|
|
|
434
410
|
- Hovering or keyboard-focusing on the deck automatically expands all notifications with spring animations.
|
|
435
411
|
- Leaving collapses them back into a clean stack.
|
|
436
412
|
|
|
437
|
-
### 🔊
|
|
413
|
+
### 🔊 Sound Notification Playback & Hooks
|
|
438
414
|
|
|
439
|
-
|
|
415
|
+
Trigger sound feedback on notification mount via audio URL or custom sound handler callbacks:
|
|
440
416
|
|
|
441
417
|
```js
|
|
442
|
-
import { createToast
|
|
418
|
+
import { createToast } from "customizable-toast-notification";
|
|
443
419
|
|
|
444
|
-
//
|
|
445
|
-
createToast({
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
420
|
+
// 1. Play from audio URL:
|
|
421
|
+
createToast({
|
|
422
|
+
message: "Changes saved",
|
|
423
|
+
type: "success",
|
|
424
|
+
sound: "/assets/sounds/success.mp3",
|
|
425
|
+
});
|
|
449
426
|
|
|
450
|
-
//
|
|
451
|
-
|
|
427
|
+
// 2. Or supply a custom onSound callback:
|
|
428
|
+
createToast({
|
|
429
|
+
message: "Network warning",
|
|
430
|
+
type: "warning",
|
|
431
|
+
sound: true,
|
|
432
|
+
onSound: (options) => {
|
|
433
|
+
mySoundPlayer.play(options.type);
|
|
434
|
+
},
|
|
435
|
+
});
|
|
452
436
|
```
|
|
453
437
|
|
|
454
438
|
### 👆 Mobile Touch Swipe-to-Dismiss
|
|
@@ -601,12 +585,10 @@ if (shouldReduceMotion()) {
|
|
|
601
585
|
| `theme` | `"light" \| "dark" \| "high-contrast" \| "compact" \| "spacious" \| "glass"` | `"light"` | Built-in CSS theme applied via `data-toast-theme` on document root. |
|
|
602
586
|
| `stacked` | `boolean` | `false` | Enable iOS-style 3D card deck layout with depth scaling and hover expansion. |
|
|
603
587
|
| `swipeToDismiss` | `boolean` | `true` | Enable touch / mouse drag swipe gesture to dismiss toasts with spring snap-back physics. |
|
|
604
|
-
| `sound` | `boolean` | `
|
|
605
|
-
| `soundPreset` | `"modern" \| "retro" \| "futuristic" \| "subtle" \| "bell"` | `"modern"` | Built-in sound synthesis theme for audio notifications. |
|
|
588
|
+
| `sound` | `boolean` | `false` | Enable sound notification support (audio URLs or `onSound` callbacks). |
|
|
606
589
|
| `pauseOnHover` | `boolean` | `false` | When `true`, automatically pauses countdown timers for all toasts on mouse hover or keyboard focus. |
|
|
607
|
-
| `
|
|
608
|
-
| `
|
|
609
|
-
| `priorityScorer` | `((context) => number) \| null` | `null` | Custom priority scoring function for custom business logic or external AI models. |
|
|
590
|
+
| `priorityQueue` | `boolean` | `false` | Enable content-aware queue priority sorting (critical alerts jump ahead of routine messages). |
|
|
591
|
+
| `priorityScorer` | `((context) => number) \| null` | `null` | Custom priority scoring function for custom business logic or external classifiers. |
|
|
610
592
|
| `onMetrics` | `((metrics: ToastMetrics) => void) \| null` | `null` | Real-time telemetry callback emitting `{ activeCount, queueDepth, visibleCount, droppedCount, timestamp }`. |
|
|
611
593
|
| `disableInlineStyles` | `boolean` | `false` | When `true`, toasts use CSS classes instead of inline `style.*` for stricter CSP compliance. |
|
|
612
594
|
| `reducedMotion` | `"auto" \| "always" \| "never"` | `"auto"` | Control animation behavior. `"auto"` respects `prefers-reduced-motion`, `"always"` disables, `"never"` enables. |
|
|
@@ -683,68 +665,44 @@ setConfig({ zIndex: 50000 });
|
|
|
683
665
|
|
|
684
666
|
The following enterprise-grade features are available in v3.17.0+ and are opt-in via global config or toast options:
|
|
685
667
|
|
|
686
|
-
###
|
|
668
|
+
### ⚡ Priority Queue Routing
|
|
687
669
|
|
|
688
|
-
|
|
670
|
+
When the queue fills (more than `maxVisible` toasts), the `priorityQueue` flag and `priority` options reorder the queue by urgency instead of strict FIFO. Priority is derived from `priority` option or `type` (error > warning > info > success), with support for custom priority scorers or consumer classifiers (`examples/ai-triage/`).
|
|
689
671
|
|
|
690
672
|
```js
|
|
691
|
-
|
|
673
|
+
setConfig({ priorityQueue: true });
|
|
692
674
|
|
|
693
|
-
//
|
|
694
|
-
|
|
675
|
+
createToast({ message: "Payment failed", type: "error" }); // Highest priority (score: 80)
|
|
676
|
+
createToast({ message: "Background sync", type: "info" }); // Queued behind the error (score: 40)
|
|
695
677
|
|
|
696
|
-
|
|
678
|
+
// Or specify an explicit priority score:
|
|
679
|
+
createToast({ message: "VIP Customer Alert", priority: 100 });
|
|
697
680
|
```
|
|
698
681
|
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
### 🧠 AI-Powered Priority Queue Routing
|
|
702
|
-
|
|
703
|
-
When the queue fills (more than `maxVisible` toasts), the `aiPrioritization` flag reorders the queue by urgency instead of strict FIFO. Priority is derived from `type` (error > warning > info > success) plus keyword scoring (`urgent`, `critical`, `failed`, `done`, etc.). Fully offline, zero external calls.
|
|
704
|
-
|
|
705
|
-
```js
|
|
706
|
-
setConfig({ aiPrioritization: true });
|
|
707
|
-
|
|
708
|
-
createToast({ message: "Payment failed", type: "error" }); // Highest priority
|
|
709
|
-
createToast({ message: "Background sync", type: "info" }); // Queued behind the error
|
|
710
|
-
```
|
|
682
|
+
### 👆 Touch & Pointer Swipe-to-Dismiss
|
|
711
683
|
|
|
712
|
-
|
|
684
|
+
Toasts support smooth native pointer and touch swipe-to-dismiss out of the box:
|
|
713
685
|
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
No configuration required — it's transparent to callers. The queue drains in priority order (when enabled above) and reuses the same recycled elements.
|
|
719
|
-
|
|
720
|
-
### 👆 Advanced Gestures: Flick Swipe & Pinch-to-Expand
|
|
721
|
-
|
|
722
|
-
Swipe-to-dismiss already exists in Phase 2; Phase 3 refines the physics:
|
|
723
|
-
|
|
724
|
-
- **Flick detection**: velocity ≥ 0.65 px/ms over ≥ 50 px triggers instant dismiss; anything shorter snaps back with spring easing.
|
|
725
|
-
- **Pinch-to-expand**: two-finger gesture on a toast expands it to full height (useful for long error messages with stack traces); releasing collapses it back.
|
|
726
|
-
|
|
727
|
-
The multi-touch math (`calculateVelocity`, `isFlick`, `detectPinch`) is exported for consumer recipes that want custom gesture behavior.
|
|
686
|
+
- Horizontal drag beyond threshold flings the toast off screen with smooth dismissal transition.
|
|
687
|
+
- Dragging below threshold cleanly snaps the notification back into position.
|
|
688
|
+
- Interactive elements (buttons, links, inputs) inside toasts automatically guard against accidental swipe drag.
|
|
728
689
|
|
|
729
690
|
### 🏗️ How It All Fits Together
|
|
730
691
|
|
|
731
692
|
```js
|
|
732
|
-
import { setConfig } from "customizable-toast-notification";
|
|
693
|
+
import { setConfig, createToast } from "customizable-toast-notification";
|
|
733
694
|
|
|
734
695
|
setConfig({
|
|
735
696
|
maxVisible: 3,
|
|
736
|
-
|
|
737
|
-
aiPrioritization: true,// sort the queue by urgency
|
|
697
|
+
priorityQueue: true, // sort the queue by urgency
|
|
738
698
|
stacked: true, // iOS-style card deck
|
|
739
|
-
swipeToDismiss: true, //
|
|
740
|
-
sound: true, //
|
|
699
|
+
swipeToDismiss: true, // touch & pointer gestures
|
|
700
|
+
sound: true, // notification chimes
|
|
741
701
|
});
|
|
742
702
|
|
|
743
703
|
createToast({ message: "New notification", type: "success" });
|
|
744
704
|
```
|
|
745
705
|
|
|
746
|
-
The library keeps its zero-runtime-dependency guarantee: `BroadcastChannel`, Web Audio, and the gesture math are all native browser APIs with immediate graceful fallbacks when unavailable.
|
|
747
|
-
|
|
748
706
|
## 💡 Examples
|
|
749
707
|
|
|
750
708
|
### Basic Toast Types
|
|
@@ -1016,8 +974,8 @@ createToast({ message: "Using external CSS!" });
|
|
|
1016
974
|
|
|
1017
975
|
```html
|
|
1018
976
|
<!-- HTML (CDN) -->
|
|
1019
|
-
<link rel="stylesheet" href="https://unpkg.com/customizable-toast-notification@
|
|
1020
|
-
<script src="https://unpkg.com/customizable-toast-notification@
|
|
977
|
+
<link rel="stylesheet" href="https://unpkg.com/customizable-toast-notification@4.0.1/dist/index.css">
|
|
978
|
+
<script src="https://unpkg.com/customizable-toast-notification@4.0.1/dist/index.umd.js"></script>
|
|
1021
979
|
<script>
|
|
1022
980
|
customizableToast.setConfig({ disableInlineStyles: true });
|
|
1023
981
|
customizableToast.createToast({ message: "Using external CSS!" });
|
|
@@ -1263,40 +1221,6 @@ toast.info("Protected from global styles", {
|
|
|
1263
1221
|
});
|
|
1264
1222
|
```
|
|
1265
1223
|
|
|
1266
|
-
## 🌍 Internationalization (i18n) Engine
|
|
1267
|
-
|
|
1268
|
-
Built-in multi-locale support with automatic RTL layout switching:
|
|
1269
|
-
|
|
1270
|
-
```javascript
|
|
1271
|
-
import { setLocale, registerLocale } from "customizable-toast-notification";
|
|
1272
|
-
|
|
1273
|
-
// Built-in support for "en", "hi", "ar"
|
|
1274
|
-
setLocale("ar"); // Automatically switches to right-to-left layout
|
|
1275
|
-
|
|
1276
|
-
// Register custom translations
|
|
1277
|
-
registerLocale("fr", {
|
|
1278
|
-
undo: "Annuler",
|
|
1279
|
-
close: "Fermer la notification",
|
|
1280
|
-
success: "Opération réussie"
|
|
1281
|
-
});
|
|
1282
|
-
```
|
|
1283
|
-
|
|
1284
|
-
## 📜 Notification History & Telemetry Ring Buffer
|
|
1285
|
-
|
|
1286
|
-
Track and inspect notification delivery, dismissals, and drop telemetry:
|
|
1287
|
-
|
|
1288
|
-
```javascript
|
|
1289
|
-
import { getToastHistory, clearToastHistory, setHistoryCapacity } from "customizable-toast-notification";
|
|
1290
|
-
|
|
1291
|
-
// Set capacity (default 50)
|
|
1292
|
-
setHistoryCapacity(100);
|
|
1293
|
-
|
|
1294
|
-
// Get immutable snapshot of recent toasts with timestamps, status, and metadata
|
|
1295
|
-
const history = getToastHistory();
|
|
1296
|
-
console.log(history);
|
|
1297
|
-
// Output: [{ id: "...", message: "...", type: "...", status: "active" | "dismissed" | "dropped", timestamp: ... }]
|
|
1298
|
-
```
|
|
1299
|
-
|
|
1300
1224
|
## 🤝 Contributing
|
|
1301
1225
|
|
|
1302
1226
|
Exciting times ahead! Looking for sponsors and eager to explore new collaborations:) . Contributions are welcome! Please read our [Contributing Guidelines](CONTRIBUTING.md) for details.
|