@vived/app 4.30.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.
Files changed (189) hide show
  1. package/lib/Components/BaseApp/Factories/setupBaseApp.d.ts +2 -2
  2. package/lib/Components/BaseApp/Factories/setupBaseApp.js +1 -0
  3. package/lib/Components/ChannelModel/UC/SelectChannelModelUC.js +7 -0
  4. package/lib/Components/InspectorTab/Adapters/index.d.ts +1 -0
  5. package/lib/Components/InspectorTab/Adapters/index.js +13 -0
  6. package/lib/Components/InspectorTab/Adapters/inspectorTabAdapter.d.ts +3 -0
  7. package/lib/Components/InspectorTab/Adapters/inspectorTabAdapter.js +23 -0
  8. package/lib/Components/InspectorTab/Controllers/KeyboardToSetTab.d.ts +10 -0
  9. package/lib/Components/InspectorTab/Controllers/KeyboardToSetTab.js +45 -0
  10. package/lib/Components/InspectorTab/Controllers/clickSetInspectorTab.d.ts +2 -0
  11. package/lib/Components/InspectorTab/Controllers/clickSetInspectorTab.js +13 -0
  12. package/lib/Components/InspectorTab/Controllers/clickSetInspectorTabIndex.d.ts +2 -0
  13. package/lib/Components/InspectorTab/Controllers/clickSetInspectorTabIndex.js +13 -0
  14. package/lib/Components/InspectorTab/Controllers/index.d.ts +3 -0
  15. package/lib/Components/InspectorTab/Controllers/index.js +15 -0
  16. package/lib/Components/InspectorTab/Entities/InspectorTabEntity.d.ts +12 -0
  17. package/lib/Components/InspectorTab/Entities/InspectorTabEntity.js +54 -0
  18. package/lib/Components/InspectorTab/Entities/index.d.ts +1 -0
  19. package/lib/Components/InspectorTab/Entities/index.js +13 -0
  20. package/lib/Components/InspectorTab/Factories/index.d.ts +1 -0
  21. package/lib/Components/InspectorTab/Factories/index.js +13 -0
  22. package/lib/Components/InspectorTab/Factories/setupInspectorTabs.d.ts +2 -0
  23. package/lib/Components/InspectorTab/Factories/setupInspectorTabs.js +17 -0
  24. package/lib/Components/InspectorTab/Mocks/InspectorTabPmMock.d.ts +8 -0
  25. package/lib/Components/InspectorTab/Mocks/InspectorTabPmMock.js +15 -0
  26. package/lib/Components/InspectorTab/Mocks/index.d.ts +1 -0
  27. package/lib/Components/InspectorTab/Mocks/index.js +13 -0
  28. package/lib/Components/InspectorTab/PMs/InspectorTabPM.d.ts +12 -0
  29. package/lib/Components/InspectorTab/PMs/InspectorTabPM.js +55 -0
  30. package/lib/Components/InspectorTab/PMs/index.d.ts +1 -0
  31. package/lib/Components/InspectorTab/PMs/index.js +13 -0
  32. package/lib/Components/InspectorTab/index.d.ts +6 -0
  33. package/lib/Components/InspectorTab/index.js +18 -0
  34. package/lib/Components/MouseInput/Factories/index.d.ts +1 -0
  35. package/lib/Components/MouseInput/Factories/index.js +13 -0
  36. package/lib/Components/MouseInput/Factories/setupMouseInput.d.ts +2 -0
  37. package/lib/Components/MouseInput/Factories/setupMouseInput.js +9 -0
  38. package/lib/Components/MouseInput/index.d.ts +1 -0
  39. package/lib/Components/MouseInput/index.js +1 -0
  40. package/lib/Components/OverlayColor/UC/SerializeOverlayColoredObjects.d.ts +27 -0
  41. package/lib/Components/OverlayColor/UC/SerializeOverlayColoredObjects.js +87 -0
  42. package/lib/Components/OverlayColor/UC/index.d.ts +1 -0
  43. package/lib/Components/OverlayColor/UC/index.js +1 -0
  44. package/lib/Components/SceneRoot/Controllers/DoubleTapToFocus.d.ts +1 -1
  45. package/lib/Components/SceneRoot/Controllers/DoubleTapToFocus.js +3 -5
  46. package/lib/Components/SceneRoot/Controllers/MouseClickToFocus.d.ts +1 -1
  47. package/lib/Components/SceneRoot/Controllers/MouseClickToFocus.js +6 -5
  48. package/lib/Components/SceneRoot/Controllers/MouseDoubleClickToRecenter.d.ts +1 -1
  49. package/lib/Components/SceneRoot/Controllers/MouseDoubleClickToRecenter.js +3 -5
  50. package/lib/Components/SceneRoot/Controllers/MouseOrbit.d.ts +2 -1
  51. package/lib/Components/SceneRoot/Controllers/MouseOrbit.js +19 -6
  52. package/lib/Components/SceneRoot/Controllers/MousePan.d.ts +2 -1
  53. package/lib/Components/SceneRoot/Controllers/MousePan.js +19 -6
  54. package/lib/Components/SceneRoot/Controllers/MouseRoll.d.ts +1 -1
  55. package/lib/Components/SceneRoot/Controllers/MouseRoll.js +3 -5
  56. package/lib/Components/SceneRoot/Controllers/MouseScale.d.ts +2 -1
  57. package/lib/Components/SceneRoot/Controllers/MouseScale.js +16 -6
  58. package/lib/Components/SceneRoot/Controllers/ScaleSceneRootSC.d.ts +2 -2
  59. package/lib/Components/SceneRoot/Controllers/ScaleSceneRootSC.js +8 -11
  60. package/lib/Components/SceneRoot/Controllers/SceneRootMoveSC.d.ts +2 -2
  61. package/lib/Components/SceneRoot/Controllers/SceneRootMoveSC.js +9 -12
  62. package/lib/Components/SceneRoot/Controllers/TouchOrbit.d.ts +3 -1
  63. package/lib/Components/SceneRoot/Controllers/TouchOrbit.js +24 -6
  64. package/lib/Components/SceneRoot/Controllers/TouchPan.d.ts +3 -1
  65. package/lib/Components/SceneRoot/Controllers/TouchPan.js +24 -6
  66. package/lib/Components/SceneRoot/Controllers/TouchPinch.d.ts +2 -2
  67. package/lib/Components/SceneRoot/Controllers/TouchPinch.js +12 -6
  68. package/lib/Components/SceneRoot/Controllers/TouchScale.d.ts +2 -2
  69. package/lib/Components/SceneRoot/Controllers/TouchScale.js +16 -5
  70. package/lib/Components/SceneRoot/Factories/index.d.ts +1 -0
  71. package/lib/Components/SceneRoot/Factories/index.js +13 -0
  72. package/lib/Components/SceneRoot/Factories/setupSceneRoot.d.ts +3 -0
  73. package/lib/Components/SceneRoot/Factories/setupSceneRoot.js +45 -0
  74. package/lib/Components/SceneRoot/Mocks/DragScaleSceneRootUcMock.d.ts +9 -0
  75. package/lib/Components/SceneRoot/Mocks/DragScaleSceneRootUcMock.js +13 -0
  76. package/lib/Components/SceneRoot/Mocks/MockDragScaleSceneRootUC.d.ts +9 -0
  77. package/lib/Components/SceneRoot/Mocks/MockDragScaleSceneRootUC.js +13 -0
  78. package/lib/Components/SceneRoot/Mocks/MockFocusOnPixelUC.d.ts +10 -0
  79. package/lib/Components/SceneRoot/Mocks/MockFocusOnPixelUC.js +15 -0
  80. package/lib/Components/SceneRoot/Mocks/MockOrbitSceneRootUC.d.ts +11 -0
  81. package/lib/Components/SceneRoot/Mocks/MockOrbitSceneRootUC.js +15 -0
  82. package/lib/Components/SceneRoot/Mocks/MockPanSceneRootUC.d.ts +10 -0
  83. package/lib/Components/SceneRoot/Mocks/MockPanSceneRootUC.js +14 -0
  84. package/lib/Components/SceneRoot/Mocks/MockPinchSceneRootUC.d.ts +10 -0
  85. package/lib/Components/SceneRoot/Mocks/MockPinchSceneRootUC.js +14 -0
  86. package/lib/Components/SceneRoot/Mocks/OrbitSceneRootUcMock.d.ts +11 -0
  87. package/lib/Components/SceneRoot/Mocks/OrbitSceneRootUcMock.js +15 -0
  88. package/lib/Components/SceneRoot/Mocks/PanSceneRootUcMock.d.ts +10 -0
  89. package/lib/Components/SceneRoot/Mocks/PanSceneRootUcMock.js +14 -0
  90. package/lib/Components/SceneRoot/Mocks/index.d.ts +5 -0
  91. package/lib/Components/SceneRoot/Mocks/index.js +17 -0
  92. package/lib/Components/SceneRoot/UC/CenterSceneRootOnPixelPick.js +1 -1
  93. package/lib/Components/SceneRoot/UC/FocusOnPixel.js +1 -1
  94. package/lib/Components/SceneRoot/index.d.ts +3 -1
  95. package/lib/Components/SceneRoot/index.js +3 -1
  96. package/lib/Components/Selection/Controller/KeyboardToClearSelection.d.ts +8 -0
  97. package/lib/Components/Selection/Controller/KeyboardToClearSelection.js +23 -0
  98. package/lib/Components/Selection/Controller/index.d.ts +1 -0
  99. package/lib/Components/Selection/Controller/index.js +1 -0
  100. package/lib/Components/Selection/Factories/index.d.ts +1 -0
  101. package/lib/Components/Selection/Factories/index.js +13 -0
  102. package/lib/Components/Selection/Factories/setupSelection.d.ts +2 -0
  103. package/lib/Components/Selection/Factories/setupSelection.js +27 -0
  104. package/lib/Components/Selection/index.d.ts +1 -0
  105. package/lib/Components/Selection/index.js +1 -0
  106. package/lib/Components/Stick/UCs/TryStickAppObjectUC.js +10 -0
  107. package/lib/Components/StoredView/Adapters/hasStoredViewAdapter.d.ts +2 -0
  108. package/lib/Components/StoredView/Adapters/hasStoredViewAdapter.js +19 -0
  109. package/lib/Components/StoredView/Adapters/index.d.ts +1 -0
  110. package/lib/Components/StoredView/Adapters/index.js +13 -0
  111. package/lib/Components/StoredView/Controllers/clearStoredView.d.ts +2 -0
  112. package/lib/Components/StoredView/Controllers/clearStoredView.js +13 -0
  113. package/lib/Components/StoredView/Controllers/index.d.ts +4 -0
  114. package/lib/Components/StoredView/Controllers/index.js +16 -0
  115. package/lib/Components/StoredView/Controllers/restoreStoredView.d.ts +2 -0
  116. package/lib/Components/StoredView/Controllers/restoreStoredView.js +13 -0
  117. package/lib/Components/StoredView/Controllers/setViewInXR.d.ts +2 -0
  118. package/lib/Components/StoredView/Controllers/setViewInXR.js +13 -0
  119. package/lib/Components/StoredView/Controllers/storeCurrentView.d.ts +2 -0
  120. package/lib/Components/StoredView/Controllers/storeCurrentView.js +13 -0
  121. package/lib/Components/StoredView/Factories/index.d.ts +1 -0
  122. package/lib/Components/StoredView/Factories/index.js +13 -0
  123. package/lib/Components/StoredView/Factories/setupStoredView.d.ts +2 -0
  124. package/lib/Components/StoredView/Factories/setupStoredView.js +21 -0
  125. package/lib/Components/StoredView/Mocks/ClearStoredViewUcMock.d.ts +8 -0
  126. package/lib/Components/StoredView/Mocks/ClearStoredViewUcMock.js +15 -0
  127. package/lib/Components/StoredView/Mocks/HasStoredViewPmMock.d.ts +8 -0
  128. package/lib/Components/StoredView/Mocks/HasStoredViewPmMock.js +15 -0
  129. package/lib/Components/StoredView/Mocks/RestoreStoredViewUcMock.d.ts +9 -0
  130. package/lib/Components/StoredView/Mocks/RestoreStoredViewUcMock.js +17 -0
  131. package/lib/Components/StoredView/Mocks/SetViewInXRUcMock.d.ts +8 -0
  132. package/lib/Components/StoredView/Mocks/SetViewInXRUcMock.js +15 -0
  133. package/lib/Components/StoredView/Mocks/StoreCurrentViewUcMock.d.ts +8 -0
  134. package/lib/Components/StoredView/Mocks/StoreCurrentViewUcMock.js +15 -0
  135. package/lib/Components/StoredView/Mocks/index.d.ts +1 -0
  136. package/lib/Components/StoredView/Mocks/index.js +13 -0
  137. package/lib/Components/StoredView/PM/HasStoredViewPM.js +7 -9
  138. package/lib/Components/StoredView/UC/ClearStoredViewUC.d.ts +0 -1
  139. package/lib/Components/StoredView/UC/ClearStoredViewUC.js +4 -15
  140. package/lib/Components/StoredView/UC/RestoreStoredViewUC.d.ts +0 -1
  141. package/lib/Components/StoredView/UC/RestoreStoredViewUC.js +8 -22
  142. package/lib/Components/StoredView/UC/SerializeStoredView.js +3 -6
  143. package/lib/Components/StoredView/UC/SetInXRUC.d.ts +0 -1
  144. package/lib/Components/StoredView/UC/SetInXRUC.js +4 -15
  145. package/lib/Components/StoredView/UC/StoreCurrentViewUC.d.ts +0 -1
  146. package/lib/Components/StoredView/UC/StoreCurrentViewUC.js +7 -19
  147. package/lib/Components/StoredView/index.d.ts +3 -0
  148. package/lib/Components/StoredView/index.js +3 -0
  149. package/lib/Components/Tools/Adapters/toolAdapter.d.ts +1 -1
  150. package/lib/Components/Tools/Adapters/toolAdapter.js +16 -23
  151. package/lib/Components/Tools/Controller/ToolHotkeys.d.ts +1 -1
  152. package/lib/Components/Tools/Controller/triggerTool.d.ts +1 -1
  153. package/lib/Components/Tools/Entities/ToolEntity.d.ts +7 -7
  154. package/lib/Components/Tools/Entities/ToolEntity.js +1 -2
  155. package/lib/Components/Tools/Entities/ToolRepository.d.ts +12 -11
  156. package/lib/Components/Tools/Entities/ToolRepository.js +30 -26
  157. package/lib/Components/Tools/Factories/index.d.ts +1 -0
  158. package/lib/Components/Tools/Factories/index.js +13 -0
  159. package/lib/Components/Tools/Factories/setupTools.d.ts +3 -0
  160. package/lib/Components/Tools/Factories/setupTools.js +15 -0
  161. package/lib/Components/Tools/Factories/toolFactory.d.ts +3 -0
  162. package/lib/Components/Tools/Factories/toolFactory.js +14 -0
  163. package/lib/Components/Tools/Mocks/MockToolRepo.d.ts +17 -0
  164. package/lib/Components/Tools/Mocks/MockToolRepo.js +28 -0
  165. package/lib/Components/Tools/Mocks/ToolPMMock.d.ts +2 -2
  166. package/lib/Components/Tools/Mocks/index.d.ts +1 -0
  167. package/lib/Components/Tools/Mocks/index.js +1 -0
  168. package/lib/Components/Tools/PM/ToolPM.d.ts +6 -6
  169. package/lib/Components/Tools/index.d.ts +1 -0
  170. package/lib/Components/Tools/index.js +1 -0
  171. package/lib/Components/TouchController/Factories/index.d.ts +1 -0
  172. package/lib/Components/TouchController/Factories/index.js +13 -0
  173. package/lib/Components/TouchController/Factories/setupTouchInput.d.ts +2 -0
  174. package/lib/Components/TouchController/Factories/setupTouchInput.js +9 -0
  175. package/lib/Components/TouchController/index.d.ts +1 -0
  176. package/lib/Components/TouchController/index.js +1 -0
  177. package/lib/Components/UndoRedo/Factories/index.d.ts +1 -0
  178. package/lib/Components/UndoRedo/Factories/index.js +13 -0
  179. package/lib/Components/UndoRedo/Factories/setupUndoRedo.d.ts +2 -0
  180. package/lib/Components/UndoRedo/Factories/setupUndoRedo.js +18 -0
  181. package/lib/Components/UndoRedo/UCs/UndoRedoButtonStatesHook.d.ts +11 -0
  182. package/lib/Components/UndoRedo/UCs/UndoRedoButtonStatesHook.js +55 -0
  183. package/lib/Components/UndoRedo/UCs/index.d.ts +1 -0
  184. package/lib/Components/UndoRedo/UCs/index.js +13 -0
  185. package/lib/Components/UndoRedo/index.d.ts +3 -1
  186. package/lib/Components/UndoRedo/index.js +3 -1
  187. package/lib/Components/index.d.ts +1 -0
  188. package/lib/Components/index.js +1 -0
  189. package/package.json +1 -1
@@ -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<ToolTypes> extends AppObjectEntity {
5
+ export declare abstract class ToolRepository extends AppObjectEntity {
6
6
  static readonly type = "TOOL_REPOSITORY";
7
- abstract get activeTool(): ToolEntity<ToolTypes> | undefined;
8
- abstract get allTools(): ToolEntity<ToolTypes>[];
9
- abstract setupToolsFromData(toolData: ToolData<ToolTypes>[]): void;
10
- abstract getTool(toolType: ToolTypes): ToolEntity<ToolTypes> | undefined;
11
- abstract getToolForHotkey(hotkey: HotKey): ToolEntity<ToolTypes> | undefined;
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: ToolTypes): void;
14
- abstract toggleToolVisibility(toolType: ToolTypes): void;
15
- abstract toolFactory: (toolData: ToolData<ToolTypes>) => ToolEntity<ToolTypes>;
16
- static get: <ToolTypes_1>(appObjects: AppObjectRepo) => ToolRepository<ToolTypes_1> | undefined;
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<ToolTypes>(appObject: AppObject): ToolRepository<ToolTypes>;
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 = (toolData) => {
21
- const ao = this.appObjects.getOrCreate(toolData.toolType);
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 @@
1
+ export * from "./setupTools";
@@ -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("./setupTools"), exports);
@@ -0,0 +1,3 @@
1
+ import { AppObject, AppObjectRepo } from "../../../AppObject";
2
+ import { ToolData } from "../Entities";
3
+ export declare function setupTools(appObjects: AppObjectRepo, toolData: ToolData[]): AppObject;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setupTools = void 0;
4
+ const Controller_1 = require("../Controller");
5
+ const Entities_1 = require("../Entities");
6
+ const toolFactory_1 = require("./toolFactory");
7
+ function setupTools(appObjects, toolData) {
8
+ const ao = appObjects.getOrCreate("ToolRepo");
9
+ const toolRepo = Entities_1.makeToolRepo(ao);
10
+ toolRepo.toolFactory = toolFactory_1.makeToolFactory(appObjects);
11
+ toolRepo.setupToolsFromData(toolData);
12
+ new Controller_1.ToolHotkeys(ao);
13
+ return ao;
14
+ }
15
+ exports.setupTools = setupTools;
@@ -0,0 +1,3 @@
1
+ import { AppObjectRepo } from "../../../AppObject";
2
+ import { ToolEntity } from "../Entities";
3
+ export declare function makeToolFactory(appObjects: AppObjectRepo): (id: string) => ToolEntity;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeToolFactory = void 0;
4
+ const Entities_1 = require("../Entities");
5
+ const PM_1 = require("../PM");
6
+ function makeToolFactory(appObjects) {
7
+ return function toolFactory(id) {
8
+ const ao = appObjects.getOrCreate(id);
9
+ const toolEntity = Entities_1.makeToolEntity(ao);
10
+ PM_1.makeToolPM(ao);
11
+ return toolEntity;
12
+ };
13
+ }
14
+ exports.makeToolFactory = makeToolFactory;
@@ -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<CT> extends ToolPM<CT> {
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<CT>(appObjects: AppObjectRepo): ToolPMMock<CT>;
8
+ export declare function makeToolPMMock(appObjects: AppObjectRepo): ToolPMMock;
@@ -1 +1,2 @@
1
1
  export * from "./ToolPMMock";
2
+ export * from "./MockToolRepo";
@@ -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("./ToolPMMock"), exports);
14
+ __exportStar(require("./MockToolRepo"), exports);
@@ -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<ToolType> {
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<ToolType> extends AppObjectPM<ToolVM<ToolType>> {
20
+ export declare abstract class ToolPM extends AppObjectPM<ToolVM> {
21
21
  static readonly type = "ToolPM";
22
- static get<ToolType>(id: string, appObjects: AppObjectRepo): ToolPM<ToolType> | undefined;
22
+ static get(id: string, appObjects: AppObjectRepo): ToolPM | undefined;
23
23
  }
24
- export declare function makeToolPM<ToolType>(appObject: AppObject): ToolPMImp<ToolType>;
25
- declare class ToolPMImp<ToolType> extends ToolPM<ToolType> {
24
+ export declare function makeToolPM(appObject: AppObject): ToolPMImp;
25
+ declare class ToolPMImp extends ToolPM {
26
26
  private get tool();
27
- vmsAreEqual(a: ToolVM<ToolType>, b: ToolVM<ToolType>): boolean;
27
+ vmsAreEqual(a: ToolVM, b: ToolVM): boolean;
28
28
  onToolChange: () => void;
29
29
  constructor(appObject: AppObject);
30
30
  }
@@ -1,5 +1,6 @@
1
1
  export * from "./Adapters";
2
2
  export * from "./Controller";
3
3
  export * from "./Entities";
4
+ export * from "./Factories";
4
5
  export * from "./Mocks";
5
6
  export * from "./PM";
@@ -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);
@@ -0,0 +1 @@
1
+ export * from "./setupTouchInput";
@@ -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("./setupTouchInput"), exports);
@@ -0,0 +1,2 @@
1
+ import { AppObjectRepo } from "../../../AppObject";
2
+ export declare function setupTouchInput(appObject: AppObjectRepo): void;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setupTouchInput = void 0;
4
+ const Entities_1 = require("../Entities");
5
+ function setupTouchInput(appObject) {
6
+ const ao = appObject.getOrCreate("TouchInput");
7
+ Entities_1.makeTouchInput(ao);
8
+ }
9
+ exports.setupTouchInput = setupTouchInput;
@@ -1,3 +1,4 @@
1
1
  export * from "./Entities";
2
+ export * from "./Factories";
2
3
  export * from "./Mock";
3
4
  export * from "./UC";
@@ -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);
@@ -0,0 +1 @@
1
+ export * from "./setupUndoRedo";
@@ -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("./setupUndoRedo"), exports);
@@ -0,0 +1,2 @@
1
+ import { AppObject, AppObjectRepo } from "../../../AppObject";
2
+ export declare function setupUndoRedo(appObjects: AppObjectRepo): AppObject;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setupUndoRedo = void 0;
4
+ const Entities_1 = require("../Entities");
5
+ const PM_1 = require("../PM");
6
+ const UCs_1 = require("../UCs");
7
+ function setupUndoRedo(appObjects) {
8
+ const ao = appObjects.getOrCreate("UndoRedo");
9
+ // Entity
10
+ const undoRedo = Entities_1.makeUndoRedoEntity(ao);
11
+ // UCs
12
+ new UCs_1.UndoRedoToolStatesHook(ao);
13
+ // PMs
14
+ PM_1.makeHasUndoPM(ao);
15
+ PM_1.makeHasRedoPM(ao);
16
+ return ao;
17
+ }
18
+ exports.setupUndoRedo = setupUndoRedo;
@@ -0,0 +1,11 @@
1
+ import { AppObject, AppObjectUC } from "../../../AppObject";
2
+ export declare class UndoRedoToolStatesHook extends AppObjectUC {
3
+ static type: string;
4
+ private get baseApp();
5
+ private get undoRedo();
6
+ private get toolRepo();
7
+ private undoTool?;
8
+ private redoTool?;
9
+ onUndoRedoChange: () => void;
10
+ constructor(appObject: AppObject);
11
+ }
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UndoRedoToolStatesHook = void 0;
4
+ const AppObject_1 = require("../../../AppObject");
5
+ const BaseAppState_1 = require("../../BaseApp/Entity/BaseAppState");
6
+ const Entities_1 = require("../../Tools/Entities");
7
+ const Entities_2 = require("../Entities");
8
+ class UndoRedoToolStatesHook extends AppObject_1.AppObjectUC {
9
+ constructor(appObject) {
10
+ var _a, _b, _c, _d;
11
+ super(appObject, UndoRedoToolStatesHook.type);
12
+ this.onUndoRedoChange = () => {
13
+ if (!this.baseApp)
14
+ return;
15
+ if (!this.undoRedo)
16
+ return;
17
+ if (this.redoTool) {
18
+ if (this.baseApp.isAuthoring) {
19
+ this.redoTool.state = this.undoRedo.hasRedo
20
+ ? Entities_1.ToolState.ENABLED
21
+ : Entities_1.ToolState.DISABLED;
22
+ }
23
+ else {
24
+ this.redoTool.state = Entities_1.ToolState.HIDDEN;
25
+ }
26
+ }
27
+ if (this.undoTool) {
28
+ if (this.baseApp.isAuthoring) {
29
+ this.undoTool.state = this.undoRedo.hasUndo
30
+ ? Entities_1.ToolState.ENABLED
31
+ : Entities_1.ToolState.DISABLED;
32
+ }
33
+ else {
34
+ this.undoTool.state = Entities_1.ToolState.HIDDEN;
35
+ }
36
+ }
37
+ };
38
+ this.undoTool = (_a = this.toolRepo) === null || _a === void 0 ? void 0 : _a.getTool("UNDO");
39
+ this.redoTool = (_b = this.toolRepo) === null || _b === void 0 ? void 0 : _b.getTool("REDO");
40
+ (_c = this.undoRedo) === null || _c === void 0 ? void 0 : _c.addChangeObserver(this.onUndoRedoChange);
41
+ (_d = this.baseApp) === null || _d === void 0 ? void 0 : _d.addChangeObserver(this.onUndoRedoChange);
42
+ this.onUndoRedoChange();
43
+ }
44
+ get baseApp() {
45
+ return this.getCachedSingleton(BaseAppState_1.BaseAppState.type);
46
+ }
47
+ get undoRedo() {
48
+ return this.getCachedSingleton(Entities_2.UndoRedoEntity.type);
49
+ }
50
+ get toolRepo() {
51
+ return this.getCachedSingleton(Entities_1.ToolRepository.type);
52
+ }
53
+ }
54
+ exports.UndoRedoToolStatesHook = UndoRedoToolStatesHook;
55
+ UndoRedoToolStatesHook.type = "UndoRedoToolStatesHook";
@@ -0,0 +1 @@
1
+ export * from "./UndoRedoButtonStatesHook";
@@ -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("./UndoRedoButtonStatesHook"), exports);
@@ -1,4 +1,6 @@
1
+ export * from "./Controllers";
1
2
  export * from "./Entities";
3
+ export * from "./Factories";
2
4
  export * from "./Mocks";
3
5
  export * from "./PM";
4
- export * from "./Controllers";
6
+ export * from "./UCs";
@@ -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("./Controllers"), exports);
18
+ __exportStar(require("./UCs"), exports);
@@ -12,6 +12,7 @@ export * from "./FramedScreen";
12
12
  export * from "./GLBModel";
13
13
  export * from "./Hideable";
14
14
  export * from "./HoverLabel";
15
+ export * from "./InspectorTab";
15
16
  export * from "./KeyboardInput";
16
17
  export * from "./Label";
17
18
  export * from "./LabelDrop";
@@ -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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vived/app",
3
- "version": "4.30.0",
3
+ "version": "4.32.0",
4
4
  "description": "Public package for the VIVED Learning App system",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",