vim-web 0.3.44-dev.85 → 0.4.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/dist/types/core-viewers/shared/baseInputHandler.d.ts +0 -1
- package/dist/types/core-viewers/shared/index.d.ts +1 -1
- package/dist/types/core-viewers/shared/inputAdapter.d.ts +21 -0
- package/dist/types/core-viewers/shared/inputHandler.d.ts +1 -20
- package/dist/types/core-viewers/shared/raycaster.d.ts +14 -0
- package/dist/types/core-viewers/shared/selection.d.ts +1 -1
- package/dist/types/core-viewers/shared/vim.d.ts +15 -2
- package/dist/types/core-viewers/ultra/element3d.d.ts +29 -1
- package/dist/types/core-viewers/ultra/index.d.ts +2 -2
- package/dist/types/core-viewers/ultra/inputAdapter.d.ts +7 -4
- package/dist/types/core-viewers/ultra/raycaster.d.ts +2 -2
- package/dist/types/core-viewers/ultra/sectionBox.d.ts +3 -3
- package/dist/types/core-viewers/ultra/vim.d.ts +1 -1
- package/dist/types/core-viewers/webgl/loader/mesh.d.ts +5 -5
- package/dist/types/core-viewers/webgl/loader/progressive/insertableGeometry.d.ts +2 -2
- package/dist/types/core-viewers/webgl/loader/progressive/legacyMeshFactory.d.ts +2 -2
- package/dist/types/core-viewers/webgl/loader/progressive/subsetBuilder.d.ts +2 -2
- package/dist/types/core-viewers/webgl/loader/progressive/subsetRequest.d.ts +2 -2
- package/dist/types/core-viewers/webgl/loader/scene.d.ts +7 -7
- package/dist/types/core-viewers/webgl/loader/vim.d.ts +11 -11
- package/dist/types/core-viewers/webgl/viewer/index.d.ts +1 -1
- package/dist/types/core-viewers/webgl/viewer/rendering/renderScene.d.ts +4 -4
- package/dist/types/core-viewers/webgl/viewer/rendering/renderer.d.ts +3 -3
- package/dist/types/react-viewers/controlbar/controlBarButton.d.ts +0 -1
- package/dist/types/react-viewers/controlbar/index.d.ts +0 -1
- package/dist/types/react-viewers/helpers/index.d.ts +0 -1
- package/dist/types/react-viewers/panels/messageBox.d.ts +0 -1
- package/dist/vim-web.iife.js +80 -100
- package/dist/vim-web.iife.js.map +1 -1
- package/dist/vim-web.js +80 -100
- package/dist/vim-web.js.map +1 -1
- package/package.json +1 -1
- package/dist/types/react-viewers/helpers/deferredPromise.d.ts +0 -8
- /package/dist/types/core-viewers/webgl/viewer/{inputsAdapter.d.ts → inputAdapter.d.ts} +0 -0
package/dist/vim-web.js
CHANGED
|
@@ -21423,7 +21423,7 @@ class Fog {
|
|
|
21423
21423
|
};
|
|
21424
21424
|
}
|
|
21425
21425
|
}
|
|
21426
|
-
class Scene extends Object3D {
|
|
21426
|
+
let Scene$1 = class Scene extends Object3D {
|
|
21427
21427
|
constructor() {
|
|
21428
21428
|
super();
|
|
21429
21429
|
this.isScene = true;
|
|
@@ -21465,7 +21465,7 @@ class Scene extends Object3D {
|
|
|
21465
21465
|
data2.object.environmentRotation = this.environmentRotation.toArray();
|
|
21466
21466
|
return data2;
|
|
21467
21467
|
}
|
|
21468
|
-
}
|
|
21468
|
+
};
|
|
21469
21469
|
class InterleavedBuffer {
|
|
21470
21470
|
constructor(array, stride) {
|
|
21471
21471
|
this.isInterleavedBuffer = true;
|
|
@@ -30655,7 +30655,7 @@ class ObjectLoader extends Loader {
|
|
|
30655
30655
|
let geometry, material;
|
|
30656
30656
|
switch (data2.type) {
|
|
30657
30657
|
case "Scene":
|
|
30658
|
-
object = new Scene();
|
|
30658
|
+
object = new Scene$1();
|
|
30659
30659
|
if (data2.background !== void 0) {
|
|
30660
30660
|
if (Number.isInteger(data2.background)) {
|
|
30661
30661
|
object.background = new Color(data2.background);
|
|
@@ -44937,7 +44937,7 @@ const three_module = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.define
|
|
|
44937
44937
|
SIGNED_RED_RGTC1_Format,
|
|
44938
44938
|
SRGBColorSpace,
|
|
44939
44939
|
SRGBTransfer,
|
|
44940
|
-
Scene,
|
|
44940
|
+
Scene: Scene$1,
|
|
44941
44941
|
ShaderChunk,
|
|
44942
44942
|
ShaderLib,
|
|
44943
44943
|
ShaderMaterial,
|
|
@@ -46760,7 +46760,7 @@ let Vim$1 = class Vim {
|
|
|
46760
46760
|
* @param {VimHeader | undefined} header - The Vim header, if available.
|
|
46761
46761
|
* @param {VimDocument} document - The Vim document.
|
|
46762
46762
|
* @param {G3d | undefined} g3d - The G3d object, if available.
|
|
46763
|
-
* @param {
|
|
46763
|
+
* @param {Scene} scene - The scene containing the vim's geometry.
|
|
46764
46764
|
* @param {VimSettings} settings - The settings used to open this vim.
|
|
46765
46765
|
* @param {ElementMapping | ElementNoMapping | ElementMapping2} map - The element mapping.
|
|
46766
46766
|
* @param {SubsetBuilder} builder - The subset builder for constructing subsets of the Vim object.
|
|
@@ -46863,7 +46863,7 @@ let Vim$1 = class Vim {
|
|
|
46863
46863
|
* @param {number} id - The element ID to retrieve objects for.
|
|
46864
46864
|
* @returns {THREE.Object3D[]} An array of objects corresponding to the element ID, or an empty array if none are found.
|
|
46865
46865
|
*/
|
|
46866
|
-
|
|
46866
|
+
getElementsFromId(id2) {
|
|
46867
46867
|
const elements = this.map.getElementsFromElementId(id2);
|
|
46868
46868
|
return (elements == null ? void 0 : elements.map((e) => this.getElementFromIndex(e)).filter((o) => o !== void 0)) ?? [];
|
|
46869
46869
|
}
|
|
@@ -47165,7 +47165,7 @@ function calculateCentroidAndBoundingBox(positions) {
|
|
|
47165
47165
|
const centroid = sum.divideScalar(positions.length);
|
|
47166
47166
|
return { centroid, aabb };
|
|
47167
47167
|
}
|
|
47168
|
-
class
|
|
47168
|
+
class Scene2 {
|
|
47169
47169
|
constructor(matrix) {
|
|
47170
47170
|
// Dependencies
|
|
47171
47171
|
__publicField(this, "_renderer");
|
|
@@ -49840,7 +49840,7 @@ async function loadFromVimX(bfast2, settings2, onProgress) {
|
|
|
49840
49840
|
remoteVimx2.bfast.source.onProgress = onProgress;
|
|
49841
49841
|
}
|
|
49842
49842
|
const vimx = await Vimx.fromRemote(remoteVimx2, !settings2.progressive);
|
|
49843
|
-
const scene = new
|
|
49843
|
+
const scene = new Scene2(settings2.matrix);
|
|
49844
49844
|
const mapping = new ElementMapping2(vimx.scene);
|
|
49845
49845
|
const builder = new VimxSubsetBuilder(vimx, scene);
|
|
49846
49846
|
const vim = new Vim$1(
|
|
@@ -49870,7 +49870,7 @@ async function loadFromVim(bfast2, settings2, onProgress) {
|
|
|
49870
49870
|
const geometry = await bfast2.getBfast("geometry");
|
|
49871
49871
|
const g3d2 = await distExports$2.G3d.createFromBfast(geometry);
|
|
49872
49872
|
const materials = new distExports$2.G3dMaterial(g3d2.materialColors);
|
|
49873
|
-
const scene = new
|
|
49873
|
+
const scene = new Scene2(settings2.matrix);
|
|
49874
49874
|
const factory = new VimMeshFactory(g3d2, materials, scene);
|
|
49875
49875
|
const doc = await distExports$2.VimDocument.createFromBfast(bfast2);
|
|
49876
49876
|
const mapping = await ElementMapping.fromG3d(g3d2, doc);
|
|
@@ -49972,7 +49972,7 @@ class VimRequest {
|
|
|
49972
49972
|
this._completionPromise.resolve();
|
|
49973
49973
|
}
|
|
49974
49974
|
async getResult() {
|
|
49975
|
-
await this._completionPromise;
|
|
49975
|
+
await this._completionPromise.promise;
|
|
49976
49976
|
return this._error ? new ErrorResult(this._error) : new SuccessResult(this._vimResult);
|
|
49977
49977
|
}
|
|
49978
49978
|
/**
|
|
@@ -52464,7 +52464,7 @@ class MouseHandler extends BaseInputHandler {
|
|
|
52464
52464
|
__publicField(this, "onClick");
|
|
52465
52465
|
__publicField(this, "onDoubleClick");
|
|
52466
52466
|
__publicField(this, "onWheel");
|
|
52467
|
-
this._capture = new
|
|
52467
|
+
this._capture = new CaptureHandler(canvas);
|
|
52468
52468
|
this._dragHandler = new DragHandler((delta, button) => this.onDrag(delta, button));
|
|
52469
52469
|
}
|
|
52470
52470
|
addListeners() {
|
|
@@ -52523,7 +52523,6 @@ class MouseHandler extends BaseInputHandler {
|
|
|
52523
52523
|
var _a3;
|
|
52524
52524
|
if (event.pointerType !== "mouse") return;
|
|
52525
52525
|
this._canvas.focus();
|
|
52526
|
-
this._capture.onPointerMove(event);
|
|
52527
52526
|
const pos = this.relativePosition(event);
|
|
52528
52527
|
this._dragHandler.onPointerMove(pos);
|
|
52529
52528
|
(_a3 = this.onMouseMove) == null ? void 0 : _a3.call(this, pos);
|
|
@@ -52547,34 +52546,23 @@ class MouseHandler extends BaseInputHandler {
|
|
|
52547
52546
|
);
|
|
52548
52547
|
}
|
|
52549
52548
|
}
|
|
52550
|
-
class
|
|
52549
|
+
class CaptureHandler {
|
|
52551
52550
|
constructor(canvas) {
|
|
52552
52551
|
__publicField(this, "_canvas");
|
|
52553
|
-
__publicField(this, "
|
|
52554
|
-
__publicField(this, "id");
|
|
52552
|
+
__publicField(this, "_id");
|
|
52555
52553
|
this._canvas = canvas;
|
|
52556
|
-
this.
|
|
52557
|
-
this.id = -1;
|
|
52554
|
+
this._id = -1;
|
|
52558
52555
|
}
|
|
52559
52556
|
onPointerDown(event) {
|
|
52560
|
-
if (this.
|
|
52561
|
-
this._canvas.releasePointerCapture(this.
|
|
52562
|
-
}
|
|
52563
|
-
this.id = event.pointerId;
|
|
52564
|
-
this.state = "capture";
|
|
52565
|
-
}
|
|
52566
|
-
onPointerMove(_event) {
|
|
52567
|
-
if (this.state === "capture") {
|
|
52568
|
-
this._canvas.setPointerCapture(this.id);
|
|
52569
|
-
this.state = "captured";
|
|
52557
|
+
if (this._id >= 0) {
|
|
52558
|
+
this._canvas.releasePointerCapture(this._id);
|
|
52570
52559
|
}
|
|
52560
|
+
this._canvas.setPointerCapture(event.pointerId);
|
|
52561
|
+
this._id = event.pointerId;
|
|
52571
52562
|
}
|
|
52572
52563
|
onPointerUp(event) {
|
|
52573
|
-
|
|
52574
|
-
|
|
52575
|
-
this.state = "none";
|
|
52576
|
-
this.id = -1;
|
|
52577
|
-
}
|
|
52564
|
+
this._canvas.releasePointerCapture(this._id);
|
|
52565
|
+
this._id = -1;
|
|
52578
52566
|
}
|
|
52579
52567
|
}
|
|
52580
52568
|
class DoubleClickHandler {
|
|
@@ -55104,7 +55092,7 @@ class RenderScene {
|
|
|
55104
55092
|
__publicField(this, "_2dCount", 0);
|
|
55105
55093
|
__publicField(this, "_outlineCount", 0);
|
|
55106
55094
|
__publicField(this, "_modelMaterial");
|
|
55107
|
-
this.threeScene = new Scene();
|
|
55095
|
+
this.threeScene = new Scene$1();
|
|
55108
55096
|
}
|
|
55109
55097
|
get meshes() {
|
|
55110
55098
|
return this._vimScenes.flatMap((s) => s.meshes);
|
|
@@ -55145,7 +55133,7 @@ class RenderScene {
|
|
|
55145
55133
|
* Add object to be rendered
|
|
55146
55134
|
*/
|
|
55147
55135
|
add(target) {
|
|
55148
|
-
if (target instanceof
|
|
55136
|
+
if (target instanceof Scene2) {
|
|
55149
55137
|
this.addScene(target);
|
|
55150
55138
|
target.material = this._modelMaterial;
|
|
55151
55139
|
return;
|
|
@@ -55173,7 +55161,7 @@ class RenderScene {
|
|
|
55173
55161
|
* Remove object from rendering
|
|
55174
55162
|
*/
|
|
55175
55163
|
remove(target) {
|
|
55176
|
-
if (target instanceof
|
|
55164
|
+
if (target instanceof Scene2) {
|
|
55177
55165
|
this.removeScene(target);
|
|
55178
55166
|
return;
|
|
55179
55167
|
}
|
|
@@ -56940,7 +56928,7 @@ let Renderer$1 = class Renderer {
|
|
|
56940
56928
|
* @param target The object or scene to add for rendering.
|
|
56941
56929
|
*/
|
|
56942
56930
|
add(target) {
|
|
56943
|
-
if (target instanceof
|
|
56931
|
+
if (target instanceof Scene2) {
|
|
56944
56932
|
const mem = target.getMemory();
|
|
56945
56933
|
const remaining = this.maxMemory - this.estimatedMemory;
|
|
56946
56934
|
if (mem > remaining) {
|
|
@@ -58852,17 +58840,14 @@ class Decoder {
|
|
|
58852
58840
|
}
|
|
58853
58841
|
}
|
|
58854
58842
|
const CODE_TO_KEYCODE = {
|
|
58855
|
-
// Arrow keys
|
|
58856
58843
|
"ArrowUp": 38,
|
|
58857
58844
|
"ArrowDown": 40,
|
|
58858
58845
|
"ArrowLeft": 37,
|
|
58859
58846
|
"ArrowRight": 39,
|
|
58860
|
-
// WASD movement
|
|
58861
58847
|
"KeyW": 87,
|
|
58862
58848
|
"KeyA": 65,
|
|
58863
58849
|
"KeyS": 83,
|
|
58864
58850
|
"KeyD": 68,
|
|
58865
|
-
// Vertical movement (Up/Down)
|
|
58866
58851
|
"KeyE": 69,
|
|
58867
58852
|
"KeyQ": 81
|
|
58868
58853
|
};
|
|
@@ -58927,16 +58912,10 @@ function createAdapter$1(viewer) {
|
|
|
58927
58912
|
moveCamera: (value) => {
|
|
58928
58913
|
},
|
|
58929
58914
|
keyDown: (code) => {
|
|
58930
|
-
|
|
58931
|
-
if (!key) return false;
|
|
58932
|
-
viewer.rpc.RPCKeyEvent(key, true);
|
|
58933
|
-
return true;
|
|
58915
|
+
return sendKey(viewer, code, true);
|
|
58934
58916
|
},
|
|
58935
58917
|
keyUp: (code) => {
|
|
58936
|
-
|
|
58937
|
-
if (!key) return false;
|
|
58938
|
-
viewer.rpc.RPCKeyEvent(key, false);
|
|
58939
|
-
return true;
|
|
58918
|
+
return sendKey(viewer, code, false);
|
|
58940
58919
|
},
|
|
58941
58920
|
mouseDown: (pos, button) => {
|
|
58942
58921
|
viewer.rpc.RPCMouseButtonEvent(pos, button, true);
|
|
@@ -58954,6 +58933,12 @@ async function frameSelection$1(viewer) {
|
|
|
58954
58933
|
if (!box) return;
|
|
58955
58934
|
viewer.camera.frameBox(box);
|
|
58956
58935
|
}
|
|
58936
|
+
function sendKey(viewer, code, pressed) {
|
|
58937
|
+
const key = CODE_TO_KEYCODE[code];
|
|
58938
|
+
if (!key) return false;
|
|
58939
|
+
viewer.rpc.RPCKeyEvent(key, pressed);
|
|
58940
|
+
return true;
|
|
58941
|
+
}
|
|
58957
58942
|
class LoadSuccess {
|
|
58958
58943
|
constructor(vim) {
|
|
58959
58944
|
__publicField(this, "isError", false);
|
|
@@ -60944,28 +60929,53 @@ class Viewport2 {
|
|
|
60944
60929
|
}
|
|
60945
60930
|
}
|
|
60946
60931
|
class Element3D2 {
|
|
60932
|
+
/**
|
|
60933
|
+
* Creates a new `Element3D` instance.
|
|
60934
|
+
* @param vim - The parent `Vim` model.
|
|
60935
|
+
* @param instance - The internal instance index.
|
|
60936
|
+
*/
|
|
60947
60937
|
constructor(vim, instance) {
|
|
60938
|
+
/**
|
|
60939
|
+
* The parent `Vim` instance this element belongs to.
|
|
60940
|
+
*/
|
|
60948
60941
|
__publicField(this, "vim");
|
|
60942
|
+
// TODO: this should be many instances
|
|
60943
|
+
// This will be replaced by the element index in the future
|
|
60944
|
+
/**
|
|
60945
|
+
* The internal instance index within the `Vim` model.
|
|
60946
|
+
*/
|
|
60949
60947
|
__publicField(this, "instance");
|
|
60950
60948
|
this.vim = vim;
|
|
60951
60949
|
this.instance = instance;
|
|
60952
60950
|
}
|
|
60951
|
+
/**
|
|
60952
|
+
* The unique handle of the parent `Vim` model.
|
|
60953
|
+
*/
|
|
60953
60954
|
get vimHandle() {
|
|
60954
60955
|
return this.vim.handle;
|
|
60955
60956
|
}
|
|
60956
|
-
|
|
60957
|
+
/**
|
|
60958
|
+
* Gets or sets the display state of the element (e.g., visible, hidden).
|
|
60959
|
+
*/
|
|
60957
60960
|
get state() {
|
|
60958
60961
|
return this.vim.nodeState.getNodeState(this.instance);
|
|
60959
60962
|
}
|
|
60960
60963
|
set state(state) {
|
|
60961
60964
|
this.vim.nodeState.setNodeState(this.instance, state);
|
|
60962
60965
|
}
|
|
60966
|
+
/**
|
|
60967
|
+
* Gets or sets the color override of the element.
|
|
60968
|
+
*/
|
|
60963
60969
|
get color() {
|
|
60964
60970
|
return this.vim.getColor(this.instance);
|
|
60965
60971
|
}
|
|
60966
60972
|
set color(color) {
|
|
60967
60973
|
this.vim.setColor([this.instance], color);
|
|
60968
60974
|
}
|
|
60975
|
+
/**
|
|
60976
|
+
* Computes and returns the bounding box of the element.
|
|
60977
|
+
* @returns A promise resolving to the element's bounding box.
|
|
60978
|
+
*/
|
|
60969
60979
|
async getBoundingBox() {
|
|
60970
60980
|
return this.vim.getBoundingBoxNodes([this.instance]);
|
|
60971
60981
|
}
|
|
@@ -61009,7 +61019,7 @@ class Vim2 {
|
|
|
61009
61019
|
this._objects.set(instance, object);
|
|
61010
61020
|
return object;
|
|
61011
61021
|
}
|
|
61012
|
-
|
|
61022
|
+
getElementsFromId(id2) {
|
|
61013
61023
|
throw new Error("Method not implemented.");
|
|
61014
61024
|
}
|
|
61015
61025
|
getElementFromIndex(element) {
|
|
@@ -61640,6 +61650,11 @@ const style = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
61640
61650
|
sectionDefaultStyle,
|
|
61641
61651
|
sectionNoPadStyle
|
|
61642
61652
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
61653
|
+
const index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
61654
|
+
__proto__: null,
|
|
61655
|
+
Ids: controlBarIds,
|
|
61656
|
+
Style: style
|
|
61657
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
61643
61658
|
var jsxRuntime = { exports: {} };
|
|
61644
61659
|
var reactJsxRuntime_production_min = {};
|
|
61645
61660
|
/**
|
|
@@ -62578,21 +62593,6 @@ function requireJsxRuntime() {
|
|
|
62578
62593
|
return jsxRuntime.exports;
|
|
62579
62594
|
}
|
|
62580
62595
|
var jsxRuntimeExports = requireJsxRuntime();
|
|
62581
|
-
function isControlBarButtonItem(button) {
|
|
62582
|
-
return button !== null && typeof button === "object" && typeof button.id === "string" && typeof button.tip === "string" && typeof button.action === "function" && typeof button.icon === "function" && (button.enabled === void 0 || typeof button.enabled === "function") && (button.isOn === void 0 || typeof button.isOn === "function") && (button.style === void 0 || typeof button.style === "function");
|
|
62583
|
-
}
|
|
62584
|
-
function createButton(button) {
|
|
62585
|
-
var _a3;
|
|
62586
|
-
if (button.enabled !== void 0 && !button.enabled()) return null;
|
|
62587
|
-
const style$1 = (button.style ?? buttonDefaultStyle)((_a3 = button.isOn) == null ? void 0 : _a3.call(button));
|
|
62588
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("button", { id: button.id, "data-tip": button.tip, onClick: button.action, className: style$1, type: "button", children: button.icon({ height: "20", width: "20", fill: "currentColor", className: "vc-max-h-[80%]" }) }, button.id);
|
|
62589
|
-
}
|
|
62590
|
-
const index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
62591
|
-
__proto__: null,
|
|
62592
|
-
Ids: controlBarIds,
|
|
62593
|
-
Style: style,
|
|
62594
|
-
isControlBarButtonItem
|
|
62595
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
62596
62596
|
function pointer({ height, width, fill: fill2, className }) {
|
|
62597
62597
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className, height, width, viewBox: "0 0 50 50", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
62598
62598
|
"path",
|
|
@@ -67425,6 +67425,12 @@ function AxesPanel(props) {
|
|
|
67425
67425
|
}
|
|
67426
67426
|
);
|
|
67427
67427
|
}
|
|
67428
|
+
function createButton(button) {
|
|
67429
|
+
var _a3;
|
|
67430
|
+
if (button.enabled !== void 0 && !button.enabled()) return null;
|
|
67431
|
+
const style$1 = (button.style ?? buttonDefaultStyle)((_a3 = button.isOn) == null ? void 0 : _a3.call(button));
|
|
67432
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("button", { id: button.id, "data-tip": button.tip, onClick: button.action, className: style$1, type: "button", children: button.icon({ height: "20", width: "20", fill: "currentColor", className: "vc-max-h-[80%]" }) }, button.id);
|
|
67433
|
+
}
|
|
67428
67434
|
function createSection$1(section) {
|
|
67429
67435
|
if (section.enable !== void 0 && !section.enable()) return null;
|
|
67430
67436
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `vim-control-bar-section ${section.style ?? sectionDefaultStyle}`, children: section.buttons.map((b) => createButton(b)) }, section.id);
|
|
@@ -74927,31 +74933,6 @@ function useBimInfo() {
|
|
|
74927
74933
|
}
|
|
74928
74934
|
};
|
|
74929
74935
|
}
|
|
74930
|
-
class DeferredPromise extends Promise {
|
|
74931
|
-
constructor(executor = () => {
|
|
74932
|
-
}) {
|
|
74933
|
-
var _a3;
|
|
74934
|
-
let resolver;
|
|
74935
|
-
let rejector;
|
|
74936
|
-
super((resolve, reject) => {
|
|
74937
|
-
resolver = resolve;
|
|
74938
|
-
rejector = reject;
|
|
74939
|
-
return executor(resolve, reject);
|
|
74940
|
-
});
|
|
74941
|
-
__publicField(this, "resolve");
|
|
74942
|
-
__publicField(this, "reject");
|
|
74943
|
-
__publicField(this, "initialCallStack");
|
|
74944
|
-
this.resolve = resolver;
|
|
74945
|
-
this.reject = rejector;
|
|
74946
|
-
this.initialCallStack = (_a3 = Error().stack) == null ? void 0 : _a3.split("\n").slice(2).join("\n");
|
|
74947
|
-
}
|
|
74948
|
-
/** @throws error with amended call stack */
|
|
74949
|
-
rejectWithError(error) {
|
|
74950
|
-
var _a3;
|
|
74951
|
-
error.stack = [(_a3 = error.stack) == null ? void 0 : _a3.split("\n")[0], this.initialCallStack].join("\n");
|
|
74952
|
-
this.reject(error);
|
|
74953
|
-
}
|
|
74954
|
-
}
|
|
74955
74936
|
const vcColorPrimary = "vc-text-[#212733]";
|
|
74956
74937
|
const vcColorSecondary = "vc-text-[#787C83]";
|
|
74957
74938
|
const vcColorLink = "vc-text-[#0590CC]";
|
|
@@ -75193,9 +75174,9 @@ class LoadRequest2 {
|
|
|
75193
75174
|
__publicField(this, "_callbacks");
|
|
75194
75175
|
__publicField(this, "_request");
|
|
75195
75176
|
__publicField(this, "_progress", { loaded: 0, total: 0, all: /* @__PURE__ */ new Map() });
|
|
75196
|
-
__publicField(this, "_progressPromise", new
|
|
75177
|
+
__publicField(this, "_progressPromise", new ControllablePromise());
|
|
75197
75178
|
__publicField(this, "_isDone", false);
|
|
75198
|
-
__publicField(this, "_completionPromise", new
|
|
75179
|
+
__publicField(this, "_completionPromise", new ControllablePromise());
|
|
75199
75180
|
this.source = source;
|
|
75200
75181
|
this._callbacks = callbacks;
|
|
75201
75182
|
this.startRequest(source, settings2);
|
|
@@ -75216,7 +75197,7 @@ class LoadRequest2 {
|
|
|
75216
75197
|
this._callbacks.onProgress(progress);
|
|
75217
75198
|
this._progress = progress;
|
|
75218
75199
|
this._progressPromise.resolve();
|
|
75219
|
-
this._progressPromise = new
|
|
75200
|
+
this._progressPromise = new ControllablePromise();
|
|
75220
75201
|
}
|
|
75221
75202
|
onSuccess() {
|
|
75222
75203
|
this._callbacks.onDone();
|
|
@@ -75236,7 +75217,7 @@ class LoadRequest2 {
|
|
|
75236
75217
|
}
|
|
75237
75218
|
async *getProgress() {
|
|
75238
75219
|
while (!this._isDone) {
|
|
75239
|
-
await this._progressPromise;
|
|
75220
|
+
await this._progressPromise.promise;
|
|
75240
75221
|
yield this._progress;
|
|
75241
75222
|
}
|
|
75242
75223
|
}
|
|
@@ -76091,7 +76072,7 @@ function getVisibilityState$1(viewer) {
|
|
|
76091
76072
|
return "some";
|
|
76092
76073
|
}
|
|
76093
76074
|
function createViewer$1(container, settings2 = {}, coreSettings = {}) {
|
|
76094
|
-
const
|
|
76075
|
+
const controllablePromise = new ControllablePromise();
|
|
76095
76076
|
const cmpContainer = container instanceof HTMLElement ? createContainer(container) : container ?? createContainer();
|
|
76096
76077
|
const viewer = new Viewer$3(coreSettings);
|
|
76097
76078
|
viewer.viewport.reparent(cmpContainer.gfx);
|
|
@@ -76110,12 +76091,12 @@ function createViewer$1(container, settings2 = {}, coreSettings = {}) {
|
|
|
76110
76091
|
{
|
|
76111
76092
|
container: cmpContainer,
|
|
76112
76093
|
viewer,
|
|
76113
|
-
onMount: (cmp) =>
|
|
76094
|
+
onMount: (cmp) => controllablePromise.resolve(patchRef(cmp)),
|
|
76114
76095
|
settings: settings2
|
|
76115
76096
|
}
|
|
76116
76097
|
)
|
|
76117
76098
|
);
|
|
76118
|
-
return promise;
|
|
76099
|
+
return controllablePromise.promise;
|
|
76119
76100
|
}
|
|
76120
76101
|
function Viewer$1(props) {
|
|
76121
76102
|
const settings2 = useSettings(props.viewer, props.settings ?? {});
|
|
@@ -76484,7 +76465,7 @@ function allButSelection(viewer, vim) {
|
|
|
76484
76465
|
return false;
|
|
76485
76466
|
}
|
|
76486
76467
|
function createViewer(container) {
|
|
76487
|
-
const
|
|
76468
|
+
const controllablePromise = new ControllablePromise();
|
|
76488
76469
|
const cmpContainer = container instanceof HTMLElement ? createContainer(container) : container ?? createContainer();
|
|
76489
76470
|
const core = Viewer$2.createWithCanvas(cmpContainer.gfx);
|
|
76490
76471
|
const reactRoot = clientExports.createRoot(cmpContainer.ui);
|
|
@@ -76502,11 +76483,11 @@ function createViewer(container) {
|
|
|
76502
76483
|
{
|
|
76503
76484
|
container: cmpContainer,
|
|
76504
76485
|
core,
|
|
76505
|
-
onMount: (cmp) =>
|
|
76486
|
+
onMount: (cmp) => controllablePromise.resolve(attachDispose(cmp))
|
|
76506
76487
|
}
|
|
76507
76488
|
)
|
|
76508
76489
|
);
|
|
76509
|
-
return promise;
|
|
76490
|
+
return controllablePromise.promise;
|
|
76510
76491
|
}
|
|
76511
76492
|
function Viewer3(props) {
|
|
76512
76493
|
const sectionBox2 = useUltraSectionBox(props.core);
|
|
@@ -76610,7 +76591,6 @@ const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
76610
76591
|
__proto__: null,
|
|
76611
76592
|
ContextMenu: contextMenu,
|
|
76612
76593
|
ControlBar: index$5,
|
|
76613
|
-
DeferredPromise,
|
|
76614
76594
|
Errors: index$3,
|
|
76615
76595
|
Icons: icons,
|
|
76616
76596
|
IsolationPanel,
|