@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.
- package/docs/builtin/paths.json +86 -86
- package/package.json +95 -95
- package/src/built-in/CDEManager/example.ts +1 -1
- package/src/built-in/CDEManager/examples/FileOperations/example.ts +1 -1
- package/src/built-in/ClashesManager/example.ts +283 -285
- package/src/built-in/UIManager/src/app/example.ts +1 -3
- package/src/built-in/UIManager/src/app/examples/AppState/example.ts +1 -3
- package/src/built-in/UIManager/src/app/examples/Banner/example.ts +1 -3
- package/src/built-in/UIManager/src/app/examples/Contexts/example.ts +1 -3
- package/src/built-in/UIManager/src/app/examples/FileDrop/example.ts +1 -3
- package/src/built-in/UIManager/src/app/examples/FloatingLayout/example.ts +1 -3
- package/src/built-in/UIManager/src/app/examples/Modal/example.ts +1 -3
- package/src/built-in/UIManager/src/app/examples/Notifications/example.ts +1 -3
- package/src/built-in/UIManager/src/app/examples/Sidebar/example.ts +1 -3
- package/src/built-in/UIManager/src/clashes-panel/example.ts +160 -164
- package/src/built-in/UIManager/src/models-list/example.ts +1 -3
|
@@ -27,8 +27,7 @@ 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, ProjectData } from "thatopen
|
|
31
|
-
import uiManagerDef from "../../../../index";
|
|
30
|
+
import { PlatformClient, ProjectData, UIManager } from "@thatopen/services";
|
|
32
31
|
import {
|
|
33
32
|
componentsContext,
|
|
34
33
|
clientContext,
|
|
@@ -78,7 +77,6 @@ class ProjectInfoPanel extends LitElement {
|
|
|
78
77
|
|
|
79
78
|
// ---- app wiring ----
|
|
80
79
|
|
|
81
|
-
const UIManager = uiManagerDef.componentDefinition;
|
|
82
80
|
const client = PlatformClient.fromPlatformContext();
|
|
83
81
|
const { components } = (await client.setup(
|
|
84
82
|
{ OBC, OBF, BUI, THREE, FRAGS },
|
|
@@ -30,11 +30,9 @@ import * as OBC from "@thatopen/components";
|
|
|
30
30
|
import * as OBF from "@thatopen/components-front";
|
|
31
31
|
import * as FRAGS from "@thatopen/fragments";
|
|
32
32
|
import * as BUI from "@thatopen/ui";
|
|
33
|
-
import { PlatformClient } from "thatopen
|
|
34
|
-
import uiManagerDef from "../../../../index";
|
|
33
|
+
import { PlatformClient, UIManager } from "@thatopen/services";
|
|
35
34
|
import type { App, AppReadyEvent } from "../../index";
|
|
36
35
|
|
|
37
|
-
const UIManager = uiManagerDef.componentDefinition;
|
|
38
36
|
const client = PlatformClient.fromPlatformContext();
|
|
39
37
|
const { components } = (await client.setup(
|
|
40
38
|
{ OBC, OBF, BUI, THREE, FRAGS },
|
|
@@ -26,11 +26,9 @@ import * as OBC from "@thatopen/components";
|
|
|
26
26
|
import * as OBF from "@thatopen/components-front";
|
|
27
27
|
import * as FRAGS from "@thatopen/fragments";
|
|
28
28
|
import * as BUI from "@thatopen/ui";
|
|
29
|
-
import { PlatformClient } from "thatopen
|
|
30
|
-
import uiManagerDef from "../../../../index";
|
|
29
|
+
import { PlatformClient, UIManager } from "@thatopen/services";
|
|
31
30
|
import type { App } from "../../index";
|
|
32
31
|
|
|
33
|
-
const UIManager = uiManagerDef.componentDefinition;
|
|
34
32
|
const client = PlatformClient.fromPlatformContext();
|
|
35
33
|
const { components } = (await client.setup(
|
|
36
34
|
{ OBC, OBF, BUI, THREE, FRAGS },
|
|
@@ -27,8 +27,7 @@ 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
|
|
31
|
-
import uiManagerDef from "../../../../index";
|
|
30
|
+
import { PlatformClient, UIManager } from "@thatopen/services";
|
|
32
31
|
import type { App } from "../../index";
|
|
33
32
|
|
|
34
33
|
// A child component that triggers modals without holding a reference to top-app.
|
|
@@ -120,7 +119,6 @@ class ModalActions extends LitElement {
|
|
|
120
119
|
|
|
121
120
|
// ---- app wiring ----
|
|
122
121
|
|
|
123
|
-
const UIManager = uiManagerDef.componentDefinition;
|
|
124
122
|
const client = PlatformClient.fromPlatformContext();
|
|
125
123
|
const { components } = (await client.setup(
|
|
126
124
|
{ OBC, OBF, BUI, THREE, FRAGS },
|
|
@@ -26,8 +26,7 @@ import * as OBC from "@thatopen/components";
|
|
|
26
26
|
import * as OBF from "@thatopen/components-front";
|
|
27
27
|
import * as FRAGS from "@thatopen/fragments";
|
|
28
28
|
import * as BUI from "@thatopen/ui";
|
|
29
|
-
import { PlatformClient } from "thatopen
|
|
30
|
-
import uiManagerDef from "../../../../index";
|
|
29
|
+
import { PlatformClient, UIManager } from "@thatopen/services";
|
|
31
30
|
import type { App, AppReadyEvent } from "../../index";
|
|
32
31
|
|
|
33
32
|
// A child component that dispatches top:notification to surface messages
|
|
@@ -83,7 +82,6 @@ class StatusReporter extends LitElement {
|
|
|
83
82
|
|
|
84
83
|
// ---- app wiring ----
|
|
85
84
|
|
|
86
|
-
const UIManager = uiManagerDef.componentDefinition;
|
|
87
85
|
const client = PlatformClient.fromPlatformContext();
|
|
88
86
|
const { components } = (await client.setup(
|
|
89
87
|
{ OBC, OBF, BUI, THREE, FRAGS },
|
|
@@ -24,11 +24,9 @@ import * as OBC from "@thatopen/components";
|
|
|
24
24
|
import * as OBF from "@thatopen/components-front";
|
|
25
25
|
import * as FRAGS from "@thatopen/fragments";
|
|
26
26
|
import * as BUI from "@thatopen/ui";
|
|
27
|
-
import { PlatformClient } from "thatopen
|
|
28
|
-
import uiManagerDef from "../../../../index";
|
|
27
|
+
import { PlatformClient, UIManager } from "@thatopen/services";
|
|
29
28
|
import type { App } from "../../index";
|
|
30
29
|
|
|
31
|
-
const UIManager = uiManagerDef.componentDefinition;
|
|
32
30
|
const client = PlatformClient.fromPlatformContext();
|
|
33
31
|
const { components } = (await client.setup(
|
|
34
32
|
{ OBC, OBF, BUI, THREE, FRAGS },
|
|
@@ -1,164 +1,160 @@
|
|
|
1
|
-
/* MD
|
|
2
|
-
## clashes-panel
|
|
3
|
-
---
|
|
4
|
-
BIM coordinators need a dedicated review environment where they can see all
|
|
5
|
-
detected clashes, filter by status, navigate to each issue in the 3D viewer,
|
|
6
|
-
and mark items as resolved — without writing any UI code themselves.
|
|
7
|
-
|
|
8
|
-
`clashes-panel` is a ready-made web component that delivers exactly that. It
|
|
9
|
-
connects to `ClashesManager` automatically and manages the entire review
|
|
10
|
-
workflow: the detection matrix, the clash table with status filters, sphere
|
|
11
|
-
markers and element highlights in the viewer, run controls with live progress,
|
|
12
|
-
and a loading skeleton while fresh data reloads after a run completes.
|
|
13
|
-
|
|
14
|
-
This tutorial covers the prerequisites before mounting the panel; dropping it
|
|
15
|
-
into a `top-app` layout alongside a 3D viewer; and a detailed breakdown of
|
|
16
|
-
everything the panel handles automatically so you know what you do not need to
|
|
17
|
-
implement yourself.
|
|
18
|
-
|
|
19
|
-
By the end, you'll have a fully working clash-review environment running in
|
|
20
|
-
your application with a single line of markup.
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
import { html } from "lit";
|
|
24
|
-
import * as THREE from "three";
|
|
25
|
-
import * as OBC from "@thatopen/components";
|
|
26
|
-
import * as OBF from "@thatopen/components-front";
|
|
27
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
28
|
-
import * as BUI from "@thatopen/ui";
|
|
29
|
-
import { PlatformClient } from "thatopen
|
|
30
|
-
import
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
the user
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
the
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
**
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
**Disconnection cleanup** — when the panel is removed from the DOM it calls
|
|
162
|
-
`hideMarkers` and `clearClashHighlight` on the manager, leaving the 3D scene
|
|
163
|
-
clean regardless of what was selected at the time.
|
|
164
|
-
*/
|
|
1
|
+
/* MD
|
|
2
|
+
## clashes-panel
|
|
3
|
+
---
|
|
4
|
+
BIM coordinators need a dedicated review environment where they can see all
|
|
5
|
+
detected clashes, filter by status, navigate to each issue in the 3D viewer,
|
|
6
|
+
and mark items as resolved — without writing any UI code themselves.
|
|
7
|
+
|
|
8
|
+
`clashes-panel` is a ready-made web component that delivers exactly that. It
|
|
9
|
+
connects to `ClashesManager` automatically and manages the entire review
|
|
10
|
+
workflow: the detection matrix, the clash table with status filters, sphere
|
|
11
|
+
markers and element highlights in the viewer, run controls with live progress,
|
|
12
|
+
and a loading skeleton while fresh data reloads after a run completes.
|
|
13
|
+
|
|
14
|
+
This tutorial covers the prerequisites before mounting the panel; dropping it
|
|
15
|
+
into a `top-app` layout alongside a 3D viewer; and a detailed breakdown of
|
|
16
|
+
everything the panel handles automatically so you know what you do not need to
|
|
17
|
+
implement yourself.
|
|
18
|
+
|
|
19
|
+
By the end, you'll have a fully working clash-review environment running in
|
|
20
|
+
your application with a single line of markup.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import { html } from "lit";
|
|
24
|
+
import * as THREE from "three";
|
|
25
|
+
import * as OBC from "@thatopen/components";
|
|
26
|
+
import * as OBF from "@thatopen/components-front";
|
|
27
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
28
|
+
import * as BUI from "@thatopen/ui";
|
|
29
|
+
import { PlatformClient, UIManager, ClashesManager } from "@thatopen/services";
|
|
30
|
+
import type { App } from "../app/index";
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
/* MD
|
|
34
|
+
### ✅ Prerequisites
|
|
35
|
+
|
|
36
|
+
Two conditions must be met before the panel mounts:
|
|
37
|
+
|
|
38
|
+
1. **`UIManager` must be in the setup call.** It registers all platform web
|
|
39
|
+
components, including `<top-clashes-panel>` itself. Without it the element is
|
|
40
|
+
unknown to the browser and renders as an empty box.
|
|
41
|
+
|
|
42
|
+
2. **`ClashesManager.init(client)` must have resolved.** The panel reads all
|
|
43
|
+
its initial data from the manager in `connectedCallback`. If `init` has not
|
|
44
|
+
finished, the panel mounts into an empty state and never catches up because
|
|
45
|
+
it only subscribes to change events — it does not poll.
|
|
46
|
+
|
|
47
|
+
Both conditions are naturally satisfied when you call `init` before appending
|
|
48
|
+
`top-app` to the document, which is the pattern shown below.
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
const client = PlatformClient.fromPlatformContext();
|
|
52
|
+
|
|
53
|
+
const { components } = (await client.setup(
|
|
54
|
+
{ OBC, OBF, BUI, THREE, FRAGS },
|
|
55
|
+
{ uuid: UIManager.uuid },
|
|
56
|
+
{ uuid: ClashesManager.uuid },
|
|
57
|
+
)) as { components: OBC.Components };
|
|
58
|
+
|
|
59
|
+
components.get(UIManager).init();
|
|
60
|
+
|
|
61
|
+
// init must resolve before top-app (and therefore clashes-panel) mounts.
|
|
62
|
+
await components.get(ClashesManager).init(client);
|
|
63
|
+
|
|
64
|
+
/* MD
|
|
65
|
+
### 🖥️ Wiring the panel
|
|
66
|
+
|
|
67
|
+
Add `clashes-panel` as a named area in `app.elements` and reference it in your
|
|
68
|
+
layout template. A side-by-side layout with the 3D viewer is the most natural
|
|
69
|
+
arrangement — the panel controls markers and highlights directly in the scene.
|
|
70
|
+
*/
|
|
71
|
+
|
|
72
|
+
const app = document.createElement("top-app") as unknown as App;
|
|
73
|
+
|
|
74
|
+
app.setup = (waitUntil) => {
|
|
75
|
+
waitUntil(
|
|
76
|
+
(async () => {
|
|
77
|
+
const fragments = components.get(OBC.FragmentsManager);
|
|
78
|
+
const workerUrl = await FRAGS.FragmentsModels.getWorker();
|
|
79
|
+
fragments.init(await FRAGS.toClassicWorker(workerUrl), { classicWorker: true });
|
|
80
|
+
})(),
|
|
81
|
+
"Fragments Core",
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
waitUntil(
|
|
85
|
+
(async () => {
|
|
86
|
+
const loader = components.get(OBC.IfcLoader);
|
|
87
|
+
await loader.setup();
|
|
88
|
+
})(),
|
|
89
|
+
"IFC Loader",
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
return { components, client };
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
app.elements = {
|
|
96
|
+
viewer: () => html`<top-viewer><top-viewer-tools></top-viewer-tools></top-viewer>`,
|
|
97
|
+
clashes: () => html`<top-clashes-panel></top-clashes-panel>`,
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
app.layouts = {
|
|
101
|
+
main: {
|
|
102
|
+
label: "Main",
|
|
103
|
+
icon: "solar:3d-square-bold",
|
|
104
|
+
template: `"viewer clashes" 1fr / 1fr 22rem`,
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
app.layout = "main";
|
|
109
|
+
|
|
110
|
+
const container = document.getElementById("that-open-app") ?? document.body;
|
|
111
|
+
container.appendChild(app);
|
|
112
|
+
document.body.style.margin = "0";
|
|
113
|
+
|
|
114
|
+
/* MD
|
|
115
|
+
### 🤖 What the panel manages automatically
|
|
116
|
+
|
|
117
|
+
Once mounted, `clashes-panel` takes ownership of the following without any
|
|
118
|
+
further code from you:
|
|
119
|
+
|
|
120
|
+
**Data synchronization** — the panel subscribes to every `ClashesManager`
|
|
121
|
+
event (`onJobsChanged`, `onRunsChanged`, `onClashesChanged`,
|
|
122
|
+
`onClashStatusChanged`, `onQueriesChanged`, `onRunningJobsChanged`) and keeps
|
|
123
|
+
its tables in sync. Changes made programmatically through the manager API are
|
|
124
|
+
reflected in the panel immediately.
|
|
125
|
+
|
|
126
|
+
**Run lifecycle** — a progress callout appears as soon as a run starts
|
|
127
|
+
(`onRunProgress`), updates its percentage and message in real time, and
|
|
128
|
+
disappears when the run completes or errors. If a run was already in progress
|
|
129
|
+
when the page loaded, the panel calls `reconnectIfRunning` automatically when
|
|
130
|
+
the user opens that job.
|
|
131
|
+
|
|
132
|
+
**Post-run reload skeleton** — after a successful run the manager reloads clash
|
|
133
|
+
data from storage. During that window (`onReloadingChanged = true`) the panel
|
|
134
|
+
replaces its entire content with an animated skeleton so the user is never left
|
|
135
|
+
looking at stale results that appear final.
|
|
136
|
+
|
|
137
|
+
**Sphere markers** — entering a job view places colored spheres in the 3D scene
|
|
138
|
+
at each clash location, transformed from IFC world space to viewer space.
|
|
139
|
+
Selecting a clash in the table zooms the camera, ghosts unrelated elements, and
|
|
140
|
+
re-focuses the markers on the selection. Leaving the job view removes all
|
|
141
|
+
markers and restores the full scene.
|
|
142
|
+
|
|
143
|
+
**Element highlights** — element A is highlighted green and element B red for
|
|
144
|
+
every new or active clash in the current job. Selecting a single clash refines
|
|
145
|
+
the highlight to that pair only. Clearing the selection or changing status
|
|
146
|
+
restores the full job highlight.
|
|
147
|
+
|
|
148
|
+
**Model awareness** — the panel tracks which fragment models are currently
|
|
149
|
+
loaded in the scene. Markers and highlights are activated only when the relevant
|
|
150
|
+
models are present, and are cleaned up automatically if a model is disposed
|
|
151
|
+
while the panel is open.
|
|
152
|
+
|
|
153
|
+
**Save indicator** — a subtle indicator appears while auto-save is in progress
|
|
154
|
+
(`onSaveStart`) and disappears once the write confirms (`onSaveComplete`), so
|
|
155
|
+
users know their status changes and query edits are persisted.
|
|
156
|
+
|
|
157
|
+
**Disconnection cleanup** — when the panel is removed from the DOM it calls
|
|
158
|
+
`hideMarkers` and `clearClashHighlight` on the manager, leaving the 3D scene
|
|
159
|
+
clean regardless of what was selected at the time.
|
|
160
|
+
*/
|
|
@@ -14,12 +14,10 @@ import * as OBC from "@thatopen/components";
|
|
|
14
14
|
import * as OBF from "@thatopen/components-front";
|
|
15
15
|
import * as FRAGS from "@thatopen/fragments";
|
|
16
16
|
import * as BUI from "@thatopen/ui";
|
|
17
|
-
import { PlatformClient } from "thatopen
|
|
18
|
-
import uiManagerDef from "../../index";
|
|
17
|
+
import { PlatformClient, UIManager } from "@thatopen/services";
|
|
19
18
|
import type { App } from "../app/index";
|
|
20
19
|
import type { ModelsList } from "./index";
|
|
21
20
|
|
|
22
|
-
const UIManager = uiManagerDef.componentDefinition;
|
|
23
21
|
|
|
24
22
|
const client = PlatformClient.fromPlatformContext();
|
|
25
23
|
|