vim-web 0.3.44-dev.70 → 0.3.44-dev.72
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/generic/genericField.d.ts +26 -0
- package/dist/types/react-viewers/generic/genericPanel.d.ts +12 -0
- package/dist/types/react-viewers/generic/index.d.ts +2 -0
- package/dist/types/react-viewers/helpers/customizer.d.ts +4 -0
- package/dist/types/react-viewers/helpers/index.d.ts +6 -9
- package/dist/types/react-viewers/helpers/layout.d.ts +24 -0
- package/dist/types/react-viewers/index.d.ts +2 -1
- package/dist/types/react-viewers/panels/contextMenu.d.ts +2 -2
- package/dist/types/react-viewers/panels/index.d.ts +1 -2
- package/dist/types/react-viewers/panels/isolationPanel.d.ts +5 -0
- package/dist/types/react-viewers/panels/modal.d.ts +2 -2
- package/dist/types/react-viewers/panels/sectionBoxPanel.d.ts +3 -2
- package/dist/types/react-viewers/state/controlBarState.d.ts +2 -2
- package/dist/types/react-viewers/ultra/modal.d.ts +3 -3
- package/dist/types/react-viewers/ultra/viewerRef.d.ts +11 -2
- package/dist/types/react-viewers/webgl/loading.d.ts +2 -2
- package/dist/types/react-viewers/webgl/viewerRef.d.ts +11 -2
- package/dist/types/react-viewers/webgl/viewerState.d.ts +1 -1
- package/dist/vim-web.iife.js +304 -201
- package/dist/vim-web.iife.js.map +1 -1
- package/dist/vim-web.js +305 -202
- package/dist/vim-web.js.map +1 -1
- package/package.json +1 -1
- package/dist/types/react-viewers/panels/genericPanel.d.ts +0 -26
- package/dist/types/react-viewers/panels/renderSettingsPanel.d.ts +0 -4
- /package/dist/types/react-viewers/{components → generic}/inputNumber.d.ts +0 -0
package/dist/vim-web.iife.js
CHANGED
|
@@ -74583,92 +74583,13 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
74583
74583
|
})
|
|
74584
74584
|
);
|
|
74585
74585
|
}
|
|
74586
|
-
|
|
74587
|
-
|
|
74588
|
-
|
|
74589
|
-
|
|
74590
|
-
|
|
74591
|
-
let rejector;
|
|
74592
|
-
super((resolve, reject) => {
|
|
74593
|
-
resolver = resolve;
|
|
74594
|
-
rejector = reject;
|
|
74595
|
-
return executor(resolve, reject);
|
|
74596
|
-
});
|
|
74597
|
-
__publicField(this, "resolve");
|
|
74598
|
-
__publicField(this, "reject");
|
|
74599
|
-
__publicField(this, "initialCallStack");
|
|
74600
|
-
this.resolve = resolver;
|
|
74601
|
-
this.reject = rejector;
|
|
74602
|
-
this.initialCallStack = (_a3 = Error().stack) == null ? void 0 : _a3.split("\n").slice(2).join("\n");
|
|
74603
|
-
}
|
|
74604
|
-
/** @throws error with amended call stack */
|
|
74605
|
-
rejectWithError(error) {
|
|
74606
|
-
var _a3;
|
|
74607
|
-
error.stack = [(_a3 = error.stack) == null ? void 0 : _a3.split("\n")[0], this.initialCallStack].join("\n");
|
|
74608
|
-
this.reject(error);
|
|
74609
|
-
}
|
|
74610
|
-
}
|
|
74611
|
-
class LoadRequest {
|
|
74612
|
-
constructor(callbacks, source, settings2) {
|
|
74613
|
-
__publicField(this, "source");
|
|
74614
|
-
__publicField(this, "_callbacks");
|
|
74615
|
-
__publicField(this, "_request");
|
|
74616
|
-
__publicField(this, "_progress", { loaded: 0, total: 0, all: /* @__PURE__ */ new Map() });
|
|
74617
|
-
__publicField(this, "_progressPromise", new DeferredPromise());
|
|
74618
|
-
__publicField(this, "_isDone", false);
|
|
74619
|
-
__publicField(this, "_completionPromise", new DeferredPromise());
|
|
74620
|
-
this.source = source;
|
|
74621
|
-
this._callbacks = callbacks;
|
|
74622
|
-
this.startRequest(source, settings2);
|
|
74623
|
-
}
|
|
74624
|
-
async startRequest(source, settings2) {
|
|
74625
|
-
this._request = await requestVim(source, settings2);
|
|
74626
|
-
for await (const progress of this._request.getProgress()) {
|
|
74627
|
-
this.onProgress(progress);
|
|
74628
|
-
}
|
|
74629
|
-
const result = await this._request.getResult();
|
|
74630
|
-
if (result.isError()) {
|
|
74631
|
-
this.onError(result.error);
|
|
74632
|
-
} else {
|
|
74633
|
-
this.onSuccess();
|
|
74634
|
-
}
|
|
74635
|
-
}
|
|
74636
|
-
onProgress(progress) {
|
|
74637
|
-
this._callbacks.onProgress(progress);
|
|
74638
|
-
this._progress = progress;
|
|
74639
|
-
this._progressPromise.resolve();
|
|
74640
|
-
this._progressPromise = new DeferredPromise();
|
|
74641
|
-
}
|
|
74642
|
-
onSuccess() {
|
|
74643
|
-
this._callbacks.onDone();
|
|
74644
|
-
this.end();
|
|
74645
|
-
}
|
|
74646
|
-
onError(error) {
|
|
74647
|
-
this._callbacks.onError({
|
|
74648
|
-
url: this.source.url,
|
|
74649
|
-
error
|
|
74650
|
-
});
|
|
74651
|
-
this.end();
|
|
74652
|
-
}
|
|
74653
|
-
end() {
|
|
74654
|
-
this._isDone = true;
|
|
74655
|
-
this._progressPromise.resolve();
|
|
74656
|
-
this._completionPromise.resolve();
|
|
74657
|
-
}
|
|
74658
|
-
async *getProgress() {
|
|
74659
|
-
while (!this._isDone) {
|
|
74660
|
-
await this._progressPromise;
|
|
74661
|
-
yield this._progress;
|
|
74586
|
+
function useRefresher() {
|
|
74587
|
+
const [refresh, setRefresh] = React2.useState(false);
|
|
74588
|
+
return {
|
|
74589
|
+
refresh: () => {
|
|
74590
|
+
setRefresh(!refresh);
|
|
74662
74591
|
}
|
|
74663
|
-
}
|
|
74664
|
-
async getResult() {
|
|
74665
|
-
await this._completionPromise;
|
|
74666
|
-
return this._request.getResult();
|
|
74667
|
-
}
|
|
74668
|
-
abort() {
|
|
74669
|
-
this._request.abort();
|
|
74670
|
-
this.onError("Request aborted");
|
|
74671
|
-
}
|
|
74592
|
+
};
|
|
74672
74593
|
}
|
|
74673
74594
|
function useStateRef(initialValue) {
|
|
74674
74595
|
const [value, setValue] = React2.useState(initialValue);
|
|
@@ -74865,6 +74786,45 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
74865
74786
|
}
|
|
74866
74787
|
};
|
|
74867
74788
|
}
|
|
74789
|
+
function useArgFuncRef(fn) {
|
|
74790
|
+
const ref = React2.useRef(fn);
|
|
74791
|
+
return {
|
|
74792
|
+
call(arg) {
|
|
74793
|
+
return ref == null ? void 0 : ref.current(arg);
|
|
74794
|
+
},
|
|
74795
|
+
get() {
|
|
74796
|
+
return ref.current;
|
|
74797
|
+
},
|
|
74798
|
+
set(fn2) {
|
|
74799
|
+
ref.current = fn2;
|
|
74800
|
+
},
|
|
74801
|
+
prepend(fn2) {
|
|
74802
|
+
const oldFn = ref.current;
|
|
74803
|
+
ref.current = (arg) => {
|
|
74804
|
+
fn2(arg);
|
|
74805
|
+
return oldFn(arg);
|
|
74806
|
+
};
|
|
74807
|
+
},
|
|
74808
|
+
append(fn2) {
|
|
74809
|
+
const oldFn = ref.current;
|
|
74810
|
+
ref.current = (arg) => {
|
|
74811
|
+
const result = oldFn(arg);
|
|
74812
|
+
fn2(arg);
|
|
74813
|
+
return result;
|
|
74814
|
+
};
|
|
74815
|
+
}
|
|
74816
|
+
};
|
|
74817
|
+
}
|
|
74818
|
+
const reactUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
74819
|
+
__proto__: null,
|
|
74820
|
+
useActionRef,
|
|
74821
|
+
useArgActionRef,
|
|
74822
|
+
useArgFuncRef,
|
|
74823
|
+
useAsyncFuncRef,
|
|
74824
|
+
useFuncRef,
|
|
74825
|
+
useRefresher,
|
|
74826
|
+
useStateRef
|
|
74827
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
74868
74828
|
function useViewerState(viewer) {
|
|
74869
74829
|
const getVim = () => {
|
|
74870
74830
|
var _a3;
|
|
@@ -74996,6 +74956,31 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
74996
74956
|
}
|
|
74997
74957
|
};
|
|
74998
74958
|
}
|
|
74959
|
+
class DeferredPromise extends Promise {
|
|
74960
|
+
constructor(executor = () => {
|
|
74961
|
+
}) {
|
|
74962
|
+
var _a3;
|
|
74963
|
+
let resolver;
|
|
74964
|
+
let rejector;
|
|
74965
|
+
super((resolve, reject) => {
|
|
74966
|
+
resolver = resolve;
|
|
74967
|
+
rejector = reject;
|
|
74968
|
+
return executor(resolve, reject);
|
|
74969
|
+
});
|
|
74970
|
+
__publicField(this, "resolve");
|
|
74971
|
+
__publicField(this, "reject");
|
|
74972
|
+
__publicField(this, "initialCallStack");
|
|
74973
|
+
this.resolve = resolver;
|
|
74974
|
+
this.reject = rejector;
|
|
74975
|
+
this.initialCallStack = (_a3 = Error().stack) == null ? void 0 : _a3.split("\n").slice(2).join("\n");
|
|
74976
|
+
}
|
|
74977
|
+
/** @throws error with amended call stack */
|
|
74978
|
+
rejectWithError(error) {
|
|
74979
|
+
var _a3;
|
|
74980
|
+
error.stack = [(_a3 = error.stack) == null ? void 0 : _a3.split("\n")[0], this.initialCallStack].join("\n");
|
|
74981
|
+
this.reject(error);
|
|
74982
|
+
}
|
|
74983
|
+
}
|
|
74999
74984
|
const vcColorPrimary = "vc-text-[#212733]";
|
|
75000
74985
|
const vcColorSecondary = "vc-text-[#787C83]";
|
|
75001
74986
|
const vcColorLink = "vc-text-[#0590CC]";
|
|
@@ -75231,6 +75216,68 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
75231
75216
|
serverFileLoadingError,
|
|
75232
75217
|
serverStreamError
|
|
75233
75218
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
75219
|
+
class LoadRequest {
|
|
75220
|
+
constructor(callbacks, source, settings2) {
|
|
75221
|
+
__publicField(this, "source");
|
|
75222
|
+
__publicField(this, "_callbacks");
|
|
75223
|
+
__publicField(this, "_request");
|
|
75224
|
+
__publicField(this, "_progress", { loaded: 0, total: 0, all: /* @__PURE__ */ new Map() });
|
|
75225
|
+
__publicField(this, "_progressPromise", new DeferredPromise());
|
|
75226
|
+
__publicField(this, "_isDone", false);
|
|
75227
|
+
__publicField(this, "_completionPromise", new DeferredPromise());
|
|
75228
|
+
this.source = source;
|
|
75229
|
+
this._callbacks = callbacks;
|
|
75230
|
+
this.startRequest(source, settings2);
|
|
75231
|
+
}
|
|
75232
|
+
async startRequest(source, settings2) {
|
|
75233
|
+
this._request = await requestVim(source, settings2);
|
|
75234
|
+
for await (const progress of this._request.getProgress()) {
|
|
75235
|
+
this.onProgress(progress);
|
|
75236
|
+
}
|
|
75237
|
+
const result = await this._request.getResult();
|
|
75238
|
+
if (result.isError()) {
|
|
75239
|
+
this.onError(result.error);
|
|
75240
|
+
} else {
|
|
75241
|
+
this.onSuccess();
|
|
75242
|
+
}
|
|
75243
|
+
}
|
|
75244
|
+
onProgress(progress) {
|
|
75245
|
+
this._callbacks.onProgress(progress);
|
|
75246
|
+
this._progress = progress;
|
|
75247
|
+
this._progressPromise.resolve();
|
|
75248
|
+
this._progressPromise = new DeferredPromise();
|
|
75249
|
+
}
|
|
75250
|
+
onSuccess() {
|
|
75251
|
+
this._callbacks.onDone();
|
|
75252
|
+
this.end();
|
|
75253
|
+
}
|
|
75254
|
+
onError(error) {
|
|
75255
|
+
this._callbacks.onError({
|
|
75256
|
+
url: this.source.url,
|
|
75257
|
+
error
|
|
75258
|
+
});
|
|
75259
|
+
this.end();
|
|
75260
|
+
}
|
|
75261
|
+
end() {
|
|
75262
|
+
this._isDone = true;
|
|
75263
|
+
this._progressPromise.resolve();
|
|
75264
|
+
this._completionPromise.resolve();
|
|
75265
|
+
}
|
|
75266
|
+
async *getProgress() {
|
|
75267
|
+
while (!this._isDone) {
|
|
75268
|
+
await this._progressPromise;
|
|
75269
|
+
yield this._progress;
|
|
75270
|
+
}
|
|
75271
|
+
}
|
|
75272
|
+
async getResult() {
|
|
75273
|
+
await this._completionPromise;
|
|
75274
|
+
return this._request.getResult();
|
|
75275
|
+
}
|
|
75276
|
+
abort() {
|
|
75277
|
+
this._request.abort();
|
|
75278
|
+
this.onError("Request aborted");
|
|
75279
|
+
}
|
|
75280
|
+
}
|
|
75234
75281
|
class ComponentLoader {
|
|
75235
75282
|
constructor(viewer, modal) {
|
|
75236
75283
|
__publicField(this, "_viewer");
|
|
@@ -75475,7 +75522,6 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
75475
75522
|
const getActiveState = () => {
|
|
75476
75523
|
return (state == null ? void 0 : state[0]) ?? (state == null ? void 0 : state[1]) ?? (state == null ? void 0 : state[2]);
|
|
75477
75524
|
};
|
|
75478
|
-
console.log("REnder Modal and setup Imperative handle");
|
|
75479
75525
|
React2.useImperativeHandle(ref, () => ({
|
|
75480
75526
|
getActiveState,
|
|
75481
75527
|
loading(content2) {
|
|
@@ -75549,6 +75595,35 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
75549
75595
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(LoadingBox, { content: modal });
|
|
75550
75596
|
}
|
|
75551
75597
|
}
|
|
75598
|
+
function computeFloatingPosition(originRect, panelRect) {
|
|
75599
|
+
let left = originRect.left + originRect.width / 2 - panelRect.width / 2;
|
|
75600
|
+
let top = originRect.top - 10 - panelRect.height;
|
|
75601
|
+
if (top < 10) {
|
|
75602
|
+
top = originRect.bottom + 10;
|
|
75603
|
+
}
|
|
75604
|
+
if (left < 10) {
|
|
75605
|
+
left = 10;
|
|
75606
|
+
} else if (left + panelRect.width > window.innerWidth - 10) {
|
|
75607
|
+
left = window.innerWidth - panelRect.width - 10;
|
|
75608
|
+
}
|
|
75609
|
+
return { top, left };
|
|
75610
|
+
}
|
|
75611
|
+
function useFloatingPanelPosition(panelRef, anchorElement, enabled) {
|
|
75612
|
+
const [position, setPosition] = React2.useState({ top: 0, left: 0 });
|
|
75613
|
+
React2.useLayoutEffect(() => {
|
|
75614
|
+
if (!enabled || !anchorElement || !panelRef.current) return;
|
|
75615
|
+
const updatePosition = () => {
|
|
75616
|
+
const originRect = anchorElement.getBoundingClientRect();
|
|
75617
|
+
const panelRect = panelRef.current.getBoundingClientRect();
|
|
75618
|
+
setPosition(computeFloatingPosition(originRect, panelRect));
|
|
75619
|
+
};
|
|
75620
|
+
updatePosition();
|
|
75621
|
+
const resizeObserver = new ResizeObserver(updatePosition);
|
|
75622
|
+
panelRef.current.parentElement && resizeObserver.observe(panelRef.current.parentElement);
|
|
75623
|
+
return () => resizeObserver.disconnect();
|
|
75624
|
+
}, [anchorElement, enabled]);
|
|
75625
|
+
return position;
|
|
75626
|
+
}
|
|
75552
75627
|
function InputNumber(props) {
|
|
75553
75628
|
const defaultValue = React2.useRef(props.state.get());
|
|
75554
75629
|
const externalValue = React2.useSyncExternalStore(
|
|
@@ -75587,74 +75662,91 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
75587
75662
|
}
|
|
75588
75663
|
);
|
|
75589
75664
|
}
|
|
75590
|
-
function
|
|
75591
|
-
|
|
75592
|
-
|
|
75593
|
-
|
|
75594
|
-
|
|
75595
|
-
|
|
75596
|
-
|
|
75597
|
-
|
|
75598
|
-
|
|
75599
|
-
|
|
75600
|
-
|
|
75601
|
-
|
|
75602
|
-
|
|
75603
|
-
|
|
75604
|
-
|
|
75605
|
-
|
|
75665
|
+
function GenericEntry(field) {
|
|
75666
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
75667
|
+
"div",
|
|
75668
|
+
{
|
|
75669
|
+
className: "vim-sectionbox-offsets-entry vc-text-xs vc-flex vc-items-center vc-justify-between vc-my-2",
|
|
75670
|
+
children: [
|
|
75671
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("dt", { className: "vc-w-1/2 vc-inline", children: field.label }),
|
|
75672
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("dd", { className: "vc-w-1/3 vc-inline", children: /* @__PURE__ */ jsxRuntimeExports.jsx(GenericField, { field }) })
|
|
75673
|
+
]
|
|
75674
|
+
},
|
|
75675
|
+
field.id
|
|
75676
|
+
);
|
|
75677
|
+
}
|
|
75678
|
+
function GenericField(props) {
|
|
75679
|
+
switch (props.field.type) {
|
|
75680
|
+
case "number":
|
|
75681
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(InputNumber, { state: props.field.state });
|
|
75682
|
+
case "text":
|
|
75683
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(GenericTextField, { field: props.field });
|
|
75684
|
+
case "bool":
|
|
75685
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(GenericBoolField, { field: props.field });
|
|
75686
|
+
default:
|
|
75687
|
+
return null;
|
|
75688
|
+
}
|
|
75689
|
+
}
|
|
75690
|
+
function GenericTextField(props) {
|
|
75691
|
+
const refresher = useRefresher();
|
|
75692
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75693
|
+
"input",
|
|
75694
|
+
{
|
|
75695
|
+
id: props.field.id,
|
|
75696
|
+
type: "text",
|
|
75697
|
+
value: props.field.state.get(),
|
|
75698
|
+
onChange: (e) => {
|
|
75699
|
+
refresher.refresh();
|
|
75700
|
+
props.field.state.set(e.target.value);
|
|
75701
|
+
},
|
|
75702
|
+
className: "vc-border vc-inline vc-border-gray-300 vc-py-1 vc-w-full vc-px-1",
|
|
75703
|
+
onBlur: () => props.field.state.confirm()
|
|
75606
75704
|
}
|
|
75607
|
-
|
|
75608
|
-
|
|
75609
|
-
|
|
75610
|
-
|
|
75611
|
-
|
|
75612
|
-
}, [props.showPanel.get()]);
|
|
75613
|
-
if (!props.showPanel.get()) return null;
|
|
75614
|
-
const createTextBox = (field) => {
|
|
75615
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75616
|
-
"input",
|
|
75617
|
-
{
|
|
75618
|
-
id: field.id,
|
|
75619
|
-
type: "number",
|
|
75620
|
-
value: field.state.get(),
|
|
75621
|
-
onChange: (e) => field.state.set(e.target.value),
|
|
75622
|
-
className: "vc-border vc-inline vc-border-gray-300 vc-py-1 vc-w-full vc-px-1",
|
|
75623
|
-
onBlur: () => field.state.confirm()
|
|
75624
|
-
}
|
|
75625
|
-
);
|
|
75626
|
-
};
|
|
75627
|
-
const createCheckbox = (field) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75705
|
+
);
|
|
75706
|
+
}
|
|
75707
|
+
function GenericBoolField(props) {
|
|
75708
|
+
const refresher = useRefresher();
|
|
75709
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75628
75710
|
"input",
|
|
75629
75711
|
{
|
|
75630
|
-
id: field.id,
|
|
75712
|
+
id: props.field.id,
|
|
75631
75713
|
type: "checkbox",
|
|
75632
|
-
checked: field.state.get(),
|
|
75633
|
-
onChange: (e) =>
|
|
75714
|
+
checked: props.field.state.get(),
|
|
75715
|
+
onChange: (e) => {
|
|
75716
|
+
refresher.refresh();
|
|
75717
|
+
props.field.state.set(e.target.checked);
|
|
75718
|
+
},
|
|
75634
75719
|
className: "vc-border vc-inline vc-border-gray-300 vc-py-1 vc-w-full vc-px-1"
|
|
75635
75720
|
}
|
|
75636
75721
|
);
|
|
75637
|
-
|
|
75638
|
-
|
|
75639
|
-
|
|
75640
|
-
|
|
75641
|
-
|
|
75642
|
-
|
|
75643
|
-
} else if (field.type === "bool") {
|
|
75644
|
-
fieldElement = createCheckbox(field);
|
|
75645
|
-
}
|
|
75646
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
75647
|
-
"div",
|
|
75648
|
-
{
|
|
75649
|
-
className: "vim-sectionbox-offsets-entry vc-text-xs vc-flex vc-items-center vc-justify-between vc-my-2",
|
|
75650
|
-
children: [
|
|
75651
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("dt", { className: "vc-w-1/2 vc-inline", children: field.label }),
|
|
75652
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("dd", { className: "vc-w-1/3 vc-inline", children: fieldElement })
|
|
75653
|
-
]
|
|
75654
|
-
},
|
|
75655
|
-
field.id
|
|
75656
|
-
);
|
|
75722
|
+
}
|
|
75723
|
+
function useCustomizer(baseEntries, ref) {
|
|
75724
|
+
const customization = React2.useRef();
|
|
75725
|
+
const [entries, setEntries] = React2.useState(baseEntries);
|
|
75726
|
+
const applyCustomization = () => {
|
|
75727
|
+
setEntries(customization.current ? customization.current(baseEntries) : baseEntries);
|
|
75657
75728
|
};
|
|
75729
|
+
const setCustomization = (fn) => {
|
|
75730
|
+
customization.current = fn;
|
|
75731
|
+
applyCustomization();
|
|
75732
|
+
};
|
|
75733
|
+
React2.useEffect(() => {
|
|
75734
|
+
applyCustomization();
|
|
75735
|
+
}, [baseEntries]);
|
|
75736
|
+
React2.useImperativeHandle(ref, () => ({
|
|
75737
|
+
customize: setCustomization
|
|
75738
|
+
}));
|
|
75739
|
+
return entries;
|
|
75740
|
+
}
|
|
75741
|
+
const GenericPanel = React2.forwardRef((props, ref) => {
|
|
75742
|
+
const panelRef = React2.useRef(null);
|
|
75743
|
+
const panelPosition = useFloatingPanelPosition(
|
|
75744
|
+
panelRef,
|
|
75745
|
+
props.anchorElement,
|
|
75746
|
+
props.showPanel.get()
|
|
75747
|
+
);
|
|
75748
|
+
const entries = useCustomizer(props.entries, ref);
|
|
75749
|
+
if (!props.showPanel.get()) return null;
|
|
75658
75750
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "vc-fixed vc-inset-0 vc-flex vc-pointer-events-none", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
75659
75751
|
"div",
|
|
75660
75752
|
{
|
|
@@ -75674,47 +75766,34 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
75674
75766
|
"button",
|
|
75675
75767
|
{
|
|
75676
75768
|
className: "vc-flex vc-border-none vc-bg-transparent vc-text-sm vc-cursor-pointer",
|
|
75677
|
-
onClick: props.onClose
|
|
75769
|
+
onClick: props.onClose ?? (() => props.showPanel.set(false)),
|
|
75678
75770
|
children: close({ height: 12, width: 12, fill: "currentColor" })
|
|
75679
75771
|
}
|
|
75680
75772
|
)
|
|
75681
75773
|
] }),
|
|
75682
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("dl", { className: "vc-text-xl vc-text-gray-darker vc-mb-2 vc-mx-2", children:
|
|
75774
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("dl", { className: "vc-text-xl vc-text-gray-darker vc-mb-2 vc-mx-2", children: entries.map(GenericEntry) })
|
|
75683
75775
|
]
|
|
75684
75776
|
}
|
|
75685
75777
|
) });
|
|
75686
|
-
}
|
|
75687
|
-
|
|
75688
|
-
|
|
75689
|
-
|
|
75690
|
-
|
|
75691
|
-
|
|
75692
|
-
|
|
75693
|
-
|
|
75694
|
-
|
|
75695
|
-
|
|
75696
|
-
|
|
75697
|
-
|
|
75698
|
-
|
|
75699
|
-
|
|
75700
|
-
|
|
75701
|
-
|
|
75702
|
-
|
|
75703
|
-
|
|
75704
|
-
|
|
75705
|
-
return { top: 0, left: 0 };
|
|
75706
|
-
}
|
|
75707
|
-
function SectionBoxPanel(props) {
|
|
75708
|
-
return GenericPanel({
|
|
75709
|
-
header: "Section Box Offsets",
|
|
75710
|
-
showPanel: props.state.showOffsetPanel,
|
|
75711
|
-
fields: [
|
|
75712
|
-
{ type: "number", id: "topOffset", label: "Top Offset", state: props.state.topOffset },
|
|
75713
|
-
{ type: "number", id: "sideOffset", label: "Side Offset", state: props.state.sideOffset },
|
|
75714
|
-
{ type: "number", id: "bottomOffset", label: "Bottom Offset", state: props.state.bottomOffset }
|
|
75715
|
-
]
|
|
75716
|
-
});
|
|
75717
|
-
}
|
|
75778
|
+
});
|
|
75779
|
+
const SectionBoxPanel = React2.forwardRef(
|
|
75780
|
+
(props, ref) => {
|
|
75781
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75782
|
+
GenericPanel,
|
|
75783
|
+
{
|
|
75784
|
+
ref,
|
|
75785
|
+
header: "Section Box Offsets",
|
|
75786
|
+
anchorElement: document.getElementById("vim-control-bar"),
|
|
75787
|
+
showPanel: props.state.showOffsetPanel,
|
|
75788
|
+
entries: [
|
|
75789
|
+
{ type: "number", id: "topOffset", label: "Top Offset", state: props.state.topOffset },
|
|
75790
|
+
{ type: "number", id: "sideOffset", label: "Side Offset", state: props.state.sideOffset },
|
|
75791
|
+
{ type: "number", id: "bottomOffset", label: "Bottom Offset", state: props.state.bottomOffset }
|
|
75792
|
+
]
|
|
75793
|
+
}
|
|
75794
|
+
);
|
|
75795
|
+
}
|
|
75796
|
+
);
|
|
75718
75797
|
function useSectionBox(adapter) {
|
|
75719
75798
|
const enable = useStateRef(false);
|
|
75720
75799
|
const visible2 = useStateRef(false);
|
|
@@ -75870,17 +75949,24 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
75870
75949
|
handler.keyboard.registerKeyUp("KeyF", "replace", () => camera2.frameSelection.call());
|
|
75871
75950
|
}, []);
|
|
75872
75951
|
}
|
|
75873
|
-
|
|
75874
|
-
|
|
75875
|
-
|
|
75876
|
-
|
|
75877
|
-
|
|
75878
|
-
|
|
75879
|
-
|
|
75880
|
-
|
|
75881
|
-
|
|
75882
|
-
|
|
75883
|
-
|
|
75952
|
+
const IsolationPanel = React2.forwardRef(
|
|
75953
|
+
(props, ref) => {
|
|
75954
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
75955
|
+
GenericPanel,
|
|
75956
|
+
{
|
|
75957
|
+
ref,
|
|
75958
|
+
header: "Render Settings",
|
|
75959
|
+
anchorElement: document.getElementById("vim-control-bar"),
|
|
75960
|
+
showPanel: props.state.showPanel,
|
|
75961
|
+
entries: [
|
|
75962
|
+
{ type: "bool", id: "showGhost", label: "Show Ghost", state: props.state.showGhost },
|
|
75963
|
+
// { type: "bool", id: "showRooms", label: "Show Rooms", state: props.state.showRooms },
|
|
75964
|
+
{ type: "number", id: "ghostOpacity", label: "Ghost Opacity", state: props.state.ghostOpacity }
|
|
75965
|
+
]
|
|
75966
|
+
}
|
|
75967
|
+
);
|
|
75968
|
+
}
|
|
75969
|
+
);
|
|
75884
75970
|
function useSharedIsolation(adapter) {
|
|
75885
75971
|
const _adapter = React2.useRef(adapter);
|
|
75886
75972
|
const visibility = useStateRef(() => adapter.computeVisibility());
|
|
@@ -76050,6 +76136,8 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76050
76136
|
const settings2 = useSettings(props.viewer, props.settings ?? {});
|
|
76051
76137
|
const modal = React2.useRef(null);
|
|
76052
76138
|
const sectionBoxRef = useWebglSectionBox(props.viewer);
|
|
76139
|
+
const isolationPanelHandle = React2.useRef(null);
|
|
76140
|
+
const sectionBoxPanelHandle = React2.useRef(null);
|
|
76053
76141
|
const camera2 = useWebglCamera(props.viewer, sectionBoxRef);
|
|
76054
76142
|
const cursor = React2.useMemo(() => new CursorManager(props.viewer), []);
|
|
76055
76143
|
const loader = React2.useRef(new ComponentLoader(props.viewer, modal));
|
|
@@ -76078,7 +76166,6 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76078
76166
|
props.viewer.viewport.canvas.tabIndex = 0;
|
|
76079
76167
|
applyWebglBindings(props.viewer, camera2, isolationRef, side);
|
|
76080
76168
|
const subContext = props.viewer.inputs.onContextMenu.subscribe(showContextMenu);
|
|
76081
|
-
console.log("ON MOUNT");
|
|
76082
76169
|
props.onMount({
|
|
76083
76170
|
container: props.container,
|
|
76084
76171
|
core: props.viewer,
|
|
@@ -76086,6 +76173,12 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76086
76173
|
isolation: isolationRef,
|
|
76087
76174
|
camera: camera2,
|
|
76088
76175
|
settings: settings2,
|
|
76176
|
+
get isolationPanel() {
|
|
76177
|
+
return isolationPanelHandle.current;
|
|
76178
|
+
},
|
|
76179
|
+
get sectionBoxPanel() {
|
|
76180
|
+
return sectionBoxPanelHandle.current;
|
|
76181
|
+
},
|
|
76089
76182
|
get sectionBox() {
|
|
76090
76183
|
return sectionBoxRef;
|
|
76091
76184
|
},
|
|
@@ -76153,8 +76246,8 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76153
76246
|
show: isTrue(settings2.value.ui.controlBar)
|
|
76154
76247
|
}
|
|
76155
76248
|
),
|
|
76156
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SectionBoxPanel, { state: sectionBoxRef }),
|
|
76157
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
76249
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SectionBoxPanel, { ref: sectionBoxPanelHandle, state: sectionBoxRef }),
|
|
76250
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(IsolationPanel, { ref: isolationPanelHandle, state: isolationRef }),
|
|
76158
76251
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
76159
76252
|
AxesPanelMemo,
|
|
76160
76253
|
{
|
|
@@ -76432,9 +76525,11 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76432
76525
|
return promise;
|
|
76433
76526
|
}
|
|
76434
76527
|
function Viewer(props) {
|
|
76435
|
-
const modal = React2.useRef(null);
|
|
76436
76528
|
const sectionBox2 = useUltraSectionBox(props.core);
|
|
76437
76529
|
const camera2 = useUltraCamera(props.core, sectionBox2);
|
|
76530
|
+
const isolationPanelHandle = React2.useRef(null);
|
|
76531
|
+
const sectionBoxPanelHandle = React2.useRef(null);
|
|
76532
|
+
const modalHandle = React2.useRef(null);
|
|
76438
76533
|
const side = useSideState(true, 400);
|
|
76439
76534
|
const [_, setSelectState] = React2.useState(0);
|
|
76440
76535
|
const [controlBarCustom, setControlBarCustom] = React2.useState(() => (c) => c);
|
|
@@ -76442,24 +76537,30 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76442
76537
|
const controlBar = useUltraControlBar(props.core, sectionBox2, isolation, camera2, (_2) => _2);
|
|
76443
76538
|
useViewerInput(props.core.inputs, camera2);
|
|
76444
76539
|
React2.useEffect(() => {
|
|
76445
|
-
props.core.onStateChanged.subscribe((state) => updateModal(
|
|
76540
|
+
props.core.onStateChanged.subscribe((state) => updateModal(modalHandle, state));
|
|
76446
76541
|
props.core.selection.onSelectionChanged.subscribe(() => {
|
|
76447
76542
|
setSelectState((i2) => (i2 + 1) % 2);
|
|
76448
76543
|
});
|
|
76449
76544
|
props.onMount({
|
|
76450
76545
|
core: props.core,
|
|
76451
76546
|
get modal() {
|
|
76452
|
-
return
|
|
76547
|
+
return modalHandle.current;
|
|
76453
76548
|
},
|
|
76454
76549
|
isolation,
|
|
76455
76550
|
sectionBox: sectionBox2,
|
|
76456
76551
|
camera: camera2,
|
|
76552
|
+
get isolationPanel() {
|
|
76553
|
+
return isolationPanelHandle.current;
|
|
76554
|
+
},
|
|
76555
|
+
get sectionBoxPanel() {
|
|
76556
|
+
return sectionBoxPanelHandle.current;
|
|
76557
|
+
},
|
|
76457
76558
|
dispose: () => {
|
|
76458
76559
|
},
|
|
76459
76560
|
controlBar: {
|
|
76460
76561
|
customize: (v) => setControlBarCustom(() => v)
|
|
76461
76562
|
},
|
|
76462
|
-
load: patchLoad(props.core,
|
|
76563
|
+
load: patchLoad(props.core, modalHandle)
|
|
76463
76564
|
});
|
|
76464
76565
|
}, []);
|
|
76465
76566
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
@@ -76474,11 +76575,11 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76474
76575
|
show: true
|
|
76475
76576
|
}
|
|
76476
76577
|
),
|
|
76477
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SectionBoxPanel, { state: sectionBox2 }),
|
|
76478
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
76578
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SectionBoxPanel, { ref: sectionBoxPanelHandle, state: sectionBox2 }),
|
|
76579
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(IsolationPanel, { ref: isolationPanelHandle, state: isolation })
|
|
76479
76580
|
] });
|
|
76480
76581
|
} }),
|
|
76481
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Modal, { ref:
|
|
76582
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Modal, { ref: modalHandle, canFollowLinks: true }),
|
|
76482
76583
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
76483
76584
|
ReactTooltip,
|
|
76484
76585
|
{
|
|
@@ -76519,8 +76620,10 @@ Averrage Date/Second ${avgDataRatePS} kb
|
|
|
76519
76620
|
__proto__: null,
|
|
76520
76621
|
ContextMenu: contextMenu,
|
|
76521
76622
|
ControlBar: index$5,
|
|
76623
|
+
DeferredPromise,
|
|
76522
76624
|
Errors: index$3,
|
|
76523
76625
|
Icons: icons,
|
|
76626
|
+
ReactUtils: reactUtils,
|
|
76524
76627
|
Settings: index$4,
|
|
76525
76628
|
Ultra: index$1,
|
|
76526
76629
|
Urls: urls,
|