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.iife.js
CHANGED
|
@@ -21439,7 +21439,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
21439
21439
|
};
|
|
21440
21440
|
}
|
|
21441
21441
|
}
|
|
21442
|
-
class Scene extends Object3D {
|
|
21442
|
+
let Scene$1 = class Scene extends Object3D {
|
|
21443
21443
|
constructor() {
|
|
21444
21444
|
super();
|
|
21445
21445
|
this.isScene = true;
|
|
@@ -21481,7 +21481,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
21481
21481
|
data2.object.environmentRotation = this.environmentRotation.toArray();
|
|
21482
21482
|
return data2;
|
|
21483
21483
|
}
|
|
21484
|
-
}
|
|
21484
|
+
};
|
|
21485
21485
|
class InterleavedBuffer {
|
|
21486
21486
|
constructor(array, stride) {
|
|
21487
21487
|
this.isInterleavedBuffer = true;
|
|
@@ -30671,7 +30671,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
30671
30671
|
let geometry, material;
|
|
30672
30672
|
switch (data2.type) {
|
|
30673
30673
|
case "Scene":
|
|
30674
|
-
object = new Scene();
|
|
30674
|
+
object = new Scene$1();
|
|
30675
30675
|
if (data2.background !== void 0) {
|
|
30676
30676
|
if (Number.isInteger(data2.background)) {
|
|
30677
30677
|
object.background = new Color(data2.background);
|
|
@@ -44953,7 +44953,7 @@ void main() {
|
|
|
44953
44953
|
SIGNED_RED_RGTC1_Format,
|
|
44954
44954
|
SRGBColorSpace,
|
|
44955
44955
|
SRGBTransfer,
|
|
44956
|
-
Scene,
|
|
44956
|
+
Scene: Scene$1,
|
|
44957
44957
|
ShaderChunk,
|
|
44958
44958
|
ShaderLib,
|
|
44959
44959
|
ShaderMaterial,
|
|
@@ -46776,7 +46776,7 @@ void main() {
|
|
|
46776
46776
|
* @param {VimHeader | undefined} header - The Vim header, if available.
|
|
46777
46777
|
* @param {VimDocument} document - The Vim document.
|
|
46778
46778
|
* @param {G3d | undefined} g3d - The G3d object, if available.
|
|
46779
|
-
* @param {
|
|
46779
|
+
* @param {Scene} scene - The scene containing the vim's geometry.
|
|
46780
46780
|
* @param {VimSettings} settings - The settings used to open this vim.
|
|
46781
46781
|
* @param {ElementMapping | ElementNoMapping | ElementMapping2} map - The element mapping.
|
|
46782
46782
|
* @param {SubsetBuilder} builder - The subset builder for constructing subsets of the Vim object.
|
|
@@ -46879,7 +46879,7 @@ void main() {
|
|
|
46879
46879
|
* @param {number} id - The element ID to retrieve objects for.
|
|
46880
46880
|
* @returns {THREE.Object3D[]} An array of objects corresponding to the element ID, or an empty array if none are found.
|
|
46881
46881
|
*/
|
|
46882
|
-
|
|
46882
|
+
getElementsFromId(id2) {
|
|
46883
46883
|
const elements = this.map.getElementsFromElementId(id2);
|
|
46884
46884
|
return (elements == null ? void 0 : elements.map((e) => this.getElementFromIndex(e)).filter((o) => o !== void 0)) ?? [];
|
|
46885
46885
|
}
|
|
@@ -47181,7 +47181,7 @@ void main() {
|
|
|
47181
47181
|
const centroid = sum.divideScalar(positions.length);
|
|
47182
47182
|
return { centroid, aabb };
|
|
47183
47183
|
}
|
|
47184
|
-
class
|
|
47184
|
+
class Scene {
|
|
47185
47185
|
constructor(matrix) {
|
|
47186
47186
|
// Dependencies
|
|
47187
47187
|
__publicField(this, "_renderer");
|
|
@@ -49856,7 +49856,7 @@ void main() {
|
|
|
49856
49856
|
remoteVimx2.bfast.source.onProgress = onProgress;
|
|
49857
49857
|
}
|
|
49858
49858
|
const vimx = await Vimx.fromRemote(remoteVimx2, !settings2.progressive);
|
|
49859
|
-
const scene = new
|
|
49859
|
+
const scene = new Scene(settings2.matrix);
|
|
49860
49860
|
const mapping = new ElementMapping2(vimx.scene);
|
|
49861
49861
|
const builder = new VimxSubsetBuilder(vimx, scene);
|
|
49862
49862
|
const vim = new Vim$1(
|
|
@@ -49886,7 +49886,7 @@ void main() {
|
|
|
49886
49886
|
const geometry = await bfast2.getBfast("geometry");
|
|
49887
49887
|
const g3d2 = await distExports$2.G3d.createFromBfast(geometry);
|
|
49888
49888
|
const materials = new distExports$2.G3dMaterial(g3d2.materialColors);
|
|
49889
|
-
const scene = new
|
|
49889
|
+
const scene = new Scene(settings2.matrix);
|
|
49890
49890
|
const factory = new VimMeshFactory(g3d2, materials, scene);
|
|
49891
49891
|
const doc = await distExports$2.VimDocument.createFromBfast(bfast2);
|
|
49892
49892
|
const mapping = await ElementMapping.fromG3d(g3d2, doc);
|
|
@@ -49988,7 +49988,7 @@ void main() {
|
|
|
49988
49988
|
this._completionPromise.resolve();
|
|
49989
49989
|
}
|
|
49990
49990
|
async getResult() {
|
|
49991
|
-
await this._completionPromise;
|
|
49991
|
+
await this._completionPromise.promise;
|
|
49992
49992
|
return this._error ? new ErrorResult(this._error) : new SuccessResult(this._vimResult);
|
|
49993
49993
|
}
|
|
49994
49994
|
/**
|
|
@@ -52480,7 +52480,7 @@ void main() {
|
|
|
52480
52480
|
__publicField(this, "onClick");
|
|
52481
52481
|
__publicField(this, "onDoubleClick");
|
|
52482
52482
|
__publicField(this, "onWheel");
|
|
52483
|
-
this._capture = new
|
|
52483
|
+
this._capture = new CaptureHandler(canvas);
|
|
52484
52484
|
this._dragHandler = new DragHandler((delta, button) => this.onDrag(delta, button));
|
|
52485
52485
|
}
|
|
52486
52486
|
addListeners() {
|
|
@@ -52539,7 +52539,6 @@ void main() {
|
|
|
52539
52539
|
var _a3;
|
|
52540
52540
|
if (event.pointerType !== "mouse") return;
|
|
52541
52541
|
this._canvas.focus();
|
|
52542
|
-
this._capture.onPointerMove(event);
|
|
52543
52542
|
const pos = this.relativePosition(event);
|
|
52544
52543
|
this._dragHandler.onPointerMove(pos);
|
|
52545
52544
|
(_a3 = this.onMouseMove) == null ? void 0 : _a3.call(this, pos);
|
|
@@ -52563,34 +52562,23 @@ void main() {
|
|
|
52563
52562
|
);
|
|
52564
52563
|
}
|
|
52565
52564
|
}
|
|
52566
|
-
class
|
|
52565
|
+
class CaptureHandler {
|
|
52567
52566
|
constructor(canvas) {
|
|
52568
52567
|
__publicField(this, "_canvas");
|
|
52569
|
-
__publicField(this, "
|
|
52570
|
-
__publicField(this, "id");
|
|
52568
|
+
__publicField(this, "_id");
|
|
52571
52569
|
this._canvas = canvas;
|
|
52572
|
-
this.
|
|
52573
|
-
this.id = -1;
|
|
52570
|
+
this._id = -1;
|
|
52574
52571
|
}
|
|
52575
52572
|
onPointerDown(event) {
|
|
52576
|
-
if (this.
|
|
52577
|
-
this._canvas.releasePointerCapture(this.
|
|
52578
|
-
}
|
|
52579
|
-
this.id = event.pointerId;
|
|
52580
|
-
this.state = "capture";
|
|
52581
|
-
}
|
|
52582
|
-
onPointerMove(_event) {
|
|
52583
|
-
if (this.state === "capture") {
|
|
52584
|
-
this._canvas.setPointerCapture(this.id);
|
|
52585
|
-
this.state = "captured";
|
|
52573
|
+
if (this._id >= 0) {
|
|
52574
|
+
this._canvas.releasePointerCapture(this._id);
|
|
52586
52575
|
}
|
|
52576
|
+
this._canvas.setPointerCapture(event.pointerId);
|
|
52577
|
+
this._id = event.pointerId;
|
|
52587
52578
|
}
|
|
52588
52579
|
onPointerUp(event) {
|
|
52589
|
-
|
|
52590
|
-
|
|
52591
|
-
this.state = "none";
|
|
52592
|
-
this.id = -1;
|
|
52593
|
-
}
|
|
52580
|
+
this._canvas.releasePointerCapture(this._id);
|
|
52581
|
+
this._id = -1;
|
|
52594
52582
|
}
|
|
52595
52583
|
}
|
|
52596
52584
|
class DoubleClickHandler {
|
|
@@ -55120,7 +55108,7 @@ void main() {
|
|
|
55120
55108
|
__publicField(this, "_2dCount", 0);
|
|
55121
55109
|
__publicField(this, "_outlineCount", 0);
|
|
55122
55110
|
__publicField(this, "_modelMaterial");
|
|
55123
|
-
this.threeScene = new Scene();
|
|
55111
|
+
this.threeScene = new Scene$1();
|
|
55124
55112
|
}
|
|
55125
55113
|
get meshes() {
|
|
55126
55114
|
return this._vimScenes.flatMap((s) => s.meshes);
|
|
@@ -55161,7 +55149,7 @@ void main() {
|
|
|
55161
55149
|
* Add object to be rendered
|
|
55162
55150
|
*/
|
|
55163
55151
|
add(target) {
|
|
55164
|
-
if (target instanceof
|
|
55152
|
+
if (target instanceof Scene) {
|
|
55165
55153
|
this.addScene(target);
|
|
55166
55154
|
target.material = this._modelMaterial;
|
|
55167
55155
|
return;
|
|
@@ -55189,7 +55177,7 @@ void main() {
|
|
|
55189
55177
|
* Remove object from rendering
|
|
55190
55178
|
*/
|
|
55191
55179
|
remove(target) {
|
|
55192
|
-
if (target instanceof
|
|
55180
|
+
if (target instanceof Scene) {
|
|
55193
55181
|
this.removeScene(target);
|
|
55194
55182
|
return;
|
|
55195
55183
|
}
|
|
@@ -56956,7 +56944,7 @@ void main() {
|
|
|
56956
56944
|
* @param target The object or scene to add for rendering.
|
|
56957
56945
|
*/
|
|
56958
56946
|
add(target) {
|
|
56959
|
-
if (target instanceof
|
|
56947
|
+
if (target instanceof Scene) {
|
|
56960
56948
|
const mem = target.getMemory();
|
|
56961
56949
|
const remaining = this.maxMemory - this.estimatedMemory;
|
|
56962
56950
|
if (mem > remaining) {
|
|
@@ -58868,17 +58856,14 @@ void main() {
|
|
|
58868
58856
|
}
|
|
58869
58857
|
}
|
|
58870
58858
|
const CODE_TO_KEYCODE = {
|
|
58871
|
-
// Arrow keys
|
|
58872
58859
|
"ArrowUp": 38,
|
|
58873
58860
|
"ArrowDown": 40,
|
|
58874
58861
|
"ArrowLeft": 37,
|
|
58875
58862
|
"ArrowRight": 39,
|
|
58876
|
-
// WASD movement
|
|
58877
58863
|
"KeyW": 87,
|
|
58878
58864
|
"KeyA": 65,
|
|
58879
58865
|
"KeyS": 83,
|
|
58880
58866
|
"KeyD": 68,
|
|
58881
|
-
// Vertical movement (Up/Down)
|
|
58882
58867
|
"KeyE": 69,
|
|
58883
58868
|
"KeyQ": 81
|
|
58884
58869
|
};
|
|
@@ -58943,16 +58928,10 @@ void main() {
|
|
|
58943
58928
|
moveCamera: (value) => {
|
|
58944
58929
|
},
|
|
58945
58930
|
keyDown: (code) => {
|
|
58946
|
-
|
|
58947
|
-
if (!key) return false;
|
|
58948
|
-
viewer.rpc.RPCKeyEvent(key, true);
|
|
58949
|
-
return true;
|
|
58931
|
+
return sendKey(viewer, code, true);
|
|
58950
58932
|
},
|
|
58951
58933
|
keyUp: (code) => {
|
|
58952
|
-
|
|
58953
|
-
if (!key) return false;
|
|
58954
|
-
viewer.rpc.RPCKeyEvent(key, false);
|
|
58955
|
-
return true;
|
|
58934
|
+
return sendKey(viewer, code, false);
|
|
58956
58935
|
},
|
|
58957
58936
|
mouseDown: (pos, button) => {
|
|
58958
58937
|
viewer.rpc.RPCMouseButtonEvent(pos, button, true);
|
|
@@ -58970,6 +58949,12 @@ void main() {
|
|
|
58970
58949
|
if (!box) return;
|
|
58971
58950
|
viewer.camera.frameBox(box);
|
|
58972
58951
|
}
|
|
58952
|
+
function sendKey(viewer, code, pressed) {
|
|
58953
|
+
const key = CODE_TO_KEYCODE[code];
|
|
58954
|
+
if (!key) return false;
|
|
58955
|
+
viewer.rpc.RPCKeyEvent(key, pressed);
|
|
58956
|
+
return true;
|
|
58957
|
+
}
|
|
58973
58958
|
class LoadSuccess {
|
|
58974
58959
|
constructor(vim) {
|
|
58975
58960
|
__publicField(this, "isError", false);
|
|
@@ -60960,28 +60945,53 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
60960
60945
|
}
|
|
60961
60946
|
}
|
|
60962
60947
|
class Element3D {
|
|
60948
|
+
/**
|
|
60949
|
+
* Creates a new `Element3D` instance.
|
|
60950
|
+
* @param vim - The parent `Vim` model.
|
|
60951
|
+
* @param instance - The internal instance index.
|
|
60952
|
+
*/
|
|
60963
60953
|
constructor(vim, instance) {
|
|
60954
|
+
/**
|
|
60955
|
+
* The parent `Vim` instance this element belongs to.
|
|
60956
|
+
*/
|
|
60964
60957
|
__publicField(this, "vim");
|
|
60958
|
+
// TODO: this should be many instances
|
|
60959
|
+
// This will be replaced by the element index in the future
|
|
60960
|
+
/**
|
|
60961
|
+
* The internal instance index within the `Vim` model.
|
|
60962
|
+
*/
|
|
60965
60963
|
__publicField(this, "instance");
|
|
60966
60964
|
this.vim = vim;
|
|
60967
60965
|
this.instance = instance;
|
|
60968
60966
|
}
|
|
60967
|
+
/**
|
|
60968
|
+
* The unique handle of the parent `Vim` model.
|
|
60969
|
+
*/
|
|
60969
60970
|
get vimHandle() {
|
|
60970
60971
|
return this.vim.handle;
|
|
60971
60972
|
}
|
|
60972
|
-
|
|
60973
|
+
/**
|
|
60974
|
+
* Gets or sets the display state of the element (e.g., visible, hidden).
|
|
60975
|
+
*/
|
|
60973
60976
|
get state() {
|
|
60974
60977
|
return this.vim.nodeState.getNodeState(this.instance);
|
|
60975
60978
|
}
|
|
60976
60979
|
set state(state) {
|
|
60977
60980
|
this.vim.nodeState.setNodeState(this.instance, state);
|
|
60978
60981
|
}
|
|
60982
|
+
/**
|
|
60983
|
+
* Gets or sets the color override of the element.
|
|
60984
|
+
*/
|
|
60979
60985
|
get color() {
|
|
60980
60986
|
return this.vim.getColor(this.instance);
|
|
60981
60987
|
}
|
|
60982
60988
|
set color(color) {
|
|
60983
60989
|
this.vim.setColor([this.instance], color);
|
|
60984
60990
|
}
|
|
60991
|
+
/**
|
|
60992
|
+
* Computes and returns the bounding box of the element.
|
|
60993
|
+
* @returns A promise resolving to the element's bounding box.
|
|
60994
|
+
*/
|
|
60985
60995
|
async getBoundingBox() {
|
|
60986
60996
|
return this.vim.getBoundingBoxNodes([this.instance]);
|
|
60987
60997
|
}
|
|
@@ -61025,7 +61035,7 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
61025
61035
|
this._objects.set(instance, object);
|
|
61026
61036
|
return object;
|
|
61027
61037
|
}
|
|
61028
|
-
|
|
61038
|
+
getElementsFromId(id2) {
|
|
61029
61039
|
throw new Error("Method not implemented.");
|
|
61030
61040
|
}
|
|
61031
61041
|
getElementFromIndex(element) {
|
|
@@ -61656,6 +61666,11 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
61656
61666
|
sectionDefaultStyle,
|
|
61657
61667
|
sectionNoPadStyle
|
|
61658
61668
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
61669
|
+
const index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
61670
|
+
__proto__: null,
|
|
61671
|
+
Ids: controlBarIds,
|
|
61672
|
+
Style: style
|
|
61673
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
61659
61674
|
var jsxRuntime = { exports: {} };
|
|
61660
61675
|
var reactJsxRuntime_production_min = {};
|
|
61661
61676
|
/**
|
|
@@ -62594,21 +62609,6 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
62594
62609
|
return jsxRuntime.exports;
|
|
62595
62610
|
}
|
|
62596
62611
|
var jsxRuntimeExports = requireJsxRuntime();
|
|
62597
|
-
function isControlBarButtonItem(button) {
|
|
62598
|
-
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");
|
|
62599
|
-
}
|
|
62600
|
-
function createButton(button) {
|
|
62601
|
-
var _a3;
|
|
62602
|
-
if (button.enabled !== void 0 && !button.enabled()) return null;
|
|
62603
|
-
const style$1 = (button.style ?? buttonDefaultStyle)((_a3 = button.isOn) == null ? void 0 : _a3.call(button));
|
|
62604
|
-
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);
|
|
62605
|
-
}
|
|
62606
|
-
const index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
62607
|
-
__proto__: null,
|
|
62608
|
-
Ids: controlBarIds,
|
|
62609
|
-
Style: style,
|
|
62610
|
-
isControlBarButtonItem
|
|
62611
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
62612
62612
|
function pointer({ height, width, fill: fill2, className }) {
|
|
62613
62613
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { className, height, width, viewBox: "0 0 50 50", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
62614
62614
|
"path",
|
|
@@ -67441,6 +67441,12 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
67441
67441
|
}
|
|
67442
67442
|
);
|
|
67443
67443
|
}
|
|
67444
|
+
function createButton(button) {
|
|
67445
|
+
var _a3;
|
|
67446
|
+
if (button.enabled !== void 0 && !button.enabled()) return null;
|
|
67447
|
+
const style$1 = (button.style ?? buttonDefaultStyle)((_a3 = button.isOn) == null ? void 0 : _a3.call(button));
|
|
67448
|
+
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);
|
|
67449
|
+
}
|
|
67444
67450
|
function createSection$1(section) {
|
|
67445
67451
|
if (section.enable !== void 0 && !section.enable()) return null;
|
|
67446
67452
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `vim-control-bar-section ${section.style ?? sectionDefaultStyle}`, children: section.buttons.map((b) => createButton(b)) }, section.id);
|
|
@@ -74943,31 +74949,6 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
74943
74949
|
}
|
|
74944
74950
|
};
|
|
74945
74951
|
}
|
|
74946
|
-
class DeferredPromise extends Promise {
|
|
74947
|
-
constructor(executor = () => {
|
|
74948
|
-
}) {
|
|
74949
|
-
var _a3;
|
|
74950
|
-
let resolver;
|
|
74951
|
-
let rejector;
|
|
74952
|
-
super((resolve, reject) => {
|
|
74953
|
-
resolver = resolve;
|
|
74954
|
-
rejector = reject;
|
|
74955
|
-
return executor(resolve, reject);
|
|
74956
|
-
});
|
|
74957
|
-
__publicField(this, "resolve");
|
|
74958
|
-
__publicField(this, "reject");
|
|
74959
|
-
__publicField(this, "initialCallStack");
|
|
74960
|
-
this.resolve = resolver;
|
|
74961
|
-
this.reject = rejector;
|
|
74962
|
-
this.initialCallStack = (_a3 = Error().stack) == null ? void 0 : _a3.split("\n").slice(2).join("\n");
|
|
74963
|
-
}
|
|
74964
|
-
/** @throws error with amended call stack */
|
|
74965
|
-
rejectWithError(error) {
|
|
74966
|
-
var _a3;
|
|
74967
|
-
error.stack = [(_a3 = error.stack) == null ? void 0 : _a3.split("\n")[0], this.initialCallStack].join("\n");
|
|
74968
|
-
this.reject(error);
|
|
74969
|
-
}
|
|
74970
|
-
}
|
|
74971
74952
|
const vcColorPrimary = "vc-text-[#212733]";
|
|
74972
74953
|
const vcColorSecondary = "vc-text-[#787C83]";
|
|
74973
74954
|
const vcColorLink = "vc-text-[#0590CC]";
|
|
@@ -75209,9 +75190,9 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
75209
75190
|
__publicField(this, "_callbacks");
|
|
75210
75191
|
__publicField(this, "_request");
|
|
75211
75192
|
__publicField(this, "_progress", { loaded: 0, total: 0, all: /* @__PURE__ */ new Map() });
|
|
75212
|
-
__publicField(this, "_progressPromise", new
|
|
75193
|
+
__publicField(this, "_progressPromise", new ControllablePromise());
|
|
75213
75194
|
__publicField(this, "_isDone", false);
|
|
75214
|
-
__publicField(this, "_completionPromise", new
|
|
75195
|
+
__publicField(this, "_completionPromise", new ControllablePromise());
|
|
75215
75196
|
this.source = source;
|
|
75216
75197
|
this._callbacks = callbacks;
|
|
75217
75198
|
this.startRequest(source, settings2);
|
|
@@ -75232,7 +75213,7 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
75232
75213
|
this._callbacks.onProgress(progress);
|
|
75233
75214
|
this._progress = progress;
|
|
75234
75215
|
this._progressPromise.resolve();
|
|
75235
|
-
this._progressPromise = new
|
|
75216
|
+
this._progressPromise = new ControllablePromise();
|
|
75236
75217
|
}
|
|
75237
75218
|
onSuccess() {
|
|
75238
75219
|
this._callbacks.onDone();
|
|
@@ -75252,7 +75233,7 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
75252
75233
|
}
|
|
75253
75234
|
async *getProgress() {
|
|
75254
75235
|
while (!this._isDone) {
|
|
75255
|
-
await this._progressPromise;
|
|
75236
|
+
await this._progressPromise.promise;
|
|
75256
75237
|
yield this._progress;
|
|
75257
75238
|
}
|
|
75258
75239
|
}
|
|
@@ -76107,7 +76088,7 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76107
76088
|
return "some";
|
|
76108
76089
|
}
|
|
76109
76090
|
function createViewer$1(container, settings2 = {}, coreSettings = {}) {
|
|
76110
|
-
const
|
|
76091
|
+
const controllablePromise = new ControllablePromise();
|
|
76111
76092
|
const cmpContainer = container instanceof HTMLElement ? createContainer(container) : container ?? createContainer();
|
|
76112
76093
|
const viewer = new Viewer$3(coreSettings);
|
|
76113
76094
|
viewer.viewport.reparent(cmpContainer.gfx);
|
|
@@ -76126,12 +76107,12 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76126
76107
|
{
|
|
76127
76108
|
container: cmpContainer,
|
|
76128
76109
|
viewer,
|
|
76129
|
-
onMount: (cmp) =>
|
|
76110
|
+
onMount: (cmp) => controllablePromise.resolve(patchRef(cmp)),
|
|
76130
76111
|
settings: settings2
|
|
76131
76112
|
}
|
|
76132
76113
|
)
|
|
76133
76114
|
);
|
|
76134
|
-
return promise;
|
|
76115
|
+
return controllablePromise.promise;
|
|
76135
76116
|
}
|
|
76136
76117
|
function Viewer$1(props) {
|
|
76137
76118
|
const settings2 = useSettings(props.viewer, props.settings ?? {});
|
|
@@ -76500,7 +76481,7 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76500
76481
|
return false;
|
|
76501
76482
|
}
|
|
76502
76483
|
function createViewer(container) {
|
|
76503
|
-
const
|
|
76484
|
+
const controllablePromise = new ControllablePromise();
|
|
76504
76485
|
const cmpContainer = container instanceof HTMLElement ? createContainer(container) : container ?? createContainer();
|
|
76505
76486
|
const core = Viewer$2.createWithCanvas(cmpContainer.gfx);
|
|
76506
76487
|
const reactRoot = clientExports.createRoot(cmpContainer.ui);
|
|
@@ -76518,11 +76499,11 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76518
76499
|
{
|
|
76519
76500
|
container: cmpContainer,
|
|
76520
76501
|
core,
|
|
76521
|
-
onMount: (cmp) =>
|
|
76502
|
+
onMount: (cmp) => controllablePromise.resolve(attachDispose(cmp))
|
|
76522
76503
|
}
|
|
76523
76504
|
)
|
|
76524
76505
|
);
|
|
76525
|
-
return promise;
|
|
76506
|
+
return controllablePromise.promise;
|
|
76526
76507
|
}
|
|
76527
76508
|
function Viewer(props) {
|
|
76528
76509
|
const sectionBox2 = useUltraSectionBox(props.core);
|
|
@@ -76626,7 +76607,6 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76626
76607
|
__proto__: null,
|
|
76627
76608
|
ContextMenu: contextMenu,
|
|
76628
76609
|
ControlBar: index$5,
|
|
76629
|
-
DeferredPromise,
|
|
76630
76610
|
Errors: index$3,
|
|
76631
76611
|
Icons: icons,
|
|
76632
76612
|
IsolationPanel,
|