@samline/notify 1.0.0 → 1.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/README.md +19 -4
- package/dist/browser-notify.js +1 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,12 +32,23 @@ npm install @samline/notify
|
|
|
32
32
|
|
|
33
33
|
## CDN / Browser
|
|
34
34
|
|
|
35
|
-
Include the
|
|
35
|
+
Include the CSS and UMD bundle via unpkg or jsDelivr:
|
|
36
|
+
|
|
37
|
+
```html
|
|
38
|
+
<!-- unpkg -->
|
|
39
|
+
<link rel="stylesheet" href="https://unpkg.com/@samline/notify@1.0.1/dist/styles.css" />
|
|
40
|
+
<script src="https://unpkg.com/@samline/notify@1.0.1/dist/browser-notify.js"></script>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```html
|
|
44
|
+
<!-- jsDelivr -->
|
|
45
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@samline/notify@1.0.1/dist/styles.css" />
|
|
46
|
+
<script src="https://cdn.jsdelivr.net/npm/@samline/notify@1.0.1/dist/browser-notify.js"></script>
|
|
47
|
+
```
|
|
36
48
|
|
|
37
49
|
```html
|
|
38
|
-
<script src="dist/browser-notify.js"></script>
|
|
39
50
|
<script>
|
|
40
|
-
|
|
51
|
+
window.notify.show({
|
|
41
52
|
title: 'Hello from the browser',
|
|
42
53
|
type: 'success',
|
|
43
54
|
duration: 2000,
|
|
@@ -66,7 +77,11 @@ Include the generated UMD file (`dist/browser-notify.js`) in your HTML:
|
|
|
66
77
|
**VanillaJS (default):**
|
|
67
78
|
|
|
68
79
|
```js
|
|
69
|
-
import { showNotifyToast } from '@samline/notify'
|
|
80
|
+
import { showNotifyToast, onNotifyToastsChange } from '@samline/notify'
|
|
81
|
+
|
|
82
|
+
// Subscribe first — the library manages state, rendering is up to you
|
|
83
|
+
onNotifyToastsChange((toasts) => { /* render toasts in your DOM */ })
|
|
84
|
+
|
|
70
85
|
showNotifyToast({ title: 'Hello world!', type: 'success' })
|
|
71
86
|
```
|
|
72
87
|
|
package/dist/browser-notify.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@samline/notify",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "A toast notification library designed to bring beautiful, animated notifications to React, Vue, Svelte, and Vanilla JS. Seamless integration across multiple frameworks.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"toast",
|