vim-web 0.3.44-dev.16 → 0.3.44-dev.17
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/react-viewers/controlbar/controlBarIds.d.ts +1 -1
- package/dist/types/react-viewers/ultra/index.d.ts +2 -0
- package/dist/types/react-viewers/ultra/ultraComponent.d.ts +1 -25
- package/dist/types/react-viewers/ultra/ultraComponentRef.d.ts +31 -0
- package/dist/vim-web.iife.js +59 -45
- package/dist/vim-web.iife.js.map +1 -1
- package/dist/vim-web.js +59 -45
- package/dist/vim-web.js.map +1 -1
- package/package.json +1 -1
package/dist/vim-web.js
CHANGED
|
@@ -45819,7 +45819,7 @@ class ElementNoMapping {
|
|
|
45819
45819
|
}
|
|
45820
45820
|
}
|
|
45821
45821
|
class ElementMapping {
|
|
45822
|
-
constructor(instances, instanceToElement,
|
|
45822
|
+
constructor(instances, instanceToElement, elementIds, instanceMeshes) {
|
|
45823
45823
|
__publicField(this, "_instanceToElement");
|
|
45824
45824
|
__publicField(this, "_instanceMeshes");
|
|
45825
45825
|
__publicField(this, "_elementToInstances");
|
|
@@ -45832,17 +45832,17 @@ class ElementMapping {
|
|
|
45832
45832
|
this._elementToInstances = ElementMapping.invertMap(
|
|
45833
45833
|
this._instanceToElement
|
|
45834
45834
|
);
|
|
45835
|
-
this._elementIds =
|
|
45836
|
-
this._elementIdToElements = ElementMapping.invertArray(
|
|
45835
|
+
this._elementIds = elementIds;
|
|
45836
|
+
this._elementIdToElements = ElementMapping.invertArray(elementIds);
|
|
45837
45837
|
this._instanceMeshes = instanceMeshes;
|
|
45838
45838
|
}
|
|
45839
45839
|
static async fromG3d(g3d2, bim) {
|
|
45840
45840
|
const instanceToElement = await bim.node.getAllElementIndex();
|
|
45841
|
-
const
|
|
45841
|
+
const elementIds = await bim.element.getAllId();
|
|
45842
45842
|
return new ElementMapping(
|
|
45843
45843
|
Array.from(g3d2.instanceNodes),
|
|
45844
45844
|
instanceToElement,
|
|
45845
|
-
|
|
45845
|
+
elementIds,
|
|
45846
45846
|
g3d2.instanceMeshes
|
|
45847
45847
|
);
|
|
45848
45848
|
}
|
|
@@ -60796,8 +60796,8 @@ class Vim2 {
|
|
|
60796
60796
|
if (nodes === "all") {
|
|
60797
60797
|
this._rpc.RPCClearMaterialOverrides(this._handle);
|
|
60798
60798
|
} else {
|
|
60799
|
-
const
|
|
60800
|
-
this._rpc.RPCSetMaterialOverrides(this._handle, nodes,
|
|
60799
|
+
const ids2 = new Array(nodes.length).fill(MaterialHandles.Invalid);
|
|
60800
|
+
this._rpc.RPCSetMaterialOverrides(this._handle, nodes, ids2);
|
|
60801
60801
|
}
|
|
60802
60802
|
}
|
|
60803
60803
|
updateMap(nodes, state) {
|
|
@@ -67561,7 +67561,7 @@ function createSection$1(section) {
|
|
|
67561
67561
|
if (section.enable !== void 0 && !section.enable()) return null;
|
|
67562
67562
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `vim-control-bar-section ${section.style ?? sectionDefaultStyle}`, children: section.buttons.map((b) => createButton(b)) }, section.id);
|
|
67563
67563
|
}
|
|
67564
|
-
const
|
|
67564
|
+
const ids = {
|
|
67565
67565
|
// Sections
|
|
67566
67566
|
sectionCamera: "controlBar.sectionCamera",
|
|
67567
67567
|
sectionActions: "controlBar.sectionActions",
|
|
@@ -67623,7 +67623,7 @@ const controlBar = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
|
|
|
67623
67623
|
buttonExpandStyle,
|
|
67624
67624
|
createButton,
|
|
67625
67625
|
createSection: createSection$1,
|
|
67626
|
-
|
|
67626
|
+
ids,
|
|
67627
67627
|
sectionBlueStyle,
|
|
67628
67628
|
sectionDefaultStyle,
|
|
67629
67629
|
sectionNoPadStyle
|
|
@@ -67811,12 +67811,12 @@ function getMeasureState(viewer, cursor) {
|
|
|
67811
67811
|
}
|
|
67812
67812
|
function controlBarSectionBox(section, hasSelection) {
|
|
67813
67813
|
return {
|
|
67814
|
-
id:
|
|
67814
|
+
id: ids.sectionSectionBox,
|
|
67815
67815
|
style: section.enable.get() ? sectionNoPadStyle : sectionDefaultStyle,
|
|
67816
67816
|
//enable: () => section.getEnable(),
|
|
67817
67817
|
buttons: [
|
|
67818
67818
|
{
|
|
67819
|
-
id:
|
|
67819
|
+
id: ids.buttonSectionBoxEnable,
|
|
67820
67820
|
tip: "Enable Section Box",
|
|
67821
67821
|
isOn: () => section.enable.get(),
|
|
67822
67822
|
style: (on) => buttonExpandStyle(on),
|
|
@@ -67824,7 +67824,7 @@ function controlBarSectionBox(section, hasSelection) {
|
|
|
67824
67824
|
icon: sectionBox
|
|
67825
67825
|
},
|
|
67826
67826
|
{
|
|
67827
|
-
id:
|
|
67827
|
+
id: ids.buttonSectionBoxShrinkToSelection,
|
|
67828
67828
|
tip: "Fit Section",
|
|
67829
67829
|
enabled: () => section.enable.get(),
|
|
67830
67830
|
isOn: () => hasSelection,
|
|
@@ -67833,7 +67833,7 @@ function controlBarSectionBox(section, hasSelection) {
|
|
|
67833
67833
|
icon: sectionBoxShrink
|
|
67834
67834
|
},
|
|
67835
67835
|
{
|
|
67836
|
-
id:
|
|
67836
|
+
id: ids.buttonSectionBoxClip,
|
|
67837
67837
|
tip: "Reset Section",
|
|
67838
67838
|
enabled: () => section.enable.get(),
|
|
67839
67839
|
style: (on) => buttonDefaultStyle(on),
|
|
@@ -67841,7 +67841,7 @@ function controlBarSectionBox(section, hasSelection) {
|
|
|
67841
67841
|
icon: sectionBoxReset
|
|
67842
67842
|
},
|
|
67843
67843
|
{
|
|
67844
|
-
id:
|
|
67844
|
+
id: ids.buttonSectionBoxVisible,
|
|
67845
67845
|
tip: "Show Section Box",
|
|
67846
67846
|
enabled: () => section.enable.get(),
|
|
67847
67847
|
isOn: () => section.visible.get(),
|
|
@@ -67850,7 +67850,7 @@ function controlBarSectionBox(section, hasSelection) {
|
|
|
67850
67850
|
icon: visible
|
|
67851
67851
|
},
|
|
67852
67852
|
{
|
|
67853
|
-
id:
|
|
67853
|
+
id: ids.buttonSectionBoxAuto,
|
|
67854
67854
|
tip: "Auto Section",
|
|
67855
67855
|
enabled: () => section.enable.get(),
|
|
67856
67856
|
isOn: () => section.auto.get(),
|
|
@@ -67859,7 +67859,7 @@ function controlBarSectionBox(section, hasSelection) {
|
|
|
67859
67859
|
icon: sectionBoxAuto
|
|
67860
67860
|
},
|
|
67861
67861
|
{
|
|
67862
|
-
id:
|
|
67862
|
+
id: ids.buttonSectionBoxSettings,
|
|
67863
67863
|
tip: "Section Settings",
|
|
67864
67864
|
enabled: () => section.enable.get(),
|
|
67865
67865
|
isOn: () => section.showOffsetPanel.get(),
|
|
@@ -67873,12 +67873,12 @@ function controlBarSectionBox(section, hasSelection) {
|
|
|
67873
67873
|
function controlBarPointer(viewer, camera2, settings2, section) {
|
|
67874
67874
|
const pointer = getPointerState(viewer);
|
|
67875
67875
|
return {
|
|
67876
|
-
id:
|
|
67876
|
+
id: ids.sectionCamera,
|
|
67877
67877
|
enable: () => anyUiCursorButton(settings2),
|
|
67878
67878
|
style: sectionDefaultStyle,
|
|
67879
67879
|
buttons: [
|
|
67880
67880
|
{
|
|
67881
|
-
id:
|
|
67881
|
+
id: ids.buttonCameraOrbit,
|
|
67882
67882
|
enabled: () => isTrue(settings2.ui.orbit),
|
|
67883
67883
|
tip: "Orbit",
|
|
67884
67884
|
action: () => pointer.onButton("orbit"),
|
|
@@ -67887,7 +67887,7 @@ function controlBarPointer(viewer, camera2, settings2, section) {
|
|
|
67887
67887
|
style: buttonDefaultStyle
|
|
67888
67888
|
},
|
|
67889
67889
|
{
|
|
67890
|
-
id:
|
|
67890
|
+
id: ids.buttonCameraLook,
|
|
67891
67891
|
enabled: () => isTrue(settings2.ui.lookAround),
|
|
67892
67892
|
tip: "Look Around",
|
|
67893
67893
|
action: () => pointer.onButton("look"),
|
|
@@ -67896,7 +67896,7 @@ function controlBarPointer(viewer, camera2, settings2, section) {
|
|
|
67896
67896
|
style: buttonDefaultStyle
|
|
67897
67897
|
},
|
|
67898
67898
|
{
|
|
67899
|
-
id:
|
|
67899
|
+
id: ids.buttonCameraPan,
|
|
67900
67900
|
enabled: () => isTrue(settings2.ui.pan),
|
|
67901
67901
|
tip: "Pan",
|
|
67902
67902
|
action: () => pointer.onButton("pan"),
|
|
@@ -67905,7 +67905,7 @@ function controlBarPointer(viewer, camera2, settings2, section) {
|
|
|
67905
67905
|
style: buttonDefaultStyle
|
|
67906
67906
|
},
|
|
67907
67907
|
{
|
|
67908
|
-
id:
|
|
67908
|
+
id: ids.buttonCameraZoom,
|
|
67909
67909
|
enabled: () => isTrue(settings2.ui.zoom),
|
|
67910
67910
|
tip: "Zoom",
|
|
67911
67911
|
action: () => pointer.onButton("zoom"),
|
|
@@ -67914,7 +67914,7 @@ function controlBarPointer(viewer, camera2, settings2, section) {
|
|
|
67914
67914
|
style: buttonDefaultStyle
|
|
67915
67915
|
},
|
|
67916
67916
|
{
|
|
67917
|
-
id:
|
|
67917
|
+
id: ids.buttonCameraZoomWindow,
|
|
67918
67918
|
enabled: () => isTrue(settings2.ui.zoomWindow),
|
|
67919
67919
|
tip: "Zoom Window",
|
|
67920
67920
|
action: () => {
|
|
@@ -67929,12 +67929,12 @@ function controlBarPointer(viewer, camera2, settings2, section) {
|
|
|
67929
67929
|
}
|
|
67930
67930
|
function controlBarActions(camera2, settings2, isolation, measure$1) {
|
|
67931
67931
|
return {
|
|
67932
|
-
id:
|
|
67932
|
+
id: ids.sectionActions,
|
|
67933
67933
|
enable: () => true,
|
|
67934
67934
|
style: sectionDefaultStyle,
|
|
67935
67935
|
buttons: [
|
|
67936
67936
|
{
|
|
67937
|
-
id:
|
|
67937
|
+
id: ids.buttonZoomToFit,
|
|
67938
67938
|
enabled: () => isTrue(settings2.ui.zoomToFit),
|
|
67939
67939
|
tip: "Zoom to Fit",
|
|
67940
67940
|
action: () => camera2.frameContext(),
|
|
@@ -67943,7 +67943,7 @@ function controlBarActions(camera2, settings2, isolation, measure$1) {
|
|
|
67943
67943
|
style: buttonDefaultStyle
|
|
67944
67944
|
},
|
|
67945
67945
|
{
|
|
67946
|
-
id:
|
|
67946
|
+
id: ids.buttonToggleIsolation,
|
|
67947
67947
|
enabled: () => isTrue(settings2.ui.toggleIsolation),
|
|
67948
67948
|
tip: "Toggle Isolation",
|
|
67949
67949
|
action: () => isolation.toggle("controlBar"),
|
|
@@ -67951,7 +67951,7 @@ function controlBarActions(camera2, settings2, isolation, measure$1) {
|
|
|
67951
67951
|
style: buttonDefaultStyle
|
|
67952
67952
|
},
|
|
67953
67953
|
{
|
|
67954
|
-
id:
|
|
67954
|
+
id: ids.buttonMeasure,
|
|
67955
67955
|
enabled: () => isTrue(settings2.ui.measuringMode),
|
|
67956
67956
|
isOn: () => measure$1.active,
|
|
67957
67957
|
tip: "Measuring Mode",
|
|
@@ -67965,12 +67965,12 @@ function controlBarActions(camera2, settings2, isolation, measure$1) {
|
|
|
67965
67965
|
function controlBarSettings(modal, side, settings$1) {
|
|
67966
67966
|
const fullScreen = getFullScreenState();
|
|
67967
67967
|
return {
|
|
67968
|
-
id:
|
|
67968
|
+
id: ids.sectionSettings,
|
|
67969
67969
|
enable: () => anyUiSettingButton(settings$1),
|
|
67970
67970
|
style: sectionDefaultStyle,
|
|
67971
67971
|
buttons: [
|
|
67972
67972
|
{
|
|
67973
|
-
id:
|
|
67973
|
+
id: ids.buttonProjectInspector,
|
|
67974
67974
|
enabled: () => isTrue(settings$1.ui.projectInspector) && (isTrue(settings$1.ui.bimTreePanel) || isTrue(settings$1.ui.bimInfoPanel)),
|
|
67975
67975
|
tip: "Project Inspector",
|
|
67976
67976
|
action: () => side.toggleContent("bim"),
|
|
@@ -67978,7 +67978,7 @@ function controlBarSettings(modal, side, settings$1) {
|
|
|
67978
67978
|
style: buttonDefaultStyle
|
|
67979
67979
|
},
|
|
67980
67980
|
{
|
|
67981
|
-
id:
|
|
67981
|
+
id: ids.buttonSettings,
|
|
67982
67982
|
enabled: () => isTrue(settings$1.ui.settings),
|
|
67983
67983
|
tip: "Settings",
|
|
67984
67984
|
action: () => side.toggleContent("settings"),
|
|
@@ -67986,7 +67986,7 @@ function controlBarSettings(modal, side, settings$1) {
|
|
|
67986
67986
|
style: buttonDefaultStyle
|
|
67987
67987
|
},
|
|
67988
67988
|
{
|
|
67989
|
-
id:
|
|
67989
|
+
id: ids.buttonHelp,
|
|
67990
67990
|
enabled: () => isTrue(settings$1.ui.help),
|
|
67991
67991
|
tip: "Help",
|
|
67992
67992
|
action: () => modal.help(true),
|
|
@@ -67994,7 +67994,7 @@ function controlBarSettings(modal, side, settings$1) {
|
|
|
67994
67994
|
style: buttonDefaultStyle
|
|
67995
67995
|
},
|
|
67996
67996
|
{
|
|
67997
|
-
id:
|
|
67997
|
+
id: ids.buttonMaximize,
|
|
67998
67998
|
enabled: () => isTrue(settings$1.ui.maximise) && settings$1.capacity.canGoFullScreen,
|
|
67999
67999
|
tip: fullScreen.get() ? "Minimize" : "Fullscreen",
|
|
68000
68000
|
action: () => fullScreen.toggle(),
|
|
@@ -76494,15 +76494,26 @@ function createUltraComponent(container) {
|
|
|
76494
76494
|
function UltraComponent(props) {
|
|
76495
76495
|
const modal = useModal(true);
|
|
76496
76496
|
const sectionBox2 = useUltraSectionBox(props.viewer);
|
|
76497
|
-
const controlBar2 = useUltraControlBar(props.viewer, sectionBox2, (_2) => _2);
|
|
76498
76497
|
const side = useSideState(true, 400);
|
|
76499
76498
|
const [_, setSelectState] = useState(0);
|
|
76499
|
+
const [controlBarCustom, setControlBarCustom] = useState(() => (c) => c);
|
|
76500
|
+
const controlBar2 = useUltraControlBar(props.viewer, sectionBox2, (_2) => _2);
|
|
76500
76501
|
useEffect(() => {
|
|
76501
76502
|
props.viewer.onStateChanged.subscribe((state) => updateModal(modal, state));
|
|
76502
76503
|
props.viewer.selection.onValueChanged.subscribe(() => {
|
|
76503
76504
|
setSelectState((i) => (i + 1) % 2);
|
|
76504
76505
|
});
|
|
76505
|
-
props.onMount(
|
|
76506
|
+
props.onMount({
|
|
76507
|
+
viewer: props.viewer,
|
|
76508
|
+
modal,
|
|
76509
|
+
sectionBox: sectionBox2,
|
|
76510
|
+
dispose: () => {
|
|
76511
|
+
},
|
|
76512
|
+
controlBar: {
|
|
76513
|
+
customize: (v) => setControlBarCustom(() => v)
|
|
76514
|
+
},
|
|
76515
|
+
load: patchLoad(props.viewer, modal)
|
|
76516
|
+
});
|
|
76506
76517
|
}, []);
|
|
76507
76518
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
76508
76519
|
/* @__PURE__ */ jsxRuntimeExports.jsx(RestOfScreen, { side, content: () => {
|
|
@@ -76512,18 +76523,28 @@ function UltraComponent(props) {
|
|
|
76512
76523
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
76513
76524
|
ControlBar,
|
|
76514
76525
|
{
|
|
76515
|
-
content: controlBar2,
|
|
76526
|
+
content: controlBarCustom(controlBar2),
|
|
76516
76527
|
show: true
|
|
76517
76528
|
}
|
|
76518
76529
|
),
|
|
76519
76530
|
/* @__PURE__ */ jsxRuntimeExports.jsx(SectionBoxPanel, { state: sectionBox2 })
|
|
76520
76531
|
] });
|
|
76521
76532
|
} }),
|
|
76522
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Modal, { state: modal })
|
|
76533
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Modal, { state: modal }),
|
|
76534
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
76535
|
+
ReactTooltip,
|
|
76536
|
+
{
|
|
76537
|
+
multiline: true,
|
|
76538
|
+
arrowColor: "transparent",
|
|
76539
|
+
type: "light",
|
|
76540
|
+
className: "!vc-max-w-xs !vc-border !vc-border-solid !vc-border-gray-medium !vc-bg-white !vc-text-xs !vc-text-gray-darkest !vc-opacity-100 !vc-shadow-[2px_6px_15px_rgba(0,0,0,0.3)] !vc-transition-opacity",
|
|
76541
|
+
delayShow: 200
|
|
76542
|
+
}
|
|
76543
|
+
)
|
|
76523
76544
|
] });
|
|
76524
76545
|
}
|
|
76525
|
-
function
|
|
76526
|
-
function load(source) {
|
|
76546
|
+
function patchLoad(viewer, modal) {
|
|
76547
|
+
return function load(source) {
|
|
76527
76548
|
const request2 = viewer.loadVim(source);
|
|
76528
76549
|
void updateProgress(request2, modal);
|
|
76529
76550
|
void request2.getResult().then(
|
|
@@ -76538,18 +76559,11 @@ function createComponentRef(viewer, modal, sectionBox2) {
|
|
|
76538
76559
|
}
|
|
76539
76560
|
);
|
|
76540
76561
|
return request2;
|
|
76541
|
-
}
|
|
76542
|
-
return {
|
|
76543
|
-
viewer,
|
|
76544
|
-
modal,
|
|
76545
|
-
sectionBox: sectionBox2,
|
|
76546
|
-
dispose: () => {
|
|
76547
|
-
},
|
|
76548
|
-
load
|
|
76549
76562
|
};
|
|
76550
76563
|
}
|
|
76551
76564
|
const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
76552
76565
|
__proto__: null,
|
|
76566
|
+
ControlBar: controlBar,
|
|
76553
76567
|
UltraComponent,
|
|
76554
76568
|
createUltraComponent
|
|
76555
76569
|
}, Symbol.toStringTag, { value: "Module" }));
|