@thatopen/services 0.3.1 → 0.3.3

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 (44) hide show
  1. package/README.md +3 -0
  2. package/dist/built-in/index.d.ts +31 -2
  3. package/dist/cli.js +5 -5
  4. package/docs/ai-quickstart.md +89 -0
  5. package/docs/cli/create.md +4 -3
  6. package/docs/cli/login.md +2 -2
  7. package/docs/cli/paths.json +1 -1
  8. package/docs/cli/serve.md +3 -3
  9. package/package.json +1 -1
  10. package/src/built-in/index.ts +31 -2
  11. package/src/cli/templates/app/src/app.ts +37 -37
  12. package/src/cli/templates/app/src/assets/tool-placeholder.ts +50 -50
  13. package/src/cli/templates/app/src/main.ts +223 -340
  14. package/src/cli/templates/app/src/setups/camera-tools.ts +63 -63
  15. package/src/cli/templates/app/src/setups/clipper-tool.ts +20 -1
  16. package/src/cli/templates/app/src/setups/clipper.ts +75 -75
  17. package/src/cli/templates/app/src/setups/index.ts +23 -33
  18. package/src/cli/templates/app/src/setups/inspection.ts +136 -136
  19. package/src/cli/templates/app/src/setups/measurement-tool.ts +19 -1
  20. package/src/cli/templates/app/src/setups/measurements.ts +133 -133
  21. package/src/cli/templates/app/src/setups/reality-capture/lib/hidden-tiles-plugin.ts +88 -88
  22. package/src/cli/templates/app/src/setups/reality-capture/lib/point-tile-plugin.ts +166 -166
  23. package/src/cli/templates/app/src/setups/reality-capture/lib/render-frame.ts +31 -31
  24. package/src/cli/templates/app/src/setups/reality-capture/lib/splat-tile-plugin.ts +51 -51
  25. package/src/cli/templates/app/src/setups/reality-capture-viewer.ts +1383 -1383
  26. package/src/cli/templates/app/src/setups/right-sidebar.ts +178 -178
  27. package/src/cli/templates/app/src/setups/styles-panel.ts +110 -110
  28. package/src/cli/templates/app/src/setups/tool-mode-manager.ts +15 -9
  29. package/src/cli/templates/app/src/setups/tool-mode.ts +23 -23
  30. package/src/cli/templates/app/src/setups/active-tool-hud.ts +0 -69
  31. package/src/cli/templates/app/src/setups/clipper-panel.ts +0 -167
  32. package/src/cli/templates/app/src/setups/commands-panel.ts +0 -239
  33. package/src/cli/templates/app/src/setups/data-table-panel.ts +0 -2224
  34. package/src/cli/templates/app/src/setups/file-format-icons.ts +0 -95
  35. package/src/cli/templates/app/src/setups/files-panel.ts +0 -1503
  36. package/src/cli/templates/app/src/setups/fps-indicator.ts +0 -63
  37. package/src/cli/templates/app/src/setups/graphics-panel.ts +0 -490
  38. package/src/cli/templates/app/src/setups/measurement-settings-panel.ts +0 -161
  39. package/src/cli/templates/app/src/setups/model-tree.ts +0 -797
  40. package/src/cli/templates/app/src/setups/objects-panel.ts +0 -127
  41. package/src/cli/templates/app/src/setups/properties-panel.ts +0 -1048
  42. package/src/cli/templates/app/src/setups/settings-panel.ts +0 -94
  43. package/src/cli/templates/app/src/setups/visibility-toolbar.ts +0 -498
  44. package/src/cli/templates/app/src/setups/walkthrough.ts +0 -528
@@ -1,127 +0,0 @@
1
- import * as BUI from "@thatopen/ui";
2
- import type { InspectionInstances, InstanceRow } from "./inspection";
3
- import { toolPlaceholderUri } from "../assets/tool-placeholder";
4
- import { cardHeader } from "./card-header";
5
-
6
- /**
7
- * OBJECTS outliner panel (UI-reorg increment b). Lists every created clip plane
8
- * and measurement from the unified {@link InspectionInstances} API, each row with
9
- * hide/show, enable/disable (clip planes only) and delete. Re-renders on the
10
- * inspection `onChanged` event (the row actions themselves fire it via the tools,
11
- * so handlers don't re-render manually). Returns its `bim-panel` WITHOUT
12
- * self-mounting — main.ts docks it in the activity-bar "Objects" layout.
13
- *
14
- * @param inspection unified clip-plane + measurement instance list (from W1)
15
- * @returns the `bim-panel` element
16
- */
17
- const iconFor = (r: InstanceRow): string => {
18
- if (r.kind === "clip") return "mdi:scissors-cutting";
19
- switch (r.type) {
20
- case "Length": return "mdi:ruler";
21
- case "Area": return "mdi:vector-square";
22
- case "Angle": return "mdi:angle-acute";
23
- default: return "mdi:cube-outline";
24
- }
25
- };
26
-
27
- export const objectsPanel = (inspection: InspectionInstances) => {
28
- // bim-tooltip portals itself into a body-level container while shown and only
29
- // hides on its parent button's `mouseleave`. A row action (delete / toggle)
30
- // fires inspection.onChanged → the row re-renders and the button is removed —
31
- // so the parent never sees `mouseleave` and the portaled tooltip is left
32
- // orphaned on screen. Firing `mouseleave` on the button first runs the
33
- // tooltip's hide (re-parents + clears it) BEFORE the row removes, so no stale
34
- // tooltip lingers after delete/toggle.
35
- const dismissTip = (e: Event) =>
36
- (e.currentTarget as HTMLElement | null)?.dispatchEvent(new MouseEvent("mouseleave"));
37
-
38
- const rowHtml = (r: InstanceRow) => BUI.html`
39
- <div class="ob-row">
40
- <bim-icon class="ob-ico" icon=${iconFor(r)}></bim-icon>
41
- <span class="ob-lbl" title=${r.label}>${r.label}</span>
42
- <bim-button
43
- class="ob-act"
44
- icon=${r.visible ? "mdi:eye-outline" : "mdi:eye-off-outline"}
45
- @click=${(e: Event) => { dismissTip(e); r.setVisible(!r.visible); }}
46
- ><bim-tooltip>${r.visible ? "Hide" : "Show"}</bim-tooltip></bim-button>
47
- ${r.enabled !== undefined
48
- ? BUI.html`<bim-button
49
- class="ob-act"
50
- icon=${r.enabled ? "mdi:toggle-switch-outline" : "mdi:toggle-switch-off-outline"}
51
- @click=${(e: Event) => { dismissTip(e); r.setEnabled?.(!r.enabled); }}
52
- ><bim-tooltip>${r.enabled ? "Disable cut" : "Enable cut"}</bim-tooltip></bim-button>`
53
- : null}
54
- <bim-button
55
- class="ob-act"
56
- icon="mdi:trash-can-outline"
57
- @click=${(e: Event) => { dismissTip(e); r.remove(); }}
58
- ><bim-tooltip>Delete</bim-tooltip></bim-button>
59
- </div>`;
60
-
61
- // A titled group ("Clip planes" / "Measurements") when its rows are present.
62
- const group = (title: string, rows: InstanceRow[]) =>
63
- rows.length === 0
64
- ? null
65
- : BUI.html`
66
- <div class="ob-grp">${title}</div>
67
- ${rows.map(rowHtml)}`;
68
-
69
- const [panel, update] = BUI.Component.create<BUI.Panel, { tick: number }>(
70
- // Arity >= 1 (state param) is REQUIRED — an arity-0 callback makes
71
- // Component.create return a single element, not [el, update].
72
- (_s) => {
73
- const rows = inspection.list();
74
- const clips = rows.filter((r) => r.kind === "clip");
75
- const measures = rows.filter((r) => r.kind === "measurement");
76
- return BUI.html`
77
- <bim-panel
78
- label="Objects"
79
- icon="mdi:cube-outline"
80
- header-hidden
81
- style="width: 100%; height: 100%; pointer-events: auto;"
82
- >
83
- <style>
84
- .ob-scroll { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0;
85
- overflow-y: auto; padding: 0.4rem 0 0.6rem; }
86
- .ob-scroll::-webkit-scrollbar { width: 0.4rem; }
87
- .ob-scroll::-webkit-scrollbar-thumb { border-radius: 0.25rem;
88
- background-color: var(--bim-scrollbar--c, #3C3C41); }
89
- .ob-grp { padding: 0.45rem 0.75rem 0.2rem; font-size: 0.68rem;
90
- font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
91
- color: var(--bim-ui_bg-contrast-60, #99a0ae); }
92
- .ob-row { display: flex; align-items: center; gap: 0.4rem;
93
- padding: 0.1rem 0.5rem 0.1rem 0.75rem; min-height: 1.7rem; }
94
- .ob-row:hover { background: var(--bim-ui_bg-contrast-20, rgba(255,255,255,0.06)); }
95
- .ob-ico { flex: 0 0 auto; font-size: 0.9rem;
96
- color: var(--bim-ui_bg-contrast-60, #99a0ae); }
97
- .ob-lbl { flex: 1 1 auto; min-width: 0; overflow: hidden;
98
- text-overflow: ellipsis; white-space: nowrap; font-size: 0.74rem;
99
- color: var(--bim-ui_bg-contrast-100, #e3e3e3); }
100
- .ob-act { flex: 0 0 auto; }
101
- /* Shared empty-state look (same svg placeholder + faded label as the
102
- Properties panel) so all panels read consistently when empty. */
103
- .ob-empty { display: flex; flex-direction: column; align-items: center;
104
- justify-content: center; gap: 0.75rem; height: 100%; min-height: 12rem;
105
- padding: 1rem; text-align: center; }
106
- </style>
107
- <div style="display: flex; flex-direction: column; height: 100%; width: 100%;">
108
- ${cardHeader("mdi:cube-outline", "Objects", "1.1rem")}
109
- <div class="ob-scroll">
110
- ${rows.length === 0
111
- ? BUI.html`<div class="ob-empty">
112
- <img src=${toolPlaceholderUri} alt="" style="width: 7.5rem; height: auto; opacity: 0.9;" />
113
- <bim-label style="opacity: 0.55; white-space: normal;">No clip planes or measurements yet. Create them from the Inspection toolbar.</bim-label>
114
- </div>`
115
- : BUI.html`${group("Clip planes", clips)}${group("Measurements", measures)}`}
116
- </div>
117
- </div>
118
- </bim-panel>`;
119
- },
120
- { tick: 0 },
121
- );
122
-
123
- // Re-render whenever an instance is added/removed or its state changes.
124
- inspection.onChanged.add(() => update({ tick: 0 }));
125
-
126
- return panel;
127
- };