@vived/app 4.21.0 → 4.23.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/App/Adapters/index.d.ts +4 -0
- package/lib/Components/{KeyboardInput/Mocks → App/Adapters}/index.js +4 -1
- package/lib/Components/App/Adapters/isAuthoringAdapter.d.ts +2 -0
- package/lib/Components/App/Adapters/isAuthoringAdapter.js +23 -0
- package/lib/Components/App/Adapters/isReviewingAdapter.d.ts +2 -0
- package/lib/Components/App/Adapters/isReviewingAdapter.js +23 -0
- package/lib/Components/App/Adapters/slideNavigationAdapter.d.ts +3 -0
- package/lib/Components/App/Adapters/slideNavigationAdapter.js +23 -0
- package/lib/Components/App/Adapters/slideTextAdapter.d.ts +2 -0
- package/lib/Components/App/Adapters/slideTextAdapter.js +23 -0
- package/lib/Components/App/Entity/BaseAppState.d.ts +2 -0
- package/lib/Components/App/Entity/BaseAppState.js +7 -0
- package/lib/Components/App/Mocks/IsAuthoringMock.d.ts +8 -0
- package/lib/Components/App/Mocks/IsAuthoringMock.js +15 -0
- package/lib/Components/App/Mocks/IsReviewingMock.d.ts +8 -0
- package/lib/Components/App/Mocks/IsReviewingMock.js +15 -0
- package/lib/Components/App/Mocks/SlideNavigationMock.d.ts +8 -0
- package/lib/Components/App/Mocks/SlideNavigationMock.js +15 -0
- package/lib/Components/App/Mocks/SlideTextMock.d.ts +8 -0
- package/lib/Components/App/Mocks/SlideTextMock.js +15 -0
- package/lib/Components/App/Mocks/index.d.ts +4 -0
- package/lib/Components/App/Mocks/index.js +4 -0
- package/lib/Components/App/PM/IsAuthoringPM.d.ts +2 -6
- package/lib/Components/App/PM/IsAuthoringPM.js +16 -10
- package/lib/Components/App/PM/IsReviewingPM.d.ts +2 -6
- package/lib/Components/App/PM/IsReviewingPM.js +16 -10
- package/lib/Components/App/PM/SlideNavigationPM.d.ts +12 -0
- package/lib/Components/App/PM/SlideNavigationPM.js +49 -0
- package/lib/Components/App/PM/SlideTextPM.d.ts +2 -5
- package/lib/Components/App/PM/SlideTextPM.js +17 -10
- package/lib/Components/App/PM/index.d.ts +1 -1
- package/lib/Components/App/PM/index.js +1 -1
- package/lib/Components/App/index.d.ts +1 -0
- package/lib/Components/App/index.js +1 -0
- package/lib/Components/ChannelModel/Adapters/activeModelAdapter.d.ts +2 -0
- package/lib/Components/ChannelModel/Adapters/activeModelAdapter.js +23 -0
- package/lib/Components/ChannelModel/Adapters/index.d.ts +1 -0
- package/lib/Components/ChannelModel/Adapters/index.js +1 -0
- package/lib/Components/ChannelModel/Entities/ChannelModelRepo.d.ts +2 -2
- package/lib/Components/ChannelModel/Entities/ChannelModelRepo.js +3 -3
- package/lib/Components/ChannelModel/Mocks/ActiveModelMock.d.ts +8 -0
- package/lib/Components/ChannelModel/Mocks/ActiveModelMock.js +15 -0
- package/lib/Components/ChannelModel/Mocks/index.d.ts +1 -0
- package/lib/Components/ChannelModel/Mocks/index.js +1 -0
- package/lib/Components/ChannelModel/PMs/ActiveModelPM.d.ts +13 -0
- package/lib/Components/ChannelModel/PMs/ActiveModelPM.js +36 -0
- package/lib/Components/ChannelModel/PMs/index.d.ts +1 -0
- package/lib/Components/ChannelModel/PMs/index.js +1 -0
- package/lib/Components/ChannelModel/UC/SelectChannelModelUC.js +7 -1
- package/lib/Components/ChannelModel/UC/SerializeActiveModel.d.ts +26 -0
- package/lib/Components/ChannelModel/UC/SerializeActiveModel.js +80 -0
- package/lib/Components/ChannelModel/UC/index.d.ts +1 -0
- package/lib/Components/ChannelModel/UC/index.js +1 -0
- package/lib/Components/RequestHandler/UC/SetAppStateUC.d.ts +9 -2
- package/lib/Components/RequestHandler/UC/SetAppStateUC.js +35 -27
- package/package.json +1 -1
- package/lib/Components/App/PM/HasNextPreviousStatePM.d.ts +0 -15
- package/lib/Components/App/PM/HasNextPreviousStatePM.js +0 -44
- package/lib/Components/ChannelModel/Mocks/ProcessChannelModelUCMock.d.ts +0 -8
- package/lib/Components/ChannelModel/Mocks/ProcessChannelModelUCMock.js +0 -15
- package/lib/Components/ChannelModel/UC/InitializeChannelModelFromGLB.d.ts +0 -0
- package/lib/Components/ChannelModel/UC/InitializeChannelModelFromGLB.js +0 -1
- package/lib/Components/ChannelModel/UC/ProcessChannelModelUC.d.ts +0 -6
- package/lib/Components/ChannelModel/UC/ProcessChannelModelUC.js +0 -9
- package/lib/Components/ChannelModel/UC/SetupChannelModelUC.d.ts +0 -9
- package/lib/Components/ChannelModel/UC/SetupChannelModelUC.js +0 -11
- package/lib/Components/HoverLabel/Mocks/index.d.ts +0 -1
- package/lib/Components/HoverLabel/Mocks/index.js +0 -13
- package/lib/Components/HoverLabel/PM/HoverLabelPM.d.ts +0 -19
- package/lib/Components/HoverLabel/PM/HoverLabelPM.js +0 -65
- package/lib/Components/KeyboardInput/Mocks/index.d.ts +0 -1
- package/lib/Components/Landmarks/Mocks/index.d.ts +0 -1
- package/lib/Components/Landmarks/Mocks/index.js +0 -13
- package/lib/Components/MouseInput/Mocks/index.d.ts +0 -1
- package/lib/Components/MouseInput/Mocks/index.js +0 -13
- package/lib/Components/Question/Mocks/index.d.ts +0 -2
- package/lib/Components/Question/Mocks/index.js +0 -14
- package/lib/Components/RequestHandler/Mocks/index.d.ts +0 -1
- package/lib/Components/RequestHandler/Mocks/index.js +0 -13
- package/lib/Components/SceneRoot/Controllers/StylusMove.d.ts +0 -14
- package/lib/Components/SceneRoot/Controllers/StylusMove.js +0 -56
- package/lib/Components/SceneRoot/Controllers/StylusScale.d.ts +0 -14
- package/lib/Components/SceneRoot/Controllers/StylusScale.js +0 -58
- package/lib/Components/Selection/Controller/StylusHoverOnAppObject.d.ts +0 -11
- package/lib/Components/Selection/Controller/StylusHoverOnAppObject.js +0 -42
- package/lib/Components/Selection/Controller/StylusPressOnAppObject.d.ts +0 -18
- package/lib/Components/Selection/Controller/StylusPressOnAppObject.js +0 -77
- package/lib/Components/Selection/Controller/StylusSelectAppObject.d.ts +0 -11
- package/lib/Components/Selection/Controller/StylusSelectAppObject.js +0 -44
- package/lib/Components/TouchController/Mock/index.d.ts +0 -2
- package/lib/Components/TouchController/Mock/index.js +0 -14
- package/lib/Components/UndoRedo/Mocks/index.d.ts +0 -1
- package/lib/Components/UndoRedo/Mocks/index.js +0 -13
- package/lib/Components/XR/Mocks/index.d.ts +0 -2
- package/lib/Components/XR/Mocks/index.js +0 -14
- package/lib/Components/zSpace/Controllers/EmulateStylus.d.ts +0 -10
- package/lib/Components/zSpace/Controllers/EmulateStylus.js +0 -113
- package/lib/Components/zSpace/Controllers/ZSpaceScaleRoot.d.ts +0 -14
- package/lib/Components/zSpace/Controllers/ZSpaceScaleRoot.js +0 -57
- package/lib/Components/zSpace/Controllers/index.d.ts +0 -1
- package/lib/Components/zSpace/Controllers/index.js +0 -13
- package/lib/Components/zSpace/Entities/ZSpaceStylusEntity.d.ts +0 -29
- package/lib/Components/zSpace/Entities/ZSpaceStylusEntity.js +0 -115
- package/lib/Components/zSpace/Mocks/index.d.ts +0 -1
- package/lib/Components/zSpace/Mocks/index.js +0 -13
- package/lib/Components/zSpace/PM/StylusColorLengthPM.d.ts +0 -13
- package/lib/Components/zSpace/PM/StylusColorLengthPM.js +0 -77
- package/lib/Components/zSpace/PM/StylusIsInUsePM.d.ts +0 -6
- package/lib/Components/zSpace/PM/StylusIsInUsePM.js +0 -42
- package/lib/Types/ChannelModelData.d.ts +0 -67
- package/lib/Types/ChannelModelData.js +0 -21
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="jest" />
|
|
2
|
+
import { AppObject, AppObjectRepo } from "../../../AppObject";
|
|
3
|
+
import { ActiveModelPM } from "../PMs";
|
|
4
|
+
export declare class ActiveModelMock extends ActiveModelPM {
|
|
5
|
+
vmsAreEqual: jest.Mock<any, any>;
|
|
6
|
+
constructor(appObject: AppObject);
|
|
7
|
+
}
|
|
8
|
+
export declare function makeActiveModelMock(appObjects: AppObjectRepo): ActiveModelMock;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeActiveModelMock = exports.ActiveModelMock = void 0;
|
|
4
|
+
const PMs_1 = require("../PMs");
|
|
5
|
+
class ActiveModelMock extends PMs_1.ActiveModelPM {
|
|
6
|
+
constructor(appObject) {
|
|
7
|
+
super(appObject, PMs_1.ActiveModelPM.type);
|
|
8
|
+
this.vmsAreEqual = jest.fn();
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.ActiveModelMock = ActiveModelMock;
|
|
12
|
+
function makeActiveModelMock(appObjects) {
|
|
13
|
+
return new ActiveModelMock(appObjects.getOrCreate("ActiveModelMock"));
|
|
14
|
+
}
|
|
15
|
+
exports.makeActiveModelMock = makeActiveModelMock;
|
|
@@ -10,6 +10,7 @@ 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("./ActiveModelMock"), exports);
|
|
13
14
|
__exportStar(require("./ChannelModelObjectPMMock"), exports);
|
|
14
15
|
__exportStar(require("./ChannelModelPMMock"), exports);
|
|
15
16
|
__exportStar(require("./ChannelModelViewFactoryMock"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AppObject, AppObjectPM, AppObjectRepo } from "../../../AppObject";
|
|
2
|
+
export declare abstract class ActiveModelPM extends AppObjectPM<string> {
|
|
3
|
+
static readonly type = "ActiveModelPM";
|
|
4
|
+
static get(appObjects: AppObjectRepo): ActiveModelPM | undefined;
|
|
5
|
+
}
|
|
6
|
+
export declare function makeActiveModelPM(appObject: AppObject): ActiveModelPMImp;
|
|
7
|
+
declare class ActiveModelPMImp extends ActiveModelPM {
|
|
8
|
+
private get repo();
|
|
9
|
+
vmsAreEqual(a: string, b: string): boolean;
|
|
10
|
+
onEntityChange: () => void;
|
|
11
|
+
constructor(appObject: AppObject);
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeActiveModelPM = exports.ActiveModelPM = void 0;
|
|
4
|
+
const AppObject_1 = require("../../../AppObject");
|
|
5
|
+
const Entities_1 = require("../Entities");
|
|
6
|
+
class ActiveModelPM extends AppObject_1.AppObjectPM {
|
|
7
|
+
static get(appObjects) {
|
|
8
|
+
return AppObject_1.getSingletonComponent(ActiveModelPM.type, appObjects);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.ActiveModelPM = ActiveModelPM;
|
|
12
|
+
ActiveModelPM.type = "ActiveModelPM";
|
|
13
|
+
function makeActiveModelPM(appObject) {
|
|
14
|
+
return new ActiveModelPMImp(appObject);
|
|
15
|
+
}
|
|
16
|
+
exports.makeActiveModelPM = makeActiveModelPM;
|
|
17
|
+
class ActiveModelPMImp extends ActiveModelPM {
|
|
18
|
+
constructor(appObject) {
|
|
19
|
+
var _a;
|
|
20
|
+
super(appObject, ActiveModelPM.type);
|
|
21
|
+
this.onEntityChange = () => {
|
|
22
|
+
if (!this.repo)
|
|
23
|
+
return;
|
|
24
|
+
this.doUpdateView(this.repo.activeModel);
|
|
25
|
+
};
|
|
26
|
+
(_a = this.repo) === null || _a === void 0 ? void 0 : _a.addChangeObserver(this.onEntityChange);
|
|
27
|
+
this.onEntityChange();
|
|
28
|
+
this.appObjects.registerSingleton(this);
|
|
29
|
+
}
|
|
30
|
+
get repo() {
|
|
31
|
+
return this.getCachedSingleton(Entities_1.ChannelModelRepo.type);
|
|
32
|
+
}
|
|
33
|
+
vmsAreEqual(a, b) {
|
|
34
|
+
return a === b;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -10,5 +10,6 @@ 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("./ActiveModelPM"), exports);
|
|
13
14
|
__exportStar(require("./ChannelModelObjectPM"), exports);
|
|
14
15
|
__exportStar(require("./ChannelModelPM"), exports);
|
|
@@ -4,6 +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 Entities_1 = require("../Entities");
|
|
7
8
|
const LoadChannelModelUC_1 = require("./LoadChannelModelUC");
|
|
8
9
|
class SelectChannelModelUC extends AppObject_1.AppObjectUC {
|
|
9
10
|
}
|
|
@@ -21,7 +22,8 @@ class SelectChannelModelUCImp extends SelectChannelModelUC {
|
|
|
21
22
|
const showSelectModel = this.showSelectModel;
|
|
22
23
|
const loadChannelModel = this.loadChannelModel;
|
|
23
24
|
const sceneRoot = this.sceneRoot;
|
|
24
|
-
|
|
25
|
+
const repo = this.repo;
|
|
26
|
+
if (!showSelectModel || !loadChannelModel || !sceneRoot || !repo) {
|
|
25
27
|
return Promise.reject(new Error("Missing Components"));
|
|
26
28
|
}
|
|
27
29
|
return showSelectModel
|
|
@@ -33,6 +35,7 @@ class SelectChannelModelUCImp extends SelectChannelModelUC {
|
|
|
33
35
|
sceneRoot.position = channelModel.defaultPosition;
|
|
34
36
|
sceneRoot.rotation = channelModel.defaultRotation;
|
|
35
37
|
sceneRoot.scale = channelModel.defaultScale;
|
|
38
|
+
repo.activeModel = channelModel.id;
|
|
36
39
|
return channelModel.id;
|
|
37
40
|
});
|
|
38
41
|
};
|
|
@@ -48,4 +51,7 @@ class SelectChannelModelUCImp extends SelectChannelModelUC {
|
|
|
48
51
|
get sceneRoot() {
|
|
49
52
|
return this.getCachedSingleton(SceneRoot_1.SceneRootEntity.type);
|
|
50
53
|
}
|
|
54
|
+
get repo() {
|
|
55
|
+
return this.getCachedSingleton(Entities_1.ChannelModelRepo.type);
|
|
56
|
+
}
|
|
51
57
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AppObject, AppObjectUC } from "../../../AppObject";
|
|
2
|
+
import { SerializedSystem } from "../../StateMachine";
|
|
3
|
+
export declare abstract class SerializeActiveModel extends AppObjectUC implements SerializedSystem {
|
|
4
|
+
static readonly type = "SerializeDemoState";
|
|
5
|
+
name: string;
|
|
6
|
+
abstract seriliziationVersion: number;
|
|
7
|
+
abstract getSystemState(): object;
|
|
8
|
+
abstract applySystemState(state: object, version: number, transitionDuration: number): void;
|
|
9
|
+
abstract applyDefaultState(transitionDuration: number): void;
|
|
10
|
+
}
|
|
11
|
+
export declare function makeSerializeActiveModel(appObject: AppObject): SerializeActiveModel;
|
|
12
|
+
export declare class SerializeActiveModelImp extends SerializeActiveModel {
|
|
13
|
+
seriliziationVersion: number;
|
|
14
|
+
private get repo();
|
|
15
|
+
private get stateMachine();
|
|
16
|
+
private get loadChannelModel();
|
|
17
|
+
private get showSelectModel();
|
|
18
|
+
getSystemState(): object;
|
|
19
|
+
applySystemState(state: object, version: number): void;
|
|
20
|
+
applyStateV1(state: SerializedActiveModelStateV1): void;
|
|
21
|
+
applyDefaultState(): void;
|
|
22
|
+
constructor(appObject: AppObject);
|
|
23
|
+
}
|
|
24
|
+
export interface SerializedActiveModelStateV1 {
|
|
25
|
+
modelID: string;
|
|
26
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SerializeActiveModelImp = exports.makeSerializeActiveModel = exports.SerializeActiveModel = void 0;
|
|
4
|
+
const AppObject_1 = require("../../../AppObject");
|
|
5
|
+
const StateMachine_1 = require("../../StateMachine");
|
|
6
|
+
const Entities_1 = require("../Entities");
|
|
7
|
+
const LoadChannelModelUC_1 = require("./LoadChannelModelUC");
|
|
8
|
+
const SelectChannelModelUC_1 = require("./SelectChannelModelUC");
|
|
9
|
+
class SerializeActiveModel extends AppObject_1.AppObjectUC {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.name = "active-model";
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.SerializeActiveModel = SerializeActiveModel;
|
|
16
|
+
SerializeActiveModel.type = "SerializeDemoState";
|
|
17
|
+
function makeSerializeActiveModel(appObject) {
|
|
18
|
+
return new SerializeActiveModelImp(appObject);
|
|
19
|
+
}
|
|
20
|
+
exports.makeSerializeActiveModel = makeSerializeActiveModel;
|
|
21
|
+
class SerializeActiveModelImp extends SerializeActiveModel {
|
|
22
|
+
constructor(appObject) {
|
|
23
|
+
var _a;
|
|
24
|
+
super(appObject, SerializeActiveModel.type);
|
|
25
|
+
this.seriliziationVersion = 1;
|
|
26
|
+
(_a = this.stateMachine) === null || _a === void 0 ? void 0 : _a.registerSerializedSystem(this);
|
|
27
|
+
}
|
|
28
|
+
get repo() {
|
|
29
|
+
return this.getCachedSingleton(Entities_1.ChannelModelRepo.type);
|
|
30
|
+
}
|
|
31
|
+
get stateMachine() {
|
|
32
|
+
return this.getCachedSingleton(StateMachine_1.StateMachineEntity.type);
|
|
33
|
+
}
|
|
34
|
+
get loadChannelModel() {
|
|
35
|
+
var _a;
|
|
36
|
+
return (_a = this.getCachedSingleton(LoadChannelModelUC_1.LoadChannelModelUC.type)) === null || _a === void 0 ? void 0 : _a.loadChannelModel;
|
|
37
|
+
}
|
|
38
|
+
get showSelectModel() {
|
|
39
|
+
var _a;
|
|
40
|
+
return (_a = this.getCachedSingleton(SelectChannelModelUC_1.SelectChannelModelUC.type)) === null || _a === void 0 ? void 0 : _a.selectChannelModel;
|
|
41
|
+
}
|
|
42
|
+
getSystemState() {
|
|
43
|
+
if (!this.repo)
|
|
44
|
+
return {};
|
|
45
|
+
const appState = {
|
|
46
|
+
modelID: this.repo.activeModel,
|
|
47
|
+
};
|
|
48
|
+
return appState;
|
|
49
|
+
}
|
|
50
|
+
applySystemState(state, version) {
|
|
51
|
+
if (version === 1) {
|
|
52
|
+
this.applyStateV1(state);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
// Unsupported version
|
|
56
|
+
this.warn(`Unsupported data version ${version} for serialized system ${this.name}. Reverting to default state`);
|
|
57
|
+
this.applyDefaultState();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
applyStateV1(state) {
|
|
61
|
+
const { modelID } = state;
|
|
62
|
+
if (!modelID) {
|
|
63
|
+
this.applyDefaultState();
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (!this.repo || !this.loadChannelModel) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
this.repo.activeModel = modelID;
|
|
70
|
+
this.loadChannelModel(modelID);
|
|
71
|
+
}
|
|
72
|
+
applyDefaultState() {
|
|
73
|
+
if (!this.repo || !this.showSelectModel) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
this.repo.activeModel = "";
|
|
77
|
+
this.showSelectModel();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.SerializeActiveModelImp = SerializeActiveModelImp;
|
|
@@ -13,3 +13,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13
13
|
__exportStar(require("./ChannelModelViewFactory"), exports);
|
|
14
14
|
__exportStar(require("./LoadChannelModelUC"), exports);
|
|
15
15
|
__exportStar(require("./SelectChannelModelUC"), exports);
|
|
16
|
+
__exportStar(require("./SerializeActiveModel"), exports);
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import { AppObject } from "../../../AppObject/AppObject";
|
|
2
2
|
import { AppObjectUC } from "../../../AppObject/AppObjectUC";
|
|
3
3
|
import { RequestHandler } from "../Entities";
|
|
4
|
-
export declare type SetAppStateAction = (
|
|
4
|
+
export declare type SetAppStateAction = (data: StartAppPayload) => void;
|
|
5
5
|
export declare abstract class SetAppStateBaseUC extends AppObjectUC implements RequestHandler {
|
|
6
6
|
static readonly type = "SetAppStateBaseUC";
|
|
7
7
|
readonly requestType = "SET_APP_STATE";
|
|
8
|
-
readonly payloadVersion =
|
|
8
|
+
readonly payloadVersion = 3;
|
|
9
9
|
abstract action: SetAppStateAction;
|
|
10
10
|
abstract handleRequest: (version: number, payload?: unknown) => void;
|
|
11
11
|
}
|
|
12
12
|
export declare function makeSetAppStateUC(appObject: AppObject): SetAppStateBaseUC;
|
|
13
|
+
export declare type StartAppPayload = {
|
|
14
|
+
finalState?: object;
|
|
15
|
+
hideNavigation: boolean;
|
|
16
|
+
hasNextSlide: boolean;
|
|
17
|
+
hasPreviousSlide: boolean;
|
|
18
|
+
duration?: number;
|
|
19
|
+
};
|
|
@@ -2,16 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.makeSetAppStateUC = exports.SetAppStateBaseUC = void 0;
|
|
4
4
|
const AppObjectUC_1 = require("../../../AppObject/AppObjectUC");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const Entities_1 = require("../Entities");
|
|
5
|
+
const Entity_1 = require("../../App/Entity");
|
|
6
|
+
const Entities_1 = require("../../StateMachine/Entities");
|
|
7
|
+
const Entities_2 = require("../../UndoRedo/Entities");
|
|
8
|
+
const Entities_3 = require("../Entities");
|
|
10
9
|
class SetAppStateBaseUC extends AppObjectUC_1.AppObjectUC {
|
|
11
10
|
constructor() {
|
|
12
11
|
super(...arguments);
|
|
13
12
|
this.requestType = "SET_APP_STATE";
|
|
14
|
-
this.payloadVersion =
|
|
13
|
+
this.payloadVersion = 3;
|
|
15
14
|
}
|
|
16
15
|
}
|
|
17
16
|
exports.SetAppStateBaseUC = SetAppStateBaseUC;
|
|
@@ -23,45 +22,54 @@ exports.makeSetAppStateUC = makeSetAppStateUC;
|
|
|
23
22
|
class SetAppStateBaseUCImp extends SetAppStateBaseUC {
|
|
24
23
|
constructor(appObject) {
|
|
25
24
|
super(appObject, SetAppStateBaseUC.type);
|
|
26
|
-
this.action = (
|
|
27
|
-
var _a
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (!baseApp) {
|
|
31
|
-
this.warn("Unable to find BaseAppState");
|
|
25
|
+
this.action = (data) => {
|
|
26
|
+
var _a;
|
|
27
|
+
if (!this.stateMachine || !this.baseApp) {
|
|
28
|
+
this.error("Missing component");
|
|
32
29
|
return;
|
|
33
30
|
}
|
|
34
|
-
const
|
|
35
|
-
if (
|
|
36
|
-
this.
|
|
37
|
-
|
|
31
|
+
const { finalState, hasNextSlide, hasPreviousSlide, hideNavigation, duration, } = data;
|
|
32
|
+
if (finalState) {
|
|
33
|
+
this.stateMachine.setSerializedStates(finalState, duration !== null && duration !== void 0 ? duration : 0);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
this.stateMachine.setDefaultState(duration !== null && duration !== void 0 ? duration : 0);
|
|
38
37
|
}
|
|
39
|
-
|
|
40
|
-
baseApp.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
(
|
|
38
|
+
this.baseApp.isReviewing = false;
|
|
39
|
+
this.baseApp.hasNextState = hasNextSlide;
|
|
40
|
+
this.baseApp.hasPreviousState = hasPreviousSlide;
|
|
41
|
+
this.baseApp.hideSlideNavigation = hideNavigation;
|
|
42
|
+
(_a = this.undoRedo) === null || _a === void 0 ? void 0 : _a.clearStack();
|
|
44
43
|
};
|
|
45
44
|
this.handleRequest = (version, payload) => {
|
|
46
45
|
if (version === this.payloadVersion) {
|
|
47
|
-
const
|
|
48
|
-
this.action(
|
|
46
|
+
const data = this.castPayload(payload);
|
|
47
|
+
this.action(data);
|
|
49
48
|
}
|
|
50
49
|
else {
|
|
51
|
-
throw new
|
|
50
|
+
throw new Entities_3.UnsupportedRequestVersion(this.requestType, version);
|
|
52
51
|
}
|
|
53
52
|
};
|
|
54
|
-
const handler = appObject.getComponent(
|
|
53
|
+
const handler = appObject.getComponent(Entities_3.AppHandlerEntity.type);
|
|
55
54
|
if (!handler) {
|
|
56
55
|
this.warn("SetAppStateBaseUC has been added to an app object that does not have an AppHandlerEntity. Add one first");
|
|
57
56
|
return;
|
|
58
57
|
}
|
|
59
58
|
handler.registerRequestHandler(this);
|
|
60
59
|
}
|
|
60
|
+
get baseApp() {
|
|
61
|
+
return this.getCachedSingleton(Entity_1.BaseAppState.type);
|
|
62
|
+
}
|
|
63
|
+
get stateMachine() {
|
|
64
|
+
return this.getCachedSingleton(Entities_1.StateMachineEntity.type);
|
|
65
|
+
}
|
|
66
|
+
get undoRedo() {
|
|
67
|
+
return this.getCachedSingleton(Entities_2.UndoRedoEntity.type);
|
|
68
|
+
}
|
|
61
69
|
castPayload(payload) {
|
|
62
70
|
const castPayload = payload;
|
|
63
|
-
if (castPayload.
|
|
64
|
-
throw new
|
|
71
|
+
if (castPayload.hasNextSlide === undefined) {
|
|
72
|
+
throw new Entities_3.UnableToParsePayload(this.requestType, 1, JSON.stringify(payload));
|
|
65
73
|
}
|
|
66
74
|
return castPayload;
|
|
67
75
|
}
|
package/package.json
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { AppObject, AppObjectPM, AppObjectRepo } from "../../../AppObject";
|
|
2
|
-
export interface HasNextPreviousStateVM {
|
|
3
|
-
hasNextState: boolean;
|
|
4
|
-
hasPreviousState: boolean;
|
|
5
|
-
}
|
|
6
|
-
export declare class HasNextPreviousStatePM extends AppObjectPM<HasNextPreviousStateVM> {
|
|
7
|
-
static readonly type = "HasNextPreviousStatePM";
|
|
8
|
-
static get: (appObjects: AppObjectRepo) => HasNextPreviousStatePM | undefined;
|
|
9
|
-
private baseAppState?;
|
|
10
|
-
onAppStateChange: () => void;
|
|
11
|
-
vmsAreEqual(a: HasNextPreviousStateVM, b: HasNextPreviousStateVM): boolean;
|
|
12
|
-
dispose(): void;
|
|
13
|
-
constructor(appObject: AppObject);
|
|
14
|
-
}
|
|
15
|
-
export declare const defaultHasNextPreviousStateVM: HasNextPreviousStateVM;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defaultHasNextPreviousStateVM = exports.HasNextPreviousStatePM = void 0;
|
|
4
|
-
const AppObject_1 = require("../../../AppObject");
|
|
5
|
-
const Entity_1 = require("../Entity");
|
|
6
|
-
class HasNextPreviousStatePM extends AppObject_1.AppObjectPM {
|
|
7
|
-
constructor(appObject) {
|
|
8
|
-
super(appObject, HasNextPreviousStatePM.type);
|
|
9
|
-
this.onAppStateChange = () => {
|
|
10
|
-
if (!this.baseAppState)
|
|
11
|
-
return;
|
|
12
|
-
const hasNextState = this.baseAppState.hasNextState;
|
|
13
|
-
const hasPreviousState = this.baseAppState.hasPreviousState;
|
|
14
|
-
const vm = { hasNextState, hasPreviousState };
|
|
15
|
-
this.doUpdateView(vm);
|
|
16
|
-
};
|
|
17
|
-
this.baseAppState = appObject.getComponent(Entity_1.BaseAppState.type);
|
|
18
|
-
if (!this.baseAppState) {
|
|
19
|
-
this.warn("HasNextPreviousStatePM added to an app object that does not have a BaseAppState Entity. Add one first");
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
this.baseAppState.addChangeObserver(this.onAppStateChange);
|
|
23
|
-
this.onAppStateChange();
|
|
24
|
-
}
|
|
25
|
-
vmsAreEqual(a, b) {
|
|
26
|
-
if (a.hasNextState !== b.hasNextState)
|
|
27
|
-
return false;
|
|
28
|
-
if (a.hasPreviousState !== b.hasPreviousState)
|
|
29
|
-
return false;
|
|
30
|
-
return true;
|
|
31
|
-
}
|
|
32
|
-
dispose() {
|
|
33
|
-
var _a;
|
|
34
|
-
super.dispose();
|
|
35
|
-
(_a = this.baseAppState) === null || _a === void 0 ? void 0 : _a.removeChangeObserver(this.onAppStateChange);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.HasNextPreviousStatePM = HasNextPreviousStatePM;
|
|
39
|
-
HasNextPreviousStatePM.type = "HasNextPreviousStatePM";
|
|
40
|
-
HasNextPreviousStatePM.get = (appObjects) => AppObject_1.getSingletonComponent(HasNextPreviousStatePM.type, appObjects);
|
|
41
|
-
exports.defaultHasNextPreviousStateVM = {
|
|
42
|
-
hasNextState: true,
|
|
43
|
-
hasPreviousState: false,
|
|
44
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="jest" />
|
|
2
|
-
import { AppObject, AppObjectRepo } from "../../../AppObject";
|
|
3
|
-
import { ProcessChannelModelUC } from "../UC";
|
|
4
|
-
export declare class ProcessChannelModelUCMock extends ProcessChannelModelUC {
|
|
5
|
-
processChannelModel: jest.Mock<any, any>;
|
|
6
|
-
constructor(appObject: AppObject);
|
|
7
|
-
}
|
|
8
|
-
export declare function makeProcessChannelModelUCMock(appObjects: AppObjectRepo): ProcessChannelModelUCMock;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makeProcessChannelModelUCMock = exports.ProcessChannelModelUCMock = void 0;
|
|
4
|
-
const UC_1 = require("../UC");
|
|
5
|
-
class ProcessChannelModelUCMock extends UC_1.ProcessChannelModelUC {
|
|
6
|
-
constructor(appObject) {
|
|
7
|
-
super(appObject, UC_1.ProcessChannelModelUC.type);
|
|
8
|
-
this.processChannelModel = jest.fn().mockResolvedValue(undefined);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.ProcessChannelModelUCMock = ProcessChannelModelUCMock;
|
|
12
|
-
function makeProcessChannelModelUCMock(appObjects) {
|
|
13
|
-
return new ProcessChannelModelUCMock(appObjects.getOrCreate("ProcessChannelModelUCMock"));
|
|
14
|
-
}
|
|
15
|
-
exports.makeProcessChannelModelUCMock = makeProcessChannelModelUCMock;
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { AppObjectRepo, AppObjectUC } from "../../../AppObject";
|
|
2
|
-
export declare abstract class ProcessChannelModelUC extends AppObjectUC {
|
|
3
|
-
static readonly type: string;
|
|
4
|
-
abstract processChannelModel: (modelAssetID: string) => Promise<void>;
|
|
5
|
-
static get: (appObjects: AppObjectRepo) => ProcessChannelModelUC | undefined;
|
|
6
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProcessChannelModelUC = void 0;
|
|
4
|
-
const AppObject_1 = require("../../../AppObject");
|
|
5
|
-
class ProcessChannelModelUC extends AppObject_1.AppObjectUC {
|
|
6
|
-
}
|
|
7
|
-
exports.ProcessChannelModelUC = ProcessChannelModelUC;
|
|
8
|
-
ProcessChannelModelUC.type = "ProcessChannelModelUC";
|
|
9
|
-
ProcessChannelModelUC.get = (appObjects) => AppObject_1.getSingletonComponent(ProcessChannelModelUC.type, appObjects);
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { 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 SetupChannelModelUC extends AppObjectUC {
|
|
5
|
-
static readonly type: string;
|
|
6
|
-
static readonly SCENE_MODEL_DATA_ASSET_LINK_TYPE = "default_model_data";
|
|
7
|
-
abstract setupChannelModel(modelID: string): Promise<ChannelModelEntity>;
|
|
8
|
-
static get: (appObjects: AppObjectRepo) => SetupChannelModelUC | undefined;
|
|
9
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SetupChannelModelUC = exports.SCENE_MODEL_DATA_ASSET_LINK_TYPE = void 0;
|
|
4
|
-
const AppObject_1 = require("../../../AppObject");
|
|
5
|
-
exports.SCENE_MODEL_DATA_ASSET_LINK_TYPE = "default_model_data";
|
|
6
|
-
class SetupChannelModelUC extends AppObject_1.AppObjectUC {
|
|
7
|
-
}
|
|
8
|
-
exports.SetupChannelModelUC = SetupChannelModelUC;
|
|
9
|
-
SetupChannelModelUC.type = "SetupChannelModelUC";
|
|
10
|
-
SetupChannelModelUC.SCENE_MODEL_DATA_ASSET_LINK_TYPE = "default_model_data";
|
|
11
|
-
SetupChannelModelUC.get = (appObjects) => AppObject_1.getSingletonComponent(SetupChannelModelUC.type, appObjects);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./MockTryShowHoverLabelUC";
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./MockTryShowHoverLabelUC"), exports);
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { AppObject, AppObjectPM } from "../../../AppObject";
|
|
2
|
-
export interface HoverLabelVM {
|
|
3
|
-
show: boolean;
|
|
4
|
-
text: string;
|
|
5
|
-
position: {
|
|
6
|
-
x: number;
|
|
7
|
-
y: number;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
export declare class HoverLabelPM extends AppObjectPM<HoverLabelVM> {
|
|
11
|
-
static readonly type = "HoverLabelPM";
|
|
12
|
-
static addIfMissing(appObj: AppObject): HoverLabelPM;
|
|
13
|
-
private hoverLabelEntity?;
|
|
14
|
-
vmsAreEqual(a: HoverLabelVM, b: HoverLabelVM): boolean;
|
|
15
|
-
onEntityChange: () => void;
|
|
16
|
-
dispose: () => void;
|
|
17
|
-
constructor(appObject: AppObject);
|
|
18
|
-
}
|
|
19
|
-
export declare const defaultHoverLabelVM: HoverLabelVM;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defaultHoverLabelVM = exports.HoverLabelPM = void 0;
|
|
4
|
-
const AppObject_1 = require("../../../AppObject");
|
|
5
|
-
const HoverLabel_1 = require("../Entities/HoverLabel");
|
|
6
|
-
class HoverLabelPM extends AppObject_1.AppObjectPM {
|
|
7
|
-
constructor(appObject) {
|
|
8
|
-
super(appObject, HoverLabelPM.type);
|
|
9
|
-
this.onEntityChange = () => {
|
|
10
|
-
if (!this.hoverLabelEntity)
|
|
11
|
-
return;
|
|
12
|
-
const vm = {
|
|
13
|
-
show: false,
|
|
14
|
-
text: "",
|
|
15
|
-
position: { x: 0, y: 0 },
|
|
16
|
-
};
|
|
17
|
-
if (this.hoverLabelEntity.show) {
|
|
18
|
-
vm.show = true;
|
|
19
|
-
vm.text = this.hoverLabelEntity.label;
|
|
20
|
-
vm.position.x = this.hoverLabelEntity.position.x;
|
|
21
|
-
vm.position.y = this.hoverLabelEntity.position.y;
|
|
22
|
-
}
|
|
23
|
-
this.doUpdateView(vm);
|
|
24
|
-
};
|
|
25
|
-
this.dispose = () => {
|
|
26
|
-
var _a, _b;
|
|
27
|
-
super.dispose();
|
|
28
|
-
(_a = this.hoverLabelEntity) === null || _a === void 0 ? void 0 : _a.removeChangeObserver(this.onEntityChange);
|
|
29
|
-
(_b = this.hoverLabelEntity) === null || _b === void 0 ? void 0 : _b.removeOnDisposeObserver(this.dispose);
|
|
30
|
-
};
|
|
31
|
-
this.hoverLabelEntity = this.appObject.getComponent(HoverLabel_1.HoverLabelEntity.type);
|
|
32
|
-
if (!this.hoverLabelEntity) {
|
|
33
|
-
this.warn("Serializer has been added to an App Object that does not have a HoverLabelEntity. Add the Entity first");
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
this.hoverLabelEntity.addChangeObserver(this.onEntityChange);
|
|
37
|
-
this.hoverLabelEntity.addOnDisposeObserver(() => this.dispose());
|
|
38
|
-
this.onEntityChange();
|
|
39
|
-
}
|
|
40
|
-
static addIfMissing(appObj) {
|
|
41
|
-
const existing = appObj.getComponent(HoverLabelPM.type);
|
|
42
|
-
if (existing) {
|
|
43
|
-
return existing;
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
return new HoverLabelPM(appObj);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
vmsAreEqual(a, b) {
|
|
50
|
-
if (a.show !== b.show)
|
|
51
|
-
return false;
|
|
52
|
-
if (a.text !== b.text)
|
|
53
|
-
return false;
|
|
54
|
-
if (a.position.x !== b.position.x || a.position.y !== b.position.y)
|
|
55
|
-
return false;
|
|
56
|
-
return true;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
exports.HoverLabelPM = HoverLabelPM;
|
|
60
|
-
HoverLabelPM.type = "HoverLabelPM";
|
|
61
|
-
exports.defaultHoverLabelVM = {
|
|
62
|
-
show: false,
|
|
63
|
-
text: "",
|
|
64
|
-
position: { x: 0, y: 0 },
|
|
65
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./MockKeyboardInput";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./MockLandmark";
|