vis-core 0.30.0-beta.5 → 0.30.0-beta.6
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/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/index.module.js +23 -22
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.module.js
CHANGED
|
@@ -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.
|
|
66
|
+
const version = "0.30.0-beta.6", publicKeyPEM = "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUEyTG1aVVQzVG9LZEVRRUdrdUU1QQo3dnlYTzRMM1Z6NDA5RFF2a2xzRHZ2SytNM2M2OGl4ZEVhZDZFcnZGS2FKQ1QrNTZNdU1XSXhUTnlDZDVQSkFGCjVYdzI4cW1iVkVCR3FGdXVIZTltSm5GUmRXN1NpK1Z1cTZvRWxwQkRkeEFIQ0dsWVVpU1R3WmhBbjJaVXJLSUYKd1J2c1k1bi9uWWNhZnl5QW9tRjhmNVRsTkpwS1JtbDU3WlRSWjBMdzdQRDFSeHFIbmJ0YWFETkpiSDV5eFd6cQpaVTBwQWhxMFNkNHdlOW1DUTJWWXc5czhtUERLbW4rU083eGovSUsrR1ZEaEJNOUpaZ3VIcGFZUGt3bWd5UkdwCkx6V0tHMkZULzJRalZUT1dRT09mRFVtVitDSVlsN1hVVlh1Q0toYWFNQ0ZVa1JQOHg4aEZucmNFeklHQ1JpM3IKK3dJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0t", accessToken = {
|
|
67
67
|
token: void 0,
|
|
68
68
|
getInfo() {
|
|
69
69
|
if (!this.token)
|
|
@@ -140370,38 +140370,39 @@ class Editor {
|
|
|
140370
140370
|
}
|
|
140371
140371
|
fromJSON(e, r) {
|
|
140372
140372
|
return N0(this, null, function* () {
|
|
140373
|
-
var
|
|
140373
|
+
var w, W, E;
|
|
140374
|
+
let o = null;
|
|
140374
140375
|
try {
|
|
140375
140376
|
r && !y(r) ? console.warn(
|
|
140376
140377
|
"fromJSON 第二个参数已修改,{beforeSetVisOptions:(r)=>r} 替代"
|
|
140377
|
-
) : r && this.hooks.addEvents(r);
|
|
140378
|
-
let
|
|
140378
|
+
) : r && (o = r.fj, delete r.fj, this.hooks.addEvents(r));
|
|
140379
|
+
let O;
|
|
140379
140380
|
if (typeof e == "string") {
|
|
140380
|
-
const
|
|
140381
|
+
const j = this.options.assetsPrefix + e;
|
|
140381
140382
|
console.time("vis-core:time.json-fetch");
|
|
140382
|
-
const { res:
|
|
140383
|
-
if (console.timeEnd("vis-core:time.json-fetch"),
|
|
140384
|
-
throw new Error("fromJSON error:" +
|
|
140385
|
-
|
|
140383
|
+
const { res: le, err: fe } = yield jsonFetch(j);
|
|
140384
|
+
if (console.timeEnd("vis-core:time.json-fetch"), fe)
|
|
140385
|
+
throw new Error("fromJSON error:" + fe);
|
|
140386
|
+
O = le;
|
|
140386
140387
|
} else
|
|
140387
|
-
|
|
140388
|
-
if (this.hooks.dispatch("beforeFromJSON"),
|
|
140388
|
+
O = e;
|
|
140389
|
+
if (this.hooks.dispatch("beforeFromJSON"), o && (O = yield o(O)), O = fixJSON(O), O.at && (accessToken.token = O.at), !this.storage) {
|
|
140389
140390
|
if (!accessToken.token)
|
|
140390
140391
|
throw new Error("设置 token 或平台重新下载 JSON 文件");
|
|
140391
|
-
const
|
|
140392
|
-
if (!
|
|
140392
|
+
const j = accessToken.getInfo();
|
|
140393
|
+
if (!j || !j.isValid)
|
|
140393
140394
|
throw new Error("need accessToken");
|
|
140394
140395
|
}
|
|
140395
|
-
if (this.config.fromJSON(
|
|
140396
|
-
const
|
|
140397
|
-
|
|
140396
|
+
if (this.config.fromJSON(O.c), this.history.fromJSON(O.h), this.viewport.fromJSON(O.v), this.hooks.fromJSON(O.s), this.config.compareVersion(), yield this.history.processUndos(this.options.processUndosMaxFrameTime), (w = O.v.bg) != null && w.texture && this.viewport.vis) {
|
|
140397
|
+
const j = parseTexture(O.v.bg.texture);
|
|
140398
|
+
j.colorSpace = SRGBColorSpace, this.viewport.vis.pencil.scene.background = j;
|
|
140398
140399
|
}
|
|
140399
|
-
return this.hooks.dispatch("beforeShow"), (
|
|
140400
|
-
var
|
|
140401
|
-
(
|
|
140402
|
-
}), this.hooks.dispatch("afterFromJSON"),
|
|
140403
|
-
} catch (
|
|
140404
|
-
throw this.hooks.dispatch("errorFromJSON"), new Error("fromJSON error:" +
|
|
140400
|
+
return this.hooks.dispatch("beforeShow"), (W = this.viewport.vis) == null || W.show(), this.hooks.dispatch("afterShow"), (E = this.pencil.controls) == null || E.saveState(), this.select(null), window.requestIdleCallback(() => {
|
|
140401
|
+
var j;
|
|
140402
|
+
(j = this.viewport.vis) == null || j.worker.dispose();
|
|
140403
|
+
}), this.hooks.dispatch("afterFromJSON"), O;
|
|
140404
|
+
} catch (O) {
|
|
140405
|
+
throw this.hooks.dispatch("errorFromJSON"), new Error("fromJSON error:" + O);
|
|
140405
140406
|
}
|
|
140406
140407
|
});
|
|
140407
140408
|
}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "0.30.0-beta.
|
|
1
|
+
declare const _default: "0.30.0-beta.6";
|
|
2
2
|
export default _default;
|