@egen-civitas/esm-styleguide 2.0.0 → 2.1.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/CHANGELOG.md +12 -0
- package/dist/internal.d.ts +1 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +1 -0
- package/dist/workbench/index.d.ts +1 -0
- package/dist/workbench/index.d.ts.map +1 -1
- package/dist/workbench/index.js +1 -0
- package/dist/workbench/tool-window-header.component.d.ts +17 -0
- package/dist/workbench/tool-window-header.component.d.ts.map +1 -0
- package/dist/workbench/tool-window-header.component.js +29 -0
- package/dist/workbench/tool-window-zone.component.d.ts.map +1 -1
- package/dist/workbench/tool-window-zone.component.js +5 -0
- package/dist/workbench/workbench.module.scss +19 -0
- package/mock.tsx +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @egen-civitas/esm-styleguide
|
|
2
2
|
|
|
3
|
+
## 2.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b6c977c: Correction : `Section`, `SectionAction`, `SectionGrid` (et leurs parties) n'étaient exportés que par `public.ts` ; le point d'entrée réel du package (`internal.ts`) ne les exposait pas, donc `import { Section } from '@egen-civitas/esm-framework'` valait `undefined` à l'exécution et ne typait pas. Les deux points d'entrée les exportent désormais, avec un test garde-fou.
|
|
8
|
+
|
|
9
|
+
## 2.1.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- d5c883a: Zones : l'en-tête expose un emplacement d'actions entre le titre et le bouton de fermeture, alimenté par le composant `ToolWindowHeader` (portail) depuis le contenu d'une fenêtre d'outils. Rendu sur place hors zone.
|
|
14
|
+
|
|
3
15
|
## 2.0.0
|
|
4
16
|
|
|
5
17
|
### Major Changes
|
package/dist/internal.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export * from './dialogs/index.js';
|
|
|
41
41
|
export * from './selections/index.js';
|
|
42
42
|
export * from './carousel/index.js';
|
|
43
43
|
export * from './content-section/index.js';
|
|
44
|
+
export * from './section/index.js';
|
|
44
45
|
export * from './hero-mosaic/index.js';
|
|
45
46
|
export * from './top-bar/index.js';
|
|
46
47
|
export * from './sites/index.js';
|
package/dist/internal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qCAAqC,CAAC;AACpD,cAAc,iCAAiC,CAAC;AAChD,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sDAAsD,CAAC;AACrE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,oDAAoD,CAAC;AACnE,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,mCAAmC,CAAC;AAClD,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uDAAuD,CAAC;AACtE,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,c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AAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uDAAuD,CAAC;AACtE,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC"}
|
package/dist/internal.js
CHANGED
|
@@ -41,6 +41,7 @@ export * from "./dialogs/index.js";
|
|
|
41
41
|
export * from "./selections/index.js";
|
|
42
42
|
export * from "./carousel/index.js";
|
|
43
43
|
export * from "./content-section/index.js";
|
|
44
|
+
export * from "./section/index.js";
|
|
44
45
|
export * from "./hero-mosaic/index.js";
|
|
45
46
|
export * from "./top-bar/index.js";
|
|
46
47
|
export * from "./sites/index.js";
|
|
@@ -2,6 +2,7 @@ export * from './use-active-app-modules.js';
|
|
|
2
2
|
export * from './use-tool-windows.js';
|
|
3
3
|
export * from './tool-window-rail.component.js';
|
|
4
4
|
export * from './tool-window-zone.component.js';
|
|
5
|
+
export * from './tool-window-header.component.js';
|
|
5
6
|
export * from './splitter.component.js';
|
|
6
7
|
export * from './workbench-icons.js';
|
|
7
8
|
export * from './workbench.render.js';
|
|
@@ -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;AACtC,cAAc,kCAAkC,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,mCAAmC,CAAC;AAClD,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kCAAkC,CAAC"}
|
package/dist/workbench/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export * from "./use-active-app-modules.js";
|
|
|
2
2
|
export * from "./use-tool-windows.js";
|
|
3
3
|
export * from "./tool-window-rail.component.js";
|
|
4
4
|
export * from "./tool-window-zone.component.js";
|
|
5
|
+
export * from "./tool-window-header.component.js";
|
|
5
6
|
export * from "./splitter.component.js";
|
|
6
7
|
export * from "./workbench-icons.js";
|
|
7
8
|
export * from "./workbench.render.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
/** Attribut de l'emplacement d'en-tête d'une zone (entre le titre et le bouton de fermeture). */
|
|
3
|
+
export declare const TOOL_WINDOW_HEADER_ATTRIBUTE = "data-tool-window-header";
|
|
4
|
+
export interface ToolWindowHeaderProps {
|
|
5
|
+
/** Actions et contrôles de la fenêtre d'outils (boutons, recherche, filtres…). */
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Place `children` dans l'en-tête de la zone qui affiche la fenêtre d'outils, à droite du titre et à
|
|
10
|
+
* gauche du bouton de fermeture : la fenêtre n'a ainsi pas à réserver une barre d'outils dans son
|
|
11
|
+
* propre contenu. Les enfants restent rendus par la fenêtre (son état, ses contextes et ses
|
|
12
|
+
* gestionnaires d'événements) ; seul leur emplacement dans le DOM change.
|
|
13
|
+
*
|
|
14
|
+
* Hors d'une zone (Storybook, tests, rendu autonome), les enfants sont rendus sur place.
|
|
15
|
+
*/
|
|
16
|
+
export declare function ToolWindowHeader({ children }: ToolWindowHeaderProps): React.JSX.Element;
|
|
17
|
+
//# sourceMappingURL=tool-window-header.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-window-header.component.d.ts","sourceRoot":"","sources":["../../src/workbench/tool-window-header.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAqC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGjF,iGAAiG;AACjG,eAAO,MAAM,4BAA4B,4BAA4B,CAAC;AAEtE,MAAM,WAAW,qBAAqB;IACpC,kFAAkF;IAClF,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,EAAE,qBAAqB,qBAgBnE"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React, { useLayoutEffect, useRef, useState } from "react";
|
|
3
|
+
import { createPortal } from "react-dom";
|
|
4
|
+
/** Attribut de l'emplacement d'en-tête d'une zone (entre le titre et le bouton de fermeture). */ export const TOOL_WINDOW_HEADER_ATTRIBUTE = 'data-tool-window-header';
|
|
5
|
+
/**
|
|
6
|
+
* Place `children` dans l'en-tête de la zone qui affiche la fenêtre d'outils, à droite du titre et à
|
|
7
|
+
* gauche du bouton de fermeture : la fenêtre n'a ainsi pas à réserver une barre d'outils dans son
|
|
8
|
+
* propre contenu. Les enfants restent rendus par la fenêtre (son état, ses contextes et ses
|
|
9
|
+
* gestionnaires d'événements) ; seul leur emplacement dans le DOM change.
|
|
10
|
+
*
|
|
11
|
+
* Hors d'une zone (Storybook, tests, rendu autonome), les enfants sont rendus sur place.
|
|
12
|
+
*/ export function ToolWindowHeader({ children }) {
|
|
13
|
+
const markerRef = useRef(null);
|
|
14
|
+
// undefined : pas encore résolu · null : hors zone (rendu sur place) · élément : emplacement de la zone.
|
|
15
|
+
const [slot, setSlot] = useState(undefined);
|
|
16
|
+
useLayoutEffect(()=>{
|
|
17
|
+
const zone = markerRef.current?.closest('aside[data-anchor]');
|
|
18
|
+
setSlot(zone?.querySelector(`[${TOOL_WINDOW_HEADER_ATTRIBUTE}]`) ?? null);
|
|
19
|
+
}, []);
|
|
20
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
21
|
+
children: [
|
|
22
|
+
/*#__PURE__*/ _jsx("span", {
|
|
23
|
+
ref: markerRef,
|
|
24
|
+
hidden: true
|
|
25
|
+
}),
|
|
26
|
+
slot === undefined ? null : slot === null ? children : /*#__PURE__*/ createPortal(children, slot)
|
|
27
|
+
]
|
|
28
|
+
});
|
|
29
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-window-zone.component.d.ts","sourceRoot":"","sources":["../../src/workbench/tool-window-zone.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwF,MAAM,OAAO,CAAC;AAC7G,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-window-zone.component.d.ts","sourceRoot":"","sources":["../../src/workbench/tool-window-zone.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwF,MAAM,OAAO,CAAC;AAC7G,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAwCxF,UAAU,mBAAmB;IAC3B,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,EAAE,mBAAmB,qBA4F7D"}
|
|
@@ -4,6 +4,7 @@ import { TOOL_WINDOW_SLOTS } from "@egen-civitas/esm-extensions";
|
|
|
4
4
|
import { ComponentContext, ExtensionSlot, useStore } from "@egen-civitas/esm-react-utils";
|
|
5
5
|
import { X } from "lucide-react";
|
|
6
6
|
import { Splitter } from "./splitter.component.js";
|
|
7
|
+
import { TOOL_WINDOW_HEADER_ATTRIBUTE } from "./tool-window-header.component.js";
|
|
7
8
|
import { toolWindowTitle, useToolWindows } from "./use-tool-windows.js";
|
|
8
9
|
import { closeToolWindow, workbenchStore } from "./workbench.store.js";
|
|
9
10
|
import styles from "./workbench.module.scss";
|
|
@@ -109,6 +110,10 @@ const EXIT_CLASS = {
|
|
|
109
110
|
className: styles.zoneTitle,
|
|
110
111
|
children: title
|
|
111
112
|
}),
|
|
113
|
+
/*#__PURE__*/ _jsx("div", {
|
|
114
|
+
className: styles.zoneHeaderTools,
|
|
115
|
+
[TOOL_WINDOW_HEADER_ATTRIBUTE]: ''
|
|
116
|
+
}),
|
|
112
117
|
/*#__PURE__*/ _jsx("button", {
|
|
113
118
|
type: "button",
|
|
114
119
|
className: styles.zoneClose,
|
|
@@ -164,6 +164,8 @@ $gap: var(--egen-workbench-gap, 0.375rem);
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
.zoneTitle {
|
|
167
|
+
flex: 0 1 auto;
|
|
168
|
+
max-width: 50%;
|
|
167
169
|
margin: 0;
|
|
168
170
|
overflow: hidden;
|
|
169
171
|
font-size: 0.8125rem;
|
|
@@ -173,7 +175,24 @@ $gap: var(--egen-workbench-gap, 0.375rem);
|
|
|
173
175
|
white-space: nowrap;
|
|
174
176
|
}
|
|
175
177
|
|
|
178
|
+
.zoneHeaderTools {
|
|
179
|
+
display: flex;
|
|
180
|
+
flex: 1 1 0;
|
|
181
|
+
align-items: center;
|
|
182
|
+
justify-content: flex-end;
|
|
183
|
+
gap: 0.375rem;
|
|
184
|
+
min-width: 0;
|
|
185
|
+
// Trop étroit : les actions défilent horizontalement plutôt que de repousser le titre ou la fermeture.
|
|
186
|
+
overflow-x: auto;
|
|
187
|
+
scrollbar-width: none;
|
|
188
|
+
|
|
189
|
+
&::-webkit-scrollbar {
|
|
190
|
+
display: none;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
176
194
|
.zoneClose {
|
|
195
|
+
flex: 0 0 auto;
|
|
177
196
|
display: inline-flex;
|
|
178
197
|
align-items: center;
|
|
179
198
|
justify-content: center;
|
package/mock.tsx
CHANGED
|
@@ -183,6 +183,7 @@ export const TableOfContentsIcon = () => <span>TableOfContentsIcon</span>;
|
|
|
183
183
|
export const TimeIcon = () => <span>TimeIcon</span>;
|
|
184
184
|
export const ToolsIcon = () => <span>ToolsIcon</span>;
|
|
185
185
|
export const TranslateIcon = () => <span>TranslateIcon</span>;
|
|
186
|
+
export const ToolWindowHeader = ({ children }: { children?: React.ReactNode }) => <>{children}</>;
|
|
186
187
|
export const TrashCanIcon = () => <span>TrashCanIcon</span>;
|
|
187
188
|
export const TreeViewAltIcon = () => <span>TreeViewAltIcon</span>;
|
|
188
189
|
export const UserAvatarIcon = () => <span>UserAvatarIcon</span>;
|