@vived/app 4.22.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/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
|
@@ -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";
|
|
@@ -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("./MockLandmark"), exports);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./MockMouseInput";
|
|
@@ -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("./MockMouseInput"), exports);
|
|
@@ -1,14 +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("./MockQuestionAnswerEntity"), exports);
|
|
14
|
-
__exportStar(require("./MockValidateQuestion"), exports);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./MockAppHandlerEntity";
|
|
@@ -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("./MockAppHandlerEntity"), exports);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { AppObject } from "../../../AppObject/AppObject";
|
|
2
|
-
import { AppObjectController } from "../../../AppObject/AppObjectController";
|
|
3
|
-
import { ZSpaceStylusButton, ZSpaceStylusController } from "../../zSpace/Entities/ZSpaceStylusEntity";
|
|
4
|
-
export declare class StylusMove extends AppObjectController implements ZSpaceStylusController {
|
|
5
|
-
static readonly type = "StylusMove";
|
|
6
|
-
private stylus?;
|
|
7
|
-
private stylusRootMovementUC?;
|
|
8
|
-
private isMoving;
|
|
9
|
-
allow: (button: ZSpaceStylusButton) => boolean;
|
|
10
|
-
onButtonDown: (button: ZSpaceStylusButton) => void;
|
|
11
|
-
onButtonUp: () => void;
|
|
12
|
-
onStylusMove: () => void;
|
|
13
|
-
constructor(appObject: AppObject);
|
|
14
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StylusMove = void 0;
|
|
4
|
-
const AppObjectController_1 = require("../../../AppObject/AppObjectController");
|
|
5
|
-
const ZSpaceStylusEntity_1 = require("../../zSpace/Entities/ZSpaceStylusEntity");
|
|
6
|
-
const StylusMoveTransformUC_1 = require("../../Transform3D/UC/StylusMoveTransformUC");
|
|
7
|
-
const zSpace_1 = require("../../zSpace");
|
|
8
|
-
class StylusMove extends AppObjectController_1.AppObjectController {
|
|
9
|
-
constructor(appObject) {
|
|
10
|
-
super(appObject, StylusMove.type);
|
|
11
|
-
this.isMoving = false;
|
|
12
|
-
this.allow = (button) => {
|
|
13
|
-
if (button === ZSpaceStylusEntity_1.ZSpaceStylusButton.PRIMARY)
|
|
14
|
-
return true;
|
|
15
|
-
return false;
|
|
16
|
-
};
|
|
17
|
-
this.onButtonDown = (button) => {
|
|
18
|
-
var _a;
|
|
19
|
-
this.isMoving = false;
|
|
20
|
-
if (!this.stylus)
|
|
21
|
-
return;
|
|
22
|
-
if (!this.allow(button))
|
|
23
|
-
return;
|
|
24
|
-
(_a = this.stylusRootMovementUC) === null || _a === void 0 ? void 0 : _a.initialize();
|
|
25
|
-
this.isMoving = true;
|
|
26
|
-
};
|
|
27
|
-
this.onButtonUp = () => {
|
|
28
|
-
var _a;
|
|
29
|
-
this.isMoving = true;
|
|
30
|
-
if (!this.stylus)
|
|
31
|
-
return;
|
|
32
|
-
(_a = this.stylusRootMovementUC) === null || _a === void 0 ? void 0 : _a.stop();
|
|
33
|
-
};
|
|
34
|
-
this.onStylusMove = () => {
|
|
35
|
-
var _a;
|
|
36
|
-
if (!this.stylus || !this.isMoving)
|
|
37
|
-
return;
|
|
38
|
-
(_a = this.stylusRootMovementUC) === null || _a === void 0 ? void 0 : _a.move();
|
|
39
|
-
};
|
|
40
|
-
const zSpaceEntity = zSpace_1.ZSpaceEntity.get(this.appObject.appObjectRepo);
|
|
41
|
-
if (!zSpaceEntity) {
|
|
42
|
-
this.warn("Unable to find ZSpaceEntity");
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
this.stylus = zSpaceEntity.stylus;
|
|
46
|
-
this.stylusRootMovementUC = appObject.getComponent(StylusMoveTransformUC_1.StylusMoveTransformUC.type);
|
|
47
|
-
if (!this.stylusRootMovementUC) {
|
|
48
|
-
this.warn("StylusMoveSceneRoot has been added to an App Object that does not have a StylusMoveTransformUC");
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
this.stylus.registerController(this);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
exports.StylusMove = StylusMove;
|
|
56
|
-
StylusMove.type = "StylusMove";
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { AppObject } from "../../../AppObject/AppObject";
|
|
2
|
-
import { AppObjectController } from "../../../AppObject/AppObjectController";
|
|
3
|
-
import { ZSpaceStylusButton, ZSpaceStylusController } from "../../zSpace/Entities/ZSpaceStylusEntity";
|
|
4
|
-
export declare class StylusScale extends AppObjectController implements ZSpaceStylusController {
|
|
5
|
-
static readonly type = "ZSpaceScaleRoot";
|
|
6
|
-
private stylus?;
|
|
7
|
-
private scaleSceneRootWithRay?;
|
|
8
|
-
private isScaling;
|
|
9
|
-
allow: (button: ZSpaceStylusButton) => boolean;
|
|
10
|
-
onButtonDown: (button: ZSpaceStylusButton) => void;
|
|
11
|
-
onStylusMove: () => void;
|
|
12
|
-
onButtonUp: () => void;
|
|
13
|
-
constructor(appObject: AppObject);
|
|
14
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StylusScale = void 0;
|
|
4
|
-
const AppObjectController_1 = require("../../../AppObject/AppObjectController");
|
|
5
|
-
const ScaleSceneRootWithRay_1 = require("../UC/ScaleSceneRootWithRay");
|
|
6
|
-
const ZSpaceStylusEntity_1 = require("../../zSpace/Entities/ZSpaceStylusEntity");
|
|
7
|
-
const zSpace_1 = require("../../zSpace");
|
|
8
|
-
class StylusScale extends AppObjectController_1.AppObjectController {
|
|
9
|
-
constructor(appObject) {
|
|
10
|
-
super(appObject, StylusScale.type);
|
|
11
|
-
this.isScaling = false;
|
|
12
|
-
this.allow = (button) => {
|
|
13
|
-
if (button === ZSpaceStylusEntity_1.ZSpaceStylusButton.BACK_RIGHT)
|
|
14
|
-
return true;
|
|
15
|
-
return false;
|
|
16
|
-
};
|
|
17
|
-
this.onButtonDown = (button) => {
|
|
18
|
-
var _a;
|
|
19
|
-
this.isScaling = false;
|
|
20
|
-
if (!this.stylus)
|
|
21
|
-
return;
|
|
22
|
-
if (!this.allow(button))
|
|
23
|
-
return;
|
|
24
|
-
const pointerRay = this.stylus.pickRay;
|
|
25
|
-
const rayStart = this.stylus.transform.localPosition;
|
|
26
|
-
(_a = this.scaleSceneRootWithRay) === null || _a === void 0 ? void 0 : _a.initializeScale(pointerRay, rayStart);
|
|
27
|
-
this.isScaling = true;
|
|
28
|
-
};
|
|
29
|
-
this.onStylusMove = () => {
|
|
30
|
-
var _a;
|
|
31
|
-
if (!this.stylus)
|
|
32
|
-
return;
|
|
33
|
-
if (!this.isScaling)
|
|
34
|
-
return;
|
|
35
|
-
const pointerRay = this.stylus.pickRay;
|
|
36
|
-
const rayStart = this.stylus.transform.localPosition;
|
|
37
|
-
(_a = this.scaleSceneRootWithRay) === null || _a === void 0 ? void 0 : _a.doScale(pointerRay, rayStart);
|
|
38
|
-
};
|
|
39
|
-
this.onButtonUp = () => {
|
|
40
|
-
this.isScaling = false;
|
|
41
|
-
};
|
|
42
|
-
const zSpaceEntity = zSpace_1.ZSpaceEntity.get(this.appObject.appObjectRepo);
|
|
43
|
-
if (!zSpaceEntity) {
|
|
44
|
-
this.warn("Unable to find ZSpaceEntity");
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
this.stylus = zSpaceEntity.stylus;
|
|
48
|
-
this.scaleSceneRootWithRay = appObject.getComponent(ScaleSceneRootWithRay_1.ScaleSceneRootWithRay.type);
|
|
49
|
-
if (!this.scaleSceneRootWithRay) {
|
|
50
|
-
this.warn("StylusMoveSceneRoot has been added to an App Object that does not have a scaleSceneRootWithRay");
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
this.stylus.registerController(this);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
exports.StylusScale = StylusScale;
|
|
58
|
-
StylusScale.type = "ZSpaceScaleRoot";
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { AppObject } from "../../../AppObject/AppObject";
|
|
2
|
-
import { AppObjectController } from "../../../AppObject/AppObjectController";
|
|
3
|
-
import { ZSpaceStylusController } from "../../zSpace/Entities/ZSpaceStylusEntity";
|
|
4
|
-
export declare class StylusHoverOnAppObject extends AppObjectController implements ZSpaceStylusController {
|
|
5
|
-
static readonly type = "StylusHoverOnAppObject";
|
|
6
|
-
private stylus?;
|
|
7
|
-
private hoverUC?;
|
|
8
|
-
allow: () => boolean;
|
|
9
|
-
onStylusMove: () => void;
|
|
10
|
-
constructor(appObject: AppObject);
|
|
11
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StylusHoverOnAppObject = void 0;
|
|
4
|
-
const AppObjectController_1 = require("../../../AppObject/AppObjectController");
|
|
5
|
-
const ZSpaceEntity_1 = require("../../zSpace/Entities/ZSpaceEntity");
|
|
6
|
-
const HoverAppObjectUC_1 = require("../UC/HoverAppObjectUC");
|
|
7
|
-
class StylusHoverOnAppObject extends AppObjectController_1.AppObjectController {
|
|
8
|
-
constructor(appObject) {
|
|
9
|
-
super(appObject, StylusHoverOnAppObject.type);
|
|
10
|
-
this.allow = () => {
|
|
11
|
-
return true;
|
|
12
|
-
};
|
|
13
|
-
this.onStylusMove = () => {
|
|
14
|
-
if (!this.stylus)
|
|
15
|
-
return;
|
|
16
|
-
if (!this.hoverUC)
|
|
17
|
-
return;
|
|
18
|
-
if (!this.allow())
|
|
19
|
-
return;
|
|
20
|
-
const pointerRay = this.stylus.pickRay;
|
|
21
|
-
this.hoverUC.tryHoverSceneObject(pointerRay);
|
|
22
|
-
};
|
|
23
|
-
const zSpaceEntity = ZSpaceEntity_1.ZSpaceEntity.get(this.appObjects);
|
|
24
|
-
if (!zSpaceEntity) {
|
|
25
|
-
this.warn("Unable to find ZSpaceEntity");
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
this.stylus = zSpaceEntity.stylus;
|
|
29
|
-
this.hoverUC = appObject.getComponent(HoverAppObjectUC_1.HoverAppObjectUC.type);
|
|
30
|
-
if (!this.stylus) {
|
|
31
|
-
console.warn("StylusInputPointer Controller has been added to an app object that does not have a ZSpaceStylusEntity");
|
|
32
|
-
}
|
|
33
|
-
else if (!this.hoverUC) {
|
|
34
|
-
console.warn("HoverAppObjectUC has not been found on any objects in the app object repo");
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
this.stylus.registerController(this);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
exports.StylusHoverOnAppObject = StylusHoverOnAppObject;
|
|
42
|
-
StylusHoverOnAppObject.type = "StylusHoverOnAppObject";
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { AppObject } from "../../../AppObject/AppObject";
|
|
2
|
-
import { AppObjectController } from "../../../AppObject/AppObjectController";
|
|
3
|
-
import { ZSpaceStylusButton, ZSpaceStylusController } from "../../zSpace/Entities/ZSpaceStylusEntity";
|
|
4
|
-
export declare class StylusPressOnAppObject extends AppObjectController implements ZSpaceStylusController {
|
|
5
|
-
static readonly type = "StylusPressOnAppObject";
|
|
6
|
-
static readonly maxTapDistancePx = 5;
|
|
7
|
-
private stylus?;
|
|
8
|
-
private pressUC?;
|
|
9
|
-
private startPosition;
|
|
10
|
-
private endPosition;
|
|
11
|
-
private pressedID;
|
|
12
|
-
private isPressed;
|
|
13
|
-
allow: (button: ZSpaceStylusButton) => boolean;
|
|
14
|
-
onButtonDown: (button: ZSpaceStylusButton) => void;
|
|
15
|
-
onButtonUp: (button: ZSpaceStylusButton) => void;
|
|
16
|
-
onStylusMove: () => void;
|
|
17
|
-
constructor(appObject: AppObject);
|
|
18
|
-
}
|