@vived/app 4.13.0 → 4.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Components/Question/Entities/QuestionAnswerEntity.d.ts +0 -1
- package/lib/Components/Question/Entities/QuestionAnswerEntity.js +2 -6
- package/lib/Components/Transform3D/Controllers/Mouse/DragScaleTransformMC.d.ts +12 -0
- package/lib/Components/Transform3D/Controllers/Mouse/DragScaleTransformMC.js +49 -0
- package/lib/Components/Transform3D/Controllers/Mouse/PanTransformMC.d.ts +12 -0
- package/lib/Components/Transform3D/Controllers/Mouse/PanTransformMC.js +48 -0
- package/lib/Components/Transform3D/Controllers/Mouse/RollScaleTransformMC.d.ts +9 -0
- package/lib/Components/Transform3D/Controllers/Mouse/RollScaleTransformMC.js +37 -0
- package/lib/Components/Transform3D/Controllers/Mouse/index.d.ts +3 -0
- package/lib/Components/Transform3D/Controllers/Mouse/index.js +15 -0
- package/lib/Components/Transform3D/Controllers/Stylus/PanScaleTransformSC.d.ts +13 -0
- package/lib/Components/Transform3D/Controllers/Stylus/PanScaleTransformSC.js +54 -0
- package/lib/Components/Transform3D/Controllers/Stylus/PanTransformSC.d.ts +13 -0
- package/lib/Components/Transform3D/Controllers/Stylus/PanTransformSC.js +54 -0
- package/lib/Components/Transform3D/Controllers/Stylus/ScaleTransformSC.d.ts +13 -0
- package/lib/Components/Transform3D/Controllers/Stylus/ScaleTransformSC.js +54 -0
- package/lib/Components/Transform3D/Controllers/Stylus/index.d.ts +3 -0
- package/lib/Components/Transform3D/Controllers/Stylus/index.js +15 -0
- package/lib/Components/Transform3D/Controllers/Touch/DragScaleTransformTC.d.ts +13 -0
- package/lib/Components/Transform3D/Controllers/Touch/DragScaleTransformTC.js +60 -0
- package/lib/Components/Transform3D/Controllers/Touch/PanTransformTC.d.ts +12 -0
- package/lib/Components/Transform3D/Controllers/Touch/PanTransformTC.js +52 -0
- package/lib/Components/Transform3D/Controllers/Touch/PinchTransformTC.d.ts +13 -0
- package/lib/Components/Transform3D/Controllers/Touch/PinchTransformTC.js +55 -0
- package/lib/Components/Transform3D/Controllers/Touch/index.d.ts +3 -0
- package/lib/Components/Transform3D/Controllers/Touch/index.js +15 -0
- package/lib/Components/Transform3D/Controllers/index.d.ts +3 -0
- package/lib/Components/Transform3D/Controllers/index.js +15 -0
- package/lib/Components/Transform3D/Mocks/MockBumpTransformScaleAboutPixelPoint.d.ts +12 -0
- package/lib/Components/Transform3D/Mocks/MockBumpTransformScaleAboutPixelPoint.js +14 -0
- package/lib/Components/Transform3D/Mocks/MockPanTransformUC.d.ts +18 -0
- package/lib/Components/Transform3D/Mocks/MockPanTransformUC.js +18 -0
- package/lib/Components/Transform3D/Mocks/MockPinchTransformUC.d.ts +13 -0
- package/lib/Components/Transform3D/Mocks/MockPinchTransformUC.js +15 -0
- package/lib/Components/Transform3D/Mocks/MockRayPanScaleTransformUC.d.ts +17 -0
- package/lib/Components/Transform3D/Mocks/MockRayPanScaleTransformUC.js +15 -0
- package/lib/Components/Transform3D/Mocks/MockRayScaleTransform.d.ts +16 -0
- package/lib/Components/Transform3D/Mocks/MockRayScaleTransform.js +18 -0
- package/lib/Components/Transform3D/Mocks/index.d.ts +5 -0
- package/lib/Components/Transform3D/Mocks/index.js +17 -0
- package/lib/Components/Transform3D/UC/BumpTransformScaleAboutPixelPoint.d.ts +12 -0
- package/lib/Components/Transform3D/UC/BumpTransformScaleAboutPixelPoint.js +67 -0
- package/lib/Components/Transform3D/UC/PanTransformUC.d.ts +18 -0
- package/lib/Components/Transform3D/UC/PanTransformUC.js +94 -0
- package/lib/Components/Transform3D/UC/PinchTransform.d.ts +13 -0
- package/lib/Components/Transform3D/UC/PinchTransform.js +90 -0
- package/lib/Components/Transform3D/UC/RayPanScaleTransform.d.ts +17 -0
- package/lib/Components/Transform3D/UC/RayPanScaleTransform.js +108 -0
- package/lib/Components/Transform3D/UC/ScaleTransform.d.ts +16 -0
- package/lib/Components/Transform3D/UC/ScaleTransform.js +104 -0
- package/lib/Components/Transform3D/UC/index.d.ts +6 -0
- package/lib/Components/Transform3D/UC/index.js +6 -0
- package/lib/Components/Transform3D/index.d.ts +2 -0
- package/lib/Components/Transform3D/index.js +2 -0
- package/package.json +1 -1
|
@@ -5,7 +5,6 @@ export declare const MAX_QUESTION_LENGTH = 40;
|
|
|
5
5
|
export declare const LONG_TEXT_VALIDATION_MESSAGE: string;
|
|
6
6
|
export declare const MAX_FEEDBACK_LENGTH = 200;
|
|
7
7
|
export declare const LONG_FEEDBACK_VALIDATION_MESSAGE: string;
|
|
8
|
-
export declare const FEEDBACK_STRING_CANNOT_BE_0_CHARACTERS = "Feedback string cannot be 0 characters.";
|
|
9
8
|
export declare abstract class QuestionAnswerEntity extends AppObjectEntity {
|
|
10
9
|
static readonly type = "QuestionAnswerEntity";
|
|
11
10
|
abstract readonly id: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makeQuestionAnswerEntity = exports.QuestionAnswerEntity = exports.
|
|
3
|
+
exports.makeQuestionAnswerEntity = exports.QuestionAnswerEntity = exports.LONG_FEEDBACK_VALIDATION_MESSAGE = exports.MAX_FEEDBACK_LENGTH = exports.LONG_TEXT_VALIDATION_MESSAGE = exports.MAX_QUESTION_LENGTH = exports.EMPTY_TEXT_VALIDATION_MESSAGE = void 0;
|
|
4
4
|
const AppObjectEntity_1 = require("../../../AppObject/AppObjectEntity");
|
|
5
5
|
const Entities_1 = require("../../../Entities");
|
|
6
6
|
exports.EMPTY_TEXT_VALIDATION_MESSAGE = "Answer text is required.";
|
|
@@ -8,7 +8,6 @@ exports.MAX_QUESTION_LENGTH = 40;
|
|
|
8
8
|
exports.LONG_TEXT_VALIDATION_MESSAGE = `Answer text may not exceed ${exports.MAX_QUESTION_LENGTH} characters.`;
|
|
9
9
|
exports.MAX_FEEDBACK_LENGTH = 200;
|
|
10
10
|
exports.LONG_FEEDBACK_VALIDATION_MESSAGE = `Answer feedback may not exceed ${exports.MAX_FEEDBACK_LENGTH} characters.`;
|
|
11
|
-
exports.FEEDBACK_STRING_CANNOT_BE_0_CHARACTERS = "Feedback string cannot be 0 characters.";
|
|
12
11
|
class QuestionAnswerEntity extends AppObjectEntity_1.AppObjectEntity {
|
|
13
12
|
}
|
|
14
13
|
exports.QuestionAnswerEntity = QuestionAnswerEntity;
|
|
@@ -52,10 +51,7 @@ class QuestionAnswerEntityImp extends QuestionAnswerEntity {
|
|
|
52
51
|
this.memoizedFeedback.val = val;
|
|
53
52
|
}
|
|
54
53
|
get feedbackValidationMessage() {
|
|
55
|
-
if (this.feedbackText.length
|
|
56
|
-
return exports.FEEDBACK_STRING_CANNOT_BE_0_CHARACTERS;
|
|
57
|
-
}
|
|
58
|
-
else if (this.feedbackText.length > exports.MAX_FEEDBACK_LENGTH) {
|
|
54
|
+
if (this.feedbackText.length > exports.MAX_FEEDBACK_LENGTH) {
|
|
59
55
|
return exports.LONG_FEEDBACK_VALIDATION_MESSAGE;
|
|
60
56
|
}
|
|
61
57
|
else {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AppObject, AppObjectController } from "../../../../AppObject";
|
|
2
|
+
import { MouseController, MouseInputEvent } from "../../../MouseInput";
|
|
3
|
+
export declare class DragScaleTransformMC extends AppObjectController implements MouseController {
|
|
4
|
+
static readonly type = "DragScaleTransformMC";
|
|
5
|
+
private isDragging;
|
|
6
|
+
private scaleUC?;
|
|
7
|
+
allow: (e: MouseInputEvent) => boolean;
|
|
8
|
+
onDown: (e: MouseInputEvent) => void;
|
|
9
|
+
onMove: (e: MouseInputEvent) => void;
|
|
10
|
+
onUp: () => void;
|
|
11
|
+
constructor(appObject: AppObject);
|
|
12
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DragScaleTransformMC = void 0;
|
|
4
|
+
const AppObject_1 = require("../../../../AppObject");
|
|
5
|
+
const MouseInput_1 = require("../../../MouseInput");
|
|
6
|
+
const UC_1 = require("../../UC");
|
|
7
|
+
class DragScaleTransformMC extends AppObject_1.AppObjectController {
|
|
8
|
+
constructor(appObject) {
|
|
9
|
+
super(appObject, DragScaleTransformMC.type);
|
|
10
|
+
this.isDragging = false;
|
|
11
|
+
this.allow = (e) => {
|
|
12
|
+
return true;
|
|
13
|
+
};
|
|
14
|
+
this.onDown = (e) => {
|
|
15
|
+
var _a;
|
|
16
|
+
this.isDragging = false;
|
|
17
|
+
if (!this.allow(e))
|
|
18
|
+
return;
|
|
19
|
+
const pixelPosition = e.position;
|
|
20
|
+
(_a = this.scaleUC) === null || _a === void 0 ? void 0 : _a.initializePixel(pixelPosition);
|
|
21
|
+
this.isDragging = true;
|
|
22
|
+
};
|
|
23
|
+
this.onMove = (e) => {
|
|
24
|
+
var _a;
|
|
25
|
+
if (!this.isDragging)
|
|
26
|
+
return;
|
|
27
|
+
(_a = this.scaleUC) === null || _a === void 0 ? void 0 : _a.updatePixel(e.position);
|
|
28
|
+
};
|
|
29
|
+
this.onUp = () => {
|
|
30
|
+
var _a;
|
|
31
|
+
this.isDragging = false;
|
|
32
|
+
(_a = this.scaleUC) === null || _a === void 0 ? void 0 : _a.finish();
|
|
33
|
+
};
|
|
34
|
+
this.scaleUC = appObject.getComponent(UC_1.ScaleTransformUC.type);
|
|
35
|
+
if (!this.scaleUC) {
|
|
36
|
+
this.error("App Object that does not have ScaleTransformUC");
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const mouseInput = MouseInput_1.MouseInputEntity.get(this.appObjects);
|
|
40
|
+
if (mouseInput) {
|
|
41
|
+
mouseInput.registerController(this);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
this.warn("Unable to find MouseInputEntity");
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.DragScaleTransformMC = DragScaleTransformMC;
|
|
49
|
+
DragScaleTransformMC.type = "DragScaleTransformMC";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AppObject, AppObjectController } from "../../../../AppObject";
|
|
2
|
+
import { MouseController, MouseInputEvent } from "../../../MouseInput";
|
|
3
|
+
export declare class PanTransformMC extends AppObjectController implements MouseController {
|
|
4
|
+
static readonly type = "PanTransformMC";
|
|
5
|
+
private doPan;
|
|
6
|
+
allow: (e: MouseInputEvent) => boolean;
|
|
7
|
+
private panUC?;
|
|
8
|
+
onDown: (e: MouseInputEvent) => void;
|
|
9
|
+
onMove: (e: MouseInputEvent) => void;
|
|
10
|
+
onUp: () => void;
|
|
11
|
+
constructor(appObject: AppObject);
|
|
12
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PanTransformMC = void 0;
|
|
4
|
+
const AppObject_1 = require("../../../../AppObject");
|
|
5
|
+
const MouseInput_1 = require("../../../MouseInput");
|
|
6
|
+
const UC_1 = require("../../UC");
|
|
7
|
+
class PanTransformMC extends AppObject_1.AppObjectController {
|
|
8
|
+
constructor(appObject) {
|
|
9
|
+
super(appObject, PanTransformMC.type);
|
|
10
|
+
this.doPan = false;
|
|
11
|
+
this.allow = (e) => {
|
|
12
|
+
return true;
|
|
13
|
+
};
|
|
14
|
+
this.onDown = (e) => {
|
|
15
|
+
var _a;
|
|
16
|
+
this.doPan = false;
|
|
17
|
+
if (!this.allow(e))
|
|
18
|
+
return;
|
|
19
|
+
(_a = this.panUC) === null || _a === void 0 ? void 0 : _a.initializePixel(e.position);
|
|
20
|
+
this.doPan = true;
|
|
21
|
+
};
|
|
22
|
+
this.onMove = (e) => {
|
|
23
|
+
var _a;
|
|
24
|
+
if (!this.doPan)
|
|
25
|
+
return;
|
|
26
|
+
(_a = this.panUC) === null || _a === void 0 ? void 0 : _a.updatePixel(e.position);
|
|
27
|
+
};
|
|
28
|
+
this.onUp = () => {
|
|
29
|
+
var _a;
|
|
30
|
+
this.doPan = false;
|
|
31
|
+
(_a = this.panUC) === null || _a === void 0 ? void 0 : _a.finish();
|
|
32
|
+
};
|
|
33
|
+
this.panUC = appObject.getComponent(UC_1.PanTransformUC.type);
|
|
34
|
+
if (!this.panUC) {
|
|
35
|
+
this.error("Controller has been added to an App Object that does not have PanTransformUC. Add one first.");
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const mouseInput = MouseInput_1.MouseInputEntity.get(this.appObjects);
|
|
39
|
+
if (mouseInput) {
|
|
40
|
+
mouseInput.registerController(this);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
this.warn("Unable to find MouseInputEntity");
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.PanTransformMC = PanTransformMC;
|
|
48
|
+
PanTransformMC.type = "PanTransformMC";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AppObject, AppObjectController } from "../../../../AppObject";
|
|
2
|
+
import { MouseController, MouseWheelEvent } from "../../../MouseInput";
|
|
3
|
+
export declare class RollScaleTransformMC extends AppObjectController implements MouseController {
|
|
4
|
+
static readonly type = "RollScaleTransformMC";
|
|
5
|
+
private bumpScaleUC?;
|
|
6
|
+
allow: (e: MouseWheelEvent) => boolean;
|
|
7
|
+
onWheel: (e: MouseWheelEvent) => void;
|
|
8
|
+
constructor(appObject: AppObject);
|
|
9
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RollScaleTransformMC = void 0;
|
|
4
|
+
const AppObject_1 = require("../../../../AppObject");
|
|
5
|
+
const MouseInput_1 = require("../../../MouseInput");
|
|
6
|
+
const UC_1 = require("../../UC");
|
|
7
|
+
class RollScaleTransformMC extends AppObject_1.AppObjectController {
|
|
8
|
+
constructor(appObject) {
|
|
9
|
+
super(appObject, RollScaleTransformMC.type);
|
|
10
|
+
this.allow = (e) => {
|
|
11
|
+
return true;
|
|
12
|
+
};
|
|
13
|
+
this.onWheel = (e) => {
|
|
14
|
+
if (!this.allow(e))
|
|
15
|
+
return;
|
|
16
|
+
if (!this.bumpScaleUC) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
this.bumpScaleUC.bump(e.event.deltaY > 0 ? "OUT" : "IN", e.position);
|
|
20
|
+
};
|
|
21
|
+
this.bumpScaleUC =
|
|
22
|
+
appObject.getComponent(UC_1.BumpTransformScaleAboutPixelPointUC.type);
|
|
23
|
+
if (!this.bumpScaleUC) {
|
|
24
|
+
this.error("Controller has been added to an App Object that does not have BumpTransformScaleAboutPixelPointUC. Add one first.");
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const mouseInput = MouseInput_1.MouseInputEntity.get(this.appObjects);
|
|
28
|
+
if (mouseInput) {
|
|
29
|
+
mouseInput.registerController(this);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
this.error("Unable to find MouseInputEntity");
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.RollScaleTransformMC = RollScaleTransformMC;
|
|
37
|
+
RollScaleTransformMC.type = "RollScaleTransformMC";
|
|
@@ -0,0 +1,15 @@
|
|
|
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("./DragScaleTransformMC"), exports);
|
|
14
|
+
__exportStar(require("./PanTransformMC"), exports);
|
|
15
|
+
__exportStar(require("./RollScaleTransformMC"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AppObject, AppObjectController } from "../../../../AppObject";
|
|
2
|
+
import { StylusController } from "../../../Stylus";
|
|
3
|
+
export declare class PanScaleTransformSC extends AppObjectController implements StylusController {
|
|
4
|
+
static readonly type = "PanScaleTransformSC";
|
|
5
|
+
private stylus?;
|
|
6
|
+
private uc?;
|
|
7
|
+
private doPan;
|
|
8
|
+
allow: (button: number) => boolean;
|
|
9
|
+
onButtonDown: (button: number) => void;
|
|
10
|
+
onButtonUp: () => void;
|
|
11
|
+
onStylusMove: () => void;
|
|
12
|
+
constructor(appObject: AppObject);
|
|
13
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PanScaleTransformSC = void 0;
|
|
4
|
+
const AppObject_1 = require("../../../../AppObject");
|
|
5
|
+
const Stylus_1 = require("../../../Stylus");
|
|
6
|
+
const UC_1 = require("../../UC");
|
|
7
|
+
class PanScaleTransformSC extends AppObject_1.AppObjectController {
|
|
8
|
+
constructor(appObject) {
|
|
9
|
+
super(appObject, PanScaleTransformSC.type);
|
|
10
|
+
this.doPan = false;
|
|
11
|
+
this.allow = (button) => {
|
|
12
|
+
if (button === 0)
|
|
13
|
+
return true;
|
|
14
|
+
return false;
|
|
15
|
+
};
|
|
16
|
+
this.onButtonDown = (button) => {
|
|
17
|
+
this.doPan = false;
|
|
18
|
+
if (!this.stylus || !this.uc)
|
|
19
|
+
return;
|
|
20
|
+
if (!this.allow(button))
|
|
21
|
+
return;
|
|
22
|
+
this.uc.initialize(this.stylus.pickRay);
|
|
23
|
+
this.doPan = true;
|
|
24
|
+
};
|
|
25
|
+
this.onButtonUp = () => {
|
|
26
|
+
if (!this.doPan)
|
|
27
|
+
return;
|
|
28
|
+
this.doPan = false;
|
|
29
|
+
if (!this.uc)
|
|
30
|
+
return;
|
|
31
|
+
this.uc.finish();
|
|
32
|
+
};
|
|
33
|
+
this.onStylusMove = () => {
|
|
34
|
+
if (!this.stylus || !this.uc)
|
|
35
|
+
return;
|
|
36
|
+
if (!this.doPan)
|
|
37
|
+
return;
|
|
38
|
+
this.uc.update(this.stylus.pickRay);
|
|
39
|
+
};
|
|
40
|
+
this.stylus = Stylus_1.StylusEntity.get(this.appObjects);
|
|
41
|
+
if (!this.stylus) {
|
|
42
|
+
this.error("Unable to find StylusEntity");
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
this.uc = appObject.getComponent(UC_1.RayPanScaleTransformUC.type);
|
|
46
|
+
if (!this.uc) {
|
|
47
|
+
this.error("App Object that does not have a StylusDragScaleTransformUC");
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
this.stylus.registerController(this);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.PanScaleTransformSC = PanScaleTransformSC;
|
|
54
|
+
PanScaleTransformSC.type = "PanScaleTransformSC";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AppObject, AppObjectController } from "../../../../AppObject";
|
|
2
|
+
import { StylusController } from "../../../Stylus";
|
|
3
|
+
export declare class PanTransformSC extends AppObjectController implements StylusController {
|
|
4
|
+
static readonly type = "PanTransformSC";
|
|
5
|
+
private stylus?;
|
|
6
|
+
private uc?;
|
|
7
|
+
private doUpdate;
|
|
8
|
+
allow: (button: number) => boolean;
|
|
9
|
+
onButtonDown: (button: number) => void;
|
|
10
|
+
onButtonUp: () => void;
|
|
11
|
+
onStylusMove: () => void;
|
|
12
|
+
constructor(appObject: AppObject);
|
|
13
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PanTransformSC = void 0;
|
|
4
|
+
const AppObject_1 = require("../../../../AppObject");
|
|
5
|
+
const Stylus_1 = require("../../../Stylus");
|
|
6
|
+
const UC_1 = require("../../UC");
|
|
7
|
+
class PanTransformSC extends AppObject_1.AppObjectController {
|
|
8
|
+
constructor(appObject) {
|
|
9
|
+
super(appObject, PanTransformSC.type);
|
|
10
|
+
this.doUpdate = false;
|
|
11
|
+
this.allow = (button) => {
|
|
12
|
+
if (button === 0)
|
|
13
|
+
return true;
|
|
14
|
+
return false;
|
|
15
|
+
};
|
|
16
|
+
this.onButtonDown = (button) => {
|
|
17
|
+
this.doUpdate = false;
|
|
18
|
+
if (!this.stylus || !this.uc)
|
|
19
|
+
return;
|
|
20
|
+
if (!this.allow(button))
|
|
21
|
+
return;
|
|
22
|
+
this.uc.initializeRay(this.stylus.pickRay);
|
|
23
|
+
this.doUpdate = true;
|
|
24
|
+
};
|
|
25
|
+
this.onButtonUp = () => {
|
|
26
|
+
if (!this.doUpdate)
|
|
27
|
+
return;
|
|
28
|
+
this.doUpdate = false;
|
|
29
|
+
if (!this.uc)
|
|
30
|
+
return;
|
|
31
|
+
this.uc.finish();
|
|
32
|
+
};
|
|
33
|
+
this.onStylusMove = () => {
|
|
34
|
+
if (!this.stylus || !this.uc)
|
|
35
|
+
return;
|
|
36
|
+
if (!this.doUpdate)
|
|
37
|
+
return;
|
|
38
|
+
this.uc.updateRay(this.stylus.pickRay);
|
|
39
|
+
};
|
|
40
|
+
this.stylus = Stylus_1.StylusEntity.get(this.appObjects);
|
|
41
|
+
if (!this.stylus) {
|
|
42
|
+
this.error("Unable to find StylusEntity");
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
this.uc = appObject.getComponent(UC_1.PanTransformUC.type);
|
|
46
|
+
if (!this.uc) {
|
|
47
|
+
this.error("App Object that does not have a RayScaleTransformUC");
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
this.stylus.registerController(this);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.PanTransformSC = PanTransformSC;
|
|
54
|
+
PanTransformSC.type = "PanTransformSC";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AppObject, AppObjectController } from "../../../../AppObject";
|
|
2
|
+
import { StylusController } from "../../../Stylus";
|
|
3
|
+
export declare class ScaleTransformSC extends AppObjectController implements StylusController {
|
|
4
|
+
static readonly type = "ScaleTransformSC";
|
|
5
|
+
private stylus?;
|
|
6
|
+
private uc?;
|
|
7
|
+
private doUpdate;
|
|
8
|
+
allow: (button: number) => boolean;
|
|
9
|
+
onButtonDown: (button: number) => void;
|
|
10
|
+
onButtonUp: () => void;
|
|
11
|
+
onStylusMove: () => void;
|
|
12
|
+
constructor(appObject: AppObject);
|
|
13
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ScaleTransformSC = void 0;
|
|
4
|
+
const AppObject_1 = require("../../../../AppObject");
|
|
5
|
+
const Stylus_1 = require("../../../Stylus");
|
|
6
|
+
const UC_1 = require("../../UC");
|
|
7
|
+
class ScaleTransformSC extends AppObject_1.AppObjectController {
|
|
8
|
+
constructor(appObject) {
|
|
9
|
+
super(appObject, ScaleTransformSC.type);
|
|
10
|
+
this.doUpdate = false;
|
|
11
|
+
this.allow = (button) => {
|
|
12
|
+
if (button === 0)
|
|
13
|
+
return true;
|
|
14
|
+
return false;
|
|
15
|
+
};
|
|
16
|
+
this.onButtonDown = (button) => {
|
|
17
|
+
this.doUpdate = false;
|
|
18
|
+
if (!this.stylus || !this.uc)
|
|
19
|
+
return;
|
|
20
|
+
if (!this.allow(button))
|
|
21
|
+
return;
|
|
22
|
+
this.uc.initializeRay(this.stylus.pickRay);
|
|
23
|
+
this.doUpdate = true;
|
|
24
|
+
};
|
|
25
|
+
this.onButtonUp = () => {
|
|
26
|
+
if (!this.doUpdate)
|
|
27
|
+
return;
|
|
28
|
+
this.doUpdate = false;
|
|
29
|
+
if (!this.uc)
|
|
30
|
+
return;
|
|
31
|
+
this.uc.finish();
|
|
32
|
+
};
|
|
33
|
+
this.onStylusMove = () => {
|
|
34
|
+
if (!this.stylus || !this.uc)
|
|
35
|
+
return;
|
|
36
|
+
if (!this.doUpdate)
|
|
37
|
+
return;
|
|
38
|
+
this.uc.updateRay(this.stylus.pickRay);
|
|
39
|
+
};
|
|
40
|
+
this.stylus = Stylus_1.StylusEntity.get(this.appObjects);
|
|
41
|
+
if (!this.stylus) {
|
|
42
|
+
this.error("Unable to find StylusEntity");
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
this.uc = appObject.getComponent(UC_1.ScaleTransformUC.type);
|
|
46
|
+
if (!this.uc) {
|
|
47
|
+
this.error("App Object that does not have a RayScaleTransformUC");
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
this.stylus.registerController(this);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.ScaleTransformSC = ScaleTransformSC;
|
|
54
|
+
ScaleTransformSC.type = "ScaleTransformSC";
|
|
@@ -0,0 +1,15 @@
|
|
|
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("./PanScaleTransformSC"), exports);
|
|
14
|
+
__exportStar(require("./PanTransformSC"), exports);
|
|
15
|
+
__exportStar(require("./ScaleTransformSC"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AppObject, AppObjectController } from "../../../../AppObject";
|
|
2
|
+
import { TouchController, TouchInputEvent } from "../../../TouchController";
|
|
3
|
+
import { ScaleTransformUC } from "../../UC";
|
|
4
|
+
export declare class DragScaleTransformTC extends AppObjectController implements TouchController {
|
|
5
|
+
static readonly type = "DragScaleTransformTC";
|
|
6
|
+
private isScaling;
|
|
7
|
+
scaleUC?: ScaleTransformUC;
|
|
8
|
+
allow: (e: TouchInputEvent) => boolean;
|
|
9
|
+
onTouchStart: (e: TouchInputEvent) => void;
|
|
10
|
+
onTouchMove: (e: TouchInputEvent) => void;
|
|
11
|
+
onTouchEnd: () => void;
|
|
12
|
+
constructor(appObject: AppObject);
|
|
13
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DragScaleTransformTC = void 0;
|
|
4
|
+
const AppObject_1 = require("../../../../AppObject");
|
|
5
|
+
const TouchController_1 = require("../../../TouchController");
|
|
6
|
+
const UC_1 = require("../../UC");
|
|
7
|
+
class DragScaleTransformTC extends AppObject_1.AppObjectController {
|
|
8
|
+
constructor(appObject) {
|
|
9
|
+
super(appObject, DragScaleTransformTC.type);
|
|
10
|
+
this.isScaling = false;
|
|
11
|
+
this.allow = (e) => {
|
|
12
|
+
if (e.touches.length !== 1) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
return true;
|
|
16
|
+
};
|
|
17
|
+
this.onTouchStart = (e) => {
|
|
18
|
+
var _a;
|
|
19
|
+
this.isScaling = false;
|
|
20
|
+
if (e.touches.length !== 1) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (!this.allow(e)) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const pixelPosition = e.touches[0].position;
|
|
27
|
+
(_a = this.scaleUC) === null || _a === void 0 ? void 0 : _a.initializePixel(pixelPosition);
|
|
28
|
+
this.isScaling = true;
|
|
29
|
+
};
|
|
30
|
+
this.onTouchMove = (e) => {
|
|
31
|
+
var _a;
|
|
32
|
+
if (!this.isScaling)
|
|
33
|
+
return;
|
|
34
|
+
if (e.touches.length !== 1)
|
|
35
|
+
return;
|
|
36
|
+
const pixelPosition = e.touches[0].position;
|
|
37
|
+
(_a = this.scaleUC) === null || _a === void 0 ? void 0 : _a.updatePixel(pixelPosition);
|
|
38
|
+
};
|
|
39
|
+
this.onTouchEnd = () => {
|
|
40
|
+
var _a;
|
|
41
|
+
this.isScaling = false;
|
|
42
|
+
(_a = this.scaleUC) === null || _a === void 0 ? void 0 : _a.finish();
|
|
43
|
+
};
|
|
44
|
+
const appObjects = appObject.appObjectRepo;
|
|
45
|
+
this.scaleUC = appObject.getComponent(UC_1.ScaleTransformUC.type);
|
|
46
|
+
if (!this.scaleUC) {
|
|
47
|
+
this.error("App Object that does not have ScaleTransformUC");
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const touchInput = TouchController_1.TouchInputEntity.get(appObjects);
|
|
51
|
+
if (touchInput) {
|
|
52
|
+
touchInput.registerController(this);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
this.warn("Unable to find TouchInputEntity");
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.DragScaleTransformTC = DragScaleTransformTC;
|
|
60
|
+
DragScaleTransformTC.type = "DragScaleTransformTC";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AppObject, AppObjectController } from "../../../../AppObject";
|
|
2
|
+
import { TouchController, TouchInputEvent } from "../../../TouchController";
|
|
3
|
+
export declare class PanTransformTC extends AppObjectController implements TouchController {
|
|
4
|
+
static readonly type = "PanTransformTC";
|
|
5
|
+
private isPanning;
|
|
6
|
+
private panUC?;
|
|
7
|
+
allow: (e: TouchInputEvent) => boolean;
|
|
8
|
+
onTouchStart: (e: TouchInputEvent) => void;
|
|
9
|
+
onTouchMove: (e: TouchInputEvent) => void;
|
|
10
|
+
onTouchEnd: (e: TouchInputEvent) => void;
|
|
11
|
+
constructor(appObject: AppObject);
|
|
12
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PanTransformTC = void 0;
|
|
4
|
+
const AppObject_1 = require("../../../../AppObject");
|
|
5
|
+
const TouchController_1 = require("../../../TouchController");
|
|
6
|
+
const UC_1 = require("../../UC");
|
|
7
|
+
class PanTransformTC extends AppObject_1.AppObjectController {
|
|
8
|
+
constructor(appObject) {
|
|
9
|
+
super(appObject, PanTransformTC.type);
|
|
10
|
+
this.isPanning = false;
|
|
11
|
+
this.allow = (e) => {
|
|
12
|
+
return true;
|
|
13
|
+
};
|
|
14
|
+
this.onTouchStart = (e) => {
|
|
15
|
+
var _a, _b;
|
|
16
|
+
if (!this.allow(e)) {
|
|
17
|
+
this.isPanning = false;
|
|
18
|
+
(_a = this.panUC) === null || _a === void 0 ? void 0 : _a.cancelPan();
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
(_b = this.panUC) === null || _b === void 0 ? void 0 : _b.initializePixel(e.touchCenter);
|
|
22
|
+
this.isPanning = true;
|
|
23
|
+
};
|
|
24
|
+
this.onTouchMove = (e) => {
|
|
25
|
+
var _a;
|
|
26
|
+
if (!this.isPanning)
|
|
27
|
+
return;
|
|
28
|
+
const pixelPosition = e.touches[0].position;
|
|
29
|
+
(_a = this.panUC) === null || _a === void 0 ? void 0 : _a.updatePixel(pixelPosition);
|
|
30
|
+
};
|
|
31
|
+
this.onTouchEnd = (e) => {
|
|
32
|
+
var _a;
|
|
33
|
+
this.isPanning = false;
|
|
34
|
+
(_a = this.panUC) === null || _a === void 0 ? void 0 : _a.finish();
|
|
35
|
+
};
|
|
36
|
+
const appObjects = appObject.appObjectRepo;
|
|
37
|
+
this.panUC = appObject.getComponent(UC_1.PanTransformUC.type);
|
|
38
|
+
if (!this.panUC) {
|
|
39
|
+
this.warn("Controller has been added to an App Object that does not have PanTransformUC. Add one first.");
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const touchInput = TouchController_1.TouchInputEntity.get(appObjects);
|
|
43
|
+
if (touchInput) {
|
|
44
|
+
touchInput.registerController(this);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
this.warn("Unable to find TouchInputEntity");
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.PanTransformTC = PanTransformTC;
|
|
52
|
+
PanTransformTC.type = "PanTransformTC";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AppObject, AppObjectController } from "../../../../AppObject";
|
|
2
|
+
import { TouchController, TouchInputEvent } from "../../../TouchController";
|
|
3
|
+
import { PinchTransformUC } from "../../UC";
|
|
4
|
+
export declare class PinchTransformTC extends AppObjectController implements TouchController {
|
|
5
|
+
static readonly type = "PinchTransformTC";
|
|
6
|
+
private isPinching;
|
|
7
|
+
pinchUC?: PinchTransformUC;
|
|
8
|
+
allow: (e: TouchInputEvent) => boolean;
|
|
9
|
+
onTouchStart: (e: TouchInputEvent) => void;
|
|
10
|
+
onTouchMove: (e: TouchInputEvent) => void;
|
|
11
|
+
onTouchEnd: () => void;
|
|
12
|
+
constructor(appObject: AppObject);
|
|
13
|
+
}
|