@vived/app 4.31.0 → 4.32.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/BaseApp/Factories/setupBaseApp.d.ts +2 -2
- package/lib/Components/BaseApp/Factories/setupBaseApp.js +1 -0
- package/lib/Components/ChannelModel/UC/SelectChannelModelUC.js +7 -0
- package/lib/Components/InspectorTab/Controllers/KeyboardToSetTab.d.ts +10 -0
- package/lib/Components/InspectorTab/Controllers/KeyboardToSetTab.js +45 -0
- package/lib/Components/InspectorTab/Controllers/index.d.ts +1 -0
- package/lib/Components/InspectorTab/Controllers/index.js +1 -0
- package/lib/Components/InspectorTab/Factories/setupInspectorTabs.js +5 -0
- package/lib/Components/MouseInput/index.d.ts +1 -0
- package/lib/Components/MouseInput/index.js +1 -0
- package/lib/Components/SceneRoot/Controllers/DoubleTapToFocus.d.ts +1 -1
- package/lib/Components/SceneRoot/Controllers/DoubleTapToFocus.js +3 -5
- package/lib/Components/SceneRoot/Controllers/MouseClickToFocus.d.ts +1 -1
- package/lib/Components/SceneRoot/Controllers/MouseClickToFocus.js +6 -5
- package/lib/Components/SceneRoot/Controllers/MouseDoubleClickToRecenter.d.ts +1 -1
- package/lib/Components/SceneRoot/Controllers/MouseDoubleClickToRecenter.js +3 -5
- package/lib/Components/SceneRoot/Controllers/MouseOrbit.d.ts +2 -1
- package/lib/Components/SceneRoot/Controllers/MouseOrbit.js +19 -6
- package/lib/Components/SceneRoot/Controllers/MousePan.d.ts +2 -1
- package/lib/Components/SceneRoot/Controllers/MousePan.js +19 -6
- package/lib/Components/SceneRoot/Controllers/MouseRoll.d.ts +1 -1
- package/lib/Components/SceneRoot/Controllers/MouseRoll.js +3 -5
- package/lib/Components/SceneRoot/Controllers/MouseScale.d.ts +2 -1
- package/lib/Components/SceneRoot/Controllers/MouseScale.js +16 -6
- package/lib/Components/SceneRoot/Controllers/ScaleSceneRootSC.d.ts +2 -2
- package/lib/Components/SceneRoot/Controllers/ScaleSceneRootSC.js +8 -11
- package/lib/Components/SceneRoot/Controllers/SceneRootMoveSC.d.ts +2 -2
- package/lib/Components/SceneRoot/Controllers/SceneRootMoveSC.js +9 -12
- package/lib/Components/SceneRoot/Controllers/TouchOrbit.d.ts +3 -1
- package/lib/Components/SceneRoot/Controllers/TouchOrbit.js +24 -6
- package/lib/Components/SceneRoot/Controllers/TouchPan.d.ts +3 -1
- package/lib/Components/SceneRoot/Controllers/TouchPan.js +24 -6
- package/lib/Components/SceneRoot/Controllers/TouchPinch.d.ts +2 -2
- package/lib/Components/SceneRoot/Controllers/TouchPinch.js +12 -6
- package/lib/Components/SceneRoot/Controllers/TouchScale.d.ts +2 -2
- package/lib/Components/SceneRoot/Controllers/TouchScale.js +16 -5
- package/lib/Components/SceneRoot/Factories/index.d.ts +1 -0
- package/lib/Components/SceneRoot/Factories/index.js +13 -0
- package/lib/Components/SceneRoot/Factories/setupSceneRoot.d.ts +3 -0
- package/lib/Components/SceneRoot/Factories/setupSceneRoot.js +45 -0
- package/lib/Components/SceneRoot/Mocks/MockDragScaleSceneRootUC.d.ts +9 -0
- package/lib/Components/SceneRoot/Mocks/MockDragScaleSceneRootUC.js +13 -0
- package/lib/Components/SceneRoot/Mocks/MockFocusOnPixelUC.d.ts +10 -0
- package/lib/Components/SceneRoot/Mocks/MockFocusOnPixelUC.js +15 -0
- package/lib/Components/SceneRoot/Mocks/MockOrbitSceneRootUC.d.ts +11 -0
- package/lib/Components/SceneRoot/Mocks/MockOrbitSceneRootUC.js +15 -0
- package/lib/Components/SceneRoot/Mocks/MockPanSceneRootUC.d.ts +10 -0
- package/lib/Components/SceneRoot/Mocks/MockPanSceneRootUC.js +14 -0
- package/lib/Components/SceneRoot/Mocks/MockPinchSceneRootUC.d.ts +10 -0
- package/lib/Components/SceneRoot/Mocks/MockPinchSceneRootUC.js +14 -0
- package/lib/Components/SceneRoot/Mocks/index.d.ts +5 -2
- package/lib/Components/SceneRoot/Mocks/index.js +5 -2
- package/lib/Components/SceneRoot/UC/CenterSceneRootOnPixelPick.js +1 -1
- package/lib/Components/SceneRoot/UC/FocusOnPixel.js +1 -1
- package/lib/Components/SceneRoot/index.d.ts +3 -1
- package/lib/Components/SceneRoot/index.js +3 -1
- package/lib/Components/Selection/Controller/index.d.ts +1 -0
- package/lib/Components/Selection/Controller/index.js +1 -0
- package/lib/Components/Selection/index.d.ts +1 -0
- package/lib/Components/Selection/index.js +1 -0
- package/lib/Components/Stick/UCs/TryStickAppObjectUC.js +10 -0
- package/lib/Components/StoredView/PM/HasStoredViewPM.js +7 -9
- package/lib/Components/StoredView/UC/ClearStoredViewUC.d.ts +0 -1
- package/lib/Components/StoredView/UC/ClearStoredViewUC.js +4 -15
- package/lib/Components/StoredView/UC/RestoreStoredViewUC.d.ts +0 -1
- package/lib/Components/StoredView/UC/RestoreStoredViewUC.js +8 -22
- package/lib/Components/StoredView/UC/SerializeStoredView.js +3 -6
- package/lib/Components/StoredView/UC/SetInXRUC.d.ts +0 -1
- package/lib/Components/StoredView/UC/SetInXRUC.js +4 -15
- package/lib/Components/StoredView/UC/StoreCurrentViewUC.d.ts +0 -1
- package/lib/Components/StoredView/UC/StoreCurrentViewUC.js +7 -19
- package/lib/Components/StoredView/index.d.ts +3 -0
- package/lib/Components/StoredView/index.js +3 -0
- package/lib/Components/Tools/Adapters/toolAdapter.d.ts +1 -1
- package/lib/Components/Tools/Adapters/toolAdapter.js +16 -23
- package/lib/Components/Tools/Controller/ToolHotkeys.d.ts +1 -1
- package/lib/Components/Tools/Controller/triggerTool.d.ts +1 -1
- package/lib/Components/Tools/Entities/ToolEntity.d.ts +7 -7
- package/lib/Components/Tools/Entities/ToolEntity.js +1 -2
- package/lib/Components/Tools/Entities/ToolRepository.d.ts +12 -11
- package/lib/Components/Tools/Entities/ToolRepository.js +30 -26
- package/lib/Components/Tools/Mocks/MockToolRepo.d.ts +17 -0
- package/lib/Components/Tools/Mocks/MockToolRepo.js +28 -0
- package/lib/Components/Tools/Mocks/ToolPMMock.d.ts +2 -2
- package/lib/Components/Tools/Mocks/index.d.ts +1 -0
- package/lib/Components/Tools/Mocks/index.js +1 -0
- package/lib/Components/Tools/PM/ToolPM.d.ts +6 -6
- package/lib/Components/Tools/index.d.ts +1 -0
- package/lib/Components/Tools/index.js +1 -0
- package/lib/Components/TouchController/index.d.ts +1 -0
- package/lib/Components/TouchController/index.js +1 -0
- package/lib/Components/UndoRedo/index.d.ts +3 -1
- package/lib/Components/UndoRedo/index.js +3 -1
- package/lib/Components/index.d.ts +1 -0
- package/lib/Components/index.js +1 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.makeRestoreStoredViewUC = exports.RestoreStoredViewUC = void 0;
|
|
4
4
|
const AppObject_1 = require("../../../AppObject");
|
|
5
5
|
const Utilities_1 = require("../../../Utilities");
|
|
6
6
|
const ValueObjects_1 = require("../../../ValueObjects");
|
|
@@ -15,20 +15,10 @@ function makeRestoreStoredViewUC(appObject) {
|
|
|
15
15
|
return new RestoreStoredViewUCImp(appObject);
|
|
16
16
|
}
|
|
17
17
|
exports.makeRestoreStoredViewUC = makeRestoreStoredViewUC;
|
|
18
|
-
function restoreStoredView(appObjects) {
|
|
19
|
-
const uc = RestoreStoredViewUC.get(appObjects);
|
|
20
|
-
if (uc) {
|
|
21
|
-
uc.restoreStoredView();
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
appObjects.submitWarning("restoreStoredView", "Can't find ClearStoredViewUC");
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
exports.restoreStoredView = restoreStoredView;
|
|
28
18
|
class RestoreStoredViewUCImp extends RestoreStoredViewUC {
|
|
29
19
|
constructor(appObject) {
|
|
30
20
|
super(appObject, RestoreStoredViewUC.type);
|
|
31
|
-
this.ease = Utilities_1.
|
|
21
|
+
this.ease = Utilities_1.cubicInOut;
|
|
32
22
|
this.restoreStoredView = () => {
|
|
33
23
|
if (this.storedView && this.sceneRoot) {
|
|
34
24
|
if (!this.storedView.hasStoredView)
|
|
@@ -47,15 +37,11 @@ class RestoreStoredViewUCImp extends RestoreStoredViewUC {
|
|
|
47
37
|
this.warn("Missing necessary entities");
|
|
48
38
|
}
|
|
49
39
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
this.
|
|
56
|
-
if (!this.storedView) {
|
|
57
|
-
this.error("Unable to find stored view");
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
40
|
+
}
|
|
41
|
+
get storedView() {
|
|
42
|
+
return this.getCachedSingleton(Entities_1.StoredView.type);
|
|
43
|
+
}
|
|
44
|
+
get sceneRoot() {
|
|
45
|
+
return this.getCachedSingleton(SceneRoot_1.SceneRootEntity.type);
|
|
60
46
|
}
|
|
61
47
|
}
|
|
@@ -21,12 +21,6 @@ class SerializeStoredViewImp extends SerializeStoredView {
|
|
|
21
21
|
constructor(appObject) {
|
|
22
22
|
super(appObject, SerializeStoredView.type);
|
|
23
23
|
this.seriliziationVersion = 1;
|
|
24
|
-
this.storedView = appObject.getComponent(StoredView_1.StoredView.type);
|
|
25
|
-
if (!this.storedView) {
|
|
26
|
-
console.warn("SerializeStoredView UC has been added to an App Object that does not have a StoredView Entity. Add one before adding the UC");
|
|
27
|
-
this.dispose();
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
24
|
const stateMachine = StateMachineEntity_1.StateMachineEntity.get(appObject.appObjectRepo);
|
|
31
25
|
if (stateMachine) {
|
|
32
26
|
stateMachine.registerSerializedSystem(this);
|
|
@@ -35,6 +29,9 @@ class SerializeStoredViewImp extends SerializeStoredView {
|
|
|
35
29
|
this.warn("Unable to find StateMachineEntity");
|
|
36
30
|
}
|
|
37
31
|
}
|
|
32
|
+
get storedView() {
|
|
33
|
+
return this.getCachedSingleton(StoredView_1.StoredView.type);
|
|
34
|
+
}
|
|
38
35
|
getSystemState() {
|
|
39
36
|
if (!this.storedView) {
|
|
40
37
|
console.warn("[SerializeStoredView] No stored view entity");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.makeSetViewInXRUC = exports.SetViewInXRUC = void 0;
|
|
4
4
|
const AppObject_1 = require("../../../AppObject");
|
|
5
5
|
const Dispatcher_1 = require("../../Dispatcher");
|
|
6
6
|
class SetViewInXRUC extends AppObject_1.AppObjectUC {
|
|
@@ -12,16 +12,6 @@ function makeSetViewInXRUC(appObject) {
|
|
|
12
12
|
return new SetViewInXRUCImp(appObject);
|
|
13
13
|
}
|
|
14
14
|
exports.makeSetViewInXRUC = makeSetViewInXRUC;
|
|
15
|
-
function setViewInXR(appObjects) {
|
|
16
|
-
const uc = SetViewInXRUC.get(appObjects);
|
|
17
|
-
if (uc) {
|
|
18
|
-
uc.setViewInXR();
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
appObjects.submitWarning("setViewInXR", "Can't find ClearStoredViewUC");
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.setViewInXR = setViewInXR;
|
|
25
15
|
class SetViewInXRUCImp extends SetViewInXRUC {
|
|
26
16
|
constructor(appObject) {
|
|
27
17
|
super(appObject, SetViewInXRUC.type);
|
|
@@ -33,9 +23,8 @@ class SetViewInXRUCImp extends SetViewInXRUC {
|
|
|
33
23
|
this.warn("Missing necessary entities");
|
|
34
24
|
}
|
|
35
25
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
26
|
+
}
|
|
27
|
+
get dispatchStartZSpace() {
|
|
28
|
+
return this.getCachedSingleton(Dispatcher_1.DispatchStartZSpaceUC.type);
|
|
40
29
|
}
|
|
41
30
|
}
|
|
@@ -5,4 +5,3 @@ export declare abstract class StoreCurrentViewUC extends AppObjectUC {
|
|
|
5
5
|
abstract storeCurrentView(): void;
|
|
6
6
|
}
|
|
7
7
|
export declare function makeStoreCurrentViewUC(appObject: AppObject): StoreCurrentViewUC;
|
|
8
|
-
export declare function storeCurrentView(appObjects: AppObjectRepo): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.makeStoreCurrentViewUC = exports.StoreCurrentViewUC = void 0;
|
|
4
4
|
const AppObject_1 = require("../../../AppObject");
|
|
5
5
|
const Dispatcher_1 = require("../../Dispatcher");
|
|
6
6
|
const SceneRoot_1 = require("../../SceneRoot");
|
|
@@ -14,16 +14,6 @@ function makeStoreCurrentViewUC(appObject) {
|
|
|
14
14
|
return new StoreCurrentViewUCImp(appObject);
|
|
15
15
|
}
|
|
16
16
|
exports.makeStoreCurrentViewUC = makeStoreCurrentViewUC;
|
|
17
|
-
function storeCurrentView(appObjects) {
|
|
18
|
-
const uc = StoreCurrentViewUC.get(appObjects);
|
|
19
|
-
if (uc) {
|
|
20
|
-
uc.storeCurrentView();
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
appObjects.submitWarning("storeCurrentView", "Can't find StoreCurrentViewUC");
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.storeCurrentView = storeCurrentView;
|
|
27
17
|
class StoreCurrentViewUCImp extends StoreCurrentViewUC {
|
|
28
18
|
constructor(appObject) {
|
|
29
19
|
super(appObject, StoreCurrentViewUC.type);
|
|
@@ -36,13 +26,11 @@ class StoreCurrentViewUCImp extends StoreCurrentViewUC {
|
|
|
36
26
|
this.storedView.hasStoredView = true;
|
|
37
27
|
Dispatcher_1.dispatchStateChange(this.appObject.appObjectRepo);
|
|
38
28
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
this.error("Unable to find stored view");
|
|
46
|
-
}
|
|
29
|
+
}
|
|
30
|
+
get storedView() {
|
|
31
|
+
return this.getCachedSingleton(Entities_1.StoredView.type);
|
|
32
|
+
}
|
|
33
|
+
get sceneRoot() {
|
|
34
|
+
return this.getCachedSingleton(SceneRoot_1.SceneRootEntity.type);
|
|
47
35
|
}
|
|
48
36
|
}
|
|
@@ -10,6 +10,9 @@ 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("./Adapters"), exports);
|
|
14
|
+
__exportStar(require("./Controllers"), exports);
|
|
13
15
|
__exportStar(require("./Entities"), exports);
|
|
16
|
+
__exportStar(require("./Factories"), exports);
|
|
14
17
|
__exportStar(require("./PM"), exports);
|
|
15
18
|
__exportStar(require("./UC"), exports);
|
|
@@ -1,26 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.toolAdapter = void 0;
|
|
4
4
|
const ToolPM_1 = require("../PM/ToolPM");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
pm.removeView(setVM);
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
exports.makeToolAdapter = makeToolAdapter;
|
|
5
|
+
exports.toolAdapter = {
|
|
6
|
+
defaultVM: ToolPM_1.defaultToolVM,
|
|
7
|
+
subscribe: (id, appObjects, setVM) => {
|
|
8
|
+
const pm = ToolPM_1.ToolPM.get(id, appObjects);
|
|
9
|
+
if (!pm) {
|
|
10
|
+
appObjects.submitError("toolAdapter", "Unable to find ToolPM");
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
pm.addView(setVM);
|
|
14
|
+
},
|
|
15
|
+
unsubscribe: (id, appObjects, setVM) => {
|
|
16
|
+
var _a;
|
|
17
|
+
(_a = ToolPM_1.ToolPM.get(id, appObjects)) === null || _a === void 0 ? void 0 : _a.removeView(setVM);
|
|
18
|
+
},
|
|
19
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AppObject } from "../../../AppObject/AppObject";
|
|
2
2
|
import { AppObjectController } from "../../../AppObject/AppObjectController";
|
|
3
3
|
import { KeyboardController } from "../../KeyboardInput";
|
|
4
|
-
export declare class ToolHotkeys
|
|
4
|
+
export declare class ToolHotkeys extends AppObjectController implements KeyboardController {
|
|
5
5
|
static readonly type = "ToolHotkeys";
|
|
6
6
|
private toolRepo?;
|
|
7
7
|
onKeyDown: (e: KeyboardEvent) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { AppObjectRepo } from "../../../AppObject/AppObjectRepo";
|
|
2
|
-
export declare function triggerTool
|
|
2
|
+
export declare function triggerTool(toolType: string, appObjects: AppObjectRepo): void;
|
|
@@ -7,8 +7,8 @@ export declare enum ToolState {
|
|
|
7
7
|
ENABLED = "ENABLED",
|
|
8
8
|
ACTIVE = "ACTIVE"
|
|
9
9
|
}
|
|
10
|
-
export interface ToolData
|
|
11
|
-
toolType:
|
|
10
|
+
export interface ToolData {
|
|
11
|
+
toolType: string;
|
|
12
12
|
isDefault: boolean;
|
|
13
13
|
label: string;
|
|
14
14
|
shortcutLabel: string;
|
|
@@ -21,9 +21,9 @@ export interface HotKey {
|
|
|
21
21
|
meta?: boolean;
|
|
22
22
|
alt?: boolean;
|
|
23
23
|
}
|
|
24
|
-
export declare abstract class ToolEntity
|
|
24
|
+
export declare abstract class ToolEntity extends AppObjectEntity {
|
|
25
25
|
static readonly type = "TOOL";
|
|
26
|
-
abstract get toolType():
|
|
26
|
+
abstract get toolType(): string | undefined;
|
|
27
27
|
abstract get label(): string;
|
|
28
28
|
abstract set label(toolLabel: string);
|
|
29
29
|
abstract readonly isDefault: boolean;
|
|
@@ -36,7 +36,7 @@ export declare abstract class ToolEntity<ToolTypes> extends AppObjectEntity {
|
|
|
36
36
|
abstract triggerActions(): void;
|
|
37
37
|
abstract registerAction(action: () => void): void;
|
|
38
38
|
abstract isMyHotkey(hotkey: HotKey): boolean;
|
|
39
|
-
abstract setupFromData(data: ToolData
|
|
40
|
-
static get
|
|
39
|
+
abstract setupFromData(data: ToolData): void;
|
|
40
|
+
static get(id: string, appObjects: AppObjectRepo): ToolEntity | undefined;
|
|
41
41
|
}
|
|
42
|
-
export declare function makeToolEntity
|
|
42
|
+
export declare function makeToolEntity(appObject: AppObject): ToolEntity;
|
|
@@ -13,8 +13,7 @@ var ToolState;
|
|
|
13
13
|
class ToolEntity extends AppObjectEntity_1.AppObjectEntity {
|
|
14
14
|
static get(id, appObjects) {
|
|
15
15
|
var _a;
|
|
16
|
-
return (_a = appObjects
|
|
17
|
-
.get(id)) === null || _a === void 0 ? void 0 : _a.getComponent(ToolEntity.type);
|
|
16
|
+
return (_a = appObjects.get(id)) === null || _a === void 0 ? void 0 : _a.getComponent(ToolEntity.type);
|
|
18
17
|
}
|
|
19
18
|
}
|
|
20
19
|
exports.ToolEntity = ToolEntity;
|
|
@@ -2,17 +2,18 @@ import { AppObject } from "../../../AppObject/AppObject";
|
|
|
2
2
|
import { AppObjectEntity } from "../../../AppObject/AppObjectEntity";
|
|
3
3
|
import { AppObjectRepo } from "../../../AppObject/AppObjectRepo";
|
|
4
4
|
import { HotKey, ToolData, ToolEntity } from "./ToolEntity";
|
|
5
|
-
export declare abstract class ToolRepository
|
|
5
|
+
export declare abstract class ToolRepository extends AppObjectEntity {
|
|
6
6
|
static readonly type = "TOOL_REPOSITORY";
|
|
7
|
-
abstract get activeTool(): ToolEntity
|
|
8
|
-
abstract get allTools(): ToolEntity
|
|
9
|
-
abstract setupToolsFromData(toolData: ToolData
|
|
10
|
-
abstract getTool(toolType:
|
|
11
|
-
abstract getToolForHotkey(hotkey: HotKey): ToolEntity
|
|
7
|
+
abstract get activeTool(): ToolEntity | undefined;
|
|
8
|
+
abstract get allTools(): ToolEntity[];
|
|
9
|
+
abstract setupToolsFromData(toolData: ToolData[]): void;
|
|
10
|
+
abstract getTool(toolType: string): ToolEntity | undefined;
|
|
11
|
+
abstract getToolForHotkey(hotkey: HotKey): ToolEntity | undefined;
|
|
12
12
|
abstract setDefaultToolActive(): void;
|
|
13
|
-
abstract triggerTool(toolType:
|
|
14
|
-
abstract toggleToolVisibility(toolType:
|
|
15
|
-
abstract toolFactory: (
|
|
16
|
-
|
|
13
|
+
abstract triggerTool(toolType: string): void;
|
|
14
|
+
abstract toggleToolVisibility(toolType: string): void;
|
|
15
|
+
abstract toolFactory: (id: string) => ToolEntity;
|
|
16
|
+
abstract makeTool(id: string): ToolEntity;
|
|
17
|
+
static get: (appObjects: AppObjectRepo) => ToolRepository | undefined;
|
|
17
18
|
}
|
|
18
|
-
export declare function makeToolRepo
|
|
19
|
+
export declare function makeToolRepo(appObject: AppObject): ToolRepository;
|
|
@@ -17,10 +17,9 @@ class ToolRepositoryImp extends ToolRepository {
|
|
|
17
17
|
constructor(appObject) {
|
|
18
18
|
super(appObject, ToolRepository.type);
|
|
19
19
|
this.toolLookup = new Map();
|
|
20
|
-
this.toolFactory = (
|
|
21
|
-
const ao = this.appObjects.getOrCreate(
|
|
20
|
+
this.toolFactory = (id) => {
|
|
21
|
+
const ao = this.appObjects.getOrCreate(id + "_tool");
|
|
22
22
|
const toolEntity = ToolEntity_1.makeToolEntity(ao);
|
|
23
|
-
toolEntity.setupFromData(toolData);
|
|
24
23
|
return toolEntity;
|
|
25
24
|
};
|
|
26
25
|
}
|
|
@@ -35,29 +34,6 @@ class ToolRepositoryImp extends ToolRepository {
|
|
|
35
34
|
this.warn(`No default tools has been specified`);
|
|
36
35
|
}
|
|
37
36
|
}
|
|
38
|
-
setupToolsFromData(toolDatas) {
|
|
39
|
-
toolDatas.forEach((toolData) => {
|
|
40
|
-
const toolType = toolData.toolType;
|
|
41
|
-
if (this.toolLookup.has(toolType)) {
|
|
42
|
-
this.warn(`A tool with the ID ${toolData.toolType} already exists. Replacing`);
|
|
43
|
-
}
|
|
44
|
-
const tool = this.toolFactory(toolData);
|
|
45
|
-
this.toolLookup.set(toolType, tool);
|
|
46
|
-
if (toolData.isDefault) {
|
|
47
|
-
if (this._defaultToolType) {
|
|
48
|
-
this.warn(`More than one tools is marked as default. Replacing`);
|
|
49
|
-
}
|
|
50
|
-
this._defaultToolType = toolType;
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
if (!this._defaultToolType) {
|
|
54
|
-
this.warn(`No default tools was specified. Defaulting to the first tool in the list`);
|
|
55
|
-
this._defaultToolType = Array.from(this.toolLookup.keys())[0];
|
|
56
|
-
}
|
|
57
|
-
if (this._defaultToolType) {
|
|
58
|
-
this.triggerTool(this._defaultToolType);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
37
|
getTool(type) {
|
|
62
38
|
return this.toolLookup.get(type);
|
|
63
39
|
}
|
|
@@ -124,4 +100,32 @@ class ToolRepositoryImp extends ToolRepository {
|
|
|
124
100
|
tool.state = ToolEntity_1.ToolState.HIDDEN;
|
|
125
101
|
}
|
|
126
102
|
}
|
|
103
|
+
makeTool(id) {
|
|
104
|
+
const tool = this.toolFactory(id);
|
|
105
|
+
if (this.toolLookup.has(id)) {
|
|
106
|
+
this.warn(`A tool with the ID ${id} already exists. Replacing`);
|
|
107
|
+
}
|
|
108
|
+
this.toolLookup.set(id, tool);
|
|
109
|
+
return tool;
|
|
110
|
+
}
|
|
111
|
+
setupToolsFromData(toolDatas) {
|
|
112
|
+
toolDatas.forEach((toolData) => {
|
|
113
|
+
const toolType = toolData.toolType;
|
|
114
|
+
const tool = this.makeTool(toolType);
|
|
115
|
+
tool.setupFromData(toolData);
|
|
116
|
+
if (toolData.isDefault) {
|
|
117
|
+
if (this._defaultToolType) {
|
|
118
|
+
this.warn(`More than one tools is marked as default. Replacing`);
|
|
119
|
+
}
|
|
120
|
+
this._defaultToolType = toolType;
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
if (!this._defaultToolType) {
|
|
124
|
+
this.warn(`No default tools was specified. Defaulting to the first tool in the list`);
|
|
125
|
+
this._defaultToolType = Array.from(this.toolLookup.keys())[0];
|
|
126
|
+
}
|
|
127
|
+
if (this._defaultToolType) {
|
|
128
|
+
this.triggerTool(this._defaultToolType);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
127
131
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="jest" />
|
|
2
|
+
import { AppObject, AppObjectRepo } from "../../../AppObject";
|
|
3
|
+
import { ToolEntity, ToolRepository } from "../Entities";
|
|
4
|
+
export declare class MockToolRepo extends ToolRepository {
|
|
5
|
+
get activeTool(): ToolEntity | undefined;
|
|
6
|
+
get allTools(): ToolEntity[];
|
|
7
|
+
setupToolsFromData: jest.Mock<any, any>;
|
|
8
|
+
getTool: jest.Mock<any, any>;
|
|
9
|
+
getToolForHotkey: jest.Mock<any, any>;
|
|
10
|
+
setDefaultToolActive: jest.Mock<any, any>;
|
|
11
|
+
triggerTool: jest.Mock<any, any>;
|
|
12
|
+
toggleToolVisibility: jest.Mock<any, any>;
|
|
13
|
+
toolFactory: jest.Mock<any, any>;
|
|
14
|
+
makeTool: jest.Mock<any, any>;
|
|
15
|
+
constructor(appObject: AppObject);
|
|
16
|
+
}
|
|
17
|
+
export declare function makeMockToolRepo(appObjects: AppObjectRepo): MockToolRepo;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeMockToolRepo = exports.MockToolRepo = void 0;
|
|
4
|
+
const Entities_1 = require("../Entities");
|
|
5
|
+
class MockToolRepo extends Entities_1.ToolRepository {
|
|
6
|
+
constructor(appObject) {
|
|
7
|
+
super(appObject, Entities_1.ToolRepository.type);
|
|
8
|
+
this.setupToolsFromData = jest.fn();
|
|
9
|
+
this.getTool = jest.fn();
|
|
10
|
+
this.getToolForHotkey = jest.fn();
|
|
11
|
+
this.setDefaultToolActive = jest.fn();
|
|
12
|
+
this.triggerTool = jest.fn();
|
|
13
|
+
this.toggleToolVisibility = jest.fn();
|
|
14
|
+
this.toolFactory = jest.fn();
|
|
15
|
+
this.makeTool = jest.fn();
|
|
16
|
+
}
|
|
17
|
+
get activeTool() {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
get allTools() {
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.MockToolRepo = MockToolRepo;
|
|
25
|
+
function makeMockToolRepo(appObjects) {
|
|
26
|
+
return new MockToolRepo(appObjects.getOrCreate("MockToolRepo"));
|
|
27
|
+
}
|
|
28
|
+
exports.makeMockToolRepo = makeMockToolRepo;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="jest" />
|
|
2
2
|
import { AppObject, AppObjectRepo } from "../../../AppObject";
|
|
3
3
|
import { ToolPM } from "../PM";
|
|
4
|
-
export declare class ToolPMMock
|
|
4
|
+
export declare class ToolPMMock extends ToolPM {
|
|
5
5
|
vmsAreEqual: jest.Mock<any, any>;
|
|
6
6
|
constructor(appObject: AppObject);
|
|
7
7
|
}
|
|
8
|
-
export declare function makeToolPMMock
|
|
8
|
+
export declare function makeToolPMMock(appObjects: AppObjectRepo): ToolPMMock;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AppObjectRepo } from "../../../AppObject";
|
|
2
2
|
import { AppObject } from "../../../AppObject/AppObject";
|
|
3
3
|
import { AppObjectPM } from "../../../AppObject/AppObjectPM";
|
|
4
|
-
export interface ToolVM
|
|
4
|
+
export interface ToolVM {
|
|
5
5
|
label: string;
|
|
6
6
|
enabled: boolean;
|
|
7
7
|
selected: boolean;
|
|
@@ -17,14 +17,14 @@ export declare const defaultToolVM: {
|
|
|
17
17
|
shortcutLabel: string;
|
|
18
18
|
tooltipLabel: string;
|
|
19
19
|
};
|
|
20
|
-
export declare abstract class ToolPM
|
|
20
|
+
export declare abstract class ToolPM extends AppObjectPM<ToolVM> {
|
|
21
21
|
static readonly type = "ToolPM";
|
|
22
|
-
static get
|
|
22
|
+
static get(id: string, appObjects: AppObjectRepo): ToolPM | undefined;
|
|
23
23
|
}
|
|
24
|
-
export declare function makeToolPM
|
|
25
|
-
declare class ToolPMImp
|
|
24
|
+
export declare function makeToolPM(appObject: AppObject): ToolPMImp;
|
|
25
|
+
declare class ToolPMImp extends ToolPM {
|
|
26
26
|
private get tool();
|
|
27
|
-
vmsAreEqual(a: ToolVM
|
|
27
|
+
vmsAreEqual(a: ToolVM, b: ToolVM): boolean;
|
|
28
28
|
onToolChange: () => void;
|
|
29
29
|
constructor(appObject: AppObject);
|
|
30
30
|
}
|
|
@@ -13,5 +13,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13
13
|
__exportStar(require("./Adapters"), exports);
|
|
14
14
|
__exportStar(require("./Controller"), exports);
|
|
15
15
|
__exportStar(require("./Entities"), exports);
|
|
16
|
+
__exportStar(require("./Factories"), exports);
|
|
16
17
|
__exportStar(require("./Mocks"), exports);
|
|
17
18
|
__exportStar(require("./PM"), exports);
|
|
@@ -11,5 +11,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
__exportStar(require("./Entities"), exports);
|
|
14
|
+
__exportStar(require("./Factories"), exports);
|
|
14
15
|
__exportStar(require("./Mock"), exports);
|
|
15
16
|
__exportStar(require("./UC"), exports);
|
|
@@ -10,7 +10,9 @@ 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("./Controllers"), exports);
|
|
13
14
|
__exportStar(require("./Entities"), exports);
|
|
15
|
+
__exportStar(require("./Factories"), exports);
|
|
14
16
|
__exportStar(require("./Mocks"), exports);
|
|
15
17
|
__exportStar(require("./PM"), exports);
|
|
16
|
-
__exportStar(require("./
|
|
18
|
+
__exportStar(require("./UCs"), exports);
|
package/lib/Components/index.js
CHANGED
|
@@ -24,6 +24,7 @@ __exportStar(require("./FramedScreen"), exports);
|
|
|
24
24
|
__exportStar(require("./GLBModel"), exports);
|
|
25
25
|
__exportStar(require("./Hideable"), exports);
|
|
26
26
|
__exportStar(require("./HoverLabel"), exports);
|
|
27
|
+
__exportStar(require("./InspectorTab"), exports);
|
|
27
28
|
__exportStar(require("./KeyboardInput"), exports);
|
|
28
29
|
__exportStar(require("./Label"), exports);
|
|
29
30
|
__exportStar(require("./LabelDrop"), exports);
|