@hgdc/ui 0.68.0 → 0.69.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/dist/products.js +5 -2
- package/dist/shell-memory.d.ts +6 -0
- package/dist/shell-memory.js +20 -0
- package/package.json +1 -1
package/dist/products.js
CHANGED
|
@@ -69,8 +69,11 @@ name = word) {
|
|
|
69
69
|
accent: HGDC_EMAIL_ACCENT,
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
|
-
/**
|
|
73
|
-
|
|
72
|
+
/**
|
|
73
|
+
* Le compte commun (profil, sécurité), hors du catalogue des produits. Adresse et pastille gardent
|
|
74
|
+
* le mot `account` ; le nom affiché est ID (ADR 0015 du dépôt `hgdc`).
|
|
75
|
+
*/
|
|
76
|
+
const account = product("Account", "Ton compte : profil, sécurité et organisations, pour tous les produits de la famille.", UserCircleIcon, "live", "ID");
|
|
74
77
|
export const HGDC_ACCOUNT = { ...account, entryHref: account.href };
|
|
75
78
|
/** Manager : les organisations, leurs membres et leurs rôles. En tête du menu et de la barre des produits. */
|
|
76
79
|
export const HGDC_MANAGER = product("Manager", "Tes organisations, leurs membres et leurs rôles.", UserGroupIcon, "live");
|
package/dist/shell-memory.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ export declare const SHELL_ORG_KEY = "hgdc-shell:org";
|
|
|
4
4
|
export declare const SHELL_NAV_KEY_PREFIX = "hgdc-shell:nav:";
|
|
5
5
|
/** Dernier produit ouvert (son mot), en `localStorage` : l'accueil d'`app.hgdc.ch` y renvoie. */
|
|
6
6
|
export declare const SHELL_LAST_PRODUCT_KEY = "hgdc-shell:last";
|
|
7
|
+
/** Slug de la dernière organisation ouverte, le même pour tous les modules : Basalte est un seul produit (ADR 0019 de la famille). */
|
|
8
|
+
export declare const SHELL_LAST_ORG_KEY = "hgdc-shell:last-org";
|
|
7
9
|
export type ShellOrganization = {
|
|
8
10
|
initials: string;
|
|
9
11
|
logo?: string;
|
|
@@ -59,6 +61,10 @@ export declare function rememberShellOrganization(org: {
|
|
|
59
61
|
}): void;
|
|
60
62
|
/** Oublie l'organisation (déconnexion) : la page suivante montre un squelette. */
|
|
61
63
|
export declare function forgetShellOrganization(): void;
|
|
64
|
+
/** Retient l'organisation ouverte : à appeler sur la page d'une organisation, jamais pour la démo. */
|
|
65
|
+
export declare function rememberLastOrganization(slug: string): void;
|
|
66
|
+
/** Slug de la dernière organisation ouverte dans un module. À comparer aux organisations de la personne. */
|
|
67
|
+
export declare function lastOrganization(): string | null;
|
|
62
68
|
/** Retient la hauteur de la navigation d'un produit (`AppShell` le fait après l'affichage). */
|
|
63
69
|
export declare function rememberShellNavHeight(product: string, height: number): void;
|
|
64
70
|
/** Retient le produit affiché (`AppShell` le fait), pour que l'accueil d'`app.hgdc.ch` y renvoie. */
|
package/dist/shell-memory.js
CHANGED
|
@@ -18,6 +18,8 @@ export const SHELL_ORG_KEY = "hgdc-shell:org";
|
|
|
18
18
|
export const SHELL_NAV_KEY_PREFIX = "hgdc-shell:nav:";
|
|
19
19
|
/** Dernier produit ouvert (son mot), en `localStorage` : l'accueil d'`app.hgdc.ch` y renvoie. */
|
|
20
20
|
export const SHELL_LAST_PRODUCT_KEY = "hgdc-shell:last";
|
|
21
|
+
/** Slug de la dernière organisation ouverte, le même pour tous les modules : Basalte est un seul produit (ADR 0019 de la famille). */
|
|
22
|
+
export const SHELL_LAST_ORG_KEY = "hgdc-shell:last-org";
|
|
21
23
|
/**
|
|
22
24
|
* Applique la mémoire de la coque sur `<html>` : `data-sidebar="rail"`, `data-hgdc-product`
|
|
23
25
|
* (le produit de l'adresse), `data-hgdc-org` et les variables `--hgdc-org-initials`,
|
|
@@ -150,8 +152,26 @@ export function forgetShellOrganization() {
|
|
|
150
152
|
if (!win)
|
|
151
153
|
return;
|
|
152
154
|
storageSet(SHELL_ORG_KEY, null);
|
|
155
|
+
storageSet(SHELL_LAST_ORG_KEY, null);
|
|
153
156
|
shellBoot(SHELL_BOOT_CONFIG, win);
|
|
154
157
|
}
|
|
158
|
+
/** Retient l'organisation ouverte : à appeler sur la page d'une organisation, jamais pour la démo. */
|
|
159
|
+
export function rememberLastOrganization(slug) {
|
|
160
|
+
if (browser())
|
|
161
|
+
storageSet(SHELL_LAST_ORG_KEY, slug);
|
|
162
|
+
}
|
|
163
|
+
/** Slug de la dernière organisation ouverte dans un module. À comparer aux organisations de la personne. */
|
|
164
|
+
export function lastOrganization() {
|
|
165
|
+
const win = browser();
|
|
166
|
+
if (!win)
|
|
167
|
+
return null;
|
|
168
|
+
try {
|
|
169
|
+
return win.localStorage.getItem(SHELL_LAST_ORG_KEY);
|
|
170
|
+
}
|
|
171
|
+
catch {
|
|
172
|
+
return null;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
155
175
|
/** Retient la hauteur de la navigation d'un produit (`AppShell` le fait après l'affichage). */
|
|
156
176
|
export function rememberShellNavHeight(product, height) {
|
|
157
177
|
if (!browser() || !(height > 0))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hgdc/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.69.1",
|
|
4
4
|
"description": "Interface de la H Collection : jetons de la DA, thèmes, polices et composants.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"homepage": "https://github.com/hugogebel-boop/hgdc-kit/tree/main/packages/ui#readme",
|