@vived/app 4.9.2 → 4.10.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 (74) hide show
  1. package/lib/Components/App/Mocks/index.d.ts +2 -0
  2. package/lib/Components/App/Mocks/index.js +14 -0
  3. package/lib/Components/Babylon/Mocks/MockBabylonRenderingUC.d.ts +2 -0
  4. package/lib/Components/Babylon/Mocks/MockBabylonRenderingUC.js +5 -1
  5. package/lib/Components/Babylon/Mocks/MockPixelToSceneRayUC.d.ts +3 -0
  6. package/lib/Components/Babylon/Mocks/MockPixelToSceneRayUC.js +7 -3
  7. package/lib/Components/Babylon/Mocks/MockScenePixelPickUC.d.ts +2 -1
  8. package/lib/Components/Babylon/Mocks/MockScenePixelPickUC.js +5 -1
  9. package/lib/Components/Babylon/Mocks/MockSceneRayPickUC.d.ts +2 -1
  10. package/lib/Components/Babylon/Mocks/MockSceneRayPickUC.js +5 -1
  11. package/lib/Components/Babylon/Mocks/index.d.ts +4 -0
  12. package/lib/Components/Babylon/Mocks/index.js +16 -0
  13. package/lib/Components/Dispatcher/Mocks/MockDispatchStateChange.d.ts +2 -0
  14. package/lib/Components/Dispatcher/Mocks/MockDispatchStateChange.js +5 -1
  15. package/lib/Components/Dispatcher/Mocks/MockDispatcher.d.ts +2 -0
  16. package/lib/Components/Dispatcher/Mocks/MockDispatcher.js +5 -1
  17. package/lib/Components/Dispatcher/Mocks/MockShowAlert.d.ts +8 -0
  18. package/lib/Components/Dispatcher/Mocks/MockShowAlert.js +15 -0
  19. package/lib/Components/Dispatcher/Mocks/MockShowConfirm.d.ts +8 -0
  20. package/lib/Components/Dispatcher/Mocks/MockShowConfirm.js +15 -0
  21. package/lib/Components/Dispatcher/Mocks/MockShowMarkdown.d.ts +8 -0
  22. package/lib/Components/Dispatcher/Mocks/MockShowMarkdown.js +15 -0
  23. package/lib/Components/Dispatcher/Mocks/MockSubmitResult.d.ts +12 -0
  24. package/lib/Components/Dispatcher/Mocks/MockSubmitResult.js +19 -0
  25. package/lib/Components/Dispatcher/Mocks/index.d.ts +6 -0
  26. package/lib/Components/Dispatcher/Mocks/index.js +18 -0
  27. package/lib/Components/HoverLabel/Controllers/HoverLabelMouse.d.ts +0 -9
  28. package/lib/Components/HoverLabel/Controllers/HoverLabelMouse.js +2 -3
  29. package/lib/Components/HoverLabel/Controllers/HoverLabelTouch.d.ts +0 -13
  30. package/lib/Components/HoverLabel/Controllers/HoverLabelTouch.js +2 -3
  31. package/lib/Components/HoverLabel/Controllers/StylusHoverLabel.d.ts +16 -0
  32. package/lib/Components/HoverLabel/Controllers/StylusHoverLabel.js +43 -0
  33. package/lib/Components/HoverLabel/Controllers/index.d.ts +1 -0
  34. package/lib/Components/HoverLabel/Controllers/index.js +1 -0
  35. package/lib/Components/HoverLabel/Entities/HoverLabel.d.ts +14 -4
  36. package/lib/Components/HoverLabel/Entities/HoverLabel.js +43 -9
  37. package/lib/Components/HoverLabel/Mocks/MockTryShowHoverLabelUC.d.ts +9 -0
  38. package/lib/Components/HoverLabel/Mocks/MockTryShowHoverLabelUC.js +16 -0
  39. package/lib/Components/HoverLabel/Mocks/index.d.ts +1 -0
  40. package/lib/Components/HoverLabel/Mocks/index.js +13 -0
  41. package/lib/Components/HoverLabel/PM/ScreenHoverLabelPM.d.ts +19 -0
  42. package/lib/Components/HoverLabel/PM/ScreenHoverLabelPM.js +62 -0
  43. package/lib/Components/HoverLabel/PM/WorldHoverLabelPM.d.ts +15 -0
  44. package/lib/Components/HoverLabel/PM/WorldHoverLabelPM.js +55 -0
  45. package/lib/Components/HoverLabel/PM/index.d.ts +2 -1
  46. package/lib/Components/HoverLabel/PM/index.js +2 -1
  47. package/lib/Components/HoverLabel/UseCases/TryShowHoverLabel.d.ts +3 -2
  48. package/lib/Components/HoverLabel/UseCases/TryShowHoverLabel.js +38 -25
  49. package/lib/Components/HoverLabel/index.d.ts +2 -2
  50. package/lib/Components/HoverLabel/index.js +2 -2
  51. package/lib/Components/KeyboardInput/Mocks/index.d.ts +1 -0
  52. package/lib/Components/KeyboardInput/Mocks/index.js +13 -0
  53. package/lib/Components/Landmarks/Entities/LandmarkGlobals.d.ts +1 -1
  54. package/lib/Components/Landmarks/Mocks/index.d.ts +1 -0
  55. package/lib/Components/Landmarks/Mocks/index.js +13 -0
  56. package/lib/Components/Landmarks/UseCases/AddLandmarkUC.js +2 -2
  57. package/lib/Components/MouseInput/Mocks/index.d.ts +1 -0
  58. package/lib/Components/MouseInput/Mocks/index.js +13 -0
  59. package/lib/Components/Question/Mocks/MockValidateQuestion.d.ts +8 -0
  60. package/lib/Components/Question/Mocks/MockValidateQuestion.js +15 -0
  61. package/lib/Components/Question/Mocks/index.d.ts +2 -0
  62. package/lib/Components/Question/Mocks/index.js +14 -0
  63. package/lib/Components/RequestHandler/Mocks/index.d.ts +1 -0
  64. package/lib/Components/RequestHandler/Mocks/index.js +13 -0
  65. package/lib/Components/TouchController/Mock/index.d.ts +2 -0
  66. package/lib/Components/TouchController/Mock/index.js +14 -0
  67. package/lib/Components/UndoRedo/Mocks/index.d.ts +1 -0
  68. package/lib/Components/UndoRedo/Mocks/index.js +13 -0
  69. package/lib/Components/zSpace/Entities/ZSpaceEntity.js +2 -9
  70. package/lib/Components/zSpace/Entities/ZSpaceStylusEntity.d.ts +2 -0
  71. package/lib/Components/zSpace/Entities/ZSpaceStylusEntity.js +4 -0
  72. package/lib/Components/zSpace/Mocks/index.d.ts +1 -0
  73. package/lib/Components/zSpace/Mocks/index.js +13 -0
  74. package/package.json +1 -1
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeMockTryShowHoverLabelUC = exports.MockTryShowHoverLabelUC = void 0;
4
+ const UseCases_1 = require("../UseCases");
5
+ class MockTryShowHoverLabelUC extends UseCases_1.TryShowHoverLabel {
6
+ constructor(appObject) {
7
+ super(appObject, UseCases_1.TryShowHoverLabel.type);
8
+ this.tryShowWorldHoverLabel = jest.fn();
9
+ this.tryShowScreenHoverLabel = jest.fn();
10
+ }
11
+ }
12
+ exports.MockTryShowHoverLabelUC = MockTryShowHoverLabelUC;
13
+ function makeMockTryShowHoverLabelUC(appObjects) {
14
+ return new MockTryShowHoverLabelUC(appObjects.getOrCreate("HoverLabels"));
15
+ }
16
+ exports.makeMockTryShowHoverLabelUC = makeMockTryShowHoverLabelUC;
@@ -0,0 +1 @@
1
+ export * from "./MockTryShowHoverLabelUC";
@@ -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("./MockTryShowHoverLabelUC"), exports);
@@ -0,0 +1,19 @@
1
+ import { AppObject, AppObjectPM, AppObjectRepo } from "../../../AppObject";
2
+ export interface ScreenHoverLabelVM {
3
+ show: boolean;
4
+ text: string;
5
+ screenPosition: {
6
+ x: number;
7
+ y: number;
8
+ };
9
+ }
10
+ export declare class ScreenHoverLabelPM extends AppObjectPM<ScreenHoverLabelVM> {
11
+ static readonly type = "ScreenHoverLabelPM";
12
+ static get(appObjects: AppObjectRepo): ScreenHoverLabelPM | undefined;
13
+ private hoverLabelEntity?;
14
+ vmsAreEqual(a: ScreenHoverLabelVM, b: ScreenHoverLabelVM): boolean;
15
+ onEntityChange: () => void;
16
+ dispose: () => void;
17
+ constructor(appObject: AppObject);
18
+ }
19
+ export declare const defaultScreenHoverLabelVM: ScreenHoverLabelVM;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defaultScreenHoverLabelVM = exports.ScreenHoverLabelPM = void 0;
4
+ const AppObject_1 = require("../../../AppObject");
5
+ const HoverLabel_1 = require("../Entities/HoverLabel");
6
+ class ScreenHoverLabelPM extends AppObject_1.AppObjectPM {
7
+ constructor(appObject) {
8
+ super(appObject, ScreenHoverLabelPM.type);
9
+ this.onEntityChange = () => {
10
+ if (!this.hoverLabelEntity)
11
+ return;
12
+ const vm = {
13
+ show: false,
14
+ text: "",
15
+ screenPosition: { x: 0, y: 0 },
16
+ };
17
+ if (this.hoverLabelEntity.mode === HoverLabel_1.HoverLabelMode.SCREEN &&
18
+ this.hoverLabelEntity.show) {
19
+ vm.show = true;
20
+ vm.text = this.hoverLabelEntity.label;
21
+ vm.screenPosition.x = this.hoverLabelEntity.pixelPosition.x;
22
+ vm.screenPosition.y = this.hoverLabelEntity.pixelPosition.y;
23
+ }
24
+ this.doUpdateView(vm);
25
+ };
26
+ this.dispose = () => {
27
+ var _a, _b;
28
+ super.dispose();
29
+ (_a = this.hoverLabelEntity) === null || _a === void 0 ? void 0 : _a.removeChangeObserver(this.onEntityChange);
30
+ (_b = this.hoverLabelEntity) === null || _b === void 0 ? void 0 : _b.removeOnDisposeObserver(this.dispose);
31
+ };
32
+ this.hoverLabelEntity = this.appObject.getComponent(HoverLabel_1.HoverLabelEntity.type);
33
+ if (!this.hoverLabelEntity) {
34
+ this.warn("Serializer has been added to an App Object that does not have a HoverLabelEntity. Add the Entity first");
35
+ return;
36
+ }
37
+ this.hoverLabelEntity.addChangeObserver(this.onEntityChange);
38
+ this.hoverLabelEntity.addOnDisposeObserver(() => this.dispose());
39
+ this.onEntityChange();
40
+ this.appObjects.registerSingleton(this);
41
+ }
42
+ static get(appObjects) {
43
+ return AppObject_1.getSingletonComponent(ScreenHoverLabelPM.type, appObjects);
44
+ }
45
+ vmsAreEqual(a, b) {
46
+ if (a.show !== b.show)
47
+ return false;
48
+ if (a.text !== b.text)
49
+ return false;
50
+ if (a.screenPosition.x !== b.screenPosition.x ||
51
+ a.screenPosition.y !== b.screenPosition.y)
52
+ return false;
53
+ return true;
54
+ }
55
+ }
56
+ exports.ScreenHoverLabelPM = ScreenHoverLabelPM;
57
+ ScreenHoverLabelPM.type = "ScreenHoverLabelPM";
58
+ exports.defaultScreenHoverLabelVM = {
59
+ show: false,
60
+ text: "",
61
+ screenPosition: { x: 0, y: 0 },
62
+ };
@@ -0,0 +1,15 @@
1
+ import { AppObject, AppObjectPM, AppObjectRepo } from "../../../AppObject";
2
+ export interface WorldHoverLabelVM {
3
+ show: boolean;
4
+ text: string;
5
+ }
6
+ export declare class WorldHoverLabelPM extends AppObjectPM<WorldHoverLabelVM> {
7
+ static readonly type = "WorldHoverLabelPM";
8
+ static get(appObjects: AppObjectRepo): WorldHoverLabelPM | undefined;
9
+ private hoverLabelEntity?;
10
+ vmsAreEqual(a: WorldHoverLabelVM, b: WorldHoverLabelVM): boolean;
11
+ onEntityChange: () => void;
12
+ dispose: () => void;
13
+ constructor(appObject: AppObject);
14
+ }
15
+ export declare const defaultWorldHoverLabelVM: WorldHoverLabelVM;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defaultWorldHoverLabelVM = exports.WorldHoverLabelPM = void 0;
4
+ const AppObject_1 = require("../../../AppObject");
5
+ const HoverLabel_1 = require("../Entities/HoverLabel");
6
+ class WorldHoverLabelPM extends AppObject_1.AppObjectPM {
7
+ constructor(appObject) {
8
+ super(appObject, WorldHoverLabelPM.type);
9
+ this.onEntityChange = () => {
10
+ if (!this.hoverLabelEntity)
11
+ return;
12
+ const vm = {
13
+ show: false,
14
+ text: "",
15
+ };
16
+ if (this.hoverLabelEntity.mode === HoverLabel_1.HoverLabelMode.WORLD &&
17
+ this.hoverLabelEntity.show) {
18
+ vm.show = true;
19
+ vm.text = this.hoverLabelEntity.label;
20
+ }
21
+ this.doUpdateView(vm);
22
+ };
23
+ this.dispose = () => {
24
+ var _a, _b;
25
+ super.dispose();
26
+ (_a = this.hoverLabelEntity) === null || _a === void 0 ? void 0 : _a.removeChangeObserver(this.onEntityChange);
27
+ (_b = this.hoverLabelEntity) === null || _b === void 0 ? void 0 : _b.removeOnDisposeObserver(this.dispose);
28
+ };
29
+ this.hoverLabelEntity = this.appObject.getComponent(HoverLabel_1.HoverLabelEntity.type);
30
+ if (!this.hoverLabelEntity) {
31
+ this.warn("Serializer has been added to an App Object that does not have a HoverLabelEntity. Add the Entity first");
32
+ return;
33
+ }
34
+ this.hoverLabelEntity.addChangeObserver(this.onEntityChange);
35
+ this.hoverLabelEntity.addOnDisposeObserver(() => this.dispose());
36
+ this.onEntityChange();
37
+ this.appObjects.registerSingleton(this);
38
+ }
39
+ static get(appObjects) {
40
+ return AppObject_1.getSingletonComponent(WorldHoverLabelPM.type, appObjects);
41
+ }
42
+ vmsAreEqual(a, b) {
43
+ if (a.show !== b.show)
44
+ return false;
45
+ if (a.text !== b.text)
46
+ return false;
47
+ return true;
48
+ }
49
+ }
50
+ exports.WorldHoverLabelPM = WorldHoverLabelPM;
51
+ WorldHoverLabelPM.type = "WorldHoverLabelPM";
52
+ exports.defaultWorldHoverLabelVM = {
53
+ show: false,
54
+ text: "",
55
+ };
@@ -1,2 +1,3 @@
1
1
  export * from "./AllowHoverLabelPM";
2
- export * from "./HoverLabelPM";
2
+ export * from "./ScreenHoverLabelPM";
3
+ export * from "./WorldHoverLabelPM";
@@ -11,4 +11,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./AllowHoverLabelPM"), exports);
14
- __exportStar(require("./HoverLabelPM"), exports);
14
+ __exportStar(require("./ScreenHoverLabelPM"), exports);
15
+ __exportStar(require("./WorldHoverLabelPM"), exports);
@@ -1,8 +1,9 @@
1
1
  import { AppObject, AppObjectRepo, AppObjectUC } from "../../../AppObject";
2
- import { Vector2 } from "../../../ValueObjects";
2
+ import { ParametricLine, Vector2 } from "../../../ValueObjects";
3
3
  export declare abstract class TryShowHoverLabel extends AppObjectUC {
4
4
  static readonly type = "TryShowHoverLabel";
5
- abstract tryShowHoverLabel(position: Vector2): void;
5
+ abstract tryShowScreenHoverLabel(position: Vector2): void;
6
+ abstract tryShowWorldHoverLabel(ray: ParametricLine): void;
6
7
  static get(appObjects: AppObjectRepo): TryShowHoverLabel | undefined;
7
8
  }
8
9
  export declare function makeTryShowHoverLabel(appObject: AppObject): TryShowHoverLabel;
@@ -7,15 +7,7 @@ const Label_1 = require("../../Label");
7
7
  const HoverLabel_1 = require("../Entities/HoverLabel");
8
8
  class TryShowHoverLabel extends AppObject_1.AppObjectUC {
9
9
  static get(appObjects) {
10
- const ucs = appObjects.getAllComponents(TryShowHoverLabel.type);
11
- if (ucs.length === 0) {
12
- console.warn("Unable to find a TryShowHoverLabel. Add one on Mount");
13
- return undefined;
14
- }
15
- else if (ucs.length > 1) {
16
- console.warn("Multiple TryShowHoverLabel have been found. There should only be one. Using the first one");
17
- }
18
- return ucs[0];
10
+ return AppObject_1.getSingletonComponent(TryShowHoverLabel.type, appObjects);
19
11
  }
20
12
  }
21
13
  exports.TryShowHoverLabel = TryShowHoverLabel;
@@ -27,27 +19,27 @@ exports.makeTryShowHoverLabel = makeTryShowHoverLabel;
27
19
  class TryShowHoverLabelIMP extends TryShowHoverLabel {
28
20
  constructor(appObject) {
29
21
  super(appObject, TryShowHoverLabel.type);
30
- this.tryShowHoverLabel = (position) => {
22
+ this.tryShowScreenHoverLabel = (position) => {
23
+ var _a;
31
24
  if (!this.hoverLabelEntity)
32
25
  return;
33
- if (!this.hoverLabelEntity.allowHoverLabel) {
34
- this.hoverLabelEntity.hideHoverLabel();
35
- return;
26
+ const appObjectID = (_a = Babylon_1.scenePixelPick(position, this.appObjects)) === null || _a === void 0 ? void 0 : _a.appObjectID;
27
+ const displayLabel = this.getDisplayLabelForAppObjectID(appObjectID);
28
+ if (displayLabel) {
29
+ this.hoverLabelEntity.showScreenHoverLabel(displayLabel, position);
36
30
  }
37
- const scenePick = Babylon_1.scenePixelPick(position, this.appObjects);
38
- if (!scenePick || !scenePick.appObjectID) {
39
- return;
40
- }
41
- const appObj = this.appObjects.get(scenePick.appObjectID);
42
- if (!appObj) {
43
- return;
31
+ else {
32
+ this.hoverLabelEntity.hideHoverLabel();
44
33
  }
45
- const label = Label_1.Label.get(appObj);
46
- if (!label) {
34
+ };
35
+ this.tryShowWorldHoverLabel = (ray) => {
36
+ if (!this.hoverLabelEntity)
47
37
  return;
48
- }
49
- if (label.display) {
50
- this.hoverLabelEntity.showHoverLabel(label.display, position);
38
+ const pickHit = Babylon_1.sceneRayPick(ray, this.appObjects);
39
+ const appObjectID = pickHit === null || pickHit === void 0 ? void 0 : pickHit.appObjectID;
40
+ const displayLabel = this.getDisplayLabelForAppObjectID(appObjectID);
41
+ if (displayLabel && (pickHit === null || pickHit === void 0 ? void 0 : pickHit.worldPickPoint)) {
42
+ this.hoverLabelEntity.showWorldHoverLabel(displayLabel, pickHit.worldPickPoint);
51
43
  }
52
44
  else {
53
45
  this.hoverLabelEntity.hideHoverLabel();
@@ -57,5 +49,26 @@ class TryShowHoverLabelIMP extends TryShowHoverLabel {
57
49
  if (!this.hoverLabelEntity) {
58
50
  this.warn("PM has been added to an App Object that does not have a HoverLabelEntity. Add the Entity first");
59
51
  }
52
+ this.appObjects.registerSingleton(this);
53
+ }
54
+ getDisplayLabelForAppObjectID(appObjectID) {
55
+ if (!appObjectID)
56
+ return;
57
+ if (!this.hoverLabelEntity)
58
+ return;
59
+ if (!this.hoverLabelEntity.allowHoverLabel) {
60
+ return;
61
+ }
62
+ const appObj = this.appObjects.get(appObjectID);
63
+ if (!appObj) {
64
+ return;
65
+ }
66
+ const label = Label_1.Label.get(appObj);
67
+ if (!label) {
68
+ return;
69
+ }
70
+ if (label.display) {
71
+ return label.display;
72
+ }
60
73
  }
61
74
  }
@@ -1,4 +1,4 @@
1
+ export * from "./Controllers";
1
2
  export * from "./Entities";
2
- export * from "./UseCases";
3
3
  export * from "./PM";
4
- export * from "./Controllers";
4
+ export * from "./UseCases";
@@ -10,7 +10,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./Controllers"), exports);
13
14
  __exportStar(require("./Entities"), exports);
14
- __exportStar(require("./UseCases"), exports);
15
15
  __exportStar(require("./PM"), exports);
16
- __exportStar(require("./Controllers"), exports);
16
+ __exportStar(require("./UseCases"), exports);
@@ -0,0 +1 @@
1
+ export * from "./MockKeyboardInput";
@@ -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("./MockKeyboardInput"), exports);
@@ -5,7 +5,7 @@ import { LandmarkRepo } from "./LandmarkRepo";
5
5
  export declare abstract class LandmarkGlobals extends AppObjectEntity {
6
6
  static readonly type = "LandmarkGlobals";
7
7
  static get: (appObjects: AppObjectRepo) => LandmarkGlobals | undefined;
8
- abstract landmarkFactory(id: string): LandmarkEntity | undefined;
8
+ abstract landmarkFactory(id: string, parentID: string): LandmarkEntity | undefined;
9
9
  abstract landmarkRepoFactory(id: string): LandmarkRepo | undefined;
10
10
  abstract lastSize: number;
11
11
  abstract lastColor: OverlayColorEnums;
@@ -0,0 +1 @@
1
+ export * from "./MockLandmark";
@@ -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("./MockLandmark"), exports);
@@ -43,7 +43,7 @@ class AddLandmarkUCImp extends AddLandmarkUC {
43
43
  const globals = this.appObjects.getSingleton(LandmarkGlobals_1.LandmarkGlobals.type);
44
44
  if (!globals)
45
45
  return;
46
- const newLandmark = globals.landmarkFactory(data.id);
46
+ const newLandmark = globals.landmarkFactory(data.id, this.appObject.id);
47
47
  if (!newLandmark)
48
48
  return;
49
49
  newLandmark.transform.parent = this.transform3D;
@@ -57,7 +57,7 @@ class AddLandmarkUCImp extends AddLandmarkUC {
57
57
  const globals = this.appObjects.getSingleton(LandmarkGlobals_1.LandmarkGlobals.type);
58
58
  if (!globals)
59
59
  return;
60
- const newLandmark = globals.landmarkFactory(Utilities_1.generateUniqueID());
60
+ const newLandmark = globals.landmarkFactory(Utilities_1.generateUniqueID(), this.appObject.id);
61
61
  if (!newLandmark)
62
62
  return;
63
63
  newLandmark.transform.parent = this.transform3D;
@@ -0,0 +1 @@
1
+ export * from "./MockMouseInput";
@@ -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("./MockMouseInput"), exports);
@@ -0,0 +1,8 @@
1
+ /// <reference types="jest" />
2
+ import { AppObject, AppObjectRepo } from "../../../AppObject";
3
+ import { ValidateQuestionChallengeStateUC } from "../UC";
4
+ export declare class MockValidateQuestion extends ValidateQuestionChallengeStateUC {
5
+ validate: jest.Mock<any, any>;
6
+ constructor(appObject: AppObject);
7
+ }
8
+ export declare function makeMockValidateQuestion(appObjects: AppObjectRepo): MockValidateQuestion;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeMockValidateQuestion = exports.MockValidateQuestion = void 0;
4
+ const UC_1 = require("../UC");
5
+ class MockValidateQuestion extends UC_1.ValidateQuestionChallengeStateUC {
6
+ constructor(appObject) {
7
+ super(appObject, UC_1.ValidateQuestionChallengeStateUC.type);
8
+ this.validate = jest.fn();
9
+ }
10
+ }
11
+ exports.MockValidateQuestion = MockValidateQuestion;
12
+ function makeMockValidateQuestion(appObjects) {
13
+ return new MockValidateQuestion(appObjects.getOrCreate("QuestionEntity"));
14
+ }
15
+ exports.makeMockValidateQuestion = makeMockValidateQuestion;
@@ -0,0 +1,2 @@
1
+ export * from "./MockQuestionAnswerEntity";
2
+ export * from "./MockValidateQuestion";
@@ -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("./MockQuestionAnswerEntity"), exports);
14
+ __exportStar(require("./MockValidateQuestion"), exports);
@@ -0,0 +1 @@
1
+ export * from "./MockAppHandlerEntity";
@@ -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("./MockAppHandlerEntity"), exports);
@@ -0,0 +1,2 @@
1
+ export * from "./MockTouchInput";
2
+ export * from "./mockTouchInputEvent";
@@ -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("./MockTouchInput"), exports);
14
+ __exportStar(require("./mockTouchInputEvent"), exports);
@@ -0,0 +1 @@
1
+ export * from "./MockUndoRedo";
@@ -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("./MockUndoRedo"), exports);
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.tempScaleCoef = exports.makeZSpaceEntity = exports.ZSpaceEntity = exports.INSPIRE_WIDTH = void 0;
4
+ const AppObject_1 = require("../../../AppObject");
4
5
  const AppObjectEntity_1 = require("../../../AppObject/AppObjectEntity");
5
6
  const Entities_1 = require("../../../Entities");
6
7
  const ZSpaceDisplayEntity_1 = require("./ZSpaceDisplayEntity");
@@ -9,15 +10,7 @@ const ZSpaceViewEntity_1 = require("./ZSpaceViewEntity");
9
10
  exports.INSPIRE_WIDTH = 0.344;
10
11
  class ZSpaceEntity extends AppObjectEntity_1.AppObjectEntity {
11
12
  static get(appObjects) {
12
- const selectionEntities = appObjects.getAllComponents(ZSpaceEntity.type);
13
- if (selectionEntities.length === 0) {
14
- console.warn("Unable to find a ZSpaceEntity. Add one on Mount");
15
- return undefined;
16
- }
17
- else if (selectionEntities.length > 1) {
18
- console.warn("Many ZSpaceEntity have been found. There should only be one. Using the first one");
19
- }
20
- return selectionEntities[0];
13
+ return AppObject_1.getSingletonComponent(ZSpaceEntity.type, appObjects);
21
14
  }
22
15
  }
23
16
  exports.ZSpaceEntity = ZSpaceEntity;
@@ -1,3 +1,4 @@
1
+ import { AppObjectRepo } from "../../../AppObject";
1
2
  import { AppObject } from "../../../AppObject/AppObject";
2
3
  import { AppObjectEntity } from "../../../AppObject/AppObjectEntity";
3
4
  import { ParametricLine } from "../../../ValueObjects";
@@ -23,5 +24,6 @@ export declare abstract class ZSpaceStylusEntity extends AppObjectEntity {
23
24
  abstract readonly helperTransform: Transform3D;
24
25
  abstract get pickRay(): ParametricLine;
25
26
  abstract get isInUse(): boolean;
27
+ static get(appObjects: AppObjectRepo): ZSpaceStylusEntity | undefined;
26
28
  }
27
29
  export declare function makeZSpaceStylus(appObj: AppObject): ZSpaceStylusEntity;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.makeZSpaceStylus = exports.ZSpaceStylusEntity = exports.ZSpaceStylusButton = void 0;
4
+ const AppObject_1 = require("../../../AppObject");
4
5
  const AppObjectEntity_1 = require("../../../AppObject/AppObjectEntity");
5
6
  const Entities_1 = require("../../../Entities");
6
7
  const ValueObjects_1 = require("../../../ValueObjects");
@@ -12,6 +13,9 @@ var ZSpaceStylusButton;
12
13
  ZSpaceStylusButton[ZSpaceStylusButton["BACK_LEFT"] = 2] = "BACK_LEFT";
13
14
  })(ZSpaceStylusButton = exports.ZSpaceStylusButton || (exports.ZSpaceStylusButton = {}));
14
15
  class ZSpaceStylusEntity extends AppObjectEntity_1.AppObjectEntity {
16
+ static get(appObjects) {
17
+ return AppObject_1.getSingletonComponent(ZSpaceStylusEntity.type, appObjects);
18
+ }
15
19
  }
16
20
  exports.ZSpaceStylusEntity = ZSpaceStylusEntity;
17
21
  ZSpaceStylusEntity.type = "ZSpaceStylusEntity";
@@ -0,0 +1 @@
1
+ export * from "./MockCheckZSpaceDisplaySizeUC";
@@ -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("./MockCheckZSpaceDisplaySizeUC"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vived/app",
3
- "version": "4.9.2",
3
+ "version": "4.10.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",