@heswell/vuu-portal 2.2.4 → 2.2.5

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.
Files changed (2) hide show
  1. package/README.md +77 -0
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -138,3 +138,80 @@ absolute paths and `~/` paths are also accepted.
138
138
  start.
139
139
  - `vuu.portal.defaultModulesFile` is the seed catalogue. See
140
140
  [`default-modules.yaml`](./default-modules.yaml) for the format.
141
+
142
+ ## Workspaces and the Panels palette
143
+
144
+ `@vuu-ui/*` 4.0.0-alpha.26 adds named workspaces to the portal UI: a
145
+ **Workspaces** section in the nav with **+ New workspace**, the
146
+ `/workspaces/:id` route, **Reset to default**, and an **Add panel** button that
147
+ opens the **Panels** palette (tabs Modules, Tables and Recent) inline beside
148
+ the workspace grid. Tables › Browse lists the Vuu servers; each server page is
149
+ an unsaved workspace with the Tables palette pinned, which **Save as
150
+ workspace** keeps.
151
+
152
+ This package is the portal *server*. It doesn't render the UI; it supplies the
153
+ module records the palette is built from.
154
+
155
+ ### What the server provides
156
+
157
+ A module record with a `workspace` descriptor is listed in the palette's
158
+ Modules tab, grouped by `workspace.paletteGroup`. A module without one isn't.
159
+ See [Workspace metadata](../../docs/requirements/vuu-portal-module-discovery.md#workspace-metadata)
160
+ for the field. In [`default-modules.yaml`](./default-modules.yaml):
161
+
162
+ | Module | `workspace` | Why |
163
+ | --- | --- | --- |
164
+ | `moduleAdmin`, `userAdmin` | `{ paletteGroup: "Admin", defaultSize: { cols: 12, rows: 6 } }` | Standalone pages |
165
+ | `basket-trading` | `{ paletteGroup: "Trading", defaultSize: { cols: 12, rows: 8 } }` | Standalone page |
166
+ | `vuu-table-browser` | none | It is itself a workspace page; its tables are in the palette's Tables tab |
167
+ | `vuu-table-viewer` | none | Nested module; it only works inside the table browser |
168
+
169
+ The seed only applies when `modules.yaml` is first created. To change an
170
+ existing deployment, edit `modules.yaml` or use the module admin
171
+ (`updateModule` with `workspace`, or `workspace: null` to remove a module from
172
+ the palette).
173
+
174
+ ### Portal host requirements
175
+
176
+ The host is the `PortalShell` application, for example finos/vuu
177
+ `vuu-ui/portal-examples/portal-host`. See its
178
+ `docs/module-federation-architecture.md`. Workspaces are opt in:
179
+
180
+ ```tsx
181
+ import {
182
+ AddPanelButton,
183
+ createPortalComponentRegistries,
184
+ PortalShell,
185
+ type PortalWorkspacesOptions,
186
+ } from "@vuu-ui/core/portal";
187
+
188
+ const { renderers, settingsCodecs } = createPortalComponentRegistries();
189
+
190
+ const workspaces: PortalWorkspacesOptions = {
191
+ componentRenderers: renderers,
192
+ headerActions: <AddPanelButton />,
193
+ settingsCodecs,
194
+ };
195
+
196
+ <PortalShell contextPanel={{ placement: "inline" }} workspaces={workspaces} ...>
197
+ ```
198
+
199
+ - `PortalShell` renders the single `GridLayoutProvider` above both the palette
200
+ and the workspace. Don't add another one in the host or in a remote.
201
+ - `contextPanel={{ placement: "inline" }}` shows the palette beside the grid
202
+ instead of over it.
203
+ - Module Federation must share these as strict singletons
204
+ (`singleton: true, strictVersion: true`) in the host *and* every remote:
205
+ `react`, `react-dom`, `react-router-dom`, `@vuu-ui/core`,
206
+ `@vuu-ui/core/portal`, `@vuu-ui/grid-layout` and
207
+ `@vuu-ui/vuu-notifications`. A second copy of grid-layout breaks dragging
208
+ from the palette into the workspace; a second React or router breaks
209
+ rendering.
210
+ - Workspaces are saved by `workspaces.persistenceService`. By default that is
211
+ browser local storage, scoped to the `PortalShell` id and the signed-in
212
+ user. Servers added under Tables › Browse are kept in the per-user portal
213
+ state (`servers/manual`). This server doesn't store either.
214
+
215
+ To turn workspaces off, leave the `workspaces` prop off `PortalShell`. To
216
+ keep workspaces but hide a module from the palette, remove its `workspace`
217
+ descriptor.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heswell/vuu-portal",
3
- "version": "2.2.4",
3
+ "version": "2.2.5",
4
4
  "description": "VUU portal server with remote module discovery",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -31,7 +31,7 @@
31
31
  "peerDependencies": {
32
32
  "@heswell/vuu-server": "^3.1.0 || ^4.0.0",
33
33
  "@heswell/vuu-table": "^1.0.1",
34
- "@vuu-ui/vuu-protocol-types": "^4.0.0-alpha.25"
34
+ "@vuu-ui/vuu-protocol-types": "^4.0.0-alpha.26"
35
35
  },
36
36
  "repository": {
37
37
  "type": "git",