@egen-civitas/esm-styleguide 1.13.1 → 1.15.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/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @egen-civitas/esm-styleguide
2
2
 
3
+ ## 1.15.0
4
+
5
+ ### Minor Changes
6
+
7
+ - af95904: Rail gauche : options globales avec sous-options.
8
+
9
+ - `ToolWindowMeta.global` : une extension du slot `shell-rail-left-slot` (ou `shell-rail-bottom-slot`) déclarée avec `meta.global: true` reste affichée dans le rail quelle que soit l'app active, comme le rail droit. Sans ce drapeau, le comportement est inchangé (seules les extensions de l'app active apparaissent).
10
+ - Nouveau composant `SectionNavPanel` (`section`) : contenu prêt à l'emploi d'une option globale. Il liste, dans la zone gauche, les sous-options d'une section (entrées `NavEntryMeta` déclarées par l'app sur `topbar-level2-nav`), regroupées par `group`, avec icône, et navigue vers la route de la sous-option au clic ; la sous-option de la page courante est marquée active. La zone centrale se met à jour par la navigation habituelle.
11
+ - Liste blanche d'icônes du plan de travail étendue (`Calendar`, `CalendarCheck`, `Compass`, `Contact`, `FileCheck`, `FileText`, `Globe`, `Layers`, `Radio`, `Star`, `Zap`).
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [af95904]
16
+ - @egen-civitas/esm-extensions@1.4.0
17
+
18
+ ## 1.14.0
19
+
20
+ ### Minor Changes
21
+
22
+ - 23488df: Scrollbars invisibles dans toutes les apps et tous les composants (le défilement reste intact). Règle globale dans la feuille de style du shell, avec `!important` pour neutraliser aussi les réglages locaux (`scrollbar-thin`, `scrollbar-thumb-*`, Carbon). Exception ponctuelle : attribut `data-scrollbar="visible"` sur l'élément concerné.
23
+
24
+ ## 1.13.2
25
+
26
+ ### Patch Changes
27
+
28
+ - 2a9541f: Plan de travail du shell : chaque racine (rails gauche/droit, zones gauche/droite/bas) est maintenant décorée par `egenComponentDecorator`. Avant, `renderWorkbench` montait `createRoot(...).render(<ToolWindowZone />)` sans `ComponentContext` : dès qu'on choisissait un outil dans un rail, la zone rendait son `ExtensionSlot` et levait « ComponentContext has not been provided. This should come from @egen-civitas/esm-react-utils ». Les composants du plan de travail ont aussi accès au namespace i18n `@egen-civitas/esm-styleguide`, à SWR et à la garde d'erreur, comme les autres apps. Test de régression : `workbench.render.test.tsx` (échoue sans le correctif). L'app-shell est republié car il embarque le styleguide.
29
+
3
30
  ## 1.13.1
4
31
 
5
32
  ### Patch Changes
@@ -5,6 +5,28 @@ html {
5
5
  scroll-behavior: smooth;
6
6
  }
7
7
 
8
+ // =============================================================================
9
+ // SCROLLBARS — Invisibles partout (toutes les apps, tous les composants)
10
+ //
11
+ // Le défilement (molette, tactile, clavier, trackpad) reste intact : seule la barre est
12
+ // masquée. `!important` est volontaire : il neutralise aussi les réglages locaux des apps
13
+ // (`scrollbar-thin`, `scrollbar-thumb-*`, styles Carbon) pour qu'aucune barre ne réapparaisse.
14
+ //
15
+ // Pour un élément qui doit exceptionnellement garder sa barre : `data-scrollbar="visible"`.
16
+ // Pour passer à des barres personnalisées plus tard, ne modifier que ce bloc.
17
+ // =============================================================================
18
+
19
+ *:not([data-scrollbar='visible']) {
20
+ scrollbar-width: none !important; // Firefox, Chrome 121+, Safari 18.2+
21
+ -ms-overflow-style: none !important; // anciens Edge / IE
22
+ }
23
+
24
+ *:not([data-scrollbar='visible'])::-webkit-scrollbar {
25
+ display: none !important; // anciens Chrome / Safari
26
+ width: 0 !important;
27
+ height: 0 !important;
28
+ }
29
+
8
30
  // =============================================================================
9
31
  // LAYOUT PUBLIC — Routes sans navigation primaire (landing, login, suspended)
10
32
  //
@@ -7,4 +7,5 @@ export * from './workbench-icons.js';
7
7
  export * from './workbench.render.js';
8
8
  export * from './workbench.store.js';
9
9
  export * from './workbench-badges.js';
10
+ export * from './section-nav-panel.component.js';
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/workbench/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/workbench/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kCAAkC,CAAC"}
@@ -7,3 +7,4 @@ export * from "./workbench-icons.js";
7
7
  export * from "./workbench.render.js";
8
8
  export * from "./workbench.store.js";
9
9
  export * from "./workbench-badges.js";
10
+ export * from "./section-nav-panel.component.js";
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ export interface SectionNavPanelProps {
3
+ /** Section (`NavEntryMeta.section`) dont le panneau liste les sous-options. */
4
+ section: string;
5
+ }
6
+ /**
7
+ * Contenu d'une option globale du rail gauche : liste les sous-options (entrées `NavEntryMeta`
8
+ * de la `section`, déclarées par l'app sur le slot `topbar-level2-nav`), regroupées par `group`.
9
+ * Un clic navigue vers la route de la sous-option : la zone centrale se met à jour, la zone
10
+ * gauche reste ouverte.
11
+ *
12
+ * À utiliser comme composant d'une extension du slot `shell-rail-left-slot` déclarée avec
13
+ * `meta.global: true` (voir `ToolWindowMeta`).
14
+ */
15
+ export declare function SectionNavPanel({ section }: SectionNavPanelProps): React.JSX.Element | null;
16
+ //# sourceMappingURL=section-nav-panel.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"section-nav-panel.component.d.ts","sourceRoot":"","sources":["../../src/workbench/section-nav-panel.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAqB5D,MAAM,WAAW,oBAAoB;IACnC,+EAA+E;IAC/E,OAAO,EAAE,MAAM,CAAC;CACjB;AA6BD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,EAAE,OAAO,EAAE,EAAE,oBAAoB,4BA0EhE"}
@@ -0,0 +1,134 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React, { useEffect, useMemo, useState } from "react";
3
+ import { isNavEntryMeta, TOPBAR_LEVEL2_NAV_SLOT } from "@egen-civitas/esm-extensions";
4
+ import { navigate } from "@egen-civitas/esm-navigation";
5
+ import { useAssignedExtensions } from "@egen-civitas/esm-react-utils";
6
+ import { translateFrom } from "@egen-civitas/esm-translations";
7
+ import { resolveWorkbenchIcon } from "./workbench-icons.js";
8
+ import styles from "./section-nav-panel.module.scss";
9
+ const text = (moduleName, key, fallback)=>key ? translateFrom(moduleName, key, fallback) : fallback;
10
+ /** Route courante, relative à la base SPA, sans slash de tête ni de queue (ex. `annuaire/contacts`). */ function currentRoute() {
11
+ const base = window.getEgenSpaBase().replace(/\/$/, '');
12
+ const path = window.location.pathname;
13
+ return (path.startsWith(base) ? path.slice(base.length) : path).replace(/^\/+|\/+$/g, '');
14
+ }
15
+ const matches = (route, current)=>current === route || current.startsWith(`${route}/`);
16
+ function useCurrentRoute() {
17
+ const [route, setRoute] = useState(currentRoute);
18
+ useEffect(()=>{
19
+ const update = ()=>setRoute(currentRoute());
20
+ window.addEventListener('single-spa:routing-event', update);
21
+ window.addEventListener('popstate', update);
22
+ update();
23
+ return ()=>{
24
+ window.removeEventListener('single-spa:routing-event', update);
25
+ window.removeEventListener('popstate', update);
26
+ };
27
+ }, []);
28
+ return route;
29
+ }
30
+ /**
31
+ * Contenu d'une option globale du rail gauche : liste les sous-options (entrées `NavEntryMeta`
32
+ * de la `section`, déclarées par l'app sur le slot `topbar-level2-nav`), regroupées par `group`.
33
+ * Un clic navigue vers la route de la sous-option : la zone centrale se met à jour, la zone
34
+ * gauche reste ouverte.
35
+ *
36
+ * À utiliser comme composant d'une extension du slot `shell-rail-left-slot` déclarée avec
37
+ * `meta.global: true` (voir `ToolWindowMeta`).
38
+ */ export function SectionNavPanel({ section }) {
39
+ const assigned = useAssignedExtensions(TOPBAR_LEVEL2_NAV_SLOT);
40
+ const route = useCurrentRoute();
41
+ const [selected, setSelected] = useState(null);
42
+ const groups = useMemo(()=>{
43
+ const byKey = new Map();
44
+ for (const extension of assigned){
45
+ if (!isNavEntryMeta(extension.meta) || extension.meta.section !== section) continue;
46
+ const meta = extension.meta;
47
+ const key = meta.group ?? '';
48
+ let group = byKey.get(key);
49
+ if (!group) {
50
+ const label = meta.group ? meta.groupLabel ?? meta.group : undefined;
51
+ group = {
52
+ key,
53
+ label: label ? text(extension.moduleName, meta.groupLabelKey, label) : undefined,
54
+ entries: []
55
+ };
56
+ byKey.set(key, group);
57
+ }
58
+ group.entries.push({
59
+ name: extension.name,
60
+ moduleName: extension.moduleName,
61
+ meta
62
+ });
63
+ }
64
+ return [
65
+ ...byKey.values()
66
+ ];
67
+ }, [
68
+ assigned,
69
+ section
70
+ ]);
71
+ // Sous-option active : la route la plus spécifique qui correspond ; à route égale (plusieurs
72
+ // sous-options sur la même page), celle qui vient d'être cliquée, sinon la première.
73
+ const activeName = useMemo(()=>{
74
+ const candidates = groups.flatMap((group)=>group.entries).filter((entry)=>matches(entry.meta.route, route));
75
+ if (candidates.length === 0) return null;
76
+ const longest = Math.max(...candidates.map((entry)=>entry.meta.route.length));
77
+ const best = candidates.filter((entry)=>entry.meta.route.length === longest);
78
+ return (best.find((entry)=>entry.name === selected) ?? best[0]).name;
79
+ }, [
80
+ groups,
81
+ route,
82
+ selected
83
+ ]);
84
+ if (groups.length === 0) return null;
85
+ return /*#__PURE__*/ _jsx("nav", {
86
+ className: styles.panel,
87
+ "data-testid": `section-nav-${section}`,
88
+ children: groups.map((group)=>/*#__PURE__*/ _jsxs("div", {
89
+ className: styles.group,
90
+ role: "group",
91
+ "aria-label": group.label,
92
+ children: [
93
+ group.label && /*#__PURE__*/ _jsx("h3", {
94
+ className: styles.groupTitle,
95
+ children: group.label
96
+ }),
97
+ /*#__PURE__*/ _jsx("ul", {
98
+ className: styles.list,
99
+ children: group.entries.map((entry)=>{
100
+ const Icon = resolveWorkbenchIcon(entry.meta.icon);
101
+ const label = text(entry.moduleName, entry.meta.labelKey, entry.meta.label);
102
+ const description = entry.meta.description ? text(entry.moduleName, entry.meta.descriptionKey, entry.meta.description) : undefined;
103
+ return /*#__PURE__*/ _jsx("li", {
104
+ children: /*#__PURE__*/ _jsxs("button", {
105
+ type: "button",
106
+ className: styles.entry,
107
+ "data-active": entry.name === activeName,
108
+ "aria-current": entry.name === activeName ? 'page' : undefined,
109
+ title: description,
110
+ onClick: ()=>{
111
+ setSelected(entry.name);
112
+ navigate({
113
+ to: `\${egenSpaBase}/${entry.meta.route}`
114
+ });
115
+ },
116
+ children: [
117
+ Icon && /*#__PURE__*/ _jsx(Icon, {
118
+ size: 16,
119
+ "aria-hidden": "true",
120
+ className: styles.entryIcon
121
+ }),
122
+ /*#__PURE__*/ _jsx("span", {
123
+ className: styles.entryLabel,
124
+ children: label
125
+ })
126
+ ]
127
+ })
128
+ }, entry.name);
129
+ })
130
+ })
131
+ ]
132
+ }, group.key))
133
+ });
134
+ }
@@ -0,0 +1,80 @@
1
+ // Panneau de sous-options d'une option globale du rail gauche (zone gauche du plan de travail).
2
+ .panel {
3
+ display: flex;
4
+ flex-direction: column;
5
+ gap: 0.75rem;
6
+ box-sizing: border-box;
7
+ padding: 0.5rem;
8
+ }
9
+
10
+ .group {
11
+ display: flex;
12
+ flex-direction: column;
13
+ gap: 0.25rem;
14
+ }
15
+
16
+ .groupTitle {
17
+ margin: 0;
18
+ padding: 0 0.5rem;
19
+ color: var(--colors-surface-muted-foreground, #9ca3af);
20
+ font-size: 0.6875rem;
21
+ font-weight: 600;
22
+ letter-spacing: 0.04em;
23
+ text-transform: uppercase;
24
+ }
25
+
26
+ .list {
27
+ display: flex;
28
+ flex-direction: column;
29
+ gap: 0.125rem;
30
+ margin: 0;
31
+ padding: 0;
32
+ list-style: none;
33
+ }
34
+
35
+ .entry {
36
+ display: flex;
37
+ align-items: center;
38
+ gap: 0.5rem;
39
+ box-sizing: border-box;
40
+ width: 100%;
41
+ padding: 0.4375rem 0.5rem;
42
+ border: 0;
43
+ border-radius: 0.5rem;
44
+ background: transparent;
45
+ color: var(--colors-surface-muted-foreground, #9ca3af);
46
+ font: inherit;
47
+ font-size: 0.8125rem;
48
+ text-align: left;
49
+ cursor: pointer;
50
+ transition:
51
+ background-color 120ms ease,
52
+ color 120ms ease;
53
+
54
+ &:hover {
55
+ background: var(--colors-surface-translucent-hover, rgb(255 255 255 / 10%));
56
+ color: var(--colors-surface-foreground, #fff);
57
+ }
58
+
59
+ &:focus-visible {
60
+ outline: 2px solid var(--colors-border-ring, var(--colors-primary-500, #3b82f6));
61
+ outline-offset: 1px;
62
+ }
63
+
64
+ &[data-active='true'] {
65
+ background: var(--colors-surface-translucent-hover, rgb(255 255 255 / 14%));
66
+ color: var(--colors-surface-foreground, #fff);
67
+ font-weight: 600;
68
+ }
69
+ }
70
+
71
+ .entryIcon {
72
+ flex: 0 0 auto;
73
+ }
74
+
75
+ .entryLabel {
76
+ min-width: 0;
77
+ overflow: hidden;
78
+ text-overflow: ellipsis;
79
+ white-space: nowrap;
80
+ }
@@ -10,7 +10,8 @@ export declare function toolWindowTitle({ moduleName, meta }: ToolWindow): strin
10
10
  /**
11
11
  * Fenêtres d'outils d'une zone, triées par `meta.order` (puis ordre du slot).
12
12
  *
13
- * Zones `left` et `bottom` : uniquement celles de l'app active (le rail change avec l'app).
13
+ * Zones `left` et `bottom` : celles de l'app active (le rail change avec l'app) et celles qui
14
+ * déclarent `meta.global` (toujours présentes).
14
15
  * Zone `right` : globale, toujours toutes les extensions déclarées.
15
16
  */
16
17
  export declare function useToolWindows(anchor: ToolWindowAnchor): ToolWindow[];
@@ -1 +1 @@
1
- {"version":3,"file":"use-tool-windows.d.ts","sourceRoot":"","sources":["../../src/workbench/use-tool-windows.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACpB,MAAM,8BAA8B,CAAC;AAKtC,MAAM,WAAW,UAAU;IACzB,4EAA4E;IAC5E,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,cAAc,CAAC;CACtB;AAED,sFAAsF;AACtF,wBAAgB,eAAe,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,UAAU,GAAG,MAAM,CAExE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,gBAAgB,GAAG,UAAU,EAAE,CAsBrE"}
1
+ {"version":3,"file":"use-tool-windows.d.ts","sourceRoot":"","sources":["../../src/workbench/use-tool-windows.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACpB,MAAM,8BAA8B,CAAC;AAKtC,MAAM,WAAW,UAAU;IACzB,4EAA4E;IAC5E,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,cAAc,CAAC;CACtB;AAED,sFAAsF;AACtF,wBAAgB,eAAe,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,UAAU,GAAG,MAAM,CAExE;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,gBAAgB,GAAG,UAAU,EAAE,CA2BrE"}
@@ -9,7 +9,8 @@ import { useActiveAppModules } from "./use-active-app-modules.js";
9
9
  /**
10
10
  * Fenêtres d'outils d'une zone, triées par `meta.order` (puis ordre du slot).
11
11
  *
12
- * Zones `left` et `bottom` : uniquement celles de l'app active (le rail change avec l'app).
12
+ * Zones `left` et `bottom` : celles de l'app active (le rail change avec l'app) et celles qui
13
+ * déclarent `meta.global` (toujours présentes).
13
14
  * Zone `right` : globale, toujours toutes les extensions déclarées.
14
15
  */ export function useToolWindows(anchor) {
15
16
  const assigned = useAssignedExtensions(TOOL_WINDOW_SLOTS[anchor]);
@@ -17,7 +18,7 @@ import { useActiveAppModules } from "./use-active-app-modules.js";
17
18
  return useMemo(()=>assigned.map((extension, index)=>({
18
19
  extension,
19
20
  index
20
- })).filter(({ extension })=>isToolWindowMeta(extension.meta)).filter(({ extension })=>anchor === 'right' || activeModules.has(extension.moduleName)).sort((a, b)=>{
21
+ })).filter(({ extension })=>isToolWindowMeta(extension.meta)).filter(({ extension })=>anchor === 'right' || extension.meta.global === true || activeModules.has(extension.moduleName)).sort((a, b)=>{
21
22
  const orderA = a.extension.meta.order ?? a.index;
22
23
  const orderB = b.extension.meta.order ?? b.index;
23
24
  return orderA - orderB || a.index - b.index;
@@ -1 +1 @@
1
- {"version":3,"file":"workbench-icons.d.ts","sourceRoot":"","sources":["../../src/workbench/workbench-icons.ts"],"names":[],"mappings":"AAAA,OAAO,EAoBL,KAAK,UAAU,EAChB,MAAM,cAAc,CAAC;AAEtB;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAoBhE,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAE1E"}
1
+ {"version":3,"file":"workbench-icons.d.ts","sourceRoot":"","sources":["../../src/workbench/workbench-icons.ts"],"names":[],"mappings":"AAAA,OAAO,EA+BL,KAAK,UAAU,EAChB,MAAM,cAAc,CAAC;AAEtB;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CA+BhE,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAE1E"}
@@ -1,4 +1,4 @@
1
- import { BookOpen, Bell, Bot, Building2, CalendarDays, CircleHelp, Folder, FolderTree, House, Info, LayoutGrid, ListTree, MapPin, Megaphone, Newspaper, Search, Settings, Terminal, Users } from "lucide-react";
1
+ import { BookOpen, Bell, Bot, Building2, CalendarDays, CircleHelp, Folder, FolderTree, House, Info, LayoutGrid, ListTree, MapPin, Megaphone, Newspaper, Search, Settings, Terminal, Users, Calendar, CalendarCheck, Compass, Contact, FileCheck, FileText, Globe, Layers, Radio, Star, Zap } from "lucide-react";
2
2
  /**
3
3
  * Icônes autorisées pour `ToolWindowMeta.icon` (liste blanche : une app ne peut pas faire
4
4
  * charger au shell une icône arbitraire). Un nom inconnu affiche l'initiale du titre.
@@ -21,7 +21,18 @@ import { BookOpen, Bell, Bot, Building2, CalendarDays, CircleHelp, Folder, Folde
21
21
  Search,
22
22
  Settings,
23
23
  Terminal,
24
- Users
24
+ Users,
25
+ Calendar,
26
+ CalendarCheck,
27
+ Compass,
28
+ Contact,
29
+ FileCheck,
30
+ FileText,
31
+ Globe,
32
+ Layers,
33
+ Radio,
34
+ Star,
35
+ Zap
25
36
  };
26
37
  export function resolveWorkbenchIcon(name) {
27
38
  return name ? WORKBENCH_ICONS[name] : undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"workbench.render.d.ts","sourceRoot":"","sources":["../../src/workbench/workbench.render.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;CAChC;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,gBAAgB,QAMzG"}
1
+ {"version":3,"file":"workbench.render.d.ts","sourceRoot":"","sources":["../../src/workbench/workbench.render.tsx"],"names":[],"mappings":"AAwBA,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,WAAW,GAAG,IAAI,CAAC;CAChC;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,gBAAgB,QAMzG"}
@@ -1,8 +1,23 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  /** @module @category Workbench */ import React from "react";
3
3
  import { createRoot } from "react-dom/client";
4
+ import { egenComponentDecorator } from "@egen-civitas/esm-react-utils";
4
5
  import { LeftRail, RightRail } from "./tool-window-rail.component.js";
5
6
  import { ToolWindowZone } from "./tool-window-zone.component.js";
7
+ /**
8
+ * Le shell monte chaque morceau du plan de travail dans sa propre racine React, hors de toute app :
9
+ * sans décorateur, ces racines n'ont ni `ComponentContext` (les `ExtensionSlot` de `ToolWindowZone`
10
+ * levaient « ComponentContext has not been provided » dès qu'on ouvrait une fenêtre d'outils),
11
+ * ni namespace i18n, ni garde d'erreur. On les décore donc comme n'importe quelle app.
12
+ * `strictMode` est désactivé : ce sont des éléments de châssis du shell, montés une seule fois.
13
+ */ const decoratorOptions = {
14
+ moduleName: '@egen-civitas/esm-styleguide',
15
+ featureName: 'workbench',
16
+ strictMode: false
17
+ };
18
+ const DecoratedLeftRail = egenComponentDecorator(decoratorOptions)(LeftRail);
19
+ const DecoratedRightRail = egenComponentDecorator(decoratorOptions)(RightRail);
20
+ const DecoratedToolWindowZone = egenComponentDecorator(decoratorOptions)(ToolWindowZone);
6
21
  /**
7
22
  * Monte le plan de travail du shell : rails gauche/droit fixes et zones gauche, droite, bas
8
23
  * redimensionnables. À utiliser uniquement par le shell, une seule fois ; les apps y déclarent
@@ -10,15 +25,15 @@ import { ToolWindowZone } from "./tool-window-zone.component.js";
10
25
  *
11
26
  * Tant qu'aucune extension n'est déclarée, les rails sont vides et les zones repliées.
12
27
  */ export function renderWorkbench({ railLeft, railRight, zoneLeft, zoneRight, zoneBottom }) {
13
- if (railLeft) createRoot(railLeft).render(/*#__PURE__*/ _jsx(LeftRail, {}));
14
- if (railRight) createRoot(railRight).render(/*#__PURE__*/ _jsx(RightRail, {}));
15
- if (zoneLeft) createRoot(zoneLeft).render(/*#__PURE__*/ _jsx(ToolWindowZone, {
28
+ if (railLeft) createRoot(railLeft).render(/*#__PURE__*/ _jsx(DecoratedLeftRail, {}));
29
+ if (railRight) createRoot(railRight).render(/*#__PURE__*/ _jsx(DecoratedRightRail, {}));
30
+ if (zoneLeft) createRoot(zoneLeft).render(/*#__PURE__*/ _jsx(DecoratedToolWindowZone, {
16
31
  anchor: "left"
17
32
  }));
18
- if (zoneRight) createRoot(zoneRight).render(/*#__PURE__*/ _jsx(ToolWindowZone, {
33
+ if (zoneRight) createRoot(zoneRight).render(/*#__PURE__*/ _jsx(DecoratedToolWindowZone, {
19
34
  anchor: "right"
20
35
  }));
21
- if (zoneBottom) createRoot(zoneBottom).render(/*#__PURE__*/ _jsx(ToolWindowZone, {
36
+ if (zoneBottom) createRoot(zoneBottom).render(/*#__PURE__*/ _jsx(DecoratedToolWindowZone, {
22
37
  anchor: "bottom"
23
38
  }));
24
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@egen-civitas/esm-styleguide",
3
- "version": "1.13.1",
3
+ "version": "1.15.0",
4
4
  "license": "MPL-2.0",
5
5
  "description": "The styleguide for Egen SPA",
6
6
  "main": "dist/internal.js",
@@ -98,7 +98,7 @@
98
98
  "@egen-civitas/esm-config": "^1.0.0",
99
99
  "@egen-civitas/esm-data-api": "^1.0.2",
100
100
  "@egen-civitas/esm-error-handling": "^1.0.0",
101
- "@egen-civitas/esm-extensions": "^1.3.0",
101
+ "@egen-civitas/esm-extensions": "^1.4.0",
102
102
  "@egen-civitas/esm-globals": "^1.0.0",
103
103
  "@egen-civitas/esm-navigation": "^1.0.2",
104
104
  "@egen-civitas/esm-react-utils": "^1.0.5",
@@ -121,7 +121,7 @@
121
121
  "@egen-civitas/esm-data-api": "^1.0.2",
122
122
  "@egen-civitas/esm-error-handling": "^1.0.0",
123
123
  "@egen-civitas/esm-expression-evaluator": "^1.0.0",
124
- "@egen-civitas/esm-extensions": "^1.3.0",
124
+ "@egen-civitas/esm-extensions": "^1.4.0",
125
125
  "@egen-civitas/esm-globals": "^1.0.0",
126
126
  "@egen-civitas/esm-navigation": "^1.0.2",
127
127
  "@egen-civitas/esm-react-utils": "^1.0.5",