@vived/app 4.34.11 → 4.35.1

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 (165) hide show
  1. package/lib/AppObject/AppObjectComponent.d.ts +9 -0
  2. package/lib/AppObject/AppObjectComponent.js +11 -1
  3. package/lib/AppObject/AppObjectController.d.ts +2 -1
  4. package/lib/AppObject/AppObjectController.js +4 -0
  5. package/lib/AppObject/AppObjectEntity.d.ts +2 -1
  6. package/lib/AppObject/AppObjectEntity.js +1 -0
  7. package/lib/AppObject/AppObjectPM.d.ts +2 -1
  8. package/lib/AppObject/AppObjectPM.js +1 -0
  9. package/lib/AppObject/AppObjectUC.d.ts +2 -1
  10. package/lib/AppObject/AppObjectUC.js +4 -0
  11. package/lib/AppObject/AppObjectView.d.ts +2 -1
  12. package/lib/AppObject/AppObjectView.js +4 -0
  13. package/lib/Components/ChannelModel/Entities/ChannelModel.js +1 -1
  14. package/lib/Components/FramedScreen/Factories/setupStandardFramedScreen.d.ts +4 -1
  15. package/lib/Components/FramedScreen/Factories/setupStandardFramedScreen.js +4 -2
  16. package/lib/Components/HoverLabel/Factories/setupHoverLabel.d.ts +16 -2
  17. package/lib/Components/HoverLabel/Factories/setupHoverLabel.js +8 -2
  18. package/lib/Components/LabelDrop/UseCases/DragLabelDropUC.js +3 -3
  19. package/lib/Utilities/LerpNumber.d.ts +56 -0
  20. package/lib/Utilities/LerpNumber.js +85 -0
  21. package/lib/Utilities/LerpNumberX.d.ts +56 -0
  22. package/lib/Utilities/LerpNumberX.js +85 -0
  23. package/lib/Utilities/index.d.ts +2 -0
  24. package/lib/Utilities/index.js +2 -0
  25. package/lib/Utilities/interpolateNumber.d.ts +1 -0
  26. package/lib/Utilities/{lerpNumber.js → interpolateNumber.js} +3 -3
  27. package/lib/ValueObjects/Vector3.js +4 -4
  28. package/package.json +1 -1
  29. package/lib/Components/App/Adapters/index.d.ts +0 -4
  30. package/lib/Components/App/Adapters/index.js +0 -16
  31. package/lib/Components/App/Adapters/isAuthoringAdapter.d.ts +0 -2
  32. package/lib/Components/App/Adapters/isAuthoringAdapter.js +0 -23
  33. package/lib/Components/App/Adapters/isReviewingAdapter.d.ts +0 -2
  34. package/lib/Components/App/Adapters/isReviewingAdapter.js +0 -23
  35. package/lib/Components/App/Adapters/slideNavigationAdapter.d.ts +0 -3
  36. package/lib/Components/App/Adapters/slideNavigationAdapter.js +0 -23
  37. package/lib/Components/App/Adapters/slideTextAdapter.d.ts +0 -2
  38. package/lib/Components/App/Adapters/slideTextAdapter.js +0 -23
  39. package/lib/Components/App/Controller/clickContinue.d.ts +0 -2
  40. package/lib/Components/App/Controller/clickContinue.js +0 -13
  41. package/lib/Components/App/Controller/clickEditSlideText.d.ts +0 -2
  42. package/lib/Components/App/Controller/clickEditSlideText.js +0 -13
  43. package/lib/Components/App/Controller/index.d.ts +0 -5
  44. package/lib/Components/App/Controller/index.js +0 -17
  45. package/lib/Components/App/Controller/removeRenderCanvas.d.ts +0 -2
  46. package/lib/Components/App/Controller/removeRenderCanvas.js +0 -13
  47. package/lib/Components/App/Controller/submitRenderCanvas.d.ts +0 -2
  48. package/lib/Components/App/Controller/submitRenderCanvas.js +0 -13
  49. package/lib/Components/App/Controller/updateContentSize.d.ts +0 -2
  50. package/lib/Components/App/Controller/updateContentSize.js +0 -13
  51. package/lib/Components/App/Entity/BaseAppState.d.ts +0 -20
  52. package/lib/Components/App/Entity/BaseAppState.js +0 -68
  53. package/lib/Components/App/Entity/index.d.ts +0 -1
  54. package/lib/Components/App/Entity/index.js +0 -13
  55. package/lib/Components/App/Mocks/IsAuthoringMock.d.ts +0 -8
  56. package/lib/Components/App/Mocks/IsAuthoringMock.js +0 -15
  57. package/lib/Components/App/Mocks/IsReviewingMock.d.ts +0 -8
  58. package/lib/Components/App/Mocks/IsReviewingMock.js +0 -15
  59. package/lib/Components/App/Mocks/MockAppRenderingUC.d.ts +0 -10
  60. package/lib/Components/App/Mocks/MockAppRenderingUC.js +0 -16
  61. package/lib/Components/App/Mocks/MockRenderCanvasUC.d.ts +0 -10
  62. package/lib/Components/App/Mocks/MockRenderCanvasUC.js +0 -16
  63. package/lib/Components/App/Mocks/MockUpdateContentSizeUC.d.ts +0 -9
  64. package/lib/Components/App/Mocks/MockUpdateContentSizeUC.js +0 -15
  65. package/lib/Components/App/Mocks/SlideNavigationMock.d.ts +0 -8
  66. package/lib/Components/App/Mocks/SlideNavigationMock.js +0 -15
  67. package/lib/Components/App/Mocks/SlideTextMock.d.ts +0 -8
  68. package/lib/Components/App/Mocks/SlideTextMock.js +0 -15
  69. package/lib/Components/App/Mocks/index.d.ts +0 -7
  70. package/lib/Components/App/Mocks/index.js +0 -19
  71. package/lib/Components/App/PM/IsAuthoringPM.d.ts +0 -6
  72. package/lib/Components/App/PM/IsAuthoringPM.js +0 -39
  73. package/lib/Components/App/PM/IsReviewingPM.d.ts +0 -6
  74. package/lib/Components/App/PM/IsReviewingPM.js +0 -39
  75. package/lib/Components/App/PM/SlideNavigationPM.d.ts +0 -12
  76. package/lib/Components/App/PM/SlideNavigationPM.js +0 -49
  77. package/lib/Components/App/PM/SlideTextPM.d.ts +0 -6
  78. package/lib/Components/App/PM/SlideTextPM.js +0 -34
  79. package/lib/Components/App/PM/index.d.ts +0 -4
  80. package/lib/Components/App/PM/index.js +0 -16
  81. package/lib/Components/App/UC/AppRenderingUC.d.ts +0 -7
  82. package/lib/Components/App/UC/AppRenderingUC.js +0 -9
  83. package/lib/Components/App/UC/EditSlideTextUC.d.ts +0 -10
  84. package/lib/Components/App/UC/EditSlideTextUC.js +0 -57
  85. package/lib/Components/App/UC/RenderCanvasUC.d.ts +0 -10
  86. package/lib/Components/App/UC/RenderCanvasUC.js +0 -88
  87. package/lib/Components/App/UC/SerializeBaseAppState.d.ts +0 -17
  88. package/lib/Components/App/UC/SerializeBaseAppState.js +0 -59
  89. package/lib/Components/App/UC/UndoRedoEditSlideText.d.ts +0 -11
  90. package/lib/Components/App/UC/UndoRedoEditSlideText.js +0 -43
  91. package/lib/Components/App/UC/UpdateContentSizeUC.d.ts +0 -7
  92. package/lib/Components/App/UC/UpdateContentSizeUC.js +0 -33
  93. package/lib/Components/App/UC/index.d.ts +0 -7
  94. package/lib/Components/App/UC/index.js +0 -19
  95. package/lib/Components/App/index.d.ts +0 -6
  96. package/lib/Components/App/index.js +0 -18
  97. package/lib/Components/Callouts/Controller/MouseCalloutRoll.d.ts +0 -9
  98. package/lib/Components/Callouts/Controller/MouseCalloutRoll.js +0 -27
  99. package/lib/Components/Callouts/Mocks/MoveCalloutToCamUcMock.d.ts +0 -7
  100. package/lib/Components/Callouts/Mocks/MoveCalloutToCamUcMock.js +0 -11
  101. package/lib/Components/Callouts/Mocks/TryBumpLabelUcMock.d.ts +0 -9
  102. package/lib/Components/Callouts/Mocks/TryBumpLabelUcMock.js +0 -13
  103. package/lib/Components/Callouts/UC/MoveCalloutToCamUC.d.ts +0 -14
  104. package/lib/Components/Callouts/UC/MoveCalloutToCamUC.js +0 -35
  105. package/lib/Components/Callouts/UC/TryBumpLabelUC.d.ts +0 -9
  106. package/lib/Components/Callouts/UC/TryBumpLabelUC.js +0 -61
  107. package/lib/Components/Challenge/React/challengeAuthorHelpHookAdapter.d.ts +0 -3
  108. package/lib/Components/Challenge/React/challengeAuthorHelpHookAdapter.js +0 -23
  109. package/lib/Components/Challenge/React/challengeConsumerHelpHookAdapter.d.ts +0 -3
  110. package/lib/Components/Challenge/React/challengeConsumerHelpHookAdapter.js +0 -23
  111. package/lib/Components/Challenge/React/index.d.ts +0 -3
  112. package/lib/Components/Challenge/React/index.js +0 -15
  113. package/lib/Components/Challenge/React/selectedChallengeHookAdapter.d.ts +0 -3
  114. package/lib/Components/Challenge/React/selectedChallengeHookAdapter.js +0 -29
  115. package/lib/Components/Challenge/UCs/SetChallengeUndo.d.ts +0 -11
  116. package/lib/Components/Challenge/UCs/SetChallengeUndo.js +0 -37
  117. package/lib/Components/ChannelModel/Controllers/setModelObjectLabel.d.ts +0 -2
  118. package/lib/Components/ChannelModel/Controllers/setModelObjectLabel.js +0 -14
  119. package/lib/Components/ChannelModel/Mocks/ValidateObjectPickUcMock.d.ts +0 -8
  120. package/lib/Components/ChannelModel/Mocks/ValidateObjectPickUcMock.js +0 -15
  121. package/lib/Components/Enablement/Entities/EnablablementEntity.d.ts +0 -16
  122. package/lib/Components/Enablement/Entities/EnablablementEntity.js +0 -28
  123. package/lib/Components/Enablement/PM/EnablableStatePM.d.ts +0 -14
  124. package/lib/Components/Enablement/PM/EnablableStatePM.js +0 -41
  125. package/lib/Components/FramedScreen/Factories/setupFramedScreen.d.ts +0 -2
  126. package/lib/Components/FramedScreen/Factories/setupFramedScreen.js +0 -35
  127. package/lib/Components/FramedScreen/PM/FramedScreenContainerPM.d.ts +0 -18
  128. package/lib/Components/FramedScreen/PM/FramedScreenContainerPM.js +0 -55
  129. package/lib/Components/HoverLabel/Controllers/ToggleAllowHoverLabelController.d.ts +0 -2
  130. package/lib/Components/HoverLabel/Controllers/ToggleAllowHoverLabelController.js +0 -13
  131. package/lib/Components/HoverLabel/Entities/HoverLabel.d.ts +0 -23
  132. package/lib/Components/HoverLabel/Entities/HoverLabel.js +0 -102
  133. package/lib/Components/Label/Entities/Label.d.ts +0 -18
  134. package/lib/Components/Label/Entities/Label.js +0 -64
  135. package/lib/Components/Landmarks/Controller/SetSelectedLandmarkColor.d.ts +0 -3
  136. package/lib/Components/Landmarks/Controller/SetSelectedLandmarkColor.js +0 -24
  137. package/lib/Components/Landmarks/Controller/submitLandmarkSizeX.d.ts +0 -2
  138. package/lib/Components/Landmarks/Controller/submitLandmarkSizeX.js +0 -19
  139. package/lib/Components/Landmarks/Controller/updateLandmarkSizeX.d.ts +0 -2
  140. package/lib/Components/Landmarks/Controller/updateLandmarkSizeX.js +0 -19
  141. package/lib/Components/Landmarks/UseCases/AddLandmarkUC.d.ts +0 -8
  142. package/lib/Components/Landmarks/UseCases/AddLandmarkUC.js +0 -67
  143. package/lib/Components/Question/UC/registerQuestionChallenge.d.ts +0 -2
  144. package/lib/Components/Question/UC/registerQuestionChallenge.js +0 -20
  145. package/lib/Components/SceneRoot/Mocks/DragScaleSceneRootUcMock.d.ts +0 -9
  146. package/lib/Components/SceneRoot/Mocks/DragScaleSceneRootUcMock.js +0 -13
  147. package/lib/Components/SceneRoot/Mocks/OrbitSceneRootUcMock.d.ts +0 -11
  148. package/lib/Components/SceneRoot/Mocks/OrbitSceneRootUcMock.js +0 -15
  149. package/lib/Components/SceneRoot/Mocks/PanSceneRootUcMock.d.ts +0 -10
  150. package/lib/Components/SceneRoot/Mocks/PanSceneRootUcMock.js +0 -14
  151. package/lib/Components/Selection/Controller/HoverOnAppObjectSC.d.ts +0 -11
  152. package/lib/Components/Selection/Controller/HoverOnAppObjectSC.js +0 -41
  153. package/lib/Components/Selection/Controller/PressOnAppObjectSC.d.ts +0 -18
  154. package/lib/Components/Selection/Controller/PressOnAppObjectSC.js +0 -70
  155. package/lib/Components/Selection/Controller/SelectAppObjectSC.d.ts +0 -11
  156. package/lib/Components/Selection/Controller/SelectAppObjectSC.js +0 -39
  157. package/lib/Components/Transform3D/Controllers/Mouse/TryMousePanTransformMC.d.ts +0 -13
  158. package/lib/Components/Transform3D/Controllers/Mouse/TryMousePanTransformMC.js +0 -51
  159. package/lib/Components/Transform3D/Controllers/Touch/TryTouchPanTransformTC.d.ts +0 -12
  160. package/lib/Components/Transform3D/Controllers/Touch/TryTouchPanTransformTC.js +0 -53
  161. package/lib/Components/Transform3D/UC/DragTransformUC.d.ts +0 -11
  162. package/lib/Components/Transform3D/UC/DragTransformUC.js +0 -108
  163. package/lib/Components/Transform3D/UC/StickTransformUC.d.ts +0 -12
  164. package/lib/Components/Transform3D/UC/StickTransformUC.js +0 -72
  165. package/lib/Utilities/lerpNumber.d.ts +0 -1
@@ -1,51 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TryMousePanTransformMC = void 0;
4
- const AppObject_1 = require("../../../../AppObject");
5
- const MouseInput_1 = require("../../../MouseInput");
6
- const TryPanTransformUC_1 = require("../../UC/TryPanTransformUC");
7
- class TryMousePanTransformMC extends AppObject_1.AppObjectController {
8
- constructor(appObject) {
9
- var _a;
10
- super(appObject, TryMousePanTransformMC.type);
11
- this.allow = (e) => {
12
- if (e.button !== 0)
13
- return false;
14
- return true;
15
- };
16
- this.isDragging = false;
17
- this.onDown = (e) => {
18
- var _a, _b, _c;
19
- if (this.isDragging) {
20
- (_a = this.tryScreenDragUC) === null || _a === void 0 ? void 0 : _a.cancel();
21
- this.isDragging = false;
22
- }
23
- if (!this.allow(e)) {
24
- return;
25
- }
26
- this.isDragging = (_c = (_b = this.tryScreenDragUC) === null || _b === void 0 ? void 0 : _b.tryWithPixel(e.position)) !== null && _c !== void 0 ? _c : false;
27
- };
28
- this.onMove = (e) => {
29
- var _a;
30
- if (!this.isDragging)
31
- return;
32
- (_a = this.tryScreenDragUC) === null || _a === void 0 ? void 0 : _a.moveWithPixel(e.position);
33
- };
34
- this.onUp = () => {
35
- var _a;
36
- if (!this.isDragging)
37
- return;
38
- (_a = this.tryScreenDragUC) === null || _a === void 0 ? void 0 : _a.stop();
39
- this.isDragging = false;
40
- };
41
- (_a = this.mouseInput) === null || _a === void 0 ? void 0 : _a.registerController(this);
42
- }
43
- get mouseInput() {
44
- return this.getCachedSingleton(MouseInput_1.MouseInputEntity.type);
45
- }
46
- get tryScreenDragUC() {
47
- return this.getCachedLocalComponent(TryPanTransformUC_1.TryPanTransformUC.type);
48
- }
49
- }
50
- exports.TryMousePanTransformMC = TryMousePanTransformMC;
51
- TryMousePanTransformMC.type = "TryMousePanTransformMC";
@@ -1,12 +0,0 @@
1
- import { AppObject, AppObjectController } from "../../../../AppObject";
2
- import { TouchController, TouchInputEvent } from "../../../TouchController";
3
- export declare class TryTouchPanTransformTC extends AppObjectController implements TouchController {
4
- static readonly type = "TryTouchPanTransformTC";
5
- allow: (e: TouchInputEvent) => boolean;
6
- private get tryScreenDragUC();
7
- private isDragging;
8
- onTouchStart: (e: TouchInputEvent) => void;
9
- onTouchMove: (e: TouchInputEvent) => void;
10
- onTouchEnd: () => void;
11
- constructor(appObject: AppObject);
12
- }
@@ -1,53 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TryTouchPanTransformTC = void 0;
4
- const AppObject_1 = require("../../../../AppObject");
5
- const TouchController_1 = require("../../../TouchController");
6
- const TryPanTransformUC_1 = require("../../UC/TryPanTransformUC");
7
- class TryTouchPanTransformTC extends AppObject_1.AppObjectController {
8
- constructor(appObject) {
9
- super(appObject, TryTouchPanTransformTC.type);
10
- this.allow = (e) => {
11
- if (e.touches.length !== 1)
12
- return false;
13
- return true;
14
- };
15
- this.isDragging = false;
16
- this.onTouchStart = (e) => {
17
- var _a;
18
- if (this.isDragging) {
19
- (_a = this.tryScreenDragUC) === null || _a === void 0 ? void 0 : _a.cancel();
20
- this.isDragging = false;
21
- }
22
- if (!this.tryScreenDragUC)
23
- return;
24
- if (!this.allow(e))
25
- return;
26
- const position = e.touches[0].position;
27
- this.isDragging = this.tryScreenDragUC.tryWithPixel(position);
28
- };
29
- this.onTouchMove = (e) => {
30
- if (!this.tryScreenDragUC)
31
- return;
32
- if (!this.isDragging)
33
- return;
34
- const position = e.touches[0].position;
35
- this.tryScreenDragUC.moveWithPixel(position);
36
- };
37
- this.onTouchEnd = () => {
38
- if (!this.tryScreenDragUC)
39
- return;
40
- if (!this.isDragging)
41
- return;
42
- this.tryScreenDragUC.stop();
43
- this.isDragging = false;
44
- };
45
- const touchInput = TouchController_1.TouchInputEntity.get(this.appObjects);
46
- touchInput === null || touchInput === void 0 ? void 0 : touchInput.registerController(this);
47
- }
48
- get tryScreenDragUC() {
49
- return this.getCachedLocalComponent(TryPanTransformUC_1.TryPanTransformUC.type);
50
- }
51
- }
52
- exports.TryTouchPanTransformTC = TryTouchPanTransformTC;
53
- TryTouchPanTransformTC.type = "TryTouchPanTransformTC";
@@ -1,11 +0,0 @@
1
- import { AppObject, AppObjectUC } from "../../../AppObject";
2
- import { Vector3 } from "../../../ValueObjects";
3
- export declare abstract class DragTransformUC extends AppObjectUC {
4
- static readonly type = "DragTransformUC";
5
- static get(appObj: AppObject): DragTransformUC | undefined;
6
- abstract initialize(initialPick: Vector3): void;
7
- abstract update(pick: Vector3): void;
8
- abstract stop(registerUndo?: boolean): void;
9
- abstract cancel(): void;
10
- }
11
- export declare function makeDragTransformUC(appObject: AppObject): DragTransformUC;
@@ -1,108 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.makeDragTransformUC = exports.DragTransformUC = void 0;
4
- const AppObject_1 = require("../../../AppObject");
5
- const ValueObjects_1 = require("../../../ValueObjects");
6
- const Dispatcher_1 = require("../../Dispatcher");
7
- const UndoRedo_1 = require("../../UndoRedo");
8
- const Transform3D_1 = require("../Entities/Transform3D");
9
- const MoveTransformUndoRedo_1 = require("./MoveTransformUndoRedo");
10
- class DragTransformUC extends AppObject_1.AppObjectUC {
11
- static get(appObj) {
12
- return appObj.getComponent(this.type);
13
- }
14
- }
15
- exports.DragTransformUC = DragTransformUC;
16
- DragTransformUC.type = "DragTransformUC";
17
- function makeDragTransformUC(appObject) {
18
- return new DragTransformUCImp(appObject);
19
- }
20
- exports.makeDragTransformUC = makeDragTransformUC;
21
- class DragTransformUCImp extends DragTransformUC {
22
- constructor(appObject) {
23
- super(appObject, DragTransformUC.type);
24
- this.initialPos = ValueObjects_1.Vector3.Zero();
25
- this.isDragging = false;
26
- this.didDrag = false;
27
- this.pickOffset = ValueObjects_1.Vector3.Zero();
28
- this.initialize = (initialPick) => {
29
- this.isDragging = false;
30
- this.didDrag = false;
31
- if (!this.transform) {
32
- return;
33
- }
34
- const worldPos = this.transform.worldPosition;
35
- this.pickOffset = ValueObjects_1.Vector3.Subtract(worldPos, initialPick);
36
- this.initialPos = this.transform.localPosition;
37
- this.isDragging = true;
38
- };
39
- this.update = (pick) => {
40
- if (!this.isDragging)
41
- return;
42
- if (!this.transform)
43
- return;
44
- this.transform.worldPosition = ValueObjects_1.Vector3.Add(pick, this.pickOffset);
45
- this.didDrag = true;
46
- };
47
- this.stop = (registerUndo = false) => {
48
- var _a, _b;
49
- if (!this.transform)
50
- return;
51
- this.isDragging = false;
52
- if (!this.didDrag)
53
- return;
54
- (_a = this.dispatchStateChange) === null || _a === void 0 ? void 0 : _a.doDispatch();
55
- if (registerUndo) {
56
- const undoDTO = {
57
- endPosition: this.transform.localPosition,
58
- endRotation: this.transform.localRotation,
59
- startPosition: this.initialPos,
60
- startRotation: this.transform.localRotation,
61
- };
62
- (_b = this.undoRedoEntity) === null || _b === void 0 ? void 0 : _b.submitAction(new MoveTransformUndoRedo_1.MoveTransformUndoRedo(undoDTO, this.transform, this.appObject.appObjectRepo));
63
- }
64
- this.didDrag = false;
65
- };
66
- this.cancel = () => {
67
- if (!this.transform)
68
- return;
69
- if (!this.isDragging)
70
- return;
71
- this.transform.localPosition = this.initialPos;
72
- this.isDragging = false;
73
- this.didDrag = false;
74
- };
75
- this.dispose = () => {
76
- var _a;
77
- super.dispose();
78
- (_a = this.transform) === null || _a === void 0 ? void 0 : _a.removeOnDisposeObserver(this.dispose);
79
- };
80
- this.transform = appObject.getComponent(Transform3D_1.Transform3D.type);
81
- if (!this.transform) {
82
- this.warn("Peel Transform UC has been added to an App Object that does not have a Transform3D. Add a transform 3D before adding the UC");
83
- this.dispose();
84
- return;
85
- }
86
- this.transform.addOnDisposeObserver(this.dispose);
87
- }
88
- get dispatchStateChange() {
89
- if (!this._cachedDispatchStateChange) {
90
- this._cachedDispatchStateChange = Dispatcher_1.DispatchStateChangeUC.get(this.appObject.appObjectRepo);
91
- if (!this._cachedDispatchStateChange) {
92
- this.warn("Unable to find DispatchStateChangeUC");
93
- return;
94
- }
95
- }
96
- return this._cachedDispatchStateChange;
97
- }
98
- get undoRedoEntity() {
99
- if (!this._cachedUndoRedo) {
100
- this._cachedUndoRedo = UndoRedo_1.UndoRedoEntity.get(this.appObject.appObjectRepo);
101
- if (!this._cachedUndoRedo) {
102
- this.warn("Unable to find UndoRedoEntity");
103
- return;
104
- }
105
- }
106
- return this._cachedUndoRedo;
107
- }
108
- }
@@ -1,12 +0,0 @@
1
- import { AppObject } from "../../../AppObject";
2
- import { AppObjectUC } from "../../../AppObject/AppObjectUC";
3
- import { EaseFn } from "../../../Types";
4
- export declare abstract class StickTransformUC extends AppObjectUC {
5
- static readonly type = "StickTransformUC";
6
- static get(appObj: AppObject): StickTransformUC | undefined;
7
- abstract stickDurationMS: number;
8
- abstract easeFn: EaseFn;
9
- abstract get canBeStuck(): boolean;
10
- abstract stick(onCompleteCallback?: () => void): void;
11
- }
12
- export declare function makeStickTransformUC(appObject: AppObject): StickTransformUC;
@@ -1,72 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.makeStickTransformUC = exports.StickTransformUC = void 0;
4
- const AppObjectUC_1 = require("../../../AppObject/AppObjectUC");
5
- const Utilities_1 = require("../../../Utilities");
6
- const ValueObjects_1 = require("../../../ValueObjects");
7
- const Transform3D_1 = require("../Entities/Transform3D");
8
- /* TODO
9
- - Register state change on complete
10
- - Register Undo on complete based on a flag (optionally)
11
- - Move stick position and rotation to the Entity
12
- */
13
- class StickTransformUC extends AppObjectUC_1.AppObjectUC {
14
- static get(appObj) {
15
- return appObj.getComponent(this.type);
16
- }
17
- }
18
- exports.StickTransformUC = StickTransformUC;
19
- StickTransformUC.type = "StickTransformUC";
20
- function makeStickTransformUC(appObject) {
21
- return new StickTransformUCImp(appObject);
22
- }
23
- exports.makeStickTransformUC = makeStickTransformUC;
24
- class StickTransformUCImp extends StickTransformUC {
25
- constructor(appObject) {
26
- super(appObject, StickTransformUC.type);
27
- this.stickDurationMS = 500;
28
- this.easeFn = Utilities_1.expoOut;
29
- this.dispose = () => {
30
- var _a;
31
- super.dispose();
32
- (_a = this.transform) === null || _a === void 0 ? void 0 : _a.removeOnDisposeObserver(this.dispose);
33
- };
34
- this.transform = appObject.getComponent(Transform3D_1.Transform3D.type);
35
- if (!this.transform) {
36
- this.warn("Peel Transform UC has been added to an App Object that does not have a Transform3D. Add a transform 3D before adding the UC");
37
- this.dispose();
38
- return;
39
- }
40
- this.transform.addOnDisposeObserver(this.dispose);
41
- }
42
- get canBeStuck() {
43
- if (!this.transform)
44
- return false;
45
- if (!ValueObjects_1.Vector3.Equal(this.transform.localPosition, ValueObjects_1.Vector3.Zero())) {
46
- return true;
47
- }
48
- else if (!ValueObjects_1.Quaternion.Equal(this.transform.localRotation, ValueObjects_1.Quaternion.Identity())) {
49
- return true;
50
- }
51
- else {
52
- return false;
53
- }
54
- }
55
- stick(onCompleteCallback) {
56
- var _a;
57
- if (!this.canBeStuck) {
58
- if (onCompleteCallback) {
59
- onCompleteCallback();
60
- }
61
- return;
62
- }
63
- const lerpData = {
64
- durationMS: this.stickDurationMS,
65
- ease: this.easeFn,
66
- desiredPosition: ValueObjects_1.Vector3.Zero(),
67
- desiredRotation: ValueObjects_1.Quaternion.Identity(),
68
- onCompletedCallback: onCompleteCallback,
69
- };
70
- (_a = this.transform) === null || _a === void 0 ? void 0 : _a.lerp(lerpData);
71
- }
72
- }
@@ -1 +0,0 @@
1
- export declare function lerpNumber(start: number, end: number, percent: number, clamp?: boolean): number;