@vived/app 4.20.0 → 4.21.0
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/lib/Components/ChannelModel/Controllers/clickSelectChannelModel.d.ts +2 -0
- package/lib/Components/ChannelModel/Controllers/clickSelectChannelModel.js +13 -0
- package/lib/Components/ChannelModel/Controllers/index.d.ts +1 -0
- package/lib/Components/ChannelModel/Controllers/index.js +1 -0
- package/lib/Components/ChannelModel/Mocks/LoadChannelModelMock.d.ts +9 -0
- package/lib/Components/ChannelModel/Mocks/LoadChannelModelMock.js +16 -0
- package/lib/Components/ChannelModel/Mocks/SelectChannelModelUCMock.d.ts +8 -0
- package/lib/Components/ChannelModel/Mocks/SelectChannelModelUCMock.js +15 -0
- package/lib/Components/ChannelModel/Mocks/index.d.ts +2 -0
- package/lib/Components/ChannelModel/Mocks/index.js +2 -0
- package/lib/Components/ChannelModel/UC/LoadChannelModelUC.d.ts +10 -0
- package/lib/Components/ChannelModel/UC/LoadChannelModelUC.js +132 -0
- package/lib/Components/ChannelModel/UC/SelectChannelModelUC.js +28 -34
- package/lib/Components/ChannelModel/UC/index.d.ts +2 -0
- package/lib/Components/ChannelModel/UC/index.js +2 -0
- package/lib/Components/Dispatcher/Mocks/GetAssetBlobURLUCMock.d.ts +8 -0
- package/lib/Components/Dispatcher/Mocks/GetAssetBlobURLUCMock.js +15 -0
- package/lib/Components/Dispatcher/Mocks/GetLinkedAssetsUCMock.d.ts +8 -0
- package/lib/Components/Dispatcher/Mocks/GetLinkedAssetsUCMock.js +15 -0
- package/lib/Components/Dispatcher/Mocks/MockGetAssetFolderURL.d.ts +1 -1
- package/lib/Components/Dispatcher/Mocks/MockGetAssetFolderURL.js +3 -3
- package/lib/Components/Dispatcher/Mocks/MockShowAlert.d.ts +1 -1
- package/lib/Components/Dispatcher/Mocks/MockShowAlert.js +3 -3
- package/lib/Components/Dispatcher/Mocks/MockShowConfirm.d.ts +1 -1
- package/lib/Components/Dispatcher/Mocks/MockShowConfirm.js +3 -3
- package/lib/Components/Dispatcher/Mocks/MockShowMarkdown.d.ts +1 -1
- package/lib/Components/Dispatcher/Mocks/MockShowMarkdown.js +3 -3
- package/lib/Components/Dispatcher/Mocks/MockShowSpinner.d.ts +8 -0
- package/lib/Components/Dispatcher/Mocks/MockShowSpinner.js +15 -0
- package/lib/Components/Dispatcher/Mocks/MockSubmitResult.d.ts +1 -1
- package/lib/Components/Dispatcher/Mocks/MockSubmitResult.js +3 -3
- package/lib/Components/Dispatcher/Mocks/ShowSelectModelUCMock.d.ts +8 -0
- package/lib/Components/Dispatcher/Mocks/ShowSelectModelUCMock.js +15 -0
- package/lib/Components/Dispatcher/Mocks/index.d.ts +6 -1
- package/lib/Components/Dispatcher/Mocks/index.js +6 -1
- package/lib/Components/Dispatcher/UC/AppIsReadyUC.js +5 -5
- package/lib/Components/Dispatcher/UC/DispatchStartZSpaceUC.js +5 -5
- package/lib/Components/Dispatcher/UC/DispatchStateChangeUC.js +4 -4
- package/lib/Components/Dispatcher/UC/DispatchStopZSpaceUC.js +5 -5
- package/lib/Components/Dispatcher/UC/GetAssetBlobURLUC.js +21 -21
- package/lib/Components/Dispatcher/UC/GetAssetFolderURLUC.js +20 -20
- package/lib/Components/Dispatcher/UC/GetAssetMetaUC.js +21 -21
- package/lib/Components/Dispatcher/UC/GetAssetsForOwnerUC.js +21 -21
- package/lib/Components/Dispatcher/UC/GetLinkedAssetsUC.js +22 -22
- package/lib/Components/Dispatcher/UC/GoToNextStateUC.js +5 -5
- package/lib/Components/Dispatcher/UC/GoToPreviousStateUC.js +5 -5
- package/lib/Components/Dispatcher/UC/HasNextStateUC.js +15 -15
- package/lib/Components/Dispatcher/UC/HasPreviousStateUC.js +15 -15
- package/lib/Components/Dispatcher/UC/IsAssetFetchedUC.js +16 -16
- package/lib/Components/Dispatcher/UC/IsZSpaceAvailableUC.js +15 -15
- package/lib/Components/Dispatcher/UC/LogUC.js +12 -12
- package/lib/Components/Dispatcher/UC/RegisterExternalStylesheetsUC.js +7 -7
- package/lib/Components/Dispatcher/UC/RestoreCurrentStateUC.js +5 -5
- package/lib/Components/Dispatcher/UC/ShowAlertUC.js +11 -11
- package/lib/Components/Dispatcher/UC/ShowConfirmUC.js +13 -13
- package/lib/Components/Dispatcher/UC/ShowMarkdownEditorUC.js +13 -13
- package/lib/Components/Dispatcher/UC/ShowSelectModelUC.js +15 -15
- package/lib/Components/Dispatcher/UC/StateIsCompleteUC.js +5 -5
- package/lib/Components/Dispatcher/UC/SubmitActivityAssetUC.js +21 -21
- package/lib/Components/Dispatcher/UC/SubmitResultResultUC.js +69 -69
- package/lib/Components/Dispatcher/index.d.ts +1 -0
- package/lib/Components/Dispatcher/index.js +1 -0
- package/lib/Components/GLBModel/Mocks/LoadGlbFileUCMock.d.ts +1 -0
- package/lib/Components/GLBModel/Mocks/LoadGlbFileUCMock.js +1 -0
- package/lib/Components/GLBModel/UCs/LoadGlbFileUC.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.clickSelectChannelModel = void 0;
|
|
4
|
+
const SelectChannelModelUC_1 = require("../UC/SelectChannelModelUC");
|
|
5
|
+
function clickSelectChannelModel(appObjects) {
|
|
6
|
+
const selectChannelModelUC = SelectChannelModelUC_1.SelectChannelModelUC.get(appObjects);
|
|
7
|
+
if (!selectChannelModelUC) {
|
|
8
|
+
appObjects.submitError("clickSelectChannelModel", "Unable to find SelectChannelModelUC");
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
selectChannelModelUC.selectChannelModel();
|
|
12
|
+
}
|
|
13
|
+
exports.clickSelectChannelModel = clickSelectChannelModel;
|
|
@@ -10,4 +10,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./clickSelectChannelModel"), exports);
|
|
13
14
|
__exportStar(require("./setModelObjectLabel"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="jest" />
|
|
2
|
+
import { AppObject, AppObjectRepo } from "../../../AppObject";
|
|
3
|
+
import { LoadChannelModelUC } from "../UC";
|
|
4
|
+
export declare class LoadChannelModelUCMock extends LoadChannelModelUC {
|
|
5
|
+
loadChannelModel: jest.Mock<any, any>;
|
|
6
|
+
blobToJSON: jest.Mock<any, any>;
|
|
7
|
+
constructor(appObject: AppObject);
|
|
8
|
+
}
|
|
9
|
+
export declare function makeLoadChannelModelUCMock(appObjects: AppObjectRepo): LoadChannelModelUCMock;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeLoadChannelModelUCMock = exports.LoadChannelModelUCMock = void 0;
|
|
4
|
+
const UC_1 = require("../UC");
|
|
5
|
+
class LoadChannelModelUCMock extends UC_1.LoadChannelModelUC {
|
|
6
|
+
constructor(appObject) {
|
|
7
|
+
super(appObject, UC_1.LoadChannelModelUC.type);
|
|
8
|
+
this.loadChannelModel = jest.fn();
|
|
9
|
+
this.blobToJSON = jest.fn();
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.LoadChannelModelUCMock = LoadChannelModelUCMock;
|
|
13
|
+
function makeLoadChannelModelUCMock(appObjects) {
|
|
14
|
+
return new LoadChannelModelUCMock(appObjects.getOrCreate("LoadChannelModelUCMock"));
|
|
15
|
+
}
|
|
16
|
+
exports.makeLoadChannelModelUCMock = makeLoadChannelModelUCMock;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="jest" />
|
|
2
|
+
import { AppObject, AppObjectRepo } from "../../../AppObject";
|
|
3
|
+
import { SelectChannelModelUC } from "../UC/SelectChannelModelUC";
|
|
4
|
+
export declare class SelectChannelModelUCMock extends SelectChannelModelUC {
|
|
5
|
+
selectChannelModel: jest.Mock<any, any>;
|
|
6
|
+
constructor(appObject: AppObject);
|
|
7
|
+
}
|
|
8
|
+
export declare function makeSelectChannelModelUCMock(appObjects: AppObjectRepo): SelectChannelModelUCMock;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeSelectChannelModelUCMock = exports.SelectChannelModelUCMock = void 0;
|
|
4
|
+
const SelectChannelModelUC_1 = require("../UC/SelectChannelModelUC");
|
|
5
|
+
class SelectChannelModelUCMock extends SelectChannelModelUC_1.SelectChannelModelUC {
|
|
6
|
+
constructor(appObject) {
|
|
7
|
+
super(appObject, SelectChannelModelUC_1.SelectChannelModelUC.type);
|
|
8
|
+
this.selectChannelModel = jest.fn();
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.SelectChannelModelUCMock = SelectChannelModelUCMock;
|
|
12
|
+
function makeSelectChannelModelUCMock(appObjects) {
|
|
13
|
+
return new SelectChannelModelUCMock(appObjects.getOrCreate("SelectChannelModelUCMock"));
|
|
14
|
+
}
|
|
15
|
+
exports.makeSelectChannelModelUCMock = makeSelectChannelModelUCMock;
|
|
@@ -13,3 +13,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13
13
|
__exportStar(require("./ChannelModelObjectPMMock"), exports);
|
|
14
14
|
__exportStar(require("./ChannelModelPMMock"), exports);
|
|
15
15
|
__exportStar(require("./ChannelModelViewFactoryMock"), exports);
|
|
16
|
+
__exportStar(require("./LoadChannelModelMock"), exports);
|
|
17
|
+
__exportStar(require("./SelectChannelModelUCMock"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AppObject, AppObjectRepo, AppObjectUC } from "../../../AppObject";
|
|
2
|
+
import { ChannelModelEntity } from "../Entities";
|
|
3
|
+
export declare const SCENE_MODEL_DATA_ASSET_LINK_TYPE = "default_model_data";
|
|
4
|
+
export declare abstract class LoadChannelModelUC extends AppObjectUC {
|
|
5
|
+
static type: string;
|
|
6
|
+
abstract loadChannelModel(id: string): Promise<ChannelModelEntity>;
|
|
7
|
+
abstract blobToJSON(blobURL: string): Promise<object>;
|
|
8
|
+
static get(appObjects: AppObjectRepo): LoadChannelModelUC | undefined;
|
|
9
|
+
}
|
|
10
|
+
export declare function makeLoadChannelModelUC(appObject: AppObject): LoadChannelModelUC;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeLoadChannelModelUC = exports.LoadChannelModelUC = exports.SCENE_MODEL_DATA_ASSET_LINK_TYPE = void 0;
|
|
4
|
+
const AppObject_1 = require("../../../AppObject");
|
|
5
|
+
const Dispatcher_1 = require("../../Dispatcher");
|
|
6
|
+
const GLBModel_1 = require("../../GLBModel");
|
|
7
|
+
const Entities_1 = require("../Entities");
|
|
8
|
+
const ChannelModelViewFactory_1 = require("./ChannelModelViewFactory");
|
|
9
|
+
exports.SCENE_MODEL_DATA_ASSET_LINK_TYPE = "default_model_data";
|
|
10
|
+
class LoadChannelModelUC extends AppObject_1.AppObjectUC {
|
|
11
|
+
static get(appObjects) {
|
|
12
|
+
return AppObject_1.getSingletonComponent(LoadChannelModelUC.type, appObjects);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.LoadChannelModelUC = LoadChannelModelUC;
|
|
16
|
+
LoadChannelModelUC.type = "LoadChannelModelUC";
|
|
17
|
+
function makeLoadChannelModelUC(appObject) {
|
|
18
|
+
return new LoadChannelModelUCImp(appObject);
|
|
19
|
+
}
|
|
20
|
+
exports.makeLoadChannelModelUC = makeLoadChannelModelUC;
|
|
21
|
+
class LoadChannelModelUCImp extends LoadChannelModelUC {
|
|
22
|
+
constructor(appObject) {
|
|
23
|
+
super(appObject, LoadChannelModelUC.type);
|
|
24
|
+
this.loadChannelModel = (modelID) => {
|
|
25
|
+
if (!this.channelModelRepo ||
|
|
26
|
+
!this.glbRepo ||
|
|
27
|
+
!this.loadGlbFile ||
|
|
28
|
+
!this.getAssetBlob ||
|
|
29
|
+
!this.getLinkedAsset ||
|
|
30
|
+
!this.channelModelViewFactory ||
|
|
31
|
+
!this.showSpinner) {
|
|
32
|
+
this.error("Missing Component(s)");
|
|
33
|
+
return Promise.reject(new Error("Missing Component(s)"));
|
|
34
|
+
}
|
|
35
|
+
const existingChannelModel = this.channelModelRepo.getForAppObject(modelID);
|
|
36
|
+
if (existingChannelModel) {
|
|
37
|
+
if (existingChannelModel.state === Entities_1.ChannelModelState.READY) {
|
|
38
|
+
return Promise.resolve(existingChannelModel);
|
|
39
|
+
}
|
|
40
|
+
else if (existingChannelModel.state === Entities_1.ChannelModelState.LOADING) {
|
|
41
|
+
return this.waitForExistingToLoad(existingChannelModel);
|
|
42
|
+
}
|
|
43
|
+
else if (existingChannelModel.state === Entities_1.ChannelModelState.ERROR) {
|
|
44
|
+
return Promise.reject(existingChannelModel.modelError);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const channelModel = this.channelModelRepo.createChannelModel(modelID);
|
|
48
|
+
channelModel.state = Entities_1.ChannelModelState.LOADING;
|
|
49
|
+
const getLinkedAsset = this.getLinkedAsset;
|
|
50
|
+
const getAssetBlob = this.getAssetBlob;
|
|
51
|
+
const channelModelViewFactory = this.channelModelViewFactory;
|
|
52
|
+
let closeSpinner = () => { };
|
|
53
|
+
return this.showSpinner("Loading Model", "Loading channel model...")
|
|
54
|
+
.then((closeCB) => {
|
|
55
|
+
closeSpinner = closeCB;
|
|
56
|
+
return getAssetBlob(modelID);
|
|
57
|
+
})
|
|
58
|
+
.then((blobURL) => {
|
|
59
|
+
const glbModel = this.glbRepo.createGlbModel(modelID);
|
|
60
|
+
return this.loadGlbFile.loadBlobURL(blobURL, glbModel);
|
|
61
|
+
})
|
|
62
|
+
.then(() => {
|
|
63
|
+
return getLinkedAsset(modelID, exports.SCENE_MODEL_DATA_ASSET_LINK_TYPE);
|
|
64
|
+
})
|
|
65
|
+
.then((dataAssets) => {
|
|
66
|
+
if (dataAssets.length === 0) {
|
|
67
|
+
return Promise.reject(new Error("Model asset does not have data"));
|
|
68
|
+
}
|
|
69
|
+
return getAssetBlob(dataAssets[0].id);
|
|
70
|
+
})
|
|
71
|
+
.then((blobURL) => {
|
|
72
|
+
return this.blobToJSON(blobURL);
|
|
73
|
+
})
|
|
74
|
+
.then((dto) => {
|
|
75
|
+
channelModel.setupFromData(dto);
|
|
76
|
+
channelModelViewFactory.initializeView(channelModel);
|
|
77
|
+
channelModel.state = Entities_1.ChannelModelState.READY;
|
|
78
|
+
closeSpinner();
|
|
79
|
+
return channelModel;
|
|
80
|
+
})
|
|
81
|
+
.catch((e) => {
|
|
82
|
+
closeSpinner();
|
|
83
|
+
return Promise.reject(e);
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
this.blobToJSON = (url) => {
|
|
87
|
+
return fetch(url).then((resp) => {
|
|
88
|
+
return resp.json();
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
this.appObjects.registerSingleton(this);
|
|
92
|
+
}
|
|
93
|
+
get channelModelRepo() {
|
|
94
|
+
return this.getCachedSingleton(Entities_1.ChannelModelRepo.type);
|
|
95
|
+
}
|
|
96
|
+
get loadGlbFile() {
|
|
97
|
+
return this.getCachedSingleton(GLBModel_1.LoadGlbFileUC.type);
|
|
98
|
+
}
|
|
99
|
+
get glbRepo() {
|
|
100
|
+
return this.getCachedSingleton(GLBModel_1.GlbModelRepo.type);
|
|
101
|
+
}
|
|
102
|
+
get channelModelViewFactory() {
|
|
103
|
+
return this.getCachedSingleton(ChannelModelViewFactory_1.ChannelModelViewFactory.type);
|
|
104
|
+
}
|
|
105
|
+
get getAssetBlob() {
|
|
106
|
+
var _a;
|
|
107
|
+
return (_a = this.getCachedSingleton(Dispatcher_1.GetAssetBlobURLUC.type)) === null || _a === void 0 ? void 0 : _a.doDispatch;
|
|
108
|
+
}
|
|
109
|
+
get getLinkedAsset() {
|
|
110
|
+
var _a;
|
|
111
|
+
return (_a = this.getCachedSingleton(Dispatcher_1.GetLinkedAssetsUC.type)) === null || _a === void 0 ? void 0 : _a.doDispatch;
|
|
112
|
+
}
|
|
113
|
+
get showSpinner() {
|
|
114
|
+
var _a;
|
|
115
|
+
return (_a = this.getCachedSingleton(Dispatcher_1.ShowSpinnerUC.type)) === null || _a === void 0 ? void 0 : _a.showSpinner;
|
|
116
|
+
}
|
|
117
|
+
waitForExistingToLoad(existing) {
|
|
118
|
+
return new Promise((resolve, reject) => {
|
|
119
|
+
const onExistingModelChange = () => {
|
|
120
|
+
if (existing.state === Entities_1.ChannelModelState.READY) {
|
|
121
|
+
existing.removeChangeObserver(onExistingModelChange);
|
|
122
|
+
resolve(existing);
|
|
123
|
+
}
|
|
124
|
+
else if (existing.state === Entities_1.ChannelModelState.ERROR) {
|
|
125
|
+
existing.removeChangeObserver(onExistingModelChange);
|
|
126
|
+
reject(existing.modelError);
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
existing.addChangeObserver(onExistingModelChange);
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
}
|
|
@@ -4,7 +4,7 @@ exports.makeSelectChannelModelUC = exports.SelectChannelModelUC = void 0;
|
|
|
4
4
|
const AppObject_1 = require("../../../AppObject");
|
|
5
5
|
const Dispatcher_1 = require("../../Dispatcher");
|
|
6
6
|
const SceneRoot_1 = require("../../SceneRoot");
|
|
7
|
-
const
|
|
7
|
+
const LoadChannelModelUC_1 = require("./LoadChannelModelUC");
|
|
8
8
|
class SelectChannelModelUC extends AppObject_1.AppObjectUC {
|
|
9
9
|
}
|
|
10
10
|
exports.SelectChannelModelUC = SelectChannelModelUC;
|
|
@@ -18,40 +18,34 @@ class SelectChannelModelUCImp extends SelectChannelModelUC {
|
|
|
18
18
|
constructor(appObject) {
|
|
19
19
|
super(appObject, SelectChannelModelUC.type);
|
|
20
20
|
this.selectChannelModel = () => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
.doDispatch()
|
|
38
|
-
.then((resp) => {
|
|
39
|
-
modelID = resp.modelId;
|
|
40
|
-
return setupChannelModelUC.setupChannelModel(modelID);
|
|
41
|
-
})
|
|
42
|
-
.then((channelModel) => {
|
|
43
|
-
const sceneRoot = SceneRoot_1.SceneRootEntity.get(appObjects);
|
|
44
|
-
if (!sceneRoot)
|
|
45
|
-
return;
|
|
46
|
-
sceneRoot.position = channelModel.defaultPosition;
|
|
47
|
-
sceneRoot.rotation = channelModel.defaultRotation;
|
|
48
|
-
sceneRoot.scale = channelModel.defaultScale;
|
|
49
|
-
resolve(modelID);
|
|
50
|
-
})
|
|
51
|
-
.catch((e) => {
|
|
52
|
-
reject(e);
|
|
53
|
-
});
|
|
21
|
+
const showSelectModel = this.showSelectModel;
|
|
22
|
+
const loadChannelModel = this.loadChannelModel;
|
|
23
|
+
const sceneRoot = this.sceneRoot;
|
|
24
|
+
if (!showSelectModel || !loadChannelModel || !sceneRoot) {
|
|
25
|
+
return Promise.reject(new Error("Missing Components"));
|
|
26
|
+
}
|
|
27
|
+
return showSelectModel
|
|
28
|
+
.doDispatch()
|
|
29
|
+
.then((resp) => {
|
|
30
|
+
return loadChannelModel(resp.modelId);
|
|
31
|
+
})
|
|
32
|
+
.then((channelModel) => {
|
|
33
|
+
sceneRoot.position = channelModel.defaultPosition;
|
|
34
|
+
sceneRoot.rotation = channelModel.defaultRotation;
|
|
35
|
+
sceneRoot.scale = channelModel.defaultScale;
|
|
36
|
+
return channelModel.id;
|
|
54
37
|
});
|
|
55
38
|
};
|
|
39
|
+
this.appObjects.registerSingleton(this);
|
|
40
|
+
}
|
|
41
|
+
get showSelectModel() {
|
|
42
|
+
return this.getCachedSingleton(Dispatcher_1.ShowSelectModelUC.type);
|
|
43
|
+
}
|
|
44
|
+
get loadChannelModel() {
|
|
45
|
+
var _a;
|
|
46
|
+
return (_a = this.getCachedSingleton(LoadChannelModelUC_1.LoadChannelModelUC.type)) === null || _a === void 0 ? void 0 : _a.loadChannelModel;
|
|
47
|
+
}
|
|
48
|
+
get sceneRoot() {
|
|
49
|
+
return this.getCachedSingleton(SceneRoot_1.SceneRootEntity.type);
|
|
56
50
|
}
|
|
57
51
|
}
|
|
@@ -11,3 +11,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
__exportStar(require("./ChannelModelViewFactory"), exports);
|
|
14
|
+
__exportStar(require("./LoadChannelModelUC"), exports);
|
|
15
|
+
__exportStar(require("./SelectChannelModelUC"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="jest" />
|
|
2
|
+
import { AppObject, AppObjectRepo } from "../../../AppObject";
|
|
3
|
+
import { GetAssetBlobURLUC } from "../UC";
|
|
4
|
+
export declare class GetAssetBlobURLUCMock extends GetAssetBlobURLUC {
|
|
5
|
+
doDispatch: jest.Mock<any, any>;
|
|
6
|
+
constructor(appObject: AppObject);
|
|
7
|
+
}
|
|
8
|
+
export declare function makeGetAssetBlobURLUCMock(appObjects: AppObjectRepo): GetAssetBlobURLUCMock;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeGetAssetBlobURLUCMock = exports.GetAssetBlobURLUCMock = void 0;
|
|
4
|
+
const UC_1 = require("../UC");
|
|
5
|
+
class GetAssetBlobURLUCMock extends UC_1.GetAssetBlobURLUC {
|
|
6
|
+
constructor(appObject) {
|
|
7
|
+
super(appObject, UC_1.GetAssetBlobURLUC.type);
|
|
8
|
+
this.doDispatch = jest.fn();
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.GetAssetBlobURLUCMock = GetAssetBlobURLUCMock;
|
|
12
|
+
function makeGetAssetBlobURLUCMock(appObjects) {
|
|
13
|
+
return new GetAssetBlobURLUCMock(appObjects.getOrCreate("GetAssetBlobURLUCMock"));
|
|
14
|
+
}
|
|
15
|
+
exports.makeGetAssetBlobURLUCMock = makeGetAssetBlobURLUCMock;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="jest" />
|
|
2
|
+
import { AppObject, AppObjectRepo } from "../../../AppObject";
|
|
3
|
+
import { GetLinkedAssetsUC } from "../UC";
|
|
4
|
+
export declare class GetLinkedAssetsUCMock extends GetLinkedAssetsUC {
|
|
5
|
+
doDispatch: jest.Mock<any, any>;
|
|
6
|
+
constructor(appObject: AppObject);
|
|
7
|
+
}
|
|
8
|
+
export declare function makeGetLinkedAssetsUCMock(appObjects: AppObjectRepo): GetLinkedAssetsUCMock;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeGetLinkedAssetsUCMock = exports.GetLinkedAssetsUCMock = void 0;
|
|
4
|
+
const UC_1 = require("../UC");
|
|
5
|
+
class GetLinkedAssetsUCMock extends UC_1.GetLinkedAssetsUC {
|
|
6
|
+
constructor(appObject) {
|
|
7
|
+
super(appObject, UC_1.GetLinkedAssetsUC.type);
|
|
8
|
+
this.doDispatch = jest.fn();
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.GetLinkedAssetsUCMock = GetLinkedAssetsUCMock;
|
|
12
|
+
function makeGetLinkedAssetsUCMock(appObjects) {
|
|
13
|
+
return new GetLinkedAssetsUCMock(appObjects.getOrCreate("GetLinkedAssetsUCMock"));
|
|
14
|
+
}
|
|
15
|
+
exports.makeGetLinkedAssetsUCMock = makeGetLinkedAssetsUCMock;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="jest" />
|
|
2
2
|
import { AppObjectRepo } from "../../../AppObject";
|
|
3
3
|
import { AppObject } from "../../../AppObject/AppObject";
|
|
4
|
-
import { GetAssetFolderURLUC } from "../UC";
|
|
4
|
+
import { GetAssetFolderURLUC } from "../UC/GetAssetFolderURLUC";
|
|
5
5
|
export declare class MockGetAssetFolderURL extends GetAssetFolderURLUC {
|
|
6
6
|
doDispatch: jest.Mock<any, any>;
|
|
7
7
|
constructor(appObject: AppObject);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.makeMockGetAssetFolderURL = exports.MockGetAssetFolderURL = void 0;
|
|
4
|
-
const
|
|
5
|
-
class MockGetAssetFolderURL extends
|
|
4
|
+
const GetAssetFolderURLUC_1 = require("../UC/GetAssetFolderURLUC");
|
|
5
|
+
class MockGetAssetFolderURL extends GetAssetFolderURLUC_1.GetAssetFolderURLUC {
|
|
6
6
|
constructor(appObject) {
|
|
7
|
-
super(appObject,
|
|
7
|
+
super(appObject, GetAssetFolderURLUC_1.GetAssetFolderURLUC.type);
|
|
8
8
|
this.doDispatch = jest.fn();
|
|
9
9
|
}
|
|
10
10
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="jest" />
|
|
2
2
|
import { AppObject, AppObjectRepo } from "../../../AppObject";
|
|
3
|
-
import { ShowAlertUC } from "../UC";
|
|
3
|
+
import { ShowAlertUC } from "../UC/ShowAlertUC";
|
|
4
4
|
export declare class MockShowAlert extends ShowAlertUC {
|
|
5
5
|
showAlert: jest.Mock<any, any>;
|
|
6
6
|
constructor(appObject: AppObject);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.makeMockShowAlert = exports.MockShowAlert = void 0;
|
|
4
|
-
const
|
|
5
|
-
class MockShowAlert extends
|
|
4
|
+
const ShowAlertUC_1 = require("../UC/ShowAlertUC");
|
|
5
|
+
class MockShowAlert extends ShowAlertUC_1.ShowAlertUC {
|
|
6
6
|
constructor(appObject) {
|
|
7
|
-
super(appObject,
|
|
7
|
+
super(appObject, ShowAlertUC_1.ShowAlertUC.type);
|
|
8
8
|
this.showAlert = jest.fn();
|
|
9
9
|
}
|
|
10
10
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="jest" />
|
|
2
2
|
import { AppObject, AppObjectRepo } from "../../../AppObject";
|
|
3
|
-
import { ShowConfirmUC } from "../UC";
|
|
3
|
+
import { ShowConfirmUC } from "../UC/ShowConfirmUC";
|
|
4
4
|
export declare class MockShowConfirmUC extends ShowConfirmUC {
|
|
5
5
|
showConfirm: jest.Mock<any, any>;
|
|
6
6
|
constructor(appObject: AppObject);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.makeMockShowConfirmUC = exports.MockShowConfirmUC = void 0;
|
|
4
|
-
const
|
|
5
|
-
class MockShowConfirmUC extends
|
|
4
|
+
const ShowConfirmUC_1 = require("../UC/ShowConfirmUC");
|
|
5
|
+
class MockShowConfirmUC extends ShowConfirmUC_1.ShowConfirmUC {
|
|
6
6
|
constructor(appObject) {
|
|
7
|
-
super(appObject,
|
|
7
|
+
super(appObject, ShowConfirmUC_1.ShowConfirmUC.type);
|
|
8
8
|
this.showConfirm = jest.fn();
|
|
9
9
|
}
|
|
10
10
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="jest" />
|
|
2
2
|
import { AppObject, AppObjectRepo } from "../../../AppObject";
|
|
3
|
-
import { ShowMarkdownEditorUC } from "../UC";
|
|
3
|
+
import { ShowMarkdownEditorUC } from "../UC/ShowMarkdownEditorUC";
|
|
4
4
|
export declare class MockShowMarkdownEditor extends ShowMarkdownEditorUC {
|
|
5
5
|
showMarkdownEditor: jest.Mock<any, any>;
|
|
6
6
|
constructor(appObject: AppObject);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.makeMockShowMarkdownEditor = exports.MockShowMarkdownEditor = void 0;
|
|
4
|
-
const
|
|
5
|
-
class MockShowMarkdownEditor extends
|
|
4
|
+
const ShowMarkdownEditorUC_1 = require("../UC/ShowMarkdownEditorUC");
|
|
5
|
+
class MockShowMarkdownEditor extends ShowMarkdownEditorUC_1.ShowMarkdownEditorUC {
|
|
6
6
|
constructor(appObject) {
|
|
7
|
-
super(appObject,
|
|
7
|
+
super(appObject, ShowMarkdownEditorUC_1.ShowMarkdownEditorUC.type);
|
|
8
8
|
this.showMarkdownEditor = jest.fn();
|
|
9
9
|
}
|
|
10
10
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="jest" />
|
|
2
|
+
import { AppObject, AppObjectRepo } from "../../../AppObject";
|
|
3
|
+
import { ShowSpinnerUC } from "../UC";
|
|
4
|
+
export declare class MockShowSpinner extends ShowSpinnerUC {
|
|
5
|
+
showSpinner: jest.Mock<any, any>;
|
|
6
|
+
constructor(appObject: AppObject);
|
|
7
|
+
}
|
|
8
|
+
export declare function makeMockShowSpinner(appObjects: AppObjectRepo): MockShowSpinner;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeMockShowSpinner = exports.MockShowSpinner = void 0;
|
|
4
|
+
const UC_1 = require("../UC");
|
|
5
|
+
class MockShowSpinner extends UC_1.ShowSpinnerUC {
|
|
6
|
+
constructor(appObject) {
|
|
7
|
+
super(appObject, MockShowSpinner.type);
|
|
8
|
+
this.showSpinner = jest.fn();
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.MockShowSpinner = MockShowSpinner;
|
|
12
|
+
function makeMockShowSpinner(appObjects) {
|
|
13
|
+
return new MockShowSpinner(appObjects.getOrCreate("MockShowSpinner"));
|
|
14
|
+
}
|
|
15
|
+
exports.makeMockShowSpinner = makeMockShowSpinner;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="jest" />
|
|
2
2
|
import { AppObject, AppObjectRepo } from "../../../AppObject";
|
|
3
|
-
import { SubmitResultResultUC } from "../UC";
|
|
3
|
+
import { SubmitResultResultUC } from "../UC/SubmitResultResultUC";
|
|
4
4
|
export declare class MockSubmitResult extends SubmitResultResultUC {
|
|
5
5
|
submitHitResult: jest.Mock<any, any>;
|
|
6
6
|
submitProgressResult: jest.Mock<any, any>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.makeMockSubmitResult = exports.MockSubmitResult = void 0;
|
|
4
|
-
const
|
|
5
|
-
class MockSubmitResult extends
|
|
4
|
+
const SubmitResultResultUC_1 = require("../UC/SubmitResultResultUC");
|
|
5
|
+
class MockSubmitResult extends SubmitResultResultUC_1.SubmitResultResultUC {
|
|
6
6
|
constructor(appObject) {
|
|
7
|
-
super(appObject,
|
|
7
|
+
super(appObject, SubmitResultResultUC_1.SubmitResultResultUC.type);
|
|
8
8
|
this.submitHitResult = jest.fn();
|
|
9
9
|
this.submitProgressResult = jest.fn();
|
|
10
10
|
this.submitMultiHitResult = jest.fn();
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="jest" />
|
|
2
|
+
import { AppObject, AppObjectRepo } from "../../../AppObject";
|
|
3
|
+
import { ShowSelectModelUC } from "../UC/ShowSelectModelUC";
|
|
4
|
+
export declare class ShowSelectModelUCMock extends ShowSelectModelUC {
|
|
5
|
+
doDispatch: jest.Mock<any, any>;
|
|
6
|
+
constructor(appObject: AppObject);
|
|
7
|
+
}
|
|
8
|
+
export declare function makeShowSelectModelUCMock(appObjects: AppObjectRepo): ShowSelectModelUCMock;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeShowSelectModelUCMock = exports.ShowSelectModelUCMock = void 0;
|
|
4
|
+
const ShowSelectModelUC_1 = require("../UC/ShowSelectModelUC");
|
|
5
|
+
class ShowSelectModelUCMock extends ShowSelectModelUC_1.ShowSelectModelUC {
|
|
6
|
+
constructor(appObject) {
|
|
7
|
+
super(appObject, ShowSelectModelUC_1.ShowSelectModelUC.type);
|
|
8
|
+
this.doDispatch = jest.fn();
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.ShowSelectModelUCMock = ShowSelectModelUCMock;
|
|
12
|
+
function makeShowSelectModelUCMock(appObjects) {
|
|
13
|
+
return new ShowSelectModelUCMock(appObjects.getOrCreate("ShowSelectModelUCMock"));
|
|
14
|
+
}
|
|
15
|
+
exports.makeShowSelectModelUCMock = makeShowSelectModelUCMock;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./GetAssetBlobURLUCMock";
|
|
2
|
+
export * from "./GetLinkedAssetsUCMock";
|
|
2
3
|
export * from "./MockDispatcher";
|
|
4
|
+
export * from "./MockDispatchStateChange";
|
|
5
|
+
export * from "./MockGetAssetFolderURL";
|
|
3
6
|
export * from "./MockShowAlert";
|
|
4
7
|
export * from "./MockShowConfirm";
|
|
5
8
|
export * from "./MockShowMarkdown";
|
|
9
|
+
export * from "./MockShowSpinner";
|
|
6
10
|
export * from "./MockSubmitResult";
|
|
11
|
+
export * from "./ShowSelectModelUCMock";
|
|
@@ -10,9 +10,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./
|
|
13
|
+
__exportStar(require("./GetAssetBlobURLUCMock"), exports);
|
|
14
|
+
__exportStar(require("./GetLinkedAssetsUCMock"), exports);
|
|
14
15
|
__exportStar(require("./MockDispatcher"), exports);
|
|
16
|
+
__exportStar(require("./MockDispatchStateChange"), exports);
|
|
17
|
+
__exportStar(require("./MockGetAssetFolderURL"), exports);
|
|
15
18
|
__exportStar(require("./MockShowAlert"), exports);
|
|
16
19
|
__exportStar(require("./MockShowConfirm"), exports);
|
|
17
20
|
__exportStar(require("./MockShowMarkdown"), exports);
|
|
21
|
+
__exportStar(require("./MockShowSpinner"), exports);
|
|
18
22
|
__exportStar(require("./MockSubmitResult"), exports);
|
|
23
|
+
__exportStar(require("./ShowSelectModelUCMock"), exports);
|
|
@@ -31,15 +31,15 @@ class AppIsReadyUCImp extends AppIsReadyUC {
|
|
|
31
31
|
constructor(appObject) {
|
|
32
32
|
super(appObject, AppIsReadyUC.type);
|
|
33
33
|
this.requestVersion = 1;
|
|
34
|
+
this.doDispatch = () => {
|
|
35
|
+
if (!this.appDispatcher)
|
|
36
|
+
return;
|
|
37
|
+
this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion);
|
|
38
|
+
};
|
|
34
39
|
this.appDispatcher = appObject.getComponent(AppDispatcher_1.AppDispatcher.type);
|
|
35
40
|
if (!this.appDispatcher) {
|
|
36
41
|
this.warn("AppIsReadyUCImp has been added to an App Object that does not have a AppDispatcher. Add a dispatcher first");
|
|
37
42
|
this.dispose();
|
|
38
43
|
}
|
|
39
44
|
}
|
|
40
|
-
doDispatch() {
|
|
41
|
-
if (!this.appDispatcher)
|
|
42
|
-
return;
|
|
43
|
-
this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion);
|
|
44
|
-
}
|
|
45
45
|
}
|
|
@@ -21,15 +21,15 @@ class DispatchStateChangeUCImp extends DispatchStartZSpaceUC {
|
|
|
21
21
|
constructor(appObject) {
|
|
22
22
|
super(appObject, DispatchStartZSpaceUC.type);
|
|
23
23
|
this.requestVersion = 1;
|
|
24
|
+
this.doDispatch = () => {
|
|
25
|
+
if (!this.appDispatcher)
|
|
26
|
+
return;
|
|
27
|
+
this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion);
|
|
28
|
+
};
|
|
24
29
|
this.appDispatcher = appObject.getComponent(AppDispatcher_1.AppDispatcher.type);
|
|
25
30
|
if (!this.appDispatcher) {
|
|
26
31
|
this.warn("DispatchStartZSpaceUC has been added to an App Object that does not have a AppDispatcher. Add a dispatcher first");
|
|
27
32
|
this.dispose();
|
|
28
33
|
}
|
|
29
34
|
}
|
|
30
|
-
doDispatch() {
|
|
31
|
-
if (!this.appDispatcher)
|
|
32
|
-
return;
|
|
33
|
-
this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion);
|
|
34
|
-
}
|
|
35
35
|
}
|