vim-web 0.3.44-dev.83 → 0.3.44-dev.85

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.
@@ -13,6 +13,9 @@ export interface GenericTextEntry extends BaseGenericEntry {
13
13
  export interface GenericNumberEntry extends BaseGenericEntry {
14
14
  type: "number";
15
15
  state: StateRef<number>;
16
+ min?: number;
17
+ max?: number;
18
+ step?: number;
16
19
  }
17
20
  export interface GenericBoolEntry extends BaseGenericEntry {
18
21
  type: "bool";
@@ -1,5 +1,4 @@
1
- import { StateRef } from "../helpers/reactUtils";
1
+ import { GenericNumberEntry } from "./genericField";
2
2
  export declare function InputNumber(props: {
3
- state: StateRef<number>;
4
- disabled?: boolean;
3
+ entry: GenericNumberEntry;
5
4
  }): import("react/jsx-runtime").JSX.Element;
@@ -4,6 +4,7 @@
4
4
  import * as Core from '../../core-viewers';
5
5
  import { LoadRequest } from '../helpers/loadRequest';
6
6
  import { ModalHandle } from '../panels/modal';
7
+ import { Settings } from '../settings';
7
8
  type AddSettings = {
8
9
  /**
9
10
  * Controls whether to frame the camera on a vim everytime it is updated.
@@ -28,7 +29,8 @@ export type LoadingError = {
28
29
  export declare class ComponentLoader {
29
30
  private _viewer;
30
31
  private _modal;
31
- constructor(viewer: Core.Webgl.Viewer, modal: React.RefObject<ModalHandle>);
32
+ private _addLink;
33
+ constructor(viewer: Core.Webgl.Viewer, modal: React.RefObject<ModalHandle>, settings: Settings);
32
34
  /**
33
35
  * Event emitter for progress updates.
34
36
  */
@@ -52496,9 +52496,6 @@ void main() {
52496
52496
  this.reg(this._canvas, "wheel", (e) => {
52497
52497
  this.onMouseScroll(e);
52498
52498
  });
52499
- this.reg(this._canvas, "dblclick", (e) => {
52500
- this.handleDoubleClick(e);
52501
- });
52502
52499
  }
52503
52500
  dispose() {
52504
52501
  this.unregister();
@@ -52531,7 +52528,6 @@ void main() {
52531
52528
  var _a3;
52532
52529
  if (event.pointerType !== "mouse") return;
52533
52530
  if (event.button !== 0) return;
52534
- console.log("click!");
52535
52531
  const pos = this.relativePosition(event);
52536
52532
  if (!almostEqual(this._lastMouseDownPosition, pos, 0.01)) {
52537
52533
  return;
@@ -52550,7 +52546,6 @@ void main() {
52550
52546
  }
52551
52547
  async handleDoubleClick(event) {
52552
52548
  var _a3;
52553
- console.log("double click!");
52554
52549
  const pos = this.relativePosition(event);
52555
52550
  (_a3 = this.onDoubleClick) == null ? void 0 : _a3.call(this, pos);
52556
52551
  event.preventDefault();
@@ -75321,11 +75316,14 @@ Averrage Date/Second ${avgDataRatePS} kb
75321
75316
  ] });
75322
75317
  }
75323
75318
  class ComponentLoader {
75324
- constructor(viewer, modal) {
75319
+ constructor(viewer, modal, settings2) {
75325
75320
  __publicField(this, "_viewer");
75326
75321
  __publicField(this, "_modal");
75322
+ __publicField(this, "_addLink", false);
75327
75323
  this._viewer = viewer;
75328
75324
  this._modal = modal;
75325
+ this._addLink = /* settings.capacity.canFollowUrl */
75326
+ false;
75329
75327
  }
75330
75328
  /**
75331
75329
  * Event emitter for progress updates.
@@ -75336,7 +75334,7 @@ Averrage Date/Second ${avgDataRatePS} kb
75336
75334
  message: "Loading in WebGL Mode",
75337
75335
  progress: p.loaded,
75338
75336
  mode: "bytes",
75339
- more: UltraSuggestion()
75337
+ more: this._addLink ? UltraSuggestion() : void 0
75340
75338
  });
75341
75339
  }
75342
75340
  /**
@@ -75599,10 +75597,13 @@ Averrage Date/Second ${avgDataRatePS} kb
75599
75597
  return position;
75600
75598
  }
75601
75599
  function InputNumber(props) {
75602
- const defaultValue = React2.useRef(props.state.get());
75600
+ var _a3;
75601
+ const entry = props.entry;
75602
+ const state = entry.state;
75603
+ const defaultValue = React2.useRef(props.entry.state.get());
75603
75604
  const externalValue = React2.useSyncExternalStore(
75604
- (callback) => props.state.onChange.subscribe(callback),
75605
- () => props.state.get()
75605
+ (callback) => state.onChange.subscribe(callback),
75606
+ () => state.get()
75606
75607
  );
75607
75608
  const [inputValue, setInputValue] = React2.useState(externalValue.toString());
75608
75609
  React2.useEffect(() => {
@@ -75616,24 +75617,27 @@ Averrage Date/Second ${avgDataRatePS} kb
75616
75617
  setInputValue(input);
75617
75618
  const parsed = parseFloat(input);
75618
75619
  if (!isNaN(parsed)) {
75619
- props.state.set(parsed);
75620
+ state.set(parsed);
75620
75621
  }
75621
75622
  };
75622
75623
  const handleBlur = () => {
75623
75624
  const parsed = parseFloat(inputValue);
75624
75625
  const value = isNaN(parsed) ? defaultValue.current : parsed;
75625
- props.state.set(value);
75626
- setInputValue(props.state.get().toString());
75626
+ state.set(value);
75627
+ setInputValue(state.get().toString());
75627
75628
  };
75628
75629
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
75629
75630
  "input",
75630
75631
  {
75631
- disabled: props.disabled ?? false,
75632
+ disabled: ((_a3 = entry.enabled) == null ? void 0 : _a3.call(entry)) === false,
75632
75633
  type: "number",
75633
75634
  value: inputValue,
75634
75635
  onChange: handleChange,
75635
75636
  onBlur: handleBlur,
75636
- className: "vc-border vc-inline vc-border-gray-300 vc-py-1 vc-w-full vc-px-1"
75637
+ className: "vc-border vc-inline vc-border-gray-300 vc-py-1 vc-w-full vc-px-1",
75638
+ min: entry.min,
75639
+ max: entry.max,
75640
+ step: entry.step
75637
75641
  }
75638
75642
  );
75639
75643
  }
@@ -75654,14 +75658,14 @@ Averrage Date/Second ${avgDataRatePS} kb
75654
75658
  );
75655
75659
  }
75656
75660
  function GenericField(props) {
75657
- var _a3, _b2, _c, _d, _e, _f;
75661
+ var _a3, _b2, _c, _d;
75658
75662
  switch (props.field.type) {
75659
75663
  case "number":
75660
- return /* @__PURE__ */ jsxRuntimeExports.jsx(InputNumber, { state: props.field.state, disabled: ((_b2 = (_a3 = props.field).enabled) == null ? void 0 : _b2.call(_a3)) === false });
75664
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(InputNumber, { entry: props.field });
75661
75665
  case "text":
75662
- return /* @__PURE__ */ jsxRuntimeExports.jsx(GenericTextField, { state: props.field.state, disabled: ((_d = (_c = props.field).enabled) == null ? void 0 : _d.call(_c)) === false });
75666
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(GenericTextField, { state: props.field.state, disabled: ((_b2 = (_a3 = props.field).enabled) == null ? void 0 : _b2.call(_a3)) === false });
75663
75667
  case "bool":
75664
- return /* @__PURE__ */ jsxRuntimeExports.jsx(GenericBoolField, { state: props.field.state, disabled: ((_f = (_e = props.field).enabled) == null ? void 0 : _f.call(_e)) === false });
75668
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(GenericBoolField, { state: props.field.state, disabled: ((_d = (_c = props.field).enabled) == null ? void 0 : _d.call(_c)) === false });
75665
75669
  default:
75666
75670
  return null;
75667
75671
  }
@@ -75949,7 +75953,16 @@ Averrage Date/Second ${avgDataRatePS} kb
75949
75953
  entries: [
75950
75954
  { type: "bool", id: Ids.showGhost, label: "Show Ghost", state: props.state.showGhost },
75951
75955
  // { type: "bool", id: "showRooms", label: "Show Rooms", state: props.state.showRooms },
75952
- { type: "number", id: Ids.ghostOpacity, label: "Ghost Opacity", state: props.state.ghostOpacity, enabled: () => props.state.showGhost.get() }
75956
+ {
75957
+ type: "number",
75958
+ id: Ids.ghostOpacity,
75959
+ label: "Ghost Opacity",
75960
+ state: props.state.ghostOpacity,
75961
+ enabled: () => props.state.showGhost.get(),
75962
+ min: 0,
75963
+ max: 1,
75964
+ step: 0.05
75965
+ }
75953
75966
  ]
75954
75967
  }
75955
75968
  );
@@ -76128,7 +76141,7 @@ Averrage Date/Second ${avgDataRatePS} kb
76128
76141
  const sectionBoxPanelHandle = React2.useRef(null);
76129
76142
  const camera2 = useWebglCamera(props.viewer, sectionBoxRef);
76130
76143
  const cursor = React2.useMemo(() => new CursorManager(props.viewer), []);
76131
- const loader = React2.useRef(new ComponentLoader(props.viewer, modal));
76144
+ const loader = React2.useRef(new ComponentLoader(props.viewer, modal, settings2.value));
76132
76145
  useViewerInput(props.viewer.inputs, camera2);
76133
76146
  const side = useSideState(
76134
76147
  isTrue(settings2.value.ui.bimTreePanel) || isTrue(settings2.value.ui.bimInfoPanel),