customizable-toast-notification 3.19.0 → 3.20.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 CHANGED
@@ -1,3 +1,19 @@
1
+ # [3.20.0](https://github.com/sammy-cool/customizable-toast-notification/compare/v3.19.0...v3.20.0) (2026-10-26)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **core:** resolve cta double-click, rtl button margins, dynamic stacked, and cross-tab update sync ([0d1eb0f](https://github.com/sammy-cool/customizable-toast-notification/commit/0d1eb0f9390b2076c6642108df188566f3e40f27))
7
+ * **core:** resolve rtl layout, localized labels, fade exit timing, and drop telemetry ([6477abb](https://github.com/sammy-cool/customizable-toast-notification/commit/6477abb4d4b3f564c15ad8e302c3e41e9dacd2c9))
8
+ * handle floating promises to satisfy sonarqube quality gate ([8ee9b3b](https://github.com/sammy-cool/customizable-toast-notification/commit/8ee9b3b7b546bdad8b4542f0beddbdb80ea9a762))
9
+ * update SonarQube organization and project key for consistency ([a730b5f](https://github.com/sammy-cool/customizable-toast-notification/commit/a730b5f97e2351c3e27d6cf40a019d3a71aa0b2a))
10
+
11
+
12
+ ### Features
13
+
14
+ * **core:** implement history ring buffer, tag threading, focus trap, and framework adapters ([8f4f362](https://github.com/sammy-cool/customizable-toast-notification/commit/8f4f3623412aea01c2d8b851363463e5fc8bf11a))
15
+ * **core:** implement i18n engine, react adapter, multi-tab queue sync, and a11y ([6aa44f6](https://github.com/sammy-cool/customizable-toast-notification/commit/6aa44f6cebfef164c1098c7af510934578212ebc))
16
+
1
17
  # [3.19.0](https://github.com/sammy-cool/customizable-toast-notification/compare/v3.18.2...v3.19.0) (2026-10-24)
2
18
 
3
19
 
package/README.md CHANGED
@@ -7,6 +7,8 @@
7
7
  [![Bundle Size](https://img.shields.io/bundlephobia/minzip/customizable-toast-notification)](https://bundlephobia.com/package/customizable-toast-notification)
8
8
  [![TypeScript Strict](https://img.shields.io/badge/TypeScript-Strict%20Types-blue?logo=typescript)](dist/index.d.ts)
9
9
  [![CodeQL Security](https://img.shields.io/badge/CodeQL-Protected-success?logo=github)](.github/workflows/codeql.yml)
10
+ [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=sammy-cool_customizable-toast-notification&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=sammy-cool_customizable-toast-notification)
11
+ [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=sammy-cool_customizable-toast-notification&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=sammy-cool_customizable-toast-notification)
10
12
  [![Open in StackBlitz](https://img.shields.io/badge/StackBlitz-Live%20Sandbox-blue?logo=stackblitz)](https://stackblitz.com/edit/customizable-toast-notification-demo?file=index.html)
11
13
 
12
14
  **[▶ Try the interactive live playground](https://sammy-cool.github.io/customizable-toast-notification/)** — test damped spring physics, 5 zero-asset Web Audio synthesizer presets, dynamic action undo countdowns, and iOS-style card deck stacking in real time.
@@ -34,13 +36,13 @@
34
36
  └──────────────────────────────────────────────────┘
35
37
  ```
36
38
 
37
- Toast notifications that work the same everywhere — plain JavaScript, Vue, Svelte, Angular, SolidJS, or a multi-page app. Built with sanitized-by-default HTML rendering, zero runtime dependencies, and 177 automated unit & logic tests plus Playwright cross-browser specifications.
39
+ Toast notifications that work the same everywhere — plain JavaScript, Vue, Svelte, Angular, SolidJS, or a multi-page app. Built with sanitized-by-default HTML rendering, zero runtime dependencies, and 233 automated unit & logic tests plus 80 Playwright cross-browser specifications.
38
40
 
39
41
  ## ✨ Key Features
40
42
 
41
43
  - 🌐 **Actually Framework Agnostic** - Not a React library with "vanilla JS support" bolted on — the same API works identically in React, Vue, Angular, Svelte, htmx, or plain HTML with no build step at all
42
44
  - 🛡️ **Sanitized by Default** - `allowHtml` content is sanitized before render (DOMPurify if it's on the page, a verified-equivalent fallback if not) — safe to use with content you don't fully control
43
- - ✅ **Rigorously Tested** - 177 real logic & unit tests plus Playwright end-to-end specifications across Chromium, Firefox, and WebKit — not just "it worked on my machine"
45
+ - ✅ **Rigorously Tested** - 233 real logic & unit tests across 87 suites plus 80 Playwright end-to-end specifications across Chromium, Firefox, and WebKit — not just "it worked on my machine"
44
46
  - 🚫 **Zero Runtime Dependencies** - Nothing pulled in when your users load your app
45
47
  - 🔧 **Real TypeScript Types** - Full type definitions with real autocomplete and type-checking, not a placeholder `any`
46
48
  - 🎨 **Highly Customizable** - Colors, positions, animations, progress bars, and styling
@@ -114,7 +116,7 @@ Global Variable Name: `customizableToast`
114
116
  <script src="https://cdn.jsdelivr.net/npm/customizable-toast-notification/dist/index.umd.js"></script>
115
117
 
116
118
  <!-- OR pin to a specific version -->
117
- <script src="https://cdn.jsdelivr.net/npm/customizable-toast-notification@3.19.0/dist/index.umd.js"></script>
119
+ <script src="https://cdn.jsdelivr.net/npm/customizable-toast-notification@3.20.0/dist/index.umd.js"></script>
118
120
 
119
121
  <script>
120
122
  // Access the global UMD export
@@ -227,6 +229,9 @@ auto-dismissed on its own — they no-op gracefully rather than throwing. You ca
227
229
  | `progressBarColor` | `string` | Falls back to `textColor` | Alias for `progressColor` (accepts hex, rgb, hsl, CSS var) |
228
230
  | `progress` | `number \| 'indeterminate'`| `undefined` | Explicit percentage (0 to 100) or `"indeterminate"` moving gradient |
229
231
  | `usePool` | `boolean` | `false` | Virtual element pooling for DOM recycling in high-frequency rendering |
232
+ | `tag` / `groupId` | `string` | `undefined` | Thread grouping identifier to replace notification in-place instead of stacking |
233
+ | `trapFocus` | `boolean` | `false` | Modal keyboard focus trap (`Tab`/`Shift+Tab`) cycling for high-priority toasts |
234
+ | `shadowDom` | `boolean` | `false` | Render toast container inside isolated Shadow Root to prevent CSS bleed |
230
235
  | `cta` | `object \| array` | `null` | Call-to-action configuration (see [CTA](#call-to-action)) |
231
236
  | `undo` | `function \| object`| `null` | Action Undo button with live dynamic countdown badge (see [Undo](#️-action-undo-with-live-countdown)) |
232
237
  | `spring` | `boolean \| string \| object`| `null` | Configurable spring physics animations (see [Spring Physics](#-configurable-spring-physics-animation-engine)) |
@@ -1011,8 +1016,8 @@ createToast({ message: "Using external CSS!" });
1011
1016
 
1012
1017
  ```html
1013
1018
  <!-- HTML (CDN) -->
1014
- <link rel="stylesheet" href="https://unpkg.com/customizable-toast-notification@3.19.0/dist/index.css">
1015
- <script src="https://unpkg.com/customizable-toast-notification@3.19.0/dist/index.umd.js"></script>
1019
+ <link rel="stylesheet" href="https://unpkg.com/customizable-toast-notification@3.20.0/dist/index.css">
1020
+ <script src="https://unpkg.com/customizable-toast-notification@3.20.0/dist/index.umd.js"></script>
1016
1021
  <script>
1017
1022
  customizableToast.setConfig({ disableInlineStyles: true });
1018
1023
  customizableToast.createToast({ message: "Using external CSS!" });
@@ -1192,6 +1197,106 @@ document.documentElement.style.setProperty('--toast-success-bg', '#10b981');
1192
1197
  --toast-emergency-z-index: 10099; /* Emergency fallback z-index */
1193
1198
  ```
1194
1199
 
1200
+ ## 🧩 First-Class Framework Subpath Adapters
1201
+
1202
+ Native, zero-runtime-overhead subpaths with complete TypeScript typings are included for modern web frameworks:
1203
+
1204
+ ```typescript
1205
+ // React & Next.js
1206
+ import { useToast } from "customizable-toast-notification/react";
1207
+ const { success, error, promise } = useToast();
1208
+
1209
+ // Vue 3 & Nuxt
1210
+ import { useToast } from "customizable-toast-notification/vue";
1211
+ const toast = useToast();
1212
+ toast.success("Saved!");
1213
+
1214
+ // Svelte & SvelteKit
1215
+ import { toastStore } from "customizable-toast-notification/svelte";
1216
+ $toastStore.info("Store updated");
1217
+
1218
+ // SolidJS
1219
+ import { useToast } from "customizable-toast-notification/solid";
1220
+ const { success } = useToast();
1221
+
1222
+ // Angular 17+ (Signals & Standalone Injectable)
1223
+ import { injectToast, ToastService } from "customizable-toast-notification/angular";
1224
+ const toast = injectToast();
1225
+ ```
1226
+
1227
+ ## 🧵 Threaded Tag Grouping (`tag` / `groupId`)
1228
+
1229
+ Replace or update notifications in-place by tag instead of stacking duplicate cards:
1230
+
1231
+ ```javascript
1232
+ // Updates the existing 'upload-123' card in-place and resets the timer
1233
+ toast({
1234
+ tag: "upload-123",
1235
+ message: "Uploading: 45%...",
1236
+ showProgressBar: true,
1237
+ progress: 45
1238
+ });
1239
+ ```
1240
+
1241
+ ## 🔒 Accessible Modal Keyboard Focus Trap (`trapFocus`)
1242
+
1243
+ Trap keyboard navigation (`Tab` / `Shift+Tab`) inside high-priority interactive dialogs or action confirmations:
1244
+
1245
+ ```javascript
1246
+ toast.error("Critical: Unsaved changes will be lost", {
1247
+ trapFocus: true,
1248
+ role: "alert",
1249
+ cta: [
1250
+ { label: "Discard", onClick: () => discardChanges() },
1251
+ { label: "Keep Editing", onClick: () => {} }
1252
+ ]
1253
+ });
1254
+ ```
1255
+
1256
+ ## 🛡️ Shadow DOM Isolation (`shadowDom`)
1257
+
1258
+ Render notifications in an isolated Shadow Root to prevent host application CSS collisions:
1259
+
1260
+ ```javascript
1261
+ toast.info("Protected from global styles", {
1262
+ shadowDom: true
1263
+ });
1264
+ ```
1265
+
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
+
1195
1300
  ## 🤝 Contributing
1196
1301
 
1197
1302
  Exciting times ahead! Looking for sponsors and eager to explore new collaborations:) . Contributions are welcome! Please read our [Contributing Guidelines](CONTRIBUTING.md) for details.