@zhongguo168a/yxeditor-common 0.0.52 → 0.0.54
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 +12 -2
- package/dist/index.esm.js +19 -3
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1040,7 +1040,7 @@ declare class RouteView extends EventDispatcher {
|
|
|
1040
1040
|
open(): void;
|
|
1041
1041
|
close(): void;
|
|
1042
1042
|
refresh(): void;
|
|
1043
|
-
stop(reason?:
|
|
1043
|
+
stop(reason?: LinkError): void;
|
|
1044
1044
|
/**
|
|
1045
1045
|
* 等待发送的结果
|
|
1046
1046
|
* 如果返回 null,表示主动取消 [cancel]
|
|
@@ -1063,7 +1063,13 @@ declare class RouteView extends EventDispatcher {
|
|
|
1063
1063
|
onClose(value: (ctx: this) => void): this;
|
|
1064
1064
|
onClosed(value: (ctx: this) => void): this;
|
|
1065
1065
|
onRefresh(value: (ctx: this) => void): this;
|
|
1066
|
+
/**
|
|
1067
|
+
* 默认执行 close();
|
|
1068
|
+
* @param value
|
|
1069
|
+
* @returns
|
|
1070
|
+
*/
|
|
1066
1071
|
onStop(value: (ctx: this) => void): this;
|
|
1072
|
+
get reason(): LinkError;
|
|
1067
1073
|
node: Node;
|
|
1068
1074
|
datas: {};
|
|
1069
1075
|
tags: {};
|
|
@@ -1072,6 +1078,7 @@ declare class RouteView extends EventDispatcher {
|
|
|
1072
1078
|
state: ViewState;
|
|
1073
1079
|
protected _controller: RouteController;
|
|
1074
1080
|
protected _route: Route;
|
|
1081
|
+
protected _reason: LinkError;
|
|
1075
1082
|
private _onOpen;
|
|
1076
1083
|
private _onOpened;
|
|
1077
1084
|
private _onClose;
|
|
@@ -1351,7 +1358,10 @@ declare class AssetLoader extends Dispatcher {
|
|
|
1351
1358
|
onComplete?: (err: any, asset: any) => void;
|
|
1352
1359
|
preload?: boolean;
|
|
1353
1360
|
}): this;
|
|
1354
|
-
|
|
1361
|
+
loadJson(uri: string, otherConfig?: {
|
|
1362
|
+
onComplete?: (err: any, asset: any) => void;
|
|
1363
|
+
preload?: boolean;
|
|
1364
|
+
}): this;
|
|
1355
1365
|
loadSpriteFrame(uri: string, otherConfig?: {
|
|
1356
1366
|
onComplete?: (err: any, asset: any) => void;
|
|
1357
1367
|
uuid?: string;
|
package/dist/index.esm.js
CHANGED
|
@@ -3859,6 +3859,9 @@ class RouteView extends EventDispatcher {
|
|
|
3859
3859
|
this.tags = {};
|
|
3860
3860
|
this.enableHistory = false;
|
|
3861
3861
|
this.state = 0;
|
|
3862
|
+
this._onStop = (ctx) => {
|
|
3863
|
+
ctx.close();
|
|
3864
|
+
};
|
|
3862
3865
|
this._controller = controller;
|
|
3863
3866
|
this._route = route;
|
|
3864
3867
|
}
|
|
@@ -3942,6 +3945,7 @@ class RouteView extends EventDispatcher {
|
|
|
3942
3945
|
console.error(`stop view ${this.route.key}`);
|
|
3943
3946
|
console.error(e.stack);
|
|
3944
3947
|
}
|
|
3948
|
+
this.dispatch(ViewEvent.Stop);
|
|
3945
3949
|
}
|
|
3946
3950
|
/**
|
|
3947
3951
|
* 等待发送的结果
|
|
@@ -4041,10 +4045,18 @@ class RouteView extends EventDispatcher {
|
|
|
4041
4045
|
this._onRefresh = value;
|
|
4042
4046
|
return this;
|
|
4043
4047
|
}
|
|
4048
|
+
/**
|
|
4049
|
+
* 默认执行 close();
|
|
4050
|
+
* @param value
|
|
4051
|
+
* @returns
|
|
4052
|
+
*/
|
|
4044
4053
|
onStop(value) {
|
|
4045
4054
|
this._onStop = value;
|
|
4046
4055
|
return this;
|
|
4047
4056
|
}
|
|
4057
|
+
get reason() {
|
|
4058
|
+
return this._reason;
|
|
4059
|
+
}
|
|
4048
4060
|
}
|
|
4049
4061
|
|
|
4050
4062
|
class ViewHistory extends RouteList {
|
|
@@ -4559,10 +4571,14 @@ class AssetLoader extends Dispatcher {
|
|
|
4559
4571
|
this._loaderList.push(item);
|
|
4560
4572
|
return this;
|
|
4561
4573
|
}
|
|
4562
|
-
|
|
4574
|
+
loadJson(uri, otherConfig) {
|
|
4563
4575
|
let item = new LoaderItem();
|
|
4564
|
-
item.type = "
|
|
4576
|
+
item.type = "Json";
|
|
4565
4577
|
item.uri = new AssetURI(uri);
|
|
4578
|
+
if (otherConfig) {
|
|
4579
|
+
item.onComplete = otherConfig.onComplete;
|
|
4580
|
+
item.preload = otherConfig.preload != undefined ? otherConfig.preload : false;
|
|
4581
|
+
}
|
|
4566
4582
|
this._loaderList.push(item);
|
|
4567
4583
|
return this;
|
|
4568
4584
|
}
|
|
@@ -4630,7 +4646,7 @@ class AssetLoader extends Dispatcher {
|
|
|
4630
4646
|
});
|
|
4631
4647
|
break;
|
|
4632
4648
|
}
|
|
4633
|
-
case "
|
|
4649
|
+
case "Json": {
|
|
4634
4650
|
assetManager.loadBundle(item.uri.bundle, (err, bundle) => {
|
|
4635
4651
|
if (this._stop) {
|
|
4636
4652
|
return;
|