@thatopen/services 0.3.1 → 0.3.2

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 (42) hide show
  1. package/README.md +3 -0
  2. package/dist/built-in/index.d.ts +22 -2
  3. package/dist/cli.js +3 -3
  4. package/docs/ai-quickstart.md +86 -0
  5. package/docs/builtin/paths.json +74 -74
  6. package/docs/cli/create.md +4 -3
  7. package/package.json +1 -1
  8. package/src/built-in/index.ts +22 -2
  9. package/src/cli/templates/app/src/app.ts +37 -37
  10. package/src/cli/templates/app/src/assets/tool-placeholder.ts +50 -50
  11. package/src/cli/templates/app/src/main.ts +223 -340
  12. package/src/cli/templates/app/src/setups/camera-tools.ts +63 -63
  13. package/src/cli/templates/app/src/setups/clipper-tool.ts +20 -1
  14. package/src/cli/templates/app/src/setups/clipper.ts +75 -75
  15. package/src/cli/templates/app/src/setups/index.ts +23 -33
  16. package/src/cli/templates/app/src/setups/inspection.ts +136 -136
  17. package/src/cli/templates/app/src/setups/measurement-tool.ts +19 -1
  18. package/src/cli/templates/app/src/setups/measurements.ts +133 -133
  19. package/src/cli/templates/app/src/setups/reality-capture/lib/hidden-tiles-plugin.ts +88 -88
  20. package/src/cli/templates/app/src/setups/reality-capture/lib/point-tile-plugin.ts +166 -166
  21. package/src/cli/templates/app/src/setups/reality-capture/lib/render-frame.ts +31 -31
  22. package/src/cli/templates/app/src/setups/reality-capture/lib/splat-tile-plugin.ts +51 -51
  23. package/src/cli/templates/app/src/setups/reality-capture-viewer.ts +1383 -1383
  24. package/src/cli/templates/app/src/setups/right-sidebar.ts +178 -178
  25. package/src/cli/templates/app/src/setups/styles-panel.ts +110 -110
  26. package/src/cli/templates/app/src/setups/tool-mode-manager.ts +15 -9
  27. package/src/cli/templates/app/src/setups/tool-mode.ts +23 -23
  28. package/src/cli/templates/app/src/setups/active-tool-hud.ts +0 -69
  29. package/src/cli/templates/app/src/setups/clipper-panel.ts +0 -167
  30. package/src/cli/templates/app/src/setups/commands-panel.ts +0 -239
  31. package/src/cli/templates/app/src/setups/data-table-panel.ts +0 -2224
  32. package/src/cli/templates/app/src/setups/file-format-icons.ts +0 -95
  33. package/src/cli/templates/app/src/setups/files-panel.ts +0 -1503
  34. package/src/cli/templates/app/src/setups/fps-indicator.ts +0 -63
  35. package/src/cli/templates/app/src/setups/graphics-panel.ts +0 -490
  36. package/src/cli/templates/app/src/setups/measurement-settings-panel.ts +0 -161
  37. package/src/cli/templates/app/src/setups/model-tree.ts +0 -797
  38. package/src/cli/templates/app/src/setups/objects-panel.ts +0 -127
  39. package/src/cli/templates/app/src/setups/properties-panel.ts +0 -1048
  40. package/src/cli/templates/app/src/setups/settings-panel.ts +0 -94
  41. package/src/cli/templates/app/src/setups/visibility-toolbar.ts +0 -498
  42. package/src/cli/templates/app/src/setups/walkthrough.ts +0 -528
@@ -1,161 +0,0 @@
1
- import * as BUI from "@thatopen/ui";
2
- import type { MeasurementTool } from "./measurement-tool";
3
-
4
- /**
5
- * MEASUREMENT settings section for the merged Settings layout (UI-reorg). Color,
6
- * per-type units, rounding, snap toggles, and global visibility — all driven by
7
- * W1's measurementTool settings API (getMeasurementSettings + setters), re-read
8
- * on `onChanged`. (Line thickness lands later with the LineSegments2 conversion.)
9
- * Returns its `bim-panel` WITHOUT self-mounting.
10
- *
11
- * @param tool the measurement tool (worker 1)
12
- * @returns the `bim-panel` element
13
- */
14
- export const measurementSettingsPanel = (tool: MeasurementTool) => {
15
- const dropdown = (
16
- opts: string[],
17
- selected: string,
18
- onPick: (v: string) => void,
19
- ) => BUI.html`
20
- <bim-dropdown
21
- style="flex: 1 1 auto; min-width: 0;"
22
- @change=${(e: Event) => {
23
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
24
- const v = (e.target as any).value?.[0];
25
- if (v != null) onPick(String(v));
26
- }}
27
- >
28
- ${opts.map((o) => BUI.html`<bim-option .value=${o} label=${o} ?checked=${o === selected}></bim-option>`)}
29
- </bim-dropdown>`;
30
-
31
- const [panel, update] = BUI.Component.create<BUI.Panel, { tick: number }>(
32
- // NOTE: the callback MUST take a state param (arity >= 1) — an arity-0
33
- // callback makes Component.create return a single element instead of
34
- // [el, update], and the destructure throws "object is not iterable".
35
- (_s) => {
36
- // Fail-safe: a settings sub-panel must NEVER crash main(). If the tool's
37
- // settings API is unavailable/throws, render a placeholder instead.
38
- let s: ReturnType<MeasurementTool["getMeasurementSettings"]> | null = null;
39
- try {
40
- s = tool.getMeasurementSettings?.() ?? null;
41
- } catch (error) {
42
- console.warn("[measurement-settings] getMeasurementSettings failed", error);
43
- }
44
- if (!s || !s.unitOptions || !s.units || !s.snaps) {
45
- return BUI.html`
46
- <bim-panel label="Measurement" icon="mdi:ruler" style="width: 100%; height: 100%; pointer-events: auto;">
47
- <div style="padding: 0.9rem 1.1rem; font-size: 0.78rem; color: var(--bim-ui_bg-contrast-70, #a7a7ab);">
48
- Measurement settings unavailable.
49
- </div>
50
- </bim-panel>`;
51
- }
52
- const unitRow = (label: string, type: "length" | "area" | "angle") => BUI.html`
53
- <div class="ms-row">
54
- <span class="ms-lbl">${label}</span>
55
- ${dropdown(s.unitOptions[type], s.units[type], (v) => tool.setUnits(type, v))}
56
- </div>`;
57
- return BUI.html`
58
- <bim-panel
59
- label="Measurement"
60
- icon="mdi:ruler"
61
- style="width: 100%; height: 100%; pointer-events: auto;"
62
- >
63
- <style>
64
- .ms-body { display: flex; flex-direction: column; gap: 0.45rem;
65
- padding: 0.6rem 0.75rem; overflow-y: auto; height: 100%; }
66
- .ms-row { display: flex; align-items: center; gap: 0.5rem; }
67
- .ms-toggle { cursor: pointer; justify-content: space-between; }
68
- .ms-lbl { font-size: 0.72rem; white-space: nowrap; flex: 0 0 5.5rem;
69
- color: var(--bim-ui_bg-contrast-80, #c9c9c9); }
70
- .ms-snaps { display: flex; gap: 0.9rem; flex-wrap: wrap; }
71
- .ms-snap { display: inline-flex; align-items: center; gap: 0.3rem;
72
- cursor: pointer; font-size: 0.72rem;
73
- color: var(--bim-ui_bg-contrast-80, #c9c9c9); }
74
- </style>
75
- <div class="ms-body">
76
- <div class="ms-row">
77
- <span class="ms-lbl">Color</span>
78
- <bim-color-input
79
- color=${s.color}
80
- @input=${(e: Event) => {
81
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
82
- const t = e.target as any;
83
- tool.setColor(String(t.color ?? t.value));
84
- }}
85
- ></bim-color-input>
86
- </div>
87
- ${unitRow("Length", "length")}
88
- ${unitRow("Area", "area")}
89
- ${unitRow("Angle", "angle")}
90
- <div class="ms-row">
91
- <span class="ms-lbl">Decimals</span>
92
- <bim-number-input
93
- slider
94
- value=${s.rounding}
95
- min="0"
96
- max="6"
97
- step="1"
98
- style="flex: 1 1 auto;"
99
- @change=${(e: Event) => {
100
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
101
- tool.setRounding(Number((e.target as any).value));
102
- }}
103
- ></bim-number-input>
104
- </div>
105
- ${
106
- typeof s.thickness === "number" && typeof tool.setThickness === "function"
107
- ? BUI.html`
108
- <div class="ms-row">
109
- <span class="ms-lbl">Thickness</span>
110
- <bim-number-input
111
- slider
112
- value=${s.thickness}
113
- min="1"
114
- max="10"
115
- step="1"
116
- style="flex: 1 1 auto;"
117
- @change=${(e: Event) => {
118
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
119
- tool.setThickness(Number((e.target as any).value));
120
- }}
121
- ></bim-number-input>
122
- </div>`
123
- : BUI.html``
124
- }
125
- <div class="ms-row">
126
- <span class="ms-lbl">Snap</span>
127
- <div class="ms-snaps">
128
- ${Object.keys(s.snaps).map(
129
- (kind) => BUI.html`<label class="ms-snap">
130
- <bim-checkbox
131
- toggle
132
- ?checked=${s.snaps[kind as keyof typeof s.snaps]}
133
- @change=${(e: Event) => {
134
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
135
- tool.setSnap(kind as never, !!(e.target as any).checked);
136
- }}
137
- ></bim-checkbox>${kind}
138
- </label>`,
139
- )}
140
- </div>
141
- </div>
142
- <label class="ms-row ms-toggle">
143
- <span class="ms-lbl">Show measurements</span>
144
- <bim-checkbox
145
- toggle
146
- ?checked=${s.visible}
147
- @change=${(e: Event) => {
148
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
149
- tool.setVisible(!!(e.target as any).checked);
150
- }}
151
- ></bim-checkbox>
152
- </label>
153
- </div>
154
- </bim-panel>`;
155
- },
156
- { tick: 0 },
157
- );
158
-
159
- tool.onChanged.add(() => update({ tick: 0 }));
160
- return panel;
161
- };