vis-core 0.12.16 → 0.12.18

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.
@@ -41029,7 +41029,7 @@ function Ql(n) {
41029
41029
  const t = new t0();
41030
41030
  return t.color.setScalar(n), t;
41031
41031
  }
41032
- const XX = "0.12.16", o1 = !1;
41032
+ const XX = "0.12.18", o1 = !1;
41033
41033
  class pl {
41034
41034
  constructor(t, e = {}) {
41035
41035
  P(this, "container");
@@ -41191,13 +41191,10 @@ class pl {
41191
41191
  return Gt(this, null, function* () {
41192
41192
  const { pencil: i } = this;
41193
41193
  if (t === "mouseWheel" || t === "mouseLeft" || t === "mouseRight") {
41194
- if (yield this.settings.mouseNone, !this.settings.mouseNone)
41195
- if (e) {
41196
- this.mouseButtonsActiveStore[t] = e;
41197
- const s = t.replace("mouse", "").toLowerCase();
41198
- i.cameraControls.mouseButtons[s] = e;
41199
- } else
41200
- this.playing && (this.mouseButtonsActiveStore[t] = e, i.cameraControls.mouseButtons.left = ii.NONE);
41194
+ if (yield this.settings.mouseNone, !this.settings.mouseNone) {
41195
+ const s = t.replace("mouse", "").toLowerCase();
41196
+ e ? (this.mouseButtonsActiveStore[t] = e, i.cameraControls.mouseButtons[s] = e) : this.playing && (this.mouseButtonsActiveStore[t] = e, i.cameraControls.mouseButtons[s] = ii.NONE);
41197
+ }
41201
41198
  } else
41202
41199
  t === "mouseNone" && (e ? (i.cameraControls.mouseButtons.left = ii.NONE, i.cameraControls.mouseButtons.right = ii.NONE, i.cameraControls.mouseButtons.wheel = ii.NONE) : setTimeout(() => {
41203
41200
  this.handleSetting(
@@ -41721,23 +41718,26 @@ class VX extends X0 {
41721
41718
  );
41722
41719
  });
41723
41720
  }
41724
- getPointInContinent(e) {
41721
+ getPointInContinentInfo(e) {
41725
41722
  return a9.features.find((i) => i.geometry.coordinates.some((s) => s.length ? Fm(P5(e), qo(s)) : !1));
41726
41723
  }
41724
+ getPointInContinent(e) {
41725
+ return !!this.getPointInContinentInfo(e);
41726
+ }
41727
41727
  getLocationPosition(e) {
41728
41728
  var s;
41729
- const i = (s = this.getPointInContinent(e)) == null ? void 0 : s.properties.name;
41729
+ const i = (s = this.getPointInContinentInfo(e)) == null ? void 0 : s.properties.name;
41730
41730
  if (i) {
41731
41731
  const l = this.mapArr.find((a) => a.userData.name === i);
41732
41732
  if (l) {
41733
- const { projection: a } = l.userData, [o, c] = e, [d, r] = a([o, c]), h = new S(d, -r, 0).add(
41733
+ const { projection: a } = l.userData, [o, c] = e, [d, r] = a([o, c]), h = l.object3d.getWorldPosition(new S()), u = new S(d, -r, 0).add(
41734
41734
  new S(
41735
- l.position.x,
41736
- l.position.y,
41737
- l.position.z + this.options.depth
41735
+ h.x,
41736
+ h.y,
41737
+ h.z + this.options.depth
41738
41738
  )
41739
41739
  );
41740
- return [h.x, h.y, h.z];
41740
+ return [u.x, u.y, u.z];
41741
41741
  }
41742
41742
  }
41743
41743
  }
@@ -46561,11 +46561,12 @@ class gT {
46561
46561
  var l;
46562
46562
  let s = t.material;
46563
46563
  Array.isArray(t.material) && e !== void 0 ? (s = [...t.material], t.material[e] = i) : t.material = i, s && t.userData.fixBufferGeometry && (this.pencil.scene.traverse((a) => {
46564
- Array.isArray(a.material) ? a.material.forEach((o, c) => {
46565
- o === s && (a.material[c] = i);
46566
- }) : a.material === s && (a.material = i);
46564
+ const o = a;
46565
+ o.material && e !== void 0 && Array.isArray(o.material) && Array.isArray(s) ? o.material.every(
46566
+ (c, d) => c === s[d]
46567
+ ) && (o.material[e] = i) : o.material && !Array.isArray(o.material) && !Array.isArray(s) && o.material === s && (o.material = i);
46567
46568
  }), (l = this.viewport.vis) == null || l.mList.materialList.forEach((a) => {
46568
- a.material === s && (a.material = i);
46569
+ (Array.isArray(s) ? e !== void 0 && a.material === s[e] : a.material === s) && (a.material = i);
46569
46570
  }));
46570
46571
  }
46571
46572
  uuidByObject(t) {
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "0.12.16";
1
+ declare const _default: "0.12.18";
2
2
  export default _default;
@@ -10,7 +10,7 @@ export default class extends BaseObject {
10
10
  mapArr: PlaneMap[];
11
11
  constructor(options: Options);
12
12
  create(): Promise<void>;
13
- getPointInContinent(location: [number, number]): {
13
+ getPointInContinentInfo(location: [number, number]): {
14
14
  type: string;
15
15
  properties: {
16
16
  name: string;
@@ -20,6 +20,7 @@ export default class extends BaseObject {
20
20
  coordinates: number[][][][];
21
21
  };
22
22
  } | undefined;
23
+ getPointInContinent(location: [number, number]): boolean;
23
24
  getLocationPosition(location: [number, number]): number[] | undefined;
24
25
  dispose(): void;
25
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vis-core",
3
- "version": "0.12.16",
3
+ "version": "0.12.18",
4
4
  "scripts": {
5
5
  "start": "npm run version && PORT=5173 bundler-dev",
6
6
  "build:site": "npm run version &&PUBLIC_EXCLUDE=public/city bundler",