@thatopen/services 0.3.8 → 0.3.10

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.
@@ -1,285 +1,283 @@
1
- /* MD
2
- ## ClashesManager
3
- ---
4
- Structural engineers and BIM coordinators routinely detect geometric clashes
5
- between disciplines — structural steel penetrating ductwork, pipes clashing
6
- with slabs — and need to track the status of each issue through resolution
7
- without leaving their BIM environment.
8
-
9
- ClashesManager is the platform-side component that owns clash data: it loads and
10
- persists jobs, runs, and clashes; launches cloud-based clash detection in a Web
11
- Worker; and exposes the events and methods needed to build review workflows on
12
- top of it.
13
-
14
- This tutorial covers initializing the manager from the platform client; the
15
- recommended `clashes-panel` UI that works out of the box once `init` has been
16
- called; defining queries and detection matrices for fine-grained control;
17
- launching a detection run and tracking progress; updating clash status
18
- programmatically; and rendering sphere markers and element highlights without
19
- the built-in panel.
20
-
21
- By the end, you'll understand every public surface of ClashesManager and know
22
- which parts are handled automatically by `clashes-panel` so you can decide how
23
- much of the stack you need for your use case.
24
- */
25
-
26
- import * as THREE from "three";
27
- import * as OBC from "@thatopen/components";
28
- import * as OBF from "@thatopen/components-front";
29
- import * as FRAGS from "@thatopen/fragments";
30
- import * as BUI from "@thatopen/ui";
31
- import { PlatformClient } from "thatopen-services";
32
- import clashesManagerDef from "./index";
33
-
34
- const ClashesManager = clashesManagerDef.componentDefinition;
35
-
36
- const client = PlatformClient.fromPlatformContext();
37
-
38
- const { components } = (await client.setup(
39
- { OBC, OBF, BUI, THREE, FRAGS },
40
- { uuid: ClashesManager.uuid },
41
- )) as { components: OBC.Components };
42
-
43
- /* MD
44
- ### 🚀 Initializing the manager
45
-
46
- `init(client)` is the only call required before using the manager. It:
47
-
48
- - Loads all persisted clash data (jobs, runs, clashes, queries, matrices) from
49
- the project's cloud storage into memory.
50
- - Registers `save` and `reload` callbacks so writes are debounced to storage
51
- automatically and the manager can refresh its data after a run completes.
52
- - Reads any in-flight cloud executions so that a page reload mid-run doesn't
53
- lose track of the job.
54
- - Resolves the engine's active `World` in the background — if no world exists
55
- yet, it waits until one is created, so the order of initialization does not
56
- matter.
57
-
58
- After `init` resolves, `manager.ready` is `true` and all data properties
59
- (`jobs`, `runs`, `clashes`, `queries`, `matrices`) are populated.
60
- */
61
-
62
- const manager = components.get(ClashesManager);
63
- await manager.init(client);
64
-
65
- console.log(
66
- `Loaded ${manager.jobs.length} jobs, ` +
67
- `${manager.runs.length} runs, ` +
68
- `${manager.clashes.length} clashes.`,
69
- );
70
-
71
- /* MD
72
- ### 🖥️ Adding the built-in panel (recommended)
73
-
74
- Once `init` has been called, the `<clashes-panel>` web component is the
75
- recommended way to interact with `ClashesManager`. It covers the full
76
- review workflow — detection matrix, clash table, sphere markers, status
77
- filters, run progress — with zero additional wiring.
78
-
79
- `clashes-panel` is registered when `UIManager` is included in the platform
80
- setup call. See the **clashes-panel** tutorial for the complete setup and a
81
- detailed breakdown of everything the panel manages automatically.
82
-
83
- The sections below are for cases where you need direct control: building a
84
- custom UI, integrating clash data into your own panels, or automating status
85
- updates from outside the panel.
86
- */
87
-
88
- /* MD
89
- ### 📐 Queries and matrices
90
-
91
- A `ClashQuery` defines a named set of model elements: which files to scan and,
92
- optionally, which IFC categories or attribute conditions to match. Queries have
93
- no detection logic of their own — they are inputs to a matrix.
94
-
95
- A `ClashMatrix` pairs queries in an upper-triangle grid. Each active cell
96
- corresponds to one `ClashJob` that the cloud worker will execute. The matrix
97
- also carries the clash type (`hard` or `clearance`) and, for clearance checks,
98
- the tolerance in metres.
99
-
100
- Assigning to `manager.queries` or `manager.matrices` triggers a debounced
101
- auto-save (2 s). Call `await manager.flush()` to persist immediately before
102
- navigating away.
103
- */
104
-
105
- const structuralFileId = "file-id-of-structural-model";
106
- const mepFileId = "file-id-of-mep-model";
107
-
108
- manager.queries = [
109
- {
110
- id: "q-structural",
111
- name: "Structural",
112
- modelFileIds: [structuralFileId],
113
- query: { categories: ["IFCBEAM", "IFCCOLUMN", "IFCSLAB"] },
114
- },
115
- {
116
- id: "q-mep",
117
- name: "MEP",
118
- modelFileIds: [mepFileId],
119
- // Omitting `query` matches all elements with geometry in the listed files.
120
- },
121
- ];
122
-
123
- // The matrix below defines a single hard-clash job between Structural and MEP.
124
- // `activePairs` lists the upper-triangle cell keys (queryAId:queryBId).
125
- // `jobIds` is managed by the platform when the matrix is saved; leave it empty
126
- // on first creation and the backend fills it after the first save.
127
- manager.matrices = [
128
- {
129
- id: "matrix-main",
130
- name: "Structural vs MEP",
131
- queryIds: ["q-structural", "q-mep"],
132
- activePairs: ["q-structural:q-mep"],
133
- jobIds: [],
134
- jobType: "hard",
135
- },
136
- ];
137
-
138
- await manager.flush();
139
-
140
- /* MD
141
- ### ▶️ Running clash detection
142
-
143
- `run(jobId)` launches a Web Worker that calls the cloud clash-detection
144
- endpoint. It returns immediately — all feedback arrives through events.
145
-
146
- | Event | Payload | When |
147
- |-------|---------|------|
148
- | `onRunProgress` | `{ message, progress }` | Periodically while the worker runs |
149
- | `onRunComplete` | `{ runId, clashCount }` | Worker finished successfully |
150
- | `onRunError` | `{ code?, message }` | Worker or cloud error |
151
- | `onRunningJobsChanged` | `Set<string>` | A job starts or finishes |
152
- | `onReloadingChanged` | `boolean` | Data reload after a successful run |
153
-
154
- If the page is reloaded while a run is in progress, `init` re-reads the
155
- in-flight execution from storage and populates `runningJobIds`. Call
156
- `reconnectIfRunning(jobId)` to resume receiving progress events for that job.
157
- */
158
-
159
- manager.onRunProgress.add(({ message, progress }) => {
160
- console.log(`[${progress}%] ${message}`);
161
- });
162
-
163
- manager.onRunComplete.add(({ runId, clashCount }) => {
164
- console.log(`Run ${runId} complete — ${clashCount} clash(es) found.`);
165
- });
166
-
167
- manager.onRunError.add(({ code, message }) => {
168
- console.error(`Run failed (${code ?? "unknown"}): ${message}`);
169
- });
170
-
171
- manager.onReloadingChanged.add((reloading) => {
172
- // Use this flag to show a loading state in a custom UI while fresh data
173
- // is fetched from storage after the run. clashes-panel handles this automatically.
174
- console.log(reloading ? "Reloading clash data…" : "Clash data ready.");
175
- });
176
-
177
- // Guard: only run if the manager is ready and the job is not already running.
178
- const jobToRun = manager.jobs[0];
179
- if (jobToRun && manager.ready && !manager.runningJobIds.has(jobToRun.id)) {
180
- manager.run(jobToRun.id);
181
- }
182
-
183
- // If a run was already in progress before this page loaded, reconnect to it.
184
- for (const jobId of manager.runningJobIds) {
185
- manager.reconnectIfRunning(jobId);
186
- }
187
-
188
- /* MD
189
- ### ✅ Updating clash status
190
-
191
- Each clash starts with status `"new"`. Reviewers move clashes through a
192
- workflow by calling `updateClash`. Valid statuses are:
193
-
194
- - `"new"` — detected, not yet reviewed
195
- - `"active"` — under investigation
196
- - `"acknowledged"` — known issue, not blocking
197
- - `"resolved"` — fixed and verified
198
-
199
- Status changes and comments are persisted automatically via the same
200
- auto-save mechanism as queries and matrices.
201
-
202
- `runsForJob(jobId)` and `clashesForRun(runId)` let you navigate the history:
203
- a clash's `firstSeenRunId` / `lastSeenRunId` span shows across which runs it
204
- was present, so you can determine whether a resolution actually closed it.
205
- */
206
-
207
- manager.onClashStatusChanged.add((allClashes) => {
208
- const open = allClashes.filter(c => c.status === "new" || c.status === "active");
209
- console.log(`Open clashes: ${open.length}`);
210
- });
211
-
212
- const clashToAcknowledge = manager.clashes[0];
213
- if (clashToAcknowledge) {
214
- manager.updateClash(clashToAcknowledge.id, {
215
- status: "acknowledged",
216
- comments: "Coordination with MEP team scheduled for next sprint.",
217
- });
218
- }
219
-
220
- // Navigate run history for the first job.
221
- const firstJob = manager.jobs[0];
222
- if (firstJob) {
223
- const runs = manager.runsForJob(firstJob.id); // newest first
224
- const latestRun = runs[0];
225
- if (latestRun) {
226
- const clashesInRun = manager.clashesForRun(latestRun.id);
227
- console.log(`Latest run has ${clashesInRun.length} active clash(es).`);
228
- }
229
- }
230
-
231
- /* MD
232
- ### 📍 Visualization without the built-in panel
233
-
234
- If you are building a custom UI and not using `clashes-panel`, you can drive
235
- the visualization layer directly.
236
-
237
- **Sphere markers** — `showMarkers` places colored 3D spheres at clash
238
- locations in the viewer. Call `hideMarkers` to remove them and re-enable
239
- hover highlighting. Points are automatically transformed from IFC world space
240
- to Three.js viewer space using `FragmentsManager.baseCoordinationMatrix`.
241
-
242
- **Element highlights** — `highlightAllClashes` colors element A (green) and
243
- element B (red) for every new/active clash in the provided list.
244
- `clearClashHighlight` removes both styles. For single-clash focus, use
245
- `highlightClash` and pair it with `ghostClashes` to dim everything else.
246
-
247
- **Clustering** — `cluster(clashes, threshold)` groups spatially close clashes
248
- into a single marker. Pass `threshold = 0` to show one sphere per clash.
249
- `toViewerPoint` converts a raw IFC point to viewer space if you need to
250
- position custom objects.
251
- */
252
-
253
- const jobClashes = manager.clashes.filter(c => c.jobId === firstJob?.id);
254
-
255
- // Show one marker per clash, colored by status.
256
- manager.showMarkers(
257
- jobClashes.map(c => ({ id: c.id, point: c.point, count: 1, status: c.status })),
258
- );
259
-
260
- // Highlight all open clashes across both element sets.
261
- manager.highlightAllClashes(jobClashes);
262
-
263
- // --- Clustered view ---
264
- // Group clashes within 2 m of each other into a single sphere.
265
- const clusters = manager.cluster(jobClashes, 2);
266
- manager.showMarkers(
267
- clusters.map(group => ({
268
- point: group[0].point,
269
- count: group.length,
270
- status: group[0].status,
271
- })),
272
- );
273
-
274
- // Focus on a single clash: ghost everything else and zoom in.
275
- const focusClash = jobClashes[0];
276
- if (focusClash) {
277
- manager.clearClashHighlight();
278
- manager.highlightClash(focusClash);
279
- await manager.ghostClash(focusClash);
280
- }
281
-
282
- // Restore full scene when done.
283
- manager.hideMarkers();
284
- manager.clearClashHighlight();
285
- await manager.clearGhostClash();
1
+ /* MD
2
+ ## ClashesManager
3
+ ---
4
+ Structural engineers and BIM coordinators routinely detect geometric clashes
5
+ between disciplines — structural steel penetrating ductwork, pipes clashing
6
+ with slabs — and need to track the status of each issue through resolution
7
+ without leaving their BIM environment.
8
+
9
+ ClashesManager is the platform-side component that owns clash data: it loads and
10
+ persists jobs, runs, and clashes; launches cloud-based clash detection in a Web
11
+ Worker; and exposes the events and methods needed to build review workflows on
12
+ top of it.
13
+
14
+ This tutorial covers initializing the manager from the platform client; the
15
+ recommended `clashes-panel` UI that works out of the box once `init` has been
16
+ called; defining queries and detection matrices for fine-grained control;
17
+ launching a detection run and tracking progress; updating clash status
18
+ programmatically; and rendering sphere markers and element highlights without
19
+ the built-in panel.
20
+
21
+ By the end, you'll understand every public surface of ClashesManager and know
22
+ which parts are handled automatically by `clashes-panel` so you can decide how
23
+ much of the stack you need for your use case.
24
+ */
25
+
26
+ import * as THREE from "three";
27
+ import * as OBC from "@thatopen/components";
28
+ import * as OBF from "@thatopen/components-front";
29
+ import * as FRAGS from "@thatopen/fragments";
30
+ import * as BUI from "@thatopen/ui";
31
+ import { PlatformClient, ClashesManager } from "@thatopen/services";
32
+
33
+
34
+ const client = PlatformClient.fromPlatformContext();
35
+
36
+ const { components } = (await client.setup(
37
+ { OBC, OBF, BUI, THREE, FRAGS },
38
+ { uuid: ClashesManager.uuid },
39
+ )) as { components: OBC.Components };
40
+
41
+ /* MD
42
+ ### 🚀 Initializing the manager
43
+
44
+ `init(client)` is the only call required before using the manager. It:
45
+
46
+ - Loads all persisted clash data (jobs, runs, clashes, queries, matrices) from
47
+ the project's cloud storage into memory.
48
+ - Registers `save` and `reload` callbacks so writes are debounced to storage
49
+ automatically and the manager can refresh its data after a run completes.
50
+ - Reads any in-flight cloud executions so that a page reload mid-run doesn't
51
+ lose track of the job.
52
+ - Resolves the engine's active `World` in the background — if no world exists
53
+ yet, it waits until one is created, so the order of initialization does not
54
+ matter.
55
+
56
+ After `init` resolves, `manager.ready` is `true` and all data properties
57
+ (`jobs`, `runs`, `clashes`, `queries`, `matrices`) are populated.
58
+ */
59
+
60
+ const manager = components.get(ClashesManager);
61
+ await manager.init(client);
62
+
63
+ console.log(
64
+ `Loaded ${manager.jobs.length} jobs, ` +
65
+ `${manager.runs.length} runs, ` +
66
+ `${manager.clashes.length} clashes.`,
67
+ );
68
+
69
+ /* MD
70
+ ### 🖥️ Adding the built-in panel (recommended)
71
+
72
+ Once `init` has been called, the `<top-clashes-panel>` web component is the
73
+ recommended way to interact with `ClashesManager`. It covers the full
74
+ review workflow — detection matrix, clash table, sphere markers, status
75
+ filters, run progress — with zero additional wiring.
76
+
77
+ `clashes-panel` is registered when `UIManager` is included in the platform
78
+ setup call. See the **clashes-panel** tutorial for the complete setup and a
79
+ detailed breakdown of everything the panel manages automatically.
80
+
81
+ The sections below are for cases where you need direct control: building a
82
+ custom UI, integrating clash data into your own panels, or automating status
83
+ updates from outside the panel.
84
+ */
85
+
86
+ /* MD
87
+ ### 📐 Queries and matrices
88
+
89
+ A `ClashQuery` defines a named set of model elements: which files to scan and,
90
+ optionally, which IFC categories or attribute conditions to match. Queries have
91
+ no detection logic of their own — they are inputs to a matrix.
92
+
93
+ A `ClashMatrix` pairs queries in an upper-triangle grid. Each active cell
94
+ corresponds to one `ClashJob` that the cloud worker will execute. The matrix
95
+ also carries the clash type (`hard` or `clearance`) and, for clearance checks,
96
+ the tolerance in metres.
97
+
98
+ Assigning to `manager.queries` or `manager.matrices` triggers a debounced
99
+ auto-save (2 s). Call `await manager.flush()` to persist immediately before
100
+ navigating away.
101
+ */
102
+
103
+ const structuralFileId = "file-id-of-structural-model";
104
+ const mepFileId = "file-id-of-mep-model";
105
+
106
+ manager.queries = [
107
+ {
108
+ id: "q-structural",
109
+ name: "Structural",
110
+ modelFileIds: [structuralFileId],
111
+ query: { categories: ["IFCBEAM", "IFCCOLUMN", "IFCSLAB"] },
112
+ },
113
+ {
114
+ id: "q-mep",
115
+ name: "MEP",
116
+ modelFileIds: [mepFileId],
117
+ // Omitting `query` matches all elements with geometry in the listed files.
118
+ },
119
+ ];
120
+
121
+ // The matrix below defines a single hard-clash job between Structural and MEP.
122
+ // `activePairs` lists the upper-triangle cell keys (queryAId:queryBId).
123
+ // `jobIds` is managed by the platform when the matrix is saved; leave it empty
124
+ // on first creation and the backend fills it after the first save.
125
+ manager.matrices = [
126
+ {
127
+ id: "matrix-main",
128
+ name: "Structural vs MEP",
129
+ queryIds: ["q-structural", "q-mep"],
130
+ activePairs: ["q-structural:q-mep"],
131
+ jobIds: [],
132
+ jobType: "hard",
133
+ },
134
+ ];
135
+
136
+ await manager.flush();
137
+
138
+ /* MD
139
+ ### ▶️ Running clash detection
140
+
141
+ `run(jobId)` launches a Web Worker that calls the cloud clash-detection
142
+ endpoint. It returns immediately — all feedback arrives through events.
143
+
144
+ | Event | Payload | When |
145
+ |-------|---------|------|
146
+ | `onRunProgress` | `{ message, progress }` | Periodically while the worker runs |
147
+ | `onRunComplete` | `{ runId, clashCount }` | Worker finished successfully |
148
+ | `onRunError` | `{ code?, message }` | Worker or cloud error |
149
+ | `onRunningJobsChanged` | `Set<string>` | A job starts or finishes |
150
+ | `onReloadingChanged` | `boolean` | Data reload after a successful run |
151
+
152
+ If the page is reloaded while a run is in progress, `init` re-reads the
153
+ in-flight execution from storage and populates `runningJobIds`. Call
154
+ `reconnectIfRunning(jobId)` to resume receiving progress events for that job.
155
+ */
156
+
157
+ manager.onRunProgress.add(({ message, progress }) => {
158
+ console.log(`[${progress}%] ${message}`);
159
+ });
160
+
161
+ manager.onRunComplete.add(({ runId, clashCount }) => {
162
+ console.log(`Run ${runId} complete — ${clashCount} clash(es) found.`);
163
+ });
164
+
165
+ manager.onRunError.add(({ code, message }) => {
166
+ console.error(`Run failed (${code ?? "unknown"}): ${message}`);
167
+ });
168
+
169
+ manager.onReloadingChanged.add((reloading) => {
170
+ // Use this flag to show a loading state in a custom UI while fresh data
171
+ // is fetched from storage after the run. clashes-panel handles this automatically.
172
+ console.log(reloading ? "Reloading clash data…" : "Clash data ready.");
173
+ });
174
+
175
+ // Guard: only run if the manager is ready and the job is not already running.
176
+ const jobToRun = manager.jobs[0];
177
+ if (jobToRun && manager.ready && !manager.runningJobIds.has(jobToRun.id)) {
178
+ manager.run(jobToRun.id);
179
+ }
180
+
181
+ // If a run was already in progress before this page loaded, reconnect to it.
182
+ for (const jobId of manager.runningJobIds) {
183
+ manager.reconnectIfRunning(jobId);
184
+ }
185
+
186
+ /* MD
187
+ ### ✅ Updating clash status
188
+
189
+ Each clash starts with status `"new"`. Reviewers move clashes through a
190
+ workflow by calling `updateClash`. Valid statuses are:
191
+
192
+ - `"new"` — detected, not yet reviewed
193
+ - `"active"` — under investigation
194
+ - `"acknowledged"` — known issue, not blocking
195
+ - `"resolved"` — fixed and verified
196
+
197
+ Status changes and comments are persisted automatically via the same
198
+ auto-save mechanism as queries and matrices.
199
+
200
+ `runsForJob(jobId)` and `clashesForRun(runId)` let you navigate the history:
201
+ a clash's `firstSeenRunId` / `lastSeenRunId` span shows across which runs it
202
+ was present, so you can determine whether a resolution actually closed it.
203
+ */
204
+
205
+ manager.onClashStatusChanged.add((allClashes) => {
206
+ const open = allClashes.filter(c => c.status === "new" || c.status === "active");
207
+ console.log(`Open clashes: ${open.length}`);
208
+ });
209
+
210
+ const clashToAcknowledge = manager.clashes[0];
211
+ if (clashToAcknowledge) {
212
+ manager.updateClash(clashToAcknowledge.id, {
213
+ status: "acknowledged",
214
+ comments: "Coordination with MEP team scheduled for next sprint.",
215
+ });
216
+ }
217
+
218
+ // Navigate run history for the first job.
219
+ const firstJob = manager.jobs[0];
220
+ if (firstJob) {
221
+ const runs = manager.runsForJob(firstJob.id); // newest first
222
+ const latestRun = runs[0];
223
+ if (latestRun) {
224
+ const clashesInRun = manager.clashesForRun(latestRun.id);
225
+ console.log(`Latest run has ${clashesInRun.length} active clash(es).`);
226
+ }
227
+ }
228
+
229
+ /* MD
230
+ ### 📍 Visualization without the built-in panel
231
+
232
+ If you are building a custom UI and not using `clashes-panel`, you can drive
233
+ the visualization layer directly.
234
+
235
+ **Sphere markers** — `showMarkers` places colored 3D spheres at clash
236
+ locations in the viewer. Call `hideMarkers` to remove them and re-enable
237
+ hover highlighting. Points are automatically transformed from IFC world space
238
+ to Three.js viewer space using `FragmentsManager.baseCoordinationMatrix`.
239
+
240
+ **Element highlights** — `highlightAllClashes` colors element A (green) and
241
+ element B (red) for every new/active clash in the provided list.
242
+ `clearClashHighlight` removes both styles. For single-clash focus, use
243
+ `highlightClash` and pair it with `ghostClashes` to dim everything else.
244
+
245
+ **Clustering** — `cluster(clashes, threshold)` groups spatially close clashes
246
+ into a single marker. Pass `threshold = 0` to show one sphere per clash.
247
+ `toViewerPoint` converts a raw IFC point to viewer space if you need to
248
+ position custom objects.
249
+ */
250
+
251
+ const jobClashes = manager.clashes.filter(c => c.jobId === firstJob?.id);
252
+
253
+ // Show one marker per clash, colored by status.
254
+ manager.showMarkers(
255
+ jobClashes.map(c => ({ id: c.id, point: c.point, count: 1, status: c.status })),
256
+ );
257
+
258
+ // Highlight all open clashes across both element sets.
259
+ manager.highlightAllClashes(jobClashes);
260
+
261
+ // --- Clustered view ---
262
+ // Group clashes within 2 m of each other into a single sphere.
263
+ const clusters = manager.cluster(jobClashes, 2);
264
+ manager.showMarkers(
265
+ clusters.map(group => ({
266
+ point: group[0].point,
267
+ count: group.length,
268
+ status: group[0].status,
269
+ })),
270
+ );
271
+
272
+ // Focus on a single clash: ghost everything else and zoom in.
273
+ const focusClash = jobClashes[0];
274
+ if (focusClash) {
275
+ manager.clearClashHighlight();
276
+ manager.highlightClash(focusClash);
277
+ await manager.ghostClash(focusClash);
278
+ }
279
+
280
+ // Restore full scene when done.
281
+ manager.hideMarkers();
282
+ manager.clearClashHighlight();
283
+ await manager.clearGhostClash();
@@ -27,11 +27,9 @@ import * as OBC from "@thatopen/components";
27
27
  import * as OBF from "@thatopen/components-front";
28
28
  import * as FRAGS from "@thatopen/fragments";
29
29
  import * as BUI from "@thatopen/ui";
30
- import { PlatformClient } from "thatopen-services";
31
- import uiManagerDef from "../../index";
30
+ import { PlatformClient, UIManager } from "@thatopen/services";
32
31
  import type { App } from "./index";
33
32
 
34
- const UIManager = uiManagerDef.componentDefinition;
35
33
 
36
34
  const client = PlatformClient.fromPlatformContext();
37
35
 
@@ -29,8 +29,7 @@ import * as OBC from "@thatopen/components";
29
29
  import * as OBF from "@thatopen/components-front";
30
30
  import * as FRAGS from "@thatopen/fragments";
31
31
  import * as BUI from "@thatopen/ui";
32
- import { PlatformClient } from "thatopen-services";
33
- import uiManagerDef from "../../../../index";
32
+ import { PlatformClient, UIManager } from "@thatopen/services";
34
33
  import {
35
34
  appStateContext,
36
35
  AppState,
@@ -93,7 +92,6 @@ class ResultCounter extends LitElement {
93
92
 
94
93
  // ---- app wiring ----
95
94
 
96
- const UIManager = uiManagerDef.componentDefinition;
97
95
  const client = PlatformClient.fromPlatformContext();
98
96
  const { components } = (await client.setup(
99
97
  { OBC, OBF, BUI, THREE, FRAGS },
@@ -28,8 +28,7 @@ import * as OBC from "@thatopen/components";
28
28
  import * as OBF from "@thatopen/components-front";
29
29
  import * as FRAGS from "@thatopen/fragments";
30
30
  import * as BUI from "@thatopen/ui";
31
- import { PlatformClient } from "thatopen-services";
32
- import uiManagerDef from "../../../../index";
31
+ import { PlatformClient, UIManager } from "@thatopen/services";
33
32
  import type { App } from "../../index";
34
33
 
35
34
  // A child component that controls a banner without holding a reference to top-app.
@@ -116,7 +115,6 @@ class BannerController extends LitElement {
116
115
 
117
116
  // ---- app wiring ----
118
117
 
119
- const UIManager = uiManagerDef.componentDefinition;
120
118
  const client = PlatformClient.fromPlatformContext();
121
119
  const { components } = (await client.setup(
122
120
  { OBC, OBF, BUI, THREE, FRAGS },