@shapediver/viewer.features.drawing-tools 3.12.16 → 3.12.19
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/package.json +10 -10
- package/dist/business/implementation/managers/interaction/InteractionManagerAdapter.d.ts +0 -36
- package/dist/business/implementation/managers/interaction/InteractionManagerAdapter.d.ts.map +0 -1
- package/dist/business/implementation/managers/interaction/InteractionManagerAdapter.js +0 -77
- package/dist/business/implementation/managers/interaction/InteractionManagerAdapter.js.map +0 -1
- package/dist/business/implementation/managers/interaction/InteractionManagerRefactored.d.ts +0 -82
- package/dist/business/implementation/managers/interaction/InteractionManagerRefactored.d.ts.map +0 -1
- package/dist/business/implementation/managers/interaction/InteractionManagerRefactored.js +0 -406
- package/dist/business/implementation/managers/interaction/InteractionManagerRefactored.js.map +0 -1
- package/dist/business/implementation/managers/interaction/actions/InteractionActions.d.ts +0 -107
- package/dist/business/implementation/managers/interaction/actions/InteractionActions.d.ts.map +0 -1
- package/dist/business/implementation/managers/interaction/actions/InteractionActions.js +0 -191
- package/dist/business/implementation/managers/interaction/actions/InteractionActions.js.map +0 -1
- package/dist/business/implementation/managers/interaction/config/InteractionConfig.d.ts +0 -134
- package/dist/business/implementation/managers/interaction/config/InteractionConfig.d.ts.map +0 -1
- package/dist/business/implementation/managers/interaction/config/InteractionConfig.js +0 -218
- package/dist/business/implementation/managers/interaction/config/InteractionConfig.js.map +0 -1
- package/dist/business/implementation/managers/interaction/gestures/GestureRecognition.d.ts +0 -118
- package/dist/business/implementation/managers/interaction/gestures/GestureRecognition.d.ts.map +0 -1
- package/dist/business/implementation/managers/interaction/gestures/GestureRecognition.js +0 -352
- package/dist/business/implementation/managers/interaction/gestures/GestureRecognition.js.map +0 -1
- package/dist/business/implementation/managers/interaction/index.d.ts +0 -13
- package/dist/business/implementation/managers/interaction/index.d.ts.map +0 -1
- package/dist/business/implementation/managers/interaction/index.js +0 -49
- package/dist/business/implementation/managers/interaction/index.js.map +0 -1
- package/dist/business/implementation/managers/interaction/interfaces/IInteractionManagerForStrategy.d.ts +0 -24
- package/dist/business/implementation/managers/interaction/interfaces/IInteractionManagerForStrategy.d.ts.map +0 -1
- package/dist/business/implementation/managers/interaction/interfaces/IInteractionManagerForStrategy.js +0 -3
- package/dist/business/implementation/managers/interaction/interfaces/IInteractionManagerForStrategy.js.map +0 -1
- package/dist/business/implementation/managers/interaction/mobile-detection-example.d.ts +0 -24
- package/dist/business/implementation/managers/interaction/mobile-detection-example.d.ts.map +0 -1
- package/dist/business/implementation/managers/interaction/mobile-detection-example.js +0 -112
- package/dist/business/implementation/managers/interaction/mobile-detection-example.js.map +0 -1
- package/dist/business/implementation/managers/interaction/strategies/DesktopInteractionStrategy.d.ts +0 -37
- package/dist/business/implementation/managers/interaction/strategies/DesktopInteractionStrategy.d.ts.map +0 -1
- package/dist/business/implementation/managers/interaction/strategies/DesktopInteractionStrategy.js +0 -301
- package/dist/business/implementation/managers/interaction/strategies/DesktopInteractionStrategy.js.map +0 -1
- package/dist/business/implementation/managers/interaction/strategies/IInteractionStrategy.d.ts +0 -52
- package/dist/business/implementation/managers/interaction/strategies/IInteractionStrategy.d.ts.map +0 -1
- package/dist/business/implementation/managers/interaction/strategies/IInteractionStrategy.js +0 -21
- package/dist/business/implementation/managers/interaction/strategies/IInteractionStrategy.js.map +0 -1
- package/dist/business/implementation/managers/interaction/strategies/MobileInteractionStrategy.d.ts +0 -80
- package/dist/business/implementation/managers/interaction/strategies/MobileInteractionStrategy.d.ts.map +0 -1
- package/dist/business/implementation/managers/interaction/strategies/MobileInteractionStrategy.js +0 -671
- package/dist/business/implementation/managers/interaction/strategies/MobileInteractionStrategy.js.map +0 -1
- package/dist/business/implementation/managers/interaction/test-mobile-detection.d.ts +0 -24
- package/dist/business/implementation/managers/interaction/test-mobile-detection.d.ts.map +0 -1
- package/dist/business/implementation/managers/interaction/test-mobile-detection.js +0 -136
- package/dist/business/implementation/managers/interaction/test-mobile-detection.js.map +0 -1
- package/dist/business/implementation/managers/interaction/test-refactored.d.ts +0 -9
- package/dist/business/implementation/managers/interaction/test-refactored.d.ts.map +0 -1
- package/dist/business/implementation/managers/interaction/test-refactored.js +0 -57
- package/dist/business/implementation/managers/interaction/test-refactored.js.map +0 -1
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ActionFactory = exports.UpdateHoverAction = exports.DeletePointsAction = exports.MoveDraggedPointsAction = exports.StartDragAction = exports.FinalizeInsertionAction = exports.StartInsertionAction = exports.SelectPointAction = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Action for selecting a point
|
|
6
|
-
*/
|
|
7
|
-
class SelectPointAction {
|
|
8
|
-
constructor(pointIndex) {
|
|
9
|
-
this.pointIndex = pointIndex;
|
|
10
|
-
}
|
|
11
|
-
canExecute(context) {
|
|
12
|
-
return (context.drawingToolsManager.getPointsData().length > this.pointIndex);
|
|
13
|
-
}
|
|
14
|
-
execute(context) {
|
|
15
|
-
const helper = context.interactionManager.interactionManagerHelper;
|
|
16
|
-
// Check if point exists
|
|
17
|
-
if (context.drawingToolsManager.getPointsData().length <=
|
|
18
|
-
this.pointIndex) {
|
|
19
|
-
return { success: false, message: "Point index out of range" };
|
|
20
|
-
}
|
|
21
|
-
// Select the point
|
|
22
|
-
const distances = [{ index: this.pointIndex, distance: 0 }];
|
|
23
|
-
helper.selectPoint(distances);
|
|
24
|
-
return { success: true, updateRequired: true };
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
exports.SelectPointAction = SelectPointAction;
|
|
28
|
-
/**
|
|
29
|
-
* Action for starting point insertion
|
|
30
|
-
*/
|
|
31
|
-
class StartInsertionAction {
|
|
32
|
-
canExecute(context) {
|
|
33
|
-
return !context.interactionManager.insertionInteractionHandler
|
|
34
|
-
.insertionActive;
|
|
35
|
-
}
|
|
36
|
-
execute(context) {
|
|
37
|
-
const result = context.interactionManager.startInsertion();
|
|
38
|
-
return {
|
|
39
|
-
success: !!result,
|
|
40
|
-
updateRequired: true,
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.StartInsertionAction = StartInsertionAction;
|
|
45
|
-
/**
|
|
46
|
-
* Action for finalizing point insertion
|
|
47
|
-
*/
|
|
48
|
-
class FinalizeInsertionAction {
|
|
49
|
-
canExecute(context) {
|
|
50
|
-
return context.interactionManager.insertionInteractionHandler
|
|
51
|
-
.insertionActive;
|
|
52
|
-
}
|
|
53
|
-
execute(context) {
|
|
54
|
-
const result = context.interactionManager.insertionInteractionHandler.finalizeInsertion();
|
|
55
|
-
if (result) {
|
|
56
|
-
context.drawingToolsManager.update();
|
|
57
|
-
}
|
|
58
|
-
return {
|
|
59
|
-
success: result,
|
|
60
|
-
updateRequired: result,
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
exports.FinalizeInsertionAction = FinalizeInsertionAction;
|
|
65
|
-
/**
|
|
66
|
-
* Action for starting point dragging
|
|
67
|
-
*/
|
|
68
|
-
class StartDragAction {
|
|
69
|
-
constructor(pointIndices) {
|
|
70
|
-
this.pointIndices = pointIndices;
|
|
71
|
-
}
|
|
72
|
-
canExecute(context) {
|
|
73
|
-
return this.pointIndices.length > 0;
|
|
74
|
-
}
|
|
75
|
-
execute(context) {
|
|
76
|
-
const helper = context.interactionManager.interactionManagerHelper;
|
|
77
|
-
// Start dragging for the selected points
|
|
78
|
-
const draggingStarted = helper.startDragging();
|
|
79
|
-
if (draggingStarted) {
|
|
80
|
-
// Freeze camera during drag
|
|
81
|
-
const cameraFreezeFlag = context.drawingToolsManager.viewport.addFlag("CAMERA_FREEZE");
|
|
82
|
-
return {
|
|
83
|
-
success: true,
|
|
84
|
-
updateRequired: false,
|
|
85
|
-
preventDefaultEvent: true,
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
return { success: false };
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
exports.StartDragAction = StartDragAction;
|
|
92
|
-
/**
|
|
93
|
-
* Action for moving dragged points
|
|
94
|
-
*/
|
|
95
|
-
class MoveDraggedPointsAction {
|
|
96
|
-
constructor(newPosition) {
|
|
97
|
-
this.newPosition = newPosition;
|
|
98
|
-
}
|
|
99
|
-
canExecute(context) {
|
|
100
|
-
// Check if currently dragging
|
|
101
|
-
return true; // Placeholder
|
|
102
|
-
}
|
|
103
|
-
execute(context) {
|
|
104
|
-
const helper = context.interactionManager.interactionManagerHelper;
|
|
105
|
-
// Move the selected points to the new position
|
|
106
|
-
const moved = helper.moveSelectedPoints(context.ray);
|
|
107
|
-
return {
|
|
108
|
-
success: true,
|
|
109
|
-
updateRequired: !!moved,
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
exports.MoveDraggedPointsAction = MoveDraggedPointsAction;
|
|
114
|
-
/**
|
|
115
|
-
* Action for deleting points
|
|
116
|
-
*/
|
|
117
|
-
class DeletePointsAction {
|
|
118
|
-
constructor(pointIndices) {
|
|
119
|
-
this.pointIndices = pointIndices;
|
|
120
|
-
}
|
|
121
|
-
canExecute(context) {
|
|
122
|
-
return this.pointIndices.length > 0;
|
|
123
|
-
}
|
|
124
|
-
execute(context) {
|
|
125
|
-
context.interactionManager.deleteSelection();
|
|
126
|
-
return {
|
|
127
|
-
success: true,
|
|
128
|
-
updateRequired: true,
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
undo() {
|
|
132
|
-
// Implementation for undoing deletion
|
|
133
|
-
// This would require storing the deleted points and their positions
|
|
134
|
-
// For now, this is a placeholder for the undo system
|
|
135
|
-
console.warn("Undo deletion not yet implemented");
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
exports.DeletePointsAction = DeletePointsAction;
|
|
139
|
-
/**
|
|
140
|
-
* Action for updating hover state
|
|
141
|
-
*/
|
|
142
|
-
class UpdateHoverAction {
|
|
143
|
-
constructor(pointIndex) {
|
|
144
|
-
this.pointIndex = pointIndex;
|
|
145
|
-
}
|
|
146
|
-
canExecute(context) {
|
|
147
|
-
return true;
|
|
148
|
-
}
|
|
149
|
-
execute(context) {
|
|
150
|
-
const helper = context.interactionManager.interactionManagerHelper;
|
|
151
|
-
// Update hover state
|
|
152
|
-
if (this.pointIndex !== undefined) {
|
|
153
|
-
// Set hover to specific point
|
|
154
|
-
helper.checkHover([{ index: this.pointIndex, distance: 0 }], context.ray);
|
|
155
|
-
}
|
|
156
|
-
else {
|
|
157
|
-
// Clear hover state
|
|
158
|
-
helper.checkHover([], context.ray);
|
|
159
|
-
}
|
|
160
|
-
return { success: true };
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
exports.UpdateHoverAction = UpdateHoverAction;
|
|
164
|
-
/**
|
|
165
|
-
* Action factory for creating appropriate actions based on context
|
|
166
|
-
*/
|
|
167
|
-
class ActionFactory {
|
|
168
|
-
static createSelectAction(pointIndex) {
|
|
169
|
-
return new SelectPointAction(pointIndex);
|
|
170
|
-
}
|
|
171
|
-
static createInsertionStartAction() {
|
|
172
|
-
return new StartInsertionAction();
|
|
173
|
-
}
|
|
174
|
-
static createInsertionFinalizeAction() {
|
|
175
|
-
return new FinalizeInsertionAction();
|
|
176
|
-
}
|
|
177
|
-
static createDragStartAction(pointIndices) {
|
|
178
|
-
return new StartDragAction(pointIndices);
|
|
179
|
-
}
|
|
180
|
-
static createMoveDraggedPointsAction(position) {
|
|
181
|
-
return new MoveDraggedPointsAction(position);
|
|
182
|
-
}
|
|
183
|
-
static createDeleteAction(pointIndices) {
|
|
184
|
-
return new DeletePointsAction(pointIndices);
|
|
185
|
-
}
|
|
186
|
-
static createHoverAction(pointIndex) {
|
|
187
|
-
return new UpdateHoverAction(pointIndex);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
exports.ActionFactory = ActionFactory;
|
|
191
|
-
//# sourceMappingURL=InteractionActions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InteractionActions.js","sourceRoot":"","sources":["../../../../../../src/business/implementation/managers/interaction/actions/InteractionActions.ts"],"names":[],"mappings":";;;AAsCA;;GAEG;AACH,MAAa,iBAAiB;IAC7B,YAAoB,UAAkB;QAAlB,eAAU,GAAV,UAAU,CAAQ;IAAG,CAAC;IAE1C,UAAU,CAAC,OAA2B;QACrC,OAAO,CACN,OAAO,CAAC,mBAAmB,CAAC,aAAa,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,UAAU,CACpE,CAAC;IACH,CAAC;IAED,OAAO,CAAC,OAA2B;QAClC,MAAM,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,wBAAwB,CAAC;QAEnE,wBAAwB;QACxB,IACC,OAAO,CAAC,mBAAmB,CAAC,aAAa,EAAE,CAAC,MAAM;YAClD,IAAI,CAAC,UAAU,EACd;YACD,OAAO,EAAC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,0BAA0B,EAAC,CAAC;SAC7D;QAED,mBAAmB;QACnB,MAAM,SAAS,GAAG,CAAC,EAAC,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,QAAQ,EAAE,CAAC,EAAC,CAAC,CAAC;QAC1D,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAE9B,OAAO,EAAC,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAC,CAAC;IAC9C,CAAC;CACD;AA1BD,8CA0BC;AAED;;GAEG;AACH,MAAa,oBAAoB;IAChC,UAAU,CAAC,OAA2B;QACrC,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC,2BAA2B;aAC5D,eAAe,CAAC;IACnB,CAAC;IAED,OAAO,CAAC,OAA2B;QAClC,MAAM,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,cAAc,EAAE,CAAC;QAC3D,OAAO;YACN,OAAO,EAAE,CAAC,CAAC,MAAM;YACjB,cAAc,EAAE,IAAI;SACpB,CAAC;IACH,CAAC;CACD;AAbD,oDAaC;AAED;;GAE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EAAE,QAAQ,EAAE,CAAC,EAAC,CAAC,EACvC,OAAO,CAAC,GAAG,CACX,CAAC;SACF;aAAM;YACN,oBAAoB;YACpB,MAAM,CAAC,UAAU,CAAC,EAAE,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;SACnC;QAED,OAAO,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;IACxB,CAAC;CACD;AAxBD,8CAwBC;AAED;;GAEG;AACH,MAAa,aAAa;IACzB,MAAM,CAAC,kBAAkB,CAAC,UAAkB;QAC3C,OAAO,IAAI,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC;IAED,MAAM,CAAC,0BAA0B;QAChC,OAAO,IAAI,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED,MAAM,CAAC,6BAA6B;QACnC,OAAO,IAAI,uBAAuB,EAAE,CAAC;IACtC,CAAC;IAED,MAAM,CAAC,qBAAqB,CAAC,YAAsB;QAClD,OAAO,IAAI,eAAe,CAAC,YAAY,CAAC,CAAC;IAC1C,CAAC;IAED,MAAM,CAAC,6BAA6B,CACnC,QAAc;QAEd,OAAO,IAAI,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IAC9C,CAAC;IAED,MAAM,CAAC,kBAAkB,CAAC,YAAsB;QAC/C,OAAO,IAAI,kBAAkB,CAAC,YAAY,CAAC,CAAC;IAC7C,CAAC;IAED,MAAM,CAAC,iBAAiB,CAAC,UAAmB;QAC3C,OAAO,IAAI,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC;CACD;AA9BD,sCA8BC"}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configuration for interaction behavior
|
|
3
|
-
*/
|
|
4
|
-
export interface InteractionConfig {
|
|
5
|
-
platform: PlatformType;
|
|
6
|
-
touchSettings: TouchSettings;
|
|
7
|
-
mouseSettings: MouseSettings;
|
|
8
|
-
gestureSettings: GestureSettings;
|
|
9
|
-
accessibility: AccessibilitySettings;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Platform types
|
|
13
|
-
*/
|
|
14
|
-
export declare enum PlatformType {
|
|
15
|
-
AUTO = "auto",
|
|
16
|
-
DESKTOP = "desktop",
|
|
17
|
-
MOBILE = "mobile",
|
|
18
|
-
TABLET = "tablet"
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Touch-specific settings
|
|
22
|
-
*/
|
|
23
|
-
export interface TouchSettings {
|
|
24
|
-
/** Minimum touch target size in pixels (accessibility guideline: 44px) */
|
|
25
|
-
minTouchTargetSize: number;
|
|
26
|
-
/** Maximum distance for tap detection in pixels */
|
|
27
|
-
tapThreshold: number;
|
|
28
|
-
/** Duration for long press detection in milliseconds */
|
|
29
|
-
longPressDuration: number;
|
|
30
|
-
/** Maximum movement allowed during tap in pixels */
|
|
31
|
-
tapMovementThreshold: number;
|
|
32
|
-
/** Time window for double-tap detection in milliseconds */
|
|
33
|
-
doubleTapInterval: number;
|
|
34
|
-
/** Enable haptic feedback if available */
|
|
35
|
-
enableHapticFeedback: boolean;
|
|
36
|
-
/** Vibration pattern for feedback [duration, pause, duration, ...] */
|
|
37
|
-
hapticPattern: number[];
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Mouse-specific settings
|
|
41
|
-
*/
|
|
42
|
-
export interface MouseSettings {
|
|
43
|
-
/** Click threshold for drag detection in pixels */
|
|
44
|
-
clickThreshold: number;
|
|
45
|
-
/** Enable right-click context menu */
|
|
46
|
-
enableContextMenu: boolean;
|
|
47
|
-
/** Mouse button bindings */
|
|
48
|
-
buttonBindings: {
|
|
49
|
-
primary: MouseAction;
|
|
50
|
-
secondary: MouseAction;
|
|
51
|
-
auxiliary: MouseAction;
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Gesture recognition settings
|
|
56
|
-
*/
|
|
57
|
-
export interface GestureSettings {
|
|
58
|
-
/** Enable multi-touch gestures */
|
|
59
|
-
enableMultiTouch: boolean;
|
|
60
|
-
/** Confidence threshold for gesture recognition (0-1) */
|
|
61
|
-
confidenceThreshold: number;
|
|
62
|
-
/** Maximum time between gesture events in milliseconds */
|
|
63
|
-
gestureTimeout: number;
|
|
64
|
-
/** Enable simultaneous gesture recognition */
|
|
65
|
-
allowSimultaneousGestures: boolean;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Accessibility settings
|
|
69
|
-
*/
|
|
70
|
-
export interface AccessibilitySettings {
|
|
71
|
-
/** Increase touch targets for accessibility */
|
|
72
|
-
largeTargets: boolean;
|
|
73
|
-
/** High contrast mode */
|
|
74
|
-
highContrast: boolean;
|
|
75
|
-
/** Reduce motion for users with vestibular disorders */
|
|
76
|
-
reduceMotion: boolean;
|
|
77
|
-
/** Voice control support */
|
|
78
|
-
voiceControlEnabled: boolean;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Mouse action types
|
|
82
|
-
*/
|
|
83
|
-
export declare enum MouseAction {
|
|
84
|
-
SELECT = "select",
|
|
85
|
-
CONTEXT_MENU = "context_menu",
|
|
86
|
-
INSERT = "insert",
|
|
87
|
-
DELETE = "delete",
|
|
88
|
-
PAN_CAMERA = "pan_camera",
|
|
89
|
-
NONE = "none"
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Default configurations for different platforms
|
|
93
|
-
*/
|
|
94
|
-
export declare class InteractionConfigFactory {
|
|
95
|
-
static createDesktopConfig(): InteractionConfig;
|
|
96
|
-
static createMobileConfig(): InteractionConfig;
|
|
97
|
-
static createTabletConfig(): InteractionConfig;
|
|
98
|
-
static createAutoConfig(): InteractionConfig;
|
|
99
|
-
/**
|
|
100
|
-
* Create config based on device characteristics
|
|
101
|
-
*/
|
|
102
|
-
static createConfigForDevice(): InteractionConfig;
|
|
103
|
-
/**
|
|
104
|
-
* Merge custom config with defaults
|
|
105
|
-
*/
|
|
106
|
-
static mergeConfig(baseConfig: InteractionConfig, customConfig: Partial<InteractionConfig>): InteractionConfig;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Configuration manager for interaction settings
|
|
110
|
-
*/
|
|
111
|
-
export declare class InteractionConfigManager {
|
|
112
|
-
private config;
|
|
113
|
-
private listeners;
|
|
114
|
-
constructor(initialConfig?: InteractionConfig);
|
|
115
|
-
getConfig(): InteractionConfig;
|
|
116
|
-
updateConfig(newConfig: Partial<InteractionConfig>): void;
|
|
117
|
-
setPlatform(platform: PlatformType): void;
|
|
118
|
-
addListener(listener: (config: InteractionConfig) => void): void;
|
|
119
|
-
removeListener(listener: (config: InteractionConfig) => void): void;
|
|
120
|
-
private notifyListeners;
|
|
121
|
-
/**
|
|
122
|
-
* Enable accessibility mode
|
|
123
|
-
*/
|
|
124
|
-
enableAccessibility(): void;
|
|
125
|
-
/**
|
|
126
|
-
* Check if current platform supports touch
|
|
127
|
-
*/
|
|
128
|
-
isTouchEnabled(): boolean;
|
|
129
|
-
/**
|
|
130
|
-
* Check if haptic feedback is available and enabled
|
|
131
|
-
*/
|
|
132
|
-
isHapticEnabled(): boolean;
|
|
133
|
-
}
|
|
134
|
-
//# sourceMappingURL=InteractionConfig.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InteractionConfig.d.ts","sourceRoot":"","sources":["../../../../../../src/business/implementation/managers/interaction/config/InteractionConfig.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,QAAQ,EAAE,YAAY,CAAC;IACvB,aAAa,EAAE,aAAa,CAAC;IAC7B,aAAa,EAAE,aAAa,CAAC;IAC7B,eAAe,EAAE,eAAe,CAAC;IACjC,aAAa,EAAE,qBAAqB,CAAC;CACrC;AAED;;GAEG;AACH,oBAAY,YAAY;IACvB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,MAAM,WAAW;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,0EAA0E;IAC1E,kBAAkB,EA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MAAM,CAAC,mBAAmB,IAAI,iBAAiB;IAoC/C,MAAM,CAAC,kBAAkB,IAAI,iBAAiB;IAoC9C,MAAM,CAAC,kBAAkB,IAAI,iBAAiB;IAoB9C,MAAM,CAAC,gBAAgB,IAAI,iBAAiB;IAQ5C;;OAEG;IACH,MAAM,CAAC,qBAAqB,IAAI,iBAAiB;IAgBjD;;OAEG;IACH,MAAM,CAAC,WAAW,CACjB,UAAU,EAAE,iBAAiB,EAC7B,YAAY,EAAE,OAAO,CAAC,iBAAiB,CAAC,GACtC,iBAAiB;CA0BpB;AAED;;GAEG;AACH,qBAAa,wBAAwB;IACpC,OAAO,CAAC,MAAM,CAAoB;IAClC,OAAO,CAAC,SAAS,CAAkD;gBAEvD,aAAa,CAAC,EAAE,iBAAiB;IAK7C,SAAS,IAAI,iBAAiB;IAI9B,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,IAAI;IAQzD,WAAW,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI;IAwBzC,WAAW,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,GAAG,IAAI;IAIhE,cAAc,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,GAAG,IAAI;IAOnE,OAAO,CAAC,eAAe;IAIvB;;OAEG;IACH,mBAAmB,IAAI,IAAI;IAkB3B;;OAEG;IACH,cAAc,IAAI,OAAO;IASzB;;OAEG;IACH,eAAe,IAAI,OAAO;CAM1B"}
|
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InteractionConfigManager = exports.InteractionConfigFactory = exports.MouseAction = exports.PlatformType = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Platform types
|
|
6
|
-
*/
|
|
7
|
-
var PlatformType;
|
|
8
|
-
(function (PlatformType) {
|
|
9
|
-
PlatformType["AUTO"] = "auto";
|
|
10
|
-
PlatformType["DESKTOP"] = "desktop";
|
|
11
|
-
PlatformType["MOBILE"] = "mobile";
|
|
12
|
-
PlatformType["TABLET"] = "tablet";
|
|
13
|
-
})(PlatformType = exports.PlatformType || (exports.PlatformType = {}));
|
|
14
|
-
/**
|
|
15
|
-
* Mouse action types
|
|
16
|
-
*/
|
|
17
|
-
var MouseAction;
|
|
18
|
-
(function (MouseAction) {
|
|
19
|
-
MouseAction["SELECT"] = "select";
|
|
20
|
-
MouseAction["CONTEXT_MENU"] = "context_menu";
|
|
21
|
-
MouseAction["INSERT"] = "insert";
|
|
22
|
-
MouseAction["DELETE"] = "delete";
|
|
23
|
-
MouseAction["PAN_CAMERA"] = "pan_camera";
|
|
24
|
-
MouseAction["NONE"] = "none";
|
|
25
|
-
})(MouseAction = exports.MouseAction || (exports.MouseAction = {}));
|
|
26
|
-
/**
|
|
27
|
-
* Default configurations for different platforms
|
|
28
|
-
*/
|
|
29
|
-
class InteractionConfigFactory {
|
|
30
|
-
static createDesktopConfig() {
|
|
31
|
-
return {
|
|
32
|
-
platform: PlatformType.DESKTOP,
|
|
33
|
-
touchSettings: {
|
|
34
|
-
minTouchTargetSize: 20,
|
|
35
|
-
tapThreshold: 10,
|
|
36
|
-
longPressDuration: 500,
|
|
37
|
-
tapMovementThreshold: 10,
|
|
38
|
-
doubleTapInterval: 300,
|
|
39
|
-
enableHapticFeedback: false,
|
|
40
|
-
hapticPattern: [50],
|
|
41
|
-
},
|
|
42
|
-
mouseSettings: {
|
|
43
|
-
clickThreshold: 5,
|
|
44
|
-
enableContextMenu: true,
|
|
45
|
-
buttonBindings: {
|
|
46
|
-
primary: MouseAction.SELECT,
|
|
47
|
-
secondary: MouseAction.CONTEXT_MENU,
|
|
48
|
-
auxiliary: MouseAction.PAN_CAMERA,
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
gestureSettings: {
|
|
52
|
-
enableMultiTouch: false,
|
|
53
|
-
confidenceThreshold: 0.8,
|
|
54
|
-
gestureTimeout: 500,
|
|
55
|
-
allowSimultaneousGestures: false,
|
|
56
|
-
},
|
|
57
|
-
accessibility: {
|
|
58
|
-
largeTargets: false,
|
|
59
|
-
highContrast: false,
|
|
60
|
-
reduceMotion: false,
|
|
61
|
-
voiceControlEnabled: false,
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
static createMobileConfig() {
|
|
66
|
-
return {
|
|
67
|
-
platform: PlatformType.MOBILE,
|
|
68
|
-
touchSettings: {
|
|
69
|
-
minTouchTargetSize: 44,
|
|
70
|
-
tapThreshold: 20,
|
|
71
|
-
longPressDuration: 500,
|
|
72
|
-
tapMovementThreshold: 15,
|
|
73
|
-
doubleTapInterval: 300,
|
|
74
|
-
enableHapticFeedback: true,
|
|
75
|
-
hapticPattern: [50, 50, 50],
|
|
76
|
-
},
|
|
77
|
-
mouseSettings: {
|
|
78
|
-
clickThreshold: 10,
|
|
79
|
-
enableContextMenu: false,
|
|
80
|
-
buttonBindings: {
|
|
81
|
-
primary: MouseAction.SELECT,
|
|
82
|
-
secondary: MouseAction.NONE,
|
|
83
|
-
auxiliary: MouseAction.NONE,
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
gestureSettings: {
|
|
87
|
-
enableMultiTouch: true,
|
|
88
|
-
confidenceThreshold: 0.7,
|
|
89
|
-
gestureTimeout: 800,
|
|
90
|
-
allowSimultaneousGestures: true,
|
|
91
|
-
},
|
|
92
|
-
accessibility: {
|
|
93
|
-
largeTargets: true,
|
|
94
|
-
highContrast: false,
|
|
95
|
-
reduceMotion: false,
|
|
96
|
-
voiceControlEnabled: true,
|
|
97
|
-
},
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
static createTabletConfig() {
|
|
101
|
-
// Hybrid approach between desktop and mobile
|
|
102
|
-
const mobileConfig = this.createMobileConfig();
|
|
103
|
-
const desktopConfig = this.createDesktopConfig();
|
|
104
|
-
return Object.assign(Object.assign({}, mobileConfig), { platform: PlatformType.TABLET, touchSettings: Object.assign(Object.assign({}, mobileConfig.touchSettings), { minTouchTargetSize: 36, tapThreshold: 15 }), mouseSettings: Object.assign(Object.assign({}, desktopConfig.mouseSettings), { enableContextMenu: true }) });
|
|
105
|
-
}
|
|
106
|
-
static createAutoConfig() {
|
|
107
|
-
// Start with desktop config and auto-detect
|
|
108
|
-
return Object.assign(Object.assign({}, this.createDesktopConfig()), { platform: PlatformType.AUTO });
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Create config based on device characteristics
|
|
112
|
-
*/
|
|
113
|
-
static createConfigForDevice() {
|
|
114
|
-
// Simple device detection
|
|
115
|
-
const isTouchDevice = "ontouchstart" in window || navigator.maxTouchPoints > 0;
|
|
116
|
-
const isSmallScreen = window.innerWidth < 768;
|
|
117
|
-
const isLargeScreen = window.innerWidth > 1024;
|
|
118
|
-
if (isTouchDevice && isSmallScreen) {
|
|
119
|
-
return this.createMobileConfig();
|
|
120
|
-
}
|
|
121
|
-
else if (isTouchDevice && !isSmallScreen) {
|
|
122
|
-
return this.createTabletConfig();
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
return this.createDesktopConfig();
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Merge custom config with defaults
|
|
130
|
-
*/
|
|
131
|
-
static mergeConfig(baseConfig, customConfig) {
|
|
132
|
-
var _a;
|
|
133
|
-
return Object.assign(Object.assign(Object.assign({}, baseConfig), customConfig), { touchSettings: Object.assign(Object.assign({}, baseConfig.touchSettings), customConfig.touchSettings), mouseSettings: Object.assign(Object.assign(Object.assign({}, baseConfig.mouseSettings), customConfig.mouseSettings), { buttonBindings: Object.assign(Object.assign({}, baseConfig.mouseSettings.buttonBindings), (_a = customConfig.mouseSettings) === null || _a === void 0 ? void 0 : _a.buttonBindings) }), gestureSettings: Object.assign(Object.assign({}, baseConfig.gestureSettings), customConfig.gestureSettings), accessibility: Object.assign(Object.assign({}, baseConfig.accessibility), customConfig.accessibility) });
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
exports.InteractionConfigFactory = InteractionConfigFactory;
|
|
137
|
-
/**
|
|
138
|
-
* Configuration manager for interaction settings
|
|
139
|
-
*/
|
|
140
|
-
class InteractionConfigManager {
|
|
141
|
-
constructor(initialConfig) {
|
|
142
|
-
this.listeners = [];
|
|
143
|
-
this.config =
|
|
144
|
-
initialConfig || InteractionConfigFactory.createConfigForDevice();
|
|
145
|
-
}
|
|
146
|
-
getConfig() {
|
|
147
|
-
return this.config;
|
|
148
|
-
}
|
|
149
|
-
updateConfig(newConfig) {
|
|
150
|
-
this.config = InteractionConfigFactory.mergeConfig(this.config, newConfig);
|
|
151
|
-
this.notifyListeners();
|
|
152
|
-
}
|
|
153
|
-
setPlatform(platform) {
|
|
154
|
-
let newConfig;
|
|
155
|
-
switch (platform) {
|
|
156
|
-
case PlatformType.DESKTOP:
|
|
157
|
-
newConfig = InteractionConfigFactory.createDesktopConfig();
|
|
158
|
-
break;
|
|
159
|
-
case PlatformType.MOBILE:
|
|
160
|
-
newConfig = InteractionConfigFactory.createMobileConfig();
|
|
161
|
-
break;
|
|
162
|
-
case PlatformType.TABLET:
|
|
163
|
-
newConfig = InteractionConfigFactory.createTabletConfig();
|
|
164
|
-
break;
|
|
165
|
-
case PlatformType.AUTO:
|
|
166
|
-
newConfig = InteractionConfigFactory.createConfigForDevice();
|
|
167
|
-
break;
|
|
168
|
-
default:
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
this.config = newConfig;
|
|
172
|
-
this.notifyListeners();
|
|
173
|
-
}
|
|
174
|
-
addListener(listener) {
|
|
175
|
-
this.listeners.push(listener);
|
|
176
|
-
}
|
|
177
|
-
removeListener(listener) {
|
|
178
|
-
const index = this.listeners.indexOf(listener);
|
|
179
|
-
if (index > -1) {
|
|
180
|
-
this.listeners.splice(index, 1);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
notifyListeners() {
|
|
184
|
-
this.listeners.forEach((listener) => listener(this.config));
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Enable accessibility mode
|
|
188
|
-
*/
|
|
189
|
-
enableAccessibility() {
|
|
190
|
-
this.updateConfig({
|
|
191
|
-
accessibility: {
|
|
192
|
-
largeTargets: true,
|
|
193
|
-
highContrast: true,
|
|
194
|
-
reduceMotion: true,
|
|
195
|
-
voiceControlEnabled: true,
|
|
196
|
-
},
|
|
197
|
-
touchSettings: Object.assign(Object.assign({}, this.config.touchSettings), { minTouchTargetSize: Math.max(this.config.touchSettings.minTouchTargetSize, 44) }),
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Check if current platform supports touch
|
|
202
|
-
*/
|
|
203
|
-
isTouchEnabled() {
|
|
204
|
-
return (this.config.platform === PlatformType.MOBILE ||
|
|
205
|
-
this.config.platform === PlatformType.TABLET ||
|
|
206
|
-
(this.config.platform === PlatformType.AUTO &&
|
|
207
|
-
"ontouchstart" in window));
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Check if haptic feedback is available and enabled
|
|
211
|
-
*/
|
|
212
|
-
isHapticEnabled() {
|
|
213
|
-
return (this.config.touchSettings.enableHapticFeedback &&
|
|
214
|
-
"vibrate" in navigator);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
exports.InteractionConfigManager = InteractionConfigManager;
|
|
218
|
-
//# sourceMappingURL=InteractionConfig.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InteractionConfig.js","sourceRoot":"","sources":["../../../../../../src/business/implementation/managers/interaction/config/InteractionConfig.ts"],"names":[],"mappings":";;;AAWA;;GAEG;AACH,IAAY,YAKX;AALD,WAAY,YAAY;IACvB,6BAAa,CAAA;IACb,mCAAmB,CAAA;IACnB,iCAAiB,CAAA;IACjB,iCAAiB,CAAA;AAClB,CAAC,EALW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAKvB;AAgFD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,EAAE,IAAI;gBAClB,YAAY,EAAE,IAAI;gBAClB,mBAAmB,EAAE,IAAI;aACzB;YACD,aAAa,kCACT,IAAI,CAAC,MAAM,CAAC,aAAa,KAC5B,kBAAkB,EAAE,IAAI,CAAC,GAAG,CAC3B,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,kBAAkB,EAC5C,EAAE,CACF,GACD;SACD,CAAC,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,cAAc;QACb,OAAO,CACN,IAAI,CAAC,MAAM,CAAC,QAAQ,KAAK,YAAY,CAAC,MAAM;YAC5C,IAAI,CAAC,MAAM,CAAC,QAAQ,KAAK,YAAY,CAAC,MAAM;YAC5C,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,KAAK,YAAY,CAAC,IAAI;gBAC1C,cAAc,IAAI,MAAM,CAAC,CAC1B,CAAC;IACH,CAAC;IAED;;OAEG;IACH,eAAe;QACd,OAAO,CACN,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,oBAAoB;YAC9C,SAAS,IAAI,SAAS,CACtB,CAAC;IACH,CAAC;CACD;AAtGD,4DAsGC"}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base interface for gesture recognition
|
|
3
|
-
*/
|
|
4
|
-
export interface IGestureRecognizer {
|
|
5
|
-
/**
|
|
6
|
-
* Process a pointer event and determine if it matches this gesture
|
|
7
|
-
*/
|
|
8
|
-
processEvent(event: PointerEvent): GestureResult;
|
|
9
|
-
/**
|
|
10
|
-
* Reset the gesture recognizer state
|
|
11
|
-
*/
|
|
12
|
-
reset(): void;
|
|
13
|
-
/**
|
|
14
|
-
* Get the current gesture state
|
|
15
|
-
*/
|
|
16
|
-
getState(): GestureState;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Result of gesture processing
|
|
20
|
-
*/
|
|
21
|
-
export interface GestureResult {
|
|
22
|
-
recognized: boolean;
|
|
23
|
-
gesture?: GestureType;
|
|
24
|
-
confidence?: number;
|
|
25
|
-
data?: any;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Types of gestures that can be recognized
|
|
29
|
-
*/
|
|
30
|
-
export declare enum GestureType {
|
|
31
|
-
TAP = "tap",
|
|
32
|
-
DOUBLE_TAP = "double_tap",
|
|
33
|
-
LONG_PRESS = "long_press",
|
|
34
|
-
DRAG = "drag",
|
|
35
|
-
SWIPE = "swipe",
|
|
36
|
-
PINCH = "pinch",
|
|
37
|
-
ROTATE = "rotate"
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* State of gesture recognition
|
|
41
|
-
*/
|
|
42
|
-
export declare enum GestureState {
|
|
43
|
-
IDLE = "idle",
|
|
44
|
-
POSSIBLE = "possible",
|
|
45
|
-
BEGAN = "began",
|
|
46
|
-
CHANGED = "changed",
|
|
47
|
-
ENDED = "ended",
|
|
48
|
-
CANCELLED = "cancelled",
|
|
49
|
-
FAILED = "failed"
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Tap gesture recognizer
|
|
53
|
-
*/
|
|
54
|
-
export declare class TapGestureRecognizer implements IGestureRecognizer {
|
|
55
|
-
private state;
|
|
56
|
-
private startTime;
|
|
57
|
-
private startPosition;
|
|
58
|
-
private tapCount;
|
|
59
|
-
private lastTapTime;
|
|
60
|
-
private readonly MAX_TAP_DURATION;
|
|
61
|
-
private readonly MAX_TAP_DISTANCE;
|
|
62
|
-
private readonly DOUBLE_TAP_INTERVAL;
|
|
63
|
-
processEvent(event: PointerEvent): GestureResult;
|
|
64
|
-
reset(): void;
|
|
65
|
-
getState(): GestureState;
|
|
66
|
-
private handlePointerDown;
|
|
67
|
-
private handlePointerMove;
|
|
68
|
-
private handlePointerUp;
|
|
69
|
-
private getDistance;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Long press gesture recognizer
|
|
73
|
-
*/
|
|
74
|
-
export declare class LongPressGestureRecognizer implements IGestureRecognizer {
|
|
75
|
-
private state;
|
|
76
|
-
private startTime;
|
|
77
|
-
private startPosition;
|
|
78
|
-
private timer?;
|
|
79
|
-
private readonly LONG_PRESS_DURATION;
|
|
80
|
-
private readonly MAX_MOVEMENT_DISTANCE;
|
|
81
|
-
processEvent(event: PointerEvent): GestureResult;
|
|
82
|
-
reset(): void;
|
|
83
|
-
getState(): GestureState;
|
|
84
|
-
private handlePointerDown;
|
|
85
|
-
private handlePointerMove;
|
|
86
|
-
private handlePointerEnd;
|
|
87
|
-
private getDistance;
|
|
88
|
-
private clearTimer;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Drag gesture recognizer
|
|
92
|
-
*/
|
|
93
|
-
export declare class DragGestureRecognizer implements IGestureRecognizer {
|
|
94
|
-
private state;
|
|
95
|
-
private startPosition;
|
|
96
|
-
private currentPosition;
|
|
97
|
-
private readonly MIN_DRAG_DISTANCE;
|
|
98
|
-
processEvent(event: PointerEvent): GestureResult;
|
|
99
|
-
reset(): void;
|
|
100
|
-
getState(): GestureState;
|
|
101
|
-
private handlePointerDown;
|
|
102
|
-
private handlePointerMove;
|
|
103
|
-
private handlePointerEnd;
|
|
104
|
-
private getTotalDistance;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Gesture manager that coordinates multiple recognizers
|
|
108
|
-
*/
|
|
109
|
-
export declare class GestureManager {
|
|
110
|
-
private recognizers;
|
|
111
|
-
private activeGestures;
|
|
112
|
-
addRecognizer(recognizer: IGestureRecognizer): void;
|
|
113
|
-
removeRecognizer(recognizer: IGestureRecognizer): void;
|
|
114
|
-
processEvent(event: PointerEvent): GestureResult[];
|
|
115
|
-
reset(): void;
|
|
116
|
-
isGestureActive(gesture: GestureType): boolean;
|
|
117
|
-
}
|
|
118
|
-
//# sourceMappingURL=GestureRecognition.d.ts.map
|