@samline/notify 0.1.7 → 0.1.8
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 +5 -5
- package/dist/index.cjs.js +0 -11
- package/dist/index.esm.js +0 -11
- package/docs/browser.md +4 -4
- package/package.json +9 -8
- package/rollup.config.mjs +11 -2
package/README.md
CHANGED
|
@@ -47,8 +47,8 @@ CDN / Browser
|
|
|
47
47
|
Use the browser build when your project loads scripts directly and cannot compile npm modules (Shopify, WordPress, plain HTML). Example CDN usage (replace version):
|
|
48
48
|
|
|
49
49
|
```html
|
|
50
|
-
<script src="https://unpkg.com/@samline/notify@
|
|
51
|
-
<link rel="stylesheet" href="https://unpkg.com/@samline/notify@
|
|
50
|
+
<script src="https://unpkg.com/@samline/notify@0.1.7/dist/notify.umd.js"></script>
|
|
51
|
+
<link rel="stylesheet" href="https://unpkg.com/@samline/notify@0.1.7/dist/styles.css">
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
Entry Points
|
|
@@ -59,7 +59,7 @@ Choose the entrypoint matching your stack so you only import what you need.
|
|
|
59
59
|
| --- | --- | --- |
|
|
60
60
|
| Vanilla JS | `import { default as notifications } from '@samline/notify'` | [docs/vanilla.md](docs/vanilla.md) |
|
|
61
61
|
| Vanilla explicit subpath | `import { sileo } from '@samline/notify/vanilla'` | [docs/vanilla.md](docs/vanilla.md) |
|
|
62
|
-
| Browser / CDN | `<script src="https://unpkg.com/@samline/notify@
|
|
62
|
+
| Browser / CDN | `<script src="https://unpkg.com/@samline/notify@0.1.7/dist/notify.umd.js"></script>` | [docs/browser.md](docs/browser.md) |
|
|
63
63
|
| React | `import { Toaster } from '@samline/notify/react'` | [docs/react.md](docs/react.md) |
|
|
64
64
|
| Vue | `import Notifications from '@samline/notify/vue'` | [docs/vue.md](docs/vue.md) |
|
|
65
65
|
| Svelte | `import Toaster from '@samline/notify/svelte'` | [docs/svelte.md](docs/svelte.md) |
|
|
@@ -69,8 +69,8 @@ Quick Start
|
|
|
69
69
|
Vanilla example (UMD / modules):
|
|
70
70
|
|
|
71
71
|
```html
|
|
72
|
-
<script src="https://unpkg.com/@samline/notify@
|
|
73
|
-
<link rel="stylesheet" href="https://unpkg.com/@samline/notify@
|
|
72
|
+
<script src="https://unpkg.com/@samline/notify@0.1.7/dist/notify.umd.js"></script>
|
|
73
|
+
<link rel="stylesheet" href="https://unpkg.com/@samline/notify@0.1.7/dist/styles.css">
|
|
74
74
|
<script>
|
|
75
75
|
const api = window.notify || window.notifications;
|
|
76
76
|
api.initToasters(document.body, ['top-right']);
|
package/dist/index.cjs.js
CHANGED
|
@@ -413,15 +413,6 @@ class Animation {
|
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
415
|
|
|
416
|
-
var invariant = function () { };
|
|
417
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
418
|
-
invariant = function (check, message) {
|
|
419
|
-
if (!check) {
|
|
420
|
-
throw new Error(message);
|
|
421
|
-
}
|
|
422
|
-
};
|
|
423
|
-
}
|
|
424
|
-
|
|
425
416
|
/**
|
|
426
417
|
* The MotionValue tracks the state of a single animatable
|
|
427
418
|
* value. Currently, updatedAt and current are unused. The
|
|
@@ -964,8 +955,6 @@ function createAnimate(AnimatePolyfill) {
|
|
|
964
955
|
return function animate(elements, keyframes, options = {}) {
|
|
965
956
|
elements = resolveElements(elements);
|
|
966
957
|
const numElements = elements.length;
|
|
967
|
-
invariant(Boolean(numElements), "No valid element provided.");
|
|
968
|
-
invariant(Boolean(keyframes), "No keyframes defined.");
|
|
969
958
|
/**
|
|
970
959
|
* Create and start new animations
|
|
971
960
|
*/
|
package/dist/index.esm.js
CHANGED
|
@@ -409,15 +409,6 @@ class Animation {
|
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
411
|
|
|
412
|
-
var invariant = function () { };
|
|
413
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
414
|
-
invariant = function (check, message) {
|
|
415
|
-
if (!check) {
|
|
416
|
-
throw new Error(message);
|
|
417
|
-
}
|
|
418
|
-
};
|
|
419
|
-
}
|
|
420
|
-
|
|
421
412
|
/**
|
|
422
413
|
* The MotionValue tracks the state of a single animatable
|
|
423
414
|
* value. Currently, updatedAt and current are unused. The
|
|
@@ -960,8 +951,6 @@ function createAnimate(AnimatePolyfill) {
|
|
|
960
951
|
return function animate(elements, keyframes, options = {}) {
|
|
961
952
|
elements = resolveElements(elements);
|
|
962
953
|
const numElements = elements.length;
|
|
963
|
-
invariant(Boolean(numElements), "No valid element provided.");
|
|
964
|
-
invariant(Boolean(keyframes), "No keyframes defined.");
|
|
965
954
|
/**
|
|
966
955
|
* Create and start new animations
|
|
967
956
|
*/
|
package/docs/browser.md
CHANGED
|
@@ -5,8 +5,8 @@ Quick start
|
|
|
5
5
|
Include the UMD bundle and stylesheet in a static page:
|
|
6
6
|
|
|
7
7
|
```html
|
|
8
|
-
<link rel="stylesheet" href="https://unpkg.com/@samline/notify@
|
|
9
|
-
<script src="https://unpkg.com/@samline/notify@
|
|
8
|
+
<link rel="stylesheet" href="https://unpkg.com/@samline/notify@0.1.7/dist/styles.css">
|
|
9
|
+
<script src="https://unpkg.com/@samline/notify@0.1.7/dist/notify.umd.js"></script>
|
|
10
10
|
<script>
|
|
11
11
|
const api = window.notify || window.notifications;
|
|
12
12
|
api.initToasters(document.body, ['top-right']);
|
|
@@ -27,8 +27,8 @@ Use the browser build when your project loads scripts directly in the page and c
|
|
|
27
27
|
Example using the UMD build (replace path/version as needed):
|
|
28
28
|
|
|
29
29
|
```html
|
|
30
|
-
<link rel="stylesheet" href="https://unpkg.com/@samline/notify@
|
|
31
|
-
<script src="https://unpkg.com/@samline/notify@
|
|
30
|
+
<link rel="stylesheet" href="https://unpkg.com/@samline/notify@0.1.7/dist/styles.css">
|
|
31
|
+
<script src="https://unpkg.com/@samline/notify@0.1.7/dist/notify.umd.js"></script>
|
|
32
32
|
<script>
|
|
33
33
|
document.addEventListener('DOMContentLoaded', () => {
|
|
34
34
|
const api = window.notify || window.notifications;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@samline/notify",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Notifications engine inspired by Sileo, with adapters for vanilla, React, Vue and Svelte.",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -26,22 +26,23 @@
|
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"react": ">=18",
|
|
28
28
|
"react-dom": ">=18",
|
|
29
|
-
"
|
|
30
|
-
"
|
|
29
|
+
"svelte": "^5.55.0",
|
|
30
|
+
"vue": "^3.5.31"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@rollup/plugin-commonjs": "^25.0.0",
|
|
34
34
|
"@rollup/plugin-node-resolve": "^15.0.0",
|
|
35
|
+
"@rollup/plugin-replace": "^6.0.3",
|
|
35
36
|
"@rollup/plugin-typescript": "^11.0.0",
|
|
37
|
+
"@types/node": "^20.0.0",
|
|
38
|
+
"@types/react": "^18.2.0",
|
|
39
|
+
"@types/react-dom": "^18.2.0",
|
|
36
40
|
"rollup": "^3.0.0",
|
|
37
|
-
"tslib": "^2.8.1",
|
|
38
41
|
"rollup-plugin-copy": "^3.4.0",
|
|
39
42
|
"svelte-check": "^3.3.0",
|
|
43
|
+
"tslib": "^2.8.1",
|
|
40
44
|
"typescript": "^5.0.0",
|
|
41
|
-
"vitest": "^1.0.0"
|
|
42
|
-
"@types/node": "^20.0.0",
|
|
43
|
-
"@types/react": "^18.2.0",
|
|
44
|
-
"@types/react-dom": "^18.2.0"
|
|
45
|
+
"vitest": "^1.0.0"
|
|
45
46
|
},
|
|
46
47
|
"devDependenciesMeta": {
|
|
47
48
|
"@types/react": {
|
package/rollup.config.mjs
CHANGED
|
@@ -2,6 +2,7 @@ import resolve from '@rollup/plugin-node-resolve';
|
|
|
2
2
|
import commonjs from '@rollup/plugin-commonjs';
|
|
3
3
|
import typescript from '@rollup/plugin-typescript';
|
|
4
4
|
import copy from 'rollup-plugin-copy';
|
|
5
|
+
import replace from '@rollup/plugin-replace';
|
|
5
6
|
|
|
6
7
|
export default [
|
|
7
8
|
// ESM + CJS
|
|
@@ -11,13 +12,21 @@ export default [
|
|
|
11
12
|
{ file: 'dist/index.esm.js', format: 'es', exports: 'named' },
|
|
12
13
|
{ file: 'dist/index.cjs.js', format: 'cjs', exports: 'named' }
|
|
13
14
|
],
|
|
14
|
-
plugins: [
|
|
15
|
+
plugins: [
|
|
16
|
+
replace({
|
|
17
|
+
'process.env.NODE_ENV': JSON.stringify('production'),
|
|
18
|
+
preventAssignment: true
|
|
19
|
+
}),
|
|
20
|
+
resolve(),
|
|
21
|
+
commonjs(),
|
|
22
|
+
typescript({ tsconfig: './tsconfig.json' }),
|
|
15
23
|
copy({
|
|
16
24
|
targets: [
|
|
17
25
|
{ src: 'src/styles/sileo.css', dest: 'dist', rename: 'styles.css' }
|
|
18
26
|
],
|
|
19
27
|
verbose: true
|
|
20
|
-
})
|
|
28
|
+
})
|
|
29
|
+
]
|
|
21
30
|
},
|
|
22
31
|
// UMD build for browser (vanilla DOM use)
|
|
23
32
|
{
|