@hyvor/design 1.0.12 → 1.0.13
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.
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { onMount } from 'svelte';
|
|
4
4
|
import BarProducts, { PRODUCTS } from './BarProducts.svelte';
|
|
5
5
|
import BarSupport from './BarSupport.svelte';
|
|
6
|
-
import { loadBarUser, type BarConfig, type BarProduct } from './bar.js';
|
|
6
|
+
import { loadBarUser, setInstanceAndProduct, type BarConfig, type BarProduct } from './bar.js';
|
|
7
7
|
import BarUpdates from './BarUpdates.svelte';
|
|
8
8
|
import IconCaretDownFill from '@hyvor/icons/IconCaretDownFill';
|
|
9
9
|
import LogoTalk from '../../marketing/Logo/LogoTalk.svelte';
|
|
@@ -43,7 +43,8 @@
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
onMount(() => {
|
|
46
|
-
|
|
46
|
+
setInstanceAndProduct(instance, product);
|
|
47
|
+
loadBarUser();
|
|
47
48
|
});
|
|
48
49
|
|
|
49
50
|
function getLogo() {
|
|
@@ -34,11 +34,20 @@ export declare const barUser: import("svelte/store").Writable<BarUser | null>;
|
|
|
34
34
|
export declare const barUnreadUpdates: import("svelte/store").Writable<number>;
|
|
35
35
|
export declare const barLicense: import("svelte/store").Writable<BarResolvedLicense | null>;
|
|
36
36
|
export declare const barHasFailedInvoices: import("svelte/store").Writable<boolean>;
|
|
37
|
-
export declare function
|
|
37
|
+
export declare function setInstanceAndProduct(instance_: string, product_: BarProduct): void;
|
|
38
|
+
export declare function loadBarUser(): void;
|
|
38
39
|
export declare class UnreadUpdatesTimeLocalStorage {
|
|
39
40
|
static KEY: string;
|
|
40
41
|
static get(): number | null;
|
|
41
42
|
static set(value: string): void;
|
|
42
43
|
static setNow(): void;
|
|
43
44
|
}
|
|
45
|
+
export declare const bar: {
|
|
46
|
+
/**
|
|
47
|
+
* Refetches data like user info, unread updates, billing data, etc.
|
|
48
|
+
* But does not show a loader
|
|
49
|
+
* This is useful to create after, for example, a user creates a new blog
|
|
50
|
+
*/
|
|
51
|
+
reload: () => void;
|
|
52
|
+
};
|
|
44
53
|
export {};
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { writable } from 'svelte/store';
|
|
2
|
+
let instance = '';
|
|
3
|
+
let product = 'core';
|
|
2
4
|
export const barUser = writable(null);
|
|
3
5
|
export const barUnreadUpdates = writable(0);
|
|
4
6
|
export const barLicense = writable(null);
|
|
5
7
|
export const barHasFailedInvoices = writable(false);
|
|
6
|
-
export function
|
|
8
|
+
export function setInstanceAndProduct(instance_, product_) {
|
|
9
|
+
instance = instance_;
|
|
10
|
+
product = product_;
|
|
11
|
+
}
|
|
12
|
+
export function loadBarUser() {
|
|
7
13
|
const query = new URLSearchParams();
|
|
8
14
|
query.set('product', product);
|
|
9
15
|
const lastUnreadTime = UnreadUpdatesTimeLocalStorage.get();
|
|
@@ -76,3 +82,14 @@ class BarLocalStorage {
|
|
|
76
82
|
}
|
|
77
83
|
}
|
|
78
84
|
}
|
|
85
|
+
// exported to be used from outside
|
|
86
|
+
export const bar = {
|
|
87
|
+
/**
|
|
88
|
+
* Refetches data like user info, unread updates, billing data, etc.
|
|
89
|
+
* But does not show a loader
|
|
90
|
+
* This is useful to create after, for example, a user creates a new blog
|
|
91
|
+
*/
|
|
92
|
+
reload: () => {
|
|
93
|
+
loadBarUser();
|
|
94
|
+
}
|
|
95
|
+
};
|
|
@@ -20,6 +20,7 @@ export { default as InputGroup } from './FormControl/InputGroup.svelte';
|
|
|
20
20
|
export { default as Label } from './FormControl/Label.svelte';
|
|
21
21
|
export { default as Validation } from './FormControl/Validation.svelte';
|
|
22
22
|
export { default as HyvorBar } from './HyvorBar/HyvorBar.svelte';
|
|
23
|
+
export { bar as hyvorBar } from './HyvorBar/bar.js';
|
|
23
24
|
export { default as IconButton } from './IconButton/IconButton.svelte';
|
|
24
25
|
export { default as Link } from './Link/Link.svelte';
|
|
25
26
|
export { default as Loader } from './Loader/Loader.svelte';
|
package/dist/components/index.js
CHANGED
|
@@ -20,6 +20,7 @@ export { default as InputGroup } from './FormControl/InputGroup.svelte';
|
|
|
20
20
|
export { default as Label } from './FormControl/Label.svelte';
|
|
21
21
|
export { default as Validation } from './FormControl/Validation.svelte';
|
|
22
22
|
export { default as HyvorBar } from './HyvorBar/HyvorBar.svelte';
|
|
23
|
+
export { bar as hyvorBar } from './HyvorBar/bar.js';
|
|
23
24
|
export { default as IconButton } from './IconButton/IconButton.svelte';
|
|
24
25
|
export { default as Link } from './Link/Link.svelte';
|
|
25
26
|
export { default as Loader } from './Loader/Loader.svelte';
|
package/package.json
CHANGED