vis-core 0.29.10 → 0.29.12

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.
@@ -63,7 +63,7 @@ import { continentsCountriesIso2 } from "geojson-cn";
63
63
  Array.prototype.at || (Array.prototype.at = function(v) {
64
64
  return v < 0 && (v = this.length + v), this[v];
65
65
  });
66
- const version = "0.29.10", publicKeyPEM = "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUEyTG1aVVQzVG9LZEVRRUdrdUU1QQo3dnlYTzRMM1Z6NDA5RFF2a2xzRHZ2SytNM2M2OGl4ZEVhZDZFcnZGS2FKQ1QrNTZNdU1XSXhUTnlDZDVQSkFGCjVYdzI4cW1iVkVCR3FGdXVIZTltSm5GUmRXN1NpK1Z1cTZvRWxwQkRkeEFIQ0dsWVVpU1R3WmhBbjJaVXJLSUYKd1J2c1k1bi9uWWNhZnl5QW9tRjhmNVRsTkpwS1JtbDU3WlRSWjBMdzdQRDFSeHFIbmJ0YWFETkpiSDV5eFd6cQpaVTBwQWhxMFNkNHdlOW1DUTJWWXc5czhtUERLbW4rU083eGovSUsrR1ZEaEJNOUpaZ3VIcGFZUGt3bWd5UkdwCkx6V0tHMkZULzJRalZUT1dRT09mRFVtVitDSVlsN1hVVlh1Q0toYWFNQ0ZVa1JQOHg4aEZucmNFeklHQ1JpM3IKK3dJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0t", accessToken = {
66
+ const version = "0.29.12", publicKeyPEM = "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUEyTG1aVVQzVG9LZEVRRUdrdUU1QQo3dnlYTzRMM1Z6NDA5RFF2a2xzRHZ2SytNM2M2OGl4ZEVhZDZFcnZGS2FKQ1QrNTZNdU1XSXhUTnlDZDVQSkFGCjVYdzI4cW1iVkVCR3FGdXVIZTltSm5GUmRXN1NpK1Z1cTZvRWxwQkRkeEFIQ0dsWVVpU1R3WmhBbjJaVXJLSUYKd1J2c1k1bi9uWWNhZnl5QW9tRjhmNVRsTkpwS1JtbDU3WlRSWjBMdzdQRDFSeHFIbmJ0YWFETkpiSDV5eFd6cQpaVTBwQWhxMFNkNHdlOW1DUTJWWXc5czhtUERLbW4rU083eGovSUsrR1ZEaEJNOUpaZ3VIcGFZUGt3bWd5UkdwCkx6V0tHMkZULzJRalZUT1dRT09mRFVtVitDSVlsN1hVVlh1Q0toYWFNQ0ZVa1JQOHg4aEZucmNFeklHQ1JpM3IKK3dJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0t", accessToken = {
67
67
  token: void 0,
68
68
  getInfo() {
69
69
  if (!this.token)
@@ -36707,14 +36707,14 @@ function linear() {
36707
36707
  return copy(v, linear());
36708
36708
  }, initRange.apply(v, arguments), linearish(v);
36709
36709
  }
36710
- var Ce = Object.defineProperty, Ie$2 = Object.defineProperties, Pe = Object.getOwnPropertyDescriptors, V$2 = Object.getOwnPropertySymbols, te$1 = Object.prototype.hasOwnProperty, ie$1 = Object.prototype.propertyIsEnumerable, ne$1 = Math.pow, ee$1 = (v, e, n) => e in v ? Ce(v, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : v[e] = n, k$1 = (v, e) => {
36710
+ var Ce = Object.defineProperty, Ie$2 = Object.defineProperties, Pe = Object.getOwnPropertyDescriptors, V$2 = Object.getOwnPropertySymbols, te$1 = Object.prototype.hasOwnProperty, ie$1 = Object.prototype.propertyIsEnumerable, se$1 = Math.pow, ee$1 = (v, e, n) => e in v ? Ce(v, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : v[e] = n, k$1 = (v, e) => {
36711
36711
  for (var n in e || (e = {}))
36712
36712
  te$1.call(e, n) && ee$1(v, n, e[n]);
36713
36713
  if (V$2)
36714
36714
  for (var n of V$2(e))
36715
36715
  ie$1.call(e, n) && ee$1(v, n, e[n]);
36716
36716
  return v;
36717
- }, $$1 = (v, e) => Ie$2(v, Pe(e)), se$1 = (v, e) => {
36717
+ }, $$1 = (v, e) => Ie$2(v, Pe(e)), ne$1 = (v, e) => {
36718
36718
  var n = {};
36719
36719
  for (var r in v)
36720
36720
  te$1.call(v, r) && e.indexOf(r) < 0 && (n[r] = v[r]);
@@ -36825,7 +36825,7 @@ const tt$1 = (v, e = 1) => {
36825
36825
  }
36826
36826
  });
36827
36827
  };
36828
- class nt {
36828
+ let st$1 = class {
36829
36829
  constructor() {
36830
36830
  this.onPointerIndex = [];
36831
36831
  }
@@ -36853,8 +36853,8 @@ class nt {
36853
36853
  this.lead.removePick(e);
36854
36854
  });
36855
36855
  }
36856
- }
36857
- let st$1 = class extends nt {
36856
+ };
36857
+ class nt extends st$1 {
36858
36858
  constructor() {
36859
36859
  super(...arguments), this.userData = {}, this.materialList = {}, this.useMaterialType = "origin", this.disposeMaterialIfNotUsed = !0;
36860
36860
  }
@@ -36911,7 +36911,8 @@ let st$1 = class extends nt {
36911
36911
  this.disposeMaterialIfNotUsed
36912
36912
  );
36913
36913
  }
36914
- }, pe$1 = class extends st$1 {
36914
+ }
36915
+ let pe$1 = class extends nt {
36915
36916
  constructor() {
36916
36917
  super(...arguments), this.key = "", this.objectType = "BaseObject", this.userData = {}, this.isPrefab = !1, this.isInstantiate = !1, this.isBloom = !1, this.isBaseObject = !0, this.disposeTrack = !0;
36917
36918
  }
@@ -37025,28 +37026,28 @@ let st$1 = class extends nt {
37025
37026
  return re$1(this, null, function* () {
37026
37027
  var n, r;
37027
37028
  const C = (n = e == null ? void 0 : e.recursive) != null ? n : !0, w = (r = e == null ? void 0 : e.cloneMaterial) != null ? r : !1, { objectType: E, objectOptions: O } = this;
37028
- let le = e == null ? void 0 : e.create, fe;
37029
- return this.objectType === "BaseObject" ? fe = this.lead.createBaseObject(this.object3d.clone(!1), {
37030
- target: (e == null ? void 0 : e.target) || this.parent
37031
- }) : (le === void 0 && (le = (Se) => {
37032
- var ze;
37029
+ let le = e == null ? void 0 : e.create, fe, Se = (e == null ? void 0 : e.target) || this.parent;
37030
+ return Se === this.lead.prefabGroup && (Se = this.lead.group), this.objectType === "BaseObject" ? fe = this.lead.createBaseObject(this.object3d.clone(!1), {
37031
+ target: Se
37032
+ }) : (le === void 0 && (le = (ze) => {
37033
+ var ke;
37033
37034
  if (this.object3d) {
37034
- if ((ze = e == null ? void 0 : e.instancedAttr) != null && ze.length) {
37035
- const ke = e.instancedAttr.length;
37035
+ if ((ke = e == null ? void 0 : e.instancedAttr) != null && ke.length) {
37036
+ const Fe = e.instancedAttr.length;
37036
37037
  if (this.object3d instanceof Sprite$1)
37037
- Se.object3d = tt$1(this.object3d, ke);
37038
+ ze.object3d = tt$1(this.object3d, Fe);
37038
37039
  else {
37039
- const Fe = this.object3d, mt = w ? this.cloneMaterial() : Fe.material;
37040
- Se.object3d = new InstancedMesh(
37041
- Fe.geometry,
37042
- mt,
37043
- ke
37040
+ const mt = this.object3d, Lt = w ? this.cloneMaterial() : mt.material;
37041
+ ze.object3d = new InstancedMesh(
37042
+ mt.geometry,
37043
+ Lt,
37044
+ Fe
37044
37045
  );
37045
37046
  }
37046
- it$1(Se.object3d, e == null ? void 0 : e.instancedAttr);
37047
+ it$1(ze.object3d, e == null ? void 0 : e.instancedAttr);
37047
37048
  } else
37048
- Se.object3d = this.object3d.clone(!1), w && Se.object3d.material && (Se.object3d.material = this.cloneMaterial());
37049
- Se.object3d.userData.prefab && delete Se.object3d.userData.prefab;
37049
+ ze.object3d = this.object3d.clone(!1), w && ze.object3d.material && (ze.object3d.material = this.cloneMaterial());
37050
+ ze.object3d.userData.prefab && delete ze.object3d.userData.prefab;
37050
37051
  }
37051
37052
  }), fe = yield this.lead.draw(E, $$1(k$1({}, O || {}), {
37052
37053
  create: le,
@@ -37054,11 +37055,11 @@ let st$1 = class extends nt {
37054
37055
  keyType: this.keyType,
37055
37056
  key: (e == null ? void 0 : e.key) || this.keyName,
37056
37057
  uId: (e == null ? void 0 : e.uId) || this.keyUId,
37057
- target: (e == null ? void 0 : e.target) || this.parent
37058
+ target: Se
37058
37059
  }))), this.isBloom && fe.enableBloom(), C && (yield Promise.all(
37059
37060
  this.children.map(
37060
- (Se) => Se.instantiate({
37061
- key: Se.keyUId ? `${Se.keyName}-${Se.keyUId}` : Se.keyName,
37061
+ (ze) => ze.instantiate({
37062
+ key: ze.keyUId ? `${ze.keyName}-${ze.keyUId}` : ze.keyName,
37062
37063
  uId: e == null ? void 0 : e.uId,
37063
37064
  cloneMaterial: w,
37064
37065
  target: fe
@@ -37107,7 +37108,7 @@ function rt$1(v, e) {
37107
37108
  });
37108
37109
  }
37109
37110
  function at(v, { minLng: e, maxLng: n, minLat: r, maxLat: C } = {}) {
37110
- const w = Math.round(ne$1(360 / v, 2) / Math.PI), E = (1 + Math.sqrt(5)) / 2, O = (Fe) => Fe / E * 360 % 360 - 180, le = (Fe) => Math.acos(2 * Fe / w - 1) / Math.PI * 180 - 90, fe = (Fe) => w * (Math.cos((Fe + 90) * Math.PI / 180) + 1) / 2, Se = [
37111
+ const w = Math.round(se$1(360 / v, 2) / Math.PI), E = (1 + Math.sqrt(5)) / 2, O = (Fe) => Fe / E * 360 % 360 - 180, le = (Fe) => Math.acos(2 * Fe / w - 1) / Math.PI * 180 - 90, fe = (Fe) => w * (Math.cos((Fe + 90) * Math.PI / 180) + 1) / 2, Se = [
37111
37112
  C !== void 0 ? Math.ceil(fe(C)) : 0,
37112
37113
  r !== void 0 ? Math.floor(fe(r)) : w - 1
37113
37114
  ], ze = e === void 0 && n === void 0 ? () => !0 : e === void 0 ? (Fe) => Fe <= n : n === void 0 ? (Fe) => Fe >= e : n >= e ? (Fe) => Fe >= e && Fe <= n : (Fe) => Fe >= e || Fe <= n, ke = [];
@@ -37493,7 +37494,7 @@ let Ot$2 = class extends ShaderMaterial {
37493
37494
  alphaTest: Lt = 0,
37494
37495
  repeat: bt = new Vector2(1, 1),
37495
37496
  resolution: Ue = new Vector2(1, 1)
37496
- } = n, Gt = se$1(n, [
37497
+ } = n, Gt = ne$1(n, [
37497
37498
  "lineWidth",
37498
37499
  "color",
37499
37500
  "opacity",
@@ -61496,7 +61497,6 @@ class Camera extends Event {
61496
61497
  const IS_DEV = !1;
61497
61498
  class Base extends Camera {
61498
61499
  constructor(n) {
61499
- var r;
61500
61500
  super();
61501
61501
  g0(this, "playing", !0);
61502
61502
  g0(this, "leftTruck", !0);
@@ -61528,45 +61528,23 @@ class Base extends Camera {
61528
61528
  logarithmicDepthBuffer: !0,
61529
61529
  observeParentScale: !0
61530
61530
  }, n), !this.options.assetsPrefix) {
61531
- let C = "/";
61532
- C === "/" && (C = ""), this.options.assetsPrefix = C;
61531
+ let r = "/";
61532
+ r === "/" && (r = ""), this.options.assetsPrefix = r;
61533
61533
  }
61534
61534
  this.options.workerOnce !== void 0 && (this.workerOnce = this.options.workerOnce);
61535
61535
  try {
61536
- const C = window.location.search.match(/v_ldb=(\d+)/);
61537
- if (C) {
61538
- const w = !!+C[1];
61539
- this.options.logarithmicDepthBuffer = w;
61536
+ const r = window.location.search.match(/v_ldb=(\d+)/);
61537
+ if (r) {
61538
+ const C = !!+r[1];
61539
+ this.options.logarithmicDepthBuffer = C;
61540
61540
  }
61541
- } catch (C) {
61542
- console.error(C);
61543
- }
61544
- if (this.options.editor) {
61545
- const C = detect();
61546
- let w = (r = this.options.tier) != null ? r : C.tier;
61547
- try {
61548
- const E = window.location.search.match(/v_tier=(\d+)/);
61549
- E && (w = +E[1]);
61550
- } catch (E) {
61551
- console.error(E);
61552
- }
61553
- this.tier0 = w !== 3, this.editor = new Editor({
61554
- assetsPrefix: this.options.assetsPrefix,
61555
- visFactories: this
61556
- }), console.info(
61557
- "vis-core:detect",
61558
- version,
61559
- JSON.stringify(
61560
- Ui(O0({}, C), {
61561
- ldb: this.options.logarithmicDepthBuffer,
61562
- tier0: this.tier0
61563
- }),
61564
- null,
61565
- 2
61566
- )
61567
- );
61541
+ } catch (r) {
61542
+ console.error(r);
61568
61543
  }
61569
- this.visName = this.constructor.VisName;
61544
+ this.options.editor && (this.editor = new Editor({
61545
+ assetsPrefix: this.options.assetsPrefix,
61546
+ visFactories: this
61547
+ }), this.showDetectRes()), this.visName = this.constructor.VisName;
61570
61548
  }
61571
61549
  get loader() {
61572
61550
  return this.pencil.loader;
@@ -61574,6 +61552,29 @@ class Base extends Camera {
61574
61552
  get worker() {
61575
61553
  return this.pencil.installPlugins.get("worker");
61576
61554
  }
61555
+ showDetectRes() {
61556
+ var C;
61557
+ const n = detect();
61558
+ let r = (C = this.options.tier) != null ? C : n.tier;
61559
+ try {
61560
+ const w = window.location.search.match(/v_tier=(\d+)/);
61561
+ w && (r = +w[1]);
61562
+ } catch (w) {
61563
+ console.error(w);
61564
+ }
61565
+ this.tier0 = r !== 3, console.info(
61566
+ "vis-core:detect",
61567
+ version,
61568
+ JSON.stringify(
61569
+ Ui(O0({}, n), {
61570
+ ldb: this.options.logarithmicDepthBuffer,
61571
+ tier0: this.tier0
61572
+ }),
61573
+ null,
61574
+ 2
61575
+ )
61576
+ );
61577
+ }
61577
61578
  setOptions(n) {
61578
61579
  this.options = O0(O0({}, this.options), n);
61579
61580
  }
@@ -61684,14 +61685,13 @@ class Base extends Camera {
61684
61685
  if (Ue.material) {
61685
61686
  const Gt = Ue.material;
61686
61687
  (Array.isArray(Gt) ? Gt : [Gt]).forEach((Xt) => {
61687
- !Lt.has(Xt) && Xt.name && (Lt.set(Xt, Xt.name), Xt.name = "");
61688
+ !Lt.has(Xt) && Xt.name && (Lt.set(Xt, Xt.name), Xt.name = ""), Xt.transparent && Xt.alphaTest === 0 && (Xt.alphaTest = 0.01, Xt.needsUpdate = !0);
61688
61689
  });
61689
61690
  }
61690
61691
  });
61691
61692
  }), ke.event.on("render", () => {
61692
61693
  [...Lt.keys()].forEach((bt) => {
61693
- const Ue = Lt.get(bt);
61694
- Ue && (bt.name = Ue);
61694
+ Lt.has(bt) && (bt.name = Lt.get(bt));
61695
61695
  }), Lt.clear();
61696
61696
  });
61697
61697
  }
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "0.29.10";
1
+ declare const _default: "0.29.12";
2
2
  export default _default;
@@ -75,6 +75,7 @@ export default class Base extends Camera {
75
75
  editor?: Editor;
76
76
  publicDir: Record<string, string>;
77
77
  constructor(options: BaseOptions);
78
+ private showDetectRes;
78
79
  setOptions(options: Record<string, any>): void;
79
80
  _baseObjectByUuid: Editor['baseObjectByUuid'];
80
81
  _objectByUuid: Editor['objectByUuid'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vis-core",
3
- "version": "0.29.10",
3
+ "version": "0.29.12",
4
4
  "scripts": {
5
5
  "start": "npm run version && PORT=5173 bundler-dev",
6
6
  "build:site": "npm run version && PUBLIC_EXCLUDE=true bundler",
@@ -66,7 +66,7 @@
66
66
  "esus-lite": "^0.2.8",
67
67
  "events": "^3.3.0",
68
68
  "geojson-cn": "^0.2.5",
69
- "gl-draw": "0.16.6",
69
+ "gl-draw": "0.16.7",
70
70
  "jsrsasign": "^11.1.0",
71
71
  "lodash-es": "^4.17.21"
72
72
  },