vis-core 0.30.0-beta.30 → 0.30.0-beta.32

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.30.0-beta.30", publicKeyPEM = "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUEyTG1aVVQzVG9LZEVRRUdrdUU1QQo3dnlYTzRMM1Z6NDA5RFF2a2xzRHZ2SytNM2M2OGl4ZEVhZDZFcnZGS2FKQ1QrNTZNdU1XSXhUTnlDZDVQSkFGCjVYdzI4cW1iVkVCR3FGdXVIZTltSm5GUmRXN1NpK1Z1cTZvRWxwQkRkeEFIQ0dsWVVpU1R3WmhBbjJaVXJLSUYKd1J2c1k1bi9uWWNhZnl5QW9tRjhmNVRsTkpwS1JtbDU3WlRSWjBMdzdQRDFSeHFIbmJ0YWFETkpiSDV5eFd6cQpaVTBwQWhxMFNkNHdlOW1DUTJWWXc5czhtUERLbW4rU083eGovSUsrR1ZEaEJNOUpaZ3VIcGFZUGt3bWd5UkdwCkx6V0tHMkZULzJRalZUT1dRT09mRFVtVitDSVlsN1hVVlh1Q0toYWFNQ0ZVa1JQOHg4aEZucmNFeklHQ1JpM3IKK3dJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0t", accessToken = {
66
+ const version = "0.30.0-beta.32", publicKeyPEM = "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUEyTG1aVVQzVG9LZEVRRUdrdUU1QQo3dnlYTzRMM1Z6NDA5RFF2a2xzRHZ2SytNM2M2OGl4ZEVhZDZFcnZGS2FKQ1QrNTZNdU1XSXhUTnlDZDVQSkFGCjVYdzI4cW1iVkVCR3FGdXVIZTltSm5GUmRXN1NpK1Z1cTZvRWxwQkRkeEFIQ0dsWVVpU1R3WmhBbjJaVXJLSUYKd1J2c1k1bi9uWWNhZnl5QW9tRjhmNVRsTkpwS1JtbDU3WlRSWjBMdzdQRDFSeHFIbmJ0YWFETkpiSDV5eFd6cQpaVTBwQWhxMFNkNHdlOW1DUTJWWXc5czhtUERLbW4rU083eGovSUsrR1ZEaEJNOUpaZ3VIcGFZUGt3bWd5UkdwCkx6V0tHMkZULzJRalZUT1dRT09mRFVtVitDSVlsN1hVVlh1Q0toYWFNQ0ZVa1JQOHg4aEZucmNFeklHQ1JpM3IKK3dJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0t", accessToken = {
67
67
  token: void 0,
68
68
  getInfo() {
69
69
  if (!this.token)
@@ -140399,39 +140399,39 @@ class Editor {
140399
140399
  }
140400
140400
  fromJSON(e, r) {
140401
140401
  return B0(this, null, function* () {
140402
- var V, le, fe;
140402
+ var V, le;
140403
140403
  let o = null;
140404
140404
  try {
140405
140405
  r && !y(r) ? console.warn(
140406
140406
  "fromJSON 第二个参数已修改,{beforeSetVisOptions:(r)=>r} 替代"
140407
140407
  ) : r && (o = r.fj, delete r.fj, this.hooks.addEvents(r));
140408
- let Le;
140408
+ let fe;
140409
140409
  if (typeof e == "string") {
140410
- const Ce = this.options.assetsPrefix + e;
140410
+ const Le = this.options.assetsPrefix + e;
140411
140411
  console.time("vis-core:time.json-fetch");
140412
- const { res: Re, err: Pe } = yield jsonFetch(Ce);
140413
- if (console.timeEnd("vis-core:time.json-fetch"), Pe)
140414
- throw new Error("fromJSON error:" + Pe);
140415
- Le = Re;
140412
+ const { res: Ce, err: Re } = yield jsonFetch(Le);
140413
+ if (console.timeEnd("vis-core:time.json-fetch"), Re)
140414
+ throw new Error("fromJSON error:" + Re);
140415
+ fe = Ce;
140416
140416
  } else
140417
- Le = e;
140418
- if (this.hooks.dispatch("beforeFromJSON"), o && (Le = yield o(Le)), Le = fixJSON(Le), Le.at && (accessToken.token = Le.at), !this.storage) {
140417
+ fe = e;
140418
+ if (this.hooks.dispatch("beforeFromJSON"), o && (fe = yield o(fe)), fe = fixJSON(fe), fe.at && (accessToken.token = fe.at), !this.storage) {
140419
140419
  if (!accessToken.token)
140420
140420
  throw new Error("设置 token 或平台重新下载 JSON 文件");
140421
- const Ce = accessToken.getInfo();
140422
- if (!Ce || !Ce.isValid)
140421
+ const Le = accessToken.getInfo();
140422
+ if (!Le || !Le.isValid)
140423
140423
  throw new Error("need accessToken");
140424
140424
  }
140425
- if (this.config.fromJSON(Le.c), this.history.fromJSON(Le.h), this.viewport.fromJSON(Le.v), this.hooks.fromJSON(Le.s), this.config.compareVersion(), yield this.history.processUndos(this.options.processUndosMaxFrameTime), (V = Le.v.bg) != null && V.texture && this.viewport.vis) {
140426
- const Ce = parseTexture(Le.v.bg.texture);
140427
- Ce.colorSpace = SRGBColorSpace, this.viewport.vis.pencil.scene.background = Ce;
140425
+ if (this.config.fromJSON(fe.c), this.history.fromJSON(fe.h), this.viewport.fromJSON(fe.v), this.hooks.fromJSON(fe.s), this.config.compareVersion(), yield this.history.processUndos(this.options.processUndosMaxFrameTime), (V = fe.v.bg) != null && V.texture && this.viewport.vis) {
140426
+ const Le = parseTexture(fe.v.bg.texture);
140427
+ Le.colorSpace = SRGBColorSpace, this.viewport.vis.pencil.scene.background = Le;
140428
140428
  }
140429
- return this.hooks.dispatch("beforeShow"), (le = this.viewport.vis) == null || le.show(), this.hooks.dispatch("afterShow"), (fe = this.pencil.controls) == null || fe.saveState(), this.select(null), window.requestIdleCallback(() => {
140430
- var Ce;
140431
- (Ce = this.viewport.vis) == null || Ce.worker.dispose();
140432
- }), this.hooks.dispatch("afterFromJSON"), Le;
140433
- } catch (Le) {
140434
- throw this.hooks.dispatch("errorFromJSON"), new Error("fromJSON error:" + Le);
140429
+ return this.hooks.dispatch("beforeShow"), this.viewport.vis && (this.playing && this.viewport.vis.lead.prefabGroup.hide(), this.viewport.vis.show()), this.hooks.dispatch("afterShow"), (le = this.pencil.controls) == null || le.saveState(), this.select(null), window.requestIdleCallback(() => {
140430
+ var Le;
140431
+ (Le = this.viewport.vis) == null || Le.worker.dispose();
140432
+ }), this.hooks.dispatch("afterFromJSON"), fe;
140433
+ } catch (fe) {
140434
+ throw this.hooks.dispatch("errorFromJSON"), new Error("fromJSON error:" + fe);
140435
140435
  }
140436
140436
  });
140437
140437
  }
@@ -144282,7 +144282,8 @@ const getLabelElement = (v) => {
144282
144282
  initCityVis(r, o = !1) {
144283
144283
  return B0(this, null, function* () {
144284
144284
  var Le;
144285
- (Le = this.options.fixCity) != null && Le[r] && (r = this.options.fixCity[r]);
144285
+ if ((Le = this.options.fixCity) != null && Le[r] && (r = this.options.fixCity[r]), r === 71e4)
144286
+ return null;
144286
144287
  const V = new City({
144287
144288
  container: this.container,
144288
144289
  editor: !1
@@ -144311,9 +144312,10 @@ const getLabelElement = (v) => {
144311
144312
  initCityOnMap(r) {
144312
144313
  return B0(this, null, function* () {
144313
144314
  const o = this.getAdcodeShowLevel(r);
144314
- if (o === "province")
144315
- yield (yield this.initCityVis(r)).drawCityPlane(r, this.lead.group);
144316
- else if (o === "city") {
144315
+ if (o === "province") {
144316
+ const V = yield this.initCityVis(r);
144317
+ yield V == null ? void 0 : V.drawCityPlane(r, this.lead.group);
144318
+ } else if (o === "city") {
144317
144319
  const V = findAdcodeInfo(r).c;
144318
144320
  let le = null;
144319
144321
  if (V.length > 0)
@@ -144322,10 +144324,13 @@ const getLabelElement = (v) => {
144322
144324
  else
144323
144325
  le = yield this.initCityVis(r);
144324
144326
  yield le == null ? void 0 : le.drawCityPlane(r, this.lead.group), this.pencil.camera.near = 1e-3, this.pencil.camera.far = 7, this.pencil.camera.updateProjectionMatrix();
144325
- } else if (o === "district" && (yield (yield this.initCityVis(r)).drawCityPlane(r, this.lead.group), this.pencil.camera.near = 1e-3, this.pencil.camera.far = 7, this.pencil.camera.updateProjectionMatrix(), this.options.nearbyCities)) {
144326
- const le = findAdcodeInfo(r).parent, fe = findAdcodeInfo(le).c;
144327
- for (const Le of fe)
144328
- (this.options.nearbyCities === "full" || Le !== r) && (yield this.initCityVis(Le, !0));
144327
+ } else if (o === "district") {
144328
+ const V = yield this.initCityVis(r);
144329
+ if (yield V == null ? void 0 : V.drawCityPlane(r, this.lead.group), this.pencil.camera.near = 1e-3, this.pencil.camera.far = 7, this.pencil.camera.updateProjectionMatrix(), this.options.nearbyCities) {
144330
+ const le = findAdcodeInfo(r).parent, fe = findAdcodeInfo(le).c;
144331
+ for (const Le of fe)
144332
+ (this.options.nearbyCities === "full" || Le !== r) && (yield this.initCityVis(Le, !0));
144333
+ }
144329
144334
  }
144330
144335
  this.cityVis.forEach((V) => {
144331
144336
  if (!V.options.grey) {
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "0.30.0-beta.30";
1
+ declare const _default: "0.30.0-beta.32";
2
2
  export default _default;
@@ -190,7 +190,7 @@ export default class extends Base {
190
190
  initSettingsObj: Record<string, any>;
191
191
  handleSetting(key: string, value: any): Promise<any>;
192
192
  init(): Promise<void>;
193
- initCityVis(adcode: number, grey?: boolean): Promise<City>;
193
+ initCityVis(adcode: number, grey?: boolean): Promise<City | null>;
194
194
  initCityOnMap(adcode: number): Promise<void>;
195
195
  initVisBg(): Promise<void>;
196
196
  initVis(adcode: number): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vis-core",
3
- "version": "0.30.0-beta.30",
3
+ "version": "0.30.0-beta.32",
4
4
  "scripts": {
5
5
  "start": "npm run version && PORT=5173 bundler-dev",
6
6
  "build:site": "npm run version && PUBLIC_EXCLUDE=true bundler",