@kong/kongponents 9.43.3-pr.2953.6ec956d.0 → 9.43.3-pr.2953.9e5e5e4.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.
|
@@ -7,7 +7,7 @@ const defaultToastConfig = {
|
|
|
7
7
|
message: 'Success',
|
|
8
8
|
timeoutMilliseconds: 3000,
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export function useToast() {
|
|
11
11
|
// Initialize the toast manager; stub out the `open` and `destroy` methods on the server
|
|
12
12
|
const toast = import.meta.client ? new ToastManager() : { open: () => { }, destroy: () => { } };
|
|
13
13
|
const showToast = async (notification) => {
|
package/package.json
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// TODO: testing some stuff...
|
|
2
|
-
// @ts-ignore - import path exists
|
|
3
|
-
import { defineNuxtPlugin } from '#app';
|
|
4
|
-
// In some NodeJS environments, the `crypto` module is not available by default, so import it and make it available on the server
|
|
5
|
-
import crypto from 'node:crypto';
|
|
6
|
-
export default defineNuxtPlugin({
|
|
7
|
-
name: 'kongponents',
|
|
8
|
-
setup() {
|
|
9
|
-
// Inject the crypto module into the global scope if it is not already available
|
|
10
|
-
if (import.meta.server && typeof globalThis?.crypto === 'undefined') {
|
|
11
|
-
globalThis.crypto = globalThis.crypto || crypto;
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
});
|