@egen-civitas/esm-styleguide 2.3.1 → 3.1.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 +51 -0
- package/dist/_all.scss +0 -1
- package/dist/_vars.scss +4 -4
- package/dist/assistant/index.d.ts +7 -0
- package/dist/assistant/index.d.ts.map +1 -1
- package/dist/assistant/index.js +5 -0
- package/dist/assistant/robot/README.md +47 -0
- package/dist/assistant/robot/Robot.d.ts +16 -0
- package/dist/assistant/robot/Robot.d.ts.map +1 -0
- package/dist/assistant/robot/Robot.js +159 -0
- package/dist/assistant/robot/RobotStage.d.ts +31 -0
- package/dist/assistant/robot/RobotStage.d.ts.map +1 -0
- package/dist/assistant/robot/RobotStage.js +250 -0
- package/dist/assistant/robot/clips.d.ts +62 -0
- package/dist/assistant/robot/clips.d.ts.map +1 -0
- package/dist/assistant/robot/clips.js +179 -0
- package/dist/assistant/robot/controller.d.ts +133 -0
- package/dist/assistant/robot/controller.d.ts.map +1 -0
- package/dist/assistant/robot/controller.js +522 -0
- package/dist/assistant/robot/gestures.d.ts +23 -0
- package/dist/assistant/robot/gestures.d.ts.map +1 -0
- package/dist/assistant/robot/gestures.js +1301 -0
- package/dist/assistant/robot/hands.d.ts +55 -0
- package/dist/assistant/robot/hands.d.ts.map +1 -0
- package/dist/assistant/robot/hands.js +121 -0
- package/dist/assistant/robot/ik.d.ts +34 -0
- package/dist/assistant/robot/ik.d.ts.map +1 -0
- package/dist/assistant/robot/ik.js +57 -0
- package/dist/assistant/robot/index.d.ts +18 -0
- package/dist/assistant/robot/index.d.ts.map +1 -0
- package/dist/assistant/robot/index.js +9 -0
- package/dist/assistant/robot/lazy.d.ts +8 -0
- package/dist/assistant/robot/lazy.d.ts.map +1 -0
- package/dist/assistant/robot/lazy.js +33 -0
- package/dist/assistant/robot/materials.d.ts +46 -0
- package/dist/assistant/robot/materials.d.ts.map +1 -0
- package/dist/assistant/robot/materials.js +101 -0
- package/dist/assistant/robot/parts/Body.d.ts +28 -0
- package/dist/assistant/robot/parts/Body.d.ts.map +1 -0
- package/dist/assistant/robot/parts/Body.js +368 -0
- package/dist/assistant/robot/parts/Head.d.ts +11 -0
- package/dist/assistant/robot/parts/Head.d.ts.map +1 -0
- package/dist/assistant/robot/parts/Head.js +210 -0
- package/dist/assistant/robot/parts/primitives.d.ts +36 -0
- package/dist/assistant/robot/parts/primitives.d.ts.map +1 -0
- package/dist/assistant/robot/parts/primitives.js +127 -0
- package/dist/assistant/robot/skeleton.d.ts +66 -0
- package/dist/assistant/robot/skeleton.d.ts.map +1 -0
- package/dist/assistant/robot/skeleton.js +266 -0
- package/dist/cards/card-header.component.d.ts +1 -1
- package/dist/cards/card-header.component.js +1 -1
- package/dist/cards/card-header.stories.js +1 -1
- package/dist/components/_general.scss +3 -3
- package/dist/config-schema.d.ts +0 -17
- package/dist/config-schema.d.ts.map +1 -1
- package/dist/config-schema.js +0 -25
- package/dist/datepicker/datepicker.stories.js +1 -1
- package/dist/empty-card/empty-card.stories.js +2 -2
- package/dist/error-state/error-state.stories.js +2 -2
- package/dist/icons/icon-registration.d.ts.map +1 -1
- package/dist/icons/icon-registration.js +0 -30
- package/dist/icons/icons.d.ts +4 -32
- package/dist/icons/icons.d.ts.map +1 -1
- package/dist/icons/icons.js +18 -148
- package/dist/index.js +0 -2
- package/dist/internal.d.ts +0 -3
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +0 -3
- package/dist/notifications/actionable-notification.stories.js +5 -5
- package/dist/notifications/notification.stories.js +5 -5
- package/dist/page-header/page-header.component.d.ts +1 -1
- package/dist/page-header/page-header.component.js +1 -1
- package/dist/pagination/pagination.stories.js +2 -2
- package/dist/pictograms/pictogram-registration.d.ts.map +1 -1
- package/dist/pictograms/pictogram-registration.js +2 -36
- package/dist/pictograms/pictograms.d.ts +2 -20
- package/dist/pictograms/pictograms.d.ts.map +1 -1
- package/dist/pictograms/pictograms.js +2 -139
- package/dist/public.d.ts +0 -3
- package/dist/public.d.ts.map +1 -1
- package/dist/public.js +0 -3
- package/dist/responsive-wrapper/responsive-wrapper.stories.js +1 -1
- package/dist/snackbars/snackbar.stories.js +1 -1
- package/dist/toasts/toast.stories.js +1 -1
- package/dist/workbench/compartments.d.ts +47 -0
- package/dist/workbench/compartments.d.ts.map +1 -0
- package/dist/workbench/compartments.js +147 -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/splitter.component.d.ts +32 -0
- package/dist/workbench/splitter.component.d.ts.map +1 -1
- package/dist/workbench/splitter.component.js +120 -1
- package/dist/workbench/tool-window-header.component.d.ts +2 -0
- package/dist/workbench/tool-window-header.component.d.ts.map +1 -1
- package/dist/workbench/tool-window-header.component.js +3 -1
- package/dist/workbench/tool-window-rail.component.d.ts.map +1 -1
- package/dist/workbench/tool-window-rail.component.js +16 -6
- package/dist/workbench/tool-window-zone.component.d.ts +11 -4
- package/dist/workbench/tool-window-zone.component.d.ts.map +1 -1
- package/dist/workbench/tool-window-zone.component.js +152 -57
- package/dist/workbench/use-tool-windows.d.ts +7 -1
- package/dist/workbench/use-tool-windows.d.ts.map +1 -1
- package/dist/workbench/use-tool-windows.js +4 -2
- package/dist/workbench/workbench.module.scss +139 -13
- package/dist/workbench/workbench.store.d.ts +39 -4
- package/dist/workbench/workbench.store.d.ts.map +1 -1
- package/dist/workbench/workbench.store.js +128 -5
- package/dist/workspaces/container/workspace-container.component.d.ts +8 -8
- package/dist/workspaces/container/workspace-container.component.js +9 -9
- package/dist/workspaces2/workspace2.d.ts +3 -3
- package/dist/workspaces2/workspace2.js +3 -3
- package/mock-jest.tsx +0 -41
- package/mock.tsx +0 -41
- package/package.json +26 -23
- package/src/_vars.scss +4 -4
- package/dist/entity-banner/actions-menu/entity-banner-actions-menu.component.d.ts +0 -19
- package/dist/entity-banner/actions-menu/entity-banner-actions-menu.component.d.ts.map +0 -1
- package/dist/entity-banner/actions-menu/entity-banner-actions-menu.component.js +0 -137
- package/dist/entity-banner/actions-menu/entity-banner-actions-menu.module.scss +0 -23
- package/dist/entity-banner/contact-details/entity-banner-contact-details.component.d.ts +0 -9
- package/dist/entity-banner/contact-details/entity-banner-contact-details.component.d.ts.map +0 -1
- package/dist/entity-banner/contact-details/entity-banner-contact-details.component.js +0 -207
- package/dist/entity-banner/contact-details/entity-banner-contact-details.module.scss +0 -47
- package/dist/entity-banner/contact-details/entity-banner-toggle-contact-details-button.component.d.ts +0 -12
- package/dist/entity-banner/contact-details/entity-banner-toggle-contact-details-button.component.d.ts.map +0 -1
- package/dist/entity-banner/contact-details/entity-banner-toggle-contact-details-button.component.js +0 -15
- package/dist/entity-banner/contact-details/types.d.ts +0 -48
- package/dist/entity-banner/contact-details/types.d.ts.map +0 -1
- package/dist/entity-banner/contact-details/types.js +0 -1
- package/dist/entity-banner/contact-details/useEntityAttributes.d.ts +0 -14
- package/dist/entity-banner/contact-details/useEntityAttributes.d.ts.map +0 -1
- package/dist/entity-banner/contact-details/useEntityAttributes.js +0 -12
- package/dist/entity-banner/contact-details/useEntityGroupsForEntity.d.ts +0 -11
- package/dist/entity-banner/contact-details/useEntityGroupsForEntity.d.ts.map +0 -1
- package/dist/entity-banner/contact-details/useEntityGroupsForEntity.js +0 -9
- package/dist/entity-banner/contact-details/useRelationships.d.ts +0 -35
- package/dist/entity-banner/contact-details/useRelationships.d.ts.map +0 -1
- package/dist/entity-banner/contact-details/useRelationships.js +0 -37
- package/dist/entity-banner/entity-info/entity-banner-entity-identifiers.component.d.ts +0 -9
- package/dist/entity-banner/entity-info/entity-banner-entity-identifiers.component.d.ts.map +0 -1
- package/dist/entity-banner/entity-info/entity-banner-entity-identifiers.component.js +0 -77
- package/dist/entity-banner/entity-info/entity-banner-entity-info.component.d.ts +0 -9
- package/dist/entity-banner/entity-info/entity-banner-entity-info.component.d.ts.map +0 -1
- package/dist/entity-banner/entity-info/entity-banner-entity-info.component.js +0 -72
- package/dist/entity-banner/entity-info/entity-banner-entity-info.module.scss +0 -165
- package/dist/entity-banner/index.d.ts +0 -5
- package/dist/entity-banner/index.d.ts.map +0 -1
- package/dist/entity-banner/index.js +0 -4
- package/dist/entity-photo/entity-photo.component.d.ts +0 -21
- package/dist/entity-photo/entity-photo.component.d.ts.map +0 -1
- package/dist/entity-photo/entity-photo.component.js +0 -111
- package/dist/entity-photo/entity-photo.module.scss +0 -21
- package/dist/entity-photo/index.d.ts +0 -3
- package/dist/entity-photo/index.d.ts.map +0 -1
- package/dist/entity-photo/index.js +0 -2
- package/dist/entity-photo/placeholder-icon.component.d.ts +0 -9
- package/dist/entity-photo/placeholder-icon.component.d.ts.map +0 -1
- package/dist/entity-photo/placeholder-icon.component.js +0 -26
- package/dist/entity-photo/useEntityPhoto.d.ts +0 -29
- package/dist/entity-photo/useEntityPhoto.d.ts.map +0 -1
- package/dist/entity-photo/useEntityPhoto.js +0 -37
- package/dist/icons/svgs/baby.svg +0 -1
- package/dist/icons/svgs/chemistry.svg +0 -1
- package/dist/icons/svgs/drug-order.svg +0 -1
- package/dist/icons/svgs/generic-order-type.svg +0 -1
- package/dist/icons/svgs/hospital-bed.svg +0 -1
- package/dist/icons/svgs/image-medical.svg +0 -1
- package/dist/icons/svgs/lab-order.svg +0 -1
- package/dist/icons/svgs/material-order.svg +0 -1
- package/dist/icons/svgs/medication.svg +0 -1
- package/dist/icons/svgs/microscope.svg +0 -1
- package/dist/icons/svgs/mother.svg +0 -1
- package/dist/icons/svgs/procedure-order.svg +0 -1
- package/dist/icons/svgs/referral-order.svg +0 -1
- package/dist/icons/svgs/syringe.svg +0 -1
- package/dist/logo/_logo.scss +0 -34
- package/dist/logo/egen-logo-full.svg +0 -1
- package/dist/logo/egen-logo-icon.svg +0 -1
- package/dist/logo/egen-logo-partial.svg +0 -1
- package/dist/logo/egen-logo-white.svg +0 -1
- package/dist/logo/index.d.ts +0 -8
- package/dist/logo/index.d.ts.map +0 -1
- package/dist/logo/index.js +0 -22
- package/dist/numeric-datapoint/index.d.ts +0 -4
- package/dist/numeric-datapoint/index.d.ts.map +0 -1
- package/dist/numeric-datapoint/index.js +0 -3
- package/dist/numeric-datapoint/interpretation-utils.d.ts +0 -27
- package/dist/numeric-datapoint/interpretation-utils.d.ts.map +0 -1
- package/dist/numeric-datapoint/interpretation-utils.js +0 -66
- package/dist/numeric-datapoint/numeric-datapoint.component.d.ts +0 -44
- package/dist/numeric-datapoint/numeric-datapoint.component.d.ts.map +0 -1
- package/dist/numeric-datapoint/numeric-datapoint.component.js +0 -110
- package/dist/numeric-datapoint/numeric-datapoint.module.scss +0 -141
- package/dist/numeric-datapoint/use-concept-reference-range.d.ts +0 -13
- package/dist/numeric-datapoint/use-concept-reference-range.d.ts.map +0 -1
- package/dist/numeric-datapoint/use-concept-reference-range.js +0 -31
- package/dist/pictograms/svgs/blood-bank.svg +0 -1
- package/dist/pictograms/svgs/cardiology.svg +0 -1
- package/dist/pictograms/svgs/ct-scan.svg +0 -1
- package/dist/pictograms/svgs/dentistry.svg +0 -1
- package/dist/pictograms/svgs/emergency-department.svg +0 -1
- package/dist/pictograms/svgs/geriatrics.svg +0 -1
- package/dist/pictograms/svgs/gynaecology.svg +0 -1
- package/dist/pictograms/svgs/in-patient.svg +0 -1
- package/dist/pictograms/svgs/labs-2.svg +0 -1
- package/dist/pictograms/svgs/labs.svg +0 -1
- package/dist/pictograms/svgs/obstetrics.svg +0 -1
- package/dist/pictograms/svgs/patient-search.svg +0 -1
- package/dist/pictograms/svgs/patients.svg +0 -1
- package/dist/pictograms/svgs/pharmacy-1.svg +0 -1
- package/dist/pictograms/svgs/pharmacy-2.svg +0 -1
- package/dist/pictograms/svgs/triage.svg +0 -1
- package/dist/pictograms/svgs/x-ray.svg +0 -1
|
@@ -35,6 +35,15 @@ $gap: var(--egen-workbench-gap, 0.375rem);
|
|
|
35
35
|
flex: 1 1 auto;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
.railIconMask {
|
|
39
|
+
display: block;
|
|
40
|
+
width: 18px;
|
|
41
|
+
height: 18px;
|
|
42
|
+
background-color: currentColor;
|
|
43
|
+
mask: var(--egen-rail-icon) center / contain no-repeat;
|
|
44
|
+
-webkit-mask: var(--egen-rail-icon) center / contain no-repeat;
|
|
45
|
+
}
|
|
46
|
+
|
|
38
47
|
.railBadge {
|
|
39
48
|
position: absolute;
|
|
40
49
|
top: 0.125rem;
|
|
@@ -101,9 +110,9 @@ $gap: var(--egen-workbench-gap, 0.375rem);
|
|
|
101
110
|
height: calc(100% - #{$gap});
|
|
102
111
|
min-width: 0;
|
|
103
112
|
min-height: 0;
|
|
104
|
-
|
|
105
|
-
//
|
|
106
|
-
background:
|
|
113
|
+
// La zone est transparente : le fond sombre (même léger assombrissement que la carte centrale, voir
|
|
114
|
+
// _general.scss) est porté par chaque compartiment, qui est une carte à part entière.
|
|
115
|
+
background: transparent;
|
|
107
116
|
color: var(--colors-surface-foreground, #fff);
|
|
108
117
|
|
|
109
118
|
// Distance de glissement des animations d'ouverture/fermeture (classes egen-anim-*).
|
|
@@ -125,10 +134,8 @@ $gap: var(--egen-workbench-gap, 0.375rem);
|
|
|
125
134
|
pointer-events: none;
|
|
126
135
|
}
|
|
127
136
|
|
|
128
|
-
&[data-phase='opening'] .
|
|
129
|
-
&[data-phase='
|
|
130
|
-
&[data-phase='closing'] .zoneHeader,
|
|
131
|
-
&[data-phase='closing'] .zoneBody {
|
|
137
|
+
&[data-phase='opening'] .compartment,
|
|
138
|
+
&[data-phase='closing'] .compartment {
|
|
132
139
|
flex-shrink: 0;
|
|
133
140
|
}
|
|
134
141
|
|
|
@@ -136,8 +143,7 @@ $gap: var(--egen-workbench-gap, 0.375rem);
|
|
|
136
143
|
&.zone-left[data-phase='closing'],
|
|
137
144
|
&.zone-right[data-phase='opening'],
|
|
138
145
|
&.zone-right[data-phase='closing'] {
|
|
139
|
-
.
|
|
140
|
-
.zoneBody {
|
|
146
|
+
.compartment {
|
|
141
147
|
min-width: var(--egen-zone-inner-size);
|
|
142
148
|
}
|
|
143
149
|
}
|
|
@@ -148,12 +154,79 @@ $gap: var(--egen-workbench-gap, 0.375rem);
|
|
|
148
154
|
align-items: flex-end;
|
|
149
155
|
}
|
|
150
156
|
|
|
151
|
-
&.zone-bottom[data-phase='opening'] .
|
|
152
|
-
&.zone-bottom[data-phase='closing'] .
|
|
157
|
+
&.zone-bottom[data-phase='opening'] .compartment,
|
|
158
|
+
&.zone-bottom[data-phase='closing'] .compartment {
|
|
153
159
|
min-height: var(--egen-zone-inner-size);
|
|
154
160
|
}
|
|
155
161
|
}
|
|
156
162
|
|
|
163
|
+
// ── Compartiments ───────────────────────────────────────────────────────────
|
|
164
|
+
// Carte sombre arrondie ; plusieurs s'empilent dans une zone latérale. Leurs hauteurs (flex-grow en %,
|
|
165
|
+
// base nulle) totalisent exactement la zone : jamais de débordement, le corps défile en interne.
|
|
166
|
+
.compartment {
|
|
167
|
+
position: relative;
|
|
168
|
+
display: flex;
|
|
169
|
+
flex: 1 1 0%;
|
|
170
|
+
flex-direction: column;
|
|
171
|
+
box-sizing: border-box;
|
|
172
|
+
min-width: 0;
|
|
173
|
+
min-height: 0;
|
|
174
|
+
overflow: hidden;
|
|
175
|
+
border-radius: $radius;
|
|
176
|
+
background: var(--egen-workbench-card-bg, rgb(0 0 0 / 24%));
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// Écart entre deux compartiments (hors animation) : même largeur que l'écart entre deux zones.
|
|
180
|
+
.compartmentGap {
|
|
181
|
+
flex: 0 0 $gap;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// Poignée entre deux compartiments : elle occupe l'écart ; la zone de saisie déborde de 2px de chaque côté.
|
|
185
|
+
.compartmentSplitter {
|
|
186
|
+
position: relative;
|
|
187
|
+
z-index: 2;
|
|
188
|
+
flex: 0 0 $gap;
|
|
189
|
+
cursor: row-resize;
|
|
190
|
+
touch-action: none;
|
|
191
|
+
|
|
192
|
+
&::before {
|
|
193
|
+
content: '';
|
|
194
|
+
position: absolute;
|
|
195
|
+
inset: -2px 0;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
&::after {
|
|
199
|
+
content: '';
|
|
200
|
+
position: absolute;
|
|
201
|
+
top: 50%;
|
|
202
|
+
right: 0;
|
|
203
|
+
left: 0;
|
|
204
|
+
height: 2px;
|
|
205
|
+
border-radius: 999px;
|
|
206
|
+
background: var(--colors-primary-500, #3b82f6);
|
|
207
|
+
opacity: 0;
|
|
208
|
+
transform: translateY(-50%);
|
|
209
|
+
transition: opacity 120ms ease;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
&:hover::after,
|
|
213
|
+
&:focus-visible::after {
|
|
214
|
+
opacity: 0.8;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
&:focus-visible {
|
|
218
|
+
outline: none;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
:global(html[data-workbench-resizing^='compartment-']) .compartmentSplitter::after {
|
|
223
|
+
opacity: 1;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
:global(html[data-workbench-resizing^='compartment-']) {
|
|
227
|
+
cursor: row-resize;
|
|
228
|
+
}
|
|
229
|
+
|
|
157
230
|
.zoneHeader {
|
|
158
231
|
display: flex;
|
|
159
232
|
align-items: center;
|
|
@@ -219,8 +292,7 @@ $gap: var(--egen-workbench-gap, 0.375rem);
|
|
|
219
292
|
flex: 1 1 auto;
|
|
220
293
|
min-height: 0;
|
|
221
294
|
overflow: auto;
|
|
222
|
-
|
|
223
|
-
border-bottom-right-radius: $radius;
|
|
295
|
+
scrollbar-width: thin;
|
|
224
296
|
}
|
|
225
297
|
|
|
226
298
|
.zoneSlot {
|
|
@@ -272,6 +344,12 @@ $gap: var(--egen-workbench-gap, 0.375rem);
|
|
|
272
344
|
opacity: 1;
|
|
273
345
|
}
|
|
274
346
|
|
|
347
|
+
:global(html[data-workbench-resizing='corner-left']) .splitter-left::after,
|
|
348
|
+
:global(html[data-workbench-resizing='corner-right']) .splitter-right::after,
|
|
349
|
+
:global(html[data-workbench-resizing^='corner-']) .splitter-bottom::after {
|
|
350
|
+
opacity: 1;
|
|
351
|
+
}
|
|
352
|
+
|
|
275
353
|
.splitter-left,
|
|
276
354
|
.splitter-right {
|
|
277
355
|
top: 0;
|
|
@@ -311,3 +389,51 @@ $gap: var(--egen-workbench-gap, 0.375rem);
|
|
|
311
389
|
transform: translateY(-50%);
|
|
312
390
|
}
|
|
313
391
|
}
|
|
392
|
+
|
|
393
|
+
// ── Poignées d'angle (intersection latérale / centre / bas) ─────────────────
|
|
394
|
+
// Carré centré sur le croisement des deux frontières : la zone basse commence une demi-écart sous
|
|
395
|
+
// le centre, et la frontière latérale se trouve à la largeur de la zone, moins une demi-écart
|
|
396
|
+
// (la carte est décalée d'une demi-écart dans sa cellule). Au-dessus des deux poignées linéaires.
|
|
397
|
+
.cornerSplitter {
|
|
398
|
+
--corner-size: calc(#{$gap} + 0.75rem);
|
|
399
|
+
|
|
400
|
+
position: absolute;
|
|
401
|
+
z-index: 3;
|
|
402
|
+
top: calc(-0.5 * (#{$gap} + var(--corner-size)));
|
|
403
|
+
width: var(--corner-size);
|
|
404
|
+
height: var(--corner-size);
|
|
405
|
+
border-radius: 999px;
|
|
406
|
+
background: transparent;
|
|
407
|
+
cursor: move;
|
|
408
|
+
touch-action: none;
|
|
409
|
+
|
|
410
|
+
&::after {
|
|
411
|
+
content: '';
|
|
412
|
+
position: absolute;
|
|
413
|
+
inset: 50% auto auto 50%;
|
|
414
|
+
width: 0.5rem;
|
|
415
|
+
height: 0.5rem;
|
|
416
|
+
border-radius: 999px;
|
|
417
|
+
background: var(--colors-primary-500, #3b82f6);
|
|
418
|
+
opacity: 0;
|
|
419
|
+
transform: translate(-50%, -50%);
|
|
420
|
+
transition: opacity 120ms ease;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
&:hover::after {
|
|
424
|
+
opacity: 0.9;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
.cornerSplitter-left {
|
|
429
|
+
left: calc(var(--egen-zone-left-width, 0px) - 0.5 * (#{$gap} + var(--corner-size)));
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
.cornerSplitter-right {
|
|
433
|
+
right: calc(var(--egen-zone-right-width, 0px) - 0.5 * (#{$gap} + var(--corner-size)));
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
:global(html[data-workbench-resizing='corner-left']) .cornerSplitter-left::after,
|
|
437
|
+
:global(html[data-workbench-resizing='corner-right']) .cornerSplitter-right::after {
|
|
438
|
+
opacity: 1;
|
|
439
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ToolWindowAnchor } from '@egen-civitas/esm-extensions';
|
|
2
2
|
/**
|
|
3
3
|
* État global du plan de travail du shell (rails + zones façon IntelliJ).
|
|
4
4
|
*
|
|
@@ -11,12 +11,24 @@ export declare const WORKBENCH_STORAGE_KEY = "egen-workbench-layout";
|
|
|
11
11
|
export declare const ZONE_ANCHORS: readonly ToolWindowAnchor[];
|
|
12
12
|
/** Taille par défaut des zones, en pixels (largeur pour left/right, hauteur pour bottom). */
|
|
13
13
|
export declare const DEFAULT_ZONE_SIZES: Readonly<Record<ToolWindowAnchor, number>>;
|
|
14
|
+
/** Zones latérales : les seules à pouvoir être divisées en compartiments verticaux. */
|
|
15
|
+
export type SideAnchor = 'left' | 'right';
|
|
16
|
+
export declare const SIDE_ANCHORS: readonly SideAnchor[];
|
|
14
17
|
export interface WorkbenchState {
|
|
15
18
|
/** Largeur (left/right) ou hauteur (bottom) de chaque zone, en pixels. */
|
|
16
19
|
sizes: Record<ToolWindowAnchor, number>;
|
|
17
20
|
/** Fenêtre d'outils (nom de l'extension) affichée dans chaque zone ; `null` : zone repliée. */
|
|
18
21
|
active: Record<ToolWindowAnchor, string | null>;
|
|
22
|
+
/**
|
|
23
|
+
* Zones latérales : fenêtres d'outils ouvertes dans un compartiment **propre** (empilées sous le compartiment
|
|
24
|
+
* par défaut, dans l'ordre d'ouverture). Le compartiment par défaut reste porté par `active`.
|
|
25
|
+
*/
|
|
26
|
+
compartments: Record<SideAnchor, string[]>;
|
|
27
|
+
/** Hauteur mémorisée de chaque compartiment, en % de sa zone (clé : voir `compartmentKey`). */
|
|
28
|
+
heights: Record<string, number>;
|
|
19
29
|
}
|
|
30
|
+
/** Clé de mémorisation de la hauteur d'un compartiment ; `id` omis : compartiment par défaut de la zone. */
|
|
31
|
+
export declare function compartmentKey(anchor: SideAnchor, id?: string): string;
|
|
20
32
|
/**
|
|
21
33
|
* Borne une taille de zone : minimum fixe, maximum = plafond fixe ET part de la fenêtre
|
|
22
34
|
* (50 % de la largeur, 70 % de la hauteur), pour que le contenu central reste toujours visible.
|
|
@@ -26,10 +38,33 @@ export declare function clampZoneSize(anchor: ToolWindowAnchor, size: number, vi
|
|
|
26
38
|
height: number;
|
|
27
39
|
}): number;
|
|
28
40
|
export declare const workbenchStore: import("zustand").StoreApi<WorkbenchState>;
|
|
29
|
-
/**
|
|
41
|
+
/** Fenêtres d'outils ouvertes dans un compartiment propre de la zone `anchor` (liste vide pour la zone basse). */
|
|
42
|
+
export declare function getOpenCompartments(anchor: ToolWindowAnchor, state?: Partial<WorkbenchState>): string[];
|
|
43
|
+
/** Vrai si la fenêtre d'outils `id` demande un compartiment propre (`meta.compartment`) dans la zone `anchor`. */
|
|
44
|
+
export declare function hasOwnCompartment(anchor: ToolWindowAnchor, id: string): boolean;
|
|
45
|
+
/** Ouvre la fenêtre `id` dans un compartiment propre de la zone `anchor` (sans effet si déjà ouverte). */
|
|
46
|
+
export declare function openCompartment(anchor: SideAnchor, id: string): void;
|
|
47
|
+
/** Referme le compartiment propre `id` de la zone `anchor` ; les autres se partagent la place libérée. */
|
|
48
|
+
export declare function closeCompartment(anchor: SideAnchor, id: string): void;
|
|
49
|
+
/** Ouvre le compartiment propre `id` de la zone `anchor`, ou le referme s'il est ouvert. */
|
|
50
|
+
export declare function toggleCompartment(anchor: SideAnchor, id: string): void;
|
|
51
|
+
/**
|
|
52
|
+
* Mémorise les hauteurs (en %) des compartiments d'une zone latérale. `heights` est indexé par clé de
|
|
53
|
+
* compartiment (voir `compartmentKey`) ; seules les valeurs réellement modifiées déclenchent une mise à jour.
|
|
54
|
+
*/
|
|
55
|
+
export declare function setCompartmentHeights(heights: Readonly<Record<string, number>>): void;
|
|
56
|
+
/**
|
|
57
|
+
* Ouvre la fenêtre d'outils `id` dans la zone `anchor` ; un second appel sur la même la referme.
|
|
58
|
+
* Selon sa `meta.compartment`, elle occupe le compartiment par défaut de la zone ou un compartiment propre.
|
|
59
|
+
*/
|
|
30
60
|
export declare function toggleToolWindow(anchor: ToolWindowAnchor, id: string): void;
|
|
31
|
-
/**
|
|
32
|
-
export declare function
|
|
61
|
+
/** Ouvre la fenêtre d'outils `id` dans la zone `anchor` (sans la refermer si elle est déjà affichée). */
|
|
62
|
+
export declare function openToolWindow(anchor: ToolWindowAnchor, id: string): void;
|
|
63
|
+
/**
|
|
64
|
+
* Replie la zone `anchor` (compartiment par défaut et compartiments propres). Avec `id`, ne referme que
|
|
65
|
+
* cette fenêtre d'outils.
|
|
66
|
+
*/
|
|
67
|
+
export declare function closeToolWindow(anchor: ToolWindowAnchor, id?: string): void;
|
|
33
68
|
/** Redimensionne la zone `anchor` (valeur bornée par `clampZoneSize`). */
|
|
34
69
|
export declare function setZoneSize(anchor: ToolWindowAnchor, size: number): void;
|
|
35
70
|
/** Rétablit la taille par défaut de la zone `anchor`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workbench.store.d.ts","sourceRoot":"","sources":["../../src/workbench/workbench.store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"workbench.store.d.ts","sourceRoot":"","sources":["../../src/workbench/workbench.store.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,8BAA8B,CAAC;AAGtC;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAE7D,eAAO,MAAM,YAAY,EAAE,SAAS,gBAAgB,EAAgC,CAAC;AAErF,6FAA6F;AAC7F,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAA0C,CAAC;AAQrH,uFAAuF;AACvF,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;AAE1C,eAAO,MAAM,YAAY,EAAE,SAAS,UAAU,EAAsB,CAAC;AAErE,MAAM,WAAW,cAAc;IAC7B,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;IACxC,+FAA+F;IAC/F,MAAM,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;IAChD;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC;IAC3C,+FAA+F;IAC/F,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAED,4GAA4G;AAC5G,wBAAgB,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE,GAAE,MAA+B,GAAG,MAAM,CAE9F;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,gBAAgB,EACxB,IAAI,EAAE,MAAM,EACZ,QAAQ,GAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAA6D,GACrG,MAAM,CAMR;AAwCD,eAAO,MAAM,cAAc,4CAAiE,CAAC;AAY7F,kHAAkH;AAClH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,gBAAgB,EACxB,KAAK,GAAE,OAAO,CAAC,cAAc,CAA6B,YAG3D;AAED,kHAAkH;AAClH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAS/E;AAED,0GAA0G;AAC1G,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,QAQ7D;AAED,0GAA0G;AAC1G,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,QAQ9D;AAED,4FAA4F;AAC5F,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,QAG/D;AAMD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,QAI9E;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,EAAE,EAAE,EAAE,MAAM,QAIpE;AAED,yGAAyG;AACzG,wBAAgB,cAAc,CAAC,MAAM,EAAE,gBAAgB,EAAE,EAAE,EAAE,MAAM,QAIlE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,gBAAgB,EAAE,EAAE,CAAC,EAAE,MAAM,QAapE;AAED,0EAA0E;AAC1E,wBAAgB,WAAW,CAAC,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,QAIjE;AAED,yDAAyD;AACzD,wBAAgB,aAAa,CAAC,MAAM,EAAE,gBAAgB,QAErD"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { getGlobalStore } from "@egen-civitas/esm-state";
|
|
2
|
+
import { getAssignedExtensions, getToolWindowCompartment, TOOL_WINDOW_SLOTS } from "@egen-civitas/esm-extensions";
|
|
3
|
+
import { DEFAULT_COMPARTMENT_ID } from "./compartments.js";
|
|
2
4
|
/**
|
|
3
5
|
* État global du plan de travail du shell (rails + zones façon IntelliJ).
|
|
4
6
|
*
|
|
@@ -31,6 +33,13 @@ const ZONE_LIMITS = {
|
|
|
31
33
|
max: 720
|
|
32
34
|
}
|
|
33
35
|
};
|
|
36
|
+
export const SIDE_ANCHORS = [
|
|
37
|
+
'left',
|
|
38
|
+
'right'
|
|
39
|
+
];
|
|
40
|
+
/** Clé de mémorisation de la hauteur d'un compartiment ; `id` omis : compartiment par défaut de la zone. */ export function compartmentKey(anchor, id = DEFAULT_COMPARTMENT_ID) {
|
|
41
|
+
return `${anchor}:${id}`;
|
|
42
|
+
}
|
|
34
43
|
/**
|
|
35
44
|
* Borne une taille de zone : minimum fixe, maximum = plafond fixe ET part de la fenêtre
|
|
36
45
|
* (50 % de la largeur, 70 % de la hauteur), pour que le contenu central reste toujours visible.
|
|
@@ -53,7 +62,12 @@ function defaultState() {
|
|
|
53
62
|
left: null,
|
|
54
63
|
right: null,
|
|
55
64
|
bottom: null
|
|
56
|
-
}
|
|
65
|
+
},
|
|
66
|
+
compartments: {
|
|
67
|
+
left: [],
|
|
68
|
+
right: []
|
|
69
|
+
},
|
|
70
|
+
heights: {}
|
|
57
71
|
};
|
|
58
72
|
}
|
|
59
73
|
function readStoredState() {
|
|
@@ -68,6 +82,15 @@ function readStoredState() {
|
|
|
68
82
|
const active = parsed?.active?.[anchor];
|
|
69
83
|
if (typeof active === 'string' && active.length > 0) state.active[anchor] = active;
|
|
70
84
|
}
|
|
85
|
+
for (const anchor of SIDE_ANCHORS){
|
|
86
|
+
const open = parsed?.compartments?.[anchor];
|
|
87
|
+
if (Array.isArray(open)) {
|
|
88
|
+
state.compartments[anchor] = open.filter((id, index)=>typeof id === 'string' && id.length > 0 && open.indexOf(id) === index);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
for (const [key, value] of Object.entries(parsed?.heights ?? {})){
|
|
92
|
+
if (typeof value === 'number' && Number.isFinite(value) && value > 0 && value <= 100) state.heights[key] = value;
|
|
93
|
+
}
|
|
71
94
|
} catch {
|
|
72
95
|
// stockage indisponible ou contenu corrompu : disposition par défaut
|
|
73
96
|
}
|
|
@@ -81,7 +104,77 @@ workbenchStore.subscribe((state)=>{
|
|
|
81
104
|
// quota dépassé ou stockage désactivé : la disposition reste valable pour la session
|
|
82
105
|
}
|
|
83
106
|
});
|
|
84
|
-
|
|
107
|
+
const isSide = (anchor)=>anchor === 'left' || anchor === 'right';
|
|
108
|
+
/** Fenêtres d'outils ouvertes dans un compartiment propre de la zone `anchor` (liste vide pour la zone basse). */ export function getOpenCompartments(anchor, state = workbenchStore.getState()) {
|
|
109
|
+
return isSide(anchor) ? state.compartments?.[anchor] ?? [] : [];
|
|
110
|
+
}
|
|
111
|
+
/** Vrai si la fenêtre d'outils `id` demande un compartiment propre (`meta.compartment`) dans la zone `anchor`. */ export function hasOwnCompartment(anchor, id) {
|
|
112
|
+
if (!isSide(anchor)) return false;
|
|
113
|
+
try {
|
|
114
|
+
const extension = getAssignedExtensions(TOOL_WINDOW_SLOTS[anchor]).find((candidate)=>candidate.name === id);
|
|
115
|
+
return Boolean(extension?.meta && getToolWindowCompartment(extension.meta));
|
|
116
|
+
} catch {
|
|
117
|
+
// slot pas encore enregistré (appel d'une app avant le montage du rail) : compartiment par défaut
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/** Ouvre la fenêtre `id` dans un compartiment propre de la zone `anchor` (sans effet si déjà ouverte). */ export function openCompartment(anchor, id) {
|
|
122
|
+
const state = workbenchStore.getState();
|
|
123
|
+
const open = getOpenCompartments(anchor, state);
|
|
124
|
+
if (!open.includes(id)) {
|
|
125
|
+
workbenchStore.setState({
|
|
126
|
+
compartments: {
|
|
127
|
+
...defaultCompartments(),
|
|
128
|
+
...state.compartments,
|
|
129
|
+
[anchor]: [
|
|
130
|
+
...open,
|
|
131
|
+
id
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/** Referme le compartiment propre `id` de la zone `anchor` ; les autres se partagent la place libérée. */ export function closeCompartment(anchor, id) {
|
|
138
|
+
const state = workbenchStore.getState();
|
|
139
|
+
const open = getOpenCompartments(anchor, state);
|
|
140
|
+
if (open.includes(id)) {
|
|
141
|
+
workbenchStore.setState({
|
|
142
|
+
compartments: {
|
|
143
|
+
...defaultCompartments(),
|
|
144
|
+
...state.compartments,
|
|
145
|
+
[anchor]: open.filter((other)=>other !== id)
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
/** Ouvre le compartiment propre `id` de la zone `anchor`, ou le referme s'il est ouvert. */ export function toggleCompartment(anchor, id) {
|
|
151
|
+
if (getOpenCompartments(anchor).includes(id)) closeCompartment(anchor, id);
|
|
152
|
+
else openCompartment(anchor, id);
|
|
153
|
+
}
|
|
154
|
+
function defaultCompartments() {
|
|
155
|
+
return {
|
|
156
|
+
left: [],
|
|
157
|
+
right: []
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Mémorise les hauteurs (en %) des compartiments d'une zone latérale. `heights` est indexé par clé de
|
|
162
|
+
* compartiment (voir `compartmentKey`) ; seules les valeurs réellement modifiées déclenchent une mise à jour.
|
|
163
|
+
*/ export function setCompartmentHeights(heights) {
|
|
164
|
+
const current = workbenchStore.getState().heights ?? {};
|
|
165
|
+
const changed = Object.entries(heights).some(([key, value])=>Math.abs((current[key] ?? -1) - value) > 0.005);
|
|
166
|
+
if (changed) workbenchStore.setState({
|
|
167
|
+
heights: {
|
|
168
|
+
...current,
|
|
169
|
+
...heights
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Ouvre la fenêtre d'outils `id` dans la zone `anchor` ; un second appel sur la même la referme.
|
|
175
|
+
* Selon sa `meta.compartment`, elle occupe le compartiment par défaut de la zone ou un compartiment propre.
|
|
176
|
+
*/ export function toggleToolWindow(anchor, id) {
|
|
177
|
+
if (isSide(anchor) && hasOwnCompartment(anchor, id)) return toggleCompartment(anchor, id);
|
|
85
178
|
const { active } = workbenchStore.getState();
|
|
86
179
|
workbenchStore.setState({
|
|
87
180
|
active: {
|
|
@@ -90,15 +183,45 @@ workbenchStore.subscribe((state)=>{
|
|
|
90
183
|
}
|
|
91
184
|
});
|
|
92
185
|
}
|
|
93
|
-
/**
|
|
186
|
+
/** Ouvre la fenêtre d'outils `id` dans la zone `anchor` (sans la refermer si elle est déjà affichée). */ export function openToolWindow(anchor, id) {
|
|
187
|
+
if (isSide(anchor) && hasOwnCompartment(anchor, id)) return openCompartment(anchor, id);
|
|
94
188
|
const { active } = workbenchStore.getState();
|
|
95
|
-
if (active[anchor] !==
|
|
189
|
+
if (active[anchor] !== id) workbenchStore.setState({
|
|
96
190
|
active: {
|
|
97
191
|
...active,
|
|
98
|
-
[anchor]:
|
|
192
|
+
[anchor]: id
|
|
99
193
|
}
|
|
100
194
|
});
|
|
101
195
|
}
|
|
196
|
+
/**
|
|
197
|
+
* Replie la zone `anchor` (compartiment par défaut et compartiments propres). Avec `id`, ne referme que
|
|
198
|
+
* cette fenêtre d'outils.
|
|
199
|
+
*/ export function closeToolWindow(anchor, id) {
|
|
200
|
+
const state = workbenchStore.getState();
|
|
201
|
+
if (id !== undefined) {
|
|
202
|
+
if (isSide(anchor) && getOpenCompartments(anchor, state).includes(id)) return closeCompartment(anchor, id);
|
|
203
|
+
if (state.active[anchor] === id) workbenchStore.setState({
|
|
204
|
+
active: {
|
|
205
|
+
...state.active,
|
|
206
|
+
[anchor]: null
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
const patch = {};
|
|
212
|
+
if (state.active[anchor] !== null) patch.active = {
|
|
213
|
+
...state.active,
|
|
214
|
+
[anchor]: null
|
|
215
|
+
};
|
|
216
|
+
if (isSide(anchor) && getOpenCompartments(anchor, state).length > 0) {
|
|
217
|
+
patch.compartments = {
|
|
218
|
+
...defaultCompartments(),
|
|
219
|
+
...state.compartments,
|
|
220
|
+
[anchor]: []
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
if (Object.keys(patch).length > 0) workbenchStore.setState(patch);
|
|
224
|
+
}
|
|
102
225
|
/** Redimensionne la zone `anchor` (valeur bornée par `clampZoneSize`). */ export function setZoneSize(anchor, size) {
|
|
103
226
|
const { sizes } = workbenchStore.getState();
|
|
104
227
|
const next = clampZoneSize(anchor, size);
|
|
@@ -25,7 +25,7 @@ export interface WorkspaceContainerProps {
|
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* Use this component to render the [workspace window](https://egen.alpha.vercel.com/design-system)
|
|
28
|
-
* in an app such as the
|
|
28
|
+
* in an app such as the entity chart, or a workspace overlay in an app such as the office dashboard.
|
|
29
29
|
* This allows workspaces to be opened on the page where this component is mounted. This component
|
|
30
30
|
* must not be mounted multiple times on the same page. If there are multiple apps on a page, only
|
|
31
31
|
* one of those apps should use this component—it "hosts" the workspaces.
|
|
@@ -40,16 +40,16 @@ export interface WorkspaceContainerProps {
|
|
|
40
40
|
* The context key is a string that appears in the URL, which defines the pages on which workspaces
|
|
41
41
|
* are valid. If the URL changes in a way such that it no longer contains the context key, then
|
|
42
42
|
* all workspaces will be closed. This ensures that, for example, workspaces on the home page do
|
|
43
|
-
* not stay open when the user transitions to the
|
|
44
|
-
* not stay open when the user navigates to a different
|
|
43
|
+
* not stay open when the user transitions to the entity dashboard; and also that workspaces do
|
|
44
|
+
* not stay open when the user navigates to a different entity. The context key must be a valid
|
|
45
45
|
* sub-path of the URL, with no initial or trailing slash. So if the URL is
|
|
46
|
-
* `https://example.com/
|
|
47
|
-
* context keys, but `
|
|
46
|
+
* `https://example.com/entity/123/foo`, then `entity` and `entity/123` and `123/foo` are valid
|
|
47
|
+
* context keys, but `entity/12` and `pati` are not.
|
|
48
48
|
*
|
|
49
49
|
* An extension slot is provided in the workspace header. Its name is derived from the `featureName` of
|
|
50
50
|
* the top-level component in which it is defined (feature names are generally provided in the lifecycle
|
|
51
51
|
* functions in an app's `index.ts` file). The slot is named `workspace-header-${featureName}-slot`.
|
|
52
|
-
* For the
|
|
52
|
+
* For the entity chart, this is `workspace-header-entity-chart-slot`.
|
|
53
53
|
*
|
|
54
54
|
* This component also provides the [Siderail and Bottom Nav](https://egen.alpha.vercel.com/design-system).
|
|
55
55
|
* To use this, pass the `showSiderailAndBottomNav` prop. The Siderail is rendered on the right side of the screen
|
|
@@ -57,8 +57,8 @@ export interface WorkspaceContainerProps {
|
|
|
57
57
|
* menu provides an extension slot, to which buttons are attached as extensions. The slot
|
|
58
58
|
* derives its name from the `featureName` of the top-level component in which this `WorkspaceContainer`
|
|
59
59
|
* appears (feature names are generally provided in the lifecycle functions in an app's `index.ts` file).
|
|
60
|
-
* The slot is named `action-menu-${featureName}-items-slot`. For the
|
|
61
|
-
* `action-menu-
|
|
60
|
+
* The slot is named `action-menu-${featureName}-items-slot`. For the entity chart, this is
|
|
61
|
+
* `action-menu-entity-chart-items-slot`.
|
|
62
62
|
*
|
|
63
63
|
* This component also provides everything needed for workspace notifications to be rendered.
|
|
64
64
|
*
|
|
@@ -14,7 +14,7 @@ import ActionMenu from "./action-menu.component.js";
|
|
|
14
14
|
import styles from "./workspace.module.scss";
|
|
15
15
|
/**
|
|
16
16
|
* Use this component to render the [workspace window](https://egen.alpha.vercel.com/design-system)
|
|
17
|
-
* in an app such as the
|
|
17
|
+
* in an app such as the entity chart, or a workspace overlay in an app such as the office dashboard.
|
|
18
18
|
* This allows workspaces to be opened on the page where this component is mounted. This component
|
|
19
19
|
* must not be mounted multiple times on the same page. If there are multiple apps on a page, only
|
|
20
20
|
* one of those apps should use this component—it "hosts" the workspaces.
|
|
@@ -29,16 +29,16 @@ import styles from "./workspace.module.scss";
|
|
|
29
29
|
* The context key is a string that appears in the URL, which defines the pages on which workspaces
|
|
30
30
|
* are valid. If the URL changes in a way such that it no longer contains the context key, then
|
|
31
31
|
* all workspaces will be closed. This ensures that, for example, workspaces on the home page do
|
|
32
|
-
* not stay open when the user transitions to the
|
|
33
|
-
* not stay open when the user navigates to a different
|
|
32
|
+
* not stay open when the user transitions to the entity dashboard; and also that workspaces do
|
|
33
|
+
* not stay open when the user navigates to a different entity. The context key must be a valid
|
|
34
34
|
* sub-path of the URL, with no initial or trailing slash. So if the URL is
|
|
35
|
-
* `https://example.com/
|
|
36
|
-
* context keys, but `
|
|
35
|
+
* `https://example.com/entity/123/foo`, then `entity` and `entity/123` and `123/foo` are valid
|
|
36
|
+
* context keys, but `entity/12` and `pati` are not.
|
|
37
37
|
*
|
|
38
38
|
* An extension slot is provided in the workspace header. Its name is derived from the `featureName` of
|
|
39
39
|
* the top-level component in which it is defined (feature names are generally provided in the lifecycle
|
|
40
40
|
* functions in an app's `index.ts` file). The slot is named `workspace-header-${featureName}-slot`.
|
|
41
|
-
* For the
|
|
41
|
+
* For the entity chart, this is `workspace-header-entity-chart-slot`.
|
|
42
42
|
*
|
|
43
43
|
* This component also provides the [Siderail and Bottom Nav](https://egen.alpha.vercel.com/design-system).
|
|
44
44
|
* To use this, pass the `showSiderailAndBottomNav` prop. The Siderail is rendered on the right side of the screen
|
|
@@ -46,8 +46,8 @@ import styles from "./workspace.module.scss";
|
|
|
46
46
|
* menu provides an extension slot, to which buttons are attached as extensions. The slot
|
|
47
47
|
* derives its name from the `featureName` of the top-level component in which this `WorkspaceContainer`
|
|
48
48
|
* appears (feature names are generally provided in the lifecycle functions in an app's `index.ts` file).
|
|
49
|
-
* The slot is named `action-menu-${featureName}-items-slot`. For the
|
|
50
|
-
* `action-menu-
|
|
49
|
+
* The slot is named `action-menu-${featureName}-items-slot`. For the entity chart, this is
|
|
50
|
+
* `action-menu-entity-chart-items-slot`.
|
|
51
51
|
*
|
|
52
52
|
* This component also provides everything needed for workspace notifications to be rendered.
|
|
53
53
|
*
|
|
@@ -136,7 +136,7 @@ function Workspace({ workspaceInstance, additionalWorkspaceProps }) {
|
|
|
136
136
|
]);
|
|
137
137
|
// We use the feature name of the app containing the workspace in order to set the extension
|
|
138
138
|
// slot name. We can't use contextKey for this because we don't want the slot name to be
|
|
139
|
-
// different for different
|
|
139
|
+
// different for different entities, but we do want it to be different for different apps.
|
|
140
140
|
const { featureName } = useContext(ComponentContext);
|
|
141
141
|
const toggleWindowState = useCallback(()=>{
|
|
142
142
|
updateWorkspaceWindowState(isMaximized ? 'normal' : 'maximized');
|
|
@@ -54,10 +54,10 @@ export declare function closeWorkspaceGroup2(discardUnsavedChanges?: boolean): P
|
|
|
54
54
|
* To do so, we need to call `launchChildWorkspace` instead.
|
|
55
55
|
*
|
|
56
56
|
* [^1] Omitting window or group props is useful for workspaces that don't have ties to the window or group "context" (props).
|
|
57
|
-
* For example, in the
|
|
58
|
-
* a "group context" of the current
|
|
57
|
+
* For example, in the entity chart, the notes / business forms / order basket action menu button all share
|
|
58
|
+
* a "group context" of the current session. However, the "entity list" action menu button does not need to share that group
|
|
59
59
|
* context, so opening that workspace should not need to cause other workspaces / windows / groups to potentially close.
|
|
60
|
-
* The "
|
|
60
|
+
* The "entity search" workspace in the queues and unit apps is another example.
|
|
61
61
|
*
|
|
62
62
|
* [^2] 2 sets of props are compatible if either one is nullish, or if they are shallow equal.
|
|
63
63
|
* @experimental
|
|
@@ -105,10 +105,10 @@ import { showModal } from "../modals/index.js";
|
|
|
105
105
|
* To do so, we need to call `launchChildWorkspace` instead.
|
|
106
106
|
*
|
|
107
107
|
* [^1] Omitting window or group props is useful for workspaces that don't have ties to the window or group "context" (props).
|
|
108
|
-
* For example, in the
|
|
109
|
-
* a "group context" of the current
|
|
108
|
+
* For example, in the entity chart, the notes / business forms / order basket action menu button all share
|
|
109
|
+
* a "group context" of the current session. However, the "entity list" action menu button does not need to share that group
|
|
110
110
|
* context, so opening that workspace should not need to cause other workspaces / windows / groups to potentially close.
|
|
111
|
-
* The "
|
|
111
|
+
* The "entity search" workspace in the queues and unit apps is another example.
|
|
112
112
|
*
|
|
113
113
|
* [^2] 2 sets of props are compatible if either one is nullish, or if they are shallow equal.
|
|
114
114
|
* @experimental
|