juice-toast 1.4.4 → 2.0.0-beta.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/API.md CHANGED
@@ -208,8 +208,17 @@ juiceToast.promise(fetch("/api"), {
208
208
  ## `juiceToast.use(pluginFunction)`
209
209
 
210
210
  ```js
211
- juiceToast.use(({ toast, cfg, type, root }) => {
212
- console.log("Toast created:", type);
211
+ juiceToast.use({
212
+ name: 'logger',
213
+ onCreate(ctx) {
214
+ console.log('create', ctx.id, ctx.type);
215
+ },
216
+ onShow(ctx) {
217
+ console.log('show', ctx.id);
218
+ },
219
+ onRemove(ctx) {
220
+ console.log('remove', ctx.id);
221
+ },
213
222
  });
214
223
  ```
215
224
 
@@ -326,6 +335,45 @@ juiceToast.dismissAll();
326
335
  juiceToast.listActive(filter);
327
336
  ```
328
337
 
338
+ # Choose Sanitizer Engine
339
+ ```js
340
+ juiceToast.setup({
341
+ sanitizer: {
342
+ engine: 'builtin',
343
+ },
344
+ });
345
+ ```
346
+
347
+ # Grouping Toast
348
+ ```js
349
+ juiceToast.info({
350
+ title: 'Upload',
351
+ message: 'File 1 under process',
352
+ groupId: 'upload-01',
353
+ groupStrategy: 'merge',
354
+ });
355
+ ```
356
+
357
+ # Sanitizer with DOMPurify
358
+ ```js
359
+ import juiceToast from 'juice-toast';
360
+ import DOMPurify from 'dompurify';
361
+
362
+ juiceToast.setup({
363
+ sanitizer: {
364
+ engine: 'dompurify',
365
+ dompurify: DOMPurify,
366
+ },
367
+ });
368
+ ```
369
+
370
+ # DevTools
371
+ ```js
372
+ juiceToast.setup({
373
+ devTools: true
374
+ });
375
+ ```
376
+
329
377
  ---
330
378
 
331
379
  # License
package/CHANGELOG.md CHANGED
@@ -1,4 +1,11 @@
1
- ## v1.4.4 (Stable)
1
+ # MAJOR UPDATE
2
+ ## v2.0.0 (Pack 0)
3
+ - Adding DevTools
4
+ - CONTRIBUTION: Source code file now are in modules
5
+ - Adding Groups Toast
6
+ - Fix & Upgrade HTML Sanitizer
7
+
8
+ v1.4.4
2
9
  - Fix priority queue
3
10
  - Reduce memory leak's
4
11
  - Fix documentation
@@ -97,3 +104,5 @@ v1.0.1
97
104
 
98
105
  v1.0.0
99
106
  - Initial release
107
+
108
+ WARNING: v2.0.0 is a breaking change, please use 1.4.4-lts
package/README.md CHANGED
@@ -6,14 +6,14 @@
6
6
  ![npm download wekkly](https://img.shields.io/npm/dw/juice-toast)
7
7
  ![npm download](https://img.shields.io/npm/dt/juice-toast)
8
8
  ![npm version](https://img.shields.io/npm/v/juice-toast)
9
- ![license](https://img.shields.io/npm/l/juice-toast)
9
+ [![License: Atrosfer 1.0](https://img.shields.io/badge/License-Atrosfer_1.0-blue.svg)](https://atrosfer.opendnf.cloud/1.0)
10
10
  ![issues](https://img.shields.io/github/issues/KhairyK/juiceToast)
11
11
  ![repo size](https://img.shields.io/github/repo-size/KhairyK/juiceToast)
12
12
  ![browser](https://img.shields.io/badge/browser-all%20modern-brightgreen)
13
13
  ![deps](https://img.shields.io/badge/dependencies-0-brightgreen)
14
14
  ![ts](https://img.shields.io/badge/types-TypeScript-blue)
15
15
  ![last commit](https://img.shields.io/github/last-commit/KhairyK/juiceToast)
16
- [![Socket Badge](https://badge.socket.dev/npm/package/juice-toast/1.4.3)](https://badge.socket.dev/npm/package/juice-toast/1.4.3)
16
+ [![Socket Badge](https://badge.socket.dev/npm/package/juice-toast/2.0.0-beta.1)](https://badge.socket.dev/npm/package/juice-toast/2.0.0-beta.1)
17
17
 
18
18
  ---
19
19
 
@@ -41,7 +41,7 @@ It supports **UMD & ESM**, **dynamic toast types**, **theme management**, **queu
41
41
  - 🧩 Plugin system
42
42
  - ♿ Accessible (ARIA + focus/hover pause)
43
43
 
44
- Try a new [React JuiceToast](https://npmjs.com/package/@juice-toast/plugins-react) plugin!
44
+ Try a new [React JuiceToast](https://npmjs.com/package/@juice-toast/plugins-react) plugin & [Vue JuiceToast](https://npmjs.com/package/@juice-toast/plugins-vue) plugin!
45
45
 
46
46
  ---
47
47
 
@@ -51,7 +51,7 @@ Try a new [React JuiceToast](https://npmjs.com/package/@juice-toast/plugins-reac
51
51
  ```bash
52
52
  npm install juice-toast --no-optional
53
53
  ```
54
- #### With Optional (React Plugins)
54
+ #### With Optional (With Plugins)
55
55
  ```bash
56
56
  npm install juice-toast
57
57
  ```
@@ -350,6 +350,13 @@ juiceToast.modal({
350
350
  });
351
351
  ```
352
352
 
353
+ ## DevTools
354
+ ```js
355
+ juiceToast.setup({
356
+ devTools: true
357
+ });
358
+ ```
359
+
353
360
  ---
354
361
 
355
362
  # 🆚 Comparison
@@ -366,6 +373,7 @@ juiceToast.modal({
366
373
  | Avatar Support | ✅ | ❌ | ❌ |
367
374
  | Custom Themes | ✅ | ✅ | Limited |
368
375
  | Modal Support | ✅ | ✅ | ❌ |
376
+ | DevTools | ✅ | ❌ | ❌ |
369
377
 
370
378
  ### Compared to SweetAlert2
371
379