@vived/app 4.30.0 → 4.31.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.
Files changed (99) hide show
  1. package/lib/Components/InspectorTab/Adapters/index.d.ts +1 -0
  2. package/lib/Components/InspectorTab/Adapters/index.js +13 -0
  3. package/lib/Components/InspectorTab/Adapters/inspectorTabAdapter.d.ts +3 -0
  4. package/lib/Components/InspectorTab/Adapters/inspectorTabAdapter.js +23 -0
  5. package/lib/Components/InspectorTab/Controllers/clickSetInspectorTab.d.ts +2 -0
  6. package/lib/Components/InspectorTab/Controllers/clickSetInspectorTab.js +13 -0
  7. package/lib/Components/InspectorTab/Controllers/clickSetInspectorTabIndex.d.ts +2 -0
  8. package/lib/Components/InspectorTab/Controllers/clickSetInspectorTabIndex.js +13 -0
  9. package/lib/Components/InspectorTab/Controllers/index.d.ts +2 -0
  10. package/lib/Components/InspectorTab/Controllers/index.js +14 -0
  11. package/lib/Components/InspectorTab/Entities/InspectorTabEntity.d.ts +12 -0
  12. package/lib/Components/InspectorTab/Entities/InspectorTabEntity.js +54 -0
  13. package/lib/Components/InspectorTab/Entities/index.d.ts +1 -0
  14. package/lib/Components/InspectorTab/Entities/index.js +13 -0
  15. package/lib/Components/InspectorTab/Factories/index.d.ts +1 -0
  16. package/lib/Components/InspectorTab/Factories/index.js +13 -0
  17. package/lib/Components/InspectorTab/Factories/setupInspectorTabs.d.ts +2 -0
  18. package/lib/Components/InspectorTab/Factories/setupInspectorTabs.js +12 -0
  19. package/lib/Components/InspectorTab/Mocks/InspectorTabPmMock.d.ts +8 -0
  20. package/lib/Components/InspectorTab/Mocks/InspectorTabPmMock.js +15 -0
  21. package/lib/Components/InspectorTab/Mocks/index.d.ts +1 -0
  22. package/lib/Components/InspectorTab/Mocks/index.js +13 -0
  23. package/lib/Components/InspectorTab/PMs/InspectorTabPM.d.ts +12 -0
  24. package/lib/Components/InspectorTab/PMs/InspectorTabPM.js +55 -0
  25. package/lib/Components/InspectorTab/PMs/index.d.ts +1 -0
  26. package/lib/Components/InspectorTab/PMs/index.js +13 -0
  27. package/lib/Components/InspectorTab/index.d.ts +6 -0
  28. package/lib/Components/InspectorTab/index.js +18 -0
  29. package/lib/Components/MouseInput/Factories/index.d.ts +1 -0
  30. package/lib/Components/MouseInput/Factories/index.js +13 -0
  31. package/lib/Components/MouseInput/Factories/setupMouseInput.d.ts +2 -0
  32. package/lib/Components/MouseInput/Factories/setupMouseInput.js +9 -0
  33. package/lib/Components/OverlayColor/UC/SerializeOverlayColoredObjects.d.ts +27 -0
  34. package/lib/Components/OverlayColor/UC/SerializeOverlayColoredObjects.js +87 -0
  35. package/lib/Components/OverlayColor/UC/index.d.ts +1 -0
  36. package/lib/Components/OverlayColor/UC/index.js +1 -0
  37. package/lib/Components/SceneRoot/Mocks/DragScaleSceneRootUcMock.d.ts +9 -0
  38. package/lib/Components/SceneRoot/Mocks/DragScaleSceneRootUcMock.js +13 -0
  39. package/lib/Components/SceneRoot/Mocks/OrbitSceneRootUcMock.d.ts +11 -0
  40. package/lib/Components/SceneRoot/Mocks/OrbitSceneRootUcMock.js +15 -0
  41. package/lib/Components/SceneRoot/Mocks/PanSceneRootUcMock.d.ts +10 -0
  42. package/lib/Components/SceneRoot/Mocks/PanSceneRootUcMock.js +14 -0
  43. package/lib/Components/SceneRoot/Mocks/index.d.ts +2 -0
  44. package/lib/Components/SceneRoot/Mocks/index.js +14 -0
  45. package/lib/Components/Selection/Controller/KeyboardToClearSelection.d.ts +8 -0
  46. package/lib/Components/Selection/Controller/KeyboardToClearSelection.js +23 -0
  47. package/lib/Components/Selection/Factories/index.d.ts +1 -0
  48. package/lib/Components/Selection/Factories/index.js +13 -0
  49. package/lib/Components/Selection/Factories/setupSelection.d.ts +2 -0
  50. package/lib/Components/Selection/Factories/setupSelection.js +27 -0
  51. package/lib/Components/StoredView/Adapters/hasStoredViewAdapter.d.ts +2 -0
  52. package/lib/Components/StoredView/Adapters/hasStoredViewAdapter.js +19 -0
  53. package/lib/Components/StoredView/Adapters/index.d.ts +1 -0
  54. package/lib/Components/StoredView/Adapters/index.js +13 -0
  55. package/lib/Components/StoredView/Controllers/clearStoredView.d.ts +2 -0
  56. package/lib/Components/StoredView/Controllers/clearStoredView.js +13 -0
  57. package/lib/Components/StoredView/Controllers/index.d.ts +4 -0
  58. package/lib/Components/StoredView/Controllers/index.js +16 -0
  59. package/lib/Components/StoredView/Controllers/restoreStoredView.d.ts +2 -0
  60. package/lib/Components/StoredView/Controllers/restoreStoredView.js +13 -0
  61. package/lib/Components/StoredView/Controllers/setViewInXR.d.ts +2 -0
  62. package/lib/Components/StoredView/Controllers/setViewInXR.js +13 -0
  63. package/lib/Components/StoredView/Controllers/storeCurrentView.d.ts +2 -0
  64. package/lib/Components/StoredView/Controllers/storeCurrentView.js +13 -0
  65. package/lib/Components/StoredView/Factories/index.d.ts +1 -0
  66. package/lib/Components/StoredView/Factories/index.js +13 -0
  67. package/lib/Components/StoredView/Factories/setupStoredView.d.ts +2 -0
  68. package/lib/Components/StoredView/Factories/setupStoredView.js +21 -0
  69. package/lib/Components/StoredView/Mocks/ClearStoredViewUcMock.d.ts +8 -0
  70. package/lib/Components/StoredView/Mocks/ClearStoredViewUcMock.js +15 -0
  71. package/lib/Components/StoredView/Mocks/HasStoredViewPmMock.d.ts +8 -0
  72. package/lib/Components/StoredView/Mocks/HasStoredViewPmMock.js +15 -0
  73. package/lib/Components/StoredView/Mocks/RestoreStoredViewUcMock.d.ts +9 -0
  74. package/lib/Components/StoredView/Mocks/RestoreStoredViewUcMock.js +17 -0
  75. package/lib/Components/StoredView/Mocks/SetViewInXRUcMock.d.ts +8 -0
  76. package/lib/Components/StoredView/Mocks/SetViewInXRUcMock.js +15 -0
  77. package/lib/Components/StoredView/Mocks/StoreCurrentViewUcMock.d.ts +8 -0
  78. package/lib/Components/StoredView/Mocks/StoreCurrentViewUcMock.js +15 -0
  79. package/lib/Components/StoredView/Mocks/index.d.ts +1 -0
  80. package/lib/Components/StoredView/Mocks/index.js +13 -0
  81. package/lib/Components/Tools/Factories/index.d.ts +1 -0
  82. package/lib/Components/Tools/Factories/index.js +13 -0
  83. package/lib/Components/Tools/Factories/setupTools.d.ts +3 -0
  84. package/lib/Components/Tools/Factories/setupTools.js +15 -0
  85. package/lib/Components/Tools/Factories/toolFactory.d.ts +3 -0
  86. package/lib/Components/Tools/Factories/toolFactory.js +14 -0
  87. package/lib/Components/TouchController/Factories/index.d.ts +1 -0
  88. package/lib/Components/TouchController/Factories/index.js +13 -0
  89. package/lib/Components/TouchController/Factories/setupTouchInput.d.ts +2 -0
  90. package/lib/Components/TouchController/Factories/setupTouchInput.js +9 -0
  91. package/lib/Components/UndoRedo/Factories/index.d.ts +1 -0
  92. package/lib/Components/UndoRedo/Factories/index.js +13 -0
  93. package/lib/Components/UndoRedo/Factories/setupUndoRedo.d.ts +2 -0
  94. package/lib/Components/UndoRedo/Factories/setupUndoRedo.js +18 -0
  95. package/lib/Components/UndoRedo/UCs/UndoRedoButtonStatesHook.d.ts +11 -0
  96. package/lib/Components/UndoRedo/UCs/UndoRedoButtonStatesHook.js +55 -0
  97. package/lib/Components/UndoRedo/UCs/index.d.ts +1 -0
  98. package/lib/Components/UndoRedo/UCs/index.js +13 -0
  99. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ export * from "./inspectorTabAdapter";
@@ -0,0 +1,13 @@
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("./inspectorTabAdapter"), exports);
@@ -0,0 +1,3 @@
1
+ import { SingletonPmAdapter } from "../../../Types";
2
+ import { InspectorTabVM } from "../PMs/InspectorTabPM";
3
+ export declare const inspectorTabAdapter: SingletonPmAdapter<InspectorTabVM>;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.inspectorTabAdapter = void 0;
4
+ const InspectorTabPM_1 = require("../PMs/InspectorTabPM");
5
+ exports.inspectorTabAdapter = {
6
+ defaultVM: InspectorTabPM_1.defaultInspectorTabVM,
7
+ subscribe: (appObjects, setVM) => {
8
+ const pm = InspectorTabPM_1.InspectorTabPM.get(appObjects);
9
+ if (!pm) {
10
+ appObjects.submitError("inspectorTabAdapter", "Unable to find InspectorTabPM");
11
+ return;
12
+ }
13
+ pm.addView(setVM);
14
+ },
15
+ unsubscribe: (appObjects, setVM) => {
16
+ const pm = InspectorTabPM_1.InspectorTabPM.get(appObjects);
17
+ if (!pm) {
18
+ appObjects.submitError("inspectorTabAdapter", "Unable to find InspectorTabPM");
19
+ return;
20
+ }
21
+ pm.removeView(setVM);
22
+ }
23
+ };
@@ -0,0 +1,2 @@
1
+ import { AppObjectRepo } from "../../../AppObject";
2
+ export declare function clickSetInspectorTab(tab: string, appObjects: AppObjectRepo): void;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.clickSetInspectorTab = void 0;
4
+ const InspectorTabEntity_1 = require("../Entities/InspectorTabEntity");
5
+ function clickSetInspectorTab(tab, appObjects) {
6
+ const entity = InspectorTabEntity_1.InspectorTabEntity.get(appObjects);
7
+ if (!entity) {
8
+ appObjects.submitError("clickSetInspectorTab", "Unable to find InspectorTabEntity");
9
+ return;
10
+ }
11
+ entity.activeTab = tab;
12
+ }
13
+ exports.clickSetInspectorTab = clickSetInspectorTab;
@@ -0,0 +1,2 @@
1
+ import { AppObjectRepo } from "../../../AppObject";
2
+ export declare function clickSetInspectorTabIndex(tabIndex: number, appObjects: AppObjectRepo): void;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.clickSetInspectorTabIndex = void 0;
4
+ const InspectorTabEntity_1 = require("../Entities/InspectorTabEntity");
5
+ function clickSetInspectorTabIndex(tabIndex, appObjects) {
6
+ const entity = InspectorTabEntity_1.InspectorTabEntity.get(appObjects);
7
+ if (!entity) {
8
+ appObjects.submitError("clickSetInspectorTabIndex", "Unable to find InspectorTabEntity");
9
+ return;
10
+ }
11
+ entity.activeTabIndex = tabIndex;
12
+ }
13
+ exports.clickSetInspectorTabIndex = clickSetInspectorTabIndex;
@@ -0,0 +1,2 @@
1
+ export * from "./clickSetInspectorTab";
2
+ export * from "./clickSetInspectorTabIndex";
@@ -0,0 +1,14 @@
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("./clickSetInspectorTab"), exports);
14
+ __exportStar(require("./clickSetInspectorTabIndex"), exports);
@@ -0,0 +1,12 @@
1
+ import { AppObject, AppObjectEntity, AppObjectRepo } from "../../../AppObject";
2
+ export declare abstract class InspectorTabEntity extends AppObjectEntity {
3
+ static readonly type = "InspectorTabEntity";
4
+ abstract get inspectorTabs(): string[];
5
+ abstract setInspectorTabs(tabs: string[]): void;
6
+ abstract get activeTab(): string;
7
+ abstract set activeTab(val: string);
8
+ abstract get activeTabIndex(): number;
9
+ abstract set activeTabIndex(val: number);
10
+ static get: (appObjects: AppObjectRepo) => InspectorTabEntity | undefined;
11
+ }
12
+ export declare function makeInspectorTabEntity(appObject: AppObject): InspectorTabEntity;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeInspectorTabEntity = exports.InspectorTabEntity = void 0;
4
+ const AppObject_1 = require("../../../AppObject");
5
+ const Entities_1 = require("../../../Entities");
6
+ class InspectorTabEntity extends AppObject_1.AppObjectEntity {
7
+ }
8
+ exports.InspectorTabEntity = InspectorTabEntity;
9
+ InspectorTabEntity.type = "InspectorTabEntity";
10
+ InspectorTabEntity.get = (appObjects) => AppObject_1.getSingletonComponent(InspectorTabEntity.type, appObjects);
11
+ function makeInspectorTabEntity(appObject) {
12
+ return new InspectorTabEntityImp(appObject);
13
+ }
14
+ exports.makeInspectorTabEntity = makeInspectorTabEntity;
15
+ class InspectorTabEntityImp extends InspectorTabEntity {
16
+ constructor(appObject) {
17
+ super(appObject, InspectorTabEntity.type);
18
+ this._inspectorTabs = [];
19
+ this.memoizedIndex = new Entities_1.MemoizedNumber(-1, this.notifyOnChange);
20
+ this.appObjects.registerSingleton(this);
21
+ }
22
+ get inspectorTabs() {
23
+ return [...this._inspectorTabs];
24
+ }
25
+ setInspectorTabs(tabs) {
26
+ this._inspectorTabs = [...tabs];
27
+ if (tabs.length === 0)
28
+ return;
29
+ this.memoizedIndex.val = 0;
30
+ }
31
+ get activeTabIndex() {
32
+ return this.memoizedIndex.val;
33
+ }
34
+ set activeTabIndex(val) {
35
+ if (val < 0 || val >= this._inspectorTabs.length) {
36
+ this.warn("Invalid index: " + val);
37
+ return;
38
+ }
39
+ this.memoizedIndex.val = val;
40
+ }
41
+ get activeTab() {
42
+ if (this.memoizedIndex.val < 0)
43
+ return "";
44
+ return this._inspectorTabs[this.memoizedIndex.val];
45
+ }
46
+ set activeTab(inspectorTab) {
47
+ const index = this._inspectorTabs.indexOf(inspectorTab);
48
+ if (index === undefined || index < 0) {
49
+ this.warn("Unknown inspector tab: " + inspectorTab);
50
+ return;
51
+ }
52
+ this.memoizedIndex.val = index;
53
+ }
54
+ }
@@ -0,0 +1 @@
1
+ export * from "./InspectorTabEntity";
@@ -0,0 +1,13 @@
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("./InspectorTabEntity"), exports);
@@ -0,0 +1 @@
1
+ export * from "./setupInspectorTabs";
@@ -0,0 +1,13 @@
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("./setupInspectorTabs"), exports);
@@ -0,0 +1,2 @@
1
+ import { AppObject, AppObjectRepo } from "../../../AppObject";
2
+ export declare function setupInspectorTabs(appObjects: AppObjectRepo, tabs: string[]): AppObject;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setupInspectorTabs = void 0;
4
+ const Entities_1 = require("../Entities");
5
+ const PMs_1 = require("../PMs");
6
+ function setupInspectorTabs(appObjects, tabs) {
7
+ const ao = appObjects.getOrCreate("InspectorTabs");
8
+ Entities_1.makeInspectorTabEntity(ao).setInspectorTabs(tabs);
9
+ PMs_1.makeInspectorTabPM(ao);
10
+ return ao;
11
+ }
12
+ exports.setupInspectorTabs = setupInspectorTabs;
@@ -0,0 +1,8 @@
1
+ /// <reference types="jest" />
2
+ import { AppObject, AppObjectRepo } from "../../../AppObject";
3
+ import { InspectorTabPM } from "../PMs/InspectorTabPM";
4
+ export declare class InspectorTabPmMock extends InspectorTabPM {
5
+ vmsAreEqual: jest.Mock<any, any>;
6
+ constructor(appObject: AppObject);
7
+ }
8
+ export declare function makeInspectorTabPmMock(appObjects: AppObjectRepo): InspectorTabPmMock;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeInspectorTabPmMock = exports.InspectorTabPmMock = void 0;
4
+ const InspectorTabPM_1 = require("../PMs/InspectorTabPM");
5
+ class InspectorTabPmMock extends InspectorTabPM_1.InspectorTabPM {
6
+ constructor(appObject) {
7
+ super(appObject, InspectorTabPM_1.InspectorTabPM.type);
8
+ this.vmsAreEqual = jest.fn();
9
+ }
10
+ }
11
+ exports.InspectorTabPmMock = InspectorTabPmMock;
12
+ function makeInspectorTabPmMock(appObjects) {
13
+ return new InspectorTabPmMock(appObjects.getOrCreate("InspectorTabPmMock"));
14
+ }
15
+ exports.makeInspectorTabPmMock = makeInspectorTabPmMock;
@@ -0,0 +1 @@
1
+ export * from "./InspectorTabPmMock";
@@ -0,0 +1,13 @@
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("./InspectorTabPmMock"), exports);
@@ -0,0 +1,12 @@
1
+ import { AppObject, AppObjectPM, AppObjectRepo } from "../../../AppObject";
2
+ export interface InspectorTabVM {
3
+ selectedTab: string;
4
+ selectedTabIndex: number;
5
+ tabs: string[];
6
+ }
7
+ export declare const defaultInspectorTabVM: InspectorTabVM;
8
+ export declare abstract class InspectorTabPM extends AppObjectPM<InspectorTabVM> {
9
+ static readonly type = "InspectorTabPM";
10
+ static get: (appObjects: AppObjectRepo) => InspectorTabPM | undefined;
11
+ }
12
+ export declare function makeInspectorTabPM(appObject: AppObject): InspectorTabPM;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeInspectorTabPM = exports.InspectorTabPM = exports.defaultInspectorTabVM = void 0;
4
+ const AppObject_1 = require("../../../AppObject");
5
+ const InspectorTabEntity_1 = require("../Entities/InspectorTabEntity");
6
+ exports.defaultInspectorTabVM = {
7
+ selectedTab: "",
8
+ selectedTabIndex: 0,
9
+ tabs: [],
10
+ };
11
+ class InspectorTabPM extends AppObject_1.AppObjectPM {
12
+ }
13
+ exports.InspectorTabPM = InspectorTabPM;
14
+ InspectorTabPM.type = "InspectorTabPM";
15
+ InspectorTabPM.get = (appObjects) => AppObject_1.getSingletonComponent(InspectorTabPM.type, appObjects);
16
+ function makeInspectorTabPM(appObject) {
17
+ return new InspectorTabPMImp(appObject);
18
+ }
19
+ exports.makeInspectorTabPM = makeInspectorTabPM;
20
+ class InspectorTabPMImp extends InspectorTabPM {
21
+ constructor(appObject) {
22
+ var _a;
23
+ super(appObject, InspectorTabPM.type);
24
+ this.onAppStateChange = () => {
25
+ if (!this.tabEntity)
26
+ return;
27
+ this.doUpdateView({
28
+ selectedTab: this.tabEntity.activeTab,
29
+ tabs: this.tabEntity.inspectorTabs,
30
+ selectedTabIndex: this.tabEntity.activeTabIndex,
31
+ });
32
+ };
33
+ (_a = this.tabEntity) === null || _a === void 0 ? void 0 : _a.addChangeObserver(this.onAppStateChange);
34
+ this.onAppStateChange();
35
+ this.appObjects.registerSingleton(this);
36
+ }
37
+ get tabEntity() {
38
+ return this.getCachedSingleton(InspectorTabEntity_1.InspectorTabEntity.type);
39
+ }
40
+ vmsAreEqual(a, b) {
41
+ if (a.selectedTab !== b.selectedTab)
42
+ return false;
43
+ if (a.selectedTabIndex !== b.selectedTabIndex)
44
+ return false;
45
+ if (a.tabs.length !== b.tabs.length)
46
+ return false;
47
+ let listsAreTheSame = true;
48
+ a.tabs.forEach((tabA, i) => {
49
+ const tabB = b.tabs[i];
50
+ if (tabA !== tabB)
51
+ listsAreTheSame = false;
52
+ });
53
+ return listsAreTheSame;
54
+ }
55
+ }
@@ -0,0 +1 @@
1
+ export * from "./InspectorTabPM";
@@ -0,0 +1,13 @@
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("./InspectorTabPM"), exports);
@@ -0,0 +1,6 @@
1
+ export * from "./Adapters";
2
+ export * from "./Controllers";
3
+ export * from "./Entities";
4
+ export * from "./Factories";
5
+ export * from "./Mocks";
6
+ export * from "./PMs";
@@ -0,0 +1,18 @@
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("./Adapters"), exports);
14
+ __exportStar(require("./Controllers"), exports);
15
+ __exportStar(require("./Entities"), exports);
16
+ __exportStar(require("./Factories"), exports);
17
+ __exportStar(require("./Mocks"), exports);
18
+ __exportStar(require("./PMs"), exports);
@@ -0,0 +1 @@
1
+ export * from "./setupMouseInput";
@@ -0,0 +1,13 @@
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("./setupMouseInput"), exports);
@@ -0,0 +1,2 @@
1
+ import { AppObjectRepo } from "../../../AppObject";
2
+ export declare function setupMouseInput(appObject: AppObjectRepo): void;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setupMouseInput = void 0;
4
+ const Entities_1 = require("../Entities");
5
+ function setupMouseInput(appObject) {
6
+ const ao = appObject.getOrCreate("MouseInput");
7
+ Entities_1.makeMouseInput(ao);
8
+ }
9
+ exports.setupMouseInput = setupMouseInput;
@@ -0,0 +1,27 @@
1
+ import { OverlayColorEnums } from "../Entities/OverlayColor";
2
+ import { SerializedSystem } from "../../StateMachine/Entities/StateMachineEntity";
3
+ import { AppObjectUC, AppObject } from "../../../AppObject";
4
+ export declare abstract class SerializeOverlayColoredObjects extends AppObjectUC implements SerializedSystem {
5
+ static readonly type = "SerializeOverlayColoredObjects";
6
+ name: string;
7
+ abstract seriliziationVersion: number;
8
+ abstract getSystemState(): object;
9
+ abstract applySystemState(state: object, version: number, transitionDuration: number): void;
10
+ abstract applyDefaultState(transitionDuration: number): void;
11
+ }
12
+ export declare function makeSerializeOverlayColoredObjects(appObject: AppObject): SerializeOverlayColoredObjects;
13
+ export declare class SerializeOverlayColoredObjectsImp extends SerializeOverlayColoredObjects {
14
+ seriliziationVersion: number;
15
+ getSystemState(): object;
16
+ applySystemState(state: object, version: number, durationS: number): Promise<void> | void;
17
+ private applyStateV1;
18
+ applyDefaultState(): void;
19
+ constructor(appObj: AppObject);
20
+ }
21
+ export interface SerializedOverlayColoredObjectV1 {
22
+ id: string;
23
+ overlayColor: OverlayColorEnums;
24
+ }
25
+ export interface SerializedOverlayColoredObjectsV1 {
26
+ overlayColoredObjects: SerializedOverlayColoredObjectV1[];
27
+ }
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SerializeOverlayColoredObjectsImp = exports.makeSerializeOverlayColoredObjects = exports.SerializeOverlayColoredObjects = void 0;
4
+ const OverlayColor_1 = require("../Entities/OverlayColor");
5
+ const StateMachineEntity_1 = require("../../StateMachine/Entities/StateMachineEntity");
6
+ const AppObject_1 = require("../../../AppObject");
7
+ class SerializeOverlayColoredObjects extends AppObject_1.AppObjectUC {
8
+ constructor() {
9
+ super(...arguments);
10
+ this.name = "overlaycolored-objects";
11
+ }
12
+ }
13
+ exports.SerializeOverlayColoredObjects = SerializeOverlayColoredObjects;
14
+ SerializeOverlayColoredObjects.type = "SerializeOverlayColoredObjects";
15
+ function makeSerializeOverlayColoredObjects(appObject) {
16
+ return new SerializeOverlayColoredObjectsImp(appObject);
17
+ }
18
+ exports.makeSerializeOverlayColoredObjects = makeSerializeOverlayColoredObjects;
19
+ class SerializeOverlayColoredObjectsImp extends SerializeOverlayColoredObjects {
20
+ constructor(appObj) {
21
+ super(appObj, SerializeOverlayColoredObjects.type);
22
+ this.seriliziationVersion = 1;
23
+ const stateMachine = this.appObjects.getSingleton(StateMachineEntity_1.StateMachineEntity.type);
24
+ if (stateMachine) {
25
+ stateMachine.registerSerializedSystem(this);
26
+ }
27
+ else {
28
+ this.warn("Unable to find StateMachineEntity");
29
+ }
30
+ }
31
+ getSystemState() {
32
+ const overlayColoredObjects = [];
33
+ const allOverlayColors = this.appObjects.getAllComponents(OverlayColor_1.OverlayColor.type);
34
+ allOverlayColors.forEach((overlayColor) => {
35
+ if (overlayColor.overlayColor !== OverlayColor_1.OverlayColorEnums.NONE)
36
+ overlayColoredObjects.push({
37
+ id: overlayColor.appObject.id,
38
+ overlayColor: overlayColor.overlayColor,
39
+ });
40
+ });
41
+ const state = {
42
+ overlayColoredObjects,
43
+ };
44
+ return state;
45
+ }
46
+ applySystemState(state, version, durationS) {
47
+ if (version === 1) {
48
+ return this.applyStateV1(state, durationS);
49
+ }
50
+ else {
51
+ this.applyDefaultState();
52
+ }
53
+ }
54
+ applyStateV1(state, durationS) {
55
+ const { overlayColoredObjects } = state;
56
+ if (!overlayColoredObjects) {
57
+ this.applyDefaultState();
58
+ return;
59
+ }
60
+ // Create a Map for faster lookups
61
+ const overlayLookup = new Map();
62
+ overlayColoredObjects.forEach((overlayColorObj) => {
63
+ overlayLookup.set(overlayColorObj.id, overlayColorObj.overlayColor);
64
+ });
65
+ const allOverlayColors = this.appObjects.getAllComponents(OverlayColor_1.OverlayColor.type);
66
+ allOverlayColors.forEach((overlayColor) => {
67
+ var _a;
68
+ const appObjectId = overlayColor.appObject.id;
69
+ overlayColor.overlayColor =
70
+ (_a = overlayLookup.get(appObjectId)) !== null && _a !== void 0 ? _a : OverlayColor_1.OverlayColorEnums.NONE;
71
+ });
72
+ overlayLookup.forEach((desiredColor, remainingObjectId) => {
73
+ const appObject = this.appObjects.get(remainingObjectId);
74
+ if (appObject) {
75
+ const overlayColor = OverlayColor_1.OverlayColor.addIfMissing(appObject);
76
+ overlayColor.overlayColor = desiredColor;
77
+ }
78
+ });
79
+ }
80
+ applyDefaultState() {
81
+ const allOverlayColors = this.appObjects.getAllComponents(OverlayColor_1.OverlayColor.type);
82
+ allOverlayColors.forEach((overlayColor) => {
83
+ overlayColor.overlayColor = OverlayColor_1.OverlayColorEnums.NONE;
84
+ });
85
+ }
86
+ }
87
+ exports.SerializeOverlayColoredObjectsImp = SerializeOverlayColoredObjectsImp;
@@ -1 +1,2 @@
1
1
  export * from "./SetOverlayColorUC";
2
+ export * from "./SerializeOverlayColoredObjects";
@@ -11,3 +11,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./SetOverlayColorUC"), exports);
14
+ __exportStar(require("./SerializeOverlayColoredObjects"), exports);
@@ -0,0 +1,9 @@
1
+ /// <reference types="jest" />
2
+ import { AppObject } from "../../../AppObject";
3
+ import { DragScaleSceneRootUC } from "../UC";
4
+ export declare class DragScaleSceneRootUcMock extends DragScaleSceneRootUC {
5
+ doScale: jest.Mock<any, any>;
6
+ initializeScale: jest.Mock<any, any>;
7
+ finishScaling: jest.Mock<any, any>;
8
+ constructor(appObject: AppObject);
9
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DragScaleSceneRootUcMock = void 0;
4
+ const UC_1 = require("../UC");
5
+ class DragScaleSceneRootUcMock extends UC_1.DragScaleSceneRootUC {
6
+ constructor(appObject) {
7
+ super(appObject, UC_1.DragScaleSceneRootUC.type);
8
+ this.doScale = jest.fn();
9
+ this.initializeScale = jest.fn();
10
+ this.finishScaling = jest.fn();
11
+ }
12
+ }
13
+ exports.DragScaleSceneRootUcMock = DragScaleSceneRootUcMock;
@@ -0,0 +1,11 @@
1
+ /// <reference types="jest" />
2
+ import { AppObject } from "../../../AppObject";
3
+ import { OrbitSceneRootUC } from "../UC/OrbitSceneRoot";
4
+ export declare class OrbitSceneRootUcMock extends OrbitSceneRootUC {
5
+ sensitivity: number;
6
+ doOrbit: jest.Mock<any, any>;
7
+ initializeOrbit: jest.Mock<any, any>;
8
+ finishOrbit: jest.Mock<any, any>;
9
+ cancelOrbit: jest.Mock<any, any>;
10
+ constructor(appObject: AppObject);
11
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OrbitSceneRootUcMock = void 0;
4
+ const OrbitSceneRoot_1 = require("../UC/OrbitSceneRoot");
5
+ class OrbitSceneRootUcMock extends OrbitSceneRoot_1.OrbitSceneRootUC {
6
+ constructor(appObject) {
7
+ super(appObject, OrbitSceneRoot_1.OrbitSceneRootUC.type);
8
+ this.sensitivity = 1;
9
+ this.doOrbit = jest.fn();
10
+ this.initializeOrbit = jest.fn();
11
+ this.finishOrbit = jest.fn();
12
+ this.cancelOrbit = jest.fn();
13
+ }
14
+ }
15
+ exports.OrbitSceneRootUcMock = OrbitSceneRootUcMock;
@@ -0,0 +1,10 @@
1
+ /// <reference types="jest" />
2
+ import { AppObject } from "../../../AppObject";
3
+ import { PanSceneRootUC } from "../UC/PanSceneRoot";
4
+ export declare class PanSceneRootUcMock extends PanSceneRootUC {
5
+ doPan: jest.Mock<any, any>;
6
+ initializePan: jest.Mock<any, any>;
7
+ finishPan: jest.Mock<any, any>;
8
+ cancelPan: jest.Mock<any, any>;
9
+ constructor(appObject: AppObject);
10
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PanSceneRootUcMock = void 0;
4
+ const PanSceneRoot_1 = require("../UC/PanSceneRoot");
5
+ class PanSceneRootUcMock extends PanSceneRoot_1.PanSceneRootUC {
6
+ constructor(appObject) {
7
+ super(appObject, PanSceneRoot_1.PanSceneRootUC.type);
8
+ this.doPan = jest.fn();
9
+ this.initializePan = jest.fn();
10
+ this.finishPan = jest.fn();
11
+ this.cancelPan = jest.fn();
12
+ }
13
+ }
14
+ exports.PanSceneRootUcMock = PanSceneRootUcMock;
@@ -0,0 +1,2 @@
1
+ export * from "./OrbitSceneRootUcMock";
2
+ export * from "./PanSceneRootUcMock";