@thatopen/services 0.1.3 → 0.3.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/README.md +59 -46
- package/dist/built-in/index.d.ts +486 -563
- package/dist/cli/lib/npmrc.d.ts +28 -0
- package/dist/cli/lib/npmrc.test.d.ts +1 -0
- package/dist/cli.js +91 -7
- package/dist/core/client.d.ts +10 -0
- package/dist/index.cjs.js +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +42 -32
- package/dist/types/npm.d.ts +14 -0
- package/dist/vite-env.d.ts +1 -1
- package/docs/builtin/paths.json +74 -70
- package/docs/cli/create.md +28 -28
- package/docs/cli/local-server.md +38 -38
- package/docs/cli/login.md +32 -32
- package/docs/cli/publish.md +31 -31
- package/docs/cli/run.md +26 -26
- package/docs/cli/serve.md +43 -43
- package/docs/cli/swap.md +30 -30
- package/package.json +100 -100
- package/resources/AGENTS.md +40 -40
- package/src/built-in/CDEManager/example.ts +214 -214
- package/src/built-in/CDEManager/examples/FileEditing/example.ts +226 -226
- package/src/built-in/CDEManager/examples/FileMoves/example.ts +186 -186
- package/src/built-in/CDEManager/examples/FileOperations/example.ts +295 -295
- package/src/built-in/CDEManager/examples/FileTransfers/example.ts +210 -210
- package/src/built-in/CDEManager/examples/FolderManagement/example.ts +230 -230
- package/src/built-in/CDEManager/examples/MetadataSchema/example.ts +230 -230
- package/src/built-in/CDEManager/examples/MetadataViews/example.ts +166 -166
- package/src/built-in/CDEManager/examples/ProjectConfig/example.ts +177 -177
- package/src/built-in/UIManager/src/app/example.ts +99 -99
- package/src/built-in/UIManager/src/app/examples/AppState/example.ts +142 -142
- package/src/built-in/UIManager/src/app/examples/Banner/example.ts +161 -0
- package/src/built-in/UIManager/src/app/examples/Contexts/example.ts +125 -125
- package/src/built-in/UIManager/src/app/examples/FileDrop/example.ts +126 -0
- package/src/built-in/UIManager/src/app/examples/FloatingLayout/example.ts +92 -92
- package/src/built-in/UIManager/src/app/examples/Modal/example.ts +165 -0
- package/src/built-in/UIManager/src/app/examples/Notifications/example.ts +135 -161
- package/src/built-in/UIManager/src/app/examples/Sidebar/example.ts +104 -104
- package/src/built-in/index.ts +649 -755
- package/src/cli/templates/app/README.md +241 -241
- package/src/cli/templates/app/index.html +35 -27
- package/src/cli/templates/app/package.json +31 -27
- package/src/cli/templates/app/src/app.ts +37 -0
- package/src/cli/templates/app/src/assets/tool-placeholder.ts +50 -0
- package/src/cli/templates/app/src/bim-components/CloudRunner/index.ts +95 -87
- package/src/cli/templates/app/src/bim-components/CloudRunner/src/index.ts +1 -1
- package/src/cli/templates/app/src/bim-components/CloudRunner/src/types.ts +5 -5
- package/src/cli/templates/app/src/bim-components/index.ts +1 -1
- package/src/cli/templates/app/src/globals.ts +1 -0
- package/src/cli/templates/app/src/main.ts +340 -56
- package/src/cli/templates/app/src/setups/active-tool-hud.ts +69 -0
- package/src/cli/templates/app/src/setups/camera-tools.ts +63 -0
- package/src/cli/templates/app/src/setups/camera-views.ts +201 -0
- package/src/cli/templates/app/src/setups/card-header.ts +35 -0
- package/src/cli/templates/app/src/setups/clipper-panel.ts +167 -0
- package/src/cli/templates/app/src/setups/clipper-tool.ts +754 -0
- package/src/cli/templates/app/src/setups/clipper.ts +75 -0
- package/src/cli/templates/app/src/setups/cloud-runner.ts +13 -9
- package/src/cli/templates/app/src/setups/commands-panel.ts +239 -0
- package/src/cli/templates/app/src/setups/data-table-panel.ts +2224 -0
- package/src/cli/templates/app/src/setups/exploded-view.ts +246 -0
- package/src/cli/templates/app/src/setups/file-format-icons.ts +95 -0
- package/src/cli/templates/app/src/setups/files-panel.ts +1503 -0
- package/src/cli/templates/app/src/setups/fps-indicator.ts +63 -0
- package/src/cli/templates/app/src/setups/graphics-panel.ts +490 -0
- package/src/cli/templates/app/src/setups/helper-panel.ts +88 -0
- package/src/cli/templates/app/src/setups/hider.ts +98 -0
- package/src/cli/templates/app/src/setups/index.ts +33 -3
- package/src/cli/templates/app/src/setups/inspection.ts +136 -0
- package/src/cli/templates/app/src/setups/measurement-panel.ts +188 -0
- package/src/cli/templates/app/src/setups/measurement-settings-panel.ts +161 -0
- package/src/cli/templates/app/src/setups/measurement-tool.ts +570 -0
- package/src/cli/templates/app/src/setups/measurements.ts +133 -0
- package/src/cli/templates/app/src/setups/model-tree.ts +797 -0
- package/src/cli/templates/app/src/setups/navigation-gizmo.ts +316 -0
- package/src/cli/templates/app/src/setups/objects-panel.ts +127 -0
- package/src/cli/templates/app/src/setups/plans-panel.ts +619 -0
- package/src/cli/templates/app/src/setups/properties-panel.ts +1048 -0
- package/src/cli/templates/app/src/setups/reality-capture/lib/hidden-tiles-plugin.ts +88 -0
- package/src/cli/templates/app/src/setups/reality-capture/lib/point-tile-plugin.ts +166 -0
- package/src/cli/templates/app/src/setups/reality-capture/lib/render-frame.ts +31 -0
- package/src/cli/templates/app/src/setups/reality-capture/lib/splat-tile-plugin.ts +51 -0
- package/src/cli/templates/app/src/setups/reality-capture-viewer.ts +1383 -0
- package/src/cli/templates/app/src/setups/right-sidebar.ts +178 -0
- package/src/cli/templates/app/src/setups/settings-panel.ts +94 -0
- package/src/cli/templates/app/src/setups/styles-panel.ts +110 -0
- package/src/cli/templates/app/src/setups/styles.ts +375 -0
- package/src/cli/templates/app/src/setups/tool-mode-manager.ts +150 -0
- package/src/cli/templates/app/src/setups/tool-mode.ts +23 -0
- package/src/cli/templates/app/src/setups/toolbar.ts +229 -0
- package/src/cli/templates/app/src/setups/ui-manager.ts +27 -0
- package/src/cli/templates/app/src/setups/visibility-toolbar.ts +498 -0
- package/src/cli/templates/app/src/setups/walkthrough.ts +528 -0
- package/src/cli/templates/app/src/ui-components/app-info-section/index.ts +26 -0
- package/src/cli/templates/app/src/ui-components/app-info-section/src/index.ts +1 -0
- package/src/cli/templates/app/src/ui-components/app-info-section/src/types.ts +15 -0
- package/src/cli/templates/app/src/ui-components/cloud-runner-section/index.ts +37 -0
- package/src/cli/templates/app/src/ui-components/cloud-runner-section/src/index.ts +1 -0
- package/src/cli/templates/app/src/ui-components/cloud-runner-section/src/types.ts +14 -0
- package/src/cli/templates/app/src/ui-components/index.ts +2 -1
- package/src/cli/templates/app/tsconfig.json +16 -17
- package/src/cli/templates/app/vite.config.js +45 -42
- package/src/cli/templates/cloud-component/README.md +205 -205
- package/src/cli/templates/cloud-component/_thatopen +5 -5
- package/src/cli/templates/cloud-component/declarations.json +4 -4
- package/src/cli/templates/cloud-component/package.json +21 -21
- package/src/cli/templates/cloud-component/src/main.ts +70 -70
- package/src/cli/templates/cloud-component/tsconfig.json +16 -16
- package/src/cli/templates/cloud-component/vite.config.js +46 -46
- package/src/cli/templates/shared/AGENTS.md +8 -8
- package/src/cli/templates/shared/CLAUDE.md +1 -1
- package/src/cli/templates/shared/_gitignore +5 -4
- package/src/built-in/AppManager/example.ts +0 -86
- package/src/built-in/FileList/example.ts +0 -107
- package/src/built-in/TabbedNavigation/example.ts +0 -115
- package/src/built-in/ViewportsManager/example.ts +0 -106
- package/src/cli/templates/app/src/setups/fragments.ts +0 -18
- package/src/cli/templates/app/src/setups/ifc-loader.ts +0 -12
- package/src/cli/templates/app/src/ui-components/AppPanel/index.ts +0 -160
|
@@ -1,104 +1,104 @@
|
|
|
1
|
-
/* MD
|
|
2
|
-
## Sidebar navigation
|
|
3
|
-
---
|
|
4
|
-
Product teams building BIM apps often need multiple distinct views — a 3D model
|
|
5
|
-
viewer, a data browser, a settings screen — but wiring a custom nav bar and
|
|
6
|
-
managing view transitions from scratch adds complexity before any real feature
|
|
7
|
-
work begins.
|
|
8
|
-
|
|
9
|
-
top-app supports named layouts with a built-in sidebar navigation bar that
|
|
10
|
-
switches the active grid template on click, so teams get multi-view navigation
|
|
11
|
-
without building the scaffolding themselves.
|
|
12
|
-
|
|
13
|
-
This tutorial covers defining three named layouts with their own grid templates
|
|
14
|
-
and icons; providing a dedicated element for each view; enabling the sidebar nav
|
|
15
|
-
bar; and setting the initial active layout.
|
|
16
|
-
|
|
17
|
-
By the end, you'll have a multi-view BIM app with a persistent sidebar that lets
|
|
18
|
-
users switch between a 3D viewer, a data panel, and a settings screen.
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
import { html } from "lit";
|
|
22
|
-
import * as THREE from "three";
|
|
23
|
-
import * as OBC from "@thatopen/components";
|
|
24
|
-
import * as OBF from "@thatopen/components-front";
|
|
25
|
-
import * as FRAGS from "@thatopen/fragments";
|
|
26
|
-
import * as BUI from "@thatopen/ui";
|
|
27
|
-
import { PlatformClient } from "thatopen-services";
|
|
28
|
-
import uiManagerDef from "../../../../index";
|
|
29
|
-
import type { App } from "../../index";
|
|
30
|
-
|
|
31
|
-
const UIManager = uiManagerDef.componentDefinition;
|
|
32
|
-
const client = PlatformClient.fromPlatformContext();
|
|
33
|
-
const { components } = (await client.setup(
|
|
34
|
-
{ OBC, OBF, BUI, THREE, FRAGS },
|
|
35
|
-
{ uuid: UIManager.uuid },
|
|
36
|
-
)) as { components: OBC.Components };
|
|
37
|
-
components.get(UIManager).init();
|
|
38
|
-
|
|
39
|
-
const app = document.createElement("top-app") as unknown as App;
|
|
40
|
-
|
|
41
|
-
app.setup = (waitUntil) => {
|
|
42
|
-
waitUntil(
|
|
43
|
-
(async () => {
|
|
44
|
-
const fragments = components.get(OBC.FragmentsManager);
|
|
45
|
-
const workerUrl = await FRAGS.FragmentsModels.getWorker();
|
|
46
|
-
fragments.init(await FRAGS.toClassicWorker(workerUrl), {
|
|
47
|
-
classicWorker: true,
|
|
48
|
-
});
|
|
49
|
-
})(),
|
|
50
|
-
"Fragments Core",
|
|
51
|
-
);
|
|
52
|
-
return { components, client };
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
app.elements = {
|
|
56
|
-
viewer: () =>
|
|
57
|
-
html`<top-viewer><top-viewer-tools></top-viewer-tools></top-viewer>`,
|
|
58
|
-
|
|
59
|
-
data: () => html`
|
|
60
|
-
<bim-panel label="Data">
|
|
61
|
-
<bim-panel-section label="Properties" icon="solar:document-bold">
|
|
62
|
-
<bim-label>Select an element in the viewer to inspect its properties.</bim-label>
|
|
63
|
-
</bim-panel-section>
|
|
64
|
-
</bim-panel>
|
|
65
|
-
`,
|
|
66
|
-
|
|
67
|
-
settings: () => html`
|
|
68
|
-
<bim-panel label="Settings">
|
|
69
|
-
<bim-panel-section label="Appearance" icon="solar:settings-bold">
|
|
70
|
-
<bim-checkbox label="Show grid" checked></bim-checkbox>
|
|
71
|
-
<bim-checkbox label="Show axes"></bim-checkbox>
|
|
72
|
-
</bim-panel-section>
|
|
73
|
-
</bim-panel>
|
|
74
|
-
`,
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
app.layouts = {
|
|
78
|
-
// Each layout defines its own CSS grid template. Only areas used in a template
|
|
79
|
-
// are rendered for that layout — unused elements are not created.
|
|
80
|
-
viewer: {
|
|
81
|
-
label: "Viewer",
|
|
82
|
-
icon: "solar:3d-square-bold",
|
|
83
|
-
template: `"viewer" 1fr / 1fr`,
|
|
84
|
-
},
|
|
85
|
-
data: {
|
|
86
|
-
label: "Data",
|
|
87
|
-
icon: "solar:document-bold",
|
|
88
|
-
template: `"data" 1fr / 1fr`,
|
|
89
|
-
},
|
|
90
|
-
settings: {
|
|
91
|
-
label: "Settings",
|
|
92
|
-
icon: "solar:settings-bold",
|
|
93
|
-
template: `"settings" 1fr / 1fr`,
|
|
94
|
-
},
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
// sidebar=true adds a vertical nav column on the left with one button per layout.
|
|
98
|
-
// Each button shows the layout's label and icon and activates that layout on click.
|
|
99
|
-
app.sidebar = true;
|
|
100
|
-
app.layout = "viewer";
|
|
101
|
-
|
|
102
|
-
const container = document.getElementById("that-open-app") ?? document.body;
|
|
103
|
-
container.appendChild(app);
|
|
104
|
-
document.body.style.margin = "0";
|
|
1
|
+
/* MD
|
|
2
|
+
## Sidebar navigation
|
|
3
|
+
---
|
|
4
|
+
Product teams building BIM apps often need multiple distinct views — a 3D model
|
|
5
|
+
viewer, a data browser, a settings screen — but wiring a custom nav bar and
|
|
6
|
+
managing view transitions from scratch adds complexity before any real feature
|
|
7
|
+
work begins.
|
|
8
|
+
|
|
9
|
+
top-app supports named layouts with a built-in sidebar navigation bar that
|
|
10
|
+
switches the active grid template on click, so teams get multi-view navigation
|
|
11
|
+
without building the scaffolding themselves.
|
|
12
|
+
|
|
13
|
+
This tutorial covers defining three named layouts with their own grid templates
|
|
14
|
+
and icons; providing a dedicated element for each view; enabling the sidebar nav
|
|
15
|
+
bar; and setting the initial active layout.
|
|
16
|
+
|
|
17
|
+
By the end, you'll have a multi-view BIM app with a persistent sidebar that lets
|
|
18
|
+
users switch between a 3D viewer, a data panel, and a settings screen.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { html } from "lit";
|
|
22
|
+
import * as THREE from "three";
|
|
23
|
+
import * as OBC from "@thatopen/components";
|
|
24
|
+
import * as OBF from "@thatopen/components-front";
|
|
25
|
+
import * as FRAGS from "@thatopen/fragments";
|
|
26
|
+
import * as BUI from "@thatopen/ui";
|
|
27
|
+
import { PlatformClient } from "thatopen-services";
|
|
28
|
+
import uiManagerDef from "../../../../index";
|
|
29
|
+
import type { App } from "../../index";
|
|
30
|
+
|
|
31
|
+
const UIManager = uiManagerDef.componentDefinition;
|
|
32
|
+
const client = PlatformClient.fromPlatformContext();
|
|
33
|
+
const { components } = (await client.setup(
|
|
34
|
+
{ OBC, OBF, BUI, THREE, FRAGS },
|
|
35
|
+
{ uuid: UIManager.uuid },
|
|
36
|
+
)) as { components: OBC.Components };
|
|
37
|
+
components.get(UIManager).init();
|
|
38
|
+
|
|
39
|
+
const app = document.createElement("top-app") as unknown as App;
|
|
40
|
+
|
|
41
|
+
app.setup = (waitUntil) => {
|
|
42
|
+
waitUntil(
|
|
43
|
+
(async () => {
|
|
44
|
+
const fragments = components.get(OBC.FragmentsManager);
|
|
45
|
+
const workerUrl = await FRAGS.FragmentsModels.getWorker();
|
|
46
|
+
fragments.init(await FRAGS.toClassicWorker(workerUrl), {
|
|
47
|
+
classicWorker: true,
|
|
48
|
+
});
|
|
49
|
+
})(),
|
|
50
|
+
"Fragments Core",
|
|
51
|
+
);
|
|
52
|
+
return { components, client };
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
app.elements = {
|
|
56
|
+
viewer: () =>
|
|
57
|
+
html`<top-viewer><top-viewer-tools></top-viewer-tools></top-viewer>`,
|
|
58
|
+
|
|
59
|
+
data: () => html`
|
|
60
|
+
<bim-panel label="Data">
|
|
61
|
+
<bim-panel-section label="Properties" icon="solar:document-bold">
|
|
62
|
+
<bim-label>Select an element in the viewer to inspect its properties.</bim-label>
|
|
63
|
+
</bim-panel-section>
|
|
64
|
+
</bim-panel>
|
|
65
|
+
`,
|
|
66
|
+
|
|
67
|
+
settings: () => html`
|
|
68
|
+
<bim-panel label="Settings">
|
|
69
|
+
<bim-panel-section label="Appearance" icon="solar:settings-bold">
|
|
70
|
+
<bim-checkbox label="Show grid" checked></bim-checkbox>
|
|
71
|
+
<bim-checkbox label="Show axes"></bim-checkbox>
|
|
72
|
+
</bim-panel-section>
|
|
73
|
+
</bim-panel>
|
|
74
|
+
`,
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
app.layouts = {
|
|
78
|
+
// Each layout defines its own CSS grid template. Only areas used in a template
|
|
79
|
+
// are rendered for that layout — unused elements are not created.
|
|
80
|
+
viewer: {
|
|
81
|
+
label: "Viewer",
|
|
82
|
+
icon: "solar:3d-square-bold",
|
|
83
|
+
template: `"viewer" 1fr / 1fr`,
|
|
84
|
+
},
|
|
85
|
+
data: {
|
|
86
|
+
label: "Data",
|
|
87
|
+
icon: "solar:document-bold",
|
|
88
|
+
template: `"data" 1fr / 1fr`,
|
|
89
|
+
},
|
|
90
|
+
settings: {
|
|
91
|
+
label: "Settings",
|
|
92
|
+
icon: "solar:settings-bold",
|
|
93
|
+
template: `"settings" 1fr / 1fr`,
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// sidebar=true adds a vertical nav column on the left with one button per layout.
|
|
98
|
+
// Each button shows the layout's label and icon and activates that layout on click.
|
|
99
|
+
app.sidebar = true;
|
|
100
|
+
app.layout = "viewer";
|
|
101
|
+
|
|
102
|
+
const container = document.getElementById("that-open-app") ?? document.body;
|
|
103
|
+
container.appendChild(app);
|
|
104
|
+
document.body.style.margin = "0";
|