@samline/notify 1.0.2 → 2.0.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/{LICENSE → LICENSE.md} +2 -2
- package/README.md +27 -163
- package/dist/_runtime.d.mts +87 -0
- package/dist/_runtime.d.ts +87 -0
- package/dist/_runtime.js +97 -0
- package/dist/_runtime.mjs +83 -0
- package/dist/browser/assets-client-B-VVPPYQ.js +114 -0
- package/dist/browser/assets-client-CUzxHubR.mjs +108 -0
- package/dist/browser/index-client-BBOQyMFk.mjs +173 -0
- package/dist/browser/index-client-Czb7hTpD.js +181 -0
- package/dist/browser/index.d.mts +134 -0
- package/dist/browser/index.d.ts +134 -0
- package/dist/browser/index.js +34 -0
- package/dist/browser/index.mjs +26 -0
- package/dist/browser/render-client-CjcQoukB.js +981 -0
- package/dist/browser/render-client-bGRSTd-L.mjs +974 -0
- package/dist/core/index.d.mts +68 -0
- package/dist/core/index.d.ts +68 -0
- package/dist/core/index.js +1 -0
- package/dist/core/index.mjs +1 -0
- package/dist/index.d.mts +131 -0
- package/dist/index.d.ts +131 -0
- package/dist/index.js +1240 -0
- package/dist/index.mjs +1228 -0
- package/dist/react/index.d.mts +158 -0
- package/dist/react/index.d.ts +158 -0
- package/dist/react/index.js +1116 -0
- package/dist/react/index.mjs +1107 -0
- package/dist/styles.css +589 -422
- package/dist/svelte/assets-client-B-VVPPYQ.js +114 -0
- package/dist/svelte/assets-client-CUzxHubR.mjs +108 -0
- package/dist/svelte/index-client-DbXbWMIe.js +177 -0
- package/dist/svelte/index-client-Dj_WfPK9.mjs +170 -0
- package/dist/svelte/index.d.mts +14 -0
- package/dist/svelte/index.d.ts +14 -0
- package/dist/svelte/index.js +43 -0
- package/dist/svelte/index.mjs +36 -0
- package/dist/svelte/render-client-CjcQoukB.js +981 -0
- package/dist/svelte/render-client-bGRSTd-L.mjs +974 -0
- package/dist/vue/assets-client-B-VVPPYQ.js +114 -0
- package/dist/vue/assets-client-CUzxHubR.mjs +108 -0
- package/dist/vue/index-client-DbXbWMIe.js +177 -0
- package/dist/vue/index-client-Dj_WfPK9.mjs +170 -0
- package/dist/vue/index.d.mts +50 -0
- package/dist/vue/index.d.ts +50 -0
- package/dist/vue/index.js +110 -0
- package/dist/vue/index.mjs +104 -0
- package/dist/vue/render-client-CjcQoukB.js +981 -0
- package/dist/vue/render-client-bGRSTd-L.mjs +974 -0
- package/package.json +140 -95
- package/dist/browser-notify.js +0 -68
- package/dist/cc-2Yt7NqMX.mjs +0 -21
- package/dist/cc-B6peeNak.mjs +0 -33
- package/dist/cc-BWuAzFJ6.js +0 -12
- package/dist/cc-CaBHsjUt.js +0 -34
- package/dist/cc-DGff5sSY.js +0 -21
- package/dist/cc-he3fHS3P.mjs +0 -12
- package/dist/notify.d.mts +0 -48
- package/dist/notify.d.mts.map +0 -1
- package/dist/notify.d.ts +0 -48
- package/dist/notify.d.ts.map +0 -1
- package/dist/notify.js +0 -206
- package/dist/notify.mjs +0 -202
- package/dist/react-notify-12s--2JK5UjB.mjs +0 -1244
- package/dist/react-notify-12s-Kv2M6zlv.js +0 -1247
- package/dist/react.d.mts +0 -70
- package/dist/react.d.mts.map +0 -1
- package/dist/react.d.ts +0 -70
- package/dist/react.d.ts.map +0 -1
- package/dist/react.js +0 -19
- package/dist/react.mjs +0 -10
- package/dist/render-notify-toasts.js +0 -213
- package/dist/svelte.d.mts +0 -49
- package/dist/svelte.d.mts.map +0 -1
- package/dist/svelte.d.ts +0 -49
- package/dist/svelte.d.ts.map +0 -1
- package/dist/svelte.js +0 -284
- package/dist/svelte.mjs +0 -280
- package/dist/vue.d.mts +0 -107
- package/dist/vue.d.mts.map +0 -1
- package/dist/vue.d.ts +0 -107
- package/dist/vue.d.ts.map +0 -1
- package/dist/vue.js +0 -2215
- package/dist/vue.mjs +0 -2211
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
function __insertCSS(code) {
|
|
2
|
+
if (!code || typeof document == 'undefined') return
|
|
3
|
+
let head = document.head || document.getElementsByTagName('head')[0]
|
|
4
|
+
let style = document.createElement('style')
|
|
5
|
+
style.type = 'text/css'
|
|
6
|
+
head.appendChild(style)
|
|
7
|
+
;style.styleSheet ? (style.styleSheet.cssText = code) : style.appendChild(document.createTextNode(code))
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
+
|
|
12
|
+
var vue = require('vue');
|
|
13
|
+
var indexClient = require('./index-client-DbXbWMIe.js');
|
|
14
|
+
|
|
15
|
+
const toasterProps = {
|
|
16
|
+
id: String,
|
|
17
|
+
theme: String,
|
|
18
|
+
position: String,
|
|
19
|
+
expand: Boolean,
|
|
20
|
+
duration: Number,
|
|
21
|
+
gap: Number,
|
|
22
|
+
visibleToasts: Number,
|
|
23
|
+
closeButton: Boolean,
|
|
24
|
+
className: String,
|
|
25
|
+
offset: [
|
|
26
|
+
Object,
|
|
27
|
+
String,
|
|
28
|
+
Number
|
|
29
|
+
],
|
|
30
|
+
mobileOffset: [
|
|
31
|
+
Object,
|
|
32
|
+
String,
|
|
33
|
+
Number
|
|
34
|
+
],
|
|
35
|
+
dir: String,
|
|
36
|
+
richColors: Boolean,
|
|
37
|
+
customAriaLabel: String,
|
|
38
|
+
containerAriaLabel: String
|
|
39
|
+
};
|
|
40
|
+
function cleanOptions(options) {
|
|
41
|
+
const nextOptions = {};
|
|
42
|
+
for(const key in options){
|
|
43
|
+
if (Object.prototype.hasOwnProperty.call(options, key) && options[key] !== undefined) {
|
|
44
|
+
nextOptions[key] = options[key];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return nextOptions;
|
|
48
|
+
}
|
|
49
|
+
const Toaster = vue.defineComponent({
|
|
50
|
+
name: 'NotifyToaster',
|
|
51
|
+
props: toasterProps,
|
|
52
|
+
setup (props) {
|
|
53
|
+
let mounted = false;
|
|
54
|
+
const sync = ()=>{
|
|
55
|
+
const options = cleanOptions({
|
|
56
|
+
id: props.id,
|
|
57
|
+
theme: props.theme,
|
|
58
|
+
position: props.position,
|
|
59
|
+
expand: props.expand,
|
|
60
|
+
duration: props.duration,
|
|
61
|
+
gap: props.gap,
|
|
62
|
+
visibleToasts: props.visibleToasts,
|
|
63
|
+
closeButton: props.closeButton,
|
|
64
|
+
className: props.className,
|
|
65
|
+
offset: props.offset,
|
|
66
|
+
mobileOffset: props.mobileOffset,
|
|
67
|
+
dir: props.dir,
|
|
68
|
+
richColors: props.richColors,
|
|
69
|
+
customAriaLabel: props.customAriaLabel,
|
|
70
|
+
containerAriaLabel: props.containerAriaLabel
|
|
71
|
+
});
|
|
72
|
+
indexClient.createToaster(options);
|
|
73
|
+
};
|
|
74
|
+
vue.onMounted(()=>{
|
|
75
|
+
mounted = true;
|
|
76
|
+
sync();
|
|
77
|
+
});
|
|
78
|
+
vue.watch(()=>({
|
|
79
|
+
...props
|
|
80
|
+
}), ()=>{
|
|
81
|
+
if (!mounted) return;
|
|
82
|
+
sync();
|
|
83
|
+
}, {
|
|
84
|
+
deep: true
|
|
85
|
+
});
|
|
86
|
+
vue.onBeforeUnmount(()=>{
|
|
87
|
+
indexClient.destroyToaster();
|
|
88
|
+
mounted = false;
|
|
89
|
+
});
|
|
90
|
+
return ()=>vue.h('span', {
|
|
91
|
+
'data-notify-vue-toaster': '',
|
|
92
|
+
hidden: true,
|
|
93
|
+
'aria-hidden': 'true'
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
const NotifyPlugin = {
|
|
98
|
+
install (app) {
|
|
99
|
+
app.component('NotifyToaster', Toaster);
|
|
100
|
+
app.config.globalProperties.$toast = indexClient.toast;
|
|
101
|
+
app.provide('notify:toast', indexClient.toast);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
exports.createToaster = indexClient.createToaster;
|
|
106
|
+
exports.destroyToaster = indexClient.destroyToaster;
|
|
107
|
+
exports.getToaster = indexClient.getToaster;
|
|
108
|
+
exports.toast = indexClient.toast;
|
|
109
|
+
exports.NotifyPlugin = NotifyPlugin;
|
|
110
|
+
exports.Toaster = Toaster;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
function __insertCSS(code) {
|
|
2
|
+
if (!code || typeof document == 'undefined') return
|
|
3
|
+
let head = document.head || document.getElementsByTagName('head')[0]
|
|
4
|
+
let style = document.createElement('style')
|
|
5
|
+
style.type = 'text/css'
|
|
6
|
+
head.appendChild(style)
|
|
7
|
+
;style.styleSheet ? (style.styleSheet.cssText = code) : style.appendChild(document.createTextNode(code))
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
import { defineComponent, onMounted, watch, onBeforeUnmount, h } from 'vue';
|
|
11
|
+
import { d as destroyToaster, c as createToaster, t as toast } from './index-client-Dj_WfPK9.mjs';
|
|
12
|
+
export { g as getToaster } from './index-client-Dj_WfPK9.mjs';
|
|
13
|
+
|
|
14
|
+
const toasterProps = {
|
|
15
|
+
id: String,
|
|
16
|
+
theme: String,
|
|
17
|
+
position: String,
|
|
18
|
+
expand: Boolean,
|
|
19
|
+
duration: Number,
|
|
20
|
+
gap: Number,
|
|
21
|
+
visibleToasts: Number,
|
|
22
|
+
closeButton: Boolean,
|
|
23
|
+
className: String,
|
|
24
|
+
offset: [
|
|
25
|
+
Object,
|
|
26
|
+
String,
|
|
27
|
+
Number
|
|
28
|
+
],
|
|
29
|
+
mobileOffset: [
|
|
30
|
+
Object,
|
|
31
|
+
String,
|
|
32
|
+
Number
|
|
33
|
+
],
|
|
34
|
+
dir: String,
|
|
35
|
+
richColors: Boolean,
|
|
36
|
+
customAriaLabel: String,
|
|
37
|
+
containerAriaLabel: String
|
|
38
|
+
};
|
|
39
|
+
function cleanOptions(options) {
|
|
40
|
+
const nextOptions = {};
|
|
41
|
+
for(const key in options){
|
|
42
|
+
if (Object.prototype.hasOwnProperty.call(options, key) && options[key] !== undefined) {
|
|
43
|
+
nextOptions[key] = options[key];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return nextOptions;
|
|
47
|
+
}
|
|
48
|
+
const Toaster = defineComponent({
|
|
49
|
+
name: 'NotifyToaster',
|
|
50
|
+
props: toasterProps,
|
|
51
|
+
setup (props) {
|
|
52
|
+
let mounted = false;
|
|
53
|
+
const sync = ()=>{
|
|
54
|
+
const options = cleanOptions({
|
|
55
|
+
id: props.id,
|
|
56
|
+
theme: props.theme,
|
|
57
|
+
position: props.position,
|
|
58
|
+
expand: props.expand,
|
|
59
|
+
duration: props.duration,
|
|
60
|
+
gap: props.gap,
|
|
61
|
+
visibleToasts: props.visibleToasts,
|
|
62
|
+
closeButton: props.closeButton,
|
|
63
|
+
className: props.className,
|
|
64
|
+
offset: props.offset,
|
|
65
|
+
mobileOffset: props.mobileOffset,
|
|
66
|
+
dir: props.dir,
|
|
67
|
+
richColors: props.richColors,
|
|
68
|
+
customAriaLabel: props.customAriaLabel,
|
|
69
|
+
containerAriaLabel: props.containerAriaLabel
|
|
70
|
+
});
|
|
71
|
+
createToaster(options);
|
|
72
|
+
};
|
|
73
|
+
onMounted(()=>{
|
|
74
|
+
mounted = true;
|
|
75
|
+
sync();
|
|
76
|
+
});
|
|
77
|
+
watch(()=>({
|
|
78
|
+
...props
|
|
79
|
+
}), ()=>{
|
|
80
|
+
if (!mounted) return;
|
|
81
|
+
sync();
|
|
82
|
+
}, {
|
|
83
|
+
deep: true
|
|
84
|
+
});
|
|
85
|
+
onBeforeUnmount(()=>{
|
|
86
|
+
destroyToaster();
|
|
87
|
+
mounted = false;
|
|
88
|
+
});
|
|
89
|
+
return ()=>h('span', {
|
|
90
|
+
'data-notify-vue-toaster': '',
|
|
91
|
+
hidden: true,
|
|
92
|
+
'aria-hidden': 'true'
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
const NotifyPlugin = {
|
|
97
|
+
install (app) {
|
|
98
|
+
app.component('NotifyToaster', Toaster);
|
|
99
|
+
app.config.globalProperties.$toast = toast;
|
|
100
|
+
app.provide('notify:toast', toast);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export { NotifyPlugin, Toaster, createToaster, destroyToaster, toast };
|